@ai-ecoverse/slicc-spectrum 1.37.0 → 1.38.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.
@@ -8,12 +8,15 @@ import '@adobe/spectrum-wc-icons/swc-icon-cloud-state-online.js';
8
8
  import '@adobe/spectrum-wc-icons/swc-icon-cloud-state-slow-connection.js';
9
9
  import '@adobe/spectrum-wc-icons/swc-icon-copy.js';
10
10
  import { type TemplateResult } from 'lit';
11
- import type { BrowserAutomation, NetworkStatus, SliccModel } from '../model/types.js';
11
+ import type { BrowserAutomation, NetworkStatus, SliccModel, TailnetState, TailnetStatus } from '../model/types.js';
12
12
  import { ModelElement } from './base.js';
13
13
  export declare const command = "npx @ai-ecoverse/slicc-node";
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' | 'declined', string>;
16
16
  export declare function automationOf(browser: BrowserAutomation): keyof typeof automation;
17
+ export declare const tailnetStates: Record<TailnetState, readonly ['neutral' | 'info' | 'positive' | 'notice' | 'negative', string]>;
18
+ export declare function tailnetAddress(addresses: readonly string[]): string | undefined;
19
+ export declare function exitNodeValue(tailnet: TailnetStatus): string;
17
20
  export declare function networkLabel(status: NetworkStatus): string;
18
21
  export declare const networkIcon: Record<NetworkStatus['health'], TemplateResult>;
19
22
  export declare function host(url: string): string;
@@ -36,11 +39,23 @@ export declare class SliccNetwork extends ModelElement {
36
39
  error: {
37
40
  state: boolean;
38
41
  };
42
+ busy: {
43
+ state: boolean;
44
+ };
45
+ tailnetError: {
46
+ state: boolean;
47
+ };
48
+ tailnetCopied: {
49
+ state: boolean;
50
+ };
39
51
  };
40
52
  checking: boolean;
41
53
  copied: boolean;
42
54
  uncopied: boolean;
43
55
  error: string;
56
+ busy: string;
57
+ tailnetError: string;
58
+ tailnetCopied: string;
44
59
  constructor();
45
60
  static styles: import("lit").CSSResult[];
46
61
  protected subscribe(model: SliccModel): Array<() => void>;
@@ -1,7 +1,7 @@
1
1
  import type { SliccModel } from '../model/types.js';
2
2
  import { type ChangesScenario } from './changes.js';
3
3
  import { type MountScenario } from './files.js';
4
- import { DummyNetwork, type NetworkScenario } from './network.js';
4
+ import { DummyNetwork, type NetworkScenario, type TailnetScenario } from './network.js';
5
5
  import { DummyUpdates, type UpdateScenario } from './updates.js';
6
6
  export interface DummyOptions {
7
7
  delay?: number;
@@ -9,10 +9,11 @@ export interface DummyOptions {
9
9
  updates?: UpdateScenario;
10
10
  mounts?: MountScenario | 'off';
11
11
  network?: NetworkScenario | 'off';
12
+ tailnet?: TailnetScenario;
12
13
  changes?: ChangesScenario;
13
14
  }
14
15
  export interface DummyModel extends SliccModel {
15
16
  updates: DummyUpdates;
16
17
  network?: DummyNetwork;
17
18
  }
18
- export declare function createDummyModel({ delay, storage, updates, mounts, network, changes, }?: DummyOptions): DummyModel;
19
+ export declare function createDummyModel({ delay, storage, updates, mounts, network, tailnet, changes, }?: DummyOptions): DummyModel;
@@ -1,15 +1,21 @@
1
1
  import { Emitter } from '../model/emitter.js';
2
- import type { NetworkPort, NetworkStatus } from '../model/types.js';
2
+ import type { NetworkPort, NetworkStatus, TailnetStatus } from '../model/types.js';
3
3
  import type { Clock } from './clock.js';
4
4
  export type NetworkScenario = 'ok' | 'limited' | 'failing';
5
+ export type TailnetScenario = 'off' | 'needs-login' | 'running' | 'failed';
5
6
  export declare function networkFixtures(scenario: NetworkScenario, now?: number): NetworkStatus;
7
+ export declare function tailnetFixtures(scenario: TailnetScenario): TailnetStatus;
6
8
  export declare class DummyNetwork extends Emitter<{
7
9
  network: NetworkStatus;
8
10
  }> implements NetworkPort {
9
11
  #private;
10
12
  scenario: NetworkScenario;
11
- constructor(scenario: NetworkScenario, clock: Clock);
13
+ constructor(scenario: NetworkScenario, clock: Clock, tailnet?: TailnetScenario);
12
14
  status(): NetworkStatus;
13
15
  setScenario(scenario: NetworkScenario): void;
14
16
  check(): Promise<void>;
17
+ setTailnet(on: boolean): Promise<void>;
18
+ submitAuthKey(key: string): Promise<void>;
19
+ setExitNode(id: string | null): Promise<void>;
20
+ logoutTailnet(): Promise<void>;
15
21
  }
@@ -3,7 +3,7 @@ export { DummyChanges } from './dummy/changes.js';
3
3
  export type { DummyMount, MountScenario } from './dummy/files.js';
4
4
  export type { DummyModel, DummyOptions } from './dummy/index.js';
5
5
  export { createDummyModel } from './dummy/index.js';
6
- export type { NetworkScenario } from './dummy/network.js';
7
- export { DummyNetwork, networkFixtures } from './dummy/network.js';
6
+ export type { NetworkScenario, TailnetScenario } from './dummy/network.js';
7
+ export { DummyNetwork, networkFixtures, tailnetFixtures } from './dummy/network.js';
8
8
  export type { UpdateScenario } from './dummy/updates.js';
9
9
  export { DummyUpdates, updateFixtures } from './dummy/updates.js';
@@ -550,12 +550,37 @@ export interface NetworkStatus {
550
550
  failures: readonly NetworkFailure[];
551
551
  extensionUrl?: string;
552
552
  browser?: BrowserAutomation;
553
+ tailnet?: TailnetStatus;
554
+ }
555
+ export type TailnetState = 'off' | 'loading' | 'needs-login' | 'starting' | 'running' | 'failed';
556
+ export interface TailnetExitNode {
557
+ id: string;
558
+ name: string;
559
+ online: boolean;
560
+ }
561
+ export interface TailnetStatus {
562
+ state: TailnetState;
563
+ detail?: string;
564
+ loginUrl?: string;
565
+ node?: {
566
+ name: string;
567
+ addresses: readonly string[];
568
+ };
569
+ exitNode?: string | null;
570
+ exitNodes?: readonly TailnetExitNode[];
571
+ autoExitNode?: boolean;
572
+ shieldsUp?: boolean;
573
+ peers?: number;
553
574
  }
554
575
  export interface NetworkPort extends Subscribable<{
555
576
  network: NetworkStatus;
556
577
  }> {
557
578
  status(): NetworkStatus;
558
579
  check?(): Promise<void>;
580
+ setTailnet?(on: boolean): Promise<void>;
581
+ setExitNode?(id: string | 'auto' | null): Promise<void>;
582
+ submitAuthKey?(key: string): Promise<void>;
583
+ logoutTailnet?(): Promise<void>;
559
584
  }
560
585
  export interface SliccModel {
561
586
  agent: AgentPort;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-spectrum",
3
- "version": "1.37.0",
3
+ "version": "1.38.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",
@@ -73,7 +73,7 @@
73
73
  "@adobe/spectrum-wc": "2.0.0-beta.4",
74
74
  "@adobe/spectrum-wc-icons": "2.0.0-beta.4",
75
75
  "@ai-ecoverse/slicc-kernel": "1.26.1",
76
- "@ai-ecoverse/slicc-shared-web": "1.10.0",
76
+ "@ai-ecoverse/slicc-shared-web": "1.10.1",
77
77
  "@ai-ecoverse/wasm-bash": "5.3.0-8",
78
78
  "@ai-ecoverse/wasm-coreutils": "9.7.0-3",
79
79
  "@biomejs/biome": "2.5.15",