@ai-ecoverse/slicc-spectrum 1.78.0 → 1.79.1

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.
@@ -4,6 +4,7 @@ import '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';
4
4
  import { type PropertyValues } from 'lit';
5
5
  import type { Approval, ApprovalDecision, GuestMessageApproval, GuestToolApproval, SliccModel, SudoApproval } from '../model/types.js';
6
6
  import { ModelElement } from './base.js';
7
+ export { deadline } from './messages.js';
7
8
  export declare function countdown(ms: number): string;
8
9
  export declare function asking(approval: SudoApproval): string;
9
10
  export declare function sudo(approval: SudoApproval): string;
@@ -57,4 +58,3 @@ export declare class SliccApprovals extends ModelElement {
57
58
  close(): void;
58
59
  render(): unknown;
59
60
  }
60
- export declare function deadline(at: number): string;
@@ -22,6 +22,7 @@ export interface PromptOptions {
22
22
  submit?: (value: string) => Promise<void>;
23
23
  }
24
24
  export declare function focused(): HTMLElement | null;
25
+ export declare function themeOf(node: Node | null): Element;
25
26
  export declare const dialogStyles: import("lit").CSSResult;
26
27
  export declare class SliccConfirm extends LitElement {
27
28
  #private;
@@ -0,0 +1,98 @@
1
+ import '@adobe/spectrum-wc/components/action-button/swc-action-button.js';
2
+ import '@adobe/spectrum-wc/components/button/swc-button.js';
3
+ import '@adobe/spectrum-wc-icons/swc-icon-alert-triangle.js';
4
+ import '@adobe/spectrum-wc-icons/swc-icon-copy.js';
5
+ import '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';
6
+ import '@spectrum-web-components/field-label/sp-field-label.js';
7
+ import '@spectrum-web-components/help-text/sp-help-text.js';
8
+ import '@spectrum-web-components/menu/sp-menu-item.js';
9
+ import '@spectrum-web-components/picker/sp-picker.js';
10
+ import '@spectrum-web-components/textfield/sp-textfield.js';
11
+ import { LitElement, type TemplateResult } from 'lit';
12
+ import type { Agent, GuestGate, GuestPort, GuestSeat } from '../model/types.js';
13
+ export declare const guestExpiries: ReadonlyArray<readonly [string, string, number]>;
14
+ export declare const guestNameLimit = 40;
15
+ export interface GuestCone {
16
+ id: string;
17
+ name: string;
18
+ scoops: readonly string[];
19
+ }
20
+ export interface GateOption {
21
+ value: GuestGate;
22
+ label: string;
23
+ description: string;
24
+ }
25
+ export type GateField = 'messages' | 'tools';
26
+ export declare function gateOptions(field: GateField, cone: GuestCone): GateOption[];
27
+ export declare function guestCones(agents: readonly Agent[]): GuestCone[];
28
+ export declare function activeCone(agents: readonly Agent[], active: string): string;
29
+ export declare function guestNameProblem(label: string): string | null;
30
+ export declare function guestExpiry(seat: GuestSeat, now?: number): string;
31
+ export declare function pendingLabel(count: number): string;
32
+ export declare class SliccGuestInvite extends LitElement {
33
+ #private;
34
+ static properties: {
35
+ cone: {
36
+ state: boolean;
37
+ };
38
+ label: {
39
+ state: boolean;
40
+ };
41
+ expiry: {
42
+ state: boolean;
43
+ };
44
+ messages: {
45
+ state: boolean;
46
+ };
47
+ tools: {
48
+ state: boolean;
49
+ };
50
+ pending: {
51
+ state: boolean;
52
+ };
53
+ error: {
54
+ state: boolean;
55
+ };
56
+ problem: {
57
+ state: boolean;
58
+ };
59
+ url: {
60
+ state: boolean;
61
+ };
62
+ copied: {
63
+ state: boolean;
64
+ };
65
+ uncopied: {
66
+ state: boolean;
67
+ };
68
+ };
69
+ cone: string;
70
+ label: string;
71
+ expiry: string;
72
+ messages: GuestGate;
73
+ tools: GuestGate;
74
+ pending: boolean;
75
+ error: string;
76
+ problem: string;
77
+ url: string;
78
+ copied: boolean;
79
+ uncopied: boolean;
80
+ port: GuestPort | null;
81
+ cones: readonly GuestCone[];
82
+ trigger: HTMLElement | null;
83
+ constructor();
84
+ static styles: import("lit").CSSResult[];
85
+ get result(): Promise<GuestSeat | null>;
86
+ protected firstUpdated(): void;
87
+ disconnectedCallback(): void;
88
+ create(): Promise<void>;
89
+ copy(): Promise<void>;
90
+ render(): TemplateResult;
91
+ }
92
+ export interface InviteOptions {
93
+ port: GuestPort;
94
+ agents: readonly Agent[];
95
+ active: string;
96
+ trigger?: HTMLElement | null;
97
+ }
98
+ export declare function invite(options: InviteOptions): Promise<GuestSeat | null>;
@@ -72,6 +72,7 @@ type Target = {
72
72
  export declare function target(command: string): Target | null;
73
73
  export declare function chip(call: ToolCall, model?: SliccModel | null): TemplateResult;
74
74
  export declare function time(at: number): string;
75
+ export declare function deadline(at: number): string;
75
76
  export declare function day(at: number): string;
76
77
  export declare function stamps(messages: readonly Message[]): Set<string>;
77
78
  export declare function size(bytes: number): string;
@@ -13,7 +13,7 @@ import '@adobe/spectrum-wc-icons/swc-icon-info-circle.js';
13
13
  import '@adobe/spectrum-wc-icons/swc-icon-visibility.js';
14
14
  import '@adobe/spectrum-wc-icons/swc-icon-visibility-off.js';
15
15
  import { type TemplateResult } from 'lit';
16
- import type { AccessKey, BrowserAutomation, DeviceAccess, Leader, LeaderState, LinkedDevice, LinkState, NetworkExit, NetworkLinks, NetworkPort, NetworkRoute, NetworkStatus, RemoteControlMode, SliccModel, TailnetState, TailnetStatus } from '../model/types.js';
16
+ import type { AccessKey, BrowserAutomation, DeviceAccess, GuestSeat, Leader, LeaderState, LinkedDevice, LinkState, NetworkExit, NetworkLinks, NetworkPort, NetworkRoute, NetworkStatus, RemoteControlMode, SliccModel, TailnetState, TailnetStatus } from '../model/types.js';
17
17
  import { ModelElement } from './base.js';
18
18
  import { type ConfirmOptions } from './confirm.js';
19
19
  export { command } from './reach.js';
@@ -43,6 +43,7 @@ export declare function deviceName(name: string): string;
43
43
  export declare function networkStatus(port: NetworkPort): NetworkStatus;
44
44
  export declare const leaderStates: Record<LeaderState, readonly ['neutral' | 'info' | 'positive' | 'notice' | 'negative', string]>;
45
45
  export declare function leaderConfirm(leader: Leader): ConfirmOptions;
46
+ export declare function guestConfirm(seat: GuestSeat): ConfirmOptions;
46
47
  export declare function remoteLight(status: NetworkStatus | undefined): RemoteLight | null;
47
48
  export type LinksSummary = 'permission' | 'none' | 'reconnecting' | 'connecting' | 'offline' | 'linked';
48
49
  export declare function linksSummary(links: NetworkLinks): LinksSummary;
@@ -97,6 +98,12 @@ export declare class SliccNetwork extends ModelElement {
97
98
  leaderError: {
98
99
  state: boolean;
99
100
  };
101
+ guestError: {
102
+ state: boolean;
103
+ };
104
+ guestsOff: {
105
+ state: boolean;
106
+ };
100
107
  };
101
108
  checking: boolean;
102
109
  copied: string | null;
@@ -109,6 +116,8 @@ export declare class SliccNetwork extends ModelElement {
109
116
  linksError: string;
110
117
  syncError: string;
111
118
  leaderError: string;
119
+ guestError: string;
120
+ guestsOff: string | null;
112
121
  constructor();
113
122
  static styles: import("lit").CSSResult[];
114
123
  protected subscribe(model: SliccModel): Array<() => void>;
@@ -0,0 +1,20 @@
1
+ import { Emitter } from '../model/emitter.js';
2
+ import type { GuestDraft, GuestEvents, GuestPort, GuestSeat } from '../model/types.js';
3
+ import type { Clock } from './clock.js';
4
+ export type GuestsScenario = 'on' | 'none' | 'unavailable' | 'fail';
5
+ export declare const guestsUnavailable = "Guests need the tray hub. Connect this SLICC to a tray to invite one.";
6
+ export declare const guestsRefused = "The hub couldn\u2019t make a link right now. Try again in a minute.";
7
+ export declare function guestsFixtures(scenario: GuestsScenario, now?: number): GuestSeat[];
8
+ export declare class DummyGuests extends Emitter<GuestEvents> implements GuestPort {
9
+ #private;
10
+ scenario: GuestsScenario;
11
+ constructor(scenario: GuestsScenario, clock: Clock);
12
+ list(): readonly GuestSeat[];
13
+ unavailable(): string | null;
14
+ setScenario(scenario: GuestsScenario): void;
15
+ mint(agentId: string, draft: GuestDraft): Promise<{
16
+ seat: GuestSeat;
17
+ url: string;
18
+ }>;
19
+ revoke(id: string): Promise<void>;
20
+ }
@@ -4,6 +4,7 @@ import { type BrowserScenario, DummyBrowser } from './browser.js';
4
4
  import { type ChangesScenario } from './changes.js';
5
5
  import { type MountScenario } from './files.js';
6
6
  import { DummyFollow, type FollowScenario } from './follow.js';
7
+ import { DummyGuests, type GuestsScenario } from './guests.js';
7
8
  import { DummyNetwork, type LeadersScenario, type LinksScenario, type NetworkScenario, type TailnetScenario } from './network.js';
8
9
  import { DummyNotices, type NoticeScenario } from './notices.js';
9
10
  import { DummyTabs, type TabsScenario } from './tabs.js';
@@ -26,6 +27,7 @@ export interface DummyOptions {
26
27
  approvals?: ApprovalScenario | 'off';
27
28
  follow?: FollowScenario | 'off';
28
29
  vault?: VaultScenario | 'off';
30
+ guests?: GuestsScenario | 'off';
29
31
  accounts?: 'settings' | 'vault';
30
32
  providers?: 'connected' | 'none';
31
33
  hold?: AgentHold['reason'] | 'off';
@@ -43,6 +45,7 @@ export interface DummyModel extends SliccModel {
43
45
  approvals?: DummyApprovals;
44
46
  follow?: DummyFollow;
45
47
  vault?: DummyVault;
48
+ guests?: DummyGuests;
46
49
  }
47
50
  export declare function vaultAccounts(accounts: readonly Account[]): Account[];
48
- export declare function createDummyModel({ delay, storage, updates, packages, confirm, mounts, network, tailnet, links, leaders, changes, notices, tabs, approvals, follow, vault, accounts, providers, hold, readonly, browser: scenario, sprinkles, monitor, }?: DummyOptions): DummyModel;
51
+ export declare function createDummyModel({ delay, storage, updates, packages, confirm, mounts, network, tailnet, links, leaders, changes, notices, tabs, approvals, follow, vault, guests, accounts, providers, hold, readonly, browser: scenario, sprinkles, monitor, }?: DummyOptions): DummyModel;
@@ -7,6 +7,8 @@ export { DummyChanges } from './dummy/changes.js';
7
7
  export type { DummyMount, MountScenario } from './dummy/files.js';
8
8
  export type { FollowScenario } from './dummy/follow.js';
9
9
  export { DummyFollow, followFixtures } from './dummy/follow.js';
10
+ export type { GuestsScenario } from './dummy/guests.js';
11
+ export { DummyGuests, guestsFixtures, guestsRefused, guestsUnavailable, } from './dummy/guests.js';
10
12
  export type { DummyModel, DummyOptions } from './dummy/index.js';
11
13
  export { createDummyModel } from './dummy/index.js';
12
14
  export type { LeadersScenario, NetworkScenario, TailnetScenario } from './dummy/network.js';
@@ -1241,6 +1241,39 @@ export interface VaultPort extends Subscribable<VaultEvents> {
1241
1241
  dismissBackupReminder?(): Promise<void>;
1242
1242
  button(): VaultButton;
1243
1243
  }
1244
+ export type GuestGate = 'user' | 'cone' | 'agent' | `scoop:${string}` | 'off';
1245
+ export interface GuestGates {
1246
+ messages: GuestGate;
1247
+ tools: GuestGate;
1248
+ }
1249
+ export interface GuestSeat {
1250
+ id: string;
1251
+ label: string;
1252
+ agentId: string;
1253
+ createdAt: number;
1254
+ expiresAt: number | null;
1255
+ gates: GuestGates;
1256
+ connected: boolean;
1257
+ pending: number;
1258
+ }
1259
+ export interface GuestDraft {
1260
+ label: string;
1261
+ expiresAt: number | null;
1262
+ gates: GuestGates;
1263
+ }
1264
+ export interface GuestEvents {
1265
+ seats: readonly GuestSeat[];
1266
+ unavailable: string | null;
1267
+ }
1268
+ export interface GuestPort extends Subscribable<GuestEvents> {
1269
+ list(): readonly GuestSeat[];
1270
+ mint(agentId: string, draft: GuestDraft): Promise<{
1271
+ seat: GuestSeat;
1272
+ url: string;
1273
+ }>;
1274
+ revoke(id: string): Promise<void>;
1275
+ unavailable?(): string | null;
1276
+ }
1244
1277
  export interface SliccModel {
1245
1278
  agent: AgentPort;
1246
1279
  files: FilePort;
@@ -1259,5 +1292,6 @@ export interface SliccModel {
1259
1292
  approvals?: ApprovalsPort;
1260
1293
  follow?: FollowPort;
1261
1294
  vault?: VaultPort;
1295
+ guests?: GuestPort;
1262
1296
  }
1263
1297
  export {};
@@ -9,6 +9,7 @@ import { SliccComposer } from './app/composer.js';
9
9
  import { SliccConfirm, SliccPrompt } from './app/confirm.js';
10
10
  import { SliccFiles, SliccFileView } from './app/files.js';
11
11
  import { SliccFollow } from './app/follow.js';
12
+ import { SliccGuestInvite } from './app/guests.js';
12
13
  import { SliccNetwork } from './app/network.js';
13
14
  import { SliccNotices } from './app/notices.js';
14
15
  import { SliccSecrets } from './app/secrets.js';
@@ -37,5 +38,5 @@ export type { Listener, Subscribable } from './model/emitter.js';
37
38
  export { Emitter } from './model/emitter.js';
38
39
  export type * from './model/types.js';
39
40
  export { isVaultFailure } from './model/values.js';
40
- export { SliccAgents, SliccApp, SliccApprovals, SliccBrowser, SliccChanges, SliccChat, SliccCodeView, SliccComposer, SliccConfirm, SliccDiffPanel, SliccDiffView, SliccDock, SliccFiles, SliccFileTree, SliccFileView, SliccFollow, SliccNetwork, SliccNotices, SliccPrompt, SliccSecrets, SliccUpdates, SliccValueRequest, SliccVaultButton, };
41
+ export { SliccAgents, SliccApp, SliccApprovals, SliccBrowser, SliccChanges, SliccChat, SliccCodeView, SliccComposer, SliccConfirm, SliccDiffPanel, SliccDiffView, SliccDock, SliccFiles, SliccFileTree, SliccFileView, SliccFollow, SliccGuestInvite, SliccNetwork, SliccNotices, SliccPrompt, SliccSecrets, SliccUpdates, SliccValueRequest, SliccVaultButton, };
41
42
  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.78.0",
3
+ "version": "1.79.1",
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,7 +72,7 @@
72
72
  "devDependencies": {
73
73
  "@adobe/spectrum-wc": "2.0.0-beta.5",
74
74
  "@adobe/spectrum-wc-icons": "2.0.0-beta.5",
75
- "@ai-ecoverse/slicc-kernel": "1.98.0",
75
+ "@ai-ecoverse/slicc-kernel": "1.99.1",
76
76
  "@ai-ecoverse/slicc-shared-web": "1.20.0",
77
77
  "@ai-ecoverse/slicc-vault": "1.9.1",
78
78
  "@ai-ecoverse/wasm-bash": "5.3.0-18",