@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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HarnessLogo
|
|
3
|
+
} from "./chunk-ATCOWFRV.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Conversation
|
|
6
|
+
} from "./chunk-LOP6XOON.mjs";
|
|
7
|
+
import {
|
|
8
|
+
harnessDisplayName,
|
|
9
|
+
sessionDisplayName
|
|
10
|
+
} from "./chunk-LS6JBXNT.mjs";
|
|
11
|
+
import {
|
|
12
|
+
UiIcon
|
|
13
|
+
} from "./chunk-ZLYHUYE2.mjs";
|
|
14
|
+
|
|
15
|
+
// src/subagents.jsx
|
|
16
|
+
import { useEffect, useRef, useState } from "preact/hooks";
|
|
17
|
+
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
18
|
+
var ACTIVE_ACTIVITY = /* @__PURE__ */ new Set(["working", "running", "recent"]);
|
|
19
|
+
function activityLabel(activity, age) {
|
|
20
|
+
if (activity === "needs-input") return "Needs input";
|
|
21
|
+
if (activity === "failed") return "Failed";
|
|
22
|
+
if (activity === "unseen") return "New update";
|
|
23
|
+
if (activity === "working") return "Working";
|
|
24
|
+
if (activity === "running") return "Running";
|
|
25
|
+
if (activity === "recent") return "Recent";
|
|
26
|
+
if (activity === "finished") return "Finished";
|
|
27
|
+
return age;
|
|
28
|
+
}
|
|
29
|
+
function SubagentRow({ row, inspector, adapter }) {
|
|
30
|
+
return /* @__PURE__ */ jsxs("button", { className: "scui-subagent-row", type: "button", "data-activity": row.activity ?? "idle", onClick: () => adapter.onIntent({ action: "openSubagent", parentKey: inspector.parentKey, key: row.key }), children: [
|
|
31
|
+
/* @__PURE__ */ jsx(HarnessLogo, { id: row.harness, activity: row.activity, size: 30 }),
|
|
32
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
33
|
+
/* @__PURE__ */ jsx("strong", { children: sessionDisplayName(row) }),
|
|
34
|
+
/* @__PURE__ */ jsx("small", { children: row.preview || (row.activity === "working" ? "Working\u2026" : row.cwd) })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
37
|
+
/* @__PURE__ */ jsx("small", { children: activityLabel(row.activity, row.age) }),
|
|
38
|
+
/* @__PURE__ */ jsx(UiIcon, { name: "chevron", size: 14 })
|
|
39
|
+
] })
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
function SubagentSection({ label, rows, inspector, adapter }) {
|
|
43
|
+
if (!rows.length) return null;
|
|
44
|
+
return /* @__PURE__ */ jsxs("section", { className: "scui-subagent-section", "aria-labelledby": `scui-subagents-${label.toLowerCase().replaceAll(" ", "-")}`, children: [
|
|
45
|
+
/* @__PURE__ */ jsx("h2", { id: `scui-subagents-${label.toLowerCase().replaceAll(" ", "-")}`, children: label }),
|
|
46
|
+
rows.map((row) => /* @__PURE__ */ jsx(SubagentRow, { row, inspector, adapter }, row.key))
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
function SubagentInspectorContent({ state, adapter, onClose, inspector }) {
|
|
50
|
+
const selected = inspector.items.find((row) => row.key === inspector.selectedKey) ?? null;
|
|
51
|
+
const active = inspector.items.filter((row) => ACTIVE_ACTIVITY.has(row.activity));
|
|
52
|
+
const history = inspector.items.filter((row) => !ACTIVE_ACTIVITY.has(row.activity));
|
|
53
|
+
const [historyOpen, setHistoryOpen] = useState(false);
|
|
54
|
+
const backButton = useRef(null);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (inspector.status === "ready" && !active.length) setHistoryOpen(true);
|
|
57
|
+
}, [inspector.parentKey, inspector.status]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
backButton.current?.focus({ preventScroll: true });
|
|
60
|
+
}, [selected?.key]);
|
|
61
|
+
const detailState = selected ? {
|
|
62
|
+
...state,
|
|
63
|
+
transcript: inspector.transcript,
|
|
64
|
+
busy: selected.activity === "working",
|
|
65
|
+
needsInput: selected.activity === "needs-input",
|
|
66
|
+
harness: selected.harness,
|
|
67
|
+
mode: "mirror",
|
|
68
|
+
canSend: false,
|
|
69
|
+
canSteer: false,
|
|
70
|
+
canInterrupt: false,
|
|
71
|
+
canRespond: false,
|
|
72
|
+
taskPlan: { source: "none", items: [], residueCount: 0, observedAt: null },
|
|
73
|
+
semantics: { fidelity: null, residue: [], residueCount: 0, parseErrors: 0, rawRecords: 0, subagents: [] },
|
|
74
|
+
history: { ...state.history, hasEarlier: false }
|
|
75
|
+
} : null;
|
|
76
|
+
const leave = () => {
|
|
77
|
+
adapter.onIntent({ action: "closeSubagents" });
|
|
78
|
+
onClose();
|
|
79
|
+
};
|
|
80
|
+
const back = () => selected ? adapter.onIntent({ action: "openSubagents", key: inspector.parentKey }) : leave();
|
|
81
|
+
return /* @__PURE__ */ jsxs("section", { className: "scui-subagents", "aria-label": `Agents for ${inspector.parentTitle}`, children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("header", { className: "scui-head", children: [
|
|
83
|
+
/* @__PURE__ */ jsx("button", { ref: backButton, type: "button", "aria-label": selected ? "Back to agents" : "Back to chats", onClick: back, children: /* @__PURE__ */ jsx(UiIcon, { name: "back", size: 17 }) }),
|
|
84
|
+
selected ? /* @__PURE__ */ jsx(HarnessLogo, { id: selected.harness, activity: selected.activity, size: 24 }) : /* @__PURE__ */ jsx(UiIcon, { name: "agents", size: 20 }),
|
|
85
|
+
/* @__PURE__ */ jsxs("span", { className: "scui-head-copy", children: [
|
|
86
|
+
/* @__PURE__ */ jsx("strong", { children: selected ? sessionDisplayName(selected) : "Agents" }),
|
|
87
|
+
/* @__PURE__ */ jsx("small", { children: selected ? `${harnessDisplayName(selected.harness)} \xB7 Read-only` : `${inspector.items.length} ${inspector.items.length === 1 ? "session" : "sessions"} \xB7 ${inspector.parentTitle}` })
|
|
88
|
+
] })
|
|
89
|
+
] }),
|
|
90
|
+
inspector.status === "loading" ? /* @__PURE__ */ jsxs("div", { className: "scui-subagents-loading", role: "status", children: [
|
|
91
|
+
/* @__PURE__ */ jsx("i", {}),
|
|
92
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
93
|
+
/* @__PURE__ */ jsx("strong", { children: selected ? "Loading subagent" : "Finding subagents" }),
|
|
94
|
+
/* @__PURE__ */ jsx("small", { children: selected ? "Reading a bounded recent transcript\u2026" : "Reading native session relationships\u2026" })
|
|
95
|
+
] })
|
|
96
|
+
] }) : null,
|
|
97
|
+
inspector.error ? /* @__PURE__ */ jsx("div", { className: "scui-error", role: "alert", children: inspector.error }) : null,
|
|
98
|
+
!selected && inspector.status === "ready" && inspector.items.length ? /* @__PURE__ */ jsxs("div", { className: "scui-subagent-rows", children: [
|
|
99
|
+
/* @__PURE__ */ jsx(SubagentSection, { label: "Active", rows: active, inspector, adapter }),
|
|
100
|
+
history.length ? /* @__PURE__ */ jsxs("details", { className: "scui-subagent-history", open: historyOpen, onToggle: (event) => setHistoryOpen(event.currentTarget.open), children: [
|
|
101
|
+
/* @__PURE__ */ jsxs("summary", { children: [
|
|
102
|
+
/* @__PURE__ */ jsx("span", { children: "History" }),
|
|
103
|
+
/* @__PURE__ */ jsx("small", { children: history.length }),
|
|
104
|
+
/* @__PURE__ */ jsx(UiIcon, { name: "chevron", size: 14 })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx("div", { children: history.map((row) => /* @__PURE__ */ jsx(SubagentRow, { row, inspector, adapter }, row.key)) })
|
|
107
|
+
] }) : null
|
|
108
|
+
] }) : null,
|
|
109
|
+
!selected && inspector.status === "ready" && !inspector.items.length ? /* @__PURE__ */ jsx("div", { className: "scui-empty", children: "No native child sessions were found." }) : null,
|
|
110
|
+
selected && inspector.status === "ready" && detailState ? /* @__PURE__ */ jsx(Conversation, { state: detailState, adapter, memoryKey: `subagent:${selected.key}` }) : null
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
function SubagentInspector({ state, adapter, onClose }) {
|
|
114
|
+
if (!state.subagentInspector) return null;
|
|
115
|
+
return /* @__PURE__ */ jsx(SubagentInspectorContent, { state, adapter, onClose, inspector: state.subagentInspector });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
SubagentInspector
|
|
120
|
+
};
|