@ravi-os/sdk 0.1.0 → 0.2.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.js CHANGED
@@ -66,11 +66,11 @@ export class RaviClient {
66
66
  });
67
67
  },
68
68
  /** List all agents */
69
- list: async () => {
69
+ list: async (options) => {
70
70
  return this.transport.call({
71
71
  groupSegments: ["agents"],
72
72
  command: "list",
73
- body: {},
73
+ body: { ...(options ?? {}) },
74
74
  });
75
75
  },
76
76
  /** Reset agent session */
@@ -139,12 +139,21 @@ export class RaviClient {
139
139
  body: { id, targetType, targetId, ...(options ?? {}) },
140
140
  });
141
141
  },
142
+ /** Stream raw artifact bytes */
143
+ blob: async (id) => {
144
+ return this.transport.call({
145
+ groupSegments: ["artifacts"],
146
+ command: "blob",
147
+ body: { id },
148
+ binary: true,
149
+ });
150
+ },
142
151
  /** Create a generic Ravi artifact record */
143
- create: async (kind, options) => {
152
+ create: async (options) => {
144
153
  return this.transport.call({
145
154
  groupSegments: ["artifacts"],
146
155
  command: "create",
147
- body: { kind, ...(options ?? {}) },
156
+ body: { ...(options ?? {}) },
148
157
  });
149
158
  },
150
159
  /** Append an artifact lifecycle event */
@@ -171,6 +180,32 @@ export class RaviClient {
171
180
  body: { ...(options ?? {}) },
172
181
  });
173
182
  },
183
+ /** Publish a local artifact package through a Console-compatible endpoint */
184
+ publish: async (target, options) => {
185
+ return this.transport.call({
186
+ groupSegments: ["artifacts"],
187
+ command: "publish",
188
+ body: { target, ...(options ?? {}) },
189
+ });
190
+ },
191
+ release: {
192
+ /** Activate an existing Pages release for a local artifact */
193
+ activate: async (id, options) => {
194
+ return this.transport.call({
195
+ groupSegments: ["artifacts", "release"],
196
+ command: "activate",
197
+ body: { id, ...(options ?? {}) },
198
+ });
199
+ }
200
+ },
201
+ /** Restore current artifact content from an immutable version */
202
+ restore: async (id, options) => {
203
+ return this.transport.call({
204
+ groupSegments: ["artifacts"],
205
+ command: "restore",
206
+ body: { id, ...(options ?? {}) },
207
+ });
208
+ },
174
209
  /** Show artifact details, links and events */
175
210
  show: async (id) => {
176
211
  return this.transport.call({
@@ -179,6 +214,14 @@ export class RaviClient {
179
214
  body: { id },
180
215
  });
181
216
  },
217
+ /** Create an immutable version snapshot for an artifact */
218
+ snapshot: async (id, options) => {
219
+ return this.transport.call({
220
+ groupSegments: ["artifacts"],
221
+ command: "snapshot",
222
+ body: { id, ...(options ?? {}) },
223
+ });
224
+ },
182
225
  /** Edit artifact metadata and high-level fields */
183
226
  update: async (id, options) => {
184
227
  return this.transport.call({
@@ -187,13 +230,21 @@ export class RaviClient {
187
230
  body: { id, ...(options ?? {}) },
188
231
  });
189
232
  },
190
- /** Watch artifact lifecycle until a terminal status */
191
- watch: async (id, options) => {
233
+ /** Show one immutable artifact version */
234
+ version: async (id, options) => {
192
235
  return this.transport.call({
193
236
  groupSegments: ["artifacts"],
194
- command: "watch",
237
+ command: "version",
195
238
  body: { id, ...(options ?? {}) },
196
239
  });
240
+ },
241
+ /** List immutable versions for an artifact */
242
+ versions: async (id) => {
243
+ return this.transport.call({
244
+ groupSegments: ["artifacts"],
245
+ command: "versions",
246
+ body: { id },
247
+ });
197
248
  }
198
249
  };
199
250
  audio = {
@@ -206,7 +257,49 @@ export class RaviClient {
206
257
  });
207
258
  }
208
259
  };
260
+ commands = {
261
+ /** List Ravi commands */
262
+ list: async (options) => {
263
+ return this.transport.call({
264
+ groupSegments: ["commands"],
265
+ command: "list",
266
+ body: { ...(options ?? {}) },
267
+ });
268
+ },
269
+ /** Render a Ravi command into its composed prompt */
270
+ run: async (name, args, options) => {
271
+ return this.transport.call({
272
+ groupSegments: ["commands"],
273
+ command: "run",
274
+ body: { name, args, ...(options ?? {}) },
275
+ });
276
+ },
277
+ /** Show one Ravi command */
278
+ show: async (name, options) => {
279
+ return this.transport.call({
280
+ groupSegments: ["commands"],
281
+ command: "show",
282
+ body: { name, ...(options ?? {}) },
283
+ });
284
+ },
285
+ /** Validate Ravi command files */
286
+ validate: async (options) => {
287
+ return this.transport.call({
288
+ groupSegments: ["commands"],
289
+ command: "validate",
290
+ body: { ...(options ?? {}) },
291
+ });
292
+ }
293
+ };
209
294
  contacts = {
295
+ /** Show session activity attributed to a contact */
296
+ activity: async (contact, options) => {
297
+ return this.transport.call({
298
+ groupSegments: ["contacts"],
299
+ command: "activity",
300
+ body: { contact, ...(options ?? {}) },
301
+ });
302
+ },
210
303
  /** Add/allow a contact */
211
304
  add: async (identity, name, options) => {
212
305
  return this.transport.call({
@@ -335,6 +428,48 @@ export class RaviClient {
335
428
  body: { source, target },
336
429
  });
337
430
  },
431
+ /** Show messages attributed to a contact */
432
+ messages: async (contact, options) => {
433
+ return this.transport.call({
434
+ groupSegments: ["contacts"],
435
+ command: "messages",
436
+ body: { contact, ...(options ?? {}) },
437
+ });
438
+ },
439
+ metadata: {
440
+ /** List current scoped metadata for a contact */
441
+ list: async (contact, options) => {
442
+ return this.transport.call({
443
+ groupSegments: ["contacts", "metadata"],
444
+ command: "list",
445
+ body: { contact, ...(options ?? {}) },
446
+ });
447
+ },
448
+ /** Remove scoped metadata from a contact */
449
+ remove: async (contact, key, options) => {
450
+ return this.transport.call({
451
+ groupSegments: ["contacts", "metadata"],
452
+ command: "remove",
453
+ body: { contact, key, ...(options ?? {}) },
454
+ });
455
+ },
456
+ /** Set scoped metadata for a contact */
457
+ set: async (contact, key, value, options) => {
458
+ return this.transport.call({
459
+ groupSegments: ["contacts", "metadata"],
460
+ command: "set",
461
+ body: { contact, key, value, ...(options ?? {}) },
462
+ });
463
+ }
464
+ },
465
+ /** Append a note to a contact timeline */
466
+ note: async (contact, text, options) => {
467
+ return this.transport.call({
468
+ groupSegments: ["contacts"],
469
+ command: "note",
470
+ body: { contact, text, ...(options ?? {}) },
471
+ });
472
+ },
338
473
  /** List pending contacts */
339
474
  pending: async (options) => {
340
475
  return this.transport.call({
@@ -343,6 +478,14 @@ export class RaviClient {
343
478
  body: { ...(options ?? {}) },
344
479
  });
345
480
  },
481
+ /** Show a contact profile card */
482
+ profile: async (contact, options) => {
483
+ return this.transport.call({
484
+ groupSegments: ["contacts"],
485
+ command: "profile",
486
+ body: { contact, ...(options ?? {}) },
487
+ });
488
+ },
346
489
  /** Remove a contact */
347
490
  remove: async (contact) => {
348
491
  return this.transport.call({
@@ -351,6 +494,14 @@ export class RaviClient {
351
494
  body: { contact },
352
495
  });
353
496
  },
497
+ /** Show session summaries attributed to a contact */
498
+ sessions: async (contact, options) => {
499
+ return this.transport.call({
500
+ groupSegments: ["contacts"],
501
+ command: "sessions",
502
+ body: { contact, ...(options ?? {}) },
503
+ });
504
+ },
354
505
  /** Set contact property */
355
506
  set: async (contact, key, value) => {
356
507
  return this.transport.call({
@@ -367,6 +518,14 @@ export class RaviClient {
367
518
  body: { contact, tag },
368
519
  });
369
520
  },
521
+ /** Show contact timeline events */
522
+ timeline: async (contact, options) => {
523
+ return this.transport.call({
524
+ groupSegments: ["contacts"],
525
+ command: "timeline",
526
+ body: { contact, ...(options ?? {}) },
527
+ });
528
+ },
370
529
  /** Unlink a platform identity from its contact */
371
530
  unlink: async (platformIdentity, options) => {
372
531
  return this.transport.call({
@@ -409,6 +568,14 @@ export class RaviClient {
409
568
  body: { permission, objectType, objectId },
410
569
  });
411
570
  },
571
+ /** Dry-run or revoke stale agent-runtime contexts left by old turn-scoped issuance */
572
+ cleanupAgentRuntime: async (options) => {
573
+ return this.transport.call({
574
+ groupSegments: ["context"],
575
+ command: "cleanup-agent-runtime",
576
+ body: { ...(options ?? {}) },
577
+ });
578
+ },
412
579
  /** Evaluate a Codex PreToolUse Bash hook payload from stdin using the current Ravi context */
413
580
  codexBashHook: async () => {
414
581
  return this.transport.call({
@@ -427,11 +594,11 @@ export class RaviClient {
427
594
  });
428
595
  },
429
596
  /** List entries in the local credentials store */
430
- list: async () => {
597
+ list: async (options) => {
431
598
  return this.transport.call({
432
599
  groupSegments: ["context", "credentials"],
433
600
  command: "list",
434
- body: {},
601
+ body: { ...(options ?? {}) },
435
602
  });
436
603
  },
437
604
  /** Remove a stored context-key from the credentials store */
@@ -491,6 +658,14 @@ export class RaviClient {
491
658
  body: { contextId, ...(options ?? {}) },
492
659
  });
493
660
  },
661
+ /** Show the current context session visibility */
662
+ visibility: async () => {
663
+ return this.transport.call({
664
+ groupSegments: ["context"],
665
+ command: "visibility",
666
+ body: {},
667
+ });
668
+ },
494
669
  /** Resolve the current runtime context */
495
670
  whoami: async () => {
496
671
  return this.transport.call({
@@ -542,6 +717,202 @@ export class RaviClient {
542
717
  });
543
718
  }
544
719
  };
720
+ crm = {
721
+ account: {
722
+ /** Create a CRM account */
723
+ create: async (name, options) => {
724
+ return this.transport.call({
725
+ groupSegments: ["crm", "account"],
726
+ command: "create",
727
+ body: { name, ...(options ?? {}) },
728
+ });
729
+ },
730
+ /** Link a contact to an account */
731
+ linkContact: async (account, contact, options) => {
732
+ return this.transport.call({
733
+ groupSegments: ["crm", "account"],
734
+ command: "link-contact",
735
+ body: { account, contact, ...(options ?? {}) },
736
+ });
737
+ },
738
+ /** Show CRM account */
739
+ show: async (account) => {
740
+ return this.transport.call({
741
+ groupSegments: ["crm", "account"],
742
+ command: "show",
743
+ body: { account },
744
+ });
745
+ }
746
+ },
747
+ /** Show CRM account */
748
+ accountCommand: async (account) => {
749
+ return this.transport.call({
750
+ groupSegments: ["crm"],
751
+ command: "account",
752
+ body: { account },
753
+ });
754
+ },
755
+ /** Show open opportunity board */
756
+ board: async () => {
757
+ return this.transport.call({
758
+ groupSegments: ["crm"],
759
+ command: "board",
760
+ body: {},
761
+ });
762
+ },
763
+ contact: {
764
+ /** Set one CRM contact profile field */
765
+ set: async (contact, field, value, options) => {
766
+ return this.transport.call({
767
+ groupSegments: ["crm", "contact"],
768
+ command: "set",
769
+ body: { contact, field, value, ...(options ?? {}) },
770
+ });
771
+ },
772
+ /** Show CRM profile for one contact */
773
+ show: async (contact) => {
774
+ return this.transport.call({
775
+ groupSegments: ["crm", "contact"],
776
+ command: "show",
777
+ body: { contact },
778
+ });
779
+ }
780
+ },
781
+ /** Show CRM profile for one contact */
782
+ contactCommand: async (contact) => {
783
+ return this.transport.call({
784
+ groupSegments: ["crm"],
785
+ command: "contact",
786
+ body: { contact },
787
+ });
788
+ },
789
+ /** List CRM contact cards */
790
+ contacts: async (options) => {
791
+ return this.transport.call({
792
+ groupSegments: ["crm"],
793
+ command: "contacts",
794
+ body: { ...(options ?? {}) },
795
+ });
796
+ },
797
+ fact: {
798
+ /** Confirm a CRM fact */
799
+ confirm: async (fact) => {
800
+ return this.transport.call({
801
+ groupSegments: ["crm", "fact"],
802
+ command: "confirm",
803
+ body: { fact },
804
+ });
805
+ },
806
+ /** List CRM facts */
807
+ list: async (options) => {
808
+ return this.transport.call({
809
+ groupSegments: ["crm", "fact"],
810
+ command: "list",
811
+ body: { ...(options ?? {}) },
812
+ });
813
+ },
814
+ /** Propose or confirm a CRM fact */
815
+ propose: async (entityType, entity, key, value, options) => {
816
+ return this.transport.call({
817
+ groupSegments: ["crm", "fact"],
818
+ command: "propose",
819
+ body: { entityType, entity, key, value, ...(options ?? {}) },
820
+ });
821
+ },
822
+ /** Reject a CRM fact */
823
+ reject: async (fact) => {
824
+ return this.transport.call({
825
+ groupSegments: ["crm", "fact"],
826
+ command: "reject",
827
+ body: { fact },
828
+ });
829
+ }
830
+ },
831
+ /** List open CRM next actions */
832
+ next: async (options) => {
833
+ return this.transport.call({
834
+ groupSegments: ["crm"],
835
+ command: "next",
836
+ body: { ...(options ?? {}) },
837
+ });
838
+ },
839
+ opportunity: {
840
+ /** List contacts linked to an opportunity */
841
+ contacts: async (opportunity) => {
842
+ return this.transport.call({
843
+ groupSegments: ["crm", "opportunity"],
844
+ command: "contacts",
845
+ body: { opportunity },
846
+ });
847
+ },
848
+ /** Create a CRM opportunity */
849
+ create: async (title, options) => {
850
+ return this.transport.call({
851
+ groupSegments: ["crm", "opportunity"],
852
+ command: "create",
853
+ body: { title, ...(options ?? {}) },
854
+ });
855
+ },
856
+ /** Link a contact to an opportunity */
857
+ linkContact: async (opportunity, contact, options) => {
858
+ return this.transport.call({
859
+ groupSegments: ["crm", "opportunity"],
860
+ command: "link-contact",
861
+ body: { opportunity, contact, ...(options ?? {}) },
862
+ });
863
+ },
864
+ /** Move an opportunity to another stage */
865
+ move: async (opportunity, stage, options) => {
866
+ return this.transport.call({
867
+ groupSegments: ["crm", "opportunity"],
868
+ command: "move",
869
+ body: { opportunity, stage, ...(options ?? {}) },
870
+ });
871
+ },
872
+ /** Show CRM opportunity */
873
+ show: async (opportunity) => {
874
+ return this.transport.call({
875
+ groupSegments: ["crm", "opportunity"],
876
+ command: "show",
877
+ body: { opportunity },
878
+ });
879
+ }
880
+ },
881
+ /** Show CRM opportunity */
882
+ opportunityCommand: async (opportunity) => {
883
+ return this.transport.call({
884
+ groupSegments: ["crm"],
885
+ command: "opportunity",
886
+ body: { opportunity },
887
+ });
888
+ },
889
+ task: {
890
+ /** Create a CRM relationship task */
891
+ create: async (title, options) => {
892
+ return this.transport.call({
893
+ groupSegments: ["crm", "task"],
894
+ command: "create",
895
+ body: { title, ...(options ?? {}) },
896
+ });
897
+ },
898
+ /** Complete a CRM task */
899
+ done: async (task) => {
900
+ return this.transport.call({
901
+ groupSegments: ["crm", "task"],
902
+ command: "done",
903
+ body: { task },
904
+ });
905
+ },
906
+ /** Show CRM task */
907
+ show: async (task) => {
908
+ return this.transport.call({
909
+ groupSegments: ["crm", "task"],
910
+ command: "show",
911
+ body: { task },
912
+ });
913
+ }
914
+ }
915
+ };
545
916
  cron = {
546
917
  /** Add a new scheduled job */
547
918
  add: async (name, options) => {
@@ -568,11 +939,11 @@ export class RaviClient {
568
939
  });
569
940
  },
570
941
  /** List all scheduled jobs */
571
- list: async () => {
942
+ list: async (options) => {
572
943
  return this.transport.call({
573
944
  groupSegments: ["cron"],
574
945
  command: "list",
575
- body: {},
946
+ body: { ...(options ?? {}) },
576
947
  });
577
948
  },
578
949
  /** Delete a job */
@@ -609,14 +980,6 @@ export class RaviClient {
609
980
  }
610
981
  };
611
982
  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
983
  /** Edit environment file (~/.ravi/.env) */
621
984
  env: async () => {
622
985
  return this.transport.call({
@@ -657,14 +1020,6 @@ export class RaviClient {
657
1020
  body: { ...(options ?? {}) },
658
1021
  });
659
1022
  },
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
1023
  /** Start the daemon via PM2 */
669
1024
  start: async () => {
670
1025
  return this.transport.call({
@@ -802,24 +1157,6 @@ export class RaviClient {
802
1157
  });
803
1158
  }
804
1159
  };
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
1160
  heartbeat = {
824
1161
  /** Disable heartbeat for an agent */
825
1162
  disable: async (id) => {
@@ -896,11 +1233,11 @@ export class RaviClient {
896
1233
  });
897
1234
  },
898
1235
  /** List configured hooks */
899
- list: async () => {
1236
+ list: async (options) => {
900
1237
  return this.transport.call({
901
1238
  groupSegments: ["hooks"],
902
1239
  command: "list",
903
- body: {},
1240
+ body: { ...(options ?? {}) },
904
1241
  });
905
1242
  },
906
1243
  /** Delete a hook */
@@ -983,14 +1320,6 @@ export class RaviClient {
983
1320
  }
984
1321
  };
985
1322
  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
1323
  /** Create a new instance */
995
1324
  create: async (name, options) => {
996
1325
  return this.transport.call({
@@ -1048,11 +1377,11 @@ export class RaviClient {
1048
1377
  });
1049
1378
  },
1050
1379
  /** List all instances */
1051
- list: async () => {
1380
+ list: async (options) => {
1052
1381
  return this.transport.call({
1053
1382
  groupSegments: ["instances"],
1054
1383
  command: "list",
1055
- body: {},
1384
+ body: { ...(options ?? {}) },
1056
1385
  });
1057
1386
  },
1058
1387
  pending: {
@@ -1065,11 +1394,11 @@ export class RaviClient {
1065
1394
  });
1066
1395
  },
1067
1396
  /** List pending contacts and chats for an instance */
1068
- list: async (name) => {
1397
+ list: async (name, options) => {
1069
1398
  return this.transport.call({
1070
1399
  groupSegments: ["instances", "pending"],
1071
1400
  command: "list",
1072
- body: { name },
1401
+ body: { name, ...(options ?? {}) },
1073
1402
  });
1074
1403
  },
1075
1404
  /** Reject and remove a pending contact or chat */
@@ -1107,11 +1436,11 @@ export class RaviClient {
1107
1436
  });
1108
1437
  },
1109
1438
  /** List routes for an instance */
1110
- list: async (name) => {
1439
+ list: async (name, options) => {
1111
1440
  return this.transport.call({
1112
1441
  groupSegments: ["instances", "routes"],
1113
1442
  command: "list",
1114
- body: { name },
1443
+ body: { name, ...(options ?? {}) },
1115
1444
  });
1116
1445
  },
1117
1446
  /** Remove a route (soft-delete, recoverable) */
@@ -1190,6 +1519,140 @@ export class RaviClient {
1190
1519
  });
1191
1520
  }
1192
1521
  };
1522
+ observers = {
1523
+ /** List session observer bindings */
1524
+ list: async (options) => {
1525
+ return this.transport.call({
1526
+ groupSegments: ["observers"],
1527
+ command: "list",
1528
+ body: { ...(options ?? {}) },
1529
+ });
1530
+ },
1531
+ profiles: {
1532
+ /** Create a Markdown observer profile scaffold */
1533
+ init: async (profileId, options) => {
1534
+ return this.transport.call({
1535
+ groupSegments: ["observers", "profiles"],
1536
+ command: "init",
1537
+ body: { profileId, ...(options ?? {}) },
1538
+ });
1539
+ },
1540
+ /** List observer profiles */
1541
+ list: async (options) => {
1542
+ return this.transport.call({
1543
+ groupSegments: ["observers", "profiles"],
1544
+ command: "list",
1545
+ body: { ...(options ?? {}) },
1546
+ });
1547
+ },
1548
+ /** Render an observer profile preview */
1549
+ preview: async (profileId, options) => {
1550
+ return this.transport.call({
1551
+ groupSegments: ["observers", "profiles"],
1552
+ command: "preview",
1553
+ body: { profileId, ...(options ?? {}) },
1554
+ });
1555
+ },
1556
+ /** Show one observer profile */
1557
+ show: async (profileId) => {
1558
+ return this.transport.call({
1559
+ groupSegments: ["observers", "profiles"],
1560
+ command: "show",
1561
+ body: { profileId },
1562
+ });
1563
+ },
1564
+ /** Validate observer profiles */
1565
+ validate: async (profileId) => {
1566
+ return this.transport.call({
1567
+ groupSegments: ["observers", "profiles"],
1568
+ command: "validate",
1569
+ body: { profileId },
1570
+ });
1571
+ }
1572
+ },
1573
+ /** Apply observer rules to an existing source session */
1574
+ refresh: async (session) => {
1575
+ return this.transport.call({
1576
+ groupSegments: ["observers"],
1577
+ command: "refresh",
1578
+ body: { session },
1579
+ });
1580
+ },
1581
+ rules: {
1582
+ /** Disable an observer rule */
1583
+ disable: async (id) => {
1584
+ return this.transport.call({
1585
+ groupSegments: ["observers", "rules"],
1586
+ command: "disable",
1587
+ body: { id },
1588
+ });
1589
+ },
1590
+ /** Enable an observer rule */
1591
+ enable: async (id) => {
1592
+ return this.transport.call({
1593
+ groupSegments: ["observers", "rules"],
1594
+ command: "enable",
1595
+ body: { id },
1596
+ });
1597
+ },
1598
+ /** Explain observer rule matching for a source session */
1599
+ explain: async (session) => {
1600
+ return this.transport.call({
1601
+ groupSegments: ["observers", "rules"],
1602
+ command: "explain",
1603
+ body: { session },
1604
+ });
1605
+ },
1606
+ /** List observer rules */
1607
+ list: async (options) => {
1608
+ return this.transport.call({
1609
+ groupSegments: ["observers", "rules"],
1610
+ command: "list",
1611
+ body: { ...(options ?? {}) },
1612
+ });
1613
+ },
1614
+ /** Delete an observer rule */
1615
+ rm: async (id) => {
1616
+ return this.transport.call({
1617
+ groupSegments: ["observers", "rules"],
1618
+ command: "rm",
1619
+ body: { id },
1620
+ });
1621
+ },
1622
+ /** Create or overwrite an observer rule */
1623
+ set: async (id, observerAgentId, options) => {
1624
+ return this.transport.call({
1625
+ groupSegments: ["observers", "rules"],
1626
+ command: "set",
1627
+ body: { id, observerAgentId, ...(options ?? {}) },
1628
+ });
1629
+ },
1630
+ /** Show one observer rule */
1631
+ show: async (id) => {
1632
+ return this.transport.call({
1633
+ groupSegments: ["observers", "rules"],
1634
+ command: "show",
1635
+ body: { id },
1636
+ });
1637
+ },
1638
+ /** Validate observer rules */
1639
+ validate: async () => {
1640
+ return this.transport.call({
1641
+ groupSegments: ["observers", "rules"],
1642
+ command: "validate",
1643
+ body: {},
1644
+ });
1645
+ }
1646
+ },
1647
+ /** Show one observer binding */
1648
+ show: async (bindingId) => {
1649
+ return this.transport.call({
1650
+ groupSegments: ["observers"],
1651
+ command: "show",
1652
+ body: { bindingId },
1653
+ });
1654
+ }
1655
+ };
1193
1656
  permissions = {
1194
1657
  /** Check if a subject has a permission on an object */
1195
1658
  check: async (subject, permission, object) => {
@@ -1430,11 +1893,11 @@ export class RaviClient {
1430
1893
  });
1431
1894
  },
1432
1895
  /** List available call profiles */
1433
- list: async () => {
1896
+ list: async (options) => {
1434
1897
  return this.transport.call({
1435
1898
  groupSegments: ["prox", "calls", "profiles"],
1436
1899
  command: "list",
1437
- body: {},
1900
+ body: { ...(options ?? {}) },
1438
1901
  });
1439
1902
  },
1440
1903
  /** Show a call profile by ID */
@@ -1570,11 +2033,11 @@ export class RaviClient {
1570
2033
  });
1571
2034
  },
1572
2035
  /** List voice agents */
1573
- list: async () => {
2036
+ list: async (options) => {
1574
2037
  return this.transport.call({
1575
2038
  groupSegments: ["prox", "calls", "voice-agents"],
1576
2039
  command: "list",
1577
- body: {},
2040
+ body: { ...(options ?? {}) },
1578
2041
  });
1579
2042
  },
1580
2043
  /** Show a voice agent by ID */
@@ -1624,11 +2087,11 @@ export class RaviClient {
1624
2087
  });
1625
2088
  },
1626
2089
  /** List routes across all instances or for one instance */
1627
- list: async (name) => {
2090
+ list: async (name, options) => {
1628
2091
  return this.transport.call({
1629
2092
  groupSegments: ["routes"],
1630
2093
  command: "list",
1631
- body: { name },
2094
+ body: { name, ...(options ?? {}) },
1632
2095
  });
1633
2096
  },
1634
2097
  /** Show route details */
@@ -1676,6 +2139,90 @@ export class RaviClient {
1676
2139
  body: { ...(options ?? {}) },
1677
2140
  });
1678
2141
  }
2142
+ },
2143
+ swift: {
2144
+ /** Compare on-disk Ravi Swift SDK sources to a fresh emit; exit 1 on drift */
2145
+ check: async (options) => {
2146
+ return this.transport.call({
2147
+ groupSegments: ["sdk", "swift"],
2148
+ command: "check",
2149
+ body: { ...(options ?? {}) },
2150
+ });
2151
+ },
2152
+ /** Generate the Ravi Swift SDK source files from the live registry */
2153
+ generate: async (options) => {
2154
+ return this.transport.call({
2155
+ groupSegments: ["sdk", "swift"],
2156
+ command: "generate",
2157
+ body: { ...(options ?? {}) },
2158
+ });
2159
+ }
2160
+ }
2161
+ };
2162
+ self = {
2163
+ /** Show the current chat binding and participants */
2164
+ chat: async (options) => {
2165
+ return this.transport.call({
2166
+ groupSegments: ["self"],
2167
+ command: "chat",
2168
+ body: { ...(options ?? {}) },
2169
+ });
2170
+ },
2171
+ /** Show the full current self-context packet */
2172
+ context: async (options) => {
2173
+ return this.transport.call({
2174
+ groupSegments: ["self"],
2175
+ command: "context",
2176
+ body: { ...(options ?? {}) },
2177
+ });
2178
+ },
2179
+ /** Explain how Ravi resolved the current self-context */
2180
+ explain: async () => {
2181
+ return this.transport.call({
2182
+ groupSegments: ["self"],
2183
+ command: "explain",
2184
+ body: {},
2185
+ });
2186
+ },
2187
+ /** Show current knowledge integration status for this context */
2188
+ knowledge: async () => {
2189
+ return this.transport.call({
2190
+ groupSegments: ["self"],
2191
+ command: "knowledge",
2192
+ body: {},
2193
+ });
2194
+ },
2195
+ /** Show capabilities inherited by the current context */
2196
+ permissions: async () => {
2197
+ return this.transport.call({
2198
+ groupSegments: ["self"],
2199
+ command: "permissions",
2200
+ body: {},
2201
+ });
2202
+ },
2203
+ /** Show bounded recent message metadata for the current chat */
2204
+ recent: async (options) => {
2205
+ return this.transport.call({
2206
+ groupSegments: ["self"],
2207
+ command: "recent",
2208
+ body: { ...(options ?? {}) },
2209
+ });
2210
+ },
2211
+ /** Show route information that led to the current session */
2212
+ route: async () => {
2213
+ return this.transport.call({
2214
+ groupSegments: ["self"],
2215
+ command: "route",
2216
+ body: {},
2217
+ });
2218
+ },
2219
+ /** Show the current agent/session identity */
2220
+ whoami: async () => {
2221
+ return this.transport.call({
2222
+ groupSegments: ["self"],
2223
+ command: "whoami",
2224
+ body: {},
2225
+ });
1679
2226
  }
1680
2227
  };
1681
2228
  service = {
@@ -1721,14 +2268,6 @@ export class RaviClient {
1721
2268
  body: { target, message, sender, ...(options ?? {}) },
1722
2269
  });
1723
2270
  },
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
2271
  /** Delete a session permanently */
1733
2272
  delete: async (nameOrKey) => {
1734
2273
  return this.transport.call({
@@ -1753,6 +2292,14 @@ export class RaviClient {
1753
2292
  body: { nameOrKey, duration },
1754
2293
  });
1755
2294
  },
2295
+ /** Inspect or mutate persisted session goal state */
2296
+ goal: async (action, nameOrKey, objective, options) => {
2297
+ return this.transport.call({
2298
+ groupSegments: ["sessions"],
2299
+ command: "goal",
2300
+ body: { action, nameOrKey, objective, ...(options ?? {}) },
2301
+ });
2302
+ },
1756
2303
  /** Show unified session inspection details */
1757
2304
  info: async (nameOrKey) => {
1758
2305
  return this.transport.call({
@@ -1785,6 +2332,14 @@ export class RaviClient {
1785
2332
  body: { ...(options ?? {}) },
1786
2333
  });
1787
2334
  },
2335
+ /** Prune sessions inactive for a duration (dry-run by default) */
2336
+ prune: async (options) => {
2337
+ return this.transport.call({
2338
+ groupSegments: ["sessions"],
2339
+ command: "prune",
2340
+ body: { ...(options ?? {}) },
2341
+ });
2342
+ },
1788
2343
  /** Read message history of a session (normalized) */
1789
2344
  read: async (nameOrKey, options) => {
1790
2345
  return this.transport.call({
@@ -1914,6 +2469,14 @@ export class RaviClient {
1914
2469
  command: "trace",
1915
2470
  body: { nameOrKey, ...(options ?? {}) },
1916
2471
  });
2472
+ },
2473
+ /** Show runtime session visibility state */
2474
+ visibility: async (nameOrKey) => {
2475
+ return this.transport.call({
2476
+ groupSegments: ["sessions"],
2477
+ command: "visibility",
2478
+ body: { nameOrKey },
2479
+ });
1917
2480
  }
1918
2481
  };
1919
2482
  settings = {
@@ -1950,6 +2513,64 @@ export class RaviClient {
1950
2513
  });
1951
2514
  }
1952
2515
  };
2516
+ skillGates = {
2517
+ /** Disable a skill gate rule */
2518
+ disable: async (id) => {
2519
+ return this.transport.call({
2520
+ groupSegments: ["skill-gates"],
2521
+ command: "disable",
2522
+ body: { id },
2523
+ });
2524
+ },
2525
+ /** Enable a configured skill gate rule */
2526
+ enable: async (id) => {
2527
+ return this.transport.call({
2528
+ groupSegments: ["skill-gates"],
2529
+ command: "enable",
2530
+ body: { id },
2531
+ });
2532
+ },
2533
+ /** List skill gate rules */
2534
+ list: async (options) => {
2535
+ return this.transport.call({
2536
+ groupSegments: ["skill-gates"],
2537
+ command: "list",
2538
+ body: { ...(options ?? {}) },
2539
+ });
2540
+ },
2541
+ /** Delete a configured override and restore the default behavior */
2542
+ reset: async (id) => {
2543
+ return this.transport.call({
2544
+ groupSegments: ["skill-gates"],
2545
+ command: "reset",
2546
+ body: { id },
2547
+ });
2548
+ },
2549
+ /** Remove a custom gate or disable a default gate */
2550
+ rm: async (id) => {
2551
+ return this.transport.call({
2552
+ groupSegments: ["skill-gates"],
2553
+ command: "rm",
2554
+ body: { id },
2555
+ });
2556
+ },
2557
+ /** Create or overwrite a skill gate rule */
2558
+ set: async (id, skill, options) => {
2559
+ return this.transport.call({
2560
+ groupSegments: ["skill-gates"],
2561
+ command: "set",
2562
+ body: { id, skill, ...(options ?? {}) },
2563
+ });
2564
+ },
2565
+ /** Show one skill gate rule */
2566
+ show: async (id) => {
2567
+ return this.transport.call({
2568
+ groupSegments: ["skill-gates"],
2569
+ command: "show",
2570
+ body: { id },
2571
+ });
2572
+ }
2573
+ };
1953
2574
  skills = {
1954
2575
  /** Install Ravi catalog skills or skills from an explicit source */
1955
2576
  install: async (name, options) => {
@@ -2028,11 +2649,11 @@ export class RaviClient {
2028
2649
  });
2029
2650
  },
2030
2651
  /** List stickers in the typed catalog */
2031
- list: async () => {
2652
+ list: async (options) => {
2032
2653
  return this.transport.call({
2033
2654
  groupSegments: ["stickers"],
2034
2655
  command: "list",
2035
- body: {},
2656
+ body: { ...(options ?? {}) },
2036
2657
  });
2037
2658
  },
2038
2659
  /** Remove a sticker catalog entry */
@@ -2061,7 +2682,7 @@ export class RaviClient {
2061
2682
  }
2062
2683
  };
2063
2684
  tags = {
2064
- /** Attach a tag to an agent or session */
2685
+ /** Attach a tag to a Ravi asset */
2065
2686
  attach: async (slug, options) => {
2066
2687
  return this.transport.call({
2067
2688
  groupSegments: ["tags"],
@@ -2077,7 +2698,7 @@ export class RaviClient {
2077
2698
  body: { slug, ...(options ?? {}) },
2078
2699
  });
2079
2700
  },
2080
- /** Detach a tag from an agent or session */
2701
+ /** Detach a tag from a Ravi asset */
2081
2702
  detach: async (slug, options) => {
2082
2703
  return this.transport.call({
2083
2704
  groupSegments: ["tags"],
@@ -2086,11 +2707,11 @@ export class RaviClient {
2086
2707
  });
2087
2708
  },
2088
2709
  /** List tag definitions */
2089
- list: async () => {
2710
+ list: async (options) => {
2090
2711
  return this.transport.call({
2091
2712
  groupSegments: ["tags"],
2092
2713
  command: "list",
2093
- body: {},
2714
+ body: { ...(options ?? {}) },
2094
2715
  });
2095
2716
  },
2096
2717
  /** Search bindings by tag or asset */
@@ -2101,6 +2722,14 @@ export class RaviClient {
2101
2722
  body: { ...(options ?? {}) },
2102
2723
  });
2103
2724
  },
2725
+ /** Set tag definition metadata */
2726
+ set: async (slug, key, value) => {
2727
+ return this.transport.call({
2728
+ groupSegments: ["tags"],
2729
+ command: "set",
2730
+ body: { slug, key, value },
2731
+ });
2732
+ },
2104
2733
  /** Show one tag and its bindings */
2105
2734
  show: async (slug) => {
2106
2735
  return this.transport.call({
@@ -2145,11 +2774,11 @@ export class RaviClient {
2145
2774
  });
2146
2775
  },
2147
2776
  /** List configured task automations */
2148
- list: async () => {
2777
+ list: async (options) => {
2149
2778
  return this.transport.call({
2150
2779
  groupSegments: ["tasks", "automations"],
2151
2780
  command: "list",
2152
- body: {},
2781
+ body: { ...(options ?? {}) },
2153
2782
  });
2154
2783
  },
2155
2784
  /** Delete a task automation */
@@ -2203,11 +2832,11 @@ export class RaviClient {
2203
2832
  });
2204
2833
  },
2205
2834
  /** List gating dependencies and dependents for a task */
2206
- ls: async (taskId) => {
2835
+ ls: async (taskId, options) => {
2207
2836
  return this.transport.call({
2208
2837
  groupSegments: ["tasks", "deps"],
2209
2838
  command: "ls",
2210
- body: { taskId },
2839
+ body: { taskId, ...(options ?? {}) },
2211
2840
  });
2212
2841
  },
2213
2842
  /** Remove one gating dependency from a task */
@@ -2261,11 +2890,11 @@ export class RaviClient {
2261
2890
  });
2262
2891
  },
2263
2892
  /** List resolved task profiles from all catalog sources */
2264
- list: async () => {
2893
+ list: async (options) => {
2265
2894
  return this.transport.call({
2266
2895
  groupSegments: ["tasks", "profiles"],
2267
2896
  command: "list",
2268
- body: {},
2897
+ body: { ...(options ?? {}) },
2269
2898
  });
2270
2899
  },
2271
2900
  /** Render a profile preview with the resolved template context */
@@ -2316,57 +2945,15 @@ export class RaviClient {
2316
2945
  command: "unarchive",
2317
2946
  body: { taskId },
2318
2947
  });
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
2948
  }
2362
2949
  };
2363
2950
  tools = {
2364
2951
  /** List all available CLI tools */
2365
- list: async () => {
2952
+ list: async (options) => {
2366
2953
  return this.transport.call({
2367
2954
  groupSegments: ["tools"],
2368
2955
  command: "list",
2369
- body: {},
2956
+ body: { ...(options ?? {}) },
2370
2957
  });
2371
2958
  },
2372
2959
  /** Export tools as JSON manifest */
@@ -2438,11 +3025,11 @@ export class RaviClient {
2438
3025
  });
2439
3026
  },
2440
3027
  /** List all event triggers */
2441
- list: async () => {
3028
+ list: async (options) => {
2442
3029
  return this.transport.call({
2443
3030
  groupSegments: ["triggers"],
2444
3031
  command: "list",
2445
- body: {},
3032
+ body: { ...(options ?? {}) },
2446
3033
  });
2447
3034
  },
2448
3035
  /** Delete a trigger */
@@ -2489,6 +3076,16 @@ export class RaviClient {
2489
3076
  }
2490
3077
  };
2491
3078
  whatsapp = {
3079
+ chats: {
3080
+ /** List chats with message activity in the last N days (or since a date) */
3081
+ list: async (options) => {
3082
+ return this.transport.call({
3083
+ groupSegments: ["whatsapp", "chats"],
3084
+ command: "list",
3085
+ body: { ...(options ?? {}) },
3086
+ });
3087
+ }
3088
+ },
2492
3089
  dm: {
2493
3090
  /** Send read receipt (blue ticks) for a specific message */
2494
3091
  ack: async (contact, messageId, options) => {
@@ -2649,11 +3246,11 @@ export class RaviClient {
2649
3246
  });
2650
3247
  },
2651
3248
  /** List workflow runs */
2652
- list: async () => {
3249
+ list: async (options) => {
2653
3250
  return this.transport.call({
2654
3251
  groupSegments: ["workflows", "runs"],
2655
3252
  command: "list",
2656
- body: {},
3253
+ body: { ...(options ?? {}) },
2657
3254
  });
2658
3255
  },
2659
3256
  /** Release a manual node transition or gate */
@@ -2715,11 +3312,11 @@ export class RaviClient {
2715
3312
  });
2716
3313
  },
2717
3314
  /** List workflow specs */
2718
- list: async () => {
3315
+ list: async (options) => {
2719
3316
  return this.transport.call({
2720
3317
  groupSegments: ["workflows", "specs"],
2721
3318
  command: "list",
2722
- body: {},
3319
+ body: { ...(options ?? {}) },
2723
3320
  });
2724
3321
  },
2725
3322
  /** Show one workflow spec */