@sjawhar/claude-envoy 5.16.6 → 5.16.8

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": "5.16.6"
5
+ "version": "5.16.8"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "5.16.6",
3
+ "version": "5.16.8",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
@@ -30711,7 +30711,7 @@ import { dirname as dirname3, isAbsolute as isAbsolute2, join as join6 } from "p
30711
30711
 
30712
30712
  // ../cipher-client/src/device-login-lock.ts
30713
30713
  import { randomUUID as randomUUID2 } from "crypto";
30714
- import { constants } from "fs";
30714
+ import { closeSync as closeSync2, constants, fstatSync, openSync as openSync2, readSync } from "fs";
30715
30715
  import {
30716
30716
  link,
30717
30717
  lstat,
@@ -31314,6 +31314,27 @@ async function withLoginLock(path, named, work, options = {}) {
31314
31314
  await removeOwn(lock, mine, locked);
31315
31315
  return answer;
31316
31316
  }
31317
+ function loginLockHeldBy(path, pid) {
31318
+ let fd;
31319
+ try {
31320
+ fd = openSync2(`${path}.lock`, LOCK_READ);
31321
+ } catch {
31322
+ return false;
31323
+ }
31324
+ try {
31325
+ if (!fstatSync(fd).isFile())
31326
+ return false;
31327
+ const bytes = Buffer.alloc(DEVICE_LOGIN_MOST_BYTES);
31328
+ const read = readSync(fd, bytes, 0, bytes.length, 0);
31329
+ return bytes.toString("utf8", 0, read).startsWith(`${pid} `);
31330
+ } catch {
31331
+ return false;
31332
+ } finally {
31333
+ try {
31334
+ closeSync2(fd);
31335
+ } catch {}
31336
+ }
31337
+ }
31317
31338
  function namedWithUuid(name, prefix) {
31318
31339
  return name.startsWith(prefix) && /^[0-9a-f-]{36}$/.test(name.slice(prefix.length));
31319
31340
  }
@@ -31331,7 +31352,6 @@ async function removeLeftLocks(path) {
31331
31352
  const name = basename2(path);
31332
31353
  await removeUntouched(dirname2(path), (one) => namedWithUuid(one, `${name}.lock.stale-`) || namedWithUuid(one, `${name}.lock.steal.stale-`));
31333
31354
  }
31334
-
31335
31355
  // ../cipher-client/src/device-login-file.ts
31336
31356
  var DEVICE_LOGIN_FILE_VAR = "AGENT_SECRETS_DEVICE_LOGIN_FILE";
31337
31357
  var DEVICE_LOGIN_FILE_NAMED = `the device login ${DEVICE_LOGIN_FILE_VAR} names (default ~/.config/legion/device-login.json)`;
package/dist/dispatch.js CHANGED
@@ -983,7 +983,7 @@ __export(exports_coerce, {
983
983
  import { readFileSync as readFileSync8 } from "fs";
984
984
 
985
985
  // ../envoy-client/src/dispatch-cli.ts
986
- import { closeSync as closeSync4, constants as constants4, fstatSync as fstatSync2, openSync as openSync4, readFileSync as readFileSync7 } from "fs";
986
+ import { closeSync as closeSync5, constants as constants4, fstatSync as fstatSync3, openSync as openSync5, readFileSync as readFileSync7 } from "fs";
987
987
 
988
988
  // ../envoy-client/src/askgate-marker.ts
989
989
  import { createHash, randomBytes } from "crypto";
@@ -23465,7 +23465,7 @@ import { dirname as dirname3, isAbsolute as isAbsolute3, join as join5 } from "p
23465
23465
 
23466
23466
  // ../cipher-client/src/device-login-lock.ts
23467
23467
  import { randomUUID } from "crypto";
23468
- import { constants as constants2 } from "fs";
23468
+ import { closeSync as closeSync3, constants as constants2, fstatSync, openSync as openSync3, readSync } from "fs";
23469
23469
  import {
23470
23470
  link,
23471
23471
  lstat,
@@ -24068,6 +24068,27 @@ async function withLoginLock(path, named, work, options = {}) {
24068
24068
  await removeOwn(lock, mine, locked);
24069
24069
  return answer;
24070
24070
  }
24071
+ function loginLockHeldBy(path, pid) {
24072
+ let fd;
24073
+ try {
24074
+ fd = openSync3(`${path}.lock`, LOCK_READ);
24075
+ } catch {
24076
+ return false;
24077
+ }
24078
+ try {
24079
+ if (!fstatSync(fd).isFile())
24080
+ return false;
24081
+ const bytes = Buffer.alloc(DEVICE_LOGIN_MOST_BYTES);
24082
+ const read = readSync(fd, bytes, 0, bytes.length, 0);
24083
+ return bytes.toString("utf8", 0, read).startsWith(`${pid} `);
24084
+ } catch {
24085
+ return false;
24086
+ } finally {
24087
+ try {
24088
+ closeSync3(fd);
24089
+ } catch {}
24090
+ }
24091
+ }
24071
24092
  function namedWithUuid(name, prefix) {
24072
24093
  return name.startsWith(prefix) && /^[0-9a-f-]{36}$/.test(name.slice(prefix.length));
24073
24094
  }
@@ -24085,7 +24106,6 @@ async function removeLeftLocks(path) {
24085
24106
  const name = basename(path);
24086
24107
  await removeUntouched(dirname2(path), (one) => namedWithUuid(one, `${name}.lock.stale-`) || namedWithUuid(one, `${name}.lock.steal.stale-`));
24087
24108
  }
24088
-
24089
24109
  // ../cipher-client/src/device-login-file.ts
24090
24110
  var DEVICE_LOGIN_FILE_VAR = "AGENT_SECRETS_DEVICE_LOGIN_FILE";
24091
24111
  var DEVICE_LOGIN_FILE_NAMED = `the device login ${DEVICE_LOGIN_FILE_VAR} names (default ~/.config/legion/device-login.json)`;
@@ -33633,13 +33653,13 @@ async function executeDispatchTool(input) {
33633
33653
  import { createHash as createHash3 } from "crypto";
33634
33654
  import {
33635
33655
  appendFileSync as appendFileSync2,
33636
- closeSync as closeSync3,
33637
- fstatSync,
33656
+ closeSync as closeSync4,
33657
+ fstatSync as fstatSync2,
33638
33658
  mkdirSync as mkdirSync3,
33639
- openSync as openSync3,
33659
+ openSync as openSync4,
33640
33660
  readdirSync as readdirSync2,
33641
33661
  readFileSync as readFileSync5,
33642
- readSync,
33662
+ readSync as readSync2,
33643
33663
  rmSync as rmSync4,
33644
33664
  statSync as statSync3,
33645
33665
  writeFileSync as writeFileSync3
@@ -35644,12 +35664,12 @@ ${result.text}`);
35644
35664
  for (const file of fileOperands(argv)) {
35645
35665
  let bytes;
35646
35666
  try {
35647
- const fd = openSync4(operandPath(io.cwd, file), constants4.O_RDONLY | constants4.O_NONBLOCK);
35667
+ const fd = openSync5(operandPath(io.cwd, file), constants4.O_RDONLY | constants4.O_NONBLOCK);
35648
35668
  try {
35649
- if (fstatSync2(fd).isFile())
35669
+ if (fstatSync3(fd).isFile())
35650
35670
  bytes = readFileSync7(fd);
35651
35671
  } finally {
35652
- closeSync4(fd);
35672
+ closeSync5(fd);
35653
35673
  }
35654
35674
  } catch {}
35655
35675
  files.push({ ...file, sha256: bytes === undefined ? null : bytesDigest(bytes) });
@@ -42544,7 +42544,7 @@ import { dirname as dirname3, isAbsolute as isAbsolute2, join as join4 } from "p
42544
42544
 
42545
42545
  // ../cipher-client/src/device-login-lock.ts
42546
42546
  import { randomUUID } from "crypto";
42547
- import { constants } from "fs";
42547
+ import { closeSync as closeSync2, constants, fstatSync, openSync as openSync2, readSync } from "fs";
42548
42548
  import {
42549
42549
  link,
42550
42550
  lstat,
@@ -43574,6 +43574,27 @@ async function withLoginLock(path, named, work, options = {}) {
43574
43574
  await removeOwn(lock, mine, locked);
43575
43575
  return answer;
43576
43576
  }
43577
+ function loginLockHeldBy(path, pid) {
43578
+ let fd;
43579
+ try {
43580
+ fd = openSync2(`${path}.lock`, LOCK_READ);
43581
+ } catch {
43582
+ return false;
43583
+ }
43584
+ try {
43585
+ if (!fstatSync(fd).isFile())
43586
+ return false;
43587
+ const bytes = Buffer.alloc(DEVICE_LOGIN_MOST_BYTES);
43588
+ const read = readSync(fd, bytes, 0, bytes.length, 0);
43589
+ return bytes.toString("utf8", 0, read).startsWith(`${pid} `);
43590
+ } catch {
43591
+ return false;
43592
+ } finally {
43593
+ try {
43594
+ closeSync2(fd);
43595
+ } catch {}
43596
+ }
43597
+ }
43577
43598
  function namedWithUuid(name, prefix) {
43578
43599
  return name.startsWith(prefix) && /^[0-9a-f-]{36}$/.test(name.slice(prefix.length));
43579
43600
  }
@@ -43591,7 +43612,6 @@ async function removeLeftLocks(path) {
43591
43612
  const name = basename(path);
43592
43613
  await removeUntouched(dirname2(path), (one) => namedWithUuid(one, `${name}.lock.stale-`) || namedWithUuid(one, `${name}.lock.steal.stale-`));
43593
43614
  }
43594
-
43595
43615
  // ../cipher-client/src/device-login-file.ts
43596
43616
  var DEVICE_LOGIN_FILE_VAR = "AGENT_SECRETS_DEVICE_LOGIN_FILE";
43597
43617
  var DEVICE_LOGIN_FILE_NAMED = `the device login ${DEVICE_LOGIN_FILE_VAR} names (default ~/.config/legion/device-login.json)`;
@@ -46508,13 +46528,13 @@ function writeAtomically(path, text) {
46508
46528
  import { createHash as createHash3 } from "crypto";
46509
46529
  import {
46510
46530
  appendFileSync as appendFileSync2,
46511
- closeSync as closeSync3,
46512
- fstatSync,
46531
+ closeSync as closeSync4,
46532
+ fstatSync as fstatSync2,
46513
46533
  mkdirSync as mkdirSync3,
46514
- openSync as openSync3,
46534
+ openSync as openSync4,
46515
46535
  readdirSync as readdirSync2,
46516
46536
  readFileSync as readFileSync5,
46517
- readSync,
46537
+ readSync as readSync2,
46518
46538
  rmSync as rmSync4,
46519
46539
  statSync as statSync3,
46520
46540
  writeFileSync as writeFileSync3
@@ -46524,10 +46544,10 @@ import { join as join8 } from "path";
46524
46544
  // ../envoy-client/src/askgate-marker.ts
46525
46545
  import { createHash as createHash2, randomBytes } from "crypto";
46526
46546
  import {
46527
- closeSync as closeSync2,
46547
+ closeSync as closeSync3,
46528
46548
  constants as constants3,
46529
46549
  mkdirSync,
46530
- openSync as openSync2,
46550
+ openSync as openSync3,
46531
46551
  readdirSync,
46532
46552
  readFileSync as readFileSync3,
46533
46553
  readlinkSync as readlinkSync2,
@@ -46770,11 +46790,11 @@ var isFileDigest = (value) => typeof value === "object" && value !== null && typ
46770
46790
  function readMarker(file) {
46771
46791
  let text;
46772
46792
  try {
46773
- const fd = openSync2(file, constants3.O_RDONLY | constants3.O_NOFOLLOW);
46793
+ const fd = openSync3(file, constants3.O_RDONLY | constants3.O_NOFOLLOW);
46774
46794
  try {
46775
46795
  text = readFileSync3(fd, "utf-8");
46776
46796
  } finally {
46777
- closeSync2(fd);
46797
+ closeSync3(fd);
46778
46798
  }
46779
46799
  } catch {
46780
46800
  return;
@@ -62256,7 +62276,7 @@ var import_nats5 = __toESM(require_mod4(), 1);
62256
62276
 
62257
62277
  // package.json
62258
62278
  var name2 = "@sjawhar/claude-envoy";
62259
- var version2 = "5.16.6";
62279
+ var version2 = "5.16.8";
62260
62280
  var legion = {
62261
62281
  daemonApiVersion: 220
62262
62282
  };