@volter-ai-dev/supercode-ui 0.1.70 → 0.1.72

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.
Files changed (59) hide show
  1. package/README.md +61 -1
  2. package/activity.mjs +5 -1235
  3. package/chunks/chunk-2FG7VKIW.mjs +201 -0
  4. package/chunks/chunk-4XUMCWPC.mjs +29 -0
  5. package/chunks/chunk-E65I2I2L.mjs +120 -0
  6. package/chunks/chunk-IL5T2AST.mjs +842 -0
  7. package/chunks/chunk-LOP6XOON.mjs +671 -0
  8. package/chunks/chunk-LS6JBXNT.mjs +1237 -0
  9. package/chunks/chunk-SJ3YTA6Z.mjs +316 -0
  10. package/chunks/chunk-TKTOVDXB.mjs +139 -0
  11. package/chunks/chunk-V3UM7H7W.mjs +328 -0
  12. package/chunks/chunk-WRK5TBX3.mjs +224 -0
  13. package/chunks/chunk-ZLYHUYE2.mjs +62 -0
  14. package/components.d.ts +3 -0
  15. package/components.mjs +59 -3766
  16. package/composer.mjs +8 -580
  17. package/conversation.mjs +16 -1373
  18. package/embed.mjs +15 -3681
  19. package/icon.mjs +3 -58
  20. package/index.d.ts +25 -0
  21. package/logo.mjs +5 -87
  22. package/messenger.d.ts +3 -0
  23. package/messenger.mjs +21 -3677
  24. package/package.json +22 -3
  25. package/react/activity.mjs +5 -1235
  26. package/react/chunks/chunk-7ES5FSLG.mjs +316 -0
  27. package/react/chunks/chunk-LS6JBXNT.mjs +1237 -0
  28. package/react/chunks/chunk-LYRIQE5M.mjs +29 -0
  29. package/react/chunks/chunk-NJC6S2AW.mjs +201 -0
  30. package/react/chunks/chunk-OINC7LV7.mjs +62 -0
  31. package/react/chunks/chunk-QL6QEYPK.mjs +842 -0
  32. package/react/chunks/chunk-UGL6AB2K.mjs +120 -0
  33. package/react/chunks/chunk-UKHDCPME.mjs +328 -0
  34. package/react/chunks/chunk-UKMTRNJN.mjs +671 -0
  35. package/react/chunks/chunk-VFOVJ4S3.mjs +139 -0
  36. package/react/chunks/chunk-YK7SJ6EH.mjs +224 -0
  37. package/react/components.mjs +59 -3766
  38. package/react/composer.mjs +8 -580
  39. package/react/conversation.mjs +16 -1373
  40. package/react/icon.mjs +3 -58
  41. package/react/index.d.ts +25 -0
  42. package/react/logo.mjs +5 -87
  43. package/react/messenger.d.ts +3 -0
  44. package/react/messenger.mjs +21 -3677
  45. package/react/sessions.mjs +9 -519
  46. package/react/settings.mjs +9 -425
  47. package/react/subagents.mjs +8 -1546
  48. package/react/supervision-components.mjs +1354 -0
  49. package/react/supervision.d.ts +36 -0
  50. package/sessions.mjs +9 -519
  51. package/settings.mjs +9 -425
  52. package/source-inventory.d.ts +240 -0
  53. package/source-inventory.mjs +367 -0
  54. package/styles.css +104 -0
  55. package/subagents.mjs +8 -1546
  56. package/supervision-components.d.ts +36 -0
  57. package/supervision-components.mjs +1354 -0
  58. package/supervision.d.ts +242 -0
  59. package/supervision.mjs +349 -0
@@ -0,0 +1,36 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ProfileListProps, ProfileDetailsProps, ChannelListProps, RouteListProps, TriggerListProps, SkillListProps, SkillDetailsProps, MemoryBrowserProps, SourceInspectorProps, ApprovalInboxProps, ApprovalDetailsProps, AdapterStatusProps, OrchestrationOverviewProps } from '../source-inventory.js';
3
+ export function ProfileList(props: ProfileListProps): ReactElement;
4
+ export function ProfileDetails(props: ProfileDetailsProps): ReactElement;
5
+ export function ChannelList(props: ChannelListProps): ReactElement;
6
+ export function RouteList(props: RouteListProps): ReactElement;
7
+ export function TriggerList(props: TriggerListProps): ReactElement;
8
+ export function SkillList(props: SkillListProps): ReactElement;
9
+ export function SkillDetails(props: SkillDetailsProps): ReactElement;
10
+ export function MemoryBrowser(props: MemoryBrowserProps): ReactElement;
11
+ export function SourceInspector(props: SourceInspectorProps): ReactElement;
12
+ export function ApprovalInbox(props: ApprovalInboxProps): ReactElement;
13
+ export function ApprovalDetails(props: ApprovalDetailsProps): ReactElement;
14
+ export function AdapterStatus(props: AdapterStatusProps): ReactElement;
15
+ export function OrchestrationOverview(props: OrchestrationOverviewProps): ReactElement;
16
+ export type * from '../supervision.js';
17
+ import type { WorkflowBoardProps, WorkflowListProps, TaskCardProps, TaskDetailsProps, DependencyListProps, AttemptTimelineProps, HandoffCardProps, ReviewCardProps, TaskThreadProps, JobListProps, JobDetailsProps, JobActionsProps, RunListProps, RunDetailsProps, DeliveryStatusProps, OrchestrationJobsProps } from '../supervision.js';
18
+ export function WorkflowBoard(props: WorkflowBoardProps): ReactElement;
19
+ export function WorkflowList(props: WorkflowListProps): ReactElement;
20
+ export function TaskCard(props: TaskCardProps): ReactElement;
21
+ export function TaskDetails(props: TaskDetailsProps): ReactElement;
22
+ export function DependencyList(props: DependencyListProps): ReactElement;
23
+ export function AttemptTimeline(props: AttemptTimelineProps): ReactElement;
24
+ export function HandoffCard(props: HandoffCardProps): ReactElement;
25
+ export function ReviewCard(props: ReviewCardProps): ReactElement;
26
+ export function TaskThread(props: TaskThreadProps): ReactElement;
27
+ export function JobList(props: JobListProps): ReactElement;
28
+ export function JobDetails(props: JobDetailsProps): ReactElement;
29
+ export function JobActions(props: JobActionsProps): ReactElement;
30
+ export function RunList(props: RunListProps): ReactElement;
31
+ export function RunDetails(props: RunDetailsProps): ReactElement;
32
+ export function DeliveryStatus(props: DeliveryStatusProps): ReactElement;
33
+ export function OrchestrationJobs(props: OrchestrationJobsProps): ReactElement;
34
+
35
+ import type { JobControlsProps } from '../supervision.js';
36
+ export function JobControls(props: JobControlsProps): ReactElement;
package/sessions.mjs CHANGED
@@ -1,522 +1,12 @@
1
- // src/sessions.jsx
2
- import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState3 } from "preact/hooks";
3
-
4
- // core.mjs
5
- var HARNESS_NAMES = Object.freeze({
6
- "claude-code": "Claude Code",
7
- codex: "Codex",
8
- gemini: "Gemini CLI",
9
- goose: "Goose",
10
- opencode: "OpenCode",
11
- pi: "Pi",
12
- grok: "Grok"
13
- });
14
- var DEFAULT_LABELS = Object.freeze({
15
- chats: "Chats",
16
- newChat: "New chat",
17
- searchChats: "Search chats",
18
- askAgent: "Ask your agent\u2026",
19
- attachContext: "Attach files or images",
20
- continueHere: "Continue here",
21
- continueWithTerminal: "Continue with terminal",
22
- joinLive: "Join live",
23
- forkHere: "Fork here"
24
- });
25
- var EMPTY_UI_STATE = Object.freeze({
26
- pill: Object.freeze({ tone: "off", label: "connecting\u2026" }),
27
- startup: "connecting",
28
- transcript: Object.freeze([]),
29
- busy: false,
30
- operation: null,
31
- needsInput: false,
32
- harness: "",
33
- mode: "none",
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,
39
- canSend: false,
40
- canSteer: false,
41
- canResume: false,
42
- supportsResume: false,
43
- continuationModes: Object.freeze([]),
44
- canBranch: false,
45
- supportsBranch: false,
46
- canAttach: false,
47
- supportsAttach: false,
48
- canDetach: false,
49
- canOpenTerminal: false,
50
- canExport: false,
51
- canReduce: false,
52
- canInterrupt: false,
53
- canRespond: false,
54
- canConfigureSettings: false,
55
- messaging: null,
56
- workspace: "",
57
- taskPlan: Object.freeze({ source: "none", items: Object.freeze([]), residueCount: 0, observedAt: null }),
58
- semantics: Object.freeze({ fidelity: null, residue: Object.freeze([]), residueCount: 0, parseErrors: 0, rawRecords: 0, subagents: Object.freeze([]) }),
59
- terminalHandoff: null,
60
- exportBackTarget: null,
61
- exportReceipt: null,
62
- reductionReceipt: null,
63
- interopSettings: null,
64
- interopSettingsError: null,
65
- harnessAuthentication: null,
66
- error: null,
67
- recoverable: false,
68
- harnesses: Object.freeze([]),
69
- history: Object.freeze({ sessionLimit: 0, hasMoreSessions: false, transcriptLimit: 120, hasEarlier: false }),
70
- savedDraft: "",
71
- attention: Object.freeze([]),
72
- sessions: Object.freeze([]),
73
- subagentInspector: null,
74
- attached: null,
75
- owned: null,
76
- attachError: null,
77
- agentPackage: null,
78
- contributions: Object.freeze([]),
79
- agentPackageError: null,
80
- agentPackageCapabilityState: null,
81
- agentPackageCapabilityError: null
82
- });
83
- function relativeAge(updatedAt, now = Date.now()) {
84
- if (typeof updatedAt !== "number" || !Number.isFinite(updatedAt) || updatedAt <= 0) return "";
85
- const delta = Math.max(0, now - updatedAt);
86
- if (delta < 6e4) return "now";
87
- if (delta < 36e5) return `${Math.floor(delta / 6e4)}m ago`;
88
- if (delta < 864e5) return `${Math.floor(delta / 36e5)}h ago`;
89
- if (delta < 6048e5) return `${Math.floor(delta / 864e5)}d ago`;
90
- return `${Math.floor(delta / 6048e5)}w ago`;
91
- }
92
- function harnessDisplayName(id) {
93
- return HARNESS_NAMES[id] ?? id;
94
- }
95
- function sessionDisplayName(session) {
96
- const title = session.title?.trim();
97
- return title && title !== session.name ? title : session.name || "Untitled chat";
98
- }
99
- function sessionActivity(state, row) {
100
- if (row.activity && ACTIVITY_PRIORITY[row.activity] !== void 0) return row.activity;
101
- if (state.needsInput && row.active) return "needs-input";
102
- if (state.busy && row.active) return "working";
103
- if (row.runtimeStatus === "busy") return "working";
104
- const attention = state.attention.find((item) => item.key === row.key)?.kind;
105
- if (attention) return attention;
106
- if (row.runtimeStatus === "running") return "running";
107
- if (row.live || row.runtimeStatus === "idle") return "recent";
108
- return "idle";
109
- }
110
- var ACTIVITY_PRIORITY = Object.freeze({
111
- "needs-input": 70,
112
- failed: 60,
113
- working: 50,
114
- unseen: 40,
115
- finished: 30,
116
- running: 20,
117
- recent: 10,
118
- idle: 0
119
- });
120
- function filterSessions(rows, query) {
121
- const needle = query.trim().toLocaleLowerCase();
122
- if (!needle) return [...rows];
123
- return rows.filter((row) => [row.name, row.title, row.preview, row.cwd, row.harness, harnessDisplayName(row.harness)].some((value) => typeof value === "string" && value.toLocaleLowerCase().includes(needle)));
124
- }
125
-
126
- // src/conversation.jsx
127
- import { Fragment as Fragment3 } from "preact";
128
- import { useEffect as useEffect3, useId, useLayoutEffect, useRef as useRef3, useState as useState2 } from "preact/hooks";
129
-
130
- // src/markdown.jsx
131
- import MarkdownIt from "markdown-it";
132
- import { useEffect, useMemo, useRef } from "preact/hooks";
133
- import { jsx } from "preact/jsx-runtime";
134
- var markdown = new MarkdownIt({ html: false, linkify: true, breaks: false });
135
- var LANGUAGE_LABELS = {
136
- bash: "Shell",
137
- css: "CSS",
138
- html: "HTML",
139
- js: "JavaScript",
140
- javascript: "JavaScript",
141
- jsx: "JSX",
142
- md: "Markdown",
143
- markdown: "Markdown",
144
- py: "Python",
145
- python: "Python",
146
- rs: "Rust",
147
- rust: "Rust",
148
- sh: "Shell",
149
- shell: "Shell",
150
- ts: "TypeScript",
151
- tsx: "TSX",
152
- yaml: "YAML",
153
- yml: "YAML",
154
- json: "JSON",
155
- jsonc: "JSONC",
156
- sql: "SQL",
157
- xml: "XML"
158
- };
159
- var COPY_ICON = '<svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="5" width="8" height="8" rx="1.5"></rect><path d="M3 10.5V4.25C3 3.56 3.56 3 4.25 3h6.25"></path></svg>';
160
- function languageLabel(info) {
161
- const language = info.trim().split(/\s+/, 1)[0]?.toLocaleLowerCase() ?? "";
162
- if (!language) return "Code";
163
- return LANGUAGE_LABELS[language] ?? language.toLocaleUpperCase();
164
- }
165
- function frameCode(render, tokens, index, options, env, self) {
166
- const label = markdown.utils.escapeHtml(languageLabel(tokens[index]?.info ?? ""));
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>`;
172
- }
173
- for (const kind of ["fence", "code_block"]) {
174
- const render = markdown.renderer.rules[kind];
175
- markdown.renderer.rules[kind] = (tokens, index, options, env, self) => frameCode(render, tokens, index, options, env, self);
176
- }
177
- var defaultLinkOpen = markdown.renderer.rules.link_open;
178
- markdown.renderer.rules.link_open = (tokens, index, options, env, self) => {
179
- tokens[index]?.attrSet("target", "_blank");
180
- tokens[index]?.attrSet("rel", "noreferrer noopener");
181
- return defaultLinkOpen ? defaultLinkOpen(tokens, index, options, env, self) : self.renderToken(tokens, index, options);
182
- };
183
-
184
- // src/memory.js
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
- }
192
- function boundedSet(map, key, value) {
193
- map.delete(key);
194
- map.set(key, value);
195
- while (map.size > MEMORY_LIMIT) map.delete(map.keys().next().value);
196
- }
197
-
198
- // src/icon.jsx
199
- import { Fragment, jsx as jsx2, jsxs } from "preact/jsx-runtime";
200
- var ICONS = {
201
- agents: () => /* @__PURE__ */ jsxs(Fragment, { children: [
202
- /* @__PURE__ */ jsx2("circle", { cx: "6", cy: "6.5", r: "2" }),
203
- /* @__PURE__ */ jsx2("path", { d: "M2.75 13c.45-2 1.55-3 3.25-3s2.8 1 3.25 3" }),
204
- /* @__PURE__ */ jsx2("circle", { cx: "12.25", cy: "7", r: "1.5" }),
205
- /* @__PURE__ */ jsx2("path", { d: "M10.5 10.75c1.95-.65 3.45.1 4 2.25" })
206
- ] }),
207
- attach: () => /* @__PURE__ */ jsx2("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" }),
208
- back: () => /* @__PURE__ */ jsx2("path", { d: "m11.5 4.5-4.5 4.5 4.5 4.5" }),
209
- check: () => /* @__PURE__ */ jsx2("path", { d: "m4 9 3.25 3.25L14 5.5" }),
210
- chevron: () => /* @__PURE__ */ jsx2("path", { d: "m7 4.5 4.5 4.5L7 13.5" }),
211
- close: () => /* @__PURE__ */ jsxs(Fragment, { children: [
212
- /* @__PURE__ */ jsx2("path", { d: "m4.75 4.75 8.5 8.5" }),
213
- /* @__PURE__ */ jsx2("path", { d: "m13.25 4.75-8.5 8.5" })
214
- ] }),
215
- compose: () => /* @__PURE__ */ jsxs(Fragment, { children: [
216
- /* @__PURE__ */ jsx2("path", { d: "M11.75 3.75 14.25 6.25 7 13.5l-3.25.75.75-3.25 7.25-7.25Z" }),
217
- /* @__PURE__ */ jsx2("path", { d: "m10.5 5 2.5 2.5" })
218
- ] }),
219
- copy: () => /* @__PURE__ */ jsxs(Fragment, { children: [
220
- /* @__PURE__ */ jsx2("rect", { x: "5", y: "5", width: "8", height: "8", rx: "1.5" }),
221
- /* @__PURE__ */ jsx2("path", { d: "M3 10.5V4.25C3 3.56 3.56 3 4.25 3h6.25" })
222
- ] }),
223
- down: () => /* @__PURE__ */ jsxs(Fragment, { children: [
224
- /* @__PURE__ */ jsx2("path", { d: "M9 3.5v10" }),
225
- /* @__PURE__ */ jsx2("path", { d: "m4.75 9.5 4.25 4 4.25-4" })
226
- ] }),
227
- image: () => /* @__PURE__ */ jsxs(Fragment, { children: [
228
- /* @__PURE__ */ jsx2("rect", { x: "3", y: "3.5", width: "12", height: "11", rx: "1.75" }),
229
- /* @__PURE__ */ jsx2("circle", { cx: "6.5", cy: "7", r: "1.25" }),
230
- /* @__PURE__ */ jsx2("path", { d: "m4.5 13 3.25-3 2.1 1.85 1.65-1.5L14 13" })
231
- ] }),
232
- menu: () => /* @__PURE__ */ jsxs(Fragment, { children: [
233
- /* @__PURE__ */ jsx2("circle", { cx: "4", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" }),
234
- /* @__PURE__ */ jsx2("circle", { cx: "9", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" }),
235
- /* @__PURE__ */ jsx2("circle", { cx: "14", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" })
236
- ] }),
237
- plus: () => /* @__PURE__ */ jsxs(Fragment, { children: [
238
- /* @__PURE__ */ jsx2("path", { d: "M9 3.5v11" }),
239
- /* @__PURE__ */ jsx2("path", { d: "M3.5 9h11" })
240
- ] }),
241
- search: () => /* @__PURE__ */ jsxs(Fragment, { children: [
242
- /* @__PURE__ */ jsx2("circle", { cx: "7.75", cy: "7.75", r: "4.25" }),
243
- /* @__PURE__ */ jsx2("path", { d: "m11 11 3.5 3.5" })
244
- ] }),
245
- send: () => /* @__PURE__ */ jsxs(Fragment, { children: [
246
- /* @__PURE__ */ jsx2("path", { d: "M9 14.5v-11" }),
247
- /* @__PURE__ */ jsx2("path", { d: "m4.75 7.75 4.25-4.25 4.25 4.25" })
248
- ] }),
249
- stop: () => /* @__PURE__ */ jsx2("rect", { x: "4.5", y: "4.5", width: "9", height: "9", rx: "1.5", fill: "currentColor", stroke: "none" })
250
- };
251
- function UiIcon({ name, size = 16, class: className = "" }) {
252
- const Glyph = ICONS[name];
253
- if (!Glyph) return null;
254
- return /* @__PURE__ */ jsx2("svg", { className: `scui-icon ${className}`, style: { "--scui-icon-size": `${size}px` }, viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx2(Glyph, {}) });
255
- }
256
-
257
- // src/context.jsx
258
- import { useEffect as useEffect2, useRef as useRef2, useState } from "preact/hooks";
259
- import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "preact/jsx-runtime";
260
- var MAX_IMAGE_BYTES = 5 * 1024 * 1024;
261
- var MAX_RESOLVED_IMAGE_BYTES = 16 * 1024 * 1024;
262
-
263
- // src/conversation.jsx
264
- import { Fragment as Fragment4, jsx as jsx4, jsxs as jsxs3 } from "preact/jsx-runtime";
265
- function LoadingStatus({ state, compact = false }) {
266
- const copy = {
267
- connecting: ["Connecting to coding agents", "Checking installed harnesses and capabilities.", 0],
268
- starting: [`Starting ${harnessDisplayName(state.harness) || "coding agent"}`, "Opening a controlled session in this workspace.", 1],
269
- discovering: ["Loading recent sessions", "Scanning native session stores without loading full transcripts.", 2],
270
- ready: ["Ready", "Coding sessions are up to date.", 3]
271
- }[state.startup];
272
- return /* @__PURE__ */ jsxs3("div", { className: `scui-loading${compact ? " scui-loading-compact" : ""}`, role: "status", "aria-busy": state.startup !== "ready", children: [
273
- /* @__PURE__ */ jsx4("span", { className: "scui-orbit", "aria-hidden": "true", children: /* @__PURE__ */ jsx4("i", {}) }),
274
- /* @__PURE__ */ jsxs3("span", { className: "scui-loading-copy", children: [
275
- /* @__PURE__ */ jsx4("strong", { children: copy[0] }),
276
- /* @__PURE__ */ jsx4("small", { children: copy[1] })
277
- ] }),
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)) })
279
- ] });
280
- }
281
- var conversationMemory = uiMemory();
282
-
283
- // src/logo.jsx
284
- import { useEffect as useEffect4 } from "preact/hooks";
285
- import { jsx as jsx5, jsxs as jsxs4 } from "preact/jsx-runtime";
286
- var LOGOS = {
287
- "claude-code": {
288
- viewBox: "-1 3.5 26 18",
289
- paths: [
290
- ["path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z" }]
291
- ]
292
- },
293
- codex: {
294
- viewBox: "-1 -1 26 26",
295
- paths: [
296
- ["path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z" }]
297
- ]
298
- },
299
- gemini: {
300
- viewBox: "0 0 24 24",
301
- paths: [["path", { d: "M12 24C12 17.373 6.627 12 0 12 6.627 12 12 6.627 12 0c0 6.627 5.373 12 12 12-6.627 0-12 5.373-12 12z" }]]
302
- },
303
- grok: {
304
- viewBox: "-1 -1 26 26",
305
- paths: [["path", { d: "M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815" }]]
306
- },
307
- // Canonical mark from block/goose's documentation/static/img/goose.svg.
308
- goose: {
309
- viewBox: "0 0 45 45",
310
- paths: [["path", { d: "M43.2098 39.2492L39.8118 36.4522C37.9646 34.9318 36.3923 33.1051 35.1631 31.0529C33.4647 28.2172 31.1178 25.8243 28.3164 24.071L26.9482 23.2744C26.4794 22.9485 26.1525 22.4405 26.106 21.8675C26.0762 21.4981 26.1647 21.1678 26.3712 20.8771C27.0837 19.873 30.9617 15.6995 31.6365 15.1411C32.5056 14.4228 33.4739 13.8253 34.3724 13.1412C34.5001 13.0438 34.6283 12.9469 34.7545 12.8481C35.0574 12.6088 35.3295 12.3671 35.5458 12.0803C36.5993 10.8604 36.5783 9.82938 36.5783 9.82938C36.4677 9.5534 36.0645 8.69902 35.2449 8.29825C35.9696 8.28406 36.7872 8.55564 37.1582 8.91873C37.6039 8.21947 37.8922 7.76585 38.3404 7.00347C38.4471 6.82241 38.5038 6.48771 38.2998 6.30029C38.1114 6.11287 37.6416 6.01697 37.4606 6.12364C36.4692 6.70693 35.5047 7.33475 34.6351 7.88525C34.6351 7.88525 33.6046 7.86372 32.3842 8.91775C32.097 9.13452 31.8552 9.4066 31.6282 9.69433C31.5171 9.83476 31.4202 9.96297 31.3233 10.0912C30.6387 10.9901 30.0417 11.958 29.3234 12.8271C28.7656 13.5023 24.5915 17.3798 23.5874 18.0923C23.2967 18.2988 22.9669 18.3879 22.597 18.3575C22.0245 18.3115 21.5161 17.9842 21.1902 17.5154L20.3935 16.1472C18.6402 13.3448 16.2474 10.9989 13.4117 9.30041C11.3594 8.0712 9.5332 6.49847 8.01234 4.65172L5.2153 1.25377C5.0773 1.08642 4.81306 1.11382 4.71422 1.30662C4.39615 1.92612 3.78888 3.23411 3.32353 4.99327C3.92786 5.81095 5.26717 7.35089 6.8624 8.65351C6.97348 8.74403 6.88246 8.92313 6.74447 8.88496C5.36846 8.51013 4.03062 7.90825 3.02944 7.39542C2.94772 7.35383 2.84887 7.4057 2.83713 7.49672C2.68152 8.74354 2.64139 10.1127 2.80581 11.5562C4.02572 12.1596 5.85143 12.8804 7.76816 13.3389C7.90713 13.3722 7.90273 13.5723 7.76229 13.5992C6.26982 13.8801 4.70688 13.9427 3.43656 13.9261C3.3475 13.9251 3.28193 14.0093 3.30591 14.0949C3.56085 14.9958 3.90632 15.9118 4.3619 16.8342C4.55029 17.2487 4.75532 17.6553 4.97504 18.0532C6.21207 18.107 7.47946 17.9964 8.75369 17.7713C8.97095 17.7331 9.08741 18.0189 8.90391 18.1417C8.03877 18.7201 7.11588 19.2183 6.25758 19.6283C6.14259 19.6836 6.1054 19.8304 6.18125 19.9327C6.69114 20.6236 7.25191 21.2774 7.86114 21.8866C7.86114 21.8866 10.8608 24.9763 10.9425 25.2185C12.6928 23.4261 15.5701 21.4394 18.7474 19.7047C14.4921 23.1672 12.1198 25.7235 10.9258 27.1758L10.0935 28.3439C9.66091 28.9507 9.2856 29.5951 8.97193 30.2709C7.92231 32.5292 6.19201 37.0966 6.19201 37.0966C6.0594 37.4543 6.16755 37.8072 6.39753 38.0371C6.66031 38.2999 7.01263 38.4076 7.37033 38.275C7.37033 38.275 11.9368 36.5447 14.1961 35.495C14.8719 35.1814 15.5168 34.8056 16.1231 34.3735L17.4095 33.457C18.0907 32.9715 19.0234 33.0489 19.615 33.6405L22.5804 36.6058C23.1896 37.2151 23.8433 37.7758 24.5343 38.2857C24.637 38.3611 24.7833 38.3244 24.8386 38.2094C25.2492 37.3516 25.7473 36.4277 26.3252 35.5631C26.4481 35.3796 26.7343 35.4965 26.6957 35.7133C26.4701 36.988 26.3605 38.2554 26.3086 39.3035C27.2178 39.9172 28.5551 40.5606 30.3721 41.1611C30.4577 41.185 30.5419 41.1195 30.5409 41.0304C30.5237 39.7596 30.5864 38.1967 30.8677 36.7047C30.8942 36.5638 31.0943 36.5593 31.1281 36.6988C31.5861 38.616 32.3069 40.4417 32.8041 41.5829C34.3543 41.8256 35.7234 41.7855 36.9703 41.6298C37.0618 41.6186 37.1136 41.5197 37.0715 41.4375C36.5587 40.4364 35.9568 39.0975 35.582 37.7225C35.5443 37.584 35.7229 37.4935 35.8135 37.6046C37.1161 39.1998 38.656 40.5391 39.3548 41.1175C41.2333 40.6786 42.5413 40.0713 43.1604 39.7528C43.3532 39.6539 43.3806 39.3897 43.2132 39.2517Z" }]]
311
- },
312
- opencode: { viewBox: "2.5 0 19 24", paths: [["path", { d: "M16 6H8v12h8V6zm4 16H4V2h16v20z" }]] },
313
- pi: {
314
- viewBox: "0 0 24 24",
315
- paths: [
316
- ["path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z" }],
317
- ["path", { d: "M17.5 12H23v11h-5.5V12z" }]
318
- ]
319
- },
320
- // Product mark shared with the first-party browser frontend favicon.
321
- supercode: {
322
- viewBox: "0 0 64 64",
323
- paths: [
324
- ["rect", { width: "64", height: "64", rx: "14", fill: "#111923" }],
325
- ["path", { d: "M18 21h28v6H18zm0 13h18v6H18z", fill: "#5f8fff" }],
326
- ["circle", { cx: "46", cy: "37", r: "7", fill: "none", stroke: "#8ce0aa", strokeWidth: "4" }]
327
- ]
328
- }
329
- };
330
- var SVG_ATTRIBUTE_NAMES = Object.freeze({
331
- clipRule: "clip-rule",
332
- fillRule: "fill-rule",
333
- strokeWidth: "stroke-width"
334
- });
335
- function HarnessLogo({ id, activity, size = 28, onMissingLogo }) {
336
- const logo = LOGOS[id];
337
- useEffect4(() => {
338
- if (!logo) onMissingLogo?.(id);
339
- }, [id, logo, onMissingLogo]);
340
- if (!logo) return null;
341
- return /* @__PURE__ */ jsxs4("span", { className: "scui-logo", "data-harness": id, "data-activity": activity, style: { "--scui-logo-size": `${size}px` }, "aria-hidden": "true", children: [
342
- /* @__PURE__ */ jsx5("svg", { viewBox: logo.viewBox, preserveAspectRatio: "xMidYMid meet", focusable: "false", children: logo.paths.map(([Tag, props], index) => /* @__PURE__ */ jsx5(Tag, { ...props }, index)) }),
343
- activity && activity !== "idle" ? /* @__PURE__ */ jsx5("i", {}) : null
344
- ] });
345
- }
346
-
347
- // src/sessions.jsx
348
- import { jsx as jsx6, jsxs as jsxs5 } from "preact/jsx-runtime";
349
- var sessionListMemory = uiMemory();
350
- function sessionPathParts(value) {
351
- const complete = String(value ?? "").replaceAll("\\", "/");
352
- const boundary = complete.lastIndexOf("/");
353
- if (boundary < 0) return { complete, leading: complete, separator: "", trailing: "" };
354
- return {
355
- complete,
356
- leading: complete.slice(0, boundary),
357
- separator: "/",
358
- trailing: complete.slice(boundary + 1)
359
- };
360
- }
361
- function SessionRow({ row, state, onOpen, onOpenSubagents, now = Date.now() }) {
362
- const activity = sessionActivity(state, row);
363
- const working = activity === "working";
364
- const attention = state.attention.find((item) => item.key === row.key);
365
- const title = sessionDisplayName(row);
366
- const path = sessionPathParts(row.cwd);
367
- const preview = row.preview || attention?.preview || "";
368
- const unreadCount = attention?.unreadCount ?? 0;
369
- const unreadLabel = unreadCount > 99 ? "99+" : String(unreadCount);
370
- const age = relativeAge(row.previewUpdatedAt ?? row.updatedAt, now) || row.age;
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: [
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: [
416
- /* @__PURE__ */ jsx6(HarnessLogo, { id: row.harness, activity, size: 34 }),
417
- /* @__PURE__ */ jsxs5("span", { className: "scui-session-copy", children: [
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,
420
- path.complete ? /* @__PURE__ */ jsxs5("small", { className: "scui-session-path", title: row.cwd, children: [
421
- /* @__PURE__ */ jsx6("span", { className: "scui-session-path-leading", children: path.leading }),
422
- path.separator ? /* @__PURE__ */ jsx6("span", { className: "scui-session-path-separator", children: path.separator }) : null,
423
- path.trailing ? /* @__PURE__ */ jsx6("span", { className: "scui-session-path-trailing", children: path.trailing }) : null
424
- ] }) : null,
425
- working || preview ? /* @__PURE__ */ jsxs5("span", { className: "scui-session-preview", children: [
426
- working ? /* @__PURE__ */ jsxs5("span", { className: "scui-session-working", "aria-hidden": "true", children: [
427
- /* @__PURE__ */ jsx6("i", {}),
428
- /* @__PURE__ */ jsx6("i", {}),
429
- /* @__PURE__ */ jsx6("i", {})
430
- ] }) : null,
431
- preview || working ? /* @__PURE__ */ jsx6("small", { children: preview || "Working\u2026" }) : null
432
- ] }) : null,
433
- state.attachError?.key === row.key ? /* @__PURE__ */ jsx6("em", { children: state.attachError.message }) : null
434
- ] })
435
- ] }),
436
- row.subagentCount || age || unreadCount ? /* @__PURE__ */ jsxs5("span", { className: "scui-session-rail", children: [
437
- /* @__PURE__ */ jsxs5("span", { className: "scui-session-rail-meta", children: [
438
- row.subagentCount ? /* @__PURE__ */ jsxs5("button", { className: "scui-session-agents", type: "button", title: `${row.subagentCount} agent sessions`, "aria-label": `Open ${row.subagentCount} agent sessions in ${title}`, onClick: () => onOpenSubagents?.(row), children: [
439
- /* @__PURE__ */ jsx6(UiIcon, { name: "agents", size: 14 }),
440
- /* @__PURE__ */ jsx6("span", { children: row.subagentCount })
441
- ] }) : null,
442
- age ? /* @__PURE__ */ jsx6("time", { children: age }) : null
443
- ] }),
444
- unreadCount ? /* @__PURE__ */ jsx6("b", { "aria-label": `${unreadCount} unread messages`, children: unreadLabel }) : null
445
- ] }) : null
446
- ] });
447
- }
448
- function SessionList({ state, adapter, onOpen, onOpenSubagents, onNew, onClose, components = {}, slots = {}, labels = DEFAULT_LABELS, focusKey = null, memoryKey = state.workspace || "@default", headerActions: HeaderActions }) {
449
- const remembered = sessionListMemory.get(memoryKey) ?? { query: "", top: 0 };
450
- const [query, setQuery] = useState3(remembered.query);
451
- const [loadingMore, setLoadingMore] = useState3(false);
452
- const [now, setNow] = useState3(() => Date.now());
453
- const root = useRef4(null);
454
- const rowScroller = useRef4(null);
455
- const rows = filterSessions(state.sessions, query);
456
- const Row = components.SessionRow ?? SessionRow;
457
- const ListHeader = slots.listHeader;
458
- const ListToolbarActions = slots.listToolbarActions;
459
- const BeforeSessions = slots.beforeSessions;
460
- const AfterSessions = slots.afterSessions;
461
- useLayoutEffect2(() => {
462
- if (rowScroller.current) rowScroller.current.scrollTop = remembered.top;
463
- }, [memoryKey]);
464
- useEffect5(() => {
465
- if (!focusKey || !root.current) return;
466
- const target = focusKey === "@new" ? root.current.querySelector('[data-list-focus="new"]') : [...root.current.querySelectorAll("[data-session-key]")].find((element) => element.dataset.sessionKey === focusKey);
467
- (target ?? root.current.querySelector("input,button"))?.focus({ preventScroll: true });
468
- }, [focusKey, rows.length]);
469
- useEffect5(() => {
470
- if (loadingMore) setLoadingMore(false);
471
- }, [state.error, state.history.hasMoreSessions, state.sessions.length]);
472
- useEffect5(() => {
473
- const timer = setInterval(() => setNow(Date.now()), 1e4);
474
- return () => clearInterval(timer);
475
- }, []);
476
- const loadMore = () => {
477
- if (loadingMore) return;
478
- setLoadingMore(true);
479
- const result = adapter.onIntent({ action: "loadSessions" });
480
- if (result && typeof result.then === "function") {
481
- Promise.resolve(result).then(() => setLoadingMore(false), () => setLoadingMore(false));
482
- }
483
- };
484
- return /* @__PURE__ */ jsxs5("section", { className: "scui-list", ref: root, children: [
485
- ListHeader ? /* @__PURE__ */ jsx6(ListHeader, { state, adapter, value: { query, rows, onNew } }) : /* @__PURE__ */ jsxs5("header", { className: "scui-head", children: [
486
- /* @__PURE__ */ jsxs5("span", { className: "scui-head-copy", children: [
487
- /* @__PURE__ */ jsx6("strong", { children: labels.chats }),
488
- /* @__PURE__ */ jsxs5("small", { children: [
489
- state.sessions.length,
490
- " recent conversations"
491
- ] })
492
- ] }),
493
- HeaderActions ? /* @__PURE__ */ jsx6(HeaderActions, { state, adapter, value: "list" }) : null,
494
- /* @__PURE__ */ jsx6("button", { type: "button", "data-list-focus": "new", "aria-label": labels.newChat, disabled: !state.harnesses.some((item) => item.startable), onClick: onNew, children: /* @__PURE__ */ jsx6(UiIcon, { name: "plus", size: 18 }) }),
495
- onClose ? /* @__PURE__ */ jsx6("button", { type: "button", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx6(UiIcon, { name: "close", size: 18 }) }) : null
496
- ] }),
497
- state.startup !== "ready" ? /* @__PURE__ */ jsx6(LoadingStatus, { state, compact: rows.length > 0 }) : null,
498
- state.sessions.length > 4 || ListToolbarActions ? /* @__PURE__ */ jsxs5("div", { className: "scui-list-toolbar", children: [
499
- state.sessions.length > 4 ? /* @__PURE__ */ jsxs5("label", { className: "scui-search", children: [
500
- /* @__PURE__ */ jsx6(UiIcon, { name: "search", size: 15 }),
501
- /* @__PURE__ */ jsx6("input", { type: "search", "aria-label": labels.searchChats, placeholder: labels.searchChats, value: query, onInput: (event) => {
502
- const value = event.currentTarget.value;
503
- setQuery(value);
504
- boundedSet(sessionListMemory, memoryKey, { query: value, top: 0 });
505
- if (rowScroller.current) rowScroller.current.scrollTop = 0;
506
- } }),
507
- query ? /* @__PURE__ */ jsx6("small", { children: rows.length }) : null
508
- ] }) : null,
509
- ListToolbarActions ? /* @__PURE__ */ jsx6(ListToolbarActions, { state, adapter, value: { query, rows, onNew, canStart: state.harnesses.some((item) => item.startable) } }) : null
510
- ] }) : null,
511
- /* @__PURE__ */ jsxs5("div", { className: "scui-session-rows", ref: rowScroller, onScroll: (event) => boundedSet(sessionListMemory, memoryKey, { query, top: event.currentTarget.scrollTop }), children: [
512
- BeforeSessions ? /* @__PURE__ */ jsx6(BeforeSessions, { state, adapter, value: { query, rows } }) : null,
513
- !rows.length && state.startup === "ready" ? /* @__PURE__ */ jsx6("div", { className: "scui-empty", children: query ? "No chats match your search." : state.error ?? "No coding chats found." }) : null,
514
- rows.map((row) => /* @__PURE__ */ jsx6(Row, { value: row, row, state, adapter, onOpen, onOpenSubagents, now }, row.key)),
515
- state.history.hasMoreSessions ? /* @__PURE__ */ jsx6("button", { className: "scui-load", type: "button", disabled: loadingMore, onClick: loadMore, children: loadingMore ? "Loading older chats\u2026" : "Load older chats" }) : null,
516
- AfterSessions ? /* @__PURE__ */ jsx6(AfterSessions, { state, adapter, value: { query, rows } }) : null
517
- ] })
518
- ] });
519
- }
1
+ import {
2
+ SessionList,
3
+ SessionRow
4
+ } from "./chunks/chunk-2FG7VKIW.mjs";
5
+ import "./chunks/chunk-TKTOVDXB.mjs";
6
+ import "./chunks/chunk-LOP6XOON.mjs";
7
+ import "./chunks/chunk-V3UM7H7W.mjs";
8
+ import "./chunks/chunk-LS6JBXNT.mjs";
9
+ import "./chunks/chunk-ZLYHUYE2.mjs";
520
10
  export {
521
11
  SessionList,
522
12
  SessionRow