From e54cbfa01f23f065b68fb9502a393d98d6ec6af2 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 6 Nov 2026 04:08:49 +0000 Subject: pirc-extension 0.1.9-dev+c08d7338dad8 --- pi-parts.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pi-parts.js (limited to 'pi-parts.js') 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 }; +} -- cgit v1.2.3