@molecule/app-ide-react 1.20.0 → 1.20.2
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/components/BackgroundTasksStrip.d.ts +6 -3
- package/dist/components/BackgroundTasksStrip.d.ts.map +1 -1
- package/dist/components/BackgroundTasksStrip.js +18 -10
- package/dist/components/BackgroundTasksStrip.js.map +1 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +111 -131
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/components/DockStrip.d.ts +55 -0
- package/dist/components/DockStrip.d.ts.map +1 -0
- package/dist/components/DockStrip.js +90 -0
- package/dist/components/DockStrip.js.map +1 -0
- package/dist/components/PlanCard.d.ts +26 -0
- package/dist/components/PlanCard.d.ts.map +1 -0
- package/dist/components/PlanCard.js +58 -0
- package/dist/components/PlanCard.js.map +1 -0
- package/dist/components/PlanStatusIcon.d.ts +15 -0
- package/dist/components/PlanStatusIcon.d.ts.map +1 -0
- package/dist/components/PlanStatusIcon.js +32 -0
- package/dist/components/PlanStatusIcon.js.map +1 -0
- package/dist/components/TestStatusBar.d.ts.map +1 -1
- package/dist/components/TestStatusBar.js +13 -42
- package/dist/components/TestStatusBar.js.map +1 -1
- package/dist/components/ToolCallCard.d.ts.map +1 -1
- package/dist/components/ToolCallCard.js +22 -61
- package/dist/components/ToolCallCard.js.map +1 -1
- package/dist/components/tool-call-utilities.d.ts.map +1 -1
- package/dist/components/tool-call-utilities.js +7 -0
- package/dist/components/tool-call-utilities.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The strips stacked above the composer — working plan, background tasks, tests,
|
|
3
|
+
* uncommitted files — are one family. {@link DockStrip} is their shared chrome
|
|
4
|
+
* (hairline top border, chevron, muted label, right-hand actions, indented
|
|
5
|
+
* detail) and {@link StatusMark} is their shared status icon, so they cannot
|
|
6
|
+
* drift apart.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { JSX, ReactNode } from 'react';
|
|
11
|
+
/** The states a strip row can be in. */
|
|
12
|
+
export type StatusMarkState = 'done' | 'active' | 'todo' | 'failed';
|
|
13
|
+
/**
|
|
14
|
+
* One status icon for every strip row: the landing page's green check circle
|
|
15
|
+
* when done, the platform's molecule spinner while active, a red crossed circle
|
|
16
|
+
* when failed, an empty ring when still to do.
|
|
17
|
+
* @param props - Component props.
|
|
18
|
+
* @param props.state - The row's state.
|
|
19
|
+
* @param props.size - Pixel size (default 16).
|
|
20
|
+
* @returns The icon.
|
|
21
|
+
*/
|
|
22
|
+
export declare function StatusMark({ state, size, }: {
|
|
23
|
+
state: StatusMarkState;
|
|
24
|
+
size?: number;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
/** Props for {@link DockStrip}. */
|
|
27
|
+
export interface DockStripProps {
|
|
28
|
+
/** `data-mol-id` of the strip root. */
|
|
29
|
+
molId: string;
|
|
30
|
+
/** `data-mol-id` of the clickable header row. */
|
|
31
|
+
toggleMolId?: string;
|
|
32
|
+
/** Whether the detail is shown. */
|
|
33
|
+
expanded: boolean;
|
|
34
|
+
/** Toggle the detail. */
|
|
35
|
+
onToggle: () => void;
|
|
36
|
+
/** Leading icon, before the label. */
|
|
37
|
+
icon?: ReactNode;
|
|
38
|
+
/** The strip's one-line summary. */
|
|
39
|
+
label: ReactNode;
|
|
40
|
+
/** Quieter text after the label (the thing in flight). */
|
|
41
|
+
hint?: ReactNode;
|
|
42
|
+
/** Right-hand readout and action buttons; clicks must stop propagation. */
|
|
43
|
+
actions?: ReactNode;
|
|
44
|
+
/** Extra attributes for the root (e.g. a tone `data-*`). */
|
|
45
|
+
rootProps?: Record<string, string>;
|
|
46
|
+
/** The detail shown when expanded. */
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Shared chrome for the strips above the composer.
|
|
51
|
+
* @param props - See {@link DockStripProps}.
|
|
52
|
+
* @returns The strip.
|
|
53
|
+
*/
|
|
54
|
+
export declare function DockStrip({ molId, toggleMolId, expanded, onToggle, icon, label, hint, actions, rootProps, children, }: DockStripProps): JSX.Element;
|
|
55
|
+
//# sourceMappingURL=DockStrip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DockStrip.d.ts","sourceRoot":"","sources":["../../src/components/DockStrip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAS3C,wCAAwC;AACxC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;AAEnE;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAgB,GACjB,EAAE;IACD,KAAK,EAAE,eAAe,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,GAAG,CAAC,OAAO,CAoEd;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,CAAA;IACjB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,sCAAsC;IACtC,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,oCAAoC;IACpC,KAAK,EAAE,SAAS,CAAA;IAChB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAsF9B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { useThemeMode } from '@molecule/app-react';
|
|
4
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
5
|
+
import { moleculeSpinnerMarkSvg } from '@molecule/app-ui';
|
|
6
|
+
const MARK_SIZE = 16;
|
|
7
|
+
/**
|
|
8
|
+
* One status icon for every strip row: the landing page's green check circle
|
|
9
|
+
* when done, the platform's molecule spinner while active, a red crossed circle
|
|
10
|
+
* when failed, an empty ring when still to do.
|
|
11
|
+
* @param props - Component props.
|
|
12
|
+
* @param props.state - The row's state.
|
|
13
|
+
* @param props.size - Pixel size (default 16).
|
|
14
|
+
* @returns The icon.
|
|
15
|
+
*/
|
|
16
|
+
export function StatusMark({ state, size = MARK_SIZE, }) {
|
|
17
|
+
const isLight = useThemeMode() === 'light';
|
|
18
|
+
const gradientId = `mol-mark-spinner-${useId().replace(/[:]/g, '')}`;
|
|
19
|
+
if (state === 'active') {
|
|
20
|
+
return (_jsx("span", { "aria-hidden": true, style: { display: 'inline-flex', flexShrink: 0 }, dangerouslySetInnerHTML: { __html: moleculeSpinnerMarkSvg({ size, gradientId }) } }));
|
|
21
|
+
}
|
|
22
|
+
if (state === 'todo') {
|
|
23
|
+
return (_jsx("span", { "aria-hidden": true, style: {
|
|
24
|
+
display: 'inline-block',
|
|
25
|
+
flexShrink: 0,
|
|
26
|
+
boxSizing: 'border-box',
|
|
27
|
+
width: size,
|
|
28
|
+
height: size,
|
|
29
|
+
borderRadius: '50%',
|
|
30
|
+
border: `1.5px solid ${isLight ? '#afb8c1' : '#6e7681'}`,
|
|
31
|
+
} }));
|
|
32
|
+
}
|
|
33
|
+
const failed = state === 'failed';
|
|
34
|
+
const ink = failed ? (isLight ? '#cf222e' : '#f47067') : isLight ? '#1e7a00' : '#5bb98c';
|
|
35
|
+
const tint = failed
|
|
36
|
+
? isLight
|
|
37
|
+
? 'rgba(207, 34, 46, 0.1)'
|
|
38
|
+
: 'rgba(244, 112, 103, 0.16)'
|
|
39
|
+
: isLight
|
|
40
|
+
? 'rgba(30, 122, 0, 0.12)'
|
|
41
|
+
: 'rgba(91, 185, 140, 0.16)';
|
|
42
|
+
return (_jsx("span", { "aria-hidden": true, style: {
|
|
43
|
+
display: 'inline-flex',
|
|
44
|
+
flexShrink: 0,
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
boxSizing: 'border-box',
|
|
48
|
+
width: size,
|
|
49
|
+
height: size,
|
|
50
|
+
borderRadius: '50%',
|
|
51
|
+
border: `1px solid ${ink}`,
|
|
52
|
+
color: ink,
|
|
53
|
+
background: tint,
|
|
54
|
+
}, children: _jsx("svg", { width: size * 0.56, height: size * 0.56, viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: failed ? 'M2.5 2.5 7.5 7.5M7.5 2.5 2.5 7.5' : 'M2 5.2 4 7.2 8 3' }) }) }));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Shared chrome for the strips above the composer.
|
|
58
|
+
* @param props - See {@link DockStripProps}.
|
|
59
|
+
* @returns The strip.
|
|
60
|
+
*/
|
|
61
|
+
export function DockStrip({ molId, toggleMolId, expanded, onToggle, icon, label, hint, actions, rootProps, children, }) {
|
|
62
|
+
const cm = getClassMap();
|
|
63
|
+
return (_jsxs("div", { "data-mol-id": molId, ...rootProps, style: { borderTop: '1px solid rgba(128,128,128,0.15)', padding: '8px 8px 8px 10px' }, children: [_jsxs("div", { role: "button", tabIndex: 0, "data-mol-id": toggleMolId, "aria-expanded": expanded, onClick: onToggle, onKeyDown: (e) => {
|
|
64
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
onToggle();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
/* mol-bespoke-button: the strip's HEADER ROW — chevron, label and
|
|
70
|
+
actions on one disclosure line; its real buttons are the actions. */
|
|
71
|
+
style: {
|
|
72
|
+
display: 'flex',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'space-between',
|
|
75
|
+
gap: 8,
|
|
76
|
+
cursor: 'pointer',
|
|
77
|
+
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 }, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "12", height: "12", "aria-hidden": true, style: {
|
|
78
|
+
transform: expanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
79
|
+
transition: 'transform 120ms',
|
|
80
|
+
opacity: 0.5,
|
|
81
|
+
flexShrink: 0,
|
|
82
|
+
}, children: _jsx("path", { d: "M6 4l4 4-4 4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), icon, _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }, children: label }), hint ? (_jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: {
|
|
83
|
+
opacity: 0.75,
|
|
84
|
+
whiteSpace: 'nowrap',
|
|
85
|
+
overflow: 'hidden',
|
|
86
|
+
textOverflow: 'ellipsis',
|
|
87
|
+
minWidth: 0,
|
|
88
|
+
}, children: hint })) : null] }), actions ? (_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0 }, children: actions })) : null] }), expanded && children ? (_jsx("div", { style: { marginTop: 6, paddingLeft: 18 }, children: children })) : null] }));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=DockStrip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DockStrip.js","sourceRoot":"","sources":["../../src/components/DockStrip.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,MAAM,SAAS,GAAG,EAAE,CAAA;AAKpB;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,GAAG,SAAS,GAIjB;IACC,MAAM,OAAO,GAAG,YAAY,EAAE,KAAK,OAAO,CAAA;IAC1C,MAAM,UAAU,GAAG,oBAAoB,KAAK,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAA;IACpE,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,CACL,oCAEE,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,EAAE,EAChD,uBAAuB,EAAE,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,GACjF,CACH,CAAA;IACH,CAAC;IACD,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACrB,OAAO,CACL,oCAEE,KAAK,EAAE;gBACL,OAAO,EAAE,cAAc;gBACvB,UAAU,EAAE,CAAC;gBACb,SAAS,EAAE,YAAY;gBACvB,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,YAAY,EAAE,KAAK;gBACnB,MAAM,EAAE,eAAe,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC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ACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,EACL,IAAI,EACL,eACE,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EACjD,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,YAE5E,KAAK,GACD,EACN,IAAI,CAAC,CAAC,CAAC,CACN,eACE,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EACjD,KAAK,EAAE;oCACL,OAAO,EAAE,IAAI;oCACb,UAAU,EAAE,QAAQ;oCACpB,QAAQ,EAAE,QAAQ;oCAClB,YAAY,EAAE,UAAU;oCACxB,QAAQ,EAAE,CAAC;iCACZ,YAEA,IAAI,GACA,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,YACzE,OAAO,GACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,CACtB,cAAK,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,YAAG,QAAQ,GAAO,CAChE,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import { type TaskListRow } from './tool-call-utilities.js';
|
|
3
|
+
/**
|
|
4
|
+
* The working plan, one of the strips above the composer. It is not part of the
|
|
5
|
+
* transcript: every `update_task_list` call re-draws this one strip instead of
|
|
6
|
+
* adding a new card to the chat.
|
|
7
|
+
* @param props - Component props.
|
|
8
|
+
* @param props.todos - The latest task list.
|
|
9
|
+
* @returns The plan strip, or nothing when the list is empty.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PlanCard({ todos }: {
|
|
12
|
+
todos: ReadonlyArray<TaskListRow>;
|
|
13
|
+
}): JSX.Element | null;
|
|
14
|
+
/**
|
|
15
|
+
* The latest plan in a transcript: the most recent `update_task_list` call's
|
|
16
|
+
* task list, which replaces the earlier ones.
|
|
17
|
+
* @param messages - The transcript's messages (only their tool calls are read).
|
|
18
|
+
* @returns The latest task list, or an empty list when there is none.
|
|
19
|
+
*/
|
|
20
|
+
export declare function latestPlan(messages: ReadonlyArray<{
|
|
21
|
+
toolCalls?: ReadonlyArray<{
|
|
22
|
+
name?: string;
|
|
23
|
+
input?: unknown;
|
|
24
|
+
}>;
|
|
25
|
+
}>): TaskListRow[];
|
|
26
|
+
//# sourceMappingURL=PlanCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanCard.d.ts","sourceRoot":"","sources":["../../src/components/PlanCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAOhC,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAQnF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAyD7F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAC9D,CAAC,GACD,WAAW,EAAE,CAUf"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { t } from '@molecule/app-i18n';
|
|
4
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
5
|
+
import { DockStrip, StatusMark } from './DockStrip.js';
|
|
6
|
+
import { normalizeTaskListInput } from './tool-call-utilities.js';
|
|
7
|
+
const MARK = {
|
|
8
|
+
completed: 'done',
|
|
9
|
+
in_progress: 'active',
|
|
10
|
+
pending: 'todo',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The working plan, one of the strips above the composer. It is not part of the
|
|
14
|
+
* transcript: every `update_task_list` call re-draws this one strip instead of
|
|
15
|
+
* adding a new card to the chat.
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.todos - The latest task list.
|
|
18
|
+
* @returns The plan strip, or nothing when the list is empty.
|
|
19
|
+
*/
|
|
20
|
+
export function PlanCard({ todos }) {
|
|
21
|
+
const cm = getClassMap();
|
|
22
|
+
const [expanded, setExpanded] = useState(true);
|
|
23
|
+
if (todos.length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
const completed = todos.filter((todo) => todo.status === 'completed').length;
|
|
26
|
+
const current = todos.find((todo) => todo.status === 'in_progress');
|
|
27
|
+
return (_jsx(DockStrip, { molId: "task-list-card", toggleMolId: "task-list-toggle", expanded: expanded, onToggle: () => setExpanded((open) => !open), label: t('ide.chat.taskListTitle', undefined, { defaultValue: 'Working plan' }), hint: !expanded && current ? `· ${current.content}` : undefined, actions: _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { whiteSpace: 'nowrap' }, children: t('ide.chat.taskListProgress', { done: completed, total: todos.length }, { defaultValue: '{{done}} of {{total}} done' }) }), children: _jsx("div", { style: { maxHeight: '168px', overflowY: 'auto' }, children: todos.map((todo, i) => (_jsxs("div", { "data-mol-id": "task-list-row", className: cm.textSize('xs'), style: {
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignItems: 'flex-start',
|
|
30
|
+
gap: 8,
|
|
31
|
+
padding: '3px 0',
|
|
32
|
+
...(todo.status === 'completed' ? { opacity: 0.55 } : {}),
|
|
33
|
+
}, children: [_jsx("span", { style: { flexShrink: 0, display: 'inline-flex', paddingTop: 1 }, children: _jsx(StatusMark, { state: MARK[todo.status] }) }), _jsx("span", { style: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
minWidth: 0,
|
|
36
|
+
...(todo.status === 'completed' ? { textDecoration: 'line-through' } : {}),
|
|
37
|
+
}, children: todo.content })] }, i))) }) }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The latest plan in a transcript: the most recent `update_task_list` call's
|
|
41
|
+
* task list, which replaces the earlier ones.
|
|
42
|
+
* @param messages - The transcript's messages (only their tool calls are read).
|
|
43
|
+
* @returns The latest task list, or an empty list when there is none.
|
|
44
|
+
*/
|
|
45
|
+
export function latestPlan(messages) {
|
|
46
|
+
for (let m = messages.length - 1; m >= 0; m--) {
|
|
47
|
+
const calls = messages[m].toolCalls ?? [];
|
|
48
|
+
for (let c = calls.length - 1; c >= 0; c--) {
|
|
49
|
+
if (calls[c].name !== 'update_task_list')
|
|
50
|
+
continue;
|
|
51
|
+
const rows = normalizeTaskListInput(calls[c].input);
|
|
52
|
+
if (rows.length > 0)
|
|
53
|
+
return rows;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=PlanCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanCard.js","sourceRoot":"","sources":["../../src/components/PlanCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM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AED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,QAEE;IAEF,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAA;QACzC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAkB;gBAAE,SAAQ;YAClD,MAAM,IAAI,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;YACnD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAA;QAClC,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Status mark for one row of the working-plan card: the platform's check icon
|
|
4
|
+
* when done, its molecule spinner while in progress, and an empty ring while
|
|
5
|
+
* still to do.
|
|
6
|
+
* @param props - Component props.
|
|
7
|
+
* @param props.status - The task's status.
|
|
8
|
+
* @param props.isLight - Whether the light theme is active (ring colour).
|
|
9
|
+
* @returns The status mark.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PlanStatusIcon({ status, isLight, }: {
|
|
12
|
+
status: string;
|
|
13
|
+
isLight: boolean;
|
|
14
|
+
}): JSX.Element;
|
|
15
|
+
//# sourceMappingURL=PlanStatusIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanStatusIcon.d.ts","sourceRoot":"","sources":["../../src/components/PlanStatusIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAShC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,GAAG,CAAC,OAAO,CA2Bd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { moleculeSpinnerMarkSvg } from '@molecule/app-ui';
|
|
4
|
+
import { Icon } from './Icon.js';
|
|
5
|
+
const SIZE = 14;
|
|
6
|
+
/**
|
|
7
|
+
* Status mark for one row of the working-plan card: the platform's check icon
|
|
8
|
+
* when done, its molecule spinner while in progress, and an empty ring while
|
|
9
|
+
* still to do.
|
|
10
|
+
* @param props - Component props.
|
|
11
|
+
* @param props.status - The task's status.
|
|
12
|
+
* @param props.isLight - Whether the light theme is active (ring colour).
|
|
13
|
+
* @returns The status mark.
|
|
14
|
+
*/
|
|
15
|
+
export function PlanStatusIcon({ status, isLight, }) {
|
|
16
|
+
const gradientId = `mol-plan-spinner-${useId().replace(/[:]/g, '')}`;
|
|
17
|
+
if (status === 'completed') {
|
|
18
|
+
return _jsx(Icon, { name: "check-circle", size: SIZE, "aria-hidden": true, style: { color: '#3fb950' } });
|
|
19
|
+
}
|
|
20
|
+
if (status === 'in_progress') {
|
|
21
|
+
return (_jsx("span", { "aria-hidden": true, style: { display: 'inline-flex', flexShrink: 0 }, dangerouslySetInnerHTML: { __html: moleculeSpinnerMarkSvg({ size: SIZE, gradientId }) } }));
|
|
22
|
+
}
|
|
23
|
+
return (_jsx("span", { "aria-hidden": true, style: {
|
|
24
|
+
display: 'inline-block',
|
|
25
|
+
boxSizing: 'border-box',
|
|
26
|
+
width: SIZE,
|
|
27
|
+
height: SIZE,
|
|
28
|
+
borderRadius: '50%',
|
|
29
|
+
border: `1.5px solid ${isLight ? '#afb8c1' : '#6e7681'}`,
|
|
30
|
+
} }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=PlanStatusIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanStatusIcon.js","sourceRoot":"","sources":["../../src/components/PlanStatusIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,IAAI,GAAG,EAAE,CAAA;AAEf;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,OAAO,GAIR;IACC,MAAM,UAAU,GAAG,oBAAoB,KAAK,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAA;IACpE,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;QAC3B,OAAO,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAE,IAAI,uBAAc,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAI,CAAA;IAC1F,CAAC;IACD,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;QAC7B,OAAO,CACL,oCAEE,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,EAAE,EAChD,uBAAuB,EAAE,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,GACvF,CACH,CAAA;IACH,CAAC;IACD,OAAO,CACL,oCAEE,KAAK,EAAE;YACL,OAAO,EAAE,cAAc;YACvB,SAAS,EAAE,YAAY;YACvB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,eAAe,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE;SACzD,GACD,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestStatusBar.d.ts","sourceRoot":"","sources":["../../src/components/TestStatusBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAKhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"TestStatusBar.d.ts","sourceRoot":"","sources":["../../src/components/TestStatusBar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAKhC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,0BAA0B,CAAA;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAY9D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CA0C9D;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,GAAG,EAAE,aAAa,CAAA;IAClB,iEAAiE;IACjE,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,sCAAsC;IACtC,QAAQ,EAAE,OAAO,CAAA;IACjB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,8EAA8E;IAC9E,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,mDAAmD;IACnD,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,GACP,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAuHlC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { t } from '@molecule/app-i18n';
|
|
3
3
|
import { getClassMap } from '@molecule/app-ui';
|
|
4
|
+
import { DockStrip } from './DockStrip.js';
|
|
4
5
|
import { summariseTestsBar } from './tests-bar-utilities.js';
|
|
5
6
|
/** The theme token each tone paints its dot and figures with. */
|
|
6
7
|
const TONE_COLOR = {
|
|
@@ -55,46 +56,16 @@ export function TestStatusBar({ run, tests, expanded, onToggle, onOpen, onStop,
|
|
|
55
56
|
const summary = summariseTestsBar(run, tests);
|
|
56
57
|
const hasResults = summary.passed + summary.failed + summary.skipped > 0;
|
|
57
58
|
const label = testsBarLabel(summary);
|
|
58
|
-
return (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
justifyContent: 'space-between',
|
|
70
|
-
cursor: 'pointer',
|
|
71
|
-
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 4, minWidth: 0 }, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", width: "12", height: "12", style: {
|
|
72
|
-
transform: expanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
73
|
-
transition: 'transform 120ms',
|
|
74
|
-
opacity: 0.5,
|
|
75
|
-
flexShrink: 0,
|
|
76
|
-
}, children: _jsx("path", { d: "M6 4l4 4-4 4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { "data-mol-id": "tests-bar-label", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: {
|
|
77
|
-
whiteSpace: 'nowrap',
|
|
78
|
-
overflow: 'hidden',
|
|
79
|
-
textOverflow: 'ellipsis',
|
|
80
|
-
}, children: label }), summary.tone === 'running' && (summary.currentTest ?? summary.currentFile) ? (_jsx("span", { "data-mol-id": "tests-bar-current", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: {
|
|
81
|
-
opacity: 0.75,
|
|
82
|
-
whiteSpace: 'nowrap',
|
|
83
|
-
overflow: 'hidden',
|
|
84
|
-
textOverflow: 'ellipsis',
|
|
85
|
-
minWidth: 0,
|
|
86
|
-
}, children: `· ${summary.currentTest ?? summary.currentFile}` })) : null] }), _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0 }, children: [hasResults ? (_jsxs("span", { "data-mol-id": "tests-bar-counts", className: cm.textSize('xs'), role: "img", "aria-label": t('ide.testsBar.counts', { passed: summary.passed, failed: summary.failed, skipped: summary.skipped }, { defaultValue: '{{passed}} passing, {{failed}} failing, {{skipped}} skipped' }), style: { fontWeight: 600, whiteSpace: 'nowrap', fontVariantNumeric: 'tabular-nums' }, children: [_jsx("span", { style: { color: TONE_COLOR.passing }, children: summary.passed }), _jsx("span", { style: { opacity: 0.4 }, children: ' / ' }), _jsx("span", { style: { color: TONE_COLOR.failing }, children: summary.failed }), _jsx("span", { style: { opacity: 0.4 }, children: ' / ' }), _jsx("span", { style: { color: TONE_COLOR.stopped }, children: summary.skipped })] })) : null, run.running && onStop ? (_jsx("button", { type: "button", "data-mol-id": "tests-bar-stop", className: cm.cn(cm.button({ variant: 'solid', color: 'error', size: 'xs' }), cm.touchTargetCompact), onClick: (e) => {
|
|
87
|
-
e.stopPropagation();
|
|
88
|
-
onStop();
|
|
89
|
-
}, children: t('ide.testsBar.stop', undefined, { defaultValue: 'Stop' }) })) : (_jsx("button", { type: "button", "data-mol-id": "tests-bar-open", className: cm.cn(cm.button({ variant: 'solid', color: 'primary', size: 'xs' }), cm.touchTargetCompact), onClick: (e) => {
|
|
90
|
-
e.stopPropagation();
|
|
91
|
-
onOpen();
|
|
92
|
-
}, children: t('ide.testsBar.open', undefined, { defaultValue: 'Tests' }) }))] })] }), expanded ? (_jsxs("div", { "data-mol-id": "tests-bar-detail", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: {
|
|
93
|
-
marginTop: 6,
|
|
94
|
-
paddingLeft: 16,
|
|
95
|
-
display: 'flex',
|
|
96
|
-
flexDirection: 'column',
|
|
97
|
-
gap: 2,
|
|
98
|
-
}, children: [_jsxs("div", { style: { display: 'flex', gap: 12, flexWrap: 'wrap' }, children: [_jsxs("span", { "data-mol-id": "tests-bar-passed", children: [_jsx("span", { style: { color: TONE_COLOR.passing, fontWeight: 600 }, children: summary.passed }), ' ', t('ide.testsBar.passedLabel', undefined, { defaultValue: 'passing' })] }), _jsxs("span", { "data-mol-id": "tests-bar-failed", children: [_jsx("span", { style: { color: TONE_COLOR.failing, fontWeight: 600 }, children: summary.failed }), ' ', t('ide.testsBar.failedLabel', undefined, { defaultValue: 'failing' })] }), _jsxs("span", { "data-mol-id": "tests-bar-skipped", children: [_jsx("span", { style: { color: TONE_COLOR.stopped, fontWeight: 600 }, children: summary.skipped }), ' ', t('ide.testsBar.skippedLabel', undefined, { defaultValue: 'skipped' })] }), summary.tone === 'running' ? (_jsxs("span", { "data-mol-id": "tests-bar-remaining", children: [_jsx("span", { style: { color: TONE_COLOR.running, fontWeight: 600 }, children: summary.remaining }), ' ', t('ide.testsBar.remainingLabel', undefined, { defaultValue: 'to go' })] })) : null] }), summary.currentFile ? (_jsxs("div", { "data-mol-id": "tests-bar-current-file", children: [t('ide.testsBar.currentFile', { file: summary.currentFile }, { defaultValue: 'Running {{file}}' }), summary.currentTest ? ` › ${summary.currentTest}` : ''] })) : null, run.error ? _jsx("div", { "data-mol-id": "tests-bar-error", children: run.error }) : null] })) : null] }));
|
|
59
|
+
return (_jsx(DockStrip, { molId: "tests-bar", toggleMolId: "tests-bar-toggle", rootProps: { 'data-tests-tone': summary.tone }, expanded: expanded, onToggle: onToggle, label: _jsx("span", { "data-mol-id": "tests-bar-label", children: label }), hint: summary.tone === 'running' && (summary.currentTest ?? summary.currentFile) ? (_jsx("span", { "data-mol-id": "tests-bar-current", children: `· ${summary.currentTest ?? summary.currentFile}` })) : undefined, actions: _jsxs(_Fragment, { children: [hasResults ? (_jsxs("span", { "data-mol-id": "tests-bar-counts", className: cm.textSize('xs'), role: "img", "aria-label": t('ide.testsBar.counts', { passed: summary.passed, failed: summary.failed, skipped: summary.skipped }, { defaultValue: '{{passed}} passing, {{failed}} failing, {{skipped}} skipped' }), style: { fontWeight: 600, whiteSpace: 'nowrap', fontVariantNumeric: 'tabular-nums' }, children: [_jsx("span", { style: { color: TONE_COLOR.passing }, children: summary.passed }), _jsx("span", { style: { opacity: 0.4 }, children: ' / ' }), _jsx("span", { style: { color: TONE_COLOR.failing }, children: summary.failed }), _jsx("span", { style: { opacity: 0.4 }, children: ' / ' }), _jsx("span", { style: { color: TONE_COLOR.stopped }, children: summary.skipped })] })) : null, run.running && onStop ? (_jsx("button", { type: "button", "data-mol-id": "tests-bar-stop", className: cm.cn(cm.button({ variant: 'solid', color: 'error', size: 'xs' }), cm.touchTargetCompact), onClick: (e) => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
onStop();
|
|
62
|
+
}, children: t('ide.testsBar.stop', undefined, { defaultValue: 'Stop' }) })) : (_jsx("button", { type: "button", "data-mol-id": "tests-bar-open", className: cm.cn(cm.button({ variant: 'solid', color: 'primary', size: 'xs' }), cm.touchTargetCompact), onClick: (e) => {
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
onOpen();
|
|
65
|
+
}, children: t('ide.testsBar.open', undefined, { defaultValue: 'Tests' }) }))] }), children: _jsxs("div", { "data-mol-id": "tests-bar-detail", className: cm.cn(cm.textMuted, cm.textSize('xs')), style: {
|
|
66
|
+
display: 'flex',
|
|
67
|
+
flexDirection: 'column',
|
|
68
|
+
gap: 2,
|
|
69
|
+
}, children: [_jsxs("div", { style: { display: 'flex', gap: 12, flexWrap: 'wrap' }, children: [_jsxs("span", { "data-mol-id": "tests-bar-passed", children: [_jsx("span", { style: { color: TONE_COLOR.passing, fontWeight: 600 }, children: summary.passed }), ' ', t('ide.testsBar.passedLabel', undefined, { defaultValue: 'passing' })] }), _jsxs("span", { "data-mol-id": "tests-bar-failed", children: [_jsx("span", { style: { color: TONE_COLOR.failing, fontWeight: 600 }, children: summary.failed }), ' ', t('ide.testsBar.failedLabel', undefined, { defaultValue: 'failing' })] }), _jsxs("span", { "data-mol-id": "tests-bar-skipped", children: [_jsx("span", { style: { color: TONE_COLOR.stopped, fontWeight: 600 }, children: summary.skipped }), ' ', t('ide.testsBar.skippedLabel', undefined, { defaultValue: 'skipped' })] }), summary.tone === 'running' ? (_jsxs("span", { "data-mol-id": "tests-bar-remaining", children: [_jsx("span", { style: { color: TONE_COLOR.running, fontWeight: 600 }, children: summary.remaining }), ' ', t('ide.testsBar.remainingLabel', undefined, { defaultValue: 'to go' })] })) : null] }), summary.currentFile ? (_jsxs("div", { "data-mol-id": "tests-bar-current-file", children: [t('ide.testsBar.currentFile', { file: summary.currentFile }, { defaultValue: 'Running {{file}}' }), summary.currentTest ? ` › ${summary.currentTest}` : ''] })) : null, run.error ? _jsx("div", { "data-mol-id": "tests-bar-error", children: run.error }) : null] }) }));
|
|
99
70
|
}
|
|
100
71
|
//# sourceMappingURL=TestStatusBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestStatusBar.js","sourceRoot":"","sources":["../../src/components/TestStatusBar.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"TestStatusBar.js","sourceRoot":"","sources":["../../src/components/TestStatusBar.tsx"],"names":[],"mapp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EAAE,OAAO,CAAC,WAAW,EAAE,EAC7B,EAAE,YAAY,EAAE,kBAAkB,EAAE,CACrC,EACA,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IACnD,CACP,CAAC,CAAC,CAAC,IAAI,EACP,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,6BAAiB,iBAAiB,YAAE,GAAG,CAAC,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,IACpE,GACI,CACb,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolCallCard.d.ts","sourceRoot":"","sources":["../../src/components/ToolCallCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAQ3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ToolCallCard.d.ts","sourceRoot":"","sources":["../../src/components/ToolCallCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAQ3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAyoBpD;;;;GAIG;AACH,eAAO,MAAM,YAAY,gPAiBtB,iBAAiB,KAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAk7CvC,CAAA"}
|
|
@@ -6,7 +6,7 @@ import { getClassMap } from '@molecule/app-ui';
|
|
|
6
6
|
import { useCoarsePointer, useNarrowViewport } from '../hooks/useViewport.js';
|
|
7
7
|
import { BackgroundTaskCommandsContext } from './background-task-context.js';
|
|
8
8
|
import { MarkdownContent } from './MarkdownContent.js';
|
|
9
|
-
import { basename, extractFilePath, fileDiffStats, interruptedByRestartLine, isInterruptedByRestart, isSkippedByUser, moleculeDocPath, normalizeAskUserInput,
|
|
9
|
+
import { basename, extractFilePath, fileDiffStats, interruptedByRestartLine, isInterruptedByRestart, isSkippedByUser, moleculeDocPath, normalizeAskUserInput, num, parseJudgeVerdict, readFileLabelEntries, str, subagentErrorLine, toolLabel, toolSummary, } from './tool-call-utilities.js';
|
|
10
10
|
/**
|
|
11
11
|
* Normalize a model-authored string for display: models sometimes double-escape
|
|
12
12
|
* tool arguments, so a literal "\n"/"\t"/"\r" (backslash + letter) ends up in
|
|
@@ -156,6 +156,15 @@ const PRE = {
|
|
|
156
156
|
fontSize: '11px',
|
|
157
157
|
lineHeight: 1.5,
|
|
158
158
|
};
|
|
159
|
+
// A shell command or its output is read whole: wrap it instead of scrolling sideways,
|
|
160
|
+
// and cap tall output with a vertical scroll.
|
|
161
|
+
const WRAP_PRE = {
|
|
162
|
+
...PRE,
|
|
163
|
+
whiteSpace: 'pre-wrap',
|
|
164
|
+
overflowWrap: 'anywhere',
|
|
165
|
+
overflowX: 'visible',
|
|
166
|
+
};
|
|
167
|
+
const OUTPUT_PRE = { ...WRAP_PRE, maxHeight: '320px', overflowY: 'auto' };
|
|
159
168
|
/**
|
|
160
169
|
* Render the input section for a tool call.
|
|
161
170
|
* @param name - The tool name.
|
|
@@ -166,7 +175,7 @@ function renderIn(name, input) {
|
|
|
166
175
|
const inp = (input ?? {});
|
|
167
176
|
switch (name) {
|
|
168
177
|
case 'exec_command':
|
|
169
|
-
return (_jsxs("pre", { style:
|
|
178
|
+
return (_jsxs("pre", { style: WRAP_PRE, children: [_jsx("span", { style: { opacity: 0.5 }, children: "$ " }), str(inp.command) ?? ''] }));
|
|
170
179
|
case 'write_file':
|
|
171
180
|
// Full file content is too noisy — show only the path
|
|
172
181
|
return _jsx("pre", { style: PRE, children: str(inp.path) ?? '' });
|
|
@@ -237,7 +246,7 @@ function renderOut(name, output) {
|
|
|
237
246
|
const stdout = (str(out.stdout) ?? '').trimEnd();
|
|
238
247
|
const stderr = (str(out.stderr) ?? '').trimEnd();
|
|
239
248
|
const exitCode = num(out.exitCode);
|
|
240
|
-
return (_jsxs("div", { children: [stdout && _jsx("pre", { style:
|
|
249
|
+
return (_jsxs("div", { children: [stdout && _jsx("pre", { style: OUTPUT_PRE, children: stdout }), stderr && (_jsx("pre", { style: { ...OUTPUT_PRE, color: '#f47067', marginTop: stdout ? '4px' : 0 }, children: stderr })), exitCode != null && exitCode !== 0 && (_jsxs("div", { style: { marginTop: '4px', color: '#f47067', fontSize: '10px' }, children: ["exit code ", exitCode] })), !stdout && !stderr && (_jsx("span", { style: { opacity: 0.5 }, children: t('ide.toolCall.noOutput', undefined, { defaultValue: '(no output)' }) }))] }));
|
|
241
250
|
}
|
|
242
251
|
case 'write_file': {
|
|
243
252
|
const diff = out.diff;
|
|
@@ -464,62 +473,10 @@ export const ToolCallCard = memo(function ToolCallCard({ id, name, input, output
|
|
|
464
473
|
setExpanded((e) => !e);
|
|
465
474
|
}
|
|
466
475
|
: undefined;
|
|
467
|
-
// ── update_task_list:
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
const borderClr = isLight ? '#d0d7de' : '#3d444d';
|
|
472
|
-
const statusGlyph = (status) => status === 'completed' ? '✓' : status === 'in_progress' ? '◐' : '○';
|
|
473
|
-
const statusColor = (status) => status === 'completed'
|
|
474
|
-
? '#3fb950'
|
|
475
|
-
: status === 'in_progress'
|
|
476
|
-
? isLight
|
|
477
|
-
? '#2563eb'
|
|
478
|
-
: '#60a5fa'
|
|
479
|
-
: isLight
|
|
480
|
-
? '#848d97'
|
|
481
|
-
: '#6e7681';
|
|
482
|
-
return (_jsxs("div", { className: className, "data-mol-id": "task-list-card", style: {
|
|
483
|
-
marginBottom: '8px',
|
|
484
|
-
marginTop: '8px',
|
|
485
|
-
borderRadius: '8px',
|
|
486
|
-
border: `1px solid ${borderClr}`,
|
|
487
|
-
background: isLight ? '#f6f8fa' : 'rgba(255,255,255,0.04)',
|
|
488
|
-
overflow: 'hidden',
|
|
489
|
-
}, children: [_jsxs("div", { style: {
|
|
490
|
-
display: 'flex',
|
|
491
|
-
alignItems: 'center',
|
|
492
|
-
justifyContent: 'space-between',
|
|
493
|
-
gap: '8px',
|
|
494
|
-
padding: '6px 12px',
|
|
495
|
-
borderBottom: todos.length > 0 ? `1px solid ${borderClr}` : 'none',
|
|
496
|
-
fontSize: '12px',
|
|
497
|
-
fontWeight: 600,
|
|
498
|
-
}, children: [_jsx("span", { children: t('ide.chat.taskListTitle', undefined, { defaultValue: 'Working plan' }) }), todos.length > 0 && (_jsx("span", { style: { fontWeight: 400, opacity: 0.65 }, children: t('ide.chat.taskListProgress', { done: completed, total: todos.length }, {
|
|
499
|
-
defaultValue: '{{done}} of {{total}} done',
|
|
500
|
-
}) }))] }), todos.map((todo, i) => (_jsxs("div", { style: {
|
|
501
|
-
display: 'flex',
|
|
502
|
-
alignItems: 'flex-start',
|
|
503
|
-
gap: '8px',
|
|
504
|
-
padding: '4px 12px',
|
|
505
|
-
borderTop: i > 0 ? `1px solid ${isLight ? '#eaeef2' : 'rgba(255,255,255,0.06)'}` : 'none',
|
|
506
|
-
fontSize: '12.5px',
|
|
507
|
-
...(todo.status === 'completed'
|
|
508
|
-
? { opacity: 0.55, textDecoration: 'line-through' }
|
|
509
|
-
: {}),
|
|
510
|
-
}, children: [_jsx("span", { "aria-hidden": true, style: {
|
|
511
|
-
flexShrink: 0,
|
|
512
|
-
width: 16,
|
|
513
|
-
fontSize: '12px',
|
|
514
|
-
lineHeight: '17px',
|
|
515
|
-
color: statusColor(todo.status),
|
|
516
|
-
fontWeight: 600,
|
|
517
|
-
}, children: statusGlyph(todo.status) }), _jsxs("span", { style: { flex: 1, minWidth: 0 }, children: [todo.priority === 'high' && todo.status !== 'completed' && (_jsx("span", { style: {
|
|
518
|
-
color: isLight ? '#d63a2f' : '#f87171',
|
|
519
|
-
fontWeight: 600,
|
|
520
|
-
marginRight: '4px',
|
|
521
|
-
}, children: "!" })), todo.content] })] }, i)))] }));
|
|
522
|
-
}
|
|
476
|
+
// ── update_task_list: drawn once, pinned above the composer (PlanCard) — not
|
|
477
|
+
// repeated in the transcript on every update.
|
|
478
|
+
if (name === 'update_task_list')
|
|
479
|
+
return null;
|
|
523
480
|
// ── spawn_agent: subagent card — explore report / judge verdict / build summary ──
|
|
524
481
|
if (name === 'spawn_agent') {
|
|
525
482
|
const inp = (input ?? {});
|
|
@@ -1180,7 +1137,9 @@ export const ToolCallCard = memo(function ToolCallCard({ id, name, input, output
|
|
|
1180
1137
|
letterSpacing: '0.6px',
|
|
1181
1138
|
marginBottom: '4px',
|
|
1182
1139
|
fontWeight: 600,
|
|
1183
|
-
}, children:
|
|
1140
|
+
}, children: name === 'exec_command'
|
|
1141
|
+
? t('ide.toolCall.command', undefined, { defaultValue: 'Command' })
|
|
1142
|
+
: t('ide.toolCall.request', undefined, { defaultValue: 'Request' }) }), inContent] })), outContent && (_jsxs("div", { style: {
|
|
1184
1143
|
padding: '6px 10px',
|
|
1185
1144
|
borderTop: inContent ? '1px solid rgba(128,128,128,0.15)' : undefined,
|
|
1186
1145
|
}, children: [_jsx("div", { className: cm.textMuted, style: {
|
|
@@ -1189,7 +1148,9 @@ export const ToolCallCard = memo(function ToolCallCard({ id, name, input, output
|
|
|
1189
1148
|
letterSpacing: '0.6px',
|
|
1190
1149
|
marginBottom: '4px',
|
|
1191
1150
|
fontWeight: 600,
|
|
1192
|
-
}, children:
|
|
1151
|
+
}, children: name === 'exec_command'
|
|
1152
|
+
? t('ide.toolCall.output', undefined, { defaultValue: 'Output' })
|
|
1153
|
+
: t('ide.toolCall.response', undefined, { defaultValue: 'Response' }) }), outContent] }))] })) : (_jsxs("div", { style: { padding: '6px 10px' }, children: [name === 'rename_file' && (_jsxs("pre", { style: PRE, children: [str((input ?? {}).old_path) ?? '', ' → ', str((input ?? {}).new_path) ?? ''] })), (name === 'list_files' || name === 'find_files' || name === 'search_files') &&
|
|
1193
1154
|
output !== undefined &&
|
|
1194
1155
|
renderOut(name, output), name === 'find_package' && output !== undefined && (_jsx(PackageResultRows, { results: packageResults(output), onFileOpen: onFileOpen }))] })) }))] }));
|
|
1195
1156
|
});
|