pi2dsh 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +46 -2
  2. package/README.zh.md +26 -0
  3. package/dist/{analyzer-DLwDZoYB.mjs → analyzer-BL7Nfvko.mjs} +2 -2
  4. package/dist/{analyzer-DLwDZoYB.mjs.map → analyzer-BL7Nfvko.mjs.map} +1 -1
  5. package/dist/cli.mjs +3 -2
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/compat/pi-coding-agent.d.mts +2 -2
  8. package/dist/compat/pi-coding-agent.mjs +2 -2
  9. package/dist/{mcp-config-CyCPWeUs.mjs → compatibility-D_PV1zgF.mjs} +10 -187
  10. package/dist/compatibility-D_PV1zgF.mjs.map +1 -0
  11. package/dist/credentials-oauth.mjs +1 -1
  12. package/dist/host.d.mts +9 -2
  13. package/dist/host.d.mts.map +1 -1
  14. package/dist/host.mjs +7 -2
  15. package/dist/host.mjs.map +1 -1
  16. package/dist/index.d.mts +8 -0
  17. package/dist/index.d.mts.map +1 -1
  18. package/dist/index.mjs +154 -8
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/mcp-config-C1K-IzzB.mjs +180 -0
  21. package/dist/mcp-config-C1K-IzzB.mjs.map +1 -0
  22. package/dist/{pi-coding-agent-DXJ_Jzo0.mjs → pi-coding-agent-CPXFo0UO.mjs} +0 -0
  23. package/dist/pi-coding-agent-CPXFo0UO.mjs.map +1 -0
  24. package/dist/{pi-coding-agent-69yY0ke-.d.mts → pi-coding-agent-Pvy0m9tS.d.mts} +6 -2
  25. package/dist/{pi-coding-agent-69yY0ke-.d.mts.map → pi-coding-agent-Pvy0m9tS.d.mts.map} +1 -1
  26. package/dist/{runtime-CW52OWvW.mjs → runtime-CBZcd1uU.mjs} +476 -18
  27. package/dist/runtime-CBZcd1uU.mjs.map +1 -0
  28. package/dist/runtime.d.mts +66 -40
  29. package/dist/runtime.d.mts.map +1 -1
  30. package/dist/runtime.mjs +2 -2
  31. package/package.json +7 -2
  32. package/dist/mcp-config-CyCPWeUs.mjs.map +0 -1
  33. package/dist/pi-coding-agent-DXJ_Jzo0.mjs.map +0 -1
  34. package/dist/runtime-CW52OWvW.mjs.map +0 -1
package/README.md CHANGED
@@ -82,6 +82,36 @@ Two installer messages worth knowing:
82
82
 
83
83
  Requires Node.js 22.19+ and DeepSeek Harness.
84
84
 
85
+ ### Engine configuration
86
+
87
+ The engine reads one `config` block from its plugin row. Today it takes a
88
+ single opt-in:
89
+
90
+ ```yaml
91
+ # $DSH_HOME/profiles/<profile>/cordis.patch.yml
92
+ - id: pi2dsh
93
+ config:
94
+ serveNativeSubagents: true
95
+ ```
96
+
97
+ `serveNativeSubagents` (default: **off**) serves DSH-native subagents with
98
+ the profile's Pi packages. With it on, a child agent DSH spawns through its
99
+ own subagent delegation (one whose session carries the subagent origin)
100
+ receives every discovered Pi package mounted on its own agent scope — the
101
+ package's tools, commands and prompt sections appear for that child only,
102
+ and every contribution unwinds when the child ends. With it off, such
103
+ children run as plain DSH agents, exactly as before.
104
+
105
+ The mount is guaranteed for the child's **first** turn: prompt assembly and
106
+ tool execution wait for it, so even a child that runs a single turn sees the
107
+ full tool set. Each child is served exactly once, whichever path DSH created
108
+ it through — children the agent registry reports as runtime roots are served
109
+ by the engine's root mount path, and the subagent path serves the rest; the
110
+ two never overlap. Pi subagent-bridge children are unaffected either way:
111
+ they already receive the creator package's own per-spawn loader mount, and
112
+ the bridge recognizes them by the `pi2dsh-sub-` session-id prefix (stable
113
+ across a persisted resume), so no child is ever mounted twice.
114
+
85
115
  ## Walkthrough: advanced MCP in your terminal
86
116
 
87
117
  The clearest example of what the bridge buys you. dsh-TUI ships a native
@@ -100,6 +130,19 @@ dsh plugin --profile dsh-tui add pi2dsh
100
130
  dsh plugin --profile dsh-tui add pi-mcp-adapter
101
131
  ```
102
132
 
133
+ Or use the same unmodified Pi packages in dsh-pi-tui:
134
+
135
+ ```sh
136
+ dsh plugin --profile pi-tui add @xmoon76/dsh-pi-tui
137
+ dsh plugin --profile pi-tui add pi2dsh pi-mcp-adapter @tintinweb/pi-subagents
138
+ dsh --profile pi-tui
139
+ ```
140
+
141
+ That composition keeps dsh-pi-tui's native `/login` and projects Pi OAuth
142
+ flows into it, mounts the original MCP manager through the public
143
+ `piTuiExtensions` surface, and exposes the original Pi subagent flow at
144
+ `/agents`. See [`examples/pi-tui-ecosystem`](examples/pi-tui-ecosystem/).
145
+
103
146
  Then restart `dsh` — plugins mount at startup.
104
147
 
105
148
  ### 2. Configure your MCP servers
@@ -157,8 +200,8 @@ it work. **This is the list to trust.**
157
200
  | [`@crazygit/pi-codex-image-gen`](https://www.npmjs.com/package/@crazygit/pi-codex-image-gen) | ChatGPT/Codex OAuth → `gpt-image-2` generation; local reference-image upload through DSH approval; image edit; native attachment storage and inline Web rendering | CLI + web | [`codex-image-gen`](examples/codex-image-gen/) |
158
201
  | [`pi-btw`](https://www.npmjs.com/package/pi-btw) | `/btw <question>` as a real child session in DSH's subagent UI; `/btw-inject`; `/btw --save`; main thread stays clean | CLI + web | [`side-conversation`](examples/side-conversation/) |
159
202
  | [`pi-powerline-footer`](https://www.npmjs.com/package/pi-powerline-footer) | A terminal status line — model, thinking level, project, context usage — drawn into DSH's widget dock, colour included | web | [`presentation-surfaces`](examples/presentation-surfaces/) |
160
- | [`pi-mcp-adapter`](https://www.npmjs.com/package/pi-mcp-adapter) | Full-screen manager in dsh-TUI; stdio/Streamable HTTP/SSE; discovery, direct/proxy/scripted calls, resources, prompts, images, structured content, MCP Apps, approval, elicitation, sampling, cancellation and restart through DSH runtimes; native `/mcp` preserved beside `/pi-mcp` | dsh-TUI | [`tui-mcp`](examples/tui-mcp/) · [evidence matrix](docs/mcp-compatibility.md) |
161
- | [`@tintinweb/pi-subagents`](https://www.npmjs.com/package/@tintinweb/pi-subagents) | The model delegates to autonomous subagents: spawn (with real host-native tools), background + completion notify, mid-run steer, wait-for-result, resume with memory, stop that stays stopped, `/pi-agents` manager, and cross-restart reopen by archive identity — every child a native DSH session | CLI + dsh-TUI | [`subagents`](examples/subagents/) · [acceptance report](community/subagents-acceptance-report.md) |
203
+ | [`pi-mcp-adapter`](https://www.npmjs.com/package/pi-mcp-adapter) | Original full-screen manager; stdio/Streamable HTTP/SSE; discovery, direct/proxy/scripted calls, resources, prompts, images, structured content, MCP Apps, approval, elicitation, sampling, cancellation and restart through DSH runtimes | dsh-TUI + dsh-pi-tui | [`tui-mcp`](examples/tui-mcp/) · [`pi-tui-ecosystem`](examples/pi-tui-ecosystem/) · [evidence matrix](docs/mcp-compatibility.md) |
204
+ | [`@tintinweb/pi-subagents`](https://www.npmjs.com/package/@tintinweb/pi-subagents) | The model delegates to autonomous subagents: spawn (with real host-native tools), background + completion notify, mid-run steer, wait-for-result, resume with memory, stop that stays stopped, interactive manager, and cross-restart reopen by archive identity — every child a native DSH session | CLI + dsh-TUI + dsh-pi-tui | [`subagents`](examples/subagents/) · [`pi-tui-ecosystem`](examples/pi-tui-ecosystem/) · [acceptance report](community/subagents-acceptance-report.md) |
162
205
  | [`pi-provider-alibaba`](https://www.npmjs.com/package/pi-provider-alibaba) | Alibaba Token Plan (CN) with its plan-specific key: live catalog, cold-start dynamic model, complete tool loop and restart. The package also declares Coding/API routes, but each requires its own non-interchangeable credential | CLI + web | [`alibaba-token-plan`](examples/alibaba-token-plan/) |
163
206
  | [`pi-vision-tool`](https://www.npmjs.com/package/pi-vision-tool) | Tool registration through a JSON-Schema shape DSH had to convert (`anyOf` → `oneOf`) | CLI + web | — |
164
207
  | [`pi-approval-guardian`](https://www.npmjs.com/package/pi-approval-guardian) | Every tool call reviewed by a second model before execution; allow and deny both observed | CLI (bare env) | — |
@@ -422,6 +465,7 @@ in one has actually been executed against a real DSH loop before landing.
422
465
  | [`custom-gateways`](examples/custom-gateways/) | Add any OpenAI-compatible gateway the official DSH way, and every Pi plugin sees it |
423
466
  | [`tui-mcp`](examples/tui-mcp/) | Keep dsh-TUI's native `/mcp`, add the Pi ecosystem manager as `/pi-mcp`, and exercise its complete host-influenced MCP surface through DSH runtimes |
424
467
  | [`subagents`](examples/subagents/) | The model runs a small team: delegate, background, steer mid-run, collect, resume with memory, stop for real, manage via `/pi-agents`, reopen across restarts |
468
+ | [`pi-tui-ecosystem`](examples/pi-tui-ecosystem/) | Run the unmodified Pi MCP manager and Pi subagent flow in `@xmoon76/dsh-pi-tui`; native `/login` and Pi OAuth providers coexist without duplicate commands |
425
469
 
426
470
  ## Other tools
427
471
 
package/README.zh.md CHANGED
@@ -70,6 +70,32 @@ Pi 包(每一个都是你显式装的),用同一个桥实例挂载它们
70
70
 
71
71
  需要 Node.js 22.19+ 和 DeepSeek Harness。
72
72
 
73
+ ### 引擎配置
74
+
75
+ 引擎从自己的插件行读一个 `config` 块。目前只有一个 opt-in:
76
+
77
+ ```yaml
78
+ # $DSH_HOME/profiles/<profile>/cordis.patch.yml
79
+ - id: pi2dsh
80
+ config:
81
+ serveNativeSubagents: true
82
+ ```
83
+
84
+ `serveNativeSubagents`(默认**关**):让 DSH 原生子代理——DSH 自己的
85
+ subagent 委派所创建、会话带 subagent 血统的孩子——拿到 profile 里全部已
86
+ 发现的 Pi 包,挂在孩子**自己的** agent scope 上:包的 tools/commands/
87
+ prompt 段只对这个孩子可见,孩子结束全部随之卸载。关掉时,这类孩子就是
88
+ 普通 DSH agent,与引入前完全一致。
89
+
90
+ 挂载对孩子的**首轮**有保证:prompt 装配和工具执行都会等挂载落地,只跑
91
+ 一轮的孩子也能看到完整工具集。每个孩子恰好被伺候一次,不管 DSH 从哪条
92
+ 路径创建它——agent registry 报为 runtime root 的孩子由引擎的根挂载路径
93
+ 负责,其余由子代理路径负责,两边永不重叠。Pi 子代理桥
94
+ (`@tintinweb/pi-subagents` 一类包经 subagent bridge 创建的孩子)不受
95
+ 这个开关影响:它们本来就走创建方包自己的 per-spawn loader 挂载,桥用
96
+ `pi2dsh-sub-` 会话 id 前缀认出它们(前缀在持久化 resume 后依然稳定),
97
+ 所以任何孩子都不会被挂两次。
98
+
73
99
  ## 走一遍:终端里的进阶 MCP
74
100
 
75
101
  这个例子最能说明这座桥值什么。dsh-TUI 自带原生的 `/mcp` 命令(DSH 官方 MCP
@@ -1,5 +1,5 @@
1
1
 
2
- import { c as PI_AI_PACKAGES, f as ruleForApi, g as ruleForUiContextProperty, h as ruleForHostImport, l as PI_CODING_AGENT_PACKAGES, m as ruleForEvent, p as ruleForContextProperty, u as PI_TUI_PACKAGES } from "./mcp-config-CyCPWeUs.mjs";
2
+ import { a as PI_AI_PACKAGES, d as ruleForEvent, f as ruleForHostImport, l as ruleForApi, o as PI_CODING_AGENT_PACKAGES, p as ruleForUiContextProperty, s as PI_TUI_PACKAGES, u as ruleForContextProperty } from "./compatibility-D_PV1zgF.mjs";
3
3
  import { builtinModules } from "node:module";
4
4
  import { lstat, readFile, readdir, stat } from "node:fs/promises";
5
5
  import { basename, dirname, extname, join, relative, resolve } from "node:path";
@@ -623,4 +623,4 @@ async function analyzePackage(pkg) {
623
623
  //#endregion
624
624
  export { analyzePackage };
625
625
 
626
- //# sourceMappingURL=analyzer-DLwDZoYB.mjs.map
626
+ //# sourceMappingURL=analyzer-BL7Nfvko.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer-DLwDZoYB.mjs","names":[],"sources":["../src/module-graph.ts","../src/analyzer.ts"],"sourcesContent":["import { builtinModules } from 'node:module'\nimport { lstat, readFile, readdir, stat } from 'node:fs/promises'\nimport { dirname, extname, join, relative, resolve } from 'node:path'\nimport ts from 'typescript'\n\nexport const SCRIPT_EXTENSIONS = new Set(['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs'])\nconst MODULE_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs', '.json']\n\ninterface LocalReference {\n kind: 'module' | 'asset'\n specifier: string\n // A lazy reference is only evaluated when some feature runs, never while the\n // extension entry loads: dynamic import()/require() inside a function body,\n // or worker/data assets spawned on demand. Pi's loader therefore succeeds\n // even when a lazy target is unresolvable; problems on lazy paths surface\n // (identically under Pi and pi2dsh) only if that feature is used.\n lazy: boolean\n}\n\nexport interface LocalClosureIssue {\n file: string\n kind: LocalReference['kind']\n specifier: string\n detail: string\n lazy: boolean\n}\n\nexport interface LocalClosure {\n files: string[]\n // Files whose module-level code executes the moment the extension entry\n // loads (transitive non-lazy module edges from the entries).\n loadTimeFiles: Set<string>\n issues: LocalClosureIssue[]\n}\n\nexport function sourceKind(path: string): ts.ScriptKind {\n if (path.endsWith('.js') || path.endsWith('.mjs') || path.endsWith('.cjs')) return ts.ScriptKind.JS\n if (path.endsWith('.jsx')) return ts.ScriptKind.JSX\n if (path.endsWith('.tsx')) return ts.ScriptKind.TSX\n return ts.ScriptKind.TS\n}\n\nfunction literalModule(node: ts.Expression | undefined): string | undefined {\n return node !== undefined && (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) ? node.text : undefined\n}\n\nfunction isImportMetaUrl(node: ts.Expression | undefined): boolean {\n return node !== undefined && ts.isPropertyAccessExpression(node) && node.name.text === 'url'\n && ts.isMetaProperty(node.expression) && node.expression.keywordToken === ts.SyntaxKind.ImportKeyword\n}\n\nfunction localReferences(path: string, text: string): LocalReference[] {\n const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, sourceKind(path))\n const values = new Map<string, LocalReference>()\n const createRequireNames = new Set<string>(['createRequire'])\n const requireNames = new Set<string>(['require'])\n const add = (kind: LocalReference['kind'], specifier: string, lazy: boolean): void => {\n // '#'-prefixed specifiers are Node subpath imports resolved through the\n // package's own `imports` map — package-local, not external dependencies.\n if (!specifier.startsWith('.') && !specifier.startsWith('#')) return\n const key = `${kind}:${specifier}`\n const existing = values.get(key)\n // A specifier reached both statically and lazily executes at load time.\n if (existing === undefined) values.set(key, { kind, specifier, lazy })\n else if (existing.lazy && !lazy) existing.lazy = false\n }\n function collectRequireAliases(node: ts.Node): void {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)\n && (node.moduleSpecifier.text === 'node:module' || node.moduleSpecifier.text === 'module')\n && node.importClause?.namedBindings !== undefined && ts.isNamedImports(node.importClause.namedBindings)) {\n for (const element of node.importClause.namedBindings.elements) {\n if ((element.propertyName?.text ?? element.name.text) === 'createRequire') createRequireNames.add(element.name.text)\n }\n } else if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)\n && node.initializer !== undefined && ts.isCallExpression(node.initializer)\n && ts.isIdentifier(node.initializer.expression) && createRequireNames.has(node.initializer.expression.text)) {\n requireNames.add(node.name.text)\n }\n ts.forEachChild(node, collectRequireAliases)\n }\n collectRequireAliases(source)\n function visit(node: ts.Node): void {\n if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) && node.moduleSpecifier !== undefined\n && ts.isStringLiteral(node.moduleSpecifier)) {\n add('module', node.moduleSpecifier.text, false)\n } else if (ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)\n && ts.isStringLiteral(node.moduleReference.expression)) {\n add('module', node.moduleReference.expression.text, false)\n } else if (ts.isCallExpression(node) && node.arguments.length > 0\n && ((node.expression.kind === ts.SyntaxKind.ImportKeyword)\n || (ts.isIdentifier(node.expression) && requireNames.has(node.expression.text)))) {\n const specifier = literalModule(node.arguments[0])\n if (specifier !== undefined) add('module', specifier, insideFunctionBody(node))\n } else if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === 'URL'\n && isImportMetaUrl(node.arguments?.[1])) {\n const specifier = literalModule(node.arguments?.[0])\n if (specifier !== undefined) add('asset', specifier, false)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return [...values.values()]\n}\n\nfunction externalPackage(specifier: string): string | undefined {\n // `bun:*` counts as a host builtin, not an npm dependency: Pi's official\n // distribution is a Bun-compiled binary, so ecosystem packages gate these\n // requires behind runtime detection and take their declared Node fallback\n // (better-sqlite3, node:sqlite) everywhere else.\n if (specifier.startsWith('.') || specifier.startsWith('/') || specifier.startsWith('#')\n || specifier.startsWith('node:') || specifier.startsWith('bun:')\n || builtinModules.includes(specifier)) return undefined\n const parts = specifier.split('/')\n return specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]\n}\n\nfunction insideTry(node: ts.Node): boolean {\n let current: ts.Node | undefined = node.parent\n while (current !== undefined) {\n if (ts.isTryStatement(current)) return true\n // Stop at function boundaries: a try in an outer function does not guard\n // an import inside a nested callback executed later.\n if (ts.isFunctionLike(current)) {\n // ...unless the whole function body IS awaited inside the try; keeping\n // this conservative check simple errs toward reporting the dependency.\n return false\n }\n current = current.parent\n }\n return false\n}\n\n// Inside any function body means the expression does not run while the module\n// itself loads — it runs when (if ever) that function is called.\nfunction insideFunctionBody(node: ts.Node): boolean {\n let current: ts.Node | undefined = node.parent\n while (current !== undefined) {\n if (ts.isFunctionLike(current)) return true\n current = current.parent\n }\n return false\n}\n\nexport interface RuntimeDependencyUse {\n name: string\n // true when every use sits on a lazy path (dynamic import/require inside a\n // function body): the module loads fine without the dependency, exactly as\n // under Pi, and only the feature that calls it needs the install.\n lazy: boolean\n}\n\nexport function runtimeExternalPackages(path: string, text: string): RuntimeDependencyUse[] {\n const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, sourceKind(path))\n const packages = new Map<string, RuntimeDependencyUse>()\n const createRequireNames = new Set<string>(['createRequire'])\n const requireNames = new Set<string>(['require'])\n const add = (specifier: string, lazy: boolean): void => {\n const name = externalPackage(specifier)\n if (name === undefined || name.length === 0) return\n const existing = packages.get(name)\n if (existing === undefined) packages.set(name, { name, lazy })\n else if (existing.lazy && !lazy) existing.lazy = false\n }\n function collectRequireAliases(node: ts.Node): void {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)\n && (node.moduleSpecifier.text === 'node:module' || node.moduleSpecifier.text === 'module')\n && node.importClause?.namedBindings !== undefined && ts.isNamedImports(node.importClause.namedBindings)) {\n for (const element of node.importClause.namedBindings.elements) {\n if ((element.propertyName?.text ?? element.name.text) === 'createRequire') createRequireNames.add(element.name.text)\n }\n } else if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)\n && node.initializer !== undefined && ts.isCallExpression(node.initializer)\n && ts.isIdentifier(node.initializer.expression) && createRequireNames.has(node.initializer.expression.text)) {\n requireNames.add(node.name.text)\n }\n ts.forEachChild(node, collectRequireAliases)\n }\n collectRequireAliases(source)\n function visit(node: ts.Node): void {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {\n const clause = node.importClause\n const named = clause?.namedBindings\n const namedImportsAreTypeOnly = named !== undefined && ts.isNamedImports(named)\n && named.elements.length > 0 && named.elements.every(element => element.isTypeOnly)\n if (clause === undefined || (!clause.isTypeOnly && (clause.name !== undefined || !namedImportsAreTypeOnly))) {\n add(node.moduleSpecifier.text, false)\n }\n } else if (ts.isExportDeclaration(node) && !node.isTypeOnly\n && node.moduleSpecifier !== undefined && ts.isStringLiteral(node.moduleSpecifier)) {\n add(node.moduleSpecifier.text, false)\n } else if (ts.isImportEqualsDeclaration(node) && !node.isTypeOnly\n && ts.isExternalModuleReference(node.moduleReference) && ts.isStringLiteral(node.moduleReference.expression)) {\n add(node.moduleReference.expression.text, false)\n } else if (ts.isCallExpression(node) && node.arguments.length > 0\n && ((node.expression.kind === ts.SyntaxKind.ImportKeyword)\n || (ts.isIdentifier(node.expression) && requireNames.has(node.expression.text)))) {\n // A dynamic import/require wrapped in try/catch is the ecosystem's\n // optional-dependency idiom (e.g. pi-harness-runtime's \"// Dynamic\n // import for Playwright (optional dependency)\") — its absence is a\n // designed degradation, not an undeclared runtime requirement.\n if (!insideTry(node)) {\n const specifier = literalModule(node.arguments[0])\n if (specifier !== undefined) add(specifier, insideFunctionBody(node))\n }\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return [...packages.values()]\n}\n\nfunction inside(rootDir: string, path: string): boolean {\n const pathRelative = relative(rootDir, path)\n return pathRelative === '' || (pathRelative !== '..' && !pathRelative.startsWith(`..${process.platform === 'win32' ? '\\\\' : '/'}`))\n}\n\nfunction sourceAlternates(base: string): string[] {\n const extension = extname(base)\n const stem = extension.length > 0 ? base.slice(0, -extension.length) : base\n if (extension === '.js') return [`${stem}.ts`, `${stem}.tsx`]\n if (extension === '.mjs') return [`${stem}.mts`, `${stem}.ts`]\n if (extension === '.cjs') return [`${stem}.cts`, `${stem}.ts`]\n if (extension === '.jsx') return [`${stem}.tsx`, `${stem}.ts`]\n return []\n}\n\nasync function isFile(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile()\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false\n throw error\n }\n}\n\nfunction subpathImportTarget(rootDir: string, specifier: string, importsMap: Record<string, unknown>): string | undefined {\n const conditionValue = (value: unknown): string | undefined => {\n if (typeof value === 'string') return value\n if (typeof value !== 'object' || value === null) return undefined\n const record = value as Record<string, unknown>\n for (const condition of ['import', 'node', 'default']) {\n const candidate = conditionValue(record[condition])\n if (candidate !== undefined) return candidate\n }\n return undefined\n }\n const direct = conditionValue(importsMap[specifier])\n if (direct !== undefined) return resolve(rootDir, direct)\n for (const [pattern, value] of Object.entries(importsMap)) {\n const star = pattern.indexOf('*')\n if (star === -1) continue\n const prefix = pattern.slice(0, star)\n const suffix = pattern.slice(star + 1)\n if (!specifier.startsWith(prefix) || !specifier.endsWith(suffix)) continue\n const wildcard = specifier.slice(prefix.length, specifier.length - suffix.length)\n const target = conditionValue(value)\n if (target !== undefined) return resolve(rootDir, target.replace('*', wildcard))\n }\n return undefined\n}\n\nasync function packageImportsMap(rootDir: string): Promise<Record<string, unknown>> {\n try {\n const parsed = JSON.parse(await readFile(join(rootDir, 'package.json'), 'utf8')) as { imports?: unknown }\n return typeof parsed.imports === 'object' && parsed.imports !== null ? parsed.imports as Record<string, unknown> : {}\n } catch {\n return {}\n }\n}\n\nasync function resolveModule(fromFile: string, specifier: string, rootDir: string, importsMap: Record<string, unknown>): Promise<string> {\n if (specifier.startsWith('#')) {\n const target = subpathImportTarget(rootDir, specifier, importsMap)\n if (target === undefined) {\n throw new Error(`cannot resolve subpath import ${JSON.stringify(specifier)} through the package \"imports\" map`)\n }\n return resolveModule(fromFile, relative(dirname(fromFile), target).startsWith('.')\n ? relative(dirname(fromFile), target)\n : `./${relative(dirname(fromFile), target)}`, rootDir, importsMap)\n }\n const base = resolve(dirname(fromFile), specifier)\n const candidates = [\n base,\n ...sourceAlternates(base),\n ...(extname(base) === '' ? MODULE_EXTENSIONS.map(extension => `${base}${extension}`) : []),\n ...MODULE_EXTENSIONS.map(extension => join(base, `index${extension}`)),\n ]\n for (const candidate of [...new Set(candidates)]) {\n if (!inside(rootDir, candidate)) throw new Error(`extension import escapes the Pi package: ${specifier} from ${fromFile}`)\n if (await isFile(candidate)) return candidate\n }\n throw new Error(`cannot resolve local extension import ${JSON.stringify(specifier)} from ${fromFile}`)\n}\n\nasync function expandAsset(path: string, rootDir: string): Promise<string[]> {\n if (!inside(rootDir, path)) throw new Error(`extension asset escapes the Pi package: ${path}`)\n let info\n try {\n info = await lstat(path)\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n // A `new URL('./worker.js', import.meta.url)` asset may only exist in its\n // TypeScript source form before the package builds; track the source.\n for (const alternate of sourceAlternates(path)) {\n if (await isFile(alternate)) return [alternate]\n }\n throw error\n }\n if (info.isSymbolicLink()) throw new Error(`refusing to copy symbolic link from Pi package: ${path}`)\n if (info.isFile()) return [path]\n if (!info.isDirectory()) return []\n const output: string[] = []\n for (const entry of await readdir(path)) output.push(...await expandAsset(join(path, entry), rootDir))\n return output\n}\n\nexport async function collectLocalClosure(rootDir: string, entries: readonly string[]): Promise<LocalClosure> {\n const importsMap = await packageImportsMap(rootDir)\n const graph = new Map<string, Array<{ lazy: boolean, targets: string[] }>>()\n const issues: LocalClosureIssue[] = []\n const queue = entries.map(path => resolve(path))\n // Pass 1: the full local reference graph, lazy edges included, so the\n // snapshot carries every file any feature could ever load.\n while (queue.length > 0) {\n const source = queue.shift() as string\n if (graph.has(source)) continue\n if (!inside(rootDir, source)) throw new Error(`extension source escapes the Pi package: ${source}`)\n const info = await lstat(source)\n if (info.isSymbolicLink()) throw new Error(`refusing to copy symbolic link from Pi package: ${source}`)\n if (!info.isFile()) throw new Error(`extension closure contains a non-file path: ${source}`)\n const edges: Array<{ lazy: boolean, targets: string[] }> = []\n graph.set(source, edges)\n if (!SCRIPT_EXTENSIONS.has(extname(source))) continue\n const text = await readFile(source, 'utf8')\n for (const reference of localReferences(source, text)) {\n // Worker/data assets never execute while the entry loads; the feature\n // that spawns them does, so their whole subtree is a lazy path.\n const lazy = reference.lazy || reference.kind === 'asset'\n try {\n const targets = reference.kind === 'module'\n ? [await resolveModule(source, reference.specifier, rootDir, importsMap)]\n : await expandAsset(resolve(dirname(source), reference.specifier), rootDir)\n edges.push({ lazy, targets })\n queue.push(...targets)\n } catch (error) {\n issues.push({\n file: source,\n kind: reference.kind,\n specifier: reference.specifier,\n detail: error instanceof Error ? error.message : String(error),\n lazy,\n })\n }\n }\n }\n // Pass 2: load-time reachability across non-lazy module edges only. This is\n // the set whose problems actually break `pi` (and pi2dsh) at extension load;\n // everything else fails at feature-use time, identically under both hosts.\n const loadTimeFiles = new Set<string>()\n const loadQueue = entries.map(path => resolve(path)).filter(path => graph.has(path))\n while (loadQueue.length > 0) {\n const source = loadQueue.shift() as string\n if (loadTimeFiles.has(source)) continue\n loadTimeFiles.add(source)\n for (const edge of graph.get(source) ?? []) {\n if (edge.lazy) continue\n for (const target of edge.targets) {\n if (!loadTimeFiles.has(target)) loadQueue.push(target)\n }\n }\n }\n // An issue found inside a file that itself only loads lazily cannot break\n // extension load either, however the reference is written.\n for (const issue of issues) {\n if (!loadTimeFiles.has(issue.file)) issue.lazy = true\n }\n return { files: [...graph.keys()].sort(), loadTimeFiles, issues }\n}\n","import { readFile } from 'node:fs/promises'\nimport { basename, extname, relative } from 'node:path'\nimport ts from 'typescript'\nimport {\n PI_CODING_AGENT_PACKAGES,\n PI_AI_PACKAGES,\n PI_TUI_PACKAGES,\n ruleForApi,\n ruleForContextProperty,\n ruleForEvent,\n ruleForHostImport,\n ruleForUiContextProperty,\n} from './compatibility.js'\nimport { collectLocalClosure, runtimeExternalPackages, SCRIPT_EXTENSIONS, sourceKind } from './module-graph.js'\nimport type {\n CompatibilityFinding,\n CompatibilityLevel,\n CompatibilityReport,\n ResolvedPiPackage,\n} from './types.js'\n\nfunction literalText(node: ts.Node | undefined): string | undefined {\n return node !== undefined && (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node))\n ? node.text\n : undefined\n}\n\nfunction hasModifier(node: ts.Node, kind: ts.SyntaxKind): boolean {\n return ts.canHaveModifiers(node) && ts.getModifiers(node)?.some(modifier => modifier.kind === kind) === true\n}\n\nfunction parameterIdentifier(node: ts.SignatureDeclarationBase): string | undefined {\n const parameter = node.parameters[0]\n return parameter !== undefined && ts.isIdentifier(parameter.name) ? parameter.name.text : undefined\n}\n\nfunction extensionApiReceivers(source: ts.SourceFile): Set<string> {\n const receivers = new Set<string>()\n const functions = new Map<string, ts.FunctionLikeDeclarationBase>()\n\n function index(node: ts.Node): void {\n if (ts.isFunctionDeclaration(node) && node.name !== undefined) functions.set(node.name.text, node)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)\n && node.initializer !== undefined\n && (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer))) {\n functions.set(node.name.text, node.initializer)\n }\n if (ts.isParameter(node) && node.type !== undefined\n && /(?:^|\\.)ExtensionAPI\\b/u.test(node.type.getText(source)) && ts.isIdentifier(node.name)) {\n receivers.add(node.name.text)\n }\n // Published Pi packages commonly ship JavaScript with type annotations\n // erased. `pi` is the documented ExtensionAPI parameter name throughout\n // the ecosystem, including helper functions reached from the entry point.\n if (ts.isParameter(node) && ts.isIdentifier(node.name)\n && /^(?:pi|extensionApi)$/iu.test(node.name.text)) {\n receivers.add(node.name.text)\n }\n ts.forEachChild(node, index)\n }\n index(source)\n\n for (const statement of source.statements) {\n if (ts.isFunctionDeclaration(statement)\n && hasModifier(statement, ts.SyntaxKind.ExportKeyword)\n && hasModifier(statement, ts.SyntaxKind.DefaultKeyword)) {\n const name = parameterIdentifier(statement)\n if (name !== undefined) receivers.add(name)\n }\n if (ts.isExportAssignment(statement)) {\n const expression = statement.expression\n if (ts.isArrowFunction(expression) || ts.isFunctionExpression(expression)) {\n const name = parameterIdentifier(expression)\n if (name !== undefined) receivers.add(name)\n } else if (ts.isIdentifier(expression)) {\n const candidate = functions.get(expression.text)\n if (candidate !== undefined) {\n const name = parameterIdentifier(candidate)\n if (name !== undefined) receivers.add(name)\n }\n }\n }\n if (ts.isExportDeclaration(statement) && statement.moduleSpecifier === undefined\n && statement.exportClause !== undefined && ts.isNamedExports(statement.exportClause)) {\n for (const element of statement.exportClause.elements) {\n if (element.name.text !== 'default' || element.propertyName === undefined || !ts.isIdentifier(element.propertyName)) continue\n const candidate = functions.get(element.propertyName.text)\n if (candidate !== undefined) {\n const name = parameterIdentifier(candidate)\n if (name !== undefined) receivers.add(name)\n }\n }\n }\n }\n return receivers\n}\n\nfunction extensionApiProperties(source: ts.SourceFile, receivers: ReadonlySet<string>): Set<string> {\n const properties = new Set<string>()\n function visit(node: ts.Node): void {\n if ((ts.isPropertyDeclaration(node) || ts.isParameter(node)) && ts.isIdentifier(node.name)) {\n const typed = node.type !== undefined && /(?:^|\\.)(?:Pi)?ExtensionAPI\\b/u.test(node.type.getText(source))\n if (typed || /^(?:pi|extensionApi)$/iu.test(node.name.text)) properties.add(node.name.text)\n } else if (ts.isBinaryExpression(node) && node.operatorToken.kind === ts.SyntaxKind.EqualsToken\n && ts.isPropertyAccessExpression(node.left) && node.left.expression.kind === ts.SyntaxKind.ThisKeyword\n && ts.isIdentifier(node.right) && receivers.has(node.right.text)) {\n properties.add(node.left.name.text)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return properties\n}\n\nfunction enclosingFunctionName(node: ts.ParameterDeclaration): string | undefined {\n const parent = node.parent\n if (ts.isMethodDeclaration(parent) && parent.name !== undefined) return parent.name.getText()\n if ((ts.isArrowFunction(parent) || ts.isFunctionExpression(parent)) && ts.isPropertyAssignment(parent.parent)) {\n return parent.parent.name.getText()\n }\n return undefined\n}\n\nfunction extensionContextReceivers(source: ts.SourceFile): Set<string> {\n const receivers = new Set<string>()\n function visit(node: ts.Node): void {\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typedContext = node.type !== undefined\n && /(?:^|\\.)(?:Extension|ExtensionCommand|ToolExecution)Context\\b/u.test(node.type.getText(source))\n const conventionalHandlerContext = /^(?:ctx|context)$/iu.test(node.name.text)\n && /^(?:execute|handler)$/u.test(enclosingFunctionName(node) ?? '')\n if (typedContext || conventionalHandlerContext) receivers.add(node.name.text)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return receivers\n}\n\n// The three Pi packages whose named exports the shim audit tracks.\nconst PI_SHIMMED_PACKAGES = new Set<string>([\n ...PI_CODING_AGENT_PACKAGES,\n ...PI_TUI_PACKAGES,\n ...PI_AI_PACKAGES,\n])\n\n// Everything Pi's loader provides to extensions without a declaration —\n// exempt from the undeclared-runtime-dependency fatal, and (for typebox) not\n// subject to per-symbol shim auditing.\nconst PI_HOST_PACKAGES = new Set<string>([\n ...PI_SHIMMED_PACKAGES,\n 'typebox',\n '@sinclair/typebox',\n])\n\nfunction dependencyNames(packageJson: Record<string, unknown>): Set<string> {\n const names = new Set<string>()\n for (const field of ['dependencies', 'optionalDependencies', 'peerDependencies']) {\n const value = packageJson[field]\n if (typeof value !== 'object' || value === null || Array.isArray(value)) continue\n for (const [name, specifier] of Object.entries(value)) {\n if (typeof specifier === 'string') names.add(name)\n }\n }\n return names\n}\n\nfunction pushFinding(\n findings: CompatibilityFinding[],\n rootDir: string,\n file: string,\n source: ts.SourceFile,\n node: ts.Node,\n capability: string,\n level: CompatibilityLevel,\n detail: string,\n): void {\n const position = source.getLineAndCharacterOfPosition(node.getStart(source))\n findings.push({\n capability,\n level,\n file: relative(rootDir, file).replaceAll('\\\\', '/'),\n line: position.line + 1,\n detail,\n })\n}\n\nasync function analyzeExtension(rootDir: string, file: string): Promise<CompatibilityFinding[]> {\n const text = await readFile(file, 'utf8')\n const source = ts.createSourceFile(file, text, ts.ScriptTarget.Latest, true, sourceKind(file))\n const findings: CompatibilityFinding[] = []\n const receivers = extensionApiReceivers(source)\n const apiProperties = extensionApiProperties(source, receivers)\n const contextReceivers = extensionContextReceivers(source)\n const methodAliases = new Map<string, string>()\n const eventBusAliases = new Set<string>()\n const uiAliases = new Set<string>()\n\n function reportHostImport(packageName: string, importedName: string, node: ts.Node): void {\n const matched = ruleForHostImport(packageName, importedName)\n if (matched === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, `host-import(${packageName}:${importedName})`, 'unsupported',\n `The pi2dsh host shim does not export ${JSON.stringify(importedName)} from ${JSON.stringify(packageName)}.`,\n )\n return\n }\n pushFinding(\n findings, rootDir, file, source, node, `host-import(${packageName}:${importedName})`, matched.level, matched.detail,\n )\n }\n\n for (const statement of source.statements) {\n if (ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier)\n && PI_SHIMMED_PACKAGES.has(statement.moduleSpecifier.text)) {\n const packageName = statement.moduleSpecifier.text\n const clause = statement.importClause\n if (clause === undefined) {\n reportHostImport(packageName, '<side-effect>', statement)\n continue\n }\n if (clause.isTypeOnly) continue\n if (clause.name !== undefined) reportHostImport(packageName, 'default', clause.name)\n if (clause.namedBindings !== undefined && ts.isNamespaceImport(clause.namedBindings)) {\n reportHostImport(packageName, '*', clause.namedBindings)\n } else if (clause.namedBindings !== undefined) {\n for (const element of clause.namedBindings.elements) {\n if (!element.isTypeOnly) reportHostImport(packageName, element.propertyName?.text ?? element.name.text, element)\n }\n }\n } else if (ts.isExportDeclaration(statement) && !statement.isTypeOnly\n && statement.moduleSpecifier !== undefined && ts.isStringLiteral(statement.moduleSpecifier)\n && PI_HOST_PACKAGES.has(statement.moduleSpecifier.text)) {\n const packageName = statement.moduleSpecifier.text\n if (statement.exportClause === undefined || ts.isNamespaceExport(statement.exportClause)) {\n reportHostImport(packageName, '*', statement)\n } else {\n for (const element of statement.exportClause.elements) {\n if (!element.isTypeOnly) reportHostImport(packageName, element.propertyName?.text ?? element.name.text, element)\n }\n }\n } else if (ts.isImportEqualsDeclaration(statement) && !statement.isTypeOnly\n && ts.isExternalModuleReference(statement.moduleReference)\n && ts.isStringLiteral(statement.moduleReference.expression)\n && PI_HOST_PACKAGES.has(statement.moduleReference.expression.text)) {\n reportHostImport(statement.moduleReference.expression.text, '*', statement)\n }\n }\n\n const declarations: ts.VariableDeclaration[] = []\n const isApiReceiver = (node: ts.Expression): boolean => ts.isIdentifier(node) && receivers.has(node.text)\n || (ts.isPropertyAccessExpression(node) && node.expression.kind === ts.SyntaxKind.ThisKeyword\n && apiProperties.has(node.name.text))\n function collectDeclarations(node: ts.Node): void {\n if (ts.isVariableDeclaration(node)) declarations.push(node)\n ts.forEachChild(node, collectDeclarations)\n }\n collectDeclarations(source)\n\n for (let pass = 0; pass < declarations.length + 1; pass += 1) {\n let changed = false\n for (const declaration of declarations) {\n const initializer = declaration.initializer\n if (initializer === undefined) continue\n if (ts.isIdentifier(declaration.name) && isApiReceiver(initializer)) {\n if (!receivers.has(declaration.name.text)) {\n receivers.add(declaration.name.text)\n changed = true\n }\n }\n if (ts.isIdentifier(declaration.name) && ts.isIdentifier(initializer) && contextReceivers.has(initializer.text)) {\n if (!contextReceivers.has(declaration.name.text)) {\n contextReceivers.add(declaration.name.text)\n changed = true\n }\n }\n if (ts.isIdentifier(declaration.name) && ts.isPropertyAccessExpression(initializer)\n && initializer.name.text === 'ui' && ts.isIdentifier(initializer.expression)\n && contextReceivers.has(initializer.expression.text) && !uiAliases.has(declaration.name.text)) {\n uiAliases.add(declaration.name.text)\n changed = true\n }\n if (ts.isIdentifier(declaration.name) && ts.isPropertyAccessExpression(initializer)\n && isApiReceiver(initializer.expression)) {\n if (initializer.name.text === 'events') {\n if (!eventBusAliases.has(declaration.name.text)) {\n eventBusAliases.add(declaration.name.text)\n changed = true\n }\n } else if (!methodAliases.has(declaration.name.text)) {\n methodAliases.set(declaration.name.text, initializer.name.text)\n changed = true\n }\n }\n if (ts.isObjectBindingPattern(declaration.name) && isApiReceiver(initializer)) {\n for (const element of declaration.name.elements) {\n if (!ts.isIdentifier(element.name)) continue\n const method = element.propertyName !== undefined && ts.isIdentifier(element.propertyName)\n ? element.propertyName.text\n : element.name.text\n if (method === 'events') {\n if (!eventBusAliases.has(element.name.text)) {\n eventBusAliases.add(element.name.text)\n changed = true\n }\n } else if (!methodAliases.has(element.name.text)) {\n methodAliases.set(element.name.text, method)\n changed = true\n }\n }\n }\n }\n if (!changed) break\n }\n\n function reportMethod(method: string, args: ts.NodeArray<ts.Expression>, node: ts.Node): void {\n if (method === 'on') {\n const event = literalText(args[0])\n if (event === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, 'on(<dynamic>)', 'unsupported',\n 'Dynamic event names cannot be audited or mapped safely.',\n )\n } else {\n const rule = ruleForEvent(event)\n pushFinding(findings, rootDir, file, source, node, `on(${event})`, rule.level, rule.detail)\n }\n return\n }\n const rule = ruleForApi(method)\n if (rule === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, method, 'unsupported',\n `Unknown ExtensionAPI method ${JSON.stringify(method)} cannot be audited or mapped safely.`,\n )\n return\n }\n pushFinding(findings, rootDir, file, source, node, method, rule.level, rule.detail)\n }\n\n function reportEventBus(method: string, node: ts.Node): void {\n const rule = ruleForApi('events')\n if ((method === 'on' || method === 'emit') && rule !== undefined) {\n pushFinding(findings, rootDir, file, source, node, `events.${method}`, rule.level, rule.detail)\n } else {\n pushFinding(\n findings, rootDir, file, source, node, `events.${method}`, 'unsupported',\n `Unknown Pi event-bus method ${JSON.stringify(method)} cannot be mapped safely.`,\n )\n }\n }\n\n function reportContext(property: string, node: ts.Node): void {\n const matched = ruleForContextProperty(property)\n if (matched === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, `ctx.${property}`, 'unsupported',\n `Unknown Pi extension-context property ${JSON.stringify(property)} cannot be audited or mapped safely.`,\n )\n } else {\n pushFinding(findings, rootDir, file, source, node, `ctx.${property}`, matched.level, matched.detail)\n }\n }\n\n function reportUiContext(property: string, node: ts.Node): void {\n const matched = ruleForUiContextProperty(property)\n if (matched === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, `ctx.ui.${property}`, 'unsupported',\n `Unknown Pi UI-context property ${JSON.stringify(property)} cannot be audited or mapped safely.`,\n )\n } else {\n pushFinding(findings, rootDir, file, source, node, `ctx.ui.${property}`, matched.level, matched.detail)\n }\n }\n\n function visit(node: ts.Node): void {\n if (ts.isCallExpression(node) && ts.isIdentifier(node.expression)) {\n const method = methodAliases.get(node.expression.text)\n if (method !== undefined) reportMethod(method, node.arguments, node)\n } else if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression)) {\n const target = node.expression.expression\n if (isApiReceiver(target)) {\n reportMethod(node.expression.name.text, node.arguments, node)\n } else if (ts.isIdentifier(target) && eventBusAliases.has(target.text)) {\n reportEventBus(node.expression.name.text, node)\n } else if (ts.isPropertyAccessExpression(target)\n && target.name.text === 'events'\n && isApiReceiver(target.expression)) {\n reportEventBus(node.expression.name.text, node)\n }\n } else if (ts.isCallExpression(node) && ts.isElementAccessExpression(node.expression)\n && isApiReceiver(node.expression.expression)) {\n const method = literalText(node.expression.argumentExpression)\n if (method === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, '<dynamic-api-method>', 'unsupported',\n 'Dynamic ExtensionAPI method access cannot be audited or mapped safely.',\n )\n } else {\n reportMethod(method, node.arguments, node)\n }\n }\n if (ts.isPropertyAccessExpression(node)) {\n const target = node.expression\n if (ts.isPropertyAccessExpression(target) && target.name.text === 'ui'\n && ts.isIdentifier(target.expression) && contextReceivers.has(target.expression.text)) {\n reportUiContext(node.name.text, node)\n } else if (ts.isIdentifier(target) && uiAliases.has(target.text)) {\n reportUiContext(node.name.text, node)\n } else if (ts.isIdentifier(target) && contextReceivers.has(target.text) && node.name.text !== 'ui') {\n reportContext(node.name.text, node)\n }\n } else if (ts.isElementAccessExpression(node) && ts.isIdentifier(node.expression)\n && contextReceivers.has(node.expression.text)) {\n const property = literalText(node.argumentExpression)\n if (property === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, 'ctx.<dynamic>', 'unsupported',\n 'Dynamic Pi extension-context access cannot be audited or mapped safely.',\n )\n } else if (property !== 'ui') {\n reportContext(property, node)\n }\n }\n ts.forEachChild(node, visit)\n }\n\n visit(source)\n return findings\n}\n\nexport async function analyzePackage(pkg: ResolvedPiPackage): Promise<CompatibilityReport> {\n const extensionClosure = await collectLocalClosure(pkg.rootDir, pkg.resources.extensions)\n const findings = (await Promise.all(\n extensionClosure.files.filter(file => SCRIPT_EXTENSIONS.has(extname(file)))\n .map(file => analyzeExtension(pkg.rootDir, file)),\n )).flat()\n\n if (pkg.resources.extensions.length > 0 && findings.length === 0) {\n findings.push({\n capability: 'static-audit',\n level: 'unsupported',\n file: pkg.resources.extensions.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')).join(', '),\n line: 1,\n detail: 'No ExtensionAPI use was statically proven across the local module closure; conversion fails closed instead of claiming compatibility.',\n })\n }\n for (const issue of extensionClosure.issues) {\n // Only a break on the load-time path blocks the package: Pi's own loader\n // fails the same lazy references at feature-use time, and the snapshot\n // preserves the published file layout, so behavior matches Pi exactly.\n const lazyIssue = issue.lazy || issue.kind === 'asset'\n findings.push({\n capability: `${issue.kind}(${issue.specifier})`,\n level: lazyIssue ? 'partial' : 'fatal',\n file: relative(pkg.rootDir, issue.file).replaceAll('\\\\', '/'),\n line: 1,\n detail: lazyIssue\n ? `Unresolved reference on a lazy path: ${issue.detail}. Extension load is unaffected; if the feature that evaluates it runs, it fails the same way under Pi (published file layout is preserved).`\n : `The local extension closure is incomplete: ${issue.detail}`,\n })\n }\n\n const declaredDependencies = dependencyNames(pkg.packageJson)\n for (const file of extensionClosure.files.filter(candidate => SCRIPT_EXTENSIONS.has(extname(candidate)))) {\n const text = await readFile(file, 'utf8')\n const lazyFile = !extensionClosure.loadTimeFiles.has(file)\n for (const use of runtimeExternalPackages(file, text)) {\n if (PI_HOST_PACKAGES.has(use.name) || declaredDependencies.has(use.name)) continue\n // Undeclared imports only crash extension load when they execute at load\n // time. On lazy paths (function-body dynamic imports, or files that are\n // themselves only lazily reachable) Pi degrades per-feature; mirror that.\n const lazyUse = use.lazy || lazyFile\n findings.push({\n capability: lazyUse ? `optional-lazy-dependency(${use.name})` : `undeclared-runtime-dependency(${use.name})`,\n level: lazyUse ? 'partial' : 'fatal',\n file: relative(pkg.rootDir, file).replaceAll('\\\\', '/'),\n line: 1,\n detail: lazyUse\n ? `The extension imports ${JSON.stringify(use.name)} only on a lazily-evaluated path without declaring it; the feature that needs it asks for the module at call time, exactly as under Pi (install ${use.name} to use that feature).`\n : `The extension imports ${JSON.stringify(use.name)} at load time, but the Pi package does not declare it as a dependency.`,\n })\n }\n }\n\n const resourceFinding = (file: string, capability: string, level: CompatibilityLevel, detail: string): CompatibilityFinding => ({\n capability,\n level,\n file: relative(pkg.rootDir, file).replaceAll('\\\\', '/'),\n line: 1,\n detail,\n })\n for (const file of pkg.resources.skills.filter(path => basename(path) === 'SKILL.md' || path.endsWith('.md'))) {\n findings.push(resourceFinding(file, 'skill', 'full', 'Copied as a DSH filesystem skill with its resource directory intact.'))\n }\n for (const file of pkg.resources.prompts) {\n findings.push(resourceFinding(file, 'prompt', 'full', 'Registered as a DSH slash command with Pi-compatible argument expansion.'))\n }\n for (const file of pkg.resources.themes) {\n findings.push(resourceFinding(file, 'theme', 'unsupported', 'Pi terminal themes have no effect in DSH Web or headless surfaces.'))\n }\n findings.sort((left, right) => left.file.localeCompare(right.file) || left.line - right.line || left.capability.localeCompare(right.capability))\n\n const summary: Record<CompatibilityLevel, number> = { full: 0, partial: 0, unsupported: 0, fatal: 0 }\n for (const finding of findings) summary[finding.level] += 1\n // Static analysis screens; it does not certify. Only fatal findings block a\n // bundle (it cannot be built or trusted). Everything else installs: verify\n // real behavior with the black-box run instead of trusting this verdict.\n const verdict = summary.fatal > 0 ? 'blocked' : summary.partial > 0 || summary.unsupported > 0 ? 'review' : 'ready'\n\n return {\n schemaVersion: 1,\n package: pkg.identity,\n verdict,\n summary,\n resources: {\n extensions: pkg.resources.extensions.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n skills: pkg.resources.skills.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n prompts: pkg.resources.prompts.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n themes: pkg.resources.themes.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n },\n findings,\n }\n}\n"],"mappings":";;;;;;;AAKA,MAAa,oCAAoB,IAAI,IAAI;CAAC;CAAO;CAAQ;CAAQ;CAAQ;CAAO;CAAQ;CAAQ;AAAM,CAAC;AACvG,MAAM,oBAAoB;CAAC;CAAO;CAAQ;CAAQ;CAAQ;CAAO;CAAQ;CAAQ;CAAQ;AAAO;AA6BhG,SAAgB,WAAW,MAA6B;CACtD,IAAI,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,KAAK,KAAK,SAAS,MAAM,GAAG,OAAO,GAAG,WAAW;CACjG,IAAI,KAAK,SAAS,MAAM,GAAG,OAAO,GAAG,WAAW;CAChD,IAAI,KAAK,SAAS,MAAM,GAAG,OAAO,GAAG,WAAW;CAChD,OAAO,GAAG,WAAW;AACvB;AAEA,SAAS,cAAc,MAAqD;CAC1E,OAAO,SAAS,KAAA,MAAc,GAAG,gBAAgB,IAAI,KAAK,GAAG,gCAAgC,IAAI,KAAK,KAAK,OAAO,KAAA;AACpH;AAEA,SAAS,gBAAgB,MAA0C;CACjE,OAAO,SAAS,KAAA,KAAa,GAAG,2BAA2B,IAAI,KAAK,KAAK,KAAK,SAAS,SAClF,GAAG,eAAe,KAAK,U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AAc,MAAM,UAAU,CAAC;CAE/I,MAAM,UAA8C;EAAE,MAAM;EAAG,SAAS;EAAG,aAAa;EAAG,OAAO;CAAE;CACpG,KAAK,MAAM,WAAW,UAAU,QAAQ,QAAQ,UAAU;CAI1D,MAAM,UAAU,QAAQ,QAAQ,IAAI,YAAY,QAAQ,UAAU,KAAK,QAAQ,cAAc,IAAI,WAAW;CAE5G,OAAO;EACL,eAAe;EACf,SAAS,IAAI;EACb;EACA;EACA,WAAW;GACT,YAAY,IAAI,UAAU,WAAW,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;GAClG,QAAQ,IAAI,UAAU,OAAO,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;GAC1F,SAAS,IAAI,UAAU,QAAQ,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;GAC5F,QAAQ,IAAI,UAAU,OAAO,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;EAC5F;EACA;CACF;AACF"}
1
+ {"version":3,"file":"analyzer-BL7Nfvko.mjs","names":[],"sources":["../src/module-graph.ts","../src/analyzer.ts"],"sourcesContent":["import { builtinModules } from 'node:module'\nimport { lstat, readFile, readdir, stat } from 'node:fs/promises'\nimport { dirname, extname, join, relative, resolve } from 'node:path'\nimport ts from 'typescript'\n\nexport const SCRIPT_EXTENSIONS = new Set(['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs'])\nconst MODULE_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts', '.js', '.jsx', '.mjs', '.cjs', '.json']\n\ninterface LocalReference {\n kind: 'module' | 'asset'\n specifier: string\n // A lazy reference is only evaluated when some feature runs, never while the\n // extension entry loads: dynamic import()/require() inside a function body,\n // or worker/data assets spawned on demand. Pi's loader therefore succeeds\n // even when a lazy target is unresolvable; problems on lazy paths surface\n // (identically under Pi and pi2dsh) only if that feature is used.\n lazy: boolean\n}\n\nexport interface LocalClosureIssue {\n file: string\n kind: LocalReference['kind']\n specifier: string\n detail: string\n lazy: boolean\n}\n\nexport interface LocalClosure {\n files: string[]\n // Files whose module-level code executes the moment the extension entry\n // loads (transitive non-lazy module edges from the entries).\n loadTimeFiles: Set<string>\n issues: LocalClosureIssue[]\n}\n\nexport function sourceKind(path: string): ts.ScriptKind {\n if (path.endsWith('.js') || path.endsWith('.mjs') || path.endsWith('.cjs')) return ts.ScriptKind.JS\n if (path.endsWith('.jsx')) return ts.ScriptKind.JSX\n if (path.endsWith('.tsx')) return ts.ScriptKind.TSX\n return ts.ScriptKind.TS\n}\n\nfunction literalModule(node: ts.Expression | undefined): string | undefined {\n return node !== undefined && (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) ? node.text : undefined\n}\n\nfunction isImportMetaUrl(node: ts.Expression | undefined): boolean {\n return node !== undefined && ts.isPropertyAccessExpression(node) && node.name.text === 'url'\n && ts.isMetaProperty(node.expression) && node.expression.keywordToken === ts.SyntaxKind.ImportKeyword\n}\n\nfunction localReferences(path: string, text: string): LocalReference[] {\n const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, sourceKind(path))\n const values = new Map<string, LocalReference>()\n const createRequireNames = new Set<string>(['createRequire'])\n const requireNames = new Set<string>(['require'])\n const add = (kind: LocalReference['kind'], specifier: string, lazy: boolean): void => {\n // '#'-prefixed specifiers are Node subpath imports resolved through the\n // package's own `imports` map — package-local, not external dependencies.\n if (!specifier.startsWith('.') && !specifier.startsWith('#')) return\n const key = `${kind}:${specifier}`\n const existing = values.get(key)\n // A specifier reached both statically and lazily executes at load time.\n if (existing === undefined) values.set(key, { kind, specifier, lazy })\n else if (existing.lazy && !lazy) existing.lazy = false\n }\n function collectRequireAliases(node: ts.Node): void {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)\n && (node.moduleSpecifier.text === 'node:module' || node.moduleSpecifier.text === 'module')\n && node.importClause?.namedBindings !== undefined && ts.isNamedImports(node.importClause.namedBindings)) {\n for (const element of node.importClause.namedBindings.elements) {\n if ((element.propertyName?.text ?? element.name.text) === 'createRequire') createRequireNames.add(element.name.text)\n }\n } else if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)\n && node.initializer !== undefined && ts.isCallExpression(node.initializer)\n && ts.isIdentifier(node.initializer.expression) && createRequireNames.has(node.initializer.expression.text)) {\n requireNames.add(node.name.text)\n }\n ts.forEachChild(node, collectRequireAliases)\n }\n collectRequireAliases(source)\n function visit(node: ts.Node): void {\n if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) && node.moduleSpecifier !== undefined\n && ts.isStringLiteral(node.moduleSpecifier)) {\n add('module', node.moduleSpecifier.text, false)\n } else if (ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference)\n && ts.isStringLiteral(node.moduleReference.expression)) {\n add('module', node.moduleReference.expression.text, false)\n } else if (ts.isCallExpression(node) && node.arguments.length > 0\n && ((node.expression.kind === ts.SyntaxKind.ImportKeyword)\n || (ts.isIdentifier(node.expression) && requireNames.has(node.expression.text)))) {\n const specifier = literalModule(node.arguments[0])\n if (specifier !== undefined) add('module', specifier, insideFunctionBody(node))\n } else if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === 'URL'\n && isImportMetaUrl(node.arguments?.[1])) {\n const specifier = literalModule(node.arguments?.[0])\n if (specifier !== undefined) add('asset', specifier, false)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return [...values.values()]\n}\n\nfunction externalPackage(specifier: string): string | undefined {\n // `bun:*` counts as a host builtin, not an npm dependency: Pi's official\n // distribution is a Bun-compiled binary, so ecosystem packages gate these\n // requires behind runtime detection and take their declared Node fallback\n // (better-sqlite3, node:sqlite) everywhere else.\n if (specifier.startsWith('.') || specifier.startsWith('/') || specifier.startsWith('#')\n || specifier.startsWith('node:') || specifier.startsWith('bun:')\n || builtinModules.includes(specifier)) return undefined\n const parts = specifier.split('/')\n return specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]\n}\n\nfunction insideTry(node: ts.Node): boolean {\n let current: ts.Node | undefined = node.parent\n while (current !== undefined) {\n if (ts.isTryStatement(current)) return true\n // Stop at function boundaries: a try in an outer function does not guard\n // an import inside a nested callback executed later.\n if (ts.isFunctionLike(current)) {\n // ...unless the whole function body IS awaited inside the try; keeping\n // this conservative check simple errs toward reporting the dependency.\n return false\n }\n current = current.parent\n }\n return false\n}\n\n// Inside any function body means the expression does not run while the module\n// itself loads — it runs when (if ever) that function is called.\nfunction insideFunctionBody(node: ts.Node): boolean {\n let current: ts.Node | undefined = node.parent\n while (current !== undefined) {\n if (ts.isFunctionLike(current)) return true\n current = current.parent\n }\n return false\n}\n\nexport interface RuntimeDependencyUse {\n name: string\n // true when every use sits on a lazy path (dynamic import/require inside a\n // function body): the module loads fine without the dependency, exactly as\n // under Pi, and only the feature that calls it needs the install.\n lazy: boolean\n}\n\nexport function runtimeExternalPackages(path: string, text: string): RuntimeDependencyUse[] {\n const source = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, sourceKind(path))\n const packages = new Map<string, RuntimeDependencyUse>()\n const createRequireNames = new Set<string>(['createRequire'])\n const requireNames = new Set<string>(['require'])\n const add = (specifier: string, lazy: boolean): void => {\n const name = externalPackage(specifier)\n if (name === undefined || name.length === 0) return\n const existing = packages.get(name)\n if (existing === undefined) packages.set(name, { name, lazy })\n else if (existing.lazy && !lazy) existing.lazy = false\n }\n function collectRequireAliases(node: ts.Node): void {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)\n && (node.moduleSpecifier.text === 'node:module' || node.moduleSpecifier.text === 'module')\n && node.importClause?.namedBindings !== undefined && ts.isNamedImports(node.importClause.namedBindings)) {\n for (const element of node.importClause.namedBindings.elements) {\n if ((element.propertyName?.text ?? element.name.text) === 'createRequire') createRequireNames.add(element.name.text)\n }\n } else if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)\n && node.initializer !== undefined && ts.isCallExpression(node.initializer)\n && ts.isIdentifier(node.initializer.expression) && createRequireNames.has(node.initializer.expression.text)) {\n requireNames.add(node.name.text)\n }\n ts.forEachChild(node, collectRequireAliases)\n }\n collectRequireAliases(source)\n function visit(node: ts.Node): void {\n if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {\n const clause = node.importClause\n const named = clause?.namedBindings\n const namedImportsAreTypeOnly = named !== undefined && ts.isNamedImports(named)\n && named.elements.length > 0 && named.elements.every(element => element.isTypeOnly)\n if (clause === undefined || (!clause.isTypeOnly && (clause.name !== undefined || !namedImportsAreTypeOnly))) {\n add(node.moduleSpecifier.text, false)\n }\n } else if (ts.isExportDeclaration(node) && !node.isTypeOnly\n && node.moduleSpecifier !== undefined && ts.isStringLiteral(node.moduleSpecifier)) {\n add(node.moduleSpecifier.text, false)\n } else if (ts.isImportEqualsDeclaration(node) && !node.isTypeOnly\n && ts.isExternalModuleReference(node.moduleReference) && ts.isStringLiteral(node.moduleReference.expression)) {\n add(node.moduleReference.expression.text, false)\n } else if (ts.isCallExpression(node) && node.arguments.length > 0\n && ((node.expression.kind === ts.SyntaxKind.ImportKeyword)\n || (ts.isIdentifier(node.expression) && requireNames.has(node.expression.text)))) {\n // A dynamic import/require wrapped in try/catch is the ecosystem's\n // optional-dependency idiom (e.g. pi-harness-runtime's \"// Dynamic\n // import for Playwright (optional dependency)\") — its absence is a\n // designed degradation, not an undeclared runtime requirement.\n if (!insideTry(node)) {\n const specifier = literalModule(node.arguments[0])\n if (specifier !== undefined) add(specifier, insideFunctionBody(node))\n }\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return [...packages.values()]\n}\n\nfunction inside(rootDir: string, path: string): boolean {\n const pathRelative = relative(rootDir, path)\n return pathRelative === '' || (pathRelative !== '..' && !pathRelative.startsWith(`..${process.platform === 'win32' ? '\\\\' : '/'}`))\n}\n\nfunction sourceAlternates(base: string): string[] {\n const extension = extname(base)\n const stem = extension.length > 0 ? base.slice(0, -extension.length) : base\n if (extension === '.js') return [`${stem}.ts`, `${stem}.tsx`]\n if (extension === '.mjs') return [`${stem}.mts`, `${stem}.ts`]\n if (extension === '.cjs') return [`${stem}.cts`, `${stem}.ts`]\n if (extension === '.jsx') return [`${stem}.tsx`, `${stem}.ts`]\n return []\n}\n\nasync function isFile(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile()\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false\n throw error\n }\n}\n\nfunction subpathImportTarget(rootDir: string, specifier: string, importsMap: Record<string, unknown>): string | undefined {\n const conditionValue = (value: unknown): string | undefined => {\n if (typeof value === 'string') return value\n if (typeof value !== 'object' || value === null) return undefined\n const record = value as Record<string, unknown>\n for (const condition of ['import', 'node', 'default']) {\n const candidate = conditionValue(record[condition])\n if (candidate !== undefined) return candidate\n }\n return undefined\n }\n const direct = conditionValue(importsMap[specifier])\n if (direct !== undefined) return resolve(rootDir, direct)\n for (const [pattern, value] of Object.entries(importsMap)) {\n const star = pattern.indexOf('*')\n if (star === -1) continue\n const prefix = pattern.slice(0, star)\n const suffix = pattern.slice(star + 1)\n if (!specifier.startsWith(prefix) || !specifier.endsWith(suffix)) continue\n const wildcard = specifier.slice(prefix.length, specifier.length - suffix.length)\n const target = conditionValue(value)\n if (target !== undefined) return resolve(rootDir, target.replace('*', wildcard))\n }\n return undefined\n}\n\nasync function packageImportsMap(rootDir: string): Promise<Record<string, unknown>> {\n try {\n const parsed = JSON.parse(await readFile(join(rootDir, 'package.json'), 'utf8')) as { imports?: unknown }\n return typeof parsed.imports === 'object' && parsed.imports !== null ? parsed.imports as Record<string, unknown> : {}\n } catch {\n return {}\n }\n}\n\nasync function resolveModule(fromFile: string, specifier: string, rootDir: string, importsMap: Record<string, unknown>): Promise<string> {\n if (specifier.startsWith('#')) {\n const target = subpathImportTarget(rootDir, specifier, importsMap)\n if (target === undefined) {\n throw new Error(`cannot resolve subpath import ${JSON.stringify(specifier)} through the package \"imports\" map`)\n }\n return resolveModule(fromFile, relative(dirname(fromFile), target).startsWith('.')\n ? relative(dirname(fromFile), target)\n : `./${relative(dirname(fromFile), target)}`, rootDir, importsMap)\n }\n const base = resolve(dirname(fromFile), specifier)\n const candidates = [\n base,\n ...sourceAlternates(base),\n ...(extname(base) === '' ? MODULE_EXTENSIONS.map(extension => `${base}${extension}`) : []),\n ...MODULE_EXTENSIONS.map(extension => join(base, `index${extension}`)),\n ]\n for (const candidate of [...new Set(candidates)]) {\n if (!inside(rootDir, candidate)) throw new Error(`extension import escapes the Pi package: ${specifier} from ${fromFile}`)\n if (await isFile(candidate)) return candidate\n }\n throw new Error(`cannot resolve local extension import ${JSON.stringify(specifier)} from ${fromFile}`)\n}\n\nasync function expandAsset(path: string, rootDir: string): Promise<string[]> {\n if (!inside(rootDir, path)) throw new Error(`extension asset escapes the Pi package: ${path}`)\n let info\n try {\n info = await lstat(path)\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n // A `new URL('./worker.js', import.meta.url)` asset may only exist in its\n // TypeScript source form before the package builds; track the source.\n for (const alternate of sourceAlternates(path)) {\n if (await isFile(alternate)) return [alternate]\n }\n throw error\n }\n if (info.isSymbolicLink()) throw new Error(`refusing to copy symbolic link from Pi package: ${path}`)\n if (info.isFile()) return [path]\n if (!info.isDirectory()) return []\n const output: string[] = []\n for (const entry of await readdir(path)) output.push(...await expandAsset(join(path, entry), rootDir))\n return output\n}\n\nexport async function collectLocalClosure(rootDir: string, entries: readonly string[]): Promise<LocalClosure> {\n const importsMap = await packageImportsMap(rootDir)\n const graph = new Map<string, Array<{ lazy: boolean, targets: string[] }>>()\n const issues: LocalClosureIssue[] = []\n const queue = entries.map(path => resolve(path))\n // Pass 1: the full local reference graph, lazy edges included, so the\n // snapshot carries every file any feature could ever load.\n while (queue.length > 0) {\n const source = queue.shift() as string\n if (graph.has(source)) continue\n if (!inside(rootDir, source)) throw new Error(`extension source escapes the Pi package: ${source}`)\n const info = await lstat(source)\n if (info.isSymbolicLink()) throw new Error(`refusing to copy symbolic link from Pi package: ${source}`)\n if (!info.isFile()) throw new Error(`extension closure contains a non-file path: ${source}`)\n const edges: Array<{ lazy: boolean, targets: string[] }> = []\n graph.set(source, edges)\n if (!SCRIPT_EXTENSIONS.has(extname(source))) continue\n const text = await readFile(source, 'utf8')\n for (const reference of localReferences(source, text)) {\n // Worker/data assets never execute while the entry loads; the feature\n // that spawns them does, so their whole subtree is a lazy path.\n const lazy = reference.lazy || reference.kind === 'asset'\n try {\n const targets = reference.kind === 'module'\n ? [await resolveModule(source, reference.specifier, rootDir, importsMap)]\n : await expandAsset(resolve(dirname(source), reference.specifier), rootDir)\n edges.push({ lazy, targets })\n queue.push(...targets)\n } catch (error) {\n issues.push({\n file: source,\n kind: reference.kind,\n specifier: reference.specifier,\n detail: error instanceof Error ? error.message : String(error),\n lazy,\n })\n }\n }\n }\n // Pass 2: load-time reachability across non-lazy module edges only. This is\n // the set whose problems actually break `pi` (and pi2dsh) at extension load;\n // everything else fails at feature-use time, identically under both hosts.\n const loadTimeFiles = new Set<string>()\n const loadQueue = entries.map(path => resolve(path)).filter(path => graph.has(path))\n while (loadQueue.length > 0) {\n const source = loadQueue.shift() as string\n if (loadTimeFiles.has(source)) continue\n loadTimeFiles.add(source)\n for (const edge of graph.get(source) ?? []) {\n if (edge.lazy) continue\n for (const target of edge.targets) {\n if (!loadTimeFiles.has(target)) loadQueue.push(target)\n }\n }\n }\n // An issue found inside a file that itself only loads lazily cannot break\n // extension load either, however the reference is written.\n for (const issue of issues) {\n if (!loadTimeFiles.has(issue.file)) issue.lazy = true\n }\n return { files: [...graph.keys()].sort(), loadTimeFiles, issues }\n}\n","import { readFile } from 'node:fs/promises'\nimport { basename, extname, relative } from 'node:path'\nimport ts from 'typescript'\nimport {\n PI_CODING_AGENT_PACKAGES,\n PI_AI_PACKAGES,\n PI_TUI_PACKAGES,\n ruleForApi,\n ruleForContextProperty,\n ruleForEvent,\n ruleForHostImport,\n ruleForUiContextProperty,\n} from './compatibility.js'\nimport { collectLocalClosure, runtimeExternalPackages, SCRIPT_EXTENSIONS, sourceKind } from './module-graph.js'\nimport type {\n CompatibilityFinding,\n CompatibilityLevel,\n CompatibilityReport,\n ResolvedPiPackage,\n} from './types.js'\n\nfunction literalText(node: ts.Node | undefined): string | undefined {\n return node !== undefined && (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node))\n ? node.text\n : undefined\n}\n\nfunction hasModifier(node: ts.Node, kind: ts.SyntaxKind): boolean {\n return ts.canHaveModifiers(node) && ts.getModifiers(node)?.some(modifier => modifier.kind === kind) === true\n}\n\nfunction parameterIdentifier(node: ts.SignatureDeclarationBase): string | undefined {\n const parameter = node.parameters[0]\n return parameter !== undefined && ts.isIdentifier(parameter.name) ? parameter.name.text : undefined\n}\n\nfunction extensionApiReceivers(source: ts.SourceFile): Set<string> {\n const receivers = new Set<string>()\n const functions = new Map<string, ts.FunctionLikeDeclarationBase>()\n\n function index(node: ts.Node): void {\n if (ts.isFunctionDeclaration(node) && node.name !== undefined) functions.set(node.name.text, node)\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)\n && node.initializer !== undefined\n && (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer))) {\n functions.set(node.name.text, node.initializer)\n }\n if (ts.isParameter(node) && node.type !== undefined\n && /(?:^|\\.)ExtensionAPI\\b/u.test(node.type.getText(source)) && ts.isIdentifier(node.name)) {\n receivers.add(node.name.text)\n }\n // Published Pi packages commonly ship JavaScript with type annotations\n // erased. `pi` is the documented ExtensionAPI parameter name throughout\n // the ecosystem, including helper functions reached from the entry point.\n if (ts.isParameter(node) && ts.isIdentifier(node.name)\n && /^(?:pi|extensionApi)$/iu.test(node.name.text)) {\n receivers.add(node.name.text)\n }\n ts.forEachChild(node, index)\n }\n index(source)\n\n for (const statement of source.statements) {\n if (ts.isFunctionDeclaration(statement)\n && hasModifier(statement, ts.SyntaxKind.ExportKeyword)\n && hasModifier(statement, ts.SyntaxKind.DefaultKeyword)) {\n const name = parameterIdentifier(statement)\n if (name !== undefined) receivers.add(name)\n }\n if (ts.isExportAssignment(statement)) {\n const expression = statement.expression\n if (ts.isArrowFunction(expression) || ts.isFunctionExpression(expression)) {\n const name = parameterIdentifier(expression)\n if (name !== undefined) receivers.add(name)\n } else if (ts.isIdentifier(expression)) {\n const candidate = functions.get(expression.text)\n if (candidate !== undefined) {\n const name = parameterIdentifier(candidate)\n if (name !== undefined) receivers.add(name)\n }\n }\n }\n if (ts.isExportDeclaration(statement) && statement.moduleSpecifier === undefined\n && statement.exportClause !== undefined && ts.isNamedExports(statement.exportClause)) {\n for (const element of statement.exportClause.elements) {\n if (element.name.text !== 'default' || element.propertyName === undefined || !ts.isIdentifier(element.propertyName)) continue\n const candidate = functions.get(element.propertyName.text)\n if (candidate !== undefined) {\n const name = parameterIdentifier(candidate)\n if (name !== undefined) receivers.add(name)\n }\n }\n }\n }\n return receivers\n}\n\nfunction extensionApiProperties(source: ts.SourceFile, receivers: ReadonlySet<string>): Set<string> {\n const properties = new Set<string>()\n function visit(node: ts.Node): void {\n if ((ts.isPropertyDeclaration(node) || ts.isParameter(node)) && ts.isIdentifier(node.name)) {\n const typed = node.type !== undefined && /(?:^|\\.)(?:Pi)?ExtensionAPI\\b/u.test(node.type.getText(source))\n if (typed || /^(?:pi|extensionApi)$/iu.test(node.name.text)) properties.add(node.name.text)\n } else if (ts.isBinaryExpression(node) && node.operatorToken.kind === ts.SyntaxKind.EqualsToken\n && ts.isPropertyAccessExpression(node.left) && node.left.expression.kind === ts.SyntaxKind.ThisKeyword\n && ts.isIdentifier(node.right) && receivers.has(node.right.text)) {\n properties.add(node.left.name.text)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return properties\n}\n\nfunction enclosingFunctionName(node: ts.ParameterDeclaration): string | undefined {\n const parent = node.parent\n if (ts.isMethodDeclaration(parent) && parent.name !== undefined) return parent.name.getText()\n if ((ts.isArrowFunction(parent) || ts.isFunctionExpression(parent)) && ts.isPropertyAssignment(parent.parent)) {\n return parent.parent.name.getText()\n }\n return undefined\n}\n\nfunction extensionContextReceivers(source: ts.SourceFile): Set<string> {\n const receivers = new Set<string>()\n function visit(node: ts.Node): void {\n if (ts.isParameter(node) && ts.isIdentifier(node.name)) {\n const typedContext = node.type !== undefined\n && /(?:^|\\.)(?:Extension|ExtensionCommand|ToolExecution)Context\\b/u.test(node.type.getText(source))\n const conventionalHandlerContext = /^(?:ctx|context)$/iu.test(node.name.text)\n && /^(?:execute|handler)$/u.test(enclosingFunctionName(node) ?? '')\n if (typedContext || conventionalHandlerContext) receivers.add(node.name.text)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return receivers\n}\n\n// The three Pi packages whose named exports the shim audit tracks.\nconst PI_SHIMMED_PACKAGES = new Set<string>([\n ...PI_CODING_AGENT_PACKAGES,\n ...PI_TUI_PACKAGES,\n ...PI_AI_PACKAGES,\n])\n\n// Everything Pi's loader provides to extensions without a declaration —\n// exempt from the undeclared-runtime-dependency fatal, and (for typebox) not\n// subject to per-symbol shim auditing.\nconst PI_HOST_PACKAGES = new Set<string>([\n ...PI_SHIMMED_PACKAGES,\n 'typebox',\n '@sinclair/typebox',\n])\n\nfunction dependencyNames(packageJson: Record<string, unknown>): Set<string> {\n const names = new Set<string>()\n for (const field of ['dependencies', 'optionalDependencies', 'peerDependencies']) {\n const value = packageJson[field]\n if (typeof value !== 'object' || value === null || Array.isArray(value)) continue\n for (const [name, specifier] of Object.entries(value)) {\n if (typeof specifier === 'string') names.add(name)\n }\n }\n return names\n}\n\nfunction pushFinding(\n findings: CompatibilityFinding[],\n rootDir: string,\n file: string,\n source: ts.SourceFile,\n node: ts.Node,\n capability: string,\n level: CompatibilityLevel,\n detail: string,\n): void {\n const position = source.getLineAndCharacterOfPosition(node.getStart(source))\n findings.push({\n capability,\n level,\n file: relative(rootDir, file).replaceAll('\\\\', '/'),\n line: position.line + 1,\n detail,\n })\n}\n\nasync function analyzeExtension(rootDir: string, file: string): Promise<CompatibilityFinding[]> {\n const text = await readFile(file, 'utf8')\n const source = ts.createSourceFile(file, text, ts.ScriptTarget.Latest, true, sourceKind(file))\n const findings: CompatibilityFinding[] = []\n const receivers = extensionApiReceivers(source)\n const apiProperties = extensionApiProperties(source, receivers)\n const contextReceivers = extensionContextReceivers(source)\n const methodAliases = new Map<string, string>()\n const eventBusAliases = new Set<string>()\n const uiAliases = new Set<string>()\n\n function reportHostImport(packageName: string, importedName: string, node: ts.Node): void {\n const matched = ruleForHostImport(packageName, importedName)\n if (matched === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, `host-import(${packageName}:${importedName})`, 'unsupported',\n `The pi2dsh host shim does not export ${JSON.stringify(importedName)} from ${JSON.stringify(packageName)}.`,\n )\n return\n }\n pushFinding(\n findings, rootDir, file, source, node, `host-import(${packageName}:${importedName})`, matched.level, matched.detail,\n )\n }\n\n for (const statement of source.statements) {\n if (ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier)\n && PI_SHIMMED_PACKAGES.has(statement.moduleSpecifier.text)) {\n const packageName = statement.moduleSpecifier.text\n const clause = statement.importClause\n if (clause === undefined) {\n reportHostImport(packageName, '<side-effect>', statement)\n continue\n }\n if (clause.isTypeOnly) continue\n if (clause.name !== undefined) reportHostImport(packageName, 'default', clause.name)\n if (clause.namedBindings !== undefined && ts.isNamespaceImport(clause.namedBindings)) {\n reportHostImport(packageName, '*', clause.namedBindings)\n } else if (clause.namedBindings !== undefined) {\n for (const element of clause.namedBindings.elements) {\n if (!element.isTypeOnly) reportHostImport(packageName, element.propertyName?.text ?? element.name.text, element)\n }\n }\n } else if (ts.isExportDeclaration(statement) && !statement.isTypeOnly\n && statement.moduleSpecifier !== undefined && ts.isStringLiteral(statement.moduleSpecifier)\n && PI_HOST_PACKAGES.has(statement.moduleSpecifier.text)) {\n const packageName = statement.moduleSpecifier.text\n if (statement.exportClause === undefined || ts.isNamespaceExport(statement.exportClause)) {\n reportHostImport(packageName, '*', statement)\n } else {\n for (const element of statement.exportClause.elements) {\n if (!element.isTypeOnly) reportHostImport(packageName, element.propertyName?.text ?? element.name.text, element)\n }\n }\n } else if (ts.isImportEqualsDeclaration(statement) && !statement.isTypeOnly\n && ts.isExternalModuleReference(statement.moduleReference)\n && ts.isStringLiteral(statement.moduleReference.expression)\n && PI_HOST_PACKAGES.has(statement.moduleReference.expression.text)) {\n reportHostImport(statement.moduleReference.expression.text, '*', statement)\n }\n }\n\n const declarations: ts.VariableDeclaration[] = []\n const isApiReceiver = (node: ts.Expression): boolean => ts.isIdentifier(node) && receivers.has(node.text)\n || (ts.isPropertyAccessExpression(node) && node.expression.kind === ts.SyntaxKind.ThisKeyword\n && apiProperties.has(node.name.text))\n function collectDeclarations(node: ts.Node): void {\n if (ts.isVariableDeclaration(node)) declarations.push(node)\n ts.forEachChild(node, collectDeclarations)\n }\n collectDeclarations(source)\n\n for (let pass = 0; pass < declarations.length + 1; pass += 1) {\n let changed = false\n for (const declaration of declarations) {\n const initializer = declaration.initializer\n if (initializer === undefined) continue\n if (ts.isIdentifier(declaration.name) && isApiReceiver(initializer)) {\n if (!receivers.has(declaration.name.text)) {\n receivers.add(declaration.name.text)\n changed = true\n }\n }\n if (ts.isIdentifier(declaration.name) && ts.isIdentifier(initializer) && contextReceivers.has(initializer.text)) {\n if (!contextReceivers.has(declaration.name.text)) {\n contextReceivers.add(declaration.name.text)\n changed = true\n }\n }\n if (ts.isIdentifier(declaration.name) && ts.isPropertyAccessExpression(initializer)\n && initializer.name.text === 'ui' && ts.isIdentifier(initializer.expression)\n && contextReceivers.has(initializer.expression.text) && !uiAliases.has(declaration.name.text)) {\n uiAliases.add(declaration.name.text)\n changed = true\n }\n if (ts.isIdentifier(declaration.name) && ts.isPropertyAccessExpression(initializer)\n && isApiReceiver(initializer.expression)) {\n if (initializer.name.text === 'events') {\n if (!eventBusAliases.has(declaration.name.text)) {\n eventBusAliases.add(declaration.name.text)\n changed = true\n }\n } else if (!methodAliases.has(declaration.name.text)) {\n methodAliases.set(declaration.name.text, initializer.name.text)\n changed = true\n }\n }\n if (ts.isObjectBindingPattern(declaration.name) && isApiReceiver(initializer)) {\n for (const element of declaration.name.elements) {\n if (!ts.isIdentifier(element.name)) continue\n const method = element.propertyName !== undefined && ts.isIdentifier(element.propertyName)\n ? element.propertyName.text\n : element.name.text\n if (method === 'events') {\n if (!eventBusAliases.has(element.name.text)) {\n eventBusAliases.add(element.name.text)\n changed = true\n }\n } else if (!methodAliases.has(element.name.text)) {\n methodAliases.set(element.name.text, method)\n changed = true\n }\n }\n }\n }\n if (!changed) break\n }\n\n function reportMethod(method: string, args: ts.NodeArray<ts.Expression>, node: ts.Node): void {\n if (method === 'on') {\n const event = literalText(args[0])\n if (event === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, 'on(<dynamic>)', 'unsupported',\n 'Dynamic event names cannot be audited or mapped safely.',\n )\n } else {\n const rule = ruleForEvent(event)\n pushFinding(findings, rootDir, file, source, node, `on(${event})`, rule.level, rule.detail)\n }\n return\n }\n const rule = ruleForApi(method)\n if (rule === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, method, 'unsupported',\n `Unknown ExtensionAPI method ${JSON.stringify(method)} cannot be audited or mapped safely.`,\n )\n return\n }\n pushFinding(findings, rootDir, file, source, node, method, rule.level, rule.detail)\n }\n\n function reportEventBus(method: string, node: ts.Node): void {\n const rule = ruleForApi('events')\n if ((method === 'on' || method === 'emit') && rule !== undefined) {\n pushFinding(findings, rootDir, file, source, node, `events.${method}`, rule.level, rule.detail)\n } else {\n pushFinding(\n findings, rootDir, file, source, node, `events.${method}`, 'unsupported',\n `Unknown Pi event-bus method ${JSON.stringify(method)} cannot be mapped safely.`,\n )\n }\n }\n\n function reportContext(property: string, node: ts.Node): void {\n const matched = ruleForContextProperty(property)\n if (matched === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, `ctx.${property}`, 'unsupported',\n `Unknown Pi extension-context property ${JSON.stringify(property)} cannot be audited or mapped safely.`,\n )\n } else {\n pushFinding(findings, rootDir, file, source, node, `ctx.${property}`, matched.level, matched.detail)\n }\n }\n\n function reportUiContext(property: string, node: ts.Node): void {\n const matched = ruleForUiContextProperty(property)\n if (matched === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, `ctx.ui.${property}`, 'unsupported',\n `Unknown Pi UI-context property ${JSON.stringify(property)} cannot be audited or mapped safely.`,\n )\n } else {\n pushFinding(findings, rootDir, file, source, node, `ctx.ui.${property}`, matched.level, matched.detail)\n }\n }\n\n function visit(node: ts.Node): void {\n if (ts.isCallExpression(node) && ts.isIdentifier(node.expression)) {\n const method = methodAliases.get(node.expression.text)\n if (method !== undefined) reportMethod(method, node.arguments, node)\n } else if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression)) {\n const target = node.expression.expression\n if (isApiReceiver(target)) {\n reportMethod(node.expression.name.text, node.arguments, node)\n } else if (ts.isIdentifier(target) && eventBusAliases.has(target.text)) {\n reportEventBus(node.expression.name.text, node)\n } else if (ts.isPropertyAccessExpression(target)\n && target.name.text === 'events'\n && isApiReceiver(target.expression)) {\n reportEventBus(node.expression.name.text, node)\n }\n } else if (ts.isCallExpression(node) && ts.isElementAccessExpression(node.expression)\n && isApiReceiver(node.expression.expression)) {\n const method = literalText(node.expression.argumentExpression)\n if (method === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, '<dynamic-api-method>', 'unsupported',\n 'Dynamic ExtensionAPI method access cannot be audited or mapped safely.',\n )\n } else {\n reportMethod(method, node.arguments, node)\n }\n }\n if (ts.isPropertyAccessExpression(node)) {\n const target = node.expression\n if (ts.isPropertyAccessExpression(target) && target.name.text === 'ui'\n && ts.isIdentifier(target.expression) && contextReceivers.has(target.expression.text)) {\n reportUiContext(node.name.text, node)\n } else if (ts.isIdentifier(target) && uiAliases.has(target.text)) {\n reportUiContext(node.name.text, node)\n } else if (ts.isIdentifier(target) && contextReceivers.has(target.text) && node.name.text !== 'ui') {\n reportContext(node.name.text, node)\n }\n } else if (ts.isElementAccessExpression(node) && ts.isIdentifier(node.expression)\n && contextReceivers.has(node.expression.text)) {\n const property = literalText(node.argumentExpression)\n if (property === undefined) {\n pushFinding(\n findings, rootDir, file, source, node, 'ctx.<dynamic>', 'unsupported',\n 'Dynamic Pi extension-context access cannot be audited or mapped safely.',\n )\n } else if (property !== 'ui') {\n reportContext(property, node)\n }\n }\n ts.forEachChild(node, visit)\n }\n\n visit(source)\n return findings\n}\n\nexport async function analyzePackage(pkg: ResolvedPiPackage): Promise<CompatibilityReport> {\n const extensionClosure = await collectLocalClosure(pkg.rootDir, pkg.resources.extensions)\n const findings = (await Promise.all(\n extensionClosure.files.filter(file => SCRIPT_EXTENSIONS.has(extname(file)))\n .map(file => analyzeExtension(pkg.rootDir, file)),\n )).flat()\n\n if (pkg.resources.extensions.length > 0 && findings.length === 0) {\n findings.push({\n capability: 'static-audit',\n level: 'unsupported',\n file: pkg.resources.extensions.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')).join(', '),\n line: 1,\n detail: 'No ExtensionAPI use was statically proven across the local module closure; conversion fails closed instead of claiming compatibility.',\n })\n }\n for (const issue of extensionClosure.issues) {\n // Only a break on the load-time path blocks the package: Pi's own loader\n // fails the same lazy references at feature-use time, and the snapshot\n // preserves the published file layout, so behavior matches Pi exactly.\n const lazyIssue = issue.lazy || issue.kind === 'asset'\n findings.push({\n capability: `${issue.kind}(${issue.specifier})`,\n level: lazyIssue ? 'partial' : 'fatal',\n file: relative(pkg.rootDir, issue.file).replaceAll('\\\\', '/'),\n line: 1,\n detail: lazyIssue\n ? `Unresolved reference on a lazy path: ${issue.detail}. Extension load is unaffected; if the feature that evaluates it runs, it fails the same way under Pi (published file layout is preserved).`\n : `The local extension closure is incomplete: ${issue.detail}`,\n })\n }\n\n const declaredDependencies = dependencyNames(pkg.packageJson)\n for (const file of extensionClosure.files.filter(candidate => SCRIPT_EXTENSIONS.has(extname(candidate)))) {\n const text = await readFile(file, 'utf8')\n const lazyFile = !extensionClosure.loadTimeFiles.has(file)\n for (const use of runtimeExternalPackages(file, text)) {\n if (PI_HOST_PACKAGES.has(use.name) || declaredDependencies.has(use.name)) continue\n // Undeclared imports only crash extension load when they execute at load\n // time. On lazy paths (function-body dynamic imports, or files that are\n // themselves only lazily reachable) Pi degrades per-feature; mirror that.\n const lazyUse = use.lazy || lazyFile\n findings.push({\n capability: lazyUse ? `optional-lazy-dependency(${use.name})` : `undeclared-runtime-dependency(${use.name})`,\n level: lazyUse ? 'partial' : 'fatal',\n file: relative(pkg.rootDir, file).replaceAll('\\\\', '/'),\n line: 1,\n detail: lazyUse\n ? `The extension imports ${JSON.stringify(use.name)} only on a lazily-evaluated path without declaring it; the feature that needs it asks for the module at call time, exactly as under Pi (install ${use.name} to use that feature).`\n : `The extension imports ${JSON.stringify(use.name)} at load time, but the Pi package does not declare it as a dependency.`,\n })\n }\n }\n\n const resourceFinding = (file: string, capability: string, level: CompatibilityLevel, detail: string): CompatibilityFinding => ({\n capability,\n level,\n file: relative(pkg.rootDir, file).replaceAll('\\\\', '/'),\n line: 1,\n detail,\n })\n for (const file of pkg.resources.skills.filter(path => basename(path) === 'SKILL.md' || path.endsWith('.md'))) {\n findings.push(resourceFinding(file, 'skill', 'full', 'Copied as a DSH filesystem skill with its resource directory intact.'))\n }\n for (const file of pkg.resources.prompts) {\n findings.push(resourceFinding(file, 'prompt', 'full', 'Registered as a DSH slash command with Pi-compatible argument expansion.'))\n }\n for (const file of pkg.resources.themes) {\n findings.push(resourceFinding(file, 'theme', 'unsupported', 'Pi terminal themes have no effect in DSH Web or headless surfaces.'))\n }\n findings.sort((left, right) => left.file.localeCompare(right.file) || left.line - right.line || left.capability.localeCompare(right.capability))\n\n const summary: Record<CompatibilityLevel, number> = { full: 0, partial: 0, unsupported: 0, fatal: 0 }\n for (const finding of findings) summary[finding.level] += 1\n // Static analysis screens; it does not certify. Only fatal findings block a\n // bundle (it cannot be built or trusted). Everything else installs: verify\n // real behavior with the black-box run instead of trusting this verdict.\n const verdict = summary.fatal > 0 ? 'blocked' : summary.partial > 0 || summary.unsupported > 0 ? 'review' : 'ready'\n\n return {\n schemaVersion: 1,\n package: pkg.identity,\n verdict,\n summary,\n resources: {\n extensions: pkg.resources.extensions.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n skills: pkg.resources.skills.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n prompts: pkg.resources.prompts.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n themes: pkg.resources.themes.map(file => relative(pkg.rootDir, file).replaceAll('\\\\', '/')),\n },\n findings,\n }\n}\n"],"mappings":";;;;;;;AAKA,MAAa,oCAAoB,IAAI,IAAI;CAAC;CAAO;CAAQ;CAAQ;CAAQ;CAAO;CAAQ;CAAQ;AAAM,CAAC;AACvG,MAAM,oBAAoB;CAAC;CAAO;CAAQ;CAAQ;CAAQ;CAAO;CAAQ;CAAQ;CAAQ;AAAO;AA6BhG,SAAgB,WAAW,MAA6B;CACtD,IAAI,KAAK,SAAS,KAAK,KAAK,KAAK,SAAS,MAAM,KAAK,KAAK,SAAS,MAAM,GAAG,OAAO,GAAG,WAAW;CACjG,IAAI,KAAK,SAAS,MAAM,GAAG,OAAO,GAAG,WAAW;CAChD,IAAI,KAAK,SAAS,MAAM,GAAG,OAAO,GAAG,WAAW;CAChD,OAAO,GAAG,WAAW;AACvB;AAEA,SAAS,cAAc,MAAqD;CAC1E,OAAO,SAAS,KAAA,MAAc,GAAG,gBAAgB,IAAI,KAAK,GAAG,gCAAgC,IAAI,KAAK,KAAK,OAAO,KAAA;AACpH;AAEA,SAAS,gBAAgB,MAA0C;CACjE,OAAO,SAAS,KAAA,KAAa,GAAG,2BAA2B,IAAI,KAAK,KAAK,KAAK,SAAS,SAClF,GAAG,eAAe,KAAK,UAAU,KAAK,KAAK,WAAW,iBAAiB,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AAM,UAA8C;EAAE,MAAM;EAAG,SAAS;EAAG,aAAa;EAAG,OAAO;CAAE;CACpG,KAAK,MAAM,WAAW,UAAU,QAAQ,QAAQ,UAAU;CAI1D,MAAM,UAAU,QAAQ,QAAQ,IAAI,YAAY,QAAQ,UAAU,KAAK,QAAQ,cAAc,IAAI,WAAW;CAE5G,OAAO;EACL,eAAe;EACf,SAAS,IAAI;EACb;EACA;EACA,WAAW;GACT,YAAY,IAAI,UAAU,WAAW,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;GAClG,QAAQ,IAAI,UAAU,OAAO,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;GAC1F,SAAS,IAAI,UAAU,QAAQ,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;GAC5F,QAAQ,IAAI,UAAU,OAAO,KAAI,SAAQ,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG,CAAC;EAC5F;EACA;CACF;AACF"}
package/dist/cli.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import { i as renderMcpPatch, n as convertPiMcpConfig } from "./mcp-config-C1K-IzzB.mjs";
2
3
  import { t as resolvePiPackage } from "./source-0sA5z08z.mjs";
3
- import { a as CONTEXT_RULES, d as UI_CONTEXT_RULES, i as API_RULES, n as convertPiMcpConfig, o as EVENT_RULES, r as renderMcpPatch, s as HOST_IMPORT_RULES } from "./mcp-config-CyCPWeUs.mjs";
4
+ import { c as UI_CONTEXT_RULES, i as HOST_IMPORT_RULES, n as CONTEXT_RULES, r as EVENT_RULES, t as API_RULES } from "./compatibility-D_PV1zgF.mjs";
4
5
  import { writeFileSync } from "node:fs";
5
6
  import { parseArgs } from "node:util";
6
7
  //#region src/cli.ts
@@ -75,7 +76,7 @@ async function main() {
75
76
  if (command !== "inspect" || source === void 0) throw new Error(`invalid command\n\n${usage()}`);
76
77
  const pkg = await resolvePiPackage(source);
77
78
  try {
78
- const { analyzePackage } = await import("./analyzer-DLwDZoYB.mjs");
79
+ const { analyzePackage } = await import("./analyzer-BL7Nfvko.mjs");
79
80
  const report = await analyzePackage(pkg);
80
81
  console.log(parsed.values.json ? JSON.stringify(report, null, 2) : reportText(report));
81
82
  if (report.verdict === "blocked") process.exitCode = 2;
package/dist/cli.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["// The analyzer (which pulls the 23 MB typescript compiler, an optional peer)\n// loads lazily inside its own command only — `matrix` and `mcp-config` must\n// run on an install without typescript.\nimport { writeFileSync } from 'node:fs'\nimport { parseArgs } from 'node:util'\nimport { API_RULES, CONTEXT_RULES, EVENT_RULES, HOST_IMPORT_RULES, UI_CONTEXT_RULES } from './compatibility.js'\nimport { convertPiMcpConfig, renderMcpPatch } from './mcp-config.js'\nimport { resolvePiPackage } from './source.js'\nimport type { CompatibilityReport } from './types.js'\n\nfunction usage(): string {\n return `pi2dsh — migrate Pi packages to DeepSeek Harness\\n\\n`\n + `Usage:\\n`\n + ` pi2dsh inspect <package-or-path> [--json]\\n`\n + ` pi2dsh mcp-config [--cwd <dir>] [--out <file>] [--json]\\n`\n + ` pi2dsh matrix [--json]\\n\\n`\n + `Installing is dsh's own job — \\`dsh plugin add pi2dsh\\`, then\\n`\n + `\\`dsh plugin add <pi package>\\`. This CLI only inspects.\\n\\n`\n + `mcp-config reads Pi's standard mcpServers files (six-layer precedence)\\n`\n + `and emits DSH cordis.patch.yml entries for the official dsh-mcp-client —\\n`\n + `Pi's MCP adapter code is never executed.\\n`\n}\n\nfunction reportText(report: CompatibilityReport): string {\n const lines = [\n `${report.package.name}@${report.package.version}: ${report.verdict.toUpperCase()}`,\n `full=${report.summary.full} partial=${report.summary.partial} unsupported=${report.summary.unsupported}`,\n `extensions=${report.resources.extensions.length} skills=${report.resources.skills.length} prompts=${report.resources.prompts.length} themes=${report.resources.themes.length}`,\n ]\n for (const finding of report.findings) {\n lines.push(`${finding.level.toUpperCase().padEnd(11)} ${finding.file}:${finding.line} ${finding.capability} — ${finding.detail}`)\n }\n return lines.join('\\n')\n}\n\nfunction matrix(json: boolean): void {\n const value = {\n api: API_RULES,\n events: EVENT_RULES,\n context: CONTEXT_RULES,\n uiContext: UI_CONTEXT_RULES,\n hostImports: HOST_IMPORT_RULES,\n }\n if (json) console.log(JSON.stringify(value, null, 2))\n else {\n for (const [kind, rules] of Object.entries(value)) {\n console.log(`${kind}:`)\n for (const [name, candidate] of Object.entries(rules)) {\n if ('level' in candidate && 'detail' in candidate) {\n console.log(` ${candidate.level.padEnd(11)} ${name} — ${candidate.detail}`)\n } else {\n const hostRules = candidate as Readonly<Record<string, { level: string; detail: string }>>\n for (const [exportName, hostRule] of Object.entries(hostRules)) {\n console.log(` ${hostRule.level.padEnd(11)} ${name}:${exportName} — ${hostRule.detail}`)\n }\n }\n }\n }\n }\n}\n\nasync function main(): Promise<void> {\n const parsed = parseArgs({\n allowPositionals: true,\n strict: true,\n options: {\n json: { type: 'boolean', default: false },\n out: { type: 'string' },\n cwd: { type: 'string' },\n help: { type: 'boolean', short: 'h', default: false },\n },\n })\n const [command, source] = parsed.positionals\n if (parsed.values.help || command === undefined) {\n console.log(usage())\n return\n }\n if (command === 'matrix') {\n matrix(parsed.values.json)\n return\n }\n if (command === 'mcp-config') {\n const result = convertPiMcpConfig(parsed.values.cwd ?? process.cwd())\n for (const warning of result.warnings) {\n console.error(`warning: ${warning.server}: ${warning.message}`)\n }\n const output = parsed.values.json ? `${JSON.stringify(result, null, 2)}\\n` : renderMcpPatch(result)\n if (parsed.values.out === undefined) process.stdout.write(output)\n else {\n writeFileSync(parsed.values.out, output)\n console.error(`wrote ${result.entries.length} MCP server entr${result.entries.length === 1 ? 'y' : 'ies'} from ${result.sources.length} Pi config file(s) to ${parsed.values.out}`)\n }\n return\n }\n if (command !== 'inspect' || source === undefined) {\n throw new Error(`invalid command\\n\\n${usage()}`)\n }\n\n const pkg = await resolvePiPackage(source)\n try {\n const { analyzePackage } = await import('./analyzer.js')\n const report = await analyzePackage(pkg)\n console.log(parsed.values.json ? JSON.stringify(report, null, 2) : reportText(report))\n if (report.verdict === 'blocked') process.exitCode = 2\n } finally {\n await pkg.dispose()\n }\n}\n\nmain().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : String(error))\n process.exitCode = 1\n})\n"],"mappings":";;;;;;AAUA,SAAS,QAAgB;CACvB,OAAO;AAUT;AAEA,SAAS,WAAW,QAAqC;CACvD,MAAM,QAAQ;EACZ,GAAG,OAAO,QAAQ,KAAK,GAAG,OAAO,QAAQ,QAAQ,IAAI,OAAO,QAAQ,YAAY;EAChF,QAAQ,OAAO,QAAQ,KAAK,WAAW,OAAO,QAAQ,QAAQ,eAAe,OAAO,QAAQ;EAC5F,cAAc,OAAO,UAAU,WAAW,OAAO,UAAU,OAAO,UAAU,OAAO,OAAO,WAAW,OAAO,UAAU,QAAQ,OAAO,UAAU,OAAO,UAAU,OAAO;CACzK;CACA,KAAK,MAAM,WAAW,OAAO,UAC3B,MAAM,KAAK,GAAG,QAAQ,MAAM,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,QAAQ,KAAK,GAAG,QAAQ,KAAK,GAAG,QAAQ,WAAW,KAAK,QAAQ,QAAQ;CAElI,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,OAAO,MAAqB;CACnC,MAAM,QAAQ;EACZ,KAAK;EACL,QAAQ;EACR,SAAS;EACT,WAAW;EACX,aAAa;CACf;CACA,IAAI,MAAM,QAAQ,IAAI,KAAK,UAAU,OAAO,MAAM,CAAC,CAAC;MAElD,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,KAAK,GAAG;EACjD,QAAQ,IAAI,GAAG,KAAK,EAAE;EACtB,KAAK,MAAM,CAAC,MAAM,cAAc,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,WAAW,IAAI,MAAM,MAAM,QAAQ,OAAO,QAAQ,OAAO,wBAAwB,OAAO,OAAO,KAAK;EACpL;EACA;CACF;CACA,IAAI,YAAY,aAAa,WAAW,KAAA,GACtC,MAAM,IAAI,MAAM,sBAAsB,MAAM,GAAG;CAGjD,MAAM,MAAM,MAAM,iBAAiB,MAAM;CACzC,IAAI;EACF,MAAM,EAAE,mBAAmB,MAAM,OAAO;EACxC,MAAM,SAAS,MAAM,eAAe,GAAG;EACvC,QAAQ,IAAI,OAAO,OAAO,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC;EACrF,IAAI,OAAO,YAAY,WAAW,QAAQ,WAAW;CACvD,UAAU;EACR,MAAM,IAAI,QAAQ;CACpB;AACF;AAEA,KAAK,CAAC,CAAC,OAAO,UAAmB;CAC/B,QAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CACpE,QAAQ,WAAW;AACrB,CAAC"}
1
+ {"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["// The analyzer (which pulls the 23 MB typescript compiler, an optional peer)\n// loads lazily inside its own command only — `matrix` and `mcp-config` must\n// run on an install without typescript.\nimport { writeFileSync } from 'node:fs'\nimport { parseArgs } from 'node:util'\nimport { API_RULES, CONTEXT_RULES, EVENT_RULES, HOST_IMPORT_RULES, UI_CONTEXT_RULES } from './compatibility.js'\nimport { convertPiMcpConfig, renderMcpPatch } from './mcp-config.js'\nimport { resolvePiPackage } from './source.js'\nimport type { CompatibilityReport } from './types.js'\n\nfunction usage(): string {\n return `pi2dsh — migrate Pi packages to DeepSeek Harness\\n\\n`\n + `Usage:\\n`\n + ` pi2dsh inspect <package-or-path> [--json]\\n`\n + ` pi2dsh mcp-config [--cwd <dir>] [--out <file>] [--json]\\n`\n + ` pi2dsh matrix [--json]\\n\\n`\n + `Installing is dsh's own job — \\`dsh plugin add pi2dsh\\`, then\\n`\n + `\\`dsh plugin add <pi package>\\`. This CLI only inspects.\\n\\n`\n + `mcp-config reads Pi's standard mcpServers files (six-layer precedence)\\n`\n + `and emits DSH cordis.patch.yml entries for the official dsh-mcp-client —\\n`\n + `Pi's MCP adapter code is never executed.\\n`\n}\n\nfunction reportText(report: CompatibilityReport): string {\n const lines = [\n `${report.package.name}@${report.package.version}: ${report.verdict.toUpperCase()}`,\n `full=${report.summary.full} partial=${report.summary.partial} unsupported=${report.summary.unsupported}`,\n `extensions=${report.resources.extensions.length} skills=${report.resources.skills.length} prompts=${report.resources.prompts.length} themes=${report.resources.themes.length}`,\n ]\n for (const finding of report.findings) {\n lines.push(`${finding.level.toUpperCase().padEnd(11)} ${finding.file}:${finding.line} ${finding.capability} — ${finding.detail}`)\n }\n return lines.join('\\n')\n}\n\nfunction matrix(json: boolean): void {\n const value = {\n api: API_RULES,\n events: EVENT_RULES,\n context: CONTEXT_RULES,\n uiContext: UI_CONTEXT_RULES,\n hostImports: HOST_IMPORT_RULES,\n }\n if (json) console.log(JSON.stringify(value, null, 2))\n else {\n for (const [kind, rules] of Object.entries(value)) {\n console.log(`${kind}:`)\n for (const [name, candidate] of Object.entries(rules)) {\n if ('level' in candidate && 'detail' in candidate) {\n console.log(` ${candidate.level.padEnd(11)} ${name} — ${candidate.detail}`)\n } else {\n const hostRules = candidate as Readonly<Record<string, { level: string; detail: string }>>\n for (const [exportName, hostRule] of Object.entries(hostRules)) {\n console.log(` ${hostRule.level.padEnd(11)} ${name}:${exportName} — ${hostRule.detail}`)\n }\n }\n }\n }\n }\n}\n\nasync function main(): Promise<void> {\n const parsed = parseArgs({\n allowPositionals: true,\n strict: true,\n options: {\n json: { type: 'boolean', default: false },\n out: { type: 'string' },\n cwd: { type: 'string' },\n help: { type: 'boolean', short: 'h', default: false },\n },\n })\n const [command, source] = parsed.positionals\n if (parsed.values.help || command === undefined) {\n console.log(usage())\n return\n }\n if (command === 'matrix') {\n matrix(parsed.values.json)\n return\n }\n if (command === 'mcp-config') {\n const result = convertPiMcpConfig(parsed.values.cwd ?? process.cwd())\n for (const warning of result.warnings) {\n console.error(`warning: ${warning.server}: ${warning.message}`)\n }\n const output = parsed.values.json ? `${JSON.stringify(result, null, 2)}\\n` : renderMcpPatch(result)\n if (parsed.values.out === undefined) process.stdout.write(output)\n else {\n writeFileSync(parsed.values.out, output)\n console.error(`wrote ${result.entries.length} MCP server entr${result.entries.length === 1 ? 'y' : 'ies'} from ${result.sources.length} Pi config file(s) to ${parsed.values.out}`)\n }\n return\n }\n if (command !== 'inspect' || source === undefined) {\n throw new Error(`invalid command\\n\\n${usage()}`)\n }\n\n const pkg = await resolvePiPackage(source)\n try {\n const { analyzePackage } = await import('./analyzer.js')\n const report = await analyzePackage(pkg)\n console.log(parsed.values.json ? JSON.stringify(report, null, 2) : reportText(report))\n if (report.verdict === 'blocked') process.exitCode = 2\n } finally {\n await pkg.dispose()\n }\n}\n\nmain().catch((error: unknown) => {\n console.error(error instanceof Error ? error.message : String(error))\n process.exitCode = 1\n})\n"],"mappings":";;;;;;;AAUA,SAAS,QAAgB;CACvB,OAAO;AAUT;AAEA,SAAS,WAAW,QAAqC;CACvD,MAAM,QAAQ;EACZ,GAAG,OAAO,QAAQ,KAAK,GAAG,OAAO,QAAQ,QAAQ,IAAI,OAAO,QAAQ,YAAY;EAChF,QAAQ,OAAO,QAAQ,KAAK,WAAW,OAAO,QAAQ,QAAQ,eAAe,OAAO,QAAQ;EAC5F,cAAc,OAAO,UAAU,WAAW,OAAO,UAAU,OAAO,UAAU,OAAO,OAAO,WAAW,OAAO,UAAU,QAAQ,OAAO,UAAU,OAAO,UAAU,OAAO;CACzK;CACA,KAAK,MAAM,WAAW,OAAO,UAC3B,MAAM,KAAK,GAAG,QAAQ,MAAM,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE,GAAG,QAAQ,KAAK,GAAG,QAAQ,KAAK,GAAG,QAAQ,WAAW,KAAK,QAAQ,QAAQ;CAElI,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA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,OAAO,IAAI,QAAQ,SAAS;EAEhE,MAAM,SAAS,OAAO,OAAO,OAAO,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,MAAM,eAAe,MAAM;EAClG,IAAI,OAAO,OAAO,QAAQ,KAAA,GAAW,QAAQ,OAAO,MAAM,MAAM;OAC3D;GACH,cAAc,OAAO,OAAO,KAAK,MAAM;GACvC,QAAQ,MAAM,SAAS,OAAO,QAAQ,OAAO,kBAAkB,OAAO,QAAQ,WAAW,IAAI,MAAM,MAAM,QAAQ,OAAO,QAAQ,OAAO,wBAAwB,OAAO,OAAO,KAAK;EACpL;EACA;CACF;CACA,IAAI,YAAY,aAAa,WAAW,KAAA,GACtC,MAAM,IAAI,MAAM,sBAAsB,MAAM,GAAG;CAGjD,MAAM,MAAM,MAAM,iBAAiB,MAAM;CACzC,IAAI;EACF,MAAM,EAAE,mBAAmB,MAAM,OAAO;EACxC,MAAM,SAAS,MAAM,eAAe,GAAG;EACvC,QAAQ,IAAI,OAAO,OAAO,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC;EACrF,IAAI,OAAO,YAAY,WAAW,QAAQ,WAAW;CACvD,UAAU;EACR,MAAM,IAAI,QAAQ;CACpB;AACF;AAEA,KAAK,CAAC,CAAC,OAAO,UAAmB;CAC/B,QAAQ,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CACpE,QAAQ,WAAW;AACrB,CAAC"}
@@ -1,3 +1,3 @@
1
1
 
2
- import { $ as generateBranchSummary, $n as buildContextEntries, $t as collectEntriesForBranchSummary, A as SettingsManagerCreateOptions, An as TruncationOptions, At as ShellConfig, B as VERSION, Bn as CustomMessageEntry, Bt as parseFrontmatter, C as RegisteredToolRecord, Cn as createLocalBashOperations, Ct as processImage, D as SettingsCallbacks, Dn as withFileMutationQueue, Dt as theme, E as RetrySettings, En as getAgentDir, Et as resizeImage, F as ThemeColor, Fn as truncateTail, Ft as ProjectTrustStore, G as convertToPng, Gn as SessionHeader, Gt as CompactionPreparation, H as __runWithSubagentSessionFactory, Hn as ModelChangeEntry, Ht as BranchPreparation, I as ToolExecutionComponent, In as BranchSummaryEntry, It as wrapRegisteredTool, J as createCodingTools, Jn as SessionManager, Jt as CutPointResult, K as copyToClipboard, Kn as SessionInfo, Kt as CompactionResult, L as ToolExecutionOptions, Ln as CURRENT_SESSION_VERSION, Lt as wrapRegisteredTools, M as StoredCredential, Mn as formatSize, Mt as formatSkillsForPrompt, N as Theme, Nn as truncateHead, Nt as loadSkills, O as SettingsConfig, On as DEFAULT_MAX_BYTES, Ot as renderDiff, P as ThemeBg, Pn as truncateLine, Pt as loadSkillsFromDir, Q as ensureTool, Qn as assertValidSessionId, Qt as calculateContextTokens, R as TuiMode, Rn as CompactionEntry, Rt as wrapToolDefinition, S as ParsedSkillBlock, Sn as createBashToolDefinition, St as parseSkillBlock, T as ResizedImage, Tn as createExtensionRuntime, Tt as readStoredCredential, U as __setSubagentSessionFactory, Un as SessionContext, Ut as BranchSummaryResult, V as VisualTruncateResult, Vn as LabelEntry, Vt as stripFrontmatter, W as compact, Wn as SessionEntry, Wt as CollectEntriesResult, X as createReadOnlyTools, Xn as SessionTreeNode, Xt as FileOperations, Y as createEventBus, Yn as SessionMessageEntry, Yt as DEFAULT_COMPACTION_SETTINGS, Z as defineTool, Zn as ThinkingLevelChangeEntry, Zt as GenerateBranchSummaryOptions, _ as ImageResizeOptions, _n as createEditToolDefinition, _r as convertToLlm, _t as isReadToolResult, a as CustomEditor, an as prepareCompaction, ar as migrateSessionEntries, at as getPackageDir, b as ModelRuntime, bn as bashToolSystemPromptContribution, br as createCustomMessage, bt as keyHint, c as DefaultProjectTrust, cn as createLsTool, cr as BRANCH_SUMMARY_PREFIX, ct as getSettingsListTheme, d as ExtensionEditorComponent, dn as createFindToolDefinition, dr as BranchSummaryMessage, dt as initTheme, en as estimateTokens, er as buildSessionContext, et as generateSummary, f as ExtensionInputComponent, fn as createGrepTool, fr as COMPACTION_SUMMARY_PREFIX, ft as isBashToolResult, g as FooterComponent, gn as createEditTool, gr as bashExecutionToText, gt as isLsToolResult, h as FileSettingsStorage, hn as createWriteToolDefinition, hr as CustomMessage, ht as isGrepToolResult, i as ColorMode, in as prepareBranchEntries, ir as loadEntriesFromFile, it as getMarkdownTheme, j as SettingsSelectorComponent, jn as TruncationResult, jt as getShellConfig, k as SettingsManager, kn as DEFAULT_MAX_LINES, kt as truncateToVisualLines, l as DefaultResourceLoader, ln as createLsToolDefinition, lr as BRANCH_SUMMARY_SUFFIX, lt as getToolPath, m as ExtensionSelectorComponent, mn as createWriteTool, mr as CompactionSummaryMessage, mt as isFindToolResult, n as BorderedLoader, nn as findTurnStartIndex, nr as getDefaultSessionDir, nt as getBinDir, o as CustomMessageComponent, on as serializeConversation, or as parseSessionEntries, ot as getReadmePath, p as ExtensionRunner, pn as createGrepToolDefinition, pr as COMPACTION_SUMMARY_SUFFIX, pt as isEditToolResult, q as createAgentSession, qn as SessionInfoEntry, qt as CompactionSettings, r as CONFIG_DIR_NAME, rn as getLastAssistantUsage, rr as getLatestCompactionEntry, rt as getLanguageFromPath, s as DefaultPackageManager, sn as shouldCompact, sr as sessionEntryToContextMessages, st as getSelectListTheme, t as AssistantMessageComponent, tn as findCutPoint, tr as findMostRecentSession, tt as generateSummaryWithUsage, u as DynamicBorder, un as createFindTool, ur as BashExecutionMessage, ut as highlightCode, v as InMemorySettingsStorage, vn as createReadTool, vr as createBranchSummaryMessage, vt as isToolCallEventType, w as RenderDiffOptions, wn as ExtensionRuntime, wt as rawKeyHint, x as PackageSource, xn as createBashTool, xt as keyText, y as ModelRegistry, yn as createReadToolDefinition, yr as createCompactionSummaryMessage, yt as isWriteToolResult, z as UserMessageComponent, zn as CustomEntry, zt as wrapToolDefinitions } from "../pi-coding-agent-69yY0ke-.mjs";
3
- export { AssistantMessageComponent, BRANCH_SUMMARY_PREFIX, BRANCH_SUMMARY_SUFFIX, type BashExecutionMessage, BorderedLoader, type BranchPreparation, type BranchSummaryEntry, type BranchSummaryMessage, type BranchSummaryResult, COMPACTION_SUMMARY_PREFIX, COMPACTION_SUMMARY_SUFFIX, CONFIG_DIR_NAME, CURRENT_SESSION_VERSION, type CollectEntriesResult, ColorMode, type CompactionEntry, type CompactionPreparation, type CompactionResult, type CompactionSettings, type CompactionSummaryMessage, CustomEditor, type CustomEntry, type CustomMessage, CustomMessageComponent, type CustomMessageEntry, type CutPointResult, DEFAULT_COMPACTION_SETTINGS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DefaultPackageManager, DefaultProjectTrust, DefaultResourceLoader, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionRunner, type ExtensionRuntime, ExtensionSelectorComponent, type FileOperations, FileSettingsStorage, FooterComponent, type GenerateBranchSummaryOptions, ImageResizeOptions, InMemorySettingsStorage, type LabelEntry, type ModelChangeEntry, ModelRegistry, ModelRuntime, PackageSource, ParsedSkillBlock, ProjectTrustStore, RegisteredToolRecord, RenderDiffOptions, ResizedImage, RetrySettings, type SessionContext, type SessionEntry, type SessionHeader, type SessionInfo, type SessionInfoEntry, SessionManager, type SessionMessageEntry, type SessionTreeNode, SettingsCallbacks, SettingsConfig, SettingsManager, SettingsManagerCreateOptions, SettingsSelectorComponent, type ShellConfig, StoredCredential, Theme, ThemeBg, ThemeColor, type ThinkingLevelChangeEntry, ToolExecutionComponent, ToolExecutionOptions, type TruncationOptions, type TruncationResult, TuiMode, UserMessageComponent, VERSION, VisualTruncateResult, __runWithSubagentSessionFactory, __setSubagentSessionFactory, assertValidSessionId, bashExecutionToText, bashToolSystemPromptContribution, buildContextEntries, buildSessionContext, calculateContextTokens, collectEntriesForBranchSummary, compact, convertToLlm, convertToPng, copyToClipboard, createAgentSession, createBashTool, createBashToolDefinition, createBranchSummaryMessage, createCodingTools, createCompactionSummaryMessage, createCustomMessage, createEditTool, createEditToolDefinition, createEventBus, createExtensionRuntime, createFindTool, createFindToolDefinition, createGrepTool, createGrepToolDefinition, createLocalBashOperations, createLsTool, createLsToolDefinition, createReadOnlyTools, createReadTool, createReadToolDefinition, createWriteTool, createWriteToolDefinition, defineTool, ensureTool, estimateTokens, findCutPoint, findMostRecentSession, findTurnStartIndex, formatSize, formatSkillsForPrompt, generateBranchSummary, generateSummary, generateSummaryWithUsage, getAgentDir, getBinDir, getDefaultSessionDir, getLanguageFromPath, getLastAssistantUsage, getLatestCompactionEntry, getMarkdownTheme, getPackageDir, getReadmePath, getSelectListTheme, getSettingsListTheme, getShellConfig, getToolPath, highlightCode, initTheme, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, keyHint, keyText, loadEntriesFromFile, loadSkills, loadSkillsFromDir, migrateSessionEntries, parseFrontmatter, parseSessionEntries, parseSkillBlock, prepareBranchEntries, prepareCompaction, processImage, rawKeyHint, readStoredCredential, renderDiff, resizeImage, serializeConversation, sessionEntryToContextMessages, shouldCompact, stripFrontmatter, theme, truncateHead, truncateLine, truncateTail, truncateToVisualLines, withFileMutationQueue, wrapRegisteredTool, wrapRegisteredTools, wrapToolDefinition, wrapToolDefinitions };
2
+ import { $ as generateBranchSummary, $n as assertValidSessionId, $t as calculateContextTokens, A as SettingsManagerCreateOptions, An as DEFAULT_MAX_LINES, At as truncateToVisualLines, B as VERSION, Bn as CustomEntry, Bt as wrapToolDefinitions, C as RegisteredToolRecord, Cn as createBashToolDefinition, Ct as processImage, D as SettingsCallbacks, Dn as getAgentDir, Dt as resizeImage, E as RetrySettings, En as createExtensionRuntime, Et as readStoredCredential, F as ThemeColor, Fn as truncateLine, Ft as loadSkillsFromDir, G as convertToPng, Gn as SessionEntry, Gt as CollectEntriesResult, H as __runWithSubagentSessionFactory, Hn as LabelEntry, Ht as stripFrontmatter, I as ToolExecutionComponent, In as truncateTail, It as ProjectTrustStore, J as createCodingTools, Jn as SessionInfoEntry, Jt as CompactionSettings, K as copyToClipboard, Kn as SessionHeader, Kt as CompactionPreparation, L as ToolExecutionOptions, Ln as BranchSummaryEntry, Lt as wrapRegisteredTool, M as StoredCredential, Mn as TruncationResult, Mt as getShellConfig, N as Theme, Nn as formatSize, Nt as formatSkillsForPrompt, O as SettingsConfig, On as withFileMutationQueue, Ot as theme, P as ThemeBg, Pn as truncateHead, Pt as loadSkills, Q as ensureTool, Qn as ThinkingLevelChangeEntry, Qt as GenerateBranchSummaryOptions, R as TuiMode, Rn as CURRENT_SESSION_VERSION, Rt as wrapRegisteredTools, S as ParsedSkillBlock, Sn as createBashTool, St as parseSkillBlock, T as ResizedImage, Tn as ExtensionRuntime, Tt as rawKeyHint, U as __setSubagentSessionFactory, Un as ModelChangeEntry, Ut as BranchPreparation, V as VisualTruncateResult, Vn as CustomMessageEntry, Vt as parseFrontmatter, W as compact, Wn as SessionContext, Wt as BranchSummaryResult, X as createReadOnlyTools, Xn as SessionMessageEntry, Xt as DEFAULT_COMPACTION_SETTINGS, Y as createEventBus, Yn as SessionManager, Yt as CutPointResult, Z as defineTool, Zn as SessionTreeNode, Zt as FileOperations, _ as ImageResizeOptions, _n as createEditTool, _r as bashExecutionToText, _t as isReadToolResult, a as CustomEditor, an as prepareBranchEntries, ar as loadEntriesFromFile, at as getPackageDir, b as ModelRuntime, bn as createReadToolDefinition, br as createCompactionSummaryMessage, bt as keyHint, c as DefaultProjectTrust, cn as shouldCompact, cr as sessionEntryToContextMessages, ct as getSettingsListTheme, d as ExtensionEditorComponent, dn as createFindTool, dr as BashExecutionMessage, dt as initTheme, en as collectEntriesForBranchSummary, er as buildContextEntries, et as generateSummary, f as ExtensionInputComponent, fn as createFindToolDefinition, fr as BranchSummaryMessage, ft as isBashToolResult, g as FooterComponent, gn as createWriteToolDefinition, gr as CustomMessage, gt as isLsToolResult, h as FileSettingsStorage, hn as createWriteTool, hr as CompactionSummaryMessage, ht as isGrepToolResult, i as ColorMode, in as getLastAssistantUsage, ir as getLatestCompactionEntry, it as getMarkdownTheme, j as SettingsSelectorComponent, jn as TruncationOptions, jt as ShellConfig, k as SettingsManager, kn as DEFAULT_MAX_BYTES, kt as renderDiff, l as DefaultResourceLoader, ln as createLsTool, lr as BRANCH_SUMMARY_PREFIX, lt as getToolPath, m as ExtensionSelectorComponent, mn as createGrepToolDefinition, mr as COMPACTION_SUMMARY_SUFFIX, mt as isFindToolResult, n as BorderedLoader, nn as findCutPoint, nr as findMostRecentSession, nt as getBinDir, o as CustomMessageComponent, on as prepareCompaction, or as migrateSessionEntries, ot as getReadmePath, p as ExtensionRunner, pn as createGrepTool, pr as COMPACTION_SUMMARY_PREFIX, pt as isEditToolResult, q as createAgentSession, qn as SessionInfo, qt as CompactionResult, r as CONFIG_DIR_NAME, rn as findTurnStartIndex, rr as getDefaultSessionDir, rt as getLanguageFromPath, s as DefaultPackageManager, sn as serializeConversation, sr as parseSessionEntries, st as getSelectListTheme, t as AssistantMessageComponent, tn as estimateTokens, tr as buildSessionContext, tt as generateSummaryWithUsage, u as DynamicBorder, un as createLsToolDefinition, ur as BRANCH_SUMMARY_SUFFIX, ut as highlightCode, v as InMemorySettingsStorage, vn as createEditToolDefinition, vr as convertToLlm, vt as isToolCallEventType, w as RenderDiffOptions, wn as createLocalBashOperations, wt as providePiExtensionDiscovery, x as PackageSource, xn as bashToolSystemPromptContribution, xr as createCustomMessage, xt as keyText, y as ModelRegistry, yn as createReadTool, yr as createBranchSummaryMessage, yt as isWriteToolResult, z as UserMessageComponent, zn as CompactionEntry, zt as wrapToolDefinition } from "../pi-coding-agent-Pvy0m9tS.mjs";
3
+ export { AssistantMessageComponent, BRANCH_SUMMARY_PREFIX, BRANCH_SUMMARY_SUFFIX, type BashExecutionMessage, BorderedLoader, type BranchPreparation, type BranchSummaryEntry, type BranchSummaryMessage, type BranchSummaryResult, COMPACTION_SUMMARY_PREFIX, COMPACTION_SUMMARY_SUFFIX, CONFIG_DIR_NAME, CURRENT_SESSION_VERSION, type CollectEntriesResult, ColorMode, type CompactionEntry, type CompactionPreparation, type CompactionResult, type CompactionSettings, type CompactionSummaryMessage, CustomEditor, type CustomEntry, type CustomMessage, CustomMessageComponent, type CustomMessageEntry, type CutPointResult, DEFAULT_COMPACTION_SETTINGS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DefaultPackageManager, DefaultProjectTrust, DefaultResourceLoader, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionRunner, type ExtensionRuntime, ExtensionSelectorComponent, type FileOperations, FileSettingsStorage, FooterComponent, type GenerateBranchSummaryOptions, ImageResizeOptions, InMemorySettingsStorage, type LabelEntry, type ModelChangeEntry, ModelRegistry, ModelRuntime, PackageSource, ParsedSkillBlock, ProjectTrustStore, RegisteredToolRecord, RenderDiffOptions, ResizedImage, RetrySettings, type SessionContext, type SessionEntry, type SessionHeader, type SessionInfo, type SessionInfoEntry, SessionManager, type SessionMessageEntry, type SessionTreeNode, SettingsCallbacks, SettingsConfig, SettingsManager, SettingsManagerCreateOptions, SettingsSelectorComponent, type ShellConfig, StoredCredential, Theme, ThemeBg, ThemeColor, type ThinkingLevelChangeEntry, ToolExecutionComponent, ToolExecutionOptions, type TruncationOptions, type TruncationResult, TuiMode, UserMessageComponent, VERSION, VisualTruncateResult, __runWithSubagentSessionFactory, __setSubagentSessionFactory, assertValidSessionId, bashExecutionToText, bashToolSystemPromptContribution, buildContextEntries, buildSessionContext, calculateContextTokens, collectEntriesForBranchSummary, compact, convertToLlm, convertToPng, copyToClipboard, createAgentSession, createBashTool, createBashToolDefinition, createBranchSummaryMessage, createCodingTools, createCompactionSummaryMessage, createCustomMessage, createEditTool, createEditToolDefinition, createEventBus, createExtensionRuntime, createFindTool, createFindToolDefinition, createGrepTool, createGrepToolDefinition, createLocalBashOperations, createLsTool, createLsToolDefinition, createReadOnlyTools, createReadTool, createReadToolDefinition, createWriteTool, createWriteToolDefinition, defineTool, ensureTool, estimateTokens, findCutPoint, findMostRecentSession, findTurnStartIndex, formatSize, formatSkillsForPrompt, generateBranchSummary, generateSummary, generateSummaryWithUsage, getAgentDir, getBinDir, getDefaultSessionDir, getLanguageFromPath, getLastAssistantUsage, getLatestCompactionEntry, getMarkdownTheme, getPackageDir, getReadmePath, getSelectListTheme, getSettingsListTheme, getShellConfig, getToolPath, highlightCode, initTheme, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, keyHint, keyText, loadEntriesFromFile, loadSkills, loadSkillsFromDir, migrateSessionEntries, parseFrontmatter, parseSessionEntries, parseSkillBlock, prepareBranchEntries, prepareCompaction, processImage, providePiExtensionDiscovery, rawKeyHint, readStoredCredential, renderDiff, resizeImage, serializeConversation, sessionEntryToContextMessages, shouldCompact, stripFrontmatter, theme, truncateHead, truncateLine, truncateTail, truncateToVisualLines, withFileMutationQueue, wrapRegisteredTool, wrapRegisteredTools, wrapToolDefinition, wrapToolDefinitions };
@@ -1,4 +1,4 @@
1
1
 
2
- import { $ as isReadToolResult, $t as DEFAULT_MAX_LINES, A as createCodingTools, At as serializeConversation, B as getMarkdownTheme, Bt as createEditTool, C as VERSION, Cn as createCompactionSummaryMessage, Ct as collectEntriesForBranchSummary, D as convertToPng, Dt as getLastAssistantUsage, E as compact, Et as findTurnStartIndex, F as generateBranchSummary, Ft as createFindToolDefinition, G as getToolPath, Gt as bashToolSystemPromptContribution, H as getReadmePath, Ht as renderDiff, I as generateSummary, It as createGrepTool, J as isBashToolResult, Jt as createLocalBashOperations, K as highlightCode, Kt as createBashTool, L as generateSummaryWithUsage, Lt as createGrepToolDefinition, M as createReadOnlyTools, Mt as createLsTool, N as defineTool, Nt as createLsToolDefinition, O as copyToClipboard, Ot as prepareBranchEntries, P as ensureTool, Pt as createFindTool, Q as isLsToolResult, Qt as DEFAULT_MAX_BYTES, R as getBinDir, Rt as createWriteTool, S as UserMessageComponent, Sn as createBranchSummaryMessage, St as calculateContextTokens, T as __setSubagentSessionFactory, Tt as findCutPoint, U as getSelectListTheme, Ut as createReadTool, V as getPackageDir, Vt as createEditToolDefinition, W as getSettingsListTheme, Wt as createReadToolDefinition, X as isFindToolResult, Xt as createExtensionRuntime, Y as isEditToolResult, Yt as truncateToVisualLines, Z as isGrepToolResult, Zt as withFileMutationQueue, _ as ModelRuntime, _n as BRANCH_SUMMARY_SUFFIX, _t as wrapToolDefinition, a as CustomMessageComponent, an as SessionManager, at as processImage, b as Theme, bn as bashExecutionToText, bt as stripFrontmatter, c as DynamicBorder, cn as buildSessionContext, ct as resizeImage, d as ExtensionRunner, dn as getLatestCompactionEntry, dt as formatSkillsForPrompt, en as formatSize, et as isToolCallEventType, f as ExtensionSelectorComponent, fn as loadEntriesFromFile, ft as loadSkills, g as ModelRegistry, gn as BRANCH_SUMMARY_PREFIX, gt as wrapRegisteredTools, h as InMemorySettingsStorage, hn as sessionEntryToContextMessages, ht as wrapRegisteredTool, i as CustomEditor, in as CURRENT_SESSION_VERSION, it as parseSkillBlock, j as createEventBus, jt as shouldCompact, k as createAgentSession, kt as prepareCompaction, l as ExtensionEditorComponent, ln as findMostRecentSession, lt as theme, m as FooterComponent, mn as parseSessionEntries, mt as ProjectTrustStore, n as BorderedLoader, nn as truncateLine, nt as keyHint, o as DefaultPackageManager, on as assertValidSessionId, ot as rawKeyHint, p as FileSettingsStorage, pn as migrateSessionEntries, pt as loadSkillsFromDir, q as initTheme, qt as createBashToolDefinition, r as CONFIG_DIR_NAME, rn as truncateTail, rt as keyText, s as DefaultResourceLoader, sn as buildContextEntries, st as readStoredCredential, t as AssistantMessageComponent, tn as truncateHead, tt as isWriteToolResult, u as ExtensionInputComponent, un as getDefaultSessionDir, ut as getShellConfig, v as SettingsManager, vn as COMPACTION_SUMMARY_PREFIX, vt as wrapToolDefinitions, w as __runWithSubagentSessionFactory, wn as createCustomMessage, wt as estimateTokens, x as ToolExecutionComponent, xn as convertToLlm, xt as DEFAULT_COMPACTION_SETTINGS, y as SettingsSelectorComponent, yn as COMPACTION_SUMMARY_SUFFIX, yt as parseFrontmatter, z as getLanguageFromPath, zt as createWriteToolDefinition } from "../pi-coding-agent-DXJ_Jzo0.mjs";
2
+ import { $ as isReadToolResult, $t as DEFAULT_MAX_BYTES, A as createCodingTools, At as prepareCompaction, B as getMarkdownTheme, Bt as createWriteToolDefinition, C as VERSION, Cn as createBranchSummaryMessage, Ct as calculateContextTokens, D as convertToPng, Dt as findTurnStartIndex, E as compact, Et as findCutPoint, F as generateBranchSummary, Ft as createFindTool, G as getToolPath, Gt as createReadToolDefinition, H as getReadmePath, Ht as createEditToolDefinition, I as generateSummary, It as createFindToolDefinition, J as isBashToolResult, Jt as createBashToolDefinition, K as highlightCode, Kt as bashToolSystemPromptContribution, L as generateSummaryWithUsage, Lt as createGrepTool, M as createReadOnlyTools, Mt as shouldCompact, N as defineTool, Nt as createLsTool, O as copyToClipboard, Ot as getLastAssistantUsage, P as ensureTool, Pt as createLsToolDefinition, Q as isLsToolResult, Qt as withFileMutationQueue, R as getBinDir, Rt as createGrepToolDefinition, S as UserMessageComponent, Sn as convertToLlm, St as DEFAULT_COMPACTION_SETTINGS, T as __setSubagentSessionFactory, Tn as createCustomMessage, Tt as estimateTokens, U as getSelectListTheme, Ut as renderDiff, V as getPackageDir, Vt as createEditTool, W as getSettingsListTheme, Wt as createReadTool, X as isFindToolResult, Xt as truncateToVisualLines, Y as isEditToolResult, Yt as createLocalBashOperations, Z as isGrepToolResult, Zt as createExtensionRuntime, _ as ModelRuntime, _n as BRANCH_SUMMARY_PREFIX, _t as wrapRegisteredTools, a as CustomMessageComponent, an as CURRENT_SESSION_VERSION, at as processImage, b as Theme, bn as COMPACTION_SUMMARY_SUFFIX, bt as parseFrontmatter, c as DynamicBorder, cn as buildContextEntries, ct as readStoredCredential, d as ExtensionRunner, dn as getDefaultSessionDir, dt as getShellConfig, en as DEFAULT_MAX_LINES, et as isToolCallEventType, f as ExtensionSelectorComponent, fn as getLatestCompactionEntry, ft as formatSkillsForPrompt, g as ModelRegistry, gn as sessionEntryToContextMessages, gt as wrapRegisteredTool, h as InMemorySettingsStorage, hn as parseSessionEntries, ht as ProjectTrustStore, i as CustomEditor, in as truncateTail, it as parseSkillBlock, j as createEventBus, jt as serializeConversation, k as createAgentSession, kt as prepareBranchEntries, l as ExtensionEditorComponent, ln as buildSessionContext, lt as resizeImage, m as FooterComponent, mn as migrateSessionEntries, mt as loadSkillsFromDir, n as BorderedLoader, nn as truncateHead, nt as keyHint, o as DefaultPackageManager, on as SessionManager, ot as providePiExtensionDiscovery, p as FileSettingsStorage, pn as loadEntriesFromFile, pt as loadSkills, q as initTheme, qt as createBashTool, r as CONFIG_DIR_NAME, rn as truncateLine, rt as keyText, s as DefaultResourceLoader, sn as assertValidSessionId, st as rawKeyHint, t as AssistantMessageComponent, tn as formatSize, tt as isWriteToolResult, u as ExtensionInputComponent, un as findMostRecentSession, ut as theme, v as SettingsManager, vn as BRANCH_SUMMARY_SUFFIX, vt as wrapToolDefinition, w as __runWithSubagentSessionFactory, wn as createCompactionSummaryMessage, wt as collectEntriesForBranchSummary, x as ToolExecutionComponent, xn as bashExecutionToText, xt as stripFrontmatter, y as SettingsSelectorComponent, yn as COMPACTION_SUMMARY_PREFIX, yt as wrapToolDefinitions, z as getLanguageFromPath, zt as createWriteTool } from "../pi-coding-agent-CPXFo0UO.mjs";
3
3
  import { t as getAgentDir } from "../pi-config-shim-CZ1wFzqM.mjs";
4
- export { AssistantMessageComponent, BRANCH_SUMMARY_PREFIX, BRANCH_SUMMARY_SUFFIX, BorderedLoader, COMPACTION_SUMMARY_PREFIX, COMPACTION_SUMMARY_SUFFIX, CONFIG_DIR_NAME, CURRENT_SESSION_VERSION, CustomEditor, CustomMessageComponent, DEFAULT_COMPACTION_SETTINGS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DefaultPackageManager, DefaultResourceLoader, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionRunner, ExtensionSelectorComponent, FileSettingsStorage, FooterComponent, InMemorySettingsStorage, ModelRegistry, ModelRuntime, ProjectTrustStore, SessionManager, SettingsManager, SettingsSelectorComponent, Theme, ToolExecutionComponent, UserMessageComponent, VERSION, __runWithSubagentSessionFactory, __setSubagentSessionFactory, assertValidSessionId, bashExecutionToText, bashToolSystemPromptContribution, buildContextEntries, buildSessionContext, calculateContextTokens, collectEntriesForBranchSummary, compact, convertToLlm, convertToPng, copyToClipboard, createAgentSession, createBashTool, createBashToolDefinition, createBranchSummaryMessage, createCodingTools, createCompactionSummaryMessage, createCustomMessage, createEditTool, createEditToolDefinition, createEventBus, createExtensionRuntime, createFindTool, createFindToolDefinition, createGrepTool, createGrepToolDefinition, createLocalBashOperations, createLsTool, createLsToolDefinition, createReadOnlyTools, createReadTool, createReadToolDefinition, createWriteTool, createWriteToolDefinition, defineTool, ensureTool, estimateTokens, findCutPoint, findMostRecentSession, findTurnStartIndex, formatSize, formatSkillsForPrompt, generateBranchSummary, generateSummary, generateSummaryWithUsage, getAgentDir, getBinDir, getDefaultSessionDir, getLanguageFromPath, getLastAssistantUsage, getLatestCompactionEntry, getMarkdownTheme, getPackageDir, getReadmePath, getSelectListTheme, getSettingsListTheme, getShellConfig, getToolPath, highlightCode, initTheme, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, keyHint, keyText, loadEntriesFromFile, loadSkills, loadSkillsFromDir, migrateSessionEntries, parseFrontmatter, parseSessionEntries, parseSkillBlock, prepareBranchEntries, prepareCompaction, processImage, rawKeyHint, readStoredCredential, renderDiff, resizeImage, serializeConversation, sessionEntryToContextMessages, shouldCompact, stripFrontmatter, theme, truncateHead, truncateLine, truncateTail, truncateToVisualLines, withFileMutationQueue, wrapRegisteredTool, wrapRegisteredTools, wrapToolDefinition, wrapToolDefinitions };
4
+ export { AssistantMessageComponent, BRANCH_SUMMARY_PREFIX, BRANCH_SUMMARY_SUFFIX, BorderedLoader, COMPACTION_SUMMARY_PREFIX, COMPACTION_SUMMARY_SUFFIX, CONFIG_DIR_NAME, CURRENT_SESSION_VERSION, CustomEditor, CustomMessageComponent, DEFAULT_COMPACTION_SETTINGS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DefaultPackageManager, DefaultResourceLoader, DynamicBorder, ExtensionEditorComponent, ExtensionInputComponent, ExtensionRunner, ExtensionSelectorComponent, FileSettingsStorage, FooterComponent, InMemorySettingsStorage, ModelRegistry, ModelRuntime, ProjectTrustStore, SessionManager, SettingsManager, SettingsSelectorComponent, Theme, ToolExecutionComponent, UserMessageComponent, VERSION, __runWithSubagentSessionFactory, __setSubagentSessionFactory, assertValidSessionId, bashExecutionToText, bashToolSystemPromptContribution, buildContextEntries, buildSessionContext, calculateContextTokens, collectEntriesForBranchSummary, compact, convertToLlm, convertToPng, copyToClipboard, createAgentSession, createBashTool, createBashToolDefinition, createBranchSummaryMessage, createCodingTools, createCompactionSummaryMessage, createCustomMessage, createEditTool, createEditToolDefinition, createEventBus, createExtensionRuntime, createFindTool, createFindToolDefinition, createGrepTool, createGrepToolDefinition, createLocalBashOperations, createLsTool, createLsToolDefinition, createReadOnlyTools, createReadTool, createReadToolDefinition, createWriteTool, createWriteToolDefinition, defineTool, ensureTool, estimateTokens, findCutPoint, findMostRecentSession, findTurnStartIndex, formatSize, formatSkillsForPrompt, generateBranchSummary, generateSummary, generateSummaryWithUsage, getAgentDir, getBinDir, getDefaultSessionDir, getLanguageFromPath, getLastAssistantUsage, getLatestCompactionEntry, getMarkdownTheme, getPackageDir, getReadmePath, getSelectListTheme, getSettingsListTheme, getShellConfig, getToolPath, highlightCode, initTheme, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, keyHint, keyText, loadEntriesFromFile, loadSkills, loadSkillsFromDir, migrateSessionEntries, parseFrontmatter, parseSessionEntries, parseSkillBlock, prepareBranchEntries, prepareCompaction, processImage, providePiExtensionDiscovery, rawKeyHint, readStoredCredential, renderDiff, resizeImage, serializeConversation, sessionEntryToContextMessages, shouldCompact, stripFrontmatter, theme, truncateHead, truncateLine, truncateTail, truncateToVisualLines, withFileMutationQueue, wrapRegisteredTool, wrapRegisteredTools, wrapToolDefinition, wrapToolDefinitions };