@volter-ai-dev/supercode-ui 0.1.69 → 0.1.71
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 +37 -1
- package/activity.mjs +5 -1235
- package/chunks/chunk-ATCOWFRV.mjs +105 -0
- package/chunks/chunk-LOP6XOON.mjs +671 -0
- package/chunks/chunk-LQMYNJPU.mjs +120 -0
- package/chunks/chunk-LS6JBXNT.mjs +1237 -0
- package/chunks/chunk-O7Q2PELK.mjs +201 -0
- package/chunks/chunk-OW42DS6P.mjs +842 -0
- package/chunks/chunk-SJ3YTA6Z.mjs +316 -0
- package/chunks/chunk-SSYNT434.mjs +224 -0
- package/chunks/chunk-V3UM7H7W.mjs +328 -0
- package/chunks/chunk-XD2WJYSL.mjs +29 -0
- package/chunks/chunk-ZLYHUYE2.mjs +62 -0
- package/components.d.ts +3 -0
- package/components.mjs +59 -3766
- package/composer.mjs +8 -580
- package/conversation.mjs +16 -1373
- package/embed.mjs +15 -3681
- package/icon.mjs +3 -58
- package/index.d.ts +25 -0
- package/logo.mjs +5 -87
- package/messenger.d.ts +3 -0
- package/messenger.mjs +21 -3677
- package/package.json +3 -2
- package/react/activity.mjs +5 -1235
- package/react/chunks/chunk-2RIHDJT6.mjs +842 -0
- package/react/chunks/chunk-7ES5FSLG.mjs +316 -0
- package/react/chunks/chunk-GV5KV5UY.mjs +105 -0
- package/react/chunks/chunk-GYQOTTZ5.mjs +224 -0
- package/react/chunks/chunk-LS6JBXNT.mjs +1237 -0
- package/react/chunks/chunk-OINC7LV7.mjs +62 -0
- package/react/chunks/chunk-TQHX2DQG.mjs +120 -0
- package/react/chunks/chunk-UKHDCPME.mjs +328 -0
- package/react/chunks/chunk-UKMTRNJN.mjs +671 -0
- package/react/chunks/chunk-ZM5X5LOF.mjs +29 -0
- package/react/chunks/chunk-ZXD7NZXI.mjs +201 -0
- package/react/components.mjs +59 -3766
- package/react/composer.mjs +8 -580
- package/react/conversation.mjs +16 -1373
- package/react/icon.mjs +3 -58
- package/react/index.d.ts +25 -0
- package/react/logo.mjs +5 -87
- package/react/messenger.d.ts +3 -0
- package/react/messenger.mjs +21 -3677
- package/react/sessions.mjs +9 -519
- package/react/settings.mjs +9 -425
- package/react/subagents.mjs +8 -1546
- package/sessions.mjs +9 -519
- package/settings.mjs +9 -425
- package/styles.css +12 -0
- package/subagents.mjs +8 -1546
package/activity.mjs
CHANGED
|
@@ -1,1238 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
goose: "Goose",
|
|
7
|
-
opencode: "OpenCode",
|
|
8
|
-
pi: "Pi",
|
|
9
|
-
grok: "Grok"
|
|
10
|
-
});
|
|
11
|
-
var DEFAULT_LABELS = Object.freeze({
|
|
12
|
-
chats: "Chats",
|
|
13
|
-
newChat: "New chat",
|
|
14
|
-
searchChats: "Search chats",
|
|
15
|
-
askAgent: "Ask your agent\u2026",
|
|
16
|
-
attachContext: "Attach files or images",
|
|
17
|
-
continueHere: "Continue here",
|
|
18
|
-
continueWithTerminal: "Continue with terminal",
|
|
19
|
-
joinLive: "Join live",
|
|
20
|
-
forkHere: "Fork here"
|
|
21
|
-
});
|
|
22
|
-
var EMPTY_UI_STATE = Object.freeze({
|
|
23
|
-
pill: Object.freeze({ tone: "off", label: "connecting\u2026" }),
|
|
24
|
-
startup: "connecting",
|
|
25
|
-
transcript: Object.freeze([]),
|
|
26
|
-
busy: false,
|
|
27
|
-
operation: null,
|
|
28
|
-
needsInput: false,
|
|
29
|
-
harness: "",
|
|
30
|
-
mode: "none",
|
|
31
|
-
strategy: null,
|
|
32
|
-
participant: Object.freeze({ kind: "local-user", label: null, origin: null }),
|
|
33
|
-
workspaceRef: Object.freeze({ kind: "none", value: null }),
|
|
34
|
-
mirror: null,
|
|
35
|
-
holder: null,
|
|
36
|
-
canSend: false,
|
|
37
|
-
canSteer: false,
|
|
38
|
-
canResume: false,
|
|
39
|
-
supportsResume: false,
|
|
40
|
-
continuationModes: Object.freeze([]),
|
|
41
|
-
canBranch: false,
|
|
42
|
-
supportsBranch: false,
|
|
43
|
-
canAttach: false,
|
|
44
|
-
supportsAttach: false,
|
|
45
|
-
canDetach: false,
|
|
46
|
-
canOpenTerminal: false,
|
|
47
|
-
canExport: false,
|
|
48
|
-
canReduce: false,
|
|
49
|
-
canInterrupt: false,
|
|
50
|
-
canRespond: false,
|
|
51
|
-
canConfigureSettings: false,
|
|
52
|
-
messaging: null,
|
|
53
|
-
workspace: "",
|
|
54
|
-
taskPlan: Object.freeze({ source: "none", items: Object.freeze([]), residueCount: 0, observedAt: null }),
|
|
55
|
-
semantics: Object.freeze({ fidelity: null, residue: Object.freeze([]), residueCount: 0, parseErrors: 0, rawRecords: 0, subagents: Object.freeze([]) }),
|
|
56
|
-
terminalHandoff: null,
|
|
57
|
-
exportBackTarget: null,
|
|
58
|
-
exportReceipt: null,
|
|
59
|
-
reductionReceipt: null,
|
|
60
|
-
interopSettings: null,
|
|
61
|
-
interopSettingsError: null,
|
|
62
|
-
harnessAuthentication: null,
|
|
63
|
-
error: null,
|
|
64
|
-
recoverable: false,
|
|
65
|
-
harnesses: Object.freeze([]),
|
|
66
|
-
history: Object.freeze({ sessionLimit: 0, hasMoreSessions: false, transcriptLimit: 120, hasEarlier: false }),
|
|
67
|
-
savedDraft: "",
|
|
68
|
-
attention: Object.freeze([]),
|
|
69
|
-
sessions: Object.freeze([]),
|
|
70
|
-
subagentInspector: null,
|
|
71
|
-
attached: null,
|
|
72
|
-
owned: null,
|
|
73
|
-
attachError: null,
|
|
74
|
-
agentPackage: null,
|
|
75
|
-
contributions: Object.freeze([]),
|
|
76
|
-
agentPackageError: null,
|
|
77
|
-
agentPackageCapabilityState: null,
|
|
78
|
-
agentPackageCapabilityError: null
|
|
79
|
-
});
|
|
80
|
-
var ROLES = /* @__PURE__ */ new Set(["system", "user", "assistant", "tool", "reasoning", "request", "notice"]);
|
|
81
|
-
var MODES = /* @__PURE__ */ new Set(["none", "control", "mirror"]);
|
|
82
|
-
var STRATEGIES = /* @__PURE__ */ new Set(["start", "resume", "attach", "branch", "reduce"]);
|
|
83
|
-
var STARTUP = /* @__PURE__ */ new Set(["connecting", "starting", "discovering", "ready"]);
|
|
84
|
-
var FIDELITY = /* @__PURE__ */ new Set(["byte_lossless", "value_lossless", "semantic"]);
|
|
85
|
-
var TOOL_CATEGORIES = /* @__PURE__ */ new Set(["read", "search", "edit", "command", "test", "web", "agent", "plan", "other"]);
|
|
86
|
-
var TOOL_DETAILS = /* @__PURE__ */ new Set(["file", "matches", "diff", "terminal", "web", "agent", "plan", "fields"]);
|
|
87
|
-
var AUTHENTICATION_PHASES = /* @__PURE__ */ new Set(["idle", "checking", "required", "configured", "unavailable", "launching", "awaiting_user", "verifying", "authenticated", "failed", "cancelled"]);
|
|
88
|
-
var MAX_TOOL_FIELDS = 8;
|
|
89
|
-
var MAX_TOOL_FIELD_CHARS = 800;
|
|
90
|
-
var MAX_TOOL_PREVIEW_CHARS = 4e3;
|
|
91
|
-
var MAX_CONTRIBUTIONS = 64;
|
|
92
|
-
var MAX_CONTRIBUTION_JSON_DEPTH = 12;
|
|
93
|
-
var MAX_CONTRIBUTION_COLLECTION = 100;
|
|
94
|
-
var MAX_CONTRIBUTION_STRING_CHARS = 16e3;
|
|
95
|
-
function record(value) {
|
|
96
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
97
|
-
}
|
|
98
|
-
function readHarnessAuthentication(value) {
|
|
99
|
-
const flow = record(value);
|
|
100
|
-
if (flow?.schema !== "supercode.harness-authentication-flow.v1" || !AUTHENTICATION_PHASES.has(flow.phase)) return null;
|
|
101
|
-
const plan = record(flow.plan);
|
|
102
|
-
const error = record(flow.error);
|
|
103
|
-
return {
|
|
104
|
-
schema: "supercode.harness-authentication-flow.v1",
|
|
105
|
-
revision: Number.isSafeInteger(flow.revision) ? Math.max(0, flow.revision) : 0,
|
|
106
|
-
phase: flow.phase,
|
|
107
|
-
harness: typeof flow.harness === "string" ? boundedString(flow.harness, 100) : null,
|
|
108
|
-
plan: plan ? {
|
|
109
|
-
method: plan.method === "device_code" ? "device_code" : "browser",
|
|
110
|
-
interaction: plan.interaction === "device_code" ? "device_code" : "browser",
|
|
111
|
-
browserBehavior: plan.browserBehavior === "none" ? "none" : "native_auto",
|
|
112
|
-
headless: plan.headless === true,
|
|
113
|
-
instructions: boundedString(plan.instructions, 2e3)
|
|
114
|
-
} : null,
|
|
115
|
-
error: error && typeof error.message === "string" ? { code: boundedString(error.code, 100), message: boundedString(error.message, 2e3) } : null
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
function string(value, fallback = "") {
|
|
119
|
-
return typeof value === "string" ? value : fallback;
|
|
120
|
-
}
|
|
121
|
-
function number(value, fallback = 0) {
|
|
122
|
-
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
123
|
-
}
|
|
124
|
-
function nullableNumber(value) {
|
|
125
|
-
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
126
|
-
}
|
|
127
|
-
function relativeContributionPath(value) {
|
|
128
|
-
if (typeof value !== "string" || value.startsWith("/") || /^[a-z]:[\\/]/i.test(value)) return null;
|
|
129
|
-
return value.replaceAll("\\", "/").split("/").some((segment) => segment === "..") ? null : boundedString(value, 1e3);
|
|
130
|
-
}
|
|
131
|
-
function contributionJson(value, depth = 0, seen = /* @__PURE__ */ new WeakSet()) {
|
|
132
|
-
if (value === null || typeof value === "boolean" || typeof value === "string") {
|
|
133
|
-
return typeof value === "string" ? boundedString(value, MAX_CONTRIBUTION_STRING_CHARS) : value;
|
|
134
|
-
}
|
|
135
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
136
|
-
if (depth >= MAX_CONTRIBUTION_JSON_DEPTH || !value || typeof value !== "object" || seen.has(value)) {
|
|
137
|
-
return void 0;
|
|
138
|
-
}
|
|
139
|
-
seen.add(value);
|
|
140
|
-
if (Array.isArray(value)) {
|
|
141
|
-
const result2 = [];
|
|
142
|
-
for (const item of value.slice(0, MAX_CONTRIBUTION_COLLECTION)) {
|
|
143
|
-
const normalized = contributionJson(item, depth + 1, seen);
|
|
144
|
-
if (normalized !== void 0) result2.push(normalized);
|
|
145
|
-
}
|
|
146
|
-
seen.delete(value);
|
|
147
|
-
return result2;
|
|
148
|
-
}
|
|
149
|
-
const source = record(value);
|
|
150
|
-
if (!source) return void 0;
|
|
151
|
-
const result = {};
|
|
152
|
-
for (const [key, item] of Object.entries(source).slice(0, MAX_CONTRIBUTION_COLLECTION)) {
|
|
153
|
-
const normalized = contributionJson(item, depth + 1, seen);
|
|
154
|
-
if (normalized !== void 0) result[boundedString(key, 200)] = normalized;
|
|
155
|
-
}
|
|
156
|
-
seen.delete(value);
|
|
157
|
-
return result;
|
|
158
|
-
}
|
|
159
|
-
function normalizeContributions(value) {
|
|
160
|
-
if (!Array.isArray(value)) return [];
|
|
161
|
-
return value.slice(0, MAX_CONTRIBUTIONS).flatMap((candidate) => {
|
|
162
|
-
const item = record(candidate);
|
|
163
|
-
const placement = record(item?.placement);
|
|
164
|
-
const source = relativeContributionPath(item?.source);
|
|
165
|
-
if (item?.schema !== "supercode/contribution-v1" || typeof item.id !== "string" || !item.id.trim() || typeof item.kind !== "string" || !item.kind.trim() || source === null) return [];
|
|
166
|
-
const data = contributionJson(item.data);
|
|
167
|
-
if (data === void 0) return [];
|
|
168
|
-
return [{
|
|
169
|
-
schema: "supercode/contribution-v1",
|
|
170
|
-
id: boundedString(item.id, 200),
|
|
171
|
-
kind: boundedString(item.kind, 100),
|
|
172
|
-
...typeof item.title === "string" ? { title: boundedString(item.title, 500) } : {},
|
|
173
|
-
...placement ? { placement: {
|
|
174
|
-
...typeof placement.surface === "string" ? { surface: boundedString(placement.surface, 100) } : {},
|
|
175
|
-
...typeof placement.region === "string" ? { region: boundedString(placement.region, 100) } : {}
|
|
176
|
-
} } : {},
|
|
177
|
-
data,
|
|
178
|
-
source
|
|
179
|
-
}];
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
function readAgentPackage(value) {
|
|
183
|
-
const agentPackage = record(value);
|
|
184
|
-
const capabilities = record(agentPackage?.capabilities);
|
|
185
|
-
const storage = record(agentPackage?.storage);
|
|
186
|
-
const relativePath = relativeContributionPath(storage?.relativePath);
|
|
187
|
-
if (agentPackage?.schemaVersion !== 1 || typeof agentPackage.id !== "string" || typeof agentPackage.name !== "string" || typeof agentPackage.version !== "string" || !capabilities || !Array.isArray(capabilities.required) || !Array.isArray(capabilities.optional) || !storage || relativePath === null) return null;
|
|
188
|
-
const resources = record(agentPackage.resources);
|
|
189
|
-
return {
|
|
190
|
-
id: boundedString(agentPackage.id, 200),
|
|
191
|
-
name: boundedString(agentPackage.name, 500),
|
|
192
|
-
version: boundedString(agentPackage.version, 100),
|
|
193
|
-
description: typeof agentPackage.description === "string" ? boundedString(agentPackage.description, 2e3) : null,
|
|
194
|
-
capabilities: {
|
|
195
|
-
required: capabilities.required.filter((item) => typeof item === "string").slice(0, 100).map((item) => boundedString(item, 200)),
|
|
196
|
-
optional: capabilities.optional.filter((item) => typeof item === "string").slice(0, 100).map((item) => boundedString(item, 200))
|
|
197
|
-
},
|
|
198
|
-
storage: { relativePath },
|
|
199
|
-
resources: resources ? Object.fromEntries(Object.entries(resources).flatMap(([id, candidate]) => {
|
|
200
|
-
const state = record(candidate);
|
|
201
|
-
if (state?.schema !== "supercode/package-resource-state-v1") return [];
|
|
202
|
-
if (state.status === "absent" && typeof state.contributionId === "string") {
|
|
203
|
-
return [[boundedString(id, 200), {
|
|
204
|
-
schema: "supercode/package-resource-state-v1",
|
|
205
|
-
status: "absent",
|
|
206
|
-
contributionId: boundedString(state.contributionId, 200)
|
|
207
|
-
}]];
|
|
208
|
-
}
|
|
209
|
-
if (state.status === "error" && typeof state.contributionId === "string" && typeof state.message === "string") {
|
|
210
|
-
return [[boundedString(id, 200), {
|
|
211
|
-
schema: "supercode/package-resource-state-v1",
|
|
212
|
-
status: "error",
|
|
213
|
-
contributionId: boundedString(state.contributionId, 200),
|
|
214
|
-
message: boundedString(state.message)
|
|
215
|
-
}]];
|
|
216
|
-
}
|
|
217
|
-
const resource = record(state?.resource);
|
|
218
|
-
const data = contributionJson(resource?.data);
|
|
219
|
-
if (state?.status !== "ready" || resource?.schema !== "supercode/package-resource-v1" || typeof resource.contributionId !== "string" || !["json", "text"].includes(resource.format) || typeof resource.mediaType !== "string" || data === void 0) return [];
|
|
220
|
-
return [[boundedString(id, 200), {
|
|
221
|
-
schema: "supercode/package-resource-state-v1",
|
|
222
|
-
status: "ready",
|
|
223
|
-
resource: {
|
|
224
|
-
schema: "supercode/package-resource-v1",
|
|
225
|
-
contributionId: boundedString(resource.contributionId, 200),
|
|
226
|
-
format: resource.format,
|
|
227
|
-
mediaType: boundedString(resource.mediaType, 200),
|
|
228
|
-
data
|
|
229
|
-
}
|
|
230
|
-
}]];
|
|
231
|
-
})) : {}
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
function readAgentPackageCapabilityState(value) {
|
|
235
|
-
const state = record(value);
|
|
236
|
-
if (!state) return null;
|
|
237
|
-
const fields = ["availableRequired", "missingRequired", "enabledOptional", "unavailableOptional"];
|
|
238
|
-
if (!fields.every((field) => Array.isArray(state[field]))) return null;
|
|
239
|
-
return {
|
|
240
|
-
ready: state.ready === true,
|
|
241
|
-
...Object.fromEntries(fields.map((field) => [
|
|
242
|
-
field,
|
|
243
|
-
state[field].filter((item) => typeof item === "string").slice(0, 100).map((item) => boundedString(item, 200))
|
|
244
|
-
]))
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
function boundedString(value, max = 2e3) {
|
|
248
|
-
if (typeof value !== "string") return "";
|
|
249
|
-
return value.length <= max ? value : `${value.slice(0, max)}\u2026`;
|
|
250
|
-
}
|
|
251
|
-
function argumentValue(argumentsText) {
|
|
252
|
-
if (!argumentsText) return null;
|
|
253
|
-
try {
|
|
254
|
-
return JSON.parse(argumentsText);
|
|
255
|
-
} catch {
|
|
256
|
-
return null;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
function firstString(source, keys) {
|
|
260
|
-
for (const key of keys) {
|
|
261
|
-
if (typeof source?.[key] === "string" && source[key].trim()) return source[key].trim();
|
|
262
|
-
}
|
|
263
|
-
return "";
|
|
264
|
-
}
|
|
265
|
-
function decodedLiteral(value) {
|
|
266
|
-
if (!value) return "";
|
|
267
|
-
if (value.startsWith('"')) {
|
|
268
|
-
try {
|
|
269
|
-
return JSON.parse(value);
|
|
270
|
-
} catch {
|
|
271
|
-
return "";
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return value.slice(1, -1).replaceAll("\\n", "\n").replaceAll("\\t", " ").replaceAll("\\r", "\r").replaceAll("\\`", "`").replaceAll("\\'", "'").replaceAll("\\\\", "\\");
|
|
275
|
-
}
|
|
276
|
-
function sourceString(source, keys) {
|
|
277
|
-
if (!source) return "";
|
|
278
|
-
const names = keys.join("|");
|
|
279
|
-
const match = new RegExp(`(?:^|[,{\\s])["']?(?:${names})["']?\\s*:\\s*("(?:\\\\.|[^"\\\\])*"|'(?:\\\\.|[^'\\\\])*'|\`(?:\\\\.|[^\`\\\\])*\`)`).exec(source);
|
|
280
|
-
return decodedLiteral(match?.[1]);
|
|
281
|
-
}
|
|
282
|
-
function assignedString(source, keys) {
|
|
283
|
-
if (!source) return "";
|
|
284
|
-
const names = keys.join("|");
|
|
285
|
-
const match = new RegExp(`\\b(?:${names})\\s*=\\s*("(?:\\\\.|[^"\\\\])*"|'(?:\\\\.|[^'\\\\])*'|\`(?:\\\\.|[^\`\\\\])*\`)`).exec(source);
|
|
286
|
-
return decodedLiteral(match?.[1]);
|
|
287
|
-
}
|
|
288
|
-
function callArgumentSource(source, open) {
|
|
289
|
-
let depth = 1;
|
|
290
|
-
let quote = "";
|
|
291
|
-
let escaped = false;
|
|
292
|
-
let lineComment = false;
|
|
293
|
-
let blockComment = false;
|
|
294
|
-
for (let index = open + 1; index < source.length; index += 1) {
|
|
295
|
-
const char = source[index];
|
|
296
|
-
const next = source[index + 1];
|
|
297
|
-
if (lineComment) {
|
|
298
|
-
if (char === "\n") lineComment = false;
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
if (blockComment) {
|
|
302
|
-
if (char === "*" && next === "/") {
|
|
303
|
-
blockComment = false;
|
|
304
|
-
index += 1;
|
|
305
|
-
}
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
if (quote) {
|
|
309
|
-
if (escaped) escaped = false;
|
|
310
|
-
else if (char === "\\") escaped = true;
|
|
311
|
-
else if (char === quote) quote = "";
|
|
312
|
-
continue;
|
|
313
|
-
}
|
|
314
|
-
if (char === "/" && next === "/") {
|
|
315
|
-
lineComment = true;
|
|
316
|
-
index += 1;
|
|
317
|
-
continue;
|
|
318
|
-
}
|
|
319
|
-
if (char === "/" && next === "*") {
|
|
320
|
-
blockComment = true;
|
|
321
|
-
index += 1;
|
|
322
|
-
continue;
|
|
323
|
-
}
|
|
324
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
325
|
-
quote = char;
|
|
326
|
-
continue;
|
|
327
|
-
}
|
|
328
|
-
if (char === "(") depth += 1;
|
|
329
|
-
else if (char === ")" && (depth -= 1) === 0) return source.slice(open + 1, index);
|
|
330
|
-
}
|
|
331
|
-
return source.slice(open + 1);
|
|
332
|
-
}
|
|
333
|
-
function toolCalls(source) {
|
|
334
|
-
const calls = [];
|
|
335
|
-
let quote = "";
|
|
336
|
-
let escaped = false;
|
|
337
|
-
let lineComment = false;
|
|
338
|
-
let blockComment = false;
|
|
339
|
-
for (let index = 0; index < source.length && calls.length < 8; index += 1) {
|
|
340
|
-
const char = source[index];
|
|
341
|
-
const next = source[index + 1];
|
|
342
|
-
if (lineComment) {
|
|
343
|
-
if (char === "\n") lineComment = false;
|
|
344
|
-
continue;
|
|
345
|
-
}
|
|
346
|
-
if (blockComment) {
|
|
347
|
-
if (char === "*" && next === "/") {
|
|
348
|
-
blockComment = false;
|
|
349
|
-
index += 1;
|
|
350
|
-
}
|
|
351
|
-
continue;
|
|
352
|
-
}
|
|
353
|
-
if (quote) {
|
|
354
|
-
if (escaped) escaped = false;
|
|
355
|
-
else if (char === "\\") escaped = true;
|
|
356
|
-
else if (char === quote) quote = "";
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
if (char === "/" && next === "/") {
|
|
360
|
-
lineComment = true;
|
|
361
|
-
index += 1;
|
|
362
|
-
continue;
|
|
363
|
-
}
|
|
364
|
-
if (char === "/" && next === "*") {
|
|
365
|
-
blockComment = true;
|
|
366
|
-
index += 1;
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
370
|
-
quote = char;
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
if (!source.startsWith("tools.", index) || /[A-Za-z0-9_$]/.test(source[index - 1] ?? "")) continue;
|
|
374
|
-
const nameStart = index + 6;
|
|
375
|
-
let nameEnd = nameStart;
|
|
376
|
-
while (/[A-Za-z0-9_$]/.test(source[nameEnd] ?? "")) nameEnd += 1;
|
|
377
|
-
let open = nameEnd;
|
|
378
|
-
while (/\s/.test(source[open] ?? "")) open += 1;
|
|
379
|
-
if (nameEnd === nameStart || source[open] !== "(") continue;
|
|
380
|
-
calls.push({ name: source.slice(nameStart, nameEnd), arguments: callArgumentSource(source, open) });
|
|
381
|
-
index = open;
|
|
382
|
-
}
|
|
383
|
-
return calls;
|
|
384
|
-
}
|
|
385
|
-
function toolEnvelope(entry) {
|
|
386
|
-
const value = argumentValue(entry.arguments);
|
|
387
|
-
const source = typeof value === "string" ? value : value === null ? entry.arguments ?? "" : "";
|
|
388
|
-
const calls = source ? toolCalls(source) : [];
|
|
389
|
-
const tools = [...new Set(calls.map((call) => call.name))];
|
|
390
|
-
const name = tools.length === 1 ? tools[0] : entry.label ?? "tool";
|
|
391
|
-
return { args: record(value), source, callSource: calls[0]?.arguments ?? "", tools, name };
|
|
392
|
-
}
|
|
393
|
-
function patchPath(source) {
|
|
394
|
-
return /\*\*\* (?:Update|Add|Delete) File:\s*([^\r\n]*?)(?=\\[nr]|[\r\n]|$)/.exec(source)?.[1]?.trim() ?? "";
|
|
395
|
-
}
|
|
396
|
-
function explicitNumber(sources, keys) {
|
|
397
|
-
for (const source of sources) {
|
|
398
|
-
for (const key of keys) {
|
|
399
|
-
const value = source?.[key];
|
|
400
|
-
const parsed = typeof value === "string" && value.trim() !== "" ? Number(value) : value;
|
|
401
|
-
if (typeof parsed === "number" && Number.isFinite(parsed)) return parsed;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
return null;
|
|
405
|
-
}
|
|
406
|
-
function toolDetail(category) {
|
|
407
|
-
return { read: "file", search: "matches", edit: "diff", command: "terminal", test: "terminal", web: "web", agent: "agent", plan: "plan" }[category] ?? "fields";
|
|
408
|
-
}
|
|
409
|
-
function usefulToolFields(args) {
|
|
410
|
-
if (!args) return [];
|
|
411
|
-
const hidden = /* @__PURE__ */ new Set(["command", "cmd", "file_path", "target_file", "path", "query", "pattern", "url", "patch", "diff", "old_string", "new_string", "content", "prompt", "description", "task", "plan", "todos"]);
|
|
412
|
-
return Object.entries(args).flatMap(([key, value]) => {
|
|
413
|
-
if (hidden.has(key) || value === null || value === void 0) return [];
|
|
414
|
-
const rendered = typeof value === "string" ? value : JSON.stringify(value);
|
|
415
|
-
if (!rendered) return [];
|
|
416
|
-
return [{ label: key.replaceAll(/[_-]+/g, " ").replace(/^./, (letter) => letter.toLocaleUpperCase()), value: boundedString(rendered, MAX_TOOL_FIELD_CHARS) }];
|
|
417
|
-
}).slice(0, MAX_TOOL_FIELDS);
|
|
418
|
-
}
|
|
419
|
-
function planItems(args) {
|
|
420
|
-
const source = Array.isArray(args?.plan) ? args.plan : Array.isArray(args?.todos) ? args.todos : [];
|
|
421
|
-
return source.flatMap((item) => {
|
|
422
|
-
if (typeof item === "string" && item.trim()) return [{ label: boundedString(item.trim(), 300), status: "" }];
|
|
423
|
-
const value = record(item);
|
|
424
|
-
const label = firstString(value, ["step", "title", "content", "text"]);
|
|
425
|
-
if (!label) return [];
|
|
426
|
-
return [{ label: boundedString(label, 300), status: firstString(value, ["status"]) }];
|
|
427
|
-
}).slice(0, 12);
|
|
428
|
-
}
|
|
429
|
-
function agentItems(name, resultText) {
|
|
430
|
-
if (!/list.?agents/i.test(name)) return [];
|
|
431
|
-
return (resultText ?? "").split("\n").flatMap((line) => {
|
|
432
|
-
const parts = line.trim().split(/\s+·\s+/).filter(Boolean);
|
|
433
|
-
return parts.length > 1 ? [{ label: boundedString(parts[0], 120), status: boundedString(parts.slice(1).join(" \xB7 "), 180) }] : [];
|
|
434
|
-
}).slice(0, 12);
|
|
435
|
-
}
|
|
436
|
-
function editPreview(args, resultText, source) {
|
|
437
|
-
const direct = firstString(args, ["patch", "diff"]);
|
|
438
|
-
if (direct) return direct;
|
|
439
|
-
const oldText = firstString(args, ["old_string"]);
|
|
440
|
-
const newText = firstString(args, ["new_string"]);
|
|
441
|
-
if (oldText || newText) {
|
|
442
|
-
return [
|
|
443
|
-
...oldText.split("\n").map((line) => `- ${line}`),
|
|
444
|
-
...newText.split("\n").map((line) => `+ ${line}`)
|
|
445
|
-
].join("\n");
|
|
446
|
-
}
|
|
447
|
-
const patch = /\*\*\* Begin Patch[\s\S]*?\*\*\* End Patch/.exec(source ?? "")?.[0];
|
|
448
|
-
if (patch) return patch;
|
|
449
|
-
return /^(?:diff --git|@@ |--- |\+\+\+ )/m.test(resultText ?? "") ? resultText : "";
|
|
450
|
-
}
|
|
451
|
-
function toolResultEnvelope(resultText) {
|
|
452
|
-
const match = /^Script (?:completed|failed)\r?\nWall time ([0-9.]+) seconds\r?\nOutput:\r?\n([\s\S]*)$/.exec(resultText ?? "");
|
|
453
|
-
if (!match) {
|
|
454
|
-
try {
|
|
455
|
-
const value = JSON.parse(resultText ?? "");
|
|
456
|
-
const object = record(value);
|
|
457
|
-
return {
|
|
458
|
-
preview: typeof value === "string" ? value : firstString(object, ["output", "message", "text", "summary", "result"]) || resultText || "",
|
|
459
|
-
value: object,
|
|
460
|
-
durationMs: null
|
|
461
|
-
};
|
|
462
|
-
} catch {
|
|
463
|
-
return { preview: resultText ?? "", value: null, durationMs: null };
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
const durationMs = Number(match[1]) * 1e3;
|
|
467
|
-
try {
|
|
468
|
-
const value = record(JSON.parse(match[2]));
|
|
469
|
-
return {
|
|
470
|
-
preview: typeof value?.output === "string" ? value.output : match[2],
|
|
471
|
-
value,
|
|
472
|
-
durationMs: Number.isFinite(durationMs) ? durationMs : null
|
|
473
|
-
};
|
|
474
|
-
} catch {
|
|
475
|
-
return { preview: match[2], value: null, durationMs: Number.isFinite(durationMs) ? durationMs : null };
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
function semanticAgentPreview(name, status, outcome) {
|
|
479
|
-
const normalized = name.toLocaleLowerCase();
|
|
480
|
-
if (status === "error") return outcome.preview;
|
|
481
|
-
if (/^(?:agent|task)$|spawn.?agent/.test(normalized) && outcome.preview) return "Agent is working in the background.";
|
|
482
|
-
if (/send.?message|followup.?task/.test(normalized) && outcome.preview) {
|
|
483
|
-
return /resumed from transcript|resumedAgentId/i.test(outcome.preview) ? "Agent resumed in the background." : "Message delivered.";
|
|
484
|
-
}
|
|
485
|
-
return outcome.preview;
|
|
486
|
-
}
|
|
487
|
-
function verificationCommand(command) {
|
|
488
|
-
let shell = "";
|
|
489
|
-
let quote = "";
|
|
490
|
-
let escaped = false;
|
|
491
|
-
for (const char of command) {
|
|
492
|
-
if (escaped) {
|
|
493
|
-
escaped = false;
|
|
494
|
-
shell += quote ? " " : char;
|
|
495
|
-
continue;
|
|
496
|
-
}
|
|
497
|
-
if (char === "\\") {
|
|
498
|
-
escaped = true;
|
|
499
|
-
shell += quote ? " " : char;
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
if (quote) {
|
|
503
|
-
if (char === quote) quote = "";
|
|
504
|
-
shell += " ";
|
|
505
|
-
continue;
|
|
506
|
-
}
|
|
507
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
508
|
-
quote = char;
|
|
509
|
-
shell += " ";
|
|
510
|
-
continue;
|
|
511
|
-
}
|
|
512
|
-
shell += char;
|
|
513
|
-
}
|
|
514
|
-
return /(?:^|[;&|]\s*)(?:(?:npm|pnpm|yarn|bun)\s+(?:run\s+)?(?:test|typecheck|lint|build)|cargo\s+(?:test|clippy|build|check|fmt)|npx\s+(?:vitest|tsc|eslint|playwright)|pytest\b|go\s+test\b)/i.test(shell);
|
|
515
|
-
}
|
|
516
|
-
function classifyTool(name, command) {
|
|
517
|
-
const normalized = name.toLocaleLowerCase();
|
|
518
|
-
if (/write_stdin|^wait$/.test(normalized)) return "command";
|
|
519
|
-
if (/update.?plan|todo|checklist|taskcreate|taskupdate|create.?goal|update.?goal/.test(normalized)) return "plan";
|
|
520
|
-
if (/search.?replace|edit|write|patch|replace|create_file|apply_patch/.test(normalized)) return "edit";
|
|
521
|
-
if (/read|view|open_file|list_dir/.test(normalized)) return "read";
|
|
522
|
-
if (/web.?search|web.?fetch|fetch.?url/.test(normalized)) return "web";
|
|
523
|
-
if (/search|find|grep|glob|toolsearch/.test(normalized)) return "search";
|
|
524
|
-
if (/browser|web|fetch|url/.test(normalized)) return "web";
|
|
525
|
-
if (/agent|subagent|send.?message|delegate|followup.?task|taskstop|taskoutput|^task$/.test(normalized)) return "agent";
|
|
526
|
-
if (/test|typecheck|lint|build/.test(normalized)) return "test";
|
|
527
|
-
if (/terminal|bash|shell|command|exec|write_stdin|^wait$/.test(normalized)) return verificationCommand(command) ? "test" : "command";
|
|
528
|
-
return "other";
|
|
529
|
-
}
|
|
530
|
-
function toolAction(status, category, name, tools) {
|
|
531
|
-
const position = status === "pending" ? 0 : status === "error" ? 2 : 1;
|
|
532
|
-
if (tools.length > 1) return [`Running ${tools.length} actions`, `Ran ${tools.length} actions`, `${tools.length} actions failed`][position];
|
|
533
|
-
const normalized = name.toLocaleLowerCase();
|
|
534
|
-
if (/send.?message|followup.?task/.test(normalized)) return ["Messaging agent", "Messaged agent", "Agent message failed"][position];
|
|
535
|
-
if (/taskstop|interrupt.?agent|kill_command_or_subagent/.test(normalized)) return ["Stopping agent", "Stopped agent", "Stop failed"][position];
|
|
536
|
-
if (/list.?agents|taskoutput|wait.?agent/.test(normalized)) return ["Checking agents", "Checked agents", "Agent check failed"][position];
|
|
537
|
-
if (/get_command_or_subagent_output|write_stdin|^wait$/.test(normalized)) return ["Waiting for", "Checked", "Check failed"][position];
|
|
538
|
-
if (/web.?search/.test(normalized)) return ["Searching web", "Searched web", "Web search failed"][position];
|
|
539
|
-
if (/web.?fetch|fetch.?url/.test(normalized)) return ["Fetching page", "Fetched page", "Page fetch failed"][position];
|
|
540
|
-
if (/^skill$|use.?skill|load.?skill/.test(normalized)) return ["Loading skill", "Loaded skill", "Skill load failed"][position];
|
|
541
|
-
if (/taskcreate/.test(normalized)) return ["Adding task", "Added task", "Task creation failed"][position];
|
|
542
|
-
if (/taskupdate/.test(normalized)) return ["Updating task", "Updated task", "Task update failed"][position];
|
|
543
|
-
if (/create.?goal/.test(normalized)) return ["Creating goal", "Created goal", "Goal creation failed"][position];
|
|
544
|
-
if (/update.?goal/.test(normalized)) return ["Updating goal", "Updated goal", "Goal update failed"][position];
|
|
545
|
-
const actions = {
|
|
546
|
-
read: ["Reading", "Read", "Read failed"],
|
|
547
|
-
search: ["Searching", "Searched", "Search failed"],
|
|
548
|
-
edit: ["Editing", "Edited", "Edit failed"],
|
|
549
|
-
command: ["Running command", "Ran command", "Command failed"],
|
|
550
|
-
test: ["Running tests", "Ran tests", "Tests failed"],
|
|
551
|
-
web: ["Browsing", "Browsed", "Browser action failed"],
|
|
552
|
-
agent: ["Starting agent", "Started agent", "Agent failed"],
|
|
553
|
-
plan: ["Updating plan", "Updated plan", "Plan update failed"]
|
|
554
|
-
};
|
|
555
|
-
return actions[category]?.[position] ?? (status === "error" ? `${name} failed` : name.replaceAll(/[_-]+/g, " "));
|
|
556
|
-
}
|
|
557
|
-
function createToolPresentation(entry) {
|
|
558
|
-
const envelope = toolEnvelope(entry);
|
|
559
|
-
const args = envelope.args;
|
|
560
|
-
const outcome = toolResultEnvelope(entry.resultText);
|
|
561
|
-
const patchSource = assignedString(envelope.source, ["patch"]) || envelope.source;
|
|
562
|
-
const command = firstString(args, ["command", "cmd"]) || sourceString(envelope.callSource, ["command", "cmd"]);
|
|
563
|
-
const category = classifyTool(envelope.name, command || envelope.source || entry.arguments || "");
|
|
564
|
-
const path = firstString(args, ["file_path", "target_file", "target_directory", "path"]) || sourceString(envelope.callSource, ["file_path", "target_file", "target_directory", "path"]) || patchPath(patchSource);
|
|
565
|
-
const query = firstString(args, ["query", "pattern"]) || sourceString(envelope.callSource, ["query", "pattern", "q"]);
|
|
566
|
-
const url = firstString(args, ["url"]) || sourceString(envelope.callSource, ["url", "ref_id"]);
|
|
567
|
-
const subject = firstString(args, ["subject", "description", "summary", "task", "objective", "prompt"]) || sourceString(envelope.callSource, ["subject", "description", "summary", "task", "objective", "prompt"]);
|
|
568
|
-
const agentTarget = category === "agent" ? firstString(record(outcome.value), ["command", "name"]) || firstString(args, ["target", "task_name", "taskId", "task_id", "agentId", "agent_id", "resume", "team_name"]) || sourceString(envelope.callSource, ["target", "task_name", "taskId", "task_id", "agentId", "agent_id", "resume", "team_name"]) : "";
|
|
569
|
-
const skillTarget = /^skill$|use.?skill|load.?skill/i.test(envelope.name) ? firstString(args, ["skill", "name"]) || sourceString(envelope.callSource, ["skill", "name"]) : "";
|
|
570
|
-
const background = /get_command_or_subagent_output|kill_command_or_subagent/i.test(envelope.name) ? "background task" : /write_stdin|^wait$/i.test(envelope.name) ? "background command" : "";
|
|
571
|
-
const items = category === "agent" ? agentItems(envelope.name, outcome.preview) : planItems(args);
|
|
572
|
-
const taskId = firstString(args, ["taskId", "task_id"]);
|
|
573
|
-
const planTarget = category === "plan" ? items.length ? `${items.length} ${items.length === 1 ? "item" : "items"}` : taskId ? `task ${taskId}` : "" : "";
|
|
574
|
-
const target = path || command || query || url || subject || agentTarget || skillTarget || background || planTarget || (envelope.tools.length > 1 ? `${envelope.tools.length} coordinated actions` : toolTarget(entry.arguments));
|
|
575
|
-
const previewSource = category === "edit" ? editPreview(args, outcome.preview, patchSource) : category === "agent" ? semanticAgentPreview(envelope.name, entry.status ?? "completed", outcome) : outcome.preview;
|
|
576
|
-
const result = record(entry.resultContent);
|
|
577
|
-
const metadata = record(entry.metadata);
|
|
578
|
-
const resultMetadata = record(result?.metadata);
|
|
579
|
-
return {
|
|
580
|
-
name: boundedString(envelope.name, 120),
|
|
581
|
-
action: boundedString(toolAction(entry.status ?? "completed", category, envelope.name, envelope.tools), 120),
|
|
582
|
-
category,
|
|
583
|
-
detail: toolDetail(category),
|
|
584
|
-
target: boundedString(target, 300),
|
|
585
|
-
command: boundedString(command, MAX_TOOL_FIELD_CHARS),
|
|
586
|
-
path: boundedString(path, MAX_TOOL_FIELD_CHARS),
|
|
587
|
-
query: boundedString(query, MAX_TOOL_FIELD_CHARS),
|
|
588
|
-
url: boundedString(url, MAX_TOOL_FIELD_CHARS),
|
|
589
|
-
subject: boundedString(subject, MAX_TOOL_FIELD_CHARS),
|
|
590
|
-
preview: boundedString(previewSource, MAX_TOOL_PREVIEW_CHARS),
|
|
591
|
-
fields: usefulToolFields(args),
|
|
592
|
-
items,
|
|
593
|
-
tools: envelope.tools,
|
|
594
|
-
exitCode: explicitNumber([outcome.value, result, resultMetadata, metadata], ["exit_code", "exitCode", "pi_bash_exit_code"]),
|
|
595
|
-
durationMs: explicitNumber([outcome.value, result, resultMetadata, metadata], ["duration_ms", "durationMs", "elapsed_ms", "elapsedMs", "totalDurationMs"]) ?? outcome.durationMs,
|
|
596
|
-
additions: explicitNumber([result, resultMetadata, metadata], ["additions", "lines_added"]),
|
|
597
|
-
deletions: explicitNumber([result, resultMetadata, metadata], ["deletions", "lines_removed"]),
|
|
598
|
-
matches: explicitNumber([result, resultMetadata, metadata], ["matches", "match_count", "result_count"])
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
function readToolPresentation(value, entry) {
|
|
602
|
-
const generated = createToolPresentation(entry);
|
|
603
|
-
const item = record(value);
|
|
604
|
-
if (!item) return generated;
|
|
605
|
-
const fields = Array.isArray(item.fields) ? item.fields.flatMap((raw) => {
|
|
606
|
-
const field = record(raw);
|
|
607
|
-
return field && typeof field.label === "string" && typeof field.value === "string" ? [{ label: boundedString(field.label, 80), value: boundedString(field.value, MAX_TOOL_FIELD_CHARS) }] : [];
|
|
608
|
-
}).slice(0, MAX_TOOL_FIELDS) : generated.fields;
|
|
609
|
-
const items = Array.isArray(item.items) ? item.items.flatMap((raw) => {
|
|
610
|
-
const planItem = record(raw);
|
|
611
|
-
return planItem && typeof planItem.label === "string" ? [{ label: boundedString(planItem.label, 300), status: boundedString(planItem.status, 40) }] : [];
|
|
612
|
-
}).slice(0, 12) : generated.items;
|
|
613
|
-
const tools = Array.isArray(item.tools) ? item.tools.filter((tool) => typeof tool === "string").map((tool) => boundedString(tool, 120)).slice(0, 8) : generated.tools;
|
|
614
|
-
return {
|
|
615
|
-
name: boundedString(item.name, 120) || generated.name,
|
|
616
|
-
action: boundedString(item.action, 120) || generated.action,
|
|
617
|
-
category: TOOL_CATEGORIES.has(item.category) ? item.category : generated.category,
|
|
618
|
-
detail: TOOL_DETAILS.has(item.detail) ? item.detail : generated.detail,
|
|
619
|
-
target: boundedString(item.target, 300) || generated.target,
|
|
620
|
-
command: boundedString(item.command, MAX_TOOL_FIELD_CHARS) || generated.command,
|
|
621
|
-
path: boundedString(item.path, MAX_TOOL_FIELD_CHARS) || generated.path,
|
|
622
|
-
query: boundedString(item.query, MAX_TOOL_FIELD_CHARS) || generated.query,
|
|
623
|
-
url: boundedString(item.url, MAX_TOOL_FIELD_CHARS) || generated.url,
|
|
624
|
-
subject: boundedString(item.subject, MAX_TOOL_FIELD_CHARS) || generated.subject,
|
|
625
|
-
preview: boundedString(item.preview, MAX_TOOL_PREVIEW_CHARS) || generated.preview,
|
|
626
|
-
fields,
|
|
627
|
-
items,
|
|
628
|
-
tools,
|
|
629
|
-
exitCode: nullableNumber(item.exitCode) ?? generated.exitCode,
|
|
630
|
-
durationMs: nullableNumber(item.durationMs) ?? generated.durationMs,
|
|
631
|
-
additions: nullableNumber(item.additions) ?? generated.additions,
|
|
632
|
-
deletions: nullableNumber(item.deletions) ?? generated.deletions,
|
|
633
|
-
matches: nullableNumber(item.matches) ?? generated.matches
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
var OPAQUE_RAW_CHARS = 4e3;
|
|
637
|
-
function opaqueEntry(item) {
|
|
638
|
-
const previouslyOpaque = item.role === "opaque";
|
|
639
|
-
let raw;
|
|
640
|
-
if (previouslyOpaque && typeof item.raw === "string") {
|
|
641
|
-
raw = item.raw;
|
|
642
|
-
} else {
|
|
643
|
-
try {
|
|
644
|
-
raw = JSON.stringify(item, null, 2) ?? "";
|
|
645
|
-
} catch {
|
|
646
|
-
raw = "[unserializable entry payload]";
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
const kind = previouslyOpaque && typeof item.kind === "string" ? item.kind : typeof item.role === "string" ? item.role : "";
|
|
650
|
-
return {
|
|
651
|
-
id: item.id,
|
|
652
|
-
role: "opaque",
|
|
653
|
-
kind: boundedString(kind, 120) || "unknown",
|
|
654
|
-
text: typeof item.text === "string" ? boundedString(item.text, OPAQUE_RAW_CHARS) : "",
|
|
655
|
-
ts: nullableNumber(item.ts),
|
|
656
|
-
truncated: item.truncated === true || raw.length > OPAQUE_RAW_CHARS,
|
|
657
|
-
raw: boundedString(raw, OPAQUE_RAW_CHARS)
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
function readTranscript(value) {
|
|
661
|
-
if (!Array.isArray(value)) return [];
|
|
662
|
-
const result = [];
|
|
663
|
-
for (const candidate of value) {
|
|
664
|
-
const item = record(candidate);
|
|
665
|
-
if (!item || typeof item.id !== "string") continue;
|
|
666
|
-
if (typeof item.text !== "string" || !ROLES.has(item.role)) {
|
|
667
|
-
result.push(opaqueEntry(item));
|
|
668
|
-
continue;
|
|
669
|
-
}
|
|
670
|
-
const entry = {
|
|
671
|
-
id: item.id,
|
|
672
|
-
role: item.role,
|
|
673
|
-
text: item.text,
|
|
674
|
-
ts: nullableNumber(item.ts),
|
|
675
|
-
truncated: item.truncated === true,
|
|
676
|
-
...Number.isSafeInteger(item.messageIndex) && item.messageIndex > 0 ? { messageIndex: item.messageIndex } : {}
|
|
677
|
-
};
|
|
678
|
-
for (const key of ["label", "arguments", "resultText", "code"]) {
|
|
679
|
-
if (typeof item[key] === "string") entry[key] = item[key];
|
|
680
|
-
}
|
|
681
|
-
if (["pending", "completed", "error"].includes(item.status)) entry.status = item.status;
|
|
682
|
-
if (item.role === "tool") entry.presentation = readToolPresentation(item.presentation, entry);
|
|
683
|
-
if (typeof item.streaming === "boolean") entry.streaming = item.streaming;
|
|
684
|
-
if (Array.isArray(item.context)) {
|
|
685
|
-
entry.context = item.context.flatMap((raw) => {
|
|
686
|
-
const context = record(raw);
|
|
687
|
-
return context && typeof context.label === "string" && typeof context.detail === "string" ? [{
|
|
688
|
-
...typeof context.id === "string" ? { id: context.id } : {},
|
|
689
|
-
...typeof context.kind === "string" ? { kind: context.kind } : {},
|
|
690
|
-
label: context.label,
|
|
691
|
-
detail: context.detail
|
|
692
|
-
}] : [];
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
if (Array.isArray(item.images)) {
|
|
696
|
-
entry.images = item.images.flatMap((raw) => {
|
|
697
|
-
const image = record(raw);
|
|
698
|
-
return image && typeof image.label === "string" ? [{
|
|
699
|
-
...typeof image.id === "string" ? { id: image.id } : {},
|
|
700
|
-
label: image.label,
|
|
701
|
-
...typeof image.url === "string" ? { url: image.url } : {},
|
|
702
|
-
...typeof image.reference === "string" && image.reference.length <= 4e3 ? { reference: image.reference } : {},
|
|
703
|
-
...typeof image.mediaType === "string" && image.mediaType.startsWith("image/") && image.mediaType.length <= 100 ? { mediaType: image.mediaType } : {},
|
|
704
|
-
...Number.isSafeInteger(image.byteSize) && image.byteSize >= 0 ? { byteSize: image.byteSize } : {}
|
|
705
|
-
}] : [];
|
|
706
|
-
}).slice(0, 4);
|
|
707
|
-
}
|
|
708
|
-
const request = record(item.request);
|
|
709
|
-
if (request && typeof request.requestKind === "string" && typeof request.payloadText === "string") {
|
|
710
|
-
entry.request = {
|
|
711
|
-
requestId: request.requestId,
|
|
712
|
-
requestKind: request.requestKind,
|
|
713
|
-
payloadText: request.payloadText,
|
|
714
|
-
options: Array.isArray(request.options) ? request.options.flatMap((raw) => {
|
|
715
|
-
const option = record(raw);
|
|
716
|
-
return option && typeof option.optionId === "string" && typeof option.name === "string" ? [{ optionId: option.optionId, name: option.name, kind: string(option.kind, "other") }] : [];
|
|
717
|
-
}) : [],
|
|
718
|
-
cancellable: request.cancellable === true,
|
|
719
|
-
status: request.status === "responded" ? "responded" : "pending",
|
|
720
|
-
resolution: record(request.resolution)
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
result.push(entry);
|
|
724
|
-
}
|
|
725
|
-
return result;
|
|
726
|
-
}
|
|
727
|
-
function readParticipant(value) {
|
|
728
|
-
const participant = record(value);
|
|
729
|
-
if (!participant) return { kind: "local-user", label: null, origin: null };
|
|
730
|
-
return {
|
|
731
|
-
kind: ["local-user", "foreign", "unknown"].includes(participant.kind) ? participant.kind : "unknown",
|
|
732
|
-
label: typeof participant.label === "string" && participant.label ? boundedString(participant.label, 200) : null,
|
|
733
|
-
origin: typeof participant.origin === "string" && participant.origin ? boundedString(participant.origin, 100) : null
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
function readWorkspaceRef(value, fallbackPath = "") {
|
|
737
|
-
const ref = record(value);
|
|
738
|
-
if (ref && ["repo", "none", "channel"].includes(ref.kind)) {
|
|
739
|
-
return {
|
|
740
|
-
kind: ref.kind,
|
|
741
|
-
value: ref.kind === "none" ? null : typeof ref.value === "string" && ref.value ? boundedString(ref.value, 500) : null
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
return fallbackPath ? { kind: "repo", value: boundedString(fallbackPath, 500) } : { kind: "none", value: null };
|
|
745
|
-
}
|
|
746
|
-
function readMirror(value) {
|
|
747
|
-
const mirror = record(value);
|
|
748
|
-
if (!mirror || typeof mirror.canonicalHarness !== "string" || !mirror.canonicalHarness) return null;
|
|
749
|
-
return {
|
|
750
|
-
canonicalHarness: boundedString(mirror.canonicalHarness, 100),
|
|
751
|
-
canonicalKey: typeof mirror.canonicalKey === "string" && mirror.canonicalKey ? boundedString(mirror.canonicalKey, 300) : null,
|
|
752
|
-
bounded: mirror.bounded === true,
|
|
753
|
-
truncated: mirror.truncated === true,
|
|
754
|
-
origin: typeof mirror.origin === "string" && mirror.origin ? boundedString(mirror.origin, 200) : null
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
function readHolder(value) {
|
|
758
|
-
const holder = record(value);
|
|
759
|
-
if (!holder) return null;
|
|
760
|
-
const surface = typeof holder.surface === "string" && holder.surface ? boundedString(holder.surface, 100) : null;
|
|
761
|
-
return {
|
|
762
|
-
surface,
|
|
763
|
-
canTakeOver: holder.canTakeOver === true && surface !== null && surface !== "supercode"
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
var TRIGGER_KINDS = ["human", "channel", "cron", "heartbeat", "webhook", "parent", "api", "unknown"];
|
|
767
|
-
function readTrigger(value) {
|
|
768
|
-
const trigger = record(value);
|
|
769
|
-
if (!trigger) return null;
|
|
770
|
-
const kind = trigger.kind === "manual" ? "human" : trigger.kind;
|
|
771
|
-
return {
|
|
772
|
-
kind: TRIGGER_KINDS.includes(kind) ? kind : "unknown",
|
|
773
|
-
label: typeof trigger.label === "string" && trigger.label ? boundedString(trigger.label, 200) : null,
|
|
774
|
-
surface: typeof trigger.surface === "string" && trigger.surface ? boundedString(trigger.surface, 300) : null
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
function readCrossSurface(value) {
|
|
778
|
-
const moved = record(value);
|
|
779
|
-
if (!moved || typeof moved.state !== "string" || !moved.state) return null;
|
|
780
|
-
return {
|
|
781
|
-
state: boundedString(moved.state, 100),
|
|
782
|
-
platform: typeof moved.platform === "string" && moved.platform ? boundedString(moved.platform, 100) : null,
|
|
783
|
-
error: typeof moved.error === "string" && moved.error ? boundedString(moved.error, 500) : null
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
function readRecurring(value) {
|
|
787
|
-
const recurring = record(value);
|
|
788
|
-
if (!recurring || typeof recurring.groupKey !== "string" || !recurring.groupKey) return null;
|
|
789
|
-
const runs = Number.isSafeInteger(recurring.runs) && recurring.runs > 0 ? recurring.runs : 1;
|
|
790
|
-
return {
|
|
791
|
-
groupKey: boundedString(recurring.groupKey, 300),
|
|
792
|
-
runs,
|
|
793
|
-
lastStatus: ["ok", "failed", "mixed"].includes(recurring.lastStatus) ? recurring.lastStatus : null
|
|
794
|
-
};
|
|
795
|
-
}
|
|
796
|
-
function readSessions(value) {
|
|
797
|
-
if (!Array.isArray(value)) return [];
|
|
798
|
-
return value.flatMap((raw) => {
|
|
799
|
-
const row = record(raw);
|
|
800
|
-
if (!row || typeof row.key !== "string" || typeof row.harness !== "string") return [];
|
|
801
|
-
return [{
|
|
802
|
-
key: row.key,
|
|
803
|
-
harness: row.harness,
|
|
804
|
-
name: string(row.name),
|
|
805
|
-
cwd: string(row.cwd),
|
|
806
|
-
title: string(row.title),
|
|
807
|
-
preview: string(row.preview),
|
|
808
|
-
age: string(row.age),
|
|
809
|
-
previewUpdatedAt: nullableNumber(row.previewUpdatedAt),
|
|
810
|
-
updatedAt: nullableNumber(row.updatedAt),
|
|
811
|
-
messages: nullableNumber(row.messages),
|
|
812
|
-
active: row.active === true,
|
|
813
|
-
writable: row.writable === true,
|
|
814
|
-
live: row.live === true,
|
|
815
|
-
runtimeStatus: row.runtimeStatus === "running" || row.runtimeStatus === "busy" || row.runtimeStatus === "idle" ? row.runtimeStatus : null,
|
|
816
|
-
...Number.isSafeInteger(row.subagentCount) && row.subagentCount > 0 ? { subagentCount: row.subagentCount } : {},
|
|
817
|
-
activity: ACTIVITY_PRIORITY[row.activity] !== void 0 ? row.activity : void 0,
|
|
818
|
-
...row.participant !== void 0 ? { participant: readParticipant(row.participant) } : {},
|
|
819
|
-
workspaceRef: readWorkspaceRef(row.workspaceRef, string(row.cwd)),
|
|
820
|
-
...readMirror(row.mirror) ? { mirror: readMirror(row.mirror) } : {},
|
|
821
|
-
...readTrigger(row.trigger) ? { trigger: readTrigger(row.trigger) } : {},
|
|
822
|
-
...readRecurring(row.recurring) ? { recurring: readRecurring(row.recurring) } : {},
|
|
823
|
-
...readCrossSurface(row.crossSurface) ? { crossSurface: readCrossSurface(row.crossSurface) } : {}
|
|
824
|
-
}];
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
function readSubagentInspector(value) {
|
|
828
|
-
const inspector = record(value);
|
|
829
|
-
if (!inspector || typeof inspector.parentKey !== "string" || !inspector.parentKey) return null;
|
|
830
|
-
return {
|
|
831
|
-
parentKey: inspector.parentKey,
|
|
832
|
-
parentTitle: boundedString(string(inspector.parentTitle), 500),
|
|
833
|
-
status: ["loading", "ready", "error"].includes(inspector.status) ? inspector.status : "loading",
|
|
834
|
-
items: readSessions(inspector.items).slice(0, 100),
|
|
835
|
-
selectedKey: typeof inspector.selectedKey === "string" && inspector.selectedKey ? inspector.selectedKey : null,
|
|
836
|
-
transcript: readTranscript(inspector.transcript).slice(-120),
|
|
837
|
-
error: typeof inspector.error === "string" ? boundedString(inspector.error) : null
|
|
838
|
-
};
|
|
839
|
-
}
|
|
840
|
-
function readAttached(value) {
|
|
841
|
-
const item = record(value);
|
|
842
|
-
if (!item || typeof item.harness !== "string") return null;
|
|
843
|
-
return { key: string(item.key), harness: item.harness, name: string(item.name), cwd: string(item.cwd), title: string(item.title) };
|
|
844
|
-
}
|
|
845
|
-
function readTaskPlan(value) {
|
|
846
|
-
const plan = record(value);
|
|
847
|
-
if (!plan) return { ...EMPTY_UI_STATE.taskPlan, items: [] };
|
|
848
|
-
return {
|
|
849
|
-
source: ["codex-update-plan", "claude-tasks", "opencode-todos"].includes(plan.source) ? plan.source : "none",
|
|
850
|
-
items: Array.isArray(plan.items) ? plan.items.flatMap((raw) => {
|
|
851
|
-
const item = record(raw);
|
|
852
|
-
if (!item || typeof item.id !== "string" || typeof item.title !== "string") return [];
|
|
853
|
-
return [{
|
|
854
|
-
id: item.id,
|
|
855
|
-
title: item.title,
|
|
856
|
-
status: ["pending", "in_progress", "completed", "cancelled", "unknown"].includes(item.status) ? item.status : "unknown",
|
|
857
|
-
...typeof item.nativeStatus === "string" ? { nativeStatus: item.nativeStatus } : {},
|
|
858
|
-
...Array.isArray(item.blockedBy) ? { blockedBy: item.blockedBy.filter((value2) => typeof value2 === "string") } : {}
|
|
859
|
-
}];
|
|
860
|
-
}) : [],
|
|
861
|
-
residueCount: number(plan.residueCount),
|
|
862
|
-
observedAt: nullableNumber(plan.observedAt)
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
function readSemantics(value) {
|
|
866
|
-
const semantics = record(value);
|
|
867
|
-
if (!semantics) return { ...EMPTY_UI_STATE.semantics, residue: [], subagents: [] };
|
|
868
|
-
return {
|
|
869
|
-
fidelity: FIDELITY.has(semantics.fidelity) ? semantics.fidelity : null,
|
|
870
|
-
residue: Array.isArray(semantics.residue) ? semantics.residue.filter((item) => typeof item === "string") : [],
|
|
871
|
-
residueCount: number(semantics.residueCount),
|
|
872
|
-
parseErrors: number(semantics.parseErrors),
|
|
873
|
-
rawRecords: number(semantics.rawRecords),
|
|
874
|
-
subagents: Array.isArray(semantics.subagents) ? semantics.subagents.flatMap((raw) => {
|
|
875
|
-
const child = record(raw);
|
|
876
|
-
if (!child || typeof child.id !== "string" || typeof child.source !== "string") return [];
|
|
877
|
-
return [{ id: child.id, source: child.source, model: typeof child.model === "string" ? child.model : null, messages: number(child.messages), fidelity: FIDELITY.has(child.fidelity) ? child.fidelity : "semantic" }];
|
|
878
|
-
}) : []
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
function readTerminalHandoff(value) {
|
|
882
|
-
const handoff = record(value);
|
|
883
|
-
if (!handoff || typeof handoff.program !== "string" || !handoff.program.trim() || !Array.isArray(handoff.arguments) || !handoff.arguments.every((argument) => typeof argument === "string") || typeof handoff.cwd !== "string") return null;
|
|
884
|
-
return { program: handoff.program, arguments: [...handoff.arguments], cwd: handoff.cwd };
|
|
885
|
-
}
|
|
886
|
-
function readExportReceipt(value) {
|
|
887
|
-
const receipt = record(value);
|
|
888
|
-
if (!receipt || typeof receipt.targetHarness !== "string" || !["byte_lossless", "value_lossless", "semantic"].includes(receipt.fidelity) || typeof receipt.path !== "string" || !receipt.path.trim() || !Number.isInteger(receipt.files) || receipt.files < 1 || !Number.isInteger(receipt.residueCount) || receipt.residueCount < 0) return null;
|
|
889
|
-
return {
|
|
890
|
-
targetHarness: receipt.targetHarness,
|
|
891
|
-
fidelity: receipt.fidelity,
|
|
892
|
-
path: receipt.path,
|
|
893
|
-
files: receipt.files,
|
|
894
|
-
residueCount: receipt.residueCount
|
|
895
|
-
};
|
|
896
|
-
}
|
|
897
|
-
function readReductionReceipt(value) {
|
|
898
|
-
const receipt = record(value);
|
|
899
|
-
if (!receipt || typeof receipt.sourceTokens !== "number" || !Number.isFinite(receipt.sourceTokens) || typeof receipt.reducedTokens !== "number" || !Number.isFinite(receipt.reducedTokens) || receipt.sourceTokens <= receipt.reducedTokens || receipt.reducedTokens < 0 || typeof receipt.ratio !== "number" || !Number.isFinite(receipt.ratio) || receipt.ratio <= 1 || typeof receipt.sidecarId !== "string" || !receipt.sidecarId.trim() || receipt.verified !== true || receipt.reversible !== true || typeof receipt.targetHarness !== "string" || !receipt.targetHarness.trim()) return null;
|
|
900
|
-
return {
|
|
901
|
-
sourceTokens: receipt.sourceTokens,
|
|
902
|
-
reducedTokens: receipt.reducedTokens,
|
|
903
|
-
ratio: receipt.ratio,
|
|
904
|
-
sidecarId: receipt.sidecarId,
|
|
905
|
-
verified: true,
|
|
906
|
-
reversible: true,
|
|
907
|
-
targetHarness: receipt.targetHarness
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
function readInteropSettings(value) {
|
|
911
|
-
const report = record(value);
|
|
912
|
-
if (report?.schema !== "supercode.harness-interop-settings.v1" || typeof report.harness !== "string" || typeof report.revision !== "string" || !Array.isArray(report.controls) || !Array.isArray(report.advisories)) return null;
|
|
913
|
-
const controls = report.controls.slice(0, 20).flatMap((raw) => {
|
|
914
|
-
const control = record(raw);
|
|
915
|
-
if (!control || typeof control.key !== "string" || typeof control.label !== "string") return [];
|
|
916
|
-
return [{
|
|
917
|
-
key: boundedString(control.key, 200),
|
|
918
|
-
nativeKey: boundedString(control.native_key ?? control.nativeKey, 200),
|
|
919
|
-
label: boundedString(control.label, 300),
|
|
920
|
-
description: boundedString(control.description),
|
|
921
|
-
scope: ["user", "project", "managed", "command_line"].includes(control.scope) ? control.scope : "user",
|
|
922
|
-
sourcePath: boundedString(control.source_path ?? control.sourcePath, 4e3),
|
|
923
|
-
configuredValue: typeof (control.configured_value ?? control.configuredValue) === "string" ? boundedString(control.configured_value ?? control.configuredValue, 500) : null,
|
|
924
|
-
effectiveValue: typeof (control.effective_value ?? control.effectiveValue) === "string" ? boundedString(control.effective_value ?? control.effectiveValue, 500) : null,
|
|
925
|
-
effectiveKnown: (control.effective_known ?? control.effectiveKnown) === true,
|
|
926
|
-
effectiveNote: boundedString(control.effective_note ?? control.effectiveNote),
|
|
927
|
-
choices: Array.isArray(control.choices) ? control.choices.slice(0, 20).flatMap((candidate) => {
|
|
928
|
-
const choice = record(candidate);
|
|
929
|
-
return choice && typeof choice.value === "string" && typeof choice.label === "string" ? [{
|
|
930
|
-
value: boundedString(choice.value, 500),
|
|
931
|
-
label: boundedString(choice.label, 300),
|
|
932
|
-
description: boundedString(choice.description),
|
|
933
|
-
...typeof choice.risk === "string" ? { risk: boundedString(choice.risk) } : {}
|
|
934
|
-
}] : [];
|
|
935
|
-
}) : [],
|
|
936
|
-
writable: control.writable === true,
|
|
937
|
-
resettable: control.resettable === true,
|
|
938
|
-
requiresRestart: (control.requires_restart ?? control.requiresRestart) === true
|
|
939
|
-
}];
|
|
940
|
-
});
|
|
941
|
-
const advisories = report.advisories.slice(0, 20).flatMap((raw) => {
|
|
942
|
-
const advisory = record(raw);
|
|
943
|
-
const recommendation = record(advisory?.recommendation);
|
|
944
|
-
const change = record(recommendation?.change);
|
|
945
|
-
if (!advisory || !recommendation || !change || typeof advisory.code !== "string" || typeof advisory.title !== "string" || typeof advisory.setting !== "string" || typeof change.key !== "string") return [];
|
|
946
|
-
return [{
|
|
947
|
-
code: boundedString(advisory.code, 200),
|
|
948
|
-
severity: ["info", "warning", "error"].includes(advisory.severity) ? advisory.severity : "warning",
|
|
949
|
-
title: boundedString(advisory.title, 500),
|
|
950
|
-
message: boundedString(advisory.message),
|
|
951
|
-
setting: boundedString(advisory.setting, 200),
|
|
952
|
-
recommendation: {
|
|
953
|
-
label: boundedString(recommendation.label, 500),
|
|
954
|
-
description: boundedString(recommendation.description),
|
|
955
|
-
consequence: boundedString(recommendation.consequence),
|
|
956
|
-
change: {
|
|
957
|
-
key: boundedString(change.key, 200),
|
|
958
|
-
value: typeof change.value === "string" ? boundedString(change.value, 500) : null
|
|
959
|
-
},
|
|
960
|
-
command: boundedString(recommendation.command, 4e3)
|
|
961
|
-
}
|
|
962
|
-
}];
|
|
963
|
-
});
|
|
964
|
-
return {
|
|
965
|
-
schema: "supercode.harness-interop-settings.v1",
|
|
966
|
-
harness: report.harness,
|
|
967
|
-
revision: boundedString(report.revision, 500),
|
|
968
|
-
controls,
|
|
969
|
-
advisories
|
|
970
|
-
};
|
|
971
|
-
}
|
|
972
|
-
function normalizeUiState(value) {
|
|
973
|
-
const raw = record(value) ?? {};
|
|
974
|
-
const pill = record(raw.pill);
|
|
975
|
-
const history = record(raw.history);
|
|
976
|
-
const attachError = record(raw.attachError);
|
|
977
|
-
const canResume = raw.canResume === true;
|
|
978
|
-
const continuationModes = Array.isArray(raw.continuationModes) ? [...new Set(raw.continuationModes.filter((mode) => mode === "headless" || mode === "terminal"))] : canResume ? ["headless"] : [];
|
|
979
|
-
return {
|
|
980
|
-
pill: { tone: ["live", "warn", "dead"].includes(pill?.tone) ? pill.tone : "off", label: string(pill?.label, "connecting\u2026") },
|
|
981
|
-
startup: STARTUP.has(raw.startup) ? raw.startup : "connecting",
|
|
982
|
-
transcript: readTranscript(raw.transcript),
|
|
983
|
-
busy: raw.busy === true,
|
|
984
|
-
operation: typeof raw.operation === "string" ? raw.operation : null,
|
|
985
|
-
needsInput: raw.needsInput === true,
|
|
986
|
-
harness: string(raw.harness),
|
|
987
|
-
mode: MODES.has(raw.mode) ? raw.mode : "none",
|
|
988
|
-
strategy: STRATEGIES.has(raw.strategy) ? raw.strategy : null,
|
|
989
|
-
canSend: raw.canSend === true,
|
|
990
|
-
canSteer: raw.canSteer === true,
|
|
991
|
-
canResume,
|
|
992
|
-
supportsResume: raw.supportsResume === true,
|
|
993
|
-
continuationModes,
|
|
994
|
-
canBranch: raw.canBranch === true,
|
|
995
|
-
supportsBranch: raw.supportsBranch === true,
|
|
996
|
-
canAttach: raw.canAttach === true,
|
|
997
|
-
supportsAttach: raw.supportsAttach === true,
|
|
998
|
-
canDetach: raw.canDetach === true,
|
|
999
|
-
canOpenTerminal: raw.canOpenTerminal === true,
|
|
1000
|
-
canExport: raw.canExport === true,
|
|
1001
|
-
canReduce: raw.canReduce === true,
|
|
1002
|
-
canInterrupt: raw.canInterrupt === true,
|
|
1003
|
-
canRespond: raw.canRespond === true,
|
|
1004
|
-
canConfigureSettings: raw.canConfigureSettings === true,
|
|
1005
|
-
messaging: raw.messaging === "live_peer" ? "live_peer" : null,
|
|
1006
|
-
workspace: string(raw.workspace),
|
|
1007
|
-
workspaceRef: readWorkspaceRef(raw.workspaceRef, string(raw.workspace)),
|
|
1008
|
-
participant: readParticipant(raw.participant),
|
|
1009
|
-
mirror: readMirror(raw.mirror),
|
|
1010
|
-
holder: readHolder(raw.holder),
|
|
1011
|
-
taskPlan: readTaskPlan(raw.taskPlan),
|
|
1012
|
-
semantics: readSemantics(raw.semantics),
|
|
1013
|
-
terminalHandoff: readTerminalHandoff(raw.terminalHandoff),
|
|
1014
|
-
exportBackTarget: typeof raw.exportBackTarget === "string" ? raw.exportBackTarget : null,
|
|
1015
|
-
exportReceipt: readExportReceipt(raw.exportReceipt),
|
|
1016
|
-
reductionReceipt: readReductionReceipt(raw.reductionReceipt),
|
|
1017
|
-
interopSettings: readInteropSettings(raw.interopSettings),
|
|
1018
|
-
interopSettingsError: typeof raw.interopSettingsError === "string" ? boundedString(raw.interopSettingsError) : null,
|
|
1019
|
-
harnessAuthentication: readHarnessAuthentication(raw.harnessAuthentication),
|
|
1020
|
-
error: typeof raw.error === "string" ? raw.error : null,
|
|
1021
|
-
recoverable: raw.recoverable === true,
|
|
1022
|
-
harnesses: Array.isArray(raw.harnesses) ? raw.harnesses.flatMap((candidate) => {
|
|
1023
|
-
const item = record(candidate);
|
|
1024
|
-
if (!item || typeof item.id !== "string") return [];
|
|
1025
|
-
const startable = item.startable === true;
|
|
1026
|
-
const launchModes = Array.isArray(item.launchModes) ? [...new Set(item.launchModes.filter((mode) => mode === "headless" || mode === "terminal"))] : startable ? ["headless"] : [];
|
|
1027
|
-
const preferredLaunchMode = launchModes.includes(item.preferredLaunchMode) ? item.preferredLaunchMode : launchModes.includes("terminal") ? "terminal" : launchModes[0] ?? null;
|
|
1028
|
-
const capabilities = record(item.capabilities);
|
|
1029
|
-
return [{
|
|
1030
|
-
id: item.id,
|
|
1031
|
-
label: string(item.label, harnessDisplayName(item.id)),
|
|
1032
|
-
installed: item.installed === true,
|
|
1033
|
-
startable,
|
|
1034
|
-
reason: typeof item.reason === "string" ? boundedString(item.reason) : null,
|
|
1035
|
-
auth: ["ready", "configured", "required", "unknown"].includes(item.auth) ? item.auth : "unknown",
|
|
1036
|
-
runtime: ["ready", "degraded", "unavailable"].includes(item.runtime) ? item.runtime : startable ? "ready" : "unavailable",
|
|
1037
|
-
protocol: boundedString(item.protocol, 100),
|
|
1038
|
-
repair: typeof item.repair === "string" ? boundedString(item.repair, 4e3) : null,
|
|
1039
|
-
capabilities: {
|
|
1040
|
-
start: capabilities?.start === true,
|
|
1041
|
-
resume: capabilities?.resume === true,
|
|
1042
|
-
attach: capabilities?.attach === true,
|
|
1043
|
-
send: capabilities?.send === true,
|
|
1044
|
-
interrupt: capabilities?.interrupt === true,
|
|
1045
|
-
steer: capabilities?.steer === true,
|
|
1046
|
-
respond: capabilities?.respond === true
|
|
1047
|
-
},
|
|
1048
|
-
launchModes,
|
|
1049
|
-
preferredLaunchMode
|
|
1050
|
-
}];
|
|
1051
|
-
}) : [],
|
|
1052
|
-
history: { sessionLimit: number(history?.sessionLimit), hasMoreSessions: history?.hasMoreSessions === true, transcriptLimit: number(history?.transcriptLimit, 120), hasEarlier: history?.hasEarlier === true },
|
|
1053
|
-
savedDraft: string(raw.savedDraft),
|
|
1054
|
-
attention: Array.isArray(raw.attention) ? raw.attention.flatMap((candidate) => {
|
|
1055
|
-
const item = record(candidate);
|
|
1056
|
-
return item && typeof item.key === "string" && ["unseen", "finished", "failed"].includes(item.kind) ? [{ key: item.key, kind: item.kind, ...typeof item.preview === "string" ? { preview: item.preview } : {}, ...Number.isSafeInteger(item.afterMessages) && item.afterMessages >= 0 ? { afterMessages: item.afterMessages } : {}, ...Number.isSafeInteger(item.unreadCount) && item.unreadCount > 0 ? { unreadCount: item.unreadCount } : {} }] : [];
|
|
1057
|
-
}) : [],
|
|
1058
|
-
sessions: readSessions(raw.sessions),
|
|
1059
|
-
subagentInspector: readSubagentInspector(raw.subagentInspector),
|
|
1060
|
-
attached: readAttached(raw.attached),
|
|
1061
|
-
owned: readAttached(raw.owned),
|
|
1062
|
-
attachError: attachError && typeof attachError.key === "string" && typeof attachError.message === "string" ? { key: attachError.key, message: attachError.message } : null,
|
|
1063
|
-
agentPackage: readAgentPackage(raw.agentPackage),
|
|
1064
|
-
contributions: normalizeContributions(raw.contributions),
|
|
1065
|
-
agentPackageError: typeof raw.agentPackageError === "string" ? boundedString(raw.agentPackageError) : null,
|
|
1066
|
-
agentPackageCapabilityState: readAgentPackageCapabilityState(raw.agentPackageCapabilityState),
|
|
1067
|
-
agentPackageCapabilityError: typeof raw.agentPackageCapabilityError === "string" ? boundedString(raw.agentPackageCapabilityError) : null
|
|
1068
|
-
};
|
|
1069
|
-
}
|
|
1070
|
-
function harnessDisplayName(id) {
|
|
1071
|
-
return HARNESS_NAMES[id] ?? id;
|
|
1072
|
-
}
|
|
1073
|
-
function sessionDisplayName(session) {
|
|
1074
|
-
const title = session.title?.trim();
|
|
1075
|
-
return title && title !== session.name ? title : session.name || "Untitled chat";
|
|
1076
|
-
}
|
|
1077
|
-
function sessionActivity(state, row) {
|
|
1078
|
-
if (row.activity && ACTIVITY_PRIORITY[row.activity] !== void 0) return row.activity;
|
|
1079
|
-
if (state.needsInput && row.active) return "needs-input";
|
|
1080
|
-
if (state.busy && row.active) return "working";
|
|
1081
|
-
if (row.runtimeStatus === "busy") return "working";
|
|
1082
|
-
const attention = state.attention.find((item) => item.key === row.key)?.kind;
|
|
1083
|
-
if (attention) return attention;
|
|
1084
|
-
if (row.runtimeStatus === "running") return "running";
|
|
1085
|
-
if (row.live || row.runtimeStatus === "idle") return "recent";
|
|
1086
|
-
return "idle";
|
|
1087
|
-
}
|
|
1088
|
-
var ACTIVITY_PRIORITY = Object.freeze({
|
|
1089
|
-
"needs-input": 70,
|
|
1090
|
-
failed: 60,
|
|
1091
|
-
working: 50,
|
|
1092
|
-
unseen: 40,
|
|
1093
|
-
finished: 30,
|
|
1094
|
-
running: 20,
|
|
1095
|
-
recent: 10,
|
|
1096
|
-
idle: 0
|
|
1097
|
-
});
|
|
1098
|
-
function activityDetail(activity, preview, pill) {
|
|
1099
|
-
if (preview) return preview;
|
|
1100
|
-
if (activity === "needs-input") return "Needs input";
|
|
1101
|
-
if (activity === "failed") return "Run failed";
|
|
1102
|
-
if (activity === "working") return "Working\u2026";
|
|
1103
|
-
if (activity === "finished") return "Finished";
|
|
1104
|
-
if (activity === "unseen") return "New reply";
|
|
1105
|
-
if (activity === "running") return "Session is running";
|
|
1106
|
-
return pill || "Agent chats";
|
|
1107
|
-
}
|
|
1108
|
-
function projectAgentActivity(value) {
|
|
1109
|
-
const state = normalizeUiState(value);
|
|
1110
|
-
const attentionByKey = new Map(state.attention.map((item) => [item.key, item]));
|
|
1111
|
-
const sessionsByKey = new Map(state.sessions.map((row) => [row.key, row]));
|
|
1112
|
-
const unreadCount = state.attention.reduce((total, item) => total + (item.unreadCount ?? 1), 0);
|
|
1113
|
-
const unreadTone = state.attention.length > 0 && state.attention.every((item) => sessionsByKey.get(item.key)?.writable) ? "attention" : "neutral";
|
|
1114
|
-
const ranked = state.sessions.map((row, index) => {
|
|
1115
|
-
const activity2 = sessionActivity(state, row);
|
|
1116
|
-
return {
|
|
1117
|
-
row,
|
|
1118
|
-
index,
|
|
1119
|
-
activity: activity2,
|
|
1120
|
-
priority: ACTIVITY_PRIORITY[activity2] ?? 0,
|
|
1121
|
-
active: row.active || row.key === state.attached?.key || row.key === state.owned?.key,
|
|
1122
|
-
updatedAt: row.previewUpdatedAt ?? row.updatedAt ?? 0
|
|
1123
|
-
};
|
|
1124
|
-
}).sort((left, right) => right.priority - left.priority || Number(right.active) - Number(left.active) || right.updatedAt - left.updatedAt || left.index - right.index);
|
|
1125
|
-
const selected = ranked[0];
|
|
1126
|
-
const fallback = state.attached ?? state.owned;
|
|
1127
|
-
const harness = selected?.row.harness ?? fallback?.harness ?? state.harness;
|
|
1128
|
-
const activity = selected?.activity ?? (state.needsInput ? "needs-input" : state.busy ? "working" : state.startup === "ready" ? "idle" : "recent");
|
|
1129
|
-
const attention = selected ? attentionByKey.get(selected.row.key) : null;
|
|
1130
|
-
const preview = selected?.row.preview || attention?.preview || "";
|
|
1131
|
-
return {
|
|
1132
|
-
harness,
|
|
1133
|
-
sessionKey: selected?.row.key ?? fallback?.key ?? null,
|
|
1134
|
-
title: selected ? sessionDisplayName(selected.row) : fallback ? sessionDisplayName(fallback) : "Agent chats",
|
|
1135
|
-
detail: activityDetail(activity, preview, state.pill.label),
|
|
1136
|
-
activity,
|
|
1137
|
-
unreadCount,
|
|
1138
|
-
unreadTone
|
|
1139
|
-
};
|
|
1140
|
-
}
|
|
1141
|
-
function toolTarget(argumentsText) {
|
|
1142
|
-
if (!argumentsText) return "";
|
|
1143
|
-
try {
|
|
1144
|
-
const args = JSON.parse(argumentsText);
|
|
1145
|
-
for (const key of ["file_path", "target_file", "path", "command", "cmd", "query", "pattern", "url"]) {
|
|
1146
|
-
if (typeof args?.[key] === "string") return args[key];
|
|
1147
|
-
}
|
|
1148
|
-
} catch {
|
|
1149
|
-
return argumentsText.length > 120 ? `${argumentsText.slice(0, 117)}\u2026` : argumentsText;
|
|
1150
|
-
}
|
|
1151
|
-
return "";
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
|
-
// src/logo.jsx
|
|
1155
|
-
import { useEffect } from "preact/hooks";
|
|
1156
|
-
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
1157
|
-
var LOGOS = {
|
|
1158
|
-
"claude-code": {
|
|
1159
|
-
viewBox: "-1 3.5 26 18",
|
|
1160
|
-
paths: [
|
|
1161
|
-
["path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z" }]
|
|
1162
|
-
]
|
|
1163
|
-
},
|
|
1164
|
-
codex: {
|
|
1165
|
-
viewBox: "-1 -1 26 26",
|
|
1166
|
-
paths: [
|
|
1167
|
-
["path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z" }]
|
|
1168
|
-
]
|
|
1169
|
-
},
|
|
1170
|
-
gemini: {
|
|
1171
|
-
viewBox: "0 0 24 24",
|
|
1172
|
-
paths: [["path", { d: "M12 24C12 17.373 6.627 12 0 12 6.627 12 12 6.627 12 0c0 6.627 5.373 12 12 12-6.627 0-12 5.373-12 12z" }]]
|
|
1173
|
-
},
|
|
1174
|
-
grok: {
|
|
1175
|
-
viewBox: "-1 -1 26 26",
|
|
1176
|
-
paths: [["path", { d: "M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815" }]]
|
|
1177
|
-
},
|
|
1178
|
-
// Canonical mark from block/goose's documentation/static/img/goose.svg.
|
|
1179
|
-
goose: {
|
|
1180
|
-
viewBox: "0 0 45 45",
|
|
1181
|
-
paths: [["path", { d: "M43.2098 39.2492L39.8118 36.4522C37.9646 34.9318 36.3923 33.1051 35.1631 31.0529C33.4647 28.2172 31.1178 25.8243 28.3164 24.071L26.9482 23.2744C26.4794 22.9485 26.1525 22.4405 26.106 21.8675C26.0762 21.4981 26.1647 21.1678 26.3712 20.8771C27.0837 19.873 30.9617 15.6995 31.6365 15.1411C32.5056 14.4228 33.4739 13.8253 34.3724 13.1412C34.5001 13.0438 34.6283 12.9469 34.7545 12.8481C35.0574 12.6088 35.3295 12.3671 35.5458 12.0803C36.5993 10.8604 36.5783 9.82938 36.5783 9.82938C36.4677 9.5534 36.0645 8.69902 35.2449 8.29825C35.9696 8.28406 36.7872 8.55564 37.1582 8.91873C37.6039 8.21947 37.8922 7.76585 38.3404 7.00347C38.4471 6.82241 38.5038 6.48771 38.2998 6.30029C38.1114 6.11287 37.6416 6.01697 37.4606 6.12364C36.4692 6.70693 35.5047 7.33475 34.6351 7.88525C34.6351 7.88525 33.6046 7.86372 32.3842 8.91775C32.097 9.13452 31.8552 9.4066 31.6282 9.69433C31.5171 9.83476 31.4202 9.96297 31.3233 10.0912C30.6387 10.9901 30.0417 11.958 29.3234 12.8271C28.7656 13.5023 24.5915 17.3798 23.5874 18.0923C23.2967 18.2988 22.9669 18.3879 22.597 18.3575C22.0245 18.3115 21.5161 17.9842 21.1902 17.5154L20.3935 16.1472C18.6402 13.3448 16.2474 10.9989 13.4117 9.30041C11.3594 8.0712 9.5332 6.49847 8.01234 4.65172L5.2153 1.25377C5.0773 1.08642 4.81306 1.11382 4.71422 1.30662C4.39615 1.92612 3.78888 3.23411 3.32353 4.99327C3.92786 5.81095 5.26717 7.35089 6.8624 8.65351C6.97348 8.74403 6.88246 8.92313 6.74447 8.88496C5.36846 8.51013 4.03062 7.90825 3.02944 7.39542C2.94772 7.35383 2.84887 7.4057 2.83713 7.49672C2.68152 8.74354 2.64139 10.1127 2.80581 11.5562C4.02572 12.1596 5.85143 12.8804 7.76816 13.3389C7.90713 13.3722 7.90273 13.5723 7.76229 13.5992C6.26982 13.8801 4.70688 13.9427 3.43656 13.9261C3.3475 13.9251 3.28193 14.0093 3.30591 14.0949C3.56085 14.9958 3.90632 15.9118 4.3619 16.8342C4.55029 17.2487 4.75532 17.6553 4.97504 18.0532C6.21207 18.107 7.47946 17.9964 8.75369 17.7713C8.97095 17.7331 9.08741 18.0189 8.90391 18.1417C8.03877 18.7201 7.11588 19.2183 6.25758 19.6283C6.14259 19.6836 6.1054 19.8304 6.18125 19.9327C6.69114 20.6236 7.25191 21.2774 7.86114 21.8866C7.86114 21.8866 10.8608 24.9763 10.9425 25.2185C12.6928 23.4261 15.5701 21.4394 18.7474 19.7047C14.4921 23.1672 12.1198 25.7235 10.9258 27.1758L10.0935 28.3439C9.66091 28.9507 9.2856 29.5951 8.97193 30.2709C7.92231 32.5292 6.19201 37.0966 6.19201 37.0966C6.0594 37.4543 6.16755 37.8072 6.39753 38.0371C6.66031 38.2999 7.01263 38.4076 7.37033 38.275C7.37033 38.275 11.9368 36.5447 14.1961 35.495C14.8719 35.1814 15.5168 34.8056 16.1231 34.3735L17.4095 33.457C18.0907 32.9715 19.0234 33.0489 19.615 33.6405L22.5804 36.6058C23.1896 37.2151 23.8433 37.7758 24.5343 38.2857C24.637 38.3611 24.7833 38.3244 24.8386 38.2094C25.2492 37.3516 25.7473 36.4277 26.3252 35.5631C26.4481 35.3796 26.7343 35.4965 26.6957 35.7133C26.4701 36.988 26.3605 38.2554 26.3086 39.3035C27.2178 39.9172 28.5551 40.5606 30.3721 41.1611C30.4577 41.185 30.5419 41.1195 30.5409 41.0304C30.5237 39.7596 30.5864 38.1967 30.8677 36.7047C30.8942 36.5638 31.0943 36.5593 31.1281 36.6988C31.5861 38.616 32.3069 40.4417 32.8041 41.5829C34.3543 41.8256 35.7234 41.7855 36.9703 41.6298C37.0618 41.6186 37.1136 41.5197 37.0715 41.4375C36.5587 40.4364 35.9568 39.0975 35.582 37.7225C35.5443 37.584 35.7229 37.4935 35.8135 37.6046C37.1161 39.1998 38.656 40.5391 39.3548 41.1175C41.2333 40.6786 42.5413 40.0713 43.1604 39.7528C43.3532 39.6539 43.3806 39.3897 43.2132 39.2517Z" }]]
|
|
1182
|
-
},
|
|
1183
|
-
opencode: { viewBox: "2.5 0 19 24", paths: [["path", { d: "M16 6H8v12h8V6zm4 16H4V2h16v20z" }]] },
|
|
1184
|
-
pi: {
|
|
1185
|
-
viewBox: "0 0 24 24",
|
|
1186
|
-
paths: [
|
|
1187
|
-
["path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z" }],
|
|
1188
|
-
["path", { d: "M17.5 12H23v11h-5.5V12z" }]
|
|
1189
|
-
]
|
|
1190
|
-
},
|
|
1191
|
-
// Product mark shared with the first-party browser frontend favicon.
|
|
1192
|
-
supercode: {
|
|
1193
|
-
viewBox: "0 0 64 64",
|
|
1194
|
-
paths: [
|
|
1195
|
-
["rect", { width: "64", height: "64", rx: "14", fill: "#111923" }],
|
|
1196
|
-
["path", { d: "M18 21h28v6H18zm0 13h18v6H18z", fill: "#5f8fff" }],
|
|
1197
|
-
["circle", { cx: "46", cy: "37", r: "7", fill: "none", stroke: "#8ce0aa", strokeWidth: "4" }]
|
|
1198
|
-
]
|
|
1199
|
-
}
|
|
1200
|
-
};
|
|
1201
|
-
var SVG_ATTRIBUTE_NAMES = Object.freeze({
|
|
1202
|
-
clipRule: "clip-rule",
|
|
1203
|
-
fillRule: "fill-rule",
|
|
1204
|
-
strokeWidth: "stroke-width"
|
|
1205
|
-
});
|
|
1206
|
-
function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
1207
|
-
const logo = LOGOS[id];
|
|
1208
|
-
useEffect(() => {
|
|
1209
|
-
if (!logo) onMissingLogo?.(id);
|
|
1210
|
-
}, [id, logo, onMissingLogo]);
|
|
1211
|
-
if (!logo) return null;
|
|
1212
|
-
return /* @__PURE__ */ jsxs("span", { className: "scui-logo", "data-harness": id, "data-activity": activity, style: { "--scui-logo-size": `${size}px` }, "aria-hidden": "true", children: [
|
|
1213
|
-
/* @__PURE__ */ jsx("svg", { viewBox: logo.viewBox, preserveAspectRatio: "xMidYMid meet", focusable: "false", children: logo.paths.map(([Tag, props], index) => /* @__PURE__ */ jsx(Tag, { ...props }, index)) }),
|
|
1214
|
-
activity && activity !== "idle" ? /* @__PURE__ */ jsx("i", {}) : null
|
|
1215
|
-
] });
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
// src/activity.jsx
|
|
1219
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
1220
|
-
function AgentActivityLauncher({ state, onOpen, class: className = "", showSummary = false, components = {} }) {
|
|
1221
|
-
const value = projectAgentActivity(state);
|
|
1222
|
-
const Logo = components.HarnessLogo ?? HarnessLogo;
|
|
1223
|
-
const badge = value.unreadCount > 99 ? "99+" : String(value.unreadCount);
|
|
1224
|
-
const label = [value.title, value.detail, value.unreadCount ? `${value.unreadCount} unread` : ""].filter(Boolean).join(" \xB7 ");
|
|
1225
|
-
return /* @__PURE__ */ jsxs2("button", { className: `scui-launcher ${className}`, "data-activity": value.activity, "data-unread-tone": value.unreadTone, type: "button", "aria-label": `Open ${label}`, onClick: () => onOpen?.(value), children: [
|
|
1226
|
-
/* @__PURE__ */ jsxs2("span", { className: "scui-launcher-logo", children: [
|
|
1227
|
-
/* @__PURE__ */ jsx2(Logo, { id: value.harness || "supercode", activity: value.activity, size: 36 }),
|
|
1228
|
-
value.unreadCount ? /* @__PURE__ */ jsx2("b", { "aria-hidden": "true", children: badge }) : null
|
|
1229
|
-
] }),
|
|
1230
|
-
showSummary ? /* @__PURE__ */ jsxs2("span", { className: "scui-launcher-copy", children: [
|
|
1231
|
-
/* @__PURE__ */ jsx2("strong", { children: value.title }),
|
|
1232
|
-
/* @__PURE__ */ jsx2("small", { children: value.detail })
|
|
1233
|
-
] }) : null
|
|
1234
|
-
] });
|
|
1235
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
AgentActivityLauncher
|
|
3
|
+
} from "./chunks/chunk-XD2WJYSL.mjs";
|
|
4
|
+
import "./chunks/chunk-ATCOWFRV.mjs";
|
|
5
|
+
import "./chunks/chunk-LS6JBXNT.mjs";
|
|
1236
6
|
export {
|
|
1237
7
|
AgentActivityLauncher
|
|
1238
8
|
};
|