primcli 1.29.0 → 1.31.0

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.
@@ -1,4 +1,4 @@
1
- import { S as normalizeApiBaseUrl, c as resolveConfigEnvironment, i as loadCliConfig } from "../cli-config-BKso8oJu.js";
1
+ import { S as normalizeApiBaseUrl, c as resolveConfigEnvironment, i as loadCliConfig } from "../cli-config-BvflSzQe.js";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { homedir } from "node:os";
package/man/primitive.1 CHANGED
@@ -27,6 +27,30 @@ receives existing webhook events without a public endpoint. It prints complete
27
27
  JSONL bodies on stdout and status on stderr. Use saved login credentials or
28
28
  PRIMITIVE_API_KEY. A private default destination is saved per API host and account.
29
29
  .PP
30
+ .B primitive listen --notify-session UUID --sender person@example.com
31
+ queues external email metadata into one exact loaded native Codex session.
32
+ Requires an existing private native local-session Unix socket and a connected-agent
33
+ credential. This mode requires WebSocket and the shared saved subscription;
34
+ --transport poll and a custom --subscription are rejected. The local-mail-*
35
+ subscription namespace is reserved for shared receiving. No runtime is launched. Repeat --sender or use comma-separated exact
36
+ addresses. Routine authenticated status interactions do not notify the session.
37
+ .PP
38
+ .B primitive listen --status --notify-session UUID
39
+ inspects local notification receipts without receiving mail or connecting to a
40
+ session. Accepted means queued; unknown outcomes are held across restarts and are
41
+ never automatically resent. Inspect the exact session before a manual resend.
42
+ Use --limit (default 100, maximum 1000) and --cursor with the returned nextCursor
43
+ to page through receipts. Notification subscriptions accept email.received only;
44
+ --once counts a candidate processed during this invocation, including filtered
45
+ or routine email, not a model wake. Waiter-owned replies and existing accepted
46
+ notification receipts do not count. Inbound IDs are saved before server
47
+ acknowledgement; pending authentication or parsing retries exact IDs locally.
48
+ .PP
49
+ Connected chat, exact-parent emails wait, and native notifications share one
50
+ receiver per local installation, API environment, and credential. A remaining
51
+ foreground participant can resume receiving after the owner exits. Generic
52
+ stdout, exec, forwarding, and emails watch remain separate consumers.
53
+ .PP
30
54
  .B primitive listen init --language python
31
55
  creates a Python starter in a new primitive-listener directory. Generation is
32
56
  offline and refuses to overwrite files. Change into that directory and run
@@ -144,6 +168,23 @@ Print the generated API operation manifest.
144
168
  .TP
145
169
  .B primitive describe COMMAND_OR_OPERATION
146
170
  Describe a generated API operation, including request and response schemas.
171
+
172
+ .SS Waiting with connected credentials
173
+ .B primitive emails wait --reply-to-sent-email-id <sent-id> --from peer@example.com
174
+ waits on an existing send without resending it. The receiving address comes
175
+ from the sent record; an optional --to must match. Existing replies are included
176
+ by default, and --since narrows the window. Only authenticated, exactly threaded
177
+ plain replies are returned; interaction attachments remain pending for inspection.
178
+ JSONL contains matching email details; --table prints compact rows. Timeout exits
179
+ 1. Connected waits share one local address event receiver and use exact-parent
180
+ search for recovery; they never scan inbox history. Organization credentials
181
+ retain the existing search-based wait behavior.
182
+ .PP
183
+ Connected chat authenticates the reply receiver before sending and records a
184
+ stable idempotency key. After a lost send response, repeating the same command
185
+ looks up that key without sending again. Timed-out exact-parent waits retain
186
+ their claim for resume. A plain reply does not prove task completion.
187
+
147
188
  .SH GLOBAL OPTIONS
148
189
  .TP
149
190
  .B --api-key KEY
@@ -154,6 +195,39 @@ Print command duration to standard error after completion.
154
195
  .TP
155
196
  .B --help
156
197
  Show command help.
198
+ .SH EXIT STATUS
199
+ .B primitive chat,
200
+ .B primitive chat reply,
201
+ .B primitive send
202
+ and
203
+ .B primitive reply
204
+ share one outcome vocabulary. With
205
+ .B --json
206
+ the outcome is the
207
+ .B outcome
208
+ field of an envelope printed for every result.
209
+ .TP
210
+ .B 0
211
+ .BR replied ,
212
+ .B sent
213
+ (accepted for delivery; queued counts) or
214
+ .B already_sent
215
+ (an identical earlier send, including HTTP 410 sent_email_deleted; nothing new went out).
216
+ .TP
217
+ .B 1
218
+ .BR not_sent :
219
+ the API rejected the request, the command failed before sending, or the send record has status agent_failed, gate_denied or canceled.
220
+ .TP
221
+ .B 2
222
+ Invalid flags or arguments. Nothing was sent.
223
+ .TP
224
+ .B 3
225
+ .BR sent_awaiting_reply :
226
+ chat sent the message but no reply arrived before the timeout. Wait; do not resend.
227
+ .TP
228
+ .B 4
229
+ .BR uncertain :
230
+ transport error, conflict, server error, or a send record with status unknown. The message may have gone out; check sent history before retrying.
157
231
  .SH ENVIRONMENT
158
232
  .TP
159
233
  .B PRIMITIVE_API_KEY
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primcli",
3
- "version": "1.29.0",
3
+ "version": "1.31.0",
4
4
  "description": "Official Primitive CLI: deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal. Wraps the @primitivedotdev/sdk runtime client with one-shot commands.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -50,10 +50,10 @@
50
50
  "description": "Manage your account settings, storage, and webhook secret"
51
51
  },
52
52
  "agent-connections": {
53
- "description": "Remove revoked agent connections with an organization owner or admin login. This preserves mail and does not stop the external runtime."
53
+ "description": "Claim a private invitation from stdin or remove a revoked connection with an owner/admin login."
54
54
  },
55
55
  "agent": {
56
- "description": "Agent signup and authentication API operations"
56
+ "description": "Connect an existing agent privately, manage its contacts, or use agent signup operations."
57
57
  },
58
58
  "credits": {
59
59
  "description": "Redeem credit codes and check the organization credit balance"
@@ -129,7 +129,13 @@
129
129
  "description": "Schedule and send wake commands to your own functions over signed email, and manage which senders may wake them. Use `primitive wake schedules list|create|get|update|delete|run`, `primitive wake authorizations list|create|update|delete`, and `primitive wake dispatches list`."
130
130
  },
131
131
  "listen": {
132
- "description": "Receive existing webhook events locally. Run primitive listen for JSONL, use --exec for a short durable acceptance hook, or --forward-to for an existing local webhook handler."
132
+ "description": "Receive events locally as JSONL, use --exec or --forward-to, or notify an exact loaded native session with --notify-session and approved --sender addresses. Use --status --notify-session to inspect durable notification receipts."
133
+ },
134
+ "contacts": {
135
+ "description": "Shared organization contacts. Use list, get, add, update, or remove; edits use conditional versions."
136
+ },
137
+ "agent:contacts": {
138
+ "description": "Contacts and notification preferences for one agent address. Connected profiles default to their own address."
133
139
  }
134
140
  },
135
141
  "topicSeparator": " "
@@ -160,13 +166,15 @@
160
166
  "@oclif/plugin-autocomplete": "^3.2.45",
161
167
  "@oclif/plugin-help": "^6.2.44",
162
168
  "@oclif/plugin-warn-if-update-available": "^3.1.65",
163
- "viem": "^2.21.0"
169
+ "viem": "^2.21.0",
170
+ "ws": "^8.21.0"
164
171
  },
165
172
  "devDependencies": {
166
173
  "@biomejs/biome": "^2.4.10",
167
174
  "@primitivedotdev/api-core": "workspace:*",
168
175
  "@primitivedotdev/sdk": "workspace:*",
169
176
  "@types/node": "^22.10.2",
177
+ "@types/ws": "^8.18.1",
170
178
  "@vitest/coverage-v8": "^4.1.11",
171
179
  "oclif": "^4.23.0",
172
180
  "tsdown": "^0.21.10",