@sjawhar/claude-envoy 2.43.0 → 2.44.0

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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "2.43.0"
5
+ "version": "2.44.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
package/dist/dispatch.js CHANGED
@@ -15324,7 +15324,7 @@ var SEARCH_QUERY_HINT = "search with a short phrase of a few words, not a passag
15324
15324
  var SEARCH_KIND_DEPTH = 100;
15325
15325
  var PROJECT_KEY_PATTERN = /^[A-Z][A-Z0-9]{1,9}$/;
15326
15326
  var PROJECT_KEY_RULE = "an uppercase letter, then 1 to 9 uppercase letters or digits, such as CORE";
15327
- var ARCHITECTURE_SOURCE_REPO_PATTERN = /^[A-Za-z0-9-]+\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
15327
+ var ARCHITECTURE_SOURCE_REPO_PATTERN = /^[A-Za-z0-9_-]+\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
15328
15328
  var ISSUE_STATUSES = [
15329
15329
  "triage",
15330
15330
  "icebox",
@@ -15370,7 +15370,7 @@ var dispatchToolSpecs = [
15370
15370
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
15371
15371
  assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
15372
15372
  components: componentsArgument(z).optional(),
15373
- repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
15373
+ repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
15374
15374
  })
15375
15375
  },
15376
15376
  {
@@ -15396,7 +15396,7 @@ var dispatchToolSpecs = [
15396
15396
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
15397
15397
  advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
15398
15398
  components: componentsArgument(z).optional(),
15399
- repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; an empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
15399
+ repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
15400
15400
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
15401
15401
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
15402
15402
  }),
@@ -36914,7 +36914,7 @@ var SEARCH_QUERY_HINT = "search with a short phrase of a few words, not a passag
36914
36914
  var SEARCH_KIND_DEPTH = 100;
36915
36915
  var PROJECT_KEY_PATTERN = /^[A-Z][A-Z0-9]{1,9}$/;
36916
36916
  var PROJECT_KEY_RULE = "an uppercase letter, then 1 to 9 uppercase letters or digits, such as CORE";
36917
- var ARCHITECTURE_SOURCE_REPO_PATTERN = /^[A-Za-z0-9-]+\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
36917
+ var ARCHITECTURE_SOURCE_REPO_PATTERN = /^[A-Za-z0-9_-]+\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
36918
36918
  var ISSUE_STATUSES = [
36919
36919
  "triage",
36920
36920
  "icebox",
@@ -36960,7 +36960,7 @@ var dispatchToolSpecs = [
36960
36960
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
36961
36961
  assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
36962
36962
  components: componentsArgument(z).optional(),
36963
- repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
36963
+ repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
36964
36964
  })
36965
36965
  },
36966
36966
  {
@@ -36986,7 +36986,7 @@ var dispatchToolSpecs = [
36986
36986
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
36987
36987
  advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
36988
36988
  components: componentsArgument(z).optional(),
36989
- repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; an empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
36989
+ repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
36990
36990
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
36991
36991
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
36992
36992
  }),
@@ -54679,14 +54679,20 @@ var legionCacheView = object({
54679
54679
  healthError: nonEmptyString2.optional(),
54680
54680
  retainedUntil: timestamp.optional()
54681
54681
  });
54682
+ var legionAppInstallations = object({ implement: boolean2(), review: boolean2() });
54682
54683
  var legionRepositories = object({
54683
54684
  owners: array(nonEmptyString2),
54684
54685
  mapped: array(object({
54685
54686
  repo: nonEmptyString2,
54686
54687
  default: boolean2(),
54688
+ apps: legionAppInstallations.optional(),
54687
54689
  cache: legionCacheView.optional()
54688
54690
  })),
54689
- refused: array(object({ repo: nonEmptyString2, reason: nonEmptyString2 })),
54691
+ refused: array(object({
54692
+ repo: nonEmptyString2,
54693
+ reason: nonEmptyString2,
54694
+ apps: legionAppInstallations.optional()
54695
+ })),
54690
54696
  withoutWebhookApp: array(object({ repo: nonEmptyString2, reason: nonEmptyString2 })),
54691
54697
  caches: array(legionCacheView)
54692
54698
  });
@@ -54835,7 +54841,9 @@ var LegionControllerCredentialResponse = object({
54835
54841
  })),
54836
54842
  default: nonEmptyString2,
54837
54843
  app: _enum2(["implement", "review"]),
54838
- expiresAt: timestamp
54844
+ expiresAt: timestamp,
54845
+ renames: array(object({ from: nonEmptyString2, to: nonEmptyString2 })).optional(),
54846
+ installed: array(nonEmptyString2)
54839
54847
  });
54840
54848
  var LegionErrorResponse = object({
54841
54849
  error: nonEmptyString2,
@@ -57724,9 +57732,9 @@ var import_nats2 = __toESM(require_mod4(), 1);
57724
57732
 
57725
57733
  // package.json
57726
57734
  var name = "@sjawhar/claude-envoy";
57727
- var version2 = "2.43.0";
57735
+ var version2 = "2.44.0";
57728
57736
  var legion = {
57729
- daemonApiVersion: 151
57737
+ daemonApiVersion: 152
57730
57738
  };
57731
57739
 
57732
57740
  // ../pi-shared/src/agent-stream.ts
@@ -14261,7 +14261,7 @@ var SEARCH_QUERY_HINT = "search with a short phrase of a few words, not a passag
14261
14261
  var SEARCH_KIND_DEPTH = 100;
14262
14262
  var PROJECT_KEY_PATTERN = /^[A-Z][A-Z0-9]{1,9}$/;
14263
14263
  var PROJECT_KEY_RULE = "an uppercase letter, then 1 to 9 uppercase letters or digits, such as CORE";
14264
- var ARCHITECTURE_SOURCE_REPO_PATTERN = /^[A-Za-z0-9-]+\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
14264
+ var ARCHITECTURE_SOURCE_REPO_PATTERN = /^[A-Za-z0-9_-]+\/(?!\.\.?$)[A-Za-z0-9._-]+$/;
14265
14265
  var ISSUE_STATUSES = [
14266
14266
  "triage",
14267
14267
  "icebox",
@@ -14307,7 +14307,7 @@ var dispatchToolSpecs = [
14307
14307
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
14308
14308
  assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14309
14309
  components: componentsArgument(z).optional(),
14310
- repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
14310
+ repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
14311
14311
  })
14312
14312
  },
14313
14313
  {
@@ -14333,7 +14333,7 @@ var dispatchToolSpecs = [
14333
14333
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
14334
14334
  advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
14335
14335
  components: componentsArgument(z).optional(),
14336
- repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; an empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
14336
+ repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
14337
14337
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
14338
14338
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
14339
14339
  }),
@@ -183,8 +183,8 @@ merges, because the child's work must build on the merged change. Name the merge
183
183
  task (`gh api repos/<owner>/<repo>/pulls/<n> --jq .merge_commit_sha`); for a repository that pins the
184
184
  other one by commit (a lock file or dependency pin), the pin is that commit. Do not hold such a
185
185
  child with `--blocked-by` instead, because Legion would start it at the blocker's close, before you
186
- name the merged commit. Read the other repositories with your gh's read-only access
187
- (`-R owner/repo`).
186
+ name the merged commit. Read another repository with your gh, which reaches every repository your
187
+ role's App is installed on (`-R owner/repo`).
188
188
 
189
189
  ## Recording a wait on other work
190
190
 
@@ -23,7 +23,7 @@ and 7 (a conflict, the hand-over, the close) is in
23
23
  | `child-status` | A child of your tree left the workflow or re-entered it, or joined your tree from the admission queue or from a closed tree; the reason names the child and its new status, or reads `<KEY> joined the tree of <ROOT> from the admission queue`, or, for a member of a closed tree your release took, `<KEY> joined the tree of <ROOT> from the closed tree of <OLD ROOT>`. A reason that says a child starts planning comes at the child's first phase, and it also says that the child's own architect starts with it. From then on that architect owns the child while it holds its role: its decomposition, its children and its acceptance. While that architect holds its role, you hear only the child's `child-status` and `child-closed`, and its architect's `worker-died` and `worker-stalled`. The child's other notices come to you too while that architect does not hold its role, which the daemon's `holdsRole` decides. `todo` (a human's move, your `release_children`, or your `rerun_child`) means it runs again under your tree from planning, and the daemon starts it; you start nothing. A child held for a blocker starts the same way once nothing holds it, and the reason, naming it and its root, says what cleared the hold: its last blocker's close, naming the issues it waited on, now done, or a person or you taking its blocked-by links off; you start nothing for it either. `backlog`, `icebox` or `triage` (a human's move, or your `park_child`) means the child stopped as workflow's `leave` decides, and it advances no further until it is set back to `todo`. The child's next start resumes its architect's session, and that architect starts in a new session only once supervise's `forgetSession` has dropped that one. A `park_child` and then a `rerun_child` is that child's restart and not a park, because the daemon refuses `rerun_child` on a child whose phase is not `done` (`CHILD_RUNNING`, `packages/daemon/internal/api/architect.go`). Joined from the admission queue means a root that waited for a slot and never ran, which a person made a child of your tree or your `release_children` adopted, now runs in your tree as a child, from planning when it is `todo` and parked otherwise. It takes an admission slot of its own when its work starts, and its own architect starts with its first phase. One that waits on an unfinished blocked-by issue is held for that blocker like any other child, and starts when nothing holds it. You start nothing. A reason saying an issue is beneath an ancestor whose reviewed head the daemon has already accepted is a person's `todo` the daemon recorded and holds at `admitted`: nothing starts it until that ancestor closes, and a `request_backward_move` of the ancestor is what runs it under the ancestor now. What the other issues you own do is your decision. When a park leaves no child that an issue in `accepting` waits on, run that issue's last round (`skill://legion-architect/references/acceptance.md`). |
24
24
  | `child-closed` | Read the child completion and remaining open children. Re-scope open work, and take out with `park_child` each child the result makes unneeded (first take its link off each sibling that waits on it, or park that sibling too when its work ends with the parked child, under the same rule, as section 2 says) and say why with `dispatch comment`. Park a child only when a person asked for that move, or when the work is done, folded into another issue or no longer needed. Then file any new child the result calls for, after the red-team check in `skill://legion-architect/references/decomposition.md`, and release it at once with `release_children`, blocked by what it builds on (section 2). When a worker waits on this child for a missing surface (see `phase-finished`), tell it to continue with `envoy_publish` to its role topic. The last child's close is not the end-game (section 3). When it was the last child an issue in `accepting` waits on, run that issue's last round (`skill://legion-architect/references/acceptance.md`). |
25
25
  | `child-release-stalled` | Its `reason` names a child that a `release_children` released and your tree has not recorded, its parent, and why, one of three: the parent's release has not reached the daemon after three tries; or GitHub did not answer the App installation read, or the default-branch read past GitHub's rate limit, of a repository on the child's parent chain, and the release left the child unrecorded because a parent on that chain is not `todo`, or did not write the child `todo` because its parent is not recorded; or the daemon's recovery of such a repository, once GitHub answered, still left children unrecorded. The first two come to the architect whose `release_children` it was. The recovery's notice goes, whoever ran the release, to the architect that owns each child's parent where your tree records that parent, and to the tree root's architect for the rest: a notice on each recorded parent lists that parent's children, and one on the tree root lists the rest, each with its parent. Read the parent's record with the `legion` tool's `read_record` (`issue` the parent); release the parent first when the `reason` says to, then run `release_children` for the child again once the parent is recorded in your tree, and tell the controller if it never is. |
26
- | `child-not-recorded` | Its `reason` names a child your tree did not record and why: its repository resolves to none (neither it nor an ancestor names one, and the project has no default), or to one not mapped to the project, or to one the daemon leaves out for a missing GitHub App. The daemon said why on the child too. Set the child's repository to one of the project's (`dispatch issue-update --repo owner/name`), then release it again with `release_children`; tell the controller when the repository it needs is not served. |
26
+ | `child-not-recorded` | Its `reason` names a child your tree did not record and why: its repository resolves to none (neither it nor an ancestor names one, and the project has no default), or a role GitHub App is not installed on that repository, which the reason names. The daemon said why on the child too. Set the child's repository (`dispatch issue-update --repo owner/name`), or get the named App installed on the repository it has, then release it again with `release_children`. Tell the controller when neither is yours to do. |
27
27
  | `children-first` | An issue of your tree at `admitted` starts no phase of its own while Dispatch shows an open child under it, a child you filed and have not released included. The reason names the parent and each open child with the Dispatch status that holds it, and each cycle it found (a child `blocked_by` an issue above it on its own parent chain, which only a person taking that link off ends: open a `dispatch ask`). It comes once per issue and run of its tree. Release every child that should run. Park a child only when a person asked for that move, or when the work is done, folded into another issue or no longer needed, and cite that reason in a comment on the child. A released child, a held one included, stays under the parent, because the parent's wait ends when that child leaves the workflow. Move out from under the parent only a child you have not released and that should not run now. Move it under another issue you own (section 3 says which) that has started a phase and has not reached `accepting`, and never under an issue it waits on: that move ends this wait and leaves the child in the tree (section 3). After the move, ask the person on the root (`dispatch ask`) when that child's work should run or stop: release it when they say to run it; when they say to stop it, close it, or move it to `icebox` under the rule when they say its work should wait, citing their answer. Until they answer, sign off neither the issue you moved it under nor any issue above it that you accept. Never give such a child the `legion` label, and never clear its parent while the tree is live, because such a child would then run nowhere (section 3). Where you own no issue to move the child under, ask the person. A child's architect sends each of these questions to the architect above it, as "Every turn" in `skill://legion-architect` says. The parent's first phase can start once the last open child has left the workflow; a parent the daemon has already started gives its admission slot back while it waits for its children, and takes one again by itself; nothing of its work stops meanwhile, and you do nothing for it (https://cybermonklabs.github.io/legion/legion/concepts/#admission-and-the-legion-label, which also names the three roots that keep their slot through a wait); a parent the daemon has not started waits in the line for a slot. You start nothing. |
28
28
  | `design-approved` | Its `version` is the approved one, and it names no step: under more than one gated step, read `gatedSteps` in your own record (the `legion` tool's `read_record`) to see which step that version opened and whether another still holds the tree. A human approved the document of one gated step at its current version; that step is open. Proceed to section 2 once every gated step is `approved` — except on a root whose catch-up said `handed_over`: its workers already run their phases, so start nothing. One whose `version` is the version a human's own answer to a decision block wrote, after an earlier approval (Dispatch carried that approval to it, "After approval" in `skill://legion-architect/references/design-gate.md`), opens nothing new: carry on, and release no wave because of it. A root that was waiting on a question in `awaiting_person` gets no such notice: the task that resumes it says "Your spec is approved at version N and the design gate is open: this resume is your design-approved wake", and that resume is this wake — proceed to section 2 on it. |
29
29
  | `design-changes-requested` | Its `version` and `reason`, and no step: under more than one gated step, read `gatedSteps` in your own record (the `legion` tool's `read_record`) and take the step whose `status` is `changes_requested`. A human asked for changes to that step's document at `version`, for `reason`. Revise that document as the reason asks and request approval again as "The armed gate" in `skill://legion-architect/references/design-gate.md` says; end your turn; that step is closed. On a root that was waiting on a question in `awaiting_person`, a review the human gave after the wait began comes in the resume task, not in this notice, whether it answered the wait or came after something else did: the task names the review with its version and reason, unless a later approval superseded it. A `version` below the latest, or a second request for one version, is a request that reached the daemon late: read it as the same section's last paragraph says. Each request arrives once. |
@@ -51,7 +51,8 @@ answer to your ask, a mention), Envoy or Slack. No `legion controller start` can
51
51
  owner a command names (`-R owner/repo`, `repos/owner/repo` in `gh api`, a GitHub URL), and with the
52
52
  first owner's token (`GH_CONFIG_DIR`) otherwise, so always name the repository: another owner's repository read with
53
53
  the first owner's token can fail. The tokens sit in `LEGION_GH_OWNERS_DIR`, one read-only directory
54
- per owner, each token reaching that owner's repositories in the project and no others, refreshed
54
+ per owner the review App is installed on, each token reaching every repository that owner's
55
+ installation holds, refreshed
55
56
  every minute. When the daemon has no GitHub App, `legion controller start`
56
57
  prints `[legion] the daemon has no GitHub App to act as; the controller's gh acts as nobody`.
57
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "AGENTS.md"
20
20
  ],
21
21
  "legion": {
22
- "daemonApiVersion": 151
22
+ "daemonApiVersion": 152
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
@@ -58,15 +58,16 @@ This form sends an empty value, and the API answers as if you had sent no creden
58
58
  ```sh
59
59
  # wrong
60
60
  agent-secrets LEGION_SLACK_BOT_TOKEN -- \
61
- curl -sS -H "Authorization: Bearer $LEGION_SLACK_BOT_TOKEN" https://slack.com/api/auth.test
61
+ sh -c "printf 'Authorization: Bearer %s' \"$LEGION_SLACK_BOT_TOKEN\" | curl -sS -H @- https://slack.com/api/auth.test"
62
62
  ```
63
63
 
64
- Your own shell expands `$LEGION_SLACK_BOT_TOKEN` before `agent-secrets` runs, and in your shell that
65
- name is empty. Slack then answers `{"ok":false,"error":"not_authed"}`. What the client hands over — the value, or the placeholder of
66
- a secret behind the airlock — exists only in the environment of the command the client starts, so
67
- that command must read it itself. Put the command in single quotes, inside
68
- `sh -c`, where the quotes keep the expansion for the child, and give `curl` the header on standard
69
- input (`-H @-`), so the value is in no command's arguments:
64
+ Your own shell expands `$LEGION_SLACK_BOT_TOKEN` inside the double quotes before `agent-secrets`
65
+ runs, and in your shell that name is empty. Slack then answers `{"ok":false,"error":"not_authed"}`.
66
+ What the client hands over — the value, or the placeholder of a secret behind the airlock — exists
67
+ only in the environment of the command the client starts, so that command must read it itself.
68
+ Put the command in single quotes, inside `sh -c`, where the quotes keep the expansion for the
69
+ child, and give `curl` the header on standard input (`-H @-`), so the value is in no command's
70
+ arguments:
70
71
 
71
72
  ```sh
72
73
  # right
@@ -150,13 +151,14 @@ Your transcript keeps everything a command prints.
150
151
  ```
151
152
 
152
153
  - Take a credential out of a JSON value inside the command, and pass it on there without
153
- printing it. `jq -e` exits 1 when the path holds nothing, so the command stops rather than
154
- sending an empty credential:
154
+ printing it, with the header on curl's standard input so it is in no command's arguments.
155
+ `jq -e` exits 1 when the path holds nothing, so the command stops rather than sending an empty
156
+ credential:
155
157
 
156
158
  ```sh
157
159
  agent-secrets NAME --reason '…' -- sh -c '
158
160
  token=$(printf %s "$NAME" | jq -er ".path.to.token" 2>/dev/null) || { echo "no token at .path.to.token" >&2; exit 1; }
159
- curl -sS -H "Authorization: Bearer $token" https://api.example.com/'
161
+ printf "Authorization: Bearer %s" "$token" | curl -sS -H @- https://api.example.com/'
160
162
  ```
161
163
 
162
164
  For a GitHub App secret, `--github-owner <account> --github-token` hands the command that one