@vellumai/assistant 0.5.10 → 0.5.12
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/AGENTS.md +8 -0
- package/ARCHITECTURE.md +43 -43
- package/Dockerfile +3 -0
- package/docs/architecture/integrations.md +37 -42
- package/docs/architecture/memory.md +7 -12
- package/docs/credential-execution-service.md +9 -9
- package/docs/skills.md +1 -1
- package/node_modules/@vellumai/ces-contracts/src/__tests__/grants.test.ts +7 -7
- package/node_modules/@vellumai/ces-contracts/src/handles.ts +5 -4
- package/node_modules/@vellumai/credential-storage/src/index.ts +3 -3
- package/node_modules/@vellumai/credential-storage/src/static-credentials.ts +1 -1
- package/openapi.yaml +7208 -0
- package/package.json +2 -1
- package/scripts/generate-openapi.ts +562 -0
- package/src/__tests__/acp-session.test.ts +239 -44
- package/src/__tests__/assistant-feature-flag-guard.test.ts +8 -8
- package/src/__tests__/assistant-feature-flag-guardrails.test.ts +5 -86
- package/src/__tests__/assistant-feature-flags-integration.test.ts +7 -14
- package/src/__tests__/browser-skill-endstate.test.ts +1 -1
- package/src/__tests__/btw-routes.test.ts +8 -0
- package/src/__tests__/bundled-skill-retrieval-guard.test.ts +10 -10
- package/src/__tests__/catalog-cache.test.ts +164 -0
- package/src/__tests__/catalog-search.test.ts +61 -0
- package/src/__tests__/channel-approvals.test.ts +7 -7
- package/src/__tests__/channel-readiness-service.test.ts +41 -0
- package/src/__tests__/cli-command-risk-guard.test.ts +181 -6
- package/src/__tests__/config-schema.test.ts +10 -2
- package/src/__tests__/context-memory-e2e.test.ts +2 -6
- package/src/__tests__/conversation-delete-schedule-cleanup.test.ts +396 -0
- package/src/__tests__/conversation-error.test.ts +3 -2
- package/src/__tests__/conversation-skill-tools.test.ts +1 -3
- package/src/__tests__/conversation-title-service.test.ts +2 -15
- package/src/__tests__/credential-execution-feature-gates.test.ts +4 -8
- package/src/__tests__/credential-execution-managed-contract.test.ts +8 -8
- package/src/__tests__/credential-security-e2e.test.ts +4 -4
- package/src/__tests__/credential-security-invariants.test.ts +12 -18
- package/src/__tests__/credential-vault-unit.test.ts +32 -34
- package/src/__tests__/credential-vault.test.ts +25 -33
- package/src/__tests__/credentials-cli.test.ts +3 -3
- package/src/__tests__/daemon-credential-client.test.ts +2 -2
- package/src/__tests__/dynamic-skill-workflow-prompt.test.ts +1 -1
- package/src/__tests__/gateway-only-guard.test.ts +3 -0
- package/src/__tests__/heartbeat-service.test.ts +35 -0
- package/src/__tests__/host-bash-proxy.test.ts +79 -0
- package/src/__tests__/host-cu-proxy.test.ts +90 -0
- package/src/__tests__/host-file-proxy.test.ts +89 -0
- package/src/__tests__/host-shell-tool.test.ts +1 -1
- package/src/__tests__/inline-skill-load-permissions.test.ts +3 -3
- package/src/__tests__/integration-status.test.ts +5 -5
- package/src/__tests__/list-messages-attachments.test.ts +171 -0
- package/src/__tests__/llm-request-log-turn-query.test.ts +64 -0
- package/src/__tests__/log-export-workspace.test.ts +1 -1
- package/src/__tests__/mcp-abort-signal.test.ts +205 -0
- package/src/__tests__/mcp-client-auth.test.ts +1 -1
- package/src/__tests__/memory-lifecycle-e2e.test.ts +2 -2
- package/src/__tests__/memory-recall-log-store.test.ts +182 -0
- package/src/__tests__/memory-recall-quality.test.ts +6 -8
- package/src/__tests__/memory-regressions.test.ts +53 -42
- package/src/__tests__/memory-retrieval.benchmark.test.ts +5 -9
- package/src/__tests__/messaging-send-tool.test.ts +5 -5
- package/src/__tests__/messaging-skill-split.test.ts +2 -17
- package/src/__tests__/notification-telegram-adapter.test.ts +125 -0
- package/src/__tests__/oauth-cli.test.ts +203 -649
- package/src/__tests__/oauth-provider-profiles.test.ts +55 -20
- package/src/__tests__/oauth-scope-policy.test.ts +4 -6
- package/src/__tests__/onboarding-template-contract.test.ts +2 -2
- package/src/__tests__/platform-callback-registration.test.ts +119 -0
- package/src/__tests__/secret-ingress-channel.test.ts +261 -0
- package/src/__tests__/secret-ingress-cli.test.ts +201 -0
- package/src/__tests__/secret-ingress-http.test.ts +312 -0
- package/src/__tests__/secret-ingress.test.ts +283 -0
- package/src/__tests__/secret-onetime-send.test.ts +4 -4
- package/src/__tests__/secret-routes-managed-proxy.test.ts +78 -0
- package/src/__tests__/secure-keys-managed-failover.test.ts +73 -0
- package/src/__tests__/skill-feature-flags-integration.test.ts +4 -4
- package/src/__tests__/skill-feature-flags.test.ts +11 -19
- package/src/__tests__/skill-load-feature-flag.test.ts +1 -1
- package/src/__tests__/skill-load-inline-command.test.ts +3 -3
- package/src/__tests__/skill-load-inline-includes.test.ts +2 -2
- package/src/__tests__/skill-memory.test.ts +2 -4
- package/src/__tests__/skill-projection-feature-flag.test.ts +2 -4
- package/src/__tests__/skill-projection.benchmark.test.ts +1 -3
- package/src/__tests__/skills-uninstall.test.ts +2 -2
- package/src/__tests__/skills.test.ts +16 -2
- package/src/__tests__/slack-channel-config.test.ts +1 -1
- package/src/__tests__/slack-messaging-token-resolution.test.ts +22 -24
- package/src/__tests__/slack-share-routes.test.ts +5 -5
- package/src/__tests__/slack-skill.test.ts +5 -69
- package/src/__tests__/system-prompt.test.ts +39 -0
- package/src/__tests__/vellum-self-knowledge-inline-command.test.ts +1 -1
- package/src/__tests__/workspace-migration-018-rekey-compound-credential-keys.test.ts +181 -0
- package/src/__tests__/workspace-migration-backfill-installation-id.test.ts +5 -4
- package/src/acp/client-handler.ts +113 -31
- package/src/acp/session-manager.ts +29 -27
- package/src/approvals/guardian-request-resolvers.ts +1 -1
- package/src/cli/AGENTS.md +113 -0
- package/src/cli/commands/autonomy.ts +3 -5
- package/src/cli/commands/browser-relay.ts +2 -17
- package/src/cli/commands/contacts.ts +6 -4
- package/src/cli/commands/conversations.ts +13 -1
- package/src/cli/commands/credential-execution.ts +17 -3
- package/src/cli/commands/credentials.ts +2 -8
- package/src/cli/commands/memory.ts +2 -3
- package/src/cli/commands/oauth/__tests__/connect.test.ts +706 -0
- package/src/cli/commands/oauth/__tests__/disconnect.test.ts +686 -0
- package/src/cli/commands/oauth/__tests__/mode.test.ts +625 -0
- package/src/cli/commands/oauth/__tests__/ping.test.ts +631 -0
- package/src/cli/commands/oauth/__tests__/providers-delete.test.ts +574 -0
- package/src/cli/commands/oauth/__tests__/providers-update.test.ts +416 -0
- package/src/cli/commands/oauth/__tests__/status.test.ts +551 -0
- package/src/cli/commands/oauth/__tests__/token.test.ts +420 -0
- package/src/cli/commands/oauth/apps.ts +87 -50
- package/src/cli/commands/oauth/connect.ts +405 -0
- package/src/cli/commands/oauth/disconnect.ts +285 -0
- package/src/cli/commands/oauth/index.ts +62 -20
- package/src/cli/commands/oauth/mode.ts +251 -0
- package/src/cli/commands/oauth/ping.ts +196 -0
- package/src/cli/commands/oauth/providers.ts +589 -55
- package/src/cli/commands/oauth/request.ts +564 -0
- package/src/cli/commands/oauth/shared.ts +114 -0
- package/src/cli/commands/oauth/status.ts +191 -0
- package/src/cli/commands/oauth/token.ts +150 -0
- package/src/cli/commands/platform/connect.ts +104 -0
- package/src/cli/commands/platform/disconnect.ts +118 -0
- package/src/cli/commands/platform/index.ts +252 -0
- package/src/cli/commands/sequence.ts +5 -4
- package/src/cli/commands/shotgun.ts +16 -0
- package/src/cli/commands/skills.ts +173 -41
- package/src/cli/commands/usage.ts +5 -11
- package/src/cli/lib/daemon-credential-client.ts +22 -38
- package/src/cli/program.ts +1 -1
- package/src/cli.ts +82 -17
- package/src/config/assistant-feature-flags.ts +77 -18
- package/src/config/bundled-skills/_shared/CLI_RETRIEVAL_PATTERN.md +1 -1
- package/src/config/bundled-skills/app-builder/tools/app-create.ts +1 -1
- package/src/config/bundled-skills/contacts/tools/google-contacts.ts +1 -1
- package/src/config/bundled-skills/conversations/SKILL.md +20 -0
- package/src/config/bundled-skills/conversations/TOOLS.json +23 -0
- package/src/config/bundled-skills/conversations/tools/rename-conversation.ts +66 -0
- package/src/config/bundled-skills/gmail/SKILL.md +13 -13
- package/src/config/bundled-skills/gmail/tools/gmail-archive.ts +3 -3
- package/src/config/bundled-skills/gmail/tools/gmail-attachments.ts +2 -2
- package/src/config/bundled-skills/gmail/tools/gmail-draft.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-filters.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-follow-up.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-forward.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-label.ts +2 -2
- package/src/config/bundled-skills/gmail/tools/gmail-outreach-scan.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-send-draft.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-sender-digest.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-trash.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-unsubscribe.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-vacation.ts +1 -1
- package/src/config/bundled-skills/google-calendar/SKILL.md +10 -4
- package/src/config/bundled-skills/google-calendar/tools/shared.ts +1 -1
- package/src/config/bundled-skills/messaging/SKILL.md +19 -42
- package/src/config/bundled-skills/messaging/TOOLS.json +9 -9
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-style.ts +1 -1
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +5 -2
- package/src/config/bundled-skills/messaging/tools/shared.ts +5 -6
- package/src/config/bundled-skills/notifications/SKILL.md +1 -1
- package/src/config/bundled-skills/schedule/SKILL.md +2 -2
- package/src/config/bundled-skills/settings/SKILL.md +5 -3
- package/src/config/bundled-skills/settings/TOOLS.json +17 -0
- package/src/config/bundled-skills/settings/tools/avatar-get.ts +50 -0
- package/src/config/bundled-skills/settings/tools/avatar-remove.ts +7 -0
- package/src/config/bundled-skills/settings/tools/avatar-update.ts +6 -1
- package/src/config/bundled-skills/settings/tools/identity-avatar.ts +55 -0
- package/src/config/bundled-skills/skills-catalog/SKILL.md +3 -3
- package/src/config/bundled-skills/slack/SKILL.md +58 -44
- package/src/config/bundled-tool-registry.ts +7 -19
- package/src/config/env.ts +5 -1
- package/src/config/feature-flag-registry.json +58 -42
- package/src/config/loader.ts +4 -0
- package/src/config/schemas/platform.ts +0 -8
- package/src/config/schemas/security.ts +9 -1
- package/src/config/schemas/services.ts +1 -1
- package/src/config/skill-state.ts +1 -3
- package/src/config/skills.ts +2 -4
- package/src/credential-execution/client.ts +1 -1
- package/src/credential-execution/feature-gates.ts +9 -16
- package/src/credential-execution/process-manager.ts +12 -0
- package/src/daemon/config-watcher.ts +4 -0
- package/src/daemon/conversation-agent-loop-handlers.ts +10 -0
- package/src/daemon/conversation-agent-loop.ts +51 -2
- package/src/daemon/conversation-error.ts +36 -6
- package/src/daemon/conversation-memory.ts +0 -1
- package/src/daemon/conversation-messaging.ts +9 -0
- package/src/daemon/conversation-runtime-assembly.ts +33 -0
- package/src/daemon/conversation-surfaces.ts +120 -14
- package/src/daemon/conversation.ts +5 -0
- package/src/daemon/handlers/config-slack-channel.ts +43 -1
- package/src/daemon/handlers/conversations.ts +41 -33
- package/src/daemon/handlers/skills.ts +148 -3
- package/src/daemon/host-bash-proxy.ts +16 -0
- package/src/daemon/host-cu-proxy.ts +16 -0
- package/src/daemon/host-file-proxy.ts +16 -0
- package/src/daemon/lifecycle.ts +73 -3
- package/src/daemon/message-types/acp.ts +0 -15
- package/src/daemon/message-types/conversations.ts +1 -0
- package/src/daemon/message-types/guardian-actions.ts +2 -0
- package/src/daemon/message-types/host-bash.ts +6 -1
- package/src/daemon/message-types/host-cu.ts +6 -1
- package/src/daemon/message-types/host-file.ts +6 -1
- package/src/daemon/message-types/integrations.ts +0 -1
- package/src/daemon/message-types/memory.ts +0 -1
- package/src/daemon/message-types/messages.ts +9 -1
- package/src/daemon/message-types/schedules.ts +9 -0
- package/src/daemon/server.ts +48 -9
- package/src/email/feature-gate.ts +3 -3
- package/src/heartbeat/heartbeat-service.ts +48 -0
- package/src/hooks/cli.ts +74 -0
- package/src/inbound/platform-callback-registration.ts +68 -19
- package/src/mcp/client.ts +6 -1
- package/src/mcp/manager.ts +2 -1
- package/src/mcp/mcp-oauth-provider.ts +3 -3
- package/src/memory/app-store.ts +3 -3
- package/src/memory/conversation-crud.ts +213 -0
- package/src/memory/conversation-key-store.ts +26 -0
- package/src/memory/conversation-title-service.ts +7 -17
- package/src/memory/db-init.ts +24 -0
- package/src/memory/embedding-local.ts +47 -2
- package/src/memory/indexer.ts +13 -10
- package/src/memory/items-extractor.ts +12 -4
- package/src/memory/job-utils.ts +5 -0
- package/src/memory/jobs-store.ts +10 -2
- package/src/memory/journal-memory.ts +6 -2
- package/src/memory/llm-request-log-store.ts +88 -21
- package/src/memory/memory-recall-log-store.ts +128 -0
- package/src/memory/migrations/194-memory-recall-logs.ts +50 -0
- package/src/memory/migrations/195-oauth-providers-ping-config.ts +23 -0
- package/src/memory/migrations/196-messages-conversation-created-at-index.ts +9 -0
- package/src/memory/migrations/196-strip-integration-prefix-from-provider-keys.ts +186 -0
- package/src/memory/migrations/197-oauth-providers-behavior-columns.ts +29 -0
- package/src/memory/migrations/198-drop-setup-skill-id-column.ts +11 -0
- package/src/memory/migrations/index.ts +6 -0
- package/src/memory/migrations/registry.ts +8 -0
- package/src/memory/retriever.test.ts +4 -5
- package/src/memory/schema/infrastructure.ts +31 -0
- package/src/memory/schema/oauth.ts +14 -0
- package/src/messaging/provider.ts +13 -12
- package/src/messaging/providers/gmail/adapter.ts +44 -35
- package/src/messaging/providers/slack/adapter.ts +63 -33
- package/src/messaging/providers/telegram-bot/adapter.ts +7 -9
- package/src/messaging/providers/whatsapp/adapter.ts +6 -8
- package/src/notifications/adapters/telegram.ts +78 -2
- package/src/oauth/__tests__/identity-verifier.test.ts +464 -0
- package/src/oauth/byo-connection.test.ts +22 -24
- package/src/oauth/connect-orchestrator.ts +79 -64
- package/src/oauth/connect-types.ts +7 -65
- package/src/oauth/connection-resolver.test.ts +13 -13
- package/src/oauth/connection-resolver.ts +3 -4
- package/src/oauth/identity-verifier.ts +177 -0
- package/src/oauth/manual-token-connection.ts +5 -5
- package/src/oauth/oauth-store.ts +251 -5
- package/src/oauth/platform-connection.test.ts +56 -6
- package/src/oauth/platform-connection.ts +8 -1
- package/src/oauth/seed-providers.ts +256 -34
- package/src/permissions/checker.ts +129 -3
- package/src/permissions/trust-client.ts +2 -2
- package/src/platform/client.ts +2 -2
- package/src/prompts/journal-context.ts +6 -1
- package/src/prompts/system-prompt.ts +43 -9
- package/src/prompts/templates/BOOTSTRAP.md +16 -5
- package/src/providers/anthropic/client.ts +139 -28
- package/src/runtime/auth/__tests__/middleware.test.ts +19 -0
- package/src/runtime/auth/route-policy.ts +0 -1
- package/src/runtime/btw-sidechain.ts +7 -1
- package/src/runtime/channel-approvals.ts +2 -2
- package/src/runtime/channel-readiness-service.ts +30 -7
- package/src/runtime/guardian-action-service.ts +7 -2
- package/src/runtime/http-router.ts +31 -0
- package/src/runtime/http-server.ts +26 -7
- package/src/runtime/http-types.ts +9 -0
- package/src/runtime/pending-interactions.ts +21 -3
- package/src/runtime/routes/acp-routes.ts +46 -28
- package/src/runtime/routes/app-management-routes.ts +123 -0
- package/src/runtime/routes/app-routes.ts +31 -0
- package/src/runtime/routes/approval-routes.ts +108 -3
- package/src/runtime/routes/attachment-routes.ts +45 -0
- package/src/runtime/routes/avatar-routes.ts +16 -0
- package/src/runtime/routes/brain-graph-routes.ts +18 -0
- package/src/runtime/routes/btw-routes.ts +20 -0
- package/src/runtime/routes/call-routes.ts +81 -0
- package/src/runtime/routes/channel-readiness-routes.ts +48 -7
- package/src/runtime/routes/channel-routes.ts +18 -0
- package/src/runtime/routes/channel-verification-routes.ts +49 -1
- package/src/runtime/routes/contact-routes.ts +77 -0
- package/src/runtime/routes/conversation-attention-routes.ts +37 -0
- package/src/runtime/routes/conversation-management-routes.ts +125 -0
- package/src/runtime/routes/conversation-query-routes.ts +78 -0
- package/src/runtime/routes/conversation-routes.ts +191 -39
- package/src/runtime/routes/conversation-starter-routes.ts +29 -0
- package/src/runtime/routes/debug-routes.ts +23 -0
- package/src/runtime/routes/diagnostics-routes.ts +30 -0
- package/src/runtime/routes/documents-routes.ts +42 -0
- package/src/runtime/routes/events-routes.ts +10 -0
- package/src/runtime/routes/global-search-routes.ts +35 -0
- package/src/runtime/routes/guardian-action-routes.ts +61 -3
- package/src/runtime/routes/guardian-approval-prompt.ts +77 -2
- package/src/runtime/routes/heartbeat-routes.ts +278 -0
- package/src/runtime/routes/host-bash-routes.ts +16 -1
- package/src/runtime/routes/host-cu-routes.ts +23 -1
- package/src/runtime/routes/host-file-routes.ts +18 -1
- package/src/runtime/routes/identity-routes.ts +35 -0
- package/src/runtime/routes/inbound-message-handler.ts +46 -25
- package/src/runtime/routes/inbound-stages/acl-enforcement.ts +21 -8
- package/src/runtime/routes/inbound-stages/secret-ingress-check.ts +30 -2
- package/src/runtime/routes/inbound-stages/transcribe-audio.ts +1 -2
- package/src/runtime/routes/integrations/slack/share.ts +1 -1
- package/src/runtime/routes/integrations/twilio.ts +32 -22
- package/src/runtime/routes/invite-routes.ts +83 -0
- package/src/runtime/routes/log-export-routes.ts +14 -0
- package/src/runtime/routes/memory-item-routes.ts +99 -1
- package/src/runtime/routes/migration-rollback-routes.ts +25 -0
- package/src/runtime/routes/migration-routes.ts +40 -0
- package/src/runtime/routes/notification-routes.ts +20 -0
- package/src/runtime/routes/oauth-apps.ts +13 -4
- package/src/runtime/routes/pairing-routes.ts +15 -0
- package/src/runtime/routes/recording-routes.ts +72 -0
- package/src/runtime/routes/schedule-routes.ts +77 -5
- package/src/runtime/routes/secret-routes.ts +99 -14
- package/src/runtime/routes/settings-routes.ts +102 -19
- package/src/runtime/routes/skills-routes.ts +141 -18
- package/src/runtime/routes/subagents-routes.ts +38 -3
- package/src/runtime/routes/surface-action-routes.ts +66 -24
- package/src/runtime/routes/surface-content-routes.ts +20 -0
- package/src/runtime/routes/telemetry-routes.ts +12 -0
- package/src/runtime/routes/trace-event-routes.ts +25 -0
- package/src/runtime/routes/trust-rules-routes.ts +46 -0
- package/src/runtime/routes/tts-routes.ts +15 -4
- package/src/runtime/routes/upgrade-broadcast-routes.ts +38 -0
- package/src/runtime/routes/usage-routes.ts +59 -0
- package/src/runtime/routes/watch-routes.ts +28 -0
- package/src/runtime/routes/work-items-routes.ts +59 -0
- package/src/runtime/routes/workspace-commit-routes.ts +12 -0
- package/src/runtime/routes/workspace-routes.ts +102 -0
- package/src/schedule/integration-status.ts +2 -2
- package/src/schedule/scheduler.ts +7 -1
- package/src/security/AGENTS.md +7 -0
- package/src/security/ces-rpc-credential-backend.ts +19 -16
- package/src/security/credential-backend.ts +1 -1
- package/src/security/encrypted-store.ts +3 -3
- package/src/security/oauth-completion-page.ts +153 -0
- package/src/security/oauth2.ts +58 -17
- package/src/security/secret-ingress.ts +174 -0
- package/src/security/secret-patterns.ts +133 -0
- package/src/security/secret-scanner.ts +28 -117
- package/src/security/secure-keys.ts +207 -7
- package/src/security/token-manager.ts +3 -6
- package/src/signals/bash.ts +6 -1
- package/src/signals/confirm.ts +12 -8
- package/src/signals/user-message.ts +18 -3
- package/src/skills/catalog-cache.ts +44 -0
- package/src/skills/catalog-search.ts +18 -0
- package/src/skills/skill-memory.ts +1 -2
- package/src/tasks/task-runner.ts +7 -1
- package/src/tools/credentials/broker.ts +1 -1
- package/src/tools/credentials/metadata-store.ts +1 -1
- package/src/tools/credentials/post-connect-hooks.ts +1 -1
- package/src/tools/credentials/vault.ts +36 -48
- package/src/tools/host-terminal/host-shell.ts +16 -3
- package/src/tools/mcp/mcp-tool-factory.ts +2 -1
- package/src/tools/memory/definitions.ts +1 -1
- package/src/tools/memory/handlers.test.ts +2 -4
- package/src/tools/skills/load.ts +1 -1
- package/src/tools/skills/sandbox-runner.ts +16 -3
- package/src/tools/terminal/safe-env.ts +7 -0
- package/src/tools/terminal/shell.ts +16 -3
- package/src/tools/tool-manifest.ts +1 -1
- package/src/util/log-redact.ts +9 -34
- package/src/util/logger.ts +11 -1
- package/src/util/sentry-log-stream.ts +51 -0
- package/src/watcher/providers/github.ts +2 -2
- package/src/watcher/providers/gmail.ts +1 -1
- package/src/watcher/providers/google-calendar.ts +1 -1
- package/src/watcher/providers/linear.ts +2 -2
- package/src/workspace/migrations/011-backfill-installation-id.ts +5 -3
- package/src/workspace/migrations/020-rename-oauth-skill-dirs.ts +119 -0
- package/src/workspace/migrations/registry.ts +2 -0
- package/docs/architecture/keychain-broker.md +0 -68
- package/src/cli/commands/oauth/connections.ts +0 -734
- package/src/cli/commands/oauth/platform.ts +0 -525
- package/src/cli/commands/platform.ts +0 -176
- package/src/config/bundled-skills/slack/TOOLS.json +0 -272
- package/src/config/bundled-skills/slack/tools/shared.ts +0 -34
- package/src/config/bundled-skills/slack/tools/slack-add-reaction.ts +0 -27
- package/src/config/bundled-skills/slack/tools/slack-channel-details.ts +0 -38
- package/src/config/bundled-skills/slack/tools/slack-channel-permissions.ts +0 -146
- package/src/config/bundled-skills/slack/tools/slack-configure-channels.ts +0 -105
- package/src/config/bundled-skills/slack/tools/slack-delete-message.ts +0 -26
- package/src/config/bundled-skills/slack/tools/slack-edit-message.ts +0 -27
- package/src/config/bundled-skills/slack/tools/slack-leave-channel.ts +0 -25
- package/src/config/bundled-skills/slack/tools/slack-scan-digest.ts +0 -372
- package/src/oauth/provider-behaviors.ts +0 -634
package/AGENTS.md
CHANGED
|
@@ -3,3 +3,11 @@
|
|
|
3
3
|
For error handling conventions (throw vs result objects vs null), see [docs/error-handling.md](docs/error-handling.md).
|
|
4
4
|
|
|
5
5
|
Subdirectory-scoped rules live in local AGENTS.md files: `src/cli/`, `src/runtime/`, `src/approvals/`, `src/notifications/`, `src/workspace/migrations/`.
|
|
6
|
+
|
|
7
|
+
## Adding new environment variables
|
|
8
|
+
|
|
9
|
+
When you introduce a new env var that the assistant process needs to read at runtime, **update `src/tools/terminal/safe-env.ts`** as well.
|
|
10
|
+
|
|
11
|
+
`safe-env.ts` maintains the allowlist of env vars that are forwarded to agent-spawned child processes (bash tool, skill sandbox, etc.). Anything not on the list is stripped to prevent credential leakage. If your new var is needed by commands the agent runs, it must be added.
|
|
12
|
+
|
|
13
|
+
**Default to including it.** If the var doesn't contain secrets (e.g. a URL, a feature flag, a path, a mode string), add it. Only omit it if it carries credential material (tokens, passwords, private keys) — those must stay isolated to CES.
|
package/ARCHITECTURE.md
CHANGED
|
@@ -617,7 +617,7 @@ Release-driven update notification system that surfaces release notes to the ass
|
|
|
617
617
|
|
|
618
618
|
The assistant feature-flag resolver (`src/config/assistant-feature-flags.ts`) is the canonical module for determining whether an assistant feature flag is enabled. It loads default values from the unified registry at `meta/feature-flags/feature-flag-registry.json` (bundled copy at `src/config/feature-flag-registry.json`) and resolves the effective state for each declared assistant-scope flag. Assistant feature flags are declaration-driven assistant-scoped booleans that can gate any assistant behavior; skill availability is one consumer.
|
|
619
619
|
|
|
620
|
-
**Canonical key format:**
|
|
620
|
+
**Canonical key format:** Simple kebab-case (e.g., `contacts`, `ces-tools`).
|
|
621
621
|
|
|
622
622
|
**Resolution priority** (highest wins):
|
|
623
623
|
|
|
@@ -645,7 +645,7 @@ The assistant feature-flag resolver (`src/config/assistant-feature-flags.ts`) is
|
|
|
645
645
|
|
|
646
646
|
All six enforcement points derive the flag key via `skillFlagKey(skill)` — which returns `undefined` for ungated skills, short-circuiting the check — and then call `isAssistantFeatureFlagEnabled(flagKey, config)` for consistency.
|
|
647
647
|
|
|
648
|
-
**Migration path:** The legacy `skills.<id>.enabled` key
|
|
648
|
+
**Migration path:** The legacy `skills.<id>.enabled` and `feature_flags.<id>.enabled` key formats are no longer supported. All code must use simple kebab-case keys (e.g., `contacts`, `ces-tools`). Guard tests enforce canonical key usage and declaration coverage for literal key references in the unified registry.
|
|
649
649
|
|
|
650
650
|
**Key source files:**
|
|
651
651
|
|
|
@@ -1142,7 +1142,7 @@ Skills can expose custom tools via a `TOOLS.json` manifest alongside their `SKIL
|
|
|
1142
1142
|
|
|
1143
1143
|
### Bundled Skill Retrieval Contract (CLI-First)
|
|
1144
1144
|
|
|
1145
|
-
Config/status retrieval instructions in bundled `SKILL.md` files are CLI-first. Retrieval should flow through canonical `vellum` CLI surfaces (`assistant config get` for generic settings, secure credential surfaces for secrets, and domain reads where available) instead of direct gateway curl snippets or
|
|
1145
|
+
Config/status retrieval instructions in bundled `SKILL.md` files are CLI-first. Retrieval should flow through canonical `vellum` CLI surfaces (`assistant config get` for generic settings, secure credential surfaces for secrets, and domain reads where available) instead of direct gateway curl snippets or credential store lookups.
|
|
1146
1146
|
|
|
1147
1147
|
```mermaid
|
|
1148
1148
|
graph LR
|
|
@@ -1156,7 +1156,7 @@ Rules enforced by guard tests:
|
|
|
1156
1156
|
|
|
1157
1157
|
- Retrieval reads use `bash` + canonical CLI surfaces (`assistant config get` and domain read commands where available).
|
|
1158
1158
|
- Direct gateway `curl` + manual bearer headers are for control-plane writes/actions, not retrieval reads.
|
|
1159
|
-
- Bundled skill docs must not instruct direct
|
|
1159
|
+
- Bundled skill docs must not instruct direct credential store lookups (`security find-generic-password`, `secret-tool`) for retrieval.
|
|
1160
1160
|
- `host_bash` is not used for Vellum CLI retrieval commands unless intentionally allowlisted.
|
|
1161
1161
|
- Outbound credentialed API calls use CES tools (`make_authenticated_request`, `run_authenticated_command`) so credential materialization happens in a separate process. Command output (stdout/stderr) is forwarded back to the assistant and may contain credential values if the command echoes them, so the isolation covers injection, not output. `host_bash` is available as a user-approved escape hatch but is outside the strong secrecy guarantee.
|
|
1162
1162
|
|
|
@@ -1264,7 +1264,7 @@ graph TB
|
|
|
1264
1264
|
|
|
1265
1265
|
Skills can embed dynamic shell output in their SKILL.md body using `!`command``tokens. When`skill_load` processes a skill containing these tokens, the commands are executed at load time through a sandboxed runner and their output is substituted inline. This enables externally authored skills to include project-specific context (e.g., directory listings, config values) without requiring manual edits.
|
|
1266
1266
|
|
|
1267
|
-
**Feature flag:** `
|
|
1267
|
+
**Feature flag:** `inline-skill-commands` (default: enabled). When disabled, loading a skill that contains `!`command`` tokens fails closed with an error rather than leaving raw tokens in the prompt.
|
|
1268
1268
|
|
|
1269
1269
|
#### Syntax and Parsing
|
|
1270
1270
|
|
|
@@ -1935,44 +1935,44 @@ Connected channels are resolved at signal emission time: vellum is always includ
|
|
|
1935
1935
|
|
|
1936
1936
|
## Storage Summary
|
|
1937
1937
|
|
|
1938
|
-
| What | Where
|
|
1939
|
-
| ---------------------------------------- |
|
|
1940
|
-
| API key | CES / encrypted file store
|
|
1941
|
-
| Credential secrets | CES / encrypted file store
|
|
1942
|
-
| Credential metadata | `~/.vellum/workspace/data/credentials/metadata.json`
|
|
1943
|
-
| Integration OAuth tokens | CES / encrypted file store (via `secure-keys.ts`)
|
|
1944
|
-
| User preferences | UserDefaults
|
|
1945
|
-
| Session logs | `~/Library/.../logs/session-*.json`
|
|
1946
|
-
| Conversations & messages | `~/.vellum/workspace/data/db/assistant.db`
|
|
1947
|
-
| Memory segments | `~/.vellum/workspace/data/db/assistant.db`
|
|
1948
|
-
| Extracted facts | `~/.vellum/workspace/data/db/assistant.db`
|
|
1949
|
-
| Embeddings | `~/.vellum/workspace/data/db/assistant.db`
|
|
1950
|
-
| Async job queue | `~/.vellum/workspace/data/db/assistant.db`
|
|
1951
|
-
| Attachments | `~/.vellum/workspace/data/db/assistant.db`
|
|
1952
|
-
| Sandbox filesystem | `~/.vellum/workspace`
|
|
1953
|
-
| Tool permission rules | `~/.vellum/protected/trust.json`
|
|
1954
|
-
| Web users & assistants | PostgreSQL
|
|
1955
|
-
| Trace events | In-memory (TraceStore)
|
|
1956
|
-
| Media embed settings | `~/.vellum/workspace/config.json` (`ui.mediaEmbeds`)
|
|
1957
|
-
| Media embed MIME cache | In-memory (`ImageMIMEProbe`)
|
|
1958
|
-
| Tasks & task runs | `~/.vellum/workspace/data/db/assistant.db`
|
|
1959
|
-
| Work items (Task Queue) | `~/.vellum/workspace/data/db/assistant.db`
|
|
1960
|
-
| Recurrence schedules & runs | `~/.vellum/workspace/data/db/assistant.db`
|
|
1961
|
-
| Watchers & events | `~/.vellum/workspace/data/db/assistant.db`
|
|
1962
|
-
| Proxy CA cert + key | `{dataDir}/proxy-ca/`
|
|
1963
|
-
| Proxy leaf certs | `{dataDir}/proxy-ca/issued/`
|
|
1964
|
-
| Proxy sessions | In-memory (SessionManager)
|
|
1965
|
-
| Call sessions, events, pending questions | `~/.vellum/workspace/data/db/assistant.db`
|
|
1966
|
-
| Active call controllers | In-memory (CallState)
|
|
1967
|
-
| Guardian bindings | `~/.vellum/workspace/data/db/assistant.db`
|
|
1968
|
-
| Channel verification sessions | `~/.vellum/workspace/data/db/assistant.db`
|
|
1969
|
-
| Guardian approval requests | `~/.vellum/workspace/data/db/assistant.db`
|
|
1970
|
-
| Contact invites | `~/.vellum/workspace/data/db/assistant.db`
|
|
1971
|
-
| Contacts & channels | `~/.vellum/workspace/data/db/assistant.db`
|
|
1972
|
-
| Notification events | `~/.vellum/workspace/data/db/assistant.db`
|
|
1973
|
-
| Notification decisions | `~/.vellum/workspace/data/db/assistant.db`
|
|
1974
|
-
| Notification deliveries | `~/.vellum/workspace/data/db/assistant.db`
|
|
1975
|
-
| Notification preferences | `~/.vellum/workspace/data/db/assistant.db`
|
|
1938
|
+
| What | Where | Format | ORM/Driver | Retention |
|
|
1939
|
+
| ---------------------------------------- | ---------------------------------------------------- | ----------------------------------- | ---------------------------------- | ------------------------------------------------------- |
|
|
1940
|
+
| API key | CES / encrypted file store | Encrypted binary | CES API / `secure-keys.ts` | Permanent |
|
|
1941
|
+
| Credential secrets | CES / encrypted file store | Encrypted binary | `secure-keys.ts` wrapper | Permanent (until deleted via tool) |
|
|
1942
|
+
| Credential metadata | `~/.vellum/workspace/data/credentials/metadata.json` | JSON | Atomic file write | Permanent (until deleted via tool) |
|
|
1943
|
+
| Integration OAuth tokens | CES / encrypted file store (via `secure-keys.ts`) | Encrypted binary | `TokenManager` auto-refresh | Until disconnected or revoked |
|
|
1944
|
+
| User preferences | UserDefaults | plist | Foundation | Permanent |
|
|
1945
|
+
| Session logs | `~/Library/.../logs/session-*.json` | JSON per session | Swift Codable | Unbounded |
|
|
1946
|
+
| Conversations & messages | `~/.vellum/workspace/data/db/assistant.db` | SQLite + WAL | Drizzle ORM (Bun) | Permanent |
|
|
1947
|
+
| Memory segments | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent |
|
|
1948
|
+
| Extracted facts | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent, deduped |
|
|
1949
|
+
| Embeddings | `~/.vellum/workspace/data/db/assistant.db` | JSON float arrays | Drizzle ORM | Permanent |
|
|
1950
|
+
| Async job queue | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Completed jobs persist |
|
|
1951
|
+
| Attachments | `~/.vellum/workspace/data/db/assistant.db` | Base64 in SQLite | Drizzle ORM | Permanent |
|
|
1952
|
+
| Sandbox filesystem | `~/.vellum/workspace` | Real filesystem tree | Node FS APIs | Persistent across sessions |
|
|
1953
|
+
| Tool permission rules | `~/.vellum/protected/trust.json` | JSON | File I/O | Permanent |
|
|
1954
|
+
| Web users & assistants | PostgreSQL | Relational | Drizzle ORM (pg) | Permanent |
|
|
1955
|
+
| Trace events | In-memory (TraceStore) | Structured events | Swift ObservableObject | Max 5,000 per session, ephemeral |
|
|
1956
|
+
| Media embed settings | `~/.vellum/workspace/config.json` (`ui.mediaEmbeds`) | JSON | `WorkspaceConfigIO` (atomic merge) | Permanent |
|
|
1957
|
+
| Media embed MIME cache | In-memory (`ImageMIMEProbe`) | `NSCache` (500 entries) | HTTP HEAD | Ephemeral; cleared on app restart |
|
|
1958
|
+
| Tasks & task runs | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent |
|
|
1959
|
+
| Work items (Task Queue) | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; archived items retained |
|
|
1960
|
+
| Recurrence schedules & runs | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; supports cron and RRULE syntax |
|
|
1961
|
+
| Watchers & events | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent, cascade on watcher delete |
|
|
1962
|
+
| Proxy CA cert + key | `{dataDir}/proxy-ca/` | PEM files (ca.pem, ca-key.pem) | openssl CLI | Permanent (10-year validity) |
|
|
1963
|
+
| Proxy leaf certs | `{dataDir}/proxy-ca/issued/` | PEM files per hostname | openssl CLI, cached | 1-year validity, re-issued on CA change |
|
|
1964
|
+
| Proxy sessions | In-memory (SessionManager) | Map<ProxySessionId, ManagedSession> | Manual lifecycle | Ephemeral; 5min idle timeout, cleared on shutdown |
|
|
1965
|
+
| Call sessions, events, pending questions | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent, cascade on session delete |
|
|
1966
|
+
| Active call controllers | In-memory (CallState) | Map<callSessionId, CallController> | Manual lifecycle | Ephemeral; cleared on call end or destroy |
|
|
1967
|
+
| Guardian bindings | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; revoked bindings retained |
|
|
1968
|
+
| Channel verification sessions | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; consumed/expired sessions retained |
|
|
1969
|
+
| Guardian approval requests | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; decision outcome retained |
|
|
1970
|
+
| Contact invites | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; token hash stored, raw token never persisted |
|
|
1971
|
+
| Contacts & channels | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; revoked/blocked contacts retained |
|
|
1972
|
+
| Notification events | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; deduplicated by dedupeKey |
|
|
1973
|
+
| Notification decisions | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; FK to notification_events |
|
|
1974
|
+
| Notification deliveries | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; FK to notification_decisions |
|
|
1975
|
+
| Notification preferences | `~/.vellum/workspace/data/db/assistant.db` | SQLite | Drizzle ORM | Permanent; per-assistant conversational preferences |
|
|
1976
1976
|
|
|
1977
1977
|
### Sensitive Tool Output Placeholder Substitution
|
|
1978
1978
|
|
package/Dockerfile
CHANGED
|
@@ -50,14 +50,7 @@ graph TB
|
|
|
50
50
|
|
|
51
51
|
subgraph "Slack Skill (bundled-skills/slack/)"
|
|
52
52
|
SLACK_SKILL_MD["SKILL.md<br/>agent instructions"]
|
|
53
|
-
|
|
54
|
-
SLACK_DETAILS["slack_channel_details"]
|
|
55
|
-
SLACK_CONFIGURE["slack_configure_channels"]
|
|
56
|
-
SLACK_REACT["slack_add_reaction"]
|
|
57
|
-
SLACK_DELETE["slack_delete_message"]
|
|
58
|
-
SLACK_EDIT["slack_edit_message"]
|
|
59
|
-
SLACK_LEAVE["slack_leave_channel"]
|
|
60
|
-
SLACK_PERMS["slack_channel_permissions"]
|
|
53
|
+
SLACK_WEB_API["Web API via bash<br/>(network_mode: proxied)"]
|
|
61
54
|
end
|
|
62
55
|
|
|
63
56
|
subgraph "Sequences Skill (bundled-skills/sequences/)"
|
|
@@ -107,7 +100,7 @@ graph TB
|
|
|
107
100
|
SEND --> SHARED
|
|
108
101
|
STYLE --> STYLE_ANALYZER
|
|
109
102
|
GMAIL_ARCHIVE --> GMAIL_ADAPTER
|
|
110
|
-
|
|
103
|
+
SLACK_WEB_API --> SLACK_API
|
|
111
104
|
```
|
|
112
105
|
|
|
113
106
|
### Data Flow
|
|
@@ -151,7 +144,7 @@ sequenceDiagram
|
|
|
151
144
|
|
|
152
145
|
Note over UI,API: Tool Execution Flow
|
|
153
146
|
Tool->>TokenMgr: withValidToken("gmail", callback)
|
|
154
|
-
TokenMgr->>Store: getConnectionByProvider("
|
|
147
|
+
TokenMgr->>Store: getConnectionByProvider("google")
|
|
155
148
|
TokenMgr->>Vault: getSecureKeyAsync("oauth_connection/{conn.id}/access_token")
|
|
156
149
|
TokenMgr->>Store: check oauth_connections.expires_at
|
|
157
150
|
alt Token expired
|
|
@@ -173,7 +166,7 @@ sequenceDiagram
|
|
|
173
166
|
|
|
174
167
|
| Decision | Rationale |
|
|
175
168
|
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
176
|
-
| PKCE by default, optional client_secret | Desktop apps prefer PKCE; some providers (Slack) require a secret, which is stored in the credential store (`oauth_app/{id}/client_secret`) for autonomous refresh
|
|
169
|
+
| PKCE by default, optional client_secret | Desktop apps prefer PKCE; some providers (Slack) require a secret, which is stored in the credential store (`oauth_app/{id}/client_secret`) for autonomous refresh |
|
|
177
170
|
| Shared connect orchestrator | All OAuth providers route through `orchestrateOAuthConnect()`, which resolves profiles, enforces scope policy, runs the flow, stores tokens, and verifies identity. Adding a provider is a declarative profile entry, not new orchestration code |
|
|
178
171
|
| Canonical credential naming | All reads and writes use `client_id`/`client_secret` as canonical field names |
|
|
179
172
|
| Gateway callback transport | OAuth callbacks are now routed through the gateway at `${ingress.publicBaseUrl}/webhooks/oauth/callback` instead of a loopback redirect URI. This enables OAuth flows to work in remote and tunneled deployments. |
|
|
@@ -203,32 +196,33 @@ sequenceDiagram
|
|
|
203
196
|
| `assistant/src/watcher/providers/gmail.ts` | Gmail watcher using History API |
|
|
204
197
|
| `assistant/src/watcher/providers/github.ts` | GitHub watcher for PRs, issues, review requests, and mentions |
|
|
205
198
|
| `assistant/src/watcher/providers/linear.ts` | Linear watcher for assigned issues, status changes, and @mentions |
|
|
206
|
-
| `assistant/src/oauth/
|
|
199
|
+
| `assistant/src/oauth/seed-providers.ts` | Provider seed data: injection templates, identity config, setup metadata (seeded to DB on startup) |
|
|
207
200
|
| `assistant/src/oauth/connect-orchestrator.ts` | Shared OAuth connect orchestrator: profile resolution, scope policy, flow execution, token storage |
|
|
208
201
|
| `assistant/src/oauth/scope-policy.ts` | Deterministic scope resolution and policy enforcement |
|
|
209
|
-
| `assistant/src/oauth/connect-types.ts` | Shared types: `
|
|
202
|
+
| `assistant/src/oauth/connect-types.ts` | Shared types: `OAuthScopePolicy`, `OAuthConnectResult` |
|
|
210
203
|
| `assistant/src/oauth/token-persistence.ts` | Token storage helper: persists tokens, metadata, and runs post-connect hooks |
|
|
211
204
|
| `assistant/src/daemon/handlers/oauth-connect.ts` | Generic OAuth connect handler (`oauth_connect_start` / `oauth_connect_result`) |
|
|
212
205
|
|
|
213
206
|
---
|
|
214
207
|
|
|
215
|
-
## OAuth Extensibility — Provider
|
|
208
|
+
## OAuth Extensibility — DB-Driven Provider Config, Scope Policy, and Connect Orchestrator
|
|
216
209
|
|
|
217
|
-
The OAuth extensibility layer makes adding a new OAuth provider a declarative operation.
|
|
210
|
+
The OAuth extensibility layer makes adding a new OAuth provider a fully declarative operation. All provider configuration — protocol fields (auth URLs, token URLs, scopes, scope policy), behavioral fields (identity verification, injection templates, setup metadata), and display metadata — is stored in the `oauth_providers` SQLite table and seeded on startup via `seed-providers.ts`. The shared **connect orchestrator** handles the full flow from provider resolution through token storage.
|
|
218
211
|
|
|
219
|
-
### Provider
|
|
212
|
+
### Provider Configuration (DB-Driven)
|
|
220
213
|
|
|
221
|
-
`assistant/src/oauth/
|
|
214
|
+
All provider config lives in the `oauth_providers` table. Built-in providers are seeded on every startup by `assistant/src/oauth/seed-providers.ts`, which upserts rows from the `PROVIDER_SEED_DATA` constant. Custom providers can be registered via the CLI (`assistant oauth providers register`).
|
|
222
215
|
|
|
223
|
-
|
|
224
|
-
| -------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
225
|
-
| `identityVerifier` | Async function that fetches human-readable account info (e.g. `@username`, email) after token exchange |
|
|
226
|
-
| `setup` | Optional metadata for the generic OAuth setup skill (display name, dashboard URL, app type) |
|
|
227
|
-
| `injectionTemplates` | Auto-applied credential injection rules for the script proxy |
|
|
216
|
+
Each provider row includes:
|
|
228
217
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
218
|
+
| Column group | Fields | Purpose |
|
|
219
|
+
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
220
|
+
| **Protocol** | `authUrl`, `tokenUrl`, `tokenEndpointAuthMethod`, `callbackTransport`, `extraParams`, `loopbackPort` | OAuth2 flow parameters |
|
|
221
|
+
| **Scopes** | `defaultScopes`, `scopePolicy` | Deterministic scope resolution (user-customizable, preserved across seed restarts) |
|
|
222
|
+
| **Identity verification** | `identityUrl`, `identityMethod`, `identityHeaders`, `identityBody`, `identityResponsePaths`, `identityFormat`, `identityOkField` | Data-driven identity verifier fetches human-readable account info after token exchange |
|
|
223
|
+
| **Injection templates** | `injectionTemplates` | Auto-applied credential injection rules for the script proxy |
|
|
224
|
+
| **Setup metadata** | `displayName`, `description`, `dashboardUrl`, `appType`, `setupNotes`, `requiresClientSecret` | Metadata for the generic OAuth setup skill |
|
|
225
|
+
| **Ping config** | `pingUrl`, `pingMethod`, `pingHeaders`, `pingBody` | Health-check endpoint for `assistant oauth ping` |
|
|
232
226
|
|
|
233
227
|
### Scope Policy Engine
|
|
234
228
|
|
|
@@ -247,12 +241,12 @@ Returns `{ ok: true, scopes }` or `{ ok: false, error, allowedScopes }`.
|
|
|
247
241
|
|
|
248
242
|
`assistant/src/oauth/connect-orchestrator.ts` exports `orchestrateOAuthConnect(options)`, which runs the full OAuth2 flow:
|
|
249
243
|
|
|
250
|
-
1. **
|
|
251
|
-
2. **Load
|
|
244
|
+
1. **Receive canonical provider name** — the orchestrator receives the canonical provider name directly (e.g. `google`, `slack`).
|
|
245
|
+
2. **Load provider row** — reads all config from the `oauth_providers` DB table.
|
|
252
246
|
3. **Compute scopes** — `resolveScopes()` with scope policy enforcement.
|
|
253
247
|
4. **Build OAuth config** — assemble protocol-level config from the DB provider row.
|
|
254
248
|
5. **Run flow** — interactive (opens browser, blocks until completion) or deferred (returns auth URL for the caller to deliver).
|
|
255
|
-
6. **Verify identity** — runs the
|
|
249
|
+
6. **Verify identity** — runs the generic data-driven identity verifier using the provider row's identity columns.
|
|
256
250
|
7. **Store tokens** — `storeOAuth2Tokens()` persists access/refresh tokens, client credentials, and metadata.
|
|
257
251
|
|
|
258
252
|
Result is a discriminated union: `{ success, deferred, grantedScopes, accountInfo }` or `{ success: false, error }`.
|
|
@@ -270,24 +264,25 @@ This replaces provider-specific handlers — any provider in the registry can be
|
|
|
270
264
|
|
|
271
265
|
### Adding a New OAuth Provider
|
|
272
266
|
|
|
273
|
-
1. **
|
|
274
|
-
- Set `authUrl`, `tokenUrl`, `defaultScopes`, `scopePolicy`,
|
|
275
|
-
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
|
|
267
|
+
1. **Add seed data** to `PROVIDER_SEED_DATA` in `assistant/src/oauth/seed-providers.ts`:
|
|
268
|
+
- Set protocol fields: `authUrl`, `tokenUrl`, `defaultScopes`, `scopePolicy`, `callbackTransport`.
|
|
269
|
+
- Set identity verification: `identityUrl`, `identityMethod`, `identityHeaders`, `identityResponsePaths`, `identityFormat`.
|
|
270
|
+
- Set injection templates: `injectionTemplates` for providers whose tokens should be auto-injected by the script proxy.
|
|
271
|
+
- Set setup metadata: `displayName`, `dashboardUrl`, `appType` enable the generic OAuth setup skill to guide users through app creation.
|
|
272
|
+
2. **Alternatively, register dynamically** via the CLI: `assistant oauth providers register <key> --auth-url ... --token-url ...`.
|
|
279
273
|
3. **No handler code needed** — the generic `oauth_connect_start` handler and the connect orchestrator handle the flow automatically.
|
|
280
274
|
|
|
281
275
|
### Key Source Files
|
|
282
276
|
|
|
283
|
-
| File | Role
|
|
284
|
-
| ------------------------------------------------ |
|
|
285
|
-
| `assistant/src/oauth/
|
|
286
|
-
| `assistant/src/oauth/scope-policy.ts` | Scope resolution and policy enforcement (pure, no I/O)
|
|
287
|
-
| `assistant/src/oauth/connect-orchestrator.ts` | Shared connect orchestrator (profile → scopes → flow → tokens)
|
|
288
|
-
| `assistant/src/oauth/connect-types.ts` | Shared types (`
|
|
289
|
-
| `assistant/src/oauth/token-persistence.ts` | Token storage: credential store writes, metadata upsert, post-connect hooks
|
|
290
|
-
| `assistant/src/
|
|
277
|
+
| File | Role |
|
|
278
|
+
| ------------------------------------------------ | --------------------------------------------------------------------------- |
|
|
279
|
+
| `assistant/src/oauth/seed-providers.ts` | Provider seed data and startup seeding |
|
|
280
|
+
| `assistant/src/oauth/scope-policy.ts` | Scope resolution and policy enforcement (pure, no I/O) |
|
|
281
|
+
| `assistant/src/oauth/connect-orchestrator.ts` | Shared connect orchestrator (profile → scopes → flow → tokens) |
|
|
282
|
+
| `assistant/src/oauth/connect-types.ts` | Shared types (`OAuthScopePolicy`, `OAuthConnectResult`) |
|
|
283
|
+
| `assistant/src/oauth/token-persistence.ts` | Token storage: credential store writes, metadata upsert, post-connect hooks |
|
|
284
|
+
| `assistant/src/oauth/identity-verifier.ts` | Generic data-driven identity verifier (reads config from provider DB row) |
|
|
285
|
+
| `assistant/src/daemon/handlers/oauth-connect.ts` | Generic `oauth_connect_start` / `oauth_connect_result` handler |
|
|
291
286
|
|
|
292
287
|
---
|
|
293
288
|
|
|
@@ -154,7 +154,6 @@ graph TB
|
|
|
154
154
|
BUDGET["Dynamic Recall Budget<br/>computeRecallBudget()<br/>from prompt headroom"]
|
|
155
155
|
EMBED_Q["Generate dense + sparse<br/>query embeddings"]
|
|
156
156
|
HYBRID["Hybrid Search<br/>dense + sparse RRF on Qdrant"]
|
|
157
|
-
RECENCY["Recency Search<br/>conversation-scoped, DB only"]
|
|
158
157
|
MERGE["Merge + Deduplicate<br/>weighted score combination"]
|
|
159
158
|
SCOPE["Scope Filter<br/>scope_id filtering<br/>(strict | global_fallback)<br/>Private conversations: own scope + 'default'"]
|
|
160
159
|
TIER["Tier Classification<br/>score > 0.8 → tier 1<br/>score > 0.6 → tier 2<br/>below → dropped"]
|
|
@@ -218,9 +217,7 @@ graph TB
|
|
|
218
217
|
EMBED_Q --> SPARSE_GEN
|
|
219
218
|
EMBED_Q --> HYBRID
|
|
220
219
|
HYBRID --> RRF
|
|
221
|
-
QUERY --> RECENCY
|
|
222
220
|
HYBRID --> SCOPE
|
|
223
|
-
RECENCY --> SCOPE
|
|
224
221
|
SCOPE --> MERGE
|
|
225
222
|
MERGE --> TIER
|
|
226
223
|
TIER --> STALE
|
|
@@ -337,24 +334,22 @@ The recall pipeline runs on every turn that passes the `needsMemory` gate (skips
|
|
|
337
334
|
|
|
338
335
|
3. **Hybrid search on Qdrant**: When both dense and sparse vectors are available, the pipeline uses Qdrant's query API with two prefetch stages (dense and sparse, each fetching up to 40 candidates) fused via Reciprocal Rank Fusion (RRF). Falls back to dense-only search when sparse vectors are unavailable.
|
|
339
336
|
|
|
340
|
-
4. **
|
|
337
|
+
4. **Merge and deduplicate**: Hybrid candidates are deduplicated by key. A weighted final score is computed: `0.4 + importance * 0.25 + confidence * 0.15 + recency * 0.2`, where `recency` is a logarithmic time-decay score (ACT-R inspired) based on when the item was last seen.
|
|
341
338
|
|
|
342
|
-
5. **
|
|
343
|
-
|
|
344
|
-
6. **Tier classification** (`tier-classifier.ts`): Score-based, deterministic classification:
|
|
339
|
+
5. **Tier classification** (`tier-classifier.ts`): Score-based, deterministic classification:
|
|
345
340
|
- `finalScore > 0.8` → **tier 1** (high relevance)
|
|
346
341
|
- `finalScore > 0.6` → **tier 2** (possibly relevant)
|
|
347
342
|
- Below 0.6 → dropped
|
|
348
343
|
|
|
349
|
-
|
|
344
|
+
6. **Staleness computation** (`staleness.ts`): Each item candidate is annotated with a staleness level based on its age relative to a kind-specific base lifetime (see table above). The effective lifetime is extended by a reinforcement factor: `baseLifetime * (1 + 0.3 * (sourceConversationCount - 1))`, so items mentioned across multiple conversations age more slowly. Staleness levels:
|
|
350
345
|
- `ratio < 0.5` → `fresh`
|
|
351
346
|
- `ratio <= 1.0` → `aging`
|
|
352
347
|
- `ratio <= 2.0` → `stale`
|
|
353
348
|
- `ratio > 2.0` → `very_stale`
|
|
354
349
|
|
|
355
|
-
|
|
350
|
+
7. **Stale demotion**: `very_stale` tier 1 candidates are demoted to tier 2, preventing old information from occupying prime injection space.
|
|
356
351
|
|
|
357
|
-
|
|
352
|
+
8. **Two-layer XML injection** (`formatting.ts`): Budget-aware rendering into four XML sections:
|
|
358
353
|
|
|
359
354
|
```xml
|
|
360
355
|
<memory_context __injected>
|
|
@@ -380,7 +375,7 @@ The recall pipeline runs on every turn that passes the `needsMemory` gate (skips
|
|
|
380
375
|
|
|
381
376
|
Empty sections are omitted. Each section has a per-item token budget (150 tokens for tier 1, 100 for tier 2). Tier 1 sections consume budget first; tier 2 uses the remainder.
|
|
382
377
|
|
|
383
|
-
|
|
378
|
+
9. **Injection strategy**: The rendered `<memory_context __injected>` block is prepended as a text content block to the last user message (`injectMemoryRecallAsUserBlock`), following the same pattern as workspace, temporal, and other runtime injections. Stripping is handled by the generic `stripUserTextBlocksByPrefix` mechanism matching the `<memory_context __injected>` prefix (with a backward-compat entry for the legacy `<memory_context>` prefix from older history). This avoids synthetic message pairs and preserves prompt prefix caching between turns.
|
|
384
379
|
|
|
385
380
|
### Internal-Only Trust Gating
|
|
386
381
|
|
|
@@ -412,7 +407,7 @@ When the embedding backend or Qdrant is unavailable:
|
|
|
412
407
|
|
|
413
408
|
- A **circuit breaker** on Qdrant (`qdrant-circuit-breaker.ts`) tracks consecutive failures and short-circuits search calls when the breaker is open.
|
|
414
409
|
- If embedding generation fails and `memory.embeddings.required` is `true`, recall returns an empty result with a degradation status (`embedding_generation_failed` or `embedding_provider_down`).
|
|
415
|
-
- If embeddings are optional (default), the pipeline
|
|
410
|
+
- If embeddings are optional (default), the pipeline returns empty results (no fallback search path exists without Qdrant).
|
|
416
411
|
- Degradation status is reported to clients via `memory_status` events.
|
|
417
412
|
|
|
418
413
|
---
|
|
@@ -56,7 +56,7 @@ CES tools use the standard `class ... implements Tool` registration pattern. The
|
|
|
56
56
|
|
|
57
57
|
### 1. `host_bash` is outside the strong secrecy guarantee
|
|
58
58
|
|
|
59
|
-
The existing `host_bash` tool executes commands on the host machine without any credential isolation. When an agent uses `host_bash`, it has full access to the host environment, including any credentials stored in environment variables, config files, or
|
|
59
|
+
The existing `host_bash` tool executes commands on the host machine without any credential isolation. When an agent uses `host_bash`, it has full access to the host environment, including any credentials stored in environment variables, config files, or credential stores accessible to the user. CES does not attempt to intercept or sandbox `host_bash` invocations.
|
|
60
60
|
|
|
61
61
|
**Implication**: `host_bash` represents a weaker security tier. Agents that require the strong secrecy guarantee must use `run_authenticated_command` instead. Trust rules and permission policies should reflect this distinction — managed deployments may deny `host_bash` entirely for untrusted agents while allowing `run_authenticated_command`.
|
|
62
62
|
|
|
@@ -237,13 +237,13 @@ CES is rolled out incrementally via feature flags, all defaulting to `false` (of
|
|
|
237
237
|
|
|
238
238
|
Enable flags in this order. Each flag is safe to enable independently, but later flags depend on earlier ones being on for meaningful behavior.
|
|
239
239
|
|
|
240
|
-
| Order | Flag
|
|
241
|
-
| ----- |
|
|
242
|
-
| 1 | `
|
|
243
|
-
| 2 | `
|
|
244
|
-
| 3 | `
|
|
245
|
-
| 4 | `
|
|
246
|
-
| 5 | `
|
|
240
|
+
| Order | Flag | Gate | Safe to enable alone? |
|
|
241
|
+
| ----- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
242
|
+
| 1 | `ces-tools` | Register CES tools (`run_authenticated_command`, `make_authenticated_request`, `manage_secure_command_tool`) in the agent loop | Yes — tools register but are not invoked unless the agent discovers credentials that require CES |
|
|
243
|
+
| 2 | `ces-shell-lockdown` | Enforce shell lockdown for untrusted agents with CES-active credentials; direct shell access to credentialed services is denied | Yes — only activates when CES credentials are present |
|
|
244
|
+
| 3 | `ces-secure-install` | Route tool/command installation through CES secure bundle pipeline instead of direct shell | Yes — falls back to standard install if CES is unavailable |
|
|
245
|
+
| 4 | `ces-grant-audit` | Gate CLI execution of grant listing, grant revocation, and audit inspection commands (commands are always registered but check the flag at runtime) | Yes — read-only inspection surfaces |
|
|
246
|
+
| 5 | `ces-managed-sidecar` | Use managed sidecar transport (Unix socket) instead of local child-process transport | **No** — requires the CES sidecar container to be present in the pod template. Only enable after the sidecar image is deployed. |
|
|
247
247
|
|
|
248
248
|
### Dark-launching the managed sidecar
|
|
249
249
|
|
|
@@ -325,7 +325,7 @@ Risks that are acknowledged and accepted for v1, documented here so they are exp
|
|
|
325
325
|
|
|
326
326
|
### 1. `host_bash` is a weaker security tier
|
|
327
327
|
|
|
328
|
-
`host_bash` executes commands on the host machine with full access to the host environment. CES does not intercept or sandbox `host_bash` invocations. An untrusted agent with `host_bash` access can read credentials from environment variables, config files, or
|
|
328
|
+
`host_bash` executes commands on the host machine with full access to the host environment. CES does not intercept or sandbox `host_bash` invocations. An untrusted agent with `host_bash` access can read credentials from environment variables, config files, or credential stores.
|
|
329
329
|
|
|
330
330
|
**Mitigation**: Trust rules and permission policies should deny `host_bash` for untrusted agents in managed deployments. This is a policy enforcement, not a technical guarantee. The CES process-boundary isolation only protects operations routed through CES tools.
|
|
331
331
|
|
package/docs/skills.md
CHANGED
|
@@ -198,7 +198,7 @@ Malformed tokens do not silently pass through — they are collected as errors a
|
|
|
198
198
|
|
|
199
199
|
### Feature flag
|
|
200
200
|
|
|
201
|
-
Inline command expansion is gated by the `inline-skill-commands` feature flag (key: `
|
|
201
|
+
Inline command expansion is gated by the `inline-skill-commands` feature flag (key: `inline-skill-commands`). The flag defaults to **enabled**.
|
|
202
202
|
|
|
203
203
|
When the flag is disabled and a skill contains inline command expansion tokens, `skill_load` returns an error rather than delivering unexpanded tokens to the model. This fail-closed behavior prevents the LLM from seeing raw expansion tokens and attempting to interpret them.
|
|
204
204
|
|
|
@@ -71,19 +71,19 @@ describe("handles", () => {
|
|
|
71
71
|
|
|
72
72
|
describe("localOAuthHandle", () => {
|
|
73
73
|
test("constructs the expected format", () => {
|
|
74
|
-
expect(localOAuthHandle("
|
|
75
|
-
"local_oauth:
|
|
74
|
+
expect(localOAuthHandle("google", "conn-123")).toBe(
|
|
75
|
+
"local_oauth:google/conn-123",
|
|
76
76
|
);
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
test("roundtrips
|
|
80
|
-
const raw = localOAuthHandle("
|
|
79
|
+
test("roundtrips through parseHandle", () => {
|
|
80
|
+
const raw = localOAuthHandle("slack", "conn-abc");
|
|
81
81
|
const result = parseHandle(raw);
|
|
82
82
|
expect(result.ok).toBe(true);
|
|
83
83
|
if (!result.ok) return;
|
|
84
84
|
expect(result.handle.type).toBe(HandleType.LocalOAuth);
|
|
85
85
|
if (result.handle.type !== HandleType.LocalOAuth) return;
|
|
86
|
-
expect(result.handle.providerKey).toBe("
|
|
86
|
+
expect(result.handle.providerKey).toBe("slack");
|
|
87
87
|
expect(result.handle.connectionId).toBe("conn-abc");
|
|
88
88
|
});
|
|
89
89
|
});
|
|
@@ -133,7 +133,7 @@ describe("handles", () => {
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
test("rejects local_oauth with no slash", () => {
|
|
136
|
-
const result = parseHandle("local_oauth:
|
|
136
|
+
const result = parseHandle("local_oauth:google");
|
|
137
137
|
expect(result.ok).toBe(false);
|
|
138
138
|
});
|
|
139
139
|
|
|
@@ -150,7 +150,7 @@ describe("handles", () => {
|
|
|
150
150
|
).not.toThrow();
|
|
151
151
|
expect(() =>
|
|
152
152
|
CredentialHandleSchema.parse(
|
|
153
|
-
"local_oauth:
|
|
153
|
+
"local_oauth:google/conn-1",
|
|
154
154
|
),
|
|
155
155
|
).not.toThrow();
|
|
156
156
|
expect(() =>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* 2. **Local OAuth** — references a locally persisted OAuth connection.
|
|
15
15
|
* Format: `local_oauth:<providerKey>/<connectionId>` where providerKey
|
|
16
|
-
*
|
|
16
|
+
* is the bare provider name (e.g. `google`).
|
|
17
17
|
*
|
|
18
18
|
* 3. **Managed OAuth** — references an OAuth connection managed by the
|
|
19
19
|
* platform. Format: `platform_oauth:<connectionId>` where connectionId
|
|
@@ -50,7 +50,7 @@ export interface LocalStaticHandle {
|
|
|
50
50
|
|
|
51
51
|
export interface LocalOAuthHandle {
|
|
52
52
|
type: typeof HandleType.LocalOAuth;
|
|
53
|
-
/** Provider key (e.g. "
|
|
53
|
+
/** Provider key (e.g. "google", "slack"). */
|
|
54
54
|
providerKey: string;
|
|
55
55
|
/** Connection identifier. */
|
|
56
56
|
connectionId: string;
|
|
@@ -146,8 +146,9 @@ export function parseHandle(raw: string): ParseHandleResult {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
case HandleType.LocalOAuth: {
|
|
149
|
-
// providerKey
|
|
150
|
-
//
|
|
149
|
+
// providerKey is typically a bare name (e.g. "google"), but legacy handles
|
|
150
|
+
// may contain a colon (e.g. "integration:google"), so we split on the
|
|
151
|
+
// *last* "/" to separate providerKey from connectionId.
|
|
151
152
|
const lastSlashIdx = rest.lastIndexOf("/");
|
|
152
153
|
if (
|
|
153
154
|
lastSlashIdx === -1 ||
|
|
@@ -73,8 +73,8 @@ export interface InjectionTemplate {
|
|
|
73
73
|
export type SecureKeyDeleteResult = "deleted" | "not-found" | "error";
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
|
-
* Abstraction over the underlying secure-key backend (e.g.
|
|
77
|
-
*
|
|
76
|
+
* Abstraction over the underlying secure-key backend (e.g. encrypted file
|
|
77
|
+
* store). Implementations handle platform-specific details.
|
|
78
78
|
*/
|
|
79
79
|
export interface SecureKeyBackend {
|
|
80
80
|
/** Retrieve a secret value by key. Returns undefined if not found. */
|
|
@@ -98,7 +98,7 @@ export interface SecureKeyBackend {
|
|
|
98
98
|
export interface OAuthConnectionRecord {
|
|
99
99
|
/** Unique identifier for this connection. */
|
|
100
100
|
id: string;
|
|
101
|
-
/** Provider key (e.g. "
|
|
101
|
+
/** Provider key (e.g. "google", "slack"). */
|
|
102
102
|
providerKey: string;
|
|
103
103
|
/** Account identifier (e.g. email address). */
|
|
104
104
|
accountInfo: string | null;
|
|
@@ -233,7 +233,7 @@ export class StaticCredentialMetadataStore {
|
|
|
233
233
|
|
|
234
234
|
/**
|
|
235
235
|
* Throws if the metadata file has an unrecognized version.
|
|
236
|
-
* Call this before performing irreversible
|
|
236
|
+
* Call this before performing irreversible credential store operations
|
|
237
237
|
* so the operation fails cleanly before any side effects.
|
|
238
238
|
*/
|
|
239
239
|
assertWritable(): void {
|