aboutsummaryrefslogtreecommitdiff
path: root/pi-parts.js
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-11-06 04:08:49 +0000
committerIgor Soarez <igor@soarez.org>2026-11-06 04:08:49 +0000
commite54cbfa01f23f065b68fb9502a393d98d6ec6af2 (patch)
tree69612826d2cc115c0c66308a1459be634fc1ae33 /pi-parts.js
parente7329a8ea08bc252a57b1adad2be534174ff59ef (diff)
pirc-extension 0.1.9-dev+c08d7338dad8
Diffstat (limited to 'pi-parts.js')
-rw-r--r--pi-parts.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/pi-parts.js b/pi-parts.js
new file mode 100644
index 0000000..293db20
--- /dev/null
+++ b/pi-parts.js
@@ -0,0 +1,13 @@
+// The published extension's first entry, before loader.js: what the bundle
+// cannot import of pi, left for it on globalThis (docs/design.md, section
+// 8). pi's loader resolves pi's packages for a file with a static import of
+// one, as here, but not for the bundle, which Node imports. These are pi-tui
+// and pi's conversion to PNG, the very modules pi draws with; whole modules,
+// so that a name one lacks fails nothing. Set in the factory, which pi runs
+// at every load, /reload included.
+import * as piCodingAgent from "@earendil-works/pi-coding-agent";
+import * as piTui from "@earendil-works/pi-tui";
+
+export default function () {
+ globalThis[Symbol.for("pirc.piParts")] = { tui: piTui, convertToPng: piCodingAgent.convertToPng };
+}