pi2dsh 0.3.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +17 -0
  2. package/README.zh.md +11 -0
  3. package/dist/{all-Rt4K68QA.mjs → all-DSpxKvHa.mjs} +10 -10
  4. package/dist/{all-Rt4K68QA.mjs.map → all-DSpxKvHa.mjs.map} +1 -1
  5. package/dist/{anthropic-messages-Beym0_aC.mjs → anthropic-messages-BL9N1Idv.mjs} +3 -3
  6. package/dist/{anthropic-messages-Beym0_aC.mjs.map → anthropic-messages-BL9N1Idv.mjs.map} +1 -1
  7. package/dist/{azure-openai-responses-cHqZTgLD.mjs → azure-openai-responses-A67VbaZ1.mjs} +3 -3
  8. package/dist/{azure-openai-responses-cHqZTgLD.mjs.map → azure-openai-responses-A67VbaZ1.mjs.map} +1 -1
  9. package/dist/cli.mjs +1 -1
  10. package/dist/compat/pi-ai.d.mts +3 -38
  11. package/dist/compat/pi-ai.d.mts.map +1 -1
  12. package/dist/compat/pi-ai.mjs +3 -3
  13. package/dist/compat/pi-coding-agent.d.mts +32 -31
  14. package/dist/compat/pi-coding-agent.d.mts.map +1 -1
  15. package/dist/compat/pi-coding-agent.mjs +1 -1
  16. package/dist/credentials-oauth.mjs +2 -2
  17. package/dist/{dist-QBBA-dL_.mjs → dist-BYA74yh_.mjs} +2 -2
  18. package/dist/{dist-QBBA-dL_.mjs.map → dist-BYA74yh_.mjs.map} +1 -1
  19. package/dist/dist-DeonWo7m.mjs +1089 -0
  20. package/dist/dist-DeonWo7m.mjs.map +1 -0
  21. package/dist/{google-generative-ai-B7OZs5lu.mjs → google-generative-ai-DT5S8D8y.mjs} +2 -2
  22. package/dist/{google-generative-ai-B7OZs5lu.mjs.map → google-generative-ai-DT5S8D8y.mjs.map} +1 -1
  23. package/dist/{google-shared-CRsAUItF.mjs → google-shared-DYP_9cnK.mjs} +4 -4
  24. package/dist/{google-shared-CRsAUItF.mjs.map → google-shared-DYP_9cnK.mjs.map} +1 -1
  25. package/dist/{google-vertex-DmdaHQtB.mjs → google-vertex-Dpq7O7Be.mjs} +3 -3
  26. package/dist/{google-vertex-DmdaHQtB.mjs.map → google-vertex-Dpq7O7Be.mjs.map} +1 -1
  27. package/dist/host.mjs +1 -1
  28. package/dist/index.d.mts.map +1 -1
  29. package/dist/index.mjs +1 -1
  30. package/dist/{json-parse-CFyFZSLJ.mjs → json-parse-Dz5sKMTv.mjs} +2 -2
  31. package/dist/{json-parse-CFyFZSLJ.mjs.map → json-parse-Dz5sKMTv.mjs.map} +1 -1
  32. package/dist/{mcp-config-D2B3kv-Z.mjs → mcp-config-ByUc0jmD.mjs} +10 -9
  33. package/dist/mcp-config-ByUc0jmD.mjs.map +1 -0
  34. package/dist/{mistral-conversations-HHZCcFv_.mjs → mistral-conversations-BsxbCCWx.mjs} +4 -4
  35. package/dist/{mistral-conversations-HHZCcFv_.mjs.map → mistral-conversations-BsxbCCWx.mjs.map} +1 -1
  36. package/dist/{multipart-parser-CIa5BbwO.mjs → multipart-parser-woKCuALW.mjs} +3 -3
  37. package/dist/{multipart-parser-CIa5BbwO.mjs.map → multipart-parser-woKCuALW.mjs.map} +1 -1
  38. package/dist/{openai-codex-responses-vmovNu-q.mjs → openai-codex-responses-C7vviVT2.mjs} +3 -3
  39. package/dist/{openai-codex-responses-vmovNu-q.mjs.map → openai-codex-responses-C7vviVT2.mjs.map} +1 -1
  40. package/dist/{openai-completions-fXHhRolF.mjs → openai-completions-By8QNX1P.mjs} +3 -3
  41. package/dist/{openai-completions-fXHhRolF.mjs.map → openai-completions-By8QNX1P.mjs.map} +1 -1
  42. package/dist/{openai-responses-DKdCYf3h.mjs → openai-responses-DboJUcFN.mjs} +3 -3
  43. package/dist/{openai-responses-DKdCYf3h.mjs.map → openai-responses-DboJUcFN.mjs.map} +1 -1
  44. package/dist/{openai-responses-shared-D0Jq7yVP.mjs → openai-responses-shared-BDzn7nJY.mjs} +2 -2
  45. package/dist/{openai-responses-shared-D0Jq7yVP.mjs.map → openai-responses-shared-BDzn7nJY.mjs.map} +1 -1
  46. package/dist/{otel-BQSQRBLF.mjs → otel-PimLMoiV.mjs} +3 -3
  47. package/dist/{otel-BQSQRBLF.mjs.map → otel-PimLMoiV.mjs.map} +1 -1
  48. package/dist/{pi-ai-DhYGgq4Y.mjs → pi-ai-B_88Wb0r.mjs} +49 -6
  49. package/dist/{pi-ai-DhYGgq4Y.mjs.map → pi-ai-B_88Wb0r.mjs.map} +1 -1
  50. package/dist/{pi-coding-agent-DuqSaquA.mjs → pi-coding-agent-C9Y9ql5E.mjs} +35 -34
  51. package/dist/pi-coding-agent-C9Y9ql5E.mjs.map +1 -0
  52. package/dist/{pi-messages-CV-Ts8An.mjs → pi-messages-B-7Xo_I0.mjs} +3 -3
  53. package/dist/{pi-messages-CV-Ts8An.mjs.map → pi-messages-B-7Xo_I0.mjs.map} +1 -1
  54. package/dist/pi-types-KazmR2O5.d.mts +62 -0
  55. package/dist/pi-types-KazmR2O5.d.mts.map +1 -0
  56. package/dist/pi-uuid-Db8ShZsK.mjs +47 -0
  57. package/dist/pi-uuid-Db8ShZsK.mjs.map +1 -0
  58. package/dist/{provider-env-C72pF4vP.mjs → provider-env-D-cCRWzv.mjs} +2 -2
  59. package/dist/{provider-env-C72pF4vP.mjs.map → provider-env-D-cCRWzv.mjs.map} +1 -1
  60. package/dist/{runtime-D1oXtRIx.mjs → runtime-VK4eVnYa.mjs} +1333 -54
  61. package/dist/runtime-VK4eVnYa.mjs.map +1 -0
  62. package/dist/runtime.d.mts.map +1 -1
  63. package/dist/runtime.mjs +1 -1
  64. package/dist/{src-C3WBfOks.mjs → src-BEl3QrGL.mjs} +3 -3
  65. package/dist/{src-C3WBfOks.mjs.map → src-BEl3QrGL.mjs.map} +1 -1
  66. package/package.json +2 -2
  67. package/dist/build-BG7p2Lbr.mjs +0 -4416
  68. package/dist/build-BG7p2Lbr.mjs.map +0 -1
  69. package/dist/dist-IQKOgQyt.mjs +0 -10035
  70. package/dist/dist-IQKOgQyt.mjs.map +0 -1
  71. package/dist/mcp-config-D2B3kv-Z.mjs.map +0 -1
  72. package/dist/pi-coding-agent-DuqSaquA.mjs.map +0 -1
  73. package/dist/pi-types-BLt46jaf.d.mts +0 -2494
  74. package/dist/pi-types-BLt46jaf.d.mts.map +0 -1
  75. package/dist/rolldown-runtime-CTfmNlz1.mjs +0 -44
  76. package/dist/runtime-D1oXtRIx.mjs.map +0 -1
package/README.md CHANGED
@@ -94,6 +94,23 @@ node dist/cli.mjs mcp-config # Pi mcpServers → DSH patc
94
94
  dsh plugin --profile headless add file:$PWD/pi-host
95
95
  ```
96
96
 
97
+ ## Examples: copy-paste working capabilities
98
+
99
+ **Every verified capability ships as a complete, runnable example under
100
+ [`examples/`](examples/)** — clone the repo, follow one example's README from
101
+ zero to seeing the feature run. Every command in an example has actually been
102
+ executed against a real DSH loop (CLI and web) before landing here; nothing
103
+ is aspirational.
104
+
105
+ | Example | What you get |
106
+ |---|---|
107
+ | [`examples/vision-bridge`](examples/vision-bridge/) | A text-only model answers questions about images: mention an image path, a configured vision model reads it, the analysis is injected into the conversation (works in CLI and the DSH web app; probe images included) |
108
+ | [`examples/custom-models`](examples/custom-models/) | Define a provider once in Pi's standard `models.json` — it becomes a native DSH llm route: visible in the DSH web model picker, usable as the main model, and resolvable/callable by every Pi plugin through one directory |
109
+
110
+ More verified capabilities (approval guardian, cross-session memory,
111
+ interactive OAuth, MCP config conversion, host mode) get their examples as
112
+ each one is re-verified end to end under the same bar.
113
+
97
114
  ## Interactive OAuth: sign in with your subscription
98
115
 
99
116
  DSH ships static HTTP headers only; pi2dsh adds the interactive OAuth layer from the Pi ecosystem. Any Pi provider package that registers an `oauth` block gets a working `/login <provider>` command on DSH, driven by the package's own protocol code. Pi's four official flows ship built in (vendored byte-identical): **OpenAI Codex (ChatGPT Plus/Pro)**, **Anthropic**, **GitHub Copilot**, **Kimi Code**.
package/README.zh.md CHANGED
@@ -94,6 +94,17 @@ node dist/cli.mjs mcp-config # Pi mcpServers → DSH patc
94
94
  dsh plugin --profile headless add file:$PWD/pi-host
95
95
  ```
96
96
 
97
+ ## Examples:每个能力都有完整可跑的示例
98
+
99
+ **每个已验证的能力,都在 [`examples/`](examples/) 下有一份完整可直接运行的示例**——克隆仓库,照任意一个示例的 README 从零走到看到效果。示例里的每条命令都在真实 DSH loop(CLI 和 Web 双端)上实际执行过才收录,没有"理论上可以"的内容。
100
+
101
+ | 示例 | 你得到什么 |
102
+ |---|---|
103
+ | [`examples/vision-bridge`](examples/vision-bridge/) | 纯文本模型回答图片问题:消息里带图片路径,配置的视觉模型识图,分析结果注入对话(CLI 与 DSH Web 都能用;附探针测试图) |
104
+ | [`examples/custom-models`](examples/custom-models/) | 在 Pi 标准 `models.json` 里定义一次 provider——它成为原生 DSH llm 路由:出现在 DSH Web 模型选择器、可当主模型对话、所有 Pi 插件经同一个目录可见可调 |
105
+
106
+ 更多已验证能力(审批 guardian、跨会话记忆、交互式 OAuth、MCP 配置转换、host 模式)的示例,将按同一标准逐个重新端到端验证后补齐。
107
+
97
108
  ## 交互式 OAuth:用你的订阅账号登录
98
109
 
99
110
  DSH 原生只有静态 HTTP headers;pi2dsh 把 Pi 生态的交互式 OAuth 层带了过来。任何注册了 `oauth` 块的 Pi provider 包,在 DSH 上都直接获得可用的 `/login <provider>` 命令,登录流程由包自己的协议代码驱动。Pi 的四条官方流内建(vendored 字节级):**OpenAI Codex(ChatGPT Plus/Pro)**、**Anthropic**、**GitHub Copilot**、**Kimi Code**。
@@ -26804,7 +26804,7 @@ function amazonBedrockProvider() {
26804
26804
  }
26805
26805
  //#endregion
26806
26806
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.js
26807
- const openAICompletionsApi = () => lazyApi(() => import("./openai-completions-fXHhRolF.mjs"));
26807
+ const openAICompletionsApi = () => lazyApi(() => import("./openai-completions-By8QNX1P.mjs"));
26808
26808
  //#endregion
26809
26809
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/ant-ling.js
26810
26810
  function antLingProvider() {
@@ -26819,7 +26819,7 @@ function antLingProvider() {
26819
26819
  }
26820
26820
  //#endregion
26821
26821
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.lazy.js
26822
- const anthropicMessagesApi = () => lazyApi(() => import("./anthropic-messages-Beym0_aC.mjs"));
26822
+ const anthropicMessagesApi = () => lazyApi(() => import("./anthropic-messages-BL9N1Idv.mjs"));
26823
26823
  //#endregion
26824
26824
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js
26825
26825
  var __rewriteRelativeImportExtension$1 = function(path, preserveJsx) {
@@ -26944,7 +26944,7 @@ function anthropicProvider() {
26944
26944
  }
26945
26945
  //#endregion
26946
26946
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.js
26947
- const azureOpenAIResponsesApi = () => lazyApi(() => import("./azure-openai-responses-cHqZTgLD.mjs"));
26947
+ const azureOpenAIResponsesApi = () => lazyApi(() => import("./azure-openai-responses-A67VbaZ1.mjs"));
26948
26948
  //#endregion
26949
26949
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js
26950
26950
  function azureOpenAIResponsesProvider() {
@@ -26982,7 +26982,7 @@ function cerebrasProvider() {
26982
26982
  }
26983
26983
  //#endregion
26984
26984
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js
26985
- const openAIResponsesApi = () => lazyApi(() => import("./openai-responses-DKdCYf3h.mjs"));
26985
+ const openAIResponsesApi = () => lazyApi(() => import("./openai-responses-DboJUcFN.mjs"));
26986
26986
  //#endregion
26987
26987
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js
26988
26988
  const CLOUDFLARE_API_KEY = "CLOUDFLARE_API_KEY";
@@ -27184,7 +27184,7 @@ function githubCopilotProvider() {
27184
27184
  }
27185
27185
  //#endregion
27186
27186
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.lazy.js
27187
- const googleGenerativeAIApi = () => lazyApi(() => import("./google-generative-ai-B7OZs5lu.mjs"));
27187
+ const googleGenerativeAIApi = () => lazyApi(() => import("./google-generative-ai-DT5S8D8y.mjs"));
27188
27188
  //#endregion
27189
27189
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/google.js
27190
27190
  function googleProvider() {
@@ -27199,7 +27199,7 @@ function googleProvider() {
27199
27199
  }
27200
27200
  //#endregion
27201
27201
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.js
27202
- const googleVertexApi = () => lazyApi(() => import("./google-vertex-DmdaHQtB.mjs"));
27202
+ const googleVertexApi = () => lazyApi(() => import("./google-vertex-Dpq7O7Be.mjs"));
27203
27203
  //#endregion
27204
27204
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js
27205
27205
  const VERTEX_ADC_PATH = "~/.config/gcloud/application_default_credentials.json";
@@ -27372,7 +27372,7 @@ function minimaxCnProvider() {
27372
27372
  }
27373
27373
  //#endregion
27374
27374
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.js
27375
- const mistralConversationsApi = () => lazyApi(() => import("./mistral-conversations-HHZCcFv_.mjs").then((n) => n.t));
27375
+ const mistralConversationsApi = () => lazyApi(() => import("./mistral-conversations-BsxbCCWx.mjs").then((n) => n.t));
27376
27376
  //#endregion
27377
27377
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js
27378
27378
  function mistralProvider() {
@@ -27435,7 +27435,7 @@ function openaiProvider() {
27435
27435
  }
27436
27436
  //#endregion
27437
27437
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.js
27438
- const openAICodexResponsesApi = () => lazyApi(() => import("./openai-codex-responses-vmovNu-q.mjs"));
27438
+ const openAICodexResponsesApi = () => lazyApi(() => import("./openai-codex-responses-C7vviVT2.mjs"));
27439
27439
  //#endregion
27440
27440
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js
27441
27441
  function openaiCodexProvider() {
@@ -28195,7 +28195,7 @@ function qwenTokenPlanIndividualProvider() {
28195
28195
  }
28196
28196
  //#endregion
28197
28197
  //#region node_modules/.pnpm/@earendil-works+pi-ai@0.84.1_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.lazy.js
28198
- const piMessagesApi = () => lazyApi(() => import("./pi-messages-CV-Ts8An.mjs"));
28198
+ const piMessagesApi = () => lazyApi(() => import("./pi-messages-B-7Xo_I0.mjs"));
28199
28199
  function isRadiusGatewayModel(value) {
28200
28200
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
28201
28201
  const model = value;
@@ -28509,4 +28509,4 @@ function builtinImagesModels(options) {
28509
28509
  //#endregion
28510
28510
  export { builtinImagesModels, builtinImagesProviders, builtinModels, builtinProviders, getBuiltinModel, getBuiltinModelDataGeneratedAt, getBuiltinModels, getBuiltinProviders, radiusProvider };
28511
28511
 
28512
- //# sourceMappingURL=all-Rt4K68QA.mjs.map
28512
+ //# sourceMappingURL=all-DSpxKvHa.mjs.map