@dosu/cli 0.22.0 → 0.23.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/bin/dosu.js +59 -11
- package/package.json +2 -2
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.23.1", INSTALL_CHANNEL = "npm";
|
|
4581
4581
|
|
|
4582
4582
|
// src/debug/logger.ts
|
|
4583
4583
|
import {
|
|
@@ -15259,8 +15259,56 @@ var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
|
15259
15259
|
function requireConfig9() {
|
|
15260
15260
|
return requireLoginConfig();
|
|
15261
15261
|
}
|
|
15262
|
+
function humanizeSource(origin, version) {
|
|
15263
|
+
switch (origin) {
|
|
15264
|
+
case "manual_update":
|
|
15265
|
+
return version <= 1 ? "User created" : "User updated";
|
|
15266
|
+
case "llm_generated":
|
|
15267
|
+
return "AI generated";
|
|
15268
|
+
case "sync_upstream":
|
|
15269
|
+
return "Synced from source";
|
|
15270
|
+
case "api_update":
|
|
15271
|
+
return "Created via API";
|
|
15272
|
+
default:
|
|
15273
|
+
return origin;
|
|
15274
|
+
}
|
|
15275
|
+
}
|
|
15276
|
+
async function getKnowledgeStoreId2(client, spaceId) {
|
|
15277
|
+
const store = await client.knowledgeStore.getBySpaceId.query({ space_id: spaceId });
|
|
15278
|
+
if (!store) {
|
|
15279
|
+
console.error(import_picocolors18.default.red("No knowledge store found for this deployment."));
|
|
15280
|
+
process.exit(1);
|
|
15281
|
+
}
|
|
15282
|
+
return store.id;
|
|
15283
|
+
}
|
|
15262
15284
|
function reviewCommand() {
|
|
15263
15285
|
const cmd = new Command("review").description("Document review workflow");
|
|
15286
|
+
cmd.command("list").description("List pending document review items").option("--json", "Output as JSON").action(async (opts) => {
|
|
15287
|
+
const cfg = requireConfig9();
|
|
15288
|
+
if (!cfg.space_id) {
|
|
15289
|
+
console.error(import_picocolors18.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
|
|
15290
|
+
process.exit(1);
|
|
15291
|
+
}
|
|
15292
|
+
const client = createTypedClient(cfg);
|
|
15293
|
+
const ksId = await getKnowledgeStoreId2(client, cfg.space_id);
|
|
15294
|
+
const items = await client.review.listPending.query({ knowledgeStoreId: ksId });
|
|
15295
|
+
if (opts.json) {
|
|
15296
|
+
printResult(items, opts);
|
|
15297
|
+
return;
|
|
15298
|
+
}
|
|
15299
|
+
if (!items || items.length === 0) {
|
|
15300
|
+
console.log(import_picocolors18.default.dim("No pending review items."));
|
|
15301
|
+
return;
|
|
15302
|
+
}
|
|
15303
|
+
printTable(["ID", "Kind", "Title", "Source", "Status", "Created"], items.map((i2) => [
|
|
15304
|
+
i2.id.slice(0, 8),
|
|
15305
|
+
i2.kind,
|
|
15306
|
+
truncate(i2.title ?? "(untitled)", 40),
|
|
15307
|
+
humanizeSource(i2.origin, i2.version),
|
|
15308
|
+
i2.pendingStatus,
|
|
15309
|
+
formatDate(i2.createdAt)
|
|
15310
|
+
]), { rawData: items });
|
|
15311
|
+
});
|
|
15264
15312
|
cmd.command("context").description("Get review context for a thread").argument("<thread-id>", "Thread ID").option("--json", "Output as JSON").action(async (threadId, opts) => {
|
|
15265
15313
|
const cfg = requireConfig9();
|
|
15266
15314
|
const client = createTypedClient(cfg);
|
|
@@ -15292,18 +15340,18 @@ function reviewCommand() {
|
|
|
15292
15340
|
}
|
|
15293
15341
|
];
|
|
15294
15342
|
for (const { name, action, description } of actions) {
|
|
15295
|
-
cmd.command(name).description(description).argument("<
|
|
15343
|
+
cmd.command(name).description(description).argument("<id>", "Review item ID (from `dosu review list`)").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
15296
15344
|
const cfg = requireConfig9();
|
|
15297
15345
|
const client = createTypedClient(cfg);
|
|
15298
15346
|
await client.page.updatePublicationStatus.mutate({
|
|
15299
|
-
page_version_id:
|
|
15347
|
+
page_version_id: id,
|
|
15300
15348
|
action
|
|
15301
15349
|
});
|
|
15302
15350
|
if (opts.json) {
|
|
15303
|
-
printResult({ success: true,
|
|
15351
|
+
printResult({ success: true, id, action }, opts);
|
|
15304
15352
|
return;
|
|
15305
15353
|
}
|
|
15306
|
-
console.log(import_picocolors18.default.green(`Review ${name}: ${
|
|
15354
|
+
console.log(import_picocolors18.default.green(`Review ${name}: ${id.slice(0, 8)}`));
|
|
15307
15355
|
});
|
|
15308
15356
|
}
|
|
15309
15357
|
return cmd;
|
|
@@ -15418,7 +15466,7 @@ function requireConfig11() {
|
|
|
15418
15466
|
}
|
|
15419
15467
|
return cfg;
|
|
15420
15468
|
}
|
|
15421
|
-
async function
|
|
15469
|
+
async function getKnowledgeStoreId3(client, spaceId) {
|
|
15422
15470
|
const store = await client.knowledgeStore.getBySpaceId.query({
|
|
15423
15471
|
space_id: spaceId
|
|
15424
15472
|
});
|
|
@@ -15433,7 +15481,7 @@ function suggestCommand() {
|
|
|
15433
15481
|
cmd.command("list").description("List pending document suggestions").option("--json", "Output as JSON").action(async (opts) => {
|
|
15434
15482
|
const cfg = requireConfig11();
|
|
15435
15483
|
const client = createTypedClient(cfg);
|
|
15436
|
-
const ksId = await
|
|
15484
|
+
const ksId = await getKnowledgeStoreId3(client, cfg.space_id);
|
|
15437
15485
|
const suggestions = await client.suggestedDoc.listForKnowledgeStore.query({
|
|
15438
15486
|
knowledgeStoreId: ksId
|
|
15439
15487
|
});
|
|
@@ -15453,7 +15501,7 @@ function suggestCommand() {
|
|
|
15453
15501
|
cmd.command("generate").description("Generate new document suggestions from data sources").option("--json", "Output as JSON").action(async (opts) => {
|
|
15454
15502
|
const cfg = requireConfig11();
|
|
15455
15503
|
const client = createTypedClient(cfg);
|
|
15456
|
-
const ksId = await
|
|
15504
|
+
const ksId = await getKnowledgeStoreId3(client, cfg.space_id);
|
|
15457
15505
|
if (!cfg.org_id) {
|
|
15458
15506
|
console.error(import_picocolors20.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
|
|
15459
15507
|
process.exit(1);
|
|
@@ -15498,7 +15546,7 @@ function requireConfig12() {
|
|
|
15498
15546
|
}
|
|
15499
15547
|
return cfg;
|
|
15500
15548
|
}
|
|
15501
|
-
async function
|
|
15549
|
+
async function getKnowledgeStoreId4(client, spaceId) {
|
|
15502
15550
|
const store = await client.knowledgeStore.getBySpaceId.query({
|
|
15503
15551
|
space_id: spaceId
|
|
15504
15552
|
});
|
|
@@ -15513,7 +15561,7 @@ function tagsCommand() {
|
|
|
15513
15561
|
cmd.command("list").description("List all tags").option("--json", "Output as JSON").action(async (opts) => {
|
|
15514
15562
|
const cfg = requireConfig12();
|
|
15515
15563
|
const client = createTypedClient(cfg);
|
|
15516
|
-
const ksId = await
|
|
15564
|
+
const ksId = await getKnowledgeStoreId4(client, cfg.space_id);
|
|
15517
15565
|
const tags = await client.topic.listTopicsByKnowledgeStore.query({
|
|
15518
15566
|
knowledge_store_id: ksId
|
|
15519
15567
|
});
|
|
@@ -15540,7 +15588,7 @@ function tagsCommand() {
|
|
|
15540
15588
|
cmd.command("pages").description("List pages with a specific tag").argument("<tag-id>", "Tag ID").option("--search <query>", "Search within tagged pages").option("--limit <n>", "Maximum results", "10").option("--json", "Output as JSON").action(async (tagId, opts) => {
|
|
15541
15589
|
const cfg = requireConfig12();
|
|
15542
15590
|
const client = createTypedClient(cfg);
|
|
15543
|
-
const ksId = await
|
|
15591
|
+
const ksId = await getKnowledgeStoreId4(client, cfg.space_id);
|
|
15544
15592
|
const result = await client.topic.getPagesByTopicId.query({
|
|
15545
15593
|
knowledge_store_id: ksId,
|
|
15546
15594
|
topic_id: tagId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dosu/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dosu CLI - Manage MCP servers for AI tools",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@biomejs/biome": "^2.5.0",
|
|
39
39
|
"@clack/prompts": "^1.6.0",
|
|
40
|
-
"@dosu/api-types": "0.0.
|
|
40
|
+
"@dosu/api-types": "0.0.33",
|
|
41
41
|
"@semantic-release/changelog": "^6.0.3",
|
|
42
42
|
"@semantic-release/exec": "^7.1.0",
|
|
43
43
|
"@semantic-release/git": "^10.0.1",
|