@tai42/api-client 14.0.0 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -46,9 +46,7 @@ export interface ApiKeyBody {
46
46
  readonly description: string;
47
47
  readonly scopes: string[];
48
48
  readonly policy_data?: Record<string, unknown> | null;
49
- readonly condition?: string | null;
50
- readonly condition_id?: string | null;
51
- readonly condition_kwargs?: Record<string, unknown> | null;
49
+ readonly condition?: s.TemplatedText | null;
52
50
  }
53
51
  /**
54
52
  * Body for one-time claim-link creation (POST `/api/auth/claim-links`). The
@@ -61,16 +59,13 @@ export interface ClaimLinkBody {
61
59
  readonly ttl_seconds?: number | null;
62
60
  }
63
61
  /**
64
- * Body for the fail-closed jq guard (POST `/api/auth/validate-condition`).
65
- * `condition` (inline jq) and `condition_id` (named template) are mutually
66
- * exclusive — send exactly one. `sample_context` is a `JqAuthContext`-shaped
67
- * sample; when present the guard also evaluates the condition against it and
68
- * returns the boolean `result` (else `result` is `null`).
62
+ * Body for the fail-closed jq guard (POST `/api/auth/validate-condition`). The guard
63
+ * compile-checks the inline jq `condition` the author typed. `sample_context` is a
64
+ * `JqAuthContext`-shaped sample; when present the guard also evaluates the condition
65
+ * against it and returns the boolean `result` (else `result` is `null`).
69
66
  */
70
67
  export interface ValidateConditionBody {
71
68
  readonly condition?: string;
72
- readonly condition_id?: string;
73
- readonly condition_kwargs?: Record<string, unknown>;
74
69
  readonly sample_context?: Record<string, unknown>;
75
70
  }
76
71
  /**
@@ -392,23 +387,29 @@ export interface SetMcpSecretEnvBody {
392
387
  /**
393
388
  * The client-facing write body for a state declaration (`PUT /api/states/{name}`), the
394
389
  * wire shape of `tai42_contract.states.StateDeclaration` minus the platform-computed
395
- * `effective_schema`/`regimes` (those are read-only, refused on a write). `retention_days`
396
- * is `null` to keep records forever.
390
+ * `effective_schema`/`regimes` (those are read-only, refused on a write). `schema` is the
391
+ * `TemplatedText | dict` union: an inline JSON-schema object, or a stored template reference
392
+ * (`id` + render `kwargs`) the platform renders to the schema. `retention_days` is `null` to
393
+ * keep records forever.
397
394
  */
398
395
  export interface StateDeclarationBody {
399
396
  readonly name: string;
400
397
  readonly description?: string;
401
- readonly schema: Record<string, unknown>;
398
+ readonly schema: s.TemplatedText | Record<string, unknown>;
402
399
  readonly subject_kinds: readonly string[];
403
400
  readonly default_subject_kind: string;
404
401
  readonly retention_days?: number | null;
405
402
  }
406
- /** A state-template document write body (`PUT /api/state-templates/{name}`, the platform half). */
403
+ /**
404
+ * A state-template document write body (`PUT /api/state-templates/{name}`, the platform half).
405
+ * `schema` is the `TemplatedText | dict` union — an inline fragment schema, or a stored
406
+ * template reference the platform renders to the fragment.
407
+ */
407
408
  export interface StateTemplateBody {
408
409
  readonly name: string;
409
410
  readonly description?: string;
410
411
  readonly parameters?: Record<string, unknown>;
411
- readonly schema: Record<string, unknown>;
412
+ readonly schema: s.TemplatedText | Record<string, unknown>;
412
413
  readonly regimes?: Record<string, unknown>[];
413
414
  readonly declarations?: Record<string, unknown> | null;
414
415
  readonly trace?: Record<string, unknown>;
@@ -551,29 +552,58 @@ export declare function createApiClient(config: ApiConfig): {
551
552
  body: {
552
553
  base_tool: string;
553
554
  description: string;
555
+ extensions: (string | Record<string, unknown>)[][];
554
556
  fixed_kwargs: Record<string, unknown>;
555
- extensions: (string | {
556
- name: string;
557
- config: Record<string, unknown>;
558
- })[][];
559
- output_schema: Record<string, unknown> | null;
560
- input_schema: Record<string, unknown> | null;
557
+ input_schema: Record<string, unknown> | {
558
+ content?: string | undefined;
559
+ id?: string | undefined;
560
+ kwargs?: Record<string, unknown> | undefined;
561
+ } | null;
562
+ output_schema: Record<string, unknown> | {
563
+ content?: string | undefined;
564
+ id?: string | undefined;
565
+ kwargs?: Record<string, unknown> | undefined;
566
+ } | null;
561
567
  state_binding: {
562
568
  states: {
563
- state: string;
564
- templates: string[];
565
- subject_expr: string;
566
- scope_expr: string | null;
567
569
  input_injections: {
568
- template_jq: string | null;
569
- jq: string | null;
570
570
  into: string;
571
+ jq: {
572
+ content?: string | undefined;
573
+ id?: string | undefined;
574
+ kwargs?: Record<string, unknown> | undefined;
575
+ } | null;
576
+ template_jq: string | null;
571
577
  }[];
578
+ scope_expr: {
579
+ content?: string | undefined;
580
+ id?: string | undefined;
581
+ kwargs?: Record<string, unknown> | undefined;
582
+ } | null;
583
+ state: string;
584
+ subject_expr: {
585
+ content?: string | undefined;
586
+ id?: string | undefined;
587
+ kwargs?: Record<string, unknown> | undefined;
588
+ };
589
+ templates: string[];
572
590
  updates: {
591
+ adapter: {
592
+ content?: string | undefined;
593
+ id?: string | undefined;
594
+ kwargs?: Record<string, unknown> | undefined;
595
+ } | null;
596
+ jq: {
597
+ content?: string | undefined;
598
+ id?: string | undefined;
599
+ kwargs?: Record<string, unknown> | undefined;
600
+ } | null;
601
+ op_id: {
602
+ content?: string | undefined;
603
+ id?: string | undefined;
604
+ kwargs?: Record<string, unknown> | undefined;
605
+ } | null;
573
606
  template_jq: string | null;
574
- jq: string | null;
575
- adapter: string | null;
576
- op_id: string | null;
577
607
  }[];
578
608
  }[];
579
609
  } | null;
@@ -587,29 +617,58 @@ export declare function createApiClient(config: ApiConfig): {
587
617
  body: {
588
618
  base_tool: string;
589
619
  description: string;
620
+ extensions: (string | Record<string, unknown>)[][];
590
621
  fixed_kwargs: Record<string, unknown>;
591
- extensions: (string | {
592
- name: string;
593
- config: Record<string, unknown>;
594
- })[][];
595
- output_schema: Record<string, unknown> | null;
596
- input_schema: Record<string, unknown> | null;
622
+ input_schema: Record<string, unknown> | {
623
+ content?: string | undefined;
624
+ id?: string | undefined;
625
+ kwargs?: Record<string, unknown> | undefined;
626
+ } | null;
627
+ output_schema: Record<string, unknown> | {
628
+ content?: string | undefined;
629
+ id?: string | undefined;
630
+ kwargs?: Record<string, unknown> | undefined;
631
+ } | null;
597
632
  state_binding: {
598
633
  states: {
599
- state: string;
600
- templates: string[];
601
- subject_expr: string;
602
- scope_expr: string | null;
603
634
  input_injections: {
604
- template_jq: string | null;
605
- jq: string | null;
606
635
  into: string;
636
+ jq: {
637
+ content?: string | undefined;
638
+ id?: string | undefined;
639
+ kwargs?: Record<string, unknown> | undefined;
640
+ } | null;
641
+ template_jq: string | null;
607
642
  }[];
643
+ scope_expr: {
644
+ content?: string | undefined;
645
+ id?: string | undefined;
646
+ kwargs?: Record<string, unknown> | undefined;
647
+ } | null;
648
+ state: string;
649
+ subject_expr: {
650
+ content?: string | undefined;
651
+ id?: string | undefined;
652
+ kwargs?: Record<string, unknown> | undefined;
653
+ };
654
+ templates: string[];
608
655
  updates: {
656
+ adapter: {
657
+ content?: string | undefined;
658
+ id?: string | undefined;
659
+ kwargs?: Record<string, unknown> | undefined;
660
+ } | null;
661
+ jq: {
662
+ content?: string | undefined;
663
+ id?: string | undefined;
664
+ kwargs?: Record<string, unknown> | undefined;
665
+ } | null;
666
+ op_id: {
667
+ content?: string | undefined;
668
+ id?: string | undefined;
669
+ kwargs?: Record<string, unknown> | undefined;
670
+ } | null;
609
671
  template_jq: string | null;
610
- jq: string | null;
611
- adapter: string | null;
612
- op_id: string | null;
613
672
  }[];
614
673
  }[];
615
674
  } | null;
@@ -623,29 +682,58 @@ export declare function createApiClient(config: ApiConfig): {
623
682
  body: {
624
683
  base_tool: string;
625
684
  description: string;
685
+ extensions: (string | Record<string, unknown>)[][];
626
686
  fixed_kwargs: Record<string, unknown>;
627
- extensions: (string | {
628
- name: string;
629
- config: Record<string, unknown>;
630
- })[][];
631
- output_schema: Record<string, unknown> | null;
632
- input_schema: Record<string, unknown> | null;
687
+ input_schema: Record<string, unknown> | {
688
+ content?: string | undefined;
689
+ id?: string | undefined;
690
+ kwargs?: Record<string, unknown> | undefined;
691
+ } | null;
692
+ output_schema: Record<string, unknown> | {
693
+ content?: string | undefined;
694
+ id?: string | undefined;
695
+ kwargs?: Record<string, unknown> | undefined;
696
+ } | null;
633
697
  state_binding: {
634
698
  states: {
635
- state: string;
636
- templates: string[];
637
- subject_expr: string;
638
- scope_expr: string | null;
639
699
  input_injections: {
640
- template_jq: string | null;
641
- jq: string | null;
642
700
  into: string;
701
+ jq: {
702
+ content?: string | undefined;
703
+ id?: string | undefined;
704
+ kwargs?: Record<string, unknown> | undefined;
705
+ } | null;
706
+ template_jq: string | null;
643
707
  }[];
708
+ scope_expr: {
709
+ content?: string | undefined;
710
+ id?: string | undefined;
711
+ kwargs?: Record<string, unknown> | undefined;
712
+ } | null;
713
+ state: string;
714
+ subject_expr: {
715
+ content?: string | undefined;
716
+ id?: string | undefined;
717
+ kwargs?: Record<string, unknown> | undefined;
718
+ };
719
+ templates: string[];
644
720
  updates: {
721
+ adapter: {
722
+ content?: string | undefined;
723
+ id?: string | undefined;
724
+ kwargs?: Record<string, unknown> | undefined;
725
+ } | null;
726
+ jq: {
727
+ content?: string | undefined;
728
+ id?: string | undefined;
729
+ kwargs?: Record<string, unknown> | undefined;
730
+ } | null;
731
+ op_id: {
732
+ content?: string | undefined;
733
+ id?: string | undefined;
734
+ kwargs?: Record<string, unknown> | undefined;
735
+ } | null;
645
736
  template_jq: string | null;
646
- jq: string | null;
647
- adapter: string | null;
648
- op_id: string | null;
649
737
  }[];
650
738
  }[];
651
739
  } | null;
@@ -681,47 +769,61 @@ export declare function createApiClient(config: ApiConfig): {
681
769
  tags: string[];
682
770
  }>;
683
771
  readonly listStates: (signal?: AbortSignal) => Promise<{
684
- name: string;
685
- description: string;
686
- schema: Record<string, unknown>;
687
- subject_kinds: string[];
688
772
  default_subject_kind: string;
773
+ description: string;
774
+ effective_schema: Record<string, unknown> | null;
775
+ name: string;
776
+ regimes: Record<string, unknown>[] | null;
689
777
  retention_days: number | null;
778
+ subject_kinds: string[];
690
779
  updated_at: string | null;
691
- effective_schema?: Record<string, unknown> | null | undefined;
692
- regimes?: Record<string, unknown>[] | null | undefined;
780
+ schema?: Record<string, unknown> | {
781
+ content?: string | undefined;
782
+ id?: string | undefined;
783
+ kwargs?: Record<string, unknown> | undefined;
784
+ } | undefined;
693
785
  }[]>;
694
786
  readonly getState: (name: string, signal?: AbortSignal) => Promise<{
695
- name: string;
696
- description: string;
697
- schema: Record<string, unknown>;
698
- subject_kinds: string[];
699
787
  default_subject_kind: string;
788
+ description: string;
789
+ effective_schema: Record<string, unknown> | null;
790
+ name: string;
791
+ regimes: Record<string, unknown>[] | null;
700
792
  retention_days: number | null;
793
+ subject_kinds: string[];
794
+ updated_at: string | null;
701
795
  attachments: {
702
796
  template: string;
703
797
  path: string[];
704
798
  parameters: Record<string, unknown>;
705
799
  declarations: Record<string, unknown>;
706
800
  }[];
707
- effective_schema?: Record<string, unknown> | null | undefined;
708
- regimes?: Record<string, unknown>[] | null | undefined;
801
+ schema?: Record<string, unknown> | {
802
+ content?: string | undefined;
803
+ id?: string | undefined;
804
+ kwargs?: Record<string, unknown> | undefined;
805
+ } | undefined;
709
806
  }>;
710
807
  readonly putState: (name: string, body: StateDeclarationBody) => Promise<{
711
- name: string;
712
- description: string;
713
- schema: Record<string, unknown>;
714
- subject_kinds: string[];
715
808
  default_subject_kind: string;
809
+ description: string;
810
+ effective_schema: Record<string, unknown> | null;
811
+ name: string;
812
+ regimes: Record<string, unknown>[] | null;
716
813
  retention_days: number | null;
814
+ subject_kinds: string[];
815
+ updated_at: string | null;
717
816
  attachments: {
718
817
  template: string;
719
818
  path: string[];
720
819
  parameters: Record<string, unknown>;
721
820
  declarations: Record<string, unknown>;
722
821
  }[];
723
- effective_schema?: Record<string, unknown> | null | undefined;
724
- regimes?: Record<string, unknown>[] | null | undefined;
822
+ schema?: Record<string, unknown> | {
823
+ content?: string | undefined;
824
+ id?: string | undefined;
825
+ kwargs?: Record<string, unknown> | undefined;
826
+ } | undefined;
725
827
  }>;
726
828
  readonly deleteState: (name: string) => Promise<{
727
829
  name: string;
@@ -924,75 +1026,156 @@ export declare function createApiClient(config: ApiConfig): {
924
1026
  unavailable: string | null;
925
1027
  }[]>;
926
1028
  readonly listStateTemplates: (signal?: AbortSignal) => Promise<{
1029
+ declarations: {
1030
+ check: {
1031
+ content?: string | undefined;
1032
+ id?: string | undefined;
1033
+ kwargs?: Record<string, unknown> | undefined;
1034
+ } | null;
1035
+ schema: Record<string, unknown>;
1036
+ } | null;
1037
+ description: string;
927
1038
  kind: "state-template";
928
1039
  name: string;
929
- description: string;
930
1040
  parameters: Record<string, unknown>;
931
- schema: Record<string, unknown>;
1041
+ reconcile: {
1042
+ close: {
1043
+ content?: string | undefined;
1044
+ id?: string | undefined;
1045
+ kwargs?: Record<string, unknown> | undefined;
1046
+ };
1047
+ orphans: {
1048
+ content?: string | undefined;
1049
+ id?: string | undefined;
1050
+ kwargs?: Record<string, unknown> | undefined;
1051
+ };
1052
+ resolutions: {
1053
+ content?: string | undefined;
1054
+ id?: string | undefined;
1055
+ kwargs?: Record<string, unknown> | undefined;
1056
+ };
1057
+ } | null;
932
1058
  regimes: Record<string, unknown>[];
933
- declarations: Record<string, unknown> | null;
934
- trace: Record<string, unknown>;
935
1059
  template_jq: Record<string, {
936
1060
  description: string;
937
- purpose: "input" | "update";
1061
+ jq: {
1062
+ content?: string | undefined;
1063
+ id?: string | undefined;
1064
+ kwargs?: Record<string, unknown> | undefined;
1065
+ };
938
1066
  params: string[];
1067
+ purpose: "input" | "update";
939
1068
  reads: string[][];
940
1069
  writes: string[][];
941
- jq: string;
942
1070
  }> | null;
943
- reconcile: {
944
- view: string;
945
- close: string;
946
- resolutions: string;
947
- } | null;
1071
+ trace: Record<string, unknown>;
948
1072
  attached_to: number;
949
1073
  shipped_default: boolean;
1074
+ schema?: Record<string, unknown> | {
1075
+ content?: string | undefined;
1076
+ id?: string | undefined;
1077
+ kwargs?: Record<string, unknown> | undefined;
1078
+ } | undefined;
950
1079
  }[]>;
951
1080
  readonly getStateTemplate: (name: string, signal?: AbortSignal) => Promise<{
1081
+ declarations: {
1082
+ check: {
1083
+ content?: string | undefined;
1084
+ id?: string | undefined;
1085
+ kwargs?: Record<string, unknown> | undefined;
1086
+ } | null;
1087
+ schema: Record<string, unknown>;
1088
+ } | null;
1089
+ description: string;
952
1090
  kind: "state-template";
953
1091
  name: string;
954
- description: string;
955
1092
  parameters: Record<string, unknown>;
956
- schema: Record<string, unknown>;
1093
+ reconcile: {
1094
+ close: {
1095
+ content?: string | undefined;
1096
+ id?: string | undefined;
1097
+ kwargs?: Record<string, unknown> | undefined;
1098
+ };
1099
+ orphans: {
1100
+ content?: string | undefined;
1101
+ id?: string | undefined;
1102
+ kwargs?: Record<string, unknown> | undefined;
1103
+ };
1104
+ resolutions: {
1105
+ content?: string | undefined;
1106
+ id?: string | undefined;
1107
+ kwargs?: Record<string, unknown> | undefined;
1108
+ };
1109
+ } | null;
957
1110
  regimes: Record<string, unknown>[];
958
- declarations: Record<string, unknown> | null;
959
- trace: Record<string, unknown>;
960
1111
  template_jq: Record<string, {
961
1112
  description: string;
962
- purpose: "input" | "update";
1113
+ jq: {
1114
+ content?: string | undefined;
1115
+ id?: string | undefined;
1116
+ kwargs?: Record<string, unknown> | undefined;
1117
+ };
963
1118
  params: string[];
1119
+ purpose: "input" | "update";
964
1120
  reads: string[][];
965
1121
  writes: string[][];
966
- jq: string;
967
1122
  }> | null;
968
- reconcile: {
969
- view: string;
970
- close: string;
971
- resolutions: string;
972
- } | null;
1123
+ trace: Record<string, unknown>;
1124
+ schema?: Record<string, unknown> | {
1125
+ content?: string | undefined;
1126
+ id?: string | undefined;
1127
+ kwargs?: Record<string, unknown> | undefined;
1128
+ } | undefined;
973
1129
  }>;
974
1130
  readonly putStateTemplate: (name: string, body: StateTemplateBody, replace?: boolean) => Promise<{
1131
+ declarations: {
1132
+ check: {
1133
+ content?: string | undefined;
1134
+ id?: string | undefined;
1135
+ kwargs?: Record<string, unknown> | undefined;
1136
+ } | null;
1137
+ schema: Record<string, unknown>;
1138
+ } | null;
1139
+ description: string;
975
1140
  kind: "state-template";
976
1141
  name: string;
977
- description: string;
978
1142
  parameters: Record<string, unknown>;
979
- schema: Record<string, unknown>;
1143
+ reconcile: {
1144
+ close: {
1145
+ content?: string | undefined;
1146
+ id?: string | undefined;
1147
+ kwargs?: Record<string, unknown> | undefined;
1148
+ };
1149
+ orphans: {
1150
+ content?: string | undefined;
1151
+ id?: string | undefined;
1152
+ kwargs?: Record<string, unknown> | undefined;
1153
+ };
1154
+ resolutions: {
1155
+ content?: string | undefined;
1156
+ id?: string | undefined;
1157
+ kwargs?: Record<string, unknown> | undefined;
1158
+ };
1159
+ } | null;
980
1160
  regimes: Record<string, unknown>[];
981
- declarations: Record<string, unknown> | null;
982
- trace: Record<string, unknown>;
983
1161
  template_jq: Record<string, {
984
1162
  description: string;
985
- purpose: "input" | "update";
1163
+ jq: {
1164
+ content?: string | undefined;
1165
+ id?: string | undefined;
1166
+ kwargs?: Record<string, unknown> | undefined;
1167
+ };
986
1168
  params: string[];
1169
+ purpose: "input" | "update";
987
1170
  reads: string[][];
988
1171
  writes: string[][];
989
- jq: string;
990
1172
  }> | null;
991
- reconcile: {
992
- view: string;
993
- close: string;
994
- resolutions: string;
995
- } | null;
1173
+ trace: Record<string, unknown>;
1174
+ schema?: Record<string, unknown> | {
1175
+ content?: string | undefined;
1176
+ id?: string | undefined;
1177
+ kwargs?: Record<string, unknown> | undefined;
1178
+ } | undefined;
996
1179
  }>;
997
1180
  readonly deleteStateTemplate: (name: string) => Promise<{
998
1181
  name: string;
@@ -1172,11 +1355,7 @@ export declare function createApiClient(config: ApiConfig): {
1172
1355
  path: string;
1173
1356
  deleted: true;
1174
1357
  }>;
1175
- readonly renderTemplate: (body: {
1176
- content?: string;
1177
- template_id?: string;
1178
- kwargs?: Record<string, unknown>;
1179
- }) => Promise<{
1358
+ readonly renderTemplate: (text: s.TemplatedText) => Promise<{
1180
1359
  rendered: string;
1181
1360
  }>;
1182
1361
  readonly clearTemplatesCache: () => Promise<{
@@ -1677,7 +1856,7 @@ export declare function createApiClient(config: ApiConfig): {
1677
1856
  display_name: string;
1678
1857
  description: string;
1679
1858
  icon_url: string;
1680
- kind: "oauth" | "none";
1859
+ kind: "none" | "oauth";
1681
1860
  origin: "system" | "community";
1682
1861
  category: string;
1683
1862
  sub_services: {
@@ -1705,7 +1884,7 @@ export declare function createApiClient(config: ApiConfig): {
1705
1884
  connection_id: string;
1706
1885
  provider_id: string;
1707
1886
  alias: string;
1708
- kind: "oauth" | "none";
1887
+ kind: "none" | "oauth";
1709
1888
  account_identity: string | null;
1710
1889
  enabled_sub_services: string[];
1711
1890
  granted_scopes: string[];
@@ -1720,7 +1899,7 @@ export declare function createApiClient(config: ApiConfig): {
1720
1899
  connection_id: string;
1721
1900
  provider_id: string;
1722
1901
  alias: string;
1723
- kind: "oauth" | "none";
1902
+ kind: "none" | "oauth";
1724
1903
  account_identity: string | null;
1725
1904
  enabled_sub_services: string[];
1726
1905
  granted_scopes: string[];
@@ -1934,39 +2113,30 @@ export declare function createApiClient(config: ApiConfig): {
1934
2113
  }>;
1935
2114
  readonly listConversationRoutes: (signal?: AbortSignal) => Promise<{
1936
2115
  items: {
1937
- route_name: string;
1938
- door: "channel" | "api";
1939
- target_kind: "tool" | "agent";
1940
- target_name: string;
1941
- payload_expr: string | null;
1942
- reply_expr: string | null;
1943
- initial_mode: "agent" | "manual";
1944
- execution_key: string;
1945
- channel: string | null;
1946
- our_identity: string | null;
2116
+ callback_secret: string | null;
1947
2117
  callback_url: string | null;
1948
- turns_per_hour_override: number | null;
2118
+ channel: string | null;
2119
+ door: "channel" | "api";
1949
2120
  error_reply_text: string | null;
2121
+ execution_key: string;
1950
2122
  execution_key_fingerprint: string;
1951
- state_binding: {
1952
- states: {
1953
- state: string;
1954
- templates: string[];
1955
- subject_expr: string;
1956
- scope_expr: string | null;
1957
- input_injections: {
1958
- template_jq: string | null;
1959
- jq: string | null;
1960
- into: string;
1961
- }[];
1962
- updates: {
1963
- template_jq: string | null;
1964
- jq: string | null;
1965
- adapter: string | null;
1966
- op_id: string | null;
1967
- }[];
1968
- }[];
2123
+ initial_mode: "agent" | "manual";
2124
+ locale: string | null;
2125
+ our_identity: string | null;
2126
+ payload_expr: {
2127
+ content?: string | undefined;
2128
+ id?: string | undefined;
2129
+ kwargs?: Record<string, unknown> | undefined;
1969
2130
  } | null;
2131
+ reply_expr: {
2132
+ content?: string | undefined;
2133
+ id?: string | undefined;
2134
+ kwargs?: Record<string, unknown> | undefined;
2135
+ } | null;
2136
+ route_name: string;
2137
+ target_kind: "tool" | "agent";
2138
+ target_name: string;
2139
+ turns_per_hour_override: number | null;
1970
2140
  }[];
1971
2141
  total: number;
1972
2142
  }>;
@@ -1974,39 +2144,30 @@ export declare function createApiClient(config: ApiConfig): {
1974
2144
  created: boolean;
1975
2145
  route_name: string;
1976
2146
  route: {
1977
- route_name: string;
1978
- door: "channel" | "api";
1979
- target_kind: "tool" | "agent";
1980
- target_name: string;
1981
- payload_expr: string | null;
1982
- reply_expr: string | null;
1983
- initial_mode: "agent" | "manual";
1984
- execution_key: string;
1985
- channel: string | null;
1986
- our_identity: string | null;
2147
+ callback_secret: string | null;
1987
2148
  callback_url: string | null;
1988
- turns_per_hour_override: number | null;
2149
+ channel: string | null;
2150
+ door: "channel" | "api";
1989
2151
  error_reply_text: string | null;
2152
+ execution_key: string;
1990
2153
  execution_key_fingerprint: string;
1991
- state_binding: {
1992
- states: {
1993
- state: string;
1994
- templates: string[];
1995
- subject_expr: string;
1996
- scope_expr: string | null;
1997
- input_injections: {
1998
- template_jq: string | null;
1999
- jq: string | null;
2000
- into: string;
2001
- }[];
2002
- updates: {
2003
- template_jq: string | null;
2004
- jq: string | null;
2005
- adapter: string | null;
2006
- op_id: string | null;
2007
- }[];
2008
- }[];
2154
+ initial_mode: "agent" | "manual";
2155
+ locale: string | null;
2156
+ our_identity: string | null;
2157
+ payload_expr: {
2158
+ content?: string | undefined;
2159
+ id?: string | undefined;
2160
+ kwargs?: Record<string, unknown> | undefined;
2009
2161
  } | null;
2162
+ reply_expr: {
2163
+ content?: string | undefined;
2164
+ id?: string | undefined;
2165
+ kwargs?: Record<string, unknown> | undefined;
2166
+ } | null;
2167
+ route_name: string;
2168
+ target_kind: "tool" | "agent";
2169
+ target_name: string;
2170
+ turns_per_hour_override: number | null;
2010
2171
  };
2011
2172
  callback_secret: string | null;
2012
2173
  }>;
@@ -2101,28 +2262,157 @@ export declare function createApiClient(config: ApiConfig): {
2101
2262
  }>;
2102
2263
  readonly listConversationConfigs: (signal?: AbortSignal) => Promise<{
2103
2264
  items: {
2265
+ greeting_template: string | null;
2266
+ multichannel: boolean;
2267
+ state_binding: {
2268
+ states: {
2269
+ input_injections: {
2270
+ into: string;
2271
+ jq: {
2272
+ content?: string | undefined;
2273
+ id?: string | undefined;
2274
+ kwargs?: Record<string, unknown> | undefined;
2275
+ } | null;
2276
+ template_jq: string | null;
2277
+ }[];
2278
+ scope_expr: {
2279
+ content?: string | undefined;
2280
+ id?: string | undefined;
2281
+ kwargs?: Record<string, unknown> | undefined;
2282
+ } | null;
2283
+ state: string;
2284
+ subject_expr: {
2285
+ content?: string | undefined;
2286
+ id?: string | undefined;
2287
+ kwargs?: Record<string, unknown> | undefined;
2288
+ };
2289
+ templates: string[];
2290
+ updates: {
2291
+ adapter: {
2292
+ content?: string | undefined;
2293
+ id?: string | undefined;
2294
+ kwargs?: Record<string, unknown> | undefined;
2295
+ } | null;
2296
+ jq: {
2297
+ content?: string | undefined;
2298
+ id?: string | undefined;
2299
+ kwargs?: Record<string, unknown> | undefined;
2300
+ } | null;
2301
+ op_id: {
2302
+ content?: string | undefined;
2303
+ id?: string | undefined;
2304
+ kwargs?: Record<string, unknown> | undefined;
2305
+ } | null;
2306
+ template_jq: string | null;
2307
+ }[];
2308
+ }[];
2309
+ } | null;
2104
2310
  target_kind: "tool" | "agent";
2105
2311
  target_name: string;
2106
- multichannel: boolean;
2107
- greeting_template: string | null;
2108
2312
  }[];
2109
2313
  total: number;
2110
2314
  }>;
2111
2315
  readonly getConversationConfig: (targetKind: s.ConversationTargetKind, targetName: string, signal?: AbortSignal) => Promise<{
2316
+ greeting_template: string | null;
2317
+ multichannel: boolean;
2318
+ state_binding: {
2319
+ states: {
2320
+ input_injections: {
2321
+ into: string;
2322
+ jq: {
2323
+ content?: string | undefined;
2324
+ id?: string | undefined;
2325
+ kwargs?: Record<string, unknown> | undefined;
2326
+ } | null;
2327
+ template_jq: string | null;
2328
+ }[];
2329
+ scope_expr: {
2330
+ content?: string | undefined;
2331
+ id?: string | undefined;
2332
+ kwargs?: Record<string, unknown> | undefined;
2333
+ } | null;
2334
+ state: string;
2335
+ subject_expr: {
2336
+ content?: string | undefined;
2337
+ id?: string | undefined;
2338
+ kwargs?: Record<string, unknown> | undefined;
2339
+ };
2340
+ templates: string[];
2341
+ updates: {
2342
+ adapter: {
2343
+ content?: string | undefined;
2344
+ id?: string | undefined;
2345
+ kwargs?: Record<string, unknown> | undefined;
2346
+ } | null;
2347
+ jq: {
2348
+ content?: string | undefined;
2349
+ id?: string | undefined;
2350
+ kwargs?: Record<string, unknown> | undefined;
2351
+ } | null;
2352
+ op_id: {
2353
+ content?: string | undefined;
2354
+ id?: string | undefined;
2355
+ kwargs?: Record<string, unknown> | undefined;
2356
+ } | null;
2357
+ template_jq: string | null;
2358
+ }[];
2359
+ }[];
2360
+ } | null;
2112
2361
  target_kind: "tool" | "agent";
2113
2362
  target_name: string;
2114
- multichannel: boolean;
2115
- greeting_template: string | null;
2116
2363
  }>;
2117
2364
  readonly setConversationConfig: (config: s.TargetConversationConfig) => Promise<{
2118
2365
  created: boolean;
2119
2366
  target_kind: "tool" | "agent";
2120
2367
  target_name: string;
2121
2368
  config: {
2369
+ greeting_template: string | null;
2370
+ multichannel: boolean;
2371
+ state_binding: {
2372
+ states: {
2373
+ input_injections: {
2374
+ into: string;
2375
+ jq: {
2376
+ content?: string | undefined;
2377
+ id?: string | undefined;
2378
+ kwargs?: Record<string, unknown> | undefined;
2379
+ } | null;
2380
+ template_jq: string | null;
2381
+ }[];
2382
+ scope_expr: {
2383
+ content?: string | undefined;
2384
+ id?: string | undefined;
2385
+ kwargs?: Record<string, unknown> | undefined;
2386
+ } | null;
2387
+ state: string;
2388
+ subject_expr: {
2389
+ content?: string | undefined;
2390
+ id?: string | undefined;
2391
+ kwargs?: Record<string, unknown> | undefined;
2392
+ };
2393
+ templates: string[];
2394
+ updates: {
2395
+ adapter: {
2396
+ content?: string | undefined;
2397
+ id?: string | undefined;
2398
+ kwargs?: Record<string, unknown> | undefined;
2399
+ } | null;
2400
+ jq: {
2401
+ content?: string | undefined;
2402
+ id?: string | undefined;
2403
+ kwargs?: Record<string, unknown> | undefined;
2404
+ } | null;
2405
+ op_id: {
2406
+ content?: string | undefined;
2407
+ id?: string | undefined;
2408
+ kwargs?: Record<string, unknown> | undefined;
2409
+ } | null;
2410
+ template_jq: string | null;
2411
+ }[];
2412
+ }[];
2413
+ } | null;
2122
2414
  target_kind: "tool" | "agent";
2123
2415
  target_name: string;
2124
- multichannel: boolean;
2125
- greeting_template: string | null;
2126
2416
  };
2127
2417
  }>;
2128
2418
  readonly deleteConversationConfig: (targetKind: s.ConversationTargetKind, targetName: string) => Promise<{
@@ -2194,9 +2484,16 @@ export declare function createApiClient(config: ApiConfig): {
2194
2484
  audience?: string | null | undefined;
2195
2485
  media?: unknown[] | null | undefined;
2196
2486
  template?: {
2197
- name: string;
2487
+ body_parameters: string[];
2488
+ buttons: unknown[];
2489
+ header_media: {
2490
+ caption: string | null;
2491
+ filename: string | null;
2492
+ kind: "image" | "link" | "document" | "video" | "audio";
2493
+ url: string;
2494
+ } | null;
2198
2495
  language: string;
2199
- parameters: string[];
2496
+ name: string;
2200
2497
  } | null | undefined;
2201
2498
  options?: string[] | null | undefined;
2202
2499
  }[];
@@ -2225,42 +2522,75 @@ export declare function createApiClient(config: ApiConfig): {
2225
2522
  readonly streamAuthoredAgentRun: (name: string, input: unknown, signal?: AbortSignal) => Promise<AsyncGenerator<import("./agents").ParsedAgentEvent, any, any>>;
2226
2523
  readonly listHooks: (topic?: string, signal?: AbortSignal) => Promise<{
2227
2524
  items: {
2228
- name: string;
2229
- topic: string;
2230
- tool: string;
2525
+ condition: {
2526
+ content?: string | undefined;
2527
+ id?: string | undefined;
2528
+ kwargs?: Record<string, unknown> | undefined;
2529
+ } | null;
2231
2530
  execution_key: string;
2232
- tool_kwargs: Record<string, unknown>;
2233
- subject: {
2234
- target_kind: "tool" | "agent";
2235
- target_name: string;
2236
- kind: string;
2237
- key_expr: string;
2531
+ execution_key_fingerprint: string;
2532
+ expr: {
2533
+ content?: string | undefined;
2534
+ id?: string | undefined;
2535
+ kwargs?: Record<string, unknown> | undefined;
2238
2536
  } | null;
2239
- condition: string | null;
2240
- condition_id: string | null;
2241
- condition_kwargs: Record<string, unknown>;
2242
- expr: string | null;
2243
- expr_id: string | null;
2244
- expr_kwargs: Record<string, unknown>;
2537
+ name: string;
2245
2538
  state_binding: {
2246
2539
  states: {
2247
- state: string;
2248
- templates: string[];
2249
- subject_expr: string;
2250
- scope_expr: string | null;
2251
2540
  input_injections: {
2252
- template_jq: string | null;
2253
- jq: string | null;
2254
2541
  into: string;
2542
+ jq: {
2543
+ content?: string | undefined;
2544
+ id?: string | undefined;
2545
+ kwargs?: Record<string, unknown> | undefined;
2546
+ } | null;
2547
+ template_jq: string | null;
2255
2548
  }[];
2549
+ scope_expr: {
2550
+ content?: string | undefined;
2551
+ id?: string | undefined;
2552
+ kwargs?: Record<string, unknown> | undefined;
2553
+ } | null;
2554
+ state: string;
2555
+ subject_expr: {
2556
+ content?: string | undefined;
2557
+ id?: string | undefined;
2558
+ kwargs?: Record<string, unknown> | undefined;
2559
+ };
2560
+ templates: string[];
2256
2561
  updates: {
2562
+ adapter: {
2563
+ content?: string | undefined;
2564
+ id?: string | undefined;
2565
+ kwargs?: Record<string, unknown> | undefined;
2566
+ } | null;
2567
+ jq: {
2568
+ content?: string | undefined;
2569
+ id?: string | undefined;
2570
+ kwargs?: Record<string, unknown> | undefined;
2571
+ } | null;
2572
+ op_id: {
2573
+ content?: string | undefined;
2574
+ id?: string | undefined;
2575
+ kwargs?: Record<string, unknown> | undefined;
2576
+ } | null;
2257
2577
  template_jq: string | null;
2258
- jq: string | null;
2259
- adapter: string | null;
2260
- op_id: string | null;
2261
2578
  }[];
2262
2579
  }[];
2263
2580
  } | null;
2581
+ subject: {
2582
+ key_expr: {
2583
+ content?: string | undefined;
2584
+ id?: string | undefined;
2585
+ kwargs?: Record<string, unknown> | undefined;
2586
+ };
2587
+ kind: string;
2588
+ target_kind: "tool" | "agent";
2589
+ target_name: string;
2590
+ } | null;
2591
+ tool: string;
2592
+ tool_kwargs: Record<string, unknown>;
2593
+ topic: string;
2264
2594
  }[];
2265
2595
  total: number;
2266
2596
  topic_verifiers: Record<string, {
@@ -2269,7 +2599,7 @@ export declare function createApiClient(config: ApiConfig): {
2269
2599
  }>;
2270
2600
  trigger_auth: Record<string, "public" | "verifier" | "token" | "token+api_key" | "out-of-service">;
2271
2601
  }>;
2272
- readonly registerHook: (params: s.HookParams) => Promise<{
2602
+ readonly registerHook: (params: s.HookRegister) => Promise<{
2273
2603
  registered: boolean;
2274
2604
  name: string;
2275
2605
  }>;
@@ -2351,7 +2681,7 @@ export declare function createApiClient(config: ApiConfig): {
2351
2681
  mapped: string | null;
2352
2682
  tags: string[];
2353
2683
  summary: string;
2354
- action: "secret" | "read" | "write" | "fenced" | null;
2684
+ action: "read" | "write" | "secret" | "fenced" | null;
2355
2685
  }[]>;
2356
2686
  readonly listPublicRoutes: (signal?: AbortSignal) => Promise<string[]>;
2357
2687
  readonly pinRoutePublic: (body: PinRoutePublicBody) => Promise<{
@@ -2361,37 +2691,43 @@ export declare function createApiClient(config: ApiConfig): {
2361
2691
  url: string;
2362
2692
  }>;
2363
2693
  readonly listRoles: (signal?: AbortSignal) => Promise<{
2364
- name: string;
2365
- description: string;
2366
- scopes: string[];
2367
- condition: string | null;
2368
- condition_id: string | null;
2369
- condition_kwargs: unknown;
2370
- base_tier: string | null;
2371
2694
  allow_all: boolean;
2695
+ base_tier: string | null;
2696
+ condition: {
2697
+ content?: string | undefined;
2698
+ id?: string | undefined;
2699
+ kwargs?: Record<string, unknown> | undefined;
2700
+ } | null;
2701
+ description: string;
2372
2702
  grants: Record<string, "none" | "read" | "write">;
2373
- }[]>;
2374
- readonly createRole: (body: RoleCreateBody) => Promise<{
2375
2703
  name: string;
2376
- description: string;
2377
2704
  scopes: string[];
2378
- condition: string | null;
2379
- condition_id: string | null;
2380
- condition_kwargs: unknown;
2381
- base_tier: string | null;
2705
+ }[]>;
2706
+ readonly createRole: (body: RoleCreateBody) => Promise<{
2382
2707
  allow_all: boolean;
2708
+ base_tier: string | null;
2709
+ condition: {
2710
+ content?: string | undefined;
2711
+ id?: string | undefined;
2712
+ kwargs?: Record<string, unknown> | undefined;
2713
+ } | null;
2714
+ description: string;
2383
2715
  grants: Record<string, "none" | "read" | "write">;
2384
- }>;
2385
- readonly updateRole: (name: string, body: RoleUpdateBody) => Promise<{
2386
2716
  name: string;
2387
- description: string;
2388
2717
  scopes: string[];
2389
- condition: string | null;
2390
- condition_id: string | null;
2391
- condition_kwargs: unknown;
2392
- base_tier: string | null;
2718
+ }>;
2719
+ readonly updateRole: (name: string, body: RoleUpdateBody) => Promise<{
2393
2720
  allow_all: boolean;
2721
+ base_tier: string | null;
2722
+ condition: {
2723
+ content?: string | undefined;
2724
+ id?: string | undefined;
2725
+ kwargs?: Record<string, unknown> | undefined;
2726
+ } | null;
2727
+ description: string;
2394
2728
  grants: Record<string, "none" | "read" | "write">;
2729
+ name: string;
2730
+ scopes: string[];
2395
2731
  }>;
2396
2732
  readonly deleteRole: (name: string) => Promise<{
2397
2733
  name: string;
@@ -2401,15 +2737,17 @@ export declare function createApiClient(config: ApiConfig): {
2401
2737
  versions: {
2402
2738
  version: number;
2403
2739
  body: {
2404
- name: string;
2405
- description: string;
2406
- scopes: string[];
2407
- condition: string | null;
2408
- condition_id: string | null;
2409
- condition_kwargs: unknown;
2410
- base_tier: string | null;
2411
2740
  allow_all: boolean;
2741
+ base_tier: string | null;
2742
+ condition: {
2743
+ content?: string | undefined;
2744
+ id?: string | undefined;
2745
+ kwargs?: Record<string, unknown> | undefined;
2746
+ } | null;
2747
+ description: string;
2412
2748
  grants: Record<string, "none" | "read" | "write">;
2749
+ name: string;
2750
+ scopes: string[];
2413
2751
  };
2414
2752
  tags: string[];
2415
2753
  created_at: string;
@@ -2429,24 +2767,28 @@ export declare function createApiClient(config: ApiConfig): {
2429
2767
  }[];
2430
2768
  }>;
2431
2769
  readonly rollbackRole: (name: string, version: number) => Promise<{
2432
- name: string;
2433
- description: string;
2434
- scopes: string[];
2435
- condition: string | null;
2436
- condition_id: string | null;
2437
- condition_kwargs: unknown;
2438
- base_tier: string | null;
2439
2770
  allow_all: boolean;
2771
+ base_tier: string | null;
2772
+ condition: {
2773
+ content?: string | undefined;
2774
+ id?: string | undefined;
2775
+ kwargs?: Record<string, unknown> | undefined;
2776
+ } | null;
2777
+ description: string;
2440
2778
  grants: Record<string, "none" | "read" | "write">;
2779
+ name: string;
2780
+ scopes: string[];
2441
2781
  }>;
2442
2782
  readonly listTokensPayload: (signal?: AbortSignal) => Promise<{
2443
2783
  user_id: string;
2444
2784
  description: string;
2445
2785
  scopes: string[];
2446
2786
  policy_data: unknown;
2447
- condition?: string | null | undefined;
2448
- condition_id?: string | null | undefined;
2449
- condition_kwargs?: unknown;
2787
+ condition?: {
2788
+ content?: string | undefined;
2789
+ id?: string | undefined;
2790
+ kwargs?: Record<string, unknown> | undefined;
2791
+ } | null | undefined;
2450
2792
  }[]>;
2451
2793
  readonly createApiKey: (body: ApiKeyBody) => Promise<string>;
2452
2794
  readonly editApiKey: (userId: string, body: Omit<ApiKeyBody, "user_id">) => Promise<{
@@ -2539,11 +2881,13 @@ export declare function createApiClient(config: ApiConfig): {
2539
2881
  readonly listPolicyVersions: (userId: string, signal?: AbortSignal) => Promise<{
2540
2882
  version: number;
2541
2883
  body: {
2884
+ condition: {
2885
+ content?: string | undefined;
2886
+ id?: string | undefined;
2887
+ kwargs?: Record<string, unknown> | undefined;
2888
+ } | null;
2889
+ policy_data: Record<string, unknown>;
2542
2890
  scopes: string[];
2543
- policy_data: unknown;
2544
- condition: string | null;
2545
- condition_id: string | null;
2546
- condition_kwargs: unknown;
2547
2891
  };
2548
2892
  tags: string[];
2549
2893
  created_at: string;