@molecule/app-ide-react 1.15.0 → 1.17.0
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/README.md +193 -7
- package/dist/components/ChatPanel.d.ts +10 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +136 -14
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/components/MarkdownContent.d.ts.map +1 -1
- package/dist/components/MarkdownContent.js +27 -7
- package/dist/components/MarkdownContent.js.map +1 -1
- package/dist/components/TestStatusBar.d.ts +56 -0
- package/dist/components/TestStatusBar.d.ts.map +1 -0
- package/dist/components/TestStatusBar.js +105 -0
- package/dist/components/TestStatusBar.js.map +1 -0
- package/dist/components/TestsCard.d.ts +15 -2
- package/dist/components/TestsCard.d.ts.map +1 -1
- package/dist/components/TestsCard.js +42 -9
- package/dist/components/TestsCard.js.map +1 -1
- package/dist/components/ToolCallCard.d.ts +7 -1
- package/dist/components/ToolCallCard.d.ts.map +1 -1
- package/dist/components/ToolCallCard.js +516 -161
- package/dist/components/ToolCallCard.js.map +1 -1
- package/dist/components/tests-bar-utilities.d.ts +78 -103
- package/dist/components/tests-bar-utilities.d.ts.map +1 -1
- package/dist/components/tests-bar-utilities.js +130 -201
- package/dist/components/tests-bar-utilities.js.map +1 -1
- package/dist/components/tests-card-utilities.d.ts +78 -2
- package/dist/components/tests-card-utilities.d.ts.map +1 -1
- package/dist/components/tests-card-utilities.js +134 -6
- package/dist/components/tests-card-utilities.js.map +1 -1
- package/dist/components/tool-call-utilities.d.ts +81 -7
- package/dist/components/tool-call-utilities.d.ts.map +1 -1
- package/dist/components/tool-call-utilities.js +146 -6
- package/dist/components/tool-call-utilities.js.map +1 -1
- package/dist/hooks/useTestsBarVisible.d.ts +16 -0
- package/dist/hooks/useTestsBarVisible.d.ts.map +1 -0
- package/dist/hooks/useTestsBarVisible.js +39 -0
- package/dist/hooks/useTestsBarVisible.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +60 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -48,6 +48,11 @@ export const EMPTY_RUN_STATE = {
|
|
|
48
48
|
currentId: null,
|
|
49
49
|
output: [],
|
|
50
50
|
results: {},
|
|
51
|
+
cases: {},
|
|
52
|
+
skipPending: false,
|
|
53
|
+
// Nothing is running, so there is nothing to skip. The panel turns this off
|
|
54
|
+
// when it starts a run on a host whose handle implements `skipCurrent`.
|
|
55
|
+
skipUnavailable: true,
|
|
51
56
|
outcome: null,
|
|
52
57
|
error: null,
|
|
53
58
|
startedAt: null,
|
|
@@ -119,8 +124,10 @@ export function summarizeResults(tests, results) {
|
|
|
119
124
|
* Fold one streamed event into the run state.
|
|
120
125
|
*
|
|
121
126
|
* Deliberately total: an event for an id the card no longer lists is recorded
|
|
122
|
-
* anyway (a re-list may be in flight),
|
|
123
|
-
*
|
|
127
|
+
* anyway (a re-list may be in flight), a `case` that arrives out of order (after
|
|
128
|
+
* its file already reported a verdict) is dropped rather than resurrecting a
|
|
129
|
+
* finished row, and an unknown event type leaves the state untouched rather
|
|
130
|
+
* than throwing inside a stream handler.
|
|
124
131
|
*
|
|
125
132
|
* @param state - The current state.
|
|
126
133
|
* @param event - The event just received.
|
|
@@ -142,6 +149,10 @@ export function applyTestRunEvent(state, event) {
|
|
|
142
149
|
currentId: null,
|
|
143
150
|
output: [],
|
|
144
151
|
results,
|
|
152
|
+
cases: {},
|
|
153
|
+
skipPending: false,
|
|
154
|
+
// NOT reset: whether the host can skip at all is the panel's to say,
|
|
155
|
+
// and it says so when it creates the handle — before this arrives.
|
|
145
156
|
outcome: null,
|
|
146
157
|
error: null,
|
|
147
158
|
startedAt: Date.now(),
|
|
@@ -156,17 +167,58 @@ export function applyTestRunEvent(state, event) {
|
|
|
156
167
|
output: output.length > MAX_OUTPUT_LINES ? output.slice(-MAX_OUTPUT_LINES) : output,
|
|
157
168
|
};
|
|
158
169
|
}
|
|
170
|
+
case 'case': {
|
|
171
|
+
// Out of order: this file already has this run's verdict, so its per-test
|
|
172
|
+
// detail is gone and `isRowRunning` must not be told otherwise.
|
|
173
|
+
if (state.results[event.id])
|
|
174
|
+
return state;
|
|
175
|
+
const previous = state.cases[event.id] ?? {
|
|
176
|
+
current: null,
|
|
177
|
+
passed: 0,
|
|
178
|
+
failed: 0,
|
|
179
|
+
skipped: 0,
|
|
180
|
+
};
|
|
181
|
+
const next = event.status === 'running'
|
|
182
|
+
? {
|
|
183
|
+
...previous,
|
|
184
|
+
current: {
|
|
185
|
+
title: event.title,
|
|
186
|
+
...(event.describe ? { describe: event.describe } : {}),
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
: {
|
|
190
|
+
passed: previous.passed + (event.status === 'passed' ? 1 : 0),
|
|
191
|
+
failed: previous.failed + (event.status === 'failed' ? 1 : 0),
|
|
192
|
+
skipped: previous.skipped + (event.status === 'skipped' ? 1 : 0),
|
|
193
|
+
// Clear the "now running" line only when THIS is the test it
|
|
194
|
+
// named — a parallel runner can finish a different one first.
|
|
195
|
+
current: previous.current && previous.current.title === event.title
|
|
196
|
+
? null
|
|
197
|
+
: previous.current,
|
|
198
|
+
};
|
|
199
|
+
return { ...state, currentId: event.id, cases: { ...state.cases, [event.id]: next } };
|
|
200
|
+
}
|
|
159
201
|
case 'result': {
|
|
202
|
+
// The file is done: its live per-test detail collapses and the row's
|
|
203
|
+
// verdict pill takes over. A count the event omits falls back to what the
|
|
204
|
+
// per-test stream already counted, rather than silently reading as zero.
|
|
205
|
+
const cases = { ...state.cases };
|
|
206
|
+
const progress = cases[event.id];
|
|
207
|
+
delete cases[event.id];
|
|
160
208
|
return {
|
|
161
209
|
...state,
|
|
210
|
+
cases,
|
|
211
|
+
// Whatever the verdict, the run answered — the Skip the person asked
|
|
212
|
+
// for has either landed or been overtaken.
|
|
213
|
+
skipPending: false,
|
|
162
214
|
results: {
|
|
163
215
|
...state.results,
|
|
164
216
|
[event.id]: {
|
|
165
217
|
status: event.status,
|
|
166
218
|
...(event.durationMs != null ? { durationMs: event.durationMs } : {}),
|
|
167
|
-
passed: event.passed ?? 0,
|
|
168
|
-
failed: event.failed ?? 0,
|
|
169
|
-
skipped: event.skipped ?? 0,
|
|
219
|
+
passed: event.passed ?? progress?.passed ?? 0,
|
|
220
|
+
failed: event.failed ?? progress?.failed ?? 0,
|
|
221
|
+
skipped: event.skipped ?? progress?.skipped ?? 0,
|
|
170
222
|
...(event.output ? { output: event.output } : {}),
|
|
171
223
|
},
|
|
172
224
|
},
|
|
@@ -177,6 +229,8 @@ export function applyTestRunEvent(state, event) {
|
|
|
177
229
|
...state,
|
|
178
230
|
running: false,
|
|
179
231
|
currentId: null,
|
|
232
|
+
cases: {},
|
|
233
|
+
skipPending: false,
|
|
180
234
|
outcome: event.outcome,
|
|
181
235
|
error: event.error ?? null,
|
|
182
236
|
durationMs: event.durationMs ?? (state.startedAt ? Date.now() - state.startedAt : null),
|
|
@@ -186,6 +240,71 @@ export function applyTestRunEvent(state, event) {
|
|
|
186
240
|
return state;
|
|
187
241
|
}
|
|
188
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Record that the person asked to skip what is running. The state only says a
|
|
245
|
+
* request is OUT — the run's own `result` for the skipped file is what actually
|
|
246
|
+
* moves the row, so nothing here can make a skipped file read as anything else.
|
|
247
|
+
*
|
|
248
|
+
* @param state - The current state.
|
|
249
|
+
* @returns The next state, or the same one when there is nothing to skip.
|
|
250
|
+
*/
|
|
251
|
+
export function requestSkip(state) {
|
|
252
|
+
if (!state.running || state.skipPending || state.skipUnavailable)
|
|
253
|
+
return state;
|
|
254
|
+
return { ...state, skipPending: true };
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Record that skipping is not on offer — either the host wired no `skipCurrent`
|
|
258
|
+
* or it answered that the run had already moved on. The control is dropped; the
|
|
259
|
+
* person is not shown an error about a race they did not cause.
|
|
260
|
+
*
|
|
261
|
+
* @param state - The current state.
|
|
262
|
+
* @returns The next state.
|
|
263
|
+
*/
|
|
264
|
+
export function markSkipUnavailable(state) {
|
|
265
|
+
return { ...state, skipPending: false, skipUnavailable: true };
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Whether the host can be asked to skip right now.
|
|
269
|
+
*
|
|
270
|
+
* @param state - The run state.
|
|
271
|
+
* @returns True when a Skip control belongs on screen.
|
|
272
|
+
*/
|
|
273
|
+
export function canSkipRun(state) {
|
|
274
|
+
return state.running && !state.skipUnavailable;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Which row the Skip acts on: the one the stream named as current, or — when it
|
|
278
|
+
* has not named one yet — the single row still awaiting a verdict, because with
|
|
279
|
+
* exactly one candidate there is nothing to be ambiguous about.
|
|
280
|
+
*
|
|
281
|
+
* @param state - The run state.
|
|
282
|
+
* @returns The row's id, or `null` when the run is not on an identifiable row.
|
|
283
|
+
*/
|
|
284
|
+
export function currentRunRowId(state) {
|
|
285
|
+
if (!state.running)
|
|
286
|
+
return null;
|
|
287
|
+
if (state.currentId)
|
|
288
|
+
return state.currentId;
|
|
289
|
+
const pending = state.queued.filter((id) => state.results[id] == null);
|
|
290
|
+
return pending.length === 1 ? pending[0] : null;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The one-line name of the test a file is on: its group and its title, or just
|
|
294
|
+
* its title when the runner gave it no group.
|
|
295
|
+
*
|
|
296
|
+
* @param current - The running test, or `null`.
|
|
297
|
+
* @returns The label, or `` when nothing is named.
|
|
298
|
+
*/
|
|
299
|
+
export function testCaseLabel(current) {
|
|
300
|
+
if (!current)
|
|
301
|
+
return '';
|
|
302
|
+
const title = current.title.trim();
|
|
303
|
+
const describe = current.describe?.trim();
|
|
304
|
+
if (!title)
|
|
305
|
+
return describe ?? '';
|
|
306
|
+
return describe ? `${describe} › ${title}` : title;
|
|
307
|
+
}
|
|
189
308
|
/**
|
|
190
309
|
* The state after a run that never produced a `done` event — the host's stream
|
|
191
310
|
* died, or its request failed before the server could answer.
|
|
@@ -195,7 +314,16 @@ export function applyTestRunEvent(state, event) {
|
|
|
195
314
|
* @returns The next state, no longer running.
|
|
196
315
|
*/
|
|
197
316
|
export function failRun(state, message) {
|
|
198
|
-
return {
|
|
317
|
+
return {
|
|
318
|
+
...state,
|
|
319
|
+
running: false,
|
|
320
|
+
currentId: null,
|
|
321
|
+
cases: {},
|
|
322
|
+
skipPending: false,
|
|
323
|
+
skipUnavailable: true,
|
|
324
|
+
outcome: 'error',
|
|
325
|
+
error: message,
|
|
326
|
+
};
|
|
199
327
|
}
|
|
200
328
|
/**
|
|
201
329
|
* Whether a row should render as "running": the run is live and either the host
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests-card-utilities.js","sourceRoot":"","sources":["../../src/components/tests-card-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmDH,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAEnC,oFAAoF;AACpF,MAAM,UAAU,GAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;AAEvD;;;;;;;GAOG;AACH,SAAS,iBAAiB,CAAC,CAAgB,EAAE,CAAgB;IAC3D,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAA;IACrB,IAAI,CAAC,KAAK,GAAG;QAAE,OAAO,CAAC,CAAA;IACvB,IAAI,CAAC,KAAK,GAAG;QAAE,OAAO,CAAC,CAAC,CAAA;IACxB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,IAAc;IAC9B,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,cAAc,CAAA;IACjE,OAAO,IAAI,CAAC,SAAS,KAAK,GAAG,C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,+CAA+C,CAChD,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,KAA0B,EAC1B,OAAwC;IAExC,MAAM,QAAQ,GAAkB,EAAE,CAAA;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC9B,IAAI,KAAK,EAAE,MAAM,KAAK,QAAQ;YAAE,SAAQ;QACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;IAC/C,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -56,6 +56,19 @@ export declare function moleculeDocPath(packageName: string | undefined): string
|
|
|
56
56
|
* @returns A formatted label string with backtick-wrapped filenames.
|
|
57
57
|
*/
|
|
58
58
|
export declare function toolLabel(name: string, input: unknown): string;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a tool result says the PERSON skipped this call.
|
|
61
|
+
*
|
|
62
|
+
* It is the honest third outcome, and it has to be recognisable on sight:
|
|
63
|
+
* a skipped call did not fail (nothing went wrong) and it did not succeed
|
|
64
|
+
* (the work never happened). Reading it as either one is the lie this
|
|
65
|
+
* predicate exists to prevent — so the summary word, the status dot, and the
|
|
66
|
+
* card's error handling all ask here rather than each deciding for themselves.
|
|
67
|
+
*
|
|
68
|
+
* @param output - The raw tool output payload.
|
|
69
|
+
* @returns True when the call was skipped by the user.
|
|
70
|
+
*/
|
|
71
|
+
export declare function isSkippedByUser(output: unknown): boolean;
|
|
59
72
|
/**
|
|
60
73
|
* One-line result summary shown beneath the label.
|
|
61
74
|
* @param name - The tool name.
|
|
@@ -64,33 +77,94 @@ export declare function toolLabel(name: string, input: unknown): string;
|
|
|
64
77
|
* @returns A brief summary string describing the result.
|
|
65
78
|
*/
|
|
66
79
|
export declare function toolSummary(name: string, output: ToolOutput, status: string): string;
|
|
80
|
+
/** A single `ask_user` option after coercion — label is always safe as a React child. */
|
|
81
|
+
export interface AskUserOption {
|
|
82
|
+
/** The clickable answer text — also the string sent back as the response. */
|
|
83
|
+
label: string;
|
|
84
|
+
/** One-line explanation rendered under the label (rich options only). */
|
|
85
|
+
description?: string;
|
|
86
|
+
/** Markdown artifact shown side-by-side for comparing options (rich options only). */
|
|
87
|
+
preview?: string;
|
|
88
|
+
}
|
|
67
89
|
/** The `ask_user` tool input, after coercion — every field safe to render. */
|
|
68
90
|
export interface AskUserInput {
|
|
69
91
|
/** The question text (markdown). */
|
|
70
92
|
question: string;
|
|
71
|
-
/** Clickable answers
|
|
72
|
-
options:
|
|
93
|
+
/** Clickable answers; a plain string or a rich { label, description?, preview? }. */
|
|
94
|
+
options: AskUserOption[];
|
|
95
|
+
/** Checkboxes — several options may be chosen at once. */
|
|
96
|
+
multiSelect: boolean;
|
|
73
97
|
/** Whether the free-text box is offered. `undefined` means "model didn't say" (defaults on). */
|
|
74
98
|
allowFreeText: boolean | undefined;
|
|
75
99
|
/** Optional hint shown under the options. */
|
|
76
100
|
hint: string;
|
|
101
|
+
/** Present only on the plan-approval card — renders the rich review layout. */
|
|
102
|
+
planReview: AskUserPlanReview | undefined;
|
|
103
|
+
}
|
|
104
|
+
/** Plan-review metadata carried by the plan-approval ask_user card. */
|
|
105
|
+
export interface AskUserPlanReview {
|
|
106
|
+
/** Plan file path relative to the workspace (clickable in the card). */
|
|
107
|
+
path: string | null;
|
|
108
|
+
/** The plan's display name, when the model gave one. */
|
|
109
|
+
name: string | null;
|
|
110
|
+
/** Total checklist steps in the plan. */
|
|
111
|
+
steps: number;
|
|
112
|
+
/** First few checklist step texts, for the in-card preview. */
|
|
113
|
+
preview: string[];
|
|
77
114
|
}
|
|
78
115
|
/**
|
|
79
116
|
* Normalize raw `ask_user` tool input into renderable strings.
|
|
80
117
|
*
|
|
81
|
-
* The model is told `options` is
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
118
|
+
* The model is told `options` is a list of strings or `{ label, description?,
|
|
119
|
+
* preview? }` objects, and weaker models routinely send stranger shapes —
|
|
120
|
+
* `[{ label, value }]`, nested arrays, quote-escaped pseudo-JSON. Rendering one
|
|
121
|
+
* of those directly is React error #31, which crashes the entire IDE at the
|
|
122
|
+
* moment the user submits their first prompt. Everything the card renders goes
|
|
123
|
+
* through here.
|
|
85
124
|
*
|
|
86
125
|
* @param input - The raw tool input, straight off the model.
|
|
87
126
|
* @returns The same fields, coerced so each is safe as a React child.
|
|
88
127
|
*/
|
|
89
128
|
export declare function normalizeAskUserInput(input: unknown): AskUserInput;
|
|
129
|
+
/** One row of an `update_task_list` call, after coercion — safe to render. */
|
|
130
|
+
export interface TaskListRow {
|
|
131
|
+
content: string;
|
|
132
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
133
|
+
priority?: 'high' | 'medium' | 'low';
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Coerce raw `update_task_list` input into renderable rows. The input comes
|
|
137
|
+
* straight off the model — every field is degraded to a safe default rather
|
|
138
|
+
* than rendered raw (same contract as `normalizeAskUserInput`).
|
|
139
|
+
*
|
|
140
|
+
* @param input - The raw tool input.
|
|
141
|
+
* @returns The rows worth rendering; empty when the model sent nothing usable.
|
|
142
|
+
*/
|
|
143
|
+
export declare function normalizeTaskListInput(input: unknown): TaskListRow[];
|
|
144
|
+
/** A parsed judge-subagent verdict. */
|
|
145
|
+
export interface JudgeVerdict {
|
|
146
|
+
verdict: 'PASS' | 'FAIL';
|
|
147
|
+
/** Concrete failure lines (the `- one line per failure` block under ISSUES:). */
|
|
148
|
+
issues: string[];
|
|
149
|
+
/** The report with the verdict scaffold stripped, for the expandable body. */
|
|
150
|
+
rest: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Parse a judge subagent's report into a structured verdict.
|
|
154
|
+
*
|
|
155
|
+
* The judge system prompt fixes the shape (`VERDICT: PASS|FAIL` then optional
|
|
156
|
+
* `ISSUES:` bullets then per-criterion evidence), but the model is the author —
|
|
157
|
+
* parse defensively (case-insensitive, leading whitespace tolerated) and return
|
|
158
|
+
* `null` when no verdict line is present so the card renders the plain report.
|
|
159
|
+
*
|
|
160
|
+
* @param report - The judge subagent's final report text.
|
|
161
|
+
* @returns The structured verdict, or null when the report carries none.
|
|
162
|
+
*/
|
|
163
|
+
export declare function parseJudgeVerdict(report: string): JudgeVerdict | null;
|
|
90
164
|
/**
|
|
91
165
|
* Count truly added/removed lines between two line arrays using LCS.
|
|
92
166
|
* @param oldLines - The original lines array.
|
|
93
|
-
* @param
|
|
167
|
+
* @param modifiedLines - The modified lines array.
|
|
94
168
|
* @returns An object with the number of added and removed lines.
|
|
95
169
|
*/
|
|
96
170
|
export declare function diffLineCount(oldLines: string[], newLines: string[]): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-utilities.d.ts","sourceRoot":"","sources":["../../src/components/tool-call-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,6BAA6B;AAC7B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE5E;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAItD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOtD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGzD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK9E;AAOD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE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AC3B,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAAE,GACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAcpC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,OAAO,GACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAyB3C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAgB3E"}
|
|
@@ -189,6 +189,14 @@ export function toolLabel(name, input) {
|
|
|
189
189
|
}
|
|
190
190
|
case 'ask_user':
|
|
191
191
|
return normalizeAskUserInput(inp).question || 'Question';
|
|
192
|
+
case 'spawn_agent': {
|
|
193
|
+
const kind = str(inp.type) ?? '';
|
|
194
|
+
return kind === 'judge' ? 'Subagent — acceptance judge' : 'Subagent — research';
|
|
195
|
+
}
|
|
196
|
+
case 'update_task_list': {
|
|
197
|
+
const rows = normalizeTaskListInput(inp);
|
|
198
|
+
return rows.length > 0 ? `Working plan — ${rows.length} tasks` : 'Working plan';
|
|
199
|
+
}
|
|
192
200
|
default: {
|
|
193
201
|
const label = name.replace(/_/g, ' ');
|
|
194
202
|
// Salient-argument fallback for tools without an explicit case: nearly every
|
|
@@ -199,6 +207,23 @@ export function toolLabel(name, input) {
|
|
|
199
207
|
}
|
|
200
208
|
}
|
|
201
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Whether a tool result says the PERSON skipped this call.
|
|
212
|
+
*
|
|
213
|
+
* It is the honest third outcome, and it has to be recognisable on sight:
|
|
214
|
+
* a skipped call did not fail (nothing went wrong) and it did not succeed
|
|
215
|
+
* (the work never happened). Reading it as either one is the lie this
|
|
216
|
+
* predicate exists to prevent — so the summary word, the status dot, and the
|
|
217
|
+
* card's error handling all ask here rather than each deciding for themselves.
|
|
218
|
+
*
|
|
219
|
+
* @param output - The raw tool output payload.
|
|
220
|
+
* @returns True when the call was skipped by the user.
|
|
221
|
+
*/
|
|
222
|
+
export function isSkippedByUser(output) {
|
|
223
|
+
if (typeof output !== 'object' || output === null)
|
|
224
|
+
return false;
|
|
225
|
+
return output.status === 'skipped_by_user';
|
|
226
|
+
}
|
|
202
227
|
/**
|
|
203
228
|
* One-line result summary shown beneath the label.
|
|
204
229
|
* @param name - The tool name.
|
|
@@ -211,6 +236,11 @@ export function toolSummary(name, output, status) {
|
|
|
211
236
|
return '';
|
|
212
237
|
if (status === 'running')
|
|
213
238
|
return t('ide.toolCall.statusRunning', undefined, { defaultValue: 'Running' });
|
|
239
|
+
// Checked BEFORE every per-tool branch: a skipped `exec_command` carries no
|
|
240
|
+
// exit code and a skipped `write_file` no diff, so the branches below would
|
|
241
|
+
// fall through to the empty summary that means "it worked".
|
|
242
|
+
if (isSkippedByUser(output))
|
|
243
|
+
return t('ide.toolCall.statusSkipped', undefined, { defaultValue: 'Skipped' });
|
|
214
244
|
const out = output;
|
|
215
245
|
const hasError = typeof out === 'object' && out !== null && 'error' in out;
|
|
216
246
|
if (hasError) {
|
|
@@ -423,13 +453,61 @@ function coerceToText(value) {
|
|
|
423
453
|
}
|
|
424
454
|
return '';
|
|
425
455
|
}
|
|
456
|
+
/** Coerce the plan-approval card's `planReview` payload (hostile-safe). */
|
|
457
|
+
function normalizePlanReview(raw) {
|
|
458
|
+
if (raw == null || typeof raw !== 'object' || Array.isArray(raw))
|
|
459
|
+
return undefined;
|
|
460
|
+
const record = raw;
|
|
461
|
+
const path = typeof record.path === 'string' && record.path.trim() ? record.path : null;
|
|
462
|
+
const name = typeof record.name === 'string' && record.name.trim() ? record.name : null;
|
|
463
|
+
const steps = Number.isFinite(Number(record.steps)) ? Math.max(0, Number(record.steps)) : 0;
|
|
464
|
+
const preview = Array.isArray(record.preview)
|
|
465
|
+
? record.preview
|
|
466
|
+
.map((line) => coerceToText(line).slice(0, 160))
|
|
467
|
+
.filter((line) => line.trim() !== '')
|
|
468
|
+
.slice(0, 8)
|
|
469
|
+
: [];
|
|
470
|
+
if (!path && !name && steps === 0)
|
|
471
|
+
return undefined;
|
|
472
|
+
return { path, name, steps, preview };
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Normalize one raw option (string or object) into an `AskUserOption`.
|
|
476
|
+
*
|
|
477
|
+
* The object form is the schema-sanctioned rich option, but the same recovery
|
|
478
|
+
* rules as `coerceToText` apply — a malformed object without a `label` still
|
|
479
|
+
* yields SOMETHING clickable (via the known text keys, or the JSON dump) rather
|
|
480
|
+
* than being dropped, so the user is never left with fewer answers than the
|
|
481
|
+
* model meant to offer.
|
|
482
|
+
*/
|
|
483
|
+
function normalizeAskUserOption(raw) {
|
|
484
|
+
if (raw != null && typeof raw === 'object' && !Array.isArray(raw)) {
|
|
485
|
+
const record = raw;
|
|
486
|
+
const label = coerceToText(record.label).trim()
|
|
487
|
+
? coerceToText(record.label)
|
|
488
|
+
: coerceToText(record);
|
|
489
|
+
if (!label.trim())
|
|
490
|
+
return null;
|
|
491
|
+
return {
|
|
492
|
+
label,
|
|
493
|
+
description: coerceToText(record.description).trim()
|
|
494
|
+
? coerceToText(record.description)
|
|
495
|
+
: undefined,
|
|
496
|
+
preview: coerceToText(record.preview).trim() ? coerceToText(record.preview) : undefined,
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
const label = coerceToText(raw);
|
|
500
|
+
return label.trim() ? { label } : null;
|
|
501
|
+
}
|
|
426
502
|
/**
|
|
427
503
|
* Normalize raw `ask_user` tool input into renderable strings.
|
|
428
504
|
*
|
|
429
|
-
* The model is told `options` is
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
505
|
+
* The model is told `options` is a list of strings or `{ label, description?,
|
|
506
|
+
* preview? }` objects, and weaker models routinely send stranger shapes —
|
|
507
|
+
* `[{ label, value }]`, nested arrays, quote-escaped pseudo-JSON. Rendering one
|
|
508
|
+
* of those directly is React error #31, which crashes the entire IDE at the
|
|
509
|
+
* moment the user submits their first prompt. Everything the card renders goes
|
|
510
|
+
* through here.
|
|
433
511
|
*
|
|
434
512
|
* @param input - The raw tool input, straight off the model.
|
|
435
513
|
* @returns The same fields, coerced so each is safe as a React child.
|
|
@@ -439,15 +517,77 @@ export function normalizeAskUserInput(input) {
|
|
|
439
517
|
const rawOptions = Array.isArray(raw.options) ? raw.options : [];
|
|
440
518
|
return {
|
|
441
519
|
question: coerceToText(raw.question),
|
|
442
|
-
options: rawOptions
|
|
520
|
+
options: rawOptions
|
|
521
|
+
.map(normalizeAskUserOption)
|
|
522
|
+
.filter((option) => option !== null),
|
|
523
|
+
multiSelect: typeof raw.multiSelect === 'boolean' ? raw.multiSelect : false,
|
|
443
524
|
allowFreeText: typeof raw.allowFreeText === 'boolean' ? raw.allowFreeText : undefined,
|
|
444
525
|
hint: coerceToText(raw.hint),
|
|
526
|
+
planReview: normalizePlanReview(raw.planReview),
|
|
445
527
|
};
|
|
446
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* Coerce raw `update_task_list` input into renderable rows. The input comes
|
|
531
|
+
* straight off the model — every field is degraded to a safe default rather
|
|
532
|
+
* than rendered raw (same contract as `normalizeAskUserInput`).
|
|
533
|
+
*
|
|
534
|
+
* @param input - The raw tool input.
|
|
535
|
+
* @returns The rows worth rendering; empty when the model sent nothing usable.
|
|
536
|
+
*/
|
|
537
|
+
export function normalizeTaskListInput(input) {
|
|
538
|
+
const raw = (input ?? {});
|
|
539
|
+
if (!Array.isArray(raw.todos))
|
|
540
|
+
return [];
|
|
541
|
+
const rows = [];
|
|
542
|
+
for (const entry of raw.todos.slice(0, 50)) {
|
|
543
|
+
if (entry == null || typeof entry !== 'object' || Array.isArray(entry))
|
|
544
|
+
continue;
|
|
545
|
+
const record = entry;
|
|
546
|
+
const content = coerceToText(record.content);
|
|
547
|
+
if (!content.trim())
|
|
548
|
+
continue;
|
|
549
|
+
const status = record.status === 'in_progress' || record.status === 'completed'
|
|
550
|
+
? record.status
|
|
551
|
+
: 'pending';
|
|
552
|
+
const priority = record.priority === 'high' || record.priority === 'medium' || record.priority === 'low'
|
|
553
|
+
? record.priority
|
|
554
|
+
: undefined;
|
|
555
|
+
rows.push({ content: content.slice(0, 200), status, priority });
|
|
556
|
+
}
|
|
557
|
+
return rows;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Parse a judge subagent's report into a structured verdict.
|
|
561
|
+
*
|
|
562
|
+
* The judge system prompt fixes the shape (`VERDICT: PASS|FAIL` then optional
|
|
563
|
+
* `ISSUES:` bullets then per-criterion evidence), but the model is the author —
|
|
564
|
+
* parse defensively (case-insensitive, leading whitespace tolerated) and return
|
|
565
|
+
* `null` when no verdict line is present so the card renders the plain report.
|
|
566
|
+
*
|
|
567
|
+
* @param report - The judge subagent's final report text.
|
|
568
|
+
* @returns The structured verdict, or null when the report carries none.
|
|
569
|
+
*/
|
|
570
|
+
export function parseJudgeVerdict(report) {
|
|
571
|
+
const verdictMatch = report.match(/^\s*VERDICT:\s*(PASS|FAIL)\b/im);
|
|
572
|
+
if (!verdictMatch)
|
|
573
|
+
return null;
|
|
574
|
+
const verdict = verdictMatch[1].toUpperCase();
|
|
575
|
+
const withoutVerdict = report
|
|
576
|
+
.slice(verdictMatch.index + verdictMatch[0].length)
|
|
577
|
+
.replace(/^\s*VERDICT:\s*(?:PASS|FAIL)\b.*$/im, '');
|
|
578
|
+
const issuesBlock = withoutVerdict.match(/ISSUES:\s*\n?([\s\S]*?)(?=\n\s*\n|\n[A-Z]|\n-[^-]|$)/i);
|
|
579
|
+
const issues = (issuesBlock?.[1] ?? '')
|
|
580
|
+
.split('\n')
|
|
581
|
+
.map((line) => line.replace(/^\s*[-•*]\s*/, '').trim())
|
|
582
|
+
.filter((line) => line.length > 0)
|
|
583
|
+
.slice(0, 12);
|
|
584
|
+
const rest = withoutVerdict.replace(/^\s*ISSUES:\s*\n?/i, '').trim();
|
|
585
|
+
return { verdict, issues, rest };
|
|
586
|
+
}
|
|
447
587
|
/**
|
|
448
588
|
* Count truly added/removed lines between two line arrays using LCS.
|
|
449
589
|
* @param oldLines - The original lines array.
|
|
450
|
-
* @param
|
|
590
|
+
* @param modifiedLines - The modified lines array.
|
|
451
591
|
* @returns An object with the number of added and removed lines.
|
|
452
592
|
*/
|
|
453
593
|
export function diffLineCount(oldLines, newLines) {
|