poe-code 3.0.181 → 3.0.182
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/dist/cli/commands/config.js +3 -4
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/configure.js +12 -3
- package/dist/cli/commands/configure.js.map +1 -1
- package/dist/cli/commands/dashboard-loop-shared.d.ts +7 -0
- package/dist/cli/commands/dashboard-loop-shared.js +15 -0
- package/dist/cli/commands/dashboard-loop-shared.js.map +1 -1
- package/dist/cli/commands/experiment.js +41 -32
- package/dist/cli/commands/experiment.js.map +1 -1
- package/dist/cli/commands/mcp.js +7 -2
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/pipeline.js +55 -44
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/commands/plan.js +195 -38
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/ralph.js +24 -24
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +3 -0
- package/dist/cli/commands/shared.js +27 -1
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/commands/skill.js +21 -10
- package/dist/cli/commands/skill.js.map +1 -1
- package/dist/cli/commands/spawn-poe-agent.d.ts +2 -0
- package/dist/cli/commands/spawn-poe-agent.js +47 -0
- package/dist/cli/commands/spawn-poe-agent.js.map +1 -0
- package/dist/cli/commands/spawn.js +21 -1
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/cli/commands/utils-symlink-agents.d.ts +6 -0
- package/dist/cli/commands/utils-symlink-agents.js +78 -0
- package/dist/cli/commands/utils-symlink-agents.js.map +1 -0
- package/dist/cli/commands/utils-symlink-ops.d.ts +29 -0
- package/dist/cli/commands/utils-symlink-ops.js +76 -0
- package/dist/cli/commands/utils-symlink-ops.js.map +1 -0
- package/dist/cli/commands/utils-symlink-skills.d.ts +15 -0
- package/dist/cli/commands/utils-symlink-skills.js +136 -0
- package/dist/cli/commands/utils-symlink-skills.js.map +1 -0
- package/dist/cli/commands/utils-symlink.d.ts +3 -0
- package/dist/cli/commands/utils-symlink.js +40 -0
- package/dist/cli/commands/utils-symlink.js.map +1 -0
- package/dist/cli/commands/utils.js +2 -0
- package/dist/cli/commands/utils.js.map +1 -1
- package/dist/cli/constants.d.ts +2 -2
- package/dist/cli/constants.js +1 -1
- package/dist/cli/constants.js.map +1 -1
- package/dist/cli/program.js +8 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23269 -18158
- package/dist/index.js.map +4 -4
- package/dist/plan/document-schema.d.ts +21 -0
- package/dist/plan/document-schema.js +16 -0
- package/dist/plan/document-schema.js.map +1 -0
- package/dist/providers/claude-code.js +31 -13
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +31 -13
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/goose.js +32 -14
- package/dist/providers/goose.js.map +4 -4
- package/dist/providers/kimi.js +31 -13
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +32 -14
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/poe-agent.d.ts +5 -0
- package/dist/providers/poe-agent.js +19812 -4438
- package/dist/providers/poe-agent.js.map +4 -4
- package/dist/sdk/container.js +4 -0
- package/dist/sdk/container.js.map +1 -1
- package/dist/sdk/spawn.js +8 -2
- package/dist/sdk/spawn.js.map +1 -1
- package/dist/sdk/types.d.ts +5 -1
- package/dist/services/config.d.ts +29 -44
- package/dist/services/config.js +16 -25
- package/dist/services/config.js.map +1 -1
- package/dist/templates/pipeline/SKILL_plan.md +22 -8
- package/dist/templates/pipeline/steps.yaml.mustache +1 -1
- package/dist/templates/skill/poe-generate.md +47 -0
- package/dist/templates/skill/terminal-pilot.md +45 -0
- package/dist/utils/dry-run.d.ts +8 -0
- package/dist/utils/dry-run.js +16 -0
- package/dist/utils/dry-run.js.map +1 -1
- package/dist/utils/file-system.d.ts +4 -0
- package/package.json +16 -9
- package/packages/cmdkit/dist/cli.js +42 -22
- package/packages/cmdkit/dist/cli.js.map +3 -3
- package/packages/cmdkit/dist/index.js +52 -9
- package/packages/cmdkit/dist/index.js.map +2 -2
- package/packages/cmdkit/dist/mcp.d.ts +15 -0
- package/packages/cmdkit/dist/mcp.js +121 -20
- package/packages/cmdkit/dist/mcp.js.map +3 -3
- package/packages/cmdkit/dist/number-schema.d.ts +3 -0
- package/packages/cmdkit/dist/number-schema.js +8 -0
- package/packages/cmdkit/dist/schema-scope.d.ts +4 -0
- package/packages/cmdkit/dist/schema-scope.js +34 -0
- package/packages/cmdkit/dist/sdk.js +58 -3
- package/packages/cmdkit/dist/sdk.js.map +3 -3
- package/packages/cmdkit-schema/dist/index.compile-check.js +1 -0
- package/packages/cmdkit-schema/dist/index.d.ts +59 -16
- package/packages/cmdkit-schema/dist/index.js +53 -8
- package/packages/design-system/dist/dashboard/components/footer.js +2 -3
- package/packages/design-system/dist/dashboard/components/output-pane.d.ts +1 -10
- package/packages/design-system/dist/dashboard/components/output-pane.js +5 -74
- package/packages/design-system/dist/dashboard/dashboard.js +6 -26
- package/packages/design-system/dist/dashboard/keymap.js +4 -19
- package/packages/design-system/dist/dashboard/snapshot.js +1 -5
- package/packages/design-system/dist/dashboard/store.d.ts +1 -2
- package/packages/design-system/dist/dashboard/store.js +6 -62
- package/packages/design-system/dist/dashboard/terminal.d.ts +2 -0
- package/packages/design-system/dist/dashboard/terminal.js +18 -0
- package/packages/design-system/dist/dashboard/types.d.ts +1 -11
- package/packages/design-system/dist/terminal-markdown/ast.d.ts +10 -2
- package/packages/design-system/dist/terminal-markdown/parser/block.d.ts +2 -1
- package/packages/design-system/dist/terminal-markdown/parser/block.js +400 -110
- package/packages/design-system/dist/terminal-markdown/parser/frontmatter.d.ts +2 -0
- package/packages/design-system/dist/terminal-markdown/parser/frontmatter.js +28 -11
- package/packages/design-system/dist/terminal-markdown/parser/inline.d.ts +4 -0
- package/packages/design-system/dist/terminal-markdown/parser/inline.js +134 -55
- package/packages/design-system/dist/terminal-markdown/parser.js +36 -7
|
@@ -2,24 +2,20 @@ import { resolveThemeName } from "../../internal/theme-detect.js";
|
|
|
2
2
|
import { hasAnsi, parseAnsi } from "../ansi.js";
|
|
3
3
|
const TEXT_OFFSET = 3;
|
|
4
4
|
const CONTINUATION_PREFIX = "│";
|
|
5
|
-
export function renderOutputPane(buffer, rect,
|
|
5
|
+
export function renderOutputPane(buffer, rect, items) {
|
|
6
6
|
buffer.clearRect(rect);
|
|
7
7
|
if (rect.width <= 0 || rect.height <= 0) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
const visualLines = computeVisualLines(
|
|
11
|
-
const
|
|
12
|
-
const contentHeight = showBanner ? rect.height - 1 : rect.height;
|
|
13
|
-
const startLine = state.autoFollow
|
|
14
|
-
? Math.max(visualLines.length - contentHeight, 0)
|
|
15
|
-
: clampScrollOffset(state.scrollOffset, visualLines.length);
|
|
10
|
+
const visualLines = computeVisualLines(items, rect.width);
|
|
11
|
+
const startLine = Math.max(visualLines.length - rect.height, 0);
|
|
16
12
|
const textRect = {
|
|
17
13
|
x: rect.x + TEXT_OFFSET,
|
|
18
14
|
y: rect.y,
|
|
19
15
|
width: rect.width - TEXT_OFFSET,
|
|
20
|
-
height:
|
|
16
|
+
height: rect.height
|
|
21
17
|
};
|
|
22
|
-
for (let row = 0; row <
|
|
18
|
+
for (let row = 0; row < rect.height; row += 1) {
|
|
23
19
|
const line = visualLines[startLine + row];
|
|
24
20
|
if (line === undefined) {
|
|
25
21
|
continue;
|
|
@@ -47,36 +43,6 @@ export function renderOutputPane(buffer, rect, state) {
|
|
|
47
43
|
}
|
|
48
44
|
buffer.putInRect(textRect, row, line.text, line.style);
|
|
49
45
|
}
|
|
50
|
-
if (showBanner) {
|
|
51
|
-
const hiddenBelow = Math.max(0, visualLines.length - (startLine + contentHeight));
|
|
52
|
-
renderFollowBanner(buffer, rect, hiddenBelow);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function renderFollowBanner(buffer, rect, hiddenBelow) {
|
|
56
|
-
const bannerRow = rect.height - 1;
|
|
57
|
-
const themeName = resolveThemeName();
|
|
58
|
-
const keyStyle = themeName === "light"
|
|
59
|
-
? { fg: "#006699", bold: true }
|
|
60
|
-
: { fg: "cyan", bold: true };
|
|
61
|
-
const labelStyle = getMutedStyle(themeName);
|
|
62
|
-
const message = hiddenBelow > 0
|
|
63
|
-
? `↓ F to follow · ${hiddenBelow} more`
|
|
64
|
-
: "↓ F to follow";
|
|
65
|
-
const cells = buildBannerCells(message, keyStyle, labelStyle);
|
|
66
|
-
const clipped = cells.slice(0, rect.width);
|
|
67
|
-
const startX = rect.x + Math.max(0, Math.floor((rect.width - clipped.length) / 2));
|
|
68
|
-
const y = rect.y + bannerRow;
|
|
69
|
-
for (let index = 0; index < clipped.length; index += 1) {
|
|
70
|
-
const cell = clipped[index];
|
|
71
|
-
buffer.put(startX + index, y, cell.ch, cell.style);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function buildBannerCells(message, keyStyle, labelStyle) {
|
|
75
|
-
const cells = [];
|
|
76
|
-
for (const ch of message) {
|
|
77
|
-
cells.push({ ch, style: ch === "F" ? keyStyle : labelStyle });
|
|
78
|
-
}
|
|
79
|
-
return cells;
|
|
80
46
|
}
|
|
81
47
|
export function computeVisualLines(items, width) {
|
|
82
48
|
if (width <= 0) {
|
|
@@ -153,34 +119,6 @@ function hardWrapSegments(segments, width) {
|
|
|
153
119
|
function countCells(text) {
|
|
154
120
|
return Array.from(text).length;
|
|
155
121
|
}
|
|
156
|
-
export function scrollUp(state, lines) {
|
|
157
|
-
return {
|
|
158
|
-
...state,
|
|
159
|
-
autoFollow: false,
|
|
160
|
-
scrollOffset: Math.max(0, state.scrollOffset - normalizeCount(lines))
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
export function scrollDown(state, lines, totalVisualLines) {
|
|
164
|
-
return {
|
|
165
|
-
...state,
|
|
166
|
-
autoFollow: false,
|
|
167
|
-
scrollOffset: Math.min(clampScrollOffset(totalVisualLines - 1, totalVisualLines), state.scrollOffset + normalizeCount(lines))
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
export function scrollToTop(state) {
|
|
171
|
-
return {
|
|
172
|
-
...state,
|
|
173
|
-
autoFollow: false,
|
|
174
|
-
scrollOffset: 0
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
export function scrollToBottom(state, totalVisualLines, paneHeight) {
|
|
178
|
-
return {
|
|
179
|
-
...state,
|
|
180
|
-
autoFollow: true,
|
|
181
|
-
scrollOffset: Math.max(0, normalizeCount(totalVisualLines) - normalizeCount(paneHeight))
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
122
|
function getPrefix(kind) {
|
|
185
123
|
if (kind === "success") {
|
|
186
124
|
return "◆";
|
|
@@ -311,13 +249,6 @@ function splitLogicalLines(value) {
|
|
|
311
249
|
lines.push(currentLine);
|
|
312
250
|
return lines;
|
|
313
251
|
}
|
|
314
|
-
function clampScrollOffset(scrollOffset, totalVisualLines) {
|
|
315
|
-
const maxOffset = Math.max(0, normalizeCount(totalVisualLines) - 1);
|
|
316
|
-
return Math.max(0, Math.min(normalizeCount(scrollOffset), maxOffset));
|
|
317
|
-
}
|
|
318
|
-
function normalizeCount(value) {
|
|
319
|
-
return Math.max(0, Math.floor(value));
|
|
320
|
-
}
|
|
321
252
|
function isWrappingSpace(ch) {
|
|
322
253
|
return ch === " " || ch === "\t";
|
|
323
254
|
}
|
|
@@ -26,11 +26,6 @@ export function createDashboard(opts = {}) {
|
|
|
26
26
|
});
|
|
27
27
|
let driver;
|
|
28
28
|
let store;
|
|
29
|
-
let currentLayout = computeDashboardLayout({
|
|
30
|
-
totalWidth: 0,
|
|
31
|
-
totalHeight: 0,
|
|
32
|
-
rightPaneWidth
|
|
33
|
-
});
|
|
34
29
|
let previousBuffer = new ScreenBuffer(0, 0);
|
|
35
30
|
let unsubscribeStore;
|
|
36
31
|
let unsubscribeKeypress;
|
|
@@ -62,6 +57,7 @@ export function createDashboard(opts = {}) {
|
|
|
62
57
|
previousBuffer = new ScreenBuffer(0, 0);
|
|
63
58
|
driver.enterRawMode();
|
|
64
59
|
driver.enterAltScreen();
|
|
60
|
+
driver.disableLineWrap();
|
|
65
61
|
driver.hideCursor();
|
|
66
62
|
render();
|
|
67
63
|
const activeStore = getStore();
|
|
@@ -73,10 +69,6 @@ export function createDashboard(opts = {}) {
|
|
|
73
69
|
if (command === undefined) {
|
|
74
70
|
return;
|
|
75
71
|
}
|
|
76
|
-
if (isScrollCommand(command)) {
|
|
77
|
-
activeStore.dispatch(command, currentLayout.leftPane.height);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
72
|
emitCommand(command);
|
|
81
73
|
});
|
|
82
74
|
unsubscribeResize = driver.onResize(() => {
|
|
@@ -123,25 +115,21 @@ export function createDashboard(opts = {}) {
|
|
|
123
115
|
return;
|
|
124
116
|
}
|
|
125
117
|
const { cols, rows } = driver.getSize();
|
|
126
|
-
|
|
118
|
+
const layout = computeDashboardLayout({
|
|
127
119
|
totalWidth: cols,
|
|
128
120
|
totalHeight: rows,
|
|
129
121
|
rightPaneWidth
|
|
130
122
|
});
|
|
131
123
|
const nextBuffer = new ScreenBuffer(cols, rows);
|
|
132
124
|
const state = getStore().getState();
|
|
133
|
-
renderBorder(nextBuffer,
|
|
125
|
+
renderBorder(nextBuffer, layout, {
|
|
134
126
|
leftTitle: title,
|
|
135
127
|
rightTitle: statsTitle,
|
|
136
128
|
style: { dim: true }
|
|
137
129
|
});
|
|
138
|
-
renderOutputPane(nextBuffer,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
autoFollow: state.autoFollow
|
|
142
|
-
});
|
|
143
|
-
renderStatsPane(nextBuffer, currentLayout.rightPane, state.stats);
|
|
144
|
-
renderFooter(nextBuffer, currentLayout.footer, footerHints);
|
|
130
|
+
renderOutputPane(nextBuffer, layout.leftPane, state.output);
|
|
131
|
+
renderStatsPane(nextBuffer, layout.rightPane, state.stats);
|
|
132
|
+
renderFooter(nextBuffer, layout.footer, footerHints);
|
|
145
133
|
driver.flush(diff(previousBuffer, nextBuffer));
|
|
146
134
|
previousBuffer = nextBuffer;
|
|
147
135
|
}
|
|
@@ -177,11 +165,3 @@ export function createDashboard(opts = {}) {
|
|
|
177
165
|
function isTerminalMode() {
|
|
178
166
|
return resolveOutputFormat() === "terminal";
|
|
179
167
|
}
|
|
180
|
-
function isScrollCommand(command) {
|
|
181
|
-
return command === "scrollUp"
|
|
182
|
-
|| command === "scrollDown"
|
|
183
|
-
|| command === "pageUp"
|
|
184
|
-
|| command === "pageDown"
|
|
185
|
-
|| command === "scrollToTop"
|
|
186
|
-
|| command === "scrollToBottom";
|
|
187
|
-
}
|
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
const commands = [
|
|
2
|
-
"quit",
|
|
3
|
-
"edit",
|
|
4
|
-
"pause",
|
|
5
|
-
"retry",
|
|
6
|
-
"scrollUp",
|
|
7
|
-
"scrollDown",
|
|
8
|
-
"pageUp",
|
|
9
|
-
"pageDown",
|
|
10
|
-
"scrollToTop",
|
|
11
|
-
"scrollToBottom"
|
|
12
|
-
];
|
|
1
|
+
const commands = ["forceQuit", "quit", "edit", "pause", "retry", "view-log"];
|
|
13
2
|
const defaultBindings = {
|
|
14
|
-
|
|
3
|
+
forceQuit: ["Ctrl+C"],
|
|
4
|
+
quit: ["q"],
|
|
15
5
|
edit: ["e"],
|
|
16
6
|
pause: ["p"],
|
|
17
7
|
retry: ["r"],
|
|
18
|
-
|
|
19
|
-
scrollDown: ["down", "j"],
|
|
20
|
-
pageUp: ["pageup"],
|
|
21
|
-
pageDown: ["pagedown"],
|
|
22
|
-
scrollToTop: ["home", "g"],
|
|
23
|
-
scrollToBottom: ["end", "G", "f", "F"]
|
|
8
|
+
"view-log": ["l"]
|
|
24
9
|
};
|
|
25
10
|
export function createKeymap(overrides) {
|
|
26
11
|
const bindings = new Map();
|
|
@@ -25,11 +25,7 @@ export function renderDashboardSnapshot(opts = {}) {
|
|
|
25
25
|
rightTitle: statsTitle,
|
|
26
26
|
style: { dim: true }
|
|
27
27
|
});
|
|
28
|
-
renderOutputPane(buffer, layout.leftPane,
|
|
29
|
-
items,
|
|
30
|
-
scrollOffset: 0,
|
|
31
|
-
autoFollow: true
|
|
32
|
-
});
|
|
28
|
+
renderOutputPane(buffer, layout.leftPane, items);
|
|
33
29
|
renderStatsPane(buffer, layout.rightPane, stats);
|
|
34
30
|
renderFooter(buffer, layout.footer, defaultHints());
|
|
35
31
|
return bufferToAnsi(buffer);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DashboardState, DashboardStats, OutputItem } from "./types.js";
|
|
2
2
|
export type DashboardStore = {
|
|
3
3
|
getState(): DashboardState;
|
|
4
4
|
appendOutput(item: OutputItem): void;
|
|
5
5
|
updateStats(partial: Partial<DashboardStats>): void;
|
|
6
|
-
dispatch(command: Command, paneHeight: number): void;
|
|
7
6
|
onChange(handler: () => void): () => void;
|
|
8
7
|
};
|
|
9
8
|
export declare function createStore(): DashboardStore;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
const MAX_RETAINED_OUTPUT = 256;
|
|
2
2
|
export function createStore() {
|
|
3
3
|
let state = {
|
|
4
4
|
output: [],
|
|
5
|
-
outputScroll: 0,
|
|
6
|
-
autoFollow: true,
|
|
7
5
|
stats: {
|
|
8
6
|
status: "idle",
|
|
9
7
|
iterations: 0,
|
|
10
8
|
tokensIn: 0,
|
|
11
9
|
tokensOut: 0,
|
|
12
10
|
elapsedMs: 0
|
|
13
|
-
}
|
|
14
|
-
paused: false,
|
|
15
|
-
activeDialog: { kind: "none" }
|
|
11
|
+
}
|
|
16
12
|
};
|
|
17
13
|
const listeners = new Set();
|
|
18
14
|
function notify() {
|
|
@@ -24,12 +20,10 @@ export function createStore() {
|
|
|
24
20
|
return state;
|
|
25
21
|
}
|
|
26
22
|
function appendOutput(item) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
...state,
|
|
30
|
-
|
|
31
|
-
outputScroll: state.autoFollow ? Math.max(0, output.length - 1) : state.outputScroll
|
|
32
|
-
};
|
|
23
|
+
const next = state.output.length >= MAX_RETAINED_OUTPUT
|
|
24
|
+
? [...state.output.slice(state.output.length - MAX_RETAINED_OUTPUT + 1), item]
|
|
25
|
+
: [...state.output, item];
|
|
26
|
+
state = { ...state, output: next };
|
|
33
27
|
notify();
|
|
34
28
|
}
|
|
35
29
|
function updateStats(partial) {
|
|
@@ -42,41 +36,6 @@ export function createStore() {
|
|
|
42
36
|
};
|
|
43
37
|
notify();
|
|
44
38
|
}
|
|
45
|
-
function dispatch(command, paneHeight) {
|
|
46
|
-
const totalVisualLines = state.output.length;
|
|
47
|
-
const currentPaneState = state.autoFollow
|
|
48
|
-
? toStateFromPane(state, scrollToBottom(toPaneState(state), totalVisualLines, paneHeight))
|
|
49
|
-
: state;
|
|
50
|
-
if (command === "scrollUp") {
|
|
51
|
-
state = toStateFromPane(currentPaneState, scrollUp(toPaneState(currentPaneState), 1));
|
|
52
|
-
notify();
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (command === "scrollDown") {
|
|
56
|
-
state = toStateFromPane(currentPaneState, scrollDown(toPaneState(currentPaneState), 1, totalVisualLines));
|
|
57
|
-
notify();
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (command === "pageUp") {
|
|
61
|
-
state = toStateFromPane(currentPaneState, scrollUp(toPaneState(currentPaneState), paneHeight));
|
|
62
|
-
notify();
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (command === "pageDown") {
|
|
66
|
-
state = toStateFromPane(currentPaneState, scrollDown(toPaneState(currentPaneState), paneHeight, totalVisualLines));
|
|
67
|
-
notify();
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (command === "scrollToTop") {
|
|
71
|
-
state = toStateFromPane(currentPaneState, scrollToTop(toPaneState(currentPaneState)));
|
|
72
|
-
notify();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (command === "scrollToBottom") {
|
|
76
|
-
state = toStateFromPane(currentPaneState, scrollToBottom(toPaneState(currentPaneState), totalVisualLines, paneHeight));
|
|
77
|
-
notify();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
39
|
function onChange(handler) {
|
|
81
40
|
listeners.add(handler);
|
|
82
41
|
return () => {
|
|
@@ -87,21 +46,6 @@ export function createStore() {
|
|
|
87
46
|
getState,
|
|
88
47
|
appendOutput,
|
|
89
48
|
updateStats,
|
|
90
|
-
dispatch,
|
|
91
49
|
onChange
|
|
92
50
|
};
|
|
93
51
|
}
|
|
94
|
-
function toPaneState(state) {
|
|
95
|
-
return {
|
|
96
|
-
items: state.output,
|
|
97
|
-
scrollOffset: state.outputScroll,
|
|
98
|
-
autoFollow: state.autoFollow
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function toStateFromPane(state, paneState) {
|
|
102
|
-
return {
|
|
103
|
-
...state,
|
|
104
|
-
outputScroll: paneState.scrollOffset,
|
|
105
|
-
autoFollow: paneState.autoFollow
|
|
106
|
-
};
|
|
107
|
-
}
|
|
@@ -8,6 +8,7 @@ export function createTerminalDriver(opts) {
|
|
|
8
8
|
const keypressListeners = new Set();
|
|
9
9
|
let rawMode = false;
|
|
10
10
|
let altScreen = false;
|
|
11
|
+
let lineWrapEnabled = true;
|
|
11
12
|
let cursorHidden = false;
|
|
12
13
|
let destroyed = false;
|
|
13
14
|
readline.emitKeypressEvents(stdin);
|
|
@@ -41,6 +42,20 @@ export function createTerminalDriver(opts) {
|
|
|
41
42
|
write("\u001b[?1049l");
|
|
42
43
|
altScreen = false;
|
|
43
44
|
}
|
|
45
|
+
function disableLineWrap() {
|
|
46
|
+
if (destroyed || !lineWrapEnabled) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
write("\u001b[?7l");
|
|
50
|
+
lineWrapEnabled = false;
|
|
51
|
+
}
|
|
52
|
+
function enableLineWrap() {
|
|
53
|
+
if (destroyed || lineWrapEnabled) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
write("\u001b[?7h");
|
|
57
|
+
lineWrapEnabled = true;
|
|
58
|
+
}
|
|
44
59
|
function hideCursor() {
|
|
45
60
|
if (destroyed || cursorHidden) {
|
|
46
61
|
return;
|
|
@@ -131,6 +146,7 @@ export function createTerminalDriver(opts) {
|
|
|
131
146
|
}
|
|
132
147
|
resizeListeners.clear();
|
|
133
148
|
exitRawMode();
|
|
149
|
+
enableLineWrap();
|
|
134
150
|
exitAltScreen();
|
|
135
151
|
showCursor();
|
|
136
152
|
destroyed = true;
|
|
@@ -140,6 +156,8 @@ export function createTerminalDriver(opts) {
|
|
|
140
156
|
exitRawMode,
|
|
141
157
|
enterAltScreen,
|
|
142
158
|
exitAltScreen,
|
|
159
|
+
disableLineWrap,
|
|
160
|
+
enableLineWrap,
|
|
143
161
|
hideCursor,
|
|
144
162
|
showCursor,
|
|
145
163
|
moveTo,
|
|
@@ -12,20 +12,10 @@ export type DashboardStats = {
|
|
|
12
12
|
elapsedMs: number;
|
|
13
13
|
currentAction?: string;
|
|
14
14
|
};
|
|
15
|
-
export type Command = "quit" | "
|
|
16
|
-
export type DialogState = {
|
|
17
|
-
kind: "none";
|
|
18
|
-
} | {
|
|
19
|
-
kind: "edit";
|
|
20
|
-
initialValue: string;
|
|
21
|
-
};
|
|
15
|
+
export type Command = "quit" | "forceQuit" | "edit" | "pause" | "retry" | "view-log";
|
|
22
16
|
export type DashboardState = {
|
|
23
17
|
output: OutputItem[];
|
|
24
|
-
outputScroll: number;
|
|
25
|
-
autoFollow: boolean;
|
|
26
18
|
stats: DashboardStats;
|
|
27
|
-
paused: boolean;
|
|
28
|
-
activeDialog: DialogState;
|
|
29
19
|
};
|
|
30
20
|
export type CellStyle = {
|
|
31
21
|
fg?: string;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type MdRange = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
};
|
|
5
|
+
type MdNodeWithRange = {
|
|
6
|
+
range?: MdRange;
|
|
7
|
+
};
|
|
8
|
+
export type MdNode = MdNodeWithRange & ({
|
|
2
9
|
type: "root";
|
|
3
10
|
children: MdNode[];
|
|
4
11
|
} | {
|
|
@@ -81,4 +88,5 @@ export type MdNode = {
|
|
|
81
88
|
} | {
|
|
82
89
|
type: "footnoteReference";
|
|
83
90
|
label: string;
|
|
84
|
-
};
|
|
91
|
+
});
|
|
92
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { MdNode } from "../ast.js";
|
|
1
|
+
import type { MdNode, MdRange } from "../ast.js";
|
|
2
2
|
export declare function parseBlocks(input: string): MdNode[];
|
|
3
3
|
export declare function parseBlockDocument(input: string): {
|
|
4
4
|
frontmatter?: Record<string, unknown>;
|
|
5
|
+
frontmatterRange?: MdRange;
|
|
5
6
|
children: MdNode[];
|
|
6
7
|
};
|