@vellumai/assistant 0.12.4 → 0.12.5-dev.202609251017.e467a6c

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.
Files changed (281) hide show
  1. package/docs/architecture/memory.md +9 -1
  2. package/docs/architecture/scheduling.md +13 -5
  3. package/docs/desktop-browser-cli.md +3 -2
  4. package/docs/guardian-request-flow.md +1 -1
  5. package/node_modules/@vellumai/avatar-manifest/src/__tests__/notification-avatar.test.ts +48 -4
  6. package/node_modules/@vellumai/avatar-manifest/src/notification-avatar.ts +12 -8
  7. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/guardian-requests.test.ts +26 -0
  8. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/guardian-requests.ts +77 -3
  9. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/guardian-requests.test.ts +26 -0
  10. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/guardian-requests.ts +77 -3
  11. package/node_modules/@vellumai/gateway-client/src/outbound-contract.ts +2 -4
  12. package/node_modules/@vellumai/service-contracts/src/__tests__/guardian-requests.test.ts +26 -0
  13. package/node_modules/@vellumai/service-contracts/src/guardian-requests.ts +77 -3
  14. package/openapi.yaml +152 -3
  15. package/package.json +1 -1
  16. package/src/__tests__/agent-loop.test.ts +76 -0
  17. package/src/__tests__/anthropic-error-formatting.test.ts +9 -0
  18. package/src/__tests__/background-shell-bash.test.ts +34 -0
  19. package/src/__tests__/background-shell-host-bash.test.ts +98 -1
  20. package/src/__tests__/background-tool-registry.test.ts +39 -0
  21. package/src/__tests__/channel-readiness-discord.test.ts +8 -0
  22. package/src/__tests__/channel-readiness-slack-remote.test.ts +8 -0
  23. package/src/__tests__/client-os-metadata-persistence.test.ts +4 -20
  24. package/src/__tests__/conversation-agent-loop.test.ts +529 -1
  25. package/src/__tests__/conversation-error.test.ts +18 -0
  26. package/src/__tests__/conversation-pairing.test.ts +69 -0
  27. package/src/__tests__/conversation-queue.test.ts +257 -4
  28. package/src/__tests__/conversation-runtime-assembly.test.ts +27 -0
  29. package/src/__tests__/emit-signal-routing-intent.test.ts +62 -0
  30. package/src/__tests__/evict-conversations-for-reload.test.ts +21 -0
  31. package/src/__tests__/gemini-provider.test.ts +9 -0
  32. package/src/__tests__/host-cu-proxy.test.ts +79 -0
  33. package/src/__tests__/host-cu-routes-targeted.test.ts +14 -5
  34. package/src/__tests__/introduction-card-resolver.test.ts +53 -8
  35. package/src/__tests__/job-handler-registration-guard.test.ts +1 -0
  36. package/src/__tests__/non-member-access-request.test.ts +48 -0
  37. package/src/__tests__/notification-events-source-context-probe.test.ts +48 -1
  38. package/src/__tests__/notification-platform-adapter.test.ts +97 -0
  39. package/src/__tests__/notification-vellum-adapter.test.ts +103 -3
  40. package/src/__tests__/platform-callback-registration.test.ts +46 -1
  41. package/src/__tests__/plugin-import-boundary-guard.test.ts +3 -0
  42. package/src/__tests__/scaffold-managed-skill-tool.test.ts +116 -66
  43. package/src/__tests__/scheduler-disk-pressure.test.ts +1 -0
  44. package/src/__tests__/scheduler-result-notification.test.ts +521 -7
  45. package/src/__tests__/scheduler-wake.test.ts +1 -0
  46. package/src/__tests__/skill-load-inline-command.test.ts +35 -0
  47. package/src/__tests__/subagent-cron-run-attribution.test.ts +41 -2
  48. package/src/__tests__/subagent-manager-notify.test.ts +48 -0
  49. package/src/__tests__/trusted-contact-inline-approval-integration.test.ts +6 -6
  50. package/src/__tests__/usage-attribution.test.ts +31 -0
  51. package/src/__tests__/wake-schedule-escalation.test.ts +1 -0
  52. package/src/agent/loop.ts +23 -0
  53. package/src/api/ask-question-tool.ts +50 -0
  54. package/src/api/events/generation-handoff.ts +4 -0
  55. package/src/api/events/message-complete.ts +4 -0
  56. package/src/api/events/tool-result.ts +11 -0
  57. package/src/api/index.ts +11 -0
  58. package/src/api/requests/guardian-actions.test.ts +45 -0
  59. package/src/api/requests/guardian-actions.ts +20 -0
  60. package/src/api/responses/conversation-message.ts +4 -0
  61. package/src/api/responses/home.ts +27 -0
  62. package/src/approvals/guardian-decision-primitive.ts +6 -4
  63. package/src/approvals/guardian-request-resolvers.ts +35 -30
  64. package/src/avatar/notification-avatar.test.ts +42 -34
  65. package/src/avatar/notification-avatar.ts +1 -0
  66. package/src/calls/__tests__/call-controller.test.ts +18 -0
  67. package/src/calls/__tests__/voice-control-protocol.test.ts +6 -1
  68. package/src/calls/__tests__/voice-leg-coordinator.test.ts +70 -0
  69. package/src/calls/__tests__/voice-session-bridge.test.ts +116 -4
  70. package/src/calls/__tests__/voice-triage-escalate.test.ts +77 -11
  71. package/src/calls/call-controller.ts +3 -1
  72. package/src/calls/voice-control-protocol.ts +12 -4
  73. package/src/calls/voice-escalation-judge.ts +2 -2
  74. package/src/calls/voice-leg-coordinator.ts +23 -5
  75. package/src/calls/voice-screen-annotation.ts +44 -0
  76. package/src/calls/voice-session-bridge.ts +63 -20
  77. package/src/calls/voice-triage-escalate.ts +82 -27
  78. package/src/cli/commands/__tests__/conversations-clear.test.ts +156 -0
  79. package/src/cli/commands/conversations.help.ts +7 -2
  80. package/src/cli/commands/conversations.ts +36 -30
  81. package/src/cli/commands/oauth/index.help.ts +8 -2
  82. package/src/cli/commands/oauth/request.test.ts +32 -0
  83. package/src/cli/commands/platform/index.help.ts +2 -1
  84. package/src/cli/commands/platform/index.ts +8 -2
  85. package/src/cli/lib/__tests__/plugin-catalog-cache.test.ts +60 -0
  86. package/src/cli/lib/__tests__/plugin-catalog-platform.test.ts +66 -2
  87. package/src/cli/lib/bundled-marketplace.json +35 -0
  88. package/src/cli/lib/bundled-plugin-packages.json +21 -0
  89. package/src/cli/lib/plugin-catalog-cache.ts +17 -2
  90. package/src/cli/lib/plugin-catalog-platform.ts +48 -9
  91. package/src/config/__tests__/default-profile-catalog.test.ts +28 -0
  92. package/src/config/__tests__/platform-identity.test.ts +59 -0
  93. package/src/config/__tests__/profile-order.test.ts +19 -0
  94. package/src/config/__tests__/sync-gated-profiles.test.ts +71 -0
  95. package/src/config/bundled-skills/computer-use/SKILL.md +20 -0
  96. package/src/config/bundled-skills/computer-use/TOOLS.json +11 -11
  97. package/src/config/bundled-skills/screen-annotation/SKILL.md +41 -29
  98. package/src/config/bundled-skills/screen-annotation/TOOLS.json +5 -5
  99. package/src/config/call-site-defaults.ts +6 -0
  100. package/src/config/default-profile-catalog.ts +30 -1
  101. package/src/config/default-profile-names.ts +36 -2
  102. package/src/config/feature-flag-registry.json +9 -1
  103. package/src/config/platform-identity.ts +22 -5
  104. package/src/config/profile-order.ts +7 -1
  105. package/src/config/schemas/call-site-catalog.ts +7 -0
  106. package/src/config/schemas/llm.ts +21 -5
  107. package/src/config/sync-gated-profiles.ts +96 -44
  108. package/src/daemon/__tests__/abort-null-controller.test.ts +135 -1
  109. package/src/daemon/__tests__/auto-profile-router.test.ts +380 -0
  110. package/src/daemon/__tests__/turn-tail-assistant-reply-notify.test.ts +16 -0
  111. package/src/daemon/activity-trail.test.ts +206 -0
  112. package/src/daemon/activity-trail.ts +190 -0
  113. package/src/daemon/auto-profile-router.ts +431 -0
  114. package/src/daemon/computer-use-observation.test.ts +81 -0
  115. package/src/daemon/computer-use-observation.ts +23 -0
  116. package/src/daemon/conversation-agent-loop-handlers.ts +11 -0
  117. package/src/daemon/conversation-agent-loop.ts +157 -32
  118. package/src/daemon/conversation-error.ts +19 -0
  119. package/src/daemon/conversation-lifecycle.ts +70 -7
  120. package/src/daemon/conversation-media-retry.ts +1 -2
  121. package/src/daemon/conversation-messaging.ts +31 -2
  122. package/src/daemon/conversation-process.ts +107 -16
  123. package/src/daemon/conversation-queue-manager.ts +7 -0
  124. package/src/daemon/conversation-runtime-assembly.ts +1 -0
  125. package/src/daemon/conversation-turn-finalize.ts +14 -0
  126. package/src/daemon/conversation.ts +25 -6
  127. package/src/daemon/event-loop-watchdog.test.ts +201 -2
  128. package/src/daemon/event-loop-watchdog.ts +182 -6
  129. package/src/daemon/host-cu-proxy.ts +34 -3
  130. package/src/daemon/pkb-reminder-builder.test.ts +10 -3
  131. package/src/daemon/pkb-reminder-builder.ts +1 -1
  132. package/src/daemon/wake-conversation-ops.ts +4 -2
  133. package/src/desktop/desktop-computer-use.test.ts +14 -4
  134. package/src/home/feed-types.ts +2 -0
  135. package/src/inbound/platform-callback-registration.ts +19 -6
  136. package/src/live-voice/__tests__/live-voice-agent-turn.test.ts +27 -0
  137. package/src/live-voice/__tests__/live-voice-flux-turn-end.test.ts +83 -0
  138. package/src/live-voice/__tests__/live-voice-triage-escalate.test.ts +48 -1
  139. package/src/live-voice/__tests__/live-voice-vad.test.ts +34 -2
  140. package/src/live-voice/__tests__/protocol.test.ts +22 -0
  141. package/src/live-voice/continuation-judge.ts +1 -1
  142. package/src/live-voice/live-voice-session.ts +25 -19
  143. package/src/live-voice/protocol.ts +16 -5
  144. package/src/messaging/providers/discord/withdraw.ts +4 -5
  145. package/src/messaging/providers/gmail/client.ts +4 -0
  146. package/src/messaging/providers/slack/withdraw.ts +5 -5
  147. package/src/messaging/providers/telegram-bot/withdraw.ts +4 -5
  148. package/src/monitoring/__tests__/proc-fixtures.ts +28 -0
  149. package/src/monitoring/__tests__/proc-wait-state.test.ts +232 -0
  150. package/src/monitoring/__tests__/process-usage.test.ts +243 -0
  151. package/src/monitoring/proc-wait-state.ts +366 -0
  152. package/src/monitoring/process-memory.ts +4 -3
  153. package/src/monitoring/process-usage.ts +215 -0
  154. package/src/monitoring/resource-sample-types.ts +8 -0
  155. package/src/monitoring/resource-sampler.ts +17 -2
  156. package/src/monitoring/stall-capture.ts +12 -0
  157. package/src/notifications/README.md +88 -9
  158. package/src/notifications/__tests__/assistant-reply-producer.test.ts +390 -119
  159. package/src/notifications/__tests__/background-result-producer.test.ts +1272 -0
  160. package/src/notifications/__tests__/broadcaster.test.ts +292 -1
  161. package/src/notifications/__tests__/completion-policy.test.ts +243 -0
  162. package/src/notifications/__tests__/decision-engine.test.ts +51 -4
  163. package/src/notifications/__tests__/has-pending-background-work.test.ts +281 -0
  164. package/src/notifications/__tests__/home-feed-side-effect.test.ts +161 -3
  165. package/src/notifications/__tests__/resolve-visible-in-source.test.ts +110 -1
  166. package/src/notifications/__tests__/schedule-result-producer.test.ts +11 -4
  167. package/src/notifications/adapters/macos.ts +24 -12
  168. package/src/notifications/adapters/platform.ts +16 -5
  169. package/src/notifications/assistant-reply-producer.ts +96 -71
  170. package/src/notifications/background-result-producer.ts +369 -0
  171. package/src/notifications/broadcaster.ts +28 -8
  172. package/src/notifications/completion-policy.ts +115 -0
  173. package/src/notifications/completion-work.ts +46 -0
  174. package/src/notifications/conversation-pairing.ts +32 -13
  175. package/src/notifications/decision-engine.ts +18 -24
  176. package/src/notifications/emit-signal.ts +16 -1
  177. package/src/notifications/events-store.ts +4 -0
  178. package/src/notifications/has-pending-background-work.ts +91 -0
  179. package/src/notifications/home-feed-mirror.ts +44 -0
  180. package/src/notifications/home-feed-side-effect.ts +54 -28
  181. package/src/notifications/resolve-visible-in-source.ts +56 -2
  182. package/src/notifications/result-output.ts +154 -0
  183. package/src/notifications/schedule-result-producer.ts +6 -187
  184. package/src/notifications/types.ts +2 -0
  185. package/src/oauth/AGENTS.md +9 -1
  186. package/src/oauth/byo-connection.test.ts +28 -0
  187. package/src/persistence/__tests__/recent-conversation-messages.test.ts +41 -0
  188. package/src/persistence/conversation-crud.ts +26 -0
  189. package/src/persistence/conversation-types.ts +15 -37
  190. package/src/persistence/embeddings/__tests__/embedding-local-lifecycle.test.ts +85 -14
  191. package/src/persistence/jobs-store.ts +229 -0
  192. package/src/persistence/migrations/383-normalize-opencode-host-connections.ts +44 -0
  193. package/src/persistence/migrations/__tests__/383-normalize-opencode-host-connections.test.ts +102 -0
  194. package/src/persistence/steps.ts +12 -0
  195. package/src/platform/sync-avatar.test.ts +29 -0
  196. package/src/plugins/defaults/memory/AGENTS.md +5 -3
  197. package/src/plugins/defaults/memory/__tests__/skill-update-receipt-boundary-guard.test.ts +45 -0
  198. package/src/plugins/defaults/memory/__tests__/skill-update-receipt-job.test.ts +580 -0
  199. package/src/plugins/defaults/memory/__tests__/turn-retrieval.test.ts +21 -0
  200. package/src/plugins/defaults/memory/graph/tools.ts +9 -5
  201. package/src/plugins/defaults/memory/hooks/conversation-deleted.ts +4 -0
  202. package/src/plugins/defaults/memory/hooks/user-prompt-submit.ts +7 -3
  203. package/src/plugins/defaults/memory/job-handlers.ts +8 -2
  204. package/src/plugins/defaults/memory/skill-update-receipt-job.ts +334 -0
  205. package/src/plugins/defaults/memory/tools.test.ts +17 -0
  206. package/src/plugins/defaults/memory/turn-retrieval.ts +8 -0
  207. package/src/plugins/defaults/memory/v3/__tests__/injection.test.ts +24 -0
  208. package/src/plugins/defaults/memory/v3/injector.ts +4 -4
  209. package/src/plugins/types.ts +2 -0
  210. package/src/providers/__tests__/search-provider-catalog.test.ts +8 -0
  211. package/src/providers/anthropic/client.ts +4 -0
  212. package/src/providers/gemini/client.ts +7 -1
  213. package/src/providers/inference/auth.ts +25 -0
  214. package/src/providers/inference/profile-probe.ts +1 -0
  215. package/src/{calls/__tests__/typesafe-noul.test.ts → providers/jev/ask.test.ts} +4 -4
  216. package/src/{calls/typesafe-noul.ts → providers/jev/ask.ts} +67 -34
  217. package/src/providers/openai/__tests__/api-error-normalization.test.ts +12 -0
  218. package/src/providers/openai/api-error-normalization.ts +4 -0
  219. package/src/providers/retry.ts +2 -0
  220. package/src/providers/search-provider-catalog.ts +10 -0
  221. package/src/providers/types.ts +7 -0
  222. package/src/providers/usage-tracking.ts +5 -3
  223. package/src/runtime/__tests__/agent-wake.test.ts +308 -0
  224. package/src/runtime/access-request-helper.ts +16 -9
  225. package/src/runtime/agent-wake-queue.ts +52 -0
  226. package/src/runtime/agent-wake.ts +111 -18
  227. package/src/runtime/channel-approval-types.ts +6 -38
  228. package/src/runtime/channel-approvals.ts +4 -5
  229. package/src/runtime/http-server.ts +4 -1
  230. package/src/runtime/introduction-policy.test.ts +17 -1
  231. package/src/runtime/introduction-policy.ts +25 -7
  232. package/src/runtime/migrations/vbundle-builder.ts +9 -0
  233. package/src/runtime/routes/__tests__/inference-profiles-routes.test.ts +21 -1
  234. package/src/runtime/routes/__tests__/inference-provider-connection-routes.test.ts +60 -0
  235. package/src/runtime/routes/__tests__/oauth-proxy-routes.test.ts +61 -3
  236. package/src/runtime/routes/auto-profile-routes.ts +83 -0
  237. package/src/runtime/routes/conversation-management-routes.ts +1 -3
  238. package/src/runtime/routes/conversation-routes.ts +9 -0
  239. package/src/runtime/routes/guardian-action-routes.ts +8 -23
  240. package/src/runtime/routes/host-cu-routes.ts +3 -1
  241. package/src/runtime/routes/index.ts +2 -0
  242. package/src/runtime/routes/inference-profiles-routes.ts +5 -2
  243. package/src/runtime/routes/inference-provider-connection-routes.ts +25 -8
  244. package/src/runtime/routes/migration-routes.ts +8 -2
  245. package/src/runtime/routes/oauth-proxy-passthrough.test.ts +32 -0
  246. package/src/runtime/routes/platform-routes.ts +6 -1
  247. package/src/runtime/routes/user-route-dispatcher.ts +1 -2
  248. package/src/runtime/web-presence.ts +3 -4
  249. package/src/schedule/schedule-store.ts +10 -0
  250. package/src/schedule/scheduler.ts +92 -24
  251. package/src/subagent/manager.ts +32 -12
  252. package/src/telegram/__tests__/webhook-health.test.ts +8 -0
  253. package/src/telemetry/telemetry-wire-source.json +1 -1
  254. package/src/telemetry/telemetry-wire.generated.ts +1 -0
  255. package/src/tools/background-tool-registry.ts +30 -3
  256. package/src/tools/browser/cdp-client/local-cdp-client.ts +1 -2
  257. package/src/tools/host-terminal/host-shell.ts +7 -0
  258. package/src/tools/network/__tests__/web-fetch-firecrawl.test.ts +28 -1
  259. package/src/tools/network/__tests__/web-fetch-metadata.test.ts +34 -0
  260. package/src/tools/network/__tests__/web-fetch-tinyfish.test.ts +35 -1
  261. package/src/tools/network/__tests__/web-search.test.ts +96 -0
  262. package/src/tools/network/web-fetch.ts +30 -9
  263. package/src/tools/network/web-search.ts +235 -4
  264. package/src/tools/skills/load.ts +13 -17
  265. package/src/tools/skills/scaffold-managed.ts +86 -71
  266. package/src/tools/terminal/shell-launch.test.ts +27 -1
  267. package/src/tools/terminal/shell.ts +4 -0
  268. package/src/tools/workspace-tools/loader.ts +1 -2
  269. package/src/usage/attribution.ts +18 -1
  270. package/src/util/abort-reasons.ts +2 -0
  271. package/src/util/errors.ts +1 -0
  272. package/src/util/oauth-request-body.test.ts +5 -1
  273. package/src/util/provider-error-patterns.ts +11 -0
  274. package/src/util/single-flight.test.ts +6 -0
  275. package/src/util/single-flight.ts +2 -0
  276. package/src/util/worker-pipe.test.ts +56 -10
  277. package/src/util/worker-pipe.ts +9 -4
  278. package/src/workspace/git-service.ts +6 -1
  279. package/src/workspace/migrations/158-repoint-opencode-host-provider-fragments.ts +163 -0
  280. package/src/workspace/migrations/__tests__/158-repoint-opencode-host-provider-fragments.test.ts +188 -0
  281. package/src/workspace/migrations/registry.ts +2 -0
@@ -258,4 +258,64 @@ describe("mergePlatformCatalogWithBundledLocals", () => {
258
258
  expect(merged.matches[1]?.source.kind).toBe("local");
259
259
  expect(merged.ref).toBe("main");
260
260
  });
261
+ test("keeps the bundled integration when a platform row without one shadows it", () => {
262
+ const integration = {
263
+ kind: "mcp",
264
+ displayName: "Fathom",
265
+ documentationUrl: "https://example.com/docs",
266
+ verifiedAt: "2026-09-10",
267
+ verification: "documentation-only",
268
+ setup: { mode: "oauth", instructions: "Sign in." },
269
+ logo: "fathom.png",
270
+ } as const;
271
+ const platformIntegration = { ...integration, displayName: "Platform" };
272
+ const platform: PluginCatalog = {
273
+ ref: "main",
274
+ matches: [
275
+ {
276
+ name: "fathom",
277
+ path: "github:provider/fathom@pin",
278
+ category: null,
279
+ source: {
280
+ kind: "github",
281
+ repo: "provider/fathom",
282
+ ref: "0".repeat(40),
283
+ },
284
+ },
285
+ {
286
+ name: "linear",
287
+ path: "github:provider/linear@pin",
288
+ category: null,
289
+ integration: platformIntegration,
290
+ source: {
291
+ kind: "github",
292
+ repo: "provider/linear",
293
+ ref: "0".repeat(40),
294
+ },
295
+ },
296
+ ],
297
+ };
298
+ const bundled: PluginCatalog = {
299
+ ref: "bundled",
300
+ matches: ["fathom", "linear"].map((name) => ({
301
+ name,
302
+ path: `local:plugins/mcp-catalog/${name}@1.0.0`,
303
+ category: null,
304
+ integration,
305
+ source: {
306
+ kind: "local",
307
+ path: `plugins/mcp-catalog/${name}`,
308
+ version: "1.0.0",
309
+ },
310
+ })),
311
+ };
312
+
313
+ const merged = mergePlatformCatalogWithBundledLocals(platform, bundled);
314
+
315
+ const [fathom, linear] = merged.matches;
316
+ expect(fathom?.source.kind).toBe("github");
317
+ expect(fathom?.integration).toEqual(integration);
318
+ expect(linear?.source.kind).toBe("github");
319
+ expect(linear?.integration).toEqual(platformIntegration);
320
+ });
261
321
  });
@@ -161,14 +161,78 @@ describe("fetchPluginCatalogFromPlatform", () => {
161
161
  await expect(promise).rejects.toMatchObject({ status: 502 });
162
162
  });
163
163
 
164
- test("throws on a schema violation", async () => {
164
+ test.each([
165
+ ["a missing plugins array", {}],
166
+ ["a non-array plugins field", { plugins: "nope" }],
167
+ ["a non-object body", []],
168
+ ])("throws on an invalid envelope (%s)", async (_label, body) => {
165
169
  const promise = fetchPluginCatalogFromPlatform({
166
- fetch: platformFetch({ plugins: [{ repo: "acme/x", ref: SHA_A }] }),
170
+ fetch: platformFetch(body),
167
171
  });
168
172
  await expect(promise).rejects.toBeInstanceOf(PluginCatalogUnavailableError);
169
173
  await expect(promise).rejects.toMatchObject({ status: 502 });
170
174
  });
171
175
 
176
+ test("skips rows that fail the base row schema and keeps the rest", async () => {
177
+ const catalog = await fetchPluginCatalogFromPlatform({
178
+ fetch: platformFetch({
179
+ plugins: [
180
+ { repo: "acme/nameless", ref: SHA_A },
181
+ { name: 42, repo: "acme/numeric", ref: SHA_A },
182
+ "not-a-row",
183
+ { name: "good", repo: "acme/good", ref: SHA_B },
184
+ ],
185
+ }),
186
+ });
187
+ expect(catalog.matches.map((m) => m.name)).toEqual(["good"]);
188
+ });
189
+
190
+ test("keeps a row whose integration is invalid, without the integration", async () => {
191
+ const catalog = await fetchPluginCatalogFromPlatform({
192
+ fetch: platformFetch({
193
+ plugins: [
194
+ {
195
+ name: "snake-case",
196
+ repo: "acme/snake-case",
197
+ ref: SHA_A,
198
+ description: "kept",
199
+ integration: {
200
+ kind: "mcp",
201
+ display_name: "Snake Case",
202
+ documentation_url: "https://example.com/docs",
203
+ verified_at: "2026-09-10",
204
+ verification: "documentation-only",
205
+ setup: { mode: "oauth", instructions: "Sign in." },
206
+ logo: "snake-case.png",
207
+ },
208
+ },
209
+ {
210
+ name: "valid",
211
+ repo: "acme/valid",
212
+ ref: SHA_B,
213
+ integration: {
214
+ kind: "mcp",
215
+ displayName: "Valid",
216
+ documentationUrl: "https://example.com/docs",
217
+ verifiedAt: "2026-09-10",
218
+ verification: "documentation-only",
219
+ setup: { mode: "manual", instructions: "Paste a key." },
220
+ logo: "valid.png",
221
+ },
222
+ },
223
+ ],
224
+ }),
225
+ });
226
+
227
+ expect(catalog.matches.map((m) => m.name)).toEqual(["snake-case", "valid"]);
228
+ expect(catalog.matches[0]).toMatchObject({
229
+ name: "snake-case",
230
+ description: "kept",
231
+ });
232
+ expect(catalog.matches[0]?.integration).toBeUndefined();
233
+ expect(catalog.matches[1]?.integration?.displayName).toBe("Valid");
234
+ });
235
+
172
236
  test("throws when fetch rejects (network error / abort)", async () => {
173
237
  const promise = fetchPluginCatalogFromPlatform({
174
238
  fetch: (async () => {
@@ -1363,6 +1363,17 @@
1363
1363
  "category": "knowledge"
1364
1364
  }
1365
1365
  },
1366
+ {
1367
+ "name": "runway-plugin",
1368
+ "source": {
1369
+ "source": "github",
1370
+ "repo": "vellum-ai/runway-plugin",
1371
+ "ref": "bb017a1e018c7be140c02c8463273c2d85f3b9d9"
1372
+ },
1373
+ "description": "Securely set up, collaboratively direct, approve, create, track, cancel, and download Runway Gen-4.5 videos.",
1374
+ "category": "other",
1375
+ "submittedBy": "marina"
1376
+ },
1366
1377
  {
1367
1378
  "name": "semrush",
1368
1379
  "source": {
@@ -1483,6 +1494,30 @@
1483
1494
  "logo": "webull-mcp.png",
1484
1495
  "category": "finance"
1485
1496
  }
1497
+ },
1498
+ {
1499
+ "name": "wix",
1500
+ "source": {
1501
+ "source": "local",
1502
+ "path": "plugins/mcp-catalog/wix",
1503
+ "version": "1.0.2"
1504
+ },
1505
+ "description": "Manage Wix sites, stores, bookings, and CMS content.",
1506
+ "homepage": "https://dev.wix.com/docs/sdk/articles/use-the-wix-mcp/about-the-wix-mcp",
1507
+ "license": "MIT",
1508
+ "integration": {
1509
+ "kind": "mcp",
1510
+ "displayName": "Wix",
1511
+ "documentationUrl": "https://dev.wix.com/docs/sdk/articles/use-the-wix-mcp/about-the-wix-mcp",
1512
+ "verifiedAt": "2026-09-23",
1513
+ "verification": "documentation-only",
1514
+ "setup": {
1515
+ "mode": "oauth",
1516
+ "instructions": "Sign in with the Wix account that owns the sites you want to manage."
1517
+ },
1518
+ "logo": "wix-mcp.png",
1519
+ "category": "commerce"
1520
+ }
1486
1521
  }
1487
1522
  ]
1488
1523
  }
@@ -781,6 +781,27 @@
781
781
  "contentBase64": "ewogICIkc2NoZW1hIjogImh0dHBzOi8vYWdlbnQtcGx1Z2lucy5vcmcvc2NoZW1hcy8xLjAuMC9wbHVnaW4uc2NoZW1hLmpzb24iLAogICJuYW1lIjogIndlYnVsbCIsCiAgInZlcnNpb24iOiAiMS4wLjEiLAogICJkZXNjcmlwdGlvbiI6ICJSZXZpZXcgYnJva2VyYWdlIGFjY291bnRzLCBvcmRlcnMsIHBvc2l0aW9ucywgYW5kIG1hcmtldCBkYXRhLiIsCiAgImhvbWVwYWdlIjogImh0dHBzOi8vZGV2ZWxvcGVyLndlYnVsbC5jb20vYXBpcy9kb2NzL0FJLWZyaWVuZGx5LVJlc291cmNlcy9tY3AvIiwKICAibGljZW5zZSI6ICJNSVQiCn0K"
782
782
  }
783
783
  ]
784
+ },
785
+ "plugins/mcp-catalog/wix": {
786
+ "version": "1.0.2",
787
+ "files": [
788
+ {
789
+ "path": "ICON_ATTRIBUTION.md",
790
+ "contentBase64": "IyBJY29uIGF0dHJpYnV0aW9uCgpTb3VyY2U6IFtXaXgncyBvZmZpY2lhbCAxOTJweCB3ZWJzaXRlIGljb25dKGh0dHBzOi8vd3d3LndpeC5jb20vZmF2aWNvbi5pY28pLCBsaW5rZWQgZnJvbSBbd2l4LmNvbV0oaHR0cHM6Ly93d3cud2l4LmNvbS8pLgoKVGhlIGFzc2V0IHdhcyByZXNpemVkIHRvIDEyOHgxMjggYW5kIGZsYXR0ZW5lZCBvbnRvIGFuIG9wYXF1ZSB3aGl0ZSBiYWNrZ3JvdW5kIGZvciB0aGVtZSBjb250cmFzdC4gSXQgaXMgYSB0cmFkZW1hcmsgb2YgV2l4LmNvbSBhbmQgaXMgdXNlZCBvbmx5IHRvIGlkZW50aWZ5IHRoaXMgaW50ZWdyYXRpb24uCg=="
791
+ },
792
+ {
793
+ "path": "icon.png",
794
+ "contentBase64": "iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAN7ElEQVR42u2dbUxbVdzA710pUNpJxxilpIW+QAuMlo6iRDNf5tucQ9miyURNiLr5gnOyGsj0w3xLnI7xQR0YmfODxheMCSMBgppl4gLZ5lyBlkGBAisd71sLLS194z4f7pPmPue2BW5vcj485/eJ/XvuufeeX+8553/ugeEEQWAIeGyBfQH/30ECIIMEQAYJgAwSABkkADJIAGSQAMggAZBBAiCDBEAGCYAMEgAZJAAySABkkADIIAGQQQIggwRABgmADBIAGSQAMkgAZJAAyCABkEECIIMEQAYJgAwSABkkADJIAGSQAMggAZBBAiCDBEAGCYAMEgAZJAAySABkkADIIAGQQQIggwRABgmATMJmDzAajV999dXq6iqPx9PpdPv371cqlRs8dnl52WQydXd32+32pKQkuVy+e/dujUbD5XI3cjhBECaTqaura2hoyOv1pqenv/vuu3l5edQC/f39v/32m81mCwaDUqn05MmTW7duJT+9evVqU1OT3+/HcZz8EyUikai8vPzB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DZ/PJztlVog48yFXpA8dOhQx0z548OBLL70EfLSwsHDq1Cl6J7Yp2BGg1WpjCJDL5fQFH4D8/Hz6ruMwWVlZ69awQaLNfDQaTXV1dbQ8g8fjvfPOO/QZ0ZUrV8jflmB8PewIEIlE0VbScRw/ePAgkOvSkUqlMd50azQaIN/e0L1FmrNGnPmkpqa+99579PalEnFGFAqFzp8/T9+2tQkYb+ul4vP53n777Yj1l5WVjYyMbKSS3t5etVodsZLPPvts3f379N3RFRUVLpeLWmZmZubpp5+m119VVeV0Ote9QrfbXV1dHfEeLRYLs6ZjRwBBEM3NzcBl4TheVlZ2+fLlDdawtrbW2dlZXFwMdLVJSUmtra3rHt7W1kbtBpVKZWdnJ7WAz+f78MMP6Y/FE088sfHmm5iYiPjm8q233lpZWWHQbqy921Or1fn5+Q6HA8fxxMREpVL5zDPPlJeX07cPRQPH8X379olEotbW1r/++ov8Day1tTWFQrGRFCw5OVksFrtcrqSkpNLS0urq6ocffphawGg0tre3p6enhx0IhcKnnnrqjTfeiNZ/0pHJZGfPnr3vvvt+//33ubk58rtCEMTff//d29sL/BbJhu6aYOl/1A4EAk6nk1wpxHE8OTk5NTWVWVXBYNDlcoV3hXC5XKFQuO5OLJ/PR3YjOI7z+Xz6cOrxeIBtSwkJCffcc0/EFarYhEIhp9MJzGK3bt3KYMM2awIQzEC/JwwZJAAySABkkADIIAGQQQIggwRABgmADBIAGSQAMkgAZJAAyCABkEECIIMEQAYJgAwSABkkADJIAGSQAMggAZBBAiCDBEAGCYAMEgAZJAAySABkkADIIAGQQQIggwRABgmADBIAGSQAMkgAZJAAyCABkEECIIMEQAYJgAwSABkkADJIAGSQAMj8D1zqrxZewRTWAAAAAElFTkSuQmCC"
795
+ },
796
+ {
797
+ "path": "mcp.json",
798
+ "contentBase64": "ewogICIkc2NoZW1hIjogImh0dHBzOi8vYWdlbnQtcGx1Z2lucy5vcmcvc2NoZW1hcy8xLjAuMC9tY3Auc2NoZW1hLmpzb24iLAogICJtY3BTZXJ2ZXJzIjogewogICAgIndpeCI6IHsKICAgICAgInR5cGUiOiAic3RyZWFtYWJsZS1odHRwIiwKICAgICAgInVybCI6ICJodHRwczovL21jcC53aXguY29tL21jcCIKICAgIH0KICB9Cn0K"
799
+ },
800
+ {
801
+ "path": "plugin.json",
802
+ "contentBase64": "ewogICIkc2NoZW1hIjogImh0dHBzOi8vYWdlbnQtcGx1Z2lucy5vcmcvc2NoZW1hcy8xLjAuMC9wbHVnaW4uc2NoZW1hLmpzb24iLAogICJuYW1lIjogIndpeCIsCiAgInZlcnNpb24iOiAiMS4wLjIiLAogICJkZXNjcmlwdGlvbiI6ICJNYW5hZ2UgV2l4IHNpdGVzLCBzdG9yZXMsIGJvb2tpbmdzLCBhbmQgQ01TIGNvbnRlbnQuIiwKICAiaG9tZXBhZ2UiOiAiaHR0cHM6Ly9kZXYud2l4LmNvbS9kb2NzL3Nkay9hcnRpY2xlcy91c2UtdGhlLXdpeC1tY3AvYWJvdXQtdGhlLXdpeC1tY3AiLAogICJsaWNlbnNlIjogIk1JVCIKfQo="
803
+ }
804
+ ]
784
805
  }
785
806
  }
786
807
  }
@@ -29,16 +29,31 @@ type PluginCatalogLoadDeps = Pick<SearchPluginsDeps, "fetch">;
29
29
 
30
30
  const cache = new Map<string, CacheEntry>();
31
31
 
32
- /** Add bundled local packages without overriding platform-authoritative rows. */
32
+ /**
33
+ * Add bundled local packages without overriding platform-authoritative rows.
34
+ * A platform row without an integration borrows the bundled row's
35
+ * integration of the same name, so an integration the platform omits or
36
+ * serves malformed never disappears from the catalog.
37
+ */
33
38
  export function mergePlatformCatalogWithBundledLocals(
34
39
  platform: PluginCatalog,
35
40
  bundledLocal: PluginCatalog = readBundledLocalPluginCatalog(),
36
41
  ): PluginCatalog {
42
+ const bundledByName = new Map(
43
+ bundledLocal.matches.map((match) => [match.name, match]),
44
+ );
45
+ const platformMatches = platform.matches.map((match) => {
46
+ const bundledIntegration = bundledByName.get(match.name)?.integration;
47
+ if (match.integration || !bundledIntegration) {
48
+ return match;
49
+ }
50
+ return { ...match, integration: bundledIntegration };
51
+ });
37
52
  const seen = new Set(platform.matches.map((match) => match.name));
38
53
  return {
39
54
  ref: platform.ref,
40
55
  matches: [
41
- ...platform.matches,
56
+ ...platformMatches,
42
57
  ...bundledLocal.matches.filter((match) => !seen.has(match.name)),
43
58
  ].sort((a, b) => a.name.localeCompare(b.name)),
44
59
  };
@@ -7,15 +7,17 @@
7
7
  * catalog sourced from the platform is indistinguishable from one read off
8
8
  * GitHub.
9
9
  *
10
- * Every failure mode (non-2xx, unreachable/aborted, malformed body) throws
11
- * {@link PluginCatalogUnavailableError} — the fetcher never returns a partial
12
- * or silently-empty catalog, so a caller can safely fall back to a bundled
13
- * offline copy instead of mistaking an outage for "no plugins".
10
+ * Every failure mode (non-2xx, unreachable/aborted, malformed envelope)
11
+ * throws {@link PluginCatalogUnavailableError}, so a caller never mistakes an
12
+ * outage for "no plugins". Rows are validated one at a time: a row with an
13
+ * invalid `integration` is kept without it, and a row that fails the base
14
+ * row schema is skipped, so one bad row never blanks the whole catalog.
14
15
  */
15
16
 
16
17
  import { z } from "zod";
17
18
 
18
19
  import { getPlatformBaseUrl } from "../../config/env.js";
20
+ import { getLogger } from "../../util/logger.js";
19
21
  import {
20
22
  type MarketplaceEntry,
21
23
  mcpIntegrationSchema,
@@ -27,9 +29,12 @@ import {
27
29
  type SearchPluginsDeps,
28
30
  } from "./search-plugins.js";
29
31
 
32
+ const log = getLogger("plugin-catalog");
33
+
30
34
  /**
31
35
  * One flattened row from the platform catalog. Unknown keys (`id`,
32
- * `display_name`) are accepted and dropped — zod strips them by default.
36
+ * `display_name`) are accepted and dropped (zod strips them by default).
37
+ * `integration` is validated separately by {@link integrationSchema}.
33
38
  */
34
39
  const platformPluginRowSchema = z.object({
35
40
  name: z.string(),
@@ -41,11 +46,13 @@ const platformPluginRowSchema = z.object({
41
46
  category: z.string().nullable().optional(),
42
47
  homepage: z.string().nullable().optional(),
43
48
  license: z.string().nullable().optional(),
44
- integration: mcpIntegrationSchema.nullable().optional(),
49
+ integration: z.unknown(),
45
50
  });
46
51
 
52
+ const integrationSchema = mcpIntegrationSchema.nullable().optional();
53
+
47
54
  const platformCatalogSchema = z.object({
48
- plugins: z.array(platformPluginRowSchema),
55
+ plugins: z.array(z.unknown()),
49
56
  });
50
57
 
51
58
  /**
@@ -99,10 +106,22 @@ export async function fetchPluginCatalogFromPlatform(
99
106
  }
100
107
 
101
108
  const entries: MarketplaceEntry[] = [];
102
- for (const row of parsed.data.plugins) {
109
+ const skippedRows: string[] = [];
110
+ const droppedIntegrations: string[] = [];
111
+ for (const [index, rawRow] of parsed.data.plugins.entries()) {
112
+ const rowResult = platformPluginRowSchema.safeParse(rawRow);
113
+ if (!rowResult.success) {
114
+ skippedRows.push(describeInvalidRow(rawRow, index));
115
+ continue;
116
+ }
117
+ const row = rowResult.data;
103
118
  if (!row.repo || !row.ref) {
104
119
  continue;
105
120
  }
121
+ const integrationResult = integrationSchema.safeParse(row.integration);
122
+ if (!integrationResult.success) {
123
+ droppedIntegrations.push(row.name);
124
+ }
106
125
  entries.push({
107
126
  name: row.name,
108
127
  source: {
@@ -116,12 +135,32 @@ export async function fetchPluginCatalogFromPlatform(
116
135
  category: row.category ?? undefined,
117
136
  homepage: row.homepage ?? undefined,
118
137
  license: row.license ?? undefined,
119
- integration: row.integration ?? undefined,
138
+ integration: integrationResult.success
139
+ ? (integrationResult.data ?? undefined)
140
+ : undefined,
120
141
  });
121
142
  }
122
143
 
144
+ if (skippedRows.length > 0 || droppedIntegrations.length > 0) {
145
+ log.warn(
146
+ { skippedRows, droppedIntegrations },
147
+ "platform plugin catalog contained invalid rows; skipped rows and dropped integrations",
148
+ );
149
+ }
150
+
123
151
  return {
124
152
  ref: opts?.ref ?? "platform",
125
153
  matches: projectMarketplaceEntries(entries),
126
154
  };
127
155
  }
156
+
157
+ /** Name of an invalid row for logging, or its position when it has none. */
158
+ function describeInvalidRow(row: unknown, index: number): string {
159
+ if (row && typeof row === "object" && "name" in row) {
160
+ const name = (row as { name: unknown }).name;
161
+ if (typeof name === "string" && name.length > 0) {
162
+ return name;
163
+ }
164
+ }
165
+ return `#${index}`;
166
+ }
@@ -10,6 +10,7 @@ import {
10
10
  getEffectiveProfiles,
11
11
  getEffectiveProfilesForProvider,
12
12
  getUserSelectableProfilesForProvider,
13
+ MANAGED_PROFILE_TEMPLATES,
13
14
  PROFILE_IMPLS,
14
15
  resolveDefaultProfileForProvider,
15
16
  } from "../default-profile-catalog.js";
@@ -79,6 +80,33 @@ describe("getEffectiveProfiles", () => {
79
80
  ).toBeUndefined();
80
81
  });
81
82
 
83
+ test("the Auto profile is the managed Balanced body relabeled, managed-only, and flag-gated", () => {
84
+ const auto = CODE_DEFAULT_PROFILE_ENTRIES.auto;
85
+ const balanced = CODE_DEFAULT_PROFILE_ENTRIES.balanced;
86
+ expect(auto.label).toBe("Auto");
87
+ expect(auto.model).toBe(balanced.model);
88
+ expect(auto.provider).toBe(balanced.provider);
89
+ expect(auto.fallbackProfile).toBeUndefined();
90
+ // Not seeded unconditionally: the flag reconcile writes the stub.
91
+ expect(Object.keys(MANAGED_PROFILE_TEMPLATES)).not.toContain("auto");
92
+ expect(
93
+ resolveDefaultProfileForProvider(undefined, "auto", null),
94
+ ).toBeUndefined();
95
+ const stub: Record<string, ProfileEntry> = { auto: { source: "managed" } };
96
+ expect(resolveDefaultProfileForProvider(stub, "auto", null)?.model).toBe(
97
+ balanced.model,
98
+ );
99
+ expect(
100
+ resolveDefaultProfileForProvider(stub, "auto", {
101
+ provider: "anthropic",
102
+ connectionName: "anthropic-personal",
103
+ }),
104
+ ).toBeUndefined();
105
+ expect(
106
+ Object.keys(getConversationProfilesForProvider(stub, null)),
107
+ ).toContain("auto");
108
+ });
109
+
82
110
  test("the conversation view drops the managed Jev profile but keeps it selectable for call sites", () => {
83
111
  expect(
84
112
  Object.keys(getConversationProfilesForProvider(undefined, null)),
@@ -116,6 +116,7 @@ describe("fetchPlatformIdentityIds", () => {
116
116
  describe("resolvePlatformAssistantId", () => {
117
117
  const originalFetch = globalThis.fetch;
118
118
  const originalAssistantApiKeyEnv = process.env.ASSISTANT_API_KEY;
119
+ const originalPlatformUrlEnv = process.env.VELLUM_PLATFORM_URL;
119
120
  const fetchCalls: Array<{ url: string; init?: RequestInit }> = [];
120
121
  let fetchImpl: (
121
122
  input: RequestInfo | URL,
@@ -149,6 +150,11 @@ describe("resolvePlatformAssistantId", () => {
149
150
  } else {
150
151
  process.env.ASSISTANT_API_KEY = originalAssistantApiKeyEnv;
151
152
  }
153
+ if (originalPlatformUrlEnv === undefined) {
154
+ delete process.env.VELLUM_PLATFORM_URL;
155
+ } else {
156
+ process.env.VELLUM_PLATFORM_URL = originalPlatformUrlEnv;
157
+ }
152
158
  setPlatformBaseUrl(undefined);
153
159
  setPlatformAssistantId(undefined);
154
160
  setPlatformOrganizationId(undefined);
@@ -198,6 +204,59 @@ describe("resolvePlatformAssistantId", () => {
198
204
  expect(fetchCalls).toHaveLength(1);
199
205
  });
200
206
 
207
+ test("retries validate inside the cooldown once a different API key is stored", async () => {
208
+ process.env.ASSISTANT_API_KEY = "rejected-key";
209
+ setPlatformBaseUrl(BASE_URL);
210
+ fetchImpl = async () => new Response("no", { status: 401 });
211
+
212
+ await expect(resolvePlatformAssistantId()).resolves.toBe("");
213
+ expect(fetchCalls).toHaveLength(1);
214
+
215
+ process.env.ASSISTANT_API_KEY = "replacement-key";
216
+ fetchImpl = async () =>
217
+ new Response(
218
+ JSON.stringify({
219
+ assistant_id: ASSISTANT_ID,
220
+ organization_id: ORG_ID,
221
+ user_id: USER_ID,
222
+ }),
223
+ { status: 200 },
224
+ );
225
+
226
+ await expect(resolvePlatformAssistantId()).resolves.toBe(ASSISTANT_ID);
227
+ expect(fetchCalls).toHaveLength(2);
228
+ const headers = new Headers(fetchCalls[1]?.init?.headers);
229
+ expect(headers.get("Authorization")).toBe("Api-Key replacement-key");
230
+ });
231
+
232
+ test("retries validate inside the cooldown once a different base URL is stored", async () => {
233
+ process.env.ASSISTANT_API_KEY = "assistant-key";
234
+ // The environment URL outranks the in-memory override (and the test
235
+ // preload sets one), so the base URL is changed through the environment.
236
+ process.env.VELLUM_PLATFORM_URL = "https://old.example.com";
237
+ fetchImpl = async () => new Response("no", { status: 401 });
238
+
239
+ await expect(resolvePlatformAssistantId()).resolves.toBe("");
240
+ expect(fetchCalls).toHaveLength(1);
241
+
242
+ process.env.VELLUM_PLATFORM_URL = BASE_URL;
243
+ fetchImpl = async () =>
244
+ new Response(
245
+ JSON.stringify({
246
+ assistant_id: ASSISTANT_ID,
247
+ organization_id: ORG_ID,
248
+ user_id: USER_ID,
249
+ }),
250
+ { status: 200 },
251
+ );
252
+
253
+ await expect(resolvePlatformAssistantId()).resolves.toBe(ASSISTANT_ID);
254
+ expect(fetchCalls).toHaveLength(2);
255
+ expect(fetchCalls[1]?.url).toBe(
256
+ `${BASE_URL}${PLATFORM_IDENTITY_VALIDATE_PATH}`,
257
+ );
258
+ });
259
+
201
260
  test("retries validate after a failed attempt once the cooldown is cleared", async () => {
202
261
  process.env.ASSISTANT_API_KEY = "assistant-key";
203
262
  setPlatformBaseUrl(BASE_URL);
@@ -0,0 +1,19 @@
1
+ import { describe, expect, test } from "bun:test";
2
+
3
+ import { orderProfileKeys } from "../profile-order.js";
4
+
5
+ describe("orderProfileKeys", () => {
6
+ test("orders named keys first, then the rest alphabetically, skipping unknown names", () => {
7
+ const profiles = { zeta: {}, balanced: {}, alpha: {} };
8
+ expect(
9
+ orderProfileKeys(profiles, ["balanced", "ghost", "balanced", "zeta"]),
10
+ ).toEqual(["balanced", "zeta", "alpha"]);
11
+ });
12
+
13
+ test("ignores order entries that only resolve through the prototype", () => {
14
+ const profiles = { balanced: {} };
15
+ expect(
16
+ orderProfileKeys(profiles, ["constructor", "toString", "balanced"]),
17
+ ).toEqual(["balanced"]);
18
+ });
19
+ });
@@ -368,4 +368,75 @@ describe("reconcileFlagGatedProfiles", () => {
368
368
  expect(reconcileFlagGatedProfiles()).toBe(false);
369
369
  expect(readFileSync(CONFIG_PATH, "utf-8")).toBe(before);
370
370
  });
371
+
372
+ test("auto-profile flag on materializes the managed auto profile at the head of the order", () => {
373
+ process.env.IS_PLATFORM = "true";
374
+ seedBalancedConfig();
375
+ setOverridesForTesting({ "auto-profile": true });
376
+
377
+ expect(reconcileFlagGatedProfiles()).toBe(true);
378
+
379
+ const raw = readConfig();
380
+ expect(raw.llm.profiles.auto).toEqual({ source: "managed" });
381
+ expect(raw.llm.profileOrder[0]).toBe("auto");
382
+ const effective = getEffectiveProfile(raw.llm.profiles, "auto")!;
383
+ expect(effective.label).toBe("Auto");
384
+ expect(effective.model).toBe(
385
+ getEffectiveProfile(raw.llm.profiles, "balanced")!.model,
386
+ );
387
+ expect(LLMSchema.safeParse(raw.llm).success).toBe(true);
388
+ });
389
+
390
+ test("auto-profile flag on in BYOK mode writes a plain stub that the effective view hides", () => {
391
+ seedBalancedConfig();
392
+ setOverridesForTesting({ "auto-profile": true });
393
+
394
+ expect(reconcileFlagGatedProfiles()).toBe(true);
395
+
396
+ const raw = readConfig();
397
+ expect(raw.llm.profiles.auto).toEqual({ source: "managed" });
398
+ expect(getEffectiveProfile(raw.llm.profiles, "auto")).toBeDefined();
399
+ });
400
+
401
+ test("auto-profile flag off removes the managed auto profile and repoints its references", () => {
402
+ process.env.IS_PLATFORM = "true";
403
+ seedBalancedConfig();
404
+ setOverridesForTesting({ "auto-profile": true });
405
+ reconcileFlagGatedProfiles();
406
+
407
+ const raw = readConfig();
408
+ raw.llm.activeProfile = "auto";
409
+ (raw.llm as Record<string, unknown>).callSites = {
410
+ subagentSpawn: { profile: "auto" },
411
+ };
412
+ writeConfig(raw);
413
+ invalidateConfigCache();
414
+
415
+ setOverridesForTesting({ "auto-profile": false });
416
+ expect(reconcileFlagGatedProfiles()).toBe(true);
417
+
418
+ const after = readConfig();
419
+ expect(after.llm.profiles.auto).toBeUndefined();
420
+ expect(after.llm.profileOrder.includes("auto")).toBe(false);
421
+ expect(after.llm.activeProfile).toBe("balanced");
422
+ expect((after.llm as Record<string, unknown>).callSites).toEqual({
423
+ subagentSpawn: {},
424
+ });
425
+ });
426
+
427
+ test("os-beta and auto-profile reconcile independently in one pass", () => {
428
+ process.env.IS_PLATFORM = "true";
429
+ seedBalancedConfig();
430
+ setOverridesForTesting({ "os-beta": true, "auto-profile": true });
431
+ expect(reconcileFlagGatedProfiles()).toBe(true);
432
+ let order = readConfig().llm.profileOrder;
433
+ expect(order[0]).toBe("auto");
434
+ expect(order.indexOf("os-beta")).toBe(order.indexOf("balanced") + 1);
435
+
436
+ setOverridesForTesting({ "os-beta": false, "auto-profile": true });
437
+ expect(reconcileFlagGatedProfiles()).toBe(true);
438
+ order = readConfig().llm.profileOrder;
439
+ expect(order[0]).toBe("auto");
440
+ expect(order.includes("os-beta")).toBe(false);
441
+ });
371
442
  });
@@ -37,6 +37,26 @@ The tree is walked to a limited depth to keep steps fast, and says when it was
37
37
  cut off. If the element you need is not in it, call `computer_use_observe` with
38
38
  `full_tree: true`.
39
39
 
40
+ ## Coordinates and live editing
41
+
42
+ Prefer element IDs from the latest observation. Click, scroll and drag
43
+ coordinates are **screen points**, not screenshot pixels. For a desktop
44
+ screenshot, use the per-axis conversion in its observation metadata. If you
45
+ crop or resize the image, map back to the original screenshot first. Observe
46
+ again after the layout changes; an older image is not a current target.
47
+
48
+ During live editing, use the app's zoom and track-height controls, then inspect
49
+ the fresh screenshot. Avoid installing image libraries or repeatedly cropping
50
+ and measuring screenshot pixels just to locate a UI control or waveform.
51
+ Reserve scripted image or media analysis for tasks that actually require it.
52
+ If an action does not produce the expected visible result, check focus and the
53
+ coordinate mapping before repeating it.
54
+
55
+ Waveform pixels do not reveal spoken words. If an edit depends on audio you
56
+ cannot hear or a boundary you cannot see, ask for a timestamp, a user-positioned
57
+ playhead, or the source media. Do not guess the cut point or claim an edit
58
+ succeeded without observing its result.
59
+
40
60
  ## Scripting apps (macOS)
41
61
 
42
62
  Reach for `computer_use_run_applescript` first when an app can be driven by