@xiaoso/dsh-tool-plus 0.1.6 → 0.1.7-beta.1

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 (357) hide show
  1. package/THIRD_PARTY_NOTICES.md +9 -3
  2. package/lib/{abort-Cwwm4Err.mjs → abort-Caqff3M6.mjs} +2 -2
  3. package/lib/alibaba-coding-plan-DTupMiAi.mjs +73 -0
  4. package/lib/alibaba-token-plan-CHGyWOfX.mjs +46 -0
  5. package/lib/alibaba-token-plan-Dj3OZhEE.mjs +82 -0
  6. package/lib/{amazon-bedrock-TVMpUTRG.mjs → amazon-bedrock-DbFSYXfJ.mjs} +117 -38
  7. package/lib/{anthropic-BL6LFDQS.mjs → anthropic-CTJ3IQVa.mjs} +675 -166
  8. package/lib/anthropic-CXfWlp-x.mjs +105 -0
  9. package/lib/{aws-credentials-B20dliS7.mjs → anthropic-wire-CKuhDwZ1.mjs} +74 -14
  10. package/lib/{api-key-login-CIDnXeYd.mjs → api-key-validation-CGCJFbFr.mjs} +27 -68
  11. package/lib/{azure-openai-responses-BkhsLmN3.mjs → azure-openai-responses-ChFbWaGj.mjs} +27 -16
  12. package/lib/{browser-render-CmgvSNte.mjs → browser-render-9o0Rknop.mjs} +4 -4
  13. package/lib/bun-shim.mjs +71 -2
  14. package/lib/{bundled-references-ChZSPDFw.mjs → bundled-references-DY3EJxZV.mjs} +6 -5
  15. package/lib/cline-pass-Bwg3esu9.mjs +44 -0
  16. package/lib/cloudflare-ai-gateway-BupNXyKK.mjs +35 -0
  17. package/lib/cloudflare-ai-gateway-EWo0VkP5.mjs +44 -0
  18. package/lib/collapse-DOR8sOGf.mjs +2304 -0
  19. package/lib/coreweave-C82HrLpb.mjs +31 -0
  20. package/lib/coreweave-Ct8cF-da.mjs +14 -0
  21. package/lib/{cursor-B6HcmplF.mjs → cursor-B95LzVWV.mjs} +11 -3
  22. package/lib/{cursor-CRpLpaZ3.mjs → cursor-DJV_dcgB.mjs} +887 -1784
  23. package/lib/{cursor-B8m6SqAH.mjs → cursor-LKGjucn2.mjs} +48 -38
  24. package/lib/cursor-proto-B8Wj8bv9.mjs +10513 -0
  25. package/lib/{deterministic-id-D-yIV_eI.mjs → deterministic-id-CUEIMSqR.mjs} +1 -1
  26. package/lib/devin-BMTdx_hx.mjs +316 -0
  27. package/lib/{devin-DUAfvBsW.mjs → devin-DSp0Rw_E.mjs} +172 -86
  28. package/lib/devin-ExGIghmx.mjs +69 -0
  29. package/lib/devin-proto-Br8fdyNl.mjs +2888 -0
  30. package/lib/{dom-CawWi8fa.mjs → dom-DG3sPESc.mjs} +8 -8
  31. package/lib/effort-BdtQMN-_.mjs +23 -0
  32. package/lib/{error-C-f_Wnw4.mjs → error-CORgGg5a.mjs} +275 -154
  33. package/lib/{event-stream-Dh2guZxS.mjs → event-stream-ulcDenZD.mjs} +20 -4
  34. package/lib/{gemini-headers-DKUShltF.mjs → gemini-headers-Co9cVvex.mjs} +2 -2
  35. package/lib/{github-copilot-suDymKrx.mjs → github-copilot-Dstq1D3s.mjs} +69 -29
  36. package/lib/github-copilot-headers-DOh1gt_w.mjs +312 -0
  37. package/lib/gitlab-duo-DSCMrU0m.mjs +11 -0
  38. package/lib/google-CtsKkOQK.mjs +38 -0
  39. package/lib/google-antigravity-z-5KsEci.mjs +252 -0
  40. package/lib/{google-auth-DYJLM792.mjs → google-auth-ieLBaneO.mjs} +4 -4
  41. package/lib/{google-gemini-cli-8BT513Ul.mjs → google-gemini-cli-C6NE5mWz.mjs} +28 -54
  42. package/lib/{google-gemini-cli-D6cSmfvB.mjs → google-gemini-cli-CAIPSl7e.mjs} +23 -29
  43. package/lib/google-oauth-shared-DhMllAkt.mjs +53 -0
  44. package/lib/{google-shared-CVbHK5vZ.mjs → google-shared-B0aNCYEH.mjs} +140 -44
  45. package/lib/{google-validation-Cgbn3tWJ.mjs → google-validation-BEkNs-Bx.mjs} +1 -1
  46. package/lib/{google-vertex-Bui-ypAe.mjs → google-vertex-Bbd1tYNc.mjs} +8 -8
  47. package/lib/hosts-00rjRzUD.mjs +203 -0
  48. package/lib/id-AL5obQzR.mjs +71 -0
  49. package/lib/{idle-iterator-CYAxUkSD.mjs → idle-iterator-DlUkEfzW.mjs} +3 -3
  50. package/lib/index.mjs +598 -5275
  51. package/lib/kilo-ChJL54wq.mjs +81 -0
  52. package/lib/kimi-C2c_Zq8A.mjs +67 -0
  53. package/lib/{launch-BmgEUycu.mjs → launch-DKDH71En.mjs} +1 -1
  54. package/lib/markit-CmRfm4E2.mjs +9885 -0
  55. package/lib/models-DnXMYGcJ.mjs +381604 -0
  56. package/lib/muse-code-Di1VZmB1.mjs +143 -0
  57. package/lib/{ollama-Df9ce-Cp.mjs → ollama-B8ic3sEp.mjs} +15 -30
  58. package/lib/{openai-codex-CAVI3Me-.mjs → openai-codex-DuJNC99x.mjs} +29 -99
  59. package/lib/{openai-codex-responses-BcnOotRB.mjs → openai-codex-responses-BL29nh9K.mjs} +204 -116
  60. package/lib/{openai-completions-Bq4WT47M.mjs → openai-completions-BK2f2dBv.mjs} +152 -82
  61. package/lib/openai-configuration-update-xMYUjaK_.mjs +150 -0
  62. package/lib/{openai-reasoning-fallback-DXsfiSXO.mjs → openai-reasoning-fallback-BdB3RCbj.mjs} +106 -12
  63. package/lib/{openai-responses-Mq_-PjvE.mjs → openai-responses-CGQPlIIy.mjs} +76 -82
  64. package/lib/{perplexity-XgLF73E7.mjs → perplexity-TBjz3VMB.mjs} +52 -9
  65. package/lib/{pkce-BlQikGPu.mjs → pkce-BYjmugmw.mjs} +1 -1
  66. package/lib/protobuf-aab1UGVn.mjs +717 -0
  67. package/lib/{provider-response-C6vcbQyO.mjs → provider-response-SqKSkkUc.mjs} +1 -1
  68. package/lib/{proxy-D9lm7ONA.mjs → proxy-5nWqRL1f.mjs} +45 -5
  69. package/lib/{readability-Cpm-ocau.mjs → readability-uGhqb4GC.mjs} +2 -2
  70. package/lib/reference-CtvM4zLU.mjs +114 -0
  71. package/lib/{request-debug-HJMoJncL.mjs → request-debug-NQN0BjHH.mjs} +1 -1
  72. package/lib/{sanitize-text-CfcXzw5X.mjs → sanitize-text-BCf5KmCf.mjs} +1 -1
  73. package/lib/{scrapers-Cg5w77td.mjs → scrapers-BpqEnqNM.mjs} +12 -12
  74. package/lib/{src-BcD0_rQR.mjs → src-BwW51vA5.mjs} +979 -388
  75. package/lib/{sse-debug-CYdjOC96.mjs → sse-debug-B-tkLCPW.mjs} +1 -1
  76. package/lib/{stream-Bjq8wjfr.mjs → stream-B_7qN-bA.mjs} +3802 -2623
  77. package/lib/stream-markup-healing-DKT1lnkW.mjs +267 -0
  78. package/lib/{strict-tool-validation-imVLUcbI.mjs → strict-tool-validation-CBTz1dAA.mjs} +2 -2
  79. package/lib/taxonomy-DSIM99rS.mjs +15392 -0
  80. package/lib/{stream-markup-healing-DZ6bVDxH.mjs → thinking-CiLa2LFB.mjs} +31 -186
  81. package/lib/{turndown-DN7ByzEI.mjs → turndown-DrX1M4WG.mjs} +4 -4
  82. package/lib/{type-guards-B9VVjRDK.mjs → type-guards-CttAANEx.mjs} +1 -1
  83. package/lib/types/client/BashPlusCard.d.ts +53 -0
  84. package/lib/types/client/ToolPlusSection.d.ts +36 -0
  85. package/lib/types/client/forms.d.ts +42 -0
  86. package/lib/types/client/index.d.ts +29 -0
  87. package/lib/types/client/locales.d.ts +19 -0
  88. package/lib/types/client/rm-safe-status-text.d.ts +15 -0
  89. package/lib/types/client/rows.d.ts +107 -0
  90. package/lib/types/client/web-connection-rpc.d.ts +22 -0
  91. package/lib/types/config/fields.d.ts +85 -0
  92. package/lib/types/config/omp-settings.d.ts +21 -0
  93. package/lib/types/config/settings.d.ts +212 -0
  94. package/lib/types/config/truncate.d.ts +27 -0
  95. package/lib/types/host/browser-probe-rpc.d.ts +29 -0
  96. package/lib/types/index.d.ts +6 -0
  97. package/lib/types/tools/ast-edit/adapter/index.d.ts +26 -0
  98. package/lib/types/tools/ast-edit/adapter/sdk.d.ts +49 -0
  99. package/lib/types/tools/ast-grep/adapter/index.d.ts +31 -0
  100. package/lib/types/tools/ast-grep/adapter/sdk.d.ts +44 -0
  101. package/lib/types/tools/bash/adapter/spill.d.ts +34 -0
  102. package/lib/types/tools/bash/background.d.ts +40 -0
  103. package/lib/types/tools/bash/bash-executor.d.ts +102 -0
  104. package/lib/types/tools/bash/bash-interceptor.d.ts +33 -0
  105. package/lib/types/tools/bash/cd-workdir.d.ts +35 -0
  106. package/lib/types/tools/bash/logger.d.ts +18 -0
  107. package/lib/types/tools/bash/non-interactive-env.d.ts +5 -0
  108. package/lib/types/tools/bash/render.d.ts +46 -0
  109. package/lib/types/tools/bash/rm-safe-status.d.ts +62 -0
  110. package/lib/types/tools/bash/rm-safe.d.ts +18 -0
  111. package/lib/types/tools/bash/sanitize-text.d.ts +34 -0
  112. package/lib/types/tools/bash/shell-snapshot.d.ts +31 -0
  113. package/lib/types/tools/bash/shell-tokenize.d.ts +60 -0
  114. package/lib/types/tools/bash/streaming-output.d.ts +32 -0
  115. package/lib/types/tools/bash/trash-cli-main.d.ts +1 -0
  116. package/lib/types/tools/bash/trash-cli.d.ts +77 -0
  117. package/lib/types/tools/bash/types.d.ts +107 -0
  118. package/lib/types/tools/bash/which.d.ts +20 -0
  119. package/lib/types/tools/bash/windows-shell.d.ts +31 -0
  120. package/lib/types/tools/bash/yield.d.ts +71 -0
  121. package/lib/types/tools/edit/adapter/index.d.ts +57 -0
  122. package/lib/types/tools/edit/adapter/tools/auto-generated-guard.d.ts +10 -0
  123. package/lib/types/tools/edit/adapter/tools/output-meta.d.ts +34 -0
  124. package/lib/types/tools/edit/adapter/tools/plan-mode-guard.d.ts +21 -0
  125. package/lib/types/tools/glob/adapter/index.d.ts +52 -0
  126. package/lib/types/tools/grep/adapter/index.d.ts +53 -0
  127. package/lib/types/tools/grep/adapter/match-path.d.ts +1 -0
  128. package/lib/types/tools/hashline/native/diff-preview.d.ts +37 -0
  129. package/lib/types/tools/hashline/native/index.d.ts +109 -0
  130. package/lib/types/tools/hashline/native/normalize.d.ts +29 -0
  131. package/lib/types/tools/hashline/native/policy.d.ts +98 -0
  132. package/lib/types/tools/hashline/native/writer.d.ts +42 -0
  133. package/lib/types/tools/omp/browser/launch.d.ts +28 -0
  134. package/lib/types/tools/omp/browser/readable.d.ts +17 -0
  135. package/lib/types/tools/omp/config/settings-schema.d.ts +12 -0
  136. package/lib/types/tools/omp/config/settings.d.ts +59 -0
  137. package/lib/types/tools/omp/edit/apply-patch/parser.d.ts +34 -0
  138. package/lib/types/tools/omp/edit/details.d.ts +54 -0
  139. package/lib/types/tools/omp/edit/diff.d.ts +60 -0
  140. package/lib/types/tools/omp/edit/dispatch.d.ts +43 -0
  141. package/lib/types/tools/omp/edit/file-snapshot-store.d.ts +81 -0
  142. package/lib/types/tools/omp/edit/hashline/execute.d.ts +40 -0
  143. package/lib/types/tools/omp/edit/hashline/params.d.ts +6 -0
  144. package/lib/types/tools/omp/edit/modes/apply-patch.d.ts +25 -0
  145. package/lib/types/tools/omp/edit/modes/patch.d.ts +109 -0
  146. package/lib/types/tools/omp/edit/modes/replace.d.ts +151 -0
  147. package/lib/types/tools/omp/edit/normalize.d.ts +31 -0
  148. package/lib/types/tools/omp/edit/notebook.d.ts +50 -0
  149. package/lib/types/tools/omp/edit/read-file.d.ts +2 -0
  150. package/lib/types/tools/omp/edit/snapshot-details.d.ts +33 -0
  151. package/lib/types/tools/omp/extensibility/skills.d.ts +22 -0
  152. package/lib/types/tools/omp/internal-urls/index.d.ts +100 -0
  153. package/lib/types/tools/omp/internal-urls/local-protocol.d.ts +12 -0
  154. package/lib/types/tools/omp/internal-urls/parse.d.ts +31 -0
  155. package/lib/types/tools/omp/internal-urls/types.d.ts +189 -0
  156. package/lib/types/tools/omp/internal-urls/xd-protocol.d.ts +19 -0
  157. package/lib/types/tools/omp/markit/converters/docx.d.ts +6 -0
  158. package/lib/types/tools/omp/markit/converters/epub.d.ts +15 -0
  159. package/lib/types/tools/omp/markit/converters/pdf/index.d.ts +7 -0
  160. package/lib/types/tools/omp/markit/converters/pptx.d.ts +57 -0
  161. package/lib/types/tools/omp/markit/converters/xlsx.d.ts +25 -0
  162. package/lib/types/tools/omp/markit/index.d.ts +2 -0
  163. package/lib/types/tools/omp/markit/registry.d.ts +16 -0
  164. package/lib/types/tools/omp/markit/types.d.ts +30 -0
  165. package/lib/types/tools/omp/sdk.d.ts +103 -0
  166. package/lib/types/tools/omp/session/agent-storage.d.ts +154 -0
  167. package/lib/types/tools/omp/session/streaming-output.d.ts +244 -0
  168. package/lib/types/tools/omp/task/spawn-policy.d.ts +22 -0
  169. package/lib/types/tools/omp/tools/approval.d.ts +62 -0
  170. package/lib/types/tools/omp/tools/ast-edit.d.ts +73 -0
  171. package/lib/types/tools/omp/tools/ast-grep.d.ts +61 -0
  172. package/lib/types/tools/omp/tools/auto-generated-guard.d.ts +20 -0
  173. package/lib/types/tools/omp/tools/conflict-detect.d.ts +237 -0
  174. package/lib/types/tools/omp/tools/fetch.d.ts +103 -0
  175. package/lib/types/tools/omp/tools/file-recorder.d.ts +13 -0
  176. package/lib/types/tools/omp/tools/fs-cache-invalidation.d.ts +15 -0
  177. package/lib/types/tools/omp/tools/glob.d.ts +86 -0
  178. package/lib/types/tools/omp/tools/grep.d.ts +102 -0
  179. package/lib/types/tools/omp/tools/grouped-file-output.d.ts +70 -0
  180. package/lib/types/tools/omp/tools/index.d.ts +23 -0
  181. package/lib/types/tools/omp/tools/list-limit.d.ts +12 -0
  182. package/lib/types/tools/omp/tools/match-line-format.d.ts +11 -0
  183. package/lib/types/tools/omp/tools/output-meta.d.ts +160 -0
  184. package/lib/types/tools/omp/tools/path-utils.d.ts +326 -0
  185. package/lib/types/tools/omp/tools/plan-mode-guard.d.ts +33 -0
  186. package/lib/types/tools/omp/tools/read-archive.d.ts +16 -0
  187. package/lib/types/tools/omp/tools/read-format.d.ts +104 -0
  188. package/lib/types/tools/omp/tools/read-path-resolution.d.ts +19 -0
  189. package/lib/types/tools/omp/tools/read-selector.d.ts +27 -0
  190. package/lib/types/tools/omp/tools/read-sqlite.d.ts +16 -0
  191. package/lib/types/tools/omp/tools/read-summary.d.ts +15 -0
  192. package/lib/types/tools/omp/tools/read.d.ts +70 -0
  193. package/lib/types/tools/omp/tools/render-utils.d.ts +28 -0
  194. package/lib/types/tools/omp/tools/report-tool-issue.d.ts +149 -0
  195. package/lib/types/tools/omp/tools/resolve.d.ts +127 -0
  196. package/lib/types/tools/omp/tools/sqlite-reader.d.ts +114 -0
  197. package/lib/types/tools/omp/tools/tool-errors.d.ts +33 -0
  198. package/lib/types/tools/omp/tools/tool-result.d.ts +33 -0
  199. package/lib/types/tools/omp/tools/tool-timeouts.d.ts +57 -0
  200. package/lib/types/tools/omp/tools/write.d.ts +53 -0
  201. package/lib/types/tools/omp/tools/writethrough.d.ts +24 -0
  202. package/lib/types/tools/omp/utils/block-context.d.ts +35 -0
  203. package/lib/types/tools/omp/utils/cpuprofile.d.ts +51 -0
  204. package/lib/types/tools/omp/utils/edit-mode.d.ts +13 -0
  205. package/lib/types/tools/omp/utils/file-display-mode.d.ts +27 -0
  206. package/lib/types/tools/omp/utils/image-loading.d.ts +51 -0
  207. package/lib/types/tools/omp/utils/image-resize.d.ts +42 -0
  208. package/lib/types/tools/omp/utils/lang-from-path.d.ts +9 -0
  209. package/lib/types/tools/omp/utils/markit-cache.d.ts +23 -0
  210. package/lib/types/tools/omp/utils/markit.d.ts +30 -0
  211. package/lib/types/tools/omp/utils/profile-tree.d.ts +47 -0
  212. package/lib/types/tools/omp/utils/sample-profile.d.ts +67 -0
  213. package/lib/types/tools/omp/utils/sixel.d.ts +21 -0
  214. package/lib/types/tools/omp/utils/tools-manager.d.ts +11 -0
  215. package/lib/types/tools/omp/utils/turndown.d.ts +15 -0
  216. package/lib/types/tools/omp/utils/zip.d.ts +129 -0
  217. package/lib/types/tools/omp/web/browser-render.d.ts +50 -0
  218. package/lib/types/tools/omp/web/parallel.d.ts +68 -0
  219. package/lib/types/tools/omp/web/scrapers/artifacthub.d.ts +6 -0
  220. package/lib/types/tools/omp/web/scrapers/arxiv.d.ts +5 -0
  221. package/lib/types/tools/omp/web/scrapers/aur.d.ts +5 -0
  222. package/lib/types/tools/omp/web/scrapers/biorxiv.d.ts +5 -0
  223. package/lib/types/tools/omp/web/scrapers/bluesky.d.ts +5 -0
  224. package/lib/types/tools/omp/web/scrapers/brew.d.ts +5 -0
  225. package/lib/types/tools/omp/web/scrapers/cheatsh.d.ts +8 -0
  226. package/lib/types/tools/omp/web/scrapers/chocolatey.d.ts +5 -0
  227. package/lib/types/tools/omp/web/scrapers/choosealicense.d.ts +2 -0
  228. package/lib/types/tools/omp/web/scrapers/cisa-kev.d.ts +5 -0
  229. package/lib/types/tools/omp/web/scrapers/clojars.d.ts +5 -0
  230. package/lib/types/tools/omp/web/scrapers/coingecko.d.ts +5 -0
  231. package/lib/types/tools/omp/web/scrapers/crates-io.d.ts +5 -0
  232. package/lib/types/tools/omp/web/scrapers/crossref.d.ts +2 -0
  233. package/lib/types/tools/omp/web/scrapers/devto.d.ts +5 -0
  234. package/lib/types/tools/omp/web/scrapers/discogs.d.ts +8 -0
  235. package/lib/types/tools/omp/web/scrapers/discourse.d.ts +5 -0
  236. package/lib/types/tools/omp/web/scrapers/dockerhub.d.ts +5 -0
  237. package/lib/types/tools/omp/web/scrapers/docs-rs.d.ts +9 -0
  238. package/lib/types/tools/omp/web/scrapers/fdroid.d.ts +5 -0
  239. package/lib/types/tools/omp/web/scrapers/firefox-addons.d.ts +2 -0
  240. package/lib/types/tools/omp/web/scrapers/flathub.d.ts +2 -0
  241. package/lib/types/tools/omp/web/scrapers/github-gist.d.ts +5 -0
  242. package/lib/types/tools/omp/web/scrapers/github.d.ts +34 -0
  243. package/lib/types/tools/omp/web/scrapers/gitlab.d.ts +5 -0
  244. package/lib/types/tools/omp/web/scrapers/go-pkg.d.ts +5 -0
  245. package/lib/types/tools/omp/web/scrapers/hackage.d.ts +5 -0
  246. package/lib/types/tools/omp/web/scrapers/hackernews.d.ts +2 -0
  247. package/lib/types/tools/omp/web/scrapers/hex.d.ts +5 -0
  248. package/lib/types/tools/omp/web/scrapers/huggingface.d.ts +2 -0
  249. package/lib/types/tools/omp/web/scrapers/iacr.d.ts +5 -0
  250. package/lib/types/tools/omp/web/scrapers/index.d.ts +84 -0
  251. package/lib/types/tools/omp/web/scrapers/jetbrains-marketplace.d.ts +2 -0
  252. package/lib/types/tools/omp/web/scrapers/lemmy.d.ts +2 -0
  253. package/lib/types/tools/omp/web/scrapers/lobsters.d.ts +5 -0
  254. package/lib/types/tools/omp/web/scrapers/mastodon.d.ts +5 -0
  255. package/lib/types/tools/omp/web/scrapers/maven.d.ts +6 -0
  256. package/lib/types/tools/omp/web/scrapers/mdn.d.ts +2 -0
  257. package/lib/types/tools/omp/web/scrapers/metacpan.d.ts +5 -0
  258. package/lib/types/tools/omp/web/scrapers/musicbrainz.d.ts +5 -0
  259. package/lib/types/tools/omp/web/scrapers/npm.d.ts +5 -0
  260. package/lib/types/tools/omp/web/scrapers/nuget.d.ts +5 -0
  261. package/lib/types/tools/omp/web/scrapers/nvd.d.ts +5 -0
  262. package/lib/types/tools/omp/web/scrapers/ollama.d.ts +2 -0
  263. package/lib/types/tools/omp/web/scrapers/open-vsx.d.ts +5 -0
  264. package/lib/types/tools/omp/web/scrapers/opencorporates.d.ts +5 -0
  265. package/lib/types/tools/omp/web/scrapers/openlibrary.d.ts +5 -0
  266. package/lib/types/tools/omp/web/scrapers/orcid.d.ts +5 -0
  267. package/lib/types/tools/omp/web/scrapers/osv.d.ts +5 -0
  268. package/lib/types/tools/omp/web/scrapers/packagist.d.ts +5 -0
  269. package/lib/types/tools/omp/web/scrapers/pub-dev.d.ts +5 -0
  270. package/lib/types/tools/omp/web/scrapers/pubmed.d.ts +5 -0
  271. package/lib/types/tools/omp/web/scrapers/pypi.d.ts +5 -0
  272. package/lib/types/tools/omp/web/scrapers/rawg.d.ts +2 -0
  273. package/lib/types/tools/omp/web/scrapers/readthedocs.d.ts +2 -0
  274. package/lib/types/tools/omp/web/scrapers/reddit.d.ts +5 -0
  275. package/lib/types/tools/omp/web/scrapers/repology.d.ts +5 -0
  276. package/lib/types/tools/omp/web/scrapers/rfc.d.ts +5 -0
  277. package/lib/types/tools/omp/web/scrapers/rubygems.d.ts +5 -0
  278. package/lib/types/tools/omp/web/scrapers/searchcode.d.ts +2 -0
  279. package/lib/types/tools/omp/web/scrapers/sec-edgar.d.ts +5 -0
  280. package/lib/types/tools/omp/web/scrapers/semantic-scholar.d.ts +2 -0
  281. package/lib/types/tools/omp/web/scrapers/snapcraft.d.ts +2 -0
  282. package/lib/types/tools/omp/web/scrapers/sourcegraph.d.ts +2 -0
  283. package/lib/types/tools/omp/web/scrapers/spdx.d.ts +5 -0
  284. package/lib/types/tools/omp/web/scrapers/spotify.d.ts +8 -0
  285. package/lib/types/tools/omp/web/scrapers/stackoverflow.d.ts +6 -0
  286. package/lib/types/tools/omp/web/scrapers/terraform.d.ts +5 -0
  287. package/lib/types/tools/omp/web/scrapers/tldr.d.ts +7 -0
  288. package/lib/types/tools/omp/web/scrapers/twitter.d.ts +5 -0
  289. package/lib/types/tools/omp/web/scrapers/types.d.ts +90 -0
  290. package/lib/types/tools/omp/web/scrapers/utils.d.ts +26 -0
  291. package/lib/types/tools/omp/web/scrapers/vimeo.d.ts +5 -0
  292. package/lib/types/tools/omp/web/scrapers/vscode-marketplace.d.ts +5 -0
  293. package/lib/types/tools/omp/web/scrapers/w3c.d.ts +2 -0
  294. package/lib/types/tools/omp/web/scrapers/wikidata.d.ts +5 -0
  295. package/lib/types/tools/omp/web/scrapers/wikipedia.d.ts +5 -0
  296. package/lib/types/tools/omp/web/scrapers/youtube.d.ts +5 -0
  297. package/lib/types/tools/omp/web/search/providers/utils.d.ts +49 -0
  298. package/lib/types/tools/omp/web/search/types.d.ts +501 -0
  299. package/lib/types/tools/omp/web/search/utils.d.ts +4 -0
  300. package/lib/types/tools/omp/workspace-tree.d.ts +42 -0
  301. package/lib/types/tools/read/adapter/index.d.ts +49 -0
  302. package/lib/types/tools/read/adapter/internal-urls/artifact-protocol.d.ts +15 -0
  303. package/lib/types/tools/read/adapter/internal-urls/registry-helpers.d.ts +44 -0
  304. package/lib/types/tools/read/adapter/registry/agent-registry.d.ts +29 -0
  305. package/lib/types/tools/shared/auto-generated-guard.dsh.d.ts +16 -0
  306. package/lib/types/tools/shared/browser-detect.d.ts +54 -0
  307. package/lib/types/tools/shared/browser-rpc-channel.d.ts +40 -0
  308. package/lib/types/tools/shared/bun-ffi-shim.d.ts +13 -0
  309. package/lib/types/tools/shared/bun-named-shim.d.ts +42 -0
  310. package/lib/types/tools/shared/bun-shim.d.ts +138 -0
  311. package/lib/types/tools/shared/bun-sqlite-shim.d.ts +49 -0
  312. package/lib/types/tools/shared/fs-promises-shim.d.ts +15 -0
  313. package/lib/types/tools/shared/image-bridge.d.ts +98 -0
  314. package/lib/types/tools/shared/omp-prompt.d.ts +47 -0
  315. package/lib/types/tools/shared/sandbox-policy.d.ts +38 -0
  316. package/lib/types/tools/shared/session-state.d.ts +51 -0
  317. package/lib/types/tools/shared/tool-errors.d.ts +33 -0
  318. package/lib/types/tools/shared/win-path-fixes.d.ts +16 -0
  319. package/lib/types/tools/write/adapter/index.d.ts +31 -0
  320. package/lib/{types-DX_bvuus.mjs → types-PVueGi9S.mjs} +2 -2
  321. package/lib/{utils-C-dSORPa.mjs → utils-B7A3Eu4L.mjs} +2364 -2676
  322. package/lib/{utils-Cp2Mxf_U.mjs → utils-CUPhpw9A.mjs} +413 -134
  323. package/lib/{utils-CQHPEQ3W.mjs → utils-DeWqNWV8.mjs} +2 -2
  324. package/lib/{vision-guard-mBmtAHx0.mjs → vision-guard-_XwsL1DF.mjs} +14 -29
  325. package/lib/xai-oauth-CXhnz0gO.mjs +210 -0
  326. package/lib/{xiaomi-7mE345KX.mjs → xiaomi-psoUItal.mjs} +8 -37
  327. package/lib/{zai-CeNpMV3W.mjs → zai-ApJ8HBgT.mjs} +8 -71
  328. package/lib/{zip-BK7UHCwX.mjs → zip-Kd602XNe.mjs} +1 -1
  329. package/package.json +12 -12
  330. package/presets/package.json +1 -1
  331. package/presets/tool-plus-ptc/agent.cordis.yml +1 -1
  332. package/presets/tool-plus-standard/agent.cordis.yml +1 -1
  333. package/scripts/patch-pi-natives.mjs +108 -108
  334. package/lib/agent_pb-Rizyt9Zg.mjs +0 -805
  335. package/lib/anthropic-CDmj476p.mjs +0 -262
  336. package/lib/api_server_pb-CDZgLMta.mjs +0 -252
  337. package/lib/callback-server-CFJK-jvK.mjs +0 -398
  338. package/lib/codex-P1dGpX7G.mjs +0 -54
  339. package/lib/device-code-CuXTWYwY.mjs +0 -51
  340. package/lib/devin-BcQwht1W.mjs +0 -114
  341. package/lib/devin-BvMfGevz.mjs +0 -95
  342. package/lib/github-copilot-B3kQl0g0.mjs +0 -104
  343. package/lib/gitlab-duo-BriUTP8k.mjs +0 -155
  344. package/lib/gitlab-duo-workflow-wK5Ljzmc.mjs +0 -91
  345. package/lib/google-CE5tFDod.mjs +0 -30
  346. package/lib/google-antigravity-C1jgNljz.mjs +0 -198
  347. package/lib/google-oauth-shared-BLVTvokk.mjs +0 -147
  348. package/lib/grammar-D-NqNUxQ.mjs +0 -49
  349. package/lib/identity-HNO1Oe9B.mjs +0 -219
  350. package/lib/kimi-DgcUpPtK.mjs +0 -236
  351. package/lib/markit-DtGoRE6M.mjs +0 -1417
  352. package/lib/minimax-code-Y3h5li9N.mjs +0 -53
  353. package/lib/models-DRA2c_8U.mjs +0 -104660
  354. package/lib/opencode-BsVw9rCD.mjs +0 -38
  355. package/lib/to-binary-B1BEBIPC.mjs +0 -6002
  356. package/lib/wafer-BlhWLweO.mjs +0 -17
  357. package/lib/xai-oauth-5pORHUrg.mjs +0 -446
@@ -7,9 +7,15 @@ Scope of ported upstream code:
7
7
 
8
8
  - from **oh-my-pi** (MIT, notice below): the tool suite sources under
9
9
  `src/tools/` (bash runtime, read, write, edit, grep, glob, plus the OMP
10
- `omp/` engine sources they wrap), and the hashline patch engine fused
11
- in-repo at `src/tools/hashline/engine/` (upstream `packages/hashline`,
12
- with small Node-runtime adaptations).
10
+ `omp/` engine sources they wrap), and the thin hashline adapter at
11
+ `src/tools/hashline/native/` (`diff-preview.ts` is a verbatim port of the
12
+ former upstream TypeScript engine). The hashline engine itself is no longer
13
+ vendored: since oh-my-pi 18.x it lives in Rust (`crates/pi-edit`) and reaches
14
+ this plugin through the `@oh-my-pi/pi-natives` dependency, which ships
15
+ upstream's compiled binary.
16
+ - upstream hashline **test fixtures** vendored for regression testing under
17
+ `src/tools/hashline/test/fixtures/` (copied from
18
+ `crates/pi-edit/tests/fixtures/hashline/`), MIT, same notice below.
13
19
 
14
20
  ---
15
21
 
@@ -1,7 +1,7 @@
1
1
  import { installBunShim as __installBunShim } from "./bun-shim.mjs";
2
2
  __installBunShim();
3
- import { v as AbortError } from "./error-C-f_Wnw4.mjs";
4
- //#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/utils/abort.ts
3
+ import { _ as AbortError } from "./error-CORgGg5a.mjs";
4
+ //#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/utils/abort.ts
5
5
  /**
6
6
  * Tracks whether a merged request signal was aborted by the caller or by provider-local logic.
7
7
  *
@@ -0,0 +1,73 @@
1
+ import { installBunShim as __installBunShim } from "./bun-shim.mjs";
2
+ __installBunShim();
3
+ import { g as OnPromptRequiredError, m as LoginCancelledError, p as ApiKeyRequiredError, t as ConfigurationError } from "./error-CORgGg5a.mjs";
4
+ import { n as validateApiKeyAgainstModelsEndpoint, r as validateOpenAICompatibleApiKey } from "./api-key-validation-CGCJFbFr.mjs";
5
+ //#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/alibaba-coding-plan.ts
6
+ const DEFAULT_AUTH_URL = "https://modelstudio.console.alibabacloud.com/";
7
+ const CHINA_AUTH_URL = "https://bailian.console.aliyun.com/?tab=model#/api-key";
8
+ const DEFAULT_API_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1";
9
+ const CHINA_API_BASE_URL = "https://coding.dashscope.aliyuncs.com/v1";
10
+ const VALIDATION_MODEL = "qwen3.5-plus";
11
+ async function loginAlibabaCodingPlan(options) {
12
+ if (!options.onPrompt) throw new OnPromptRequiredError("Alibaba Coding Plan");
13
+ const endpointChoice = await options.onPrompt({
14
+ message: "Select Alibaba Coding Plan endpoint: 1=International (default), 2=China, 3=Custom — enter 1, 2, or 3",
15
+ placeholder: "1"
16
+ });
17
+ if (options.signal?.aborted) throw new LoginCancelledError();
18
+ const choice = endpointChoice.trim();
19
+ let baseUrl;
20
+ let authUrl;
21
+ let instructions;
22
+ if (choice === "2") {
23
+ baseUrl = CHINA_API_BASE_URL;
24
+ authUrl = CHINA_AUTH_URL;
25
+ instructions = "Copy your API key from the Alibaba Cloud Bailian console (China mainland)";
26
+ } else if (choice === "3") {
27
+ const trimmedUrl = (await options.onPrompt({
28
+ message: "Enter custom base URL",
29
+ placeholder: "https://your-proxy.com/v1"
30
+ })).trim().replace(/\/+$/, "");
31
+ if (!trimmedUrl) throw new ConfigurationError("Custom URL is required for option 3");
32
+ baseUrl = trimmedUrl;
33
+ authUrl = DEFAULT_AUTH_URL;
34
+ instructions = "Copy your API key from the Alibaba Cloud DashScope console";
35
+ } else {
36
+ baseUrl = DEFAULT_API_BASE_URL;
37
+ authUrl = DEFAULT_AUTH_URL;
38
+ instructions = "Copy your API key from the Alibaba Cloud DashScope console (International)";
39
+ }
40
+ options.onAuth?.({
41
+ url: authUrl,
42
+ instructions
43
+ });
44
+ const apiKey = await options.onPrompt({
45
+ message: "Paste your Alibaba Coding Plan API key",
46
+ placeholder: "sk-..."
47
+ });
48
+ if (options.signal?.aborted) throw new LoginCancelledError();
49
+ const trimmed = apiKey.trim();
50
+ if (!trimmed) throw new ApiKeyRequiredError();
51
+ options.onProgress?.("Validating API key...");
52
+ if (choice === "3") await validateApiKeyAgainstModelsEndpoint({
53
+ provider: "Alibaba Coding Plan",
54
+ apiKey: trimmed,
55
+ modelsUrl: `${baseUrl}/models`,
56
+ signal: options.signal
57
+ });
58
+ else await validateOpenAICompatibleApiKey({
59
+ provider: "Alibaba Coding Plan",
60
+ apiKey: trimmed,
61
+ baseUrl,
62
+ model: VALIDATION_MODEL,
63
+ signal: options.signal
64
+ });
65
+ return {
66
+ access: trimmed,
67
+ refresh: trimmed,
68
+ expires: Number.MAX_SAFE_INTEGER,
69
+ enterpriseUrl: baseUrl
70
+ };
71
+ }
72
+ //#endregion
73
+ export { loginAlibabaCodingPlan };
@@ -0,0 +1,46 @@
1
+ import { installBunShim as __installBunShim } from "./bun-shim.mjs";
2
+ __installBunShim();
3
+ //#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.1.17/node_modules/@oh-my-pi/pi-catalog/src/wire/alibaba-token-plan.ts
4
+ /**
5
+ * International (Singapore) Token Plan endpoint. Default region; keys issued by
6
+ * the international product authenticate only here.
7
+ */
8
+ const ALIBABA_TOKEN_PLAN_BASE_URL = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
9
+ /**
10
+ * China (Beijing) Token Plan endpoint (百炼 Token Plan). Keys are region-locked:
11
+ * a Beijing-issued key is rejected by the international endpoint with
12
+ * `invalid_api_key`, and vice versa (#6682).
13
+ */
14
+ const ALIBABA_TOKEN_PLAN_CN_BASE_URL = "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1";
15
+ const TOKEN_PATTERN = /^sk-[A-Za-z0-9._~+/-]+={0,2}$/;
16
+ function parseAlibabaTokenPlanCredential(value) {
17
+ const trimmed = value.trim();
18
+ if (!trimmed) return null;
19
+ if (!trimmed.startsWith("{")) return TOKEN_PATTERN.test(trimmed) ? { token: trimmed } : null;
20
+ try {
21
+ const parsed = JSON.parse(trimmed);
22
+ if (typeof parsed.token !== "string" || !TOKEN_PATTERN.test(parsed.token.trim())) return null;
23
+ if (parsed.cookie !== void 0 && typeof parsed.cookie !== "string") return null;
24
+ if (parsed.baseUrl !== void 0 && typeof parsed.baseUrl !== "string") return null;
25
+ const token = parsed.token.trim();
26
+ const cookie = parsed.cookie?.trim();
27
+ const baseUrl = parsed.baseUrl?.trim();
28
+ const credential = { token };
29
+ if (cookie) credential.cookie = cookie;
30
+ if (baseUrl) credential.baseUrl = baseUrl;
31
+ return credential;
32
+ } catch {
33
+ return null;
34
+ }
35
+ }
36
+ function serializeAlibabaTokenPlanCredential(token, cookie, baseUrl) {
37
+ const trimmedCookie = cookie.trim();
38
+ const trimmedBaseUrl = baseUrl?.trim();
39
+ if (!trimmedCookie && !trimmedBaseUrl) return token;
40
+ const payload = { token };
41
+ if (trimmedCookie) payload.cookie = trimmedCookie;
42
+ if (trimmedBaseUrl) payload.baseUrl = trimmedBaseUrl;
43
+ return JSON.stringify(payload);
44
+ }
45
+ //#endregion
46
+ export { serializeAlibabaTokenPlanCredential as i, ALIBABA_TOKEN_PLAN_CN_BASE_URL as n, parseAlibabaTokenPlanCredential as r, ALIBABA_TOKEN_PLAN_BASE_URL as t };
@@ -0,0 +1,82 @@
1
+ import { installBunShim as __installBunShim } from "./bun-shim.mjs";
2
+ __installBunShim();
3
+ import { g as OnPromptRequiredError, m as LoginCancelledError, p as ApiKeyRequiredError, t as ConfigurationError } from "./error-CORgGg5a.mjs";
4
+ import { i as serializeAlibabaTokenPlanCredential, n as ALIBABA_TOKEN_PLAN_CN_BASE_URL, t as ALIBABA_TOKEN_PLAN_BASE_URL } from "./alibaba-token-plan-CHGyWOfX.mjs";
5
+ import { n as validateApiKeyAgainstModelsEndpoint } from "./api-key-validation-CGCJFbFr.mjs";
6
+ //#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/alibaba-token-plan.ts
7
+ const INTERNATIONAL_AUTH_URL = "https://home.qwencloud.com/billing/subscription/token-plan-individual";
8
+ const CHINA_AUTH_URL = "https://www.aliyun.com/benefit/scene/tokenplan";
9
+ /**
10
+ * Log in to the QwenCloud Token Plan provider.
11
+ *
12
+ * The Token Plan ships as two regionally separate products with
13
+ * non-interchangeable keys — International (Singapore) and China (Beijing) —
14
+ * so login first selects the region (or a custom base URL) before pasting the
15
+ * key, mirroring {@link loginAlibabaCodingPlan}. The chosen region is validated
16
+ * against its own `/models` endpoint and, when it diverges from the default
17
+ * international endpoint, stored in the credential so inference and discovery
18
+ * both target it (#6682).
19
+ */
20
+ async function loginAlibabaTokenPlan(options) {
21
+ if (!options.onPrompt) throw new OnPromptRequiredError("QwenCloud Token Plan");
22
+ const endpointChoice = await options.onPrompt({
23
+ message: "Select QwenCloud Token Plan region: 1=International (default), 2=China (Beijing), 3=Custom — enter 1, 2, or 3",
24
+ placeholder: "1"
25
+ });
26
+ if (options.signal?.aborted) throw new LoginCancelledError();
27
+ const choice = endpointChoice.trim();
28
+ let baseUrl;
29
+ let authUrl;
30
+ let instructions;
31
+ if (choice === "2") {
32
+ baseUrl = ALIBABA_TOKEN_PLAN_CN_BASE_URL;
33
+ authUrl = CHINA_AUTH_URL;
34
+ instructions = "Subscribe to the China (Beijing) 百炼 Token Plan and copy its dedicated API key";
35
+ } else if (choice === "3") {
36
+ const trimmedUrl = (await options.onPrompt({
37
+ message: "Enter custom Token Plan base URL",
38
+ placeholder: "https://token-plan.<region>.maas.aliyuncs.com/compatible-mode/v1"
39
+ })).trim().replace(/\/+$/, "");
40
+ if (!trimmedUrl) throw new ConfigurationError("Custom URL is required for option 3");
41
+ baseUrl = trimmedUrl;
42
+ authUrl = INTERNATIONAL_AUTH_URL;
43
+ instructions = "Copy your Token Plan API key for the custom endpoint";
44
+ } else {
45
+ baseUrl = ALIBABA_TOKEN_PLAN_BASE_URL;
46
+ authUrl = INTERNATIONAL_AUTH_URL;
47
+ instructions = "Subscribe to Token Plan Individual and copy its dedicated API key. Keep this page open; the next prompt explains how to enable optional quota reporting.";
48
+ }
49
+ options.onAuth?.({
50
+ url: authUrl,
51
+ instructions
52
+ });
53
+ const apiKeyInput = await options.onPrompt({
54
+ message: "Paste your QwenCloud Token Plan API key",
55
+ placeholder: "sk-sp-..."
56
+ });
57
+ if (options.signal?.aborted) throw new LoginCancelledError();
58
+ const apiKey = apiKeyInput.trim();
59
+ if (!apiKey) throw new ApiKeyRequiredError();
60
+ options.onProgress?.("Validating API key...");
61
+ await validateApiKeyAgainstModelsEndpoint({
62
+ provider: "QwenCloud Token Plan",
63
+ apiKey,
64
+ modelsUrl: `${baseUrl}/models`,
65
+ signal: options.signal,
66
+ fetch: options.fetch
67
+ });
68
+ const cookieRequestHost = baseUrl === "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1" ? "bailian-cs.console.aliyun.com" : "cs-data.qwencloud.com";
69
+ const cookie = (await options.onPrompt({
70
+ message: baseUrl === "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1" ? "Optional quota reporting: open browser DevTools → Network, reload the Token Plan page, filter for api.json, and select the bailian-cs.console.aliyun.com/data/api.json request whose api query ends in /tokenplan/personal/api/v2/usage. Copy Request Headers → Cookie, then paste the complete name=value; ... value here, or press Enter to skip." : "Optional quota reporting: open browser DevTools → Network, reload the Token Plan page, filter for api.json, and select the cs-data.qwencloud.com/data/api.json request whose api query ends in /tokenplan/personal/api/v2/usage. Copy Request Headers → Cookie, then paste the complete name=value; ... value here, or press Enter to skip.",
71
+ placeholder: "name=value; name=value; ...",
72
+ allowEmpty: true
73
+ })).trim().replace(/^Cookie:\s*/i, "").trim();
74
+ if (options.signal?.aborted) throw new LoginCancelledError();
75
+ if (cookie && !cookie.split(";").some((segment) => {
76
+ const separator = segment.indexOf("=");
77
+ return separator > 0 && Boolean(segment.slice(0, separator).trim() && segment.slice(separator + 1).trim());
78
+ })) throw new ConfigurationError(`Invalid QwenCloud Cookie header. Copy the complete Cookie request header from the ${cookieRequestHost} usage request, not a single cookie value.`);
79
+ return serializeAlibabaTokenPlanCredential(apiKey, cookie, baseUrl === "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1" ? void 0 : baseUrl);
80
+ }
81
+ //#endregion
82
+ export { loginAlibabaTokenPlan };
@@ -1,13 +1,14 @@
1
1
  import { installBunShim as __installBunShim } from "./bun-shim.mjs";
2
2
  __installBunShim();
3
- import { I as $flag, _ as parseStreamingJsonThrottled, g as parseStreamingJson } from "./src-BcD0_rQR.mjs";
4
- import { G as fetchWithRetry, I as BedrockApiError, U as EventStreamFrameError, l as finalize, r as ValidationError, v as AbortError } from "./error-C-f_Wnw4.mjs";
5
- import { C as kStreamingPartialJson, S as kStreamingLastParseLen, a as normalizeSystemPrompts, h as clearStreamingPartialJson, k as toolWireSchema, m as transformMessages, o as normalizeToolCallId, s as resolveCacheRetention, w as renderDemotedThinking, y as kStreamingBlockIndex } from "./utils-Cp2Mxf_U.mjs";
6
- import { i as resolveAwsBearerToken, n as resolveAwsCredentials, r as signRequest, s as resolveAwsAmbientRegion, t as invalidateAwsCredentialCache } from "./aws-credentials-B20dliS7.mjs";
7
- import { o as mapEffortToAnthropicAdaptiveEffort, s as requireSupportedEffort, t as calculateCost } from "./models-DRA2c_8U.mjs";
8
- import { t as AssistantMessageEventStream } from "./event-stream-Dh2guZxS.mjs";
9
- import { i as getStreamFirstEventTimeoutMs, t as armPreResponseTimeout } from "./idle-iterator-CYAxUkSD.mjs";
10
- //#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/providers/aws-eventstream.ts
3
+ import { B as USER_AGENT, C as warn, F as $flag, _ as parseStreamingJson, v as parseStreamingJsonThrottled } from "./src-BwW51vA5.mjs";
4
+ import { G as fetchWithRetry, I as BedrockApiError, U as EventStreamFrameError, _ as AbortError, c as finalize, r as ValidationError } from "./error-CORgGg5a.mjs";
5
+ import { A as toolWireSchema, C as kStreamingLastParseLen, T as renderDemotedThinking, b as kStreamingBlockIndex, c as resolveCacheRetention, g as clearStreamingPartialJson, h as transformMessages, o as normalizeSystemPrompts, s as normalizeToolCallId, w as kStreamingPartialJson } from "./utils-CUPhpw9A.mjs";
6
+ import { n as isRecord } from "./type-guards-CttAANEx.mjs";
7
+ import { a as mapEffortToAnthropicAdaptiveEffort, c as invalidateAwsCredentialCache, d as resolveAwsBearerToken, l as resolveAwsCredentials, m as resolveAwsAmbientRegion, o as requireSupportedEffort, r as parseAnthropicInputTransformations, t as THINKING_BINDING_CONTROLS_BETA, u as signRequest } from "./anthropic-wire-CKuhDwZ1.mjs";
8
+ import { t as calculateCost } from "./models-DnXMYGcJ.mjs";
9
+ import { t as AssistantMessageEventStream } from "./event-stream-ulcDenZD.mjs";
10
+ import { i as getStreamFirstEventTimeoutMs, t as armPreResponseTimeout } from "./idle-iterator-DlUkEfzW.mjs";
11
+ //#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/providers/aws-eventstream.ts
11
12
  /**
12
13
  * `application/vnd.amazon.eventstream` decoder.
13
14
  *
@@ -162,7 +163,7 @@ async function* decodeEventStream(source) {
162
163
  }
163
164
  }
164
165
  //#endregion
165
- //#region node_modules/.pnpm/@oh-my-pi+pi-ai@17.3.5/node_modules/@oh-my-pi/pi-ai/src/providers/amazon-bedrock.ts
166
+ //#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/providers/amazon-bedrock.ts
166
167
  /**
167
168
  * Headers SigV4 generates for itself. A caller cannot be allowed to supply these:
168
169
  * `signRequest` would sign the caller's value but return its own, so the signature
@@ -229,24 +230,27 @@ function regionServesGeo(region, geo) {
229
230
  }
230
231
  /**
231
232
  * Resolve the Bedrock runtime region for a request. An explicit per-request
232
- * region and an ARN-embedded region win outright. Otherwise, for a geo-prefixed
233
- * cross-region inference profile (`us.`/`eu.`/`apac.`/`au.`/`jp.`/`us-gov.`), an
234
- * ambient region (`AWS_REGION` / `AWS_DEFAULT_REGION`) is honored only when it
235
- * can serve the profile's geo; a mismatched or absent ambient region is
236
- * corrected to the geo default so an `eu.`/`apac.` profile never POSTs to a `us`
237
- * endpoint (and vice versa). `global.` profiles have no geo entry, so the
238
- * ambient region (or `us-east-1`) is used unchanged.
233
+ * region and an ARN-embedded model region win outright. Otherwise, for a
234
+ * geo-prefixed cross-region inference profile (`us.`/`eu.`/`apac.`/`au.`/`jp.`/
235
+ * `us-gov.`), an ambient region (`AWS_REGION` / `AWS_DEFAULT_REGION`) is
236
+ * honored only when it can serve the profile's geo. If the ambient region is
237
+ * absent or mismatched, a same-geo guardrail ARN region is used when available;
238
+ * otherwise the geo default is used. `global.` profiles have no geo entry, so
239
+ * the ambient region (or, when absent, a guardrail ARN's region or
240
+ * `us-east-1`) is used unchanged.
239
241
  */
240
242
  function resolveBedrockRegion(modelId, options) {
241
243
  const explicit = options.region || inferRegionFromBedrockArn(modelId);
242
244
  if (explicit) return explicit;
243
245
  const ambient = resolveAwsAmbientRegion(options.profile);
246
+ const guardrailRegion = inferRegionFromBedrockArn(options.guardrailIdentifier ?? "");
244
247
  const geo = inferenceProfileGeo(modelId);
245
248
  if (geo) {
246
249
  if (ambient && regionServesGeo(ambient, geo)) return ambient;
250
+ if (guardrailRegion && regionServesGeo(guardrailRegion, geo)) return guardrailRegion;
247
251
  return INFERENCE_PROFILE_GEO_DEFAULT_REGION[geo];
248
252
  }
249
- return ambient || "us-east-1";
253
+ return ambient || guardrailRegion || "us-east-1";
250
254
  }
251
255
  /**
252
256
  * Bedrock validates that requests carrying any `toolUse`/`toolResult` history
@@ -264,6 +268,31 @@ const NO_TOOLS_SENTINEL = { toolSpec: {
264
268
  properties: {}
265
269
  } }
266
270
  } };
271
+ const REQUEST_METADATA_PATTERN = /^[a-zA-Z0-9\s:_@$#=/+,\-.]*$/;
272
+ const REQUEST_METADATA_MAX_ENTRIES = 16;
273
+ const REQUEST_METADATA_MAX_LENGTH = 256;
274
+ /**
275
+ * Bedrock rejects the whole invocation on a malformed `requestMetadata` entry.
276
+ * Attribution tags must never cost a turn, so invalid and excess entries are
277
+ * dropped with a warning instead of failing the request. Returns `undefined`
278
+ * for an empty result so the field is omitted from the body entirely.
279
+ */
280
+ function sanitizeRequestMetadata(raw) {
281
+ if (!isRecord(raw)) return void 0;
282
+ const out = {};
283
+ const dropped = [];
284
+ let kept = 0;
285
+ for (const [key, value] of Object.entries(raw)) {
286
+ if (typeof value !== "string" || key.length < 1 || key.length > REQUEST_METADATA_MAX_LENGTH || !REQUEST_METADATA_PATTERN.test(key) || value.length > REQUEST_METADATA_MAX_LENGTH || !REQUEST_METADATA_PATTERN.test(value) || kept >= REQUEST_METADATA_MAX_ENTRIES) {
287
+ dropped.push(key);
288
+ continue;
289
+ }
290
+ out[key] = value;
291
+ kept++;
292
+ }
293
+ if (dropped.length > 0) warn("Bedrock requestMetadata entries dropped", { keys: dropped });
294
+ return kept > 0 ? out : void 0;
295
+ }
267
296
  const streamBedrock = (model, context, options) => {
268
297
  const stream = new AssistantMessageEventStream();
269
298
  (async () => {
@@ -299,14 +328,22 @@ const streamBedrock = (model, context, options) => {
299
328
  const promptCachePolicy = resolvePromptCachePolicy(model, resolveCacheRetention(options.cacheRetention));
300
329
  const convertedMessages = convertMessages(context, model, promptCachePolicy);
301
330
  const toolPlan = planToolConfig(context.tools, options.toolChoice, convertedMessages);
302
- const toolConfig = toolPlan.toolConfig;
331
+ let toolConfig = toolPlan.toolConfig;
303
332
  const sentinelInjected = toolPlan.sentinelInjected;
304
333
  let additionalModelRequestFields = buildAdditionalModelRequestFields(model, options);
334
+ const prefixMismatchBehavior = model.thinking?.prefixBinding ? options.anthropicPrefixMismatchBehavior ?? "drop_block" : void 0;
305
335
  if (toolConfig?.toolChoice && additionalModelRequestFields) {
306
336
  const tc = toolConfig.toolChoice;
307
- if (tc.any || tc.tool) additionalModelRequestFields = void 0;
337
+ if (tc.any || tc.tool) {
338
+ if (prefixMismatchBehavior) toolConfig = {
339
+ ...toolConfig,
340
+ toolChoice: { auto: {} }
341
+ };
342
+ else additionalModelRequestFields = void 0;
343
+ }
308
344
  }
309
- const commandInput = {
345
+ if (prefixMismatchBehavior) additionalModelRequestFields = applyBedrockThinkingBinding(additionalModelRequestFields, prefixMismatchBehavior);
346
+ let commandInput = {
310
347
  messages: convertedMessages,
311
348
  system: buildSystemPrompt(context.systemPrompt, promptCachePolicy),
312
349
  inferenceConfig: {
@@ -315,9 +352,20 @@ const streamBedrock = (model, context, options) => {
315
352
  topP: options.topP
316
353
  },
317
354
  toolConfig,
318
- additionalModelRequestFields
355
+ guardrailConfig: buildGuardrailConfig(options),
356
+ additionalModelRequestFields,
357
+ requestMetadata: model.requestMetadata || options.requestMetadata ? {
358
+ ...model.requestMetadata,
359
+ ...options.requestMetadata
360
+ } : void 0,
361
+ ...prefixMismatchBehavior ? { additionalModelResponseFieldPaths: ["/input_transformations"] } : {}
362
+ };
363
+ const replacementInput = await options?.onPayload?.(commandInput, model);
364
+ if (replacementInput !== void 0) commandInput = replacementInput;
365
+ commandInput = {
366
+ ...commandInput,
367
+ requestMetadata: sanitizeRequestMetadata(commandInput.requestMetadata)
319
368
  };
320
- options?.onPayload?.(commandInput, model);
321
369
  const host = `bedrock-runtime.${region}.amazonaws.com`;
322
370
  const url = `https://${host}/model/${encodeURIComponent(model.id)}/converse-stream`;
323
371
  const urlPath = `/model/${encodeURIComponent(model.id)}/converse-stream`;
@@ -332,11 +380,12 @@ const streamBedrock = (model, context, options) => {
332
380
  const bodyText = JSON.stringify(commandInput);
333
381
  const body = new TextEncoder().encode(bodyText);
334
382
  const callerHeaders = {};
335
- for (const [name, value] of Object.entries(options?.headers ?? {})) {
383
+ for (const source of [model.headers, options?.headers]) for (const [name, value] of Object.entries(source ?? {})) {
336
384
  const field = name.toLowerCase();
337
385
  if (SIGNER_OWNED_HEADERS.has(field) || BEDROCK_RESERVED_HEADERS.has(field)) continue;
338
386
  callerHeaders[field] = value;
339
387
  }
388
+ callerHeaders["user-agent"] ??= USER_AGENT;
340
389
  const baseHeaders = {
341
390
  ...callerHeaders,
342
391
  "content-type": "application/json",
@@ -436,8 +485,20 @@ const streamBedrock = (model, context, options) => {
436
485
  break;
437
486
  case "messageStop": {
438
487
  const ev = payload;
488
+ const responseFields = isRecord(ev.additionalModelResponseFields) ? ev.additionalModelResponseFields : void 0;
489
+ const transformations = parseAnthropicInputTransformations(responseFields?.input_transformations);
490
+ if (transformations.length > 0) {
491
+ output.inputTransformations = transformations;
492
+ for (const transformation of transformations) {
493
+ if (transformation.reason !== "prefix_binding_mismatch") continue;
494
+ warn("bedrock: dropped thinking block after conversation prefix changed", {
495
+ model: model.id,
496
+ path: transformation.path
497
+ });
498
+ }
499
+ }
439
500
  output.stopReason = sentinelInjected && ev.stopReason === "tool_use" ? "stop" : mapStopReason(ev.stopReason);
440
- if (output.stopReason === "error") output.errorMessage = `Generation failed with stop reason: ${ev.stopReason ?? "unknown"}`;
501
+ if (output.stopReason === "error") output.errorMessage = ev.stopReason === "guardrail_intervened" ? `Response blocked by Amazon Bedrock guardrail (stop reason: ${ev.stopReason}).` : ev.stopReason === "content_filtered" ? `Response filtered by Amazon Bedrock content filters (stop reason: ${ev.stopReason}).` : `Generation failed with stop reason: ${ev.stopReason ?? "unknown"}`;
441
502
  break;
442
503
  }
443
504
  case "metadata": handleMetadata(payload, model, output);
@@ -605,7 +666,7 @@ function handleMetadata(event, model, output) {
605
666
  output.usage.cacheRead = event.usage.cacheReadInputTokens || 0;
606
667
  output.usage.cacheWrite = event.usage.cacheWriteInputTokens || 0;
607
668
  output.usage.totalTokens = event.usage.totalTokens || output.usage.input + output.usage.output;
608
- calculateCost(model, output.usage);
669
+ calculateCost(model, output.usage, output.timestamp);
609
670
  }
610
671
  }
611
672
  function handleContentBlockStop(event, blocks, output, stream) {
@@ -671,16 +732,6 @@ function takeCachePoint(policy) {
671
732
  ...policy.ttl ? { ttl: policy.ttl } : {}
672
733
  } };
673
734
  }
674
- /**
675
- * Check if the model supports thinking signatures in reasoningContent.
676
- * Only Anthropic Claude models support the signature field.
677
- * Other models (Nova, Titan, Mistral, Llama, etc.) reject it with:
678
- * "This model doesn't support the reasoningContent.reasoningText.signature field"
679
- */
680
- function supportsThinkingSignature(model) {
681
- const id = model.id.toLowerCase();
682
- return id.includes("anthropic.claude") || id.includes("anthropic/claude");
683
- }
684
735
  function buildSystemPrompt(systemPrompt, promptCachePolicy) {
685
736
  const prompts = normalizeSystemPrompts(systemPrompt);
686
737
  if (prompts.length === 0) return void 0;
@@ -740,12 +791,11 @@ function convertMessages(context, model, promptCachePolicy) {
740
791
  } });
741
792
  break;
742
793
  case "thinking":
743
- if (c.thinking.trim().length === 0) continue;
794
+ if (c.thinking.trim().length === 0 && !c.thinkingSignature) continue;
744
795
  if (c.thinkingSignature) contentBlocks.push({ reasoningContent: { reasoningText: {
745
796
  text: c.thinking.toWellFormed(),
746
797
  signature: c.thinkingSignature
747
798
  } } });
748
- else if (!supportsThinkingSignature(model)) contentBlocks.push({ reasoningContent: { reasoningText: { text: c.thinking.toWellFormed() } } });
749
799
  else contentBlocks.push({ text: renderDemotedThinking(model.id, c.thinking) });
750
800
  break;
751
801
  default: throw new ValidationError("Unknown assistant content type");
@@ -858,10 +908,35 @@ function mapStopReason(reason) {
858
908
  default: return "error";
859
909
  }
860
910
  }
911
+ /**
912
+ * Build the Converse `guardrailConfig` block when a guardrail identifier is set.
913
+ * The version defaults to `"DRAFT"` (Bedrock's editable working draft) and the
914
+ * trace is passed through untouched — leaving it undefined keeps Bedrock's own
915
+ * default rather than forcing a value.
916
+ */
917
+ function buildGuardrailConfig(options) {
918
+ if (!options.guardrailIdentifier) return void 0;
919
+ return {
920
+ guardrailIdentifier: options.guardrailIdentifier,
921
+ guardrailVersion: options.guardrailVersion ?? "DRAFT",
922
+ ...options.guardrailTrace === void 0 ? {} : { trace: options.guardrailTrace }
923
+ };
924
+ }
925
+ function applyBedrockThinkingBinding(fields, behavior) {
926
+ const result = { ...fields };
927
+ const thinking = isRecord(result.thinking) ? { ...result.thinking } : { type: "adaptive" };
928
+ thinking.block_binding = { prefix_mismatch_behavior: behavior };
929
+ result.thinking = thinking;
930
+ const betas = Array.isArray(result.anthropic_beta) ? result.anthropic_beta.filter((beta) => typeof beta === "string") : [];
931
+ if (!betas.includes("thinking-binding-controls-2026-08-01")) betas.push(THINKING_BINDING_CONTROLS_BETA);
932
+ result.anthropic_beta = betas;
933
+ return result;
934
+ }
861
935
  function buildAdditionalModelRequestFields(model, options) {
862
936
  const reasoning = options.reasoning;
863
937
  if (!reasoning || !model.reasoning) return void 0;
864
- if (model.thinking?.mode === "anthropic-adaptive") {
938
+ const mode = model.thinking?.mode;
939
+ if (mode === "anthropic-adaptive") {
865
940
  const effort = mapEffortToAnthropicAdaptiveEffort(model, reasoning);
866
941
  const adaptive = { type: "adaptive" };
867
942
  if (model.thinking?.supportsDisplay) adaptive.display = options.thinkingDisplay ?? "summarized";
@@ -870,6 +945,10 @@ function buildAdditionalModelRequestFields(model, options) {
870
945
  output_config: { effort }
871
946
  };
872
947
  }
948
+ if (mode === "effort") {
949
+ const level = requireSupportedEffort(model, reasoning);
950
+ return { reasoning: { effort: model.thinking?.effortMap?.[level] ?? level } };
951
+ }
873
952
  const level = requireSupportedEffort(model, reasoning);
874
953
  const result = { thinking: {
875
954
  type: "enabled",