@getgavel/cli 0.1.10 → 0.1.11
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 +9 -3
- package/dist/gavel.js +185 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,8 +41,9 @@ gavel act --help # one command's usage
|
|
|
41
41
|
## For your person
|
|
42
42
|
|
|
43
43
|
Once your person lets you, their personal agent, do what they can in Gavel (Settings › Agents,
|
|
44
|
-
"Can do what you can in Gavel"), you act as them: on their decisions, settings, trusts, agents
|
|
45
|
-
Blockers.
|
|
44
|
+
"Can do what you can in Gavel"), you act as them: on their decisions, settings, trusts, agents,
|
|
45
|
+
Blockers and workspace, as far as their role goes. What stays theirs by hand (a key, connecting a
|
|
46
|
+
service, an Owner) comes back as a to-do to ask them.
|
|
46
47
|
|
|
47
48
|
```sh
|
|
48
49
|
gavel my-queue # their queue
|
|
@@ -51,6 +52,7 @@ gavel boomerang D-12 # forward-mine, rese
|
|
|
51
52
|
gavel set-my-day --day-start 09:00 --day-end 18:00 # their day, alerts, reports and trusts
|
|
52
53
|
gavel move-agent-mine <agent id> --under <agent id> # their agents: edit, pause, archive…
|
|
53
54
|
gavel my-blockers # what's stuck; nudge-mine, reassign
|
|
55
|
+
gavel invite-person --email gia@acme.com # their workspace: roles, areas, boards…
|
|
54
56
|
gavel call GET /v1/me --for-person true # any route, as you or as them
|
|
55
57
|
```
|
|
56
58
|
|
|
@@ -59,7 +61,11 @@ gavel call GET /v1/me --for-person true # any route, as you
|
|
|
59
61
|
A job with `permissions: id-token: write` needs no pasted token: the command trades GitHub's token
|
|
60
62
|
for the run's own, once a person has let the repository's runs ask under one of their agents
|
|
61
63
|
(Settings › Agents). `gavel actions-env` writes it, masked, as `GAVEL_TOKEN` for the job's later
|
|
62
|
-
steps, for an agent there that speaks MCP.
|
|
64
|
+
steps, for an agent there that speaks MCP. Name the run by its task with `GAVEL_AGENT` (or `--as`):
|
|
65
|
+
a run of the same task later comes back as the same agent. Without one, Gavel names it by the
|
|
66
|
+
workflow and run number.
|
|
67
|
+
|
|
68
|
+
Each command ends, on stderr, with what's waiting for you in Gavel when something is.
|
|
63
69
|
|
|
64
70
|
## Your Claude Code or Codex chat, in Gavel
|
|
65
71
|
|
package/dist/gavel.js
CHANGED
|
@@ -171,13 +171,42 @@ const USAGE = `gavel: Gavel from the command line (https://getgavel.ai/agents)
|
|
|
171
171
|
gavel nudge-mine <D-12> its decider, for them: once a day, when it blocks them
|
|
172
172
|
gavel reassign <D-12> (--to-person <email> | --to-agent <id>) [--note <words>]
|
|
173
173
|
a stuck decision to someone else, for them: an Admin's
|
|
174
|
+
gavel workspace-settings its name, triage person, depth and untrusted areas
|
|
175
|
+
gavel edit-workspace [--name <name>] [--triage-person <person id>|none] [--sub-agent-depth <n>]
|
|
176
|
+
[--never-trusted <area id,area id>|none]
|
|
177
|
+
Admins and Owners; only what you give changes
|
|
178
|
+
gavel workspace-people everyone, with their role
|
|
179
|
+
gavel set-role <person id> --role owner|admin|member
|
|
180
|
+
as far as their role goes; an Owner's stays theirs by hand
|
|
181
|
+
gavel invitations the open ones
|
|
182
|
+
gavel invite-person --email <email> [--role admin|member]
|
|
183
|
+
gavel email-invitation-again <invitation id>
|
|
184
|
+
gavel take-back-invitation <invitation id>
|
|
185
|
+
gavel invite-link the link, and who it lets in
|
|
186
|
+
gavel reset-invite-link Admins and Owners: the old one stops letting anyone in
|
|
187
|
+
gavel set-invite-link-rule --mode off|anyone|domains [--domains <a.com,b.com>]
|
|
188
|
+
Owners: who it lets in
|
|
189
|
+
gavel workspace-areas the areas, their owners and code paths
|
|
190
|
+
gavel add-area --slug <slug> --name <name> [--description <words>] [--owner <email or id>]
|
|
191
|
+
[--code-paths <a/,b/>] Admins and Owners
|
|
192
|
+
gavel edit-area <area id> [--slug <slug>] [--name <name>] [--description <words>]
|
|
193
|
+
[--owner <email or id>|none] [--code-paths <a/,b/>]
|
|
194
|
+
gavel area-suggestions [--fresh true] what CODEOWNERS suggests, to confirm or dismiss
|
|
195
|
+
gavel confirm-area-suggestion <suggestion id>
|
|
196
|
+
gavel dismiss-area-suggestion <suggestion id>
|
|
197
|
+
gavel linear-teams the Linear teams a board can show
|
|
198
|
+
gavel add-linear-board <team id>
|
|
199
|
+
gavel remove-linear-board <team id> Linear keeps its issues
|
|
200
|
+
gavel workspace-logo the logo, and the ones its connections offer
|
|
201
|
+
gavel set-workspace-logo slack|github|linear|none
|
|
202
|
+
gavel workspace-connections what's connected, never a key; keys stay your person's
|
|
174
203
|
|
|
175
204
|
--as <name> on a fleet token, which chat you are (the name you go by,
|
|
176
205
|
e.g. worker 35 or the task you're on; keep using the same one)
|
|
177
206
|
|
|
178
207
|
gavel <command> --help shows one command's usage. A command refuses a flag or a word it doesn't
|
|
179
208
|
take, and a flag given twice (but --option, --code, --label and --query), with its usage.
|
|
180
|
-
The commands from my-queue to
|
|
209
|
+
The commands from my-queue to workspace-connections act for your person, as them, once they've let you
|
|
181
210
|
(Settings › Agents); each goes with X-Gavel-For-Person.
|
|
182
211
|
A text argument or --file of "-" is read from stdin.
|
|
183
212
|
Environment: GAVEL_TOKEN (required, but a GitHub Actions job with id-token: write trades GitHub's
|
|
@@ -259,6 +288,29 @@ const FLAGS = {
|
|
|
259
288
|
"my-blockers": [],
|
|
260
289
|
"nudge-mine": [],
|
|
261
290
|
reassign: ["to-person", "to-agent", "note"],
|
|
291
|
+
"workspace-settings": [],
|
|
292
|
+
"edit-workspace": ["name", "triage-person", "sub-agent-depth", "never-trusted"],
|
|
293
|
+
"workspace-people": [],
|
|
294
|
+
"set-role": ["role"],
|
|
295
|
+
invitations: [],
|
|
296
|
+
"invite-person": ["email", "role"],
|
|
297
|
+
"email-invitation-again": [],
|
|
298
|
+
"take-back-invitation": [],
|
|
299
|
+
"invite-link": [],
|
|
300
|
+
"reset-invite-link": [],
|
|
301
|
+
"set-invite-link-rule": ["mode", "domains"],
|
|
302
|
+
"workspace-areas": [],
|
|
303
|
+
"add-area": ["slug", "name", "description", "owner", "code-paths"],
|
|
304
|
+
"edit-area": ["slug", "name", "description", "owner", "code-paths"],
|
|
305
|
+
"area-suggestions": ["fresh"],
|
|
306
|
+
"confirm-area-suggestion": [],
|
|
307
|
+
"dismiss-area-suggestion": [],
|
|
308
|
+
"linear-teams": [],
|
|
309
|
+
"add-linear-board": [],
|
|
310
|
+
"remove-linear-board": [],
|
|
311
|
+
"workspace-logo": [],
|
|
312
|
+
"set-workspace-logo": [],
|
|
313
|
+
"workspace-connections": [],
|
|
262
314
|
};
|
|
263
315
|
// Your person's own actions, sent as them (X-Gavel-For-Person) once they've let you act for them
|
|
264
316
|
// (D-911): the MCP tools' names.
|
|
@@ -300,6 +352,29 @@ const FOR_PERSON = [
|
|
|
300
352
|
"my-blockers",
|
|
301
353
|
"nudge-mine",
|
|
302
354
|
"reassign",
|
|
355
|
+
"workspace-settings",
|
|
356
|
+
"edit-workspace",
|
|
357
|
+
"workspace-people",
|
|
358
|
+
"set-role",
|
|
359
|
+
"invitations",
|
|
360
|
+
"invite-person",
|
|
361
|
+
"email-invitation-again",
|
|
362
|
+
"take-back-invitation",
|
|
363
|
+
"invite-link",
|
|
364
|
+
"reset-invite-link",
|
|
365
|
+
"set-invite-link-rule",
|
|
366
|
+
"workspace-areas",
|
|
367
|
+
"add-area",
|
|
368
|
+
"edit-area",
|
|
369
|
+
"area-suggestions",
|
|
370
|
+
"confirm-area-suggestion",
|
|
371
|
+
"dismiss-area-suggestion",
|
|
372
|
+
"linear-teams",
|
|
373
|
+
"add-linear-board",
|
|
374
|
+
"remove-linear-board",
|
|
375
|
+
"workspace-logo",
|
|
376
|
+
"set-workspace-logo",
|
|
377
|
+
"workspace-connections",
|
|
303
378
|
];
|
|
304
379
|
const isCommand = (name) => Object.hasOwn(FLAGS, name);
|
|
305
380
|
// A command's own entries in USAGE: each line naming it, with the lines indented under it.
|
|
@@ -597,6 +672,109 @@ function personRequest(command, p, f, options) {
|
|
|
597
672
|
case "reassign":
|
|
598
673
|
upTo(1);
|
|
599
674
|
return asThem("POST", `/v1/decisions/${ref(p[0])}/reassign`, { toPerson: f["to-person"], toAgentId: f["to-agent"], note: f.note });
|
|
675
|
+
case "workspace-settings":
|
|
676
|
+
upTo(0);
|
|
677
|
+
return asThem("GET", "/v1/workspace");
|
|
678
|
+
case "edit-workspace": {
|
|
679
|
+
upTo(0);
|
|
680
|
+
const depth = f["sub-agent-depth"];
|
|
681
|
+
if (depth !== undefined && !/^\d+$/.test(depth))
|
|
682
|
+
throw new UsageError("--sub-agent-depth is a number");
|
|
683
|
+
const untrusted = f["never-trusted"];
|
|
684
|
+
const body = compact({
|
|
685
|
+
name: f.name,
|
|
686
|
+
triagePersonId: orNone("triage-person"),
|
|
687
|
+
subAgentMaxDepth: depth === undefined ? undefined : Number(depth),
|
|
688
|
+
neverTrustableAreaIds: untrusted === undefined ? undefined : untrusted === "none" ? [] : list(untrusted),
|
|
689
|
+
});
|
|
690
|
+
if (!Object.keys(body).length)
|
|
691
|
+
throw new UsageError("edit-workspace needs something to change");
|
|
692
|
+
return asThem("PATCH", "/v1/workspace", body);
|
|
693
|
+
}
|
|
694
|
+
case "workspace-people":
|
|
695
|
+
upTo(0);
|
|
696
|
+
return asThem("GET", "/v1/workspace/people");
|
|
697
|
+
case "set-role":
|
|
698
|
+
upTo(1);
|
|
699
|
+
return asThem("PATCH", `/v1/workspace/people/${id("the person's id")}`, { role: need(f.role, "--role") });
|
|
700
|
+
case "invitations":
|
|
701
|
+
upTo(0);
|
|
702
|
+
return asThem("GET", "/v1/workspace/invitations");
|
|
703
|
+
case "invite-person":
|
|
704
|
+
upTo(0);
|
|
705
|
+
return asThem("POST", "/v1/workspace/invitations", { email: need(f.email, "--email"), role: f.role });
|
|
706
|
+
case "email-invitation-again":
|
|
707
|
+
upTo(1);
|
|
708
|
+
return asThem("POST", `/v1/workspace/invitations/${id("the invitation's id")}/email`);
|
|
709
|
+
case "take-back-invitation":
|
|
710
|
+
upTo(1);
|
|
711
|
+
return asThem("DELETE", `/v1/workspace/invitations/${id("the invitation's id")}`);
|
|
712
|
+
case "invite-link":
|
|
713
|
+
upTo(0);
|
|
714
|
+
return asThem("GET", "/v1/workspace/invite-link");
|
|
715
|
+
case "reset-invite-link":
|
|
716
|
+
upTo(0);
|
|
717
|
+
return asThem("POST", "/v1/workspace/invite-link/reset");
|
|
718
|
+
case "set-invite-link-rule":
|
|
719
|
+
upTo(0);
|
|
720
|
+
return asThem("PUT", "/v1/workspace/invite-link/rule", { mode: need(f.mode, "--mode"), domains: f.domains === undefined ? undefined : list(f.domains) });
|
|
721
|
+
case "workspace-areas":
|
|
722
|
+
upTo(0);
|
|
723
|
+
return asThem("GET", "/v1/areas");
|
|
724
|
+
case "add-area":
|
|
725
|
+
upTo(0);
|
|
726
|
+
return asThem("POST", "/v1/areas", {
|
|
727
|
+
slug: need(f.slug, "--slug"),
|
|
728
|
+
name: need(f.name, "--name"),
|
|
729
|
+
description: f.description && readText(f.description),
|
|
730
|
+
ownerPerson: f.owner,
|
|
731
|
+
codePaths: f["code-paths"] === undefined ? undefined : list(f["code-paths"]),
|
|
732
|
+
});
|
|
733
|
+
case "edit-area": {
|
|
734
|
+
upTo(1);
|
|
735
|
+
const area = id("the area's id");
|
|
736
|
+
const body = compact({
|
|
737
|
+
slug: f.slug,
|
|
738
|
+
name: f.name,
|
|
739
|
+
description: f.description && readText(f.description),
|
|
740
|
+
ownerPerson: orNone("owner"),
|
|
741
|
+
codePaths: f["code-paths"] === undefined ? undefined : list(f["code-paths"]),
|
|
742
|
+
});
|
|
743
|
+
if (!Object.keys(body).length)
|
|
744
|
+
throw new UsageError("edit-area needs something to change");
|
|
745
|
+
return asThem("PATCH", `/v1/areas/${area}`, body);
|
|
746
|
+
}
|
|
747
|
+
case "area-suggestions":
|
|
748
|
+
upTo(0);
|
|
749
|
+
return asThem("GET", `/v1/areas/suggestions${yesNo("fresh") ? "?fresh=1" : ""}`);
|
|
750
|
+
case "confirm-area-suggestion":
|
|
751
|
+
upTo(1);
|
|
752
|
+
return asThem("POST", `/v1/areas/suggestions/${id("the suggestion's id")}/confirm`);
|
|
753
|
+
case "dismiss-area-suggestion":
|
|
754
|
+
upTo(1);
|
|
755
|
+
return asThem("POST", `/v1/areas/suggestions/${id("the suggestion's id")}/dismiss`);
|
|
756
|
+
case "linear-teams":
|
|
757
|
+
upTo(0);
|
|
758
|
+
return asThem("GET", "/v1/board/teams");
|
|
759
|
+
case "add-linear-board":
|
|
760
|
+
upTo(1);
|
|
761
|
+
return asThem("POST", "/v1/board/boards", { teamId: need(p[0], "the team's id") });
|
|
762
|
+
case "remove-linear-board":
|
|
763
|
+
upTo(1);
|
|
764
|
+
return asThem("DELETE", `/v1/board/boards/${id("the team's id")}`);
|
|
765
|
+
case "workspace-logo":
|
|
766
|
+
upTo(0);
|
|
767
|
+
return asThem("GET", "/v1/workspace/logo");
|
|
768
|
+
case "set-workspace-logo": {
|
|
769
|
+
upTo(1);
|
|
770
|
+
const source = need(p[0], "slack, github, linear or none");
|
|
771
|
+
if (!["slack", "github", "linear", "none"].includes(source))
|
|
772
|
+
throw new UsageError("set-workspace-logo takes slack, github, linear or none");
|
|
773
|
+
return asThem("PUT", "/v1/workspace/logo", { source: source === "none" ? null : source });
|
|
774
|
+
}
|
|
775
|
+
case "workspace-connections":
|
|
776
|
+
upTo(0);
|
|
777
|
+
return asThem("GET", "/v1/connections");
|
|
600
778
|
default:
|
|
601
779
|
throw new UsageError(`unknown command "${command}"`);
|
|
602
780
|
}
|
|
@@ -1375,6 +1553,7 @@ async function main(argvIn) {
|
|
|
1375
1553
|
headers: {
|
|
1376
1554
|
authorization: `Bearer ${token}`,
|
|
1377
1555
|
accept: "application/json",
|
|
1556
|
+
"x-gavel-waiting": "1",
|
|
1378
1557
|
...agentHeader(as),
|
|
1379
1558
|
...(request.forPerson ? { "x-gavel-for-person": "true" } : {}),
|
|
1380
1559
|
...(request.body !== undefined ? { "content-type": "application/json" } : {}),
|
|
@@ -1394,6 +1573,11 @@ async function main(argvIn) {
|
|
|
1394
1573
|
return 1;
|
|
1395
1574
|
}
|
|
1396
1575
|
console.log(out);
|
|
1576
|
+
// What's waiting for you (the server's own words), on stderr so stdout stays the answer's JSON. A
|
|
1577
|
+
// failed call's stderr stays its error alone.
|
|
1578
|
+
const waiting = res.headers.get("x-gavel-waiting");
|
|
1579
|
+
if (waiting)
|
|
1580
|
+
console.error(waiting);
|
|
1397
1581
|
return 0;
|
|
1398
1582
|
}
|
|
1399
1583
|
main(process.argv.slice(2)).then((code) => process.exit(code), (err) => {
|
package/package.json
CHANGED