@alumbwe/anvil 1.0.20 → 1.0.21
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/package.json +6 -2
- package/src/agents/bundled-agents.generated.ts +4 -4
- package/src/chat.tsx +1703 -1698
- package/src/cli-args.ts +134 -134
- package/src/components/status-bar.tsx +331 -313
- package/src/hooks/helpers/send-message.ts +663 -654
- package/src/hooks/use-send-message.ts +806 -773
- package/src/index.tsx +473 -473
- package/src/state/chat-store.ts +553 -544
- package/src/utils/create-run-config.ts +121 -121
- package/src/utils/format-compact-number.ts +37 -0
- package/vendor/@anvil/common/package.json +27 -0
- package/vendor/@anvil/common/src/__tests__/agent-validation.test.ts +846 -0
- package/vendor/@anvil/common/src/__tests__/anvil-model-availability.test.ts +101 -0
- package/vendor/@anvil/common/src/__tests__/anvil-models.test.ts +1408 -0
- package/vendor/@anvil/common/src/__tests__/anvil-public-data-use-copy.test.ts +258 -0
- package/vendor/@anvil/common/src/__tests__/anvil-referral-tiers.test.ts +48 -0
- package/vendor/@anvil/common/src/__tests__/anvil-spend-ceilings.test.ts +282 -0
- package/vendor/@anvil/common/src/__tests__/anvil-trust.test.ts +526 -0
- package/vendor/@anvil/common/src/__tests__/deepseek-direct.test.ts +68 -0
- package/vendor/@anvil/common/src/__tests__/disposable-email.test.ts +132 -0
- package/vendor/@anvil/common/src/__tests__/dynamic-agent-template-schema.test.ts +422 -0
- package/vendor/@anvil/common/src/__tests__/env-ci.test.ts +167 -0
- package/vendor/@anvil/common/src/__tests__/env-process.test.ts +145 -0
- package/vendor/@anvil/common/src/__tests__/foreign-client-shipped-agents.test.ts +234 -0
- package/vendor/@anvil/common/src/__tests__/foreign-client-signals.test.ts +379 -0
- package/vendor/@anvil/common/src/__tests__/free-agents.test.ts +807 -0
- package/vendor/@anvil/common/src/__tests__/gravity-capi.test.ts +154 -0
- package/vendor/@anvil/common/src/__tests__/handlesteps-parsing.test.ts +246 -0
- package/vendor/@anvil/common/src/__tests__/kimi-k3-god-only.test.ts +77 -0
- package/vendor/@anvil/common/src/__tests__/model-config.test.ts +89 -0
- package/vendor/@anvil/common/src/__tests__/project-file-tree.test.ts +298 -0
- package/vendor/@anvil/common/src/__tests__/provisioned-model-tiers.test.ts +116 -0
- package/vendor/@anvil/common/src/__tests__/reasoning-effort.test.ts +167 -0
- package/vendor/@anvil/common/src/__tests__/reddit-capi.test.ts +132 -0
- package/vendor/@anvil/common/src/__tests__/response-ad-positions.test.ts +72 -0
- package/vendor/@anvil/common/src/__tests__/user-state.test.ts +30 -0
- package/vendor/@anvil/common/src/actions.ts +215 -0
- package/vendor/@anvil/common/src/analytics-core.ts +69 -0
- package/vendor/@anvil/common/src/analytics.ts +93 -0
- package/vendor/@anvil/common/src/api-keys/constants.ts +26 -0
- package/vendor/@anvil/common/src/browser-actions.ts +413 -0
- package/vendor/@anvil/common/src/constants/__tests__/anvil-onboarding-gate.test.ts +63 -0
- package/vendor/@anvil/common/src/constants/__tests__/anvil-onboarding.test.ts +246 -0
- package/vendor/@anvil/common/src/constants/__tests__/cf-worker-signals.test.ts +106 -0
- package/vendor/@anvil/common/src/constants/agents.ts +99 -0
- package/vendor/@anvil/common/src/constants/analytics-events.ts +435 -0
- package/vendor/@anvil/common/src/constants/anthropic.ts +73 -0
- package/vendor/@anvil/common/src/constants/anvil-data-use.ts +81 -0
- package/vendor/@anvil/common/src/constants/anvil-errors.ts +7 -0
- package/vendor/@anvil/common/src/constants/anvil-gemini-thinker.ts +21 -0
- package/vendor/@anvil/common/src/constants/anvil-model-ids.ts +11 -0
- package/vendor/@anvil/common/src/constants/anvil-models.ts +2130 -0
- package/vendor/@anvil/common/src/constants/anvil-onboarding-gate.ts +55 -0
- package/vendor/@anvil/common/src/constants/anvil-onboarding.ts +307 -0
- package/vendor/@anvil/common/src/constants/anvil-referral-tiers.ts +87 -0
- package/vendor/@anvil/common/src/constants/anvil-signup-block.ts +68 -0
- package/vendor/@anvil/common/src/constants/anvil-spend-ceilings.ts +450 -0
- package/vendor/@anvil/common/src/constants/anvil-trust.ts +976 -0
- package/vendor/@anvil/common/src/constants/auth.ts +18 -0
- package/vendor/@anvil/common/src/constants/byok.ts +2 -0
- package/vendor/@anvil/common/src/constants/cf-worker-signals.ts +132 -0
- package/vendor/@anvil/common/src/constants/composio.ts +34 -0
- package/vendor/@anvil/common/src/constants/deepseek-direct.ts +55 -0
- package/vendor/@anvil/common/src/constants/feedback.ts +13 -0
- package/vendor/@anvil/common/src/constants/foreign-client-signals.ts +272 -0
- package/vendor/@anvil/common/src/constants/free-agents.ts +777 -0
- package/vendor/@anvil/common/src/constants/gemini.ts +15 -0
- package/vendor/@anvil/common/src/constants/grant-priorities.ts +13 -0
- package/vendor/@anvil/common/src/constants/hosts.ts +6 -0
- package/vendor/@anvil/common/src/constants/images.ts +51 -0
- package/vendor/@anvil/common/src/constants/index.ts +7 -0
- package/vendor/@anvil/common/src/constants/knowledge.ts +35 -0
- package/vendor/@anvil/common/src/constants/limits.ts +23 -0
- package/vendor/@anvil/common/src/constants/model-config.ts +277 -0
- package/vendor/@anvil/common/src/constants/openrouter-attribution.ts +8 -0
- package/vendor/@anvil/common/src/constants/paths.ts +69 -0
- package/vendor/@anvil/common/src/constants/provider-routes.ts +317 -0
- package/vendor/@anvil/common/src/constants/reasoning-effort.ts +79 -0
- package/vendor/@anvil/common/src/constants/skills.ts +60 -0
- package/vendor/@anvil/common/src/constants/subscription-plans.ts +49 -0
- package/vendor/@anvil/common/src/constants/ui.ts +25 -0
- package/vendor/@anvil/common/src/env-ci.ts +36 -0
- package/vendor/@anvil/common/src/env-process.ts +95 -0
- package/vendor/@anvil/common/src/env-schema.ts +95 -0
- package/vendor/@anvil/common/src/env.ts +24 -0
- package/vendor/@anvil/common/src/gravity-capi.ts +207 -0
- package/vendor/@anvil/common/src/mcp/client.ts +233 -0
- package/vendor/@anvil/common/src/old-constants.ts +10 -0
- package/vendor/@anvil/common/src/project-file-tree.ts +355 -0
- package/vendor/@anvil/common/src/reddit-capi.ts +254 -0
- package/vendor/@anvil/common/src/schemas/feedback.ts +52 -0
- package/vendor/@anvil/common/src/schemas/logs.ts +66 -0
- package/vendor/@anvil/common/src/templates/agent-validation.ts +392 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/LICENSE +202 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/README.md +294 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/examples/01-basic-diff-reviewer.ts +17 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/examples/02-intermediate-git-committer.ts +78 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/examples/03-advanced-file-explorer.ts +73 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/my-custom-agent.ts +40 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/package.json +6 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/skills/README.md +65 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/skills/example-skill/SKILL.md +29 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/types/agent-definition.ts +497 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/types/tools.ts +444 -0
- package/vendor/@anvil/common/src/templates/initial-agents-dir/types/util-types.ts +178 -0
- package/vendor/@anvil/common/src/testing/TESTING_PATTERNS.md +351 -0
- package/vendor/@anvil/common/src/testing/anvil-offer-invariants.ts +169 -0
- package/vendor/@anvil/common/src/testing/errors.ts +33 -0
- package/vendor/@anvil/common/src/testing/fixtures/agent-runtime.ts +334 -0
- package/vendor/@anvil/common/src/testing/impl/agent-runtime.ts +6 -0
- package/vendor/@anvil/common/src/testing/index.ts +84 -0
- package/vendor/@anvil/common/src/testing/mock-modules.ts +53 -0
- package/vendor/@anvil/common/src/testing/mock-types.ts +123 -0
- package/vendor/@anvil/common/src/testing/mocks/analytics.ts +261 -0
- package/vendor/@anvil/common/src/testing/mocks/child-process.ts +93 -0
- package/vendor/@anvil/common/src/testing/mocks/crypto.ts +218 -0
- package/vendor/@anvil/common/src/testing/mocks/database.ts +337 -0
- package/vendor/@anvil/common/src/testing/mocks/fetch.ts +219 -0
- package/vendor/@anvil/common/src/testing/mocks/filesystem.ts +166 -0
- package/vendor/@anvil/common/src/testing/mocks/index.ts +101 -0
- package/vendor/@anvil/common/src/testing/mocks/logger.ts +135 -0
- package/vendor/@anvil/common/src/testing/mocks/stream.ts +313 -0
- package/vendor/@anvil/common/src/testing/mocks/timers.ts +132 -0
- package/vendor/@anvil/common/src/testing/mocks/tree-sitter.ts +127 -0
- package/vendor/@anvil/common/src/testing/setup.ts +282 -0
- package/vendor/@anvil/common/src/testing-env-ci.ts +15 -0
- package/vendor/@anvil/common/src/testing-env-process.ts +78 -0
- package/vendor/@anvil/common/src/tools/__tests__/compile-tool-definitions.test.ts +34 -0
- package/vendor/@anvil/common/src/tools/compile-tool-definitions.ts +157 -0
- package/vendor/@anvil/common/src/tools/constants.ts +117 -0
- package/vendor/@anvil/common/src/tools/list.ts +190 -0
- package/vendor/@anvil/common/src/tools/params/__tests__/coerce-to-array.test.ts +213 -0
- package/vendor/@anvil/common/src/tools/params/__tests__/read-docs.test.ts +47 -0
- package/vendor/@anvil/common/src/tools/params/__tests__/render-ui.test.ts +65 -0
- package/vendor/@anvil/common/src/tools/params/tool/__tests__/run-terminal-command-timeout.test.ts +49 -0
- package/vendor/@anvil/common/src/tools/params/tool/add-message.ts +39 -0
- package/vendor/@anvil/common/src/tools/params/tool/add-subgoal.ts +57 -0
- package/vendor/@anvil/common/src/tools/params/tool/apply-patch.ts +110 -0
- package/vendor/@anvil/common/src/tools/params/tool/ask-user.ts +181 -0
- package/vendor/@anvil/common/src/tools/params/tool/browser-logs.ts +85 -0
- package/vendor/@anvil/common/src/tools/params/tool/cloud-plan-ready.ts +94 -0
- package/vendor/@anvil/common/src/tools/params/tool/code-search.ts +159 -0
- package/vendor/@anvil/common/src/tools/params/tool/composio.ts +131 -0
- package/vendor/@anvil/common/src/tools/params/tool/create-plan.ts +80 -0
- package/vendor/@anvil/common/src/tools/params/tool/end-turn.ts +57 -0
- package/vendor/@anvil/common/src/tools/params/tool/find-files.ts +60 -0
- package/vendor/@anvil/common/src/tools/params/tool/glob.ts +80 -0
- package/vendor/@anvil/common/src/tools/params/tool/gravity-index.ts +93 -0
- package/vendor/@anvil/common/src/tools/params/tool/list-directory.ts +58 -0
- package/vendor/@anvil/common/src/tools/params/tool/lookup-agent-info.ts +37 -0
- package/vendor/@anvil/common/src/tools/params/tool/propose-str-replace.ts +103 -0
- package/vendor/@anvil/common/src/tools/params/tool/propose-write-file.ts +71 -0
- package/vendor/@anvil/common/src/tools/params/tool/read-docs.ts +90 -0
- package/vendor/@anvil/common/src/tools/params/tool/read-files.ts +109 -0
- package/vendor/@anvil/common/src/tools/params/tool/read-subtree.ts +79 -0
- package/vendor/@anvil/common/src/tools/params/tool/read-url.ts +81 -0
- package/vendor/@anvil/common/src/tools/params/tool/render-ui.ts +168 -0
- package/vendor/@anvil/common/src/tools/params/tool/run-file-change-hooks.ts +57 -0
- package/vendor/@anvil/common/src/tools/params/tool/run-terminal-command.ts +211 -0
- package/vendor/@anvil/common/src/tools/params/tool/screenshot.ts +97 -0
- package/vendor/@anvil/common/src/tools/params/tool/set-messages.ts +44 -0
- package/vendor/@anvil/common/src/tools/params/tool/set-output.ts +61 -0
- package/vendor/@anvil/common/src/tools/params/tool/skill.ts +59 -0
- package/vendor/@anvil/common/src/tools/params/tool/spawn-agent-inline.ts +56 -0
- package/vendor/@anvil/common/src/tools/params/tool/spawn-agents.ts +154 -0
- package/vendor/@anvil/common/src/tools/params/tool/str-replace.ts +107 -0
- package/vendor/@anvil/common/src/tools/params/tool/suggest-followups.ts +97 -0
- package/vendor/@anvil/common/src/tools/params/tool/task-completed.ts +61 -0
- package/vendor/@anvil/common/src/tools/params/tool/think-deeply.ts +56 -0
- package/vendor/@anvil/common/src/tools/params/tool/update-subgoal.ts +89 -0
- package/vendor/@anvil/common/src/tools/params/tool/vision-analyze.ts +82 -0
- package/vendor/@anvil/common/src/tools/params/tool/web-search.ts +73 -0
- package/vendor/@anvil/common/src/tools/params/tool/write-file.ts +71 -0
- package/vendor/@anvil/common/src/tools/params/tool/write-todos.ts +67 -0
- package/vendor/@anvil/common/src/tools/params/utils.ts +150 -0
- package/vendor/@anvil/common/src/tools/utils.ts +24 -0
- package/vendor/@anvil/common/src/types/__tests__/dynamic-agent-template.test.ts +20 -0
- package/vendor/@anvil/common/src/types/agent-template.ts +215 -0
- package/vendor/@anvil/common/src/types/anvil-session.ts +535 -0
- package/vendor/@anvil/common/src/types/anvil-streak.ts +6 -0
- package/vendor/@anvil/common/src/types/anvil-usage.ts +64 -0
- package/vendor/@anvil/common/src/types/api/agents/publish.ts +61 -0
- package/vendor/@anvil/common/src/types/bun-test.d.ts +5 -0
- package/vendor/@anvil/common/src/types/contracts/agent-runtime.ts +75 -0
- package/vendor/@anvil/common/src/types/contracts/analytics.ts +9 -0
- package/vendor/@anvil/common/src/types/contracts/bigquery.ts +55 -0
- package/vendor/@anvil/common/src/types/contracts/billing.ts +46 -0
- package/vendor/@anvil/common/src/types/contracts/client.ts +53 -0
- package/vendor/@anvil/common/src/types/contracts/database.ts +112 -0
- package/vendor/@anvil/common/src/types/contracts/env.ts +203 -0
- package/vendor/@anvil/common/src/types/contracts/llm.ts +191 -0
- package/vendor/@anvil/common/src/types/contracts/logger.ts +14 -0
- package/vendor/@anvil/common/src/types/contracts/logs.ts +34 -0
- package/vendor/@anvil/common/src/types/contracts/trace.ts +21 -0
- package/vendor/@anvil/common/src/types/dynamic-agent-template.ts +328 -0
- package/vendor/@anvil/common/src/types/filesystem.ts +10 -0
- package/vendor/@anvil/common/src/types/function-params.ts +33 -0
- package/vendor/@anvil/common/src/types/grant.ts +20 -0
- package/vendor/@anvil/common/src/types/gravity-index.ts +170 -0
- package/vendor/@anvil/common/src/types/json.ts +29 -0
- package/vendor/@anvil/common/src/types/mcp.ts +24 -0
- package/vendor/@anvil/common/src/types/messages/anvil-message.ts +58 -0
- package/vendor/@anvil/common/src/types/messages/content-part.ts +59 -0
- package/vendor/@anvil/common/src/types/messages/data-content.ts +14 -0
- package/vendor/@anvil/common/src/types/messages/provider-metadata.ts +13 -0
- package/vendor/@anvil/common/src/types/organization.ts +118 -0
- package/vendor/@anvil/common/src/types/print-mode.ts +121 -0
- package/vendor/@anvil/common/src/types/publisher.ts +67 -0
- package/vendor/@anvil/common/src/types/session-state.ts +149 -0
- package/vendor/@anvil/common/src/types/skill.ts +86 -0
- package/vendor/@anvil/common/src/types/source.ts +11 -0
- package/vendor/@anvil/common/src/types/spawn.ts +13 -0
- package/vendor/@anvil/common/src/types/subscription.ts +67 -0
- package/vendor/@anvil/common/src/types/usage.ts +16 -0
- package/vendor/@anvil/common/src/types/util.ts +3 -0
- package/vendor/@anvil/common/src/util/__tests__/ad-user-agent.test.ts +26 -0
- package/vendor/@anvil/common/src/util/__tests__/analytics-dispatcher.test.ts +122 -0
- package/vendor/@anvil/common/src/util/__tests__/analytics-log.test.ts +102 -0
- package/vendor/@anvil/common/src/util/__tests__/analytics-sampling.test.ts +143 -0
- package/vendor/@anvil/common/src/util/__tests__/anvil-streak.test.ts +202 -0
- package/vendor/@anvil/common/src/util/__tests__/anvil-usage-summary.test.ts +193 -0
- package/vendor/@anvil/common/src/util/__tests__/axiom-only-log.test.ts +140 -0
- package/vendor/@anvil/common/src/util/__tests__/client-user-agent.test.ts +148 -0
- package/vendor/@anvil/common/src/util/__tests__/engagement-tracker.test.ts +115 -0
- package/vendor/@anvil/common/src/util/__tests__/env-file-path.test.ts +57 -0
- package/vendor/@anvil/common/src/util/__tests__/error-abort.test.ts +774 -0
- package/vendor/@anvil/common/src/util/__tests__/error-api-details.test.ts +206 -0
- package/vendor/@anvil/common/src/util/__tests__/file-read-limits.test.ts +173 -0
- package/vendor/@anvil/common/src/util/__tests__/format-code-search.test.ts +60 -0
- package/vendor/@anvil/common/src/util/__tests__/log-mirror.test.ts +31 -0
- package/vendor/@anvil/common/src/util/__tests__/messages.test.ts +1252 -0
- package/vendor/@anvil/common/src/util/__tests__/partial-json-delta.test.ts +505 -0
- package/vendor/@anvil/common/src/util/__tests__/path.test.ts +22 -0
- package/vendor/@anvil/common/src/util/__tests__/project-ignore.test.ts +90 -0
- package/vendor/@anvil/common/src/util/__tests__/promise.test.ts +325 -0
- package/vendor/@anvil/common/src/util/__tests__/rate-limit.test.ts +28 -0
- package/vendor/@anvil/common/src/util/__tests__/reddit-anvil-retention.test.ts +130 -0
- package/vendor/@anvil/common/src/util/__tests__/saxy.test.ts +1008 -0
- package/vendor/@anvil/common/src/util/__tests__/split-data.test.ts +289 -0
- package/vendor/@anvil/common/src/util/__tests__/string.test.ts +239 -0
- package/vendor/@anvil/common/src/util/__tests__/thread-title.test.ts +70 -0
- package/vendor/@anvil/common/src/util/__tests__/tool-result-media-order.test.ts +108 -0
- package/vendor/@anvil/common/src/util/__tests__/ttft-histogram.test.ts +180 -0
- package/vendor/@anvil/common/src/util/__tests__/with-timeout.test.ts +24 -0
- package/vendor/@anvil/common/src/util/__tests__/zoned-time.test.ts +88 -0
- package/vendor/@anvil/common/src/util/ad-user-agent.ts +25 -0
- package/vendor/@anvil/common/src/util/agent-file-utils.ts +110 -0
- package/vendor/@anvil/common/src/util/agent-id-parsing.ts +136 -0
- package/vendor/@anvil/common/src/util/agent-name-normalization.ts +38 -0
- package/vendor/@anvil/common/src/util/agent-name-resolver.ts +86 -0
- package/vendor/@anvil/common/src/util/analytics-dispatcher.ts +82 -0
- package/vendor/@anvil/common/src/util/analytics-log.ts +78 -0
- package/vendor/@anvil/common/src/util/analytics-sampling.ts +255 -0
- package/vendor/@anvil/common/src/util/anvil-model-availability.ts +102 -0
- package/vendor/@anvil/common/src/util/anvil-privacy.ts +82 -0
- package/vendor/@anvil/common/src/util/anvil-streak-line.ts +103 -0
- package/vendor/@anvil/common/src/util/anvil-streak.ts +156 -0
- package/vendor/@anvil/common/src/util/anvil-usage-summary.ts +125 -0
- package/vendor/@anvil/common/src/util/array.ts +31 -0
- package/vendor/@anvil/common/src/util/axiom-only-log.ts +124 -0
- package/vendor/@anvil/common/src/util/cache-debug.ts +171 -0
- package/vendor/@anvil/common/src/util/client-user-agent.ts +114 -0
- package/vendor/@anvil/common/src/util/credentials.ts +26 -0
- package/vendor/@anvil/common/src/util/currency.ts +25 -0
- package/vendor/@anvil/common/src/util/dates.ts +81 -0
- package/vendor/@anvil/common/src/util/disposable-email.ts +277 -0
- package/vendor/@anvil/common/src/util/engagement-tracker.ts +129 -0
- package/vendor/@anvil/common/src/util/env-file-path.ts +40 -0
- package/vendor/@anvil/common/src/util/error.ts +562 -0
- package/vendor/@anvil/common/src/util/file-read-limits.ts +236 -0
- package/vendor/@anvil/common/src/util/file.ts +339 -0
- package/vendor/@anvil/common/src/util/format-code-search.ts +115 -0
- package/vendor/@anvil/common/src/util/lazy-response-ads.ts +92 -0
- package/vendor/@anvil/common/src/util/log-data.ts +57 -0
- package/vendor/@anvil/common/src/util/log-ingest.ts +58 -0
- package/vendor/@anvil/common/src/util/log-mirror.ts +34 -0
- package/vendor/@anvil/common/src/util/lru-cache.ts +67 -0
- package/vendor/@anvil/common/src/util/messages.ts +685 -0
- package/vendor/@anvil/common/src/util/min-heap.ts +87 -0
- package/vendor/@anvil/common/src/util/model-utils.ts +4 -0
- package/vendor/@anvil/common/src/util/object.ts +128 -0
- package/vendor/@anvil/common/src/util/partial-json-delta.ts +89 -0
- package/vendor/@anvil/common/src/util/path.ts +15 -0
- package/vendor/@anvil/common/src/util/project-ignore.ts +119 -0
- package/vendor/@anvil/common/src/util/promise.ts +73 -0
- package/vendor/@anvil/common/src/util/random.ts +15 -0
- package/vendor/@anvil/common/src/util/rate-limit.ts +56 -0
- package/vendor/@anvil/common/src/util/reddit-anvil-retention.ts +60 -0
- package/vendor/@anvil/common/src/util/reddit-capi-events.ts +36 -0
- package/vendor/@anvil/common/src/util/response-ad-positions.ts +54 -0
- package/vendor/@anvil/common/src/util/saxy.ts +741 -0
- package/vendor/@anvil/common/src/util/skills.test.ts +44 -0
- package/vendor/@anvil/common/src/util/skills.ts +36 -0
- package/vendor/@anvil/common/src/util/split-data.ts +259 -0
- package/vendor/@anvil/common/src/util/stop-sequence.ts +61 -0
- package/vendor/@anvil/common/src/util/string.ts +426 -0
- package/vendor/@anvil/common/src/util/system-info.ts +53 -0
- package/vendor/@anvil/common/src/util/thread-title.ts +46 -0
- package/vendor/@anvil/common/src/util/ttft-histogram.ts +73 -0
- package/vendor/@anvil/common/src/util/xml-parser.ts +27 -0
- package/vendor/@anvil/common/src/util/xml.ts +17 -0
- package/vendor/@anvil/common/src/util/zod-schema.ts +25 -0
- package/vendor/@anvil/common/src/util/zoned-time.ts +136 -0
- package/vendor/@anvil/common/src/utils/ask-user-bridge.ts +44 -0
- package/vendor/@anvil/sdk/dist/index.cjs +52297 -0
- package/vendor/@anvil/sdk/dist/index.cjs.map +440 -0
- package/vendor/@anvil/sdk/dist/index.d.ts +4277 -0
- package/vendor/@anvil/sdk/dist/index.mjs +52290 -0
- package/vendor/@anvil/sdk/dist/index.mjs.map +440 -0
- package/vendor/@anvil/sdk/dist/vendor/ai.cjs +30886 -0
- package/vendor/@anvil/sdk/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/vendor/@anvil/sdk/dist/vendor/ripgrep/arm64-linux/rg +0 -0
- package/vendor/@anvil/sdk/dist/vendor/ripgrep/x64-darwin/rg +0 -0
- package/vendor/@anvil/sdk/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/vendor/@anvil/sdk/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-c-sharp.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-cpp.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-go.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-java.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-javascript.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-python.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-ruby.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-rust.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-tsx.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter-typescript.wasm +0 -0
- package/vendor/@anvil/sdk/dist/wasm/tree-sitter.wasm +0 -0
- package/vendor/@anvil/sdk/package.json +21 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Union type of all available tool names
|
|
3
|
+
*/
|
|
4
|
+
export type ToolName =
|
|
5
|
+
| 'add_message'
|
|
6
|
+
| 'apply_patch'
|
|
7
|
+
| 'ask_user'
|
|
8
|
+
| 'cloud_plan_ready'
|
|
9
|
+
| 'code_search'
|
|
10
|
+
| 'end_turn'
|
|
11
|
+
| 'find_files'
|
|
12
|
+
| 'glob'
|
|
13
|
+
| 'gravity_index'
|
|
14
|
+
| 'list_directory'
|
|
15
|
+
| 'lookup_agent_info'
|
|
16
|
+
| 'propose_str_replace'
|
|
17
|
+
| 'propose_write_file'
|
|
18
|
+
| 'read_docs'
|
|
19
|
+
| 'read_files'
|
|
20
|
+
| 'read_subtree'
|
|
21
|
+
| 'read_url'
|
|
22
|
+
| 'render_ui'
|
|
23
|
+
| 'run_file_change_hooks'
|
|
24
|
+
| 'run_terminal_command'
|
|
25
|
+
| 'set_messages'
|
|
26
|
+
| 'set_output'
|
|
27
|
+
| 'skill'
|
|
28
|
+
| 'spawn_agents'
|
|
29
|
+
| 'str_replace'
|
|
30
|
+
| 'suggest_followups'
|
|
31
|
+
| 'task_completed'
|
|
32
|
+
| 'think_deeply'
|
|
33
|
+
| 'web_search'
|
|
34
|
+
| 'write_file'
|
|
35
|
+
| 'write_todos'
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Map of tool names to their parameter types
|
|
39
|
+
*/
|
|
40
|
+
export interface ToolParamsMap {
|
|
41
|
+
add_message: AddMessageParams
|
|
42
|
+
apply_patch: ApplyPatchParams
|
|
43
|
+
ask_user: AskUserParams
|
|
44
|
+
cloud_plan_ready: CloudPlanReadyParams
|
|
45
|
+
code_search: CodeSearchParams
|
|
46
|
+
end_turn: EndTurnParams
|
|
47
|
+
find_files: FindFilesParams
|
|
48
|
+
glob: GlobParams
|
|
49
|
+
gravity_index: GravityIndexParams
|
|
50
|
+
list_directory: ListDirectoryParams
|
|
51
|
+
lookup_agent_info: LookupAgentInfoParams
|
|
52
|
+
propose_str_replace: ProposeStrReplaceParams
|
|
53
|
+
propose_write_file: ProposeWriteFileParams
|
|
54
|
+
read_docs: ReadDocsParams
|
|
55
|
+
read_files: ReadFilesParams
|
|
56
|
+
read_subtree: ReadSubtreeParams
|
|
57
|
+
read_url: ReadUrlParams
|
|
58
|
+
render_ui: RenderUiParams
|
|
59
|
+
run_file_change_hooks: RunFileChangeHooksParams
|
|
60
|
+
run_terminal_command: RunTerminalCommandParams
|
|
61
|
+
set_messages: SetMessagesParams
|
|
62
|
+
set_output: SetOutputParams
|
|
63
|
+
skill: SkillParams
|
|
64
|
+
spawn_agents: SpawnAgentsParams
|
|
65
|
+
str_replace: StrReplaceParams
|
|
66
|
+
suggest_followups: SuggestFollowupsParams
|
|
67
|
+
task_completed: TaskCompletedParams
|
|
68
|
+
think_deeply: ThinkDeeplyParams
|
|
69
|
+
web_search: WebSearchParams
|
|
70
|
+
write_file: WriteFileParams
|
|
71
|
+
write_todos: WriteTodosParams
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Add a new message to the conversation history. To be used for complex requests that can't be solved in a single step, as you may forget what happened!
|
|
76
|
+
*/
|
|
77
|
+
export interface AddMessageParams {
|
|
78
|
+
role: 'user' | 'assistant'
|
|
79
|
+
content: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Apply a file operation (create, update, or delete) using Codex-style apply_patch format.
|
|
84
|
+
*/
|
|
85
|
+
export interface ApplyPatchParams {
|
|
86
|
+
/** The file operation to perform. */
|
|
87
|
+
operation: {
|
|
88
|
+
/** Operation type: create_file, update_file, or delete_file */
|
|
89
|
+
type: 'create_file' | 'update_file' | 'delete_file'
|
|
90
|
+
/** File path relative to project root */
|
|
91
|
+
path: string
|
|
92
|
+
/** Diff content. Required for create_file and update_file. Lines prefixed with + for creates, unified diff with @@ hunks for updates. */
|
|
93
|
+
diff?: string
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Ask the user multiple choice questions and pause execution until they respond.
|
|
99
|
+
*/
|
|
100
|
+
export interface AskUserParams {
|
|
101
|
+
/** List of multiple choice questions to ask the user */
|
|
102
|
+
questions: {
|
|
103
|
+
/** The question to ask the user */
|
|
104
|
+
question: string
|
|
105
|
+
/** Short label (max 12 chars) displayed as a chip/tag */
|
|
106
|
+
header?: string
|
|
107
|
+
/** Array of answer options with label and optional description (minimum 2) */
|
|
108
|
+
options: {
|
|
109
|
+
/** The display text for this option */
|
|
110
|
+
label: string
|
|
111
|
+
/** Explanation shown when option is focused */
|
|
112
|
+
description?: string
|
|
113
|
+
}[]
|
|
114
|
+
/** If true, allows selecting multiple options (checkbox). If false, single selection only (radio). */
|
|
115
|
+
multiSelect?: boolean
|
|
116
|
+
/** Validation rules for "Other" text input */
|
|
117
|
+
validation?: {
|
|
118
|
+
/** Maximum length for "Other" text input */
|
|
119
|
+
maxLength?: number
|
|
120
|
+
/** Minimum length for "Other" text input */
|
|
121
|
+
minLength?: number
|
|
122
|
+
/** Regex pattern for "Other" text input */
|
|
123
|
+
pattern?: string
|
|
124
|
+
/** Custom error message when pattern fails */
|
|
125
|
+
patternError?: string
|
|
126
|
+
}
|
|
127
|
+
}[]
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface CloudPlanReadyParams {
|
|
131
|
+
summary: string
|
|
132
|
+
stack: string[]
|
|
133
|
+
build_prompt: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Search for string patterns in the project's files. This tool uses ripgrep (rg), a fast line-oriented search tool. Use this tool only when read_files is not sufficient to find the files you need.
|
|
138
|
+
*/
|
|
139
|
+
export interface CodeSearchParams {
|
|
140
|
+
/** The pattern to search for. */
|
|
141
|
+
pattern: string
|
|
142
|
+
/** Optional ripgrep flags to customize the search (e.g., "-i" for case-insensitive, "-g *.ts -g *.js" for TypeScript and JavaScript files only, "-g !*.test.ts" to exclude Typescript test files, "-A 3" for 3 lines after match, "-B 2" for 2 lines before match). */
|
|
143
|
+
flags?: string
|
|
144
|
+
/** Optional working directory to search within, relative to the project root. Defaults to searching the entire project. */
|
|
145
|
+
cwd?: string
|
|
146
|
+
/** Maximum number of results to return per file. Defaults to 15. There is also a global limit of 250 results across all files. */
|
|
147
|
+
maxResults?: number
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* End your turn, regardless of any new tool results that might be coming. This will allow the user to type another prompt.
|
|
152
|
+
*/
|
|
153
|
+
export interface EndTurnParams {}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Find several files related to a brief natural language description of the files or the name of a function or class you are looking for.
|
|
157
|
+
*/
|
|
158
|
+
export interface FindFilesParams {
|
|
159
|
+
/** A brief natural language description of the files or the name of a function or class you are looking for. It's also helpful to mention a directory or two to look within. */
|
|
160
|
+
prompt: string
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Search for files matching a glob pattern. Returns matching file paths sorted by modification time.
|
|
165
|
+
*/
|
|
166
|
+
export interface GlobParams {
|
|
167
|
+
/** Glob pattern to match files against (e.g., *.js, src/glob/*.ts, glob/test/glob/*.go). */
|
|
168
|
+
pattern: string
|
|
169
|
+
/** Optional working directory to search within, relative to project root. If not provided, searches from project root. */
|
|
170
|
+
cwd?: string
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Use the Gravity Index tool discovery and install API.
|
|
175
|
+
*/
|
|
176
|
+
export interface GravityIndexParams {
|
|
177
|
+
/** Which Gravity Index operation to perform. search: recommend a provider; browse: list catalog services; list_categories: list categories with counts; get_service: full detail for a known slug; report_integration: report a completed integration. */
|
|
178
|
+
action:
|
|
179
|
+
| 'search'
|
|
180
|
+
| 'browse'
|
|
181
|
+
| 'list_categories'
|
|
182
|
+
| 'get_service'
|
|
183
|
+
| 'report_integration'
|
|
184
|
+
/** For action "search": what the user needs, including stack, constraints, and required capabilities. */
|
|
185
|
+
query?: string
|
|
186
|
+
/** For action "search": continue a previous search. For action "report_integration": the search_id from the earlier search result (required). */
|
|
187
|
+
search_id?: string
|
|
188
|
+
/** For action "search": optional structured JSON context about the project, stack, or constraints. */
|
|
189
|
+
context?: Record<string, any>
|
|
190
|
+
/** For action "browse": optional category filter, e.g. Database, Auth, Payments, Hosting, Email, AI. */
|
|
191
|
+
category?: string
|
|
192
|
+
/** For action "browse": optional keyword filter, e.g. sendgrid or postgres. */
|
|
193
|
+
q?: string
|
|
194
|
+
/** For action "get_service": service slug, e.g. supabase, stripe, sendgrid (required). */
|
|
195
|
+
slug?: string
|
|
196
|
+
/** For action "report_integration": slug of the service that was actually integrated (required). */
|
|
197
|
+
integrated_slug?: string
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* List files and directories in the specified path. Returns separate arrays of file names and directory names.
|
|
202
|
+
*/
|
|
203
|
+
export interface ListDirectoryParams {
|
|
204
|
+
/** Directory path to list, relative to the project root. */
|
|
205
|
+
path: string
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Retrieve information about an agent by ID
|
|
210
|
+
*/
|
|
211
|
+
export interface LookupAgentInfoParams {
|
|
212
|
+
/** Agent ID (short local or full published format) */
|
|
213
|
+
agentId: string
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Propose string replacements in a file without actually applying them.
|
|
218
|
+
*/
|
|
219
|
+
export interface ProposeStrReplaceParams {
|
|
220
|
+
/** The path to the file to edit. */
|
|
221
|
+
path: string
|
|
222
|
+
/** Array of replacements to make. */
|
|
223
|
+
replacements: {
|
|
224
|
+
/** The string to replace. This must be an *exact match* of the string you want to replace, including whitespace and punctuation. */
|
|
225
|
+
oldString: string
|
|
226
|
+
/** The string to replace the corresponding oldString with. Can be empty to delete. */
|
|
227
|
+
newString: string
|
|
228
|
+
/** Whether to allow multiple replacements of oldString. */
|
|
229
|
+
allowMultiple?: boolean
|
|
230
|
+
}[]
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Propose creating or editing a file without actually applying the changes.
|
|
235
|
+
*/
|
|
236
|
+
export interface ProposeWriteFileParams {
|
|
237
|
+
/** Path to the file relative to the **project root** */
|
|
238
|
+
path: string
|
|
239
|
+
/** What the change is intended to do in only one sentence. */
|
|
240
|
+
instructions: string
|
|
241
|
+
/** Edit snippet to apply to the file. */
|
|
242
|
+
content: string
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Fetch up-to-date documentation for libraries and frameworks using Context7 API.
|
|
247
|
+
*/
|
|
248
|
+
export interface ReadDocsParams {
|
|
249
|
+
/** The library or framework name (e.g., "Next.js", "MongoDB", "React"). Use the official name as it appears in documentation if possible. Only public libraries available in Context7's database are supported, so small or private libraries may not be available. */
|
|
250
|
+
libraryTitle: string
|
|
251
|
+
/** Specific topic to focus on (e.g., "routing", "hooks", "authentication") */
|
|
252
|
+
topic: string
|
|
253
|
+
/** Optional maximum number of tokens to return. Defaults to 10000. */
|
|
254
|
+
max_tokens?: number
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Read the multiple files from disk and return their contents. Use this tool to read as many files as would be helpful to answer the user's request.
|
|
259
|
+
*/
|
|
260
|
+
export interface ReadFilesParams {
|
|
261
|
+
/** List of file paths to read. */
|
|
262
|
+
paths: string[]
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Read one or more directory subtrees (as a blob including subdirectories, file names, and parsed variables within each source file) or return parsed variable names for files. If no paths are provided, returns the entire project tree.
|
|
267
|
+
*/
|
|
268
|
+
export interface ReadSubtreeParams {
|
|
269
|
+
/** List of paths to directories or files. Relative to the project root. If omitted, the entire project tree is used. */
|
|
270
|
+
paths?: string[]
|
|
271
|
+
/** Maximum token budget for the subtree blob; the tree will be truncated to fit within this budget by first dropping file variables and then removing the most-nested files and directories. */
|
|
272
|
+
maxTokens?: number
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Fetch a URL and extract readable text from the page.
|
|
277
|
+
*/
|
|
278
|
+
export interface ReadUrlParams {
|
|
279
|
+
/** The full http:// or https:// URL to fetch and extract readable text from. */
|
|
280
|
+
url: string
|
|
281
|
+
/** Maximum number of extracted text characters to return. Defaults to 20000. */
|
|
282
|
+
max_chars?: number
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Render a small interactive UI widget in the Anvil CLI. Currently supports a button that opens a link.
|
|
287
|
+
*/
|
|
288
|
+
export interface RenderUiParams {
|
|
289
|
+
/** The UI widget to render. */
|
|
290
|
+
widget: {
|
|
291
|
+
/** Widget type. Currently, the only supported widget is button. */
|
|
292
|
+
type: 'button'
|
|
293
|
+
/** Short button label shown to the user. */
|
|
294
|
+
text: string
|
|
295
|
+
/** The http:// or https:// URL to open when the user clicks the button. */
|
|
296
|
+
link: string
|
|
297
|
+
/** Theme-aware color treatment. Use primary for the main action and secondary for lower-emphasis actions. */
|
|
298
|
+
variant?: 'primary' | 'secondary'
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Parameters for run_file_change_hooks tool
|
|
304
|
+
*/
|
|
305
|
+
export interface RunFileChangeHooksParams {
|
|
306
|
+
/** List of file paths that were changed and should trigger file change hooks */
|
|
307
|
+
files: string[]
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Execute a CLI command from the **project root** (different from the user's cwd).
|
|
312
|
+
*/
|
|
313
|
+
export interface RunTerminalCommandParams {
|
|
314
|
+
/** CLI command valid for user's OS. */
|
|
315
|
+
command: string
|
|
316
|
+
/** Either SYNC (waits, returns output) or BACKGROUND (runs in background). Default SYNC */
|
|
317
|
+
process_type?: 'SYNC' | 'BACKGROUND'
|
|
318
|
+
/** The working directory to run the command in. Default is the project root. */
|
|
319
|
+
cwd?: string
|
|
320
|
+
/** Set to -1 for no timeout. Does not apply for BACKGROUND commands. Default 30 */
|
|
321
|
+
timeout_seconds?: number
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Set the conversation history to the provided messages.
|
|
326
|
+
*/
|
|
327
|
+
export interface SetMessagesParams {
|
|
328
|
+
messages: any
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* JSON object to set as the agent output. This completely replaces any previous output. If the agent was spawned, this value will be passed back to its parent. If the agent has an outputSchema defined, the output will be validated against it.
|
|
333
|
+
*/
|
|
334
|
+
export interface SetOutputParams {}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Load a skill's full instructions when relevant to the current task. Skills are loaded on-demand - only load them when you need their specific guidance.
|
|
338
|
+
*/
|
|
339
|
+
export interface SkillParams {
|
|
340
|
+
/** The name of the skill to load */
|
|
341
|
+
name: string
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Spawn multiple agents and send a prompt and/or parameters to each of them. These agents will run in parallel. Note that that means they will run independently. If you need to run agents sequentially, use spawn_agents with one agent at a time instead.
|
|
346
|
+
*/
|
|
347
|
+
export interface SpawnAgentsParams {
|
|
348
|
+
agents: {
|
|
349
|
+
/** Agent to spawn */
|
|
350
|
+
agent_type: string
|
|
351
|
+
/** Prompt to send to the agent */
|
|
352
|
+
prompt?: string
|
|
353
|
+
/** Parameters object for the agent (if any) */
|
|
354
|
+
params?: Record<string, any>
|
|
355
|
+
}[]
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Replace strings in a file with new strings.
|
|
360
|
+
*/
|
|
361
|
+
export interface StrReplaceParams {
|
|
362
|
+
/** The path to the file to edit. */
|
|
363
|
+
path: string
|
|
364
|
+
/** Array of replacements to make. */
|
|
365
|
+
replacements: {
|
|
366
|
+
/** The string to replace. This must be an *exact match* of the string you want to replace, including whitespace and punctuation. */
|
|
367
|
+
oldString: string
|
|
368
|
+
/** The string to replace the corresponding oldString with. Can be empty to delete. */
|
|
369
|
+
newString: string
|
|
370
|
+
/** Whether to allow multiple replacements of oldString. */
|
|
371
|
+
allowMultiple?: boolean
|
|
372
|
+
}[]
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Suggest clickable followup prompts to the user.
|
|
377
|
+
*/
|
|
378
|
+
export interface SuggestFollowupsParams {
|
|
379
|
+
/** List of suggested followup prompts the user can click to send */
|
|
380
|
+
followups: {
|
|
381
|
+
/** The prompt text to send as a user message when clicked. Keep it short and goal-oriented — one sentence naming the outcome, not the steps to get there */
|
|
382
|
+
prompt: string
|
|
383
|
+
/** Short display label for the card (defaults to truncated prompt if not provided) */
|
|
384
|
+
label?: string
|
|
385
|
+
}[]
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Signal that the task is complete. Use this tool when:
|
|
390
|
+
- The user's request is completely fulfilled
|
|
391
|
+
- You need clarification from the user before continuing
|
|
392
|
+
- You are stuck or need help from the user to continue
|
|
393
|
+
|
|
394
|
+
This tool explicitly marks the end of your work on the current task.
|
|
395
|
+
*/
|
|
396
|
+
export interface TaskCompletedParams {}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Deeply consider complex tasks by brainstorming approaches and tradeoffs step-by-step.
|
|
400
|
+
*/
|
|
401
|
+
export interface ThinkDeeplyParams {
|
|
402
|
+
/** Detailed step-by-step analysis. Initially keep each step concise (max ~5-7 words per step). */
|
|
403
|
+
thought: string
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Search the web for current information using Serper API.
|
|
408
|
+
*/
|
|
409
|
+
export interface WebSearchParams {
|
|
410
|
+
/** The search query to find relevant web content */
|
|
411
|
+
query: string
|
|
412
|
+
/** Search depth - 'standard' for quick results, 'deep' for more comprehensive search. Default is 'standard'. */
|
|
413
|
+
depth?: 'standard' | 'deep'
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Create or edit a file with the given content.
|
|
418
|
+
*/
|
|
419
|
+
export interface WriteFileParams {
|
|
420
|
+
/** Path to the file relative to the **project root** */
|
|
421
|
+
path: string
|
|
422
|
+
/** What the change is intended to do in only one sentence. */
|
|
423
|
+
instructions: string
|
|
424
|
+
/** Edit snippet to apply to the file. */
|
|
425
|
+
content: string
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Write a todo list to track tasks for multi-step implementations. Use this frequently to maintain an updated step-by-step plan.
|
|
430
|
+
*/
|
|
431
|
+
export interface WriteTodosParams {
|
|
432
|
+
/** List of todos with their completion status. Add ALL of the applicable tasks to the list, so you don't forget to do anything. Try to order the todos the same way you will complete them. Do not mark todos as completed if you have not completed them yet! */
|
|
433
|
+
todos: {
|
|
434
|
+
/** Description of the task */
|
|
435
|
+
task: string
|
|
436
|
+
/** Whether the task is completed */
|
|
437
|
+
completed: boolean
|
|
438
|
+
}[]
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Get parameters type for a specific tool
|
|
443
|
+
*/
|
|
444
|
+
export type GetToolParams<T extends ToolName> = ToolParamsMap[T]
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// ===== JSON Types =====
|
|
2
|
+
export type JSONValue =
|
|
3
|
+
| null
|
|
4
|
+
| string
|
|
5
|
+
| number
|
|
6
|
+
| boolean
|
|
7
|
+
| JSONObject
|
|
8
|
+
| JSONArray
|
|
9
|
+
|
|
10
|
+
export type JSONObject = { [key: string]: JSONValue | undefined }
|
|
11
|
+
|
|
12
|
+
export type JSONArray = JSONValue[]
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* JSON Schema definition (for prompt schema or output schema)
|
|
16
|
+
*/
|
|
17
|
+
export type JsonSchema = {
|
|
18
|
+
type?:
|
|
19
|
+
| 'object'
|
|
20
|
+
| 'array'
|
|
21
|
+
| 'string'
|
|
22
|
+
| 'number'
|
|
23
|
+
| 'boolean'
|
|
24
|
+
| 'null'
|
|
25
|
+
| 'integer'
|
|
26
|
+
description?: string
|
|
27
|
+
properties?: Record<string, JsonSchema | boolean>
|
|
28
|
+
required?: string[]
|
|
29
|
+
enum?: Array<string | number | boolean | null>
|
|
30
|
+
[k: string]: unknown
|
|
31
|
+
}
|
|
32
|
+
export type JsonObjectSchema = JsonSchema & { type: 'object' }
|
|
33
|
+
|
|
34
|
+
// ===== Data Content Types =====
|
|
35
|
+
export type DataContent = string | Uint8Array | ArrayBuffer | Buffer
|
|
36
|
+
|
|
37
|
+
// ===== Provider Metadata Types =====
|
|
38
|
+
export type ProviderMetadata = Record<
|
|
39
|
+
string,
|
|
40
|
+
Record<string, JSONValue | undefined>
|
|
41
|
+
>
|
|
42
|
+
|
|
43
|
+
// ===== Content Part Types =====
|
|
44
|
+
export type TextPart = {
|
|
45
|
+
type: 'text'
|
|
46
|
+
text: string
|
|
47
|
+
providerOptions?: ProviderMetadata
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type ImagePart = {
|
|
51
|
+
type: 'image'
|
|
52
|
+
image: DataContent
|
|
53
|
+
mediaType?: string
|
|
54
|
+
providerOptions?: ProviderMetadata
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type FilePart = {
|
|
58
|
+
type: 'file'
|
|
59
|
+
data: DataContent
|
|
60
|
+
filename?: string
|
|
61
|
+
mediaType: string
|
|
62
|
+
providerOptions?: ProviderMetadata
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type ReasoningPart = {
|
|
66
|
+
type: 'reasoning'
|
|
67
|
+
text: string
|
|
68
|
+
providerOptions?: ProviderMetadata
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ToolCallPart = {
|
|
72
|
+
type: 'tool-call'
|
|
73
|
+
toolCallId: string
|
|
74
|
+
toolName: string
|
|
75
|
+
input: Record<string, unknown>
|
|
76
|
+
providerOptions?: ProviderMetadata
|
|
77
|
+
providerExecuted?: boolean
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ToolResultOutput =
|
|
81
|
+
| {
|
|
82
|
+
type: 'json'
|
|
83
|
+
value: JSONValue
|
|
84
|
+
}
|
|
85
|
+
| {
|
|
86
|
+
type: 'media'
|
|
87
|
+
data: string
|
|
88
|
+
mediaType: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ===== Message Types =====
|
|
92
|
+
export type AuxiliaryMessageData = {
|
|
93
|
+
providerOptions?: ProviderMetadata
|
|
94
|
+
tags?: string[]
|
|
95
|
+
|
|
96
|
+
/** @deprecated Use tags instead. */
|
|
97
|
+
timeToLive?: 'agentStep' | 'userPrompt'
|
|
98
|
+
/** @deprecated Use tags instead. */
|
|
99
|
+
keepDuringTruncation?: boolean
|
|
100
|
+
/** @deprecated Use tags instead. */
|
|
101
|
+
keepLastTags?: string[]
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type SystemMessage = {
|
|
105
|
+
role: 'system'
|
|
106
|
+
content: TextPart[]
|
|
107
|
+
} & AuxiliaryMessageData
|
|
108
|
+
|
|
109
|
+
export type UserMessage = {
|
|
110
|
+
role: 'user'
|
|
111
|
+
content: (TextPart | ImagePart | FilePart)[]
|
|
112
|
+
} & AuxiliaryMessageData
|
|
113
|
+
|
|
114
|
+
export type AssistantMessage = {
|
|
115
|
+
role: 'assistant'
|
|
116
|
+
content: (TextPart | ReasoningPart | ToolCallPart)[]
|
|
117
|
+
} & AuxiliaryMessageData
|
|
118
|
+
|
|
119
|
+
export type ToolMessage = {
|
|
120
|
+
role: 'tool'
|
|
121
|
+
toolCallId: string
|
|
122
|
+
toolName: string
|
|
123
|
+
content: ToolResultOutput[]
|
|
124
|
+
} & AuxiliaryMessageData
|
|
125
|
+
|
|
126
|
+
export type Message =
|
|
127
|
+
| SystemMessage
|
|
128
|
+
| UserMessage
|
|
129
|
+
| AssistantMessage
|
|
130
|
+
| ToolMessage
|
|
131
|
+
|
|
132
|
+
// ===== MCP Server Types =====
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* MCP server configuration for stdio-based servers.
|
|
136
|
+
*
|
|
137
|
+
* Environment variables in `env` can be:
|
|
138
|
+
* - A plain string value (hardcoded, e.g., `'production'`)
|
|
139
|
+
* - A `$VAR_NAME` reference to read from local environment (e.g., `'$NOTION_TOKEN'`)
|
|
140
|
+
*
|
|
141
|
+
* The `$VAR_NAME` syntax reads from `process.env.VAR_NAME` at agent load time.
|
|
142
|
+
* This keeps secrets out of your agent definitions - store them in `.env.local` instead.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* env: {
|
|
147
|
+
* // Read NOTION_TOKEN from local .env file
|
|
148
|
+
* NOTION_TOKEN: '$NOTION_TOKEN',
|
|
149
|
+
* // Read MY_API_KEY from local env, pass as API_KEY to MCP server
|
|
150
|
+
* API_KEY: '$MY_API_KEY',
|
|
151
|
+
* // Hardcoded value (non-secret)
|
|
152
|
+
* NODE_ENV: 'production',
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export type MCPConfig =
|
|
157
|
+
| {
|
|
158
|
+
type?: 'stdio'
|
|
159
|
+
command: string
|
|
160
|
+
args?: string[]
|
|
161
|
+
env?: Record<string, string>
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
type?: 'http' | 'sse'
|
|
165
|
+
url: string
|
|
166
|
+
params?: Record<string, string>
|
|
167
|
+
headers?: Record<string, string>
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// ============================================================================
|
|
171
|
+
// Logger Interface
|
|
172
|
+
// ============================================================================
|
|
173
|
+
export interface Logger {
|
|
174
|
+
debug: (data: any, msg?: string) => void
|
|
175
|
+
info: (data: any, msg?: string) => void
|
|
176
|
+
warn: (data: any, msg?: string) => void
|
|
177
|
+
error: (data: any, msg?: string) => void
|
|
178
|
+
}
|