@livedesk/hub 0.1.35 → 0.1.37
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/package.json +2 -2
- package/src/agents/agent-audit-store.js +6 -16
- package/src/agents/agent-permissions.js +27 -33
- package/src/agents/agent-tool-registry.js +322 -340
- package/src/captures/capture-store.js +252 -299
- package/src/filesystem/shared-folders.js +181 -189
- package/src/filesystem/transfer-jobs.js +314 -345
- package/src/live-desk-update.js +615 -683
- package/src/remote-hub.js +59 -643
- package/src/server.js +111 -924
- package/src/settings/settings-schema.js +40 -32
- package/src/settings/settings-store.js +2 -7
- package/src/transport/relay-hub-control.js +1376 -1703
- package/src/transport/udp-hub-transport.js +520 -543
- package/src/transport/udp-rendezvous.js +408 -574
- package/src/security/device-credential-authority.js +0 -406
- package/src/security/security-audit-store.js +0 -260
- package/src/transport/secure-direct-acceptor.js +0 -543
|
@@ -1,340 +1,322 @@
|
|
|
1
|
-
const readOnlyInput = {
|
|
2
|
-
type: 'object',
|
|
3
|
-
properties: {
|
|
4
|
-
deviceIds: { type: 'array', items: { type: 'string' }, maxItems: 500 }
|
|
5
|
-
},
|
|
6
|
-
additionalProperties: false
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
function withQueryInput(properties) {
|
|
10
|
-
return {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: { ...properties, deviceIds: readOnlyInput.properties.deviceIds },
|
|
13
|
-
additionalProperties: false
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function withRequiredInput(properties, required = []) {
|
|
18
|
-
return {
|
|
19
|
-
...withQueryInput(properties),
|
|
20
|
-
required
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const taskPermission = { ask: 'ask', safeAuto: 'ask', fullAccess: 'allow' };
|
|
25
|
-
const readTaskPermission = { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' };
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
{
|
|
29
|
-
name: 'livedesk.list_devices',
|
|
30
|
-
description: 'List connected LiveDesk Clients. This is read-only.',
|
|
31
|
-
category: 'read',
|
|
32
|
-
readOnly: true,
|
|
33
|
-
mutating: false,
|
|
34
|
-
risk: 'low',
|
|
35
|
-
reversible: true,
|
|
36
|
-
supportsBatch: true,
|
|
37
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
38
|
-
inputSchema: readOnlyInput,
|
|
39
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'livedesk.get_system_health',
|
|
43
|
-
description: 'Read system health from the selected Clients.',
|
|
44
|
-
category: 'read',
|
|
45
|
-
readOnly: true,
|
|
46
|
-
mutating: false,
|
|
47
|
-
risk: 'low',
|
|
48
|
-
reversible: true,
|
|
49
|
-
supportsBatch: true,
|
|
50
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
51
|
-
inputSchema: readOnlyInput,
|
|
52
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'livedesk.get_gpu_status',
|
|
56
|
-
description: 'Read GPU status from the selected Clients.',
|
|
57
|
-
category: 'read',
|
|
58
|
-
readOnly: true,
|
|
59
|
-
mutating: false,
|
|
60
|
-
risk: 'low',
|
|
61
|
-
reversible: true,
|
|
62
|
-
supportsBatch: true,
|
|
63
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
64
|
-
inputSchema: readOnlyInput,
|
|
65
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'livedesk.get_disk_status',
|
|
69
|
-
description: 'Read disk status from the selected Clients.',
|
|
70
|
-
category: 'read',
|
|
71
|
-
readOnly: true,
|
|
72
|
-
mutating: false,
|
|
73
|
-
risk: 'low',
|
|
74
|
-
reversible: true,
|
|
75
|
-
supportsBatch: true,
|
|
76
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
77
|
-
inputSchema: readOnlyInput,
|
|
78
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'livedesk.list_processes',
|
|
82
|
-
description: 'Read process status from the selected Clients. Use processName when the request names a specific process.',
|
|
83
|
-
category: 'read',
|
|
84
|
-
readOnly: true,
|
|
85
|
-
mutating: false,
|
|
86
|
-
risk: 'low',
|
|
87
|
-
reversible: true,
|
|
88
|
-
supportsBatch: true,
|
|
89
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
90
|
-
inputSchema: withQueryInput({ processName: { type: 'string', maxLength: 120 } }),
|
|
91
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'livedesk.get_service_status',
|
|
95
|
-
description: 'Read service status from the selected Clients. Use serviceName when the user names a service.',
|
|
96
|
-
category: 'read',
|
|
97
|
-
readOnly: true,
|
|
98
|
-
mutating: false,
|
|
99
|
-
risk: 'low',
|
|
100
|
-
reversible: true,
|
|
101
|
-
supportsBatch: true,
|
|
102
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
103
|
-
inputSchema: withQueryInput({ serviceName: { type: 'string', maxLength: 120 } }),
|
|
104
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'livedesk.collect_diagnostics',
|
|
108
|
-
description: 'Collect the existing safe LiveDesk diagnostics payload from the selected Clients.',
|
|
109
|
-
category: 'read',
|
|
110
|
-
readOnly: true,
|
|
111
|
-
mutating: false,
|
|
112
|
-
risk: 'low',
|
|
113
|
-
reversible: true,
|
|
114
|
-
supportsBatch: true,
|
|
115
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
116
|
-
inputSchema: readOnlyInput,
|
|
117
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'livedesk.control_process',
|
|
121
|
-
description: 'Stop or restart a named process on the selected Clients. This changes process state.',
|
|
122
|
-
category: 'processControl',
|
|
123
|
-
readOnly: false,
|
|
124
|
-
mutating: true,
|
|
125
|
-
risk: 'high',
|
|
126
|
-
reversible: true,
|
|
127
|
-
supportsBatch: true,
|
|
128
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
129
|
-
inputSchema: withRequiredInput({ processName: { type: 'string', minLength: 1, maxLength: 120 }, action: { type: 'string', enum: ['stop', 'restart'] } }, ['processName', 'action']),
|
|
130
|
-
defaultPermission: taskPermission
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
name: 'livedesk.control_service',
|
|
134
|
-
description: 'Start, stop, or restart a named service on the selected Clients.',
|
|
135
|
-
category: 'serviceControl',
|
|
136
|
-
readOnly: false,
|
|
137
|
-
mutating: true,
|
|
138
|
-
risk: 'high',
|
|
139
|
-
reversible: true,
|
|
140
|
-
supportsBatch: true,
|
|
141
|
-
supportedPlatforms: ['windows', 'linux'],
|
|
142
|
-
inputSchema: withRequiredInput({ serviceName: { type: 'string', minLength: 1, maxLength: 120 }, action: { type: 'string', enum: ['start', 'stop', 'restart'] } }, ['serviceName', 'action']),
|
|
143
|
-
defaultPermission: taskPermission
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: 'livedesk.launch_application',
|
|
147
|
-
description: 'Launch a specific application without using a shell command.',
|
|
148
|
-
category: 'applicationControl',
|
|
149
|
-
readOnly: false,
|
|
150
|
-
mutating: true,
|
|
151
|
-
risk: 'medium',
|
|
152
|
-
reversible: true,
|
|
153
|
-
supportsBatch: true,
|
|
154
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
155
|
-
inputSchema: withRequiredInput({ executable: { type: 'string', minLength: 1, maxLength: 400 }, args: { type: 'array', items: { type: 'string', maxLength: 400 }, maxItems: 32 }, workingDirectory: { type: 'string', maxLength: 600 } }, ['executable']),
|
|
156
|
-
defaultPermission: taskPermission
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
name: 'livedesk.close_application',
|
|
160
|
-
description: 'Close a named application process on the selected Clients.',
|
|
161
|
-
category: 'applicationControl',
|
|
162
|
-
readOnly: false,
|
|
163
|
-
mutating: true,
|
|
164
|
-
risk: 'medium',
|
|
165
|
-
reversible: true,
|
|
166
|
-
supportsBatch: true,
|
|
167
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
168
|
-
inputSchema: withRequiredInput({ processName: { type: 'string', minLength: 1, maxLength: 120 }, force: { type: 'boolean' } }, ['processName']),
|
|
169
|
-
defaultPermission: taskPermission
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: 'livedesk.read_file',
|
|
173
|
-
description: 'Read a bounded UTF-8 text file from the selected Clients, with sensitive credential paths rejected.',
|
|
174
|
-
category: 'fileRead',
|
|
175
|
-
readOnly: true,
|
|
176
|
-
mutating: false,
|
|
177
|
-
risk: 'medium',
|
|
178
|
-
reversible: true,
|
|
179
|
-
supportsBatch: true,
|
|
180
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
181
|
-
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, maxBytes: { type: 'integer', minimum: 1, maximum: 65536 } }, ['path']),
|
|
182
|
-
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: 'livedesk.write_file',
|
|
186
|
-
description: 'Write bounded text content to a file on the selected Clients.',
|
|
187
|
-
category: 'fileWrite',
|
|
188
|
-
readOnly: false,
|
|
189
|
-
mutating: true,
|
|
190
|
-
risk: 'high',
|
|
191
|
-
reversible: true,
|
|
192
|
-
supportsBatch: true,
|
|
193
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
194
|
-
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, content: { type: 'string', maxLength: 1048576 }, append: { type: 'boolean' } }, ['path', 'content']),
|
|
195
|
-
defaultPermission: taskPermission
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
name: 'livedesk.delete_file',
|
|
199
|
-
description: 'Delete a selected file or explicitly requested directory on the selected Clients.',
|
|
200
|
-
category: 'fileDelete',
|
|
201
|
-
readOnly: false,
|
|
202
|
-
mutating: true,
|
|
203
|
-
risk: 'critical',
|
|
204
|
-
reversible: false,
|
|
205
|
-
supportsBatch: true,
|
|
206
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
207
|
-
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, recursive: { type: 'boolean' } }, ['path']),
|
|
208
|
-
defaultPermission: taskPermission
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: 'livedesk.list_directory',
|
|
212
|
-
description: 'List bounded file metadata from a directory on the selected Clients.',
|
|
213
|
-
category: 'fileRead',
|
|
214
|
-
readOnly: true,
|
|
215
|
-
mutating: false,
|
|
216
|
-
risk: 'low',
|
|
217
|
-
reversible: true,
|
|
218
|
-
supportsBatch: true,
|
|
219
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
220
|
-
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, recursive: { type: 'boolean' }, maxEntries: { type: 'integer', minimum: 1, maximum: 500 } }, ['path']),
|
|
221
|
-
defaultPermission: readTaskPermission
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: 'livedesk.run_command',
|
|
225
|
-
description: 'Run a bounded command through the selected Client command interpreter. This is an audited high-risk action.',
|
|
226
|
-
category: 'shell',
|
|
227
|
-
readOnly: false,
|
|
228
|
-
mutating: true,
|
|
229
|
-
risk: 'critical',
|
|
230
|
-
reversible: false,
|
|
231
|
-
supportsBatch: false,
|
|
232
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
233
|
-
inputSchema: withRequiredInput({ command: { type: 'string', minLength: 1, maxLength: 4000 }, workingDirectory: { type: 'string', maxLength: 600 }, timeoutMs: { type: 'integer', minimum: 1000, maximum: 30000 } }, ['command']),
|
|
234
|
-
defaultPermission: taskPermission
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
name: 'livedesk.run_script',
|
|
238
|
-
description: 'Run a bounded script file using the Client platform interpreter.',
|
|
239
|
-
category: 'script',
|
|
240
|
-
readOnly: false,
|
|
241
|
-
mutating: true,
|
|
242
|
-
risk: 'high',
|
|
243
|
-
reversible: false,
|
|
244
|
-
supportsBatch: false,
|
|
245
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
246
|
-
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, args: { type: 'array', items: { type: 'string', maxLength: 400 }, maxItems: 32 }, timeoutMs: { type: 'integer', minimum: 1000, maximum: 30000 } }, ['path']),
|
|
247
|
-
defaultPermission: taskPermission
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: 'livedesk.install_software',
|
|
251
|
-
description: 'Install a named package through an explicitly selected package manager.',
|
|
252
|
-
category: 'softwareInstall',
|
|
253
|
-
readOnly: false,
|
|
254
|
-
mutating: true,
|
|
255
|
-
risk: 'high',
|
|
256
|
-
reversible: false,
|
|
257
|
-
supportsBatch: false,
|
|
258
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
259
|
-
inputSchema: withRequiredInput({ manager: { type: 'string', enum: ['winget', 'brew', 'apt', 'npm'] }, packageName: { type: 'string', minLength: 1, maxLength: 200 }, version: { type: 'string', maxLength: 80 } }, ['manager', 'packageName']),
|
|
260
|
-
defaultPermission: taskPermission
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
name: 'livedesk.get_network_status',
|
|
264
|
-
description: 'Read bounded network adapter and connectivity status from the selected Clients.',
|
|
265
|
-
category: 'network',
|
|
266
|
-
readOnly: true,
|
|
267
|
-
mutating: false,
|
|
268
|
-
risk: 'low',
|
|
269
|
-
reversible: true,
|
|
270
|
-
supportsBatch: true,
|
|
271
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
272
|
-
inputSchema: readOnlyInput,
|
|
273
|
-
defaultPermission: readTaskPermission
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
name: 'livedesk.power_action',
|
|
277
|
-
description: 'Request an explicit power action on the selected Clients.',
|
|
278
|
-
category: 'systemPower',
|
|
279
|
-
readOnly: false,
|
|
280
|
-
mutating: true,
|
|
281
|
-
risk: 'critical',
|
|
282
|
-
reversible: false,
|
|
283
|
-
supportsBatch: true,
|
|
284
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
285
|
-
inputSchema: withRequiredInput({ action: { type: 'string', enum: ['lock', 'logoff', 'sleep', 'restart', 'shutdown'] }, delaySec: { type: 'integer', minimum: 0, maximum: 3600 } }, ['action']),
|
|
286
|
-
defaultPermission: taskPermission
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
name: 'livedesk.system_configuration',
|
|
290
|
-
description: 'Apply one explicitly named system configuration action supported by the Client agent.',
|
|
291
|
-
category: 'systemConfiguration',
|
|
292
|
-
readOnly: false,
|
|
293
|
-
mutating: true,
|
|
294
|
-
risk: 'critical',
|
|
295
|
-
reversible: false,
|
|
296
|
-
supportsBatch: false,
|
|
297
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
298
|
-
inputSchema: withRequiredInput({ action: { type: 'string', enum: ['set-timezone', 'set-environment-variable'] }, name: { type: 'string', minLength: 1, maxLength: 120 }, value: { type: 'string', maxLength: 400 } }, ['action', 'name', 'value']),
|
|
299
|
-
defaultPermission: taskPermission
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
name: 'livedesk.collect_logs',
|
|
303
|
-
description: 'Collect bounded recent application and system log lines without reading credential stores.',
|
|
304
|
-
category: 'read',
|
|
305
|
-
readOnly: true,
|
|
306
|
-
mutating: false,
|
|
307
|
-
risk: 'medium',
|
|
308
|
-
reversible: true,
|
|
309
|
-
supportsBatch: true,
|
|
310
|
-
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
311
|
-
inputSchema: withQueryInput({ source: { type: 'string', maxLength: 120 }, maxLines: { type: 'integer', minimum: 1, maximum: 500 } }),
|
|
312
|
-
defaultPermission: readTaskPermission
|
|
313
|
-
}
|
|
314
|
-
]);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
export
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
const retiredMutatingToolNames = new Set(RETIRED_AGENT_MUTATING_TOOL_NAMES);
|
|
325
|
-
|
|
326
|
-
export const AGENT_TOOL_DEFINITIONS = Object.freeze(
|
|
327
|
-
ALL_AGENT_TOOL_DEFINITIONS.filter(tool => tool.readOnly === true && tool.mutating !== true)
|
|
328
|
-
);
|
|
329
|
-
|
|
330
|
-
export const AGENT_TOOL_NAMES = Object.freeze(AGENT_TOOL_DEFINITIONS.map(tool => tool.name));
|
|
331
|
-
|
|
332
|
-
const toolByName = new Map(AGENT_TOOL_DEFINITIONS.map(tool => [tool.name, tool]));
|
|
333
|
-
|
|
334
|
-
export function getAgentToolDefinition(name) {
|
|
335
|
-
return toolByName.get(String(name || '').trim()) || null;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function isRetiredAgentMutatingToolName(name) {
|
|
339
|
-
return retiredMutatingToolNames.has(String(name || '').trim());
|
|
340
|
-
}
|
|
1
|
+
const readOnlyInput = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
properties: {
|
|
4
|
+
deviceIds: { type: 'array', items: { type: 'string' }, maxItems: 500 }
|
|
5
|
+
},
|
|
6
|
+
additionalProperties: false
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function withQueryInput(properties) {
|
|
10
|
+
return {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: { ...properties, deviceIds: readOnlyInput.properties.deviceIds },
|
|
13
|
+
additionalProperties: false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function withRequiredInput(properties, required = []) {
|
|
18
|
+
return {
|
|
19
|
+
...withQueryInput(properties),
|
|
20
|
+
required
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const taskPermission = { ask: 'ask', safeAuto: 'ask', fullAccess: 'allow' };
|
|
25
|
+
const readTaskPermission = { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' };
|
|
26
|
+
|
|
27
|
+
export const AGENT_TOOL_DEFINITIONS = Object.freeze([
|
|
28
|
+
{
|
|
29
|
+
name: 'livedesk.list_devices',
|
|
30
|
+
description: 'List connected LiveDesk Clients. This is read-only.',
|
|
31
|
+
category: 'read',
|
|
32
|
+
readOnly: true,
|
|
33
|
+
mutating: false,
|
|
34
|
+
risk: 'low',
|
|
35
|
+
reversible: true,
|
|
36
|
+
supportsBatch: true,
|
|
37
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
38
|
+
inputSchema: readOnlyInput,
|
|
39
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'livedesk.get_system_health',
|
|
43
|
+
description: 'Read system health from the selected Clients.',
|
|
44
|
+
category: 'read',
|
|
45
|
+
readOnly: true,
|
|
46
|
+
mutating: false,
|
|
47
|
+
risk: 'low',
|
|
48
|
+
reversible: true,
|
|
49
|
+
supportsBatch: true,
|
|
50
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
51
|
+
inputSchema: readOnlyInput,
|
|
52
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'livedesk.get_gpu_status',
|
|
56
|
+
description: 'Read GPU status from the selected Clients.',
|
|
57
|
+
category: 'read',
|
|
58
|
+
readOnly: true,
|
|
59
|
+
mutating: false,
|
|
60
|
+
risk: 'low',
|
|
61
|
+
reversible: true,
|
|
62
|
+
supportsBatch: true,
|
|
63
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
64
|
+
inputSchema: readOnlyInput,
|
|
65
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'livedesk.get_disk_status',
|
|
69
|
+
description: 'Read disk status from the selected Clients.',
|
|
70
|
+
category: 'read',
|
|
71
|
+
readOnly: true,
|
|
72
|
+
mutating: false,
|
|
73
|
+
risk: 'low',
|
|
74
|
+
reversible: true,
|
|
75
|
+
supportsBatch: true,
|
|
76
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
77
|
+
inputSchema: readOnlyInput,
|
|
78
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'livedesk.list_processes',
|
|
82
|
+
description: 'Read process status from the selected Clients. Use processName when the request names a specific process.',
|
|
83
|
+
category: 'read',
|
|
84
|
+
readOnly: true,
|
|
85
|
+
mutating: false,
|
|
86
|
+
risk: 'low',
|
|
87
|
+
reversible: true,
|
|
88
|
+
supportsBatch: true,
|
|
89
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
90
|
+
inputSchema: withQueryInput({ processName: { type: 'string', maxLength: 120 } }),
|
|
91
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'livedesk.get_service_status',
|
|
95
|
+
description: 'Read service status from the selected Clients. Use serviceName when the user names a service.',
|
|
96
|
+
category: 'read',
|
|
97
|
+
readOnly: true,
|
|
98
|
+
mutating: false,
|
|
99
|
+
risk: 'low',
|
|
100
|
+
reversible: true,
|
|
101
|
+
supportsBatch: true,
|
|
102
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
103
|
+
inputSchema: withQueryInput({ serviceName: { type: 'string', maxLength: 120 } }),
|
|
104
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'livedesk.collect_diagnostics',
|
|
108
|
+
description: 'Collect the existing safe LiveDesk diagnostics payload from the selected Clients.',
|
|
109
|
+
category: 'read',
|
|
110
|
+
readOnly: true,
|
|
111
|
+
mutating: false,
|
|
112
|
+
risk: 'low',
|
|
113
|
+
reversible: true,
|
|
114
|
+
supportsBatch: true,
|
|
115
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
116
|
+
inputSchema: readOnlyInput,
|
|
117
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'livedesk.control_process',
|
|
121
|
+
description: 'Stop or restart a named process on the selected Clients. This changes process state.',
|
|
122
|
+
category: 'processControl',
|
|
123
|
+
readOnly: false,
|
|
124
|
+
mutating: true,
|
|
125
|
+
risk: 'high',
|
|
126
|
+
reversible: true,
|
|
127
|
+
supportsBatch: true,
|
|
128
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
129
|
+
inputSchema: withRequiredInput({ processName: { type: 'string', minLength: 1, maxLength: 120 }, action: { type: 'string', enum: ['stop', 'restart'] } }, ['processName', 'action']),
|
|
130
|
+
defaultPermission: taskPermission
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'livedesk.control_service',
|
|
134
|
+
description: 'Start, stop, or restart a named service on the selected Clients.',
|
|
135
|
+
category: 'serviceControl',
|
|
136
|
+
readOnly: false,
|
|
137
|
+
mutating: true,
|
|
138
|
+
risk: 'high',
|
|
139
|
+
reversible: true,
|
|
140
|
+
supportsBatch: true,
|
|
141
|
+
supportedPlatforms: ['windows', 'linux'],
|
|
142
|
+
inputSchema: withRequiredInput({ serviceName: { type: 'string', minLength: 1, maxLength: 120 }, action: { type: 'string', enum: ['start', 'stop', 'restart'] } }, ['serviceName', 'action']),
|
|
143
|
+
defaultPermission: taskPermission
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'livedesk.launch_application',
|
|
147
|
+
description: 'Launch a specific application without using a shell command.',
|
|
148
|
+
category: 'applicationControl',
|
|
149
|
+
readOnly: false,
|
|
150
|
+
mutating: true,
|
|
151
|
+
risk: 'medium',
|
|
152
|
+
reversible: true,
|
|
153
|
+
supportsBatch: true,
|
|
154
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
155
|
+
inputSchema: withRequiredInput({ executable: { type: 'string', minLength: 1, maxLength: 400 }, args: { type: 'array', items: { type: 'string', maxLength: 400 }, maxItems: 32 }, workingDirectory: { type: 'string', maxLength: 600 } }, ['executable']),
|
|
156
|
+
defaultPermission: taskPermission
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'livedesk.close_application',
|
|
160
|
+
description: 'Close a named application process on the selected Clients.',
|
|
161
|
+
category: 'applicationControl',
|
|
162
|
+
readOnly: false,
|
|
163
|
+
mutating: true,
|
|
164
|
+
risk: 'medium',
|
|
165
|
+
reversible: true,
|
|
166
|
+
supportsBatch: true,
|
|
167
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
168
|
+
inputSchema: withRequiredInput({ processName: { type: 'string', minLength: 1, maxLength: 120 }, force: { type: 'boolean' } }, ['processName']),
|
|
169
|
+
defaultPermission: taskPermission
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'livedesk.read_file',
|
|
173
|
+
description: 'Read a bounded UTF-8 text file from the selected Clients, with sensitive credential paths rejected.',
|
|
174
|
+
category: 'fileRead',
|
|
175
|
+
readOnly: true,
|
|
176
|
+
mutating: false,
|
|
177
|
+
risk: 'medium',
|
|
178
|
+
reversible: true,
|
|
179
|
+
supportsBatch: true,
|
|
180
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
181
|
+
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, maxBytes: { type: 'integer', minimum: 1, maximum: 65536 } }, ['path']),
|
|
182
|
+
defaultPermission: { ask: 'allow', safeAuto: 'allow', fullAccess: 'allow' }
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'livedesk.write_file',
|
|
186
|
+
description: 'Write bounded text content to a file on the selected Clients.',
|
|
187
|
+
category: 'fileWrite',
|
|
188
|
+
readOnly: false,
|
|
189
|
+
mutating: true,
|
|
190
|
+
risk: 'high',
|
|
191
|
+
reversible: true,
|
|
192
|
+
supportsBatch: true,
|
|
193
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
194
|
+
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, content: { type: 'string', maxLength: 1048576 }, append: { type: 'boolean' } }, ['path', 'content']),
|
|
195
|
+
defaultPermission: taskPermission
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'livedesk.delete_file',
|
|
199
|
+
description: 'Delete a selected file or explicitly requested directory on the selected Clients.',
|
|
200
|
+
category: 'fileDelete',
|
|
201
|
+
readOnly: false,
|
|
202
|
+
mutating: true,
|
|
203
|
+
risk: 'critical',
|
|
204
|
+
reversible: false,
|
|
205
|
+
supportsBatch: true,
|
|
206
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
207
|
+
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, recursive: { type: 'boolean' } }, ['path']),
|
|
208
|
+
defaultPermission: taskPermission
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: 'livedesk.list_directory',
|
|
212
|
+
description: 'List bounded file metadata from a directory on the selected Clients.',
|
|
213
|
+
category: 'fileRead',
|
|
214
|
+
readOnly: true,
|
|
215
|
+
mutating: false,
|
|
216
|
+
risk: 'low',
|
|
217
|
+
reversible: true,
|
|
218
|
+
supportsBatch: true,
|
|
219
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
220
|
+
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, recursive: { type: 'boolean' }, maxEntries: { type: 'integer', minimum: 1, maximum: 500 } }, ['path']),
|
|
221
|
+
defaultPermission: readTaskPermission
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'livedesk.run_command',
|
|
225
|
+
description: 'Run a bounded command through the selected Client command interpreter. This is an audited high-risk action.',
|
|
226
|
+
category: 'shell',
|
|
227
|
+
readOnly: false,
|
|
228
|
+
mutating: true,
|
|
229
|
+
risk: 'critical',
|
|
230
|
+
reversible: false,
|
|
231
|
+
supportsBatch: false,
|
|
232
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
233
|
+
inputSchema: withRequiredInput({ command: { type: 'string', minLength: 1, maxLength: 4000 }, workingDirectory: { type: 'string', maxLength: 600 }, timeoutMs: { type: 'integer', minimum: 1000, maximum: 30000 } }, ['command']),
|
|
234
|
+
defaultPermission: taskPermission
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'livedesk.run_script',
|
|
238
|
+
description: 'Run a bounded script file using the Client platform interpreter.',
|
|
239
|
+
category: 'script',
|
|
240
|
+
readOnly: false,
|
|
241
|
+
mutating: true,
|
|
242
|
+
risk: 'high',
|
|
243
|
+
reversible: false,
|
|
244
|
+
supportsBatch: false,
|
|
245
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
246
|
+
inputSchema: withRequiredInput({ path: { type: 'string', minLength: 1, maxLength: 600 }, args: { type: 'array', items: { type: 'string', maxLength: 400 }, maxItems: 32 }, timeoutMs: { type: 'integer', minimum: 1000, maximum: 30000 } }, ['path']),
|
|
247
|
+
defaultPermission: taskPermission
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'livedesk.install_software',
|
|
251
|
+
description: 'Install a named package through an explicitly selected package manager.',
|
|
252
|
+
category: 'softwareInstall',
|
|
253
|
+
readOnly: false,
|
|
254
|
+
mutating: true,
|
|
255
|
+
risk: 'high',
|
|
256
|
+
reversible: false,
|
|
257
|
+
supportsBatch: false,
|
|
258
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
259
|
+
inputSchema: withRequiredInput({ manager: { type: 'string', enum: ['winget', 'brew', 'apt', 'npm'] }, packageName: { type: 'string', minLength: 1, maxLength: 200 }, version: { type: 'string', maxLength: 80 } }, ['manager', 'packageName']),
|
|
260
|
+
defaultPermission: taskPermission
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'livedesk.get_network_status',
|
|
264
|
+
description: 'Read bounded network adapter and connectivity status from the selected Clients.',
|
|
265
|
+
category: 'network',
|
|
266
|
+
readOnly: true,
|
|
267
|
+
mutating: false,
|
|
268
|
+
risk: 'low',
|
|
269
|
+
reversible: true,
|
|
270
|
+
supportsBatch: true,
|
|
271
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
272
|
+
inputSchema: readOnlyInput,
|
|
273
|
+
defaultPermission: readTaskPermission
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: 'livedesk.power_action',
|
|
277
|
+
description: 'Request an explicit power action on the selected Clients.',
|
|
278
|
+
category: 'systemPower',
|
|
279
|
+
readOnly: false,
|
|
280
|
+
mutating: true,
|
|
281
|
+
risk: 'critical',
|
|
282
|
+
reversible: false,
|
|
283
|
+
supportsBatch: true,
|
|
284
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
285
|
+
inputSchema: withRequiredInput({ action: { type: 'string', enum: ['lock', 'logoff', 'sleep', 'restart', 'shutdown'] }, delaySec: { type: 'integer', minimum: 0, maximum: 3600 } }, ['action']),
|
|
286
|
+
defaultPermission: taskPermission
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: 'livedesk.system_configuration',
|
|
290
|
+
description: 'Apply one explicitly named system configuration action supported by the Client agent.',
|
|
291
|
+
category: 'systemConfiguration',
|
|
292
|
+
readOnly: false,
|
|
293
|
+
mutating: true,
|
|
294
|
+
risk: 'critical',
|
|
295
|
+
reversible: false,
|
|
296
|
+
supportsBatch: false,
|
|
297
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
298
|
+
inputSchema: withRequiredInput({ action: { type: 'string', enum: ['set-timezone', 'set-environment-variable'] }, name: { type: 'string', minLength: 1, maxLength: 120 }, value: { type: 'string', maxLength: 400 } }, ['action', 'name', 'value']),
|
|
299
|
+
defaultPermission: taskPermission
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: 'livedesk.collect_logs',
|
|
303
|
+
description: 'Collect bounded recent application and system log lines without reading credential stores.',
|
|
304
|
+
category: 'read',
|
|
305
|
+
readOnly: true,
|
|
306
|
+
mutating: false,
|
|
307
|
+
risk: 'medium',
|
|
308
|
+
reversible: true,
|
|
309
|
+
supportsBatch: true,
|
|
310
|
+
supportedPlatforms: ['windows', 'macos', 'linux'],
|
|
311
|
+
inputSchema: withQueryInput({ source: { type: 'string', maxLength: 120 }, maxLines: { type: 'integer', minimum: 1, maximum: 500 } }),
|
|
312
|
+
defaultPermission: readTaskPermission
|
|
313
|
+
}
|
|
314
|
+
]);
|
|
315
|
+
|
|
316
|
+
export const AGENT_TOOL_NAMES = Object.freeze(AGENT_TOOL_DEFINITIONS.map(tool => tool.name));
|
|
317
|
+
|
|
318
|
+
const toolByName = new Map(AGENT_TOOL_DEFINITIONS.map(tool => [tool.name, tool]));
|
|
319
|
+
|
|
320
|
+
export function getAgentToolDefinition(name) {
|
|
321
|
+
return toolByName.get(String(name || '').trim()) || null;
|
|
322
|
+
}
|