@getgavel/cli 0.1.12 → 0.1.13

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/gavel.js +53 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -32,6 +32,7 @@ gavel ask --file decision.json # put a decision to your person
32
32
  gavel wait D-12 --timeout 60 # until it's decided
33
33
  gavel watch # one GAVEL_WAKE line per new thing for you; run it in the background
34
34
  gavel find "nudge a decision" # the API's routes for what you want, and who may call each
35
+ gavel work claim # when you're free: your next ready task; work done W-12 when it ships
35
36
  gavel help # every command
36
37
  gavel act --help # one command's usage
37
38
  ```
package/dist/gavel.js CHANGED
@@ -57,21 +57,31 @@ const USAGE = `gavel: Gavel from the command line (https://getgavel.ai/agents)
57
57
  gavel work file (<title> | --title <words>) [--status <status>] [--description <words>]
58
58
  [--worker <email or agent> | --worker none] [--reporter <email or agent>]
59
59
  [--waiting-on <email or agent>] [--decision <D-12>] [--code <url>]... [--label <Group: Name>]...
60
+ [--waits-on <W-3,W-4>]
60
61
  a work item on the Board's Being done (W-12), when you
61
62
  start: you're its worker unless you name another, Backlog
62
63
  unless --status (Triage, Backlog, Needs Decision, Queued,
63
- Building, Blocked, Deployed, Icebox, Closed, Duplicate)
64
+ Building, Blocked, Deployed, Icebox, Closed, Duplicate);
65
+ --waits-on the items it waits on
64
66
  gavel work move <W-12> [<status>] [--waiting-on <email or agent>] [--decision <D-12>]
65
67
  [--code <url>]... [--worker <email or agent> | --worker none] [--title <words>]
66
- [--description <words>] [--label <Group: Name>]... [--label none]
68
+ [--description <words>] [--label <Group: Name>]... [--label none] [--waits-on <W-3,W-4> | --waits-on none]
67
69
  move it as your work moves: Building, Blocked with
68
70
  --waiting-on, Needs Decision with --decision, Deployed
69
71
  with --code (a commit or pull request; again for each);
70
- --label sets all its labels (again for each)
72
+ --label sets all its labels (again for each), --waits-on
73
+ all the items it waits on
71
74
  gavel work show <W-12> an item and its history
72
75
  gavel work list [--worker me|<email or agent>] [--status <status>] [--open true]
73
76
  the workspace's items, the latest changed first, and
74
77
  its labels
78
+ gavel work claim [--label <Group: Name>] [--area <area>]
79
+ when you're free: the next ready item, yours in Building
80
+ while you work (any call keeps it; 10 minutes quiet and
81
+ it goes back to Queued); none ready, what's waiting
82
+ gavel work renew <W-12> keep your claim through a long quiet stretch
83
+ gavel work release <W-12> [--why <words>] let it go: back to Queued, the why in its history
84
+ gavel work done <W-12> [--code <url>]... finish it: Deployed with its code, your claim ends
75
85
  gavel message (--to-agent <id> | --to-person <email>) (<text> | --text <words>) [--decision <D-12>]
76
86
  start a conversation with another agent
77
87
  gavel message --conversation <C-12> (<text> | --text <words>)
@@ -175,7 +185,7 @@ const USAGE = `gavel: Gavel from the command line (https://getgavel.ai/agents)
175
185
  a stuck decision to someone else, for them: an Admin's
176
186
  gavel workspace-settings its name, triage person, depth and untrusted areas
177
187
  gavel edit-workspace [--name <name>] [--triage-person <person id>|none] [--sub-agent-depth <n>]
178
- [--never-trusted <area id,area id>|none]
188
+ [--never-trusted <area id,area id>|none] [--coordinator <agent id>|none]
179
189
  Admins and Owners; only what you give changes
180
190
  gavel workspace-people everyone, with their role
181
191
  gavel set-role <person id> --role owner|admin|member
@@ -241,7 +251,7 @@ const FLAGS = {
241
251
  act: ["note"],
242
252
  inbox: [],
243
253
  status: ["text", "description", "folders", "state", "issue", "waiting-on", "item"],
244
- work: ["title", "status", "description", "worker", "reporter", "waiting-on", "decision", "code", "label", "open"],
254
+ work: ["title", "status", "description", "worker", "reporter", "waiting-on", "decision", "code", "label", "open", "waits-on", "area", "why"],
245
255
  message: ["to-agent", "to-person", "conversation", "text", "decision"],
246
256
  conversations: [],
247
257
  "wait-for-reply": ["timeout"],
@@ -299,7 +309,7 @@ const FLAGS = {
299
309
  "nudge-mine": [],
300
310
  reassign: ["to-person", "to-agent", "note"],
301
311
  "workspace-settings": [],
302
- "edit-workspace": ["name", "triage-person", "sub-agent-depth", "never-trusted"],
312
+ "edit-workspace": ["name", "triage-person", "sub-agent-depth", "never-trusted", "coordinator"],
303
313
  "workspace-people": [],
304
314
  "set-role": ["role"],
305
315
  invitations: [],
@@ -458,29 +468,55 @@ function workRequest(p, f, code, label) {
458
468
  const description = f.description === undefined ? undefined : readText(f.description);
459
469
  const links = code.length ? code.map((url) => ({ url })) : undefined;
460
470
  const labels = !label.length ? undefined : label.length === 1 && label[0] === "none" ? [] : label;
471
+ const waitsOn = f["waits-on"] === undefined ? undefined : f["waits-on"] === "none" ? [] : f["waits-on"].split(",").map((r) => r.trim()).filter(Boolean);
461
472
  const ref = (value) => {
462
473
  if (!value || !/^W-\d+$/i.test(value))
463
474
  throw new UsageError(`work ${sub} needs its item, like W-12`);
464
475
  return encodeURIComponent(value.toUpperCase());
465
476
  };
477
+ const onlyItem = () => {
478
+ if (rest.length > 1)
479
+ throw new UsageError(`work ${sub} doesn't take "${rest[1]}"`);
480
+ return ref(rest[0]);
481
+ };
466
482
  switch (sub) {
467
483
  case "file": {
468
- only(["title", "status", "description", "worker", "reporter", "waiting-on", "decision", "code", "label"]);
484
+ only(["title", "status", "description", "worker", "reporter", "waiting-on", "decision", "code", "label", "waits-on"]);
469
485
  if (f.title !== undefined && rest.length)
470
486
  throw new UsageError("give the title once: as words or as --title");
471
487
  const title = readText(need(f.title ?? rest.join(" "), "the item's title"));
472
- return { method: "POST", path: "/v1/work", body: compact({ title, status: f.status, description, worker, reporter: f.reporter, waitingOn: f["waiting-on"], decision: f.decision, code: links, labels }) };
488
+ return {
489
+ method: "POST",
490
+ path: "/v1/work",
491
+ body: compact({ title, status: f.status, description, worker, reporter: f.reporter, waitingOn: f["waiting-on"], decision: f.decision, code: links, labels, waitsOn }),
492
+ };
473
493
  }
474
494
  case "move": {
475
- only(["title", "status", "description", "worker", "waiting-on", "decision", "code", "label"]);
495
+ only(["title", "status", "description", "worker", "waiting-on", "decision", "code", "label", "waits-on"]);
476
496
  const [item, ...words] = rest;
477
497
  if (f.status !== undefined && words.length)
478
498
  throw new UsageError("give the status once: as words or as --status");
479
- const body = compact({ status: f.status ?? (words.join(" ") || undefined), title: f.title, description, worker, waitingOn: f["waiting-on"], decision: f.decision, code: links, labels });
499
+ const body = compact({ status: f.status ?? (words.join(" ") || undefined), title: f.title, description, worker, waitingOn: f["waiting-on"], decision: f.decision, code: links, labels, waitsOn });
480
500
  if (!Object.keys(body).length)
481
501
  throw new UsageError("work move needs a status or something to change");
482
502
  return { method: "PATCH", path: `/v1/work/${ref(item)}`, body };
483
503
  }
504
+ case "claim":
505
+ only(["label", "area"]);
506
+ if (rest.length)
507
+ throw new UsageError(`work claim doesn't take "${rest[0]}"`);
508
+ if (label.length > 1)
509
+ throw new UsageError("work claim takes one --label");
510
+ return { method: "POST", path: "/v1/work/claim", body: compact({ label: label[0], area: f.area }) };
511
+ case "renew":
512
+ only([]);
513
+ return { method: "POST", path: `/v1/work/${onlyItem()}/renew`, body: {} };
514
+ case "release":
515
+ only(["why"]);
516
+ return { method: "POST", path: `/v1/work/${onlyItem()}/release`, body: compact({ why: f.why === undefined ? undefined : readText(f.why) }) };
517
+ case "done":
518
+ only(["code"]);
519
+ return { method: "POST", path: `/v1/work/${onlyItem()}/done`, body: compact({ code: links }) };
484
520
  case "show":
485
521
  only([]);
486
522
  if (rest.length > 1)
@@ -496,7 +532,7 @@ function workRequest(p, f, code, label) {
496
532
  return { method: "GET", path: `/v1/work${query.size ? `?${query}` : ""}` };
497
533
  }
498
534
  default:
499
- throw new UsageError(sub ? `work doesn't take "${sub}": use file, move, show or list` : "work needs file, move, show or list");
535
+ throw new UsageError(sub ? `work doesn't take "${sub}": use file, move, show, list, claim, renew, release or done` : "work needs file, move, show, list, claim, renew, release or done");
500
536
  }
501
537
  }
502
538
  // gavel my-queue … overrule: your person's actions, as them (FOR_PERSON).
@@ -704,6 +740,7 @@ function personRequest(command, p, f, options) {
704
740
  triagePersonId: orNone("triage-person"),
705
741
  subAgentMaxDepth: depth === undefined ? undefined : Number(depth),
706
742
  neverTrustableAreaIds: untrusted === undefined ? undefined : untrusted === "none" ? [] : list(untrusted),
743
+ coordinatorAgentId: orNone("coordinator"),
707
744
  });
708
745
  if (!Object.keys(body).length)
709
746
  throw new UsageError("edit-workspace needs something to change");
@@ -1457,6 +1494,10 @@ export function wakeLine(item) {
1457
1494
  return "GAVEL_WAKE chat: your person wrote to you in Gavel: read it with gavel chat";
1458
1495
  case "health":
1459
1496
  return "GAVEL_WAKE health: Gavel's chat self-check: see gavel inbox";
1497
+ case "claim":
1498
+ return `GAVEL_WAKE claim on ${item.ref} ran out, back in Queued: see gavel inbox, then give it to an agent or let one claim it`;
1499
+ case "work":
1500
+ return `GAVEL_WAKE work ${item.ref} Blocked half an hour: move it, or name it Blocked again with gavel work move ${item.ref} Blocked`;
1460
1501
  default:
1461
1502
  return "GAVEL_WAKE something new: see gavel inbox";
1462
1503
  }
@@ -1472,7 +1513,7 @@ async function watch(token, as) {
1472
1513
  for (;;) {
1473
1514
  let res;
1474
1515
  try {
1475
- res = await fetch(`${base}/v1/inbox/watch?watch=${id}&timeout=50&kinds=health${start ? "&start=true" : ""}`, {
1516
+ res = await fetch(`${base}/v1/inbox/watch?watch=${id}&timeout=50&kinds=health,claim,work${start ? "&start=true" : ""}`, {
1476
1517
  headers: { authorization: `Bearer ${token}`, accept: "application/json", ...agentHeader(as) },
1477
1518
  });
1478
1519
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getgavel/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "The gavel command: an agent's Gavel from a shell (pair, ask, wait, watch and the rest)",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://getgavel.ai/agents",