@liberseek/boft-cli-linux-x64 0.8.0 → 0.8.1

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/README.md CHANGED
@@ -7,7 +7,7 @@ BOFT CLI runs Pi and other external harnesses inside Codex Desktop.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install -g @liberseek/boft-cli@0.8.0
10
+ npm install -g @liberseek/boft-cli@0.8.1
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@liberseek/boft-cli`.
@@ -12,7 +12,7 @@ License text: licenses/Cosmokit-LICENSE.txt
12
12
  License: Apache-2.0
13
13
  License text: licenses/Agent-Client-Protocol-SDK-LICENSE.txt
14
14
 
15
- @anthropic-ai/claude-agent-sdk 0.3.220
15
+ @anthropic-ai/claude-agent-sdk 0.3.273
16
16
  License: SEE LICENSE IN README.md
17
17
  License text: licenses/Claude-Agent-SDK-LICENSE.md
18
18
 
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.8.0","distribution":"npm","target":"linux-x64"}
1
+ {"schemaVersion":1,"version":"0.8.1","distribution":"npm","target":"linux-x64"}
@@ -136,7 +136,7 @@ async function readRuntimeMetadata(entryPath2, environment = process.env) {
136
136
  }
137
137
 
138
138
  // packages/update-manager/dist/github-release.js
139
- var CODEXHOST_LATEST_RELEASE_URL = "https://api.github.com/repos/LiberSeek/BOFT-CLI/releases/latest";
139
+ var CODEXHOST_LATEST_RELEASE_URL = "https://api.github.com/repos/LIBERSEEK/BOFT-CLI/releases/latest";
140
140
  var SHA256_DIGEST_PATTERN = /^sha256:([0-9a-f]{64})$/u;
141
141
  var RELEASE_NOTES_URL_PATTERN = /^https:\/\/github\.com\/(LiberSeek|LIBERSEEK)\/BOFT-CLI\/releases\/tag\/(v[0-9A-Za-z.+-]+)$/u;
142
142
  var DOWNLOAD_URL_PREFIXES = [
@@ -274,7 +274,7 @@ function selectInstallerReleaseArtifact(release, target) {
274
274
  // packages/update-manager/dist/github-cli-release.js
275
275
  import { execFile } from "node:child_process";
276
276
  import path3 from "node:path";
277
- var GITHUB_LATEST_RELEASE_ENDPOINT = "repos/BytePioneer-AI/codex-host/releases/latest";
277
+ var GITHUB_LATEST_RELEASE_ENDPOINT = "repos/LIBERSEEK/BOFT-CLI/releases/latest";
278
278
  var MAX_RELEASE_RESPONSE_BYTES = 1024 * 1024;
279
279
  var GITHUB_CLI_TIMEOUT_MS = 5e3;
280
280
  function defaultExecutableCandidates(environment, platform) {
@@ -363,39 +363,25 @@ async function regularFile(filePath) {
363
363
  throw error51;
364
364
  }
365
365
  }
366
- async function isUpdateOperationActive(stateDirectory) {
366
+ async function discoverActiveUpdateStatus(stateDirectory) {
367
367
  if (!path4.isAbsolute(stateDirectory))
368
368
  throw new Error("update state directory must be absolute");
369
- return regularFile(path4.join(stateDirectory, LOCK_FILE));
370
- }
371
- async function discoverLatestUpdateStatus(stateDirectory) {
372
- if (!path4.isAbsolute(stateDirectory))
373
- throw new Error("update state directory must be absolute");
374
- let entries;
369
+ const lockPath = path4.join(stateDirectory, LOCK_FILE);
370
+ if (!await regularFile(lockPath))
371
+ return null;
375
372
  try {
376
- entries = await readdir(stateDirectory, { withFileTypes: true });
377
- } catch (error51) {
378
- if (error51.code === "ENOENT")
373
+ const lock = JSON.parse(await readFile2(lockPath, "utf8"));
374
+ if (typeof lock.statusPath !== "string" || !path4.isAbsolute(lock.statusPath))
379
375
  return null;
380
- throw error51;
381
- }
382
- const candidates = [];
383
- for (const entry of entries) {
384
- if (!entry.isDirectory() || entry.isSymbolicLink() || !entry.name.startsWith("update-"))
385
- continue;
386
- const statusPath = path4.join(stateDirectory, entry.name, STATUS_FILE);
387
- if (!await regularFile(statusPath))
388
- continue;
389
- try {
390
- candidates.push({
391
- statusPath,
392
- status: parseUpdateStatus(JSON.parse(await readFile2(statusPath, "utf8")))
393
- });
394
- } catch {
395
- }
376
+ if (!await regularFile(lock.statusPath))
377
+ return null;
378
+ const status = parseUpdateStatus(JSON.parse(await readFile2(lock.statusPath, "utf8")));
379
+ if (TERMINAL_PHASES.has(status.phase))
380
+ return null;
381
+ return { statusPath: lock.statusPath, status };
382
+ } catch {
383
+ return null;
396
384
  }
397
- candidates.sort((left, right) => right.status.updatedAt - left.status.updatedAt);
398
- return candidates[0] ?? null;
399
385
  }
400
386
  async function cleanupTerminalUpdateState(stateDirectory, options = {}) {
401
387
  const now = Math.floor((options.now ?? Date.now()) / 1e3);
@@ -593,6 +579,48 @@ async function verifyDownloadedArtifact(source, filePath, result) {
593
579
  }
594
580
  }
595
581
 
582
+ // packages/update-manager/dist/updater-ready.js
583
+ import { setTimeout as delay } from "node:timers/promises";
584
+ async function waitForUpdaterReady(child, readStatus, timeoutMs = 1e4) {
585
+ let failure;
586
+ const onError = (error51) => {
587
+ failure = error51;
588
+ };
589
+ const onExit = () => {
590
+ failure = new Error("Background Updater exited before completing handoff");
591
+ };
592
+ child.on("error", onError);
593
+ child.on("exit", onExit);
594
+ const deadline = performance.now() + timeoutMs;
595
+ try {
596
+ while (true) {
597
+ const status = await readStatus();
598
+ if (status?.phase === "failed")
599
+ throw new Error(status.error ?? "Background Updater failed");
600
+ if (failure)
601
+ throw failure;
602
+ if (child.exitCode != null || child.signalCode != null) {
603
+ throw new Error("Background Updater exited before completing handoff");
604
+ }
605
+ if (status?.phase === "waiting-for-exit")
606
+ return;
607
+ if (status && status.phase !== "prepared") {
608
+ throw new Error(`Unexpected Updater phase during handoff: ${status.phase}`);
609
+ }
610
+ if (performance.now() >= deadline) {
611
+ throw new Error("Background Updater did not confirm handoff before the startup timeout");
612
+ }
613
+ await delay(20);
614
+ }
615
+ } catch (error51) {
616
+ child.kill();
617
+ throw error51;
618
+ } finally {
619
+ child.removeListener("error", onError);
620
+ child.removeListener("exit", onExit);
621
+ }
622
+ }
623
+
596
624
  // packages/update-manager/dist/update-manager.js
597
625
  var REQUEST_SCHEMA_VERSION = 1;
598
626
  var WINDOWS_RENAME_RETRY_DELAYS_MS = [10, 30, 70, 150, 300];
@@ -602,7 +630,7 @@ function errorMessage(error51) {
602
630
  function systemErrorCode(error51) {
603
631
  return typeof error51 === "object" && error51 !== null && "code" in error51 ? String(error51.code) : null;
604
632
  }
605
- function delay(milliseconds) {
633
+ function delay2(milliseconds) {
606
634
  return new Promise((resolve) => setTimeout(resolve, milliseconds));
607
635
  }
608
636
  async function replaceStatusFile(temporaryPath, statusPath) {
@@ -618,7 +646,7 @@ async function replaceStatusFile(temporaryPath, statusPath) {
618
646
  throw error51;
619
647
  }
620
648
  retryIndex += 1;
621
- await delay(retryDelay);
649
+ await delay2(retryDelay);
622
650
  }
623
651
  }
624
652
  }
@@ -838,14 +866,20 @@ function createBackgroundUpdateManager(dependencies = {}) {
838
866
  app_path: appPath
839
867
  }, artifact.artifactPath);
840
868
  },
841
- start(prepared) {
869
+ async start(prepared) {
842
870
  if (!preparedRequests.delete(prepared.requestPath)) {
843
871
  throw new Error("background update was not prepared by this manager or was already started");
844
872
  }
845
- const child = spawnUpdater(prepared.helperPath, prepared.requestPath);
846
- if (child.pid === void 0)
847
- throw new Error("background Updater did not report a process ID");
848
- return Object.freeze({ ...prepared, updaterPid: child.pid });
873
+ try {
874
+ const child = spawnUpdater(prepared.helperPath, prepared.requestPath);
875
+ await waitForUpdaterReady(child, () => this.readStatus(prepared.statusPath));
876
+ if (child.pid === void 0)
877
+ throw new Error("background Updater did not report a process ID");
878
+ return Object.freeze({ ...prepared, updaterPid: child.pid });
879
+ } catch (error51) {
880
+ await writeFailedStatus(prepared.statusPath, prepared.version, prepared.installation, error51);
881
+ throw error51;
882
+ }
849
883
  },
850
884
  async readStatus(statusPathValue) {
851
885
  const statusPath = requireAbsolutePath(statusPathValue, "update status path");
@@ -15538,6 +15572,8 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
15538
15572
  harness,
15539
15573
  sessionId: external_exports.string().min(1).max(512),
15540
15574
  project: project.nullable(),
15575
+ /** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
15576
+ title: external_exports.string().min(1).max(200).optional(),
15541
15577
  /** Models the session used, most requests first. */
15542
15578
  models: external_exports.array(model).max(16),
15543
15579
  firstAtMs: count,
@@ -15604,7 +15640,12 @@ var usageStatisticsResultSchema = external_exports.strictObject({
15604
15640
  * The sessions that spent the most, by cost and by tokens without cache, all filters applied;
15605
15641
  * requests without a native session are not listed here but count everywhere else.
15606
15642
  */
15607
- sessions: external_exports.array(usageStatisticsSessionSchema).max(100)
15643
+ sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
15644
+ /**
15645
+ * The sessions last active in the range, newest first, all filters applied. Optional for older
15646
+ * Hosts; missing is treated as no list rather than no sessions.
15647
+ */
15648
+ recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
15608
15649
  });
15609
15650
 
15610
15651
  // packages/shared-contracts/dist/ids.js
@@ -17564,14 +17605,15 @@ function createConsoleUpdates(options) {
17564
17605
  });
17565
17606
  let candidate = null;
17566
17607
  let handedOff = false;
17608
+ let currentStatusPath = null;
17567
17609
  async function latestStatus() {
17568
- const directory = stateDirectory();
17569
- const discovered = await discoverLatestUpdateStatus(directory);
17570
- if (!discovered) return null;
17571
- if (discovered.status.phase !== "succeeded" && discovered.status.phase !== "failed" && !await isUpdateOperationActive(directory)) {
17572
- return null;
17610
+ if (!currentStatusPath) {
17611
+ const active = await discoverActiveUpdateStatus(stateDirectory());
17612
+ if (!active) return null;
17613
+ currentStatusPath = active.statusPath;
17573
17614
  }
17574
- return publicStatus(discovered.status);
17615
+ const status = await manager.readStatus(currentStatusPath);
17616
+ return status ? publicStatus(status) : null;
17575
17617
  }
17576
17618
  function installable(metadata, release) {
17577
17619
  const kind = installationKind(metadata);
@@ -17698,6 +17740,7 @@ function createConsoleUpdates(options) {
17698
17740
  if (existing) return { status: existing };
17699
17741
  throw new ConsoleUpdateError("busy", "Another update operation is already active");
17700
17742
  }
17743
+ currentStatusPath = null;
17701
17744
  try {
17702
17745
  const release = await fetchLatest();
17703
17746
  if (compareSemanticVersions(metadata.version, release.version) >= 0 || candidate && candidate.version !== release.version) {
@@ -17716,9 +17759,10 @@ function createConsoleUpdates(options) {
17716
17759
  try {
17717
17760
  const prepared = await prepare(metadata, target, release, async (info) => {
17718
17761
  await lock.setStatusPath(info.statusPath);
17762
+ currentStatusPath = info.statusPath;
17719
17763
  resolvePrepared(info.statusPath);
17720
17764
  });
17721
- manager.start(prepared);
17765
+ await manager.start(prepared);
17722
17766
  handedOff = true;
17723
17767
  options.onHandedOff();
17724
17768
  } catch (error51) {
@@ -17751,7 +17795,7 @@ function createConsoleUpdates(options) {
17751
17795
 
17752
17796
  // packages/console-server/src/server.ts
17753
17797
  var CONSOLE_SERVICE = "codexhost-console";
17754
- var ISSUE_LIST_URL = "https://github.com/LiberSeek/BOFT-CLI/issues";
17798
+ var ISSUE_LIST_URL = "https://github.com/LIBERSEEK/BOFT-CLI/issues";
17755
17799
  var MAX_BODY_BYTES = 16 * 1024;
17756
17800
  var INSPECT_CACHE_MS = 2e3;
17757
17801
  var SECURITY_HEADERS = {
@@ -18225,7 +18269,7 @@ async function runUpdateCommand(target, updates, write = console.log) {
18225
18269
  const { status } = await updates.start(target);
18226
18270
  if (status.phase === "failed") throw new Error(status.error ?? "Update failed");
18227
18271
  write(
18228
- `Update ${status.version}: ${status.phase}. The background updater will finish installation and restart BOFT.`
18272
+ `Update ${status.version}: ${status.phase}. The background updater has accepted the handoff; installation is not complete yet. It will install the update and restart BOFT CLI.`
18229
18273
  );
18230
18274
  }
18231
18275
  async function updateFromCommand(appDirectory2, arguments_) {