@dosu/cli 0.25.0 → 0.26.0
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/bin/dosu.js +45 -5
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -4577,7 +4577,7 @@ var init_dist4 = __esm(() => {
|
|
|
4577
4577
|
function getVersionString() {
|
|
4578
4578
|
return `v${VERSION}`;
|
|
4579
4579
|
}
|
|
4580
|
-
var VERSION = "0.
|
|
4580
|
+
var VERSION = "0.26.0", INSTALL_CHANNEL = "npm";
|
|
4581
4581
|
|
|
4582
4582
|
// src/debug/logger.ts
|
|
4583
4583
|
import {
|
|
@@ -13657,7 +13657,7 @@ var init_flow3 = __esm(() => {
|
|
|
13657
13657
|
// src/cli/cli.ts
|
|
13658
13658
|
init_commander();
|
|
13659
13659
|
init_client();
|
|
13660
|
-
import { readFileSync as
|
|
13660
|
+
import { readFileSync as readFileSync14, unlinkSync as unlinkSync2 } from "node:fs";
|
|
13661
13661
|
|
|
13662
13662
|
// src/commands/analytics.ts
|
|
13663
13663
|
init_commander();
|
|
@@ -15258,6 +15258,7 @@ init_dist();
|
|
|
15258
15258
|
init_commander();
|
|
15259
15259
|
init_trpc();
|
|
15260
15260
|
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
15261
|
+
import { readFileSync as readFileSync12 } from "node:fs";
|
|
15261
15262
|
function requireConfig9() {
|
|
15262
15263
|
return requireLoginConfig();
|
|
15263
15264
|
}
|
|
@@ -15363,6 +15364,45 @@ function reviewCommand() {
|
|
|
15363
15364
|
console.log("");
|
|
15364
15365
|
console.log(change.diff);
|
|
15365
15366
|
});
|
|
15367
|
+
cmd.command("edit").description("Edit a pending document version's body/title in place").argument("<page-version-id>", "Page version ID (from `dosu review list`)").option("--title <title>", "New title").option("--body <markdown>", "New body (markdown)").option("--body-file <path>", "Read body from file").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
15368
|
+
const cfg = requireConfig9();
|
|
15369
|
+
const client = createTypedClient(cfg);
|
|
15370
|
+
if (opts.body !== undefined && opts.bodyFile !== undefined) {
|
|
15371
|
+
console.error(import_picocolors18.default.red("Pass only one of --body or --body-file."));
|
|
15372
|
+
process.exit(1);
|
|
15373
|
+
}
|
|
15374
|
+
let body = opts.body;
|
|
15375
|
+
if (opts.bodyFile) {
|
|
15376
|
+
try {
|
|
15377
|
+
body = readFileSync12(opts.bodyFile, "utf-8");
|
|
15378
|
+
} catch (err) {
|
|
15379
|
+
console.error(import_picocolors18.default.red(`Failed to read --body-file: ${err.message}`));
|
|
15380
|
+
process.exit(1);
|
|
15381
|
+
}
|
|
15382
|
+
}
|
|
15383
|
+
if (body === undefined && opts.title === undefined) {
|
|
15384
|
+
console.error(import_picocolors18.default.red("Nothing to edit. Pass --title and/or --body/--body-file."));
|
|
15385
|
+
process.exit(1);
|
|
15386
|
+
}
|
|
15387
|
+
try {
|
|
15388
|
+
await client.page.updateReview.mutate({
|
|
15389
|
+
page_version_id: id,
|
|
15390
|
+
title: opts.title,
|
|
15391
|
+
body
|
|
15392
|
+
});
|
|
15393
|
+
} catch (err) {
|
|
15394
|
+
if (isTRPCClientError(err) && err.data?.code === "NOT_FOUND") {
|
|
15395
|
+
console.error(import_picocolors18.default.red(`No pending review item found for '${id}'. Run 'dosu review list' to see editable items.`));
|
|
15396
|
+
process.exit(1);
|
|
15397
|
+
}
|
|
15398
|
+
throw err;
|
|
15399
|
+
}
|
|
15400
|
+
if (opts.json) {
|
|
15401
|
+
printResult({ success: true, id }, opts);
|
|
15402
|
+
return;
|
|
15403
|
+
}
|
|
15404
|
+
console.log(import_picocolors18.default.green(`Review edited: ${id.slice(0, 8)}`));
|
|
15405
|
+
});
|
|
15366
15406
|
cmd.command("context").description("Get review context for a thread").argument("<thread-id>", "Thread ID").option("--json", "Output as JSON").action(async (threadId, opts) => {
|
|
15367
15407
|
const cfg = requireConfig9();
|
|
15368
15408
|
const client = createTypedClient(cfg);
|
|
@@ -15810,7 +15850,7 @@ init_skill_update_check();
|
|
|
15810
15850
|
init_config();
|
|
15811
15851
|
init_logger();
|
|
15812
15852
|
var import_picocolors23 = __toESM(require_picocolors(), 1);
|
|
15813
|
-
import { existsSync as existsSync14, mkdirSync as mkdirSync7, readFileSync as
|
|
15853
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync7, readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "node:fs";
|
|
15814
15854
|
import { join as join25 } from "node:path";
|
|
15815
15855
|
var CACHE_FILENAME2 = "update-check.json";
|
|
15816
15856
|
var CHECK_INTERVAL_MS2 = 24 * 60 * 60 * 1000;
|
|
@@ -15841,7 +15881,7 @@ function readCache() {
|
|
|
15841
15881
|
const path3 = getCachePath2();
|
|
15842
15882
|
if (!existsSync14(path3))
|
|
15843
15883
|
return null;
|
|
15844
|
-
const data = JSON.parse(
|
|
15884
|
+
const data = JSON.parse(readFileSync13(path3, "utf-8"));
|
|
15845
15885
|
if (typeof data.lastCheck === "number" && typeof data.latestVersion === "string") {
|
|
15846
15886
|
return data;
|
|
15847
15887
|
}
|
|
@@ -16177,7 +16217,7 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
|
|
|
16177
16217
|
if (opts.tail !== undefined) {
|
|
16178
16218
|
const n2 = typeof opts.tail === "string" ? parseInt(opts.tail, 10) || 50 : 50;
|
|
16179
16219
|
try {
|
|
16180
|
-
const content =
|
|
16220
|
+
const content = readFileSync14(logPath, "utf-8");
|
|
16181
16221
|
const lines = content.split(`
|
|
16182
16222
|
`);
|
|
16183
16223
|
console.log(lines.slice(-n2).join(`
|