@vellumai/assistant 0.4.44 → 0.4.45
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/.prettierignore +4 -0
- package/ARCHITECTURE.md +34 -31
- package/README.md +4 -4
- package/bun.lock +10 -35
- package/docs/architecture/integrations.md +102 -197
- package/docs/architecture/keychain-broker.md +1 -1
- package/docs/architecture/memory.md +2 -2
- package/docs/architecture/scheduling.md +1 -1
- package/docs/architecture/security.md +11 -11
- package/docs/error-handling.md +1 -1
- package/docs/trusted-contact-access.md +3 -3
- package/drizzle/meta/0000_snapshot.json +34 -100
- package/drizzle/meta/_journal.json +1 -1
- package/drizzle.config.ts +4 -4
- package/package.json +3 -2
- package/scripts/capture-x-graphql.ts +237 -141
- package/scripts/generate-bundled-tool-registry.ts +223 -0
- package/src/__tests__/access-request-decision.test.ts +0 -1
- package/src/__tests__/actor-token-service.test.ts +23 -24
- package/src/__tests__/agent-loop.test.ts +0 -131
- package/src/__tests__/always-loaded-tools-guard.test.ts +71 -0
- package/src/__tests__/amazon-cdp-integration.test.ts +11 -9
- package/src/__tests__/approval-primitive.test.ts +0 -1
- package/src/__tests__/approval-routes-http.test.ts +11 -1
- package/src/__tests__/asset-materialize-tool.test.ts +0 -1
- package/src/__tests__/asset-search-tool.test.ts +0 -1
- package/src/__tests__/assistant-attachment-directive.test.ts +1 -1
- package/src/__tests__/assistant-events-sse-hardening.test.ts +0 -1
- package/src/__tests__/assistant-feature-flag-guardrails.test.ts +0 -2
- package/src/__tests__/assistant-feature-flags-integration.test.ts +70 -18
- package/src/__tests__/assistant-id-boundary-guard.test.ts +6 -6
- package/src/__tests__/attachments-store.test.ts +0 -1
- package/src/__tests__/avatar-e2e.test.ts +74 -115
- package/src/__tests__/avatar-router.test.ts +25 -62
- package/src/__tests__/browser-manager.test.ts +24 -0
- package/src/__tests__/browser-skill-baseline-tool-payload.test.ts +4 -3
- package/src/__tests__/browser-skill-endstate.test.ts +8 -11
- package/src/__tests__/btw-routes.test.ts +326 -0
- package/src/__tests__/bundled-skill-retrieval-guard.test.ts +23 -9
- package/src/__tests__/call-controller.test.ts +0 -1
- package/src/__tests__/call-conversation-messages.test.ts +0 -1
- package/src/__tests__/call-domain.test.ts +0 -1
- package/src/__tests__/call-pointer-messages.test.ts +0 -1
- package/src/__tests__/call-recovery.test.ts +0 -1
- package/src/__tests__/call-routes-http.test.ts +0 -1
- package/src/__tests__/call-store.test.ts +0 -1
- package/src/__tests__/canonical-guardian-store.test.ts +0 -1
- package/src/__tests__/channel-approval-routes.test.ts +1 -1
- package/src/__tests__/channel-approvals.test.ts +1 -1
- package/src/__tests__/channel-delivery-store.test.ts +0 -1
- package/src/__tests__/channel-guardian.test.ts +5 -7
- package/src/__tests__/channel-retry-sweep.test.ts +0 -1
- package/src/__tests__/checker.test.ts +4 -11
- package/src/__tests__/compaction.benchmark.test.ts +16 -14
- package/src/__tests__/computer-use-session-lifecycle.test.ts +10 -11
- package/src/__tests__/computer-use-session-working-dir.test.ts +2 -6
- package/src/__tests__/computer-use-skill-lifecycle-cleanup.test.ts +2 -5
- package/src/__tests__/computer-use-tools.test.ts +35 -31
- package/src/__tests__/config-schema.test.ts +11 -15
- package/src/__tests__/config-watcher.test.ts +0 -1
- package/src/__tests__/confirmation-request-guardian-bridge.test.ts +0 -1
- package/src/__tests__/conflict-store.test.ts +0 -1
- package/src/__tests__/connection-policy.test.ts +4 -7
- package/src/__tests__/contacts-tools.test.ts +0 -1
- package/src/__tests__/context-memory-e2e.test.ts +2 -4
- package/src/__tests__/context-overflow-reducer.test.ts +2 -4
- package/src/__tests__/context-window-manager.test.ts +147 -60
- package/src/__tests__/contradiction-checker.test.ts +0 -1
- package/src/__tests__/conversation-attention-store.test.ts +0 -1
- package/src/__tests__/conversation-attention-telegram.test.ts +1 -1
- package/src/__tests__/conversation-pairing.test.ts +2 -2
- package/src/__tests__/conversation-routes-guardian-reply.test.ts +25 -1
- package/src/__tests__/conversation-routes-slash-commands.test.ts +381 -0
- package/src/__tests__/conversation-store.test.ts +0 -1
- package/src/__tests__/conversation-unread-route.test.ts +1 -2
- package/src/__tests__/credential-security-invariants.test.ts +7 -8
- package/src/__tests__/cross-provider-web-search.test.ts +353 -0
- package/src/__tests__/daemon-assistant-events.test.ts +6 -7
- package/src/__tests__/db-schedule-syntax-migration.test.ts +15 -3
- package/src/__tests__/delete-managed-skill-tool.test.ts +5 -9
- package/src/__tests__/deterministic-verification-control-plane.test.ts +0 -1
- package/src/__tests__/diagnostics-export.test.ts +189 -0
- package/src/__tests__/dynamic-skill-workflow-prompt.test.ts +0 -1
- package/src/__tests__/emit-signal-routing-intent.test.ts +3 -3
- package/src/__tests__/entity-extractor.test.ts +0 -1
- package/src/__tests__/entity-search.test.ts +0 -1
- package/src/__tests__/ephemeral-permissions.test.ts +2 -4
- package/src/__tests__/file-read-tool.test.ts +86 -0
- package/src/__tests__/followup-tools.test.ts +0 -1
- package/src/__tests__/frontmatter.test.ts +77 -34
- package/src/__tests__/gateway-only-enforcement.test.ts +0 -1
- package/src/__tests__/gateway-only-guard.test.ts +1 -1
- package/src/__tests__/guardian-action-conversation-turn.test.ts +0 -1
- package/src/__tests__/guardian-action-followup-executor.test.ts +0 -1
- package/src/__tests__/guardian-action-followup-store.test.ts +0 -1
- package/src/__tests__/guardian-action-grant-mint-consume.test.ts +0 -1
- package/src/__tests__/guardian-action-late-reply.test.ts +0 -1
- package/src/__tests__/guardian-action-store.test.ts +0 -1
- package/src/__tests__/guardian-action-sweep.test.ts +0 -1
- package/src/__tests__/guardian-decision-primitive-canonical.test.ts +0 -1
- package/src/__tests__/guardian-dispatch.test.ts +1 -2
- package/src/__tests__/guardian-grant-minting.test.ts +1 -1
- package/src/__tests__/guardian-outbound-http.test.ts +0 -1
- package/src/__tests__/guardian-principal-id-roundtrip.test.ts +0 -1
- package/src/__tests__/guardian-routing-invariants.test.ts +1 -1
- package/src/__tests__/guardian-routing-state.test.ts +0 -1
- package/src/__tests__/guardian-verification-voice-binding.test.ts +0 -1
- package/src/__tests__/guardian-verify-setup-skill-regression.test.ts +3 -5
- package/src/__tests__/handlers-user-message-approval-consumption.test.ts +28 -426
- package/src/__tests__/host-bash-proxy.test.ts +335 -0
- package/src/__tests__/host-file-proxy.test.ts +374 -0
- package/src/__tests__/host-shell-tool.test.ts +147 -1
- package/src/__tests__/http-user-message-parity.test.ts +361 -0
- package/src/__tests__/inbound-invite-redemption.test.ts +0 -1
- package/src/__tests__/integration-status.test.ts +3 -8
- package/src/__tests__/intent-routing.test.ts +7 -46
- package/src/__tests__/invite-redemption-service.test.ts +0 -1
- package/src/__tests__/invite-routes-http.test.ts +0 -1
- package/src/__tests__/llm-usage-store.test.ts +0 -1
- package/src/__tests__/managed-avatar-client.test.ts +101 -55
- package/src/__tests__/managed-skill-lifecycle.test.ts +9 -18
- package/src/__tests__/managed-store.test.ts +94 -21
- package/src/__tests__/media-reuse-story.e2e.test.ts +0 -1
- package/src/__tests__/memory-context-benchmark.benchmark.test.ts +2 -4
- package/src/__tests__/memory-lifecycle-e2e.test.ts +0 -1
- package/src/__tests__/memory-recall-quality.test.ts +0 -1
- package/src/__tests__/memory-regressions.experimental.test.ts +0 -1
- package/src/__tests__/memory-regressions.test.ts +0 -1
- package/src/__tests__/memory-retrieval.benchmark.test.ts +0 -1
- package/src/__tests__/memory-upsert-concurrency.test.ts +0 -1
- package/src/__tests__/messaging-send-tool.test.ts +35 -0
- package/src/__tests__/messaging-skill-split.test.ts +138 -0
- package/src/__tests__/migration-cross-version-compatibility.test.ts +0 -1
- package/src/__tests__/migration-export-http.test.ts +2 -3
- package/src/__tests__/migration-import-commit-http.test.ts +1 -2
- package/src/__tests__/migration-import-preflight-http.test.ts +1 -2
- package/src/__tests__/migration-validate-http.test.ts +1 -2
- package/src/__tests__/native-web-search.test.ts +475 -0
- package/src/__tests__/navigate-settings-tab.test.ts +84 -0
- package/src/__tests__/non-member-access-request.test.ts +0 -1
- package/src/__tests__/notification-broadcaster.test.ts +15 -15
- package/src/__tests__/notification-decision-strategy.test.ts +6 -6
- package/src/__tests__/notification-deep-link.test.ts +7 -7
- package/src/__tests__/notification-guardian-path.test.ts +2 -3
- package/src/__tests__/notification-telegram-adapter.test.ts +1 -1
- package/src/__tests__/notification-thread-candidates.test.ts +4 -4
- package/src/__tests__/onboarding-starter-tasks.test.ts +0 -1
- package/src/__tests__/playbook-execution.test.ts +0 -1
- package/src/__tests__/playbook-tools.test.ts +0 -1
- package/src/__tests__/profile-compiler.test.ts +0 -1
- package/src/__tests__/provider-managed-proxy-integration.test.ts +25 -0
- package/src/__tests__/qdrant-collection-migration.test.ts +223 -0
- package/src/__tests__/recording-handler.test.ts +30 -94
- package/src/__tests__/registry.test.ts +28 -35
- package/src/__tests__/relay-server.test.ts +0 -1
- package/src/__tests__/ride-shotgun-handler.test.ts +4 -20
- package/src/__tests__/runtime-attachment-metadata.test.ts +0 -1
- package/src/__tests__/runtime-events-sse-parity.test.ts +3 -4
- package/src/__tests__/runtime-events-sse.test.ts +0 -1
- package/src/__tests__/sandbox-diagnostics.test.ts +0 -1
- package/src/__tests__/scaffold-managed-skill-tool.test.ts +30 -28
- package/src/__tests__/schedule-store.test.ts +441 -1
- package/src/__tests__/schedule-tools.test.ts +468 -7
- package/src/__tests__/scheduler-recurrence.test.ts +196 -23
- package/src/__tests__/scoped-approval-grants.test.ts +0 -1
- package/src/__tests__/scoped-grant-security-matrix.test.ts +0 -1
- package/src/__tests__/secret-prompt-log-hygiene.test.ts +6 -3
- package/src/__tests__/secret-response-routing.test.ts +4 -1
- package/src/__tests__/send-endpoint-busy.test.ts +14 -2
- package/src/__tests__/send-notification-tool.test.ts +0 -7
- package/src/__tests__/sequence-store.test.ts +0 -1
- package/src/__tests__/server-history-render.test.ts +1 -2
- package/src/__tests__/session-abort-tool-results.test.ts +0 -1
- package/src/__tests__/session-agent-loop.test.ts +46 -6
- package/src/__tests__/session-confirmation-signals.test.ts +0 -1
- package/src/__tests__/session-conflict-gate.test.ts +2 -6
- package/src/__tests__/session-error.test.ts +5 -14
- package/src/__tests__/session-init.benchmark.test.ts +3 -5
- package/src/__tests__/session-load-history-repair.test.ts +0 -1
- package/src/__tests__/session-media-retry.test.ts +12 -74
- package/src/__tests__/session-pre-run-repair.test.ts +0 -1
- package/src/__tests__/session-profile-injection.test.ts +2 -6
- package/src/__tests__/session-provider-retry-repair.test.ts +2 -6
- package/src/__tests__/session-queue.test.ts +94 -139
- package/src/__tests__/session-skill-tools.test.ts +115 -115
- package/src/__tests__/session-slash-known.test.ts +0 -1
- package/src/__tests__/session-slash-queue.test.ts +0 -1
- package/src/__tests__/session-slash-unknown.test.ts +0 -1
- package/src/__tests__/session-surfaces-task-progress.test.ts +34 -0
- package/src/__tests__/session-usage.test.ts +0 -1
- package/src/__tests__/session-workspace-cache-state.test.ts +2 -6
- package/src/__tests__/session-workspace-injection.test.ts +2 -6
- package/src/__tests__/session-workspace-tool-tracking.test.ts +2 -6
- package/src/__tests__/skill-feature-flags-integration.test.ts +180 -184
- package/src/__tests__/skill-feature-flags.test.ts +125 -18
- package/src/__tests__/skill-load-feature-flag.test.ts +1 -2
- package/src/__tests__/skill-load-tool.test.ts +194 -2
- package/src/__tests__/skill-projection-feature-flag.test.ts +27 -16
- package/src/__tests__/skill-projection.benchmark.test.ts +15 -14
- package/src/__tests__/skills.test.ts +14 -53
- package/src/__tests__/slack-channel-config.test.ts +0 -1
- package/src/__tests__/slack-inbound-verification.test.ts +0 -1
- package/src/__tests__/slack-skill.test.ts +1 -1
- package/src/__tests__/subagent-tools.test.ts +2 -2
- package/src/__tests__/system-prompt.test.ts +4 -3
- package/src/__tests__/task-compiler.test.ts +0 -1
- package/src/__tests__/task-management-tools.test.ts +0 -1
- package/src/__tests__/task-memory-cleanup.test.ts +0 -1
- package/src/__tests__/task-runner.test.ts +0 -1
- package/src/__tests__/task-scheduler.test.ts +0 -1
- package/src/__tests__/terminal-tools.test.ts +0 -1
- package/src/__tests__/test-support/computer-use-skill-harness.ts +2 -4
- package/src/__tests__/thread-seed-composer.test.ts +5 -5
- package/src/__tests__/tool-approval-handler.test.ts +0 -1
- package/src/__tests__/tool-execution-abort-cleanup.test.ts +0 -1
- package/src/__tests__/tool-execution-pipeline.benchmark.test.ts +0 -1
- package/src/__tests__/tool-executor.test.ts +8 -86
- package/src/__tests__/tool-grant-request-escalation.test.ts +0 -1
- package/src/__tests__/tool-notification-listener.test.ts +1 -1
- package/src/__tests__/tool-preview-lifecycle.test.ts +416 -0
- package/src/__tests__/trust-store.test.ts +80 -4
- package/src/__tests__/trusted-contact-approval-notifier.test.ts +0 -1
- package/src/__tests__/trusted-contact-inline-approval-integration.test.ts +0 -1
- package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +0 -1
- package/src/__tests__/trusted-contact-multichannel.test.ts +0 -1
- package/src/__tests__/trusted-contact-verification.test.ts +0 -1
- package/src/__tests__/twilio-provider.test.ts +0 -1
- package/src/__tests__/twilio-routes.test.ts +0 -1
- package/src/__tests__/{request-file-tool.test.ts → ui-file-upload-surface.test.ts} +11 -72
- package/src/__tests__/update-bulletin.test.ts +0 -1
- package/src/__tests__/usage-cache-backfill-migration.test.ts +0 -1
- package/src/__tests__/usage-routes.test.ts +0 -1
- package/src/__tests__/verification-control-plane-policy.test.ts +4 -4
- package/src/__tests__/voice-invite-redemption.test.ts +0 -1
- package/src/__tests__/voice-scoped-grant-consumer.test.ts +0 -1
- package/src/__tests__/voice-session-bridge.test.ts +9 -1
- package/src/__tests__/web-fetch.test.ts +57 -0
- package/src/__tests__/workspace-git-service.test.ts +5 -14
- package/src/__tests__/workspace-policy.test.ts +0 -1
- package/src/agent/loop.ts +22 -34
- package/src/bundler/bundle-signer.ts +4 -4
- package/src/calls/call-controller.ts +1 -1
- package/src/calls/relay-server.ts +1 -1
- package/src/calls/twilio-rest.ts +1 -1
- package/src/calls/voice-session-bridge.ts +3 -1
- package/src/cli/__tests__/notifications.test.ts +3 -4
- package/src/cli/commands/map.ts +2 -6
- package/src/cli/commands/mcp.ts +73 -15
- package/src/cli/commands/notifications.ts +4 -4
- package/src/cli/commands/sessions.ts +9 -1
- package/src/cli/commands/skills.ts +6 -10
- package/src/cli/http-client.ts +2 -3
- package/src/cli/main-screen.tsx +10 -10
- package/src/cli/program.ts +0 -4
- package/src/cli/reference.ts +0 -2
- package/src/cli.ts +15 -9
- package/src/config/__tests__/bundled-tool-registry-guard.test.ts +120 -0
- package/src/config/bundled-skills/_shared/CLI_RETRIEVAL_PATTERN.md +11 -0
- package/src/config/bundled-skills/app-builder/SKILL.md +6 -1
- package/src/config/bundled-skills/browser/SKILL.md +6 -1
- package/src/config/bundled-skills/chatgpt-import/SKILL.md +5 -1
- package/src/config/bundled-skills/claude-code/SKILL.md +5 -1
- package/src/config/bundled-skills/computer-use/SKILL.md +6 -1
- package/src/config/bundled-skills/computer-use/TOOLS.json +6 -69
- package/src/config/bundled-skills/computer-use/tools/computer-use-click.ts +10 -1
- package/src/config/bundled-skills/contacts/SKILL.md +10 -1
- package/src/config/bundled-skills/contacts/TOOLS.json +35 -0
- package/src/config/bundled-skills/{messaging → contacts}/tools/google-contacts.ts +9 -2
- package/src/config/bundled-skills/document/SKILL.md +4 -1
- package/src/config/bundled-skills/doordash/SKILL.md +8 -1
- package/src/config/bundled-skills/doordash/lib/shared/platform.ts +4 -1
- package/src/config/bundled-skills/followups/SKILL.md +4 -1
- package/src/config/bundled-skills/gmail/SKILL.md +180 -0
- package/src/config/bundled-skills/gmail/TOOLS.json +506 -0
- package/src/config/bundled-skills/gmail/tools/gmail-archive.ts +149 -0
- package/src/config/bundled-skills/gmail/tools/gmail-attachments.ts +110 -0
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-draft.ts +1 -1
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-filters.ts +1 -1
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-follow-up.ts +1 -1
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-forward.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/gmail-label.ts +50 -0
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-outreach-scan.ts +8 -90
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-send-draft.ts +1 -1
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-sender-digest.ts +2 -2
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-trash.ts +1 -1
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-unsubscribe.ts +1 -1
- package/src/config/bundled-skills/{messaging → gmail}/tools/gmail-vacation.ts +1 -1
- package/src/config/bundled-skills/gmail/tools/shared.ts +47 -0
- package/src/config/bundled-skills/google-calendar/SKILL.md +5 -1
- package/src/config/bundled-skills/image-studio/SKILL.md +5 -1
- package/src/config/bundled-skills/knowledge-graph/SKILL.md +4 -1
- package/src/config/bundled-skills/media-processing/SKILL.md +7 -13
- package/src/config/bundled-skills/media-processing/TOOLS.json +0 -22
- package/src/config/bundled-skills/media-processing/tools/generate-clip.ts +12 -1
- package/src/config/bundled-skills/messaging/SKILL.md +23 -139
- package/src/config/bundled-skills/messaging/TOOLS.json +33 -1215
- package/src/config/bundled-skills/messaging/tools/gmail-mime-helpers.ts +42 -0
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +165 -2
- package/src/config/bundled-skills/messaging/tools/messaging-sender-digest.ts +1 -13
- package/src/config/bundled-skills/messaging/tools/shared.ts +81 -34
- package/src/config/bundled-skills/notifications/SKILL.md +5 -1
- package/src/config/bundled-skills/orchestration/SKILL.md +30 -0
- package/src/config/bundled-skills/orchestration/TOOLS.json +35 -0
- package/src/config/bundled-skills/{reminder/tools/reminder-create.ts → orchestration/tools/swarm-delegate.ts} +3 -3
- package/src/config/bundled-skills/phone-calls/SKILL.md +9 -1
- package/src/config/bundled-skills/playbooks/SKILL.md +4 -1
- package/src/config/bundled-skills/schedule/SKILL.md +70 -9
- package/src/config/bundled-skills/schedule/TOOLS.json +38 -6
- package/src/config/bundled-skills/screen-watch/SKILL.md +28 -0
- package/src/config/bundled-skills/screen-watch/TOOLS.json +35 -0
- package/src/config/bundled-skills/{reminder/tools/reminder-cancel.ts → screen-watch/tools/start-screen-watch.ts} +3 -3
- package/src/config/bundled-skills/sequences/SKILL.md +47 -0
- package/src/config/bundled-skills/sequences/TOOLS.json +340 -0
- package/src/config/bundled-skills/sequences/tools/sequence-update.ts +128 -0
- package/src/config/bundled-skills/sequences/tools/shared.ts +9 -0
- package/src/config/bundled-skills/settings/SKILL.md +12 -0
- package/src/config/bundled-skills/settings/TOOLS.json +112 -0
- package/src/config/bundled-skills/settings/tools/navigate-settings-tab.ts +43 -0
- package/src/config/bundled-skills/settings/tools/open-system-settings.ts +52 -0
- package/src/config/bundled-skills/{computer-use/tools/computer-use-right-click.ts → settings/tools/set-avatar.ts} +2 -6
- package/src/{tools/system/voice-config.ts → config/bundled-skills/settings/tools/voice-config-update.ts} +59 -96
- package/src/config/bundled-skills/skill-management/SKILL.md +18 -0
- package/src/config/bundled-skills/skill-management/TOOLS.json +90 -0
- package/src/config/bundled-skills/{computer-use/tools/computer-use-double-click.ts → skill-management/tools/delete-managed.ts} +2 -6
- package/src/config/bundled-skills/skill-management/tools/scaffold-managed.ts +12 -0
- package/src/config/bundled-skills/slack/SKILL.md +5 -1
- package/src/config/bundled-skills/subagent/SKILL.md +4 -1
- package/src/config/bundled-skills/tasks/SKILL.md +5 -2
- package/src/config/bundled-skills/transcribe/SKILL.md +4 -1
- package/src/config/bundled-skills/watcher/SKILL.md +4 -1
- package/src/config/bundled-tool-registry.ts +118 -107
- package/src/config/env.ts +5 -2
- package/src/config/feature-flag-registry.json +25 -9
- package/src/config/loader.ts +10 -2
- package/src/config/schema.ts +19 -16
- package/src/config/schemas/inference.ts +12 -22
- package/src/config/schemas/memory-storage.ts +19 -1
- package/src/config/schemas/platform.ts +0 -16
- package/src/config/skill-state.ts +11 -8
- package/src/config/skills.ts +83 -32
- package/src/context/token-estimator.ts +11 -0
- package/src/context/window-manager.ts +180 -151
- package/src/daemon/computer-use-session.ts +11 -43
- package/src/daemon/daemon-control.ts +4 -1
- package/src/daemon/handlers/config-channels.ts +5 -9
- package/src/daemon/handlers/config-ingress.ts +0 -4
- package/src/daemon/handlers/config-model.ts +7 -13
- package/src/daemon/handlers/config-telegram.ts +4 -8
- package/src/daemon/handlers/config-voice.ts +2 -5
- package/src/daemon/handlers/dictation.ts +2 -12
- package/src/daemon/handlers/identity.ts +0 -105
- package/src/daemon/handlers/recording.ts +3 -23
- package/src/daemon/handlers/session-history.ts +1 -1
- package/src/daemon/handlers/sessions.ts +53 -72
- package/src/daemon/handlers/shared.ts +7 -28
- package/src/daemon/handlers/skills.ts +31 -27
- package/src/daemon/host-bash-proxy.ts +148 -0
- package/src/daemon/host-file-proxy.ts +135 -0
- package/src/daemon/lifecycle.ts +49 -24
- package/src/daemon/mcp-reload-service.ts +123 -0
- package/src/daemon/message-protocol.ts +6 -0
- package/src/daemon/message-types/browser.ts +1 -1
- package/src/daemon/message-types/computer-use.ts +1 -4
- package/src/daemon/message-types/guardian-actions.ts +1 -1
- package/src/daemon/message-types/host-bash.ts +18 -0
- package/src/daemon/message-types/host-file.ts +44 -0
- package/src/daemon/message-types/integrations.ts +1 -67
- package/src/daemon/message-types/messages.ts +15 -0
- package/src/daemon/message-types/schedules.ts +11 -27
- package/src/daemon/message-types/sessions.ts +2 -1
- package/src/daemon/message-types/settings.ts +1 -1
- package/src/daemon/message-types/shared.ts +1 -1
- package/src/daemon/ride-shotgun-handler.ts +2 -42
- package/src/daemon/server.ts +43 -10
- package/src/daemon/session-agent-loop-handlers.ts +48 -7
- package/src/daemon/session-agent-loop.ts +97 -66
- package/src/daemon/session-attachments.ts +1 -1
- package/src/daemon/session-error.ts +17 -16
- package/src/daemon/session-lifecycle.ts +20 -1
- package/src/daemon/session-media-retry.ts +1 -15
- package/src/daemon/session-messaging.ts +14 -6
- package/src/daemon/session-process.ts +36 -7
- package/src/daemon/session-queue-manager.ts +62 -103
- package/src/daemon/session-runtime-assembly.ts +27 -0
- package/src/daemon/session-skill-tools.ts +12 -11
- package/src/daemon/session-slash.ts +7 -0
- package/src/daemon/session-surfaces.ts +19 -97
- package/src/daemon/session-tool-setup.ts +146 -6
- package/src/daemon/session.ts +77 -13
- package/src/errors.ts +0 -2
- package/src/export/formatter.ts +6 -0
- package/src/mcp/mcp-oauth-provider.ts +1 -3
- package/src/media/avatar-router.ts +20 -28
- package/src/media/avatar-types.ts +7 -14
- package/src/media/managed-avatar-client.ts +70 -34
- package/src/memory/conversation-title-service.ts +1 -2
- package/src/memory/db-init.ts +16 -0
- package/src/memory/embedding-backend.ts +129 -27
- package/src/memory/embedding-gemini.test.ts +256 -0
- package/src/memory/embedding-gemini.ts +47 -13
- package/src/memory/embedding-local.ts +14 -2
- package/src/memory/embedding-ollama.ts +15 -2
- package/src/memory/embedding-openai.ts +15 -2
- package/src/memory/embedding-types.test.ts +116 -0
- package/src/memory/embedding-types.ts +61 -0
- package/src/memory/fingerprint.ts +1 -1
- package/src/memory/indexer.ts +25 -1
- package/src/memory/job-handlers/embedding.test.ts +258 -0
- package/src/memory/job-handlers/embedding.ts +81 -1
- package/src/memory/job-handlers/index-maintenance.ts +35 -1
- package/src/memory/job-handlers/media-processing.ts +11 -1
- package/src/memory/job-utils.ts +21 -6
- package/src/memory/jobs-store.ts +5 -1
- package/src/memory/jobs-worker.ts +8 -0
- package/src/memory/message-content.ts +66 -0
- package/src/memory/migrations/100-core-tables.ts +1 -31
- package/src/memory/migrations/104-core-indexes.ts +0 -11
- package/src/memory/migrations/145-drop-accounts-table.ts +19 -0
- package/src/memory/migrations/146-schedule-oneshot-routing.ts +94 -0
- package/src/memory/migrations/147-migrate-reminders-to-schedules.ts +129 -0
- package/src/memory/migrations/148-drop-reminders-table.ts +18 -0
- package/src/memory/migrations/index.ts +4 -0
- package/src/memory/migrations/registry.ts +19 -0
- package/src/memory/qdrant-client.ts +158 -43
- package/src/memory/retriever.test.ts +0 -1
- package/src/memory/retriever.ts +12 -2
- package/src/memory/schema/infrastructure.ts +5 -29
- package/src/memory/search/formatting.ts +34 -9
- package/src/memory/search/semantic.ts +57 -2
- package/src/memory/search/types.ts +2 -1
- package/src/notifications/AGENTS.md +2 -2
- package/src/notifications/README.md +59 -58
- package/src/notifications/adapters/macos.ts +1 -1
- package/src/notifications/broadcaster.ts +5 -5
- package/src/notifications/copy-composer.ts +1 -1
- package/src/notifications/decision-engine.ts +2 -2
- package/src/notifications/destination-resolver.ts +2 -2
- package/src/notifications/emit-signal.ts +8 -8
- package/src/notifications/signal.ts +1 -1
- package/src/notifications/thread-seed-composer.ts +1 -1
- package/src/oauth/connect-orchestrator.ts +1 -1
- package/src/oauth/token-persistence.ts +1 -1
- package/src/permissions/checker.ts +12 -1
- package/src/permissions/defaults.ts +10 -14
- package/src/permissions/trust-store.ts +37 -0
- package/src/permissions/workspace-policy.ts +0 -1
- package/src/prompts/__tests__/build-cli-reference-section.test.ts +11 -0
- package/src/prompts/computer-use-prompt.ts +1 -1
- package/src/prompts/system-prompt.ts +29 -30
- package/src/prompts/templates/SOUL.md +1 -2
- package/src/prompts/templates/UPDATES.md +16 -7
- package/src/providers/anthropic/client.ts +87 -33
- package/src/providers/gemini/client.ts +6 -0
- package/src/providers/managed-proxy/constants.ts +5 -0
- package/src/providers/openai/client.ts +15 -0
- package/src/providers/registry.ts +2 -2
- package/src/providers/types.ts +24 -2
- package/src/runtime/AGENTS.md +18 -0
- package/src/runtime/assistant-event-hub.ts +2 -3
- package/src/runtime/assistant-event.ts +4 -4
- package/src/runtime/auth/__tests__/context.test.ts +5 -5
- package/src/runtime/auth/__tests__/credential-service.test.ts +0 -1
- package/src/runtime/auth/__tests__/guard-tests.test.ts +2 -2
- package/src/runtime/auth/__tests__/{ipc-auth-context.test.ts → local-auth-context.test.ts} +21 -21
- package/src/runtime/auth/__tests__/route-policy.test.ts +2 -2
- package/src/runtime/auth/__tests__/scopes.test.ts +7 -7
- package/src/runtime/auth/__tests__/subject.test.ts +8 -8
- package/src/runtime/auth/__tests__/token-service.test.ts +0 -1
- package/src/runtime/auth/route-policy.ts +8 -4
- package/src/runtime/auth/scopes.ts +1 -1
- package/src/runtime/auth/subject.ts +4 -4
- package/src/runtime/auth/token-service.ts +0 -23
- package/src/runtime/auth/types.ts +3 -3
- package/src/runtime/guardian-action-followup-executor.ts +1 -1
- package/src/runtime/guardian-action-grant-minter.ts +1 -1
- package/src/runtime/guardian-action-service.ts +3 -3
- package/src/runtime/http-server.ts +15 -2
- package/src/runtime/invite-service.ts +3 -3
- package/src/runtime/local-actor-identity.ts +17 -22
- package/src/runtime/pending-interactions.ts +21 -9
- package/src/runtime/routes/app-management-routes.ts +2 -3
- package/src/runtime/routes/approval-routes.ts +1 -3
- package/src/runtime/routes/btw-routes.ts +155 -0
- package/src/runtime/routes/computer-use-routes.ts +77 -31
- package/src/runtime/routes/conversation-routes.ts +230 -46
- package/src/runtime/routes/diagnostics-routes.ts +63 -29
- package/src/runtime/routes/documents-routes.ts +2 -2
- package/src/runtime/routes/global-search-routes.ts +1 -1
- package/src/runtime/routes/host-bash-routes.ts +83 -0
- package/src/runtime/routes/host-file-routes.ts +79 -0
- package/src/runtime/routes/integrations/slack/share.ts +1 -1
- package/src/runtime/routes/log-export-routes.ts +120 -0
- package/src/runtime/routes/mcp-routes.ts +20 -0
- package/src/runtime/routes/migration-routes.ts +3 -3
- package/src/runtime/routes/pairing-routes.ts +1 -1
- package/src/runtime/routes/recording-routes.ts +6 -4
- package/src/runtime/routes/schedule-routes.ts +31 -5
- package/src/runtime/routes/session-management-routes.ts +2 -6
- package/src/runtime/routes/session-query-routes.ts +18 -15
- package/src/runtime/routes/settings-routes.ts +7 -261
- package/src/runtime/routes/skills-routes.ts +7 -6
- package/src/runtime/routes/subagents-routes.ts +4 -10
- package/src/runtime/routes/surface-action-routes.ts +3 -14
- package/src/runtime/routes/surface-content-routes.ts +22 -5
- package/src/runtime/routes/work-items-routes.ts +21 -25
- package/src/runtime/routes/workspace-routes.test.ts +3 -3
- package/src/runtime/routes/workspace-utils.ts +1 -1
- package/src/runtime/telegram-streaming-delivery.ts +3 -0
- package/src/runtime/verification-outbound-actions.ts +2 -2
- package/src/schedule/integration-status.ts +0 -6
- package/src/schedule/schedule-store.ts +234 -43
- package/src/schedule/scheduler.ts +73 -74
- package/src/security/oauth2.ts +1 -1
- package/src/sequence/store.ts +12 -2
- package/src/skills/frontmatter.ts +19 -77
- package/src/skills/managed-store.ts +11 -2
- package/src/subagent/manager.ts +5 -3
- package/src/tasks/ephemeral-permissions.ts +3 -5
- package/src/tools/AGENTS.md +0 -1
- package/src/tools/browser/browser-manager.ts +17 -11
- package/src/tools/browser/jit-auth.ts +4 -1
- package/src/tools/claude-code/claude-code.ts +1 -1
- package/src/tools/computer-use/definitions.ts +48 -60
- package/src/tools/document/document-tool.ts +6 -6
- package/src/tools/filesystem/edit.ts +2 -1
- package/src/tools/filesystem/read.ts +20 -2
- package/src/tools/filesystem/write.ts +2 -1
- package/src/tools/host-filesystem/edit.ts +17 -1
- package/src/tools/host-filesystem/read.ts +16 -1
- package/src/tools/host-filesystem/write.ts +15 -1
- package/src/tools/host-terminal/host-shell.ts +24 -0
- package/src/tools/memory/definitions.ts +45 -81
- package/src/tools/memory/handlers.test.ts +0 -1
- package/src/tools/memory/handlers.ts +1 -1
- package/src/tools/memory/register.ts +26 -60
- package/src/tools/network/script-proxy/session-manager.ts +6 -8
- package/src/tools/network/web-fetch.ts +7 -1
- package/src/tools/network/web-search.ts +2 -1
- package/src/tools/registry.ts +23 -0
- package/src/tools/schedule/create.ts +113 -5
- package/src/tools/schedule/list.ts +57 -15
- package/src/tools/schedule/update.ts +73 -3
- package/src/tools/shared/filesystem/image-read.ts +192 -0
- package/src/tools/side-effects.ts +1 -7
- package/src/tools/skills/delete-managed.ts +27 -64
- package/src/tools/skills/execute.ts +54 -0
- package/src/tools/skills/load.ts +127 -5
- package/src/tools/skills/scaffold-managed.ts +93 -172
- package/src/tools/subagent/message.ts +0 -7
- package/src/tools/subagent/spawn.ts +1 -1
- package/src/tools/swarm/delegate.ts +0 -3
- package/src/tools/system/avatar-generator.ts +13 -19
- package/src/tools/system/request-permission.ts +2 -1
- package/src/tools/terminal/safe-env.ts +1 -0
- package/src/tools/tool-manifest.ts +41 -47
- package/src/tools/types.ts +6 -2
- package/src/tools/ui-surface/definitions.ts +0 -55
- package/src/util/errors.ts +0 -10
- package/src/workspace/git-service.ts +0 -2
- package/src/__tests__/account-registry.test.ts +0 -258
- package/src/__tests__/email-classifier.test.ts +0 -25
- package/src/__tests__/gmail-integration.test.ts +0 -97
- package/src/__tests__/handle-user-message-secret-resume.test.ts +0 -172
- package/src/__tests__/managed-twitter-guardrails.test.ts +0 -357
- package/src/__tests__/recording-intent-fallback.test.ts +0 -199
- package/src/__tests__/recording-intent.test.ts +0 -985
- package/src/__tests__/recording-state-machine.test.ts +0 -1574
- package/src/__tests__/reminder-store.test.ts +0 -350
- package/src/__tests__/reminder.test.ts +0 -337
- package/src/__tests__/scan-result-store.test.ts +0 -121
- package/src/__tests__/twitter-platform-proxy-client.test.ts +0 -475
- package/src/__tests__/view-image-tool.test.ts +0 -241
- package/src/cli/commands/amazon/cart.ts +0 -513
- package/src/cli/commands/amazon/checkout.ts +0 -394
- package/src/cli/commands/amazon/client.ts +0 -513
- package/src/cli/commands/amazon/index.ts +0 -885
- package/src/cli/commands/amazon/product-details.ts +0 -145
- package/src/cli/commands/amazon/request-extractor.ts +0 -187
- package/src/cli/commands/amazon/search.ts +0 -76
- package/src/cli/commands/amazon/session.ts +0 -108
- package/src/cli/commands/twitter/__tests__/cli-read-routing.test.ts +0 -345
- package/src/cli/commands/twitter/__tests__/cli-routing.test.ts +0 -252
- package/src/cli/commands/twitter/__tests__/oauth-client.test.ts +0 -151
- package/src/cli/commands/twitter/index.ts +0 -420
- package/src/cli/commands/twitter/oauth-client.ts +0 -60
- package/src/cli/commands/twitter/router.ts +0 -351
- package/src/cli/commands/twitter/types.ts +0 -30
- package/src/config/bundled-skills/agentmail/SKILL.md +0 -132
- package/src/config/bundled-skills/agentmail/icon.svg +0 -21
- package/src/config/bundled-skills/amazon/SKILL.md +0 -136
- package/src/config/bundled-skills/amazon/icon.svg +0 -13
- package/src/config/bundled-skills/api-mapping/SKILL.md +0 -78
- package/src/config/bundled-skills/api-mapping/icon.svg +0 -18
- package/src/config/bundled-skills/cli-discover/SKILL.md +0 -68
- package/src/config/bundled-skills/deploy-fullstack-vercel/SKILL.md +0 -179
- package/src/config/bundled-skills/document-writer/SKILL.md +0 -195
- package/src/config/bundled-skills/elevenlabs-voice/SKILL.md +0 -140
- package/src/config/bundled-skills/email-setup/SKILL.md +0 -68
- package/src/config/bundled-skills/frontend-design/SKILL.md +0 -44
- package/src/config/bundled-skills/frontend-design/icon.svg +0 -16
- package/src/config/bundled-skills/google-oauth-setup/SKILL.md +0 -452
- package/src/config/bundled-skills/guardian-verify-setup/SKILL.md +0 -203
- package/src/config/bundled-skills/influencer/SKILL.md +0 -144
- package/src/config/bundled-skills/influencer/scripts/client.ts +0 -1269
- package/src/config/bundled-skills/influencer/scripts/influencer.ts +0 -267
- package/src/config/bundled-skills/macos-automation/SKILL.md +0 -65
- package/src/config/bundled-skills/macos-automation/icon.svg +0 -12
- package/src/config/bundled-skills/mcp-setup/SKILL.md +0 -75
- package/src/config/bundled-skills/media-processing/tools/media-diagnostics.ts +0 -184
- package/src/config/bundled-skills/messaging/tools/gmail-archive-by-query.ts +0 -80
- package/src/config/bundled-skills/messaging/tools/gmail-archive.ts +0 -29
- package/src/config/bundled-skills/messaging/tools/gmail-batch-archive.ts +0 -56
- package/src/config/bundled-skills/messaging/tools/gmail-batch-label.ts +0 -34
- package/src/config/bundled-skills/messaging/tools/gmail-download-attachment.ts +0 -47
- package/src/config/bundled-skills/messaging/tools/gmail-label.ts +0 -31
- package/src/config/bundled-skills/messaging/tools/gmail-list-attachments.ts +0 -67
- package/src/config/bundled-skills/messaging/tools/gmail-send-with-attachments.ts +0 -97
- package/src/config/bundled-skills/messaging/tools/gmail-summarize-thread.ts +0 -87
- package/src/config/bundled-skills/messaging/tools/gmail-triage.ts +0 -135
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-activity.ts +0 -24
- package/src/config/bundled-skills/messaging/tools/messaging-reply.ts +0 -201
- package/src/config/bundled-skills/messaging/tools/send-notification.ts +0 -1
- package/src/config/bundled-skills/messaging/tools/sequence-cancel.ts +0 -27
- package/src/config/bundled-skills/messaging/tools/sequence-pause.ts +0 -48
- package/src/config/bundled-skills/messaging/tools/sequence-resume.ts +0 -27
- package/src/config/bundled-skills/messaging/tools/sequence-update.ts +0 -56
- package/src/config/bundled-skills/notion/SKILL.md +0 -240
- package/src/config/bundled-skills/notion-oauth-setup/SKILL.md +0 -126
- package/src/config/bundled-skills/oauth-setup/SKILL.md +0 -143
- package/src/config/bundled-skills/public-ingress/SKILL.md +0 -258
- package/src/config/bundled-skills/reminder/SKILL.md +0 -79
- package/src/config/bundled-skills/reminder/TOOLS.json +0 -89
- package/src/config/bundled-skills/reminder/tools/reminder-list.ts +0 -12
- package/src/config/bundled-skills/restaurant-reservation/SKILL.md +0 -141
- package/src/config/bundled-skills/screen-recording/SKILL.md +0 -148
- package/src/config/bundled-skills/self-upgrade/SKILL.md +0 -69
- package/src/config/bundled-skills/skills-catalog/SKILL.md +0 -78
- package/src/config/bundled-skills/slack-app-setup/SKILL.md +0 -178
- package/src/config/bundled-skills/slack-digest-setup/SKILL.md +0 -163
- package/src/config/bundled-skills/slack-oauth-setup/SKILL.md +0 -157
- package/src/config/bundled-skills/start-the-day/SKILL.md +0 -70
- package/src/config/bundled-skills/start-the-day/icon.svg +0 -13
- package/src/config/bundled-skills/telegram-setup/SKILL.md +0 -105
- package/src/config/bundled-skills/time-based-actions/SKILL.md +0 -142
- package/src/config/bundled-skills/twilio-setup/SKILL.md +0 -232
- package/src/config/bundled-skills/twitter/SKILL.md +0 -206
- package/src/config/bundled-skills/twitter/icon.svg +0 -14
- package/src/config/bundled-skills/typescript-eval/SKILL.md +0 -60
- package/src/config/bundled-skills/vercel-token-setup/SKILL.md +0 -214
- package/src/config/bundled-skills/voice-setup/SKILL.md +0 -131
- package/src/config/bundled-skills/voice-setup/icon.svg +0 -20
- package/src/daemon/handlers/pairing.ts +0 -119
- package/src/daemon/handlers/session-user-message.ts +0 -961
- package/src/daemon/recording-executor.ts +0 -180
- package/src/daemon/recording-intent-fallback.ts +0 -162
- package/src/daemon/recording-intent.ts +0 -493
- package/src/memory/account-store.ts +0 -117
- package/src/messaging/activity-analyzer.ts +0 -76
- package/src/messaging/email-classifier.ts +0 -208
- package/src/messaging/index.ts +0 -2
- package/src/messaging/outreach-classifier.ts +0 -185
- package/src/messaging/thread-summarizer.ts +0 -346
- package/src/messaging/types.ts +0 -17
- package/src/tools/browser/x-auto-navigate.ts +0 -254
- package/src/tools/credentials/account-registry.ts +0 -144
- package/src/tools/filesystem/view-image.ts +0 -244
- package/src/tools/reminder/reminder-store.ts +0 -194
- package/src/tools/reminder/reminder.ts +0 -158
- package/src/tools/system/navigate-settings.ts +0 -74
- package/src/tools/system/open-system-settings.ts +0 -85
- package/src/tools/system/version.ts +0 -54
- package/src/twitter/platform-proxy-client.ts +0 -408
- /package/src/config/bundled-skills/{messaging → gmail}/tools/scan-result-store.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-analytics.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-create.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-delete.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-enroll.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-enrollment-list.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-get.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-import.ts +0 -0
- /package/src/config/bundled-skills/{messaging → sequences}/tools/sequence-list.ts +0 -0
|
@@ -225,7 +225,10 @@ mock.module("../config/assistant-feature-flags.js", () => ({
|
|
|
225
225
|
}));
|
|
226
226
|
|
|
227
227
|
mock.module("../config/skill-state.js", () => ({
|
|
228
|
-
skillFlagKey: (
|
|
228
|
+
skillFlagKey: (skill: { featureFlag?: string }) =>
|
|
229
|
+
skill.featureFlag
|
|
230
|
+
? `feature_flags.${skill.featureFlag}.enabled`
|
|
231
|
+
: undefined,
|
|
229
232
|
}));
|
|
230
233
|
|
|
231
234
|
// ---------------------------------------------------------------------------
|
|
@@ -320,7 +323,7 @@ describe("projectSkillTools", () => {
|
|
|
320
323
|
expect(result.allowedToolNames.size).toBe(0);
|
|
321
324
|
});
|
|
322
325
|
|
|
323
|
-
test("active skill with valid manifest returns tool definitions", () => {
|
|
326
|
+
test("active skill with valid manifest returns empty tool definitions but populates allowedToolNames", () => {
|
|
324
327
|
mockCatalog = [makeSkill("deploy")];
|
|
325
328
|
mockManifests = { deploy: makeManifest(["deploy_run", "deploy_status"]) };
|
|
326
329
|
|
|
@@ -332,11 +335,8 @@ describe("projectSkillTools", () => {
|
|
|
332
335
|
previouslyActiveSkillIds: sessionState,
|
|
333
336
|
});
|
|
334
337
|
|
|
335
|
-
|
|
336
|
-
expect(result.toolDefinitions
|
|
337
|
-
"deploy_run",
|
|
338
|
-
"deploy_status",
|
|
339
|
-
]);
|
|
338
|
+
// Tool definitions are no longer sent to the LLM — tools are invoked via skill_execute dispatch.
|
|
339
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
340
340
|
expect(result.allowedToolNames).toEqual(
|
|
341
341
|
new Set(["deploy_run", "deploy_status"]),
|
|
342
342
|
);
|
|
@@ -358,7 +358,7 @@ describe("projectSkillTools", () => {
|
|
|
358
358
|
previouslyActiveSkillIds: sessionState,
|
|
359
359
|
});
|
|
360
360
|
|
|
361
|
-
expect(result.toolDefinitions).
|
|
361
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
362
362
|
expect(result.allowedToolNames).toEqual(
|
|
363
363
|
new Set(["deploy_run", "oncall_page"]),
|
|
364
364
|
);
|
|
@@ -381,7 +381,7 @@ describe("projectSkillTools", () => {
|
|
|
381
381
|
previouslyActiveSkillIds: sessionState,
|
|
382
382
|
});
|
|
383
383
|
|
|
384
|
-
expect(result.toolDefinitions).
|
|
384
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
385
385
|
expect(result.allowedToolNames).toEqual(
|
|
386
386
|
new Set(["deploy_run", "oncall_page"]),
|
|
387
387
|
);
|
|
@@ -469,8 +469,7 @@ describe("projectSkillTools", () => {
|
|
|
469
469
|
const result2 = projectSkillTools(history, {
|
|
470
470
|
previouslyActiveSkillIds: sessionState,
|
|
471
471
|
});
|
|
472
|
-
expect(result2.toolDefinitions).
|
|
473
|
-
expect(result2.toolDefinitions[0].name).toBe("deploy_run");
|
|
472
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
474
473
|
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
475
474
|
expect(sessionState.has("deploy")).toBe(true);
|
|
476
475
|
|
|
@@ -499,8 +498,8 @@ describe("projectSkillTools", () => {
|
|
|
499
498
|
const result2 = projectSkillTools(history, {
|
|
500
499
|
previouslyActiveSkillIds: sessionState,
|
|
501
500
|
});
|
|
502
|
-
expect(result2.toolDefinitions).
|
|
503
|
-
expect(result2.
|
|
501
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
502
|
+
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
504
503
|
expect(sessionState.has("deploy")).toBe(true);
|
|
505
504
|
expect(mockRegisteredTools.has("deploy")).toBe(true);
|
|
506
505
|
});
|
|
@@ -533,7 +532,8 @@ describe("projectSkillTools", () => {
|
|
|
533
532
|
const result3 = projectSkillTools(history, {
|
|
534
533
|
previouslyActiveSkillIds: sessionState,
|
|
535
534
|
});
|
|
536
|
-
expect(result3.toolDefinitions).
|
|
535
|
+
expect(result3.toolDefinitions).toEqual([]);
|
|
536
|
+
expect(result3.allowedToolNames.has("deploy_run")).toBe(true);
|
|
537
537
|
expect(sessionState.has("deploy")).toBe(true);
|
|
538
538
|
// Ref count should be exactly 1, not 2
|
|
539
539
|
expect(mockSkillRefCount.get("deploy")).toBe(1);
|
|
@@ -560,8 +560,8 @@ describe("projectSkillTools", () => {
|
|
|
560
560
|
const result2 = projectSkillTools(history, {
|
|
561
561
|
previouslyActiveSkillIds: sessionState,
|
|
562
562
|
});
|
|
563
|
-
expect(result2.toolDefinitions).
|
|
564
|
-
expect(result2.
|
|
563
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
564
|
+
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
565
565
|
expect(sessionState.get("deploy")).toBe("v1:hash-bbb");
|
|
566
566
|
// Unregister was called for the stale version
|
|
567
567
|
expect(mockUnregisteredSkillIds).toContain("deploy");
|
|
@@ -587,7 +587,8 @@ describe("projectSkillTools", () => {
|
|
|
587
587
|
const result2 = projectSkillTools(history, {
|
|
588
588
|
previouslyActiveSkillIds: sessionState,
|
|
589
589
|
});
|
|
590
|
-
expect(result2.toolDefinitions).
|
|
590
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
591
|
+
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
591
592
|
expect(mockUnregisteredSkillIds).not.toContain("deploy");
|
|
592
593
|
// Ref count should still be 1 (no additional registration)
|
|
593
594
|
expect(mockSkillRefCount.get("deploy")).toBe(1);
|
|
@@ -607,7 +608,7 @@ describe("projectSkillTools", () => {
|
|
|
607
608
|
previouslyActiveSkillIds: sessionState,
|
|
608
609
|
});
|
|
609
610
|
|
|
610
|
-
expect(result.toolDefinitions).
|
|
611
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
611
612
|
expect(result.allowedToolNames).toEqual(new Set(["deploy_run"]));
|
|
612
613
|
});
|
|
613
614
|
|
|
@@ -620,7 +621,7 @@ describe("projectSkillTools", () => {
|
|
|
620
621
|
previouslyActiveSkillIds: sessionState,
|
|
621
622
|
});
|
|
622
623
|
|
|
623
|
-
expect(result.toolDefinitions).
|
|
624
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
624
625
|
expect(result.allowedToolNames).toEqual(new Set(["oncall_page"]));
|
|
625
626
|
});
|
|
626
627
|
|
|
@@ -718,8 +719,10 @@ describe("projectSkillTools", () => {
|
|
|
718
719
|
// ---------------------------------------------------------------------------
|
|
719
720
|
|
|
720
721
|
describe("resolveTools callback (session wiring)", () => {
|
|
721
|
-
// Simulates the resolveTools callback wired in the Session constructor
|
|
722
|
-
//
|
|
722
|
+
// Simulates the resolveTools callback wired in the Session constructor.
|
|
723
|
+
// Since skill tool definitions are no longer sent to the LLM (tools are
|
|
724
|
+
// invoked via skill_execute dispatch), the definitions array only contains
|
|
725
|
+
// base (core + MCP) tools. Skill tool names still appear in allowedToolNames.
|
|
723
726
|
const baseToolDefs: ToolDefinition[] = [
|
|
724
727
|
{
|
|
725
728
|
name: "file_read",
|
|
@@ -740,6 +743,7 @@ describe("resolveTools callback (session wiring)", () => {
|
|
|
740
743
|
const projection = projectSkillTools(history, {
|
|
741
744
|
previouslyActiveSkillIds: sessionState,
|
|
742
745
|
});
|
|
746
|
+
// projection.toolDefinitions is now always [] — skill tools are dispatched via skill_execute
|
|
743
747
|
return [...base, ...projection.toolDefinitions];
|
|
744
748
|
};
|
|
745
749
|
}
|
|
@@ -764,7 +768,7 @@ describe("resolveTools callback (session wiring)", () => {
|
|
|
764
768
|
expect(result.map((d) => d.name)).toEqual(["file_read", "bash"]);
|
|
765
769
|
});
|
|
766
770
|
|
|
767
|
-
test("
|
|
771
|
+
test("skill tools are NOT appended to definitions — only base tools returned", () => {
|
|
768
772
|
mockCatalog = [makeSkill("deploy")];
|
|
769
773
|
mockManifests = { deploy: makeManifest(["deploy_run", "deploy_status"]) };
|
|
770
774
|
|
|
@@ -775,16 +779,12 @@ describe("resolveTools callback (session wiring)", () => {
|
|
|
775
779
|
|
|
776
780
|
const result = resolveTools(history);
|
|
777
781
|
|
|
778
|
-
|
|
779
|
-
expect(result.
|
|
780
|
-
|
|
781
|
-
"bash",
|
|
782
|
-
"deploy_run",
|
|
783
|
-
"deploy_status",
|
|
784
|
-
]);
|
|
782
|
+
// Only base tools — skill tool definitions no longer sent to LLM
|
|
783
|
+
expect(result).toHaveLength(2);
|
|
784
|
+
expect(result.map((d) => d.name)).toEqual(["file_read", "bash"]);
|
|
785
785
|
});
|
|
786
786
|
|
|
787
|
-
test("
|
|
787
|
+
test("base tools are unchanged even when skills are active", () => {
|
|
788
788
|
mockCatalog = [makeSkill("oncall")];
|
|
789
789
|
mockManifests = { oncall: makeManifest(["oncall_page"]) };
|
|
790
790
|
|
|
@@ -795,13 +795,13 @@ describe("resolveTools callback (session wiring)", () => {
|
|
|
795
795
|
|
|
796
796
|
const result = resolveTools(history);
|
|
797
797
|
|
|
798
|
-
//
|
|
798
|
+
// Only base tools present
|
|
799
|
+
expect(result).toHaveLength(2);
|
|
799
800
|
expect(result[0].name).toBe("file_read");
|
|
800
801
|
expect(result[1].name).toBe("bash");
|
|
801
|
-
expect(result[2].name).toBe("oncall_page");
|
|
802
802
|
});
|
|
803
803
|
|
|
804
|
-
test("multiple skills
|
|
804
|
+
test("multiple active skills do not add tools to definitions array", () => {
|
|
805
805
|
mockCatalog = [makeSkill("deploy"), makeSkill("oncall")];
|
|
806
806
|
mockManifests = {
|
|
807
807
|
deploy: makeManifest(["deploy_run"]),
|
|
@@ -816,13 +816,14 @@ describe("resolveTools callback (session wiring)", () => {
|
|
|
816
816
|
|
|
817
817
|
const result = resolveTools(history);
|
|
818
818
|
|
|
819
|
-
|
|
819
|
+
// Only base tools — skill tool definitions no longer in the API tools array
|
|
820
|
+
expect(result).toHaveLength(2);
|
|
820
821
|
const names = result.map((d) => d.name);
|
|
821
822
|
expect(names).toContain("file_read");
|
|
822
823
|
expect(names).toContain("bash");
|
|
823
|
-
expect(names).toContain("deploy_run");
|
|
824
|
-
expect(names).toContain("oncall_page");
|
|
825
|
-
expect(names).toContain("oncall_ack");
|
|
824
|
+
expect(names).not.toContain("deploy_run");
|
|
825
|
+
expect(names).not.toContain("oncall_page");
|
|
826
|
+
expect(names).not.toContain("oncall_ack");
|
|
826
827
|
});
|
|
827
828
|
});
|
|
828
829
|
|
|
@@ -1033,8 +1034,7 @@ describe("skill activation requires loaded_skill marker (security invariant)", (
|
|
|
1033
1034
|
const result = projectSkillTools(history, {
|
|
1034
1035
|
previouslyActiveSkillIds: sessionState,
|
|
1035
1036
|
});
|
|
1036
|
-
expect(result.toolDefinitions).
|
|
1037
|
-
expect(result.toolDefinitions[0].name).toBe("approved_action");
|
|
1037
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1038
1038
|
expect(result.allowedToolNames.has("approved_action")).toBe(true);
|
|
1039
1039
|
});
|
|
1040
1040
|
});
|
|
@@ -1088,7 +1088,7 @@ describe("mid-run skill tool activation (end-to-end)", () => {
|
|
|
1088
1088
|
sessionState = new Map<string, string>();
|
|
1089
1089
|
});
|
|
1090
1090
|
|
|
1091
|
-
test("Turn 1 calls skill_load → Turn 2
|
|
1091
|
+
test("Turn 1 calls skill_load → Turn 2 skill is in allowedToolNames but NOT in tool definitions", () => {
|
|
1092
1092
|
mockCatalog = [makeSkill("deploy")];
|
|
1093
1093
|
mockManifests = { deploy: makeManifest(["deploy_run"]) };
|
|
1094
1094
|
|
|
@@ -1137,10 +1137,10 @@ describe("mid-run skill tool activation (end-to-end)", () => {
|
|
|
1137
1137
|
];
|
|
1138
1138
|
|
|
1139
1139
|
const turn2Result = resolveTools(historyTurn2);
|
|
1140
|
+
// Tool definitions remain stable (only base tools) — skill tools dispatched via skill_execute
|
|
1140
1141
|
expect(turn2Result.toolDefinitions.map((d) => d.name)).toEqual([
|
|
1141
1142
|
"file_read",
|
|
1142
1143
|
"bash",
|
|
1143
|
-
"deploy_run",
|
|
1144
1144
|
]);
|
|
1145
1145
|
expect(turn2Result.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1146
1146
|
});
|
|
@@ -1187,13 +1187,14 @@ describe("mid-run skill tool activation (end-to-end)", () => {
|
|
|
1187
1187
|
|
|
1188
1188
|
const result = resolveTools(history);
|
|
1189
1189
|
|
|
1190
|
-
// Skill tools
|
|
1191
|
-
expect(result.toolDefinitions.map((d) => d.name)).toContain(
|
|
1190
|
+
// Skill tools are NOT in the definitions array — dispatched via skill_execute
|
|
1191
|
+
expect(result.toolDefinitions.map((d) => d.name)).not.toContain(
|
|
1192
1192
|
"monitor_check",
|
|
1193
1193
|
);
|
|
1194
|
-
expect(result.toolDefinitions.map((d) => d.name)).toContain(
|
|
1194
|
+
expect(result.toolDefinitions.map((d) => d.name)).not.toContain(
|
|
1195
1195
|
"monitor_alert",
|
|
1196
1196
|
);
|
|
1197
|
+
// But they ARE in the allowed set (for skill_execute dispatch)
|
|
1197
1198
|
expect(result.allowedToolNames.has("monitor_check")).toBe(true);
|
|
1198
1199
|
expect(result.allowedToolNames.has("monitor_alert")).toBe(true);
|
|
1199
1200
|
|
|
@@ -1248,9 +1249,11 @@ describe("mid-run skill tool activation (end-to-end)", () => {
|
|
|
1248
1249
|
|
|
1249
1250
|
const resultA = resolveTools(historyAfterA);
|
|
1250
1251
|
const namesA = resultA.toolDefinitions.map((d) => d.name);
|
|
1251
|
-
|
|
1252
|
+
// Skill tools not in definitions — only in allowedToolNames
|
|
1253
|
+
expect(namesA).not.toContain("deploy_run");
|
|
1252
1254
|
expect(namesA).not.toContain("oncall_page");
|
|
1253
1255
|
expect(namesA).not.toContain("metrics_query");
|
|
1256
|
+
expect(resultA.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1254
1257
|
|
|
1255
1258
|
// Step 2: Load skill B (oncall) — deploy should remain active
|
|
1256
1259
|
const historyAfterB: Message[] = [
|
|
@@ -1280,9 +1283,12 @@ describe("mid-run skill tool activation (end-to-end)", () => {
|
|
|
1280
1283
|
|
|
1281
1284
|
const resultB = resolveTools(historyAfterB);
|
|
1282
1285
|
const namesB = resultB.toolDefinitions.map((d) => d.name);
|
|
1283
|
-
|
|
1284
|
-
expect(namesB).toContain("
|
|
1286
|
+
// Skill tools not in definitions
|
|
1287
|
+
expect(namesB).not.toContain("deploy_run");
|
|
1288
|
+
expect(namesB).not.toContain("oncall_page");
|
|
1285
1289
|
expect(namesB).not.toContain("metrics_query");
|
|
1290
|
+
expect(resultB.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1291
|
+
expect(resultB.allowedToolNames.has("oncall_page")).toBe(true);
|
|
1286
1292
|
|
|
1287
1293
|
// Step 3: Load skill C (metrics) — all three should be active
|
|
1288
1294
|
const historyAfterC: Message[] = [
|
|
@@ -1312,10 +1318,12 @@ describe("mid-run skill tool activation (end-to-end)", () => {
|
|
|
1312
1318
|
|
|
1313
1319
|
const resultC = resolveTools(historyAfterC);
|
|
1314
1320
|
const namesC = resultC.toolDefinitions.map((d) => d.name);
|
|
1315
|
-
|
|
1316
|
-
expect(namesC).toContain("
|
|
1317
|
-
expect(namesC).toContain("
|
|
1318
|
-
expect(namesC).toContain("
|
|
1321
|
+
// Skill tools not in definitions — only base tools
|
|
1322
|
+
expect(namesC).not.toContain("deploy_run");
|
|
1323
|
+
expect(namesC).not.toContain("oncall_page");
|
|
1324
|
+
expect(namesC).not.toContain("metrics_query");
|
|
1325
|
+
expect(namesC).not.toContain("metrics_dashboard");
|
|
1326
|
+
expect(namesC).toEqual(["file_read", "bash"]);
|
|
1319
1327
|
|
|
1320
1328
|
// Verify allowed tool names include all skill tools plus core tools
|
|
1321
1329
|
expect(resultC.allowedToolNames.has("deploy_run")).toBe(true);
|
|
@@ -1380,7 +1388,7 @@ describe("context-derived deactivation regression", () => {
|
|
|
1380
1388
|
sessionState = new Map<string, string>();
|
|
1381
1389
|
});
|
|
1382
1390
|
|
|
1383
|
-
test("tool definitions
|
|
1391
|
+
test("tool definitions stay stable — only allowedToolNames changes when skills deactivate", () => {
|
|
1384
1392
|
mockCatalog = [makeSkill("deploy"), makeSkill("oncall")];
|
|
1385
1393
|
mockManifests = {
|
|
1386
1394
|
deploy: makeManifest(["deploy_run"]),
|
|
@@ -1395,9 +1403,10 @@ describe("context-derived deactivation regression", () => {
|
|
|
1395
1403
|
...skillLoadMessages('<loaded_skill id="oncall" />'),
|
|
1396
1404
|
];
|
|
1397
1405
|
const result1 = resolveTools(history1);
|
|
1398
|
-
|
|
1399
|
-
expect(result1.toolDefinitions
|
|
1400
|
-
expect(result1.
|
|
1406
|
+
// Only base tools in definitions — skill tools dispatched via skill_execute
|
|
1407
|
+
expect(result1.toolDefinitions).toHaveLength(2);
|
|
1408
|
+
expect(result1.allowedToolNames.has("oncall_page")).toBe(true);
|
|
1409
|
+
expect(result1.allowedToolNames.has("oncall_ack")).toBe(true);
|
|
1401
1410
|
|
|
1402
1411
|
// Turn 2: oncall marker removed from history (truncated)
|
|
1403
1412
|
const history2: Message[] = [
|
|
@@ -1405,15 +1414,16 @@ describe("context-derived deactivation regression", () => {
|
|
|
1405
1414
|
];
|
|
1406
1415
|
const result2 = resolveTools(history2);
|
|
1407
1416
|
|
|
1408
|
-
// Tool definitions
|
|
1409
|
-
expect(result2.toolDefinitions).toHaveLength(
|
|
1410
|
-
expect(result2.toolDefinitions.map((d) => d.name)).
|
|
1411
|
-
"
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
);
|
|
1416
|
-
expect(result2.
|
|
1417
|
+
// Tool definitions unchanged — still only base tools
|
|
1418
|
+
expect(result2.toolDefinitions).toHaveLength(2);
|
|
1419
|
+
expect(result2.toolDefinitions.map((d) => d.name)).toEqual([
|
|
1420
|
+
"file_read",
|
|
1421
|
+
"bash",
|
|
1422
|
+
]);
|
|
1423
|
+
// allowedToolNames reflects deactivation
|
|
1424
|
+
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1425
|
+
expect(result2.allowedToolNames.has("oncall_page")).toBe(false);
|
|
1426
|
+
expect(result2.allowedToolNames.has("oncall_ack")).toBe(false);
|
|
1417
1427
|
});
|
|
1418
1428
|
|
|
1419
1429
|
test("executor blocks the tool after deactivation — allowedToolNames excludes it", () => {
|
|
@@ -1492,7 +1502,8 @@ describe("context-derived deactivation regression", () => {
|
|
|
1492
1502
|
...skillLoadMessages('<loaded_skill id="oncall" />'),
|
|
1493
1503
|
];
|
|
1494
1504
|
const result1 = resolveTools(history1);
|
|
1495
|
-
|
|
1505
|
+
// Only base tools in definitions — skill tools dispatched via skill_execute
|
|
1506
|
+
expect(result1.toolDefinitions).toHaveLength(2);
|
|
1496
1507
|
|
|
1497
1508
|
// Clear tracking before turn 2
|
|
1498
1509
|
mockUnregisteredSkillIds = [];
|
|
@@ -1503,7 +1514,7 @@ describe("context-derived deactivation regression", () => {
|
|
|
1503
1514
|
];
|
|
1504
1515
|
const result2 = resolveTools(history2);
|
|
1505
1516
|
|
|
1506
|
-
//
|
|
1517
|
+
// Still only base tools (same as turn 1)
|
|
1507
1518
|
expect(result2.toolDefinitions).toHaveLength(2);
|
|
1508
1519
|
expect(result2.toolDefinitions.map((d) => d.name)).toEqual([
|
|
1509
1520
|
"file_read",
|
|
@@ -1550,7 +1561,10 @@ describe("context-derived deactivation regression", () => {
|
|
|
1550
1561
|
];
|
|
1551
1562
|
const result3 = resolveTools(history3);
|
|
1552
1563
|
expect(result3.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1553
|
-
|
|
1564
|
+
// Skill tools not in definitions — dispatched via skill_execute
|
|
1565
|
+
expect(result3.toolDefinitions.map((d) => d.name)).not.toContain(
|
|
1566
|
+
"deploy_run",
|
|
1567
|
+
);
|
|
1554
1568
|
});
|
|
1555
1569
|
});
|
|
1556
1570
|
|
|
@@ -1573,7 +1587,7 @@ describe("slash preactivation through session processing", () => {
|
|
|
1573
1587
|
sessionState = new Map<string, string>();
|
|
1574
1588
|
});
|
|
1575
1589
|
|
|
1576
|
-
test("slash-known skill has its tools
|
|
1590
|
+
test("slash-known skill has its tools in allowedToolNames on first projection (turn-0)", () => {
|
|
1577
1591
|
mockCatalog = [makeSkill("deploy")];
|
|
1578
1592
|
mockManifests = { deploy: makeManifest(["deploy_run", "deploy_status"]) };
|
|
1579
1593
|
|
|
@@ -1586,11 +1600,8 @@ describe("slash preactivation through session processing", () => {
|
|
|
1586
1600
|
previouslyActiveSkillIds: sessionState,
|
|
1587
1601
|
});
|
|
1588
1602
|
|
|
1589
|
-
|
|
1590
|
-
expect(result.toolDefinitions
|
|
1591
|
-
"deploy_run",
|
|
1592
|
-
"deploy_status",
|
|
1593
|
-
]);
|
|
1603
|
+
// Tool definitions are no longer sent to the LLM
|
|
1604
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1594
1605
|
expect(result.allowedToolNames).toEqual(
|
|
1595
1606
|
new Set(["deploy_run", "deploy_status"]),
|
|
1596
1607
|
);
|
|
@@ -1605,7 +1616,7 @@ describe("slash preactivation through session processing", () => {
|
|
|
1605
1616
|
preactivatedSkillIds: ["deploy"],
|
|
1606
1617
|
previouslyActiveSkillIds: sessionState,
|
|
1607
1618
|
});
|
|
1608
|
-
expect(result1.toolDefinitions).
|
|
1619
|
+
expect(result1.toolDefinitions).toEqual([]);
|
|
1609
1620
|
expect(result1.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1610
1621
|
|
|
1611
1622
|
// Second request: no preactivation, no history markers.
|
|
@@ -1614,7 +1625,7 @@ describe("slash preactivation through session processing", () => {
|
|
|
1614
1625
|
previouslyActiveSkillIds: sessionState,
|
|
1615
1626
|
});
|
|
1616
1627
|
|
|
1617
|
-
expect(result2.toolDefinitions).
|
|
1628
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
1618
1629
|
expect(result2.allowedToolNames.has("deploy_run")).toBe(false);
|
|
1619
1630
|
});
|
|
1620
1631
|
|
|
@@ -1636,7 +1647,7 @@ describe("slash preactivation through session processing", () => {
|
|
|
1636
1647
|
previouslyActiveSkillIds: sessionState,
|
|
1637
1648
|
});
|
|
1638
1649
|
|
|
1639
|
-
expect(result.toolDefinitions).
|
|
1650
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1640
1651
|
expect(result.allowedToolNames).toEqual(
|
|
1641
1652
|
new Set(["deploy_run", "oncall_page"]),
|
|
1642
1653
|
);
|
|
@@ -1654,9 +1665,7 @@ const GMAIL_TOOL_NAMES = [
|
|
|
1654
1665
|
"gmail_mark_read",
|
|
1655
1666
|
"gmail_draft",
|
|
1656
1667
|
"gmail_archive",
|
|
1657
|
-
"gmail_batch_archive",
|
|
1658
1668
|
"gmail_label",
|
|
1659
|
-
"gmail_batch_label",
|
|
1660
1669
|
"gmail_trash",
|
|
1661
1670
|
"gmail_send",
|
|
1662
1671
|
"gmail_unsubscribe",
|
|
@@ -1677,7 +1686,7 @@ describe("bundled skill: gmail", () => {
|
|
|
1677
1686
|
sessionState = new Map<string, string>();
|
|
1678
1687
|
});
|
|
1679
1688
|
|
|
1680
|
-
test("gmail skill activation via loaded_skill marker
|
|
1689
|
+
test("gmail skill activation via loaded_skill marker registers all 11 tools in allowedToolNames", () => {
|
|
1681
1690
|
mockCatalog = [makeSkill("gmail", "/path/to/bundled-skills/gmail")];
|
|
1682
1691
|
mockManifests = { gmail: makeManifest([...GMAIL_TOOL_NAMES]) };
|
|
1683
1692
|
|
|
@@ -1689,10 +1698,7 @@ describe("bundled skill: gmail", () => {
|
|
|
1689
1698
|
previouslyActiveSkillIds: sessionState,
|
|
1690
1699
|
});
|
|
1691
1700
|
|
|
1692
|
-
expect(result.toolDefinitions).
|
|
1693
|
-
expect(result.toolDefinitions.map((d) => d.name)).toEqual([
|
|
1694
|
-
...GMAIL_TOOL_NAMES,
|
|
1695
|
-
]);
|
|
1701
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1696
1702
|
expect(result.allowedToolNames).toEqual(new Set(GMAIL_TOOL_NAMES));
|
|
1697
1703
|
});
|
|
1698
1704
|
|
|
@@ -1732,7 +1738,7 @@ describe("bundled skill: claude-code", () => {
|
|
|
1732
1738
|
sessionState = new Map<string, string>();
|
|
1733
1739
|
});
|
|
1734
1740
|
|
|
1735
|
-
test("claude-code skill activation
|
|
1741
|
+
test("claude-code skill activation registers claude_code in allowedToolNames", () => {
|
|
1736
1742
|
mockCatalog = [
|
|
1737
1743
|
makeSkill("claude-code", "/path/to/bundled-skills/claude-code"),
|
|
1738
1744
|
];
|
|
@@ -1746,8 +1752,7 @@ describe("bundled skill: claude-code", () => {
|
|
|
1746
1752
|
previouslyActiveSkillIds: sessionState,
|
|
1747
1753
|
});
|
|
1748
1754
|
|
|
1749
|
-
expect(result.toolDefinitions).
|
|
1750
|
-
expect(result.toolDefinitions[0].name).toBe("claude_code");
|
|
1755
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1751
1756
|
expect(result.allowedToolNames).toEqual(new Set(["claude_code"]));
|
|
1752
1757
|
});
|
|
1753
1758
|
|
|
@@ -1800,7 +1805,7 @@ describe("bundled skill: app-builder", () => {
|
|
|
1800
1805
|
sessionState = new Map<string, string>();
|
|
1801
1806
|
});
|
|
1802
1807
|
|
|
1803
|
-
test("app-builder skill activation
|
|
1808
|
+
test("app-builder skill activation registers all 9 canonical non-proxy tools in allowedToolNames", () => {
|
|
1804
1809
|
mockCatalog = [
|
|
1805
1810
|
makeSkill("app-builder", "/path/to/bundled-skills/app-builder"),
|
|
1806
1811
|
];
|
|
@@ -1816,10 +1821,7 @@ describe("bundled skill: app-builder", () => {
|
|
|
1816
1821
|
previouslyActiveSkillIds: sessionState,
|
|
1817
1822
|
});
|
|
1818
1823
|
|
|
1819
|
-
expect(result.toolDefinitions).
|
|
1820
|
-
expect(result.toolDefinitions.map((d) => d.name)).toEqual([
|
|
1821
|
-
...APP_BUILDER_TOOL_NAMES,
|
|
1822
|
-
]);
|
|
1824
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1823
1825
|
expect(result.allowedToolNames).toEqual(new Set(APP_BUILDER_TOOL_NAMES));
|
|
1824
1826
|
});
|
|
1825
1827
|
|
|
@@ -1890,7 +1892,7 @@ describe("bundled skill: browser", () => {
|
|
|
1890
1892
|
sessionState = new Map<string, string>();
|
|
1891
1893
|
});
|
|
1892
1894
|
|
|
1893
|
-
test("browser skill activation via loaded_skill marker
|
|
1895
|
+
test("browser skill activation via loaded_skill marker registers all 14 tools in allowedToolNames", () => {
|
|
1894
1896
|
mockCatalog = [makeSkill("browser", "/path/to/bundled-skills/browser")];
|
|
1895
1897
|
mockManifests = { browser: makeManifest([...BROWSER_TOOL_NAMES]) };
|
|
1896
1898
|
|
|
@@ -1902,10 +1904,7 @@ describe("bundled skill: browser", () => {
|
|
|
1902
1904
|
previouslyActiveSkillIds: sessionState,
|
|
1903
1905
|
});
|
|
1904
1906
|
|
|
1905
|
-
expect(result.toolDefinitions).
|
|
1906
|
-
expect(result.toolDefinitions.map((d) => d.name)).toEqual([
|
|
1907
|
-
...BROWSER_TOOL_NAMES,
|
|
1908
|
-
]);
|
|
1907
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
1909
1908
|
expect(result.allowedToolNames).toEqual(new Set(BROWSER_TOOL_NAMES));
|
|
1910
1909
|
});
|
|
1911
1910
|
|
|
@@ -1980,8 +1979,8 @@ describe("tamper detection", () => {
|
|
|
1980
1979
|
const result1 = projectSkillTools(history, {
|
|
1981
1980
|
previouslyActiveSkillIds: sessionState,
|
|
1982
1981
|
});
|
|
1983
|
-
expect(result1.toolDefinitions).
|
|
1984
|
-
expect(result1.
|
|
1982
|
+
expect(result1.toolDefinitions).toEqual([]);
|
|
1983
|
+
expect(result1.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1985
1984
|
expect(sessionState.get("deploy")).toBe("v1:original-file-hash");
|
|
1986
1985
|
|
|
1987
1986
|
// Simulate file mutation on disk — the hash changes
|
|
@@ -1994,8 +1993,8 @@ describe("tamper detection", () => {
|
|
|
1994
1993
|
});
|
|
1995
1994
|
|
|
1996
1995
|
// Tools are still available (re-registered with new hash)
|
|
1997
|
-
expect(result2.toolDefinitions).
|
|
1998
|
-
expect(result2.
|
|
1996
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
1997
|
+
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
1999
1998
|
|
|
2000
1999
|
// Old tools were unregistered before new ones registered
|
|
2001
2000
|
expect(mockUnregisteredSkillIds).toContain("deploy");
|
|
@@ -2026,7 +2025,8 @@ describe("tamper detection", () => {
|
|
|
2026
2025
|
const result = projectSkillTools(history, {
|
|
2027
2026
|
previouslyActiveSkillIds: sessionState,
|
|
2028
2027
|
});
|
|
2029
|
-
expect(result.toolDefinitions).
|
|
2028
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2029
|
+
expect(result.allowedToolNames.has("deploy_run")).toBe(true);
|
|
2030
2030
|
expect(mockUnregisteredSkillIds).not.toContain("deploy");
|
|
2031
2031
|
expect(mockSkillRefCount.get("deploy")).toBe(1);
|
|
2032
2032
|
}
|
|
@@ -2053,7 +2053,7 @@ describe("tamper detection", () => {
|
|
|
2053
2053
|
previouslyActiveSkillIds: sessionState,
|
|
2054
2054
|
});
|
|
2055
2055
|
|
|
2056
|
-
expect(result.toolDefinitions).
|
|
2056
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2057
2057
|
expect(result.allowedToolNames).toEqual(
|
|
2058
2058
|
new Set(["deploy_run", "deploy_status"]),
|
|
2059
2059
|
);
|
|
@@ -2093,7 +2093,7 @@ describe("tamper detection", () => {
|
|
|
2093
2093
|
previouslyActiveSkillIds: sessionState,
|
|
2094
2094
|
});
|
|
2095
2095
|
|
|
2096
|
-
expect(result.toolDefinitions).
|
|
2096
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2097
2097
|
expect(result.allowedToolNames).toEqual(
|
|
2098
2098
|
new Set(["deploy_run", "oncall_page"]),
|
|
2099
2099
|
);
|
|
@@ -2127,7 +2127,8 @@ describe("tamper detection", () => {
|
|
|
2127
2127
|
const result = projectSkillTools(history, {
|
|
2128
2128
|
previouslyActiveSkillIds: sessionState,
|
|
2129
2129
|
});
|
|
2130
|
-
expect(result.toolDefinitions).
|
|
2130
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2131
|
+
expect(result.allowedToolNames.has("deploy_run")).toBe(true);
|
|
2131
2132
|
|
|
2132
2133
|
// The exception triggers re-registration since the fallback hash
|
|
2133
2134
|
// (`unknown-<timestamp>`) will never match the stored hash
|
|
@@ -2219,8 +2220,7 @@ describe("versioned markers through session projection", () => {
|
|
|
2219
2220
|
previouslyActiveSkillIds: sessionState,
|
|
2220
2221
|
});
|
|
2221
2222
|
|
|
2222
|
-
expect(result.toolDefinitions).
|
|
2223
|
-
expect(result.toolDefinitions[0].name).toBe("deploy_run");
|
|
2223
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2224
2224
|
expect(result.allowedToolNames).toEqual(new Set(["deploy_run"]));
|
|
2225
2225
|
});
|
|
2226
2226
|
|
|
@@ -2242,7 +2242,7 @@ describe("versioned markers through session projection", () => {
|
|
|
2242
2242
|
previouslyActiveSkillIds: sessionState,
|
|
2243
2243
|
});
|
|
2244
2244
|
|
|
2245
|
-
expect(result.toolDefinitions).
|
|
2245
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2246
2246
|
expect(result.allowedToolNames).toEqual(
|
|
2247
2247
|
new Set(["deploy_run", "oncall_page"]),
|
|
2248
2248
|
);
|
|
@@ -2303,7 +2303,8 @@ describe("hash change re-prompt regressions (PR 35)", () => {
|
|
|
2303
2303
|
const result1 = projectSkillTools(history, {
|
|
2304
2304
|
previouslyActiveSkillIds: sessionState,
|
|
2305
2305
|
});
|
|
2306
|
-
expect(result1.toolDefinitions).
|
|
2306
|
+
expect(result1.toolDefinitions).toEqual([]);
|
|
2307
|
+
expect(result1.allowedToolNames.has("deploy_run")).toBe(true);
|
|
2307
2308
|
expect(sessionState.get("deploy")).toBe("v1:approved-hash");
|
|
2308
2309
|
expect(mockSkillRefCount.get("deploy")).toBe(1);
|
|
2309
2310
|
|
|
@@ -2316,8 +2317,8 @@ describe("hash change re-prompt regressions (PR 35)", () => {
|
|
|
2316
2317
|
previouslyActiveSkillIds: sessionState,
|
|
2317
2318
|
});
|
|
2318
2319
|
|
|
2319
|
-
expect(result2.toolDefinitions).
|
|
2320
|
-
expect(result2.
|
|
2320
|
+
expect(result2.toolDefinitions).toEqual([]);
|
|
2321
|
+
expect(result2.allowedToolNames.has("deploy_run")).toBe(true);
|
|
2321
2322
|
|
|
2322
2323
|
// Old version was unregistered
|
|
2323
2324
|
expect(mockUnregisteredSkillIds).toContain("deploy");
|
|
@@ -2580,8 +2581,7 @@ describe("includes metadata does not auto-activate child skill tools", () => {
|
|
|
2580
2581
|
});
|
|
2581
2582
|
|
|
2582
2583
|
// Only parent tools should be projected
|
|
2583
|
-
expect(result.toolDefinitions).
|
|
2584
|
-
expect(result.toolDefinitions[0].name).toBe("parent_action");
|
|
2584
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2585
2585
|
expect(result.allowedToolNames).toEqual(new Set(["parent_action"]));
|
|
2586
2586
|
|
|
2587
2587
|
// Child tools must NOT be present
|
|
@@ -2608,7 +2608,7 @@ describe("includes metadata does not auto-activate child skill tools", () => {
|
|
|
2608
2608
|
previouslyActiveSkillIds: sessionState,
|
|
2609
2609
|
});
|
|
2610
2610
|
|
|
2611
|
-
expect(result.toolDefinitions).
|
|
2611
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2612
2612
|
expect(result.allowedToolNames).toEqual(
|
|
2613
2613
|
new Set(["parent_action", "child_action"]),
|
|
2614
2614
|
);
|
|
@@ -2636,8 +2636,8 @@ describe("includes metadata does not auto-activate child skill tools", () => {
|
|
|
2636
2636
|
previouslyActiveSkillIds: sessionState,
|
|
2637
2637
|
});
|
|
2638
2638
|
|
|
2639
|
-
expect(result.toolDefinitions).
|
|
2640
|
-
expect(result.
|
|
2639
|
+
expect(result.toolDefinitions).toEqual([]);
|
|
2640
|
+
expect(result.allowedToolNames.has("gp_action")).toBe(true);
|
|
2641
2641
|
expect(result.allowedToolNames.has("parent_action")).toBe(false);
|
|
2642
2642
|
expect(result.allowedToolNames.has("child_action")).toBe(false);
|
|
2643
2643
|
});
|