@edenapp/types 0.5.1 → 0.6.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
@@ -13,7 +13,8 @@ export type WindowMode = "floating" | "tiled" | "both";
13
13
  * - "tokens": Inject only CSS custom property definitions
14
14
  * - "none": Don't inject any CSS
15
15
  */
16
- export type CSSInjectionMode = "full" | "tokens" | "none";
16
+ export type CSSInjectionMode = "none" | "tokens" | "full";
17
+ export type AppFrameInjectionMode = "none" | "window-only" | "full" | boolean;
17
18
 
18
19
  export interface WindowInjectionOptions {
19
20
  /**
@@ -24,8 +25,13 @@ export interface WindowInjectionOptions {
24
25
  */
25
26
  css?: CSSInjectionMode;
26
27
 
27
- /** Inject the Eden app frame with title bar controls (default: true) */
28
- appFrame?: boolean;
28
+ /**
29
+ * Inject Eden app frame runtime and visuals (default: true).
30
+ * - true | "full": full Eden frame (rounded container + system top bar controls)
31
+ * - "window-only": keep frame runtime/container, but app renders its own top bar
32
+ * - false | "none": disable app frame injection entirely
33
+ */
34
+ appFrame?: AppFrameInjectionMode;
29
35
  }
30
36
 
31
37
  export interface WindowConfig {
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @edenapp/types
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - add fs/mv fs/cp
8
+ unify dialogs api through solid-kit
9
+ add process manager app
10
+
11
+ ## 0.5.2
12
+
13
+ ### Patch Changes
14
+
15
+ - gate view and process endpoints and add "window-only" inejction mode to appframe
16
+
3
17
  ## 0.5.1
4
18
 
5
19
  ## 0.5.0
@@ -0,0 +1,127 @@
1
+ /**
2
+ * CPU usage sample for a tracked Eden process.
3
+ */
4
+ export interface EdenProcessCpuUsage {
5
+ /** CPU usage percentage since the previous sample. */
6
+ percentCPUUsage: number;
7
+
8
+ /** Total CPU time in seconds since process startup, when available. */
9
+ cumulativeCPUUsage?: number;
10
+
11
+ /** Average idle wakeups per second since the previous sample. */
12
+ idleWakeupsPerSecond: number;
13
+ }
14
+
15
+ /**
16
+ * Memory usage sample for a tracked Eden process.
17
+ *
18
+ * All values are reported in kilobytes.
19
+ */
20
+ export interface EdenProcessMemoryUsage {
21
+ /** Memory currently pinned to physical RAM. */
22
+ workingSetSize: number;
23
+
24
+ /** Peak working set size. */
25
+ peakWorkingSetSize: number;
26
+
27
+ /** Memory private to the process, when available. */
28
+ privateBytes?: number;
29
+ }
30
+
31
+ /**
32
+ * A single Electron process attributed to an Eden app or to shared/system work.
33
+ */
34
+ export interface EdenProcessMetric {
35
+ /** OS process id. */
36
+ pid: number;
37
+
38
+ /** Creation time in milliseconds since the Unix epoch. */
39
+ creationTime: number;
40
+
41
+ /** Eden-level grouping used by the task manager. */
42
+ category: "renderer" | "backend" | "shared";
43
+
44
+ /** Electron/Chromium process type, e.g. "Tab", "Utility", "GPU". */
45
+ processType: string;
46
+
47
+ /** Electron utility service name, when available. */
48
+ serviceName?: string;
49
+
50
+ /** Human-readable process name, when available. */
51
+ name?: string;
52
+
53
+ /** Eden app id if this process belongs to an app. */
54
+ appId?: string;
55
+
56
+ /** Eden view id for renderer processes. */
57
+ viewId?: number;
58
+
59
+ /** CPU usage snapshot. */
60
+ cpu: EdenProcessCpuUsage;
61
+
62
+ /** Memory usage snapshot. */
63
+ memory: EdenProcessMemoryUsage;
64
+ }
65
+
66
+ /**
67
+ * Aggregated resource usage for a running Eden app instance.
68
+ */
69
+ export interface AppProcessMetrics {
70
+ /** Running app instance metadata. */
71
+ instance: import("./index").AppInstance;
72
+
73
+ /** Sum of CPU usage across app-owned processes. */
74
+ totalCPUPercent: number;
75
+
76
+ /** Sum of working set memory across app-owned processes, in KB. */
77
+ totalMemoryWorkingSetSize: number;
78
+
79
+ /** Sum of peak working set memory across app-owned processes, in KB. */
80
+ totalMemoryPeakWorkingSetSize: number;
81
+
82
+ /** Renderer process metrics, when the app has a frontend. */
83
+ renderer?: EdenProcessMetric;
84
+
85
+ /** Backend utility process metrics, when the app has a backend. */
86
+ backend?: EdenProcessMetric;
87
+ }
88
+
89
+ /**
90
+ * Aggregate totals for a process metrics snapshot.
91
+ */
92
+ export interface ProcessMetricsTotals {
93
+ /** CPU used by tracked Eden app processes. */
94
+ appCPUPercent: number;
95
+
96
+ /** CPU used by unattributed Electron processes. */
97
+ sharedCPUPercent: number;
98
+
99
+ /** Total CPU usage across all Electron app metrics. */
100
+ overallCPUPercent: number;
101
+
102
+ /** Working set memory used by tracked Eden app processes, in KB. */
103
+ appMemoryWorkingSetSize: number;
104
+
105
+ /** Working set memory used by unattributed Electron processes, in KB. */
106
+ sharedMemoryWorkingSetSize: number;
107
+
108
+ /** Total working set memory across all Electron app metrics, in KB. */
109
+ overallMemoryWorkingSetSize: number;
110
+ }
111
+
112
+ /**
113
+ * Full snapshot used by the Eden task manager/profiler.
114
+ */
115
+ export interface ProcessMetricsSnapshot {
116
+ /** ISO timestamp describing when the sample was created. */
117
+ sampledAt: string;
118
+
119
+ /** Per-app resource usage. */
120
+ apps: AppProcessMetrics[];
121
+
122
+ /** Electron processes that cannot be safely attributed to a single Eden app. */
123
+ sharedProcesses: EdenProcessMetric[];
124
+
125
+ /** Aggregate totals for the sample. */
126
+ totals: ProcessMetricsTotals;
127
+ }
@@ -357,6 +357,21 @@ export interface FsCommands {
357
357
  args: { path: string };
358
358
  response: void;
359
359
  };
360
+ /**
361
+ * Copy a file or directory.
362
+ * Directories are copied recursively.
363
+ */
364
+ "fs/cp": {
365
+ args: { from: string; to: string };
366
+ response: void;
367
+ };
368
+ /**
369
+ * Move or rename a file or directory.
370
+ */
371
+ "fs/mv": {
372
+ args: { from: string; to: string };
373
+ response: void;
374
+ };
360
375
  }
361
376
 
362
377
  /**
@@ -490,6 +505,7 @@ export interface PackageCommands {
490
505
  export interface ProcessCommands {
491
506
  /**
492
507
  * Launch an application instance.
508
+ * Requires "process/manage" permission.
493
509
  */
494
510
  "process/launch": {
495
511
  args: {
@@ -499,19 +515,44 @@ export interface ProcessCommands {
499
515
  };
500
516
  /**
501
517
  * Stop a running application instance.
518
+ * Requires "process/manage" permission.
502
519
  */
503
520
  "process/stop": {
504
521
  args: { appId: string };
505
522
  response: { success: boolean };
506
523
  };
524
+ /**
525
+ * Stop the caller app instance.
526
+ * No explicit permission required - this endpoint only allows self-exit.
527
+ */
528
+ "process/exit": {
529
+ args: { };
530
+ response: { success: boolean };
531
+ };
507
532
  /**
508
533
  * List all running application processes.
534
+ * Requires "process/read" permission.
509
535
  * @param showHidden - If true, includes overlay apps (hidden by default)
510
536
  */
511
537
  "process/list": {
512
538
  args: { showHidden?: boolean };
513
539
  response: import("./index").AppInstance[];
514
540
  };
541
+ /**
542
+ * Return CPU and memory metrics for running Eden apps.
543
+ * Requires "process/read" permission.
544
+ * @param showHidden - If true, includes overlay apps and backend-only apps
545
+ * @param pollingTimeoutMs - How long main should keep the shared sampler alive
546
+ * @param waitForAccurateCpu - If false, returns the current sample immediately,
547
+ * even before Electron has a full CPU interval
548
+ */
549
+ "process/metrics": {
550
+ args: {
551
+ showHidden?: boolean;
552
+ pollingTimeoutMs?: number;
553
+ waitForAccurateCpu?: boolean };
554
+ response: import("./index").ProcessMetricsSnapshot;
555
+ };
515
556
  }
516
557
 
517
558
  /**
@@ -730,7 +771,16 @@ export interface UserCommands {
730
771
  */
731
772
  export interface ViewCommands {
732
773
  /**
733
- * Update the bounds (position and size) of a specific view.
774
+ * Update bounds for the caller's own view.
775
+ */
776
+ "view/update-bounds": {
777
+ args: {
778
+ bounds: import("./index").ViewBounds };
779
+ response: { success: boolean };
780
+ };
781
+ /**
782
+ * Update bounds for any app view.
783
+ * Requires "view/manage" permission.
734
784
  */
735
785
  "view/update-view-bounds": {
736
786
  args: {
@@ -739,7 +789,16 @@ export interface ViewCommands {
739
789
  response: { success: boolean };
740
790
  };
741
791
  /**
742
- * Show or hide a specific view.
792
+ * Show or hide the caller's own view.
793
+ */
794
+ "view/set-visibility": {
795
+ args: {
796
+ visible: boolean };
797
+ response: { success: boolean };
798
+ };
799
+ /**
800
+ * Show or hide any app view.
801
+ * Requires "view/manage" permission.
743
802
  */
744
803
  "view/set-view-visibility": {
745
804
  args: {
@@ -748,14 +807,24 @@ export interface ViewCommands {
748
807
  response: { success: boolean };
749
808
  };
750
809
  /**
751
- * Bring an application's view to the front and focus it.
810
+ * Bring caller's own view to the front and focus it.
752
811
  */
753
- "view/focus-app": {
754
- args: { appId: string };
812
+ "view/focus": {
813
+ args: { };
814
+ response: { success: boolean };
815
+ };
816
+ /**
817
+ * Bring any app view to the front and focus it.
818
+ * Requires "view/manage" permission.
819
+ */
820
+ "view/focus-view": {
821
+ args: {
822
+ appId: string };
755
823
  response: { success: boolean };
756
824
  };
757
825
  /**
758
826
  * Update the available workspace bounds (e.g. after taskbar resize).
827
+ * Requires "view/manage" permission for app callers.
759
828
  */
760
829
  "view/update-global-bounds": {
761
830
  args: {
@@ -764,7 +833,16 @@ export interface ViewCommands {
764
833
  response: { success: boolean };
765
834
  };
766
835
  /**
767
- * Toggle between floating and tiled window modes.
836
+ * Toggle caller's own view between floating and tiled window modes.
837
+ */
838
+ "view/toggle-mode": {
839
+ args: {
840
+ mode?: "floating" | "tiled" };
841
+ response: { success: boolean };
842
+ };
843
+ /**
844
+ * Toggle any app view between floating and tiled window modes.
845
+ * Requires "view/manage" permission.
768
846
  */
769
847
  "view/toggle-view-mode": {
770
848
  args: {
@@ -773,45 +851,43 @@ export interface ViewCommands {
773
851
  response: { success: boolean };
774
852
  };
775
853
  /**
776
- * Start dragging a window.
854
+ * Start dragging caller's own view.
777
855
  */
778
856
  "view/start-drag": {
779
857
  args: {
780
- appId: string;
781
858
  startX: number;
782
859
  startY: number };
783
860
  response: { success: boolean };
784
861
  };
785
862
  /**
786
- * End the current drag operation.
863
+ * End drag operation for caller's own view.
787
864
  */
788
865
  "view/end-drag": {
789
- args: { appId: string };
866
+ args: { };
790
867
  response: { success: boolean };
791
868
  };
792
869
  /**
793
870
  * Handle global mouse up event to stop any active drag/resize operations.
871
+ * Requires "view/manage" permission for app callers.
794
872
  */
795
873
  "view/global-mouseup": {
796
874
  args: Record<string, never>;
797
875
  response: { success: boolean };
798
876
  };
799
877
  /**
800
- * Start resizing a window.
878
+ * Start resizing caller's own view.
801
879
  */
802
880
  "view/start-resize": {
803
881
  args: {
804
- appId: string;
805
882
  startX: number;
806
883
  startY: number };
807
884
  response: { success: boolean };
808
885
  };
809
886
  /**
810
- * End the current resize operation.
887
+ * End resize operation for caller's own view.
811
888
  */
812
889
  "view/end-resize": {
813
- args: {
814
- appId: string };
890
+ args: { };
815
891
  response: { success: boolean };
816
892
  };
817
893
  /**
package/global.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  // Ambient declarations for renderer globals
2
2
 
3
+ import type { AppFrameInjectionMode, CSSInjectionMode } from "./AppManifest";
3
4
  import type { EdenAPI, AppBusAPI, AppBusConnection } from "./ipc";
4
5
 
5
6
  export interface EdenFrame {
6
7
  // Public API
7
8
  setTitle: (title: string) => void;
8
9
  resetTitle: () => void;
10
+ close: () => Promise<void>;
11
+ minimize: () => Promise<void>;
12
+ toggleMode: () => Promise<void>;
9
13
 
10
14
  // Internal state (used by frame system)
11
15
  _internal: {
@@ -21,6 +25,10 @@ export interface EdenFrame {
21
25
  resizable?: boolean;
22
26
  minSize?: { width: number; height: number };
23
27
  maxSize?: { width: number; height: number };
28
+ injections?: {
29
+ css?: CSSInjectionMode;
30
+ appFrame?: AppFrameInjectionMode;
31
+ };
24
32
  };
25
33
  currentMode: "tiled" | "floating";
26
34
  bounds: {
@@ -53,6 +61,3 @@ declare global {
53
61
  edenFrame?: EdenFrame;
54
62
  }
55
63
  }
56
-
57
- // This export is important - it marks the file as a module
58
- export {};
package/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from "./EdenSeedConfig";
5
5
  export * from "./User";
6
6
 
7
7
  export * from "./AppManifest";
8
+ export * from "./ProcessMetrics";
8
9
 
9
10
  export * from "./global";
10
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edenapp/types",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "TypeScript type definitions for the Eden platform",
5
5
  "types": "index.d.ts",
6
6
  "author": "Dariusz Majnert",
@@ -17,6 +17,6 @@
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "https://github.com/b0czek/eden.git",
20
- "directory": "src/types"
20
+ "directory": "packages/types"
21
21
  }
22
22
  }