pi2dsh 0.13.1 → 0.13.3

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 (106) hide show
  1. package/README.md +24 -20
  2. package/README.zh.md +20 -16
  3. package/dist/{analyzer-CJFwQlSG.mjs → analyzer-DBtUYKI1.mjs} +2 -2
  4. package/dist/{analyzer-CJFwQlSG.mjs.map → analyzer-DBtUYKI1.mjs.map} +1 -1
  5. package/dist/anthropic-messages-CaYTgvLF.mjs +6436 -0
  6. package/dist/anthropic-messages-CaYTgvLF.mjs.map +1 -0
  7. package/dist/azure-openai-responses-HKWkzl2m.mjs +208 -0
  8. package/dist/azure-openai-responses-HKWkzl2m.mjs.map +1 -0
  9. package/dist/cli.mjs +3 -2
  10. package/dist/cli.mjs.map +1 -1
  11. package/dist/compat/pi-ai.d.mts +3 -2636
  12. package/dist/compat/pi-ai.mjs +3 -2
  13. package/dist/compat/pi-coding-agent.d.mts +2 -2
  14. package/dist/compat/pi-coding-agent.mjs +2 -2
  15. package/dist/{mcp-config-_idn-pzI.mjs → compatibility-Bz6ZXA7F.mjs} +8 -185
  16. package/dist/compatibility-Bz6ZXA7F.mjs.map +1 -0
  17. package/dist/completionchunk-Dhk56lZl.mjs +5212 -0
  18. package/dist/completionchunk-Dhk56lZl.mjs.map +1 -0
  19. package/dist/{credentials-oauth-Txs6oew8.mjs → credentials-oauth-CAohSLcB.mjs} +3 -3
  20. package/dist/{credentials-oauth-Txs6oew8.mjs.map → credentials-oauth-CAohSLcB.mjs.map} +1 -1
  21. package/dist/credentials-oauth.mjs +1 -1
  22. package/dist/deferred-tools-BD4g5QUx.mjs +32 -0
  23. package/dist/deferred-tools-BD4g5QUx.mjs.map +1 -0
  24. package/dist/diagnostics-BqYkodgB.mjs +35 -0
  25. package/dist/diagnostics-BqYkodgB.mjs.map +1 -0
  26. package/dist/dist-QBBA-dL_.mjs +1246 -0
  27. package/dist/dist-QBBA-dL_.mjs.map +1 -0
  28. package/dist/error-body-DKA3lknR.mjs +104 -0
  29. package/dist/error-body-DKA3lknR.mjs.map +1 -0
  30. package/dist/event-stream-QxN1yvIF.mjs +64 -0
  31. package/dist/event-stream-QxN1yvIF.mjs.map +1 -0
  32. package/dist/from-BCscBQ9P.mjs +3856 -0
  33. package/dist/from-BCscBQ9P.mjs.map +1 -0
  34. package/dist/github-copilot-headers-CZo2QHrt.mjs +25 -0
  35. package/dist/github-copilot-headers-CZo2QHrt.mjs.map +1 -0
  36. package/dist/google-generative-ai-2gCFYp-t.mjs +356 -0
  37. package/dist/google-generative-ai-2gCFYp-t.mjs.map +1 -0
  38. package/dist/google-shared-75IdVyrx.mjs +29041 -0
  39. package/dist/google-shared-75IdVyrx.mjs.map +1 -0
  40. package/dist/google-vertex-Bhyo4z2i.mjs +400 -0
  41. package/dist/google-vertex-Bhyo4z2i.mjs.map +1 -0
  42. package/dist/hash-Dbggamac.mjs +19 -0
  43. package/dist/hash-Dbggamac.mjs.map +1 -0
  44. package/dist/headers-CPzZhJQn.mjs +17 -0
  45. package/dist/headers-CPzZhJQn.mjs.map +1 -0
  46. package/dist/host.d.mts +12 -2
  47. package/dist/host.d.mts.map +1 -1
  48. package/dist/host.mjs +43 -5
  49. package/dist/host.mjs.map +1 -1
  50. package/dist/index.d.mts +5 -3
  51. package/dist/index.d.mts.map +1 -1
  52. package/dist/index.mjs +51 -13
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/json-parse-CZ0U0sj_.mjs +384 -0
  55. package/dist/json-parse-CZ0U0sj_.mjs.map +1 -0
  56. package/dist/mcp-config-jmzbgdHa.mjs +181 -0
  57. package/dist/mcp-config-jmzbgdHa.mjs.map +1 -0
  58. package/dist/mistral-conversations-DJyeTo8C.mjs +36921 -0
  59. package/dist/mistral-conversations-DJyeTo8C.mjs.map +1 -0
  60. package/dist/multipart-parser-SRcGkVuX.mjs +301 -0
  61. package/dist/multipart-parser-SRcGkVuX.mjs.map +1 -0
  62. package/dist/{pi-ai-D7PqVeWs.mjs → openai-DkzRh5_G.mjs} +78 -5063
  63. package/dist/openai-DkzRh5_G.mjs.map +1 -0
  64. package/dist/openai-codex-responses-DedxQjNG.mjs +1220 -0
  65. package/dist/openai-codex-responses-DedxQjNG.mjs.map +1 -0
  66. package/dist/openai-completions-DrjrWRdX.mjs +945 -0
  67. package/dist/openai-completions-DrjrWRdX.mjs.map +1 -0
  68. package/dist/openai-prompt-cache-BDWtZRKh.mjs +11 -0
  69. package/dist/openai-prompt-cache-BDWtZRKh.mjs.map +1 -0
  70. package/dist/openai-responses-BRdGpBX6.mjs +251 -0
  71. package/dist/openai-responses-BRdGpBX6.mjs.map +1 -0
  72. package/dist/openai-responses-shared-BmnSvdKL.mjs +570 -0
  73. package/dist/openai-responses-shared-BmnSvdKL.mjs.map +1 -0
  74. package/dist/otel-CBhmS-NR.mjs +24935 -0
  75. package/dist/otel-CBhmS-NR.mjs.map +1 -0
  76. package/dist/pi-ai-CfokFhIL.d.mts +2673 -0
  77. package/dist/pi-ai-CfokFhIL.d.mts.map +1 -0
  78. package/dist/pi-ai-Dh7HUxbt.mjs +3239 -0
  79. package/dist/pi-ai-Dh7HUxbt.mjs.map +1 -0
  80. package/dist/{pi-coding-agent-B0PT23gE.d.mts → pi-coding-agent-69yY0ke-.d.mts} +4 -2
  81. package/dist/{pi-coding-agent-B0PT23gE.d.mts.map → pi-coding-agent-69yY0ke-.d.mts.map} +1 -1
  82. package/dist/{pi-coding-agent-BVZu0dHG.mjs → pi-coding-agent-Cvez0jkF.mjs} +0 -0
  83. package/dist/{pi-coding-agent-BVZu0dHG.mjs.map → pi-coding-agent-Cvez0jkF.mjs.map} +1 -1
  84. package/dist/pi-messages-D61G2tgs.mjs +307 -0
  85. package/dist/pi-messages-D61G2tgs.mjs.map +1 -0
  86. package/dist/provider-env-C72pF4vP.mjs +40 -0
  87. package/dist/provider-env-C72pF4vP.mjs.map +1 -0
  88. package/dist/provider-retry-Cw6YJ4cr.mjs +80 -0
  89. package/dist/provider-retry-Cw6YJ4cr.mjs.map +1 -0
  90. package/dist/rolldown-runtime-CTfmNlz1.mjs +44 -0
  91. package/dist/{runtime-DEjs_Qlf.mjs → runtime-Dd2KhoX-.mjs} +659 -125
  92. package/dist/runtime-Dd2KhoX-.mjs.map +1 -0
  93. package/dist/runtime.d.mts +135 -26
  94. package/dist/runtime.d.mts.map +1 -1
  95. package/dist/runtime.mjs +1 -1
  96. package/dist/simple-options-B_GO8FDE.mjs +456 -0
  97. package/dist/simple-options-B_GO8FDE.mjs.map +1 -0
  98. package/dist/src-DlTagfW5.mjs +1186 -0
  99. package/dist/src-DlTagfW5.mjs.map +1 -0
  100. package/dist/{types-7IWJPPvS.d.mts → types-B9VBF8le.d.mts} +2 -9
  101. package/dist/{types-7IWJPPvS.d.mts.map → types-B9VBF8le.d.mts.map} +1 -1
  102. package/package.json +2 -2
  103. package/dist/compat/pi-ai.d.mts.map +0 -1
  104. package/dist/mcp-config-_idn-pzI.mjs.map +0 -1
  105. package/dist/pi-ai-D7PqVeWs.mjs.map +0 -1
  106. package/dist/runtime-DEjs_Qlf.mjs.map +0 -1
package/README.md CHANGED
@@ -47,13 +47,11 @@ dsh plugin --profile web add @kassing/pi-vision
47
47
 
48
48
  Then **restart `dsh`** — plugins mount at startup.
49
49
 
50
- > **Use `web` or `headless` as the profile name.** DSH ships a template for
51
- > exactly those two, and each includes a surface (the web app / the one-shot
52
- > driver). `dsh plugin --profile <any-other-name>` creates a profile with no
53
- > surface at all, and that profile **starts up and then hangs with no
54
- > diagnostic** nothing to do with pi2dsh, but easy to hit on your first
55
- > install. If you want a differently named profile, add the surface bundle to
56
- > its `dsh.profile.bundles` yourself.
50
+ > **A profile needs a surface bundle.** DSH's built-in templates are `web` and
51
+ > `headless`. A custom profile is valid when its product installs a surface
52
+ > for example `@deepseek-harness-tui/dsh-tui` in the `dsh-tui` profile. A bare
53
+ > arbitrary profile has no surface and can start with nothing to drive it, so
54
+ > add the intended surface to `dsh.profile.bundles` first.
57
55
 
58
56
  That is the whole model. There is no conversion step, no generated bundle, no
59
57
  build. The engine discovers the Pi packages in your profile (every one is
@@ -178,6 +176,7 @@ it work. **This is the list to trust.**
178
176
  | [`@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/) |
179
177
  | [`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/) |
180
178
  | [`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/) |
179
+ | [`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) |
181
180
  | [`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 | — |
182
181
  | [`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) | — |
183
182
  | [`pi-hermes-memory`](https://www.npmjs.com/package/pi-hermes-memory) | Cross-session memory: written in one process, read back in a second, fresh one | CLI | — |
@@ -294,14 +293,17 @@ ESM.
294
293
 
295
294
  The rules that keep it honest:
296
295
 
297
- - **Never a second implementation of something DSH already has.** Tools go to
298
- DSH's tool registry, models to DSH's llm configuration, MCP to
299
- `dsh-mcp-client`, skills to `dsh-skill-filesystem`, questions to DSH's user
300
- questions. The bridge translates configuration; it does not build a parallel
301
- runtime.
302
- - **You never see Pi.** Everything you configure, read, or type is DSH-shaped:
303
- DSH settings, DSH commands, DSH credentials. Pi vocabulary exists only
304
- inside the plugin's view and the bridge's own internals.
296
+ - **Never a second bridge-owned implementation of something DSH already has.**
297
+ Tools go to DSH's tool registry, models to DSH's llm configuration,
298
+ configuration-only MCP servers to `dsh-mcp-client`, skills to
299
+ `dsh-skill-filesystem`, and questions to DSH's user questions. An explicitly
300
+ installed Pi capability package can retain behavior that it owns; the bridge
301
+ maps its public surfaces and does not copy its transport.
302
+ - **No bridge-private user world.** Normal configuration remains DSH-shaped:
303
+ DSH settings, commands and credentials. When an installed capability package
304
+ deliberately exposes its own manager, that surface remains recognizable and
305
+ is namespaced on conflict — dsh-TUI keeps `/mcp`, while the Pi manager is
306
+ `/pi-mcp`.
305
307
  - **No per-package special cases.** The core contains no
306
308
  `if (packageName === …)`. One ABI gap fixed unlocks every package that hits
307
309
  it.
@@ -310,7 +312,7 @@ The rules that keep it honest:
310
312
  something invented. If a plugin needs one during startup, it is marked
311
313
  unusable with a removal hint rather than half-working.
312
314
  - **Verified, not asserted.** Every capability has a public-API contract test,
313
- and ships only after running end to end on a real DSH loop CLI *and* web.
315
+ and ships only after running end to end on every DSH surface it claims.
314
316
 
315
317
  ## What this is teaching us about DSH
316
318
 
@@ -375,11 +377,11 @@ audit states this boundary explicitly.
375
377
  | [Tools](docs/capabilities/tools.md) | 11 | 2 same semantics · 9 mapped, difference stated |
376
378
  | [Commands, flags, editor input](docs/capabilities/commands.md) | 13 | 13 mapped, difference stated |
377
379
  | [Messages, context, agent loop](docs/capabilities/conversation.md) | 20 | 9 same semantics · 11 mapped, difference stated |
378
- | [Sessions & side conversations](docs/capabilities/sessions.md) | 24 | 6 same semantics · 18 mapped, difference stated |
380
+ | [Sessions & side conversations](docs/capabilities/sessions.md) | 24 | 7 same semantics · 17 mapped, difference stated |
379
381
  | [Models, providers, credentials](docs/capabilities/models.md) | 15 | 1 same semantics · 12 mapped, difference stated · 2 not available |
380
- | [Asking the user, rendering](docs/capabilities/interaction.md) | 24 | 4 same semantics · 20 mapped, difference stated |
382
+ | [Asking the user, rendering](docs/capabilities/interaction.md) | 24 | 5 same semantics · 19 mapped, difference stated |
381
383
  | [Project environment & resources](docs/capabilities/environment.md) | 4 | 1 same semantics · 1 mapped, difference stated · 2 not available |
382
- | **Total** | **111** | **23 same semantics · 84 mapped, difference stated · 4 not available** |
384
+ | **Total** | **111** | **25 same semantics · 82 mapped, difference stated · 4 not available** |
383
385
  <!-- capability-table:end -->
384
386
 
385
387
  Plus **203 imported symbols** from Pi's three runtime packages
@@ -400,7 +402,8 @@ only, and the bridge adds the Pi ecosystem's interactive OAuth layer. Any Pi
400
402
  provider package that declares an `oauth` block gets a working
401
403
  `/login <provider>`, driven by the package's own protocol code — Pi's four
402
404
  official flows (OpenAI Codex, Anthropic, GitHub Copilot, Kimi Code) ship built
403
- in. Credentials persist with Pi's `auth.json` semantics and resolve per
405
+ in and are available immediately after installing the engine, even before the
406
+ first community Pi package. Credentials persist with Pi's `auth.json` semantics and resolve per
404
407
  request through a standard `dsh-credentials` provider, so your subscription
405
408
  drives real calls on DSH's native llm path. Details in
406
409
  [models](docs/capabilities/models.md).
@@ -433,6 +436,7 @@ in one has actually been executed against a real DSH loop before landing.
433
436
  | [`subscription-login`](examples/subscription-login/) | Use a ChatGPT / Claude / Copilot / Kimi subscription as a DSH model: `/login`, then the route and credential appear on their own |
434
437
  | [`gateway-compat`](examples/gateway-compat/) | Private / domestic / proxy gateways that reject the `developer` role: how rc.8's official profile carries Pi compat declarations to the wire (passthrough recorder included) |
435
438
  | [`custom-gateways`](examples/custom-gateways/) | Add any OpenAI-compatible gateway the official DSH way, and every Pi plugin sees it |
439
+ | [`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 |
436
440
 
437
441
  ## Other tools
438
442
 
package/README.zh.md CHANGED
@@ -40,11 +40,10 @@ dsh plugin --profile web add @kassing/pi-vision
40
40
 
41
41
  然后**重启 `dsh`**——插件在启动时挂载。
42
42
 
43
- > **profile 名字请用 `web` `headless`。** DSH 只为这两个名字内置了模板,
44
- > 每个都带一个界面层(网页应用 / 一次性执行器)。`dsh plugin --profile <别的
45
- > 名字>` 建出来的 profile **没有任何界面层**,起来之后会**直接挂住、不报任何
46
- > 错**——这跟 pi2dsh 无关,但第一次装的时候很容易撞上。确实想用别的名字,就
47
- > 自己往它的 `dsh.profile.bundles` 里加界面 bundle。
43
+ > **profile 必须带一个界面 bundle。** DSH 内置模板是 `web` `headless`;产品
44
+ > 自己装了界面的自定义 profile 也完全有效,例如 `dsh-tui` profile 里的
45
+ > `@deepseek-harness-tui/dsh-tui`。只有随手新建、没装任何界面层的空 profile 才会
46
+ > 启动后没人驱动;这种情况先把目标界面加进 `dsh.profile.bundles`。
48
47
 
49
48
  就这一种方式。没有转换步骤,没有生成产物,不用构建。引擎会读出你 profile 里的
50
49
  Pi 包(每一个都是你显式装的),用同一个桥实例挂载它们:一个模型目录、一个登录、
@@ -159,6 +158,7 @@ Web 里**直接粘图**——哪怕你的主模型是纯文本的。DSH 正常
159
158
  | [`@crazygit/pi-codex-image-gen`](https://www.npmjs.com/package/@crazygit/pi-codex-image-gen) | ChatGPT/Codex OAuth 调 `gpt-image-2` 生图;本地参考图走 DSH 审批后上传;编辑图片;原生附件存储并在 Web 内直接显示 | CLI + Web | [`codex-image-gen`](examples/codex-image-gen/) |
160
159
  | [`pi-btw`](https://www.npmjs.com/package/pi-btw) | `/btw <问题>` 跑成 DSH 子代理界面里的真子会话;`/btw-inject`;`/btw --save`;主会话保持干净 | CLI + Web | [`side-conversation`](examples/side-conversation/) |
161
160
  | [`pi-powerline-footer`](https://www.npmjs.com/package/pi-powerline-footer) | 终端状态条(模型、思考档位、项目、上下文用量)画进 DSH 的 widget dock,带颜色 | Web | [`presentation-surfaces`](examples/presentation-surfaces/) |
161
+ | [`pi-mcp-adapter`](https://www.npmjs.com/package/pi-mcp-adapter) | 完整管理界面画进 dsh-TUI;stdio/Streamable HTTP/SSE;发现、直连/代理/脚本调用、resources、prompts、图片、结构化内容、MCP Apps、审批、elicitation、sampling、取消与重启全部穿过 DSH 运行时;原生 `/mcp` 与 `/pi-mcp` 共存 | dsh-TUI | [`tui-mcp`](examples/tui-mcp/) · [证据矩阵](docs/mcp-compatibility.md) |
162
162
  | [`pi-vision-tool`](https://www.npmjs.com/package/pi-vision-tool) | 工具注册,且带一个 DSH 需要转换的 JSON Schema 形状(`anyOf` → `oneOf`) | CLI + Web | — |
163
163
  | [`pi-approval-guardian`](https://www.npmjs.com/package/pi-approval-guardian) | 每次工具调用先由第二个模型审批;放行与拒绝两条路都看到了 | CLI(裸环境) | — |
164
164
  | [`pi-hermes-memory`](https://www.npmjs.com/package/pi-hermes-memory) | 跨会话记忆:一个进程写入,另一个全新进程读回 | CLI | — |
@@ -257,18 +257,20 @@ footer、title、working/thinking 类),都画在宿主自己的 slot 座位
257
257
 
258
258
  保证它靠谱的几条标准:
259
259
 
260
- - **DSH 已经有的东西,绝不再造一遍。** 工具进 DSH 的工具注册表,模型进 DSH 的
261
- llm 配置,MCP 交给 `dsh-mcp-client`,skills 交给 `dsh-skill-filesystem`,
262
- 提问交给 DSH 的 user questions。桥做的是配置翻译,不是另起一套运行时。
263
- - **你面前永远没有 Pi。** 你要配的、要读的、要敲的,全是 DSH 形状:DSH 设置、
264
- DSH 命令、DSH 凭证。Pi 的词汇只活在插件自己的视野和桥的内部实现里。
260
+ - **DSH 已经有的东西,桥绝不再造一遍。** 工具进 DSH 的工具注册表,模型进 DSH 的
261
+ llm 配置,只有 server 配置的 MCP 交给 `dsh-mcp-client`,skills 交给
262
+ `dsh-skill-filesystem`,提问交给 DSH 的 user questions。用户显式安装的 Pi
263
+ 能力包可以保留它自己拥有的行为;桥只映射公开宿主面,不抄它的 transport。
264
+ - **不造桥私有的用户世界。** 常规配置仍然全是 DSH 形状:DSH 设置、命令、凭证。
265
+ 如果一个被安装的能力包明确自带管理面,就保留并在冲突时标出来源——dsh-TUI 的
266
+ `/mcp` 不动,Pi 管理面叫 `/pi-mcp`。
265
267
  - **零逐包特判。** 核心里没有任何 `if (packageName === …)`。修一个 ABI 缺口,
266
268
  撞上它的包一起解锁。
267
269
  - **绝不伪装成功。** 映射不了的能力会**如实告诉你**——同一个插件同一项能力只提示
268
270
  一次,讲人话。如果某个插件在启动期就需要这样一项能力,它会被整包标成不可用并
269
271
  给出卸载建议,而不是半死不活地跑着。
270
- - **验证过才算数。** 每项能力都有公开 API 契约测试,并且必须在真实 DSH loop 上
271
- 端到端跑通——CLI **和** Web 双端——才会发布。
272
+ - **验证过才算数。** 每项能力都有公开 API 契约测试,并且必须在它声称支持的每个
273
+ DSH 界面上端到端跑通才会发布。
272
274
 
273
275
  ## 这件事正在检验 DSH 什么
274
276
 
@@ -324,11 +326,11 @@ Pi 包能碰到的每一个面,以及它落到 DSH 的什么位置。下面这
324
326
  | [工具](docs/capabilities/tools.md) | 11 | 2 语义一致 · 9 已映射并写明差异 |
325
327
  | [命令、flag、编辑器输入](docs/capabilities/commands.md) | 13 | 13 已映射并写明差异 |
326
328
  | [消息、上下文、agent 循环](docs/capabilities/conversation.md) | 20 | 9 语义一致 · 11 已映射并写明差异 |
327
- | [会话与侧边对话](docs/capabilities/sessions.md) | 24 | 6 语义一致 · 18 已映射并写明差异 |
329
+ | [会话与侧边对话](docs/capabilities/sessions.md) | 24 | 7 语义一致 · 17 已映射并写明差异 |
328
330
  | [模型、provider、凭证](docs/capabilities/models.md) | 15 | 1 语义一致 · 12 已映射并写明差异 · 2 不提供 |
329
- | [向用户提问与渲染](docs/capabilities/interaction.md) | 24 | 4 语义一致 · 20 已映射并写明差异 |
331
+ | [向用户提问与渲染](docs/capabilities/interaction.md) | 24 | 5 语义一致 · 19 已映射并写明差异 |
330
332
  | [项目环境与资源](docs/capabilities/environment.md) | 4 | 1 语义一致 · 1 已映射并写明差异 · 2 不提供 |
331
- | **合计** | **111** | **23 语义一致 · 84 已映射并写明差异 · 4 不提供** |
333
+ | **合计** | **111** | **25 语义一致 · 82 已映射并写明差异 · 4 不提供** |
332
334
  <!-- capability-table:end -->
333
335
 
334
336
  另外还有 Pi 三个运行时包(`pi-coding-agent`、`pi-tui`、`pi-ai`)的 **203 个
@@ -344,7 +346,8 @@ Pi 包能碰到的每一个面,以及它落到 DSH 的什么位置。下面这
344
346
  **用订阅登录**也能用:DSH 本身只提供静态 HTTP header,桥补上了 Pi 生态的交互式
345
347
  OAuth 层。任何声明了 `oauth` 块的 Pi provider 包都会得到一条可用的
346
348
  `/login <provider>`,跑的是这个包自己的协议代码——Pi 官方的四条流程(OpenAI
347
- Codex、Anthropic、GitHub Copilot、Kimi Code)内置。凭证按 Pi 的 `auth.json`
349
+ Codex、Anthropic、GitHub Copilot、Kimi Code)内置;只装好引擎、还没装第一个社区
350
+ Pi 包时也能直接使用。凭证按 Pi 的 `auth.json`
348
351
  语义持久化,并通过标准的 `dsh-credentials` provider 按请求解析,所以你的订阅能
349
352
  驱动 DSH 原生 llm 路径上的真实调用。细节见[模型](docs/capabilities/models.md)。
350
353
 
@@ -372,6 +375,7 @@ loop 上实际跑过才会进来。
372
375
  | [`subscription-login`](examples/subscription-login/) | 用 ChatGPT / Claude / Copilot / Kimi 订阅账号当 DSH 的模型:`/login`、登录后自动建路由与凭证 |
373
376
  | [`gateway-compat`](examples/gateway-compat/) | 私有 / 国内 / 代理网关拒收 `developer` 角色:rc.8 官方 profile 如何把 Pi compat 声明送到真实请求(附透传录制代理) |
374
377
  | [`custom-gateways`](examples/custom-gateways/) | 按 DSH 官方方式接任何 OpenAI 兼容网关,每个 Pi 插件都能看到它 |
378
+ | [`tui-mcp`](examples/tui-mcp/) | 保留 dsh-TUI 原生 `/mcp`,把 Pi 生态管理面作为 `/pi-mcp` 加进来,并让完整的宿主相关 MCP 功能面穿过 DSH 运行时 |
375
379
 
376
380
  ## 其它工具
377
381
 
@@ -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-_idn-pzI.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-Bz6ZXA7F.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-CJFwQlSG.mjs.map
626
+ //# sourceMappingURL=analyzer-DBtUYKI1.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer-CJFwQlSG.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,GAAG,WAAW;AAC5F;AAEA,SAAS,gBAAg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AAG,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-DBtUYKI1.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,GAAG,WAAW;AAC5F;AAEA,SAAS,gBAAgB,MAAc,MAAgC;CACrE,MAAM,SAA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