@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,244 @@
|
|
|
1
|
+
import type { AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
export declare const DEFAULT_MAX_LINES = 3000;
|
|
3
|
+
export declare const DEFAULT_MAX_BYTES: number;
|
|
4
|
+
export declare const DEFAULT_MAX_COLUMN = 512;
|
|
5
|
+
/**
|
|
6
|
+
* Default artifact-on-disk cap for {@link OutputSink}.
|
|
7
|
+
*
|
|
8
|
+
* `0` means unbounded: by default, `artifact://<id>` references preserve the
|
|
9
|
+
* complete raw stream instead of a capped head/tail sample.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ARTIFACT_DEFAULT_MAX_BYTES = 0;
|
|
12
|
+
/** Default head budget; the remainder becomes the rolling tail window. */
|
|
13
|
+
export declare const ARTIFACT_DEFAULT_HEAD_BYTES: number;
|
|
14
|
+
export interface OutputSummary {
|
|
15
|
+
output: string;
|
|
16
|
+
truncated: boolean;
|
|
17
|
+
totalLines: number;
|
|
18
|
+
totalBytes: number;
|
|
19
|
+
outputLines: number;
|
|
20
|
+
outputBytes: number;
|
|
21
|
+
/** Bytes elided from the middle when head-retain mode is active. */
|
|
22
|
+
elidedBytes?: number;
|
|
23
|
+
/** Lines elided from the middle when head-retain mode is active. */
|
|
24
|
+
elidedLines?: number;
|
|
25
|
+
/** Bytes dropped by the per-line column cap (sum across all lines). */
|
|
26
|
+
columnDroppedBytes?: number;
|
|
27
|
+
/** Number of distinct lines that hit the per-line column cap. */
|
|
28
|
+
columnTruncatedLines?: number;
|
|
29
|
+
/** Configured per-line column cap in effect (chars), when > 0. */
|
|
30
|
+
columnMax?: number;
|
|
31
|
+
/** Artifact ID for internal URL access (artifact://<id>) when truncated */
|
|
32
|
+
artifactId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface OutputSinkOptions {
|
|
35
|
+
artifactPath?: string;
|
|
36
|
+
artifactId?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Total inline body budget (bytes). Default DEFAULT_MAX_BYTES. The head
|
|
39
|
+
* window and rolling tail window share this budget, so a composed
|
|
40
|
+
* `dump()` body never exceeds it (plus the elision marker).
|
|
41
|
+
*/
|
|
42
|
+
spillThreshold?: number;
|
|
43
|
+
/**
|
|
44
|
+
* When > 0, the sink keeps the first `headBytes` of output in addition to
|
|
45
|
+
* the rolling tail window. Output between the two windows is elided
|
|
46
|
+
* (middle elision). Clamped to `spillThreshold / 2` so the tail keeps at
|
|
47
|
+
* least half the inline budget. Default 0 = tail-only behavior.
|
|
48
|
+
*/
|
|
49
|
+
headBytes?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Per-line byte cap. When > 0, lines wider than `maxColumns` bytes are
|
|
52
|
+
* truncated with an ellipsis at write time; remaining bytes up to the next
|
|
53
|
+
* `\n` are dropped. Cap state persists across chunks so split-mid-line
|
|
54
|
+
* writes still respect the budget. Default 0 = no per-line cap.
|
|
55
|
+
*/
|
|
56
|
+
maxColumns?: number;
|
|
57
|
+
onChunk?: (chunk: string) => void;
|
|
58
|
+
/** Minimum ms between onChunk calls. 0 = every chunk (default). */
|
|
59
|
+
chunkThrottleMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Optional cap on bytes written to the artifact-on-disk file. When the cap
|
|
62
|
+
* is hit, the head window is preserved verbatim and subsequent output feeds
|
|
63
|
+
* a rolling tail window; on close, the sink writes a single
|
|
64
|
+
* `[ARTIFACT TRUNCATED: …]` notice between them. Default
|
|
65
|
+
* {@link ARTIFACT_DEFAULT_MAX_BYTES} (unbounded).
|
|
66
|
+
*/
|
|
67
|
+
artifactMaxBytes?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Bytes reserved for the head window of the capped artifact file. The
|
|
70
|
+
* tail window receives `artifactMaxBytes - artifactHeadBytes`. Default
|
|
71
|
+
* {@link ARTIFACT_DEFAULT_HEAD_BYTES}; clamped to `[0, artifactMaxBytes]`.
|
|
72
|
+
*/
|
|
73
|
+
artifactHeadBytes?: number;
|
|
74
|
+
}
|
|
75
|
+
export interface TruncationResult {
|
|
76
|
+
content: string;
|
|
77
|
+
truncated?: boolean;
|
|
78
|
+
truncatedBy?: "lines" | "bytes" | "middle";
|
|
79
|
+
totalLines: number;
|
|
80
|
+
totalBytes: number;
|
|
81
|
+
outputLines?: number;
|
|
82
|
+
outputBytes?: number;
|
|
83
|
+
/** Bytes elided from the middle (truncateMiddle only). */
|
|
84
|
+
elidedBytes?: number;
|
|
85
|
+
/** Lines elided from the middle (truncateMiddle only). */
|
|
86
|
+
elidedLines?: number;
|
|
87
|
+
lastLinePartial?: boolean;
|
|
88
|
+
firstLineExceedsLimit?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface TruncationOptions {
|
|
91
|
+
/** Maximum number of lines (default: 3000) */
|
|
92
|
+
maxLines?: number;
|
|
93
|
+
/** Maximum number of bytes (default: 50KB) */
|
|
94
|
+
maxBytes?: number;
|
|
95
|
+
/**
|
|
96
|
+
* For `truncateMiddle`: bytes reserved for the head window. The tail
|
|
97
|
+
* window receives `maxBytes - maxHeadBytes`. Default `floor(maxBytes/2)`.
|
|
98
|
+
*/
|
|
99
|
+
maxHeadBytes?: number;
|
|
100
|
+
/**
|
|
101
|
+
* For `truncateMiddle`: lines reserved for the head window. The tail
|
|
102
|
+
* window receives `maxLines - maxHeadLines`. Default `floor(maxLines/2)`.
|
|
103
|
+
*/
|
|
104
|
+
maxHeadLines?: number;
|
|
105
|
+
}
|
|
106
|
+
/** Result from byte-level truncation helpers. */
|
|
107
|
+
export interface ByteTruncationResult {
|
|
108
|
+
text: string;
|
|
109
|
+
bytes: number;
|
|
110
|
+
}
|
|
111
|
+
export interface TailTruncationNoticeOptions {
|
|
112
|
+
fullOutputPath?: string;
|
|
113
|
+
originalContent?: string;
|
|
114
|
+
suffix?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface HeadTruncationNoticeOptions {
|
|
117
|
+
startLine?: number;
|
|
118
|
+
totalFileLines?: number;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Truncate a string/buffer to fit within a byte limit, keeping the tail.
|
|
122
|
+
* Handles multi-byte UTF-8 boundaries correctly.
|
|
123
|
+
*/
|
|
124
|
+
export declare function truncateTailBytes(data: string | Uint8Array, maxBytes: number): ByteTruncationResult;
|
|
125
|
+
/**
|
|
126
|
+
* Truncate a string/buffer to fit within a byte limit, keeping the head.
|
|
127
|
+
* Handles multi-byte UTF-8 boundaries correctly.
|
|
128
|
+
*/
|
|
129
|
+
export declare function truncateHeadBytes(data: string | Uint8Array, maxBytes: number): ByteTruncationResult;
|
|
130
|
+
/**
|
|
131
|
+
* Truncate a single line to max characters, appending '…' if truncated.
|
|
132
|
+
*/
|
|
133
|
+
export declare function truncateLine(line: string, maxChars?: number): {
|
|
134
|
+
text: string;
|
|
135
|
+
wasTruncated: boolean;
|
|
136
|
+
};
|
|
137
|
+
/** Shared helper to build a no-truncation result. */
|
|
138
|
+
export declare function noTruncResult(content: string, totalLines?: number, totalBytes?: number): TruncationResult;
|
|
139
|
+
/**
|
|
140
|
+
* Truncate content from the head (keep first N lines/bytes).
|
|
141
|
+
* Never returns partial lines. If the first line exceeds the byte limit,
|
|
142
|
+
* returns empty content with firstLineExceedsLimit=true.
|
|
143
|
+
*
|
|
144
|
+
* This implementation avoids Buffer.from(content) for the whole input.
|
|
145
|
+
* It only computes UTF-8 byteLength for candidate lines that can still fit.
|
|
146
|
+
*/
|
|
147
|
+
export declare function truncateHead(content: string, options?: TruncationOptions): TruncationResult;
|
|
148
|
+
/**
|
|
149
|
+
* Truncate content from the tail (keep last N lines/bytes).
|
|
150
|
+
* May return a partial first line if the last line exceeds the byte limit.
|
|
151
|
+
*
|
|
152
|
+
* Also avoids Buffer.from(content) for the whole input.
|
|
153
|
+
*/
|
|
154
|
+
export declare function truncateTail(content: string, options?: TruncationOptions): TruncationResult;
|
|
155
|
+
/**
|
|
156
|
+
* Format the inline marker substituted for the elided middle region.
|
|
157
|
+
* Returned without surrounding newlines so callers can position it freely.
|
|
158
|
+
*/
|
|
159
|
+
export declare function formatMiddleElisionMarker(elidedLines: number, elidedBytes: number): string;
|
|
160
|
+
/**
|
|
161
|
+
* Truncate content keeping a head window and a tail window, eliding the middle.
|
|
162
|
+
*
|
|
163
|
+
* The combined output is `<head>\n<marker>\n<tail>` when truncation is needed.
|
|
164
|
+
* `maxHeadBytes` defaults to `floor(maxBytes / 2)`; the tail receives the
|
|
165
|
+
* remainder. Falls back to `truncateTail` / `truncateHead` if either side's
|
|
166
|
+
* budget is empty or the content already fits.
|
|
167
|
+
*/
|
|
168
|
+
export declare function truncateMiddle(content: string, options?: TruncationOptions): TruncationResult;
|
|
169
|
+
/** Options for {@link enforceInlineByteCap}. */
|
|
170
|
+
export interface InlineByteCapOptions {
|
|
171
|
+
/** Inline byte budget. Defaults to {@link DEFAULT_MAX_BYTES}. */
|
|
172
|
+
maxBytes?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Persist the full text as a session artifact. When an artifact id is
|
|
175
|
+
* returned, a `[raw output: artifact://<id>]` footer is appended so the
|
|
176
|
+
* elided bytes stay recoverable.
|
|
177
|
+
*/
|
|
178
|
+
saveArtifact?: (full: string) => string | undefined | Promise<string | undefined>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Final-defense inline size guard for tool results.
|
|
182
|
+
*
|
|
183
|
+
* No-op when `text` fits within `maxBytes` (the common path). Otherwise keeps
|
|
184
|
+
* ~60% of the budget from the head and ~25% from the tail — cut on line
|
|
185
|
+
* boundaries, never splitting a multi-byte UTF-8 sequence — with an elision
|
|
186
|
+
* marker between. The remaining ~15% is slack for the marker and the optional
|
|
187
|
+
* `[raw output: artifact://<id>]` footer, so the result stays under `maxBytes`.
|
|
188
|
+
*/
|
|
189
|
+
export declare function enforceInlineByteCap(text: string, options: InlineByteCapOptions): Promise<string>;
|
|
190
|
+
export declare class TailBuffer {
|
|
191
|
+
#private;
|
|
192
|
+
readonly maxBytes: number;
|
|
193
|
+
constructor(maxBytes: number);
|
|
194
|
+
append(text: string): void;
|
|
195
|
+
text(): string;
|
|
196
|
+
bytes(): number;
|
|
197
|
+
}
|
|
198
|
+
export declare class OutputSink {
|
|
199
|
+
#private;
|
|
200
|
+
constructor(options?: OutputSinkOptions);
|
|
201
|
+
/**
|
|
202
|
+
* Push a chunk of output. The buffer management and onChunk callback run
|
|
203
|
+
* synchronously. File sink writes are deferred and serialized internally.
|
|
204
|
+
*/
|
|
205
|
+
push(chunk: string): void;
|
|
206
|
+
createInput(): WritableStream<Uint8Array | string>;
|
|
207
|
+
/**
|
|
208
|
+
* Replace the in-memory buffer with the given text. Used when an upstream
|
|
209
|
+
* minimizer rewrites the captured output after the raw bytes have already
|
|
210
|
+
* been streamed.
|
|
211
|
+
*
|
|
212
|
+
* After this call the buffer is authoritative: streaming counters realign
|
|
213
|
+
* to the replacement, the retained head window is cleared, and head
|
|
214
|
+
* retention is disabled so subsequent `push()` calls append directly to the
|
|
215
|
+
* tail buffer instead of repopulating the (now meaningless) head window
|
|
216
|
+
* — which would otherwise reorder content and trip the middle-elision
|
|
217
|
+
* branch in `dump()` against stale totals.
|
|
218
|
+
*/
|
|
219
|
+
replace(text: string): void;
|
|
220
|
+
dump(notice?: string): Promise<OutputSummary>;
|
|
221
|
+
/**
|
|
222
|
+
* Release the artifact spill descriptor on an exit path that skips
|
|
223
|
+
* {@link dump} — a thrown error or abort. Idempotent and safe in a
|
|
224
|
+
* `finally`: if {@link dump} already ran this is a no-op, otherwise it
|
|
225
|
+
* flushes the capped tail and closes the sink so the descriptor is not
|
|
226
|
+
* leaked until a later unrelated read hits `EMFILE` (issue #6463).
|
|
227
|
+
*/
|
|
228
|
+
dispose(): Promise<void>;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Format a truncation notice for tail-truncated output (bash, python, ssh).
|
|
232
|
+
* Returns empty string if not truncated.
|
|
233
|
+
*/
|
|
234
|
+
export declare function formatTailTruncationNotice(truncation: TruncationResult, options?: TailTruncationNoticeOptions): string;
|
|
235
|
+
/**
|
|
236
|
+
* Format a truncation notice for head-truncated output (read tool).
|
|
237
|
+
* Returns empty string if not truncated.
|
|
238
|
+
*/
|
|
239
|
+
export declare function formatHeadTruncationNotice(truncation: TruncationResult, options?: HeadTruncationNoticeOptions): string;
|
|
240
|
+
/**
|
|
241
|
+
* Build an onChunk handler that appends to a TailBuffer and emits a streaming
|
|
242
|
+
* update (when `onUpdate` is defined) with the buffer's current text.
|
|
243
|
+
*/
|
|
244
|
+
export declare function streamTailUpdates<TDetails, TInput = unknown>(tailBuffer: TailBuffer, onUpdate: AgentToolUpdateCallback<TDetails, TInput> | undefined): (chunk: string) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Default agent used when a session has unrestricted spawning. */
|
|
2
|
+
export declare const DEFAULT_SPAWN_AGENT = "task";
|
|
3
|
+
/** Spawn policy derived from a parent agent's `spawns` frontmatter. */
|
|
4
|
+
export interface ResolvedSpawnPolicy {
|
|
5
|
+
/** True when at least one subagent may be spawned. */
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/** Agent used when the caller omits the agent field. */
|
|
8
|
+
defaultAgent: string;
|
|
9
|
+
/** Explicitly allowed agents, or `null` when the policy is unrestricted. */
|
|
10
|
+
allowedAgents: readonly string[] | null;
|
|
11
|
+
/** Text used in spawn rejection messages. */
|
|
12
|
+
allowedErrorText: string;
|
|
13
|
+
/** Backtick-quoted explicit agents for prompt descriptions. */
|
|
14
|
+
allowedPromptText?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Resolves spawn frontmatter into the default and prompt/error surfaces. */
|
|
17
|
+
export declare function resolveSpawnPolicy(parentSpawns: string | boolean | null | undefined): ResolvedSpawnPolicy;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the `scout` agent is spawnable in a session: not disabled via
|
|
20
|
+
* `task.disabledAgents`, and permitted by the session spawn policy.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isScoutSpawnable(disabledAgents: readonly string[] | undefined, spawns: string | boolean | null | undefined): boolean;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool approval resolution.
|
|
3
|
+
*
|
|
4
|
+
* Approval policy is declared by each tool. This module only knows how to:
|
|
5
|
+
* - normalize user `tools.approval.<tool>: allow | deny | prompt` overrides,
|
|
6
|
+
* - compare a tool capability tier against the active approval mode,
|
|
7
|
+
* - format the generic approval prompt body.
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentTool, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
10
|
+
export type { ToolApproval, ToolApprovalDecision, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
11
|
+
export type ApprovalPolicy = "allow" | "deny" | "prompt";
|
|
12
|
+
export type ApprovalMode = "always-ask" | "write" | "yolo";
|
|
13
|
+
type ApprovalSubject = Pick<AgentTool, "name" | "approval" | "formatApprovalDetails">;
|
|
14
|
+
export interface ResolvedApproval {
|
|
15
|
+
policy: ApprovalPolicy;
|
|
16
|
+
tier: ToolTier;
|
|
17
|
+
reason?: string;
|
|
18
|
+
override: boolean;
|
|
19
|
+
source?: "tool" | "user" | "mode";
|
|
20
|
+
/** User-policy key that produced `source: "user"` (defaults to the tool name). */
|
|
21
|
+
policyKey?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Evaluate a tool's own approval declaration against `args` and return the
|
|
25
|
+
* resulting capability tier, defaulting to `exec` when the tool omits an
|
|
26
|
+
* approval. Unlike reading `tool.approval` directly, this runs function-valued
|
|
27
|
+
* approvals — the write tool's `xd://` gate uses it to take a mounted device's
|
|
28
|
+
* argument-dependent tier instead of falling back to `exec`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveToolTier(tool: ApprovalSubject, args: unknown): ToolTier;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve approval policy for a tool call.
|
|
33
|
+
*
|
|
34
|
+
* Resolution order:
|
|
35
|
+
* 1. Tool `approval(args)` decision, defaulting to tier "exec" when omitted.
|
|
36
|
+
* A decision may carry a `policyKey` — `tools.approval.<policyKey>` is then
|
|
37
|
+
* the user override consulted instead of `tools.approval.<tool.name>`, with
|
|
38
|
+
* the invoking tool's own policy as the fallback when the user set none for
|
|
39
|
+
* the keyed sub-tool (e.g. an `xd://` device dispatch without a device
|
|
40
|
+
* policy still honors `tools.approval.write`).
|
|
41
|
+
* 2. User per-tool override, if set and valid.
|
|
42
|
+
* 3. Active mode tier comparison.
|
|
43
|
+
*
|
|
44
|
+
* In yolo mode, override-based tool prompts are ignored; user `tools.approval`
|
|
45
|
+
* settings remain authoritative.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveApproval(tool: ApprovalSubject, args: unknown, mode: ApprovalMode, userConfig?: Record<string, unknown>): ResolvedApproval;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a tool call requires user approval.
|
|
50
|
+
*
|
|
51
|
+
* @throws Error if policy is 'deny'
|
|
52
|
+
* @returns Object with required flag and optional reason for the prompt
|
|
53
|
+
*/
|
|
54
|
+
export declare function requiresApproval(tool: ApprovalSubject, args: unknown, mode: ApprovalMode, userConfig?: Record<string, unknown>): {
|
|
55
|
+
required: boolean;
|
|
56
|
+
reason?: string;
|
|
57
|
+
};
|
|
58
|
+
export declare function truncateForPrompt(value: string, maxChars?: number): string;
|
|
59
|
+
/**
|
|
60
|
+
* Format the approval prompt body shown to the user.
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatApprovalPrompt(tool: ApprovalSubject, args: unknown, reason?: string): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { ToolExample } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { ToolSession } from "../sdk";
|
|
4
|
+
import type { OutputMeta } from "../../omp/tools/output-meta.ts";
|
|
5
|
+
declare const astEditSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
6
|
+
paths: string[];
|
|
7
|
+
ops: {
|
|
8
|
+
out: string;
|
|
9
|
+
pat: string;
|
|
10
|
+
}[];
|
|
11
|
+
}, {
|
|
12
|
+
paths: string[];
|
|
13
|
+
ops: {
|
|
14
|
+
out: string;
|
|
15
|
+
pat: string;
|
|
16
|
+
}[];
|
|
17
|
+
}>;
|
|
18
|
+
export interface AstEditToolDetails {
|
|
19
|
+
totalReplacements: number;
|
|
20
|
+
filesTouched: number;
|
|
21
|
+
filesSearched: number;
|
|
22
|
+
applied: boolean;
|
|
23
|
+
limitReached: boolean;
|
|
24
|
+
parseErrors?: string[];
|
|
25
|
+
/** Total parse error count before {@link PARSE_ERRORS_LIMIT} capping. Omitted when no errors. */
|
|
26
|
+
parseErrorsTotal?: number;
|
|
27
|
+
scopePath?: string;
|
|
28
|
+
files?: string[];
|
|
29
|
+
fileReplacements?: Array<{
|
|
30
|
+
path: string;
|
|
31
|
+
count: number;
|
|
32
|
+
}>;
|
|
33
|
+
meta?: OutputMeta;
|
|
34
|
+
/** Pre-formatted text for the user-visible TUI render. Mirrors `result.text` lines but uses
|
|
35
|
+
* a `│` gutter (no model-only hashline anchors). The TUI uses this directly so it never parses model-facing text. */
|
|
36
|
+
displayContent?: string;
|
|
37
|
+
/** Absolute base directory used during the edit. Used by the renderer to resolve
|
|
38
|
+
* display-relative paths to absolute paths for OSC 8 hyperlinks. */
|
|
39
|
+
searchPath?: string;
|
|
40
|
+
/** Session cwd at edit time. Display header paths are cwd-relative, so the
|
|
41
|
+
* renderer resolves them against this; `searchPath` is the scope target. */
|
|
42
|
+
cwd?: string;
|
|
43
|
+
}
|
|
44
|
+
type AstEditSchemaInfer = typeof astEditSchema.infer;
|
|
45
|
+
export declare class AstEditTool implements AgentTool<typeof astEditSchema, AstEditToolDetails> {
|
|
46
|
+
private readonly session;
|
|
47
|
+
readonly name = "ast_edit";
|
|
48
|
+
readonly approval: (args: unknown) => "read" | "write";
|
|
49
|
+
readonly formatApprovalDetails: (args: unknown) => string[];
|
|
50
|
+
readonly label = "AST Edit";
|
|
51
|
+
readonly summary = "Perform AST-aware code edits (structural refactoring)";
|
|
52
|
+
readonly description: string;
|
|
53
|
+
readonly parameters: import("@oh-my-pi/omptype").FluentType<{
|
|
54
|
+
paths: string[];
|
|
55
|
+
ops: {
|
|
56
|
+
out: string;
|
|
57
|
+
pat: string;
|
|
58
|
+
}[];
|
|
59
|
+
}, {
|
|
60
|
+
paths: string[];
|
|
61
|
+
ops: {
|
|
62
|
+
out: string;
|
|
63
|
+
pat: string;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
readonly strict = true;
|
|
67
|
+
readonly examples: readonly ToolExample<AstEditSchemaInfer>[];
|
|
68
|
+
readonly deferrable = true;
|
|
69
|
+
readonly loadMode = "discoverable";
|
|
70
|
+
constructor(session: ToolSession);
|
|
71
|
+
execute(_toolCallId: string, params: AstEditSchemaInfer, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AstEditToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AstEditToolDetails>>;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { ToolExample } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { ToolSession } from "../sdk";
|
|
4
|
+
import type { OutputMeta } from "../../omp/tools/output-meta.ts";
|
|
5
|
+
declare const astGrepSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
6
|
+
pat: string;
|
|
7
|
+
path?: string | undefined;
|
|
8
|
+
skip?: number | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
pat: string;
|
|
11
|
+
path?: string | undefined;
|
|
12
|
+
skip?: number | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export interface AstGrepToolDetails {
|
|
15
|
+
matchCount: number;
|
|
16
|
+
fileCount: number;
|
|
17
|
+
filesSearched: number;
|
|
18
|
+
limitReached: boolean;
|
|
19
|
+
parseErrors?: string[];
|
|
20
|
+
/** Total parse error count before {@link PARSE_ERRORS_LIMIT} capping. Omitted when no errors. */
|
|
21
|
+
parseErrorsTotal?: number;
|
|
22
|
+
scopePath?: string;
|
|
23
|
+
files?: string[];
|
|
24
|
+
fileMatches?: Array<{
|
|
25
|
+
path: string;
|
|
26
|
+
count: number;
|
|
27
|
+
}>;
|
|
28
|
+
meta?: OutputMeta;
|
|
29
|
+
/** Pre-formatted text for the user-visible TUI render. Mirrors `result.text` lines but uses
|
|
30
|
+
* a `│` gutter and `*` to mark match lines. The TUI uses this directly so it never parses model-facing text. */
|
|
31
|
+
displayContent?: string;
|
|
32
|
+
/** Absolute base directory used during search. Used by the renderer to resolve
|
|
33
|
+
* display-relative paths to absolute paths for OSC 8 hyperlinks. */
|
|
34
|
+
searchPath?: string;
|
|
35
|
+
/** Session cwd at search time. Display header/match paths are cwd-relative, so
|
|
36
|
+
* the renderer resolves them against this; `searchPath` is the scope target. */
|
|
37
|
+
cwd?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare class AstGrepTool implements AgentTool<typeof astGrepSchema, AstGrepToolDetails> {
|
|
40
|
+
private readonly session;
|
|
41
|
+
readonly name = "ast_grep";
|
|
42
|
+
readonly approval: "read";
|
|
43
|
+
readonly label = "AST Grep";
|
|
44
|
+
readonly summary = "Search code with AST patterns (structural grep)";
|
|
45
|
+
get description(): string;
|
|
46
|
+
readonly parameters: import("@oh-my-pi/omptype").FluentType<{
|
|
47
|
+
pat: string;
|
|
48
|
+
path?: string | undefined;
|
|
49
|
+
skip?: number | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
pat: string;
|
|
52
|
+
path?: string | undefined;
|
|
53
|
+
skip?: number | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
readonly strict = true;
|
|
56
|
+
readonly examples: readonly ToolExample<typeof astGrepSchema.inferIn>[];
|
|
57
|
+
readonly loadMode = "discoverable";
|
|
58
|
+
constructor(session: ToolSession);
|
|
59
|
+
execute(_toolCallId: string, params: typeof astGrepSchema.infer, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<AstGrepToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<AstGrepToolDetails>>;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Settings } from "../config/settings.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Check if a file is auto-generated by examining its content.
|
|
4
|
+
* Throws ToolError if the file appears to be auto-generated.
|
|
5
|
+
*
|
|
6
|
+
* @param absolutePath - Absolute path to the file
|
|
7
|
+
* @param displayPath - Path to show in error messages (relative or as provided)
|
|
8
|
+
* @param activeSettings - Session settings; falls back to global settings or the schema default
|
|
9
|
+
*/
|
|
10
|
+
export declare function assertEditableFile(absolutePath: string, displayPath?: string, activeSettings?: Settings): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Check if file content is auto-generated.
|
|
13
|
+
* Uses only the first CHECK_BYTE_COUNT characters of the content.
|
|
14
|
+
* Throws ToolError if the content appears to be auto-generated.
|
|
15
|
+
*
|
|
16
|
+
* @param content - File content to check (can be full content or prefix)
|
|
17
|
+
* @param displayPath - Path to show in error messages
|
|
18
|
+
* @param activeSettings - Session settings; falls back to global settings or the schema default
|
|
19
|
+
*/
|
|
20
|
+
export declare function assertEditableFileContent(content: string, displayPath: string, activeSettings?: Settings): void;
|