@agentvault/claude-bridge 0.5.1 → 0.5.3

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/dist/index.js CHANGED
@@ -235,6 +235,7 @@ var init_launchd = __esm({
235
235
  this.deps.writeFile(path2, renderLaunchdPlist(spec));
236
236
  const svc = `${this.domain()}/${spec.label}`;
237
237
  this.deps.exec("launchctl", ["bootout", svc]);
238
+ this.waitUntilGone(svc);
238
239
  let r7 = this.deps.exec("launchctl", ["bootstrap", this.domain(), path2]);
239
240
  for (let i2 = 0; i2 < 5 && r7.code !== 0; i2++) {
240
241
  this.deps.exec("sleep", ["0.3"]);
@@ -242,6 +243,14 @@ var init_launchd = __esm({
242
243
  }
243
244
  this.deps.exec("launchctl", ["kickstart", "-k", svc]);
244
245
  }
246
+ // Poll `launchctl print` until the label is unloaded (non-zero), bounded to
247
+ // ~5s. Returns immediately when nothing is loaded (fresh install).
248
+ waitUntilGone(svc) {
249
+ for (let i2 = 0; i2 < 20; i2++) {
250
+ if (this.deps.exec("launchctl", ["print", svc]).code !== 0) return;
251
+ this.deps.exec("sleep", ["0.25"]);
252
+ }
253
+ }
245
254
  uninstall(label) {
246
255
  this.deps.exec("launchctl", ["bootout", `${this.domain()}/${label}`]);
247
256
  const path2 = this.plistPath(label);
@@ -323,7 +332,7 @@ var init_systemd = __esm({
323
332
  });
324
333
 
325
334
  // src/service/backend.ts
326
- import { execFileSync } from "node:child_process";
335
+ import { spawnSync } from "node:child_process";
327
336
  import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync2, rmSync as rmSync3, existsSync as existsSync4, chmodSync } from "node:fs";
328
337
  import { userInfo } from "node:os";
329
338
  function defaultDeps() {
@@ -332,13 +341,8 @@ function defaultDeps() {
332
341
  uid: userInfo().uid,
333
342
  user: userInfo().username,
334
343
  exec: (cmd, args) => {
335
- try {
336
- const stdout = execFileSync(cmd, args, { encoding: "utf8" });
337
- return { code: 0, stdout };
338
- } catch (e7) {
339
- const err = e7;
340
- return { code: err.status ?? 1, stdout: String(err.stdout ?? "") };
341
- }
344
+ const r7 = spawnSync(cmd, args, { encoding: "utf8" });
345
+ return { code: r7.status ?? 1, stdout: r7.stdout ?? "" };
342
346
  },
343
347
  writeFile: (p2, d10) => writeFileSync2(p2, d10),
344
348
  mkdir: (p2) => mkdirSync3(p2, { recursive: true }),
@@ -132766,7 +132770,7 @@ async function main() {
132766
132770
  "[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
132767
132771
  );
132768
132772
  }
132769
- console.error(`[bridge] version: ${true ? "0.5.1" : "dev"}`);
132773
+ console.error(`[bridge] version: ${true ? "0.5.3" : "dev"}`);
132770
132774
  console.error(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
132771
132775
  if (cfg.worker) {
132772
132776
  console.error(`[bridge] WORKER MODE \u2014 workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
@@ -8,6 +8,7 @@ export declare class LaunchdBackend implements ServiceBackend {
8
8
  private plistPath;
9
9
  private domain;
10
10
  install(spec: ServiceSpec): void;
11
+ private waitUntilGone;
11
12
  uninstall(label: string): void;
12
13
  status(label: string): {
13
14
  loaded: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"launchd.d.ts","sourceRoot":"","sources":["../../src/service/launchd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAUhE,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAkC5D;AAED,qBAAa,cAAe,YAAW,cAAc;IACvC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC,OAAO,CAAC,SAAS;IAGjB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAsBhC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAI3D"}
1
+ {"version":3,"file":"launchd.d.ts","sourceRoot":"","sources":["../../src/service/launchd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAUhE,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAkC5D;AAED,qBAAa,cAAe,YAAW,cAAc;IACvC,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,WAAW;IAErC,OAAO,CAAC,SAAS;IAGjB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA2BhC,OAAO,CAAC,aAAa;IAOrB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM9B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;CAI3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/claude-bridge",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "description": "AgentVault Claude Bridge — daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
6
6
  "main": "dist/index.js",