@nk070281sjv/cli 2.3.8 → 2.3.10

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.
Files changed (2) hide show
  1. package/dist/index.js +59 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -30779,7 +30779,7 @@ ${hint}
30779
30779
  }
30780
30780
 
30781
30781
  // src/lib/version.ts
30782
- var CLI_VERSION = true ? "2.3.8" : createRequire(import.meta.url)("../../package.json").version;
30782
+ var CLI_VERSION = true ? "2.3.10" : createRequire(import.meta.url)("../../package.json").version;
30783
30783
 
30784
30784
  // src/lib/deps.ts
30785
30785
  init_src();
@@ -38646,7 +38646,9 @@ var runAgentsSubcommand = new Command("run-agents").description("Run OCR review
38646
38646
  console.log(`Progress: ocr review watch --session-id ${sessionId}`);
38647
38647
  console.log(`Status: ocr review status --session-id ${sessionId}`);
38648
38648
  console.log(`Artifacts: ${sessionDir}`);
38649
- return;
38649
+ console.log("Monitoring background review until it finishes. If OpenCode stops waiting, the background review continues.");
38650
+ const exitCode = await waitForDetachedRun(sessionDir, round);
38651
+ process.exit(exitCode);
38650
38652
  }
38651
38653
  writeRunMeta(sessionDir, round, {
38652
38654
  status: "running",
@@ -38887,6 +38889,61 @@ function renderRunAgentsProgress(event) {
38887
38889
  console.error(source_default.green("OCR pipeline complete."));
38888
38890
  }
38889
38891
  }
38892
+ async function waitForDetachedRun(sessionDir, round) {
38893
+ let lastLine2 = "";
38894
+ while (true) {
38895
+ const snapshot = readDetachedSnapshot(sessionDir, round);
38896
+ const line = formatDetachedProgress(snapshot);
38897
+ if (line !== lastLine2) {
38898
+ console.log(line);
38899
+ lastLine2 = line;
38900
+ }
38901
+ if (snapshot.status === "completed") {
38902
+ console.log(source_default.green(`OCR review complete: ${join28(sessionDir, "rounds", `round-${round}`, "final.md")}`));
38903
+ return 0;
38904
+ }
38905
+ if (snapshot.status === "failed") {
38906
+ console.error(source_default.red("OCR review failed. Inspect worker stderr and failure-summary.json if present."));
38907
+ return 1;
38908
+ }
38909
+ if (snapshot.pid && !snapshot.live && snapshot.status !== "completed") {
38910
+ console.error(source_default.red("OCR background worker is not running and did not mark the review complete."));
38911
+ return 1;
38912
+ }
38913
+ await new Promise((resolve4) => setTimeout(resolve4, 15e3));
38914
+ }
38915
+ }
38916
+ function readDetachedSnapshot(sessionDir, round) {
38917
+ const roundDir = join28(sessionDir, "rounds", `round-${round}`);
38918
+ const runMeta = readJson(join28(roundDir, "run-meta.json"));
38919
+ const processLogsDir = join28(roundDir, "process-logs");
38920
+ const metas = existsSync23(processLogsDir) ? readdirMetaFiles(processLogsDir).map((path2) => readJson(path2)).filter(isRecord3) : [];
38921
+ const reviewers = metas.filter((meta) => meta.phase === "reviews");
38922
+ const pid = typeof runMeta?.pid === "number" ? runMeta.pid : void 0;
38923
+ return {
38924
+ status: String(runMeta?.status ?? "unknown"),
38925
+ pid,
38926
+ live: pid ? isPidLive(pid) : void 0,
38927
+ completedReviews: reviewers.filter((meta) => meta.status === "completed").length,
38928
+ totalReviews: reviewers.length,
38929
+ runningReviews: reviewers.filter((meta) => meta.status === "running").map((meta) => String(meta.id)).sort(),
38930
+ pipeline: Object.fromEntries(
38931
+ ["aggregation", "validation", "synthesis"].map((phase) => [
38932
+ phase,
38933
+ String(metas.find((meta) => meta.id === phase)?.status ?? "pending")
38934
+ ])
38935
+ )
38936
+ };
38937
+ }
38938
+ function formatDetachedProgress(snapshot) {
38939
+ const running = snapshot.runningReviews.length > 0 ? snapshot.runningReviews.join(", ") : "none";
38940
+ return [
38941
+ `OCR background status: ${snapshot.status}${snapshot.pid ? ` pid=${snapshot.pid} live=${snapshot.live ? "yes" : "no"}` : ""}`,
38942
+ `reviews ${snapshot.completedReviews}/${snapshot.totalReviews || "?"} complete`,
38943
+ `running: ${running}`,
38944
+ `pipeline: aggregation=${snapshot.pipeline.aggregation}, validation=${snapshot.pipeline.validation}, synthesis=${snapshot.pipeline.synthesis}`
38945
+ ].join(" | ");
38946
+ }
38890
38947
  var CONTROL_PROMPT = "Resume this OCR review: run `ocr state status --json` and act on `next_action`, continuing forward from `current_phase` without redoing completed phases.";
38891
38948
  var reviewCommand = new Command("review").description("Run or resume an OCR review").option("--resume <workflow-id>", "Resume a prior review by its workflow session id").action(async (options) => {
38892
38949
  if (!options.resume) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nk070281sjv/cli",
3
- "version": "2.3.8",
3
+ "version": "2.3.10",
4
4
  "description": "CLI for Open Code Review - Multi-environment setup and progress tracking",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@inquirer/prompts": "^7.2.0",
40
- "@nk070281sjv/agents": "2.3.8",
40
+ "@nk070281sjv/agents": "2.3.10",
41
41
  "chalk": "^5.4.1",
42
42
  "chokidar": "^4.0.3",
43
43
  "commander": "^13.0.0",