@sjawhar/claude-envoy 2.32.4 → 2.33.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.32.4"
5
+ "version": "2.33.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "2.32.4",
3
+ "version": "2.33.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
@@ -27848,6 +27848,7 @@ var EXCHANGE_CLIENT_ID = "dispatch-token-exchange";
27848
27848
  var FORM_SESSION = "session";
27849
27849
  var FORM_LAUNCHER_CREDENTIAL = "launcher_credential";
27850
27850
  var FORM_LAUNCHER_CREDENTIAL_DECLINED = "false";
27851
+ var FORM_PROJECTS = "projects";
27851
27852
  var SUBJECT_TOKEN_TYPE_KUBERNETES = "urn:envoy:params:oauth:token-type:kubernetes-service-account";
27852
27853
  var SUBJECT_TOKEN_TYPE_GOOGLE = "urn:envoy:params:oauth:token-type:google-identity";
27853
27854
  var SUBJECT_TOKEN_TYPE_PERSON = "urn:envoy:params:oauth:token-type:person-google-identity";
@@ -29341,6 +29342,7 @@ class BrokerTokenClient {
29341
29342
  #subject;
29342
29343
  #actor;
29343
29344
  #session;
29345
+ #projects;
29344
29346
  #launcherCredential;
29345
29347
  #renewBeforeMs;
29346
29348
  #now;
@@ -29357,6 +29359,7 @@ class BrokerTokenClient {
29357
29359
  this.#subject = options.subject;
29358
29360
  this.#actor = options.actor;
29359
29361
  this.#session = options.session ?? "";
29362
+ this.#projects = [...options.projects ?? []];
29360
29363
  this.#launcherCredential = options.launcherCredential ?? true;
29361
29364
  this.#renewBeforeMs = options.renewBeforeMs ?? DEFAULT_RENEW_BEFORE_MS;
29362
29365
  this.#now = options.now ?? Date.now;
@@ -29407,6 +29410,8 @@ class BrokerTokenClient {
29407
29410
  };
29408
29411
  if (this.#session !== "")
29409
29412
  form[FORM_SESSION] = this.#session;
29413
+ if (this.#projects.length > 0)
29414
+ form[FORM_PROJECTS] = this.#projects.join(" ");
29410
29415
  if (!this.#launcherCredential) {
29411
29416
  form[FORM_LAUNCHER_CREDENTIAL] = FORM_LAUNCHER_CREDENTIAL_DECLINED;
29412
29417
  }
@@ -29711,6 +29716,8 @@ var IDENTITY_VAR = "AGENT_SECRETS_MACHINE_IDENTITY";
29711
29716
  var MACHINE_TOKEN_FILE_VAR = "AGENT_SECRETS_MACHINE_TOKEN_FILE";
29712
29717
  var MACHINE_AUDIENCE_VAR = "AGENT_SECRETS_MACHINE_AUDIENCE";
29713
29718
  var SESSION_VAR = "AGENT_SECRETS_SESSION";
29719
+ var PROJECTS_VAR = "AGENT_SECRETS_PROJECTS";
29720
+ var MAX_PROJECTS = 16;
29714
29721
  var POOL_AUDIENCE_VAR = "AGENT_SECRETS_POOL_AUDIENCE";
29715
29722
  var POOL_ACCOUNT_VAR = "AGENT_SECRETS_POOL_ACCOUNT";
29716
29723
  var IDENTITY_KUBERNETES = "kubernetes";
@@ -29722,6 +29729,7 @@ var BROKER_VARIABLES = [
29722
29729
  MACHINE_TOKEN_FILE_VAR,
29723
29730
  MACHINE_AUDIENCE_VAR,
29724
29731
  SESSION_VAR,
29732
+ PROJECTS_VAR,
29725
29733
  POOL_AUDIENCE_VAR,
29726
29734
  POOL_ACCOUNT_VAR,
29727
29735
  SIGNIN_DIR_VAR,
@@ -29771,6 +29779,24 @@ function tradeSession(env, own = "") {
29771
29779
  const acting = own.trim();
29772
29780
  return acting !== "" ? acting : value(env, SESSION_VAR);
29773
29781
  }
29782
+ function tradeProjects(env) {
29783
+ const keys = value(env, PROJECTS_VAR).split(/\s+/).filter((key) => key !== "");
29784
+ if (keys.length > MAX_PROJECTS) {
29785
+ throw new Error(`${PROJECTS_VAR}: ${keys.length} projects are named, and a token names at most ${MAX_PROJECTS}`);
29786
+ }
29787
+ for (const key of keys) {
29788
+ if (!PROJECT_KEY_PATTERN.test(key)) {
29789
+ throw new Error(`${PROJECTS_VAR}: "${key}" is not a project key: ${PROJECT_KEY_RULE}`);
29790
+ }
29791
+ }
29792
+ const sorted = keys.sort();
29793
+ for (let at = 1;at < sorted.length; at += 1) {
29794
+ if (sorted[at] === sorted[at - 1]) {
29795
+ throw new Error(`${PROJECTS_VAR}: ${sorted[at]} is named twice, and a list names each project once`);
29796
+ }
29797
+ }
29798
+ return sorted;
29799
+ }
29774
29800
  async function brokerTokenClient(env, own = "") {
29775
29801
  const brokerUrl = value(env, BROKER_URL_VAR);
29776
29802
  const machine = machineIdentity(env);
@@ -29796,7 +29822,8 @@ async function brokerTokenClient(env, own = "") {
29796
29822
  key: await importDpopKey(record.box_key, `${record.person}'s box key`),
29797
29823
  subject: personIdentity(record, flow),
29798
29824
  actor: machine,
29799
- session: own.trim() || signInSessionName(record)
29825
+ session: own.trim() || signInSessionName(record),
29826
+ projects: tradeProjects(env)
29800
29827
  });
29801
29828
  return { client, signIn: { person: record.person, thumbprint: record.thumbprint } };
29802
29829
  }
@@ -40579,6 +40579,7 @@ var EXCHANGE_CLIENT_ID = "dispatch-token-exchange";
40579
40579
  var FORM_SESSION = "session";
40580
40580
  var FORM_LAUNCHER_CREDENTIAL = "launcher_credential";
40581
40581
  var FORM_LAUNCHER_CREDENTIAL_DECLINED = "false";
40582
+ var FORM_PROJECTS = "projects";
40582
40583
  var SUBJECT_TOKEN_TYPE_KUBERNETES = "urn:envoy:params:oauth:token-type:kubernetes-service-account";
40583
40584
  var SUBJECT_TOKEN_TYPE_GOOGLE = "urn:envoy:params:oauth:token-type:google-identity";
40584
40585
  var SUBJECT_TOKEN_TYPE_PERSON = "urn:envoy:params:oauth:token-type:person-google-identity";
@@ -42082,6 +42083,7 @@ class BrokerTokenClient {
42082
42083
  #subject;
42083
42084
  #actor;
42084
42085
  #session;
42086
+ #projects;
42085
42087
  #launcherCredential;
42086
42088
  #renewBeforeMs;
42087
42089
  #now;
@@ -42098,6 +42100,7 @@ class BrokerTokenClient {
42098
42100
  this.#subject = options.subject;
42099
42101
  this.#actor = options.actor;
42100
42102
  this.#session = options.session ?? "";
42103
+ this.#projects = [...options.projects ?? []];
42101
42104
  this.#launcherCredential = options.launcherCredential ?? true;
42102
42105
  this.#renewBeforeMs = options.renewBeforeMs ?? DEFAULT_RENEW_BEFORE_MS;
42103
42106
  this.#now = options.now ?? Date.now;
@@ -42148,6 +42151,8 @@ class BrokerTokenClient {
42148
42151
  };
42149
42152
  if (this.#session !== "")
42150
42153
  form[FORM_SESSION] = this.#session;
42154
+ if (this.#projects.length > 0)
42155
+ form[FORM_PROJECTS] = this.#projects.join(" ");
42151
42156
  if (!this.#launcherCredential) {
42152
42157
  form[FORM_LAUNCHER_CREDENTIAL] = FORM_LAUNCHER_CREDENTIAL_DECLINED;
42153
42158
  }
@@ -42452,6 +42457,8 @@ var IDENTITY_VAR = "AGENT_SECRETS_MACHINE_IDENTITY";
42452
42457
  var MACHINE_TOKEN_FILE_VAR = "AGENT_SECRETS_MACHINE_TOKEN_FILE";
42453
42458
  var MACHINE_AUDIENCE_VAR = "AGENT_SECRETS_MACHINE_AUDIENCE";
42454
42459
  var SESSION_VAR = "AGENT_SECRETS_SESSION";
42460
+ var PROJECTS_VAR = "AGENT_SECRETS_PROJECTS";
42461
+ var MAX_PROJECTS = 16;
42455
42462
  var POOL_AUDIENCE_VAR = "AGENT_SECRETS_POOL_AUDIENCE";
42456
42463
  var POOL_ACCOUNT_VAR = "AGENT_SECRETS_POOL_ACCOUNT";
42457
42464
  var IDENTITY_KUBERNETES = "kubernetes";
@@ -42463,6 +42470,7 @@ var BROKER_VARIABLES = [
42463
42470
  MACHINE_TOKEN_FILE_VAR,
42464
42471
  MACHINE_AUDIENCE_VAR,
42465
42472
  SESSION_VAR,
42473
+ PROJECTS_VAR,
42466
42474
  POOL_AUDIENCE_VAR,
42467
42475
  POOL_ACCOUNT_VAR,
42468
42476
  SIGNIN_DIR_VAR,
@@ -42512,6 +42520,24 @@ function tradeSession(env, own = "") {
42512
42520
  const acting = own.trim();
42513
42521
  return acting !== "" ? acting : value(env, SESSION_VAR);
42514
42522
  }
42523
+ function tradeProjects(env) {
42524
+ const keys = value(env, PROJECTS_VAR).split(/\s+/).filter((key) => key !== "");
42525
+ if (keys.length > MAX_PROJECTS) {
42526
+ throw new Error(`${PROJECTS_VAR}: ${keys.length} projects are named, and a token names at most ${MAX_PROJECTS}`);
42527
+ }
42528
+ for (const key of keys) {
42529
+ if (!PROJECT_KEY_PATTERN.test(key)) {
42530
+ throw new Error(`${PROJECTS_VAR}: "${key}" is not a project key: ${PROJECT_KEY_RULE}`);
42531
+ }
42532
+ }
42533
+ const sorted = keys.sort();
42534
+ for (let at = 1;at < sorted.length; at += 1) {
42535
+ if (sorted[at] === sorted[at - 1]) {
42536
+ throw new Error(`${PROJECTS_VAR}: ${sorted[at]} is named twice, and a list names each project once`);
42537
+ }
42538
+ }
42539
+ return sorted;
42540
+ }
42515
42541
  async function brokerTokenClient(env, own = "") {
42516
42542
  const brokerUrl = value(env, BROKER_URL_VAR);
42517
42543
  const machine = machineIdentity(env);
@@ -42537,7 +42563,8 @@ async function brokerTokenClient(env, own = "") {
42537
42563
  key: await importDpopKey(record.box_key, `${record.person}'s box key`),
42538
42564
  subject: personIdentity(record, flow),
42539
42565
  actor: machine,
42540
- session: own.trim() || signInSessionName(record)
42566
+ session: own.trim() || signInSessionName(record),
42567
+ projects: tradeProjects(env)
42541
42568
  });
42542
42569
  return { client, signIn: { person: record.person, thumbprint: record.thumbprint } };
42543
42570
  }
@@ -57476,7 +57503,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
57476
57503
 
57477
57504
  // package.json
57478
57505
  var name = "@sjawhar/claude-envoy";
57479
- var version2 = "2.32.4";
57506
+ var version2 = "2.33.0";
57480
57507
  var legion = {
57481
57508
  daemonApiVersion: 144
57482
57509
  };
@@ -26691,6 +26691,7 @@ var EXCHANGE_CLIENT_ID = "dispatch-token-exchange";
26691
26691
  var FORM_SESSION = "session";
26692
26692
  var FORM_LAUNCHER_CREDENTIAL = "launcher_credential";
26693
26693
  var FORM_LAUNCHER_CREDENTIAL_DECLINED = "false";
26694
+ var FORM_PROJECTS = "projects";
26694
26695
  var SUBJECT_TOKEN_TYPE_KUBERNETES = "urn:envoy:params:oauth:token-type:kubernetes-service-account";
26695
26696
  var SUBJECT_TOKEN_TYPE_GOOGLE = "urn:envoy:params:oauth:token-type:google-identity";
26696
26697
  var SUBJECT_TOKEN_TYPE_PERSON = "urn:envoy:params:oauth:token-type:person-google-identity";
@@ -28184,6 +28185,7 @@ class BrokerTokenClient {
28184
28185
  #subject;
28185
28186
  #actor;
28186
28187
  #session;
28188
+ #projects;
28187
28189
  #launcherCredential;
28188
28190
  #renewBeforeMs;
28189
28191
  #now;
@@ -28200,6 +28202,7 @@ class BrokerTokenClient {
28200
28202
  this.#subject = options.subject;
28201
28203
  this.#actor = options.actor;
28202
28204
  this.#session = options.session ?? "";
28205
+ this.#projects = [...options.projects ?? []];
28203
28206
  this.#launcherCredential = options.launcherCredential ?? true;
28204
28207
  this.#renewBeforeMs = options.renewBeforeMs ?? DEFAULT_RENEW_BEFORE_MS;
28205
28208
  this.#now = options.now ?? Date.now;
@@ -28250,6 +28253,8 @@ class BrokerTokenClient {
28250
28253
  };
28251
28254
  if (this.#session !== "")
28252
28255
  form[FORM_SESSION] = this.#session;
28256
+ if (this.#projects.length > 0)
28257
+ form[FORM_PROJECTS] = this.#projects.join(" ");
28253
28258
  if (!this.#launcherCredential) {
28254
28259
  form[FORM_LAUNCHER_CREDENTIAL] = FORM_LAUNCHER_CREDENTIAL_DECLINED;
28255
28260
  }
@@ -28554,6 +28559,8 @@ var IDENTITY_VAR = "AGENT_SECRETS_MACHINE_IDENTITY";
28554
28559
  var MACHINE_TOKEN_FILE_VAR = "AGENT_SECRETS_MACHINE_TOKEN_FILE";
28555
28560
  var MACHINE_AUDIENCE_VAR = "AGENT_SECRETS_MACHINE_AUDIENCE";
28556
28561
  var SESSION_VAR = "AGENT_SECRETS_SESSION";
28562
+ var PROJECTS_VAR = "AGENT_SECRETS_PROJECTS";
28563
+ var MAX_PROJECTS = 16;
28557
28564
  var POOL_AUDIENCE_VAR = "AGENT_SECRETS_POOL_AUDIENCE";
28558
28565
  var POOL_ACCOUNT_VAR = "AGENT_SECRETS_POOL_ACCOUNT";
28559
28566
  var IDENTITY_KUBERNETES = "kubernetes";
@@ -28565,6 +28572,7 @@ var BROKER_VARIABLES = [
28565
28572
  MACHINE_TOKEN_FILE_VAR,
28566
28573
  MACHINE_AUDIENCE_VAR,
28567
28574
  SESSION_VAR,
28575
+ PROJECTS_VAR,
28568
28576
  POOL_AUDIENCE_VAR,
28569
28577
  POOL_ACCOUNT_VAR,
28570
28578
  SIGNIN_DIR_VAR,
@@ -28614,6 +28622,24 @@ function tradeSession(env, own = "") {
28614
28622
  const acting = own.trim();
28615
28623
  return acting !== "" ? acting : value(env, SESSION_VAR);
28616
28624
  }
28625
+ function tradeProjects(env) {
28626
+ const keys = value(env, PROJECTS_VAR).split(/\s+/).filter((key) => key !== "");
28627
+ if (keys.length > MAX_PROJECTS) {
28628
+ throw new Error(`${PROJECTS_VAR}: ${keys.length} projects are named, and a token names at most ${MAX_PROJECTS}`);
28629
+ }
28630
+ for (const key of keys) {
28631
+ if (!PROJECT_KEY_PATTERN.test(key)) {
28632
+ throw new Error(`${PROJECTS_VAR}: "${key}" is not a project key: ${PROJECT_KEY_RULE}`);
28633
+ }
28634
+ }
28635
+ const sorted = keys.sort();
28636
+ for (let at = 1;at < sorted.length; at += 1) {
28637
+ if (sorted[at] === sorted[at - 1]) {
28638
+ throw new Error(`${PROJECTS_VAR}: ${sorted[at]} is named twice, and a list names each project once`);
28639
+ }
28640
+ }
28641
+ return sorted;
28642
+ }
28617
28643
  async function brokerTokenClient(env, own = "") {
28618
28644
  const brokerUrl = value(env, BROKER_URL_VAR);
28619
28645
  const machine = machineIdentity(env);
@@ -28639,7 +28665,8 @@ async function brokerTokenClient(env, own = "") {
28639
28665
  key: await importDpopKey(record.box_key, `${record.person}'s box key`),
28640
28666
  subject: personIdentity(record, flow),
28641
28667
  actor: machine,
28642
- session: own.trim() || signInSessionName(record)
28668
+ session: own.trim() || signInSessionName(record),
28669
+ projects: tradeProjects(env)
28643
28670
  });
28644
28671
  return { client, signIn: { person: record.person, thumbprint: record.thumbprint } };
28645
28672
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "2.32.4",
3
+ "version": "2.33.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -178,9 +178,10 @@ after it means the command could not start, and the status is 1.
178
178
  Without the grant line the status is the client's own:
179
179
 
180
180
  - **1** — a refusal or a failure that the message names: a name the broker does not serve
181
- (`UNKNOWN_SECRET`), a broker it cannot reach, a machine that is not logged in to the broker, a
182
- request cancelled or expired, `REQUEST_PENDING`, a grant that is no longer live, or a command
183
- that is not on `PATH`.
181
+ (`UNKNOWN_SECRET`), a secret that waits for its first value (`PENDING_VALUE`), a broker it cannot
182
+ reach, a machine that is not logged in to the broker, a request cancelled or expired,
183
+ `REQUEST_PENDING`, a grant that is no longer live, or a command that is not on `PATH`, which is
184
+ refused before the broker is asked anything, so it reaches no approver.
184
185
  - **2** — a usage error: no broker identity at all (no key in the key dir and no helper socket), no
185
186
  `AGENT_SECRETS_URL`, no `--`, no `NAME`, or a flag value the client refuses.
186
187
  - **75** — the request still waits for a person. The message names who decides it, where, and the
@@ -234,6 +235,17 @@ prompt, a skill, or the issue you work on. There is no list to browse and nothin
234
235
  secret exists is recorded against your session with the reason you signed, and it reaches a
235
236
  person's Inbox unless the model judge decides it first.
236
237
  - `UNKNOWN_SECRET` and a denial are final. Do not ask again, and do not try a name of your own.
238
+ - `PENDING_VALUE` is not final: the secret exists, and its owner is storing its value with
239
+ `agent-secrets secret create` now. No request was made and no approver asked. Ask again in a few
240
+ minutes. After ten minutes the broker stops calling it pending and refuses the name
241
+ `UNKNOWN_SECRET`: the create that made it deletes it when its prompt ends, at ten minutes or,
242
+ where its owner was still typing then, when that entry ends; a create that was killed deletes
243
+ nothing, and the secret stays in the store with no value. Tell its
244
+ owner, who sees it as `versions: none` in `agent-secrets secret show NAME`. The owner frees the
245
+ name with `gcloud secrets delete <id> --project <project number>` (`<id>` is the part after
246
+ `secrets/` of the `secret_name` that `show` prints), or stores the value with
247
+ `agent-secrets secret set NAME`. `agent-secrets secret delete NAME` only schedules the deletion
248
+ 30 days out, and until then the name stays taken, so the next `secret create` of it is refused.
237
249
  - A secret that a service owns goes to that service's own pods and VMs and to nothing else:
238
250
  `Evaluate` in `packages/envoy/internal/broker/policy/policy.go` grants a service-owned secret at
239
251
  once when the session's own service is the secret's owner, and denies every other session, with
@@ -276,7 +288,10 @@ the Application Default Credentials, else the gcloud login; on AWS, `--profile`,
276
288
  the email of the person the credential names, and is refused where it names none, as a token
277
289
  minted for `cloud-platform` alone does: give `--owner <email>` there. Both read the value from
278
290
  standard input or from a prompt with echo off, never from an argument. Type it at the prompt, so it
279
- reaches no shell history.
291
+ reaches no shell history. On Google Cloud, `create` makes the secret before it asks for the value,
292
+ so a store that refuses the create asks for none. Until the value is added, a failure or a signal
293
+ deletes that empty secret again, except where the store's answer leaves open whether it stored the
294
+ value: then `create` keeps the secret, exits 1, and names `agent-secrets secret show NAME` to check.
280
295
 
281
296
  ## A worked example: one page of a Slack thread
282
297