@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
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Detect and resolve unresolved git merge conflicts that surface in `read`
3
+ * output.
4
+ *
5
+ * Workflow:
6
+ * 1. `read` collects lines from disk as usual.
7
+ * 2. `scanConflictLines` inspects those lines (no extra I/O) for
8
+ * well-formed `<<<<<<<` / `=======` / `>>>>>>>` blocks.
9
+ * 3. Each completed block is registered with the session's
10
+ * `ConflictHistory`, which assigns it a stable id.
11
+ * 4. The read output is returned verbatim with a short footer naming
12
+ * every conflict id surfaced, and the agent calls
13
+ * `write({ path: "conflict://<id>", content })` to splice the
14
+ * recorded region with the chosen content.
15
+ *
16
+ * Marker shape is strict: only column-0 markers of the exact prefix length
17
+ * followed by either EOL or a single space + label count. Lines that
18
+ * merely start with `<` or `=` never match.
19
+ */
20
+ import type { ToolSession } from "./index";
21
+ export interface ConflictBlock {
22
+ /** 1-indexed line of the `<<<<<<<` marker. */
23
+ startLine: number;
24
+ /** 1-indexed line of the `=======` separator. */
25
+ separatorLine: number;
26
+ /** 1-indexed line of the `>>>>>>>` marker. */
27
+ endLine: number;
28
+ /** 1-indexed line of the `|||||||` base marker (diff3 only). */
29
+ baseLine?: number;
30
+ oursLabel?: string;
31
+ baseLabel?: string;
32
+ theirsLabel?: string;
33
+ oursLines: string[];
34
+ baseLines?: string[];
35
+ theirsLines: string[];
36
+ }
37
+ /**
38
+ * Scan an already-collected array of file lines for completed conflict
39
+ * blocks. `firstLineNumber` is the 1-indexed line number of `lines[0]`
40
+ * (so a windowed read starting at line 200 passes `firstLineNumber: 200`).
41
+ *
42
+ * Only fully-closed blocks (opener + separator + closer all present in
43
+ * the window) are returned. A block whose closer is past the window's
44
+ * tail is dropped — the agent will see the open marker and can widen
45
+ * the read.
46
+ */
47
+ export declare function scanConflictLines(lines: readonly string[], firstLineNumber: number): ConflictBlock[];
48
+ /**
49
+ * Scan a whole file for unresolved conflict blocks.
50
+ *
51
+ * Reads at most `maxBytes` (default 10 MB) so this stays cheap on
52
+ * pathological files. Files truncated by the cap report
53
+ * `scanTruncated: true`; only complete blocks within the scanned prefix
54
+ * are returned, so trailing partial markers never invent fake blocks.
55
+ */
56
+ export declare function scanFileForConflicts(absolutePath: string, options?: {
57
+ maxBytes?: number;
58
+ }): Promise<{
59
+ blocks: ConflictBlock[];
60
+ scanTruncated: boolean;
61
+ }>;
62
+ /**
63
+ * Recorded conflict block keyed by a session-stable id. The history is
64
+ * append-only; ids stay valid even after later writes resolve other
65
+ * blocks in the same file, so retries don't depend on re-reading.
66
+ */
67
+ export interface ConflictEntry extends ConflictBlock {
68
+ id: number;
69
+ absolutePath: string;
70
+ displayPath: string;
71
+ }
72
+ /** Per-session log of conflict regions surfaced by `read`. */
73
+ export declare class ConflictHistory {
74
+ #private;
75
+ /**
76
+ * Register a conflict block. Returns the (possibly pre-existing) entry
77
+ * — if the same `absolutePath`+`startLine` was registered before, the
78
+ * earlier id is reused so a re-read does not inflate the counter or
79
+ * orphan the prior id. The recorded region is overwritten on re-read
80
+ * so the splice always reflects the current marker positions on disk.
81
+ */
82
+ register(input: Omit<ConflictEntry, "id">): ConflictEntry;
83
+ get(id: number): ConflictEntry | undefined;
84
+ /** Snapshot every registered entry in insertion (id) order. */
85
+ entries(): ConflictEntry[];
86
+ /** Drop a single entry by id. Used after a successful resolve. */
87
+ invalidate(id: number): void;
88
+ /** Drop every entry referencing `absolutePath`. Used after a successful resolve. */
89
+ invalidatePath(absolutePath: string): void;
90
+ }
91
+ /** Lazily attach a `ConflictHistory` to the session and return it. */
92
+ export declare function getConflictHistory(session: ToolSession): ConflictHistory;
93
+ /** A side of a conflict block that the `read` tool can render via `conflict://N/<scope>`. */
94
+ export type ConflictScope = "ours" | "theirs" | "base";
95
+ /** Parsed `conflict://<N>` / `conflict://<N>/<scope>` / `conflict://*` URI. */
96
+ export interface ParsedConflictUri {
97
+ /** `"*"` selects every currently-registered conflict (bulk write only). */
98
+ id: number | "*";
99
+ scope?: ConflictScope;
100
+ /**
101
+ * When `raw` was a malformed `<file-prefix>:conflict://…` path, the
102
+ * stripped prefix is preserved here so callers can surface a gentle
103
+ * "you don't need the file path" note. `undefined` for clean URIs.
104
+ */
105
+ recoveredPrefix?: string;
106
+ }
107
+ /**
108
+ * Parse a `conflict://<N>`, `conflict://<N>/<scope>`, or `conflict://*` URI.
109
+ *
110
+ * Returns `null` for non-conflict paths; throws `ToolError` for a
111
+ * well-formed scheme with an invalid id or scope so the agent gets a
112
+ * clear actionable message rather than a confusing "not found" later.
113
+ *
114
+ * `*` is the bulk-write wildcard — only valid as `conflict://*` (no
115
+ * scope segment). Use it with `write({ path: "conflict://*", content })`
116
+ * to apply `content` (with optional `@ours` / `@theirs` / `@base` /
117
+ * `@both` shorthand) to every currently-registered conflict in one shot.
118
+ */
119
+ export declare function parseConflictUri(raw: string): ParsedConflictUri | null;
120
+ /** Result of {@link spliceConflict}: the new file text plus any boundary-echo repair applied. */
121
+ export interface ConflictSplice {
122
+ text: string;
123
+ /** Replacement lines dropped because they duplicated the context directly above the region. */
124
+ trimmedLeading: number;
125
+ /** Replacement lines dropped because they duplicated the context directly below the region. */
126
+ trimmedTrailing: number;
127
+ }
128
+ /**
129
+ * Splice the conflict region recorded in `entry` out of `originalText`
130
+ * and replace it with `replacement` (markers and all sides included).
131
+ *
132
+ * Works like the edit tool's patch infra: locates the recorded marker
133
+ * block by content (anchored to `entry.startLine` as the preferred
134
+ * match), so out-of-band edits earlier in the file that shift line
135
+ * numbers don't break resolution. Throws clearly when the marker block
136
+ * has actually been altered or removed.
137
+ *
138
+ * Boundary-echo repair (same philosophy as the edit tool's hashline
139
+ * keeper repair): models frequently paste the "whole resolved function"
140
+ * including the lines that live directly before/after the marker block,
141
+ * which the verbatim splice would duplicate. Replacement lines that
142
+ * exactly echo the adjacent context are dropped when the echo is
143
+ * unambiguous — two or more consecutive lines, or a single line whose
144
+ * removal fixes a delimiter-balance mismatch against the recorded sides.
145
+ */
146
+ export declare function spliceConflict(originalText: string, entry: ConflictEntry, replacement: string): ConflictSplice;
147
+ /**
148
+ * True when two registered blocks record the same marker-block content
149
+ * (labels and all sides). Out-of-band edits can shift a block's line
150
+ * numbers between reads, registering a fresh id while the stale one
151
+ * persists; callers use content identity to treat a locate-miss for the
152
+ * stale twin as "already resolved" instead of a hard failure.
153
+ */
154
+ export declare function conflictRegionsEqual(a: ConflictBlock, b: ConflictBlock): boolean;
155
+ /**
156
+ * True when the entry's recorded marker block still occurs in `content`
157
+ * (LF-normalized — recorded sections are stored LF). Distinguishes a stale
158
+ * re-registration of a just-resolved region (no longer present) from a
159
+ * DISTINCT conflict block that happens to be byte-identical (still present
160
+ * elsewhere in the file and must stay addressable).
161
+ */
162
+ export declare function conflictRegionPresent(content: string, entry: ConflictBlock): boolean;
163
+ /**
164
+ * Expand `@ours` / `@theirs` / `@base` / `@both` line tokens against the
165
+ * recorded sections of `entry`. A token only triggers when it is the
166
+ * entire content of a line (after CRLF normalisation), so `@ours` inside
167
+ * actual code is left alone. Other lines pass through verbatim.
168
+ *
169
+ * - `@ours` → expands to the recorded `oursLines` (in order).
170
+ * - `@theirs` → expands to the recorded `theirsLines` (in order).
171
+ * - `@base` → expands to `baseLines`; throws if no base section was
172
+ * recorded (i.e. the conflict was 2-way, not diff3).
173
+ * - `@both` → expands to `oursLines` then `theirsLines`.
174
+ */
175
+ export declare function expandContentTokens(content: string, entry: ConflictEntry): string;
176
+ /**
177
+ * Materialise a conflict block for `conflict://<N>` reads (and their
178
+ * `/ours` / `/theirs` / `/base` scopes).
179
+ *
180
+ * Returns:
181
+ * - `lines`: the lines to render, ordered top-to-bottom.
182
+ * - `startLine`: the 1-indexed file line number `lines[0]` corresponds
183
+ * to, so the read formatter can label hashline anchors with the
184
+ * original file positions.
185
+ *
186
+ * Bare (no scope) returns the full block including marker lines. A
187
+ * scoped view returns only that side's body — `base` throws when the
188
+ * recorded conflict is a 2-way merge with no base section.
189
+ */
190
+ export declare function renderConflictRegion(entry: ConflictEntry, scope: ConflictScope | undefined): {
191
+ lines: string[];
192
+ startLine: number;
193
+ };
194
+ /**
195
+ * Build a compact diff-style footer describing the conflicts registered
196
+ * during a read. Designed to be appended after the file content.
197
+ *
198
+ * Format:
199
+ *
200
+ * ⚠ N unresolved conflicts detected
201
+ * - ours = HEAD
202
+ * - theirs = feature/x
203
+ * NOTICE: …
204
+ *
205
+ * ──── #1 L42-48 ────
206
+ * <<< ours
207
+ * …ours body…
208
+ * === base ≡ ours
209
+ * >>> theirs
210
+ * …theirs body…
211
+ *
212
+ * Labels are aggregated once at the top from the first entry that has
213
+ * them; when a section body equals another section's body the redundant
214
+ * body is collapsed to `≡ <other>`.
215
+ */
216
+ export interface FormatConflictWarningOptions {
217
+ /**
218
+ * Total number of conflicts in the underlying file. If greater than
219
+ * `entries.length` the header notes how many are visible vs the total
220
+ * and points at `:conflicts` for the compact list.
221
+ */
222
+ totalInFile?: number;
223
+ /** Display path used inside the `:conflicts` hint. */
224
+ displayPath?: string;
225
+ /** Whether the underlying file scan hit its byte cap. */
226
+ scanTruncated?: boolean;
227
+ }
228
+ export declare function formatConflictWarning(entries: readonly ConflictEntry[], options?: FormatConflictWarningOptions): string;
229
+ /**
230
+ * Render a single-line-per-block index of every conflict in a file.
231
+ * Used by the `<path>:conflicts` read selector to give the agent a cheap overview
232
+ * of a heavily-conflicted file without dumping every body.
233
+ */
234
+ export declare function formatConflictSummary(entries: readonly ConflictEntry[], options?: {
235
+ displayPath: string;
236
+ scanTruncated?: boolean;
237
+ }): string;
@@ -0,0 +1,103 @@
1
+ import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
2
+ import type { FetchImpl } from "@oh-my-pi/pi-ai";
3
+ import type { Settings } from "../config/settings";
4
+ import type { ToolSession } from "../sdk";
5
+ import type { AgentStorage } from "../session/agent-storage";
6
+ import { type OutputMeta } from "./output-meta";
7
+ import { type LineRange } from "./path-utils";
8
+ export interface ParsedReadUrlTarget {
9
+ path: string;
10
+ raw: boolean;
11
+ offset?: number;
12
+ limit?: number;
13
+ /** Populated only when the selector carries 2+ ranges. Single-range stays on offset/limit. */
14
+ ranges?: readonly LineRange[];
15
+ }
16
+ export declare function parseReadUrlTarget(readPath: string): ParsedReadUrlTarget | null;
17
+ /** Reader backends for {@link renderHtmlToText}, in default priority order. */
18
+ export type FetchProvider = "native" | "trafilatura" | "lynx" | "parallel" | "jina" | "browser";
19
+ export declare const FETCH_PROVIDER_ORDER: readonly FetchProvider[];
20
+ /**
21
+ * Render HTML to markdown by trying reader backends in priority order: native
22
+ * (in-process), trafilatura, lynx, Parallel, Jina, then the browser
23
+ * (headless-Chromium JS rendering, see {@link renderUrlWithBrowser} — gated
24
+ * behind `browser.readerEnabled`). The `providers.fetch` setting picks the
25
+ * order — `auto` uses the default above; any specific backend is tried first,
26
+ * then the remaining backends as fallbacks. Every backend's output must clear
27
+ * the same quality gate (>100 non-whitespace chars and not
28
+ * {@link isLowQualityOutput}) before it is accepted, otherwise the next
29
+ * backend is tried.
30
+ *
31
+ * When the raw HTML is a CSR app shell (script-heavy, text-light), output
32
+ * from {@link CSR_SUSCEPTIBLE} backends (which cannot execute page
33
+ * JavaScript) is held back as low quality so the chain still reaches the
34
+ * browser backend; with no usable browser the parked shell is returned as
35
+ * before, so degradation is unchanged. The browser's own output on a shell
36
+ * is accepted as-is (a noscript remnant is expected in it).
37
+ *
38
+ * The overall `timeout` budget bounds the whole call; remote backends (Parallel,
39
+ * Jina) are additionally capped at `REMOTE_READER_MAX_MS` so a hung endpoint
40
+ * cannot starve later renderers — especially the purely-local native converter,
41
+ * which always works on already-loaded HTML. Only a real `userSignal`
42
+ * cancellation aborts the chain (#1449).
43
+ */
44
+ export declare function renderHtmlToText(url: string, html: string, timeout: number, settings: Settings, userSignal: AbortSignal | undefined, storage: AgentStorage | null, fetchOverride?: FetchImpl): Promise<{
45
+ content: string;
46
+ ok: boolean;
47
+ method: string;
48
+ }>;
49
+ /**
50
+ * Detect a client-side-rendered (CSR) app shell in raw HTML: script-dense
51
+ * markup with almost no statically visible text. Such pages only produce body
52
+ * content after JavaScript executes, so JS-unaware extractors (native/
53
+ * trafilatura/lynx) necessarily return a shell remnant (title/meta remnants)
54
+ * while the browser backend can render the real body. Deliberately
55
+ * conservative — compact HTML, multiple script tags, sparse static text — so
56
+ * genuine SSR pages are never flagged and their rendering order is unchanged.
57
+ * @returns true when the HTML looks like an unrendered SPA shell.
58
+ */
59
+ export declare function isCsrHtmlShell(html: string): boolean;
60
+ interface FetchImagePayload {
61
+ data: string;
62
+ mimeType: string;
63
+ }
64
+ export interface ReadUrlToolDetails {
65
+ kind: "url";
66
+ url: string;
67
+ finalUrl: string;
68
+ contentType: string;
69
+ method: string;
70
+ truncated: boolean;
71
+ notes: string[];
72
+ meta?: OutputMeta;
73
+ /** DSH (拍板#22): committed attachment facts when the URL image went through the bridge. */
74
+ image?: import("../../shared/image-bridge.ts").SavedImageRef;
75
+ }
76
+ interface ReadUrlEntry {
77
+ artifactId?: string;
78
+ artifactPath?: string;
79
+ details: ReadUrlToolDetails;
80
+ image?: FetchImagePayload;
81
+ output: string;
82
+ content: string;
83
+ }
84
+ /** Fetch and render a URL for a read or search operation. */
85
+ export declare function fetchReadUrl(session: ToolSession, params: {
86
+ path: string;
87
+ raw?: boolean;
88
+ }, signal?: AbortSignal, options?: {
89
+ ensureArtifact?: boolean;
90
+ }): Promise<ReadUrlEntry>;
91
+ /** Materialize rendered URL body text to a local file for tools that require filesystem paths. */
92
+ export declare function materializeReadUrlToFile(session: ToolSession, params: {
93
+ path: string;
94
+ raw?: boolean;
95
+ }, signal?: AbortSignal): Promise<{
96
+ path: string;
97
+ details: ReadUrlToolDetails;
98
+ }>;
99
+ export declare function executeReadUrl(session: ToolSession, params: {
100
+ path: string;
101
+ raw?: boolean;
102
+ }, signal?: AbortSignal): Promise<AgentToolResult<ReadUrlToolDetails>>;
103
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Creates a deduplicating recorder for relative file paths.
3
+ * Preserves insertion order in `list`; subsequent duplicates are ignored.
4
+ */
5
+ export declare function createFileRecorder(): {
6
+ record: (relativePath: string) => void;
7
+ list: string[];
8
+ };
9
+ /**
10
+ * Strip native virtual-root prefixes and format file paths relative to cwd when
11
+ * they are inside cwd. Paths outside cwd remain absolute.
12
+ */
13
+ export declare function formatResultPath(filePath: string, isDirectory: boolean, basePath: string, cwd: string): string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Invalidate shared filesystem scan caches after a content write/update.
3
+ */
4
+ export declare function invalidateFsScanAfterWrite(path: string): void;
5
+ /**
6
+ * Invalidate shared filesystem scan caches after deleting a file.
7
+ */
8
+ export declare function invalidateFsScanAfterDelete(path: string): void;
9
+ /**
10
+ * Invalidate shared filesystem scan caches after a rename/move.
11
+ *
12
+ * Some watchers care about the disappearance at the old path; others about the
13
+ * appearance at the new one. Bust both to keep callers honest.
14
+ */
15
+ export declare function invalidateFsScanAfterRename(oldPath: string, newPath: string): void;
@@ -0,0 +1,86 @@
1
+ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
2
+ import type { ToolExample } from "@oh-my-pi/pi-ai";
3
+ import { type TruncationResult } from "../../omp/session/streaming-output.ts";
4
+ import type { ToolSession } from "../../omp/sdk.ts";
5
+ import { type OutputMeta } from "../../omp/tools/output-meta.ts";
6
+ declare const findSchema: import("@oh-my-pi/omptype").FluentType<{
7
+ path?: string | undefined;
8
+ gitignore?: boolean | undefined;
9
+ hidden?: boolean | undefined;
10
+ limit?: number | undefined;
11
+ }, {
12
+ path?: string | undefined;
13
+ gitignore?: boolean | undefined;
14
+ hidden?: boolean | undefined;
15
+ limit?: number | undefined;
16
+ }>;
17
+ export type GlobToolInput = typeof findSchema.infer;
18
+ export interface GlobToolDetails {
19
+ truncation?: TruncationResult;
20
+ resultLimitReached?: number;
21
+ meta?: OutputMeta;
22
+ scopePath?: string;
23
+ fileCount?: number;
24
+ files?: string[];
25
+ truncated?: boolean;
26
+ error?: string;
27
+ /** Working directory at search time. Used by the renderer to resolve relative
28
+ * file paths to absolute paths for OSC 8 hyperlinks. */
29
+ cwd?: string;
30
+ /** User-supplied paths whose base directory was missing on disk. The tool
31
+ * skipped these and continued with the surviving entries; surfaced as a
32
+ * non-fatal warning in the renderer and in the model-facing text. */
33
+ missingPaths?: string[];
34
+ }
35
+ /**
36
+ * Pluggable operations for the find tool.
37
+ * Override these to delegate file search to remote systems (e.g., SSH).
38
+ */
39
+ export interface GlobOperations {
40
+ /** Check if path exists */
41
+ exists: (absolutePath: string) => Promise<boolean> | boolean;
42
+ /** Optional stat for distinguishing files vs directories. */
43
+ stat?: (absolutePath: string) => Promise<{
44
+ isFile(): boolean;
45
+ isDirectory(): boolean;
46
+ }> | {
47
+ isFile(): boolean;
48
+ isDirectory(): boolean;
49
+ };
50
+ /** Find files matching glob pattern. Returns relative paths. */
51
+ glob: (pattern: string, cwd: string, options: {
52
+ ignore: string[];
53
+ limit: number;
54
+ }) => Promise<string[]> | string[];
55
+ }
56
+ export interface GlobToolOptions {
57
+ /** Custom operations for find. Default: local filesystem + rg */
58
+ operations?: GlobOperations;
59
+ /** Remap slash-only paths to the session cwd before root-search validation. */
60
+ rootPathAlias?: boolean;
61
+ }
62
+ export declare class GlobTool implements AgentTool<typeof findSchema, GlobToolDetails> {
63
+ #private;
64
+ private readonly session;
65
+ readonly name = "glob";
66
+ readonly approval: "read";
67
+ readonly loadMode = "essential";
68
+ readonly label = "Glob";
69
+ get description(): string;
70
+ readonly parameters: import("@oh-my-pi/omptype").FluentType<{
71
+ path?: string | undefined;
72
+ gitignore?: boolean | undefined;
73
+ hidden?: boolean | undefined;
74
+ limit?: number | undefined;
75
+ }, {
76
+ path?: string | undefined;
77
+ gitignore?: boolean | undefined;
78
+ hidden?: boolean | undefined;
79
+ limit?: number | undefined;
80
+ }>;
81
+ readonly examples: readonly ToolExample<typeof findSchema.infer>[];
82
+ readonly strict = true;
83
+ constructor(session: ToolSession, options?: GlobToolOptions);
84
+ execute(_toolCallId: string, params: typeof findSchema.infer, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<GlobToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<GlobToolDetails>>;
85
+ }
86
+ export {};
@@ -0,0 +1,102 @@
1
+ import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolTier } from "@oh-my-pi/pi-agent-core";
2
+ import { type TruncationResult } from "../../omp/session/streaming-output.ts";
3
+ import type { ToolSession } from "../../omp/sdk.ts";
4
+ import type { OutputMeta } from "../../omp/tools/output-meta.ts";
5
+ declare const searchSchema: import("@oh-my-pi/omptype").FluentType<{
6
+ pattern: string;
7
+ path?: string | undefined;
8
+ case?: boolean | undefined;
9
+ gitignore?: boolean | undefined;
10
+ skip?: number | null | undefined;
11
+ }, {
12
+ pattern: string;
13
+ path?: string | undefined;
14
+ case?: boolean | undefined;
15
+ gitignore?: boolean | undefined;
16
+ skip?: number | null | undefined;
17
+ }>;
18
+ export type GrepToolInput = typeof searchSchema.infer;
19
+ /** Maximum number of distinct files surfaced in a single response. The
20
+ * agent paginates further pages via `skip`. */
21
+ export declare const DEFAULT_FILE_LIMIT = 20;
22
+ /** Per-file match cap for multi-file searches — keeps a single hot file
23
+ * from crowding out diverse hits. Applied in JS after grep returns. */
24
+ export declare const MULTI_FILE_PER_FILE_MATCHES = 20;
25
+ /** Per-file match cap for single-file searches — there's no diversity
26
+ * concern when the scope is one file. */
27
+ export declare const SINGLE_FILE_MATCHES = 200;
28
+ export interface GrepToolDetails {
29
+ truncation?: TruncationResult;
30
+ fileLimitReached?: number;
31
+ perFileLimitReached?: number;
32
+ linesTruncated?: boolean;
33
+ meta?: OutputMeta;
34
+ scopePath?: string;
35
+ matchCount?: number;
36
+ fileCount?: number;
37
+ files?: string[];
38
+ fileMatches?: Array<{
39
+ path: string;
40
+ count: number;
41
+ }>;
42
+ truncated?: boolean;
43
+ error?: string;
44
+ /** Pre-formatted text for the user-visible TUI render. Mirrors the model-facing
45
+ * `result.text` lines but uses a `│` gutter and `*` to mark match lines (vs space for
46
+ * context). The TUI uses this directly so it never parses model-facing hashline anchors. */
47
+ displayContent?: string;
48
+ /** Absolute base directory used during search. Used by the renderer to resolve
49
+ * display-relative paths to absolute paths for OSC 8 hyperlinks. */
50
+ searchPath?: string;
51
+ /** Session cwd at search time. The renderer resolves the display-relative
52
+ * (cwd-relative) header/match paths against this for OSC 8 hyperlinks;
53
+ * `searchPath` is the scope label target, not the display-path base. */
54
+ cwd?: string;
55
+ /** User-supplied paths whose base directory was missing on disk. The tool
56
+ * skipped these and continued with the surviving entries; surfaced as a
57
+ * non-fatal warning in the renderer and in the model-facing text. */
58
+ missingPaths?: string[];
59
+ }
60
+ type SearchParams = typeof searchSchema.infer;
61
+ /**
62
+ * Construction-time overrides for callers that are not the model.
63
+ *
64
+ * The model-facing schema deliberately does not grow these: they exist for
65
+ * wire bridges (the Cursor `pi_grep` frame) whose protocol carries an explicit
66
+ * context width and total match cap, and which would otherwise have to drop
67
+ * them. Unset means "use the session settings / built-in caps" — the behavior
68
+ * every model-issued call keeps.
69
+ */
70
+ export interface GrepToolOptions {
71
+ /** Overrides `grep.contextBefore`/`grep.contextAfter` for every call on this instance. */
72
+ context?: number;
73
+ /** Caps total surfaced matches. Applied on top of the built-in per-file and file-window caps, never above them. */
74
+ totalMatchLimit?: number;
75
+ }
76
+ export declare class GrepTool implements AgentTool<typeof searchSchema, GrepToolDetails> {
77
+ #private;
78
+ private readonly session;
79
+ readonly name = "grep";
80
+ readonly approval: (args: unknown) => ToolTier;
81
+ readonly label = "Grep";
82
+ readonly loadMode = "discoverable";
83
+ readonly summary = "Grep file contents using ripgrep (fast regex search)";
84
+ get description(): string;
85
+ readonly parameters: import("@oh-my-pi/omptype").FluentType<{
86
+ pattern: string;
87
+ path?: string | undefined;
88
+ case?: boolean | undefined;
89
+ gitignore?: boolean | undefined;
90
+ skip?: number | null | undefined;
91
+ }, {
92
+ pattern: string;
93
+ path?: string | undefined;
94
+ case?: boolean | undefined;
95
+ gitignore?: boolean | undefined;
96
+ skip?: number | null | undefined;
97
+ }>;
98
+ readonly strict = true;
99
+ constructor(session: ToolSession, options?: GrepToolOptions);
100
+ execute(_toolCallId: string, params: SearchParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<GrepToolDetails>, _toolContext?: AgentToolContext): Promise<AgentToolResult<GrepToolDetails>>;
101
+ }
102
+ export {};
@@ -0,0 +1,70 @@
1
+ /**
2
+ * One file's contribution to a grouped file output. The header itself is generated
3
+ * by `formatGroupedFiles` (one `#` per nesting level); use `headerSuffix` to tack
4
+ * on extras like ` (1 replacement)`.
5
+ */
6
+ export interface GroupedFileSection {
7
+ /** Optional suffix appended to the file header. */
8
+ headerSuffix?: string;
9
+ /** Body lines emitted into the textual model output. */
10
+ modelLines: string[];
11
+ /** Body lines emitted into the display output. Defaults to `modelLines`. */
12
+ displayLines?: string[];
13
+ /** When true, the file (and its header) is omitted entirely. */
14
+ skip?: boolean;
15
+ }
16
+ export interface GroupedFilesOutput {
17
+ model: string[];
18
+ display: string[];
19
+ }
20
+ /**
21
+ * Render a list of files as a multi-level, prefix-folded directory tree shared by
22
+ * grep, ast-grep, ast-edit, and the LSP diagnostic formatter.
23
+ *
24
+ * Layout (one `#` per level; the shared prefix folds into the top header):
25
+ * # packages/pkg/src/
26
+ * ## root.ts
27
+ * …body…
28
+ * ## nested/
29
+ * ### child.ts
30
+ * …body…
31
+ *
32
+ * Files in the (folded) project root become single-`#` headers with no parent
33
+ * directory line. A blank line precedes every directory header and every
34
+ * root-level file so the renderers can split the output into collapsible groups.
35
+ */
36
+ export declare function formatGroupedFiles(files: string[], renderFile: (filePath: string) => GroupedFileSection): GroupedFilesOutput;
37
+ /** Per-line classification of grouped output, used by renderers for hyperlinks. */
38
+ export interface GroupedLineContext {
39
+ /** Directory header, file header, or any non-header body/content line. */
40
+ kind: "dir" | "file" | "content";
41
+ /** Number of leading `#` for headers; 0 for content lines. */
42
+ depth: number;
43
+ /** Resolved absolute path of the dir/file a header points at (when resolvable). */
44
+ headerPath?: string;
45
+ /** For content lines, the absolute path of the owning file (line hyperlinks). */
46
+ filePath?: string;
47
+ /** Header is an internal/url-like target the caller resolves itself. */
48
+ isUrl?: boolean;
49
+ }
50
+ /**
51
+ * Walk grouped output lines, tracking a directory stack keyed by header depth, so
52
+ * each header and body line can be linked back to its absolute filesystem path.
53
+ * Reconstruction is stack-based (not per-blank-group) so nested directory headers
54
+ * resolve correctly across the whole output.
55
+ *
56
+ * `headerBase` is the directory the displayed (folded) header paths are relative
57
+ * to — for grep/ast tools that is the session cwd, since display paths are
58
+ * formatted relative to cwd regardless of the (sub)directory the search was
59
+ * scoped to. `fileScope` is the initial owning file for body lines that appear
60
+ * before any header (single-file scopes have no `#` headers); it defaults to
61
+ * `headerBase` and should be passed the scoped file's absolute path.
62
+ */
63
+ export declare function classifyGroupedLines(lines: readonly string[], headerBase: string | undefined, fileScope?: string | undefined): GroupedLineContext[];
64
+ /**
65
+ * Split line indices into blank-line-separated groups, mirroring
66
+ * `splitGroupsByBlankLine`: when any blank line is present, break on runs of
67
+ * blanks; otherwise return a single group of the non-empty lines. Returning
68
+ * indices lets callers slice parallel arrays (raw lines, styled lines, contexts).
69
+ */
70
+ export declare function groupLineIndicesByBlank(rawLines: readonly string[]): number[][];
@@ -0,0 +1,23 @@
1
+ /**
2
+ * DSH adapter type shim for OMP `tools/index.ts`.
3
+ *
4
+ * The original is the 746-line OMP tool-registry barrel (imports every
5
+ * built-in tool and re-exports the whole toolbox). The tool-plus adapters
6
+ * only consume its `ToolSession` and `Tool` types, so this shared shim
7
+ * re-exports those from the shared DSH adapter (`../sdk`) and pi-agent-core.
8
+ * No tool registries are carried.
9
+ *
10
+ * NOTE (step.md 决策记录): registry barrel intentionally not ported —
11
+ * decision pending user confirmation.
12
+ */
13
+ import type { AgentTool } from '@oh-my-pi/pi-agent-core';
14
+ import type { Settings } from '../config/settings.ts';
15
+ declare module '@oh-my-pi/pi-agent-core' {
16
+ interface AgentToolContext {
17
+ hasUI?: boolean;
18
+ toolNames?: string[];
19
+ }
20
+ }
21
+ export type { ToolSession } from '../sdk.ts';
22
+ export type { Settings };
23
+ export type Tool = AgentTool<any, any, any>;
@@ -0,0 +1,12 @@
1
+ import type { LimitsMeta } from "./output-meta";
2
+ export interface ListLimitResult<T> {
3
+ items: T[];
4
+ limitReached?: number;
5
+ meta: Partial<LimitsMeta>;
6
+ }
7
+ export interface ListLimitOptions {
8
+ limit?: number;
9
+ headLimit?: number;
10
+ limitType?: "match" | "result";
11
+ }
12
+ export declare function applyListLimit<T>(items: T[], options: ListLimitOptions): ListLimitResult<T>;