@vellumai/assistant 0.12.5 → 0.12.6-dev.202609292019.a6f6d85
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/.env.example +2 -0
- package/ARCHITECTURE.md +23 -0
- package/docs/automatic-done.md +32 -0
- package/docs/desktop-browser-cli.md +3 -2
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +53 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +60 -0
- package/node_modules/@vellumai/environments/src/shell.test.ts +13 -1
- package/node_modules/@vellumai/environments/src/shell.ts +22 -1
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +53 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +60 -0
- package/node_modules/@vellumai/gateway-client/src/__tests__/status-contracts.test.ts +39 -0
- package/node_modules/@vellumai/gateway-client/src/gateway-ipc-contracts.ts +25 -0
- package/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +53 -0
- package/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +60 -0
- package/openapi.yaml +270 -10
- package/package.json +1 -1
- package/src/__tests__/agent-loop.test.ts +76 -0
- package/src/__tests__/anthropic-provider.test.ts +2 -0
- package/src/__tests__/byok-default-profile-ensure.test.ts +7 -0
- package/src/__tests__/config-get-vision-flag.test.ts +1 -1
- package/src/__tests__/config-loader-validation-reset-notice.test.ts +2 -2
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +160 -154
- package/src/__tests__/conversation-evictor.test.ts +54 -0
- package/src/__tests__/conversation-pairing.test.ts +112 -0
- package/src/__tests__/document-append-idempotency.test.ts +13 -0
- package/src/__tests__/document-create-dedupe.test.ts +13 -0
- package/src/__tests__/document-find-replace.test.ts +13 -0
- package/src/__tests__/document-revision-history.test.ts +390 -0
- package/src/__tests__/document-revision.test.ts +425 -0
- package/src/__tests__/document-tool-security.test.ts +13 -0
- package/src/__tests__/document-update-default-surface.test.ts +13 -0
- package/src/__tests__/emit-signal-routing-intent.test.ts +270 -0
- package/src/__tests__/gateway-flag-listener.test.ts +59 -6
- package/src/__tests__/headless-browser-navigate.test.ts +20 -30
- package/src/__tests__/host-cu-proxy.test.ts +79 -0
- package/src/__tests__/host-cu-routes-targeted.test.ts +14 -5
- package/src/__tests__/host-shell-tool.test.ts +6 -2
- package/src/__tests__/identity-routes.test.ts +4 -3
- package/src/__tests__/llm-catalog-parity.test.ts +4 -4
- package/src/__tests__/llm-schema.test.ts +1 -1
- package/src/__tests__/notification-platform-adapter.test.ts +83 -1
- package/src/__tests__/oauth2-gateway-transport.test.ts +2 -0
- package/src/__tests__/openai-provider.test.ts +11 -11
- package/src/__tests__/pricing.test.ts +11 -0
- package/src/__tests__/public-ingress-urls.test.ts +26 -0
- package/src/__tests__/retry-thinking-tool-choice.test.ts +47 -0
- package/src/__tests__/usage-attribution.test.ts +31 -0
- package/src/__tests__/workspace-migration-133-collapse-provider-connections.test.ts +3 -3
- package/src/__tests__/workspace-migration-160-repair-retired-fireworks-model-ids.test.ts +262 -0
- package/src/__tests__/workspace-migration-161-repair-retired-fireworks-glm-5p2-model-id.test.ts +233 -0
- package/src/acp/agent-process.ts +6 -1
- package/src/acp/client-handler.ts +6 -1
- package/src/agent/loop.ts +29 -6
- package/src/api/events/document-editor-show.ts +5 -0
- package/src/api/events/document-editor-update.ts +10 -0
- package/src/api/events/tool-result.ts +1 -0
- package/src/calls/__tests__/voice-session-bridge.test.ts +54 -0
- package/src/calls/channel-admission-reader.ts +15 -9
- package/src/calls/twilio-provider.ts +14 -31
- package/src/calls/voice-session-bridge.ts +18 -1
- package/src/cli/commands/browser.ts +1 -2
- package/src/cli/lib/__tests__/plugin-artifact.test.ts +23 -0
- package/src/cli/lib/__tests__/plugin-catalog-visibility.test.ts +2 -0
- package/src/cli/lib/__tests__/plugin-details.test.ts +16 -0
- package/src/cli/lib/bundled-marketplace.json +41 -2
- package/src/cli/lib/inspect-plugin.ts +15 -15
- package/src/cli/lib/list-installed-plugins.ts +29 -28
- package/src/cli/lib/plugin-artifact.ts +74 -63
- package/src/cli/lib/plugin-catalog-visibility.ts +1 -0
- package/src/cli/lib/plugin-details.ts +27 -42
- package/src/cli/lib/plugin-marketplace.ts +6 -8
- package/src/cli/lib/plugin-surfaces.ts +8 -7
- package/src/cli.ts +1 -3
- package/src/config/__tests__/chat-settings.test.ts +121 -0
- package/src/config/assistant-feature-flags.ts +28 -23
- package/src/config/bundled-skills/computer-use/SKILL.md +20 -0
- package/src/config/bundled-skills/computer-use/TOOLS.json +11 -11
- package/src/config/chat-settings.ts +100 -0
- package/src/config/default-profile-catalog.ts +1 -1
- package/src/config/feature-flag-cache.ts +7 -25
- package/src/config/feature-flag-registry.json +1 -9
- package/src/config/loader.ts +5 -1
- package/src/config/profile-text-generation.ts +25 -21
- package/src/config/schemas/conversations.ts +14 -0
- package/src/config/schemas/llm.ts +1 -0
- package/src/config/schemas/notifications.ts +8 -1
- package/src/contacts/gateway-channel-read.ts +1 -1
- package/src/conversations/__tests__/auto-archive-activity.test.ts +136 -0
- package/src/conversations/__tests__/auto-archive.test.ts +304 -0
- package/src/conversations/auto-archive-activity.ts +61 -0
- package/src/conversations/auto-archive.ts +201 -0
- package/src/daemon/computer-use-observation.test.ts +81 -0
- package/src/daemon/computer-use-observation.ts +23 -0
- package/src/daemon/conversation-agent-loop.ts +11 -6
- package/src/daemon/conversation-evictor.ts +50 -16
- package/src/daemon/doordash-steps.ts +1 -3
- package/src/daemon/handlers/__tests__/config-a2a-accept.test.ts +43 -1
- package/src/daemon/handlers/__tests__/config-channels.test.ts +1 -1
- package/src/daemon/handlers/config-a2a.ts +75 -2
- package/src/daemon/host-cu-proxy.ts +34 -3
- package/src/daemon/lifecycle.ts +15 -2
- package/src/daemon/shutdown-handlers.ts +3 -0
- package/src/daemon/turn-finalization.ts +4 -0
- package/src/desktop/desktop-browser-endpoint.ts +11 -2
- package/src/desktop/desktop-chrome-policy.test.ts +1 -0
- package/src/desktop/desktop-chrome-policy.ts +7 -1
- package/src/desktop/desktop-computer-use.test.ts +14 -4
- package/src/desktop/desktop-session-manager.ts +5 -3
- package/src/documents/document-revisions-store.ts +153 -0
- package/src/documents/document-store.ts +471 -133
- package/src/followups/followup-store.ts +0 -4
- package/src/inbound/__tests__/oauth-callback-url.test.ts +25 -2
- package/src/inbound/oauth-callback-url.ts +30 -1
- package/src/inbound/public-ingress-urls.ts +12 -2
- package/src/ipc/gateway-client.test.ts +40 -0
- package/src/ipc/gateway-client.ts +12 -29
- package/src/ipc/gateway-flag-listener.ts +7 -10
- package/src/live-voice/__tests__/live-voice-agent-turn.test.ts +71 -0
- package/src/live-voice/__tests__/live-voice-flux-turn-end.test.ts +83 -0
- package/src/live-voice/__tests__/protocol.test.ts +77 -0
- package/src/live-voice/__tests__/share-targets.test.ts +163 -0
- package/src/live-voice/live-voice-session.ts +23 -6
- package/src/live-voice/protocol.ts +22 -0
- package/src/live-voice/share-targets.ts +225 -0
- package/src/mcp/__tests__/mcp-oauth-client-registration.test.ts +144 -3
- package/src/mcp/__tests__/mcp-oauth-provider.test.ts +2 -0
- package/src/mcp/client.ts +1 -19
- package/src/mcp/mcp-oauth-provider.ts +66 -49
- package/src/media/openrouter-image-service.ts +39 -22
- package/src/monitoring/__tests__/oom-inheritance-sweep.test.ts +86 -0
- package/src/monitoring/__tests__/oom-kill-reporter.test.ts +374 -0
- package/src/monitoring/control.ts +2 -1
- package/src/monitoring/oom-inheritance-sweep.ts +96 -0
- package/src/monitoring/oom-kill-reporter.ts +469 -0
- package/src/monitoring/resource-sampler.ts +30 -0
- package/src/notifications/README.md +53 -4
- package/src/notifications/__tests__/assistant-initiated-thread.test.ts +254 -0
- package/src/notifications/__tests__/broadcaster.test.ts +558 -6
- package/src/notifications/__tests__/completion-policy.test.ts +37 -0
- package/src/notifications/__tests__/from-me-alert-integration.test.ts +192 -0
- package/src/notifications/adapters/platform.ts +14 -0
- package/src/notifications/assistant-initiated-thread.ts +101 -0
- package/src/notifications/broadcaster.ts +94 -16
- package/src/notifications/chat-reply-policy.ts +11 -0
- package/src/notifications/completion-policy.ts +12 -2
- package/src/notifications/conversation-pairing.ts +15 -70
- package/src/notifications/emit-signal.ts +34 -3
- package/src/notifications/types.ts +2 -0
- package/src/oauth/connect-orchestrator.ts +1 -2
- package/src/persistence/__tests__/conversation-auto-archive.test.ts +330 -0
- package/src/persistence/conversation-auto-archive.ts +170 -0
- package/src/persistence/conversation-crud.ts +2 -1
- package/src/persistence/conversation-queries.ts +15 -8
- package/src/persistence/embeddings/embed.test.ts +96 -0
- package/src/persistence/embeddings/embed.ts +20 -2
- package/src/persistence/embeddings/embedding-gemini.test.ts +39 -3
- package/src/persistence/embeddings/embedding-gemini.ts +39 -1
- package/src/persistence/embeddings/embedding-local.ts +6 -0
- package/src/persistence/embeddings/qdrant-manager.ts +5 -0
- package/src/persistence/job-utils.ts +10 -0
- package/src/persistence/migrations/384-add-document-revision.test.ts +83 -0
- package/src/persistence/migrations/384-add-document-revision.ts +21 -0
- package/src/persistence/migrations/385-create-document-revisions.test.ts +67 -0
- package/src/persistence/migrations/385-create-document-revisions.ts +28 -0
- package/src/persistence/migrations/386-conversations-last-reopened-at.ts +10 -0
- package/src/persistence/migrations/__tests__/386-conversations-last-reopened-at.test.ts +32 -0
- package/src/persistence/schema/conversations.ts +1 -0
- package/src/persistence/schema/documents.ts +20 -0
- package/src/persistence/steps.ts +6 -0
- package/src/platform/managed-speech.ts +42 -46
- package/src/plugin-api/vision-support.test.ts +21 -21
- package/src/plugins/defaults/empty-response/hooks/post-model-call.ts +11 -6
- package/src/providers/__tests__/dispatch-connection-routing.test.ts +1 -1
- package/src/providers/__tests__/search-provider-catalog.test.ts +8 -0
- package/src/providers/anthropic/client.ts +1 -1
- package/src/providers/fireworks/client.test.ts +168 -0
- package/src/providers/fireworks/client.ts +24 -0
- package/src/providers/inference/adapter-factory.ts +6 -0
- package/src/providers/ionet/client.test.ts +143 -0
- package/src/providers/ionet/client.ts +37 -0
- package/src/providers/model-catalog.ts +141 -84
- package/src/providers/model-intents.ts +4 -4
- package/src/providers/openai/chat-completions-provider.ts +23 -1
- package/src/providers/retry.ts +56 -4
- package/src/providers/search-provider-catalog.ts +10 -0
- package/src/providers/types.ts +10 -2
- package/src/providers/usage-tracking.ts +5 -3
- package/src/runtime/assistant-event-hub.ts +23 -0
- package/src/runtime/auth/__tests__/guard-tests.test.ts +0 -7
- package/src/runtime/auth/__tests__/route-policy.test.ts +1 -1
- package/src/runtime/channel-retry-sweep.ts +1 -2
- package/src/runtime/migrations/__tests__/vbundle-streaming-validator.test.ts +35 -10
- package/src/runtime/migrations/__tests__/vbundle-validator-v1-schema.test.ts +48 -0
- package/src/runtime/migrations/vbundle-builder.ts +19 -3
- package/src/runtime/migrations/vbundle-streaming-importer.ts +14 -19
- package/src/runtime/migrations/vbundle-streaming-validator.ts +14 -7
- package/src/runtime/migrations/vbundle-validator.ts +54 -1
- package/src/runtime/pending-interactions.ts +20 -2
- package/src/runtime/routes/__tests__/contact-routes.test.ts +5 -3
- package/src/runtime/routes/__tests__/conversation-list-routes.test.ts +36 -0
- package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +375 -2
- package/src/runtime/routes/__tests__/inference-send-routes.test.ts +1 -1
- package/src/runtime/routes/__tests__/user-route-dispatcher.test.ts +12 -0
- package/src/runtime/routes/contact-routes.ts +2 -2
- package/src/runtime/routes/conversation-list-routes.ts +10 -2
- package/src/runtime/routes/conversation-query-routes.ts +48 -10
- package/src/runtime/routes/documents-routes.ts +185 -47
- package/src/runtime/routes/events-routes.ts +1 -3
- package/src/runtime/routes/host-app-control-routes.ts +1 -0
- package/src/runtime/routes/host-bash-routes.ts +1 -0
- package/src/runtime/routes/host-browser-routes.ts +15 -0
- package/src/runtime/routes/host-cu-routes.ts +4 -1
- package/src/runtime/routes/host-file-routes.ts +1 -0
- package/src/runtime/routes/host-proxy-result-binding.test.ts +83 -0
- package/src/runtime/routes/host-proxy-result-binding.ts +25 -0
- package/src/runtime/routes/host-transfer-routes.ts +1 -0
- package/src/runtime/routes/identity-routes.ts +3 -3
- package/src/runtime/routes/integrations/a2a.ts +4 -1
- package/src/runtime/routes/migration-routes.ts +3 -1
- package/src/runtime/routes/notification-routes.ts +1 -2
- package/src/runtime/routes/ui-snapshot-routes.test.ts +1 -0
- package/src/runtime/routes/user-route-dispatcher.ts +5 -1
- package/src/runtime/verification-templates.ts +1 -2
- package/src/sequence/analytics.ts +0 -4
- package/src/sequence/engine.ts +1 -11
- package/src/sequence/guardrails.ts +1 -6
- package/src/sequence/importer.ts +0 -8
- package/src/sequence/store.ts +0 -10
- package/src/signals/user-message.ts +0 -6
- package/src/skills/catalog-install.ts +52 -23
- package/src/tools/browser/browser-execution.ts +20 -23
- package/src/tools/browser/cdp-client/cdp-inspect/ws-transport.ts +1 -3
- package/src/tools/document/document-tool.ts +13 -11
- package/src/tools/executor.ts +1 -2
- package/src/tools/host-terminal/host-shell.ts +4 -2
- package/src/tools/network/__tests__/web-search.test.ts +105 -0
- package/src/tools/network/web-fetch.ts +2 -4
- package/src/tools/network/web-search.ts +239 -12
- package/src/tools/shared/filesystem/format-diff.ts +1 -2
- package/src/tools/shared/shell-output.test.ts +42 -0
- package/src/tools/shared/shell-output.ts +27 -4
- package/src/tools/terminal/shell.ts +3 -3
- package/src/tools/ui-surface/visual-validation.ts +1 -2
- package/src/usage/attribution.ts +18 -1
- package/src/util/__tests__/oom-priority.test.ts +55 -0
- package/src/util/__tests__/worker-memory.test.ts +16 -0
- package/src/util/debounce.ts +0 -4
- package/src/util/oom-priority.ts +79 -0
- package/src/util/platform.ts +0 -2
- package/src/util/plugin-manifest.ts +5 -7
- package/src/util/pricing.ts +25 -0
- package/src/util/worker-memory.ts +9 -3
- package/src/util/worker-process.ts +8 -0
- package/src/workspace/byok-default-profile-ensure.ts +11 -0
- package/src/workspace/hatched-date.ts +11 -4
- package/src/workspace/migrations/160-repair-retired-fireworks-model-ids.ts +209 -0
- package/src/workspace/migrations/161-repair-retired-fireworks-glm-5p2-model-id.ts +197 -0
- package/src/workspace/migrations/registry.ts +4 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { isPlainObject } from "../util/object.js";
|
|
6
|
+
import { AutoArchiveConfigSchema } from "./schemas/conversations.js";
|
|
7
|
+
import { NotificationsConfigSchema } from "./schemas/notifications.js";
|
|
8
|
+
|
|
9
|
+
const ChatSettingsConfigSchema = z.object({
|
|
10
|
+
conversations: z
|
|
11
|
+
.object({ autoArchive: AutoArchiveConfigSchema.optional() })
|
|
12
|
+
.optional(),
|
|
13
|
+
notifications: NotificationsConfigSchema.optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function readPath(value: unknown, path: readonly PropertyKey[]): unknown {
|
|
17
|
+
for (const key of path) {
|
|
18
|
+
if (!isPlainObject(value)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
value = Reflect.get(value, key);
|
|
22
|
+
}
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function validateChatSettingsWrite(
|
|
27
|
+
previous: Record<string, unknown>,
|
|
28
|
+
next: Record<string, unknown>,
|
|
29
|
+
): { success: true } | { success: false; error: z.ZodError } {
|
|
30
|
+
const result = ChatSettingsConfigSchema.safeParse(next);
|
|
31
|
+
if (result.success) {
|
|
32
|
+
return { success: true };
|
|
33
|
+
}
|
|
34
|
+
// Untouched legacy values must not block unrelated writes or partial repairs.
|
|
35
|
+
const issues = result.error.issues.filter(
|
|
36
|
+
(issue) =>
|
|
37
|
+
!isDeepStrictEqual(
|
|
38
|
+
readPath(previous, issue.path),
|
|
39
|
+
readPath(next, issue.path),
|
|
40
|
+
),
|
|
41
|
+
);
|
|
42
|
+
return issues.length > 0
|
|
43
|
+
? { success: false, error: new z.ZodError(issues) }
|
|
44
|
+
: { success: true };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const ChatSettingsPatchSchema = z.object({
|
|
48
|
+
conversations: z
|
|
49
|
+
.object({
|
|
50
|
+
autoArchive: z
|
|
51
|
+
.object({
|
|
52
|
+
enabled: AutoArchiveConfigSchema.shape.enabled
|
|
53
|
+
.unwrap()
|
|
54
|
+
.nullable()
|
|
55
|
+
.optional(),
|
|
56
|
+
afterDays: AutoArchiveConfigSchema.shape.afterDays
|
|
57
|
+
.unwrap()
|
|
58
|
+
.nullable()
|
|
59
|
+
.optional(),
|
|
60
|
+
})
|
|
61
|
+
.passthrough()
|
|
62
|
+
.nullable()
|
|
63
|
+
.optional(),
|
|
64
|
+
})
|
|
65
|
+
.passthrough()
|
|
66
|
+
.nullable()
|
|
67
|
+
.optional(),
|
|
68
|
+
notifications: z
|
|
69
|
+
.object({
|
|
70
|
+
newMessageEnabled: NotificationsConfigSchema.shape.newMessageEnabled
|
|
71
|
+
.unwrap()
|
|
72
|
+
.nullable()
|
|
73
|
+
.optional(),
|
|
74
|
+
})
|
|
75
|
+
.passthrough()
|
|
76
|
+
.nullable()
|
|
77
|
+
.optional(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export function scrubNulledChatSettings(
|
|
81
|
+
raw: Record<string, unknown>,
|
|
82
|
+
patch: Record<string, unknown>,
|
|
83
|
+
): void {
|
|
84
|
+
for (const path of [
|
|
85
|
+
["conversations"],
|
|
86
|
+
["notifications"],
|
|
87
|
+
["conversations", "autoArchive"],
|
|
88
|
+
["conversations", "autoArchive", "enabled"],
|
|
89
|
+
["conversations", "autoArchive", "afterDays"],
|
|
90
|
+
["notifications", "newMessageEnabled"],
|
|
91
|
+
]) {
|
|
92
|
+
if (readPath(patch, path) !== null) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const parent = readPath(raw, path.slice(0, -1));
|
|
96
|
+
if (isPlainObject(parent)) {
|
|
97
|
+
delete parent[path[path.length - 1]!];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -117,7 +117,7 @@ const VELLUM_PROFILE_IMPLS: ProfileImpls = {
|
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
119
|
"cost-optimized": {
|
|
120
|
-
model: "accounts/fireworks/models/deepseek-
|
|
120
|
+
model: "accounts/fireworks/models/deepseek-v4p1-flash",
|
|
121
121
|
provider: "vellum",
|
|
122
122
|
source: "managed",
|
|
123
123
|
label: "Budget",
|
|
@@ -1,31 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Cache for resolved feature-flag overrides.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* pulls `util/logger.js` (pino) and the gateway IPC client. Stdlib-only
|
|
8
|
-
* by design: this file must remain safe to import from the test
|
|
9
|
-
* preload's load-time chain, where a broken `node_modules` symlink has
|
|
10
|
-
* historically tripped the env override (see DB ghost #3,
|
|
11
|
-
* /workspace/journal/2026-05-25-db-ghost-3-recovery.md).
|
|
4
|
+
* State lives on `globalThis.vellumAssistant.featureFlagCache` so test
|
|
5
|
+
* infrastructure can seed it through the ambient namespace without importing
|
|
6
|
+
* production modules into the preload-time graph.
|
|
12
7
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* type (declared in `src/vellum-assistant-namespace.d.ts`), which types the
|
|
17
|
-
* slot without adding a runtime import between them. See
|
|
18
|
-
* `__tests__/feature-flag-test-helpers.ts` for the test-side writer.
|
|
19
|
-
*
|
|
20
|
-
* Both `overrides` and `fromGateway` were previously module-level `let`
|
|
21
|
-
* bindings inside `assistant-feature-flags.ts`. The semantics are
|
|
22
|
-
* preserved exactly: `overrides === null` means "no fetch has populated
|
|
23
|
-
* the cache yet"; `fromGateway === true` means "the cache is
|
|
24
|
-
* authoritative — `initFeatureFlagOverrides()` should not clobber it".
|
|
25
|
-
*
|
|
26
|
-
* Consumers:
|
|
27
|
-
* - `assistant-feature-flags.ts` (resolver — reads/writes via gateway fetch)
|
|
28
|
-
* - `__tests__/feature-flag-test-helpers.ts` (seeds for tests, via globalThis)
|
|
8
|
+
* `overrides === null` means no fetch has populated the cache.
|
|
9
|
+
* `fromGateway === true` prevents initialization from replacing an
|
|
10
|
+
* authoritative fetched or test-seeded value.
|
|
29
11
|
*/
|
|
30
12
|
|
|
31
13
|
function slot(): VellumFeatureFlagCache {
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
"scope": "assistant",
|
|
344
344
|
"key": "mcp-catalog-qa-integrations",
|
|
345
345
|
"label": "MCP Catalog QA Integrations",
|
|
346
|
-
"description": "Show Gamma, Guru, Intercom, Ramp, Semrush, and
|
|
346
|
+
"description": "Show Gamma, Guru, Intercom, Ramp, Semrush, Typeform, and Upwork in the installable plugin catalog while their OAuth flows are validated. When off, catalog search, detail, and install-by-name cannot resolve them. Existing installed connections remain available.",
|
|
347
347
|
"defaultEnabled": false
|
|
348
348
|
},
|
|
349
349
|
{
|
|
@@ -560,14 +560,6 @@
|
|
|
560
560
|
"description": "Streams an interactive virtual desktop from a platform-hosted, containerized assistant over /v1/desktop/stream. Requires platform hosting; self-hosted assistants are excluded. Off: the virtual desktop is hidden. On: the chat header offers its viewer and controls.",
|
|
561
561
|
"defaultEnabled": false
|
|
562
562
|
},
|
|
563
|
-
{
|
|
564
|
-
"id": "assistant-inbox",
|
|
565
|
-
"scope": "client",
|
|
566
|
-
"key": "assistant-inbox",
|
|
567
|
-
"label": "Assistant Inbox",
|
|
568
|
-
"description": "Shows an Assistant Inbox entry above Preferences in the web sidebar and the /assistant/inbox page it opens: a mailbox for the assistant's managed vellum.me address (received and sent, with a reading pane), the inline email setup card for entitled orgs with no address yet, and an upgrade card for orgs without the managed_email entitlement. With it on, email setup happens only there: the billing wizard hands off to the inbox instead of its own domain step, the billing page's finish-setup nudge gives way to the inbox's rail entry, and the Channels page's Email section points there instead of registering an address itself. Off hides the entry, redirects the route to chat, and keeps the older setup surfaces.",
|
|
569
|
-
"defaultEnabled": false
|
|
570
|
-
},
|
|
571
563
|
{
|
|
572
564
|
"id": "sidebar-done",
|
|
573
565
|
"scope": "both",
|
package/src/config/loader.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
getConfigValidationResetNoticePath,
|
|
18
18
|
getWorkspaceConfigPath,
|
|
19
19
|
} from "../util/platform.js";
|
|
20
|
+
import { validateChatSettingsWrite } from "./chat-settings.js";
|
|
20
21
|
import { pruneSeededCallsiteDefaultsFromConfig } from "./prune-seeded-callsite-defaults.js";
|
|
21
22
|
import { AssistantConfigSchema } from "./schema.js";
|
|
22
23
|
import type { AssistantConfig } from "./types.js";
|
|
@@ -1364,7 +1365,10 @@ function describeJsonShape(value: unknown): string {
|
|
|
1364
1365
|
}
|
|
1365
1366
|
|
|
1366
1367
|
export function saveRawConfig(config: Record<string, unknown>): void {
|
|
1367
|
-
|
|
1368
|
+
const chatSettings = validateChatSettingsWrite(loadRawConfig(), config);
|
|
1369
|
+
if (!chatSettings.success) {
|
|
1370
|
+
throw chatSettings.error;
|
|
1371
|
+
}
|
|
1368
1372
|
const configPath = getWorkspaceConfigPath();
|
|
1369
1373
|
|
|
1370
1374
|
// Strip legacy apiKeys — provider keys belong in secure storage, not plaintext config
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
1
3
|
import { catalogModelSupportsText } from "../providers/model-catalog.js";
|
|
2
4
|
|
|
5
|
+
const ProfileReferenceSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
profile: z.string().optional().catch(undefined),
|
|
8
|
+
})
|
|
9
|
+
.optional()
|
|
10
|
+
.catch(undefined);
|
|
11
|
+
const TextGenerationProfileSchema = z.object({
|
|
12
|
+
provider: z.string().optional().catch(undefined),
|
|
13
|
+
model: z.string().optional().catch(undefined),
|
|
14
|
+
mix: z.array(ProfileReferenceSchema).optional().catch(undefined),
|
|
15
|
+
});
|
|
16
|
+
|
|
3
17
|
/**
|
|
4
18
|
* Whether a profile can back the conversation model (active profile or a
|
|
5
19
|
* per-conversation pin). Mix arms are judged individually: a mix that can
|
|
@@ -16,34 +30,24 @@ export function profileSupportsTextGeneration(
|
|
|
16
30
|
},
|
|
17
31
|
siblings: Record<string, unknown>,
|
|
18
32
|
): boolean {
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
typeof arm.profile === "string"
|
|
27
|
-
? arm.profile
|
|
28
|
-
: undefined;
|
|
33
|
+
const parsed = TextGenerationProfileSchema.safeParse(entry);
|
|
34
|
+
if (!parsed.success) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
if (parsed.data.mix && parsed.data.mix.length > 0) {
|
|
38
|
+
return parsed.data.mix.every((arm) => {
|
|
39
|
+
const name = arm?.profile;
|
|
29
40
|
if (name === undefined) {
|
|
30
41
|
return true;
|
|
31
42
|
}
|
|
32
|
-
const target = siblings[name];
|
|
33
|
-
if (target
|
|
43
|
+
const target = TextGenerationProfileSchema.safeParse(siblings[name]);
|
|
44
|
+
if (!target.success) {
|
|
34
45
|
return true;
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
return catalogModelSupportsText(
|
|
38
|
-
typeof nested.provider === "string" ? nested.provider : undefined,
|
|
39
|
-
typeof nested.model === "string" ? nested.model : undefined,
|
|
40
|
-
);
|
|
47
|
+
return catalogModelSupportsText(target.data.provider, target.data.model);
|
|
41
48
|
});
|
|
42
49
|
}
|
|
43
|
-
return catalogModelSupportsText(
|
|
44
|
-
typeof entry.provider === "string" ? entry.provider : undefined,
|
|
45
|
-
typeof entry.model === "string" ? entry.model : undefined,
|
|
46
|
-
);
|
|
50
|
+
return catalogModelSupportsText(parsed.data.provider, parsed.data.model);
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
export function nonTextConversationProfileMessage(profileName: string): string {
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
+
export const AutoArchiveConfigSchema = z.object({
|
|
4
|
+
enabled: z
|
|
5
|
+
.boolean()
|
|
6
|
+
.default(false)
|
|
7
|
+
.describe("Automatically mark eligible inactive chats Done."),
|
|
8
|
+
afterDays: z
|
|
9
|
+
.literal([1, 7, 14, 30])
|
|
10
|
+
.default(7)
|
|
11
|
+
.describe("Elapsed days of inactivity before a chat is eligible for Done."),
|
|
12
|
+
});
|
|
13
|
+
|
|
3
14
|
export const ConversationsConfigSchema = z
|
|
4
15
|
.object({
|
|
16
|
+
autoArchive: AutoArchiveConfigSchema.default(
|
|
17
|
+
AutoArchiveConfigSchema.parse({}),
|
|
18
|
+
),
|
|
5
19
|
skipAutoRetitling: z
|
|
6
20
|
.boolean({
|
|
7
21
|
error: "conversations.skipAutoRetitling must be a boolean",
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const NotificationsConfigSchema = z
|
|
4
|
-
.object({
|
|
4
|
+
.object({
|
|
5
|
+
newMessageEnabled: z
|
|
6
|
+
.boolean()
|
|
7
|
+
.default(true)
|
|
8
|
+
.describe(
|
|
9
|
+
"Allow ordinary chat-reply alerts. Does not change unread state or action-required alerts.",
|
|
10
|
+
),
|
|
11
|
+
})
|
|
5
12
|
.describe(
|
|
6
13
|
"Notification delivery configuration. Model selection lives under llm.callSites.notificationDecision and llm.callSites.preferenceExtraction.",
|
|
7
14
|
);
|
|
@@ -32,7 +32,7 @@ export async function gatewayContactChannelState(
|
|
|
32
32
|
);
|
|
33
33
|
return undefined;
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
35
|
+
if (result == null) {
|
|
36
36
|
return undefined;
|
|
37
37
|
}
|
|
38
38
|
const parsed = GetContactIpcResponseSchema.safeParse(result);
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { beforeEach, expect, mock, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
const resident = {
|
|
4
|
+
hasInFlightWork: mock(() => false),
|
|
5
|
+
inFlightSendRequestIds: new Set<string>(),
|
|
6
|
+
pendingStandaloneSurfaces: new Set<string>(),
|
|
7
|
+
};
|
|
8
|
+
let hasResident = false;
|
|
9
|
+
let pendingInput = false;
|
|
10
|
+
let pendingBackground = false;
|
|
11
|
+
let hasManager = false;
|
|
12
|
+
let states:
|
|
13
|
+
| Array<{ id: string; parentConversationId: string; status: string }>
|
|
14
|
+
| undefined = [];
|
|
15
|
+
let activeAndPendingIds: string[] = [];
|
|
16
|
+
mock.module("../../daemon/conversation-registry.js", () => ({
|
|
17
|
+
findConversation: () => (hasResident ? resident : undefined),
|
|
18
|
+
}));
|
|
19
|
+
mock.module("../../runtime/pending-interactions.js", () => ({
|
|
20
|
+
getByConversation: () => (pendingInput ? [{}] : []),
|
|
21
|
+
}));
|
|
22
|
+
mock.module("../../notifications/has-pending-background-work.js", () => ({
|
|
23
|
+
hasPendingBackgroundWork: () => pendingBackground,
|
|
24
|
+
}));
|
|
25
|
+
mock.module("../../acp/index.js", () => ({
|
|
26
|
+
peekAcpSessionManager: () =>
|
|
27
|
+
hasManager
|
|
28
|
+
? {
|
|
29
|
+
getStatus: () => states,
|
|
30
|
+
getActiveAndPendingIds: () => activeAndPendingIds,
|
|
31
|
+
}
|
|
32
|
+
: undefined,
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
import {
|
|
36
|
+
beginTurnFinalization,
|
|
37
|
+
resetTurnFinalizationsForTesting,
|
|
38
|
+
} from "../../daemon/turn-finalization.js";
|
|
39
|
+
import { getDb } from "../../persistence/db-connection.js";
|
|
40
|
+
import { initializeDb } from "../../persistence/db-init.js";
|
|
41
|
+
import { acpSessionHistory } from "../../persistence/schema/index.js";
|
|
42
|
+
import { hasAutoArchiveBlockingWork } from "../auto-archive-activity.js";
|
|
43
|
+
|
|
44
|
+
await initializeDb();
|
|
45
|
+
const ID = "conv-123";
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
hasResident = pendingInput = pendingBackground = hasManager = false;
|
|
48
|
+
resident.hasInFlightWork.mockReturnValue(false);
|
|
49
|
+
resident.inFlightSendRequestIds.clear();
|
|
50
|
+
resident.pendingStandaloneSurfaces.clear();
|
|
51
|
+
states = [];
|
|
52
|
+
activeAndPendingIds = [];
|
|
53
|
+
resetTurnFinalizationsForTesting();
|
|
54
|
+
getDb().delete(acpSessionHistory).run();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("inactive nonresident and idle resident chats have no runtime blockers", () => {
|
|
58
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(false);
|
|
59
|
+
hasResident = true;
|
|
60
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(false);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
for (const blocker of [
|
|
64
|
+
"in-flight",
|
|
65
|
+
"accepted-send",
|
|
66
|
+
"standalone-surface",
|
|
67
|
+
"input",
|
|
68
|
+
"background",
|
|
69
|
+
"finalization",
|
|
70
|
+
]) {
|
|
71
|
+
test(`${blocker} work blocks automatic Done`, () => {
|
|
72
|
+
hasResident = true;
|
|
73
|
+
if (blocker === "in-flight") {
|
|
74
|
+
resident.hasInFlightWork.mockReturnValue(true);
|
|
75
|
+
}
|
|
76
|
+
if (blocker === "accepted-send") {
|
|
77
|
+
resident.inFlightSendRequestIds.add("request-123");
|
|
78
|
+
}
|
|
79
|
+
if (blocker === "standalone-surface") {
|
|
80
|
+
resident.pendingStandaloneSurfaces.add("surface-123");
|
|
81
|
+
}
|
|
82
|
+
if (blocker === "input") {
|
|
83
|
+
pendingInput = true;
|
|
84
|
+
}
|
|
85
|
+
if (blocker === "background") {
|
|
86
|
+
pendingBackground = true;
|
|
87
|
+
}
|
|
88
|
+
if (blocker === "finalization") {
|
|
89
|
+
beginTurnFinalization(ID);
|
|
90
|
+
}
|
|
91
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(true);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
test("settled turn finalization releases its blocker", () => {
|
|
96
|
+
const settle = beginTurnFinalization(ID);
|
|
97
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(true);
|
|
98
|
+
settle();
|
|
99
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test("live ACP state protects only its parent and terminal state does not block", () => {
|
|
103
|
+
hasManager = true;
|
|
104
|
+
states = [{ id: "session-123", parentConversationId: ID, status: "running" }];
|
|
105
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(true);
|
|
106
|
+
expect(hasAutoArchiveBlockingWork("conv-other")).toBe(false);
|
|
107
|
+
states[0]!.status = "completed";
|
|
108
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(false);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test("ACP resume reservations protect terminal history before live registration", () => {
|
|
112
|
+
hasManager = true;
|
|
113
|
+
activeAndPendingIds = ["session-123"];
|
|
114
|
+
getDb()
|
|
115
|
+
.insert(acpSessionHistory)
|
|
116
|
+
.values({
|
|
117
|
+
id: "session-123",
|
|
118
|
+
parentConversationId: ID,
|
|
119
|
+
agentId: "agent-123",
|
|
120
|
+
acpSessionId: "session-123",
|
|
121
|
+
task: "Example task",
|
|
122
|
+
status: "completed",
|
|
123
|
+
startedAt: 1,
|
|
124
|
+
})
|
|
125
|
+
.run();
|
|
126
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(true);
|
|
127
|
+
expect(hasAutoArchiveBlockingWork("conv-other")).toBe(false);
|
|
128
|
+
activeAndPendingIds = [];
|
|
129
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(false);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
test("uncertain ACP status fails closed", () => {
|
|
133
|
+
hasManager = true;
|
|
134
|
+
states = undefined;
|
|
135
|
+
expect(hasAutoArchiveBlockingWork(ID)).toBe(true);
|
|
136
|
+
});
|