@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.
- package/THIRD_PARTY_NOTICES.md +9 -3
- package/lib/{abort-Cwwm4Err.mjs → abort-Caqff3M6.mjs} +2 -2
- package/lib/alibaba-coding-plan-DTupMiAi.mjs +73 -0
- package/lib/alibaba-token-plan-CHGyWOfX.mjs +46 -0
- package/lib/alibaba-token-plan-Dj3OZhEE.mjs +82 -0
- package/lib/{amazon-bedrock-TVMpUTRG.mjs → amazon-bedrock-DbFSYXfJ.mjs} +117 -38
- package/lib/{anthropic-BL6LFDQS.mjs → anthropic-CTJ3IQVa.mjs} +675 -166
- package/lib/anthropic-CXfWlp-x.mjs +105 -0
- package/lib/{aws-credentials-B20dliS7.mjs → anthropic-wire-CKuhDwZ1.mjs} +74 -14
- package/lib/{api-key-login-CIDnXeYd.mjs → api-key-validation-CGCJFbFr.mjs} +27 -68
- package/lib/{azure-openai-responses-BkhsLmN3.mjs → azure-openai-responses-ChFbWaGj.mjs} +27 -16
- package/lib/{browser-render-CmgvSNte.mjs → browser-render-9o0Rknop.mjs} +4 -4
- package/lib/bun-shim.mjs +71 -2
- package/lib/{bundled-references-ChZSPDFw.mjs → bundled-references-DY3EJxZV.mjs} +6 -5
- package/lib/cline-pass-Bwg3esu9.mjs +44 -0
- package/lib/cloudflare-ai-gateway-BupNXyKK.mjs +35 -0
- package/lib/cloudflare-ai-gateway-EWo0VkP5.mjs +44 -0
- package/lib/collapse-DOR8sOGf.mjs +2304 -0
- package/lib/coreweave-C82HrLpb.mjs +31 -0
- package/lib/coreweave-Ct8cF-da.mjs +14 -0
- package/lib/{cursor-B6HcmplF.mjs → cursor-B95LzVWV.mjs} +11 -3
- package/lib/{cursor-CRpLpaZ3.mjs → cursor-DJV_dcgB.mjs} +887 -1784
- package/lib/{cursor-B8m6SqAH.mjs → cursor-LKGjucn2.mjs} +48 -38
- package/lib/cursor-proto-B8Wj8bv9.mjs +10513 -0
- package/lib/{deterministic-id-D-yIV_eI.mjs → deterministic-id-CUEIMSqR.mjs} +1 -1
- package/lib/devin-BMTdx_hx.mjs +316 -0
- package/lib/{devin-DUAfvBsW.mjs → devin-DSp0Rw_E.mjs} +172 -86
- package/lib/devin-ExGIghmx.mjs +69 -0
- package/lib/devin-proto-Br8fdyNl.mjs +2888 -0
- package/lib/{dom-CawWi8fa.mjs → dom-DG3sPESc.mjs} +8 -8
- package/lib/effort-BdtQMN-_.mjs +23 -0
- package/lib/{error-C-f_Wnw4.mjs → error-CORgGg5a.mjs} +275 -154
- package/lib/{event-stream-Dh2guZxS.mjs → event-stream-ulcDenZD.mjs} +20 -4
- package/lib/{gemini-headers-DKUShltF.mjs → gemini-headers-Co9cVvex.mjs} +2 -2
- package/lib/{github-copilot-suDymKrx.mjs → github-copilot-Dstq1D3s.mjs} +69 -29
- package/lib/github-copilot-headers-DOh1gt_w.mjs +312 -0
- package/lib/gitlab-duo-DSCMrU0m.mjs +11 -0
- package/lib/google-CtsKkOQK.mjs +38 -0
- package/lib/google-antigravity-z-5KsEci.mjs +252 -0
- package/lib/{google-auth-DYJLM792.mjs → google-auth-ieLBaneO.mjs} +4 -4
- package/lib/{google-gemini-cli-8BT513Ul.mjs → google-gemini-cli-C6NE5mWz.mjs} +28 -54
- package/lib/{google-gemini-cli-D6cSmfvB.mjs → google-gemini-cli-CAIPSl7e.mjs} +23 -29
- package/lib/google-oauth-shared-DhMllAkt.mjs +53 -0
- package/lib/{google-shared-CVbHK5vZ.mjs → google-shared-B0aNCYEH.mjs} +140 -44
- package/lib/{google-validation-Cgbn3tWJ.mjs → google-validation-BEkNs-Bx.mjs} +1 -1
- package/lib/{google-vertex-Bui-ypAe.mjs → google-vertex-Bbd1tYNc.mjs} +8 -8
- package/lib/hosts-00rjRzUD.mjs +203 -0
- package/lib/id-AL5obQzR.mjs +71 -0
- package/lib/{idle-iterator-CYAxUkSD.mjs → idle-iterator-DlUkEfzW.mjs} +3 -3
- package/lib/index.mjs +598 -5275
- package/lib/kilo-ChJL54wq.mjs +81 -0
- package/lib/kimi-C2c_Zq8A.mjs +67 -0
- package/lib/{launch-BmgEUycu.mjs → launch-DKDH71En.mjs} +1 -1
- package/lib/markit-CmRfm4E2.mjs +9885 -0
- package/lib/models-DnXMYGcJ.mjs +381604 -0
- package/lib/muse-code-Di1VZmB1.mjs +143 -0
- package/lib/{ollama-Df9ce-Cp.mjs → ollama-B8ic3sEp.mjs} +15 -30
- package/lib/{openai-codex-CAVI3Me-.mjs → openai-codex-DuJNC99x.mjs} +29 -99
- package/lib/{openai-codex-responses-BcnOotRB.mjs → openai-codex-responses-BL29nh9K.mjs} +204 -116
- package/lib/{openai-completions-Bq4WT47M.mjs → openai-completions-BK2f2dBv.mjs} +152 -82
- package/lib/openai-configuration-update-xMYUjaK_.mjs +150 -0
- package/lib/{openai-reasoning-fallback-DXsfiSXO.mjs → openai-reasoning-fallback-BdB3RCbj.mjs} +106 -12
- package/lib/{openai-responses-Mq_-PjvE.mjs → openai-responses-CGQPlIIy.mjs} +76 -82
- package/lib/{perplexity-XgLF73E7.mjs → perplexity-TBjz3VMB.mjs} +52 -9
- package/lib/{pkce-BlQikGPu.mjs → pkce-BYjmugmw.mjs} +1 -1
- package/lib/protobuf-aab1UGVn.mjs +717 -0
- package/lib/{provider-response-C6vcbQyO.mjs → provider-response-SqKSkkUc.mjs} +1 -1
- package/lib/{proxy-D9lm7ONA.mjs → proxy-5nWqRL1f.mjs} +45 -5
- package/lib/{readability-Cpm-ocau.mjs → readability-uGhqb4GC.mjs} +2 -2
- package/lib/reference-CtvM4zLU.mjs +114 -0
- package/lib/{request-debug-HJMoJncL.mjs → request-debug-NQN0BjHH.mjs} +1 -1
- package/lib/{sanitize-text-CfcXzw5X.mjs → sanitize-text-BCf5KmCf.mjs} +1 -1
- package/lib/{scrapers-Cg5w77td.mjs → scrapers-BpqEnqNM.mjs} +12 -12
- package/lib/{src-BcD0_rQR.mjs → src-BwW51vA5.mjs} +979 -388
- package/lib/{sse-debug-CYdjOC96.mjs → sse-debug-B-tkLCPW.mjs} +1 -1
- package/lib/{stream-Bjq8wjfr.mjs → stream-B_7qN-bA.mjs} +3802 -2623
- package/lib/stream-markup-healing-DKT1lnkW.mjs +267 -0
- package/lib/{strict-tool-validation-imVLUcbI.mjs → strict-tool-validation-CBTz1dAA.mjs} +2 -2
- package/lib/taxonomy-DSIM99rS.mjs +15392 -0
- package/lib/{stream-markup-healing-DZ6bVDxH.mjs → thinking-CiLa2LFB.mjs} +31 -186
- package/lib/{turndown-DN7ByzEI.mjs → turndown-DrX1M4WG.mjs} +4 -4
- package/lib/{type-guards-B9VVjRDK.mjs → type-guards-CttAANEx.mjs} +1 -1
- package/lib/types/client/BashPlusCard.d.ts +53 -0
- package/lib/types/client/ToolPlusSection.d.ts +36 -0
- package/lib/types/client/forms.d.ts +42 -0
- package/lib/types/client/index.d.ts +29 -0
- package/lib/types/client/locales.d.ts +19 -0
- package/lib/types/client/rm-safe-status-text.d.ts +15 -0
- package/lib/types/client/rows.d.ts +107 -0
- package/lib/types/client/web-connection-rpc.d.ts +22 -0
- package/lib/types/config/fields.d.ts +85 -0
- package/lib/types/config/omp-settings.d.ts +21 -0
- package/lib/types/config/settings.d.ts +212 -0
- package/lib/types/config/truncate.d.ts +27 -0
- package/lib/types/host/browser-probe-rpc.d.ts +29 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/tools/ast-edit/adapter/index.d.ts +26 -0
- package/lib/types/tools/ast-edit/adapter/sdk.d.ts +49 -0
- package/lib/types/tools/ast-grep/adapter/index.d.ts +31 -0
- package/lib/types/tools/ast-grep/adapter/sdk.d.ts +44 -0
- package/lib/types/tools/bash/adapter/spill.d.ts +34 -0
- package/lib/types/tools/bash/background.d.ts +40 -0
- package/lib/types/tools/bash/bash-executor.d.ts +102 -0
- package/lib/types/tools/bash/bash-interceptor.d.ts +33 -0
- package/lib/types/tools/bash/cd-workdir.d.ts +35 -0
- package/lib/types/tools/bash/logger.d.ts +18 -0
- package/lib/types/tools/bash/non-interactive-env.d.ts +5 -0
- package/lib/types/tools/bash/render.d.ts +46 -0
- package/lib/types/tools/bash/rm-safe-status.d.ts +62 -0
- package/lib/types/tools/bash/rm-safe.d.ts +18 -0
- package/lib/types/tools/bash/sanitize-text.d.ts +34 -0
- package/lib/types/tools/bash/shell-snapshot.d.ts +31 -0
- package/lib/types/tools/bash/shell-tokenize.d.ts +60 -0
- package/lib/types/tools/bash/streaming-output.d.ts +32 -0
- package/lib/types/tools/bash/trash-cli-main.d.ts +1 -0
- package/lib/types/tools/bash/trash-cli.d.ts +77 -0
- package/lib/types/tools/bash/types.d.ts +107 -0
- package/lib/types/tools/bash/which.d.ts +20 -0
- package/lib/types/tools/bash/windows-shell.d.ts +31 -0
- package/lib/types/tools/bash/yield.d.ts +71 -0
- package/lib/types/tools/edit/adapter/index.d.ts +57 -0
- package/lib/types/tools/edit/adapter/tools/auto-generated-guard.d.ts +10 -0
- package/lib/types/tools/edit/adapter/tools/output-meta.d.ts +34 -0
- package/lib/types/tools/edit/adapter/tools/plan-mode-guard.d.ts +21 -0
- package/lib/types/tools/glob/adapter/index.d.ts +52 -0
- package/lib/types/tools/grep/adapter/index.d.ts +53 -0
- package/lib/types/tools/grep/adapter/match-path.d.ts +1 -0
- package/lib/types/tools/hashline/native/diff-preview.d.ts +37 -0
- package/lib/types/tools/hashline/native/index.d.ts +109 -0
- package/lib/types/tools/hashline/native/normalize.d.ts +29 -0
- package/lib/types/tools/hashline/native/policy.d.ts +98 -0
- package/lib/types/tools/hashline/native/writer.d.ts +42 -0
- package/lib/types/tools/omp/browser/launch.d.ts +28 -0
- package/lib/types/tools/omp/browser/readable.d.ts +17 -0
- package/lib/types/tools/omp/config/settings-schema.d.ts +12 -0
- package/lib/types/tools/omp/config/settings.d.ts +59 -0
- package/lib/types/tools/omp/edit/apply-patch/parser.d.ts +34 -0
- package/lib/types/tools/omp/edit/details.d.ts +54 -0
- package/lib/types/tools/omp/edit/diff.d.ts +60 -0
- package/lib/types/tools/omp/edit/dispatch.d.ts +43 -0
- package/lib/types/tools/omp/edit/file-snapshot-store.d.ts +81 -0
- package/lib/types/tools/omp/edit/hashline/execute.d.ts +40 -0
- package/lib/types/tools/omp/edit/hashline/params.d.ts +6 -0
- package/lib/types/tools/omp/edit/modes/apply-patch.d.ts +25 -0
- package/lib/types/tools/omp/edit/modes/patch.d.ts +109 -0
- package/lib/types/tools/omp/edit/modes/replace.d.ts +151 -0
- package/lib/types/tools/omp/edit/normalize.d.ts +31 -0
- package/lib/types/tools/omp/edit/notebook.d.ts +50 -0
- package/lib/types/tools/omp/edit/read-file.d.ts +2 -0
- package/lib/types/tools/omp/edit/snapshot-details.d.ts +33 -0
- package/lib/types/tools/omp/extensibility/skills.d.ts +22 -0
- package/lib/types/tools/omp/internal-urls/index.d.ts +100 -0
- package/lib/types/tools/omp/internal-urls/local-protocol.d.ts +12 -0
- package/lib/types/tools/omp/internal-urls/parse.d.ts +31 -0
- package/lib/types/tools/omp/internal-urls/types.d.ts +189 -0
- package/lib/types/tools/omp/internal-urls/xd-protocol.d.ts +19 -0
- package/lib/types/tools/omp/markit/converters/docx.d.ts +6 -0
- package/lib/types/tools/omp/markit/converters/epub.d.ts +15 -0
- package/lib/types/tools/omp/markit/converters/pdf/index.d.ts +7 -0
- package/lib/types/tools/omp/markit/converters/pptx.d.ts +57 -0
- package/lib/types/tools/omp/markit/converters/xlsx.d.ts +25 -0
- package/lib/types/tools/omp/markit/index.d.ts +2 -0
- package/lib/types/tools/omp/markit/registry.d.ts +16 -0
- package/lib/types/tools/omp/markit/types.d.ts +30 -0
- package/lib/types/tools/omp/sdk.d.ts +103 -0
- package/lib/types/tools/omp/session/agent-storage.d.ts +154 -0
- package/lib/types/tools/omp/session/streaming-output.d.ts +244 -0
- package/lib/types/tools/omp/task/spawn-policy.d.ts +22 -0
- package/lib/types/tools/omp/tools/approval.d.ts +62 -0
- package/lib/types/tools/omp/tools/ast-edit.d.ts +73 -0
- package/lib/types/tools/omp/tools/ast-grep.d.ts +61 -0
- package/lib/types/tools/omp/tools/auto-generated-guard.d.ts +20 -0
- package/lib/types/tools/omp/tools/conflict-detect.d.ts +237 -0
- package/lib/types/tools/omp/tools/fetch.d.ts +103 -0
- package/lib/types/tools/omp/tools/file-recorder.d.ts +13 -0
- package/lib/types/tools/omp/tools/fs-cache-invalidation.d.ts +15 -0
- package/lib/types/tools/omp/tools/glob.d.ts +86 -0
- package/lib/types/tools/omp/tools/grep.d.ts +102 -0
- package/lib/types/tools/omp/tools/grouped-file-output.d.ts +70 -0
- package/lib/types/tools/omp/tools/index.d.ts +23 -0
- package/lib/types/tools/omp/tools/list-limit.d.ts +12 -0
- package/lib/types/tools/omp/tools/match-line-format.d.ts +11 -0
- package/lib/types/tools/omp/tools/output-meta.d.ts +160 -0
- package/lib/types/tools/omp/tools/path-utils.d.ts +326 -0
- package/lib/types/tools/omp/tools/plan-mode-guard.d.ts +33 -0
- package/lib/types/tools/omp/tools/read-archive.d.ts +16 -0
- package/lib/types/tools/omp/tools/read-format.d.ts +104 -0
- package/lib/types/tools/omp/tools/read-path-resolution.d.ts +19 -0
- package/lib/types/tools/omp/tools/read-selector.d.ts +27 -0
- package/lib/types/tools/omp/tools/read-sqlite.d.ts +16 -0
- package/lib/types/tools/omp/tools/read-summary.d.ts +15 -0
- package/lib/types/tools/omp/tools/read.d.ts +70 -0
- package/lib/types/tools/omp/tools/render-utils.d.ts +28 -0
- package/lib/types/tools/omp/tools/report-tool-issue.d.ts +149 -0
- package/lib/types/tools/omp/tools/resolve.d.ts +127 -0
- package/lib/types/tools/omp/tools/sqlite-reader.d.ts +114 -0
- package/lib/types/tools/omp/tools/tool-errors.d.ts +33 -0
- package/lib/types/tools/omp/tools/tool-result.d.ts +33 -0
- package/lib/types/tools/omp/tools/tool-timeouts.d.ts +57 -0
- package/lib/types/tools/omp/tools/write.d.ts +53 -0
- package/lib/types/tools/omp/tools/writethrough.d.ts +24 -0
- package/lib/types/tools/omp/utils/block-context.d.ts +35 -0
- package/lib/types/tools/omp/utils/cpuprofile.d.ts +51 -0
- package/lib/types/tools/omp/utils/edit-mode.d.ts +13 -0
- package/lib/types/tools/omp/utils/file-display-mode.d.ts +27 -0
- package/lib/types/tools/omp/utils/image-loading.d.ts +51 -0
- package/lib/types/tools/omp/utils/image-resize.d.ts +42 -0
- package/lib/types/tools/omp/utils/lang-from-path.d.ts +9 -0
- package/lib/types/tools/omp/utils/markit-cache.d.ts +23 -0
- package/lib/types/tools/omp/utils/markit.d.ts +30 -0
- package/lib/types/tools/omp/utils/profile-tree.d.ts +47 -0
- package/lib/types/tools/omp/utils/sample-profile.d.ts +67 -0
- package/lib/types/tools/omp/utils/sixel.d.ts +21 -0
- package/lib/types/tools/omp/utils/tools-manager.d.ts +11 -0
- package/lib/types/tools/omp/utils/turndown.d.ts +15 -0
- package/lib/types/tools/omp/utils/zip.d.ts +129 -0
- package/lib/types/tools/omp/web/browser-render.d.ts +50 -0
- package/lib/types/tools/omp/web/parallel.d.ts +68 -0
- package/lib/types/tools/omp/web/scrapers/artifacthub.d.ts +6 -0
- package/lib/types/tools/omp/web/scrapers/arxiv.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/aur.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/biorxiv.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/bluesky.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/brew.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/cheatsh.d.ts +8 -0
- package/lib/types/tools/omp/web/scrapers/chocolatey.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/choosealicense.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/cisa-kev.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/clojars.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/coingecko.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/crates-io.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/crossref.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/devto.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/discogs.d.ts +8 -0
- package/lib/types/tools/omp/web/scrapers/discourse.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/dockerhub.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/docs-rs.d.ts +9 -0
- package/lib/types/tools/omp/web/scrapers/fdroid.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/firefox-addons.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/flathub.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/github-gist.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/github.d.ts +34 -0
- package/lib/types/tools/omp/web/scrapers/gitlab.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/go-pkg.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/hackage.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/hackernews.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/hex.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/huggingface.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/iacr.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/index.d.ts +84 -0
- package/lib/types/tools/omp/web/scrapers/jetbrains-marketplace.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/lemmy.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/lobsters.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/mastodon.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/maven.d.ts +6 -0
- package/lib/types/tools/omp/web/scrapers/mdn.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/metacpan.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/musicbrainz.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/npm.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/nuget.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/nvd.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/ollama.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/open-vsx.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/opencorporates.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/openlibrary.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/orcid.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/osv.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/packagist.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/pub-dev.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/pubmed.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/pypi.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/rawg.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/readthedocs.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/reddit.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/repology.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/rfc.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/rubygems.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/searchcode.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/sec-edgar.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/semantic-scholar.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/snapcraft.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/sourcegraph.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/spdx.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/spotify.d.ts +8 -0
- package/lib/types/tools/omp/web/scrapers/stackoverflow.d.ts +6 -0
- package/lib/types/tools/omp/web/scrapers/terraform.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/tldr.d.ts +7 -0
- package/lib/types/tools/omp/web/scrapers/twitter.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/types.d.ts +90 -0
- package/lib/types/tools/omp/web/scrapers/utils.d.ts +26 -0
- package/lib/types/tools/omp/web/scrapers/vimeo.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/vscode-marketplace.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/w3c.d.ts +2 -0
- package/lib/types/tools/omp/web/scrapers/wikidata.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/wikipedia.d.ts +5 -0
- package/lib/types/tools/omp/web/scrapers/youtube.d.ts +5 -0
- package/lib/types/tools/omp/web/search/providers/utils.d.ts +49 -0
- package/lib/types/tools/omp/web/search/types.d.ts +501 -0
- package/lib/types/tools/omp/web/search/utils.d.ts +4 -0
- package/lib/types/tools/omp/workspace-tree.d.ts +42 -0
- package/lib/types/tools/read/adapter/index.d.ts +49 -0
- package/lib/types/tools/read/adapter/internal-urls/artifact-protocol.d.ts +15 -0
- package/lib/types/tools/read/adapter/internal-urls/registry-helpers.d.ts +44 -0
- package/lib/types/tools/read/adapter/registry/agent-registry.d.ts +29 -0
- package/lib/types/tools/shared/auto-generated-guard.dsh.d.ts +16 -0
- package/lib/types/tools/shared/browser-detect.d.ts +54 -0
- package/lib/types/tools/shared/browser-rpc-channel.d.ts +40 -0
- package/lib/types/tools/shared/bun-ffi-shim.d.ts +13 -0
- package/lib/types/tools/shared/bun-named-shim.d.ts +42 -0
- package/lib/types/tools/shared/bun-shim.d.ts +138 -0
- package/lib/types/tools/shared/bun-sqlite-shim.d.ts +49 -0
- package/lib/types/tools/shared/fs-promises-shim.d.ts +15 -0
- package/lib/types/tools/shared/image-bridge.d.ts +98 -0
- package/lib/types/tools/shared/omp-prompt.d.ts +47 -0
- package/lib/types/tools/shared/sandbox-policy.d.ts +38 -0
- package/lib/types/tools/shared/session-state.d.ts +51 -0
- package/lib/types/tools/shared/tool-errors.d.ts +33 -0
- package/lib/types/tools/shared/win-path-fixes.d.ts +16 -0
- package/lib/types/tools/write/adapter/index.d.ts +31 -0
- package/lib/{types-DX_bvuus.mjs → types-PVueGi9S.mjs} +2 -2
- package/lib/{utils-C-dSORPa.mjs → utils-B7A3Eu4L.mjs} +2364 -2676
- package/lib/{utils-Cp2Mxf_U.mjs → utils-CUPhpw9A.mjs} +413 -134
- package/lib/{utils-CQHPEQ3W.mjs → utils-DeWqNWV8.mjs} +2 -2
- package/lib/{vision-guard-mBmtAHx0.mjs → vision-guard-_XwsL1DF.mjs} +14 -29
- package/lib/xai-oauth-CXhnz0gO.mjs +210 -0
- package/lib/{xiaomi-7mE345KX.mjs → xiaomi-psoUItal.mjs} +8 -37
- package/lib/{zai-CeNpMV3W.mjs → zai-ApJ8HBgT.mjs} +8 -71
- package/lib/{zip-BK7UHCwX.mjs → zip-Kd602XNe.mjs} +1 -1
- package/package.json +12 -12
- package/presets/package.json +1 -1
- package/presets/tool-plus-ptc/agent.cordis.yml +1 -1
- package/presets/tool-plus-standard/agent.cordis.yml +1 -1
- package/scripts/patch-pi-natives.mjs +108 -108
- package/lib/agent_pb-Rizyt9Zg.mjs +0 -805
- package/lib/anthropic-CDmj476p.mjs +0 -262
- package/lib/api_server_pb-CDZgLMta.mjs +0 -252
- package/lib/callback-server-CFJK-jvK.mjs +0 -398
- package/lib/codex-P1dGpX7G.mjs +0 -54
- package/lib/device-code-CuXTWYwY.mjs +0 -51
- package/lib/devin-BcQwht1W.mjs +0 -114
- package/lib/devin-BvMfGevz.mjs +0 -95
- package/lib/github-copilot-B3kQl0g0.mjs +0 -104
- package/lib/gitlab-duo-BriUTP8k.mjs +0 -155
- package/lib/gitlab-duo-workflow-wK5Ljzmc.mjs +0 -91
- package/lib/google-CE5tFDod.mjs +0 -30
- package/lib/google-antigravity-C1jgNljz.mjs +0 -198
- package/lib/google-oauth-shared-BLVTvokk.mjs +0 -147
- package/lib/grammar-D-NqNUxQ.mjs +0 -49
- package/lib/identity-HNO1Oe9B.mjs +0 -219
- package/lib/kimi-DgcUpPtK.mjs +0 -236
- package/lib/markit-DtGoRE6M.mjs +0 -1417
- package/lib/minimax-code-Y3h5li9N.mjs +0 -53
- package/lib/models-DRA2c_8U.mjs +0 -104660
- package/lib/opencode-BsVw9rCD.mjs +0 -38
- package/lib/to-binary-B1BEBIPC.mjs +0 -6002
- package/lib/wafer-BlhWLweO.mjs +0 -17
- package/lib/xai-oauth-5pORHUrg.mjs +0 -446
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patch application logic for the edit tool.
|
|
3
|
+
*
|
|
4
|
+
* Applies parsed diff hunks to file content using fuzzy matching
|
|
5
|
+
* for robust handling of whitespace and formatting differences.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
+
import { type WritethroughCallback } from "../../../omp/tools/writethrough.ts";
|
|
9
|
+
import type { ToolSession } from "../../../omp/tools/index.ts";
|
|
10
|
+
import type { EditToolDetails, Operation } from "../details";
|
|
11
|
+
export interface PatchInput {
|
|
12
|
+
path: string;
|
|
13
|
+
op: Operation;
|
|
14
|
+
rename?: string;
|
|
15
|
+
diff?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FileSystem {
|
|
18
|
+
exists(path: string): Promise<boolean>;
|
|
19
|
+
read(path: string): Promise<string>;
|
|
20
|
+
readBinary?: (path: string) => Promise<Uint8Array>;
|
|
21
|
+
write(path: string, content: string): Promise<void>;
|
|
22
|
+
delete(path: string): Promise<void>;
|
|
23
|
+
mkdir(path: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
interface FileChange {
|
|
26
|
+
type: Operation;
|
|
27
|
+
path: string;
|
|
28
|
+
newPath?: string;
|
|
29
|
+
oldContent?: string;
|
|
30
|
+
newContent?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ApplyPatchResult {
|
|
33
|
+
change: FileChange;
|
|
34
|
+
warnings?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface ApplyPatchOptions {
|
|
37
|
+
cwd: string;
|
|
38
|
+
dryRun?: boolean;
|
|
39
|
+
fuzzyThreshold?: number;
|
|
40
|
+
allowFuzzy?: boolean;
|
|
41
|
+
fs?: FileSystem;
|
|
42
|
+
/**
|
|
43
|
+
* Permit `op: "create"` to replace an existing file (full-file overwrite).
|
|
44
|
+
* The JSON `patch` edit mode sanctions create-as-overwrite for major
|
|
45
|
+
* restructures (see prompts/tools/patch.md); the Codex `apply_patch`
|
|
46
|
+
* envelope documents `*** Add File` as strictly non-overwriting and must
|
|
47
|
+
* leave this unset.
|
|
48
|
+
*/
|
|
49
|
+
allowCreateOverwrite?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** Default filesystem implementation using Bun APIs */
|
|
52
|
+
export declare const defaultFileSystem: FileSystem;
|
|
53
|
+
/**
|
|
54
|
+
* Apply a patch operation to the filesystem.
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyPatch(input: PatchInput, options: ApplyPatchOptions): Promise<ApplyPatchResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Preview what changes a patch would make without applying it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function previewPatch(input: PatchInput, options: ApplyPatchOptions): Promise<ApplyPatchResult>;
|
|
61
|
+
export declare function computePatchDiff(input: PatchInput, cwd: string, options?: {
|
|
62
|
+
fuzzyThreshold?: number;
|
|
63
|
+
allowFuzzy?: boolean;
|
|
64
|
+
allowCreateOverwrite?: boolean;
|
|
65
|
+
}): Promise<{
|
|
66
|
+
diff: string;
|
|
67
|
+
firstChangedLine: number | undefined;
|
|
68
|
+
} | {
|
|
69
|
+
error: string;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const patchEditEntrySchema: import("@oh-my-pi/omptype").FluentType<{
|
|
72
|
+
op?: "delete" | "create" | "update" | undefined;
|
|
73
|
+
rename?: string | undefined;
|
|
74
|
+
diff?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
op?: "delete" | "create" | "update" | undefined;
|
|
77
|
+
rename?: string | undefined;
|
|
78
|
+
diff?: string | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
export type PatchEditEntry = typeof patchEditEntrySchema.infer;
|
|
81
|
+
export declare const patchEditSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
82
|
+
path: string;
|
|
83
|
+
edits: {
|
|
84
|
+
op?: "delete" | "create" | "update" | undefined;
|
|
85
|
+
rename?: string | undefined;
|
|
86
|
+
diff?: string | undefined;
|
|
87
|
+
}[];
|
|
88
|
+
}, {
|
|
89
|
+
path: string;
|
|
90
|
+
edits: {
|
|
91
|
+
op?: "delete" | "create" | "update" | undefined;
|
|
92
|
+
rename?: string | undefined;
|
|
93
|
+
diff?: string | undefined;
|
|
94
|
+
}[];
|
|
95
|
+
}>;
|
|
96
|
+
export type PatchParams = typeof patchEditSchema.infer;
|
|
97
|
+
export interface ExecutePatchSingleOptions {
|
|
98
|
+
session: ToolSession;
|
|
99
|
+
path: string;
|
|
100
|
+
params: PatchEditEntry;
|
|
101
|
+
signal?: AbortSignal;
|
|
102
|
+
allowFuzzy: boolean;
|
|
103
|
+
fuzzyThreshold: number;
|
|
104
|
+
/** See {@link ApplyPatchOptions.allowCreateOverwrite}; set by the JSON `patch` mode only. */
|
|
105
|
+
allowCreateOverwrite?: boolean;
|
|
106
|
+
writethrough: WritethroughCallback;
|
|
107
|
+
}
|
|
108
|
+
export declare function executePatchSingle(options: ExecutePatchSingleOptions): Promise<AgentToolResult<EditToolDetails, typeof patchEditEntrySchema>>;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fuzzy matching utilities for the edit tool.
|
|
3
|
+
*
|
|
4
|
+
* Provides both character-level and line-level fuzzy matching with progressive
|
|
5
|
+
* fallback strategies for finding text in files.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
8
|
+
import type { WritethroughCallback } from "../../../omp/tools/writethrough.ts";
|
|
9
|
+
import type { ToolSession } from "../../../omp/tools/index.ts";
|
|
10
|
+
import type { EditToolDetails } from "../details";
|
|
11
|
+
export interface FuzzyMatch {
|
|
12
|
+
actualText: string;
|
|
13
|
+
startIndex: number;
|
|
14
|
+
startLine: number;
|
|
15
|
+
confidence: number;
|
|
16
|
+
}
|
|
17
|
+
export interface MatchOutcome {
|
|
18
|
+
match?: FuzzyMatch;
|
|
19
|
+
closest?: FuzzyMatch;
|
|
20
|
+
occurrences?: number;
|
|
21
|
+
occurrenceLines?: number[];
|
|
22
|
+
occurrencePreviews?: string[];
|
|
23
|
+
fuzzyMatches?: number;
|
|
24
|
+
dominantFuzzy?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type SequenceMatchStrategy = "exact" | "trim-trailing" | "trim" | "comment-prefix" | "unicode" | "prefix" | "substring" | "fuzzy" | "fuzzy-dominant" | "character";
|
|
27
|
+
export interface SequenceSearchResult {
|
|
28
|
+
index: number | undefined;
|
|
29
|
+
confidence: number;
|
|
30
|
+
matchCount?: number;
|
|
31
|
+
matchIndices?: number[];
|
|
32
|
+
strategy?: SequenceMatchStrategy;
|
|
33
|
+
}
|
|
34
|
+
export type ContextMatchStrategy = "exact" | "trim" | "unicode" | "prefix" | "substring" | "fuzzy";
|
|
35
|
+
export interface ContextLineResult {
|
|
36
|
+
index: number | undefined;
|
|
37
|
+
confidence: number;
|
|
38
|
+
matchCount?: number;
|
|
39
|
+
matchIndices?: number[];
|
|
40
|
+
strategy?: ContextMatchStrategy;
|
|
41
|
+
}
|
|
42
|
+
export declare class EditMatchError extends Error {
|
|
43
|
+
readonly path: string;
|
|
44
|
+
readonly searchText: string;
|
|
45
|
+
readonly closest: FuzzyMatch | undefined;
|
|
46
|
+
readonly options: {
|
|
47
|
+
allowFuzzy: boolean;
|
|
48
|
+
threshold: number;
|
|
49
|
+
fuzzyMatches?: number;
|
|
50
|
+
};
|
|
51
|
+
constructor(path: string, searchText: string, closest: FuzzyMatch | undefined, options: {
|
|
52
|
+
allowFuzzy: boolean;
|
|
53
|
+
threshold: number;
|
|
54
|
+
fuzzyMatches?: number;
|
|
55
|
+
});
|
|
56
|
+
static formatMessage(path: string, searchText: string, closest: FuzzyMatch | undefined, options: {
|
|
57
|
+
allowFuzzy: boolean;
|
|
58
|
+
threshold: number;
|
|
59
|
+
fuzzyMatches?: number;
|
|
60
|
+
}): string;
|
|
61
|
+
}
|
|
62
|
+
/** Default similarity threshold for fuzzy matching */
|
|
63
|
+
export declare const DEFAULT_FUZZY_THRESHOLD = 0.95;
|
|
64
|
+
/** Compute Levenshtein distance between two strings */
|
|
65
|
+
export declare function levenshteinDistance(a: string, b: string): number;
|
|
66
|
+
/** Compute similarity score between two strings (0 to 1) */
|
|
67
|
+
export declare function similarity(a: string, b: string): number;
|
|
68
|
+
/**
|
|
69
|
+
* Find a match for target text within content.
|
|
70
|
+
* Used primarily for replace-mode edits; excluded ranges remain invisible to exact and fuzzy matching.
|
|
71
|
+
*/
|
|
72
|
+
export declare function findMatch(content: string, target: string, options: {
|
|
73
|
+
allowFuzzy: boolean;
|
|
74
|
+
threshold?: number;
|
|
75
|
+
excludedRanges?: readonly {
|
|
76
|
+
startIndex: number;
|
|
77
|
+
endIndex: number;
|
|
78
|
+
}[];
|
|
79
|
+
}): MatchOutcome;
|
|
80
|
+
/**
|
|
81
|
+
* Find a sequence of pattern lines within content lines.
|
|
82
|
+
*
|
|
83
|
+
* Attempts matches with decreasing strictness:
|
|
84
|
+
* 1. Exact match
|
|
85
|
+
* 2. Trailing whitespace ignored
|
|
86
|
+
* 3. All whitespace trimmed
|
|
87
|
+
* 4. Unicode punctuation normalized
|
|
88
|
+
* 5. Prefix match (pattern is prefix of line)
|
|
89
|
+
* 6. Substring match (pattern is substring of line)
|
|
90
|
+
* 7. Fuzzy similarity match
|
|
91
|
+
*
|
|
92
|
+
* @param lines - The lines of the file content
|
|
93
|
+
* @param pattern - The lines to search for
|
|
94
|
+
* @param start - Starting index for the search
|
|
95
|
+
* @param eof - If true, prefer matching at end of file first
|
|
96
|
+
*/
|
|
97
|
+
export declare function seekSequence(lines: string[], pattern: string[], start: number, eof: boolean, options?: {
|
|
98
|
+
allowFuzzy?: boolean;
|
|
99
|
+
}): SequenceSearchResult;
|
|
100
|
+
export declare function findClosestSequenceMatch(lines: string[], pattern: string[], options?: {
|
|
101
|
+
start?: number;
|
|
102
|
+
eof?: boolean;
|
|
103
|
+
}): {
|
|
104
|
+
index: number | undefined;
|
|
105
|
+
confidence: number;
|
|
106
|
+
strategy: SequenceMatchStrategy;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Find a context line in the file using progressive matching strategies.
|
|
110
|
+
*
|
|
111
|
+
* @param lines - The lines of the file content
|
|
112
|
+
* @param context - The context line to search for
|
|
113
|
+
* @param startFrom - Starting index for the search
|
|
114
|
+
*/
|
|
115
|
+
export declare function findContextLine(lines: string[], context: string, startFrom: number, options?: {
|
|
116
|
+
allowFuzzy?: boolean;
|
|
117
|
+
skipFunctionFallback?: boolean;
|
|
118
|
+
}): ContextLineResult;
|
|
119
|
+
export declare const replaceEditSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
120
|
+
path: string;
|
|
121
|
+
old_string: string;
|
|
122
|
+
new_string: string;
|
|
123
|
+
replace_all?: boolean | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
path: string;
|
|
126
|
+
old_string: string;
|
|
127
|
+
new_string: string;
|
|
128
|
+
replace_all?: boolean | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
export type ReplaceParams = typeof replaceEditSchema.infer;
|
|
131
|
+
/**
|
|
132
|
+
* Internal batch form of {@link ReplaceParams}, produced only by the Cursor
|
|
133
|
+
* exec bridge: a `pi_edit` frame carries several replacements against one
|
|
134
|
+
* path but must run as a single tool lifecycle with one aggregate result.
|
|
135
|
+
* Never advertised to the model — the agent loop validates model calls
|
|
136
|
+
* against {@link replaceEditSchema}, which has no `edits` field.
|
|
137
|
+
*/
|
|
138
|
+
export interface ReplaceBatchParams {
|
|
139
|
+
path: string;
|
|
140
|
+
edits: Omit<ReplaceParams, "path">[];
|
|
141
|
+
}
|
|
142
|
+
export interface ExecuteReplaceOptions {
|
|
143
|
+
session: ToolSession;
|
|
144
|
+
path: string;
|
|
145
|
+
params: Omit<ReplaceParams, "path">;
|
|
146
|
+
signal?: AbortSignal;
|
|
147
|
+
allowFuzzy: boolean;
|
|
148
|
+
fuzzyThreshold: number;
|
|
149
|
+
writethrough: WritethroughCallback;
|
|
150
|
+
}
|
|
151
|
+
export declare function executeReplace(options: ExecuteReplaceOptions): Promise<AgentToolResult<EditToolDetails, ReplaceParams>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text normalization utilities for the edit tool.
|
|
3
|
+
*
|
|
4
|
+
* Whitespace, Unicode, and indentation helpers. Line-ending and BOM
|
|
5
|
+
* primitives live in `@oh-my-pi/hashline` and are re-exported here so
|
|
6
|
+
* existing consumers see one stable surface.
|
|
7
|
+
*/
|
|
8
|
+
export { type BomResult, detectLineEnding, type LineEnding, normalizeToLF, restoreLineEndings, stripBom, } from "@oh-my-pi/hashline";
|
|
9
|
+
/** Count leading whitespace characters in a line */
|
|
10
|
+
export declare function countLeadingWhitespace(line: string): number;
|
|
11
|
+
/** Get the leading whitespace string from a line */
|
|
12
|
+
export declare function getLeadingWhitespace(line: string): string;
|
|
13
|
+
/** Compute minimum indentation of non-empty lines */
|
|
14
|
+
export declare function minIndent(text: string): number;
|
|
15
|
+
/** Detect the indentation character used in text (space or tab) */
|
|
16
|
+
export declare function detectIndentChar(text: string): string;
|
|
17
|
+
export declare function convertLeadingTabsToSpaces(text: string, spacesPerTab: number): string;
|
|
18
|
+
export declare function normalizeUnicode(s: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Normalize a line for fuzzy comparison.
|
|
21
|
+
* Trims, collapses whitespace, and normalizes punctuation.
|
|
22
|
+
*/
|
|
23
|
+
export declare function normalizeForFuzzy(line: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Adjust newText indentation to match the indentation delta between
|
|
26
|
+
* what was provided (oldText) and what was actually matched (actualText).
|
|
27
|
+
*
|
|
28
|
+
* If oldText has 0 indent but actualText has 12 spaces, we add 12 spaces
|
|
29
|
+
* to each line in newText.
|
|
30
|
+
*/
|
|
31
|
+
export declare function adjustIndentation(oldText: string, actualText: string, newText: string): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type NotebookCellType = "code" | "markdown" | "raw";
|
|
2
|
+
export interface NotebookCell {
|
|
3
|
+
cell_type: NotebookCellType;
|
|
4
|
+
source?: string | string[];
|
|
5
|
+
metadata?: Record<string, unknown>;
|
|
6
|
+
execution_count?: number | null;
|
|
7
|
+
outputs?: unknown[];
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface NotebookDocument {
|
|
11
|
+
cells: NotebookCell[];
|
|
12
|
+
metadata: Record<string, unknown>;
|
|
13
|
+
nbformat: number;
|
|
14
|
+
nbformat_minor: number;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare function isNotebookPath(filePath: string): boolean;
|
|
18
|
+
export declare function splitNotebookSource(content: string): string[];
|
|
19
|
+
export declare function readNotebookDocument(absolutePath: string, displayPath: string): Promise<NotebookDocument>;
|
|
20
|
+
export declare function applyNotebookEditableText(notebook: NotebookDocument, text: string, displayPath: string): NotebookDocument;
|
|
21
|
+
/**
|
|
22
|
+
* Decode a notebook for display and for hashline anchoring.
|
|
23
|
+
*
|
|
24
|
+
* The decode is the **engine's own codec** — `pi-natives`
|
|
25
|
+
* `notebookToEditableText`, the same call upstream's read tool makes
|
|
26
|
+
* (`refs/oh-my-pi/packages/coding-agent/src/tools/read.ts:1599`) — not a
|
|
27
|
+
* second TS implementation. That matters beyond tidiness: `read` mints the
|
|
28
|
+
* hashline tag over this projection and the edit engine validates the live
|
|
29
|
+
* file by projecting it the same way (`crates/pi-edit/src/files.rs:138-142`),
|
|
30
|
+
* so once both sides run the same code their agreement is structural. A
|
|
31
|
+
* hand-maintained copy can only *resemble* the engine, and the first
|
|
32
|
+
* divergence (BOM handling, cell escaping, cell join) silently turns every
|
|
33
|
+
* edit into "file changed between read and edit".
|
|
34
|
+
*
|
|
35
|
+
* Error text is identical to the previous TS decoder, verified over the whole
|
|
36
|
+
* corpus including BOM and every failure shape: the Rust `NotebookError`
|
|
37
|
+
* `Display` strings are verbatim ports. Only ENOENT is ours, because the read
|
|
38
|
+
* has to happen here to keep the `File not found: <display>` message the
|
|
39
|
+
* `read` tool and the patch/replace modes rely on.
|
|
40
|
+
*
|
|
41
|
+
* What stays in this file is the **encode** half (`readNotebookDocument` +
|
|
42
|
+
* `applyNotebookEditableText` + `serializeEditedNotebookText`), which
|
|
43
|
+
* `native/writer.ts` no longer uses — the engine serializes notebooks itself
|
|
44
|
+
* for the hashline path. It survives only because the native surface exposes
|
|
45
|
+
* no encoder and DSH's own patch/replace/write paths still need one; deleting
|
|
46
|
+
* it means migrating those modes onto the Rust engine (the same move this
|
|
47
|
+
* migration made for hashline), which is the remaining half of the work.
|
|
48
|
+
*/
|
|
49
|
+
export declare function readEditableNotebookText(absolutePath: string, displayPath: string): Promise<string>;
|
|
50
|
+
export declare function serializeEditedNotebookText(absolutePath: string, displayPath: string, text: string): Promise<string>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bound the size of the `oldText` / `newText` snapshots that edit-tool results
|
|
3
|
+
* carry in `details`. These fields hold the full pre/post file content; for
|
|
4
|
+
* large files they balloon the per-turn JSONL line and the session file
|
|
5
|
+
* (300 KB+ each on the cases reported in #3786) without paying for any LLM
|
|
6
|
+
* context (provider serializers send only `content`, never `details`).
|
|
7
|
+
*
|
|
8
|
+
* Only consumer of the raw snapshots is the ACP event mapper, which builds a
|
|
9
|
+
* `diff` ToolCallContent for ACP clients (Zed). When the snapshots are pruned
|
|
10
|
+
* the mapper returns `undefined` for that file and the text content still
|
|
11
|
+
* flows — diff visualization degrades gracefully for over-threshold edits.
|
|
12
|
+
*/
|
|
13
|
+
import type { EditToolDetails, EditToolPerFileResult } from "./details";
|
|
14
|
+
/**
|
|
15
|
+
* Combined `oldText` + `newText` character budget for a single edit-tool
|
|
16
|
+
* result. Applies both per-entry (one file at a time) and as an aggregate
|
|
17
|
+
* across `perFileResults` (so a many-small-files batch can't accumulate
|
|
18
|
+
* unbounded snapshot bytes — see #3787 review).
|
|
19
|
+
*
|
|
20
|
+
* Picked so typical code-file edits keep ACP diff visualization while
|
|
21
|
+
* pathological cases (large generated files, full-file rewrites, or
|
|
22
|
+
* many-file batches) drop the raw snapshots before they hit the
|
|
23
|
+
* session JSONL.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MAX_EDIT_SNAPSHOT_TEXT_CHARS = 32768;
|
|
26
|
+
/**
|
|
27
|
+
* Prune oversized `oldText` / `newText` from an edit-tool details payload,
|
|
28
|
+
* recursing into `perFileResults` when present. Per-file overload comes first
|
|
29
|
+
* so the more specific shape (required `path`) wins overload resolution at
|
|
30
|
+
* the per-file call sites.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pruneOversizedEditSnapshots(details: EditToolPerFileResult): EditToolPerFileResult;
|
|
33
|
+
export declare function pruneOversizedEditSnapshots(details: EditToolDetails): EditToolDetails;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH adapter for OMP `extensibility/skills.ts` — the `Skill` type
|
|
3
|
+
* referenced by `tools/path-utils.ts` (skill:// resolution). DSH has no
|
|
4
|
+
* skill:// protocol; the type is provided verbatim so path-utils compiles.
|
|
5
|
+
*/
|
|
6
|
+
export interface Skill {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
filePath: string;
|
|
10
|
+
baseDir: string;
|
|
11
|
+
source: string;
|
|
12
|
+
/** When true, loaded but excluded from rendered <skills> listing. */
|
|
13
|
+
hide?: boolean;
|
|
14
|
+
/** Filesystem-resolved plugin root for Agent Plugin skills. */
|
|
15
|
+
containRoot?: string;
|
|
16
|
+
/** Source metadata for display */
|
|
17
|
+
_source?: {
|
|
18
|
+
provider: string;
|
|
19
|
+
kind?: string;
|
|
20
|
+
category?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH adapter for OMP `internal-urls/` — the internal URL protocol system
|
|
3
|
+
* (agent://, memory://, skill://, local://, …).
|
|
4
|
+
*
|
|
5
|
+
* plan.md 判定:DSH 无 OMP 内部 URL 协议(read/write 不解析这些 scheme),
|
|
6
|
+
* 因此适配层仅提供 `path-utils` 引用的表面:
|
|
7
|
+
* - `LocalProtocolOptions`(verbatim 类型)
|
|
8
|
+
* - `InternalUrlRouter`(空路由:canHandle 恒 false —— DSH 没有可解析的
|
|
9
|
+
* 内部协议;engine 的调用方在 canHandle=false 时走普通路径解析)
|
|
10
|
+
*/
|
|
11
|
+
export interface LocalProtocolOptions {
|
|
12
|
+
getArtifactsDir?: () => string | null;
|
|
13
|
+
getSessionId?: () => string | null;
|
|
14
|
+
}
|
|
15
|
+
/** Raw resource payload shape (verbatim OMP, unused in DSH). */
|
|
16
|
+
export interface InternalResource {
|
|
17
|
+
url: string;
|
|
18
|
+
content: string;
|
|
19
|
+
contentType: 'text/markdown' | 'application/json' | 'text/plain';
|
|
20
|
+
size?: number;
|
|
21
|
+
sourcePath?: string;
|
|
22
|
+
immutable?: boolean;
|
|
23
|
+
/** 目录形态标记(verbatim 引擎在 resolve 后读取;空路由永不产生)。 */
|
|
24
|
+
isDirectory?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Resolve context passed to router handlers (verbatim OMP surface). */
|
|
27
|
+
export interface ResolveContext {
|
|
28
|
+
cwd?: string;
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
localProtocolOptions?: LocalProtocolOptions;
|
|
31
|
+
pathOnly?: boolean;
|
|
32
|
+
settings?: unknown;
|
|
33
|
+
skills?: readonly unknown[];
|
|
34
|
+
/** Session-bound `xd://` documentation resolver. */
|
|
35
|
+
xd?: {
|
|
36
|
+
read: (name: string | null) => Promise<string>;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Write context passed to router write handlers (verbatim OMP surface). */
|
|
40
|
+
export interface WriteContext {
|
|
41
|
+
cwd?: string;
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
localProtocolOptions?: LocalProtocolOptions;
|
|
44
|
+
/** Session-bound `xd://` device dispatcher. */
|
|
45
|
+
xd?: {
|
|
46
|
+
write(name: string | null, content: string): Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Internal URL shape (verbatim OMP minimal surface). */
|
|
50
|
+
export interface InternalUrl {
|
|
51
|
+
scheme: string;
|
|
52
|
+
host: string;
|
|
53
|
+
pathname: string;
|
|
54
|
+
search?: string;
|
|
55
|
+
hash?: string;
|
|
56
|
+
}
|
|
57
|
+
/** Loose URL shape accepted by resolvers (parse.ts's InternalUrl extends URL). */
|
|
58
|
+
type InternalUrlLike = {
|
|
59
|
+
protocol?: string;
|
|
60
|
+
host?: string;
|
|
61
|
+
pathname: string;
|
|
62
|
+
search?: string;
|
|
63
|
+
hash?: string;
|
|
64
|
+
};
|
|
65
|
+
/** Parse an internal URL into its parts (verbatim OMP semantics). */
|
|
66
|
+
export declare function parseInternalUrl(input: string): InternalUrl;
|
|
67
|
+
/** Minimal router: no internal protocol handlers are registered in DSH. */
|
|
68
|
+
export declare class InternalUrlRouter {
|
|
69
|
+
#private;
|
|
70
|
+
static instance(): InternalUrlRouter;
|
|
71
|
+
canHandle(_url: string): boolean;
|
|
72
|
+
canResolve(_input: string): boolean;
|
|
73
|
+
/** Completion is part of the verbatim engine surface(grep.ts);空路由恒无候选。 */
|
|
74
|
+
complete(_scheme: string, _query: string, _context?: ResolveContext): Promise<import('./types.ts').UrlCompletion[] | null>;
|
|
75
|
+
getHandler(_scheme: string): {
|
|
76
|
+
write?: (url: unknown, content: string, context?: unknown) => Promise<void>;
|
|
77
|
+
} | undefined;
|
|
78
|
+
resolve(_url: string, _context?: ResolveContext): Promise<InternalResource>;
|
|
79
|
+
write(_input: string, _content: string, _context?: WriteContext): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
/** DSH: no local:// sandbox — resolve to the raw path. */
|
|
82
|
+
export declare function resolveLocalUrlToPath(input: string | InternalUrlLike, _options?: LocalProtocolOptions, _platform?: NodeJS.Platform): string;
|
|
83
|
+
/** DSH: no memory root registry — empty. */
|
|
84
|
+
export declare function memoryRootsFromRegistry(): string[];
|
|
85
|
+
/** DSH: no memory:// backing — resolve to the raw path. */
|
|
86
|
+
export declare function resolveMemoryUrlToPath(url: InternalUrl, _memoryRoot: string): string;
|
|
87
|
+
/** DSH: no local:// sandbox — static handler with no options. */
|
|
88
|
+
export declare class LocalProtocolHandler {
|
|
89
|
+
static resolveOptions(_context?: ResolveContext): LocalProtocolOptions | undefined;
|
|
90
|
+
}
|
|
91
|
+
/** DSH: no local:// sandbox — the local root is the cwd. */
|
|
92
|
+
export declare function resolveLocalRoot(_options: LocalProtocolOptions, _platform?: NodeJS.Platform): string;
|
|
93
|
+
/** DSH: no vault:// — resolve to the raw path. */
|
|
94
|
+
export declare function resolveVaultUrlToPath(input: string | InternalUrlLike): string;
|
|
95
|
+
/** DSH: no local:// file backing — resolve to nothing (caller falls back to text path). */
|
|
96
|
+
export declare function resolveLocalUrlToFile(_input: string | InternalUrlLike, _context?: ResolveContext): Promise<{
|
|
97
|
+
path: string;
|
|
98
|
+
size: number;
|
|
99
|
+
} | null>;
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH adapter for OMP `internal-urls/local-protocol.ts`.
|
|
3
|
+
*
|
|
4
|
+
* plan.md 判定:DSH 无 local:// 内部协议(internal-urls 空路由
|
|
5
|
+
* canHandle 恒 false),local:// 解析实现整体删除;仅保留 verbatim 的
|
|
6
|
+
* `LocalProtocolOptions` 类型面,供 `internal-urls/types.ts` 与 grep 的
|
|
7
|
+
* verbatim grep.ts 类型引用。
|
|
8
|
+
*/
|
|
9
|
+
export interface LocalProtocolOptions {
|
|
10
|
+
getArtifactsDir?: () => string | null;
|
|
11
|
+
getSessionId?: () => string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal URL parser that handles colons in the host segment.
|
|
3
|
+
*
|
|
4
|
+
* Standard `new URL()` interprets colons as port separators, which breaks
|
|
5
|
+
* namespaced internal URLs like `skill://plugin:name`. This parser extracts
|
|
6
|
+
* components via regex first, then falls back to a minimal URL-like object
|
|
7
|
+
* when `new URL()` fails.
|
|
8
|
+
*
|
|
9
|
+
* All code that parses internal URLs (router, protocol handlers, tools)
|
|
10
|
+
* MUST use this function instead of calling `new URL()` directly.
|
|
11
|
+
*/
|
|
12
|
+
import type { InternalUrl } from "./types";
|
|
13
|
+
/**
|
|
14
|
+
* Extract the lowercased scheme from a URI-shaped input, or `undefined` when
|
|
15
|
+
* the input does not look like a URI.
|
|
16
|
+
*
|
|
17
|
+
* Accepts both hierarchical (`scheme://…`) and opaque (`scheme:rest`) forms —
|
|
18
|
+
* MCP resource URIs may be opaque (`urn:example:document`, `custom:item`).
|
|
19
|
+
* The opaque form is guarded against path-like false positives:
|
|
20
|
+
* - Windows drive paths (`C:\…`, `C:/…`, `C:foo`) — single-letter scheme.
|
|
21
|
+
* - Filenames with extensions (`foo.ts:50`) — dot in the scheme segment.
|
|
22
|
+
* - Read-tool selector tails (`Makefile:12`, `README:raw:1-20`).
|
|
23
|
+
*/
|
|
24
|
+
export declare function extractUriScheme(input: string): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Parse an internal URL into an InternalUrl.
|
|
27
|
+
*
|
|
28
|
+
* Handles URLs where `new URL()` would fail (e.g., `skill://plugin:name`
|
|
29
|
+
* where the colon is not a port separator).
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseInternalUrl(input: string): InternalUrl;
|