@ravi-os/sdk 0.260519.2 → 0.260608.1
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/dist/client.d.ts +876 -12
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1244 -26
- package/dist/client.js.map +1 -1
- package/dist/schemas.d.ts +33124 -4926
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +42262 -5253
- package/dist/schemas.js.map +1 -1
- package/dist/streaming.d.ts +1 -92
- package/dist/streaming.d.ts.map +1 -1
- package/dist/streaming.generated.d.ts +185 -0
- package/dist/streaming.generated.d.ts.map +1 -0
- package/dist/streaming.generated.js +233 -0
- package/dist/streaming.generated.js.map +1 -0
- package/dist/streaming.js +10 -188
- package/dist/streaming.js.map +1 -1
- package/dist/types.d.ts +7126 -887
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -122,6 +122,64 @@ export class RaviClient {
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
|
+
apps = {
|
|
126
|
+
/** Validate Ravi app manifests without executing app code */
|
|
127
|
+
check: async (id) => {
|
|
128
|
+
return this.transport.call({
|
|
129
|
+
groupSegments: ["apps"],
|
|
130
|
+
command: "check",
|
|
131
|
+
body: { id },
|
|
132
|
+
});
|
|
133
|
+
},
|
|
134
|
+
/** Print agent guidance for discovering, scaffolding, and operating Ravi apps */
|
|
135
|
+
guide: async (id) => {
|
|
136
|
+
return this.transport.call({
|
|
137
|
+
groupSegments: ["apps"],
|
|
138
|
+
command: "guide",
|
|
139
|
+
body: { id },
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
/** List discovered Ravi apps */
|
|
143
|
+
list: async (options) => {
|
|
144
|
+
return this.transport.call({
|
|
145
|
+
groupSegments: ["apps"],
|
|
146
|
+
command: "list",
|
|
147
|
+
body: { ...(options ?? {}) },
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
/** Print all built-in Ravi apps agent prompts */
|
|
151
|
+
prompts: async (id) => {
|
|
152
|
+
return this.transport.call({
|
|
153
|
+
groupSegments: ["apps"],
|
|
154
|
+
command: "prompts",
|
|
155
|
+
body: { id },
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
/** Run a Ravi app operation through the runtime app router */
|
|
159
|
+
run: async (id, operation, args) => {
|
|
160
|
+
return this.transport.call({
|
|
161
|
+
groupSegments: ["apps"],
|
|
162
|
+
command: "run",
|
|
163
|
+
body: { id, operation, args },
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
/** Create a Ravi app scaffold from the app contract */
|
|
167
|
+
scaffold: async (id, options) => {
|
|
168
|
+
return this.transport.call({
|
|
169
|
+
groupSegments: ["apps"],
|
|
170
|
+
command: "scaffold",
|
|
171
|
+
body: { id, ...(options ?? {}) },
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
/** Show a Ravi app manifest */
|
|
175
|
+
show: async (id) => {
|
|
176
|
+
return this.transport.call({
|
|
177
|
+
groupSegments: ["apps"],
|
|
178
|
+
command: "show",
|
|
179
|
+
body: { id },
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
};
|
|
125
183
|
artifacts = {
|
|
126
184
|
/** Soft-archive an artifact */
|
|
127
185
|
archive: async (id) => {
|
|
@@ -257,7 +315,203 @@ export class RaviClient {
|
|
|
257
315
|
});
|
|
258
316
|
}
|
|
259
317
|
};
|
|
318
|
+
bridges = {
|
|
319
|
+
/** Create a Ravi MCP bridge URL for a Console project */
|
|
320
|
+
create: async (options) => {
|
|
321
|
+
return this.transport.call({
|
|
322
|
+
groupSegments: ["bridges"],
|
|
323
|
+
command: "create",
|
|
324
|
+
body: { ...(options ?? {}) },
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
/** List Ravi MCP bridges for a Console project */
|
|
328
|
+
list: async (options) => {
|
|
329
|
+
return this.transport.call({
|
|
330
|
+
groupSegments: ["bridges"],
|
|
331
|
+
command: "list",
|
|
332
|
+
body: { ...(options ?? {}) },
|
|
333
|
+
});
|
|
334
|
+
},
|
|
335
|
+
/** Revoke a Ravi MCP bridge and its client tokens */
|
|
336
|
+
revoke: async (id, options) => {
|
|
337
|
+
return this.transport.call({
|
|
338
|
+
groupSegments: ["bridges"],
|
|
339
|
+
command: "revoke",
|
|
340
|
+
body: { id, ...(options ?? {}) },
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
calendar = {
|
|
345
|
+
accounts: {
|
|
346
|
+
/** Create or update a local calendar provider account */
|
|
347
|
+
create: async (options) => {
|
|
348
|
+
return this.transport.call({
|
|
349
|
+
groupSegments: ["calendar", "accounts"],
|
|
350
|
+
command: "create",
|
|
351
|
+
body: { ...(options ?? {}) },
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
/** List local calendar accounts */
|
|
355
|
+
list: async (options) => {
|
|
356
|
+
return this.transport.call({
|
|
357
|
+
groupSegments: ["calendar", "accounts"],
|
|
358
|
+
command: "list",
|
|
359
|
+
body: { ...(options ?? {}) },
|
|
360
|
+
});
|
|
361
|
+
},
|
|
362
|
+
/** Run one provider sync tick for an account */
|
|
363
|
+
sync: async (account, options) => {
|
|
364
|
+
return this.transport.call({
|
|
365
|
+
groupSegments: ["calendar", "accounts"],
|
|
366
|
+
command: "sync",
|
|
367
|
+
body: { account, ...(options ?? {}) },
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
/** Return free/busy availability in a bounded time window */
|
|
372
|
+
availability: async (options) => {
|
|
373
|
+
return this.transport.call({
|
|
374
|
+
groupSegments: ["calendar"],
|
|
375
|
+
command: "availability",
|
|
376
|
+
body: { ...(options ?? {}) },
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
calendars: {
|
|
380
|
+
/** Create or update a local calendar projection */
|
|
381
|
+
create: async (options) => {
|
|
382
|
+
return this.transport.call({
|
|
383
|
+
groupSegments: ["calendar", "calendars"],
|
|
384
|
+
command: "create",
|
|
385
|
+
body: { ...(options ?? {}) },
|
|
386
|
+
});
|
|
387
|
+
},
|
|
388
|
+
/** Disable a local calendar projection */
|
|
389
|
+
disable: async (calendar) => {
|
|
390
|
+
return this.transport.call({
|
|
391
|
+
groupSegments: ["calendar", "calendars"],
|
|
392
|
+
command: "disable",
|
|
393
|
+
body: { calendar },
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
/** List local calendars visible to the current requester */
|
|
397
|
+
list: async (options) => {
|
|
398
|
+
return this.transport.call({
|
|
399
|
+
groupSegments: ["calendar", "calendars"],
|
|
400
|
+
command: "list",
|
|
401
|
+
body: { ...(options ?? {}) },
|
|
402
|
+
});
|
|
403
|
+
},
|
|
404
|
+
/** Grant a calendar relation to an agent/contact/system subject */
|
|
405
|
+
share: async (calendar, options) => {
|
|
406
|
+
return this.transport.call({
|
|
407
|
+
groupSegments: ["calendar", "calendars"],
|
|
408
|
+
command: "share",
|
|
409
|
+
body: { calendar, ...(options ?? {}) },
|
|
410
|
+
});
|
|
411
|
+
},
|
|
412
|
+
/** Show a local calendar */
|
|
413
|
+
show: async (calendar, options) => {
|
|
414
|
+
return this.transport.call({
|
|
415
|
+
groupSegments: ["calendar", "calendars"],
|
|
416
|
+
command: "show",
|
|
417
|
+
body: { calendar, ...(options ?? {}) },
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
events: {
|
|
422
|
+
/** Cancel a local calendar event */
|
|
423
|
+
cancel: async (event, options) => {
|
|
424
|
+
return this.transport.call({
|
|
425
|
+
groupSegments: ["calendar", "events"],
|
|
426
|
+
command: "cancel",
|
|
427
|
+
body: { event, ...(options ?? {}) },
|
|
428
|
+
});
|
|
429
|
+
},
|
|
430
|
+
/** Create a local calendar event and local outbox row */
|
|
431
|
+
create: async (options) => {
|
|
432
|
+
return this.transport.call({
|
|
433
|
+
groupSegments: ["calendar", "events"],
|
|
434
|
+
command: "create",
|
|
435
|
+
body: { ...(options ?? {}) },
|
|
436
|
+
});
|
|
437
|
+
},
|
|
438
|
+
/** List local calendar events in a bounded time window */
|
|
439
|
+
list: async (options) => {
|
|
440
|
+
return this.transport.call({
|
|
441
|
+
groupSegments: ["calendar", "events"],
|
|
442
|
+
command: "list",
|
|
443
|
+
body: { ...(options ?? {}) },
|
|
444
|
+
});
|
|
445
|
+
},
|
|
446
|
+
/** Read one local calendar event */
|
|
447
|
+
read: async (event) => {
|
|
448
|
+
return this.transport.call({
|
|
449
|
+
groupSegments: ["calendar", "events"],
|
|
450
|
+
command: "read",
|
|
451
|
+
body: { event },
|
|
452
|
+
});
|
|
453
|
+
},
|
|
454
|
+
/** Record an attendee response and enqueue provider delivery */
|
|
455
|
+
respond: async (event, options) => {
|
|
456
|
+
return this.transport.call({
|
|
457
|
+
groupSegments: ["calendar", "events"],
|
|
458
|
+
command: "respond",
|
|
459
|
+
body: { event, ...(options ?? {}) },
|
|
460
|
+
});
|
|
461
|
+
},
|
|
462
|
+
/** Update a local calendar event and enqueue provider delivery */
|
|
463
|
+
update: async (event, options) => {
|
|
464
|
+
return this.transport.call({
|
|
465
|
+
groupSegments: ["calendar", "events"],
|
|
466
|
+
command: "update",
|
|
467
|
+
body: { event, ...(options ?? {}) },
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
outbox: {
|
|
472
|
+
/** Inspect one local calendar outbox row */
|
|
473
|
+
inspect: async (outbox) => {
|
|
474
|
+
return this.transport.call({
|
|
475
|
+
groupSegments: ["calendar", "outbox"],
|
|
476
|
+
command: "inspect",
|
|
477
|
+
body: { outbox },
|
|
478
|
+
});
|
|
479
|
+
},
|
|
480
|
+
/** List local calendar outbox rows */
|
|
481
|
+
list: async (options) => {
|
|
482
|
+
return this.transport.call({
|
|
483
|
+
groupSegments: ["calendar", "outbox"],
|
|
484
|
+
command: "list",
|
|
485
|
+
body: { ...(options ?? {}) },
|
|
486
|
+
});
|
|
487
|
+
},
|
|
488
|
+
/** Move a failed/dead local outbox row back to pending */
|
|
489
|
+
retry: async (outbox) => {
|
|
490
|
+
return this.transport.call({
|
|
491
|
+
groupSegments: ["calendar", "outbox"],
|
|
492
|
+
command: "retry",
|
|
493
|
+
body: { outbox },
|
|
494
|
+
});
|
|
495
|
+
},
|
|
496
|
+
/** Show local calendar outbox status */
|
|
497
|
+
status: async () => {
|
|
498
|
+
return this.transport.call({
|
|
499
|
+
groupSegments: ["calendar", "outbox"],
|
|
500
|
+
command: "status",
|
|
501
|
+
body: {},
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
};
|
|
260
506
|
chats = {
|
|
507
|
+
/** Backfill message provider timestamps from raw provenance */
|
|
508
|
+
backfillProviderTimestamps: async (options) => {
|
|
509
|
+
return this.transport.call({
|
|
510
|
+
groupSegments: ["chats"],
|
|
511
|
+
command: "backfill-provider-timestamps",
|
|
512
|
+
body: { ...(options ?? {}) },
|
|
513
|
+
});
|
|
514
|
+
},
|
|
261
515
|
/** List recent canonical chats */
|
|
262
516
|
list: async (options) => {
|
|
263
517
|
return this.transport.call({
|
|
@@ -333,6 +587,26 @@ export class RaviClient {
|
|
|
333
587
|
});
|
|
334
588
|
}
|
|
335
589
|
};
|
|
590
|
+
cloud = {
|
|
591
|
+
projects: {
|
|
592
|
+
/** Create a Ravi Cloud project in Console */
|
|
593
|
+
create: async (slug, options) => {
|
|
594
|
+
return this.transport.call({
|
|
595
|
+
groupSegments: ["cloud", "projects"],
|
|
596
|
+
command: "create",
|
|
597
|
+
body: { slug, ...(options ?? {}) },
|
|
598
|
+
});
|
|
599
|
+
},
|
|
600
|
+
/** List Ravi Cloud projects from Console */
|
|
601
|
+
list: async (options) => {
|
|
602
|
+
return this.transport.call({
|
|
603
|
+
groupSegments: ["cloud", "projects"],
|
|
604
|
+
command: "list",
|
|
605
|
+
body: { ...(options ?? {}) },
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
};
|
|
336
610
|
commands = {
|
|
337
611
|
/** List Ravi commands */
|
|
338
612
|
list: async (options) => {
|
|
@@ -367,6 +641,32 @@ export class RaviClient {
|
|
|
367
641
|
});
|
|
368
642
|
}
|
|
369
643
|
};
|
|
644
|
+
connectors = {
|
|
645
|
+
/** List your connectors */
|
|
646
|
+
list: async (options) => {
|
|
647
|
+
return this.transport.call({
|
|
648
|
+
groupSegments: ["connectors"],
|
|
649
|
+
command: "list",
|
|
650
|
+
body: { ...(options ?? {}) },
|
|
651
|
+
});
|
|
652
|
+
},
|
|
653
|
+
/** Revoke a connector and delete its stored credentials */
|
|
654
|
+
revoke: async (id, options) => {
|
|
655
|
+
return this.transport.call({
|
|
656
|
+
groupSegments: ["connectors"],
|
|
657
|
+
command: "revoke",
|
|
658
|
+
body: { id, ...(options ?? {}) },
|
|
659
|
+
});
|
|
660
|
+
},
|
|
661
|
+
/** Show details of a single connector */
|
|
662
|
+
show: async (id) => {
|
|
663
|
+
return this.transport.call({
|
|
664
|
+
groupSegments: ["connectors"],
|
|
665
|
+
command: "show",
|
|
666
|
+
body: { id },
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
};
|
|
370
670
|
contacts = {
|
|
371
671
|
/** Show session activity attributed to a contact */
|
|
372
672
|
activity: async (contact, options) => {
|
|
@@ -805,11 +1105,11 @@ export class RaviClient {
|
|
|
805
1105
|
});
|
|
806
1106
|
},
|
|
807
1107
|
/** Show open opportunity board */
|
|
808
|
-
board: async () => {
|
|
1108
|
+
board: async (options) => {
|
|
809
1109
|
return this.transport.call({
|
|
810
1110
|
groupSegments: ["crm"],
|
|
811
1111
|
command: "board",
|
|
812
|
-
body: {},
|
|
1112
|
+
body: { ...(options ?? {}) },
|
|
813
1113
|
});
|
|
814
1114
|
},
|
|
815
1115
|
contact: {
|
|
@@ -938,7 +1238,125 @@ export class RaviClient {
|
|
|
938
1238
|
body: { opportunity },
|
|
939
1239
|
});
|
|
940
1240
|
},
|
|
1241
|
+
pipeline: {
|
|
1242
|
+
/** Create a CRM pipeline */
|
|
1243
|
+
create: async (name, options) => {
|
|
1244
|
+
return this.transport.call({
|
|
1245
|
+
groupSegments: ["crm", "pipeline"],
|
|
1246
|
+
command: "create",
|
|
1247
|
+
body: { name, ...(options ?? {}) },
|
|
1248
|
+
});
|
|
1249
|
+
},
|
|
1250
|
+
/** List CRM pipelines */
|
|
1251
|
+
list: async (options) => {
|
|
1252
|
+
return this.transport.call({
|
|
1253
|
+
groupSegments: ["crm", "pipeline"],
|
|
1254
|
+
command: "list",
|
|
1255
|
+
body: { ...(options ?? {}) },
|
|
1256
|
+
});
|
|
1257
|
+
},
|
|
1258
|
+
/** Set a CRM pipeline field */
|
|
1259
|
+
set: async (pipeline, field, value) => {
|
|
1260
|
+
return this.transport.call({
|
|
1261
|
+
groupSegments: ["crm", "pipeline"],
|
|
1262
|
+
command: "set",
|
|
1263
|
+
body: { pipeline, field, value },
|
|
1264
|
+
});
|
|
1265
|
+
},
|
|
1266
|
+
/** Show one CRM pipeline with stages and topics */
|
|
1267
|
+
show: async (pipeline) => {
|
|
1268
|
+
return this.transport.call({
|
|
1269
|
+
groupSegments: ["crm", "pipeline"],
|
|
1270
|
+
command: "show",
|
|
1271
|
+
body: { pipeline },
|
|
1272
|
+
});
|
|
1273
|
+
},
|
|
1274
|
+
stage: {
|
|
1275
|
+
/** Add a stage to a CRM pipeline */
|
|
1276
|
+
add: async (pipeline, key, options) => {
|
|
1277
|
+
return this.transport.call({
|
|
1278
|
+
groupSegments: ["crm", "pipeline", "stage"],
|
|
1279
|
+
command: "add",
|
|
1280
|
+
body: { pipeline, key, ...(options ?? {}) },
|
|
1281
|
+
});
|
|
1282
|
+
},
|
|
1283
|
+
/** Archive a CRM pipeline stage */
|
|
1284
|
+
archive: async (pipeline, stage) => {
|
|
1285
|
+
return this.transport.call({
|
|
1286
|
+
groupSegments: ["crm", "pipeline", "stage"],
|
|
1287
|
+
command: "archive",
|
|
1288
|
+
body: { pipeline, stage },
|
|
1289
|
+
});
|
|
1290
|
+
},
|
|
1291
|
+
/** List stages in a CRM pipeline */
|
|
1292
|
+
list: async (pipeline, options) => {
|
|
1293
|
+
return this.transport.call({
|
|
1294
|
+
groupSegments: ["crm", "pipeline", "stage"],
|
|
1295
|
+
command: "list",
|
|
1296
|
+
body: { pipeline, ...(options ?? {}) },
|
|
1297
|
+
});
|
|
1298
|
+
},
|
|
1299
|
+
/** Set a CRM pipeline stage field */
|
|
1300
|
+
set: async (pipeline, stage, field, value) => {
|
|
1301
|
+
return this.transport.call({
|
|
1302
|
+
groupSegments: ["crm", "pipeline", "stage"],
|
|
1303
|
+
command: "set",
|
|
1304
|
+
body: { pipeline, stage, field, value },
|
|
1305
|
+
});
|
|
1306
|
+
},
|
|
1307
|
+
/** Show one CRM pipeline stage */
|
|
1308
|
+
show: async (pipeline, stage) => {
|
|
1309
|
+
return this.transport.call({
|
|
1310
|
+
groupSegments: ["crm", "pipeline", "stage"],
|
|
1311
|
+
command: "show",
|
|
1312
|
+
body: { pipeline, stage },
|
|
1313
|
+
});
|
|
1314
|
+
},
|
|
1315
|
+
topic: {
|
|
1316
|
+
/** Add a topic to a CRM pipeline stage */
|
|
1317
|
+
add: async (pipeline, stage, key, options) => {
|
|
1318
|
+
return this.transport.call({
|
|
1319
|
+
groupSegments: ["crm", "pipeline", "stage", "topic"],
|
|
1320
|
+
command: "add",
|
|
1321
|
+
body: { pipeline, stage, key, ...(options ?? {}) },
|
|
1322
|
+
});
|
|
1323
|
+
},
|
|
1324
|
+
/** Archive a CRM pipeline stage topic */
|
|
1325
|
+
archive: async (pipeline, stage, topic) => {
|
|
1326
|
+
return this.transport.call({
|
|
1327
|
+
groupSegments: ["crm", "pipeline", "stage", "topic"],
|
|
1328
|
+
command: "archive",
|
|
1329
|
+
body: { pipeline, stage, topic },
|
|
1330
|
+
});
|
|
1331
|
+
},
|
|
1332
|
+
/** Set a CRM pipeline stage topic field */
|
|
1333
|
+
set: async (pipeline, stage, topic, field, value) => {
|
|
1334
|
+
return this.transport.call({
|
|
1335
|
+
groupSegments: ["crm", "pipeline", "stage", "topic"],
|
|
1336
|
+
command: "set",
|
|
1337
|
+
body: { pipeline, stage, topic, field, value },
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
/** List topics configured for a CRM pipeline stage */
|
|
1342
|
+
topics: async (pipeline, stage, options) => {
|
|
1343
|
+
return this.transport.call({
|
|
1344
|
+
groupSegments: ["crm", "pipeline", "stage"],
|
|
1345
|
+
command: "topics",
|
|
1346
|
+
body: { pipeline, stage, ...(options ?? {}) },
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
941
1351
|
task: {
|
|
1352
|
+
/** Cancel a CRM task */
|
|
1353
|
+
cancel: async (task, options) => {
|
|
1354
|
+
return this.transport.call({
|
|
1355
|
+
groupSegments: ["crm", "task"],
|
|
1356
|
+
command: "cancel",
|
|
1357
|
+
body: { task, ...(options ?? {}) },
|
|
1358
|
+
});
|
|
1359
|
+
},
|
|
942
1360
|
/** Create a CRM relationship task */
|
|
943
1361
|
create: async (title, options) => {
|
|
944
1362
|
return this.transport.call({
|
|
@@ -955,6 +1373,14 @@ export class RaviClient {
|
|
|
955
1373
|
body: { task },
|
|
956
1374
|
});
|
|
957
1375
|
},
|
|
1376
|
+
/** List CRM tasks (all statuses) */
|
|
1377
|
+
list: async (options) => {
|
|
1378
|
+
return this.transport.call({
|
|
1379
|
+
groupSegments: ["crm", "task"],
|
|
1380
|
+
command: "list",
|
|
1381
|
+
body: { ...(options ?? {}) },
|
|
1382
|
+
});
|
|
1383
|
+
},
|
|
958
1384
|
/** Show CRM task */
|
|
959
1385
|
show: async (task) => {
|
|
960
1386
|
return this.transport.call({
|
|
@@ -962,6 +1388,14 @@ export class RaviClient {
|
|
|
962
1388
|
command: "show",
|
|
963
1389
|
body: { task },
|
|
964
1390
|
});
|
|
1391
|
+
},
|
|
1392
|
+
/** Snooze a CRM task to a new due_at */
|
|
1393
|
+
snooze: async (task, options) => {
|
|
1394
|
+
return this.transport.call({
|
|
1395
|
+
groupSegments: ["crm", "task"],
|
|
1396
|
+
command: "snooze",
|
|
1397
|
+
body: { task, ...(options ?? {}) },
|
|
1398
|
+
});
|
|
965
1399
|
}
|
|
966
1400
|
}
|
|
967
1401
|
};
|
|
@@ -1209,6 +1643,24 @@ export class RaviClient {
|
|
|
1209
1643
|
});
|
|
1210
1644
|
}
|
|
1211
1645
|
};
|
|
1646
|
+
gmail = {
|
|
1647
|
+
/** List messages in the connected Gmail mailbox */
|
|
1648
|
+
list: async (options) => {
|
|
1649
|
+
return this.transport.call({
|
|
1650
|
+
groupSegments: ["gmail"],
|
|
1651
|
+
command: "list",
|
|
1652
|
+
body: { ...(options ?? {}) },
|
|
1653
|
+
});
|
|
1654
|
+
},
|
|
1655
|
+
/** Read a single Gmail message */
|
|
1656
|
+
read: async (id, options) => {
|
|
1657
|
+
return this.transport.call({
|
|
1658
|
+
groupSegments: ["gmail"],
|
|
1659
|
+
command: "read",
|
|
1660
|
+
body: { id, ...(options ?? {}) },
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1212
1664
|
heartbeat = {
|
|
1213
1665
|
/** Disable heartbeat for an agent */
|
|
1214
1666
|
disable: async (id) => {
|
|
@@ -1337,6 +1789,104 @@ export class RaviClient {
|
|
|
1337
1789
|
});
|
|
1338
1790
|
}
|
|
1339
1791
|
};
|
|
1792
|
+
inbox = {
|
|
1793
|
+
/** Archive a local inbox item */
|
|
1794
|
+
archive: async (item) => {
|
|
1795
|
+
return this.transport.call({
|
|
1796
|
+
groupSegments: ["inbox"],
|
|
1797
|
+
command: "archive",
|
|
1798
|
+
body: { item },
|
|
1799
|
+
});
|
|
1800
|
+
},
|
|
1801
|
+
/** Disable inbox polling for the current Console+org */
|
|
1802
|
+
disable: async () => {
|
|
1803
|
+
return this.transport.call({
|
|
1804
|
+
groupSegments: ["inbox"],
|
|
1805
|
+
command: "disable",
|
|
1806
|
+
body: {},
|
|
1807
|
+
});
|
|
1808
|
+
},
|
|
1809
|
+
/** Mark a local inbox item done */
|
|
1810
|
+
done: async (item) => {
|
|
1811
|
+
return this.transport.call({
|
|
1812
|
+
groupSegments: ["inbox"],
|
|
1813
|
+
command: "done",
|
|
1814
|
+
body: { item },
|
|
1815
|
+
});
|
|
1816
|
+
},
|
|
1817
|
+
/** Enable inbox polling for the current Console+org */
|
|
1818
|
+
enable: async () => {
|
|
1819
|
+
return this.transport.call({
|
|
1820
|
+
groupSegments: ["inbox"],
|
|
1821
|
+
command: "enable",
|
|
1822
|
+
body: {},
|
|
1823
|
+
});
|
|
1824
|
+
},
|
|
1825
|
+
/** List recently delivered inbox items in the local mirror */
|
|
1826
|
+
items: async (options) => {
|
|
1827
|
+
return this.transport.call({
|
|
1828
|
+
groupSegments: ["inbox"],
|
|
1829
|
+
command: "items",
|
|
1830
|
+
body: { ...(options ?? {}) },
|
|
1831
|
+
});
|
|
1832
|
+
},
|
|
1833
|
+
/** List local inbox items */
|
|
1834
|
+
list: async (options) => {
|
|
1835
|
+
return this.transport.call({
|
|
1836
|
+
groupSegments: ["inbox"],
|
|
1837
|
+
command: "list",
|
|
1838
|
+
body: { ...(options ?? {}) },
|
|
1839
|
+
});
|
|
1840
|
+
},
|
|
1841
|
+
/** Run a single inbox poll cycle (foreground) */
|
|
1842
|
+
poll: async (options) => {
|
|
1843
|
+
return this.transport.call({
|
|
1844
|
+
groupSegments: ["inbox"],
|
|
1845
|
+
command: "poll",
|
|
1846
|
+
body: { ...(options ?? {}) },
|
|
1847
|
+
});
|
|
1848
|
+
},
|
|
1849
|
+
/** Read one local inbox item and mark it seen */
|
|
1850
|
+
read: async (item) => {
|
|
1851
|
+
return this.transport.call({
|
|
1852
|
+
groupSegments: ["inbox"],
|
|
1853
|
+
command: "read",
|
|
1854
|
+
body: { item },
|
|
1855
|
+
});
|
|
1856
|
+
},
|
|
1857
|
+
/** Republish a locally stored inbox item to NATS */
|
|
1858
|
+
replay: async (ref) => {
|
|
1859
|
+
return this.transport.call({
|
|
1860
|
+
groupSegments: ["inbox"],
|
|
1861
|
+
command: "replay",
|
|
1862
|
+
body: { ref },
|
|
1863
|
+
});
|
|
1864
|
+
},
|
|
1865
|
+
/** Snooze a local inbox item until a timestamp */
|
|
1866
|
+
snooze: async (item, options) => {
|
|
1867
|
+
return this.transport.call({
|
|
1868
|
+
groupSegments: ["inbox"],
|
|
1869
|
+
command: "snooze",
|
|
1870
|
+
body: { item, ...(options ?? {}) },
|
|
1871
|
+
});
|
|
1872
|
+
},
|
|
1873
|
+
/** List local inbox source domains */
|
|
1874
|
+
sources: async () => {
|
|
1875
|
+
return this.transport.call({
|
|
1876
|
+
groupSegments: ["inbox"],
|
|
1877
|
+
command: "sources",
|
|
1878
|
+
body: {},
|
|
1879
|
+
});
|
|
1880
|
+
},
|
|
1881
|
+
/** Show inbox poller status and subscriptions */
|
|
1882
|
+
status: async () => {
|
|
1883
|
+
return this.transport.call({
|
|
1884
|
+
groupSegments: ["inbox"],
|
|
1885
|
+
command: "status",
|
|
1886
|
+
body: {},
|
|
1887
|
+
});
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1340
1890
|
insights = {
|
|
1341
1891
|
/** Create a new insight with lineage captured from the current runtime context */
|
|
1342
1892
|
create: async (summary, options) => {
|
|
@@ -1561,6 +2111,260 @@ export class RaviClient {
|
|
|
1561
2111
|
});
|
|
1562
2112
|
}
|
|
1563
2113
|
};
|
|
2114
|
+
mail = {
|
|
2115
|
+
accounts: {
|
|
2116
|
+
/** Create or update a local mail provider account */
|
|
2117
|
+
create: async (options) => {
|
|
2118
|
+
return this.transport.call({
|
|
2119
|
+
groupSegments: ["mail", "accounts"],
|
|
2120
|
+
command: "create",
|
|
2121
|
+
body: { ...(options ?? {}) },
|
|
2122
|
+
});
|
|
2123
|
+
},
|
|
2124
|
+
/** List local mail accounts */
|
|
2125
|
+
list: async (options) => {
|
|
2126
|
+
return this.transport.call({
|
|
2127
|
+
groupSegments: ["mail", "accounts"],
|
|
2128
|
+
command: "list",
|
|
2129
|
+
body: { ...(options ?? {}) },
|
|
2130
|
+
});
|
|
2131
|
+
},
|
|
2132
|
+
/** Run one local provider sync tick for an account */
|
|
2133
|
+
sync: async (account, options) => {
|
|
2134
|
+
return this.transport.call({
|
|
2135
|
+
groupSegments: ["mail", "accounts"],
|
|
2136
|
+
command: "sync",
|
|
2137
|
+
body: { account, ...(options ?? {}) },
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
},
|
|
2141
|
+
domains: {
|
|
2142
|
+
/** Register a managed Ravi Mail domain in Console */
|
|
2143
|
+
create: async (domain, options) => {
|
|
2144
|
+
return this.transport.call({
|
|
2145
|
+
groupSegments: ["mail", "domains"],
|
|
2146
|
+
command: "create",
|
|
2147
|
+
body: { domain, ...(options ?? {}) },
|
|
2148
|
+
});
|
|
2149
|
+
},
|
|
2150
|
+
/** List managed Ravi Mail domains through Console */
|
|
2151
|
+
list: async (options) => {
|
|
2152
|
+
return this.transport.call({
|
|
2153
|
+
groupSegments: ["mail", "domains"],
|
|
2154
|
+
command: "list",
|
|
2155
|
+
body: { ...(options ?? {}) },
|
|
2156
|
+
});
|
|
2157
|
+
}
|
|
2158
|
+
},
|
|
2159
|
+
mailboxes: {
|
|
2160
|
+
/** Create or update a local mailbox projection */
|
|
2161
|
+
create: async (address, options) => {
|
|
2162
|
+
return this.transport.call({
|
|
2163
|
+
groupSegments: ["mail", "mailboxes"],
|
|
2164
|
+
command: "create",
|
|
2165
|
+
body: { address, ...(options ?? {}) },
|
|
2166
|
+
});
|
|
2167
|
+
},
|
|
2168
|
+
/** Disable a local mailbox projection */
|
|
2169
|
+
disable: async (mailbox) => {
|
|
2170
|
+
return this.transport.call({
|
|
2171
|
+
groupSegments: ["mail", "mailboxes"],
|
|
2172
|
+
command: "disable",
|
|
2173
|
+
body: { mailbox },
|
|
2174
|
+
});
|
|
2175
|
+
},
|
|
2176
|
+
/** List local mailboxes */
|
|
2177
|
+
list: async (options) => {
|
|
2178
|
+
return this.transport.call({
|
|
2179
|
+
groupSegments: ["mail", "mailboxes"],
|
|
2180
|
+
command: "list",
|
|
2181
|
+
body: { ...(options ?? {}) },
|
|
2182
|
+
});
|
|
2183
|
+
},
|
|
2184
|
+
/** Show a local mailbox */
|
|
2185
|
+
show: async (mailbox) => {
|
|
2186
|
+
return this.transport.call({
|
|
2187
|
+
groupSegments: ["mail", "mailboxes"],
|
|
2188
|
+
command: "show",
|
|
2189
|
+
body: { mailbox },
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
},
|
|
2193
|
+
messages: {
|
|
2194
|
+
/** Import one normalized provider message into the local mailbox */
|
|
2195
|
+
import: async (options) => {
|
|
2196
|
+
return this.transport.call({
|
|
2197
|
+
groupSegments: ["mail", "messages"],
|
|
2198
|
+
command: "import",
|
|
2199
|
+
body: { ...(options ?? {}) },
|
|
2200
|
+
});
|
|
2201
|
+
},
|
|
2202
|
+
/** List local mail messages */
|
|
2203
|
+
list: async (options) => {
|
|
2204
|
+
return this.transport.call({
|
|
2205
|
+
groupSegments: ["mail", "messages"],
|
|
2206
|
+
command: "list",
|
|
2207
|
+
body: { ...(options ?? {}) },
|
|
2208
|
+
});
|
|
2209
|
+
},
|
|
2210
|
+
/** Read a local mail message */
|
|
2211
|
+
read: async (message, options) => {
|
|
2212
|
+
return this.transport.call({
|
|
2213
|
+
groupSegments: ["mail", "messages"],
|
|
2214
|
+
command: "read",
|
|
2215
|
+
body: { message, ...(options ?? {}) },
|
|
2216
|
+
});
|
|
2217
|
+
},
|
|
2218
|
+
/** Search local mail messages */
|
|
2219
|
+
search: async (query, options) => {
|
|
2220
|
+
return this.transport.call({
|
|
2221
|
+
groupSegments: ["mail", "messages"],
|
|
2222
|
+
command: "search",
|
|
2223
|
+
body: { query, ...(options ?? {}) },
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
},
|
|
2227
|
+
outbox: {
|
|
2228
|
+
/** Inspect a local outbox row */
|
|
2229
|
+
inspect: async (outbox) => {
|
|
2230
|
+
return this.transport.call({
|
|
2231
|
+
groupSegments: ["mail", "outbox"],
|
|
2232
|
+
command: "inspect",
|
|
2233
|
+
body: { outbox },
|
|
2234
|
+
});
|
|
2235
|
+
},
|
|
2236
|
+
/** List local outbox rows */
|
|
2237
|
+
list: async (options) => {
|
|
2238
|
+
return this.transport.call({
|
|
2239
|
+
groupSegments: ["mail", "outbox"],
|
|
2240
|
+
command: "list",
|
|
2241
|
+
body: { ...(options ?? {}) },
|
|
2242
|
+
});
|
|
2243
|
+
},
|
|
2244
|
+
/** Move a failed/dead local outbox row back to pending */
|
|
2245
|
+
retry: async (outbox) => {
|
|
2246
|
+
return this.transport.call({
|
|
2247
|
+
groupSegments: ["mail", "outbox"],
|
|
2248
|
+
command: "retry",
|
|
2249
|
+
body: { outbox },
|
|
2250
|
+
});
|
|
2251
|
+
},
|
|
2252
|
+
/** Show local mail outbox status */
|
|
2253
|
+
status: async () => {
|
|
2254
|
+
return this.transport.call({
|
|
2255
|
+
groupSegments: ["mail", "outbox"],
|
|
2256
|
+
command: "status",
|
|
2257
|
+
body: {},
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
providers: {
|
|
2262
|
+
/** List known mail providers and local account counts */
|
|
2263
|
+
list: async (options) => {
|
|
2264
|
+
return this.transport.call({
|
|
2265
|
+
groupSegments: ["mail", "providers"],
|
|
2266
|
+
command: "list",
|
|
2267
|
+
body: { ...(options ?? {}) },
|
|
2268
|
+
});
|
|
2269
|
+
},
|
|
2270
|
+
raviMail: {
|
|
2271
|
+
mailboxes: {
|
|
2272
|
+
/** Create a Ravi Mail provider mailbox through Console */
|
|
2273
|
+
create: async (addressOrLocalPart, options) => {
|
|
2274
|
+
return this.transport.call({
|
|
2275
|
+
groupSegments: ["mail", "providers", "ravi-mail", "mailboxes"],
|
|
2276
|
+
command: "create",
|
|
2277
|
+
body: { addressOrLocalPart, ...(options ?? {}) },
|
|
2278
|
+
});
|
|
2279
|
+
},
|
|
2280
|
+
/** Disable a managed Ravi Mail provider mailbox and active routes */
|
|
2281
|
+
disable: async (mailbox, options) => {
|
|
2282
|
+
return this.transport.call({
|
|
2283
|
+
groupSegments: ["mail", "providers", "ravi-mail", "mailboxes"],
|
|
2284
|
+
command: "disable",
|
|
2285
|
+
body: { mailbox, ...(options ?? {}) },
|
|
2286
|
+
});
|
|
2287
|
+
},
|
|
2288
|
+
/** List Ravi Mail provider mailboxes through Console */
|
|
2289
|
+
list: async (options) => {
|
|
2290
|
+
return this.transport.call({
|
|
2291
|
+
groupSegments: ["mail", "providers", "ravi-mail", "mailboxes"],
|
|
2292
|
+
command: "list",
|
|
2293
|
+
body: { ...(options ?? {}) },
|
|
2294
|
+
});
|
|
2295
|
+
},
|
|
2296
|
+
/** Show Ravi Mail provider mailbox metadata */
|
|
2297
|
+
show: async (mailbox, options) => {
|
|
2298
|
+
return this.transport.call({
|
|
2299
|
+
groupSegments: ["mail", "providers", "ravi-mail", "mailboxes"],
|
|
2300
|
+
command: "show",
|
|
2301
|
+
body: { mailbox, ...(options ?? {}) },
|
|
2302
|
+
});
|
|
2303
|
+
}
|
|
2304
|
+
},
|
|
2305
|
+
messages: {
|
|
2306
|
+
/** List Ravi Mail provider message metadata */
|
|
2307
|
+
list: async (options) => {
|
|
2308
|
+
return this.transport.call({
|
|
2309
|
+
groupSegments: ["mail", "providers", "ravi-mail", "messages"],
|
|
2310
|
+
command: "list",
|
|
2311
|
+
body: { ...(options ?? {}) },
|
|
2312
|
+
});
|
|
2313
|
+
},
|
|
2314
|
+
/** Read one authorized Ravi Mail provider message body through Console */
|
|
2315
|
+
read: async (message, options) => {
|
|
2316
|
+
return this.transport.call({
|
|
2317
|
+
groupSegments: ["mail", "providers", "ravi-mail", "messages"],
|
|
2318
|
+
command: "read",
|
|
2319
|
+
body: { message, ...(options ?? {}) },
|
|
2320
|
+
});
|
|
2321
|
+
},
|
|
2322
|
+
/** Show Ravi Mail provider message metadata */
|
|
2323
|
+
show: async (message, options) => {
|
|
2324
|
+
return this.transport.call({
|
|
2325
|
+
groupSegments: ["mail", "providers", "ravi-mail", "messages"],
|
|
2326
|
+
command: "show",
|
|
2327
|
+
body: { message, ...(options ?? {}) },
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
/** Send mail directly through Console Ravi Mail */
|
|
2332
|
+
send: async (options) => {
|
|
2333
|
+
return this.transport.call({
|
|
2334
|
+
groupSegments: ["mail", "providers", "ravi-mail"],
|
|
2335
|
+
command: "send",
|
|
2336
|
+
body: { ...(options ?? {}) },
|
|
2337
|
+
});
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
},
|
|
2341
|
+
/** Queue a local reply in the outbox */
|
|
2342
|
+
reply: async (message, options) => {
|
|
2343
|
+
return this.transport.call({
|
|
2344
|
+
groupSegments: ["mail"],
|
|
2345
|
+
command: "reply",
|
|
2346
|
+
body: { message, ...(options ?? {}) },
|
|
2347
|
+
});
|
|
2348
|
+
},
|
|
2349
|
+
/** Queue mail in the local outbox */
|
|
2350
|
+
send: async (options) => {
|
|
2351
|
+
return this.transport.call({
|
|
2352
|
+
groupSegments: ["mail"],
|
|
2353
|
+
command: "send",
|
|
2354
|
+
body: { ...(options ?? {}) },
|
|
2355
|
+
});
|
|
2356
|
+
},
|
|
2357
|
+
threads: {
|
|
2358
|
+
/** Read a local mail thread and its safe message timeline */
|
|
2359
|
+
read: async (thread, options) => {
|
|
2360
|
+
return this.transport.call({
|
|
2361
|
+
groupSegments: ["mail", "threads"],
|
|
2362
|
+
command: "read",
|
|
2363
|
+
body: { thread, ...(options ?? {}) },
|
|
2364
|
+
});
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
};
|
|
1564
2368
|
media = {
|
|
1565
2369
|
/** Send a media file (image, video, audio, document) */
|
|
1566
2370
|
send: async (filePath, options) => {
|
|
@@ -1571,6 +2375,32 @@ export class RaviClient {
|
|
|
1571
2375
|
});
|
|
1572
2376
|
}
|
|
1573
2377
|
};
|
|
2378
|
+
metrics = {
|
|
2379
|
+
/** List dates that have already been rolled up */
|
|
2380
|
+
dates: async () => {
|
|
2381
|
+
return this.transport.call({
|
|
2382
|
+
groupSegments: ["metrics"],
|
|
2383
|
+
command: "dates",
|
|
2384
|
+
body: {},
|
|
2385
|
+
});
|
|
2386
|
+
},
|
|
2387
|
+
/** Aggregate cost_events + session_events into daily_metrics for a date range */
|
|
2388
|
+
rollup: async (options) => {
|
|
2389
|
+
return this.transport.call({
|
|
2390
|
+
groupSegments: ["metrics"],
|
|
2391
|
+
command: "rollup",
|
|
2392
|
+
body: { ...(options ?? {}) },
|
|
2393
|
+
});
|
|
2394
|
+
},
|
|
2395
|
+
/** Display daily metrics rolled up to date */
|
|
2396
|
+
show: async (options) => {
|
|
2397
|
+
return this.transport.call({
|
|
2398
|
+
groupSegments: ["metrics"],
|
|
2399
|
+
command: "show",
|
|
2400
|
+
body: { ...(options ?? {}) },
|
|
2401
|
+
});
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
1574
2404
|
observers = {
|
|
1575
2405
|
/** List session observer bindings */
|
|
1576
2406
|
list: async (options) => {
|
|
@@ -1705,6 +2535,48 @@ export class RaviClient {
|
|
|
1705
2535
|
});
|
|
1706
2536
|
}
|
|
1707
2537
|
};
|
|
2538
|
+
pages = {
|
|
2539
|
+
/** Create a Ravi Pages site in a Console project */
|
|
2540
|
+
create: async (project, slug, options) => {
|
|
2541
|
+
return this.transport.call({
|
|
2542
|
+
groupSegments: ["pages"],
|
|
2543
|
+
command: "create",
|
|
2544
|
+
body: { project, slug, ...(options ?? {}) },
|
|
2545
|
+
});
|
|
2546
|
+
},
|
|
2547
|
+
/** Bind custom hostnames to a Ravi Pages site */
|
|
2548
|
+
domains: async (project, site, hostnames, options) => {
|
|
2549
|
+
return this.transport.call({
|
|
2550
|
+
groupSegments: ["pages"],
|
|
2551
|
+
command: "domains",
|
|
2552
|
+
body: { project, site, hostnames, ...(options ?? {}) },
|
|
2553
|
+
});
|
|
2554
|
+
},
|
|
2555
|
+
/** List Ravi Pages sites in a Console project */
|
|
2556
|
+
list: async (project, options) => {
|
|
2557
|
+
return this.transport.call({
|
|
2558
|
+
groupSegments: ["pages"],
|
|
2559
|
+
command: "list",
|
|
2560
|
+
body: { project, ...(options ?? {}) },
|
|
2561
|
+
});
|
|
2562
|
+
},
|
|
2563
|
+
/** Update a Ravi Pages site in a Console project */
|
|
2564
|
+
update: async (project, site, options) => {
|
|
2565
|
+
return this.transport.call({
|
|
2566
|
+
groupSegments: ["pages"],
|
|
2567
|
+
command: "update",
|
|
2568
|
+
body: { project, site, ...(options ?? {}) },
|
|
2569
|
+
});
|
|
2570
|
+
},
|
|
2571
|
+
/** Set a Ravi Pages site default visibility */
|
|
2572
|
+
visibility: async (project, site, visibility, options) => {
|
|
2573
|
+
return this.transport.call({
|
|
2574
|
+
groupSegments: ["pages"],
|
|
2575
|
+
command: "visibility",
|
|
2576
|
+
body: { project, site, visibility, ...(options ?? {}) },
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
};
|
|
1708
2580
|
permissions = {
|
|
1709
2581
|
/** Check if a subject has a permission on an object */
|
|
1710
2582
|
check: async (subject, permission, object) => {
|
|
@@ -2155,6 +3027,108 @@ export class RaviClient {
|
|
|
2155
3027
|
});
|
|
2156
3028
|
}
|
|
2157
3029
|
};
|
|
3030
|
+
rules = {
|
|
3031
|
+
/** Import provider rules into .ravi/rules/imported */
|
|
3032
|
+
import: async (source, options) => {
|
|
3033
|
+
return this.transport.call({
|
|
3034
|
+
groupSegments: ["rules"],
|
|
3035
|
+
command: "import",
|
|
3036
|
+
body: { source, ...(options ?? {}) },
|
|
3037
|
+
});
|
|
3038
|
+
},
|
|
3039
|
+
/** List importable provider rule sources */
|
|
3040
|
+
sources: async (source, options) => {
|
|
3041
|
+
return this.transport.call({
|
|
3042
|
+
groupSegments: ["rules"],
|
|
3043
|
+
command: "sources",
|
|
3044
|
+
body: { source, ...(options ?? {}) },
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
};
|
|
3048
|
+
runtime = {
|
|
3049
|
+
credentials: {
|
|
3050
|
+
/** Add a managed runtime provider credential */
|
|
3051
|
+
add: async (options) => {
|
|
3052
|
+
return this.transport.call({
|
|
3053
|
+
groupSegments: ["runtime", "credentials"],
|
|
3054
|
+
command: "add",
|
|
3055
|
+
body: { ...(options ?? {}) },
|
|
3056
|
+
});
|
|
3057
|
+
},
|
|
3058
|
+
/** Classify a provider failure for credential fallback */
|
|
3059
|
+
classify: async (options) => {
|
|
3060
|
+
return this.transport.call({
|
|
3061
|
+
groupSegments: ["runtime", "credentials"],
|
|
3062
|
+
command: "classify",
|
|
3063
|
+
body: { ...(options ?? {}) },
|
|
3064
|
+
});
|
|
3065
|
+
},
|
|
3066
|
+
/** Disable a runtime credential immediately */
|
|
3067
|
+
disable: async (id) => {
|
|
3068
|
+
return this.transport.call({
|
|
3069
|
+
groupSegments: ["runtime", "credentials"],
|
|
3070
|
+
command: "disable",
|
|
3071
|
+
body: { id },
|
|
3072
|
+
});
|
|
3073
|
+
},
|
|
3074
|
+
/** Enable a runtime credential */
|
|
3075
|
+
enable: async (id) => {
|
|
3076
|
+
return this.transport.call({
|
|
3077
|
+
groupSegments: ["runtime", "credentials"],
|
|
3078
|
+
command: "enable",
|
|
3079
|
+
body: { id },
|
|
3080
|
+
});
|
|
3081
|
+
},
|
|
3082
|
+
/** Import/reference an existing provider-native credential source */
|
|
3083
|
+
import: async (options) => {
|
|
3084
|
+
return this.transport.call({
|
|
3085
|
+
groupSegments: ["runtime", "credentials"],
|
|
3086
|
+
command: "import",
|
|
3087
|
+
body: { ...(options ?? {}) },
|
|
3088
|
+
});
|
|
3089
|
+
},
|
|
3090
|
+
/** List runtime provider credentials */
|
|
3091
|
+
list: async (options) => {
|
|
3092
|
+
return this.transport.call({
|
|
3093
|
+
groupSegments: ["runtime", "credentials"],
|
|
3094
|
+
command: "list",
|
|
3095
|
+
body: { ...(options ?? {}) },
|
|
3096
|
+
});
|
|
3097
|
+
},
|
|
3098
|
+
/** Refresh or recover credential health before pool selection */
|
|
3099
|
+
refresh: async (id, options) => {
|
|
3100
|
+
return this.transport.call({
|
|
3101
|
+
groupSegments: ["runtime", "credentials"],
|
|
3102
|
+
command: "refresh",
|
|
3103
|
+
body: { id, ...(options ?? {}) },
|
|
3104
|
+
});
|
|
3105
|
+
},
|
|
3106
|
+
/** Clear cooldown/error state for a credential */
|
|
3107
|
+
resetHealth: async (id) => {
|
|
3108
|
+
return this.transport.call({
|
|
3109
|
+
groupSegments: ["runtime", "credentials"],
|
|
3110
|
+
command: "reset-health",
|
|
3111
|
+
body: { id },
|
|
3112
|
+
});
|
|
3113
|
+
},
|
|
3114
|
+
/** Preview which credential the pool would select */
|
|
3115
|
+
select: async (options) => {
|
|
3116
|
+
return this.transport.call({
|
|
3117
|
+
groupSegments: ["runtime", "credentials"],
|
|
3118
|
+
command: "select",
|
|
3119
|
+
body: { ...(options ?? {}) },
|
|
3120
|
+
});
|
|
3121
|
+
},
|
|
3122
|
+
/** Show credential health and provider health */
|
|
3123
|
+
status: async (id) => {
|
|
3124
|
+
return this.transport.call({
|
|
3125
|
+
groupSegments: ["runtime", "credentials"],
|
|
3126
|
+
command: "status",
|
|
3127
|
+
body: { id },
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
};
|
|
2158
3132
|
sdk = {
|
|
2159
3133
|
client: {
|
|
2160
3134
|
/** Compare on-disk @ravi-os/sdk sources to a fresh emit; exit 1 on drift */
|
|
@@ -2277,33 +3251,15 @@ export class RaviClient {
|
|
|
2277
3251
|
});
|
|
2278
3252
|
}
|
|
2279
3253
|
};
|
|
2280
|
-
|
|
2281
|
-
/**
|
|
2282
|
-
|
|
2283
|
-
return this.transport.call({
|
|
2284
|
-
groupSegments: ["service"],
|
|
2285
|
-
command: "start",
|
|
2286
|
-
body: {},
|
|
2287
|
-
});
|
|
2288
|
-
},
|
|
2289
|
-
/** Start the TUI interface */
|
|
2290
|
-
tui: async (session) => {
|
|
3254
|
+
sessions = {
|
|
3255
|
+
/** Show available chat actions and recent own messages for a session */
|
|
3256
|
+
actions: async (nameOrKey, options) => {
|
|
2291
3257
|
return this.transport.call({
|
|
2292
|
-
groupSegments: ["
|
|
2293
|
-
command: "
|
|
2294
|
-
body: {
|
|
3258
|
+
groupSegments: ["sessions"],
|
|
3259
|
+
command: "actions",
|
|
3260
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
2295
3261
|
});
|
|
2296
3262
|
},
|
|
2297
|
-
/** Start WhatsApp gateway (deprecated — use daemon start) */
|
|
2298
|
-
wa: async () => {
|
|
2299
|
-
return this.transport.call({
|
|
2300
|
-
groupSegments: ["service"],
|
|
2301
|
-
command: "wa",
|
|
2302
|
-
body: {},
|
|
2303
|
-
});
|
|
2304
|
-
}
|
|
2305
|
-
};
|
|
2306
|
-
sessions = {
|
|
2307
3263
|
/** Answer a question from another session (fire-and-forget) */
|
|
2308
3264
|
answer: async (target, message, sender, options) => {
|
|
2309
3265
|
return this.transport.call({
|
|
@@ -2320,6 +3276,14 @@ export class RaviClient {
|
|
|
2320
3276
|
body: { target, message, sender, ...(options ?? {}) },
|
|
2321
3277
|
});
|
|
2322
3278
|
},
|
|
3279
|
+
/** Attach a chat as the session output target and input source */
|
|
3280
|
+
attach: async (nameOrKey, options) => {
|
|
3281
|
+
return this.transport.call({
|
|
3282
|
+
groupSegments: ["sessions"],
|
|
3283
|
+
command: "attach",
|
|
3284
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
3285
|
+
});
|
|
3286
|
+
},
|
|
2323
3287
|
/** Delete a session permanently */
|
|
2324
3288
|
delete: async (nameOrKey) => {
|
|
2325
3289
|
return this.transport.call({
|
|
@@ -2328,6 +3292,30 @@ export class RaviClient {
|
|
|
2328
3292
|
body: { nameOrKey },
|
|
2329
3293
|
});
|
|
2330
3294
|
},
|
|
3295
|
+
/** Delete one of this session agent's own channel messages */
|
|
3296
|
+
deleteMessage: async (sessionOrMessage, messageRef) => {
|
|
3297
|
+
return this.transport.call({
|
|
3298
|
+
groupSegments: ["sessions"],
|
|
3299
|
+
command: "delete-message",
|
|
3300
|
+
body: { sessionOrMessage, messageRef },
|
|
3301
|
+
});
|
|
3302
|
+
},
|
|
3303
|
+
/** Detach a chat/output target from a session */
|
|
3304
|
+
detach: async (nameOrKey, options) => {
|
|
3305
|
+
return this.transport.call({
|
|
3306
|
+
groupSegments: ["sessions"],
|
|
3307
|
+
command: "detach",
|
|
3308
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
3309
|
+
});
|
|
3310
|
+
},
|
|
3311
|
+
/** Edit one of this session agent's own text channel messages */
|
|
3312
|
+
editMessage: async (sessionOrMessage, messageOrText, textArg, options) => {
|
|
3313
|
+
return this.transport.call({
|
|
3314
|
+
groupSegments: ["sessions"],
|
|
3315
|
+
command: "edit-message",
|
|
3316
|
+
body: { sessionOrMessage, messageOrText, textArg, ...(options ?? {}) },
|
|
3317
|
+
});
|
|
3318
|
+
},
|
|
2331
3319
|
/** Send an execute command to another session (fire-and-forget) */
|
|
2332
3320
|
execute: async (target, message, options) => {
|
|
2333
3321
|
return this.transport.call({
|
|
@@ -2344,6 +3332,80 @@ export class RaviClient {
|
|
|
2344
3332
|
body: { nameOrKey, duration },
|
|
2345
3333
|
});
|
|
2346
3334
|
},
|
|
3335
|
+
followups: {
|
|
3336
|
+
/** Create a session followup cadence */
|
|
3337
|
+
add: async (name, options) => {
|
|
3338
|
+
return this.transport.call({
|
|
3339
|
+
groupSegments: ["sessions", "followups"],
|
|
3340
|
+
command: "add",
|
|
3341
|
+
body: { name, ...(options ?? {}) },
|
|
3342
|
+
});
|
|
3343
|
+
},
|
|
3344
|
+
/** Inspect one session followup cadence and recent runs */
|
|
3345
|
+
inspect: async (id, options) => {
|
|
3346
|
+
return this.transport.call({
|
|
3347
|
+
groupSegments: ["sessions", "followups"],
|
|
3348
|
+
command: "inspect",
|
|
3349
|
+
body: { id, ...(options ?? {}) },
|
|
3350
|
+
});
|
|
3351
|
+
},
|
|
3352
|
+
/** List session followup cadences */
|
|
3353
|
+
list: async (options) => {
|
|
3354
|
+
return this.transport.call({
|
|
3355
|
+
groupSegments: ["sessions", "followups"],
|
|
3356
|
+
command: "list",
|
|
3357
|
+
body: { ...(options ?? {}) },
|
|
3358
|
+
});
|
|
3359
|
+
},
|
|
3360
|
+
/** Pause a followup cadence */
|
|
3361
|
+
pause: async (id) => {
|
|
3362
|
+
return this.transport.call({
|
|
3363
|
+
groupSegments: ["sessions", "followups"],
|
|
3364
|
+
command: "pause",
|
|
3365
|
+
body: { id },
|
|
3366
|
+
});
|
|
3367
|
+
},
|
|
3368
|
+
/** Resume a followup cadence and recalculate next run */
|
|
3369
|
+
resume: async (id) => {
|
|
3370
|
+
return this.transport.call({
|
|
3371
|
+
groupSegments: ["sessions", "followups"],
|
|
3372
|
+
command: "resume",
|
|
3373
|
+
body: { id },
|
|
3374
|
+
});
|
|
3375
|
+
},
|
|
3376
|
+
/** Retry failed/dead followup runs */
|
|
3377
|
+
retry: async (run, options) => {
|
|
3378
|
+
return this.transport.call({
|
|
3379
|
+
groupSegments: ["sessions", "followups"],
|
|
3380
|
+
command: "retry",
|
|
3381
|
+
body: { run, ...(options ?? {}) },
|
|
3382
|
+
});
|
|
3383
|
+
},
|
|
3384
|
+
/** Run a followup cadence now without consuming its next scheduled time */
|
|
3385
|
+
run: async (id) => {
|
|
3386
|
+
return this.transport.call({
|
|
3387
|
+
groupSegments: ["sessions", "followups"],
|
|
3388
|
+
command: "run",
|
|
3389
|
+
body: { id },
|
|
3390
|
+
});
|
|
3391
|
+
},
|
|
3392
|
+
/** List session followup runs */
|
|
3393
|
+
runs: async (options) => {
|
|
3394
|
+
return this.transport.call({
|
|
3395
|
+
groupSegments: ["sessions", "followups"],
|
|
3396
|
+
command: "runs",
|
|
3397
|
+
body: { ...(options ?? {}) },
|
|
3398
|
+
});
|
|
3399
|
+
},
|
|
3400
|
+
/** Snooze a followup cadence until a timestamp */
|
|
3401
|
+
snooze: async (id, options) => {
|
|
3402
|
+
return this.transport.call({
|
|
3403
|
+
groupSegments: ["sessions", "followups"],
|
|
3404
|
+
command: "snooze",
|
|
3405
|
+
body: { id, ...(options ?? {}) },
|
|
3406
|
+
});
|
|
3407
|
+
}
|
|
3408
|
+
},
|
|
2347
3409
|
/** Inspect or mutate persisted session goal state */
|
|
2348
3410
|
goal: async (action, nameOrKey, objective, options) => {
|
|
2349
3411
|
return this.transport.call({
|
|
@@ -2384,6 +3446,14 @@ export class RaviClient {
|
|
|
2384
3446
|
body: { ...(options ?? {}) },
|
|
2385
3447
|
});
|
|
2386
3448
|
},
|
|
3449
|
+
/** Keep a subscribed chat as listen-only for a session */
|
|
3450
|
+
mute: async (nameOrKey, options) => {
|
|
3451
|
+
return this.transport.call({
|
|
3452
|
+
groupSegments: ["sessions"],
|
|
3453
|
+
command: "mute",
|
|
3454
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
3455
|
+
});
|
|
3456
|
+
},
|
|
2387
3457
|
/** Prune sessions inactive for a duration (dry-run by default) */
|
|
2388
3458
|
prune: async (options) => {
|
|
2389
3459
|
return this.transport.call({
|
|
@@ -2514,6 +3584,14 @@ export class RaviClient {
|
|
|
2514
3584
|
body: { nameOrKey, duration },
|
|
2515
3585
|
});
|
|
2516
3586
|
},
|
|
3587
|
+
/** List chats attached to a session */
|
|
3588
|
+
subscriptions: async (nameOrKey) => {
|
|
3589
|
+
return this.transport.call({
|
|
3590
|
+
groupSegments: ["sessions"],
|
|
3591
|
+
command: "subscriptions",
|
|
3592
|
+
body: { nameOrKey },
|
|
3593
|
+
});
|
|
3594
|
+
},
|
|
2517
3595
|
/** Read the SQLite session trace timeline */
|
|
2518
3596
|
trace: async (nameOrKey, options) => {
|
|
2519
3597
|
return this.transport.call({
|
|
@@ -2522,6 +3600,14 @@ export class RaviClient {
|
|
|
2522
3600
|
body: { nameOrKey, ...(options ?? {}) },
|
|
2523
3601
|
});
|
|
2524
3602
|
},
|
|
3603
|
+
/** Allow a subscribed chat to receive session responses */
|
|
3604
|
+
unmute: async (nameOrKey, options) => {
|
|
3605
|
+
return this.transport.call({
|
|
3606
|
+
groupSegments: ["sessions"],
|
|
3607
|
+
command: "unmute",
|
|
3608
|
+
body: { nameOrKey, ...(options ?? {}) },
|
|
3609
|
+
});
|
|
3610
|
+
},
|
|
2525
3611
|
/** Show runtime session visibility state */
|
|
2526
3612
|
visibility: async (nameOrKey) => {
|
|
2527
3613
|
return this.transport.call({
|
|
@@ -2733,6 +3819,48 @@ export class RaviClient {
|
|
|
2733
3819
|
});
|
|
2734
3820
|
}
|
|
2735
3821
|
};
|
|
3822
|
+
sync = {
|
|
3823
|
+
/** Inspect a sync outbox/inbox row by id */
|
|
3824
|
+
inspect: async (id) => {
|
|
3825
|
+
return this.transport.call({
|
|
3826
|
+
groupSegments: ["sync"],
|
|
3827
|
+
command: "inspect",
|
|
3828
|
+
body: { id },
|
|
3829
|
+
});
|
|
3830
|
+
},
|
|
3831
|
+
/** Download a bounded remote event batch from Console */
|
|
3832
|
+
pull: async (options) => {
|
|
3833
|
+
return this.transport.call({
|
|
3834
|
+
groupSegments: ["sync"],
|
|
3835
|
+
command: "pull",
|
|
3836
|
+
body: { ...(options ?? {}) },
|
|
3837
|
+
});
|
|
3838
|
+
},
|
|
3839
|
+
/** Upload a bounded outbox batch to Console */
|
|
3840
|
+
push: async (options) => {
|
|
3841
|
+
return this.transport.call({
|
|
3842
|
+
groupSegments: ["sync"],
|
|
3843
|
+
command: "push",
|
|
3844
|
+
body: { ...(options ?? {}) },
|
|
3845
|
+
});
|
|
3846
|
+
},
|
|
3847
|
+
/** Move failed sync outbox rows back to pending */
|
|
3848
|
+
retry: async (options) => {
|
|
3849
|
+
return this.transport.call({
|
|
3850
|
+
groupSegments: ["sync"],
|
|
3851
|
+
command: "retry",
|
|
3852
|
+
body: { ...(options ?? {}) },
|
|
3853
|
+
});
|
|
3854
|
+
},
|
|
3855
|
+
/** Show local sync status */
|
|
3856
|
+
status: async () => {
|
|
3857
|
+
return this.transport.call({
|
|
3858
|
+
groupSegments: ["sync"],
|
|
3859
|
+
command: "status",
|
|
3860
|
+
body: {},
|
|
3861
|
+
});
|
|
3862
|
+
}
|
|
3863
|
+
};
|
|
2736
3864
|
tagRules = {
|
|
2737
3865
|
/** Evaluate a rule against a target asset */
|
|
2738
3866
|
evaluate: async (ruleId, options) => {
|
|
@@ -3239,6 +4367,14 @@ export class RaviClient {
|
|
|
3239
4367
|
command: "test",
|
|
3240
4368
|
body: { id },
|
|
3241
4369
|
});
|
|
4370
|
+
},
|
|
4371
|
+
/** List trigger-ready NATS topics */
|
|
4372
|
+
topics: async () => {
|
|
4373
|
+
return this.transport.call({
|
|
4374
|
+
groupSegments: ["triggers"],
|
|
4375
|
+
command: "topics",
|
|
4376
|
+
body: {},
|
|
4377
|
+
});
|
|
3242
4378
|
}
|
|
3243
4379
|
};
|
|
3244
4380
|
video = {
|
|
@@ -3251,6 +4387,80 @@ export class RaviClient {
|
|
|
3251
4387
|
});
|
|
3252
4388
|
}
|
|
3253
4389
|
};
|
|
4390
|
+
watch = {
|
|
4391
|
+
/** List available watch connectors and event types */
|
|
4392
|
+
connectors: async (options) => {
|
|
4393
|
+
return this.transport.call({
|
|
4394
|
+
groupSegments: ["watch"],
|
|
4395
|
+
command: "connectors",
|
|
4396
|
+
body: { ...(options ?? {}) },
|
|
4397
|
+
});
|
|
4398
|
+
},
|
|
4399
|
+
/** Create a watch */
|
|
4400
|
+
create: async (provider, resource, options) => {
|
|
4401
|
+
return this.transport.call({
|
|
4402
|
+
groupSegments: ["watch"],
|
|
4403
|
+
command: "create",
|
|
4404
|
+
body: { provider, resource, ...(options ?? {}) },
|
|
4405
|
+
});
|
|
4406
|
+
},
|
|
4407
|
+
/** Disable a watch */
|
|
4408
|
+
disable: async (id) => {
|
|
4409
|
+
return this.transport.call({
|
|
4410
|
+
groupSegments: ["watch"],
|
|
4411
|
+
command: "disable",
|
|
4412
|
+
body: { id },
|
|
4413
|
+
});
|
|
4414
|
+
},
|
|
4415
|
+
/** Enable a watch */
|
|
4416
|
+
enable: async (id) => {
|
|
4417
|
+
return this.transport.call({
|
|
4418
|
+
groupSegments: ["watch"],
|
|
4419
|
+
command: "enable",
|
|
4420
|
+
body: { id },
|
|
4421
|
+
});
|
|
4422
|
+
},
|
|
4423
|
+
/** Show trigger-ready event subjects for a watch */
|
|
4424
|
+
events: async (id) => {
|
|
4425
|
+
return this.transport.call({
|
|
4426
|
+
groupSegments: ["watch"],
|
|
4427
|
+
command: "events",
|
|
4428
|
+
body: { id },
|
|
4429
|
+
});
|
|
4430
|
+
},
|
|
4431
|
+
/** List watches */
|
|
4432
|
+
list: async (options) => {
|
|
4433
|
+
return this.transport.call({
|
|
4434
|
+
groupSegments: ["watch"],
|
|
4435
|
+
command: "list",
|
|
4436
|
+
body: { ...(options ?? {}) },
|
|
4437
|
+
});
|
|
4438
|
+
},
|
|
4439
|
+
/** Remove a watch */
|
|
4440
|
+
rm: async (id) => {
|
|
4441
|
+
return this.transport.call({
|
|
4442
|
+
groupSegments: ["watch"],
|
|
4443
|
+
command: "rm",
|
|
4444
|
+
body: { id },
|
|
4445
|
+
});
|
|
4446
|
+
},
|
|
4447
|
+
/** Show watch details */
|
|
4448
|
+
show: async (id) => {
|
|
4449
|
+
return this.transport.call({
|
|
4450
|
+
groupSegments: ["watch"],
|
|
4451
|
+
command: "show",
|
|
4452
|
+
body: { id },
|
|
4453
|
+
});
|
|
4454
|
+
},
|
|
4455
|
+
/** Create a trigger for a watch event in the current chat */
|
|
4456
|
+
trigger: async (id, options) => {
|
|
4457
|
+
return this.transport.call({
|
|
4458
|
+
groupSegments: ["watch"],
|
|
4459
|
+
command: "trigger",
|
|
4460
|
+
body: { id, ...(options ?? {}) },
|
|
4461
|
+
});
|
|
4462
|
+
}
|
|
4463
|
+
};
|
|
3254
4464
|
whatsapp = {
|
|
3255
4465
|
dm: {
|
|
3256
4466
|
/** Send read receipt (blue ticks) for a specific message */
|
|
@@ -3383,6 +4593,14 @@ export class RaviClient {
|
|
|
3383
4593
|
body: { groupId, ...(options ?? {}) },
|
|
3384
4594
|
});
|
|
3385
4595
|
},
|
|
4596
|
+
/** Send a message to a WhatsApp group */
|
|
4597
|
+
send: async (groupId, message, options) => {
|
|
4598
|
+
return this.transport.call({
|
|
4599
|
+
groupSegments: ["whatsapp", "group"],
|
|
4600
|
+
command: "send",
|
|
4601
|
+
body: { groupId, message, ...(options ?? {}) },
|
|
4602
|
+
});
|
|
4603
|
+
},
|
|
3386
4604
|
/** Update group settings (announcement, not_announcement, locked, unlocked) */
|
|
3387
4605
|
settings: async (groupId, setting, options) => {
|
|
3388
4606
|
return this.transport.call({
|