@volter-ai-dev/supercode-ui 0.1.67 → 0.1.69
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/activity.mjs +113 -2
- package/components.d.ts +3 -0
- package/components.mjs +246 -12
- package/composer.mjs +12 -2
- package/controller.d.ts +7 -0
- package/controller.mjs +37 -1
- package/conversation.mjs +36 -2
- package/core.d.ts +6 -0
- package/core.mjs +215 -1
- package/embed.mjs +241 -11
- package/host.d.ts +1 -1
- package/host.mjs +2 -2
- package/index.d.ts +103 -0
- package/messenger.mjs +241 -11
- package/package.json +1 -1
- package/react/activity.mjs +113 -2
- package/react/components.mjs +246 -12
- package/react/composer.mjs +12 -2
- package/react/conversation.mjs +36 -2
- package/react/messenger.mjs +241 -11
- package/react/sessions.mjs +62 -3
- package/react/settings.mjs +4 -0
- package/react/subagents.mjs +36 -2
- package/sessions.mjs +62 -3
- package/settings.mjs +4 -0
- package/styles.css +11 -1
- package/subagents.mjs +36 -2
package/sessions.mjs
CHANGED
|
@@ -32,6 +32,10 @@ var EMPTY_UI_STATE = Object.freeze({
|
|
|
32
32
|
harness: "",
|
|
33
33
|
mode: "none",
|
|
34
34
|
strategy: null,
|
|
35
|
+
participant: Object.freeze({ kind: "local-user", label: null, origin: null }),
|
|
36
|
+
workspaceRef: Object.freeze({ kind: "none", value: null }),
|
|
37
|
+
mirror: null,
|
|
38
|
+
holder: null,
|
|
35
39
|
canSend: false,
|
|
36
40
|
canSteer: false,
|
|
37
41
|
canResume: false,
|
|
@@ -160,7 +164,11 @@ function languageLabel(info) {
|
|
|
160
164
|
}
|
|
161
165
|
function frameCode(render, tokens, index, options, env, self) {
|
|
162
166
|
const label = markdown.utils.escapeHtml(languageLabel(tokens[index]?.info ?? ""));
|
|
163
|
-
|
|
167
|
+
const body = render(tokens, index, options, env, self).replace(
|
|
168
|
+
"<pre>",
|
|
169
|
+
`<pre tabindex="0" role="region" aria-label="${label} code">`
|
|
170
|
+
);
|
|
171
|
+
return `<div class="scui-code-block"><div class="scui-code-head"><span>${label}</span><button class="scui-code-copy" type="button" aria-label="Copy code" title="Copy code">${COPY_ICON}<span>Copy</span></button></div>${body}</div>`;
|
|
164
172
|
}
|
|
165
173
|
for (const kind of ["fence", "code_block"]) {
|
|
166
174
|
const render = markdown.renderer.rules[kind];
|
|
@@ -175,6 +183,12 @@ markdown.renderer.rules.link_open = (tokens, index, options, env, self) => {
|
|
|
175
183
|
|
|
176
184
|
// src/memory.js
|
|
177
185
|
var MEMORY_LIMIT = 100;
|
|
186
|
+
var registry = /* @__PURE__ */ new Set();
|
|
187
|
+
function uiMemory() {
|
|
188
|
+
const map = /* @__PURE__ */ new Map();
|
|
189
|
+
registry.add(map);
|
|
190
|
+
return map;
|
|
191
|
+
}
|
|
178
192
|
function boundedSet(map, key, value) {
|
|
179
193
|
map.delete(key);
|
|
180
194
|
map.set(key, value);
|
|
@@ -264,6 +278,7 @@ function LoadingStatus({ state, compact = false }) {
|
|
|
264
278
|
/* @__PURE__ */ jsx4("span", { className: "scui-progress", "aria-hidden": "true", children: [1, 2, 3].map((step) => /* @__PURE__ */ jsx4("i", { "data-progress": step <= copy[2] ? "done" : step === copy[2] + 1 ? "current" : "waiting" }, step)) })
|
|
265
279
|
] });
|
|
266
280
|
}
|
|
281
|
+
var conversationMemory = uiMemory();
|
|
267
282
|
|
|
268
283
|
// src/logo.jsx
|
|
269
284
|
import { useEffect as useEffect4 } from "preact/hooks";
|
|
@@ -331,7 +346,7 @@ function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
|
|
|
331
346
|
|
|
332
347
|
// src/sessions.jsx
|
|
333
348
|
import { jsx as jsx6, jsxs as jsxs5 } from "preact/jsx-runtime";
|
|
334
|
-
var sessionListMemory =
|
|
349
|
+
var sessionListMemory = uiMemory();
|
|
335
350
|
function sessionPathParts(value) {
|
|
336
351
|
const complete = String(value ?? "").replaceAll("\\", "/");
|
|
337
352
|
const boundary = complete.lastIndexOf("/");
|
|
@@ -353,11 +368,55 @@ function SessionRow({ row, state, onOpen, onOpenSubagents, now = Date.now() }) {
|
|
|
353
368
|
const unreadCount = attention?.unreadCount ?? 0;
|
|
354
369
|
const unreadLabel = unreadCount > 99 ? "99+" : String(unreadCount);
|
|
355
370
|
const age = relativeAge(row.previewUpdatedAt ?? row.updatedAt, now) || row.age;
|
|
356
|
-
|
|
371
|
+
const nounBadges = [];
|
|
372
|
+
if (row.trigger && row.trigger.kind !== "manual" && row.trigger.kind !== "human") {
|
|
373
|
+
const runs = row.recurring?.runs;
|
|
374
|
+
const detail = row.trigger.label || row.trigger.surface || "";
|
|
375
|
+
nounBadges.push(
|
|
376
|
+
/* @__PURE__ */ jsxs5("small", { className: "scui-session-noun", "data-noun": "trigger", "data-kind": row.trigger.kind, "data-surface": row.trigger.surface ?? void 0, "data-status": row.recurring?.lastStatus ?? void 0, children: [
|
|
377
|
+
row.trigger.kind,
|
|
378
|
+
detail ? ` \xB7 ${detail}` : "",
|
|
379
|
+
runs && runs > 1 ? ` \xB7 \xD7${runs}` : ""
|
|
380
|
+
] }, "trigger")
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
if (row.crossSurface) {
|
|
384
|
+
nounBadges.push(
|
|
385
|
+
/* @__PURE__ */ jsxs5("small", { className: "scui-session-noun", "data-noun": "cross-surface", "data-state": row.crossSurface.state, title: row.crossSurface.error ?? void 0, children: [
|
|
386
|
+
"\u2192",
|
|
387
|
+
row.crossSurface.platform ?? "elsewhere",
|
|
388
|
+
" \xB7 ",
|
|
389
|
+
row.crossSurface.state
|
|
390
|
+
] }, "cross-surface")
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
if (row.participant && row.participant.kind !== "local-user") {
|
|
394
|
+
nounBadges.push(
|
|
395
|
+
/* @__PURE__ */ jsx6("small", { className: "scui-session-noun", "data-noun": "participant", "data-kind": row.participant.kind, children: row.participant.kind === "foreign" ? `${row.participant.label ?? "someone else"}${row.participant.origin ? ` via ${row.participant.origin}` : ""}` : "unknown participant" }, "participant")
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
if (row.mirror) {
|
|
399
|
+
nounBadges.push(
|
|
400
|
+
/* @__PURE__ */ jsxs5("small", { className: "scui-session-noun", "data-noun": "mirror", "data-truncated": row.mirror.truncated, children: [
|
|
401
|
+
"mirror of ",
|
|
402
|
+
harnessDisplayName(row.mirror.canonicalHarness)
|
|
403
|
+
] }, "mirror")
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
if (row.workspaceRef?.kind === "channel") {
|
|
407
|
+
nounBadges.push(
|
|
408
|
+
/* @__PURE__ */ jsxs5("small", { className: "scui-session-noun", "data-noun": "workspace", "data-kind": "channel", children: [
|
|
409
|
+
"#",
|
|
410
|
+
row.workspaceRef.value ?? "channel"
|
|
411
|
+
] }, "workspace")
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
return /* @__PURE__ */ jsxs5("article", { className: "scui-session", "data-active": row.active, "data-activity": activity, "data-writable": row.writable, "data-workspace-kind": row.workspaceRef?.kind, children: [
|
|
357
415
|
/* @__PURE__ */ jsxs5("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: [
|
|
358
416
|
/* @__PURE__ */ jsx6(HarnessLogo, { id: row.harness, activity, size: 34 }),
|
|
359
417
|
/* @__PURE__ */ jsxs5("span", { className: "scui-session-copy", children: [
|
|
360
418
|
/* @__PURE__ */ jsx6("span", { className: "scui-session-title", children: /* @__PURE__ */ jsx6("strong", { children: title }) }),
|
|
419
|
+
nounBadges.length ? /* @__PURE__ */ jsx6("span", { className: "scui-session-nouns", children: nounBadges }) : null,
|
|
361
420
|
path.complete ? /* @__PURE__ */ jsxs5("small", { className: "scui-session-path", title: row.cwd, children: [
|
|
362
421
|
/* @__PURE__ */ jsx6("span", { className: "scui-session-path-leading", children: path.leading }),
|
|
363
422
|
path.separator ? /* @__PURE__ */ jsx6("span", { className: "scui-session-path-separator", children: path.separator }) : null,
|
package/settings.mjs
CHANGED
|
@@ -32,6 +32,10 @@ var EMPTY_UI_STATE = Object.freeze({
|
|
|
32
32
|
harness: "",
|
|
33
33
|
mode: "none",
|
|
34
34
|
strategy: null,
|
|
35
|
+
participant: Object.freeze({ kind: "local-user", label: null, origin: null }),
|
|
36
|
+
workspaceRef: Object.freeze({ kind: "none", value: null }),
|
|
37
|
+
mirror: null,
|
|
38
|
+
holder: null,
|
|
35
39
|
canSend: false,
|
|
36
40
|
canSteer: false,
|
|
37
41
|
canResume: false,
|
package/styles.css
CHANGED
|
@@ -145,7 +145,8 @@
|
|
|
145
145
|
.scui-pending[data-status="failed"] { border-color:color-mix(in srgb,var(--scui-danger) 45%,var(--scui-border)); background:color-mix(in srgb,var(--scui-danger) 7%,var(--scui-fill)); opacity:1 }
|
|
146
146
|
.scui-pending > footer { display:flex; align-items:center; gap:8px; margin-top:5px }.scui-pending > footer small { color:var(--scui-muted) }.scui-pending[data-status="failed"] > footer small { color:var(--scui-danger) }
|
|
147
147
|
.scui-pending > footer > span { display:flex; gap:4px; margin-left:auto }.scui-pending > footer button { padding:2px 6px; border:1px solid var(--scui-border-strong); border-radius:5px; background:transparent; color:var(--scui-fg); cursor:pointer; font:inherit; font-size:9.5px }
|
|
148
|
-
|
|
148
|
+
/* Muted color, not opacity: opacity crushed the footer text below the 4.5:1 contrast floor (axe color-contrast). */
|
|
149
|
+
.scui-pending { color:var(--scui-muted) }.scui-pending > small { display:block; margin-top:3px; color:var(--scui-muted); font-size:9.5px }
|
|
149
150
|
.scui-markdown { min-width:0; font-size:12.5px; line-height:1.55 }.scui-markdown > :first-child { margin-top:0 }.scui-markdown > :last-child { margin-bottom:0 }
|
|
150
151
|
.scui-markdown p { margin:0 0 8px }.scui-markdown h1,.scui-markdown h2,.scui-markdown h3 { margin:12px 0 5px; line-height:1.25 }.scui-markdown h1 { font-size:17px }.scui-markdown h2 { font-size:15px }.scui-markdown h3 { font-size:13px }
|
|
151
152
|
.scui-markdown ul,.scui-markdown ol { margin:5px 0 9px; padding-left:20px }.scui-markdown blockquote { margin:8px 0; padding-left:9px; border-left:2px solid var(--scui-border-strong); color:var(--scui-muted) }
|
|
@@ -163,6 +164,15 @@
|
|
|
163
164
|
.scui-context p,.scui-details p { display:grid; margin:0 }.scui-context strong,.scui-details strong { color:var(--scui-fg) }
|
|
164
165
|
.scui-truncated { display:block; margin-top:5px; color:var(--scui-warning) }
|
|
165
166
|
.scui-notice { align-self:center; max-width:90%; padding:5px 8px; border-radius:7px; background:var(--scui-bg-raised); color:var(--scui-muted); font-size:10.5px; text-align:center }
|
|
167
|
+
.scui-noun-banners { display:grid; gap:4px; padding:6px 8px 0 }
|
|
168
|
+
.scui-noun-banner { display:flex; align-items:center; justify-content:center; gap:8px; align-self:center; max-width:92%; margin:0 auto }
|
|
169
|
+
.scui-noun-banner strong { color:var(--scui-fg) }
|
|
170
|
+
.scui-noun-banner button { flex:none; padding:3px 8px; border:1px solid var(--scui-border-strong); border-radius:6px; background:var(--scui-bg); color:var(--scui-fg); cursor:pointer; font-size:10.5px }
|
|
171
|
+
.scui-noun-banner button:hover { background:var(--scui-fill) }
|
|
172
|
+
.scui-session-nouns { display:flex; flex-wrap:wrap; gap:4px }
|
|
173
|
+
.scui-session-noun { padding:0 5px; border:1px solid var(--scui-border); border-radius:5px; color:var(--scui-muted); font-size:9.5px; line-height:15px; white-space:nowrap }
|
|
174
|
+
.scui-session-noun[data-noun="trigger"][data-status="failed"] { border-color:color-mix(in srgb,var(--scui-danger) 48%,var(--scui-border)); color:var(--scui-danger) }
|
|
175
|
+
.scui-session-noun[data-noun="mirror"] { font-style:italic }
|
|
166
176
|
.scui-unread-divider { display:flex; align-items:center; gap:7px; color:var(--scui-accent); font-size:9.5px; font-weight:650 }.scui-unread-divider::before,.scui-unread-divider::after { content:""; flex:1; height:1px; background:color-mix(in srgb,var(--scui-accent) 45%,var(--scui-border)) }.scui-unread-divider span { flex:none }
|
|
167
177
|
|
|
168
178
|
.scui-activity { min-width:0; color:var(--scui-muted) }
|
package/subagents.mjs
CHANGED
|
@@ -32,6 +32,10 @@ var EMPTY_UI_STATE = Object.freeze({
|
|
|
32
32
|
harness: "",
|
|
33
33
|
mode: "none",
|
|
34
34
|
strategy: null,
|
|
35
|
+
participant: Object.freeze({ kind: "local-user", label: null, origin: null }),
|
|
36
|
+
workspaceRef: Object.freeze({ kind: "none", value: null }),
|
|
37
|
+
mirror: null,
|
|
38
|
+
holder: null,
|
|
35
39
|
canSend: false,
|
|
36
40
|
canSteer: false,
|
|
37
41
|
canResume: false,
|
|
@@ -542,7 +546,11 @@ function languageLabel(info) {
|
|
|
542
546
|
}
|
|
543
547
|
function frameCode(render, tokens, index, options, env, self) {
|
|
544
548
|
const label = markdown.utils.escapeHtml(languageLabel(tokens[index]?.info ?? ""));
|
|
545
|
-
|
|
549
|
+
const body = render(tokens, index, options, env, self).replace(
|
|
550
|
+
"<pre>",
|
|
551
|
+
`<pre tabindex="0" role="region" aria-label="${label} code">`
|
|
552
|
+
);
|
|
553
|
+
return `<div class="scui-code-block"><div class="scui-code-head"><span>${label}</span><button class="scui-code-copy" type="button" aria-label="Copy code" title="Copy code">${COPY_ICON}<span>Copy</span></button></div>${body}</div>`;
|
|
546
554
|
}
|
|
547
555
|
for (const kind of ["fence", "code_block"]) {
|
|
548
556
|
const render = markdown.renderer.rules[kind];
|
|
@@ -600,6 +608,12 @@ function Markdown({ value, copyText }) {
|
|
|
600
608
|
|
|
601
609
|
// src/memory.js
|
|
602
610
|
var MEMORY_LIMIT = 100;
|
|
611
|
+
var registry = /* @__PURE__ */ new Set();
|
|
612
|
+
function uiMemory() {
|
|
613
|
+
const map = /* @__PURE__ */ new Map();
|
|
614
|
+
registry.add(map);
|
|
615
|
+
return map;
|
|
616
|
+
}
|
|
603
617
|
function boundedSet(map, key, value) {
|
|
604
618
|
map.delete(key);
|
|
605
619
|
map.set(key, value);
|
|
@@ -1103,6 +1117,26 @@ function TechnicalDetails({ entry }) {
|
|
|
1103
1117
|
] });
|
|
1104
1118
|
}
|
|
1105
1119
|
function TranscriptEntry({ entry, state, adapter }) {
|
|
1120
|
+
if (entry.role === "opaque") {
|
|
1121
|
+
return /* @__PURE__ */ jsxs3("article", { className: "scui-message scui-opaque", "data-role": "opaque", "data-kind": entry.kind, "aria-label": "Unrecognized entry", children: [
|
|
1122
|
+
/* @__PURE__ */ jsxs3("div", { className: "scui-notice", "data-code": "opaque-entry", children: [
|
|
1123
|
+
"Unrecognized entry kind ",
|
|
1124
|
+
/* @__PURE__ */ jsx4("code", { children: entry.kind }),
|
|
1125
|
+
" \u2014 kept as-is, nothing dropped"
|
|
1126
|
+
] }),
|
|
1127
|
+
entry.text ? /* @__PURE__ */ jsx4(Markdown, { value: entry.text, copyText: adapter?.copyText }) : null,
|
|
1128
|
+
entry.raw ? /* @__PURE__ */ jsxs3("details", { className: "scui-tool-technical", children: [
|
|
1129
|
+
/* @__PURE__ */ jsx4("summary", { children: "Technical details" }),
|
|
1130
|
+
/* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsxs3("section", { children: [
|
|
1131
|
+
/* @__PURE__ */ jsx4("strong", { children: "Raw entry" }),
|
|
1132
|
+
/* @__PURE__ */ jsxs3("pre", { children: [
|
|
1133
|
+
entry.raw,
|
|
1134
|
+
entry.truncated ? "\n[truncated]" : ""
|
|
1135
|
+
] })
|
|
1136
|
+
] }) })
|
|
1137
|
+
] }) : null
|
|
1138
|
+
] });
|
|
1139
|
+
}
|
|
1106
1140
|
if (entry.role === "request") return /* @__PURE__ */ jsx4(RequestCard, { entry, adapter, canRespond: state.canRespond });
|
|
1107
1141
|
if (entry.role === "reasoning") {
|
|
1108
1142
|
return /* @__PURE__ */ jsxs3("details", { className: "scui-reasoning", open: entry.streaming, children: [
|
|
@@ -1232,7 +1266,7 @@ function SessionDetails({ semantics }) {
|
|
|
1232
1266
|
] })
|
|
1233
1267
|
] });
|
|
1234
1268
|
}
|
|
1235
|
-
var conversationMemory =
|
|
1269
|
+
var conversationMemory = uiMemory();
|
|
1236
1270
|
function ConversationAnnouncements({ state }) {
|
|
1237
1271
|
const previousBusy = useRef3(state.busy);
|
|
1238
1272
|
const [announcement, setAnnouncement] = useState2("");
|