@volter-ai-dev/supercode-ui 0.1.13 → 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/icon.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { UiIcon } from './index.js';
2
+ export type { UiIconName } from './index.js';
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>;
@@ -335,6 +339,8 @@ export function terminalCommand(handoff: NonNullable<SupercodeUiState['terminalH
335
339
  export function isSendKey(event: Pick<KeyboardEvent, 'key' | 'shiftKey' | 'isComposing'>): boolean;
336
340
 
337
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;
338
344
  export function hasHarnessLogo(id: string): boolean;
339
345
  export function LoadingStatus(props: { state: SupercodeUiState; compact?: boolean }): VNode;
340
346
  export function RequestCard(props: { entry: TranscriptEntryModel; adapter: UiAdapter; canRespond: boolean }): VNode | null;
@@ -343,9 +349,9 @@ export function ActivityGroup(props: { entries: TranscriptEntryModel[]; state: S
343
349
  export function ToolRow(props: ToolRowProps): VNode;
344
350
  export function TaskPlan(props: { plan: TaskPlanModel }): VNode | null;
345
351
  export function SessionDetails(props: { semantics: SessionSemanticsModel }): VNode | null;
346
- export function Conversation(props: { state: SupercodeUiState; adapter: UiAdapter; components?: MessengerComponents; slots?: MessengerSlots; memoryKey?: string; pending?: string | PendingMessageModel | 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;
347
353
  export function SessionRow(props: { row: SessionRowModel; state: SupercodeUiState; adapter: UiAdapter; onOpen(row: SessionRowModel): void }): VNode;
348
- export function SessionList(props: { state: SupercodeUiState; adapter: UiAdapter; onOpen(row: SessionRowModel): void; onNew?(): void; onClose?(): void; components?: MessengerComponents; labels?: MessengerLabels; focusKey?: string | null }): 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;
349
355
  export function ContinuationBar(props: { state: SupercodeUiState; adapter: UiAdapter; labels?: MessengerLabels }): VNode | null;
350
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;
351
357
  export function SupercodeMessenger(props: MessengerProps): VNode;