/** * The Pi extension artifact OpenLore installs, and the rules for replacing it. * * Pi loads `.pi/extensions/*.js` (project) or `~/.pi/agent/extensions/*.js` * (global) through jiti. The compiled extension at `/dist/pi/extension.js` * is plain `tsc` output, NOT a bundle: it still imports `../cli/commands/…` and * `../core/services/…` relative to its own location. Copying that file into * `.pi/extensions/` therefore produces an extension that throws * `Cannot find module '../cli/commands/orient-inject-render.js'` the moment Pi * loads it. * * So we install a one-line re-export shim instead: Pi loads the shim, the shim * pulls the real module from inside the openlore package, and every relative * import resolves where it was compiled to resolve. Pi's own loader aliases the * `@earendil-works/*` and `typebox` specifiers, so those resolve regardless of * where the module sits on disk. */ /** Project-relative destination, and the legacy `.ts` name older versions wrote. */ export declare const PI_EXTENSION_REL: string; export declare const PI_EXTENSION_LEGACY_REL: string; /** Absolute path of the compiled extension inside the installed package. */ export declare const PI_EXTENSION_SOURCE: string; /** * The shim we write. The absolute path binds this project to the openlore * package that installed it — re-run install after moving or reinstalling * openlore, or use `pi install npm:openlore` for a location-independent wiring. */ export declare function renderPiShim(sourcePath?: string): string; export type PiFileState = /** Nothing at the destination. */ { kind: 'absent'; } /** Our shim, untouched, already pointing at `sourcePath`. */ | { kind: 'current'; } /** Our shim, untouched, but pointing somewhere else (openlore moved/upgraded). */ | { kind: 'stale'; } /** A copy of the compiled bundle (any version) — what older `openlore setup --tools pi` wrote. */ | { kind: 'legacy-copy'; } /** Our shim with edits inside it, or a file we did not write. */ | { kind: 'foreign'; }; /** * Classify what is already at the destination, so the broken artifact older * versions installed is replaced without demanding `--force` while a genuinely * hand-written `openlore.js` is not. Our own shim is recognised by its * fingerprint; a copied bundle by the signatures in `looksLikeCopiedPiBundle`. */ export declare function classifyPiFile(existing: string | null, expected: string): PiFileState; export declare function looksLikeCopiedPiBundle(content: string): boolean; /** * Is this file one OpenLore wrote? Older versions installed `openlore.ts`, whose * content no longer ships, so byte-equality is impossible — we require our own * shim marker, the exact header that `openlore.ts` carried, or the artifact * signatures in `looksLikeCopiedPiBundle`. * * Deliberately NOT "mentions OpenLore": a hand-written extension that calls * `openlore_orient` or reads `.openlore/serve.json` integrates with OpenLore, it * is not owned by it. Anything ambiguous is left in place with a warning. */ export declare function looksLikeOpenLoreExtension(content: string): boolean; export declare function readPiSource(): Promise; //# sourceMappingURL=pi-extension.d.ts.map