primcli 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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
function object(value) {
|
|
3
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
/** Only explicit annotations on UUID input fields enable defaults. */
|
|
6
|
+
function retryIdFields(schema) {
|
|
7
|
+
if (!object(schema) || !object(schema.properties)) return [];
|
|
8
|
+
return Object.entries(schema.properties).filter(([, property]) => object(property) && property["x-primitive-retry-id"] === true && property.type === "string" && property.format === "uuid").map(([name]) => name);
|
|
9
|
+
}
|
|
10
|
+
function prepareRetryIds(schema, body, bodyFlagToProperty, generate = randomUUID) {
|
|
11
|
+
if (body !== void 0 && !object(body)) return {
|
|
12
|
+
body,
|
|
13
|
+
ids: []
|
|
14
|
+
};
|
|
15
|
+
const flags = new Map([...bodyFlagToProperty].map(([flag, property]) => [property, `--${flag}`]));
|
|
16
|
+
let prepared = body;
|
|
17
|
+
const ids = [];
|
|
18
|
+
for (const field of retryIdFields(schema)) {
|
|
19
|
+
if (object(prepared) && Object.hasOwn(prepared, field)) continue;
|
|
20
|
+
if (prepared === body) prepared = { ...object(body) ? body : {} };
|
|
21
|
+
const value = generate();
|
|
22
|
+
Object.defineProperty(prepared, field, {
|
|
23
|
+
value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
ids.push({
|
|
29
|
+
field,
|
|
30
|
+
flag: flags.get(field) ?? null,
|
|
31
|
+
json_path: /^[A-Za-z_][A-Za-z0-9_]*$/.test(field) ? `$.${field}` : `$[${JSON.stringify(field)}]`,
|
|
32
|
+
value,
|
|
33
|
+
source: "generated"
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
body: prepared,
|
|
38
|
+
ids
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const generatedIds = /* @__PURE__ */ new WeakMap();
|
|
42
|
+
/** Store metadata per invocation, never on a shared command class or alias. */
|
|
43
|
+
function rememberRetryIds(command, ids) {
|
|
44
|
+
if (ids.length) generatedIds.set(command, ids);
|
|
45
|
+
else generatedIds.delete(command);
|
|
46
|
+
}
|
|
47
|
+
function takeRetryIds(command) {
|
|
48
|
+
const ids = generatedIds.get(command) ?? [];
|
|
49
|
+
generatedIds.delete(command);
|
|
50
|
+
return ids;
|
|
51
|
+
}
|
|
52
|
+
function writeRetryIdNotice(ids) {
|
|
53
|
+
for (const id of ids) {
|
|
54
|
+
const reference = id.flag ?? id.json_path;
|
|
55
|
+
const retry = id.flag ? `with ${id.flag} ${id.value}` : `with ${id.json_path} set to this value in your JSON body`;
|
|
56
|
+
process.stderr.write(`Retry ID (${reference}): ${id.value}\nRetry the same operation and inputs ${retry}.\n`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export { writeRetryIdNotice as a, takeRetryIds as i, rememberRetryIds as n, retryIdFields as r, prepareRetryIds as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as retryTransient, _ as isTrustedSender, c as classifySignalContent } from "./repeats-Dj_o6c-X-r9r6uQOb.js";
|
|
2
2
|
// src/oclif/presence-provenance.ts
|
|
3
3
|
function readPresenceProjection(detail) {
|
|
4
4
|
if (!detail || typeof detail !== "object") return null;
|
|
@@ -57,6 +57,17 @@ function tryOwnSharedMail(store) {
|
|
|
57
57
|
lastMailCheckAt: null
|
|
58
58
|
};
|
|
59
59
|
let closed = false;
|
|
60
|
+
const status = () => {
|
|
61
|
+
if (closed) return null;
|
|
62
|
+
const raw = readMailJson(path);
|
|
63
|
+
if (raw === null) throw invalidSharedMail();
|
|
64
|
+
const saved = ownerRecord(raw);
|
|
65
|
+
if (saved.generation !== current.generation || saved.pid !== current.pid || saved.identity !== current.identity || saved.ready !== current.ready || saved.gapCount !== current.gapCount || saved.lastGapReason !== current.lastGapReason || saved.lastMailCheckAt !== current.lastMailCheckAt) throw invalidSharedMail();
|
|
66
|
+
return {
|
|
67
|
+
...current,
|
|
68
|
+
alive: true
|
|
69
|
+
};
|
|
70
|
+
};
|
|
60
71
|
try {
|
|
61
72
|
writeMailJson(path, current);
|
|
62
73
|
} catch (error) {
|
|
@@ -77,6 +88,7 @@ function tryOwnSharedMail(store) {
|
|
|
77
88
|
};
|
|
78
89
|
return {
|
|
79
90
|
generation: current.generation,
|
|
91
|
+
status,
|
|
80
92
|
markReady(status = {}) {
|
|
81
93
|
markStatus({
|
|
82
94
|
...status,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Gn as sendEmail, S as describeApiFailure, h as sendPreparedSignal, ht as createEndpoint, p as prepareSignalEmail, wn as listSentEmails, zt as getEmail } from "./repeats-Dj_o6c-X-r9r6uQOb.js";
|
|
2
|
+
import { A as bareAddress, Dt as successfulSendOutcome, c as extractErrorPayload, ut as classifySendError } from "./api-command-JSxKMsEp.js";
|
|
3
3
|
import { recordSentSignal } from "./oclif/auto-signals.js";
|
|
4
4
|
import { _ as acquireListenLock, c as mailTime, d as readMailJson, f as removeMailFile, h as writeMailJson, i as mailId, l as privateMailDirectory, m as withMailLock, n as invalidSharedMail, o as mailObject, p as syncMailDirectory, r as mailAddress, s as mailString, t as SharedMailStateError, v as compareListenProcessIdentity, x as listenProcessIdentity, y as listenIdentity } from "./shared-mail-files-BAQSGxxz.js";
|
|
5
|
-
import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-
|
|
6
|
-
import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-
|
|
5
|
+
import { i as readApiBeforeDeadline, n as isPlainChatReply, o as scopedChatSenderTrust } from "./scoped-chat-BqmFQ1yz.js";
|
|
6
|
+
import { n as tryOwnSharedMail, r as waitForSharedMailChange, t as readSharedMailOwner } from "./shared-mail-watch-DdtgJOrV.js";
|
|
7
7
|
import { Errors } from "@oclif/core";
|
|
8
8
|
import { opendirSync } from "node:fs";
|
|
9
9
|
import { createHash, randomUUID, scryptSync } from "node:crypto";
|
|
10
10
|
import { dirname, join } from "node:path";
|
|
11
11
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
12
|
-
// ../sdk-node/dist/api-
|
|
12
|
+
// ../sdk-node/dist/api-Dg62AcfG.js
|
|
13
13
|
const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
|
|
14
14
|
function createSseClient({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) {
|
|
15
15
|
let lastEventId;
|
|
@@ -1831,6 +1831,10 @@ async function openSharedMailStore(options) {
|
|
|
1831
1831
|
/** The API's code for an account credential creating a pull subscription. */
|
|
1832
1832
|
const AGENT_CONNECTION_REQUIRED = "pull_subscription_requires_agent_connection";
|
|
1833
1833
|
const AGENT_CONNECTION_REQUIRED_MESSAGE = "primitive listen needs a connected agent credential, which limits the subscription to one address. Connect one with primitive agent connect and select its profile. With an account API key, watch mail with primitive emails watch or receive it at an HTTP webhook endpoint instead.";
|
|
1834
|
+
/** The API's code for a full API key that was revoked. */
|
|
1835
|
+
const KEY_REVOKED = "key_revoked";
|
|
1836
|
+
/** What a listener says when its agent's key was revoked: connect again, as signing in cannot bring it back. */
|
|
1837
|
+
const KEY_REVOKED_MESSAGE = "This agent's key was revoked, so it no longer works. Connect the agent again for a new one; signing in does not bring it back.";
|
|
1834
1838
|
/** Connected-agent API keys are the only credentials that can create pull subscriptions. */
|
|
1835
1839
|
function isConnectedAgentKey(apiKey) {
|
|
1836
1840
|
return apiKey?.startsWith("pconn_") === true;
|
|
@@ -1855,7 +1859,9 @@ async function ensureSharedMailSubscription(options) {
|
|
|
1855
1859
|
responseStyle: "fields"
|
|
1856
1860
|
});
|
|
1857
1861
|
if (result.error || !result.data?.data) {
|
|
1858
|
-
|
|
1862
|
+
const error = result.error;
|
|
1863
|
+
if (error?.error?.code === "pull_subscription_requires_agent_connection") throw new EventReceiverError(AGENT_CONNECTION_REQUIRED_MESSAGE, AGENT_CONNECTION_REQUIRED, 403);
|
|
1864
|
+
if (error?.error?.code === "key_revoked") throw new EventReceiverError(KEY_REVOKED_MESSAGE, KEY_REVOKED, 401);
|
|
1859
1865
|
throw new EventReceiverError("Could not open the shared inbound subscription.", "subscription_failed", result.response?.status ?? 0);
|
|
1860
1866
|
}
|
|
1861
1867
|
const created = result.data.data;
|
|
@@ -1993,13 +1999,16 @@ async function openSharedMailReceiver(options) {
|
|
|
1993
1999
|
let failure;
|
|
1994
2000
|
let cleanupFailure;
|
|
1995
2001
|
let active;
|
|
2002
|
+
let owned = null;
|
|
1996
2003
|
function ensureOwner() {
|
|
1997
2004
|
signal.throwIfAborted();
|
|
1998
2005
|
if (failure !== void 0) throw failure;
|
|
2006
|
+
if (owned) return owned.status();
|
|
1999
2007
|
const current = readSharedMailOwner(store);
|
|
2000
2008
|
if (current?.alive || active) return current;
|
|
2001
2009
|
const owner = tryOwnSharedMail(store);
|
|
2002
2010
|
if (!owner) return readSharedMailOwner(store);
|
|
2011
|
+
owned = owner;
|
|
2003
2012
|
active = runSharedMailTransport({
|
|
2004
2013
|
apiClient: options.apiClient,
|
|
2005
2014
|
subscription: store.subscriptionName,
|
|
@@ -2026,10 +2035,11 @@ async function openSharedMailReceiver(options) {
|
|
|
2026
2035
|
cleanupFailure = error;
|
|
2027
2036
|
failure ??= error;
|
|
2028
2037
|
} finally {
|
|
2038
|
+
owned = null;
|
|
2029
2039
|
active = void 0;
|
|
2030
2040
|
}
|
|
2031
2041
|
});
|
|
2032
|
-
return
|
|
2042
|
+
return owner.status();
|
|
2033
2043
|
}
|
|
2034
2044
|
function watch(deadline) {
|
|
2035
2045
|
const stop = new AbortController();
|
|
@@ -2046,7 +2056,7 @@ async function openSharedMailReceiver(options) {
|
|
|
2046
2056
|
return {
|
|
2047
2057
|
store,
|
|
2048
2058
|
signal,
|
|
2049
|
-
status: () => readSharedMailOwner(store),
|
|
2059
|
+
status: () => owned ? owned.status() : readSharedMailOwner(store),
|
|
2050
2060
|
async ready(deadline) {
|
|
2051
2061
|
while (deadline == null || Date.now() < deadline) {
|
|
2052
2062
|
const watching = watch(deadline);
|
|
@@ -2338,4 +2348,4 @@ async function sendSignal(context, options) {
|
|
|
2338
2348
|
release();
|
|
2339
2349
|
}
|
|
2340
2350
|
}
|
|
2341
|
-
export { ensureSharedMailSubscription as a,
|
|
2351
|
+
export { EventConnection as _, ensureSharedMailSubscription as a, KEY_REVOKED as c, createSharedMailWaiter as d, openSharedMailStore as f, otherParticipants as g, readConversationFollow as h, sharedMailScope as i, KEY_REVOKED_MESSAGE as l, followEmailConversation as m, reconcileChatSend as n, AGENT_CONNECTION_REQUIRED as o, reserveSharedMailSubscription as p, openSharedMailReceiver as r, AGENT_CONNECTION_REQUIRED_MESSAGE as s, sendSignal as t, isConnectedAgentKey as u, EventReceiverError as v };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: primitive-connect
|
|
3
|
-
description: Load before any primitive command or Primitive mail work, including in a session that is already connected
|
|
3
|
+
description: Load before any primitive command or Primitive mail work, including in a session that is already connected or using a temporary Access Pass. Covers your agent email address (sending, replying, waiting for answers or sign-up verification codes/links, reading and searching mail, --fyi acknowledgements, automatic signals, work claims, thread muting and peer agents), claiming temporary Access Passes (primitive connect), respecting global credential locks (primitive lock), pulling your live permission- and entitlement-scoped skill (primitive skill), and connecting an agent from a setup instruction (npx -y primitive@latest agent connect) or over the HTTP API without a terminal.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Your email address
|
|
@@ -26,6 +26,7 @@ session](#connect-this-session). Never send as your owner's own login instead.
|
|
|
26
26
|
| To | Run |
|
|
27
27
|
| --- | --- |
|
|
28
28
|
| Know who you are | `primitive whoami` |
|
|
29
|
+
| Load your live scoped skill | `primitive skill` (or `primitive skill install`) |
|
|
29
30
|
| Write to someone | `primitive send --to <address> --subject "<subject>" --body-stdin` |
|
|
30
31
|
| Answer an email | `primitive reply --id <email-id> --body-stdin` |
|
|
31
32
|
| Ask and use the exact answer | `primitive chat <address>`, question on stdin |
|
|
@@ -159,10 +160,8 @@ Details: [Trust rules in detail](references/collaboration.md#trust-rules-in-deta
|
|
|
159
160
|
|
|
160
161
|
## Connect this session
|
|
161
162
|
|
|
162
|
-
|
|
163
|
-
pastes a setup instruction from the Primitive app, that request authorizes the
|
|
164
|
-
connection; do not ask again. Run this in your own non-interactive tool shell,
|
|
165
|
-
with the setup URL on stdin through a quoted heredoc, never as an argument:
|
|
163
|
+
For a temporary Access Pass (`pit_v1_...`), pipe it into `primitive connect` (it dominates global auth automatically; never run `primitive unlock` if locked) and run `primitive skill` ([Access Passes and live skill](references/access-passes.md)).
|
|
164
|
+
Skip agent setup in a hook-registered Claude Code session: it is already connected. When the owner pastes a setup instruction from the Primitive app, that request authorizes the connection; do not ask again. Run this in your own non-interactive tool shell, with the setup URL on stdin through a quoted heredoc, never as an argument:
|
|
166
165
|
|
|
167
166
|
```sh
|
|
168
167
|
npx -y primitive@latest agent connect --session "$CLAUDE_CODE_SESSION_ID" --json <<'INVITATION'
|
|
@@ -181,7 +180,7 @@ Without Node.js 22 or a terminal: [HTTP API path](references/manual-setup.md#con
|
|
|
181
180
|
Read the one a task needs. Their commands assume this session acts as its
|
|
182
181
|
agent; without the hook, see [Sessions without the hook](references/connect.md#sessions-without-the-hook).
|
|
183
182
|
|
|
184
|
-
- Identity: [connect and manage](references/connect.md), [external services](references/external-services.md)
|
|
183
|
+
- Identity: [connect and manage](references/connect.md), [access passes and live skill](references/access-passes.md), [external services](references/external-services.md)
|
|
185
184
|
- Mail: [conversations](references/conversations.md), [collaboration](references/collaboration.md), [contacts](references/contacts.md), [first contact](references/contact-requests.md)
|
|
186
185
|
- Receiving: [presence](references/presence-and-receiving.md), [native sessions](references/native-session.md)
|
|
187
186
|
- Without the CLI: [manual and HTTP setup](references/manual-setup.md), [HTTP helper](references/private-api-fallback.md), [mail helpers](references/communication.md)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Temporary Access Passes and Live Scoped Skill
|
|
2
|
+
|
|
3
|
+
## Claiming a temporary Access Pass
|
|
4
|
+
|
|
5
|
+
When a user shares a temporary Access Pass URL (`https://api.primitive.dev/v1/access/pit_v1_...`) or `pit_v1_...` token, claim it through stdin so the secret stays out of process listings:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
printf '%s' '<pass-url-or-token>' | primitive connect
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- An active Access Pass binds to this agent session (auto-detecting `PRIMITIVE_SESSION_ID`, Claude Code, Codex, Antigravity, Cursor, Windsurf, Gemini CLI, OpenCode, and similar harnesses, or `--profile <name>`) and automatically dominates any global CLI login (`credentials.json`) or ambient `PRIMITIVE_API_KEY`.
|
|
12
|
+
- Never bypass an active Access Pass to use the user's global login instead, never print the returned API key, and do not auto-revoke the pass after answering unless the user explicitly asks to end access (it expires automatically).
|
|
13
|
+
- If you need more time, wider scope, or a production API key, send the user the management link returned by `primitive connect` or `primitive whoami` (`?action=extend&add=4h`, `?action=expand`, or `?action=promote`).
|
|
14
|
+
|
|
15
|
+
## Respecting global credential locks (`primitive lock`)
|
|
16
|
+
|
|
17
|
+
Users can lock their global CLI credentials (`credentials.json` and `PRIMITIVE_API_KEY`) with `primitive lock` so local agent sessions cannot accidentally use admin credentials.
|
|
18
|
+
|
|
19
|
+
- Active Access Passes (`primitive connect <url>`) and connected agent profiles (`PRIMITIVE_AGENT_PROFILE`) continue to work normally while locked.
|
|
20
|
+
- If a command fails because global credentials are locked, never run `primitive unlock` or try to work around the lock. Ask the user to share a scoped Access Pass (`primitive connect`) or to unlock manually in their own interactive terminal.
|
|
21
|
+
|
|
22
|
+
## Loading your live permission- and entitlement-scoped skill
|
|
23
|
+
|
|
24
|
+
After connecting (with an Access Pass, connected agent profile, or API key), pull the live skill document tailored to your exact active permissions and organization entitlements:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
primitive skill # print live scoped SKILL.md to stdout
|
|
28
|
+
primitive skill install # write into local agent skill directories
|
|
29
|
+
primitive skill --check # exits 0 if fresh, 2 if stale
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The live skill only includes capabilities both your credential and the organization permit (such as staged reply and standalone drafts, email rules, mail activity coordination, or semantic search). Re-run `primitive skill` or `primitive skill --check` if the user expands your pass or changes org entitlements.
|
|
@@ -145,10 +145,10 @@ email interactions; no separate interaction endpoint is required.
|
|
|
145
145
|
The organization owner can manage broader rules through their normal CLI login:
|
|
146
146
|
|
|
147
147
|
```sh
|
|
148
|
-
primitive contacts get-
|
|
149
|
-
primitive contacts
|
|
150
|
-
primitive contacts get-agent-
|
|
151
|
-
primitive contacts
|
|
148
|
+
primitive contacts get-policy
|
|
149
|
+
primitive contacts set-policy --body-file <policy-file>
|
|
150
|
+
primitive contacts get-agent-policy --agent-address agent@example.com
|
|
151
|
+
primitive contacts set-agent-policy --agent-address agent@example.com --body-file <policy-file>
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
Writes replace the document's `rules` and `allow_contact_requests`, with exactly
|
|
@@ -31,7 +31,7 @@ CLI equivalents:
|
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
33
|
primitive agent contacts list
|
|
34
|
-
primitive agent contacts
|
|
34
|
+
primitive agent contacts create person@example.com --purpose "Project coordination" --notify
|
|
35
35
|
primitive agent contacts update person@example.com --no-notify
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primitive-connect",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "c1133484268300c5",
|
|
4
4
|
"source": {
|
|
5
5
|
"repository": "https://github.com/primitivedotdev/skills",
|
|
6
6
|
"path": "skills/primitive-connect",
|
|
7
|
-
"commit": "
|
|
7
|
+
"commit": "03032d11695af6642d7cb1e0ddd7ae4d954c3ca0"
|
|
8
8
|
},
|
|
9
9
|
"files": {
|
|
10
|
-
"SKILL.md": "
|
|
10
|
+
"SKILL.md": "4508383562a1ead54a1cb62a6cd0c99661e614ccc14cdda7bcc285c66de3b9fa",
|
|
11
11
|
"package-lock.json": "5edf89546abae8a22d9cf67d1a0966f1df682e23c341a09a51c2ebdc95866ba9",
|
|
12
12
|
"package.json": "3ea7cf130139b3106b3e4909032bc53571e6e4cdbde48ab572262e3b4a250ca4",
|
|
13
|
+
"references/access-passes.md": "f8f4d3aa4ae5053effb26e92c5817123f0b6ca1cdc95936fe429857f5350da16",
|
|
13
14
|
"references/collaboration.md": "b9c599bf66ae58ea8c779cdceddb11882cc9f0da2fba0e4ca363ad8d01d64d5b",
|
|
14
15
|
"references/communication.md": "d9599e3c563a4cd1c7dd658f730306b669f7ad6522b3632dc55fd5feee60cd30",
|
|
15
16
|
"references/connect.md": "46d3e62e6b021100a0ddf84269bcb59a1725a3da4e360c797f378ce13cf5c4ec",
|
|
16
|
-
"references/contact-requests.md": "
|
|
17
|
-
"references/contacts.md": "
|
|
17
|
+
"references/contact-requests.md": "f4931e611dfe95b988010fd4547b2b66e845f1f76c202719602ff6be9e6d7508",
|
|
18
|
+
"references/contacts.md": "353dff4497e703325d496bf7e48b8cd37ee64c3ef305f895f3d669ebd76ad2a2",
|
|
18
19
|
"references/conversations.md": "c8a1125db76e40e8bf2e550223e4d4e1a86536ca43ccdd835024f6d6502098a7",
|
|
19
20
|
"references/external-services.md": "211e03cec546d2f83c78bd38985cc64203272df47eb52cf1bdce885bceee3089",
|
|
20
21
|
"references/manual-setup.md": "433f111c425cb976d153e22c851064e2e730f45229d8747ec91827f3a76b5d0e",
|
package/man/primitive.1
CHANGED
|
@@ -35,16 +35,20 @@ array; a failure adds
|
|
|
35
35
|
.B error
|
|
36
36
|
and
|
|
37
37
|
.BR exit_code .
|
|
38
|
-
Generated API commands
|
|
38
|
+
Generated API commands print the API's response body with
|
|
39
39
|
.BR --json :
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
to get the full response envelope, with the pagination cursor in
|
|
40
|
+
.BR data ,
|
|
41
|
+
and
|
|
42
|
+
.B meta
|
|
43
|
+
with the pagination cursor in
|
|
45
44
|
.B meta.cursor
|
|
46
|
-
|
|
45
|
+
where the route sends it, plus the CLI's own
|
|
47
46
|
.BR summary .
|
|
47
|
+
Without
|
|
48
|
+
.BR --json ,
|
|
49
|
+
stdout is the data payload and the
|
|
50
|
+
.B next cursor:
|
|
51
|
+
line goes to stderr.
|
|
48
52
|
.B primitive listen
|
|
49
53
|
streams JSONL and is not covered by this rule.
|
|
50
54
|
.SH LOCAL WEBHOOK EVENTS
|
|
@@ -116,9 +120,9 @@ Remove a destination using
|
|
|
116
120
|
.SH LOCAL WEBHOOK API
|
|
117
121
|
.PP
|
|
118
122
|
The generated commands
|
|
119
|
-
.B endpoints pull-
|
|
123
|
+
.B endpoints pull-event
|
|
120
124
|
and
|
|
121
|
-
.B endpoints complete-
|
|
125
|
+
.B endpoints complete-event
|
|
122
126
|
expose local webhook delivery on API hosts where it is enabled. Each command
|
|
123
127
|
makes one API request. Use their --help-full output for the input fields. Consumers
|
|
124
128
|
deduplicate event IDs and report the outcome with the returned attempt and lease.
|
|
@@ -191,7 +195,7 @@ Run
|
|
|
191
195
|
to remove local credentials, pending email-code auth state, and stale credential locks without contacting Primitive.
|
|
192
196
|
.PP
|
|
193
197
|
Where the server supports it, browser login logs you in as yourself. Run
|
|
194
|
-
.B primitive
|
|
198
|
+
.B primitive org list
|
|
195
199
|
to list your organizations and whether the CLI may be used in each, and
|
|
196
200
|
.B primitive org use ORG
|
|
197
201
|
to switch by name or id. Pass
|
|
@@ -218,6 +222,11 @@ run directly. If your organization requires approval, the command prints the
|
|
|
218
222
|
approval link and waits for the one-time token the page shows, or takes it with
|
|
219
223
|
.BR --step-up-token .
|
|
220
224
|
A new secret is printed once and never saved.
|
|
225
|
+
.B primitive keys update ID --expires-at TIME
|
|
226
|
+
extends a key before it expires; rotating keeps its expiry unless
|
|
227
|
+
.B rotate
|
|
228
|
+
is given
|
|
229
|
+
.BR --expires-at .
|
|
221
230
|
.B primitive keys revoke ID
|
|
222
231
|
revokes a key.
|
|
223
232
|
.B primitive whoami --check PERMISSION
|
|
@@ -232,7 +241,8 @@ signed in with
|
|
|
232
241
|
can leave; API keys are refused. The only owner of an organization cannot leave
|
|
233
242
|
it. If the server asks for a dashboard confirmation, open the page it names and
|
|
234
243
|
paste the token at the prompt, or pass it with --step-up-token. Refusals from
|
|
235
|
-
the server are printed as returned.
|
|
244
|
+
the server are printed as returned. Without a terminal and without --yes, it
|
|
245
|
+
exits 2 before anything is sent.
|
|
236
246
|
.PP
|
|
237
247
|
Run
|
|
238
248
|
.B primitive whoami
|
|
@@ -256,7 +266,7 @@ server decides which header names are allowed.
|
|
|
256
266
|
Schedule the send for TIME (ISO 8601 with Z or a UTC offset). Cancel it before
|
|
257
267
|
then with primitive sent cancel --id ID or --idempotency-key KEY.
|
|
258
268
|
.TP
|
|
259
|
-
.B primitive domains
|
|
269
|
+
.B primitive domains create DOMAIN
|
|
260
270
|
Start a custom-domain claim.
|
|
261
271
|
.TP
|
|
262
272
|
.B primitive domains verify --id DOMAIN_ID
|
|
@@ -313,6 +323,11 @@ Manage the repeating sends you created.
|
|
|
313
323
|
As the recipient, stop a repeat. ID is the repeat id from the message footer
|
|
314
324
|
or the id of a received message of the repeat.
|
|
315
325
|
.TP
|
|
326
|
+
.B primitive skills install [NAME] --runtime claude|codex
|
|
327
|
+
Install the skills bundled with this CLI, or only NAME, into the runtime's
|
|
328
|
+
skills folder (--project for the current directory's). A copy already at the
|
|
329
|
+
bundled version is left unchanged.
|
|
330
|
+
.TP
|
|
316
331
|
.B primitive list-operations
|
|
317
332
|
Print the generated API operation manifest.
|
|
318
333
|
.TP
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primcli",
|
|
3
|
-
"version": "3.0.0-preview.
|
|
3
|
+
"version": "3.0.0-preview.30",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"tag": "preview"
|
|
6
6
|
},
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"identifier": "COMMANDS"
|
|
43
43
|
},
|
|
44
44
|
"dirname": "primitive",
|
|
45
|
+
"hooks": {
|
|
46
|
+
"prerun": "./dist/oclif/command-stdin.js",
|
|
47
|
+
"command_not_found": "./dist/oclif/command-not-found.js"
|
|
48
|
+
},
|
|
45
49
|
"plugins": [
|
|
46
50
|
"@oclif/plugin-help",
|
|
47
51
|
"@oclif/plugin-autocomplete",
|
|
@@ -70,6 +74,9 @@
|
|
|
70
74
|
"machine": {
|
|
71
75
|
"description": "Check and repair this machine's setup for coding agents. Use `primitive machine doctor --json` to inspect and `--fix` to repair."
|
|
72
76
|
},
|
|
77
|
+
"skills": {
|
|
78
|
+
"description": "Install the agent skills bundled with this CLI. Use `primitive skills install --runtime claude` to install them all."
|
|
79
|
+
},
|
|
73
80
|
"agent-connections": {
|
|
74
81
|
"description": "Create, list, invite, revoke, and remove connected agents; claim private invitations through stdin."
|
|
75
82
|
},
|
|
@@ -92,7 +99,7 @@
|
|
|
92
99
|
"description": "Check inbound email setup and readiness, and work through mail awaiting your reply. Prefer `primitive inbox setup` for a guided setup path, `primitive inbox status` for the readiness table, and `primitive inbox next` for the oldest email awaiting your reply."
|
|
93
100
|
},
|
|
94
101
|
"emails": {
|
|
95
|
-
"description": "List, inspect, and wait for received emails. Prefer task aliases like `primitive emails list`, `primitive emails get`, `primitive emails latest`, `primitive emails wait`, and `primitive emails watch
|
|
102
|
+
"description": "List, inspect, and wait for received emails, and see what the classifier read from one. Prefer task aliases like `primitive emails list`, `primitive emails get`, `primitive emails latest`, `primitive emails facts`, `primitive emails wait`, and `primitive emails watch`. For a one-line-per-email table, `primitive emails latest --limit 200`; continue with `--cursor <cursor>`."
|
|
96
103
|
},
|
|
97
104
|
"search": {
|
|
98
105
|
"description": "Cross-corpus semantic search. Prefer `primitive search <query>` for lexical inbound search and `primitive semantic-search <query>` for meaning-aware ranking across inbound and outbound.",
|
|
@@ -102,10 +109,10 @@
|
|
|
102
109
|
"description": "Send outbound emails. Prefer `primitive send` for fresh sends and `primitive reply --id <inbound-id>` for replies. Use `primitive domains list` or `primitive inbox status` to find usable sender domains for --from; `primitive sending permissions` lists recipient-scope destinations you may send to."
|
|
103
110
|
},
|
|
104
111
|
"signin": {
|
|
105
|
-
"description": "Sign in
|
|
112
|
+
"description": "Sign in with browser approval or an emailed code"
|
|
106
113
|
},
|
|
107
114
|
"login": {
|
|
108
|
-
"description": "Log in
|
|
115
|
+
"description": "Log in with browser approval or an emailed code"
|
|
109
116
|
},
|
|
110
117
|
"otp": {
|
|
111
118
|
"description": "Authenticate with an emailed one-time code"
|
|
@@ -114,7 +121,7 @@
|
|
|
114
121
|
"description": "Short aliases for outbound sent-email history: `primitive sent list`, `primitive sent get`, and `primitive sent delete --id <id>`. Deleting sender history does not recall delivery."
|
|
115
122
|
},
|
|
116
123
|
"threads": {
|
|
117
|
-
"description": "Inspect conversation threads spanning received and sent emails. Prefer `primitive threads get --id <thread-id
|
|
124
|
+
"description": "Inspect conversation threads spanning received and sent emails. Prefer `primitive threads get --id <thread-id>`."
|
|
118
125
|
},
|
|
119
126
|
"endpoints": {
|
|
120
127
|
"description": "Manage webhook endpoints that receive email events"
|
|
@@ -129,25 +136,25 @@
|
|
|
129
136
|
"description": "Short aliases for webhook delivery attempts: `primitive deliveries list` and `primitive deliveries replay`."
|
|
130
137
|
},
|
|
131
138
|
"functions": {
|
|
132
|
-
"description": "Deploy JavaScript handlers that run on inbound mail. Prefer `primitive functions templates`, `primitive functions init`, `primitive functions deploy`, `primitive functions redeploy`, `primitive functions list`, `primitive functions get`, `primitive functions logs`, and `primitive functions set-secret
|
|
139
|
+
"description": "Deploy JavaScript handlers that run on inbound mail. Prefer `primitive functions templates`, `primitive functions init`, `primitive functions deploy`, `primitive functions redeploy`, `primitive functions list`, `primitive functions get`, `primitive functions logs`, and `primitive functions set-secret`."
|
|
133
140
|
},
|
|
134
141
|
"memories": {
|
|
135
142
|
"description": "Store durable JSON memories by key. Use `primitive memories set|get|delete|search`; pass `--function <function-id>` for function-scoped memories."
|
|
136
143
|
},
|
|
137
144
|
"templates": {
|
|
138
|
-
"description": "Browse and install Function templates. Use `primitive templates list
|
|
145
|
+
"description": "Browse and install Function templates. Use `primitive templates list`, `primitive templates get`, `primitive templates install`, and `primitive templates get-install`."
|
|
139
146
|
},
|
|
140
147
|
"org": {
|
|
141
|
-
"description": "Switch the CLI between your organizations (`primitive org use <org>`, list them with `primitive
|
|
148
|
+
"description": "Switch the CLI between your organizations (`primitive org use <org>`, list them with `primitive org list`), manage org-level (global) resources shared across functions, or leave the organization"
|
|
142
149
|
},
|
|
143
150
|
"org:secrets": {
|
|
144
|
-
"description": "Global secrets shared across every function. Use `primitive org secrets list|set|
|
|
151
|
+
"description": "Global secrets shared across every function. Use `primitive org secrets list|set|delete`. Changes land in a function on its next redeploy; a function secret of the same name overrides the global."
|
|
145
152
|
},
|
|
146
153
|
"keys": {
|
|
147
154
|
"description": "Organization API keys: list and show them (metadata only, never secrets), create, rotate and change them (with browser approval where your organization requires it), and revoke them."
|
|
148
155
|
},
|
|
149
156
|
"roles": {
|
|
150
|
-
"description": "Read roles, groups, mailbox access and the access mode. Use `primitive roles list|groups|mailbox-access|access-mode
|
|
157
|
+
"description": "Read roles, members, groups, mailbox access and the access mode. Use `primitive roles list|groups|mailbox-access|access-mode` and `primitive members list`."
|
|
151
158
|
},
|
|
152
159
|
"projects": {
|
|
153
160
|
"description": "Organization people, shared projects and project invitations"
|
|
@@ -164,6 +171,9 @@
|
|
|
164
171
|
"organization-settings": {
|
|
165
172
|
"description": "Your connected apps and CLI logins, the organization's connected apps, name, logo, search settings and billing"
|
|
166
173
|
},
|
|
174
|
+
"members": {
|
|
175
|
+
"description": "List the organization's members and their roles. Use `primitive members list`."
|
|
176
|
+
},
|
|
167
177
|
"roles-and-members": {
|
|
168
178
|
"description": "Roles, member roles and removal, the mailbox access mode, break-glass, transfers and suspensions, and leaving the organization"
|
|
169
179
|
},
|
|
@@ -179,11 +189,20 @@
|
|
|
179
189
|
"stats": {
|
|
180
190
|
"description": "Received and sent mail per hour, and how webhook deliveries ended"
|
|
181
191
|
},
|
|
192
|
+
"activity": {
|
|
193
|
+
"description": "Where you learn what others asked of you and did to your mail (`primitive activity asked`, `primitive activity concerning`, `primitive activity created`), and record or inspect verified mail activity events and shared agent work logs (`primitive activity log`, `update`, `timeline`, `list`, `agents`)."
|
|
194
|
+
},
|
|
195
|
+
"agents": {
|
|
196
|
+
"description": "Manage durable per-organization agent identities, bind credentials, pause/resume/retire agents, and claim optional agent addresses (`primitive agents list|create|get|update|pause|resume|retire|bind-credential|unbind-credential|claim-address|release-address`)."
|
|
197
|
+
},
|
|
182
198
|
"email-rules": {
|
|
183
199
|
"description": "Rules written in plain English that pick out received mail"
|
|
184
200
|
},
|
|
201
|
+
"email-rule-oversight": {
|
|
202
|
+
"description": "The email rules that reach your own mailboxes, whoever wrote them, read-only, and objections asking a rule's author to turn it off"
|
|
203
|
+
},
|
|
185
204
|
"routes": {
|
|
186
|
-
"description": "Manage recipient routes. Bind an address pattern to an endpoint or function: `primitive routes
|
|
205
|
+
"description": "Manage recipient routes. Bind an address pattern to an endpoint or function: `primitive routes create alice@d --function <id>`, `primitive routes list`, `primitive routes test <recipient>`, `primitive routes delete <id>`."
|
|
187
206
|
},
|
|
188
207
|
"repeat": {
|
|
189
208
|
"description": "Act on a message that repeats to you. Use `primitive repeat stop --id <email-id>` when it is no longer needed."
|
|
@@ -192,7 +211,7 @@
|
|
|
192
211
|
"description": "Manage repeating sends you created with `primitive send` or `primitive reply` and --repeat-every. Use `primitive repeats list|get|pause|resume|cancel`."
|
|
193
212
|
},
|
|
194
213
|
"changes": {
|
|
195
|
-
"description": "Long-poll
|
|
214
|
+
"description": "Long-poll a replayable feed of mail, send, thread mute and read-state, agent and access changes, for a login or key with changes:read. Use `primitive changes list --since start` for a baseline, then `--since <next_cursor> --wait 20`; add `--expand message` to inline each message and `--address a@x,b@y` to keep only mail to or from those addresses. Rule requests and rules over your mail are in `primitive activity asked` and `primitive activity concerning`."
|
|
196
215
|
},
|
|
197
216
|
"repeating-sends": {
|
|
198
217
|
"description": "Generated API operations for repeating sends. Prefer `primitive repeats ...` (sender) and `primitive repeat stop` (recipient)."
|
|
@@ -204,7 +223,7 @@
|
|
|
204
223
|
"description": "Receive events locally as JSONL with JSON status responses by default; --json is accepted explicitly. Use --exec or --forward-to, or deliver external mail events as tool output, never user messages, to an exact loaded native session using --notify-session with --contacts or approved --sender addresses. Add --email-id to --status to explain one received email. Add --contact-requests for owner-enabled structured first-contact intake. Use --background for independent receiving, --status --notify-session for current receiver health and durable receipts, or --stop --notify-session to stop only that receiver. Verified presence controls use no model turns and do not consume --once or --number."
|
|
205
224
|
},
|
|
206
225
|
"contacts": {
|
|
207
|
-
"description": "Shared organization contacts plus structured request, accept, and wait commands for connected agents. Directory list, get,
|
|
226
|
+
"description": "Shared organization contacts plus structured request, accept, and wait commands for connected agents. Directory list, get, create, update, and delete use conditional versions. Commands return JSON by default and accept explicit --json."
|
|
208
227
|
},
|
|
209
228
|
"agent:contacts": {
|
|
210
229
|
"description": "Contacts and notification preferences for one agent address. Connected profiles default to their own address. Commands return JSON by default and accept explicit --json."
|
|
@@ -217,6 +236,9 @@
|
|
|
217
236
|
},
|
|
218
237
|
"agent:runtime": {
|
|
219
238
|
"description": "One private line in the AGENT_RUNTIME address note saying where an agent runs and what it is, such as `Claude Code on my-laptop in app`. Use set to write it (a default is computed when --value is omitted) and get to read it; offer it to the owner before writing."
|
|
239
|
+
},
|
|
240
|
+
"skill": {
|
|
241
|
+
"description": "Fetch, verify, and install the live Primitive skill tailored to your credential's permissions, entitlements, and policies. Use `primitive skill` to print SKILL.md and `primitive skill install` to write it into local agent directories."
|
|
220
242
|
}
|
|
221
243
|
},
|
|
222
244
|
"topicSeparator": " "
|