@vellumai/assistant 0.12.5-dev.202609260125.8a6a403 → 0.12.5-staging.1

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 (154) hide show
  1. package/ARCHITECTURE.md +0 -23
  2. package/docs/desktop-browser-cli.md +2 -3
  3. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/package.json +1 -2
  4. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/index.ts +0 -1
  5. package/node_modules/@vellumai/environments/src/shell.test.ts +1 -13
  6. package/node_modules/@vellumai/environments/src/shell.ts +1 -22
  7. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/package.json +1 -2
  8. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/index.ts +0 -1
  9. package/node_modules/@vellumai/service-contracts/package.json +1 -2
  10. package/node_modules/@vellumai/service-contracts/src/index.ts +0 -1
  11. package/openapi.yaml +1 -249
  12. package/package.json +1 -1
  13. package/src/__tests__/agent-loop.test.ts +0 -76
  14. package/src/__tests__/conversation-agent-loop-overflow.test.ts +73 -92
  15. package/src/__tests__/conversation-evictor.test.ts +0 -54
  16. package/src/__tests__/document-append-idempotency.test.ts +0 -13
  17. package/src/__tests__/document-create-dedupe.test.ts +0 -13
  18. package/src/__tests__/document-find-replace.test.ts +0 -13
  19. package/src/__tests__/document-tool-security.test.ts +0 -13
  20. package/src/__tests__/document-update-default-surface.test.ts +0 -13
  21. package/src/__tests__/emit-signal-routing-intent.test.ts +0 -111
  22. package/src/__tests__/gateway-flag-listener.test.ts +6 -59
  23. package/src/__tests__/host-cu-proxy.test.ts +0 -79
  24. package/src/__tests__/host-cu-routes-targeted.test.ts +5 -14
  25. package/src/__tests__/host-shell-tool.test.ts +2 -6
  26. package/src/__tests__/identity-routes.test.ts +3 -4
  27. package/src/__tests__/notification-platform-adapter.test.ts +1 -83
  28. package/src/__tests__/oauth2-gateway-transport.test.ts +0 -2
  29. package/src/__tests__/public-ingress-urls.test.ts +0 -26
  30. package/src/__tests__/usage-attribution.test.ts +0 -31
  31. package/src/acp/agent-process.ts +1 -6
  32. package/src/acp/client-handler.ts +1 -6
  33. package/src/agent/loop.ts +6 -29
  34. package/src/api/events/document-editor-show.ts +0 -5
  35. package/src/api/events/document-editor-update.ts +0 -10
  36. package/src/calls/__tests__/voice-session-bridge.test.ts +0 -54
  37. package/src/calls/twilio-provider.ts +31 -14
  38. package/src/calls/voice-session-bridge.ts +1 -18
  39. package/src/cli/commands/browser.ts +2 -1
  40. package/src/cli/lib/__tests__/plugin-catalog-visibility.test.ts +0 -2
  41. package/src/cli/lib/bundled-marketplace.json +2 -2
  42. package/src/cli/lib/plugin-artifact.ts +2 -3
  43. package/src/cli/lib/plugin-catalog-visibility.ts +0 -1
  44. package/src/cli.ts +3 -1
  45. package/src/config/bundled-skills/computer-use/SKILL.md +0 -20
  46. package/src/config/bundled-skills/computer-use/TOOLS.json +11 -11
  47. package/src/config/feature-flag-registry.json +1 -1
  48. package/src/config/loader.ts +1 -5
  49. package/src/config/schemas/conversations.ts +0 -14
  50. package/src/config/schemas/notifications.ts +1 -8
  51. package/src/daemon/conversation-agent-loop.ts +6 -11
  52. package/src/daemon/conversation-evictor.ts +16 -50
  53. package/src/daemon/doordash-steps.ts +3 -1
  54. package/src/daemon/host-cu-proxy.ts +3 -34
  55. package/src/daemon/lifecycle.ts +2 -15
  56. package/src/daemon/shutdown-handlers.ts +0 -3
  57. package/src/daemon/turn-finalization.ts +0 -4
  58. package/src/desktop/desktop-browser-endpoint.ts +0 -1
  59. package/src/desktop/desktop-chrome-policy.ts +0 -2
  60. package/src/desktop/desktop-computer-use.test.ts +4 -14
  61. package/src/desktop/desktop-session-manager.ts +2 -4
  62. package/src/documents/document-store.ts +133 -471
  63. package/src/inbound/__tests__/oauth-callback-url.test.ts +2 -25
  64. package/src/inbound/oauth-callback-url.ts +1 -30
  65. package/src/inbound/public-ingress-urls.ts +2 -12
  66. package/src/ipc/gateway-flag-listener.ts +10 -7
  67. package/src/live-voice/__tests__/live-voice-agent-turn.test.ts +0 -71
  68. package/src/live-voice/__tests__/live-voice-flux-turn-end.test.ts +0 -83
  69. package/src/live-voice/__tests__/protocol.test.ts +0 -77
  70. package/src/live-voice/live-voice-session.ts +6 -23
  71. package/src/live-voice/protocol.ts +0 -22
  72. package/src/mcp/__tests__/mcp-oauth-client-registration.test.ts +3 -144
  73. package/src/mcp/__tests__/mcp-oauth-provider.test.ts +0 -2
  74. package/src/mcp/mcp-oauth-provider.ts +49 -66
  75. package/src/monitoring/control.ts +1 -2
  76. package/src/monitoring/resource-sampler.ts +0 -30
  77. package/src/notifications/README.md +1 -12
  78. package/src/notifications/__tests__/broadcaster.test.ts +2 -259
  79. package/src/notifications/adapters/platform.ts +0 -14
  80. package/src/notifications/broadcaster.ts +9 -28
  81. package/src/notifications/completion-policy.ts +1 -5
  82. package/src/notifications/types.ts +0 -2
  83. package/src/oauth/connect-orchestrator.ts +2 -1
  84. package/src/persistence/conversation-crud.ts +1 -2
  85. package/src/persistence/embeddings/embed.ts +2 -20
  86. package/src/persistence/embeddings/embedding-gemini.test.ts +3 -39
  87. package/src/persistence/embeddings/embedding-gemini.ts +1 -39
  88. package/src/persistence/embeddings/embedding-local.ts +0 -6
  89. package/src/persistence/embeddings/qdrant-manager.ts +0 -5
  90. package/src/persistence/schema/conversations.ts +0 -1
  91. package/src/persistence/schema/documents.ts +0 -20
  92. package/src/persistence/steps.ts +0 -6
  93. package/src/plugins/defaults/empty-response/hooks/post-model-call.ts +6 -11
  94. package/src/providers/fireworks/client.ts +0 -24
  95. package/src/providers/retry.ts +0 -16
  96. package/src/providers/types.ts +2 -10
  97. package/src/providers/usage-tracking.ts +3 -5
  98. package/src/runtime/channel-retry-sweep.ts +2 -1
  99. package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +2 -375
  100. package/src/runtime/routes/conversation-query-routes.ts +10 -48
  101. package/src/runtime/routes/documents-routes.ts +47 -185
  102. package/src/runtime/routes/events-routes.ts +3 -1
  103. package/src/runtime/routes/host-cu-routes.ts +1 -3
  104. package/src/runtime/routes/identity-routes.ts +3 -3
  105. package/src/runtime/routes/notification-routes.ts +2 -1
  106. package/src/runtime/verification-templates.ts +2 -1
  107. package/src/tools/browser/browser-execution.ts +5 -6
  108. package/src/tools/browser/cdp-client/cdp-inspect/ws-transport.ts +3 -1
  109. package/src/tools/document/document-tool.ts +11 -13
  110. package/src/tools/executor.ts +2 -1
  111. package/src/tools/network/web-fetch.ts +4 -2
  112. package/src/tools/network/web-search.ts +8 -11
  113. package/src/tools/shared/filesystem/format-diff.ts +2 -1
  114. package/src/tools/terminal/shell.ts +3 -1
  115. package/src/tools/ui-surface/visual-validation.ts +2 -1
  116. package/src/usage/attribution.ts +1 -18
  117. package/src/util/worker-process.ts +0 -8
  118. package/docs/automatic-done.md +0 -32
  119. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +0 -53
  120. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +0 -60
  121. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +0 -53
  122. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +0 -60
  123. package/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +0 -53
  124. package/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +0 -60
  125. package/src/__tests__/document-revision-history.test.ts +0 -390
  126. package/src/__tests__/document-revision.test.ts +0 -425
  127. package/src/config/__tests__/chat-settings.test.ts +0 -121
  128. package/src/config/chat-settings.ts +0 -100
  129. package/src/conversations/__tests__/auto-archive-activity.test.ts +0 -136
  130. package/src/conversations/__tests__/auto-archive.test.ts +0 -304
  131. package/src/conversations/auto-archive-activity.ts +0 -61
  132. package/src/conversations/auto-archive.ts +0 -201
  133. package/src/daemon/computer-use-observation.test.ts +0 -81
  134. package/src/daemon/computer-use-observation.ts +0 -23
  135. package/src/documents/document-revisions-store.ts +0 -153
  136. package/src/live-voice/__tests__/share-targets.test.ts +0 -163
  137. package/src/live-voice/share-targets.ts +0 -243
  138. package/src/monitoring/__tests__/oom-inheritance-sweep.test.ts +0 -86
  139. package/src/monitoring/__tests__/oom-kill-reporter.test.ts +0 -262
  140. package/src/monitoring/oom-inheritance-sweep.ts +0 -96
  141. package/src/monitoring/oom-kill-reporter.ts +0 -345
  142. package/src/notifications/chat-reply-policy.ts +0 -11
  143. package/src/persistence/__tests__/conversation-auto-archive.test.ts +0 -330
  144. package/src/persistence/conversation-auto-archive.ts +0 -170
  145. package/src/persistence/embeddings/embed.test.ts +0 -96
  146. package/src/persistence/migrations/384-add-document-revision.test.ts +0 -83
  147. package/src/persistence/migrations/384-add-document-revision.ts +0 -21
  148. package/src/persistence/migrations/385-create-document-revisions.test.ts +0 -67
  149. package/src/persistence/migrations/385-create-document-revisions.ts +0 -28
  150. package/src/persistence/migrations/386-conversations-last-reopened-at.ts +0 -10
  151. package/src/persistence/migrations/__tests__/386-conversations-last-reopened-at.test.ts +0 -32
  152. package/src/providers/fireworks/client.test.ts +0 -168
  153. package/src/util/__tests__/oom-priority.test.ts +0 -55
  154. package/src/util/oom-priority.ts +0 -79
package/ARCHITECTURE.md CHANGED
@@ -45,12 +45,6 @@ Resource pressure monitoring reports sustained CPU/memory pressure on platform-h
45
45
 
46
46
  **Lifecycle:** `src/daemon/resource-pressure-guard-lifecycle.ts` starts the guard at daemon boot with the first sample deferred onto a macrotask so it never blocks startup, and stops the guard (cancelling any pending deferred sample) on shutdown. The web chat banner built on this status is documented in the repo-level [`/ARCHITECTURE.md`](../ARCHITECTURE.md) "Resource Pressure Monitoring" section.
47
47
 
48
- ### OOM Priority
49
-
50
- When the container hits its memory limit, the kernel kills the process with the highest `oom_score` (memory share plus `oom_score_adj`). `src/util/oom-priority.ts` steers that choice so the assistant is never the victim of a runaway tool: the daemon sets itself to -700 as the first thing in `runDaemon`, before any spawn. Children inherit the parent's value at fork, so every spawn path resets its child: shell children get +1000 from the Linux prefix in `buildShellInvocation` (`packages/environments`), desktop children and ACP agents and terminals get +1000 from `withOomScoreAdj`, an `sh -c ... exec` wrapper that keeps pid and process group, and workers, the embedding worker, and Qdrant get 0 from a parent-side write right after spawn (the resource monitor gets -500 so it outlives everything but the daemon and records the kill). The monitor also sweeps the daemon's descendants every few seconds (`src/monitoring/oom-inheritance-sweep.ts`) and writes 0 over any negative value it finds, logging the comm, so a spawn path that forgets the reset degrades to a few seconds of inherited protection instead of a protected runaway. Bundled plugins (the memory plugin's rerank worker, for one) rely on the sweep rather than importing the helper, since the plugin import boundary forbids reaching outside the plugin. Raising never needs a capability; lowering needs `CAP_SYS_RESOURCE`, which the platform grants and self-hosted Docker does not, where the daemon simply stays at 0. Nothing here caps a single process or acts early: it only decides who dies once the kernel has to kill.
51
-
52
- **Verification telemetry:** the resource monitor reports kernel OOM kills in the container as a `watchdog` event with `check_name` `oom_kill` (`src/monitoring/oom-kill-reporter.ts`). It reads the kernel log through `dmesg` (the `/dev/kmsg` device is not mounted in the container; `dmesg` uses the syslog syscall, which the Kata profile permits) when the cgroup `memory.events` kill counter moves, on its first scan after start (the kill that took the daemon down restarts the monitor with it), and once a minute as a fallback. The kernel log is shared by every container on that kernel and cgroup paths read `/` from inside, so attribution is by the counter: a move of N claims the N most recent new kills; the first scan and hosts without the counter claim every new kill and say so with `attribution: "kernel_log"`. The `detail` bag lists each victim's comm, `oom_score_adj` and resident size, the cgroup memory figures at the time, and `killed_daemon`, detected by the daemon's -700 score rather than a pid the restart has since replaced; where the log is unreadable a counter move still yields a victimless event. A cursor (kernel boot id plus last log timestamp) on the monitor data dir advances only after the event is queued, so a telemetry store outage delays a report rather than losing one, and resets when the kernel reboots.
53
-
54
48
  ### Single-Header JWT Auth Model
55
49
 
56
50
  All HTTP API requests use a single `Authorization: Bearer <jwt>` header for authentication. The JWT carries identity, permissions, and policy versioning in a unified token.
@@ -908,23 +902,6 @@ graph LR
908
902
 
909
903
  ---
910
904
 
911
- ## Automatic Done
912
-
913
- `src/conversations/auto-archive.ts` runs an opt-in automatic Done sweep after startup recovery, on assistant config or feature-flag invalidation, and hourly. It marks eligible inactive native chats through the existing `archived_at` state. Candidate selection and the conditional update share the same persisted eligibility predicates; runtime checks run synchronously with each conditional write. Explicit reopening records `last_reopened_at` to grant a full inactivity interval.
914
-
915
- ```mermaid
916
- flowchart LR
917
- TRIGGER[Startup recovery / config or feature-flag change / hourly timer] --> PAGE[Bounded candidate page]
918
- PAGE --> GUARDIAN[Read pending guardian requests]
919
- GUARDIAN --> CHECK[Recheck config and runtime activity]
920
- CHECK --> CAS[Conditional SQLite Done update]
921
- CAS --> SYNC[Conversation list and metadata invalidation]
922
- ```
923
-
924
- Readiness, eligibility, restart behavior, and the gateway snapshot boundary are documented in [Automatic Done](docs/automatic-done.md).
925
-
926
- ---
927
-
928
905
  ## Plugin-Declared Schedules: Declaration → Reconciler → cron_jobs
929
906
 
930
907
  Plugins contribute recurring schedules as a surface: directories under
@@ -53,9 +53,8 @@ Non-platform assistants keep their connected-computer behavior.
53
53
  Explicit `target: "connected-computer"` or `target_client_id` selects a connected
54
54
  computer on every client. The selected target never falls back to another
55
55
  computer when unavailable. The virtual desktop uses a fixed 1440x810 display.
56
- Observations return full-screen screenshots and mouse actions use screen
57
- points. Screenshot metadata uses the transport-optimized image dimensions and
58
- provides per-axis conversion from image pixels to those screen points.
56
+ Observations return full-screen screenshots and mouse actions use the same
57
+ screen coordinates.
59
58
  Viewer resizing scales the canvas locally without changing the desktop layout.
60
59
 
61
60
  Observe first and pass the returned `observation_id` with each native action.
@@ -28,8 +28,7 @@
28
28
  "./guardian-requests": "./src/guardian-requests.ts",
29
29
  "./platform-credential": "./src/platform-credential.ts",
30
30
  "./plan-credit": "./src/plan-credit.ts",
31
- "./integration-categories": "./src/integration-categories.ts",
32
- "./mcp-oauth": "./src/mcp-oauth.ts"
31
+ "./integration-categories": "./src/integration-categories.ts"
33
32
  },
34
33
  "scripts": {
35
34
  "typecheck": "bunx tsc --noEmit",
@@ -30,7 +30,6 @@ export * from "./ingress.js";
30
30
  export * from "./no-response.js";
31
31
  export * from "./plan-credit.js";
32
32
  export * from "./integration-categories.js";
33
- export * from "./mcp-oauth.js";
34
33
  export * from "./platform-credential.js";
35
34
  export * from "./remote-web-pairing.js";
36
35
  export * from "./twilio-ingress.js";
@@ -3,27 +3,15 @@ import { describe, expect, test } from "bun:test";
3
3
  import {
4
4
  buildShellInvocation,
5
5
  buildShellSpawnFlags,
6
- CHILD_OOM_SCORE_ADJ,
7
6
  pathListDelimiter,
8
7
  prependUniquePathEntries,
9
8
  } from "./shell.js";
10
9
 
11
10
  describe("buildShellInvocation", () => {
12
11
  test("uses Bash on POSIX hosts", () => {
13
- expect(buildShellInvocation("printf hello", "darwin")).toEqual({
14
- command: "bash",
15
- args: ["-c", "--", "printf hello"],
16
- });
17
- });
18
-
19
- test("raises the shell's OOM-kill priority on Linux", () => {
20
12
  expect(buildShellInvocation("printf hello", "linux")).toEqual({
21
13
  command: "bash",
22
- args: [
23
- "-c",
24
- "--",
25
- `echo ${CHILD_OOM_SCORE_ADJ} 2>/dev/null >/proc/self/oom_score_adj; printf hello`,
26
- ],
14
+ args: ["-c", "--", "printf hello"],
27
15
  });
28
16
  });
29
17
 
@@ -24,23 +24,6 @@ if (-not $__vellumCommandSucceeded) {
24
24
  }
25
25
  exit 0`;
26
26
 
27
- /**
28
- * `oom_score_adj` for assistant-owned tool processes. Any positive value
29
- * outranks a 0-scored process; 1000 makes a tool the kernel's first choice
30
- * whenever the container runs out of memory, so the assistant itself is never
31
- * the victim of a runaway command.
32
- */
33
- export const CHILD_OOM_SCORE_ADJ = 1000;
34
-
35
- /**
36
- * Prefix for a Bash `-c` script that raises the shell's own OOM-kill priority
37
- * before the command runs. Every process the command forks inherits it. Bash
38
- * performs a builtin's redirection itself, so `/proc/self` is the shell.
39
- * Redirections apply left to right, so stderr goes to /dev/null before the
40
- * procfs open can fail and complain about it.
41
- */
42
- const LINUX_OOM_SCORE_ADJ_PREFIX = `echo ${CHILD_OOM_SCORE_ADJ} 2>/dev/null >/proc/self/oom_score_adj; `;
43
-
44
27
  export function buildShellInvocation(
45
28
  command: string,
46
29
  hostPlatform: NodeJS.Platform = process.platform,
@@ -62,11 +45,7 @@ export function buildShellInvocation(
62
45
  ],
63
46
  };
64
47
  }
65
- const script =
66
- hostPlatform === "linux"
67
- ? `${LINUX_OOM_SCORE_ADJ_PREFIX}${command}`
68
- : command;
69
- return { command: "bash", args: ["-c", "--", script] };
48
+ return { command: "bash", args: ["-c", "--", command] };
70
49
  }
71
50
 
72
51
  /**
@@ -28,8 +28,7 @@
28
28
  "./guardian-requests": "./src/guardian-requests.ts",
29
29
  "./platform-credential": "./src/platform-credential.ts",
30
30
  "./plan-credit": "./src/plan-credit.ts",
31
- "./integration-categories": "./src/integration-categories.ts",
32
- "./mcp-oauth": "./src/mcp-oauth.ts"
31
+ "./integration-categories": "./src/integration-categories.ts"
33
32
  },
34
33
  "scripts": {
35
34
  "typecheck": "bunx tsc --noEmit",
@@ -30,7 +30,6 @@ export * from "./ingress.js";
30
30
  export * from "./no-response.js";
31
31
  export * from "./plan-credit.js";
32
32
  export * from "./integration-categories.js";
33
- export * from "./mcp-oauth.js";
34
33
  export * from "./platform-credential.js";
35
34
  export * from "./remote-web-pairing.js";
36
35
  export * from "./twilio-ingress.js";
@@ -28,8 +28,7 @@
28
28
  "./guardian-requests": "./src/guardian-requests.ts",
29
29
  "./platform-credential": "./src/platform-credential.ts",
30
30
  "./plan-credit": "./src/plan-credit.ts",
31
- "./integration-categories": "./src/integration-categories.ts",
32
- "./mcp-oauth": "./src/mcp-oauth.ts"
31
+ "./integration-categories": "./src/integration-categories.ts"
33
32
  },
34
33
  "scripts": {
35
34
  "typecheck": "bunx tsc --noEmit",
@@ -30,7 +30,6 @@ export * from "./ingress.js";
30
30
  export * from "./no-response.js";
31
31
  export * from "./plan-credit.js";
32
32
  export * from "./integration-categories.js";
33
- export * from "./mcp-oauth.js";
34
33
  export * from "./platform-credential.js";
35
34
  export * from "./remote-web-pairing.js";
36
35
  export * from "./twilio-ingress.js";
package/openapi.yaml CHANGED
@@ -12482,9 +12482,6 @@ paths:
12482
12482
  type: number
12483
12483
  updatedAt:
12484
12484
  type: number
12485
- revision:
12486
- description: Bumped by one on every write. Absent from assistants that predate document revisions.
12487
- type: number
12488
12485
  required:
12489
12486
  - surfaceId
12490
12487
  - conversationId
@@ -12499,10 +12496,7 @@ paths:
12499
12496
  post:
12500
12497
  operationId: documents_post
12501
12498
  summary: Save a document
12502
- description:
12503
- Create or upsert a document (by surfaceId). With `baseRevision`, an existing document is only overwritten
12504
- while its revision still equals `baseRevision`; otherwise the save is rejected with 409 CONFLICT and
12505
- `error.details` carries the current `revision`, `title`, and `content`.
12499
+ description: Create or upsert a document (by surfaceId).
12506
12500
  tags:
12507
12501
  - documents
12508
12502
  requestBody:
@@ -12527,13 +12521,6 @@ paths:
12527
12521
  wordCount:
12528
12522
  type: number
12529
12523
  description: Word count
12530
- baseRevision:
12531
- description:
12532
- The revision this save was edited from. When set and the stored revision differs, nothing is written and
12533
- the request fails with 409. Omit for an unconditional write.
12534
- type: integer
12535
- minimum: 0
12536
- maximum: 9007199254740991
12537
12524
  required:
12538
12525
  - surfaceId
12539
12526
  - conversationId
@@ -12553,9 +12540,6 @@ paths:
12553
12540
  const: true
12554
12541
  surfaceId:
12555
12542
  type: string
12556
- revision:
12557
- description: The document's revision after the save. Absent from assistants that predate document revisions.
12558
- type: number
12559
12543
  required:
12560
12544
  - success
12561
12545
  - surfaceId
@@ -12597,9 +12581,6 @@ paths:
12597
12581
  type: number
12598
12582
  updatedAt:
12599
12583
  type: number
12600
- revision:
12601
- description: Bumped by one on every write. Absent from assistants that predate document revisions.
12602
- type: number
12603
12584
  required:
12604
12585
  - success
12605
12586
  - surfaceId
@@ -13026,157 +13007,6 @@ paths:
13026
13007
  schema:
13027
13008
  type: string
13028
13009
  format: binary
13029
- /v1/documents/{id}/revisions:
13030
- get:
13031
- operationId: documents_by_id_revisions_get
13032
- summary: List a document's revisions
13033
- description: Return the document's history snapshots, newest first, without their content.
13034
- tags:
13035
- - documents
13036
- parameters:
13037
- - name: id
13038
- in: path
13039
- required: true
13040
- schema:
13041
- type: string
13042
- responses:
13043
- "200":
13044
- description: Successful response
13045
- content:
13046
- application/json:
13047
- schema:
13048
- type: object
13049
- properties:
13050
- revisions:
13051
- type: array
13052
- items:
13053
- type: object
13054
- properties:
13055
- revision:
13056
- type: number
13057
- description: The document revision this snapshot holds
13058
- author:
13059
- type: string
13060
- enum:
13061
- - user
13062
- - assistant
13063
- description: Who made the edit that replaced this state
13064
- createdAt:
13065
- type: number
13066
- description: When the snapshot was taken
13067
- wordCount:
13068
- type: number
13069
- title:
13070
- type: string
13071
- required:
13072
- - revision
13073
- - author
13074
- - createdAt
13075
- - wordCount
13076
- - title
13077
- additionalProperties: false
13078
- required:
13079
- - revisions
13080
- additionalProperties: false
13081
- /v1/documents/{id}/revisions/{revision}:
13082
- get:
13083
- operationId: documents_by_id_revisions_by_revision_get
13084
- summary: Get a document revision
13085
- description: Return one history snapshot with its content.
13086
- tags:
13087
- - documents
13088
- parameters:
13089
- - name: id
13090
- in: path
13091
- required: true
13092
- schema:
13093
- type: string
13094
- - name: revision
13095
- in: path
13096
- required: true
13097
- schema:
13098
- type: string
13099
- responses:
13100
- "200":
13101
- description: Successful response
13102
- content:
13103
- application/json:
13104
- schema:
13105
- type: object
13106
- properties:
13107
- revision:
13108
- type: number
13109
- description: The document revision this snapshot holds
13110
- author:
13111
- type: string
13112
- enum:
13113
- - user
13114
- - assistant
13115
- description: Who made the edit that replaced this state
13116
- createdAt:
13117
- type: number
13118
- description: When the snapshot was taken
13119
- wordCount:
13120
- type: number
13121
- title:
13122
- type: string
13123
- content:
13124
- type: string
13125
- required:
13126
- - revision
13127
- - author
13128
- - createdAt
13129
- - wordCount
13130
- - title
13131
- - content
13132
- additionalProperties: false
13133
- /v1/documents/{id}/revisions/{revision}/restore:
13134
- post:
13135
- operationId: documents_by_id_revisions_by_revision_restore_post
13136
- summary: Restore a document revision
13137
- description:
13138
- Write a snapshot's title and content back as a new revision. The current state is snapshotted first, so the
13139
- restore can itself be undone.
13140
- tags:
13141
- - documents
13142
- parameters:
13143
- - name: id
13144
- in: path
13145
- required: true
13146
- schema:
13147
- type: string
13148
- - name: revision
13149
- in: path
13150
- required: true
13151
- schema:
13152
- type: string
13153
- responses:
13154
- "200":
13155
- description: Successful response
13156
- content:
13157
- application/json:
13158
- schema:
13159
- type: object
13160
- properties:
13161
- success:
13162
- type: boolean
13163
- const: true
13164
- surfaceId:
13165
- type: string
13166
- revision:
13167
- type: number
13168
- description: The document's revision after the restore
13169
- title:
13170
- type: string
13171
- content:
13172
- type: string
13173
- required:
13174
- - success
13175
- - surfaceId
13176
- - revision
13177
- - title
13178
- - content
13179
- additionalProperties: false
13180
13010
  /v1/documents/create:
13181
13011
  post:
13182
13012
  operationId: documents_create_post
@@ -13223,9 +13053,6 @@ paths:
13223
13053
  type: number
13224
13054
  updatedAt:
13225
13055
  type: number
13226
- revision:
13227
- description: Bumped by one on every write. Absent from assistants that predate document revisions.
13228
- type: number
13229
13056
  required:
13230
13057
  - success
13231
13058
  - surfaceId
@@ -14462,8 +14289,6 @@ paths:
14462
14289
  type: boolean
14463
14290
  appPins:
14464
14291
  type: boolean
14465
- chatsSettings:
14466
- type: boolean
14467
14292
  required:
14468
14293
  - memoryOptOut
14469
14294
  - retryLastTurn
@@ -14698,8 +14523,6 @@ paths:
14698
14523
  type: boolean
14699
14524
  appPins:
14700
14525
  type: boolean
14701
- chatsSettings:
14702
- type: boolean
14703
14526
  required:
14704
14527
  - memoryOptOut
14705
14528
  - retryLastTurn
@@ -38731,41 +38554,6 @@ components:
38731
38554
  ConfigPatchRequest:
38732
38555
  type: object
38733
38556
  properties:
38734
- conversations:
38735
- anyOf:
38736
- - type: object
38737
- properties:
38738
- autoArchive:
38739
- anyOf:
38740
- - type: object
38741
- properties:
38742
- enabled:
38743
- anyOf:
38744
- - type: boolean
38745
- - type: "null"
38746
- afterDays:
38747
- anyOf:
38748
- - type: number
38749
- enum:
38750
- - 1
38751
- - 7
38752
- - 14
38753
- - 30
38754
- - type: "null"
38755
- additionalProperties: {}
38756
- - type: "null"
38757
- additionalProperties: {}
38758
- - type: "null"
38759
- notifications:
38760
- anyOf:
38761
- - type: object
38762
- properties:
38763
- newMessageEnabled:
38764
- anyOf:
38765
- - type: boolean
38766
- - type: "null"
38767
- additionalProperties: {}
38768
- - type: "null"
38769
38557
  llm:
38770
38558
  type: object
38771
38559
  properties:
@@ -39499,42 +39287,6 @@ components:
39499
39287
  ConfigGetResponse:
39500
39288
  type: object
39501
39289
  properties:
39502
- conversations:
39503
- type: object
39504
- properties:
39505
- autoArchive:
39506
- type: object
39507
- properties:
39508
- enabled:
39509
- default: false
39510
- description: Automatically mark eligible inactive chats Done.
39511
- type: boolean
39512
- afterDays:
39513
- default: 7
39514
- description: Elapsed days of inactivity before a chat is eligible for Done.
39515
- type: number
39516
- enum:
39517
- - 1
39518
- - 7
39519
- - 14
39520
- - 30
39521
- required:
39522
- - enabled
39523
- - afterDays
39524
- additionalProperties: {}
39525
- required:
39526
- - autoArchive
39527
- additionalProperties: {}
39528
- notifications:
39529
- type: object
39530
- properties:
39531
- newMessageEnabled:
39532
- default: true
39533
- description: Allow ordinary chat-reply alerts. Does not change unread state or action-required alerts.
39534
- type: boolean
39535
- required:
39536
- - newMessageEnabled
39537
- additionalProperties: {}
39538
39290
  llm:
39539
39291
  type: object
39540
39292
  properties:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.12.5-dev.202609260125.8a6a403",
3
+ "version": "0.12.5-staging.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -181,82 +181,6 @@ describe("AgentLoop", () => {
181
181
  expect(calls[1].options?.config?.overrideProfile).toBe("quality-optimized");
182
182
  });
183
183
 
184
- test("the auto origin follows the routed override and drops once a switch replaces it", async () => {
185
- const toolCallId = "tool-1";
186
- const { provider, calls } = createMockProvider([
187
- toolUseResponse(toolCallId, "read_file", { path: "/tmp/test.txt" }),
188
- textResponse("done"),
189
- ]);
190
- let overrideProfile = "quality-optimized";
191
- const loop = new AgentLoop({
192
- provider: provider,
193
- systemPrompt: "system",
194
- conversationId: "test-conversation",
195
- tools: dummyTools,
196
- toolExecutor: async () => {
197
- // A confirmed profile session mid-turn: the user's pick, not Auto's.
198
- overrideProfile = "cost-optimized";
199
- return { content: "ok", isError: false };
200
- },
201
- });
202
-
203
- await loop.run({
204
- messages: [userMessage],
205
- onEvent: collectEvents([]),
206
- trust: { sourceChannel: "vellum", trustClass: "unknown" },
207
- requestId: "req-1",
208
- callSite: "mainAgent",
209
- overrideProfile: "quality-optimized",
210
- overrideProfileOrigin: "auto",
211
- resolveOverrideProfile: () => overrideProfile,
212
- });
213
-
214
- expect(calls).toHaveLength(2);
215
- expect(calls[0].options?.config?.overrideProfile).toBe("quality-optimized");
216
- expect(calls[0].options?.config?.overrideProfileOrigin).toBe("auto");
217
- expect(calls[1].options?.config?.overrideProfile).toBe("cost-optimized");
218
- expect(calls[1].options?.config?.overrideProfileOrigin).toBeUndefined();
219
- });
220
-
221
- test("a pre-model-call hook keeps the auto origin unless it changes the profile", async () => {
222
- let hookProfile: string | null | undefined;
223
- registerPlugin({
224
- manifest: { name: "profile-hook", version: "0.0.1" },
225
- hooks: {
226
- "pre-model-call": async (ctx) =>
227
- hookProfile === undefined
228
- ? ctx
229
- : { ...ctx, modelProfile: hookProfile },
230
- },
231
- });
232
- const run = async () => {
233
- const { provider, calls } = createMockProvider([textResponse("ok")]);
234
- const loop = new AgentLoop({
235
- provider: provider,
236
- systemPrompt: "system",
237
- conversationId: "test-conversation",
238
- tools: dummyTools,
239
- });
240
- await loop.run({
241
- messages: [userMessage],
242
- onEvent: collectEvents([]),
243
- trust: { sourceChannel: "vellum", trustClass: "unknown" },
244
- requestId: "req-1",
245
- callSite: "mainAgent",
246
- overrideProfile: "quality-optimized",
247
- overrideProfileOrigin: "auto",
248
- });
249
- return calls[0].options?.config;
250
- };
251
-
252
- hookProfile = undefined;
253
- expect((await run())?.overrideProfileOrigin).toBe("auto");
254
- hookProfile = "cost-optimized";
255
- expect((await run())?.overrideProfileOrigin).toBeUndefined();
256
- hookProfile = null;
257
- expect((await run())?.overrideProfileOrigin).toBeUndefined();
258
- });
259
-
260
184
  test("re-resolves max input tokens before truncating tool results", async () => {
261
185
  const toolCallId = "tool-1";
262
186
  const toolOutput = "x".repeat(2_500);