@vellumai/assistant 0.10.11 → 0.10.12-dev.202607242227.e52a30c
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 +30 -21
- package/README.md +1 -1
- package/docs/architecture/memory.md +101 -630
- package/docs/architecture/security.md +7 -2
- package/docs/trusted-contact-access.md +29 -15
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/package.json +2 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/secret-detection.test.ts +449 -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/remote-web-pairing.ts +260 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/secret-detection.ts +468 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/package.json +2 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/secret-detection.test.ts +449 -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/remote-web-pairing.ts +260 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/secret-detection.ts +468 -0
- package/node_modules/@vellumai/gateway-client/src/__tests__/binding-strength-contract.test.ts +122 -0
- package/node_modules/@vellumai/gateway-client/src/binding-strength-contract.ts +155 -0
- package/node_modules/@vellumai/gateway-client/src/index.ts +14 -0
- package/node_modules/@vellumai/service-contracts/package.json +2 -0
- package/node_modules/@vellumai/service-contracts/src/__tests__/secret-detection.test.ts +449 -0
- package/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/service-contracts/src/remote-web-pairing.ts +260 -0
- package/node_modules/@vellumai/service-contracts/src/secret-detection.ts +468 -0
- package/node_modules/@vellumai/slack-text/src/index.test.ts +71 -0
- package/node_modules/@vellumai/slack-text/src/index.ts +67 -20
- package/openapi.yaml +168 -14
- package/package.json +1 -1
- package/scripts/build-plugin-api.ts +22 -2
- package/scripts/generate-openapi.ts +21 -110
- package/scripts/voice-ttft-spike.ts +241 -0
- package/src/__tests__/acp-session.test.ts +3 -3
- package/src/__tests__/agent-loop-mutable-latest-user-message.test.ts +7 -0
- package/src/__tests__/approval-cascade.test.ts +12 -12
- package/src/__tests__/approval-routes-http.test.ts +3 -3
- package/src/__tests__/approval-source-link.test.ts +208 -0
- package/src/__tests__/assistant-event-hub-self-exclusion.test.ts +16 -16
- package/src/__tests__/assistant-event-hub-targeted.test.ts +13 -11
- package/src/__tests__/assistant-event-hub.test.ts +13 -11
- package/src/__tests__/assistant-event.test.ts +12 -9
- package/src/__tests__/assistant-events-sse-shed.test.ts +4 -4
- package/src/__tests__/assistant-id-boundary-guard.test.ts +0 -58
- package/src/__tests__/assistant-stream-state.test.ts +5 -3
- package/src/__tests__/avatar-identity-sync.test.ts +3 -3
- package/src/__tests__/browser-fill-credential.test.ts +3 -3
- package/src/__tests__/btw-routes.test.ts +13 -2
- package/src/__tests__/call-setup-flow-name-capture.test.ts +65 -3
- package/src/__tests__/channel-approvals.test.ts +0 -27
- package/src/__tests__/channel-delivery-store.test.ts +141 -0
- package/src/__tests__/channel-guardian.test.ts +85 -512
- package/src/__tests__/channel-retry-sweep.test.ts +344 -2
- package/src/__tests__/channel-setup-panel-ack.test.ts +10 -14
- package/src/__tests__/chat-reveal-guard-priming.test.ts +28 -28
- package/src/__tests__/cli-memory-v2-reembed-skills.test.ts +2 -2
- package/src/__tests__/compaction-events.test.ts +8 -8
- package/src/__tests__/config-loader-backfill.test.ts +22 -22
- package/src/__tests__/config-loader-platform-defaults.test.ts +59 -31
- package/src/__tests__/config-model-image-provider.test.ts +20 -0
- package/src/__tests__/config-schema.test.ts +118 -4
- package/src/__tests__/config-set-platform-guard.test.ts +39 -24
- package/src/__tests__/config-sounds-sync.test.ts +4 -4
- package/src/__tests__/config-watcher-skill-reseed.test.ts +170 -176
- package/src/__tests__/context-search-agent-runner.test.ts +2 -0
- package/src/__tests__/context-search-memory-v2-source.test.ts +5 -5
- package/src/__tests__/conversation-agent-loop-disk-pressure.test.ts +2 -2
- package/src/__tests__/conversation-agent-loop-fatal-cleanup.test.ts +3 -3
- package/src/__tests__/conversation-agent-loop-handlers-max-tokens.test.ts +4 -4
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +12 -12
- package/src/__tests__/conversation-agent-loop.test.ts +29 -29
- package/src/__tests__/conversation-confirmation-signals.test.ts +14 -14
- package/src/__tests__/conversation-delete-missing-logs-db.test.ts +198 -0
- package/src/__tests__/conversation-delete-schedule-cleanup.test.ts +1 -1
- package/src/__tests__/conversation-fork-crud.test.ts +28 -22
- package/src/__tests__/conversation-fork-retrospective.test.ts +13 -10
- package/src/__tests__/conversation-history-web-search.test.ts +7 -0
- package/src/__tests__/conversation-key-store-disk-view.test.ts +5 -5
- package/src/__tests__/conversation-loop-db-lock-resilience.test.ts +5 -5
- package/src/__tests__/conversation-message-sync-tags.test.ts +4 -4
- package/src/__tests__/conversation-queue.test.ts +81 -81
- package/src/__tests__/conversation-retry-route.test.ts +72 -3
- package/src/__tests__/conversation-runtime-assembly.test.ts +27 -0
- package/src/__tests__/conversation-slash-queue.test.ts +11 -11
- package/src/__tests__/conversation-slash-unknown.test.ts +2 -2
- package/src/__tests__/conversation-speed-override.test.ts +2 -2
- package/src/__tests__/conversation-starter-routes.test.ts +2 -2
- package/src/__tests__/conversation-store-ephemeral.test.ts +182 -0
- package/src/__tests__/conversation-store.test.ts +4 -0
- package/src/__tests__/conversation-surface-state.test.ts +125 -0
- package/src/__tests__/conversation-surfaces-action-delivery.test.ts +22 -37
- package/src/__tests__/conversation-surfaces-activation-emit.test.ts +28 -29
- package/src/__tests__/conversation-surfaces-app-open.test.ts +52 -9
- package/src/__tests__/conversation-surfaces-data-persist.test.ts +8 -11
- package/src/__tests__/conversation-surfaces-deselection.test.ts +3 -9
- package/src/__tests__/conversation-surfaces-standalone-payloads.test.ts +9 -9
- package/src/__tests__/conversation-surfaces-standalone.test.ts +12 -12
- package/src/__tests__/conversation-surfaces-state-update.test.ts +154 -9
- package/src/__tests__/conversation-surfaces-table-action.test.ts +4 -5
- package/src/__tests__/conversation-surfaces-task-progress.test.ts +83 -65
- package/src/__tests__/conversation-sync-tags.test.ts +5 -5
- package/src/__tests__/conversation-tool-setup-app-refresh.test.ts +1 -5
- package/src/__tests__/conversation-tool-setup-attribution.test.ts +1 -5
- package/src/__tests__/conversation-usage.test.ts +27 -0
- package/src/__tests__/conversation-wait-for-idle.test.ts +2 -2
- package/src/__tests__/credential-broker-browser-fill.test.ts +2 -2
- package/src/__tests__/credential-broker-server-use.test.ts +2 -2
- package/src/__tests__/credential-broker.test.ts +1 -1
- package/src/__tests__/credential-routes.test.ts +167 -0
- package/src/__tests__/credential-security-invariants.test.ts +3 -1
- package/src/__tests__/credential-transcript-scrub.test.ts +550 -0
- package/src/__tests__/daemon-assistant-events.test.ts +15 -15
- package/src/__tests__/document-preview-surface-schema.test.ts +33 -0
- package/src/__tests__/dynamic-skill-background-guard.test.ts +102 -13
- package/src/__tests__/emit-event-signal.test.ts +6 -6
- package/src/__tests__/estimator-calibration.test.ts +26 -0
- package/src/__tests__/events-tail-route.test.ts +6 -4
- package/src/__tests__/external-plugin-loader.test.ts +94 -1
- package/src/__tests__/guardian-card-withdrawal.test.ts +57 -0
- package/src/__tests__/helpers/native-web-search-harness.ts +10 -10
- package/src/__tests__/host-browser-proxy.test.ts +1 -1
- package/src/__tests__/host-transfer-pending-interactions.test.ts +17 -19
- package/src/__tests__/image-credentials.test.ts +65 -8
- package/src/__tests__/inference-no-mode-boot-e2e.test.ts +0 -1
- package/src/__tests__/injector-pkb-v2-silenced.test.ts +37 -7
- package/src/__tests__/injector-v3-suppression.test.ts +7 -0
- package/src/__tests__/inline-skill-load-permissions.test.ts +29 -6
- package/src/__tests__/introduction-card-resolver.test.ts +55 -4
- package/src/__tests__/job-handler-registration-guard.test.ts +1 -0
- package/src/__tests__/lifecycle-memory-v2-seed.test.ts +20 -12
- package/src/__tests__/list-messages-page-latest.test.ts +2 -2
- package/src/__tests__/llm-context-resolution.test.ts +18 -0
- package/src/__tests__/llm-resolver-override-or-default.test.ts +22 -4
- package/src/__tests__/llm-usage-store.test.ts +116 -0
- package/src/__tests__/log-redact.test.ts +82 -0
- package/src/__tests__/managed-profile-guard.test.ts +66 -1
- package/src/__tests__/managed-skill-lifecycle.test.ts +2 -2
- package/src/__tests__/managed-store.test.ts +205 -0
- package/src/__tests__/media-generate-image.test.ts +62 -11
- package/src/__tests__/memory-retrieval-hook.test.ts +4 -4
- package/src/__tests__/memory-upsert-concurrency.test.ts +1 -1
- package/src/__tests__/mtime-cache.test.ts +88 -125
- package/src/__tests__/non-member-access-request.test.ts +87 -137
- package/src/__tests__/notification-deep-link.test.ts +12 -12
- package/src/__tests__/notification-vellum-adapter.test.ts +8 -8
- package/src/__tests__/openai-responses-prompt-cache.test.ts +27 -7
- package/src/__tests__/outbound-slack-persistence.test.ts +22 -23
- package/src/__tests__/pending-interactions-resolved-event.test.ts +6 -6
- package/src/__tests__/playbook-execution.test.ts +2 -2
- package/src/__tests__/playbook-tools.test.ts +2 -2
- package/src/__tests__/plugin-api-app-globals.test.ts +44 -0
- package/src/__tests__/plugin-api-shim.test.ts +52 -6
- package/src/__tests__/plugin-event-hub-facade.test.ts +18 -15
- package/src/__tests__/plugin-import-boundary-guard.test.ts +14 -8
- package/src/__tests__/plugin-import-boundary-reverse-guard.test.ts +0 -1
- package/src/__tests__/plugin-secret-pattern-contribution.test.ts +324 -0
- package/src/__tests__/plugin-secret-patterns.test.ts +234 -0
- package/src/__tests__/plugin-types.test.ts +3 -0
- package/src/__tests__/provider-commit-message-generator.test.ts +19 -0
- package/src/__tests__/provider-connections-backfill.test.ts +13 -0
- package/src/__tests__/provider-platform-proxy-integration.test.ts +0 -3
- package/src/__tests__/provider-registry-ollama.test.ts +1 -6
- package/src/__tests__/provider-usage-tracking.test.ts +33 -0
- package/src/__tests__/prune-old-conversations-job.test.ts +5 -0
- package/src/__tests__/qdrant-manager.test.ts +19 -0
- package/src/__tests__/rebuild-index-graph-nodes.test.ts +7 -1
- package/src/__tests__/record-persisted-seq-lock-resilience.test.ts +95 -0
- package/src/__tests__/request-secret-standalone-channel-gate.test.ts +3 -3
- package/src/__tests__/runtime-events-sse-bilingual.test.ts +7 -3
- package/src/__tests__/runtime-events-sse-parity.test.ts +10 -10
- package/src/__tests__/runtime-events-sse-reconnect.test.ts +48 -20
- package/src/__tests__/runtime-events-sse.test.ts +14 -5
- package/src/__tests__/safe-parse-surface-data.test.ts +25 -0
- package/src/__tests__/scaffold-managed-skill-tool.test.ts +68 -0
- package/src/__tests__/schedule-routes.test.ts +2 -2
- package/src/__tests__/schedule-store.test.ts +3 -3
- package/src/__tests__/script-proxy-connect-tunnel.test.ts +71 -0
- package/src/__tests__/secret-ingress.test.ts +137 -0
- package/src/__tests__/secret-prompt-log-hygiene.test.ts +3 -3
- package/src/__tests__/secret-prompter-channel-fallback.test.ts +3 -3
- package/src/__tests__/secret-response-routing.test.ts +3 -3
- package/src/__tests__/secret-routes-platform-proxy.test.ts +6 -3
- package/src/__tests__/secret-routes-scrub.test.ts +276 -0
- package/src/__tests__/secret-scanner.test.ts +121 -1
- package/src/__tests__/send-endpoint-busy.test.ts +7 -7
- package/src/__tests__/slack-channels-routes.test.ts +16 -5
- package/src/__tests__/slack-inbound-verification.test.ts +45 -20
- package/src/__tests__/slack-messaging-token-resolution.test.ts +6 -0
- package/src/__tests__/slack-notification-approval-card.test.ts +103 -20
- package/src/__tests__/slack-share-routes.test.ts +22 -16
- package/src/__tests__/slack-users-routes.test.ts +12 -5
- package/src/__tests__/starter-task-flow.test.ts +6 -3
- package/src/__tests__/subagent-call-site-routing.test.ts +2 -2
- package/src/__tests__/subagent-disposal.test.ts +10 -10
- package/src/__tests__/subagent-fork-notifications.test.ts +4 -4
- package/src/__tests__/subagent-fork-prompt-role.test.ts +3 -3
- package/src/__tests__/subagent-fork-spawn.test.ts +4 -4
- package/src/__tests__/subagent-manager-notify.test.ts +10 -10
- package/src/__tests__/subagent-spawn-and-await.test.ts +31 -14
- package/src/__tests__/subagent-tool-gate-mode.test.ts +1 -5
- package/src/__tests__/surface-type-registry-guard.test.ts +66 -0
- package/src/__tests__/sync-message-contract.test.ts +3 -3
- package/src/__tests__/task-memory-cleanup.test.ts +13 -11
- package/src/__tests__/tool-approval-handler.test.ts +25 -1
- package/src/__tests__/tool-approval-seed-content-blocks.test.ts +179 -96
- package/src/__tests__/tool-preview-lifecycle.test.ts +135 -30
- package/src/__tests__/tool-result-metadata-plumbing.test.ts +5 -5
- package/src/__tests__/tool-start-timestamp.test.ts +4 -4
- package/src/__tests__/trusted-contact-multichannel.test.ts +0 -4
- package/src/__tests__/ui-choice-copy-surfaces.test.ts +178 -25
- package/src/__tests__/ui-work-result-surface.test.ts +7 -19
- package/src/__tests__/voice-config-update.test.ts +92 -1
- package/src/__tests__/voice-scoped-grant-consumer.test.ts +6 -6
- package/src/__tests__/voice-session-bridge.test.ts +44 -44
- package/src/__tests__/worker-entrypoint-guards.test.ts +2 -0
- package/src/__tests__/workspace-migration-132-web-search-mode-to-provider.test.ts +239 -0
- package/src/__tests__/workspace-migration-133-collapse-provider-connections.test.ts +449 -0
- package/src/__tests__/workspace-migration-134-image-generation-mode-to-provider.test.ts +284 -0
- package/src/acp/__tests__/client-handler.test.ts +3 -3
- package/src/acp/__tests__/prepare-agent-env.test.ts +2 -2
- package/src/acp/__tests__/session-manager-persistence.test.ts +21 -21
- package/src/acp/__tests__/session-manager-resume.test.ts +18 -14
- package/src/acp/agent-process.ts +1 -1
- package/src/acp/client-handler.ts +26 -12
- package/src/acp/prepare-agent-env.ts +6 -4
- package/src/acp/session-manager.ts +39 -22
- package/src/api/events/app-files-changed.ts +20 -0
- package/src/api/events/assistant-status.ts +20 -0
- package/src/api/events/bookmark-created.ts +37 -0
- package/src/api/events/bookmark-deleted.ts +20 -0
- package/src/api/events/client-settings-update.ts +25 -0
- package/src/api/events/config-changed.ts +19 -0
- package/src/api/events/confirmation-state-changed.ts +37 -0
- package/src/api/events/contacts-changed.ts +19 -0
- package/src/api/events/context-compacted.ts +38 -0
- package/src/api/events/conversation-inference-profile-updated.ts +26 -0
- package/src/api/events/document-editor-show.ts +26 -0
- package/src/api/events/heartbeat-alert.ts +20 -0
- package/src/api/events/heartbeat-conversation-created.ts +23 -0
- package/src/api/events/host-app-control.ts +146 -0
- package/src/api/events/host-bash.ts +40 -0
- package/src/api/events/host-browser.ts +43 -0
- package/src/api/events/host-cu.ts +37 -0
- package/src/api/events/host-file.ts +65 -0
- package/src/api/events/host-transfer.ts +59 -0
- package/src/api/events/host-ui-snapshot.ts +46 -0
- package/src/api/events/memory-recalled.ts +59 -0
- package/src/api/events/memory-status.ts +29 -0
- package/src/api/events/message-steered.ts +21 -0
- package/src/api/events/model-info.ts +39 -0
- package/src/api/events/notification-conversation-created.ts +51 -0
- package/src/api/events/oauth-connect-result.ts +26 -0
- package/src/api/events/platform-disconnected.ts +21 -0
- package/src/api/events/recording.ts +68 -0
- package/src/api/events/schedule-conversation-created.ts +24 -0
- package/src/api/events/service-group-update-complete.ts +29 -0
- package/src/api/events/service-group-update-progress.ts +23 -0
- package/src/api/events/service-group-update-starting.ts +26 -0
- package/src/api/events/show-platform-login.ts +20 -0
- package/src/api/events/skill-state-changed.ts +23 -0
- package/src/api/events/sounds-config-updated.ts +21 -0
- package/src/api/events/subagent-event.ts +2 -2
- package/src/api/events/tool-input-delta.ts +30 -0
- package/src/api/events/ui-surface-undo-result.ts +27 -0
- package/src/api/index.ts +356 -0
- package/src/api/surfaces.ts +565 -3
- package/src/approvals/guardian-card-withdrawal.ts +53 -8
- package/src/approvals/guardian-decision-primitive.ts +24 -1
- package/src/approvals/guardian-request-resolvers.ts +38 -6
- package/src/background-wake/platform-client.test.ts +20 -0
- package/src/background-wake/platform-client.ts +17 -0
- package/src/calls/__tests__/voice-control-protocol.test.ts +20 -19
- package/src/calls/__tests__/voice-session-bridge.test.ts +441 -7
- package/src/calls/__tests__/voice-triage-escalate.test.ts +271 -63
- package/src/calls/call-controller.ts +27 -27
- package/src/calls/call-domain.ts +1 -1
- package/src/calls/call-setup-flow.ts +22 -5
- package/src/calls/fish-audio-client.ts +1 -1
- package/src/calls/voice-control-protocol.ts +17 -9
- package/src/calls/voice-session-bridge.ts +361 -24
- package/src/calls/voice-triage-escalate.ts +240 -75
- package/src/channels/slack-callback-url.ts +54 -0
- package/src/channels/types.ts +10 -7
- package/src/cli/commands/__tests__/credentials.test.ts +216 -0
- package/src/cli/commands/__tests__/keys.test.ts +189 -0
- package/src/cli/commands/__tests__/tts.test.ts +121 -1
- package/src/cli/commands/config.help.ts +6 -2
- package/src/cli/commands/config.ts +40 -4
- package/src/cli/commands/contacts.ts +1 -9
- package/src/cli/commands/credentials.help.ts +14 -1
- package/src/cli/commands/credentials.ts +12 -13
- package/src/cli/commands/db/__tests__/repair.test.ts +5 -2
- package/src/cli/commands/keys.help.ts +16 -1
- package/src/cli/commands/keys.ts +37 -12
- package/src/cli/commands/memory/index.help.ts +21 -8
- package/src/cli/commands/memory/memory-v2.ts +1 -1
- package/src/cli/commands/memory/memory-v3.ts +2 -2
- package/src/cli/commands/memory/nodes.ts +29 -4
- package/src/cli/commands/oauth/connect.ts +1 -1
- package/src/cli/commands/plugins.help.ts +6 -2
- package/src/cli/commands/plugins.ts +33 -18
- package/src/cli/commands/routes-worker.ts +102 -0
- package/src/cli/commands/routes.help.ts +49 -0
- package/src/cli/commands/routes.ts +6 -1
- package/src/cli/commands/tts.help.ts +33 -0
- package/src/cli/commands/tts.ts +80 -0
- package/src/cli/lib/__tests__/install-from-github.test.ts +106 -8
- package/src/cli/lib/__tests__/parse-github-plugin-spec.test.ts +60 -0
- package/src/cli/lib/__tests__/upgrade-plugin.test.ts +151 -6
- package/src/cli/lib/bundled-marketplace.json +25 -0
- package/src/cli/lib/install-from-github.ts +118 -10
- package/src/cli/lib/parse-github-plugin-spec.ts +73 -7
- package/src/cli/lib/upgrade-plugin.ts +76 -13
- package/src/cli/output.ts +9 -0
- package/src/cli/utils/inline-secret-guard.ts +35 -0
- package/src/cli.ts +2 -109
- package/src/config/__tests__/default-profile-catalog.test.ts +68 -9
- package/src/config/__tests__/deployment-context-defaults.test.ts +14 -2
- package/src/config/__tests__/profile-materialization.test.ts +11 -0
- package/src/config/__tests__/sync-gated-profiles.test.ts +3 -3
- package/src/config/bundled-skills/_shared/CLI_RETRIEVAL_PATTERN.md +1 -1
- package/src/config/bundled-skills/app-builder/references/CUSTOM_ROUTES.md +11 -2
- package/src/config/bundled-skills/image-studio/tools/media-generate-image.ts +13 -7
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-style.ts +3 -2
- package/src/config/bundled-skills/playbooks/tools/playbook-create.ts +5 -2
- package/src/config/bundled-skills/playbooks/tools/playbook-list.ts +5 -2
- package/src/config/bundled-skills/playbooks/tools/playbook-update.ts +5 -2
- package/src/config/bundled-skills/settings/TOOLS.json +3 -3
- package/src/config/bundled-skills/settings/tools/voice-config-update.ts +42 -14
- package/src/config/bundled-skills/skill-management/SKILL.md +5 -0
- package/src/config/bundled-skills/skill-management/TOOLS.json +8 -4
- package/src/config/call-site-defaults.ts +18 -8
- package/src/config/default-profile-catalog.ts +168 -81
- package/src/config/default-profile-names.ts +27 -0
- package/src/config/feature-flag-registry.json +26 -24
- package/src/config/llm-context-resolution.ts +11 -2
- package/src/config/llm-resolver.ts +32 -5
- package/src/config/loader.ts +12 -5
- package/src/config/managed-speech-defaults.ts +74 -30
- package/src/config/memory-v3-gate.test.ts +40 -0
- package/src/config/memory-v3-gate.ts +54 -0
- package/src/config/profile-materialization.ts +23 -2
- package/src/config/raw-config-utils.ts +1 -1
- package/src/config/schema.ts +6 -0
- package/src/config/schemas/__tests__/live-voice.test.ts +54 -0
- package/src/config/schemas/__tests__/user-routes.test.ts +23 -0
- package/src/config/schemas/api-rate-limit.ts +31 -0
- package/src/config/schemas/call-site-catalog.ts +7 -0
- package/src/config/schemas/live-voice.ts +73 -1
- package/src/config/schemas/llm.ts +92 -1
- package/src/config/schemas/memory-retrospective.ts +13 -0
- package/src/config/schemas/security.ts +8 -0
- package/src/config/schemas/services.ts +19 -7
- package/src/config/schemas/user-routes.ts +27 -0
- package/src/config/seed-inference-profiles.ts +6 -4
- package/src/config/types.ts +1 -0
- package/src/contacts/member-status.ts +21 -1
- package/src/context/estimator-calibration.ts +9 -2
- package/src/conversations/job-handlers/summarization.ts +3 -0
- package/src/credential-execution/prompted-credential.ts +24 -0
- package/src/daemon/__tests__/channel-ui-capability.test.ts +26 -0
- package/src/daemon/__tests__/conversation-surfaces-launch.test.ts +5 -9
- package/src/daemon/__tests__/embedding-reconcile.test.ts +2 -2
- package/src/daemon/__tests__/native-web-search-metadata.test.ts +5 -5
- package/src/daemon/__tests__/wake-conversation-ops-completion.test.ts +32 -2
- package/src/daemon/__tests__/web-search-status-text.test.ts +2 -2
- package/src/daemon/channel-ui-capability.ts +38 -8
- package/src/daemon/chat-credential-redaction.ts +36 -13
- package/src/daemon/config-watcher.ts +75 -79
- package/src/daemon/conversation-agent-loop-handlers.ts +107 -30
- package/src/daemon/conversation-agent-loop.ts +31 -39
- package/src/daemon/conversation-error.ts +2 -0
- package/src/daemon/conversation-lifecycle.ts +7 -24
- package/src/daemon/conversation-messaging.ts +25 -14
- package/src/daemon/conversation-notifiers.ts +2 -2
- package/src/daemon/conversation-process.ts +8 -6
- package/src/daemon/conversation-queue-manager.ts +7 -7
- package/src/daemon/conversation-registry.ts +14 -2
- package/src/daemon/conversation-runtime-assembly.ts +15 -10
- package/src/daemon/conversation-store.ts +14 -2
- package/src/daemon/conversation-surface-state.ts +212 -0
- package/src/daemon/conversation-surfaces.ts +238 -291
- package/src/daemon/conversation-tool-setup.ts +34 -15
- package/src/daemon/conversation-usage.ts +24 -14
- package/src/daemon/conversation.ts +18 -61
- package/src/daemon/credential-transcript-scrub.ts +482 -0
- package/src/daemon/doordash-steps.ts +50 -20
- package/src/daemon/embedding-reconcile.ts +4 -4
- package/src/daemon/external-plugins-bootstrap.ts +17 -0
- package/src/daemon/handlers/config-channels.ts +40 -134
- package/src/daemon/handlers/config-model.test.ts +2 -0
- package/src/daemon/handlers/config-model.ts +15 -7
- package/src/daemon/handlers/shared.ts +11 -1
- package/src/daemon/host-browser-proxy.ts +20 -13
- package/src/daemon/host-file-proxy.ts +5 -3
- package/src/daemon/host-proxy-base.ts +4 -4
- package/src/daemon/inflight-turn-registry.ts +65 -0
- package/src/daemon/lifecycle.ts +13 -0
- package/src/daemon/message-protocol.ts +17 -190
- package/src/daemon/message-types/computer-use.ts +8 -50
- package/src/daemon/message-types/conversations.ts +9 -462
- package/src/daemon/message-types/diagnostics.ts +1 -23
- package/src/daemon/message-types/host-app-control.ts +11 -133
- package/src/daemon/message-types/host-browser.ts +5 -27
- package/src/daemon/message-types/host-ui-snapshot.ts +6 -31
- package/src/daemon/message-types/messages.ts +1 -114
- package/src/daemon/message-types/notifications.ts +0 -38
- package/src/daemon/message-types/skills.ts +6 -151
- package/src/daemon/message-types/surfaces.ts +131 -395
- package/src/daemon/message-types/sync.ts +0 -2
- package/src/daemon/process-message.ts +5 -5
- package/src/daemon/shutdown-handlers.ts +5 -0
- package/src/daemon/skill-memory-refresh.ts +1 -1
- package/src/daemon/tool-setup-types.ts +12 -0
- package/src/daemon/tool-side-effects.ts +26 -13
- package/src/daemon/trust-context-types.ts +8 -0
- package/src/daemon/trust-context.ts +1 -1
- package/src/daemon/wake-conversation-ops.ts +21 -4
- package/src/embedded/plugin-api.ts +3 -1
- package/src/heartbeat/heartbeat-service.ts +45 -17
- package/src/home/conversation-starter-checkpoints.ts +2 -2
- package/src/home/job-handlers/conversation-starters.ts +15 -11
- package/src/hooks/registry.ts +3 -3
- package/src/hooks/types.ts +12 -0
- package/src/ipc/assistant-server.ts +5 -2
- package/src/ipc/routes/__tests__/conversation-sync-ipc-routes.test.ts +87 -5
- package/src/ipc/routes/__tests__/events-ipc-routes.test.ts +74 -0
- package/src/ipc/routes/__tests__/memory-v2-backfill.test.ts +1 -1
- package/src/ipc/routes/conversation-sync-ipc-routes.ts +16 -8
- package/src/ipc/routes/events-ipc-routes.ts +80 -0
- package/src/live-voice/__tests__/front-decision.test.ts +405 -76
- package/src/live-voice/__tests__/live-voice-connection.test.ts +271 -0
- package/src/live-voice/__tests__/live-voice-events.test.ts +7 -2
- package/src/live-voice/__tests__/live-voice-managed-speech-fallback.test.ts +245 -0
- package/src/live-voice/__tests__/live-voice-metrics.test.ts +29 -1
- package/src/live-voice/__tests__/live-voice-progress.test.ts +757 -0
- package/src/live-voice/__tests__/live-voice-triage-escalate.test.ts +76 -48
- package/src/live-voice/__tests__/live-voice-tts-session.test.ts +8 -8
- package/src/live-voice/__tests__/live-voice-tts.test.ts +1 -0
- package/src/live-voice/__tests__/live-voice-vad.test.ts +360 -2
- package/src/live-voice/__tests__/runtime-websocket-shell.test.ts +1 -0
- package/src/live-voice/ack-phrases.ts +23 -5
- package/src/live-voice/front-decision.ts +222 -44
- package/src/live-voice/live-voice-connection.ts +225 -0
- package/src/live-voice/live-voice-credential-preflight.ts +39 -28
- package/src/live-voice/live-voice-manager.ts +53 -0
- package/src/live-voice/live-voice-metrics.ts +65 -7
- package/src/live-voice/live-voice-session-manager.ts +1 -0
- package/src/live-voice/live-voice-session.ts +1033 -121
- package/src/live-voice/live-voice-tts.ts +8 -1
- package/src/live-voice/protocol.ts +6 -0
- package/src/mcp/__tests__/mcp-oauth-provider.test.ts +75 -0
- package/src/mcp/mcp-oauth-provider.ts +59 -1
- package/src/media/app-icon-generator.ts +15 -8
- package/src/media/avatar-router.ts +9 -5
- package/src/media/image-credentials.ts +42 -10
- package/src/media/image-service.ts +1 -13
- package/src/media/types.ts +26 -3
- package/src/messaging/channel-binding-schema.ts +6 -2
- package/src/messaging/providers/slack/__tests__/adapter-token-routing.test.ts +4 -0
- package/src/messaging/providers/slack/__tests__/auth.test.ts +74 -0
- package/src/messaging/providers/slack/adapter.ts +17 -23
- package/src/messaging/providers/slack/approval-source.ts +87 -0
- package/src/messaging/providers/slack/auth.ts +78 -0
- package/src/messaging/providers/slack/deep-link.ts +45 -8
- package/src/messaging/providers/slack/message-metadata.ts +16 -0
- package/src/messaging/providers/slack/withdraw.test.ts +71 -0
- package/src/messaging/providers/slack/withdraw.ts +53 -5
- package/src/messaging/providers/telegram-bot/send.test.ts +88 -0
- package/src/messaging/providers/telegram-bot/send.ts +43 -3
- package/src/messaging/providers/telegram-bot/transport.ts +26 -8
- package/src/monitoring/recovery/__tests__/orphaned-channel-events.test.ts +144 -0
- package/src/monitoring/recovery/orphaned-channel-events.ts +72 -0
- package/src/monitoring/recovery/run-recovery.ts +2 -0
- package/src/notifications/AGENTS.md +2 -0
- package/src/notifications/access-request-copy.ts +10 -21
- package/src/notifications/adapters/macos.ts +3 -3
- package/src/notifications/adapters/slack.ts +73 -13
- package/src/notifications/approval-card-data.ts +58 -16
- package/src/notifications/broadcaster.ts +41 -19
- package/src/notifications/guardian-question-mode.ts +81 -0
- package/src/notifications/types.ts +5 -0
- package/src/oauth/AGENTS.md +1 -1
- package/src/outbound-proxy/connect-tunnel.ts +19 -0
- package/src/permissions/checker.test.ts +7 -0
- package/src/permissions/checker.ts +18 -21
- package/src/permissions/confirmation-guardian-request.test.ts +2 -2
- package/src/permissions/confirmation-guardian-request.ts +19 -3
- package/src/permissions/prompter.ts +8 -5
- package/src/permissions/question-prompter.test.ts +8 -8
- package/src/permissions/secret-prompter.ts +2 -2
- package/src/persistence/__tests__/conversation-queries-search.test.ts +40 -0
- package/src/persistence/conversation-bootstrap.ts +11 -0
- package/src/persistence/conversation-crud.ts +152 -45
- package/src/persistence/conversation-queries.ts +29 -9
- package/src/persistence/conversation-title-service.ts +39 -2
- package/src/persistence/db-connection.ts +34 -5
- package/src/persistence/delivery-crud.ts +88 -5
- package/src/persistence/delivery-status.ts +60 -2
- package/src/persistence/embeddings/__tests__/messages-lexical-index.test.ts +45 -0
- package/src/persistence/embeddings/graph-node-orphan-sweep.ts +9 -3
- package/src/persistence/embeddings/messages-lexical-index.ts +73 -0
- package/src/persistence/embeddings/qdrant-manager.ts +67 -21
- package/src/persistence/external-conversation-store.ts +22 -0
- package/src/persistence/job-handlers/cleanup.ts +14 -2
- package/src/persistence/jobs-store.ts +4 -0
- package/src/persistence/llm-usage-store.ts +69 -2
- package/src/persistence/message-content-file.ts +25 -15
- package/src/persistence/migrations/340-sweep-orphaned-graph-node-vectors.test.ts +16 -0
- package/src/persistence/migrations/341-sweep-cacheless-graph-node-vectors.test.ts +5 -8
- package/src/persistence/migrations/342-add-conversation-parent-id.test.ts +141 -0
- package/src/persistence/migrations/342-add-conversation-parent-id.ts +46 -0
- package/src/persistence/migrations/343-move-activation-state-to-memory-db.ts +74 -0
- package/src/persistence/migrations/344-move-conversation-graph-memory-state-to-memory-db.ts +66 -0
- package/src/persistence/migrations/345-move-memory-v3-ever-injected-to-memory-db.ts +62 -0
- package/src/persistence/migrations/346-move-memory-retrospective-state-to-memory-db.ts +67 -0
- package/src/persistence/migrations/347-delete-stray-greeting-conversation.ts +46 -0
- package/src/persistence/migrations/348-memory-summaries-scope-updated-index.ts +25 -0
- package/src/persistence/migrations/349-move-memory-graph-tables-to-memory-db.ts +227 -0
- package/src/persistence/migrations/350-conversations-total-input-tokens-nullable.ts +77 -0
- package/src/persistence/migrations/__tests__/347-delete-stray-greeting-conversation.test.ts +100 -0
- package/src/persistence/migrations/__tests__/350-conversations-total-input-tokens-nullable.test.ts +75 -0
- package/src/persistence/raw-query.ts +14 -0
- package/src/persistence/real-user-turn-filter.ts +26 -0
- package/src/persistence/schema/bookmarks.ts +1 -2
- package/src/persistence/schema/conversations.ts +20 -4
- package/src/persistence/schema/memory-core.ts +3 -0
- package/src/persistence/schema/memory-graph.ts +3 -0
- package/src/persistence/schema/memory-injection.ts +3 -1
- package/src/persistence/steps.ts +76 -0
- package/src/playbooks/playbook-compiler.ts +5 -2
- package/src/plugin-api/__tests__/publish-event.test.ts +54 -0
- package/src/plugin-api/app-globals.d.ts +84 -0
- package/src/plugin-api/constants.ts +2 -0
- package/src/plugin-api/conversation-turn.ts +4 -4
- package/src/plugin-api/event-hub-facade.ts +6 -4
- package/src/plugin-api/index.ts +55 -1
- package/src/plugin-api/publish-event.ts +39 -0
- package/src/plugin-api/transcription-session.test.ts +54 -0
- package/src/plugin-api/transcription-session.ts +39 -0
- package/src/plugin-api/types.ts +2 -0
- package/src/plugin-api/vision-support.test.ts +12 -0
- package/src/plugin-api/vision-support.ts +7 -1
- package/src/plugins/AGENTS.md +1 -2
- package/src/plugins/defaults/image-fallback/src/vision-caption.ts +1 -0
- package/src/plugins/defaults/index.ts +2 -0
- package/src/plugins/defaults/main.ts +64 -14
- package/src/plugins/defaults/memory/__tests__/conversation-memory-orphan-sweep.test.ts +91 -0
- package/src/plugins/defaults/memory/__tests__/conversation-memory-purge.test.ts +123 -0
- package/src/plugins/defaults/memory/__tests__/db-memory-attach.test.ts +14 -3
- package/src/plugins/defaults/memory/__tests__/jobs-worker-retrospective-sweep.test.ts +135 -0
- package/src/plugins/defaults/memory/__tests__/jobs-worker-v2-schedule.test.ts +72 -2
- package/src/plugins/defaults/memory/__tests__/memory-log-stores-degraded.test.ts +19 -39
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-job.test.ts +13 -0
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-state.test.ts +55 -40
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-sweep.test.ts +251 -0
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-trigger-check.test.ts +6 -2
- package/src/plugins/defaults/memory/__tests__/memory-v2-concept-frequency.test.ts +1 -1
- package/src/plugins/defaults/memory/__tests__/relocated-memory-test-rows.ts +103 -0
- package/src/plugins/defaults/memory/__tests__/table-relocation.test.ts +439 -0
- package/src/plugins/defaults/memory/__tests__/tools-delete-memory-page.test.ts +1 -1
- package/src/plugins/defaults/memory/context-search/agent-runner.ts +2 -0
- package/src/plugins/defaults/memory/context-search/sources/memory-v2.ts +5 -5
- package/src/plugins/defaults/memory/context-search/sources/memory.ts +2 -1
- package/src/plugins/defaults/memory/conversation-memory-orphan-sweep.ts +130 -0
- package/src/plugins/defaults/memory/conversation-memory-purge.ts +76 -0
- package/src/plugins/defaults/memory/fork-conversation-memory.ts +16 -14
- package/src/plugins/defaults/memory/graph/__tests__/conversation-graph-memory-v2-routing.test.ts +31 -9
- package/src/plugins/defaults/memory/graph/__tests__/handle-remember-v2.test.ts +23 -39
- package/src/plugins/defaults/memory/graph/bootstrap.test.ts +22 -0
- package/src/plugins/defaults/memory/graph/bootstrap.ts +7 -3
- package/src/plugins/defaults/memory/graph/capability-seed.ts +14 -10
- package/src/plugins/defaults/memory/graph/consolidation.ts +11 -3
- package/src/plugins/defaults/memory/graph/conversation-graph-memory.ts +32 -32
- package/src/plugins/defaults/memory/graph/decay.ts +3 -2
- package/src/plugins/defaults/memory/graph/extraction.ts +8 -0
- package/src/plugins/defaults/memory/graph/graph-memory-state-store.ts +13 -8
- package/src/plugins/defaults/memory/graph/graph-search.ts +9 -7
- package/src/plugins/defaults/memory/graph/retriever.test.ts +7 -11
- package/src/plugins/defaults/memory/graph/retriever.ts +25 -5
- package/src/plugins/defaults/memory/graph/store.test.ts +4 -6
- package/src/plugins/defaults/memory/graph/store.ts +43 -22
- package/src/plugins/defaults/memory/graph/tool-handlers.test.ts +28 -5
- package/src/plugins/defaults/memory/graph/tool-handlers.ts +46 -65
- package/src/plugins/defaults/memory/graph/tools.ts +13 -14
- package/src/plugins/defaults/memory/graph/types.test.ts +91 -0
- package/src/plugins/defaults/memory/graph/types.ts +47 -0
- package/src/plugins/defaults/memory/graph-topology/__tests__/build-memory-graph.test.ts +1 -1
- package/src/plugins/defaults/memory/graph-topology/build-memory-graph.ts +48 -40
- package/src/plugins/defaults/memory/graph-topology/pending-buffer.test.ts +181 -0
- package/src/plugins/defaults/memory/graph-topology/pending-buffer.ts +235 -0
- package/src/plugins/defaults/memory/hooks/conversation-deleted.ts +18 -9
- package/src/plugins/defaults/memory/hooks/conversations-cleared.ts +25 -0
- package/src/plugins/defaults/memory/hooks/user-prompt-submit.ts +2 -2
- package/src/plugins/defaults/memory/indexer.ts +22 -21
- package/src/plugins/defaults/memory/injectors.ts +15 -10
- package/src/plugins/defaults/memory/job-handler-registration.ts +5 -5
- package/src/plugins/defaults/memory/job-handlers/index-maintenance.ts +24 -17
- package/src/plugins/defaults/memory/job-handlers.ts +11 -5
- package/src/plugins/defaults/memory/jobs/__tests__/embed-concept-page.test.ts +2 -2
- package/src/plugins/defaults/memory/jobs/embed-concept-page.ts +3 -3
- package/src/plugins/defaults/memory/jobs/embed-pkb-file.ts +7 -6
- package/src/plugins/defaults/memory/jobs-worker.ts +155 -46
- package/src/plugins/defaults/memory/memory-db.ts +18 -1
- package/src/plugins/defaults/memory/memory-retrospective-enqueue.ts +14 -6
- package/src/plugins/defaults/memory/memory-retrospective-prompt.ts +4 -2
- package/src/plugins/defaults/memory/memory-retrospective-state.ts +93 -50
- package/src/plugins/defaults/memory/memory-retrospective-sweep.ts +234 -0
- package/src/plugins/defaults/memory/memory-v2-concept-frequency.ts +1 -1
- package/src/plugins/defaults/memory/pkb/pkb-search.ts +5 -4
- package/src/plugins/defaults/memory/search/semantic.ts +6 -4
- package/src/plugins/defaults/memory/{routes → src}/__tests__/memory-v2-routes.test.ts +2 -2
- package/src/plugins/defaults/memory/{routes → src}/__tests__/memory-v2-simulate-route.test.ts +4 -3
- package/src/plugins/defaults/memory/{routes → src}/memory-item-routes.test.ts +195 -9
- package/src/plugins/defaults/memory/{routes → src}/memory-item-routes.ts +136 -20
- package/src/plugins/defaults/memory/{routes → src}/memory-v2-routes.ts +20 -18
- package/src/plugins/defaults/memory/{routes → src}/memory-v3-routes.ts +3 -2
- package/src/plugins/defaults/memory/startup.ts +16 -14
- package/src/plugins/defaults/memory/task-memory-cleanup.ts +94 -25
- package/src/plugins/defaults/memory/tools.test.ts +29 -55
- package/src/plugins/defaults/memory/tools.ts +9 -8
- package/src/plugins/defaults/memory/v2/__tests__/activation-store.test.ts +89 -21
- package/src/plugins/defaults/memory/v2/__tests__/activation.test.ts +4 -3
- package/src/plugins/defaults/memory/v2/__tests__/backfill-jobs.test.ts +8 -7
- package/src/plugins/defaults/memory/v2/__tests__/injection.test.ts +36 -97
- package/src/plugins/defaults/memory/v2/__tests__/reranker.test.ts +2 -2
- package/src/plugins/defaults/memory/v2/__tests__/router.test.ts +4 -3
- package/src/plugins/defaults/memory/v2/activation-store.ts +48 -27
- package/src/plugins/defaults/memory/v2/activation.ts +8 -5
- package/src/plugins/defaults/memory/v2/backfill-jobs.ts +16 -7
- package/src/plugins/defaults/memory/v2/harness/replay-input.ts +1 -1
- package/src/plugins/defaults/memory/v2/harness/retriever.ts +1 -1
- package/src/plugins/defaults/memory/v2/injection.ts +18 -24
- package/src/plugins/defaults/memory/v2/migration.ts +9 -7
- package/src/plugins/defaults/memory/v2/reranker.ts +1 -1
- package/src/plugins/defaults/memory/v2/router.ts +10 -4
- package/src/plugins/defaults/memory/v3/__tests__/candidate-match.test.ts +2 -2
- package/src/plugins/defaults/memory/v3/__tests__/capabilities.test.ts +42 -15
- package/src/plugins/defaults/memory/v3/__tests__/carry-integration.test.ts +11 -7
- package/src/plugins/defaults/memory/v3/__tests__/edge.test.ts +1 -1
- package/src/plugins/defaults/memory/v3/__tests__/injection.test.ts +29 -2
- package/src/plugins/defaults/memory/v3/__tests__/live-integration.test.ts +16 -3
- package/src/plugins/defaults/memory/v3/__tests__/maintain-job.test.ts +10 -3
- package/src/plugins/defaults/memory/v3/__tests__/orchestrate.test.ts +1 -1
- package/src/plugins/defaults/memory/v3/__tests__/shadow-integration.test.ts +1 -1
- package/src/plugins/defaults/memory/v3/__tests__/shadow-plugin.test.ts +96 -18
- package/src/plugins/defaults/memory/v3/candidate-match.ts +2 -2
- package/src/plugins/defaults/memory/v3/capabilities.ts +69 -25
- package/src/plugins/defaults/memory/v3/card.ts +1 -1
- package/src/plugins/defaults/memory/v3/edge.ts +1 -1
- package/src/plugins/defaults/memory/v3/ever-injected-store.test.ts +74 -24
- package/src/plugins/defaults/memory/v3/ever-injected-store.ts +214 -115
- package/src/plugins/defaults/memory/v3/injector.ts +4 -0
- package/src/plugins/defaults/memory/v3/lanes-version-store.test.ts +62 -0
- package/src/plugins/defaults/memory/v3/lanes-version-store.ts +91 -0
- package/src/plugins/defaults/memory/v3/maintain-job.ts +3 -3
- package/src/plugins/defaults/memory/v3/page-content.ts +5 -5
- package/src/plugins/defaults/memory/v3/pool-select.ts +1 -0
- package/src/plugins/defaults/memory/v3/prune.test.ts +4 -2
- package/src/plugins/defaults/memory/v3/prune.ts +4 -4
- package/src/plugins/defaults/memory/v3/selection-log-store.ts +1 -1
- package/src/plugins/defaults/memory/v3/shadow-plugin.ts +90 -25
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/cli-command-store.test.ts +4 -4
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/consolidation-job.test.ts +33 -6
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/consolidation-prompt-flag-gating-guard.test.ts +8 -0
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/frontmatter-sweep.test.ts +2 -2
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/memory-v2-startup.test.ts +4 -4
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/page-index.test.ts +35 -0
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/page-store.test.ts +38 -0
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/prompts-consolidation.test.ts +135 -2
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/qdrant.test.ts +8 -5
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/sim.test.ts +11 -8
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/skill-content.test.ts +1 -1
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/skill-store.test.ts +8 -8
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/sparse-bm25.test.ts +1 -1
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/static-context.test.ts +3 -3
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/sweep-job.test.ts +7 -5
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/cli-command-content.ts +24 -1
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/cli-command-store.ts +5 -5
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/consolidation-job.ts +30 -12
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/frontmatter-sweep.ts +7 -6
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/memory-v2-startup.test.ts +11 -4
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/memory-v2-startup.ts +14 -13
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/page-index.ts +46 -3
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/page-store.ts +25 -3
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/prompts/consolidation.ts +118 -22
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/qdrant.ts +5 -5
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/sim.ts +5 -5
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/skill-content.ts +1 -1
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/skill-store.ts +5 -5
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/sparse-bm25.ts +2 -2
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/static-context.ts +9 -8
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/sweep-job.ts +15 -14
- package/src/plugins/defaults/memory/{v2 → v3/substrate}/types.ts +4 -0
- package/src/plugins/defaults/memory/v3-eval/eval-packets.ts +2 -2
- package/src/plugins/defaults/platform-hosted/__tests__/reengage.test.ts +109 -12
- package/src/plugins/defaults/platform-hosted/routes/reengage.ts +110 -12
- package/src/plugins/ensure-plugin-api-shim.ts +31 -2
- package/src/plugins/external-plugin-loader.ts +73 -3
- package/src/plugins/mtime-cache.ts +168 -140
- package/src/plugins/types.ts +23 -2
- package/src/prompts/templates/system-sections.ts +5 -1
- package/src/providers/__tests__/dispatch-connection-routing.test.ts +182 -2
- package/src/providers/__tests__/preflight-resolved-config.test.ts +88 -0
- package/src/providers/__tests__/registry-native-web-search.test.ts +0 -2
- package/src/providers/__tests__/retry-callsite.test.ts +25 -0
- package/src/providers/__tests__/satellite-connection-routing.test.ts +1 -1
- package/src/providers/__tests__/search-provider-catalog.test.ts +6 -0
- package/src/providers/anthropic/client.ts +11 -9
- package/src/providers/call-site-routing.ts +29 -0
- package/src/providers/connection-resolution.ts +36 -37
- package/src/providers/inference/__tests__/connections-credential-normalize.test.ts +87 -0
- package/src/providers/inference/__tests__/credential-slot-repair.test.ts +138 -0
- package/src/providers/inference/auth.ts +20 -0
- package/src/providers/inference/backfill.ts +12 -1
- package/src/providers/inference/connections.ts +30 -14
- package/src/providers/inference/credential-slot-repair.ts +110 -0
- package/src/providers/model-catalog.ts +81 -0
- package/src/providers/openai/__tests__/chat-completions-provider-reasoning.test.ts +39 -0
- package/src/providers/openai/chat-completions-provider.ts +7 -1
- package/src/providers/openai/responses-provider.ts +13 -4
- package/src/providers/provider-send-message.ts +12 -1
- package/src/providers/registry.ts +19 -5
- package/src/providers/retry.ts +5 -3
- package/src/providers/routing-identity.ts +99 -0
- package/src/providers/search-provider-catalog.ts +14 -4
- package/src/providers/speech-to-text/resolve.ts +25 -23
- package/src/providers/types.ts +7 -0
- package/src/providers/usage-tracking.ts +1 -1
- package/src/routes/__tests__/control.test.ts +100 -0
- package/src/routes/__tests__/route-host.test.ts +203 -0
- package/src/routes/control.ts +127 -0
- package/src/routes/route-host-client.ts +289 -0
- package/src/routes/route-host-protocol.ts +46 -0
- package/src/routes/worker.ts +235 -0
- package/src/runtime/AGENTS.md +9 -1
- package/src/runtime/access-request-helper.ts +71 -58
- package/src/runtime/agent-wake.ts +15 -31
- package/src/runtime/approval-source-link.ts +107 -0
- package/src/runtime/assistant-event-hub.ts +18 -18
- package/src/runtime/assistant-event.ts +23 -11
- package/src/runtime/assistant-stream-state.ts +4 -4
- package/src/runtime/channel-approval-types.ts +22 -0
- package/src/runtime/channel-approvals.ts +0 -25
- package/src/runtime/channel-retry-sweep.ts +200 -22
- package/src/runtime/confirmation-request-guardian-bridge.ts +9 -0
- package/src/runtime/guardian-action-service.ts +14 -1
- package/src/runtime/http-server.ts +35 -182
- package/src/runtime/http-types.ts +2 -2
- package/src/runtime/introduction-policy.test.ts +8 -0
- package/src/runtime/introduction-policy.ts +37 -56
- package/src/runtime/middleware/__tests__/rate-limiter.test.ts +53 -1
- package/src/runtime/middleware/rate-limiter.ts +53 -9
- package/src/runtime/routes/__tests__/browser-tabs-routes.test.ts +35 -0
- package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +28 -0
- package/src/runtime/routes/__tests__/default-plugin-routes.test.ts +115 -23
- package/src/runtime/routes/__tests__/defer-routes.test.ts +39 -0
- package/src/runtime/routes/__tests__/events-routes.test.ts +40 -0
- package/src/runtime/routes/__tests__/global-search-routes.test.ts +170 -0
- package/src/runtime/routes/__tests__/inference-profiles-routes.test.ts +67 -3
- package/src/runtime/routes/__tests__/inference-provider-connection-routes.test.ts +160 -0
- package/src/runtime/routes/__tests__/mcp-auth-routes.test.ts +69 -0
- package/src/runtime/routes/__tests__/route-host-worker-routes.test.ts +121 -0
- package/src/runtime/routes/__tests__/route-tags-guard.test.ts +26 -0
- package/src/runtime/routes/__tests__/sequence-routes.test.ts +56 -0
- package/src/runtime/routes/__tests__/suggest-trust-rule-routes.test.ts +29 -0
- package/src/runtime/routes/__tests__/ui-request-routes.test.ts +37 -0
- package/src/runtime/routes/__tests__/user-route-dispatcher-host.test.ts +210 -0
- package/src/runtime/routes/__tests__/user-route-dispatcher.test.ts +17 -13
- package/src/runtime/routes/__tests__/user-routes-cli.test.ts +43 -0
- package/src/runtime/routes/__tests__/watcher-routes.test.ts +42 -0
- package/src/runtime/routes/acp-routes-event-log.test.ts +17 -11
- package/src/runtime/routes/acp-routes.ts +2 -2
- package/src/runtime/routes/brain-graph-routes.ts +11 -11
- package/src/runtime/routes/browser-tabs-routes.ts +2 -1
- package/src/runtime/routes/btw-routes.ts +9 -2
- package/src/runtime/routes/canned-message-complete.ts +2 -2
- package/src/runtime/routes/chatgpt-subscription-auth-routes.ts +2 -1
- package/src/runtime/routes/consolidation-routes.ts +12 -13
- package/src/runtime/routes/content-source-routes.ts +1 -0
- package/src/runtime/routes/conversation-management-routes.ts +11 -5
- package/src/runtime/routes/conversation-query-routes.ts +120 -28
- package/src/runtime/routes/conversation-routes.ts +16 -3
- package/src/runtime/routes/credential-routes.ts +33 -0
- package/src/runtime/routes/debug-routes.ts +2 -2
- package/src/runtime/routes/defer-routes.ts +7 -4
- package/src/runtime/routes/events-routes.ts +2 -1
- package/src/runtime/routes/filing-routes.ts +5 -2
- package/src/runtime/routes/global-search-routes.ts +76 -10
- package/src/runtime/routes/guardian-approval-prompt.ts +2 -2
- package/src/runtime/routes/identity-routes.ts +87 -31
- package/src/runtime/routes/image-generation-routes.ts +12 -9
- package/src/runtime/routes/inbound-conversation.ts +19 -3
- package/src/runtime/routes/inbound-message-handler.ts +200 -82
- package/src/runtime/routes/inbound-stages/acl-enforcement.test.ts +60 -52
- package/src/runtime/routes/inbound-stages/acl-enforcement.ts +25 -40
- package/src/runtime/routes/inbound-stages/background-dispatch.test.ts +157 -94
- package/src/runtime/routes/inbound-stages/background-dispatch.ts +95 -87
- package/src/runtime/routes/inbound-stages/channel-turn-admission.test.ts +141 -0
- package/src/runtime/routes/inbound-stages/channel-turn-admission.ts +111 -0
- package/src/runtime/routes/inbound-stages/inbound-content-prep.test.ts +53 -0
- package/src/runtime/routes/inbound-stages/inbound-content-prep.ts +64 -0
- package/src/runtime/routes/index.ts +10 -6
- package/src/runtime/routes/inference-profiles-routes.ts +53 -2
- package/src/runtime/routes/inference-provider-connection-routes.ts +101 -6
- package/src/runtime/routes/integrations/slack/__tests__/{share.test.ts → token-routing.test.ts} +52 -49
- package/src/runtime/routes/integrations/slack/channels.ts +109 -84
- package/src/runtime/routes/integrations/slack/share.ts +12 -6
- package/src/runtime/routes/integrations/slack/users.ts +6 -4
- package/src/runtime/routes/live-voice-routes.test.ts +73 -0
- package/src/runtime/routes/live-voice-routes.ts +65 -0
- package/src/runtime/routes/log-export/AGENTS.md +24 -0
- package/src/runtime/routes/log-export/__tests__/installed-inventory-error.test.ts +31 -0
- package/src/runtime/routes/log-export/__tests__/installed-inventory.test.ts +200 -0
- package/src/runtime/routes/log-export/installed-inventory.ts +203 -0
- package/src/runtime/routes/log-export-routes.ts +37 -0
- package/src/runtime/routes/mcp-auth-routes.ts +42 -44
- package/src/runtime/routes/migration-routes.ts +9 -9
- package/src/runtime/routes/oauth-connect-routes.ts +1 -1
- package/src/runtime/routes/parse-body.ts +31 -0
- package/src/runtime/routes/playground/__tests__/inject-failures.test.ts +7 -7
- package/src/runtime/routes/playground/__tests__/reset-circuit.test.ts +5 -5
- package/src/runtime/routes/plugins-routes.ts +50 -15
- package/src/runtime/routes/route-host-worker-routes.ts +144 -0
- package/src/runtime/routes/sanity-routes.ts +2 -0
- package/src/runtime/routes/secret-routes.ts +46 -1
- package/src/runtime/routes/sequence-routes.ts +7 -6
- package/src/runtime/routes/suggest-trust-rule-routes.ts +6 -19
- package/src/runtime/routes/surface-action-routes.ts +10 -0
- package/src/runtime/routes/surface-conversation-resolver.ts +28 -32
- package/src/runtime/routes/ui-request-routes.ts +2 -1
- package/src/runtime/routes/upgrade-broadcast-routes.ts +6 -8
- package/src/runtime/routes/user-route-dispatcher.ts +98 -10
- package/src/runtime/routes/user-route-resolution.ts +39 -10
- package/src/runtime/routes/user-routes-cli.ts +9 -1
- package/src/runtime/routes/user-routes.ts +0 -2
- package/src/runtime/routes/watcher-routes.ts +9 -6
- package/src/runtime/routes/workspace-routes.test.ts +2 -2
- package/src/runtime/slack-reply-session.test.ts +44 -12
- package/src/runtime/slack-reply-session.ts +30 -19
- package/src/runtime/sync/sync-publisher.test.ts +7 -5
- package/src/runtime/tool-grant-request-helper.ts +14 -0
- package/src/security/AGENTS.md +1 -1
- package/src/security/credential-key.ts +17 -0
- package/src/security/plugin-secret-patterns.ts +465 -0
- package/src/security/secret-ingress.ts +76 -80
- package/src/security/secret-patterns.ts +8 -139
- package/src/security/secret-scanner.ts +43 -7
- package/src/signals/emit-event.ts +3 -3
- package/src/signals/event-stream.ts +5 -5
- package/src/skills/managed-store.ts +110 -3
- package/src/subagent/manager.ts +16 -15
- package/src/telemetry/__tests__/telemetry-event-fixtures.ts +4 -0
- package/src/telemetry/telemetry-event-sources.ts +2 -0
- package/src/telemetry/telemetry-wire-source.json +1 -1
- package/src/telemetry/telemetry-wire.generated.ts +12 -1
- package/src/telemetry/turn-events-store.ts +2 -24
- package/src/telemetry/turn-trace-store.ts +1 -15
- package/src/telemetry/types.ts +16 -0
- package/src/telemetry/usage-telemetry-reporter.test.ts +24 -6
- package/src/tools/acp/context.ts +5 -5
- package/src/tools/ask-question/ask-question-tool.test.ts +87 -1
- package/src/tools/ask-question/ask-question-tool.ts +58 -0
- package/src/tools/browser/browser-execution.ts +2 -2
- package/src/tools/browser/browser-screencast.ts +6 -6
- package/src/tools/credentials/broker.ts +48 -24
- package/src/tools/network/__tests__/web-search.test.ts +113 -15
- package/src/tools/network/managed-search-proxy.ts +12 -0
- package/src/tools/network/web-search.ts +31 -15
- package/src/tools/permission-checker.ts +42 -9
- package/src/tools/registry.ts +26 -17
- package/src/tools/skills/scaffold-managed.ts +34 -9
- package/src/tools/subagent/spawn.ts +3 -3
- package/src/tools/terminal/shell.ts +8 -4
- package/src/tools/tool-approval-handler.ts +26 -4
- package/src/tools/tool-types.ts +8 -0
- package/src/tools/types.ts +17 -0
- package/src/tools/ui-surface/definitions.ts +20 -16
- package/src/tools/ui-surface/surface-shape-docs.ts +21 -6
- package/src/tts/__tests__/tts-voice-field.test.ts +45 -0
- package/src/tts/providers/deepgram-provider.ts +4 -2
- package/src/tts/providers/elevenlabs-provider.ts +2 -2
- package/src/tts/providers/fish-audio-provider.ts +1 -1
- package/src/tts/providers/xai-provider.ts +2 -2
- package/src/tts/tts-config-resolver.ts +10 -2
- package/src/tts/tts-voice-field.ts +67 -0
- package/src/usage/attribution.ts +33 -2
- package/src/util/log-redact.ts +22 -6
- package/src/util/platform.ts +36 -0
- package/src/util/single-flight.test.ts +88 -0
- package/src/util/single-flight.ts +57 -0
- package/src/workflows/leaf-runner.ts +5 -5
- package/src/workspace/migrations/132-web-search-mode-to-provider.ts +117 -0
- package/src/workspace/migrations/133-collapse-provider-connections.ts +316 -0
- package/src/workspace/migrations/134-image-generation-mode-to-provider.ts +128 -0
- package/src/workspace/migrations/__tests__/backfill-v3-leaves.test.ts +2 -2
- package/src/workspace/migrations/registry.ts +6 -0
- package/src/workspace/provider-commit-message-generator.ts +10 -2
- package/src/__tests__/secret-patterns.test.ts +0 -27
- package/src/channels/slack-thread-store.ts +0 -184
- package/src/daemon/message-types/acp.ts +0 -78
- package/src/daemon/message-types/apps.ts +0 -356
- package/src/daemon/message-types/background-tools.ts +0 -28
- package/src/daemon/message-types/bookmarks.ts +0 -18
- package/src/daemon/message-types/contacts.ts +0 -67
- package/src/daemon/message-types/document-comments.ts +0 -14
- package/src/daemon/message-types/documents.ts +0 -82
- package/src/daemon/message-types/guardian-actions.ts +0 -48
- package/src/daemon/message-types/home.ts +0 -15
- package/src/daemon/message-types/host-bash.ts +0 -30
- package/src/daemon/message-types/host-cu.ts +0 -27
- package/src/daemon/message-types/host-file.ts +0 -54
- package/src/daemon/message-types/host-transfer.ts +0 -45
- package/src/daemon/message-types/inbox.ts +0 -65
- package/src/daemon/message-types/integrations.ts +0 -249
- package/src/daemon/message-types/memory.ts +0 -48
- package/src/daemon/message-types/schedules.ts +0 -197
- package/src/daemon/message-types/settings.ts +0 -61
- package/src/daemon/message-types/subagents.ts +0 -81
- package/src/daemon/message-types/upgrades.ts +0 -31
- package/src/daemon/message-types/workflows.ts +0 -131
- package/src/daemon/message-types/workspace.ts +0 -137
- package/src/plugins/defaults/memory/graph-topology/flag.ts +0 -14
- package/src/runtime/routes/integrations/slack/token.ts +0 -43
- /package/src/plugins/defaults/memory/{routes → src}/__tests__/memory-worker-routes.test.ts +0 -0
- /package/src/plugins/defaults/memory/{routes → src}/memory-eval-routes.ts +0 -0
- /package/src/plugins/defaults/memory/{routes → src}/memory-graph-routes.ts +0 -0
- /package/src/plugins/defaults/memory/{routes → src}/memory-worker-routes.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/concept-page-frontmatter-schema.test.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/edge-index.test.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/__tests__/injected-block-slugs.test.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/constants.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/edge-index.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/injected-block-slugs.ts +0 -0
- /package/src/plugins/defaults/memory/{v2 → v3/substrate}/prompts/sweep.ts +0 -0
|
@@ -89,7 +89,6 @@ function seedGatewayGuardian(
|
|
|
89
89
|
import { getDb } from "../persistence/db-connection.js";
|
|
90
90
|
import { initializeDb } from "../persistence/db-init.js";
|
|
91
91
|
import {
|
|
92
|
-
isAccessRequestDenied,
|
|
93
92
|
maybeNotifyGuardianOfAdmittedContact,
|
|
94
93
|
notifyGuardianOfAccessRequest,
|
|
95
94
|
} from "../runtime/access-request-helper.js";
|
|
@@ -321,12 +320,14 @@ describe("non-member access request notification", () => {
|
|
|
321
320
|
expect(pending.length).toBe(1);
|
|
322
321
|
});
|
|
323
322
|
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
//
|
|
329
|
-
|
|
323
|
+
// A bare guardian deny (a `denied` request with no durable contact seeded)
|
|
324
|
+
// does not suppress re-prompting: suppression keys off the contact being
|
|
325
|
+
// kept out (revoked/blocked), not off a denied request row. So a sender the
|
|
326
|
+
// guardian denied without blocking is re-surfaced when they message again and
|
|
327
|
+
// the guardian can decide afresh. (Durable keep-out vs. re-fire by contact
|
|
328
|
+
// status is covered at the ACL unit level.) Drives the real inbound path so
|
|
329
|
+
// the assistant-scoped conversationId matches what the notify path derives.
|
|
330
|
+
test("a denied sender's subsequent DM re-prompts the guardian (deny is not a durable keep-out)", async () => {
|
|
330
331
|
seedGatewayGuardian({
|
|
331
332
|
channelType: "telegram",
|
|
332
333
|
address: "guardian-user-789",
|
|
@@ -377,19 +378,20 @@ describe("non-member access request notification", () => {
|
|
|
377
378
|
TEST_BEARER_TOKEN,
|
|
378
379
|
);
|
|
379
380
|
const json2 = (await resp2.json()) as Record<string, unknown>;
|
|
381
|
+
// Still not a member, so the message itself is denied at the door...
|
|
380
382
|
expect(json2.denied).toBe(true);
|
|
381
383
|
|
|
382
|
-
//
|
|
383
|
-
|
|
384
|
+
// ...but the guardian IS re-prompted — the earlier deny seeded no durable
|
|
385
|
+
// keep-out, so a second signal fires and a fresh pending request is minted.
|
|
386
|
+
expect(emitSignalCalls.length).toBe(2);
|
|
384
387
|
|
|
385
|
-
// And no fresh pending request was created for the denied sender.
|
|
386
388
|
const pendingAfter = listRequests({
|
|
387
389
|
status: "pending",
|
|
388
390
|
requesterExternalUserId: "user-unknown-456",
|
|
389
391
|
sourceChannel: "telegram",
|
|
390
392
|
kind: "access_request",
|
|
391
393
|
});
|
|
392
|
-
expect(pendingAfter.length).toBe(
|
|
394
|
+
expect(pendingAfter.length).toBe(1);
|
|
393
395
|
});
|
|
394
396
|
|
|
395
397
|
test("access request is created with self-healed principal even without same-channel guardian binding", async () => {
|
|
@@ -788,13 +790,16 @@ describe("access-request-helper unit tests", () => {
|
|
|
788
790
|
});
|
|
789
791
|
|
|
790
792
|
test("notifyGuardianOfAccessRequest includes previousMemberStatus in contextPayload", async () => {
|
|
793
|
+
// A parked `pending` status still re-fires (not a keep-out), so the request
|
|
794
|
+
// is created and the status is forwarded to the card payload. (A `revoked`
|
|
795
|
+
// status would instead suppress — covered by the keep-out tests.)
|
|
791
796
|
const result = await notifyGuardianOfAccessRequest({
|
|
792
797
|
canonicalAssistantId: "self",
|
|
793
798
|
sourceChannel: "telegram",
|
|
794
799
|
conversationExternalId: "chat-123",
|
|
795
|
-
actorExternalId: "
|
|
796
|
-
actorDisplayName: "
|
|
797
|
-
previousMemberStatus: "
|
|
800
|
+
actorExternalId: "pending-user",
|
|
801
|
+
actorDisplayName: "Pending User",
|
|
802
|
+
previousMemberStatus: "pending",
|
|
798
803
|
});
|
|
799
804
|
|
|
800
805
|
expect(result.notified).toBe(true);
|
|
@@ -804,7 +809,7 @@ describe("access-request-helper unit tests", () => {
|
|
|
804
809
|
string,
|
|
805
810
|
unknown
|
|
806
811
|
>;
|
|
807
|
-
expect(payload.previousMemberStatus).toBe("
|
|
812
|
+
expect(payload.previousMemberStatus).toBe("pending");
|
|
808
813
|
});
|
|
809
814
|
|
|
810
815
|
test("notifyGuardianOfAccessRequest persists delivery rows from notification results", async () => {
|
|
@@ -919,17 +924,45 @@ describe("access-request-helper unit tests", () => {
|
|
|
919
924
|
expect(telegram!.status).toBe("sent");
|
|
920
925
|
});
|
|
921
926
|
|
|
922
|
-
test("notifyGuardianOfAccessRequest is suppressed
|
|
923
|
-
//
|
|
924
|
-
//
|
|
925
|
-
//
|
|
927
|
+
test("notifyGuardianOfAccessRequest is suppressed for a kept-out (revoked/blocked) contact", async () => {
|
|
928
|
+
// Suppression keys off the contact's durable status, not a prior denied
|
|
929
|
+
// request row. A revoked/blocked contact is deliberately kept out — no new
|
|
930
|
+
// prompt, signal, or pending request.
|
|
931
|
+
const result = await notifyGuardianOfAccessRequest({
|
|
932
|
+
canonicalAssistantId: "self",
|
|
933
|
+
sourceChannel: "telegram",
|
|
934
|
+
conversationExternalId: "chat-kept-out",
|
|
935
|
+
actorExternalId: "revoked-user",
|
|
936
|
+
actorDisplayName: "Revoked User",
|
|
937
|
+
previousMemberStatus: "revoked",
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
// Suppressed: no new prompt, no signal, no new pending request.
|
|
941
|
+
expect(result.notified).toBe(false);
|
|
942
|
+
if (!result.notified) {
|
|
943
|
+
expect(result.reason).toBe("contact_kept_out");
|
|
944
|
+
}
|
|
945
|
+
expect(emitSignalCalls.length).toBe(0);
|
|
946
|
+
|
|
947
|
+
const pending = listRequests({
|
|
948
|
+
status: "pending",
|
|
949
|
+
requesterExternalUserId: "revoked-user",
|
|
950
|
+
kind: "access_request",
|
|
951
|
+
});
|
|
952
|
+
expect(pending.length).toBe(0);
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
test("notifyGuardianOfAccessRequest re-fires for a parked contact even after a prior deny (deny is not a keep-out)", async () => {
|
|
956
|
+
// A prior `denied` request for this sender does not suppress: the contact
|
|
957
|
+
// is parked (unverified → pending), not kept out, so a later
|
|
958
|
+
// trust-requiring inbound re-surfaces to the guardian.
|
|
926
959
|
bridgeState.seedRequest({
|
|
927
960
|
id: `denied-${Date.now()}`,
|
|
928
961
|
kind: "access_request",
|
|
929
962
|
sourceType: "channel",
|
|
930
963
|
sourceChannel: "telegram",
|
|
931
|
-
sourceConversationId: "access-req-self-telegram-
|
|
932
|
-
requesterExternalUserId: "
|
|
964
|
+
sourceConversationId: "access-req-self-telegram-parked-user",
|
|
965
|
+
requesterExternalUserId: "parked-user",
|
|
933
966
|
guardianPrincipalId: anchorPrincipalId,
|
|
934
967
|
toolName: "ingress_access_request",
|
|
935
968
|
status: "denied",
|
|
@@ -938,24 +971,22 @@ describe("access-request-helper unit tests", () => {
|
|
|
938
971
|
const result = await notifyGuardianOfAccessRequest({
|
|
939
972
|
canonicalAssistantId: "self",
|
|
940
973
|
sourceChannel: "telegram",
|
|
941
|
-
conversationExternalId: "chat-
|
|
942
|
-
actorExternalId: "
|
|
943
|
-
actorDisplayName: "
|
|
974
|
+
conversationExternalId: "chat-parked",
|
|
975
|
+
actorExternalId: "parked-user",
|
|
976
|
+
actorDisplayName: "Parked User",
|
|
977
|
+
previousMemberStatus: "pending",
|
|
944
978
|
});
|
|
945
979
|
|
|
946
|
-
//
|
|
947
|
-
expect(result.notified).toBe(
|
|
948
|
-
|
|
949
|
-
expect(result.reason).toBe("already_denied");
|
|
950
|
-
}
|
|
951
|
-
expect(emitSignalCalls.length).toBe(0);
|
|
980
|
+
// Re-fired: fresh signal + a new pending request.
|
|
981
|
+
expect(result.notified).toBe(true);
|
|
982
|
+
expect(emitSignalCalls.length).toBe(1);
|
|
952
983
|
|
|
953
984
|
const pending = listRequests({
|
|
954
985
|
status: "pending",
|
|
955
|
-
requesterExternalUserId: "
|
|
986
|
+
requesterExternalUserId: "parked-user",
|
|
956
987
|
kind: "access_request",
|
|
957
988
|
});
|
|
958
|
-
expect(pending.length).toBe(
|
|
989
|
+
expect(pending.length).toBe(1);
|
|
959
990
|
});
|
|
960
991
|
|
|
961
992
|
// LUM-2673: inside the post-approval verification window, inbound from the
|
|
@@ -1034,9 +1065,12 @@ describe("access-request-helper unit tests", () => {
|
|
|
1034
1065
|
expect(pending.length).toBe(1);
|
|
1035
1066
|
});
|
|
1036
1067
|
|
|
1037
|
-
test("a
|
|
1068
|
+
test("a durable keep-out wins over an in-window approval for the same sender", async () => {
|
|
1069
|
+
// An approved request inside the verification window would normally
|
|
1070
|
+
// suppress as `approval_pending_verification`. A kept-out contact
|
|
1071
|
+
// (revoked/blocked) is checked first, so the keep-out wins.
|
|
1038
1072
|
bridgeState.seedRequest({
|
|
1039
|
-
id: `approved-then-
|
|
1073
|
+
id: `approved-then-revoked-${Date.now()}`,
|
|
1040
1074
|
kind: "access_request",
|
|
1041
1075
|
sourceType: "channel",
|
|
1042
1076
|
sourceChannel: "telegram",
|
|
@@ -1046,17 +1080,6 @@ describe("access-request-helper unit tests", () => {
|
|
|
1046
1080
|
toolName: "ingress_access_request",
|
|
1047
1081
|
status: "approved",
|
|
1048
1082
|
});
|
|
1049
|
-
bridgeState.seedRequest({
|
|
1050
|
-
id: `approved-then-denied-d-${Date.now()}`,
|
|
1051
|
-
kind: "access_request",
|
|
1052
|
-
sourceType: "channel",
|
|
1053
|
-
sourceChannel: "telegram",
|
|
1054
|
-
sourceConversationId: "access-req-self-telegram-flip-user",
|
|
1055
|
-
requesterExternalUserId: "flip-user",
|
|
1056
|
-
guardianPrincipalId: anchorPrincipalId,
|
|
1057
|
-
toolName: "ingress_access_request",
|
|
1058
|
-
status: "denied",
|
|
1059
|
-
});
|
|
1060
1083
|
|
|
1061
1084
|
const result = await notifyGuardianOfAccessRequest({
|
|
1062
1085
|
canonicalAssistantId: "self",
|
|
@@ -1064,29 +1087,30 @@ describe("access-request-helper unit tests", () => {
|
|
|
1064
1087
|
conversationExternalId: "chat-flip",
|
|
1065
1088
|
actorExternalId: "flip-user",
|
|
1066
1089
|
actorDisplayName: "Flip User",
|
|
1090
|
+
previousMemberStatus: "revoked",
|
|
1067
1091
|
});
|
|
1068
1092
|
|
|
1069
1093
|
expect(result.notified).toBe(false);
|
|
1070
1094
|
if (!result.notified) {
|
|
1071
|
-
expect(result.reason).toBe("
|
|
1095
|
+
expect(result.reason).toBe("contact_kept_out");
|
|
1072
1096
|
}
|
|
1073
1097
|
expect(emitSignalCalls.length).toBe(0);
|
|
1074
1098
|
});
|
|
1075
1099
|
|
|
1076
|
-
test("a
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1100
|
+
test("a keep-out is per-sender — a different, non-kept-out sender still gets prompted", async () => {
|
|
1101
|
+
// Suppression is scoped to the sender via their own contact status, so a
|
|
1102
|
+
// kept-out contact never bleeds into a different sender's prompt.
|
|
1103
|
+
const keptOut = await notifyGuardianOfAccessRequest({
|
|
1104
|
+
canonicalAssistantId: "self",
|
|
1081
1105
|
sourceChannel: "telegram",
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
status: "denied",
|
|
1106
|
+
conversationExternalId: "chat-kept",
|
|
1107
|
+
actorExternalId: "revoked-user",
|
|
1108
|
+
actorDisplayName: "Revoked User",
|
|
1109
|
+
previousMemberStatus: "revoked",
|
|
1087
1110
|
});
|
|
1111
|
+
expect(keptOut.notified).toBe(false);
|
|
1088
1112
|
|
|
1089
|
-
// A different sender still gets a fresh prompt.
|
|
1113
|
+
// A different sender with no keep-out still gets a fresh prompt.
|
|
1090
1114
|
const result = await notifyGuardianOfAccessRequest({
|
|
1091
1115
|
canonicalAssistantId: "self",
|
|
1092
1116
|
sourceChannel: "telegram",
|
|
@@ -1105,84 +1129,6 @@ describe("access-request-helper unit tests", () => {
|
|
|
1105
1129
|
});
|
|
1106
1130
|
expect(pending.length).toBe(1);
|
|
1107
1131
|
});
|
|
1108
|
-
|
|
1109
|
-
test("a denied request on a different channel does not suppress a new channel's prompt", async () => {
|
|
1110
|
-
// Denied on telegram; the same actor id messaging on slack is a distinct
|
|
1111
|
-
// (channel-scoped) context and still surfaces to the guardian.
|
|
1112
|
-
bridgeState.seedRequest({
|
|
1113
|
-
id: `denied-tg-${Date.now()}`,
|
|
1114
|
-
kind: "access_request",
|
|
1115
|
-
sourceType: "channel",
|
|
1116
|
-
sourceChannel: "telegram",
|
|
1117
|
-
sourceConversationId: "access-req-self-telegram-cross-user",
|
|
1118
|
-
requesterExternalUserId: "cross-user",
|
|
1119
|
-
guardianPrincipalId: anchorPrincipalId,
|
|
1120
|
-
toolName: "ingress_access_request",
|
|
1121
|
-
status: "denied",
|
|
1122
|
-
});
|
|
1123
|
-
|
|
1124
|
-
const result = await notifyGuardianOfAccessRequest({
|
|
1125
|
-
canonicalAssistantId: "self",
|
|
1126
|
-
sourceChannel: "slack",
|
|
1127
|
-
conversationExternalId: "C-cross",
|
|
1128
|
-
actorExternalId: "cross-user",
|
|
1129
|
-
actorDisplayName: "Cross User",
|
|
1130
|
-
});
|
|
1131
|
-
|
|
1132
|
-
expect(result.notified).toBe(true);
|
|
1133
|
-
const pending = listRequests({
|
|
1134
|
-
status: "pending",
|
|
1135
|
-
requesterExternalUserId: "cross-user",
|
|
1136
|
-
sourceChannel: "slack",
|
|
1137
|
-
kind: "access_request",
|
|
1138
|
-
});
|
|
1139
|
-
expect(pending.length).toBe(1);
|
|
1140
|
-
});
|
|
1141
|
-
|
|
1142
|
-
test("isAccessRequestDenied is true only for the denied (assistant, channel, sender)", async () => {
|
|
1143
|
-
const key = {
|
|
1144
|
-
canonicalAssistantId: "self",
|
|
1145
|
-
sourceChannel: "telegram",
|
|
1146
|
-
actorExternalId: "denied-user",
|
|
1147
|
-
};
|
|
1148
|
-
expect(await isAccessRequestDenied(key)).toBe(false);
|
|
1149
|
-
|
|
1150
|
-
bridgeState.seedRequest({
|
|
1151
|
-
id: `denied-${Date.now()}`,
|
|
1152
|
-
kind: "access_request",
|
|
1153
|
-
sourceType: "channel",
|
|
1154
|
-
sourceChannel: "telegram",
|
|
1155
|
-
sourceConversationId: "access-req-self-telegram-denied-user",
|
|
1156
|
-
requesterExternalUserId: "denied-user",
|
|
1157
|
-
guardianPrincipalId: anchorPrincipalId,
|
|
1158
|
-
toolName: "ingress_access_request",
|
|
1159
|
-
status: "denied",
|
|
1160
|
-
});
|
|
1161
|
-
|
|
1162
|
-
expect(await isAccessRequestDenied(key)).toBe(true);
|
|
1163
|
-
// Scoped: a different channel or sender is not treated as denied.
|
|
1164
|
-
expect(
|
|
1165
|
-
await isAccessRequestDenied({ ...key, sourceChannel: "slack" }),
|
|
1166
|
-
).toBe(false);
|
|
1167
|
-
expect(
|
|
1168
|
-
await isAccessRequestDenied({ ...key, actorExternalId: "other" }),
|
|
1169
|
-
).toBe(false);
|
|
1170
|
-
// A still-pending request is not a terminal deny.
|
|
1171
|
-
bridgeState.seedRequest({
|
|
1172
|
-
id: `pending-${Date.now()}`,
|
|
1173
|
-
kind: "access_request",
|
|
1174
|
-
sourceType: "channel",
|
|
1175
|
-
sourceChannel: "telegram",
|
|
1176
|
-
sourceConversationId: "access-req-self-telegram-pending-user",
|
|
1177
|
-
requesterExternalUserId: "pending-user",
|
|
1178
|
-
guardianPrincipalId: anchorPrincipalId,
|
|
1179
|
-
toolName: "ingress_access_request",
|
|
1180
|
-
status: "pending",
|
|
1181
|
-
});
|
|
1182
|
-
expect(
|
|
1183
|
-
await isAccessRequestDenied({ ...key, actorExternalId: "pending-user" }),
|
|
1184
|
-
).toBe(false);
|
|
1185
|
-
});
|
|
1186
1132
|
});
|
|
1187
1133
|
|
|
1188
1134
|
// ---------------------------------------------------------------------------
|
|
@@ -1282,7 +1228,11 @@ describe("maybeNotifyGuardianOfAdmittedContact", () => {
|
|
|
1282
1228
|
}
|
|
1283
1229
|
});
|
|
1284
1230
|
|
|
1285
|
-
test("a guardian
|
|
1231
|
+
test("a guardian decision suppresses admitted nudges across conversations", async () => {
|
|
1232
|
+
// Once the guardian decides a card for this contact (a `denied` request —
|
|
1233
|
+
// leave-unverified or block), the low-stakes "set trust level" nudge is
|
|
1234
|
+
// quieted in every conversation. (The deny-path access request still
|
|
1235
|
+
// re-fires for a parked contact reaching past a floor — that is separate.)
|
|
1286
1236
|
await maybeNotifyGuardianOfAdmittedContact(baseParams);
|
|
1287
1237
|
for (const row of bridgeState.requests.values()) {
|
|
1288
1238
|
row.status = "denied";
|
|
@@ -1294,7 +1244,7 @@ describe("maybeNotifyGuardianOfAdmittedContact", () => {
|
|
|
1294
1244
|
});
|
|
1295
1245
|
expect(dm.notified).toBe(false);
|
|
1296
1246
|
if (!dm.notified) {
|
|
1297
|
-
expect(dm.reason).toBe("
|
|
1247
|
+
expect(dm.reason).toBe("already_decided");
|
|
1298
1248
|
}
|
|
1299
1249
|
});
|
|
1300
1250
|
|
|
@@ -98,7 +98,7 @@ mock.module("../notifications/conversation-pairing.js", () => ({
|
|
|
98
98
|
},
|
|
99
99
|
}));
|
|
100
100
|
|
|
101
|
-
import type {
|
|
101
|
+
import type { AssistantEvent } from "../daemon/message-protocol.js";
|
|
102
102
|
import { VellumAdapter } from "../notifications/adapters/macos.js";
|
|
103
103
|
import { NotificationBroadcaster } from "../notifications/broadcaster.js";
|
|
104
104
|
import type { NotificationSignal } from "../notifications/signal.js";
|
|
@@ -179,7 +179,7 @@ describe("notification deep-link metadata", () => {
|
|
|
179
179
|
|
|
180
180
|
describe("VellumAdapter", () => {
|
|
181
181
|
test("broadcasts notification_intent with deepLinkMetadata from payload", async () => {
|
|
182
|
-
const messages:
|
|
182
|
+
const messages: AssistantEvent[] = [];
|
|
183
183
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
184
184
|
|
|
185
185
|
await adapter.send(
|
|
@@ -207,7 +207,7 @@ describe("notification deep-link metadata", () => {
|
|
|
207
207
|
});
|
|
208
208
|
|
|
209
209
|
test("broadcasts notification_intent without deepLinkMetadata when absent", async () => {
|
|
210
|
-
const messages:
|
|
210
|
+
const messages: AssistantEvent[] = [];
|
|
211
211
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
212
212
|
|
|
213
213
|
await adapter.send(
|
|
@@ -226,7 +226,7 @@ describe("notification deep-link metadata", () => {
|
|
|
226
226
|
});
|
|
227
227
|
|
|
228
228
|
test("includes conversationId in deepLinkMetadata for navigation", async () => {
|
|
229
|
-
const messages:
|
|
229
|
+
const messages: AssistantEvent[] = [];
|
|
230
230
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
231
231
|
|
|
232
232
|
const conversationId = "conv-deep-link-test";
|
|
@@ -279,7 +279,7 @@ describe("notification deep-link metadata", () => {
|
|
|
279
279
|
});
|
|
280
280
|
|
|
281
281
|
test("sourceEventName is included in the event payload", async () => {
|
|
282
|
-
const messages:
|
|
282
|
+
const messages: AssistantEvent[] = [];
|
|
283
283
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
284
284
|
|
|
285
285
|
await adapter.send(
|
|
@@ -296,7 +296,7 @@ describe("notification deep-link metadata", () => {
|
|
|
296
296
|
});
|
|
297
297
|
|
|
298
298
|
test("deepLinkMetadata with conversationId enables client-side navigation", async () => {
|
|
299
|
-
const messages:
|
|
299
|
+
const messages: AssistantEvent[] = [];
|
|
300
300
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
301
301
|
|
|
302
302
|
// Simulate a notification that should deep-link to a specific conversation
|
|
@@ -320,7 +320,7 @@ describe("notification deep-link metadata", () => {
|
|
|
320
320
|
});
|
|
321
321
|
|
|
322
322
|
test("deep-link payload includes messageId when present", async () => {
|
|
323
|
-
const messages:
|
|
323
|
+
const messages: AssistantEvent[] = [];
|
|
324
324
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
325
325
|
|
|
326
326
|
await adapter.send(
|
|
@@ -341,7 +341,7 @@ describe("notification deep-link metadata", () => {
|
|
|
341
341
|
// ── Deep-link conversationId present regardless of reuse/new ──────
|
|
342
342
|
|
|
343
343
|
test("deep-link payload includes conversationId for a newly created conversation", async () => {
|
|
344
|
-
const messages:
|
|
344
|
+
const messages: AssistantEvent[] = [];
|
|
345
345
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
346
346
|
|
|
347
347
|
// Simulates the broadcaster merging pairing.conversationId into deep-link
|
|
@@ -362,7 +362,7 @@ describe("notification deep-link metadata", () => {
|
|
|
362
362
|
});
|
|
363
363
|
|
|
364
364
|
test("deep-link payload includes conversationId for a reused conversation", async () => {
|
|
365
|
-
const messages:
|
|
365
|
+
const messages: AssistantEvent[] = [];
|
|
366
366
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
367
367
|
|
|
368
368
|
// Simulates the broadcaster merging pairing.conversationId into deep-link
|
|
@@ -388,7 +388,7 @@ describe("notification deep-link metadata", () => {
|
|
|
388
388
|
// ── Reused conversation deep-link stability regressions ─────────────────
|
|
389
389
|
|
|
390
390
|
test("reused conversation preserves the same conversationId across follow-up notifications", async () => {
|
|
391
|
-
const messages:
|
|
391
|
+
const messages: AssistantEvent[] = [];
|
|
392
392
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
393
393
|
|
|
394
394
|
const stableConversationId = "conv-bound-telegram-dest-001";
|
|
@@ -438,7 +438,7 @@ describe("notification deep-link metadata", () => {
|
|
|
438
438
|
});
|
|
439
439
|
|
|
440
440
|
test("reused conversation deep-link messageId changes per delivery for scroll targeting", async () => {
|
|
441
|
-
const messages:
|
|
441
|
+
const messages: AssistantEvent[] = [];
|
|
442
442
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
443
443
|
|
|
444
444
|
const conversationId = "conv-reused-scroll-test";
|
|
@@ -475,7 +475,7 @@ describe("notification deep-link metadata", () => {
|
|
|
475
475
|
});
|
|
476
476
|
|
|
477
477
|
test("deep-link metadata is stable when conversation is reused via binding-key continuation", async () => {
|
|
478
|
-
const messages:
|
|
478
|
+
const messages: AssistantEvent[] = [];
|
|
479
479
|
const adapter = new VellumAdapter((msg) => messages.push(msg));
|
|
480
480
|
|
|
481
481
|
// Simulates the binding-key continuation path: multiple notifications
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { AssistantEvent } from "../daemon/message-protocol.js";
|
|
4
4
|
import { VellumAdapter } from "../notifications/adapters/macos.js";
|
|
5
5
|
import type {
|
|
6
6
|
ChannelDeliveryPayload,
|
|
@@ -30,9 +30,9 @@ function makeDestination(
|
|
|
30
30
|
|
|
31
31
|
function captureBroadcast(): {
|
|
32
32
|
adapter: VellumAdapter;
|
|
33
|
-
sent:
|
|
33
|
+
sent: AssistantEvent[];
|
|
34
34
|
} {
|
|
35
|
-
const sent:
|
|
35
|
+
const sent: AssistantEvent[] = [];
|
|
36
36
|
const adapter = new VellumAdapter((msg) => sent.push(msg));
|
|
37
37
|
return { adapter, sent };
|
|
38
38
|
}
|
|
@@ -48,7 +48,7 @@ describe("VellumAdapter silent flag", () => {
|
|
|
48
48
|
expect(result.success).toBe(true);
|
|
49
49
|
expect(sent).toHaveLength(1);
|
|
50
50
|
const intent = sent[0] as Extract<
|
|
51
|
-
|
|
51
|
+
AssistantEvent,
|
|
52
52
|
{ type: "notification_intent" }
|
|
53
53
|
>;
|
|
54
54
|
expect(intent.type).toBe("notification_intent");
|
|
@@ -60,7 +60,7 @@ describe("VellumAdapter silent flag", () => {
|
|
|
60
60
|
await adapter.send(makePayload({ urgency: "medium" }), makeDestination());
|
|
61
61
|
|
|
62
62
|
const intent = sent[0] as Extract<
|
|
63
|
-
|
|
63
|
+
AssistantEvent,
|
|
64
64
|
{ type: "notification_intent" }
|
|
65
65
|
>;
|
|
66
66
|
expect(intent.silent).toBe(true);
|
|
@@ -71,7 +71,7 @@ describe("VellumAdapter silent flag", () => {
|
|
|
71
71
|
await adapter.send(makePayload({ urgency: "high" }), makeDestination());
|
|
72
72
|
|
|
73
73
|
const intent = sent[0] as Extract<
|
|
74
|
-
|
|
74
|
+
AssistantEvent,
|
|
75
75
|
{ type: "notification_intent" }
|
|
76
76
|
>;
|
|
77
77
|
expect(intent.silent).toBe(false);
|
|
@@ -82,7 +82,7 @@ describe("VellumAdapter silent flag", () => {
|
|
|
82
82
|
await adapter.send(makePayload({ urgency: "critical" }), makeDestination());
|
|
83
83
|
|
|
84
84
|
const intent = sent[0] as Extract<
|
|
85
|
-
|
|
85
|
+
AssistantEvent,
|
|
86
86
|
{ type: "notification_intent" }
|
|
87
87
|
>;
|
|
88
88
|
expect(intent.silent).toBe(false);
|
|
@@ -101,7 +101,7 @@ describe("VellumAdapter silent flag", () => {
|
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
const intent = sent[0] as Extract<
|
|
104
|
-
|
|
104
|
+
AssistantEvent,
|
|
105
105
|
{ type: "notification_intent" }
|
|
106
106
|
>;
|
|
107
107
|
expect(intent.deliveryId).toBe("delivery-xyz");
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* Prompt caching on the OpenAI Responses transport: request-wide
|
|
3
|
+
* `prompt_cache_key` emission for every direct-API model (routing affinity for
|
|
4
|
+
* implicit-mode models, opt-in explicit mode for breakpoint-capable ones),
|
|
5
|
+
* explicit `prompt_cache_options` and block-level `prompt_cache_breakpoint`
|
|
6
|
+
* anchor placement for GPT-5.6+ (turn-start / previous-turn / advancing tail,
|
|
7
|
+
* mirroring the Anthropic client), the `disableCache`
|
|
8
|
+
* explicit-mode-with-zero-markers opt-out, and the unflagged-model and Codex
|
|
9
|
+
* regression guards.
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
import { beforeEach, describe, expect, mock, test } from "bun:test";
|
|
@@ -339,15 +341,33 @@ describe("OpenAIResponsesProvider explicit prompt caching (GPT-5.6+)", () => {
|
|
|
339
341
|
expect(breakpointedItemIndexes()).toEqual([0]);
|
|
340
342
|
});
|
|
341
343
|
|
|
342
|
-
test("unflagged model sends
|
|
344
|
+
test("unflagged model sends the cache key for routing affinity but no explicit mode or breakpoints", async () => {
|
|
343
345
|
const provider = makeProvider("gpt-5.5");
|
|
344
346
|
await provider.sendMessage(
|
|
345
347
|
[userMsg("t1"), assistantMsg("r1"), userMsg("t2")],
|
|
346
348
|
{ config: { mutableLatestUserMessage: true, promptCacheKey: "conv-1" } },
|
|
347
349
|
);
|
|
348
350
|
|
|
351
|
+
// Implicit-caching models still get a stable prompt_cache_key so OpenAI's
|
|
352
|
+
// cache router keeps a conversation on the same shard, but they never opt
|
|
353
|
+
// into explicit mode or carry block-level breakpoints.
|
|
354
|
+
expect(lastStreamParams?.prompt_cache_key).toBe("conv-1");
|
|
349
355
|
expect(lastStreamParams?.prompt_cache_options).toBeUndefined();
|
|
356
|
+
expect(JSON.stringify(lastStreamParams?.input)).not.toContain(
|
|
357
|
+
"prompt_cache_breakpoint",
|
|
358
|
+
);
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
test("unflagged model with no key sends no cache params at all", async () => {
|
|
362
|
+
const provider = makeProvider("gpt-5.5");
|
|
363
|
+
await provider.sendMessage([
|
|
364
|
+
userMsg("t1"),
|
|
365
|
+
assistantMsg("r1"),
|
|
366
|
+
userMsg("t2"),
|
|
367
|
+
]);
|
|
368
|
+
|
|
350
369
|
expect(lastStreamParams?.prompt_cache_key).toBeUndefined();
|
|
370
|
+
expect(lastStreamParams?.prompt_cache_options).toBeUndefined();
|
|
351
371
|
expect(JSON.stringify(lastStreamParams?.input)).not.toContain(
|
|
352
372
|
"prompt_cache_breakpoint",
|
|
353
373
|
);
|