@ai-ecoverse/slicc-spectrum 1.44.0 → 1.46.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.
@@ -1,14 +1,37 @@
1
+ import '@adobe/spectrum-wc/components/action-button/swc-action-button.js';
1
2
  import '@adobe/spectrum-wc/components/badge/swc-badge.js';
2
3
  import '@adobe/spectrum-wc/components/button/swc-button.js';
3
4
  import '@adobe/spectrum-wc/components/close-button/swc-close-button.js';
5
+ import '@adobe/spectrum-wc/components/illustrated-message/swc-illustrated-message.js';
4
6
  import '@adobe/spectrum-wc/components/progress-circle/swc-progress-circle.js';
5
7
  import '@adobe/spectrum-wc/components/status-light/swc-status-light.js';
8
+ import '@adobe/spectrum-wc-icons/swc-icon-alert-triangle.js';
9
+ import '@adobe/spectrum-wc-icons/swc-icon-camera.js';
10
+ import '@adobe/spectrum-wc-icons/swc-icon-chevron-down.js';
11
+ import '@adobe/spectrum-wc-icons/swc-icon-chevron-left.js';
12
+ import '@adobe/spectrum-wc-icons/swc-icon-close.js';
13
+ import '@adobe/spectrum-wc-icons/swc-icon-code.js';
14
+ import '@adobe/spectrum-wc-icons/swc-icon-copy.js';
15
+ import '@adobe/spectrum-wc-icons/swc-icon-cursor-click.js';
16
+ import '@adobe/spectrum-wc-icons/swc-icon-globe-grid.js';
17
+ import '@adobe/spectrum-wc-icons/swc-icon-keyboard.js';
18
+ import '@adobe/spectrum-wc-icons/swc-icon-link.js';
19
+ import '@adobe/spectrum-wc-icons/swc-icon-open-in.js';
20
+ import '@adobe/spectrum-wc-icons/swc-icon-refresh.js';
21
+ import '@adobe/spectrum-wc-icons/swc-icon-text.js';
22
+ import '@adobe/spectrum-wc-icons/swc-icon-undo.js';
23
+ import '@adobe/spectrum-wc-icons/swc-icon-visibility.js';
24
+ import '@adobe/spectrum-wc-icons/swc-icon-web-page.js';
6
25
  import { type TemplateResult } from 'lit';
7
- import type { SliccModel } from '../model/types.js';
26
+ import type { BrowserAction, SliccModel } from '../model/types.js';
8
27
  import { ModelElement } from './base.js';
9
28
  export declare function normalize(input: string): string;
10
29
  export declare function host(url: string): string;
30
+ export declare function place(url: string): string;
31
+ export declare function since(at: number, now?: number): string;
32
+ export declare function describe(action: BrowserAction): string;
11
33
  export declare const refresh = 10000;
34
+ export declare const fresh = 3000;
12
35
  export declare class SliccBrowser extends ModelElement {
13
36
  #private;
14
37
  static properties: {
@@ -21,8 +44,9 @@ export declare class SliccBrowser extends ModelElement {
21
44
  };
22
45
  address: string;
23
46
  constructor();
24
- static styles: import("lit").CSSResult;
47
+ static styles: import("lit").CSSResult[];
25
48
  protected subscribe(model: SliccModel): Array<() => void>;
26
49
  focus(): void;
50
+ protected updated(): void;
27
51
  render(): TemplateResult;
28
52
  }
@@ -10,7 +10,7 @@ import '@adobe/spectrum-wc-icons/swc-icon-copy.js';
10
10
  import { type TemplateResult } from 'lit';
11
11
  import type { BrowserAutomation, NetworkRoute, NetworkStatus, SliccModel, TailnetState, TailnetStatus } from '../model/types.js';
12
12
  import { ModelElement } from './base.js';
13
- export declare const command = "npx @ai-ecoverse/slicc-node";
13
+ export { command } from './reach.js';
14
14
  export declare const networkHealth: Record<NetworkStatus['health'], readonly ['positive' | 'notice' | 'negative', string]>;
15
15
  export declare const automation: Record<NonNullable<BrowserAutomation['via']> | 'none', string>;
16
16
  export declare function automationOf(browser: BrowserAutomation): keyof typeof automation;
@@ -0,0 +1,15 @@
1
+ import '@adobe/spectrum-wc/components/action-button/swc-action-button.js';
2
+ import '@adobe/spectrum-wc-icons/swc-icon-alert-triangle.js';
3
+ import '@adobe/spectrum-wc-icons/swc-icon-copy.js';
4
+ import { type TemplateResult } from 'lit';
5
+ export declare const command = "npx @ai-ecoverse/slicc-node";
6
+ export declare const reachStyles: import("lit").CSSResult;
7
+ export interface Reach {
8
+ intro: string;
9
+ extensionUrl?: string;
10
+ copied: boolean;
11
+ uncopied: boolean;
12
+ copy: () => void;
13
+ }
14
+ export declare function reach({ intro, extensionUrl, copied, uncopied, copy }: Reach): TemplateResult;
15
+ export declare function copyText(text: string): Promise<boolean>;
@@ -0,0 +1,17 @@
1
+ import type { TabSkew, TabsState } from '../model/types.js';
2
+ export interface TabsLight {
3
+ variant: 'neutral' | 'info' | 'notice';
4
+ text: string;
5
+ tooltip: string;
6
+ }
7
+ export interface TabsBanner {
8
+ kind: 'skew' | 'stalled';
9
+ skew: TabSkew | null;
10
+ text: string;
11
+ reload: boolean;
12
+ }
13
+ export declare const following = "SLICC runs in another tab. This tab shows it and sends your actions there.";
14
+ export declare const connecting = "Connecting to the tab running SLICC\u2026";
15
+ export declare const alone = "SLICC is open in another tab.";
16
+ export declare function tabsBanner(state: TabsState | undefined): TabsBanner | null;
17
+ export declare function tabsLight(state: TabsState | undefined): TabsLight | null;
@@ -1,12 +1,25 @@
1
1
  import { Emitter } from '../model/emitter.js';
2
- import type { BrowserEvents, BrowserPort, BrowserTab } from '../model/types.js';
2
+ import type { BrowserAction, BrowserEvents, BrowserPort, BrowserTab } from '../model/types.js';
3
3
  import type { Clock } from './clock.js';
4
- export declare function page(tab: BrowserTab): string;
4
+ export type BrowserScenario = 'idle' | 'driving' | 'off';
5
+ export type ActionDraft = Omit<BrowserAction, 'id' | 'at' | 'status'> & Partial<Pick<BrowserAction, 'status' | 'at'>>;
6
+ export declare function page(tab: BrowserTab, mark?: number): string;
7
+ export declare function browserHistory(scenario: BrowserScenario, now?: number): ActionDraft[];
8
+ export declare const drive: readonly ActionDraft[];
5
9
  export declare class DummyBrowser extends Emitter<BrowserEvents> implements BrowserPort {
6
10
  #private;
7
- constructor(tabs: readonly BrowserTab[], clock: Clock);
11
+ constructor(tabs: readonly BrowserTab[], clock: Clock, { history, controlled, }?: {
12
+ history?: readonly ActionDraft[];
13
+ controlled?: readonly string[];
14
+ });
8
15
  list(): readonly BrowserTab[];
9
16
  active(): string | null;
17
+ actions(tabId?: string): readonly BrowserAction[];
18
+ record(draft: ActionDraft): string;
19
+ finish(id: string, error?: string): void;
20
+ run(script: readonly ActionDraft[]): Promise<void>;
21
+ release(agentId: string): void;
22
+ watch(tabId: string): () => void;
10
23
  activate(id: string): void;
11
24
  open(url: string, agentId?: string | null): BrowserTab;
12
25
  navigate(id: string, url: string): void;
@@ -1,8 +1,10 @@
1
1
  import type { SliccModel } from '../model/types.js';
2
+ import { type BrowserScenario, DummyBrowser } from './browser.js';
2
3
  import { type ChangesScenario } from './changes.js';
3
4
  import { type MountScenario } from './files.js';
4
5
  import { DummyNetwork, type NetworkScenario, type TailnetScenario } from './network.js';
5
6
  import { DummyNotices, type NoticeScenario } from './notices.js';
7
+ import { DummyTabs, type TabsScenario } from './tabs.js';
6
8
  import { DummyUpdates, type PackageConfirm, type PackageScenario, type UpdateScenario } from './updates.js';
7
9
  export interface DummyOptions {
8
10
  delay?: number;
@@ -15,10 +17,14 @@ export interface DummyOptions {
15
17
  tailnet?: TailnetScenario;
16
18
  changes?: ChangesScenario;
17
19
  notices?: NoticeScenario | 'off';
20
+ tabs?: TabsScenario | 'off';
21
+ browser?: BrowserScenario;
18
22
  }
19
23
  export interface DummyModel extends SliccModel {
24
+ browser: DummyBrowser;
20
25
  updates: DummyUpdates;
21
26
  network?: DummyNetwork;
22
27
  notices?: DummyNotices;
28
+ tabs?: DummyTabs;
23
29
  }
24
- export declare function createDummyModel({ delay, storage, updates, packages, confirm, mounts, network, tailnet, changes, notices, }?: DummyOptions): DummyModel;
30
+ export declare function createDummyModel({ delay, storage, updates, packages, confirm, mounts, network, tailnet, changes, notices, tabs, browser: scenario, }?: DummyOptions): DummyModel;
@@ -0,0 +1,15 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { TabsPort, TabsState } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export type TabsScenario = 'owner' | 'follower' | 'connecting' | 'stalled' | 'newer' | 'older' | 'alone';
5
+ export declare function tabsFixtures(scenario: TabsScenario): TabsState;
6
+ export declare class DummyTabs extends Emitter<{
7
+ tabs: TabsState;
8
+ }> implements TabsPort {
9
+ #private;
10
+ reloads: number;
11
+ constructor(scenario: TabsScenario, time: Clock);
12
+ state(): TabsState;
13
+ setScenario(scenario: TabsScenario): void;
14
+ reload(): void;
15
+ }
@@ -1,3 +1,5 @@
1
+ export type { ActionDraft, BrowserScenario } from './dummy/browser.js';
2
+ export { browserHistory, DummyBrowser, page } from './dummy/browser.js';
1
3
  export type { ChangesScenario } from './dummy/changes.js';
2
4
  export { DummyChanges } from './dummy/changes.js';
3
5
  export type { DummyMount, MountScenario } from './dummy/files.js';
@@ -7,5 +9,7 @@ export type { NetworkScenario, TailnetScenario } from './dummy/network.js';
7
9
  export { DummyNetwork, networkFixtures, tailnetFixtures } from './dummy/network.js';
8
10
  export type { NoticeScenario } from './dummy/notices.js';
9
11
  export { DummyNotices, noticeFixtures } from './dummy/notices.js';
12
+ export type { TabsScenario } from './dummy/tabs.js';
13
+ export { DummyTabs, tabsFixtures } from './dummy/tabs.js';
10
14
  export type { DummyUpdatesOptions, PackageConfirm, PackageScenario, UpdateScenario, } from './dummy/updates.js';
11
15
  export { DummyUpdates, packageFixtures, updateFixtures } from './dummy/updates.js';
@@ -337,10 +337,32 @@ export interface BrowserTab {
337
337
  url: string;
338
338
  status: TabStatus;
339
339
  agentId: string | null;
340
+ controlled?: boolean;
341
+ favicon?: string;
342
+ }
343
+ export type BrowserActionKind = 'open' | 'goto' | 'back' | 'reload' | 'close' | 'select' | 'snapshot' | 'screenshot' | 'eval' | 'click' | 'fill' | 'type' | 'press' | 'scroll' | 'request';
344
+ export interface BrowserAction {
345
+ id: string;
346
+ tabId: string | null;
347
+ agentId: string | null;
348
+ kind: BrowserActionKind;
349
+ target?: string;
350
+ value?: string;
351
+ length?: number;
352
+ status: 'running' | 'done' | 'failed';
353
+ error?: string;
354
+ at: number;
355
+ }
356
+ export interface BrowserFrame {
357
+ tabId: string;
358
+ src: string;
359
+ at: number;
340
360
  }
341
361
  export interface BrowserEvents {
342
362
  tabs: readonly BrowserTab[];
343
363
  active: string | null;
364
+ action?: BrowserAction;
365
+ frame?: BrowserFrame;
344
366
  }
345
367
  export interface BrowserPort extends Subscribable<BrowserEvents> {
346
368
  list(): readonly BrowserTab[];
@@ -350,6 +372,11 @@ export interface BrowserPort extends Subscribable<BrowserEvents> {
350
372
  navigate(id: string, url: string): void;
351
373
  close(id: string): void;
352
374
  screenshot(id: string): Promise<string>;
375
+ actions?(tabId?: string): readonly BrowserAction[];
376
+ watch?(tabId: string, size?: {
377
+ width: number;
378
+ height: number;
379
+ }): () => void;
353
380
  }
354
381
  export type ColorScheme = 'light' | 'dark' | 'system';
355
382
  export type Thinking = 'off' | 'low' | 'medium' | 'high';
@@ -632,6 +659,19 @@ export interface NoticesPort extends Subscribable<{
632
659
  act(id: string, action: string): Promise<void>;
633
660
  dismiss(id: string): void;
634
661
  }
662
+ export type TabRole = 'owner' | 'follower' | 'connecting' | 'alone';
663
+ export type TabSkew = 'newer' | 'older';
664
+ export interface TabsState {
665
+ role: TabRole;
666
+ stalled: boolean;
667
+ skew: TabSkew | null;
668
+ }
669
+ export interface TabsPort extends Subscribable<{
670
+ tabs: TabsState;
671
+ }> {
672
+ state(): TabsState;
673
+ reload(): void;
674
+ }
635
675
  export interface SliccModel {
636
676
  agent: AgentPort;
637
677
  files: FilePort;
@@ -646,4 +686,5 @@ export interface SliccModel {
646
686
  network?: NetworkPort;
647
687
  changes?: ChangesPort;
648
688
  notices?: NoticesPort;
689
+ tabs?: TabsPort;
649
690
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-spectrum",
3
- "version": "1.44.0",
3
+ "version": "1.46.0",
4
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",
@@ -72,9 +72,9 @@
72
72
  "devDependencies": {
73
73
  "@adobe/spectrum-wc": "2.0.0-beta.4",
74
74
  "@adobe/spectrum-wc-icons": "2.0.0-beta.4",
75
- "@ai-ecoverse/slicc-kernel": "1.39.0",
76
- "@ai-ecoverse/slicc-shared-web": "1.11.0",
77
- "@ai-ecoverse/wasm-bash": "5.3.0-9",
75
+ "@ai-ecoverse/slicc-kernel": "1.41.0",
76
+ "@ai-ecoverse/slicc-shared-web": "1.12.0",
77
+ "@ai-ecoverse/wasm-bash": "5.3.0-10",
78
78
  "@ai-ecoverse/wasm-coreutils": "9.7.0-3",
79
79
  "@biomejs/biome": "2.5.15",
80
80
  "@fontsource/source-code-pro": "5.3.0",