@vellumai/assistant 0.12.1-dev.202609161913.e2258d9 → 0.12.1-dev.202609162115.4edf01d

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 (85) hide show
  1. package/AGENTS.md +1 -1
  2. package/docs/architecture/integrations.md +7 -0
  3. package/docs/credential-execution-service.md +1 -1
  4. package/openapi.yaml +28 -0
  5. package/package.json +1 -1
  6. package/scripts/voice-ttft-spike.ts +2 -2
  7. package/src/__tests__/attachments-store.test.ts +22 -3
  8. package/src/__tests__/channel-reply-delivery.test.ts +56 -0
  9. package/src/__tests__/computer-use-screenshot-attachments.test.ts +411 -0
  10. package/src/__tests__/computer-use-screenshot-selection.test.ts +50 -0
  11. package/src/__tests__/conversation-agent-loop-inference-profile.test.ts +2 -0
  12. package/src/__tests__/conversation-agent-loop-overflow.test.ts +2 -0
  13. package/src/__tests__/conversation-agent-loop.test.ts +232 -6
  14. package/src/__tests__/conversation-attachments.test.ts +106 -0
  15. package/src/__tests__/conversation-fork-crud.test.ts +191 -0
  16. package/src/__tests__/credential-execution-client.test.ts +70 -53
  17. package/src/__tests__/events-tail-route.test.ts +33 -0
  18. package/src/__tests__/list-messages-tool-merge.test.ts +85 -1
  19. package/src/__tests__/oauth-commands-routes.test.ts +31 -113
  20. package/src/__tests__/persist-media-references.test.ts +50 -0
  21. package/src/__tests__/schedule-routes.test.ts +20 -0
  22. package/src/__tests__/scheduler-result-notification.test.ts +23 -4
  23. package/src/__tests__/secure-keys-managed-failover.test.ts +8 -0
  24. package/src/__tests__/secure-keys.test.ts +7 -3
  25. package/src/__tests__/skills.test.ts +5 -4
  26. package/src/__tests__/tool-result-metadata-plumbing.test.ts +63 -0
  27. package/src/api/attachment-provenance.test.ts +68 -0
  28. package/src/api/computer-use-tool.test.ts +55 -0
  29. package/src/api/computer-use-tool.ts +27 -0
  30. package/src/api/events/assistant-outbound-attachment.ts +3 -0
  31. package/src/api/index.ts +5 -0
  32. package/src/api/responses/conversation-message.ts +3 -0
  33. package/src/cli/commands/__tests__/schedules.test.ts +14 -0
  34. package/src/cli/commands/bash.help.ts +4 -3
  35. package/src/cli/commands/credentials.help.ts +3 -3
  36. package/src/cli/commands/schedules.ts +2 -0
  37. package/src/config/schemas/mcp.ts +5 -1
  38. package/src/credential-execution/ces-runtime.ts +2 -2
  39. package/src/credential-execution/executable-discovery.ts +36 -134
  40. package/src/credential-execution/process-manager.test.ts +20 -24
  41. package/src/credential-execution/process-manager.ts +24 -19
  42. package/src/daemon/__tests__/turn-tail-deleted-conversation.test.ts +36 -0
  43. package/src/daemon/assistant-attachments.ts +20 -12
  44. package/src/daemon/conversation-agent-loop-handlers.ts +74 -3
  45. package/src/daemon/conversation-agent-loop.ts +10 -0
  46. package/src/daemon/conversation-attachments.ts +93 -12
  47. package/src/daemon/conversation-turn-finalize.ts +26 -13
  48. package/src/daemon/lifecycle.ts +4 -4
  49. package/src/daemon/mcp-reload-service.ts +1 -1
  50. package/src/daemon/message-types/shared.ts +1 -0
  51. package/src/daemon/persist-media-references.ts +20 -3
  52. package/src/mcp/__tests__/manager-tool-caps.test.ts +111 -0
  53. package/src/mcp/__tests__/startup.test.ts +30 -7
  54. package/src/mcp/__tests__/tool-caps.test.ts +107 -0
  55. package/src/mcp/manager.ts +168 -101
  56. package/src/mcp/startup.ts +33 -13
  57. package/src/mcp/tool-caps.ts +176 -0
  58. package/src/oauth/seed-providers.ts +30 -0
  59. package/src/permissions/confirmation-guardian-request.test.ts +16 -0
  60. package/src/permissions/confirmation-guardian-request.ts +2 -3
  61. package/src/persistence/attachments-store.ts +84 -44
  62. package/src/persistence/conversation-crud.ts +111 -20
  63. package/src/persistence/conversation-types.test.ts +32 -0
  64. package/src/persistence/conversation-types.ts +26 -4
  65. package/src/plugins/defaults/memory/__tests__/buffer-file.test.ts +58 -13
  66. package/src/plugins/defaults/memory/src/memory-item-routes.test.ts +1 -1
  67. package/src/runtime/AGENTS.md +1 -1
  68. package/src/runtime/migrations/__tests__/vbundle-import-policy.test.ts +89 -0
  69. package/src/runtime/migrations/vbundle-import-policy.ts +33 -11
  70. package/src/runtime/routes/conversation-routes.ts +29 -4
  71. package/src/runtime/routes/oauth-commands-routes.ts +13 -53
  72. package/src/runtime/routes/oauth-request-hints.test.ts +246 -0
  73. package/src/runtime/routes/oauth-request-hints.ts +149 -0
  74. package/src/runtime/routes/schedule-routes.ts +2 -0
  75. package/src/schedule/__tests__/worker-mcp-bootstrap.test.ts +107 -0
  76. package/src/schedule/__tests__/worker-mcp-readiness.test.ts +173 -0
  77. package/src/schedule/__tests__/worker-mcp-tools.test.ts +13 -47
  78. package/src/schedule/scheduler.ts +47 -11
  79. package/src/schedule/tool-surface-readiness.ts +65 -0
  80. package/src/schedule/worker-mcp.ts +85 -0
  81. package/src/schedule/worker.ts +9 -31
  82. package/src/security/secure-keys.ts +60 -48
  83. package/src/tools/terminal/__tests__/safe-env.test.ts +4 -4
  84. package/src/tools/terminal/__tests__/sanitized-bash.test.ts +0 -14
  85. package/src/tools/terminal/safe-env.ts +5 -23
package/AGENTS.md CHANGED
@@ -16,7 +16,7 @@ When you introduce a new env var that the assistant process needs to read at run
16
16
 
17
17
  **Default to including it.** If the var doesn't contain secrets (e.g. a URL, a feature flag, a path, a mode string), add it. Only omit it if it carries credential material (tokens, passwords, private keys) — those must stay isolated to CES.
18
18
 
19
- `CES_LOCAL_SOCKET` is intentionally included despite the socket exposing credential RPCs: assistant subprocesses are expected to reach CES. Credential protection is rules-based access control inside CES, not socket-path secrecy (see root `AGENTS.md`). `CES_SERVICE_TOKEN` and `CES_CREDENTIAL_URL` are also forwarded: managed children still resolve connections through CES HTTP, and the socket path is not a sufficient substitute yet. See the comment on those keys in `src/tools/terminal/safe-env.ts` before attempting to strip them.
19
+ `CES_BOOTSTRAP_SOCKET_DIR` is forwarded so children can reach CES over IPC. `CES_SERVICE_TOKEN` and `CES_CREDENTIAL_URL` are also forwarded so children can fail over to CES HTTP until that transport is removed. Credential protection is rules-based access control inside CES, not socket-path secrecy (see root `AGENTS.md`).
20
20
 
21
21
  ## Daemon startup philosophy
22
22
 
@@ -552,6 +552,13 @@ Message content (stored as JSON `ContentBlock[]` in the DB) is flattened for the
552
552
 
553
553
  Attachments are materialized into `conversations/<conversation>/attachments/` as soon as they are linked to a message. During disk-view sync, the JSONL record reuses those filenames directly and only falls back to materializing legacy rows that have not been projected yet. Filename collisions are still resolved by appending a numeric suffix (e.g., `photo-2.png`, `photo-3.png`).
554
554
 
555
+ Computer-use screenshot media is materialized while its tool-result row is
556
+ finalized, so earlier frames remain represented in tool history, JSONL, and
557
+ compaction inputs. The final screenshot-bearing invocation reuses that same
558
+ attachment ID for an additional reply link. A single attachment can therefore
559
+ appear on both a tool-result row and a reply row without creating a second
560
+ attachment-store object.
561
+
555
562
  ### Backfill Migration
556
563
 
557
564
  Existing conversations created before the disk view was introduced are backfilled by workspace migration `009-backfill-conversation-disk-view`, which replays all conversations and their messages through the disk-view sync functions.
@@ -221,7 +221,7 @@ These invariants are enforced by guard tests and code review:
221
221
  4. **Grants and audit logs are CES-internal**: The assistant cannot read CES grant tables or audit logs directly. CES exposes grant status and audit summaries via RPC responses.
222
222
  5. **No generic authenticated HTTP clients in secure commands**: `curl`, `wget`, `httpie`, interpreters, and shell trampolines are structurally denied as secure command entrypoints. This is checked at manifest validation and re-checked at execution time.
223
223
  6. **Managed CES container runs as non-root**: The CES Docker image runs as `uid 1001` (user `ces`). The CES data volume is owned by this user.
224
- 7. **Single active bootstrap connection**: In managed mode, CES accepts one connection on the bootstrap socket and unlinks the socket path while that connection is live, so no second process can connect concurrently. CES is a long-lived sidecar: when the active session ends (the assistant disconnects or its container restarts), CES re-binds the socket and awaits the assistant's reconnection rather than shutting down. At most one connection is ever active; the sidecar only exits on SIGTERM/SIGINT.
224
+ 7. **Multi-connection bootstrap socket**: In managed mode, CES listens on the bootstrap socket as a concurrent multi-connection server and keeps the path bound. The assistant and its child processes each open their own RPC connection. CES is a long-lived sidecar: it stays up across assistant restarts and only exits on SIGTERM/SIGINT.
225
225
 
226
226
  ## Guarantees by deployment mode
227
227
 
package/openapi.yaml CHANGED
@@ -20992,6 +20992,8 @@ paths:
20992
20992
  type: string
20993
20993
  fileBacked:
20994
20994
  type: boolean
20995
+ computerUseScreenshot:
20996
+ type: boolean
20995
20997
  required:
20996
20998
  - id
20997
20999
  - filename
@@ -21999,6 +22001,8 @@ paths:
21999
22001
  type: string
22000
22002
  fileBacked:
22001
22003
  type: boolean
22004
+ computerUseScreenshot:
22005
+ type: boolean
22002
22006
  required:
22003
22007
  - id
22004
22008
  - filename
@@ -29138,6 +29142,8 @@ paths:
29138
29142
  - single_channel
29139
29143
  - multi_channel
29140
29144
  - all_channels
29145
+ quiet:
29146
+ type: boolean
29141
29147
  reuseConversation:
29142
29148
  type: boolean
29143
29149
  wakeConversationId:
@@ -29207,6 +29213,7 @@ paths:
29207
29213
  - mode
29208
29214
  - status
29209
29215
  - routingIntent
29216
+ - quiet
29210
29217
  - reuseConversation
29211
29218
  - wakeConversationId
29212
29219
  - workflowName
@@ -29386,6 +29393,8 @@ paths:
29386
29393
  - single_channel
29387
29394
  - multi_channel
29388
29395
  - all_channels
29396
+ quiet:
29397
+ type: boolean
29389
29398
  reuseConversation:
29390
29399
  type: boolean
29391
29400
  wakeConversationId:
@@ -29455,6 +29464,7 @@ paths:
29455
29464
  - mode
29456
29465
  - status
29457
29466
  - routingIntent
29467
+ - quiet
29458
29468
  - reuseConversation
29459
29469
  - wakeConversationId
29460
29470
  - workflowName
@@ -29586,6 +29596,8 @@ paths:
29586
29596
  - single_channel
29587
29597
  - multi_channel
29588
29598
  - all_channels
29599
+ quiet:
29600
+ type: boolean
29589
29601
  reuseConversation:
29590
29602
  type: boolean
29591
29603
  wakeConversationId:
@@ -29655,6 +29667,7 @@ paths:
29655
29667
  - mode
29656
29668
  - status
29657
29669
  - routingIntent
29670
+ - quiet
29658
29671
  - reuseConversation
29659
29672
  - wakeConversationId
29660
29673
  - workflowName
@@ -29783,6 +29796,8 @@ paths:
29783
29796
  - single_channel
29784
29797
  - multi_channel
29785
29798
  - all_channels
29799
+ quiet:
29800
+ type: boolean
29786
29801
  reuseConversation:
29787
29802
  type: boolean
29788
29803
  wakeConversationId:
@@ -29852,6 +29867,7 @@ paths:
29852
29867
  - mode
29853
29868
  - status
29854
29869
  - routingIntent
29870
+ - quiet
29855
29871
  - reuseConversation
29856
29872
  - wakeConversationId
29857
29873
  - workflowName
@@ -30040,6 +30056,8 @@ paths:
30040
30056
  - single_channel
30041
30057
  - multi_channel
30042
30058
  - all_channels
30059
+ quiet:
30060
+ type: boolean
30043
30061
  reuseConversation:
30044
30062
  type: boolean
30045
30063
  wakeConversationId:
@@ -30109,6 +30127,7 @@ paths:
30109
30127
  - mode
30110
30128
  - status
30111
30129
  - routingIntent
30130
+ - quiet
30112
30131
  - reuseConversation
30113
30132
  - wakeConversationId
30114
30133
  - workflowName
@@ -30240,6 +30259,8 @@ paths:
30240
30259
  - single_channel
30241
30260
  - multi_channel
30242
30261
  - all_channels
30262
+ quiet:
30263
+ type: boolean
30243
30264
  reuseConversation:
30244
30265
  type: boolean
30245
30266
  wakeConversationId:
@@ -30309,6 +30330,7 @@ paths:
30309
30330
  - mode
30310
30331
  - status
30311
30332
  - routingIntent
30333
+ - quiet
30312
30334
  - reuseConversation
30313
30335
  - wakeConversationId
30314
30336
  - workflowName
@@ -30443,6 +30465,8 @@ paths:
30443
30465
  - single_channel
30444
30466
  - multi_channel
30445
30467
  - all_channels
30468
+ quiet:
30469
+ type: boolean
30446
30470
  reuseConversation:
30447
30471
  type: boolean
30448
30472
  wakeConversationId:
@@ -30512,6 +30536,7 @@ paths:
30512
30536
  - mode
30513
30537
  - status
30514
30538
  - routingIntent
30539
+ - quiet
30515
30540
  - reuseConversation
30516
30541
  - wakeConversationId
30517
30542
  - workflowName
@@ -30782,6 +30807,8 @@ paths:
30782
30807
  - single_channel
30783
30808
  - multi_channel
30784
30809
  - all_channels
30810
+ quiet:
30811
+ type: boolean
30785
30812
  reuseConversation:
30786
30813
  type: boolean
30787
30814
  wakeConversationId:
@@ -30851,6 +30878,7 @@ paths:
30851
30878
  - mode
30852
30879
  - status
30853
30880
  - routingIntent
30881
+ - quiet
30854
30882
  - reuseConversation
30855
30883
  - wakeConversationId
30856
30884
  - workflowName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.12.1-dev.202609161913.e2258d9",
3
+ "version": "0.12.1-dev.202609162115.4edf01d",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -15,7 +15,7 @@
15
15
  * full-quality quality-optimized, full prompt + tools (pre-flag brain)
16
16
  *
17
17
  * Run with the daemon's environment so the managed connection resolves:
18
- * VELLUM_WORKSPACE_DIR=<daemon workspace> CES_LOCAL_SOCKET=<socket> \
18
+ * VELLUM_WORKSPACE_DIR=<daemon workspace> \
19
19
  * bun run scripts/voice-ttft-spike.ts [--trials 3] [--variants a,b]
20
20
  *
21
21
  * Outside the daemon env, credentials fall back to the encrypted file
@@ -217,7 +217,7 @@ async function main(): Promise<void> {
217
217
  if (!provider) {
218
218
  console.error(
219
219
  `${spec.name}: no provider resolved (managed credentials missing? ` +
220
- `run with the daemon's VELLUM_WORKSPACE_DIR + CES_LOCAL_SOCKET)`,
220
+ `run with the daemon's VELLUM_WORKSPACE_DIR)`,
221
221
  );
222
222
  continue;
223
223
  }
@@ -478,9 +478,9 @@ describe("createInlineAttachment (workspace_ref persistence)", () => {
478
478
  expect(filePath).toBeTruthy();
479
479
  expect(result.filename).toBeDefined();
480
480
  expect(filePath!.endsWith(result.filename!)).toBe(true);
481
- expect(result.filename!.startsWith(`${OVERSIZED_CONTENT_FILENAME_PREFIX}-`)).toBe(
482
- true,
483
- );
481
+ expect(
482
+ result.filename!.startsWith(`${OVERSIZED_CONTENT_FILENAME_PREFIX}-`),
483
+ ).toBe(true);
484
484
  expect(readFileSync(filePath!).toString("utf8")).toBe(original);
485
485
  });
486
486
  });
@@ -598,6 +598,25 @@ describe("linkAttachmentToMessage + getAttachmentsForMessage", () => {
598
598
  expect(linked[1].originalFilename).toBe("second.txt");
599
599
  });
600
600
 
601
+ test("reuses a repeated message attachment link with its original position", async () => {
602
+ const conv = createConversation();
603
+ const msg = await addMessage(conv.id, "assistant", "One file");
604
+ const stored = await uploadAttachment("frame.png", "image/png", "AAAA");
605
+
606
+ expect(linkAttachmentToMessage(msg.id, stored.id, 4)).toBe(stored.id);
607
+ expect(linkAttachmentToMessage(msg.id, stored.id, 0)).toBe(stored.id);
608
+
609
+ const links = rawGet<{ count: number; position: number }>(
610
+ "test:repeatedAttachmentLink",
611
+ `SELECT COUNT(*) AS count, MIN(position) AS position
612
+ FROM message_attachments
613
+ WHERE message_id = ? AND attachment_id = ?`,
614
+ msg.id,
615
+ stored.id,
616
+ );
617
+ expect(links).toEqual({ count: 1, position: 4 });
618
+ });
619
+
601
620
  test("returns empty for message with no attachments", async () => {
602
621
  const conv = createConversation();
603
622
  const msg = await addMessage(conv.id, "assistant", "No attachments");
@@ -588,6 +588,62 @@ describe("channel-reply-delivery", () => {
588
588
  expect(deliveryCalls[0].payload.text).toBe("Fallback text");
589
589
  });
590
590
 
591
+ it("delivers a screenshot-only reply attachment", async () => {
592
+ const screenshot: RuntimeAttachmentMetadata = {
593
+ id: "final-screenshot",
594
+ filename: "computer-use-click.png",
595
+ mimeType: "image/png",
596
+ sizeBytes: 10,
597
+ kind: "image",
598
+ };
599
+
600
+ await deliverRenderedReplyViaCallback({
601
+ callbackUrl: "http://gateway/deliver/telegram",
602
+ chatId: "chat-screenshot",
603
+ textSegments: [],
604
+ fallbackText: "",
605
+ attachments: [screenshot],
606
+ interSegmentDelayMs: 0,
607
+ });
608
+
609
+ expect(deliveryCalls).toHaveLength(1);
610
+ expect(deliveryCalls[0].payload).toMatchObject({
611
+ chatId: "chat-screenshot",
612
+ attachments: [screenshot],
613
+ });
614
+ });
615
+
616
+ it("delivers the final screenshot with an unrelated PDF", async () => {
617
+ const attachments: RuntimeAttachmentMetadata[] = [
618
+ {
619
+ id: "final-screenshot",
620
+ filename: "computer-use-click.png",
621
+ mimeType: "image/png",
622
+ sizeBytes: 10,
623
+ kind: "image",
624
+ },
625
+ {
626
+ id: "explicit-report",
627
+ filename: "report.pdf",
628
+ mimeType: "application/pdf",
629
+ sizeBytes: 20,
630
+ kind: "document",
631
+ },
632
+ ];
633
+
634
+ await deliverRenderedReplyViaCallback({
635
+ callbackUrl: "http://gateway/deliver/slack",
636
+ chatId: "chat-screenshot-pdf",
637
+ textSegments: ["Done."],
638
+ fallbackText: "Done.",
639
+ attachments,
640
+ interSegmentDelayMs: 0,
641
+ });
642
+
643
+ expect(deliveryCalls).toHaveLength(1);
644
+ expect(deliveryCalls[0].payload.attachments).toEqual(attachments);
645
+ });
646
+
591
647
  it("uses rendered textSegments (tool boundaries) when delivering from conversation history", async () => {
592
648
  conversationMessages.push(
593
649
  { id: "msg-user", role: "user", content: "hi" },