@volter-ai-dev/supercode-ui 0.1.13 → 0.1.15

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
@@ -21,6 +21,8 @@ export interface SessionRowModel {
21
21
  name: string;
22
22
  cwd: string;
23
23
  title: string;
24
+ /** Latest human-visible conversation message, separate from the stable title. */
25
+ preview?: string;
24
26
  age: string;
25
27
  updatedAt: number | null;
26
28
  messages: number | null;
@@ -62,6 +64,8 @@ export interface TranscriptRequest {
62
64
 
63
65
  export interface TranscriptEntryModel {
64
66
  id: string;
67
+ /** One-based canonical session-message position, when this entry came from persisted history. */
68
+ messageIndex?: number;
65
69
  role: 'system' | 'user' | 'assistant' | 'tool' | 'reasoning' | 'request' | 'notice';
66
70
  text: string;
67
71
  ts: number | null;
@@ -145,6 +149,8 @@ export interface SessionAttention {
145
149
  key: string;
146
150
  kind: 'unseen' | 'finished' | 'failed';
147
151
  preview?: string;
152
+ /** The canonical message count when this conversation was last seen. */
153
+ afterMessages?: number;
148
154
  }
149
155
 
150
156
  export interface SupercodeUiState {
@@ -220,7 +226,7 @@ export type SupercodeUiIntent =
220
226
  | { action: 'release' };
221
227
 
222
228
  export interface UiAdapter {
223
- onIntent(intent: SupercodeUiIntent): void;
229
+ onIntent(intent: SupercodeUiIntent): void | Promise<void>;
224
230
  onClose?(): void;
225
231
  onOpen?(): void;
226
232
  copyText?(value: string): void | Promise<void>;
@@ -335,6 +341,8 @@ export function terminalCommand(handoff: NonNullable<SupercodeUiState['terminalH
335
341
  export function isSendKey(event: Pick<KeyboardEvent, 'key' | 'shiftKey' | 'isComposing'>): boolean;
336
342
 
337
343
  export function HarnessLogo(props: { id: HarnessId; activity?: SessionActivity; size?: number; onMissingLogo?(id: string): void }): VNode | null;
344
+ export type UiIconName = 'back' | 'check' | 'chevron' | 'close' | 'copy' | 'down' | 'menu' | 'plus' | 'search' | 'send' | 'stop';
345
+ export function UiIcon(props: { name: UiIconName; size?: number; class?: string }): VNode | null;
338
346
  export function hasHarnessLogo(id: string): boolean;
339
347
  export function LoadingStatus(props: { state: SupercodeUiState; compact?: boolean }): VNode;
340
348
  export function RequestCard(props: { entry: TranscriptEntryModel; adapter: UiAdapter; canRespond: boolean }): VNode | null;
@@ -343,9 +351,9 @@ export function ActivityGroup(props: { entries: TranscriptEntryModel[]; state: S
343
351
  export function ToolRow(props: ToolRowProps): VNode;
344
352
  export function TaskPlan(props: { plan: TaskPlanModel }): VNode | null;
345
353
  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;
354
+ export function Conversation(props: { state: SupercodeUiState; adapter: UiAdapter; components?: MessengerComponents; slots?: MessengerSlots; memoryKey?: string; pending?: string | PendingMessageModel | null; unreadAfterMessages?: number | null }): VNode;
347
355
  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;
356
+ 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
357
  export function ContinuationBar(props: { state: SupercodeUiState; adapter: UiAdapter; labels?: MessengerLabels }): VNode | null;
350
358
  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
359
  export function SupercodeMessenger(props: MessengerProps): VNode;