@dosu/cli 0.51.1 → 0.52.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.
Files changed (3) hide show
  1. package/README.md +0 -1
  2. package/bin/dosu.js +35 -140
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -115,7 +115,6 @@ Once authenticated against a deployment, you can drive the Dosu platform without
115
115
  | `dosu ask` | Ask a question and get an AI-generated answer |
116
116
  | `dosu knowledge` | Search and browse your knowledge base |
117
117
  | `dosu docs` | Manage documents (list, create, update, import, publish, AI-generate) |
118
- | `dosu suggest` | Review and manage AI document suggestions |
119
118
  | `dosu threads` | List and manage conversation threads |
120
119
  | `dosu review` | Document review workflow |
121
120
  | `dosu sources` | Manage connected data sources (list, sync, update) |
package/bin/dosu.js CHANGED
@@ -5000,7 +5000,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
5000
5000
  function getVersionString() {
5001
5001
  return `v${VERSION}`;
5002
5002
  }
5003
- var VERSION = "0.51.1", INSTALL_CHANNEL = "npm";
5003
+ var VERSION = "0.52.0", INSTALL_CHANNEL = "npm";
5004
5004
 
5005
5005
  // src/debug/logger.ts
5006
5006
  import {
@@ -11444,7 +11444,7 @@ var init_settings = __esm(() => {
11444
11444
  });
11445
11445
 
11446
11446
  // src/telemetry/debug-id.ts
11447
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "06fcd05b-5d4d-0298-6475-6e2164756e21";
11447
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "1a1d772d-8140-9eda-6475-6e2164756e21";
11448
11448
 
11449
11449
  // src/telemetry/telemetry.ts
11450
11450
  import { randomUUID as randomUUID3 } from "node:crypto";
@@ -14047,7 +14047,7 @@ __export(exports_tui, {
14047
14047
  handleLogout: () => handleLogout
14048
14048
  });
14049
14049
  async function runTUI() {
14050
- console.log(import_picocolors29.default.magenta(LOGO));
14050
+ console.log(import_picocolors28.default.magenta(LOGO));
14051
14051
  const cfg = loadConfig();
14052
14052
  while (true) {
14053
14053
  const insightsReady = Boolean(cfg.active_account?.target?.space_id && cfg.active_account?.target?.deployment_id && cfg.active_account?.target?.api_key);
@@ -14161,7 +14161,7 @@ function handleLogout(cfg) {
14161
14161
  saveConfig(cfg);
14162
14162
  log.success("Credentials cleared.");
14163
14163
  }
14164
- var import_picocolors29, LOGO = `
14164
+ var import_picocolors28, LOGO = `
14165
14165
  /$$$$$$$
14166
14166
  | $$__ $$
14167
14167
  | $$ \\ $$ /$$$$$$ /$$$$$$$ /$$ /$$
@@ -14178,7 +14178,7 @@ var init_tui = __esm(() => {
14178
14178
  init_config();
14179
14179
  init_flow2();
14180
14180
  init_styles();
14181
- import_picocolors29 = __toESM(require_picocolors(), 1);
14181
+ import_picocolors28 = __toESM(require_picocolors(), 1);
14182
14182
  });
14183
14183
 
14184
14184
  // src/auth/ticket.ts
@@ -17232,110 +17232,6 @@ function sourcesCommand() {
17232
17232
  return cmd;
17233
17233
  }
17234
17234
 
17235
- // src/commands/suggest.ts
17236
- init_commander();
17237
- var import_picocolors24 = __toESM(require_picocolors(), 1);
17238
-
17239
- // src/client/supabase.ts
17240
- async function listSpaceDataSourceIds(config, spaceId) {
17241
- const accessToken = config.active_account?.session.access_token;
17242
- if (!accessToken)
17243
- throw new Error("Not logged in. Run 'dosu login' first.");
17244
- const endpoint = new URL("/rest/v1/space_data_source", getSupabaseURL());
17245
- endpoint.searchParams.set("select", "data_source_id");
17246
- endpoint.searchParams.set("space_id", `eq.${spaceId}`);
17247
- const response = await fetch(endpoint, {
17248
- headers: {
17249
- apikey: getSupabaseAnonKey(),
17250
- Authorization: `Bearer ${accessToken}`
17251
- }
17252
- });
17253
- if (!response.ok) {
17254
- throw new Error(`Failed to list this deployment's data sources (status ${response.status}).`);
17255
- }
17256
- const rows = await response.json();
17257
- if (!Array.isArray(rows) || rows.some((row) => !isDataSourceLink(row))) {
17258
- throw new Error("Supabase returned an invalid space_data_source response.");
17259
- }
17260
- return rows.map((row) => row.data_source_id);
17261
- }
17262
- function isDataSourceLink(value) {
17263
- return value !== null && typeof value === "object" && "data_source_id" in value && typeof value.data_source_id === "string";
17264
- }
17265
-
17266
- // src/commands/suggest.ts
17267
- init_trpc();
17268
- function requireConfig12() {
17269
- const cfg = requireLoginConfig();
17270
- if (!cfg.active_account?.target?.space_id) {
17271
- console.error(import_picocolors24.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
17272
- process.exit(1);
17273
- }
17274
- return cfg;
17275
- }
17276
- async function getKnowledgeStoreId3(client, spaceId) {
17277
- const store = await client.knowledgeStore.getBySpaceId.query({
17278
- space_id: spaceId
17279
- });
17280
- if (!store) {
17281
- console.error(import_picocolors24.default.red("No knowledge store found for this deployment."));
17282
- process.exit(1);
17283
- }
17284
- return store.id;
17285
- }
17286
- function suggestCommand() {
17287
- const cmd = new Command("suggest").description("AI document suggestions");
17288
- cmd.command("list").description("List pending document suggestions").option("--json", "Output as JSON").action(async (opts) => {
17289
- const cfg = requireConfig12();
17290
- const client = createTypedClient(cfg);
17291
- const ksId = await getKnowledgeStoreId3(client, cfg.active_account.target.space_id);
17292
- const suggestions = await client.suggestedDoc.listForKnowledgeStore.query({
17293
- knowledgeStoreId: ksId
17294
- });
17295
- if (opts.json) {
17296
- printResult(suggestions, opts);
17297
- return;
17298
- }
17299
- if (!suggestions || suggestions.length === 0) {
17300
- console.log(import_picocolors24.default.dim("No pending suggestions."));
17301
- return;
17302
- }
17303
- printTable(["ID", "Title"], suggestions.map((s) => [
17304
- s.id.slice(0, 8),
17305
- s.title ?? "(untitled)"
17306
- ]), { rawData: suggestions });
17307
- });
17308
- cmd.command("generate").description("Generate new document suggestions from data sources").option("--json", "Output as JSON").action(async (opts) => {
17309
- const cfg = requireConfig12();
17310
- const client = createTypedClient(cfg);
17311
- const ksId = await getKnowledgeStoreId3(client, cfg.active_account.target.space_id);
17312
- const dataSourceIds = await listSpaceDataSourceIds(cfg, cfg.active_account.target.space_id);
17313
- if (dataSourceIds.length === 0) {
17314
- throw new Error("No data sources are connected to the active deployment.");
17315
- }
17316
- const result = await client.suggestedDoc.generate.mutate({
17317
- knowledgeStoreId: ksId,
17318
- dataSourceIds
17319
- });
17320
- if (opts.json) {
17321
- printResult(result, opts);
17322
- return;
17323
- }
17324
- console.log(import_picocolors24.default.green("Document suggestions are being generated."));
17325
- });
17326
- cmd.command("reject").description("Reject a suggestion").argument("<id>", "Suggestion ID").option("--json", "Output as JSON").action(async (id, opts) => {
17327
- const cfg = requireConfig12();
17328
- const client = createTypedClient(cfg);
17329
- await client.suggestedDoc.delete.mutate({ id });
17330
- if (opts.json) {
17331
- printResult({ success: true, id }, opts);
17332
- return;
17333
- }
17334
- console.log(import_picocolors24.default.green("Suggestion rejected."));
17335
- });
17336
- return cmd;
17337
- }
17338
-
17339
17235
  // src/commands/telemetry.ts
17340
17236
  init_commander();
17341
17237
  init_settings();
@@ -17404,11 +17300,11 @@ function telemetryCommand() {
17404
17300
  // src/commands/threads.ts
17405
17301
  init_commander();
17406
17302
  init_trpc();
17407
- var import_picocolors25 = __toESM(require_picocolors(), 1);
17408
- function requireConfig13() {
17303
+ var import_picocolors24 = __toESM(require_picocolors(), 1);
17304
+ function requireConfig12() {
17409
17305
  const cfg = requireLoginConfig();
17410
17306
  if (!cfg.active_account?.target?.space_id) {
17411
- console.error(import_picocolors25.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
17307
+ console.error(import_picocolors24.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
17412
17308
  process.exit(1);
17413
17309
  }
17414
17310
  return cfg;
@@ -17420,7 +17316,7 @@ function threadsCommand() {
17420
17316
  "resolved",
17421
17317
  "archived"
17422
17318
  ])).option("--search <query>", "Search threads").addOption(new Option("--limit <n>", "Maximum results (default: 20; max: 100)").argParser(positiveIntegerAtMost(100)).default(20)).option("--json", "Output as JSON").action(async (opts) => {
17423
- const cfg = requireConfig13();
17319
+ const cfg = requireConfig12();
17424
17320
  const client = createTypedClient(cfg);
17425
17321
  const input = {
17426
17322
  __testing_scope__: undefined,
@@ -17459,7 +17355,7 @@ function threadsCommand() {
17459
17355
  return;
17460
17356
  }
17461
17357
  if (!threads || threads.length === 0) {
17462
- console.log(import_picocolors25.default.dim("No threads found."));
17358
+ console.log(import_picocolors24.default.dim("No threads found."));
17463
17359
  return;
17464
17360
  }
17465
17361
  printTable(["ID", "Title", "Status", "Created"], threads.map((t2) => [
@@ -17470,7 +17366,7 @@ function threadsCommand() {
17470
17366
  ]), { rawData: threads });
17471
17367
  });
17472
17368
  cmd.command("get").description("View a thread and its messages").argument("<id>", "Thread ID").addOption(new Option("--limit <n>", "Number of messages to show (default: 20; -1 for all)").argParser(messageLimit).default(20)).option("--json", "Output as JSON").action(async (id, opts) => {
17473
- const cfg = requireConfig13();
17369
+ const cfg = requireConfig12();
17474
17370
  const client = createTypedClient(cfg);
17475
17371
  const [thread, messagesData] = await Promise.all([
17476
17372
  client.thread.get.query(id),
@@ -17484,10 +17380,10 @@ function threadsCommand() {
17484
17380
  return;
17485
17381
  }
17486
17382
  if (!thread) {
17487
- console.log(import_picocolors25.default.dim("Thread not found."));
17383
+ console.log(import_picocolors24.default.dim("Thread not found."));
17488
17384
  return;
17489
17385
  }
17490
- console.log(import_picocolors25.default.bold(thread.generated_title ?? "(untitled thread)"));
17386
+ console.log(import_picocolors24.default.bold(thread.generated_title ?? "(untitled thread)"));
17491
17387
  printInfo([
17492
17388
  ["ID", thread.id],
17493
17389
  ["Created", formatDate(thread.created_at)],
@@ -17498,13 +17394,13 @@ function threadsCommand() {
17498
17394
  if (messages && messages.length > 0) {
17499
17395
  const allMessages = messages.flatMap((group) => group.messages);
17500
17396
  console.log(`
17501
- ${import_picocolors25.default.bold("Messages")} (${allMessages.length})`);
17502
- console.log(import_picocolors25.default.dim("─".repeat(60)));
17397
+ ${import_picocolors24.default.bold("Messages")} (${allMessages.length})`);
17398
+ console.log(import_picocolors24.default.dim("─".repeat(60)));
17503
17399
  for (const msg of allMessages) {
17504
17400
  const role = msg.author_role ?? "unknown";
17505
17401
  const date = formatDate(msg.created_at);
17506
17402
  console.log(`
17507
- ${import_picocolors25.default.bold(role)} ${import_picocolors25.default.dim(date)}`);
17403
+ ${import_picocolors24.default.bold(role)} ${import_picocolors24.default.dim(date)}`);
17508
17404
  if (msg.body) {
17509
17405
  console.log(truncate(msg.body, 500));
17510
17406
  }
@@ -17512,14 +17408,14 @@ ${import_picocolors25.default.bold(role)} ${import_picocolors25.default.dim(date
17512
17408
  }
17513
17409
  });
17514
17410
  cmd.command("archive").description("Archive a thread").argument("<id>", "Thread ID").option("--json", "Output as JSON").action(async (id, opts) => {
17515
- const cfg = requireConfig13();
17411
+ const cfg = requireConfig12();
17516
17412
  const client = createTypedClient(cfg);
17517
17413
  await client.thread.archive.mutate({ threadId: id, archived: true });
17518
17414
  if (opts.json) {
17519
17415
  printResult({ success: true, id }, opts);
17520
17416
  return;
17521
17417
  }
17522
- console.log(import_picocolors25.default.green(`Thread ${id.slice(0, 8)} archived.`));
17418
+ console.log(import_picocolors24.default.green(`Thread ${id.slice(0, 8)} archived.`));
17523
17419
  });
17524
17420
  return cmd;
17525
17421
  }
@@ -17527,21 +17423,21 @@ ${import_picocolors25.default.bold(role)} ${import_picocolors25.default.dim(date
17527
17423
  // src/commands/topics.ts
17528
17424
  init_commander();
17529
17425
  init_trpc();
17530
- var import_picocolors26 = __toESM(require_picocolors(), 1);
17531
- function requireConfig14() {
17426
+ var import_picocolors25 = __toESM(require_picocolors(), 1);
17427
+ function requireConfig13() {
17532
17428
  const cfg = requireLoginConfig();
17533
17429
  if (!cfg.active_account?.target?.space_id) {
17534
- console.error(import_picocolors26.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
17430
+ console.error(import_picocolors25.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
17535
17431
  process.exit(1);
17536
17432
  }
17537
17433
  return cfg;
17538
17434
  }
17539
- async function getKnowledgeStoreId4(client, spaceId) {
17435
+ async function getKnowledgeStoreId3(client, spaceId) {
17540
17436
  const store = await client.knowledgeStore.getBySpaceId.query({
17541
17437
  space_id: spaceId
17542
17438
  });
17543
17439
  if (!store) {
17544
- console.error(import_picocolors26.default.red("No knowledge store found for this deployment."));
17440
+ console.error(import_picocolors25.default.red("No knowledge store found for this deployment."));
17545
17441
  process.exit(1);
17546
17442
  }
17547
17443
  return store.id;
@@ -17549,9 +17445,9 @@ async function getKnowledgeStoreId4(client, spaceId) {
17549
17445
  function topicsCommand() {
17550
17446
  const cmd = new Command("topics").description("Browse Topics in your knowledge base");
17551
17447
  cmd.command("list").description("List all topics").option("--json", "Output as JSON").action(async (opts) => {
17552
- const cfg = requireConfig14();
17448
+ const cfg = requireConfig13();
17553
17449
  const client = createTypedClient(cfg);
17554
- const ksId = await getKnowledgeStoreId4(client, cfg.active_account.target.space_id);
17450
+ const ksId = await getKnowledgeStoreId3(client, cfg.active_account.target.space_id);
17555
17451
  const topics = await client.topic.listTopicsByKnowledgeStore.query({
17556
17452
  knowledge_store_id: ksId
17557
17453
  });
@@ -17560,7 +17456,7 @@ function topicsCommand() {
17560
17456
  return;
17561
17457
  }
17562
17458
  if (!topics || topics.length === 0) {
17563
- console.log(import_picocolors26.default.dim("No topics found."));
17459
+ console.log(import_picocolors25.default.dim("No topics found."));
17564
17460
  return;
17565
17461
  }
17566
17462
  printTable(["ID", "Name", "Description"], topics.map((t2) => [
@@ -17570,9 +17466,9 @@ function topicsCommand() {
17570
17466
  ]), { rawData: topics });
17571
17467
  });
17572
17468
  cmd.command("pages").description("List pages with a specific topic").argument("<topic-id>", "Topic ID").option("--search <query>", "Search within the topic's pages").addOption(new Option("--limit <n>", "Maximum results").argParser(positiveInteger).default(10)).option("--json", "Output as JSON").action(async (topicId, opts) => {
17573
- const cfg = requireConfig14();
17469
+ const cfg = requireConfig13();
17574
17470
  const client = createTypedClient(cfg);
17575
- const ksId = await getKnowledgeStoreId4(client, cfg.active_account.target.space_id);
17471
+ const ksId = await getKnowledgeStoreId3(client, cfg.active_account.target.space_id);
17576
17472
  const result = await client.topic.getPagesByTopicId.query({
17577
17473
  knowledge_store_id: ksId,
17578
17474
  topic_id: topicId,
@@ -17585,7 +17481,7 @@ function topicsCommand() {
17585
17481
  return;
17586
17482
  }
17587
17483
  if (!pages || pages.length === 0) {
17588
- console.log(import_picocolors26.default.dim("No pages found with this topic."));
17484
+ console.log(import_picocolors25.default.dim("No pages found with this topic."));
17589
17485
  return;
17590
17486
  }
17591
17487
  printTable(["ID", "Title"], pages.map((p2) => [
@@ -17599,7 +17495,7 @@ function topicsCommand() {
17599
17495
  // src/commands/upgrade.ts
17600
17496
  init_commander();
17601
17497
  init_skill();
17602
- var import_picocolors27 = __toESM(require_picocolors(), 1);
17498
+ var import_picocolors26 = __toESM(require_picocolors(), 1);
17603
17499
  import { spawnSync as spawnSync2 } from "node:child_process";
17604
17500
  import { realpathSync } from "node:fs";
17605
17501
  import { homedir as homedir6 } from "node:os";
@@ -17768,7 +17664,7 @@ Could not update Dosu automatically.`);
17768
17664
  ${plan.manualCommand}`);
17769
17665
  return result.status && result.status > 0 ? result.status : 1;
17770
17666
  }
17771
- console.log(import_picocolors27.default.green(`
17667
+ console.log(import_picocolors26.default.green(`
17772
17668
  ✓ Update command completed.`));
17773
17669
  console.log('Run "dosu --version" to verify.');
17774
17670
  return 0;
@@ -17781,7 +17677,7 @@ async function completeUpgrade(channel = INSTALL_CHANNEL, options = {}) {
17781
17677
  try {
17782
17678
  const result = await installSkill();
17783
17679
  if (result.success) {
17784
- console.log(import_picocolors27.default.green("✓ Skills updated."));
17680
+ console.log(import_picocolors26.default.green("✓ Skills updated."));
17785
17681
  } else {
17786
17682
  console.error('Skills could not be refreshed. Run "dosu skill update" to retry.');
17787
17683
  }
@@ -17810,7 +17706,7 @@ init_skill_update_check();
17810
17706
  // src/version/update-check.ts
17811
17707
  init_config();
17812
17708
  init_logger();
17813
- var import_picocolors28 = __toESM(require_picocolors(), 1);
17709
+ var import_picocolors27 = __toESM(require_picocolors(), 1);
17814
17710
  import { existsSync as existsSync17, mkdirSync as mkdirSync10, readFileSync as readFileSync14, writeFileSync as writeFileSync11 } from "node:fs";
17815
17711
  import { join as join28 } from "node:path";
17816
17712
  var CACHE_FILENAME3 = "update-check.json";
@@ -17903,7 +17799,7 @@ function buildUpdateNotice(current, latest, channel, interactive, npx = false) {
17903
17799
  `└${horizontal}┘`
17904
17800
  ];
17905
17801
  return `
17906
- ${frameLines.map((line) => import_picocolors28.default.yellow(line)).join(`
17802
+ ${frameLines.map((line) => import_picocolors27.default.yellow(line)).join(`
17907
17803
  `)}
17908
17804
  `;
17909
17805
  }
@@ -18332,7 +18228,6 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
18332
18228
  program2.addCommand(orgCommand());
18333
18229
  program2.addCommand(reviewCommand());
18334
18230
  program2.addCommand(sourcesCommand());
18335
- program2.addCommand(suggestCommand());
18336
18231
  program2.addCommand(telemetryCommand());
18337
18232
  program2.addCommand(topicsCommand());
18338
18233
  program2.addCommand(threadsCommand());
@@ -18453,4 +18348,4 @@ execute().catch((err) => {
18453
18348
  process.exit(1);
18454
18349
  });
18455
18350
 
18456
- //# debugId=06fcd05b-5d4d-0298-6475-6e2164756e21
18351
+ //# debugId=1a1d772d-8140-9eda-6475-6e2164756e21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/cli",
3
- "version": "0.51.1",
3
+ "version": "0.52.0",
4
4
  "type": "module",
5
5
  "description": "Dosu CLI - Manage MCP servers for AI tools",
6
6
  "license": "MIT",