@dosu/cli 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dosu.js +191 -192
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -4341,7 +4341,7 @@ function getSupabaseAnonKey() {
|
|
|
4341
4341
|
function getVersionString() {
|
|
4342
4342
|
return `v${VERSION}`;
|
|
4343
4343
|
}
|
|
4344
|
-
var VERSION = "0.14.
|
|
4344
|
+
var VERSION = "0.14.2";
|
|
4345
4345
|
|
|
4346
4346
|
// src/debug/logger.ts
|
|
4347
4347
|
import {
|
|
@@ -5165,17 +5165,17 @@ import y2 from "node:process";
|
|
|
5165
5165
|
function ce() {
|
|
5166
5166
|
return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
5167
5167
|
}
|
|
5168
|
-
var
|
|
5168
|
+
var import_picocolors7, import_sisteransi2, V2, u = (t, n) => V2 ? t : n, le, L2, W2, C2, ue, o, d2, k2, P2, A2, T, F, $e, _2, me, de, pe, q, D, U, K2, b2 = (t) => {
|
|
5169
5169
|
switch (t) {
|
|
5170
5170
|
case "initial":
|
|
5171
5171
|
case "active":
|
|
5172
|
-
return
|
|
5172
|
+
return import_picocolors7.default.cyan(le);
|
|
5173
5173
|
case "cancel":
|
|
5174
|
-
return
|
|
5174
|
+
return import_picocolors7.default.red(L2);
|
|
5175
5175
|
case "error":
|
|
5176
|
-
return
|
|
5176
|
+
return import_picocolors7.default.yellow(W2);
|
|
5177
5177
|
case "submit":
|
|
5178
|
-
return
|
|
5178
|
+
return import_picocolors7.default.green(C2);
|
|
5179
5179
|
}
|
|
5180
5180
|
}, G2 = (t) => {
|
|
5181
5181
|
const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
|
|
@@ -5184,23 +5184,23 @@ var import_picocolors8, import_sisteransi2, V2, u = (t, n) => V2 ? t : n, le, L2
|
|
|
5184
5184
|
const $2 = a < r.length && l2 > 0, g2 = a < r.length && l2 + a < r.length;
|
|
5185
5185
|
return r.slice(l2, l2 + a).map((p2, v, f) => {
|
|
5186
5186
|
const j2 = v === 0 && $2, E = v === f.length - 1 && g2;
|
|
5187
|
-
return j2 || E ?
|
|
5187
|
+
return j2 || E ? import_picocolors7.default.dim("...") : i(p2, v + l2 === n);
|
|
5188
5188
|
});
|
|
5189
5189
|
}, ye = (t) => {
|
|
5190
5190
|
const n = t.active ?? "Yes", r = t.inactive ?? "No";
|
|
5191
5191
|
return new dD({ active: n, inactive: r, initialValue: t.initialValue ?? true, render() {
|
|
5192
|
-
const i = `${
|
|
5192
|
+
const i = `${import_picocolors7.default.gray(o)}
|
|
5193
5193
|
${b2(this.state)} ${t.message}
|
|
5194
5194
|
`, s = this.value ? n : r;
|
|
5195
5195
|
switch (this.state) {
|
|
5196
5196
|
case "submit":
|
|
5197
|
-
return `${i}${
|
|
5197
|
+
return `${i}${import_picocolors7.default.gray(o)} ${import_picocolors7.default.dim(s)}`;
|
|
5198
5198
|
case "cancel":
|
|
5199
|
-
return `${i}${
|
|
5200
|
-
${
|
|
5199
|
+
return `${i}${import_picocolors7.default.gray(o)} ${import_picocolors7.default.strikethrough(import_picocolors7.default.dim(s))}
|
|
5200
|
+
${import_picocolors7.default.gray(o)}`;
|
|
5201
5201
|
default:
|
|
5202
|
-
return `${i}${
|
|
5203
|
-
${
|
|
5202
|
+
return `${i}${import_picocolors7.default.cyan(o)} ${this.value ? `${import_picocolors7.default.green(k2)} ${n}` : `${import_picocolors7.default.dim(P2)} ${import_picocolors7.default.dim(n)}`} ${import_picocolors7.default.dim("/")} ${this.value ? `${import_picocolors7.default.dim(P2)} ${import_picocolors7.default.dim(r)}` : `${import_picocolors7.default.green(k2)} ${r}`}
|
|
5203
|
+
${import_picocolors7.default.cyan(d2)}
|
|
5204
5204
|
`;
|
|
5205
5205
|
}
|
|
5206
5206
|
} }).prompt();
|
|
@@ -5209,43 +5209,43 @@ ${import_picocolors8.default.cyan(d2)}
|
|
|
5209
5209
|
const s = r.label ?? String(r.value);
|
|
5210
5210
|
switch (i) {
|
|
5211
5211
|
case "selected":
|
|
5212
|
-
return `${
|
|
5212
|
+
return `${import_picocolors7.default.dim(s)}`;
|
|
5213
5213
|
case "active":
|
|
5214
|
-
return `${
|
|
5214
|
+
return `${import_picocolors7.default.green(k2)} ${s} ${r.hint ? import_picocolors7.default.dim(`(${r.hint})`) : ""}`;
|
|
5215
5215
|
case "cancelled":
|
|
5216
|
-
return `${
|
|
5216
|
+
return `${import_picocolors7.default.strikethrough(import_picocolors7.default.dim(s))}`;
|
|
5217
5217
|
default:
|
|
5218
|
-
return `${
|
|
5218
|
+
return `${import_picocolors7.default.dim(P2)} ${import_picocolors7.default.dim(s)}`;
|
|
5219
5219
|
}
|
|
5220
5220
|
};
|
|
5221
5221
|
return new LD({ options: t.options, initialValue: t.initialValue, render() {
|
|
5222
|
-
const r = `${
|
|
5222
|
+
const r = `${import_picocolors7.default.gray(o)}
|
|
5223
5223
|
${b2(this.state)} ${t.message}
|
|
5224
5224
|
`;
|
|
5225
5225
|
switch (this.state) {
|
|
5226
5226
|
case "submit":
|
|
5227
|
-
return `${r}${
|
|
5227
|
+
return `${r}${import_picocolors7.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
|
|
5228
5228
|
case "cancel":
|
|
5229
|
-
return `${r}${
|
|
5230
|
-
${
|
|
5229
|
+
return `${r}${import_picocolors7.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
|
|
5230
|
+
${import_picocolors7.default.gray(o)}`;
|
|
5231
5231
|
default:
|
|
5232
|
-
return `${r}${
|
|
5233
|
-
${
|
|
5234
|
-
${
|
|
5232
|
+
return `${r}${import_picocolors7.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
|
|
5233
|
+
${import_picocolors7.default.cyan(o)} `)}
|
|
5234
|
+
${import_picocolors7.default.cyan(d2)}
|
|
5235
5235
|
`;
|
|
5236
5236
|
}
|
|
5237
5237
|
} }).prompt();
|
|
5238
5238
|
}, fe = (t) => {
|
|
5239
5239
|
const n = (r, i) => {
|
|
5240
5240
|
const s = r.label ?? String(r.value);
|
|
5241
|
-
return i === "active" ? `${
|
|
5241
|
+
return i === "active" ? `${import_picocolors7.default.cyan(A2)} ${s} ${r.hint ? import_picocolors7.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors7.default.green(T)} ${import_picocolors7.default.dim(s)} ${r.hint ? import_picocolors7.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors7.default.strikethrough(import_picocolors7.default.dim(s))}` : i === "active-selected" ? `${import_picocolors7.default.green(T)} ${s} ${r.hint ? import_picocolors7.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors7.default.dim(s)}` : `${import_picocolors7.default.dim(F)} ${import_picocolors7.default.dim(s)}`;
|
|
5242
5242
|
};
|
|
5243
5243
|
return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r) {
|
|
5244
5244
|
if (this.required && r.length === 0)
|
|
5245
5245
|
return `Please select at least one option.
|
|
5246
|
-
${
|
|
5246
|
+
${import_picocolors7.default.reset(import_picocolors7.default.dim(`Press ${import_picocolors7.default.gray(import_picocolors7.default.bgWhite(import_picocolors7.default.inverse(" space ")))} to select, ${import_picocolors7.default.gray(import_picocolors7.default.bgWhite(import_picocolors7.default.inverse(" enter ")))} to submit`))}`;
|
|
5247
5247
|
}, render() {
|
|
5248
|
-
const r = `${
|
|
5248
|
+
const r = `${import_picocolors7.default.gray(o)}
|
|
5249
5249
|
${b2(this.state)} ${t.message}
|
|
5250
5250
|
`, i = (s, c) => {
|
|
5251
5251
|
const a = this.value.includes(s.value);
|
|
@@ -5253,34 +5253,34 @@ ${b2(this.state)} ${t.message}
|
|
|
5253
5253
|
};
|
|
5254
5254
|
switch (this.state) {
|
|
5255
5255
|
case "submit":
|
|
5256
|
-
return `${r}${
|
|
5256
|
+
return `${r}${import_picocolors7.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors7.default.dim(", ")) || import_picocolors7.default.dim("none")}`;
|
|
5257
5257
|
case "cancel": {
|
|
5258
|
-
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(
|
|
5259
|
-
return `${r}${
|
|
5260
|
-
${
|
|
5258
|
+
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors7.default.dim(", "));
|
|
5259
|
+
return `${r}${import_picocolors7.default.gray(o)} ${s.trim() ? `${s}
|
|
5260
|
+
${import_picocolors7.default.gray(o)}` : ""}`;
|
|
5261
5261
|
}
|
|
5262
5262
|
case "error": {
|
|
5263
5263
|
const s = this.error.split(`
|
|
5264
|
-
`).map((c, a) => a === 0 ? `${
|
|
5264
|
+
`).map((c, a) => a === 0 ? `${import_picocolors7.default.yellow(d2)} ${import_picocolors7.default.yellow(c)}` : ` ${c}`).join(`
|
|
5265
5265
|
`);
|
|
5266
|
-
return `${r +
|
|
5267
|
-
${
|
|
5266
|
+
return `${r + import_picocolors7.default.yellow(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
5267
|
+
${import_picocolors7.default.yellow(o)} `)}
|
|
5268
5268
|
${s}
|
|
5269
5269
|
`;
|
|
5270
5270
|
}
|
|
5271
5271
|
default:
|
|
5272
|
-
return `${r}${
|
|
5273
|
-
${
|
|
5274
|
-
${
|
|
5272
|
+
return `${r}${import_picocolors7.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
5273
|
+
${import_picocolors7.default.cyan(o)} `)}
|
|
5274
|
+
${import_picocolors7.default.cyan(d2)}
|
|
5275
5275
|
`;
|
|
5276
5276
|
}
|
|
5277
5277
|
} }).prompt();
|
|
5278
5278
|
}, Ie = (t = "") => {
|
|
5279
|
-
process.stdout.write(`${
|
|
5279
|
+
process.stdout.write(`${import_picocolors7.default.gray(ue)} ${t}
|
|
5280
5280
|
`);
|
|
5281
5281
|
}, Se = (t = "") => {
|
|
5282
|
-
process.stdout.write(`${
|
|
5283
|
-
${
|
|
5282
|
+
process.stdout.write(`${import_picocolors7.default.gray(o)}
|
|
5283
|
+
${import_picocolors7.default.gray(d2)} ${t}
|
|
5284
5284
|
|
|
5285
5285
|
`);
|
|
5286
5286
|
}, M2, J2, Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
@@ -5305,14 +5305,14 @@ ${import_picocolors8.default.gray(d2)} ${t}
|
|
|
5305
5305
|
const h2 = (performance.now() - m2) / 1000, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
|
|
5306
5306
|
return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
|
|
5307
5307
|
}, H2 = (m2 = "") => {
|
|
5308
|
-
a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${
|
|
5308
|
+
a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors7.default.gray(o)}
|
|
5309
5309
|
`);
|
|
5310
5310
|
let h2 = 0, w2 = 0;
|
|
5311
5311
|
j2(), c = setInterval(() => {
|
|
5312
5312
|
if (i && l2 === $2)
|
|
5313
5313
|
return;
|
|
5314
5314
|
B2(), $2 = l2;
|
|
5315
|
-
const I2 =
|
|
5315
|
+
const I2 = import_picocolors7.default.magenta(n[h2]);
|
|
5316
5316
|
if (i)
|
|
5317
5317
|
process.stdout.write(`${I2} ${l2}...`);
|
|
5318
5318
|
else if (t === "timer")
|
|
@@ -5325,7 +5325,7 @@ ${import_picocolors8.default.gray(d2)} ${t}
|
|
|
5325
5325
|
}, r);
|
|
5326
5326
|
}, N2 = (m2 = "", h2 = 0) => {
|
|
5327
5327
|
a = false, clearInterval(c), B2();
|
|
5328
|
-
const w2 = h2 === 0 ?
|
|
5328
|
+
const w2 = h2 === 0 ? import_picocolors7.default.green(C2) : h2 === 1 ? import_picocolors7.default.red(L2) : import_picocolors7.default.red(W2);
|
|
5329
5329
|
l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
|
|
5330
5330
|
`) : process.stdout.write(`${w2} ${l2}
|
|
5331
5331
|
`), E(), s();
|
|
@@ -5337,7 +5337,7 @@ ${import_picocolors8.default.gray(d2)} ${t}
|
|
|
5337
5337
|
var init_dist6 = __esm(() => {
|
|
5338
5338
|
init_dist5();
|
|
5339
5339
|
init_dist5();
|
|
5340
|
-
|
|
5340
|
+
import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
5341
5341
|
import_sisteransi2 = __toESM(require_src(), 1);
|
|
5342
5342
|
V2 = ce();
|
|
5343
5343
|
le = u("◆", "*");
|
|
@@ -5361,30 +5361,30 @@ var init_dist6 = __esm(() => {
|
|
|
5361
5361
|
D = u("◆", "*");
|
|
5362
5362
|
U = u("▲", "!");
|
|
5363
5363
|
K2 = u("■", "x");
|
|
5364
|
-
M2 = { message: (t = "", { symbol: n =
|
|
5365
|
-
const r = [`${
|
|
5364
|
+
M2 = { message: (t = "", { symbol: n = import_picocolors7.default.gray(o) } = {}) => {
|
|
5365
|
+
const r = [`${import_picocolors7.default.gray(o)}`];
|
|
5366
5366
|
if (t) {
|
|
5367
5367
|
const [i, ...s] = t.split(`
|
|
5368
5368
|
`);
|
|
5369
|
-
r.push(`${n} ${i}`, ...s.map((c) => `${
|
|
5369
|
+
r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors7.default.gray(o)} ${c}`));
|
|
5370
5370
|
}
|
|
5371
5371
|
process.stdout.write(`${r.join(`
|
|
5372
5372
|
`)}
|
|
5373
5373
|
`);
|
|
5374
5374
|
}, info: (t) => {
|
|
5375
|
-
M2.message(t, { symbol:
|
|
5375
|
+
M2.message(t, { symbol: import_picocolors7.default.blue(q) });
|
|
5376
5376
|
}, success: (t) => {
|
|
5377
|
-
M2.message(t, { symbol:
|
|
5377
|
+
M2.message(t, { symbol: import_picocolors7.default.green(D) });
|
|
5378
5378
|
}, step: (t) => {
|
|
5379
|
-
M2.message(t, { symbol:
|
|
5379
|
+
M2.message(t, { symbol: import_picocolors7.default.green(C2) });
|
|
5380
5380
|
}, warn: (t) => {
|
|
5381
|
-
M2.message(t, { symbol:
|
|
5381
|
+
M2.message(t, { symbol: import_picocolors7.default.yellow(U) });
|
|
5382
5382
|
}, warning: (t) => {
|
|
5383
5383
|
M2.warn(t);
|
|
5384
5384
|
}, error: (t) => {
|
|
5385
|
-
M2.message(t, { symbol:
|
|
5385
|
+
M2.message(t, { symbol: import_picocolors7.default.red(K2) });
|
|
5386
5386
|
} };
|
|
5387
|
-
J2 = `${
|
|
5387
|
+
J2 = `${import_picocolors7.default.gray(o)} `;
|
|
5388
5388
|
});
|
|
5389
5389
|
|
|
5390
5390
|
// src/insights/insights.ts
|
|
@@ -9865,7 +9865,7 @@ var exports_flow = {};
|
|
|
9865
9865
|
__export(exports_flow, {
|
|
9866
9866
|
startOAuthFlow: () => startOAuthFlow
|
|
9867
9867
|
});
|
|
9868
|
-
async function startOAuthFlow(signal, path2 = "/cli/auth", params = {}
|
|
9868
|
+
async function startOAuthFlow(signal, path2 = "/cli/auth", params = {}) {
|
|
9869
9869
|
const { server, tokenPromise } = await startCallbackServer();
|
|
9870
9870
|
let timeoutId;
|
|
9871
9871
|
try {
|
|
@@ -9873,12 +9873,9 @@ async function startOAuthFlow(signal, path2 = "/cli/auth", params = {}, opts = {
|
|
|
9873
9873
|
logger.debug("auth.flow", `Callback URL: ${callbackURL}`);
|
|
9874
9874
|
const authURL = buildAuthURL(callbackURL, path2, params);
|
|
9875
9875
|
logger.info("auth.flow", `Auth URL: ${authURL}`);
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
await open2.default(authURL);
|
|
9880
|
-
logger.info("auth.flow", "Browser open command executed");
|
|
9881
|
-
}
|
|
9876
|
+
const open2 = await Promise.resolve().then(() => (init_open(), exports_open));
|
|
9877
|
+
await open2.default(authURL);
|
|
9878
|
+
logger.info("auth.flow", "Browser open command executed");
|
|
9882
9879
|
const timeout = new Promise((_3, reject) => {
|
|
9883
9880
|
timeoutId = setTimeout(() => {
|
|
9884
9881
|
logger.warn("auth.flow", "Authentication timed out (8min)");
|
|
@@ -9938,7 +9935,7 @@ async function runSetup(opts = {}) {
|
|
|
9938
9935
|
cfg.mode = undefined;
|
|
9939
9936
|
saveConfig(cfg);
|
|
9940
9937
|
}
|
|
9941
|
-
const authedCfg = await stepAuthenticate(cfg, onboardingRunID
|
|
9938
|
+
const authedCfg = await stepAuthenticate(cfg, onboardingRunID);
|
|
9942
9939
|
if (!authedCfg)
|
|
9943
9940
|
return;
|
|
9944
9941
|
cfg = authedCfg;
|
|
@@ -9988,8 +9985,7 @@ async function runSetup(opts = {}) {
|
|
|
9988
9985
|
cfg.api_key = apiKey;
|
|
9989
9986
|
saveConfig(cfg);
|
|
9990
9987
|
const choices = await stepOneShotConfirm({
|
|
9991
|
-
includeGitHub: cloudSetupContext?.kind === "onboarding"
|
|
9992
|
-
setupOptions: opts
|
|
9988
|
+
includeGitHub: cloudSetupContext?.kind === "onboarding"
|
|
9993
9989
|
});
|
|
9994
9990
|
if (!choices) {
|
|
9995
9991
|
await trackCliOnboardingEvent(cfg, onboardingRunID, "cli_onboarding_cancelled", {
|
|
@@ -10007,7 +10003,7 @@ async function runSetup(opts = {}) {
|
|
|
10007
10003
|
let skillCompleted = false;
|
|
10008
10004
|
let docsImported = false;
|
|
10009
10005
|
if (choices.configureMcp) {
|
|
10010
|
-
const configured = await stepConfigureMcpTools(cfg
|
|
10006
|
+
const configured = await stepConfigureMcpTools(cfg);
|
|
10011
10007
|
if (configured === null) {
|
|
10012
10008
|
await trackCliOnboardingEvent(cfg, onboardingRunID, "cli_onboarding_cancelled", {
|
|
10013
10009
|
reason: "mcp_selection_cancelled"
|
|
@@ -10130,13 +10126,6 @@ function applyModeOverride(cfg, opts) {
|
|
|
10130
10126
|
saveConfig(cfg);
|
|
10131
10127
|
}
|
|
10132
10128
|
async function stepOneShotConfirm(opts) {
|
|
10133
|
-
if (opts.setupOptions?.yes) {
|
|
10134
|
-
return {
|
|
10135
|
-
configureMcp: !opts.setupOptions.skipMcp,
|
|
10136
|
-
installSkill: !opts.setupOptions.skipSkill,
|
|
10137
|
-
connectGitHub: opts.includeGitHub && !opts.setupOptions.skipGitHub
|
|
10138
|
-
};
|
|
10139
|
-
}
|
|
10140
10129
|
const items = [
|
|
10141
10130
|
{ value: "configureMcp", label: "Install Dosu MCP" },
|
|
10142
10131
|
{ value: "installSkill", label: "Install Dosu skill" }
|
|
@@ -10164,15 +10153,7 @@ async function stepOneShotConfirm(opts) {
|
|
|
10164
10153
|
connectGitHub: chosen.has("connectGitHub")
|
|
10165
10154
|
};
|
|
10166
10155
|
}
|
|
10167
|
-
async function stepConfigureMcpTools(cfg
|
|
10168
|
-
if (requestedToolIDs && requestedToolIDs.length > 0) {
|
|
10169
|
-
const selection2 = selectRequestedTools(requestedToolIDs);
|
|
10170
|
-
if (!selection2)
|
|
10171
|
-
return null;
|
|
10172
|
-
const results2 = stepConfigureTools(cfg, selection2);
|
|
10173
|
-
stepShowSummary(results2);
|
|
10174
|
-
return results2;
|
|
10175
|
-
}
|
|
10156
|
+
async function stepConfigureMcpTools(cfg) {
|
|
10176
10157
|
const detected = stepDetectTools();
|
|
10177
10158
|
if (detected.length === 0) {
|
|
10178
10159
|
M2.warn(`No supported AI agents detected on your system.
|
|
@@ -10204,7 +10185,7 @@ async function runInstallSkill() {
|
|
|
10204
10185
|
return false;
|
|
10205
10186
|
}
|
|
10206
10187
|
}
|
|
10207
|
-
async function stepAuthenticate(existingCfg, onboardingRunID
|
|
10188
|
+
async function stepAuthenticate(existingCfg, onboardingRunID) {
|
|
10208
10189
|
logger.info("setup", "Step: authenticate");
|
|
10209
10190
|
const cfg = existingCfg ?? loadConfig();
|
|
10210
10191
|
if (cfg.access_token) {
|
|
@@ -10234,36 +10215,26 @@ async function stepAuthenticate(existingCfg, onboardingRunID, opts = {}) {
|
|
|
10234
10215
|
s.stop("Session verification failed");
|
|
10235
10216
|
}
|
|
10236
10217
|
}
|
|
10237
|
-
|
|
10238
|
-
|
|
10239
|
-
if (
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
});
|
|
10244
|
-
}
|
|
10245
|
-
return null;
|
|
10218
|
+
const shouldLogin = await ye({ message: "Open browser to log in?" });
|
|
10219
|
+
if (pD(shouldLogin) || !shouldLogin) {
|
|
10220
|
+
if (onboardingRunID) {
|
|
10221
|
+
await trackCliOnboardingPreAuthEvent(onboardingRunID, "cli_onboarding_auth_cancelled", {
|
|
10222
|
+
reason: pD(shouldLogin) ? "prompt_cancelled" : "login_declined"
|
|
10223
|
+
});
|
|
10246
10224
|
}
|
|
10225
|
+
return null;
|
|
10247
10226
|
}
|
|
10248
10227
|
if (onboardingRunID) {
|
|
10249
10228
|
await trackCliOnboardingPreAuthEvent(onboardingRunID, "cli_onboarding_auth_started");
|
|
10250
10229
|
}
|
|
10251
|
-
return await openBrowserForSetup(cfg, onboardingRunID
|
|
10230
|
+
return await openBrowserForSetup(cfg, onboardingRunID);
|
|
10252
10231
|
}
|
|
10253
|
-
async function openBrowserForSetup(cfg, onboardingRunID
|
|
10232
|
+
async function openBrowserForSetup(cfg, onboardingRunID) {
|
|
10254
10233
|
try {
|
|
10255
10234
|
const { startOAuthFlow: startOAuthFlow2 } = await Promise.resolve().then(() => (init_flow(), exports_flow));
|
|
10256
10235
|
const s = Y2();
|
|
10257
10236
|
s.start("Waiting for authentication...");
|
|
10258
|
-
const token = await startOAuthFlow2(undefined, "/cli/auth", onboardingRunID ? { onboarding_run_id: onboardingRunID } : {}
|
|
10259
|
-
openBrowser: opts.openBrowser !== false,
|
|
10260
|
-
onAuthURL: opts.openBrowser === false ? (url) => {
|
|
10261
|
-
M2.info(`Open this URL to authenticate:
|
|
10262
|
-
${url}
|
|
10263
|
-
|
|
10264
|
-
Waiting for login to complete...`);
|
|
10265
|
-
} : undefined
|
|
10266
|
-
});
|
|
10237
|
+
const token = await startOAuthFlow2(undefined, "/cli/auth", onboardingRunID ? { onboarding_run_id: onboardingRunID } : {});
|
|
10267
10238
|
s.stop("Authenticated");
|
|
10268
10239
|
logger.info("setup", "Browser auth completed");
|
|
10269
10240
|
cfg.access_token = token.access_token;
|
|
@@ -10372,10 +10343,10 @@ async function resolveDeployment(apiClient, cfg, opts) {
|
|
|
10372
10343
|
}
|
|
10373
10344
|
return true;
|
|
10374
10345
|
}
|
|
10375
|
-
const org = await stepSelectOrg(apiClient
|
|
10346
|
+
const org = await stepSelectOrg(apiClient);
|
|
10376
10347
|
if (!org)
|
|
10377
10348
|
return false;
|
|
10378
|
-
const d3 = await stepSelectDeployment(apiClient, org
|
|
10349
|
+
const d3 = await stepSelectDeployment(apiClient, org);
|
|
10379
10350
|
if (!d3)
|
|
10380
10351
|
return false;
|
|
10381
10352
|
cfg.mode = undefined;
|
|
@@ -10389,7 +10360,7 @@ async function fetchDeployments(apiClient) {
|
|
|
10389
10360
|
return [];
|
|
10390
10361
|
}
|
|
10391
10362
|
}
|
|
10392
|
-
async function stepSelectOrg(apiClient
|
|
10363
|
+
async function stepSelectOrg(apiClient) {
|
|
10393
10364
|
try {
|
|
10394
10365
|
const orgs = await apiClient.getOrgs();
|
|
10395
10366
|
if (orgs.length === 0) {
|
|
@@ -10402,10 +10373,6 @@ async function stepSelectOrg(apiClient, noPrompt = false) {
|
|
|
10402
10373
|
${dim(orgs[0].name)}`);
|
|
10403
10374
|
return orgs[0];
|
|
10404
10375
|
}
|
|
10405
|
-
if (noPrompt) {
|
|
10406
|
-
M2.error("Multiple organizations found. Run `dosu deployments list --json`, choose a deployment, then re-run setup with `--deployment <id>`.");
|
|
10407
|
-
return null;
|
|
10408
|
-
}
|
|
10409
10376
|
const selected = await ve({
|
|
10410
10377
|
message: "Select an organization",
|
|
10411
10378
|
options: orgs.map((o2) => ({ label: o2.name, value: o2.org_id }))
|
|
@@ -10443,7 +10410,7 @@ ${dim(d3.name)}`);
|
|
|
10443
10410
|
return null;
|
|
10444
10411
|
}
|
|
10445
10412
|
}
|
|
10446
|
-
async function stepSelectDeployment(apiClient, org
|
|
10413
|
+
async function stepSelectDeployment(apiClient, org) {
|
|
10447
10414
|
try {
|
|
10448
10415
|
const allDeployments = await apiClient.getDeployments();
|
|
10449
10416
|
const deployments = allDeployments.filter((d4) => d4.org_id === org.org_id);
|
|
@@ -10457,10 +10424,6 @@ async function stepSelectDeployment(apiClient, org, noPrompt = false) {
|
|
|
10457
10424
|
${dim(deployments[0].name)}`);
|
|
10458
10425
|
return deployments[0];
|
|
10459
10426
|
}
|
|
10460
|
-
if (noPrompt) {
|
|
10461
|
-
M2.error("Multiple MCPs found. Run `dosu deployments list --json`, choose one, then re-run setup with `--deployment <id>`.");
|
|
10462
|
-
return null;
|
|
10463
|
-
}
|
|
10464
10427
|
const selected = await ve({
|
|
10465
10428
|
message: "Select an MCP",
|
|
10466
10429
|
options: deployments.map((d4) => ({ label: d4.name, value: d4.deployment_id }))
|
|
@@ -10508,24 +10471,6 @@ function isStdioOnly(p2) {
|
|
|
10508
10471
|
function stepDetectTools() {
|
|
10509
10472
|
return allSetupProviders().filter((p2) => p2.isInstalled() && !isStdioOnly(p2));
|
|
10510
10473
|
}
|
|
10511
|
-
function selectRequestedTools(requestedToolIDs) {
|
|
10512
|
-
const normalized = [...new Set(requestedToolIDs.map((id) => id.toLowerCase()))];
|
|
10513
|
-
const providers = allSetupProviders();
|
|
10514
|
-
const selected = [];
|
|
10515
|
-
for (const id of normalized) {
|
|
10516
|
-
const provider = providers.find((p2) => p2.id() === id);
|
|
10517
|
-
if (!provider) {
|
|
10518
|
-
M2.error(`Unknown AI tool '${id}'. Run 'dosu mcp list' to see available tools.`);
|
|
10519
|
-
return null;
|
|
10520
|
-
}
|
|
10521
|
-
if (isStdioOnly(provider)) {
|
|
10522
|
-
M2.error(`${provider.name()} is not supported by setup. Use 'dosu mcp add ${id}'.`);
|
|
10523
|
-
return null;
|
|
10524
|
-
}
|
|
10525
|
-
selected.push(provider);
|
|
10526
|
-
}
|
|
10527
|
-
return { toInstall: selected, toRemove: [], skipped: [] };
|
|
10528
|
-
}
|
|
10529
10474
|
async function stepSelectTools(detected) {
|
|
10530
10475
|
const configuredMap = new Map;
|
|
10531
10476
|
for (const p2 of detected) {
|
|
@@ -11321,15 +11266,17 @@ ${import_picocolors6.default.dim(`Current: ${cfg.deployment_name ?? cfg.deployme
|
|
|
11321
11266
|
}
|
|
11322
11267
|
|
|
11323
11268
|
// src/commands/docs.ts
|
|
11269
|
+
init_dist6();
|
|
11270
|
+
init_dist();
|
|
11324
11271
|
init_esm();
|
|
11325
11272
|
init_trpc();
|
|
11326
11273
|
init_logger();
|
|
11327
|
-
var
|
|
11274
|
+
var import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
11328
11275
|
import { readFileSync as readFileSync3 } from "node:fs";
|
|
11329
11276
|
function requireConfig4() {
|
|
11330
11277
|
const cfg = requireLoginConfig();
|
|
11331
11278
|
if (!cfg.space_id) {
|
|
11332
|
-
console.error(
|
|
11279
|
+
console.error(import_picocolors8.default.red("Missing space config. Run 'dosu setup' to reconfigure."));
|
|
11333
11280
|
process.exit(1);
|
|
11334
11281
|
}
|
|
11335
11282
|
return cfg;
|
|
@@ -11339,7 +11286,7 @@ async function getKnowledgeStoreId(client, spaceId) {
|
|
|
11339
11286
|
space_id: spaceId
|
|
11340
11287
|
});
|
|
11341
11288
|
if (!store) {
|
|
11342
|
-
console.error(
|
|
11289
|
+
console.error(import_picocolors8.default.red("No knowledge store found for this deployment."));
|
|
11343
11290
|
process.exit(1);
|
|
11344
11291
|
}
|
|
11345
11292
|
return store.id;
|
|
@@ -11349,10 +11296,65 @@ function readBody(opts) {
|
|
|
11349
11296
|
return readFileSync3(opts.bodyFile, "utf-8");
|
|
11350
11297
|
return opts.body;
|
|
11351
11298
|
}
|
|
11299
|
+
var IMPORT_ALREADY_IN_PROGRESS_CODE = "IMPORT_ALREADY_IN_PROGRESS";
|
|
11300
|
+
var IMPORT_ALREADY_IN_PROGRESS_LEGACY_DETAIL_PHRASE = "import operation is already in progress";
|
|
11301
|
+
function parseSerializedImportError(message) {
|
|
11302
|
+
let text = message;
|
|
11303
|
+
let appCode;
|
|
11304
|
+
try {
|
|
11305
|
+
const parsed = JSON.parse(message);
|
|
11306
|
+
let codeCandidate;
|
|
11307
|
+
if (typeof parsed?.detail === "string") {
|
|
11308
|
+
text = parsed.detail;
|
|
11309
|
+
codeCandidate = parsed.code ?? parsed.dosuCode;
|
|
11310
|
+
} else if (parsed?.detail !== null && typeof parsed.detail === "object") {
|
|
11311
|
+
const inner = parsed.detail;
|
|
11312
|
+
if (typeof inner.detail === "string") {
|
|
11313
|
+
text = inner.detail;
|
|
11314
|
+
} else if (typeof inner.message === "string") {
|
|
11315
|
+
text = inner.message;
|
|
11316
|
+
}
|
|
11317
|
+
codeCandidate = inner.code ?? inner.dosuCode ?? parsed.code ?? parsed.dosuCode;
|
|
11318
|
+
} else {
|
|
11319
|
+
codeCandidate = parsed.code ?? parsed.dosuCode;
|
|
11320
|
+
}
|
|
11321
|
+
if (typeof codeCandidate === "string" && codeCandidate === IMPORT_ALREADY_IN_PROGRESS_CODE) {
|
|
11322
|
+
appCode = IMPORT_ALREADY_IN_PROGRESS_CODE;
|
|
11323
|
+
}
|
|
11324
|
+
} catch {}
|
|
11325
|
+
return {
|
|
11326
|
+
detail: text || "Import failed. Please try again.",
|
|
11327
|
+
appCode
|
|
11328
|
+
};
|
|
11329
|
+
}
|
|
11330
|
+
function trpcImportConflictAppCode(err) {
|
|
11331
|
+
if (!isTRPCClientError(err))
|
|
11332
|
+
return;
|
|
11333
|
+
const { data } = err;
|
|
11334
|
+
if (data === null || typeof data !== "object")
|
|
11335
|
+
return;
|
|
11336
|
+
const d3 = data;
|
|
11337
|
+
let candidate = d3.code;
|
|
11338
|
+
if (typeof candidate !== "string")
|
|
11339
|
+
candidate = d3.dosuCode;
|
|
11340
|
+
if (typeof candidate !== "string")
|
|
11341
|
+
return;
|
|
11342
|
+
return candidate === IMPORT_ALREADY_IN_PROGRESS_CODE ? IMPORT_ALREADY_IN_PROGRESS_CODE : undefined;
|
|
11343
|
+
}
|
|
11344
|
+
function isConcurrentImportError(err, msg) {
|
|
11345
|
+
if (trpcImportConflictAppCode(err) === IMPORT_ALREADY_IN_PROGRESS_CODE) {
|
|
11346
|
+
return true;
|
|
11347
|
+
}
|
|
11348
|
+
const { detail, appCode } = parseSerializedImportError(msg);
|
|
11349
|
+
if (appCode === IMPORT_ALREADY_IN_PROGRESS_CODE) {
|
|
11350
|
+
return true;
|
|
11351
|
+
}
|
|
11352
|
+
return detail.includes(IMPORT_ALREADY_IN_PROGRESS_LEGACY_DETAIL_PHRASE);
|
|
11353
|
+
}
|
|
11352
11354
|
async function backendPost(path, apiKey, body) {
|
|
11353
11355
|
const backendURL = getBackendURL();
|
|
11354
11356
|
if (!backendURL) {
|
|
11355
|
-
console.error(
|
|
11357
|
+
console.error(import_picocolors8.default.red("Backend URL not configured."));
|
|
11356
11358
|
process.exit(1);
|
|
11357
11359
|
}
|
|
11358
11360
|
const resp = await fetch(`${backendURL}${path}`, {
|
|
@@ -11388,14 +11390,14 @@ function docsCommand() {
|
|
|
11388
11390
|
return;
|
|
11389
11391
|
}
|
|
11390
11392
|
if (!pages || pages.length === 0) {
|
|
11391
|
-
console.log(
|
|
11393
|
+
console.log(import_picocolors8.default.dim("No documents found."));
|
|
11392
11394
|
return;
|
|
11393
11395
|
}
|
|
11394
|
-
printTable(["ID", "Title", "Status", "Created"], pages.map((
|
|
11395
|
-
|
|
11396
|
-
truncate(
|
|
11397
|
-
|
|
11398
|
-
formatDate(
|
|
11396
|
+
printTable(["ID", "Title", "Status", "Created"], pages.map((p2) => [
|
|
11397
|
+
p2.id.slice(0, 8),
|
|
11398
|
+
truncate(p2.title ?? "(untitled)", 50),
|
|
11399
|
+
p2.published ? "published" : "draft",
|
|
11400
|
+
formatDate(p2.created_at)
|
|
11399
11401
|
]), { rawData: pages });
|
|
11400
11402
|
});
|
|
11401
11403
|
cmd.command("get").description("Get a document").argument("<id>", "Page ID").option("--version <v>", "Specific version number").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
@@ -11410,10 +11412,10 @@ function docsCommand() {
|
|
|
11410
11412
|
return;
|
|
11411
11413
|
}
|
|
11412
11414
|
if (!page) {
|
|
11413
|
-
console.log(
|
|
11415
|
+
console.log(import_picocolors8.default.dim("Document not found."));
|
|
11414
11416
|
return;
|
|
11415
11417
|
}
|
|
11416
|
-
console.log(
|
|
11418
|
+
console.log(import_picocolors8.default.bold(page.title ?? "(untitled)"));
|
|
11417
11419
|
printInfo([
|
|
11418
11420
|
["ID", page.id],
|
|
11419
11421
|
["Status", page.published ? "published" : "draft"],
|
|
@@ -11438,7 +11440,7 @@ ${page.body}`);
|
|
|
11438
11440
|
printResult(result, opts);
|
|
11439
11441
|
return;
|
|
11440
11442
|
}
|
|
11441
|
-
console.log(
|
|
11443
|
+
console.log(import_picocolors8.default.green(`Document "${opts.title}" created.`));
|
|
11442
11444
|
});
|
|
11443
11445
|
cmd.command("update").description("Update a document").argument("<id>", "Page ID").option("--title <title>", "New title").option("--body <markdown>", "New body (markdown)").option("--body-file <path>", "Read body from file").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
11444
11446
|
const cfg = requireConfig4();
|
|
@@ -11455,7 +11457,7 @@ ${page.body}`);
|
|
|
11455
11457
|
printResult(result, opts);
|
|
11456
11458
|
return;
|
|
11457
11459
|
}
|
|
11458
|
-
console.log(
|
|
11460
|
+
console.log(import_picocolors8.default.green("Document updated."));
|
|
11459
11461
|
});
|
|
11460
11462
|
for (const archived of [true, false]) {
|
|
11461
11463
|
const name = archived ? "archive" : "unarchive";
|
|
@@ -11467,7 +11469,7 @@ ${page.body}`);
|
|
|
11467
11469
|
printResult({ success: true, id, archived }, opts);
|
|
11468
11470
|
return;
|
|
11469
11471
|
}
|
|
11470
|
-
console.log(
|
|
11472
|
+
console.log(import_picocolors8.default.green(`Document ${name}d.`));
|
|
11471
11473
|
});
|
|
11472
11474
|
}
|
|
11473
11475
|
cmd.command("delete").description("Delete a document").argument("<id>", "Page ID").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
@@ -11478,7 +11480,7 @@ ${page.body}`);
|
|
|
11478
11480
|
printResult({ success: true, id }, opts);
|
|
11479
11481
|
return;
|
|
11480
11482
|
}
|
|
11481
|
-
console.log(
|
|
11483
|
+
console.log(import_picocolors8.default.green("Document deleted."));
|
|
11482
11484
|
});
|
|
11483
11485
|
cmd.command("versions").description("List document versions").argument("<id>", "Page ID").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
11484
11486
|
const cfg = requireConfig4();
|
|
@@ -11489,7 +11491,7 @@ ${page.body}`);
|
|
|
11489
11491
|
return;
|
|
11490
11492
|
}
|
|
11491
11493
|
if (!versions || versions.length === 0) {
|
|
11492
|
-
console.log(
|
|
11494
|
+
console.log(import_picocolors8.default.dim("No versions found."));
|
|
11493
11495
|
return;
|
|
11494
11496
|
}
|
|
11495
11497
|
printTable(["Version", "Created"], versions.map((v) => [
|
|
@@ -11508,7 +11510,7 @@ ${page.body}`);
|
|
|
11508
11510
|
printResult({ success: true, id, version: opts.version }, opts);
|
|
11509
11511
|
return;
|
|
11510
11512
|
}
|
|
11511
|
-
console.log(
|
|
11513
|
+
console.log(import_picocolors8.default.green(`Document restored to version ${opts.version}.`));
|
|
11512
11514
|
});
|
|
11513
11515
|
cmd.command("generate").description("Generate a document using AI").requiredOption("--title <title>", "Document title").option("--instructions <text>", "Custom generation instructions").option("--json", "Output as JSON").action(async (opts) => {
|
|
11514
11516
|
const cfg = requireConfig4();
|
|
@@ -11523,7 +11525,7 @@ ${page.body}`);
|
|
|
11523
11525
|
printResult(result, opts);
|
|
11524
11526
|
return;
|
|
11525
11527
|
}
|
|
11526
|
-
console.log(
|
|
11528
|
+
console.log(import_picocolors8.default.green("Document generation started."));
|
|
11527
11529
|
});
|
|
11528
11530
|
cmd.command("auto-tag").description("Auto-tag a document using AI").argument("<id>", "Page ID").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
11529
11531
|
const cfg = requireConfig4();
|
|
@@ -11532,7 +11534,7 @@ ${page.body}`);
|
|
|
11532
11534
|
printResult(result, opts);
|
|
11533
11535
|
return;
|
|
11534
11536
|
}
|
|
11535
|
-
console.log(
|
|
11537
|
+
console.log(import_picocolors8.default.green("Auto-tagging started."));
|
|
11536
11538
|
});
|
|
11537
11539
|
cmd.command("import").description("Import documents from an external platform").argument("<platform>", "Platform: github, gitlab, confluence, notion, coda").requiredOption("--files <ids>", "Comma-separated file/page IDs to import").option("--json", "Output as JSON").action(async (platform, opts) => {
|
|
11538
11540
|
const cfg = requireConfig4();
|
|
@@ -11548,20 +11550,38 @@ ${page.body}`);
|
|
|
11548
11550
|
};
|
|
11549
11551
|
const fn = importFn[platform.toLowerCase()];
|
|
11550
11552
|
if (!fn) {
|
|
11551
|
-
console.error(
|
|
11553
|
+
console.error(import_picocolors8.default.red(`Unknown platform: ${platform}. Use: github, gitlab, confluence, notion, coda`));
|
|
11552
11554
|
process.exit(1);
|
|
11553
11555
|
}
|
|
11554
11556
|
const idField = ["confluence", "notion", "coda"].includes(platform.toLowerCase()) ? "page_ids" : "file_ids";
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
|
|
11561
|
-
|
|
11562
|
-
|
|
11557
|
+
try {
|
|
11558
|
+
const result = await fn({
|
|
11559
|
+
knowledge_store_id: ksId,
|
|
11560
|
+
space_id: cfg.space_id,
|
|
11561
|
+
[idField]: fileIds
|
|
11562
|
+
});
|
|
11563
|
+
if (opts.json) {
|
|
11564
|
+
printResult(result, opts);
|
|
11565
|
+
return;
|
|
11566
|
+
}
|
|
11567
|
+
console.log(import_picocolors8.default.green(`Import started.${result.task_id ? ` Task ID: ${result.task_id}` : ""}`));
|
|
11568
|
+
} catch (err) {
|
|
11569
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
11570
|
+
logger.warn("docs-import", `Import failed: ${msg}`);
|
|
11571
|
+
const { detail } = parseSerializedImportError(msg);
|
|
11572
|
+
const isConcurrentImport = isConcurrentImportError(err, msg);
|
|
11573
|
+
if (opts.json) {
|
|
11574
|
+
const error = isConcurrentImport ? "An import is already in progress for this organization. Wait for it to complete or check status with: dosu docs import-status <task-id>" : detail;
|
|
11575
|
+
console.error(JSON.stringify({ error }));
|
|
11576
|
+
} else if (isConcurrentImport) {
|
|
11577
|
+
M2.error("An import is already in progress for this organization.");
|
|
11578
|
+
M2.info(`Check status with: ${import_picocolors8.default.cyan("dosu docs import-status <task-id>")}`);
|
|
11579
|
+
M2.info("Only one import can run per organization at a time.");
|
|
11580
|
+
} else {
|
|
11581
|
+
M2.error(detail);
|
|
11582
|
+
}
|
|
11583
|
+
process.exit(1);
|
|
11563
11584
|
}
|
|
11564
|
-
console.log(import_picocolors7.default.green(`Import started.${result.task_id ? ` Task ID: ${result.task_id}` : ""}`));
|
|
11565
11585
|
});
|
|
11566
11586
|
cmd.command("import-status").description("Check import task status").argument("<task-id>", "Import task ID").option("--json", "Output as JSON").action(async (taskId, opts) => {
|
|
11567
11587
|
const cfg = requireConfig4();
|
|
@@ -11572,7 +11592,7 @@ ${page.body}`);
|
|
|
11572
11592
|
return;
|
|
11573
11593
|
}
|
|
11574
11594
|
if (!status) {
|
|
11575
|
-
console.log(
|
|
11595
|
+
console.log(import_picocolors8.default.dim("Import task not found."));
|
|
11576
11596
|
return;
|
|
11577
11597
|
}
|
|
11578
11598
|
console.log(`Status: ${JSON.stringify(status)}`);
|
|
@@ -11621,7 +11641,7 @@ ${page.body}`);
|
|
|
11621
11641
|
};
|
|
11622
11642
|
const config = publishMap[platform];
|
|
11623
11643
|
if (!config) {
|
|
11624
|
-
console.error(
|
|
11644
|
+
console.error(import_picocolors8.default.red(`Unknown platform: ${platform}`));
|
|
11625
11645
|
process.exit(1);
|
|
11626
11646
|
}
|
|
11627
11647
|
logger.debug("docs", `Publishing to ${platform}`);
|
|
@@ -11630,7 +11650,7 @@ ${page.body}`);
|
|
|
11630
11650
|
printResult(result, opts);
|
|
11631
11651
|
return;
|
|
11632
11652
|
}
|
|
11633
|
-
console.log(
|
|
11653
|
+
console.log(import_picocolors8.default.green(`Document published to ${platform}.`));
|
|
11634
11654
|
});
|
|
11635
11655
|
cmd.command("sync-back").description("Sync document back to its source (Notion/Confluence)").argument("<id>", "Page ID").option("--json", "Output as JSON").action(async (id, opts) => {
|
|
11636
11656
|
const cfg = requireConfig4();
|
|
@@ -11640,7 +11660,7 @@ ${page.body}`);
|
|
|
11640
11660
|
printResult(result, opts);
|
|
11641
11661
|
return;
|
|
11642
11662
|
}
|
|
11643
|
-
console.log(
|
|
11663
|
+
console.log(import_picocolors8.default.green("Sync-back initiated."));
|
|
11644
11664
|
});
|
|
11645
11665
|
return cmd;
|
|
11646
11666
|
}
|
|
@@ -12583,27 +12603,19 @@ function createProgram() {
|
|
|
12583
12603
|
const { runTUI: runTUI2 } = await Promise.resolve().then(() => (init_tui(), exports_tui));
|
|
12584
12604
|
await runTUI2();
|
|
12585
12605
|
});
|
|
12586
|
-
program2.command("login").description("Authenticate with Dosu via OAuth").
|
|
12606
|
+
program2.command("login").description("Authenticate with Dosu via OAuth").action(async () => {
|
|
12587
12607
|
const cfg = loadConfig();
|
|
12588
12608
|
if (isAuthenticated(cfg) && !isTokenExpired(cfg)) {
|
|
12589
12609
|
console.log("You are already logged in.");
|
|
12590
12610
|
console.log("Run 'dosu logout' first to re-authenticate.");
|
|
12591
12611
|
return;
|
|
12592
12612
|
}
|
|
12593
|
-
console.log(
|
|
12613
|
+
console.log("Opening browser for authentication...");
|
|
12594
12614
|
const { startOAuthFlow: startOAuthFlow2 } = await Promise.resolve().then(() => (init_flow(), exports_flow));
|
|
12595
12615
|
const { OAuthCallbackError: OAuthCallbackError2 } = await Promise.resolve().then(() => (init_errors(), exports_errors));
|
|
12596
12616
|
let token;
|
|
12597
12617
|
try {
|
|
12598
|
-
token = await startOAuthFlow2(
|
|
12599
|
-
openBrowser: opts.open !== false,
|
|
12600
|
-
onAuthURL: opts.open === false ? (url) => {
|
|
12601
|
-
console.log("Open this URL to authenticate:");
|
|
12602
|
-
console.log(url);
|
|
12603
|
-
console.log(`
|
|
12604
|
-
Waiting for login to complete...`);
|
|
12605
|
-
} : undefined
|
|
12606
|
-
});
|
|
12618
|
+
token = await startOAuthFlow2();
|
|
12607
12619
|
} catch (err) {
|
|
12608
12620
|
if (err instanceof OAuthCallbackError2) {
|
|
12609
12621
|
console.error(err.userMessage);
|
|
@@ -12657,7 +12669,7 @@ Waiting for login to complete...`);
|
|
|
12657
12669
|
console.log(`MCP ID: ${cfg.deployment_id}`);
|
|
12658
12670
|
} else {
|
|
12659
12671
|
console.log("MCP: None selected");
|
|
12660
|
-
console.log("Run 'dosu' to
|
|
12672
|
+
console.log("Run 'dosu deployments list' to see available MCPs, then 'dosu deployments switch <id>' to select one.");
|
|
12661
12673
|
}
|
|
12662
12674
|
});
|
|
12663
12675
|
const mcp = program2.command("mcp").description("Manage MCP server integrations");
|
|
@@ -12733,7 +12745,7 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
|
|
|
12733
12745
|
program2.addCommand(tagsCommand());
|
|
12734
12746
|
program2.addCommand(threadsCommand());
|
|
12735
12747
|
program2.addCommand(skillCommand());
|
|
12736
|
-
program2.command("setup").description("Set up Dosu MCP for your AI tools").option("--deployment <id>", "Skip to tool configuration for a specific MCP").option("--mode <mode>", "Force OSS or Cloud mode, skipping the interactive prompt (oss|cloud)").
|
|
12748
|
+
program2.command("setup").description("Set up Dosu MCP for your AI tools").option("--deployment <id>", "Skip to tool configuration for a specific MCP").option("--mode <mode>", "Force OSS or Cloud mode, skipping the interactive prompt (oss|cloud)").action(async (opts) => {
|
|
12737
12749
|
const { runSetup: runSetup2 } = await Promise.resolve().then(() => (init_flow2(), exports_flow2));
|
|
12738
12750
|
let mode;
|
|
12739
12751
|
if (opts.mode !== undefined) {
|
|
@@ -12743,16 +12755,7 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
|
|
|
12743
12755
|
}
|
|
12744
12756
|
mode = normalized;
|
|
12745
12757
|
}
|
|
12746
|
-
await runSetup2({
|
|
12747
|
-
deploymentID: opts.deployment,
|
|
12748
|
-
mode,
|
|
12749
|
-
yes: opts.agent === true || opts.yes === true,
|
|
12750
|
-
openBrowser: opts.agent === true ? false : opts.open !== false,
|
|
12751
|
-
toolIDs: opts.tool ?? [],
|
|
12752
|
-
skipMcp: opts.skipMcp === true,
|
|
12753
|
-
skipSkill: opts.skipSkill === true,
|
|
12754
|
-
skipGitHub: opts.agent === true || opts.skipGithub === true
|
|
12755
|
-
});
|
|
12758
|
+
await runSetup2({ deploymentID: opts.deployment, mode });
|
|
12756
12759
|
});
|
|
12757
12760
|
program2.command("logs").description("View or manage debug logs").option("-t, --tail [n]", "Show last N lines (default: 50)").option("--clear", "Delete the log file").action((opts) => {
|
|
12758
12761
|
const logPath = logger.getLogPath();
|
|
@@ -12782,10 +12785,6 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
|
|
|
12782
12785
|
});
|
|
12783
12786
|
return program2;
|
|
12784
12787
|
}
|
|
12785
|
-
function collectValues(value, previous) {
|
|
12786
|
-
previous.push(value);
|
|
12787
|
-
return previous;
|
|
12788
|
-
}
|
|
12789
12788
|
async function execute() {
|
|
12790
12789
|
const program2 = createProgram();
|
|
12791
12790
|
await program2.parseAsync(process.argv);
|