pi2dsh 0.6.0 → 0.7.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 (87) hide show
  1. package/README.md +11 -3
  2. package/README.zh.md +8 -3
  3. package/dist/all-BChhwMVE.mjs +28512 -0
  4. package/dist/all-BChhwMVE.mjs.map +1 -0
  5. package/dist/anthropic-messages-Dlw4T0S4.mjs +6438 -0
  6. package/dist/anthropic-messages-Dlw4T0S4.mjs.map +1 -0
  7. package/dist/azure-openai-responses-vGUNukZ7.mjs +209 -0
  8. package/dist/azure-openai-responses-vGUNukZ7.mjs.map +1 -0
  9. package/dist/cli.mjs +1 -1
  10. package/dist/compat/pi-ai.d.mts.map +1 -1
  11. package/dist/compat/pi-ai.mjs +1 -1
  12. package/dist/credentials-oauth.mjs +1 -1
  13. package/dist/deferred-tools-BD4g5QUx.mjs +32 -0
  14. package/dist/deferred-tools-BD4g5QUx.mjs.map +1 -0
  15. package/dist/diagnostics-CJye1UFh.mjs +99 -0
  16. package/dist/diagnostics-CJye1UFh.mjs.map +1 -0
  17. package/dist/dist-DY2GeEQ6.mjs +1089 -0
  18. package/dist/dist-DY2GeEQ6.mjs.map +1 -0
  19. package/dist/dist-DYfTHu0C.mjs +1246 -0
  20. package/dist/dist-DYfTHu0C.mjs.map +1 -0
  21. package/dist/error-body-DKA3lknR.mjs +104 -0
  22. package/dist/error-body-DKA3lknR.mjs.map +1 -0
  23. package/dist/github-copilot-headers-CZo2QHrt.mjs +25 -0
  24. package/dist/github-copilot-headers-CZo2QHrt.mjs.map +1 -0
  25. package/dist/google-generative-ai-C30gRjRi.mjs +358 -0
  26. package/dist/google-generative-ai-C30gRjRi.mjs.map +1 -0
  27. package/dist/google-shared-W8g3Esep.mjs +29042 -0
  28. package/dist/google-shared-W8g3Esep.mjs.map +1 -0
  29. package/dist/google-vertex--O_gyVYA.mjs +402 -0
  30. package/dist/google-vertex--O_gyVYA.mjs.map +1 -0
  31. package/dist/hash-Dbggamac.mjs +19 -0
  32. package/dist/hash-Dbggamac.mjs.map +1 -0
  33. package/dist/headers-CPzZhJQn.mjs +17 -0
  34. package/dist/headers-CPzZhJQn.mjs.map +1 -0
  35. package/dist/host.mjs +2 -2
  36. package/dist/host.mjs.map +1 -1
  37. package/dist/images-models-DJtHo9Rp.mjs +1068 -0
  38. package/dist/images-models-DJtHo9Rp.mjs.map +1 -0
  39. package/dist/index.d.mts.map +1 -1
  40. package/dist/index.mjs +11 -3
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/json-parse-C-vG4_qc.mjs +384 -0
  43. package/dist/json-parse-C-vG4_qc.mjs.map +1 -0
  44. package/dist/{mcp-config-vU1LZ7fC.mjs → mcp-config-Cful6uUS.mjs} +2 -2
  45. package/dist/{mcp-config-vU1LZ7fC.mjs.map → mcp-config-Cful6uUS.mjs.map} +1 -1
  46. package/dist/mistral-conversations-LSDG9sjq.mjs +42007 -0
  47. package/dist/mistral-conversations-LSDG9sjq.mjs.map +1 -0
  48. package/dist/multipart-parser-CoM3rwav.mjs +301 -0
  49. package/dist/multipart-parser-CoM3rwav.mjs.map +1 -0
  50. package/dist/openai-codex-responses-JxII_OUX.mjs +1169 -0
  51. package/dist/openai-codex-responses-JxII_OUX.mjs.map +1 -0
  52. package/dist/openai-completions-Dp-VwLzJ.mjs +947 -0
  53. package/dist/openai-completions-Dp-VwLzJ.mjs.map +1 -0
  54. package/dist/openai-completions-lite-BrM7gJzs.mjs +316 -0
  55. package/dist/openai-completions-lite-BrM7gJzs.mjs.map +1 -0
  56. package/dist/openai-prompt-cache-BDWtZRKh.mjs +11 -0
  57. package/dist/openai-prompt-cache-BDWtZRKh.mjs.map +1 -0
  58. package/dist/openai-responses-CWmNks8K.mjs +247 -0
  59. package/dist/openai-responses-CWmNks8K.mjs.map +1 -0
  60. package/dist/openai-responses-shared-CYgIDTf3.mjs +572 -0
  61. package/dist/openai-responses-shared-CYgIDTf3.mjs.map +1 -0
  62. package/dist/openrouter-images-DfAULV7l.mjs +127 -0
  63. package/dist/openrouter-images-DfAULV7l.mjs.map +1 -0
  64. package/dist/otel-Boafyju5.mjs +24935 -0
  65. package/dist/otel-Boafyju5.mjs.map +1 -0
  66. package/dist/{pi-ai-7HR3ciAs.mjs → pi-ai-B4hucafU.mjs} +43 -5
  67. package/dist/{pi-ai-7HR3ciAs.mjs.map → pi-ai-B4hucafU.mjs.map} +1 -1
  68. package/dist/pi-messages-HzGtvc5_.mjs +306 -0
  69. package/dist/pi-messages-HzGtvc5_.mjs.map +1 -0
  70. package/dist/provider-env-C9gOBFJi.mjs +40 -0
  71. package/dist/provider-env-C9gOBFJi.mjs.map +1 -0
  72. package/dist/provider-retry-Cw6YJ4cr.mjs +80 -0
  73. package/dist/provider-retry-Cw6YJ4cr.mjs.map +1 -0
  74. package/dist/{runtime-xNd10ACP.mjs → runtime-k3IlCgjQ.mjs} +18 -3
  75. package/dist/{runtime-xNd10ACP.mjs.map → runtime-k3IlCgjQ.mjs.map} +1 -1
  76. package/dist/runtime.d.mts +8 -1
  77. package/dist/runtime.d.mts.map +1 -1
  78. package/dist/runtime.mjs +2 -2
  79. package/dist/sanitize-unicode-wLA11KvZ.mjs +29 -0
  80. package/dist/sanitize-unicode-wLA11KvZ.mjs.map +1 -0
  81. package/dist/src-D0GRWCE8.mjs +5031 -0
  82. package/dist/src-D0GRWCE8.mjs.map +1 -0
  83. package/dist/transform-messages-DGq9mvhA.mjs +379 -0
  84. package/dist/transform-messages-DGq9mvhA.mjs.map +1 -0
  85. package/dist/uuid-DtFT7tOE.mjs +65 -0
  86. package/dist/uuid-DtFT7tOE.mjs.map +1 -0
  87. package/package.json +2 -2
@@ -17,6 +17,13 @@ declare function normalizeToolSchema(schema: unknown): {
17
17
  schema: UnknownRecord;
18
18
  warnings: string[];
19
19
  };
20
+ /**
21
+ * Load models.json routes for a host with NO mounted Pi package yet — the
22
+ * single-directory capability (custom providers + image-admission
23
+ * companions in the DSH picker) is the bridge's own, not any plugin's.
24
+ * A later package mount adopts the same shared snapshot.
25
+ */
26
+ declare function ensureModelsJsonRoutes(ctx: Context): Promise<void>;
20
27
  declare function splitArguments(input: string): string[];
21
28
  declare function expandPrompt(text: string, rawInput: string): string;
22
29
  declare function applyPiPackage(ctx: Context, options: RuntimeOptions): Promise<void>;
@@ -27,5 +34,5 @@ declare const runtimeInternals: {
27
34
  textBlocks: typeof textBlocks;
28
35
  };
29
36
  //#endregion
30
- export { applyPiPackage, normalizeToolSchema, runtimeInternals };
37
+ export { applyPiPackage, ensureModelsJsonRoutes, normalizeToolSchema, runtimeInternals };
31
38
  //# sourceMappingURL=runtime.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/runtime.ts"],"mappings":";;;;KAyCK,gBAAgB;UAGX;EACR,SAAS;EACT,UAAU;EACV,SAAS;;iBA4JF,WAAW,mBAAmB;EAAQ;EAAc;;iBAcpD,oBAAoB,kBAAkB;iBAuH/B,oBAAoB;EAAoB,QAAQ;EAAe;;iBAgpDtE,eAAe;iBA+Bf,aAAa,cAAc;iBAuHd,eAAe,KAAK,SAAS,SAAS,iBAAiB;cA6HhE"}
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/runtime.ts"],"mappings":";;;;KAyCK,gBAAgB;UAGX;EACR,SAAS;EACT,UAAU;EACV,SAAS;;iBA4JF,WAAW,mBAAmB;EAAQ;EAAc;;iBAcpD,oBAAoB,kBAAkB;iBAuH/B,oBAAoB;EAAoB,QAAQ;EAAe;;;;;;;;iBAigCzD,uBAAuB,KAAK,UAAU;iBAkqBnD,eAAe;iBA+Bf,aAAa,cAAc;iBAuHd,eAAe,KAAK,SAAS,SAAS,iBAAiB;cA6HhE"}
package/dist/runtime.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
 
2
- import { n as normalizeToolSchema, r as runtimeInternals, t as applyPiPackage } from "./runtime-xNd10ACP.mjs";
3
- export { applyPiPackage, normalizeToolSchema, runtimeInternals };
2
+ import { i as runtimeInternals, n as ensureModelsJsonRoutes, r as normalizeToolSchema, t as applyPiPackage } from "./runtime-k3IlCgjQ.mjs";
3
+ export { applyPiPackage, ensureModelsJsonRoutes, normalizeToolSchema, runtimeInternals };
@@ -0,0 +1,29 @@
1
+
2
+ //#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/utils/sanitize-unicode.js
3
+ /**
4
+ * Removes unpaired Unicode surrogate characters from a string.
5
+ *
6
+ * Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,
7
+ * or vice versa) cause JSON serialization errors in many API providers.
8
+ *
9
+ * Valid emoji and other characters outside the Basic Multilingual Plane use properly paired
10
+ * surrogates and will NOT be affected by this function.
11
+ *
12
+ * @param text - The text to sanitize
13
+ * @returns The sanitized text with unpaired surrogates removed
14
+ *
15
+ * @example
16
+ * // Valid emoji (properly paired surrogates) are preserved
17
+ * sanitizeSurrogates("Hello 🙈 World") // => "Hello 🙈 World"
18
+ *
19
+ * // Unpaired high surrogate is removed
20
+ * const unpaired = String.fromCharCode(0xD83D); // high surrogate without low
21
+ * sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
22
+ */
23
+ function sanitizeSurrogates(text) {
24
+ return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
25
+ }
26
+ //#endregion
27
+ export { sanitizeSurrogates as t };
28
+
29
+ //# sourceMappingURL=sanitize-unicode-wLA11KvZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-unicode-wLA11KvZ.mjs","names":[],"sources":["../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/utils/sanitize-unicode.js"],"sourcesContent":["/**\n * Removes unpaired Unicode surrogate characters from a string.\n *\n * Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,\n * or vice versa) cause JSON serialization errors in many API providers.\n *\n * Valid emoji and other characters outside the Basic Multilingual Plane use properly paired\n * surrogates and will NOT be affected by this function.\n *\n * @param text - The text to sanitize\n * @returns The sanitized text with unpaired surrogates removed\n *\n * @example\n * // Valid emoji (properly paired surrogates) are preserved\n * sanitizeSurrogates(\"Hello 🙈 World\") // => \"Hello 🙈 World\"\n *\n * // Unpaired high surrogate is removed\n * const unpaired = String.fromCharCode(0xD83D); // high surrogate without low\n * sanitizeSurrogates(`Text ${unpaired} here`) // => \"Text here\"\n */\nexport function sanitizeSurrogates(text) {\n // Replace unpaired high surrogates (0xD800-0xDBFF not followed by low surrogate)\n // Replace unpaired low surrogates (0xDC00-0xDFFF not preceded by high surrogate)\n return text.replace(/[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?<![\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]/g, \"\");\n}\n//# sourceMappingURL=sanitize-unicode.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,mBAAmB,MAAM;CAGrC,OAAO,KAAK,QAAQ,2EAA2E,EAAE;AACrG"}