poly-weaver 0.5.1 → 0.6.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/dist/agents/implementors/handler.d.ts.map +1 -1
- package/dist/agents/implementors/handler.js +2 -1
- package/dist/agents/implementors/handler.js.map +1 -1
- package/dist/agents/planners/handler.d.ts.map +1 -1
- package/dist/agents/planners/handler.js +2 -1
- package/dist/agents/planners/handler.js.map +1 -1
- package/dist/agents/reviewers/handler.d.ts.map +1 -1
- package/dist/agents/reviewers/handler.js +9 -2
- package/dist/agents/reviewers/handler.js.map +1 -1
- package/dist/agents/runner.d.ts +40 -1
- package/dist/agents/runner.d.ts.map +1 -1
- package/dist/agents/runner.js +213 -14
- package/dist/agents/runner.js.map +1 -1
- package/dist/agents/simplifiers/handler.d.ts.map +1 -1
- package/dist/agents/simplifiers/handler.js +2 -1
- package/dist/agents/simplifiers/handler.js.map +1 -1
- package/dist/ansi.d.ts +26 -0
- package/dist/ansi.d.ts.map +1 -1
- package/dist/ansi.js +26 -0
- package/dist/ansi.js.map +1 -1
- package/dist/cli.js +46 -16
- package/dist/cli.js.map +1 -1
- package/dist/flow/built-in/default.js +1 -1
- package/dist/flow/built-in/default.js.map +1 -1
- package/dist/flow/built-in/default.ts +1 -1
- package/dist/flow/built-in/why-so-serious.js +1 -1
- package/dist/flow/built-in/why-so-serious.js.map +1 -1
- package/dist/flow/executor.d.ts.map +1 -1
- package/dist/flow/executor.js +7 -2
- package/dist/flow/executor.js.map +1 -1
- package/dist/flow/types.d.ts +5 -0
- package/dist/flow/types.d.ts.map +1 -1
- package/dist/flow/types.js.map +1 -1
- package/dist/markdown.d.ts +18 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +63 -0
- package/dist/markdown.js.map +1 -0
- package/dist/orchestrator.d.ts +10 -4
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +34 -14
- package/dist/orchestrator.js.map +1 -1
- package/dist/providers/claude/session.d.ts +3 -1
- package/dist/providers/claude/session.d.ts.map +1 -1
- package/dist/providers/claude/session.js +2 -2
- package/dist/providers/claude/session.js.map +1 -1
- package/dist/providers/codex/session.d.ts +6 -3
- package/dist/providers/codex/session.d.ts.map +1 -1
- package/dist/providers/codex/session.js +24 -4
- package/dist/providers/codex/session.js.map +1 -1
- package/dist/providers/copilot/session.d.ts +3 -1
- package/dist/providers/copilot/session.d.ts.map +1 -1
- package/dist/providers/copilot/session.js +15 -2
- package/dist/providers/copilot/session.js.map +1 -1
- package/dist/providers/types.d.ts +14 -2
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js.map +1 -1
- package/dist/pty/exit.d.ts +13 -5
- package/dist/pty/exit.d.ts.map +1 -1
- package/dist/pty/exit.js +19 -19
- package/dist/pty/exit.js.map +1 -1
- package/dist/pty/spawn.d.ts +12 -6
- package/dist/pty/spawn.d.ts.map +1 -1
- package/dist/pty/spawn.js +22 -70
- package/dist/pty/spawn.js.map +1 -1
- package/dist/pty/types.d.ts +12 -3
- package/dist/pty/types.d.ts.map +1 -1
- package/dist/session/locator.d.ts +23 -2
- package/dist/session/locator.d.ts.map +1 -1
- package/dist/session/locator.js +67 -4
- package/dist/session/locator.js.map +1 -1
- package/dist/status-bar.d.ts +21 -1
- package/dist/status-bar.d.ts.map +1 -1
- package/dist/status-bar.js +109 -34
- package/dist/status-bar.js.map +1 -1
- package/dist/terminal/cleanup.d.ts +21 -0
- package/dist/terminal/cleanup.d.ts.map +1 -0
- package/dist/terminal/cleanup.js +22 -0
- package/dist/terminal/cleanup.js.map +1 -0
- package/dist/terminal/host.d.ts +244 -0
- package/dist/terminal/host.d.ts.map +1 -0
- package/dist/terminal/host.js +642 -0
- package/dist/terminal/host.js.map +1 -0
- package/dist/terminal/input-router.d.ts +146 -0
- package/dist/terminal/input-router.d.ts.map +1 -0
- package/dist/terminal/input-router.js +426 -0
- package/dist/terminal/input-router.js.map +1 -0
- package/dist/terminal/layout.d.ts +55 -0
- package/dist/terminal/layout.d.ts.map +1 -0
- package/dist/terminal/layout.js +51 -0
- package/dist/terminal/layout.js.map +1 -0
- package/dist/terminal/output.d.ts +83 -0
- package/dist/terminal/output.d.ts.map +1 -0
- package/dist/terminal/output.js +107 -0
- package/dist/terminal/output.js.map +1 -0
- package/dist/terminal/render.d.ts +36 -0
- package/dist/terminal/render.d.ts.map +1 -0
- package/dist/terminal/render.js +233 -0
- package/dist/terminal/render.js.map +1 -0
- package/dist/terminal/virtual-terminal.d.ts +54 -0
- package/dist/terminal/virtual-terminal.d.ts.map +1 -0
- package/dist/terminal/virtual-terminal.js +110 -0
- package/dist/terminal/virtual-terminal.js.map +1 -0
- package/dist/terminal-input.d.ts +10 -0
- package/dist/terminal-input.d.ts.map +1 -1
- package/dist/terminal-input.js +46 -0
- package/dist/terminal-input.js.map +1 -1
- package/dist/user/auto-curate-prompt.d.ts +17 -0
- package/dist/user/auto-curate-prompt.d.ts.map +1 -0
- package/dist/user/auto-curate-prompt.js +22 -0
- package/dist/user/auto-curate-prompt.js.map +1 -0
- package/dist/user/curate-handler.d.ts.map +1 -1
- package/dist/user/curate-handler.js +10 -2
- package/dist/user/curate-handler.js.map +1 -1
- package/dist/user/curate-prompt.d.ts +9 -7
- package/dist/user/curate-prompt.d.ts.map +1 -1
- package/dist/user/curate-prompt.js +2 -341
- package/dist/user/curate-prompt.js.map +1 -1
- package/dist/user/handler.d.ts +13 -1
- package/dist/user/handler.d.ts.map +1 -1
- package/dist/user/handler.js +27 -15
- package/dist/user/handler.js.map +1 -1
- package/dist/user/hard-wrap.d.ts +11 -0
- package/dist/user/hard-wrap.d.ts.map +1 -0
- package/dist/user/hard-wrap.js +44 -0
- package/dist/user/hard-wrap.js.map +1 -0
- package/dist/user/host-curate-prompt.d.ts +34 -0
- package/dist/user/host-curate-prompt.d.ts.map +1 -0
- package/dist/user/host-curate-prompt.js +463 -0
- package/dist/user/host-curate-prompt.js.map +1 -0
- package/dist/user/host-prompt.d.ts +21 -0
- package/dist/user/host-prompt.d.ts.map +1 -0
- package/dist/user/host-prompt.js +337 -0
- package/dist/user/host-prompt.js.map +1 -0
- package/dist/user/index.d.ts +3 -3
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/index.js +2 -2
- package/dist/user/index.js.map +1 -1
- package/dist/user/plan-pane.d.ts +18 -0
- package/dist/user/plan-pane.d.ts.map +1 -0
- package/dist/user/plan-pane.js +34 -0
- package/dist/user/plan-pane.js.map +1 -0
- package/dist/user/prompt.d.ts +25 -42
- package/dist/user/prompt.d.ts.map +1 -1
- package/dist/user/prompt.js +16 -278
- package/dist/user/prompt.js.map +1 -1
- package/dist/user/split-surface.d.ts +32 -0
- package/dist/user/split-surface.d.ts.map +1 -0
- package/dist/user/split-surface.js +66 -0
- package/dist/user/split-surface.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { bold, cyan, dim, reset, visibleLength, } from "../ansi.js";
|
|
2
|
+
import { renderMarkdown } from "../markdown.js";
|
|
3
|
+
import { RawInputParser } from "./prompt.js";
|
|
4
|
+
import { clipToWidth, tagFor, wrapToWidth, } from "./curate-prompt.js";
|
|
5
|
+
import { buildPlanPane } from "./plan-pane.js";
|
|
6
|
+
import { buildSplitSurface, computeSplitMetrics } from "./split-surface.js";
|
|
7
|
+
const DECISION_CYCLE = ["keep", "drop", "revise"];
|
|
8
|
+
const PLAN_PAGE_OVERLAP = 1;
|
|
9
|
+
const COLLAPSE_AT_COLS = 100;
|
|
10
|
+
/**
|
|
11
|
+
* Host-backed curate-verdict prompt. The plan is always visible:
|
|
12
|
+
*
|
|
13
|
+
* - When `cols >= COLLAPSE_AT_COLS`: side-by-side. Issues panel on the
|
|
14
|
+
* left, plan on the right, with a `dim │` divider per row.
|
|
15
|
+
* - When `cols < COLLAPSE_AT_COLS`: top-down stack. Plan on top
|
|
16
|
+
* (`max(3, floor((rows - 1) / 2))` rows), full-width `dim ─` divider,
|
|
17
|
+
* issues panel below for the remaining rows. Both panels scroll
|
|
18
|
+
* independently — plan via PageUp/PageDown/Home/End/wheel, issues via
|
|
19
|
+
* Up/Down cursor movement (the issues pane auto-scrolls to keep the
|
|
20
|
+
* active issue visible).
|
|
21
|
+
*
|
|
22
|
+
* Issues panel: title + summary + per-issue rows. Each issue's full
|
|
23
|
+
* description is wrapped inline; when the cursor row is in revise mode and
|
|
24
|
+
* the editor is open, an inline buffer line renders directly under the
|
|
25
|
+
* issue.
|
|
26
|
+
*
|
|
27
|
+
* - k/d/r toggles the cursor row's decision.
|
|
28
|
+
* - Tab cycles keep → drop → revise → keep.
|
|
29
|
+
* - Enter on a revise row begins or finishes the inline edit; Esc cancels.
|
|
30
|
+
* - PageUp/PageDown/Home/End/wheel scrolls the plan.
|
|
31
|
+
* - Up/Down moves the cursor among issues.
|
|
32
|
+
* - Ctrl+D submits, Ctrl+C accepts all (keep all).
|
|
33
|
+
* - Ctrl+] is consumed by the host's `InputRouter` for dump capture.
|
|
34
|
+
*/
|
|
35
|
+
export class HostBackedCuratePrompt {
|
|
36
|
+
host;
|
|
37
|
+
constructor(host) {
|
|
38
|
+
this.host = host;
|
|
39
|
+
}
|
|
40
|
+
async prompt(verdict, planText) {
|
|
41
|
+
if (!this.host.isInteractive || verdict.issues.length === 0) {
|
|
42
|
+
return {
|
|
43
|
+
decisions: verdict.issues.map((_, index) => ({ index, decision: "keep" })),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const issues = verdict.issues;
|
|
47
|
+
const plan = planText ?? "";
|
|
48
|
+
const state = {
|
|
49
|
+
cursor: 0,
|
|
50
|
+
decisions: issues.map(() => "keep"),
|
|
51
|
+
comments: issues.map(() => undefined),
|
|
52
|
+
editing: undefined,
|
|
53
|
+
planScrollTop: 0,
|
|
54
|
+
};
|
|
55
|
+
const parser = new RawInputParser();
|
|
56
|
+
return new Promise((resolve) => {
|
|
57
|
+
let detach;
|
|
58
|
+
const finish = (result) => {
|
|
59
|
+
detach?.();
|
|
60
|
+
detach = undefined;
|
|
61
|
+
resolve(result);
|
|
62
|
+
};
|
|
63
|
+
const submit = () => {
|
|
64
|
+
for (let i = 0; i < state.decisions.length; i++) {
|
|
65
|
+
if (state.decisions[i] === "revise" && !state.comments[i]) {
|
|
66
|
+
state.decisions[i] = "keep";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
decisions: state.decisions.map((dec, i) => {
|
|
71
|
+
const rec = { index: i, decision: dec };
|
|
72
|
+
if (dec === "revise" && state.comments[i]) {
|
|
73
|
+
rec.comment = state.comments[i];
|
|
74
|
+
}
|
|
75
|
+
return rec;
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const processEvents = (events) => {
|
|
80
|
+
let dirty = false;
|
|
81
|
+
let finished = false;
|
|
82
|
+
for (const event of events) {
|
|
83
|
+
if (finished)
|
|
84
|
+
break;
|
|
85
|
+
if (state.editing) {
|
|
86
|
+
const i = state.editing.index;
|
|
87
|
+
if (event.type === "ctrl-c" || event.type === "esc") {
|
|
88
|
+
state.editing = undefined;
|
|
89
|
+
if (!state.comments[i])
|
|
90
|
+
state.decisions[i] = "keep";
|
|
91
|
+
dirty = true;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (event.type === "submit" || event.type === "newline") {
|
|
95
|
+
const text = state.editing.buffer.trim();
|
|
96
|
+
state.comments[i] = text.length > 0 ? text : undefined;
|
|
97
|
+
state.editing = undefined;
|
|
98
|
+
if (!state.comments[i])
|
|
99
|
+
state.decisions[i] = "keep";
|
|
100
|
+
dirty = true;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (event.type === "backspace") {
|
|
104
|
+
if (state.editing.buffer.length > 0) {
|
|
105
|
+
state.editing.buffer = state.editing.buffer.slice(0, -1);
|
|
106
|
+
dirty = true;
|
|
107
|
+
}
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (event.type === "insert") {
|
|
111
|
+
state.editing.buffer += event.text;
|
|
112
|
+
dirty = true;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (event.type === "ctrl-c") {
|
|
118
|
+
finish({
|
|
119
|
+
decisions: issues.map((_, i) => ({ index: i, decision: "keep" })),
|
|
120
|
+
});
|
|
121
|
+
finished = true;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (event.type === "submit") {
|
|
125
|
+
finish(submit());
|
|
126
|
+
finished = true;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (event.type === "arrow") {
|
|
130
|
+
if (event.direction === "up") {
|
|
131
|
+
state.cursor = (state.cursor - 1 + issues.length) % issues.length;
|
|
132
|
+
dirty = true;
|
|
133
|
+
}
|
|
134
|
+
else if (event.direction === "down") {
|
|
135
|
+
state.cursor = (state.cursor + 1) % issues.length;
|
|
136
|
+
dirty = true;
|
|
137
|
+
}
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (event.type === "scroll-page") {
|
|
141
|
+
const m = planMetrics(plan, this.host);
|
|
142
|
+
const step = Math.max(1, m.planHeight - PLAN_PAGE_OVERLAP);
|
|
143
|
+
const max = Math.max(0, m.planLines - m.planHeight);
|
|
144
|
+
if (event.direction === "up") {
|
|
145
|
+
state.planScrollTop = Math.max(0, state.planScrollTop - step);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
state.planScrollTop = Math.min(max, state.planScrollTop + step);
|
|
149
|
+
}
|
|
150
|
+
dirty = true;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (event.type === "scroll-home") {
|
|
154
|
+
state.planScrollTop = 0;
|
|
155
|
+
dirty = true;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (event.type === "scroll-end") {
|
|
159
|
+
const m = planMetrics(plan, this.host);
|
|
160
|
+
state.planScrollTop = Math.max(0, m.planLines - m.planHeight);
|
|
161
|
+
dirty = true;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (event.type === "scroll-lines") {
|
|
165
|
+
const m = planMetrics(plan, this.host);
|
|
166
|
+
const max = Math.max(0, m.planLines - m.planHeight);
|
|
167
|
+
state.planScrollTop = Math.min(max, Math.max(0, state.planScrollTop + event.delta));
|
|
168
|
+
dirty = true;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (event.type === "newline") {
|
|
172
|
+
if (state.decisions[state.cursor] === "revise") {
|
|
173
|
+
state.editing = {
|
|
174
|
+
index: state.cursor,
|
|
175
|
+
buffer: state.comments[state.cursor] ?? "",
|
|
176
|
+
};
|
|
177
|
+
dirty = true;
|
|
178
|
+
}
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (event.type === "tab") {
|
|
182
|
+
const cur = state.decisions[state.cursor];
|
|
183
|
+
const next = DECISION_CYCLE[(DECISION_CYCLE.indexOf(cur) + 1) % DECISION_CYCLE.length];
|
|
184
|
+
state.decisions[state.cursor] = next;
|
|
185
|
+
if (next === "revise" && !state.comments[state.cursor]) {
|
|
186
|
+
state.editing = { index: state.cursor, buffer: "" };
|
|
187
|
+
}
|
|
188
|
+
dirty = true;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (event.type === "insert") {
|
|
192
|
+
const ch = event.text.toLowerCase();
|
|
193
|
+
const prev = state.decisions[state.cursor];
|
|
194
|
+
if (ch === "k")
|
|
195
|
+
state.decisions[state.cursor] = "keep";
|
|
196
|
+
else if (ch === "d")
|
|
197
|
+
state.decisions[state.cursor] = "drop";
|
|
198
|
+
else if (ch === "r")
|
|
199
|
+
state.decisions[state.cursor] = "revise";
|
|
200
|
+
else
|
|
201
|
+
continue;
|
|
202
|
+
if (state.decisions[state.cursor] === "revise" && !state.comments[state.cursor]) {
|
|
203
|
+
state.editing = { index: state.cursor, buffer: "" };
|
|
204
|
+
}
|
|
205
|
+
if (state.decisions[state.cursor] !== prev)
|
|
206
|
+
dirty = true;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (dirty && !finished)
|
|
210
|
+
this.host.scheduleParentUiRender();
|
|
211
|
+
return finished;
|
|
212
|
+
};
|
|
213
|
+
const mode = {
|
|
214
|
+
getSurface: () => {
|
|
215
|
+
const layout = this.host.getLayout();
|
|
216
|
+
const cols = Math.max(20, layout.columns);
|
|
217
|
+
const rows = Math.max(1, layout.childRows);
|
|
218
|
+
return buildSurface(verdict, plan, state, cols, rows);
|
|
219
|
+
},
|
|
220
|
+
onInput: (chunk) => {
|
|
221
|
+
processEvents(parser.parseChunk(chunk));
|
|
222
|
+
return true;
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
parser.onDeferred((events) => {
|
|
226
|
+
processEvents(events);
|
|
227
|
+
});
|
|
228
|
+
detach = this.host.attachParentUi(mode);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function buildLeftPane(verdict, state, width, rows) {
|
|
233
|
+
const issues = verdict.issues;
|
|
234
|
+
const lines = [];
|
|
235
|
+
const n = issues.length;
|
|
236
|
+
const s = n === 1 ? "" : "s";
|
|
237
|
+
lines.push(clipToWidth(`${bold}${cyan}User Verdict Curation${reset} — ${n} issue${s}`, width));
|
|
238
|
+
if (verdict.summary) {
|
|
239
|
+
for (const l of renderMarkdown(verdict.summary, width)) {
|
|
240
|
+
lines.push(l);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
lines.push("");
|
|
244
|
+
// Track each issue's header row so we can scroll the left pane to keep
|
|
245
|
+
// the active issue on screen when the natural surface is taller than
|
|
246
|
+
// `rows`. Editor placement also feeds into the anchor.
|
|
247
|
+
const issueStartRows = [];
|
|
248
|
+
let editorRow;
|
|
249
|
+
let editorCol = 0;
|
|
250
|
+
for (let i = 0; i < issues.length; i++) {
|
|
251
|
+
const isCursor = i === state.cursor;
|
|
252
|
+
const arrow = isCursor ? `${bold}❯${reset}` : " ";
|
|
253
|
+
const tag = tagFor(state.decisions[i]);
|
|
254
|
+
const issue = issues[i];
|
|
255
|
+
const meta = [];
|
|
256
|
+
if (issue.severity)
|
|
257
|
+
meta.push(issue.severity);
|
|
258
|
+
if (issue.category)
|
|
259
|
+
meta.push(issue.category);
|
|
260
|
+
const head = `${arrow} ${tag} `;
|
|
261
|
+
const headWidth = visibleLength(head);
|
|
262
|
+
const avail = Math.max(1, width - headWidth);
|
|
263
|
+
const metaToken = meta.length ? `${dim}[${meta.join("/")}]${reset}` : "";
|
|
264
|
+
const metaWidth = meta.length ? visibleLength(metaToken) : 0;
|
|
265
|
+
const rendered = renderMarkdown(issue.description, avail);
|
|
266
|
+
issueStartRows.push(lines.length);
|
|
267
|
+
if (rendered.length === 0) {
|
|
268
|
+
const headRow = metaToken ? `${head}${metaToken}` : head;
|
|
269
|
+
lines.push(clipToWidth(headRow, width));
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
lines.push(`${head}${rendered[0]}`);
|
|
273
|
+
const indent = " ".repeat(headWidth);
|
|
274
|
+
for (let j = 1; j < rendered.length; j++) {
|
|
275
|
+
lines.push(`${indent}${rendered[j]}`);
|
|
276
|
+
}
|
|
277
|
+
if (metaToken) {
|
|
278
|
+
const lastIdx = lines.length - 1;
|
|
279
|
+
const lastVis = visibleLength(lines[lastIdx]);
|
|
280
|
+
// Append meta to the last rendered row if it fits with a separating
|
|
281
|
+
// space; otherwise put it on a new indented row.
|
|
282
|
+
if (lastVis + 1 + metaWidth <= width) {
|
|
283
|
+
lines[lastIdx] = `${lines[lastIdx]} ${metaToken}`;
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
lines.push(`${indent}${metaToken}`);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// Inline revise row(s).
|
|
291
|
+
if (state.decisions[i] === "revise") {
|
|
292
|
+
const reviseAvail = Math.max(1, width - 4);
|
|
293
|
+
if (state.editing && state.editing.index === i) {
|
|
294
|
+
const buf = state.editing.buffer;
|
|
295
|
+
const prefix = " └─ Revise: ";
|
|
296
|
+
const prefixWidth = visibleLength(prefix);
|
|
297
|
+
const inputWidth = Math.max(1, width - prefixWidth - 1);
|
|
298
|
+
let display;
|
|
299
|
+
if (visibleLength(buf) > inputWidth) {
|
|
300
|
+
display = `…${buf.slice(-(inputWidth - 1))}`;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
display = buf;
|
|
304
|
+
}
|
|
305
|
+
const row = `${dim}${prefix}${reset}${display}`;
|
|
306
|
+
lines.push(clipToWidth(row, width));
|
|
307
|
+
editorRow = lines.length - 1;
|
|
308
|
+
editorCol = Math.min(width - 1, prefixWidth + visibleLength(display));
|
|
309
|
+
}
|
|
310
|
+
else if (state.comments[i]) {
|
|
311
|
+
const prefix = " └─ Revise: ";
|
|
312
|
+
for (const l of wrapToWidth(state.comments[i], reviseAvail)) {
|
|
313
|
+
lines.push(`${dim}${prefix}${l}${reset}`);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (i < issues.length - 1)
|
|
318
|
+
lines.push("");
|
|
319
|
+
}
|
|
320
|
+
lines.push("");
|
|
321
|
+
const helpStartRow = lines.length;
|
|
322
|
+
const helpRows = [];
|
|
323
|
+
if (state.editing) {
|
|
324
|
+
helpRows.push("Enter submit · Esc cancel");
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
helpRows.push("↑/↓ navigate · k/d/r set · Tab cycle · Enter edit · Ctrl+D submit · Ctrl+C keep-all");
|
|
328
|
+
}
|
|
329
|
+
for (const row of helpRows) {
|
|
330
|
+
for (const l of wrapToWidth(row, width)) {
|
|
331
|
+
lines.push(`${dim}${l}${reset}`);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// Scroll the left pane so the active issue stays on screen. Anchor to the
|
|
335
|
+
// active issue's header row; when the editor is open, also keep the editor
|
|
336
|
+
// row visible (preferring the editor when both can't fit). Falls back to
|
|
337
|
+
// scrollTop=0 when the natural surface fits in `rows`.
|
|
338
|
+
const activeStart = issueStartRows[state.cursor] ?? 0;
|
|
339
|
+
const activeEndExclusive = state.cursor + 1 < issueStartRows.length
|
|
340
|
+
? issueStartRows[state.cursor + 1] - 1 // one before the spacer
|
|
341
|
+
: helpStartRow - 1; // last issue ends just before the spacer
|
|
342
|
+
// Prefer to show the entire active block; if it is taller than `rows`,
|
|
343
|
+
// fall back to the editor row (when editing) or the header row.
|
|
344
|
+
let scrollTop = 0;
|
|
345
|
+
const total = lines.length;
|
|
346
|
+
if (total > rows) {
|
|
347
|
+
// Default: anchor to the start of the active issue.
|
|
348
|
+
scrollTop = activeStart;
|
|
349
|
+
// If the block fits and there is room above, pull the window up so we
|
|
350
|
+
// also include some preceding context rather than leaving blank rows
|
|
351
|
+
// below.
|
|
352
|
+
if (activeEndExclusive - scrollTop + 1 < rows) {
|
|
353
|
+
scrollTop = Math.max(0, total - rows);
|
|
354
|
+
if (scrollTop > activeStart)
|
|
355
|
+
scrollTop = activeStart;
|
|
356
|
+
}
|
|
357
|
+
// If editing, prefer keeping the editor row visible.
|
|
358
|
+
if (editorRow !== undefined && editorRow >= scrollTop + rows) {
|
|
359
|
+
scrollTop = editorRow - rows + 1;
|
|
360
|
+
}
|
|
361
|
+
// Clamp.
|
|
362
|
+
if (scrollTop < 0)
|
|
363
|
+
scrollTop = 0;
|
|
364
|
+
if (scrollTop + rows > total)
|
|
365
|
+
scrollTop = total - rows;
|
|
366
|
+
}
|
|
367
|
+
let cursorRow;
|
|
368
|
+
let cursorCol;
|
|
369
|
+
if (editorRow !== undefined) {
|
|
370
|
+
cursorRow = editorRow - scrollTop;
|
|
371
|
+
cursorCol = editorCol;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
// Place the cursor on the active issue's header row when not editing.
|
|
375
|
+
cursorRow = activeStart - scrollTop;
|
|
376
|
+
cursorCol = 0;
|
|
377
|
+
}
|
|
378
|
+
// Slice / pad to exactly `rows`.
|
|
379
|
+
if (scrollTop > 0) {
|
|
380
|
+
lines.splice(0, scrollTop);
|
|
381
|
+
}
|
|
382
|
+
while (lines.length < rows)
|
|
383
|
+
lines.push("");
|
|
384
|
+
if (lines.length > rows)
|
|
385
|
+
lines.splice(rows, lines.length - rows);
|
|
386
|
+
if (cursorRow < 0)
|
|
387
|
+
cursorRow = 0;
|
|
388
|
+
if (cursorRow >= rows)
|
|
389
|
+
cursorRow = rows - 1;
|
|
390
|
+
if (cursorCol < 0)
|
|
391
|
+
cursorCol = 0;
|
|
392
|
+
if (cursorCol >= width)
|
|
393
|
+
cursorCol = Math.max(0, width - 1);
|
|
394
|
+
return {
|
|
395
|
+
lines: lines.map((l) => clipToWidth(l, width)),
|
|
396
|
+
cursor: { row: cursorRow, col: cursorCol },
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function buildRightPane(plan, state, width, rows) {
|
|
400
|
+
// The curate phase always follows planner+reviewer cycles, so the plan
|
|
401
|
+
// header reads "Generated Plan" — we keep the same "first" label since the
|
|
402
|
+
// plan being reviewed at this point is the current generated plan.
|
|
403
|
+
const pane = buildPlanPane(plan, "first", width);
|
|
404
|
+
const max = Math.max(0, pane.lines.length - rows);
|
|
405
|
+
if (state.planScrollTop > max)
|
|
406
|
+
state.planScrollTop = max;
|
|
407
|
+
if (state.planScrollTop < 0)
|
|
408
|
+
state.planScrollTop = 0;
|
|
409
|
+
const sliced = pane.lines.slice(state.planScrollTop, state.planScrollTop + rows);
|
|
410
|
+
while (sliced.length < rows)
|
|
411
|
+
sliced.push("");
|
|
412
|
+
return sliced.map((l) => clipToWidth(l, width));
|
|
413
|
+
}
|
|
414
|
+
function computeNarrowPlanRows(rows) {
|
|
415
|
+
// Reserve 1 row for the divider; split the remainder roughly in half with a
|
|
416
|
+
// floor of 3 plan rows so the header + rule + at least one body row remain
|
|
417
|
+
// visible.
|
|
418
|
+
return Math.max(3, Math.floor((rows - 1) / 2));
|
|
419
|
+
}
|
|
420
|
+
function buildSurface(verdict, plan, state, cols, rows) {
|
|
421
|
+
const split = computeSplitMetrics({ cols, rows, collapseAt: COLLAPSE_AT_COLS });
|
|
422
|
+
if (split.collapsed) {
|
|
423
|
+
// Narrow stack: plan on top, divider rule, issues below. Both panes are
|
|
424
|
+
// independently scrollable (plan via PageUp/PageDown/Home/End/wheel,
|
|
425
|
+
// issues via Up/Down cursor movement).
|
|
426
|
+
const planRows = computeNarrowPlanRows(rows);
|
|
427
|
+
const issueRows = Math.max(1, rows - 1 - planRows);
|
|
428
|
+
const right = buildRightPane(plan, state, cols, planRows);
|
|
429
|
+
const left = buildLeftPane(verdict, state, cols, issueRows);
|
|
430
|
+
const separator = `${dim}${"─".repeat(cols)}${reset}`;
|
|
431
|
+
const lines = [...right, separator, ...left.lines];
|
|
432
|
+
while (lines.length < rows)
|
|
433
|
+
lines.push("");
|
|
434
|
+
if (lines.length > rows)
|
|
435
|
+
lines.splice(rows, lines.length - rows);
|
|
436
|
+
let cursorRow = planRows + 1 + left.cursor.row;
|
|
437
|
+
if (cursorRow < 0)
|
|
438
|
+
cursorRow = 0;
|
|
439
|
+
if (cursorRow >= rows)
|
|
440
|
+
cursorRow = rows - 1;
|
|
441
|
+
return {
|
|
442
|
+
lines,
|
|
443
|
+
cursor: { row: cursorRow, col: left.cursor.col },
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
const left = buildLeftPane(verdict, state, split.leftWidth, rows);
|
|
447
|
+
const right = buildRightPane(plan, state, split.rightWidth, rows);
|
|
448
|
+
return buildSplitSurface({ lines: left.lines, cursor: left.cursor }, { lines: right }, { cols, rows, collapseAt: COLLAPSE_AT_COLS });
|
|
449
|
+
}
|
|
450
|
+
function planMetrics(plan, host) {
|
|
451
|
+
const layout = host.getLayout();
|
|
452
|
+
const cols = Math.max(20, layout.columns);
|
|
453
|
+
const rows = Math.max(1, layout.childRows);
|
|
454
|
+
const split = computeSplitMetrics({ cols, rows, collapseAt: COLLAPSE_AT_COLS });
|
|
455
|
+
if (split.collapsed) {
|
|
456
|
+
const planRows = computeNarrowPlanRows(rows);
|
|
457
|
+
const pane = buildPlanPane(plan, "first", cols);
|
|
458
|
+
return { planHeight: planRows, planLines: pane.lines.length };
|
|
459
|
+
}
|
|
460
|
+
const pane = buildPlanPane(plan, "first", split.rightWidth);
|
|
461
|
+
return { planHeight: rows, planLines: pane.lines.length };
|
|
462
|
+
}
|
|
463
|
+
//# sourceMappingURL=host-curate-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-curate-prompt.js","sourceRoot":"","sources":["../../src/user/host-curate-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,KAAK,EACL,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,WAAW,EACX,MAAM,EACN,WAAW,GAKZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI5E,MAAM,cAAc,GAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACpE,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,sBAAsB;IACJ;IAA7B,YAA6B,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CAAC,OAAsB,EAAE,QAAiB;QACpD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5D,O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AAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAChF,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAChD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAChE,CAAC;IACD,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,UAAW,CAAC,CAAC;IAC7D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UserPromptContext, UserPromptHandler, UserPromptResult } from "./prompt.js";
|
|
2
|
+
import type { TerminalHost } from "../terminal/host.js";
|
|
3
|
+
/**
|
|
4
|
+
* Host-backed user-review prompt with a top-down stack layout.
|
|
5
|
+
*
|
|
6
|
+
* Plan on top (header rule + scrollable body), full-width dim ─ separator, a
|
|
7
|
+
* blank top-margin row, the controls block (Approve + bounded feedback editor
|
|
8
|
+
* + optional hint), and a blank bottom-margin row above the host status bar.
|
|
9
|
+
*
|
|
10
|
+
* Key handling:
|
|
11
|
+
* - ↑/↓ toggles between Approve and the editor (does NOT scroll the plan).
|
|
12
|
+
* - PageUp/PageDown/Home/End/wheel scrolls the plan.
|
|
13
|
+
* - Ctrl+D submits feedback (or accepts when on Approve), Ctrl+C accepts.
|
|
14
|
+
* - Ctrl+] is consumed by the host's `InputRouter` for dump capture.
|
|
15
|
+
*/
|
|
16
|
+
export declare class HostBackedUserPrompt implements UserPromptHandler {
|
|
17
|
+
private readonly host;
|
|
18
|
+
constructor(host: TerminalHost);
|
|
19
|
+
prompt(plan: string, _phase: string, context: UserPromptContext): Promise<UserPromptResult>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=host-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-prompt.d.ts","sourceRoot":"","sources":["../../src/user/host-prompt.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAmC,MAAM,qBAAqB,CAAC;AAUzF;;;;;;;;;;;;GAYG;AACH,qBAAa,oBAAqB,YAAW,iBAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,YAAY;IAEzC,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC;CA8I7B"}
|