@vellumai/assistant 0.3.0
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/.dockerignore +27 -0
- package/.env.example +22 -0
- package/Dockerfile +99 -0
- package/Dockerfile.sandbox +5 -0
- package/README.md +248 -0
- package/bun.lock +1723 -0
- package/bunfig.toml +2 -0
- package/docs/skills.md +158 -0
- package/drizzle/0000_dizzy_maggott.sql +301 -0
- package/drizzle/meta/0000_snapshot.json +1999 -0
- package/drizzle/meta/_journal.json +13 -0
- package/drizzle.config.ts +7 -0
- package/eslint.config.mjs +17 -0
- package/hook-templates/debug-prompt-logger/hook.json +7 -0
- package/hook-templates/debug-prompt-logger/run.sh +68 -0
- package/knip.json +9 -0
- package/package.json +70 -0
- package/scripts/capture-x-graphql.ts +545 -0
- package/scripts/ipc/check-contract-inventory.ts +104 -0
- package/scripts/ipc/check-swift-decoder-drift.ts +166 -0
- package/scripts/ipc/generate-swift.ts +492 -0
- package/scripts/test-filesystem-tools.sh +48 -0
- package/scripts/test.sh +127 -0
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +2485 -0
- package/src/__tests__/account-registry.test.ts +245 -0
- package/src/__tests__/active-skill-tools.test.ts +378 -0
- package/src/__tests__/agent-heartbeat-service.test.ts +250 -0
- package/src/__tests__/agent-loop-thinking.test.ts +81 -0
- package/src/__tests__/agent-loop.test.ts +1135 -0
- package/src/__tests__/anthropic-provider.test.ts +778 -0
- package/src/__tests__/app-builder-tool-scripts.test.ts +290 -0
- package/src/__tests__/app-bundler.test.ts +292 -0
- package/src/__tests__/app-executors.test.ts +613 -0
- package/src/__tests__/app-git-history.test.ts +176 -0
- package/src/__tests__/app-git-service.test.ts +169 -0
- package/src/__tests__/app-open-proxy.test.ts +62 -0
- package/src/__tests__/asset-materialize-tool.test.ts +452 -0
- package/src/__tests__/asset-search-tool.test.ts +477 -0
- package/src/__tests__/assistant-attachment-directive.test.ts +401 -0
- package/src/__tests__/assistant-attachments.test.ts +437 -0
- package/src/__tests__/assistant-event-hub.test.ts +226 -0
- package/src/__tests__/assistant-event.test.ts +123 -0
- package/src/__tests__/assistant-events-sse-hardening.test.ts +315 -0
- package/src/__tests__/attachments-store.test.ts +476 -0
- package/src/__tests__/attachments.test.ts +134 -0
- package/src/__tests__/audit-log-rotation.test.ts +154 -0
- package/src/__tests__/browser-fill-credential.test.ts +309 -0
- package/src/__tests__/browser-manager.test.ts +203 -0
- package/src/__tests__/browser-runtime-check.test.ts +55 -0
- package/src/__tests__/browser-skill-baseline-tool-payload.test.ts +68 -0
- package/src/__tests__/browser-skill-endstate.test.ts +195 -0
- package/src/__tests__/bundle-scanner.test.ts +313 -0
- package/src/__tests__/call-bridge.test.ts +517 -0
- package/src/__tests__/call-constants.test.ts +40 -0
- package/src/__tests__/call-domain.test.ts +163 -0
- package/src/__tests__/call-orchestrator.test.ts +625 -0
- package/src/__tests__/call-recovery.test.ts +518 -0
- package/src/__tests__/call-routes-http.test.ts +699 -0
- package/src/__tests__/call-state-machine.test.ts +143 -0
- package/src/__tests__/call-state.test.ts +174 -0
- package/src/__tests__/call-store.test.ts +691 -0
- package/src/__tests__/channel-approval-routes.test.ts +2356 -0
- package/src/__tests__/channel-approval.test.ts +299 -0
- package/src/__tests__/channel-approvals.test.ts +521 -0
- package/src/__tests__/channel-delivery-store.test.ts +447 -0
- package/src/__tests__/channel-guardian.test.ts +1005 -0
- package/src/__tests__/checker.test.ts +3519 -0
- package/src/__tests__/clarification-resolver.test.ts +159 -0
- package/src/__tests__/classifier.test.ts +67 -0
- package/src/__tests__/claude-code-skill-regression.test.ts +127 -0
- package/src/__tests__/claude-code-tool-profiles.test.ts +88 -0
- package/src/__tests__/cli-discover.test.ts +85 -0
- package/src/__tests__/cli.test.ts +26 -0
- package/src/__tests__/clipboard.test.ts +80 -0
- package/src/__tests__/commit-guarantee.test.ts +335 -0
- package/src/__tests__/commit-message-enrichment-service.test.ts +550 -0
- package/src/__tests__/compaction.benchmark.test.ts +176 -0
- package/src/__tests__/computer-use-session-compaction.test.ts +132 -0
- package/src/__tests__/computer-use-session-lifecycle.test.ts +293 -0
- package/src/__tests__/computer-use-session-working-dir.test.ts +117 -0
- package/src/__tests__/computer-use-skill-baseline.test.ts +74 -0
- package/src/__tests__/computer-use-skill-endstate.test.ts +89 -0
- package/src/__tests__/computer-use-skill-lifecycle-cleanup.test.ts +217 -0
- package/src/__tests__/computer-use-skill-manifest-regression.test.ts +107 -0
- package/src/__tests__/computer-use-skill-proxy-bridge.test.ts +54 -0
- package/src/__tests__/computer-use-tools.test.ts +250 -0
- package/src/__tests__/config-schema.test.ts +1462 -0
- package/src/__tests__/conflict-intent-tokenization.test.ts +141 -0
- package/src/__tests__/conflict-policy.test.ts +121 -0
- package/src/__tests__/conflict-store.test.ts +332 -0
- package/src/__tests__/connection-policy.test.ts +102 -0
- package/src/__tests__/contacts-tools.test.ts +331 -0
- package/src/__tests__/context-memory-e2e.test.ts +434 -0
- package/src/__tests__/context-token-estimator.test.ts +135 -0
- package/src/__tests__/context-window-manager.test.ts +376 -0
- package/src/__tests__/contradiction-checker.test.ts +314 -0
- package/src/__tests__/conversation-store.test.ts +612 -0
- package/src/__tests__/credential-broker-browser-fill.test.ts +517 -0
- package/src/__tests__/credential-broker-server-use.test.ts +554 -0
- package/src/__tests__/credential-broker.test.ts +167 -0
- package/src/__tests__/credential-host-pattern-match.test.ts +104 -0
- package/src/__tests__/credential-metadata-store.test.ts +779 -0
- package/src/__tests__/credential-policy-validate.test.ts +121 -0
- package/src/__tests__/credential-resolve.test.ts +328 -0
- package/src/__tests__/credential-security-e2e.test.ts +352 -0
- package/src/__tests__/credential-security-invariants.test.ts +583 -0
- package/src/__tests__/credential-selection.test.ts +354 -0
- package/src/__tests__/credential-vault-unit.test.ts +780 -0
- package/src/__tests__/credential-vault.test.ts +852 -0
- package/src/__tests__/daemon-assistant-events.test.ts +164 -0
- package/src/__tests__/daemon-server-session-init.test.ts +522 -0
- package/src/__tests__/date-context.test.ts +373 -0
- package/src/__tests__/db-schedule-syntax-migration.test.ts +129 -0
- package/src/__tests__/delete-managed-skill-tool.test.ts +97 -0
- package/src/__tests__/diff.test.ts +121 -0
- package/src/__tests__/domain-normalize.test.ts +112 -0
- package/src/__tests__/domain-policy.test.ts +124 -0
- package/src/__tests__/doordash-client.test.ts +186 -0
- package/src/__tests__/doordash-session.test.ts +152 -0
- package/src/__tests__/dynamic-page-surface.test.ts +91 -0
- package/src/__tests__/dynamic-skill-workflow-prompt.test.ts +132 -0
- package/src/__tests__/edit-engine.test.ts +180 -0
- package/src/__tests__/elevenlabs-client.test.ts +271 -0
- package/src/__tests__/email-cli.test.ts +283 -0
- package/src/__tests__/encrypted-store.test.ts +332 -0
- package/src/__tests__/entity-extractor.test.ts +190 -0
- package/src/__tests__/ephemeral-permissions.test.ts +362 -0
- package/src/__tests__/evaluate-typescript-tool.test.ts +286 -0
- package/src/__tests__/event-bus.test.ts +222 -0
- package/src/__tests__/file-edit-tool.test.ts +122 -0
- package/src/__tests__/file-ops-service.test.ts +330 -0
- package/src/__tests__/file-read-tool.test.ts +75 -0
- package/src/__tests__/file-write-tool.test.ts +113 -0
- package/src/__tests__/filesystem-tools.test.ts +579 -0
- package/src/__tests__/fixtures/credential-security-fixtures.ts +181 -0
- package/src/__tests__/fixtures/media-reuse-fixtures.ts +126 -0
- package/src/__tests__/fixtures/mock-signup-server.ts +387 -0
- package/src/__tests__/fixtures/proxy-fixtures.ts +147 -0
- package/src/__tests__/followup-tools.test.ts +303 -0
- package/src/__tests__/forbidden-legacy-symbols.test.ts +71 -0
- package/src/__tests__/fuzzy-match-property.test.ts +216 -0
- package/src/__tests__/fuzzy-match.test.ts +138 -0
- package/src/__tests__/gateway-only-enforcement.test.ts +631 -0
- package/src/__tests__/gemini-image-service.test.ts +261 -0
- package/src/__tests__/gemini-provider.test.ts +651 -0
- package/src/__tests__/get-weather.test.ts +318 -0
- package/src/__tests__/gmail-integration.test.ts +73 -0
- package/src/__tests__/handlers-add-trust-rule-metadata.test.ts +202 -0
- package/src/__tests__/handlers-cu-observation-blob.test.ts +352 -0
- package/src/__tests__/handlers-ipc-blob-probe.test.ts +191 -0
- package/src/__tests__/handlers-slack-config.test.ts +200 -0
- package/src/__tests__/handlers-task-submit-slash.test.ts +38 -0
- package/src/__tests__/handlers-telegram-config.test.ts +968 -0
- package/src/__tests__/handlers-twilio-config.test.ts +659 -0
- package/src/__tests__/handlers-twitter-config.test.ts +858 -0
- package/src/__tests__/headless-browser-interactions.test.ts +536 -0
- package/src/__tests__/headless-browser-navigate.test.ts +211 -0
- package/src/__tests__/headless-browser-read-tools.test.ts +261 -0
- package/src/__tests__/headless-browser-snapshot.test.ts +185 -0
- package/src/__tests__/history-repair-observability.test.ts +56 -0
- package/src/__tests__/history-repair.test.ts +510 -0
- package/src/__tests__/home-base-bootstrap.test.ts +82 -0
- package/src/__tests__/hooks-blocking.test.ts +128 -0
- package/src/__tests__/hooks-cli.test.ts +144 -0
- package/src/__tests__/hooks-config.test.ts +93 -0
- package/src/__tests__/hooks-discovery.test.ts +199 -0
- package/src/__tests__/hooks-integration.test.ts +189 -0
- package/src/__tests__/hooks-manager.test.ts +187 -0
- package/src/__tests__/hooks-runner.test.ts +182 -0
- package/src/__tests__/hooks-settings.test.ts +154 -0
- package/src/__tests__/hooks-templates.test.ts +137 -0
- package/src/__tests__/hooks-ts-runner.test.ts +125 -0
- package/src/__tests__/hooks-watch.test.ts +100 -0
- package/src/__tests__/host-file-edit-tool.test.ts +228 -0
- package/src/__tests__/host-file-read-tool.test.ts +123 -0
- package/src/__tests__/host-file-write-tool.test.ts +136 -0
- package/src/__tests__/host-shell-tool.test.ts +562 -0
- package/src/__tests__/ingress-reconcile.test.ts +581 -0
- package/src/__tests__/ingress-url-consistency.test.ts +214 -0
- package/src/__tests__/intent-routing.test.ts +259 -0
- package/src/__tests__/ipc-blob-store.test.ts +315 -0
- package/src/__tests__/ipc-contract-inventory.test.ts +54 -0
- package/src/__tests__/ipc-contract.test.ts +74 -0
- package/src/__tests__/ipc-protocol.test.ts +113 -0
- package/src/__tests__/ipc-roundtrip.benchmark.test.ts +237 -0
- package/src/__tests__/ipc-snapshot.test.ts +1769 -0
- package/src/__tests__/ipc-validate.test.ts +407 -0
- package/src/__tests__/key-migration.test.ts +206 -0
- package/src/__tests__/keychain.test.ts +258 -0
- package/src/__tests__/llm-usage-store.test.ts +221 -0
- package/src/__tests__/managed-skill-lifecycle.test.ts +257 -0
- package/src/__tests__/managed-store.test.ts +608 -0
- package/src/__tests__/media-generate-image.test.ts +238 -0
- package/src/__tests__/media-reuse-story.e2e.test.ts +676 -0
- package/src/__tests__/media-visibility-policy.test.ts +141 -0
- package/src/__tests__/memory-context-benchmark.benchmark.test.ts +235 -0
- package/src/__tests__/memory-lifecycle-e2e.test.ts +481 -0
- package/src/__tests__/memory-query-builder.test.ts +59 -0
- package/src/__tests__/memory-recall-quality.test.ts +846 -0
- package/src/__tests__/memory-regressions.experimental.test.ts +538 -0
- package/src/__tests__/memory-regressions.test.ts +4435 -0
- package/src/__tests__/memory-retrieval-budget.test.ts +49 -0
- package/src/__tests__/memory-retrieval.benchmark.test.ts +430 -0
- package/src/__tests__/migration-cli-flows.test.ts +169 -0
- package/src/__tests__/migration-ordering.test.ts +249 -0
- package/src/__tests__/mock-signup-server.test.ts +528 -0
- package/src/__tests__/oauth-callback-registry.test.ts +92 -0
- package/src/__tests__/oauth2-gateway-transport.test.ts +285 -0
- package/src/__tests__/onboarding-starter-tasks.test.ts +176 -0
- package/src/__tests__/onboarding-template-contract.test.ts +58 -0
- package/src/__tests__/openai-provider.test.ts +753 -0
- package/src/__tests__/parallel-tool.benchmark.test.ts +294 -0
- package/src/__tests__/parser.test.ts +472 -0
- package/src/__tests__/path-classifier.test.ts +73 -0
- package/src/__tests__/path-policy.test.ts +435 -0
- package/src/__tests__/platform-move-helper.test.ts +99 -0
- package/src/__tests__/platform-socket-path.test.ts +52 -0
- package/src/__tests__/platform-workspace-migration.test.ts +1000 -0
- package/src/__tests__/platform.test.ts +131 -0
- package/src/__tests__/playbook-execution.test.ts +502 -0
- package/src/__tests__/playbook-tools.test.ts +340 -0
- package/src/__tests__/prebuilt-home-base-seed.test.ts +75 -0
- package/src/__tests__/pricing.test.ts +256 -0
- package/src/__tests__/profile-compiler.test.ts +374 -0
- package/src/__tests__/provider-commit-message-generator.test.ts +342 -0
- package/src/__tests__/provider-registry-ollama.test.ts +16 -0
- package/src/__tests__/provider-streaming.benchmark.test.ts +773 -0
- package/src/__tests__/proxy-approval-callback.test.ts +601 -0
- package/src/__tests__/public-ingress-urls.test.ts +256 -0
- package/src/__tests__/qdrant-manager.test.ts +267 -0
- package/src/__tests__/ratelimit.test.ts +297 -0
- package/src/__tests__/recurrence-engine-rruleset.test.ts +175 -0
- package/src/__tests__/recurrence-engine.test.ts +78 -0
- package/src/__tests__/recurrence-types.test.ts +79 -0
- package/src/__tests__/registry.test.ts +494 -0
- package/src/__tests__/relay-server.test.ts +688 -0
- package/src/__tests__/reminder-store.test.ts +223 -0
- package/src/__tests__/reminder.test.ts +229 -0
- package/src/__tests__/request-file-tool.test.ts +158 -0
- package/src/__tests__/run-orchestrator-assistant-events.test.ts +227 -0
- package/src/__tests__/run-orchestrator.test.ts +425 -0
- package/src/__tests__/runtime-attachment-metadata.test.ts +189 -0
- package/src/__tests__/runtime-events-sse-parity.test.ts +343 -0
- package/src/__tests__/runtime-events-sse.test.ts +162 -0
- package/src/__tests__/runtime-runs-http.test.ts +438 -0
- package/src/__tests__/runtime-runs.test.ts +260 -0
- package/src/__tests__/sandbox-diagnostics.test.ts +408 -0
- package/src/__tests__/sandbox-host-parity.test.ts +950 -0
- package/src/__tests__/scaffold-managed-skill-tool.test.ts +253 -0
- package/src/__tests__/schedule-store.test.ts +484 -0
- package/src/__tests__/schedule-tools.test.ts +783 -0
- package/src/__tests__/scheduler-recurrence.test.ts +430 -0
- package/src/__tests__/script-proxy-certs.test.ts +90 -0
- package/src/__tests__/script-proxy-connect-tunnel.test.ts +177 -0
- package/src/__tests__/script-proxy-decision-trace.test.ts +156 -0
- package/src/__tests__/script-proxy-http-forwarder.test.ts +281 -0
- package/src/__tests__/script-proxy-injection-runtime.test.ts +401 -0
- package/src/__tests__/script-proxy-mitm-handler.test.ts +407 -0
- package/src/__tests__/script-proxy-policy-runtime.test.ts +287 -0
- package/src/__tests__/script-proxy-policy.test.ts +310 -0
- package/src/__tests__/script-proxy-rewrite-specificity.test.ts +135 -0
- package/src/__tests__/script-proxy-router.test.ts +180 -0
- package/src/__tests__/script-proxy-session-manager.test.ts +382 -0
- package/src/__tests__/script-proxy-session-runtime.test.ts +113 -0
- package/src/__tests__/secret-allowlist.test.ts +230 -0
- package/src/__tests__/secret-ingress-handler.test.ts +110 -0
- package/src/__tests__/secret-onetime-send.test.ts +130 -0
- package/src/__tests__/secret-prompt-log-hygiene.test.ts +106 -0
- package/src/__tests__/secret-response-routing.test.ts +93 -0
- package/src/__tests__/secret-scanner-executor.test.ts +348 -0
- package/src/__tests__/secret-scanner.test.ts +900 -0
- package/src/__tests__/secure-keys.test.ts +323 -0
- package/src/__tests__/server-history-render.test.ts +431 -0
- package/src/__tests__/session-abort-tool-results.test.ts +240 -0
- package/src/__tests__/session-conflict-gate.test.ts +1136 -0
- package/src/__tests__/session-error.test.ts +369 -0
- package/src/__tests__/session-evictor.test.ts +188 -0
- package/src/__tests__/session-init.benchmark.test.ts +465 -0
- package/src/__tests__/session-load-history-repair.test.ts +222 -0
- package/src/__tests__/session-pre-run-repair.test.ts +213 -0
- package/src/__tests__/session-process-bridge.test.ts +242 -0
- package/src/__tests__/session-profile-injection.test.ts +444 -0
- package/src/__tests__/session-provider-retry-repair.test.ts +306 -0
- package/src/__tests__/session-queue.test.ts +1535 -0
- package/src/__tests__/session-runtime-assembly.test.ts +476 -0
- package/src/__tests__/session-runtime-workspace.test.ts +183 -0
- package/src/__tests__/session-skill-tools.test.ts +2431 -0
- package/src/__tests__/session-slash-known.test.ts +368 -0
- package/src/__tests__/session-slash-queue.test.ts +288 -0
- package/src/__tests__/session-slash-unknown.test.ts +271 -0
- package/src/__tests__/session-surfaces-task-progress.test.ts +104 -0
- package/src/__tests__/session-tool-setup-app-refresh.test.ts +473 -0
- package/src/__tests__/session-tool-setup-memory-scope.test.ts +140 -0
- package/src/__tests__/session-tool-setup-side-effect-flag.test.ts +140 -0
- package/src/__tests__/session-undo.test.ts +75 -0
- package/src/__tests__/session-workspace-cache-state.test.ts +246 -0
- package/src/__tests__/session-workspace-injection.test.ts +327 -0
- package/src/__tests__/session-workspace-tool-tracking.test.ts +240 -0
- package/src/__tests__/shared-filesystem-errors.test.ts +78 -0
- package/src/__tests__/shell-credential-ref.test.ts +187 -0
- package/src/__tests__/shell-identity.test.ts +256 -0
- package/src/__tests__/shell-parser-fuzz.test.ts +544 -0
- package/src/__tests__/shell-parser-property.test.ts +433 -0
- package/src/__tests__/shell-tool-proxy-mode.test.ts +272 -0
- package/src/__tests__/signup-e2e.test.ts +353 -0
- package/src/__tests__/size-guard.test.ts +117 -0
- package/src/__tests__/skill-include-graph.test.ts +303 -0
- package/src/__tests__/skill-load-tool.test.ts +409 -0
- package/src/__tests__/skill-projection.benchmark.test.ts +338 -0
- package/src/__tests__/skill-script-runner-host.test.ts +489 -0
- package/src/__tests__/skill-script-runner-sandbox.test.ts +349 -0
- package/src/__tests__/skill-script-runner.test.ts +159 -0
- package/src/__tests__/skill-tool-factory.test.ts +252 -0
- package/src/__tests__/skill-tool-manifest.test.ts +658 -0
- package/src/__tests__/skill-version-hash.test.ts +182 -0
- package/src/__tests__/skills.test.ts +680 -0
- package/src/__tests__/slash-commands-catalog.test.ts +86 -0
- package/src/__tests__/slash-commands-parser.test.ts +119 -0
- package/src/__tests__/slash-commands-resolver.test.ts +193 -0
- package/src/__tests__/slash-commands-rewrite.test.ts +39 -0
- package/src/__tests__/speaker-identification.test.ts +52 -0
- package/src/__tests__/starter-bundle.test.ts +136 -0
- package/src/__tests__/starter-task-flow.test.ts +143 -0
- package/src/__tests__/subagent-manager-notify.test.ts +404 -0
- package/src/__tests__/subagent-tools.test.ts +801 -0
- package/src/__tests__/subagent-types.test.ts +78 -0
- package/src/__tests__/swarm-orchestrator.test.ts +428 -0
- package/src/__tests__/swarm-plan-validator.test.ts +330 -0
- package/src/__tests__/swarm-recursion.test.ts +165 -0
- package/src/__tests__/swarm-router-planner.test.ts +208 -0
- package/src/__tests__/swarm-session-integration.test.ts +274 -0
- package/src/__tests__/swarm-tool.test.ts +145 -0
- package/src/__tests__/swarm-worker-backend.test.ts +129 -0
- package/src/__tests__/swarm-worker-runner.test.ts +272 -0
- package/src/__tests__/system-prompt.test.ts +439 -0
- package/src/__tests__/task-compiler.test.ts +284 -0
- package/src/__tests__/task-management-tools.test.ts +936 -0
- package/src/__tests__/task-runner.test.ts +216 -0
- package/src/__tests__/task-scheduler.test.ts +217 -0
- package/src/__tests__/task-tools.test.ts +595 -0
- package/src/__tests__/terminal-sandbox-docker.test.ts +1064 -0
- package/src/__tests__/terminal-sandbox.integration.test.ts +178 -0
- package/src/__tests__/terminal-sandbox.test.ts +202 -0
- package/src/__tests__/terminal-tools.test.ts +840 -0
- package/src/__tests__/test-support/browser-skill-harness.ts +90 -0
- package/src/__tests__/test-support/computer-use-skill-harness.ts +45 -0
- package/src/__tests__/tool-audit-listener.test.ts +113 -0
- package/src/__tests__/tool-domain-event-publisher.test.ts +253 -0
- package/src/__tests__/tool-execution-pipeline.benchmark.test.ts +500 -0
- package/src/__tests__/tool-executor-lifecycle-events.test.ts +516 -0
- package/src/__tests__/tool-executor-redaction.test.ts +289 -0
- package/src/__tests__/tool-executor-shell-integration.test.ts +301 -0
- package/src/__tests__/tool-executor.test.ts +1989 -0
- package/src/__tests__/tool-metrics-listener.test.ts +225 -0
- package/src/__tests__/tool-notification-listener.test.ts +49 -0
- package/src/__tests__/tool-permission-simulate-handler.test.ts +336 -0
- package/src/__tests__/tool-policy.test.ts +54 -0
- package/src/__tests__/tool-profiling-listener.test.ts +268 -0
- package/src/__tests__/tool-result-truncation.test.ts +217 -0
- package/src/__tests__/tool-trace-listener.test.ts +226 -0
- package/src/__tests__/top-level-renderer.test.ts +121 -0
- package/src/__tests__/top-level-scanner.test.ts +141 -0
- package/src/__tests__/trace-emitter.test.ts +173 -0
- package/src/__tests__/trust-store.test.ts +1605 -0
- package/src/__tests__/turn-commit.test.ts +554 -0
- package/src/__tests__/twilio-provider.test.ts +329 -0
- package/src/__tests__/twilio-routes-elevenlabs.test.ts +375 -0
- package/src/__tests__/twilio-routes-twiml.test.ts +127 -0
- package/src/__tests__/twilio-routes.test.ts +577 -0
- package/src/__tests__/twitter-auth-handler.test.ts +667 -0
- package/src/__tests__/twitter-cli-error-shaping.test.ts +208 -0
- package/src/__tests__/twitter-cli-routing.test.ts +252 -0
- package/src/__tests__/twitter-oauth-client.test.ts +209 -0
- package/src/__tests__/url-safety.test.ts +418 -0
- package/src/__tests__/view-image-tool.test.ts +217 -0
- package/src/__tests__/weather-skill-regression.test.ts +225 -0
- package/src/__tests__/web-fetch.test.ts +869 -0
- package/src/__tests__/web-search.test.ts +584 -0
- package/src/__tests__/workspace-git-service.test.ts +1153 -0
- package/src/__tests__/workspace-heartbeat-service.test.ts +486 -0
- package/src/__tests__/workspace-lifecycle.test.ts +292 -0
- package/src/__tests__/workspace-policy.test.ts +213 -0
- package/src/agent/attachments.ts +35 -0
- package/src/agent/loop.ts +500 -0
- package/src/agent/message-types.ts +17 -0
- package/src/agent-heartbeat/agent-heartbeat-service.ts +155 -0
- package/src/autonomy/autonomy-resolver.ts +60 -0
- package/src/autonomy/autonomy-store.ts +122 -0
- package/src/autonomy/disposition-mapper.ts +31 -0
- package/src/autonomy/index.ts +11 -0
- package/src/autonomy/types.ts +39 -0
- package/src/bundler/app-bundler.ts +295 -0
- package/src/bundler/bundle-scanner.ts +535 -0
- package/src/bundler/bundle-signer.ts +124 -0
- package/src/bundler/manifest.ts +21 -0
- package/src/bundler/signature-verifier.ts +184 -0
- package/src/calls/call-bridge.ts +168 -0
- package/src/calls/call-constants.ts +48 -0
- package/src/calls/call-domain.ts +430 -0
- package/src/calls/call-orchestrator.ts +498 -0
- package/src/calls/call-recovery.ts +207 -0
- package/src/calls/call-state-machine.ts +68 -0
- package/src/calls/call-state.ts +87 -0
- package/src/calls/call-store.ts +422 -0
- package/src/calls/elevenlabs-client.ts +97 -0
- package/src/calls/elevenlabs-config.ts +31 -0
- package/src/calls/relay-server.ts +390 -0
- package/src/calls/speaker-identification.ts +213 -0
- package/src/calls/twilio-config.ts +45 -0
- package/src/calls/twilio-provider.ts +263 -0
- package/src/calls/twilio-rest.ts +156 -0
- package/src/calls/twilio-routes.ts +311 -0
- package/src/calls/types.ts +39 -0
- package/src/calls/voice-provider.ts +14 -0
- package/src/calls/voice-quality.ts +114 -0
- package/src/cli/autonomy.ts +188 -0
- package/src/cli/config-commands.ts +334 -0
- package/src/cli/contacts.ts +149 -0
- package/src/cli/core-commands.ts +784 -0
- package/src/cli/doordash.ts +1055 -0
- package/src/cli/email-guardrails.ts +200 -0
- package/src/cli/email.ts +405 -0
- package/src/cli/ipc-client.ts +82 -0
- package/src/cli/main-screen.tsx +53 -0
- package/src/cli/map.ts +270 -0
- package/src/cli/twitter.ts +754 -0
- package/src/cli.ts +918 -0
- package/src/commands/__tests__/cc-command-registry.test.ts +319 -0
- package/src/commands/cc-command-registry.ts +209 -0
- package/src/config/bundled-skills/.gitkeep +0 -0
- package/src/config/bundled-skills/agentmail/SKILL.md +128 -0
- package/src/config/bundled-skills/agentmail/icon.svg +21 -0
- package/src/config/bundled-skills/app-builder/SKILL.md +1404 -0
- package/src/config/bundled-skills/app-builder/TOOLS.json +279 -0
- package/src/config/bundled-skills/app-builder/icon.svg +9 -0
- package/src/config/bundled-skills/app-builder/tools/app-create.ts +15 -0
- package/src/config/bundled-skills/app-builder/tools/app-delete.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-edit.ts +11 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-list.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-read.ts +18 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-write.ts +11 -0
- package/src/config/bundled-skills/app-builder/tools/app-list.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-query.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-update.ts +20 -0
- package/src/config/bundled-skills/browser/SKILL.md +28 -0
- package/src/config/bundled-skills/browser/TOOLS.json +234 -0
- package/src/config/bundled-skills/browser/tools/browser-click.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-close.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-extract.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-fill-credential.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-navigate.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-press-key.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-screenshot.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-snapshot.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-type.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-wait-for.ts +9 -0
- package/src/config/bundled-skills/claude-code/SKILL.md +50 -0
- package/src/config/bundled-skills/claude-code/TOOLS.json +40 -0
- package/src/config/bundled-skills/claude-code/tools/claude-code.ts +9 -0
- package/src/config/bundled-skills/computer-use/SKILL.md +17 -0
- package/src/config/bundled-skills/computer-use/TOOLS.json +326 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-click.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-done.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-double-click.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-drag.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-key.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-open-app.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-request-control.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-respond.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-right-click.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-run-applescript.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-scroll.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-type-text.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-wait.ts +9 -0
- package/src/config/bundled-skills/contacts/SKILL.md +39 -0
- package/src/config/bundled-skills/contacts/TOOLS.json +122 -0
- package/src/config/bundled-skills/contacts/tools/contact-merge.ts +57 -0
- package/src/config/bundled-skills/contacts/tools/contact-search.ts +60 -0
- package/src/config/bundled-skills/contacts/tools/contact-upsert.ts +66 -0
- package/src/config/bundled-skills/document/SKILL.md +26 -0
- package/src/config/bundled-skills/document/TOOLS.json +53 -0
- package/src/config/bundled-skills/document/tools/document-create.ts +9 -0
- package/src/config/bundled-skills/document/tools/document-update.ts +9 -0
- package/src/config/bundled-skills/doordash/SKILL.md +163 -0
- package/src/config/bundled-skills/followups/SKILL.md +32 -0
- package/src/config/bundled-skills/followups/TOOLS.json +100 -0
- package/src/config/bundled-skills/followups/icon.svg +24 -0
- package/src/config/bundled-skills/followups/tools/followup-create.ts +9 -0
- package/src/config/bundled-skills/followups/tools/followup-list.ts +9 -0
- package/src/config/bundled-skills/followups/tools/followup-resolve.ts +9 -0
- package/src/config/bundled-skills/google-calendar/SKILL.md +51 -0
- package/src/config/bundled-skills/google-calendar/TOOLS.json +108 -0
- package/src/config/bundled-skills/google-calendar/calendar-client.ts +165 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-check-availability.ts +21 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-create-event.ts +42 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-get-event.ts +13 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-list-events.ts +30 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-rsvp.ts +41 -0
- package/src/config/bundled-skills/google-calendar/tools/shared.ts +18 -0
- package/src/config/bundled-skills/google-calendar/types.ts +97 -0
- package/src/config/bundled-skills/image-studio/SKILL.md +32 -0
- package/src/config/bundled-skills/image-studio/TOOLS.json +42 -0
- package/src/config/bundled-skills/image-studio/tools/media-generate-image.ts +115 -0
- package/src/config/bundled-skills/macos-automation/SKILL.md +66 -0
- package/src/config/bundled-skills/messaging/SKILL.md +153 -0
- package/src/config/bundled-skills/messaging/TOOLS.json +357 -0
- package/src/config/bundled-skills/messaging/tools/gmail-archive.ts +23 -0
- package/src/config/bundled-skills/messaging/tools/gmail-batch-archive.ts +23 -0
- package/src/config/bundled-skills/messaging/tools/gmail-batch-label.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/gmail-draft.ts +26 -0
- package/src/config/bundled-skills/messaging/tools/gmail-label.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/gmail-trash.ts +23 -0
- package/src/config/bundled-skills/messaging/tools/gmail-unsubscribe.ts +84 -0
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-activity.ts +18 -0
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-style.ts +125 -0
- package/src/config/bundled-skills/messaging/tools/messaging-auth-test.ts +16 -0
- package/src/config/bundled-skills/messaging/tools/messaging-draft.ts +49 -0
- package/src/config/bundled-skills/messaging/tools/messaging-list-conversations.ts +21 -0
- package/src/config/bundled-skills/messaging/tools/messaging-mark-read.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/messaging-read.ts +28 -0
- package/src/config/bundled-skills/messaging/tools/messaging-reply.ts +32 -0
- package/src/config/bundled-skills/messaging/tools/messaging-search.ts +22 -0
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +31 -0
- package/src/config/bundled-skills/messaging/tools/shared.ts +76 -0
- package/src/config/bundled-skills/messaging/tools/slack-add-reaction.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/slack-leave-channel.ts +23 -0
- package/src/config/bundled-skills/phone-calls/SKILL.md +533 -0
- package/src/config/bundled-skills/playbooks/SKILL.md +31 -0
- package/src/config/bundled-skills/playbooks/TOOLS.json +126 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-create.ts +98 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-delete.ts +54 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-list.ts +76 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-update.ts +113 -0
- package/src/config/bundled-skills/public-ingress/SKILL.md +200 -0
- package/src/config/bundled-skills/reminder/SKILL.md +20 -0
- package/src/config/bundled-skills/reminder/TOOLS.json +67 -0
- package/src/config/bundled-skills/reminder/tools/reminder-cancel.ts +9 -0
- package/src/config/bundled-skills/reminder/tools/reminder-create.ts +9 -0
- package/src/config/bundled-skills/reminder/tools/reminder-list.ts +9 -0
- package/src/config/bundled-skills/schedule/SKILL.md +74 -0
- package/src/config/bundled-skills/schedule/TOOLS.json +135 -0
- package/src/config/bundled-skills/schedule/tools/schedule-create.ts +9 -0
- package/src/config/bundled-skills/schedule/tools/schedule-delete.ts +9 -0
- package/src/config/bundled-skills/schedule/tools/schedule-list.ts +9 -0
- package/src/config/bundled-skills/schedule/tools/schedule-update.ts +9 -0
- package/src/config/bundled-skills/self-upgrade/SKILL.md +68 -0
- package/src/config/bundled-skills/start-the-day/SKILL.md +70 -0
- package/src/config/bundled-skills/start-the-day/icon.svg +13 -0
- package/src/config/bundled-skills/subagent/SKILL.md +25 -0
- package/src/config/bundled-skills/subagent/TOOLS.json +107 -0
- package/src/config/bundled-skills/subagent/tools/subagent-abort.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-message.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-read.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-spawn.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-status.ts +9 -0
- package/src/config/bundled-skills/tasks/SKILL.md +28 -0
- package/src/config/bundled-skills/tasks/TOOLS.json +281 -0
- package/src/config/bundled-skills/tasks/tools/task-delete.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-add.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-remove.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-show.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-update.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-queue-run.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-run.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-save.ts +9 -0
- package/src/config/bundled-skills/transcribe/SKILL.md +25 -0
- package/src/config/bundled-skills/transcribe/TOOLS.json +32 -0
- package/src/config/bundled-skills/transcribe/tools/transcribe-media.ts +370 -0
- package/src/config/bundled-skills/twitter/SKILL.md +220 -0
- package/src/config/bundled-skills/watcher/SKILL.md +27 -0
- package/src/config/bundled-skills/watcher/TOOLS.json +147 -0
- package/src/config/bundled-skills/watcher/tools/watcher-create.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-delete.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-digest.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-list.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-update.ts +9 -0
- package/src/config/bundled-skills/weather/SKILL.md +37 -0
- package/src/config/bundled-skills/weather/TOOLS.json +32 -0
- package/src/config/bundled-skills/weather/icon.svg +24 -0
- package/src/config/bundled-skills/weather/tools/get-weather.ts +9 -0
- package/src/config/computer-use-prompt.ts +97 -0
- package/src/config/defaults.ts +263 -0
- package/src/config/loader.ts +339 -0
- package/src/config/schema.ts +1436 -0
- package/src/config/skill-state.ts +95 -0
- package/src/config/skills.ts +972 -0
- package/src/config/system-prompt.ts +675 -0
- package/src/config/templates/BOOTSTRAP.md +70 -0
- package/src/config/templates/IDENTITY.md +25 -0
- package/src/config/templates/LOOKS.md +25 -0
- package/src/config/templates/SOUL.md +37 -0
- package/src/config/templates/USER.md +19 -0
- package/src/config/types.ts +42 -0
- package/src/config/vellum-skills/chatgpt-import/SKILL.md +24 -0
- package/src/config/vellum-skills/chatgpt-import/TOOLS.json +23 -0
- package/src/config/vellum-skills/chatgpt-import/tools/chatgpt-import.ts +284 -0
- package/src/config/vellum-skills/deploy-fullstack-vercel/SKILL.md +179 -0
- package/src/config/vellum-skills/document-writer/SKILL.md +195 -0
- package/src/config/vellum-skills/google-oauth-setup/SKILL.md +199 -0
- package/src/config/vellum-skills/slack-oauth-setup/SKILL.md +153 -0
- package/src/config/vellum-skills/telegram-setup/SKILL.md +143 -0
- package/src/config/vellum-skills/twilio-setup/SKILL.md +213 -0
- package/src/contacts/contact-store.ts +410 -0
- package/src/contacts/index.ts +11 -0
- package/src/contacts/types.ts +28 -0
- package/src/context/token-estimator.ts +108 -0
- package/src/context/tool-result-truncation.ts +128 -0
- package/src/context/window-manager.ts +531 -0
- package/src/daemon/assistant-attachments.ts +691 -0
- package/src/daemon/classifier.ts +110 -0
- package/src/daemon/computer-use-session.ts +903 -0
- package/src/daemon/connection-policy.ts +41 -0
- package/src/daemon/date-context.ts +136 -0
- package/src/daemon/handlers/apps.ts +530 -0
- package/src/daemon/handlers/browser.ts +54 -0
- package/src/daemon/handlers/computer-use.ts +187 -0
- package/src/daemon/handlers/config.ts +1517 -0
- package/src/daemon/handlers/diagnostics.ts +338 -0
- package/src/daemon/handlers/documents.ts +173 -0
- package/src/daemon/handlers/home-base.ts +78 -0
- package/src/daemon/handlers/identity.ts +127 -0
- package/src/daemon/handlers/index.ts +129 -0
- package/src/daemon/handlers/misc.ts +331 -0
- package/src/daemon/handlers/open-bundle-handler.ts +80 -0
- package/src/daemon/handlers/publish.ts +187 -0
- package/src/daemon/handlers/sessions.ts +555 -0
- package/src/daemon/handlers/shared.ts +570 -0
- package/src/daemon/handlers/signing.ts +37 -0
- package/src/daemon/handlers/skills.ts +486 -0
- package/src/daemon/handlers/subagents.ts +210 -0
- package/src/daemon/handlers/twitter-auth.ts +198 -0
- package/src/daemon/handlers/work-items.ts +632 -0
- package/src/daemon/handlers/workspace-files.ts +75 -0
- package/src/daemon/handlers.ts +17 -0
- package/src/daemon/history-repair.ts +214 -0
- package/src/daemon/ipc-blob-store.ts +231 -0
- package/src/daemon/ipc-contract-inventory.json +495 -0
- package/src/daemon/ipc-contract-inventory.ts +126 -0
- package/src/daemon/ipc-contract.ts +2551 -0
- package/src/daemon/ipc-protocol.ts +75 -0
- package/src/daemon/ipc-validate.ts +188 -0
- package/src/daemon/lifecycle.ts +582 -0
- package/src/daemon/main.ts +21 -0
- package/src/daemon/media-visibility-policy.ts +57 -0
- package/src/daemon/ride-shotgun-handler.ts +309 -0
- package/src/daemon/server.ts +1215 -0
- package/src/daemon/session-agent-loop.ts +922 -0
- package/src/daemon/session-attachments.ts +196 -0
- package/src/daemon/session-conflict-gate.ts +184 -0
- package/src/daemon/session-dynamic-profile.ts +63 -0
- package/src/daemon/session-error.ts +290 -0
- package/src/daemon/session-evictor.ts +196 -0
- package/src/daemon/session-history.ts +437 -0
- package/src/daemon/session-lifecycle.ts +147 -0
- package/src/daemon/session-media-retry.ts +147 -0
- package/src/daemon/session-memory.ts +212 -0
- package/src/daemon/session-messaging.ts +145 -0
- package/src/daemon/session-notifiers.ts +193 -0
- package/src/daemon/session-process.ts +323 -0
- package/src/daemon/session-queue-manager.ts +82 -0
- package/src/daemon/session-runtime-assembly.ts +447 -0
- package/src/daemon/session-skill-tools.ts +356 -0
- package/src/daemon/session-slash.ts +305 -0
- package/src/daemon/session-surfaces.ts +702 -0
- package/src/daemon/session-tool-setup.ts +523 -0
- package/src/daemon/session-usage.ts +72 -0
- package/src/daemon/session-workspace.ts +19 -0
- package/src/daemon/session.ts +400 -0
- package/src/daemon/tls-certs.ts +189 -0
- package/src/daemon/trace-emitter.ts +82 -0
- package/src/daemon/video-thumbnail.ts +62 -0
- package/src/daemon/watch-handler.ts +274 -0
- package/src/doordash/client.ts +999 -0
- package/src/doordash/queries.ts +1311 -0
- package/src/doordash/query-extractor.ts +93 -0
- package/src/doordash/session.ts +82 -0
- package/src/email/provider.ts +117 -0
- package/src/email/providers/agentmail.ts +317 -0
- package/src/email/providers/index.ts +58 -0
- package/src/email/service.ts +303 -0
- package/src/email/types.ts +126 -0
- package/src/events/bus.ts +157 -0
- package/src/events/domain-events.ts +83 -0
- package/src/events/index.ts +18 -0
- package/src/events/tool-audit-listener.ts +80 -0
- package/src/events/tool-domain-event-publisher.ts +111 -0
- package/src/events/tool-metrics-listener.ts +159 -0
- package/src/events/tool-notification-listener.ts +17 -0
- package/src/events/tool-profiling-listener.ts +158 -0
- package/src/events/tool-trace-listener.ts +75 -0
- package/src/export/formatter.ts +98 -0
- package/src/followups/followup-store.ts +168 -0
- package/src/followups/index.ts +10 -0
- package/src/followups/types.ts +29 -0
- package/src/gallery/default-gallery.ts +795 -0
- package/src/gallery/gallery-manifest.ts +24 -0
- package/src/home-base/app-link-store.ts +82 -0
- package/src/home-base/bootstrap.ts +68 -0
- package/src/home-base/prebuilt/index.html +662 -0
- package/src/home-base/prebuilt/seed-metadata.json +21 -0
- package/src/home-base/prebuilt/seed.ts +112 -0
- package/src/home-base/prebuilt-home-base-updater.ts +30 -0
- package/src/hooks/cli.ts +163 -0
- package/src/hooks/config.ts +88 -0
- package/src/hooks/discovery.ts +110 -0
- package/src/hooks/manager.ts +124 -0
- package/src/hooks/runner.ts +123 -0
- package/src/hooks/templates.ts +52 -0
- package/src/hooks/types.ts +72 -0
- package/src/inbound/public-ingress-urls.ts +123 -0
- package/src/index.ts +81 -0
- package/src/instrument.ts +60 -0
- package/src/logfire.ts +99 -0
- package/src/media/gemini-image-service.ts +136 -0
- package/src/memory/account-store.ts +108 -0
- package/src/memory/admin.ts +211 -0
- package/src/memory/app-git-service.ts +295 -0
- package/src/memory/app-store.ts +577 -0
- package/src/memory/attachments-store.ts +397 -0
- package/src/memory/channel-delivery-store.ts +353 -0
- package/src/memory/channel-guardian-store.ts +669 -0
- package/src/memory/checkpoints.ts +52 -0
- package/src/memory/clarification-resolver.ts +298 -0
- package/src/memory/conflict-intent.ts +157 -0
- package/src/memory/conflict-policy.ts +73 -0
- package/src/memory/conflict-store.ts +350 -0
- package/src/memory/contradiction-checker.ts +358 -0
- package/src/memory/conversation-key-store.ts +122 -0
- package/src/memory/conversation-store.ts +470 -0
- package/src/memory/db.ts +1991 -0
- package/src/memory/embedding-backend.ts +229 -0
- package/src/memory/embedding-gemini.ts +52 -0
- package/src/memory/embedding-local.ts +65 -0
- package/src/memory/embedding-ollama.ts +55 -0
- package/src/memory/embedding-openai.ts +25 -0
- package/src/memory/entity-extractor.ts +474 -0
- package/src/memory/external-conversation-store.ts +234 -0
- package/src/memory/fingerprint.ts +20 -0
- package/src/memory/indexer.ts +156 -0
- package/src/memory/items-extractor.ts +461 -0
- package/src/memory/job-handlers/backfill.ts +139 -0
- package/src/memory/job-handlers/cleanup.ts +58 -0
- package/src/memory/job-handlers/conflict.ts +141 -0
- package/src/memory/job-handlers/embedding.ts +61 -0
- package/src/memory/job-handlers/extraction.ts +123 -0
- package/src/memory/job-handlers/index-maintenance.ts +54 -0
- package/src/memory/job-handlers/summarization.ts +286 -0
- package/src/memory/job-utils.ts +170 -0
- package/src/memory/jobs-store.ts +401 -0
- package/src/memory/jobs-worker.ts +313 -0
- package/src/memory/llm-request-log-store.ts +45 -0
- package/src/memory/llm-usage-store.ts +60 -0
- package/src/memory/message-content.ts +54 -0
- package/src/memory/profile-compiler.ts +160 -0
- package/src/memory/published-pages-store.ts +137 -0
- package/src/memory/qdrant-client.ts +366 -0
- package/src/memory/qdrant-manager.ts +242 -0
- package/src/memory/query-builder.ts +45 -0
- package/src/memory/retrieval-budget.ts +30 -0
- package/src/memory/retriever.ts +653 -0
- package/src/memory/runs-store.ts +305 -0
- package/src/memory/schema.ts +677 -0
- package/src/memory/search/entity.ts +298 -0
- package/src/memory/search/formatting.ts +207 -0
- package/src/memory/search/lexical.ts +227 -0
- package/src/memory/search/ranking.ts +401 -0
- package/src/memory/search/semantic.ts +121 -0
- package/src/memory/search/types.ts +137 -0
- package/src/memory/segmenter.ts +68 -0
- package/src/memory/shared-app-links-store.ts +138 -0
- package/src/memory/tool-usage-store.ts +62 -0
- package/src/messaging/activity-analyzer.ts +76 -0
- package/src/messaging/draft-store.ts +88 -0
- package/src/messaging/index.ts +3 -0
- package/src/messaging/provider-types.ts +80 -0
- package/src/messaging/provider.ts +52 -0
- package/src/messaging/providers/gmail/adapter.ts +193 -0
- package/src/messaging/providers/gmail/client.ts +204 -0
- package/src/messaging/providers/gmail/types.ts +90 -0
- package/src/messaging/providers/slack/adapter.ts +202 -0
- package/src/messaging/providers/slack/client.ts +198 -0
- package/src/messaging/providers/slack/types.ts +119 -0
- package/src/messaging/providers/telegram-bot/adapter.ts +162 -0
- package/src/messaging/providers/telegram-bot/client.ts +104 -0
- package/src/messaging/providers/telegram-bot/types.ts +15 -0
- package/src/messaging/registry.ts +35 -0
- package/src/messaging/style-analyzer.ts +159 -0
- package/src/messaging/thread-summarizer.ts +306 -0
- package/src/messaging/triage-engine.ts +323 -0
- package/src/messaging/types.ts +55 -0
- package/src/permissions/checker.ts +640 -0
- package/src/permissions/defaults.ts +254 -0
- package/src/permissions/prompter.ts +98 -0
- package/src/permissions/secret-prompter.ts +114 -0
- package/src/permissions/shell-identity.ts +227 -0
- package/src/permissions/trust-store.ts +607 -0
- package/src/permissions/types.ts +43 -0
- package/src/permissions/workspace-policy.ts +114 -0
- package/src/playbooks/index.ts +2 -0
- package/src/playbooks/playbook-compiler.ts +90 -0
- package/src/playbooks/types.ts +55 -0
- package/src/providers/anthropic/client.ts +751 -0
- package/src/providers/failover.ts +129 -0
- package/src/providers/fireworks/client.ts +20 -0
- package/src/providers/gemini/client.ts +285 -0
- package/src/providers/ollama/client.ts +30 -0
- package/src/providers/openai/client.ts +337 -0
- package/src/providers/openrouter/client.ts +20 -0
- package/src/providers/ratelimit.ts +93 -0
- package/src/providers/registry.ts +146 -0
- package/src/providers/retry.ts +81 -0
- package/src/providers/stream-timeout.ts +38 -0
- package/src/providers/types.ts +109 -0
- package/src/runtime/assistant-event-hub.ts +157 -0
- package/src/runtime/assistant-event.ts +82 -0
- package/src/runtime/channel-approval-parser.ts +60 -0
- package/src/runtime/channel-approval-types.ts +73 -0
- package/src/runtime/channel-approvals.ts +206 -0
- package/src/runtime/channel-guardian-service.ts +212 -0
- package/src/runtime/gateway-client.ts +58 -0
- package/src/runtime/http-server.ts +1076 -0
- package/src/runtime/http-types.ts +66 -0
- package/src/runtime/routes/app-routes.ts +174 -0
- package/src/runtime/routes/attachment-routes.ts +133 -0
- package/src/runtime/routes/call-routes.ts +190 -0
- package/src/runtime/routes/channel-routes.ts +1404 -0
- package/src/runtime/routes/conversation-routes.ts +352 -0
- package/src/runtime/routes/events-routes.ts +148 -0
- package/src/runtime/routes/run-routes.ts +257 -0
- package/src/runtime/routes/secret-routes.ts +76 -0
- package/src/runtime/run-orchestrator.ts +330 -0
- package/src/schedule/recurrence-engine.ts +162 -0
- package/src/schedule/recurrence-types.ts +67 -0
- package/src/schedule/schedule-store.ts +506 -0
- package/src/schedule/scheduler.ts +171 -0
- package/src/security/encrypted-store.ts +238 -0
- package/src/security/keychain.ts +252 -0
- package/src/security/oauth-callback-registry.ts +66 -0
- package/src/security/oauth2.ts +274 -0
- package/src/security/redaction.ts +89 -0
- package/src/security/secret-allowlist.ts +164 -0
- package/src/security/secret-ingress.ts +57 -0
- package/src/security/secret-scanner.ts +550 -0
- package/src/security/secure-keys.ts +180 -0
- package/src/security/token-manager.ts +141 -0
- package/src/services/published-app-updater.ts +69 -0
- package/src/services/vercel-deploy.ts +73 -0
- package/src/skills/active-skill-tools.ts +81 -0
- package/src/skills/clawhub.ts +414 -0
- package/src/skills/include-graph.ts +146 -0
- package/src/skills/managed-store.ts +233 -0
- package/src/skills/path-classifier.ts +128 -0
- package/src/skills/slash-commands.ts +174 -0
- package/src/skills/tool-manifest.ts +165 -0
- package/src/skills/version-hash.ts +110 -0
- package/src/slack/slack-webhook.ts +61 -0
- package/src/subagent/index.ts +19 -0
- package/src/subagent/manager.ts +511 -0
- package/src/subagent/types.ts +69 -0
- package/src/swarm/backend-claude-code.ts +145 -0
- package/src/swarm/index.ts +44 -0
- package/src/swarm/limits.ts +37 -0
- package/src/swarm/orchestrator.ts +279 -0
- package/src/swarm/plan-validator.ts +151 -0
- package/src/swarm/router-planner.ts +100 -0
- package/src/swarm/router-prompts.ts +36 -0
- package/src/swarm/synthesizer.ts +62 -0
- package/src/swarm/types.ts +62 -0
- package/src/swarm/worker-backend.ts +121 -0
- package/src/swarm/worker-prompts.ts +79 -0
- package/src/swarm/worker-runner.ts +164 -0
- package/src/tasks/SPEC.md +139 -0
- package/src/tasks/candidate-store.ts +86 -0
- package/src/tasks/ephemeral-permissions.ts +48 -0
- package/src/tasks/task-compiler.ts +199 -0
- package/src/tasks/task-runner.ts +90 -0
- package/src/tasks/task-scheduler.ts +21 -0
- package/src/tasks/task-store.ts +127 -0
- package/src/tasks/tool-sanitizer.ts +36 -0
- package/src/tools/apps/definitions.ts +59 -0
- package/src/tools/apps/executors.ts +313 -0
- package/src/tools/apps/open-proxy.ts +43 -0
- package/src/tools/apps/registry.ts +16 -0
- package/src/tools/assets/materialize.ts +218 -0
- package/src/tools/assets/search.ts +361 -0
- package/src/tools/browser/__tests__/auth-cache.test.ts +219 -0
- package/src/tools/browser/__tests__/auth-detector.test.ts +362 -0
- package/src/tools/browser/__tests__/jit-auth.test.ts +189 -0
- package/src/tools/browser/api-map.ts +293 -0
- package/src/tools/browser/auth-cache.ts +149 -0
- package/src/tools/browser/auth-detector.ts +347 -0
- package/src/tools/browser/auto-navigate.ts +270 -0
- package/src/tools/browser/browser-execution.ts +980 -0
- package/src/tools/browser/browser-handoff.ts +79 -0
- package/src/tools/browser/browser-manager.ts +715 -0
- package/src/tools/browser/browser-screencast.ts +217 -0
- package/src/tools/browser/headless-browser.ts +450 -0
- package/src/tools/browser/jit-auth.ts +51 -0
- package/src/tools/browser/network-recorder.ts +349 -0
- package/src/tools/browser/network-recording-types.ts +49 -0
- package/src/tools/browser/recording-store.ts +49 -0
- package/src/tools/browser/runtime-check.ts +43 -0
- package/src/tools/browser/x-auto-navigate.ts +207 -0
- package/src/tools/calls/call-end.ts +67 -0
- package/src/tools/calls/call-start.ts +81 -0
- package/src/tools/calls/call-status.ts +81 -0
- package/src/tools/claude-code/claude-code.ts +428 -0
- package/src/tools/computer-use/definitions.ts +443 -0
- package/src/tools/computer-use/registry.ts +22 -0
- package/src/tools/computer-use/request-computer-control.ts +53 -0
- package/src/tools/computer-use/skill-proxy-bridge.ts +28 -0
- package/src/tools/credentials/account-registry.ts +127 -0
- package/src/tools/credentials/broker-types.ts +107 -0
- package/src/tools/credentials/broker.ts +372 -0
- package/src/tools/credentials/domain-policy.ts +51 -0
- package/src/tools/credentials/host-pattern-match.ts +60 -0
- package/src/tools/credentials/metadata-store.ts +335 -0
- package/src/tools/credentials/policy-types.ts +52 -0
- package/src/tools/credentials/policy-validate.ts +80 -0
- package/src/tools/credentials/resolve.ts +122 -0
- package/src/tools/credentials/selection.ts +159 -0
- package/src/tools/credentials/tool-policy.ts +25 -0
- package/src/tools/credentials/vault.ts +657 -0
- package/src/tools/document/document-tool.ts +92 -0
- package/src/tools/document/editor-template.ts +237 -0
- package/src/tools/execution-target.ts +21 -0
- package/src/tools/execution-timeout.ts +49 -0
- package/src/tools/executor.ts +815 -0
- package/src/tools/filesystem/edit.ts +127 -0
- package/src/tools/filesystem/fuzzy-match.ts +202 -0
- package/src/tools/filesystem/read.ts +71 -0
- package/src/tools/filesystem/view-image.ts +199 -0
- package/src/tools/filesystem/write.ts +79 -0
- package/src/tools/followups/followup_create.ts +76 -0
- package/src/tools/followups/followup_list.ts +60 -0
- package/src/tools/followups/followup_resolve.ts +56 -0
- package/src/tools/host-filesystem/edit.ts +125 -0
- package/src/tools/host-filesystem/read.ts +80 -0
- package/src/tools/host-filesystem/write.ts +76 -0
- package/src/tools/host-terminal/cli-discover.ts +180 -0
- package/src/tools/host-terminal/host-shell.ts +191 -0
- package/src/tools/memory/definitions.ts +69 -0
- package/src/tools/memory/handlers.ts +246 -0
- package/src/tools/memory/register.ts +66 -0
- package/src/tools/network/__tests__/web-search.test.ts +427 -0
- package/src/tools/network/domain-normalize.ts +85 -0
- package/src/tools/network/script-proxy/__tests__/logging.test.ts +248 -0
- package/src/tools/network/script-proxy/__tests__/policy.test.ts +234 -0
- package/src/tools/network/script-proxy/__tests__/router.test.ts +76 -0
- package/src/tools/network/script-proxy/certs.ts +237 -0
- package/src/tools/network/script-proxy/connect-tunnel.ts +82 -0
- package/src/tools/network/script-proxy/http-forwarder.ts +151 -0
- package/src/tools/network/script-proxy/index.ts +28 -0
- package/src/tools/network/script-proxy/logging.ts +196 -0
- package/src/tools/network/script-proxy/mitm-handler.ts +269 -0
- package/src/tools/network/script-proxy/policy.ts +152 -0
- package/src/tools/network/script-proxy/router.ts +60 -0
- package/src/tools/network/script-proxy/server.ts +136 -0
- package/src/tools/network/script-proxy/session-manager.ts +534 -0
- package/src/tools/network/script-proxy/types.ts +125 -0
- package/src/tools/network/url-safety.ts +227 -0
- package/src/tools/network/web-fetch.ts +713 -0
- package/src/tools/network/web-search.ts +296 -0
- package/src/tools/policy-context.ts +29 -0
- package/src/tools/registry.ts +295 -0
- package/src/tools/reminder/reminder-store.ts +148 -0
- package/src/tools/reminder/reminder.ts +80 -0
- package/src/tools/schedule/create.ts +81 -0
- package/src/tools/schedule/delete.ts +28 -0
- package/src/tools/schedule/list.ts +69 -0
- package/src/tools/schedule/update.ts +97 -0
- package/src/tools/shared/filesystem/edit-engine.ts +56 -0
- package/src/tools/shared/filesystem/errors.ts +85 -0
- package/src/tools/shared/filesystem/file-ops-service.ts +215 -0
- package/src/tools/shared/filesystem/format-diff.ts +35 -0
- package/src/tools/shared/filesystem/path-policy.ts +125 -0
- package/src/tools/shared/filesystem/size-guard.ts +41 -0
- package/src/tools/shared/filesystem/types.ts +80 -0
- package/src/tools/shared/shell-output.ts +52 -0
- package/src/tools/skills/delete-managed.ts +60 -0
- package/src/tools/skills/load.ts +139 -0
- package/src/tools/skills/sandbox-runner.ts +279 -0
- package/src/tools/skills/scaffold-managed.ts +150 -0
- package/src/tools/skills/script-contract.ts +6 -0
- package/src/tools/skills/skill-script-runner.ts +86 -0
- package/src/tools/skills/skill-tool-factory.ts +64 -0
- package/src/tools/skills/vellum-catalog.ts +217 -0
- package/src/tools/subagent/abort.ts +33 -0
- package/src/tools/subagent/message.ts +39 -0
- package/src/tools/subagent/read.ts +67 -0
- package/src/tools/subagent/spawn.ts +46 -0
- package/src/tools/subagent/status.ts +45 -0
- package/src/tools/swarm/delegate.ts +183 -0
- package/src/tools/system/request-permission.ts +98 -0
- package/src/tools/system/version.ts +43 -0
- package/src/tools/tasks/index.ts +27 -0
- package/src/tools/tasks/task-delete.ts +82 -0
- package/src/tools/tasks/task-list.ts +44 -0
- package/src/tools/tasks/task-run.ts +97 -0
- package/src/tools/tasks/task-save.ts +47 -0
- package/src/tools/tasks/work-item-enqueue.ts +234 -0
- package/src/tools/tasks/work-item-list.ts +55 -0
- package/src/tools/tasks/work-item-remove.ts +60 -0
- package/src/tools/tasks/work-item-run.ts +78 -0
- package/src/tools/tasks/work-item-update.ts +114 -0
- package/src/tools/terminal/backends/docker.ts +372 -0
- package/src/tools/terminal/backends/native.ts +190 -0
- package/src/tools/terminal/backends/types.ts +26 -0
- package/src/tools/terminal/evaluate-typescript.ts +275 -0
- package/src/tools/terminal/parser.ts +413 -0
- package/src/tools/terminal/safe-env.ts +37 -0
- package/src/tools/terminal/sandbox-diagnostics.ts +149 -0
- package/src/tools/terminal/sandbox.ts +44 -0
- package/src/tools/terminal/shell.ts +257 -0
- package/src/tools/tool-manifest.ts +198 -0
- package/src/tools/types.ts +176 -0
- package/src/tools/ui-surface/definitions.ts +244 -0
- package/src/tools/ui-surface/registry.ts +14 -0
- package/src/tools/watch/screen-watch.ts +130 -0
- package/src/tools/watch/watch-state.ts +119 -0
- package/src/tools/watcher/create.ts +64 -0
- package/src/tools/watcher/delete.ts +27 -0
- package/src/tools/watcher/digest.ts +50 -0
- package/src/tools/watcher/list.ts +60 -0
- package/src/tools/watcher/update.ts +56 -0
- package/src/tools/weather/service.ts +551 -0
- package/src/twitter/client.ts +690 -0
- package/src/twitter/oauth-client.ts +102 -0
- package/src/twitter/router.ts +101 -0
- package/src/twitter/session.ts +91 -0
- package/src/usage/actors.ts +24 -0
- package/src/usage/types.ts +37 -0
- package/src/util/clipboard.ts +33 -0
- package/src/util/content-id.ts +16 -0
- package/src/util/debounce.ts +88 -0
- package/src/util/diff.ts +181 -0
- package/src/util/errors.ts +129 -0
- package/src/util/logger.ts +243 -0
- package/src/util/network-info.ts +47 -0
- package/src/util/platform.ts +632 -0
- package/src/util/pricing.ts +150 -0
- package/src/util/promise-guard.ts +37 -0
- package/src/util/retry.ts +98 -0
- package/src/util/spinner.ts +51 -0
- package/src/util/time.ts +16 -0
- package/src/util/truncate.ts +6 -0
- package/src/util/xml.ts +4 -0
- package/src/version.ts +3 -0
- package/src/watcher/constants.ts +11 -0
- package/src/watcher/engine.ts +199 -0
- package/src/watcher/provider-registry.ts +15 -0
- package/src/watcher/provider-types.ts +48 -0
- package/src/watcher/providers/gmail.ts +198 -0
- package/src/watcher/providers/google-calendar.ts +228 -0
- package/src/watcher/providers/slack.ts +129 -0
- package/src/watcher/watcher-store.ts +419 -0
- package/src/work-items/work-item-runner.ts +171 -0
- package/src/work-items/work-item-store.ts +325 -0
- package/src/workspace/commit-message-enrichment-service.ts +284 -0
- package/src/workspace/commit-message-provider.ts +95 -0
- package/src/workspace/git-service.ts +857 -0
- package/src/workspace/heartbeat-service.ts +345 -0
- package/src/workspace/provider-commit-message-generator.ts +285 -0
- package/src/workspace/top-level-renderer.ts +19 -0
- package/src/workspace/top-level-scanner.ts +41 -0
- package/src/workspace/turn-commit.ts +175 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,1436 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getDataDir } from '../util/platform.js';
|
|
3
|
+
|
|
4
|
+
const VALID_PROVIDERS = ['anthropic', 'openai', 'gemini', 'ollama', 'fireworks', 'openrouter'] as const;
|
|
5
|
+
const VALID_WEB_SEARCH_PROVIDERS = ['perplexity', 'brave', 'anthropic-native'] as const;
|
|
6
|
+
const VALID_SECRET_ACTIONS = ['redact', 'warn', 'block', 'prompt'] as const;
|
|
7
|
+
const VALID_MEMORY_EMBEDDING_PROVIDERS = ['auto', 'local', 'openai', 'gemini', 'ollama'] as const;
|
|
8
|
+
const VALID_SANDBOX_BACKENDS = ['native', 'docker'] as const;
|
|
9
|
+
const VALID_DOCKER_NETWORKS = ['none', 'bridge'] as const;
|
|
10
|
+
const VALID_PERMISSIONS_MODES = ['legacy', 'strict', 'workspace'] as const;
|
|
11
|
+
const VALID_SMS_PROVIDERS = ['twilio'] as const;
|
|
12
|
+
const VALID_CALL_PROVIDERS = ['twilio'] as const;
|
|
13
|
+
const VALID_CALL_VOICE_MODES = ['twilio_standard', 'twilio_elevenlabs_tts', 'elevenlabs_agent'] as const;
|
|
14
|
+
export const VALID_CALLER_IDENTITY_MODES = ['assistant_number', 'user_number'] as const;
|
|
15
|
+
const VALID_CALL_TRANSCRIPTION_PROVIDERS = ['Deepgram', 'Google'] as const;
|
|
16
|
+
const VALID_MEMORY_ITEM_KINDS = [
|
|
17
|
+
'preference', 'profile', 'project', 'decision', 'todo',
|
|
18
|
+
'fact', 'constraint', 'relationship', 'event', 'opinion', 'instruction', 'style',
|
|
19
|
+
] as const;
|
|
20
|
+
|
|
21
|
+
const DEFAULT_CONFLICTABLE_KINDS = [
|
|
22
|
+
'preference', 'profile', 'constraint', 'instruction', 'style',
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
export const TimeoutConfigSchema = z.object({
|
|
26
|
+
shellMaxTimeoutSec: z
|
|
27
|
+
.number({ error: 'timeouts.shellMaxTimeoutSec must be a number' })
|
|
28
|
+
.finite('timeouts.shellMaxTimeoutSec must be finite')
|
|
29
|
+
.positive('timeouts.shellMaxTimeoutSec must be a positive number')
|
|
30
|
+
.default(600),
|
|
31
|
+
shellDefaultTimeoutSec: z
|
|
32
|
+
.number({ error: 'timeouts.shellDefaultTimeoutSec must be a number' })
|
|
33
|
+
.finite('timeouts.shellDefaultTimeoutSec must be finite')
|
|
34
|
+
.positive('timeouts.shellDefaultTimeoutSec must be a positive number')
|
|
35
|
+
.default(120),
|
|
36
|
+
permissionTimeoutSec: z
|
|
37
|
+
.number({ error: 'timeouts.permissionTimeoutSec must be a number' })
|
|
38
|
+
.finite('timeouts.permissionTimeoutSec must be finite')
|
|
39
|
+
.positive('timeouts.permissionTimeoutSec must be a positive number')
|
|
40
|
+
.default(300),
|
|
41
|
+
toolExecutionTimeoutSec: z
|
|
42
|
+
.number({ error: 'timeouts.toolExecutionTimeoutSec must be a number' })
|
|
43
|
+
.finite('timeouts.toolExecutionTimeoutSec must be finite')
|
|
44
|
+
.positive('timeouts.toolExecutionTimeoutSec must be a positive number')
|
|
45
|
+
.default(120),
|
|
46
|
+
providerStreamTimeoutSec: z
|
|
47
|
+
.number({ error: 'timeouts.providerStreamTimeoutSec must be a number' })
|
|
48
|
+
.finite('timeouts.providerStreamTimeoutSec must be finite')
|
|
49
|
+
.positive('timeouts.providerStreamTimeoutSec must be a positive number')
|
|
50
|
+
.default(300),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const DockerConfigSchema = z.object({
|
|
54
|
+
image: z
|
|
55
|
+
.string({ error: 'sandbox.docker.image must be a string' })
|
|
56
|
+
.default('vellum-sandbox:latest'),
|
|
57
|
+
shell: z
|
|
58
|
+
.string({ error: 'sandbox.docker.shell must be a string' })
|
|
59
|
+
.default('bash'),
|
|
60
|
+
cpus: z
|
|
61
|
+
.number({ error: 'sandbox.docker.cpus must be a number' })
|
|
62
|
+
.finite('sandbox.docker.cpus must be finite')
|
|
63
|
+
.positive('sandbox.docker.cpus must be a positive number')
|
|
64
|
+
.default(1),
|
|
65
|
+
memoryMb: z
|
|
66
|
+
.number({ error: 'sandbox.docker.memoryMb must be a number' })
|
|
67
|
+
.int('sandbox.docker.memoryMb must be an integer')
|
|
68
|
+
.positive('sandbox.docker.memoryMb must be a positive integer')
|
|
69
|
+
.default(512),
|
|
70
|
+
pidsLimit: z
|
|
71
|
+
.number({ error: 'sandbox.docker.pidsLimit must be a number' })
|
|
72
|
+
.int('sandbox.docker.pidsLimit must be an integer')
|
|
73
|
+
.positive('sandbox.docker.pidsLimit must be a positive integer')
|
|
74
|
+
.default(256),
|
|
75
|
+
network: z
|
|
76
|
+
.enum(VALID_DOCKER_NETWORKS, {
|
|
77
|
+
error: `sandbox.docker.network must be one of: ${VALID_DOCKER_NETWORKS.join(', ')}`,
|
|
78
|
+
})
|
|
79
|
+
.default('none'),
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
export const SandboxConfigSchema = z.object({
|
|
83
|
+
enabled: z
|
|
84
|
+
.boolean({ error: 'sandbox.enabled must be a boolean' })
|
|
85
|
+
.default(true),
|
|
86
|
+
backend: z
|
|
87
|
+
.enum(VALID_SANDBOX_BACKENDS, {
|
|
88
|
+
error: `sandbox.backend must be one of: ${VALID_SANDBOX_BACKENDS.join(', ')}`,
|
|
89
|
+
})
|
|
90
|
+
.default('docker'),
|
|
91
|
+
docker: DockerConfigSchema.default({
|
|
92
|
+
image: 'vellum-sandbox:latest',
|
|
93
|
+
shell: 'bash',
|
|
94
|
+
cpus: 1,
|
|
95
|
+
memoryMb: 512,
|
|
96
|
+
pidsLimit: 256,
|
|
97
|
+
network: 'none',
|
|
98
|
+
}),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export const RateLimitConfigSchema = z.object({
|
|
102
|
+
maxRequestsPerMinute: z
|
|
103
|
+
.number({ error: 'rateLimit.maxRequestsPerMinute must be a number' })
|
|
104
|
+
.int('rateLimit.maxRequestsPerMinute must be an integer')
|
|
105
|
+
.nonnegative('rateLimit.maxRequestsPerMinute must be a non-negative integer')
|
|
106
|
+
.default(0),
|
|
107
|
+
maxTokensPerSession: z
|
|
108
|
+
.number({ error: 'rateLimit.maxTokensPerSession must be a number' })
|
|
109
|
+
.int('rateLimit.maxTokensPerSession must be an integer')
|
|
110
|
+
.nonnegative('rateLimit.maxTokensPerSession must be a non-negative integer')
|
|
111
|
+
.default(0),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const SecretDetectionConfigSchema = z.object({
|
|
115
|
+
enabled: z
|
|
116
|
+
.boolean({ error: 'secretDetection.enabled must be a boolean' })
|
|
117
|
+
.default(true),
|
|
118
|
+
action: z
|
|
119
|
+
.enum(VALID_SECRET_ACTIONS, {
|
|
120
|
+
error: `secretDetection.action must be one of: ${VALID_SECRET_ACTIONS.join(', ')}`,
|
|
121
|
+
})
|
|
122
|
+
.default('redact'),
|
|
123
|
+
entropyThreshold: z
|
|
124
|
+
.number({ error: 'secretDetection.entropyThreshold must be a number' })
|
|
125
|
+
.finite('secretDetection.entropyThreshold must be finite')
|
|
126
|
+
.positive('secretDetection.entropyThreshold must be a positive number')
|
|
127
|
+
.default(4.0),
|
|
128
|
+
allowOneTimeSend: z
|
|
129
|
+
.boolean({ error: 'secretDetection.allowOneTimeSend must be a boolean' })
|
|
130
|
+
.default(false),
|
|
131
|
+
blockIngress: z
|
|
132
|
+
.boolean({ error: 'secretDetection.blockIngress must be a boolean' })
|
|
133
|
+
.default(true),
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const PermissionsConfigSchema = z.object({
|
|
137
|
+
mode: z
|
|
138
|
+
.enum(VALID_PERMISSIONS_MODES, {
|
|
139
|
+
error: `permissions.mode must be one of: ${VALID_PERMISSIONS_MODES.join(', ')}`,
|
|
140
|
+
})
|
|
141
|
+
.default('workspace'),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export const AuditLogConfigSchema = z.object({
|
|
145
|
+
retentionDays: z
|
|
146
|
+
.number({ error: 'auditLog.retentionDays must be a number' })
|
|
147
|
+
.int('auditLog.retentionDays must be an integer')
|
|
148
|
+
.nonnegative('auditLog.retentionDays must be a non-negative integer')
|
|
149
|
+
.default(0),
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export const LogFileConfigSchema = z.object({
|
|
153
|
+
dir: z
|
|
154
|
+
.string({ error: 'logFile.dir must be a string' })
|
|
155
|
+
.optional(),
|
|
156
|
+
retentionDays: z
|
|
157
|
+
.number({ error: 'logFile.retentionDays must be a number' })
|
|
158
|
+
.int('logFile.retentionDays must be an integer')
|
|
159
|
+
.positive('logFile.retentionDays must be a positive integer')
|
|
160
|
+
.default(30),
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const ThinkingConfigSchema = z.object({
|
|
164
|
+
enabled: z
|
|
165
|
+
.boolean({ error: 'thinking.enabled must be a boolean' })
|
|
166
|
+
.default(false),
|
|
167
|
+
budgetTokens: z
|
|
168
|
+
.number({ error: 'thinking.budgetTokens must be a number' })
|
|
169
|
+
.int('thinking.budgetTokens must be an integer')
|
|
170
|
+
.positive('thinking.budgetTokens must be a positive integer')
|
|
171
|
+
.default(10000),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export const ContextWindowConfigSchema = z.object({
|
|
175
|
+
enabled: z
|
|
176
|
+
.boolean({ error: 'contextWindow.enabled must be a boolean' })
|
|
177
|
+
.default(true),
|
|
178
|
+
maxInputTokens: z
|
|
179
|
+
.number({ error: 'contextWindow.maxInputTokens must be a number' })
|
|
180
|
+
.int('contextWindow.maxInputTokens must be an integer')
|
|
181
|
+
.positive('contextWindow.maxInputTokens must be a positive integer')
|
|
182
|
+
.default(180000),
|
|
183
|
+
targetInputTokens: z
|
|
184
|
+
.number({ error: 'contextWindow.targetInputTokens must be a number' })
|
|
185
|
+
.int('contextWindow.targetInputTokens must be an integer')
|
|
186
|
+
.positive('contextWindow.targetInputTokens must be a positive integer')
|
|
187
|
+
.default(110000),
|
|
188
|
+
compactThreshold: z
|
|
189
|
+
.number({ error: 'contextWindow.compactThreshold must be a number' })
|
|
190
|
+
.finite('contextWindow.compactThreshold must be finite')
|
|
191
|
+
.gt(0, 'contextWindow.compactThreshold must be greater than 0')
|
|
192
|
+
.lte(1, 'contextWindow.compactThreshold must be less than or equal to 1')
|
|
193
|
+
.default(0.8),
|
|
194
|
+
preserveRecentUserTurns: z
|
|
195
|
+
.number({ error: 'contextWindow.preserveRecentUserTurns must be a number' })
|
|
196
|
+
.int('contextWindow.preserveRecentUserTurns must be an integer')
|
|
197
|
+
.positive('contextWindow.preserveRecentUserTurns must be a positive integer')
|
|
198
|
+
.default(8),
|
|
199
|
+
summaryMaxTokens: z
|
|
200
|
+
.number({ error: 'contextWindow.summaryMaxTokens must be a number' })
|
|
201
|
+
.int('contextWindow.summaryMaxTokens must be an integer')
|
|
202
|
+
.positive('contextWindow.summaryMaxTokens must be a positive integer')
|
|
203
|
+
.default(1200),
|
|
204
|
+
chunkTokens: z
|
|
205
|
+
.number({ error: 'contextWindow.chunkTokens must be a number' })
|
|
206
|
+
.int('contextWindow.chunkTokens must be an integer')
|
|
207
|
+
.positive('contextWindow.chunkTokens must be a positive integer')
|
|
208
|
+
.default(12000),
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
export const MemoryEmbeddingsConfigSchema = z.object({
|
|
212
|
+
required: z
|
|
213
|
+
.boolean({ error: 'memory.embeddings.required must be a boolean' })
|
|
214
|
+
.default(true),
|
|
215
|
+
provider: z
|
|
216
|
+
.enum(VALID_MEMORY_EMBEDDING_PROVIDERS, {
|
|
217
|
+
error: `memory.embeddings.provider must be one of: ${VALID_MEMORY_EMBEDDING_PROVIDERS.join(', ')}`,
|
|
218
|
+
})
|
|
219
|
+
.default('auto'),
|
|
220
|
+
localModel: z
|
|
221
|
+
.string({ error: 'memory.embeddings.localModel must be a string' })
|
|
222
|
+
.default('Xenova/bge-small-en-v1.5'),
|
|
223
|
+
openaiModel: z
|
|
224
|
+
.string({ error: 'memory.embeddings.openaiModel must be a string' })
|
|
225
|
+
.default('text-embedding-3-small'),
|
|
226
|
+
geminiModel: z
|
|
227
|
+
.string({ error: 'memory.embeddings.geminiModel must be a string' })
|
|
228
|
+
.default('gemini-embedding-001'),
|
|
229
|
+
ollamaModel: z
|
|
230
|
+
.string({ error: 'memory.embeddings.ollamaModel must be a string' })
|
|
231
|
+
.default('nomic-embed-text'),
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
const VALID_QDRANT_QUANTIZATION = ['scalar', 'none'] as const;
|
|
235
|
+
|
|
236
|
+
export const QdrantConfigSchema = z.object({
|
|
237
|
+
url: z
|
|
238
|
+
.string({ error: 'memory.qdrant.url must be a string' })
|
|
239
|
+
.default('http://127.0.0.1:6333'),
|
|
240
|
+
collection: z
|
|
241
|
+
.string({ error: 'memory.qdrant.collection must be a string' })
|
|
242
|
+
.default('memory'),
|
|
243
|
+
vectorSize: z
|
|
244
|
+
.number({ error: 'memory.qdrant.vectorSize must be a number' })
|
|
245
|
+
.int('memory.qdrant.vectorSize must be an integer')
|
|
246
|
+
.positive('memory.qdrant.vectorSize must be a positive integer')
|
|
247
|
+
.default(384),
|
|
248
|
+
onDisk: z
|
|
249
|
+
.boolean({ error: 'memory.qdrant.onDisk must be a boolean' })
|
|
250
|
+
.default(true),
|
|
251
|
+
quantization: z
|
|
252
|
+
.enum(VALID_QDRANT_QUANTIZATION, {
|
|
253
|
+
error: `memory.qdrant.quantization must be one of: ${VALID_QDRANT_QUANTIZATION.join(', ')}`,
|
|
254
|
+
})
|
|
255
|
+
.default('scalar'),
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
export const MemoryRerankingConfigSchema = z.object({
|
|
259
|
+
enabled: z
|
|
260
|
+
.boolean({ error: 'memory.retrieval.reranking.enabled must be a boolean' })
|
|
261
|
+
.default(true),
|
|
262
|
+
model: z
|
|
263
|
+
.string({ error: 'memory.retrieval.reranking.model must be a string' })
|
|
264
|
+
.default('claude-haiku-4-5-20251001'),
|
|
265
|
+
topK: z
|
|
266
|
+
.number({ error: 'memory.retrieval.reranking.topK must be a number' })
|
|
267
|
+
.int('memory.retrieval.reranking.topK must be an integer')
|
|
268
|
+
.positive('memory.retrieval.reranking.topK must be a positive integer')
|
|
269
|
+
.default(20),
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
export const MemoryDynamicBudgetConfigSchema = z.object({
|
|
273
|
+
enabled: z
|
|
274
|
+
.boolean({ error: 'memory.retrieval.dynamicBudget.enabled must be a boolean' })
|
|
275
|
+
.default(true),
|
|
276
|
+
minInjectTokens: z
|
|
277
|
+
.number({ error: 'memory.retrieval.dynamicBudget.minInjectTokens must be a number' })
|
|
278
|
+
.int('memory.retrieval.dynamicBudget.minInjectTokens must be an integer')
|
|
279
|
+
.positive('memory.retrieval.dynamicBudget.minInjectTokens must be a positive integer')
|
|
280
|
+
.default(1200),
|
|
281
|
+
maxInjectTokens: z
|
|
282
|
+
.number({ error: 'memory.retrieval.dynamicBudget.maxInjectTokens must be a number' })
|
|
283
|
+
.int('memory.retrieval.dynamicBudget.maxInjectTokens must be an integer')
|
|
284
|
+
.positive('memory.retrieval.dynamicBudget.maxInjectTokens must be a positive integer')
|
|
285
|
+
.default(10000),
|
|
286
|
+
targetHeadroomTokens: z
|
|
287
|
+
.number({ error: 'memory.retrieval.dynamicBudget.targetHeadroomTokens must be a number' })
|
|
288
|
+
.int('memory.retrieval.dynamicBudget.targetHeadroomTokens must be an integer')
|
|
289
|
+
.positive('memory.retrieval.dynamicBudget.targetHeadroomTokens must be a positive integer')
|
|
290
|
+
.default(10000),
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
export const MemoryEarlyTerminationConfigSchema = z.object({
|
|
294
|
+
enabled: z
|
|
295
|
+
.boolean({ error: 'memory.retrieval.earlyTermination.enabled must be a boolean' })
|
|
296
|
+
.default(true),
|
|
297
|
+
minCandidates: z
|
|
298
|
+
.number({ error: 'memory.retrieval.earlyTermination.minCandidates must be a number' })
|
|
299
|
+
.int('memory.retrieval.earlyTermination.minCandidates must be an integer')
|
|
300
|
+
.positive('memory.retrieval.earlyTermination.minCandidates must be a positive integer')
|
|
301
|
+
.default(20),
|
|
302
|
+
minHighConfidence: z
|
|
303
|
+
.number({ error: 'memory.retrieval.earlyTermination.minHighConfidence must be a number' })
|
|
304
|
+
.int('memory.retrieval.earlyTermination.minHighConfidence must be an integer')
|
|
305
|
+
.positive('memory.retrieval.earlyTermination.minHighConfidence must be a positive integer')
|
|
306
|
+
.default(10),
|
|
307
|
+
confidenceThreshold: z
|
|
308
|
+
.number({ error: 'memory.retrieval.earlyTermination.confidenceThreshold must be a number' })
|
|
309
|
+
.min(0, 'memory.retrieval.earlyTermination.confidenceThreshold must be >= 0')
|
|
310
|
+
.max(1, 'memory.retrieval.earlyTermination.confidenceThreshold must be <= 1')
|
|
311
|
+
.default(0.7),
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Per-kind freshness windows (in days). Items older than their window
|
|
316
|
+
* (based on lastSeenAt) are down-ranked unless recently reinforced.
|
|
317
|
+
* A value of 0 disables freshness decay for that kind.
|
|
318
|
+
*/
|
|
319
|
+
const MemoryFreshnessConfigSchema = z.object({
|
|
320
|
+
enabled: z
|
|
321
|
+
.boolean({ error: 'memory.retrieval.freshness.enabled must be a boolean' })
|
|
322
|
+
.default(true),
|
|
323
|
+
maxAgeDays: z.object({
|
|
324
|
+
fact: z
|
|
325
|
+
.number({ error: 'memory.retrieval.freshness.maxAgeDays.fact must be a number' })
|
|
326
|
+
.nonnegative('memory.retrieval.freshness.maxAgeDays.fact must be non-negative')
|
|
327
|
+
.default(0),
|
|
328
|
+
preference: z
|
|
329
|
+
.number({ error: 'memory.retrieval.freshness.maxAgeDays.preference must be a number' })
|
|
330
|
+
.nonnegative('memory.retrieval.freshness.maxAgeDays.preference must be non-negative')
|
|
331
|
+
.default(0),
|
|
332
|
+
behavior: z
|
|
333
|
+
.number({ error: 'memory.retrieval.freshness.maxAgeDays.behavior must be a number' })
|
|
334
|
+
.nonnegative('memory.retrieval.freshness.maxAgeDays.behavior must be non-negative')
|
|
335
|
+
.default(90),
|
|
336
|
+
event: z
|
|
337
|
+
.number({ error: 'memory.retrieval.freshness.maxAgeDays.event must be a number' })
|
|
338
|
+
.nonnegative('memory.retrieval.freshness.maxAgeDays.event must be non-negative')
|
|
339
|
+
.default(30),
|
|
340
|
+
opinion: z
|
|
341
|
+
.number({ error: 'memory.retrieval.freshness.maxAgeDays.opinion must be a number' })
|
|
342
|
+
.nonnegative('memory.retrieval.freshness.maxAgeDays.opinion must be non-negative')
|
|
343
|
+
.default(60),
|
|
344
|
+
}).default({
|
|
345
|
+
fact: 0,
|
|
346
|
+
preference: 0,
|
|
347
|
+
behavior: 90,
|
|
348
|
+
event: 30,
|
|
349
|
+
opinion: 60,
|
|
350
|
+
}),
|
|
351
|
+
staleDecay: z
|
|
352
|
+
.number({ error: 'memory.retrieval.freshness.staleDecay must be a number' })
|
|
353
|
+
.min(0, 'memory.retrieval.freshness.staleDecay must be >= 0')
|
|
354
|
+
.max(1, 'memory.retrieval.freshness.staleDecay must be <= 1')
|
|
355
|
+
.default(0.5),
|
|
356
|
+
reinforcementShieldDays: z
|
|
357
|
+
.number({ error: 'memory.retrieval.freshness.reinforcementShieldDays must be a number' })
|
|
358
|
+
.nonnegative('memory.retrieval.freshness.reinforcementShieldDays must be non-negative')
|
|
359
|
+
.default(7),
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
export const MemoryRetrievalConfigSchema = z.object({
|
|
363
|
+
lexicalTopK: z
|
|
364
|
+
.number({ error: 'memory.retrieval.lexicalTopK must be a number' })
|
|
365
|
+
.int('memory.retrieval.lexicalTopK must be an integer')
|
|
366
|
+
.positive('memory.retrieval.lexicalTopK must be a positive integer')
|
|
367
|
+
.default(80),
|
|
368
|
+
semanticTopK: z
|
|
369
|
+
.number({ error: 'memory.retrieval.semanticTopK must be a number' })
|
|
370
|
+
.int('memory.retrieval.semanticTopK must be an integer')
|
|
371
|
+
.positive('memory.retrieval.semanticTopK must be a positive integer')
|
|
372
|
+
.default(40),
|
|
373
|
+
maxInjectTokens: z
|
|
374
|
+
.number({ error: 'memory.retrieval.maxInjectTokens must be a number' })
|
|
375
|
+
.int('memory.retrieval.maxInjectTokens must be an integer')
|
|
376
|
+
.positive('memory.retrieval.maxInjectTokens must be a positive integer')
|
|
377
|
+
.default(10000),
|
|
378
|
+
injectionFormat: z
|
|
379
|
+
.enum(['markdown', 'structured_v1'], { error: 'memory.retrieval.injectionFormat must be "markdown" or "structured_v1"' })
|
|
380
|
+
.default('markdown'),
|
|
381
|
+
injectionStrategy: z
|
|
382
|
+
.enum(['prepend_user_block', 'separate_context_message'], {
|
|
383
|
+
error: 'memory.retrieval.injectionStrategy must be "prepend_user_block" or "separate_context_message"',
|
|
384
|
+
})
|
|
385
|
+
.default('prepend_user_block'),
|
|
386
|
+
reranking: MemoryRerankingConfigSchema.default({
|
|
387
|
+
enabled: true,
|
|
388
|
+
model: 'claude-haiku-4-5-20251001',
|
|
389
|
+
topK: 20,
|
|
390
|
+
}),
|
|
391
|
+
freshness: MemoryFreshnessConfigSchema.default({
|
|
392
|
+
enabled: true,
|
|
393
|
+
maxAgeDays: {
|
|
394
|
+
fact: 0,
|
|
395
|
+
preference: 0,
|
|
396
|
+
behavior: 90,
|
|
397
|
+
event: 30,
|
|
398
|
+
opinion: 60,
|
|
399
|
+
},
|
|
400
|
+
staleDecay: 0.5,
|
|
401
|
+
reinforcementShieldDays: 7,
|
|
402
|
+
}),
|
|
403
|
+
scopePolicy: z
|
|
404
|
+
.enum(['allow_global_fallback', 'strict'], {
|
|
405
|
+
error: 'memory.retrieval.scopePolicy must be "allow_global_fallback" or "strict"',
|
|
406
|
+
})
|
|
407
|
+
.default('allow_global_fallback'),
|
|
408
|
+
dynamicBudget: MemoryDynamicBudgetConfigSchema.default({
|
|
409
|
+
enabled: true,
|
|
410
|
+
minInjectTokens: 1200,
|
|
411
|
+
maxInjectTokens: 10000,
|
|
412
|
+
targetHeadroomTokens: 10000,
|
|
413
|
+
}),
|
|
414
|
+
earlyTermination: MemoryEarlyTerminationConfigSchema.default({
|
|
415
|
+
enabled: true,
|
|
416
|
+
minCandidates: 20,
|
|
417
|
+
minHighConfidence: 10,
|
|
418
|
+
confidenceThreshold: 0.7,
|
|
419
|
+
}),
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
export const MemorySegmentationConfigSchema = z.object({
|
|
423
|
+
targetTokens: z
|
|
424
|
+
.number({ error: 'memory.segmentation.targetTokens must be a number' })
|
|
425
|
+
.int('memory.segmentation.targetTokens must be an integer')
|
|
426
|
+
.positive('memory.segmentation.targetTokens must be a positive integer')
|
|
427
|
+
.default(450),
|
|
428
|
+
overlapTokens: z
|
|
429
|
+
.number({ error: 'memory.segmentation.overlapTokens must be a number' })
|
|
430
|
+
.int('memory.segmentation.overlapTokens must be an integer')
|
|
431
|
+
.nonnegative('memory.segmentation.overlapTokens must be a non-negative integer')
|
|
432
|
+
.default(60),
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
export const MemoryJobsConfigSchema = z.object({
|
|
436
|
+
workerConcurrency: z
|
|
437
|
+
.number({ error: 'memory.jobs.workerConcurrency must be a number' })
|
|
438
|
+
.int('memory.jobs.workerConcurrency must be an integer')
|
|
439
|
+
.positive('memory.jobs.workerConcurrency must be a positive integer')
|
|
440
|
+
.default(2),
|
|
441
|
+
batchSize: z
|
|
442
|
+
.number({ error: 'memory.jobs.batchSize must be a number' })
|
|
443
|
+
.int('memory.jobs.batchSize must be an integer')
|
|
444
|
+
.positive('memory.jobs.batchSize must be a positive integer')
|
|
445
|
+
.default(10),
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
export const MemoryRetentionConfigSchema = z.object({
|
|
449
|
+
keepRawForever: z
|
|
450
|
+
.boolean({ error: 'memory.retention.keepRawForever must be a boolean' })
|
|
451
|
+
.default(true),
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
export const MemoryCleanupConfigSchema = z.object({
|
|
455
|
+
enabled: z
|
|
456
|
+
.boolean({ error: 'memory.cleanup.enabled must be a boolean' })
|
|
457
|
+
.default(true),
|
|
458
|
+
enqueueIntervalMs: z
|
|
459
|
+
.number({ error: 'memory.cleanup.enqueueIntervalMs must be a number' })
|
|
460
|
+
.int('memory.cleanup.enqueueIntervalMs must be an integer')
|
|
461
|
+
.positive('memory.cleanup.enqueueIntervalMs must be a positive integer')
|
|
462
|
+
.default(6 * 60 * 60 * 1000),
|
|
463
|
+
resolvedConflictRetentionMs: z
|
|
464
|
+
.number({ error: 'memory.cleanup.resolvedConflictRetentionMs must be a number' })
|
|
465
|
+
.int('memory.cleanup.resolvedConflictRetentionMs must be an integer')
|
|
466
|
+
.positive('memory.cleanup.resolvedConflictRetentionMs must be a positive integer')
|
|
467
|
+
.default(30 * 24 * 60 * 60 * 1000),
|
|
468
|
+
supersededItemRetentionMs: z
|
|
469
|
+
.number({ error: 'memory.cleanup.supersededItemRetentionMs must be a number' })
|
|
470
|
+
.int('memory.cleanup.supersededItemRetentionMs must be an integer')
|
|
471
|
+
.positive('memory.cleanup.supersededItemRetentionMs must be a positive integer')
|
|
472
|
+
.default(30 * 24 * 60 * 60 * 1000),
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
export const MemoryExtractionConfigSchema = z.object({
|
|
476
|
+
useLLM: z
|
|
477
|
+
.boolean({ error: 'memory.extraction.useLLM must be a boolean' })
|
|
478
|
+
.default(true),
|
|
479
|
+
model: z
|
|
480
|
+
.string({ error: 'memory.extraction.model must be a string' })
|
|
481
|
+
.default('claude-haiku-4-5-20251001'),
|
|
482
|
+
extractFromAssistant: z
|
|
483
|
+
.boolean({ error: 'memory.extraction.extractFromAssistant must be a boolean' })
|
|
484
|
+
.default(true),
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
export const MemoryEntityConfigSchema = z.object({
|
|
488
|
+
enabled: z
|
|
489
|
+
.boolean({ error: 'memory.entity.enabled must be a boolean' })
|
|
490
|
+
.default(true),
|
|
491
|
+
model: z
|
|
492
|
+
.string({ error: 'memory.entity.model must be a string' })
|
|
493
|
+
.default('claude-haiku-4-5-20251001'),
|
|
494
|
+
extractRelations: z.object({
|
|
495
|
+
enabled: z
|
|
496
|
+
.boolean({ error: 'memory.entity.extractRelations.enabled must be a boolean' })
|
|
497
|
+
.default(true),
|
|
498
|
+
backfillBatchSize: z
|
|
499
|
+
.number({ error: 'memory.entity.extractRelations.backfillBatchSize must be a number' })
|
|
500
|
+
.int('memory.entity.extractRelations.backfillBatchSize must be an integer')
|
|
501
|
+
.positive('memory.entity.extractRelations.backfillBatchSize must be a positive integer')
|
|
502
|
+
.default(200),
|
|
503
|
+
}).default({
|
|
504
|
+
enabled: true,
|
|
505
|
+
backfillBatchSize: 200,
|
|
506
|
+
}),
|
|
507
|
+
relationRetrieval: z.object({
|
|
508
|
+
enabled: z
|
|
509
|
+
.boolean({ error: 'memory.entity.relationRetrieval.enabled must be a boolean' })
|
|
510
|
+
.default(true),
|
|
511
|
+
maxSeedEntities: z
|
|
512
|
+
.number({ error: 'memory.entity.relationRetrieval.maxSeedEntities must be a number' })
|
|
513
|
+
.int('memory.entity.relationRetrieval.maxSeedEntities must be an integer')
|
|
514
|
+
.positive('memory.entity.relationRetrieval.maxSeedEntities must be a positive integer')
|
|
515
|
+
.default(8),
|
|
516
|
+
maxNeighborEntities: z
|
|
517
|
+
.number({ error: 'memory.entity.relationRetrieval.maxNeighborEntities must be a number' })
|
|
518
|
+
.int('memory.entity.relationRetrieval.maxNeighborEntities must be an integer')
|
|
519
|
+
.positive('memory.entity.relationRetrieval.maxNeighborEntities must be a positive integer')
|
|
520
|
+
.default(20),
|
|
521
|
+
maxEdges: z
|
|
522
|
+
.number({ error: 'memory.entity.relationRetrieval.maxEdges must be a number' })
|
|
523
|
+
.int('memory.entity.relationRetrieval.maxEdges must be an integer')
|
|
524
|
+
.positive('memory.entity.relationRetrieval.maxEdges must be a positive integer')
|
|
525
|
+
.default(40),
|
|
526
|
+
neighborScoreMultiplier: z
|
|
527
|
+
.number({ error: 'memory.entity.relationRetrieval.neighborScoreMultiplier must be a number' })
|
|
528
|
+
.gt(0, 'memory.entity.relationRetrieval.neighborScoreMultiplier must be > 0')
|
|
529
|
+
.lte(1, 'memory.entity.relationRetrieval.neighborScoreMultiplier must be <= 1')
|
|
530
|
+
.default(0.7),
|
|
531
|
+
maxDepth: z
|
|
532
|
+
.number({ error: 'memory.entity.relationRetrieval.maxDepth must be a number' })
|
|
533
|
+
.int('memory.entity.relationRetrieval.maxDepth must be an integer')
|
|
534
|
+
.positive('memory.entity.relationRetrieval.maxDepth must be a positive integer')
|
|
535
|
+
.default(3),
|
|
536
|
+
}).default({
|
|
537
|
+
enabled: true,
|
|
538
|
+
maxSeedEntities: 8,
|
|
539
|
+
maxNeighborEntities: 20,
|
|
540
|
+
maxEdges: 40,
|
|
541
|
+
neighborScoreMultiplier: 0.7,
|
|
542
|
+
maxDepth: 3,
|
|
543
|
+
}),
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
export const MemoryConflictsConfigSchema = z.object({
|
|
547
|
+
enabled: z
|
|
548
|
+
.boolean({ error: 'memory.conflicts.enabled must be a boolean' })
|
|
549
|
+
.default(true),
|
|
550
|
+
gateMode: z
|
|
551
|
+
.enum(['soft'], { error: 'memory.conflicts.gateMode must be "soft"' })
|
|
552
|
+
.default('soft'),
|
|
553
|
+
reaskCooldownTurns: z
|
|
554
|
+
.number({ error: 'memory.conflicts.reaskCooldownTurns must be a number' })
|
|
555
|
+
.int('memory.conflicts.reaskCooldownTurns must be an integer')
|
|
556
|
+
.positive('memory.conflicts.reaskCooldownTurns must be a positive integer')
|
|
557
|
+
.default(3),
|
|
558
|
+
resolverLlmTimeoutMs: z
|
|
559
|
+
.number({ error: 'memory.conflicts.resolverLlmTimeoutMs must be a number' })
|
|
560
|
+
.int('memory.conflicts.resolverLlmTimeoutMs must be an integer')
|
|
561
|
+
.positive('memory.conflicts.resolverLlmTimeoutMs must be a positive integer')
|
|
562
|
+
.default(12000),
|
|
563
|
+
relevanceThreshold: z
|
|
564
|
+
.number({ error: 'memory.conflicts.relevanceThreshold must be a number' })
|
|
565
|
+
.min(0, 'memory.conflicts.relevanceThreshold must be >= 0')
|
|
566
|
+
.max(1, 'memory.conflicts.relevanceThreshold must be <= 1')
|
|
567
|
+
.default(0.3),
|
|
568
|
+
askOnIrrelevantTurns: z
|
|
569
|
+
.boolean({ error: 'memory.conflicts.askOnIrrelevantTurns must be a boolean' })
|
|
570
|
+
.default(false),
|
|
571
|
+
conflictableKinds: z
|
|
572
|
+
.array(
|
|
573
|
+
z.enum(VALID_MEMORY_ITEM_KINDS, {
|
|
574
|
+
error: `memory.conflicts.conflictableKinds entries must be one of: ${VALID_MEMORY_ITEM_KINDS.join(', ')}`,
|
|
575
|
+
}),
|
|
576
|
+
)
|
|
577
|
+
.nonempty({ message: 'memory.conflicts.conflictableKinds must not be empty' })
|
|
578
|
+
.default([...DEFAULT_CONFLICTABLE_KINDS]),
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
export const MemoryProfileConfigSchema = z.object({
|
|
582
|
+
enabled: z
|
|
583
|
+
.boolean({ error: 'memory.profile.enabled must be a boolean' })
|
|
584
|
+
.default(true),
|
|
585
|
+
maxInjectTokens: z
|
|
586
|
+
.number({ error: 'memory.profile.maxInjectTokens must be a number' })
|
|
587
|
+
.int('memory.profile.maxInjectTokens must be an integer')
|
|
588
|
+
.positive('memory.profile.maxInjectTokens must be a positive integer')
|
|
589
|
+
.default(800),
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
export const MemorySummarizationConfigSchema = z.object({
|
|
593
|
+
useLLM: z
|
|
594
|
+
.boolean({ error: 'memory.summarization.useLLM must be a boolean' })
|
|
595
|
+
.default(true),
|
|
596
|
+
model: z
|
|
597
|
+
.string({ error: 'memory.summarization.model must be a string' })
|
|
598
|
+
.default('claude-haiku-4-5-20251001'),
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
export const MemoryConfigSchema = z.object({
|
|
602
|
+
enabled: z
|
|
603
|
+
.boolean({ error: 'memory.enabled must be a boolean' })
|
|
604
|
+
.default(true),
|
|
605
|
+
embeddings: MemoryEmbeddingsConfigSchema.default({
|
|
606
|
+
required: true,
|
|
607
|
+
provider: 'auto',
|
|
608
|
+
localModel: 'Xenova/bge-small-en-v1.5',
|
|
609
|
+
openaiModel: 'text-embedding-3-small',
|
|
610
|
+
geminiModel: 'gemini-embedding-001',
|
|
611
|
+
ollamaModel: 'nomic-embed-text',
|
|
612
|
+
}),
|
|
613
|
+
qdrant: QdrantConfigSchema.default({
|
|
614
|
+
url: 'http://127.0.0.1:6333',
|
|
615
|
+
collection: 'memory',
|
|
616
|
+
vectorSize: 384,
|
|
617
|
+
onDisk: true,
|
|
618
|
+
quantization: 'scalar',
|
|
619
|
+
}),
|
|
620
|
+
retrieval: MemoryRetrievalConfigSchema.default({
|
|
621
|
+
lexicalTopK: 80,
|
|
622
|
+
semanticTopK: 40,
|
|
623
|
+
maxInjectTokens: 10000,
|
|
624
|
+
injectionFormat: 'markdown',
|
|
625
|
+
injectionStrategy: 'prepend_user_block',
|
|
626
|
+
reranking: {
|
|
627
|
+
enabled: true,
|
|
628
|
+
model: 'claude-haiku-4-5-20251001',
|
|
629
|
+
topK: 20,
|
|
630
|
+
},
|
|
631
|
+
freshness: {
|
|
632
|
+
enabled: true,
|
|
633
|
+
maxAgeDays: { fact: 0, preference: 0, behavior: 90, event: 30, opinion: 60 },
|
|
634
|
+
staleDecay: 0.5,
|
|
635
|
+
reinforcementShieldDays: 7,
|
|
636
|
+
},
|
|
637
|
+
scopePolicy: 'allow_global_fallback',
|
|
638
|
+
dynamicBudget: {
|
|
639
|
+
enabled: true,
|
|
640
|
+
minInjectTokens: 1200,
|
|
641
|
+
maxInjectTokens: 10000,
|
|
642
|
+
targetHeadroomTokens: 10000,
|
|
643
|
+
},
|
|
644
|
+
earlyTermination: {
|
|
645
|
+
enabled: true,
|
|
646
|
+
minCandidates: 20,
|
|
647
|
+
minHighConfidence: 10,
|
|
648
|
+
confidenceThreshold: 0.7,
|
|
649
|
+
},
|
|
650
|
+
}),
|
|
651
|
+
segmentation: MemorySegmentationConfigSchema.default({
|
|
652
|
+
targetTokens: 450,
|
|
653
|
+
overlapTokens: 60,
|
|
654
|
+
}),
|
|
655
|
+
jobs: MemoryJobsConfigSchema.default({
|
|
656
|
+
workerConcurrency: 2,
|
|
657
|
+
batchSize: 10,
|
|
658
|
+
}),
|
|
659
|
+
retention: MemoryRetentionConfigSchema.default({
|
|
660
|
+
keepRawForever: true,
|
|
661
|
+
}),
|
|
662
|
+
cleanup: MemoryCleanupConfigSchema.default({
|
|
663
|
+
enabled: true,
|
|
664
|
+
enqueueIntervalMs: 6 * 60 * 60 * 1000,
|
|
665
|
+
resolvedConflictRetentionMs: 30 * 24 * 60 * 60 * 1000,
|
|
666
|
+
supersededItemRetentionMs: 30 * 24 * 60 * 60 * 1000,
|
|
667
|
+
}),
|
|
668
|
+
extraction: MemoryExtractionConfigSchema.default({
|
|
669
|
+
useLLM: true,
|
|
670
|
+
model: 'claude-haiku-4-5-20251001',
|
|
671
|
+
extractFromAssistant: true,
|
|
672
|
+
}),
|
|
673
|
+
summarization: MemorySummarizationConfigSchema.default({
|
|
674
|
+
useLLM: true,
|
|
675
|
+
model: 'claude-haiku-4-5-20251001',
|
|
676
|
+
}),
|
|
677
|
+
entity: MemoryEntityConfigSchema.default({
|
|
678
|
+
enabled: true,
|
|
679
|
+
model: 'claude-haiku-4-5-20251001',
|
|
680
|
+
extractRelations: {
|
|
681
|
+
enabled: true,
|
|
682
|
+
backfillBatchSize: 200,
|
|
683
|
+
},
|
|
684
|
+
relationRetrieval: {
|
|
685
|
+
enabled: true,
|
|
686
|
+
maxSeedEntities: 8,
|
|
687
|
+
maxNeighborEntities: 20,
|
|
688
|
+
maxEdges: 40,
|
|
689
|
+
neighborScoreMultiplier: 0.7,
|
|
690
|
+
maxDepth: 3,
|
|
691
|
+
},
|
|
692
|
+
}),
|
|
693
|
+
conflicts: MemoryConflictsConfigSchema.default({
|
|
694
|
+
enabled: true,
|
|
695
|
+
gateMode: 'soft',
|
|
696
|
+
reaskCooldownTurns: 3,
|
|
697
|
+
resolverLlmTimeoutMs: 12000,
|
|
698
|
+
relevanceThreshold: 0.3,
|
|
699
|
+
askOnIrrelevantTurns: false,
|
|
700
|
+
conflictableKinds: ['preference', 'profile', 'constraint', 'instruction', 'style'],
|
|
701
|
+
}),
|
|
702
|
+
profile: MemoryProfileConfigSchema.default({
|
|
703
|
+
enabled: true,
|
|
704
|
+
maxInjectTokens: 800,
|
|
705
|
+
}),
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
export const ModelPricingOverrideSchema = z.object({
|
|
709
|
+
provider: z.string({ error: 'pricingOverrides[].provider must be a string' }),
|
|
710
|
+
modelPattern: z.string({ error: 'pricingOverrides[].modelPattern must be a string' }),
|
|
711
|
+
inputPer1M: z
|
|
712
|
+
.number({ error: 'pricingOverrides[].inputPer1M must be a number' })
|
|
713
|
+
.nonnegative('pricingOverrides[].inputPer1M must be a non-negative number'),
|
|
714
|
+
outputPer1M: z
|
|
715
|
+
.number({ error: 'pricingOverrides[].outputPer1M must be a number' })
|
|
716
|
+
.nonnegative('pricingOverrides[].outputPer1M must be a non-negative number'),
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
export const SkillEntryConfigSchema = z.object({
|
|
720
|
+
enabled: z.boolean({ error: 'skills.entries[].enabled must be a boolean' }).default(true),
|
|
721
|
+
apiKey: z.string({ error: 'skills.entries[].apiKey must be a string' }).optional(),
|
|
722
|
+
env: z.record(z.string(), z.string({ error: 'skills.entries[].env values must be strings' })).optional(),
|
|
723
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
export const SkillsLoadConfigSchema = z.object({
|
|
727
|
+
extraDirs: z.array(z.string({ error: 'skills.load.extraDirs values must be strings' })).default([]),
|
|
728
|
+
watch: z.boolean({ error: 'skills.load.watch must be a boolean' }).default(true),
|
|
729
|
+
watchDebounceMs: z.number({ error: 'skills.load.watchDebounceMs must be a number' }).int().positive().default(250),
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
export const SkillsInstallConfigSchema = z.object({
|
|
733
|
+
nodeManager: z.enum(['npm', 'pnpm', 'yarn', 'bun'], {
|
|
734
|
+
error: 'skills.install.nodeManager must be one of: npm, pnpm, yarn, bun',
|
|
735
|
+
}).default('npm'),
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
export const WorkspaceGitConfigSchema = z.object({
|
|
739
|
+
turnCommitMaxWaitMs: z
|
|
740
|
+
.number({ error: 'workspaceGit.turnCommitMaxWaitMs must be a number' })
|
|
741
|
+
.int('workspaceGit.turnCommitMaxWaitMs must be an integer')
|
|
742
|
+
.positive('workspaceGit.turnCommitMaxWaitMs must be a positive integer')
|
|
743
|
+
.default(4000),
|
|
744
|
+
failureBackoffBaseMs: z
|
|
745
|
+
.number({ error: 'workspaceGit.failureBackoffBaseMs must be a number' })
|
|
746
|
+
.int('workspaceGit.failureBackoffBaseMs must be an integer')
|
|
747
|
+
.positive('workspaceGit.failureBackoffBaseMs must be a positive integer')
|
|
748
|
+
.default(2000),
|
|
749
|
+
failureBackoffMaxMs: z
|
|
750
|
+
.number({ error: 'workspaceGit.failureBackoffMaxMs must be a number' })
|
|
751
|
+
.int('workspaceGit.failureBackoffMaxMs must be an integer')
|
|
752
|
+
.positive('workspaceGit.failureBackoffMaxMs must be a positive integer')
|
|
753
|
+
.default(60000),
|
|
754
|
+
interactiveGitTimeoutMs: z
|
|
755
|
+
.number({ error: 'workspaceGit.interactiveGitTimeoutMs must be a number' })
|
|
756
|
+
.int('workspaceGit.interactiveGitTimeoutMs must be an integer')
|
|
757
|
+
.positive('workspaceGit.interactiveGitTimeoutMs must be a positive integer')
|
|
758
|
+
.default(10000),
|
|
759
|
+
enrichmentQueueSize: z
|
|
760
|
+
.number({ error: 'workspaceGit.enrichmentQueueSize must be a number' })
|
|
761
|
+
.int('workspaceGit.enrichmentQueueSize must be an integer')
|
|
762
|
+
.positive('workspaceGit.enrichmentQueueSize must be a positive integer')
|
|
763
|
+
.default(50),
|
|
764
|
+
enrichmentConcurrency: z
|
|
765
|
+
.number({ error: 'workspaceGit.enrichmentConcurrency must be a number' })
|
|
766
|
+
.int('workspaceGit.enrichmentConcurrency must be an integer')
|
|
767
|
+
.positive('workspaceGit.enrichmentConcurrency must be a positive integer')
|
|
768
|
+
.default(1),
|
|
769
|
+
enrichmentJobTimeoutMs: z
|
|
770
|
+
.number({ error: 'workspaceGit.enrichmentJobTimeoutMs must be a number' })
|
|
771
|
+
.int('workspaceGit.enrichmentJobTimeoutMs must be an integer')
|
|
772
|
+
.positive('workspaceGit.enrichmentJobTimeoutMs must be a positive integer')
|
|
773
|
+
.default(30000),
|
|
774
|
+
enrichmentMaxRetries: z
|
|
775
|
+
.number({ error: 'workspaceGit.enrichmentMaxRetries must be a number' })
|
|
776
|
+
.int('workspaceGit.enrichmentMaxRetries must be an integer')
|
|
777
|
+
.nonnegative('workspaceGit.enrichmentMaxRetries must be non-negative')
|
|
778
|
+
.default(2),
|
|
779
|
+
commitMessageLLM: z.object({
|
|
780
|
+
enabled: z.boolean({ error: 'workspaceGit.commitMessageLLM.enabled must be a boolean' }).default(false),
|
|
781
|
+
useConfiguredProvider: z.boolean({ error: 'workspaceGit.commitMessageLLM.useConfiguredProvider must be a boolean' }).default(true),
|
|
782
|
+
providerFastModelOverrides: z.record(z.string(), z.string()).default({}),
|
|
783
|
+
timeoutMs: z.number({ error: 'workspaceGit.commitMessageLLM.timeoutMs must be a number' })
|
|
784
|
+
.int('workspaceGit.commitMessageLLM.timeoutMs must be an integer')
|
|
785
|
+
.positive('workspaceGit.commitMessageLLM.timeoutMs must be a positive integer')
|
|
786
|
+
.default(600),
|
|
787
|
+
maxTokens: z.number({ error: 'workspaceGit.commitMessageLLM.maxTokens must be a number' })
|
|
788
|
+
.int('workspaceGit.commitMessageLLM.maxTokens must be an integer')
|
|
789
|
+
.positive('workspaceGit.commitMessageLLM.maxTokens must be a positive integer')
|
|
790
|
+
.default(120),
|
|
791
|
+
temperature: z.number({ error: 'workspaceGit.commitMessageLLM.temperature must be a number' })
|
|
792
|
+
.min(0, 'workspaceGit.commitMessageLLM.temperature must be >= 0')
|
|
793
|
+
.max(2, 'workspaceGit.commitMessageLLM.temperature must be <= 2')
|
|
794
|
+
.default(0.2),
|
|
795
|
+
maxFilesInPrompt: z.number({ error: 'workspaceGit.commitMessageLLM.maxFilesInPrompt must be a number' })
|
|
796
|
+
.int('workspaceGit.commitMessageLLM.maxFilesInPrompt must be an integer')
|
|
797
|
+
.positive('workspaceGit.commitMessageLLM.maxFilesInPrompt must be a positive integer')
|
|
798
|
+
.default(30),
|
|
799
|
+
maxDiffBytes: z.number({ error: 'workspaceGit.commitMessageLLM.maxDiffBytes must be a number' })
|
|
800
|
+
.int('workspaceGit.commitMessageLLM.maxDiffBytes must be an integer')
|
|
801
|
+
.positive('workspaceGit.commitMessageLLM.maxDiffBytes must be a positive integer')
|
|
802
|
+
.default(12000),
|
|
803
|
+
minRemainingTurnBudgetMs: z.number({ error: 'workspaceGit.commitMessageLLM.minRemainingTurnBudgetMs must be a number' })
|
|
804
|
+
.int('workspaceGit.commitMessageLLM.minRemainingTurnBudgetMs must be an integer')
|
|
805
|
+
.nonnegative('workspaceGit.commitMessageLLM.minRemainingTurnBudgetMs must be non-negative')
|
|
806
|
+
.default(1000),
|
|
807
|
+
breaker: z.object({
|
|
808
|
+
openAfterFailures: z.number({ error: 'workspaceGit.commitMessageLLM.breaker.openAfterFailures must be a number' })
|
|
809
|
+
.int().positive().default(3),
|
|
810
|
+
backoffBaseMs: z.number({ error: 'workspaceGit.commitMessageLLM.breaker.backoffBaseMs must be a number' })
|
|
811
|
+
.int().positive().default(2000),
|
|
812
|
+
backoffMaxMs: z.number({ error: 'workspaceGit.commitMessageLLM.breaker.backoffMaxMs must be a number' })
|
|
813
|
+
.int().positive().default(60000),
|
|
814
|
+
}).default({ openAfterFailures: 3, backoffBaseMs: 2000, backoffMaxMs: 60000 }),
|
|
815
|
+
}).default({
|
|
816
|
+
enabled: false,
|
|
817
|
+
useConfiguredProvider: true,
|
|
818
|
+
providerFastModelOverrides: {},
|
|
819
|
+
timeoutMs: 600,
|
|
820
|
+
maxTokens: 120,
|
|
821
|
+
temperature: 0.2,
|
|
822
|
+
maxFilesInPrompt: 30,
|
|
823
|
+
maxDiffBytes: 12000,
|
|
824
|
+
minRemainingTurnBudgetMs: 1000,
|
|
825
|
+
breaker: { openAfterFailures: 3, backoffBaseMs: 2000, backoffMaxMs: 60000 },
|
|
826
|
+
}),
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
export const AgentHeartbeatConfigSchema = z.object({
|
|
830
|
+
enabled: z
|
|
831
|
+
.boolean({ error: 'agentHeartbeat.enabled must be a boolean' })
|
|
832
|
+
.default(false),
|
|
833
|
+
intervalMs: z
|
|
834
|
+
.number({ error: 'agentHeartbeat.intervalMs must be a number' })
|
|
835
|
+
.int('agentHeartbeat.intervalMs must be an integer')
|
|
836
|
+
.positive('agentHeartbeat.intervalMs must be a positive integer')
|
|
837
|
+
.default(3_600_000),
|
|
838
|
+
activeHoursStart: z
|
|
839
|
+
.number({ error: 'agentHeartbeat.activeHoursStart must be a number' })
|
|
840
|
+
.int('agentHeartbeat.activeHoursStart must be an integer')
|
|
841
|
+
.min(0, 'agentHeartbeat.activeHoursStart must be >= 0')
|
|
842
|
+
.max(23, 'agentHeartbeat.activeHoursStart must be <= 23')
|
|
843
|
+
.optional(),
|
|
844
|
+
activeHoursEnd: z
|
|
845
|
+
.number({ error: 'agentHeartbeat.activeHoursEnd must be a number' })
|
|
846
|
+
.int('agentHeartbeat.activeHoursEnd must be an integer')
|
|
847
|
+
.min(0, 'agentHeartbeat.activeHoursEnd must be >= 0')
|
|
848
|
+
.max(23, 'agentHeartbeat.activeHoursEnd must be <= 23')
|
|
849
|
+
.optional(),
|
|
850
|
+
}).superRefine((config, ctx) => {
|
|
851
|
+
const hasStart = config.activeHoursStart != null;
|
|
852
|
+
const hasEnd = config.activeHoursEnd != null;
|
|
853
|
+
if (hasStart !== hasEnd) {
|
|
854
|
+
ctx.addIssue({
|
|
855
|
+
code: z.ZodIssueCode.custom,
|
|
856
|
+
path: [hasStart ? 'activeHoursEnd' : 'activeHoursStart'],
|
|
857
|
+
message: 'agentHeartbeat.activeHoursStart and agentHeartbeat.activeHoursEnd must both be set or both be omitted',
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
if (hasStart && hasEnd && config.activeHoursStart === config.activeHoursEnd) {
|
|
861
|
+
ctx.addIssue({
|
|
862
|
+
code: z.ZodIssueCode.custom,
|
|
863
|
+
path: ['activeHoursEnd'],
|
|
864
|
+
message: 'agentHeartbeat.activeHoursStart and agentHeartbeat.activeHoursEnd must not be equal (would create an empty window)',
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
export const SwarmConfigSchema = z.object({
|
|
870
|
+
enabled: z
|
|
871
|
+
.boolean({ error: 'swarm.enabled must be a boolean' })
|
|
872
|
+
.default(true),
|
|
873
|
+
maxWorkers: z
|
|
874
|
+
.number({ error: 'swarm.maxWorkers must be a number' })
|
|
875
|
+
.int('swarm.maxWorkers must be an integer')
|
|
876
|
+
.positive('swarm.maxWorkers must be a positive integer')
|
|
877
|
+
.max(6, 'swarm.maxWorkers must be at most 6')
|
|
878
|
+
.default(3),
|
|
879
|
+
maxTasks: z
|
|
880
|
+
.number({ error: 'swarm.maxTasks must be a number' })
|
|
881
|
+
.int('swarm.maxTasks must be an integer')
|
|
882
|
+
.positive('swarm.maxTasks must be a positive integer')
|
|
883
|
+
.max(20, 'swarm.maxTasks must be at most 20')
|
|
884
|
+
.default(8),
|
|
885
|
+
maxRetriesPerTask: z
|
|
886
|
+
.number({ error: 'swarm.maxRetriesPerTask must be a number' })
|
|
887
|
+
.int('swarm.maxRetriesPerTask must be an integer')
|
|
888
|
+
.nonnegative('swarm.maxRetriesPerTask must be a non-negative integer')
|
|
889
|
+
.max(3, 'swarm.maxRetriesPerTask must be at most 3')
|
|
890
|
+
.default(1),
|
|
891
|
+
workerTimeoutSec: z
|
|
892
|
+
.number({ error: 'swarm.workerTimeoutSec must be a number' })
|
|
893
|
+
.int('swarm.workerTimeoutSec must be an integer')
|
|
894
|
+
.positive('swarm.workerTimeoutSec must be a positive integer')
|
|
895
|
+
.default(900),
|
|
896
|
+
plannerModel: z
|
|
897
|
+
.string({ error: 'swarm.plannerModel must be a string' })
|
|
898
|
+
.default('claude-haiku-4-5-20251001'),
|
|
899
|
+
synthesizerModel: z
|
|
900
|
+
.string({ error: 'swarm.synthesizerModel must be a string' })
|
|
901
|
+
.default('claude-sonnet-4-6'),
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
export const CallsDisclosureConfigSchema = z.object({
|
|
905
|
+
enabled: z
|
|
906
|
+
.boolean({ error: 'calls.disclosure.enabled must be a boolean' })
|
|
907
|
+
.default(true),
|
|
908
|
+
text: z
|
|
909
|
+
.string({ error: 'calls.disclosure.text must be a string' })
|
|
910
|
+
.default('At the very beginning of the call, disclose that you are an AI assistant calling on behalf of the user.'),
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
export const CallsSafetyConfigSchema = z.object({
|
|
914
|
+
denyCategories: z
|
|
915
|
+
.array(z.string({ error: 'calls.safety.denyCategories values must be strings' }))
|
|
916
|
+
.default([]),
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
export const CallsElevenLabsConfigSchema = z.object({
|
|
920
|
+
voiceId: z
|
|
921
|
+
.string({ error: 'calls.voice.elevenlabs.voiceId must be a string' })
|
|
922
|
+
.default(''),
|
|
923
|
+
voiceModelId: z
|
|
924
|
+
.string({ error: 'calls.voice.elevenlabs.voiceModelId must be a string' })
|
|
925
|
+
.default(''),
|
|
926
|
+
speed: z
|
|
927
|
+
.number({ error: 'calls.voice.elevenlabs.speed must be a number' })
|
|
928
|
+
.min(0.7, 'calls.voice.elevenlabs.speed must be >= 0.7')
|
|
929
|
+
.max(1.2, 'calls.voice.elevenlabs.speed must be <= 1.2')
|
|
930
|
+
.default(1.0),
|
|
931
|
+
stability: z
|
|
932
|
+
.number({ error: 'calls.voice.elevenlabs.stability must be a number' })
|
|
933
|
+
.min(0, 'calls.voice.elevenlabs.stability must be >= 0')
|
|
934
|
+
.max(1, 'calls.voice.elevenlabs.stability must be <= 1')
|
|
935
|
+
.default(0.5),
|
|
936
|
+
similarityBoost: z
|
|
937
|
+
.number({ error: 'calls.voice.elevenlabs.similarityBoost must be a number' })
|
|
938
|
+
.min(0, 'calls.voice.elevenlabs.similarityBoost must be >= 0')
|
|
939
|
+
.max(1, 'calls.voice.elevenlabs.similarityBoost must be <= 1')
|
|
940
|
+
.default(0.75),
|
|
941
|
+
useSpeakerBoost: z
|
|
942
|
+
.boolean({ error: 'calls.voice.elevenlabs.useSpeakerBoost must be a boolean' })
|
|
943
|
+
.default(true),
|
|
944
|
+
agentId: z
|
|
945
|
+
.string({ error: 'calls.voice.elevenlabs.agentId must be a string' })
|
|
946
|
+
.default(''),
|
|
947
|
+
apiBaseUrl: z
|
|
948
|
+
.string({ error: 'calls.voice.elevenlabs.apiBaseUrl must be a string' })
|
|
949
|
+
.default('https://api.elevenlabs.io'),
|
|
950
|
+
registerCallTimeoutMs: z
|
|
951
|
+
.number({ error: 'calls.voice.elevenlabs.registerCallTimeoutMs must be a number' })
|
|
952
|
+
.int('calls.voice.elevenlabs.registerCallTimeoutMs must be an integer')
|
|
953
|
+
.min(1000, 'calls.voice.elevenlabs.registerCallTimeoutMs must be >= 1000')
|
|
954
|
+
.max(15000, 'calls.voice.elevenlabs.registerCallTimeoutMs must be <= 15000')
|
|
955
|
+
.default(5000),
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
export const CallsVoiceConfigSchema = z.object({
|
|
959
|
+
mode: z
|
|
960
|
+
.enum(VALID_CALL_VOICE_MODES, {
|
|
961
|
+
error: `calls.voice.mode must be one of: ${VALID_CALL_VOICE_MODES.join(', ')}`,
|
|
962
|
+
})
|
|
963
|
+
.default('twilio_standard'),
|
|
964
|
+
language: z
|
|
965
|
+
.string({ error: 'calls.voice.language must be a string' })
|
|
966
|
+
.default('en-US'),
|
|
967
|
+
transcriptionProvider: z
|
|
968
|
+
.enum(VALID_CALL_TRANSCRIPTION_PROVIDERS, {
|
|
969
|
+
error: `calls.voice.transcriptionProvider must be one of: ${VALID_CALL_TRANSCRIPTION_PROVIDERS.join(', ')}`,
|
|
970
|
+
})
|
|
971
|
+
.default('Deepgram'),
|
|
972
|
+
fallbackToStandardOnError: z
|
|
973
|
+
.boolean({ error: 'calls.voice.fallbackToStandardOnError must be a boolean' })
|
|
974
|
+
.default(true),
|
|
975
|
+
elevenlabs: CallsElevenLabsConfigSchema.default({
|
|
976
|
+
voiceId: '',
|
|
977
|
+
voiceModelId: '',
|
|
978
|
+
speed: 1.0,
|
|
979
|
+
stability: 0.5,
|
|
980
|
+
similarityBoost: 0.75,
|
|
981
|
+
useSpeakerBoost: true,
|
|
982
|
+
agentId: '',
|
|
983
|
+
apiBaseUrl: 'https://api.elevenlabs.io',
|
|
984
|
+
registerCallTimeoutMs: 5000,
|
|
985
|
+
}),
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
export const CallerIdentityConfigSchema = z.object({
|
|
989
|
+
allowPerCallOverride: z
|
|
990
|
+
.boolean({ error: 'calls.callerIdentity.allowPerCallOverride must be a boolean' })
|
|
991
|
+
.default(true),
|
|
992
|
+
userNumber: z
|
|
993
|
+
.string({ error: 'calls.callerIdentity.userNumber must be a string' })
|
|
994
|
+
.optional(),
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
export const CallsConfigSchema = z.object({
|
|
998
|
+
enabled: z
|
|
999
|
+
.boolean({ error: 'calls.enabled must be a boolean' })
|
|
1000
|
+
.default(true),
|
|
1001
|
+
provider: z
|
|
1002
|
+
.enum(VALID_CALL_PROVIDERS, {
|
|
1003
|
+
error: `calls.provider must be one of: ${VALID_CALL_PROVIDERS.join(', ')}`,
|
|
1004
|
+
})
|
|
1005
|
+
.default('twilio'),
|
|
1006
|
+
maxDurationSeconds: z
|
|
1007
|
+
.number({ error: 'calls.maxDurationSeconds must be a number' })
|
|
1008
|
+
.int('calls.maxDurationSeconds must be an integer')
|
|
1009
|
+
.positive('calls.maxDurationSeconds must be a positive integer')
|
|
1010
|
+
.max(2_147_483, 'calls.maxDurationSeconds must be at most 2147483 (setTimeout-safe limit)')
|
|
1011
|
+
.default(3600),
|
|
1012
|
+
userConsultTimeoutSeconds: z
|
|
1013
|
+
.number({ error: 'calls.userConsultTimeoutSeconds must be a number' })
|
|
1014
|
+
.int('calls.userConsultTimeoutSeconds must be an integer')
|
|
1015
|
+
.positive('calls.userConsultTimeoutSeconds must be a positive integer')
|
|
1016
|
+
.max(2_147_483, 'calls.userConsultTimeoutSeconds must be at most 2147483 (setTimeout-safe limit)')
|
|
1017
|
+
.default(120),
|
|
1018
|
+
disclosure: CallsDisclosureConfigSchema.default({
|
|
1019
|
+
enabled: true,
|
|
1020
|
+
text: 'At the very beginning of the call, disclose that you are an AI assistant calling on behalf of the user.',
|
|
1021
|
+
}),
|
|
1022
|
+
safety: CallsSafetyConfigSchema.default({
|
|
1023
|
+
denyCategories: [],
|
|
1024
|
+
}),
|
|
1025
|
+
voice: CallsVoiceConfigSchema.default({
|
|
1026
|
+
mode: 'twilio_standard',
|
|
1027
|
+
language: 'en-US',
|
|
1028
|
+
transcriptionProvider: 'Deepgram',
|
|
1029
|
+
fallbackToStandardOnError: true,
|
|
1030
|
+
elevenlabs: {
|
|
1031
|
+
voiceId: '',
|
|
1032
|
+
voiceModelId: '',
|
|
1033
|
+
speed: 1.0,
|
|
1034
|
+
stability: 0.5,
|
|
1035
|
+
similarityBoost: 0.75,
|
|
1036
|
+
useSpeakerBoost: true,
|
|
1037
|
+
agentId: '',
|
|
1038
|
+
apiBaseUrl: 'https://api.elevenlabs.io',
|
|
1039
|
+
registerCallTimeoutMs: 5000,
|
|
1040
|
+
},
|
|
1041
|
+
}),
|
|
1042
|
+
model: z
|
|
1043
|
+
.string({ error: 'calls.model must be a string' })
|
|
1044
|
+
.optional(),
|
|
1045
|
+
callerIdentity: CallerIdentityConfigSchema.default({
|
|
1046
|
+
allowPerCallOverride: true,
|
|
1047
|
+
}),
|
|
1048
|
+
});
|
|
1049
|
+
|
|
1050
|
+
export const SkillsConfigSchema = z.object({
|
|
1051
|
+
entries: z.record(z.string(), SkillEntryConfigSchema).default({}),
|
|
1052
|
+
load: SkillsLoadConfigSchema.default({ extraDirs: [], watch: true, watchDebounceMs: 250 }),
|
|
1053
|
+
install: SkillsInstallConfigSchema.default({ nodeManager: 'npm' }),
|
|
1054
|
+
allowBundled: z.array(z.string()).nullable().default(null),
|
|
1055
|
+
});
|
|
1056
|
+
|
|
1057
|
+
export const SmsConfigSchema = z.object({
|
|
1058
|
+
enabled: z
|
|
1059
|
+
.boolean({ error: 'sms.enabled must be a boolean' })
|
|
1060
|
+
.default(false),
|
|
1061
|
+
provider: z
|
|
1062
|
+
.enum(VALID_SMS_PROVIDERS, {
|
|
1063
|
+
error: `sms.provider must be one of: ${VALID_SMS_PROVIDERS.join(', ')}`,
|
|
1064
|
+
})
|
|
1065
|
+
.default('twilio'),
|
|
1066
|
+
phoneNumber: z
|
|
1067
|
+
.string({ error: 'sms.phoneNumber must be a string' })
|
|
1068
|
+
.default(''),
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
const IngressBaseSchema = z.object({
|
|
1072
|
+
enabled: z
|
|
1073
|
+
.boolean({ error: 'ingress.enabled must be a boolean' })
|
|
1074
|
+
.optional(),
|
|
1075
|
+
publicBaseUrl: z
|
|
1076
|
+
.string({ error: 'ingress.publicBaseUrl must be a string' })
|
|
1077
|
+
.default(''),
|
|
1078
|
+
});
|
|
1079
|
+
|
|
1080
|
+
export const IngressConfigSchema = IngressBaseSchema
|
|
1081
|
+
.default({ publicBaseUrl: '' })
|
|
1082
|
+
.transform((val) => ({
|
|
1083
|
+
...val,
|
|
1084
|
+
// Backward compatibility: if `enabled` was never explicitly set (undefined),
|
|
1085
|
+
// infer it from whether a publicBaseUrl is configured. Existing users who
|
|
1086
|
+
// have a URL but predate the `enabled` field should not have their webhooks
|
|
1087
|
+
// silently disabled on upgrade.
|
|
1088
|
+
//
|
|
1089
|
+
// When publicBaseUrl is empty and enabled is unset, leave enabled as
|
|
1090
|
+
// undefined so getPublicBaseUrl() can still fall through to the
|
|
1091
|
+
// INGRESS_PUBLIC_BASE_URL env-var fallback (env-only setups).
|
|
1092
|
+
enabled: val.enabled ?? (val.publicBaseUrl ? true : undefined),
|
|
1093
|
+
}));
|
|
1094
|
+
|
|
1095
|
+
export const AssistantConfigSchema = z.object({
|
|
1096
|
+
provider: z
|
|
1097
|
+
.enum(VALID_PROVIDERS, {
|
|
1098
|
+
error: `provider must be one of: ${VALID_PROVIDERS.join(', ')}`,
|
|
1099
|
+
})
|
|
1100
|
+
.default('anthropic'),
|
|
1101
|
+
model: z
|
|
1102
|
+
.string({ error: 'model must be a string' })
|
|
1103
|
+
.default('claude-opus-4-6'),
|
|
1104
|
+
imageGenModel: z
|
|
1105
|
+
.string({ error: 'imageGenModel must be a string' })
|
|
1106
|
+
.default('gemini-2.5-flash-image'),
|
|
1107
|
+
apiKeys: z
|
|
1108
|
+
.record(z.string(), z.string({ error: 'Each apiKeys value must be a string' }))
|
|
1109
|
+
.default({}),
|
|
1110
|
+
webSearchProvider: z
|
|
1111
|
+
.enum(VALID_WEB_SEARCH_PROVIDERS, {
|
|
1112
|
+
error: `webSearchProvider must be one of: ${VALID_WEB_SEARCH_PROVIDERS.join(', ')}`,
|
|
1113
|
+
})
|
|
1114
|
+
.default('anthropic-native'),
|
|
1115
|
+
providerOrder: z
|
|
1116
|
+
.array(z.enum(VALID_PROVIDERS, {
|
|
1117
|
+
error: `Each providerOrder entry must be one of: ${VALID_PROVIDERS.join(', ')}`,
|
|
1118
|
+
}))
|
|
1119
|
+
.default([]),
|
|
1120
|
+
maxTokens: z
|
|
1121
|
+
.number({ error: 'maxTokens must be a number' })
|
|
1122
|
+
.int('maxTokens must be an integer')
|
|
1123
|
+
.positive('maxTokens must be a positive integer')
|
|
1124
|
+
.default(64000),
|
|
1125
|
+
thinking: ThinkingConfigSchema.default({
|
|
1126
|
+
enabled: false,
|
|
1127
|
+
budgetTokens: 10000,
|
|
1128
|
+
}),
|
|
1129
|
+
contextWindow: ContextWindowConfigSchema.default({
|
|
1130
|
+
enabled: true,
|
|
1131
|
+
maxInputTokens: 180000,
|
|
1132
|
+
targetInputTokens: 110000,
|
|
1133
|
+
compactThreshold: 0.8,
|
|
1134
|
+
preserveRecentUserTurns: 8,
|
|
1135
|
+
summaryMaxTokens: 1200,
|
|
1136
|
+
chunkTokens: 12000,
|
|
1137
|
+
}),
|
|
1138
|
+
memory: MemoryConfigSchema.default({
|
|
1139
|
+
enabled: true,
|
|
1140
|
+
embeddings: {
|
|
1141
|
+
required: true,
|
|
1142
|
+
provider: 'auto',
|
|
1143
|
+
localModel: 'Xenova/bge-small-en-v1.5',
|
|
1144
|
+
openaiModel: 'text-embedding-3-small',
|
|
1145
|
+
geminiModel: 'gemini-embedding-001',
|
|
1146
|
+
ollamaModel: 'nomic-embed-text',
|
|
1147
|
+
},
|
|
1148
|
+
qdrant: {
|
|
1149
|
+
url: 'http://127.0.0.1:6333',
|
|
1150
|
+
collection: 'memory',
|
|
1151
|
+
vectorSize: 384,
|
|
1152
|
+
onDisk: true,
|
|
1153
|
+
quantization: 'scalar',
|
|
1154
|
+
},
|
|
1155
|
+
retrieval: {
|
|
1156
|
+
lexicalTopK: 80,
|
|
1157
|
+
semanticTopK: 40,
|
|
1158
|
+
maxInjectTokens: 10000,
|
|
1159
|
+
injectionFormat: 'markdown',
|
|
1160
|
+
injectionStrategy: 'prepend_user_block',
|
|
1161
|
+
reranking: {
|
|
1162
|
+
enabled: true,
|
|
1163
|
+
model: 'claude-haiku-4-5-20251001',
|
|
1164
|
+
topK: 20,
|
|
1165
|
+
},
|
|
1166
|
+
freshness: {
|
|
1167
|
+
enabled: true,
|
|
1168
|
+
maxAgeDays: { fact: 0, preference: 0, behavior: 90, event: 30, opinion: 60 },
|
|
1169
|
+
staleDecay: 0.5,
|
|
1170
|
+
reinforcementShieldDays: 7,
|
|
1171
|
+
},
|
|
1172
|
+
scopePolicy: 'allow_global_fallback',
|
|
1173
|
+
dynamicBudget: {
|
|
1174
|
+
enabled: true,
|
|
1175
|
+
minInjectTokens: 1200,
|
|
1176
|
+
maxInjectTokens: 10000,
|
|
1177
|
+
targetHeadroomTokens: 10000,
|
|
1178
|
+
},
|
|
1179
|
+
earlyTermination: {
|
|
1180
|
+
enabled: true,
|
|
1181
|
+
minCandidates: 20,
|
|
1182
|
+
minHighConfidence: 10,
|
|
1183
|
+
confidenceThreshold: 0.7,
|
|
1184
|
+
},
|
|
1185
|
+
},
|
|
1186
|
+
segmentation: {
|
|
1187
|
+
targetTokens: 450,
|
|
1188
|
+
overlapTokens: 60,
|
|
1189
|
+
},
|
|
1190
|
+
jobs: {
|
|
1191
|
+
workerConcurrency: 2,
|
|
1192
|
+
batchSize: 10,
|
|
1193
|
+
},
|
|
1194
|
+
retention: {
|
|
1195
|
+
keepRawForever: true,
|
|
1196
|
+
},
|
|
1197
|
+
cleanup: {
|
|
1198
|
+
enabled: true,
|
|
1199
|
+
enqueueIntervalMs: 6 * 60 * 60 * 1000,
|
|
1200
|
+
resolvedConflictRetentionMs: 30 * 24 * 60 * 60 * 1000,
|
|
1201
|
+
supersededItemRetentionMs: 30 * 24 * 60 * 60 * 1000,
|
|
1202
|
+
},
|
|
1203
|
+
extraction: {
|
|
1204
|
+
useLLM: true,
|
|
1205
|
+
model: 'claude-haiku-4-5-20251001',
|
|
1206
|
+
extractFromAssistant: true,
|
|
1207
|
+
},
|
|
1208
|
+
summarization: {
|
|
1209
|
+
useLLM: true,
|
|
1210
|
+
model: 'claude-haiku-4-5-20251001',
|
|
1211
|
+
},
|
|
1212
|
+
entity: {
|
|
1213
|
+
enabled: true,
|
|
1214
|
+
model: 'claude-haiku-4-5-20251001',
|
|
1215
|
+
extractRelations: {
|
|
1216
|
+
enabled: true,
|
|
1217
|
+
backfillBatchSize: 200,
|
|
1218
|
+
},
|
|
1219
|
+
relationRetrieval: {
|
|
1220
|
+
enabled: true,
|
|
1221
|
+
maxSeedEntities: 8,
|
|
1222
|
+
maxNeighborEntities: 20,
|
|
1223
|
+
maxEdges: 40,
|
|
1224
|
+
neighborScoreMultiplier: 0.7,
|
|
1225
|
+
maxDepth: 3,
|
|
1226
|
+
},
|
|
1227
|
+
},
|
|
1228
|
+
conflicts: {
|
|
1229
|
+
enabled: true,
|
|
1230
|
+
gateMode: 'soft',
|
|
1231
|
+
reaskCooldownTurns: 3,
|
|
1232
|
+
resolverLlmTimeoutMs: 12000,
|
|
1233
|
+
relevanceThreshold: 0.3,
|
|
1234
|
+
askOnIrrelevantTurns: false,
|
|
1235
|
+
conflictableKinds: ['preference', 'profile', 'constraint', 'instruction', 'style'],
|
|
1236
|
+
},
|
|
1237
|
+
profile: {
|
|
1238
|
+
enabled: true,
|
|
1239
|
+
maxInjectTokens: 800,
|
|
1240
|
+
},
|
|
1241
|
+
}),
|
|
1242
|
+
dataDir: z
|
|
1243
|
+
.string({ error: 'dataDir must be a string' })
|
|
1244
|
+
.default(getDataDir()),
|
|
1245
|
+
timeouts: TimeoutConfigSchema.default({
|
|
1246
|
+
shellMaxTimeoutSec: 600,
|
|
1247
|
+
shellDefaultTimeoutSec: 120,
|
|
1248
|
+
permissionTimeoutSec: 300,
|
|
1249
|
+
toolExecutionTimeoutSec: 120,
|
|
1250
|
+
providerStreamTimeoutSec: 300,
|
|
1251
|
+
}),
|
|
1252
|
+
sandbox: SandboxConfigSchema.default({
|
|
1253
|
+
enabled: true,
|
|
1254
|
+
backend: 'docker',
|
|
1255
|
+
docker: {
|
|
1256
|
+
image: 'vellum-sandbox:latest',
|
|
1257
|
+
shell: 'bash',
|
|
1258
|
+
cpus: 1,
|
|
1259
|
+
memoryMb: 512,
|
|
1260
|
+
pidsLimit: 256,
|
|
1261
|
+
network: 'none',
|
|
1262
|
+
},
|
|
1263
|
+
}),
|
|
1264
|
+
rateLimit: RateLimitConfigSchema.default({
|
|
1265
|
+
maxRequestsPerMinute: 0,
|
|
1266
|
+
maxTokensPerSession: 0,
|
|
1267
|
+
}),
|
|
1268
|
+
secretDetection: SecretDetectionConfigSchema.default({
|
|
1269
|
+
enabled: true,
|
|
1270
|
+
action: 'redact',
|
|
1271
|
+
entropyThreshold: 4.0,
|
|
1272
|
+
allowOneTimeSend: false,
|
|
1273
|
+
blockIngress: true,
|
|
1274
|
+
}),
|
|
1275
|
+
permissions: PermissionsConfigSchema.default({
|
|
1276
|
+
mode: 'workspace',
|
|
1277
|
+
}),
|
|
1278
|
+
auditLog: AuditLogConfigSchema.default({
|
|
1279
|
+
retentionDays: 0,
|
|
1280
|
+
}),
|
|
1281
|
+
logFile: LogFileConfigSchema.default({
|
|
1282
|
+
dir: undefined,
|
|
1283
|
+
retentionDays: 30,
|
|
1284
|
+
}),
|
|
1285
|
+
pricingOverrides: z
|
|
1286
|
+
.array(ModelPricingOverrideSchema)
|
|
1287
|
+
.default([]),
|
|
1288
|
+
agentHeartbeat: AgentHeartbeatConfigSchema.default({
|
|
1289
|
+
enabled: false,
|
|
1290
|
+
intervalMs: 3_600_000,
|
|
1291
|
+
}),
|
|
1292
|
+
swarm: SwarmConfigSchema.default({
|
|
1293
|
+
enabled: true,
|
|
1294
|
+
maxWorkers: 3,
|
|
1295
|
+
maxTasks: 8,
|
|
1296
|
+
maxRetriesPerTask: 1,
|
|
1297
|
+
workerTimeoutSec: 900,
|
|
1298
|
+
plannerModel: 'claude-haiku-4-5-20251001',
|
|
1299
|
+
synthesizerModel: 'claude-sonnet-4-6',
|
|
1300
|
+
}),
|
|
1301
|
+
skills: SkillsConfigSchema.default({
|
|
1302
|
+
entries: {},
|
|
1303
|
+
load: { extraDirs: [], watch: true, watchDebounceMs: 250 },
|
|
1304
|
+
install: { nodeManager: 'npm' },
|
|
1305
|
+
allowBundled: null,
|
|
1306
|
+
}),
|
|
1307
|
+
workspaceGit: WorkspaceGitConfigSchema.default({
|
|
1308
|
+
turnCommitMaxWaitMs: 4000,
|
|
1309
|
+
failureBackoffBaseMs: 2000,
|
|
1310
|
+
failureBackoffMaxMs: 60000,
|
|
1311
|
+
interactiveGitTimeoutMs: 10000,
|
|
1312
|
+
enrichmentQueueSize: 50,
|
|
1313
|
+
enrichmentConcurrency: 1,
|
|
1314
|
+
enrichmentJobTimeoutMs: 30000,
|
|
1315
|
+
enrichmentMaxRetries: 2,
|
|
1316
|
+
commitMessageLLM: {
|
|
1317
|
+
enabled: false,
|
|
1318
|
+
useConfiguredProvider: true,
|
|
1319
|
+
providerFastModelOverrides: {},
|
|
1320
|
+
timeoutMs: 600,
|
|
1321
|
+
maxTokens: 120,
|
|
1322
|
+
temperature: 0.2,
|
|
1323
|
+
maxFilesInPrompt: 30,
|
|
1324
|
+
maxDiffBytes: 12000,
|
|
1325
|
+
minRemainingTurnBudgetMs: 1000,
|
|
1326
|
+
breaker: {
|
|
1327
|
+
openAfterFailures: 3,
|
|
1328
|
+
backoffBaseMs: 2000,
|
|
1329
|
+
backoffMaxMs: 60000,
|
|
1330
|
+
},
|
|
1331
|
+
},
|
|
1332
|
+
}),
|
|
1333
|
+
calls: CallsConfigSchema.default({
|
|
1334
|
+
enabled: true,
|
|
1335
|
+
provider: 'twilio',
|
|
1336
|
+
maxDurationSeconds: 3600,
|
|
1337
|
+
userConsultTimeoutSeconds: 120,
|
|
1338
|
+
disclosure: {
|
|
1339
|
+
enabled: true,
|
|
1340
|
+
text: 'At the very beginning of the call, disclose that you are an AI assistant calling on behalf of the user.',
|
|
1341
|
+
},
|
|
1342
|
+
safety: {
|
|
1343
|
+
denyCategories: [],
|
|
1344
|
+
},
|
|
1345
|
+
voice: {
|
|
1346
|
+
mode: 'twilio_standard',
|
|
1347
|
+
language: 'en-US',
|
|
1348
|
+
transcriptionProvider: 'Deepgram',
|
|
1349
|
+
fallbackToStandardOnError: true,
|
|
1350
|
+
elevenlabs: {
|
|
1351
|
+
voiceId: '',
|
|
1352
|
+
voiceModelId: '',
|
|
1353
|
+
speed: 1.0,
|
|
1354
|
+
stability: 0.5,
|
|
1355
|
+
similarityBoost: 0.75,
|
|
1356
|
+
useSpeakerBoost: true,
|
|
1357
|
+
agentId: '',
|
|
1358
|
+
apiBaseUrl: 'https://api.elevenlabs.io',
|
|
1359
|
+
registerCallTimeoutMs: 5000,
|
|
1360
|
+
},
|
|
1361
|
+
},
|
|
1362
|
+
callerIdentity: {
|
|
1363
|
+
allowPerCallOverride: true,
|
|
1364
|
+
},
|
|
1365
|
+
}),
|
|
1366
|
+
sms: SmsConfigSchema.default({
|
|
1367
|
+
enabled: false,
|
|
1368
|
+
provider: 'twilio',
|
|
1369
|
+
phoneNumber: '',
|
|
1370
|
+
}),
|
|
1371
|
+
ingress: IngressConfigSchema,
|
|
1372
|
+
}).superRefine((config, ctx) => {
|
|
1373
|
+
if (config.contextWindow.targetInputTokens >= config.contextWindow.maxInputTokens) {
|
|
1374
|
+
ctx.addIssue({
|
|
1375
|
+
code: z.ZodIssueCode.custom,
|
|
1376
|
+
path: ['contextWindow', 'targetInputTokens'],
|
|
1377
|
+
message: 'contextWindow.targetInputTokens must be less than contextWindow.maxInputTokens',
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
if (config.memory.segmentation.overlapTokens >= config.memory.segmentation.targetTokens) {
|
|
1381
|
+
ctx.addIssue({
|
|
1382
|
+
code: z.ZodIssueCode.custom,
|
|
1383
|
+
path: ['memory', 'segmentation', 'overlapTokens'],
|
|
1384
|
+
message: 'memory.segmentation.overlapTokens must be less than memory.segmentation.targetTokens',
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
if (config.memory.retrieval.dynamicBudget.minInjectTokens > config.memory.retrieval.dynamicBudget.maxInjectTokens) {
|
|
1388
|
+
ctx.addIssue({
|
|
1389
|
+
code: z.ZodIssueCode.custom,
|
|
1390
|
+
path: ['memory', 'retrieval', 'dynamicBudget'],
|
|
1391
|
+
message: 'memory.retrieval.dynamicBudget.minInjectTokens must be <= memory.retrieval.dynamicBudget.maxInjectTokens',
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
|
|
1396
|
+
export type AssistantConfig = z.infer<typeof AssistantConfigSchema>;
|
|
1397
|
+
export type TimeoutConfig = z.infer<typeof TimeoutConfigSchema>;
|
|
1398
|
+
export type SandboxConfig = z.infer<typeof SandboxConfigSchema>;
|
|
1399
|
+
export type DockerConfig = z.infer<typeof DockerConfigSchema>;
|
|
1400
|
+
export type RateLimitConfig = z.infer<typeof RateLimitConfigSchema>;
|
|
1401
|
+
export type SecretDetectionConfig = z.infer<typeof SecretDetectionConfigSchema>;
|
|
1402
|
+
export type PermissionsConfig = z.infer<typeof PermissionsConfigSchema>;
|
|
1403
|
+
export type AuditLogConfig = z.infer<typeof AuditLogConfigSchema>;
|
|
1404
|
+
export type LogFileConfig = z.infer<typeof LogFileConfigSchema>;
|
|
1405
|
+
export type ThinkingConfig = z.infer<typeof ThinkingConfigSchema>;
|
|
1406
|
+
export type ContextWindowConfig = z.infer<typeof ContextWindowConfigSchema>;
|
|
1407
|
+
export type MemoryEmbeddingsConfig = z.infer<typeof MemoryEmbeddingsConfigSchema>;
|
|
1408
|
+
export type MemoryRerankingConfig = z.infer<typeof MemoryRerankingConfigSchema>;
|
|
1409
|
+
export type MemoryRetrievalConfig = z.infer<typeof MemoryRetrievalConfigSchema>;
|
|
1410
|
+
export type MemorySegmentationConfig = z.infer<typeof MemorySegmentationConfigSchema>;
|
|
1411
|
+
export type MemoryJobsConfig = z.infer<typeof MemoryJobsConfigSchema>;
|
|
1412
|
+
export type MemoryRetentionConfig = z.infer<typeof MemoryRetentionConfigSchema>;
|
|
1413
|
+
export type MemoryCleanupConfig = z.infer<typeof MemoryCleanupConfigSchema>;
|
|
1414
|
+
export type MemoryExtractionConfig = z.infer<typeof MemoryExtractionConfigSchema>;
|
|
1415
|
+
export type MemorySummarizationConfig = z.infer<typeof MemorySummarizationConfigSchema>;
|
|
1416
|
+
export type MemoryEntityConfig = z.infer<typeof MemoryEntityConfigSchema>;
|
|
1417
|
+
export type MemoryConflictsConfig = z.infer<typeof MemoryConflictsConfigSchema>;
|
|
1418
|
+
export type MemoryProfileConfig = z.infer<typeof MemoryProfileConfigSchema>;
|
|
1419
|
+
export type MemoryConfig = z.infer<typeof MemoryConfigSchema>;
|
|
1420
|
+
export type QdrantConfig = z.infer<typeof QdrantConfigSchema>;
|
|
1421
|
+
export type ModelPricingOverride = z.infer<typeof ModelPricingOverrideSchema>;
|
|
1422
|
+
export type SkillEntryConfig = z.infer<typeof SkillEntryConfigSchema>;
|
|
1423
|
+
export type SkillsLoadConfig = z.infer<typeof SkillsLoadConfigSchema>;
|
|
1424
|
+
export type SkillsInstallConfig = z.infer<typeof SkillsInstallConfigSchema>;
|
|
1425
|
+
export type AgentHeartbeatConfig = z.infer<typeof AgentHeartbeatConfigSchema>;
|
|
1426
|
+
export type SwarmConfig = z.infer<typeof SwarmConfigSchema>;
|
|
1427
|
+
export type SkillsConfig = z.infer<typeof SkillsConfigSchema>;
|
|
1428
|
+
export type WorkspaceGitConfig = z.infer<typeof WorkspaceGitConfigSchema>;
|
|
1429
|
+
export type CallsConfig = z.infer<typeof CallsConfigSchema>;
|
|
1430
|
+
export type CallsDisclosureConfig = z.infer<typeof CallsDisclosureConfigSchema>;
|
|
1431
|
+
export type CallsSafetyConfig = z.infer<typeof CallsSafetyConfigSchema>;
|
|
1432
|
+
export type CallsVoiceConfig = z.infer<typeof CallsVoiceConfigSchema>;
|
|
1433
|
+
export type CallsElevenLabsConfig = z.infer<typeof CallsElevenLabsConfigSchema>;
|
|
1434
|
+
export type CallerIdentityConfig = z.infer<typeof CallerIdentityConfigSchema>;
|
|
1435
|
+
export type SmsConfig = z.infer<typeof SmsConfigSchema>;
|
|
1436
|
+
export type IngressConfig = z.infer<typeof IngressConfigSchema>;
|