@dosu/cli 0.64.2 → 0.65.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.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/bin/dosu.js +602 -287
  3. package/package.json +1 -1
package/bin/dosu.js CHANGED
@@ -1083,7 +1083,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
1083
1083
  function getVersionString() {
1084
1084
  return `v${VERSION}`;
1085
1085
  }
1086
- var VERSION = "0.64.2", INSTALL_CHANNEL = "npm";
1086
+ var VERSION = "0.65.1", INSTALL_CHANNEL = "npm";
1087
1087
 
1088
1088
  // src/debug/logger.ts
1089
1089
  import {
@@ -6874,7 +6874,7 @@ var init_dist4 = __esm(() => {
6874
6874
  });
6875
6875
 
6876
6876
  // src/client/contract.ts
6877
- var CLI_CONTRACT_HASH = "a6e002dff58e";
6877
+ var CLI_CONTRACT_HASH = "dd33222d64a5";
6878
6878
 
6879
6879
  // src/client/trpc.ts
6880
6880
  function createTypedClient(config) {
@@ -11684,30 +11684,6 @@ ${page.body}`);
11684
11684
  }
11685
11685
  console.log(import_picocolors16.default.green(`Document restored to version ${opts.revision}.`));
11686
11686
  });
11687
- cmd.command("generate").description("Generate a document using AI").requiredOption("--title <title>", "Document title").option("--instructions <text>", "Custom generation instructions").option("--json", "Output as JSON").action(async (opts) => {
11688
- const cfg = requireConfig5();
11689
- const client = createTypedClient(cfg);
11690
- const ksId = await getKnowledgeStoreId(client, cfg.active_account.target.space_id);
11691
- const result = await backendPost2("/doc/generate", requireAPIKey(cfg), {
11692
- knowledge_store_id: ksId,
11693
- title: opts.title,
11694
- instructions: opts.instructions
11695
- });
11696
- if (opts.json) {
11697
- printResult(result, opts);
11698
- return;
11699
- }
11700
- console.log(import_picocolors16.default.green("Document generation started."));
11701
- });
11702
- cmd.command("auto-tag").description("Auto-tag a document using AI").argument("<id>", "Page ID").option("--json", "Output as JSON").action(async (id, opts) => {
11703
- const cfg = requireConfig5();
11704
- const result = await backendPost2("/doc/auto-tag", requireAPIKey(cfg), { page_id: id });
11705
- if (opts.json) {
11706
- printResult(result, opts);
11707
- return;
11708
- }
11709
- console.log(import_picocolors16.default.green("Auto-tagging started."));
11710
- });
11711
11687
  cmd.command("import").description("Import documents from an external platform").addArgument(new Argument("<platform>", "Import platform").choices([...IMPORT_PLATFORMS])).requiredOption("--files <ids>", "Comma-separated file/page IDs to import").option("--json", "Output as JSON").action(async (platform, opts) => {
11712
11688
  const cfg = requireConfig5();
11713
11689
  const client = createTypedClient(cfg);
@@ -11854,11 +11830,91 @@ var init_docs = __esm(() => {
11854
11830
  import_picocolors16 = __toESM(require_picocolors(), 1);
11855
11831
  });
11856
11832
 
11833
+ // src/commands/slack-channel-resolve.ts
11834
+ function channelLabel(channel) {
11835
+ const name = channel.name ? `#${channel.name}` : channel.channel_id;
11836
+ return channel.team_name ? `${name} (${channel.team_name})` : name;
11837
+ }
11838
+ async function listAllChannels(client, orgId, search, json) {
11839
+ const channels = [];
11840
+ let cursor = null;
11841
+ let pages = 0;
11842
+ do {
11843
+ const page = await client.slackChannel.listPaged.query({
11844
+ orgId,
11845
+ limit: PAGE_SIZE,
11846
+ ...search !== undefined && { search },
11847
+ ...cursor && { cursor }
11848
+ });
11849
+ channels.push(...page.items);
11850
+ cursor = page.nextCursor;
11851
+ pages += 1;
11852
+ if (cursor && !json && pages % PROGRESS_EVERY_PAGES === 0) {
11853
+ console.error(import_picocolors17.default.dim(`Scanned ${channels.length} Slack channels…`));
11854
+ }
11855
+ } while (cursor);
11856
+ return channels;
11857
+ }
11858
+ function printCandidates(candidates) {
11859
+ const shown = candidates.slice(0, MAX_CANDIDATES);
11860
+ for (const c of shown) {
11861
+ const name = c.name ? `#${c.name}` : "-";
11862
+ console.error(` ${c.id} ${c.channel_id} ${name} ${c.team_name ?? "-"}`);
11863
+ }
11864
+ if (candidates.length > shown.length) {
11865
+ console.error(import_picocolors17.default.dim(` …and ${candidates.length - shown.length} more.`));
11866
+ }
11867
+ }
11868
+ async function resolveChannel(client, orgId, input, arg, json) {
11869
+ const value = input.trim();
11870
+ if (isUuid(value))
11871
+ return { id: value, channel: null };
11872
+ if (SLACK_CHANNEL_ID_RE.test(value)) {
11873
+ const match = (await listAllChannels(client, orgId, undefined, json)).find((c) => c.channel_id === value);
11874
+ if (!match) {
11875
+ console.error(import_picocolors17.default.red(`No Slack channel with ID ${value} in this organization.`));
11876
+ console.error("Run `dosu integrations slack-channels` to list channels, or pass a name.");
11877
+ process.exit(1);
11878
+ }
11879
+ return { id: match.id, channel: match };
11880
+ }
11881
+ const name = value.replace(/^#/, "");
11882
+ if (!name) {
11883
+ console.error(import_picocolors17.default.red(`${arg.name} must not be empty.`));
11884
+ process.exit(1);
11885
+ }
11886
+ const candidates = await listAllChannels(client, orgId, name, json);
11887
+ const exact = candidates.filter((c) => c.name?.toLowerCase() === name.toLowerCase());
11888
+ if (exact.length === 1)
11889
+ return { id: exact[0].id, channel: exact[0] };
11890
+ if (exact.length === 0) {
11891
+ console.error(import_picocolors17.default.red(`No Slack channel named #${name} in this organization.`));
11892
+ } else {
11893
+ console.error(import_picocolors17.default.red(`${exact.length} Slack channels are named #${name} (in different workspaces).`));
11894
+ }
11895
+ const shown = exact.length > 0 ? exact : candidates;
11896
+ if (shown.length > 0) {
11897
+ console.error(exact.length > 0 ? "Matches:" : "Similar channels:");
11898
+ printCandidates(shown);
11899
+ }
11900
+ console.error(`Pass the channel's UUID with ${arg.uuidUsage}.`);
11901
+ process.exit(1);
11902
+ }
11903
+ var import_picocolors17, SLACK_CHANNEL_ID_RE, PAGE_SIZE = 100, PROGRESS_EVERY_PAGES = 10, MAX_CANDIDATES = 10;
11904
+ var init_slack_channel_resolve = __esm(() => {
11905
+ init_arguments();
11906
+ import_picocolors17 = __toESM(require_picocolors(), 1);
11907
+ SLACK_CHANNEL_ID_RE = /^[CG][A-Z0-9]{8,}$/;
11908
+ });
11909
+
11857
11910
  // src/commands/integrations.ts
11911
+ function shellQuote(value) {
11912
+ return /^[\w.-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
11913
+ }
11858
11914
  function requireConfig6() {
11859
11915
  const cfg = requireLoginConfig();
11860
11916
  if (!cfg.active_account?.target?.org_id) {
11861
- console.error(import_picocolors17.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
11917
+ console.error(import_picocolors18.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
11862
11918
  process.exit(1);
11863
11919
  }
11864
11920
  return cfg;
@@ -11895,7 +11951,7 @@ function integrationsCommand() {
11895
11951
  }
11896
11952
  printTable(["Platform", "Status"], results.map((r) => [
11897
11953
  r.platform,
11898
- r.connected === null ? import_picocolors17.default.dim("status unavailable") : r.connected ? import_picocolors17.default.green("connected") : import_picocolors17.default.dim("not connected")
11954
+ r.connected === null ? import_picocolors18.default.dim("status unavailable") : r.connected ? import_picocolors18.default.green("connected") : import_picocolors18.default.dim("not connected")
11899
11955
  ]), { rawData: results });
11900
11956
  });
11901
11957
  cmd.command("status").description("Check connection status of a specific platform").addArgument(new Argument("<platform>", "Integration platform").choices([...DISPLAY_PLATFORMS])).option("--json", "Output as JSON").action(async (platform, opts) => {
@@ -11907,41 +11963,64 @@ function integrationsCommand() {
11907
11963
  printResult({ platform, connected: null, note: "connection status unavailable via CLI" }, opts);
11908
11964
  return;
11909
11965
  }
11910
- console.log(`${platform}: ${import_picocolors17.default.dim("connection status unavailable via CLI")}`);
11966
+ console.log(`${platform}: ${import_picocolors18.default.dim("connection status unavailable via CLI")}`);
11911
11967
  return;
11912
11968
  }
11913
11969
  if (opts.json) {
11914
11970
  printResult({ platform, connected, connection }, opts);
11915
11971
  return;
11916
11972
  }
11917
- console.log(`${platform}: ${connected ? import_picocolors17.default.green("connected") : import_picocolors17.default.dim("not connected")}`);
11973
+ console.log(`${platform}: ${connected ? import_picocolors18.default.green("connected") : import_picocolors18.default.dim("not connected")}`);
11918
11974
  });
11919
- cmd.command("slack-channels").description("List Slack channels").option("--json", "Output as JSON").action(async (opts) => {
11975
+ cmd.command("slack-channels").description("List Slack channels (DMs excluded), 50 per page by default").option("--search <term>", "Only channels whose name contains <term>", boundedText(200)).addOption(new Option("--limit <n>", `Channels per page (1-${MAX_CHANNEL_PAGE})`).argParser(positiveIntegerAtMost(MAX_CHANNEL_PAGE)).conflicts("all")).addOption(new Option("--cursor <uuid>", "Continue after this channel (the nextCursor of a page)").argParser(uuid).conflicts("all")).option("--all", "List every channel instead of one page").option("--json", "Output as JSON: {items, nextCursor} (nextCursor is null with --all)").action(async (opts) => {
11920
11976
  const cfg = requireConfig6();
11921
11977
  const client = createTypedClient(cfg);
11922
- const channels = await client.slackChannel.getAll.query(cfg.active_account.target.org_id);
11978
+ const orgId = cfg.active_account.target.org_id;
11979
+ const search = opts.search?.trim() || undefined;
11980
+ let page;
11981
+ if (opts.all) {
11982
+ const items = await listAllChannels(client, orgId, search, opts.json);
11983
+ page = { items, nextCursor: null };
11984
+ if (items.length > ALL_CHANNELS_WARN_AT) {
11985
+ console.error(import_picocolors18.default.yellow(`Listed ${items.length} channels. Use --search <term> to narrow the list.`));
11986
+ }
11987
+ } else {
11988
+ page = await client.slackChannel.listPaged.query({
11989
+ orgId,
11990
+ limit: opts.limit ?? DEFAULT_CHANNEL_PAGE,
11991
+ ...search && { search },
11992
+ ...opts.cursor && { cursor: opts.cursor }
11993
+ });
11994
+ }
11923
11995
  if (opts.json) {
11924
- printResult(channels, opts);
11996
+ printResult(page, opts);
11925
11997
  return;
11926
11998
  }
11927
- if (!channels || channels.length === 0) {
11928
- console.log(import_picocolors17.default.dim("No Slack channels found."));
11999
+ if (page.items.length === 0) {
12000
+ console.log(import_picocolors18.default.dim(search ? `No Slack channels match "${search}".` : "No Slack channels found."));
11929
12001
  return;
11930
12002
  }
11931
- printTable(["ID", "Name"], channels.map((c) => [
11932
- c.channel_id,
11933
- c.name ?? "(unnamed)"
11934
- ]), { rawData: channels });
12003
+ printTable(["UUID", "Slack ID", "Name", "Workspace"], page.items.map((c) => [c.id, c.channel_id, c.name ?? "(unnamed)", c.team_name ?? "-"]));
12004
+ if (page.nextCursor) {
12005
+ const next = [
12006
+ "dosu integrations slack-channels",
12007
+ search && `--search ${shellQuote(search)}`,
12008
+ opts.limit && `--limit ${opts.limit}`,
12009
+ `--cursor ${page.nextCursor}`
12010
+ ].filter(Boolean);
12011
+ console.log(import_picocolors18.default.dim(`More channels: ${next.join(" ")} (or --all)`));
12012
+ }
11935
12013
  });
11936
- cmd.command("slack-join").description("Join a Slack channel").argument("<channel-id>", "Slack channel ID").option("--json", "Output as JSON").action(async (channelId, opts) => {
12014
+ cmd.command("slack-join").description("Join a Slack channel").argument("<channel>", "Channel UUID, Slack channel ID (C… / G…), or #name").option("--json", "Output as JSON").action(async (channelId, opts) => {
11937
12015
  const cfg = requireConfig6();
11938
12016
  const client = createTypedClient(cfg);
11939
- await client.slackChannel.join.mutate(channelId);
12017
+ const { id, channel } = await resolveChannel(client, cfg.active_account.target.org_id, channelId, { name: "<channel>", uuidUsage: "`dosu integrations slack-join <uuid>`" }, opts.json);
12018
+ await client.slackChannel.join.mutate(id);
11940
12019
  if (opts.json) {
11941
- printResult({ success: true, channelId }, opts);
12020
+ printResult({ success: true, channelId, id, channel }, opts);
11942
12021
  return;
11943
12022
  }
11944
- console.log(import_picocolors17.default.green(`Joined Slack channel ${channelId}.`));
12023
+ console.log(import_picocolors18.default.green(`Joined ${channel ? channelLabel(channel) : `Slack channel ${id}`}.`));
11945
12024
  });
11946
12025
  cmd.command("github-collaborators").description("List GitHub repository collaborators").addArgument(new Argument("<repository-id>", "Numeric GitHub repository ID").argParser(positiveInteger)).option("--json", "Output as JSON").action(async (repositoryId, opts) => {
11947
12026
  const cfg = requireConfig6();
@@ -11952,21 +12031,22 @@ function integrationsCommand() {
11952
12031
  return;
11953
12032
  }
11954
12033
  if (!collaborators || collaborators.length === 0) {
11955
- console.log(import_picocolors17.default.dim("No collaborators found."));
12034
+ console.log(import_picocolors18.default.dim("No collaborators found."));
11956
12035
  return;
11957
12036
  }
11958
12037
  printTable(["Username", "Name", "Email"], collaborators.map((c) => [c.user_name ?? "-", c.full_name ?? "-", c.email ?? "-"]), { rawData: collaborators });
11959
12038
  });
11960
12039
  return cmd;
11961
12040
  }
11962
- var import_picocolors17, DISPLAY_PLATFORMS, NANGO_PROBES;
12041
+ var import_picocolors18, DEFAULT_CHANNEL_PAGE = 50, MAX_CHANNEL_PAGE = 100, ALL_CHANNELS_WARN_AT = 500, DISPLAY_PLATFORMS, NANGO_PROBES;
11963
12042
  var init_integrations = __esm(() => {
11964
12043
  init_commander();
11965
12044
  init_trpc();
11966
12045
  init_arguments();
11967
12046
  init_auth();
11968
12047
  init_output();
11969
- import_picocolors17 = __toESM(require_picocolors(), 1);
12048
+ init_slack_channel_resolve();
12049
+ import_picocolors18 = __toESM(require_picocolors(), 1);
11970
12050
  DISPLAY_PLATFORMS = [
11971
12051
  "github",
11972
12052
  "gitlab",
@@ -14182,7 +14262,7 @@ var init_conflicts = __esm(() => {
14182
14262
  });
14183
14263
 
14184
14264
  // src/telemetry/debug-id.ts
14185
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "69ea37d3-8fb0-10ad-6475-6e2164756e21";
14265
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "274ecbf7-23f0-dedc-6475-6e2164756e21";
14186
14266
 
14187
14267
  // src/telemetry/telemetry.ts
14188
14268
  import { randomUUID as randomUUID2 } from "node:crypto";
@@ -15185,7 +15265,7 @@ function resolveAgents(ids, all, get) {
15185
15265
  if (ids.length === 0) {
15186
15266
  const installed = all().filter((agent) => agent.isInstalled());
15187
15267
  if (installed.length === 0) {
15188
- console.log(import_picocolors18.default.dim("No supported agents detected on this machine."));
15268
+ console.log(import_picocolors19.default.dim("No supported agents detected on this machine."));
15189
15269
  }
15190
15270
  return installed;
15191
15271
  }
@@ -15193,7 +15273,7 @@ function resolveAgents(ids, all, get) {
15193
15273
  for (const id of ids) {
15194
15274
  const agent = get(id.toLowerCase());
15195
15275
  if (!agent) {
15196
- console.error(import_picocolors18.default.red(`unknown agent '${id}'. Supported: ${all().map((a) => a.id()).join(", ")}`));
15276
+ console.error(import_picocolors19.default.red(`unknown agent '${id}'. Supported: ${all().map((a) => a.id()).join(", ")}`));
15197
15277
  process.exitCode = 1;
15198
15278
  return [];
15199
15279
  }
@@ -15201,9 +15281,9 @@ function resolveAgents(ids, all, get) {
15201
15281
  }
15202
15282
  return agents;
15203
15283
  }
15204
- var import_picocolors18;
15284
+ var import_picocolors19;
15205
15285
  var init_agent_select = __esm(() => {
15206
- import_picocolors18 = __toESM(require_picocolors(), 1);
15286
+ import_picocolors19 = __toESM(require_picocolors(), 1);
15207
15287
  });
15208
15288
 
15209
15289
  // src/incognito/agents.ts
@@ -15318,10 +15398,10 @@ function incognitoCommand() {
15318
15398
  return;
15319
15399
  }
15320
15400
  for (const row of rows) {
15321
- const state = !row.installed ? import_picocolors19.default.dim("not installed") : row.enabled ? import_picocolors19.default.green("enabled") : "disabled";
15401
+ const state = !row.installed ? import_picocolors20.default.dim("not installed") : row.enabled ? import_picocolors20.default.green("enabled") : "disabled";
15322
15402
  console.log(` ${row.agent.padEnd(8)} ${row.name.padEnd(14)} ${state}`);
15323
15403
  }
15324
- console.log(import_picocolors19.default.dim(`
15404
+ console.log(import_picocolors20.default.dim(`
15325
15405
  Use 'dosu knowledge incognito enable|disable [agent...]' to change these.
15326
15406
  ` + `Inside a session, run /${INCOGNITO_COMMAND_NAME} to keep that session out of studying.`));
15327
15407
  });
@@ -15350,17 +15430,17 @@ Use 'dosu knowledge incognito enable|disable [agent...]' to change these.
15350
15430
  return cmd;
15351
15431
  }
15352
15432
  function reportFailure(agentName, err) {
15353
- console.error(import_picocolors19.default.red(`✗ ${agentName}: ${err instanceof Error ? err.message : String(err)}`));
15433
+ console.error(import_picocolors20.default.red(`✗ ${agentName}: ${err instanceof Error ? err.message : String(err)}`));
15354
15434
  process.exitCode = 1;
15355
15435
  }
15356
- var import_picocolors19;
15436
+ var import_picocolors20;
15357
15437
  var init_knowledge_incognito = __esm(() => {
15358
15438
  init_commander();
15359
15439
  init_agents3();
15360
15440
  init_incognito();
15361
15441
  init_agent_select();
15362
15442
  init_output();
15363
- import_picocolors19 = __toESM(require_picocolors(), 1);
15443
+ import_picocolors20 = __toESM(require_picocolors(), 1);
15364
15444
  });
15365
15445
 
15366
15446
  // src/statusline/agents.ts
@@ -15496,19 +15576,19 @@ function statuslineCommand2(renderDeps = {}) {
15496
15576
  return;
15497
15577
  }
15498
15578
  for (const row of rows) {
15499
- const state = !row.installed ? import_picocolors20.default.dim("not installed") : row.enabled ? import_picocolors20.default.green("enabled") : "disabled";
15579
+ const state = !row.installed ? import_picocolors21.default.dim("not installed") : row.enabled ? import_picocolors21.default.green("enabled") : "disabled";
15500
15580
  console.log(` ${row.agent.padEnd(8)} ${row.name.padEnd(14)} ${state}`);
15501
15581
  if (row.note)
15502
- console.log(import_picocolors20.default.yellow(` ${row.note}`));
15582
+ console.log(import_picocolors21.default.yellow(` ${row.note}`));
15503
15583
  }
15504
- console.log(import_picocolors20.default.dim(`
15584
+ console.log(import_picocolors21.default.dim(`
15505
15585
  Use 'dosu knowledge statusline enable|disable [agent...]' to change these.
15506
15586
  ` + `States: ${Object.values(STATUSLINE_LABELS).join(" ")}`));
15507
15587
  });
15508
15588
  cmd.command("enable [agents...]").description("Install the Dosu status line for agents (default: all detected)").action((ids) => {
15509
15589
  const agents = resolveAgents(ids, allStatuslineAgents, getStatuslineAgent);
15510
15590
  if (agents.length > 0 && process.env.DOSU_DEV === "true") {
15511
- console.log(import_picocolors20.default.dim(`Dev mode: the status line will run ${statuslineCommand(agents[0].id())}`));
15591
+ console.log(import_picocolors21.default.dim(`Dev mode: the status line will run ${statuslineCommand(agents[0].id())}`));
15512
15592
  }
15513
15593
  for (const agent of agents) {
15514
15594
  try {
@@ -15517,8 +15597,8 @@ Use 'dosu knowledge statusline enable|disable [agent...]' to change these.
15517
15597
  } catch (err) {
15518
15598
  if (err instanceof StatuslineConflictError) {
15519
15599
  console.log(`– ${agent.name()} · already has a status line (${err.existingCommand}); left as is.`);
15520
- console.log(import_picocolors20.default.dim(" To show Dosu alongside it, add to your script:"));
15521
- console.log(import_picocolors20.default.dim(` ${err.suggestion}`));
15600
+ console.log(import_picocolors21.default.dim(" To show Dosu alongside it, add to your script:"));
15601
+ console.log(import_picocolors21.default.dim(` ${err.suggestion}`));
15522
15602
  continue;
15523
15603
  }
15524
15604
  reportFailure2(agent.name(), err);
@@ -15542,10 +15622,10 @@ Use 'dosu knowledge statusline enable|disable [agent...]' to change these.
15542
15622
  }
15543
15623
  function reportFailure2(agentName, err) {
15544
15624
  const message = err instanceof Error ? err.message : String(err);
15545
- console.error(import_picocolors20.default.red(`✗ ${agentName}: ${message}`));
15625
+ console.error(import_picocolors21.default.red(`✗ ${agentName}: ${message}`));
15546
15626
  process.exitCode = 1;
15547
15627
  }
15548
- var import_picocolors20;
15628
+ var import_picocolors21;
15549
15629
  var init_knowledge_statusline = __esm(() => {
15550
15630
  init_commander();
15551
15631
  init_agents4();
@@ -15553,7 +15633,7 @@ var init_knowledge_statusline = __esm(() => {
15553
15633
  init_run2();
15554
15634
  init_agent_select();
15555
15635
  init_output();
15556
- import_picocolors20 = __toESM(require_picocolors(), 1);
15636
+ import_picocolors21 = __toESM(require_picocolors(), 1);
15557
15637
  });
15558
15638
 
15559
15639
  // src/report/backfill.ts
@@ -30345,8 +30425,8 @@ function ZX(e, t) {
30345
30425
  n.issues.push({ code: "custom", message: r, input: n.value });
30346
30426
  });
30347
30427
  }
30348
- function LI(e, t = pc21()) {
30349
- return e === "default" ? pc21() : ZX(e, t);
30428
+ function LI(e, t = pc22()) {
30429
+ return e === "default" ? pc22() : ZX(e, t);
30350
30430
  }
30351
30431
  function zS(e, { strictPolicyHelperKeys: t = false } = {}) {
30352
30432
  function n(o) {
@@ -30418,8 +30498,8 @@ function $I(e, t) {
30418
30498
  let a = (b, x) => {
30419
30499
  e({ path: b, message: `"${b}" is not a valid static settings payload: ${x ?? "failed validation"}. When delivered from an OS-admin policy source (MDM or the managed settings file), Claude Code will not start until this is fixed.`, startupFatal: true });
30420
30500
  }, c = (b) => {
30421
- let x = false, v, A = LI(b, pc21().optional().catch((U) => {
30422
- x = true, a(`policyHelpers.${b}.defaultSettings`, U.issues[0]?.message ?? s(pc21(), v && typeof v === "object" && !Array.isArray(v) ? v.defaultSettings : undefined));
30501
+ let x = false, v, A = LI(b, pc22().optional().catch((U) => {
30502
+ x = true, a(`policyHelpers.${b}.defaultSettings`, U.issues[0]?.message ?? s(pc22(), v && typeof v === "object" && !Array.isArray(v) ? v.defaultSettings : undefined));
30423
30503
  return;
30424
30504
  }));
30425
30505
  return st((U) => {
@@ -30442,7 +30522,7 @@ function $I(e, t) {
30442
30522
  return U === null ? undefined : U;
30443
30523
  }, A.optional()).catch((U) => {
30444
30524
  if (b === "default") {
30445
- a("policyHelpers.default", U.issues[0]?.message ?? s(pc21(), v));
30525
+ a("policyHelpers.default", U.issues[0]?.message ?? s(pc22(), v));
30446
30526
  return;
30447
30527
  }
30448
30528
  if (x)
@@ -30451,7 +30531,7 @@ function $I(e, t) {
30451
30531
  if (F && typeof F === "object" && !Array.isArray(F)) {
30452
30532
  let K = F, V = K.defaultSettings;
30453
30533
  if (V !== undefined && V !== null) {
30454
- let ne = pc21().safeParse(V);
30534
+ let ne = pc22().safeParse(V);
30455
30535
  if (ne.success) {
30456
30536
  let oe = K.outputBehavior, _e = oe === undefined || oe === null ? null : VX().safeParse(oe);
30457
30537
  if (_e && !_e.success) {
@@ -33100,7 +33180,7 @@ Wrap your summary in <summary></summary> tags.`, Tp, Vc, ua, Jt, Zn, yr, ms, ei,
33100
33180
  return a;
33101
33181
  }, nBe = 60000, KY, GY, QP, ZY, VY, A6e, k6e, Km, D6e, F6e, dJ, G6e, W6e, fJ, mJ, hJ, gJ, Zu, yJ, sI, bJ = (e, t, n, r) => {
33102
33182
  typeof sI.emitWarning === "function" ? sI.emitWarning(e, t, n, r) : console.error(`[${n}] ${t}: ${e}`);
33103
- }, pS, _J, Q6e = (e) => !yJ.has(e), PUt, zi = (e) => e && e === Math.floor(e) && e > 0 && isFinite(e), SJ = (e) => !zi(e) ? null : e <= Math.pow(2, 8) ? Uint8Array : e <= Math.pow(2, 16) ? Uint16Array : e <= Math.pow(2, 32) ? Uint32Array : e <= Number.MAX_SAFE_INTEGER ? Wm : null, Wm, fS, e3e = 8192, xJ, ic, n3e, qm, hS, RJ, TJ, i3e, CJ, kJ, Vm, Ju, gS, _S, OJ, d3e, PJ, p3e, Xu, yS, IJ, h3e = "[object Object]", g3e, _3e, DJ, y3e, b3e, bS, Zm, x3e, v3e, Qu, Yr, LJ, C3e, k3e, MJ, rs, NJ, UJ, jJ, $J, zJ, SS, HJ, N3e, BJ, U3e = 800, F3e = 16, j3e, KJ, z3e, ES, GJ, WJ, qJ, G3e, VJ, ZJ, YJ, JJ, Y3e, J3e, xS, XJ, ed, e9e, t9e, QJ, e8, o9e, t8, n8, r8, o8, a9e = "[object Boolean]", c9e = "[object Date]", l9e = "[object Map]", u9e = "[object Number]", d9e = "[object RegExp]", p9e = "[object Set]", f9e = "[object String]", m9e = "[object Symbol]", h9e = "[object ArrayBuffer]", g9e = "[object DataView]", _9e = "[object Float32Array]", y9e = "[object Float64Array]", b9e = "[object Int8Array]", S9e = "[object Int16Array]", E9e = "[object Int32Array]", x9e = "[object Uint8Array]", v9e = "[object Uint8ClampedArray]", w9e = "[object Uint16Array]", A9e = "[object Uint32Array]", s8, C9e = "[object Map]", i8, a8, R9e, c8, O9e = "[object Set]", l8, u8, I9e, d8, D9e = 1, L9e = 2, M9e = 4, p8 = "[object Arguments]", N9e = "[object Array]", U9e = "[object Boolean]", F9e = "[object Date]", j9e = "[object Error]", f8 = "[object Function]", $9e = "[object GeneratorFunction]", z9e = "[object Map]", H9e = "[object Number]", m8 = "[object Object]", B9e = "[object RegExp]", K9e = "[object Set]", G9e = "[object String]", W9e = "[object Symbol]", q9e = "[object WeakMap]", V9e = "[object ArrayBuffer]", Z9e = "[object DataView]", Y9e = "[object Float32Array]", J9e = "[object Float64Array]", X9e = "[object Int8Array]", Q9e = "[object Int16Array]", eZe = "[object Int32Array]", tZe = "[object Uint8Array]", nZe = "[object Uint8ClampedArray]", rZe = "[object Uint16Array]", oZe = "[object Uint32Array]", dt, h8, g8, _8, y8, cZe, lZe, b8, S8, E8, x8, w8, A8, wS, hZe = 1, gZe = 2, _Ze = 4, yZe, T8, AS, C8, xZe, vZe = "Expected a function", k8, R8, Ym, Jm, aI, P8, I8 = "OTEL_EXPORTER_OTLP_", L8, M8, CZe, cI, lI, kZe, uI, dI, RZe, pI, fI, mI, m1t, N8, U8, OZe, PZe, DZe, LZe, CS, td = () => _().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores"), kS, nd, hI = "_INVALID_PAIR_", RS, MZe, NZe, gI, Xm, G8, W8, I1t, D1t, q8, V8, Z8, Y8, UZe, J8, X8, F1t, W1t, q1t, Q8, eh, eX, tX, lc, tHt, nHt, rd, Hi, jZe = 300000, nX, $Ze, zZe, oX, sX, HZe, BZe, KZe, GZe, WZe, qZe, _I, VZe, OS, rHt, vI = 500, e5e = 32, fX, t5e, n5e, mX, r5e, o5e, os2, uc, aX, cX, SI, EI, hX, gX, AI, a5e, c5e = 1, xHt, l5e, u5e, d5e, p5e, f5e, m5e, _X, h5e, g5e = 16, _5e, y5e, yX, b5e, lX, S5e, E5e, bX, x5e, v5e, uX, w5e, A5e, SX, T5e, EX, C5e, k5e, R5e = 64, O5e, I5e, D5e, L5e, M5e, xX, od, bI, N5e, U5e = "Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host", j5e, vX, $5e, z5e, H5e, B5e, K5e, W5e, V5e, Z5e = 3, Y5e = 160, J5e, X5e = 'Bare source names resolve under metadata.pluginRoot, which this marketplace does not set (or sets to a path outside the marketplace root). Use a "./relative/path" source, or set metadata.pluginRoot to allow bare names.', nYe, vHt, dX = "[A-Za-z0-9][-A-Za-z0-9._]*", AX, wHt, AHt, rYe, oYe, sYe, THt, iYe, aYe, CHt, cYe, kHt, IS, lYe, CI, DS, RX, OX = "workspace", MHt, NHt, NS, hYe, II, UX, yYe, gBt, MI, NI, UI, FI, jS, $S, bYe, wYe, CYe = 'a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)', kYe = () => _().describe("Absolute path to the helper executable"), id = (e) => st((t) => t === null ? undefined : t, e.optional()).optional(), jX, FS, VX = () => q(["replace", "merge"]).describe("How the helper's managedSettings compose with the settings of the source that delivered this entry: 'replace' (default) — the output is the policy; 'merge' — the output is deep-merged over that source's own settings (helper keys win, arrays replace), so a failed helper costs only the delta"), RYe = (e) => (e === "windows" ? j("pwsh", { message: "interpreter must be 'pwsh' on windows ('sh' is not supported there)" }) : j("sh", { message: "interpreter must be 'sh' on macos/linux/wsl" })).describe("Fixed interpreter for `script`: 'sh' (/bin/sh) on macos/linux/wsl entries; 'pwsh' (PowerShell at its fixed install locations, never PATH) on the windows entry"), OYe = "exactly one of path/script must be configured", PYe = '"script" and "interpreter" must be configured together', IYe = "script must be ASCII-only on Windows (PowerShell decodes stdin with the console OEM code page); spell non-ASCII characters as escapes, e.g. [char]0x00E9", DYe = (e) => _({ message: "script must be a string" }).min(1, { message: "script must not be empty" }).max(65536, { message: "script must be at most 65536 characters" }).refine((t) => !t.includes("\x00"), { message: "script must not contain NUL bytes" }).refine((t) => bh(t), { message: "script must be valid UTF-8 (no lone surrogates)" }).refine((t) => e !== "windows" || !/[\u0080-\uffff]/.test(t), { message: IYe }).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)"), ss, jI, DI, US, pc21, UYe = 'Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)', _Bt, jYe, $X, zX, $Ye, ad, HX, r7 = "remote-settings-helper-consent", QYe, t2t, n2t, oJe, c7 = "com.anthropic.claudecode", rh = "HKLM\\SOFTWARE\\Policies\\ClaudeCode", oh = "HKCU\\SOFTWARE\\Policies\\ClaudeCode", Bi = "Settings", l7 = "/usr/bin/plutil", u7, d7 = 5000, BI = "/mnt/c/Windows/System32/reg.exe", cd = "/mnt/c/Program Files/ClaudeCode", Fs = "https://code.claude.com/docs/en", uJe, dJe, j2t, mJe, gJe, S7, I7, VJe, M7, U7, F7, h8e, Ki, g8e, w8e, A8e, N8e, $8e;
33183
+ }, pS, _J, Q6e = (e) => !yJ.has(e), PUt, zi = (e) => e && e === Math.floor(e) && e > 0 && isFinite(e), SJ = (e) => !zi(e) ? null : e <= Math.pow(2, 8) ? Uint8Array : e <= Math.pow(2, 16) ? Uint16Array : e <= Math.pow(2, 32) ? Uint32Array : e <= Number.MAX_SAFE_INTEGER ? Wm : null, Wm, fS, e3e = 8192, xJ, ic, n3e, qm, hS, RJ, TJ, i3e, CJ, kJ, Vm, Ju, gS, _S, OJ, d3e, PJ, p3e, Xu, yS, IJ, h3e = "[object Object]", g3e, _3e, DJ, y3e, b3e, bS, Zm, x3e, v3e, Qu, Yr, LJ, C3e, k3e, MJ, rs, NJ, UJ, jJ, $J, zJ, SS, HJ, N3e, BJ, U3e = 800, F3e = 16, j3e, KJ, z3e, ES, GJ, WJ, qJ, G3e, VJ, ZJ, YJ, JJ, Y3e, J3e, xS, XJ, ed, e9e, t9e, QJ, e8, o9e, t8, n8, r8, o8, a9e = "[object Boolean]", c9e = "[object Date]", l9e = "[object Map]", u9e = "[object Number]", d9e = "[object RegExp]", p9e = "[object Set]", f9e = "[object String]", m9e = "[object Symbol]", h9e = "[object ArrayBuffer]", g9e = "[object DataView]", _9e = "[object Float32Array]", y9e = "[object Float64Array]", b9e = "[object Int8Array]", S9e = "[object Int16Array]", E9e = "[object Int32Array]", x9e = "[object Uint8Array]", v9e = "[object Uint8ClampedArray]", w9e = "[object Uint16Array]", A9e = "[object Uint32Array]", s8, C9e = "[object Map]", i8, a8, R9e, c8, O9e = "[object Set]", l8, u8, I9e, d8, D9e = 1, L9e = 2, M9e = 4, p8 = "[object Arguments]", N9e = "[object Array]", U9e = "[object Boolean]", F9e = "[object Date]", j9e = "[object Error]", f8 = "[object Function]", $9e = "[object GeneratorFunction]", z9e = "[object Map]", H9e = "[object Number]", m8 = "[object Object]", B9e = "[object RegExp]", K9e = "[object Set]", G9e = "[object String]", W9e = "[object Symbol]", q9e = "[object WeakMap]", V9e = "[object ArrayBuffer]", Z9e = "[object DataView]", Y9e = "[object Float32Array]", J9e = "[object Float64Array]", X9e = "[object Int8Array]", Q9e = "[object Int16Array]", eZe = "[object Int32Array]", tZe = "[object Uint8Array]", nZe = "[object Uint8ClampedArray]", rZe = "[object Uint16Array]", oZe = "[object Uint32Array]", dt, h8, g8, _8, y8, cZe, lZe, b8, S8, E8, x8, w8, A8, wS, hZe = 1, gZe = 2, _Ze = 4, yZe, T8, AS, C8, xZe, vZe = "Expected a function", k8, R8, Ym, Jm, aI, P8, I8 = "OTEL_EXPORTER_OTLP_", L8, M8, CZe, cI, lI, kZe, uI, dI, RZe, pI, fI, mI, m1t, N8, U8, OZe, PZe, DZe, LZe, CS, td = () => _().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores"), kS, nd, hI = "_INVALID_PAIR_", RS, MZe, NZe, gI, Xm, G8, W8, I1t, D1t, q8, V8, Z8, Y8, UZe, J8, X8, F1t, W1t, q1t, Q8, eh, eX, tX, lc, tHt, nHt, rd, Hi, jZe = 300000, nX, $Ze, zZe, oX, sX, HZe, BZe, KZe, GZe, WZe, qZe, _I, VZe, OS, rHt, vI = 500, e5e = 32, fX, t5e, n5e, mX, r5e, o5e, os2, uc, aX, cX, SI, EI, hX, gX, AI, a5e, c5e = 1, xHt, l5e, u5e, d5e, p5e, f5e, m5e, _X, h5e, g5e = 16, _5e, y5e, yX, b5e, lX, S5e, E5e, bX, x5e, v5e, uX, w5e, A5e, SX, T5e, EX, C5e, k5e, R5e = 64, O5e, I5e, D5e, L5e, M5e, xX, od, bI, N5e, U5e = "Archive URLs must use https:// and must not point at a loopback, link-local, or cloud-metadata host", j5e, vX, $5e, z5e, H5e, B5e, K5e, W5e, V5e, Z5e = 3, Y5e = 160, J5e, X5e = 'Bare source names resolve under metadata.pluginRoot, which this marketplace does not set (or sets to a path outside the marketplace root). Use a "./relative/path" source, or set metadata.pluginRoot to allow bare names.', nYe, vHt, dX = "[A-Za-z0-9][-A-Za-z0-9._]*", AX, wHt, AHt, rYe, oYe, sYe, THt, iYe, aYe, CHt, cYe, kHt, IS, lYe, CI, DS, RX, OX = "workspace", MHt, NHt, NS, hYe, II, UX, yYe, gBt, MI, NI, UI, FI, jS, $S, bYe, wYe, CYe = 'a .ps1 path must not contain "[", "]", "`", "*", or "?" on Windows (PowerShell resolves them as wildcard syntax)', kYe = () => _().describe("Absolute path to the helper executable"), id = (e) => st((t) => t === null ? undefined : t, e.optional()).optional(), jX, FS, VX = () => q(["replace", "merge"]).describe("How the helper's managedSettings compose with the settings of the source that delivered this entry: 'replace' (default) — the output is the policy; 'merge' — the output is deep-merged over that source's own settings (helper keys win, arrays replace), so a failed helper costs only the delta"), RYe = (e) => (e === "windows" ? j("pwsh", { message: "interpreter must be 'pwsh' on windows ('sh' is not supported there)" }) : j("sh", { message: "interpreter must be 'sh' on macos/linux/wsl" })).describe("Fixed interpreter for `script`: 'sh' (/bin/sh) on macos/linux/wsl entries; 'pwsh' (PowerShell at its fixed install locations, never PATH) on the windows entry"), OYe = "exactly one of path/script must be configured", PYe = '"script" and "interpreter" must be configured together', IYe = "script must be ASCII-only on Windows (PowerShell decodes stdin with the console OEM code page); spell non-ASCII characters as escapes, e.g. [char]0x00E9", DYe = (e) => _({ message: "script must be a string" }).min(1, { message: "script must not be empty" }).max(65536, { message: "script must be at most 65536 characters" }).refine((t) => !t.includes("\x00"), { message: "script must not contain NUL bytes" }).refine((t) => bh(t), { message: "script must be valid UTF-8 (no lone surrogates)" }).refine((t) => e !== "windows" || !/[\u0080-\uffff]/.test(t), { message: IYe }).describe("Inline helper script, delivered to the fixed interpreter over stdin (never written to disk)"), ss, jI, DI, US, pc22, UYe = 'Entry must carry "path" (a helper executable) or "script" + "interpreter" (an inline helper), and/or "defaultSettings" (a static settings payload)', _Bt, jYe, $X, zX, $Ye, ad, HX, r7 = "remote-settings-helper-consent", QYe, t2t, n2t, oJe, c7 = "com.anthropic.claudecode", rh = "HKLM\\SOFTWARE\\Policies\\ClaudeCode", oh = "HKCU\\SOFTWARE\\Policies\\ClaudeCode", Bi = "Settings", l7 = "/usr/bin/plutil", u7, d7 = 5000, BI = "/mnt/c/Windows/System32/reg.exe", cd = "/mnt/c/Program Files/ClaudeCode", Fs = "https://code.claude.com/docs/en", uJe, dJe, j2t, mJe, gJe, S7, I7, VJe, M7, U7, F7, h8e, Ki, g8e, w8e, A8e, N8e, $8e;
33104
33184
  var init_sdk = __esm(() => {
33105
33185
  PQ = Object.create;
33106
33186
  ({ getPrototypeOf: IQ, defineProperty: QS, getOwnPropertyNames: DQ } = Object);
@@ -53807,7 +53887,7 @@ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resour
53807
53887
  jI = [...ss, "default"];
53808
53888
  DI = ["path", "script", "interpreter", "outputBehavior", "timeoutMs", "refreshIntervalMs", "defaultSettings"];
53809
53889
  US = ["managedSettings", "appendSystemPrompt"];
53810
- pc21 = M(() => X(_(), Ae()).superRefine((e, t) => {
53890
+ pc22 = M(() => X(_(), Ae()).superRefine((e, t) => {
53811
53891
  for (let n of ["policyHelper", "policyHelpers"])
53812
53892
  if (e[n] !== undefined && e[n] !== null)
53813
53893
  t.addIssue({ code: "custom", message: `must not contain "${n}" — the default payload is applied as managed settings and cannot configure further policy helpers` });
@@ -53821,7 +53901,7 @@ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resour
53821
53901
  if (e[n] !== undefined && e[n] !== null)
53822
53902
  t.addIssue({ code: "custom", message: `must not contain "${n}" — a static payload is the VALUE of a policyHelpers key (a managed-settings object), never another policyHelpers map; don't paste the map or its "${n}" line inside the slot` });
53823
53903
  }));
53824
- _Bt = M(() => ZX("linux", pc21()));
53904
+ _Bt = M(() => ZX("linux", pc22()));
53825
53905
  jYe = M(() => C(Object.fromEntries(jI.map((e) => [e, st((t) => {
53826
53906
  if (t === null)
53827
53907
  return;
@@ -59074,7 +59154,7 @@ import { delimiter as delimiter4, join as join22 } from "node:path";
59074
59154
  function requireConfig7() {
59075
59155
  const cfg = requireLoginConfig();
59076
59156
  if (!cfg.active_account?.target?.org_id || !cfg.active_account?.target?.space_id) {
59077
- console.error(import_picocolors21.default.red("Missing org/space config. Run 'dosu setup' to reconfigure."));
59157
+ console.error(import_picocolors22.default.red("Missing org/space config. Run 'dosu setup' to reconfigure."));
59078
59158
  process.exit(1);
59079
59159
  }
59080
59160
  return cfg;
@@ -59090,7 +59170,7 @@ function knowledgeCommand() {
59090
59170
  });
59091
59171
  const dataSourceIds = dataSources.map((ds) => ds.id).filter((id) => id !== null);
59092
59172
  if (dataSourceIds.length === 0) {
59093
- console.log(import_picocolors21.default.dim("No data sources connected. Add data sources in the Dosu dashboard."));
59173
+ console.log(import_picocolors22.default.dim("No data sources connected. Add data sources in the Dosu dashboard."));
59094
59174
  return;
59095
59175
  }
59096
59176
  const data = await client.search.getMentions.query({
@@ -59104,7 +59184,7 @@ function knowledgeCommand() {
59104
59184
  return;
59105
59185
  }
59106
59186
  if (!results || results.length === 0) {
59107
- console.log(import_picocolors21.default.dim("No results found."));
59187
+ console.log(import_picocolors22.default.dim("No results found."));
59108
59188
  return;
59109
59189
  }
59110
59190
  const limited = results.slice(0, opts.limit);
@@ -59113,7 +59193,7 @@ function knowledgeCommand() {
59113
59193
  r.entity_type ?? "-"
59114
59194
  ]), { json: false, rawData: limited });
59115
59195
  if (results.length > opts.limit) {
59116
- console.log(import_picocolors21.default.dim(`
59196
+ console.log(import_picocolors22.default.dim(`
59117
59197
  ${results.length - opts.limit} more results not shown.`));
59118
59198
  }
59119
59199
  });
@@ -59126,10 +59206,10 @@ ${results.length - opts.limit} more results not shown.`));
59126
59206
  return;
59127
59207
  }
59128
59208
  if (!store) {
59129
- console.log(import_picocolors21.default.dim("No knowledge store found for this deployment."));
59209
+ console.log(import_picocolors22.default.dim("No knowledge store found for this deployment."));
59130
59210
  return;
59131
59211
  }
59132
- console.log(import_picocolors21.default.bold("Knowledge Store"));
59212
+ console.log(import_picocolors22.default.bold("Knowledge Store"));
59133
59213
  console.log(` ID: ${store.id}`);
59134
59214
  console.log(` Space ID: ${store.space_id}`);
59135
59215
  });
@@ -59160,9 +59240,9 @@ ${results.length - opts.limit} more results not shown.`));
59160
59240
  if (!first)
59161
59241
  console.log();
59162
59242
  first = false;
59163
- console.log(import_picocolors21.default.bold(`${title} (${rows.length})`));
59243
+ console.log(import_picocolors22.default.bold(`${title} (${rows.length})`));
59164
59244
  if (rows.length === 0) {
59165
- console.log(import_picocolors21.default.dim(` ${emptyMsg}`));
59245
+ console.log(import_picocolors22.default.dim(` ${emptyMsg}`));
59166
59246
  return;
59167
59247
  }
59168
59248
  printTable(["Agent", stamp, "Project", "Session"], rows);
@@ -59327,14 +59407,14 @@ function formatAge(iso, now) {
59327
59407
  }
59328
59408
  function printSyncStatus(status, now = new Date) {
59329
59409
  if (status.running) {
59330
- console.log(`${import_picocolors21.default.green("●")} Sync running · pid ${status.pid}, started ${formatAge(status.startedAt ?? "", now)}.`);
59410
+ console.log(`${import_picocolors22.default.green("●")} Sync running · pid ${status.pid}, started ${formatAge(status.startedAt ?? "", now)}.`);
59331
59411
  } else if (status.staleLock) {
59332
- console.log(`${import_picocolors21.default.yellow("●")} Stale lock from pid ${status.pid} (process gone); syncs resume once it ages out.`);
59412
+ console.log(`${import_picocolors22.default.yellow("●")} Stale lock from pid ${status.pid} (process gone); syncs resume once it ages out.`);
59333
59413
  } else {
59334
59414
  console.log("○ No sync running.");
59335
59415
  }
59336
59416
  if (status.state.paused) {
59337
- console.log(import_picocolors21.default.yellow(" Studying paused: stopped by you. Resume from the Activity screen or run 'dosu knowledge sync'."));
59417
+ console.log(import_picocolors22.default.yellow(" Studying paused: stopped by you. Resume from the Activity screen or run 'dosu knowledge sync'."));
59338
59418
  }
59339
59419
  const wm = status.state.watermark;
59340
59420
  console.log(` Studied through: ${wm ? `${wm} (${formatAge(wm, now)})` : "nothing studied yet"}`);
@@ -59354,27 +59434,27 @@ function printSyncStatus(status, now = new Date) {
59354
59434
  }
59355
59435
  if (status.backoffUntil) {
59356
59436
  const n = status.state.consecutive_failures;
59357
- console.log(import_picocolors21.default.yellow(` Backing off after ${n} failure${n === 1 ? "" : "s"}; background syncs retry after ${status.backoffUntil}.`));
59437
+ console.log(import_picocolors22.default.yellow(` Backing off after ${n} failure${n === 1 ? "" : "s"}; background syncs retry after ${status.backoffUntil}.`));
59358
59438
  }
59359
59439
  if (status.state.last_refusal) {
59360
- console.log(import_picocolors21.default.yellow(` Studying paused: ${status.state.last_refusal.message} (${formatAge(status.state.last_refusal.at, now)})`));
59440
+ console.log(import_picocolors22.default.yellow(` Studying paused: ${status.state.last_refusal.message} (${formatAge(status.state.last_refusal.at, now)})`));
59361
59441
  }
59362
59442
  if (status.recentActivity.length > 0) {
59363
59443
  console.log(`
59364
59444
  Recent activity:`);
59365
59445
  for (const line of status.recentActivity) {
59366
- console.log(import_picocolors21.default.dim(` ${truncate(line, 160)}`));
59446
+ console.log(import_picocolors22.default.dim(` ${truncate(line, 160)}`));
59367
59447
  }
59368
59448
  }
59369
- console.log(import_picocolors21.default.dim(`
59449
+ console.log(import_picocolors22.default.dim(`
59370
59450
  Follow live with 'dosu logs --follow'.`));
59371
59451
  }
59372
59452
  function printSyncOutcome(outcome) {
59373
59453
  switch (outcome.status) {
59374
59454
  case "backlog": {
59375
- const inFlight = outcome.inFlightSessions > 0 ? import_picocolors21.default.dim(` (${outcome.inFlightSessions} more still in progress)`) : "";
59455
+ const inFlight = outcome.inFlightSessions > 0 ? import_picocolors22.default.dim(` (${outcome.inFlightSessions} more still in progress)`) : "";
59376
59456
  console.log(`✓ Scanned. ${outcome.readySessions} new session${outcome.readySessions === 1 ? "" : "s"} ready to study${inFlight}.`);
59377
- console.log(import_picocolors21.default.dim("Sign in with 'dosu setup' to enable studying."));
59457
+ console.log(import_picocolors22.default.dim("Sign in with 'dosu setup' to enable studying."));
59378
59458
  break;
59379
59459
  }
59380
59460
  case "studied": {
@@ -59382,21 +59462,21 @@ function printSyncOutcome(outcome) {
59382
59462
  const remaining = outcome.readySessions - (outcome.studiedSessions ?? 0);
59383
59463
  console.log(`✓ Studied ${outcome.studiedSessions} session${outcome.studiedSessions === 1 ? "" : "s"}, ${notes} suggested page${notes === 1 ? "" : "s"} created.`);
59384
59464
  if (remaining > 0) {
59385
- console.log(import_picocolors21.default.dim(`${remaining} more in the backlog; run sync again to continue.`));
59465
+ console.log(import_picocolors22.default.dim(`${remaining} more in the backlog; run sync again to continue.`));
59386
59466
  }
59387
59467
  break;
59388
59468
  }
59389
59469
  case "skipped-gateway": {
59390
- console.log(import_picocolors21.default.yellow(outcome.learner?.message ?? "Studying unavailable right now."));
59470
+ console.log(import_picocolors22.default.yellow(outcome.learner?.message ?? "Studying unavailable right now."));
59391
59471
  break;
59392
59472
  }
59393
59473
  case "mine-failed": {
59394
- console.error(import_picocolors21.default.red(outcome.learner?.message ?? "Study run failed."));
59474
+ console.error(import_picocolors22.default.red(outcome.learner?.message ?? "Study run failed."));
59395
59475
  process.exitCode = 1;
59396
59476
  break;
59397
59477
  }
59398
59478
  case "skipped-lock": {
59399
- console.log(import_picocolors21.default.dim("Skipped: another sync run is already in progress."));
59479
+ console.log(import_picocolors22.default.dim("Skipped: another sync run is already in progress."));
59400
59480
  break;
59401
59481
  }
59402
59482
  case "nothing-new": {
@@ -59405,16 +59485,16 @@ function printSyncOutcome(outcome) {
59405
59485
  break;
59406
59486
  }
59407
59487
  case "error": {
59408
- console.error(import_picocolors21.default.red(`Sync failed: ${outcome.error}`));
59488
+ console.error(import_picocolors22.default.red(`Sync failed: ${outcome.error}`));
59409
59489
  process.exitCode = 1;
59410
59490
  break;
59411
59491
  }
59412
59492
  case "skipped-backoff": {
59413
- console.log(import_picocolors21.default.dim("Skipped: a recent sync failed; waiting out the retry backoff."));
59493
+ console.log(import_picocolors22.default.dim("Skipped: a recent sync failed; waiting out the retry backoff."));
59414
59494
  break;
59415
59495
  }
59416
59496
  case "skipped-paused": {
59417
- console.log(import_picocolors21.default.dim("Skipped: studying is paused. Run 'dosu knowledge sync' to resume."));
59497
+ console.log(import_picocolors22.default.dim("Skipped: studying is paused. Run 'dosu knowledge sync' to resume."));
59418
59498
  break;
59419
59499
  }
59420
59500
  }
@@ -59447,22 +59527,22 @@ function hooksCommand() {
59447
59527
  return;
59448
59528
  }
59449
59529
  for (const row of rows) {
59450
- const state = !row.installed ? import_picocolors21.default.dim("not installed") : row.enabled ? import_picocolors21.default.green("enabled") : "disabled";
59530
+ const state = !row.installed ? import_picocolors22.default.dim("not installed") : row.enabled ? import_picocolors22.default.green("enabled") : "disabled";
59451
59531
  console.log(` ${row.agent.padEnd(8)} ${row.name.padEnd(14)} ${state}`);
59452
59532
  if (row.note)
59453
- console.log(import_picocolors21.default.yellow(` ${row.note}`));
59533
+ console.log(import_picocolors22.default.yellow(` ${row.note}`));
59454
59534
  }
59455
- console.log(import_picocolors21.default.dim(`
59535
+ console.log(import_picocolors22.default.dim(`
59456
59536
  Use 'dosu knowledge hooks enable|disable [agent...]' to change these.`));
59457
59537
  });
59458
59538
  cmd.command("enable [agents...]").description("Install the sync hook for agents (default: all detected)").action((ids) => {
59459
59539
  const agents = resolveHookAgents(ids);
59460
59540
  const devMode = process.env.DOSU_DEV === "true";
59461
59541
  if (agents.length > 0 && !devMode && !dosuOnPath()) {
59462
- console.log(import_picocolors21.default.yellow("Warning: 'dosu' is not on PATH; hooks run 'dosu knowledge sync' and will fail until it is."));
59542
+ console.log(import_picocolors22.default.yellow("Warning: 'dosu' is not on PATH; hooks run 'dosu knowledge sync' and will fail until it is."));
59463
59543
  }
59464
59544
  if (agents.length > 0 && devMode) {
59465
- console.log(import_picocolors21.default.dim(`Dev mode: hooks will run ${hookCommand()}`));
59545
+ console.log(import_picocolors22.default.dim(`Dev mode: hooks will run ${hookCommand()}`));
59466
59546
  }
59467
59547
  for (const agent of agents) {
59468
59548
  try {
@@ -59470,7 +59550,7 @@ Use 'dosu knowledge hooks enable|disable [agent...]' to change these.`));
59470
59550
  console.log(`✓ ${agent.name()} · hook enabled (${agent.configPath()})`);
59471
59551
  const note = agent.enableNote?.();
59472
59552
  if (note)
59473
- console.log(import_picocolors21.default.dim(` ${note}`));
59553
+ console.log(import_picocolors22.default.dim(` ${note}`));
59474
59554
  } catch (err) {
59475
59555
  reportHookFailure(agent, err);
59476
59556
  }
@@ -59490,14 +59570,14 @@ Use 'dosu knowledge hooks enable|disable [agent...]' to change these.`));
59490
59570
  }
59491
59571
  function reportHookFailure(agent, err) {
59492
59572
  const message = err instanceof HookConfigError ? err.message : err instanceof Error ? err.message : String(err);
59493
- console.error(import_picocolors21.default.red(`✗ ${agent.name()}: ${message}`));
59573
+ console.error(import_picocolors22.default.red(`✗ ${agent.name()}: ${message}`));
59494
59574
  process.exitCode = 1;
59495
59575
  }
59496
59576
  function dosuOnPath() {
59497
59577
  const bin = process.platform === "win32" ? "dosu.cmd" : "dosu";
59498
59578
  return (process.env.PATH ?? "").split(delimiter4).some((dir) => dir !== "" && existsSync19(join22(dir, bin)));
59499
59579
  }
59500
- var import_picocolors21;
59580
+ var import_picocolors22;
59501
59581
  var init_knowledge = __esm(() => {
59502
59582
  init_commander();
59503
59583
  init_trpc();
@@ -59519,7 +59599,7 @@ var init_knowledge = __esm(() => {
59519
59599
  init_knowledge_incognito();
59520
59600
  init_knowledge_statusline();
59521
59601
  init_output();
59522
- import_picocolors21 = __toESM(require_picocolors(), 1);
59602
+ import_picocolors22 = __toESM(require_picocolors(), 1);
59523
59603
  });
59524
59604
 
59525
59605
  // src/commands/libraries.ts
@@ -59573,7 +59653,7 @@ function librariesCommand() {
59573
59653
  });
59574
59654
  if (opts.json)
59575
59655
  return printResult(library, opts);
59576
- console.log(import_picocolors22.default.green(`Created library '${library.name}' (${library.id}).`));
59656
+ console.log(import_picocolors23.default.green(`Created library '${library.name}' (${library.id}).`));
59577
59657
  });
59578
59658
  cmd.command("update").description("Update a library (requires confirmation)").argument("<library-id>", "Library ID", uuidV4).option("--name <name>", "New name", boundedText(50)).addOption(new Option("--visibility <visibility>", "New visibility").choices([...LIBRARY_VISIBILITIES])).option("--confirm", "Apply without the interactive prompt").option("--json", "Output as JSON").action(async (libraryId, opts) => {
59579
59659
  if (opts.name === undefined && opts.visibility === undefined) {
@@ -59599,7 +59679,7 @@ function librariesCommand() {
59599
59679
  });
59600
59680
  if (opts.json)
59601
59681
  return printResult(library, opts);
59602
- console.log(import_picocolors22.default.green(`Updated library '${library.name}'.`));
59682
+ console.log(import_picocolors23.default.green(`Updated library '${library.name}'.`));
59603
59683
  });
59604
59684
  cmd.command("delete").description("Delete a library (requires confirmation)").argument("<library-id>", "Library ID", uuidV4).option("--confirm", "Apply without the interactive prompt").option("--json", "Output as JSON").action(async (libraryId, opts) => {
59605
59685
  if (!await confirmAction({
@@ -59613,7 +59693,7 @@ function librariesCommand() {
59613
59693
  const result = await createTypedClient(cfg).libraries.delete.mutate(libraryId);
59614
59694
  if (opts.json)
59615
59695
  return printResult(result, opts);
59616
- console.log(import_picocolors22.default.green(`Deleted library ${libraryId}.`));
59696
+ console.log(import_picocolors23.default.green(`Deleted library ${libraryId}.`));
59617
59697
  });
59618
59698
  const config = cmd.command("config").description("Manage library documentation settings");
59619
59699
  config.command("get").description("Show documentation settings").argument("<library-id>", "Library ID", uuidV4).option("--json", "Output as JSON").action(async (libraryId, opts) => {
@@ -59643,7 +59723,7 @@ function librariesCommand() {
59643
59723
  });
59644
59724
  if (opts.json)
59645
59725
  return printResult(result, opts);
59646
- console.log(import_picocolors22.default.green(`Updated documentation.${setting}.`));
59726
+ console.log(import_picocolors23.default.green(`Updated documentation.${setting}.`));
59647
59727
  });
59648
59728
  const sources = cmd.command("sources").description("Manage sources attached to a library");
59649
59729
  sources.command("list").description("List attached sources").argument("<library-id>", "Library ID", uuidV4).option("--json", "Output as JSON").action(async (libraryId, opts) => {
@@ -59684,7 +59764,7 @@ function librariesCommand() {
59684
59764
  const result = { action, library_id: libraryId, source_ids: uniqueIds, changed: count };
59685
59765
  if (opts.json)
59686
59766
  return printResult(result, opts);
59687
- console.log(import_picocolors22.default.green(`${action === "attach" ? "Attached" : "Detached"} ${count} source(s).`));
59767
+ console.log(import_picocolors23.default.green(`${action === "attach" ? "Attached" : "Detached"} ${count} source(s).`));
59688
59768
  });
59689
59769
  }
59690
59770
  const sourceConfig = sources.command("config").description("Manage per-library source settings");
@@ -59728,7 +59808,7 @@ function librariesCommand() {
59728
59808
  });
59729
59809
  if (opts.json)
59730
59810
  return printResult(result, opts);
59731
- console.log(import_picocolors22.default.green("Updated source settings."));
59811
+ console.log(import_picocolors23.default.green("Updated source settings."));
59732
59812
  });
59733
59813
  const monitors = cmd.command("monitors").description("Manage source-oriented Monitor settings");
59734
59814
  monitors.command("list").description("List Monitor settings by source").argument("<library-id>", "Library ID", uuidV4).option("--json", "Output as JSON").action(async (libraryId, opts) => {
@@ -59769,11 +59849,11 @@ function librariesCommand() {
59769
59849
  });
59770
59850
  if (opts.json)
59771
59851
  return printResult(result, opts);
59772
- console.log(import_picocolors22.default.green("Updated Monitor settings."));
59852
+ console.log(import_picocolors23.default.green("Updated Monitor settings."));
59773
59853
  });
59774
59854
  return cmd;
59775
59855
  }
59776
- var import_picocolors22, LIBRARY_VISIBILITIES, CONFIG_SETTINGS, CONFIG_SETTING_NAMES;
59856
+ var import_picocolors23, LIBRARY_VISIBILITIES, CONFIG_SETTINGS, CONFIG_SETTING_NAMES;
59777
59857
  var init_libraries = __esm(() => {
59778
59858
  init_commander();
59779
59859
  init_trpc();
@@ -59781,7 +59861,7 @@ var init_libraries = __esm(() => {
59781
59861
  init_auth();
59782
59862
  init_confirmation();
59783
59863
  init_output();
59784
- import_picocolors22 = __toESM(require_picocolors(), 1);
59864
+ import_picocolors23 = __toESM(require_picocolors(), 1);
59785
59865
  LIBRARY_VISIBILITIES = ["public", "internal", "private"];
59786
59866
  CONFIG_SETTINGS = {
59787
59867
  commit_to_trigger_pr: true,
@@ -59795,7 +59875,7 @@ var init_libraries = __esm(() => {
59795
59875
  function requireConfig8() {
59796
59876
  const cfg = requireLoginConfig();
59797
59877
  if (!cfg.active_account?.target?.org_id) {
59798
- console.error(import_picocolors23.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
59878
+ console.error(import_picocolors24.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
59799
59879
  process.exit(1);
59800
59880
  }
59801
59881
  return cfg;
@@ -59815,17 +59895,17 @@ function membersCommand() {
59815
59895
  printResult({ success: true, email, role }, opts);
59816
59896
  return;
59817
59897
  }
59818
- console.log(import_picocolors23.default.green(`Invitation sent to ${email} as ${role}.`));
59898
+ console.log(import_picocolors24.default.green(`Invitation sent to ${email} as ${role}.`));
59819
59899
  });
59820
59900
  return cmd;
59821
59901
  }
59822
- var import_picocolors23;
59902
+ var import_picocolors24;
59823
59903
  var init_members = __esm(() => {
59824
59904
  init_commander();
59825
59905
  init_trpc();
59826
59906
  init_auth();
59827
59907
  init_output();
59828
- import_picocolors23 = __toESM(require_picocolors(), 1);
59908
+ import_picocolors24 = __toESM(require_picocolors(), 1);
59829
59909
  });
59830
59910
 
59831
59911
  // src/commands/org.ts
@@ -59843,7 +59923,7 @@ function orgCommand() {
59843
59923
  return;
59844
59924
  }
59845
59925
  if (!orgs || orgs.length === 0) {
59846
- console.log(import_picocolors24.default.dim("No organizations found."));
59926
+ console.log(import_picocolors25.default.dim("No organizations found."));
59847
59927
  return;
59848
59928
  }
59849
59929
  if (orgs.length === 1) {
@@ -59857,18 +59937,234 @@ function orgCommand() {
59857
59937
  printTable(["ID", "Name"], orgs.map((o) => [o.org_id.slice(0, 8), o.name]), { rawData: orgs });
59858
59938
  if (cfg.active_account?.target?.org_id) {
59859
59939
  console.log(`
59860
- ${import_picocolors24.default.dim(`Current: ${cfg.active_account?.target?.org_id}`)}`);
59940
+ ${import_picocolors25.default.dim(`Current: ${cfg.active_account?.target?.org_id}`)}`);
59861
59941
  }
59862
59942
  });
59863
59943
  return cmd;
59864
59944
  }
59865
- var import_picocolors24;
59945
+ var import_picocolors25;
59866
59946
  var init_org = __esm(() => {
59867
59947
  init_commander();
59868
59948
  init_trpc();
59869
59949
  init_auth();
59870
59950
  init_output();
59871
- import_picocolors24 = __toESM(require_picocolors(), 1);
59951
+ import_picocolors25 = __toESM(require_picocolors(), 1);
59952
+ });
59953
+
59954
+ // src/commands/review-notifications.ts
59955
+ function targetOptions(cmd) {
59956
+ return cmd.addOption(new Option("--library <library-id>", "Library ID (UUID)").argParser(uuidV4).conflicts("agent")).addOption(new Option("--agent <agent-id>", "Agent ID (UUID), from `dosu agents list`").argParser(uuidV4).conflicts("library"));
59957
+ }
59958
+ function resolveTarget(opts) {
59959
+ if (opts.library) {
59960
+ return {
59961
+ scope: "space",
59962
+ targetId: opts.library,
59963
+ noun: "Library",
59964
+ flag: `--library ${opts.library}`
59965
+ };
59966
+ }
59967
+ if (opts.agent) {
59968
+ return {
59969
+ scope: "deployment",
59970
+ targetId: opts.agent,
59971
+ noun: "Agent",
59972
+ flag: `--agent ${opts.agent}`
59973
+ };
59974
+ }
59975
+ console.error(import_picocolors26.default.red("Pass --library <library-id> or --agent <agent-id>."));
59976
+ process.exit(1);
59977
+ }
59978
+ function installUrl() {
59979
+ return `${getWebAppURL()}/slack`;
59980
+ }
59981
+ function describeDisabledReason(reason) {
59982
+ if (reason === "not_in_channel") {
59983
+ return "Dosu is not in the channel. Run `/invite @Dosu` in it, then re-run `set`.";
59984
+ }
59985
+ if (reason === "is_archived" || reason === "channel_not_found" || reason === "channel_missing") {
59986
+ return "The channel is archived or gone. Run `set` with another channel.";
59987
+ }
59988
+ return `Dosu lost access to the channel (${reason}). Re-run \`set\` to reconnect.`;
59989
+ }
59990
+ function errorCode(err) {
59991
+ return isTRPCClientError(err) ? err.data?.code : undefined;
59992
+ }
59993
+ async function getNotification(client, target) {
59994
+ return client.reviewNotification.get.query({ scope: target.scope, targetId: target.targetId });
59995
+ }
59996
+ function assertWritable(state) {
59997
+ if (!state.canEdit) {
59998
+ console.error(import_picocolors26.default.red("Only organization admins can change Slack Notifications."));
59999
+ process.exit(1);
60000
+ }
60001
+ if (!state.slackInstalled) {
60002
+ console.error(import_picocolors26.default.red("The Dosu Slack app is not installed for this organization."));
60003
+ console.error(`Install it at ${installUrl()}, then re-run this command.`);
60004
+ process.exit(1);
60005
+ }
60006
+ if (!state.notificationsEnabled) {
60007
+ console.error(import_picocolors26.default.red("Slack Notifications are not enabled for this organization."));
60008
+ process.exit(1);
60009
+ }
60010
+ }
60011
+ function printNotification(target, state) {
60012
+ const { notification } = state;
60013
+ if (!notification) {
60014
+ console.log(import_picocolors26.default.dim(`No Slack channel is set for this ${target.noun}.`));
60015
+ } else {
60016
+ const delivers = [
60017
+ notification.notify_doc_reviews && "doc reviews",
60018
+ notification.notify_message_reviews && "draft replies"
60019
+ ].filter(Boolean);
60020
+ printInfo([
60021
+ [target.noun, target.targetId],
60022
+ [
60023
+ "Channel",
60024
+ notification.channel ? channelLabel(notification.channel) : import_picocolors26.default.yellow(`missing (${notification.slack_channel_id})`)
60025
+ ],
60026
+ [
60027
+ "Private",
60028
+ notification.channel?.is_private == null ? undefined : notification.channel.is_private ? "yes" : "no"
60029
+ ],
60030
+ ["Notifies", delivers.length > 0 ? delivers.join(", ") : "nothing"],
60031
+ [
60032
+ "Status",
60033
+ notification.disabled_reason ? import_picocolors26.default.red(`disabled: ${describeDisabledReason(notification.disabled_reason)}`) : notification.channel ? import_picocolors26.default.green("active") : import_picocolors26.default.red("disabled: the channel no longer exists. Run `set` with another channel.")
60034
+ ]
60035
+ ]);
60036
+ }
60037
+ if (!state.slackInstalled) {
60038
+ console.log(import_picocolors26.default.yellow(`The Dosu Slack app is not installed. Install it at ${installUrl()}.`));
60039
+ }
60040
+ if (!state.notificationsEnabled) {
60041
+ console.log(import_picocolors26.default.yellow("Slack Notifications are not enabled for this organization; nothing is delivered."));
60042
+ }
60043
+ if (!notification && state.canEdit && state.slackInstalled && state.notificationsEnabled) {
60044
+ console.log(import_picocolors26.default.dim(`Set one with: dosu review notifications set ${target.flag} --channel <channel>`));
60045
+ }
60046
+ }
60047
+ function reviewNotificationsCommand() {
60048
+ const cmd = new Command("notifications").description("Manage the Slack channel that receives a Library's or Agent's review notifications");
60049
+ cmd.addHelpText("after", RECONNECT_HELP);
60050
+ targetOptions(cmd.command("get").description("Show the Slack channel that receives review notifications")).option("--json", "Output as JSON").action(async (opts) => {
60051
+ const target = resolveTarget(opts);
60052
+ const client = createTypedClient(requireLoginConfig());
60053
+ const state = await getNotification(client, target);
60054
+ if (opts.json) {
60055
+ printResult(state, opts);
60056
+ return;
60057
+ }
60058
+ printNotification(target, state);
60059
+ });
60060
+ targetOptions(cmd.command("set").description("Send review notifications to a Slack channel (org admins; requires confirmation)").addHelpText("after", RECONNECT_HELP)).requiredOption("--channel <channel>", "Channel UUID, Slack channel ID, or #name").option("--confirm", "Apply without the interactive prompt").option("--json", "Output as JSON").action(async (opts) => {
60061
+ const target = resolveTarget(opts);
60062
+ const client = createTypedClient(requireLoginConfig());
60063
+ const state = await getNotification(client, target);
60064
+ assertWritable(state);
60065
+ const { id: slackChannelId, channel } = await resolveChannel(client, state.orgId, opts.channel, { name: "--channel", uuidUsage: "--channel <uuid>" }, opts.json);
60066
+ const label = channel ? channelLabel(channel) : slackChannelId;
60067
+ const current = state.notification;
60068
+ const currentLabel = current?.channel ? channelLabel(current.channel) : current?.slack_channel_id ?? "none";
60069
+ if (!opts.json) {
60070
+ printInfo([
60071
+ [target.noun, target.targetId],
60072
+ ["Channel", `${currentLabel} → ${label}`]
60073
+ ]);
60074
+ }
60075
+ if (!await confirmAction({
60076
+ confirmed: opts.confirm,
60077
+ json: opts.json,
60078
+ message: `Send this ${target.noun}'s review notifications to ${label}?`,
60079
+ preview: {
60080
+ target: target.noun.toLowerCase(),
60081
+ targetId: target.targetId,
60082
+ current: current?.slack_channel_id ?? null,
60083
+ slackChannelId,
60084
+ channel
60085
+ }
60086
+ }))
60087
+ return;
60088
+ try {
60089
+ await client.reviewNotification.upsert.mutate({
60090
+ scope: target.scope,
60091
+ targetId: target.targetId,
60092
+ slackChannelId
60093
+ });
60094
+ } catch (err) {
60095
+ if (errorCode(err) === "PRECONDITION_FAILED") {
60096
+ console.error(import_picocolors26.default.red(`Dosu can't join ${label}.`));
60097
+ console.error(`Run \`/invite @Dosu\` in the channel, then re-run \`dosu review notifications set ${target.flag} --channel ${opts.channel}\`.`);
60098
+ process.exit(1);
60099
+ }
60100
+ throw err;
60101
+ }
60102
+ const updated = await getNotification(client, target);
60103
+ if (opts.json) {
60104
+ printResult({ success: true, notification: updated.notification }, opts);
60105
+ return;
60106
+ }
60107
+ const saved = updated.notification?.channel;
60108
+ console.log(import_picocolors26.default.green(`Review notifications for this ${target.noun} now go to ${saved ? channelLabel(saved) : label}.`));
60109
+ });
60110
+ targetOptions(cmd.command("clear").description("Stop sending review notifications to Slack (org admins; requires confirmation)")).option("--confirm", "Apply without the interactive prompt").option("--json", "Output as JSON").action(async (opts) => {
60111
+ const target = resolveTarget(opts);
60112
+ const client = createTypedClient(requireLoginConfig());
60113
+ const state = await getNotification(client, target);
60114
+ const current = state.notification;
60115
+ if (!current) {
60116
+ if (opts.json) {
60117
+ printResult({ success: true, removed: false }, opts);
60118
+ return;
60119
+ }
60120
+ console.log(import_picocolors26.default.dim(`No Slack channel is set for this ${target.noun}; nothing to clear.`));
60121
+ return;
60122
+ }
60123
+ if (!state.canEdit) {
60124
+ console.error(import_picocolors26.default.red("Only organization admins can change Slack Notifications."));
60125
+ process.exit(1);
60126
+ }
60127
+ const label = current.channel ? channelLabel(current.channel) : current.slack_channel_id;
60128
+ if (!await confirmAction({
60129
+ confirmed: opts.confirm,
60130
+ json: opts.json,
60131
+ message: `Stop sending this ${target.noun}'s review notifications to ${label}?`,
60132
+ preview: {
60133
+ target: target.noun.toLowerCase(),
60134
+ targetId: target.targetId,
60135
+ current: current.slack_channel_id,
60136
+ channel: current.channel
60137
+ }
60138
+ }))
60139
+ return;
60140
+ await client.reviewNotification.remove.mutate({
60141
+ scope: target.scope,
60142
+ targetId: target.targetId
60143
+ });
60144
+ if (opts.json) {
60145
+ printResult({ success: true, removed: true }, opts);
60146
+ return;
60147
+ }
60148
+ console.log(import_picocolors26.default.green(`Review notifications for this ${target.noun} no longer go to Slack.`));
60149
+ });
60150
+ return cmd;
60151
+ }
60152
+ var import_picocolors26, RECONNECT_HELP = `
60153
+ A channel that stopped receiving notifications (archived, Dosu removed, access lost) shows its
60154
+ reason in \`get\`. Re-run \`set\` with the same channel to reconnect it.
60155
+
60156
+ --channel accepts a Dosu channel UUID, a Slack channel ID (C… / G…), or a name (#name or name).
60157
+ Only organization admins can change Slack Notifications.`;
60158
+ var init_review_notifications = __esm(() => {
60159
+ init_dist();
60160
+ init_commander();
60161
+ init_trpc();
60162
+ init_arguments();
60163
+ init_auth();
60164
+ init_confirmation();
60165
+ init_output();
60166
+ init_slack_channel_resolve();
60167
+ import_picocolors26 = __toESM(require_picocolors(), 1);
59872
60168
  });
59873
60169
 
59874
60170
  // src/commands/time-range.ts
@@ -59985,7 +60281,7 @@ async function requireChange(client, id) {
59985
60281
  return await client.review.getChange.query({ id });
59986
60282
  } catch (err) {
59987
60283
  if (isNotFound(err) || isInvalidId(err)) {
59988
- console.error(import_picocolors25.default.red(`No review item found for '${id}'. Run 'dosu review list' to see pending items.`));
60284
+ console.error(import_picocolors27.default.red(`No review item found for '${id}'. Run 'dosu review list' to see pending items.`));
59989
60285
  process.exit(1);
59990
60286
  }
59991
60287
  throw err;
@@ -59994,7 +60290,7 @@ async function requireChange(client, id) {
59994
60290
  async function requireDraft(client, id) {
59995
60291
  const draft = await client.messages.getMessage.query(bareMessageId(id));
59996
60292
  if (!draft) {
59997
- console.error(import_picocolors25.default.red(`No review item found for '${id}'. Run 'dosu review list' to see pending items.`));
60293
+ console.error(import_picocolors27.default.red(`No review item found for '${id}'. Run 'dosu review list' to see pending items.`));
59998
60294
  process.exit(1);
59999
60295
  }
60000
60296
  return draft;
@@ -60017,12 +60313,12 @@ function colorizeDiff(diff) {
60017
60313
  return diff.split(`
60018
60314
  `).map((line) => {
60019
60315
  if (line.startsWith("+"))
60020
- return import_picocolors25.default.green(line);
60316
+ return import_picocolors27.default.green(line);
60021
60317
  if (line.startsWith("-"))
60022
- return import_picocolors25.default.red(line);
60318
+ return import_picocolors27.default.red(line);
60023
60319
  if (line.startsWith("@@"))
60024
- return import_picocolors25.default.cyan(line);
60025
- return import_picocolors25.default.dim(line);
60320
+ return import_picocolors27.default.cyan(line);
60321
+ return import_picocolors27.default.dim(line);
60026
60322
  }).join(`
60027
60323
  `);
60028
60324
  }
@@ -60036,7 +60332,7 @@ function printChangePreview(change) {
60036
60332
  ]
60037
60333
  ]);
60038
60334
  if (!change.hasChanges) {
60039
- console.log(import_picocolors25.default.dim("No content changes."));
60335
+ console.log(import_picocolors27.default.dim("No content changes."));
60040
60336
  return;
60041
60337
  }
60042
60338
  console.log();
@@ -60053,7 +60349,7 @@ function printDraftPreview(draft) {
60053
60349
  async function getKnowledgeStoreId2(client, spaceId) {
60054
60350
  const store = await client.knowledgeStore.getBySpaceId.query({ space_id: spaceId });
60055
60351
  if (!store) {
60056
- console.error(import_picocolors25.default.red("No knowledge store found for this deployment."));
60352
+ console.error(import_picocolors27.default.red("No knowledge store found for this deployment."));
60057
60353
  process.exit(1);
60058
60354
  }
60059
60355
  return store.id;
@@ -60065,14 +60361,14 @@ function reviewCommand() {
60065
60361
  try {
60066
60362
  range = resolveTimeRange(opts.since, opts.until);
60067
60363
  } catch (err) {
60068
- console.error(import_picocolors25.default.red(`${err.message}.`));
60364
+ console.error(import_picocolors27.default.red(`${err.message}.`));
60069
60365
  process.exit(1);
60070
60366
  }
60071
60367
  const rangeLabel = describeTimeRange(range);
60072
60368
  const inRange = rangeLabel ? ` ${rangeLabel}` : "";
60073
60369
  const cfg = requireConfig10();
60074
60370
  if (!cfg.active_account?.target?.space_id) {
60075
- console.error(import_picocolors25.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
60371
+ console.error(import_picocolors27.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
60076
60372
  process.exit(1);
60077
60373
  }
60078
60374
  const client = createTypedClient(cfg);
@@ -60089,11 +60385,11 @@ function reviewCommand() {
60089
60385
  return;
60090
60386
  }
60091
60387
  if (!items || items.length === 0) {
60092
- console.log(import_picocolors25.default.dim(`No pending review items${inRange}.`));
60388
+ console.log(import_picocolors27.default.dim(`No pending review items${inRange}.`));
60093
60389
  return;
60094
60390
  }
60095
60391
  if (rangeLabel)
60096
- console.log(import_picocolors25.default.dim(`Pending review items created ${rangeLabel}:`));
60392
+ console.log(import_picocolors27.default.dim(`Pending review items created ${rangeLabel}:`));
60097
60393
  printTable(["ID", "Kind", "Title", "Source", "Status", "Created"], items.map((i) => i.kind === "draft_message" ? [
60098
60394
  i.id,
60099
60395
  i.kind,
@@ -60110,7 +60406,7 @@ function reviewCommand() {
60110
60406
  formatDate(i.createdAt)
60111
60407
  ]), { rawData: items });
60112
60408
  if (truncated) {
60113
- console.log(import_picocolors25.default.dim(`Showing ${items.length} of ${total}+ pending items${inRange} (list truncated).`));
60409
+ console.log(import_picocolors27.default.dim(`Showing ${items.length} of ${total}+ pending items${inRange} (list truncated).`));
60114
60410
  }
60115
60411
  });
60116
60412
  cmd.command("diff").description("Show a pending review item (doc-change diff or draft reply body)").argument("<id>", "Review item ID (from `dosu review list`)").option("--json", "Output as JSON").action(async (id, opts) => {
@@ -60122,8 +60418,8 @@ function reviewCommand() {
60122
60418
  printResult({ id, kind: "draft_message", title: draft.title, body: draft.body }, opts);
60123
60419
  return;
60124
60420
  }
60125
- console.log(import_picocolors25.default.bold(draft.title ?? "(untitled)"));
60126
- console.log(import_picocolors25.default.dim("Draft reply"));
60421
+ console.log(import_picocolors27.default.bold(draft.title ?? "(untitled)"));
60422
+ console.log(import_picocolors27.default.dim("Draft reply"));
60127
60423
  console.log("");
60128
60424
  console.log(draft.body ?? "");
60129
60425
  return;
@@ -60134,8 +60430,8 @@ function reviewCommand() {
60134
60430
  return;
60135
60431
  }
60136
60432
  const versions = change.publishedVersion != null ? `v${change.publishedVersion} → v${change.version}` : `v${change.version}`;
60137
- console.log(import_picocolors25.default.bold(change.title));
60138
- console.log(import_picocolors25.default.dim(`${change.source} · ${versions}`));
60433
+ console.log(import_picocolors27.default.bold(change.title));
60434
+ console.log(import_picocolors27.default.dim(`${change.source} · ${versions}`));
60139
60435
  console.log("");
60140
60436
  console.log(change.diff);
60141
60437
  });
@@ -60143,7 +60439,7 @@ function reviewCommand() {
60143
60439
  const cfg = requireConfig10();
60144
60440
  const client = createTypedClient(cfg);
60145
60441
  if (opts.body !== undefined && opts.bodyFile !== undefined) {
60146
- console.error(import_picocolors25.default.red("Pass only one of --body or --body-file."));
60442
+ console.error(import_picocolors27.default.red("Pass only one of --body or --body-file."));
60147
60443
  process.exit(1);
60148
60444
  }
60149
60445
  let body = opts.body;
@@ -60151,21 +60447,21 @@ function reviewCommand() {
60151
60447
  try {
60152
60448
  body = readFileSync19(opts.bodyFile, "utf-8");
60153
60449
  } catch (err) {
60154
- console.error(import_picocolors25.default.red(`Failed to read --body-file: ${err.message}`));
60450
+ console.error(import_picocolors27.default.red(`Failed to read --body-file: ${err.message}`));
60155
60451
  process.exit(1);
60156
60452
  }
60157
60453
  }
60158
60454
  if (body === undefined && opts.title === undefined) {
60159
- console.error(import_picocolors25.default.red("Nothing to edit. Pass --title and/or --body/--body-file."));
60455
+ console.error(import_picocolors27.default.red("Nothing to edit. Pass --title and/or --body/--body-file."));
60160
60456
  process.exit(1);
60161
60457
  }
60162
60458
  if (isDraftId(id)) {
60163
60459
  if (opts.title !== undefined) {
60164
- console.error(import_picocolors25.default.red("Draft replies support --body only (no --title)."));
60460
+ console.error(import_picocolors27.default.red("Draft replies support --body only (no --title)."));
60165
60461
  process.exit(1);
60166
60462
  }
60167
60463
  if (body === undefined) {
60168
- console.error(import_picocolors25.default.red("Draft replies require --body or --body-file."));
60464
+ console.error(import_picocolors27.default.red("Draft replies require --body or --body-file."));
60169
60465
  process.exit(1);
60170
60466
  }
60171
60467
  await requireDraft(client, id);
@@ -60182,7 +60478,7 @@ function reviewCommand() {
60182
60478
  });
60183
60479
  } catch (err) {
60184
60480
  if (isNotFound(err)) {
60185
- console.error(import_picocolors25.default.red(`No pending review item found for '${id}'. Run 'dosu review list' to see editable items.`));
60481
+ console.error(import_picocolors27.default.red(`No pending review item found for '${id}'. Run 'dosu review list' to see editable items.`));
60186
60482
  process.exit(1);
60187
60483
  }
60188
60484
  throw err;
@@ -60192,7 +60488,7 @@ function reviewCommand() {
60192
60488
  printResult({ success: true, id }, opts);
60193
60489
  return;
60194
60490
  }
60195
- console.log(import_picocolors25.default.green(`Review edited: ${truncateId(id)}`));
60491
+ console.log(import_picocolors27.default.green(`Review edited: ${truncateId(id)}`));
60196
60492
  });
60197
60493
  cmd.command("context").description("Get review context for a thread").argument("<thread-id>", "Thread ID").option("--json", "Output as JSON").action(async (threadId, opts) => {
60198
60494
  const cfg = requireConfig10();
@@ -60256,7 +60552,7 @@ function reviewCommand() {
60256
60552
  printResult({ success: true, id, action }, opts);
60257
60553
  return;
60258
60554
  }
60259
- console.log(import_picocolors25.default.green(`Review ${name}: ${truncateId(id)}`));
60555
+ console.log(import_picocolors27.default.green(`Review ${name}: ${truncateId(id)}`));
60260
60556
  });
60261
60557
  }
60262
60558
  cmd.command("revert").description("Reopen a previously accepted or declined doc change for review").argument("<id>", "Page version ID (not a pending item from `dosu review list`)").option("--json", "Output as JSON").action(async (id, opts) => {
@@ -60264,7 +60560,7 @@ function reviewCommand() {
60264
60560
  const client = createTypedClient(cfg);
60265
60561
  if (isDraftId(id)) {
60266
60562
  await requireDraft(client, id);
60267
- console.error(import_picocolors25.default.red("Revert is not supported for draft replies. A rejected draft is regenerated on the next agent run."));
60563
+ console.error(import_picocolors27.default.red("Revert is not supported for draft replies. A rejected draft is regenerated on the next agent run."));
60268
60564
  process.exit(1);
60269
60565
  }
60270
60566
  await requireChange(client, id);
@@ -60276,11 +60572,12 @@ function reviewCommand() {
60276
60572
  printResult({ success: true, id, action: "revert_to_pending" }, opts);
60277
60573
  return;
60278
60574
  }
60279
- console.log(import_picocolors25.default.green(`Review revert: ${truncateId(id)}`));
60575
+ console.log(import_picocolors27.default.green(`Review revert: ${truncateId(id)}`));
60280
60576
  });
60577
+ cmd.addCommand(reviewNotificationsCommand());
60281
60578
  return cmd;
60282
60579
  }
60283
- var import_picocolors25, DRAFT_MESSAGE_ID_PREFIX = "draft_message:";
60580
+ var import_picocolors27, DRAFT_MESSAGE_ID_PREFIX = "draft_message:";
60284
60581
  var init_review = __esm(() => {
60285
60582
  init_dist();
60286
60583
  init_commander();
@@ -60288,8 +60585,9 @@ var init_review = __esm(() => {
60288
60585
  init_auth();
60289
60586
  init_confirmation();
60290
60587
  init_output();
60588
+ init_review_notifications();
60291
60589
  init_time_range();
60292
- import_picocolors25 = __toESM(require_picocolors(), 1);
60590
+ import_picocolors27 = __toESM(require_picocolors(), 1);
60293
60591
  });
60294
60592
 
60295
60593
  // src/generated/skills.ts
@@ -60321,7 +60619,7 @@ Operate Dosu through \`dosu\`. Prefer structured output and let the CLI and App
60321
60619
 
60322
60620
  - \`dosu login\` supplies the JWT used by tRPC-backed commands.
60323
60621
  - \`dosu setup\` selects an organization, Library context, and MCP deployment, creates an API key, and can configure an agent tool.
60324
- - \`dosu ask\` needs an API key. \`docs generate\`, \`docs auto-tag\`, and \`docs publish\` need both JWT login and the API key. Other platform commands generally need JWT login; commands scoped to an organization or current Library also need the corresponding setup selection.
60622
+ - \`dosu ask\` needs an API key. \`docs publish\` needs both JWT login and the API key. Other platform commands generally need JWT login; commands scoped to an organization or current Library also need the corresponding setup selection.
60325
60623
  - For coding-agent setup, follow the nonblocking \`dosu setup --agent --tool <id>\` workflow in [workflows.md](references/workflows.md). Relay its URL and execute its returned \`resume_command\`; never invent ticket commands.
60326
60624
 
60327
60625
  ## Use current product terms
@@ -60347,6 +60645,7 @@ Operate Dosu through \`dosu\`. Prefer structured output and let the CLI and App
60347
60645
  | Create, import, or publish docs | \`dosu docs ...\` |
60348
60646
  | Show the review list, review queue, or what needs approval | \`dosu review list --json\`; if the scope looks wrong, follow the context check in [review-workflow.md](references/review-workflow.md) |
60349
60647
  | Inspect, edit, approve, or reject one review item | Read [review-workflow.md](references/review-workflow.md) first |
60648
+ | Send a Library's or Agent's review notifications to a Slack channel | \`dosu review notifications get --json\`, then \`set\`/\`clear\` |
60350
60649
  | Inspect conversations | \`dosu threads ...\` |
60351
60650
  | Browse managed topics | \`dosu topics ...\` |
60352
60651
  | Audit agent docs, README, architecture, or dependencies | Read [audit.md](references/audit.md) first |
@@ -60721,8 +61020,6 @@ dosu docs unarchive <id> [--json]
60721
61020
  dosu docs delete <id> [--json]
60722
61021
  dosu docs versions <id> [--json]
60723
61022
  dosu docs restore <id> --revision <positive-int> [--json]
60724
- dosu docs generate --title <title> [--instructions <text>] [--json]
60725
- dosu docs auto-tag <id> [--json]
60726
61023
  dosu docs import <platform> --files <comma-separated-ids> [--json]
60727
61024
  dosu docs import-status <task-id> [--json]
60728
61025
  dosu docs publish <id> --to <platform> [target flags] [--json]
@@ -60732,7 +61029,7 @@ dosu docs sync-back <id> [--json]
60732
61029
  - Document list defaults to 20. \`create\` and \`update\` reject combining \`--body\` with \`--body-file\`; \`update\` requires at least one field.
60733
61030
  - Import platforms: \`github\`, \`gitlab\`, \`azure_devops\`, \`confluence\`, \`notion\`, \`coda\`.
60734
61031
  - Publish platforms: the same six. Target flags are \`--repo-id\`, \`--project-id\`, \`--parent-page-id\`, \`--doc-id\`, \`--directory\`, and \`--data-source-id\`; Azure DevOps requires \`--data-source-id\`. Other target validation may occur in the backend.
60735
- - \`generate\`, \`auto-tag\`, import, publish, and sync operations may be asynchronous. Use the returned task/status identifiers rather than assuming completion.
61032
+ - Import, publish, and sync operations may be asynchronous. Use the returned task/status identifiers rather than assuming completion.
60736
61033
 
60737
61034
  ## Review
60738
61035
 
@@ -60746,11 +61043,18 @@ dosu review context <thread-id> [--json]
60746
61043
  dosu review approve <id> [--confirm] [--json]
60747
61044
  dosu review reject <id> [--confirm] [--json]
60748
61045
  dosu review revert <id> [--json]
61046
+ dosu review notifications get (--library <library-id> | --agent <agent-id>) [--json]
61047
+ dosu review notifications set (--library <library-id> | --agent <agent-id>)
61048
+ --channel <uuid | slack-id | #name> [--confirm] [--json]
61049
+ dosu review notifications clear (--library <library-id> | --agent <agent-id>) [--confirm] [--json]
60749
61050
  \`\`\`
60750
61051
 
60751
61052
  - \`list\` reads the selected Library's pending doc changes plus the selected MCP deployment's draft replies. JSON is \`{items, truncated, total}\`: at most 50 items, newest first; \`total\` is a lower bound when \`truncated\` is true. \`--since\`/\`--until\` take \`24h\`/\`7d\`/\`2w\`, a UTC date, or an ISO-8601 datetime.
60752
61053
  - IDs are opaque: pass each \`id\` from \`list\` verbatim (draft replies carry a \`draft_message:\` prefix). \`revert\` takes a decided doc change's page-version ID and does not apply to drafts.
60753
61054
  - \`edit\` requires at least one field; drafts accept only \`--body\`/\`--body-file\`. \`approve\` and \`reject\` do not write without interactive confirmation or \`--confirm\`.
61055
+ - \`notifications\` manages the Slack channel that receives review notifications for one Library (doc reviews) or one Agent (its draft replies). Unlike the queue commands it takes an explicit target, not the selected MCP deployment. Pass exactly one of \`--library\`/\`--agent\` (UUID v4; Agent IDs come from \`dosu agents list\`).
61056
+ - \`notifications get --json\` returns \`{orgId, canEdit, slackInstalled, notificationsEnabled, notification}\`; \`notification\` is \`null\` when no channel is set. A non-null \`notification.disabled_reason\` means delivery stopped: \`not_in_channel\` needs \`/invite @Dosu\` in the channel; \`is_archived\`/\`channel_not_found\`/\`channel_missing\` need another channel; re-running \`set\` with the same channel reconnects it.
61057
+ - \`set\`/\`clear\` need an organization admin, and \`set\` needs the Slack app installed and Slack Notifications enabled for the organization; the CLI checks all three before prompting. \`--channel\` takes the channel's Dosu UUID, a Slack ID (\`C…\`/\`G…\`), or a name; a name shared across Slack workspaces or not found exits 1 with candidate UUIDs. A private channel Dosu cannot join exits 1 asking for \`/invite @Dosu\`. \`set --json\` returns \`{success, notification}\`; \`clear --json\` returns \`{success, removed}\`, and \`removed: false\` (nothing was set) is still a success.
60754
61058
 
60755
61059
  ## Sources, integrations, members, and organization
60756
61060
 
@@ -60765,8 +61069,8 @@ dosu sources create github --repo <owner/name> [--library <id>] [--confirm] [--j
60765
61069
 
60766
61070
  dosu integrations list [--json]
60767
61071
  dosu integrations status <platform> [--json]
60768
- dosu integrations slack-channels [--json]
60769
- dosu integrations slack-join <channel-id> [--json]
61072
+ dosu integrations slack-channels [--search <term>] [--limit <1-100>] [--cursor <uuid>] [--all] [--json]
61073
+ dosu integrations slack-join <uuid | slack-id | #name> [--json]
60770
61074
  dosu integrations github-collaborators <positive-repository-id> [--json]
60771
61075
 
60772
61076
  dosu members invite <email> [--role admin|member] [--json] # default member
@@ -60783,6 +61087,17 @@ dosu org info [--json]
60783
61087
  to the active Library. A repo not listed means the GitHub App lacks access — run
60784
61088
  \`sources connect github\` first. Forks can't be connected.
60785
61089
  - Integration status choices: \`github\`, \`gitlab\`, \`azure_devops\`, \`slack\`, \`confluence\`, \`notion\`, \`coda\`, \`teams\`. GitHub, Slack, and Teams currently return \`connected: null\` because CLI status probing is unavailable for them.
61090
+ - \`slack-channels\` lists each channel's Dosu UUID and Slack ID (\`C…\`/\`G…\`); \`slack-join\` and
61091
+ \`review notifications set --channel\` accept either, or the channel name (quote \`'#name'\` in
61092
+ shells that treat \`#\` as a comment). A name shared across Slack workspaces or not found exits 1
61093
+ with candidate UUIDs on stderr. \`slack-join --json\` returns \`{success, channelId, id, channel}\`:
61094
+ \`channelId\` is the input, \`id\` the resolved UUID, and \`channel\` the matched row (\`null\` when a
61095
+ UUID was passed).
61096
+ - \`slack-channels\` lists 50 available channels per page (\`--limit\` up to 100); \`--search\` is a
61097
+ server-side substring match on the name. \`--json\` always returns \`{items, nextCursor}\`, where
61098
+ each item carries both \`id\` and \`channel_id\`; pass a non-null \`nextCursor\` as \`--cursor\` for the
61099
+ next page. \`--all\` reads every page (\`nextCursor: null\`) and cannot be combined with \`--limit\` or
61100
+ \`--cursor\`; prefer \`--search\` in large organizations.
60786
61101
  - The CLI has no member list/remove/request commands; \`members invite\` is its only member operation.
60787
61102
 
60788
61103
  ## Threads, Topics, suggestions, and analytics
@@ -61263,7 +61578,7 @@ function removeSkills() {
61263
61578
  }
61264
61579
  function printPaths(paths) {
61265
61580
  for (const path of paths)
61266
- console.log(import_picocolors26.default.dim(` ${path}`));
61581
+ console.log(import_picocolors28.default.dim(` ${path}`));
61267
61582
  }
61268
61583
  function skillCommand() {
61269
61584
  const cmd = new Command("skill").description("Manage the Dosu agent skills bundled with the CLI");
@@ -61272,10 +61587,10 @@ function skillCommand() {
61272
61587
  const result = await installSkill();
61273
61588
  if (result.success) {
61274
61589
  printPaths(result.paths ?? []);
61275
- console.log(import_picocolors26.default.green(`
61590
+ console.log(import_picocolors28.default.green(`
61276
61591
  ✓ Skills installed successfully.`));
61277
61592
  } else {
61278
- console.error(import_picocolors26.default.red(`
61593
+ console.error(import_picocolors28.default.red(`
61279
61594
  Failed to install skill. Run with --debug for details.`));
61280
61595
  process.exit(1);
61281
61596
  }
@@ -61289,11 +61604,11 @@ Failed to install skill. Run with --debug for details.`));
61289
61604
  }
61290
61605
  console.log("Removing Dosu skills...");
61291
61606
  printPaths(removed);
61292
- console.log(import_picocolors26.default.green(`
61607
+ console.log(import_picocolors28.default.green(`
61293
61608
  ✓ Skills removed.`));
61294
61609
  } catch (err) {
61295
61610
  logger.error("skill", `Failed to remove skills: ${err}`);
61296
- console.error(import_picocolors26.default.red(`
61611
+ console.error(import_picocolors28.default.red(`
61297
61612
  Failed to remove skills.`));
61298
61613
  process.exit(1);
61299
61614
  }
@@ -61302,24 +61617,24 @@ Failed to remove skills.`));
61302
61617
  console.log(`Updating Dosu skills to the copy bundled with v${VERSION}...`);
61303
61618
  const result = await installSkill();
61304
61619
  if (!result.success) {
61305
- console.error(import_picocolors26.default.red(`
61620
+ console.error(import_picocolors28.default.red(`
61306
61621
  Failed to update skill.`));
61307
61622
  process.exit(1);
61308
61623
  }
61309
61624
  printPaths(result.paths ?? []);
61310
- console.log(import_picocolors26.default.green(`
61625
+ console.log(import_picocolors28.default.green(`
61311
61626
  ✓ Skills updated.`));
61312
- console.log(import_picocolors26.default.dim(" Skills ship with the CLI; run `dosu upgrade` to get newer ones."));
61627
+ console.log(import_picocolors28.default.dim(" Skills ship with the CLI; run `dosu upgrade` to get newer ones."));
61313
61628
  });
61314
61629
  return cmd;
61315
61630
  }
61316
- var import_picocolors26, SKILL_NAME = "dosu", LEGACY_SKILL_SOURCE = "dosu-ai/dosu-skill", INSTALL_STATE_FILENAME = "skill-install.json", LEGACY_CACHE_FILENAME = "skill-update-check.json", SUPPORTED_SKILL_AGENTS, SKILL_AGENT_BY_PROVIDER;
61631
+ var import_picocolors28, SKILL_NAME = "dosu", LEGACY_SKILL_SOURCE = "dosu-ai/dosu-skill", INSTALL_STATE_FILENAME = "skill-install.json", LEGACY_CACHE_FILENAME = "skill-update-check.json", SUPPORTED_SKILL_AGENTS, SKILL_AGENT_BY_PROVIDER;
61317
61632
  var init_skill = __esm(() => {
61318
61633
  init_commander();
61319
61634
  init_config();
61320
61635
  init_logger();
61321
61636
  init_skills();
61322
- import_picocolors26 = __toESM(require_picocolors(), 1);
61637
+ import_picocolors28 = __toESM(require_picocolors(), 1);
61323
61638
  SUPPORTED_SKILL_AGENTS = [
61324
61639
  "claude-code",
61325
61640
  "cursor",
@@ -61352,7 +61667,7 @@ var init_skill = __esm(() => {
61352
61667
  function requireConfig11() {
61353
61668
  const cfg = requireLoginConfig();
61354
61669
  if (!cfg.active_account?.target?.org_id) {
61355
- console.error(import_picocolors27.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
61670
+ console.error(import_picocolors29.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
61356
61671
  process.exit(1);
61357
61672
  }
61358
61673
  return cfg;
@@ -61362,7 +61677,7 @@ function rejectWebOnlyProvider(provider, json) {
61362
61677
  if (json) {
61363
61678
  printResult({ provider, cli_supported: false, connect_via: "web", url }, { json: true });
61364
61679
  } else {
61365
- console.error(import_picocolors27.default.yellow(`Connecting '${provider}' sources is web-only for now. Open ${url}, add the source ` + `under Data Sources, then re-run 'dosu sources list'.`));
61680
+ console.error(import_picocolors29.default.yellow(`Connecting '${provider}' sources is web-only for now. Open ${url}, add the source ` + `under Data Sources, then re-run 'dosu sources list'.`));
61366
61681
  }
61367
61682
  process.exit(1);
61368
61683
  }
@@ -61381,7 +61696,7 @@ function sourcesCommand() {
61381
61696
  }
61382
61697
  const list = dataSources ?? [];
61383
61698
  if (list.length === 0) {
61384
- console.log(import_picocolors27.default.dim("No data sources connected."));
61699
+ console.log(import_picocolors29.default.dim("No data sources connected."));
61385
61700
  return;
61386
61701
  }
61387
61702
  printTable(["ID", "Name", "Provider", "Created"], list.map((ds) => [
@@ -61400,7 +61715,7 @@ function sourcesCommand() {
61400
61715
  return;
61401
61716
  }
61402
61717
  if (!ds) {
61403
- console.log(import_picocolors27.default.dim("Data source not found."));
61718
+ console.log(import_picocolors29.default.dim("Data source not found."));
61404
61719
  return;
61405
61720
  }
61406
61721
  printInfo([
@@ -61419,7 +61734,7 @@ function sourcesCommand() {
61419
61734
  printResult({ success: true, id }, opts);
61420
61735
  return;
61421
61736
  }
61422
- console.log(import_picocolors27.default.green(`Data source sync triggered for ${id.slice(0, 8)}.`));
61737
+ console.log(import_picocolors29.default.green(`Data source sync triggered for ${id.slice(0, 8)}.`));
61423
61738
  });
61424
61739
  cmd.command("update").description("Update a data source").argument("<id>", "Data source ID").option("--name <name>", "New name").option("--description <desc>", "New description").option("--json", "Output as JSON").action(async (id, opts) => {
61425
61740
  if (opts.name === undefined && opts.description === undefined) {
@@ -61436,7 +61751,7 @@ function sourcesCommand() {
61436
61751
  printResult(result, opts);
61437
61752
  return;
61438
61753
  }
61439
- console.log(import_picocolors27.default.green("Data source updated."));
61754
+ console.log(import_picocolors29.default.green("Data source updated."));
61440
61755
  });
61441
61756
  cmd.command("delete").description("Delete a data source").argument("<id>", "Data source ID").option("--json", "Output as JSON").action(async (id, opts) => {
61442
61757
  const cfg = requireConfig11();
@@ -61446,7 +61761,7 @@ function sourcesCommand() {
61446
61761
  printResult({ success: true, id }, opts);
61447
61762
  return;
61448
61763
  }
61449
- console.log(import_picocolors27.default.green("Data source deleted."));
61764
+ console.log(import_picocolors29.default.green("Data source deleted."));
61450
61765
  });
61451
61766
  cmd.command("connect").description("Install or update a provider integration (currently GitHub) via the browser").argument("[provider]", "Provider to connect (github)", "github").option("--json", "Emit machine-readable NDJSON progress events").option("--timeout <seconds>", "Seconds to wait for the browser install to complete", String(CONNECT_TIMEOUT_DEFAULT_SECONDS)).option("--no-open", "Print the URL without opening a browser").action(async (provider, opts) => {
61452
61767
  const providerName = provider.toLowerCase();
@@ -61474,14 +61789,14 @@ function sourcesCommand() {
61474
61789
  }));
61475
61790
  } else {
61476
61791
  console.log(`Open this URL to install or update the Dosu GitHub App:
61477
- ${import_picocolors27.default.cyan(url)}`);
61792
+ ${import_picocolors29.default.cyan(url)}`);
61478
61793
  if (opts.open !== false) {
61479
61794
  try {
61480
61795
  const open = await Promise.resolve().then(() => (init_open(), {}));
61481
61796
  await open_default(url);
61482
61797
  } catch {}
61483
61798
  }
61484
- console.log(import_picocolors27.default.dim("Waiting for the install to complete..."));
61799
+ console.log(import_picocolors29.default.dim("Waiting for the install to complete..."));
61485
61800
  }
61486
61801
  const timedOut = new Promise((resolve) => {
61487
61802
  timeoutId = setTimeout(() => resolve(null), timeoutSeconds * 1000);
@@ -61491,7 +61806,7 @@ function sourcesCommand() {
61491
61806
  if (opts.json) {
61492
61807
  console.log(JSON.stringify({ event: "timeout", timeout_seconds: timeoutSeconds }));
61493
61808
  } else {
61494
- console.error(import_picocolors27.default.red(`Timed out after ${timeoutSeconds}s. Finish the install in the browser, then re-run 'dosu sources connect github'.`));
61809
+ console.error(import_picocolors29.default.red(`Timed out after ${timeoutSeconds}s. Finish the install in the browser, then re-run 'dosu sources connect github'.`));
61495
61810
  }
61496
61811
  process.exit(1);
61497
61812
  return;
@@ -61507,14 +61822,14 @@ function sourcesCommand() {
61507
61822
  }));
61508
61823
  return;
61509
61824
  }
61510
- console.log(import_picocolors27.default.green(`GitHub App connected (installation ${result.installation_id}).`));
61825
+ console.log(import_picocolors29.default.green(`GitHub App connected (installation ${result.installation_id}).`));
61511
61826
  if (newRepositories.length > 0) {
61512
61827
  for (const repo of newRepositories) {
61513
61828
  console.log(` ${repo.slug}`);
61514
61829
  }
61515
- console.log(import_picocolors27.default.dim("Next: dosu sources create github --repo <owner/name> --library <library-id>"));
61830
+ console.log(import_picocolors29.default.dim("Next: dosu sources create github --repo <owner/name> --library <library-id>"));
61516
61831
  } else {
61517
- console.log(import_picocolors27.default.dim("No new repositories visible yet — GitHub may still be syncing. " + "Re-run 'dosu sources connect github' or check 'dosu sources list' shortly."));
61832
+ console.log(import_picocolors29.default.dim("No new repositories visible yet — GitHub may still be syncing. " + "Re-run 'dosu sources connect github' or check 'dosu sources list' shortly."));
61518
61833
  }
61519
61834
  } finally {
61520
61835
  clearTimeout(timeoutId);
@@ -61531,7 +61846,7 @@ function sourcesCommand() {
61531
61846
  const orgID = cfg.active_account.target.org_id;
61532
61847
  const libraryID = opts.library ?? cfg.active_account?.target?.space_id;
61533
61848
  if (!libraryID) {
61534
- console.error(import_picocolors27.default.red("No library specified and no active library. Pass --library <id>."));
61849
+ console.error(import_picocolors29.default.red("No library specified and no active library. Pass --library <id>."));
61535
61850
  process.exit(1);
61536
61851
  return;
61537
61852
  }
@@ -61539,12 +61854,12 @@ function sourcesCommand() {
61539
61854
  const repos = await fetchListForOrg(client, orgID);
61540
61855
  const repo = repos.find((r) => r.slug.toLowerCase() === opts.repo.toLowerCase());
61541
61856
  if (!repo) {
61542
- console.error(import_picocolors27.default.red(`Repository '${opts.repo}' is not visible to Dosu. Run ` + `'dosu sources connect github' to grant the GitHub App access, then retry.`));
61857
+ console.error(import_picocolors29.default.red(`Repository '${opts.repo}' is not visible to Dosu. Run ` + `'dosu sources connect github' to grant the GitHub App access, then retry.`));
61543
61858
  process.exit(1);
61544
61859
  return;
61545
61860
  }
61546
61861
  if (repo.is_fork === true) {
61547
- console.error(import_picocolors27.default.red(`'${repo.slug}' is a fork and can't be synced.` + (repo.fork_parent_slug ? ` Connect '${repo.fork_parent_slug}' instead.` : "")));
61862
+ console.error(import_picocolors29.default.red(`'${repo.slug}' is a fork and can't be synced.` + (repo.fork_parent_slug ? ` Connect '${repo.fork_parent_slug}' instead.` : "")));
61548
61863
  process.exit(1);
61549
61864
  return;
61550
61865
  }
@@ -61568,14 +61883,14 @@ function sourcesCommand() {
61568
61883
  dataSourceID: existingDataSources.get(repo.repository_id)
61569
61884
  });
61570
61885
  if (!created) {
61571
- console.error(import_picocolors27.default.red("Could not create the data source. Check 'dosu logs --tail 50' for details."));
61886
+ console.error(import_picocolors29.default.red("Could not create the data source. Check 'dosu logs --tail 50' for details."));
61572
61887
  process.exit(1);
61573
61888
  return;
61574
61889
  }
61575
61890
  const survivors = await verifyDataSourcesPersist(client, orgID, [created.data_source_id]);
61576
61891
  if (survivors.dropped.size > 0) {
61577
61892
  await deleteOrphanDeployment(client, created.deployment_id, repo.slug);
61578
- console.error(import_picocolors27.default.red(`Dosu couldn't sync '${repo.slug}' (the GitHub App may not have access to it). ` + "Nothing was created."));
61893
+ console.error(import_picocolors29.default.red(`Dosu couldn't sync '${repo.slug}' (the GitHub App may not have access to it). ` + "Nothing was created."));
61579
61894
  process.exit(1);
61580
61895
  return;
61581
61896
  }
@@ -61592,13 +61907,13 @@ function sourcesCommand() {
61592
61907
  printResult(receipt, opts);
61593
61908
  return;
61594
61909
  }
61595
- console.log(import_picocolors27.default.green(`Connected ${repo.slug} to library ${libraryID}.`));
61596
- console.log(import_picocolors27.default.dim(` data source ${created.data_source_id}`));
61597
- console.log(import_picocolors27.default.dim(` deployment ${created.deployment_id}`));
61910
+ console.log(import_picocolors29.default.green(`Connected ${repo.slug} to library ${libraryID}.`));
61911
+ console.log(import_picocolors29.default.dim(` data source ${created.data_source_id}`));
61912
+ console.log(import_picocolors29.default.dim(` deployment ${created.deployment_id}`));
61598
61913
  });
61599
61914
  return cmd;
61600
61915
  }
61601
- var import_picocolors27, CONNECT_TIMEOUT_DEFAULT_SECONDS = 600;
61916
+ var import_picocolors29, CONNECT_TIMEOUT_DEFAULT_SECONDS = 600;
61602
61917
  var init_sources = __esm(() => {
61603
61918
  init_commander();
61604
61919
  init_trpc();
@@ -61607,7 +61922,7 @@ var init_sources = __esm(() => {
61607
61922
  init_auth();
61608
61923
  init_confirmation();
61609
61924
  init_output();
61610
- import_picocolors27 = __toESM(require_picocolors(), 1);
61925
+ import_picocolors29 = __toESM(require_picocolors(), 1);
61611
61926
  });
61612
61927
 
61613
61928
  // src/telemetry/settings.ts
@@ -61839,7 +62154,7 @@ var init_telemetry2 = __esm(() => {
61839
62154
  function requireConfig12() {
61840
62155
  const cfg = requireLoginConfig();
61841
62156
  if (!cfg.active_account?.target?.space_id) {
61842
- console.error(import_picocolors28.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
62157
+ console.error(import_picocolors30.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
61843
62158
  process.exit(1);
61844
62159
  }
61845
62160
  return cfg;
@@ -61890,7 +62205,7 @@ function threadsCommand() {
61890
62205
  return;
61891
62206
  }
61892
62207
  if (!threads || threads.length === 0) {
61893
- console.log(import_picocolors28.default.dim("No threads found."));
62208
+ console.log(import_picocolors30.default.dim("No threads found."));
61894
62209
  return;
61895
62210
  }
61896
62211
  printTable(["ID", "Title", "Status", "Created"], threads.map((t) => [
@@ -61915,10 +62230,10 @@ function threadsCommand() {
61915
62230
  return;
61916
62231
  }
61917
62232
  if (!thread) {
61918
- console.log(import_picocolors28.default.dim("Thread not found."));
62233
+ console.log(import_picocolors30.default.dim("Thread not found."));
61919
62234
  return;
61920
62235
  }
61921
- console.log(import_picocolors28.default.bold(thread.generated_title ?? "(untitled thread)"));
62236
+ console.log(import_picocolors30.default.bold(thread.generated_title ?? "(untitled thread)"));
61922
62237
  printInfo([
61923
62238
  ["ID", thread.id],
61924
62239
  ["Created", formatDate(thread.created_at)],
@@ -61929,13 +62244,13 @@ function threadsCommand() {
61929
62244
  if (messages && messages.length > 0) {
61930
62245
  const allMessages = messages.flatMap((group) => group.messages);
61931
62246
  console.log(`
61932
- ${import_picocolors28.default.bold("Messages")} (${allMessages.length})`);
61933
- console.log(import_picocolors28.default.dim("─".repeat(60)));
62247
+ ${import_picocolors30.default.bold("Messages")} (${allMessages.length})`);
62248
+ console.log(import_picocolors30.default.dim("─".repeat(60)));
61934
62249
  for (const msg of allMessages) {
61935
62250
  const role = msg.author_role ?? "unknown";
61936
62251
  const date = formatDate(msg.created_at);
61937
62252
  console.log(`
61938
- ${import_picocolors28.default.bold(role)} ${import_picocolors28.default.dim(date)}`);
62253
+ ${import_picocolors30.default.bold(role)} ${import_picocolors30.default.dim(date)}`);
61939
62254
  if (msg.body) {
61940
62255
  console.log(truncate(msg.body, 500));
61941
62256
  }
@@ -61950,25 +62265,25 @@ ${import_picocolors28.default.bold(role)} ${import_picocolors28.default.dim(date
61950
62265
  printResult({ success: true, id }, opts);
61951
62266
  return;
61952
62267
  }
61953
- console.log(import_picocolors28.default.green(`Thread ${id.slice(0, 8)} archived.`));
62268
+ console.log(import_picocolors30.default.green(`Thread ${id.slice(0, 8)} archived.`));
61954
62269
  });
61955
62270
  return cmd;
61956
62271
  }
61957
- var import_picocolors28;
62272
+ var import_picocolors30;
61958
62273
  var init_threads = __esm(() => {
61959
62274
  init_commander();
61960
62275
  init_trpc();
61961
62276
  init_arguments();
61962
62277
  init_auth();
61963
62278
  init_output();
61964
- import_picocolors28 = __toESM(require_picocolors(), 1);
62279
+ import_picocolors30 = __toESM(require_picocolors(), 1);
61965
62280
  });
61966
62281
 
61967
62282
  // src/commands/topics.ts
61968
62283
  function requireConfig13() {
61969
62284
  const cfg = requireLoginConfig();
61970
62285
  if (!cfg.active_account?.target?.space_id) {
61971
- console.error(import_picocolors29.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
62286
+ console.error(import_picocolors31.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
61972
62287
  process.exit(1);
61973
62288
  }
61974
62289
  return cfg;
@@ -61978,7 +62293,7 @@ async function getKnowledgeStoreId3(client, spaceId) {
61978
62293
  space_id: spaceId
61979
62294
  });
61980
62295
  if (!store) {
61981
- console.error(import_picocolors29.default.red("No knowledge store found for this deployment."));
62296
+ console.error(import_picocolors31.default.red("No knowledge store found for this deployment."));
61982
62297
  process.exit(1);
61983
62298
  }
61984
62299
  return store.id;
@@ -61997,7 +62312,7 @@ function topicsCommand() {
61997
62312
  return;
61998
62313
  }
61999
62314
  if (!topics || topics.length === 0) {
62000
- console.log(import_picocolors29.default.dim("No topics found."));
62315
+ console.log(import_picocolors31.default.dim("No topics found."));
62001
62316
  return;
62002
62317
  }
62003
62318
  printTable(["ID", "Name", "Description"], topics.map((t) => [
@@ -62022,7 +62337,7 @@ function topicsCommand() {
62022
62337
  return;
62023
62338
  }
62024
62339
  if (!pages || pages.length === 0) {
62025
- console.log(import_picocolors29.default.dim("No pages found with this topic."));
62340
+ console.log(import_picocolors31.default.dim("No pages found with this topic."));
62026
62341
  return;
62027
62342
  }
62028
62343
  printTable(["ID", "Title"], pages.map((p) => [
@@ -62032,14 +62347,14 @@ function topicsCommand() {
62032
62347
  });
62033
62348
  return cmd;
62034
62349
  }
62035
- var import_picocolors29;
62350
+ var import_picocolors31;
62036
62351
  var init_topics = __esm(() => {
62037
62352
  init_commander();
62038
62353
  init_trpc();
62039
62354
  init_arguments();
62040
62355
  init_auth();
62041
62356
  init_output();
62042
- import_picocolors29 = __toESM(require_picocolors(), 1);
62357
+ import_picocolors31 = __toESM(require_picocolors(), 1);
62043
62358
  });
62044
62359
 
62045
62360
  // src/mcp/providers/base.ts
@@ -63011,23 +63326,23 @@ function buildUpdateHint(channel, npx = false) {
63011
63326
  function styleHint(hint) {
63012
63327
  const match = hint.match(/^(.*)("[^"]+")(.*)$/);
63013
63328
  if (!match)
63014
- return import_picocolors30.default.dim(hint);
63329
+ return import_picocolors32.default.dim(hint);
63015
63330
  const [, before, command, after] = match;
63016
- return [before && import_picocolors30.default.dim(before), import_picocolors30.default.cyan(command), after && import_picocolors30.default.dim(after)].filter(Boolean).join("");
63331
+ return [before && import_picocolors32.default.dim(before), import_picocolors32.default.cyan(command), after && import_picocolors32.default.dim(after)].filter(Boolean).join("");
63017
63332
  }
63018
63333
  function framedNotice(content, width) {
63019
63334
  const innerWidth = Math.max(...content.map(visibleWidth2)) + BOX_PADDING * 2;
63020
63335
  const framed = (line) => {
63021
63336
  const pad = innerWidth - visibleWidth2(line);
63022
63337
  const left = Math.floor(pad / 2);
63023
- return `${import_picocolors30.default.yellow("│")}${" ".repeat(left)}${line}${" ".repeat(pad - left)}${import_picocolors30.default.yellow("│")}`;
63338
+ return `${import_picocolors32.default.yellow("│")}${" ".repeat(left)}${line}${" ".repeat(pad - left)}${import_picocolors32.default.yellow("│")}`;
63024
63339
  };
63025
63340
  const box = [
63026
- import_picocolors30.default.yellow(`╭${"─".repeat(innerWidth)}╮`),
63341
+ import_picocolors32.default.yellow(`╭${"─".repeat(innerWidth)}╮`),
63027
63342
  framed(""),
63028
63343
  ...content.map(framed),
63029
63344
  framed(""),
63030
- import_picocolors30.default.yellow(`╰${"─".repeat(innerWidth)}╯`)
63345
+ import_picocolors32.default.yellow(`╰${"─".repeat(innerWidth)}╯`)
63031
63346
  ];
63032
63347
  return `
63033
63348
  ${centerBlock(box, width).join(`
@@ -63035,13 +63350,13 @@ ${centerBlock(box, width).join(`
63035
63350
  `;
63036
63351
  }
63037
63352
  function versionArrow(current, latest) {
63038
- return `${import_picocolors30.default.dim(current)} ${import_picocolors30.default.dim("→")} ${import_picocolors30.default.bold(brand(latest))}`;
63353
+ return `${import_picocolors32.default.dim(current)} ${import_picocolors32.default.dim("→")} ${import_picocolors32.default.bold(brand(latest))}`;
63039
63354
  }
63040
63355
  function buildAutoUpdateNotice(current, latest, interactive, width = process.stderr.columns ?? 80) {
63041
63356
  if (interactive) {
63042
63357
  return framedNotice([
63043
63358
  `Updating Dosu: ${versionArrow(current, latest)}`,
63044
- import_picocolors30.default.dim("Installing in the background; your next command uses it")
63359
+ import_picocolors32.default.dim("Installing in the background; your next command uses it")
63045
63360
  ], width);
63046
63361
  }
63047
63362
  return `
@@ -63098,14 +63413,14 @@ async function checkForUpdates(options = {}) {
63098
63413
  logger.error("update-check", `Update check failed: ${err}`);
63099
63414
  }
63100
63415
  }
63101
- var import_picocolors30, CACHE_FILENAME3 = "update-check.json", CHECK_INTERVAL_MS2, FETCH_TIMEOUT_MS2 = 1000, REGISTRY_URL = "https://registry.npmjs.org/-/package/@dosu/cli/dist-tags", SEMVER_PATTERN, BOX_PADDING = 3;
63416
+ var import_picocolors32, CACHE_FILENAME3 = "update-check.json", CHECK_INTERVAL_MS2, FETCH_TIMEOUT_MS2 = 1000, REGISTRY_URL = "https://registry.npmjs.org/-/package/@dosu/cli/dist-tags", SEMVER_PATTERN, BOX_PADDING = 3;
63102
63417
  var init_update_check = __esm(() => {
63103
63418
  init_config();
63104
63419
  init_logger();
63105
63420
  init_styles();
63106
63421
  init_layout();
63107
63422
  init_auto_update();
63108
- import_picocolors30 = __toESM(require_picocolors(), 1);
63423
+ import_picocolors32 = __toESM(require_picocolors(), 1);
63109
63424
  CHECK_INTERVAL_MS2 = 6 * 60 * 60 * 1000;
63110
63425
  SEMVER_PATTERN = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
63111
63426
  });
@@ -63154,8 +63469,8 @@ function canRefreshMcp(cfg) {
63154
63469
  }
63155
63470
  function displayNotice(names) {
63156
63471
  console.error(`
63157
- ${import_picocolors31.default.green(`✓ Dosu ${VERSION}: refreshed MCP config for ${names.join(", ")}`)}
63158
- ` + `${import_picocolors31.default.dim(` Run ${import_picocolors31.default.cyan('"dosu setup"')} to also update hooks and rules, then restart your AI agents.`)}
63472
+ ${import_picocolors33.default.green(`✓ Dosu ${VERSION}: refreshed MCP config for ${names.join(", ")}`)}
63473
+ ` + `${import_picocolors33.default.dim(` Run ${import_picocolors33.default.cyan('"dosu setup"')} to also update hooks and rules, then restart your AI agents.`)}
63159
63474
  `);
63160
63475
  }
63161
63476
  function checkForMcpRefresh(options = {}) {
@@ -63183,13 +63498,13 @@ function checkForMcpRefresh(options = {}) {
63183
63498
  logger.error("mcp-refresh", `MCP refresh check failed: ${err}`);
63184
63499
  }
63185
63500
  }
63186
- var import_picocolors31, CACHE_FILENAME4 = "mcp-refresh.json", MCP_FORMAT_CHANGES;
63501
+ var import_picocolors33, CACHE_FILENAME4 = "mcp-refresh.json", MCP_FORMAT_CHANGES;
63187
63502
  var init_mcp_refresh_check = __esm(() => {
63188
63503
  init_config();
63189
63504
  init_logger();
63190
63505
  init_refresh();
63191
63506
  init_update_check();
63192
- import_picocolors31 = __toESM(require_picocolors(), 1);
63507
+ import_picocolors33 = __toESM(require_picocolors(), 1);
63193
63508
  MCP_FORMAT_CHANGES = [
63194
63509
  "0.53.0",
63195
63510
  "0.62.0"
@@ -63199,8 +63514,8 @@ var init_mcp_refresh_check = __esm(() => {
63199
63514
  // src/version/skill-update-check.ts
63200
63515
  function displayNotice2() {
63201
63516
  console.error(`
63202
- ${import_picocolors32.default.green(`✓ Dosu ${VERSION}: refreshed the bundled agent skills`)}
63203
- ` + `${import_picocolors32.default.dim(" Restart your AI agents to pick up the new skill content.")}
63517
+ ${import_picocolors34.default.green(`✓ Dosu ${VERSION}: refreshed the bundled agent skills`)}
63518
+ ` + `${import_picocolors34.default.dim(" Restart your AI agents to pick up the new skill content.")}
63204
63519
  `);
63205
63520
  }
63206
63521
  function checkForSkillUpdates(options = {}) {
@@ -63221,11 +63536,11 @@ function checkForSkillUpdates(options = {}) {
63221
63536
  logger.error("skill-update-check", `Skill update check failed: ${err}`);
63222
63537
  }
63223
63538
  }
63224
- var import_picocolors32;
63539
+ var import_picocolors34;
63225
63540
  var init_skill_update_check = __esm(() => {
63226
63541
  init_skill();
63227
63542
  init_logger();
63228
- import_picocolors32 = __toESM(require_picocolors(), 1);
63543
+ import_picocolors34 = __toESM(require_picocolors(), 1);
63229
63544
  });
63230
63545
 
63231
63546
  // src/auth/errors.ts
@@ -63588,15 +63903,15 @@ function statusLine(status) {
63588
63903
  if (status.running) {
63589
63904
  const since = status.startedAt ? ` · since ${localTime(status.startedAt)}` : "";
63590
63905
  const pid = status.pid !== undefined ? ` (pid ${status.pid})` : "";
63591
- return `\uD83D\uDCDA ${import_picocolors33.default.bold(brand("Studying sessions..."))}${import_picocolors33.default.dim(`${pid}${since}`)}`;
63906
+ return `\uD83D\uDCDA ${import_picocolors35.default.bold(brand("Studying sessions..."))}${import_picocolors35.default.dim(`${pid}${since}`)}`;
63592
63907
  }
63593
63908
  if (status.state.paused) {
63594
- return `${import_picocolors33.default.yellow("○")} ${import_picocolors33.default.bold("Paused")} ${import_picocolors33.default.dim("· studying stays off until you resume")}`;
63909
+ return `${import_picocolors35.default.yellow("○")} ${import_picocolors35.default.bold("Paused")} ${import_picocolors35.default.dim("· studying stays off until you resume")}`;
63595
63910
  }
63596
63911
  if (status.staleLock) {
63597
- return `${import_picocolors33.default.yellow("○")} ${import_picocolors33.default.bold("Not running")} ${import_picocolors33.default.dim("· a previous run exited without cleaning up")}`;
63912
+ return `${import_picocolors35.default.yellow("○")} ${import_picocolors35.default.bold("Not running")} ${import_picocolors35.default.dim("· a previous run exited without cleaning up")}`;
63598
63913
  }
63599
- return `${import_picocolors33.default.dim("○")} ${import_picocolors33.default.bold("Idle")} ${import_picocolors33.default.dim("· hooks study new sessions automatically")}`;
63914
+ return `${import_picocolors35.default.dim("○")} ${import_picocolors35.default.bold("Idle")} ${import_picocolors35.default.dim("· hooks study new sessions automatically")}`;
63600
63915
  }
63601
63916
  function progressLine(done, ready, width, notes = 0) {
63602
63917
  const total = done + ready;
@@ -63605,7 +63920,7 @@ function progressLine(done, ready, width, notes = 0) {
63605
63920
  const cells = Math.max(10, Math.min(30, width - 44));
63606
63921
  const ratio = Math.max(0, Math.min(1, done / total));
63607
63922
  const filled = Math.min(cells, Math.round(ratio * cells));
63608
- const bar = brand("█".repeat(filled)) + import_picocolors33.default.dim("░".repeat(cells - filled));
63923
+ const bar = brand("█".repeat(filled)) + import_picocolors35.default.dim("░".repeat(cells - filled));
63609
63924
  const pct = Math.floor(ratio * 100);
63610
63925
  const suffix = notes > 0 ? ` · ${notes} suggested page${notes === 1 ? "" : "s"}` : "";
63611
63926
  return `${bar} ${done}/${total} studied · ${pct}%${suffix}`;
@@ -63644,17 +63959,17 @@ function confirmBox(queuedCount, backlog, width, mode = "start") {
63644
63959
  const verb = mode === "clear" ? "clear" : mode === "stop" ? "stop" : mode === "resume" ? "resume" : "start";
63645
63960
  const maxInner = Math.max(20, Math.min(width, contentWidth()) - 4);
63646
63961
  const rows = [
63647
- import_picocolors33.default.bold(brand(title)),
63648
- ...wrapLine(scope, maxInner, "").map((line) => import_picocolors33.default.dim(line)),
63962
+ import_picocolors35.default.bold(brand(title)),
63963
+ ...wrapLine(scope, maxInner, "").map((line) => import_picocolors35.default.dim(line)),
63649
63964
  "",
63650
- `${import_picocolors33.default.bold("enter")} ${verb} · ${import_picocolors33.default.bold("esc")} cancel`
63965
+ `${import_picocolors35.default.bold("enter")} ${verb} · ${import_picocolors35.default.bold("esc")} cancel`
63651
63966
  ];
63652
63967
  const inner = Math.min(maxInner, Math.max(...rows.map(visibleWidth2)));
63653
63968
  const pad = (row) => row + " ".repeat(Math.max(0, inner - visibleWidth2(row)));
63654
63969
  return [
63655
- import_picocolors33.default.dim(`╭${"─".repeat(inner + 2)}╮`),
63656
- ...rows.map((row) => `${import_picocolors33.default.dim("│")} ${pad(row)} ${import_picocolors33.default.dim("│")}`),
63657
- import_picocolors33.default.dim(`╰${"─".repeat(inner + 2)}╯`)
63970
+ import_picocolors35.default.dim(`╭${"─".repeat(inner + 2)}╮`),
63971
+ ...rows.map((row) => `${import_picocolors35.default.dim("│")} ${pad(row)} ${import_picocolors35.default.dim("│")}`),
63972
+ import_picocolors35.default.dim(`╰${"─".repeat(inner + 2)}╯`)
63658
63973
  ];
63659
63974
  }
63660
63975
  function buildActivityFrame(status, activity, width, backlog = null, pane = DEFAULT_PANE, queued = [], studiedBeforeRun = 0, open = [], runProgress = null, projectNames = {}, sessionNames = {}, frameLines) {
@@ -63670,7 +63985,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
63670
63985
  progress = progressLine(studiedDelta + stepDone, Math.max(0, backlog.ready - stepDone), width, runProgress?.notes ?? 0);
63671
63986
  }
63672
63987
  const refusal = !status.running && status.state.last_refusal;
63673
- const refusalLines = refusal ? wrapLine(`! Studying paused: ${refusal.message} (${localTime(refusal.at)})`, width).map((line) => import_picocolors33.default.yellow(line)) : [];
63988
+ const refusalLines = refusal ? wrapLine(`! Studying paused: ${refusal.message} (${localTime(refusal.at)})`, width).map((line) => import_picocolors35.default.yellow(line)) : [];
63674
63989
  const fullRows = Boolean(pane.fullRows);
63675
63990
  const withName = (item, key) => projectNames[key] ? { ...item, project: projectNames[key] } : item;
63676
63991
  const latestPass = new Map;
@@ -63696,8 +64011,8 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
63696
64011
  breadcrumb(["home", "activity"], width),
63697
64012
  "",
63698
64013
  statusLine(status),
63699
- import_picocolors33.default.dim(studied),
63700
- ...queueDetail.length > 0 ? wrapLine(queueDetail.join(" · "), width).map((line) => import_picocolors33.default.dim(line)) : [],
64014
+ import_picocolors35.default.dim(studied),
64015
+ ...queueDetail.length > 0 ? wrapLine(queueDetail.join(" · "), width).map((line) => import_picocolors35.default.dim(line)) : [],
63701
64016
  ...progress ? [progress] : [],
63702
64017
  ...refusalLines,
63703
64018
  "",
@@ -63713,7 +64028,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
63713
64028
  status.running ? "s stop" : status.state.paused ? "s resume" : "s sync now",
63714
64029
  ...!status.running && status.state.watermark ? ["c clear"] : [],
63715
64030
  "esc back"
63716
- ].join(" · "), width, "").map((line) => import_picocolors33.default.dim(line))
64031
+ ].join(" · "), width, "").map((line) => import_picocolors35.default.dim(line))
63717
64032
  ]
63718
64033
  ];
63719
64034
  const defaultHeight = fullRows ? ACTIVITY_VIEW_FULL_LIST_ROWS : ACTIVITY_VIEW_LIST_LINES;
@@ -63726,7 +64041,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
63726
64041
  ({ visible, above, below } = windowList(source, pane.scroll, height));
63727
64042
  display = visible.flatMap((row) => wrapRow(row, width));
63728
64043
  }
63729
- const listRows = display.length > 0 ? display.map((row) => import_picocolors33.default.dim(row)) : [import_picocolors33.default.dim(empty)];
64044
+ const listRows = display.length > 0 ? display.map((row) => import_picocolors35.default.dim(row)) : [import_picocolors35.default.dim(empty)];
63730
64045
  const scrollParts = [];
63731
64046
  if (above > 0)
63732
64047
  scrollParts.push(`↑ ${above} earlier`);
@@ -63735,7 +64050,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
63735
64050
  const lines = [
63736
64051
  ...header,
63737
64052
  ...listRows,
63738
- ...scrollParts.length > 0 ? [import_picocolors33.default.dim(clip(scrollParts.join(" · "), width))] : [],
64053
+ ...scrollParts.length > 0 ? [import_picocolors35.default.dim(clip(scrollParts.join(" · "), width))] : [],
63739
64054
  ...footer
63740
64055
  ];
63741
64056
  return { lines, listHeight: height };
@@ -63990,7 +64305,7 @@ ${CLEAR_BELOW}`);
63990
64305
  input.on("data", onData);
63991
64306
  });
63992
64307
  }
63993
- var import_picocolors33, ESC7, HIDE_CURSOR3, SHOW_CURSOR3, CTRL_C4, KEY_UP4, KEY_DOWN4, KEY_RIGHT3, KEY_LEFT3, CURSOR_HOME, CLEAR_BELOW, CLEAR_EOL, ACTIVITY_VIEW_POLL_MS = 500, ACTIVITY_VIEW_LIST_LINES = 10, ACTIVITY_VIEW_FULL_LIST_ROWS = 5, ACTIVITY_VIEW_BUFFER_LINES = 200, ACTIVITY_VIEW_TABS, DEFAULT_PANE, TITLE_READS_PER_DRAW = 25;
64308
+ var import_picocolors35, ESC7, HIDE_CURSOR3, SHOW_CURSOR3, CTRL_C4, KEY_UP4, KEY_DOWN4, KEY_RIGHT3, KEY_LEFT3, CURSOR_HOME, CLEAR_BELOW, CLEAR_EOL, ACTIVITY_VIEW_POLL_MS = 500, ACTIVITY_VIEW_LIST_LINES = 10, ACTIVITY_VIEW_FULL_LIST_ROWS = 5, ACTIVITY_VIEW_BUFFER_LINES = 200, ACTIVITY_VIEW_TABS, DEFAULT_PANE, TITLE_READS_PER_DRAW = 25;
63994
64309
  var init_activity_view = __esm(() => {
63995
64310
  init_follow();
63996
64311
  init_logger();
@@ -64005,7 +64320,7 @@ var init_activity_view = __esm(() => {
64005
64320
  init_alt_screen();
64006
64321
  init_layout();
64007
64322
  init_menu();
64008
- import_picocolors33 = __toESM(require_picocolors(), 1);
64323
+ import_picocolors35 = __toESM(require_picocolors(), 1);
64009
64324
  ESC7 = String.fromCharCode(27);
64010
64325
  HIDE_CURSOR3 = `${ESC7}[?25l`;
64011
64326
  SHOW_CURSOR3 = `${ESC7}[?25h`;
@@ -65723,7 +66038,7 @@ async function stepSelectTools(detected) {
65723
66038
  initialValues: preselected,
65724
66039
  statusFor: (id, picked) => {
65725
66040
  if (configuredMap.get(id))
65726
- return picked ? dim("configured") : import_picocolors34.default.yellow("will remove");
66041
+ return picked ? dim("configured") : import_picocolors36.default.yellow("will remove");
65727
66042
  return picked ? brand("will configure") : undefined;
65728
66043
  },
65729
66044
  summary: (picked) => {
@@ -65898,7 +66213,7 @@ ${dim(wrapLog("Run it inside a session to keep that session out of studying. Rem
65898
66213
  log2.success("All agents already configured. No changes needed.");
65899
66214
  }
65900
66215
  }
65901
- var import_picocolors34, OAUTH_ANALYTICS_REASONS, SETUP_HANDSHAKE_TIMEOUT_MS = 1800000, LIBRARY_SELECT_CANCELLED;
66216
+ var import_picocolors36, OAUTH_ANALYTICS_REASONS, SETUP_HANDSHAKE_TIMEOUT_MS = 1800000, LIBRARY_SELECT_CANCELLED;
65902
66217
  var init_flow2 = __esm(() => {
65903
66218
  init_errors4();
65904
66219
  init_client();
@@ -65921,7 +66236,7 @@ var init_flow2 = __esm(() => {
65921
66236
  init_analytics2();
65922
66237
  init_rules_step();
65923
66238
  init_styles();
65924
- import_picocolors34 = __toESM(require_picocolors(), 1);
66239
+ import_picocolors36 = __toESM(require_picocolors(), 1);
65925
66240
  OAUTH_ANALYTICS_REASONS = new Set([
65926
66241
  "access_denied",
65927
66242
  "bad_oauth_state",
@@ -66085,7 +66400,7 @@ Could not update Dosu automatically.`);
66085
66400
  ${plan.manualCommand}`);
66086
66401
  return result.status && result.status > 0 ? result.status : 1;
66087
66402
  }
66088
- console.log(import_picocolors35.default.green(`
66403
+ console.log(import_picocolors37.default.green(`
66089
66404
  ✓ Update command completed.`));
66090
66405
  console.log('Run "dosu --version" to verify.');
66091
66406
  return 0;
@@ -66132,7 +66447,7 @@ async function finishUpgrade(from, options = {}) {
66132
66447
  if (!needsMcpRefresh(previous, VERSION)) {
66133
66448
  checkForSkillUpdates();
66134
66449
  writeMcpRefreshCache({ version: VERSION });
66135
- console.log(import_picocolors35.default.green(`✓ Dosu ${VERSION} is ready. Your AI agents need no changes.`));
66450
+ console.log(import_picocolors37.default.green(`✓ Dosu ${VERSION} is ready. Your AI agents need no changes.`));
66136
66451
  return 0;
66137
66452
  }
66138
66453
  if (options.interactive ?? isInteractiveTerminal()) {
@@ -66197,7 +66512,7 @@ function upgradeCommand() {
66197
66512
  process.exitCode = status;
66198
66513
  });
66199
66514
  }
66200
- var import_picocolors35, PACKAGE_NAME = "@dosu/cli", LATEST_PACKAGE, BREW_MANUAL_COMMAND = "brew upgrade dosu-ai/dosu/dosu", NPX_COMMAND = "npx -y @dosu/cli@latest", PROBE_TIMEOUT_MS = 5000, RELEASES_URL = "https://github.com/dosu-ai/dosu-cli/releases/latest", PACKAGE_MANAGERS, SETUP_FALLBACK = 'Run "dosu setup" to finish updating your AI agents.', SEMVER;
66515
+ var import_picocolors37, PACKAGE_NAME = "@dosu/cli", LATEST_PACKAGE, BREW_MANUAL_COMMAND = "brew upgrade dosu-ai/dosu/dosu", NPX_COMMAND = "npx -y @dosu/cli@latest", PROBE_TIMEOUT_MS = 5000, RELEASES_URL = "https://github.com/dosu-ai/dosu-cli/releases/latest", PACKAGE_MANAGERS, SETUP_FALLBACK = 'Run "dosu setup" to finish updating your AI agents.', SEMVER;
66201
66516
  var init_upgrade = __esm(() => {
66202
66517
  init_commander();
66203
66518
  init_config();
@@ -66205,7 +66520,7 @@ var init_upgrade = __esm(() => {
66205
66520
  init_auto_update();
66206
66521
  init_mcp_refresh_check();
66207
66522
  init_skill_update_check();
66208
- import_picocolors35 = __toESM(require_picocolors(), 1);
66523
+ import_picocolors37 = __toESM(require_picocolors(), 1);
66209
66524
  LATEST_PACKAGE = `${PACKAGE_NAME}@latest`;
66210
66525
  PACKAGE_MANAGERS = {
66211
66526
  npm: {
@@ -66345,7 +66660,7 @@ function renderAnalyticsFrame(state, tab, scroll, pageStats = null, pagesPending
66345
66660
  const rows = analyticsTabRows(tab, state, pageStats);
66346
66661
  const { visible, above, below } = windowReport(rows, scroll, height);
66347
66662
  const empty = tab === "overview" ? "No analytics yet. They appear after the first study run." : tab === "projects" ? "No per-project history yet. It fills in as sessions are studied." : pagesPending ? "Loading page analytics..." : "No page analytics yet.";
66348
- const listRows = visible.length > 0 ? visible.map((row) => import_picocolors36.default.dim(row)) : [import_picocolors36.default.dim(empty)];
66663
+ const listRows = visible.length > 0 ? visible.map((row) => import_picocolors38.default.dim(row)) : [import_picocolors38.default.dim(empty)];
66349
66664
  const scrollParts = [];
66350
66665
  if (above > 0)
66351
66666
  scrollParts.push(`↑ ${above} earlier`);
@@ -66361,9 +66676,9 @@ function renderAnalyticsFrame(state, tab, scroll, pageStats = null, pagesPending
66361
66676
  ], tab, width, { spread: false }),
66362
66677
  "",
66363
66678
  ...listRows,
66364
- ...scrollParts.length > 0 ? [import_picocolors36.default.dim(scrollParts.join(" · "))] : [],
66679
+ ...scrollParts.length > 0 ? [import_picocolors38.default.dim(scrollParts.join(" · "))] : [],
66365
66680
  "",
66366
- import_picocolors36.default.dim("tab switch · ↑↓ scroll · esc back")
66681
+ import_picocolors38.default.dim("tab switch · ↑↓ scroll · esc back")
66367
66682
  ];
66368
66683
  return lines.join(`
66369
66684
  `);
@@ -66460,7 +66775,7 @@ ${CLEAR_BELOW2}`);
66460
66775
  input.on("data", onData);
66461
66776
  });
66462
66777
  }
66463
- var import_picocolors36, ESC8, HIDE_CURSOR4, SHOW_CURSOR4, CTRL_C5, KEY_UP5, KEY_DOWN5, KEY_RIGHT4, KEY_LEFT4, CURSOR_HOME2, CLEAR_BELOW2, CLEAR_EOL2, ANALYTICS_VIEW_POLL_MS = 1000, ANALYTICS_VIEW_LINES = 14, ANALYTICS_VIEW_CHROME_LINES = 8, ANALYTICS_VIEW_TABS, TOP_PAGES_LIMIT = 5, TOP_CITED_DAYS = 30, label = (text) => text.padEnd(26);
66778
+ var import_picocolors38, ESC8, HIDE_CURSOR4, SHOW_CURSOR4, CTRL_C5, KEY_UP5, KEY_DOWN5, KEY_RIGHT4, KEY_LEFT4, CURSOR_HOME2, CLEAR_BELOW2, CLEAR_EOL2, ANALYTICS_VIEW_POLL_MS = 1000, ANALYTICS_VIEW_LINES = 14, ANALYTICS_VIEW_CHROME_LINES = 8, ANALYTICS_VIEW_TABS, TOP_PAGES_LIMIT = 5, TOP_CITED_DAYS = 30, label = (text) => text.padEnd(26);
66464
66779
  var init_analytics_view = __esm(() => {
66465
66780
  init_trpc();
66466
66781
  init_config();
@@ -66468,7 +66783,7 @@ var init_analytics_view = __esm(() => {
66468
66783
  init_alt_screen();
66469
66784
  init_layout();
66470
66785
  init_menu();
66471
- import_picocolors36 = __toESM(require_picocolors(), 1);
66786
+ import_picocolors38 = __toESM(require_picocolors(), 1);
66472
66787
  ESC8 = String.fromCharCode(27);
66473
66788
  HIDE_CURSOR4 = `${ESC8}[?25l`;
66474
66789
  SHOW_CURSOR4 = `${ESC8}[?25h`;
@@ -66486,7 +66801,7 @@ var init_analytics_view = __esm(() => {
66486
66801
  // src/tui/banner.ts
66487
66802
  function paintLogoRow(row) {
66488
66803
  return row.map(([tone, art]) => {
66489
- if (!import_picocolors37.default.isColorSupported)
66804
+ if (!import_picocolors39.default.isColorSupported)
66490
66805
  return art;
66491
66806
  const { fg, fallback } = LOGO_TONES[tone];
66492
66807
  return hasTruecolor() ? `${fg}${art}\x1B[39m` : fallback(art);
@@ -66494,14 +66809,14 @@ function paintLogoRow(row) {
66494
66809
  }
66495
66810
  function checklistRows(ctx) {
66496
66811
  const on = brand(CHECK2);
66497
- const off = import_picocolors37.default.dim(CIRCLE);
66812
+ const off = import_picocolors39.default.dim(CIRCLE);
66498
66813
  const rows = [["workspace", ctx.directory]];
66499
66814
  rows.push([
66500
66815
  "account",
66501
- ctx.sessionExpired ? `${off} ${import_picocolors37.default.yellow("session expired")} ${import_picocolors37.default.dim(`${DOT3} run Log in`)}` : ctx.signedIn ? `${on} signed in` : `${off} ${import_picocolors37.default.dim(`not signed in ${DOT3} run Setup`)}`
66816
+ ctx.sessionExpired ? `${off} ${import_picocolors39.default.yellow("session expired")} ${import_picocolors39.default.dim(`${DOT3} run Log in`)}` : ctx.signedIn ? `${on} signed in` : `${off} ${import_picocolors39.default.dim(`not signed in ${DOT3} run Setup`)}`
66502
66817
  ]);
66503
66818
  const missing = new Set(ctx.setupMissing ?? []);
66504
- const warnRow = `${off} ${import_picocolors37.default.yellow("not configured")} ${import_picocolors37.default.dim(`${DOT3} run Setup`)}`;
66819
+ const warnRow = `${off} ${import_picocolors39.default.yellow("not configured")} ${import_picocolors39.default.dim(`${DOT3} run Setup`)}`;
66505
66820
  if (missing.has("MCP"))
66506
66821
  rows.push(["mcp", warnRow]);
66507
66822
  else if (ctx.deploymentName)
@@ -66513,7 +66828,7 @@ function checklistRows(ctx) {
66513
66828
  if (ctx.repoAgentsMd) {
66514
66829
  rows.push([
66515
66830
  "repo",
66516
- ctx.repoAgentsMd === "current" ? `${on} AGENTS.md has the Dosu section` : `${off} ${import_picocolors37.default.yellow(ctx.repoAgentsMd === "outdated" ? "AGENTS.md Dosu section outdated" : "AGENTS.md missing the Dosu section")} ${import_picocolors37.default.dim(`${DOT3} run Setup`)}`
66831
+ ctx.repoAgentsMd === "current" ? `${on} AGENTS.md has the Dosu section` : `${off} ${import_picocolors39.default.yellow(ctx.repoAgentsMd === "outdated" ? "AGENTS.md Dosu section outdated" : "AGENTS.md missing the Dosu section")} ${import_picocolors39.default.dim(`${DOT3} run Setup`)}`
66517
66832
  ]);
66518
66833
  }
66519
66834
  if (missing.has("agents"))
@@ -66525,24 +66840,24 @@ function checklistRows(ctx) {
66525
66840
  if (ctx.studying) {
66526
66841
  rows.push([
66527
66842
  "sync",
66528
- `\uD83D\uDCDA ${brand("studying sessions...")} ${import_picocolors37.default.dim(`${DOT3} see activity`)}`
66843
+ `\uD83D\uDCDA ${brand("studying sessions...")} ${import_picocolors39.default.dim(`${DOT3} see activity`)}`
66529
66844
  ]);
66530
66845
  }
66531
66846
  if (ctx.update) {
66532
66847
  rows.push([
66533
66848
  "update",
66534
- `${import_picocolors37.default.yellow(`↑ ${ctx.update.version} available`)} ${import_picocolors37.default.dim(`${DOT3} ${ctx.update.hint}`)}`
66849
+ `${import_picocolors39.default.yellow(`↑ ${ctx.update.version} available`)} ${import_picocolors39.default.dim(`${DOT3} ${ctx.update.hint}`)}`
66535
66850
  ]);
66536
66851
  }
66537
66852
  const labelWidth = Math.max(...rows.map(([label]) => label.length));
66538
- return rows.map(([label, value]) => `${import_picocolors37.default.dim(label.padEnd(labelWidth))} ${value}`);
66853
+ return rows.map(([label, value]) => `${import_picocolors39.default.dim(label.padEnd(labelWidth))} ${value}`);
66539
66854
  }
66540
66855
  function renderBanner(ctx) {
66541
66856
  const logo = LOGO_ROWS.map(paintLogoRow);
66542
66857
  const text = [
66543
66858
  ...checklistRows(ctx),
66544
66859
  "",
66545
- `${brandBadge("dosu-cli")} ${import_picocolors37.default.dim(`${ctx.version} ${DOT3} ${ctx.webAppHost}`)}`
66860
+ `${brandBadge("dosu-cli")} ${import_picocolors39.default.dim(`${ctx.version} ${DOT3} ${ctx.webAppHost}`)}`
66546
66861
  ];
66547
66862
  const height = Math.max(logo.length, text.length);
66548
66863
  const combined = [];
@@ -66555,10 +66870,10 @@ function renderBanner(ctx) {
66555
66870
  return ["", ...combined, ""].join(`
66556
66871
  `);
66557
66872
  }
66558
- var import_picocolors37, CHECK2 = "✔", CIRCLE = "○", DOT3 = "·", LOGO_ROWS, LOGO_MARK, LOGO_WIDTH, LOGO_TONES, COLUMN_GAP = " ";
66873
+ var import_picocolors39, CHECK2 = "✔", CIRCLE = "○", DOT3 = "·", LOGO_ROWS, LOGO_MARK, LOGO_WIDTH, LOGO_TONES, COLUMN_GAP = " ";
66559
66874
  var init_banner = __esm(() => {
66560
66875
  init_styles();
66561
- import_picocolors37 = __toESM(require_picocolors(), 1);
66876
+ import_picocolors39 = __toESM(require_picocolors(), 1);
66562
66877
  LOGO_ROWS = [
66563
66878
  [["sage", "▄▄▄▄▄▄"]],
66564
66879
  [["sage", "██ ▀▄"]],
@@ -66569,8 +66884,8 @@ var init_banner = __esm(() => {
66569
66884
  LOGO_MARK = LOGO_ROWS.map((row) => row.map(([, art]) => art).join(""));
66570
66885
  LOGO_WIDTH = Math.max(...LOGO_MARK.map((row) => row.length));
66571
66886
  LOGO_TONES = {
66572
- sage: { fg: "\x1B[38;2;180;187;145m", fallback: import_picocolors37.default.green },
66573
- moss: { fg: "\x1B[38;2;119;133;97m", fallback: (art) => import_picocolors37.default.dim(import_picocolors37.default.green(art)) }
66887
+ sage: { fg: "\x1B[38;2;180;187;145m", fallback: import_picocolors39.default.green },
66888
+ moss: { fg: "\x1B[38;2;119;133;97m", fallback: (art) => import_picocolors39.default.dim(import_picocolors39.default.green(art)) }
66574
66889
  };
66575
66890
  });
66576
66891
 
@@ -66682,16 +66997,16 @@ function renderPagesFrame(model, width, selected) {
66682
66997
  const body = [];
66683
66998
  let scrollHint = "";
66684
66999
  if (model.phase === "loading") {
66685
- body.push(import_picocolors38.default.dim("Loading pages…"));
67000
+ body.push(import_picocolors40.default.dim("Loading pages…"));
66686
67001
  } else if (model.phase === "error") {
66687
- body.push(import_picocolors38.default.yellow(clip3(model.message, width)));
67002
+ body.push(import_picocolors40.default.yellow(clip3(model.message, width)));
66688
67003
  } else if (model.pages.length === 0) {
66689
- body.push(import_picocolors38.default.dim("No pages in this Library yet."));
67004
+ body.push(import_picocolors40.default.dim("No pages in this Library yet."));
66690
67005
  } else {
66691
67006
  const rows = pageRows2(model.pages, width - 2);
66692
67007
  const { start, above } = windowSelection(rows.length, selected);
66693
67008
  const visible = rows.slice(start, start + PAGES_VIEW_LINES);
66694
- body.push(...visible.map((row, i) => start + i === selected ? `${brand("▸")} ${import_picocolors38.default.bold(row)}` : ` ${import_picocolors38.default.dim(row)}`));
67009
+ body.push(...visible.map((row, i) => start + i === selected ? `${brand("▸")} ${import_picocolors40.default.bold(row)}` : ` ${import_picocolors40.default.dim(row)}`));
66695
67010
  const below = Math.max(0, Math.max(model.total, rows.length) - start - PAGES_VIEW_LINES);
66696
67011
  const parts = [];
66697
67012
  if (above > 0)
@@ -66700,14 +67015,14 @@ function renderPagesFrame(model, width, selected) {
66700
67015
  parts.push(`↓ ${below} more`);
66701
67016
  scrollHint = parts.join(" · ");
66702
67017
  }
66703
- const count = model.phase === "ready" ? ` ${import_picocolors38.default.dim(model.pages.length < model.total ? `(${model.pages.length} of ${model.total})` : `(${model.pages.length})`)}` : "";
67018
+ const count = model.phase === "ready" ? ` ${import_picocolors40.default.dim(model.pages.length < model.total ? `(${model.pages.length} of ${model.total})` : `(${model.pages.length})`)}` : "";
66704
67019
  const lines = [
66705
67020
  `${breadcrumb(["home", "pages"], width)}${count}`,
66706
67021
  "",
66707
67022
  ...body,
66708
- ...scrollHint ? [import_picocolors38.default.dim(scrollHint)] : [],
67023
+ ...scrollHint ? [import_picocolors40.default.dim(scrollHint)] : [],
66709
67024
  "",
66710
- import_picocolors38.default.dim("↑↓ move · enter open · esc back")
67025
+ import_picocolors40.default.dim("↑↓ move · enter open · esc back")
66711
67026
  ];
66712
67027
  return lines.join(`
66713
67028
  `);
@@ -66716,9 +67031,9 @@ function renderPageFrame(page, content, width, scroll) {
66716
67031
  const body = [];
66717
67032
  let scrollHint = "";
66718
67033
  if (content.phase === "loading") {
66719
- body.push(import_picocolors38.default.dim("Loading page…"));
67034
+ body.push(import_picocolors40.default.dim("Loading page…"));
66720
67035
  } else if (content.phase === "error") {
66721
- body.push(import_picocolors38.default.yellow(clip3(content.message, width)));
67036
+ body.push(import_picocolors40.default.yellow(clip3(content.message, width)));
66722
67037
  } else {
66723
67038
  const rows = wrapBody(content.body, width);
66724
67039
  const { visible, above, below } = windowReport(rows, scroll, PAGE_BODY_LINES);
@@ -66733,12 +67048,12 @@ function renderPageFrame(page, content, width, scroll) {
66733
67048
  const meta = `${page.type} · ${page.published ? "published" : "draft"} · updated ${page.updated_at.slice(0, 10)}`;
66734
67049
  const lines = [
66735
67050
  breadcrumb(["home", "pages", page.title], width),
66736
- import_picocolors38.default.dim(clip3(meta, width)),
67051
+ import_picocolors40.default.dim(clip3(meta, width)),
66737
67052
  "",
66738
67053
  ...body,
66739
- ...scrollHint ? [import_picocolors38.default.dim(scrollHint)] : [],
67054
+ ...scrollHint ? [import_picocolors40.default.dim(scrollHint)] : [],
66740
67055
  "",
66741
- import_picocolors38.default.dim("↑↓ scroll · esc back to pages")
67056
+ import_picocolors40.default.dim("↑↓ scroll · esc back to pages")
66742
67057
  ];
66743
67058
  return lines.join(`
66744
67059
  `);
@@ -66887,7 +67202,7 @@ ${CLEAR_BELOW3}`);
66887
67202
  input.on("data", onData);
66888
67203
  });
66889
67204
  }
66890
- var import_picocolors38, ESC9, HIDE_CURSOR5, SHOW_CURSOR5, CTRL_C6, KEY_UP6, KEY_DOWN6, CURSOR_HOME3, CLEAR_BELOW3, CLEAR_EOL3, PAGES_VIEW_LINES = 12, PAGE_BODY_LINES = 14, PAGES_FETCH_BATCH = 100;
67205
+ var import_picocolors40, ESC9, HIDE_CURSOR5, SHOW_CURSOR5, CTRL_C6, KEY_UP6, KEY_DOWN6, CURSOR_HOME3, CLEAR_BELOW3, CLEAR_EOL3, PAGES_VIEW_LINES = 12, PAGE_BODY_LINES = 14, PAGES_FETCH_BATCH = 100;
66891
67206
  var init_pages_view = __esm(() => {
66892
67207
  init_trpc();
66893
67208
  init_config();
@@ -66897,7 +67212,7 @@ var init_pages_view = __esm(() => {
66897
67212
  init_analytics_view();
66898
67213
  init_layout();
66899
67214
  init_menu();
66900
- import_picocolors38 = __toESM(require_picocolors(), 1);
67215
+ import_picocolors40 = __toESM(require_picocolors(), 1);
66901
67216
  ESC9 = String.fromCharCode(27);
66902
67217
  HIDE_CURSOR5 = `${ESC9}[?25l`;
66903
67218
  SHOW_CURSOR5 = `${ESC9}[?25h`;
@@ -67010,7 +67325,7 @@ function isSetUp(cfg) {
67010
67325
  }
67011
67326
  function setupHint(cfg) {
67012
67327
  const started = Boolean(cfg.active_account?.target);
67013
- return import_picocolors39.default.yellow(started ? `incomplete · missing ${missingSetupSteps(cfg).join(" + ")}` : "not set up yet");
67328
+ return import_picocolors41.default.yellow(started ? `incomplete · missing ${missingSetupSteps(cfg).join(" + ")}` : "not set up yet");
67014
67329
  }
67015
67330
  function isStudying() {
67016
67331
  try {
@@ -67255,7 +67570,7 @@ function handleLogout(cfg) {
67255
67570
  saveConfig(cfg);
67256
67571
  log2.success("Credentials cleared.");
67257
67572
  }
67258
- var import_picocolors39, ESC10, CLEAR_SCREEN;
67573
+ var import_picocolors41, ESC10, CLEAR_SCREEN;
67259
67574
  var init_tui = __esm(() => {
67260
67575
  init_client();
67261
67576
  init_config();
@@ -67279,7 +67594,7 @@ var init_tui = __esm(() => {
67279
67594
  init_menu();
67280
67595
  init_pages_view();
67281
67596
  init_prompts();
67282
- import_picocolors39 = __toESM(require_picocolors(), 1);
67597
+ import_picocolors41 = __toESM(require_picocolors(), 1);
67283
67598
  ESC10 = String.fromCharCode(27);
67284
67599
  CLEAR_SCREEN = `${ESC10}[2J${ESC10}[H`;
67285
67600
  });
@@ -68466,4 +68781,4 @@ main().catch((err) => {
68466
68781
  process.exit(1);
68467
68782
  });
68468
68783
 
68469
- //# debugId=69ea37d3-8fb0-10ad-6475-6e2164756e21
68784
+ //# debugId=274ecbf7-23f0-dedc-6475-6e2164756e21