@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.
- package/ARCHITECTURE.md +3 -3
- package/README.md +13 -13
- package/bun.lock +80 -24
- package/docs/architecture/integrations.md +126 -128
- package/docs/runbook-trusted-contacts.md +1 -1
- package/docs/trusted-contact-access.md +12 -12
- package/package.json +3 -1
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +0 -14
- package/src/__tests__/app-bundler.test.ts +209 -0
- package/src/__tests__/app-compiler.test.ts +279 -0
- package/src/__tests__/app-executors.test.ts +293 -483
- package/src/__tests__/app-migration.test.ts +148 -0
- package/src/__tests__/app-routes-csp.test.ts +202 -0
- package/src/__tests__/avatar-e2e.test.ts +452 -0
- package/src/__tests__/avatar-generator.test.ts +193 -0
- package/src/__tests__/avatar-router.test.ts +186 -0
- package/src/__tests__/browser-download-timeout.test.ts +28 -0
- package/src/__tests__/bundled-skill-retrieval-guard.test.ts +9 -9
- package/src/__tests__/call-domain.test.ts +3 -7
- package/src/__tests__/credential-security-e2e.test.ts +19 -12
- package/src/__tests__/credentials-cli.test.ts +30 -4
- package/src/__tests__/guardian-verify-setup-skill-regression.test.ts +1 -1
- package/src/__tests__/handlers-slack-config.test.ts +0 -72
- package/src/__tests__/handlers-telegram-config.test.ts +19 -12
- package/src/__tests__/handlers-twitter-config.test.ts +105 -48
- package/src/__tests__/inbound-invite-redemption.test.ts +4 -4
- package/src/__tests__/integration-status.test.ts +15 -5
- package/src/__tests__/integrations-cli.test.ts +1 -1
- package/src/__tests__/invite-redemption-service.test.ts +62 -7
- package/src/__tests__/ipc-snapshot.test.ts +0 -8
- package/src/__tests__/managed-avatar-client.test.ts +280 -0
- package/src/__tests__/mcp-cli.test.ts +3 -3
- package/src/__tests__/oauth-cli.test.ts +203 -0
- package/src/__tests__/relay-server.test.ts +3 -3
- package/src/__tests__/secret-onetime-send.test.ts +19 -12
- package/src/__tests__/secure-keys.test.ts +78 -0
- package/src/__tests__/session-messaging-secret-redirect.test.ts +3 -0
- package/src/__tests__/slack-channel-config.test.ts +23 -16
- package/src/__tests__/slack-share-routes.test.ts +263 -0
- package/src/__tests__/sms-messaging-provider.test.ts +3 -1
- package/src/__tests__/trusted-contact-lifecycle-notifications.test.ts +7 -7
- package/src/__tests__/trusted-contact-multichannel.test.ts +3 -3
- package/src/__tests__/trusted-contact-verification.test.ts +10 -10
- package/src/__tests__/twilio-config.test.ts +15 -36
- package/src/__tests__/twilio-provider.test.ts +4 -0
- package/src/__tests__/twitter-auth-handler.test.ts +27 -14
- package/src/__tests__/twitter-cli-error-shaping.test.ts +1 -1
- package/src/__tests__/twitter-cli-routing.test.ts +38 -53
- package/src/__tests__/twitter-oauth-client.test.ts +18 -47
- package/src/__tests__/voice-invite-redemption.test.ts +27 -3
- package/src/amazon/cart.ts +1 -1
- package/src/amazon/client.ts +89 -7
- package/src/approvals/guardian-request-resolvers.ts +2 -2
- package/src/bundler/app-bundler.ts +77 -32
- package/src/bundler/app-compiler.ts +195 -0
- package/src/bundler/manifest.ts +1 -1
- package/src/bundler/package-resolver.ts +185 -0
- package/src/calls/call-domain.ts +4 -14
- package/src/calls/relay-server.ts +2 -2
- package/src/calls/twilio-config.ts +5 -24
- package/src/calls/twilio-rest.ts +19 -5
- package/src/cli/amazon.ts +74 -249
- package/src/cli/audit.ts +2 -2
- package/src/cli/autonomy.ts +9 -9
- package/src/cli/channels.ts +5 -5
- package/src/cli/completions.ts +27 -27
- package/src/cli/config.ts +14 -14
- package/src/cli/contacts.ts +27 -27
- package/src/cli/credentials.ts +28 -28
- package/src/cli/dev.ts +2 -2
- package/src/cli/doctor.ts +2 -2
- package/src/cli/email.ts +82 -82
- package/src/cli/influencer.ts +13 -13
- package/src/cli/integrations.ts +19 -144
- package/src/cli/keys.ts +10 -10
- package/src/cli/map.ts +4 -4
- package/src/cli/mcp.ts +17 -17
- package/src/cli/memory.ts +18 -18
- package/src/cli/notifications.ts +13 -13
- package/src/cli/oauth.ts +77 -0
- package/src/cli/program.ts +2 -0
- package/src/cli/sequence.ts +27 -27
- package/src/cli/sessions.ts +12 -12
- package/src/cli/trust.ts +8 -8
- package/src/cli/twitter.ts +124 -70
- package/src/config/bundled-skills/_shared/CLI_RETRIEVAL_PATTERN.md +1 -1
- package/src/config/bundled-skills/agentmail/SKILL.md +34 -34
- package/src/config/bundled-skills/amazon/SKILL.md +54 -54
- package/src/config/bundled-skills/app-builder/SKILL.md +137 -3
- package/src/config/bundled-skills/app-builder/tools/app-create.ts +10 -4
- package/src/config/bundled-skills/configure-settings/SKILL.md +18 -18
- package/src/config/bundled-skills/contacts/SKILL.md +12 -12
- package/src/config/bundled-skills/doordash/lib/client.ts +7 -9
- package/src/config/bundled-skills/email-setup/SKILL.md +4 -4
- package/src/config/bundled-skills/frontend-design/icon.svg +16 -0
- package/src/config/bundled-skills/google-oauth-setup/SKILL.md +143 -162
- package/src/config/bundled-skills/guardian-verify-setup/SKILL.md +4 -4
- package/src/config/bundled-skills/influencer/SKILL.md +13 -13
- package/src/config/bundled-skills/mcp-setup/SKILL.md +11 -11
- package/src/config/bundled-skills/phone-calls/SKILL.md +48 -54
- package/src/config/bundled-skills/public-ingress/SKILL.md +6 -6
- package/src/config/bundled-skills/slack-app-setup/SKILL.md +1 -1
- package/src/config/bundled-skills/sms-setup/SKILL.md +3 -3
- package/src/config/bundled-skills/telegram-setup/SKILL.md +2 -2
- package/src/config/bundled-skills/twilio-setup/SKILL.md +136 -225
- package/src/config/bundled-skills/twitter/SKILL.md +68 -44
- package/src/config/bundled-skills/voice-setup/SKILL.md +2 -2
- package/src/config/core-schema.ts +26 -0
- package/src/config/env.ts +4 -0
- package/src/config/feature-flag-registry.json +9 -1
- package/src/config/schema.ts +8 -0
- package/src/config/system-prompt.ts +6 -3
- package/src/config/templates/BOOTSTRAP.md +7 -5
- package/src/contacts/contacts-write.ts +5 -1
- package/src/daemon/handlers/apps.ts +31 -4
- package/src/daemon/handlers/config-ingress.ts +3 -3
- package/src/daemon/handlers/config-integrations.ts +120 -49
- package/src/daemon/handlers/config-slack-channel.ts +26 -7
- package/src/daemon/handlers/config-slack.ts +1 -54
- package/src/daemon/handlers/config-telegram.ts +28 -10
- package/src/daemon/handlers/config.ts +1 -4
- package/src/daemon/handlers/twitter-auth.ts +11 -4
- package/src/daemon/ipc-contract/apps.ts +0 -13
- package/src/daemon/ipc-contract-inventory.json +0 -2
- package/src/daemon/lifecycle.ts +8 -1
- package/src/daemon/session-messaging.ts +2 -2
- package/src/daemon/tool-side-effects.ts +30 -0
- package/src/email/providers/agentmail.ts +1 -1
- package/src/email/providers/index.ts +1 -1
- package/src/email/service.ts +1 -1
- package/src/gallery/default-gallery.ts +538 -0
- package/src/gallery/gallery-manifest.ts +5 -1
- package/src/influencer/client.ts +8 -6
- package/src/mcp/client.ts +1 -1
- package/src/media/avatar-router.ts +99 -0
- package/src/media/avatar-types.ts +60 -0
- package/src/media/managed-avatar-client.ts +189 -0
- package/src/memory/app-migration.ts +114 -0
- package/src/memory/app-store.ts +11 -0
- package/src/memory/qdrant-client.ts +1 -1
- package/src/messaging/providers/slack/client.ts +12 -2
- package/src/messaging/providers/sms/adapter.ts +6 -10
- package/src/migrations/data-layout.ts +8 -1
- package/src/oauth/token-persistence.ts +9 -6
- package/src/runtime/assistant-scope.ts +5 -0
- package/src/runtime/auth/route-policy.ts +4 -0
- package/src/runtime/channel-readiness-service.ts +9 -4
- package/src/runtime/gateway-internal-client.ts +11 -3
- package/src/runtime/http-server.ts +2 -0
- package/src/runtime/invite-redemption-service.ts +23 -13
- package/src/runtime/middleware/twilio-validation.ts +2 -2
- package/src/runtime/routes/app-routes.ts +131 -3
- package/src/runtime/routes/inbound-stages/verification-intercept.ts +3 -3
- package/src/runtime/routes/integration-routes.ts +2 -2
- package/src/runtime/routes/slack-share-routes.ts +235 -0
- package/src/runtime/routes/twilio-routes.ts +47 -34
- package/src/schedule/integration-status.ts +2 -3
- package/src/security/token-manager.ts +11 -3
- package/src/tools/apps/executors.ts +116 -8
- package/src/tools/browser/browser-manager.ts +30 -2
- package/src/tools/browser/chrome-cdp.ts +31 -3
- package/src/tools/credentials/vault.ts +9 -7
- package/src/tools/executor.ts +4 -0
- package/src/tools/system/avatar-generator.ts +55 -34
- package/src/twitter/client.ts +1 -1
- package/src/twitter/oauth-client.ts +31 -43
- package/src/twitter/router.ts +25 -23
- package/src/util/platform.ts +5 -0
- package/src/slack/slack-webhook.ts +0 -66
package/src/cli/amazon.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI command group: `
|
|
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
|
-
$
|
|
119
|
-
$
|
|
120
|
-
$
|
|
121
|
-
$
|
|
122
|
-
$
|
|
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
|
-
$
|
|
142
|
-
$
|
|
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
|
-
$
|
|
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 —
|
|
172
|
+
// refresh — grab Amazon cookies from Chrome via browser extension
|
|
178
173
|
// =========================================================================
|
|
179
174
|
amz
|
|
180
175
|
.command("refresh")
|
|
181
176
|
.description(
|
|
182
|
-
"
|
|
183
|
-
"
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
188
|
+
If this fails, try "refresh-headless" which reads cookies from Chrome's
|
|
189
|
+
local SQLite database instead.
|
|
200
190
|
|
|
201
191
|
Examples:
|
|
202
|
-
$
|
|
203
|
-
$
|
|
192
|
+
$ assistant amazon refresh
|
|
193
|
+
$ assistant amazon refresh --json`,
|
|
204
194
|
)
|
|
205
|
-
.action(async (
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
$
|
|
297
|
-
$
|
|
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
|
-
$
|
|
334
|
-
$
|
|
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
|
-
$
|
|
379
|
-
$
|
|
380
|
-
$
|
|
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
|
-
$
|
|
419
|
-
$
|
|
420
|
-
$
|
|
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
|
-
$
|
|
451
|
-
$
|
|
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
|
-
$
|
|
481
|
-
$
|
|
482
|
-
$
|
|
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
|
-
$
|
|
498
|
-
$
|
|
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
|
-
$
|
|
530
|
-
$
|
|
531
|
-
$
|
|
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
|
-
$
|
|
605
|
-
$
|
|
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
|
-
$
|
|
571
|
+
$ assistant amazon cart add --asin B08YYYYY --fresh
|
|
630
572
|
|
|
631
573
|
Examples:
|
|
632
|
-
$
|
|
633
|
-
$
|
|
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
|
-
$
|
|
652
|
-
$
|
|
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
|
-
$
|
|
678
|
-
$
|
|
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
|
-
$
|
|
706
|
-
$
|
|
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
|
-
$
|
|
733
|
-
$
|
|
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
|
-
$
|
|
758
|
-
$
|
|
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
|
-
$
|
|
726
|
+
$ assistant amazon fresh select-slot --slot-id slot_abc123
|
|
785
727
|
|
|
786
728
|
Recommended workflow before placing an order:
|
|
787
|
-
1.
|
|
788
|
-
2.
|
|
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.
|
|
732
|
+
4. assistant amazon order place
|
|
791
733
|
|
|
792
734
|
Examples:
|
|
793
|
-
$
|
|
794
|
-
$
|
|
795
|
-
$
|
|
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
|
-
//
|
|
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
|
-
$
|
|
30
|
-
$
|
|
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;
|
package/src/cli/autonomy.ts
CHANGED
|
@@ -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
|
-
$
|
|
207
|
-
$
|
|
208
|
-
$
|
|
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
|
-
$
|
|
226
|
-
$
|
|
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
|
-
$
|
|
268
|
-
$
|
|
269
|
-
$
|
|
270
|
-
$
|
|
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
|
(
|
package/src/cli/channels.ts
CHANGED
|
@@ -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
|
-
$
|
|
22
|
-
$
|
|
23
|
-
$
|
|
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
|
-
$
|
|
43
|
-
$
|
|
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 });
|