@primitivedotdev/cli 3.0.0-preview.20 → 3.0.0-preview.22

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 CHANGED
@@ -101,20 +101,20 @@ the readiness message: `primitive endpoints delete --id DESTINATION_ID`.
101
101
 
102
102
  ### Low-level delivery API
103
103
 
104
- The generated `endpoints pull-webhook-event` and `endpoints complete-webhook-event`
104
+ The generated `endpoints pull-event` and `endpoints complete-event`
105
105
  commands expose the local-delivery API when enabled on your API host. These are
106
106
  single API calls; a receive loop must retain the destination identity and report
107
107
  each attempt's outcome. Use `--help-full` to inspect the request fields:
108
108
 
109
109
  ```sh
110
- primitive endpoints pull-webhook-event --help-full
111
- primitive endpoints complete-webhook-event --help-full
110
+ primitive endpoints pull-event --help-full
111
+ primitive endpoints complete-event --help-full
112
112
  ```
113
113
 
114
114
  Completion uses a mode-specific JSON body. For a successful process handler:
115
115
 
116
116
  ```sh
117
- primitive endpoints complete-webhook-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
+ 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}'
118
118
  ```
119
119
 
120
120
  Use the IDs and lease token returned by pull. HTTP forwarding reports
@@ -234,12 +234,12 @@ Use `primitive signup <email>` for new account creation, then `primitive signup
234
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:
235
235
 
236
236
  ```bash
237
- primitive orgs # your organizations, your role, and whether the CLI may be used there
237
+ primitive org list # your organizations, your role, and whether the CLI may be used there
238
238
  primitive org use acme # switch by name or id
239
239
  primitive emails list --org beta # act in another organization for one command
240
240
  ```
241
241
 
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 orgs` 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
+ `--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.
243
243
 
244
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.
245
245
 
@@ -280,7 +280,7 @@ primitive keys revoke <id>
280
280
 
281
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.
282
282
 
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 roles members` (also `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.
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.
284
284
 
285
285
  ### Trying the preview
286
286
 
@@ -388,7 +388,7 @@ primitive memories get thread:latest
388
388
  primitive deliveries replay --id <delivery-id>
389
389
  ```
390
390
 
391
- Generated API commands remain available for compatibility and full schema parity, for example `primitive emails:list-emails` and `primitive sending:reply-to-email`.
391
+ Use canonical CLI names and the documented command-specific input/output forms, for example `primitive emails:list` and `primitive sending:reply`.
392
392
 
393
393
  ## Send outcomes and exit codes
394
394
 
@@ -535,6 +535,11 @@ and stderr stays empty. Output merged with `2>&1` therefore still parses:
535
535
  `summary` (such as an empty-result hint). Read a list as `.data[]` and an
536
536
  object's fields as `.data.<field>`. Without `--json`, stdout is the data
537
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.
538
543
  - Hand-written commands whose `--json` output is a bare array keep that shape.
539
544
  - `primitive listen` streams JSONL and is not covered by this rule.
540
545
 
@@ -583,7 +588,7 @@ checking the agent in the app before retrying. Foreground or external runtime
583
588
  hooks are not managed by this command.
584
589
 
585
590
  After disconnecting an agent, an owner or admin logged in with OAuth can run
586
- `primitive agent-connections remove-agent-connection --address agent@example.com`.
591
+ `primitive agent-connections delete --address agent@example.com`.
587
592
  This removes the revoked connection record while preserving mail, notes and the
588
593
  external runtime. Active connections return 409; missing records return 404.
589
594
  Organization API keys cannot remove connections.
@@ -691,7 +696,7 @@ primitive sent cancel --idempotency-key standup-2026-10-09
691
696
  ```
692
697
 
693
698
  Generated operation commands also expose the request headers the spec declares,
694
- for example `primitive sending send-email --idempotency-key <key>`.
699
+ for example `primitive sending send --idempotency-key <key>`.
695
700
 
696
701
  ## Recipient routing
697
702
 
@@ -701,13 +706,13 @@ endpoint is created in the same call, enabling per-address routing like
701
706
  `alice@acme.com -> functionA`), or `--endpoint` for an existing endpoint.
702
707
 
703
708
  ```bash
704
- primitive routes add alice@acme.com --function <function-id>
705
- primitive routes add 'support+*@acme.com' --match wildcard --endpoint <endpoint-id>
709
+ primitive routes create alice@acme.com --function <function-id>
710
+ primitive routes create 'support+*@acme.com' --match wildcard --endpoint <endpoint-id>
706
711
  primitive routes list
707
712
  primitive routes test alice@acme.com # preview where an address resolves, with the rule trace
708
713
  primitive routes update <route-id> --priority 5
709
714
  primitive routes reorder --set <route-id>=10 --set <other-id>=20
710
- primitive routes remove <route-id>
715
+ primitive routes delete <route-id>
711
716
  ```
712
717
 
713
718
  Recipient routing is gated by an organization entitlement; routes are inert
@@ -745,9 +750,9 @@ The three readers call the API as the connected address. Each returns the
745
750
 
746
751
  | Reader | API operation | CLI command |
747
752
  | --- | --- | --- |
748
- | `readContactPolicy` | `getAgentContactPolicy` | `primitive contacts get-agent-contact-policy` |
753
+ | `readContactPolicy` | `getAgentContactPolicy` | `primitive contacts get-agent-policy` |
749
754
  | `readContactPage` | `listAgentContacts`, 100 rows per page, with the next `cursor` or `null` | `primitive agent contacts list` |
750
- | `readNetworkAdmission` | `checkDefaultNetworkContactAdmission` | `primitive agent-networks check-default-network-contact-admission` |
755
+ | `readNetworkAdmission` | `checkDefaultNetworkContactAdmission` | `primitive agent-networks check-contact-admission` |
751
756
 
752
757
  `admit` returns one of three decisions for an email:
753
758
 
@@ -1593,3 +1598,14 @@ The ordinary final reply still needs to be read and evaluated. A clarification
1593
1598
  or blocker does not end that conversation. Sender authentication,
1594
1599
  exact-session ownership and explicit silence still apply. Separate topics
1595
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
- const { execute } = await import("@oclif/core");
90
- await execute({ dir: import.meta.url });
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
+ }