@ai-ecoverse/slicc-spectrum 1.77.1 → 1.79.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,6 +1,7 @@
1
1
  import '@adobe/spectrum-wc/components/action-button/swc-action-button.js';
2
2
  import '@adobe/spectrum-wc/components/tooltip/swc-tooltip.js';
3
3
  import '@adobe/spectrum-wc-icons/swc-icon-add.js';
4
+ import '@adobe/spectrum-wc-icons/swc-icon-chevron-right.js';
4
5
  import '@adobe/spectrum-wc-icons/swc-icon-close.js';
5
6
  import '@adobe/spectrum-wc-icons/swc-icon-delete.js';
6
7
  import { type TemplateResult } from 'lit';
@@ -10,6 +11,7 @@ export declare function ordered(agents: readonly Agent[]): Agent[];
10
11
  export declare function creatable(model: SliccModel | null | undefined): boolean;
11
12
  export declare function createCone(model: SliccModel, trigger: HTMLElement): Promise<Agent | undefined>;
12
13
  export declare function scoopSummary(scoops: readonly Agent[]): string;
14
+ export declare function scoopBrief(scoops: readonly Agent[]): string;
13
15
  export declare function unreadCount(unread: number): string;
14
16
  export declare function fillShown(fill: number): boolean;
15
17
  export declare class SliccAgents extends ModelElement {
@@ -27,5 +29,6 @@ export declare class SliccAgents extends ModelElement {
27
29
  static styles: import("lit").CSSResult[];
28
30
  protected subscribe(model: SliccModel): Array<() => void>;
29
31
  focus(): void;
32
+ protected updated(): void;
30
33
  render(): TemplateResult;
31
34
  }
@@ -2,18 +2,20 @@ import '@adobe/spectrum-wc/components/button/swc-button.js';
2
2
  import '@adobe/spectrum-wc-icons/swc-icon-alert-triangle.js';
3
3
  import '@spectrum-web-components/alert-dialog/sp-alert-dialog.js';
4
4
  import { type PropertyValues } from 'lit';
5
- import type { Approval, ApprovalDecision, SliccModel } from '../model/types.js';
5
+ import type { Approval, ApprovalDecision, GuestMessageApproval, GuestToolApproval, SliccModel, SudoApproval } from '../model/types.js';
6
6
  import { ModelElement } from './base.js';
7
7
  export declare function countdown(ms: number): string;
8
- export declare function asking(approval: Approval): string;
9
- export declare function sudo(approval: Approval): string;
8
+ export declare function asking(approval: SudoApproval): string;
9
+ export declare function sudo(approval: SudoApproval): string;
10
10
  export declare const certain: (rules: string) => boolean;
11
11
  export interface SecretRulesVerdict {
12
12
  certain: string | null;
13
13
  maybe: string | null;
14
14
  }
15
15
  export declare function secretRules(command: string, cwd?: string | null): SecretRulesVerdict;
16
- export declare function alwaysHint(approval: Approval): string;
16
+ export declare function alwaysHint(approval: SudoApproval): string;
17
+ export declare function guestAsking(approval: GuestMessageApproval | GuestToolApproval): string;
18
+ export declare function guestWaiting(approval: GuestMessageApproval | GuestToolApproval): string;
17
19
  export declare function waiting(model: SliccModel | null, now: number): Approval[];
18
20
  export declare class SliccApprovals extends ModelElement {
19
21
  #private;
@@ -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>;
@@ -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>;
@@ -1,7 +1,7 @@
1
1
  import { Emitter } from '../model/emitter.js';
2
2
  import type { Approval, ApprovalDecision, ApprovalEnd, ApprovalsEvents, ApprovalsPort } from '../model/types.js';
3
3
  import type { Clock } from './clock.js';
4
- export type ApprovalScenario = 'agent' | 'user' | 'many' | 'follower' | 'fail' | 'soon' | 'elsewhere' | 'withdrawn' | 'secrets' | 'none';
4
+ export type ApprovalScenario = 'agent' | 'user' | 'many' | 'follower' | 'fail' | 'soon' | 'elsewhere' | 'withdrawn' | 'secrets' | 'guest' | 'guest-follower' | 'none';
5
5
  export declare function approvalFixtures(scenario: ApprovalScenario, now?: number): Approval[];
6
6
  export declare class DummyApprovals extends Emitter<ApprovalsEvents> implements ApprovalsPort {
7
7
  #private;
@@ -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';
@@ -791,11 +791,15 @@ export interface NoticesPort extends Subscribable<{
791
791
  }
792
792
  export type ApprovalDecision = 'once' | 'always' | 'deny';
793
793
  export interface ApprovalRequester {
794
- kind: 'agent' | 'user';
794
+ kind: 'agent' | 'user' | 'guest';
795
795
  name: string;
796
796
  agentId?: string;
797
797
  where?: string;
798
798
  }
799
+ export interface ApprovalVerdict {
800
+ decision: 'allow' | 'deny';
801
+ reason: string;
802
+ }
799
803
  export interface SudoApproval {
800
804
  id: string;
801
805
  kind: 'sudo';
@@ -808,7 +812,37 @@ export interface SudoApproval {
808
812
  always: boolean;
809
813
  alwaysScope?: 'cwd';
810
814
  }
811
- export type Approval = SudoApproval;
815
+ export interface GuestMessageApproval {
816
+ id: string;
817
+ kind: 'guest-message';
818
+ requester: ApprovalRequester;
819
+ agentId: string;
820
+ agentName?: string;
821
+ text: string;
822
+ attachments?: readonly {
823
+ name: string;
824
+ mimeType: string;
825
+ size: number;
826
+ }[];
827
+ createdAt: number;
828
+ expiresAt: number;
829
+ always: false;
830
+ verdict?: ApprovalVerdict;
831
+ }
832
+ export interface GuestToolApproval {
833
+ id: string;
834
+ kind: 'guest-tool';
835
+ requester: ApprovalRequester;
836
+ agentId: string;
837
+ agentName?: string;
838
+ tool: string;
839
+ summary: string;
840
+ createdAt: number;
841
+ expiresAt: number;
842
+ always: false;
843
+ verdict?: ApprovalVerdict;
844
+ }
845
+ export type Approval = SudoApproval | GuestMessageApproval | GuestToolApproval;
812
846
  export type ApprovalEnd = 'answered' | 'withdrawn' | 'expired';
813
847
  export interface ApprovalsEvents {
814
848
  approvals: readonly Approval[];
@@ -819,7 +853,7 @@ export interface ApprovalsEvents {
819
853
  }
820
854
  export interface ApprovalsPort extends Subscribable<ApprovalsEvents> {
821
855
  list(): readonly Approval[];
822
- decide?(id: string, decision: ApprovalDecision): Promise<void>;
856
+ decide?(id: string, decision: ApprovalDecision, reason?: string): Promise<void>;
823
857
  }
824
858
  export type TabRole = 'owner' | 'follower' | 'connecting' | 'alone';
825
859
  export type TabSkew = 'newer' | 'older';
@@ -1207,6 +1241,39 @@ export interface VaultPort extends Subscribable<VaultEvents> {
1207
1241
  dismissBackupReminder?(): Promise<void>;
1208
1242
  button(): VaultButton;
1209
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
+ }
1210
1277
  export interface SliccModel {
1211
1278
  agent: AgentPort;
1212
1279
  files: FilePort;
@@ -1225,5 +1292,6 @@ export interface SliccModel {
1225
1292
  approvals?: ApprovalsPort;
1226
1293
  follow?: FollowPort;
1227
1294
  vault?: VaultPort;
1295
+ guests?: GuestPort;
1228
1296
  }
1229
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.77.1",
3
+ "version": "1.79.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,14 +72,14 @@
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.97.1",
75
+ "@ai-ecoverse/slicc-kernel": "1.98.2",
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",
79
79
  "@ai-ecoverse/wasm-coreutils": "9.12.0-7",
80
80
  "@biomejs/biome": "2.5.15",
81
81
  "@fontsource/source-code-pro": "5.3.0",
82
- "@happy-dom/global-registrator": "20.14.5",
82
+ "@happy-dom/global-registrator": "20.14.6",
83
83
  "@pierre/diffs": "1.5.2",
84
84
  "@pierre/trees": "1.0.0-beta.6",
85
85
  "@spectrum-web-components/action-button": "1.12.4",
@@ -102,7 +102,7 @@
102
102
  "@wterm/dom": "0.5.4",
103
103
  "dockview-core": "8.4.1",
104
104
  "esbuild": "0.28.2",
105
- "happy-dom": "20.14.5",
105
+ "happy-dom": "20.14.6",
106
106
  "lefthook": "2.2.1",
107
107
  "lucide": "1.53.0",
108
108
  "monocart-coverage-reports": "2.13.2",