@vellumai/assistant 0.4.53 → 0.4.54
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/bun.lock +62 -349
- package/docs/architecture/integrations.md +1 -1
- package/docs/architecture/keychain-broker.md +94 -29
- package/docs/architecture/security.md +2 -2
- package/knip.json +7 -29
- package/package.json +2 -9
- package/src/__tests__/agent-loop.test.ts +1 -1
- package/src/__tests__/app-git-history.test.ts +0 -2
- package/src/__tests__/app-git-service.test.ts +1 -6
- package/src/__tests__/approval-cascade.test.ts +0 -1
- package/src/__tests__/avatar-e2e.test.ts +0 -1
- package/src/__tests__/browser-fill-credential.test.ts +1 -6
- package/src/__tests__/call-domain.test.ts +0 -1
- package/src/__tests__/call-routes-http.test.ts +0 -1
- package/src/__tests__/channel-guardian.test.ts +4 -4
- package/src/__tests__/channel-readiness-routes.test.ts +0 -1
- package/src/__tests__/channel-readiness-service.test.ts +0 -1
- package/src/__tests__/checker.test.ts +13 -11
- package/src/__tests__/claude-code-skill-regression.test.ts +0 -1
- package/src/__tests__/claude-code-tool-profiles.test.ts +1 -2
- package/src/__tests__/config-loader-backfill.test.ts +0 -3
- package/src/__tests__/config-schema.test.ts +3 -9
- package/src/__tests__/config-watcher.test.ts +11 -3
- package/src/__tests__/credential-broker-browser-fill.test.ts +27 -24
- package/src/__tests__/credential-broker-server-use.test.ts +60 -24
- package/src/__tests__/credential-security-e2e.test.ts +1 -6
- package/src/__tests__/credential-security-invariants.test.ts +13 -8
- package/src/__tests__/credential-vault-unit.test.ts +28 -12
- package/src/__tests__/credential-vault.test.ts +40 -28
- package/src/__tests__/credentials-cli.test.ts +1 -21
- package/src/__tests__/email-invite-adapter.test.ts +0 -1
- package/src/__tests__/fixtures/credential-security-fixtures.ts +3 -3
- package/src/__tests__/fixtures/media-reuse-fixtures.ts +3 -79
- package/src/__tests__/gateway-only-enforcement.test.ts +1 -21
- package/src/__tests__/guardian-action-conversation-turn.test.ts +8 -8
- package/src/__tests__/guardian-action-late-reply.test.ts +13 -14
- package/src/__tests__/guardian-action-store.test.ts +0 -57
- package/src/__tests__/guardian-outbound-http.test.ts +1 -1
- package/src/__tests__/guardian-verification-voice-binding.test.ts +1 -3
- package/src/__tests__/hooks-blocking.test.ts +1 -1
- package/src/__tests__/hooks-config.test.ts +5 -29
- package/src/__tests__/hooks-discovery.test.ts +1 -1
- package/src/__tests__/hooks-integration.test.ts +1 -1
- package/src/__tests__/hooks-manager.test.ts +1 -1
- package/src/__tests__/hooks-runner.test.ts +1 -23
- package/src/__tests__/hooks-settings.test.ts +1 -1
- package/src/__tests__/hooks-templates.test.ts +1 -1
- package/src/__tests__/integration-status.test.ts +0 -1
- package/src/__tests__/invite-routes-http.test.ts +0 -3
- package/src/__tests__/llm-usage-store.test.ts +50 -0
- package/src/__tests__/managed-proxy-context.test.ts +41 -41
- package/src/__tests__/media-generate-image.test.ts +2 -2
- package/src/__tests__/media-reuse-story.e2e.test.ts +1 -6
- package/src/__tests__/memory-regressions.experimental.test.ts +4 -4
- package/src/__tests__/memory-regressions.test.ts +27 -27
- package/src/__tests__/memory-retrieval.benchmark.test.ts +1 -1
- package/src/__tests__/memory-upsert-concurrency.test.ts +4 -4
- package/src/__tests__/notification-decision-fallback.test.ts +1 -1
- package/src/__tests__/oauth-cli.test.ts +1 -4
- package/src/__tests__/oauth-store.test.ts +1 -3
- package/src/__tests__/openai-provider.test.ts +7 -7
- package/src/__tests__/platform.test.ts +14 -4
- package/src/__tests__/pricing.test.ts +0 -223
- package/src/__tests__/provider-commit-message-generator.test.ts +1 -4
- package/src/__tests__/provider-fail-open-selection.test.ts +58 -54
- package/src/__tests__/provider-managed-proxy-integration.test.ts +63 -63
- package/src/__tests__/provider-registry-ollama.test.ts +3 -3
- package/src/__tests__/public-ingress-urls.test.ts +1 -1
- package/src/__tests__/registry.test.ts +3 -103
- package/src/__tests__/script-proxy-injection-runtime.test.ts +2 -7
- package/src/__tests__/secret-onetime-send.test.ts +1 -6
- package/src/__tests__/secret-routes-managed-proxy.test.ts +6 -13
- package/src/__tests__/secure-keys.test.ts +241 -229
- package/src/__tests__/session-abort-tool-results.test.ts +0 -1
- package/src/__tests__/session-confirmation-signals.test.ts +0 -1
- package/src/__tests__/session-messaging-secret-redirect.test.ts +1 -7
- package/src/__tests__/session-pre-run-repair.test.ts +0 -1
- package/src/__tests__/session-provider-retry-repair.test.ts +0 -1
- package/src/__tests__/session-queue.test.ts +2 -4
- 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-workspace-injection.test.ts +0 -1
- package/src/__tests__/session-workspace-tool-tracking.test.ts +0 -1
- package/src/__tests__/skill-projection-feature-flag.test.ts +0 -1
- package/src/__tests__/slack-channel-config.test.ts +1 -7
- package/src/__tests__/swarm-recursion.test.ts +0 -1
- package/src/__tests__/swarm-session-integration.test.ts +0 -1
- package/src/__tests__/swarm-tool.test.ts +0 -1
- package/src/__tests__/task-compiler.test.ts +1 -1
- package/src/__tests__/test-support/browser-skill-harness.ts +0 -18
- package/src/__tests__/test-support/computer-use-skill-harness.ts +0 -23
- package/src/__tests__/tool-executor.test.ts +1 -1
- package/src/__tests__/trust-store.test.ts +3 -82
- package/src/__tests__/twilio-config.test.ts +0 -1
- package/src/__tests__/twilio-provider.test.ts +0 -5
- package/src/__tests__/twilio-routes.test.ts +0 -1
- package/src/__tests__/usage-cache-backfill-migration.test.ts +10 -10
- package/src/calls/guardian-question-copy.ts +1 -1
- package/src/cli/commands/doctor.ts +10 -34
- package/src/cli/commands/memory.ts +3 -5
- package/src/cli/commands/sessions.ts +1 -1
- package/src/cli/commands/usage.ts +359 -0
- package/src/cli/http-client.ts +22 -12
- package/src/cli/program.ts +2 -0
- package/src/cli/reference.ts +1 -0
- package/src/cli.ts +251 -181
- package/src/config/assistant-feature-flags.ts +0 -7
- package/src/config/bundled-skills/chatgpt-import/tools/chatgpt-import.ts +1 -1
- package/src/config/bundled-skills/claude-code/SKILL.md +1 -1
- package/src/config/bundled-skills/claude-code/TOOLS.json +1 -1
- package/src/config/bundled-skills/gmail/SKILL.md +0 -1
- package/src/config/bundled-skills/image-studio/tools/media-generate-image.ts +2 -2
- package/src/config/bundled-skills/media-processing/services/reduce.ts +1 -1
- package/src/config/bundled-skills/messaging/SKILL.md +0 -1
- package/src/config/bundled-skills/sequences/SKILL.md +0 -1
- package/src/config/env.ts +13 -0
- package/src/config/feature-flag-registry.json +9 -41
- package/src/config/schemas/security.ts +1 -2
- package/src/config/skills.ts +1 -1
- package/src/contacts/contact-store.ts +0 -50
- package/src/daemon/approved-devices-store.ts +0 -44
- package/src/daemon/classifier.ts +1 -1
- package/src/daemon/config-watcher.ts +12 -6
- package/src/daemon/handlers/config-model.ts +1 -1
- package/src/daemon/handlers/sessions.ts +4 -116
- package/src/daemon/handlers/skills.ts +1 -1
- package/src/daemon/lifecycle.ts +13 -15
- package/src/daemon/providers-setup.ts +1 -1
- package/src/daemon/server.ts +19 -3
- package/src/daemon/session-slash.ts +2 -2
- package/src/daemon/shutdown-handlers.ts +15 -0
- package/src/daemon/watch-handler.ts +2 -2
- package/src/email/guardrails.ts +1 -1
- package/src/email/service.ts +0 -5
- package/src/hooks/templates.ts +1 -1
- package/src/media/app-icon-generator.ts +2 -2
- package/src/media/avatar-router.ts +2 -2
- package/src/media/gemini-image-service.ts +5 -5
- package/src/memory/admin.ts +2 -2
- package/src/memory/app-git-service.ts +0 -7
- package/src/memory/conversation-crud.ts +1 -1
- package/src/memory/conversation-title-service.ts +2 -2
- package/src/memory/embedding-backend.ts +30 -26
- package/src/memory/external-conversation-store.ts +0 -30
- package/src/memory/guardian-action-store.ts +0 -31
- package/src/memory/guardian-approvals.ts +1 -56
- package/src/memory/indexer.ts +4 -3
- package/src/memory/items-extractor.ts +1 -1
- package/src/memory/job-handlers/backfill.ts +5 -2
- package/src/memory/job-handlers/index-maintenance.ts +2 -2
- package/src/memory/job-handlers/media-processing.ts +2 -2
- package/src/memory/job-handlers/summarization.ts +1 -1
- package/src/memory/job-utils.ts +1 -2
- package/src/memory/jobs-worker.ts +2 -2
- package/src/memory/llm-usage-store.ts +57 -11
- package/src/memory/media-store.ts +4 -535
- package/src/memory/migrations/032-guardian-delivery-conversation-index.ts +2 -2
- package/src/memory/migrations/110-channel-guardian.ts +0 -1
- package/src/memory/published-pages-store.ts +0 -83
- package/src/memory/qdrant-circuit-breaker.ts +0 -8
- package/src/memory/retriever.ts +1 -1
- package/src/memory/search/semantic.ts +1 -8
- package/src/memory/shared-app-links-store.ts +0 -15
- package/src/messaging/registry.ts +0 -5
- package/src/messaging/style-analyzer.ts +1 -1
- package/src/notifications/copy-composer.ts +5 -13
- package/src/notifications/decision-engine.ts +2 -2
- package/src/notifications/deliveries-store.ts +0 -39
- package/src/notifications/guardian-question-mode.ts +6 -10
- package/src/notifications/preference-extractor.ts +1 -1
- package/src/oauth/byo-connection.test.ts +29 -20
- package/src/oauth/provider-behaviors.ts +1 -1
- package/src/permissions/checker.ts +1 -1
- package/src/permissions/shell-identity.ts +0 -5
- package/src/permissions/trust-store.ts +0 -37
- package/src/prompts/system-prompt.ts +3 -3
- package/src/providers/managed-proxy/constants.ts +8 -10
- package/src/providers/managed-proxy/context.ts +14 -9
- package/src/providers/provider-send-message.ts +4 -52
- package/src/providers/registry.ts +16 -50
- package/src/runtime/actor-token-store.ts +0 -23
- package/src/runtime/http-router.ts +5 -1
- package/src/runtime/http-server.ts +101 -4
- package/src/runtime/invite-instruction-generator.ts +25 -51
- package/src/runtime/invite-service.ts +0 -20
- package/src/runtime/routes/attachment-routes.ts +1 -1
- package/src/runtime/routes/brain-graph-routes.ts +1 -1
- package/src/runtime/routes/call-routes.ts +1 -1
- package/src/runtime/routes/conversation-routes.ts +32 -11
- package/src/runtime/routes/debug-routes.ts +1 -1
- package/src/runtime/routes/diagnostics-routes.ts +2 -2
- package/src/runtime/routes/documents-routes.ts +3 -3
- package/src/runtime/routes/global-search-routes.ts +1 -1
- package/src/runtime/routes/guardian-bootstrap-routes.ts +0 -20
- package/src/runtime/routes/guardian-refresh-routes.ts +0 -20
- package/src/runtime/routes/secret-routes.ts +4 -4
- package/src/runtime/routes/trust-rules-routes.ts +1 -1
- package/src/security/credential-backend.ts +148 -0
- package/src/security/oauth2.ts +1 -1
- package/src/security/secret-allowlist.ts +1 -1
- package/src/security/secure-keys.ts +98 -160
- package/src/security/token-manager.ts +0 -7
- package/src/sequence/guardrails.ts +0 -4
- package/src/sequence/store.ts +1 -20
- package/src/sequence/types.ts +1 -36
- package/src/signals/cancel.ts +69 -0
- package/src/signals/conversation-undo.ts +127 -0
- package/src/signals/trust-rule.ts +174 -0
- package/src/skills/clawhub.ts +5 -5
- package/src/skills/managed-store.ts +4 -4
- package/src/telemetry/usage-telemetry-reporter.test.ts +366 -0
- package/src/telemetry/usage-telemetry-reporter.ts +181 -0
- package/src/tools/claude-code/claude-code.ts +2 -2
- package/src/tools/credentials/vault.ts +8 -4
- package/src/tools/memory/handlers.test.ts +24 -26
- package/src/tools/memory/handlers.ts +1 -13
- package/src/tools/registry.ts +5 -100
- package/src/tools/terminal/parser.ts +34 -4
- package/src/tools/tool-manifest.ts +0 -10
- package/src/usage/actors.ts +0 -12
- package/src/util/canonicalize-identity.ts +0 -9
- package/src/util/errors.ts +0 -3
- package/src/util/platform.ts +24 -7
- package/src/util/pricing.ts +0 -38
- package/src/watcher/constants.ts +0 -7
- package/src/watcher/providers/linear.ts +1 -1
- package/src/work-items/work-item-store.ts +4 -4
- package/src/workspace/commit-message-provider.ts +1 -1
- package/src/workspace/git-service.ts +44 -1
- package/src/workspace/provider-commit-message-generator.ts +1 -1
- package/src/__tests__/fixtures/proxy-fixtures.ts +0 -147
- package/src/browser-extension-relay/client.ts +0 -155
- package/src/contacts/index.ts +0 -18
- package/src/daemon/tls-certs.ts +0 -270
- package/src/errors.ts +0 -41
- package/src/events/index.ts +0 -18
- package/src/followups/index.ts +0 -10
- package/src/playbooks/index.ts +0 -10
- package/src/runtime/auth/index.ts +0 -44
- package/src/tasks/candidate-store.ts +0 -95
- package/src/tools/browser/api-map.ts +0 -313
- package/src/tools/browser/auto-navigate.ts +0 -469
- package/src/tools/browser/headless-browser.ts +0 -590
- package/src/tools/browser/recording-store.ts +0 -75
- package/src/tools/computer-use/registry.ts +0 -21
- package/src/tools/tasks/index.ts +0 -27
|
@@ -2,8 +2,6 @@ import { afterAll, beforeEach, describe, expect, test } from "bun:test";
|
|
|
2
2
|
|
|
3
3
|
import { RiskLevel } from "../permissions/types.js";
|
|
4
4
|
import type { ToolDefinition } from "../providers/types.js";
|
|
5
|
-
// We cannot import the private LazyTool class directly, so we test through
|
|
6
|
-
// registerLazyTool + getTool which exercise the same code path.
|
|
7
5
|
import {
|
|
8
6
|
__clearRegistryForTesting,
|
|
9
7
|
__resetRegistryForTesting,
|
|
@@ -13,16 +11,11 @@ import {
|
|
|
13
11
|
getSkillToolNames,
|
|
14
12
|
getTool,
|
|
15
13
|
initializeTools,
|
|
16
|
-
registerLazyTool,
|
|
17
14
|
registerSkillTools,
|
|
18
15
|
registerTool,
|
|
19
16
|
unregisterSkillTools,
|
|
20
17
|
} from "../tools/registry.js";
|
|
21
|
-
import {
|
|
22
|
-
eagerModuleToolNames,
|
|
23
|
-
explicitTools,
|
|
24
|
-
lazyTools,
|
|
25
|
-
} from "../tools/tool-manifest.js";
|
|
18
|
+
import { eagerModuleToolNames, explicitTools } from "../tools/tool-manifest.js";
|
|
26
19
|
import type { Tool, ToolContext, ToolExecutionResult } from "../tools/types.js";
|
|
27
20
|
|
|
28
21
|
// Clean up global registry after this file completes to prevent
|
|
@@ -61,48 +54,6 @@ function makeSkillTool(name: string, ownerSkillId: string): Tool {
|
|
|
61
54
|
};
|
|
62
55
|
}
|
|
63
56
|
|
|
64
|
-
describe("LazyTool", () => {
|
|
65
|
-
test("clears cached promise on load failure so subsequent call can retry", async () => {
|
|
66
|
-
let callCount = 0;
|
|
67
|
-
|
|
68
|
-
registerLazyTool({
|
|
69
|
-
name: "test-retry-tool",
|
|
70
|
-
description: "A tool that fails on first load then succeeds",
|
|
71
|
-
category: "test",
|
|
72
|
-
defaultRiskLevel: RiskLevel.Low,
|
|
73
|
-
definition: {
|
|
74
|
-
name: "test-retry-tool",
|
|
75
|
-
description: "A tool that fails on first load then succeeds",
|
|
76
|
-
input_schema: { type: "object", properties: {}, required: [] },
|
|
77
|
-
},
|
|
78
|
-
loader: async () => {
|
|
79
|
-
callCount++;
|
|
80
|
-
if (callCount === 1) {
|
|
81
|
-
throw new Error("transient load failure");
|
|
82
|
-
}
|
|
83
|
-
return makeFakeTool("test-retry-tool");
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const tool = getTool("test-retry-tool")!;
|
|
88
|
-
expect(tool).toBeDefined();
|
|
89
|
-
|
|
90
|
-
const dummyContext = {} as ToolContext;
|
|
91
|
-
|
|
92
|
-
// First call should throw the transient error
|
|
93
|
-
await expect(tool.execute({}, dummyContext)).rejects.toThrow(
|
|
94
|
-
"transient load failure",
|
|
95
|
-
);
|
|
96
|
-
expect(callCount).toBe(1);
|
|
97
|
-
|
|
98
|
-
// Second call should retry the loader and succeed
|
|
99
|
-
const result = await tool.execute({}, dummyContext);
|
|
100
|
-
expect(result.content).toBe("ok");
|
|
101
|
-
expect(result.isError).toBe(false);
|
|
102
|
-
expect(callCount).toBe(2);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
|
|
106
57
|
describe("tool registry host tools", () => {
|
|
107
58
|
test("registers host tools and exposes them in tool definitions", async () => {
|
|
108
59
|
await initializeTools();
|
|
@@ -157,29 +108,6 @@ describe("tool registry dynamic-tools tools", () => {
|
|
|
157
108
|
});
|
|
158
109
|
|
|
159
110
|
describe("tool manifest", () => {
|
|
160
|
-
test("all manifest lazy tools are registered after init", async () => {
|
|
161
|
-
await initializeTools();
|
|
162
|
-
const registered = new Set(getAllTools().map((t) => t.name));
|
|
163
|
-
|
|
164
|
-
for (const descriptor of lazyTools) {
|
|
165
|
-
expect(registered.has(descriptor.name)).toBe(true);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
test("manifest declares expected core lazy tools", () => {
|
|
170
|
-
// bash moved from lazy to eager registration
|
|
171
|
-
// swarm_delegate moved to the orchestration bundled skill
|
|
172
|
-
const lazyNames = new Set(lazyTools.map((t) => t.name));
|
|
173
|
-
expect(lazyNames.has("bash")).toBe(false);
|
|
174
|
-
expect(lazyNames.has("evaluate_typescript_code")).toBe(false);
|
|
175
|
-
expect(lazyNames.has("claude_code")).toBe(false);
|
|
176
|
-
expect(lazyNames.has("swarm_delegate")).toBe(false);
|
|
177
|
-
// bash is in eager tools; swarm_delegate is now a bundled skill tool
|
|
178
|
-
expect(eagerModuleToolNames).toContain("bash");
|
|
179
|
-
expect(eagerModuleToolNames).not.toContain("swarm_delegate");
|
|
180
|
-
expect(eagerModuleToolNames).not.toContain("version");
|
|
181
|
-
});
|
|
182
|
-
|
|
183
111
|
test("eager module tool names list contains expected count", () => {
|
|
184
112
|
expect(eagerModuleToolNames.length).toBe(11);
|
|
185
113
|
});
|
|
@@ -193,12 +121,10 @@ describe("tool manifest", () => {
|
|
|
193
121
|
expect(names).not.toContain("start_screen_watch");
|
|
194
122
|
});
|
|
195
123
|
|
|
196
|
-
test("registered tool count is at least eager +
|
|
124
|
+
test("registered tool count is at least eager + host", async () => {
|
|
197
125
|
await initializeTools();
|
|
198
126
|
const tools = getAllTools();
|
|
199
|
-
expect(tools.length).toBeGreaterThanOrEqual(
|
|
200
|
-
eagerModuleToolNames.length + lazyTools.length,
|
|
201
|
-
);
|
|
127
|
+
expect(tools.length).toBeGreaterThanOrEqual(eagerModuleToolNames.length);
|
|
202
128
|
});
|
|
203
129
|
});
|
|
204
130
|
|
|
@@ -253,11 +179,6 @@ describe("baseline characterization: hardcoded tool loading", () => {
|
|
|
253
179
|
const tool = getTool("claude_code");
|
|
254
180
|
expect(tool).toBeUndefined();
|
|
255
181
|
});
|
|
256
|
-
|
|
257
|
-
test("claude_code is NOT in lazyTools manifest", () => {
|
|
258
|
-
const lazyNames = lazyTools.map((t) => t.name);
|
|
259
|
-
expect(lazyNames).not.toContain("claude_code");
|
|
260
|
-
});
|
|
261
182
|
});
|
|
262
183
|
|
|
263
184
|
describe("baseline characterization: core app tool surface", () => {
|
|
@@ -505,24 +426,3 @@ describe("skill tool reference counting", () => {
|
|
|
505
426
|
expect(getSkillRefCount("nonexistent-skill")).toBe(0);
|
|
506
427
|
});
|
|
507
428
|
});
|
|
508
|
-
|
|
509
|
-
describe("computer-use registration split", () => {
|
|
510
|
-
// Start each test from a completely empty registry so assertions are
|
|
511
|
-
// non-vacuous — the split functions must actually register tools.
|
|
512
|
-
|
|
513
|
-
test("registerComputerUseActionTools registers all 11 CU action tools and nothing else", async () => {
|
|
514
|
-
const { registerComputerUseActionTools } =
|
|
515
|
-
await import("../tools/computer-use/registry.js");
|
|
516
|
-
|
|
517
|
-
__clearRegistryForTesting();
|
|
518
|
-
expect(getAllTools()).toHaveLength(0);
|
|
519
|
-
|
|
520
|
-
registerComputerUseActionTools();
|
|
521
|
-
|
|
522
|
-
const registered = getAllTools();
|
|
523
|
-
expect(registered).toHaveLength(11);
|
|
524
|
-
expect(registered.every((t) => t.name.startsWith("computer_use_"))).toBe(
|
|
525
|
-
true,
|
|
526
|
-
);
|
|
527
|
-
});
|
|
528
|
-
});
|
|
@@ -27,21 +27,16 @@ mock.module("../tools/credentials/metadata-store.js", () => ({
|
|
|
27
27
|
listCredentialMetadata: () => credentialMetadataList,
|
|
28
28
|
}));
|
|
29
29
|
|
|
30
|
-
// Track
|
|
30
|
+
// Track getSecureKeyAsync return values per storage key
|
|
31
31
|
let secureKeyValues = new Map<string, string | undefined>();
|
|
32
32
|
|
|
33
33
|
mock.module("../security/secure-keys.js", () => ({
|
|
34
|
-
getSecureKey: (account: string) => secureKeyValues.get(account),
|
|
35
34
|
getSecureKeyAsync: (account: string) =>
|
|
36
35
|
Promise.resolve(secureKeyValues.get(account)),
|
|
37
|
-
setSecureKey: () => true,
|
|
38
36
|
setSecureKeyAsync: () => Promise.resolve(true),
|
|
39
|
-
deleteSecureKey: () => "deleted",
|
|
40
37
|
deleteSecureKeyAsync: () => Promise.resolve("deleted"),
|
|
41
|
-
|
|
42
|
-
getBackendType: () => "encrypted",
|
|
38
|
+
listSecureKeysAsync: async () => [],
|
|
43
39
|
_resetBackend: () => {},
|
|
44
|
-
_setBackend: () => {},
|
|
45
40
|
}));
|
|
46
41
|
|
|
47
42
|
// Stub ensureLocalCA / certs so tests never run openssl
|
|
@@ -42,16 +42,11 @@ mock.module("../security/secure-keys.js", () => {
|
|
|
42
42
|
return "not-found" as const;
|
|
43
43
|
};
|
|
44
44
|
return {
|
|
45
|
-
getSecureKey: (key: string) => storedKeys.get(key) ?? null,
|
|
46
45
|
getSecureKeyAsync: async (key: string) => storedKeys.get(key) ?? undefined,
|
|
47
|
-
setSecureKey: syncSet,
|
|
48
46
|
setSecureKeyAsync: async (key: string, value: string) =>
|
|
49
47
|
syncSet(key, value),
|
|
50
|
-
deleteSecureKey: syncDelete,
|
|
51
48
|
deleteSecureKeyAsync: async (key: string) => syncDelete(key),
|
|
52
|
-
|
|
53
|
-
getBackendType: () => "encrypted",
|
|
54
|
-
isDowngradedFromKeychain: () => false,
|
|
49
|
+
listSecureKeysAsync: async () => [],
|
|
55
50
|
};
|
|
56
51
|
});
|
|
57
52
|
|
|
@@ -9,13 +9,7 @@ const metadataDeletes: Array<{ service: string; field: string }> = [];
|
|
|
9
9
|
|
|
10
10
|
const PLATFORM_BASE_URL = "https://platform.example.com";
|
|
11
11
|
const ASSISTANT_API_KEY_PATH = credentialKey("vellum", "assistant_api_key");
|
|
12
|
-
const MANAGED_PROVIDERS = [
|
|
13
|
-
"anthropic",
|
|
14
|
-
"openai",
|
|
15
|
-
"gemini",
|
|
16
|
-
"fireworks",
|
|
17
|
-
"openrouter",
|
|
18
|
-
] as const;
|
|
12
|
+
const MANAGED_PROVIDERS = ["anthropic", "gemini"] as const;
|
|
19
13
|
|
|
20
14
|
const mockConfig = {
|
|
21
15
|
provider: "anthropic",
|
|
@@ -66,7 +60,6 @@ mock.module("../logfire.js", () => ({
|
|
|
66
60
|
}));
|
|
67
61
|
|
|
68
62
|
mock.module("../security/secure-keys.js", () => ({
|
|
69
|
-
getSecureKey: (key: string) => secureKeyStore[key],
|
|
70
63
|
getSecureKeyAsync: async (key: string) => secureKeyStore[key],
|
|
71
64
|
setSecureKeyAsync: async (key: string, value: string) => {
|
|
72
65
|
secureKeyStore[key] = value;
|
|
@@ -129,15 +122,15 @@ function makeDeleteCredentialRequest(name: string): Request {
|
|
|
129
122
|
}
|
|
130
123
|
|
|
131
124
|
describe("secret routes managed proxy registry sync", () => {
|
|
132
|
-
beforeEach(() => {
|
|
125
|
+
beforeEach(async () => {
|
|
133
126
|
secureKeyStore = {};
|
|
134
127
|
metadataUpserts.length = 0;
|
|
135
128
|
metadataDeletes.length = 0;
|
|
136
129
|
lastGeminiConstructorOpts = null;
|
|
137
|
-
initializeProviders(mockConfig);
|
|
130
|
+
await initializeProviders(mockConfig);
|
|
138
131
|
});
|
|
139
132
|
|
|
140
|
-
test("adding vellum:assistant_api_key bootstraps managed providers immediately", async () => {
|
|
133
|
+
test("adding vellum:assistant_api_key bootstraps managed fallback providers immediately", async () => {
|
|
141
134
|
expect(listProviders()).toEqual([]);
|
|
142
135
|
|
|
143
136
|
const res = await handleAddSecret(
|
|
@@ -159,9 +152,9 @@ describe("secret routes managed proxy registry sync", () => {
|
|
|
159
152
|
expect(lastGeminiConstructorOpts).toBeDefined();
|
|
160
153
|
});
|
|
161
154
|
|
|
162
|
-
test("deleting vellum:assistant_api_key clears managed providers immediately", async () => {
|
|
155
|
+
test("deleting vellum:assistant_api_key clears managed fallback providers immediately", async () => {
|
|
163
156
|
secureKeyStore[ASSISTANT_API_KEY_PATH] = "ast-managed-key";
|
|
164
|
-
initializeProviders(mockConfig);
|
|
157
|
+
await initializeProviders(mockConfig);
|
|
165
158
|
|
|
166
159
|
for (const provider of MANAGED_PROVIDERS) {
|
|
167
160
|
expect(listProviders()).toContain(provider);
|