@dosu/cli 0.67.0-beta.2 → 0.67.0-beta.3
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 +91 -94
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -450,7 +450,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
|
|
|
450
450
|
function getVersionString() {
|
|
451
451
|
return `v${VERSION}`;
|
|
452
452
|
}
|
|
453
|
-
var VERSION = "0.67.0-beta.
|
|
453
|
+
var VERSION = "0.67.0-beta.3", INSTALL_CHANNEL = "npm";
|
|
454
454
|
|
|
455
455
|
// src/debug/logger.ts
|
|
456
456
|
import {
|
|
@@ -16200,76 +16200,6 @@ var init_ask = __esm(() => {
|
|
|
16200
16200
|
import_picocolors7 = __toESM(require_picocolors(), 1);
|
|
16201
16201
|
});
|
|
16202
16202
|
|
|
16203
|
-
// src/setup/styles.ts
|
|
16204
|
-
import { stripVTControlCharacters as stripVTControlCharacters4 } from "node:util";
|
|
16205
|
-
function hasTruecolor() {
|
|
16206
|
-
return /truecolor|24bit/i.test(process.env.COLORTERM ?? "");
|
|
16207
|
-
}
|
|
16208
|
-
function brand(msg) {
|
|
16209
|
-
if (!import_picocolors8.default.isColorSupported)
|
|
16210
|
-
return msg;
|
|
16211
|
-
return hasTruecolor() ? `${BRAND_FG}${msg}${RESET_FG}` : import_picocolors8.default.green(msg);
|
|
16212
|
-
}
|
|
16213
|
-
function brandBadge(msg) {
|
|
16214
|
-
if (!import_picocolors8.default.isColorSupported)
|
|
16215
|
-
return `[ ${msg} ]`;
|
|
16216
|
-
const label = import_picocolors8.default.bold(` ${msg} `);
|
|
16217
|
-
return hasTruecolor() ? `${BRAND_BG}${INK_FG}${label}${RESET_FG}${RESET_BG}` : import_picocolors8.default.bgGreen(import_picocolors8.default.black(label));
|
|
16218
|
-
}
|
|
16219
|
-
function dim(msg) {
|
|
16220
|
-
return import_picocolors8.default.dim(msg);
|
|
16221
|
-
}
|
|
16222
|
-
function formatSetupSummary(title, items, marker = IconAdd) {
|
|
16223
|
-
const styled = marker === IconRemove ? import_picocolors8.default.red(marker) : brand(marker);
|
|
16224
|
-
const lines = items.map((item) => {
|
|
16225
|
-
const path = `${item.path}${item.status ? ` (${item.status})` : ""}`;
|
|
16226
|
-
return item.label ? `${styled} ${item.label}
|
|
16227
|
-
${dim(path)}` : `${styled} ${dim(path)}`;
|
|
16228
|
-
});
|
|
16229
|
-
return `${title}
|
|
16230
|
-
${lines.join(`
|
|
16231
|
-
`)}`;
|
|
16232
|
-
}
|
|
16233
|
-
function browserFallbackHint(url) {
|
|
16234
|
-
return dim(`If your browser doesn't open automatically, visit:
|
|
16235
|
-
${url}`);
|
|
16236
|
-
}
|
|
16237
|
-
function info(msg) {
|
|
16238
|
-
return import_picocolors8.default.cyan(msg);
|
|
16239
|
-
}
|
|
16240
|
-
function visibleWidth(text) {
|
|
16241
|
-
return stripVTControlCharacters4(text).length;
|
|
16242
|
-
}
|
|
16243
|
-
function wrapLog(text, columns = process.stdout.columns || 80) {
|
|
16244
|
-
const width = Math.max(20, columns - LOG_GUTTER);
|
|
16245
|
-
const out = [];
|
|
16246
|
-
for (const paragraph of text.split(`
|
|
16247
|
-
`)) {
|
|
16248
|
-
if (visibleWidth(paragraph) <= width) {
|
|
16249
|
-
out.push(paragraph);
|
|
16250
|
-
continue;
|
|
16251
|
-
}
|
|
16252
|
-
let line = "";
|
|
16253
|
-
for (const word of paragraph.split(" ")) {
|
|
16254
|
-
if (line === "") {
|
|
16255
|
-
line = word;
|
|
16256
|
-
} else if (visibleWidth(line) + 1 + visibleWidth(word) <= width) {
|
|
16257
|
-
line = `${line} ${word}`;
|
|
16258
|
-
} else {
|
|
16259
|
-
out.push(line);
|
|
16260
|
-
line = word;
|
|
16261
|
-
}
|
|
16262
|
-
}
|
|
16263
|
-
out.push(line);
|
|
16264
|
-
}
|
|
16265
|
-
return out.join(`
|
|
16266
|
-
`);
|
|
16267
|
-
}
|
|
16268
|
-
var import_picocolors8, IconAdd = "✔", IconRemove = "-", BRAND_FG = "\x1B[38;2;82;164;15m", BRAND_BG = "\x1B[48;2;82;164;15m", INK_FG = "\x1B[38;2;14;14;14m", RESET_FG = "\x1B[39m", RESET_BG = "\x1B[49m", LOG_GUTTER = 4;
|
|
16269
|
-
var init_styles = __esm(() => {
|
|
16270
|
-
import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
16271
|
-
});
|
|
16272
|
-
|
|
16273
16203
|
// src/tui/layout.ts
|
|
16274
16204
|
function contentWidth(columns = process.stdout.columns ?? 80) {
|
|
16275
16205
|
return Math.min(columns, CONTENT_WIDTH);
|
|
@@ -16289,9 +16219,9 @@ function breadcrumb(segments, width = contentWidth()) {
|
|
|
16289
16219
|
const trailWidth = head.reduce((total, segment) => total + segment.length + 3, 0);
|
|
16290
16220
|
const room = Math.max(8, width - trailWidth);
|
|
16291
16221
|
const clipped = leaf.length <= room ? leaf : `${leaf.slice(0, room - 1)}…`;
|
|
16292
|
-
return head.map((segment) =>
|
|
16222
|
+
return head.map((segment) => import_picocolors8.default.dim(`${segment} › `)).join("") + import_picocolors8.default.bold(clipped);
|
|
16293
16223
|
}
|
|
16294
|
-
function
|
|
16224
|
+
function visibleWidth(text) {
|
|
16295
16225
|
return text.replace(ANSI_PATTERN2, "").length;
|
|
16296
16226
|
}
|
|
16297
16227
|
function tabStrip(labels, active, width, { spread = true } = {}) {
|
|
@@ -16302,8 +16232,8 @@ function tabStrip(labels, active, width, { spread = true } = {}) {
|
|
|
16302
16232
|
for (const [id, label] of labels) {
|
|
16303
16233
|
const left = Math.floor((cellW - label.length) / 2);
|
|
16304
16234
|
const cell = " ".repeat(left) + label + " ".repeat(cellW - label.length - left);
|
|
16305
|
-
row += id === active ? brand(
|
|
16306
|
-
rule += id === active ? brand("━".repeat(cellW)) :
|
|
16235
|
+
row += id === active ? brand(import_picocolors8.default.bold(cell)) : import_picocolors8.default.dim(cell);
|
|
16236
|
+
rule += id === active ? brand("━".repeat(cellW)) : import_picocolors8.default.dim("─".repeat(cellW));
|
|
16307
16237
|
}
|
|
16308
16238
|
return [row, rule];
|
|
16309
16239
|
}
|
|
@@ -16326,18 +16256,18 @@ function tabStrip(labels, active, width, { spread = true } = {}) {
|
|
|
16326
16256
|
if (id === active) {
|
|
16327
16257
|
activeStart = col;
|
|
16328
16258
|
activeLen = label.length;
|
|
16329
|
-
row += brand(
|
|
16259
|
+
row += brand(import_picocolors8.default.bold(label));
|
|
16330
16260
|
} else {
|
|
16331
|
-
row +=
|
|
16261
|
+
row += import_picocolors8.default.dim(label);
|
|
16332
16262
|
}
|
|
16333
16263
|
col += label.length;
|
|
16334
16264
|
});
|
|
16335
16265
|
const tail = Math.max(0, width - activeStart - activeLen);
|
|
16336
|
-
const rule =
|
|
16266
|
+
const rule = import_picocolors8.default.dim("─".repeat(activeStart)) + brand("━".repeat(activeLen)) + import_picocolors8.default.dim("─".repeat(tail));
|
|
16337
16267
|
return [row, rule];
|
|
16338
16268
|
}
|
|
16339
16269
|
function centerBlock(lines, width) {
|
|
16340
|
-
const blockWidth = Math.max(...lines.map(
|
|
16270
|
+
const blockWidth = Math.max(...lines.map(visibleWidth));
|
|
16341
16271
|
const pad = " ".repeat(Math.max(0, Math.floor((width - blockWidth) / 2)));
|
|
16342
16272
|
return lines.map((line) => pad + line);
|
|
16343
16273
|
}
|
|
@@ -16392,10 +16322,10 @@ function installCenteredLayout(stream = process.stdout) {
|
|
|
16392
16322
|
active = false;
|
|
16393
16323
|
};
|
|
16394
16324
|
}
|
|
16395
|
-
var
|
|
16325
|
+
var import_picocolors8, ESC2, CONTENT_WIDTH = 64, TOKEN_PATTERN, COLUMN_RESET_FINALS, active = false, ANSI_PATTERN2, TAB_CELL_PAD = 2;
|
|
16396
16326
|
var init_layout = __esm(() => {
|
|
16397
16327
|
init_styles();
|
|
16398
|
-
|
|
16328
|
+
import_picocolors8 = __toESM(require_picocolors(), 1);
|
|
16399
16329
|
ESC2 = String.fromCharCode(27);
|
|
16400
16330
|
TOKEN_PATTERN = new RegExp(`(\r
|
|
16401
16331
|
|\r|
|
|
@@ -16404,6 +16334,73 @@ var init_layout = __esm(() => {
|
|
|
16404
16334
|
ANSI_PATTERN2 = new RegExp(`${ESC2}\\[[0-9;?]*[A-Za-z]`, "g");
|
|
16405
16335
|
});
|
|
16406
16336
|
|
|
16337
|
+
// src/setup/styles.ts
|
|
16338
|
+
function hasTruecolor() {
|
|
16339
|
+
return /truecolor|24bit/i.test(process.env.COLORTERM ?? "");
|
|
16340
|
+
}
|
|
16341
|
+
function brand(msg) {
|
|
16342
|
+
if (!import_picocolors9.default.isColorSupported)
|
|
16343
|
+
return msg;
|
|
16344
|
+
return hasTruecolor() ? `${BRAND_FG}${msg}${RESET_FG}` : import_picocolors9.default.green(msg);
|
|
16345
|
+
}
|
|
16346
|
+
function brandBadge(msg) {
|
|
16347
|
+
if (!import_picocolors9.default.isColorSupported)
|
|
16348
|
+
return `[ ${msg} ]`;
|
|
16349
|
+
const label = import_picocolors9.default.bold(` ${msg} `);
|
|
16350
|
+
return hasTruecolor() ? `${BRAND_BG}${INK_FG}${label}${RESET_FG}${RESET_BG}` : import_picocolors9.default.bgGreen(import_picocolors9.default.black(label));
|
|
16351
|
+
}
|
|
16352
|
+
function dim(msg) {
|
|
16353
|
+
return import_picocolors9.default.dim(msg);
|
|
16354
|
+
}
|
|
16355
|
+
function formatSetupSummary(title, items, marker = IconAdd) {
|
|
16356
|
+
const styled = marker === IconRemove ? import_picocolors9.default.red(marker) : brand(marker);
|
|
16357
|
+
const lines = items.map((item) => {
|
|
16358
|
+
const path = `${item.path}${item.status ? ` (${item.status})` : ""}`;
|
|
16359
|
+
return item.label ? `${styled} ${item.label}
|
|
16360
|
+
${dim(path)}` : `${styled} ${dim(path)}`;
|
|
16361
|
+
});
|
|
16362
|
+
return `${title}
|
|
16363
|
+
${lines.join(`
|
|
16364
|
+
`)}`;
|
|
16365
|
+
}
|
|
16366
|
+
function browserFallbackHint(url) {
|
|
16367
|
+
return dim(`If your browser doesn't open automatically, visit:
|
|
16368
|
+
${url}`);
|
|
16369
|
+
}
|
|
16370
|
+
function info(msg) {
|
|
16371
|
+
return import_picocolors9.default.cyan(msg);
|
|
16372
|
+
}
|
|
16373
|
+
function wrapLog(text, columns = process.stdout.columns || 80) {
|
|
16374
|
+
const width = Math.max(20, contentWidth(columns) - LOG_GUTTER);
|
|
16375
|
+
const out = [];
|
|
16376
|
+
for (const paragraph of text.split(`
|
|
16377
|
+
`)) {
|
|
16378
|
+
if (visibleWidth(paragraph) <= width) {
|
|
16379
|
+
out.push(paragraph);
|
|
16380
|
+
continue;
|
|
16381
|
+
}
|
|
16382
|
+
let line = "";
|
|
16383
|
+
for (const word of paragraph.split(" ")) {
|
|
16384
|
+
if (line === "") {
|
|
16385
|
+
line = word;
|
|
16386
|
+
} else if (visibleWidth(line) + 1 + visibleWidth(word) <= width) {
|
|
16387
|
+
line = `${line} ${word}`;
|
|
16388
|
+
} else {
|
|
16389
|
+
out.push(line);
|
|
16390
|
+
line = word;
|
|
16391
|
+
}
|
|
16392
|
+
}
|
|
16393
|
+
out.push(line);
|
|
16394
|
+
}
|
|
16395
|
+
return out.join(`
|
|
16396
|
+
`);
|
|
16397
|
+
}
|
|
16398
|
+
var import_picocolors9, IconAdd = "✔", IconRemove = "-", BRAND_FG = "\x1B[38;2;82;164;15m", BRAND_BG = "\x1B[48;2;82;164;15m", INK_FG = "\x1B[38;2;14;14;14m", RESET_FG = "\x1B[39m", RESET_BG = "\x1B[49m", LOG_GUTTER = 4;
|
|
16399
|
+
var init_styles = __esm(() => {
|
|
16400
|
+
init_layout();
|
|
16401
|
+
import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
16402
|
+
});
|
|
16403
|
+
|
|
16407
16404
|
// src/tui/menu.ts
|
|
16408
16405
|
function parseKeys(chunk) {
|
|
16409
16406
|
const keys = [];
|
|
@@ -16441,9 +16438,9 @@ function reduceMenuKey(key, selected, count) {
|
|
|
16441
16438
|
return { type: "none" };
|
|
16442
16439
|
}
|
|
16443
16440
|
function renderMenuFrame(message, options, selected) {
|
|
16444
|
-
const labelWidth = Math.max(...options.map((option) =>
|
|
16441
|
+
const labelWidth = Math.max(...options.map((option) => visibleWidth(option.label)));
|
|
16445
16442
|
const rows = options.map((option, index) => {
|
|
16446
|
-
const label = option.label + " ".repeat(labelWidth -
|
|
16443
|
+
const label = option.label + " ".repeat(labelWidth - visibleWidth(option.label));
|
|
16447
16444
|
const hint = option.hint ? ` ${import_picocolors10.default.dim(option.hint)}` : "";
|
|
16448
16445
|
return index === selected ? `${brand(POINTER)} ${import_picocolors10.default.bold(label)}${hint}` : ` ${import_picocolors10.default.dim(label)}${hint}`;
|
|
16449
16446
|
});
|
|
@@ -18360,7 +18357,7 @@ async function stepConnectGitHubRepo(cfg, detected = detectGitRepo(), opts = {})
|
|
|
18360
18357
|
}
|
|
18361
18358
|
repos = refresh.repos;
|
|
18362
18359
|
if (!refresh.foundNew) {
|
|
18363
|
-
log2.warn("GitHub may still be syncing. Pick 'Refresh list' in a moment to re-check; sync usually completes within a minute.");
|
|
18360
|
+
log2.warn(wrapLog("GitHub may still be syncing. Pick 'Refresh list' in a moment to re-check; sync usually completes within a minute."));
|
|
18364
18361
|
}
|
|
18365
18362
|
continue;
|
|
18366
18363
|
}
|
|
@@ -22218,7 +22215,7 @@ var init_backlog = __esm(() => {
|
|
|
22218
22215
|
});
|
|
22219
22216
|
|
|
22220
22217
|
// src/telemetry/debug-id.ts
|
|
22221
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
22218
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "b28c8070-bfe4-35bd-6475-6e2164756e21";
|
|
22222
22219
|
|
|
22223
22220
|
// src/telemetry/telemetry.ts
|
|
22224
22221
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -29686,8 +29683,8 @@ function confirmBox(queuedCount, backlog, width, mode = "start") {
|
|
|
29686
29683
|
"",
|
|
29687
29684
|
`${import_picocolors37.default.bold("enter")} ${verb} · ${import_picocolors37.default.bold("esc")} cancel`
|
|
29688
29685
|
];
|
|
29689
|
-
const inner = Math.min(maxInner, Math.max(...rows.map(
|
|
29690
|
-
const pad = (row) => row + " ".repeat(Math.max(0, inner -
|
|
29686
|
+
const inner = Math.min(maxInner, Math.max(...rows.map(visibleWidth)));
|
|
29687
|
+
const pad = (row) => row + " ".repeat(Math.max(0, inner - visibleWidth(row)));
|
|
29691
29688
|
return [
|
|
29692
29689
|
import_picocolors37.default.dim(`╭${"─".repeat(inner + 2)}╮`),
|
|
29693
29690
|
...rows.map((row) => `${import_picocolors37.default.dim("│")} ${pad(row)} ${import_picocolors37.default.dim("│")}`),
|
|
@@ -31109,7 +31106,7 @@ async function runSetupFlow(opts = {}) {
|
|
|
31109
31106
|
return;
|
|
31110
31107
|
}
|
|
31111
31108
|
if (!refreshed.finishedOnboarding) {
|
|
31112
|
-
log2.warn("Your account still needs onboarding. Finish it in the browser at the Dosu app, then re-run `dosu setup`.");
|
|
31109
|
+
log2.warn(wrapLog("Your account still needs onboarding. Finish it in the browser at the Dosu app, then re-run `dosu setup`."));
|
|
31113
31110
|
trackInBackground(trackCliOnboardingEvent(cfg, onboardingRunID, "cli_onboarding_failed", {
|
|
31114
31111
|
reason: "onboarding_incomplete_after_handshake"
|
|
31115
31112
|
}));
|
|
@@ -31229,7 +31226,7 @@ async function stepOfferInitialSync(cfg) {
|
|
|
31229
31226
|
backlog = inScope(await stepPickSyncScope(candidates, storedScope));
|
|
31230
31227
|
n = offered(backlog).length;
|
|
31231
31228
|
if (n === 0) {
|
|
31232
|
-
log2.info("No sessions from those repos are waiting. Dosu memory learns from new ones.");
|
|
31229
|
+
log2.info(wrapLog("No sessions from those repos are waiting. Dosu memory learns from new ones."));
|
|
31233
31230
|
recordCommandFacets({ backfill_offer: "not-offered" });
|
|
31234
31231
|
return;
|
|
31235
31232
|
}
|
|
@@ -32501,9 +32498,9 @@ function styleHint(hint) {
|
|
|
32501
32498
|
return [before && import_picocolors41.default.dim(before), import_picocolors41.default.cyan(command), after && import_picocolors41.default.dim(after)].filter(Boolean).join("");
|
|
32502
32499
|
}
|
|
32503
32500
|
function framedNotice(content, width) {
|
|
32504
|
-
const innerWidth = Math.max(...content.map(
|
|
32501
|
+
const innerWidth = Math.max(...content.map(visibleWidth)) + BOX_PADDING * 2;
|
|
32505
32502
|
const framed = (line) => {
|
|
32506
|
-
const pad = innerWidth -
|
|
32503
|
+
const pad = innerWidth - visibleWidth(line);
|
|
32507
32504
|
const left = Math.floor(pad / 2);
|
|
32508
32505
|
return `${import_picocolors41.default.yellow("│")}${" ".repeat(left)}${line}${" ".repeat(pad - left)}${import_picocolors41.default.yellow("│")}`;
|
|
32509
32506
|
};
|
|
@@ -32921,7 +32918,7 @@ function wrapValue(text, room) {
|
|
|
32921
32918
|
const append = (piece, sep) => {
|
|
32922
32919
|
if (current === "")
|
|
32923
32920
|
current = piece;
|
|
32924
|
-
else if (
|
|
32921
|
+
else if (visibleWidth(current) + sep.length + visibleWidth(piece) <= room) {
|
|
32925
32922
|
current += sep + piece;
|
|
32926
32923
|
} else {
|
|
32927
32924
|
lines.push(current);
|
|
@@ -32929,7 +32926,7 @@ function wrapValue(text, room) {
|
|
|
32929
32926
|
}
|
|
32930
32927
|
};
|
|
32931
32928
|
for (const item of text.split(LIST_SEP)) {
|
|
32932
|
-
const pieces =
|
|
32929
|
+
const pieces = visibleWidth(item) <= room ? [item] : item.split(" ");
|
|
32933
32930
|
pieces.forEach((piece, i) => {
|
|
32934
32931
|
append(piece, i === 0 ? LIST_SEP : " ");
|
|
32935
32932
|
});
|
|
@@ -34980,4 +34977,4 @@ main().catch((err) => {
|
|
|
34980
34977
|
process.exit(1);
|
|
34981
34978
|
});
|
|
34982
34979
|
|
|
34983
|
-
//# debugId=
|
|
34980
|
+
//# debugId=b28c8070-bfe4-35bd-6475-6e2164756e21
|