@volter-ai-dev/supercode-ui 0.1.55 → 0.1.57
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 +155 -112
- package/embed.mjs +155 -112
- package/messenger.mjs +155 -112
- package/package.json +1 -1
- package/react/components.mjs +155 -112
- package/react/messenger.mjs +155 -112
- package/react/sessions.mjs +3 -4
- package/react/subagents.mjs +66 -21
- package/sessions.mjs +3 -4
- package/styles.css +2 -2
- package/subagents.mjs +66 -21
package/styles.css
CHANGED
|
@@ -213,9 +213,9 @@
|
|
|
213
213
|
.scui-readiness { margin:0 0 7px; border:1px solid var(--scui-border); border-radius:7px; background:var(--scui-bg) }.scui-readiness > summary { padding:6px 8px; color:var(--scui-muted); cursor:pointer; font-size:10px }.scui-readiness > div { display:grid; border-top:1px solid var(--scui-border) }.scui-readiness section { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:7px; padding:7px 8px }.scui-readiness section + section { border-top:1px solid var(--scui-border) }.scui-readiness section > span { display:grid; min-width:0 }.scui-readiness section strong,.scui-readiness section small,.scui-readiness section em { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }.scui-readiness section small { color:var(--scui-muted); font-size:9px }.scui-readiness section em { color:var(--scui-muted); font-size:8px; font-style:normal }.scui-readiness section button { padding:4px 6px; border:1px solid var(--scui-border); border-radius:6px; background:transparent; cursor:pointer; font-size:9px }
|
|
214
214
|
.scui-new { display:grid; justify-items:center; gap:5px; margin:auto; padding:20px; color:var(--scui-muted); text-align:center }.scui-new > span { color:var(--scui-accent); font-size:28px }.scui-new strong { color:var(--scui-fg) }
|
|
215
215
|
.scui-opening { position:absolute; z-index:30; inset:var(--scui-head-height) 0 0; display:flex; align-items:center; justify-content:center; gap:10px; padding:20px; background:var(--scui-bg) }.scui-opening > span { display:grid }.scui-opening small { color:var(--scui-muted) }.scui-opening > i { width:16px; height:16px; border:2px solid var(--scui-border); border-top-color:var(--scui-accent); border-radius:50%; animation:scui-spin .8s linear infinite }
|
|
216
|
-
.scui-subagents {
|
|
216
|
+
.scui-subagents { display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; background:var(--scui-bg); color:var(--scui-fg) }.scui-subagents > .scui-head > .scui-icon { flex:none; color:var(--scui-muted) }
|
|
217
217
|
.scui-subagents-loading { display:flex; flex:1; align-items:center; justify-content:center; gap:10px; padding:20px; color:var(--scui-muted) }.scui-subagents-loading > i { width:16px; height:16px; border:2px solid var(--scui-border); border-top-color:var(--scui-accent); border-radius:50%; animation:scui-spin .8s linear infinite }.scui-subagents-loading > span { display:grid }.scui-subagents-loading strong { color:var(--scui-fg); font-size:11px }.scui-subagents-loading small { font-size:9.5px }
|
|
218
|
-
.scui-subagent-rows { flex:1; min-height:0; overflow:auto; padding:6px }.scui-subagent-
|
|
218
|
+
.scui-subagent-rows { flex:1; min-height:0; overflow:auto; padding:6px }.scui-subagent-section { display:grid; gap:1px }.scui-subagent-section + .scui-subagent-section,.scui-subagent-history { margin-top:6px }.scui-subagent-section > h2 { margin:0; padding:5px 8px 3px; color:var(--scui-muted); font-size:8.5px; font-weight:650; letter-spacing:.055em; text-transform:uppercase }.scui-subagent-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; width:100%; align-items:center; gap:8px; padding:8px; border:0; border-radius:7px; background:transparent; color:var(--scui-fg); text-align:left; cursor:pointer }.scui-subagent-row:hover { background:var(--scui-fill) }.scui-subagent-row > span { display:grid; min-width:0 }.scui-subagent-row > span:nth-child(3) { grid-auto-flow:column; align-items:center; gap:4px; color:var(--scui-muted) }.scui-subagent-row strong,.scui-subagent-row small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }.scui-subagent-row strong { font-size:11.5px }.scui-subagent-row small { color:var(--scui-muted); font-size:9.5px }.scui-subagent-row[data-activity="needs-input"] > span:nth-child(3) small { color:var(--scui-warning) }.scui-subagent-row[data-activity="failed"] > span:nth-child(3) small { color:var(--scui-danger) }.scui-subagent-history { border-top:1px solid var(--scui-border) }.scui-subagent-history > summary { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:6px; padding:8px; border-radius:7px; color:var(--scui-muted); cursor:pointer; list-style:none; font-size:9px; font-weight:650; letter-spacing:.045em; text-transform:uppercase }.scui-subagent-history > summary::-webkit-details-marker { display:none }.scui-subagent-history > summary:hover { background:var(--scui-fill); color:var(--scui-fg) }.scui-subagent-history > summary small { min-width:18px; padding:1px 5px; border-radius:999px; background:var(--scui-fill); color:inherit; text-align:center; font-size:8.5px }.scui-subagent-history > summary .scui-icon { transform:rotate(90deg); transition:transform 120ms }.scui-subagent-history[open] > summary .scui-icon { transform:rotate(-90deg) }.scui-subagent-history > div { display:grid; gap:1px }.scui-subagents > .scui-conversation-wrap { flex:1; min-height:0 }
|
|
219
219
|
|
|
220
220
|
@keyframes scui-spin { to { transform:rotate(360deg) } }
|
|
221
221
|
@keyframes scui-breathe { 50% { transform:scale(.72); opacity:.5 } }
|
package/subagents.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/subagents.jsx
|
|
2
|
+
import { useEffect as useEffect5, useRef as useRef4, useState as useState3 } from "preact/hooks";
|
|
3
|
+
|
|
1
4
|
// core.mjs
|
|
2
5
|
var HARNESS_NAMES = Object.freeze({
|
|
3
6
|
"claude-code": "Claude Code",
|
|
@@ -1402,10 +1405,49 @@ function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
|
1402
1405
|
|
|
1403
1406
|
// src/subagents.jsx
|
|
1404
1407
|
import { jsx as jsx6, jsxs as jsxs5 } from "preact/jsx-runtime";
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
if (
|
|
1408
|
+
var ACTIVE_ACTIVITY = /* @__PURE__ */ new Set(["working", "running", "recent"]);
|
|
1409
|
+
function activityLabel(activity, age) {
|
|
1410
|
+
if (activity === "needs-input") return "Needs input";
|
|
1411
|
+
if (activity === "failed") return "Failed";
|
|
1412
|
+
if (activity === "unseen") return "New update";
|
|
1413
|
+
if (activity === "working") return "Working";
|
|
1414
|
+
if (activity === "running") return "Running";
|
|
1415
|
+
if (activity === "recent") return "Recent";
|
|
1416
|
+
if (activity === "finished") return "Finished";
|
|
1417
|
+
return age;
|
|
1418
|
+
}
|
|
1419
|
+
function SubagentRow({ row, inspector, adapter }) {
|
|
1420
|
+
return /* @__PURE__ */ jsxs5("button", { className: "scui-subagent-row", type: "button", "data-activity": row.activity ?? "idle", onClick: () => adapter.onIntent({ action: "openSubagent", parentKey: inspector.parentKey, key: row.key }), children: [
|
|
1421
|
+
/* @__PURE__ */ jsx6(HarnessLogo, { id: row.harness, activity: row.activity, size: 30 }),
|
|
1422
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1423
|
+
/* @__PURE__ */ jsx6("strong", { children: sessionDisplayName(row) }),
|
|
1424
|
+
/* @__PURE__ */ jsx6("small", { children: row.preview || (row.activity === "working" ? "Working\u2026" : row.cwd) })
|
|
1425
|
+
] }),
|
|
1426
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1427
|
+
/* @__PURE__ */ jsx6("small", { children: activityLabel(row.activity, row.age) }),
|
|
1428
|
+
/* @__PURE__ */ jsx6(UiIcon, { name: "chevron", size: 14 })
|
|
1429
|
+
] })
|
|
1430
|
+
] });
|
|
1431
|
+
}
|
|
1432
|
+
function SubagentSection({ label, rows, inspector, adapter }) {
|
|
1433
|
+
if (!rows.length) return null;
|
|
1434
|
+
return /* @__PURE__ */ jsxs5("section", { className: "scui-subagent-section", "aria-labelledby": `scui-subagents-${label.toLowerCase().replaceAll(" ", "-")}`, children: [
|
|
1435
|
+
/* @__PURE__ */ jsx6("h2", { id: `scui-subagents-${label.toLowerCase().replaceAll(" ", "-")}`, children: label }),
|
|
1436
|
+
rows.map((row) => /* @__PURE__ */ jsx6(SubagentRow, { row, inspector, adapter }, row.key))
|
|
1437
|
+
] });
|
|
1438
|
+
}
|
|
1439
|
+
function SubagentInspectorContent({ state, adapter, onClose, inspector }) {
|
|
1408
1440
|
const selected = inspector.items.find((row) => row.key === inspector.selectedKey) ?? null;
|
|
1441
|
+
const active = inspector.items.filter((row) => ACTIVE_ACTIVITY.has(row.activity));
|
|
1442
|
+
const history = inspector.items.filter((row) => !ACTIVE_ACTIVITY.has(row.activity));
|
|
1443
|
+
const [historyOpen, setHistoryOpen] = useState3(false);
|
|
1444
|
+
const backButton = useRef4(null);
|
|
1445
|
+
useEffect5(() => {
|
|
1446
|
+
if (inspector.status === "ready" && !active.length) setHistoryOpen(true);
|
|
1447
|
+
}, [inspector.parentKey, inspector.status]);
|
|
1448
|
+
useEffect5(() => {
|
|
1449
|
+
backButton.current?.focus({ preventScroll: true });
|
|
1450
|
+
}, [selected?.key]);
|
|
1409
1451
|
const detailState = selected ? {
|
|
1410
1452
|
...state,
|
|
1411
1453
|
transcript: inspector.transcript,
|
|
@@ -1426,15 +1468,14 @@ function SubagentInspector({ state, adapter, onClose }) {
|
|
|
1426
1468
|
onClose();
|
|
1427
1469
|
};
|
|
1428
1470
|
const back = () => selected ? adapter.onIntent({ action: "openSubagents", key: inspector.parentKey }) : leave();
|
|
1429
|
-
return /* @__PURE__ */ jsxs5("section", { className: "scui-subagents", "aria-label": `
|
|
1471
|
+
return /* @__PURE__ */ jsxs5("section", { className: "scui-subagents", "aria-label": `Agents for ${inspector.parentTitle}`, children: [
|
|
1430
1472
|
/* @__PURE__ */ jsxs5("header", { className: "scui-head", children: [
|
|
1431
|
-
/* @__PURE__ */ jsx6("button", { type: "button", "aria-label": selected ? "Back to
|
|
1432
|
-
/* @__PURE__ */ jsx6(UiIcon, { name: "agents", size: 20 }),
|
|
1473
|
+
/* @__PURE__ */ jsx6("button", { ref: backButton, type: "button", "aria-label": selected ? "Back to agents" : "Back to chats", onClick: back, children: /* @__PURE__ */ jsx6(UiIcon, { name: "back", size: 17 }) }),
|
|
1474
|
+
selected ? /* @__PURE__ */ jsx6(HarnessLogo, { id: selected.harness, activity: selected.activity, size: 24 }) : /* @__PURE__ */ jsx6(UiIcon, { name: "agents", size: 20 }),
|
|
1433
1475
|
/* @__PURE__ */ jsxs5("span", { className: "scui-head-copy", children: [
|
|
1434
|
-
/* @__PURE__ */ jsx6("strong", { children: selected ? sessionDisplayName(selected) :
|
|
1435
|
-
/* @__PURE__ */ jsx6("small", { children: selected ? `${harnessDisplayName(selected.harness)} \xB7 Read-only` : inspector.parentTitle })
|
|
1436
|
-
] })
|
|
1437
|
-
/* @__PURE__ */ jsx6("button", { type: "button", "aria-label": "Close subagent inspector", onClick: leave, children: /* @__PURE__ */ jsx6(UiIcon, { name: "close", size: 18 }) })
|
|
1476
|
+
/* @__PURE__ */ jsx6("strong", { children: selected ? sessionDisplayName(selected) : "Agents" }),
|
|
1477
|
+
/* @__PURE__ */ jsx6("small", { children: selected ? `${harnessDisplayName(selected.harness)} \xB7 Read-only` : `${inspector.items.length} ${inspector.items.length === 1 ? "session" : "sessions"} \xB7 ${inspector.parentTitle}` })
|
|
1478
|
+
] })
|
|
1438
1479
|
] }),
|
|
1439
1480
|
inspector.status === "loading" ? /* @__PURE__ */ jsxs5("div", { className: "scui-subagents-loading", role: "status", children: [
|
|
1440
1481
|
/* @__PURE__ */ jsx6("i", {}),
|
|
@@ -1444,21 +1485,25 @@ function SubagentInspector({ state, adapter, onClose }) {
|
|
|
1444
1485
|
] })
|
|
1445
1486
|
] }) : null,
|
|
1446
1487
|
inspector.error ? /* @__PURE__ */ jsx6("div", { className: "scui-error", role: "alert", children: inspector.error }) : null,
|
|
1447
|
-
!selected && inspector.status === "ready" ? /* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */ jsx6(
|
|
1449
|
-
/* @__PURE__ */ jsxs5("
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
/* @__PURE__ */ jsx6(
|
|
1456
|
-
] })
|
|
1457
|
-
] }
|
|
1488
|
+
!selected && inspector.status === "ready" && inspector.items.length ? /* @__PURE__ */ jsxs5("div", { className: "scui-subagent-rows", children: [
|
|
1489
|
+
/* @__PURE__ */ jsx6(SubagentSection, { label: "Active", rows: active, inspector, adapter }),
|
|
1490
|
+
history.length ? /* @__PURE__ */ jsxs5("details", { className: "scui-subagent-history", open: historyOpen, onToggle: (event) => setHistoryOpen(event.currentTarget.open), children: [
|
|
1491
|
+
/* @__PURE__ */ jsxs5("summary", { children: [
|
|
1492
|
+
/* @__PURE__ */ jsx6("span", { children: "History" }),
|
|
1493
|
+
/* @__PURE__ */ jsx6("small", { children: history.length }),
|
|
1494
|
+
/* @__PURE__ */ jsx6(UiIcon, { name: "chevron", size: 14 })
|
|
1495
|
+
] }),
|
|
1496
|
+
/* @__PURE__ */ jsx6("div", { children: history.map((row) => /* @__PURE__ */ jsx6(SubagentRow, { row, inspector, adapter }, row.key)) })
|
|
1497
|
+
] }) : null
|
|
1498
|
+
] }) : null,
|
|
1458
1499
|
!selected && inspector.status === "ready" && !inspector.items.length ? /* @__PURE__ */ jsx6("div", { className: "scui-empty", children: "No native child sessions were found." }) : null,
|
|
1459
1500
|
selected && inspector.status === "ready" && detailState ? /* @__PURE__ */ jsx6(Conversation, { state: detailState, adapter, memoryKey: `subagent:${selected.key}` }) : null
|
|
1460
1501
|
] });
|
|
1461
1502
|
}
|
|
1503
|
+
function SubagentInspector({ state, adapter, onClose }) {
|
|
1504
|
+
if (!state.subagentInspector) return null;
|
|
1505
|
+
return /* @__PURE__ */ jsx6(SubagentInspectorContent, { state, adapter, onClose, inspector: state.subagentInspector });
|
|
1506
|
+
}
|
|
1462
1507
|
export {
|
|
1463
1508
|
SubagentInspector
|
|
1464
1509
|
};
|