@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,27 @@
|
|
|
1
|
+
import type { LineRange } from "../../omp/tools/path-utils.ts";
|
|
2
|
+
/** Parsed representation of a path-embedded selector. */
|
|
3
|
+
export type ParsedSelector = {
|
|
4
|
+
kind: "none";
|
|
5
|
+
} | {
|
|
6
|
+
kind: "raw";
|
|
7
|
+
} | {
|
|
8
|
+
kind: "conflicts";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "lines";
|
|
11
|
+
ranges: [LineRange, ...LineRange[]];
|
|
12
|
+
raw?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Returns true when the selector requested verbatim/raw output (alone or combined with a range). */
|
|
15
|
+
export declare function isRawSelector(parsed: ParsedSelector): boolean;
|
|
16
|
+
/** Returns true when the selector requested multiple line ranges. */
|
|
17
|
+
export declare function isMultiRange(parsed: ParsedSelector): boolean;
|
|
18
|
+
export declare function parseSel(sel: string | undefined): ParsedSelector;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a single-range selector to the offset/limit pair used by internal pagination.
|
|
21
|
+
* Returns the FIRST range only — multi-range callers MUST branch on `isMultiRange` before
|
|
22
|
+
* calling this helper.
|
|
23
|
+
*/
|
|
24
|
+
export declare function selToOffsetLimit(parsed: ParsedSelector): {
|
|
25
|
+
offset?: number;
|
|
26
|
+
limit?: number;
|
|
27
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { ToolSession } from "../../omp/sdk.ts";
|
|
3
|
+
import type { ReadToolDetails } from "./read";
|
|
4
|
+
import { type SuffixMatchCache } from "./read-path-resolution";
|
|
5
|
+
interface ResolvedSqliteReadPath {
|
|
6
|
+
absolutePath: string;
|
|
7
|
+
sqliteSubPath: string;
|
|
8
|
+
queryString: string;
|
|
9
|
+
suffixResolution?: {
|
|
10
|
+
from: string;
|
|
11
|
+
to: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function resolveSqliteReadPath(session: ToolSession, readPath: string, suffixCache: SuffixMatchCache, signal?: AbortSignal): Promise<ResolvedSqliteReadPath | null>;
|
|
15
|
+
export declare function readSqlite(resolvedSqlitePath: ResolvedSqliteReadPath, signal?: AbortSignal): Promise<AgentToolResult<ReadToolDetails>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type SummaryResult } from "@oh-my-pi/pi-natives";
|
|
2
|
+
import type { ToolSession } from "../../omp/sdk.ts";
|
|
3
|
+
import { type ElidedRange } from "./read-format";
|
|
4
|
+
/**
|
|
5
|
+
* Prose files (Markdown flavors and plain text) skip code-block summarization
|
|
6
|
+
* unless `read.summarize.prose` opts them in.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isProseSummaryPath(filePath: string): boolean;
|
|
9
|
+
export declare function trySummarize(session: ToolSession, absolutePath: string, fileSize: number, signal?: AbortSignal): Promise<SummaryResult | null>;
|
|
10
|
+
export declare function renderSummary(session: ToolSession, summary: SummaryResult): {
|
|
11
|
+
text: string;
|
|
12
|
+
displayText: string;
|
|
13
|
+
elidedRanges: ElidedRange[];
|
|
14
|
+
elidedLines: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolTier } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { ToolSession } from "../../omp/sdk.ts";
|
|
3
|
+
import { type TruncationResult } from "../../omp/session/streaming-output.ts";
|
|
4
|
+
import { type OutputMeta } from "../../omp/tools/output-meta.ts";
|
|
5
|
+
declare const readSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
6
|
+
path: string;
|
|
7
|
+
}, {
|
|
8
|
+
path: string;
|
|
9
|
+
}>;
|
|
10
|
+
export type ReadToolInput = typeof readSchema.infer;
|
|
11
|
+
export interface ReadToolDetails {
|
|
12
|
+
kind?: "file" | "url";
|
|
13
|
+
truncation?: TruncationResult;
|
|
14
|
+
isDirectory?: boolean;
|
|
15
|
+
resolvedPath?: string;
|
|
16
|
+
suffixResolution?: {
|
|
17
|
+
from: string;
|
|
18
|
+
to: string;
|
|
19
|
+
};
|
|
20
|
+
/** DSH image bridge (拍板#22): committed attachment facts for an image read. */
|
|
21
|
+
image?: import("../../shared/image-bridge.ts").SavedImageRef;
|
|
22
|
+
url?: string;
|
|
23
|
+
finalUrl?: string;
|
|
24
|
+
contentType?: string;
|
|
25
|
+
method?: string;
|
|
26
|
+
notes?: string[];
|
|
27
|
+
meta?: OutputMeta;
|
|
28
|
+
/** Full on-disk byte size recorded before applying a file range. */
|
|
29
|
+
fileSize?: number;
|
|
30
|
+
/** Full source line count when the read reached EOF and the count is exact. */
|
|
31
|
+
totalLines?: number;
|
|
32
|
+
/** Raw text + start line for user-visible TUI rendering, set when content is text-like.
|
|
33
|
+
* Mirrors the same lines the model receives but without hashline/line-number prefixes,
|
|
34
|
+
* so the TUI can render the file content with its own gutter without re-parsing the formatted text. */
|
|
35
|
+
displayContent?: {
|
|
36
|
+
text: string;
|
|
37
|
+
startLine: number;
|
|
38
|
+
lineNumbers?: Array<number | null>;
|
|
39
|
+
};
|
|
40
|
+
summary?: {
|
|
41
|
+
lines: number;
|
|
42
|
+
elidedSpans: number;
|
|
43
|
+
elidedLines: number;
|
|
44
|
+
};
|
|
45
|
+
/** Number of unresolved git conflicts surfaced by this read (TUI uses for inline `⚠ N` badge). */
|
|
46
|
+
conflictCount?: number;
|
|
47
|
+
/** Paths recovered from a delimited read argument; used only by the TUI to render one call as multiple read rows. */
|
|
48
|
+
displayReadTargets?: string[];
|
|
49
|
+
}
|
|
50
|
+
type ReadParams = ReadToolInput;
|
|
51
|
+
/**
|
|
52
|
+
* Read tool implementation.
|
|
53
|
+
*
|
|
54
|
+
* Reads files with support for images, converted documents (via markit), and text.
|
|
55
|
+
* Directories return a formatted listing with modification times.
|
|
56
|
+
*/
|
|
57
|
+
export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDetails> {
|
|
58
|
+
#private;
|
|
59
|
+
private readonly session;
|
|
60
|
+
readonly name = "read";
|
|
61
|
+
readonly approval: (args: unknown) => ToolTier;
|
|
62
|
+
readonly label = "Read";
|
|
63
|
+
readonly loadMode = "essential";
|
|
64
|
+
description: string;
|
|
65
|
+
get parameters(): typeof readSchema;
|
|
66
|
+
readonly strict = true;
|
|
67
|
+
constructor(session: ToolSession);
|
|
68
|
+
execute(_toolCallId: string, params: ReadParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<ReadToolDetails>, _toolContext?: AgentToolContext): Promise<AgentToolResult<ReadToolDetails>>;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting helpers shared by the tool engines.
|
|
3
|
+
*
|
|
4
|
+
* The TUI renderer utilities that used to live here were cut with the TUI
|
|
5
|
+
* layer (plan.md 拍板#17); what remains is what the engines themselves use.
|
|
6
|
+
*/
|
|
7
|
+
export { replaceTabs, truncateToWidth } from "@oh-my-pi/pi-tui";
|
|
8
|
+
export { formatAge, formatBytes, formatCount, formatDuration, pluralize } from "@oh-my-pi/pi-utils";
|
|
9
|
+
/**
|
|
10
|
+
* Extract domain from URL, stripping www. prefix.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDomain(url: string): string;
|
|
13
|
+
export declare function shortenPath(filePath: unknown, homeDir?: string): string;
|
|
14
|
+
export type CodeFrameMarker = "" | " " | "*" | "+" | "-" | ">";
|
|
15
|
+
export declare function formatCodeFrameLine(marker: CodeFrameMarker, lineNumber: string | number, content: string, lineNumberWidth: number): string;
|
|
16
|
+
export declare const PARSE_ERRORS_LIMIT = 20;
|
|
17
|
+
export declare function dedupeParseErrors(errors: string[] | undefined): string[];
|
|
18
|
+
export declare function formatParseErrors(errors: string[], total?: number): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Cap an upstream parse-error list to {@link PARSE_ERRORS_LIMIT} unique entries,
|
|
21
|
+
* preserving the original deduplicated total. Use this at the source so tool
|
|
22
|
+
* details never carry thousands of per-file parse errors into traces or
|
|
23
|
+
* renderers.
|
|
24
|
+
*/
|
|
25
|
+
export declare function capParseErrors(errors: string[] | undefined, limit?: number): {
|
|
26
|
+
errors: string[];
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* report_issue — automated QA backend for tracking unexpected tool behavior.
|
|
3
|
+
*
|
|
4
|
+
* No model-facing tool schema anymore: the write tool dispatches plain text to
|
|
5
|
+
* `xd://report_issue`, and the system prompt tells the model to write
|
|
6
|
+
* `<tool>: <concise description>` there when auto-QA is enabled.
|
|
7
|
+
*
|
|
8
|
+
* Enabled by default (`dev.autoqa` defaults to true); `PI_AUTO_QA=0` or an
|
|
9
|
+
* explicit `dev.autoqa: false` short-circuits injection entirely. When the
|
|
10
|
+
* user is only enabled by default (never configured `dev.autoqa` themselves),
|
|
11
|
+
* a persisted `dev.autoqaConsent: "denied"` also disables injection so a "No"
|
|
12
|
+
* in the consent dialog fully turns the feature off.
|
|
13
|
+
* Records grievances to a local SQLite database; never throws from the device
|
|
14
|
+
* dispatch path.
|
|
15
|
+
*
|
|
16
|
+
* Nothing is written until consent resolves. If the user has never been asked
|
|
17
|
+
* (`dev.autoqaConsent === "unset"`) the process-global consent handler —
|
|
18
|
+
* wired by `InteractiveMode` to a Yes/No popup — is invoked exactly once and
|
|
19
|
+
* the decision is persisted; a denial (or dismissal) drops the pending report
|
|
20
|
+
* without touching the database. Subsequent calls (including from subagents)
|
|
21
|
+
* read the cached decision without prompting. `PI_AUTO_QA_PUSH=1` bypasses
|
|
22
|
+
* the dialog for headless environments.
|
|
23
|
+
*
|
|
24
|
+
* When the user grants consent, push is automatically active against the
|
|
25
|
+
* bundled endpoint (`dev.autoqaPush.endpoint`, default `qa.omp.sh`). Each
|
|
26
|
+
* insert schedules a background flush that POSTs pending rows and deletes them
|
|
27
|
+
* on HTTP 2xx. `PI_AUTO_QA_PUSH=1` forces push in non-interactive environments
|
|
28
|
+
* where the consent dialog never fires. Device execution is never blocked on
|
|
29
|
+
* the network and never throws.
|
|
30
|
+
*/
|
|
31
|
+
import { Database } from "bun:sqlite";
|
|
32
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
33
|
+
import type { FetchImpl } from "@oh-my-pi/pi-ai";
|
|
34
|
+
import type { Settings } from "../config/settings";
|
|
35
|
+
import type { ToolSession } from "./index";
|
|
36
|
+
import type { XdevDispatch } from "./resolve";
|
|
37
|
+
export declare const REPORT_ISSUE_DEVICE_NAME = "report_issue";
|
|
38
|
+
export declare const REPORT_ISSUE_DEVICE_PATH = "xd://report_issue";
|
|
39
|
+
/** Usage text for `read xd://report_issue`. */
|
|
40
|
+
export declare function reportIssueDeviceUsage(): string;
|
|
41
|
+
/** Whether a tool call writes to `xd://report_issue`. */
|
|
42
|
+
export declare function isReportIssueToolCall(toolCall: {
|
|
43
|
+
name: string;
|
|
44
|
+
arguments?: Record<string, unknown>;
|
|
45
|
+
}): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether Auto-QA is active for this session.
|
|
48
|
+
*
|
|
49
|
+
* Precedence: `PI_AUTO_QA` env flag > explicit `dev.autoqa` setting >
|
|
50
|
+
* default-on unless the user previously denied consent. The denial veto only
|
|
51
|
+
* applies to the default: explicitly configuring `dev.autoqa: true` re-enables
|
|
52
|
+
* injection (recording still no-ops until consent is granted).
|
|
53
|
+
*/
|
|
54
|
+
export declare function isAutoQaEnabled(settings?: Settings): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Resolver for the user's "share grievances?" consent.
|
|
57
|
+
*
|
|
58
|
+
* Return values:
|
|
59
|
+
* - `true` — user agreed; record + ship for this run and persist.
|
|
60
|
+
* - `false` — user declined; suppress for this run and persist.
|
|
61
|
+
* - `null` — user dismissed the dialog (ESC, click-away, …) without
|
|
62
|
+
* picking an option. The decision is NOT cached or persisted,
|
|
63
|
+
* so the next `report_issue` invocation re-prompts.
|
|
64
|
+
*
|
|
65
|
+
* Persistence is the tool's job (so subagent invocations can persist into the
|
|
66
|
+
* disk-backed `Settings` instance the host registered alongside the handler),
|
|
67
|
+
* not the handler's. Implementations live in hosts that have UI affordances —
|
|
68
|
+
* today only `InteractiveMode`. When no handler is registered (CLI subcommands,
|
|
69
|
+
* tests, non-interactive runs) consent defaults to `false` — the explicit
|
|
70
|
+
* "don't collect by default" stance.
|
|
71
|
+
*/
|
|
72
|
+
export type AutoQaConsentHandler = () => Promise<boolean | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Register the consent handler and the persistent {@link Settings} instance
|
|
75
|
+
* the decision should be written to. Passing `null` clears the handler
|
|
76
|
+
* (e.g. on `InteractiveMode` teardown). Re-registration is authoritative.
|
|
77
|
+
*/
|
|
78
|
+
export declare function setAutoQaConsentHandler(handler: AutoQaConsentHandler | null, persistentSettings?: Settings | null): void;
|
|
79
|
+
/** Test-only: clear consent cache + handler. Never call from production code. */
|
|
80
|
+
export declare function __resetAutoQaConsentForTests(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Resolve the user's consent for Auto-QA grievances.
|
|
83
|
+
*
|
|
84
|
+
* Priority:
|
|
85
|
+
* 1. module cache (`cachedConsent`) — process-global, survives subagent boundaries
|
|
86
|
+
* 2. persisted setting on the caller's `Settings`
|
|
87
|
+
* 3. persisted setting on the registered persistent settings instance
|
|
88
|
+
* 4. registered UI handler (single-flight)
|
|
89
|
+
* 5. default `false` (no handler / non-interactive)
|
|
90
|
+
*/
|
|
91
|
+
export declare function resolveAutoQaConsent(settings: Settings | undefined): Promise<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* Open (or return the cached handle for) the auto-QA SQLite database at
|
|
94
|
+
* `~/.omp/autoqa.db` (XDG: `$XDG_DATA_HOME/omp/autoqa.db`), creating the
|
|
95
|
+
* schema lazily. Returns `null` when the path cannot be resolved or opened.
|
|
96
|
+
*/
|
|
97
|
+
export declare function openAutoQaDb(): Database | null;
|
|
98
|
+
export interface FlushResult {
|
|
99
|
+
pushed: number;
|
|
100
|
+
ok: boolean;
|
|
101
|
+
skipped?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Optional per-flush controls. Used by `omp grievances push` to surface
|
|
105
|
+
* progress to a TTY and to skip the user-facing consent gate (manual
|
|
106
|
+
* pushes are the user's explicit intent, not a side effect of a device write).
|
|
107
|
+
*/
|
|
108
|
+
export interface FlushOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Skip the `dev.autoqaConsent === "granted"` gate in
|
|
111
|
+
* {@link resolvePushConfig}. Endpoint configuration is still required.
|
|
112
|
+
* Reserved for explicit user-driven pushes (CLI `grievances push`,
|
|
113
|
+
* future debug recipes); never set from the device's auto-flush path.
|
|
114
|
+
*/
|
|
115
|
+
bypassConsent?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Fetch implementation for the push POST. Defaults to global fetch.
|
|
118
|
+
*/
|
|
119
|
+
fetch?: FetchImpl;
|
|
120
|
+
/**
|
|
121
|
+
* Fires once at the start of the loop with the snapshot count of
|
|
122
|
+
* unpushed rows. Subsequent inserts won't be reflected (the count is
|
|
123
|
+
* a planning hint for progress reporters, not a live total).
|
|
124
|
+
*/
|
|
125
|
+
onStart?: (totalUnpushed: number) => void;
|
|
126
|
+
/**
|
|
127
|
+
* Fires after every successfully shipped batch with the running pushed
|
|
128
|
+
* count. Reporters compare against the `totalUnpushed` they saw in
|
|
129
|
+
* `onStart` to advance their bar.
|
|
130
|
+
*/
|
|
131
|
+
onProgress?: (pushedSoFar: number) => void;
|
|
132
|
+
}
|
|
133
|
+
/** Test-only: clear single-flight + cooldown state. Never call from production code. */
|
|
134
|
+
export declare function __resetAutoQaFlushStateForTests(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Flush queued grievances to the configured backend.
|
|
137
|
+
*/
|
|
138
|
+
export declare function flushGrievances(db?: Database, settings?: Settings, options?: FlushOptions): Promise<FlushResult>;
|
|
139
|
+
/** Test-only: await the last consent → insert → flush pipeline. */
|
|
140
|
+
export declare function __awaitAutoQaRecordPipelineForTests(): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Execute `write xd://report_issue`. `text` must be either:
|
|
143
|
+
* - `<tool>: <concise description>` on one line, or
|
|
144
|
+
* - tool name on the first line with the report body below.
|
|
145
|
+
*/
|
|
146
|
+
export declare function dispatchReportIssueDevice(session: ToolSession, text: string): Promise<{
|
|
147
|
+
result: AgentToolResult<unknown>;
|
|
148
|
+
xdev: XdevDispatch;
|
|
149
|
+
}>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolution devices: staged work is finalized through plain-text writes to
|
|
3
|
+
* always-available `xd://` URLs — no tool schema, no JSON protocol.
|
|
4
|
+
*
|
|
5
|
+
* write xd://resolve reason text → APPLY the pending staged preview
|
|
6
|
+
* write xd://reject reason text → DISCARD the pending staged preview
|
|
7
|
+
* write xd://propose plan <slug> → submit the plan for approval (plan mode)
|
|
8
|
+
*
|
|
9
|
+
* Nothing rides the system prompt: the flows that stage work teach the call
|
|
10
|
+
* shape at the moment it becomes relevant (the preview reminder for
|
|
11
|
+
* resolve/reject, the plan-mode prompt for propose).
|
|
12
|
+
*
|
|
13
|
+
* Rendering rides the write tool's xd:// delegation: renderers.ts keys the
|
|
14
|
+
* resolve renderer under `resolve` and `reject` so device writes and legacy
|
|
15
|
+
* `resolve` tool transcripts draw the same block.
|
|
16
|
+
*/
|
|
17
|
+
import type { AgentToolResult, CustomMessage } from "@oh-my-pi/pi-agent-core";
|
|
18
|
+
import type { ToolSession } from ".";
|
|
19
|
+
import type { ToolTier } from "./approval";
|
|
20
|
+
/**
|
|
21
|
+
* Dispatch metadata carried on write-tool details for renderer delegation.
|
|
22
|
+
* (原 xdev.ts 的类型面;挂载设备层已随拍板剔除,仅 resolution/report_issue
|
|
23
|
+
* 设备继续在 write details 上携带此元数据。)
|
|
24
|
+
*/
|
|
25
|
+
export interface XdevDispatch {
|
|
26
|
+
tool: string;
|
|
27
|
+
mode: "help" | "execute";
|
|
28
|
+
/** Validated inner args, kept for renderer delegation on result rebuilds. */
|
|
29
|
+
args?: Record<string, unknown>;
|
|
30
|
+
/** Approval tier of the wrapped device call (`read` = no workspace mutation). */
|
|
31
|
+
tier?: ToolTier;
|
|
32
|
+
/** Details object returned by the wrapped tool, when executed. */
|
|
33
|
+
inner?: unknown;
|
|
34
|
+
}
|
|
35
|
+
export declare const RESOLVE_DEVICE_NAME = "resolve";
|
|
36
|
+
export declare const REJECT_DEVICE_NAME = "reject";
|
|
37
|
+
export declare const PROPOSE_DEVICE_NAME = "propose";
|
|
38
|
+
/** The plain-text resolution device URLs (`xd://resolve`, …). */
|
|
39
|
+
export declare const RESOLVE_DEVICE_PATH = "xd://resolve";
|
|
40
|
+
export declare const REJECT_DEVICE_PATH = "xd://reject";
|
|
41
|
+
export declare const PROPOSE_DEVICE_PATH = "xd://propose";
|
|
42
|
+
/**
|
|
43
|
+
* Model-visible banner prepended to a staged preview's tool result text. The
|
|
44
|
+
* TUI badge (`⟨proposed⟩`) never reaches the model, and preview diffs are
|
|
45
|
+
* byte-identical to applied-edit output — without this line the model reads
|
|
46
|
+
* the result as an already-applied change.
|
|
47
|
+
*/
|
|
48
|
+
export declare const PREVIEW_PENDING_NOTICE = "Staged as a proposal \u2014 files NOT modified yet. To apply: write a one-sentence reason to xd://resolve. To discard: write to xd://reject.";
|
|
49
|
+
export type ResolutionDeviceName = typeof RESOLVE_DEVICE_NAME | typeof REJECT_DEVICE_NAME | typeof PROPOSE_DEVICE_NAME;
|
|
50
|
+
/** Whether an xd:// device name is one of the plain-text resolution devices. */
|
|
51
|
+
export declare function isResolutionDeviceName(name: string): name is ResolutionDeviceName;
|
|
52
|
+
/** One-line usage string returned by `read xd://<device>` — the only "docs" these devices carry. */
|
|
53
|
+
export declare function resolutionDeviceUsage(device: ResolutionDeviceName): string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether an assistant tool call is a `write` targeting `xd://resolve` or
|
|
56
|
+
* `xd://reject`. Used as the SoftToolRequirement compliance check while a
|
|
57
|
+
* preview is pending — a plain `write` elsewhere resolves nothing.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isPreviewResolutionToolCall(toolCall: {
|
|
60
|
+
name: string;
|
|
61
|
+
arguments?: Record<string, unknown>;
|
|
62
|
+
}): boolean;
|
|
63
|
+
/** Whether an assistant tool call is a `write` targeting `xd://propose` (plan-mode decision detection). */
|
|
64
|
+
export declare function isProposeToolCall(toolCall: {
|
|
65
|
+
name: string;
|
|
66
|
+
arguments?: Record<string, unknown>;
|
|
67
|
+
}): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The XdevDispatch metadata carried on a completed `write` execution result, or
|
|
70
|
+
* `undefined` when the execution was not a device dispatch. Consumers check
|
|
71
|
+
* `.tool` (e.g. `PROPOSE_DEVICE_NAME` for plan-mode decision tracking and the
|
|
72
|
+
* event-controller's plan-approval hook).
|
|
73
|
+
*/
|
|
74
|
+
export declare function writeDeviceDispatch(toolName: string, result: unknown): XdevDispatch | undefined;
|
|
75
|
+
/** Handler installed by plan mode; `xd://propose` dispatches the written plan title to it. */
|
|
76
|
+
export type PlanProposalHandler = (title: string) => Promise<AgentToolResult<unknown>>;
|
|
77
|
+
type ResolveAction = "apply" | "discard";
|
|
78
|
+
/** Details payload carried on a resolve/reject dispatch result (`XdevDispatch.inner`). */
|
|
79
|
+
export interface ResolveDetails {
|
|
80
|
+
action: ResolveAction;
|
|
81
|
+
reason: string;
|
|
82
|
+
sourceToolName?: string;
|
|
83
|
+
label?: string;
|
|
84
|
+
sourceResultDetails?: unknown;
|
|
85
|
+
}
|
|
86
|
+
/** Parse a completed `write` dispatch targeting `xd://resolve` or `xd://reject`. */
|
|
87
|
+
export declare function resolveDispatchDetails(toolName: string, result: unknown): ResolveDetails | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Register a non-forcing resolve-protocol handler for a staged preview. Wraps the
|
|
90
|
+
* caller's apply/reject into an onInvoked closure and stores it on the tool-choice
|
|
91
|
+
* queue's pending-invoker registry under a UNIQUE id. A `write` to `xd://resolve`
|
|
92
|
+
* or `xd://reject` dispatches to it; the agent-loop's SoftToolRequirement
|
|
93
|
+
* lifecycle injects the preview reminder and escalates to a forced `write` only
|
|
94
|
+
* if the model declines — so a compliant turn pays ZERO tool_choice change (no
|
|
95
|
+
* prompt-cache messages-cache invalidation).
|
|
96
|
+
*
|
|
97
|
+
* This is the canonical entry point for any tool that wants preview/apply
|
|
98
|
+
* semantics. No session-level abstraction is needed: callers pass their
|
|
99
|
+
* apply/reject functions directly. Resolution requires the `write` tool to be
|
|
100
|
+
* active — the session's soft requirement names it.
|
|
101
|
+
*/
|
|
102
|
+
export declare function queueResolveHandler(session: ToolSession, options: {
|
|
103
|
+
label: string;
|
|
104
|
+
sourceToolName: string;
|
|
105
|
+
apply(reason: string): Promise<AgentToolResult<unknown>>;
|
|
106
|
+
reject?(reason: string): Promise<AgentToolResult<unknown> | undefined>;
|
|
107
|
+
}): void;
|
|
108
|
+
/**
|
|
109
|
+
* The canonical preview reminder. The resolve mechanism owns the wording; the
|
|
110
|
+
* agent-loop delivers it via the session's `SoftToolRequirement.reminder` (injected
|
|
111
|
+
* once per pending-preview head) instead of a host-side steer, so it lands as a
|
|
112
|
+
* stable mid-history append and never churns the cached prefix.
|
|
113
|
+
*/
|
|
114
|
+
export declare function buildResolveReminderMessage(sourceToolName: string): CustomMessage;
|
|
115
|
+
/**
|
|
116
|
+
* Execute a resolution-device write. `text` is the raw plain-text body:
|
|
117
|
+
* - `xd://resolve` / `xd://reject` → the reason; dispatches to the pending
|
|
118
|
+
* preview invoker (in-flight queue directive first).
|
|
119
|
+
* - `xd://propose` → the plan title; dispatches to the plan-proposal handler
|
|
120
|
+
* installed by plan mode.
|
|
121
|
+
*/
|
|
122
|
+
export declare function dispatchResolutionDevice(session: ToolSession, device: ResolutionDeviceName, text: string): Promise<{
|
|
123
|
+
result: AgentToolResult<unknown>;
|
|
124
|
+
xdev: XdevDispatch;
|
|
125
|
+
}>;
|
|
126
|
+
export {};
|
|
127
|
+
/** Streaming-safe call preview for a resolution-device write: `Resolve/Reject/Propose: <text>`. */
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
export declare function looksLikeSqlite(bytes: Uint8Array): boolean;
|
|
3
|
+
/** Row cap for raw `?q=` SQL — protects against `SELECT *` on multi-million-row tables. */
|
|
4
|
+
export declare const MAX_RAW_QUERY_ROWS = 1000;
|
|
5
|
+
export interface SqlitePathCandidate {
|
|
6
|
+
sqlitePath: string;
|
|
7
|
+
subPath: string;
|
|
8
|
+
queryString: string;
|
|
9
|
+
}
|
|
10
|
+
export type SqliteSelector = {
|
|
11
|
+
kind: "list";
|
|
12
|
+
} | {
|
|
13
|
+
kind: "schema";
|
|
14
|
+
table: string;
|
|
15
|
+
sampleLimit: number;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "row";
|
|
18
|
+
table: string;
|
|
19
|
+
key: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "query";
|
|
22
|
+
table: string;
|
|
23
|
+
limit: number;
|
|
24
|
+
offset: number;
|
|
25
|
+
order?: string;
|
|
26
|
+
where?: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "raw";
|
|
29
|
+
sql: string;
|
|
30
|
+
};
|
|
31
|
+
export type SqliteRowLookup = {
|
|
32
|
+
kind: "pk";
|
|
33
|
+
column: string;
|
|
34
|
+
type: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "rowid";
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Row count for a table in the listing.
|
|
40
|
+
* - `exact`: counted in full (the table is small enough to count cheaply).
|
|
41
|
+
* - `estimate`: the planner's `sqlite_stat1` figure; the table is too large to
|
|
42
|
+
* scan, so this may be stale.
|
|
43
|
+
* - `atLeast`: a lower bound; counting was capped before reaching the end.
|
|
44
|
+
*/
|
|
45
|
+
export type TableRowCount = {
|
|
46
|
+
kind: "exact";
|
|
47
|
+
rows: number;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "estimate";
|
|
50
|
+
rows: number;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "atLeast";
|
|
53
|
+
rows: number;
|
|
54
|
+
};
|
|
55
|
+
export interface SqliteTableSummary {
|
|
56
|
+
name: string;
|
|
57
|
+
count: TableRowCount;
|
|
58
|
+
}
|
|
59
|
+
export declare function parseSqlitePathCandidates(filePath: string): SqlitePathCandidate[];
|
|
60
|
+
export declare function isSqliteFile(absolutePath: string): Promise<boolean>;
|
|
61
|
+
export declare function parseSqliteSelector(subPath: string, queryString: string): SqliteSelector;
|
|
62
|
+
export declare function listTables(db: Database, options?: {
|
|
63
|
+
probeCap?: number;
|
|
64
|
+
}): SqliteTableSummary[];
|
|
65
|
+
export declare function getTableSchema(db: Database, table: string): string;
|
|
66
|
+
export declare function getTablePrimaryKey(db: Database, table: string): {
|
|
67
|
+
column: string;
|
|
68
|
+
type: string;
|
|
69
|
+
} | null;
|
|
70
|
+
export declare function resolveTableRowLookup(db: Database, table: string): SqliteRowLookup;
|
|
71
|
+
export declare function queryRows(db: Database, table: string, opts: {
|
|
72
|
+
limit: number;
|
|
73
|
+
offset: number;
|
|
74
|
+
order?: string;
|
|
75
|
+
where?: string;
|
|
76
|
+
}): {
|
|
77
|
+
columns: string[];
|
|
78
|
+
rows: Record<string, unknown>[];
|
|
79
|
+
totalCount: number;
|
|
80
|
+
};
|
|
81
|
+
export declare function getRowByKey(db: Database, table: string, pk: {
|
|
82
|
+
column: string;
|
|
83
|
+
type?: string;
|
|
84
|
+
}, key: string): Record<string, unknown> | null;
|
|
85
|
+
export declare function getRowByRowId(db: Database, table: string, key: string): Record<string, unknown> | null;
|
|
86
|
+
export declare function executeReadQuery(db: Database, sql: string): {
|
|
87
|
+
columns: string[];
|
|
88
|
+
rows: Record<string, unknown>[];
|
|
89
|
+
truncated: boolean;
|
|
90
|
+
};
|
|
91
|
+
export declare function insertRow(db: Database, table: string, data: Record<string, unknown>): void;
|
|
92
|
+
export declare function updateRowByKey(db: Database, table: string, pk: {
|
|
93
|
+
column: string;
|
|
94
|
+
type?: string;
|
|
95
|
+
}, key: string, data: Record<string, unknown>): number;
|
|
96
|
+
export declare function updateRowByRowId(db: Database, table: string, key: string, data: Record<string, unknown>): number;
|
|
97
|
+
export declare function deleteRowByKey(db: Database, table: string, pk: {
|
|
98
|
+
column: string;
|
|
99
|
+
type?: string;
|
|
100
|
+
}, key: string): number;
|
|
101
|
+
export declare function deleteRowByRowId(db: Database, table: string, key: string): number;
|
|
102
|
+
export declare function renderTableList(tables: SqliteTableSummary[]): string;
|
|
103
|
+
export declare function renderSchema(createSql: string, sampleRows: {
|
|
104
|
+
columns: string[];
|
|
105
|
+
rows: Record<string, unknown>[];
|
|
106
|
+
}): string;
|
|
107
|
+
export declare function renderRow(row: Record<string, unknown>): string;
|
|
108
|
+
export declare function renderTable(columns: string[], rows: Record<string, unknown>[], meta: {
|
|
109
|
+
totalCount: number;
|
|
110
|
+
offset: number;
|
|
111
|
+
limit: number;
|
|
112
|
+
table: string;
|
|
113
|
+
dbPath: string;
|
|
114
|
+
}): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standardized error types for tool execution.
|
|
3
|
+
*
|
|
4
|
+
* Tools should throw these instead of returning error text.
|
|
5
|
+
* The agent loop catches and renders them appropriately.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Base error for tool execution failures.
|
|
9
|
+
* Override render() for custom LLM-facing formatting.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ToolError extends Error {
|
|
12
|
+
readonly context?: Record<string, unknown> | undefined;
|
|
13
|
+
constructor(message: string, context?: Record<string, unknown> | undefined);
|
|
14
|
+
/** Render error for LLM consumption. Override for custom formatting. */
|
|
15
|
+
render(): string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Error thrown when a tool operation is aborted (e.g., via AbortSignal).
|
|
19
|
+
*/
|
|
20
|
+
export declare class ToolAbortError extends Error {
|
|
21
|
+
static readonly MESSAGE = "Operation aborted";
|
|
22
|
+
constructor(message?: string, options?: ErrorOptions);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Throw ToolAbortError if the signal is aborted.
|
|
26
|
+
* Use this instead of signal?.throwIfAborted() to get consistent error types.
|
|
27
|
+
*/
|
|
28
|
+
export declare function throwIfAborted(signal?: AbortSignal): void;
|
|
29
|
+
/**
|
|
30
|
+
* Render an error for LLM consumption.
|
|
31
|
+
* Handles ToolError.render() and falls back to message/string.
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderError(e: unknown): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { OutputSummary, TruncationResult } from "../session/streaming-output";
|
|
4
|
+
import type { OutputMeta, TruncationOptions, TruncationSummaryOptions, TruncationTextOptions } from "./output-meta";
|
|
5
|
+
type ToolContent = Array<TextContent | ImageContent>;
|
|
6
|
+
type DetailsWithMeta = {
|
|
7
|
+
meta?: OutputMeta;
|
|
8
|
+
};
|
|
9
|
+
export declare class ToolResultBuilder<TDetails extends DetailsWithMeta> {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(details?: TDetails);
|
|
12
|
+
text(text: string): this;
|
|
13
|
+
content(content: ToolContent): this;
|
|
14
|
+
truncation(result: TruncationResult, options: TruncationOptions): this;
|
|
15
|
+
truncationFromSummary(summary: OutputSummary, options: TruncationSummaryOptions): this;
|
|
16
|
+
truncationFromText(text: string, options: TruncationTextOptions): this;
|
|
17
|
+
limits(limits: {
|
|
18
|
+
matchLimit?: number;
|
|
19
|
+
resultLimit?: number;
|
|
20
|
+
headLimit?: number;
|
|
21
|
+
columnMax?: number;
|
|
22
|
+
}): this;
|
|
23
|
+
sourceUrl(value: string): this;
|
|
24
|
+
sourcePath(value: string): this;
|
|
25
|
+
sourceInternal(value: string): this;
|
|
26
|
+
/** Flag the result as a non-throwing failure (agent-loop surfaces it as a tool error). */
|
|
27
|
+
error(value?: boolean): this;
|
|
28
|
+
/** Marks the result contextually useless — compaction may elide it once consumed. */
|
|
29
|
+
useless(value?: boolean): this;
|
|
30
|
+
done(): AgentToolResult<TDetails>;
|
|
31
|
+
}
|
|
32
|
+
export declare function toolResult<TDetails extends DetailsWithMeta>(details?: TDetails): ToolResultBuilder<TDetails>;
|
|
33
|
+
export {};
|