@vellumai/assistant 0.11.9 → 0.11.10-dev.202609091114.7b6342c
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/ARCHITECTURE.md +2 -2
- package/Dockerfile +6 -12
- package/docs/architecture/memory.md +17 -9
- package/docs/guardian-request-flow.md +7 -4
- package/docs/runbook-trusted-contacts.md +13 -2
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/package.json +3 -1
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/plan-credit.test.ts +51 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/secret-detection.test.ts +2 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/desktop-presence.ts +11 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/plan-credit.ts +66 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/secret-detection.ts +7 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/package.json +3 -1
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/plan-credit.test.ts +51 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/secret-detection.test.ts +2 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/desktop-presence.ts +11 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/plan-credit.ts +66 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/secret-detection.ts +7 -0
- package/node_modules/@vellumai/gateway-client/src/gateway-ipc-contracts.ts +72 -0
- package/node_modules/@vellumai/service-contracts/package.json +3 -1
- package/node_modules/@vellumai/service-contracts/src/__tests__/plan-credit.test.ts +51 -0
- package/node_modules/@vellumai/service-contracts/src/__tests__/secret-detection.test.ts +2 -0
- package/node_modules/@vellumai/service-contracts/src/desktop-presence.ts +11 -0
- package/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/service-contracts/src/plan-credit.ts +66 -0
- package/node_modules/@vellumai/service-contracts/src/secret-detection.ts +7 -0
- package/openapi.yaml +729 -63
- package/package.json +1 -1
- package/src/__tests__/agent-loop-mutable-latest-user-message.test.ts +19 -21
- package/src/__tests__/assistant-event-hub-machine-name.test.ts +40 -0
- package/src/__tests__/assistant-event-hub.test.ts +45 -0
- package/src/__tests__/cli-memory-v2-reembed-skills.test.ts +0 -1
- package/src/__tests__/compactor-assistant-tail-preview.test.ts +111 -0
- package/src/__tests__/compactor-tail-resolution.test.ts +116 -0
- package/src/__tests__/computer-use-native-history.test.ts +30 -0
- package/src/__tests__/computer-use-window-schema.test.ts +24 -0
- package/src/__tests__/config-get-vision-flag.test.ts +36 -0
- package/src/__tests__/config-loader-validation-reset-notice.test.ts +47 -15
- package/src/__tests__/context-search-conversations-source.test.ts +27 -5
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +189 -195
- package/src/__tests__/conversation-agent-loop.test.ts +690 -50
- package/src/__tests__/conversation-fork-crud.test.ts +132 -45
- package/src/__tests__/conversation-fork-retrospective.test.ts +9 -7
- package/src/__tests__/conversation-lifecycle.test.ts +684 -10
- package/src/__tests__/conversation-pairing.test.ts +10 -9
- package/src/__tests__/conversation-runtime-assembly.test.ts +288 -1
- package/src/__tests__/conversation-surfaces-history-restored-completion.test.ts +21 -4
- package/src/__tests__/conversation-surfaces-point-at-budget.test.ts +150 -0
- package/src/__tests__/conversation-surfaces-point-at-capability.test.ts +161 -0
- package/src/__tests__/copy-composer-tc-templates.test.ts +2 -2
- package/src/__tests__/credential-security-invariants.test.ts +1 -0
- package/src/__tests__/delivered-post-record.test.ts +107 -0
- package/src/__tests__/guardian-action-service-scope.test.ts +53 -0
- package/src/__tests__/guardian-question-mode.test.ts +88 -138
- package/src/__tests__/headless-browser-mode.test.ts +63 -13
- package/src/__tests__/heartbeat-disk-pressure.test.ts +2 -0
- package/src/__tests__/heartbeat-service.test.ts +118 -27
- package/src/__tests__/host-cu-proxy.test.ts +159 -1
- package/src/__tests__/host-proxy-interface.test.ts +15 -0
- package/src/__tests__/host-proxy-preactivation.test.ts +61 -0
- package/src/__tests__/injector-chain.test.ts +3 -3
- package/src/__tests__/injector-registry-order-guard.test.ts +1 -1
- package/src/__tests__/injector-v3-suppression.test.ts +587 -45
- package/src/__tests__/llm-schema.test.ts +70 -2
- package/src/__tests__/logger.test.ts +33 -32
- package/src/__tests__/mcp-config-secret-boundary.test.ts +2 -0
- package/src/__tests__/memory-config-file-parity.test.ts +18 -0
- package/src/__tests__/memory-retrieval-hook.test.ts +53 -3
- package/src/__tests__/messages-read-boundary-guard.test.ts +0 -1
- package/src/__tests__/messaging-send-tool.test.ts +251 -128
- package/src/__tests__/messaging-shared.test.ts +19 -0
- package/src/__tests__/notification-decision-fallback.test.ts +98 -76
- package/src/__tests__/notification-decision-strategy.test.ts +10 -38
- package/src/__tests__/notification-events-source-context-probe.test.ts +211 -0
- package/src/__tests__/openai-responses-prompt-cache.test.ts +7 -2
- package/src/__tests__/openai-responses-provider.test.ts +42 -0
- package/src/__tests__/outlook-messaging-provider.test.ts +9 -0
- package/src/__tests__/platform-callback-registration.test.ts +162 -3
- package/src/__tests__/plugin-api-webhook-url.test.ts +66 -4
- package/src/__tests__/plugin-import-boundary-guard.test.ts +1 -0
- package/src/__tests__/pricing.test.ts +29 -0
- package/src/__tests__/prompt-cache-cross-turn-stability.test.ts +63 -3
- package/src/__tests__/scheduler-result-notification.test.ts +209 -0
- package/src/__tests__/strip-memory-injections.test.ts +75 -27
- package/src/__tests__/tool-approval-seed-content-blocks.test.ts +4 -13
- package/src/acp/auto-install.test.ts +35 -1
- package/src/acp/resolve-agent.test.ts +3 -3
- package/src/agent/loop.ts +116 -45
- package/src/api/constants/personality-sliders.test.ts +21 -0
- package/src/api/constants/personality-sliders.ts +64 -0
- package/src/api/events/contact-record-request.ts +16 -4
- package/src/api/events/contact-request.ts +10 -1
- package/src/api/index.ts +12 -0
- package/src/api/responses/memory-v3-selection-log.ts +64 -13
- package/src/api/surfaces.ts +6 -5
- package/src/background-wake/next-wake.test.ts +13 -0
- package/src/background-wake/next-wake.ts +4 -2
- package/src/calls/__tests__/voice-session-bridge.test.ts +166 -0
- package/src/calls/__tests__/voice-turn-sight-hold.test.ts +301 -0
- package/src/calls/voice-session-bridge.ts +162 -1
- package/src/calls/voice-triage-escalate.ts +1 -1
- package/src/channels/types.ts +14 -0
- package/src/cli/__tests__/catalog-search-help.test.ts +1 -0
- package/src/cli/__tests__/contacts-address-prompt-cli.test.ts +701 -0
- package/src/cli/__tests__/contacts-record-prompt-cli.test.ts +276 -15
- package/src/cli/__tests__/roadmap-cli.test.ts +313 -0
- package/src/cli/__tests__/run-assistant-command.ts +59 -20
- package/src/cli/commands/__tests__/conversations-slack.test.ts +12 -0
- package/src/cli/commands/__tests__/plugins-search.test.ts +81 -0
- package/src/cli/commands/config.help.ts +3 -1
- package/src/cli/commands/contacts.help.ts +179 -12
- package/src/cli/commands/contacts.ts +442 -47
- package/src/cli/commands/memory/worker.ts +1 -1
- package/src/cli/commands/platform/__tests__/credits-format.test.ts +152 -0
- package/src/cli/commands/platform/__tests__/credits.test.ts +20 -0
- package/src/cli/commands/platform/credits-format.ts +108 -0
- package/src/cli/commands/platform/index.help.ts +33 -11
- package/src/cli/commands/platform/index.ts +7 -18
- package/src/cli/commands/plugins.help.ts +4 -1
- package/src/cli/commands/plugins.ts +2 -1
- package/src/cli/commands/roadmap.help.ts +171 -0
- package/src/cli/commands/roadmap.ts +358 -0
- package/src/cli/index.help.ts +2 -0
- package/src/cli/lib/__tests__/cli-output.test.ts +5 -0
- package/src/cli/lib/cli-output.ts +6 -6
- package/src/cli/program.ts +2 -0
- package/src/config/__tests__/webhook-routing.test.ts +42 -0
- package/src/config/acp-defaults.test.ts +3 -3
- package/src/config/acp-defaults.ts +5 -5
- package/src/config/bundled-skills/acp/SKILL.md +8 -11
- package/src/config/bundled-skills/computer-use/SKILL.md +21 -0
- package/src/config/bundled-skills/computer-use/TOOLS.json +6 -0
- package/src/config/bundled-skills/contacts/SKILL.md +61 -11
- package/src/config/bundled-skills/messaging/SKILL.md +2 -0
- package/src/config/bundled-skills/messaging/TOOLS.json +4 -4
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +160 -36
- package/src/config/bundled-skills/messaging/tools/shared.ts +6 -0
- package/src/config/bundled-skills/schedule/SKILL.md +10 -2
- package/src/config/bundled-skills/screen-annotation/SKILL.md +80 -0
- package/src/config/bundled-skills/screen-annotation/TOOLS.json +73 -0
- package/src/config/bundled-skills/screen-annotation/tools/screen-annotation.test.ts +74 -0
- package/src/config/bundled-skills/screen-annotation/tools/screen-clear-marks.ts +33 -0
- package/src/config/bundled-skills/screen-annotation/tools/screen-point-at.ts +25 -0
- package/src/config/env-registry.ts +2 -0
- package/src/config/feature-flag-registry.json +39 -7
- package/src/config/input-modalities.test.ts +71 -0
- package/src/config/input-modalities.ts +95 -0
- package/src/config/loader.ts +2 -0
- package/src/config/schemas/__tests__/memory-v3.test.ts +58 -15
- package/src/config/schemas/heartbeat.ts +3 -3
- package/src/config/schemas/llm.ts +47 -10
- package/src/config/schemas/memory-storage.test.ts +39 -0
- package/src/config/schemas/memory-storage.ts +21 -0
- package/src/config/schemas/memory-v3.ts +73 -46
- package/src/config/schemas/services.ts +18 -0
- package/src/config/webhook-routing.ts +12 -2
- package/src/context/compactor.ts +12 -13
- package/src/context/strip-injections.ts +29 -25
- package/src/context/token-estimator.ts +2 -2
- package/src/daemon/__tests__/embedding-reconcile.test.ts +77 -0
- package/src/daemon/__tests__/lifecycle-embedding-reconcile.test.ts +3 -0
- package/src/daemon/__tests__/turn-actor.test.ts +68 -0
- package/src/daemon/conversation-agent-loop-handlers.ts +152 -22
- package/src/daemon/conversation-agent-loop.ts +19 -3
- package/src/daemon/conversation-messaging.ts +3 -2
- package/src/daemon/conversation-runtime-assembly.ts +191 -69
- package/src/daemon/conversation-surfaces.ts +32 -62
- package/src/daemon/conversation.ts +153 -46
- package/src/daemon/embedding-reconcile.ts +64 -1
- package/src/daemon/handlers/config-embeddings.ts +31 -0
- package/src/daemon/host-cu-proxy.ts +66 -50
- package/src/daemon/host-cu-target.ts +139 -0
- package/src/daemon/host-proxy-preactivation.ts +29 -1
- package/src/daemon/mcp-reload-service.ts +6 -0
- package/src/daemon/providers-setup.ts +5 -26
- package/src/daemon/trust-context.ts +1 -1
- package/src/daemon/turn-actor.ts +46 -0
- package/src/heartbeat/heartbeat-service.ts +72 -13
- package/src/inbound/platform-callback-registration.ts +77 -11
- package/src/inbound/pod-webhook-claim.ts +35 -0
- package/src/inbound/velay-webhooks-gate.ts +20 -0
- package/src/ipc/gateway-client.ts +91 -0
- package/src/live-voice/__tests__/live-voice-photo.test.ts +174 -0
- package/src/live-voice/__tests__/live-voice-session-guardian.test.ts +127 -0
- package/src/live-voice/__tests__/live-voice-session-telemetry.test.ts +42 -2
- package/src/live-voice/__tests__/live-voice-sight-frame.test.ts +81 -0
- package/src/live-voice/__tests__/protocol.test.ts +67 -0
- package/src/live-voice/live-voice-connection.ts +14 -1
- package/src/live-voice/live-voice-photo.ts +109 -4
- package/src/live-voice/live-voice-session-manager.ts +10 -1
- package/src/live-voice/live-voice-session.ts +196 -31
- package/src/live-voice/protocol.ts +134 -1
- package/src/mcp/__tests__/reload-signal-emission.test.ts +54 -0
- package/src/mcp/__tests__/reload-signal.test.ts +57 -0
- package/src/mcp/__tests__/startup.test.ts +150 -0
- package/src/mcp/reload-signal.ts +50 -0
- package/src/mcp/startup.ts +101 -0
- package/src/messaging/providers/outlook/adapter.ts +2 -13
- package/src/messaging/providers/outlook/client.ts +13 -1
- package/src/messaging/providers/outlook/types.ts +3 -0
- package/src/messaging/providers/telegram-bot/adapter.ts +9 -2
- package/src/messaging/providers/telegram-bot/client.ts +8 -2
- package/src/messaging/providers/whatsapp/adapter.ts +9 -2
- package/src/messaging/providers/whatsapp/client.ts +8 -2
- package/src/notifications/AGENTS.md +5 -0
- package/src/notifications/README.md +21 -7
- package/src/notifications/__tests__/assistant-reply-producer.test.ts +3 -10
- package/src/notifications/__tests__/background-failure-signal.test.ts +96 -0
- package/src/notifications/__tests__/broadcaster.test.ts +171 -7
- package/src/notifications/__tests__/decision-engine.test.ts +79 -6
- package/src/notifications/__tests__/edit-notification.test.ts +59 -0
- package/src/notifications/__tests__/resolve-visible-in-source.test.ts +96 -0
- package/src/notifications/__tests__/schedule-result-producer.test.ts +397 -0
- package/src/notifications/access-request-copy.ts +5 -5
- package/src/notifications/approval-card-data.ts +29 -13
- package/src/notifications/assistant-reply-producer.ts +0 -4
- package/src/notifications/background-failure-signal.ts +13 -1
- package/src/notifications/broadcaster.ts +65 -2
- package/src/notifications/conversation-pairing.ts +263 -155
- package/src/notifications/copy-composer.ts +38 -22
- package/src/notifications/decision-engine.ts +89 -61
- package/src/notifications/delivered-post-record.ts +81 -0
- package/src/notifications/deliveries-store.ts +8 -1
- package/src/notifications/edit-notification.ts +16 -0
- package/src/notifications/events-store.ts +68 -2
- package/src/notifications/guardian-question-mode.ts +24 -232
- package/src/notifications/home-feed-side-effect.ts +1 -0
- package/src/notifications/notification-utils.ts +13 -5
- package/src/notifications/resolve-visible-in-source.ts +56 -0
- package/src/notifications/schedule-result-producer.ts +275 -0
- package/src/notifications/signal.ts +5 -0
- package/src/oauth/__tests__/seed-providers-managed.test.ts +82 -0
- package/src/oauth/seed-providers.ts +201 -3
- package/src/onboarding/onboarding-events-store.ts +14 -8
- package/src/persistence/conversation-crud.ts +68 -19
- package/src/persistence/embeddings/embedding-backend.test.ts +162 -0
- package/src/persistence/embeddings/embedding-backend.ts +148 -11
- package/src/persistence/embeddings/embedding-gemini.test.ts +328 -9
- package/src/persistence/embeddings/embedding-gemini.ts +211 -27
- package/src/persistence/embeddings/embedding-openai.test.ts +113 -0
- package/src/persistence/embeddings/embedding-openai.ts +55 -4
- package/src/persistence/embeddings/embedding-types.test.ts +24 -0
- package/src/persistence/embeddings/embedding-types.ts +25 -1
- package/src/persistence/job-utils.ts +6 -2
- package/src/persistence/message-metadata.ts +20 -0
- package/src/persistence/migrations/283-memory-v3-selections-message-id-and-sections.ts +2 -1
- package/src/persistence/migrations/376-notification-deliveries-canonical-message-id.ts +37 -0
- package/src/persistence/schema/memory-injection.ts +31 -9
- package/src/persistence/schema/notifications.ts +8 -0
- package/src/persistence/steps.ts +2 -0
- package/src/plugin-api/index.ts +2 -1
- package/src/plugin-api/vision-support.test.ts +81 -0
- package/src/plugin-api/vision-support.ts +57 -10
- package/src/plugin-api/webhook-url.ts +18 -4
- package/src/plugins/AGENTS.md +1 -1
- package/src/plugins/defaults/channel/injectors.ts +3 -1
- package/src/plugins/defaults/injector-order.ts +2 -2
- package/src/plugins/defaults/memory/AGENTS.md +263 -30
- package/src/plugins/defaults/memory/__tests__/conversation-memory-orphan-sweep.test.ts +4 -0
- package/src/plugins/defaults/memory/__tests__/conversation-memory-purge.test.ts +6 -0
- package/src/plugins/defaults/memory/__tests__/db-memory-attach.test.ts +9 -3
- package/src/plugins/defaults/memory/__tests__/memory-log-stores-degraded.test.ts +3 -7
- package/src/plugins/defaults/memory/__tests__/relocated-memory-test-rows.ts +18 -0
- package/src/plugins/defaults/memory/context-search/sources/conversations.ts +16 -2
- package/src/plugins/defaults/memory/conversation-memory-purge.ts +2 -0
- package/src/plugins/defaults/memory/fork-conversation-memory.ts +13 -13
- package/src/plugins/defaults/memory/graph/__tests__/conversation-graph-memory-v2-routing.test.ts +19 -12
- package/src/plugins/defaults/memory/graph/conversation-graph-memory.ts +17 -15
- package/src/plugins/defaults/memory/graph-topology/build-memory-graph.ts +1 -1
- package/src/plugins/defaults/memory/hooks/__tests__/post-compact.test.ts +121 -0
- package/src/plugins/defaults/memory/hooks/init.ts +10 -0
- package/src/plugins/defaults/memory/hooks/injection-metadata.ts +100 -0
- package/src/plugins/defaults/memory/hooks/post-compact.ts +19 -7
- package/src/plugins/defaults/memory/hooks/user-prompt-submit.ts +11 -83
- package/src/plugins/defaults/memory/injectors.ts +4 -4
- package/src/plugins/defaults/memory/job-handlers.ts +4 -1
- package/src/plugins/defaults/memory/jobs/__tests__/embed-concept-page.test.ts +1 -0
- package/src/plugins/defaults/memory/jobs/embed-concept-page.ts +11 -3
- package/src/plugins/defaults/memory/memory-db.ts +4 -0
- package/src/plugins/defaults/memory/memory-marker.ts +28 -17
- package/src/plugins/defaults/memory/src/__tests__/memory-v2-simulate-route.test.ts +0 -1
- package/src/plugins/defaults/memory/src/__tests__/memory-worker-routes.test.ts +20 -0
- package/src/plugins/defaults/memory/src/memory-item-routes.test.ts +0 -1
- package/src/plugins/defaults/memory/src/memory-worker-routes.ts +3 -1
- package/src/plugins/defaults/memory/substrate/__tests__/cli-command-store.test.ts +1 -1
- package/src/plugins/defaults/memory/substrate/__tests__/consolidation-job.test.ts +66 -0
- package/src/plugins/defaults/memory/substrate/__tests__/injected-block-slugs.test.ts +345 -0
- package/src/plugins/defaults/memory/substrate/__tests__/page-index.test.ts +0 -1
- package/src/plugins/defaults/memory/substrate/__tests__/prompts-consolidation.test.ts +170 -1
- package/src/plugins/defaults/memory/substrate/__tests__/reembed-job.test.ts +1 -0
- package/src/plugins/defaults/memory/substrate/capability-slugs.ts +53 -0
- package/src/plugins/defaults/memory/substrate/cli-command-store.ts +4 -18
- package/src/plugins/defaults/memory/substrate/consolidation-job.ts +40 -1
- package/src/plugins/defaults/memory/substrate/ingest.ts +11 -9
- package/src/plugins/defaults/memory/substrate/injected-block-slugs.ts +426 -42
- package/src/plugins/defaults/memory/substrate/page-index.ts +5 -4
- package/src/plugins/defaults/memory/substrate/prompts/consolidation.ts +127 -14
- package/src/plugins/defaults/memory/substrate/skill-store.ts +1 -18
- package/src/plugins/defaults/memory/v2/__tests__/backfill-jobs.test.ts +1 -0
- package/src/plugins/defaults/memory/v2/__tests__/injection.test.ts +2 -8
- package/src/plugins/defaults/memory/v2/__tests__/router.test.ts +0 -1
- package/src/plugins/defaults/memory/v2/injection.ts +4 -4
- package/src/plugins/defaults/memory/v3/__tests__/capabilities.test.ts +16 -0
- package/src/plugins/defaults/memory/v3/__tests__/carry-integration.test.ts +1004 -319
- package/src/plugins/defaults/memory/v3/__tests__/dense.test.ts +227 -4
- package/src/plugins/defaults/memory/v3/__tests__/injection.test.ts +836 -263
- package/src/plugins/defaults/memory/v3/__tests__/live-integration.test.ts +65 -38
- package/src/plugins/defaults/memory/v3/__tests__/maintain-job.test.ts +354 -3
- package/src/plugins/defaults/memory/v3/__tests__/orchestrate.test.ts +688 -104
- package/src/plugins/defaults/memory/v3/__tests__/overlong-sections.test.ts +109 -0
- package/src/plugins/defaults/memory/v3/__tests__/page-content.test.ts +144 -0
- package/src/plugins/defaults/memory/v3/__tests__/plugin-schema.test.ts +534 -0
- package/src/plugins/defaults/memory/v3/__tests__/pool-log-store.test.ts +449 -0
- package/src/plugins/defaults/memory/v3/__tests__/pool-select.test.ts +265 -27
- package/src/plugins/defaults/memory/v3/__tests__/render-injection.test.ts +34 -117
- package/src/plugins/defaults/memory/v3/__tests__/section-dense-store.test.ts +491 -4
- package/src/plugins/defaults/memory/v3/__tests__/section-needle.test.ts +124 -1
- package/src/plugins/defaults/memory/v3/__tests__/sections.test.ts +264 -4
- package/src/plugins/defaults/memory/v3/__tests__/selection-log-store.test.ts +560 -22
- package/src/plugins/defaults/memory/v3/__tests__/shadow-integration.test.ts +40 -33
- package/src/plugins/defaults/memory/v3/__tests__/shadow-plugin.test.ts +718 -63
- package/src/plugins/defaults/memory/v3/__tests__/types.test.ts +83 -2
- package/src/plugins/defaults/memory/v3/candidate-match.ts +1 -1
- package/src/plugins/defaults/memory/v3/capabilities.ts +90 -14
- package/src/plugins/defaults/memory/v3/card.test.ts +15 -16
- package/src/plugins/defaults/memory/v3/card.ts +16 -15
- package/src/plugins/defaults/memory/v3/dense.ts +10 -0
- package/src/plugins/defaults/memory/v3/ever-injected-store.test.ts +643 -140
- package/src/plugins/defaults/memory/v3/ever-injected-store.ts +462 -212
- package/src/plugins/defaults/memory/v3/hot-set.test.ts +2 -2
- package/src/plugins/defaults/memory/v3/injector.ts +366 -278
- package/src/plugins/defaults/memory/v3/learned-edges.test.ts +2 -2
- package/src/plugins/defaults/memory/v3/maintain-job.ts +299 -73
- package/src/plugins/defaults/memory/v3/orchestrate.ts +327 -214
- package/src/plugins/defaults/memory/v3/overlong-sections.ts +83 -0
- package/src/plugins/defaults/memory/v3/page-content.ts +72 -92
- package/src/plugins/defaults/memory/v3/plugin-schema.ts +346 -0
- package/src/plugins/defaults/memory/v3/pool-log-store.ts +291 -0
- package/src/plugins/defaults/memory/v3/pool-select.test.ts +2 -2
- package/src/plugins/defaults/memory/v3/pool-select.ts +160 -60
- package/src/plugins/defaults/memory/v3/prune.test.ts +1042 -329
- package/src/plugins/defaults/memory/v3/prune.ts +433 -270
- package/src/plugins/defaults/memory/v3/rare-term-lane.test.ts +269 -0
- package/src/plugins/defaults/memory/v3/rare-term-lane.ts +141 -0
- package/src/plugins/defaults/memory/v3/render-injection.ts +43 -82
- package/src/plugins/defaults/memory/v3/section-dense-store.ts +316 -28
- package/src/plugins/defaults/memory/v3/section-needle.ts +145 -11
- package/src/plugins/defaults/memory/v3/sections.ts +103 -16
- package/src/plugins/defaults/memory/v3/selection-log-store.ts +243 -78
- package/src/plugins/defaults/memory/v3/shadow-plugin.ts +189 -68
- package/src/plugins/defaults/memory/v3/tuning-profile.ts +6 -0
- package/src/plugins/defaults/memory/v3/types.ts +169 -23
- package/src/plugins/defaults/memory/v3-eval/__tests__/eval-packets.test.ts +21 -4
- package/src/plugins/defaults/memory/v3-eval/eval-packets.ts +77 -26
- package/src/plugins/types.ts +14 -0
- package/src/providers/__tests__/connection-model-compat.test.ts +1 -0
- package/src/providers/__tests__/provider-secret-catalog.test.ts +4 -0
- package/src/providers/__tests__/xml-tool-call-salvage.test.ts +172 -0
- package/src/providers/inline-audio-support.test.ts +34 -0
- package/src/providers/inline-audio-support.ts +27 -0
- package/src/providers/model-catalog.ts +102 -0
- package/src/providers/openai/__tests__/chat-completions-extra-body.test.ts +51 -0
- package/src/providers/openai/__tests__/chat-completions-provider-xml-salvage.test.ts +291 -0
- package/src/providers/openai/chat-completions-provider.ts +114 -14
- package/src/providers/openai/codex-models.ts +1 -0
- package/src/providers/openai/responses-provider.ts +65 -15
- package/src/providers/opencode/client.test.ts +24 -0
- package/src/providers/opencode/client.ts +6 -1
- package/src/providers/provider-secret-catalog.ts +11 -1
- package/src/providers/retry.ts +6 -0
- package/src/providers/vellum/client.ts +14 -1
- package/src/providers/vellum/personality-directions.test.ts +163 -0
- package/src/providers/vellum/personality-directions.ts +120 -0
- package/src/providers/xml-tool-call-salvage.ts +212 -0
- package/src/runtime/AGENTS.md +7 -2
- package/src/runtime/__tests__/background-job-runner.test.ts +115 -0
- package/src/runtime/__tests__/guardian-form-registry.test.ts +0 -32
- package/src/runtime/__tests__/host-observe.test.ts +44 -0
- package/src/runtime/assistant-event-hub.ts +14 -9
- package/src/runtime/auth/__tests__/guard-tests.test.ts +1 -4
- package/src/runtime/auth/__tests__/route-policy.test.ts +65 -0
- package/src/runtime/auth/same-actor.ts +4 -3
- package/src/runtime/background-job-runner.ts +10 -0
- package/src/runtime/channel-reply-delivery.ts +1 -162
- package/src/runtime/guardian-action-service.ts +20 -1
- package/src/runtime/host-observe.ts +56 -6
- package/src/runtime/http-server.ts +35 -0
- package/src/runtime/outbound-post-reconciliation.ts +183 -0
- package/src/runtime/routes/__tests__/contact-address-prompt-route.test.ts +231 -0
- package/src/runtime/routes/__tests__/contact-record-prompt-route.test.ts +59 -3
- package/src/runtime/routes/__tests__/guardian-form-routes.test.ts +85 -0
- package/src/runtime/routes/__tests__/heartbeat-routes.test.ts +24 -0
- package/src/runtime/routes/__tests__/platform-credits-routes.test.ts +239 -0
- package/src/runtime/routes/__tests__/roadmap-routes.test.ts +469 -0
- package/src/runtime/routes/__tests__/watch-routes.test.ts +70 -1
- package/src/runtime/routes/__tests__/webhook-routes.test.ts +83 -0
- package/src/runtime/routes/contact-prompt-routes.ts +177 -28
- package/src/runtime/routes/conversation-query-routes.ts +53 -11
- package/src/runtime/routes/events-routes.ts +13 -3
- package/src/runtime/routes/guardian-action-routes.ts +7 -0
- package/src/runtime/routes/guardian-form-routes.ts +6 -4
- package/src/runtime/routes/heartbeat-routes.ts +41 -53
- package/src/runtime/routes/index.ts +2 -2
- package/src/runtime/routes/integrations/a2a.ts +12 -3
- package/src/runtime/routes/integrations/vercel.ts +13 -3
- package/src/runtime/routes/platform-routes.ts +175 -23
- package/src/runtime/routes/roadmap-routes.ts +744 -0
- package/src/runtime/routes/watch-routes.ts +50 -0
- package/src/runtime/routes/webhook-routes.ts +24 -2
- package/src/runtime/web-presence.ts +13 -9
- package/src/schedule/__tests__/schedule-timezone.test.ts +21 -3
- package/src/schedule/__tests__/worker-mcp-tools.test.ts +88 -0
- package/src/schedule/schedule-timezone.ts +25 -0
- package/src/schedule/scheduler.ts +19 -0
- package/src/schedule/worker.ts +119 -2
- package/src/telemetry/__tests__/live-voice-funnel.test.ts +32 -0
- package/src/telemetry/live-voice-funnel.ts +33 -0
- package/src/tools/acp/list-agents.test.ts +1 -1
- package/src/tools/browser/__tests__/browser-status.test.ts +3 -0
- package/src/tools/browser/browser-execution.ts +117 -53
- package/src/tools/browser/browser-status-constants.ts +6 -6
- package/src/tools/capability-offer.test.ts +87 -0
- package/src/tools/capability-offer.ts +93 -0
- package/src/tools/computer-use/definitions.ts +6 -0
- package/src/tools/computer-use/skill-proxy-bridge.ts +10 -0
- package/src/tools/terminal/safe-env.ts +2 -0
- package/src/watch/__tests__/watch-retro.test.ts +11 -10
- package/src/watch/__tests__/watch-session-manager.test.ts +75 -1
- package/src/watch/watch-retro.ts +10 -9
- package/src/watch/watch-session-manager.ts +17 -0
- package/src/runtime/routes/__tests__/sight-frame-routes.test.ts +0 -487
- package/src/runtime/routes/sight-frame-routes.ts +0 -136
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import type { ToolContext } from "../../../../tools/types.js";
|
|
4
|
+
import { run as clearMarks } from "./screen-clear-marks.js";
|
|
5
|
+
import { run as pointAt } from "./screen-point-at.js";
|
|
6
|
+
|
|
7
|
+
function recorder() {
|
|
8
|
+
const calls: { toolName: string; input: Record<string, unknown> }[] = [];
|
|
9
|
+
const context = {
|
|
10
|
+
proxyToolResolver: async (
|
|
11
|
+
toolName: string,
|
|
12
|
+
input: Record<string, unknown>,
|
|
13
|
+
) => {
|
|
14
|
+
calls.push({ toolName, input });
|
|
15
|
+
return { content: "ok", isError: false };
|
|
16
|
+
},
|
|
17
|
+
} as unknown as ToolContext;
|
|
18
|
+
return { calls, context };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const MARK = { x: 0.1, y: 0.2, width: 0.3, height: 0.1, caption: "Press" };
|
|
22
|
+
|
|
23
|
+
describe("screen_point_at", () => {
|
|
24
|
+
/**
|
|
25
|
+
* The wire name is the route: `surfaceProxyResolver` forwards tools by the
|
|
26
|
+
* `computer_use_` prefix to the connected desktop client, which answers this
|
|
27
|
+
* one in its own main process. The name the model reads belongs to the
|
|
28
|
+
* skill; renaming the wire name would leave the tool resolving nowhere.
|
|
29
|
+
*/
|
|
30
|
+
test("forwards under the name the proxy resolver routes on", async () => {
|
|
31
|
+
const { calls, context } = recorder();
|
|
32
|
+
|
|
33
|
+
await pointAt({ marks: [MARK] }, context);
|
|
34
|
+
|
|
35
|
+
expect(calls).toEqual([
|
|
36
|
+
{ toolName: "computer_use_point_at", input: { marks: [MARK] } },
|
|
37
|
+
]);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test("fails with a message when no client is connected", async () => {
|
|
41
|
+
const result = await pointAt(
|
|
42
|
+
{ marks: [MARK] },
|
|
43
|
+
{} as unknown as ToolContext,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
expect(result.isError).toBe(true);
|
|
47
|
+
expect(result.content).toContain("connected desktop client");
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe("screen_clear_marks", () => {
|
|
52
|
+
/** Nothing pointed at is the same request carrying nothing. */
|
|
53
|
+
test("clears by sending no marks", async () => {
|
|
54
|
+
const { calls, context } = recorder();
|
|
55
|
+
|
|
56
|
+
await clearMarks({}, context);
|
|
57
|
+
|
|
58
|
+
expect(calls).toEqual([
|
|
59
|
+
{ toolName: "computer_use_point_at", input: { marks: [] } },
|
|
60
|
+
]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/** The pick has to survive, or a clear lands on a different machine. */
|
|
64
|
+
test("keeps the client it was aimed at", async () => {
|
|
65
|
+
const { calls, context } = recorder();
|
|
66
|
+
|
|
67
|
+
await clearMarks({ target_client_id: "client-9" }, context);
|
|
68
|
+
|
|
69
|
+
expect(calls[0]?.input).toEqual({
|
|
70
|
+
target_client_id: "client-9",
|
|
71
|
+
marks: [],
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Take down whatever is drawn on the shared surface.
|
|
3
|
+
*
|
|
4
|
+
* Its own tool rather than an empty `marks` array on the pointing one,
|
|
5
|
+
* because clearing is a thing the model decides to do rather than a shape of
|
|
6
|
+
* argument it has to remember. On the wire it is the same request carrying
|
|
7
|
+
* nothing, which is how the client says "nothing is being pointed at".
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
forwardComputerUseProxyTool,
|
|
12
|
+
POINT_AT_PROXY_TOOL,
|
|
13
|
+
} from "../../../../tools/computer-use/skill-proxy-bridge.js";
|
|
14
|
+
import type {
|
|
15
|
+
ToolContext,
|
|
16
|
+
ToolExecutionResult,
|
|
17
|
+
} from "../../../../tools/types.js";
|
|
18
|
+
|
|
19
|
+
export async function run(
|
|
20
|
+
input: Record<string, unknown>,
|
|
21
|
+
context: ToolContext,
|
|
22
|
+
): Promise<ToolExecutionResult> {
|
|
23
|
+
return forwardComputerUseProxyTool(
|
|
24
|
+
POINT_AT_PROXY_TOOL,
|
|
25
|
+
{
|
|
26
|
+
...(typeof input.target_client_id === "string"
|
|
27
|
+
? { target_client_id: input.target_client_id }
|
|
28
|
+
: {}),
|
|
29
|
+
marks: [],
|
|
30
|
+
},
|
|
31
|
+
context,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Point at things on the surface a call is being shown.
|
|
3
|
+
*
|
|
4
|
+
* Forwarded as `computer_use_point_at` rather than under its own name:
|
|
5
|
+
* `surfaceProxyResolver` routes tools by that prefix to the connected desktop
|
|
6
|
+
* client, and the client answers this one in its own main process because the
|
|
7
|
+
* marks are drawn on a window it owns. The name the model sees belongs to
|
|
8
|
+
* this skill; the name on the wire is the route.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
forwardComputerUseProxyTool,
|
|
13
|
+
POINT_AT_PROXY_TOOL,
|
|
14
|
+
} from "../../../../tools/computer-use/skill-proxy-bridge.js";
|
|
15
|
+
import type {
|
|
16
|
+
ToolContext,
|
|
17
|
+
ToolExecutionResult,
|
|
18
|
+
} from "../../../../tools/types.js";
|
|
19
|
+
|
|
20
|
+
export async function run(
|
|
21
|
+
input: Record<string, unknown>,
|
|
22
|
+
context: ToolContext,
|
|
23
|
+
): Promise<ToolExecutionResult> {
|
|
24
|
+
return forwardComputerUseProxyTool(POINT_AT_PROXY_TOOL, input, context);
|
|
25
|
+
}
|
|
@@ -223,6 +223,7 @@ const KNOWN_VELLUM_VARS = new Set([
|
|
|
223
223
|
"VELLUM_HOOK_NAME",
|
|
224
224
|
"VELLUM_HOOK_SETTINGS",
|
|
225
225
|
"VELLUM_LOCKFILE_DIR",
|
|
226
|
+
"VELLUM_MARKETING_URL",
|
|
226
227
|
"VELLUM_MIGRATION_EXPORT_ALLOWED_HOSTS",
|
|
227
228
|
"VELLUM_MIGRATION_IMPORT_ALLOWED_HOSTS",
|
|
228
229
|
"VELLUM_PLATFORM_URL",
|
|
@@ -233,6 +234,7 @@ const KNOWN_VELLUM_VARS = new Set([
|
|
|
233
234
|
"VELLUM_PROFILER_RUN_ID",
|
|
234
235
|
"VELLUM_ROOT_DIR",
|
|
235
236
|
"VELLUM_SSH_USER",
|
|
237
|
+
"VELLUM_WEB_URL",
|
|
236
238
|
"VELLUM_WORKSPACE_DIR",
|
|
237
239
|
"VELLUM_CPU_LIMIT",
|
|
238
240
|
"VELLUM_MEMORY_LIMIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"scope": "client",
|
|
33
33
|
"key": "vision-mode",
|
|
34
34
|
"label": "Vision Mode",
|
|
35
|
-
"description": "Gates
|
|
35
|
+
"description": "Gates hold-to-Live ambient frame sampling in the voice room camera. String-valued so future A/B arms can be added as new values.",
|
|
36
36
|
"defaultEnabled": "off",
|
|
37
37
|
"values": ["off", "on"]
|
|
38
38
|
},
|
|
@@ -366,6 +366,14 @@
|
|
|
366
366
|
"description": "Gates the marketing pricing takeover page (www.vellum.ai/pricing) and the `/assistant/checkout?package=<slug>` deep link its package CTAs target. One flag covers both halves of the funnel so they can never be enabled independently and strand a CTA. When off, the checkout deep link redirects to the in-app plans takeover.",
|
|
367
367
|
"defaultEnabled": false
|
|
368
368
|
},
|
|
369
|
+
{
|
|
370
|
+
"id": "schedule-result-notify",
|
|
371
|
+
"scope": "assistant",
|
|
372
|
+
"key": "schedule-result-notify",
|
|
373
|
+
"label": "Schedule Result Notify",
|
|
374
|
+
"description": "Gates the `schedule.result` fallback notification the assistant sends when an execute-mode schedule run produces user-facing output but never notifies about it itself. On by default; turn it off to return to notify-only-if-the-run-said-so, where a scheduled briefing can run and leave no trace outside its own conversation.",
|
|
375
|
+
"defaultEnabled": true
|
|
376
|
+
},
|
|
369
377
|
{
|
|
370
378
|
"id": "assistant-reply-push",
|
|
371
379
|
"scope": "assistant",
|
|
@@ -375,19 +383,19 @@
|
|
|
375
383
|
"defaultEnabled": true
|
|
376
384
|
},
|
|
377
385
|
{
|
|
378
|
-
"id": "
|
|
386
|
+
"id": "activity-presence-suppression",
|
|
379
387
|
"scope": "assistant",
|
|
380
|
-
"key": "
|
|
381
|
-
"label": "
|
|
382
|
-
"description": "Gates whether a
|
|
383
|
-
"defaultEnabled":
|
|
388
|
+
"key": "activity-presence-suppression",
|
|
389
|
+
"label": "Activity Presence Suppression",
|
|
390
|
+
"description": "Gates whether a background-activity failure notification is suppressed while a client reports itself visible on that conversation. Off by default; turn it on to stop notifying about work the user is already watching.",
|
|
391
|
+
"defaultEnabled": false
|
|
384
392
|
},
|
|
385
393
|
{
|
|
386
394
|
"id": "web-presence-suppression",
|
|
387
395
|
"scope": "assistant",
|
|
388
396
|
"key": "web-presence-suppression",
|
|
389
397
|
"label": "Web Presence Suppression",
|
|
390
|
-
"description": "Gates whether a `chat.assistant_reply` push is suppressed while a browser tab reports itself visible on that conversation. On by default; turn it off to restore unconditional reply pushes for web-visible conversations.",
|
|
398
|
+
"description": "Gates whether a `chat.assistant_reply` push is suppressed while a browser tab or desktop app window reports itself visible on that conversation. On by default; turn it off to restore unconditional reply pushes for web-visible conversations.",
|
|
391
399
|
"defaultEnabled": true
|
|
392
400
|
},
|
|
393
401
|
{
|
|
@@ -423,6 +431,14 @@
|
|
|
423
431
|
"description": "Renders a conversation bound to an external channel (Slack, Telegram, Discord, phone, email, and any other channel adapter) as two lanes in web chat: Vellum stays the primary full-width lane, and the canonical external-channel transcript moves into the existing read-only right drawer, opened from a channel-thread control in the chat header. Rows the client can attribute to the external channel are drawn once, in the drawer, instead of being blended into the Vellum lane. The drawer offers an Open in <channel> secondary action and a per-message Reference in Vellum action that stages one quoted reference above the Vellum composer. The Vellum composer stays the only input; nothing about delivery, routing, or permissions changes. Off leaves the header deep-link pill and the blended transcript unchanged.",
|
|
424
432
|
"defaultEnabled": false
|
|
425
433
|
},
|
|
434
|
+
{
|
|
435
|
+
"id": "stripe-link-oauth",
|
|
436
|
+
"scope": "assistant",
|
|
437
|
+
"key": "stripe-link-oauth",
|
|
438
|
+
"label": "Link by Stripe Integration",
|
|
439
|
+
"description": "Gates the seeded Link by Stripe OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup; only its visibility changes. Off by default because a connected wallet lets an assistant spend real money.",
|
|
440
|
+
"defaultEnabled": false
|
|
441
|
+
},
|
|
426
442
|
{
|
|
427
443
|
"id": "monday-oauth",
|
|
428
444
|
"scope": "assistant",
|
|
@@ -431,6 +447,14 @@
|
|
|
431
447
|
"description": "Gates the seeded monday.com OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup; only its visibility changes.",
|
|
432
448
|
"defaultEnabled": false
|
|
433
449
|
},
|
|
450
|
+
{
|
|
451
|
+
"id": "figma-oauth",
|
|
452
|
+
"scope": "assistant",
|
|
453
|
+
"key": "figma-oauth",
|
|
454
|
+
"label": "Figma Integration",
|
|
455
|
+
"description": "Gates the seeded Figma OAuth provider. When off, the provider is hidden from GET /v1/oauth/providers, its get-by-id route, and the connect/update routes, so it cannot be listed or connected from the CLI, gateway, or web integrations list. The row is still seeded into oauth_providers on startup, and existing connections keep injecting credentials; only its visibility changes.",
|
|
456
|
+
"defaultEnabled": false
|
|
457
|
+
},
|
|
434
458
|
{
|
|
435
459
|
"id": "chatgpt-device-code-login",
|
|
436
460
|
"scope": "client",
|
|
@@ -446,6 +470,14 @@
|
|
|
446
470
|
"label": "Model-First Profile Create",
|
|
447
471
|
"description": "Reverses the two questions the web client's New Model modal asks when creating an inference profile. Off: the modal asks for a provider first and then offers that provider's models. On: it opens on one searchable list of every catalog model the assistant can reach, deduplicated across providers, and only then asks which provider serves the chosen model. That second question is skipped when a single provider serves it, answered with radio cards when several do, and turned into an inline connect form (API key, setup, or ChatGPT sign-in) when the chosen route has no connection yet. Editing an existing profile is unchanged either way, and both flows persist the same profile shape.",
|
|
448
472
|
"defaultEnabled": false
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"id": "velay-webhooks",
|
|
476
|
+
"scope": "assistant",
|
|
477
|
+
"key": "velay-webhooks",
|
|
478
|
+
"label": "Velay Webhooks",
|
|
479
|
+
"description": "Platform pods resolve webhook callback URLs from the Velay-published ingress URL instead of registering platform callback routes. Falls back to platform callback registration while no tunnel URL is published.",
|
|
480
|
+
"defaultEnabled": false
|
|
449
481
|
}
|
|
450
482
|
]
|
|
451
483
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
catalogSupportsModality,
|
|
5
|
+
resolveModalityOverride,
|
|
6
|
+
} from "./input-modalities.js";
|
|
7
|
+
|
|
8
|
+
describe("catalogSupportsModality", () => {
|
|
9
|
+
test("text is always supported", () => {
|
|
10
|
+
expect(catalogSupportsModality("text", undefined)).toBe(true);
|
|
11
|
+
expect(catalogSupportsModality("text", { supportsVision: false })).toBe(
|
|
12
|
+
true,
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("image follows supportsVision and fails closed when unknown", () => {
|
|
17
|
+
expect(catalogSupportsModality("image", undefined)).toBe(false);
|
|
18
|
+
expect(catalogSupportsModality("image", { supportsVision: true })).toBe(
|
|
19
|
+
true,
|
|
20
|
+
);
|
|
21
|
+
expect(catalogSupportsModality("image", { supportsVision: false })).toBe(
|
|
22
|
+
false,
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("audio follows supportsAudioInput and fails closed when unknown", () => {
|
|
27
|
+
expect(catalogSupportsModality("audio", undefined)).toBe(false);
|
|
28
|
+
expect(
|
|
29
|
+
catalogSupportsModality("audio", { supportsAudioInput: true }),
|
|
30
|
+
).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("video has no catalog flag and fails closed", () => {
|
|
34
|
+
expect(
|
|
35
|
+
catalogSupportsModality("video", {
|
|
36
|
+
supportsVision: true,
|
|
37
|
+
supportsAudioInput: true,
|
|
38
|
+
}),
|
|
39
|
+
).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("resolveModalityOverride", () => {
|
|
44
|
+
test("untouched inherits the catalog value, including unknown", () => {
|
|
45
|
+
expect(resolveModalityOverride(undefined, true)).toBe(true);
|
|
46
|
+
expect(resolveModalityOverride(undefined, false)).toBe(false);
|
|
47
|
+
expect(resolveModalityOverride(undefined, undefined)).toBeUndefined();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("enabled and supported together reach the wire even when the catalog is unknown", () => {
|
|
51
|
+
expect(
|
|
52
|
+
resolveModalityOverride({ enabled: true, supported: true }, undefined),
|
|
53
|
+
).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("enabled without a support declaration inherits the catalog", () => {
|
|
57
|
+
expect(resolveModalityOverride({ enabled: true }, false)).toBe(false);
|
|
58
|
+
expect(resolveModalityOverride({ enabled: true }, undefined)).toBe(false);
|
|
59
|
+
expect(resolveModalityOverride({ enabled: true }, true)).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("disabled policy blocks a catalog-supported modality", () => {
|
|
63
|
+
expect(
|
|
64
|
+
resolveModalityOverride({ enabled: false, supported: true }, true),
|
|
65
|
+
).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test("supported: true without enabled defaults enabled to true", () => {
|
|
69
|
+
expect(resolveModalityOverride({ supported: true }, false)).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { PROVIDER_CATALOG } from "../providers/model-catalog.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Input modalities a profile can declare independently of the model catalog.
|
|
7
|
+
* Cataloged models keep today's flags; free-text / empty-catalog models use
|
|
8
|
+
* these overrides to say what the serving surface actually accepts.
|
|
9
|
+
*/
|
|
10
|
+
export const INPUT_MODALITIES = ["text", "image", "audio", "video"] as const;
|
|
11
|
+
export type InputModality = (typeof INPUT_MODALITIES)[number];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Per-modality policy + capability. Absent fields inherit catalog defaults
|
|
15
|
+
* (unknown models: unsupported, except text which is always supported).
|
|
16
|
+
*
|
|
17
|
+
* - `enabled`: whether this profile may use the modality.
|
|
18
|
+
* - `supported`: whether the model accepts the modality, overriding the catalog
|
|
19
|
+
* when set.
|
|
20
|
+
*/
|
|
21
|
+
export const ModalityOverrideSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
enabled: z.boolean().optional(),
|
|
24
|
+
supported: z.boolean().optional(),
|
|
25
|
+
})
|
|
26
|
+
.meta({ id: "ModalityOverride" });
|
|
27
|
+
export type ModalityOverride = z.infer<typeof ModalityOverrideSchema>;
|
|
28
|
+
|
|
29
|
+
export const InputModalitiesSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
text: ModalityOverrideSchema.optional(),
|
|
32
|
+
image: ModalityOverrideSchema.optional(),
|
|
33
|
+
audio: ModalityOverrideSchema.optional(),
|
|
34
|
+
video: ModalityOverrideSchema.optional(),
|
|
35
|
+
})
|
|
36
|
+
.meta({ id: "InputModalities" });
|
|
37
|
+
export type InputModalities = z.infer<typeof InputModalitiesSchema>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Catalog capability for a modality. Unknown models fail closed except text,
|
|
41
|
+
* which every chat profile can send.
|
|
42
|
+
*/
|
|
43
|
+
export function catalogSupportsModality(
|
|
44
|
+
modality: InputModality,
|
|
45
|
+
catalog: {
|
|
46
|
+
supportsVision?: boolean;
|
|
47
|
+
supportsAudioInput?: boolean;
|
|
48
|
+
} | undefined,
|
|
49
|
+
): boolean {
|
|
50
|
+
if (modality === "text") {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
if (modality === "image") {
|
|
54
|
+
return catalog?.supportsVision === true;
|
|
55
|
+
}
|
|
56
|
+
if (modality === "audio") {
|
|
57
|
+
return catalog?.supportsAudioInput === true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function catalogEntryFor(
|
|
63
|
+
provider: string,
|
|
64
|
+
model: string,
|
|
65
|
+
): { supportsVision?: boolean; supportsAudioInput?: boolean } | undefined {
|
|
66
|
+
const catalogProvider = PROVIDER_CATALOG.find((p) => p.id === provider);
|
|
67
|
+
return catalogProvider?.models.find((m) => m.id === model);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Resolve whether a modality should be sent on the wire.
|
|
72
|
+
*
|
|
73
|
+
* Untouched (no override for that row) inherits `catalogSupported`, which may
|
|
74
|
+
* be `undefined` when the catalog does not know the model. An authored
|
|
75
|
+
* override is always a boolean: both `enabled` and `supported` must be true,
|
|
76
|
+
* with missing leaves defaulting to enabled=true and supported=catalog.
|
|
77
|
+
*/
|
|
78
|
+
export function resolveModalityOverride(
|
|
79
|
+
override: ModalityOverride | undefined,
|
|
80
|
+
catalogSupported: boolean | undefined,
|
|
81
|
+
): boolean | undefined {
|
|
82
|
+
if (override == null) {
|
|
83
|
+
return catalogSupported;
|
|
84
|
+
}
|
|
85
|
+
const catalog = catalogSupported === true;
|
|
86
|
+
const enabled = override.enabled ?? true;
|
|
87
|
+
const supported = override.supported ?? catalog;
|
|
88
|
+
return enabled && supported;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function modalitiesOf(
|
|
92
|
+
entry: { inputModalities?: InputModalities | null } | undefined,
|
|
93
|
+
): InputModalities | undefined {
|
|
94
|
+
return entry?.inputModalities ?? undefined;
|
|
95
|
+
}
|
package/src/config/loader.ts
CHANGED
|
@@ -180,6 +180,8 @@ export function getDeploymentContextDefaults(): Record<string, unknown> {
|
|
|
180
180
|
"discord-oauth": managed,
|
|
181
181
|
"hubspot-oauth": managed,
|
|
182
182
|
"monday-oauth": managed,
|
|
183
|
+
"stripe-link-oauth": managed,
|
|
184
|
+
"figma-oauth": managed,
|
|
183
185
|
"eventbrite-oauth": managed,
|
|
184
186
|
"calendly-oauth": managed,
|
|
185
187
|
},
|
|
@@ -18,15 +18,22 @@ describe("MemoryV3ConfigSchema", () => {
|
|
|
18
18
|
perSeed: 3,
|
|
19
19
|
cap: 20,
|
|
20
20
|
},
|
|
21
|
-
spotlight: { n: 6, windowTurns: 2 },
|
|
22
21
|
needleK: 100,
|
|
23
22
|
denseK: 100,
|
|
24
23
|
replyQueryK: 12,
|
|
25
24
|
spanQueryK: 0,
|
|
25
|
+
finderSectionsPerPage: 3,
|
|
26
26
|
selectorEnabled: true,
|
|
27
27
|
selectorPromptPath: null,
|
|
28
28
|
edge: { hubDegree: 30, seedCount: 18, perSeed: 6, cap: 45 },
|
|
29
29
|
entity: { enabled: true, idfFloor: 4, cap: 8 },
|
|
30
|
+
rareTerm: {
|
|
31
|
+
enabled: true,
|
|
32
|
+
maxDf: 12,
|
|
33
|
+
maxDfFraction: 0.002,
|
|
34
|
+
perTerm: 2,
|
|
35
|
+
cap: 24,
|
|
36
|
+
},
|
|
30
37
|
gate: {
|
|
31
38
|
enabled: true,
|
|
32
39
|
denseThreshold: 0.66,
|
|
@@ -83,20 +90,13 @@ describe("MemoryV3ConfigSchema", () => {
|
|
|
83
90
|
).toThrow();
|
|
84
91
|
});
|
|
85
92
|
|
|
86
|
-
test("
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
).
|
|
93
|
-
expect(() => MemoryV3ConfigSchema.parse({ spotlight: { n: 0 } })).toThrow();
|
|
94
|
-
expect(() =>
|
|
95
|
-
MemoryV3ConfigSchema.parse({ spotlight: { windowTurns: -1 } }),
|
|
96
|
-
).toThrow();
|
|
97
|
-
expect(() =>
|
|
98
|
-
MemoryV3ConfigSchema.parse({ spotlight: { n: 1.5 } }),
|
|
99
|
-
).toThrow();
|
|
93
|
+
test("ignores the persisted `spotlight` sub-config", () => {
|
|
94
|
+
// Workspace migrations 117 and 119 seeded `memory.v3.spotlight` into
|
|
95
|
+
// config files; unknown-key stripping keeps them parsing.
|
|
96
|
+
const parsed = MemoryV3ConfigSchema.parse({
|
|
97
|
+
spotlight: { n: 3, windowTurns: 2 },
|
|
98
|
+
});
|
|
99
|
+
expect(parsed).not.toHaveProperty("spotlight");
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
test("accepts explicit lane-K overrides including zero", () => {
|
|
@@ -134,6 +134,49 @@ describe("MemoryV3ConfigSchema", () => {
|
|
|
134
134
|
expect(() => MemoryV3ConfigSchema.parse({ edge: { cap: -1 } })).toThrow();
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
+
test("accepts a partial rareTerm override, defaulting the rest", () => {
|
|
138
|
+
const parsed = MemoryV3ConfigSchema.parse({
|
|
139
|
+
rareTerm: { maxDf: 5, enabled: false },
|
|
140
|
+
});
|
|
141
|
+
expect(parsed.rareTerm).toEqual({
|
|
142
|
+
enabled: false,
|
|
143
|
+
maxDf: 5,
|
|
144
|
+
maxDfFraction: 0.002,
|
|
145
|
+
perTerm: 2,
|
|
146
|
+
cap: 24,
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test("rareTerm.maxDfFraction defaults to 0.002, takes a value in (0, 1], and rejects the rest", () => {
|
|
151
|
+
expect(MemoryV3ConfigSchema.parse({}).rareTerm.maxDfFraction).toBe(0.002);
|
|
152
|
+
expect(
|
|
153
|
+
MemoryV3ConfigSchema.parse({ rareTerm: { maxDfFraction: 0.05 } }).rareTerm
|
|
154
|
+
.maxDfFraction,
|
|
155
|
+
).toBe(0.05);
|
|
156
|
+
expect(
|
|
157
|
+
MemoryV3ConfigSchema.parse({ rareTerm: { maxDfFraction: 1 } }).rareTerm
|
|
158
|
+
.maxDfFraction,
|
|
159
|
+
).toBe(1);
|
|
160
|
+
for (const bad of [0, -0.001, 1.5]) {
|
|
161
|
+
expect(() =>
|
|
162
|
+
MemoryV3ConfigSchema.parse({ rareTerm: { maxDfFraction: bad } }),
|
|
163
|
+
).toThrow();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
test("rareTerm knobs must be positive integers and enabled a boolean", () => {
|
|
168
|
+
for (const key of ["maxDf", "perTerm", "cap"]) {
|
|
169
|
+
for (const bad of [0, -1, 1.5]) {
|
|
170
|
+
expect(() =>
|
|
171
|
+
MemoryV3ConfigSchema.parse({ rareTerm: { [key]: bad } }),
|
|
172
|
+
).toThrow();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
expect(() =>
|
|
176
|
+
MemoryV3ConfigSchema.parse({ rareTerm: { enabled: "yes" } }),
|
|
177
|
+
).toThrow();
|
|
178
|
+
});
|
|
179
|
+
|
|
137
180
|
test("accepts a partial gate override, defaulting the rest", () => {
|
|
138
181
|
const parsed = MemoryV3ConfigSchema.parse({
|
|
139
182
|
gate: { denseThreshold: 0.6 },
|
|
@@ -25,7 +25,7 @@ export const HeartbeatConfigSchema = z
|
|
|
25
25
|
.nullable()
|
|
26
26
|
.default(null)
|
|
27
27
|
.describe(
|
|
28
|
-
"Timezone for cron expression evaluation, e.g. 'America/New_York'.
|
|
28
|
+
"Timezone for cron expression and active-hours evaluation, e.g. 'America/New_York'. When null, uses the user's configured or detected timezone, then the host clock.",
|
|
29
29
|
),
|
|
30
30
|
activeHoursStart: z
|
|
31
31
|
.number({ error: "heartbeat.activeHoursStart must be a number" })
|
|
@@ -35,7 +35,7 @@ export const HeartbeatConfigSchema = z
|
|
|
35
35
|
.nullable()
|
|
36
36
|
.default(8)
|
|
37
37
|
.describe(
|
|
38
|
-
"Hour of the day (0-23) when heartbeat checks begin, or null to disable active hours restriction",
|
|
38
|
+
"Hour of the day (0-23) in the heartbeat timezone when heartbeat checks begin, or null to disable active hours restriction",
|
|
39
39
|
),
|
|
40
40
|
activeHoursEnd: z
|
|
41
41
|
.number({ error: "heartbeat.activeHoursEnd must be a number" })
|
|
@@ -45,7 +45,7 @@ export const HeartbeatConfigSchema = z
|
|
|
45
45
|
.nullable()
|
|
46
46
|
.default(22)
|
|
47
47
|
.describe(
|
|
48
|
-
"Hour of the day (0-23) when heartbeat checks stop, or null to disable active hours restriction",
|
|
48
|
+
"Hour of the day (0-23) in the heartbeat timezone when heartbeat checks stop, or null to disable active hours restriction",
|
|
49
49
|
),
|
|
50
50
|
maxConsecutiveRuns: z
|
|
51
51
|
.number({ error: "heartbeat.maxConsecutiveRuns must be a number" })
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
isBackupProfileKey,
|
|
19
19
|
isDefaultProfileKey,
|
|
20
20
|
} from "../default-profile-names.js";
|
|
21
|
+
import { InputModalitiesSchema } from "../input-modalities.js";
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Unified LLM configuration schema.
|
|
@@ -230,6 +231,29 @@ export const LLMCallSiteEnum = z.enum([
|
|
|
230
231
|
]);
|
|
231
232
|
export type LLMCallSite = z.infer<typeof LLMCallSiteEnum>;
|
|
232
233
|
|
|
234
|
+
const KNOWN_CALL_SITE_IDS = new Set<string>(LLMCallSiteEnum.options);
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Drop call-site keys the running enum does not know. A different assistant
|
|
238
|
+
* version may have written them. Rejecting those keys fails the whole
|
|
239
|
+
* `callSites` record and skips sibling `superRefine` checks, so the loader's
|
|
240
|
+
* strip-and-retry can then mis-report defined profiles as missing. GET /v1/config
|
|
241
|
+
* and `saveRawConfig` read the raw file, so the dropped keys stay on disk for
|
|
242
|
+
* a version that recognizes them.
|
|
243
|
+
*/
|
|
244
|
+
export function dropUnknownCallSiteKeys(value: unknown): unknown {
|
|
245
|
+
if (value == null || typeof value !== "object" || Array.isArray(value)) {
|
|
246
|
+
return value;
|
|
247
|
+
}
|
|
248
|
+
const out: Record<string, unknown> = {};
|
|
249
|
+
for (const [key, entry] of Object.entries(value as Record<string, unknown>)) {
|
|
250
|
+
if (KNOWN_CALL_SITE_IDS.has(key)) {
|
|
251
|
+
out[key] = entry;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return out;
|
|
255
|
+
}
|
|
256
|
+
|
|
233
257
|
// ---------------------------------------------------------------------------
|
|
234
258
|
// Effort, Speed & Verbosity
|
|
235
259
|
// ---------------------------------------------------------------------------
|
|
@@ -617,6 +641,13 @@ export const ProfileEntry = LLMConfigFragment.extend({
|
|
|
617
641
|
* a model the checks can vouch for never needs it.
|
|
618
642
|
*/
|
|
619
643
|
allowUnlisted: z.boolean().optional(),
|
|
644
|
+
/**
|
|
645
|
+
* Per-profile input-modality policy and capability overrides. Absent
|
|
646
|
+
* inherits the model catalog (unknown models fail closed at send time).
|
|
647
|
+
* `.nullable()` matches `label` so edit-mode PATCH can send `null` to
|
|
648
|
+
* clear a previously stored override.
|
|
649
|
+
*/
|
|
650
|
+
inputModalities: InputModalitiesSchema.nullable().optional(),
|
|
620
651
|
/**
|
|
621
652
|
* Absent means active. `.nullable()` matches `label` so the PUT route's
|
|
622
653
|
* "send `null` to clear" sentinel works for status too — a managed
|
|
@@ -897,13 +928,17 @@ export const LLMSchema = z
|
|
|
897
928
|
// Presentation-only order for named profiles. The resolver ignores this;
|
|
898
929
|
// clients use it to render profile pickers consistently.
|
|
899
930
|
profileOrder: z.array(z.string().min(1)).default([]),
|
|
900
|
-
// `partialRecord`
|
|
901
|
-
//
|
|
902
|
-
//
|
|
903
|
-
//
|
|
904
|
-
// are seeded into the user's on-disk config by
|
|
905
|
-
// schema level, so `LLMSchema.parse({})` yields an
|
|
906
|
-
|
|
931
|
+
// `partialRecord` keeps call-site keys optional. Unknown keys (written by
|
|
932
|
+
// another assistant version, or a typo) are dropped first so they do not
|
|
933
|
+
// fail the record parse. Fail-closing on those keys is how version skew
|
|
934
|
+
// takes down an otherwise valid `llm` block. Latency-optimized defaults
|
|
935
|
+
// for background call sites are seeded into the user's on-disk config by
|
|
936
|
+
// migration 040, not at schema level, so `LLMSchema.parse({})` yields an
|
|
937
|
+
// empty map.
|
|
938
|
+
callSites: z.preprocess(
|
|
939
|
+
dropUnknownCallSiteKeys,
|
|
940
|
+
z.partialRecord(LLMCallSiteEnum, LLMCallSiteConfig).default({}),
|
|
941
|
+
),
|
|
907
942
|
activeProfile: z.string().min(1).optional(),
|
|
908
943
|
// The profile the advisor role consults when spawned as a subagent (chosen
|
|
909
944
|
// under Models & Services). It is excluded from the chat-profile pickers so
|
|
@@ -1013,13 +1048,15 @@ export const LLMSchema = z
|
|
|
1013
1048
|
// --- Mix profile validation --------------------------------------------
|
|
1014
1049
|
// Config keys a mix profile must NOT also set (a mix only references other
|
|
1015
1050
|
// profiles + metadata). Derived from the fragment shape plus the
|
|
1016
|
-
// ProfileEntry-only `provider_connection
|
|
1017
|
-
// carries no config of its own, so it has no route to fall back from)
|
|
1018
|
-
// it can't drift if a new config field is added
|
|
1051
|
+
// ProfileEntry-only `provider_connection`, `fallbackProfile` (a mix
|
|
1052
|
+
// carries no config of its own, so it has no route to fall back from),
|
|
1053
|
+
// and `inputModalities` so it can't drift if a new config field is added
|
|
1054
|
+
// to `LLMConfigFragment`.
|
|
1019
1055
|
const MIX_DISALLOWED_CONFIG_KEYS = [
|
|
1020
1056
|
...Object.keys(LLMConfigFragment.shape),
|
|
1021
1057
|
"provider_connection",
|
|
1022
1058
|
"fallbackProfile",
|
|
1059
|
+
"inputModalities",
|
|
1023
1060
|
];
|
|
1024
1061
|
const mixProfileNames = new Set(
|
|
1025
1062
|
Object.entries(config.profiles ?? {})
|