@ai-ecoverse/slicc-spectrum 1.13.0 → 1.14.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.
@@ -0,0 +1,31 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import type { SliccModel, UpdateAction, UpdateItem, UpdatesPort } from '../model/types.js';
3
+ import { ModelElement } from './base.js';
4
+ export declare function updatesStatus(items: readonly UpdateItem[]): string | null;
5
+ export declare class UpdateVisibility {
6
+ #private;
7
+ constructor(ready: boolean);
8
+ change(port: UpdatesPort, layout?: boolean): 'open' | 'close' | null;
9
+ }
10
+ export declare class SliccUpdates extends ModelElement {
11
+ #private;
12
+ static properties: {
13
+ model: {
14
+ attribute: boolean;
15
+ };
16
+ pending: {
17
+ state: boolean;
18
+ };
19
+ failures: {
20
+ state: boolean;
21
+ };
22
+ };
23
+ pending: ReadonlySet<string>;
24
+ failures: ReadonlyMap<string, string>;
25
+ constructor();
26
+ static styles: import("lit").CSSResult[];
27
+ protected subscribe(model: SliccModel): Array<() => void>;
28
+ focus(): void;
29
+ act(id: string, action: UpdateAction): Promise<void>;
30
+ render(): TemplateResult;
31
+ }
@@ -1,6 +1,11 @@
1
1
  import type { SliccModel } from '../model/types.js';
2
+ import { DummyUpdates, type UpdateScenario } from './updates.js';
2
3
  export interface DummyOptions {
3
4
  delay?: number;
4
5
  storage?: Storage | null;
6
+ updates?: UpdateScenario;
5
7
  }
6
- export declare function createDummyModel({ delay, storage }?: DummyOptions): SliccModel;
8
+ export interface DummyModel extends SliccModel {
9
+ updates: DummyUpdates;
10
+ }
11
+ export declare function createDummyModel({ delay, storage, updates, }?: DummyOptions): DummyModel;
@@ -0,0 +1,15 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { UpdateAction, UpdateItem, UpdatesPort } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export type UpdateScenario = 'current' | 'boot' | 'available' | 'restart' | 'failure';
5
+ export declare function updateFixtures(scenario: UpdateScenario): readonly UpdateItem[];
6
+ export declare class DummyUpdates extends Emitter<{
7
+ items: readonly UpdateItem[];
8
+ }> implements UpdatesPort {
9
+ #private;
10
+ constructor(scenario: UpdateScenario, clock: Clock);
11
+ list(): readonly UpdateItem[];
12
+ ready(): boolean;
13
+ setScenario(scenario: UpdateScenario): void;
14
+ act(id: string, action: UpdateAction): Promise<void>;
15
+ }
@@ -1,2 +1,4 @@
1
- export type { DummyOptions } from './dummy/index.js';
1
+ export type { DummyModel, DummyOptions } from './dummy/index.js';
2
2
  export { createDummyModel } from './dummy/index.js';
3
+ export type { UpdateScenario } from './dummy/updates.js';
4
+ export { DummyUpdates, updateFixtures } from './dummy/updates.js';
@@ -475,6 +475,33 @@ export interface TrayPort extends Subscribable<TrayEvents> {
475
475
  reconnect(): void;
476
476
  disconnect(): void;
477
477
  }
478
+ export type UpdateKind = 'bios' | 'kernel' | 'agent' | 'grammars' | 'global' | 'skills' | 'ui';
479
+ export type UpdateState = 'current' | 'checking' | 'downloading' | 'linking' | 'installed' | 'available' | 'ready' | 'failed';
480
+ export type UpdateAction = 'retry' | 'restart-agent' | 'reload' | 'update-now';
481
+ export interface UpdateItem {
482
+ id: string;
483
+ label: string;
484
+ kind: UpdateKind;
485
+ state: UpdateState;
486
+ progress: {
487
+ phase: 'download' | 'link';
488
+ done: number;
489
+ total: number;
490
+ } | null;
491
+ from: string | null;
492
+ to: string | null;
493
+ checkedAt: number | null;
494
+ error: string | null;
495
+ actions: readonly UpdateAction[];
496
+ log?: string;
497
+ }
498
+ export interface UpdatesPort extends Subscribable<{
499
+ items: readonly UpdateItem[];
500
+ }> {
501
+ list(): readonly UpdateItem[];
502
+ ready(): boolean;
503
+ act(id: string, action: UpdateAction): Promise<void>;
504
+ }
478
505
  export interface SliccModel {
479
506
  agent: AgentPort;
480
507
  files: FilePort;
@@ -485,4 +512,5 @@ export interface SliccModel {
485
512
  monitor: MonitorPort;
486
513
  sprinkles: SprinklePort;
487
514
  tray: TrayPort;
515
+ updates?: UpdatesPort;
488
516
  }
@@ -6,6 +6,7 @@ import { SliccChanges, SliccDiffPanel } from './app/changes.js';
6
6
  import { SliccChat } from './app/chat.js';
7
7
  import { SliccComposer } from './app/composer.js';
8
8
  import { SliccFiles, SliccFileView } from './app/files.js';
9
+ import { SliccUpdates } from './app/updates.js';
9
10
  import { SliccCodeView, SliccDiffView } from './components/code-view.js';
10
11
  import { SliccDock } from './components/dock.js';
11
12
  import { SliccFileTree } from './components/file-tree.js';
@@ -21,5 +22,5 @@ export type { GitStatusEntry } from './components/file-tree.js';
21
22
  export type { Listener, Subscribable } from './model/emitter.js';
22
23
  export { Emitter } from './model/emitter.js';
23
24
  export type * from './model/types.js';
24
- export { SliccAgents, SliccApp, SliccBrowser, SliccChanges, SliccChat, SliccCodeView, SliccComposer, SliccDiffPanel, SliccDiffView, SliccDock, SliccFiles, SliccFileTree, SliccFileView, };
25
+ export { SliccAgents, SliccApp, SliccBrowser, SliccChanges, SliccChat, SliccCodeView, SliccComposer, SliccDiffPanel, SliccDiffView, SliccDock, SliccFiles, SliccFileTree, SliccFileView, SliccUpdates, };
25
26
  export declare function define(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-spectrum",
3
- "version": "1.13.0",
3
+ "version": "1.14.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",