@dosu/cli 0.57.0 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dosu.js +53 -28
- 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.57.
|
|
1086
|
+
var VERSION = "0.57.1", INSTALL_CHANNEL = "npm";
|
|
1087
1087
|
|
|
1088
1088
|
// src/debug/logger.ts
|
|
1089
1089
|
import {
|
|
@@ -8548,6 +8548,9 @@ function layoutMargin(columns = process.stdout.columns ?? 80) {
|
|
|
8548
8548
|
function frameTopMargin(rows = process.stdout.rows ?? 24) {
|
|
8549
8549
|
return Math.max(2, Math.min(6, Math.floor(rows / 8)));
|
|
8550
8550
|
}
|
|
8551
|
+
function frameMaxLines(rows = process.stdout.rows ?? 24) {
|
|
8552
|
+
return Math.max(1, rows - frameTopMargin(rows) - 2);
|
|
8553
|
+
}
|
|
8551
8554
|
function breadcrumb(segments, width = contentWidth()) {
|
|
8552
8555
|
const head = segments.slice(0, -1);
|
|
8553
8556
|
const leaf = segments[segments.length - 1] ?? "";
|
|
@@ -13713,7 +13716,7 @@ var init_sync = __esm(() => {
|
|
|
13713
13716
|
});
|
|
13714
13717
|
|
|
13715
13718
|
// src/telemetry/debug-id.ts
|
|
13716
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
13719
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "ca9e58ba-ed30-6875-6475-6e2164756e21";
|
|
13717
13720
|
|
|
13718
13721
|
// src/telemetry/telemetry.ts
|
|
13719
13722
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -62523,7 +62526,7 @@ function confirmBox(queuedCount, backlog, width, mode = "start") {
|
|
|
62523
62526
|
import_picocolors34.default.dim(`╰${"─".repeat(inner + 2)}╯`)
|
|
62524
62527
|
];
|
|
62525
62528
|
}
|
|
62526
|
-
function
|
|
62529
|
+
function buildActivityFrame(status, activity, width, backlog = null, pane = DEFAULT_PANE, queued = [], studiedBeforeRun = 0, open = [], runProgress = null, projectNames = {}, sessionNames = {}, frameLines) {
|
|
62527
62530
|
const studied = status.state.watermark ? `Studied sessions up to ${localTime(status.state.watermark)}` : "Nothing studied yet";
|
|
62528
62531
|
const queueDetail = [];
|
|
62529
62532
|
if (status.backoffUntil) {
|
|
@@ -62558,16 +62561,7 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
|
|
|
62558
62561
|
const source = pane.tab === "activity" ? activity.map((line) => formatActivityLine(line, width, fullRows)) : pane.tab === "queued" ? queuedRows : pane.tab === "open" ? openRows : studiedRows;
|
|
62559
62562
|
const emptyStudied = status.state.watermark ? "No sessions recorded yet. History starts with the next study run." : "No studied sessions yet.";
|
|
62560
62563
|
const empty = pane.tab === "activity" ? "No sync activity in the log yet." : pane.tab === "queued" ? "Queue empty. Finished agent sessions appear here." : pane.tab === "open" ? "No open sessions. Live agent sessions sit here until they go quiet." : emptyStudied;
|
|
62561
|
-
const
|
|
62562
|
-
const { visible, above, below } = windowList(source, pane.scroll, height);
|
|
62563
|
-
const display = fullRows ? visible.flatMap((row) => wrapRow(row, width)) : visible;
|
|
62564
|
-
const listRows = display.length > 0 ? display.map((row) => import_picocolors34.default.dim(row)) : [import_picocolors34.default.dim(empty)];
|
|
62565
|
-
const scrollParts = [];
|
|
62566
|
-
if (above > 0)
|
|
62567
|
-
scrollParts.push(`↑ ${above} earlier`);
|
|
62568
|
-
if (below > 0)
|
|
62569
|
-
scrollParts.push(`↓ ${below} newer`);
|
|
62570
|
-
const lines = [
|
|
62564
|
+
const header = [
|
|
62571
62565
|
breadcrumb(["home", "activity"], width),
|
|
62572
62566
|
"",
|
|
62573
62567
|
statusLine(status),
|
|
@@ -62576,9 +62570,9 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
|
|
|
62576
62570
|
...progress ? [progress] : [],
|
|
62577
62571
|
...refusalLines,
|
|
62578
62572
|
"",
|
|
62579
|
-
...tabBar(pane.tab, queued.length, open.length, latestPass.size, width)
|
|
62580
|
-
|
|
62581
|
-
|
|
62573
|
+
...tabBar(pane.tab, queued.length, open.length, latestPass.size, width)
|
|
62574
|
+
];
|
|
62575
|
+
const footer = [
|
|
62582
62576
|
"",
|
|
62583
62577
|
...pane.confirm ? centerBlock(confirmBox(queued.length, backlog, width, pane.confirm), width) : [
|
|
62584
62578
|
...wrapLine([
|
|
@@ -62591,8 +62585,29 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
|
|
|
62591
62585
|
].join(" · "), width, "").map((line) => import_picocolors34.default.dim(line))
|
|
62592
62586
|
]
|
|
62593
62587
|
];
|
|
62594
|
-
|
|
62595
|
-
|
|
62588
|
+
const defaultHeight = fullRows ? ACTIVITY_VIEW_FULL_LIST_ROWS : ACTIVITY_VIEW_LIST_LINES;
|
|
62589
|
+
const listBudget = frameLines === undefined ? defaultHeight : Math.max(1, Math.min(defaultHeight, frameLines - header.length - footer.length - 1));
|
|
62590
|
+
let height = listBudget;
|
|
62591
|
+
let { visible, above, below } = windowList(source, pane.scroll, height);
|
|
62592
|
+
let display = fullRows ? visible.flatMap((row) => wrapRow(row, width)) : visible;
|
|
62593
|
+
while (fullRows && frameLines !== undefined && display.length > listBudget && height > 1) {
|
|
62594
|
+
height -= 1;
|
|
62595
|
+
({ visible, above, below } = windowList(source, pane.scroll, height));
|
|
62596
|
+
display = visible.flatMap((row) => wrapRow(row, width));
|
|
62597
|
+
}
|
|
62598
|
+
const listRows = display.length > 0 ? display.map((row) => import_picocolors34.default.dim(row)) : [import_picocolors34.default.dim(empty)];
|
|
62599
|
+
const scrollParts = [];
|
|
62600
|
+
if (above > 0)
|
|
62601
|
+
scrollParts.push(`↑ ${above} earlier`);
|
|
62602
|
+
if (below > 0)
|
|
62603
|
+
scrollParts.push(`↓ ${below} newer`);
|
|
62604
|
+
const lines = [
|
|
62605
|
+
...header,
|
|
62606
|
+
...listRows,
|
|
62607
|
+
...scrollParts.length > 0 ? [import_picocolors34.default.dim(clip(scrollParts.join(" · "), width))] : [],
|
|
62608
|
+
...footer
|
|
62609
|
+
];
|
|
62610
|
+
return { lines, listHeight: height };
|
|
62596
62611
|
}
|
|
62597
62612
|
function createRowNamer() {
|
|
62598
62613
|
const dirs = createProjectDirResolver();
|
|
@@ -62704,7 +62719,7 @@ function runActivityView(io = {}) {
|
|
|
62704
62719
|
return sessions.open.length;
|
|
62705
62720
|
return (status.state.mined_sessions ?? []).length;
|
|
62706
62721
|
};
|
|
62707
|
-
|
|
62722
|
+
let listHeight = ACTIVITY_VIEW_LIST_LINES;
|
|
62708
62723
|
let lastFrame = null;
|
|
62709
62724
|
let studiedBeforeRun = null;
|
|
62710
62725
|
const draw = () => {
|
|
@@ -62729,7 +62744,11 @@ function runActivityView(io = {}) {
|
|
|
62729
62744
|
confirmSync = null;
|
|
62730
62745
|
const width = activityWidth(output.columns ?? 80);
|
|
62731
62746
|
const rowNames = rowNamesFor(status, sessions);
|
|
62732
|
-
|
|
62747
|
+
scroll = Math.min(scroll, Math.max(0, activeListLength() - listHeight));
|
|
62748
|
+
const built = buildActivityFrame(status, activity, width, backlog, { tab, scroll, confirm: confirmSync ?? undefined, fullRows }, sessions.queued, studiedBeforeRun ?? 0, sessions.open, runProgress, rowNames.projects, rowNames.titles, frameMaxLines(output.rows ?? 24));
|
|
62749
|
+
listHeight = built.listHeight;
|
|
62750
|
+
const frame = built.lines.join(`
|
|
62751
|
+
`);
|
|
62733
62752
|
if (frame === lastFrame)
|
|
62734
62753
|
return;
|
|
62735
62754
|
lastFrame = frame;
|
|
@@ -62824,7 +62843,7 @@ ${CLEAR_BELOW}`);
|
|
|
62824
62843
|
scroll = 0;
|
|
62825
62844
|
draw();
|
|
62826
62845
|
} else if (action === "up") {
|
|
62827
|
-
const maxScroll = Math.max(0, activeListLength() - listHeight
|
|
62846
|
+
const maxScroll = Math.max(0, activeListLength() - listHeight);
|
|
62828
62847
|
if (scroll < maxScroll) {
|
|
62829
62848
|
scroll += 1;
|
|
62830
62849
|
draw();
|
|
@@ -64553,6 +64572,10 @@ var init_flow2 = __esm(() => {
|
|
|
64553
64572
|
});
|
|
64554
64573
|
|
|
64555
64574
|
// src/tui/analytics-view.ts
|
|
64575
|
+
function analyticsListHeight(rows) {
|
|
64576
|
+
const room = frameMaxLines(rows) - ANALYTICS_VIEW_CHROME_LINES;
|
|
64577
|
+
return Math.max(1, Math.min(ANALYTICS_VIEW_LINES, room));
|
|
64578
|
+
}
|
|
64556
64579
|
function reduceAnalyticsViewKey(key) {
|
|
64557
64580
|
if (key === "q" || key === ESC8 || key === CTRL_C5)
|
|
64558
64581
|
return "back";
|
|
@@ -64662,9 +64685,9 @@ function analyticsTabRows(tab, state, pageStats) {
|
|
|
64662
64685
|
return projectRows(state);
|
|
64663
64686
|
return pageRows(pageStats);
|
|
64664
64687
|
}
|
|
64665
|
-
function renderAnalyticsFrame(state, tab, scroll, pageStats = null, pagesPending = false, width = contentWidth()) {
|
|
64688
|
+
function renderAnalyticsFrame(state, tab, scroll, pageStats = null, pagesPending = false, width = contentWidth(), height = ANALYTICS_VIEW_LINES) {
|
|
64666
64689
|
const rows = analyticsTabRows(tab, state, pageStats);
|
|
64667
|
-
const { visible, above, below } = windowReport(rows, scroll);
|
|
64690
|
+
const { visible, above, below } = windowReport(rows, scroll, height);
|
|
64668
64691
|
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.";
|
|
64669
64692
|
const listRows = visible.length > 0 ? visible.map((row) => import_picocolors36.default.dim(row)) : [import_picocolors36.default.dim(empty)];
|
|
64670
64693
|
const scrollParts = [];
|
|
@@ -64704,10 +64727,13 @@ function runAnalyticsView(io = {}) {
|
|
|
64704
64727
|
let pagesPending = true;
|
|
64705
64728
|
let closed = false;
|
|
64706
64729
|
let lastFrame = null;
|
|
64730
|
+
const listHeight = () => analyticsListHeight(output.rows ?? 24);
|
|
64731
|
+
const maxScroll = () => Math.max(0, analyticsTabRows(tab, status.state, pageStats).length - listHeight());
|
|
64707
64732
|
const draw = () => {
|
|
64708
64733
|
status = getStatus();
|
|
64734
|
+
scroll = Math.min(scroll, maxScroll());
|
|
64709
64735
|
const width = Math.min(contentWidth(output.columns ?? 80), (output.columns ?? 80) - 1);
|
|
64710
|
-
const frame = renderAnalyticsFrame(status.state, tab, scroll, pageStats, pagesPending, width);
|
|
64736
|
+
const frame = renderAnalyticsFrame(status.state, tab, scroll, pageStats, pagesPending, width, listHeight());
|
|
64711
64737
|
if (frame === lastFrame)
|
|
64712
64738
|
return;
|
|
64713
64739
|
lastFrame = frame;
|
|
@@ -64768,8 +64794,7 @@ ${CLEAR_BELOW2}`);
|
|
|
64768
64794
|
draw();
|
|
64769
64795
|
}
|
|
64770
64796
|
} else if (action === "down") {
|
|
64771
|
-
|
|
64772
|
-
if (scroll < maxScroll) {
|
|
64797
|
+
if (scroll < maxScroll()) {
|
|
64773
64798
|
scroll += 1;
|
|
64774
64799
|
draw();
|
|
64775
64800
|
}
|
|
@@ -64779,7 +64804,7 @@ ${CLEAR_BELOW2}`);
|
|
|
64779
64804
|
input.on("data", onData);
|
|
64780
64805
|
});
|
|
64781
64806
|
}
|
|
64782
|
-
var import_picocolors36, ESC8, HIDE_CURSOR4, SHOW_CURSOR4, CTRL_C5, KEY_UP5, KEY_DOWN5, KEY_RIGHT4, KEY_LEFT4, CURSOR_HOME2, CLEAR_BELOW2, CLEAR_EOL2, ANALYTICS_VIEW_POLL_MS = 1000, ANALYTICS_VIEW_LINES = 14, ANALYTICS_VIEW_TABS, TOP_PAGES_LIMIT = 5, TOP_CITED_DAYS = 30, label = (text) => text.padEnd(26);
|
|
64807
|
+
var import_picocolors36, ESC8, HIDE_CURSOR4, SHOW_CURSOR4, CTRL_C5, KEY_UP5, KEY_DOWN5, KEY_RIGHT4, KEY_LEFT4, CURSOR_HOME2, CLEAR_BELOW2, CLEAR_EOL2, ANALYTICS_VIEW_POLL_MS = 1000, ANALYTICS_VIEW_LINES = 14, ANALYTICS_VIEW_CHROME_LINES = 8, ANALYTICS_VIEW_TABS, TOP_PAGES_LIMIT = 5, TOP_CITED_DAYS = 30, label = (text) => text.padEnd(26);
|
|
64783
64808
|
var init_analytics_view = __esm(() => {
|
|
64784
64809
|
init_trpc();
|
|
64785
64810
|
init_config();
|
|
@@ -66788,4 +66813,4 @@ main().catch((err) => {
|
|
|
66788
66813
|
process.exit(1);
|
|
66789
66814
|
});
|
|
66790
66815
|
|
|
66791
|
-
//# debugId=
|
|
66816
|
+
//# debugId=ca9e58ba-ed30-6875-6475-6e2164756e21
|