@primitivedotdev/cli 3.0.0-preview.3 → 3.0.0-preview.30
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/README.md +110 -39
- package/bin/run.js +21 -2
- package/dist/api-command-JSxKMsEp.js +67356 -0
- package/dist/cli-command-names-A9nkSBH6.js +380 -0
- package/dist/cli-config-BEo5mbDK.js +1750 -0
- package/dist/help-inputs-NGARVZL_.js +109 -0
- package/dist/{json-output-DWrJMakZ.js → json-output-BMZrLH47.js} +25 -6
- package/dist/{listen-background-C0F9gNDD.js → listen-background-DyBYca28.js} +323 -36
- package/dist/{machine-session-BG4getHB.js → machine-session-CDLKmg8U.js} +10 -10
- package/dist/{notify-session-8Jv4jJzI.js → notify-session-BeYhiOD0.js} +71 -32
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +1 -1
- package/dist/oclif/command-not-found.js +133 -0
- package/dist/oclif/command-stdin.js +9 -0
- package/dist/oclif/help.js +82 -17
- package/dist/oclif/index.js +5814 -105060
- package/dist/oclif/listen-supervisor.js +1 -1
- package/dist/oclif/proxy-auto-detect.js +1 -1
- package/dist/oclif/receiver-heal.js +4 -4
- package/dist/oclif/root-signup-hint.js +16 -16
- package/dist/receiver.d.ts +1 -1
- package/dist/{repeats-Dj_o6c-X-BKHiZsYv.js → repeats-Dj_o6c-X-r9r6uQOb.js} +15081 -14000
- package/dist/retry-ids-04ZPJCZY.js +59 -0
- package/dist/{scoped-chat-_AEpylPV.js → scoped-chat-BqmFQ1yz.js} +1 -1
- package/dist/{shared-mail-watch-BAPMsFNv.js → shared-mail-watch-DdtgJOrV.js} +12 -0
- package/dist/{signal-command-CBHAR7zj.js → signal-command-CCfFQ72M.js} +19 -9
- package/dist/skills/primitive-connect/SKILL.md +5 -6
- package/dist/skills/primitive-connect/references/access-passes.md +32 -0
- package/dist/skills/primitive-connect/references/contact-requests.md +4 -4
- package/dist/skills/primitive-connect/references/contacts.md +1 -1
- package/dist/skills/primitive-connect.json +6 -5
- package/man/primitive.1 +27 -12
- package/package.json +35 -13
- package/dist/api-command-DWjtyqH9.js +0 -3675
- package/dist/cli-config-Ms_0vNjq.js +0 -949
package/README.md
CHANGED
|
@@ -71,8 +71,9 @@ primitive listen --subscription local-webhook --forward-to http://localhost:3000
|
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
This mode forwards the exact signed body and existing webhook headers. Configure
|
|
74
|
-
the handler with
|
|
75
|
-
|
|
74
|
+
the handler with the secret the webhook signs with (the account webhook secret,
|
|
75
|
+
or the webhook's own secret when its `signed_with` is `own_secret`) and normal
|
|
76
|
+
signature verification. The CLI never forwards your API credentials. It does not follow
|
|
76
77
|
redirects or disable TLS verification. A response must finish within 30 seconds
|
|
77
78
|
and remain within 1 MiB. Existing confirmation headers retain their meaning,
|
|
78
79
|
including account content-discard behavior; exec and stdout do not confirm
|
|
@@ -100,20 +101,20 @@ the readiness message: `primitive endpoints delete --id DESTINATION_ID`.
|
|
|
100
101
|
|
|
101
102
|
### Low-level delivery API
|
|
102
103
|
|
|
103
|
-
The generated `endpoints pull-
|
|
104
|
+
The generated `endpoints pull-event` and `endpoints complete-event`
|
|
104
105
|
commands expose the local-delivery API when enabled on your API host. These are
|
|
105
106
|
single API calls; a receive loop must retain the destination identity and report
|
|
106
107
|
each attempt's outcome. Use `--help-full` to inspect the request fields:
|
|
107
108
|
|
|
108
109
|
```sh
|
|
109
|
-
primitive endpoints pull-
|
|
110
|
-
primitive endpoints complete-
|
|
110
|
+
primitive endpoints pull-event --help-full
|
|
111
|
+
primitive endpoints complete-event --help-full
|
|
111
112
|
```
|
|
112
113
|
|
|
113
114
|
Completion uses a mode-specific JSON body. For a successful process handler:
|
|
114
115
|
|
|
115
116
|
```sh
|
|
116
|
-
primitive endpoints complete-
|
|
117
|
+
primitive endpoints complete-event --id ENDPOINT_ID --raw-body '{"queue_id":"QUEUE_ID","delivery_id":"DELIVERY_ID","lease_token":"LEASE_TOKEN","mode":"exec","exit_code":0,"duration_ms":12}'
|
|
117
118
|
```
|
|
118
119
|
|
|
119
120
|
Use the IDs and lease token returned by pull. HTTP forwarding reports
|
|
@@ -140,7 +141,7 @@ primitive emails latest --limit 5
|
|
|
140
141
|
primitive inbox next
|
|
141
142
|
```
|
|
142
143
|
|
|
143
|
-
Run `primitive --help` for the full command list. Per-command help (`primitive functions deploy --help`, or `-h`) is one screen: a summary, usage,
|
|
144
|
+
Run `primitive --help` for the full command list. Per-command help (`primitive functions deploy --help`, or `-h`) is one screen: a summary, usage, required inputs, command options, common flags, and up to two examples. Common flags compact to names when needed to fit. Required request-body fields can be supplied as flags or JSON. `primitive functions deploy --help-full` prints the complete text, with every flag's full description, behavior notes, and all examples, so an agent can compose any operation without leaving the terminal.
|
|
144
145
|
|
|
145
146
|
## Verification codes and sign-in links
|
|
146
147
|
|
|
@@ -218,56 +219,72 @@ boundary to at most 60 characters. The whole message is the body.
|
|
|
218
219
|
|
|
219
220
|
## Authentication
|
|
220
221
|
|
|
221
|
-
Use `primitive signin` or `primitive login`
|
|
222
|
+
Use `primitive signin` or `primitive login` to log in. With no email, both use browser approval; `primitive signin browser` and `primitive login browser` are the explicit browser forms.
|
|
222
223
|
|
|
223
|
-
Use `primitive signin <email> --accept-terms`, then `primitive signin confirm <email> <code>` for email-code sign-in. `primitive login <email>` and `primitive otp <email>` support the same email-code flow with matching `confirm` and `resend` subcommands.
|
|
224
|
+
Use `primitive signin <email> --accept-terms`, then `primitive signin confirm <email> <code>` for email-code sign-in. `primitive login <email>` and `primitive otp <email>` support the same email-code flow with matching `confirm` and `resend` subcommands. The code logs you in to the account that uses the address, or creates a new account when none does. Primitive sends no emailed code to an address on a domain it receives mail for; log in with `primitive login browser` instead. Without a terminal to answer the terms prompt, these commands stop and ask for `--accept-terms`.
|
|
224
225
|
|
|
225
226
|
Use `primitive logout --force` to remove local CLI credentials, pending email-code auth state, and stale credential locks without contacting Primitive. This is the recovery command when an interrupted auth command leaves the CLI saying another credential operation is already in progress.
|
|
226
227
|
|
|
227
|
-
Use `primitive org leave` to leave the organization you are signed in to. It asks for confirmation first; pass `--yes` to skip the prompt in scripts. Leaving is final. Only a person signed in with `primitive login` can leave; API keys are refused. The only owner of an organization cannot leave it until someone else is made an owner. If the server asks you to confirm in the dashboard, the command prints the confirmation page and, in a terminal, asks for the token it shows; in a script, pass the token with `--step-up-token`. Refusals from the server are printed as returned, and the command exits 1.
|
|
228
|
+
Use `primitive org leave` to leave the organization you are signed in to. It asks for confirmation first; pass `--yes` to skip the prompt in scripts. Leaving is final. Only a person signed in with `primitive login` can leave; API keys are refused. The only owner of an organization cannot leave it until someone else is made an owner. If the server asks you to confirm in the dashboard, the command prints the confirmation page and, in a terminal, asks for the token it shows; in a script, pass the token with `--step-up-token`. Refusals from the server are printed as returned, and the command exits 1. Without a terminal and without `--yes`, it exits 2 before anything is sent.
|
|
228
229
|
|
|
229
|
-
Use `primitive signup <email>` for new account creation, then `primitive signup confirm <email> <code>` with the emailed verification code.
|
|
230
|
+
Use `primitive signup <email>` for new account creation, then `primitive signup confirm <email> <code>` with the emailed verification code. Without a terminal, pass `--accept-terms`.
|
|
230
231
|
|
|
231
232
|
### Switching organizations
|
|
232
233
|
|
|
233
234
|
Where the server supports it, browser login (`primitive login` with no email) logs you in as yourself rather than into one organization. The organization you choose in the browser becomes the current one, and you can switch without logging in again:
|
|
234
235
|
|
|
235
236
|
```bash
|
|
236
|
-
primitive
|
|
237
|
+
primitive org list # your organizations, your role, and whether the CLI may be used there
|
|
237
238
|
primitive org use acme # switch by name or id
|
|
238
239
|
primitive emails list --org beta # act in another organization for one command
|
|
239
240
|
```
|
|
240
241
|
|
|
241
|
-
`--org` works on every command (set `PRIMITIVE_CLI_ORG` for the same effect; `primitive memories` keeps its own `--org` flag for organization-scoped memories). Each organization decides who may use the CLI there; when it refuses, `primitive
|
|
242
|
+
`--org` works on every command (set `PRIMITIVE_CLI_ORG` for the same effect; `primitive memories` keeps its own `--org` flag for organization-scoped memories). Each organization decides who may use the CLI there; when it refuses, `primitive org list` and `primitive org use` show the reason (`not_a_member`, `cli_access_disabled_by_org`, `role_insufficient` or `cli_access_revoked`). The CLI keeps a short-lived access token per organization and gets a new one when it expires or is rejected. `primitive logout` signs you out of every organization.
|
|
242
243
|
|
|
243
244
|
Against a server without organization switching, and for logins saved by earlier CLI versions, the login stays bound to one organization and works as before. `--org` naming a different organization is refused for such a login, for an API key and for a connected agent profile.
|
|
244
245
|
|
|
245
246
|
`primitive login --permission <permission>` asks for a narrowed login. A server that does not offer narrowed CLI logins refuses it, and the CLI stops rather than logging in with a wider grant.
|
|
246
247
|
|
|
248
|
+
### Focusing on some domains
|
|
249
|
+
|
|
250
|
+
When a credential reads mail on more than one domain, a mail listing or search without a focus stops (exit 2, error code `focus_required`), names the domains and asks for a choice. It keeps stopping until a focus is chosen; the choice is saved, so it is made once. A credential with one domain never sees any of this.
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
primitive focus set support.example.com sales.example.com # list and search only these domains
|
|
254
|
+
primitive focus set --all # every domain
|
|
255
|
+
primitive focus # show the saved focus and the domains
|
|
256
|
+
primitive focus clear # forget it
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The focus is saved per profile: for the member login in the CLI config directory, for a connected agent in its profile directory. It is never written to a credential file. `PRIMITIVE_FOCUS_DOMAINS=<name,...>` (or `all`) overrides it for a session, and `--domain <name>` or `--all-domains` for one command.
|
|
260
|
+
|
|
261
|
+
It applies to `emails list`, `emails latest`, `emails search`, `search`, `emails watch`, `inbox next`, `sent list` and `semantic-search`. Each prints one stderr line naming the focus, where it came from and how to widen it; `--json` carries `meta.focus` instead. An empty focused result also says how much matching mail is on the other domains. `sent list` filters by the sending domain. `semantic-search` with a focus searches received mail only; with `--corpus outbound` it covers every domain and says the focus was not applied. A command given its own scope (`--domain-ids` on `emails list` and `emails search`, `--domain-id` on `search` and `emails watch`, `--recipient`, `--to`, `--thread-id`, or a `domain:` or `to:` search filter) ignores the saved focus. Reads by id, notifications (`listen`, `wait`, `emails wait`, `agent check-mail`) and the CLI's own reply bookkeeping never follow it.
|
|
262
|
+
|
|
247
263
|
### Grants and keys
|
|
248
264
|
|
|
249
|
-
`primitive whoami` shows your organization, role and grant when the server reports them. `primitive whoami --check mail:send` asks whether the current credential may use a permission, prints the decision, and exits 1 when it may not; nothing is enforced by asking. A request refused because the credential's grant lacks a permission fails with `grant_forbidden`, and the CLI names the permission.
|
|
265
|
+
`primitive whoami` shows your member address, your organization, your built-in role and the credential's grant when the server reports them; only a person's own login has a role line. `primitive whoami --check mail:send` asks whether the current credential may use a permission, prints the decision, and exits 1 when it may not; nothing is enforced by asking. A request refused because the credential's grant lacks a permission fails with `grant_forbidden`, and the CLI names the permission.
|
|
250
266
|
|
|
251
267
|
```bash
|
|
252
268
|
primitive keys list
|
|
253
269
|
primitive keys get <id> --json
|
|
254
270
|
primitive keys create --name orders --permission mail:read --rule <rule-id>
|
|
255
271
|
primitive keys update <id> --add mail:send,mail:reply
|
|
272
|
+
primitive keys update <id> --expires-at 2027-02-08T00:00:00Z
|
|
256
273
|
primitive keys rotate <id>
|
|
257
274
|
primitive keys revoke <id>
|
|
258
275
|
```
|
|
259
276
|
|
|
260
|
-
`keys list` shows each key's id, prefix, name, permissions, the mail it reaches, expiry and last use, and `keys get` shows one key in full. Neither shows a secret. You see your own keys, and every key if your role may read them all.
|
|
277
|
+
`keys list` shows each key's id, prefix, name, permissions, the mail it reaches, expiry and last use, and `keys get` shows one key in full. Neither shows a secret. Revoked keys are left out of `keys list` unless you pass `--include-revoked`, which marks each `[revoked]` with when it was revoked. You see your own keys, and every key if your role may read them all.
|
|
261
278
|
|
|
262
|
-
`keys create` needs you to say what the key can do: a `--preset`, or `--permission` with the mail it reaches (`--address`, `--domain`, `--rule`, each repeatable, or `--all-mailboxes`). There is no default, and a super admin key needs `--preset super_admin`. A key never holds more than you do, and your organization's credential policy applies. `keys update` adds or removes permissions (`--add`, `--remove`) or
|
|
279
|
+
`keys create` needs you to say what the key can do: a `--preset`, or `--permission` with the mail it reaches (`--address`, `--domain`, `--rule`, each repeatable, or `--all-mailboxes`). There is no default, and a super admin key needs `--preset super_admin`. A key never holds more than you do, and your organization's credential policy applies. `keys update` adds or removes permissions (`--add`, `--remove`), adds or removes email rules (`--add-rule`, `--remove-rule`), or replaces them all (`--rule`); the key keeps its id and secret. A request already held open with that key, such as a long poll or a wait, ends once when its permissions change. `keys update --expires-at <time>` extends a key before it expires, within your organization's credential policy, and `--no-expiry` removes its expiry where the policy allows. Rotating keeps the expiry: `keys rotate` gives the new key the old key's expiry unless you pass `--expires-at` or `--no-expiry`. An expired key cannot be extended.
|
|
263
280
|
|
|
264
281
|
Creating, rotating and changing a key run directly. If your organization requires approval, the command prints the approval link, opens it where it can, and waits for the one-time token the page shows. In a script it prints the link and exits: approve, then run it again with `--step-up-token`. The new secret is printed once, alone on stdout (or in the JSON with `--json`), and the CLI never saves it, so store it right away. `keys revoke` asks for confirmation; pass `--yes` in scripts.
|
|
265
282
|
|
|
266
|
-
`primitive roles list`, `primitive roles groups`, `primitive roles mailbox-access` and `primitive roles access-mode` read roles, groups, mailbox access and the access mode. Where the server has not enabled them, they print `feature_disabled`. The built-in roles are `owner`, `admin
|
|
283
|
+
`primitive roles list`, `primitive roles groups`, `primitive roles mailbox-access` and `primitive roles access-mode` read roles, groups, mailbox access and the access mode. `primitive members list` lists the members and their roles. Where the server has not enabled them, they print `feature_disabled`. The built-in roles are `owner`, `admin` and `member`. Operator is a template with every permission `admin` has except managing members, changing roles, managing mailbox delegations, sending invitations and billing. By default, owners, admins and operators may use the CLI. An organization can open it to every member by setting `cli_access` to `all_members` in its credential policy.
|
|
267
284
|
|
|
268
285
|
### Trying the preview
|
|
269
286
|
|
|
270
|
-
Install the 3.0.0 preview with `npm install -g primitive@preview`. `npm install -g primitive` stays on the latest stable version.
|
|
287
|
+
Install the 3.0.0 preview with `npm install -g primitive@preview`. `npm install -g primitive` stays on the latest stable version. Code that uses the SDK alongside the preview CLI, such as a webhook handler reading `email.analysis.understanding`, needs the preview SDK too: `npm install @primitivedotdev/sdk@preview`, or the Python and Go previews their READMEs name. The 2.x SDK does not type the email rules payload.
|
|
271
288
|
|
|
272
289
|
### Downgrading after signing in as yourself
|
|
273
290
|
|
|
@@ -359,7 +376,7 @@ primitive emails list
|
|
|
359
376
|
primitive emails get --id <inbound-email-id>
|
|
360
377
|
primitive emails get --id <inbound-email-id> --context
|
|
361
378
|
primitive emails get --id <inbound-email-id> --compact
|
|
362
|
-
primitive sent list
|
|
379
|
+
primitive sent list # your own sends; --all-senders for every send you can read
|
|
363
380
|
primitive sent delete --id <sent-email-id>
|
|
364
381
|
primitive domains list
|
|
365
382
|
primitive billing
|
|
@@ -371,7 +388,7 @@ primitive memories get thread:latest
|
|
|
371
388
|
primitive deliveries replay --id <delivery-id>
|
|
372
389
|
```
|
|
373
390
|
|
|
374
|
-
|
|
391
|
+
Use canonical CLI names and the documented command-specific input/output forms, for example `primitive emails:list` and `primitive sending:reply`.
|
|
375
392
|
|
|
376
393
|
## Send outcomes and exit codes
|
|
377
394
|
|
|
@@ -491,15 +508,39 @@ With `--json`, stdout is exactly one JSON document, on success and on failure,
|
|
|
491
508
|
and stderr stays empty. Output merged with `2>&1` therefore still parses:
|
|
492
509
|
|
|
493
510
|
- Notices the command would otherwise print on stderr (hints, progress, prior
|
|
494
|
-
reply warnings) go in the document's `warnings` array
|
|
511
|
+
reply warnings) go in the document's `warnings` array, or in `cli_warnings`
|
|
512
|
+
when the document already has a `warnings` of its own.
|
|
495
513
|
- A failure adds `error` and `exit_code`. If the command printed no document of
|
|
496
|
-
its own, the CLI prints `{ "error": ..., "exit_code": ... }`.
|
|
514
|
+
its own, the CLI prints `{ "error": ..., "exit_code": ... }`. An error the
|
|
515
|
+
CLI raises itself carries a `code`: `usage_error` (exit 2) when it refused
|
|
516
|
+
before sending anything, such as a bad flag or an unreadable file, and
|
|
517
|
+
`cli_error` otherwise.
|
|
518
|
+
- Generated commands check missing required request-body fields after merging
|
|
519
|
+
flags and JSON, before authentication or HTTP requests. Their `usage_error` includes
|
|
520
|
+
`error.details.missing`: an array of `{ field, flag, json_path }`, such as
|
|
521
|
+
`{ "field": "email", "flag": "--email", "json_path": "$.email" }`.
|
|
522
|
+
`flag` is null when the field must be supplied in JSON.
|
|
523
|
+
- For UUID input fields explicitly marked `x-primitive-retry-id` in the API
|
|
524
|
+
contract, generated commands create a retry ID when omitted. Caller values
|
|
525
|
+
are preserved. The ID is reused during approval and printed before requests
|
|
526
|
+
in human output. With `--json`, `cli_retry_ids` lists generated values as
|
|
527
|
+
`{ field, flag, json_path, value, source: "generated" }` on success or failure.
|
|
528
|
+
Retry the same operation and inputs with that value explicitly supplied.
|
|
529
|
+
Unmarked fields, including resource IDs named `request_id`, have no default.
|
|
530
|
+
- Unknown commands exit 2 with `error.code` `command_not_found`. When nearby
|
|
531
|
+
commands exist, `error.details.suggestions` lists their full invocations.
|
|
497
532
|
- Generated API commands (`primitive sent list`, `primitive emails list`, ...)
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
533
|
+
print the API's response body with `--json`: `data`, and `meta` with
|
|
534
|
+
`meta.cursor` for the next page where the route sends it, plus the CLI's own
|
|
535
|
+
`summary` (such as an empty-result hint). Read a list as `.data[]` and an
|
|
536
|
+
object's fields as `.data.<field>`. Without `--json`, stdout is the data
|
|
537
|
+
payload and the `next cursor: <cursor>` line goes to stderr.
|
|
538
|
+
`sent list` prints a human-readable table instead; use `--json` for its data.
|
|
539
|
+
- `activity created|asked|concerning --json` returns `{data, meta}`: the rows
|
|
540
|
+
are in `data`, with `covers`, `withheld` and the next page's `cursor` in `meta`.
|
|
541
|
+
- Positional arguments are read only from the command line. Piped stdin is
|
|
542
|
+
ignored unless the command explicitly accepts a body, secret or hook input.
|
|
543
|
+
- Hand-written commands whose `--json` output is a bare array keep that shape.
|
|
503
544
|
- `primitive listen` streams JSONL and is not covered by this rule.
|
|
504
545
|
|
|
505
546
|
## Searching mail
|
|
@@ -512,7 +553,7 @@ prints a table (header on stderr). Each result in `--json` output carries
|
|
|
512
553
|
primitive search "invoice" --from acme.com
|
|
513
554
|
primitive search "contract" --thread-id <thread-uuid> # one conversation
|
|
514
555
|
primitive search "quarterly invoi" --prefix # last word matches as a prefix
|
|
515
|
-
primitive search "a" --prefix --no-count
|
|
556
|
+
primitive search "a" --prefix --no-count # skip the total count
|
|
516
557
|
```
|
|
517
558
|
|
|
518
559
|
- `--thread-id <uuid>` only returns emails in that thread. It combines with
|
|
@@ -521,11 +562,11 @@ primitive search "a" --prefix --no-count --envelope # skip the total count
|
|
|
521
562
|
`invoi` matches invoice and invoicing. Only the final unquoted word is
|
|
522
563
|
affected.
|
|
523
564
|
- `--no-count` skips computing the total match count, which makes broad
|
|
524
|
-
queries cheaper. `meta.total` is then null in `--json` output, and
|
|
525
|
-
|
|
565
|
+
queries cheaper. `meta.total` is then null in `--json` output, and the
|
|
566
|
+
table's footer says `Total: not counted (--no-count)`. Use `meta.cursor`
|
|
526
567
|
to tell whether another page exists.
|
|
527
|
-
-
|
|
528
|
-
next-page cursor
|
|
568
|
+
- Below the table, stderr gives the total (with `+` when the count was capped)
|
|
569
|
+
and the next-page cursor.
|
|
529
570
|
|
|
530
571
|
These flags apply to the default lexical search only and are rejected with
|
|
531
572
|
`--mode`.
|
|
@@ -547,7 +588,7 @@ checking the agent in the app before retrying. Foreground or external runtime
|
|
|
547
588
|
hooks are not managed by this command.
|
|
548
589
|
|
|
549
590
|
After disconnecting an agent, an owner or admin logged in with OAuth can run
|
|
550
|
-
`primitive agent-connections
|
|
591
|
+
`primitive agent-connections delete --address agent@example.com`.
|
|
551
592
|
This removes the revoked connection record while preserving mail, notes and the
|
|
552
593
|
external runtime. Active connections return 409; missing records return 404.
|
|
553
594
|
Organization API keys cannot remove connections.
|
|
@@ -655,7 +696,7 @@ primitive sent cancel --idempotency-key standup-2026-10-09
|
|
|
655
696
|
```
|
|
656
697
|
|
|
657
698
|
Generated operation commands also expose the request headers the spec declares,
|
|
658
|
-
for example `primitive sending send
|
|
699
|
+
for example `primitive sending send --idempotency-key <key>`.
|
|
659
700
|
|
|
660
701
|
## Recipient routing
|
|
661
702
|
|
|
@@ -665,13 +706,13 @@ endpoint is created in the same call, enabling per-address routing like
|
|
|
665
706
|
`alice@acme.com -> functionA`), or `--endpoint` for an existing endpoint.
|
|
666
707
|
|
|
667
708
|
```bash
|
|
668
|
-
primitive routes
|
|
669
|
-
primitive routes
|
|
709
|
+
primitive routes create alice@acme.com --function <function-id>
|
|
710
|
+
primitive routes create 'support+*@acme.com' --match wildcard --endpoint <endpoint-id>
|
|
670
711
|
primitive routes list
|
|
671
712
|
primitive routes test alice@acme.com # preview where an address resolves, with the rule trace
|
|
672
713
|
primitive routes update <route-id> --priority 5
|
|
673
714
|
primitive routes reorder --set <route-id>=10 --set <other-id>=20
|
|
674
|
-
primitive routes
|
|
715
|
+
primitive routes delete <route-id>
|
|
675
716
|
```
|
|
676
717
|
|
|
677
718
|
Recipient routing is gated by an organization entitlement; routes are inert
|
|
@@ -709,9 +750,9 @@ The three readers call the API as the connected address. Each returns the
|
|
|
709
750
|
|
|
710
751
|
| Reader | API operation | CLI command |
|
|
711
752
|
| --- | --- | --- |
|
|
712
|
-
| `readContactPolicy` | `getAgentContactPolicy` | `primitive contacts get-agent-
|
|
753
|
+
| `readContactPolicy` | `getAgentContactPolicy` | `primitive contacts get-agent-policy` |
|
|
713
754
|
| `readContactPage` | `listAgentContacts`, 100 rows per page, with the next `cursor` or `null` | `primitive agent contacts list` |
|
|
714
|
-
| `readNetworkAdmission` | `checkDefaultNetworkContactAdmission` | `primitive agent-networks check-
|
|
755
|
+
| `readNetworkAdmission` | `checkDefaultNetworkContactAdmission` | `primitive agent-networks check-contact-admission` |
|
|
715
756
|
|
|
716
757
|
`admit` returns one of three decisions for an email:
|
|
717
758
|
|
|
@@ -1142,6 +1183,25 @@ pass, immediately before claiming. To keep both on
|
|
|
1142
1183
|
purpose, rerun with `--keep-existing`. `--resume` continues a claim that
|
|
1143
1184
|
already happened and is never refused.
|
|
1144
1185
|
|
|
1186
|
+
### Install the bundled skills
|
|
1187
|
+
|
|
1188
|
+
`primitive skills install` copies the skills bundled in this package into a
|
|
1189
|
+
runtime's skills folder, for sessions that use a member login instead of
|
|
1190
|
+
`agent connect`:
|
|
1191
|
+
|
|
1192
|
+
```sh
|
|
1193
|
+
primitive skills install --runtime claude
|
|
1194
|
+
primitive skills install primitive-connect --runtime codex --json
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
It installs every bundled skill, or only the one named, into the runtime's
|
|
1198
|
+
`skills` folder (`$CLAUDE_CONFIG_DIR` or `~/.claude` for Claude, `$CODEX_HOME`
|
|
1199
|
+
or `~/.codex` for Codex; `--project` uses `.claude/skills`
|
|
1200
|
+
or `.agents/skills` in the current directory), and reports each skill's path,
|
|
1201
|
+
state (`installed`, `updated`, `unchanged` or `failed`) and content version.
|
|
1202
|
+
A copy already at the bundled version is left unchanged, and a symlinked copy
|
|
1203
|
+
is replaced by a real directory. A name that is not bundled exits 2.
|
|
1204
|
+
|
|
1145
1205
|
### Set up a machine for every coding session
|
|
1146
1206
|
|
|
1147
1207
|
`primitive machine doctor` checks what lets each Claude Code, Codex and omp
|
|
@@ -1538,3 +1598,14 @@ The ordinary final reply still needs to be read and evaluated. A clarification
|
|
|
1538
1598
|
or blocker does not end that conversation. Sender authentication,
|
|
1539
1599
|
exact-session ownership and explicit silence still apply. Separate topics
|
|
1540
1600
|
remain separate conversations.
|
|
1601
|
+
|
|
1602
|
+
## Canonical commands
|
|
1603
|
+
|
|
1604
|
+
Generated request inputs and readable task inputs share one short command path.
|
|
1605
|
+
For example, `wake schedules create` accepts `--from`, `--to` and `--cron`, or
|
|
1606
|
+
request fields through `--raw-body`/`--body-file`. Inputs exclusive to one form
|
|
1607
|
+
cannot be mixed; the CLI reports those combinations before making a request.
|
|
1608
|
+
With `--json`, both forms put the result in `data` and preserve pagination metadata.
|
|
1609
|
+
Retired spellings are refused with a suggestion, never executed as aliases.
|
|
1610
|
+
`functions redeploy --id <id>` redeploys stored source; add `--file <bundle>`
|
|
1611
|
+
to upload a new bundle, with the existing secret and deployment-wait options.
|
package/bin/run.js
CHANGED
|
@@ -86,5 +86,24 @@ await writeRootAuthContextIfNeeded();
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
// A removed child can otherwise become a parent's positional argument (for
|
|
90
|
+
// example search semantic-search). Reject retired paths before any command runs.
|
|
91
|
+
const { COMMANDS, retiredCommandTarget } = await import("../dist/oclif/index.js");
|
|
92
|
+
const retired = retiredCommandTarget(process.argv.slice(2));
|
|
93
|
+
if (retired) {
|
|
94
|
+
const target = COMMANDS[retired.newId];
|
|
95
|
+
const suggestions = target && !target.hidden
|
|
96
|
+
? [`primitive ${retired.newId.replaceAll(":", " ")}`]
|
|
97
|
+
: [];
|
|
98
|
+
const message = `Unknown command "primitive ${retired.oldId.replaceAll(":", " ")}".${suggestions.length ? ` Did you mean "${suggestions[0]}"?` : ""} Run "primitive --help" to see the commands.`;
|
|
99
|
+
const error = { code: "command_not_found", message,
|
|
100
|
+
...(suggestions.length ? { details: { suggestions } } : {}),
|
|
101
|
+
};
|
|
102
|
+
if ((separator === -1 ? cliArgs : cliArgs.slice(0, separator)).includes("--json"))
|
|
103
|
+
process.stdout.write(`${JSON.stringify({ error, exit_code: 2 }, null, 2)}\n`);
|
|
104
|
+
else process.stderr.write(`${message}\n`);
|
|
105
|
+
process.exitCode = 2;
|
|
106
|
+
} else {
|
|
107
|
+
const { execute } = await import("@oclif/core");
|
|
108
|
+
await execute({ dir: import.meta.url });
|
|
109
|
+
}
|