@dosu/cli 0.64.1 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/dosu.js +602 -261
- 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.
|
|
1086
|
+
var VERSION = "0.65.0", 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 = "
|
|
6877
|
+
var CLI_CONTRACT_HASH = "dd33222d64a5";
|
|
6878
6878
|
|
|
6879
6879
|
// src/client/trpc.ts
|
|
6880
6880
|
function createTypedClient(config) {
|
|
@@ -11854,11 +11854,91 @@ var init_docs = __esm(() => {
|
|
|
11854
11854
|
import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
11855
11855
|
});
|
|
11856
11856
|
|
|
11857
|
+
// src/commands/slack-channel-resolve.ts
|
|
11858
|
+
function channelLabel(channel) {
|
|
11859
|
+
const name = channel.name ? `#${channel.name}` : channel.channel_id;
|
|
11860
|
+
return channel.team_name ? `${name} (${channel.team_name})` : name;
|
|
11861
|
+
}
|
|
11862
|
+
async function listAllChannels(client, orgId, search, json) {
|
|
11863
|
+
const channels = [];
|
|
11864
|
+
let cursor = null;
|
|
11865
|
+
let pages = 0;
|
|
11866
|
+
do {
|
|
11867
|
+
const page = await client.slackChannel.listPaged.query({
|
|
11868
|
+
orgId,
|
|
11869
|
+
limit: PAGE_SIZE,
|
|
11870
|
+
...search !== undefined && { search },
|
|
11871
|
+
...cursor && { cursor }
|
|
11872
|
+
});
|
|
11873
|
+
channels.push(...page.items);
|
|
11874
|
+
cursor = page.nextCursor;
|
|
11875
|
+
pages += 1;
|
|
11876
|
+
if (cursor && !json && pages % PROGRESS_EVERY_PAGES === 0) {
|
|
11877
|
+
console.error(import_picocolors17.default.dim(`Scanned ${channels.length} Slack channels…`));
|
|
11878
|
+
}
|
|
11879
|
+
} while (cursor);
|
|
11880
|
+
return channels;
|
|
11881
|
+
}
|
|
11882
|
+
function printCandidates(candidates) {
|
|
11883
|
+
const shown = candidates.slice(0, MAX_CANDIDATES);
|
|
11884
|
+
for (const c of shown) {
|
|
11885
|
+
const name = c.name ? `#${c.name}` : "-";
|
|
11886
|
+
console.error(` ${c.id} ${c.channel_id} ${name} ${c.team_name ?? "-"}`);
|
|
11887
|
+
}
|
|
11888
|
+
if (candidates.length > shown.length) {
|
|
11889
|
+
console.error(import_picocolors17.default.dim(` …and ${candidates.length - shown.length} more.`));
|
|
11890
|
+
}
|
|
11891
|
+
}
|
|
11892
|
+
async function resolveChannel(client, orgId, input, arg, json) {
|
|
11893
|
+
const value = input.trim();
|
|
11894
|
+
if (isUuid(value))
|
|
11895
|
+
return { id: value, channel: null };
|
|
11896
|
+
if (SLACK_CHANNEL_ID_RE.test(value)) {
|
|
11897
|
+
const match = (await listAllChannels(client, orgId, undefined, json)).find((c) => c.channel_id === value);
|
|
11898
|
+
if (!match) {
|
|
11899
|
+
console.error(import_picocolors17.default.red(`No Slack channel with ID ${value} in this organization.`));
|
|
11900
|
+
console.error("Run `dosu integrations slack-channels` to list channels, or pass a name.");
|
|
11901
|
+
process.exit(1);
|
|
11902
|
+
}
|
|
11903
|
+
return { id: match.id, channel: match };
|
|
11904
|
+
}
|
|
11905
|
+
const name = value.replace(/^#/, "");
|
|
11906
|
+
if (!name) {
|
|
11907
|
+
console.error(import_picocolors17.default.red(`${arg.name} must not be empty.`));
|
|
11908
|
+
process.exit(1);
|
|
11909
|
+
}
|
|
11910
|
+
const candidates = await listAllChannels(client, orgId, name, json);
|
|
11911
|
+
const exact = candidates.filter((c) => c.name?.toLowerCase() === name.toLowerCase());
|
|
11912
|
+
if (exact.length === 1)
|
|
11913
|
+
return { id: exact[0].id, channel: exact[0] };
|
|
11914
|
+
if (exact.length === 0) {
|
|
11915
|
+
console.error(import_picocolors17.default.red(`No Slack channel named #${name} in this organization.`));
|
|
11916
|
+
} else {
|
|
11917
|
+
console.error(import_picocolors17.default.red(`${exact.length} Slack channels are named #${name} (in different workspaces).`));
|
|
11918
|
+
}
|
|
11919
|
+
const shown = exact.length > 0 ? exact : candidates;
|
|
11920
|
+
if (shown.length > 0) {
|
|
11921
|
+
console.error(exact.length > 0 ? "Matches:" : "Similar channels:");
|
|
11922
|
+
printCandidates(shown);
|
|
11923
|
+
}
|
|
11924
|
+
console.error(`Pass the channel's UUID with ${arg.uuidUsage}.`);
|
|
11925
|
+
process.exit(1);
|
|
11926
|
+
}
|
|
11927
|
+
var import_picocolors17, SLACK_CHANNEL_ID_RE, PAGE_SIZE = 100, PROGRESS_EVERY_PAGES = 10, MAX_CANDIDATES = 10;
|
|
11928
|
+
var init_slack_channel_resolve = __esm(() => {
|
|
11929
|
+
init_arguments();
|
|
11930
|
+
import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
11931
|
+
SLACK_CHANNEL_ID_RE = /^[CG][A-Z0-9]{8,}$/;
|
|
11932
|
+
});
|
|
11933
|
+
|
|
11857
11934
|
// src/commands/integrations.ts
|
|
11935
|
+
function shellQuote(value) {
|
|
11936
|
+
return /^[\w.-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
11937
|
+
}
|
|
11858
11938
|
function requireConfig6() {
|
|
11859
11939
|
const cfg = requireLoginConfig();
|
|
11860
11940
|
if (!cfg.active_account?.target?.org_id) {
|
|
11861
|
-
console.error(
|
|
11941
|
+
console.error(import_picocolors18.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
|
|
11862
11942
|
process.exit(1);
|
|
11863
11943
|
}
|
|
11864
11944
|
return cfg;
|
|
@@ -11895,7 +11975,7 @@ function integrationsCommand() {
|
|
|
11895
11975
|
}
|
|
11896
11976
|
printTable(["Platform", "Status"], results.map((r) => [
|
|
11897
11977
|
r.platform,
|
|
11898
|
-
r.connected === null ?
|
|
11978
|
+
r.connected === null ? import_picocolors18.default.dim("status unavailable") : r.connected ? import_picocolors18.default.green("connected") : import_picocolors18.default.dim("not connected")
|
|
11899
11979
|
]), { rawData: results });
|
|
11900
11980
|
});
|
|
11901
11981
|
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 +11987,64 @@ function integrationsCommand() {
|
|
|
11907
11987
|
printResult({ platform, connected: null, note: "connection status unavailable via CLI" }, opts);
|
|
11908
11988
|
return;
|
|
11909
11989
|
}
|
|
11910
|
-
console.log(`${platform}: ${
|
|
11990
|
+
console.log(`${platform}: ${import_picocolors18.default.dim("connection status unavailable via CLI")}`);
|
|
11911
11991
|
return;
|
|
11912
11992
|
}
|
|
11913
11993
|
if (opts.json) {
|
|
11914
11994
|
printResult({ platform, connected, connection }, opts);
|
|
11915
11995
|
return;
|
|
11916
11996
|
}
|
|
11917
|
-
console.log(`${platform}: ${connected ?
|
|
11997
|
+
console.log(`${platform}: ${connected ? import_picocolors18.default.green("connected") : import_picocolors18.default.dim("not connected")}`);
|
|
11918
11998
|
});
|
|
11919
|
-
cmd.command("slack-channels").description("List Slack channels").option("--json", "Output as JSON").action(async (opts) => {
|
|
11999
|
+
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
12000
|
const cfg = requireConfig6();
|
|
11921
12001
|
const client = createTypedClient(cfg);
|
|
11922
|
-
const
|
|
12002
|
+
const orgId = cfg.active_account.target.org_id;
|
|
12003
|
+
const search = opts.search?.trim() || undefined;
|
|
12004
|
+
let page;
|
|
12005
|
+
if (opts.all) {
|
|
12006
|
+
const items = await listAllChannels(client, orgId, search, opts.json);
|
|
12007
|
+
page = { items, nextCursor: null };
|
|
12008
|
+
if (items.length > ALL_CHANNELS_WARN_AT) {
|
|
12009
|
+
console.error(import_picocolors18.default.yellow(`Listed ${items.length} channels. Use --search <term> to narrow the list.`));
|
|
12010
|
+
}
|
|
12011
|
+
} else {
|
|
12012
|
+
page = await client.slackChannel.listPaged.query({
|
|
12013
|
+
orgId,
|
|
12014
|
+
limit: opts.limit ?? DEFAULT_CHANNEL_PAGE,
|
|
12015
|
+
...search && { search },
|
|
12016
|
+
...opts.cursor && { cursor: opts.cursor }
|
|
12017
|
+
});
|
|
12018
|
+
}
|
|
11923
12019
|
if (opts.json) {
|
|
11924
|
-
printResult(
|
|
12020
|
+
printResult(page, opts);
|
|
11925
12021
|
return;
|
|
11926
12022
|
}
|
|
11927
|
-
if (
|
|
11928
|
-
console.log(
|
|
12023
|
+
if (page.items.length === 0) {
|
|
12024
|
+
console.log(import_picocolors18.default.dim(search ? `No Slack channels match "${search}".` : "No Slack channels found."));
|
|
11929
12025
|
return;
|
|
11930
12026
|
}
|
|
11931
|
-
printTable(["ID", "Name"],
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
12027
|
+
printTable(["UUID", "Slack ID", "Name", "Workspace"], page.items.map((c) => [c.id, c.channel_id, c.name ?? "(unnamed)", c.team_name ?? "-"]));
|
|
12028
|
+
if (page.nextCursor) {
|
|
12029
|
+
const next = [
|
|
12030
|
+
"dosu integrations slack-channels",
|
|
12031
|
+
search && `--search ${shellQuote(search)}`,
|
|
12032
|
+
opts.limit && `--limit ${opts.limit}`,
|
|
12033
|
+
`--cursor ${page.nextCursor}`
|
|
12034
|
+
].filter(Boolean);
|
|
12035
|
+
console.log(import_picocolors18.default.dim(`More channels: ${next.join(" ")} (or --all)`));
|
|
12036
|
+
}
|
|
11935
12037
|
});
|
|
11936
|
-
cmd.command("slack-join").description("Join a Slack channel").argument("<channel
|
|
12038
|
+
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
12039
|
const cfg = requireConfig6();
|
|
11938
12040
|
const client = createTypedClient(cfg);
|
|
11939
|
-
await client.
|
|
12041
|
+
const { id, channel } = await resolveChannel(client, cfg.active_account.target.org_id, channelId, { name: "<channel>", uuidUsage: "`dosu integrations slack-join <uuid>`" }, opts.json);
|
|
12042
|
+
await client.slackChannel.join.mutate(id);
|
|
11940
12043
|
if (opts.json) {
|
|
11941
|
-
printResult({ success: true, channelId }, opts);
|
|
12044
|
+
printResult({ success: true, channelId, id, channel }, opts);
|
|
11942
12045
|
return;
|
|
11943
12046
|
}
|
|
11944
|
-
console.log(
|
|
12047
|
+
console.log(import_picocolors18.default.green(`Joined ${channel ? channelLabel(channel) : `Slack channel ${id}`}.`));
|
|
11945
12048
|
});
|
|
11946
12049
|
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
12050
|
const cfg = requireConfig6();
|
|
@@ -11952,21 +12055,22 @@ function integrationsCommand() {
|
|
|
11952
12055
|
return;
|
|
11953
12056
|
}
|
|
11954
12057
|
if (!collaborators || collaborators.length === 0) {
|
|
11955
|
-
console.log(
|
|
12058
|
+
console.log(import_picocolors18.default.dim("No collaborators found."));
|
|
11956
12059
|
return;
|
|
11957
12060
|
}
|
|
11958
12061
|
printTable(["Username", "Name", "Email"], collaborators.map((c) => [c.user_name ?? "-", c.full_name ?? "-", c.email ?? "-"]), { rawData: collaborators });
|
|
11959
12062
|
});
|
|
11960
12063
|
return cmd;
|
|
11961
12064
|
}
|
|
11962
|
-
var
|
|
12065
|
+
var import_picocolors18, DEFAULT_CHANNEL_PAGE = 50, MAX_CHANNEL_PAGE = 100, ALL_CHANNELS_WARN_AT = 500, DISPLAY_PLATFORMS, NANGO_PROBES;
|
|
11963
12066
|
var init_integrations = __esm(() => {
|
|
11964
12067
|
init_commander();
|
|
11965
12068
|
init_trpc();
|
|
11966
12069
|
init_arguments();
|
|
11967
12070
|
init_auth();
|
|
11968
12071
|
init_output();
|
|
11969
|
-
|
|
12072
|
+
init_slack_channel_resolve();
|
|
12073
|
+
import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
11970
12074
|
DISPLAY_PLATFORMS = [
|
|
11971
12075
|
"github",
|
|
11972
12076
|
"gitlab",
|
|
@@ -14182,7 +14286,7 @@ var init_conflicts = __esm(() => {
|
|
|
14182
14286
|
});
|
|
14183
14287
|
|
|
14184
14288
|
// src/telemetry/debug-id.ts
|
|
14185
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
14289
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "a31208d6-6e9d-91e6-6475-6e2164756e21";
|
|
14186
14290
|
|
|
14187
14291
|
// src/telemetry/telemetry.ts
|
|
14188
14292
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -15185,7 +15289,7 @@ function resolveAgents(ids, all, get) {
|
|
|
15185
15289
|
if (ids.length === 0) {
|
|
15186
15290
|
const installed = all().filter((agent) => agent.isInstalled());
|
|
15187
15291
|
if (installed.length === 0) {
|
|
15188
|
-
console.log(
|
|
15292
|
+
console.log(import_picocolors19.default.dim("No supported agents detected on this machine."));
|
|
15189
15293
|
}
|
|
15190
15294
|
return installed;
|
|
15191
15295
|
}
|
|
@@ -15193,7 +15297,7 @@ function resolveAgents(ids, all, get) {
|
|
|
15193
15297
|
for (const id of ids) {
|
|
15194
15298
|
const agent = get(id.toLowerCase());
|
|
15195
15299
|
if (!agent) {
|
|
15196
|
-
console.error(
|
|
15300
|
+
console.error(import_picocolors19.default.red(`unknown agent '${id}'. Supported: ${all().map((a) => a.id()).join(", ")}`));
|
|
15197
15301
|
process.exitCode = 1;
|
|
15198
15302
|
return [];
|
|
15199
15303
|
}
|
|
@@ -15201,9 +15305,9 @@ function resolveAgents(ids, all, get) {
|
|
|
15201
15305
|
}
|
|
15202
15306
|
return agents;
|
|
15203
15307
|
}
|
|
15204
|
-
var
|
|
15308
|
+
var import_picocolors19;
|
|
15205
15309
|
var init_agent_select = __esm(() => {
|
|
15206
|
-
|
|
15310
|
+
import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
15207
15311
|
});
|
|
15208
15312
|
|
|
15209
15313
|
// src/incognito/agents.ts
|
|
@@ -15318,10 +15422,10 @@ function incognitoCommand() {
|
|
|
15318
15422
|
return;
|
|
15319
15423
|
}
|
|
15320
15424
|
for (const row of rows) {
|
|
15321
|
-
const state = !row.installed ?
|
|
15425
|
+
const state = !row.installed ? import_picocolors20.default.dim("not installed") : row.enabled ? import_picocolors20.default.green("enabled") : "disabled";
|
|
15322
15426
|
console.log(` ${row.agent.padEnd(8)} ${row.name.padEnd(14)} ${state}`);
|
|
15323
15427
|
}
|
|
15324
|
-
console.log(
|
|
15428
|
+
console.log(import_picocolors20.default.dim(`
|
|
15325
15429
|
Use 'dosu knowledge incognito enable|disable [agent...]' to change these.
|
|
15326
15430
|
` + `Inside a session, run /${INCOGNITO_COMMAND_NAME} to keep that session out of studying.`));
|
|
15327
15431
|
});
|
|
@@ -15350,17 +15454,17 @@ Use 'dosu knowledge incognito enable|disable [agent...]' to change these.
|
|
|
15350
15454
|
return cmd;
|
|
15351
15455
|
}
|
|
15352
15456
|
function reportFailure(agentName, err) {
|
|
15353
|
-
console.error(
|
|
15457
|
+
console.error(import_picocolors20.default.red(`✗ ${agentName}: ${err instanceof Error ? err.message : String(err)}`));
|
|
15354
15458
|
process.exitCode = 1;
|
|
15355
15459
|
}
|
|
15356
|
-
var
|
|
15460
|
+
var import_picocolors20;
|
|
15357
15461
|
var init_knowledge_incognito = __esm(() => {
|
|
15358
15462
|
init_commander();
|
|
15359
15463
|
init_agents3();
|
|
15360
15464
|
init_incognito();
|
|
15361
15465
|
init_agent_select();
|
|
15362
15466
|
init_output();
|
|
15363
|
-
|
|
15467
|
+
import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
15364
15468
|
});
|
|
15365
15469
|
|
|
15366
15470
|
// src/statusline/agents.ts
|
|
@@ -15496,19 +15600,19 @@ function statuslineCommand2(renderDeps = {}) {
|
|
|
15496
15600
|
return;
|
|
15497
15601
|
}
|
|
15498
15602
|
for (const row of rows) {
|
|
15499
|
-
const state = !row.installed ?
|
|
15603
|
+
const state = !row.installed ? import_picocolors21.default.dim("not installed") : row.enabled ? import_picocolors21.default.green("enabled") : "disabled";
|
|
15500
15604
|
console.log(` ${row.agent.padEnd(8)} ${row.name.padEnd(14)} ${state}`);
|
|
15501
15605
|
if (row.note)
|
|
15502
|
-
console.log(
|
|
15606
|
+
console.log(import_picocolors21.default.yellow(` ${row.note}`));
|
|
15503
15607
|
}
|
|
15504
|
-
console.log(
|
|
15608
|
+
console.log(import_picocolors21.default.dim(`
|
|
15505
15609
|
Use 'dosu knowledge statusline enable|disable [agent...]' to change these.
|
|
15506
15610
|
` + `States: ${Object.values(STATUSLINE_LABELS).join(" ")}`));
|
|
15507
15611
|
});
|
|
15508
15612
|
cmd.command("enable [agents...]").description("Install the Dosu status line for agents (default: all detected)").action((ids) => {
|
|
15509
15613
|
const agents = resolveAgents(ids, allStatuslineAgents, getStatuslineAgent);
|
|
15510
15614
|
if (agents.length > 0 && process.env.DOSU_DEV === "true") {
|
|
15511
|
-
console.log(
|
|
15615
|
+
console.log(import_picocolors21.default.dim(`Dev mode: the status line will run ${statuslineCommand(agents[0].id())}`));
|
|
15512
15616
|
}
|
|
15513
15617
|
for (const agent of agents) {
|
|
15514
15618
|
try {
|
|
@@ -15517,8 +15621,8 @@ Use 'dosu knowledge statusline enable|disable [agent...]' to change these.
|
|
|
15517
15621
|
} catch (err) {
|
|
15518
15622
|
if (err instanceof StatuslineConflictError) {
|
|
15519
15623
|
console.log(`– ${agent.name()} · already has a status line (${err.existingCommand}); left as is.`);
|
|
15520
|
-
console.log(
|
|
15521
|
-
console.log(
|
|
15624
|
+
console.log(import_picocolors21.default.dim(" To show Dosu alongside it, add to your script:"));
|
|
15625
|
+
console.log(import_picocolors21.default.dim(` ${err.suggestion}`));
|
|
15522
15626
|
continue;
|
|
15523
15627
|
}
|
|
15524
15628
|
reportFailure2(agent.name(), err);
|
|
@@ -15542,10 +15646,10 @@ Use 'dosu knowledge statusline enable|disable [agent...]' to change these.
|
|
|
15542
15646
|
}
|
|
15543
15647
|
function reportFailure2(agentName, err) {
|
|
15544
15648
|
const message = err instanceof Error ? err.message : String(err);
|
|
15545
|
-
console.error(
|
|
15649
|
+
console.error(import_picocolors21.default.red(`✗ ${agentName}: ${message}`));
|
|
15546
15650
|
process.exitCode = 1;
|
|
15547
15651
|
}
|
|
15548
|
-
var
|
|
15652
|
+
var import_picocolors21;
|
|
15549
15653
|
var init_knowledge_statusline = __esm(() => {
|
|
15550
15654
|
init_commander();
|
|
15551
15655
|
init_agents4();
|
|
@@ -15553,7 +15657,7 @@ var init_knowledge_statusline = __esm(() => {
|
|
|
15553
15657
|
init_run2();
|
|
15554
15658
|
init_agent_select();
|
|
15555
15659
|
init_output();
|
|
15556
|
-
|
|
15660
|
+
import_picocolors21 = __toESM(require_picocolors(), 1);
|
|
15557
15661
|
});
|
|
15558
15662
|
|
|
15559
15663
|
// src/report/backfill.ts
|
|
@@ -30345,8 +30449,8 @@ function ZX(e, t) {
|
|
|
30345
30449
|
n.issues.push({ code: "custom", message: r, input: n.value });
|
|
30346
30450
|
});
|
|
30347
30451
|
}
|
|
30348
|
-
function LI(e, t =
|
|
30349
|
-
return e === "default" ?
|
|
30452
|
+
function LI(e, t = pc22()) {
|
|
30453
|
+
return e === "default" ? pc22() : ZX(e, t);
|
|
30350
30454
|
}
|
|
30351
30455
|
function zS(e, { strictPolicyHelperKeys: t = false } = {}) {
|
|
30352
30456
|
function n(o) {
|
|
@@ -30418,8 +30522,8 @@ function $I(e, t) {
|
|
|
30418
30522
|
let a = (b, x) => {
|
|
30419
30523
|
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
30524
|
}, c = (b) => {
|
|
30421
|
-
let x = false, v, A = LI(b,
|
|
30422
|
-
x = true, a(`policyHelpers.${b}.defaultSettings`, U.issues[0]?.message ?? s(
|
|
30525
|
+
let x = false, v, A = LI(b, pc22().optional().catch((U) => {
|
|
30526
|
+
x = true, a(`policyHelpers.${b}.defaultSettings`, U.issues[0]?.message ?? s(pc22(), v && typeof v === "object" && !Array.isArray(v) ? v.defaultSettings : undefined));
|
|
30423
30527
|
return;
|
|
30424
30528
|
}));
|
|
30425
30529
|
return st((U) => {
|
|
@@ -30442,7 +30546,7 @@ function $I(e, t) {
|
|
|
30442
30546
|
return U === null ? undefined : U;
|
|
30443
30547
|
}, A.optional()).catch((U) => {
|
|
30444
30548
|
if (b === "default") {
|
|
30445
|
-
a("policyHelpers.default", U.issues[0]?.message ?? s(
|
|
30549
|
+
a("policyHelpers.default", U.issues[0]?.message ?? s(pc22(), v));
|
|
30446
30550
|
return;
|
|
30447
30551
|
}
|
|
30448
30552
|
if (x)
|
|
@@ -30451,7 +30555,7 @@ function $I(e, t) {
|
|
|
30451
30555
|
if (F && typeof F === "object" && !Array.isArray(F)) {
|
|
30452
30556
|
let K = F, V = K.defaultSettings;
|
|
30453
30557
|
if (V !== undefined && V !== null) {
|
|
30454
|
-
let ne =
|
|
30558
|
+
let ne = pc22().safeParse(V);
|
|
30455
30559
|
if (ne.success) {
|
|
30456
30560
|
let oe = K.outputBehavior, _e = oe === undefined || oe === null ? null : VX().safeParse(oe);
|
|
30457
30561
|
if (_e && !_e.success) {
|
|
@@ -33100,7 +33204,7 @@ Wrap your summary in <summary></summary> tags.`, Tp, Vc, ua, Jt, Zn, yr, ms, ei,
|
|
|
33100
33204
|
return a;
|
|
33101
33205
|
}, 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
33206
|
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,
|
|
33207
|
+
}, 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
33208
|
var init_sdk = __esm(() => {
|
|
33105
33209
|
PQ = Object.create;
|
|
33106
33210
|
({ getPrototypeOf: IQ, defineProperty: QS, getOwnPropertyNames: DQ } = Object);
|
|
@@ -53807,7 +53911,7 @@ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resour
|
|
|
53807
53911
|
jI = [...ss, "default"];
|
|
53808
53912
|
DI = ["path", "script", "interpreter", "outputBehavior", "timeoutMs", "refreshIntervalMs", "defaultSettings"];
|
|
53809
53913
|
US = ["managedSettings", "appendSystemPrompt"];
|
|
53810
|
-
|
|
53914
|
+
pc22 = M(() => X(_(), Ae()).superRefine((e, t) => {
|
|
53811
53915
|
for (let n of ["policyHelper", "policyHelpers"])
|
|
53812
53916
|
if (e[n] !== undefined && e[n] !== null)
|
|
53813
53917
|
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 +53925,7 @@ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resour
|
|
|
53821
53925
|
if (e[n] !== undefined && e[n] !== null)
|
|
53822
53926
|
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
53927
|
}));
|
|
53824
|
-
_Bt = M(() => ZX("linux",
|
|
53928
|
+
_Bt = M(() => ZX("linux", pc22()));
|
|
53825
53929
|
jYe = M(() => C(Object.fromEntries(jI.map((e) => [e, st((t) => {
|
|
53826
53930
|
if (t === null)
|
|
53827
53931
|
return;
|
|
@@ -59074,7 +59178,7 @@ import { delimiter as delimiter4, join as join22 } from "node:path";
|
|
|
59074
59178
|
function requireConfig7() {
|
|
59075
59179
|
const cfg = requireLoginConfig();
|
|
59076
59180
|
if (!cfg.active_account?.target?.org_id || !cfg.active_account?.target?.space_id) {
|
|
59077
|
-
console.error(
|
|
59181
|
+
console.error(import_picocolors22.default.red("Missing org/space config. Run 'dosu setup' to reconfigure."));
|
|
59078
59182
|
process.exit(1);
|
|
59079
59183
|
}
|
|
59080
59184
|
return cfg;
|
|
@@ -59090,7 +59194,7 @@ function knowledgeCommand() {
|
|
|
59090
59194
|
});
|
|
59091
59195
|
const dataSourceIds = dataSources.map((ds) => ds.id).filter((id) => id !== null);
|
|
59092
59196
|
if (dataSourceIds.length === 0) {
|
|
59093
|
-
console.log(
|
|
59197
|
+
console.log(import_picocolors22.default.dim("No data sources connected. Add data sources in the Dosu dashboard."));
|
|
59094
59198
|
return;
|
|
59095
59199
|
}
|
|
59096
59200
|
const data = await client.search.getMentions.query({
|
|
@@ -59104,7 +59208,7 @@ function knowledgeCommand() {
|
|
|
59104
59208
|
return;
|
|
59105
59209
|
}
|
|
59106
59210
|
if (!results || results.length === 0) {
|
|
59107
|
-
console.log(
|
|
59211
|
+
console.log(import_picocolors22.default.dim("No results found."));
|
|
59108
59212
|
return;
|
|
59109
59213
|
}
|
|
59110
59214
|
const limited = results.slice(0, opts.limit);
|
|
@@ -59113,7 +59217,7 @@ function knowledgeCommand() {
|
|
|
59113
59217
|
r.entity_type ?? "-"
|
|
59114
59218
|
]), { json: false, rawData: limited });
|
|
59115
59219
|
if (results.length > opts.limit) {
|
|
59116
|
-
console.log(
|
|
59220
|
+
console.log(import_picocolors22.default.dim(`
|
|
59117
59221
|
${results.length - opts.limit} more results not shown.`));
|
|
59118
59222
|
}
|
|
59119
59223
|
});
|
|
@@ -59126,10 +59230,10 @@ ${results.length - opts.limit} more results not shown.`));
|
|
|
59126
59230
|
return;
|
|
59127
59231
|
}
|
|
59128
59232
|
if (!store) {
|
|
59129
|
-
console.log(
|
|
59233
|
+
console.log(import_picocolors22.default.dim("No knowledge store found for this deployment."));
|
|
59130
59234
|
return;
|
|
59131
59235
|
}
|
|
59132
|
-
console.log(
|
|
59236
|
+
console.log(import_picocolors22.default.bold("Knowledge Store"));
|
|
59133
59237
|
console.log(` ID: ${store.id}`);
|
|
59134
59238
|
console.log(` Space ID: ${store.space_id}`);
|
|
59135
59239
|
});
|
|
@@ -59160,9 +59264,9 @@ ${results.length - opts.limit} more results not shown.`));
|
|
|
59160
59264
|
if (!first)
|
|
59161
59265
|
console.log();
|
|
59162
59266
|
first = false;
|
|
59163
|
-
console.log(
|
|
59267
|
+
console.log(import_picocolors22.default.bold(`${title} (${rows.length})`));
|
|
59164
59268
|
if (rows.length === 0) {
|
|
59165
|
-
console.log(
|
|
59269
|
+
console.log(import_picocolors22.default.dim(` ${emptyMsg}`));
|
|
59166
59270
|
return;
|
|
59167
59271
|
}
|
|
59168
59272
|
printTable(["Agent", stamp, "Project", "Session"], rows);
|
|
@@ -59327,14 +59431,14 @@ function formatAge(iso, now) {
|
|
|
59327
59431
|
}
|
|
59328
59432
|
function printSyncStatus(status, now = new Date) {
|
|
59329
59433
|
if (status.running) {
|
|
59330
|
-
console.log(`${
|
|
59434
|
+
console.log(`${import_picocolors22.default.green("●")} Sync running · pid ${status.pid}, started ${formatAge(status.startedAt ?? "", now)}.`);
|
|
59331
59435
|
} else if (status.staleLock) {
|
|
59332
|
-
console.log(`${
|
|
59436
|
+
console.log(`${import_picocolors22.default.yellow("●")} Stale lock from pid ${status.pid} (process gone); syncs resume once it ages out.`);
|
|
59333
59437
|
} else {
|
|
59334
59438
|
console.log("○ No sync running.");
|
|
59335
59439
|
}
|
|
59336
59440
|
if (status.state.paused) {
|
|
59337
|
-
console.log(
|
|
59441
|
+
console.log(import_picocolors22.default.yellow(" Studying paused: stopped by you. Resume from the Activity screen or run 'dosu knowledge sync'."));
|
|
59338
59442
|
}
|
|
59339
59443
|
const wm = status.state.watermark;
|
|
59340
59444
|
console.log(` Studied through: ${wm ? `${wm} (${formatAge(wm, now)})` : "nothing studied yet"}`);
|
|
@@ -59354,27 +59458,27 @@ function printSyncStatus(status, now = new Date) {
|
|
|
59354
59458
|
}
|
|
59355
59459
|
if (status.backoffUntil) {
|
|
59356
59460
|
const n = status.state.consecutive_failures;
|
|
59357
|
-
console.log(
|
|
59461
|
+
console.log(import_picocolors22.default.yellow(` Backing off after ${n} failure${n === 1 ? "" : "s"}; background syncs retry after ${status.backoffUntil}.`));
|
|
59358
59462
|
}
|
|
59359
59463
|
if (status.state.last_refusal) {
|
|
59360
|
-
console.log(
|
|
59464
|
+
console.log(import_picocolors22.default.yellow(` Studying paused: ${status.state.last_refusal.message} (${formatAge(status.state.last_refusal.at, now)})`));
|
|
59361
59465
|
}
|
|
59362
59466
|
if (status.recentActivity.length > 0) {
|
|
59363
59467
|
console.log(`
|
|
59364
59468
|
Recent activity:`);
|
|
59365
59469
|
for (const line of status.recentActivity) {
|
|
59366
|
-
console.log(
|
|
59470
|
+
console.log(import_picocolors22.default.dim(` ${truncate(line, 160)}`));
|
|
59367
59471
|
}
|
|
59368
59472
|
}
|
|
59369
|
-
console.log(
|
|
59473
|
+
console.log(import_picocolors22.default.dim(`
|
|
59370
59474
|
Follow live with 'dosu logs --follow'.`));
|
|
59371
59475
|
}
|
|
59372
59476
|
function printSyncOutcome(outcome) {
|
|
59373
59477
|
switch (outcome.status) {
|
|
59374
59478
|
case "backlog": {
|
|
59375
|
-
const inFlight = outcome.inFlightSessions > 0 ?
|
|
59479
|
+
const inFlight = outcome.inFlightSessions > 0 ? import_picocolors22.default.dim(` (${outcome.inFlightSessions} more still in progress)`) : "";
|
|
59376
59480
|
console.log(`✓ Scanned. ${outcome.readySessions} new session${outcome.readySessions === 1 ? "" : "s"} ready to study${inFlight}.`);
|
|
59377
|
-
console.log(
|
|
59481
|
+
console.log(import_picocolors22.default.dim("Sign in with 'dosu setup' to enable studying."));
|
|
59378
59482
|
break;
|
|
59379
59483
|
}
|
|
59380
59484
|
case "studied": {
|
|
@@ -59382,21 +59486,21 @@ function printSyncOutcome(outcome) {
|
|
|
59382
59486
|
const remaining = outcome.readySessions - (outcome.studiedSessions ?? 0);
|
|
59383
59487
|
console.log(`✓ Studied ${outcome.studiedSessions} session${outcome.studiedSessions === 1 ? "" : "s"}, ${notes} suggested page${notes === 1 ? "" : "s"} created.`);
|
|
59384
59488
|
if (remaining > 0) {
|
|
59385
|
-
console.log(
|
|
59489
|
+
console.log(import_picocolors22.default.dim(`${remaining} more in the backlog; run sync again to continue.`));
|
|
59386
59490
|
}
|
|
59387
59491
|
break;
|
|
59388
59492
|
}
|
|
59389
59493
|
case "skipped-gateway": {
|
|
59390
|
-
console.log(
|
|
59494
|
+
console.log(import_picocolors22.default.yellow(outcome.learner?.message ?? "Studying unavailable right now."));
|
|
59391
59495
|
break;
|
|
59392
59496
|
}
|
|
59393
59497
|
case "mine-failed": {
|
|
59394
|
-
console.error(
|
|
59498
|
+
console.error(import_picocolors22.default.red(outcome.learner?.message ?? "Study run failed."));
|
|
59395
59499
|
process.exitCode = 1;
|
|
59396
59500
|
break;
|
|
59397
59501
|
}
|
|
59398
59502
|
case "skipped-lock": {
|
|
59399
|
-
console.log(
|
|
59503
|
+
console.log(import_picocolors22.default.dim("Skipped: another sync run is already in progress."));
|
|
59400
59504
|
break;
|
|
59401
59505
|
}
|
|
59402
59506
|
case "nothing-new": {
|
|
@@ -59405,16 +59509,16 @@ function printSyncOutcome(outcome) {
|
|
|
59405
59509
|
break;
|
|
59406
59510
|
}
|
|
59407
59511
|
case "error": {
|
|
59408
|
-
console.error(
|
|
59512
|
+
console.error(import_picocolors22.default.red(`Sync failed: ${outcome.error}`));
|
|
59409
59513
|
process.exitCode = 1;
|
|
59410
59514
|
break;
|
|
59411
59515
|
}
|
|
59412
59516
|
case "skipped-backoff": {
|
|
59413
|
-
console.log(
|
|
59517
|
+
console.log(import_picocolors22.default.dim("Skipped: a recent sync failed; waiting out the retry backoff."));
|
|
59414
59518
|
break;
|
|
59415
59519
|
}
|
|
59416
59520
|
case "skipped-paused": {
|
|
59417
|
-
console.log(
|
|
59521
|
+
console.log(import_picocolors22.default.dim("Skipped: studying is paused. Run 'dosu knowledge sync' to resume."));
|
|
59418
59522
|
break;
|
|
59419
59523
|
}
|
|
59420
59524
|
}
|
|
@@ -59447,22 +59551,22 @@ function hooksCommand() {
|
|
|
59447
59551
|
return;
|
|
59448
59552
|
}
|
|
59449
59553
|
for (const row of rows) {
|
|
59450
|
-
const state = !row.installed ?
|
|
59554
|
+
const state = !row.installed ? import_picocolors22.default.dim("not installed") : row.enabled ? import_picocolors22.default.green("enabled") : "disabled";
|
|
59451
59555
|
console.log(` ${row.agent.padEnd(8)} ${row.name.padEnd(14)} ${state}`);
|
|
59452
59556
|
if (row.note)
|
|
59453
|
-
console.log(
|
|
59557
|
+
console.log(import_picocolors22.default.yellow(` ${row.note}`));
|
|
59454
59558
|
}
|
|
59455
|
-
console.log(
|
|
59559
|
+
console.log(import_picocolors22.default.dim(`
|
|
59456
59560
|
Use 'dosu knowledge hooks enable|disable [agent...]' to change these.`));
|
|
59457
59561
|
});
|
|
59458
59562
|
cmd.command("enable [agents...]").description("Install the sync hook for agents (default: all detected)").action((ids) => {
|
|
59459
59563
|
const agents = resolveHookAgents(ids);
|
|
59460
59564
|
const devMode = process.env.DOSU_DEV === "true";
|
|
59461
59565
|
if (agents.length > 0 && !devMode && !dosuOnPath()) {
|
|
59462
|
-
console.log(
|
|
59566
|
+
console.log(import_picocolors22.default.yellow("Warning: 'dosu' is not on PATH; hooks run 'dosu knowledge sync' and will fail until it is."));
|
|
59463
59567
|
}
|
|
59464
59568
|
if (agents.length > 0 && devMode) {
|
|
59465
|
-
console.log(
|
|
59569
|
+
console.log(import_picocolors22.default.dim(`Dev mode: hooks will run ${hookCommand()}`));
|
|
59466
59570
|
}
|
|
59467
59571
|
for (const agent of agents) {
|
|
59468
59572
|
try {
|
|
@@ -59470,7 +59574,7 @@ Use 'dosu knowledge hooks enable|disable [agent...]' to change these.`));
|
|
|
59470
59574
|
console.log(`✓ ${agent.name()} · hook enabled (${agent.configPath()})`);
|
|
59471
59575
|
const note = agent.enableNote?.();
|
|
59472
59576
|
if (note)
|
|
59473
|
-
console.log(
|
|
59577
|
+
console.log(import_picocolors22.default.dim(` ${note}`));
|
|
59474
59578
|
} catch (err) {
|
|
59475
59579
|
reportHookFailure(agent, err);
|
|
59476
59580
|
}
|
|
@@ -59490,14 +59594,14 @@ Use 'dosu knowledge hooks enable|disable [agent...]' to change these.`));
|
|
|
59490
59594
|
}
|
|
59491
59595
|
function reportHookFailure(agent, err) {
|
|
59492
59596
|
const message = err instanceof HookConfigError ? err.message : err instanceof Error ? err.message : String(err);
|
|
59493
|
-
console.error(
|
|
59597
|
+
console.error(import_picocolors22.default.red(`✗ ${agent.name()}: ${message}`));
|
|
59494
59598
|
process.exitCode = 1;
|
|
59495
59599
|
}
|
|
59496
59600
|
function dosuOnPath() {
|
|
59497
59601
|
const bin = process.platform === "win32" ? "dosu.cmd" : "dosu";
|
|
59498
59602
|
return (process.env.PATH ?? "").split(delimiter4).some((dir) => dir !== "" && existsSync19(join22(dir, bin)));
|
|
59499
59603
|
}
|
|
59500
|
-
var
|
|
59604
|
+
var import_picocolors22;
|
|
59501
59605
|
var init_knowledge = __esm(() => {
|
|
59502
59606
|
init_commander();
|
|
59503
59607
|
init_trpc();
|
|
@@ -59519,7 +59623,7 @@ var init_knowledge = __esm(() => {
|
|
|
59519
59623
|
init_knowledge_incognito();
|
|
59520
59624
|
init_knowledge_statusline();
|
|
59521
59625
|
init_output();
|
|
59522
|
-
|
|
59626
|
+
import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
59523
59627
|
});
|
|
59524
59628
|
|
|
59525
59629
|
// src/commands/libraries.ts
|
|
@@ -59573,7 +59677,7 @@ function librariesCommand() {
|
|
|
59573
59677
|
});
|
|
59574
59678
|
if (opts.json)
|
|
59575
59679
|
return printResult(library, opts);
|
|
59576
|
-
console.log(
|
|
59680
|
+
console.log(import_picocolors23.default.green(`Created library '${library.name}' (${library.id}).`));
|
|
59577
59681
|
});
|
|
59578
59682
|
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
59683
|
if (opts.name === undefined && opts.visibility === undefined) {
|
|
@@ -59599,7 +59703,7 @@ function librariesCommand() {
|
|
|
59599
59703
|
});
|
|
59600
59704
|
if (opts.json)
|
|
59601
59705
|
return printResult(library, opts);
|
|
59602
|
-
console.log(
|
|
59706
|
+
console.log(import_picocolors23.default.green(`Updated library '${library.name}'.`));
|
|
59603
59707
|
});
|
|
59604
59708
|
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
59709
|
if (!await confirmAction({
|
|
@@ -59613,7 +59717,7 @@ function librariesCommand() {
|
|
|
59613
59717
|
const result = await createTypedClient(cfg).libraries.delete.mutate(libraryId);
|
|
59614
59718
|
if (opts.json)
|
|
59615
59719
|
return printResult(result, opts);
|
|
59616
|
-
console.log(
|
|
59720
|
+
console.log(import_picocolors23.default.green(`Deleted library ${libraryId}.`));
|
|
59617
59721
|
});
|
|
59618
59722
|
const config = cmd.command("config").description("Manage library documentation settings");
|
|
59619
59723
|
config.command("get").description("Show documentation settings").argument("<library-id>", "Library ID", uuidV4).option("--json", "Output as JSON").action(async (libraryId, opts) => {
|
|
@@ -59643,7 +59747,7 @@ function librariesCommand() {
|
|
|
59643
59747
|
});
|
|
59644
59748
|
if (opts.json)
|
|
59645
59749
|
return printResult(result, opts);
|
|
59646
|
-
console.log(
|
|
59750
|
+
console.log(import_picocolors23.default.green(`Updated documentation.${setting}.`));
|
|
59647
59751
|
});
|
|
59648
59752
|
const sources = cmd.command("sources").description("Manage sources attached to a library");
|
|
59649
59753
|
sources.command("list").description("List attached sources").argument("<library-id>", "Library ID", uuidV4).option("--json", "Output as JSON").action(async (libraryId, opts) => {
|
|
@@ -59684,7 +59788,7 @@ function librariesCommand() {
|
|
|
59684
59788
|
const result = { action, library_id: libraryId, source_ids: uniqueIds, changed: count };
|
|
59685
59789
|
if (opts.json)
|
|
59686
59790
|
return printResult(result, opts);
|
|
59687
|
-
console.log(
|
|
59791
|
+
console.log(import_picocolors23.default.green(`${action === "attach" ? "Attached" : "Detached"} ${count} source(s).`));
|
|
59688
59792
|
});
|
|
59689
59793
|
}
|
|
59690
59794
|
const sourceConfig = sources.command("config").description("Manage per-library source settings");
|
|
@@ -59728,7 +59832,7 @@ function librariesCommand() {
|
|
|
59728
59832
|
});
|
|
59729
59833
|
if (opts.json)
|
|
59730
59834
|
return printResult(result, opts);
|
|
59731
|
-
console.log(
|
|
59835
|
+
console.log(import_picocolors23.default.green("Updated source settings."));
|
|
59732
59836
|
});
|
|
59733
59837
|
const monitors = cmd.command("monitors").description("Manage source-oriented Monitor settings");
|
|
59734
59838
|
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 +59873,11 @@ function librariesCommand() {
|
|
|
59769
59873
|
});
|
|
59770
59874
|
if (opts.json)
|
|
59771
59875
|
return printResult(result, opts);
|
|
59772
|
-
console.log(
|
|
59876
|
+
console.log(import_picocolors23.default.green("Updated Monitor settings."));
|
|
59773
59877
|
});
|
|
59774
59878
|
return cmd;
|
|
59775
59879
|
}
|
|
59776
|
-
var
|
|
59880
|
+
var import_picocolors23, LIBRARY_VISIBILITIES, CONFIG_SETTINGS, CONFIG_SETTING_NAMES;
|
|
59777
59881
|
var init_libraries = __esm(() => {
|
|
59778
59882
|
init_commander();
|
|
59779
59883
|
init_trpc();
|
|
@@ -59781,7 +59885,7 @@ var init_libraries = __esm(() => {
|
|
|
59781
59885
|
init_auth();
|
|
59782
59886
|
init_confirmation();
|
|
59783
59887
|
init_output();
|
|
59784
|
-
|
|
59888
|
+
import_picocolors23 = __toESM(require_picocolors(), 1);
|
|
59785
59889
|
LIBRARY_VISIBILITIES = ["public", "internal", "private"];
|
|
59786
59890
|
CONFIG_SETTINGS = {
|
|
59787
59891
|
commit_to_trigger_pr: true,
|
|
@@ -59795,7 +59899,7 @@ var init_libraries = __esm(() => {
|
|
|
59795
59899
|
function requireConfig8() {
|
|
59796
59900
|
const cfg = requireLoginConfig();
|
|
59797
59901
|
if (!cfg.active_account?.target?.org_id) {
|
|
59798
|
-
console.error(
|
|
59902
|
+
console.error(import_picocolors24.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
|
|
59799
59903
|
process.exit(1);
|
|
59800
59904
|
}
|
|
59801
59905
|
return cfg;
|
|
@@ -59815,17 +59919,17 @@ function membersCommand() {
|
|
|
59815
59919
|
printResult({ success: true, email, role }, opts);
|
|
59816
59920
|
return;
|
|
59817
59921
|
}
|
|
59818
|
-
console.log(
|
|
59922
|
+
console.log(import_picocolors24.default.green(`Invitation sent to ${email} as ${role}.`));
|
|
59819
59923
|
});
|
|
59820
59924
|
return cmd;
|
|
59821
59925
|
}
|
|
59822
|
-
var
|
|
59926
|
+
var import_picocolors24;
|
|
59823
59927
|
var init_members = __esm(() => {
|
|
59824
59928
|
init_commander();
|
|
59825
59929
|
init_trpc();
|
|
59826
59930
|
init_auth();
|
|
59827
59931
|
init_output();
|
|
59828
|
-
|
|
59932
|
+
import_picocolors24 = __toESM(require_picocolors(), 1);
|
|
59829
59933
|
});
|
|
59830
59934
|
|
|
59831
59935
|
// src/commands/org.ts
|
|
@@ -59843,7 +59947,7 @@ function orgCommand() {
|
|
|
59843
59947
|
return;
|
|
59844
59948
|
}
|
|
59845
59949
|
if (!orgs || orgs.length === 0) {
|
|
59846
|
-
console.log(
|
|
59950
|
+
console.log(import_picocolors25.default.dim("No organizations found."));
|
|
59847
59951
|
return;
|
|
59848
59952
|
}
|
|
59849
59953
|
if (orgs.length === 1) {
|
|
@@ -59857,18 +59961,234 @@ function orgCommand() {
|
|
|
59857
59961
|
printTable(["ID", "Name"], orgs.map((o) => [o.org_id.slice(0, 8), o.name]), { rawData: orgs });
|
|
59858
59962
|
if (cfg.active_account?.target?.org_id) {
|
|
59859
59963
|
console.log(`
|
|
59860
|
-
${
|
|
59964
|
+
${import_picocolors25.default.dim(`Current: ${cfg.active_account?.target?.org_id}`)}`);
|
|
59861
59965
|
}
|
|
59862
59966
|
});
|
|
59863
59967
|
return cmd;
|
|
59864
59968
|
}
|
|
59865
|
-
var
|
|
59969
|
+
var import_picocolors25;
|
|
59866
59970
|
var init_org = __esm(() => {
|
|
59867
59971
|
init_commander();
|
|
59868
59972
|
init_trpc();
|
|
59869
59973
|
init_auth();
|
|
59870
59974
|
init_output();
|
|
59871
|
-
|
|
59975
|
+
import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
59976
|
+
});
|
|
59977
|
+
|
|
59978
|
+
// src/commands/review-notifications.ts
|
|
59979
|
+
function targetOptions(cmd) {
|
|
59980
|
+
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"));
|
|
59981
|
+
}
|
|
59982
|
+
function resolveTarget(opts) {
|
|
59983
|
+
if (opts.library) {
|
|
59984
|
+
return {
|
|
59985
|
+
scope: "space",
|
|
59986
|
+
targetId: opts.library,
|
|
59987
|
+
noun: "Library",
|
|
59988
|
+
flag: `--library ${opts.library}`
|
|
59989
|
+
};
|
|
59990
|
+
}
|
|
59991
|
+
if (opts.agent) {
|
|
59992
|
+
return {
|
|
59993
|
+
scope: "deployment",
|
|
59994
|
+
targetId: opts.agent,
|
|
59995
|
+
noun: "Agent",
|
|
59996
|
+
flag: `--agent ${opts.agent}`
|
|
59997
|
+
};
|
|
59998
|
+
}
|
|
59999
|
+
console.error(import_picocolors26.default.red("Pass --library <library-id> or --agent <agent-id>."));
|
|
60000
|
+
process.exit(1);
|
|
60001
|
+
}
|
|
60002
|
+
function installUrl() {
|
|
60003
|
+
return `${getWebAppURL()}/slack`;
|
|
60004
|
+
}
|
|
60005
|
+
function describeDisabledReason(reason) {
|
|
60006
|
+
if (reason === "not_in_channel") {
|
|
60007
|
+
return "Dosu is not in the channel. Run `/invite @Dosu` in it, then re-run `set`.";
|
|
60008
|
+
}
|
|
60009
|
+
if (reason === "is_archived" || reason === "channel_not_found" || reason === "channel_missing") {
|
|
60010
|
+
return "The channel is archived or gone. Run `set` with another channel.";
|
|
60011
|
+
}
|
|
60012
|
+
return `Dosu lost access to the channel (${reason}). Re-run \`set\` to reconnect.`;
|
|
60013
|
+
}
|
|
60014
|
+
function errorCode(err) {
|
|
60015
|
+
return isTRPCClientError(err) ? err.data?.code : undefined;
|
|
60016
|
+
}
|
|
60017
|
+
async function getNotification(client, target) {
|
|
60018
|
+
return client.reviewNotification.get.query({ scope: target.scope, targetId: target.targetId });
|
|
60019
|
+
}
|
|
60020
|
+
function assertWritable(state) {
|
|
60021
|
+
if (!state.canEdit) {
|
|
60022
|
+
console.error(import_picocolors26.default.red("Only organization admins can change Slack Notifications."));
|
|
60023
|
+
process.exit(1);
|
|
60024
|
+
}
|
|
60025
|
+
if (!state.slackInstalled) {
|
|
60026
|
+
console.error(import_picocolors26.default.red("The Dosu Slack app is not installed for this organization."));
|
|
60027
|
+
console.error(`Install it at ${installUrl()}, then re-run this command.`);
|
|
60028
|
+
process.exit(1);
|
|
60029
|
+
}
|
|
60030
|
+
if (!state.notificationsEnabled) {
|
|
60031
|
+
console.error(import_picocolors26.default.red("Slack Notifications are not enabled for this organization."));
|
|
60032
|
+
process.exit(1);
|
|
60033
|
+
}
|
|
60034
|
+
}
|
|
60035
|
+
function printNotification(target, state) {
|
|
60036
|
+
const { notification } = state;
|
|
60037
|
+
if (!notification) {
|
|
60038
|
+
console.log(import_picocolors26.default.dim(`No Slack channel is set for this ${target.noun}.`));
|
|
60039
|
+
} else {
|
|
60040
|
+
const delivers = [
|
|
60041
|
+
notification.notify_doc_reviews && "doc reviews",
|
|
60042
|
+
notification.notify_message_reviews && "draft replies"
|
|
60043
|
+
].filter(Boolean);
|
|
60044
|
+
printInfo([
|
|
60045
|
+
[target.noun, target.targetId],
|
|
60046
|
+
[
|
|
60047
|
+
"Channel",
|
|
60048
|
+
notification.channel ? channelLabel(notification.channel) : import_picocolors26.default.yellow(`missing (${notification.slack_channel_id})`)
|
|
60049
|
+
],
|
|
60050
|
+
[
|
|
60051
|
+
"Private",
|
|
60052
|
+
notification.channel?.is_private == null ? undefined : notification.channel.is_private ? "yes" : "no"
|
|
60053
|
+
],
|
|
60054
|
+
["Notifies", delivers.length > 0 ? delivers.join(", ") : "nothing"],
|
|
60055
|
+
[
|
|
60056
|
+
"Status",
|
|
60057
|
+
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.")
|
|
60058
|
+
]
|
|
60059
|
+
]);
|
|
60060
|
+
}
|
|
60061
|
+
if (!state.slackInstalled) {
|
|
60062
|
+
console.log(import_picocolors26.default.yellow(`The Dosu Slack app is not installed. Install it at ${installUrl()}.`));
|
|
60063
|
+
}
|
|
60064
|
+
if (!state.notificationsEnabled) {
|
|
60065
|
+
console.log(import_picocolors26.default.yellow("Slack Notifications are not enabled for this organization; nothing is delivered."));
|
|
60066
|
+
}
|
|
60067
|
+
if (!notification && state.canEdit && state.slackInstalled && state.notificationsEnabled) {
|
|
60068
|
+
console.log(import_picocolors26.default.dim(`Set one with: dosu review notifications set ${target.flag} --channel <channel>`));
|
|
60069
|
+
}
|
|
60070
|
+
}
|
|
60071
|
+
function reviewNotificationsCommand() {
|
|
60072
|
+
const cmd = new Command("notifications").description("Manage the Slack channel that receives a Library's or Agent's review notifications");
|
|
60073
|
+
cmd.addHelpText("after", RECONNECT_HELP);
|
|
60074
|
+
targetOptions(cmd.command("get").description("Show the Slack channel that receives review notifications")).option("--json", "Output as JSON").action(async (opts) => {
|
|
60075
|
+
const target = resolveTarget(opts);
|
|
60076
|
+
const client = createTypedClient(requireLoginConfig());
|
|
60077
|
+
const state = await getNotification(client, target);
|
|
60078
|
+
if (opts.json) {
|
|
60079
|
+
printResult(state, opts);
|
|
60080
|
+
return;
|
|
60081
|
+
}
|
|
60082
|
+
printNotification(target, state);
|
|
60083
|
+
});
|
|
60084
|
+
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) => {
|
|
60085
|
+
const target = resolveTarget(opts);
|
|
60086
|
+
const client = createTypedClient(requireLoginConfig());
|
|
60087
|
+
const state = await getNotification(client, target);
|
|
60088
|
+
assertWritable(state);
|
|
60089
|
+
const { id: slackChannelId, channel } = await resolveChannel(client, state.orgId, opts.channel, { name: "--channel", uuidUsage: "--channel <uuid>" }, opts.json);
|
|
60090
|
+
const label = channel ? channelLabel(channel) : slackChannelId;
|
|
60091
|
+
const current = state.notification;
|
|
60092
|
+
const currentLabel = current?.channel ? channelLabel(current.channel) : current?.slack_channel_id ?? "none";
|
|
60093
|
+
if (!opts.json) {
|
|
60094
|
+
printInfo([
|
|
60095
|
+
[target.noun, target.targetId],
|
|
60096
|
+
["Channel", `${currentLabel} → ${label}`]
|
|
60097
|
+
]);
|
|
60098
|
+
}
|
|
60099
|
+
if (!await confirmAction({
|
|
60100
|
+
confirmed: opts.confirm,
|
|
60101
|
+
json: opts.json,
|
|
60102
|
+
message: `Send this ${target.noun}'s review notifications to ${label}?`,
|
|
60103
|
+
preview: {
|
|
60104
|
+
target: target.noun.toLowerCase(),
|
|
60105
|
+
targetId: target.targetId,
|
|
60106
|
+
current: current?.slack_channel_id ?? null,
|
|
60107
|
+
slackChannelId,
|
|
60108
|
+
channel
|
|
60109
|
+
}
|
|
60110
|
+
}))
|
|
60111
|
+
return;
|
|
60112
|
+
try {
|
|
60113
|
+
await client.reviewNotification.upsert.mutate({
|
|
60114
|
+
scope: target.scope,
|
|
60115
|
+
targetId: target.targetId,
|
|
60116
|
+
slackChannelId
|
|
60117
|
+
});
|
|
60118
|
+
} catch (err) {
|
|
60119
|
+
if (errorCode(err) === "PRECONDITION_FAILED") {
|
|
60120
|
+
console.error(import_picocolors26.default.red(`Dosu can't join ${label}.`));
|
|
60121
|
+
console.error(`Run \`/invite @Dosu\` in the channel, then re-run \`dosu review notifications set ${target.flag} --channel ${opts.channel}\`.`);
|
|
60122
|
+
process.exit(1);
|
|
60123
|
+
}
|
|
60124
|
+
throw err;
|
|
60125
|
+
}
|
|
60126
|
+
const updated = await getNotification(client, target);
|
|
60127
|
+
if (opts.json) {
|
|
60128
|
+
printResult({ success: true, notification: updated.notification }, opts);
|
|
60129
|
+
return;
|
|
60130
|
+
}
|
|
60131
|
+
const saved = updated.notification?.channel;
|
|
60132
|
+
console.log(import_picocolors26.default.green(`Review notifications for this ${target.noun} now go to ${saved ? channelLabel(saved) : label}.`));
|
|
60133
|
+
});
|
|
60134
|
+
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) => {
|
|
60135
|
+
const target = resolveTarget(opts);
|
|
60136
|
+
const client = createTypedClient(requireLoginConfig());
|
|
60137
|
+
const state = await getNotification(client, target);
|
|
60138
|
+
const current = state.notification;
|
|
60139
|
+
if (!current) {
|
|
60140
|
+
if (opts.json) {
|
|
60141
|
+
printResult({ success: true, removed: false }, opts);
|
|
60142
|
+
return;
|
|
60143
|
+
}
|
|
60144
|
+
console.log(import_picocolors26.default.dim(`No Slack channel is set for this ${target.noun}; nothing to clear.`));
|
|
60145
|
+
return;
|
|
60146
|
+
}
|
|
60147
|
+
if (!state.canEdit) {
|
|
60148
|
+
console.error(import_picocolors26.default.red("Only organization admins can change Slack Notifications."));
|
|
60149
|
+
process.exit(1);
|
|
60150
|
+
}
|
|
60151
|
+
const label = current.channel ? channelLabel(current.channel) : current.slack_channel_id;
|
|
60152
|
+
if (!await confirmAction({
|
|
60153
|
+
confirmed: opts.confirm,
|
|
60154
|
+
json: opts.json,
|
|
60155
|
+
message: `Stop sending this ${target.noun}'s review notifications to ${label}?`,
|
|
60156
|
+
preview: {
|
|
60157
|
+
target: target.noun.toLowerCase(),
|
|
60158
|
+
targetId: target.targetId,
|
|
60159
|
+
current: current.slack_channel_id,
|
|
60160
|
+
channel: current.channel
|
|
60161
|
+
}
|
|
60162
|
+
}))
|
|
60163
|
+
return;
|
|
60164
|
+
await client.reviewNotification.remove.mutate({
|
|
60165
|
+
scope: target.scope,
|
|
60166
|
+
targetId: target.targetId
|
|
60167
|
+
});
|
|
60168
|
+
if (opts.json) {
|
|
60169
|
+
printResult({ success: true, removed: true }, opts);
|
|
60170
|
+
return;
|
|
60171
|
+
}
|
|
60172
|
+
console.log(import_picocolors26.default.green(`Review notifications for this ${target.noun} no longer go to Slack.`));
|
|
60173
|
+
});
|
|
60174
|
+
return cmd;
|
|
60175
|
+
}
|
|
60176
|
+
var import_picocolors26, RECONNECT_HELP = `
|
|
60177
|
+
A channel that stopped receiving notifications (archived, Dosu removed, access lost) shows its
|
|
60178
|
+
reason in \`get\`. Re-run \`set\` with the same channel to reconnect it.
|
|
60179
|
+
|
|
60180
|
+
--channel accepts a Dosu channel UUID, a Slack channel ID (C… / G…), or a name (#name or name).
|
|
60181
|
+
Only organization admins can change Slack Notifications.`;
|
|
60182
|
+
var init_review_notifications = __esm(() => {
|
|
60183
|
+
init_dist();
|
|
60184
|
+
init_commander();
|
|
60185
|
+
init_trpc();
|
|
60186
|
+
init_arguments();
|
|
60187
|
+
init_auth();
|
|
60188
|
+
init_confirmation();
|
|
60189
|
+
init_output();
|
|
60190
|
+
init_slack_channel_resolve();
|
|
60191
|
+
import_picocolors26 = __toESM(require_picocolors(), 1);
|
|
59872
60192
|
});
|
|
59873
60193
|
|
|
59874
60194
|
// src/commands/time-range.ts
|
|
@@ -59985,7 +60305,7 @@ async function requireChange(client, id) {
|
|
|
59985
60305
|
return await client.review.getChange.query({ id });
|
|
59986
60306
|
} catch (err) {
|
|
59987
60307
|
if (isNotFound(err) || isInvalidId(err)) {
|
|
59988
|
-
console.error(
|
|
60308
|
+
console.error(import_picocolors27.default.red(`No review item found for '${id}'. Run 'dosu review list' to see pending items.`));
|
|
59989
60309
|
process.exit(1);
|
|
59990
60310
|
}
|
|
59991
60311
|
throw err;
|
|
@@ -59994,7 +60314,7 @@ async function requireChange(client, id) {
|
|
|
59994
60314
|
async function requireDraft(client, id) {
|
|
59995
60315
|
const draft = await client.messages.getMessage.query(bareMessageId(id));
|
|
59996
60316
|
if (!draft) {
|
|
59997
|
-
console.error(
|
|
60317
|
+
console.error(import_picocolors27.default.red(`No review item found for '${id}'. Run 'dosu review list' to see pending items.`));
|
|
59998
60318
|
process.exit(1);
|
|
59999
60319
|
}
|
|
60000
60320
|
return draft;
|
|
@@ -60017,12 +60337,12 @@ function colorizeDiff(diff) {
|
|
|
60017
60337
|
return diff.split(`
|
|
60018
60338
|
`).map((line) => {
|
|
60019
60339
|
if (line.startsWith("+"))
|
|
60020
|
-
return
|
|
60340
|
+
return import_picocolors27.default.green(line);
|
|
60021
60341
|
if (line.startsWith("-"))
|
|
60022
|
-
return
|
|
60342
|
+
return import_picocolors27.default.red(line);
|
|
60023
60343
|
if (line.startsWith("@@"))
|
|
60024
|
-
return
|
|
60025
|
-
return
|
|
60344
|
+
return import_picocolors27.default.cyan(line);
|
|
60345
|
+
return import_picocolors27.default.dim(line);
|
|
60026
60346
|
}).join(`
|
|
60027
60347
|
`);
|
|
60028
60348
|
}
|
|
@@ -60036,7 +60356,7 @@ function printChangePreview(change) {
|
|
|
60036
60356
|
]
|
|
60037
60357
|
]);
|
|
60038
60358
|
if (!change.hasChanges) {
|
|
60039
|
-
console.log(
|
|
60359
|
+
console.log(import_picocolors27.default.dim("No content changes."));
|
|
60040
60360
|
return;
|
|
60041
60361
|
}
|
|
60042
60362
|
console.log();
|
|
@@ -60053,7 +60373,7 @@ function printDraftPreview(draft) {
|
|
|
60053
60373
|
async function getKnowledgeStoreId2(client, spaceId) {
|
|
60054
60374
|
const store = await client.knowledgeStore.getBySpaceId.query({ space_id: spaceId });
|
|
60055
60375
|
if (!store) {
|
|
60056
|
-
console.error(
|
|
60376
|
+
console.error(import_picocolors27.default.red("No knowledge store found for this deployment."));
|
|
60057
60377
|
process.exit(1);
|
|
60058
60378
|
}
|
|
60059
60379
|
return store.id;
|
|
@@ -60065,14 +60385,14 @@ function reviewCommand() {
|
|
|
60065
60385
|
try {
|
|
60066
60386
|
range = resolveTimeRange(opts.since, opts.until);
|
|
60067
60387
|
} catch (err) {
|
|
60068
|
-
console.error(
|
|
60388
|
+
console.error(import_picocolors27.default.red(`${err.message}.`));
|
|
60069
60389
|
process.exit(1);
|
|
60070
60390
|
}
|
|
60071
60391
|
const rangeLabel = describeTimeRange(range);
|
|
60072
60392
|
const inRange = rangeLabel ? ` ${rangeLabel}` : "";
|
|
60073
60393
|
const cfg = requireConfig10();
|
|
60074
60394
|
if (!cfg.active_account?.target?.space_id) {
|
|
60075
|
-
console.error(
|
|
60395
|
+
console.error(import_picocolors27.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
|
|
60076
60396
|
process.exit(1);
|
|
60077
60397
|
}
|
|
60078
60398
|
const client = createTypedClient(cfg);
|
|
@@ -60089,11 +60409,11 @@ function reviewCommand() {
|
|
|
60089
60409
|
return;
|
|
60090
60410
|
}
|
|
60091
60411
|
if (!items || items.length === 0) {
|
|
60092
|
-
console.log(
|
|
60412
|
+
console.log(import_picocolors27.default.dim(`No pending review items${inRange}.`));
|
|
60093
60413
|
return;
|
|
60094
60414
|
}
|
|
60095
60415
|
if (rangeLabel)
|
|
60096
|
-
console.log(
|
|
60416
|
+
console.log(import_picocolors27.default.dim(`Pending review items created ${rangeLabel}:`));
|
|
60097
60417
|
printTable(["ID", "Kind", "Title", "Source", "Status", "Created"], items.map((i) => i.kind === "draft_message" ? [
|
|
60098
60418
|
i.id,
|
|
60099
60419
|
i.kind,
|
|
@@ -60110,7 +60430,7 @@ function reviewCommand() {
|
|
|
60110
60430
|
formatDate(i.createdAt)
|
|
60111
60431
|
]), { rawData: items });
|
|
60112
60432
|
if (truncated) {
|
|
60113
|
-
console.log(
|
|
60433
|
+
console.log(import_picocolors27.default.dim(`Showing ${items.length} of ${total}+ pending items${inRange} (list truncated).`));
|
|
60114
60434
|
}
|
|
60115
60435
|
});
|
|
60116
60436
|
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 +60442,8 @@ function reviewCommand() {
|
|
|
60122
60442
|
printResult({ id, kind: "draft_message", title: draft.title, body: draft.body }, opts);
|
|
60123
60443
|
return;
|
|
60124
60444
|
}
|
|
60125
|
-
console.log(
|
|
60126
|
-
console.log(
|
|
60445
|
+
console.log(import_picocolors27.default.bold(draft.title ?? "(untitled)"));
|
|
60446
|
+
console.log(import_picocolors27.default.dim("Draft reply"));
|
|
60127
60447
|
console.log("");
|
|
60128
60448
|
console.log(draft.body ?? "");
|
|
60129
60449
|
return;
|
|
@@ -60134,8 +60454,8 @@ function reviewCommand() {
|
|
|
60134
60454
|
return;
|
|
60135
60455
|
}
|
|
60136
60456
|
const versions = change.publishedVersion != null ? `v${change.publishedVersion} → v${change.version}` : `v${change.version}`;
|
|
60137
|
-
console.log(
|
|
60138
|
-
console.log(
|
|
60457
|
+
console.log(import_picocolors27.default.bold(change.title));
|
|
60458
|
+
console.log(import_picocolors27.default.dim(`${change.source} · ${versions}`));
|
|
60139
60459
|
console.log("");
|
|
60140
60460
|
console.log(change.diff);
|
|
60141
60461
|
});
|
|
@@ -60143,7 +60463,7 @@ function reviewCommand() {
|
|
|
60143
60463
|
const cfg = requireConfig10();
|
|
60144
60464
|
const client = createTypedClient(cfg);
|
|
60145
60465
|
if (opts.body !== undefined && opts.bodyFile !== undefined) {
|
|
60146
|
-
console.error(
|
|
60466
|
+
console.error(import_picocolors27.default.red("Pass only one of --body or --body-file."));
|
|
60147
60467
|
process.exit(1);
|
|
60148
60468
|
}
|
|
60149
60469
|
let body = opts.body;
|
|
@@ -60151,21 +60471,21 @@ function reviewCommand() {
|
|
|
60151
60471
|
try {
|
|
60152
60472
|
body = readFileSync19(opts.bodyFile, "utf-8");
|
|
60153
60473
|
} catch (err) {
|
|
60154
|
-
console.error(
|
|
60474
|
+
console.error(import_picocolors27.default.red(`Failed to read --body-file: ${err.message}`));
|
|
60155
60475
|
process.exit(1);
|
|
60156
60476
|
}
|
|
60157
60477
|
}
|
|
60158
60478
|
if (body === undefined && opts.title === undefined) {
|
|
60159
|
-
console.error(
|
|
60479
|
+
console.error(import_picocolors27.default.red("Nothing to edit. Pass --title and/or --body/--body-file."));
|
|
60160
60480
|
process.exit(1);
|
|
60161
60481
|
}
|
|
60162
60482
|
if (isDraftId(id)) {
|
|
60163
60483
|
if (opts.title !== undefined) {
|
|
60164
|
-
console.error(
|
|
60484
|
+
console.error(import_picocolors27.default.red("Draft replies support --body only (no --title)."));
|
|
60165
60485
|
process.exit(1);
|
|
60166
60486
|
}
|
|
60167
60487
|
if (body === undefined) {
|
|
60168
|
-
console.error(
|
|
60488
|
+
console.error(import_picocolors27.default.red("Draft replies require --body or --body-file."));
|
|
60169
60489
|
process.exit(1);
|
|
60170
60490
|
}
|
|
60171
60491
|
await requireDraft(client, id);
|
|
@@ -60182,7 +60502,7 @@ function reviewCommand() {
|
|
|
60182
60502
|
});
|
|
60183
60503
|
} catch (err) {
|
|
60184
60504
|
if (isNotFound(err)) {
|
|
60185
|
-
console.error(
|
|
60505
|
+
console.error(import_picocolors27.default.red(`No pending review item found for '${id}'. Run 'dosu review list' to see editable items.`));
|
|
60186
60506
|
process.exit(1);
|
|
60187
60507
|
}
|
|
60188
60508
|
throw err;
|
|
@@ -60192,7 +60512,7 @@ function reviewCommand() {
|
|
|
60192
60512
|
printResult({ success: true, id }, opts);
|
|
60193
60513
|
return;
|
|
60194
60514
|
}
|
|
60195
|
-
console.log(
|
|
60515
|
+
console.log(import_picocolors27.default.green(`Review edited: ${truncateId(id)}`));
|
|
60196
60516
|
});
|
|
60197
60517
|
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
60518
|
const cfg = requireConfig10();
|
|
@@ -60256,7 +60576,7 @@ function reviewCommand() {
|
|
|
60256
60576
|
printResult({ success: true, id, action }, opts);
|
|
60257
60577
|
return;
|
|
60258
60578
|
}
|
|
60259
|
-
console.log(
|
|
60579
|
+
console.log(import_picocolors27.default.green(`Review ${name}: ${truncateId(id)}`));
|
|
60260
60580
|
});
|
|
60261
60581
|
}
|
|
60262
60582
|
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 +60584,7 @@ function reviewCommand() {
|
|
|
60264
60584
|
const client = createTypedClient(cfg);
|
|
60265
60585
|
if (isDraftId(id)) {
|
|
60266
60586
|
await requireDraft(client, id);
|
|
60267
|
-
console.error(
|
|
60587
|
+
console.error(import_picocolors27.default.red("Revert is not supported for draft replies. A rejected draft is regenerated on the next agent run."));
|
|
60268
60588
|
process.exit(1);
|
|
60269
60589
|
}
|
|
60270
60590
|
await requireChange(client, id);
|
|
@@ -60276,11 +60596,12 @@ function reviewCommand() {
|
|
|
60276
60596
|
printResult({ success: true, id, action: "revert_to_pending" }, opts);
|
|
60277
60597
|
return;
|
|
60278
60598
|
}
|
|
60279
|
-
console.log(
|
|
60599
|
+
console.log(import_picocolors27.default.green(`Review revert: ${truncateId(id)}`));
|
|
60280
60600
|
});
|
|
60601
|
+
cmd.addCommand(reviewNotificationsCommand());
|
|
60281
60602
|
return cmd;
|
|
60282
60603
|
}
|
|
60283
|
-
var
|
|
60604
|
+
var import_picocolors27, DRAFT_MESSAGE_ID_PREFIX = "draft_message:";
|
|
60284
60605
|
var init_review = __esm(() => {
|
|
60285
60606
|
init_dist();
|
|
60286
60607
|
init_commander();
|
|
@@ -60288,8 +60609,9 @@ var init_review = __esm(() => {
|
|
|
60288
60609
|
init_auth();
|
|
60289
60610
|
init_confirmation();
|
|
60290
60611
|
init_output();
|
|
60612
|
+
init_review_notifications();
|
|
60291
60613
|
init_time_range();
|
|
60292
|
-
|
|
60614
|
+
import_picocolors27 = __toESM(require_picocolors(), 1);
|
|
60293
60615
|
});
|
|
60294
60616
|
|
|
60295
60617
|
// src/generated/skills.ts
|
|
@@ -60347,6 +60669,7 @@ Operate Dosu through \`dosu\`. Prefer structured output and let the CLI and App
|
|
|
60347
60669
|
| Create, import, or publish docs | \`dosu docs ...\` |
|
|
60348
60670
|
| 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
60671
|
| Inspect, edit, approve, or reject one review item | Read [review-workflow.md](references/review-workflow.md) first |
|
|
60672
|
+
| Send a Library's or Agent's review notifications to a Slack channel | \`dosu review notifications get --json\`, then \`set\`/\`clear\` |
|
|
60350
60673
|
| Inspect conversations | \`dosu threads ...\` |
|
|
60351
60674
|
| Browse managed topics | \`dosu topics ...\` |
|
|
60352
60675
|
| Audit agent docs, README, architecture, or dependencies | Read [audit.md](references/audit.md) first |
|
|
@@ -60746,11 +61069,18 @@ dosu review context <thread-id> [--json]
|
|
|
60746
61069
|
dosu review approve <id> [--confirm] [--json]
|
|
60747
61070
|
dosu review reject <id> [--confirm] [--json]
|
|
60748
61071
|
dosu review revert <id> [--json]
|
|
61072
|
+
dosu review notifications get (--library <library-id> | --agent <agent-id>) [--json]
|
|
61073
|
+
dosu review notifications set (--library <library-id> | --agent <agent-id>)
|
|
61074
|
+
--channel <uuid | slack-id | #name> [--confirm] [--json]
|
|
61075
|
+
dosu review notifications clear (--library <library-id> | --agent <agent-id>) [--confirm] [--json]
|
|
60749
61076
|
\`\`\`
|
|
60750
61077
|
|
|
60751
61078
|
- \`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
61079
|
- 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
61080
|
- \`edit\` requires at least one field; drafts accept only \`--body\`/\`--body-file\`. \`approve\` and \`reject\` do not write without interactive confirmation or \`--confirm\`.
|
|
61081
|
+
- \`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\`).
|
|
61082
|
+
- \`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.
|
|
61083
|
+
- \`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
61084
|
|
|
60755
61085
|
## Sources, integrations, members, and organization
|
|
60756
61086
|
|
|
@@ -60765,8 +61095,8 @@ dosu sources create github --repo <owner/name> [--library <id>] [--confirm] [--j
|
|
|
60765
61095
|
|
|
60766
61096
|
dosu integrations list [--json]
|
|
60767
61097
|
dosu integrations status <platform> [--json]
|
|
60768
|
-
dosu integrations slack-channels [--json]
|
|
60769
|
-
dosu integrations slack-join <
|
|
61098
|
+
dosu integrations slack-channels [--search <term>] [--limit <1-100>] [--cursor <uuid>] [--all] [--json]
|
|
61099
|
+
dosu integrations slack-join <uuid | slack-id | #name> [--json]
|
|
60770
61100
|
dosu integrations github-collaborators <positive-repository-id> [--json]
|
|
60771
61101
|
|
|
60772
61102
|
dosu members invite <email> [--role admin|member] [--json] # default member
|
|
@@ -60783,6 +61113,17 @@ dosu org info [--json]
|
|
|
60783
61113
|
to the active Library. A repo not listed means the GitHub App lacks access — run
|
|
60784
61114
|
\`sources connect github\` first. Forks can't be connected.
|
|
60785
61115
|
- 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.
|
|
61116
|
+
- \`slack-channels\` lists each channel's Dosu UUID and Slack ID (\`C…\`/\`G…\`); \`slack-join\` and
|
|
61117
|
+
\`review notifications set --channel\` accept either, or the channel name (quote \`'#name'\` in
|
|
61118
|
+
shells that treat \`#\` as a comment). A name shared across Slack workspaces or not found exits 1
|
|
61119
|
+
with candidate UUIDs on stderr. \`slack-join --json\` returns \`{success, channelId, id, channel}\`:
|
|
61120
|
+
\`channelId\` is the input, \`id\` the resolved UUID, and \`channel\` the matched row (\`null\` when a
|
|
61121
|
+
UUID was passed).
|
|
61122
|
+
- \`slack-channels\` lists 50 available channels per page (\`--limit\` up to 100); \`--search\` is a
|
|
61123
|
+
server-side substring match on the name. \`--json\` always returns \`{items, nextCursor}\`, where
|
|
61124
|
+
each item carries both \`id\` and \`channel_id\`; pass a non-null \`nextCursor\` as \`--cursor\` for the
|
|
61125
|
+
next page. \`--all\` reads every page (\`nextCursor: null\`) and cannot be combined with \`--limit\` or
|
|
61126
|
+
\`--cursor\`; prefer \`--search\` in large organizations.
|
|
60786
61127
|
- The CLI has no member list/remove/request commands; \`members invite\` is its only member operation.
|
|
60787
61128
|
|
|
60788
61129
|
## Threads, Topics, suggestions, and analytics
|
|
@@ -61263,7 +61604,7 @@ function removeSkills() {
|
|
|
61263
61604
|
}
|
|
61264
61605
|
function printPaths(paths) {
|
|
61265
61606
|
for (const path of paths)
|
|
61266
|
-
console.log(
|
|
61607
|
+
console.log(import_picocolors28.default.dim(` ${path}`));
|
|
61267
61608
|
}
|
|
61268
61609
|
function skillCommand() {
|
|
61269
61610
|
const cmd = new Command("skill").description("Manage the Dosu agent skills bundled with the CLI");
|
|
@@ -61272,10 +61613,10 @@ function skillCommand() {
|
|
|
61272
61613
|
const result = await installSkill();
|
|
61273
61614
|
if (result.success) {
|
|
61274
61615
|
printPaths(result.paths ?? []);
|
|
61275
|
-
console.log(
|
|
61616
|
+
console.log(import_picocolors28.default.green(`
|
|
61276
61617
|
✓ Skills installed successfully.`));
|
|
61277
61618
|
} else {
|
|
61278
|
-
console.error(
|
|
61619
|
+
console.error(import_picocolors28.default.red(`
|
|
61279
61620
|
Failed to install skill. Run with --debug for details.`));
|
|
61280
61621
|
process.exit(1);
|
|
61281
61622
|
}
|
|
@@ -61289,11 +61630,11 @@ Failed to install skill. Run with --debug for details.`));
|
|
|
61289
61630
|
}
|
|
61290
61631
|
console.log("Removing Dosu skills...");
|
|
61291
61632
|
printPaths(removed);
|
|
61292
|
-
console.log(
|
|
61633
|
+
console.log(import_picocolors28.default.green(`
|
|
61293
61634
|
✓ Skills removed.`));
|
|
61294
61635
|
} catch (err) {
|
|
61295
61636
|
logger.error("skill", `Failed to remove skills: ${err}`);
|
|
61296
|
-
console.error(
|
|
61637
|
+
console.error(import_picocolors28.default.red(`
|
|
61297
61638
|
Failed to remove skills.`));
|
|
61298
61639
|
process.exit(1);
|
|
61299
61640
|
}
|
|
@@ -61302,24 +61643,24 @@ Failed to remove skills.`));
|
|
|
61302
61643
|
console.log(`Updating Dosu skills to the copy bundled with v${VERSION}...`);
|
|
61303
61644
|
const result = await installSkill();
|
|
61304
61645
|
if (!result.success) {
|
|
61305
|
-
console.error(
|
|
61646
|
+
console.error(import_picocolors28.default.red(`
|
|
61306
61647
|
Failed to update skill.`));
|
|
61307
61648
|
process.exit(1);
|
|
61308
61649
|
}
|
|
61309
61650
|
printPaths(result.paths ?? []);
|
|
61310
|
-
console.log(
|
|
61651
|
+
console.log(import_picocolors28.default.green(`
|
|
61311
61652
|
✓ Skills updated.`));
|
|
61312
|
-
console.log(
|
|
61653
|
+
console.log(import_picocolors28.default.dim(" Skills ship with the CLI; run `dosu upgrade` to get newer ones."));
|
|
61313
61654
|
});
|
|
61314
61655
|
return cmd;
|
|
61315
61656
|
}
|
|
61316
|
-
var
|
|
61657
|
+
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
61658
|
var init_skill = __esm(() => {
|
|
61318
61659
|
init_commander();
|
|
61319
61660
|
init_config();
|
|
61320
61661
|
init_logger();
|
|
61321
61662
|
init_skills();
|
|
61322
|
-
|
|
61663
|
+
import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
61323
61664
|
SUPPORTED_SKILL_AGENTS = [
|
|
61324
61665
|
"claude-code",
|
|
61325
61666
|
"cursor",
|
|
@@ -61352,7 +61693,7 @@ var init_skill = __esm(() => {
|
|
|
61352
61693
|
function requireConfig11() {
|
|
61353
61694
|
const cfg = requireLoginConfig();
|
|
61354
61695
|
if (!cfg.active_account?.target?.org_id) {
|
|
61355
|
-
console.error(
|
|
61696
|
+
console.error(import_picocolors29.default.red("Missing org config. Run 'dosu setup' to reconfigure."));
|
|
61356
61697
|
process.exit(1);
|
|
61357
61698
|
}
|
|
61358
61699
|
return cfg;
|
|
@@ -61362,7 +61703,7 @@ function rejectWebOnlyProvider(provider, json) {
|
|
|
61362
61703
|
if (json) {
|
|
61363
61704
|
printResult({ provider, cli_supported: false, connect_via: "web", url }, { json: true });
|
|
61364
61705
|
} else {
|
|
61365
|
-
console.error(
|
|
61706
|
+
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
61707
|
}
|
|
61367
61708
|
process.exit(1);
|
|
61368
61709
|
}
|
|
@@ -61381,7 +61722,7 @@ function sourcesCommand() {
|
|
|
61381
61722
|
}
|
|
61382
61723
|
const list = dataSources ?? [];
|
|
61383
61724
|
if (list.length === 0) {
|
|
61384
|
-
console.log(
|
|
61725
|
+
console.log(import_picocolors29.default.dim("No data sources connected."));
|
|
61385
61726
|
return;
|
|
61386
61727
|
}
|
|
61387
61728
|
printTable(["ID", "Name", "Provider", "Created"], list.map((ds) => [
|
|
@@ -61400,7 +61741,7 @@ function sourcesCommand() {
|
|
|
61400
61741
|
return;
|
|
61401
61742
|
}
|
|
61402
61743
|
if (!ds) {
|
|
61403
|
-
console.log(
|
|
61744
|
+
console.log(import_picocolors29.default.dim("Data source not found."));
|
|
61404
61745
|
return;
|
|
61405
61746
|
}
|
|
61406
61747
|
printInfo([
|
|
@@ -61419,7 +61760,7 @@ function sourcesCommand() {
|
|
|
61419
61760
|
printResult({ success: true, id }, opts);
|
|
61420
61761
|
return;
|
|
61421
61762
|
}
|
|
61422
|
-
console.log(
|
|
61763
|
+
console.log(import_picocolors29.default.green(`Data source sync triggered for ${id.slice(0, 8)}.`));
|
|
61423
61764
|
});
|
|
61424
61765
|
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
61766
|
if (opts.name === undefined && opts.description === undefined) {
|
|
@@ -61436,7 +61777,7 @@ function sourcesCommand() {
|
|
|
61436
61777
|
printResult(result, opts);
|
|
61437
61778
|
return;
|
|
61438
61779
|
}
|
|
61439
|
-
console.log(
|
|
61780
|
+
console.log(import_picocolors29.default.green("Data source updated."));
|
|
61440
61781
|
});
|
|
61441
61782
|
cmd.command("delete").description("Delete a data source").argument("<id>", "Data source ID").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
61442
61783
|
const cfg = requireConfig11();
|
|
@@ -61446,7 +61787,7 @@ function sourcesCommand() {
|
|
|
61446
61787
|
printResult({ success: true, id }, opts);
|
|
61447
61788
|
return;
|
|
61448
61789
|
}
|
|
61449
|
-
console.log(
|
|
61790
|
+
console.log(import_picocolors29.default.green("Data source deleted."));
|
|
61450
61791
|
});
|
|
61451
61792
|
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
61793
|
const providerName = provider.toLowerCase();
|
|
@@ -61474,14 +61815,14 @@ function sourcesCommand() {
|
|
|
61474
61815
|
}));
|
|
61475
61816
|
} else {
|
|
61476
61817
|
console.log(`Open this URL to install or update the Dosu GitHub App:
|
|
61477
|
-
${
|
|
61818
|
+
${import_picocolors29.default.cyan(url)}`);
|
|
61478
61819
|
if (opts.open !== false) {
|
|
61479
61820
|
try {
|
|
61480
61821
|
const open = await Promise.resolve().then(() => (init_open(), {}));
|
|
61481
61822
|
await open_default(url);
|
|
61482
61823
|
} catch {}
|
|
61483
61824
|
}
|
|
61484
|
-
console.log(
|
|
61825
|
+
console.log(import_picocolors29.default.dim("Waiting for the install to complete..."));
|
|
61485
61826
|
}
|
|
61486
61827
|
const timedOut = new Promise((resolve) => {
|
|
61487
61828
|
timeoutId = setTimeout(() => resolve(null), timeoutSeconds * 1000);
|
|
@@ -61491,7 +61832,7 @@ function sourcesCommand() {
|
|
|
61491
61832
|
if (opts.json) {
|
|
61492
61833
|
console.log(JSON.stringify({ event: "timeout", timeout_seconds: timeoutSeconds }));
|
|
61493
61834
|
} else {
|
|
61494
|
-
console.error(
|
|
61835
|
+
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
61836
|
}
|
|
61496
61837
|
process.exit(1);
|
|
61497
61838
|
return;
|
|
@@ -61507,14 +61848,14 @@ function sourcesCommand() {
|
|
|
61507
61848
|
}));
|
|
61508
61849
|
return;
|
|
61509
61850
|
}
|
|
61510
|
-
console.log(
|
|
61851
|
+
console.log(import_picocolors29.default.green(`GitHub App connected (installation ${result.installation_id}).`));
|
|
61511
61852
|
if (newRepositories.length > 0) {
|
|
61512
61853
|
for (const repo of newRepositories) {
|
|
61513
61854
|
console.log(` ${repo.slug}`);
|
|
61514
61855
|
}
|
|
61515
|
-
console.log(
|
|
61856
|
+
console.log(import_picocolors29.default.dim("Next: dosu sources create github --repo <owner/name> --library <library-id>"));
|
|
61516
61857
|
} else {
|
|
61517
|
-
console.log(
|
|
61858
|
+
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
61859
|
}
|
|
61519
61860
|
} finally {
|
|
61520
61861
|
clearTimeout(timeoutId);
|
|
@@ -61531,7 +61872,7 @@ function sourcesCommand() {
|
|
|
61531
61872
|
const orgID = cfg.active_account.target.org_id;
|
|
61532
61873
|
const libraryID = opts.library ?? cfg.active_account?.target?.space_id;
|
|
61533
61874
|
if (!libraryID) {
|
|
61534
|
-
console.error(
|
|
61875
|
+
console.error(import_picocolors29.default.red("No library specified and no active library. Pass --library <id>."));
|
|
61535
61876
|
process.exit(1);
|
|
61536
61877
|
return;
|
|
61537
61878
|
}
|
|
@@ -61539,12 +61880,12 @@ function sourcesCommand() {
|
|
|
61539
61880
|
const repos = await fetchListForOrg(client, orgID);
|
|
61540
61881
|
const repo = repos.find((r) => r.slug.toLowerCase() === opts.repo.toLowerCase());
|
|
61541
61882
|
if (!repo) {
|
|
61542
|
-
console.error(
|
|
61883
|
+
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
61884
|
process.exit(1);
|
|
61544
61885
|
return;
|
|
61545
61886
|
}
|
|
61546
61887
|
if (repo.is_fork === true) {
|
|
61547
|
-
console.error(
|
|
61888
|
+
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
61889
|
process.exit(1);
|
|
61549
61890
|
return;
|
|
61550
61891
|
}
|
|
@@ -61568,14 +61909,14 @@ function sourcesCommand() {
|
|
|
61568
61909
|
dataSourceID: existingDataSources.get(repo.repository_id)
|
|
61569
61910
|
});
|
|
61570
61911
|
if (!created) {
|
|
61571
|
-
console.error(
|
|
61912
|
+
console.error(import_picocolors29.default.red("Could not create the data source. Check 'dosu logs --tail 50' for details."));
|
|
61572
61913
|
process.exit(1);
|
|
61573
61914
|
return;
|
|
61574
61915
|
}
|
|
61575
61916
|
const survivors = await verifyDataSourcesPersist(client, orgID, [created.data_source_id]);
|
|
61576
61917
|
if (survivors.dropped.size > 0) {
|
|
61577
61918
|
await deleteOrphanDeployment(client, created.deployment_id, repo.slug);
|
|
61578
|
-
console.error(
|
|
61919
|
+
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
61920
|
process.exit(1);
|
|
61580
61921
|
return;
|
|
61581
61922
|
}
|
|
@@ -61592,13 +61933,13 @@ function sourcesCommand() {
|
|
|
61592
61933
|
printResult(receipt, opts);
|
|
61593
61934
|
return;
|
|
61594
61935
|
}
|
|
61595
|
-
console.log(
|
|
61596
|
-
console.log(
|
|
61597
|
-
console.log(
|
|
61936
|
+
console.log(import_picocolors29.default.green(`Connected ${repo.slug} to library ${libraryID}.`));
|
|
61937
|
+
console.log(import_picocolors29.default.dim(` data source ${created.data_source_id}`));
|
|
61938
|
+
console.log(import_picocolors29.default.dim(` deployment ${created.deployment_id}`));
|
|
61598
61939
|
});
|
|
61599
61940
|
return cmd;
|
|
61600
61941
|
}
|
|
61601
|
-
var
|
|
61942
|
+
var import_picocolors29, CONNECT_TIMEOUT_DEFAULT_SECONDS = 600;
|
|
61602
61943
|
var init_sources = __esm(() => {
|
|
61603
61944
|
init_commander();
|
|
61604
61945
|
init_trpc();
|
|
@@ -61607,7 +61948,7 @@ var init_sources = __esm(() => {
|
|
|
61607
61948
|
init_auth();
|
|
61608
61949
|
init_confirmation();
|
|
61609
61950
|
init_output();
|
|
61610
|
-
|
|
61951
|
+
import_picocolors29 = __toESM(require_picocolors(), 1);
|
|
61611
61952
|
});
|
|
61612
61953
|
|
|
61613
61954
|
// src/telemetry/settings.ts
|
|
@@ -61839,7 +62180,7 @@ var init_telemetry2 = __esm(() => {
|
|
|
61839
62180
|
function requireConfig12() {
|
|
61840
62181
|
const cfg = requireLoginConfig();
|
|
61841
62182
|
if (!cfg.active_account?.target?.space_id) {
|
|
61842
|
-
console.error(
|
|
62183
|
+
console.error(import_picocolors30.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
|
|
61843
62184
|
process.exit(1);
|
|
61844
62185
|
}
|
|
61845
62186
|
return cfg;
|
|
@@ -61890,7 +62231,7 @@ function threadsCommand() {
|
|
|
61890
62231
|
return;
|
|
61891
62232
|
}
|
|
61892
62233
|
if (!threads || threads.length === 0) {
|
|
61893
|
-
console.log(
|
|
62234
|
+
console.log(import_picocolors30.default.dim("No threads found."));
|
|
61894
62235
|
return;
|
|
61895
62236
|
}
|
|
61896
62237
|
printTable(["ID", "Title", "Status", "Created"], threads.map((t) => [
|
|
@@ -61915,10 +62256,10 @@ function threadsCommand() {
|
|
|
61915
62256
|
return;
|
|
61916
62257
|
}
|
|
61917
62258
|
if (!thread) {
|
|
61918
|
-
console.log(
|
|
62259
|
+
console.log(import_picocolors30.default.dim("Thread not found."));
|
|
61919
62260
|
return;
|
|
61920
62261
|
}
|
|
61921
|
-
console.log(
|
|
62262
|
+
console.log(import_picocolors30.default.bold(thread.generated_title ?? "(untitled thread)"));
|
|
61922
62263
|
printInfo([
|
|
61923
62264
|
["ID", thread.id],
|
|
61924
62265
|
["Created", formatDate(thread.created_at)],
|
|
@@ -61929,13 +62270,13 @@ function threadsCommand() {
|
|
|
61929
62270
|
if (messages && messages.length > 0) {
|
|
61930
62271
|
const allMessages = messages.flatMap((group) => group.messages);
|
|
61931
62272
|
console.log(`
|
|
61932
|
-
${
|
|
61933
|
-
console.log(
|
|
62273
|
+
${import_picocolors30.default.bold("Messages")} (${allMessages.length})`);
|
|
62274
|
+
console.log(import_picocolors30.default.dim("─".repeat(60)));
|
|
61934
62275
|
for (const msg of allMessages) {
|
|
61935
62276
|
const role = msg.author_role ?? "unknown";
|
|
61936
62277
|
const date = formatDate(msg.created_at);
|
|
61937
62278
|
console.log(`
|
|
61938
|
-
${
|
|
62279
|
+
${import_picocolors30.default.bold(role)} ${import_picocolors30.default.dim(date)}`);
|
|
61939
62280
|
if (msg.body) {
|
|
61940
62281
|
console.log(truncate(msg.body, 500));
|
|
61941
62282
|
}
|
|
@@ -61950,25 +62291,25 @@ ${import_picocolors28.default.bold(role)} ${import_picocolors28.default.dim(date
|
|
|
61950
62291
|
printResult({ success: true, id }, opts);
|
|
61951
62292
|
return;
|
|
61952
62293
|
}
|
|
61953
|
-
console.log(
|
|
62294
|
+
console.log(import_picocolors30.default.green(`Thread ${id.slice(0, 8)} archived.`));
|
|
61954
62295
|
});
|
|
61955
62296
|
return cmd;
|
|
61956
62297
|
}
|
|
61957
|
-
var
|
|
62298
|
+
var import_picocolors30;
|
|
61958
62299
|
var init_threads = __esm(() => {
|
|
61959
62300
|
init_commander();
|
|
61960
62301
|
init_trpc();
|
|
61961
62302
|
init_arguments();
|
|
61962
62303
|
init_auth();
|
|
61963
62304
|
init_output();
|
|
61964
|
-
|
|
62305
|
+
import_picocolors30 = __toESM(require_picocolors(), 1);
|
|
61965
62306
|
});
|
|
61966
62307
|
|
|
61967
62308
|
// src/commands/topics.ts
|
|
61968
62309
|
function requireConfig13() {
|
|
61969
62310
|
const cfg = requireLoginConfig();
|
|
61970
62311
|
if (!cfg.active_account?.target?.space_id) {
|
|
61971
|
-
console.error(
|
|
62312
|
+
console.error(import_picocolors31.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
|
|
61972
62313
|
process.exit(1);
|
|
61973
62314
|
}
|
|
61974
62315
|
return cfg;
|
|
@@ -61978,7 +62319,7 @@ async function getKnowledgeStoreId3(client, spaceId) {
|
|
|
61978
62319
|
space_id: spaceId
|
|
61979
62320
|
});
|
|
61980
62321
|
if (!store) {
|
|
61981
|
-
console.error(
|
|
62322
|
+
console.error(import_picocolors31.default.red("No knowledge store found for this deployment."));
|
|
61982
62323
|
process.exit(1);
|
|
61983
62324
|
}
|
|
61984
62325
|
return store.id;
|
|
@@ -61997,7 +62338,7 @@ function topicsCommand() {
|
|
|
61997
62338
|
return;
|
|
61998
62339
|
}
|
|
61999
62340
|
if (!topics || topics.length === 0) {
|
|
62000
|
-
console.log(
|
|
62341
|
+
console.log(import_picocolors31.default.dim("No topics found."));
|
|
62001
62342
|
return;
|
|
62002
62343
|
}
|
|
62003
62344
|
printTable(["ID", "Name", "Description"], topics.map((t) => [
|
|
@@ -62022,7 +62363,7 @@ function topicsCommand() {
|
|
|
62022
62363
|
return;
|
|
62023
62364
|
}
|
|
62024
62365
|
if (!pages || pages.length === 0) {
|
|
62025
|
-
console.log(
|
|
62366
|
+
console.log(import_picocolors31.default.dim("No pages found with this topic."));
|
|
62026
62367
|
return;
|
|
62027
62368
|
}
|
|
62028
62369
|
printTable(["ID", "Title"], pages.map((p) => [
|
|
@@ -62032,14 +62373,14 @@ function topicsCommand() {
|
|
|
62032
62373
|
});
|
|
62033
62374
|
return cmd;
|
|
62034
62375
|
}
|
|
62035
|
-
var
|
|
62376
|
+
var import_picocolors31;
|
|
62036
62377
|
var init_topics = __esm(() => {
|
|
62037
62378
|
init_commander();
|
|
62038
62379
|
init_trpc();
|
|
62039
62380
|
init_arguments();
|
|
62040
62381
|
init_auth();
|
|
62041
62382
|
init_output();
|
|
62042
|
-
|
|
62383
|
+
import_picocolors31 = __toESM(require_picocolors(), 1);
|
|
62043
62384
|
});
|
|
62044
62385
|
|
|
62045
62386
|
// src/mcp/providers/base.ts
|
|
@@ -63011,23 +63352,23 @@ function buildUpdateHint(channel, npx = false) {
|
|
|
63011
63352
|
function styleHint(hint) {
|
|
63012
63353
|
const match = hint.match(/^(.*)("[^"]+")(.*)$/);
|
|
63013
63354
|
if (!match)
|
|
63014
|
-
return
|
|
63355
|
+
return import_picocolors32.default.dim(hint);
|
|
63015
63356
|
const [, before, command, after] = match;
|
|
63016
|
-
return [before &&
|
|
63357
|
+
return [before && import_picocolors32.default.dim(before), import_picocolors32.default.cyan(command), after && import_picocolors32.default.dim(after)].filter(Boolean).join("");
|
|
63017
63358
|
}
|
|
63018
63359
|
function framedNotice(content, width) {
|
|
63019
63360
|
const innerWidth = Math.max(...content.map(visibleWidth2)) + BOX_PADDING * 2;
|
|
63020
63361
|
const framed = (line) => {
|
|
63021
63362
|
const pad = innerWidth - visibleWidth2(line);
|
|
63022
63363
|
const left = Math.floor(pad / 2);
|
|
63023
|
-
return `${
|
|
63364
|
+
return `${import_picocolors32.default.yellow("│")}${" ".repeat(left)}${line}${" ".repeat(pad - left)}${import_picocolors32.default.yellow("│")}`;
|
|
63024
63365
|
};
|
|
63025
63366
|
const box = [
|
|
63026
|
-
|
|
63367
|
+
import_picocolors32.default.yellow(`╭${"─".repeat(innerWidth)}╮`),
|
|
63027
63368
|
framed(""),
|
|
63028
63369
|
...content.map(framed),
|
|
63029
63370
|
framed(""),
|
|
63030
|
-
|
|
63371
|
+
import_picocolors32.default.yellow(`╰${"─".repeat(innerWidth)}╯`)
|
|
63031
63372
|
];
|
|
63032
63373
|
return `
|
|
63033
63374
|
${centerBlock(box, width).join(`
|
|
@@ -63035,13 +63376,13 @@ ${centerBlock(box, width).join(`
|
|
|
63035
63376
|
`;
|
|
63036
63377
|
}
|
|
63037
63378
|
function versionArrow(current, latest) {
|
|
63038
|
-
return `${
|
|
63379
|
+
return `${import_picocolors32.default.dim(current)} ${import_picocolors32.default.dim("→")} ${import_picocolors32.default.bold(brand(latest))}`;
|
|
63039
63380
|
}
|
|
63040
63381
|
function buildAutoUpdateNotice(current, latest, interactive, width = process.stderr.columns ?? 80) {
|
|
63041
63382
|
if (interactive) {
|
|
63042
63383
|
return framedNotice([
|
|
63043
63384
|
`Updating Dosu: ${versionArrow(current, latest)}`,
|
|
63044
|
-
|
|
63385
|
+
import_picocolors32.default.dim("Installing in the background; your next command uses it")
|
|
63045
63386
|
], width);
|
|
63046
63387
|
}
|
|
63047
63388
|
return `
|
|
@@ -63098,14 +63439,14 @@ async function checkForUpdates(options = {}) {
|
|
|
63098
63439
|
logger.error("update-check", `Update check failed: ${err}`);
|
|
63099
63440
|
}
|
|
63100
63441
|
}
|
|
63101
|
-
var
|
|
63442
|
+
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
63443
|
var init_update_check = __esm(() => {
|
|
63103
63444
|
init_config();
|
|
63104
63445
|
init_logger();
|
|
63105
63446
|
init_styles();
|
|
63106
63447
|
init_layout();
|
|
63107
63448
|
init_auto_update();
|
|
63108
|
-
|
|
63449
|
+
import_picocolors32 = __toESM(require_picocolors(), 1);
|
|
63109
63450
|
CHECK_INTERVAL_MS2 = 6 * 60 * 60 * 1000;
|
|
63110
63451
|
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
63452
|
});
|
|
@@ -63154,8 +63495,8 @@ function canRefreshMcp(cfg) {
|
|
|
63154
63495
|
}
|
|
63155
63496
|
function displayNotice(names) {
|
|
63156
63497
|
console.error(`
|
|
63157
|
-
${
|
|
63158
|
-
` + `${
|
|
63498
|
+
${import_picocolors33.default.green(`✓ Dosu ${VERSION}: refreshed MCP config for ${names.join(", ")}`)}
|
|
63499
|
+
` + `${import_picocolors33.default.dim(` Run ${import_picocolors33.default.cyan('"dosu setup"')} to also update hooks and rules, then restart your AI agents.`)}
|
|
63159
63500
|
`);
|
|
63160
63501
|
}
|
|
63161
63502
|
function checkForMcpRefresh(options = {}) {
|
|
@@ -63183,13 +63524,13 @@ function checkForMcpRefresh(options = {}) {
|
|
|
63183
63524
|
logger.error("mcp-refresh", `MCP refresh check failed: ${err}`);
|
|
63184
63525
|
}
|
|
63185
63526
|
}
|
|
63186
|
-
var
|
|
63527
|
+
var import_picocolors33, CACHE_FILENAME4 = "mcp-refresh.json", MCP_FORMAT_CHANGES;
|
|
63187
63528
|
var init_mcp_refresh_check = __esm(() => {
|
|
63188
63529
|
init_config();
|
|
63189
63530
|
init_logger();
|
|
63190
63531
|
init_refresh();
|
|
63191
63532
|
init_update_check();
|
|
63192
|
-
|
|
63533
|
+
import_picocolors33 = __toESM(require_picocolors(), 1);
|
|
63193
63534
|
MCP_FORMAT_CHANGES = [
|
|
63194
63535
|
"0.53.0",
|
|
63195
63536
|
"0.62.0"
|
|
@@ -63199,8 +63540,8 @@ var init_mcp_refresh_check = __esm(() => {
|
|
|
63199
63540
|
// src/version/skill-update-check.ts
|
|
63200
63541
|
function displayNotice2() {
|
|
63201
63542
|
console.error(`
|
|
63202
|
-
${
|
|
63203
|
-
` + `${
|
|
63543
|
+
${import_picocolors34.default.green(`✓ Dosu ${VERSION}: refreshed the bundled agent skills`)}
|
|
63544
|
+
` + `${import_picocolors34.default.dim(" Restart your AI agents to pick up the new skill content.")}
|
|
63204
63545
|
`);
|
|
63205
63546
|
}
|
|
63206
63547
|
function checkForSkillUpdates(options = {}) {
|
|
@@ -63221,11 +63562,11 @@ function checkForSkillUpdates(options = {}) {
|
|
|
63221
63562
|
logger.error("skill-update-check", `Skill update check failed: ${err}`);
|
|
63222
63563
|
}
|
|
63223
63564
|
}
|
|
63224
|
-
var
|
|
63565
|
+
var import_picocolors34;
|
|
63225
63566
|
var init_skill_update_check = __esm(() => {
|
|
63226
63567
|
init_skill();
|
|
63227
63568
|
init_logger();
|
|
63228
|
-
|
|
63569
|
+
import_picocolors34 = __toESM(require_picocolors(), 1);
|
|
63229
63570
|
});
|
|
63230
63571
|
|
|
63231
63572
|
// src/auth/errors.ts
|
|
@@ -63588,15 +63929,15 @@ function statusLine(status) {
|
|
|
63588
63929
|
if (status.running) {
|
|
63589
63930
|
const since = status.startedAt ? ` · since ${localTime(status.startedAt)}` : "";
|
|
63590
63931
|
const pid = status.pid !== undefined ? ` (pid ${status.pid})` : "";
|
|
63591
|
-
return `\uD83D\uDCDA ${
|
|
63932
|
+
return `\uD83D\uDCDA ${import_picocolors35.default.bold(brand("Studying sessions..."))}${import_picocolors35.default.dim(`${pid}${since}`)}`;
|
|
63592
63933
|
}
|
|
63593
63934
|
if (status.state.paused) {
|
|
63594
|
-
return `${
|
|
63935
|
+
return `${import_picocolors35.default.yellow("○")} ${import_picocolors35.default.bold("Paused")} ${import_picocolors35.default.dim("· studying stays off until you resume")}`;
|
|
63595
63936
|
}
|
|
63596
63937
|
if (status.staleLock) {
|
|
63597
|
-
return `${
|
|
63938
|
+
return `${import_picocolors35.default.yellow("○")} ${import_picocolors35.default.bold("Not running")} ${import_picocolors35.default.dim("· a previous run exited without cleaning up")}`;
|
|
63598
63939
|
}
|
|
63599
|
-
return `${
|
|
63940
|
+
return `${import_picocolors35.default.dim("○")} ${import_picocolors35.default.bold("Idle")} ${import_picocolors35.default.dim("· hooks study new sessions automatically")}`;
|
|
63600
63941
|
}
|
|
63601
63942
|
function progressLine(done, ready, width, notes = 0) {
|
|
63602
63943
|
const total = done + ready;
|
|
@@ -63605,7 +63946,7 @@ function progressLine(done, ready, width, notes = 0) {
|
|
|
63605
63946
|
const cells = Math.max(10, Math.min(30, width - 44));
|
|
63606
63947
|
const ratio = Math.max(0, Math.min(1, done / total));
|
|
63607
63948
|
const filled = Math.min(cells, Math.round(ratio * cells));
|
|
63608
|
-
const bar = brand("█".repeat(filled)) +
|
|
63949
|
+
const bar = brand("█".repeat(filled)) + import_picocolors35.default.dim("░".repeat(cells - filled));
|
|
63609
63950
|
const pct = Math.floor(ratio * 100);
|
|
63610
63951
|
const suffix = notes > 0 ? ` · ${notes} suggested page${notes === 1 ? "" : "s"}` : "";
|
|
63611
63952
|
return `${bar} ${done}/${total} studied · ${pct}%${suffix}`;
|
|
@@ -63644,17 +63985,17 @@ function confirmBox(queuedCount, backlog, width, mode = "start") {
|
|
|
63644
63985
|
const verb = mode === "clear" ? "clear" : mode === "stop" ? "stop" : mode === "resume" ? "resume" : "start";
|
|
63645
63986
|
const maxInner = Math.max(20, Math.min(width, contentWidth()) - 4);
|
|
63646
63987
|
const rows = [
|
|
63647
|
-
|
|
63648
|
-
...wrapLine(scope, maxInner, "").map((line) =>
|
|
63988
|
+
import_picocolors35.default.bold(brand(title)),
|
|
63989
|
+
...wrapLine(scope, maxInner, "").map((line) => import_picocolors35.default.dim(line)),
|
|
63649
63990
|
"",
|
|
63650
|
-
`${
|
|
63991
|
+
`${import_picocolors35.default.bold("enter")} ${verb} · ${import_picocolors35.default.bold("esc")} cancel`
|
|
63651
63992
|
];
|
|
63652
63993
|
const inner = Math.min(maxInner, Math.max(...rows.map(visibleWidth2)));
|
|
63653
63994
|
const pad = (row) => row + " ".repeat(Math.max(0, inner - visibleWidth2(row)));
|
|
63654
63995
|
return [
|
|
63655
|
-
|
|
63656
|
-
...rows.map((row) => `${
|
|
63657
|
-
|
|
63996
|
+
import_picocolors35.default.dim(`╭${"─".repeat(inner + 2)}╮`),
|
|
63997
|
+
...rows.map((row) => `${import_picocolors35.default.dim("│")} ${pad(row)} ${import_picocolors35.default.dim("│")}`),
|
|
63998
|
+
import_picocolors35.default.dim(`╰${"─".repeat(inner + 2)}╯`)
|
|
63658
63999
|
];
|
|
63659
64000
|
}
|
|
63660
64001
|
function buildActivityFrame(status, activity, width, backlog = null, pane = DEFAULT_PANE, queued = [], studiedBeforeRun = 0, open = [], runProgress = null, projectNames = {}, sessionNames = {}, frameLines) {
|
|
@@ -63670,7 +64011,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
|
|
|
63670
64011
|
progress = progressLine(studiedDelta + stepDone, Math.max(0, backlog.ready - stepDone), width, runProgress?.notes ?? 0);
|
|
63671
64012
|
}
|
|
63672
64013
|
const refusal = !status.running && status.state.last_refusal;
|
|
63673
|
-
const refusalLines = refusal ? wrapLine(`! Studying paused: ${refusal.message} (${localTime(refusal.at)})`, width).map((line) =>
|
|
64014
|
+
const refusalLines = refusal ? wrapLine(`! Studying paused: ${refusal.message} (${localTime(refusal.at)})`, width).map((line) => import_picocolors35.default.yellow(line)) : [];
|
|
63674
64015
|
const fullRows = Boolean(pane.fullRows);
|
|
63675
64016
|
const withName = (item, key) => projectNames[key] ? { ...item, project: projectNames[key] } : item;
|
|
63676
64017
|
const latestPass = new Map;
|
|
@@ -63696,8 +64037,8 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
|
|
|
63696
64037
|
breadcrumb(["home", "activity"], width),
|
|
63697
64038
|
"",
|
|
63698
64039
|
statusLine(status),
|
|
63699
|
-
|
|
63700
|
-
...queueDetail.length > 0 ? wrapLine(queueDetail.join(" · "), width).map((line) =>
|
|
64040
|
+
import_picocolors35.default.dim(studied),
|
|
64041
|
+
...queueDetail.length > 0 ? wrapLine(queueDetail.join(" · "), width).map((line) => import_picocolors35.default.dim(line)) : [],
|
|
63701
64042
|
...progress ? [progress] : [],
|
|
63702
64043
|
...refusalLines,
|
|
63703
64044
|
"",
|
|
@@ -63713,7 +64054,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
|
|
|
63713
64054
|
status.running ? "s stop" : status.state.paused ? "s resume" : "s sync now",
|
|
63714
64055
|
...!status.running && status.state.watermark ? ["c clear"] : [],
|
|
63715
64056
|
"esc back"
|
|
63716
|
-
].join(" · "), width, "").map((line) =>
|
|
64057
|
+
].join(" · "), width, "").map((line) => import_picocolors35.default.dim(line))
|
|
63717
64058
|
]
|
|
63718
64059
|
];
|
|
63719
64060
|
const defaultHeight = fullRows ? ACTIVITY_VIEW_FULL_LIST_ROWS : ACTIVITY_VIEW_LIST_LINES;
|
|
@@ -63726,7 +64067,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
|
|
|
63726
64067
|
({ visible, above, below } = windowList(source, pane.scroll, height));
|
|
63727
64068
|
display = visible.flatMap((row) => wrapRow(row, width));
|
|
63728
64069
|
}
|
|
63729
|
-
const listRows = display.length > 0 ? display.map((row) =>
|
|
64070
|
+
const listRows = display.length > 0 ? display.map((row) => import_picocolors35.default.dim(row)) : [import_picocolors35.default.dim(empty)];
|
|
63730
64071
|
const scrollParts = [];
|
|
63731
64072
|
if (above > 0)
|
|
63732
64073
|
scrollParts.push(`↑ ${above} earlier`);
|
|
@@ -63735,7 +64076,7 @@ function buildActivityFrame(status, activity, width, backlog = null, pane = DEFA
|
|
|
63735
64076
|
const lines = [
|
|
63736
64077
|
...header,
|
|
63737
64078
|
...listRows,
|
|
63738
|
-
...scrollParts.length > 0 ? [
|
|
64079
|
+
...scrollParts.length > 0 ? [import_picocolors35.default.dim(clip(scrollParts.join(" · "), width))] : [],
|
|
63739
64080
|
...footer
|
|
63740
64081
|
];
|
|
63741
64082
|
return { lines, listHeight: height };
|
|
@@ -63990,7 +64331,7 @@ ${CLEAR_BELOW}`);
|
|
|
63990
64331
|
input.on("data", onData);
|
|
63991
64332
|
});
|
|
63992
64333
|
}
|
|
63993
|
-
var
|
|
64334
|
+
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
64335
|
var init_activity_view = __esm(() => {
|
|
63995
64336
|
init_follow();
|
|
63996
64337
|
init_logger();
|
|
@@ -64005,7 +64346,7 @@ var init_activity_view = __esm(() => {
|
|
|
64005
64346
|
init_alt_screen();
|
|
64006
64347
|
init_layout();
|
|
64007
64348
|
init_menu();
|
|
64008
|
-
|
|
64349
|
+
import_picocolors35 = __toESM(require_picocolors(), 1);
|
|
64009
64350
|
ESC7 = String.fromCharCode(27);
|
|
64010
64351
|
HIDE_CURSOR3 = `${ESC7}[?25l`;
|
|
64011
64352
|
SHOW_CURSOR3 = `${ESC7}[?25h`;
|
|
@@ -64157,9 +64498,9 @@ When \`read_knowledge\` is listed, call it before non-trivial code or documentat
|
|
|
64157
64498
|
|
|
64158
64499
|
When \`write_knowledge\` is listed, use it after the task for durable, non-obvious knowledge that future work would otherwise have to rediscover. Do not save task or PR summaries, progress, test results, obvious facts, speculation, duplicates, or sensitive data. **If nothing durable was learned, do not write.**
|
|
64159
64500
|
|
|
64160
|
-
Use \`review_knowledge\` only when the user asks to inspect or manage pending knowledge. Preview one item at a time and require explicit confirmation before making changes.
|
|
64501
|
+
Use \`review_knowledge\` only when the user asks to inspect or manage pending knowledge; for a review list, review queue, pending reviews, or what needs approval, call it with action="list". Preview one item at a time and require explicit confirmation before making changes.
|
|
64161
64502
|
|
|
64162
|
-
When \`read_knowledge\` or \`write_knowledge\` returned a \`receipt_item_id\` this turn, call \`finalize_session_knowledge\` exactly once at the end of the turn — after completing the task, immediately before your final reply — passing all receipt_item_ids from this turn.
|
|
64503
|
+
When \`read_knowledge\` or \`write_knowledge\` returned a \`receipt_item_id\` this turn, call \`finalize_session_knowledge\` exactly once at the end of the turn — after completing the task, immediately before your final reply — passing all receipt_item_ids from this turn. Avoid calling it when the current turn produced no receipt_item_id (it will succeed but render an empty state), and never call it more than once per turn.
|
|
64163
64504
|
`, RULE_TARGETS;
|
|
64164
64505
|
var init_installer = __esm(() => {
|
|
64165
64506
|
DOSU_RULE_SECTION_START = `<!-- dosu:rules:start v${DOSU_RULE_SECTION_VERSION} -->`;
|
|
@@ -65723,7 +66064,7 @@ async function stepSelectTools(detected) {
|
|
|
65723
66064
|
initialValues: preselected,
|
|
65724
66065
|
statusFor: (id, picked) => {
|
|
65725
66066
|
if (configuredMap.get(id))
|
|
65726
|
-
return picked ? dim("configured") :
|
|
66067
|
+
return picked ? dim("configured") : import_picocolors36.default.yellow("will remove");
|
|
65727
66068
|
return picked ? brand("will configure") : undefined;
|
|
65728
66069
|
},
|
|
65729
66070
|
summary: (picked) => {
|
|
@@ -65898,7 +66239,7 @@ ${dim(wrapLog("Run it inside a session to keep that session out of studying. Rem
|
|
|
65898
66239
|
log2.success("All agents already configured. No changes needed.");
|
|
65899
66240
|
}
|
|
65900
66241
|
}
|
|
65901
|
-
var
|
|
66242
|
+
var import_picocolors36, OAUTH_ANALYTICS_REASONS, SETUP_HANDSHAKE_TIMEOUT_MS = 1800000, LIBRARY_SELECT_CANCELLED;
|
|
65902
66243
|
var init_flow2 = __esm(() => {
|
|
65903
66244
|
init_errors4();
|
|
65904
66245
|
init_client();
|
|
@@ -65921,7 +66262,7 @@ var init_flow2 = __esm(() => {
|
|
|
65921
66262
|
init_analytics2();
|
|
65922
66263
|
init_rules_step();
|
|
65923
66264
|
init_styles();
|
|
65924
|
-
|
|
66265
|
+
import_picocolors36 = __toESM(require_picocolors(), 1);
|
|
65925
66266
|
OAUTH_ANALYTICS_REASONS = new Set([
|
|
65926
66267
|
"access_denied",
|
|
65927
66268
|
"bad_oauth_state",
|
|
@@ -66085,7 +66426,7 @@ Could not update Dosu automatically.`);
|
|
|
66085
66426
|
${plan.manualCommand}`);
|
|
66086
66427
|
return result.status && result.status > 0 ? result.status : 1;
|
|
66087
66428
|
}
|
|
66088
|
-
console.log(
|
|
66429
|
+
console.log(import_picocolors37.default.green(`
|
|
66089
66430
|
✓ Update command completed.`));
|
|
66090
66431
|
console.log('Run "dosu --version" to verify.');
|
|
66091
66432
|
return 0;
|
|
@@ -66132,7 +66473,7 @@ async function finishUpgrade(from, options = {}) {
|
|
|
66132
66473
|
if (!needsMcpRefresh(previous, VERSION)) {
|
|
66133
66474
|
checkForSkillUpdates();
|
|
66134
66475
|
writeMcpRefreshCache({ version: VERSION });
|
|
66135
|
-
console.log(
|
|
66476
|
+
console.log(import_picocolors37.default.green(`✓ Dosu ${VERSION} is ready. Your AI agents need no changes.`));
|
|
66136
66477
|
return 0;
|
|
66137
66478
|
}
|
|
66138
66479
|
if (options.interactive ?? isInteractiveTerminal()) {
|
|
@@ -66197,7 +66538,7 @@ function upgradeCommand() {
|
|
|
66197
66538
|
process.exitCode = status;
|
|
66198
66539
|
});
|
|
66199
66540
|
}
|
|
66200
|
-
var
|
|
66541
|
+
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
66542
|
var init_upgrade = __esm(() => {
|
|
66202
66543
|
init_commander();
|
|
66203
66544
|
init_config();
|
|
@@ -66205,7 +66546,7 @@ var init_upgrade = __esm(() => {
|
|
|
66205
66546
|
init_auto_update();
|
|
66206
66547
|
init_mcp_refresh_check();
|
|
66207
66548
|
init_skill_update_check();
|
|
66208
|
-
|
|
66549
|
+
import_picocolors37 = __toESM(require_picocolors(), 1);
|
|
66209
66550
|
LATEST_PACKAGE = `${PACKAGE_NAME}@latest`;
|
|
66210
66551
|
PACKAGE_MANAGERS = {
|
|
66211
66552
|
npm: {
|
|
@@ -66345,7 +66686,7 @@ function renderAnalyticsFrame(state, tab, scroll, pageStats = null, pagesPending
|
|
|
66345
66686
|
const rows = analyticsTabRows(tab, state, pageStats);
|
|
66346
66687
|
const { visible, above, below } = windowReport(rows, scroll, height);
|
|
66347
66688
|
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) =>
|
|
66689
|
+
const listRows = visible.length > 0 ? visible.map((row) => import_picocolors38.default.dim(row)) : [import_picocolors38.default.dim(empty)];
|
|
66349
66690
|
const scrollParts = [];
|
|
66350
66691
|
if (above > 0)
|
|
66351
66692
|
scrollParts.push(`↑ ${above} earlier`);
|
|
@@ -66361,9 +66702,9 @@ function renderAnalyticsFrame(state, tab, scroll, pageStats = null, pagesPending
|
|
|
66361
66702
|
], tab, width, { spread: false }),
|
|
66362
66703
|
"",
|
|
66363
66704
|
...listRows,
|
|
66364
|
-
...scrollParts.length > 0 ? [
|
|
66705
|
+
...scrollParts.length > 0 ? [import_picocolors38.default.dim(scrollParts.join(" · "))] : [],
|
|
66365
66706
|
"",
|
|
66366
|
-
|
|
66707
|
+
import_picocolors38.default.dim("tab switch · ↑↓ scroll · esc back")
|
|
66367
66708
|
];
|
|
66368
66709
|
return lines.join(`
|
|
66369
66710
|
`);
|
|
@@ -66460,7 +66801,7 @@ ${CLEAR_BELOW2}`);
|
|
|
66460
66801
|
input.on("data", onData);
|
|
66461
66802
|
});
|
|
66462
66803
|
}
|
|
66463
|
-
var
|
|
66804
|
+
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
66805
|
var init_analytics_view = __esm(() => {
|
|
66465
66806
|
init_trpc();
|
|
66466
66807
|
init_config();
|
|
@@ -66468,7 +66809,7 @@ var init_analytics_view = __esm(() => {
|
|
|
66468
66809
|
init_alt_screen();
|
|
66469
66810
|
init_layout();
|
|
66470
66811
|
init_menu();
|
|
66471
|
-
|
|
66812
|
+
import_picocolors38 = __toESM(require_picocolors(), 1);
|
|
66472
66813
|
ESC8 = String.fromCharCode(27);
|
|
66473
66814
|
HIDE_CURSOR4 = `${ESC8}[?25l`;
|
|
66474
66815
|
SHOW_CURSOR4 = `${ESC8}[?25h`;
|
|
@@ -66486,7 +66827,7 @@ var init_analytics_view = __esm(() => {
|
|
|
66486
66827
|
// src/tui/banner.ts
|
|
66487
66828
|
function paintLogoRow(row) {
|
|
66488
66829
|
return row.map(([tone, art]) => {
|
|
66489
|
-
if (!
|
|
66830
|
+
if (!import_picocolors39.default.isColorSupported)
|
|
66490
66831
|
return art;
|
|
66491
66832
|
const { fg, fallback } = LOGO_TONES[tone];
|
|
66492
66833
|
return hasTruecolor() ? `${fg}${art}\x1B[39m` : fallback(art);
|
|
@@ -66494,14 +66835,14 @@ function paintLogoRow(row) {
|
|
|
66494
66835
|
}
|
|
66495
66836
|
function checklistRows(ctx) {
|
|
66496
66837
|
const on = brand(CHECK2);
|
|
66497
|
-
const off =
|
|
66838
|
+
const off = import_picocolors39.default.dim(CIRCLE);
|
|
66498
66839
|
const rows = [["workspace", ctx.directory]];
|
|
66499
66840
|
rows.push([
|
|
66500
66841
|
"account",
|
|
66501
|
-
ctx.sessionExpired ? `${off} ${
|
|
66842
|
+
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
66843
|
]);
|
|
66503
66844
|
const missing = new Set(ctx.setupMissing ?? []);
|
|
66504
|
-
const warnRow = `${off} ${
|
|
66845
|
+
const warnRow = `${off} ${import_picocolors39.default.yellow("not configured")} ${import_picocolors39.default.dim(`${DOT3} run Setup`)}`;
|
|
66505
66846
|
if (missing.has("MCP"))
|
|
66506
66847
|
rows.push(["mcp", warnRow]);
|
|
66507
66848
|
else if (ctx.deploymentName)
|
|
@@ -66513,7 +66854,7 @@ function checklistRows(ctx) {
|
|
|
66513
66854
|
if (ctx.repoAgentsMd) {
|
|
66514
66855
|
rows.push([
|
|
66515
66856
|
"repo",
|
|
66516
|
-
ctx.repoAgentsMd === "current" ? `${on} AGENTS.md has the Dosu section` : `${off} ${
|
|
66857
|
+
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
66858
|
]);
|
|
66518
66859
|
}
|
|
66519
66860
|
if (missing.has("agents"))
|
|
@@ -66525,24 +66866,24 @@ function checklistRows(ctx) {
|
|
|
66525
66866
|
if (ctx.studying) {
|
|
66526
66867
|
rows.push([
|
|
66527
66868
|
"sync",
|
|
66528
|
-
`\uD83D\uDCDA ${brand("studying sessions...")} ${
|
|
66869
|
+
`\uD83D\uDCDA ${brand("studying sessions...")} ${import_picocolors39.default.dim(`${DOT3} see activity`)}`
|
|
66529
66870
|
]);
|
|
66530
66871
|
}
|
|
66531
66872
|
if (ctx.update) {
|
|
66532
66873
|
rows.push([
|
|
66533
66874
|
"update",
|
|
66534
|
-
`${
|
|
66875
|
+
`${import_picocolors39.default.yellow(`↑ ${ctx.update.version} available`)} ${import_picocolors39.default.dim(`${DOT3} ${ctx.update.hint}`)}`
|
|
66535
66876
|
]);
|
|
66536
66877
|
}
|
|
66537
66878
|
const labelWidth = Math.max(...rows.map(([label]) => label.length));
|
|
66538
|
-
return rows.map(([label, value]) => `${
|
|
66879
|
+
return rows.map(([label, value]) => `${import_picocolors39.default.dim(label.padEnd(labelWidth))} ${value}`);
|
|
66539
66880
|
}
|
|
66540
66881
|
function renderBanner(ctx) {
|
|
66541
66882
|
const logo = LOGO_ROWS.map(paintLogoRow);
|
|
66542
66883
|
const text = [
|
|
66543
66884
|
...checklistRows(ctx),
|
|
66544
66885
|
"",
|
|
66545
|
-
`${brandBadge("dosu-cli")} ${
|
|
66886
|
+
`${brandBadge("dosu-cli")} ${import_picocolors39.default.dim(`${ctx.version} ${DOT3} ${ctx.webAppHost}`)}`
|
|
66546
66887
|
];
|
|
66547
66888
|
const height = Math.max(logo.length, text.length);
|
|
66548
66889
|
const combined = [];
|
|
@@ -66555,10 +66896,10 @@ function renderBanner(ctx) {
|
|
|
66555
66896
|
return ["", ...combined, ""].join(`
|
|
66556
66897
|
`);
|
|
66557
66898
|
}
|
|
66558
|
-
var
|
|
66899
|
+
var import_picocolors39, CHECK2 = "✔", CIRCLE = "○", DOT3 = "·", LOGO_ROWS, LOGO_MARK, LOGO_WIDTH, LOGO_TONES, COLUMN_GAP = " ";
|
|
66559
66900
|
var init_banner = __esm(() => {
|
|
66560
66901
|
init_styles();
|
|
66561
|
-
|
|
66902
|
+
import_picocolors39 = __toESM(require_picocolors(), 1);
|
|
66562
66903
|
LOGO_ROWS = [
|
|
66563
66904
|
[["sage", "▄▄▄▄▄▄"]],
|
|
66564
66905
|
[["sage", "██ ▀▄"]],
|
|
@@ -66569,8 +66910,8 @@ var init_banner = __esm(() => {
|
|
|
66569
66910
|
LOGO_MARK = LOGO_ROWS.map((row) => row.map(([, art]) => art).join(""));
|
|
66570
66911
|
LOGO_WIDTH = Math.max(...LOGO_MARK.map((row) => row.length));
|
|
66571
66912
|
LOGO_TONES = {
|
|
66572
|
-
sage: { fg: "\x1B[38;2;180;187;145m", fallback:
|
|
66573
|
-
moss: { fg: "\x1B[38;2;119;133;97m", fallback: (art) =>
|
|
66913
|
+
sage: { fg: "\x1B[38;2;180;187;145m", fallback: import_picocolors39.default.green },
|
|
66914
|
+
moss: { fg: "\x1B[38;2;119;133;97m", fallback: (art) => import_picocolors39.default.dim(import_picocolors39.default.green(art)) }
|
|
66574
66915
|
};
|
|
66575
66916
|
});
|
|
66576
66917
|
|
|
@@ -66682,16 +67023,16 @@ function renderPagesFrame(model, width, selected) {
|
|
|
66682
67023
|
const body = [];
|
|
66683
67024
|
let scrollHint = "";
|
|
66684
67025
|
if (model.phase === "loading") {
|
|
66685
|
-
body.push(
|
|
67026
|
+
body.push(import_picocolors40.default.dim("Loading pages…"));
|
|
66686
67027
|
} else if (model.phase === "error") {
|
|
66687
|
-
body.push(
|
|
67028
|
+
body.push(import_picocolors40.default.yellow(clip3(model.message, width)));
|
|
66688
67029
|
} else if (model.pages.length === 0) {
|
|
66689
|
-
body.push(
|
|
67030
|
+
body.push(import_picocolors40.default.dim("No pages in this Library yet."));
|
|
66690
67031
|
} else {
|
|
66691
67032
|
const rows = pageRows2(model.pages, width - 2);
|
|
66692
67033
|
const { start, above } = windowSelection(rows.length, selected);
|
|
66693
67034
|
const visible = rows.slice(start, start + PAGES_VIEW_LINES);
|
|
66694
|
-
body.push(...visible.map((row, i) => start + i === selected ? `${brand("▸")} ${
|
|
67035
|
+
body.push(...visible.map((row, i) => start + i === selected ? `${brand("▸")} ${import_picocolors40.default.bold(row)}` : ` ${import_picocolors40.default.dim(row)}`));
|
|
66695
67036
|
const below = Math.max(0, Math.max(model.total, rows.length) - start - PAGES_VIEW_LINES);
|
|
66696
67037
|
const parts = [];
|
|
66697
67038
|
if (above > 0)
|
|
@@ -66700,14 +67041,14 @@ function renderPagesFrame(model, width, selected) {
|
|
|
66700
67041
|
parts.push(`↓ ${below} more`);
|
|
66701
67042
|
scrollHint = parts.join(" · ");
|
|
66702
67043
|
}
|
|
66703
|
-
const count = model.phase === "ready" ? ` ${
|
|
67044
|
+
const count = model.phase === "ready" ? ` ${import_picocolors40.default.dim(model.pages.length < model.total ? `(${model.pages.length} of ${model.total})` : `(${model.pages.length})`)}` : "";
|
|
66704
67045
|
const lines = [
|
|
66705
67046
|
`${breadcrumb(["home", "pages"], width)}${count}`,
|
|
66706
67047
|
"",
|
|
66707
67048
|
...body,
|
|
66708
|
-
...scrollHint ? [
|
|
67049
|
+
...scrollHint ? [import_picocolors40.default.dim(scrollHint)] : [],
|
|
66709
67050
|
"",
|
|
66710
|
-
|
|
67051
|
+
import_picocolors40.default.dim("↑↓ move · enter open · esc back")
|
|
66711
67052
|
];
|
|
66712
67053
|
return lines.join(`
|
|
66713
67054
|
`);
|
|
@@ -66716,9 +67057,9 @@ function renderPageFrame(page, content, width, scroll) {
|
|
|
66716
67057
|
const body = [];
|
|
66717
67058
|
let scrollHint = "";
|
|
66718
67059
|
if (content.phase === "loading") {
|
|
66719
|
-
body.push(
|
|
67060
|
+
body.push(import_picocolors40.default.dim("Loading page…"));
|
|
66720
67061
|
} else if (content.phase === "error") {
|
|
66721
|
-
body.push(
|
|
67062
|
+
body.push(import_picocolors40.default.yellow(clip3(content.message, width)));
|
|
66722
67063
|
} else {
|
|
66723
67064
|
const rows = wrapBody(content.body, width);
|
|
66724
67065
|
const { visible, above, below } = windowReport(rows, scroll, PAGE_BODY_LINES);
|
|
@@ -66733,12 +67074,12 @@ function renderPageFrame(page, content, width, scroll) {
|
|
|
66733
67074
|
const meta = `${page.type} · ${page.published ? "published" : "draft"} · updated ${page.updated_at.slice(0, 10)}`;
|
|
66734
67075
|
const lines = [
|
|
66735
67076
|
breadcrumb(["home", "pages", page.title], width),
|
|
66736
|
-
|
|
67077
|
+
import_picocolors40.default.dim(clip3(meta, width)),
|
|
66737
67078
|
"",
|
|
66738
67079
|
...body,
|
|
66739
|
-
...scrollHint ? [
|
|
67080
|
+
...scrollHint ? [import_picocolors40.default.dim(scrollHint)] : [],
|
|
66740
67081
|
"",
|
|
66741
|
-
|
|
67082
|
+
import_picocolors40.default.dim("↑↓ scroll · esc back to pages")
|
|
66742
67083
|
];
|
|
66743
67084
|
return lines.join(`
|
|
66744
67085
|
`);
|
|
@@ -66887,7 +67228,7 @@ ${CLEAR_BELOW3}`);
|
|
|
66887
67228
|
input.on("data", onData);
|
|
66888
67229
|
});
|
|
66889
67230
|
}
|
|
66890
|
-
var
|
|
67231
|
+
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
67232
|
var init_pages_view = __esm(() => {
|
|
66892
67233
|
init_trpc();
|
|
66893
67234
|
init_config();
|
|
@@ -66897,7 +67238,7 @@ var init_pages_view = __esm(() => {
|
|
|
66897
67238
|
init_analytics_view();
|
|
66898
67239
|
init_layout();
|
|
66899
67240
|
init_menu();
|
|
66900
|
-
|
|
67241
|
+
import_picocolors40 = __toESM(require_picocolors(), 1);
|
|
66901
67242
|
ESC9 = String.fromCharCode(27);
|
|
66902
67243
|
HIDE_CURSOR5 = `${ESC9}[?25l`;
|
|
66903
67244
|
SHOW_CURSOR5 = `${ESC9}[?25h`;
|
|
@@ -67010,7 +67351,7 @@ function isSetUp(cfg) {
|
|
|
67010
67351
|
}
|
|
67011
67352
|
function setupHint(cfg) {
|
|
67012
67353
|
const started = Boolean(cfg.active_account?.target);
|
|
67013
|
-
return
|
|
67354
|
+
return import_picocolors41.default.yellow(started ? `incomplete · missing ${missingSetupSteps(cfg).join(" + ")}` : "not set up yet");
|
|
67014
67355
|
}
|
|
67015
67356
|
function isStudying() {
|
|
67016
67357
|
try {
|
|
@@ -67255,7 +67596,7 @@ function handleLogout(cfg) {
|
|
|
67255
67596
|
saveConfig(cfg);
|
|
67256
67597
|
log2.success("Credentials cleared.");
|
|
67257
67598
|
}
|
|
67258
|
-
var
|
|
67599
|
+
var import_picocolors41, ESC10, CLEAR_SCREEN;
|
|
67259
67600
|
var init_tui = __esm(() => {
|
|
67260
67601
|
init_client();
|
|
67261
67602
|
init_config();
|
|
@@ -67279,7 +67620,7 @@ var init_tui = __esm(() => {
|
|
|
67279
67620
|
init_menu();
|
|
67280
67621
|
init_pages_view();
|
|
67281
67622
|
init_prompts();
|
|
67282
|
-
|
|
67623
|
+
import_picocolors41 = __toESM(require_picocolors(), 1);
|
|
67283
67624
|
ESC10 = String.fromCharCode(27);
|
|
67284
67625
|
CLEAR_SCREEN = `${ESC10}[2J${ESC10}[H`;
|
|
67285
67626
|
});
|
|
@@ -68466,4 +68807,4 @@ main().catch((err) => {
|
|
|
68466
68807
|
process.exit(1);
|
|
68467
68808
|
});
|
|
68468
68809
|
|
|
68469
|
-
//# debugId=
|
|
68810
|
+
//# debugId=a31208d6-6e9d-91e6-6475-6e2164756e21
|