@ravi-os/sdk 0.2.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 */
@@ -149,11 +149,11 @@ export class RaviClient {
149
149
  });
150
150
  },
151
151
  /** Create a generic Ravi artifact record */
152
- create: async (kind, options) => {
152
+ create: async (options) => {
153
153
  return this.transport.call({
154
154
  groupSegments: ["artifacts"],
155
155
  command: "create",
156
- body: { kind, ...(options ?? {}) },
156
+ body: { ...(options ?? {}) },
157
157
  });
158
158
  },
159
159
  /** Append an artifact lifecycle event */
@@ -180,6 +180,32 @@ export class RaviClient {
180
180
  body: { ...(options ?? {}) },
181
181
  });
182
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
+ },
183
209
  /** Show artifact details, links and events */
184
210
  show: async (id) => {
185
211
  return this.transport.call({
@@ -188,6 +214,14 @@ export class RaviClient {
188
214
  body: { id },
189
215
  });
190
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
+ },
191
225
  /** Edit artifact metadata and high-level fields */
192
226
  update: async (id, options) => {
193
227
  return this.transport.call({
@@ -196,13 +230,21 @@ export class RaviClient {
196
230
  body: { id, ...(options ?? {}) },
197
231
  });
198
232
  },
199
- /** Watch artifact lifecycle until a terminal status */
200
- watch: async (id, options) => {
233
+ /** Show one immutable artifact version */
234
+ version: async (id, options) => {
201
235
  return this.transport.call({
202
236
  groupSegments: ["artifacts"],
203
- command: "watch",
237
+ command: "version",
204
238
  body: { id, ...(options ?? {}) },
205
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
+ });
206
248
  }
207
249
  };
208
250
  audio = {
@@ -215,7 +257,49 @@ export class RaviClient {
215
257
  });
216
258
  }
217
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
+ };
218
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
+ },
219
303
  /** Add/allow a contact */
220
304
  add: async (identity, name, options) => {
221
305
  return this.transport.call({
@@ -344,6 +428,48 @@ export class RaviClient {
344
428
  body: { source, target },
345
429
  });
346
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
+ },
347
473
  /** List pending contacts */
348
474
  pending: async (options) => {
349
475
  return this.transport.call({
@@ -352,6 +478,14 @@ export class RaviClient {
352
478
  body: { ...(options ?? {}) },
353
479
  });
354
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
+ },
355
489
  /** Remove a contact */
356
490
  remove: async (contact) => {
357
491
  return this.transport.call({
@@ -360,6 +494,14 @@ export class RaviClient {
360
494
  body: { contact },
361
495
  });
362
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
+ },
363
505
  /** Set contact property */
364
506
  set: async (contact, key, value) => {
365
507
  return this.transport.call({
@@ -376,6 +518,14 @@ export class RaviClient {
376
518
  body: { contact, tag },
377
519
  });
378
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
+ },
379
529
  /** Unlink a platform identity from its contact */
380
530
  unlink: async (platformIdentity, options) => {
381
531
  return this.transport.call({
@@ -418,6 +568,14 @@ export class RaviClient {
418
568
  body: { permission, objectType, objectId },
419
569
  });
420
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
+ },
421
579
  /** Evaluate a Codex PreToolUse Bash hook payload from stdin using the current Ravi context */
422
580
  codexBashHook: async () => {
423
581
  return this.transport.call({
@@ -436,11 +594,11 @@ export class RaviClient {
436
594
  });
437
595
  },
438
596
  /** List entries in the local credentials store */
439
- list: async () => {
597
+ list: async (options) => {
440
598
  return this.transport.call({
441
599
  groupSegments: ["context", "credentials"],
442
600
  command: "list",
443
- body: {},
601
+ body: { ...(options ?? {}) },
444
602
  });
445
603
  },
446
604
  /** Remove a stored context-key from the credentials store */
@@ -500,6 +658,14 @@ export class RaviClient {
500
658
  body: { contextId, ...(options ?? {}) },
501
659
  });
502
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
+ },
503
669
  /** Resolve the current runtime context */
504
670
  whoami: async () => {
505
671
  return this.transport.call({
@@ -551,6 +717,202 @@ export class RaviClient {
551
717
  });
552
718
  }
553
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
+ };
554
916
  cron = {
555
917
  /** Add a new scheduled job */
556
918
  add: async (name, options) => {
@@ -577,11 +939,11 @@ export class RaviClient {
577
939
  });
578
940
  },
579
941
  /** List all scheduled jobs */
580
- list: async () => {
942
+ list: async (options) => {
581
943
  return this.transport.call({
582
944
  groupSegments: ["cron"],
583
945
  command: "list",
584
- body: {},
946
+ body: { ...(options ?? {}) },
585
947
  });
586
948
  },
587
949
  /** Delete a job */
@@ -618,14 +980,6 @@ export class RaviClient {
618
980
  }
619
981
  };
620
982
  daemon = {
621
- /** Run daemon in dev mode with auto-rebuild on file changes */
622
- dev: async () => {
623
- return this.transport.call({
624
- groupSegments: ["daemon"],
625
- command: "dev",
626
- body: {},
627
- });
628
- },
629
983
  /** Edit environment file (~/.ravi/.env) */
630
984
  env: async () => {
631
985
  return this.transport.call({
@@ -666,14 +1020,6 @@ export class RaviClient {
666
1020
  body: { ...(options ?? {}) },
667
1021
  });
668
1022
  },
669
- /** Run daemon in foreground (used by PM2) */
670
- run: async () => {
671
- return this.transport.call({
672
- groupSegments: ["daemon"],
673
- command: "run",
674
- body: {},
675
- });
676
- },
677
1023
  /** Start the daemon via PM2 */
678
1024
  start: async () => {
679
1025
  return this.transport.call({
@@ -811,24 +1157,6 @@ export class RaviClient {
811
1157
  });
812
1158
  }
813
1159
  };
814
- events = {
815
- /** Replay persisted JetStream events with filters */
816
- replay: async (options) => {
817
- return this.transport.call({
818
- groupSegments: ["events"],
819
- command: "replay",
820
- body: { ...(options ?? {}) },
821
- });
822
- },
823
- /** Stream all events in real-time (default command) */
824
- stream: async (options) => {
825
- return this.transport.call({
826
- groupSegments: ["events"],
827
- command: "stream",
828
- body: { ...(options ?? {}) },
829
- });
830
- }
831
- };
832
1160
  heartbeat = {
833
1161
  /** Disable heartbeat for an agent */
834
1162
  disable: async (id) => {
@@ -905,11 +1233,11 @@ export class RaviClient {
905
1233
  });
906
1234
  },
907
1235
  /** List configured hooks */
908
- list: async () => {
1236
+ list: async (options) => {
909
1237
  return this.transport.call({
910
1238
  groupSegments: ["hooks"],
911
1239
  command: "list",
912
- body: {},
1240
+ body: { ...(options ?? {}) },
913
1241
  });
914
1242
  },
915
1243
  /** Delete a hook */
@@ -992,14 +1320,6 @@ export class RaviClient {
992
1320
  }
993
1321
  };
994
1322
  instances = {
995
- /** Connect an instance to omni (QR code for WhatsApp) */
996
- connect: async (name, options) => {
997
- return this.transport.call({
998
- groupSegments: ["instances"],
999
- command: "connect",
1000
- body: { name, ...(options ?? {}) },
1001
- });
1002
- },
1003
1323
  /** Create a new instance */
1004
1324
  create: async (name, options) => {
1005
1325
  return this.transport.call({
@@ -1057,11 +1377,11 @@ export class RaviClient {
1057
1377
  });
1058
1378
  },
1059
1379
  /** List all instances */
1060
- list: async () => {
1380
+ list: async (options) => {
1061
1381
  return this.transport.call({
1062
1382
  groupSegments: ["instances"],
1063
1383
  command: "list",
1064
- body: {},
1384
+ body: { ...(options ?? {}) },
1065
1385
  });
1066
1386
  },
1067
1387
  pending: {
@@ -1074,11 +1394,11 @@ export class RaviClient {
1074
1394
  });
1075
1395
  },
1076
1396
  /** List pending contacts and chats for an instance */
1077
- list: async (name) => {
1397
+ list: async (name, options) => {
1078
1398
  return this.transport.call({
1079
1399
  groupSegments: ["instances", "pending"],
1080
1400
  command: "list",
1081
- body: { name },
1401
+ body: { name, ...(options ?? {}) },
1082
1402
  });
1083
1403
  },
1084
1404
  /** Reject and remove a pending contact or chat */
@@ -1116,11 +1436,11 @@ export class RaviClient {
1116
1436
  });
1117
1437
  },
1118
1438
  /** List routes for an instance */
1119
- list: async (name) => {
1439
+ list: async (name, options) => {
1120
1440
  return this.transport.call({
1121
1441
  groupSegments: ["instances", "routes"],
1122
1442
  command: "list",
1123
- body: { name },
1443
+ body: { name, ...(options ?? {}) },
1124
1444
  });
1125
1445
  },
1126
1446
  /** Remove a route (soft-delete, recoverable) */
@@ -1199,6 +1519,140 @@ export class RaviClient {
1199
1519
  });
1200
1520
  }
1201
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
+ };
1202
1656
  permissions = {
1203
1657
  /** Check if a subject has a permission on an object */
1204
1658
  check: async (subject, permission, object) => {
@@ -1439,11 +1893,11 @@ export class RaviClient {
1439
1893
  });
1440
1894
  },
1441
1895
  /** List available call profiles */
1442
- list: async () => {
1896
+ list: async (options) => {
1443
1897
  return this.transport.call({
1444
1898
  groupSegments: ["prox", "calls", "profiles"],
1445
1899
  command: "list",
1446
- body: {},
1900
+ body: { ...(options ?? {}) },
1447
1901
  });
1448
1902
  },
1449
1903
  /** Show a call profile by ID */
@@ -1579,11 +2033,11 @@ export class RaviClient {
1579
2033
  });
1580
2034
  },
1581
2035
  /** List voice agents */
1582
- list: async () => {
2036
+ list: async (options) => {
1583
2037
  return this.transport.call({
1584
2038
  groupSegments: ["prox", "calls", "voice-agents"],
1585
2039
  command: "list",
1586
- body: {},
2040
+ body: { ...(options ?? {}) },
1587
2041
  });
1588
2042
  },
1589
2043
  /** Show a voice agent by ID */
@@ -1633,11 +2087,11 @@ export class RaviClient {
1633
2087
  });
1634
2088
  },
1635
2089
  /** List routes across all instances or for one instance */
1636
- list: async (name) => {
2090
+ list: async (name, options) => {
1637
2091
  return this.transport.call({
1638
2092
  groupSegments: ["routes"],
1639
2093
  command: "list",
1640
- body: { name },
2094
+ body: { name, ...(options ?? {}) },
1641
2095
  });
1642
2096
  },
1643
2097
  /** Show route details */
@@ -1685,6 +2139,90 @@ export class RaviClient {
1685
2139
  body: { ...(options ?? {}) },
1686
2140
  });
1687
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
+ });
1688
2226
  }
1689
2227
  };
1690
2228
  service = {
@@ -1730,14 +2268,6 @@ export class RaviClient {
1730
2268
  body: { target, message, sender, ...(options ?? {}) },
1731
2269
  });
1732
2270
  },
1733
- /** Tail live runtime events for a session (defaults to current session when available) */
1734
- debug: async (nameOrKey, options) => {
1735
- return this.transport.call({
1736
- groupSegments: ["sessions"],
1737
- command: "debug",
1738
- body: { nameOrKey, ...(options ?? {}) },
1739
- });
1740
- },
1741
2271
  /** Delete a session permanently */
1742
2272
  delete: async (nameOrKey) => {
1743
2273
  return this.transport.call({
@@ -1762,6 +2292,14 @@ export class RaviClient {
1762
2292
  body: { nameOrKey, duration },
1763
2293
  });
1764
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
+ },
1765
2303
  /** Show unified session inspection details */
1766
2304
  info: async (nameOrKey) => {
1767
2305
  return this.transport.call({
@@ -1794,6 +2332,14 @@ export class RaviClient {
1794
2332
  body: { ...(options ?? {}) },
1795
2333
  });
1796
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
+ },
1797
2343
  /** Read message history of a session (normalized) */
1798
2344
  read: async (nameOrKey, options) => {
1799
2345
  return this.transport.call({
@@ -1923,6 +2469,14 @@ export class RaviClient {
1923
2469
  command: "trace",
1924
2470
  body: { nameOrKey, ...(options ?? {}) },
1925
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
+ });
1926
2480
  }
1927
2481
  };
1928
2482
  settings = {
@@ -1959,6 +2513,64 @@ export class RaviClient {
1959
2513
  });
1960
2514
  }
1961
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
+ };
1962
2574
  skills = {
1963
2575
  /** Install Ravi catalog skills or skills from an explicit source */
1964
2576
  install: async (name, options) => {
@@ -2037,11 +2649,11 @@ export class RaviClient {
2037
2649
  });
2038
2650
  },
2039
2651
  /** List stickers in the typed catalog */
2040
- list: async () => {
2652
+ list: async (options) => {
2041
2653
  return this.transport.call({
2042
2654
  groupSegments: ["stickers"],
2043
2655
  command: "list",
2044
- body: {},
2656
+ body: { ...(options ?? {}) },
2045
2657
  });
2046
2658
  },
2047
2659
  /** Remove a sticker catalog entry */
@@ -2070,7 +2682,7 @@ export class RaviClient {
2070
2682
  }
2071
2683
  };
2072
2684
  tags = {
2073
- /** Attach a tag to an agent or session */
2685
+ /** Attach a tag to a Ravi asset */
2074
2686
  attach: async (slug, options) => {
2075
2687
  return this.transport.call({
2076
2688
  groupSegments: ["tags"],
@@ -2086,7 +2698,7 @@ export class RaviClient {
2086
2698
  body: { slug, ...(options ?? {}) },
2087
2699
  });
2088
2700
  },
2089
- /** Detach a tag from an agent or session */
2701
+ /** Detach a tag from a Ravi asset */
2090
2702
  detach: async (slug, options) => {
2091
2703
  return this.transport.call({
2092
2704
  groupSegments: ["tags"],
@@ -2095,11 +2707,11 @@ export class RaviClient {
2095
2707
  });
2096
2708
  },
2097
2709
  /** List tag definitions */
2098
- list: async () => {
2710
+ list: async (options) => {
2099
2711
  return this.transport.call({
2100
2712
  groupSegments: ["tags"],
2101
2713
  command: "list",
2102
- body: {},
2714
+ body: { ...(options ?? {}) },
2103
2715
  });
2104
2716
  },
2105
2717
  /** Search bindings by tag or asset */
@@ -2110,6 +2722,14 @@ export class RaviClient {
2110
2722
  body: { ...(options ?? {}) },
2111
2723
  });
2112
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
+ },
2113
2733
  /** Show one tag and its bindings */
2114
2734
  show: async (slug) => {
2115
2735
  return this.transport.call({
@@ -2154,11 +2774,11 @@ export class RaviClient {
2154
2774
  });
2155
2775
  },
2156
2776
  /** List configured task automations */
2157
- list: async () => {
2777
+ list: async (options) => {
2158
2778
  return this.transport.call({
2159
2779
  groupSegments: ["tasks", "automations"],
2160
2780
  command: "list",
2161
- body: {},
2781
+ body: { ...(options ?? {}) },
2162
2782
  });
2163
2783
  },
2164
2784
  /** Delete a task automation */
@@ -2212,11 +2832,11 @@ export class RaviClient {
2212
2832
  });
2213
2833
  },
2214
2834
  /** List gating dependencies and dependents for a task */
2215
- ls: async (taskId) => {
2835
+ ls: async (taskId, options) => {
2216
2836
  return this.transport.call({
2217
2837
  groupSegments: ["tasks", "deps"],
2218
2838
  command: "ls",
2219
- body: { taskId },
2839
+ body: { taskId, ...(options ?? {}) },
2220
2840
  });
2221
2841
  },
2222
2842
  /** Remove one gating dependency from a task */
@@ -2270,11 +2890,11 @@ export class RaviClient {
2270
2890
  });
2271
2891
  },
2272
2892
  /** List resolved task profiles from all catalog sources */
2273
- list: async () => {
2893
+ list: async (options) => {
2274
2894
  return this.transport.call({
2275
2895
  groupSegments: ["tasks", "profiles"],
2276
2896
  command: "list",
2277
- body: {},
2897
+ body: { ...(options ?? {}) },
2278
2898
  });
2279
2899
  },
2280
2900
  /** Render a profile preview with the resolved template context */
@@ -2325,57 +2945,15 @@ export class RaviClient {
2325
2945
  command: "unarchive",
2326
2946
  body: { taskId },
2327
2947
  });
2328
- },
2329
- /** Watch task events live */
2330
- watch: async (taskId) => {
2331
- return this.transport.call({
2332
- groupSegments: ["tasks"],
2333
- command: "watch",
2334
- body: { taskId },
2335
- });
2336
- }
2337
- };
2338
- tmux = {
2339
- /** Attach or switch to an agent/session inside tmux */
2340
- attach: async (agent, session) => {
2341
- return this.transport.call({
2342
- groupSegments: ["tmux"],
2343
- command: "attach",
2344
- body: { agent, session },
2345
- });
2346
- },
2347
- /** List Ravi-managed tmux sessions and windows */
2348
- list: async () => {
2349
- return this.transport.call({
2350
- groupSegments: ["tmux"],
2351
- command: "list",
2352
- body: {},
2353
- });
2354
- },
2355
- /** Ensure a tmux session/window exists for an agent or session */
2356
- open: async (agent, session) => {
2357
- return this.transport.call({
2358
- groupSegments: ["tmux"],
2359
- command: "open",
2360
- body: { agent, session },
2361
- });
2362
- },
2363
- /** Listen to NATS prompts and open tmux windows automatically */
2364
- watch: async (options) => {
2365
- return this.transport.call({
2366
- groupSegments: ["tmux"],
2367
- command: "watch",
2368
- body: { ...(options ?? {}) },
2369
- });
2370
2948
  }
2371
2949
  };
2372
2950
  tools = {
2373
2951
  /** List all available CLI tools */
2374
- list: async () => {
2952
+ list: async (options) => {
2375
2953
  return this.transport.call({
2376
2954
  groupSegments: ["tools"],
2377
2955
  command: "list",
2378
- body: {},
2956
+ body: { ...(options ?? {}) },
2379
2957
  });
2380
2958
  },
2381
2959
  /** Export tools as JSON manifest */
@@ -2447,11 +3025,11 @@ export class RaviClient {
2447
3025
  });
2448
3026
  },
2449
3027
  /** List all event triggers */
2450
- list: async () => {
3028
+ list: async (options) => {
2451
3029
  return this.transport.call({
2452
3030
  groupSegments: ["triggers"],
2453
3031
  command: "list",
2454
- body: {},
3032
+ body: { ...(options ?? {}) },
2455
3033
  });
2456
3034
  },
2457
3035
  /** Delete a trigger */
@@ -2498,6 +3076,16 @@ export class RaviClient {
2498
3076
  }
2499
3077
  };
2500
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
+ },
2501
3089
  dm: {
2502
3090
  /** Send read receipt (blue ticks) for a specific message */
2503
3091
  ack: async (contact, messageId, options) => {
@@ -2658,11 +3246,11 @@ export class RaviClient {
2658
3246
  });
2659
3247
  },
2660
3248
  /** List workflow runs */
2661
- list: async () => {
3249
+ list: async (options) => {
2662
3250
  return this.transport.call({
2663
3251
  groupSegments: ["workflows", "runs"],
2664
3252
  command: "list",
2665
- body: {},
3253
+ body: { ...(options ?? {}) },
2666
3254
  });
2667
3255
  },
2668
3256
  /** Release a manual node transition or gate */
@@ -2724,11 +3312,11 @@ export class RaviClient {
2724
3312
  });
2725
3313
  },
2726
3314
  /** List workflow specs */
2727
- list: async () => {
3315
+ list: async (options) => {
2728
3316
  return this.transport.call({
2729
3317
  groupSegments: ["workflows", "specs"],
2730
3318
  command: "list",
2731
- body: {},
3319
+ body: { ...(options ?? {}) },
2732
3320
  });
2733
3321
  },
2734
3322
  /** Show one workflow spec */