@ai-ecoverse/slicc-spectrum 1.0.0 → 1.1.0

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 (80) hide show
  1. package/README.md +63 -3
  2. package/dist/chunk-24WRGUXG.js +168 -0
  3. package/dist/chunk-24WRGUXG.js.map +7 -0
  4. package/dist/chunk-364Y2XOJ.js +28 -0
  5. package/dist/chunk-364Y2XOJ.js.map +7 -0
  6. package/dist/chunk-4RGMMAR4.js +18 -0
  7. package/dist/chunk-4RGMMAR4.js.map +7 -0
  8. package/dist/chunk-5OVGH7HO.js +28 -0
  9. package/dist/chunk-5OVGH7HO.js.map +7 -0
  10. package/dist/chunk-6A6NIESE.js +9 -0
  11. package/dist/chunk-6A6NIESE.js.map +7 -0
  12. package/dist/chunk-EN3XGF2M.js +26 -0
  13. package/dist/chunk-EN3XGF2M.js.map +7 -0
  14. package/dist/chunk-ER3HU7OE.js +22 -0
  15. package/dist/chunk-ER3HU7OE.js.map +7 -0
  16. package/dist/chunk-FN3Y2AYJ.js +17 -0
  17. package/dist/chunk-FN3Y2AYJ.js.map +7 -0
  18. package/dist/chunk-H5WU2XYY.js +8 -0
  19. package/dist/chunk-H5WU2XYY.js.map +7 -0
  20. package/dist/chunk-HBUX7E54.js +234 -0
  21. package/dist/chunk-HBUX7E54.js.map +7 -0
  22. package/dist/chunk-IBQ4O4NO.js +13 -0
  23. package/dist/chunk-IBQ4O4NO.js.map +7 -0
  24. package/dist/chunk-J45KH7MF.js +180 -0
  25. package/dist/chunk-J45KH7MF.js.map +7 -0
  26. package/dist/chunk-JASEW37G.js +411 -0
  27. package/dist/chunk-JASEW37G.js.map +7 -0
  28. package/dist/chunk-MR7SU4GJ.js +59 -0
  29. package/dist/chunk-MR7SU4GJ.js.map +7 -0
  30. package/dist/chunk-MTF6JFSL.js +1093 -0
  31. package/dist/chunk-MTF6JFSL.js.map +7 -0
  32. package/dist/chunk-Q4AC2O6Z.js +13 -0
  33. package/dist/chunk-Q4AC2O6Z.js.map +7 -0
  34. package/dist/chunk-SZ33GAVH.js +2638 -0
  35. package/dist/chunk-SZ33GAVH.js.map +7 -0
  36. package/dist/chunk-T5NHW4KC.js +23 -0
  37. package/dist/chunk-T5NHW4KC.js.map +7 -0
  38. package/dist/chunk-T5QFSUYQ.js +8 -0
  39. package/dist/chunk-T5QFSUYQ.js.map +7 -0
  40. package/dist/chunk-TS7SL372.js +687 -0
  41. package/dist/chunk-TS7SL372.js.map +7 -0
  42. package/dist/chunk-Y4Z7K443.js +64 -0
  43. package/dist/chunk-Y4Z7K443.js.map +7 -0
  44. package/dist/chunk-ZMBN6APP.js +11 -0
  45. package/dist/chunk-ZMBN6APP.js.map +7 -0
  46. package/dist/chunk-ZTPYBVZL.js +181 -0
  47. package/dist/chunk-ZTPYBVZL.js.map +7 -0
  48. package/dist/fonts/source-code-pro-latin-400-normal.woff2 +0 -0
  49. package/dist/fonts/source-code-pro-latin-600-normal.woff2 +0 -0
  50. package/dist/slicc-dummy.js +1393 -0
  51. package/dist/slicc-dummy.js.map +7 -0
  52. package/dist/slicc-terminal.js +2 -27
  53. package/dist/slicc-terminal.js.map +4 -4
  54. package/dist/slicc-ui.js +22441 -0
  55. package/dist/slicc-ui.js.map +7 -0
  56. package/dist/types/app/agents.d.ts +11 -0
  57. package/dist/types/app/app.d.ts +40 -0
  58. package/dist/types/app/base.d.ts +27 -0
  59. package/dist/types/app/chat.d.ts +23 -0
  60. package/dist/types/app/fonts.d.ts +3 -0
  61. package/dist/types/app/markdown.d.ts +24 -0
  62. package/dist/types/app/panels.d.ts +31 -0
  63. package/dist/types/app/spectrum.d.ts +19 -0
  64. package/dist/types/components/dock.d.ts +24 -0
  65. package/dist/types/components/sheets.d.ts +1 -0
  66. package/dist/types/dummy/agent.d.ts +14 -0
  67. package/dist/types/dummy/browser.d.ts +15 -0
  68. package/dist/types/dummy/clock.d.ts +5 -0
  69. package/dist/types/dummy/files.d.ts +14 -0
  70. package/dist/types/dummy/fixtures.d.ts +11 -0
  71. package/dist/types/dummy/index.d.ts +6 -0
  72. package/dist/types/dummy/script.d.ts +23 -0
  73. package/dist/types/dummy/settings.d.ts +13 -0
  74. package/dist/types/dummy/shell.d.ts +16 -0
  75. package/dist/types/dummy/terminals.d.ts +15 -0
  76. package/dist/types/dummy.d.ts +2 -0
  77. package/dist/types/model/emitter.d.ts +9 -0
  78. package/dist/types/model/types.d.ts +183 -0
  79. package/dist/types/ui.d.ts +15 -0
  80. package/package.json +29 -11
@@ -0,0 +1,11 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import type { Agent, SliccModel } from '../model/types.js';
3
+ import { ModelElement } from './base.js';
4
+ export declare function ordered(agents: readonly Agent[]): Agent[];
5
+ export declare class SliccAgents extends ModelElement {
6
+ #private;
7
+ static styles: import("lit").CSSResult[];
8
+ protected subscribe(model: SliccModel): Array<() => void>;
9
+ focus(): void;
10
+ render(): TemplateResult;
11
+ }
@@ -0,0 +1,40 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import type { SliccDock } from '../components/dock.js';
3
+ import type { ColorScheme, SliccModel } from '../model/types.js';
4
+ import { ModelElement } from './base.js';
5
+ import { type ScreenClass } from './panels.js';
6
+ export type Color = 'light' | 'dark';
7
+ export declare function resolveColor(scheme: ColorScheme, prefersDark: boolean): Color;
8
+ export declare class SliccApp extends ModelElement {
9
+ #private;
10
+ static properties: {
11
+ model: {
12
+ attribute: boolean;
13
+ };
14
+ prefersDark: {
15
+ state: boolean;
16
+ };
17
+ screen: {
18
+ reflect: boolean;
19
+ };
20
+ };
21
+ prefersDark: boolean;
22
+ screen: ScreenClass;
23
+ storage: Storage | null;
24
+ layoutKey: string;
25
+ constructor();
26
+ static styles: import("lit").CSSResult[];
27
+ get color(): Color;
28
+ get dock(): SliccDock;
29
+ protected subscribe(model: SliccModel): Array<() => void>;
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
32
+ get fontBase(): string | null;
33
+ set fontBase(value: string | null);
34
+ protected updated(): void;
35
+ get storageKey(): string;
36
+ resetLayout(): void;
37
+ show(id: string): void;
38
+ toggleColor(): void;
39
+ render(): TemplateResult;
40
+ }
@@ -0,0 +1,27 @@
1
+ import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
2
+ import type { AgentStatus, SliccModel } from '../model/types.js';
3
+ export declare class ModelElement extends LitElement {
4
+ #private;
5
+ static properties: {
6
+ model: {
7
+ attribute: boolean;
8
+ };
9
+ };
10
+ static shadowRootOptions: ShadowRootInit;
11
+ model: SliccModel | null;
12
+ constructor();
13
+ protected subscribe(model: SliccModel): Array<() => void>;
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ protected willUpdate(changed: PropertyValues): void;
17
+ }
18
+ export declare const statusVariant: {
19
+ readonly idle: 'neutral';
20
+ readonly thinking: 'info';
21
+ readonly working: 'info';
22
+ readonly waiting: 'notice';
23
+ readonly error: 'negative';
24
+ };
25
+ export declare function percent(fill: number): string;
26
+ export declare function dot(status: AgentStatus): TemplateResult;
27
+ export declare const shared: import("lit").CSSResult;
@@ -0,0 +1,23 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import type { SliccModel } from '../model/types.js';
3
+ import { ModelElement } from './base.js';
4
+ export declare class SliccChat extends ModelElement {
5
+ #private;
6
+ static properties: {
7
+ model: {
8
+ attribute: boolean;
9
+ };
10
+ draft: {
11
+ state: boolean;
12
+ };
13
+ };
14
+ draft: string;
15
+ constructor();
16
+ static styles: import("lit").CSSResult[];
17
+ protected subscribe(model: SliccModel): Array<() => void>;
18
+ protected firstUpdated(): void;
19
+ focus(): void;
20
+ send(): void;
21
+ stop(): void;
22
+ render(): TemplateResult;
23
+ }
@@ -0,0 +1,3 @@
1
+ export declare const defaultFontBase = "/fonts/";
2
+ export declare function fontFaces(base: string | null, codeBase: string): string;
3
+ export declare function installFonts(document: Document, base: string | null, codeBase: string): HTMLStyleElement;
@@ -0,0 +1,24 @@
1
+ import { type TemplateResult } from 'lit';
2
+ type Block = {
3
+ type: 'code';
4
+ lang: string;
5
+ text: string;
6
+ } | {
7
+ type: 'heading';
8
+ level: number;
9
+ text: string;
10
+ } | {
11
+ type: 'list';
12
+ ordered: boolean;
13
+ items: string[];
14
+ } | {
15
+ type: 'table';
16
+ rows: string[][];
17
+ } | {
18
+ type: 'paragraph';
19
+ text: string;
20
+ };
21
+ export declare function inline(text: string): TemplateResult[];
22
+ export declare function parse(text: string): Block[];
23
+ export declare function markdown(text: string): TemplateResult;
24
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { SliccDock } from '../components/dock.js';
2
+ import type { SliccModel } from '../model/types.js';
3
+ export type Direction = 'left' | 'right' | 'above' | 'below' | 'within';
4
+ export type Side = 'left' | 'center' | 'right';
5
+ export type ScreenClass = 'phone' | 'tablet' | 'desktop';
6
+ export declare const screenClasses: readonly ScreenClass[];
7
+ export interface Placement {
8
+ position?: {
9
+ referencePanel: string;
10
+ direction: Direction;
11
+ };
12
+ initialWidth?: number;
13
+ initialHeight?: number;
14
+ }
15
+ export interface Surface {
16
+ id: string;
17
+ title: string;
18
+ tag: string;
19
+ icon: string;
20
+ side: Side;
21
+ open: readonly ScreenClass[];
22
+ width?: number;
23
+ }
24
+ export declare const surfaces: Surface[];
25
+ export declare function screenClass(width: number): ScreenClass;
26
+ export declare function surface(id: string): Surface | undefined;
27
+ export declare function create(tag: string, model: SliccModel): HTMLElement;
28
+ export declare function placement(dock: SliccDock, side: Side, screen: ScreenClass): Placement;
29
+ export declare function openSurface(dock: SliccDock, item: Surface, screen: ScreenClass): void;
30
+ export declare function defaultLayout(dock: SliccDock, screen: ScreenClass): void;
31
+ export declare function closed(dock: SliccDock): Surface[];
@@ -0,0 +1,19 @@
1
+ import '@spectrum-web-components/theme/sp-theme.js';
2
+ import '@spectrum-web-components/theme/spectrum-two/theme-light.js';
3
+ import '@spectrum-web-components/theme/spectrum-two/theme-dark.js';
4
+ import '@spectrum-web-components/theme/spectrum-two/scale-medium.js';
5
+ import '@spectrum-web-components/action-button/sp-action-button.js';
6
+ import '@spectrum-web-components/action-menu/sp-action-menu.js';
7
+ import '@spectrum-web-components/badge/sp-badge.js';
8
+ import '@spectrum-web-components/button/sp-button.js';
9
+ import '@spectrum-web-components/menu/sp-menu.js';
10
+ import '@spectrum-web-components/menu/sp-menu-divider.js';
11
+ import '@spectrum-web-components/menu/sp-menu-item.js';
12
+ import '@spectrum-web-components/picker/sp-picker.js';
13
+ import '@spectrum-web-components/progress-circle/sp-progress-circle.js';
14
+ import '@spectrum-web-components/textfield/sp-textfield.js';
15
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-chat.js';
16
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-contrast.js';
17
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-send.js';
18
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-user-group.js';
19
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-view-grid.js';
@@ -0,0 +1,24 @@
1
+ import { type AddPanelOptions, type DockviewApi, type DockviewTheme, type IDockviewPanel, type SerializedDockview } from 'dockview-core';
2
+ export type PanelParams = Record<string, unknown>;
3
+ export type PanelFactory = (params: PanelParams) => HTMLElement;
4
+ export type { AddPanelOptions, DockviewApi, IDockviewPanel, SerializedDockview };
5
+ export declare const theme: DockviewTheme;
6
+ export declare class SliccDock extends HTMLElement {
7
+ #private;
8
+ factories: Record<string, PanelFactory>;
9
+ get api(): DockviewApi;
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ has(id: string): boolean;
13
+ content(id: string): HTMLElement | undefined;
14
+ open(options: AddPanelOptions): IDockviewPanel;
15
+ close(id: string): void;
16
+ focusPanel(id: string): void;
17
+ cycleGroup(delta: number): string | null;
18
+ cycleTab(delta: number): string | null;
19
+ toJSON(): SerializedDockview;
20
+ restore(layout: SerializedDockview | null | undefined): boolean;
21
+ clear(): void;
22
+ dispose(): void;
23
+ }
24
+ export declare function defineDock(name?: string): void;
@@ -0,0 +1 @@
1
+ export declare function adoptStyles(root: ShadowRoot, ...texts: string[]): void;
@@ -0,0 +1,14 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { Agent, AgentEvents, AgentPort, Message } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ import { type Effects } from './script.js';
5
+ export declare class DummyAgent extends Emitter<AgentEvents> implements AgentPort {
6
+ #private;
7
+ constructor(agents: readonly Agent[], conversations: Record<string, readonly Message[]>, effects: Omit<Effects, 'agentId'>, clock: Clock);
8
+ list(): readonly Agent[];
9
+ active(): string;
10
+ select(id: string): void;
11
+ messages(agentId: string): readonly Message[];
12
+ send(agentId: string, text: string): Promise<void>;
13
+ stop(agentId: string): void;
14
+ }
@@ -0,0 +1,15 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { BrowserEvents, BrowserPort, BrowserTab } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export declare function page(tab: BrowserTab): string;
5
+ export declare class DummyBrowser extends Emitter<BrowserEvents> implements BrowserPort {
6
+ #private;
7
+ constructor(tabs: readonly BrowserTab[], clock: Clock);
8
+ list(): readonly BrowserTab[];
9
+ active(): string | null;
10
+ activate(id: string): void;
11
+ open(url: string, agentId?: string | null): BrowserTab;
12
+ navigate(id: string, url: string): void;
13
+ close(id: string): void;
14
+ screenshot(id: string): Promise<string>;
15
+ }
@@ -0,0 +1,5 @@
1
+ export interface Clock {
2
+ delay: number;
3
+ sleep(ticks?: number): Promise<void>;
4
+ }
5
+ export declare function clock(delay: number): Clock;
@@ -0,0 +1,14 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { Change, FileEntry, FileEvents, FilePort } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export declare class DummyFiles extends Emitter<FileEvents> implements FilePort {
5
+ #private;
6
+ constructor(contents: Record<string, string>, directories: readonly string[], changes: readonly Change[], clock: Clock);
7
+ list(): Promise<readonly FileEntry[]>;
8
+ read(path: string): Promise<string>;
9
+ write(path: string, text: string, agentId?: string | null): Promise<void>;
10
+ remove(path: string, agentId?: string | null): Promise<void>;
11
+ changes(): readonly Change[];
12
+ accept(path: string): void;
13
+ revert(path: string): Promise<void>;
14
+ }
@@ -0,0 +1,11 @@
1
+ import type { Account, Agent, BrowserTab, Change, Message, ModelOption, Settings, TerminalInfo } from '../model/types.js';
2
+ export declare const files: Record<string, string>;
3
+ export declare const directories: string[];
4
+ export declare const pending: Change[];
5
+ export declare const models: ModelOption[];
6
+ export declare const defaults: Settings;
7
+ export declare const accounts: Account[];
8
+ export declare const agents: Agent[];
9
+ export declare const conversations: Record<string, Message[]>;
10
+ export declare const tabs: BrowserTab[];
11
+ export declare const terminals: TerminalInfo[];
@@ -0,0 +1,6 @@
1
+ import type { SliccModel } from '../model/types.js';
2
+ export interface DummyOptions {
3
+ delay?: number;
4
+ storage?: Storage | null;
5
+ }
6
+ export declare function createDummyModel({ delay, storage }?: DummyOptions): SliccModel;
@@ -0,0 +1,23 @@
1
+ import type { BrowserPort, FilePort } from '../model/types.js';
2
+ export interface Effects {
3
+ files: FilePort;
4
+ browser: BrowserPort;
5
+ agentId: string;
6
+ }
7
+ export type Step = {
8
+ type: 'thinking';
9
+ text: string;
10
+ } | {
11
+ type: 'text';
12
+ text: string;
13
+ } | {
14
+ type: 'tool';
15
+ name: string;
16
+ title: string;
17
+ input: string;
18
+ output: string;
19
+ paths: string[];
20
+ ticks: number;
21
+ effect?: (effects: Effects) => Promise<unknown> | unknown;
22
+ };
23
+ export declare function script(prompt: string): Step[];
@@ -0,0 +1,13 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { Account, ModelOption, Settings, SettingsEvents, SettingsPort } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export declare class DummySettings extends Emitter<SettingsEvents> implements SettingsPort {
5
+ #private;
6
+ constructor(defaults: Settings, models: readonly ModelOption[], accounts: readonly Account[], storage: Storage | null, clock: Clock);
7
+ get(): Settings;
8
+ update(patch: Partial<Settings>): void;
9
+ models(): readonly ModelOption[];
10
+ accounts(): readonly Account[];
11
+ connect(id: string): Promise<void>;
12
+ disconnect(id: string): void;
13
+ }
@@ -0,0 +1,16 @@
1
+ import type { TerminalBackend, TerminalSession, TerminalSignal, TerminalSink } from '../backend.js';
2
+ import type { FilePort } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export declare function resolve(cwd: string, target: string): string;
5
+ export declare class FakeShell implements TerminalSession {
6
+ #private;
7
+ cwd: string;
8
+ closed: boolean;
9
+ constructor(sink: TerminalSink, files: FilePort, cwd: string, clock: Clock);
10
+ history(): readonly string[];
11
+ write(data: Uint8Array): void;
12
+ resize(): void;
13
+ signal(name: TerminalSignal): void;
14
+ close(): void;
15
+ }
16
+ export declare function shellBackend(files: FilePort, cwd: string, clock: Clock): TerminalBackend;
@@ -0,0 +1,15 @@
1
+ import type { TerminalBackend } from '../backend.js';
2
+ import { Emitter } from '../model/emitter.js';
3
+ import type { FilePort, TerminalEvents, TerminalInfo, TerminalPort } from '../model/types.js';
4
+ import type { Clock } from './clock.js';
5
+ export declare class DummyTerminals extends Emitter<TerminalEvents> implements TerminalPort {
6
+ #private;
7
+ constructor(terminals: readonly TerminalInfo[], files: FilePort, clock: Clock);
8
+ list(): readonly TerminalInfo[];
9
+ open({ cwd, agentId, }?: {
10
+ cwd?: string;
11
+ agentId?: string | null;
12
+ }): TerminalInfo;
13
+ close(id: string): void;
14
+ backend(id: string): TerminalBackend;
15
+ }
@@ -0,0 +1,2 @@
1
+ export type { DummyOptions } from './dummy/index.js';
2
+ export { createDummyModel } from './dummy/index.js';
@@ -0,0 +1,9 @@
1
+ export type Listener<T> = (detail: T) => void;
2
+ export interface Subscribable<Events extends object> {
3
+ on<K extends keyof Events>(type: K, listener: Listener<Events[K]>): () => void;
4
+ }
5
+ export declare class Emitter<Events extends object> implements Subscribable<Events> {
6
+ #private;
7
+ on<K extends keyof Events>(type: K, listener: Listener<Events[K]>): () => void;
8
+ emit<K extends keyof Events>(type: K, detail: Events[K]): void;
9
+ }
@@ -0,0 +1,183 @@
1
+ import type { TerminalBackend } from '../backend.js';
2
+ import type { Subscribable } from './emitter.js';
3
+ export type AgentKind = 'cone' | 'scoop';
4
+ export type AgentStatus = 'idle' | 'thinking' | 'working' | 'waiting' | 'error';
5
+ export interface Agent {
6
+ id: string;
7
+ name: string;
8
+ kind: AgentKind;
9
+ parentId: string | null;
10
+ status: AgentStatus;
11
+ model: string;
12
+ contextFill: number;
13
+ unread: number;
14
+ }
15
+ export type ToolStatus = 'running' | 'done' | 'error';
16
+ export interface ToolCall {
17
+ id: string;
18
+ name: string;
19
+ title: string;
20
+ input: string;
21
+ output: string;
22
+ status: ToolStatus;
23
+ paths: string[];
24
+ }
25
+ export type MessagePart = {
26
+ type: 'text';
27
+ text: string;
28
+ } | {
29
+ type: 'thinking';
30
+ text: string;
31
+ } | {
32
+ type: 'tool';
33
+ tool: ToolCall;
34
+ };
35
+ export interface UserMessage {
36
+ id: string;
37
+ role: 'user';
38
+ text: string;
39
+ createdAt: number;
40
+ }
41
+ export type AssistantStatus = 'streaming' | 'done' | 'stopped';
42
+ export interface AssistantMessage {
43
+ id: string;
44
+ role: 'assistant';
45
+ parts: MessagePart[];
46
+ status: AssistantStatus;
47
+ createdAt: number;
48
+ }
49
+ export type EventKind = 'webhook' | 'cron' | 'scoop' | 'compaction' | 'error';
50
+ export interface EventMessage {
51
+ id: string;
52
+ role: 'event';
53
+ kind: EventKind;
54
+ title: string;
55
+ text: string;
56
+ createdAt: number;
57
+ }
58
+ export type Message = UserMessage | AssistantMessage | EventMessage;
59
+ export interface AgentEvents {
60
+ agents: readonly Agent[];
61
+ active: string;
62
+ message: {
63
+ agentId: string;
64
+ message: Message;
65
+ };
66
+ }
67
+ export interface AgentPort extends Subscribable<AgentEvents> {
68
+ list(): readonly Agent[];
69
+ active(): string;
70
+ select(id: string): void;
71
+ messages(agentId: string): readonly Message[];
72
+ send(agentId: string, text: string): Promise<void>;
73
+ stop(agentId: string): void;
74
+ }
75
+ export type FileKind = 'file' | 'directory';
76
+ export interface FileEntry {
77
+ path: string;
78
+ kind: FileKind;
79
+ size: number;
80
+ modified: number;
81
+ }
82
+ export type ChangeStatus = 'added' | 'modified' | 'deleted';
83
+ export interface Change {
84
+ path: string;
85
+ status: ChangeStatus;
86
+ before: string | null;
87
+ after: string | null;
88
+ agentId: string | null;
89
+ }
90
+ export interface FileEvents {
91
+ files: readonly FileEntry[];
92
+ file: string;
93
+ changes: readonly Change[];
94
+ }
95
+ export interface FilePort extends Subscribable<FileEvents> {
96
+ list(): Promise<readonly FileEntry[]>;
97
+ read(path: string): Promise<string>;
98
+ write(path: string, text: string, agentId?: string | null): Promise<void>;
99
+ remove(path: string, agentId?: string | null): Promise<void>;
100
+ changes(): readonly Change[];
101
+ accept(path: string): void;
102
+ revert(path: string): Promise<void>;
103
+ }
104
+ export interface TerminalInfo {
105
+ id: string;
106
+ title: string;
107
+ cwd: string;
108
+ agentId: string | null;
109
+ }
110
+ export interface TerminalEvents {
111
+ terminals: readonly TerminalInfo[];
112
+ }
113
+ export interface TerminalPort extends Subscribable<TerminalEvents> {
114
+ list(): readonly TerminalInfo[];
115
+ open(options?: {
116
+ cwd?: string;
117
+ agentId?: string | null;
118
+ }): TerminalInfo;
119
+ close(id: string): void;
120
+ backend(id: string): TerminalBackend;
121
+ }
122
+ export type TabStatus = 'loading' | 'complete';
123
+ export interface BrowserTab {
124
+ id: string;
125
+ title: string;
126
+ url: string;
127
+ status: TabStatus;
128
+ agentId: string | null;
129
+ }
130
+ export interface BrowserEvents {
131
+ tabs: readonly BrowserTab[];
132
+ active: string | null;
133
+ }
134
+ export interface BrowserPort extends Subscribable<BrowserEvents> {
135
+ list(): readonly BrowserTab[];
136
+ active(): string | null;
137
+ activate(id: string): void;
138
+ open(url: string, agentId?: string | null): BrowserTab;
139
+ navigate(id: string, url: string): void;
140
+ close(id: string): void;
141
+ screenshot(id: string): Promise<string>;
142
+ }
143
+ export type ColorScheme = 'light' | 'dark' | 'system';
144
+ export type Thinking = 'off' | 'low' | 'medium' | 'high';
145
+ export interface Settings {
146
+ color: ColorScheme;
147
+ model: string;
148
+ thinking: Thinking;
149
+ sendOnEnter: boolean;
150
+ showThinking: boolean;
151
+ diffStyle: 'unified' | 'split';
152
+ }
153
+ export type AccountStatus = 'connected' | 'expired' | 'disconnected';
154
+ export interface Account {
155
+ id: string;
156
+ provider: string;
157
+ identity: string;
158
+ status: AccountStatus;
159
+ }
160
+ export interface ModelOption {
161
+ id: string;
162
+ label: string;
163
+ provider: string;
164
+ }
165
+ export interface SettingsEvents {
166
+ settings: Settings;
167
+ accounts: readonly Account[];
168
+ }
169
+ export interface SettingsPort extends Subscribable<SettingsEvents> {
170
+ get(): Settings;
171
+ update(patch: Partial<Settings>): void;
172
+ models(): readonly ModelOption[];
173
+ accounts(): readonly Account[];
174
+ connect(id: string): Promise<void>;
175
+ disconnect(id: string): void;
176
+ }
177
+ export interface SliccModel {
178
+ agent: AgentPort;
179
+ files: FilePort;
180
+ terminals: TerminalPort;
181
+ browser: BrowserPort;
182
+ settings: SettingsPort;
183
+ }
@@ -0,0 +1,15 @@
1
+ import './app/spectrum.ts';
2
+ import { SliccAgents } from './app/agents.js';
3
+ import { SliccApp } from './app/app.js';
4
+ import { SliccChat } from './app/chat.js';
5
+ import { SliccDock } from './components/dock.js';
6
+ export type { Color } from './app/app.js';
7
+ export { resolveColor } from './app/app.js';
8
+ export type { Placement, Surface } from './app/panels.js';
9
+ export { surfaces } from './app/panels.js';
10
+ export type { PanelFactory, PanelParams } from './components/dock.js';
11
+ export type { Listener, Subscribable } from './model/emitter.js';
12
+ export { Emitter } from './model/emitter.js';
13
+ export type * from './model/types.js';
14
+ export { SliccAgents, SliccApp, SliccChat, SliccDock };
15
+ export declare function define(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-spectrum",
3
- "version": "1.0.0",
4
- "description": "A terminal web component for SLICC, built on wterm, that talks to slicc-kernel",
3
+ "version": "1.1.0",
4
+ "description": "Web components for SLICC on Spectrum Web Components: the terminal, the app shell and its surfaces",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -25,6 +25,14 @@
25
25
  ".": {
26
26
  "types": "./dist/types/index.d.ts",
27
27
  "default": "./dist/slicc-terminal.js"
28
+ },
29
+ "./ui": {
30
+ "types": "./dist/types/ui.d.ts",
31
+ "default": "./dist/slicc-ui.js"
32
+ },
33
+ "./dummy": {
34
+ "types": "./dist/types/dummy.d.ts",
35
+ "default": "./dist/slicc-dummy.js"
28
36
  }
29
37
  },
30
38
  "files": [
@@ -37,29 +45,39 @@
37
45
  "trust": "npx fledgling sync -y --skip-publish",
38
46
  "trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
39
47
  "release": "semantic-release",
40
- "start": "npm run build && node test/integration/server.mjs",
48
+ "start": "npm run build && node test/integration/chrome.mjs",
41
49
  "pretest": "npm run build && playwright-core install --no-shell chromium",
42
- "test": "node --test --test-global-setup=test/integration/global.mjs 'test/integration/*.test.mjs'",
43
- "test:unit": "NODE_NO_WARNINGS=1 mcr -c mcr.config.mjs node --test 'test/unit/**/*.test.mjs'",
44
- "coverage:staged": "npm run --silent test:unit && uvx diff-cover@10.6.0 coverage/unit/lcov.info --compare-branch HEAD --ignore-unstaged --fail-under 100",
50
+ "test": "node --test --test-global-setup=node_modules/@ai-ecoverse/slicc-shared-web/harness/global.mjs 'test/integration/*.test.mjs'",
51
+ "test:unit": "NODE_NO_WARNINGS=1 mcr -c node_modules/@ai-ecoverse/slicc-shared-web/mcr.config.mjs node --test 'test/unit/**/*.test.mjs'",
45
52
  "typecheck": "tsc",
46
- "lint": "biome check . && npm run typecheck && npm run lint:comments && npm run lint:no-unit-tests",
47
- "lint:comments": "d=node_modules/.cache/no-comment-9cc7617; [ -f $d/check.mjs ] || { mkdir -p $d && for f in lib comments marker check; do curl -fsSL -o $d/$f.mjs https://raw.githubusercontent.com/ai-ecoverse/slicc/9cc7617c94c24b84c4d6fd8edf92441378257d07/packages/dev-tools/no-comment/$f.mjs || exit 1; done; } && node $d/check.mjs --force",
48
- "lint:no-unit-tests": "! git ls-files --cached --others --exclude-standard | grep -E '(^|/)(tests?|__tests__)/|\\.(test|spec)\\.' | grep -vE '^test/integration/'",
53
+ "lint": "slicc-lint",
49
54
  "format": "biome check --write ."
50
55
  },
51
56
  "devDependencies": {
52
- "@ai-ecoverse/slicc-kernel": "1.1.0",
57
+ "@ai-ecoverse/slicc-kernel": "1.7.2",
58
+ "@ai-ecoverse/slicc-shared-web": "1.4.1",
53
59
  "@ai-ecoverse/wasm-bash": "5.3.0-7",
54
60
  "@ai-ecoverse/wasm-coreutils": "9.7.0-3",
55
61
  "@biomejs/biome": "2.5.15",
62
+ "@fontsource/source-code-pro": "5.3.0",
56
63
  "@happy-dom/global-registrator": "20.14.5",
64
+ "@spectrum-web-components/action-button": "1.12.4",
65
+ "@spectrum-web-components/action-menu": "1.12.4",
66
+ "@spectrum-web-components/badge": "1.12.4",
67
+ "@spectrum-web-components/button": "1.12.4",
68
+ "@spectrum-web-components/icons-workflow": "1.12.4",
69
+ "@spectrum-web-components/menu": "1.12.4",
70
+ "@spectrum-web-components/picker": "1.12.4",
71
+ "@spectrum-web-components/progress-circle": "1.12.4",
72
+ "@spectrum-web-components/textfield": "1.12.4",
73
+ "@spectrum-web-components/theme": "1.12.4",
57
74
  "@types/node": "26.6.4",
58
75
  "@wterm/core": "0.5.4",
59
76
  "@wterm/dom": "0.5.4",
77
+ "dockview-core": "8.4.0",
60
78
  "esbuild": "0.28.2",
61
79
  "happy-dom": "20.14.5",
62
- "lefthook": "2.1.16",
80
+ "lefthook": "2.1.17",
63
81
  "monocart-coverage-reports": "2.13.0",
64
82
  "playwright-core": "1.63.0",
65
83
  "semantic-release": "25.0.9",