@open-code-review/cli 1.7.0 → 1.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/dist/dashboard/server.js +20 -25
- package/dist/index.js +32 -3
- package/package.json +2 -2
package/dist/dashboard/server.js
CHANGED
|
@@ -25112,18 +25112,16 @@ var AiCliService = class {
|
|
|
25112
25112
|
active: this.activeAdapter?.binary ?? null,
|
|
25113
25113
|
preferred: this.preference
|
|
25114
25114
|
};
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
console.log(` AI CLI: ${adapter.name} v${detection.version ?? "?"} detected`);
|
|
25119
|
-
}
|
|
25115
|
+
const detected = this.entries.filter((e) => e.detection.found).map((e) => `${e.adapter.name} v${e.detection.version ?? "?"}`);
|
|
25116
|
+
if (detected.length > 0) {
|
|
25117
|
+
console.log(` AI CLI detected: ${detected.join(", ")}`);
|
|
25120
25118
|
}
|
|
25121
25119
|
if (this.preference === "off") {
|
|
25122
|
-
console.log(" AI CLI
|
|
25120
|
+
console.log(" AI CLI active: off (read-only mode)");
|
|
25123
25121
|
} else if (this.activeAdapter) {
|
|
25124
|
-
console.log(` AI CLI:
|
|
25122
|
+
console.log(` AI CLI active: ${this.activeAdapter.name} (${this.preference})`);
|
|
25125
25123
|
} else {
|
|
25126
|
-
console.log(" AI CLI:
|
|
25124
|
+
console.log(" AI CLI active: none (read-only mode)");
|
|
25127
25125
|
}
|
|
25128
25126
|
}
|
|
25129
25127
|
/** Returns the status object for the /api/config endpoint. */
|
|
@@ -28142,7 +28140,12 @@ function cleanupAllPostGenerations() {
|
|
|
28142
28140
|
}
|
|
28143
28141
|
|
|
28144
28142
|
// src/server/index.ts
|
|
28143
|
+
import { homedir } from "node:os";
|
|
28145
28144
|
var __dirname3 = dirname10(fileURLToPath3(import.meta.url));
|
|
28145
|
+
function shortenPath(p) {
|
|
28146
|
+
const home = homedir();
|
|
28147
|
+
return p.startsWith(home) ? "~" + p.slice(home.length) : p;
|
|
28148
|
+
}
|
|
28146
28149
|
var AUTH_TOKEN = randomBytes(32).toString("hex");
|
|
28147
28150
|
var app = (0, import_express12.default)();
|
|
28148
28151
|
var httpServer = createServer(app);
|
|
@@ -28250,7 +28253,6 @@ async function startServer(options = {}) {
|
|
|
28250
28253
|
process.kill(pid, "SIGTERM");
|
|
28251
28254
|
}
|
|
28252
28255
|
killedCount++;
|
|
28253
|
-
console.log(`Killed orphaned process (PID ${pid})`);
|
|
28254
28256
|
setTimeout(() => {
|
|
28255
28257
|
try {
|
|
28256
28258
|
process.kill(pid, 0);
|
|
@@ -28268,7 +28270,7 @@ async function startServer(options = {}) {
|
|
|
28268
28270
|
}
|
|
28269
28271
|
}
|
|
28270
28272
|
if (killedCount > 0) {
|
|
28271
|
-
console.log(`
|
|
28273
|
+
console.log(` Cleaned up ${killedCount} orphaned process(es)`);
|
|
28272
28274
|
}
|
|
28273
28275
|
}
|
|
28274
28276
|
const staleResult = db.exec(
|
|
@@ -28285,7 +28287,7 @@ async function startServer(options = {}) {
|
|
|
28285
28287
|
WHERE finished_at IS NULL OR exit_code IS NULL`
|
|
28286
28288
|
);
|
|
28287
28289
|
saveDb(db, ocrDir);
|
|
28288
|
-
console.log(`Cleaned up ${staleCount} stale command
|
|
28290
|
+
console.log(` Cleaned up ${staleCount} stale command(s)`);
|
|
28289
28291
|
}
|
|
28290
28292
|
app.get("/api/reviews", (_req, res) => {
|
|
28291
28293
|
try {
|
|
@@ -28329,14 +28331,10 @@ async function startServer(options = {}) {
|
|
|
28329
28331
|
});
|
|
28330
28332
|
}
|
|
28331
28333
|
io.on("connection", (socket) => {
|
|
28332
|
-
console.log("Client connected:", socket.id);
|
|
28333
28334
|
registerSocketHandlers(io, socket);
|
|
28334
28335
|
registerCommandHandlers(io, socket, db, ocrDir, aiCliService);
|
|
28335
28336
|
registerChatHandlers(io, socket, db, ocrDir, aiCliService);
|
|
28336
28337
|
registerPostHandlers(io, socket, db, ocrDir, aiCliService);
|
|
28337
|
-
socket.on("disconnect", () => {
|
|
28338
|
-
console.log("Client disconnected:", socket.id);
|
|
28339
|
-
});
|
|
28340
28338
|
});
|
|
28341
28339
|
const dbFilePath = join13(ocrDir, "data", "ocr.db");
|
|
28342
28340
|
const dbSyncWatcher = new DbSyncWatcher(db, dbFilePath, io, () => {
|
|
@@ -28344,7 +28342,7 @@ async function startServer(options = {}) {
|
|
|
28344
28342
|
});
|
|
28345
28343
|
await dbSyncWatcher.init();
|
|
28346
28344
|
dbSyncWatcher.startWatching();
|
|
28347
|
-
console.log(`Watching DB:
|
|
28345
|
+
console.log(` Watching DB: ${shortenPath(dbFilePath)}`);
|
|
28348
28346
|
registerSaveHooks(
|
|
28349
28347
|
() => dbSyncWatcher.syncFromDisk(),
|
|
28350
28348
|
() => dbSyncWatcher.markOwnWrite()
|
|
@@ -28354,7 +28352,7 @@ async function startServer(options = {}) {
|
|
|
28354
28352
|
await fsSync.fullScan();
|
|
28355
28353
|
saveDb(db, ocrDir);
|
|
28356
28354
|
fsSync.startWatching();
|
|
28357
|
-
console.log(`Watching sessions: ${sessionsDir}`);
|
|
28355
|
+
console.log(` Watching sessions: ${shortenPath(sessionsDir)}`);
|
|
28358
28356
|
const stopReviewersWatch = watchReviewersMeta(ocrDir, io);
|
|
28359
28357
|
await new Promise((resolve3, reject) => {
|
|
28360
28358
|
httpServer.once("error", (err) => {
|
|
@@ -28367,14 +28365,11 @@ async function startServer(options = {}) {
|
|
|
28367
28365
|
}
|
|
28368
28366
|
});
|
|
28369
28367
|
httpServer.listen(port, "127.0.0.1", () => {
|
|
28370
|
-
console.log(`
|
|
28371
|
-
console.log(`OCR directory:
|
|
28372
|
-
console.log(
|
|
28373
|
-
console.log(
|
|
28374
|
-
console.log(
|
|
28375
|
-
console.log(` ${AUTH_TOKEN.slice(0, 8)}...[redacted]`);
|
|
28376
|
-
console.log("=".repeat(60));
|
|
28377
|
-
console.log("");
|
|
28368
|
+
console.log(` Server: http://localhost:${port}`);
|
|
28369
|
+
console.log(` OCR directory: ${shortenPath(ocrDir)}`);
|
|
28370
|
+
console.log();
|
|
28371
|
+
console.log(` Auth token: ${AUTH_TOKEN.slice(0, 8)}...[redacted]`);
|
|
28372
|
+
console.log();
|
|
28378
28373
|
resolve3();
|
|
28379
28374
|
});
|
|
28380
28375
|
});
|
package/dist/index.js
CHANGED
|
@@ -20755,6 +20755,28 @@ function setConfiguredToolIds(targetDir, toolIds) {
|
|
|
20755
20755
|
configuredTools: toolIds
|
|
20756
20756
|
});
|
|
20757
20757
|
}
|
|
20758
|
+
function stampCliVersion(targetDir, version) {
|
|
20759
|
+
const existing = loadCliConfig(targetDir) ?? { configuredTools: [] };
|
|
20760
|
+
return saveCliConfig(targetDir, { ...existing, cliVersion: version });
|
|
20761
|
+
}
|
|
20762
|
+
function checkLocalArtifactVersion(targetDir, runningVersion) {
|
|
20763
|
+
const config = loadCliConfig(targetDir);
|
|
20764
|
+
if (!config?.cliVersion) return null;
|
|
20765
|
+
if (config.cliVersion === runningVersion) return null;
|
|
20766
|
+
return { storedVersion: config.cliVersion, runningVersion };
|
|
20767
|
+
}
|
|
20768
|
+
function printLocalVersionHint(drift) {
|
|
20769
|
+
const msg = source_default.yellow(" Local .ocr/ files were installed with ") + source_default.dim(`v${drift.storedVersion}`) + source_default.yellow(" but you're running ") + source_default.green(`v${drift.runningVersion}`) + source_default.yellow(".");
|
|
20770
|
+
const hint = source_default.dim(" Run ") + source_default.bold("ocr update") + source_default.dim(" to refresh local assets.");
|
|
20771
|
+
process.stderr.write(`
|
|
20772
|
+
${msg}
|
|
20773
|
+
${hint}
|
|
20774
|
+
|
|
20775
|
+
`);
|
|
20776
|
+
}
|
|
20777
|
+
|
|
20778
|
+
// src/lib/version.ts
|
|
20779
|
+
var CLI_VERSION = true ? "1.8.0" : createRequire(import.meta.url)("../../package.json").version;
|
|
20758
20780
|
|
|
20759
20781
|
// src/lib/deps.ts
|
|
20760
20782
|
import { execFileSync } from "node:child_process";
|
|
@@ -20998,6 +21020,7 @@ var initCommand = new Command("init").description("Set up OCR for AI coding envi
|
|
|
20998
21020
|
}
|
|
20999
21021
|
const successfulToolIds = successful.map((r) => r.tool.id);
|
|
21000
21022
|
setConfiguredToolIds(targetDir, successfulToolIds);
|
|
21023
|
+
stampCliVersion(targetDir, CLI_VERSION);
|
|
21001
21024
|
}
|
|
21002
21025
|
if (failed.length > 0) {
|
|
21003
21026
|
console.log();
|
|
@@ -25608,6 +25631,7 @@ var updateCommand = new Command("update").description("Update OCR assets after p
|
|
|
25608
25631
|
if (options.dryRun) {
|
|
25609
25632
|
console.log(source_default.dim(" Run without --dry-run to apply changes."));
|
|
25610
25633
|
} else {
|
|
25634
|
+
stampCliVersion(targetDir, CLI_VERSION);
|
|
25611
25635
|
console.log(source_default.green(" \u2713 Update complete"));
|
|
25612
25636
|
}
|
|
25613
25637
|
console.log();
|
|
@@ -25986,12 +26010,11 @@ ${line2}
|
|
|
25986
26010
|
}
|
|
25987
26011
|
|
|
25988
26012
|
// src/index.ts
|
|
25989
|
-
var cliVersion = true ? "1.7.0" : createRequire(import.meta.url)("../package.json").version;
|
|
25990
26013
|
var HUMAN_COMMANDS = /* @__PURE__ */ new Set(["init", "update", "doctor", "dashboard", "progress"]);
|
|
25991
26014
|
var subcommand = process.argv[2];
|
|
25992
|
-
var updateCheck = subcommand && HUMAN_COMMANDS.has(subcommand) ? checkForUpdate(
|
|
26015
|
+
var updateCheck = subcommand && HUMAN_COMMANDS.has(subcommand) ? checkForUpdate(CLI_VERSION) : null;
|
|
25993
26016
|
var program2 = new Command();
|
|
25994
|
-
program2.name("ocr").description("Open Code Review - AI-powered multi-agent code review").version(
|
|
26017
|
+
program2.name("ocr").description("Open Code Review - AI-powered multi-agent code review").version(CLI_VERSION);
|
|
25995
26018
|
program2.addCommand(initCommand);
|
|
25996
26019
|
program2.addCommand(progressCommand);
|
|
25997
26020
|
program2.addCommand(stateCommand);
|
|
@@ -26000,6 +26023,12 @@ program2.addCommand(dashboardCommand);
|
|
|
26000
26023
|
program2.addCommand(doctorCommand);
|
|
26001
26024
|
program2.addCommand(reviewersCommand);
|
|
26002
26025
|
await program2.parseAsync();
|
|
26026
|
+
if (subcommand && HUMAN_COMMANDS.has(subcommand)) {
|
|
26027
|
+
const drift = checkLocalArtifactVersion(process.cwd(), CLI_VERSION);
|
|
26028
|
+
if (drift) {
|
|
26029
|
+
printLocalVersionHint(drift);
|
|
26030
|
+
}
|
|
26031
|
+
}
|
|
26003
26032
|
if (updateCheck) {
|
|
26004
26033
|
const updateResult = await Promise.race([
|
|
26005
26034
|
updateCheck,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-code-review/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "CLI for Open Code Review - Multi-environment setup and progress tracking",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"ora": "^8.1.1",
|
|
51
51
|
"socket.io": "^4.8",
|
|
52
52
|
"sql.js": "^1.14.1",
|
|
53
|
-
"@open-code-review/agents": "1.
|
|
53
|
+
"@open-code-review/agents": "1.8.1"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|