@volter-ai-dev/supercode-ui 0.1.54 → 0.1.55

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/components.mjs CHANGED
@@ -65,6 +65,7 @@ var EMPTY_UI_STATE = Object.freeze({
65
65
  savedDraft: "",
66
66
  attention: Object.freeze([]),
67
67
  sessions: Object.freeze([]),
68
+ subagentInspector: null,
68
69
  attached: null,
69
70
  owned: null,
70
71
  attachError: null
@@ -571,10 +572,25 @@ function readSessions(value) {
571
572
  active: row.active === true,
572
573
  writable: row.writable === true,
573
574
  live: row.live === true,
574
- runtimeStatus: row.runtimeStatus === "running" || row.runtimeStatus === "busy" || row.runtimeStatus === "idle" ? row.runtimeStatus : null
575
+ runtimeStatus: row.runtimeStatus === "running" || row.runtimeStatus === "busy" || row.runtimeStatus === "idle" ? row.runtimeStatus : null,
576
+ ...Number.isSafeInteger(row.subagentCount) && row.subagentCount > 0 ? { subagentCount: row.subagentCount } : {},
577
+ activity: ACTIVITY_PRIORITY[row.activity] !== void 0 ? row.activity : void 0
575
578
  }];
576
579
  });
577
580
  }
581
+ function readSubagentInspector(value) {
582
+ const inspector = record(value);
583
+ if (!inspector || typeof inspector.parentKey !== "string" || !inspector.parentKey) return null;
584
+ return {
585
+ parentKey: inspector.parentKey,
586
+ parentTitle: boundedString(string(inspector.parentTitle), 500),
587
+ status: ["loading", "ready", "error"].includes(inspector.status) ? inspector.status : "loading",
588
+ items: readSessions(inspector.items).slice(0, 100),
589
+ selectedKey: typeof inspector.selectedKey === "string" && inspector.selectedKey ? inspector.selectedKey : null,
590
+ transcript: readTranscript(inspector.transcript).slice(-120),
591
+ error: typeof inspector.error === "string" ? boundedString(inspector.error) : null
592
+ };
593
+ }
578
594
  function readAttached(value) {
579
595
  const item = record(value);
580
596
  if (!item || typeof item.harness !== "string") return null;
@@ -789,6 +805,7 @@ function normalizeUiState(value) {
789
805
  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 } : {} }] : [];
790
806
  }) : [],
791
807
  sessions: readSessions(raw.sessions),
808
+ subagentInspector: readSubagentInspector(raw.subagentInspector),
792
809
  attached: readAttached(raw.attached),
793
810
  owned: readAttached(raw.owned),
794
811
  attachError: attachError && typeof attachError.key === "string" && typeof attachError.message === "string" ? { key: attachError.key, message: attachError.message } : null
@@ -802,6 +819,7 @@ function sessionDisplayName(session) {
802
819
  return title && title !== session.name ? title : session.name || "Untitled chat";
803
820
  }
804
821
  function sessionActivity(state, row) {
822
+ if (row.activity && ACTIVITY_PRIORITY[row.activity] !== void 0) return row.activity;
805
823
  if (state.needsInput && row.active) return "needs-input";
806
824
  if (state.busy && row.active) return "working";
807
825
  if (row.runtimeStatus === "busy") return "working";
@@ -944,6 +962,12 @@ function boundedSet(map, key, value) {
944
962
  // src/icon.jsx
945
963
  import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
946
964
  var ICONS = {
965
+ agents: () => /* @__PURE__ */ jsxs(Fragment, { children: [
966
+ /* @__PURE__ */ jsx("circle", { cx: "6", cy: "6.5", r: "2" }),
967
+ /* @__PURE__ */ jsx("path", { d: "M2.75 13c.45-2 1.55-3 3.25-3s2.8 1 3.25 3" }),
968
+ /* @__PURE__ */ jsx("circle", { cx: "12.25", cy: "7", r: "1.5" }),
969
+ /* @__PURE__ */ jsx("path", { d: "M10.5 10.75c1.95-.65 3.45.1 4 2.25" })
970
+ ] }),
947
971
  attach: () => /* @__PURE__ */ jsx("path", { d: "M6.25 9.75 10.6 5.4a2.1 2.1 0 0 1 2.97 2.97l-5.4 5.4a3.3 3.3 0 0 1-4.67-4.66l5.52-5.52" }),
948
972
  back: () => /* @__PURE__ */ jsx("path", { d: "m11.5 4.5-4.5 4.5 4.5 4.5" }),
949
973
  check: () => /* @__PURE__ */ jsx("path", { d: "m4 9 3.25 3.25L14 5.5" }),
@@ -2307,7 +2331,7 @@ function sessionPathParts(value) {
2307
2331
  trailing: complete.slice(boundary + 1)
2308
2332
  };
2309
2333
  }
2310
- function SessionRow({ row, state, onOpen, now = Date.now() }) {
2334
+ function SessionRow({ row, state, onOpen, onOpenSubagents, now = Date.now() }) {
2311
2335
  const activity = sessionActivity(state, row);
2312
2336
  const working = activity === "working";
2313
2337
  const attention = state.attention.find((item) => item.key === row.key);
@@ -2317,32 +2341,40 @@ function SessionRow({ row, state, onOpen, now = Date.now() }) {
2317
2341
  const unreadCount = attention?.unreadCount ?? 0;
2318
2342
  const unreadLabel = unreadCount > 99 ? "99+" : String(unreadCount);
2319
2343
  const age = relativeAge(row.previewUpdatedAt ?? row.updatedAt, now) || row.age;
2320
- return /* @__PURE__ */ jsxs7("button", { className: "scui-session", "data-active": row.active, "data-activity": activity, "data-writable": row.writable, "data-session-key": row.key, type: "button", "aria-label": `${title} \xB7 ${harnessDisplayName(row.harness)}${row.writable ? "" : " \xB7 Read-only"}${working ? " \xB7 Working" : ""}${path.complete ? ` \xB7 ${path.complete}` : ""}${preview ? ` \xB7 ${preview}` : ""}${unreadCount ? ` \xB7 ${unreadCount} unread` : ""}${age ? ` \xB7 ${age}` : ""}`, "aria-current": row.active ? "true" : void 0, onClick: () => onOpen(row), children: [
2321
- /* @__PURE__ */ jsx8(HarnessLogo, { id: row.harness, activity, size: 34 }),
2322
- /* @__PURE__ */ jsxs7("span", { className: "scui-session-copy", children: [
2323
- /* @__PURE__ */ jsxs7("span", { className: "scui-session-title", children: [
2324
- /* @__PURE__ */ jsx8("strong", { children: title }),
2325
- /* @__PURE__ */ jsx8("span", { className: "scui-session-meta", children: age ? /* @__PURE__ */ jsx8("time", { children: age }) : null })
2326
- ] }),
2327
- path.complete ? /* @__PURE__ */ jsxs7("small", { className: "scui-session-path", title: row.cwd, children: [
2328
- /* @__PURE__ */ jsx8("span", { className: "scui-session-path-leading", children: path.leading }),
2329
- path.separator ? /* @__PURE__ */ jsx8("span", { className: "scui-session-path-separator", children: path.separator }) : null,
2330
- path.trailing ? /* @__PURE__ */ jsx8("span", { className: "scui-session-path-trailing", children: path.trailing }) : null
2331
- ] }) : null,
2332
- working || preview || unreadCount ? /* @__PURE__ */ jsxs7("span", { className: "scui-session-preview", children: [
2333
- working ? /* @__PURE__ */ jsxs7("span", { className: "scui-session-working", "aria-hidden": "true", children: [
2334
- /* @__PURE__ */ jsx8("i", {}),
2335
- /* @__PURE__ */ jsx8("i", {}),
2336
- /* @__PURE__ */ jsx8("i", {})
2344
+ return /* @__PURE__ */ jsxs7("article", { className: "scui-session", "data-active": row.active, "data-activity": activity, "data-writable": row.writable, children: [
2345
+ /* @__PURE__ */ jsxs7("button", { className: "scui-session-main", "data-session-key": row.key, type: "button", "aria-label": `${title} \xB7 ${harnessDisplayName(row.harness)}${row.writable ? "" : " \xB7 Read-only"}${working ? " \xB7 Working" : ""}${path.complete ? ` \xB7 ${path.complete}` : ""}${preview ? ` \xB7 ${preview}` : ""}${unreadCount ? ` \xB7 ${unreadCount} unread` : ""}${age ? ` \xB7 ${age}` : ""}`, "aria-current": row.active ? "true" : void 0, onClick: () => onOpen(row), children: [
2346
+ /* @__PURE__ */ jsx8(HarnessLogo, { id: row.harness, activity, size: 34 }),
2347
+ /* @__PURE__ */ jsxs7("span", { className: "scui-session-copy", children: [
2348
+ /* @__PURE__ */ jsxs7("span", { className: "scui-session-title", children: [
2349
+ /* @__PURE__ */ jsx8("strong", { children: title }),
2350
+ /* @__PURE__ */ jsx8("span", { className: "scui-session-meta", children: age ? /* @__PURE__ */ jsx8("time", { children: age }) : null })
2351
+ ] }),
2352
+ path.complete ? /* @__PURE__ */ jsxs7("small", { className: "scui-session-path", title: row.cwd, children: [
2353
+ /* @__PURE__ */ jsx8("span", { className: "scui-session-path-leading", children: path.leading }),
2354
+ path.separator ? /* @__PURE__ */ jsx8("span", { className: "scui-session-path-separator", children: path.separator }) : null,
2355
+ path.trailing ? /* @__PURE__ */ jsx8("span", { className: "scui-session-path-trailing", children: path.trailing }) : null
2337
2356
  ] }) : null,
2338
- preview || working ? /* @__PURE__ */ jsx8("small", { children: preview || "Working\u2026" }) : null,
2339
- unreadCount ? /* @__PURE__ */ jsx8("b", { "aria-label": `${unreadCount} unread messages`, children: unreadLabel }) : null
2340
- ] }) : null,
2341
- state.attachError?.key === row.key ? /* @__PURE__ */ jsx8("em", { children: state.attachError.message }) : null
2342
- ] })
2357
+ working || preview || unreadCount ? /* @__PURE__ */ jsxs7("span", { className: "scui-session-preview", children: [
2358
+ working ? /* @__PURE__ */ jsxs7("span", { className: "scui-session-working", "aria-hidden": "true", children: [
2359
+ /* @__PURE__ */ jsx8("i", {}),
2360
+ /* @__PURE__ */ jsx8("i", {}),
2361
+ /* @__PURE__ */ jsx8("i", {})
2362
+ ] }) : null,
2363
+ preview || working ? /* @__PURE__ */ jsx8("small", { children: preview || "Working\u2026" }) : null,
2364
+ unreadCount ? /* @__PURE__ */ jsx8("b", { "aria-label": `${unreadCount} unread messages`, children: unreadLabel }) : null
2365
+ ] }) : null,
2366
+ state.attachError?.key === row.key ? /* @__PURE__ */ jsx8("em", { children: state.attachError.message }) : null
2367
+ ] })
2368
+ ] }),
2369
+ row.subagentCount ? /* @__PURE__ */ jsxs7("button", { className: "scui-session-agents", type: "button", "aria-label": `Inspect ${row.subagentCount} subagents in ${title}`, onClick: () => onOpenSubagents?.(row), children: [
2370
+ /* @__PURE__ */ jsx8(UiIcon, { name: "agents", size: 14 }),
2371
+ row.subagentCount,
2372
+ " ",
2373
+ row.subagentCount === 1 ? "agent" : "agents"
2374
+ ] }) : null
2343
2375
  ] });
2344
2376
  }
2345
- function SessionList({ state, adapter, onOpen, onNew, onClose, components = {}, slots = {}, labels = DEFAULT_LABELS, focusKey = null, memoryKey = state.workspace || "@default", headerActions: HeaderActions }) {
2377
+ function SessionList({ state, adapter, onOpen, onOpenSubagents, onNew, onClose, components = {}, slots = {}, labels = DEFAULT_LABELS, focusKey = null, memoryKey = state.workspace || "@default", headerActions: HeaderActions }) {
2346
2378
  const remembered = sessionListMemory.get(memoryKey) ?? { query: "", top: 0 };
2347
2379
  const [query, setQuery] = useState4(remembered.query);
2348
2380
  const [loadingMore, setLoadingMore] = useState4(false);
@@ -2408,26 +2440,86 @@ function SessionList({ state, adapter, onOpen, onNew, onClose, components = {},
2408
2440
  /* @__PURE__ */ jsxs7("div", { className: "scui-session-rows", ref: rowScroller, onScroll: (event) => boundedSet(sessionListMemory, memoryKey, { query, top: event.currentTarget.scrollTop }), children: [
2409
2441
  BeforeSessions ? /* @__PURE__ */ jsx8(BeforeSessions, { state, adapter, value: { query, rows } }) : null,
2410
2442
  !rows.length && state.startup === "ready" ? /* @__PURE__ */ jsx8("div", { className: "scui-empty", children: query ? "No chats match your search." : state.error ?? "No coding chats found." }) : null,
2411
- rows.map((row) => /* @__PURE__ */ jsx8(Row, { value: row, row, state, adapter, onOpen, now }, row.key)),
2443
+ rows.map((row) => /* @__PURE__ */ jsx8(Row, { value: row, row, state, adapter, onOpen, onOpenSubagents, now }, row.key)),
2412
2444
  state.history.hasMoreSessions ? /* @__PURE__ */ jsx8("button", { className: "scui-load", type: "button", disabled: loadingMore, onClick: loadMore, children: loadingMore ? "Loading older chats\u2026" : "Load older chats" }) : null,
2413
2445
  AfterSessions ? /* @__PURE__ */ jsx8(AfterSessions, { state, adapter, value: { query, rows } }) : null
2414
2446
  ] })
2415
2447
  ] });
2416
2448
  }
2417
2449
 
2450
+ // src/subagents.jsx
2451
+ import { jsx as jsx9, jsxs as jsxs8 } from "preact/jsx-runtime";
2452
+ function SubagentInspector({ state, adapter, onClose }) {
2453
+ const inspector = state.subagentInspector;
2454
+ if (!inspector) return null;
2455
+ const selected = inspector.items.find((row) => row.key === inspector.selectedKey) ?? null;
2456
+ const detailState = selected ? {
2457
+ ...state,
2458
+ transcript: inspector.transcript,
2459
+ busy: selected.activity === "working",
2460
+ needsInput: selected.activity === "needs-input",
2461
+ harness: selected.harness,
2462
+ mode: "mirror",
2463
+ canSend: false,
2464
+ canSteer: false,
2465
+ canInterrupt: false,
2466
+ canRespond: false,
2467
+ taskPlan: { source: "none", items: [], residueCount: 0, observedAt: null },
2468
+ semantics: { fidelity: null, residue: [], residueCount: 0, parseErrors: 0, rawRecords: 0, subagents: [] },
2469
+ history: { ...state.history, hasEarlier: false }
2470
+ } : null;
2471
+ const leave = () => {
2472
+ adapter.onIntent({ action: "closeSubagents" });
2473
+ onClose();
2474
+ };
2475
+ const back = () => selected ? adapter.onIntent({ action: "openSubagents", key: inspector.parentKey }) : leave();
2476
+ return /* @__PURE__ */ jsxs8("section", { className: "scui-subagents", "aria-label": `Subagents for ${inspector.parentTitle}`, children: [
2477
+ /* @__PURE__ */ jsxs8("header", { className: "scui-head", children: [
2478
+ /* @__PURE__ */ jsx9("button", { type: "button", "aria-label": selected ? "Back to subagents" : "Back to chats", onClick: back, children: /* @__PURE__ */ jsx9(UiIcon, { name: "back", size: 17 }) }),
2479
+ /* @__PURE__ */ jsx9(UiIcon, { name: "agents", size: 20 }),
2480
+ /* @__PURE__ */ jsxs8("span", { className: "scui-head-copy", children: [
2481
+ /* @__PURE__ */ jsx9("strong", { children: selected ? sessionDisplayName(selected) : `${inspector.items.length || ""} ${inspector.items.length === 1 ? "agent" : "agents"}`.trim() }),
2482
+ /* @__PURE__ */ jsx9("small", { children: selected ? `${harnessDisplayName(selected.harness)} \xB7 Read-only` : inspector.parentTitle })
2483
+ ] }),
2484
+ /* @__PURE__ */ jsx9("button", { type: "button", "aria-label": "Close subagent inspector", onClick: leave, children: /* @__PURE__ */ jsx9(UiIcon, { name: "close", size: 18 }) })
2485
+ ] }),
2486
+ inspector.status === "loading" ? /* @__PURE__ */ jsxs8("div", { className: "scui-subagents-loading", role: "status", children: [
2487
+ /* @__PURE__ */ jsx9("i", {}),
2488
+ /* @__PURE__ */ jsxs8("span", { children: [
2489
+ /* @__PURE__ */ jsx9("strong", { children: selected ? "Loading subagent" : "Finding subagents" }),
2490
+ /* @__PURE__ */ jsx9("small", { children: selected ? "Reading a bounded recent transcript\u2026" : "Reading native session relationships\u2026" })
2491
+ ] })
2492
+ ] }) : null,
2493
+ inspector.error ? /* @__PURE__ */ jsx9("div", { className: "scui-error", role: "alert", children: inspector.error }) : null,
2494
+ !selected && inspector.status === "ready" ? /* @__PURE__ */ jsx9("div", { className: "scui-subagent-rows", children: inspector.items.map((row) => /* @__PURE__ */ jsxs8("button", { type: "button", "data-activity": row.activity ?? "idle", onClick: () => adapter.onIntent({ action: "openSubagent", parentKey: inspector.parentKey, key: row.key }), children: [
2495
+ /* @__PURE__ */ jsx9(HarnessLogo, { id: row.harness, activity: row.activity, size: 30 }),
2496
+ /* @__PURE__ */ jsxs8("span", { children: [
2497
+ /* @__PURE__ */ jsx9("strong", { children: sessionDisplayName(row) }),
2498
+ /* @__PURE__ */ jsx9("small", { children: row.preview || (row.activity === "working" ? "Working\u2026" : row.cwd) })
2499
+ ] }),
2500
+ /* @__PURE__ */ jsxs8("span", { children: [
2501
+ /* @__PURE__ */ jsx9("small", { children: row.activity === "needs-input" ? "Needs input" : row.activity === "working" ? "Working" : row.age }),
2502
+ /* @__PURE__ */ jsx9(UiIcon, { name: "chevron", size: 14 })
2503
+ ] })
2504
+ ] }, row.key)) }) : null,
2505
+ !selected && inspector.status === "ready" && !inspector.items.length ? /* @__PURE__ */ jsx9("div", { className: "scui-empty", children: "No native child sessions were found." }) : null,
2506
+ selected && inspector.status === "ready" && detailState ? /* @__PURE__ */ jsx9(Conversation, { state: detailState, adapter, memoryKey: `subagent:${selected.key}` }) : null
2507
+ ] });
2508
+ }
2509
+
2418
2510
  // src/settings.jsx
2419
2511
  import { useEffect as useEffect7, useId as useId2, useMemo as useMemo2, useRef as useRef6, useState as useState5 } from "preact/hooks";
2420
- import { jsx as jsx9, jsxs as jsxs8 } from "preact/jsx-runtime";
2512
+ import { jsx as jsx10, jsxs as jsxs9 } from "preact/jsx-runtime";
2421
2513
  function HarnessAdvisory({ state, onReview }) {
2422
2514
  const advisory = state.interopSettings?.advisories[0];
2423
2515
  if (!advisory && !state.interopSettingsError) return null;
2424
- return /* @__PURE__ */ jsxs8("div", { className: "scui-advisory", "data-severity": advisory?.severity ?? "error", role: advisory?.severity === "error" || !advisory ? "alert" : "status", children: [
2425
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "!" }),
2426
- /* @__PURE__ */ jsxs8("span", { children: [
2427
- /* @__PURE__ */ jsx9("strong", { children: advisory?.title ?? "Could not inspect harness settings" }),
2428
- /* @__PURE__ */ jsx9("small", { children: advisory?.message ?? state.interopSettingsError })
2516
+ return /* @__PURE__ */ jsxs9("div", { className: "scui-advisory", "data-severity": advisory?.severity ?? "error", role: advisory?.severity === "error" || !advisory ? "alert" : "status", children: [
2517
+ /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "!" }),
2518
+ /* @__PURE__ */ jsxs9("span", { children: [
2519
+ /* @__PURE__ */ jsx10("strong", { children: advisory?.title ?? "Could not inspect harness settings" }),
2520
+ /* @__PURE__ */ jsx10("small", { children: advisory?.message ?? state.interopSettingsError })
2429
2521
  ] }),
2430
- advisory && state.canConfigureSettings ? /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => onReview(advisory.recommendation.change), children: "Review" }) : null
2522
+ advisory && state.canConfigureSettings ? /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => onReview(advisory.recommendation.change), children: "Review" }) : null
2431
2523
  ] });
2432
2524
  }
2433
2525
  function initialValues(report, recommendedChange) {
@@ -2455,11 +2547,11 @@ function HarnessSettingsPanel({ state, adapter, onClose, recommendedChange = nul
2455
2547
  document.addEventListener("keydown", dismiss);
2456
2548
  return () => document.removeEventListener("keydown", dismiss);
2457
2549
  }, [onClose]);
2458
- if (!report) return /* @__PURE__ */ jsx9("section", { ref: panel, className: "scui-settings", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, children: /* @__PURE__ */ jsxs8("header", { children: [
2459
- /* @__PURE__ */ jsx9("button", { type: "button", "aria-label": "Close settings", onClick: onClose, children: /* @__PURE__ */ jsx9(UiIcon, { name: "close", size: 18 }) }),
2460
- /* @__PURE__ */ jsxs8("span", { children: [
2461
- /* @__PURE__ */ jsx9("strong", { id: titleId, children: "Harness settings" }),
2462
- /* @__PURE__ */ jsx9("small", { children: state.interopSettingsError ?? "No interoperability controls are available." })
2550
+ if (!report) return /* @__PURE__ */ jsx10("section", { ref: panel, className: "scui-settings", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, children: /* @__PURE__ */ jsxs9("header", { children: [
2551
+ /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Close settings", onClick: onClose, children: /* @__PURE__ */ jsx10(UiIcon, { name: "close", size: 18 }) }),
2552
+ /* @__PURE__ */ jsxs9("span", { children: [
2553
+ /* @__PURE__ */ jsx10("strong", { id: titleId, children: "Harness settings" }),
2554
+ /* @__PURE__ */ jsx10("small", { children: state.interopSettingsError ?? "No interoperability controls are available." })
2463
2555
  ] })
2464
2556
  ] }) });
2465
2557
  const changed = report.controls.flatMap((control) => values[control.key] !== (control.configuredValue ?? control.effectiveValue ?? control.choices[0]?.value ?? null) ? [{ key: control.key, value: values[control.key] ?? null }] : []);
@@ -2468,45 +2560,45 @@ function HarnessSettingsPanel({ state, adapter, onClose, recommendedChange = nul
2468
2560
  if (!changed.length || !state.canConfigureSettings) return;
2469
2561
  adapter.onIntent({ action: "configureHarness", harness: report.harness, changes: changed, expectedRevision: report.revision });
2470
2562
  };
2471
- return /* @__PURE__ */ jsxs8("section", { ref: panel, className: "scui-settings", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, children: [
2472
- /* @__PURE__ */ jsxs8("header", { children: [
2473
- /* @__PURE__ */ jsx9("button", { type: "button", "aria-label": "Close settings", onClick: onClose, children: /* @__PURE__ */ jsx9(UiIcon, { name: "close", size: 18 }) }),
2474
- /* @__PURE__ */ jsxs8("span", { children: [
2475
- /* @__PURE__ */ jsxs8("strong", { id: titleId, children: [
2563
+ return /* @__PURE__ */ jsxs9("section", { ref: panel, className: "scui-settings", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, children: [
2564
+ /* @__PURE__ */ jsxs9("header", { children: [
2565
+ /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Close settings", onClick: onClose, children: /* @__PURE__ */ jsx10(UiIcon, { name: "close", size: 18 }) }),
2566
+ /* @__PURE__ */ jsxs9("span", { children: [
2567
+ /* @__PURE__ */ jsxs9("strong", { id: titleId, children: [
2476
2568
  harnessDisplayName(report.harness),
2477
2569
  " interoperability"
2478
2570
  ] }),
2479
- /* @__PURE__ */ jsx9("small", { children: "Native harness settings used by Supercode" })
2571
+ /* @__PURE__ */ jsx10("small", { children: "Native harness settings used by Supercode" })
2480
2572
  ] })
2481
2573
  ] }),
2482
- /* @__PURE__ */ jsxs8("form", { onSubmit: submit, children: [
2574
+ /* @__PURE__ */ jsxs9("form", { onSubmit: submit, children: [
2483
2575
  report.controls.map((control) => {
2484
2576
  const choice = control.choices.find((item) => item.value === values[control.key]);
2485
2577
  const recommendation = report.advisories.map((advisory) => advisory.recommendation).find((item) => item.change.key === control.key && item.change.value === values[control.key]);
2486
2578
  const consequence = choice?.risk ?? recommendation?.consequence;
2487
- return /* @__PURE__ */ jsxs8("fieldset", { disabled: !control.writable || Boolean(state.operation), children: [
2488
- /* @__PURE__ */ jsxs8("label", { htmlFor: `scui-setting-${control.key}`, children: [
2489
- /* @__PURE__ */ jsx9("strong", { children: control.label }),
2490
- /* @__PURE__ */ jsx9("small", { children: control.description })
2579
+ return /* @__PURE__ */ jsxs9("fieldset", { disabled: !control.writable || Boolean(state.operation), children: [
2580
+ /* @__PURE__ */ jsxs9("label", { htmlFor: `scui-setting-${control.key}`, children: [
2581
+ /* @__PURE__ */ jsx10("strong", { children: control.label }),
2582
+ /* @__PURE__ */ jsx10("small", { children: control.description })
2491
2583
  ] }),
2492
- /* @__PURE__ */ jsxs8("select", { id: `scui-setting-${control.key}`, value: values[control.key] ?? "@default", onChange: (event) => setValues((current) => ({ ...current, [control.key]: event.currentTarget.value === "@default" ? null : event.currentTarget.value })), children: [
2493
- control.resettable ? /* @__PURE__ */ jsx9("option", { value: "@default", children: "Use harness default" }) : null,
2494
- control.choices.map((item) => /* @__PURE__ */ jsx9("option", { value: item.value, children: item.label }, item.value))
2584
+ /* @__PURE__ */ jsxs9("select", { id: `scui-setting-${control.key}`, value: values[control.key] ?? "@default", onChange: (event) => setValues((current) => ({ ...current, [control.key]: event.currentTarget.value === "@default" ? null : event.currentTarget.value })), children: [
2585
+ control.resettable ? /* @__PURE__ */ jsx10("option", { value: "@default", children: "Use harness default" }) : null,
2586
+ control.choices.map((item) => /* @__PURE__ */ jsx10("option", { value: item.value, children: item.label }, item.value))
2495
2587
  ] }),
2496
- choice ? /* @__PURE__ */ jsx9("p", { children: choice.description }) : null,
2497
- consequence ? /* @__PURE__ */ jsxs8("p", { className: "scui-setting-risk", children: [
2498
- /* @__PURE__ */ jsx9("strong", { children: "Security consequence" }),
2588
+ choice ? /* @__PURE__ */ jsx10("p", { children: choice.description }) : null,
2589
+ consequence ? /* @__PURE__ */ jsxs9("p", { className: "scui-setting-risk", children: [
2590
+ /* @__PURE__ */ jsx10("strong", { children: "Security consequence" }),
2499
2591
  consequence
2500
2592
  ] }) : null,
2501
- /* @__PURE__ */ jsxs8("small", { className: "scui-setting-source", children: [
2593
+ /* @__PURE__ */ jsxs9("small", { className: "scui-setting-source", children: [
2502
2594
  control.effectiveNote,
2503
2595
  control.sourcePath ? ` Source: ${control.sourcePath}` : ""
2504
2596
  ] })
2505
2597
  ] }, control.key);
2506
2598
  }),
2507
- /* @__PURE__ */ jsxs8("footer", { children: [
2508
- /* @__PURE__ */ jsx9("button", { type: "button", onClick: onClose, children: "Cancel" }),
2509
- /* @__PURE__ */ jsx9("button", { type: "submit", disabled: !changed.length || !state.canConfigureSettings || Boolean(state.operation), children: state.operation === "configureHarness" ? "Applying\u2026" : "Apply changes" })
2599
+ /* @__PURE__ */ jsxs9("footer", { children: [
2600
+ /* @__PURE__ */ jsx10("button", { type: "button", onClick: onClose, children: "Cancel" }),
2601
+ /* @__PURE__ */ jsx10("button", { type: "submit", disabled: !changed.length || !state.canConfigureSettings || Boolean(state.operation), children: state.operation === "configureHarness" ? "Applying\u2026" : "Apply changes" })
2510
2602
  ] })
2511
2603
  ] })
2512
2604
  ] });
@@ -2514,20 +2606,20 @@ function HarnessSettingsPanel({ state, adapter, onClose, recommendedChange = nul
2514
2606
  function HarnessReadiness({ harnesses, adapter }) {
2515
2607
  const blocked = harnesses.filter((item) => !item.startable);
2516
2608
  if (!blocked.length || harnesses.some((item) => item.startable)) return null;
2517
- return /* @__PURE__ */ jsxs8("details", { className: "scui-readiness", open: true, children: [
2518
- /* @__PURE__ */ jsx9("summary", { children: "No coding harness is ready" }),
2519
- /* @__PURE__ */ jsx9("div", { children: blocked.map((item) => /* @__PURE__ */ jsxs8("section", { children: [
2520
- /* @__PURE__ */ jsx9(HarnessLogo, { id: item.id, size: 25 }),
2521
- /* @__PURE__ */ jsxs8("span", { children: [
2522
- /* @__PURE__ */ jsx9("strong", { children: item.label }),
2523
- /* @__PURE__ */ jsx9("small", { children: item.reason || (item.auth === "required" ? "Authentication required" : "Unavailable") }),
2524
- item.protocol ? /* @__PURE__ */ jsxs8("em", { children: [
2609
+ return /* @__PURE__ */ jsxs9("details", { className: "scui-readiness", open: true, children: [
2610
+ /* @__PURE__ */ jsx10("summary", { children: "No coding harness is ready" }),
2611
+ /* @__PURE__ */ jsx10("div", { children: blocked.map((item) => /* @__PURE__ */ jsxs9("section", { children: [
2612
+ /* @__PURE__ */ jsx10(HarnessLogo, { id: item.id, size: 25 }),
2613
+ /* @__PURE__ */ jsxs9("span", { children: [
2614
+ /* @__PURE__ */ jsx10("strong", { children: item.label }),
2615
+ /* @__PURE__ */ jsx10("small", { children: item.reason || (item.auth === "required" ? "Authentication required" : "Unavailable") }),
2616
+ item.protocol ? /* @__PURE__ */ jsxs9("em", { children: [
2525
2617
  item.protocol,
2526
2618
  " \xB7 ",
2527
2619
  item.runtime
2528
2620
  ] }) : null
2529
2621
  ] }),
2530
- item.repair ? /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => adapter.copyText?.(item.repair), children: "Copy fix" }) : null
2622
+ item.repair ? /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => adapter.copyText?.(item.repair), children: "Copy fix" }) : null
2531
2623
  ] }, item.id)) })
2532
2624
  ] });
2533
2625
  }
@@ -2575,30 +2667,30 @@ function HarnessPicker({ harnesses, value, disabled = false, adapter, onChange,
2575
2667
  onChange(id);
2576
2668
  close();
2577
2669
  };
2578
- return /* @__PURE__ */ jsxs8("div", { className: "scui-harness-menu", ref: root, onBlur: (event) => {
2670
+ return /* @__PURE__ */ jsxs9("div", { className: "scui-harness-menu", ref: root, onBlur: (event) => {
2579
2671
  if (event.relatedTarget && !event.currentTarget.contains(event.relatedTarget)) setOpen(false);
2580
2672
  }, children: [
2581
- /* @__PURE__ */ jsxs8("button", { ref: trigger, className: "scui-harness-trigger", type: "button", disabled: disabled || !selected, "aria-label": selected ? `Coding harness: ${selected.label}` : "No coding harness available", "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": open ? menuId : void 0, onClick: () => setOpen((current) => !current), children: [
2582
- selected ? /* @__PURE__ */ jsx9(Logo, { id: selected.id, size: 20 }) : null,
2583
- /* @__PURE__ */ jsx9("strong", { children: selected?.label ?? "No harness available" }),
2584
- /* @__PURE__ */ jsx9(UiIcon, { name: "chevron", size: 13 })
2673
+ /* @__PURE__ */ jsxs9("button", { ref: trigger, className: "scui-harness-trigger", type: "button", disabled: disabled || !selected, "aria-label": selected ? `Coding harness: ${selected.label}` : "No coding harness available", "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": open ? menuId : void 0, onClick: () => setOpen((current) => !current), children: [
2674
+ selected ? /* @__PURE__ */ jsx10(Logo, { id: selected.id, size: 20 }) : null,
2675
+ /* @__PURE__ */ jsx10("strong", { children: selected?.label ?? "No harness available" }),
2676
+ /* @__PURE__ */ jsx10(UiIcon, { name: "chevron", size: 13 })
2585
2677
  ] }),
2586
- open ? /* @__PURE__ */ jsxs8("div", { ref: panel, id: menuId, className: "scui-harness-popover", role: "dialog", "aria-label": "Choose coding harness", onKeyDown: navigate, children: [
2587
- /* @__PURE__ */ jsx9("strong", { className: "scui-harness-popover-title", children: "Choose coding harness" }),
2588
- /* @__PURE__ */ jsx9("div", { className: "scui-harness-options", role: "listbox", "aria-label": "Available coding harnesses", children: available.map((item) => /* @__PURE__ */ jsxs8("button", { type: "button", role: "option", "aria-selected": item.id === selected?.id, onClick: () => select(item.id), children: [
2589
- /* @__PURE__ */ jsx9(Logo, { id: item.id, size: 24 }),
2590
- /* @__PURE__ */ jsx9("strong", { children: item.label }),
2591
- /* @__PURE__ */ jsx9("span", { children: item.id === selected?.id ? /* @__PURE__ */ jsx9(UiIcon, { name: "check", size: 15 }) : null })
2678
+ open ? /* @__PURE__ */ jsxs9("div", { ref: panel, id: menuId, className: "scui-harness-popover", role: "dialog", "aria-label": "Choose coding harness", onKeyDown: navigate, children: [
2679
+ /* @__PURE__ */ jsx10("strong", { className: "scui-harness-popover-title", children: "Choose coding harness" }),
2680
+ /* @__PURE__ */ jsx10("div", { className: "scui-harness-options", role: "listbox", "aria-label": "Available coding harnesses", children: available.map((item) => /* @__PURE__ */ jsxs9("button", { type: "button", role: "option", "aria-selected": item.id === selected?.id, onClick: () => select(item.id), children: [
2681
+ /* @__PURE__ */ jsx10(Logo, { id: item.id, size: 24 }),
2682
+ /* @__PURE__ */ jsx10("strong", { children: item.label }),
2683
+ /* @__PURE__ */ jsx10("span", { children: item.id === selected?.id ? /* @__PURE__ */ jsx10(UiIcon, { name: "check", size: 15 }) : null })
2592
2684
  ] }, item.id)) }),
2593
- unavailable.length ? /* @__PURE__ */ jsxs8("details", { className: "scui-harness-manage", children: [
2594
- /* @__PURE__ */ jsx9("summary", { children: "Manage additional harnesses" }),
2595
- /* @__PURE__ */ jsx9("div", { children: unavailable.map((item) => /* @__PURE__ */ jsxs8("section", { children: [
2596
- /* @__PURE__ */ jsx9(Logo, { id: item.id, size: 24 }),
2597
- /* @__PURE__ */ jsxs8("span", { children: [
2598
- /* @__PURE__ */ jsx9("strong", { children: item.label }),
2599
- /* @__PURE__ */ jsx9("small", { children: item.reason || (item.auth === "required" ? "Authentication required" : "Unavailable") })
2685
+ unavailable.length ? /* @__PURE__ */ jsxs9("details", { className: "scui-harness-manage", children: [
2686
+ /* @__PURE__ */ jsx10("summary", { children: "Manage additional harnesses" }),
2687
+ /* @__PURE__ */ jsx10("div", { children: unavailable.map((item) => /* @__PURE__ */ jsxs9("section", { children: [
2688
+ /* @__PURE__ */ jsx10(Logo, { id: item.id, size: 24 }),
2689
+ /* @__PURE__ */ jsxs9("span", { children: [
2690
+ /* @__PURE__ */ jsx10("strong", { children: item.label }),
2691
+ /* @__PURE__ */ jsx10("small", { children: item.reason || (item.auth === "required" ? "Authentication required" : "Unavailable") })
2600
2692
  ] }),
2601
- item.repair ? /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => adapter?.copyText?.(item.repair), children: "Copy fix" }) : null
2693
+ item.repair ? /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => adapter?.copyText?.(item.repair), children: "Copy fix" }) : null
2602
2694
  ] }, item.id)) })
2603
2695
  ] }) : null
2604
2696
  ] }) : null
@@ -2606,16 +2698,16 @@ function HarnessPicker({ harnesses, value, disabled = false, adapter, onChange,
2606
2698
  }
2607
2699
 
2608
2700
  // src/messenger.jsx
2609
- import { jsx as jsx10, jsxs as jsxs9 } from "preact/jsx-runtime";
2701
+ import { jsx as jsx11, jsxs as jsxs10 } from "preact/jsx-runtime";
2610
2702
  var pendingMessageMemory = /* @__PURE__ */ new Map();
2611
2703
  var messengerViewMemory = /* @__PURE__ */ new Map();
2612
2704
  var newChatMemory = /* @__PURE__ */ new Map();
2613
2705
  var TRACKED_ACTIONS = /* @__PURE__ */ new Set(["resume", "join", "detach", "branch", "reduce", "terminal", "export", "steer", "interrupt", "respond", "configureHarness", "refresh", "loadEarlier", "loadSessions"]);
2614
2706
  function Receipt({ state, adapter }) {
2615
2707
  const receipt = state.reductionReceipt;
2616
- if (receipt) return /* @__PURE__ */ jsx10("div", { className: "scui-receipt", children: /* @__PURE__ */ jsxs9("span", { children: [
2617
- /* @__PURE__ */ jsx10("strong", { children: "Reduced and verified" }),
2618
- /* @__PURE__ */ jsxs9("small", { children: [
2708
+ if (receipt) return /* @__PURE__ */ jsx11("div", { className: "scui-receipt", children: /* @__PURE__ */ jsxs10("span", { children: [
2709
+ /* @__PURE__ */ jsx11("strong", { children: "Reduced and verified" }),
2710
+ /* @__PURE__ */ jsxs10("small", { children: [
2619
2711
  receipt.sourceTokens.toLocaleString(),
2620
2712
  " \u2192 ",
2621
2713
  receipt.reducedTokens.toLocaleString(),
@@ -2624,27 +2716,27 @@ function Receipt({ state, adapter }) {
2624
2716
  "\xD7 \xB7 reversible"
2625
2717
  ] })
2626
2718
  ] }) });
2627
- if (state.exportReceipt) return /* @__PURE__ */ jsxs9("div", { className: "scui-receipt", children: [
2628
- /* @__PURE__ */ jsxs9("span", { children: [
2629
- /* @__PURE__ */ jsxs9("strong", { children: [
2719
+ if (state.exportReceipt) return /* @__PURE__ */ jsxs10("div", { className: "scui-receipt", children: [
2720
+ /* @__PURE__ */ jsxs10("span", { children: [
2721
+ /* @__PURE__ */ jsxs10("strong", { children: [
2630
2722
  "Lossless export ready \xB7 ",
2631
2723
  harnessDisplayName(state.exportReceipt.targetHarness)
2632
2724
  ] }),
2633
- /* @__PURE__ */ jsxs9("small", { children: [
2725
+ /* @__PURE__ */ jsxs10("small", { children: [
2634
2726
  state.exportReceipt.path,
2635
2727
  " \xB7 ",
2636
2728
  state.exportReceipt.files,
2637
2729
  " files"
2638
2730
  ] })
2639
2731
  ] }),
2640
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => adapter.copyText?.(state.exportReceipt.path), children: "Copy path" })
2732
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: () => adapter.copyText?.(state.exportReceipt.path), children: "Copy path" })
2641
2733
  ] });
2642
- if (state.terminalHandoff) return /* @__PURE__ */ jsxs9("div", { className: "scui-receipt", children: [
2643
- /* @__PURE__ */ jsxs9("span", { children: [
2644
- /* @__PURE__ */ jsx10("strong", { children: "Terminal handoff ready" }),
2645
- /* @__PURE__ */ jsx10("small", { children: state.terminalHandoff.cwd })
2734
+ if (state.terminalHandoff) return /* @__PURE__ */ jsxs10("div", { className: "scui-receipt", children: [
2735
+ /* @__PURE__ */ jsxs10("span", { children: [
2736
+ /* @__PURE__ */ jsx11("strong", { children: "Terminal handoff ready" }),
2737
+ /* @__PURE__ */ jsx11("small", { children: state.terminalHandoff.cwd })
2646
2738
  ] }),
2647
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => adapter.copyText?.(terminalCommand(state.terminalHandoff)), children: "Copy command" })
2739
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: () => adapter.copyText?.(terminalCommand(state.terminalHandoff)), children: "Copy command" })
2648
2740
  ] });
2649
2741
  return null;
2650
2742
  }
@@ -2716,13 +2808,13 @@ function ConversationActions({ state, adapter, actionPending, onNew, onSettings
2716
2808
  const index = event.key === "Home" ? 0 : event.key === "End" ? items.length - 1 : event.key === "ArrowDown" ? (current + 1) % items.length : (current <= 0 ? items.length : current) - 1;
2717
2809
  items[index].focus({ preventScroll: true });
2718
2810
  };
2719
- return /* @__PURE__ */ jsxs9("div", { className: "scui-menu", ref: root, onBlur: (event) => {
2811
+ return /* @__PURE__ */ jsxs10("div", { className: "scui-menu", ref: root, onBlur: (event) => {
2720
2812
  if (event.relatedTarget && !event.currentTarget.contains(event.relatedTarget)) setOpen(false);
2721
2813
  }, children: [
2722
- /* @__PURE__ */ jsx10("button", { ref: trigger, className: "scui-menu-trigger", type: "button", "aria-label": "Conversation actions", "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": open ? menuId : void 0, onClick: () => setOpen((value) => !value), children: /* @__PURE__ */ jsx10(UiIcon, { name: "menu", size: 18 }) }),
2723
- open ? /* @__PURE__ */ jsx10("div", { ref: panel, id: menuId, className: "scui-menu-panel", role: "menu", "aria-label": "Conversation actions", onKeyDown: navigate, children: groups.map((group) => /* @__PURE__ */ jsxs9("section", { role: "group", "aria-label": group.label, children: [
2724
- /* @__PURE__ */ jsx10("strong", { children: group.label }),
2725
- group.items.map((item) => /* @__PURE__ */ jsx10("button", { role: "menuitem", type: "button", disabled: actionPending, onClick: () => dispatch(item), children: item.label }, item.key))
2814
+ /* @__PURE__ */ jsx11("button", { ref: trigger, className: "scui-menu-trigger", type: "button", "aria-label": "Conversation actions", "aria-haspopup": "menu", "aria-expanded": open, "aria-controls": open ? menuId : void 0, onClick: () => setOpen((value) => !value), children: /* @__PURE__ */ jsx11(UiIcon, { name: "menu", size: 18 }) }),
2815
+ open ? /* @__PURE__ */ jsx11("div", { ref: panel, id: menuId, className: "scui-menu-panel", role: "menu", "aria-label": "Conversation actions", onKeyDown: navigate, children: groups.map((group) => /* @__PURE__ */ jsxs10("section", { role: "group", "aria-label": group.label, children: [
2816
+ /* @__PURE__ */ jsx11("strong", { children: group.label }),
2817
+ group.items.map((item) => /* @__PURE__ */ jsx11("button", { role: "menuitem", type: "button", disabled: actionPending, onClick: () => dispatch(item), children: item.label }, item.key))
2726
2818
  ] }, group.label)) }) : null
2727
2819
  ] });
2728
2820
  }
@@ -2734,20 +2826,20 @@ function ChatHeader({ state, adapter, pendingStatus, actionPending, onBack, onNe
2734
2826
  useEffect8(() => {
2735
2827
  if (state.mode === "mirror" && !state.canSend) back.current?.focus({ preventScroll: true });
2736
2828
  }, []);
2737
- return /* @__PURE__ */ jsxs9("header", { className: "scui-head scui-chat-head", children: [
2738
- /* @__PURE__ */ jsx10("button", { ref: back, type: "button", "aria-label": "Back to chats", onClick: onBack, children: /* @__PURE__ */ jsx10(UiIcon, { name: "back", size: 17 }) }),
2739
- /* @__PURE__ */ jsx10(HarnessLogo, { id: harness, size: 24 }),
2740
- /* @__PURE__ */ jsxs9("span", { className: "scui-head-copy", children: [
2741
- /* @__PURE__ */ jsx10("strong", { children: title }),
2742
- /* @__PURE__ */ jsxs9("small", { children: [
2829
+ return /* @__PURE__ */ jsxs10("header", { className: "scui-head scui-chat-head", children: [
2830
+ /* @__PURE__ */ jsx11("button", { ref: back, type: "button", "aria-label": "Back to chats", onClick: onBack, children: /* @__PURE__ */ jsx11(UiIcon, { name: "back", size: 17 }) }),
2831
+ /* @__PURE__ */ jsx11(HarnessLogo, { id: harness, size: 24 }),
2832
+ /* @__PURE__ */ jsxs10("span", { className: "scui-head-copy", children: [
2833
+ /* @__PURE__ */ jsx11("strong", { children: title }),
2834
+ /* @__PURE__ */ jsxs10("small", { children: [
2743
2835
  harnessDisplayName(harness),
2744
2836
  " \xB7 ",
2745
2837
  status
2746
2838
  ] })
2747
2839
  ] }),
2748
- HeaderActions ? /* @__PURE__ */ jsx10(HeaderActions, { state, adapter, value: "chat" }) : null,
2749
- /* @__PURE__ */ jsx10(ConversationActions, { state, adapter, actionPending, onNew, onSettings }),
2750
- onClose ? /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx10(UiIcon, { name: "close", size: 18 }) }) : null
2840
+ HeaderActions ? /* @__PURE__ */ jsx11(HeaderActions, { state, adapter, value: "chat" }) : null,
2841
+ /* @__PURE__ */ jsx11(ConversationActions, { state, adapter, actionPending, onNew, onSettings }),
2842
+ onClose ? /* @__PURE__ */ jsx11("button", { type: "button", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx11(UiIcon, { name: "close", size: 18 }) }) : null
2751
2843
  ] });
2752
2844
  }
2753
2845
  function Chat({ state, adapter, onBack, onNew, onClose, components, slots, labels, contextCandidates, navigation, composerCommand }) {
@@ -2863,22 +2955,22 @@ function Chat({ state, adapter, onBack, onNew, onClose, components, slots, label
2863
2955
  const unreadAfterMessages = state.attention.find((item) => item.key === state.attached?.key)?.afterMessages ?? null;
2864
2956
  const Advisory = components.HarnessAdvisory ?? HarnessAdvisory;
2865
2957
  const SettingsPanel = components.HarnessSettingsPanel ?? HarnessSettingsPanel;
2866
- return /* @__PURE__ */ jsxs9("section", { className: "scui-chat", children: [
2867
- Header ? /* @__PURE__ */ jsx10(Header, { state: actionState, adapter: trackedAdapter, value: null }) : /* @__PURE__ */ jsx10(ChatHeader, { state: actionState, adapter: trackedAdapter, pendingStatus: pending?.status ?? null, actionPending: Boolean(action), onBack, onNew, onClose, onSettings: () => setSettings({ recommendedChange: null }), headerActions: HeaderActions }),
2868
- actionLabel ? /* @__PURE__ */ jsxs9("div", { className: "scui-operation", role: "status", children: [
2869
- /* @__PURE__ */ jsx10("i", {}),
2958
+ return /* @__PURE__ */ jsxs10("section", { className: "scui-chat", children: [
2959
+ Header ? /* @__PURE__ */ jsx11(Header, { state: actionState, adapter: trackedAdapter, value: null }) : /* @__PURE__ */ jsx11(ChatHeader, { state: actionState, adapter: trackedAdapter, pendingStatus: pending?.status ?? null, actionPending: Boolean(action), onBack, onNew, onClose, onSettings: () => setSettings({ recommendedChange: null }), headerActions: HeaderActions }),
2960
+ actionLabel ? /* @__PURE__ */ jsxs10("div", { className: "scui-operation", role: "status", children: [
2961
+ /* @__PURE__ */ jsx11("i", {}),
2870
2962
  actionLabel
2871
2963
  ] }) : null,
2872
- state.error ? /* @__PURE__ */ jsxs9("div", { className: "scui-error", role: "alert", children: [
2873
- /* @__PURE__ */ jsx10("span", { children: state.error }),
2874
- state.recoverable ? /* @__PURE__ */ jsx10("button", { type: "button", disabled: Boolean(action), onClick: () => trackedAdapter.onIntent({ action: "refresh" }), children: "Retry" }) : null
2964
+ state.error ? /* @__PURE__ */ jsxs10("div", { className: "scui-error", role: "alert", children: [
2965
+ /* @__PURE__ */ jsx11("span", { children: state.error }),
2966
+ state.recoverable ? /* @__PURE__ */ jsx11("button", { type: "button", disabled: Boolean(action), onClick: () => trackedAdapter.onIntent({ action: "refresh" }), children: "Retry" }) : null
2875
2967
  ] }) : null,
2876
- /* @__PURE__ */ jsx10(Receipt, { state, adapter }),
2877
- /* @__PURE__ */ jsx10(Conversation, { state: actionState, adapter: trackedAdapter, components, slots, memoryKey, pending: pendingMessage, unreadAfterMessages }, memoryKey),
2878
- /* @__PURE__ */ jsx10(ContinuationBar, { state: actionState, adapter: trackedAdapter, labels }),
2879
- /* @__PURE__ */ jsx10(Advisory, { state: actionState, adapter: trackedAdapter, value: state.interopSettings?.advisories[0] ?? null, onReview: (recommendedChange) => setSettings({ recommendedChange }) }),
2880
- state.mode !== "mirror" || state.canSend ? /* @__PURE__ */ jsx10(Composer, { state: actionState, adapter: trackedAdapter, labels, memoryKey, pendingStatus: pending?.status ?? null, restoreDraft, command: composerCommand, contextCandidates, components, onDraftRestored: (id) => setRestoreDraft((value) => value?.id === id ? null : value), onPending: beginPending }, memoryKey) : null,
2881
- settings ? /* @__PURE__ */ jsx10(SettingsPanel, { state: actionState, adapter: trackedAdapter, value: state.interopSettings, recommendedChange: settings.recommendedChange, onClose: () => setSettings(null) }) : null
2968
+ /* @__PURE__ */ jsx11(Receipt, { state, adapter }),
2969
+ /* @__PURE__ */ jsx11(Conversation, { state: actionState, adapter: trackedAdapter, components, slots, memoryKey, pending: pendingMessage, unreadAfterMessages }, memoryKey),
2970
+ /* @__PURE__ */ jsx11(ContinuationBar, { state: actionState, adapter: trackedAdapter, labels }),
2971
+ /* @__PURE__ */ jsx11(Advisory, { state: actionState, adapter: trackedAdapter, value: state.interopSettings?.advisories[0] ?? null, onReview: (recommendedChange) => setSettings({ recommendedChange }) }),
2972
+ state.mode !== "mirror" || state.canSend ? /* @__PURE__ */ jsx11(Composer, { state: actionState, adapter: trackedAdapter, labels, memoryKey, pendingStatus: pending?.status ?? null, restoreDraft, command: composerCommand, contextCandidates, components, onDraftRestored: (id) => setRestoreDraft((value) => value?.id === id ? null : value), onPending: beginPending }, memoryKey) : null,
2973
+ settings ? /* @__PURE__ */ jsx11(SettingsPanel, { state: actionState, adapter: trackedAdapter, value: state.interopSettings, recommendedChange: settings.recommendedChange, onClose: () => setSettings(null) }) : null
2882
2974
  ] });
2883
2975
  }
2884
2976
  function NewChat({ state, adapter, onBack, onClose, onStarted, labels, memoryKey, headerActions: HeaderActions, contextCandidates, components, navigation, composerCommand }) {
@@ -3041,40 +3133,40 @@ function NewChat({ state, adapter, onBack, onClose, onStarted, labels, memoryKey
3041
3133
  Promise.resolve(result).catch(() => setStarting((current) => current?.id === id ? null : current));
3042
3134
  }
3043
3135
  };
3044
- return /* @__PURE__ */ jsxs9("section", { className: "scui-chat", children: [
3045
- /* @__PURE__ */ jsxs9("header", { className: "scui-head", children: [
3046
- /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Back", onClick: onBack, children: /* @__PURE__ */ jsx10(UiIcon, { name: "back", size: 18 }) }),
3047
- /* @__PURE__ */ jsxs9("span", { className: "scui-head-copy", children: [
3048
- /* @__PURE__ */ jsx10("strong", { children: labels.newChat }),
3049
- /* @__PURE__ */ jsx10("small", { children: "No session is created until you send" })
3136
+ return /* @__PURE__ */ jsxs10("section", { className: "scui-chat", children: [
3137
+ /* @__PURE__ */ jsxs10("header", { className: "scui-head", children: [
3138
+ /* @__PURE__ */ jsx11("button", { type: "button", "aria-label": "Back", onClick: onBack, children: /* @__PURE__ */ jsx11(UiIcon, { name: "back", size: 18 }) }),
3139
+ /* @__PURE__ */ jsxs10("span", { className: "scui-head-copy", children: [
3140
+ /* @__PURE__ */ jsx11("strong", { children: labels.newChat }),
3141
+ /* @__PURE__ */ jsx11("small", { children: "No session is created until you send" })
3050
3142
  ] }),
3051
- HeaderActions ? /* @__PURE__ */ jsx10(HeaderActions, { state, adapter, value: "new" }) : null,
3052
- onClose ? /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx10(UiIcon, { name: "close", size: 18 }) }) : null
3143
+ HeaderActions ? /* @__PURE__ */ jsx11(HeaderActions, { state, adapter, value: "new" }) : null,
3144
+ onClose ? /* @__PURE__ */ jsx11("button", { type: "button", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx11(UiIcon, { name: "close", size: 18 }) }) : null
3053
3145
  ] }),
3054
- starting ? /* @__PURE__ */ jsxs9("div", { className: "scui-operation", role: "status", children: [
3055
- /* @__PURE__ */ jsx10("i", {}),
3146
+ starting ? /* @__PURE__ */ jsxs10("div", { className: "scui-operation", role: "status", children: [
3147
+ /* @__PURE__ */ jsx11("i", {}),
3056
3148
  mode === "terminal" ? "Opening terminal\u2026" : operationLabel("start")
3057
3149
  ] }) : null,
3058
- /* @__PURE__ */ jsxs9("div", { className: "scui-new", children: [
3059
- /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", children: "\u2726" }),
3060
- /* @__PURE__ */ jsx10("strong", { children: "What should the agent build or fix?" }),
3061
- /* @__PURE__ */ jsx10("small", { children: "Choose a coding harness and send the first message." })
3150
+ /* @__PURE__ */ jsxs10("div", { className: "scui-new", children: [
3151
+ /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", children: "\u2726" }),
3152
+ /* @__PURE__ */ jsx11("strong", { children: "What should the agent build or fix?" }),
3153
+ /* @__PURE__ */ jsx11("small", { children: "Choose a coding harness and send the first message." })
3062
3154
  ] }),
3063
- /* @__PURE__ */ jsxs9("div", { className: "scui-compose", children: [
3064
- /* @__PURE__ */ jsx10(Readiness, { harnesses: state.harnesses, state, adapter }),
3065
- mode !== "terminal" ? /* @__PURE__ */ jsx10(ContextCandidates, { items: contextCandidates, context, images, state, adapter, onAttach: attachCandidate, component: components.ContextCandidate }) : null,
3066
- /* @__PURE__ */ jsx10(ImageTray, { items: images, onRemove: (index) => setImages((items) => {
3155
+ /* @__PURE__ */ jsxs10("div", { className: "scui-compose", children: [
3156
+ /* @__PURE__ */ jsx11(Readiness, { harnesses: state.harnesses, state, adapter }),
3157
+ mode !== "terminal" ? /* @__PURE__ */ jsx11(ContextCandidates, { items: contextCandidates, context, images, state, adapter, onAttach: attachCandidate, component: components.ContextCandidate }) : null,
3158
+ /* @__PURE__ */ jsx11(ImageTray, { items: images, onRemove: (index) => setImages((items) => {
3067
3159
  const next = items.filter((_, itemIndex) => itemIndex !== index);
3068
3160
  remember({ images: next });
3069
3161
  return next;
3070
3162
  }) }),
3071
- /* @__PURE__ */ jsx10(ContextTray, { items: context, onRemove: (index) => setContext((items) => {
3163
+ /* @__PURE__ */ jsx11(ContextTray, { items: context, onRemove: (index) => setContext((items) => {
3072
3164
  const next = items.filter((_, itemIndex) => itemIndex !== index);
3073
3165
  remember({ context: next });
3074
3166
  return next;
3075
3167
  }) }),
3076
- terminalAttachments ? /* @__PURE__ */ jsx10("small", { className: "scui-context-error", role: "alert", children: "Terminal starts currently accept text only. Remove attachments or choose Headless." }) : pickerError ? /* @__PURE__ */ jsx10("small", { className: "scui-context-error", role: "alert", children: pickerError }) : null,
3077
- /* @__PURE__ */ jsxs9("div", { className: `scui-envelope scui-new-envelope${dragging ? " scui-drop-target" : ""}`, onDragEnter: (event) => {
3168
+ terminalAttachments ? /* @__PURE__ */ jsx11("small", { className: "scui-context-error", role: "alert", children: "Terminal starts currently accept text only. Remove attachments or choose Headless." }) : pickerError ? /* @__PURE__ */ jsx11("small", { className: "scui-context-error", role: "alert", children: pickerError }) : null,
3169
+ /* @__PURE__ */ jsxs10("div", { className: `scui-envelope scui-new-envelope${dragging ? " scui-drop-target" : ""}`, onDragEnter: (event) => {
3078
3170
  if (Array.from(event.dataTransfer?.types ?? []).includes("Files")) {
3079
3171
  event.preventDefault();
3080
3172
  setDragging(true);
@@ -3084,7 +3176,7 @@ function NewChat({ state, adapter, onBack, onClose, onStarted, labels, memoryKey
3084
3176
  }, onDragLeave: (event) => {
3085
3177
  if (!event.currentTarget.contains(event.relatedTarget)) setDragging(false);
3086
3178
  }, onDrop: dropImages, children: [
3087
- /* @__PURE__ */ jsx10("textarea", { ref: textarea, rows: 3, "aria-label": "Message coding agent", placeholder: startable.length ? "What should the agent do?" : "No coding harness is available", value: draft, disabled: !startable.length || Boolean(starting), onPaste: pasteImages, onInput: (event) => {
3179
+ /* @__PURE__ */ jsx11("textarea", { ref: textarea, rows: 3, "aria-label": "Message coding agent", placeholder: startable.length ? "What should the agent do?" : "No coding harness is available", value: draft, disabled: !startable.length || Boolean(starting), onPaste: pasteImages, onInput: (event) => {
3088
3180
  const value = event.currentTarget.value;
3089
3181
  setDraft(value);
3090
3182
  remember({ draft: value });
@@ -3094,19 +3186,19 @@ function NewChat({ state, adapter, onBack, onClose, onStarted, labels, memoryKey
3094
3186
  send();
3095
3187
  }
3096
3188
  } }),
3097
- /* @__PURE__ */ jsxs9("footer", { className: "scui-new-envelope-controls", children: [
3098
- adapter.pickContext ? /* @__PURE__ */ jsx10("button", { className: "scui-attach", type: "button", "aria-label": labels.attachContext ?? DEFAULT_LABELS.attachContext, disabled: mode === "terminal" || picking || context.length >= MAX_CONTEXT_ITEMS && images.length >= MAX_IMAGE_ITEMS || Boolean(starting), onClick: pickContext, children: picking ? /* @__PURE__ */ jsx10("i", { className: "scui-control-spinner" }) : /* @__PURE__ */ jsx10(UiIcon, { name: "attach", size: 17 }) }) : null,
3099
- /* @__PURE__ */ jsx10(Picker, { harnesses: state.harnesses, value: harness, disabled: Boolean(starting), adapter, logo: components.HarnessLogo, onChange: (value) => {
3189
+ /* @__PURE__ */ jsxs10("footer", { className: "scui-new-envelope-controls", children: [
3190
+ adapter.pickContext ? /* @__PURE__ */ jsx11("button", { className: "scui-attach", type: "button", "aria-label": labels.attachContext ?? DEFAULT_LABELS.attachContext, disabled: mode === "terminal" || picking || context.length >= MAX_CONTEXT_ITEMS && images.length >= MAX_IMAGE_ITEMS || Boolean(starting), onClick: pickContext, children: picking ? /* @__PURE__ */ jsx11("i", { className: "scui-control-spinner" }) : /* @__PURE__ */ jsx11(UiIcon, { name: "attach", size: 17 }) }) : null,
3191
+ /* @__PURE__ */ jsx11(Picker, { harnesses: state.harnesses, value: harness, disabled: Boolean(starting), adapter, logo: components.HarnessLogo, onChange: (value) => {
3100
3192
  setHarness(value);
3101
3193
  remember({ harness: value });
3102
3194
  } }),
3103
- /* @__PURE__ */ jsx10(ExecutionModeSelect, { modes: launchModes, value: mode, disabled: Boolean(starting) || mode !== requestedMode, onChange: (item) => {
3195
+ /* @__PURE__ */ jsx11(ExecutionModeSelect, { modes: launchModes, value: mode, disabled: Boolean(starting) || mode !== requestedMode, onChange: (item) => {
3104
3196
  const next = { ...modes, [harness]: item };
3105
3197
  setModes(next);
3106
3198
  setPickerError(null);
3107
3199
  remember({ modes: next });
3108
3200
  } }),
3109
- /* @__PURE__ */ jsx10("span", { children: /* @__PURE__ */ jsx10("button", { type: "button", className: "scui-send", "aria-label": mode === "terminal" ? "Start terminal session" : "Start headless session", disabled: !draft.trim() && !images.length || !harness || Boolean(starting) || terminalAttachments || mode === "terminal" && !draft.trim(), onClick: send, children: starting ? /* @__PURE__ */ jsx10("i", { className: "scui-control-spinner" }) : /* @__PURE__ */ jsx10(UiIcon, { name: "send", size: 17 }) }) })
3201
+ /* @__PURE__ */ jsx11("span", { children: /* @__PURE__ */ jsx11("button", { type: "button", className: "scui-send", "aria-label": mode === "terminal" ? "Start terminal session" : "Start headless session", disabled: !draft.trim() && !images.length || !harness || Boolean(starting) || terminalAttachments || mode === "terminal" && !draft.trim(), onClick: send, children: starting ? /* @__PURE__ */ jsx11("i", { className: "scui-control-spinner" }) : /* @__PURE__ */ jsx11(UiIcon, { name: "send", size: 17 }) }) })
3110
3202
  ] })
3111
3203
  ] })
3112
3204
  ] })
@@ -3122,6 +3214,7 @@ function SupercodeMessenger({ state: stateInput, adapter, class: className = "",
3122
3214
  const [newNavigation, setNewNavigation] = useState6(null);
3123
3215
  const [chatNavigation, setChatNavigation] = useState6(null);
3124
3216
  const [listFocus, setListFocus] = useState6(null);
3217
+ const [inspecting, setInspecting] = useState6(null);
3125
3218
  const lastNavigation = useRef7(null);
3126
3219
  const setView = (next) => {
3127
3220
  boundedSet(messengerViewMemory, memoryKey, next);
@@ -3173,18 +3266,28 @@ function SupercodeMessenger({ state: stateInput, adapter, class: className = "",
3173
3266
  setOpening(row);
3174
3267
  adapter.onIntent({ action: "attach", key: row.key });
3175
3268
  };
3269
+ const openSubagents = (row) => {
3270
+ setListFocus(row.key);
3271
+ setInspecting(row);
3272
+ adapter.onIntent({ action: "openSubagents", key: row.key });
3273
+ };
3176
3274
  const close = () => adapter.onClose?.();
3177
3275
  const Footer = slots.footer;
3178
3276
  const HeaderActions = slots.headerActions;
3179
- return /* @__PURE__ */ jsxs9("main", { className: `scui-root ${className}`, "data-view": view, "data-mode": state.mode, "aria-label": "Supercode messenger", children: [
3180
- view === "list" ? /* @__PURE__ */ jsx10(SessionList, { state, adapter, focusKey: listFocus, onOpen: open, onNew: () => {
3277
+ const inspectorParent = inspecting ?? (state.subagentInspector ? state.sessions.find((row) => row.key === state.subagentInspector.parentKey) ?? { key: state.subagentInspector.parentKey, title: state.subagentInspector.parentTitle } : null);
3278
+ const inspectorState = inspectorParent ? {
3279
+ ...state,
3280
+ subagentInspector: state.subagentInspector?.parentKey === inspectorParent.key ? state.subagentInspector : { parentKey: inspectorParent.key, parentTitle: sessionDisplayName(inspectorParent), status: "loading", items: [], selectedKey: null, transcript: [], error: null }
3281
+ } : null;
3282
+ return /* @__PURE__ */ jsxs10("main", { className: `scui-root ${className}`, "data-view": view, "data-mode": state.mode, "aria-label": "Supercode messenger", children: [
3283
+ view === "list" ? /* @__PURE__ */ jsx11(SessionList, { state, adapter, focusKey: listFocus, onOpen: open, onOpenSubagents: openSubagents, onNew: () => {
3181
3284
  setListFocus("@new");
3182
3285
  setChatNavigation(null);
3183
3286
  setNewNavigation(null);
3184
3287
  setView("new");
3185
3288
  }, onClose: adapter.onClose ? close : void 0, components, labels: copy, memoryKey, slots, headerActions: HeaderActions }) : null,
3186
- view === "new" ? /* @__PURE__ */ jsx10(NewChat, { state, adapter, onBack: () => setView("list"), onClose: adapter.onClose ? close : void 0, onStarted: (mode) => setView(mode === "terminal" ? "list" : "chat"), labels: copy, memoryKey, headerActions: HeaderActions, contextCandidates, components, navigation: newNavigation, composerCommand }) : null,
3187
- view === "chat" ? /* @__PURE__ */ jsx10(Chat, { state, adapter, onBack: () => {
3289
+ view === "new" ? /* @__PURE__ */ jsx11(NewChat, { state, adapter, onBack: () => setView("list"), onClose: adapter.onClose ? close : void 0, onStarted: (mode) => setView(mode === "terminal" ? "list" : "chat"), labels: copy, memoryKey, headerActions: HeaderActions, contextCandidates, components, navigation: newNavigation, composerCommand }) : null,
3290
+ view === "chat" ? /* @__PURE__ */ jsx11(Chat, { state, adapter, onBack: () => {
3188
3291
  setListFocus(state.attached?.key ?? listFocus);
3189
3292
  setView("list");
3190
3293
  }, onNew: () => {
@@ -3193,18 +3296,19 @@ function SupercodeMessenger({ state: stateInput, adapter, class: className = "",
3193
3296
  setNewNavigation(null);
3194
3297
  setView("new");
3195
3298
  }, onClose: adapter.onClose ? close : void 0, components, slots, labels: copy, contextCandidates, navigation: chatNavigation?.sessionKey === state.attached?.key ? chatNavigation : null, composerCommand }) : null,
3196
- opening ? /* @__PURE__ */ jsxs9("div", { className: "scui-opening", role: "status", "aria-busy": "true", children: [
3197
- /* @__PURE__ */ jsx10(HarnessLogo, { id: opening.harness, size: 34 }),
3198
- /* @__PURE__ */ jsxs9("span", { children: [
3199
- /* @__PURE__ */ jsxs9("strong", { children: [
3299
+ opening ? /* @__PURE__ */ jsxs10("div", { className: "scui-opening", role: "status", "aria-busy": "true", children: [
3300
+ /* @__PURE__ */ jsx11(HarnessLogo, { id: opening.harness, size: 34 }),
3301
+ /* @__PURE__ */ jsxs10("span", { children: [
3302
+ /* @__PURE__ */ jsxs10("strong", { children: [
3200
3303
  "Opening ",
3201
3304
  sessionDisplayName(opening)
3202
3305
  ] }),
3203
- /* @__PURE__ */ jsx10("small", { children: "Loading the latest transcript window\u2026" })
3306
+ /* @__PURE__ */ jsx11("small", { children: "Loading the latest transcript window\u2026" })
3204
3307
  ] }),
3205
- /* @__PURE__ */ jsx10("i", {})
3308
+ /* @__PURE__ */ jsx11("i", {})
3206
3309
  ] }) : null,
3207
- Footer ? /* @__PURE__ */ jsx10(Footer, { state, adapter, value: copy }) : null
3310
+ inspectorState ? /* @__PURE__ */ jsx11(SubagentInspector, { state: inspectorState, adapter, onClose: () => setInspecting(null) }) : null,
3311
+ Footer ? /* @__PURE__ */ jsx11(Footer, { state, adapter, value: copy }) : null
3208
3312
  ] });
3209
3313
  }
3210
3314
  export {
@@ -3228,6 +3332,7 @@ export {
3228
3332
  SessionDetails,
3229
3333
  SessionList,
3230
3334
  SessionRow,
3335
+ SubagentInspector,
3231
3336
  SupercodeMessenger,
3232
3337
  TaskPlan,
3233
3338
  ToolRow,