@vellumai/assistant 0.4.37 → 0.4.41

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 (169) hide show
  1. package/ARCHITECTURE.md +3 -3
  2. package/README.md +13 -13
  3. package/bun.lock +80 -24
  4. package/docs/architecture/integrations.md +126 -128
  5. package/docs/runbook-trusted-contacts.md +1 -1
  6. package/docs/trusted-contact-access.md +12 -12
  7. package/package.json +3 -1
  8. package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +0 -14
  9. package/src/__tests__/app-bundler.test.ts +209 -0
  10. package/src/__tests__/app-compiler.test.ts +279 -0
  11. package/src/__tests__/app-executors.test.ts +293 -483
  12. package/src/__tests__/app-migration.test.ts +148 -0
  13. package/src/__tests__/app-routes-csp.test.ts +202 -0
  14. package/src/__tests__/avatar-e2e.test.ts +452 -0
  15. package/src/__tests__/avatar-generator.test.ts +193 -0
  16. package/src/__tests__/avatar-router.test.ts +186 -0
  17. package/src/__tests__/browser-download-timeout.test.ts +28 -0
  18. package/src/__tests__/bundled-skill-retrieval-guard.test.ts +9 -9
  19. package/src/__tests__/call-domain.test.ts +3 -7
  20. package/src/__tests__/credential-security-e2e.test.ts +19 -12
  21. package/src/__tests__/credentials-cli.test.ts +30 -4
  22. package/src/__tests__/guardian-verify-setup-skill-regression.test.ts +1 -1
  23. package/src/__tests__/handlers-slack-config.test.ts +0 -72
  24. package/src/__tests__/handlers-telegram-config.test.ts +19 -12
  25. package/src/__tests__/handlers-twitter-config.test.ts +105 -48
  26. package/src/__tests__/inbound-invite-redemption.test.ts +4 -4
  27. package/src/__tests__/integration-status.test.ts +15 -5
  28. package/src/__tests__/integrations-cli.test.ts +1 -1
  29. package/src/__tests__/invite-redemption-service.test.ts +62 -7
  30. package/src/__tests__/ipc-snapshot.test.ts +0 -8
  31. package/src/__tests__/managed-avatar-client.test.ts +280 -0
  32. package/src/__tests__/mcp-cli.test.ts +3 -3
  33. package/src/__tests__/oauth-cli.test.ts +203 -0
  34. package/src/__tests__/relay-server.test.ts +3 -3
  35. package/src/__tests__/secret-onetime-send.test.ts +19 -12
  36. package/src/__tests__/secure-keys.test.ts +78 -0
  37. package/src/__tests__/session-messaging-secret-redirect.test.ts +3 -0
  38. package/src/__tests__/slack-channel-config.test.ts +23 -16
  39. package/src/__tests__/slack-share-routes.test.ts +263 -0
  40. package/src/__tests__/sms-messaging-provider.test.ts +3 -1
  41. package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +7 -7
  42. package/src/__tests__/trusted-contact-multichannel.test.ts +3 -3
  43. package/src/__tests__/trusted-contact-verification.test.ts +10 -10
  44. package/src/__tests__/twilio-config.test.ts +15 -36
  45. package/src/__tests__/twilio-provider.test.ts +4 -0
  46. package/src/__tests__/twitter-auth-handler.test.ts +27 -14
  47. package/src/__tests__/twitter-cli-error-shaping.test.ts +1 -1
  48. package/src/__tests__/twitter-cli-routing.test.ts +38 -53
  49. package/src/__tests__/twitter-oauth-client.test.ts +18 -47
  50. package/src/__tests__/voice-invite-redemption.test.ts +27 -3
  51. package/src/amazon/cart.ts +1 -1
  52. package/src/amazon/client.ts +89 -7
  53. package/src/approvals/guardian-request-resolvers.ts +2 -2
  54. package/src/bundler/app-bundler.ts +77 -32
  55. package/src/bundler/app-compiler.ts +195 -0
  56. package/src/bundler/manifest.ts +1 -1
  57. package/src/bundler/package-resolver.ts +185 -0
  58. package/src/calls/call-domain.ts +4 -14
  59. package/src/calls/relay-server.ts +2 -2
  60. package/src/calls/twilio-config.ts +5 -24
  61. package/src/calls/twilio-rest.ts +19 -5
  62. package/src/cli/amazon.ts +74 -249
  63. package/src/cli/audit.ts +2 -2
  64. package/src/cli/autonomy.ts +9 -9
  65. package/src/cli/channels.ts +5 -5
  66. package/src/cli/completions.ts +27 -27
  67. package/src/cli/config.ts +14 -14
  68. package/src/cli/contacts.ts +27 -27
  69. package/src/cli/credentials.ts +28 -28
  70. package/src/cli/dev.ts +2 -2
  71. package/src/cli/doctor.ts +2 -2
  72. package/src/cli/email.ts +82 -82
  73. package/src/cli/influencer.ts +13 -13
  74. package/src/cli/integrations.ts +19 -144
  75. package/src/cli/keys.ts +10 -10
  76. package/src/cli/map.ts +4 -4
  77. package/src/cli/mcp.ts +17 -17
  78. package/src/cli/memory.ts +18 -18
  79. package/src/cli/notifications.ts +13 -13
  80. package/src/cli/oauth.ts +77 -0
  81. package/src/cli/program.ts +2 -0
  82. package/src/cli/sequence.ts +27 -27
  83. package/src/cli/sessions.ts +12 -12
  84. package/src/cli/trust.ts +8 -8
  85. package/src/cli/twitter.ts +124 -70
  86. package/src/config/bundled-skills/_shared/CLI_RETRIEVAL_PATTERN.md +1 -1
  87. package/src/config/bundled-skills/agentmail/SKILL.md +34 -34
  88. package/src/config/bundled-skills/amazon/SKILL.md +54 -54
  89. package/src/config/bundled-skills/app-builder/SKILL.md +137 -3
  90. package/src/config/bundled-skills/app-builder/tools/app-create.ts +10 -4
  91. package/src/config/bundled-skills/configure-settings/SKILL.md +18 -18
  92. package/src/config/bundled-skills/contacts/SKILL.md +12 -12
  93. package/src/config/bundled-skills/doordash/lib/client.ts +7 -9
  94. package/src/config/bundled-skills/email-setup/SKILL.md +4 -4
  95. package/src/config/bundled-skills/frontend-design/icon.svg +16 -0
  96. package/src/config/bundled-skills/google-oauth-setup/SKILL.md +143 -162
  97. package/src/config/bundled-skills/guardian-verify-setup/SKILL.md +4 -4
  98. package/src/config/bundled-skills/influencer/SKILL.md +13 -13
  99. package/src/config/bundled-skills/mcp-setup/SKILL.md +11 -11
  100. package/src/config/bundled-skills/phone-calls/SKILL.md +48 -54
  101. package/src/config/bundled-skills/public-ingress/SKILL.md +6 -6
  102. package/src/config/bundled-skills/slack-app-setup/SKILL.md +1 -1
  103. package/src/config/bundled-skills/sms-setup/SKILL.md +3 -3
  104. package/src/config/bundled-skills/telegram-setup/SKILL.md +2 -2
  105. package/src/config/bundled-skills/twilio-setup/SKILL.md +136 -225
  106. package/src/config/bundled-skills/twitter/SKILL.md +68 -44
  107. package/src/config/bundled-skills/voice-setup/SKILL.md +2 -2
  108. package/src/config/core-schema.ts +26 -0
  109. package/src/config/env.ts +4 -0
  110. package/src/config/feature-flag-registry.json +9 -1
  111. package/src/config/schema.ts +8 -0
  112. package/src/config/system-prompt.ts +6 -3
  113. package/src/config/templates/BOOTSTRAP.md +7 -5
  114. package/src/contacts/contacts-write.ts +5 -1
  115. package/src/daemon/handlers/apps.ts +31 -4
  116. package/src/daemon/handlers/config-ingress.ts +3 -3
  117. package/src/daemon/handlers/config-integrations.ts +120 -49
  118. package/src/daemon/handlers/config-slack-channel.ts +26 -7
  119. package/src/daemon/handlers/config-slack.ts +1 -54
  120. package/src/daemon/handlers/config-telegram.ts +28 -10
  121. package/src/daemon/handlers/config.ts +1 -4
  122. package/src/daemon/handlers/twitter-auth.ts +11 -4
  123. package/src/daemon/ipc-contract/apps.ts +0 -13
  124. package/src/daemon/ipc-contract-inventory.json +0 -2
  125. package/src/daemon/lifecycle.ts +8 -1
  126. package/src/daemon/session-messaging.ts +2 -2
  127. package/src/daemon/tool-side-effects.ts +30 -0
  128. package/src/email/providers/agentmail.ts +1 -1
  129. package/src/email/providers/index.ts +1 -1
  130. package/src/email/service.ts +1 -1
  131. package/src/gallery/default-gallery.ts +538 -0
  132. package/src/gallery/gallery-manifest.ts +5 -1
  133. package/src/influencer/client.ts +8 -6
  134. package/src/mcp/client.ts +1 -1
  135. package/src/media/avatar-router.ts +99 -0
  136. package/src/media/avatar-types.ts +60 -0
  137. package/src/media/managed-avatar-client.ts +189 -0
  138. package/src/memory/app-migration.ts +114 -0
  139. package/src/memory/app-store.ts +11 -0
  140. package/src/memory/qdrant-client.ts +1 -1
  141. package/src/messaging/providers/slack/client.ts +12 -2
  142. package/src/messaging/providers/sms/adapter.ts +6 -10
  143. package/src/migrations/data-layout.ts +8 -1
  144. package/src/oauth/token-persistence.ts +9 -6
  145. package/src/runtime/assistant-scope.ts +5 -0
  146. package/src/runtime/auth/route-policy.ts +4 -0
  147. package/src/runtime/channel-readiness-service.ts +9 -4
  148. package/src/runtime/gateway-internal-client.ts +11 -3
  149. package/src/runtime/http-server.ts +2 -0
  150. package/src/runtime/invite-redemption-service.ts +23 -13
  151. package/src/runtime/middleware/twilio-validation.ts +2 -2
  152. package/src/runtime/routes/app-routes.ts +131 -3
  153. package/src/runtime/routes/inbound-stages/verification-intercept.ts +3 -3
  154. package/src/runtime/routes/integration-routes.ts +2 -2
  155. package/src/runtime/routes/slack-share-routes.ts +235 -0
  156. package/src/runtime/routes/twilio-routes.ts +47 -34
  157. package/src/schedule/integration-status.ts +2 -3
  158. package/src/security/token-manager.ts +11 -3
  159. package/src/tools/apps/executors.ts +116 -8
  160. package/src/tools/browser/browser-manager.ts +30 -2
  161. package/src/tools/browser/chrome-cdp.ts +31 -3
  162. package/src/tools/credentials/vault.ts +9 -7
  163. package/src/tools/executor.ts +4 -0
  164. package/src/tools/system/avatar-generator.ts +55 -34
  165. package/src/twitter/client.ts +1 -1
  166. package/src/twitter/oauth-client.ts +31 -43
  167. package/src/twitter/router.ts +25 -23
  168. package/src/util/platform.ts +5 -0
  169. package/src/slack/slack-webhook.ts +0 -66
package/src/cli/amazon.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  /**
2
- * CLI command group: `vellum amazon`
2
+ * CLI command group: `assistant amazon`
3
3
  *
4
4
  * Shop on Amazon and Amazon Fresh via the command line.
5
5
  * All commands output JSON to stdout. Use --json for machine-readable output.
6
6
  */
7
7
 
8
- import * as net from "node:net";
9
-
10
8
  import { Command } from "commander";
11
9
 
12
10
  import {
@@ -16,22 +14,19 @@ import {
16
14
  getPaymentMethods,
17
15
  getProductDetails,
18
16
  placeOrder,
17
+ refreshSessionFromExtension,
19
18
  removeFromCart,
20
19
  search,
21
20
  selectFreshDeliverySlot,
22
21
  SessionExpiredError,
23
22
  viewCart,
24
23
  } from "../amazon/client.js";
25
- import { extractRequests, saveRequests } from "../amazon/request-extractor.js";
26
24
  import {
27
25
  clearSession,
28
26
  importFromRecording,
29
27
  loadSession,
30
28
  saveSession,
31
29
  } from "../amazon/session.js";
32
- import { createMessageParser, serialize } from "../daemon/ipc-protocol.js";
33
- import { loadRecording } from "../tools/browser/recording-store.js";
34
- import { getSocketPath, readSessionToken } from "../util/platform.js";
35
30
 
36
31
  // ---------------------------------------------------------------------------
37
32
  // Helpers
@@ -115,11 +110,11 @@ WARNING: "order place" is IRREVERSIBLE — it charges the user's payment method
115
110
  places a real Amazon order. Always confirm with the user before running it.
116
111
 
117
112
  Examples:
118
- $ vellum amazon status
119
- $ vellum amazon refresh
120
- $ vellum amazon search "AA batteries" --limit 5
121
- $ vellum amazon cart add --asin B07XXXXX --quantity 2
122
- $ vellum amazon order place --payment-method-id pm_abc123`,
113
+ $ assistant amazon status
114
+ $ assistant amazon refresh
115
+ $ assistant amazon search "AA batteries" --limit 5
116
+ $ assistant amazon cart add --asin B07XXXXX --quantity 2
117
+ $ assistant amazon order place --payment-method-id pm_abc123`,
123
118
  );
124
119
 
125
120
  // =========================================================================
@@ -138,8 +133,8 @@ session. Typically used to restore a session from a saved recording rather than
138
133
  re-authenticating via "refresh".
139
134
 
140
135
  Examples:
141
- $ vellum amazon login --recording /path/to/recording.json
142
- $ vellum amazon login --recording ~/recordings/amazon-2024-01-15.json`,
136
+ $ assistant amazon login --recording /path/to/recording.json
137
+ $ assistant amazon login --recording ~/recordings/amazon-2024-01-15.json`,
143
138
  )
144
139
  .action(async (opts: { recording: string }, cmd: Command) => {
145
140
  await run(cmd, async () => {
@@ -166,7 +161,7 @@ all shopping commands will fail until a new session is established via
166
161
  "refresh", "refresh-headless", or "login".
167
162
 
168
163
  Examples:
169
- $ vellum amazon logout`,
164
+ $ assistant amazon logout`,
170
165
  )
171
166
  .action((_opts: unknown, cmd: Command) => {
172
167
  clearSession();
@@ -174,94 +169,41 @@ Examples:
174
169
  });
175
170
 
176
171
  // =========================================================================
177
- // refresh — start Ride Shotgun learn to capture fresh cookies
172
+ // refresh — grab Amazon cookies from Chrome via browser extension
178
173
  // =========================================================================
179
174
  amz
180
175
  .command("refresh")
181
176
  .description(
182
- "Start a Ride Shotgun learn session to capture fresh Amazon cookies. " +
183
- "Opens amazon.com in a separate Chrome window sign in when prompted. " +
184
- "Your existing Chrome and tabs are not affected.",
177
+ "Refresh Amazon session by grabbing cookies from Chrome via the browser extension. " +
178
+ "Requires the Vellum Chrome extension to be loaded and connected.",
185
179
  )
186
- .option("--duration <seconds>", "Recording duration in seconds", "180")
187
180
  .addHelpText(
188
181
  "after",
189
182
  `
190
- Opens amazon.com in a separate Chrome window via Ride Shotgun and starts a
191
- learn session to capture session cookies. The user must sign into Amazon when
192
- prompted. The existing Chrome profile and open tabs are not affected — a
193
- separate Chrome instance is launched.
194
-
195
- The recording runs for --duration seconds (default: 180). After completion,
196
- captured cookies are automatically imported as the active session. Request
197
- templates are also extracted for self-healing capabilities.
183
+ Grabs Amazon session cookies directly from Chrome via the browser extension
184
+ relay. Much faster than the old Ride Shotgun approach no separate Chrome
185
+ instance is launched. Requires the Vellum Chrome extension to be loaded
186
+ and connected.
198
187
 
199
- After cookie capture, the Chrome window is minimized automatically.
188
+ If this fails, try "refresh-headless" which reads cookies from Chrome's
189
+ local SQLite database instead.
200
190
 
201
191
  Examples:
202
- $ vellum amazon refresh
203
- $ vellum amazon refresh --duration 120`,
192
+ $ assistant amazon refresh
193
+ $ assistant amazon refresh --json`,
204
194
  )
205
- .action(async (opts: { duration: string }, cmd: Command) => {
195
+ .action(async (_opts: unknown, cmd: Command) => {
206
196
  const json = getJson(cmd);
207
- const duration = parseInt(opts.duration, 10);
208
-
209
197
  try {
210
- // Restore minimized Chrome window so user can see the login page
211
- try {
212
- await restoreChromeWindow();
213
- } catch {
214
- /* best-effort */
215
- }
216
-
217
- const result = await startLearnSession(duration);
218
- if (result.recordingPath) {
219
- const session = importFromRecording(result.recordingPath);
220
-
221
- // Also extract and save captured request templates for self-healing
222
- let requestsCaptured = 0;
223
- try {
224
- const recording = loadRecording(result.recordingId ?? "");
225
- if (recording) {
226
- const requests = extractRequests(recording);
227
- if (requests.length > 0) {
228
- saveRequests(requests);
229
- requestsCaptured = requests.length;
230
- }
231
- }
232
- } catch {
233
- // Non-fatal: request extraction is best-effort
234
- }
235
-
236
- // Best-effort: minimize Chrome window after capturing session
237
- try {
238
- await minimizeChromeWindow();
239
- process.stderr.write("[amazon] Chrome window minimized\n");
240
- } catch {
241
- // Non-fatal: minimizing is best-effort
242
- }
243
-
244
- output(
245
- {
246
- ok: true,
247
- message: "Session refreshed successfully",
248
- cookieCount: session.cookies.length,
249
- recordingId: result.recordingId,
250
- requestsCaptured,
251
- },
252
- json,
253
- );
254
- } else {
255
- output(
256
- {
257
- ok: false,
258
- error: "Recording completed but no recording path returned",
259
- recordingId: result.recordingId,
260
- },
261
- json,
262
- );
263
- process.exitCode = 1;
264
- }
198
+ const session = await refreshSessionFromExtension();
199
+ output(
200
+ {
201
+ ok: true,
202
+ message: "Session refreshed from Chrome via browser extension",
203
+ cookieCount: session.cookies.length,
204
+ },
205
+ json,
206
+ );
265
207
  } catch (err) {
266
208
  outputError(err instanceof Error ? err.message : String(err));
267
209
  }
@@ -293,8 +235,8 @@ interfering with Chrome's WAL journaling. Required cookies (session-id,
293
235
  ubid-main, and at-main or x-main) are validated after extraction.
294
236
 
295
237
  Examples:
296
- $ vellum amazon refresh-headless
297
- $ vellum amazon refresh-headless --json`,
238
+ $ assistant amazon refresh-headless
239
+ $ assistant amazon refresh-headless --json`,
298
240
  )
299
241
  .action(async (_opts: unknown, cmd: Command) => {
300
242
  const json = getJson(cmd);
@@ -330,8 +272,8 @@ session exists, returns loggedIn: false.
330
272
  Use this to verify session health before running shopping commands.
331
273
 
332
274
  Examples:
333
- $ vellum amazon status
334
- $ vellum amazon status --json`,
275
+ $ assistant amazon status
276
+ $ assistant amazon status --json`,
335
277
  )
336
278
  .action((_opts: unknown, cmd: Command) => {
337
279
  const session = loadSession();
@@ -375,9 +317,9 @@ The --fresh flag restricts results to Amazon Fresh grocery items. The
375
317
  --limit flag controls the maximum number of results returned (default: 20).
376
318
 
377
319
  Examples:
378
- $ vellum amazon search "AA batteries"
379
- $ vellum amazon search "whole milk" --fresh --limit 10
380
- $ vellum amazon search "USB-C cable" --limit 5 --json`,
320
+ $ assistant amazon search "AA batteries"
321
+ $ assistant amazon search "whole milk" --fresh --limit 10
322
+ $ assistant amazon search "USB-C cable" --limit 5 --json`,
381
323
  )
382
324
  .action(
383
325
  async (
@@ -415,9 +357,9 @@ description, images, and available variations. Use --fresh if the product
415
357
  is an Amazon Fresh grocery item.
416
358
 
417
359
  Examples:
418
- $ vellum amazon product B07XXXXX
419
- $ vellum amazon product B08YYYYY --fresh
420
- $ vellum amazon product B07XXXXX --json`,
360
+ $ assistant amazon product B07XXXXX
361
+ $ assistant amazon product B08YYYYY --fresh
362
+ $ assistant amazon product B07XXXXX --json`,
421
363
  )
422
364
  .action(async (asin: string, opts: { fresh?: boolean }, cmd: Command) => {
423
365
  await run(cmd, async () => {
@@ -447,8 +389,8 @@ Each variation includes dimension labels (e.g. "Size: Large", "Color: Blue")
447
389
  and its own ASIN for use with "product" or "cart add".
448
390
 
449
391
  Examples:
450
- $ vellum amazon variations B07XXXXX
451
- $ vellum amazon variations B07XXXXX --json`,
392
+ $ assistant amazon variations B07XXXXX
393
+ $ assistant amazon variations B07XXXXX --json`,
452
394
  )
453
395
  .action(async (asin: string, _opts: unknown, cmd: Command) => {
454
396
  await run(cmd, async () => {
@@ -477,9 +419,9 @@ The cart is shared between regular Amazon and Amazon Fresh items. Use
477
419
  --fresh when adding grocery items to route them through the Fresh workflow.
478
420
 
479
421
  Examples:
480
- $ vellum amazon cart view
481
- $ vellum amazon cart add --asin B07XXXXX --quantity 2
482
- $ vellum amazon cart remove --cart-item-id CXYZ123`,
422
+ $ assistant amazon cart view
423
+ $ assistant amazon cart add --asin B07XXXXX --quantity 2
424
+ $ assistant amazon cart remove --cart-item-id CXYZ123`,
483
425
  );
484
426
 
485
427
  // cart view
@@ -494,8 +436,8 @@ price, and cart-item-id. Use the cart-item-id with "cart remove" to delete
494
436
  individual items.
495
437
 
496
438
  Examples:
497
- $ vellum amazon cart view
498
- $ vellum amazon cart view --json`,
439
+ $ assistant amazon cart view
440
+ $ assistant amazon cart view --json`,
499
441
  )
500
442
  .action(async (_opts: unknown, cmd: Command) => {
501
443
  await run(cmd, async () => {
@@ -526,9 +468,9 @@ Options:
526
468
  failures. Includes raw Amazon API response data.
527
469
 
528
470
  Examples:
529
- $ vellum amazon cart add --asin B07XXXXX
530
- $ vellum amazon cart add --asin B08YYYYY --quantity 3 --fresh
531
- $ vellum amazon cart add --asin B07XXXXX --verbose`,
471
+ $ assistant amazon cart add --asin B07XXXXX
472
+ $ assistant amazon cart add --asin B08YYYYY --quantity 3 --fresh
473
+ $ assistant amazon cart add --asin B07XXXXX --verbose`,
532
474
  )
533
475
  .action(
534
476
  async (
@@ -601,8 +543,8 @@ Options:
601
543
  line-item ID.
602
544
 
603
545
  Examples:
604
- $ vellum amazon cart remove --cart-item-id CXYZ123
605
- $ vellum amazon cart remove --cart-item-id CXYZ123 --json`,
546
+ $ assistant amazon cart remove --cart-item-id CXYZ123
547
+ $ assistant amazon cart remove --cart-item-id CXYZ123 --json`,
606
548
  )
607
549
  .action(async (opts: { cartItemId: string }, cmd: Command) => {
608
550
  await run(cmd, async () => {
@@ -626,11 +568,11 @@ delivery slot must be selected. Use "delivery-slots" to list available time
626
568
  windows, then "select-slot" to reserve one.
627
569
 
628
570
  Fresh items must also be added to cart with the --fresh flag:
629
- $ vellum amazon cart add --asin B08YYYYY --fresh
571
+ $ assistant amazon cart add --asin B08YYYYY --fresh
630
572
 
631
573
  Examples:
632
- $ vellum amazon fresh delivery-slots
633
- $ vellum amazon fresh select-slot --slot-id slot_abc123`,
574
+ $ assistant amazon fresh delivery-slots
575
+ $ assistant amazon fresh select-slot --slot-id slot_abc123`,
634
576
  );
635
577
 
636
578
  // fresh delivery-slots
@@ -648,8 +590,8 @@ Slot availability changes frequently. Re-check before placing an order if
648
590
  significant time has passed since the last query.
649
591
 
650
592
  Examples:
651
- $ vellum amazon fresh delivery-slots
652
- $ vellum amazon fresh delivery-slots --json`,
593
+ $ assistant amazon fresh delivery-slots
594
+ $ assistant amazon fresh delivery-slots --json`,
653
595
  )
654
596
  .action(async (_opts: unknown, cmd: Command) => {
655
597
  await run(cmd, async () => {
@@ -674,8 +616,8 @@ must be obtained from "fresh delivery-slots". A slot must be selected before
674
616
  placing an Amazon Fresh order via "order place".
675
617
 
676
618
  Examples:
677
- $ vellum amazon fresh select-slot --slot-id slot_abc123
678
- $ vellum amazon fresh select-slot --slot-id slot_abc123 --json`,
619
+ $ assistant amazon fresh select-slot --slot-id slot_abc123
620
+ $ assistant amazon fresh select-slot --slot-id slot_abc123 --json`,
679
621
  )
680
622
  .action(async (opts: { slotId: string }, cmd: Command) => {
681
623
  await run(cmd, async () => {
@@ -702,8 +644,8 @@ If no --payment-method-id is passed to "order place", Amazon uses the
702
644
  account's default payment method.
703
645
 
704
646
  Examples:
705
- $ vellum amazon payment-methods
706
- $ vellum amazon payment-methods --json`,
647
+ $ assistant amazon payment-methods
648
+ $ assistant amazon payment-methods --json`,
707
649
  )
708
650
  .action(async (_opts: unknown, cmd: Command) => {
709
651
  await run(cmd, async () => {
@@ -729,8 +671,8 @@ Use this to review the order before committing with "order place". This
729
671
  command is read-only and does not charge or modify the cart.
730
672
 
731
673
  Examples:
732
- $ vellum amazon checkout
733
- $ vellum amazon checkout --json`,
674
+ $ assistant amazon checkout
675
+ $ assistant amazon checkout --json`,
734
676
  )
735
677
  .action(async (_opts: unknown, cmd: Command) => {
736
678
  await run(cmd, async () => {
@@ -754,8 +696,8 @@ method and submits a real Amazon order that cannot be undone via this CLI.
754
696
  Always confirm with the user and review checkout summary first.
755
697
 
756
698
  Examples:
757
- $ vellum amazon checkout
758
- $ vellum amazon order place`,
699
+ $ assistant amazon checkout
700
+ $ assistant amazon order place`,
759
701
  );
760
702
 
761
703
  // order place
@@ -781,18 +723,18 @@ Options:
781
723
  account's default payment method.
782
724
 
783
725
  For Amazon Fresh orders, select a delivery slot before placing the order:
784
- $ vellum amazon fresh select-slot --slot-id slot_abc123
726
+ $ assistant amazon fresh select-slot --slot-id slot_abc123
785
727
 
786
728
  Recommended workflow before placing an order:
787
- 1. vellum amazon cart view (verify cart contents)
788
- 2. vellum amazon checkout (review totals and shipping)
729
+ 1. assistant amazon cart view (verify cart contents)
730
+ 2. assistant amazon checkout (review totals and shipping)
789
731
  3. Confirm with the user
790
- 4. vellum amazon order place
732
+ 4. assistant amazon order place
791
733
 
792
734
  Examples:
793
- $ vellum amazon order place
794
- $ vellum amazon order place --payment-method-id pm_abc123
795
- $ vellum amazon order place --json`,
735
+ $ assistant amazon order place
736
+ $ assistant amazon order place --payment-method-id pm_abc123
737
+ $ assistant amazon order place --json`,
796
738
  )
797
739
  .action(async (opts: { paymentMethodId?: string }, cmd: Command) => {
798
740
  await run(cmd, async () => {
@@ -805,7 +747,7 @@ Examples:
805
747
  }
806
748
 
807
749
  // ---------------------------------------------------------------------------
808
- // Chrome CDP helpers (delegated to shared module)
750
+ // Headless cookie extraction from Chrome's SQLite database
809
751
  // ---------------------------------------------------------------------------
810
752
 
811
753
  import { execSync } from "node:child_process";
@@ -818,16 +760,6 @@ import {
818
760
  import { homedir, tmpdir } from "node:os";
819
761
  import { join as pathJoin } from "node:path";
820
762
 
821
- import {
822
- ensureChromeWithCdp,
823
- minimizeChromeWindow,
824
- restoreChromeWindow,
825
- } from "../tools/browser/chrome-cdp.js";
826
-
827
- // ---------------------------------------------------------------------------
828
- // Headless cookie extraction from Chrome's SQLite database
829
- // ---------------------------------------------------------------------------
830
-
831
763
  const CHROME_COOKIES_DB = pathJoin(
832
764
  homedir(),
833
765
  "Library/Application Support/Google/Chrome/Default/Cookies",
@@ -991,110 +923,3 @@ async function extractSessionFromChromeCookies(): Promise<
991
923
  importedAt: new Date().toISOString(),
992
924
  };
993
925
  }
994
-
995
- // ---------------------------------------------------------------------------
996
- // Ride Shotgun learn session helper
997
- // ---------------------------------------------------------------------------
998
-
999
- interface LearnResult {
1000
- recordingId?: string;
1001
- recordingPath?: string;
1002
- }
1003
-
1004
- async function startLearnSession(
1005
- durationSeconds: number,
1006
- ): Promise<LearnResult> {
1007
- await ensureChromeWithCdp({ startUrl: "https://www.amazon.com/" });
1008
-
1009
- return new Promise((resolve, reject) => {
1010
- const socketPath = getSocketPath();
1011
- const sessionToken = readSessionToken();
1012
- const socket = net.createConnection(socketPath);
1013
- const parser = createMessageParser();
1014
-
1015
- socket.on("error", (err) => {
1016
- reject(
1017
- new Error(
1018
- `Cannot connect to assistant: ${err.message}. Is the assistant running?`,
1019
- ),
1020
- );
1021
- });
1022
-
1023
- const timeoutHandle = setTimeout(
1024
- () => {
1025
- socket.destroy();
1026
- reject(
1027
- new Error(`Learn session timed out after ${durationSeconds + 30}s`),
1028
- );
1029
- },
1030
- (durationSeconds + 30) * 1000,
1031
- );
1032
- timeoutHandle.unref();
1033
-
1034
- let authenticated = !sessionToken;
1035
-
1036
- const sendStartCommand = () => {
1037
- socket.write(
1038
- serialize({
1039
- type: "ride_shotgun_start",
1040
- durationSeconds,
1041
- intervalSeconds: 5,
1042
- mode: "learn",
1043
- targetDomain: "amazon.com",
1044
- } as unknown as import("../daemon/ipc-protocol.js").ClientMessage),
1045
- );
1046
- };
1047
-
1048
- socket.on("data", (chunk) => {
1049
- const messages = parser.feed(chunk.toString("utf-8"));
1050
- for (const msg of messages) {
1051
- const m = msg as unknown as Record<string, unknown>;
1052
-
1053
- if (!authenticated && m.type === "auth_result") {
1054
- if ((m as { success: boolean }).success) {
1055
- authenticated = true;
1056
- sendStartCommand();
1057
- } else {
1058
- clearTimeout(timeoutHandle);
1059
- socket.destroy();
1060
- reject(new Error("Authentication failed"));
1061
- }
1062
- continue;
1063
- }
1064
-
1065
- if (m.type === "auth_result") {
1066
- continue;
1067
- }
1068
-
1069
- if (m.type === "ride_shotgun_error") {
1070
- clearTimeout(timeoutHandle);
1071
- socket.destroy();
1072
- reject(new Error((m as { message: string }).message));
1073
- continue;
1074
- }
1075
-
1076
- if (m.type === "ride_shotgun_result") {
1077
- clearTimeout(timeoutHandle);
1078
- socket.destroy();
1079
- resolve({
1080
- recordingId: m.recordingId as string | undefined,
1081
- recordingPath: m.recordingPath as string | undefined,
1082
- });
1083
- }
1084
- }
1085
- });
1086
-
1087
- socket.on("connect", () => {
1088
- if (sessionToken) {
1089
- socket.write(
1090
- serialize({
1091
- type: "auth",
1092
- token: sessionToken,
1093
- } as unknown as import("../daemon/ipc-protocol.js").ClientMessage),
1094
- );
1095
- } else {
1096
- sendStartCommand();
1097
- }
1098
- });
1099
- });
1100
- }
package/src/cli/audit.ts CHANGED
@@ -26,8 +26,8 @@ Table columns:
26
26
  Duration Wall-clock execution time (e.g. 120ms, 1.3s)
27
27
 
28
28
  Examples:
29
- $ vellum audit
30
- $ vellum audit --limit 50`,
29
+ $ assistant audit
30
+ $ assistant audit --limit 50`,
31
31
  )
32
32
  .action((opts: { limit: string }) => {
33
33
  const limit = parseInt(opts.limit, 10) || 20;
@@ -203,9 +203,9 @@ Config is stored in <data-dir>/.vellum/workspace/autonomy.json, where
203
203
  <data-dir> is the BASE_DATA_DIR environment variable (defaults to $HOME).
204
204
 
205
205
  Examples:
206
- $ vellum autonomy get
207
- $ vellum autonomy set --default draft
208
- $ vellum autonomy set --channel telegram --tier auto`,
206
+ $ assistant autonomy get
207
+ $ assistant autonomy set --default draft
208
+ $ assistant autonomy set --channel telegram --tier auto`,
209
209
  );
210
210
 
211
211
  autonomy
@@ -222,8 +222,8 @@ Pass --json (on the parent command) for machine-readable output containing
222
222
  the complete config object.
223
223
 
224
224
  Examples:
225
- $ vellum autonomy get
226
- $ vellum autonomy --json get`,
225
+ $ assistant autonomy get
226
+ $ assistant autonomy --json get`,
227
227
  )
228
228
  .action((_opts: Record<string, unknown>, cmd: Command) => {
229
229
  const json = getJson(cmd);
@@ -264,10 +264,10 @@ For example, setting a channel default leaves all other channel defaults,
264
264
  category overrides, and contact overrides intact.
265
265
 
266
266
  Examples:
267
- $ vellum autonomy set --default draft
268
- $ vellum autonomy set --channel telegram --tier auto
269
- $ vellum autonomy set --category billing --tier notify
270
- $ vellum autonomy set --contact c_8f3a1b2d --tier draft`,
267
+ $ assistant autonomy set --default draft
268
+ $ assistant autonomy set --channel telegram --tier auto
269
+ $ assistant autonomy set --category billing --tier notify
270
+ $ assistant autonomy set --contact c_8f3a1b2d --tier draft`,
271
271
  )
272
272
  .action(
273
273
  (
@@ -18,9 +18,9 @@ that the assistant uses to send and receive messages.
18
18
  The assistant must be running — channel status is read from the live gateway.
19
19
 
20
20
  Examples:
21
- $ vellum channels readiness
22
- $ vellum channels readiness --channel telegram
23
- $ vellum channels readiness --json`,
21
+ $ assistant channels readiness
22
+ $ assistant channels readiness --channel telegram
23
+ $ assistant channels readiness --json`,
24
24
  );
25
25
 
26
26
  channels
@@ -39,8 +39,8 @@ configured channels are returned. Common channel types include: telegram,
39
39
  voice, sms, email, slack, vellum.
40
40
 
41
41
  Examples:
42
- $ vellum channels readiness
43
- $ vellum channels readiness --channel telegram`,
42
+ $ assistant channels readiness
43
+ $ assistant channels readiness --channel telegram`,
44
44
  )
45
45
  .action(async (opts: { channel?: string }, cmd: Command) => {
46
46
  const query = toQueryString({ channel: opts.channel });