@volter-ai-dev/supercode-ui 0.1.12 → 0.1.14
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 +1 -1
- package/components.d.ts +1 -0
- package/components.mjs +791 -364
- package/composer.d.ts +1 -1
- package/composer.mjs +100 -24
- package/controller.mjs +5 -2
- package/conversation.d.ts +1 -0
- package/conversation.mjs +368 -193
- package/core.mjs +3 -2
- package/embed.mjs +792 -366
- package/icon.d.ts +2 -0
- package/icon.mjs +45 -0
- package/index.d.ts +17 -4
- package/messenger.mjs +790 -364
- package/package.json +8 -2
- package/sessions.mjs +164 -46
- package/styles.css +38 -18
package/icon.d.ts
ADDED
package/icon.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/icon.jsx
|
|
2
|
+
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
3
|
+
var ICONS = {
|
|
4
|
+
back: () => /* @__PURE__ */ jsx("path", { d: "m11.5 4.5-4.5 4.5 4.5 4.5" }),
|
|
5
|
+
check: () => /* @__PURE__ */ jsx("path", { d: "m4 9 3.25 3.25L14 5.5" }),
|
|
6
|
+
chevron: () => /* @__PURE__ */ jsx("path", { d: "m7 4.5 4.5 4.5L7 13.5" }),
|
|
7
|
+
close: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8
|
+
/* @__PURE__ */ jsx("path", { d: "m4.75 4.75 8.5 8.5" }),
|
|
9
|
+
/* @__PURE__ */ jsx("path", { d: "m13.25 4.75-8.5 8.5" })
|
|
10
|
+
] }),
|
|
11
|
+
copy: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12
|
+
/* @__PURE__ */ jsx("rect", { x: "5", y: "5", width: "8", height: "8", rx: "1.5" }),
|
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M3 10.5V4.25C3 3.56 3.56 3 4.25 3h6.25" })
|
|
14
|
+
] }),
|
|
15
|
+
down: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16
|
+
/* @__PURE__ */ jsx("path", { d: "M9 3.5v10" }),
|
|
17
|
+
/* @__PURE__ */ jsx("path", { d: "m4.75 9.5 4.25 4 4.25-4" })
|
|
18
|
+
] }),
|
|
19
|
+
menu: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx("circle", { cx: "4", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" }),
|
|
21
|
+
/* @__PURE__ */ jsx("circle", { cx: "9", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" }),
|
|
22
|
+
/* @__PURE__ */ jsx("circle", { cx: "14", cy: "9", r: "1.25", fill: "currentColor", stroke: "none" })
|
|
23
|
+
] }),
|
|
24
|
+
plus: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx("path", { d: "M9 3.5v11" }),
|
|
26
|
+
/* @__PURE__ */ jsx("path", { d: "M3.5 9h11" })
|
|
27
|
+
] }),
|
|
28
|
+
search: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx("circle", { cx: "7.75", cy: "7.75", r: "4.25" }),
|
|
30
|
+
/* @__PURE__ */ jsx("path", { d: "m11 11 3.5 3.5" })
|
|
31
|
+
] }),
|
|
32
|
+
send: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx("path", { d: "M9 14.5v-11" }),
|
|
34
|
+
/* @__PURE__ */ jsx("path", { d: "m4.75 7.75 4.25-4.25 4.25 4.25" })
|
|
35
|
+
] }),
|
|
36
|
+
stop: () => /* @__PURE__ */ jsx("rect", { x: "4.5", y: "4.5", width: "9", height: "9", rx: "1.5", fill: "currentColor", stroke: "none" })
|
|
37
|
+
};
|
|
38
|
+
function UiIcon({ name, size = 16, class: className = "" }) {
|
|
39
|
+
const Glyph = ICONS[name];
|
|
40
|
+
if (!Glyph) return null;
|
|
41
|
+
return /* @__PURE__ */ jsx("svg", { class: `scui-icon ${className}`, style: { "--scui-icon-size": `${size}px` }, viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx(Glyph, {}) });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
UiIcon
|
|
45
|
+
};
|
package/index.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export interface TranscriptRequest {
|
|
|
62
62
|
|
|
63
63
|
export interface TranscriptEntryModel {
|
|
64
64
|
id: string;
|
|
65
|
+
/** One-based canonical session-message position, when this entry came from persisted history. */
|
|
66
|
+
messageIndex?: number;
|
|
65
67
|
role: 'system' | 'user' | 'assistant' | 'tool' | 'reasoning' | 'request' | 'notice';
|
|
66
68
|
text: string;
|
|
67
69
|
ts: number | null;
|
|
@@ -145,6 +147,8 @@ export interface SessionAttention {
|
|
|
145
147
|
key: string;
|
|
146
148
|
kind: 'unseen' | 'finished' | 'failed';
|
|
147
149
|
preview?: string;
|
|
150
|
+
/** The canonical message count when this conversation was last seen. */
|
|
151
|
+
afterMessages?: number;
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
export interface SupercodeUiState {
|
|
@@ -220,7 +224,7 @@ export type SupercodeUiIntent =
|
|
|
220
224
|
| { action: 'release' };
|
|
221
225
|
|
|
222
226
|
export interface UiAdapter {
|
|
223
|
-
onIntent(intent: SupercodeUiIntent): void
|
|
227
|
+
onIntent(intent: SupercodeUiIntent): void | Promise<void>;
|
|
224
228
|
onClose?(): void;
|
|
225
229
|
onOpen?(): void;
|
|
226
230
|
copyText?(value: string): void | Promise<void>;
|
|
@@ -237,6 +241,13 @@ export interface MessengerLabels {
|
|
|
237
241
|
forkHere: string;
|
|
238
242
|
}
|
|
239
243
|
|
|
244
|
+
export interface PendingMessageModel {
|
|
245
|
+
text: string;
|
|
246
|
+
status: 'sending' | 'failed';
|
|
247
|
+
onRetry?(): void;
|
|
248
|
+
onEdit?(): void;
|
|
249
|
+
}
|
|
250
|
+
|
|
240
251
|
export interface ComponentOverrideProps<T = unknown> {
|
|
241
252
|
state: SupercodeUiState;
|
|
242
253
|
adapter: UiAdapter;
|
|
@@ -328,6 +339,8 @@ export function terminalCommand(handoff: NonNullable<SupercodeUiState['terminalH
|
|
|
328
339
|
export function isSendKey(event: Pick<KeyboardEvent, 'key' | 'shiftKey' | 'isComposing'>): boolean;
|
|
329
340
|
|
|
330
341
|
export function HarnessLogo(props: { id: HarnessId; activity?: SessionActivity; size?: number; onMissingLogo?(id: string): void }): VNode | null;
|
|
342
|
+
export type UiIconName = 'back' | 'check' | 'chevron' | 'close' | 'copy' | 'down' | 'menu' | 'plus' | 'search' | 'send' | 'stop';
|
|
343
|
+
export function UiIcon(props: { name: UiIconName; size?: number; class?: string }): VNode | null;
|
|
331
344
|
export function hasHarnessLogo(id: string): boolean;
|
|
332
345
|
export function LoadingStatus(props: { state: SupercodeUiState; compact?: boolean }): VNode;
|
|
333
346
|
export function RequestCard(props: { entry: TranscriptEntryModel; adapter: UiAdapter; canRespond: boolean }): VNode | null;
|
|
@@ -336,11 +349,11 @@ export function ActivityGroup(props: { entries: TranscriptEntryModel[]; state: S
|
|
|
336
349
|
export function ToolRow(props: ToolRowProps): VNode;
|
|
337
350
|
export function TaskPlan(props: { plan: TaskPlanModel }): VNode | null;
|
|
338
351
|
export function SessionDetails(props: { semantics: SessionSemanticsModel }): VNode | null;
|
|
339
|
-
export function Conversation(props: { state: SupercodeUiState; adapter: UiAdapter; components?: MessengerComponents; slots?: MessengerSlots; memoryKey?: string; pending?: string | null }): VNode;
|
|
352
|
+
export function Conversation(props: { state: SupercodeUiState; adapter: UiAdapter; components?: MessengerComponents; slots?: MessengerSlots; memoryKey?: string; pending?: string | PendingMessageModel | null; unreadAfterMessages?: number | null }): VNode;
|
|
340
353
|
export function SessionRow(props: { row: SessionRowModel; state: SupercodeUiState; adapter: UiAdapter; onOpen(row: SessionRowModel): void }): VNode;
|
|
341
|
-
export function SessionList(props: { state: SupercodeUiState; adapter: UiAdapter; onOpen(row: SessionRowModel): void; onNew?(): void; onClose?(): void; components?: MessengerComponents; labels?: MessengerLabels }): VNode;
|
|
354
|
+
export function SessionList(props: { state: SupercodeUiState; adapter: UiAdapter; onOpen(row: SessionRowModel): void; onNew?(): void; onClose?(): void; components?: MessengerComponents; labels?: MessengerLabels; focusKey?: string | null; memoryKey?: string }): VNode;
|
|
342
355
|
export function ContinuationBar(props: { state: SupercodeUiState; adapter: UiAdapter; labels?: MessengerLabels }): VNode | null;
|
|
343
|
-
export function Composer(props: { state: SupercodeUiState; adapter: UiAdapter; labels?: MessengerLabels; memoryKey?: string; onPending?(text: string): void }): VNode;
|
|
356
|
+
export function Composer(props: { state: SupercodeUiState; adapter: UiAdapter; labels?: MessengerLabels; memoryKey?: string; pendingStatus?: PendingMessageModel['status'] | 'editing' | null; restoreDraft?: { id: string | number; text: string } | null; onPending?(text: string): void; onDraftRestored?(id: string | number): void }): VNode;
|
|
344
357
|
export function SupercodeMessenger(props: MessengerProps): VNode;
|
|
345
358
|
|
|
346
359
|
export interface MountedMessenger {
|