@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,435 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum of analytics event types used throughout the application
|
|
3
|
+
*/
|
|
4
|
+
export enum AnalyticsEvent {
|
|
5
|
+
// Cross-surface — DAU
|
|
6
|
+
// Emitted exactly once per user-submitted message/prompt, on each surface,
|
|
7
|
+
// and never sampled. `distinct_id` is the canonical anvil Postgres user
|
|
8
|
+
// id on every surface, so unique-users of this event gives accurate
|
|
9
|
+
// per-surface DAU (filter on the `surface` property) and a combined DAU (no
|
|
10
|
+
// filter). The `surface` property is one of: cli, web, chat, desktop, cloud
|
|
11
|
+
// (web = the anvil.com builder, cloud = connected-repo builder projects).
|
|
12
|
+
// Emission points: cli client analytics; chat's stream route (server-side);
|
|
13
|
+
// desktop's analytics module; web/cloud via the Convex send mutation
|
|
14
|
+
// (PostHog + Axiom, both direct from Convex — see convex/analytics.ts).
|
|
15
|
+
MESSAGE_SENT = 'message_sent',
|
|
16
|
+
|
|
17
|
+
// Cross-surface — engaged time
|
|
18
|
+
// Emitted once per minute of *active engagement* on each surface (cli / web /
|
|
19
|
+
// chat / cloud / desktop) while the user is present (visible+focused for
|
|
20
|
+
// browser surfaces, recently-active for the CLI) and not idle. Never sampled.
|
|
21
|
+
// `distinct_id` is the canonical user id where available (anonymous/device id
|
|
22
|
+
// otherwise). Because interval = 1 minute, a raw event COUNT equals minutes
|
|
23
|
+
// spent: sum per product = Total count broken down by `surface`; average per
|
|
24
|
+
// user = "Average count per user" broken down by `surface`. See
|
|
25
|
+
// common/src/util/engagement-tracker.ts.
|
|
26
|
+
PRODUCT_ACTIVE_MINUTE = 'product_active_minute',
|
|
27
|
+
|
|
28
|
+
// CLI
|
|
29
|
+
APP_LAUNCHED = 'cli.app_launched',
|
|
30
|
+
FINGERPRINT_GENERATED = 'cli.fingerprint_generated',
|
|
31
|
+
CHANGE_DIRECTORY = 'cli.change_directory',
|
|
32
|
+
INVALID_COMMAND = 'cli.invalid_command',
|
|
33
|
+
KNOWLEDGE_FILE_UPDATED = 'cli.knowledge_file_updated',
|
|
34
|
+
LOGIN = 'cli.login',
|
|
35
|
+
// Login funnel — the path between launch and a successful `cli.login`.
|
|
36
|
+
// Emitted from login-flow.ts (the chokepoint both the modal and the
|
|
37
|
+
// `login` command share); all tagged with `via` (modal | plain_command).
|
|
38
|
+
LOGIN_STARTED = 'cli.login_started',
|
|
39
|
+
LOGIN_FAILED = 'cli.login_failed',
|
|
40
|
+
LOGIN_TIMEOUT = 'cli.login_timeout',
|
|
41
|
+
LOGIN_ABORTED = 'cli.login_aborted',
|
|
42
|
+
SLASH_MENU_ACTIVATED = 'cli.slash_menu_activated',
|
|
43
|
+
SLASH_COMMAND_USED = 'cli.slash_command_used',
|
|
44
|
+
TERMINAL_BROKER_SPAWN_FAILED = 'cli.terminal_broker_spawn_failed',
|
|
45
|
+
TERMINAL_WATCHDOG_FAILED = 'cli.terminal_watchdog_failed',
|
|
46
|
+
TERMINAL_COMMAND_COMPLETED = 'cli.terminal_command_completed',
|
|
47
|
+
USER_INPUT_COMPLETE = 'cli.user_input_complete',
|
|
48
|
+
UPDATE_ANVIL_FAILED = 'cli.update_anvil_failed',
|
|
49
|
+
FEEDBACK_BUTTON_HOVERED = 'cli.feedback_button_hovered',
|
|
50
|
+
FOLLOWUP_CLICKED = 'cli.followup_clicked',
|
|
51
|
+
SUGGESTED_PROMPT_SHOWN = 'cli.suggested_prompt_shown',
|
|
52
|
+
SUGGESTED_PROMPT_CLICKED = 'cli.suggested_prompt_clicked',
|
|
53
|
+
// Sampled per eligible transcript slot; use response_id to recover the
|
|
54
|
+
// response-length distribution without ingesting every user's full stream.
|
|
55
|
+
CLI_INLINE_AD_SLOT_ELIGIBLE = 'cli.inline_ad_slot_eligible',
|
|
56
|
+
// Emitted once when a response needs a fifth slot and starts reusing its
|
|
57
|
+
// four-ad pool.
|
|
58
|
+
CLI_INLINE_AD_POOL_REUSED = 'cli.inline_ad_pool_reused',
|
|
59
|
+
|
|
60
|
+
// Backend
|
|
61
|
+
AGENT_STEP = 'backend.agent_step',
|
|
62
|
+
CREDIT_GRANT = 'backend.credit_grant',
|
|
63
|
+
CREDIT_CONSUMED = 'backend.credit_consumed',
|
|
64
|
+
MALFORMED_TOOL_CALL_JSON = 'backend.malformed_tool_call_json',
|
|
65
|
+
TOOL_USE = 'backend.tool_use',
|
|
66
|
+
UNKNOWN_TOOL_CALL = 'backend.unknown_tool_call',
|
|
67
|
+
USER_INPUT = 'backend.user_input',
|
|
68
|
+
|
|
69
|
+
// Backend - Database Operations
|
|
70
|
+
ADVISORY_LOCK_CONTENTION = 'backend.advisory_lock_contention',
|
|
71
|
+
TRANSACTION_RETRY_THRESHOLD_EXCEEDED = 'backend.transaction_retry_threshold_exceeded',
|
|
72
|
+
|
|
73
|
+
// Backend - Subscription
|
|
74
|
+
SUBSCRIPTION_CREATED = 'backend.subscription_created',
|
|
75
|
+
SUBSCRIPTION_CANCELED = 'backend.subscription_canceled',
|
|
76
|
+
SUBSCRIPTION_PAYMENT_FAILED = 'backend.subscription_payment_failed',
|
|
77
|
+
SUBSCRIPTION_BLOCK_CREATED = 'backend.subscription_block_created',
|
|
78
|
+
SUBSCRIPTION_BLOCK_LIMIT_HIT = 'backend.subscription_block_limit_hit',
|
|
79
|
+
SUBSCRIPTION_WEEKLY_LIMIT_HIT = 'backend.subscription_weekly_limit_hit',
|
|
80
|
+
SUBSCRIPTION_CREDITS_MIGRATED = 'backend.subscription_credits_migrated',
|
|
81
|
+
SUBSCRIPTION_TIER_CHANGED = 'backend.subscription_tier_changed',
|
|
82
|
+
|
|
83
|
+
// Web
|
|
84
|
+
SIGNUP = 'web.signup',
|
|
85
|
+
|
|
86
|
+
// Web - Authentication
|
|
87
|
+
AUTH_LOGIN_STARTED = 'auth.login_started',
|
|
88
|
+
AUTH_LOGOUT_COMPLETED = 'auth.logout_completed',
|
|
89
|
+
|
|
90
|
+
// Web - Cookie Consent
|
|
91
|
+
COOKIE_CONSENT_ACCEPTED = 'cookie_consent.accepted',
|
|
92
|
+
COOKIE_CONSENT_DECLINED = 'cookie_consent.declined',
|
|
93
|
+
|
|
94
|
+
// Web - Onboarding
|
|
95
|
+
ONBOARDING_STEP_COMPLETED = 'onboarding_step_completed',
|
|
96
|
+
ONBOARDING_STEP_VIEWED = 'onboarding_step_viewed',
|
|
97
|
+
ONBOARDING_PM_SELECTED = 'onboarding_pm_selected',
|
|
98
|
+
ONBOARDING_EDITOR_OPENED = 'onboarding_editor_opened',
|
|
99
|
+
|
|
100
|
+
// Web - Onboard Page
|
|
101
|
+
ONBOARD_PAGE_CD_COMMAND_COPIED = 'onboard_page.cd_command_copied',
|
|
102
|
+
ONBOARD_PAGE_RUN_COMMAND_COPIED = 'onboard_page.run_command_copied',
|
|
103
|
+
ONBOARD_PAGE_INSTALL_COMMAND_COPIED = 'onboard_page.install_command_copied',
|
|
104
|
+
|
|
105
|
+
// Web - Creator Attribution
|
|
106
|
+
ANVIL_REFERRER_ATTRIBUTED = 'anvil.referrer_attributed',
|
|
107
|
+
|
|
108
|
+
// Web - Install Dialog
|
|
109
|
+
INSTALL_DIALOG_CD_COMMAND_COPIED = 'install_dialog.cd_command_copied',
|
|
110
|
+
INSTALL_DIALOG_RUN_COMMAND_COPIED = 'install_dialog.run_command_copied',
|
|
111
|
+
INSTALL_DIALOG_INSTALL_COMMAND_COPIED = 'install_dialog.install_command_copied',
|
|
112
|
+
|
|
113
|
+
// Web - Home Page
|
|
114
|
+
HOME_FEATURE_LEARN_MORE_CLICKED = 'home.feature_learn_more_clicked',
|
|
115
|
+
HOME_INSTALL_COMMAND_COPIED = 'home.install_command_copied',
|
|
116
|
+
HOME_TRY_FREE_CLICKED = 'home.try_free_clicked',
|
|
117
|
+
HOME_TESTIMONIAL_CLICKED = 'home.testimonial_clicked',
|
|
118
|
+
HOME_CTA_INSTALL_GUIDE_CLICKED = 'home.cta_install_guide_clicked',
|
|
119
|
+
HOME_COMPETITION_TAB_CHANGED = 'home.competition_tab_changed',
|
|
120
|
+
|
|
121
|
+
// Web - Demo Terminal
|
|
122
|
+
DEMO_TERMINAL_COMMAND_EXECUTED = 'demo_terminal.command_executed',
|
|
123
|
+
DEMO_TERMINAL_HELP_VIEWED = 'demo_terminal.help_viewed',
|
|
124
|
+
DEMO_TERMINAL_OPTIMIZE_REQUESTED = 'demo_terminal.optimize_requested',
|
|
125
|
+
DEMO_TERMINAL_FIX_MEMORY_LEAK = 'demo_terminal.fix_memory_leak',
|
|
126
|
+
DEMO_TERMINAL_REFACTOR_REQUESTED = 'demo_terminal.refactor_requested',
|
|
127
|
+
DEMO_TERMINAL_FEATURE_REQUESTED = 'demo_terminal.feature_requested',
|
|
128
|
+
DEMO_TERMINAL_THEME_CHANGED = 'demo_terminal.theme_changed',
|
|
129
|
+
|
|
130
|
+
// Web - UI Components
|
|
131
|
+
TOAST_SHOWN = 'toast.shown',
|
|
132
|
+
|
|
133
|
+
// Web - API
|
|
134
|
+
AGENT_RUN_API_REQUEST = 'api.agent_run_request',
|
|
135
|
+
AGENT_RUN_CREATED = 'api.agent_run_created',
|
|
136
|
+
AGENT_RUN_COMPLETED = 'api.agent_run_completed',
|
|
137
|
+
AGENT_RUN_VALIDATION_ERROR = 'api.agent_run_validation_error',
|
|
138
|
+
AGENT_RUN_CREATION_ERROR = 'api.agent_run_creation_error',
|
|
139
|
+
AGENT_RUN_COMPLETION_ERROR = 'api.agent_run_completion_error',
|
|
140
|
+
ME_API_REQUEST = 'api.me_request',
|
|
141
|
+
ME_VALIDATION_ERROR = 'api.me_validation_error',
|
|
142
|
+
CHAT_COMPLETIONS_REQUEST = 'api.chat_completions_request',
|
|
143
|
+
CHAT_COMPLETIONS_AUTH_ERROR = 'api.chat_completions_auth_error',
|
|
144
|
+
CHAT_COMPLETIONS_VALIDATION_ERROR = 'api.chat_completions_validation_error',
|
|
145
|
+
CHAT_COMPLETIONS_INSUFFICIENT_CREDITS = 'api.chat_completions_insufficient_credits',
|
|
146
|
+
CHAT_COMPLETIONS_GENERATION_STARTED = 'api.chat_completions_generation_started',
|
|
147
|
+
CHAT_COMPLETIONS_STREAM_STARTED = 'api.chat_completions_stream_started',
|
|
148
|
+
CHAT_COMPLETIONS_ERROR = 'api.chat_completions_error',
|
|
149
|
+
|
|
150
|
+
// Web - Usage API
|
|
151
|
+
USAGE_API_REQUEST = 'api.usage_request',
|
|
152
|
+
USAGE_API_AUTH_ERROR = 'api.usage_auth_error',
|
|
153
|
+
|
|
154
|
+
// Web - Search API
|
|
155
|
+
WEB_SEARCH_REQUEST = 'api.web_search_request',
|
|
156
|
+
WEB_SEARCH_AUTH_ERROR = 'api.web_search_auth_error',
|
|
157
|
+
WEB_SEARCH_VALIDATION_ERROR = 'api.web_search_validation_error',
|
|
158
|
+
WEB_SEARCH_INSUFFICIENT_CREDITS = 'api.web_search_insufficient_credits',
|
|
159
|
+
WEB_SEARCH_ERROR = 'api.web_search_error',
|
|
160
|
+
|
|
161
|
+
DOCS_SEARCH_REQUEST = 'api.docs_search_request',
|
|
162
|
+
DOCS_SEARCH_AUTH_ERROR = 'api.docs_search_auth_error',
|
|
163
|
+
DOCS_SEARCH_VALIDATION_ERROR = 'api.docs_search_validation_error',
|
|
164
|
+
DOCS_SEARCH_INSUFFICIENT_CREDITS = 'api.docs_search_insufficient_credits',
|
|
165
|
+
DOCS_SEARCH_ERROR = 'api.docs_search_error',
|
|
166
|
+
|
|
167
|
+
GRAVITY_INDEX_REQUEST = 'api.gravity_index_request',
|
|
168
|
+
GRAVITY_INDEX_AUTH_ERROR = 'api.gravity_index_auth_error',
|
|
169
|
+
GRAVITY_INDEX_VALIDATION_ERROR = 'api.gravity_index_validation_error',
|
|
170
|
+
GRAVITY_INDEX_ERROR = 'api.gravity_index_error',
|
|
171
|
+
|
|
172
|
+
// Web - Feedback API
|
|
173
|
+
FEEDBACK_SUBMITTED = 'api.feedback_submitted',
|
|
174
|
+
FEEDBACK_AUTH_ERROR = 'api.feedback_auth_error',
|
|
175
|
+
FEEDBACK_VALIDATION_ERROR = 'api.feedback_validation_error',
|
|
176
|
+
|
|
177
|
+
// Web - Logs ingest API (client logs/events → BigQuery)
|
|
178
|
+
LOGS_INGEST_AUTH_ERROR = 'api.logs_ingest_auth_error',
|
|
179
|
+
LOGS_INGEST_VALIDATION_ERROR = 'api.logs_ingest_validation_error',
|
|
180
|
+
|
|
181
|
+
// Web - Ads API
|
|
182
|
+
ADS_API_AUTH_ERROR = 'api.ads_auth_error',
|
|
183
|
+
ADS_FETCH_COMPLETED = 'ads.fetch_completed',
|
|
184
|
+
ADS_IMPRESSION_RECORDED = 'ads.impression_recorded',
|
|
185
|
+
ADS_CLICKED = 'ads.clicked',
|
|
186
|
+
|
|
187
|
+
// Web - Token Count API
|
|
188
|
+
TOKEN_COUNT_REQUEST = 'api.token_count_request',
|
|
189
|
+
TOKEN_COUNT_AUTH_ERROR = 'api.token_count_auth_error',
|
|
190
|
+
TOKEN_COUNT_VALIDATION_ERROR = 'api.token_count_validation_error',
|
|
191
|
+
TOKEN_COUNT_ERROR = 'api.token_count_error',
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
// Anvil - Referral program server lifecycle (emitted from packages/billing
|
|
195
|
+
// via the server logger → Axiom `event` column).
|
|
196
|
+
ANVIL_REFERRAL_REDEEMED = 'anvil.referral.redeemed',
|
|
197
|
+
// A redemption attempt that hit one of the one-shot eligibility guards
|
|
198
|
+
// (signup_too_old, user_banned, referrer_limit_reached, reverse_referral,
|
|
199
|
+
// self_referral). Deliberately EXCLUDES the two repeat-prone errors —
|
|
200
|
+
// invalid_code (cookie intentionally kept for legacy codes) and
|
|
201
|
+
// already_referred (cookie can outlive redemption on the /onboard RSC hop)
|
|
202
|
+
// — which would otherwise re-fire on every <=10-min token mint; those log
|
|
203
|
+
// at debug only. Without this event, a "my friend's invite didn't count"
|
|
204
|
+
// support case is undiagnosable — the guards otherwise return silently.
|
|
205
|
+
ANVIL_REFERRAL_REDEEM_FAILED = 'anvil.referral.redeem_failed',
|
|
206
|
+
// Attribution went through and the referred user redeemed from an IP or
|
|
207
|
+
// browser the REFERRER was recently seen on. Evidence, NOT a verdict: this
|
|
208
|
+
// is also exactly what a genuine in-person referral looks like ("try it,
|
|
209
|
+
// here's my laptop" — a sibling on the family computer shares both). Only
|
|
210
|
+
// suspicious when corroborated by real farm signals (dormant GitHub, burst
|
|
211
|
+
// velocity, no product use); the sweep + scripts do that weighing.
|
|
212
|
+
ANVIL_REFERRAL_SOCK_SIGNAL = 'anvil.referral.sock_signal',
|
|
213
|
+
// Anvil - Get Started Page (referral onboarding funnel, in order:
|
|
214
|
+
// viewed → sign_in_clicked → signed_in → eligibility_resolved →
|
|
215
|
+
// [connect_github_clicked] → install_command_copied | web_clicked).
|
|
216
|
+
// Every event carries a `referrer` prop (the inviter's name) for per-referrer
|
|
217
|
+
// funnel breakdowns.
|
|
218
|
+
ANVIL_GET_STARTED_VIEWED = 'anvil.get_started_viewed',
|
|
219
|
+
ANVIL_GET_STARTED_SIGN_IN_CLICKED = 'anvil.get_started_sign_in_clicked',
|
|
220
|
+
ANVIL_GET_STARTED_SIGNED_IN = 'anvil.get_started_signed_in',
|
|
221
|
+
ANVIL_GET_STARTED_ELIGIBILITY_RESOLVED = 'anvil.get_started_eligibility_resolved',
|
|
222
|
+
ANVIL_GET_STARTED_CONNECT_GITHUB_CLICKED = 'anvil.get_started_connect_github_clicked',
|
|
223
|
+
ANVIL_GET_STARTED_INSTALL_COMMAND_COPIED = 'anvil.get_started_install_command_copied',
|
|
224
|
+
ANVIL_GET_STARTED_WEB_CLICKED = 'anvil.get_started_web_clicked',
|
|
225
|
+
// Deprecated (previous get-started design — no longer fired):
|
|
226
|
+
ANVIL_GET_STARTED_HELP_EXPANDED = 'anvil.get_started_help_expanded',
|
|
227
|
+
ANVIL_GET_STARTED_EDITOR_CLICKED = 'anvil.get_started_editor_clicked',
|
|
228
|
+
|
|
229
|
+
// Anvil - Chat
|
|
230
|
+
// Emitted once per new-thread title generation attempt (server-side). The
|
|
231
|
+
// `outcome` property is one of: generated | empty | unknown_model | error |
|
|
232
|
+
// aborted. Carries `latencyMs`, `model`, and `titleLength` so the failure/
|
|
233
|
+
// fallback rate and added latency are queryable.
|
|
234
|
+
ANVIL_CHAT_TITLE_GENERATED = 'anvil.chat_title_generated',
|
|
235
|
+
|
|
236
|
+
// Anvil - CLI landing page (/cli). Fired when the install command is
|
|
237
|
+
// copied; `location` distinguishes hero vs install section. Lets us measure
|
|
238
|
+
// install intent per campaign (utm_* ride along as super-properties) — the
|
|
239
|
+
// best proxy conversion for CLI traffic, since CLI activation happens in a
|
|
240
|
+
// separate identity space with no key back to the web landing.
|
|
241
|
+
ANVIL_CLI_INSTALL_COMMAND_COPIED = 'anvil.cli_install_command_copied',
|
|
242
|
+
|
|
243
|
+
// Anvil - Enterprise landing page (/enterprise). Fired when the contact
|
|
244
|
+
// form is submitted successfully; carries `companySize` and whether the
|
|
245
|
+
// sender self-identified as an AI lab, so inbound demand can be segmented
|
|
246
|
+
// without reading the emails. The lead itself lands in james@/victor@ inboxes
|
|
247
|
+
// — this event only measures the funnel into them.
|
|
248
|
+
ANVIL_ENTERPRISE_CONTACT_SUBMITTED = 'anvil.enterprise_contact_submitted',
|
|
249
|
+
|
|
250
|
+
// Anvil - Desktop download CTAs (home hero, products row, /desktop).
|
|
251
|
+
// Fired on every click of a download button; `location` distinguishes the
|
|
252
|
+
// CTA, `platform` the build, and `repeat: true` marks a click we swallowed
|
|
253
|
+
// because the same download had just started (the "did that work?" double
|
|
254
|
+
// click) — a direct read on whether the click feedback is landing.
|
|
255
|
+
ANVIL_DESKTOP_DOWNLOAD_CLICKED = 'anvil.desktop_download_clicked',
|
|
256
|
+
|
|
257
|
+
// Anvil Web creation gate: the user's idea was screened as something Web
|
|
258
|
+
// cannot build, and they clicked through to the surface we suggested.
|
|
259
|
+
// `surface` is desktop | cli | unsupported. Pairs with the Convex
|
|
260
|
+
// web_gate_decision row (which carries the same click) — PostHog answers
|
|
261
|
+
// "did the redirect land?" across the funnel, Convex answers "for which
|
|
262
|
+
// ideas?". Both exist because the Convex row cannot see what the user does
|
|
263
|
+
// after leaving /web.
|
|
264
|
+
ANVIL_WEB_GATE_REDIRECT_CLICKED = 'anvil.web_gate_redirect_clicked',
|
|
265
|
+
|
|
266
|
+
// Anvil Web first-session onboarding. The details sequence runs in the
|
|
267
|
+
// chat pane while the first build streams; its answers are composed into the
|
|
268
|
+
// user's SECOND prompt, which is the drop-off metric this exists to move
|
|
269
|
+
// (51% of Web projects never get one). `_STEP` fires per question with
|
|
270
|
+
// whether it was answered or skipped, so the funnel shows which question
|
|
271
|
+
// people bail on. `_FINISHED` carries `answered` (0-4) and `sent`.
|
|
272
|
+
ANVIL_WEB_ONBOARDING_STEP = 'anvil.web_onboarding_step',
|
|
273
|
+
ANVIL_WEB_ONBOARDING_FINISHED = 'anvil.web_onboarding_finished',
|
|
274
|
+
|
|
275
|
+
// The workspace spotlight tour that follows the first build. `_STEP` fires
|
|
276
|
+
// per pane shown (preview/database/logs/publish/chat); `_FINISHED` records
|
|
277
|
+
// completed vs skipped and where they stopped.
|
|
278
|
+
ANVIL_WEB_TOUR_STEP = 'anvil.web_tour_step',
|
|
279
|
+
ANVIL_WEB_TOUR_FINISHED = 'anvil.web_tour_finished',
|
|
280
|
+
|
|
281
|
+
// The bookmark gate: a blocking card shown once per browser, right after the
|
|
282
|
+
// user's first prompt in a Web or Cloud workspace, asking them to bookmark
|
|
283
|
+
// the page before continuing. `surface` is web | cloud and `variant` is
|
|
284
|
+
// pointer | touch (the two illustrations). `_SHOWN` minus `_CONFIRMED` is the
|
|
285
|
+
// abandon rate — the number to watch, since the card has no other exit and a
|
|
286
|
+
// gap between the two means people are closing the tab instead.
|
|
287
|
+
ANVIL_BOOKMARK_GATE_SHOWN = 'anvil.bookmark_gate_shown',
|
|
288
|
+
ANVIL_BOOKMARK_GATE_CONFIRMED = 'anvil.bookmark_gate_confirmed',
|
|
289
|
+
|
|
290
|
+
// Anvil - Cloud landing page (/cloud). Fired when a logged-out visitor
|
|
291
|
+
// clicks a "Continue with GitHub" / "Connect your repo" CTA; `location`
|
|
292
|
+
// distinguishes hero vs the migration/lovable section vs the final CTA. Best
|
|
293
|
+
// proxy for cloud sign-up intent (utm_* ride along as super-properties).
|
|
294
|
+
ANVIL_CLOUD_CONNECT_REPO_CLICKED = 'anvil.cloud_connect_repo_clicked',
|
|
295
|
+
ANVIL_CLOUD_BLANK_PROJECT_CLICKED = 'anvil.cloud_blank_project_clicked',
|
|
296
|
+
|
|
297
|
+
// Anvil - Home Page
|
|
298
|
+
ANVIL_HOME_INSTALL_COMMAND_COPIED = 'anvil.home_install_command_copied',
|
|
299
|
+
ANVIL_HOME_GITHUB_CLICKED = 'anvil.home_github_clicked',
|
|
300
|
+
ANVIL_HOME_INSTALL_GUIDE_EXPANDED = 'anvil.home_install_guide_expanded',
|
|
301
|
+
ANVIL_HOME_FAQ_OPENED = 'anvil.home_faq_opened',
|
|
302
|
+
|
|
303
|
+
// Anvil - Home savings calculator CTA. Fires alongside
|
|
304
|
+
// ANVIL_DESKTOP_DOWNLOAD_CLICKED (location: savings_calculator) but adds
|
|
305
|
+
// what the visitor had configured at the moment they converted: `savings`
|
|
306
|
+
// (the headline number they were looking at), `perSeat`, `seats`, `tools`
|
|
307
|
+
// and `toolCount`. The question it exists to answer is whether a bigger
|
|
308
|
+
// computed number actually converts better — bucket `savings` and compare
|
|
309
|
+
// click-through, which the download event alone cannot show.
|
|
310
|
+
ANVIL_HOME_SAVINGS_CTA_CLICKED = 'anvil.home_savings_cta_clicked',
|
|
311
|
+
|
|
312
|
+
// Anvil - acquisition attribution (UTM / ad-click params captured as
|
|
313
|
+
// super-properties; filter by utm_source, reddit_click_id, is_reddit_traffic)
|
|
314
|
+
ANVIL_ATTRIBUTED = 'anvil.attributed',
|
|
315
|
+
ANVIL_AFFILIATE_SIGNUP = 'anvil.affiliate.signup',
|
|
316
|
+
ANVIL_AFFILIATE_ACTIVATION = 'anvil.affiliate.activation',
|
|
317
|
+
// Anvil - Reddit ad funnel (filter in PostHog by reddit_click_id / utm_source)
|
|
318
|
+
ANVIL_REDDIT_FUNNEL_CLI_INSTALLED = 'anvil.reddit_funnel.cli_installed',
|
|
319
|
+
ANVIL_REDDIT_FUNNEL_LOGIN = 'anvil.reddit_funnel.login',
|
|
320
|
+
ANVIL_REDDIT_FUNNEL_SIGN_UP = 'anvil.reddit_funnel.sign_up',
|
|
321
|
+
ANVIL_REDDIT_FUNNEL_FIRST_PROMPT = 'anvil.reddit_funnel.first_prompt',
|
|
322
|
+
ANVIL_REDDIT_FUNNEL_RETENTION_1D = 'anvil.reddit_funnel.retention_1d',
|
|
323
|
+
ANVIL_REDDIT_FUNNEL_RETENTION_7D = 'anvil.reddit_funnel.retention_7d',
|
|
324
|
+
ANVIL_REDDIT_FUNNEL_RETENTION_24D = 'anvil.reddit_funnel.retention_24d',
|
|
325
|
+
// Legacy surface-specific names retained for historical dashboards.
|
|
326
|
+
ANVIL_REDDIT_FUNNEL_FIRST_PROMPT_CLI = 'anvil.reddit_funnel.first_prompt_cli',
|
|
327
|
+
ANVIL_REDDIT_FUNNEL_FIRST_PROMPT_WEB = 'anvil.reddit_funnel.first_prompt_web',
|
|
328
|
+
ANVIL_REDDIT_FUNNEL_FIRST_PROMPT_CHAT = 'anvil.reddit_funnel.first_prompt_chat',
|
|
329
|
+
ANVIL_REDDIT_FUNNEL_RETENTION_1D_CLI = 'anvil.reddit_funnel.retention_1d_cli',
|
|
330
|
+
ANVIL_REDDIT_FUNNEL_RETENTION_7D_CLI = 'anvil.reddit_funnel.retention_7d_cli',
|
|
331
|
+
ANVIL_REDDIT_FUNNEL_RETENTION_24D_CLI = 'anvil.reddit_funnel.retention_24d_cli',
|
|
332
|
+
ANVIL_REDDIT_FUNNEL_GRAVITY_AD_CLICK = 'anvil.reddit_funnel.gravity_ad_click',
|
|
333
|
+
|
|
334
|
+
// Anvil web /chat ads experiment (server-rendered Gravity ads vs the
|
|
335
|
+
// existing @gravity-ai/react inline slot; bucketed by user id — see
|
|
336
|
+
// anvil/web/src/app/chat/_components/ad-experiment.ts). Both events carry
|
|
337
|
+
// `experiment` + `variant` so PostHog can break down exposure and CTR by arm.
|
|
338
|
+
ANVIL_CHAT_ADS_EXPERIMENT_EXPOSED = 'anvil.chat_ads.experiment_exposed',
|
|
339
|
+
ANVIL_CHAT_ADS_AD_SHOWN = 'anvil.chat_ads.ad_shown',
|
|
340
|
+
|
|
341
|
+
// Anvil Desktop (Electron app)
|
|
342
|
+
// Mirrors the CLI's surface events so the desktop shows up in the same DAU /
|
|
343
|
+
// login funnels. `message_sent` (above) is reused with `surface: 'desktop'`;
|
|
344
|
+
// these capture the launch, auth, and per-turn activity unique to the app.
|
|
345
|
+
DESKTOP_APP_LAUNCHED = 'desktop.app_launched',
|
|
346
|
+
// The ATTEMPT, which `desktop.login` (the completion) cannot stand in for. A screen that gets
|
|
347
|
+
// more people to press the button and a screen nobody presses look identical in completions
|
|
348
|
+
// alone if sign-in itself is what breaks — and the first-run screen exists to move exactly this
|
|
349
|
+
// number. `surface` says which control started it, so a change to one of them is separable.
|
|
350
|
+
DESKTOP_LOGIN_STARTED = 'desktop.login_started',
|
|
351
|
+
DESKTOP_LOGIN = 'desktop.login',
|
|
352
|
+
// Every way device-code sign-in can fail on the client. Without it a user who
|
|
353
|
+
// cannot sign in is INVISIBLE: `/api/auth/cli/code` answers 200 on all of
|
|
354
|
+
// them (unreachable host, TLS interception, clock skew, an abandoned code),
|
|
355
|
+
// so the server sees a healthy login it never hears about again.
|
|
356
|
+
DESKTOP_LOGIN_FAILED = 'desktop.login_failed',
|
|
357
|
+
DESKTOP_LOGOUT = 'desktop.logout',
|
|
358
|
+
DESKTOP_THREAD_CREATED = 'desktop.thread_created',
|
|
359
|
+
DESKTOP_THREAD_TITLED = 'desktop.thread_titled',
|
|
360
|
+
DESKTOP_PROJECT_OPENED = 'desktop.project_opened',
|
|
361
|
+
DESKTOP_PROJECT_REMOVED = 'desktop.project_removed',
|
|
362
|
+
DESKTOP_TURN_COMPLETED = 'desktop.turn_completed',
|
|
363
|
+
DESKTOP_FAILED_TURN_RECOVERY = 'desktop.failed_turn_recovery',
|
|
364
|
+
DESKTOP_HARNESS_CHANGED = 'desktop.harness_changed',
|
|
365
|
+
DESKTOP_MODEL_CHANGED = 'desktop.model_changed',
|
|
366
|
+
DESKTOP_SKILL_RUN = 'desktop.skill_run',
|
|
367
|
+
DESKTOP_QUEUE_SEND_NOW = 'desktop.queue_send_now',
|
|
368
|
+
// Feature-adoption catch-all. ONE event for the long tail of desktop
|
|
369
|
+
// features (panels, worktrees, diffs, skills, terminal, preview, …), keyed
|
|
370
|
+
// by a bounded `feature` property from
|
|
371
|
+
// `anvil-desktop/src/core/features.ts`. A single PostHog insight
|
|
372
|
+
// ("desktop.feature_used, broken down by feature", unique users) answers
|
|
373
|
+
// "what do people actually use?" for the whole app, and adding a feature
|
|
374
|
+
// never means adding an event to this enum or to the sampling lists.
|
|
375
|
+
//
|
|
376
|
+
// Reserved for user-INTENT actions only — never render/effect churn. The
|
|
377
|
+
// first-class desktop.* events above stay separate because they anchor
|
|
378
|
+
// funnels (login, DAU, turns) or reliability alerts.
|
|
379
|
+
DESKTOP_FEATURE_USED = 'desktop.feature_used',
|
|
380
|
+
DESKTOP_AUTORUN_TOGGLED = 'desktop.autorun_toggled',
|
|
381
|
+
DESKTOP_AUTORUN_SCOPE_SET = 'desktop.autorun_scope_set',
|
|
382
|
+
// One-shot per process: which codex CLI the Codex harness resolved (or why
|
|
383
|
+
// none). Answers "is the packaged app finding users' codex?" in the field,
|
|
384
|
+
// where the stdout breadcrumb is unavailable.
|
|
385
|
+
DESKTOP_CODEX_RESOLUTION = 'desktop.codex_resolution',
|
|
386
|
+
// Sponsored ads interspersed into the transcript (server-side ads_* events
|
|
387
|
+
// in web/api/v1/ads capture the fetch/impression/click ledger; these are the
|
|
388
|
+
// desktop-surface funnels). `desktop.inline_ad_pool_reused` was retired
|
|
389
|
+
// along with the head-pool model (ads are now inline parts capped at
|
|
390
|
+
// MAX_MESSAGE_AD_COUNT); historical rows exist but nothing emits it. The
|
|
391
|
+
// CLI's `cli.inline_ad_pool_reused` sibling still fires.
|
|
392
|
+
DESKTOP_AD_SHOWN = 'desktop.ad_shown',
|
|
393
|
+
DESKTOP_AD_CLICKED = 'desktop.ad_clicked',
|
|
394
|
+
DESKTOP_INLINE_AD_SLOT_ELIGIBLE = 'desktop.inline_ad_slot_eligible',
|
|
395
|
+
// Shutdown/crash lifecycle of harness CLI children: turns aborted at quit so
|
|
396
|
+
// their CLIs terminate, orphans from a dead orchestrator reaped at launch,
|
|
397
|
+
// and interrupted turns auto-resumed by recovery. Together these answer "how
|
|
398
|
+
// often do users hit the orphaned-CLI zombie?" in the field.
|
|
399
|
+
DESKTOP_SHUTDOWN_TURNS_ABORTED = 'desktop.shutdown_turns_aborted',
|
|
400
|
+
DESKTOP_ORPHANS_REAPED = 'desktop.orphans_reaped',
|
|
401
|
+
DESKTOP_WORKTREES_RECLAIMED = 'desktop.worktrees_reclaimed',
|
|
402
|
+
DESKTOP_TURNS_RESURRECTED = 'desktop.turns_resurrected',
|
|
403
|
+
// Passive stall detector: a turn produced no harness stream activity for the
|
|
404
|
+
// configured window. Telemetry ONLY — the turn is not aborted. Join to
|
|
405
|
+
// desktop.turn_completed to tell a recovered long-silent tool call from a
|
|
406
|
+
// real hang, i.e. whether an *acting* watchdog is worth building.
|
|
407
|
+
DESKTOP_TURN_STALLED = 'desktop.turn_stalled',
|
|
408
|
+
// A turn that went quiet because it is PARKED on a background command, not
|
|
409
|
+
// because anything is wrong. Verified against the real Claude Code CLI: a
|
|
410
|
+
// background Bash wait emits no stream messages whatsoever for its entire
|
|
411
|
+
// duration, so the stall detector cannot tell it apart from a hang by
|
|
412
|
+
// listening. This event is what the detector reports instead, so a long wait
|
|
413
|
+
// is still counted — and stays out of desktop.turn_stalled, which is meant to
|
|
414
|
+
// mean "unexplained silence".
|
|
415
|
+
DESKTOP_TURN_BACKGROUND_WAIT = 'desktop.turn_background_wait',
|
|
416
|
+
// Saturation of the orchestrator's single event loop, one line per minute per
|
|
417
|
+
// running app. That process serves the renderer bundle, every SSE stream, all
|
|
418
|
+
// git work, agent turns, terminals and preview drives, so a stall anywhere
|
|
419
|
+
// reads to the user as the whole app hanging. The same numbers ride on
|
|
420
|
+
// `desktop.turn_completed`, which is what separates "the backend queued my
|
|
421
|
+
// turn" from "my own orchestrator was pinned" — the question the 2026-07
|
|
422
|
+
// "opening a new tab is incredibly slow" report could not be answered from
|
|
423
|
+
// server-side timings alone.
|
|
424
|
+
DESKTOP_EVENT_LOOP_HEALTH = 'desktop.event_loop_health',
|
|
425
|
+
// Background lifecycle outcomes. Counts are bucketed and conflict changes
|
|
426
|
+
// emit only on transitions, so periodic scans do not create cardinality or volume churn.
|
|
427
|
+
DESKTOP_THREADS_AUTO_ARCHIVED = 'desktop.threads_auto_archived',
|
|
428
|
+
DESKTOP_DELIVERY_CONFLICT_CHANGED = 'desktop.delivery_conflict_changed',
|
|
429
|
+
|
|
430
|
+
// Common
|
|
431
|
+
FLUSH_FAILED = 'common.flush_failed',
|
|
432
|
+
|
|
433
|
+
// Client Logging - for sending logger events to PostHog in production
|
|
434
|
+
CLI_LOG = 'cli.log',
|
|
435
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenRouter → Anthropic model ID mapping. Used by the token-count API to
|
|
3
|
+
* route Anthropic-family requests to Anthropic's native counting endpoint.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const OPENROUTER_TO_ANTHROPIC_MODEL_MAP: Record<string, string> = {
|
|
7
|
+
// Claude 3.x Haiku models
|
|
8
|
+
'anthropic/claude-3.5-haiku-20241022': 'claude-3-5-haiku-20241022',
|
|
9
|
+
'anthropic/claude-3.5-haiku': 'claude-3-5-haiku-20241022',
|
|
10
|
+
'anthropic/claude-3-5-haiku': 'claude-3-5-haiku-20241022',
|
|
11
|
+
'anthropic/claude-3-5-haiku-20241022': 'claude-3-5-haiku-20241022',
|
|
12
|
+
'anthropic/claude-3-haiku': 'claude-3-haiku-20240307',
|
|
13
|
+
|
|
14
|
+
// Claude 3.x Sonnet models
|
|
15
|
+
'anthropic/claude-3.5-sonnet': 'claude-3-5-sonnet-20241022',
|
|
16
|
+
'anthropic/claude-3-5-sonnet': 'claude-3-5-sonnet-20241022',
|
|
17
|
+
'anthropic/claude-3-5-sonnet-20241022': 'claude-3-5-sonnet-20241022',
|
|
18
|
+
'anthropic/claude-3-5-sonnet-20240620': 'claude-3-5-sonnet-20240620',
|
|
19
|
+
'anthropic/claude-3-sonnet': 'claude-3-sonnet-20240229',
|
|
20
|
+
|
|
21
|
+
// Claude 3.x Opus models
|
|
22
|
+
'anthropic/claude-3-opus': 'claude-3-opus-20240229',
|
|
23
|
+
'anthropic/claude-3-opus-20240229': 'claude-3-opus-20240229',
|
|
24
|
+
|
|
25
|
+
// Claude 4.x Haiku models
|
|
26
|
+
'anthropic/claude-haiku-4.5': 'claude-haiku-4-5-20251001',
|
|
27
|
+
'anthropic/claude-haiku-4': 'claude-haiku-4-20250514',
|
|
28
|
+
|
|
29
|
+
// Claude 4.x Sonnet models
|
|
30
|
+
'anthropic/claude-sonnet-4.6': 'claude-sonnet-4-6',
|
|
31
|
+
'anthropic/claude-sonnet-4.5': 'claude-sonnet-4-5-20250929',
|
|
32
|
+
'anthropic/claude-sonnet-4': 'claude-sonnet-4-20250514',
|
|
33
|
+
'anthropic/claude-4-sonnet-20250522': 'claude-sonnet-4-20250514',
|
|
34
|
+
'anthropic/claude-4-sonnet': 'claude-sonnet-4-20250514',
|
|
35
|
+
|
|
36
|
+
// Claude 5.x models
|
|
37
|
+
'anthropic/claude-fable-5': 'claude-fable-5',
|
|
38
|
+
'anthropic/claude-opus-5': 'claude-opus-5',
|
|
39
|
+
|
|
40
|
+
// Claude 4.x Opus models
|
|
41
|
+
'anthropic/claude-opus-4.8': 'claude-opus-4-8',
|
|
42
|
+
'anthropic/claude-opus-4.7': 'claude-opus-4-7',
|
|
43
|
+
'anthropic/claude-opus-4.6': 'claude-opus-4-6',
|
|
44
|
+
'anthropic/claude-opus-4.5': 'claude-opus-4-5-20251101',
|
|
45
|
+
'anthropic/claude-opus-4.1': 'claude-opus-4-1-20250805',
|
|
46
|
+
'anthropic/claude-opus-4': 'claude-opus-4-1-20250805',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function isClaudeModel(model: string): boolean {
|
|
50
|
+
return model.startsWith('anthropic/') || model.startsWith('claude-')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Convert an OpenRouter model ID to an Anthropic model ID.
|
|
55
|
+
* Throws if the model has a non-anthropic provider prefix.
|
|
56
|
+
*/
|
|
57
|
+
export function toAnthropicModelId(openrouterModel: string): string {
|
|
58
|
+
// Already an Anthropic model ID (no provider prefix)
|
|
59
|
+
if (!openrouterModel.includes('/')) {
|
|
60
|
+
return openrouterModel
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!openrouterModel.startsWith('anthropic/')) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`Cannot convert non-Anthropic model to Anthropic model ID: ${openrouterModel}`,
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
OPENROUTER_TO_ANTHROPIC_MODEL_MAP[openrouterModel] ??
|
|
71
|
+
openrouterModel.replace('anthropic/', '')
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
const POLICY_EFFECTIVE_DATE = 'July 23, 2026'
|
|
2
|
+
|
|
3
|
+
export const ANVIL_POLICY_ROLLOUT = {
|
|
4
|
+
version: '2026-07-23',
|
|
5
|
+
effectiveDate: POLICY_EFFECTIVE_DATE,
|
|
6
|
+
lastUpdated: '07/23/2026',
|
|
7
|
+
noticeEndsAt: '2026-08-23T00:00:00-07:00',
|
|
8
|
+
notice: {
|
|
9
|
+
title: `We’ve updated our Terms and Privacy Policy, effective ${POLICY_EFFECTIVE_DATE}.`,
|
|
10
|
+
summary:
|
|
11
|
+
'Prompts may be used to personalize ads, AI training applies only to labeled models or features, and usage restrictions were updated.',
|
|
12
|
+
},
|
|
13
|
+
} as const
|
|
14
|
+
|
|
15
|
+
export const ANVIL_PRIVACY_POLICY_URL = 'https://anvil.com/privacy-policy'
|
|
16
|
+
|
|
17
|
+
export const ANVIL_AI_TRAINING_NOTICE = 'May use data for AI training'
|
|
18
|
+
|
|
19
|
+
export type AnvilModelDataUse = 'service' | 'training'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Canonical short-form public copy derived from the July 23 Privacy Policy.
|
|
23
|
+
* Product surfaces should import these answers instead of restating data-use
|
|
24
|
+
* promises. Static Markdown/MDX copies are protected by the drift test in
|
|
25
|
+
* `anvil-public-data-use-copy.test.ts`.
|
|
26
|
+
*/
|
|
27
|
+
export const ANVIL_PUBLIC_DATA_USE_COPY = {
|
|
28
|
+
collectionQuestion: 'Does Anvil collect my data?',
|
|
29
|
+
collectionAnswer:
|
|
30
|
+
'Anvil is supported by text ads. We do not collect your traces or files unless the model provider does. Currently, this applies only to DeepSeek models.',
|
|
31
|
+
trainingQuestion: 'Is my data used to train AI?',
|
|
32
|
+
trainingAnswer:
|
|
33
|
+
'Only when a model or feature says data may be used for AI training. Anvil or the provider may then keep submissions to develop, train, test, evaluate, fine-tune, and improve AI models or products.',
|
|
34
|
+
storageQuestion: 'How is my data used and stored?',
|
|
35
|
+
storageAnswer:
|
|
36
|
+
'We use prompts, messages, code, files, and repository data to provide the service. We may analyze prompts and messages—including pasted content—to personalize ads, using Anvil systems and service providers acting on our behalf. Separate uploads and connected repositories are not provided to advertising providers. Where required by law, we provide advertising choices and honor recognized opt-out signals; elsewhere, this processing may be required to use the free service. See the Privacy Policy for retention and details.',
|
|
37
|
+
compactTrainingSummary: `Models or features labeled “${ANVIL_AI_TRAINING_NOTICE}” may keep submissions to develop, train, test, evaluate, fine-tune, and improve AI models or products.`,
|
|
38
|
+
compactPrivacySummary: `Prompts and messages may be analyzed to personalize ads, using Anvil systems and service providers acting on our behalf. Separate uploads and connected repositories are not provided to advertising providers. Models or features labeled “${ANVIL_AI_TRAINING_NOTICE}” may use submissions for that purpose.`,
|
|
39
|
+
localExecutionSummary:
|
|
40
|
+
'Anvil edits files locally but sends relevant prompts, code, files, and repository context to its servers and model providers. See the Privacy Policy for details.',
|
|
41
|
+
compactLocalExecutionSummary:
|
|
42
|
+
'Edits run locally, but relevant prompts, code, files, and repository context are sent to Anvil and model providers.',
|
|
43
|
+
} as const
|
|
44
|
+
|
|
45
|
+
export const ANVIL_DATA_USE_GENERATED_MARKDOWN_BLOCK = {
|
|
46
|
+
start: '<!-- BEGIN GENERATED ANVIL DATA USE -->',
|
|
47
|
+
end: '<!-- END GENERATED ANVIL DATA USE -->',
|
|
48
|
+
} as const
|
|
49
|
+
|
|
50
|
+
export const ANVIL_DATA_USE_GENERATED_MDX_BLOCK = {
|
|
51
|
+
start: '{/* BEGIN GENERATED ANVIL DATA USE */}',
|
|
52
|
+
end: '{/* END GENERATED ANVIL DATA USE */}',
|
|
53
|
+
} as const
|
|
54
|
+
|
|
55
|
+
export function renderAnvilDataUseFaqMarkdown(): string {
|
|
56
|
+
return `${ANVIL_DATA_USE_GENERATED_MARKDOWN_BLOCK.start}
|
|
57
|
+
|
|
58
|
+
**${ANVIL_PUBLIC_DATA_USE_COPY.trainingQuestion}** ${ANVIL_PUBLIC_DATA_USE_COPY.trainingAnswer}
|
|
59
|
+
|
|
60
|
+
**${ANVIL_PUBLIC_DATA_USE_COPY.storageQuestion}** ${ANVIL_PUBLIC_DATA_USE_COPY.storageAnswer}
|
|
61
|
+
|
|
62
|
+
See the [Privacy Policy](${ANVIL_PRIVACY_POLICY_URL}) for complete details.
|
|
63
|
+
|
|
64
|
+
${ANVIL_DATA_USE_GENERATED_MARKDOWN_BLOCK.end}`
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function renderAnvilDataUseFaqMdx(): string {
|
|
68
|
+
return `${ANVIL_DATA_USE_GENERATED_MDX_BLOCK.start}
|
|
69
|
+
|
|
70
|
+
## ${ANVIL_PUBLIC_DATA_USE_COPY.storageQuestion}
|
|
71
|
+
|
|
72
|
+
${ANVIL_PUBLIC_DATA_USE_COPY.storageAnswer}
|
|
73
|
+
|
|
74
|
+
## ${ANVIL_PUBLIC_DATA_USE_COPY.trainingQuestion}
|
|
75
|
+
|
|
76
|
+
${ANVIL_PUBLIC_DATA_USE_COPY.trainingAnswer}
|
|
77
|
+
|
|
78
|
+
See the [Privacy Policy](${ANVIL_PRIVACY_POLICY_URL}) for complete details.
|
|
79
|
+
|
|
80
|
+
${ANVIL_DATA_USE_GENERATED_MDX_BLOCK.end}`
|
|
81
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Provider billing failures observed from CrofAI, OpenRouter, and similar APIs. */
|
|
2
|
+
export const ANVIL_PROVIDER_USAGE_ERROR_PATTERN =
|
|
3
|
+
/\b(?:(?:not enough|insufficient|out of)\s+credits?|(?:add|refill|top up)\s+(?:more\s+)?credits?)\b/i
|
|
4
|
+
|
|
5
|
+
/** Shared copy keeps every Anvil surface clear that the user is not billed. */
|
|
6
|
+
export const ANVIL_PROVIDER_USAGE_MESSAGE =
|
|
7
|
+
'Anvil ran out of provider usage and needs a refill. This is on us, not your account.'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const ANVIL_GEMINI_THINKER_AGENT_ID = 'thinker-with-files-gemini'
|
|
2
|
+
|
|
3
|
+
/** Agent id the anvil WEB CHAT uses for its gemini-thinker child (see
|
|
4
|
+
* agents/thinker/thinker-gemini.ts, spawned from agents/base-chat.ts). Distinct
|
|
5
|
+
* from the CLI's ANVIL_GEMINI_THINKER_AGENT_ID. */
|
|
6
|
+
export const ANVIL_CHAT_GEMINI_THINKER_AGENT_ID = 'thinker-gemini'
|
|
7
|
+
|
|
8
|
+
/** The ONLY agents permitted to call the premium Gemini Pro model. Gemini Pro is
|
|
9
|
+
* not a user-pickable model — its only legitimate callers are these two thinker
|
|
10
|
+
* subagents (CLI + chat). The chat-completions endpoint rejects any other agent
|
|
11
|
+
* that requests Gemini Pro on an unbilled path. */
|
|
12
|
+
export const ANVIL_GEMINI_PRO_AGENT_IDS: ReadonlySet<string> = new Set([
|
|
13
|
+
ANVIL_GEMINI_THINKER_AGENT_ID,
|
|
14
|
+
ANVIL_CHAT_GEMINI_THINKER_AGENT_ID,
|
|
15
|
+
])
|
|
16
|
+
|
|
17
|
+
export const ANVIL_GEMINI_THINKER_SYSTEM_INSTRUCTION =
|
|
18
|
+
"Spawn the thinker-with-files-gemini agent to think through problems worth reasoning about -- it's very smart. Reach for it on non-trivial bugs, uncertain approaches, and tricky decisions, not just the hardest tasks. Skip it for routine, clearly-scoped edits. Pass the relevant filePaths since it has no conversation history."
|
|
19
|
+
|
|
20
|
+
export const ANVIL_GEMINI_THINKER_INSTRUCTIONS_PROMPT =
|
|
21
|
+
'- For problems worth thinking through -- non-trivial bugs, uncertain approaches, or tricky decisions -- spawn the thinker-with-files-gemini agent after gathering context, not just for the hardest tasks. Skip it for routine, clearly-scoped edits. Pass the relevant filePaths.'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable Anvil model identifiers that are safe to import from browser code.
|
|
3
|
+
*
|
|
4
|
+
* Keep this module dependency-free: the full Anvil model catalog pulls in
|
|
5
|
+
* server-side model configuration that is not part of the desktop renderer's
|
|
6
|
+
* type environment.
|
|
7
|
+
*/
|
|
8
|
+
export const ANVIL_DEEPSEEK_V4_FLASH_MODEL_ID =
|
|
9
|
+
'deepseek/deepseek-v4-flash'
|
|
10
|
+
export const ANVIL_DEEPSEEK_V4_PRO_MODEL_ID = 'deepseek/deepseek-v4-pro'
|
|
11
|
+
export const ANVIL_MINIMAX_M3_MODEL_ID = 'minimax/minimax-m3'
|