@primitive.ai/prim 0.1.0-alpha.33 → 0.1.0-alpha.34

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
@@ -127,7 +127,7 @@ prim daemon start # start (stop / restart / status)
127
127
  Read and respond to the decision graph.
128
128
 
129
129
  ```bash
130
- prim decisions recent # Recent decisions feed
130
+ prim decisions recent # Recent decisions feed (--author <name> for one teammate's)
131
131
  prim decisions show <id> # Drill into one decision
132
132
  prim decisions cascade <id> # Blast radius of a decision
133
133
  prim decisions check --files <…> # Active decisions referencing files (warn-only)
package/SKILL.md CHANGED
@@ -44,7 +44,7 @@ The gate fail-opens on its *own* infrastructure errors (no daemon, network blip,
44
44
  ## Read the graph before large or load-bearing edits
45
45
 
46
46
  - `npx --yes @primitive.ai/prim decisions check --files "src/a.ts,src/b.ts"` -- which active decisions reference the files you're about to touch (comma-separated paths, one `--files` value). Run it before a big change.
47
- - `npx --yes @primitive.ai/prim decisions recent` -- the team's recent decisions, each row badged by author and agent (`Your Claude Code` / `Your Codex` / `Your Hermes`); `--limit <n>` and `--since <dur>` narrow it.
47
+ - `npx --yes @primitive.ai/prim decisions recent` -- the team's recent decisions, each row badged by author and agent (`Your Claude Code` / `Your Codex` / `Your Hermes`); `--limit <n>` and `--since <dur>` narrow it. `--author "<name>"` filters to one teammate (feed name, `"First Last"`, last name, username, email, or email local-part) -- the way to answer "what has X decided?"; an unknown or ambiguous name comes back as `unavailable` with the reason, and `authorHasDecisions` in the JSON distinguishes "no feed-visible decisions" (false) from "has decisions, none in this window" (true).
48
48
  - `npx --yes @primitive.ai/prim decisions show <idOrShortId>` and `npx --yes @primitive.ai/prim decisions cascade <idOrShortId>` -- full detail, and the downstream blast radius a change would disturb.
49
49
 
50
50
  ## Reconcile and the verdict footer
@@ -130,6 +130,7 @@ Examples:
130
130
 
131
131
  - `npx --yes @primitive.ai/prim auth status --json | jq -r .authenticated` — boolean; the exit code remains the authoritative signal
132
132
  - `npx --yes @primitive.ai/prim decisions recent | jq -r '.decisions[].shortId'` — list recent decision short ids (STDOUT is already JSON)
133
+ - `npx --yes @primitive.ai/prim decisions recent --author "Maya" | jq -r 'if .unavailable then "UNAVAILABLE: \(.unavailable)" else .decisions[].intent end'` — one teammate's latest decisions (check `.unavailable` first; empty output alone is not "no decisions")
133
134
  - `npx --yes @primitive.ai/prim decisions show <id> | jq .` — full decision detail
134
135
 
135
136
  ## Pitfalls
package/dist/index.js CHANGED
@@ -1332,6 +1332,12 @@ function formatCascadeJson(result) {
1332
1332
  var RECENT_TIMEOUT_MS = 1e4;
1333
1333
  var defaultDeps2 = { getClient };
1334
1334
  async function fetchRecent(args, deps = defaultDeps2) {
1335
+ if (args.author !== void 0 && args.author.trim() === "") {
1336
+ return {
1337
+ decisions: [],
1338
+ unavailable: "--author must be a non-empty name"
1339
+ };
1340
+ }
1335
1341
  const params = new URLSearchParams();
1336
1342
  if (args.limit !== void 0) {
1337
1343
  params.set("limit", String(args.limit));
@@ -1339,6 +1345,9 @@ async function fetchRecent(args, deps = defaultDeps2) {
1339
1345
  if (args.since !== void 0) {
1340
1346
  params.set("since", args.since);
1341
1347
  }
1348
+ if (args.author !== void 0) {
1349
+ params.set("author", args.author);
1350
+ }
1342
1351
  try {
1343
1352
  const client = deps.getClient();
1344
1353
  const res = await daemonOrDirectGet(
@@ -1347,10 +1356,22 @@ async function fetchRecent(args, deps = defaultDeps2) {
1347
1356
  client,
1348
1357
  RECENT_TIMEOUT_MS
1349
1358
  );
1359
+ if (args.author !== void 0 && res.author === void 0 && res.unavailable === void 0) {
1360
+ return {
1361
+ decisions: [],
1362
+ unavailable: "--author requires a newer Primitive backend (no author echo in response); retry without --author for the team-wide feed"
1363
+ };
1364
+ }
1350
1365
  const result = { decisions: res.decisions };
1351
1366
  if (res.viewerHasDecisions !== void 0) {
1352
1367
  result.viewerHasDecisions = res.viewerHasDecisions;
1353
1368
  }
1369
+ if (res.author !== void 0) {
1370
+ result.author = res.author;
1371
+ }
1372
+ if (res.authorHasDecisions !== void 0) {
1373
+ result.authorHasDecisions = res.authorHasDecisions;
1374
+ }
1354
1375
  if (res.unavailable !== void 0) {
1355
1376
  result.unavailable = res.unavailable;
1356
1377
  }
@@ -1407,10 +1428,20 @@ function formatRecentHuman(result) {
1407
1428
  if (result.unavailable !== void 0) {
1408
1429
  return `[prim] recent \xB7 feed not verified \u2014 ${result.unavailable}`;
1409
1430
  }
1431
+ if (result.author !== void 0 && result.decisions.length === 0) {
1432
+ if (result.authorHasDecisions === true) {
1433
+ return `[prim] recent \xB7 ${result.author.name} \xB7 0 decisions in this window (older decisions exist \u2014 widen --since or raise --limit)`;
1434
+ }
1435
+ if (result.authorHasDecisions === false) {
1436
+ return `[prim] recent \xB7 ${result.author.name} \xB7 no feed-visible decisions yet (if unexpected, check prim setup/doctor on their machine and the repo they work in)`;
1437
+ }
1438
+ return `[prim] recent \xB7 ${result.author.name} \xB7 0 decisions`;
1439
+ }
1440
+ const label = result.author === void 0 ? "recent" : `recent \xB7 ${result.author.name}`;
1410
1441
  if (result.decisions.length === 0) {
1411
1442
  return "[prim] recent \xB7 0 decisions";
1412
1443
  }
1413
- const lines = [`[prim] recent \xB7 ${String(result.decisions.length)} decision(s)`];
1444
+ const lines = [`[prim] ${label} \xB7 ${String(result.decisions.length)} decision(s)`];
1414
1445
  for (const row of result.decisions) {
1415
1446
  lines.push(formatRecentRow(row));
1416
1447
  }
@@ -1771,10 +1802,14 @@ function registerDecisionsCommands(program2) {
1771
1802
  decisions.command("recent").description("Show the team-wide chronological decision feed").option("--limit <n>", "Maximum number of rows to return (default 10)").option(
1772
1803
  "--since <duration>",
1773
1804
  "Lookback window \u2014 accepts `Nm`, `Nh`, `Nd` (minutes / hours / days) or absolute epoch ms"
1805
+ ).option(
1806
+ "--author <name>",
1807
+ `Filter to one teammate's decisions \u2014 feed name, "First Last", last name, username, email, or email local-part`
1774
1808
  ).action(async (opts) => {
1775
1809
  const result = await fetchRecent({
1776
1810
  limit: opts.limit ? Number.parseInt(opts.limit, 10) : void 0,
1777
- since: opts.since
1811
+ since: opts.since,
1812
+ author: opts.author
1778
1813
  });
1779
1814
  console.error(formatRecentHuman(result));
1780
1815
  console.log(formatRecentJson(result));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitive.ai/prim",
3
- "version": "0.1.0-alpha.33",
3
+ "version": "0.1.0-alpha.34",
4
4
  "description": "CLI for Primitive's decision graph — passive decision capture, conflict gate, and team presence",
5
5
  "type": "module",
6
6
  "license": "MIT",