@edenapp/types 0.12.1 → 0.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.
package/AppManifest.d.ts CHANGED
@@ -243,18 +243,13 @@ export interface ResolvedGrant {
243
243
  preset?: string;
244
244
  }
245
245
 
246
- /**
247
- * App Manifest Interface
248
- *
249
- * Defines the structure of an Eden app package.
250
- * Each app must include a manifest.json file with this structure.
251
- */
252
- export interface AppManifest {
253
- /** Unique identifier for the app (e.g., "com.example.myapp") */
246
+ /** Fields shared by every Eden package manifest. */
247
+ export interface PackageManifestBase {
248
+ /** Globally unique package identifier. */
254
249
  id: string;
255
250
 
256
251
  /**
257
- * Human-readable name.
252
+ * Human-readable package name.
258
253
  * Can be a simple string or a map of locales to names (e.g. { "en": "Files", "pl": "Pliki" })
259
254
  */
260
255
  name: string | Record<string, string>;
@@ -262,12 +257,24 @@ export interface AppManifest {
262
257
  /** Version string (semver recommended) */
263
258
  version: string;
264
259
 
265
- /** App description */
260
+ /** Package description. */
266
261
  description?: string;
267
262
 
268
- /** App author information */
263
+ /** Package author information. */
269
264
  author?: string;
270
265
 
266
+ /** Icon path relative to the package root. */
267
+ icon?: string;
268
+ }
269
+
270
+ /**
271
+ * Defines the structure of an executable Eden app package.
272
+ * Each app must include a manifest.json file with this structure.
273
+ */
274
+ export interface AppManifest extends PackageManifestBase {
275
+ /** Package kind. Omitted manifests are treated as apps for compatibility. */
276
+ kind?: "app";
277
+
271
278
  /** Entry point for the backend worker thread */
272
279
  backend?: {
273
280
  /** Path to the backend entry file (relative to app root) */
@@ -317,9 +324,6 @@ export interface AppManifest {
317
324
  /** Window configuration */
318
325
  window?: WindowConfig;
319
326
 
320
- /** App icon path (relative to app root) */
321
- icon?: string;
322
-
323
327
  /** Build configuration (for prebuilt apps) */
324
328
  build?: {
325
329
  /** Command to build the app (e.g., "npm run build") */
@@ -393,8 +397,52 @@ export interface AppManifest {
393
397
  * @example ["node_modules/@linuxcnc-node/core", "node_modules/better-sqlite3"]
394
398
  */
395
399
  include?: string[];
400
+
401
+ /** DLC extension points exposed by this app. */
402
+ dlc?: {
403
+ extensionPoints: DlcExtensionPoint[];
404
+ };
405
+ }
406
+
407
+ /** A named, strictly-versioned extension point exposed by an app. */
408
+ export interface DlcExtensionPoint {
409
+ id: string;
410
+ /** Strict SemVer version implemented by the host. */
411
+ version: string;
412
+ }
413
+
414
+ export type DlcMetadata =
415
+ | null
416
+ | boolean
417
+ | number
418
+ | string
419
+ | DlcMetadata[]
420
+ | { [key: string]: DlcMetadata };
421
+
422
+ /** A contribution made by a DLC to one host extension point. */
423
+ export interface DlcContribution {
424
+ extensionPoint: string;
425
+ /** SemVer range accepted by this contribution. */
426
+ requires: string;
427
+ /** Opaque host-defined JSON. Eden stores but never interprets this value. */
428
+ metadata?: DlcMetadata;
429
+ }
430
+
431
+ /**
432
+ * A data package bound to exactly one installed host app.
433
+ * DLC packages have no independent execution identity.
434
+ */
435
+ export interface DlcManifest extends PackageManifestBase {
436
+ kind: "dlc";
437
+ hostAppId: string;
438
+ contributions: DlcContribution[];
439
+ /** Additional file types opened by the host while this DLC is installed. */
440
+ fileHandlers?: FileHandlerConfig[];
396
441
  }
397
442
 
443
+ /** Any manifest supported by an .edenite package. */
444
+ export type PackageManifest = AppManifest | DlcManifest;
445
+
398
446
  /**
399
447
  * Runtime App Manifest
400
448
  *
@@ -402,6 +450,9 @@ export interface AppManifest {
402
450
  * This is what Eden uses internally after loading and processing an app.
403
451
  */
404
452
  export interface RuntimeAppManifest extends AppManifest {
453
+ /** Installed app manifests always carry an explicit package discriminator. */
454
+ kind: "app";
455
+
405
456
  /** Whether this is a prebuilt system app */
406
457
  isPrebuilt: boolean;
407
458
 
@@ -417,3 +468,12 @@ export interface RuntimeAppManifest extends AppManifest {
417
468
  /** Grants with presets resolved to full definitions */
418
469
  resolvedGrants: ResolvedGrant[];
419
470
  }
471
+
472
+ /** Installed DLC manifest with runtime package provenance. */
473
+ export interface RuntimeDlcManifest extends DlcManifest {
474
+ /** Whether this DLC is bundled with Eden rather than user-installed. */
475
+ isPrebuilt: boolean;
476
+ }
477
+
478
+ /** Manifest for an installed app or DLC package. */
479
+ export type InstalledPackageManifest = RuntimeAppManifest | RuntimeDlcManifest;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @edenapp/types
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f878857: Replace host settings panel declarations and state overlays with complete validated resolved views, typed action envelopes, stable-ID reconciliation, resolved collection rows, and independently authorized same-owner nested panels. This intentionally replaces the pre-1.0 panel API without a compatibility adapter.
8
+
9
+ Allow trusted hosts to register panels without an additional grant, so public parent panels and children that inherit their ancestors' access rules use the same registration API.
10
+
11
+ Keep controls synchronized after rejected or unchanged actions, isolate radio selections between node instances, and discard dialog drafts and errors when fields disappear or change input kind.
12
+
13
+ Keep settings navigation and management views usable in narrow spaces by collapsing the sidebar to labeled icon actions and reflowing daemon and package details around their available panel width. Render resolved settings in grouped, responsive rows instead of leaving the new panel markup unstyled, and match select pickers to their controls with consistent Eden styling, centered values, and option heights.
14
+
15
+ ## 0.13.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 7ebd35d: Add app-bound DLC manifests, secure `.edenite` packaging and extraction, built-in DLC bundling, unified package installation and removal, transactional host-aware lifecycle handling, host-scoped JavaScript module resource URLs, trusted main-process inventory APIs with package-size details in Settings, optional host file-handler extensions, binary filesystem commands, editor-owned contracts for external language highlighters and custom document codecs, and a built-in HTTP request highlighter DLC.
20
+ - 9bd04f0: Open a compact spatial layout compass from tiled app titles when adjacent windows are available, with controls to swap positions or temporarily expand across compatible neighbors without persistent gutters or another renderer. Keep layout actions unavailable during an active expansion so they cannot implicitly restore or rearrange the covered split.
21
+
22
+ ### Patch Changes
23
+
24
+ - 6128a97: Resize floating app windows from their left, right, and bottom edges, including both bottom corners, with side handles beginning below the title bar so the full top frame remains available for window dragging.
25
+
3
26
  ## 0.12.1
4
27
 
5
28
  ## 0.12.0
package/Package.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ import type {
2
+ InstalledPackageManifest,
3
+ RuntimeAppManifest,
4
+ RuntimeDlcManifest,
5
+ } from "./AppManifest";
6
+
7
+ /** A host-scoped installed DLC and the root URL used to consume its payload. */
8
+ export interface DlcResource {
9
+ manifest: RuntimeDlcManifest;
10
+ /** Caller-scoped URL ending in `/`; resolve host-defined contribution paths against it. */
11
+ rootUrl: string;
12
+ }
13
+
14
+ /** Details for an installed package. DLC packages return an empty DLC list. */
15
+ export interface InstalledPackageInfo {
16
+ manifest: InstalledPackageManifest;
17
+ dlcs: DlcResource[];
18
+ }
19
+
20
+ /** Runtime installation preview returned when inspecting an .edenite package. */
21
+ export type PackageOperationPreview =
22
+ | {
23
+ kind: "app";
24
+ existingVersion?: string;
25
+ incompatibleDlcs: RuntimeDlcManifest[];
26
+ hostRunning: boolean;
27
+ replaceable: boolean;
28
+ }
29
+ | {
30
+ kind: "dlc";
31
+ existingVersion?: string;
32
+ host?: RuntimeAppManifest;
33
+ compatibilityErrors: string[];
34
+ hostRunning: boolean;
35
+ replaceable: boolean;
36
+ };
@@ -1,11 +1,8 @@
1
1
  import type { UserProfile } from "./User";
2
2
 
3
- /** Text that can be localized by the Settings renderer. */
4
3
  export type SettingsPanelLocalizedText =
5
4
  | string
6
5
  | Readonly<Record<string, string>>;
7
-
8
- /** JSON-compatible values accepted by panel state and action inputs. */
9
6
  export type SettingsPanelValue =
10
7
  | string
11
8
  | number
@@ -13,25 +10,19 @@ export type SettingsPanelValue =
13
10
  | null
14
11
  | SettingsPanelValue[]
15
12
  | { [key: string]: SettingsPanelValue };
16
-
17
13
  export type SettingsPanelBadgeTone =
18
14
  | "neutral"
19
15
  | "info"
20
16
  | "success"
21
17
  | "warning"
22
18
  | "danger";
23
-
24
- /** Fully-qualified active-user grant required to discover a panel. */
25
19
  export type SettingsPanelGrant = string;
26
-
27
- /** Additional active-user grant required to invoke one panel action. */
28
20
  export type SettingsPanelActionGrant = string;
29
21
 
30
22
  export interface SettingsPanelBadge {
31
23
  label: SettingsPanelLocalizedText;
32
24
  tone?: SettingsPanelBadgeTone;
33
25
  }
34
-
35
26
  export interface SettingsPanelValidation {
36
27
  required?: boolean;
37
28
  minLength?: number;
@@ -41,98 +32,12 @@ export interface SettingsPanelValidation {
41
32
  max?: number;
42
33
  step?: number;
43
34
  }
44
-
45
35
  export interface SettingsPanelOption {
46
36
  value: string;
47
37
  label: SettingsPanelLocalizedText;
48
38
  description?: SettingsPanelLocalizedText;
49
39
  }
50
40
 
51
- export type SettingsPanelInputType =
52
- | "text"
53
- | "password"
54
- | "number"
55
- | "checkbox"
56
- | "radio"
57
- | "select"
58
- | "textarea"
59
- | "color"
60
- | "range";
61
-
62
- export interface SettingsPanelFormField {
63
- id: string;
64
- label: SettingsPanelLocalizedText;
65
- description?: SettingsPanelLocalizedText;
66
- input: SettingsPanelInputType;
67
- placeholder?: SettingsPanelLocalizedText;
68
- options?: SettingsPanelOption[];
69
- validation?: SettingsPanelValidation;
70
- autocomplete?: string;
71
- }
72
-
73
- export interface SettingsPanelControlBase {
74
- id: string;
75
- label: SettingsPanelLocalizedText;
76
- description?: SettingsPanelLocalizedText;
77
- }
78
-
79
- export interface SettingsPanelStatusRow extends SettingsPanelControlBase {
80
- kind: "status";
81
- stateKey: string;
82
- }
83
-
84
- export interface SettingsPanelToggle extends SettingsPanelControlBase {
85
- kind: "toggle";
86
- stateKey: string;
87
- actionId: string;
88
- }
89
-
90
- export interface SettingsPanelButton extends SettingsPanelControlBase {
91
- kind: "button";
92
- actionId: string;
93
- tone?: SettingsPanelBadgeTone;
94
- confirmation?: SettingsPanelLocalizedText;
95
- }
96
-
97
- export interface SettingsPanelInput extends SettingsPanelControlBase {
98
- kind: "input";
99
- stateKey: string;
100
- actionId: string;
101
- input: SettingsPanelInputType;
102
- placeholder?: SettingsPanelLocalizedText;
103
- options?: SettingsPanelOption[];
104
- validation?: SettingsPanelValidation;
105
- }
106
-
107
- export interface SettingsPanelDialogContent {
108
- title: SettingsPanelLocalizedText;
109
- description?: SettingsPanelLocalizedText;
110
- fields: SettingsPanelFormField[];
111
- submitLabel: SettingsPanelLocalizedText;
112
- cancelLabel: SettingsPanelLocalizedText;
113
- }
114
-
115
- export interface SettingsPanelDialog extends SettingsPanelControlBase {
116
- kind: "dialog";
117
- actionId: string;
118
- buttonLabel: SettingsPanelLocalizedText;
119
- dialog: SettingsPanelDialogContent;
120
- }
121
-
122
- export type SettingsPanelControl =
123
- | SettingsPanelStatusRow
124
- | SettingsPanelToggle
125
- | SettingsPanelButton
126
- | SettingsPanelInput
127
- | SettingsPanelDialog;
128
-
129
- export interface SettingsPanelSection {
130
- id: string;
131
- title?: SettingsPanelLocalizedText;
132
- description?: SettingsPanelLocalizedText;
133
- controls: SettingsPanelControl[];
134
- }
135
-
136
41
  export type SettingsPanelActionInputSchema =
137
42
  | {
138
43
  type: "string";
@@ -155,51 +60,197 @@ export type SettingsPanelActionInputSchema =
155
60
  required?: boolean;
156
61
  items?: SettingsPanelActionInputSchema;
157
62
  }
158
- | {
159
- type: "object";
160
- required?: boolean;
161
- properties?: Record<string, SettingsPanelActionInputSchema>;
162
- additionalProperties?: boolean;
163
- }
63
+ | SettingsPanelObjectInputSchema
164
64
  | { type: "any"; required?: boolean };
165
65
 
66
+ export interface SettingsPanelObjectInputSchema {
67
+ type: "object";
68
+ required?: boolean;
69
+ properties?: Record<string, SettingsPanelActionInputSchema>;
70
+ additionalProperties?: boolean;
71
+ }
72
+
166
73
  export interface SettingsPanelActionDefinition {
167
74
  id: string;
168
75
  label?: SettingsPanelLocalizedText;
169
76
  description?: SettingsPanelLocalizedText;
170
- /** An additional active-user grant required for this action. */
171
77
  grant?: SettingsPanelActionGrant;
172
- input?: SettingsPanelActionInputSchema;
78
+ params?: SettingsPanelObjectInputSchema;
79
+ value?: SettingsPanelActionInputSchema;
80
+ fields?: SettingsPanelObjectInputSchema;
173
81
  }
174
82
 
175
- /**
176
- * Serializable panel declaration. Callbacks belong in the separate provider.
177
- *
178
- * IDs beginning with `eden.` and `app.` are reserved by Eden.
179
- */
83
+ /** Serializable metadata that remains stable for a registration's lifetime. */
180
84
  export interface SettingsPanelDefinition {
181
85
  id: string;
86
+ parentId?: string;
182
87
  title: SettingsPanelLocalizedText;
183
88
  description?: SettingsPanelLocalizedText;
184
89
  icon?: string;
185
- /** Active-user grant required before the panel can be discovered or loaded. */
186
- grant: SettingsPanelGrant;
187
- sections: SettingsPanelSection[];
90
+ /** Omit to add no grant requirement beyond the parent panel, if any. */
91
+ grant?: SettingsPanelGrant;
188
92
  actions?: SettingsPanelActionDefinition[];
189
93
  }
190
94
 
191
- export interface SettingsPanelControlState {
95
+ export interface SettingsPanelActionBinding {
96
+ actionId: string;
97
+ /** Public, client-visible parameters. Handlers must reauthorize resources. */
98
+ params?: Record<string, SettingsPanelValue>;
99
+ }
100
+
101
+ export interface SettingsPanelActionInvocation {
102
+ params?: Record<string, SettingsPanelValue>;
192
103
  value?: SettingsPanelValue;
104
+ fields?: Record<string, SettingsPanelValue>;
105
+ }
106
+
107
+ interface SettingsPanelNodeBase {
108
+ id: string;
109
+ label: SettingsPanelLocalizedText;
110
+ description?: SettingsPanelLocalizedText;
111
+ }
112
+ interface SettingsPanelInteractiveNode extends SettingsPanelNodeBase {
113
+ action: SettingsPanelActionBinding;
114
+ disabled?: boolean;
115
+ }
116
+
117
+ export interface SettingsPanelStatusNode extends SettingsPanelNodeBase {
118
+ kind: "status";
119
+ value?: SettingsPanelLocalizedText;
120
+ detail?: SettingsPanelLocalizedText;
121
+ badge?: SettingsPanelBadge;
122
+ }
123
+ export interface SettingsPanelToggleNode extends SettingsPanelInteractiveNode {
124
+ kind: "toggle";
125
+ value: boolean;
126
+ }
127
+ export interface SettingsPanelButtonNode extends SettingsPanelInteractiveNode {
128
+ kind: "button";
129
+ tone?: SettingsPanelBadgeTone;
130
+ confirmation?: SettingsPanelLocalizedText;
131
+ }
132
+
133
+ interface SettingsPanelInputNodeBase extends SettingsPanelInteractiveNode {
134
+ kind: "input";
135
+ placeholder?: SettingsPanelLocalizedText;
136
+ validation?: SettingsPanelValidation;
137
+ }
138
+ export interface SettingsPanelStringInputNode
139
+ extends SettingsPanelInputNodeBase {
140
+ input: "text" | "textarea" | "color";
141
+ value: string;
142
+ }
143
+ export interface SettingsPanelChoiceInputNode
144
+ extends SettingsPanelInputNodeBase {
145
+ input: "select" | "radio";
146
+ value: string;
147
+ options: SettingsPanelOption[];
148
+ }
149
+ export interface SettingsPanelNumberInputNode
150
+ extends SettingsPanelInputNodeBase {
151
+ input: "number" | "range";
152
+ value: number;
153
+ }
154
+ export interface SettingsPanelCheckboxInputNode
155
+ extends SettingsPanelInputNodeBase {
156
+ input: "checkbox";
157
+ value: boolean;
158
+ }
159
+ export type SettingsPanelInputNode =
160
+ | SettingsPanelStringInputNode
161
+ | SettingsPanelChoiceInputNode
162
+ | SettingsPanelNumberInputNode
163
+ | SettingsPanelCheckboxInputNode;
164
+
165
+ interface SettingsPanelDialogFieldBase {
166
+ id: string;
167
+ label: SettingsPanelLocalizedText;
168
+ description?: SettingsPanelLocalizedText;
169
+ placeholder?: SettingsPanelLocalizedText;
170
+ validation?: SettingsPanelValidation;
171
+ autocomplete?: string;
172
+ }
173
+ export interface SettingsPanelStringDialogField
174
+ extends SettingsPanelDialogFieldBase {
175
+ input: "text" | "textarea" | "color";
176
+ value?: string;
177
+ }
178
+ export interface SettingsPanelChoiceDialogField
179
+ extends SettingsPanelDialogFieldBase {
180
+ input: "select" | "radio";
181
+ value?: string;
182
+ options: SettingsPanelOption[];
183
+ }
184
+ export interface SettingsPanelNumberDialogField
185
+ extends SettingsPanelDialogFieldBase {
186
+ input: "number" | "range";
187
+ value?: number;
188
+ }
189
+ export interface SettingsPanelCheckboxDialogField
190
+ extends SettingsPanelDialogFieldBase {
191
+ input: "checkbox";
192
+ value?: boolean;
193
+ }
194
+ export interface SettingsPanelPasswordDialogField
195
+ extends SettingsPanelDialogFieldBase {
196
+ input: "password";
197
+ value?: never;
198
+ }
199
+ export type SettingsPanelDialogField =
200
+ | SettingsPanelStringDialogField
201
+ | SettingsPanelChoiceDialogField
202
+ | SettingsPanelNumberDialogField
203
+ | SettingsPanelCheckboxDialogField
204
+ | SettingsPanelPasswordDialogField;
205
+
206
+ export interface SettingsPanelDialogContent {
207
+ title: SettingsPanelLocalizedText;
208
+ description?: SettingsPanelLocalizedText;
209
+ fields: SettingsPanelDialogField[];
210
+ submitLabel: SettingsPanelLocalizedText;
211
+ cancelLabel: SettingsPanelLocalizedText;
212
+ }
213
+ export interface SettingsPanelDialogNode extends SettingsPanelInteractiveNode {
214
+ kind: "dialog";
215
+ buttonLabel: SettingsPanelLocalizedText;
216
+ dialog: SettingsPanelDialogContent;
217
+ }
218
+ export type SettingsPanelRowNode =
219
+ | SettingsPanelStatusNode
220
+ | SettingsPanelButtonNode
221
+ | SettingsPanelToggleNode
222
+ | SettingsPanelDialogNode;
223
+
224
+ export interface SettingsPanelCollectionItem {
225
+ id: string;
226
+ title: SettingsPanelLocalizedText;
227
+ description?: SettingsPanelLocalizedText;
193
228
  detail?: SettingsPanelLocalizedText;
194
229
  badge?: SettingsPanelBadge;
195
230
  disabled?: boolean;
196
- hidden?: boolean;
231
+ nodes: SettingsPanelRowNode[];
197
232
  }
233
+ export interface SettingsPanelCollectionNode extends SettingsPanelNodeBase {
234
+ kind: "collection";
235
+ emptyLabel?: SettingsPanelLocalizedText;
236
+ items: SettingsPanelCollectionItem[];
237
+ }
238
+ export type SettingsPanelNode =
239
+ | SettingsPanelStatusNode
240
+ | SettingsPanelToggleNode
241
+ | SettingsPanelButtonNode
242
+ | SettingsPanelInputNode
243
+ | SettingsPanelDialogNode
244
+ | SettingsPanelCollectionNode;
198
245
 
199
- export interface SettingsPanelState {
200
- controls?: Record<string, SettingsPanelControlState>;
201
- /** Renderer-specific, JSON-compatible state for Eden-owned custom views. */
202
- data?: SettingsPanelValue;
246
+ export interface SettingsPanelSection {
247
+ id: string;
248
+ title?: SettingsPanelLocalizedText;
249
+ description?: SettingsPanelLocalizedText;
250
+ nodes: SettingsPanelNode[];
251
+ }
252
+ export interface SettingsPanelView {
253
+ sections: SettingsPanelSection[];
203
254
  }
204
255
 
205
256
  export interface SettingsPanelProviderContext {
@@ -207,54 +258,71 @@ export interface SettingsPanelProviderContext {
207
258
  sessionId: string;
208
259
  user: UserProfile;
209
260
  }
210
-
211
261
  export type SettingsPanelLoader = (
212
262
  context: SettingsPanelProviderContext,
213
- ) => SettingsPanelState | Promise<SettingsPanelState>;
214
-
263
+ ) => SettingsPanelView | Promise<SettingsPanelView>;
215
264
  export type SettingsPanelActionHandler = (
216
- input: SettingsPanelValue | undefined,
265
+ invocation: SettingsPanelActionInvocation,
217
266
  context: SettingsPanelProviderContext,
218
267
  ) => void | Promise<void>;
219
-
220
- /** Trusted main-process callbacks for a registered panel. */
221
268
  export interface SettingsPanelProvider {
222
269
  load: SettingsPanelLoader;
223
270
  actions?: Record<string, SettingsPanelActionHandler>;
224
271
  }
225
272
 
226
273
  export interface SettingsPanelRegistrationOptions {
227
- /** Whether the panel is initially included in the Settings catalog. */
228
274
  visible?: boolean;
229
275
  }
230
-
231
276
  export interface SettingsPanelRegistration {
232
277
  readonly panelId: string;
278
+ /** Reload the selected panel's complete resolved snapshot. */
279
+ invalidate(): void;
233
280
  setVisible(visible: boolean): void;
234
281
  unregister(): void;
235
282
  }
236
283
 
237
284
  export type SettingsPanelSource = "eden" | "application" | "host";
238
-
239
285
  export interface SettingsPanelSummary {
240
286
  id: string;
287
+ parentId?: string;
241
288
  title: SettingsPanelLocalizedText;
242
289
  description?: SettingsPanelLocalizedText;
243
290
  icon?: string;
244
291
  source: SettingsPanelSource;
245
292
  }
246
-
247
293
  export interface SettingsPanelActionAuthorization {
248
294
  id: string;
249
295
  authorized: boolean;
250
296
  }
251
-
252
- export interface SettingsPanelDeclaration extends SettingsPanelSummary {
253
- sections: SettingsPanelSection[];
297
+ interface SettingsPanelSnapshotBase extends SettingsPanelSummary {
254
298
  actions: SettingsPanelActionAuthorization[];
255
- /** Eden-owned renderer ID. Third-party registrations always use `generic`. */
256
- renderer: "generic" | "appearance" | "apps" | "daemons";
257
299
  }
300
+ export interface SettingsPanelGenericSnapshot
301
+ extends SettingsPanelSnapshotBase {
302
+ renderer: "generic";
303
+ view: SettingsPanelView;
304
+ }
305
+ export interface SettingsPanelAppearanceSnapshot
306
+ extends SettingsPanelSnapshotBase {
307
+ renderer: "appearance";
308
+ data?: SettingsPanelValue;
309
+ }
310
+ export interface SettingsPanelAppsSnapshot extends SettingsPanelSnapshotBase {
311
+ renderer: "apps";
312
+ data?: SettingsPanelValue;
313
+ }
314
+ export interface SettingsPanelDaemonsSnapshot
315
+ extends SettingsPanelSnapshotBase {
316
+ renderer: "daemons";
317
+ data?: SettingsPanelValue;
318
+ }
319
+ export type SettingsPanelCustomSnapshot =
320
+ | SettingsPanelAppearanceSnapshot
321
+ | SettingsPanelAppsSnapshot
322
+ | SettingsPanelDaemonsSnapshot;
323
+ export type SettingsPanelSnapshot =
324
+ | SettingsPanelGenericSnapshot
325
+ | SettingsPanelCustomSnapshot;
258
326
 
259
327
  export interface SettingsPanelError {
260
328
  code:
@@ -267,13 +335,10 @@ export interface SettingsPanelError {
267
335
  message: string;
268
336
  fields?: Record<string, string>;
269
337
  }
270
-
271
338
  export interface SettingsPanelResponse {
272
- panel?: SettingsPanelDeclaration;
273
- state?: SettingsPanelState;
339
+ panel?: SettingsPanelSnapshot;
274
340
  error?: SettingsPanelError;
275
341
  }
276
-
277
342
  export interface SettingsPanelActionResponse {
278
343
  success: boolean;
279
344
  error?: SettingsPanelError;
package/View.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /** A spatial edge around the caller's tiled window. */
2
+ export type TileLayoutDirection = "top" | "right" | "bottom" | "left";
3
+
4
+ /** A tiled window adjacent to one edge of the caller's window. */
5
+ export interface TileLayoutNeighbor {
6
+ name: string | Record<string, string>;
7
+ /** Whether the caller can temporarily cover this neighbor. */
8
+ canExpand: boolean;
9
+ }
10
+
11
+ /** Context used to render the caller-scoped tiled-window layout controls. */
12
+ export interface TileLayoutState {
13
+ mode: "floating" | "tiled";
14
+ neighbors: Partial<Record<TileLayoutDirection, TileLayoutNeighbor>>;
15
+ }
@@ -404,6 +404,13 @@ export interface FsCommands {
404
404
  encoding?: string };
405
405
  response: string;
406
406
  };
407
+ /**
408
+ * Read the raw contents of a file.
409
+ */
410
+ "fs/read-binary": {
411
+ args: { path: string };
412
+ response: Uint8Array;
413
+ };
407
414
  /**
408
415
  * Write content to a file, creating directories if needed.
409
416
  */
@@ -414,6 +421,15 @@ export interface FsCommands {
414
421
  encoding?: string };
415
422
  response: void;
416
423
  };
424
+ /**
425
+ * Write raw bytes to a file, creating directories if needed.
426
+ */
427
+ "fs/write-binary": {
428
+ args: {
429
+ path: string;
430
+ content: Uint8Array };
431
+ response: void;
432
+ };
417
433
  /**
418
434
  * Check if a file or directory exists.
419
435
  */
@@ -579,18 +595,19 @@ export interface NotificationCommands {
579
595
  */
580
596
  export interface PackageCommands {
581
597
  /**
582
- * Install an application from a local path.
598
+ * Install an application or DLC from a local path.
583
599
  */
584
600
  "package/install": {
585
601
  args: {
586
- sourcePath: string };
587
- response: import("./index").RuntimeAppManifest;
602
+ sourcePath: string;
603
+ replace?: boolean };
604
+ response: import("./index").InstalledPackageManifest;
588
605
  };
589
606
  /**
590
- * Uninstall an application by its ID.
607
+ * Uninstall an application or DLC by its package ID.
591
608
  */
592
609
  "package/uninstall": {
593
- args: { appId: string };
610
+ args: { packageId: string };
594
611
  response: boolean;
595
612
  };
596
613
  /**
@@ -604,12 +621,27 @@ export interface PackageCommands {
604
621
  showRestricted?: boolean };
605
622
  response: import("./index").RuntimeAppManifest[];
606
623
  };
624
+ /**
625
+ * Identify the authenticated app and return its extension resources.
626
+ */
627
+ "package/self": {
628
+ args: { };
629
+ response: import("./index").InstalledPackageInfo;
630
+ };
631
+ /**
632
+ * Get an installed package and any extension resources it owns.
633
+ */
634
+ "package/get": {
635
+ args: {
636
+ packageId: string };
637
+ response: import("./index").InstalledPackageInfo;
638
+ };
607
639
  /**
608
640
  * Toggle hot reload for an app
609
641
  */
610
642
  "package/toggle-hot-reload": {
611
643
  args: {
612
- appId: string };
644
+ packageId: string };
613
645
  response: { enabled: boolean };
614
646
  };
615
647
  /**
@@ -617,31 +649,35 @@ export interface PackageCommands {
617
649
  */
618
650
  "package/is-hot-reload-enabled": {
619
651
  args: {
620
- appId: string };
652
+ packageId: string };
621
653
  response: { enabled: boolean };
622
654
  };
623
655
  /**
624
- * Get the icon for an installed application as a data URL.
656
+ * Get the icon for an installed package as a data URL.
625
657
  */
626
658
  "package/get-icon": {
627
659
  args: {
628
- appId: string };
660
+ packageId: string };
629
661
  response: { icon: string | undefined };
630
662
  };
631
663
  /**
632
664
  * Get info about a package file without installing it
633
665
  */
634
666
  "package/get-info": {
635
- args: {
636
- path: string };
637
- response: { success: boolean; manifest?: import("./index").AppManifest; error?: string };
667
+ args: { path: string };
668
+ response: {
669
+ success: boolean;
670
+ manifest?: import("./index").PackageManifest;
671
+ preview?: import("./index").PackageOperationPreview;
672
+ error?: string;
673
+ };
638
674
  };
639
675
  /**
640
- * Get the installed size of an app in bytes
676
+ * Get the installed size of a package in bytes.
641
677
  */
642
678
  "package/get-size": {
643
679
  args: {
644
- appId: string };
680
+ packageId: string };
645
681
  response: { size: number | undefined };
646
682
  };
647
683
  }
@@ -824,7 +860,7 @@ export interface SettingsCommands {
824
860
  response: { panels: import("./index").SettingsPanelSummary[] };
825
861
  };
826
862
  /**
827
- * Load one authorized panel declaration and its current state.
863
+ * Load one complete authorized panel snapshot.
828
864
  */
829
865
  "settings/panel": {
830
866
  args: { panelId: string };
@@ -837,7 +873,7 @@ export interface SettingsCommands {
837
873
  args: {
838
874
  panelId: string;
839
875
  actionId: string;
840
- input?: import("./index").SettingsPanelValue };
876
+ invocation?: import("./index").SettingsPanelActionInvocation };
841
877
  response: import("./index").SettingsPanelActionResponse;
842
878
  };
843
879
  }
@@ -1016,6 +1052,29 @@ export interface ViewCommands {
1016
1052
  mode?: "floating" | "tiled" };
1017
1053
  response: { success: boolean };
1018
1054
  };
1055
+ /**
1056
+ * Get adjacent tiled windows for the caller's app-frame layout controls.
1057
+ */
1058
+ "view/tile-layout-state": {
1059
+ args: { };
1060
+ response: import("./index").TileLayoutState;
1061
+ };
1062
+ /**
1063
+ * Swap the caller with the tiled window on one edge.
1064
+ */
1065
+ "view/swap-tile": {
1066
+ args: {
1067
+ direction: import("./index").TileLayoutDirection };
1068
+ response: import("./index").TileLayoutState;
1069
+ };
1070
+ /**
1071
+ * Temporarily cover the tiled window on one edge with the caller.
1072
+ */
1073
+ "view/expand-tile": {
1074
+ args: {
1075
+ direction: import("./index").TileLayoutDirection };
1076
+ response: import("./index").TileLayoutState;
1077
+ };
1019
1078
  /**
1020
1079
  * Start dragging caller's own view.
1021
1080
  */
@@ -1046,7 +1105,8 @@ export interface ViewCommands {
1046
1105
  "view/start-resize": {
1047
1106
  args: {
1048
1107
  startX: number;
1049
- startY: number };
1108
+ startY: number;
1109
+ direction?: "left" | "right" | "bottom" | "bottom-left" | "bottom-right" };
1050
1110
  response: { success: boolean };
1051
1111
  };
1052
1112
  /**
@@ -47,7 +47,7 @@ export interface FilePickerEvents {
47
47
  * FsEvents - Events for the "fs" namespace
48
48
  */
49
49
  export interface FsEvents {
50
- "fs/changed": { watchId: string; kind: FilesystemChangeKind };
50
+ "fs/changed": { watchId: string; kind: import("./index").FilesystemChangeKind };
51
51
  }
52
52
 
53
53
  /**
@@ -73,8 +73,9 @@ export interface NotificationEvents {
73
73
  * PackageEvents - Events for the "package" namespace
74
74
  */
75
75
  export interface PackageEvents {
76
- "package/installed": { manifest: import("./index").RuntimeAppManifest };
77
- "package/uninstalled": { appId: string };
76
+ "package/installed": { manifest: import("./index").InstalledPackageManifest };
77
+ "package/uninstalled": | { kind: "app"; packageId: string }
78
+ | { kind: "dlc"; packageId: string; hostAppId: string };
78
79
  }
79
80
 
80
81
  /**
@@ -106,6 +107,8 @@ export interface SettingsEvents {
106
107
  "settings/changed": { appId: string; key: string; value: string };
107
108
  "settings/panels-changed": {
108
109
  reason: "catalog" | "grants" | "session" | "state" | "visibility";
110
+ /** Limits a state refresh to one panel when supplied. */
111
+ panelId?: string;
109
112
  };
110
113
  }
111
114
 
@@ -120,7 +123,7 @@ export interface UserEvents {
120
123
  * ViewEvents - Events for the "view" namespace
121
124
  */
122
125
  export interface ViewEvents {
123
- "view/view-removed": { viewId: number; appId: string };
126
+ "view/view-removed": { viewId: number; appId: string; webContentsId: number };
124
127
  "view/bounds-updated": import("./index").ViewBounds;
125
128
  "view/interface-scale-changed": { scale: number };
126
129
  "view/view-loaded": { viewId: number; appId: string; overlay: boolean };
package/index.d.ts CHANGED
@@ -7,10 +7,12 @@ export * from "./GrantCatalog";
7
7
  export * from "./global";
8
8
  export * from "./ipc";
9
9
  export * from "./keyboard";
10
+ export * from "./Package";
10
11
  export * from "./Process";
11
12
  export * from "./ProcessMetrics";
12
13
  export * from "./SettingsPanel";
13
14
  export * from "./User";
15
+ export * from "./View";
14
16
  export * from "./worker";
15
17
 
16
18
  /**
@@ -113,6 +115,9 @@ export interface FileStats {
113
115
  mtime: Date;
114
116
  }
115
117
 
118
+ /** Kind of update delivered by a filesystem watch subscription. */
119
+ export type FilesystemChangeKind = "change" | "watch-error";
120
+
116
121
  /** Arguments shared by the recursive filesystem copy and move commands. */
117
122
  export interface FilesystemTransferArgs {
118
123
  from: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edenapp/types",
3
- "version": "0.12.1",
3
+ "version": "0.14.0",
4
4
  "description": "TypeScript type definitions for the Eden platform",
5
5
  "types": "index.d.ts",
6
6
  "author": "Dariusz Majnert",