@danielng23/dsh-studio-host-system-metrics 0.1.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/README.md +34 -0
- package/lib/index.js +697 -0
- package/lib/invariant.js +13 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +356 -0
- package/lib/typert.remote-client.d.ts +32 -0
- package/lib/typert.remote-client.js +241 -0
- package/lib/types/index.d.ts +65 -0
- package/lib/types/index.js +533 -0
- package/lib/types/invariant.d.ts +9 -0
- package/lib/types/invariant.js +11 -0
- package/lib/types/types.d.ts +148 -0
- package/lib/types/types.js +2 -0
- package/package.json +64 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_parameter_0$schema = z.string()
|
|
5
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_result$schema = z.object({
|
|
6
|
+
'path': z.string().readonly(),
|
|
7
|
+
'entries': z.array(z.object({
|
|
8
|
+
'name': z.string().readonly(),
|
|
9
|
+
'isDirectory': z.boolean().readonly(),
|
|
10
|
+
})).readonly(),
|
|
11
|
+
'error': z.union([z.literal(null), z.string()]).readonly(),
|
|
12
|
+
})
|
|
13
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_overview_result$schema = z.object({
|
|
14
|
+
'timestamp': z.number().readonly(),
|
|
15
|
+
'platform': z.string().readonly(),
|
|
16
|
+
'uptimeSeconds': z.number().readonly(),
|
|
17
|
+
'loadavg': z.tuple([z.number(), z.number(), z.number()]).readonly(),
|
|
18
|
+
'memory': z.object({
|
|
19
|
+
'totalBytes': z.number().readonly(),
|
|
20
|
+
'usedBytes': z.number().readonly(),
|
|
21
|
+
}).readonly(),
|
|
22
|
+
'swap': z.object({
|
|
23
|
+
'totalBytes': z.number().readonly(),
|
|
24
|
+
'usedBytes': z.number().readonly(),
|
|
25
|
+
}).readonly(),
|
|
26
|
+
'cores': z.array(z.object({
|
|
27
|
+
'user': z.number().readonly(),
|
|
28
|
+
'nice': z.number().readonly(),
|
|
29
|
+
'sys': z.number().readonly(),
|
|
30
|
+
'idle': z.number().readonly(),
|
|
31
|
+
'irq': z.number().readonly(),
|
|
32
|
+
})).readonly(),
|
|
33
|
+
'thermalLevel': z.union([z.literal(null), z.number()]).readonly(),
|
|
34
|
+
'powerState': z.union([z.literal(null), z.string()]).readonly(),
|
|
35
|
+
'hardware': z.object({
|
|
36
|
+
'manufacturer': z.string().readonly(),
|
|
37
|
+
'model': z.string().readonly(),
|
|
38
|
+
'chassis': z.string().readonly(),
|
|
39
|
+
}).readonly(),
|
|
40
|
+
'tasks': z.number().readonly(),
|
|
41
|
+
'processes': z.array(z.object({
|
|
42
|
+
'pid': z.number().readonly(),
|
|
43
|
+
'name': z.string().readonly(),
|
|
44
|
+
'cpuPct': z.number().readonly(),
|
|
45
|
+
'memPct': z.number().readonly(),
|
|
46
|
+
})).readonly(),
|
|
47
|
+
'network': z.object({
|
|
48
|
+
'interfaceName': z.string().readonly(),
|
|
49
|
+
'state': z.string().readonly(),
|
|
50
|
+
'ip': z.union([z.literal(null), z.string()]).readonly(),
|
|
51
|
+
'pingMs': z.union([z.literal(null), z.number()]).readonly(),
|
|
52
|
+
'rxBytes': z.number().readonly(),
|
|
53
|
+
'txBytes': z.number().readonly(),
|
|
54
|
+
}).readonly(),
|
|
55
|
+
'storage': z.object({
|
|
56
|
+
'path': z.string().readonly(),
|
|
57
|
+
'totalBytes': z.number().readonly(),
|
|
58
|
+
'usedBytes': z.number().readonly(),
|
|
59
|
+
'usedPct': z.number().readonly(),
|
|
60
|
+
}).readonly(),
|
|
61
|
+
})
|
|
62
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_parameter_0$schema = z.string()
|
|
63
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_result$schema = z.object({
|
|
64
|
+
'path': z.string().readonly(),
|
|
65
|
+
'kind': z.union([z.literal("text"), z.literal("image"), z.literal("video"), z.literal("unsupported")]).readonly(),
|
|
66
|
+
'mime': z.string().readonly(),
|
|
67
|
+
'sizeBytes': z.number().readonly(),
|
|
68
|
+
'truncated': z.boolean().readonly(),
|
|
69
|
+
'text': z.union([z.literal(null), z.string()]).readonly(),
|
|
70
|
+
'dataUrl': z.union([z.literal(null), z.string()]).readonly(),
|
|
71
|
+
'error': z.union([z.literal(null), z.string()]).readonly(),
|
|
72
|
+
})
|
|
73
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_parameter_0$schema = z.string()
|
|
74
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_result$schema = z.object({
|
|
75
|
+
'stdout': z.string().readonly(),
|
|
76
|
+
'stderr': z.string().readonly(),
|
|
77
|
+
'exitCode': z.union([z.literal(null), z.number()]).readonly(),
|
|
78
|
+
})
|
|
79
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_snapshot_result$schema = z.object({
|
|
80
|
+
'loadavg': z.tuple([z.number(), z.number(), z.number()]).readonly(),
|
|
81
|
+
'cpuBusyRatio': z.number().readonly(),
|
|
82
|
+
'totalMemoryBytes': z.number().readonly(),
|
|
83
|
+
'freeMemoryBytes': z.number().readonly(),
|
|
84
|
+
'uptimeSeconds': z.number().readonly(),
|
|
85
|
+
'timestamp': z.number().readonly(),
|
|
86
|
+
})
|
|
87
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_0$schema = z.string()
|
|
88
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_1$schema = z.string()
|
|
89
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_result$schema = z.object({
|
|
90
|
+
'path': z.string().readonly(),
|
|
91
|
+
'sizeBytes': z.number().readonly(),
|
|
92
|
+
'error': z.union([z.literal(null), z.string()]).readonly(),
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const TYPERT = {
|
|
96
|
+
package: '@danielng23/dsh-studio-host-system-metrics',
|
|
97
|
+
face: 'host',
|
|
98
|
+
schemas: [
|
|
99
|
+
],
|
|
100
|
+
invocations: [
|
|
101
|
+
{
|
|
102
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/listDirectory',
|
|
103
|
+
service: 'systemMetrics',
|
|
104
|
+
namespace: 'systemMetrics',
|
|
105
|
+
method: 'listDirectory',
|
|
106
|
+
invocation: { kind: 'direct' },
|
|
107
|
+
parameters: [
|
|
108
|
+
{
|
|
109
|
+
name: 'path',
|
|
110
|
+
wire: 'path',
|
|
111
|
+
source: 'json',
|
|
112
|
+
codec: {
|
|
113
|
+
mode: 'strict',
|
|
114
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/listDirectory:path',
|
|
115
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_parameter_0$schema,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
result: {
|
|
120
|
+
mode: 'strict',
|
|
121
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#DirectoryListing',
|
|
122
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_result$schema,
|
|
123
|
+
},
|
|
124
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":293,"column":9},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/overview',
|
|
128
|
+
service: 'systemMetrics',
|
|
129
|
+
namespace: 'systemMetrics',
|
|
130
|
+
method: 'overview',
|
|
131
|
+
invocation: { kind: 'direct' },
|
|
132
|
+
parameters: [
|
|
133
|
+
],
|
|
134
|
+
result: {
|
|
135
|
+
mode: 'strict',
|
|
136
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#SystemOverview',
|
|
137
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_overview_result$schema,
|
|
138
|
+
},
|
|
139
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":246,"column":9},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/readFile',
|
|
143
|
+
service: 'systemMetrics',
|
|
144
|
+
namespace: 'systemMetrics',
|
|
145
|
+
method: 'readFile',
|
|
146
|
+
invocation: { kind: 'direct' },
|
|
147
|
+
parameters: [
|
|
148
|
+
{
|
|
149
|
+
name: 'path',
|
|
150
|
+
wire: 'path',
|
|
151
|
+
source: 'json',
|
|
152
|
+
codec: {
|
|
153
|
+
mode: 'strict',
|
|
154
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/readFile:path',
|
|
155
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_parameter_0$schema,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
result: {
|
|
160
|
+
mode: 'strict',
|
|
161
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#FilePreview',
|
|
162
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_result$schema,
|
|
163
|
+
},
|
|
164
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":316,"column":9},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/runCommand',
|
|
168
|
+
service: 'systemMetrics',
|
|
169
|
+
namespace: 'systemMetrics',
|
|
170
|
+
method: 'runCommand',
|
|
171
|
+
invocation: { kind: 'direct' },
|
|
172
|
+
parameters: [
|
|
173
|
+
{
|
|
174
|
+
name: 'command',
|
|
175
|
+
wire: 'command',
|
|
176
|
+
source: 'json',
|
|
177
|
+
codec: {
|
|
178
|
+
mode: 'strict',
|
|
179
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/runCommand:command',
|
|
180
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_parameter_0$schema,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
result: {
|
|
185
|
+
mode: 'strict',
|
|
186
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#CommandResult',
|
|
187
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_result$schema,
|
|
188
|
+
},
|
|
189
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":402,"column":9},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/snapshot',
|
|
193
|
+
service: 'systemMetrics',
|
|
194
|
+
namespace: 'systemMetrics',
|
|
195
|
+
method: 'snapshot',
|
|
196
|
+
invocation: { kind: 'direct' },
|
|
197
|
+
parameters: [
|
|
198
|
+
],
|
|
199
|
+
result: {
|
|
200
|
+
mode: 'strict',
|
|
201
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#SystemMetricsSnapshot',
|
|
202
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_snapshot_result$schema,
|
|
203
|
+
},
|
|
204
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":228,"column":3},
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/writeFile',
|
|
208
|
+
service: 'systemMetrics',
|
|
209
|
+
namespace: 'systemMetrics',
|
|
210
|
+
method: 'writeFile',
|
|
211
|
+
invocation: { kind: 'direct' },
|
|
212
|
+
parameters: [
|
|
213
|
+
{
|
|
214
|
+
name: 'path',
|
|
215
|
+
wire: 'path',
|
|
216
|
+
source: 'json',
|
|
217
|
+
codec: {
|
|
218
|
+
mode: 'strict',
|
|
219
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/writeFile:path',
|
|
220
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_0$schema,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'content',
|
|
225
|
+
wire: 'content',
|
|
226
|
+
source: 'json',
|
|
227
|
+
codec: {
|
|
228
|
+
mode: 'strict',
|
|
229
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/writeFile:content',
|
|
230
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_1$schema,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
result: {
|
|
235
|
+
mode: 'strict',
|
|
236
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#WriteResult',
|
|
237
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_result$schema,
|
|
238
|
+
},
|
|
239
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":381,"column":9},
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
model: {
|
|
243
|
+
"services": [
|
|
244
|
+
{
|
|
245
|
+
"description": "Remote-only service exposing host resource snapshots to the browser. Every snapshot is projected directly from `node:os` at call time; no cache exists to synchronize.",
|
|
246
|
+
"summary": "Remote-only service exposing host resource snapshots to the browser.",
|
|
247
|
+
"tags": [
|
|
248
|
+
{
|
|
249
|
+
"name": "typert",
|
|
250
|
+
"comment": "service systemMetrics",
|
|
251
|
+
"text": "@typert service systemMetrics"
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"jsDoc": "/**\n * Remote-only service exposing host resource snapshots to the browser. Every\n * snapshot is projected directly from `node:os` at call time; no cache exists\n * to synchronize.\n * @typert service systemMetrics\n */",
|
|
255
|
+
"key": "systemMetrics",
|
|
256
|
+
"exportName": "SystemMetricsService",
|
|
257
|
+
"members": [
|
|
258
|
+
{
|
|
259
|
+
"kind": "method",
|
|
260
|
+
"name": "snapshot",
|
|
261
|
+
"signature": "@Remote('snapshot') snapshot(): SystemMetricsSnapshot",
|
|
262
|
+
"summary": "Read the current host resource state.",
|
|
263
|
+
"jsDoc": "/**\n * Read the current host resource state.\n * @returns load averages, since-boot CPU busy ratio, memory, and uptime.\n */"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"kind": "method",
|
|
267
|
+
"name": "overview",
|
|
268
|
+
"signature": "@Remote('overview') async overview(): Promise<SystemOverview>",
|
|
269
|
+
"summary": "Read the rich system overview for the left system panel: per-core CPU tick counts (the client computes usage deltas between polls), memory and swap, thermal/power/hardware (best-effort), and top processes.",
|
|
270
|
+
"jsDoc": "/**\n * Read the rich system overview for the left system panel: per-core CPU\n * tick counts (the client computes usage deltas between polls), memory and\n * swap, thermal/power/hardware (best-effort), and top processes.\n * @returns the overview.\n */"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"kind": "method",
|
|
274
|
+
"name": "listDirectory",
|
|
275
|
+
"signature": "@Remote('listDirectory') async listDirectory(path: string): Promise<DirectoryListing>",
|
|
276
|
+
"summary": "List one directory for the filesystem browser.",
|
|
277
|
+
"jsDoc": "/**\n * List one directory for the filesystem browser.\n * @param path - absolute directory to list.\n * @returns the listing (or an error string when unreadable).\n */"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"kind": "method",
|
|
281
|
+
"name": "readFile",
|
|
282
|
+
"signature": "@Remote('readFile') async readFile(path: string): Promise<FilePreview>",
|
|
283
|
+
"summary": "Read one file for the bottom-right preview pane / editor.",
|
|
284
|
+
"jsDoc": "/**\n * Read one file for the bottom-right preview pane / editor. Text payloads\n * are capped at 4 MiB, images at 4 MiB, videos at 12 MiB; oversized files\n * are truncated and flagged rather than refused. Kind is decided by\n * extension with a UTF-8 sniff fallback for unknown extensions.\n * @param path - absolute file path.\n * @returns the preview payload (or an error string when unreadable).\n */"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"kind": "method",
|
|
288
|
+
"name": "writeFile",
|
|
289
|
+
"signature": "@Remote('writeFile') async writeFile(path: string, content: string): Promise<WriteResult>",
|
|
290
|
+
"summary": "Write one text file from the bottom-right editor.",
|
|
291
|
+
"jsDoc": "/**\n * Write one text file from the bottom-right editor. Creates or replaces the\n * file at `path` with the given UTF-8 content; the parent directory must\n * exist. Trust surface matches `readFile`: the GUI already reads arbitrary\n * paths the host process can reach, so writing carries the same parity.\n * @param path - absolute file path.\n * @param content - full text content to persist.\n * @returns the write result (or an error string when unwritable).\n */"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"kind": "method",
|
|
295
|
+
"name": "runCommand",
|
|
296
|
+
"signature": "@Remote('runCommand') async runCommand(command: string): Promise<CommandResult>",
|
|
297
|
+
"summary": "Run one shell command for the bottom-right terminal panel.",
|
|
298
|
+
"jsDoc": "/**\n * Run one shell command for the bottom-right terminal panel. Executes\n * `command` through `sh -c` with a 30s timeout and a 4 MiB output cap.\n * Non-zero exits return the captured output with the real exit code; a\n * command that cannot start (or times out) returns exitCode null.\n * Trust surface matches `writeFile`: the GUI already reads and writes\n * arbitrary paths the host process can reach, so executing commands the\n * operator types carries the same parity.\n * @param command - the shell command line to execute.\n * @returns captured stdout/stderr and the exit code.\n */"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"types": [
|
|
302
|
+
{
|
|
303
|
+
"name": "CommandResult",
|
|
304
|
+
"declaration": "export interface CommandResult {\n readonly stdout: string;\n readonly stderr: string;\n readonly exitCode: number | null;\n}"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "CoreTimes",
|
|
308
|
+
"declaration": "export interface CoreTimes {\n readonly user: number;\n readonly nice: number;\n readonly sys: number;\n readonly idle: number;\n readonly irq: number;\n}"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "DirectoryEntry",
|
|
312
|
+
"declaration": "export interface DirectoryEntry {\n readonly name: string;\n readonly isDirectory: boolean;\n}"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "DirectoryListing",
|
|
316
|
+
"declaration": "export interface DirectoryListing {\n readonly path: string;\n readonly entries: readonly DirectoryEntry[];\n readonly error: string | null;\n}"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "FilePreview",
|
|
320
|
+
"declaration": "export interface FilePreview {\n readonly path: string;\n readonly kind: 'text' | 'image' | 'video' | 'unsupported';\n readonly mime: string;\n readonly sizeBytes: number;\n readonly truncated: boolean;\n readonly text: string | null;\n readonly dataUrl: string | null;\n readonly error: string | null;\n}"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "HardwareInfo",
|
|
324
|
+
"declaration": "export interface HardwareInfo {\n readonly manufacturer: string;\n readonly model: string;\n readonly chassis: string;\n}"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "NetworkInfo",
|
|
328
|
+
"declaration": "export interface NetworkInfo {\n readonly interfaceName: string;\n readonly state: string;\n readonly ip: string | null;\n readonly pingMs: number | null;\n readonly rxBytes: number;\n readonly txBytes: number;\n}"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "ProcessSample",
|
|
332
|
+
"declaration": "export interface ProcessSample {\n readonly pid: number;\n readonly name: string;\n readonly cpuPct: number;\n readonly memPct: number;\n}"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "StorageInfo",
|
|
336
|
+
"declaration": "export interface StorageInfo {\n readonly path: string;\n readonly totalBytes: number;\n readonly usedBytes: number;\n readonly usedPct: number;\n}"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "SystemMetricsSnapshot",
|
|
340
|
+
"declaration": "export interface SystemMetricsSnapshot {\n readonly loadavg: readonly [number, number, number];\n readonly cpuBusyRatio: number;\n readonly totalMemoryBytes: number;\n readonly freeMemoryBytes: number;\n readonly uptimeSeconds: number;\n readonly timestamp: number;\n}"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "SystemOverview",
|
|
344
|
+
"declaration": "export interface SystemOverview {\n readonly timestamp: number;\n readonly platform: string;\n readonly uptimeSeconds: number;\n readonly loadavg: readonly [number, number, number];\n readonly memory: { readonly totalBytes: number; readonly usedBytes: number; };\n readonly swap: { readonly totalBytes: number; readonly usedBytes: number; };\n readonly cores: readonly CoreTimes[];\n readonly thermalLevel: number | null;\n readonly powerState: string | null;\n readonly hardware: HardwareInfo;\n readonly tasks: number;\n readonly processes: readonly ProcessSample[];\n readonly network: NetworkInfo;\n readonly storage: StorageInfo;\n}"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"name": "WriteResult",
|
|
348
|
+
"declaration": "export interface WriteResult {\n readonly path: string;\n readonly sizeBytes: number;\n readonly error: string | null;\n}"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"events": [],
|
|
354
|
+
"objects": []
|
|
355
|
+
},
|
|
356
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import type {
|
|
3
|
+
RemoteResult,
|
|
4
|
+
TypertRemoteContribution,
|
|
5
|
+
} from '@deepseek-ai/dsh-typert-protocol'
|
|
6
|
+
import type { CommandResult, DirectoryListing, FilePreview, SystemMetricsSnapshot, SystemOverview, WriteResult } from '@danielng23/dsh-studio-host-system-metrics/types'
|
|
7
|
+
|
|
8
|
+
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
9
|
+
interface TypertRemoteNamespace$73797374656d4d657472696373 {
|
|
10
|
+
listDirectory: (path: string) => Promise<RemoteResult<DirectoryListing>>
|
|
11
|
+
overview: () => Promise<RemoteResult<SystemOverview>>
|
|
12
|
+
readFile: (path: string) => Promise<RemoteResult<FilePreview>>
|
|
13
|
+
runCommand: (command: string) => Promise<RemoteResult<CommandResult>>
|
|
14
|
+
snapshot: () => Promise<RemoteResult<SystemMetricsSnapshot>>
|
|
15
|
+
writeFile: (path: string, content: string) => Promise<RemoteResult<WriteResult>>
|
|
16
|
+
}
|
|
17
|
+
interface TypertRemoteMap {
|
|
18
|
+
'systemMetrics/listDirectory': (path: string) => Promise<RemoteResult<DirectoryListing>>
|
|
19
|
+
'systemMetrics/overview': () => Promise<RemoteResult<SystemOverview>>
|
|
20
|
+
'systemMetrics/readFile': (path: string) => Promise<RemoteResult<FilePreview>>
|
|
21
|
+
'systemMetrics/runCommand': (command: string) => Promise<RemoteResult<CommandResult>>
|
|
22
|
+
'systemMetrics/snapshot': () => Promise<RemoteResult<SystemMetricsSnapshot>>
|
|
23
|
+
'systemMetrics/writeFile': (path: string, content: string) => Promise<RemoteResult<WriteResult>>
|
|
24
|
+
}
|
|
25
|
+
interface TypertRemoteNamespaceMap {
|
|
26
|
+
'systemMetrics': TypertRemoteNamespace$73797374656d4d657472696373
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare const TYPERT_REMOTE: TypertRemoteContribution
|
|
31
|
+
export default TYPERT_REMOTE
|
|
32
|
+
//# sourceMappingURL=typert.remote-client.d.ts.map
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_parameter_0$schema = z.string()
|
|
5
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_result$schema = z.object({
|
|
6
|
+
'path': z.string().readonly(),
|
|
7
|
+
'entries': z.array(z.object({
|
|
8
|
+
'name': z.string().readonly(),
|
|
9
|
+
'isDirectory': z.boolean().readonly(),
|
|
10
|
+
})).readonly(),
|
|
11
|
+
'error': z.union([z.literal(null), z.string()]).readonly(),
|
|
12
|
+
})
|
|
13
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_overview_result$schema = z.object({
|
|
14
|
+
'timestamp': z.number().readonly(),
|
|
15
|
+
'platform': z.string().readonly(),
|
|
16
|
+
'uptimeSeconds': z.number().readonly(),
|
|
17
|
+
'loadavg': z.tuple([z.number(), z.number(), z.number()]).readonly(),
|
|
18
|
+
'memory': z.object({
|
|
19
|
+
'totalBytes': z.number().readonly(),
|
|
20
|
+
'usedBytes': z.number().readonly(),
|
|
21
|
+
}).readonly(),
|
|
22
|
+
'swap': z.object({
|
|
23
|
+
'totalBytes': z.number().readonly(),
|
|
24
|
+
'usedBytes': z.number().readonly(),
|
|
25
|
+
}).readonly(),
|
|
26
|
+
'cores': z.array(z.object({
|
|
27
|
+
'user': z.number().readonly(),
|
|
28
|
+
'nice': z.number().readonly(),
|
|
29
|
+
'sys': z.number().readonly(),
|
|
30
|
+
'idle': z.number().readonly(),
|
|
31
|
+
'irq': z.number().readonly(),
|
|
32
|
+
})).readonly(),
|
|
33
|
+
'thermalLevel': z.union([z.literal(null), z.number()]).readonly(),
|
|
34
|
+
'powerState': z.union([z.literal(null), z.string()]).readonly(),
|
|
35
|
+
'hardware': z.object({
|
|
36
|
+
'manufacturer': z.string().readonly(),
|
|
37
|
+
'model': z.string().readonly(),
|
|
38
|
+
'chassis': z.string().readonly(),
|
|
39
|
+
}).readonly(),
|
|
40
|
+
'tasks': z.number().readonly(),
|
|
41
|
+
'processes': z.array(z.object({
|
|
42
|
+
'pid': z.number().readonly(),
|
|
43
|
+
'name': z.string().readonly(),
|
|
44
|
+
'cpuPct': z.number().readonly(),
|
|
45
|
+
'memPct': z.number().readonly(),
|
|
46
|
+
})).readonly(),
|
|
47
|
+
'network': z.object({
|
|
48
|
+
'interfaceName': z.string().readonly(),
|
|
49
|
+
'state': z.string().readonly(),
|
|
50
|
+
'ip': z.union([z.literal(null), z.string()]).readonly(),
|
|
51
|
+
'pingMs': z.union([z.literal(null), z.number()]).readonly(),
|
|
52
|
+
'rxBytes': z.number().readonly(),
|
|
53
|
+
'txBytes': z.number().readonly(),
|
|
54
|
+
}).readonly(),
|
|
55
|
+
'storage': z.object({
|
|
56
|
+
'path': z.string().readonly(),
|
|
57
|
+
'totalBytes': z.number().readonly(),
|
|
58
|
+
'usedBytes': z.number().readonly(),
|
|
59
|
+
'usedPct': z.number().readonly(),
|
|
60
|
+
}).readonly(),
|
|
61
|
+
})
|
|
62
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_parameter_0$schema = z.string()
|
|
63
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_result$schema = z.object({
|
|
64
|
+
'path': z.string().readonly(),
|
|
65
|
+
'kind': z.union([z.literal("text"), z.literal("image"), z.literal("video"), z.literal("unsupported")]).readonly(),
|
|
66
|
+
'mime': z.string().readonly(),
|
|
67
|
+
'sizeBytes': z.number().readonly(),
|
|
68
|
+
'truncated': z.boolean().readonly(),
|
|
69
|
+
'text': z.union([z.literal(null), z.string()]).readonly(),
|
|
70
|
+
'dataUrl': z.union([z.literal(null), z.string()]).readonly(),
|
|
71
|
+
'error': z.union([z.literal(null), z.string()]).readonly(),
|
|
72
|
+
})
|
|
73
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_parameter_0$schema = z.string()
|
|
74
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_result$schema = z.object({
|
|
75
|
+
'stdout': z.string().readonly(),
|
|
76
|
+
'stderr': z.string().readonly(),
|
|
77
|
+
'exitCode': z.union([z.literal(null), z.number()]).readonly(),
|
|
78
|
+
})
|
|
79
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_snapshot_result$schema = z.object({
|
|
80
|
+
'loadavg': z.tuple([z.number(), z.number(), z.number()]).readonly(),
|
|
81
|
+
'cpuBusyRatio': z.number().readonly(),
|
|
82
|
+
'totalMemoryBytes': z.number().readonly(),
|
|
83
|
+
'freeMemoryBytes': z.number().readonly(),
|
|
84
|
+
'uptimeSeconds': z.number().readonly(),
|
|
85
|
+
'timestamp': z.number().readonly(),
|
|
86
|
+
})
|
|
87
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_0$schema = z.string()
|
|
88
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_1$schema = z.string()
|
|
89
|
+
const _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_result$schema = z.object({
|
|
90
|
+
'path': z.string().readonly(),
|
|
91
|
+
'sizeBytes': z.number().readonly(),
|
|
92
|
+
'error': z.union([z.literal(null), z.string()]).readonly(),
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const TYPERT_REMOTE = {
|
|
96
|
+
package: '@danielng23/dsh-studio-host-system-metrics',
|
|
97
|
+
descriptors: [
|
|
98
|
+
{
|
|
99
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/listDirectory',
|
|
100
|
+
service: 'systemMetrics',
|
|
101
|
+
namespace: 'systemMetrics',
|
|
102
|
+
method: 'listDirectory',
|
|
103
|
+
invocation: { kind: 'direct' },
|
|
104
|
+
parameters: [
|
|
105
|
+
{
|
|
106
|
+
name: 'path',
|
|
107
|
+
wire: 'path',
|
|
108
|
+
source: 'json',
|
|
109
|
+
codec: {
|
|
110
|
+
mode: 'strict',
|
|
111
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/listDirectory:path',
|
|
112
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_parameter_0$schema,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
result: {
|
|
117
|
+
mode: 'strict',
|
|
118
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#DirectoryListing',
|
|
119
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_listDirectory_result$schema,
|
|
120
|
+
},
|
|
121
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":293,"column":9},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/overview',
|
|
125
|
+
service: 'systemMetrics',
|
|
126
|
+
namespace: 'systemMetrics',
|
|
127
|
+
method: 'overview',
|
|
128
|
+
invocation: { kind: 'direct' },
|
|
129
|
+
parameters: [
|
|
130
|
+
],
|
|
131
|
+
result: {
|
|
132
|
+
mode: 'strict',
|
|
133
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#SystemOverview',
|
|
134
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_overview_result$schema,
|
|
135
|
+
},
|
|
136
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":246,"column":9},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/readFile',
|
|
140
|
+
service: 'systemMetrics',
|
|
141
|
+
namespace: 'systemMetrics',
|
|
142
|
+
method: 'readFile',
|
|
143
|
+
invocation: { kind: 'direct' },
|
|
144
|
+
parameters: [
|
|
145
|
+
{
|
|
146
|
+
name: 'path',
|
|
147
|
+
wire: 'path',
|
|
148
|
+
source: 'json',
|
|
149
|
+
codec: {
|
|
150
|
+
mode: 'strict',
|
|
151
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/readFile:path',
|
|
152
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_parameter_0$schema,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
result: {
|
|
157
|
+
mode: 'strict',
|
|
158
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#FilePreview',
|
|
159
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_readFile_result$schema,
|
|
160
|
+
},
|
|
161
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":316,"column":9},
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/runCommand',
|
|
165
|
+
service: 'systemMetrics',
|
|
166
|
+
namespace: 'systemMetrics',
|
|
167
|
+
method: 'runCommand',
|
|
168
|
+
invocation: { kind: 'direct' },
|
|
169
|
+
parameters: [
|
|
170
|
+
{
|
|
171
|
+
name: 'command',
|
|
172
|
+
wire: 'command',
|
|
173
|
+
source: 'json',
|
|
174
|
+
codec: {
|
|
175
|
+
mode: 'strict',
|
|
176
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/runCommand:command',
|
|
177
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_parameter_0$schema,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
result: {
|
|
182
|
+
mode: 'strict',
|
|
183
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#CommandResult',
|
|
184
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_runCommand_result$schema,
|
|
185
|
+
},
|
|
186
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":402,"column":9},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/snapshot',
|
|
190
|
+
service: 'systemMetrics',
|
|
191
|
+
namespace: 'systemMetrics',
|
|
192
|
+
method: 'snapshot',
|
|
193
|
+
invocation: { kind: 'direct' },
|
|
194
|
+
parameters: [
|
|
195
|
+
],
|
|
196
|
+
result: {
|
|
197
|
+
mode: 'strict',
|
|
198
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#SystemMetricsSnapshot',
|
|
199
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_snapshot_result$schema,
|
|
200
|
+
},
|
|
201
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":228,"column":3},
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/writeFile',
|
|
205
|
+
service: 'systemMetrics',
|
|
206
|
+
namespace: 'systemMetrics',
|
|
207
|
+
method: 'writeFile',
|
|
208
|
+
invocation: { kind: 'direct' },
|
|
209
|
+
parameters: [
|
|
210
|
+
{
|
|
211
|
+
name: 'path',
|
|
212
|
+
wire: 'path',
|
|
213
|
+
source: 'json',
|
|
214
|
+
codec: {
|
|
215
|
+
mode: 'strict',
|
|
216
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/writeFile:path',
|
|
217
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_0$schema,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'content',
|
|
222
|
+
wire: 'content',
|
|
223
|
+
source: 'json',
|
|
224
|
+
codec: {
|
|
225
|
+
mode: 'strict',
|
|
226
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics#systemMetrics/writeFile:content',
|
|
227
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_parameter_1$schema,
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
result: {
|
|
232
|
+
mode: 'strict',
|
|
233
|
+
typeSymbol: '@danielng23/dsh-studio-host-system-metrics/types#WriteResult',
|
|
234
|
+
schema: _danielng23_dsh_studio_host_system_metrics_systemMetrics_writeFile_result$schema,
|
|
235
|
+
},
|
|
236
|
+
sourceLocation: {"file":"packages/host/system-metrics/src/index.ts","line":381,"column":9},
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export default TYPERT_REMOTE
|