@kingsoftcloud/agentkit-harness-ui 0.0.24 → 0.0.26
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 +6 -0
- package/package.json +2 -2
- package/src/host/native-child-pane.mjs +1 -1
- package/src/host/session-task-events.mjs +1 -1
- package/src/host/state/native-child-observation.mjs +15 -2
- package/src/host/task-timeline.mjs +2 -1
- package/src/project.mjs +25 -1
- package/src/protocol.mjs +1 -0
- package/src/renderers.mjs +42 -13
- package/src/styles.mjs +30 -11
- package/src/view.mjs +4 -2
package/README.md
CHANGED
|
@@ -7,6 +7,12 @@ streaming assistant text, provider-supplied thinking, and live tool calls —
|
|
|
7
7
|
with ordered items, replay-safe deduplication, bounded summaries, and redacted
|
|
8
8
|
errors.
|
|
9
9
|
|
|
10
|
+
Subagent cards use distinct, theme-aware colors for role names. The optional
|
|
11
|
+
`subagent.bound.child.outcome` field preserves the recorded outcome for retry
|
|
12
|
+
history. Failed delegations keep detailed errors behind a disclosure,
|
|
13
|
+
and a matching, completed retry moves the initial rejection into retry history.
|
|
14
|
+
The child pane shows the settled result from the child-history reply.
|
|
15
|
+
|
|
10
16
|
The package is intentionally free of Studio / DSH / Python imports. React is a
|
|
11
17
|
**peer dependency** (`>=18`). Source is plain ESM (`.mjs`, no JSX) and is
|
|
12
18
|
exposed directly, with no transpiler required at runtime. The optional Markdown
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingsoftcloud/agentkit-harness-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Reusable React task-process UI for AgentKit Native: an explicitly versioned event protocol, a pure state reducer, and an accessible timeline. No Studio/DSH/Python imports; React is a peer dependency.",
|
|
@@ -98,6 +98,6 @@
|
|
|
98
98
|
"registry": "https://registry.npmjs.org"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@kingsoftcloud/agentkit-harness-core": "0.0.
|
|
101
|
+
"@kingsoftcloud/agentkit-harness-core": "0.0.26"
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -23,7 +23,7 @@ export function installNativeChildPane(ctx, { React, hostRemote, labels, renderT
|
|
|
23
23
|
const read = async () => {
|
|
24
24
|
try {
|
|
25
25
|
const detail = await hostRemote.nativeChildResult({ agentId: target.agentId, sessionId: target.parentSessionId,
|
|
26
|
-
runId: target.parentRunId, childRunId: target.runId }, controller.signal);
|
|
26
|
+
runId: target.parentRunId, childRunId: target.runId, limit: 16000 }, controller.signal);
|
|
27
27
|
if (!controller.signal.aborted) { setView(nativeChildObservationState(detail)); setError(''); terminal = ['completed', 'failed', 'canceled'].includes(detail.observation.phase); }
|
|
28
28
|
} catch { if (!controller.signal.aborted) setError('子会话同步失败,请重新打开'); }
|
|
29
29
|
finally { if (!controller.signal.aborted) timer = setTimeout(read, terminal ? 3000 : 500); }
|
|
@@ -310,7 +310,7 @@ export function bindNativeSubagents(state, tasks) {
|
|
|
310
310
|
if (!task.parentToolCallId || !state.items.some(item => item.kind === 'tool' && item.callId === task.parentToolCallId)) continue;
|
|
311
311
|
next = reduce(next, { v: 1, type: 'subagent.bound', id: `child:${task.childRunId}:${task.snapshotRevision}`,
|
|
312
312
|
callId: task.parentToolCallId, child: { runId: task.childRunId, sessionId: task.sessionId, parentRunId: task.parentRunId,
|
|
313
|
-
role: task.role, title: task.goalPreview, phase: task.phase, activity: task.activity } });
|
|
313
|
+
role: task.role, title: task.goalPreview, phase: task.phase, outcome: task.outcome, activity: task.activity } });
|
|
314
314
|
}
|
|
315
315
|
return next;
|
|
316
316
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { initialState, reduce } from '@kingsoftcloud/agentkit-harness-ui/reducer';
|
|
2
|
+
import { FINAL_SUBMISSION_TOOL } from '../../engine-view/adapter.mjs';
|
|
2
3
|
|
|
3
4
|
/** Product transport mapping. The standalone UI never calls a Native store. */
|
|
4
5
|
export function nativeChildObservationState(detail) {
|
|
@@ -9,7 +10,17 @@ export function nativeChildObservationState(detail) {
|
|
|
9
10
|
const emit = (type, body) => { state = reduce(state, { v: 1, id: `${value.snapshotRevision}:${seq++}`, type, ...body }); };
|
|
10
11
|
emit('task.started', { taskId: value.runId, runId: value.runId });
|
|
11
12
|
if (value.prompt?.text) emit('text.done', { itemId: 'prompt', role: 'user', text: value.prompt.text });
|
|
13
|
+
const finalText = value.phase === 'completed' && task.resultAvailable === true
|
|
14
|
+
&& detail.offset === 0 && typeof detail.text === 'string' && detail.text.trim() ? detail.text : '';
|
|
15
|
+
const lastText = value.rows.findLast(row => row.kind === 'text');
|
|
16
|
+
const remainingChars = finalText && detail.complete === false && Number.isSafeInteger(detail.totalChars)
|
|
17
|
+
&& Number.isSafeInteger(detail.nextOffset) ? Math.max(0, detail.totalChars - detail.nextOffset) : 0;
|
|
12
18
|
for (const row of value.rows) {
|
|
19
|
+
// The result page carries the settled answer. The internal submission stays in the ledger.
|
|
20
|
+
if (row.kind === 'tool' && row.name === FINAL_SUBMISSION_TOOL) continue;
|
|
21
|
+
if (finalText && row === lastText && (row.text?.trim() === finalText.trim()
|
|
22
|
+
|| row.omittedChars > 0 && finalText.startsWith(row.text)
|
|
23
|
+
|| remainingChars > 0 && row.text?.startsWith(finalText))) continue;
|
|
13
24
|
if (row.kind === 'text' || row.kind === 'thought') emit(row.kind === 'text' ? 'text.done' : 'thinking.done', { itemId: row.id, text: row.text });
|
|
14
25
|
if (row.kind === 'tool') {
|
|
15
26
|
let input = {}; try { input = JSON.parse(row.input?.text); } catch { /* truncated preview remains an incomplete input */ }
|
|
@@ -21,9 +32,11 @@ export function nativeChildObservationState(detail) {
|
|
|
21
32
|
}
|
|
22
33
|
if (value.live?.thinking) emit('thinking.delta', { itemId: `live-thought:${value.live.operationKey}`, delta: value.live.thinking });
|
|
23
34
|
if (value.live?.text) emit('text.delta', { itemId: `live-text:${value.live.operationKey}`, delta: value.live.text });
|
|
35
|
+
if (finalText) emit('text.done', { itemId: 'final-answer', text: finalText });
|
|
24
36
|
if (['completed', 'failed', 'canceled'].includes(value.phase)) emit('task.finished', {
|
|
25
37
|
outcome: value.phase === 'failed' ? 'failed' : value.phase === 'canceled' ? 'cancelled' : value.outcome === 'verified' ? 'completed'
|
|
26
|
-
: value.outcome === 'blocked' ? 'blocked' : 'unverified',
|
|
38
|
+
: value.outcome === 'blocked' ? 'blocked' : 'unverified',
|
|
39
|
+
verificationRequired: value.outcome === 'unverified',
|
|
27
40
|
...(value.phase === 'completed' && state.items.at(-1)?.kind === 'text'
|
|
28
41
|
? { finalAnswerId: state.items.at(-1).id } : {}),
|
|
29
42
|
});
|
|
@@ -31,5 +44,5 @@ export function nativeChildObservationState(detail) {
|
|
|
31
44
|
else if (!value.driving) emit('task.state', { state: 'interrupted' });
|
|
32
45
|
return { state, workspaceView: value.workspaceView, omittedRows: value.omittedRows, omittedChars: (value.prompt?.omittedChars ?? 0)
|
|
33
46
|
+ value.rows.reduce((sum, row) => sum + (row.omittedChars ?? 0) + (row.input?.omittedChars ?? 0) + (row.result?.omittedChars ?? 0), 0)
|
|
34
|
-
+ (value.live?.omittedChars ?? 0) };
|
|
47
|
+
+ (value.live?.omittedChars ?? 0) + remainingChars };
|
|
35
48
|
}
|
|
@@ -15,7 +15,8 @@ const labels = { result: '执行结果', thought: '思考', running: '执行中'
|
|
|
15
15
|
contextFailed: '上下文压缩失败', contextInterrupted: '上下文压缩已中断', contextNoop: '上下文已是最新,无需压缩', interrupted: '任务已中断', recovered: '已恢复',
|
|
16
16
|
failed: '任务失败', completed: '已完成', cancelled: '已停止', blocked: '任务受阻', unverified: '已结束,结果未验证',
|
|
17
17
|
waiting: '等待确认或回执', paused: '已暂停', toolScheduled: '排队中', toolRunning: '执行中', toolCompleted: '已返回',
|
|
18
|
-
toolFailed: '执行失败', toolUncertain: '执行结果未知', toolNotDispatched: '未执行',
|
|
18
|
+
toolFailed: '执行失败', toolUncertain: '执行结果未知', toolNotDispatched: '未执行',
|
|
19
|
+
toolRetryHistory: '重试记录', jumpLatest: '回到最新',
|
|
19
20
|
readKind: '读取', readReading: '读取中', listKind: '列出文件', listSearching: '列出文件中', searchKind: '搜索', searchSearching: '搜索中',
|
|
20
21
|
searchQuery: '搜索词', searchScope: '搜索范围', searchGlob: '文件匹配规则', searchMatches: '返回命中数', searchResultsTruncated: '部分命中位置已省略',
|
|
21
22
|
readPath: '文件路径', readLines: '已读取行', readRequestedLines: '请求读取行', readOffset: '起始偏移', readLimit: '读取上限',
|
package/src/project.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { contextTimelineItems } from './context-markers.mjs';
|
|
|
6
6
|
// active tool, errors) without mutating state. Kept separate from the view so
|
|
7
7
|
// the same projections can be tested and reused by hosts and screens readers.
|
|
8
8
|
|
|
9
|
-
import { TaskState, ToolStatus } from "./protocol.mjs";
|
|
9
|
+
import { TaskOutcome, TaskState, ToolStatus } from "./protocol.mjs";
|
|
10
10
|
import { toolConversationVisible } from './tool-identity.mjs';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -97,6 +97,30 @@ export function failedTools(state) {
|
|
|
97
97
|
return visibleItems(state).filter(item => item.kind === "tool" && item.status === ToolStatus.Failed);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
/** Recognize a corrected delegation in the same turn after its child has returned. */
|
|
101
|
+
export function resolvedDelegateAttempts(items) {
|
|
102
|
+
const preceding = new Map();
|
|
103
|
+
const recovered = new Set();
|
|
104
|
+
for (const item of items) {
|
|
105
|
+
if (item.kind === 'text' && item.role === 'user') preceding.clear();
|
|
106
|
+
if (item.kind !== 'tool' || item.name !== 'native_delegate') continue;
|
|
107
|
+
const { output_contract, output_format, ...request } = item.input ?? {};
|
|
108
|
+
if (typeof request.role !== 'string' || typeof request.task !== 'string') continue;
|
|
109
|
+
const key = JSON.stringify(Object.entries(request).sort(([a], [b]) => a.localeCompare(b)));
|
|
110
|
+
const earlier = preceding.get(key);
|
|
111
|
+
preceding.set(key, item);
|
|
112
|
+
if (item.status !== ToolStatus.Completed || item.child?.phase !== 'completed'
|
|
113
|
+
|| ![TaskOutcome.Completed, TaskOutcome.Unverified].includes(item.child.outcome)
|
|
114
|
+
|| output_contract !== undefined || output_format !== undefined) continue;
|
|
115
|
+
if (earlier?.status === ToolStatus.Failed && !earlier.child
|
|
116
|
+
&& earlier.input.output_contract === 'parent' && earlier.input.output_format === 'text'
|
|
117
|
+
&& /^(?:Error: )?studio_native_child_parent_output_invalid$/.test(earlier.error?.trim())) {
|
|
118
|
+
recovered.add(earlier.callId);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return recovered;
|
|
122
|
+
}
|
|
123
|
+
|
|
100
124
|
/** A one-line concise status string for the task, host-declared only. */
|
|
101
125
|
export function taskStatusLabel(state, labels = DEFAULT_LABELS) {
|
|
102
126
|
const s = state?.taskState;
|
package/src/protocol.mjs
CHANGED
|
@@ -207,6 +207,7 @@ function normalizePayload(type, event) {
|
|
|
207
207
|
|| !child.runId || !child.sessionId || !child.parentRunId || child.title.length > 512) throw Error('Invalid subagent identity');
|
|
208
208
|
return { callId: str(event.callId), child: { runId: child.runId, sessionId: child.sessionId,
|
|
209
209
|
parentRunId: child.parentRunId, role: child.role, title: child.title, phase: str(child.phase),
|
|
210
|
+
...(TASK_OUTCOMES.has(child.outcome) ? { outcome: child.outcome } : {}),
|
|
210
211
|
activity: child.activity && typeof child.activity.name === 'string' && TOOL_STATUSES.has(child.activity.status)
|
|
211
212
|
? { name: child.activity.name, input: asObject(child.activity.input), status: child.activity.status } : null } };
|
|
212
213
|
}
|
package/src/renderers.mjs
CHANGED
|
@@ -40,6 +40,27 @@ export function toolRendererKind(name) {
|
|
|
40
40
|
return 'default';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
const SUBAGENT_COLORS = ['blue', 'violet', 'teal', 'amber', 'green', 'indigo'];
|
|
44
|
+
const subagentRole = item => item.child?.role || item.input?.role || item.input?.subagent_type || '';
|
|
45
|
+
|
|
46
|
+
/** Give different visible roles different colors until the palette is full. */
|
|
47
|
+
export function subagentRoleColors(items) {
|
|
48
|
+
const roles = new Map(), used = new Set();
|
|
49
|
+
for (const item of items) {
|
|
50
|
+
if (item.kind !== 'tool' || !item.child && toolRendererKind(item.name) !== 'agent') continue;
|
|
51
|
+
const role = subagentRole(item);
|
|
52
|
+
if (typeof role !== 'string' || !role || roles.has(role)) continue;
|
|
53
|
+
let hash = 2166136261;
|
|
54
|
+
for (const char of role) hash = Math.imul(hash ^ char.codePointAt(0), 16777619) >>> 0;
|
|
55
|
+
const start = hash % SUBAGENT_COLORS.length;
|
|
56
|
+
const colors = [...SUBAGENT_COLORS.slice(start), ...SUBAGENT_COLORS.slice(0, start)];
|
|
57
|
+
const color = colors.find(candidate => !used.has(candidate)) ?? colors[0];
|
|
58
|
+
roles.set(role, color);
|
|
59
|
+
used.add(color);
|
|
60
|
+
}
|
|
61
|
+
return roles;
|
|
62
|
+
}
|
|
63
|
+
|
|
43
64
|
/** "read" splits internally into a file read vs a search/list summary. */
|
|
44
65
|
function readSubKind(name, input) {
|
|
45
66
|
if (['list', 'search'].includes(toolIdentity(name).family)) return "search";
|
|
@@ -85,7 +106,8 @@ const toolIsLive = item => item.kind === 'tool-preview' ? item.streaming === tru
|
|
|
85
106
|
*
|
|
86
107
|
* Policy-blocked commands put the reason inside the disclosure.
|
|
87
108
|
*/
|
|
88
|
-
function toolShell(item, opts, { icon, summary, body, canToggle = true, defaultOpen, actions = [], summaryAction,
|
|
109
|
+
function toolShell(item, opts, { icon, summary, body, canToggle = true, defaultOpen, actions = [], summaryAction,
|
|
110
|
+
commandBlocked = false, errorInDetails = false, summaryStatus }) {
|
|
89
111
|
const status = item.status;
|
|
90
112
|
const provisional = item.kind === 'tool-preview';
|
|
91
113
|
const streaming = toolIsLive(item);
|
|
@@ -102,17 +124,18 @@ function toolShell(item, opts, { icon, summary, body, canToggle = true, defaultO
|
|
|
102
124
|
const errorSummary = error ? toolErrorSummary(item.error, opts) : null;
|
|
103
125
|
// Non-toggleable tools have no body to expand into, so their error must live
|
|
104
126
|
// in the summary; toggleable tools show it inline only when collapsed.
|
|
105
|
-
const showInlineError = error && !commandBlocked && (canToggle
|
|
127
|
+
const showInlineError = error && !commandBlocked && !errorInDetails && (!canToggle || !open);
|
|
106
128
|
if (showInlineError) summaryKids.push(h("span", {
|
|
107
129
|
className: "harness-tool-error harness-tool-error-inline",
|
|
108
130
|
role: "alert",
|
|
109
131
|
"data-testid": "tool-error",
|
|
110
132
|
}, errorSummary));
|
|
111
|
-
|
|
112
|
-
|
|
133
|
+
const visibleStatus = summaryStatus === undefined ? status : summaryStatus;
|
|
134
|
+
if ([ToolStatus.Failed, ToolStatus.Uncertain, ToolStatus.Interrupted, ToolStatus.Waiting, ToolStatus.NotDispatched].includes(visibleStatus)) summaryKids.push(h("span", {
|
|
135
|
+
className: `harness-tool-status harness-tool-status-${visibleStatus}`,
|
|
113
136
|
"data-testid": "tool-status",
|
|
114
|
-
"data-status":
|
|
115
|
-
}, commandBlocked ? (String(opts.locale).startsWith("zh") ? "未执行" : "Not executed") : statusLabel(
|
|
137
|
+
"data-status": visibleStatus,
|
|
138
|
+
}, commandBlocked ? (String(opts.locale).startsWith("zh") ? "未执行" : "Not executed") : statusLabel(visibleStatus, opts)));
|
|
116
139
|
for (const action of actions) {
|
|
117
140
|
if (action) summaryKids.push(action);
|
|
118
141
|
}
|
|
@@ -153,17 +176,23 @@ function agentRenderer(item, opts) {
|
|
|
153
176
|
const activity = running && child?.activity && toolRendererKind(child.activity.name) === 'read' ? child.activity : null;
|
|
154
177
|
const activityPath = activity && readMeta(activity).path;
|
|
155
178
|
const primary = activityPath ? `${opts.labels.readKind || 'Read'} ${leafName(activityPath)}` : title;
|
|
156
|
-
const role =
|
|
157
|
-
let hash = 0; for (let i = 0; i < role.length; i++) hash = (hash * 31 + role.charCodeAt(i)) >>> 0;
|
|
158
|
-
const colors = ['yellow', 'red', 'orange', 'green', 'cyan', 'blue', 'purple', 'pink'];
|
|
179
|
+
const role = subagentRole(item);
|
|
159
180
|
const icon = h('svg', { className: 'harness-icon harness-tool-kind-icon', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true },
|
|
160
181
|
h('path', { d: 'M12 8V4H8' }), h('rect', { width: 16, height: 12, x: 4, y: 8, rx: 2 }),
|
|
161
182
|
h('path', { d: 'M2 14h2M20 14h2M15 13v2M9 13v2' }));
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
'
|
|
183
|
+
if (opts.resolvedDelegateAttempts?.has(item.callId)) {
|
|
184
|
+
return toolShell(item, opts, { icon, errorInDetails: true, summaryStatus: null, body: [],
|
|
185
|
+
summary: h('span', { className: 'harness-agent-title' }, opts.labels.toolRetryHistory || 'Retry history') });
|
|
186
|
+
}
|
|
187
|
+
const hasErrorDetails = item.status === ToolStatus.Failed && Boolean(item.error);
|
|
188
|
+
const openLabel = opts.labels.openSubagent || 'Open on the right';
|
|
189
|
+
const openAction = child && opts.onOpenSubagent ? { type: 'button', 'data-action': 'open-subagent', 'data-call-id': item.callId } : null;
|
|
190
|
+
return toolShell(item, opts, { icon, canToggle: hasErrorDetails, errorInDetails: hasErrorDetails,
|
|
191
|
+
body: hasErrorDetails && openAction ? [h('button', { ...openAction, className: 'harness-tool-action' }, openLabel)] : [],
|
|
192
|
+
summaryAction: !hasErrorDetails && openAction
|
|
193
|
+
? { ...openAction, 'aria-label': openLabel, title: String(title).slice(0, 512) } : undefined,
|
|
165
194
|
summary: [h('span', { className: running ? 'harness-tool-title harness-tool-title-streaming' : 'harness-tool-title' }, opts.labels.subagent || 'SubAgent'),
|
|
166
|
-
role ? h('span', { className: 'harness-agent-name', 'data-color':
|
|
195
|
+
role ? h('span', { className: 'harness-agent-name', 'data-role-color': opts.subagentRoleColors?.get(role) }, role) : null,
|
|
167
196
|
h('span', { className: 'harness-agent-separator', 'aria-hidden': true }, '·'),
|
|
168
197
|
h('span', { className: 'harness-agent-title' }, String(primary).slice(0, 512))] });
|
|
169
198
|
}
|
package/src/styles.mjs
CHANGED
|
@@ -12,6 +12,7 @@ export const styles = `
|
|
|
12
12
|
--harness-bg: transparent;
|
|
13
13
|
--harness-border: color-mix(in srgb, currentColor 14%, transparent);
|
|
14
14
|
--harness-running: #0969da;
|
|
15
|
+
--harness-agent-role: #0369a1;
|
|
15
16
|
--harness-error: #cf222e;
|
|
16
17
|
--harness-added: #1a7f37;
|
|
17
18
|
--harness-removed: #cf222e;
|
|
@@ -30,14 +31,15 @@ export const styles = `
|
|
|
30
31
|
@media (prefers-color-scheme: dark) {
|
|
31
32
|
.harness-timeline-shell {
|
|
32
33
|
--harness-running: #4493f8;
|
|
34
|
+
--harness-agent-role: #7dd3fc;
|
|
33
35
|
--harness-error: #ff7b72;
|
|
34
36
|
--harness-added: #4ac26b;
|
|
35
37
|
--harness-removed: #ff7b72;
|
|
36
38
|
--harness-thought: color-mix(in srgb, currentColor 30%, transparent);
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
.harness-timeline-shell[data-theme="dark"] { --harness-running: #4493f8; --harness-error: #ff7b72; --harness-added: #4ac26b; --harness-removed: #ff7b72; --harness-thought: color-mix(in srgb, currentColor 30%, transparent); }
|
|
40
|
-
.harness-timeline-shell[data-theme="light"] { --harness-running: #0969da; --harness-error: #cf222e; --harness-added: #1a7f37; --harness-removed: #cf222e; --harness-thought: color-mix(in srgb, currentColor 40%, transparent); }
|
|
41
|
+
.harness-timeline-shell[data-theme="dark"] { --harness-running: #4493f8; --harness-agent-role: #7dd3fc; --harness-error: #ff7b72; --harness-added: #4ac26b; --harness-removed: #ff7b72; --harness-thought: color-mix(in srgb, currentColor 30%, transparent); }
|
|
42
|
+
.harness-timeline-shell[data-theme="light"] { --harness-running: #0969da; --harness-agent-role: #0369a1; --harness-error: #cf222e; --harness-added: #1a7f37; --harness-removed: #cf222e; --harness-thought: color-mix(in srgb, currentColor 40%, transparent); }
|
|
41
43
|
.harness-timeline {
|
|
42
44
|
display: flex;
|
|
43
45
|
flex-direction: column;
|
|
@@ -259,17 +261,34 @@ export const styles = `
|
|
|
259
261
|
.harness-context-marker > svg { flex-shrink: 0; }
|
|
260
262
|
|
|
261
263
|
button.harness-tool-summary { border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; max-width: 100%; }
|
|
262
|
-
.harness-agent-name {
|
|
264
|
+
.harness-agent-name {
|
|
265
|
+
display: inline-flex; align-items: center; flex-shrink: 0; max-width: 9rem;
|
|
266
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
267
|
+
color: var(--harness-agent-role); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
268
|
+
font-weight: 500; line-height: 1.5;
|
|
269
|
+
}
|
|
270
|
+
.harness-agent-name[data-role-color="violet"] { color: #6d28d9; }
|
|
271
|
+
.harness-agent-name[data-role-color="teal"] { color: #0f766e; }
|
|
272
|
+
.harness-agent-name[data-role-color="amber"] { color: #92400e; }
|
|
273
|
+
.harness-agent-name[data-role-color="green"] { color: #166534; }
|
|
274
|
+
.harness-agent-name[data-role-color="indigo"] { color: #4338ca; }
|
|
275
|
+
@media (prefers-color-scheme: dark) {
|
|
276
|
+
.harness-timeline-shell:not([data-theme="light"]) .harness-agent-name[data-role-color="violet"] { color: #d8b4fe; }
|
|
277
|
+
.harness-timeline-shell:not([data-theme="light"]) .harness-agent-name[data-role-color="teal"] { color: #5eead4; }
|
|
278
|
+
.harness-timeline-shell:not([data-theme="light"]) .harness-agent-name[data-role-color="amber"] { color: #fcd34d; }
|
|
279
|
+
.harness-timeline-shell:not([data-theme="light"]) .harness-agent-name[data-role-color="green"] { color: #86efac; }
|
|
280
|
+
.harness-timeline-shell:not([data-theme="light"]) .harness-agent-name[data-role-color="indigo"] { color: #a5b4fc; }
|
|
281
|
+
}
|
|
282
|
+
[data-theme="dark"] .harness-agent-name[data-role-color="violet"] { color: #d8b4fe; }
|
|
283
|
+
[data-theme="dark"] .harness-agent-name[data-role-color="teal"] { color: #5eead4; }
|
|
284
|
+
[data-theme="dark"] .harness-agent-name[data-role-color="amber"] { color: #fcd34d; }
|
|
285
|
+
[data-theme="dark"] .harness-agent-name[data-role-color="green"] { color: #86efac; }
|
|
286
|
+
[data-theme="dark"] .harness-agent-name[data-role-color="indigo"] { color: #a5b4fc; }
|
|
263
287
|
.harness-agent-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--harness-fg-muted); }
|
|
288
|
+
.harness-tool-summary:has(.harness-agent-title) .harness-tool-status { flex-shrink: 0; white-space: nowrap; }
|
|
289
|
+
.harness-tool-details:has(.harness-agent-title) > .harness-tool-error { margin: 6px 0 0 24px; overflow-wrap: anywhere; }
|
|
290
|
+
.harness-tool-details:has(.harness-agent-title) > summary .harness-tool-chevron { opacity: 1; }
|
|
264
291
|
.harness-agent-separator { flex: 0 0 auto; color: var(--harness-fg-muted); }
|
|
265
|
-
.harness-agent-name[data-color="blue"] { color: #0369a1; } .harness-agent-name[data-color="cyan"] { color: #0e7490; }
|
|
266
|
-
.harness-agent-name[data-color="green"] { color: #047857; } .harness-agent-name[data-color="orange"] { color: #c2410c; }
|
|
267
|
-
.harness-agent-name[data-color="pink"] { color: #be185d; } .harness-agent-name[data-color="purple"] { color: #6d28d9; }
|
|
268
|
-
.harness-agent-name[data-color="red"] { color: #be123c; } .harness-agent-name[data-color="yellow"] { color: #b45309; }
|
|
269
|
-
[data-theme="dark"] .harness-agent-name[data-color="blue"] { color: #7dd3fc; } [data-theme="dark"] .harness-agent-name[data-color="cyan"] { color: #67e8f9; }
|
|
270
|
-
[data-theme="dark"] .harness-agent-name[data-color="green"] { color: #6ee7b7; } [data-theme="dark"] .harness-agent-name[data-color="orange"] { color: #fdba74; }
|
|
271
|
-
[data-theme="dark"] .harness-agent-name[data-color="pink"] { color: #f9a8d4; } [data-theme="dark"] .harness-agent-name[data-color="purple"] { color: #c4b5fd; }
|
|
272
|
-
[data-theme="dark"] .harness-agent-name[data-color="red"] { color: #fda4af; } [data-theme="dark"] .harness-agent-name[data-color="yellow"] { color: #fcd34d; }
|
|
273
292
|
|
|
274
293
|
.harness-subagent-pane { padding: 16px; height: 100%; min-height: 0; overflow: auto; }
|
|
275
294
|
.harness-subagent-window-notice { font-size: 12px; color: var(--harness-fg-muted, #888); }
|
package/src/view.mjs
CHANGED
|
@@ -16,9 +16,9 @@ import { latestSummaryLine } from './summary-playback.mjs';
|
|
|
16
16
|
// React binding in components.mjs maps this tree to React.createElement and
|
|
17
17
|
// attaches delegated event handlers on the root.
|
|
18
18
|
|
|
19
|
-
import { visibleItems, isWaitingForFirstToken, planProgress, DEFAULT_LABELS } from "./project.mjs";
|
|
19
|
+
import { visibleItems, isWaitingForFirstToken, planProgress, resolvedDelegateAttempts, DEFAULT_LABELS } from "./project.mjs";
|
|
20
20
|
import { latestNonEmptyLine, truncateText } from "./summary.mjs";
|
|
21
|
-
import { renderTool } from "./renderers.mjs";
|
|
21
|
+
import { renderTool, subagentRoleColors } from "./renderers.mjs";
|
|
22
22
|
import { isRetryableEditFailure } from "./tool-error.mjs";
|
|
23
23
|
import { toolIdentity } from "./tool-identity.mjs";
|
|
24
24
|
import { activityGroups, activityGroupSummary } from './activity-groups.mjs';
|
|
@@ -160,6 +160,8 @@ export function buildViewModel(state, options = {}) {
|
|
|
160
160
|
// destructure must not clobber the defaults.
|
|
161
161
|
opts.labels = { ...DEFAULT_LABELS, ...(options.labels || {}) };
|
|
162
162
|
const items = visibleItems(state);
|
|
163
|
+
opts.resolvedDelegateAttempts = resolvedDelegateAttempts(items);
|
|
164
|
+
opts.subagentRoleColors = subagentRoleColors(items);
|
|
163
165
|
const plan = planProgress(state);
|
|
164
166
|
const rootChildren = [];
|
|
165
167
|
if (plan && opts.showPlanDock !== false) rootChildren.push(planDock(plan, opts));
|