/** * Keeps the bundled phi extensions, agents and skills copied into the agent dir * in sync with the installed package version. * * They are installed by `scripts/postinstall.cjs`, which does NOT run for * `phi update` (it installs with `--ignore-scripts`) nor for the documented * `npm install -g --ignore-scripts` install. Without this check an update left * the previous version's extensions in place, so their fixes never shipped. * * The standalone Bun binary never runs postinstall either, and has no node to * run it with: process.execPath is the phi executable itself. Its archive stages * extensions/phi, agents, skills and the extensions' npm dependencies next to the * executable (scripts/build-binaries.sh), and the binary copies them in-process. */ /** Written by scripts/postinstall.cjs once the copy succeeded. */ export declare const BUNDLED_ASSETS_STAMP = ".bundled-assets-version"; /** Held (proper-lockfile directory) while one process re-syncs the agent dir; others wait for it. */ export declare const BUNDLED_ASSETS_LOCK = ".bundled-assets.lock"; /** * Non phi-internal npm packages the bundled extensions import (typebox and * phi-code* resolve through the loader's virtual modules). Keep in sync with * `extensionDeps` in scripts/postinstall.cjs and EXTENSION_DEPS in * scripts/build-binaries.sh. */ export declare const BUNDLED_EXTENSION_DEPS: readonly ["sigma-memory", "sigma-agents", "sigma-skills", "zod", "@modelcontextprotocol/sdk", "@ast-grep/napi", "cross-spawn", "ignore", "@phi-code-admin/browser"]; export declare function readBundledAssetsStamp(agentDir?: string): string | undefined; /** * True when a dependency entry exists in /extensions/node_modules but its * package.json cannot be reached: a link left dangling when npm moved or removed the * package (update, dedupe, other Node prefix). Entries that were never created are fine. */ export declare function hasBrokenExtensionLink(agentDir?: string): boolean; /** * Re-run the postinstall copy when the stamp does not match this version or when an * extension dependency link no longer resolves. One process syncs at a time; the others * wait for it and skip their own run once the agent dir is up to date. * Best effort: never throws, never blocks startup on failure. */ export declare function syncBundledAssetsIfStale(): void; /** * In-process equivalent of postinstall steps 1, 2 and 5 for the Bun binary: * copy extensions/phi, agents and skills from the archive into the agent dir, * link the extensions' npm dependencies shipped in /node_modules, then * write the version stamp. The stamp is only written when every copy succeeded, * so a partial failure is retried on the next start. */ export declare function syncBundledAssetsFromBinaryDir(packageDir: string, agentDir: string): void; //# sourceMappingURL=bundled-assets.d.ts.map