@sjawhar/claude-envoy 2.38.0 → 2.40.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.38.0"
5
+ "version": "2.40.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "2.38.0",
3
+ "version": "2.40.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
  }
@@ -57720,9 +57720,9 @@ var import_nats2 = __toESM(require_mod4(), 1);
57720
57720
 
57721
57721
  // package.json
57722
57722
  var name = "@sjawhar/claude-envoy";
57723
- var version2 = "2.38.0";
57723
+ var version2 = "2.40.0";
57724
57724
  var legion = {
57725
- daemonApiVersion: 146
57725
+ daemonApiVersion: 151
57726
57726
  };
57727
57727
 
57728
57728
  // ../pi-shared/src/agent-stream.ts
@@ -12,9 +12,12 @@ An issue pod runs no heavy build and no whole test suite. The pod's six roles sh
12
12
  limit. Near that limit the launcher's memory guard, where the deployment runs it (it is on by
13
13
  default), stops, with SIGKILL, the largest process that is neither Legion's own nor an agent's own,
14
14
  which in practice is a command an agent ran: a build, a test binary, a Python or JavaScript kernel.
15
- It then tells that process's role why, in a message on the role's topic. The command fails and the
16
- turn goes on. A command that fills the memory faster than the guard can stop it still takes the pod
17
- past its limit, and that ends every role's turn, not only yours.
15
+ It then tells that process's role why, in a message on the role's topic. In a pod that runs in a
16
+ microVM, the pod's own kernel stops such a command in place of the guard where each of the pod's
17
+ requests equals its limit, and the role is told the same way; in a pod that requests less, it can
18
+ stop an agent instead. The command fails and the turn goes on. In a gVisor pod, a command that
19
+ fills the memory faster than the guard can stop it still takes the pod past its limit, and that
20
+ ends every role's turn, not only yours.
18
21
 
19
22
  In the pod you compile the packages your change touches, run by name the tests you added or
20
23
  changed (`go test -run '<TestName>' ./internal/<package>/`, or `bun test` with their files), build
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "2.38.0",
3
+ "version": "2.40.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": 146
22
+ "daemonApiVersion": 151
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
@@ -182,10 +182,12 @@ Without the grant line the status is the client's own:
182
182
  - **1** — a refusal or a failure that the message names: a name the broker does not serve
183
183
  (`UNKNOWN_SECRET`), a secret that waits for its first value (`PENDING_VALUE`), a broker it cannot
184
184
  reach, a machine that is not logged in to the broker, a request cancelled or expired,
185
- `REQUEST_PENDING`, a grant that is no longer live, or a command that is not on `PATH`, which is
186
- refused before the broker is asked anything, so it reaches no approver.
187
- - **2** — a usage error: no broker identity at all (no key in the key dir and no helper socket), no
188
- `AGENT_SECRETS_URL`, no `--`, no `NAME`, or a flag value the client refuses.
185
+ `REQUEST_PENDING`, a grant that is no longer live, a command that is not on `PATH`, which is
186
+ refused before the broker is asked anything, so it reaches no approver, or no broker identity at
187
+ all: `no broker identity for this process: key-dir: …; sign-in: …; helper: …; machine: …`, each
188
+ source with why it had nothing.
189
+ - **2** — a usage error: no `AGENT_SECRETS_URL`, no `--`, no `NAME`, or a flag value the client
190
+ refuses.
189
191
  - **75** — the request still waits for a person. The message names who decides it, where, and the
190
192
  `agent-secrets status <request_id>` that reads it.
191
193
  - **77** — the request was denied. The approver denied it, the policy refused a name (a
@@ -225,8 +227,10 @@ never denies. Every other request waits for that person, as it does now.
225
227
  while the first request still waits, such a run joins it. Any other run that would itself wait
226
228
  for a person and shares a name with a waiting request, with another `--ttl` or another set of
227
229
  names, is refused `REQUEST_PENDING`, which names the request already waiting.
228
- - `agent-secrets identity` exits 0 when this session has a broker identity and 1 when it has none,
229
- and it asks the broker nothing. `agent-secrets self` prints this session's live grants.
230
+ - `agent-secrets identity` exits 0 when this session has a launcher's key or a helper session, and
231
+ 1 otherwise, and it asks the broker nothing. `agent-secrets identity --source` prints the source
232
+ the client would take its broker identity from (`key-dir`, `sign-in`, `helper` or `machine`).
233
+ `agent-secrets self` prints this session's live grants.
230
234
 
231
235
  ## Where a name comes from, and how you may use it
232
236
 
@@ -264,18 +268,31 @@ prompt, a skill, or the issue you work on. There is no list to browse and nothin
264
268
  1. Run the call through `agent-secrets`, with the secret your instructions name.
265
269
  2. Report a service unreachable only with the command you ran and the output you saw.
266
270
  3. When no instruction names a secret for that service, report that instead, with what you checked:
267
- `agent-secrets identity`, and which instructions you read. Request no name you guessed.
271
+ `agent-secrets identity --source`, and which instructions you read. Request no name you guessed.
268
272
 
269
273
  ## On a person's own machine
270
274
 
271
- A session on a person's own development box is not a pod, and `agent-secrets identity` exits 1 there
272
- for two reasons:
273
-
274
- - **The machine is not logged in.** `agent-secrets machine login-status` prints `issued` only while
275
- the machine holds its credential. The person logs the machine in, as `/legion/broker/guides/log-a-machine-in/` in the documentation site shows.
276
- - **The agent is not a broker session.** The helper knows only the process tree it registered. The
277
- person restarts the agent as one:
275
+ The client takes its broker identity from the first of four sources that has one, and needs no
276
+ registered agent session: a launcher's key directory, the person's own `agent-secrets login`, the
277
+ helper for a process inside a session it registered, and the machine's own cloud identity, which it
278
+ finds with no setting once the broker names its exchange audience. `agent-secrets identity
279
+ --source` names the source it would use. When the command exits 1 naming no broker identity, each
280
+ source says why it had nothing:
281
+
282
+ - **`helper: this process is in no session the helper … registered`.** The process inherited the
283
+ helper's socket but is not in a session the helper registered. That alone stops nothing: the
284
+ client goes on to the machine.
285
+ - **`machine: the broker at … names no exchange audience`.** The broker accepts no machine identity
286
+ yet. The person signs in (`agent-secrets login`), or restarts the agent as a session:
278
287
  `agent-secrets register --wait 10 --exec -- <the agent's command>`.
288
+ - **`this machine is not logged in to the secrets broker`.** The helper holds no machine credential.
289
+ `agent-secrets machine login-status` prints `issued` only while it holds one. The person logs the
290
+ machine in, as `/legion/broker/guides/log-a-machine-in/` in the documentation site shows.
291
+
292
+ A stopped helper is not a missing one. Where the helper is installed, or `AGENT_SECRETS_HELPER_SOCK`
293
+ names its socket, and the socket is gone, the command exits 1 with
294
+ `agent-secrets-helper at … so the helper is stopped`, and it does not act as the machine instead.
295
+ Report that line; the person starts the helper (`systemctl --user start agent-secrets-helper`).
279
296
 
280
297
  On `UNKNOWN_SECRET` you stop, as above. You may tell the secret's owner how to find the cause:
281
298
  `agent-secrets secret list` and `agent-secrets secret show NAME`, under a cloud sign-in that may
@@ -327,7 +344,7 @@ It exits 0 and answers `"ok": true` with the messages of the thread. A `ts` that
327
344
  status. A thread read needs the app's `channels:history` scope in a public channel and
328
345
  `groups:history` in a private one; without them Slack answers `missing_scope`, which only a person
329
346
  in the Slack workspace can fix. `LEGION_SLACK_BOT_TOKEN` is a shared agent secret, so every session
330
- with a broker identity is granted it; a session with no broker identity exits 2.
347
+ with a broker identity is granted it; a process with no broker identity exits 1.
331
348
 
332
349
  Paging: Slack recommends a `limit` of at most 200. While the answer's `has_more` is true, pass its
333
350
  `response_metadata.next_cursor` as `cursor` to the next call. Each page repeats the thread's root