codexuse-cli 5.2.6 → 5.2.7

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
@@ -15450,7 +15450,7 @@ async function resolveInstanceRuntimeState(args) {
15450
15450
  args.rows
15451
15451
  );
15452
15452
  return {
15453
- running: appServerPid2 !== null,
15453
+ running: false,
15454
15454
  appServerPid: appServerPid2,
15455
15455
  startedAt: null
15456
15456
  };
@@ -15462,7 +15462,7 @@ async function resolveInstanceRuntimeState(args) {
15462
15462
  args.rows
15463
15463
  );
15464
15464
  return {
15465
- running: appServerPid2 !== null,
15465
+ running: false,
15466
15466
  appServerPid: appServerPid2,
15467
15467
  startedAt: null
15468
15468
  };
@@ -15594,35 +15594,6 @@ async function collectCodexAppCandidates(rawPaths) {
15594
15594
  }
15595
15595
  return candidates.sort((a, b) => a.appPath.localeCompare(b.appPath));
15596
15596
  }
15597
- function addCodexAppPathsFromDirectory(rawPaths, rootPath, maxDepth = 2) {
15598
- if (!(0, import_node_fs7.existsSync)(rootPath)) {
15599
- return;
15600
- }
15601
- const pending = [{ directory: rootPath, depth: 0 }];
15602
- while (pending.length > 0) {
15603
- const current = pending.shift();
15604
- let entries;
15605
- try {
15606
- entries = (0, import_node_fs7.readdirSync)(current.directory, { withFileTypes: true });
15607
- } catch {
15608
- continue;
15609
- }
15610
- for (const entry of entries) {
15611
- if (!entry.isDirectory()) {
15612
- continue;
15613
- }
15614
- const childPath = import_node_path13.default.join(current.directory, entry.name);
15615
- if (entry.name === "Codex.app") {
15616
- rawPaths.add(childPath);
15617
- continue;
15618
- }
15619
- if (entry.name.endsWith(".app") || current.depth >= maxDepth) {
15620
- continue;
15621
- }
15622
- pending.push({ directory: childPath, depth: current.depth + 1 });
15623
- }
15624
- }
15625
- }
15626
15597
  async function discoverCodexAppCandidates() {
15627
15598
  const now = Date.now();
15628
15599
  const envPath = process.env.CODEXUSE_OFFICIAL_CODEX_APP_PATH?.trim() || null;
@@ -15635,8 +15606,6 @@ async function discoverCodexAppCandidates() {
15635
15606
  }
15636
15607
  rawPaths.add("/Applications/Codex.app");
15637
15608
  rawPaths.add(import_node_path13.default.join((0, import_node_os4.homedir)(), "Applications", "Codex.app"));
15638
- addCodexAppPathsFromDirectory(rawPaths, "/Applications");
15639
- addCodexAppPathsFromDirectory(rawPaths, import_node_path13.default.join((0, import_node_os4.homedir)(), "Applications"));
15640
15609
  const sorted = await collectCodexAppCandidates(rawPaths);
15641
15610
  appDiscoveryCache = {
15642
15611
  envPath,
@@ -15986,6 +15955,10 @@ async function launchOfficialCodexProfileInstanceOnce(options) {
15986
15955
  reason: null
15987
15956
  };
15988
15957
  }
15958
+ if (runtime.appServerPid !== null) {
15959
+ await stopProcessTree(runtime.appServerPid, rows);
15960
+ launchBaselineMainPids = (await readProcessRows()).filter((row) => isMainProcessRow(row, candidate)).map((row) => row.pid);
15961
+ }
15989
15962
  }
15990
15963
  let cdpPort;
15991
15964
  try {
@@ -17345,9 +17318,11 @@ function formatErrorResponse(raw, status) {
17345
17318
  }
17346
17319
  }
17347
17320
  } catch {
17348
- return trimmed;
17349
17321
  }
17350
- return trimmed;
17322
+ if (trimmed.startsWith("<")) {
17323
+ return `Cloud sync request failed (${status}).`;
17324
+ }
17325
+ return trimmed.length > 500 ? `${trimmed.slice(0, 500)}...` : trimmed;
17351
17326
  }
17352
17327
  return `Cloud sync request failed (${status}).`;
17353
17328
  }
@@ -18227,7 +18202,7 @@ async function ensureCliStorageReady() {
18227
18202
  }
18228
18203
 
18229
18204
  // src/app/main.ts
18230
- var VERSION = true ? "5.2.6" : "0.0.0";
18205
+ var VERSION = true ? "5.2.7" : "0.0.0";
18231
18206
  async function runCli() {
18232
18207
  const args = process.argv.slice(2);
18233
18208
  if (args.length === 0) {