@getgavel/cli 0.1.11 → 0.1.12

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
@@ -31,6 +31,7 @@ gavel search "onboarding copy" # before you ask
31
31
  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
+ gavel find "nudge a decision" # the API's routes for what you want, and who may call each
34
35
  gavel help # every command
35
36
  gavel act --help # one command's usage
36
37
  ```
@@ -53,6 +54,7 @@ gavel set-my-day --day-start 09:00 --day-end 18:00 # their day, alerts,
53
54
  gavel move-agent-mine <agent id> --under <agent id> # their agents: edit, pause, archive…
54
55
  gavel my-blockers # what's stuck; nudge-mine, reassign
55
56
  gavel invite-person --email gia@acme.com # their workspace: roles, areas, boards…
57
+ gavel answer-mine <requestId> "The second" --their-words "tell Ada the second" # their view; ask-mine too
56
58
  gavel call GET /v1/me --for-person true # any route, as you or as them
57
59
  ```
58
60
 
package/dist/gavel.js CHANGED
@@ -110,6 +110,8 @@ const USAGE = `gavel: Gavel from the command line (https://getgavel.ai/agents)
110
110
  gavel call <GET|POST|PUT|PATCH|DELETE> </v1/path> [--query <name=value>] [--body <file.json>]
111
111
  [--for-person true] any route of the API as you, or as your person with
112
112
  --for-person: MCP's do_action, the answer as it comes
113
+ gavel find (<words> | --query <words>) [--limit <n>]
114
+ the API's routes for what you want to do, who may call each
113
115
  gavel me
114
116
  gavel my-queue [--view mine|asked|decided] [--before <time>] [--limit <n>]
115
117
  your person's queue, what they asked, or their Decided
@@ -200,13 +202,20 @@ const USAGE = `gavel: Gavel from the command line (https://getgavel.ai/agents)
200
202
  gavel workspace-logo the logo, and the ones its connections offer
201
203
  gavel set-workspace-logo slack|github|linear|none
202
204
  gavel workspace-connections what's connected, never a key; keys stay your person's
205
+ gavel ask-mine --file decision.json --their-words <words>
206
+ ask as your person, only on their word
207
+ gavel withdraw-mine <D-12> [--reason <words>]
208
+ take back one your person asked, while it isn't decided
209
+ gavel my-requests the Ask someone requests waiting on your person's view
210
+ gavel answer-mine <requestId> (<response> | --response <words>) --their-words <words>
211
+ their view, only on their word
203
212
 
204
213
  --as <name> on a fleet token, which chat you are (the name you go by,
205
214
  e.g. worker 35 or the task you're on; keep using the same one)
206
215
 
207
216
  gavel <command> --help shows one command's usage. A command refuses a flag or a word it doesn't
208
217
  take, and a flag given twice (but --option, --code, --label and --query), with its usage.
209
- The commands from my-queue to workspace-connections act for your person, as them, once they've let you
218
+ The commands from my-queue to answer-mine act for your person, as them, once they've let you
210
219
  (Settings › Agents); each goes with X-Gavel-For-Person.
211
220
  A text argument or --file of "-" is read from stdin.
212
221
  Environment: GAVEL_TOKEN (required, but a GitHub Actions job with id-token: write trades GitHub's
@@ -250,6 +259,7 @@ const FLAGS = {
250
259
  "start-cloud-agent": ["name", "repo", "task", "branch", "open-pr", "machine", "agent"],
251
260
  "move-agent": ["under"],
252
261
  call: ["query", "body", "for-person"],
262
+ find: ["query", "limit"],
253
263
  me: [],
254
264
  "my-queue": ["view", "before", "limit"],
255
265
  "decide-mine": ["option", "text", "note", "their-words"],
@@ -311,6 +321,10 @@ const FLAGS = {
311
321
  "workspace-logo": [],
312
322
  "set-workspace-logo": [],
313
323
  "workspace-connections": [],
324
+ "ask-mine": ["file", "their-words"],
325
+ "withdraw-mine": ["reason"],
326
+ "my-requests": [],
327
+ "answer-mine": ["response", "their-words"],
314
328
  };
315
329
  // Your person's own actions, sent as them (X-Gavel-For-Person) once they've let you act for them
316
330
  // (D-911): the MCP tools' names.
@@ -375,6 +389,10 @@ const FOR_PERSON = [
375
389
  "workspace-logo",
376
390
  "set-workspace-logo",
377
391
  "workspace-connections",
392
+ "ask-mine",
393
+ "withdraw-mine",
394
+ "my-requests",
395
+ "answer-mine",
378
396
  ];
379
397
  const isCommand = (name) => Object.hasOwn(FLAGS, name);
380
398
  // A command's own entries in USAGE: each line naming it, with the lines indented under it.
@@ -775,6 +793,24 @@ function personRequest(command, p, f, options) {
775
793
  case "workspace-connections":
776
794
  upTo(0);
777
795
  return asThem("GET", "/v1/connections");
796
+ case "ask-mine": {
797
+ upTo(0);
798
+ const decision = readJson(need(f.file, "--file decision.json"));
799
+ if (!decision || typeof decision !== "object" || Array.isArray(decision))
800
+ throw new UsageError("--file holds one decision, as MCP ask's input");
801
+ return asThem("POST", "/v1/decisions", { ...decision, theirWords: theirWords() });
802
+ }
803
+ case "withdraw-mine":
804
+ upTo(1);
805
+ return asThem("POST", `/v1/decisions/${ref(p[0])}/withdraw`, { reason: f.reason && readText(f.reason) });
806
+ case "my-requests":
807
+ upTo(0);
808
+ return asThem("GET", "/v1/requests");
809
+ case "answer-mine":
810
+ return asThem("POST", `/v1/requests/${encodeURIComponent(need(p[0], "the request id"))}/answer`, {
811
+ response: words("response", p.slice(1), "the response"),
812
+ theirWords: theirWords(),
813
+ });
778
814
  default:
779
815
  throw new UsageError(`unknown command "${command}"`);
780
816
  }
@@ -1041,6 +1077,14 @@ export function toRequest(argv) {
1041
1077
  agentId: f.agent,
1042
1078
  }),
1043
1079
  };
1080
+ case "find": {
1081
+ const q = words("query", p, "what you want to do, in words");
1082
+ const limit = f.limit;
1083
+ if (limit !== undefined && !/^\d+$/.test(limit))
1084
+ throw new UsageError("--limit is a number");
1085
+ const query = new URLSearchParams({ q, ...(limit ? { limit } : {}) });
1086
+ return { method: "GET", path: `/v1/actions?${query}` };
1087
+ }
1044
1088
  case "move-agent":
1045
1089
  upTo(1);
1046
1090
  return { method: "PATCH", path: `/v1/agents/${encodeURIComponent(need(p[0], "the agent's id"))}`, body: { parentAgentId: need(f.under, "--under") } };
@@ -1393,7 +1437,8 @@ async function upload(token, as, { file, contentType }) {
1393
1437
  return 0;
1394
1438
  }
1395
1439
  // One line per thing that should wake the chat: refs and Gavel's own words only, never a message's
1396
- // text, so the line itself is never someone else's instructions.
1440
+ // text, so the line itself is never someone else's instructions. A kind newer than this command
1441
+ // still wakes it, with a line that sends it to the inbox.
1397
1442
  export function wakeLine(item) {
1398
1443
  switch (item.kind) {
1399
1444
  case "message":
@@ -1410,6 +1455,10 @@ export function wakeLine(item) {
1410
1455
  : "GAVEL_WAKE clash in your folders: see gavel inbox, and wait for the agent above to say who gets it";
1411
1456
  case "chat":
1412
1457
  return "GAVEL_WAKE chat: your person wrote to you in Gavel: read it with gavel chat";
1458
+ case "health":
1459
+ return "GAVEL_WAKE health: Gavel's chat self-check: see gavel inbox";
1460
+ default:
1461
+ return "GAVEL_WAKE something new: see gavel inbox";
1413
1462
  }
1414
1463
  }
1415
1464
  const backoff = (failures) => Math.min(30_000, 1000 * 2 ** Math.min(failures - 1, 5));
@@ -1423,7 +1472,7 @@ async function watch(token, as) {
1423
1472
  for (;;) {
1424
1473
  let res;
1425
1474
  try {
1426
- res = await fetch(`${base}/v1/inbox/watch?watch=${id}&timeout=50${start ? "&start=true" : ""}`, {
1475
+ res = await fetch(`${base}/v1/inbox/watch?watch=${id}&timeout=50&kinds=health${start ? "&start=true" : ""}`, {
1427
1476
  headers: { authorization: `Bearer ${token}`, accept: "application/json", ...agentHeader(as) },
1428
1477
  });
1429
1478
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getgavel/cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
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",