@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,98 @@
|
|
|
1
|
+
import type { ToolSession } from "../../omp/sdk.ts";
|
|
2
|
+
import type { EditPolicy } from "./index.ts";
|
|
3
|
+
/** Optional overrides for {@link buildHashlineEditPolicy}. */
|
|
4
|
+
export interface HashlinePolicyOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The payload is a verbatim custom-format string rather than JSON
|
|
7
|
+
* (upstream sets this when the call arrived through the custom-tool wire).
|
|
8
|
+
* DSH never opens an argument stream — it hands `executeHashlineSingle` the
|
|
9
|
+
* parsed `{ input }` arguments — so this stays `false`.
|
|
10
|
+
*/
|
|
11
|
+
rawInput?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Canonicalize `cwd` for the engine policy.
|
|
15
|
+
*
|
|
16
|
+
* The Rust engine canonicalizes the paths it stores (`recordSnapshot`), but it
|
|
17
|
+
* uses `policy.cwd` verbatim for path resolution and for its containment check,
|
|
18
|
+
* and that check compares byte-wise (`path_policy.rs:429-431`). On Windows a
|
|
19
|
+
* workspace under `%TEMP%` reaches JS in 8.3 short form
|
|
20
|
+
* (`C:\Users\XIAOSO~1\...`) while the engine's canonical snapshot key is the
|
|
21
|
+
* long form (`C:\Users\xiaoso456\...`), so an un-normalized `cwd` makes
|
|
22
|
+
* `is_within` fail and tag path recovery silently skip — verified with
|
|
23
|
+
* `D:/tmp/hashline-probes/probe-d3-recovery.mts` (raw cwd →
|
|
24
|
+
* `File not found: a.ts`; canonical cwd → recovered onto `nested/a.ts`).
|
|
25
|
+
*
|
|
26
|
+
* `.native` is required: the JS `realpathSync` does NOT expand short names.
|
|
27
|
+
* A failure (missing directory, permissions) falls back to the input, matching
|
|
28
|
+
* `canonicalSnapshotKey`'s behaviour so both sides of the store agree on one
|
|
29
|
+
* spelling.
|
|
30
|
+
*
|
|
31
|
+
* The same byte-wise check also drives the plan-sandbox / vault-root
|
|
32
|
+
* decisions, so normalizing here is what keeps those from silently
|
|
33
|
+
* mis-evaluating on a short-name cwd. Parity measured this normalization as
|
|
34
|
+
* neutral for every other policy behaviour (7 scenarios, raw vs canonical).
|
|
35
|
+
*/
|
|
36
|
+
export declare function canonicalCwd(cwd: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Build the engine policy for one `hashline` tool call.
|
|
39
|
+
*
|
|
40
|
+
* Field sources (all reads go through the DSH settings facade, which maps the
|
|
41
|
+
* OMP dotted keys onto the tool-plus config — `src/config/omp-settings.ts`):
|
|
42
|
+
*
|
|
43
|
+
* - `cwd` — `session.cwd` through {@link canonicalCwd}: the
|
|
44
|
+
* engine resolves every authored path against it and
|
|
45
|
+
* runs its byte-wise containment check on it
|
|
46
|
+
* (upstream :563 passes the cwd verbatim; the
|
|
47
|
+
* normalization is a DSH-required fix for Windows
|
|
48
|
+
* short names — see {@link canonicalCwd}).
|
|
49
|
+
* - `mode` — constant `"hashline"`: this adapter only serves the
|
|
50
|
+
* hashline entry point.
|
|
51
|
+
* - `allowFuzzy` — `edit.fuzzyMatch`, default true
|
|
52
|
+
* (`edit/adapter/index.ts:210`).
|
|
53
|
+
* - `fuzzyThreshold` — `edit.fuzzyThreshold`, default 0.95 (S-13 above).
|
|
54
|
+
* - `enforceSeenLines` — `edit.enforceSeenLines`, schema default false
|
|
55
|
+
* (`src/config/omp-settings.ts:24/72`). **Passed
|
|
56
|
+
* explicitly and never left to a default**: the
|
|
57
|
+
* vendored TS `Patcher` defaulted this to `true`,
|
|
58
|
+
* while upstream/native resolve it from settings
|
|
59
|
+
* (default `false`). The old engine's stricter
|
|
60
|
+
* default therefore deliberately does not survive
|
|
61
|
+
* the migration; DSH follows the settings value
|
|
62
|
+
* (strict boolean, so a missing key reads as "off").
|
|
63
|
+
* - `blockAutoGenerated`— `edit.blockAutoGenerated`, schema default true
|
|
64
|
+
* (`omp-settings.ts:21/69`); `!== false` mirrors
|
|
65
|
+
* `shouldBlockAutoGeneratedFiles`'s default-on
|
|
66
|
+
* semantics in `omp/tools/auto-generated-guard.ts:297`.
|
|
67
|
+
* - `planActive` — upstream reads `session.getPlanModeState()?.enabled`.
|
|
68
|
+
* DSH's plan mode is a hint layer with **no hard
|
|
69
|
+
* gate** (`edit/adapter/tools/plan-mode-guard.ts`
|
|
70
|
+
* documents `enforcePlanModeWrite` as a deliberate
|
|
71
|
+
* no-op), and no DSH session installs
|
|
72
|
+
* `getPlanModeState`, so this resolves to `false`.
|
|
73
|
+
* - `localSandboxRoot` — upstream resolves the `local://` root. DSH has no
|
|
74
|
+
* `local://` write sandbox: the edit-path guard
|
|
75
|
+
* (`edit/adapter/tools/plan-mode-guard.ts`) hardcodes
|
|
76
|
+
* `targetsLocalSandbox → false` and documents plan
|
|
77
|
+
* mode as a hint layer, so `undefined` reproduces the
|
|
78
|
+
* old engine's `allowTagPathRecovery` exactly (cwd
|
|
79
|
+
* only). **If DSH ever wires a real sandbox root, it
|
|
80
|
+
* must go through {@link canonicalCwd} too** — the
|
|
81
|
+
* engine's containment check is byte-wise on
|
|
82
|
+
* `localSandboxRoot` just like on `cwd`.
|
|
83
|
+
* Consequence (D-3, awaiting the Lead's ruling): the
|
|
84
|
+
* vendored engine's `allowTagPathRecovery` override —
|
|
85
|
+
* which let a bare/mis-typed authored path rebind onto
|
|
86
|
+
* the file its snapshot tag uniquely names — has no
|
|
87
|
+
* counterpart here. The native engine now decides tag
|
|
88
|
+
* path recovery from `cwd` / `localSandboxRoot` /
|
|
89
|
+
* `vaultRoots` / `homeDir` alone, so a bare filename
|
|
90
|
+
* that needs rebinding fails with native's own error
|
|
91
|
+
* rather than silently landing on a recovered path.
|
|
92
|
+
* - `vaultRoots` — upstream `isVaultEnabled() ? cachedVaultRoots() : …`.
|
|
93
|
+
* DSH has no `vault://` protocol → `undefined`.
|
|
94
|
+
* - `homeDir` — `os.homedir()` (upstream :571); the engine uses it
|
|
95
|
+
* to recognise and refuse home-directory escapes.
|
|
96
|
+
* - `rawInput` — see {@link HashlinePolicyOptions.rawInput}.
|
|
97
|
+
*/
|
|
98
|
+
export declare function buildHashlineEditPolicy(session: ToolSession, options?: HashlinePolicyOptions): EditPolicy;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ToolSession } from "../../omp/sdk.ts";
|
|
2
|
+
import type { WritethroughCallback } from "../../omp/tools/writethrough.ts";
|
|
3
|
+
import type { EditWriteRequest, EditWriteResponse } from "./index.ts";
|
|
4
|
+
/** Wiring for {@link createHashlineWriter}. */
|
|
5
|
+
export interface HashlineWriterOptions {
|
|
6
|
+
session: ToolSession;
|
|
7
|
+
/** DSH's sandbox-routed file-write channel. */
|
|
8
|
+
writethrough: WritethroughCallback;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The `writer` argument for `EditSession.apply`, carrying the landed-file
|
|
13
|
+
* record alongside the callback.
|
|
14
|
+
*
|
|
15
|
+
* The native callback signature carries a leading `error` (used by the
|
|
16
|
+
* streaming *preview* channel, never by write requests) — upstream ignores it
|
|
17
|
+
* the same way (`refs/.../edit/index.ts:576`).
|
|
18
|
+
*/
|
|
19
|
+
export interface HashlineWriter {
|
|
20
|
+
/** The error-first callback the engine invokes for every landed change. */
|
|
21
|
+
(error: Error | null, request: EditWriteRequest): Promise<EditWriteResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* DSH display paths (`EditWriteRequest.displayPath` — the authored form,
|
|
24
|
+
* e.g. `a.ts`; for a move the *source*, which is the section that landed) of
|
|
25
|
+
* every file this apply actually wrote, in write order.
|
|
26
|
+
*
|
|
27
|
+
* The engine calls the writer once per file and aborts on the first throw,
|
|
28
|
+
* so after a rejected payload this holds exactly the sections that are on
|
|
29
|
+
* disk — the breadcrumb `executeHashlineSingle` re-attaches to the
|
|
30
|
+
* model-facing error (the old TS engine reported the same list from its
|
|
31
|
+
* prepared batch, `engine/patcher.ts:287-296` at v17.3.5).
|
|
32
|
+
*/
|
|
33
|
+
readonly landedPaths: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build the `writer` argument for `EditSession.apply`.
|
|
37
|
+
*
|
|
38
|
+
* The returned callable also exposes {@link HashlineWriter.landedPaths}; only a
|
|
39
|
+
* *successful* write is recorded, so a channel refusal on file #2 leaves just
|
|
40
|
+
* file #1 in the list.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createHashlineWriter(options: HashlineWriterOptions): HashlineWriter;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-CDP-message timeout applied to every puppeteer launch/connect. Set above
|
|
3
|
+
* the fetch tool timeout (30s) so the tool wall-clock is the canonical limit;
|
|
4
|
+
* this constant only catches genuinely stuck CDP sockets.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BROWSER_PROTOCOL_TIMEOUT_MS = 60000;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the Chromium executable the browser renderer will launch.
|
|
9
|
+
* `PUPPETEER_EXECUTABLE_PATH` always wins, then the system
|
|
10
|
+
* Chrome/Edge/Chromium candidate table (Windows and macOS check mere file
|
|
11
|
+
* existence; Linux additionally version-probes, see {@link isChromiumExecutable}).
|
|
12
|
+
* Returns undefined when nothing is found — puppeteer-core would fall back to
|
|
13
|
+
* its own bundled-Chromium search, which for this package means failure, so
|
|
14
|
+
* callers should treat undefined as "browser rendering unavailable".
|
|
15
|
+
*
|
|
16
|
+
* Unlike OMP upstream there is no Chrome-for-Testing download fallback: this
|
|
17
|
+
* plugin ships no browser installer, and the detection button only reports
|
|
18
|
+
* what is already on the machine.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ensureChromiumExecutable(): Promise<string | undefined>;
|
|
21
|
+
/** Reset the cached executable resolution (test seam). */
|
|
22
|
+
export declare function resetChromiumExecutableForTest(): void;
|
|
23
|
+
/** Exposes executable candidates for detection tests (OMP parity export). */
|
|
24
|
+
export declare function systemChromiumCandidatesForTest(platform?: NodeJS.Platform, home?: string, which?: (name: string) => string | null | undefined): string[];
|
|
25
|
+
/** Expose the Linux probe for tests (OMP parity export). */
|
|
26
|
+
export declare function chromiumExecutableProbeForTest(executablePath: string): Promise<boolean>;
|
|
27
|
+
/** Expose the executable-file check for tests. */
|
|
28
|
+
export declare function isExecutableFileForTest(p: string): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type ReadableFormat = "text" | "markdown";
|
|
2
|
+
export interface ReadableResult {
|
|
3
|
+
url: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
byline?: string;
|
|
6
|
+
excerpt?: string;
|
|
7
|
+
contentLength: number;
|
|
8
|
+
text?: string;
|
|
9
|
+
markdown?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Extract readable content from raw HTML.
|
|
13
|
+
* Tries Readability (article-isolation scoring) first, then falls back to a
|
|
14
|
+
* CSS selector chain over the same pre-parsed DOM. Returns null if neither
|
|
15
|
+
* path yields usable content.
|
|
16
|
+
*/
|
|
17
|
+
export declare function extractReadableFromHtml(html: string, url: string, format: ReadableFormat): Promise<ReadableResult | null>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH adapter for OMP's `config/settings-schema.ts`.
|
|
3
|
+
*
|
|
4
|
+
* The OMP schema is a ~5900-line settings registry. The edit engine only
|
|
5
|
+
* needs `getDefault(path)` for a handful of keys; defaults are taken from the
|
|
6
|
+
* OMP schema values (verbatim) so engine behavior matches upstream. Full
|
|
7
|
+
* schema metadata (tabs, UI descriptors) is DSH-side and not replicated.
|
|
8
|
+
*/
|
|
9
|
+
export type SettingPath = string;
|
|
10
|
+
export type SettingValue<P extends string = string> = unknown;
|
|
11
|
+
/** Schema default for a setting path (verbatim OMP values; unknown -> undefined). */
|
|
12
|
+
export declare function getDefault<P extends SettingPath>(path: P): any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH adapter for OMP's `config/settings.ts` Settings surface.
|
|
3
|
+
*
|
|
4
|
+
* OMP edit engine reads session settings through `settings.get("edit.*")`,
|
|
5
|
+
* `settings.get("lsp.*")`, etc. DSH has its own configuration (fields.ts +
|
|
6
|
+
* dsh settings); this adapter maps the OMP dotted keys onto the resolved
|
|
7
|
+
* tool-plus config, so the verbatim OMP engine code compiles and runs
|
|
8
|
+
* without modification.
|
|
9
|
+
*
|
|
10
|
+
* Only the surface the edit engine actually touches is provided:
|
|
11
|
+
* - `Settings` class with `get(path)` and `getEditVariantForModel(model)`
|
|
12
|
+
* - `settings` singleton (uninitialized until `installGlobalSettings` runs)
|
|
13
|
+
* - `isSettingsInitialized()`
|
|
14
|
+
*
|
|
15
|
+
* LSP keys are not wired: the LSP integration was cut from the DSH port
|
|
16
|
+
* (plan.md §3), so those reads fall back to the schema default (their
|
|
17
|
+
* `enableLsp` gate is `false` at the call sites), never to a degraded
|
|
18
|
+
* edit path.
|
|
19
|
+
*/
|
|
20
|
+
import type { RuntimeConfig } from '../../../config/settings.ts';
|
|
21
|
+
export type SettingPath = string;
|
|
22
|
+
/** Raw settings document shape (verbatim OMP). */
|
|
23
|
+
export interface RawSettings {
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface SettingsOptions {
|
|
27
|
+
cwd?: string;
|
|
28
|
+
agentDir?: string;
|
|
29
|
+
inMemory?: boolean;
|
|
30
|
+
readOnly?: boolean;
|
|
31
|
+
overrides?: Partial<Record<string, unknown>>;
|
|
32
|
+
configFiles?: string[];
|
|
33
|
+
}
|
|
34
|
+
export type SettingValue<P extends string = string> = unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Session-scoped settings adapter. `get(path)` resolves the OMP dotted key
|
|
37
|
+
* against the live tool-plus config; unknown keys return the schema default
|
|
38
|
+
* or undefined.
|
|
39
|
+
*/
|
|
40
|
+
export declare class Settings {
|
|
41
|
+
#private;
|
|
42
|
+
constructor(config: RuntimeConfig, getDefault: (path: string) => unknown);
|
|
43
|
+
get(path: string): any;
|
|
44
|
+
/** OMP storage accessor (DSH: no agent storage — null). */
|
|
45
|
+
getStorage(): null;
|
|
46
|
+
/** Whether a path is explicitly configured (DSH config is always resolved). */
|
|
47
|
+
isConfigured(_path: string): boolean;
|
|
48
|
+
/** Persist a setting (DSH: config is static at tool time — no-op). */
|
|
49
|
+
set(_path: string, _value: unknown): void;
|
|
50
|
+
/** OMP edit-variant override hook; DSH resolves the mode from config directly. */
|
|
51
|
+
getEditVariantForModel(_model: string | undefined): 'replace' | 'patch' | 'hashline' | 'apply_patch' | null;
|
|
52
|
+
}
|
|
53
|
+
/** Install the resolved tool-plus config into the global settings singleton. */
|
|
54
|
+
export declare function installGlobalSettings(config: RuntimeConfig, getDefault: (path: string) => unknown): void;
|
|
55
|
+
export declare function isSettingsInitialized(): boolean;
|
|
56
|
+
/** Global settings singleton (read-only facade over the installed config). */
|
|
57
|
+
export declare const settings: Settings;
|
|
58
|
+
/** Re-exported schema default lookup (OMP settings.ts re-exports it too). */
|
|
59
|
+
export { getDefault } from './settings-schema.ts';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for the Codex `apply_patch` envelope format.
|
|
3
|
+
*
|
|
4
|
+
* *** Begin Patch
|
|
5
|
+
* *** Add File: <path>
|
|
6
|
+
* +<line>
|
|
7
|
+
* *** Delete File: <path>
|
|
8
|
+
* *** Update File: <path>
|
|
9
|
+
* *** Move to: <newpath>
|
|
10
|
+
* @@ <optional context>
|
|
11
|
+
* -old
|
|
12
|
+
* +new
|
|
13
|
+
* context
|
|
14
|
+
* *** End of File
|
|
15
|
+
* *** End Patch
|
|
16
|
+
*
|
|
17
|
+
* Input is the full envelope text (optionally heredoc-wrapped). Output is a
|
|
18
|
+
* list of `PatchInput` records, each ready to hand to the existing
|
|
19
|
+
* single-file `applyPatch()` in `../modes/patch.ts`.
|
|
20
|
+
*
|
|
21
|
+
* Per spec §4.3 Lenient mode: a `<<EOF` / `<<'EOF'` / `<<"EOF"` heredoc
|
|
22
|
+
* wrapper around the whole envelope is stripped before parsing.
|
|
23
|
+
*/
|
|
24
|
+
import type { PatchInput } from "../modes/patch";
|
|
25
|
+
/**
|
|
26
|
+
* Parse a Codex `*** Begin Patch` envelope into a list of single-file
|
|
27
|
+
* patch inputs.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseApplyPatch(patchText: string): PatchInput[];
|
|
30
|
+
/**
|
|
31
|
+
* Best-effort parser for in-progress TUI previews. It tolerates missing
|
|
32
|
+
* envelope markers and incomplete trailing hunks; do not use it to apply edits.
|
|
33
|
+
*/
|
|
34
|
+
export declare function parseApplyPatchStreaming(patchText: string): PatchInput[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit tool result detail shapes (shared by the replace / patch / hashline
|
|
3
|
+
* engines and the snapshot pruner). The TUI renderer that consumed these was
|
|
4
|
+
* cut with the TUI layer (plan.md 拍板#17); the shapes remain because the
|
|
5
|
+
* engines assemble them as their `AgentToolResult.details`.
|
|
6
|
+
*/
|
|
7
|
+
export type Operation = "create" | "delete" | "update";
|
|
8
|
+
export interface EditToolPerFileResult {
|
|
9
|
+
path: string;
|
|
10
|
+
diff: string;
|
|
11
|
+
firstChangedLine?: number;
|
|
12
|
+
op?: Operation;
|
|
13
|
+
move?: string;
|
|
14
|
+
isError?: boolean;
|
|
15
|
+
errorText?: string;
|
|
16
|
+
/** TUI-friendly error text. When present, rendered to the user instead of `errorText`.
|
|
17
|
+
* Set when the underlying error carries a `displayMessage` (e.g. {@link HashlineMismatchError}). */
|
|
18
|
+
displayErrorText?: string;
|
|
19
|
+
meta?: OutputMeta;
|
|
20
|
+
/** Source-of-truth content before the edit; `undefined` for create operations. */
|
|
21
|
+
oldText?: string;
|
|
22
|
+
/** Source-of-truth content after the edit; `undefined` for delete operations. */
|
|
23
|
+
newText?: string;
|
|
24
|
+
/** True when {@link pruneOversizedEditSnapshots} dropped `oldText`/`newText` from this entry. Aggregators check this to suppress misleading combined snapshots when at least one entry of a multi-entry single-path edit was pruned. */
|
|
25
|
+
snapshotsPruned?: boolean;
|
|
26
|
+
/** Pre-move source path; set only when the edit moved/renamed the file. The header renders `sourcePath → path`. */
|
|
27
|
+
sourcePath?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface EditToolDetails {
|
|
30
|
+
/** Unified diff of the changes made */
|
|
31
|
+
diff: string;
|
|
32
|
+
/** Line number of the first change in the new file (for editor navigation) */
|
|
33
|
+
firstChangedLine?: number;
|
|
34
|
+
/** Operation type (patch mode only) */
|
|
35
|
+
op?: Operation;
|
|
36
|
+
/** New path after move/rename (patch mode only) */
|
|
37
|
+
move?: string;
|
|
38
|
+
/** Structured output metadata */
|
|
39
|
+
meta?: OutputMeta;
|
|
40
|
+
/** Per-file results (multi-file edits) */
|
|
41
|
+
perFileResults?: EditToolPerFileResult[];
|
|
42
|
+
/** Absolute file path for single-file edit results. Required by ACP diff metadata consumers. */
|
|
43
|
+
path?: string;
|
|
44
|
+
/** Source-of-truth content before the edit; `undefined` for create operations. */
|
|
45
|
+
oldText?: string;
|
|
46
|
+
/** Source-of-truth content after the edit; `undefined` for delete operations. */
|
|
47
|
+
newText?: string;
|
|
48
|
+
/** True when {@link pruneOversizedEditSnapshots} dropped `oldText`/`newText` from this entry. Aggregators check this to suppress misleading combined snapshots when at least one entry of a multi-entry single-path edit was pruned. */
|
|
49
|
+
snapshotsPruned?: boolean;
|
|
50
|
+
/** Pre-move source path; set only when the edit moved/renamed the file. The header renders `sourcePath → path`. */
|
|
51
|
+
sourcePath?: string;
|
|
52
|
+
}
|
|
53
|
+
type OutputMeta = import("../../edit/adapter/tools/output-meta").OutputMeta;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type BlockContextSource } from "../../omp/utils/block-context.ts";
|
|
2
|
+
export interface DiffResult {
|
|
3
|
+
diff: string;
|
|
4
|
+
firstChangedLine: number | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface DiffError {
|
|
7
|
+
error: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DiffHunk {
|
|
10
|
+
changeContext?: string;
|
|
11
|
+
oldStartLine?: number;
|
|
12
|
+
newStartLine?: number;
|
|
13
|
+
hasContextLines: boolean;
|
|
14
|
+
oldLines: string[];
|
|
15
|
+
newLines: string[];
|
|
16
|
+
isEndOfFile: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class ParseError extends Error {
|
|
19
|
+
readonly lineNumber?: number | undefined;
|
|
20
|
+
constructor(message: string, lineNumber?: number | undefined);
|
|
21
|
+
}
|
|
22
|
+
export declare class ApplyPatchError extends Error {
|
|
23
|
+
constructor(message: string);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Generate a unified diff string with line numbers and context.
|
|
27
|
+
* Returns both the diff string and the first changed line number (in the new file).
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateDiffString(oldContent: string, newContent: string, contextLines?: number, source?: BlockContextSource): DiffResult;
|
|
30
|
+
export interface ReplaceOptions {
|
|
31
|
+
/** Allow fuzzy matching */
|
|
32
|
+
fuzzy: boolean;
|
|
33
|
+
/** Replace all occurrences */
|
|
34
|
+
all: boolean;
|
|
35
|
+
/** Similarity threshold for fuzzy matching */
|
|
36
|
+
threshold?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ReplaceResult {
|
|
39
|
+
/** The new content after replacements */
|
|
40
|
+
content: string;
|
|
41
|
+
/** Number of replacements made */
|
|
42
|
+
count: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Generate a unified diff string without file headers.
|
|
46
|
+
* Returns both the diff string and the first changed line number (in the new file).
|
|
47
|
+
*/
|
|
48
|
+
export declare function generateUnifiedDiffString(oldContent: string, newContent: string, contextLines?: number, source?: BlockContextSource): DiffResult;
|
|
49
|
+
export declare function normalizeDiff(diff: string): string;
|
|
50
|
+
export declare function normalizeCreateContent(content: string): string;
|
|
51
|
+
export declare function parseDiffHunks(diff: string): DiffHunk[];
|
|
52
|
+
/**
|
|
53
|
+
* Find and replace text in content using fuzzy matching.
|
|
54
|
+
*/
|
|
55
|
+
export declare function replaceText(content: string, oldText: string, newText: string, options: ReplaceOptions): ReplaceResult;
|
|
56
|
+
/**
|
|
57
|
+
* Compute the diff for an edit operation without applying it.
|
|
58
|
+
* Used for preview rendering in the TUI before the tool executes.
|
|
59
|
+
*/
|
|
60
|
+
export declare function computeEditDiff(path: string, oldText: string, newText: string, cwd: string, fuzzy?: boolean, all?: boolean, threshold?: number): Promise<DiffResult | DiffError>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit dispatch layer — path resolution + multi-entry/multi-file aggregation.
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from upstream `packages/coding-agent/src/edit/index.ts`
|
|
5
|
+
* (refs/oh-my-pi, 17.3.5): `resolveEditPath` (:77-93), `executeApplyPatchPerFile`
|
|
6
|
+
* (:139-256) and `executeSinglePathEntries` (:258-365). Algorithm and user-facing
|
|
7
|
+
* copy are byte-for-byte upstream; only the import surface was redirected to the
|
|
8
|
+
* DSH-resident modules and the LSP-only surface was cut, per the established
|
|
9
|
+
* omp/ adaptation conventions:
|
|
10
|
+
* - `renderer` → `./details` (TUI renderer cut, plan.md 拍板#17): the
|
|
11
|
+
* `EditToolDetails` / `EditToolPerFileResult` shapes live in `./details.ts`;
|
|
12
|
+
* the upstream per-file `diagnostics` field went with the LSP layer.
|
|
13
|
+
* - `resolvePlanPath` → DSH adapter shim (`edit/adapter/tools/plan-mode-guard`,
|
|
14
|
+
* verbatim resolution minus local:// schemes) — same redirection the local
|
|
15
|
+
* engines (modes/replace.ts, modes/patch.ts) already use.
|
|
16
|
+
* - `LspBatchRequest` / `flushLspWritethroughBatch` → local type + no-op below.
|
|
17
|
+
* DSH never constructs an outer batch request, so every `batchRequest` inside
|
|
18
|
+
* the aggregators resolves to `undefined` and the flush branches stay
|
|
19
|
+
* unreachable; the flow is kept verbatim so this file stays diffable
|
|
20
|
+
* against refs.
|
|
21
|
+
*/
|
|
22
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
23
|
+
import type { ToolSession } from "../tools/index.ts";
|
|
24
|
+
import type { EditToolDetails } from "./details";
|
|
25
|
+
/**
|
|
26
|
+
* LSP write-batch handle (upstream `tools/render-utils.ts`, surfaced through the
|
|
27
|
+
* edit renderer). Shape verbatim; DSH cuts the LSP layer (plan.md 拍板#5), so no
|
|
28
|
+
* caller ever constructs one — see {@link flushLspWritethroughBatch}.
|
|
29
|
+
*/
|
|
30
|
+
export interface LspBatchRequest {
|
|
31
|
+
id: string;
|
|
32
|
+
flush: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function resolveEditPath(session: ToolSession, authoredPath: string, options: {
|
|
35
|
+
mustExist: boolean;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}): Promise<string>;
|
|
38
|
+
/** Run apply_patch file operations and aggregate their multi-file result. */
|
|
39
|
+
export declare function executeApplyPatchPerFile(fileEntries: {
|
|
40
|
+
path: string;
|
|
41
|
+
run: (batchRequest: LspBatchRequest | undefined) => Promise<AgentToolResult<EditToolDetails>>;
|
|
42
|
+
}[], outerBatchRequest: LspBatchRequest | undefined, cwd: string, signal: AbortSignal | undefined, onUpdate?: (partialResult: AgentToolResult<EditToolDetails>) => void): Promise<AgentToolResult<EditToolDetails>>;
|
|
43
|
+
export declare function executeSinglePathEntries(path: string, runs: ((batchRequest: LspBatchRequest | undefined) => Promise<AgentToolResult<EditToolDetails>>)[], outerBatchRequest: LspBatchRequest | undefined, onUpdate: ((partialResult: AgentToolResult<EditToolDetails>) => void) | undefined, cwd: string, signal: AbortSignal | undefined): Promise<AgentToolResult<EditToolDetails>>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type EditStore, type EditStoreOwner } from "../../hashline/native/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Upper bound on the file size we snapshot.
|
|
4
|
+
*
|
|
5
|
+
* A section tag is a content hash of the *whole* file, so minting one means
|
|
6
|
+
* holding the full normalized text in the store. Files above this cap emit no
|
|
7
|
+
* `[path#tag]` header — line-anchored editing of multi-megabyte files is out
|
|
8
|
+
* of scope under the full-content model.
|
|
9
|
+
*
|
|
10
|
+
* The value mirrors the native store's own cap (`EditStore.recordSnapshotFile`
|
|
11
|
+
* returns `null` for "unreadable or larger than 4 MiB",
|
|
12
|
+
* `@oh-my-pi/pi-natives` index.d.ts:132-136); `read` also uses it to decide
|
|
13
|
+
* whether to stream a whole file into memory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SNAPSHOT_MAX_BYTES: number;
|
|
16
|
+
/**
|
|
17
|
+
* Look up (or lazily create) the file snapshot store attached to a session.
|
|
18
|
+
*
|
|
19
|
+
* One-line forward to the adapter's `getEditStore` so there is exactly one
|
|
20
|
+
* store per session; the DSH name is kept because this module owns the
|
|
21
|
+
* DSH-side concerns listed in the file header.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getFileSnapshotStore(session: EditStoreOwner): EditStore;
|
|
24
|
+
/**
|
|
25
|
+
* Canonicalize an absolute path into the stable key the snapshot store uses.
|
|
26
|
+
*
|
|
27
|
+
* Different code paths reach the snapshot store via different path forms:
|
|
28
|
+
* `read local://foo.md` records under the file's `fs.realpath` (the local
|
|
29
|
+
* protocol handler resolves symlinks); a subsequent `edit` may address the
|
|
30
|
+
* same artifact via `local://foo.md`, whose resolver does NOT realpath, or
|
|
31
|
+
* via the absolute path returned in the `[path#tag]` header. macOS adds the
|
|
32
|
+
* same hazard at the working-tree level (`/tmp/...` vs `/private/tmp/...`).
|
|
33
|
+
* Collapsing every key through `realpath` makes those forms fuse onto one
|
|
34
|
+
* snapshot entry, so a freshly-minted tag is never rejected as stale just
|
|
35
|
+
* because the lookup spelled the same file differently.
|
|
36
|
+
*
|
|
37
|
+
* Non-existent paths (new-file writes) fall back to a realpath of the parent
|
|
38
|
+
* directory + basename, then to the input. This keeps creates and updates on
|
|
39
|
+
* the same canonical key.
|
|
40
|
+
*
|
|
41
|
+
* Parity note (native migration): the Rust engine keys its own lookups by
|
|
42
|
+
* `policy.cwd` + the authored path, i.e. the unresolved spelling. For a path
|
|
43
|
+
* with no symlink component the two spellings are identical; for a symlinked
|
|
44
|
+
* subpath they are not, and a tag minted here would not be found by the
|
|
45
|
+
* engine. Listed for the parity doc (T-parity) rather than papered over —
|
|
46
|
+
* native exposes no path-canonicalization hook.
|
|
47
|
+
*/
|
|
48
|
+
export declare function canonicalSnapshotKey(absolutePath: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Read the full text of `absolutePath` (within {@link SNAPSHOT_MAX_BYTES}),
|
|
51
|
+
* record it as a version snapshot, and return its content-hash tag. Returns
|
|
52
|
+
* `undefined` when the file exceeds the cap or cannot be read — callers then
|
|
53
|
+
* omit the section header so the model never sees a tag it can't anchor against.
|
|
54
|
+
*
|
|
55
|
+
* Producers that only displayed a slice of the file (range reads, search hits)
|
|
56
|
+
* use this to mint a whole-file tag: the displayed lines stay partial, but the
|
|
57
|
+
* tag fingerprints the entire file so a follow-up edit anchored at any line
|
|
58
|
+
* validates whenever the live file is byte-identical to what was read. Raw
|
|
59
|
+
* reads pass `seenLines` even though they do not emit a header, letting a prior
|
|
60
|
+
* or later same-content hashline tag inherit the raw range's provenance.
|
|
61
|
+
*
|
|
62
|
+
* `async` for call-site compatibility (`read`/`grep`/`ast-grep` await it); the
|
|
63
|
+
* native `recordSnapshotFile` performs the read, LF normalization and the
|
|
64
|
+
* 4 MiB cap synchronously, and returns `null` instead of `undefined`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function recordFileSnapshot(session: EditStoreOwner, absolutePath: string, seenLines?: Iterable<number>): Promise<string | undefined>;
|
|
67
|
+
/** Merge explicit 1-indexed displayed lines into a recorded hashline snapshot. */
|
|
68
|
+
export declare function recordSeenLines(session: EditStoreOwner, absolutePath: string, tag: string, lines: readonly number[]): void;
|
|
69
|
+
/**
|
|
70
|
+
* Attach the lines a read displayed to the snapshot it minted, so the engine's
|
|
71
|
+
* (opt-in) seen-line guard can reject edits anchored on lines the model never
|
|
72
|
+
* saw. Best-effort: a no-op when the body has no numbered rows or the snapshot
|
|
73
|
+
* already aged out. `tag` must be the tag returned when this exact content was
|
|
74
|
+
* recorded. Every displayed `NN:` row counts as seen, including column-clipped
|
|
75
|
+
* rows — the guard no longer distinguishes full-width from truncated display.
|
|
76
|
+
*
|
|
77
|
+
* The `N:` / `NN-MM:` row parsing lives in Rust now
|
|
78
|
+
* (`EditStore.recordSeenLinesFromBody`, including the collapsed-summary
|
|
79
|
+
* boundary-line rule), so this is a straight forward with key canonicalization.
|
|
80
|
+
*/
|
|
81
|
+
export declare function recordSeenLinesFromBody(session: EditStoreOwner, absolutePath: string, tag: string, body: string): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coding-agent runner that drives the native hashline engine on behalf of the
|
|
3
|
+
* `edit` tool. Converts an `{input}` tool-call payload into a fully-applied
|
|
4
|
+
* patch, wraps the result in the agent's {@link AgentToolResult} shape, and
|
|
5
|
+
* attaches `outputMeta` for the renderer.
|
|
6
|
+
*
|
|
7
|
+
* Before the native migration this file drove the vendored TS engine
|
|
8
|
+
* (`Patch`/`Patcher`/`HashlineFilesystem`/`BlockResolver`/clipboard) and
|
|
9
|
+
* hand-assembled the model-facing text from per-section fields. Upstream 18.x
|
|
10
|
+
* moved all of that into Rust (`crates/pi-edit`), so the host side is now:
|
|
11
|
+
*
|
|
12
|
+
* 1. build the `EditPolicy` (`native/policy.ts`) and the writer
|
|
13
|
+
* (`native/writer.ts`),
|
|
14
|
+
* 2. hand `EditSession.apply` the payload,
|
|
15
|
+
* 3. shape the returned {@link EditApplyOutcome} into DSH's
|
|
16
|
+
* `EditToolDetails`.
|
|
17
|
+
*
|
|
18
|
+
* What the native engine now owns (and this file therefore no longer
|
|
19
|
+
* implements — each was verified byte-for-byte against the old DSH output):
|
|
20
|
+
* the parsed/aggregated model-facing text including the compact numbered
|
|
21
|
+
* preview and `PUT N*:` block-resolution lines, mismatch / unseen-anchor /
|
|
22
|
+
* missing-file diagnostics, the byte-identical no-op hint **and** its
|
|
23
|
+
* 3-strike escalation (the old `noop-loop-guard.ts`), tag validation with
|
|
24
|
+
* in-session recovery, `N*` block resolution, the `CUT`/`PUT` clipboard
|
|
25
|
+
* registers, and the multi-section merge for sections naming one file.
|
|
26
|
+
*/
|
|
27
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
28
|
+
import { MismatchError } from "../../../hashline/native/index.ts";
|
|
29
|
+
import type { ToolSession } from "../../../omp/tools/index.ts";
|
|
30
|
+
import type { WritethroughCallback } from "../../../omp/tools/writethrough.ts";
|
|
31
|
+
import type { EditToolDetails } from "../details";
|
|
32
|
+
import { type HashlineParams, hashlineEditParamsSchema } from "./params";
|
|
33
|
+
export interface ExecuteHashlineSingleOptions {
|
|
34
|
+
session: ToolSession;
|
|
35
|
+
input: string;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
writethrough: WritethroughCallback;
|
|
38
|
+
}
|
|
39
|
+
export declare function executeHashlineSingle(options: ExecuteHashlineSingleOptions): Promise<AgentToolResult<EditToolDetails, typeof hashlineEditParamsSchema>>;
|
|
40
|
+
export { MismatchError as HashlineMismatchError, type HashlineParams, hashlineEditParamsSchema };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edit mode wrapper for the Codex `apply_patch` envelope format.
|
|
3
|
+
*
|
|
4
|
+
* The mode accepts a single `input` string containing a full
|
|
5
|
+
* `*** Begin Patch ... *** End Patch` block, parses it, and fans out to
|
|
6
|
+
* the existing `executePatchSingle` — so all the machinery (plan mode,
|
|
7
|
+
* LSP writethrough, fs-cache invalidation, diagnostics) is shared with
|
|
8
|
+
* the `patch` mode.
|
|
9
|
+
*/
|
|
10
|
+
import type { PatchEditEntry } from "./patch";
|
|
11
|
+
export declare const applyPatchSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
12
|
+
input: string;
|
|
13
|
+
}, {
|
|
14
|
+
input: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type ApplyPatchParams = typeof applyPatchSchema.infer;
|
|
17
|
+
export type ApplyPatchEntry = PatchEditEntry & {
|
|
18
|
+
path: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Parse the envelope and lower each hunk to a `PatchEditEntry` so it can
|
|
22
|
+
* be routed through `executePatchSingle`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function expandApplyPatchToEntries(params: ApplyPatchParams): ApplyPatchEntry[];
|
|
25
|
+
export declare function expandApplyPatchToPreviewEntries(params: ApplyPatchParams): ApplyPatchEntry[];
|