@ravi-os/sdk 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 +70 -0
- package/dist/client.d.ts +1549 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2736 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +69 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +119 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +6398 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +6978 -0
- package/dist/schemas.js.map +1 -0
- package/dist/transport/http.d.ts +26 -0
- package/dist/transport/http.d.ts.map +1 -0
- package/dist/transport/http.js +86 -0
- package/dist/transport/http.js.map +1 -0
- package/dist/transport/types.d.ts +25 -0
- package/dist/transport/types.d.ts.map +1 -0
- package/dist/transport/types.js +11 -0
- package/dist/transport/types.js.map +1 -0
- package/dist/types.d.ts +2550 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +10 -0
- package/dist/version.js.map +1 -0
- package/package.json +51 -0
package/dist/client.js
ADDED
|
@@ -0,0 +1,2736 @@
|
|
|
1
|
+
// GENERATED FILE — DO NOT EDIT.
|
|
2
|
+
// Run `ravi sdk client generate` to regenerate.
|
|
3
|
+
// Drift is detected by `ravi sdk client check` (CI).
|
|
4
|
+
/**
|
|
5
|
+
* `RaviClient` exposes every registry command as a typed method.
|
|
6
|
+
*
|
|
7
|
+
* The class is generated 1:1 from `getRegistry()`. Every method calls into
|
|
8
|
+
* the supplied `Transport`, which is responsible for validation, scope
|
|
9
|
+
* enforcement, and audit (see `transport/http.ts` and
|
|
10
|
+
* `transport/in-process.ts`).
|
|
11
|
+
*/
|
|
12
|
+
export class RaviClient {
|
|
13
|
+
transport;
|
|
14
|
+
constructor(transport) {
|
|
15
|
+
this.transport = transport;
|
|
16
|
+
}
|
|
17
|
+
adapters = {
|
|
18
|
+
/** List session adapters with health and bind state */
|
|
19
|
+
list: async (options) => {
|
|
20
|
+
return this.transport.call({
|
|
21
|
+
groupSegments: ["adapters"],
|
|
22
|
+
command: "list",
|
|
23
|
+
body: { ...(options ?? {}) },
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
/** Show a session adapter debug snapshot */
|
|
27
|
+
show: async (adapterId) => {
|
|
28
|
+
return this.transport.call({
|
|
29
|
+
groupSegments: ["adapters"],
|
|
30
|
+
command: "show",
|
|
31
|
+
body: { adapterId },
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
agents = {
|
|
36
|
+
/** Create a new agent */
|
|
37
|
+
create: async (id, cwd, options) => {
|
|
38
|
+
return this.transport.call({
|
|
39
|
+
groupSegments: ["agents"],
|
|
40
|
+
command: "create",
|
|
41
|
+
body: { id, cwd, ...(options ?? {}) },
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
/** Set message debounce time */
|
|
45
|
+
debounce: async (id, ms) => {
|
|
46
|
+
return this.transport.call({
|
|
47
|
+
groupSegments: ["agents"],
|
|
48
|
+
command: "debounce",
|
|
49
|
+
body: { id, ms },
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
/** Show last turns of an agent session (what it received, what it responded) */
|
|
53
|
+
debug: async (id, nameOrKey, options) => {
|
|
54
|
+
return this.transport.call({
|
|
55
|
+
groupSegments: ["agents"],
|
|
56
|
+
command: "debug",
|
|
57
|
+
body: { id, nameOrKey, ...(options ?? {}) },
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
/** Delete an agent */
|
|
61
|
+
delete: async (id) => {
|
|
62
|
+
return this.transport.call({
|
|
63
|
+
groupSegments: ["agents"],
|
|
64
|
+
command: "delete",
|
|
65
|
+
body: { id },
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
/** List all agents */
|
|
69
|
+
list: async () => {
|
|
70
|
+
return this.transport.call({
|
|
71
|
+
groupSegments: ["agents"],
|
|
72
|
+
command: "list",
|
|
73
|
+
body: {},
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
/** Reset agent session */
|
|
77
|
+
reset: async (id, nameOrKey) => {
|
|
78
|
+
return this.transport.call({
|
|
79
|
+
groupSegments: ["agents"],
|
|
80
|
+
command: "reset",
|
|
81
|
+
body: { id, nameOrKey },
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
/** Show agent session status */
|
|
85
|
+
session: async (id) => {
|
|
86
|
+
return this.transport.call({
|
|
87
|
+
groupSegments: ["agents"],
|
|
88
|
+
command: "session",
|
|
89
|
+
body: { id },
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
/** Set agent property */
|
|
93
|
+
set: async (id, key, value) => {
|
|
94
|
+
return this.transport.call({
|
|
95
|
+
groupSegments: ["agents"],
|
|
96
|
+
command: "set",
|
|
97
|
+
body: { id, key, value },
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
/** Show agent details */
|
|
101
|
+
show: async (id) => {
|
|
102
|
+
return this.transport.call({
|
|
103
|
+
groupSegments: ["agents"],
|
|
104
|
+
command: "show",
|
|
105
|
+
body: { id },
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
/** Enable or disable spec mode for an agent */
|
|
109
|
+
specMode: async (id, enabled) => {
|
|
110
|
+
return this.transport.call({
|
|
111
|
+
groupSegments: ["agents"],
|
|
112
|
+
command: "spec-mode",
|
|
113
|
+
body: { id, enabled },
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
/** Migrate agent workspaces to AGENTS.md as the canonical file */
|
|
117
|
+
syncInstructions: async (options) => {
|
|
118
|
+
return this.transport.call({
|
|
119
|
+
groupSegments: ["agents"],
|
|
120
|
+
command: "sync-instructions",
|
|
121
|
+
body: { ...(options ?? {}) },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
artifacts = {
|
|
126
|
+
/** Soft-archive an artifact */
|
|
127
|
+
archive: async (id) => {
|
|
128
|
+
return this.transport.call({
|
|
129
|
+
groupSegments: ["artifacts"],
|
|
130
|
+
command: "archive",
|
|
131
|
+
body: { id },
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
/** Attach an artifact to a task, session, message or any target */
|
|
135
|
+
attach: async (id, targetType, targetId, options) => {
|
|
136
|
+
return this.transport.call({
|
|
137
|
+
groupSegments: ["artifacts"],
|
|
138
|
+
command: "attach",
|
|
139
|
+
body: { id, targetType, targetId, ...(options ?? {}) },
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
/** Create a generic Ravi artifact record */
|
|
143
|
+
create: async (kind, options) => {
|
|
144
|
+
return this.transport.call({
|
|
145
|
+
groupSegments: ["artifacts"],
|
|
146
|
+
command: "create",
|
|
147
|
+
body: { kind, ...(options ?? {}) },
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
/** Append an artifact lifecycle event */
|
|
151
|
+
event: async (id, eventType, options) => {
|
|
152
|
+
return this.transport.call({
|
|
153
|
+
groupSegments: ["artifacts"],
|
|
154
|
+
command: "event",
|
|
155
|
+
body: { id, eventType, ...(options ?? {}) },
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
/** List artifact lifecycle events */
|
|
159
|
+
events: async (id) => {
|
|
160
|
+
return this.transport.call({
|
|
161
|
+
groupSegments: ["artifacts"],
|
|
162
|
+
command: "events",
|
|
163
|
+
body: { id },
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
/** List artifacts */
|
|
167
|
+
list: async (options) => {
|
|
168
|
+
return this.transport.call({
|
|
169
|
+
groupSegments: ["artifacts"],
|
|
170
|
+
command: "list",
|
|
171
|
+
body: { ...(options ?? {}) },
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
/** Show artifact details, links and events */
|
|
175
|
+
show: async (id) => {
|
|
176
|
+
return this.transport.call({
|
|
177
|
+
groupSegments: ["artifacts"],
|
|
178
|
+
command: "show",
|
|
179
|
+
body: { id },
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
/** Edit artifact metadata and high-level fields */
|
|
183
|
+
update: async (id, options) => {
|
|
184
|
+
return this.transport.call({
|
|
185
|
+
groupSegments: ["artifacts"],
|
|
186
|
+
command: "update",
|
|
187
|
+
body: { id, ...(options ?? {}) },
|
|
188
|
+
});
|
|
189
|
+
},
|
|
190
|
+
/** Watch artifact lifecycle until a terminal status */
|
|
191
|
+
watch: async (id, options) => {
|
|
192
|
+
return this.transport.call({
|
|
193
|
+
groupSegments: ["artifacts"],
|
|
194
|
+
command: "watch",
|
|
195
|
+
body: { id, ...(options ?? {}) },
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
audio = {
|
|
200
|
+
/** Generate speech from text using ElevenLabs TTS */
|
|
201
|
+
generate: async (text, options) => {
|
|
202
|
+
return this.transport.call({
|
|
203
|
+
groupSegments: ["audio"],
|
|
204
|
+
command: "generate",
|
|
205
|
+
body: { text, ...(options ?? {}) },
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
contacts = {
|
|
210
|
+
/** Add/allow a contact */
|
|
211
|
+
add: async (identity, name, options) => {
|
|
212
|
+
return this.transport.call({
|
|
213
|
+
groupSegments: ["contacts"],
|
|
214
|
+
command: "add",
|
|
215
|
+
body: { identity, name, ...(options ?? {}) },
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
/** Allow a contact */
|
|
219
|
+
allow: async (contact) => {
|
|
220
|
+
return this.transport.call({
|
|
221
|
+
groupSegments: ["contacts"],
|
|
222
|
+
command: "allow",
|
|
223
|
+
body: { contact },
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
/** Approve pending contact */
|
|
227
|
+
approve: async (contact, mode, options) => {
|
|
228
|
+
return this.transport.call({
|
|
229
|
+
groupSegments: ["contacts"],
|
|
230
|
+
command: "approve",
|
|
231
|
+
body: { contact, mode, ...(options ?? {}) },
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
/** Block a contact */
|
|
235
|
+
block: async (contact) => {
|
|
236
|
+
return this.transport.call({
|
|
237
|
+
groupSegments: ["contacts"],
|
|
238
|
+
command: "block",
|
|
239
|
+
body: { contact },
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
/** Check contact status (alias for info) */
|
|
243
|
+
check: async (contact) => {
|
|
244
|
+
return this.transport.call({
|
|
245
|
+
groupSegments: ["contacts"],
|
|
246
|
+
command: "check",
|
|
247
|
+
body: { contact },
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
/** Find likely duplicate contacts */
|
|
251
|
+
duplicates: async () => {
|
|
252
|
+
return this.transport.call({
|
|
253
|
+
groupSegments: ["contacts"],
|
|
254
|
+
command: "duplicates",
|
|
255
|
+
body: {},
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
/** Find contacts by tag or search query */
|
|
259
|
+
find: async (query, options) => {
|
|
260
|
+
return this.transport.call({
|
|
261
|
+
groupSegments: ["contacts"],
|
|
262
|
+
command: "find",
|
|
263
|
+
body: { query, ...(options ?? {}) },
|
|
264
|
+
});
|
|
265
|
+
},
|
|
266
|
+
/** Show canonical contact details */
|
|
267
|
+
get: async (contact) => {
|
|
268
|
+
return this.transport.call({
|
|
269
|
+
groupSegments: ["contacts"],
|
|
270
|
+
command: "get",
|
|
271
|
+
body: { contact },
|
|
272
|
+
});
|
|
273
|
+
},
|
|
274
|
+
/** Set a contact's tag in a specific group */
|
|
275
|
+
groupTag: async (contact, group, tag) => {
|
|
276
|
+
return this.transport.call({
|
|
277
|
+
groupSegments: ["contacts"],
|
|
278
|
+
command: "group-tag",
|
|
279
|
+
body: { contact, group, tag },
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
/** Remove a contact's tag from a specific group */
|
|
283
|
+
groupUntag: async (contact, group) => {
|
|
284
|
+
return this.transport.call({
|
|
285
|
+
groupSegments: ["contacts"],
|
|
286
|
+
command: "group-untag",
|
|
287
|
+
body: { contact, group },
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
/** Add an identity to a contact (legacy alias for link) */
|
|
291
|
+
identityAdd: async (contact, platform, value) => {
|
|
292
|
+
return this.transport.call({
|
|
293
|
+
groupSegments: ["contacts"],
|
|
294
|
+
command: "identity-add",
|
|
295
|
+
body: { contact, platform, value },
|
|
296
|
+
});
|
|
297
|
+
},
|
|
298
|
+
/** Remove an identity (legacy alias for unlink) */
|
|
299
|
+
identityRemove: async (platform, value) => {
|
|
300
|
+
return this.transport.call({
|
|
301
|
+
groupSegments: ["contacts"],
|
|
302
|
+
command: "identity-remove",
|
|
303
|
+
body: { platform, value },
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
/** Show contact details with all identities */
|
|
307
|
+
info: async (contact) => {
|
|
308
|
+
return this.transport.call({
|
|
309
|
+
groupSegments: ["contacts"],
|
|
310
|
+
command: "info",
|
|
311
|
+
body: { contact },
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
/** Link a platform identity to a contact */
|
|
315
|
+
link: async (contact, options) => {
|
|
316
|
+
return this.transport.call({
|
|
317
|
+
groupSegments: ["contacts"],
|
|
318
|
+
command: "link",
|
|
319
|
+
body: { contact, ...(options ?? {}) },
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
/** List all contacts */
|
|
323
|
+
list: async (options) => {
|
|
324
|
+
return this.transport.call({
|
|
325
|
+
groupSegments: ["contacts"],
|
|
326
|
+
command: "list",
|
|
327
|
+
body: { ...(options ?? {}) },
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
/** Merge two contacts (move identities from source to target) */
|
|
331
|
+
merge: async (source, target) => {
|
|
332
|
+
return this.transport.call({
|
|
333
|
+
groupSegments: ["contacts"],
|
|
334
|
+
command: "merge",
|
|
335
|
+
body: { source, target },
|
|
336
|
+
});
|
|
337
|
+
},
|
|
338
|
+
/** List pending contacts */
|
|
339
|
+
pending: async (options) => {
|
|
340
|
+
return this.transport.call({
|
|
341
|
+
groupSegments: ["contacts"],
|
|
342
|
+
command: "pending",
|
|
343
|
+
body: { ...(options ?? {}) },
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
/** Remove a contact */
|
|
347
|
+
remove: async (contact) => {
|
|
348
|
+
return this.transport.call({
|
|
349
|
+
groupSegments: ["contacts"],
|
|
350
|
+
command: "remove",
|
|
351
|
+
body: { contact },
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
/** Set contact property */
|
|
355
|
+
set: async (contact, key, value) => {
|
|
356
|
+
return this.transport.call({
|
|
357
|
+
groupSegments: ["contacts"],
|
|
358
|
+
command: "set",
|
|
359
|
+
body: { contact, key, value },
|
|
360
|
+
});
|
|
361
|
+
},
|
|
362
|
+
/** Add a tag to a contact */
|
|
363
|
+
tag: async (contact, tag) => {
|
|
364
|
+
return this.transport.call({
|
|
365
|
+
groupSegments: ["contacts"],
|
|
366
|
+
command: "tag",
|
|
367
|
+
body: { contact, tag },
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
/** Unlink a platform identity from its contact */
|
|
371
|
+
unlink: async (platformIdentity, options) => {
|
|
372
|
+
return this.transport.call({
|
|
373
|
+
groupSegments: ["contacts"],
|
|
374
|
+
command: "unlink",
|
|
375
|
+
body: { platformIdentity, ...(options ?? {}) },
|
|
376
|
+
});
|
|
377
|
+
},
|
|
378
|
+
/** Remove a tag from a contact */
|
|
379
|
+
untag: async (contact, tag) => {
|
|
380
|
+
return this.transport.call({
|
|
381
|
+
groupSegments: ["contacts"],
|
|
382
|
+
command: "untag",
|
|
383
|
+
body: { contact, tag },
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
context = {
|
|
388
|
+
/** Request approval and extend the current runtime context if approved */
|
|
389
|
+
authorize: async (permission, objectType, objectId) => {
|
|
390
|
+
return this.transport.call({
|
|
391
|
+
groupSegments: ["context"],
|
|
392
|
+
command: "authorize",
|
|
393
|
+
body: { permission, objectType, objectId },
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
/** List inherited capabilities for the current runtime context */
|
|
397
|
+
capabilities: async () => {
|
|
398
|
+
return this.transport.call({
|
|
399
|
+
groupSegments: ["context"],
|
|
400
|
+
command: "capabilities",
|
|
401
|
+
body: {},
|
|
402
|
+
});
|
|
403
|
+
},
|
|
404
|
+
/** Check whether the current runtime context allows an action */
|
|
405
|
+
check: async (permission, objectType, objectId) => {
|
|
406
|
+
return this.transport.call({
|
|
407
|
+
groupSegments: ["context"],
|
|
408
|
+
command: "check",
|
|
409
|
+
body: { permission, objectType, objectId },
|
|
410
|
+
});
|
|
411
|
+
},
|
|
412
|
+
/** Evaluate a Codex PreToolUse Bash hook payload from stdin using the current Ravi context */
|
|
413
|
+
codexBashHook: async () => {
|
|
414
|
+
return this.transport.call({
|
|
415
|
+
groupSegments: ["context"],
|
|
416
|
+
command: "codex-bash-hook",
|
|
417
|
+
body: {},
|
|
418
|
+
});
|
|
419
|
+
},
|
|
420
|
+
credentials: {
|
|
421
|
+
/** Add a runtime context-key to the local credentials store */
|
|
422
|
+
add: async (contextKey, options) => {
|
|
423
|
+
return this.transport.call({
|
|
424
|
+
groupSegments: ["context", "credentials"],
|
|
425
|
+
command: "add",
|
|
426
|
+
body: { contextKey, ...(options ?? {}) },
|
|
427
|
+
});
|
|
428
|
+
},
|
|
429
|
+
/** List entries in the local credentials store */
|
|
430
|
+
list: async () => {
|
|
431
|
+
return this.transport.call({
|
|
432
|
+
groupSegments: ["context", "credentials"],
|
|
433
|
+
command: "list",
|
|
434
|
+
body: {},
|
|
435
|
+
});
|
|
436
|
+
},
|
|
437
|
+
/** Remove a stored context-key from the credentials store */
|
|
438
|
+
remove: async (contextKey) => {
|
|
439
|
+
return this.transport.call({
|
|
440
|
+
groupSegments: ["context", "credentials"],
|
|
441
|
+
command: "remove",
|
|
442
|
+
body: { contextKey },
|
|
443
|
+
});
|
|
444
|
+
},
|
|
445
|
+
/** Mark a stored context-key as the default */
|
|
446
|
+
setDefault: async (contextKey) => {
|
|
447
|
+
return this.transport.call({
|
|
448
|
+
groupSegments: ["context", "credentials"],
|
|
449
|
+
command: "set-default",
|
|
450
|
+
body: { contextKey },
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
/** Show full runtime context details without exposing the context key */
|
|
455
|
+
info: async (contextId) => {
|
|
456
|
+
return this.transport.call({
|
|
457
|
+
groupSegments: ["context"],
|
|
458
|
+
command: "info",
|
|
459
|
+
body: { contextId },
|
|
460
|
+
});
|
|
461
|
+
},
|
|
462
|
+
/** Issue a least-privilege child context for an external CLI */
|
|
463
|
+
issue: async (cliName, options) => {
|
|
464
|
+
return this.transport.call({
|
|
465
|
+
groupSegments: ["context"],
|
|
466
|
+
command: "issue",
|
|
467
|
+
body: { cliName, ...(options ?? {}) },
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
/** Show ancestor chain and descendant tree for a runtime context */
|
|
471
|
+
lineage: async (contextId) => {
|
|
472
|
+
return this.transport.call({
|
|
473
|
+
groupSegments: ["context"],
|
|
474
|
+
command: "lineage",
|
|
475
|
+
body: { contextId },
|
|
476
|
+
});
|
|
477
|
+
},
|
|
478
|
+
/** List issued runtime contexts without exposing context keys */
|
|
479
|
+
list: async (options) => {
|
|
480
|
+
return this.transport.call({
|
|
481
|
+
groupSegments: ["context"],
|
|
482
|
+
command: "list",
|
|
483
|
+
body: { ...(options ?? {}) },
|
|
484
|
+
});
|
|
485
|
+
},
|
|
486
|
+
/** Revoke a runtime context by context ID */
|
|
487
|
+
revoke: async (contextId, options) => {
|
|
488
|
+
return this.transport.call({
|
|
489
|
+
groupSegments: ["context"],
|
|
490
|
+
command: "revoke",
|
|
491
|
+
body: { contextId, ...(options ?? {}) },
|
|
492
|
+
});
|
|
493
|
+
},
|
|
494
|
+
/** Resolve the current runtime context */
|
|
495
|
+
whoami: async () => {
|
|
496
|
+
return this.transport.call({
|
|
497
|
+
groupSegments: ["context"],
|
|
498
|
+
command: "whoami",
|
|
499
|
+
body: {},
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
costs = {
|
|
504
|
+
/** Show detailed cost summary for one agent */
|
|
505
|
+
agent: async (agentId, options) => {
|
|
506
|
+
return this.transport.call({
|
|
507
|
+
groupSegments: ["costs"],
|
|
508
|
+
command: "agent",
|
|
509
|
+
body: { agentId, ...(options ?? {}) },
|
|
510
|
+
});
|
|
511
|
+
},
|
|
512
|
+
/** Show cost breakdown by agent */
|
|
513
|
+
agents: async (options) => {
|
|
514
|
+
return this.transport.call({
|
|
515
|
+
groupSegments: ["costs"],
|
|
516
|
+
command: "agents",
|
|
517
|
+
body: { ...(options ?? {}) },
|
|
518
|
+
});
|
|
519
|
+
},
|
|
520
|
+
/** Show detailed cost summary for one session */
|
|
521
|
+
session: async (nameOrKey) => {
|
|
522
|
+
return this.transport.call({
|
|
523
|
+
groupSegments: ["costs"],
|
|
524
|
+
command: "session",
|
|
525
|
+
body: { nameOrKey },
|
|
526
|
+
});
|
|
527
|
+
},
|
|
528
|
+
/** Show total cost summary for a recent window */
|
|
529
|
+
summary: async (options) => {
|
|
530
|
+
return this.transport.call({
|
|
531
|
+
groupSegments: ["costs"],
|
|
532
|
+
command: "summary",
|
|
533
|
+
body: { ...(options ?? {}) },
|
|
534
|
+
});
|
|
535
|
+
},
|
|
536
|
+
/** Show most expensive sessions */
|
|
537
|
+
topSessions: async (options) => {
|
|
538
|
+
return this.transport.call({
|
|
539
|
+
groupSegments: ["costs"],
|
|
540
|
+
command: "top-sessions",
|
|
541
|
+
body: { ...(options ?? {}) },
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
cron = {
|
|
546
|
+
/** Add a new scheduled job */
|
|
547
|
+
add: async (name, options) => {
|
|
548
|
+
return this.transport.call({
|
|
549
|
+
groupSegments: ["cron"],
|
|
550
|
+
command: "add",
|
|
551
|
+
body: { name, ...(options ?? {}) },
|
|
552
|
+
});
|
|
553
|
+
},
|
|
554
|
+
/** Disable a job */
|
|
555
|
+
disable: async (id) => {
|
|
556
|
+
return this.transport.call({
|
|
557
|
+
groupSegments: ["cron"],
|
|
558
|
+
command: "disable",
|
|
559
|
+
body: { id },
|
|
560
|
+
});
|
|
561
|
+
},
|
|
562
|
+
/** Enable a job */
|
|
563
|
+
enable: async (id) => {
|
|
564
|
+
return this.transport.call({
|
|
565
|
+
groupSegments: ["cron"],
|
|
566
|
+
command: "enable",
|
|
567
|
+
body: { id },
|
|
568
|
+
});
|
|
569
|
+
},
|
|
570
|
+
/** List all scheduled jobs */
|
|
571
|
+
list: async () => {
|
|
572
|
+
return this.transport.call({
|
|
573
|
+
groupSegments: ["cron"],
|
|
574
|
+
command: "list",
|
|
575
|
+
body: {},
|
|
576
|
+
});
|
|
577
|
+
},
|
|
578
|
+
/** Delete a job */
|
|
579
|
+
rm: async (id) => {
|
|
580
|
+
return this.transport.call({
|
|
581
|
+
groupSegments: ["cron"],
|
|
582
|
+
command: "rm",
|
|
583
|
+
body: { id },
|
|
584
|
+
});
|
|
585
|
+
},
|
|
586
|
+
/** Manually run a job (ignores schedule) */
|
|
587
|
+
run: async (id) => {
|
|
588
|
+
return this.transport.call({
|
|
589
|
+
groupSegments: ["cron"],
|
|
590
|
+
command: "run",
|
|
591
|
+
body: { id },
|
|
592
|
+
});
|
|
593
|
+
},
|
|
594
|
+
/** Set job property */
|
|
595
|
+
set: async (id, key, value) => {
|
|
596
|
+
return this.transport.call({
|
|
597
|
+
groupSegments: ["cron"],
|
|
598
|
+
command: "set",
|
|
599
|
+
body: { id, key, value },
|
|
600
|
+
});
|
|
601
|
+
},
|
|
602
|
+
/** Show job details */
|
|
603
|
+
show: async (id) => {
|
|
604
|
+
return this.transport.call({
|
|
605
|
+
groupSegments: ["cron"],
|
|
606
|
+
command: "show",
|
|
607
|
+
body: { id },
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
daemon = {
|
|
612
|
+
/** Run daemon in dev mode with auto-rebuild on file changes */
|
|
613
|
+
dev: async () => {
|
|
614
|
+
return this.transport.call({
|
|
615
|
+
groupSegments: ["daemon"],
|
|
616
|
+
command: "dev",
|
|
617
|
+
body: {},
|
|
618
|
+
});
|
|
619
|
+
},
|
|
620
|
+
/** Edit environment file (~/.ravi/.env) */
|
|
621
|
+
env: async () => {
|
|
622
|
+
return this.transport.call({
|
|
623
|
+
groupSegments: ["daemon"],
|
|
624
|
+
command: "env",
|
|
625
|
+
body: {},
|
|
626
|
+
});
|
|
627
|
+
},
|
|
628
|
+
/** Bootstrap the admin runtime context-key. Refuses to run if any live admin context already exists. */
|
|
629
|
+
initAdminKey: async (options) => {
|
|
630
|
+
return this.transport.call({
|
|
631
|
+
groupSegments: ["daemon"],
|
|
632
|
+
command: "init-admin-key",
|
|
633
|
+
body: { ...(options ?? {}) },
|
|
634
|
+
});
|
|
635
|
+
},
|
|
636
|
+
/** Save PM2 process list and suggest startup */
|
|
637
|
+
install: async () => {
|
|
638
|
+
return this.transport.call({
|
|
639
|
+
groupSegments: ["daemon"],
|
|
640
|
+
command: "install",
|
|
641
|
+
body: {},
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
/** Show daemon logs (PM2) */
|
|
645
|
+
logs: async (options) => {
|
|
646
|
+
return this.transport.call({
|
|
647
|
+
groupSegments: ["daemon"],
|
|
648
|
+
command: "logs",
|
|
649
|
+
body: { ...(options ?? {}) },
|
|
650
|
+
});
|
|
651
|
+
},
|
|
652
|
+
/** Restart the daemon */
|
|
653
|
+
restart: async (options) => {
|
|
654
|
+
return this.transport.call({
|
|
655
|
+
groupSegments: ["daemon"],
|
|
656
|
+
command: "restart",
|
|
657
|
+
body: { ...(options ?? {}) },
|
|
658
|
+
});
|
|
659
|
+
},
|
|
660
|
+
/** Run daemon in foreground (used by PM2) */
|
|
661
|
+
run: async () => {
|
|
662
|
+
return this.transport.call({
|
|
663
|
+
groupSegments: ["daemon"],
|
|
664
|
+
command: "run",
|
|
665
|
+
body: {},
|
|
666
|
+
});
|
|
667
|
+
},
|
|
668
|
+
/** Start the daemon via PM2 */
|
|
669
|
+
start: async () => {
|
|
670
|
+
return this.transport.call({
|
|
671
|
+
groupSegments: ["daemon"],
|
|
672
|
+
command: "start",
|
|
673
|
+
body: {},
|
|
674
|
+
});
|
|
675
|
+
},
|
|
676
|
+
/** Show daemon and infrastructure status */
|
|
677
|
+
status: async () => {
|
|
678
|
+
return this.transport.call({
|
|
679
|
+
groupSegments: ["daemon"],
|
|
680
|
+
command: "status",
|
|
681
|
+
body: {},
|
|
682
|
+
});
|
|
683
|
+
},
|
|
684
|
+
/** Stop the daemon */
|
|
685
|
+
stop: async () => {
|
|
686
|
+
return this.transport.call({
|
|
687
|
+
groupSegments: ["daemon"],
|
|
688
|
+
command: "stop",
|
|
689
|
+
body: {},
|
|
690
|
+
});
|
|
691
|
+
},
|
|
692
|
+
/** Remove ravi from PM2 and clean up */
|
|
693
|
+
uninstall: async () => {
|
|
694
|
+
return this.transport.call({
|
|
695
|
+
groupSegments: ["daemon"],
|
|
696
|
+
command: "uninstall",
|
|
697
|
+
body: {},
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
devin = {
|
|
702
|
+
auth: {
|
|
703
|
+
/** Validate Devin API credentials */
|
|
704
|
+
check: async () => {
|
|
705
|
+
return this.transport.call({
|
|
706
|
+
groupSegments: ["devin", "auth"],
|
|
707
|
+
command: "check",
|
|
708
|
+
body: {},
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
sessions: {
|
|
713
|
+
/** Archive a Devin session */
|
|
714
|
+
archive: async (session) => {
|
|
715
|
+
return this.transport.call({
|
|
716
|
+
groupSegments: ["devin", "sessions"],
|
|
717
|
+
command: "archive",
|
|
718
|
+
body: { session },
|
|
719
|
+
});
|
|
720
|
+
},
|
|
721
|
+
/** List and cache session attachments */
|
|
722
|
+
attachments: async (session, options) => {
|
|
723
|
+
return this.transport.call({
|
|
724
|
+
groupSegments: ["devin", "sessions"],
|
|
725
|
+
command: "attachments",
|
|
726
|
+
body: { session, ...(options ?? {}) },
|
|
727
|
+
});
|
|
728
|
+
},
|
|
729
|
+
/** Create a Devin session */
|
|
730
|
+
create: async (options) => {
|
|
731
|
+
return this.transport.call({
|
|
732
|
+
groupSegments: ["devin", "sessions"],
|
|
733
|
+
command: "create",
|
|
734
|
+
body: { ...(options ?? {}) },
|
|
735
|
+
});
|
|
736
|
+
},
|
|
737
|
+
/** Show Devin session insights/activity summary */
|
|
738
|
+
insights: async (session, options) => {
|
|
739
|
+
return this.transport.call({
|
|
740
|
+
groupSegments: ["devin", "sessions"],
|
|
741
|
+
command: "insights",
|
|
742
|
+
body: { session, ...(options ?? {}) },
|
|
743
|
+
});
|
|
744
|
+
},
|
|
745
|
+
/** List local or remote Devin sessions */
|
|
746
|
+
list: async (options) => {
|
|
747
|
+
return this.transport.call({
|
|
748
|
+
groupSegments: ["devin", "sessions"],
|
|
749
|
+
command: "list",
|
|
750
|
+
body: { ...(options ?? {}) },
|
|
751
|
+
});
|
|
752
|
+
},
|
|
753
|
+
/** List and cache session messages */
|
|
754
|
+
messages: async (session, options) => {
|
|
755
|
+
return this.transport.call({
|
|
756
|
+
groupSegments: ["devin", "sessions"],
|
|
757
|
+
command: "messages",
|
|
758
|
+
body: { session, ...(options ?? {}) },
|
|
759
|
+
});
|
|
760
|
+
},
|
|
761
|
+
/** Send a message to a Devin session */
|
|
762
|
+
send: async (session, message, options) => {
|
|
763
|
+
return this.transport.call({
|
|
764
|
+
groupSegments: ["devin", "sessions"],
|
|
765
|
+
command: "send",
|
|
766
|
+
body: { session, message, ...(options ?? {}) },
|
|
767
|
+
});
|
|
768
|
+
},
|
|
769
|
+
/** Show one Devin session */
|
|
770
|
+
show: async (session, options) => {
|
|
771
|
+
return this.transport.call({
|
|
772
|
+
groupSegments: ["devin", "sessions"],
|
|
773
|
+
command: "show",
|
|
774
|
+
body: { session, ...(options ?? {}) },
|
|
775
|
+
});
|
|
776
|
+
},
|
|
777
|
+
/** Sync session status, messages and attachments */
|
|
778
|
+
sync: async (session, options) => {
|
|
779
|
+
return this.transport.call({
|
|
780
|
+
groupSegments: ["devin", "sessions"],
|
|
781
|
+
command: "sync",
|
|
782
|
+
body: { session, ...(options ?? {}) },
|
|
783
|
+
});
|
|
784
|
+
},
|
|
785
|
+
/** Terminate a Devin session */
|
|
786
|
+
terminate: async (session, options) => {
|
|
787
|
+
return this.transport.call({
|
|
788
|
+
groupSegments: ["devin", "sessions"],
|
|
789
|
+
command: "terminate",
|
|
790
|
+
body: { session, ...(options ?? {}) },
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
eval = {
|
|
796
|
+
/** Run an eval task spec and persist artifacts */
|
|
797
|
+
run: async (specPath, options) => {
|
|
798
|
+
return this.transport.call({
|
|
799
|
+
groupSegments: ["eval"],
|
|
800
|
+
command: "run",
|
|
801
|
+
body: { specPath, ...(options ?? {}) },
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
events = {
|
|
806
|
+
/** Replay persisted JetStream events with filters */
|
|
807
|
+
replay: async (options) => {
|
|
808
|
+
return this.transport.call({
|
|
809
|
+
groupSegments: ["events"],
|
|
810
|
+
command: "replay",
|
|
811
|
+
body: { ...(options ?? {}) },
|
|
812
|
+
});
|
|
813
|
+
},
|
|
814
|
+
/** Stream all events in real-time (default command) */
|
|
815
|
+
stream: async (options) => {
|
|
816
|
+
return this.transport.call({
|
|
817
|
+
groupSegments: ["events"],
|
|
818
|
+
command: "stream",
|
|
819
|
+
body: { ...(options ?? {}) },
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
heartbeat = {
|
|
824
|
+
/** Disable heartbeat for an agent */
|
|
825
|
+
disable: async (id) => {
|
|
826
|
+
return this.transport.call({
|
|
827
|
+
groupSegments: ["heartbeat"],
|
|
828
|
+
command: "disable",
|
|
829
|
+
body: { id },
|
|
830
|
+
});
|
|
831
|
+
},
|
|
832
|
+
/** Enable heartbeat for an agent */
|
|
833
|
+
enable: async (id, interval) => {
|
|
834
|
+
return this.transport.call({
|
|
835
|
+
groupSegments: ["heartbeat"],
|
|
836
|
+
command: "enable",
|
|
837
|
+
body: { id, interval },
|
|
838
|
+
});
|
|
839
|
+
},
|
|
840
|
+
/** Set heartbeat property */
|
|
841
|
+
set: async (id, key, value) => {
|
|
842
|
+
return this.transport.call({
|
|
843
|
+
groupSegments: ["heartbeat"],
|
|
844
|
+
command: "set",
|
|
845
|
+
body: { id, key, value },
|
|
846
|
+
});
|
|
847
|
+
},
|
|
848
|
+
/** Show heartbeat config for an agent */
|
|
849
|
+
show: async (id) => {
|
|
850
|
+
return this.transport.call({
|
|
851
|
+
groupSegments: ["heartbeat"],
|
|
852
|
+
command: "show",
|
|
853
|
+
body: { id },
|
|
854
|
+
});
|
|
855
|
+
},
|
|
856
|
+
/** Show heartbeat status for all agents */
|
|
857
|
+
status: async () => {
|
|
858
|
+
return this.transport.call({
|
|
859
|
+
groupSegments: ["heartbeat"],
|
|
860
|
+
command: "status",
|
|
861
|
+
body: {},
|
|
862
|
+
});
|
|
863
|
+
},
|
|
864
|
+
/** Manually trigger a heartbeat */
|
|
865
|
+
trigger: async (id) => {
|
|
866
|
+
return this.transport.call({
|
|
867
|
+
groupSegments: ["heartbeat"],
|
|
868
|
+
command: "trigger",
|
|
869
|
+
body: { id },
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
};
|
|
873
|
+
hooks = {
|
|
874
|
+
/** Create a new runtime hook */
|
|
875
|
+
create: async (name, options) => {
|
|
876
|
+
return this.transport.call({
|
|
877
|
+
groupSegments: ["hooks"],
|
|
878
|
+
command: "create",
|
|
879
|
+
body: { name, ...(options ?? {}) },
|
|
880
|
+
});
|
|
881
|
+
},
|
|
882
|
+
/** Disable a hook */
|
|
883
|
+
disable: async (id) => {
|
|
884
|
+
return this.transport.call({
|
|
885
|
+
groupSegments: ["hooks"],
|
|
886
|
+
command: "disable",
|
|
887
|
+
body: { id },
|
|
888
|
+
});
|
|
889
|
+
},
|
|
890
|
+
/** Enable a hook */
|
|
891
|
+
enable: async (id) => {
|
|
892
|
+
return this.transport.call({
|
|
893
|
+
groupSegments: ["hooks"],
|
|
894
|
+
command: "enable",
|
|
895
|
+
body: { id },
|
|
896
|
+
});
|
|
897
|
+
},
|
|
898
|
+
/** List configured hooks */
|
|
899
|
+
list: async () => {
|
|
900
|
+
return this.transport.call({
|
|
901
|
+
groupSegments: ["hooks"],
|
|
902
|
+
command: "list",
|
|
903
|
+
body: {},
|
|
904
|
+
});
|
|
905
|
+
},
|
|
906
|
+
/** Delete a hook */
|
|
907
|
+
rm: async (id) => {
|
|
908
|
+
return this.transport.call({
|
|
909
|
+
groupSegments: ["hooks"],
|
|
910
|
+
command: "rm",
|
|
911
|
+
body: { id },
|
|
912
|
+
});
|
|
913
|
+
},
|
|
914
|
+
/** Show hook details */
|
|
915
|
+
show: async (id) => {
|
|
916
|
+
return this.transport.call({
|
|
917
|
+
groupSegments: ["hooks"],
|
|
918
|
+
command: "show",
|
|
919
|
+
body: { id },
|
|
920
|
+
});
|
|
921
|
+
},
|
|
922
|
+
/** Execute a hook once with a synthetic event */
|
|
923
|
+
test: async (id) => {
|
|
924
|
+
return this.transport.call({
|
|
925
|
+
groupSegments: ["hooks"],
|
|
926
|
+
command: "test",
|
|
927
|
+
body: { id },
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
image = {
|
|
932
|
+
atlas: {
|
|
933
|
+
/** Split an image atlas/contact sheet into deterministic crop artifacts */
|
|
934
|
+
split: async (input, options) => {
|
|
935
|
+
return this.transport.call({
|
|
936
|
+
groupSegments: ["image", "atlas"],
|
|
937
|
+
command: "split",
|
|
938
|
+
body: { input, ...(options ?? {}) },
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
/** Generate an image from a text prompt */
|
|
943
|
+
generate: async (prompt, options) => {
|
|
944
|
+
return this.transport.call({
|
|
945
|
+
groupSegments: ["image"],
|
|
946
|
+
command: "generate",
|
|
947
|
+
body: { prompt, ...(options ?? {}) },
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
insights = {
|
|
952
|
+
/** Create a new insight with lineage captured from the current runtime context */
|
|
953
|
+
create: async (summary, options) => {
|
|
954
|
+
return this.transport.call({
|
|
955
|
+
groupSegments: ["insights"],
|
|
956
|
+
command: "create",
|
|
957
|
+
body: { summary, ...(options ?? {}) },
|
|
958
|
+
});
|
|
959
|
+
},
|
|
960
|
+
/** List recent insights with optional filters */
|
|
961
|
+
list: async (options) => {
|
|
962
|
+
return this.transport.call({
|
|
963
|
+
groupSegments: ["insights"],
|
|
964
|
+
command: "list",
|
|
965
|
+
body: { ...(options ?? {}) },
|
|
966
|
+
});
|
|
967
|
+
},
|
|
968
|
+
/** Search insights by free text */
|
|
969
|
+
search: async (text, options) => {
|
|
970
|
+
return this.transport.call({
|
|
971
|
+
groupSegments: ["insights"],
|
|
972
|
+
command: "search",
|
|
973
|
+
body: { text, ...(options ?? {}) },
|
|
974
|
+
});
|
|
975
|
+
},
|
|
976
|
+
/** Show one insight with lineage and comments */
|
|
977
|
+
show: async (id) => {
|
|
978
|
+
return this.transport.call({
|
|
979
|
+
groupSegments: ["insights"],
|
|
980
|
+
command: "show",
|
|
981
|
+
body: { id },
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
instances = {
|
|
986
|
+
/** Connect an instance to omni (QR code for WhatsApp) */
|
|
987
|
+
connect: async (name, options) => {
|
|
988
|
+
return this.transport.call({
|
|
989
|
+
groupSegments: ["instances"],
|
|
990
|
+
command: "connect",
|
|
991
|
+
body: { name, ...(options ?? {}) },
|
|
992
|
+
});
|
|
993
|
+
},
|
|
994
|
+
/** Create a new instance */
|
|
995
|
+
create: async (name, options) => {
|
|
996
|
+
return this.transport.call({
|
|
997
|
+
groupSegments: ["instances"],
|
|
998
|
+
command: "create",
|
|
999
|
+
body: { name, ...(options ?? {}) },
|
|
1000
|
+
});
|
|
1001
|
+
},
|
|
1002
|
+
/** Delete an instance (soft-delete, recoverable) */
|
|
1003
|
+
delete: async (name) => {
|
|
1004
|
+
return this.transport.call({
|
|
1005
|
+
groupSegments: ["instances"],
|
|
1006
|
+
command: "delete",
|
|
1007
|
+
body: { name },
|
|
1008
|
+
});
|
|
1009
|
+
},
|
|
1010
|
+
/** List soft-deleted instances */
|
|
1011
|
+
deleted: async () => {
|
|
1012
|
+
return this.transport.call({
|
|
1013
|
+
groupSegments: ["instances"],
|
|
1014
|
+
command: "deleted",
|
|
1015
|
+
body: {},
|
|
1016
|
+
});
|
|
1017
|
+
},
|
|
1018
|
+
/** Disable an instance in Ravi without changing omni */
|
|
1019
|
+
disable: async (target) => {
|
|
1020
|
+
return this.transport.call({
|
|
1021
|
+
groupSegments: ["instances"],
|
|
1022
|
+
command: "disable",
|
|
1023
|
+
body: { target },
|
|
1024
|
+
});
|
|
1025
|
+
},
|
|
1026
|
+
/** Disconnect an instance from omni */
|
|
1027
|
+
disconnect: async (name) => {
|
|
1028
|
+
return this.transport.call({
|
|
1029
|
+
groupSegments: ["instances"],
|
|
1030
|
+
command: "disconnect",
|
|
1031
|
+
body: { name },
|
|
1032
|
+
});
|
|
1033
|
+
},
|
|
1034
|
+
/** Enable an instance in Ravi without changing omni */
|
|
1035
|
+
enable: async (target) => {
|
|
1036
|
+
return this.transport.call({
|
|
1037
|
+
groupSegments: ["instances"],
|
|
1038
|
+
command: "enable",
|
|
1039
|
+
body: { target },
|
|
1040
|
+
});
|
|
1041
|
+
},
|
|
1042
|
+
/** Get an instance property */
|
|
1043
|
+
get: async (name, key) => {
|
|
1044
|
+
return this.transport.call({
|
|
1045
|
+
groupSegments: ["instances"],
|
|
1046
|
+
command: "get",
|
|
1047
|
+
body: { name, key },
|
|
1048
|
+
});
|
|
1049
|
+
},
|
|
1050
|
+
/** List all instances */
|
|
1051
|
+
list: async () => {
|
|
1052
|
+
return this.transport.call({
|
|
1053
|
+
groupSegments: ["instances"],
|
|
1054
|
+
command: "list",
|
|
1055
|
+
body: {},
|
|
1056
|
+
});
|
|
1057
|
+
},
|
|
1058
|
+
pending: {
|
|
1059
|
+
/** Approve a pending contact or chat */
|
|
1060
|
+
approve: async (name, contact, options) => {
|
|
1061
|
+
return this.transport.call({
|
|
1062
|
+
groupSegments: ["instances", "pending"],
|
|
1063
|
+
command: "approve",
|
|
1064
|
+
body: { name, contact, ...(options ?? {}) },
|
|
1065
|
+
});
|
|
1066
|
+
},
|
|
1067
|
+
/** List pending contacts and chats for an instance */
|
|
1068
|
+
list: async (name) => {
|
|
1069
|
+
return this.transport.call({
|
|
1070
|
+
groupSegments: ["instances", "pending"],
|
|
1071
|
+
command: "list",
|
|
1072
|
+
body: { name },
|
|
1073
|
+
});
|
|
1074
|
+
},
|
|
1075
|
+
/** Reject and remove a pending contact or chat */
|
|
1076
|
+
reject: async (name, contact) => {
|
|
1077
|
+
return this.transport.call({
|
|
1078
|
+
groupSegments: ["instances", "pending"],
|
|
1079
|
+
command: "reject",
|
|
1080
|
+
body: { name, contact },
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
/** Restore a soft-deleted instance */
|
|
1085
|
+
restore: async (name) => {
|
|
1086
|
+
return this.transport.call({
|
|
1087
|
+
groupSegments: ["instances"],
|
|
1088
|
+
command: "restore",
|
|
1089
|
+
body: { name },
|
|
1090
|
+
});
|
|
1091
|
+
},
|
|
1092
|
+
routes: {
|
|
1093
|
+
/** Add a route to an instance */
|
|
1094
|
+
add: async (name, pattern, agent, options) => {
|
|
1095
|
+
return this.transport.call({
|
|
1096
|
+
groupSegments: ["instances", "routes"],
|
|
1097
|
+
command: "add",
|
|
1098
|
+
body: { name, pattern, agent, ...(options ?? {}) },
|
|
1099
|
+
});
|
|
1100
|
+
},
|
|
1101
|
+
/** List soft-deleted routes */
|
|
1102
|
+
deleted: async (name) => {
|
|
1103
|
+
return this.transport.call({
|
|
1104
|
+
groupSegments: ["instances", "routes"],
|
|
1105
|
+
command: "deleted",
|
|
1106
|
+
body: { name },
|
|
1107
|
+
});
|
|
1108
|
+
},
|
|
1109
|
+
/** List routes for an instance */
|
|
1110
|
+
list: async (name) => {
|
|
1111
|
+
return this.transport.call({
|
|
1112
|
+
groupSegments: ["instances", "routes"],
|
|
1113
|
+
command: "list",
|
|
1114
|
+
body: { name },
|
|
1115
|
+
});
|
|
1116
|
+
},
|
|
1117
|
+
/** Remove a route (soft-delete, recoverable) */
|
|
1118
|
+
remove: async (name, pattern, options) => {
|
|
1119
|
+
return this.transport.call({
|
|
1120
|
+
groupSegments: ["instances", "routes"],
|
|
1121
|
+
command: "remove",
|
|
1122
|
+
body: { name, pattern, ...(options ?? {}) },
|
|
1123
|
+
});
|
|
1124
|
+
},
|
|
1125
|
+
/** Restore a soft-deleted route */
|
|
1126
|
+
restore: async (name, pattern, options) => {
|
|
1127
|
+
return this.transport.call({
|
|
1128
|
+
groupSegments: ["instances", "routes"],
|
|
1129
|
+
command: "restore",
|
|
1130
|
+
body: { name, pattern, ...(options ?? {}) },
|
|
1131
|
+
});
|
|
1132
|
+
},
|
|
1133
|
+
/** Set a route property */
|
|
1134
|
+
set: async (name, pattern, key, value, options) => {
|
|
1135
|
+
return this.transport.call({
|
|
1136
|
+
groupSegments: ["instances", "routes"],
|
|
1137
|
+
command: "set",
|
|
1138
|
+
body: { name, pattern, key, value, ...(options ?? {}) },
|
|
1139
|
+
});
|
|
1140
|
+
},
|
|
1141
|
+
/** Show route details */
|
|
1142
|
+
show: async (name, pattern) => {
|
|
1143
|
+
return this.transport.call({
|
|
1144
|
+
groupSegments: ["instances", "routes"],
|
|
1145
|
+
command: "show",
|
|
1146
|
+
body: { name, pattern },
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
/** Set an instance property */
|
|
1151
|
+
set: async (name, key, value) => {
|
|
1152
|
+
return this.transport.call({
|
|
1153
|
+
groupSegments: ["instances"],
|
|
1154
|
+
command: "set",
|
|
1155
|
+
body: { name, key, value },
|
|
1156
|
+
});
|
|
1157
|
+
},
|
|
1158
|
+
/** Show instance details */
|
|
1159
|
+
show: async (name) => {
|
|
1160
|
+
return this.transport.call({
|
|
1161
|
+
groupSegments: ["instances"],
|
|
1162
|
+
command: "show",
|
|
1163
|
+
body: { name },
|
|
1164
|
+
});
|
|
1165
|
+
},
|
|
1166
|
+
/** Show connection status for an instance */
|
|
1167
|
+
status: async (name) => {
|
|
1168
|
+
return this.transport.call({
|
|
1169
|
+
groupSegments: ["instances"],
|
|
1170
|
+
command: "status",
|
|
1171
|
+
body: { name },
|
|
1172
|
+
});
|
|
1173
|
+
},
|
|
1174
|
+
/** Explain which runtime, DB, and live instance this CLI would affect */
|
|
1175
|
+
target: async (name, options) => {
|
|
1176
|
+
return this.transport.call({
|
|
1177
|
+
groupSegments: ["instances"],
|
|
1178
|
+
command: "target",
|
|
1179
|
+
body: { name, ...(options ?? {}) },
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
media = {
|
|
1184
|
+
/** Send a media file (image, video, audio, document) */
|
|
1185
|
+
send: async (filePath, options) => {
|
|
1186
|
+
return this.transport.call({
|
|
1187
|
+
groupSegments: ["media"],
|
|
1188
|
+
command: "send",
|
|
1189
|
+
body: { filePath, ...(options ?? {}) },
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
};
|
|
1193
|
+
permissions = {
|
|
1194
|
+
/** Check if a subject has a permission on an object */
|
|
1195
|
+
check: async (subject, permission, object) => {
|
|
1196
|
+
return this.transport.call({
|
|
1197
|
+
groupSegments: ["permissions"],
|
|
1198
|
+
command: "check",
|
|
1199
|
+
body: { subject, permission, object },
|
|
1200
|
+
});
|
|
1201
|
+
},
|
|
1202
|
+
/** Clear all manual relations */
|
|
1203
|
+
clear: async (options) => {
|
|
1204
|
+
return this.transport.call({
|
|
1205
|
+
groupSegments: ["permissions"],
|
|
1206
|
+
command: "clear",
|
|
1207
|
+
body: { ...(options ?? {}) },
|
|
1208
|
+
});
|
|
1209
|
+
},
|
|
1210
|
+
/** Grant a relation */
|
|
1211
|
+
grant: async (subject, relation, object) => {
|
|
1212
|
+
return this.transport.call({
|
|
1213
|
+
groupSegments: ["permissions"],
|
|
1214
|
+
command: "grant",
|
|
1215
|
+
body: { subject, relation, object },
|
|
1216
|
+
});
|
|
1217
|
+
},
|
|
1218
|
+
/** Apply a permission template to an agent */
|
|
1219
|
+
init: async (subject, template) => {
|
|
1220
|
+
return this.transport.call({
|
|
1221
|
+
groupSegments: ["permissions"],
|
|
1222
|
+
command: "init",
|
|
1223
|
+
body: { subject, template },
|
|
1224
|
+
});
|
|
1225
|
+
},
|
|
1226
|
+
/** List relations */
|
|
1227
|
+
list: async (options) => {
|
|
1228
|
+
return this.transport.call({
|
|
1229
|
+
groupSegments: ["permissions"],
|
|
1230
|
+
command: "list",
|
|
1231
|
+
body: { ...(options ?? {}) },
|
|
1232
|
+
});
|
|
1233
|
+
},
|
|
1234
|
+
/** Revoke a relation */
|
|
1235
|
+
revoke: async (subject, relation, object) => {
|
|
1236
|
+
return this.transport.call({
|
|
1237
|
+
groupSegments: ["permissions"],
|
|
1238
|
+
command: "revoke",
|
|
1239
|
+
body: { subject, relation, object },
|
|
1240
|
+
});
|
|
1241
|
+
},
|
|
1242
|
+
/** Re-sync relations from agent configs */
|
|
1243
|
+
sync: async () => {
|
|
1244
|
+
return this.transport.call({
|
|
1245
|
+
groupSegments: ["permissions"],
|
|
1246
|
+
command: "sync",
|
|
1247
|
+
body: {},
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
projects = {
|
|
1252
|
+
/** Create one project */
|
|
1253
|
+
create: async (title, options) => {
|
|
1254
|
+
return this.transport.call({
|
|
1255
|
+
groupSegments: ["projects"],
|
|
1256
|
+
command: "create",
|
|
1257
|
+
body: { title, ...(options ?? {}) },
|
|
1258
|
+
});
|
|
1259
|
+
},
|
|
1260
|
+
fixtures: {
|
|
1261
|
+
/** Reset and seed the canonical project fixtures used in demos and smoke tests */
|
|
1262
|
+
seed: async (options) => {
|
|
1263
|
+
return this.transport.call({
|
|
1264
|
+
groupSegments: ["projects", "fixtures"],
|
|
1265
|
+
command: "seed",
|
|
1266
|
+
body: { ...(options ?? {}) },
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
/** Materialize a project with cheap links and optional canonical workflows */
|
|
1271
|
+
init: async (title, options) => {
|
|
1272
|
+
return this.transport.call({
|
|
1273
|
+
groupSegments: ["projects"],
|
|
1274
|
+
command: "init",
|
|
1275
|
+
body: { title, ...(options ?? {}) },
|
|
1276
|
+
});
|
|
1277
|
+
},
|
|
1278
|
+
/** Link workflow/session/agent/resource/spec context to a project */
|
|
1279
|
+
link: async (assetType, project, target, options) => {
|
|
1280
|
+
return this.transport.call({
|
|
1281
|
+
groupSegments: ["projects"],
|
|
1282
|
+
command: "link",
|
|
1283
|
+
body: { assetType, project, target, ...(options ?? {}) },
|
|
1284
|
+
});
|
|
1285
|
+
},
|
|
1286
|
+
/** List projects */
|
|
1287
|
+
list: async (options) => {
|
|
1288
|
+
return this.transport.call({
|
|
1289
|
+
groupSegments: ["projects"],
|
|
1290
|
+
command: "list",
|
|
1291
|
+
body: { ...(options ?? {}) },
|
|
1292
|
+
});
|
|
1293
|
+
},
|
|
1294
|
+
/** List projects as an operational next-work surface */
|
|
1295
|
+
next: async (options) => {
|
|
1296
|
+
return this.transport.call({
|
|
1297
|
+
groupSegments: ["projects"],
|
|
1298
|
+
command: "next",
|
|
1299
|
+
body: { ...(options ?? {}) },
|
|
1300
|
+
});
|
|
1301
|
+
},
|
|
1302
|
+
resources: {
|
|
1303
|
+
/** Add one resource link to a project */
|
|
1304
|
+
add: async (project, target, options) => {
|
|
1305
|
+
return this.transport.call({
|
|
1306
|
+
groupSegments: ["projects", "resources"],
|
|
1307
|
+
command: "add",
|
|
1308
|
+
body: { project, target, ...(options ?? {}) },
|
|
1309
|
+
});
|
|
1310
|
+
},
|
|
1311
|
+
/** Import multiple cheap resources into a project */
|
|
1312
|
+
import: async (project, options) => {
|
|
1313
|
+
return this.transport.call({
|
|
1314
|
+
groupSegments: ["projects", "resources"],
|
|
1315
|
+
command: "import",
|
|
1316
|
+
body: { project, ...(options ?? {}) },
|
|
1317
|
+
});
|
|
1318
|
+
},
|
|
1319
|
+
/** List resource links for a project */
|
|
1320
|
+
list: async (project, options) => {
|
|
1321
|
+
return this.transport.call({
|
|
1322
|
+
groupSegments: ["projects", "resources"],
|
|
1323
|
+
command: "list",
|
|
1324
|
+
body: { project, ...(options ?? {}) },
|
|
1325
|
+
});
|
|
1326
|
+
},
|
|
1327
|
+
/** Show one resource link on a project */
|
|
1328
|
+
show: async (project, resource) => {
|
|
1329
|
+
return this.transport.call({
|
|
1330
|
+
groupSegments: ["projects", "resources"],
|
|
1331
|
+
command: "show",
|
|
1332
|
+
body: { project, resource },
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
/** Show one project with linked context */
|
|
1337
|
+
show: async (project) => {
|
|
1338
|
+
return this.transport.call({
|
|
1339
|
+
groupSegments: ["projects"],
|
|
1340
|
+
command: "show",
|
|
1341
|
+
body: { project },
|
|
1342
|
+
});
|
|
1343
|
+
},
|
|
1344
|
+
/** Show one project with workflow runtime rollup */
|
|
1345
|
+
status: async (project) => {
|
|
1346
|
+
return this.transport.call({
|
|
1347
|
+
groupSegments: ["projects"],
|
|
1348
|
+
command: "status",
|
|
1349
|
+
body: { project },
|
|
1350
|
+
});
|
|
1351
|
+
},
|
|
1352
|
+
tasks: {
|
|
1353
|
+
/** Attach an existing task to a project workflow node */
|
|
1354
|
+
attach: async (project, nodeKey, taskId, options) => {
|
|
1355
|
+
return this.transport.call({
|
|
1356
|
+
groupSegments: ["projects", "tasks"],
|
|
1357
|
+
command: "attach",
|
|
1358
|
+
body: { project, nodeKey, taskId, ...(options ?? {}) },
|
|
1359
|
+
});
|
|
1360
|
+
},
|
|
1361
|
+
/** Create a task attempt from a project workflow node */
|
|
1362
|
+
create: async (project, nodeKey, title, options) => {
|
|
1363
|
+
return this.transport.call({
|
|
1364
|
+
groupSegments: ["projects", "tasks"],
|
|
1365
|
+
command: "create",
|
|
1366
|
+
body: { project, nodeKey, title, ...(options ?? {}) },
|
|
1367
|
+
});
|
|
1368
|
+
},
|
|
1369
|
+
/** Dispatch a task using project owner/session defaults */
|
|
1370
|
+
dispatch: async (project, taskId, options) => {
|
|
1371
|
+
return this.transport.call({
|
|
1372
|
+
groupSegments: ["projects", "tasks"],
|
|
1373
|
+
command: "dispatch",
|
|
1374
|
+
body: { project, taskId, ...(options ?? {}) },
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1378
|
+
/** Update one project */
|
|
1379
|
+
update: async (project, options) => {
|
|
1380
|
+
return this.transport.call({
|
|
1381
|
+
groupSegments: ["projects"],
|
|
1382
|
+
command: "update",
|
|
1383
|
+
body: { project, ...(options ?? {}) },
|
|
1384
|
+
});
|
|
1385
|
+
},
|
|
1386
|
+
workflows: {
|
|
1387
|
+
/** Attach one existing workflow run to a project in one step */
|
|
1388
|
+
attach: async (project, runId, options) => {
|
|
1389
|
+
return this.transport.call({
|
|
1390
|
+
groupSegments: ["projects", "workflows"],
|
|
1391
|
+
command: "attach",
|
|
1392
|
+
body: { project, runId, ...(options ?? {}) },
|
|
1393
|
+
});
|
|
1394
|
+
},
|
|
1395
|
+
/** Start one workflow run from a project and link it in one step */
|
|
1396
|
+
start: async (project, specId, options) => {
|
|
1397
|
+
return this.transport.call({
|
|
1398
|
+
groupSegments: ["projects", "workflows"],
|
|
1399
|
+
command: "start",
|
|
1400
|
+
body: { project, specId, ...(options ?? {}) },
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1405
|
+
prox = {
|
|
1406
|
+
calls: {
|
|
1407
|
+
/** Cancel a pending call request */
|
|
1408
|
+
cancel: async (call_request_id, options) => {
|
|
1409
|
+
return this.transport.call({
|
|
1410
|
+
groupSegments: ["prox", "calls"],
|
|
1411
|
+
command: "cancel",
|
|
1412
|
+
body: { call_request_id, ...(options ?? {}) },
|
|
1413
|
+
});
|
|
1414
|
+
},
|
|
1415
|
+
/** Show event timeline for a call request */
|
|
1416
|
+
events: async (call_request_id) => {
|
|
1417
|
+
return this.transport.call({
|
|
1418
|
+
groupSegments: ["prox", "calls"],
|
|
1419
|
+
command: "events",
|
|
1420
|
+
body: { call_request_id },
|
|
1421
|
+
});
|
|
1422
|
+
},
|
|
1423
|
+
profiles: {
|
|
1424
|
+
/** Configure a call profile's provider settings */
|
|
1425
|
+
configure: async (profile_id, options) => {
|
|
1426
|
+
return this.transport.call({
|
|
1427
|
+
groupSegments: ["prox", "calls", "profiles"],
|
|
1428
|
+
command: "configure",
|
|
1429
|
+
body: { profile_id, ...(options ?? {}) },
|
|
1430
|
+
});
|
|
1431
|
+
},
|
|
1432
|
+
/** List available call profiles */
|
|
1433
|
+
list: async () => {
|
|
1434
|
+
return this.transport.call({
|
|
1435
|
+
groupSegments: ["prox", "calls", "profiles"],
|
|
1436
|
+
command: "list",
|
|
1437
|
+
body: {},
|
|
1438
|
+
});
|
|
1439
|
+
},
|
|
1440
|
+
/** Show a call profile by ID */
|
|
1441
|
+
show: async (profile_id) => {
|
|
1442
|
+
return this.transport.call({
|
|
1443
|
+
groupSegments: ["prox", "calls", "profiles"],
|
|
1444
|
+
command: "show",
|
|
1445
|
+
body: { profile_id },
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
/** Request a call to a person */
|
|
1450
|
+
request: async (options) => {
|
|
1451
|
+
return this.transport.call({
|
|
1452
|
+
groupSegments: ["prox", "calls"],
|
|
1453
|
+
command: "request",
|
|
1454
|
+
body: { ...(options ?? {}) },
|
|
1455
|
+
});
|
|
1456
|
+
},
|
|
1457
|
+
/** Show active call rules */
|
|
1458
|
+
rules: async (options) => {
|
|
1459
|
+
return this.transport.call({
|
|
1460
|
+
groupSegments: ["prox", "calls"],
|
|
1461
|
+
command: "rules",
|
|
1462
|
+
body: { ...(options ?? {}) },
|
|
1463
|
+
});
|
|
1464
|
+
},
|
|
1465
|
+
/** Show details of a call request */
|
|
1466
|
+
show: async (call_request_id) => {
|
|
1467
|
+
return this.transport.call({
|
|
1468
|
+
groupSegments: ["prox", "calls"],
|
|
1469
|
+
command: "show",
|
|
1470
|
+
body: { call_request_id },
|
|
1471
|
+
});
|
|
1472
|
+
},
|
|
1473
|
+
tools: {
|
|
1474
|
+
/** Bind a tool to a profile */
|
|
1475
|
+
bind: async (profile_id, tool_id, options) => {
|
|
1476
|
+
return this.transport.call({
|
|
1477
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1478
|
+
command: "bind",
|
|
1479
|
+
body: { profile_id, tool_id, ...(options ?? {}) },
|
|
1480
|
+
});
|
|
1481
|
+
},
|
|
1482
|
+
/** Configure a call tool */
|
|
1483
|
+
configure: async (tool_id, options) => {
|
|
1484
|
+
return this.transport.call({
|
|
1485
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1486
|
+
command: "configure",
|
|
1487
|
+
body: { tool_id, ...(options ?? {}) },
|
|
1488
|
+
});
|
|
1489
|
+
},
|
|
1490
|
+
/** Create a new call tool */
|
|
1491
|
+
create: async (tool_id, options) => {
|
|
1492
|
+
return this.transport.call({
|
|
1493
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1494
|
+
command: "create",
|
|
1495
|
+
body: { tool_id, ...(options ?? {}) },
|
|
1496
|
+
});
|
|
1497
|
+
},
|
|
1498
|
+
/** List call tools */
|
|
1499
|
+
list: async (options) => {
|
|
1500
|
+
return this.transport.call({
|
|
1501
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1502
|
+
command: "list",
|
|
1503
|
+
body: { ...(options ?? {}) },
|
|
1504
|
+
});
|
|
1505
|
+
},
|
|
1506
|
+
/** Execute a tool (dry-run validates without side effects) */
|
|
1507
|
+
run: async (tool_id, options) => {
|
|
1508
|
+
return this.transport.call({
|
|
1509
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1510
|
+
command: "run",
|
|
1511
|
+
body: { tool_id, ...(options ?? {}) },
|
|
1512
|
+
});
|
|
1513
|
+
},
|
|
1514
|
+
/** List tool runs for a call request */
|
|
1515
|
+
runs: async (call_request_id) => {
|
|
1516
|
+
return this.transport.call({
|
|
1517
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1518
|
+
command: "runs",
|
|
1519
|
+
body: { call_request_id },
|
|
1520
|
+
});
|
|
1521
|
+
},
|
|
1522
|
+
/** Show a call tool by ID */
|
|
1523
|
+
show: async (tool_id) => {
|
|
1524
|
+
return this.transport.call({
|
|
1525
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1526
|
+
command: "show",
|
|
1527
|
+
body: { tool_id },
|
|
1528
|
+
});
|
|
1529
|
+
},
|
|
1530
|
+
/** Unbind a tool from a profile */
|
|
1531
|
+
unbind: async (profile_id, tool_id) => {
|
|
1532
|
+
return this.transport.call({
|
|
1533
|
+
groupSegments: ["prox", "calls", "tools"],
|
|
1534
|
+
command: "unbind",
|
|
1535
|
+
body: { profile_id, tool_id },
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
},
|
|
1539
|
+
/** Show call transcript, syncing provider state when needed */
|
|
1540
|
+
transcript: async (call_request_id, options) => {
|
|
1541
|
+
return this.transport.call({
|
|
1542
|
+
groupSegments: ["prox", "calls"],
|
|
1543
|
+
command: "transcript",
|
|
1544
|
+
body: { call_request_id, ...(options ?? {}) },
|
|
1545
|
+
});
|
|
1546
|
+
},
|
|
1547
|
+
voiceAgents: {
|
|
1548
|
+
/** Bind a tool to a voice agent */
|
|
1549
|
+
bindTool: async (voice_agent_id, tool_id, options) => {
|
|
1550
|
+
return this.transport.call({
|
|
1551
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1552
|
+
command: "bind-tool",
|
|
1553
|
+
body: { voice_agent_id, tool_id, ...(options ?? {}) },
|
|
1554
|
+
});
|
|
1555
|
+
},
|
|
1556
|
+
/** Configure a voice agent */
|
|
1557
|
+
configure: async (voice_agent_id, options) => {
|
|
1558
|
+
return this.transport.call({
|
|
1559
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1560
|
+
command: "configure",
|
|
1561
|
+
body: { voice_agent_id, ...(options ?? {}) },
|
|
1562
|
+
});
|
|
1563
|
+
},
|
|
1564
|
+
/** Create a new voice agent */
|
|
1565
|
+
create: async (voice_agent_id, options) => {
|
|
1566
|
+
return this.transport.call({
|
|
1567
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1568
|
+
command: "create",
|
|
1569
|
+
body: { voice_agent_id, ...(options ?? {}) },
|
|
1570
|
+
});
|
|
1571
|
+
},
|
|
1572
|
+
/** List voice agents */
|
|
1573
|
+
list: async () => {
|
|
1574
|
+
return this.transport.call({
|
|
1575
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1576
|
+
command: "list",
|
|
1577
|
+
body: {},
|
|
1578
|
+
});
|
|
1579
|
+
},
|
|
1580
|
+
/** Show a voice agent by ID */
|
|
1581
|
+
show: async (voice_agent_id) => {
|
|
1582
|
+
return this.transport.call({
|
|
1583
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1584
|
+
command: "show",
|
|
1585
|
+
body: { voice_agent_id },
|
|
1586
|
+
});
|
|
1587
|
+
},
|
|
1588
|
+
/** Sync voice agent to provider (dry-run by default) */
|
|
1589
|
+
sync: async (voice_agent_id, options) => {
|
|
1590
|
+
return this.transport.call({
|
|
1591
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1592
|
+
command: "sync",
|
|
1593
|
+
body: { voice_agent_id, ...(options ?? {}) },
|
|
1594
|
+
});
|
|
1595
|
+
},
|
|
1596
|
+
/** Unbind a tool from a voice agent */
|
|
1597
|
+
unbindTool: async (voice_agent_id, tool_id) => {
|
|
1598
|
+
return this.transport.call({
|
|
1599
|
+
groupSegments: ["prox", "calls", "voice-agents"],
|
|
1600
|
+
command: "unbind-tool",
|
|
1601
|
+
body: { voice_agent_id, tool_id },
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
};
|
|
1607
|
+
react = {
|
|
1608
|
+
/** Send an emoji reaction to a message */
|
|
1609
|
+
send: async (messageId, emoji) => {
|
|
1610
|
+
return this.transport.call({
|
|
1611
|
+
groupSegments: ["react"],
|
|
1612
|
+
command: "send",
|
|
1613
|
+
body: { messageId, emoji },
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
routes = {
|
|
1618
|
+
/** Explain how a pattern resolves in config and the live router */
|
|
1619
|
+
explain: async (name, pattern, options) => {
|
|
1620
|
+
return this.transport.call({
|
|
1621
|
+
groupSegments: ["routes"],
|
|
1622
|
+
command: "explain",
|
|
1623
|
+
body: { name, pattern, ...(options ?? {}) },
|
|
1624
|
+
});
|
|
1625
|
+
},
|
|
1626
|
+
/** List routes across all instances or for one instance */
|
|
1627
|
+
list: async (name) => {
|
|
1628
|
+
return this.transport.call({
|
|
1629
|
+
groupSegments: ["routes"],
|
|
1630
|
+
command: "list",
|
|
1631
|
+
body: { name },
|
|
1632
|
+
});
|
|
1633
|
+
},
|
|
1634
|
+
/** Show route details */
|
|
1635
|
+
show: async (name, pattern) => {
|
|
1636
|
+
return this.transport.call({
|
|
1637
|
+
groupSegments: ["routes"],
|
|
1638
|
+
command: "show",
|
|
1639
|
+
body: { name, pattern },
|
|
1640
|
+
});
|
|
1641
|
+
}
|
|
1642
|
+
};
|
|
1643
|
+
sdk = {
|
|
1644
|
+
client: {
|
|
1645
|
+
/** Compare on-disk @ravi-os/sdk sources to a fresh emit; exit 1 on drift */
|
|
1646
|
+
check: async (options) => {
|
|
1647
|
+
return this.transport.call({
|
|
1648
|
+
groupSegments: ["sdk", "client"],
|
|
1649
|
+
command: "check",
|
|
1650
|
+
body: { ...(options ?? {}) },
|
|
1651
|
+
});
|
|
1652
|
+
},
|
|
1653
|
+
/** Generate the four @ravi-os/sdk source files from the live registry */
|
|
1654
|
+
generate: async (options) => {
|
|
1655
|
+
return this.transport.call({
|
|
1656
|
+
groupSegments: ["sdk", "client"],
|
|
1657
|
+
command: "generate",
|
|
1658
|
+
body: { ...(options ?? {}) },
|
|
1659
|
+
});
|
|
1660
|
+
}
|
|
1661
|
+
},
|
|
1662
|
+
openapi: {
|
|
1663
|
+
/** Diff a stored OpenAPI spec against the live registry */
|
|
1664
|
+
check: async (options) => {
|
|
1665
|
+
return this.transport.call({
|
|
1666
|
+
groupSegments: ["sdk", "openapi"],
|
|
1667
|
+
command: "check",
|
|
1668
|
+
body: { ...(options ?? {}) },
|
|
1669
|
+
});
|
|
1670
|
+
},
|
|
1671
|
+
/** Emit OpenAPI 3.1 spec from the CLI registry */
|
|
1672
|
+
emit: async (options) => {
|
|
1673
|
+
return this.transport.call({
|
|
1674
|
+
groupSegments: ["sdk", "openapi"],
|
|
1675
|
+
command: "emit",
|
|
1676
|
+
body: { ...(options ?? {}) },
|
|
1677
|
+
});
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
};
|
|
1681
|
+
service = {
|
|
1682
|
+
/** Start the bot server */
|
|
1683
|
+
start: async () => {
|
|
1684
|
+
return this.transport.call({
|
|
1685
|
+
groupSegments: ["service"],
|
|
1686
|
+
command: "start",
|
|
1687
|
+
body: {},
|
|
1688
|
+
});
|
|
1689
|
+
},
|
|
1690
|
+
/** Start the TUI interface */
|
|
1691
|
+
tui: async (session) => {
|
|
1692
|
+
return this.transport.call({
|
|
1693
|
+
groupSegments: ["service"],
|
|
1694
|
+
command: "tui",
|
|
1695
|
+
body: { session },
|
|
1696
|
+
});
|
|
1697
|
+
},
|
|
1698
|
+
/** Start WhatsApp gateway (deprecated — use daemon start) */
|
|
1699
|
+
wa: async () => {
|
|
1700
|
+
return this.transport.call({
|
|
1701
|
+
groupSegments: ["service"],
|
|
1702
|
+
command: "wa",
|
|
1703
|
+
body: {},
|
|
1704
|
+
});
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
sessions = {
|
|
1708
|
+
/** Answer a question from another session (fire-and-forget) */
|
|
1709
|
+
answer: async (target, message, sender, options) => {
|
|
1710
|
+
return this.transport.call({
|
|
1711
|
+
groupSegments: ["sessions"],
|
|
1712
|
+
command: "answer",
|
|
1713
|
+
body: { target, message, sender, ...(options ?? {}) },
|
|
1714
|
+
});
|
|
1715
|
+
},
|
|
1716
|
+
/** Ask a question to another session (fire-and-forget) */
|
|
1717
|
+
ask: async (target, message, sender, options) => {
|
|
1718
|
+
return this.transport.call({
|
|
1719
|
+
groupSegments: ["sessions"],
|
|
1720
|
+
command: "ask",
|
|
1721
|
+
body: { target, message, sender, ...(options ?? {}) },
|
|
1722
|
+
});
|
|
1723
|
+
},
|
|
1724
|
+
/** Tail live runtime events for a session (defaults to current session when available) */
|
|
1725
|
+
debug: async (nameOrKey, options) => {
|
|
1726
|
+
return this.transport.call({
|
|
1727
|
+
groupSegments: ["sessions"],
|
|
1728
|
+
command: "debug",
|
|
1729
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
1730
|
+
});
|
|
1731
|
+
},
|
|
1732
|
+
/** Delete a session permanently */
|
|
1733
|
+
delete: async (nameOrKey) => {
|
|
1734
|
+
return this.transport.call({
|
|
1735
|
+
groupSegments: ["sessions"],
|
|
1736
|
+
command: "delete",
|
|
1737
|
+
body: { nameOrKey },
|
|
1738
|
+
});
|
|
1739
|
+
},
|
|
1740
|
+
/** Send an execute command to another session (fire-and-forget) */
|
|
1741
|
+
execute: async (target, message, options) => {
|
|
1742
|
+
return this.transport.call({
|
|
1743
|
+
groupSegments: ["sessions"],
|
|
1744
|
+
command: "execute",
|
|
1745
|
+
body: { target, message, ...(options ?? {}) },
|
|
1746
|
+
});
|
|
1747
|
+
},
|
|
1748
|
+
/** Extend an ephemeral session's TTL */
|
|
1749
|
+
extend: async (nameOrKey, duration) => {
|
|
1750
|
+
return this.transport.call({
|
|
1751
|
+
groupSegments: ["sessions"],
|
|
1752
|
+
command: "extend",
|
|
1753
|
+
body: { nameOrKey, duration },
|
|
1754
|
+
});
|
|
1755
|
+
},
|
|
1756
|
+
/** Show unified session inspection details */
|
|
1757
|
+
info: async (nameOrKey) => {
|
|
1758
|
+
return this.transport.call({
|
|
1759
|
+
groupSegments: ["sessions"],
|
|
1760
|
+
command: "info",
|
|
1761
|
+
body: { nameOrKey },
|
|
1762
|
+
});
|
|
1763
|
+
},
|
|
1764
|
+
/** Send an informational message to another session (fire-and-forget) */
|
|
1765
|
+
inform: async (target, message, options) => {
|
|
1766
|
+
return this.transport.call({
|
|
1767
|
+
groupSegments: ["sessions"],
|
|
1768
|
+
command: "inform",
|
|
1769
|
+
body: { target, message, ...(options ?? {}) },
|
|
1770
|
+
});
|
|
1771
|
+
},
|
|
1772
|
+
/** Make an ephemeral session permanent */
|
|
1773
|
+
keep: async (nameOrKey) => {
|
|
1774
|
+
return this.transport.call({
|
|
1775
|
+
groupSegments: ["sessions"],
|
|
1776
|
+
command: "keep",
|
|
1777
|
+
body: { nameOrKey },
|
|
1778
|
+
});
|
|
1779
|
+
},
|
|
1780
|
+
/** List all sessions */
|
|
1781
|
+
list: async (options) => {
|
|
1782
|
+
return this.transport.call({
|
|
1783
|
+
groupSegments: ["sessions"],
|
|
1784
|
+
command: "list",
|
|
1785
|
+
body: { ...(options ?? {}) },
|
|
1786
|
+
});
|
|
1787
|
+
},
|
|
1788
|
+
/** Read message history of a session (normalized) */
|
|
1789
|
+
read: async (nameOrKey, options) => {
|
|
1790
|
+
return this.transport.call({
|
|
1791
|
+
groupSegments: ["sessions"],
|
|
1792
|
+
command: "read",
|
|
1793
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
1794
|
+
});
|
|
1795
|
+
},
|
|
1796
|
+
/** Rename canonical session name */
|
|
1797
|
+
rename: async (nameOrKey, newName) => {
|
|
1798
|
+
return this.transport.call({
|
|
1799
|
+
groupSegments: ["sessions"],
|
|
1800
|
+
command: "rename",
|
|
1801
|
+
body: { nameOrKey, newName },
|
|
1802
|
+
});
|
|
1803
|
+
},
|
|
1804
|
+
/** Reset a session (fresh start) */
|
|
1805
|
+
reset: async (nameOrKey) => {
|
|
1806
|
+
return this.transport.call({
|
|
1807
|
+
groupSegments: ["sessions"],
|
|
1808
|
+
command: "reset",
|
|
1809
|
+
body: { nameOrKey },
|
|
1810
|
+
});
|
|
1811
|
+
},
|
|
1812
|
+
runtime: {
|
|
1813
|
+
/** Queue a follow-up after the active runtime turn */
|
|
1814
|
+
followUp: async (session, text, options) => {
|
|
1815
|
+
return this.transport.call({
|
|
1816
|
+
groupSegments: ["sessions", "runtime"],
|
|
1817
|
+
command: "follow-up",
|
|
1818
|
+
body: { session, text, ...(options ?? {}) },
|
|
1819
|
+
});
|
|
1820
|
+
},
|
|
1821
|
+
/** Fork a runtime thread if the provider supports it */
|
|
1822
|
+
fork: async (session, threadId, options) => {
|
|
1823
|
+
return this.transport.call({
|
|
1824
|
+
groupSegments: ["sessions", "runtime"],
|
|
1825
|
+
command: "fork",
|
|
1826
|
+
body: { session, threadId, ...(options ?? {}) },
|
|
1827
|
+
});
|
|
1828
|
+
},
|
|
1829
|
+
/** Interrupt the active runtime turn */
|
|
1830
|
+
interrupt: async (session, options) => {
|
|
1831
|
+
return this.transport.call({
|
|
1832
|
+
groupSegments: ["sessions", "runtime"],
|
|
1833
|
+
command: "interrupt",
|
|
1834
|
+
body: { session, ...(options ?? {}) },
|
|
1835
|
+
});
|
|
1836
|
+
},
|
|
1837
|
+
/** List runtime threads through an active session */
|
|
1838
|
+
list: async (session, options) => {
|
|
1839
|
+
return this.transport.call({
|
|
1840
|
+
groupSegments: ["sessions", "runtime"],
|
|
1841
|
+
command: "list",
|
|
1842
|
+
body: { session, ...(options ?? {}) },
|
|
1843
|
+
});
|
|
1844
|
+
},
|
|
1845
|
+
/** Read a runtime thread through an active session */
|
|
1846
|
+
read: async (session, threadId, options) => {
|
|
1847
|
+
return this.transport.call({
|
|
1848
|
+
groupSegments: ["sessions", "runtime"],
|
|
1849
|
+
command: "read",
|
|
1850
|
+
body: { session, threadId, ...(options ?? {}) },
|
|
1851
|
+
});
|
|
1852
|
+
},
|
|
1853
|
+
/** Rollback completed runtime turns */
|
|
1854
|
+
rollback: async (session, turns, options) => {
|
|
1855
|
+
return this.transport.call({
|
|
1856
|
+
groupSegments: ["sessions", "runtime"],
|
|
1857
|
+
command: "rollback",
|
|
1858
|
+
body: { session, turns, ...(options ?? {}) },
|
|
1859
|
+
});
|
|
1860
|
+
},
|
|
1861
|
+
/** Steer the active runtime turn */
|
|
1862
|
+
steer: async (session, text, options) => {
|
|
1863
|
+
return this.transport.call({
|
|
1864
|
+
groupSegments: ["sessions", "runtime"],
|
|
1865
|
+
command: "steer",
|
|
1866
|
+
body: { session, text, ...(options ?? {}) },
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
},
|
|
1870
|
+
/** Send a prompt to a session (fire-and-forget). Use -w to wait for response, -i for interactive. */
|
|
1871
|
+
send: async (nameOrKey, prompt, options) => {
|
|
1872
|
+
return this.transport.call({
|
|
1873
|
+
groupSegments: ["sessions"],
|
|
1874
|
+
command: "send",
|
|
1875
|
+
body: { nameOrKey, prompt, ...(options ?? {}) },
|
|
1876
|
+
});
|
|
1877
|
+
},
|
|
1878
|
+
/** Set session display label */
|
|
1879
|
+
setDisplay: async (nameOrKey, displayName) => {
|
|
1880
|
+
return this.transport.call({
|
|
1881
|
+
groupSegments: ["sessions"],
|
|
1882
|
+
command: "set-display",
|
|
1883
|
+
body: { nameOrKey, displayName },
|
|
1884
|
+
});
|
|
1885
|
+
},
|
|
1886
|
+
/** Set session model override */
|
|
1887
|
+
setModel: async (nameOrKey, model) => {
|
|
1888
|
+
return this.transport.call({
|
|
1889
|
+
groupSegments: ["sessions"],
|
|
1890
|
+
command: "set-model",
|
|
1891
|
+
body: { nameOrKey, model },
|
|
1892
|
+
});
|
|
1893
|
+
},
|
|
1894
|
+
/** Set session thinking level */
|
|
1895
|
+
setThinking: async (nameOrKey, level) => {
|
|
1896
|
+
return this.transport.call({
|
|
1897
|
+
groupSegments: ["sessions"],
|
|
1898
|
+
command: "set-thinking",
|
|
1899
|
+
body: { nameOrKey, level },
|
|
1900
|
+
});
|
|
1901
|
+
},
|
|
1902
|
+
/** Make a session ephemeral with a TTL */
|
|
1903
|
+
setTtl: async (nameOrKey, duration) => {
|
|
1904
|
+
return this.transport.call({
|
|
1905
|
+
groupSegments: ["sessions"],
|
|
1906
|
+
command: "set-ttl",
|
|
1907
|
+
body: { nameOrKey, duration },
|
|
1908
|
+
});
|
|
1909
|
+
},
|
|
1910
|
+
/** Read the SQLite session trace timeline */
|
|
1911
|
+
trace: async (nameOrKey, options) => {
|
|
1912
|
+
return this.transport.call({
|
|
1913
|
+
groupSegments: ["sessions"],
|
|
1914
|
+
command: "trace",
|
|
1915
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
settings = {
|
|
1920
|
+
/** Delete a setting */
|
|
1921
|
+
delete: async (key) => {
|
|
1922
|
+
return this.transport.call({
|
|
1923
|
+
groupSegments: ["settings"],
|
|
1924
|
+
command: "delete",
|
|
1925
|
+
body: { key },
|
|
1926
|
+
});
|
|
1927
|
+
},
|
|
1928
|
+
/** Get a setting value */
|
|
1929
|
+
get: async (key) => {
|
|
1930
|
+
return this.transport.call({
|
|
1931
|
+
groupSegments: ["settings"],
|
|
1932
|
+
command: "get",
|
|
1933
|
+
body: { key },
|
|
1934
|
+
});
|
|
1935
|
+
},
|
|
1936
|
+
/** List live settings (legacy account.* hidden by default) */
|
|
1937
|
+
list: async (options) => {
|
|
1938
|
+
return this.transport.call({
|
|
1939
|
+
groupSegments: ["settings"],
|
|
1940
|
+
command: "list",
|
|
1941
|
+
body: { ...(options ?? {}) },
|
|
1942
|
+
});
|
|
1943
|
+
},
|
|
1944
|
+
/** Set a setting value */
|
|
1945
|
+
set: async (key, value) => {
|
|
1946
|
+
return this.transport.call({
|
|
1947
|
+
groupSegments: ["settings"],
|
|
1948
|
+
command: "set",
|
|
1949
|
+
body: { key, value },
|
|
1950
|
+
});
|
|
1951
|
+
}
|
|
1952
|
+
};
|
|
1953
|
+
skills = {
|
|
1954
|
+
/** Install Ravi catalog skills or skills from an explicit source */
|
|
1955
|
+
install: async (name, options) => {
|
|
1956
|
+
return this.transport.call({
|
|
1957
|
+
groupSegments: ["skills"],
|
|
1958
|
+
command: "install",
|
|
1959
|
+
body: { name, ...(options ?? {}) },
|
|
1960
|
+
});
|
|
1961
|
+
},
|
|
1962
|
+
/** List Ravi catalog skills, installed skills or source skills */
|
|
1963
|
+
list: async (options) => {
|
|
1964
|
+
return this.transport.call({
|
|
1965
|
+
groupSegments: ["skills"],
|
|
1966
|
+
command: "list",
|
|
1967
|
+
body: { ...(options ?? {}) },
|
|
1968
|
+
});
|
|
1969
|
+
},
|
|
1970
|
+
/** Show a Ravi catalog skill, installed skill or source skill */
|
|
1971
|
+
show: async (name, options) => {
|
|
1972
|
+
return this.transport.call({
|
|
1973
|
+
groupSegments: ["skills"],
|
|
1974
|
+
command: "show",
|
|
1975
|
+
body: { name, ...(options ?? {}) },
|
|
1976
|
+
});
|
|
1977
|
+
},
|
|
1978
|
+
/** Sync Ravi plugin skills into the Codex skills directory */
|
|
1979
|
+
sync: async () => {
|
|
1980
|
+
return this.transport.call({
|
|
1981
|
+
groupSegments: ["skills"],
|
|
1982
|
+
command: "sync",
|
|
1983
|
+
body: {},
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1987
|
+
specs = {
|
|
1988
|
+
/** Get inherited spec context */
|
|
1989
|
+
get: async (id, options) => {
|
|
1990
|
+
return this.transport.call({
|
|
1991
|
+
groupSegments: ["specs"],
|
|
1992
|
+
command: "get",
|
|
1993
|
+
body: { id, ...(options ?? {}) },
|
|
1994
|
+
});
|
|
1995
|
+
},
|
|
1996
|
+
/** List specs from .ravi/specs */
|
|
1997
|
+
list: async (options) => {
|
|
1998
|
+
return this.transport.call({
|
|
1999
|
+
groupSegments: ["specs"],
|
|
2000
|
+
command: "list",
|
|
2001
|
+
body: { ...(options ?? {}) },
|
|
2002
|
+
});
|
|
2003
|
+
},
|
|
2004
|
+
/** Create a new spec under .ravi/specs */
|
|
2005
|
+
new: async (id, options) => {
|
|
2006
|
+
return this.transport.call({
|
|
2007
|
+
groupSegments: ["specs"],
|
|
2008
|
+
command: "new",
|
|
2009
|
+
body: { id, ...(options ?? {}) },
|
|
2010
|
+
});
|
|
2011
|
+
},
|
|
2012
|
+
/** Rebuild the specs SQLite index from Markdown */
|
|
2013
|
+
sync: async () => {
|
|
2014
|
+
return this.transport.call({
|
|
2015
|
+
groupSegments: ["specs"],
|
|
2016
|
+
command: "sync",
|
|
2017
|
+
body: {},
|
|
2018
|
+
});
|
|
2019
|
+
}
|
|
2020
|
+
};
|
|
2021
|
+
stickers = {
|
|
2022
|
+
/** Add or update a sticker catalog entry */
|
|
2023
|
+
add: async (id, mediaPath, options) => {
|
|
2024
|
+
return this.transport.call({
|
|
2025
|
+
groupSegments: ["stickers"],
|
|
2026
|
+
command: "add",
|
|
2027
|
+
body: { id, mediaPath, ...(options ?? {}) },
|
|
2028
|
+
});
|
|
2029
|
+
},
|
|
2030
|
+
/** List stickers in the typed catalog */
|
|
2031
|
+
list: async () => {
|
|
2032
|
+
return this.transport.call({
|
|
2033
|
+
groupSegments: ["stickers"],
|
|
2034
|
+
command: "list",
|
|
2035
|
+
body: {},
|
|
2036
|
+
});
|
|
2037
|
+
},
|
|
2038
|
+
/** Remove a sticker catalog entry */
|
|
2039
|
+
remove: async (id) => {
|
|
2040
|
+
return this.transport.call({
|
|
2041
|
+
groupSegments: ["stickers"],
|
|
2042
|
+
command: "remove",
|
|
2043
|
+
body: { id },
|
|
2044
|
+
});
|
|
2045
|
+
},
|
|
2046
|
+
/** Send a sticker to the current WhatsApp chat */
|
|
2047
|
+
send: async (id, options) => {
|
|
2048
|
+
return this.transport.call({
|
|
2049
|
+
groupSegments: ["stickers"],
|
|
2050
|
+
command: "send",
|
|
2051
|
+
body: { id, ...(options ?? {}) },
|
|
2052
|
+
});
|
|
2053
|
+
},
|
|
2054
|
+
/** Show one sticker catalog entry */
|
|
2055
|
+
show: async (id) => {
|
|
2056
|
+
return this.transport.call({
|
|
2057
|
+
groupSegments: ["stickers"],
|
|
2058
|
+
command: "show",
|
|
2059
|
+
body: { id },
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
};
|
|
2063
|
+
tags = {
|
|
2064
|
+
/** Attach a tag to an agent or session */
|
|
2065
|
+
attach: async (slug, options) => {
|
|
2066
|
+
return this.transport.call({
|
|
2067
|
+
groupSegments: ["tags"],
|
|
2068
|
+
command: "attach",
|
|
2069
|
+
body: { slug, ...(options ?? {}) },
|
|
2070
|
+
});
|
|
2071
|
+
},
|
|
2072
|
+
/** Create a new tag definition */
|
|
2073
|
+
create: async (slug, options) => {
|
|
2074
|
+
return this.transport.call({
|
|
2075
|
+
groupSegments: ["tags"],
|
|
2076
|
+
command: "create",
|
|
2077
|
+
body: { slug, ...(options ?? {}) },
|
|
2078
|
+
});
|
|
2079
|
+
},
|
|
2080
|
+
/** Detach a tag from an agent or session */
|
|
2081
|
+
detach: async (slug, options) => {
|
|
2082
|
+
return this.transport.call({
|
|
2083
|
+
groupSegments: ["tags"],
|
|
2084
|
+
command: "detach",
|
|
2085
|
+
body: { slug, ...(options ?? {}) },
|
|
2086
|
+
});
|
|
2087
|
+
},
|
|
2088
|
+
/** List tag definitions */
|
|
2089
|
+
list: async () => {
|
|
2090
|
+
return this.transport.call({
|
|
2091
|
+
groupSegments: ["tags"],
|
|
2092
|
+
command: "list",
|
|
2093
|
+
body: {},
|
|
2094
|
+
});
|
|
2095
|
+
},
|
|
2096
|
+
/** Search bindings by tag or asset */
|
|
2097
|
+
search: async (options) => {
|
|
2098
|
+
return this.transport.call({
|
|
2099
|
+
groupSegments: ["tags"],
|
|
2100
|
+
command: "search",
|
|
2101
|
+
body: { ...(options ?? {}) },
|
|
2102
|
+
});
|
|
2103
|
+
},
|
|
2104
|
+
/** Show one tag and its bindings */
|
|
2105
|
+
show: async (slug) => {
|
|
2106
|
+
return this.transport.call({
|
|
2107
|
+
groupSegments: ["tags"],
|
|
2108
|
+
command: "show",
|
|
2109
|
+
body: { slug },
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
};
|
|
2113
|
+
tasks = {
|
|
2114
|
+
/** Archive a task without changing its execution status */
|
|
2115
|
+
archive: async (taskId, options) => {
|
|
2116
|
+
return this.transport.call({
|
|
2117
|
+
groupSegments: ["tasks"],
|
|
2118
|
+
command: "archive",
|
|
2119
|
+
body: { taskId, ...(options ?? {}) },
|
|
2120
|
+
});
|
|
2121
|
+
},
|
|
2122
|
+
automations: {
|
|
2123
|
+
/** Create a new task automation */
|
|
2124
|
+
add: async (name, options) => {
|
|
2125
|
+
return this.transport.call({
|
|
2126
|
+
groupSegments: ["tasks", "automations"],
|
|
2127
|
+
command: "add",
|
|
2128
|
+
body: { name, ...(options ?? {}) },
|
|
2129
|
+
});
|
|
2130
|
+
},
|
|
2131
|
+
/** Disable a task automation */
|
|
2132
|
+
disable: async (id) => {
|
|
2133
|
+
return this.transport.call({
|
|
2134
|
+
groupSegments: ["tasks", "automations"],
|
|
2135
|
+
command: "disable",
|
|
2136
|
+
body: { id },
|
|
2137
|
+
});
|
|
2138
|
+
},
|
|
2139
|
+
/** Enable a task automation */
|
|
2140
|
+
enable: async (id) => {
|
|
2141
|
+
return this.transport.call({
|
|
2142
|
+
groupSegments: ["tasks", "automations"],
|
|
2143
|
+
command: "enable",
|
|
2144
|
+
body: { id },
|
|
2145
|
+
});
|
|
2146
|
+
},
|
|
2147
|
+
/** List configured task automations */
|
|
2148
|
+
list: async () => {
|
|
2149
|
+
return this.transport.call({
|
|
2150
|
+
groupSegments: ["tasks", "automations"],
|
|
2151
|
+
command: "list",
|
|
2152
|
+
body: {},
|
|
2153
|
+
});
|
|
2154
|
+
},
|
|
2155
|
+
/** Delete a task automation */
|
|
2156
|
+
rm: async (id) => {
|
|
2157
|
+
return this.transport.call({
|
|
2158
|
+
groupSegments: ["tasks", "automations"],
|
|
2159
|
+
command: "rm",
|
|
2160
|
+
body: { id },
|
|
2161
|
+
});
|
|
2162
|
+
},
|
|
2163
|
+
/** Show one task automation and its recent runs */
|
|
2164
|
+
show: async (id) => {
|
|
2165
|
+
return this.transport.call({
|
|
2166
|
+
groupSegments: ["tasks", "automations"],
|
|
2167
|
+
command: "show",
|
|
2168
|
+
body: { id },
|
|
2169
|
+
});
|
|
2170
|
+
}
|
|
2171
|
+
},
|
|
2172
|
+
/** Mark a task as blocked */
|
|
2173
|
+
block: async (taskId, options) => {
|
|
2174
|
+
return this.transport.call({
|
|
2175
|
+
groupSegments: ["tasks"],
|
|
2176
|
+
command: "block",
|
|
2177
|
+
body: { taskId, ...(options ?? {}) },
|
|
2178
|
+
});
|
|
2179
|
+
},
|
|
2180
|
+
/** Add a comment to a task and steer the assignee if it is active */
|
|
2181
|
+
comment: async (taskId, body) => {
|
|
2182
|
+
return this.transport.call({
|
|
2183
|
+
groupSegments: ["tasks"],
|
|
2184
|
+
command: "comment",
|
|
2185
|
+
body: { taskId, body },
|
|
2186
|
+
});
|
|
2187
|
+
},
|
|
2188
|
+
/** Create a tracked task; unresolved dependencies arm launch plans instead of dispatching early */
|
|
2189
|
+
create: async (title, options) => {
|
|
2190
|
+
return this.transport.call({
|
|
2191
|
+
groupSegments: ["tasks"],
|
|
2192
|
+
command: "create",
|
|
2193
|
+
body: { title, ...(options ?? {}) },
|
|
2194
|
+
});
|
|
2195
|
+
},
|
|
2196
|
+
deps: {
|
|
2197
|
+
/** Add one gating dependency to a task */
|
|
2198
|
+
add: async (taskId, dependencyTaskId) => {
|
|
2199
|
+
return this.transport.call({
|
|
2200
|
+
groupSegments: ["tasks", "deps"],
|
|
2201
|
+
command: "add",
|
|
2202
|
+
body: { taskId, dependencyTaskId },
|
|
2203
|
+
});
|
|
2204
|
+
},
|
|
2205
|
+
/** List gating dependencies and dependents for a task */
|
|
2206
|
+
ls: async (taskId) => {
|
|
2207
|
+
return this.transport.call({
|
|
2208
|
+
groupSegments: ["tasks", "deps"],
|
|
2209
|
+
command: "ls",
|
|
2210
|
+
body: { taskId },
|
|
2211
|
+
});
|
|
2212
|
+
},
|
|
2213
|
+
/** Remove one gating dependency from a task */
|
|
2214
|
+
rm: async (taskId, dependencyTaskId) => {
|
|
2215
|
+
return this.transport.call({
|
|
2216
|
+
groupSegments: ["tasks", "deps"],
|
|
2217
|
+
command: "rm",
|
|
2218
|
+
body: { taskId, dependencyTaskId },
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
},
|
|
2222
|
+
/** Dispatch a task now, or arm a launch plan if dependencies still gate start */
|
|
2223
|
+
dispatch: async (taskId, options) => {
|
|
2224
|
+
return this.transport.call({
|
|
2225
|
+
groupSegments: ["tasks"],
|
|
2226
|
+
command: "dispatch",
|
|
2227
|
+
body: { taskId, ...(options ?? {}) },
|
|
2228
|
+
});
|
|
2229
|
+
},
|
|
2230
|
+
/** Mark a task as done */
|
|
2231
|
+
done: async (taskId, options) => {
|
|
2232
|
+
return this.transport.call({
|
|
2233
|
+
groupSegments: ["tasks"],
|
|
2234
|
+
command: "done",
|
|
2235
|
+
body: { taskId, ...(options ?? {}) },
|
|
2236
|
+
});
|
|
2237
|
+
},
|
|
2238
|
+
/** Mark a task as failed */
|
|
2239
|
+
fail: async (taskId, options) => {
|
|
2240
|
+
return this.transport.call({
|
|
2241
|
+
groupSegments: ["tasks"],
|
|
2242
|
+
command: "fail",
|
|
2243
|
+
body: { taskId, ...(options ?? {}) },
|
|
2244
|
+
});
|
|
2245
|
+
},
|
|
2246
|
+
/** List tasks */
|
|
2247
|
+
list: async (options) => {
|
|
2248
|
+
return this.transport.call({
|
|
2249
|
+
groupSegments: ["tasks"],
|
|
2250
|
+
command: "list",
|
|
2251
|
+
body: { ...(options ?? {}) },
|
|
2252
|
+
});
|
|
2253
|
+
},
|
|
2254
|
+
profiles: {
|
|
2255
|
+
/** Create a profile scaffold in the workspace or user catalog */
|
|
2256
|
+
init: async (profileId, options) => {
|
|
2257
|
+
return this.transport.call({
|
|
2258
|
+
groupSegments: ["tasks", "profiles"],
|
|
2259
|
+
command: "init",
|
|
2260
|
+
body: { profileId, ...(options ?? {}) },
|
|
2261
|
+
});
|
|
2262
|
+
},
|
|
2263
|
+
/** List resolved task profiles from all catalog sources */
|
|
2264
|
+
list: async () => {
|
|
2265
|
+
return this.transport.call({
|
|
2266
|
+
groupSegments: ["tasks", "profiles"],
|
|
2267
|
+
command: "list",
|
|
2268
|
+
body: {},
|
|
2269
|
+
});
|
|
2270
|
+
},
|
|
2271
|
+
/** Render a profile preview with the resolved template context */
|
|
2272
|
+
preview: async (profileId, options) => {
|
|
2273
|
+
return this.transport.call({
|
|
2274
|
+
groupSegments: ["tasks", "profiles"],
|
|
2275
|
+
command: "preview",
|
|
2276
|
+
body: { profileId, ...(options ?? {}) },
|
|
2277
|
+
});
|
|
2278
|
+
},
|
|
2279
|
+
/** Show the resolved manifest for one task profile */
|
|
2280
|
+
show: async (profileId) => {
|
|
2281
|
+
return this.transport.call({
|
|
2282
|
+
groupSegments: ["tasks", "profiles"],
|
|
2283
|
+
command: "show",
|
|
2284
|
+
body: { profileId },
|
|
2285
|
+
});
|
|
2286
|
+
},
|
|
2287
|
+
/** Validate one profile or the whole resolved catalog */
|
|
2288
|
+
validate: async (profileId) => {
|
|
2289
|
+
return this.transport.call({
|
|
2290
|
+
groupSegments: ["tasks", "profiles"],
|
|
2291
|
+
command: "validate",
|
|
2292
|
+
body: { profileId },
|
|
2293
|
+
});
|
|
2294
|
+
}
|
|
2295
|
+
},
|
|
2296
|
+
/** Report task progress from a CLI or agent session */
|
|
2297
|
+
report: async (taskId, options) => {
|
|
2298
|
+
return this.transport.call({
|
|
2299
|
+
groupSegments: ["tasks"],
|
|
2300
|
+
command: "report",
|
|
2301
|
+
body: { taskId, ...(options ?? {}) },
|
|
2302
|
+
});
|
|
2303
|
+
},
|
|
2304
|
+
/** Show task details and history */
|
|
2305
|
+
show: async (taskId, options) => {
|
|
2306
|
+
return this.transport.call({
|
|
2307
|
+
groupSegments: ["tasks"],
|
|
2308
|
+
command: "show",
|
|
2309
|
+
body: { taskId, ...(options ?? {}) },
|
|
2310
|
+
});
|
|
2311
|
+
},
|
|
2312
|
+
/** Restore an archived task to the default list */
|
|
2313
|
+
unarchive: async (taskId) => {
|
|
2314
|
+
return this.transport.call({
|
|
2315
|
+
groupSegments: ["tasks"],
|
|
2316
|
+
command: "unarchive",
|
|
2317
|
+
body: { taskId },
|
|
2318
|
+
});
|
|
2319
|
+
},
|
|
2320
|
+
/** Watch task events live */
|
|
2321
|
+
watch: async (taskId) => {
|
|
2322
|
+
return this.transport.call({
|
|
2323
|
+
groupSegments: ["tasks"],
|
|
2324
|
+
command: "watch",
|
|
2325
|
+
body: { taskId },
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
};
|
|
2329
|
+
tmux = {
|
|
2330
|
+
/** Attach or switch to an agent/session inside tmux */
|
|
2331
|
+
attach: async (agent, session) => {
|
|
2332
|
+
return this.transport.call({
|
|
2333
|
+
groupSegments: ["tmux"],
|
|
2334
|
+
command: "attach",
|
|
2335
|
+
body: { agent, session },
|
|
2336
|
+
});
|
|
2337
|
+
},
|
|
2338
|
+
/** List Ravi-managed tmux sessions and windows */
|
|
2339
|
+
list: async () => {
|
|
2340
|
+
return this.transport.call({
|
|
2341
|
+
groupSegments: ["tmux"],
|
|
2342
|
+
command: "list",
|
|
2343
|
+
body: {},
|
|
2344
|
+
});
|
|
2345
|
+
},
|
|
2346
|
+
/** Ensure a tmux session/window exists for an agent or session */
|
|
2347
|
+
open: async (agent, session) => {
|
|
2348
|
+
return this.transport.call({
|
|
2349
|
+
groupSegments: ["tmux"],
|
|
2350
|
+
command: "open",
|
|
2351
|
+
body: { agent, session },
|
|
2352
|
+
});
|
|
2353
|
+
},
|
|
2354
|
+
/** Listen to NATS prompts and open tmux windows automatically */
|
|
2355
|
+
watch: async (options) => {
|
|
2356
|
+
return this.transport.call({
|
|
2357
|
+
groupSegments: ["tmux"],
|
|
2358
|
+
command: "watch",
|
|
2359
|
+
body: { ...(options ?? {}) },
|
|
2360
|
+
});
|
|
2361
|
+
}
|
|
2362
|
+
};
|
|
2363
|
+
tools = {
|
|
2364
|
+
/** List all available CLI tools */
|
|
2365
|
+
list: async () => {
|
|
2366
|
+
return this.transport.call({
|
|
2367
|
+
groupSegments: ["tools"],
|
|
2368
|
+
command: "list",
|
|
2369
|
+
body: {},
|
|
2370
|
+
});
|
|
2371
|
+
},
|
|
2372
|
+
/** Export tools as JSON manifest */
|
|
2373
|
+
manifest: async () => {
|
|
2374
|
+
return this.transport.call({
|
|
2375
|
+
groupSegments: ["tools"],
|
|
2376
|
+
command: "manifest",
|
|
2377
|
+
body: {},
|
|
2378
|
+
});
|
|
2379
|
+
},
|
|
2380
|
+
/** Export tools as JSON Schema */
|
|
2381
|
+
schema: async () => {
|
|
2382
|
+
return this.transport.call({
|
|
2383
|
+
groupSegments: ["tools"],
|
|
2384
|
+
command: "schema",
|
|
2385
|
+
body: {},
|
|
2386
|
+
});
|
|
2387
|
+
},
|
|
2388
|
+
/** Show details for a specific tool */
|
|
2389
|
+
show: async (name) => {
|
|
2390
|
+
return this.transport.call({
|
|
2391
|
+
groupSegments: ["tools"],
|
|
2392
|
+
command: "show",
|
|
2393
|
+
body: { name },
|
|
2394
|
+
});
|
|
2395
|
+
},
|
|
2396
|
+
/** Test a tool execution */
|
|
2397
|
+
test: async (name, args) => {
|
|
2398
|
+
return this.transport.call({
|
|
2399
|
+
groupSegments: ["tools"],
|
|
2400
|
+
command: "test",
|
|
2401
|
+
body: { name, args },
|
|
2402
|
+
});
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
transcribe = {
|
|
2406
|
+
/** Transcribe a local audio file */
|
|
2407
|
+
file: async (path, options) => {
|
|
2408
|
+
return this.transport.call({
|
|
2409
|
+
groupSegments: ["transcribe"],
|
|
2410
|
+
command: "file",
|
|
2411
|
+
body: { path, ...(options ?? {}) },
|
|
2412
|
+
});
|
|
2413
|
+
}
|
|
2414
|
+
};
|
|
2415
|
+
triggers = {
|
|
2416
|
+
/** Add a new event trigger */
|
|
2417
|
+
add: async (name, options) => {
|
|
2418
|
+
return this.transport.call({
|
|
2419
|
+
groupSegments: ["triggers"],
|
|
2420
|
+
command: "add",
|
|
2421
|
+
body: { name, ...(options ?? {}) },
|
|
2422
|
+
});
|
|
2423
|
+
},
|
|
2424
|
+
/** Disable a trigger */
|
|
2425
|
+
disable: async (id) => {
|
|
2426
|
+
return this.transport.call({
|
|
2427
|
+
groupSegments: ["triggers"],
|
|
2428
|
+
command: "disable",
|
|
2429
|
+
body: { id },
|
|
2430
|
+
});
|
|
2431
|
+
},
|
|
2432
|
+
/** Enable a trigger */
|
|
2433
|
+
enable: async (id) => {
|
|
2434
|
+
return this.transport.call({
|
|
2435
|
+
groupSegments: ["triggers"],
|
|
2436
|
+
command: "enable",
|
|
2437
|
+
body: { id },
|
|
2438
|
+
});
|
|
2439
|
+
},
|
|
2440
|
+
/** List all event triggers */
|
|
2441
|
+
list: async () => {
|
|
2442
|
+
return this.transport.call({
|
|
2443
|
+
groupSegments: ["triggers"],
|
|
2444
|
+
command: "list",
|
|
2445
|
+
body: {},
|
|
2446
|
+
});
|
|
2447
|
+
},
|
|
2448
|
+
/** Delete a trigger */
|
|
2449
|
+
rm: async (id) => {
|
|
2450
|
+
return this.transport.call({
|
|
2451
|
+
groupSegments: ["triggers"],
|
|
2452
|
+
command: "rm",
|
|
2453
|
+
body: { id },
|
|
2454
|
+
});
|
|
2455
|
+
},
|
|
2456
|
+
/** Set trigger property */
|
|
2457
|
+
set: async (id, key, value) => {
|
|
2458
|
+
return this.transport.call({
|
|
2459
|
+
groupSegments: ["triggers"],
|
|
2460
|
+
command: "set",
|
|
2461
|
+
body: { id, key, value },
|
|
2462
|
+
});
|
|
2463
|
+
},
|
|
2464
|
+
/** Show trigger details */
|
|
2465
|
+
show: async (id) => {
|
|
2466
|
+
return this.transport.call({
|
|
2467
|
+
groupSegments: ["triggers"],
|
|
2468
|
+
command: "show",
|
|
2469
|
+
body: { id },
|
|
2470
|
+
});
|
|
2471
|
+
},
|
|
2472
|
+
/** Test trigger with fake event data */
|
|
2473
|
+
test: async (id) => {
|
|
2474
|
+
return this.transport.call({
|
|
2475
|
+
groupSegments: ["triggers"],
|
|
2476
|
+
command: "test",
|
|
2477
|
+
body: { id },
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
2480
|
+
};
|
|
2481
|
+
video = {
|
|
2482
|
+
/** Analyze a video (YouTube URL or local file) and save to markdown */
|
|
2483
|
+
analyze: async (url, options) => {
|
|
2484
|
+
return this.transport.call({
|
|
2485
|
+
groupSegments: ["video"],
|
|
2486
|
+
command: "analyze",
|
|
2487
|
+
body: { url, ...(options ?? {}) },
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
};
|
|
2491
|
+
whatsapp = {
|
|
2492
|
+
dm: {
|
|
2493
|
+
/** Send read receipt (blue ticks) for a specific message */
|
|
2494
|
+
ack: async (contact, messageId, options) => {
|
|
2495
|
+
return this.transport.call({
|
|
2496
|
+
groupSegments: ["whatsapp", "dm"],
|
|
2497
|
+
command: "ack",
|
|
2498
|
+
body: { contact, messageId, ...(options ?? {}) },
|
|
2499
|
+
});
|
|
2500
|
+
},
|
|
2501
|
+
/** Read recent messages from a DM chat */
|
|
2502
|
+
read: async (contact, options) => {
|
|
2503
|
+
return this.transport.call({
|
|
2504
|
+
groupSegments: ["whatsapp", "dm"],
|
|
2505
|
+
command: "read",
|
|
2506
|
+
body: { contact, ...(options ?? {}) },
|
|
2507
|
+
});
|
|
2508
|
+
},
|
|
2509
|
+
/** Send a direct message to a contact */
|
|
2510
|
+
send: async (contact, message, options) => {
|
|
2511
|
+
return this.transport.call({
|
|
2512
|
+
groupSegments: ["whatsapp", "dm"],
|
|
2513
|
+
command: "send",
|
|
2514
|
+
body: { contact, message, ...(options ?? {}) },
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
},
|
|
2518
|
+
group: {
|
|
2519
|
+
/** Add participants to a group */
|
|
2520
|
+
add: async (groupId, participants, options) => {
|
|
2521
|
+
return this.transport.call({
|
|
2522
|
+
groupSegments: ["whatsapp", "group"],
|
|
2523
|
+
command: "add",
|
|
2524
|
+
body: { groupId, participants, ...(options ?? {}) },
|
|
2525
|
+
});
|
|
2526
|
+
},
|
|
2527
|
+
/** Create a new group */
|
|
2528
|
+
create: async (name, participants, options) => {
|
|
2529
|
+
return this.transport.call({
|
|
2530
|
+
groupSegments: ["whatsapp", "group"],
|
|
2531
|
+
command: "create",
|
|
2532
|
+
body: { name, participants, ...(options ?? {}) },
|
|
2533
|
+
});
|
|
2534
|
+
},
|
|
2535
|
+
/** Demote participants from admin */
|
|
2536
|
+
demote: async (groupId, participants, options) => {
|
|
2537
|
+
return this.transport.call({
|
|
2538
|
+
groupSegments: ["whatsapp", "group"],
|
|
2539
|
+
command: "demote",
|
|
2540
|
+
body: { groupId, participants, ...(options ?? {}) },
|
|
2541
|
+
});
|
|
2542
|
+
},
|
|
2543
|
+
/** Update group description */
|
|
2544
|
+
description: async (groupId, text, options) => {
|
|
2545
|
+
return this.transport.call({
|
|
2546
|
+
groupSegments: ["whatsapp", "group"],
|
|
2547
|
+
command: "description",
|
|
2548
|
+
body: { groupId, text, ...(options ?? {}) },
|
|
2549
|
+
});
|
|
2550
|
+
},
|
|
2551
|
+
/** Show group metadata */
|
|
2552
|
+
info: async (groupId, options) => {
|
|
2553
|
+
return this.transport.call({
|
|
2554
|
+
groupSegments: ["whatsapp", "group"],
|
|
2555
|
+
command: "info",
|
|
2556
|
+
body: { groupId, ...(options ?? {}) },
|
|
2557
|
+
});
|
|
2558
|
+
},
|
|
2559
|
+
/** Get group invite link */
|
|
2560
|
+
invite: async (groupId, options) => {
|
|
2561
|
+
return this.transport.call({
|
|
2562
|
+
groupSegments: ["whatsapp", "group"],
|
|
2563
|
+
command: "invite",
|
|
2564
|
+
body: { groupId, ...(options ?? {}) },
|
|
2565
|
+
});
|
|
2566
|
+
},
|
|
2567
|
+
/** Join a group via invite link/code */
|
|
2568
|
+
join: async (code, options) => {
|
|
2569
|
+
return this.transport.call({
|
|
2570
|
+
groupSegments: ["whatsapp", "group"],
|
|
2571
|
+
command: "join",
|
|
2572
|
+
body: { code, ...(options ?? {}) },
|
|
2573
|
+
});
|
|
2574
|
+
},
|
|
2575
|
+
/** Leave a group */
|
|
2576
|
+
leave: async (groupId, options) => {
|
|
2577
|
+
return this.transport.call({
|
|
2578
|
+
groupSegments: ["whatsapp", "group"],
|
|
2579
|
+
command: "leave",
|
|
2580
|
+
body: { groupId, ...(options ?? {}) },
|
|
2581
|
+
});
|
|
2582
|
+
},
|
|
2583
|
+
/** List all groups the bot participates in */
|
|
2584
|
+
list: async (options) => {
|
|
2585
|
+
return this.transport.call({
|
|
2586
|
+
groupSegments: ["whatsapp", "group"],
|
|
2587
|
+
command: "list",
|
|
2588
|
+
body: { ...(options ?? {}) },
|
|
2589
|
+
});
|
|
2590
|
+
},
|
|
2591
|
+
/** Promote participants to admin */
|
|
2592
|
+
promote: async (groupId, participants, options) => {
|
|
2593
|
+
return this.transport.call({
|
|
2594
|
+
groupSegments: ["whatsapp", "group"],
|
|
2595
|
+
command: "promote",
|
|
2596
|
+
body: { groupId, participants, ...(options ?? {}) },
|
|
2597
|
+
});
|
|
2598
|
+
},
|
|
2599
|
+
/** Remove participants from a group */
|
|
2600
|
+
remove: async (groupId, participants, options) => {
|
|
2601
|
+
return this.transport.call({
|
|
2602
|
+
groupSegments: ["whatsapp", "group"],
|
|
2603
|
+
command: "remove",
|
|
2604
|
+
body: { groupId, participants, ...(options ?? {}) },
|
|
2605
|
+
});
|
|
2606
|
+
},
|
|
2607
|
+
/** Rename a group */
|
|
2608
|
+
rename: async (groupId, name, options) => {
|
|
2609
|
+
return this.transport.call({
|
|
2610
|
+
groupSegments: ["whatsapp", "group"],
|
|
2611
|
+
command: "rename",
|
|
2612
|
+
body: { groupId, name, ...(options ?? {}) },
|
|
2613
|
+
});
|
|
2614
|
+
},
|
|
2615
|
+
/** Revoke current invite link */
|
|
2616
|
+
revokeInvite: async (groupId, options) => {
|
|
2617
|
+
return this.transport.call({
|
|
2618
|
+
groupSegments: ["whatsapp", "group"],
|
|
2619
|
+
command: "revoke-invite",
|
|
2620
|
+
body: { groupId, ...(options ?? {}) },
|
|
2621
|
+
});
|
|
2622
|
+
},
|
|
2623
|
+
/** Update group settings (announcement, not_announcement, locked, unlocked) */
|
|
2624
|
+
settings: async (groupId, setting, options) => {
|
|
2625
|
+
return this.transport.call({
|
|
2626
|
+
groupSegments: ["whatsapp", "group"],
|
|
2627
|
+
command: "settings",
|
|
2628
|
+
body: { groupId, setting, ...(options ?? {}) },
|
|
2629
|
+
});
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
};
|
|
2633
|
+
workflows = {
|
|
2634
|
+
runs: {
|
|
2635
|
+
/** Archive one node run from workflow aggregate state */
|
|
2636
|
+
archiveNode: async (runId, nodeKey) => {
|
|
2637
|
+
return this.transport.call({
|
|
2638
|
+
groupSegments: ["workflows", "runs"],
|
|
2639
|
+
command: "archive-node",
|
|
2640
|
+
body: { runId, nodeKey },
|
|
2641
|
+
});
|
|
2642
|
+
},
|
|
2643
|
+
/** Cancel one workflow node run */
|
|
2644
|
+
cancel: async (runId, nodeKey) => {
|
|
2645
|
+
return this.transport.call({
|
|
2646
|
+
groupSegments: ["workflows", "runs"],
|
|
2647
|
+
command: "cancel",
|
|
2648
|
+
body: { runId, nodeKey },
|
|
2649
|
+
});
|
|
2650
|
+
},
|
|
2651
|
+
/** List workflow runs */
|
|
2652
|
+
list: async () => {
|
|
2653
|
+
return this.transport.call({
|
|
2654
|
+
groupSegments: ["workflows", "runs"],
|
|
2655
|
+
command: "list",
|
|
2656
|
+
body: {},
|
|
2657
|
+
});
|
|
2658
|
+
},
|
|
2659
|
+
/** Release a manual node transition or gate */
|
|
2660
|
+
release: async (runId, nodeKey) => {
|
|
2661
|
+
return this.transport.call({
|
|
2662
|
+
groupSegments: ["workflows", "runs"],
|
|
2663
|
+
command: "release",
|
|
2664
|
+
body: { runId, nodeKey },
|
|
2665
|
+
});
|
|
2666
|
+
},
|
|
2667
|
+
/** Show one workflow run with node state */
|
|
2668
|
+
show: async (runId) => {
|
|
2669
|
+
return this.transport.call({
|
|
2670
|
+
groupSegments: ["workflows", "runs"],
|
|
2671
|
+
command: "show",
|
|
2672
|
+
body: { runId },
|
|
2673
|
+
});
|
|
2674
|
+
},
|
|
2675
|
+
/** Skip one optional workflow node */
|
|
2676
|
+
skip: async (runId, nodeKey) => {
|
|
2677
|
+
return this.transport.call({
|
|
2678
|
+
groupSegments: ["workflows", "runs"],
|
|
2679
|
+
command: "skip",
|
|
2680
|
+
body: { runId, nodeKey },
|
|
2681
|
+
});
|
|
2682
|
+
},
|
|
2683
|
+
/** Instantiate one workflow run from a spec */
|
|
2684
|
+
start: async (specId, options) => {
|
|
2685
|
+
return this.transport.call({
|
|
2686
|
+
groupSegments: ["workflows", "runs"],
|
|
2687
|
+
command: "start",
|
|
2688
|
+
body: { specId, ...(options ?? {}) },
|
|
2689
|
+
});
|
|
2690
|
+
},
|
|
2691
|
+
/** Attach an existing task to a workflow task node */
|
|
2692
|
+
taskAttach: async (runId, nodeKey, taskId) => {
|
|
2693
|
+
return this.transport.call({
|
|
2694
|
+
groupSegments: ["workflows", "runs"],
|
|
2695
|
+
command: "task-attach",
|
|
2696
|
+
body: { runId, nodeKey, taskId },
|
|
2697
|
+
});
|
|
2698
|
+
},
|
|
2699
|
+
/** Create a new task attempt for one workflow task node */
|
|
2700
|
+
taskCreate: async (runId, nodeKey, options) => {
|
|
2701
|
+
return this.transport.call({
|
|
2702
|
+
groupSegments: ["workflows", "runs"],
|
|
2703
|
+
command: "task-create",
|
|
2704
|
+
body: { runId, nodeKey, ...(options ?? {}) },
|
|
2705
|
+
});
|
|
2706
|
+
}
|
|
2707
|
+
},
|
|
2708
|
+
specs: {
|
|
2709
|
+
/** Create one workflow spec from narrow JSON definition */
|
|
2710
|
+
create: async (specId, options) => {
|
|
2711
|
+
return this.transport.call({
|
|
2712
|
+
groupSegments: ["workflows", "specs"],
|
|
2713
|
+
command: "create",
|
|
2714
|
+
body: { specId, ...(options ?? {}) },
|
|
2715
|
+
});
|
|
2716
|
+
},
|
|
2717
|
+
/** List workflow specs */
|
|
2718
|
+
list: async () => {
|
|
2719
|
+
return this.transport.call({
|
|
2720
|
+
groupSegments: ["workflows", "specs"],
|
|
2721
|
+
command: "list",
|
|
2722
|
+
body: {},
|
|
2723
|
+
});
|
|
2724
|
+
},
|
|
2725
|
+
/** Show one workflow spec */
|
|
2726
|
+
show: async (specId) => {
|
|
2727
|
+
return this.transport.call({
|
|
2728
|
+
groupSegments: ["workflows", "specs"],
|
|
2729
|
+
command: "show",
|
|
2730
|
+
body: { specId },
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
}
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
//# sourceMappingURL=client.js.map
|