@edenapp/types 0.5.2 → 0.6.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @edenapp/types
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - error while publishing
8
+
9
+ ## 0.6.1
10
+
11
+ ## 0.6.0
12
+
13
+ ### Minor Changes
14
+
15
+ - add fs/mv fs/cp
16
+ unify dialogs api through solid-kit
17
+ add process manager app
18
+
3
19
  ## 0.5.2
4
20
 
5
21
  ### Patch Changes
@@ -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
  /**
@@ -523,6 +538,21 @@ export interface ProcessCommands {
523
538
  args: { showHidden?: boolean };
524
539
  response: import("./index").AppInstance[];
525
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
+ };
526
556
  }
527
557
 
528
558
  /**
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.2",
3
+ "version": "0.6.2",
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
  }