@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,57 @@
|
|
|
1
|
+
export interface ToolTimeoutConfig {
|
|
2
|
+
/** Default timeout in seconds when agent omits the field */
|
|
3
|
+
default: number;
|
|
4
|
+
/** Minimum allowed timeout in seconds */
|
|
5
|
+
min: number;
|
|
6
|
+
/** Maximum allowed timeout in seconds (per-tool ceiling) */
|
|
7
|
+
max: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const TOOL_TIMEOUTS: {
|
|
10
|
+
readonly bash: {
|
|
11
|
+
readonly default: 300;
|
|
12
|
+
readonly min: 1;
|
|
13
|
+
readonly max: 3600;
|
|
14
|
+
};
|
|
15
|
+
readonly eval: {
|
|
16
|
+
readonly default: 30;
|
|
17
|
+
readonly min: 1;
|
|
18
|
+
readonly max: 3600;
|
|
19
|
+
};
|
|
20
|
+
readonly browser: {
|
|
21
|
+
readonly default: 30;
|
|
22
|
+
readonly min: 1;
|
|
23
|
+
readonly max: 300;
|
|
24
|
+
};
|
|
25
|
+
readonly computer: {
|
|
26
|
+
readonly default: 120;
|
|
27
|
+
readonly min: 1;
|
|
28
|
+
readonly max: 300;
|
|
29
|
+
};
|
|
30
|
+
readonly ssh: {
|
|
31
|
+
readonly default: 60;
|
|
32
|
+
readonly min: 1;
|
|
33
|
+
readonly max: 3600;
|
|
34
|
+
};
|
|
35
|
+
readonly fetch: {
|
|
36
|
+
readonly default: 20;
|
|
37
|
+
readonly min: 1;
|
|
38
|
+
readonly max: 45;
|
|
39
|
+
};
|
|
40
|
+
readonly debug: {
|
|
41
|
+
readonly default: 30;
|
|
42
|
+
readonly min: 5;
|
|
43
|
+
readonly max: 300;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export type ToolWithTimeout = keyof typeof TOOL_TIMEOUTS;
|
|
47
|
+
/**
|
|
48
|
+
* Clamp a raw timeout to the allowed range for a tool.
|
|
49
|
+
*
|
|
50
|
+
* When `rawTimeout` is undefined the tool's `default` is used. A positive
|
|
51
|
+
* `maxTimeout` (the `tools.maxTimeout` global ceiling) caps the *resolved*
|
|
52
|
+
* value — including the default-fallback path — before the per-tool `min`/`max`
|
|
53
|
+
* floor and ceiling apply, so a configured global cap governs calls where the
|
|
54
|
+
* agent omits `timeout`, not only explicitly-passed values. `maxTimeout <= 0`
|
|
55
|
+
* means no global cap.
|
|
56
|
+
*/
|
|
57
|
+
export declare function clampTimeout(tool: ToolWithTimeout, rawTimeout?: number, maxTimeout?: number): number;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback, ToolApprovalDecision } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { ToolSession } from "../../omp/sdk.ts";
|
|
3
|
+
import type { OutputMeta } from "../../omp/tools/output-meta.ts";
|
|
4
|
+
import { type XdevDispatch } from "../../omp/tools/resolve.ts";
|
|
5
|
+
declare const writeSchema: import("@oh-my-pi/omptype").FluentType<{
|
|
6
|
+
path: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}, {
|
|
9
|
+
path: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type WriteToolInput = typeof writeSchema.infer;
|
|
13
|
+
/** Details returned by the write tool for TUI rendering */
|
|
14
|
+
export interface WriteToolDetails {
|
|
15
|
+
meta?: OutputMeta;
|
|
16
|
+
/** Set when the file was auto-chmod'd because content begins with a `#!` shebang. */
|
|
17
|
+
madeExecutable?: boolean;
|
|
18
|
+
/** Absolute filesystem path the write resolved to. Used by the renderer to wrap
|
|
19
|
+
* the (possibly cwd-relative) header path in an OSC 8 `file://` hyperlink. */
|
|
20
|
+
resolvedPath?: string;
|
|
21
|
+
/** Set when the write dispatched an `xd://` tool device; drives renderer delegation. */
|
|
22
|
+
xdev?: XdevDispatch;
|
|
23
|
+
}
|
|
24
|
+
type WriteParams = WriteToolInput;
|
|
25
|
+
/**
|
|
26
|
+
* Write tool implementation.
|
|
27
|
+
*
|
|
28
|
+
* Creates or overwrites files with optional LSP formatting and diagnostics.
|
|
29
|
+
*/
|
|
30
|
+
export declare class WriteTool implements AgentTool<typeof writeSchema, WriteToolDetails> {
|
|
31
|
+
#private;
|
|
32
|
+
private readonly session;
|
|
33
|
+
readonly name = "write";
|
|
34
|
+
readonly approval: (args: unknown) => ToolApprovalDecision;
|
|
35
|
+
readonly formatApprovalDetails: (args: unknown) => string[];
|
|
36
|
+
readonly label = "Write";
|
|
37
|
+
readonly description: string;
|
|
38
|
+
readonly parameters: import("@oh-my-pi/omptype").FluentType<{
|
|
39
|
+
path: string;
|
|
40
|
+
content: string;
|
|
41
|
+
}, {
|
|
42
|
+
path: string;
|
|
43
|
+
content: string;
|
|
44
|
+
}>;
|
|
45
|
+
readonly strict = true;
|
|
46
|
+
readonly concurrency = "exclusive";
|
|
47
|
+
readonly loadMode = "essential";
|
|
48
|
+
/** Stream matchers should see the real file content, not its JSON-escaped argument encoding. */
|
|
49
|
+
matcherDigest(args: unknown): string | undefined;
|
|
50
|
+
constructor(session: ToolSession);
|
|
51
|
+
execute(_toolCallId: string, { path: rawPath, content }: WriteParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<WriteToolDetails>, context?: AgentToolContext): Promise<AgentToolResult<WriteToolDetails>>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File-write channel for the write/edit engines.
|
|
3
|
+
*
|
|
4
|
+
* OMP routes every edit/write through an LSP writethrough (format +
|
|
5
|
+
* diagnostics). DSH has no LSP infrastructure (plan.md 拍板#5 cuts LSP), so
|
|
6
|
+
* the channel performs the actual file write directly: the edit itself is
|
|
7
|
+
* fully functional; formatting/diagnostics simply do not exist as a DSH
|
|
8
|
+
* capability. LSP-only parameters (batch request, deferred-diagnostics
|
|
9
|
+
* handle) are not part of the DSH signature.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Callback type for the file write channel. DSH's writethrough writes the
|
|
13
|
+
* content to `dst` (via the provided file handle when present) and returns
|
|
14
|
+
* nothing.
|
|
15
|
+
*/
|
|
16
|
+
export type WritethroughCallback = (dst: string, content: string, signal?: AbortSignal, file?: {
|
|
17
|
+
write(content: string): Promise<void>;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
/** Write `content` to `dst` (or the passed file handle) — no LSP pass. */
|
|
20
|
+
export declare function writethroughNoop(dst: string, content: string, _signal?: AbortSignal, file?: {
|
|
21
|
+
write(content: string): Promise<void>;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
/** Async UTF-8 write (node:fs) used when no file handle is supplied. */
|
|
24
|
+
export declare function writeFileUtf8(dst: string, content: string): Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface LineSpan {
|
|
2
|
+
startLine: number;
|
|
3
|
+
endLine: number;
|
|
4
|
+
}
|
|
5
|
+
/** Where the source came from, so tree-sitter can pick a grammar. */
|
|
6
|
+
export interface BlockContextSource {
|
|
7
|
+
path?: string;
|
|
8
|
+
lang?: string;
|
|
9
|
+
}
|
|
10
|
+
export type LineEntry = {
|
|
11
|
+
kind: "line";
|
|
12
|
+
lineNumber: number;
|
|
13
|
+
text: string;
|
|
14
|
+
context: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "ellipsis";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the off-window boundary lines for a visible window: tree-sitter
|
|
20
|
+
* syntactic spans first (covers brace and indentation languages), falling back
|
|
21
|
+
* to a lexical bracket scan when the grammar is unavailable. Returns a map of
|
|
22
|
+
* `lineNumber → source text` for the lines to surface, never including a line
|
|
23
|
+
* already visible.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findBlockContextLines(fullLines: readonly string[], visibleInput: ReadonlySet<number> | readonly number[], source?: BlockContextSource): Map<number, string>;
|
|
26
|
+
/**
|
|
27
|
+
* Build display entries for `visibleSpans` plus any off-window block-boundary
|
|
28
|
+
* lines, in source order, with `{ kind: "ellipsis" }` markers inserted across
|
|
29
|
+
* non-contiguous gaps. `options.lineText` lets callers substitute display text
|
|
30
|
+
* (e.g. column-truncated lines) for a given line number.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildLineEntriesWithBlockContext(fullLines: readonly string[], visibleSpans: readonly LineSpan[], source?: BlockContextSource, options?: {
|
|
33
|
+
lineText?: (lineNumber: number, sourceText: string, context: boolean) => string;
|
|
34
|
+
}): LineEntry[];
|
|
35
|
+
export declare function lineEntriesToPlainText(entries: readonly LineEntry[], ellipsis?: string): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser and renderer for V8 `.cpuprofile` files (emitted by `node --cpu-prof`,
|
|
3
|
+
* `bun --cpu-prof`, Chrome DevTools, and the CDP `Profiler` domain).
|
|
4
|
+
*
|
|
5
|
+
* The raw file is a JSON blob with a flat node table and up to millions of
|
|
6
|
+
* sample/timestamp entries — useless to read directly. `renderCpuProfile`
|
|
7
|
+
* converts it into a compact bottleneck summary:
|
|
8
|
+
*
|
|
9
|
+
* - the hot-path call tree, pruned to frames with meaningful self time,
|
|
10
|
+
* with pass-through chains collapsed and direct recursion flattened
|
|
11
|
+
* - `(idle)` time excluded from on-CPU totals
|
|
12
|
+
* - a profile-wide "top functions by self time" table
|
|
13
|
+
*
|
|
14
|
+
* Consumed by the read tool: `*.cpuprofile` reads show the summary, `:raw`
|
|
15
|
+
* returns the original JSON.
|
|
16
|
+
*/
|
|
17
|
+
/** Matches paths the read tool should treat as V8 CPU profiles. */
|
|
18
|
+
export declare function isCpuProfilePath(filePath: string): boolean;
|
|
19
|
+
/** Call-site metadata of one profile node. `lineNumber` is 0-based. */
|
|
20
|
+
export interface CpuProfileCallFrame {
|
|
21
|
+
functionName: string;
|
|
22
|
+
url?: string;
|
|
23
|
+
lineNumber?: number;
|
|
24
|
+
}
|
|
25
|
+
/** One node in the flat profile tree; `children` are node ids. */
|
|
26
|
+
export interface CpuProfileNode {
|
|
27
|
+
id: number;
|
|
28
|
+
callFrame: CpuProfileCallFrame;
|
|
29
|
+
hitCount?: number;
|
|
30
|
+
children?: number[];
|
|
31
|
+
}
|
|
32
|
+
/** Parsed V8 CPU profile. `startTime`/`endTime`/`timeDeltas` are microseconds. */
|
|
33
|
+
export interface CpuProfile {
|
|
34
|
+
nodes: CpuProfileNode[];
|
|
35
|
+
startTime: number;
|
|
36
|
+
endTime: number;
|
|
37
|
+
samples?: number[];
|
|
38
|
+
timeDeltas?: number[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse a `.cpuprofile` JSON blob. Accepts both the bare profile and the CDP
|
|
42
|
+
* `Profiler.stop` result shape (`{ profile: {...} }`). Returns null when the
|
|
43
|
+
* text is not a structurally valid V8 CPU profile.
|
|
44
|
+
*/
|
|
45
|
+
export declare function parseCpuProfile(text: string): CpuProfile | null;
|
|
46
|
+
/**
|
|
47
|
+
* Render a V8 CPU profile as an agent-friendly bottleneck summary.
|
|
48
|
+
* Returns null when `text` is not a CPU profile (caller falls back to the
|
|
49
|
+
* plain-text path).
|
|
50
|
+
*/
|
|
51
|
+
export declare function renderCpuProfile(text: string): string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type EditMode = "replace" | "patch" | "hashline" | "apply_patch";
|
|
2
|
+
export declare const DEFAULT_EDIT_MODE: EditMode;
|
|
3
|
+
export declare const EDIT_MODES: EditMode[];
|
|
4
|
+
export declare function normalizeEditMode(mode?: string | null): EditMode | undefined;
|
|
5
|
+
export interface EditModeSettingsLike {
|
|
6
|
+
get(key: "edit.mode"): unknown;
|
|
7
|
+
getEditVariantForModel?(model: string | undefined): EditMode | null;
|
|
8
|
+
}
|
|
9
|
+
export interface EditModeSessionLike {
|
|
10
|
+
settings: EditModeSettingsLike;
|
|
11
|
+
getActiveModelString?: () => string | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function resolveEditMode(session: EditModeSessionLike): EditMode;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve line-display mode for file-like outputs (read, grep, @file mentions).
|
|
3
|
+
*/
|
|
4
|
+
export interface FileDisplayMode {
|
|
5
|
+
lineNumbers: boolean;
|
|
6
|
+
hashLines: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Session-like object providing settings and tool availability for display mode resolution. */
|
|
9
|
+
export interface FileDisplayModeSession {
|
|
10
|
+
/** Whether the edit tool is available. Hashlines are suppressed without it. */
|
|
11
|
+
hasEditTool?: boolean;
|
|
12
|
+
settings: {
|
|
13
|
+
get(key: "readLineNumbers" | "edit.mode"): unknown;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Computes effective line display mode from session settings/env.
|
|
18
|
+
* Hashline mode takes precedence and implies line-addressed output everywhere.
|
|
19
|
+
* Hashlines are suppressed when the edit tool is not available (e.g. scout agents),
|
|
20
|
+
* when the caller signals a `raw` read, and when the source is `immutable`
|
|
21
|
+
* (e.g. internal URLs like artifact://, agent://, memory:// — there is no edit
|
|
22
|
+
* path that could consume the anchors). Raw output is returned as-is.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveFileDisplayMode(session: FileDisplayModeSession, options?: {
|
|
25
|
+
raw?: boolean;
|
|
26
|
+
immutable?: boolean;
|
|
27
|
+
}): FileDisplayMode;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ImageContent, Model } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import { type ImageResizeOptions } from "./image-resize";
|
|
3
|
+
/**
|
|
4
|
+
* Ollama and its local-backend family decode image input through llama.cpp /
|
|
5
|
+
* `stb_image`, which is compiled without WebP support, so a WebP upload fails
|
|
6
|
+
* with an opaque HTTP 400. Detect those models so the resize pipeline encodes
|
|
7
|
+
* to PNG/JPEG instead — the automatic equivalent of `OMP_NO_WEBP=1`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function modelLacksWebpSupport(model: Pick<Model, "provider" | "api" | "imageInputDecoder"> | undefined): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* `true` when `model` cannot decode WebP, otherwise `undefined` so the
|
|
12
|
+
* `OMP_NO_WEBP` env fallback in {@link resizeImage} still applies. Feed straight
|
|
13
|
+
* into {@link ImageResizeOptions.excludeWebP}.
|
|
14
|
+
*/
|
|
15
|
+
export declare function webpExclusionForModel(model: Pick<Model, "provider" | "api"> | undefined): true | undefined;
|
|
16
|
+
export declare const MAX_IMAGE_INPUT_BYTES: number;
|
|
17
|
+
export declare const SUPPORTED_INPUT_IMAGE_MIME_TYPES: Set<string>;
|
|
18
|
+
export interface LoadImageInputOptions {
|
|
19
|
+
path: string;
|
|
20
|
+
cwd: string;
|
|
21
|
+
autoResize: boolean;
|
|
22
|
+
maxBytes?: number;
|
|
23
|
+
resolvedPath?: string;
|
|
24
|
+
detectedMimeType?: string;
|
|
25
|
+
/** Force non-WebP output (e.g. for Ollama). Leave unset to honor `OMP_NO_WEBP`. */
|
|
26
|
+
excludeWebP?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* DSH extension (拍板#22 config expansion): resize-knob passthrough onto
|
|
29
|
+
* {@link resizeImage}. Upstream never passes these — it relies on the
|
|
30
|
+
* hardcoded 1568px/500KB/200px/quality-80 defaults; the tool-plus config
|
|
31
|
+
* panel wires user-tunable values through here. Unset = upstream behavior.
|
|
32
|
+
*/
|
|
33
|
+
resize?: ImageResizeOptions;
|
|
34
|
+
}
|
|
35
|
+
export interface LoadedImageInput {
|
|
36
|
+
resolvedPath: string;
|
|
37
|
+
mimeType: string;
|
|
38
|
+
data: string;
|
|
39
|
+
textNote: string;
|
|
40
|
+
dimensionNote?: string;
|
|
41
|
+
bytes: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class ImageInputTooLargeError extends Error {
|
|
44
|
+
readonly bytes: number;
|
|
45
|
+
readonly maxBytes: number;
|
|
46
|
+
constructor(bytes: number, maxBytes: number);
|
|
47
|
+
}
|
|
48
|
+
/** Converts an image to PNG, rejecting when the runtime cannot decode or encode it. */
|
|
49
|
+
export declare function convertImageToPng(image: ImageContent): Promise<ImageContent>;
|
|
50
|
+
export declare function ensureSupportedImageInput(image: ImageContent): Promise<ImageContent | null>;
|
|
51
|
+
export declare function loadImageInput(options: LoadImageInputOptions): Promise<LoadedImageInput | null>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
2
|
+
export interface ImageResizeOptions {
|
|
3
|
+
maxWidth?: number;
|
|
4
|
+
maxHeight?: number;
|
|
5
|
+
/** Smallest allowed edge length (px). Inputs below this are scaled up. */
|
|
6
|
+
minDimension?: number;
|
|
7
|
+
maxBytes?: number;
|
|
8
|
+
jpegQuality?: number;
|
|
9
|
+
excludeWebP?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ResizedImage {
|
|
12
|
+
buffer: Uint8Array;
|
|
13
|
+
mimeType: string;
|
|
14
|
+
originalWidth: number;
|
|
15
|
+
originalHeight: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
wasResized: boolean;
|
|
19
|
+
decodeFailed?: boolean;
|
|
20
|
+
get data(): string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resize and recompress an image to fit within the specified max dimensions and file size.
|
|
24
|
+
*
|
|
25
|
+
* Strategy:
|
|
26
|
+
* 1. Probe metadata. If already within all limits, return original.
|
|
27
|
+
* 2. Resize to fit max dimensions and encode at high quality across PNG/JPEG (+ WebP) — return smallest.
|
|
28
|
+
* 3. If still too large, walk a lossy JPEG/WebP quality ladder.
|
|
29
|
+
* 4. If still too large, walk a dimension-scale ladder × quality ladder.
|
|
30
|
+
* 5. If still too large, return the smallest variant produced.
|
|
31
|
+
*
|
|
32
|
+
* Set OMP_NO_WEBP to exclude WebP from encoding (llama.cpp STB doesn't decode it).
|
|
33
|
+
*
|
|
34
|
+
* Backed by `Bun.Image`: a chainable native pipeline that runs decode/transform/encode
|
|
35
|
+
* off the JS thread when the terminal (`.bytes()`) is awaited.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resizeImage(img: ImageContent, options?: ImageResizeOptions): Promise<ResizedImage>;
|
|
38
|
+
/**
|
|
39
|
+
* Format a dimension note for resized images.
|
|
40
|
+
* This helps the model understand the coordinate mapping.
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatDimensionNote(result: ResizedImage): string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language id for syntax highlighting and UI (icons, read tool), or undefined if unknown.
|
|
3
|
+
*/
|
|
4
|
+
export declare function getLanguageFromPath(filePath: string): string | undefined;
|
|
5
|
+
export declare function isMarkdownPath(filePath: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* LSP language identifier; falls back to `plaintext`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function detectLanguageId(filePath: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache schema/format revision. Bumping it changes the on-disk key prefix
|
|
3
|
+
* (`v<N>-...`), so old entries become unreachable and are pruned naturally.
|
|
4
|
+
* Bump when the cache *file* shape changes (entry JSON layout, key scheme).
|
|
5
|
+
*
|
|
6
|
+
* Converter *output* changes are handled separately: the package version is
|
|
7
|
+
* folded into the key (see {@link markitConversionCacheKey}), so any release
|
|
8
|
+
* that ships new markdown from `src/markit/converters/*` auto-invalidates the
|
|
9
|
+
* cache without a manual bump here.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MARKIT_CONVERSION_CACHE_VERSION = 1;
|
|
12
|
+
export declare const MAX_MARKIT_CONVERSION_CACHE_BYTES: number;
|
|
13
|
+
export type MarkitConversionCacheStatus = "hit" | "miss" | "skipped";
|
|
14
|
+
export type MarkitConversionCacheReadResult = {
|
|
15
|
+
status: "hit";
|
|
16
|
+
content: string;
|
|
17
|
+
} | {
|
|
18
|
+
status: "miss";
|
|
19
|
+
};
|
|
20
|
+
export declare function markitConversionCacheKey(bytes: Uint8Array, extension: string): string;
|
|
21
|
+
export declare function readMarkitConversionCache(key: string): Promise<MarkitConversionCacheReadResult>;
|
|
22
|
+
export declare function pruneMarkitConversionCache(cacheDir: string): Promise<void>;
|
|
23
|
+
export declare function writeMarkitConversionCache(key: string, content: string): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type MarkitConversionCacheStatus } from "./markit-cache";
|
|
2
|
+
/**
|
|
3
|
+
* File extensions markit can actually convert to markdown — one per registered
|
|
4
|
+
* converter in `src/markit/registry.ts` (pdf, docx, pptx, xlsx, epub). This is
|
|
5
|
+
* the single source of truth shared by the read, fetch, and CLI file tools so
|
|
6
|
+
* the advertised set never drifts from the converters that back it. Legacy
|
|
7
|
+
* binary formats (`.doc`, `.ppt`, `.xls`, `.rtf`) are intentionally absent:
|
|
8
|
+
* markit has no converter for them, so routing them here only produced an
|
|
9
|
+
* `Unsupported format` error instead of letting them fall through to the
|
|
10
|
+
* binary-file handling.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CONVERTIBLE_EXTENSIONS: ReadonlySet<string>;
|
|
13
|
+
export interface MarkitConversionResult {
|
|
14
|
+
content: string;
|
|
15
|
+
ok: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
cache?: MarkitConversionCacheStatus;
|
|
18
|
+
}
|
|
19
|
+
export interface MarkitFileConversionOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Directory converters may use for extracted image or diagram files. Since
|
|
22
|
+
* those files are conversion side effects, conversions using this option
|
|
23
|
+
* bypass the markdown cache.
|
|
24
|
+
*/
|
|
25
|
+
imageDir?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function convertFileWithMarkit(filePath: string, signal?: AbortSignal, options?: MarkitFileConversionOptions): Promise<MarkitConversionResult>;
|
|
28
|
+
export declare function convertBufferWithMarkit(buffer: Uint8Array, extension: string, signal?: AbortSignal, options?: {
|
|
29
|
+
useCache?: boolean;
|
|
30
|
+
}): Promise<MarkitConversionResult>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared display-tree machinery for profile summaries (macOS `sample` reports,
|
|
3
|
+
* V8 `.cpuprofile` files). Callers build {@link ProfileNode} trees with a
|
|
4
|
+
* domain-specific metric (on-CPU samples, self microseconds, …); this module
|
|
5
|
+
* merges same-key siblings, flattens direct recursion, collapses pass-through
|
|
6
|
+
* chains, and renders the pruned hot-path tree.
|
|
7
|
+
*/
|
|
8
|
+
/** Display node: merged, recursion-flattened mirror of a profile subtree. */
|
|
9
|
+
export interface ProfileNode {
|
|
10
|
+
/** Merge/recursion identity (demangled symbol, function@call-site, …). */
|
|
11
|
+
key: string;
|
|
12
|
+
/** Human-readable label; recursion and truncation decorations are applied at render time. */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Inclusive metric for this subtree (on-CPU samples, self µs, …); drives pruning and display. */
|
|
15
|
+
value: number;
|
|
16
|
+
/** Levels of direct recursion flattened into this node. */
|
|
17
|
+
recursion: number;
|
|
18
|
+
children: ProfileNode[];
|
|
19
|
+
}
|
|
20
|
+
/** Merge `b` into `a` (same key), combining values and child lists. */
|
|
21
|
+
export declare function mergeInto(a: ProfileNode, b: ProfileNode): void;
|
|
22
|
+
/**
|
|
23
|
+
* Flatten direct recursion: children carrying the node's own key are dissolved
|
|
24
|
+
* into it (their children promoted and merged), so a 15-deep recursive spine
|
|
25
|
+
* renders as one annotated node.
|
|
26
|
+
*/
|
|
27
|
+
export declare function flattenRecursion(node: ProfileNode): void;
|
|
28
|
+
/** `n` as a percentage of `total`, one decimal (`"12.3%"`); `"0%"` when total is empty. */
|
|
29
|
+
export declare function formatPct(n: number, total: number): string;
|
|
30
|
+
/** Options for {@link renderProfileNode}. */
|
|
31
|
+
export interface RenderTreeContext {
|
|
32
|
+
out: string[];
|
|
33
|
+
/** Denominator for percentage annotations. */
|
|
34
|
+
total: number;
|
|
35
|
+
/** Minimum subtree value a child needs to stay visible. */
|
|
36
|
+
minValue: number;
|
|
37
|
+
/** Format a metric value for the left column. */
|
|
38
|
+
formatValue: (value: number) => string;
|
|
39
|
+
/** Left-column width (characters) for formatted values. */
|
|
40
|
+
valueWidth: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Render one hot-path subtree: pass-through chains (single kept child, no own
|
|
44
|
+
* contribution above `minValue`) collapse into a single `a › b › c` line, and
|
|
45
|
+
* children below `minValue` are pruned.
|
|
46
|
+
*/
|
|
47
|
+
export declare function renderProfileNode(node: ProfileNode, indent: number, ctx: RenderTreeContext): void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser and renderer for macOS `/usr/bin/sample` call-tree reports
|
|
3
|
+
* (conventionally saved as `*.sample.txt`).
|
|
4
|
+
*
|
|
5
|
+
* The raw report is a 10k+ line ASCII call tree with mangled symbols —
|
|
6
|
+
* expensive for an agent to digest. `renderSampleProfile` converts it into a
|
|
7
|
+
* compact bottleneck summary:
|
|
8
|
+
*
|
|
9
|
+
* - per-thread hot paths, pruned to frames with meaningful on-CPU samples,
|
|
10
|
+
* with pass-through chains collapsed and direct recursion flattened
|
|
11
|
+
* - blocked/idle threads reduced to a one-line classification
|
|
12
|
+
* - a process-wide "top functions by self samples" table
|
|
13
|
+
* - Rust v0 and legacy symbols demangled (best-effort, path extraction)
|
|
14
|
+
*
|
|
15
|
+
* Consumed by the read tool: `*.sample.txt` reads show the summary, `:raw`
|
|
16
|
+
* returns the original bytes.
|
|
17
|
+
*/
|
|
18
|
+
/** Matches paths the read tool should treat as macOS sample reports. */
|
|
19
|
+
export declare function isSampleProfilePath(filePath: string): boolean;
|
|
20
|
+
/** One frame in the sampled call tree. Counts are sample hits (subtree total). */
|
|
21
|
+
export interface SampleFrame {
|
|
22
|
+
count: number;
|
|
23
|
+
symbol: string;
|
|
24
|
+
module?: string;
|
|
25
|
+
children: SampleFrame[];
|
|
26
|
+
}
|
|
27
|
+
/** One sampled thread: `Thread_<id>` root plus its call tree. */
|
|
28
|
+
export interface SampleThread {
|
|
29
|
+
id: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
total: number;
|
|
32
|
+
roots: SampleFrame[];
|
|
33
|
+
}
|
|
34
|
+
/** Metadata from the report preamble (everything before `Call graph:`). */
|
|
35
|
+
export interface SampleProfileHeader {
|
|
36
|
+
process: string;
|
|
37
|
+
pid: number;
|
|
38
|
+
intervalMs: number;
|
|
39
|
+
path?: string;
|
|
40
|
+
codeType?: string;
|
|
41
|
+
osVersion?: string;
|
|
42
|
+
footprint?: string;
|
|
43
|
+
footprintPeak?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Parsed macOS sample report. */
|
|
46
|
+
export interface SampleProfile {
|
|
47
|
+
header: SampleProfileHeader;
|
|
48
|
+
threads: SampleThread[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse a macOS `sample` report. Returns null when the text does not look
|
|
52
|
+
* like sample output (missing analysis preamble or `Call graph:` section).
|
|
53
|
+
*/
|
|
54
|
+
export declare function parseSampleProfile(text: string): SampleProfile | null;
|
|
55
|
+
/**
|
|
56
|
+
* Best-effort demangle of Rust symbols (v0 `_R…` and legacy `_ZN…E`).
|
|
57
|
+
* For v0 this is a path extractor, not a full demangler: identifiers are
|
|
58
|
+
* pulled out in order and joined with `::`, so generic arguments appear as
|
|
59
|
+
* extra path segments. Non-Rust symbols pass through unchanged.
|
|
60
|
+
*/
|
|
61
|
+
export declare function demangleSymbol(raw: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Render a macOS sample report as an agent-friendly bottleneck summary.
|
|
64
|
+
* Returns null when `text` is not sample output (caller falls back to the
|
|
65
|
+
* plain-text path).
|
|
66
|
+
*/
|
|
67
|
+
export declare function renderSampleProfile(text: string): string | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether SIXEL passthrough is explicitly enabled.
|
|
3
|
+
*
|
|
4
|
+
* Both gates must be enabled to preserve SIXEL control sequences:
|
|
5
|
+
* - PI_FORCE_IMAGE_PROTOCOL=sixel
|
|
6
|
+
* - PI_ALLOW_SIXEL_PASSTHROUGH=1
|
|
7
|
+
*/
|
|
8
|
+
export declare function isSixelPassthroughEnabled(): boolean;
|
|
9
|
+
/** Returns true when the text contains a SIXEL start sequence. */
|
|
10
|
+
export declare function containsSixelSequence(text: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Returns a boolean mask indicating which lines belong to a SIXEL sequence block.
|
|
13
|
+
* Supports multi-line SIXEL payloads generated by libsixel.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getSixelLineMask(lines: string[]): boolean[];
|
|
16
|
+
/** Returns true when the line contains a SIXEL start sequence. */
|
|
17
|
+
export declare function isSixelLine(line: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Sanitizes text while preserving embedded SIXEL sequences when passthrough is enabled.
|
|
20
|
+
*/
|
|
21
|
+
export declare function sanitizeWithOptionalSixelPassthrough(text: string, sanitize: (text: string) => string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ToolName = "sd" | "sg" | "yt-dlp" | "trafilatura";
|
|
2
|
+
export declare function getToolPath(tool: ToolName): string | null;
|
|
3
|
+
/** Download a tool asset without handing the streaming Response to Bun.write. */
|
|
4
|
+
export declare function downloadFile(url: string, dest: string, signal?: AbortSignal): Promise<void>;
|
|
5
|
+
type EnsureToolOptions = {
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
silent?: boolean;
|
|
8
|
+
notify?: (message: string) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function ensureTool(tool: ToolName, silentOrOptions?: EnsureToolOptions): Promise<string | undefined>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import TurndownService from "@oh-my-pi/pi-utils/turndown";
|
|
2
|
+
/**
|
|
3
|
+
* Build a Turndown instance configured for GFM with the fixes omp relies on:
|
|
4
|
+
* `~~strikethrough~~`, unescaped heading periods, and single-space list markers.
|
|
5
|
+
*
|
|
6
|
+
* Shared by the web scrapers (HTML → markdown) and the markit document engine
|
|
7
|
+
* (`src/markit`). The rule set must stay identical across both call sites.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTurndown(): TurndownService;
|
|
10
|
+
/**
|
|
11
|
+
* Normalize HTML tables so turndown-plugin-gfm can render them:
|
|
12
|
+
* - strip `<p>` tags inside `<td>`/`<th>` cells (joining paragraphs with a space)
|
|
13
|
+
* - wrap the first row in `<thead>` when missing
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeTablesHtml(html: string): string;
|