usebeeline 0.1.14 → 0.1.16

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.
@@ -30907,7 +30907,7 @@ var AcpClient = class extends EventEmitter {
30907
30907
 
30908
30908
  // apps/body/dist/agent-home.js
30909
30909
  var import_yaml2 = __toESM(require_dist(), 1);
30910
- import { existsSync as existsSync7, readFileSync as readFileSync5 } from "node:fs";
30910
+ import { existsSync as existsSync7, readFileSync as readFileSync5, watch } from "node:fs";
30911
30911
 
30912
30912
  // node_modules/smol-toml/dist/date.js
30913
30913
  var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
@@ -34309,6 +34309,32 @@ async function writeBackRoomClaudeLogin(input) {
34309
34309
  return;
34310
34310
  await writeBackDetachedClaudeLogin(target, source);
34311
34311
  }
34312
+ function watchRoomClaudeLogin(input) {
34313
+ const claude = SHARED_CREDENTIALS.find((credential) => credential.dir === "claude");
34314
+ if (!existsSync7(resolve16(input.operatorHome ?? homedir11(), claude.source)))
34315
+ return void 0;
34316
+ const dir = resolve16(input.root, claude.dir);
34317
+ let pass = Promise.resolve();
34318
+ let watcher;
34319
+ try {
34320
+ watcher = watch(dir, (_event, filename) => {
34321
+ if (filename !== claude.target)
34322
+ return;
34323
+ pass = pass.then(() => writeBackRoomClaudeLogin(input)).catch((error) => {
34324
+ console.error(`[body] could not write back a refreshed Claude login under ${dir}:`, error);
34325
+ });
34326
+ });
34327
+ } catch (error) {
34328
+ console.error(`[body] could not watch the Claude login under ${dir}:`, error);
34329
+ return void 0;
34330
+ }
34331
+ watcher.on("error", (error) => {
34332
+ console.error(`[body] stopped watching the Claude login under ${dir}:`, error);
34333
+ watcher.close();
34334
+ });
34335
+ watcher.unref();
34336
+ return watcher;
34337
+ }
34312
34338
  async function prepareRoomAgentHome(input) {
34313
34339
  const root = resolve16(input.root);
34314
34340
  const operatorHome = input.operatorHome ?? homedir11();
@@ -42437,6 +42463,7 @@ var MonolithRoomTurnLoop = class {
42437
42463
  this.wakeIntake = void 0;
42438
42464
  }
42439
42465
  client;
42466
+ claudeLoginWatch;
42440
42467
  sessionId;
42441
42468
  sessionCwd;
42442
42469
  sessionCommit;
@@ -42658,8 +42685,26 @@ var MonolithRoomTurnLoop = class {
42658
42685
  ...promptBytes ? { promptBytes } : {}
42659
42686
  };
42660
42687
  }
42688
+ /**
42689
+ * Watch this client's Claude login so a refresh made while the
42690
+ * Room is idle reaches other Rooms at once (see `watchRoomClaudeLogin`).
42691
+ */
42692
+ watchClaudeLogin() {
42693
+ this.stopClaudeLoginWatch();
42694
+ if (this.options.config.agentKind !== "claude" || !this.options.config.agentHomeRoot)
42695
+ return;
42696
+ this.claudeLoginWatch = watchRoomClaudeLogin({
42697
+ root: this.options.config.agentHomeRoot,
42698
+ operatorHome: this.options.config.operatorHome
42699
+ });
42700
+ }
42701
+ stopClaudeLoginWatch() {
42702
+ this.claudeLoginWatch?.close();
42703
+ this.claudeLoginWatch = void 0;
42704
+ }
42661
42705
  async discardSession() {
42662
42706
  const client = this.client;
42707
+ this.stopClaudeLoginWatch();
42663
42708
  this.client = void 0;
42664
42709
  this.sessionId = void 0;
42665
42710
  this.sessionCwd = void 0;
@@ -42967,6 +43012,7 @@ var MonolithRoomTurnLoop = class {
42967
43012
  };
42968
43013
  this.client = (this.options.createAcpClient ?? ((value) => new AcpClient(value)))(clientOptions);
42969
43014
  await this.client.start();
43015
+ this.watchClaudeLogin();
42970
43016
  const persona = configuration.soul ?? self?.soul;
42971
43017
  const repositoryInfo = repositoryState.resolution === "repository" && repositoryState.key ? {
42972
43018
  name: repositoryState.key,
@@ -43082,6 +43128,7 @@ var MonolithRoomTurnLoop = class {
43082
43128
  return void 0;
43083
43129
  trace?.retry({ provider: next, ...reason ? { reason } : {} });
43084
43130
  const client = this.client;
43131
+ this.stopClaudeLoginWatch();
43085
43132
  this.client = void 0;
43086
43133
  this.sessionId = void 0;
43087
43134
  this.sessionFingerprint = void 0;
@@ -44547,6 +44594,7 @@ var MonolithCornerTurnLoop = class {
44547
44594
  this.wakeIntake?.();
44548
44595
  }
44549
44596
  client;
44597
+ claudeLoginWatch;
44550
44598
  sessionId;
44551
44599
  /** The configuration the live session baked in; a change invalidates it. */
44552
44600
  sessionFingerprint;
@@ -44739,8 +44787,26 @@ var MonolithCornerTurnLoop = class {
44739
44787
  ...promptBytes ? { promptBytes } : {}
44740
44788
  };
44741
44789
  }
44790
+ /**
44791
+ * Watch this client's Claude login so a refresh made while the
44792
+ * corner is idle reaches other Rooms at once (see `watchRoomClaudeLogin`).
44793
+ */
44794
+ watchClaudeLogin() {
44795
+ this.stopClaudeLoginWatch();
44796
+ if (this.options.config.agentKind !== "claude" || !this.options.config.agentHomeRoot)
44797
+ return;
44798
+ this.claudeLoginWatch = watchRoomClaudeLogin({
44799
+ root: this.options.config.agentHomeRoot,
44800
+ operatorHome: this.options.config.operatorHome
44801
+ });
44802
+ }
44803
+ stopClaudeLoginWatch() {
44804
+ this.claudeLoginWatch?.close();
44805
+ this.claudeLoginWatch = void 0;
44806
+ }
44742
44807
  async discardSession() {
44743
44808
  const client = this.client;
44809
+ this.stopClaudeLoginWatch();
44744
44810
  this.client = void 0;
44745
44811
  this.sessionId = void 0;
44746
44812
  this.sessionFingerprint = void 0;
@@ -45022,6 +45088,7 @@ var MonolithCornerTurnLoop = class {
45022
45088
  };
45023
45089
  this.client = (this.options.createAcpClient ?? ((value) => new AcpClient(value)))(clientOptions);
45024
45090
  await this.client.start();
45091
+ this.watchClaudeLogin();
45025
45092
  const codegraphReady = await prepareCodegraphIndex(this.options.config, this.options.worktreePath);
45026
45093
  const fingerprint = sessionConfigFingerprint({
45027
45094
  devices: grantedDevices,
@@ -45263,6 +45330,7 @@ var MonolithCornerTurnLoop = class {
45263
45330
  return void 0;
45264
45331
  trace?.retry({ provider: next, ...reason ? { reason } : {} });
45265
45332
  const client = this.client;
45333
+ this.stopClaudeLoginWatch();
45266
45334
  this.client = void 0;
45267
45335
  this.sessionId = void 0;
45268
45336
  this.sessionFingerprint = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usebeeline",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Connect an AI coding agent to Beeline with one command.",
5
5
  "homepage": "https://usebeeline.app",
6
6
  "bugs": {