@runtypelabs/sdk 10.8.0 → 10.9.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/index.d.ts CHANGED
@@ -1204,6 +1204,11 @@ interface paths {
1204
1204
  };
1205
1205
  };
1206
1206
  toolIds?: string[];
1207
+ toolSearch?: {
1208
+ alwaysLoaded?: string[];
1209
+ enabled?: boolean;
1210
+ threshold?: number;
1211
+ };
1207
1212
  };
1208
1213
  topK?: number;
1209
1214
  topP?: number;
@@ -1475,6 +1480,8 @@ interface paths {
1475
1480
  requestBody?: {
1476
1481
  content: {
1477
1482
  "application/json": {
1483
+ /** @description The complete set of capabilities (flow, sub-agent and saved-tool attachments) on this agent, in display order. Each entry names its source by name, so the declaration is portable across accounts. Capabilities on the agent but absent here are removed; omit the field to leave them untouched. When present, the capabilities are part of the content hash and of the version this converge snapshots. They are written to the agent itself, so they cannot accompany a non-live deploy. */
1484
+ capabilities?: components["schemas"]["AgentEnsureCapability"][];
1478
1485
  contentHash?: string;
1479
1486
  definition?: {
1480
1487
  config?: {
@@ -1725,6 +1732,11 @@ interface paths {
1725
1732
  };
1726
1733
  };
1727
1734
  toolIds?: string[];
1735
+ toolSearch?: {
1736
+ alwaysLoaded?: string[];
1737
+ enabled?: boolean;
1738
+ threshold?: number;
1739
+ };
1728
1740
  };
1729
1741
  topK?: number;
1730
1742
  topP?: number;
@@ -1780,6 +1792,8 @@ interface paths {
1780
1792
  * @enum {string}
1781
1793
  */
1782
1794
  release?: "none" | "publish";
1795
+ /** @description The complete set of skills bound to this agent, in load order. Each entry names a skill by slug; `version` pins that skill versionNumber, and omitting it follows the skill's published version. Skills bound to the agent but absent here are unbound; omit the field to leave bindings untouched. Bindings are agent state, not alias state, so they take effect immediately and cannot accompany a non-live deploy. */
1796
+ skills?: components["schemas"]["AgentEnsureSkillBinding"][];
1783
1797
  version?: components["schemas"]["EnsureVersionMetadata"];
1784
1798
  };
1785
1799
  };
@@ -2522,6 +2536,11 @@ interface paths {
2522
2536
  };
2523
2537
  };
2524
2538
  toolIds?: string[];
2539
+ toolSearch?: {
2540
+ alwaysLoaded?: string[];
2541
+ enabled?: boolean;
2542
+ threshold?: number;
2543
+ } | null;
2525
2544
  };
2526
2545
  topK?: number;
2527
2546
  topP?: number;
@@ -10529,6 +10548,8 @@ interface paths {
10529
10548
  icon: string | null;
10530
10549
  id: string;
10531
10550
  indexedFields: string[];
10551
+ /** @description Who last wrote the definition (e.g. dashboard, api, sdk); sdk/terraform mean managed in code. */
10552
+ lastModifiedSource: string | null;
10532
10553
  recordCount?: number;
10533
10554
  /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10534
10555
  schema: {
@@ -10627,6 +10648,8 @@ interface paths {
10627
10648
  icon: string | null;
10628
10649
  id: string;
10629
10650
  indexedFields: string[];
10651
+ /** @description Who last wrote the definition (e.g. dashboard, api, sdk); sdk/terraform mean managed in code. */
10652
+ lastModifiedSource: string | null;
10630
10653
  recordCount?: number;
10631
10654
  /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10632
10655
  schema: {
@@ -10697,55 +10720,74 @@ interface paths {
10697
10720
  patch?: never;
10698
10721
  trace?: never;
10699
10722
  };
10700
- "/v1/collections/types.d.ts": {
10723
+ "/v1/collections/ensure": {
10701
10724
  parameters: {
10702
10725
  query?: never;
10703
10726
  header?: never;
10704
10727
  path?: never;
10705
10728
  cookie?: never;
10706
10729
  };
10730
+ get?: never;
10731
+ put?: never;
10707
10732
  /**
10708
- * Generate TypeScript types for schematized collections
10709
- * @description Emit a TypeScript `.d.ts` module (one interface per schematized collection plus a `declare module '@runtypelabs/sdk'` augmentation of `RecordCollections`) so `client.records.from('<slug>')` types record metadata. Fetch it with `runtype records typegen`; commit and diff-check the output in CI to catch collection-schema drift.
10733
+ * Ensure collection (config-as-code converge)
10734
+ * @description Idempotently converge a repo-defined record collection (display fields, schema and validationMode) onto the platform. Identity is slug + account scope. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response); full requests create the collection or update it when the canonical content hash differs. Schema changes follow the same rules as PATCH: they bump schemaVersion and append history, and a breaking change is rejected while the resulting mode is `enforce`. Set dryRun to plan without writing (CI drift gate), and onConflict: "overwrite" to converge over dashboard/API edits. Ensure never deletes a collection and never touches records.
10710
10735
  */
10711
- get: {
10736
+ post: {
10712
10737
  parameters: {
10713
10738
  query?: never;
10714
10739
  header?: never;
10715
10740
  path?: never;
10716
10741
  cookie?: never;
10717
10742
  };
10718
- requestBody?: never;
10719
- responses: {
10720
- /** @description A TypeScript declaration module */
10721
- 200: {
10722
- headers: {
10723
- [name: string]: unknown;
10724
- };
10725
- content: {
10726
- "text/plain": string;
10743
+ requestBody?: {
10744
+ content: {
10745
+ "application/json": {
10746
+ contentHash?: string;
10747
+ definition?: {
10748
+ description?: string | null;
10749
+ displayName: string;
10750
+ icon?: string | null;
10751
+ /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10752
+ schema?: {
10753
+ [key: string]: unknown;
10754
+ } | null;
10755
+ slug: string;
10756
+ /** @enum {string} */
10757
+ validationMode?: "off" | "warn" | "enforce";
10758
+ };
10759
+ dryRun?: boolean;
10760
+ expectedRemoteHash?: string;
10761
+ /** @enum {string} */
10762
+ onConflict?: "error" | "overwrite";
10763
+ slug: string;
10727
10764
  };
10728
10765
  };
10729
- /** @description Unauthorized */
10730
- 401: {
10766
+ };
10767
+ responses: {
10768
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
10769
+ 200: {
10731
10770
  headers: {
10732
10771
  [name: string]: unknown;
10733
10772
  };
10734
10773
  content: {
10735
- "application/json": components["schemas"]["Error"];
10774
+ "application/json": components["schemas"]["CollectionEnsureResponse"];
10736
10775
  };
10737
10776
  };
10738
- /** @description Insufficient permissions */
10739
- 403: {
10777
+ /** @description Invalid slug or schema, or a breaking schema change while enforcing (BREAKING_SCHEMA_CHANGE_REQUIRES_WARN_MODE) */
10778
+ 400: {
10740
10779
  headers: {
10741
10780
  [name: string]: unknown;
10742
10781
  };
10743
10782
  content: {
10744
- "application/json": components["schemas"]["Error"];
10783
+ "application/json": components["schemas"]["Error"] & {
10784
+ code?: string;
10785
+ details?: unknown;
10786
+ };
10745
10787
  };
10746
10788
  };
10747
- /** @description Internal server error */
10748
- 500: {
10789
+ /** @description Unauthorized */
10790
+ 401: {
10749
10791
  headers: {
10750
10792
  [name: string]: unknown;
10751
10793
  };
@@ -10753,79 +10795,8 @@ interface paths {
10753
10795
  "application/json": components["schemas"]["Error"];
10754
10796
  };
10755
10797
  };
10756
- };
10757
- };
10758
- put?: never;
10759
- post?: never;
10760
- delete?: never;
10761
- options?: never;
10762
- head?: never;
10763
- patch?: never;
10764
- trace?: never;
10765
- };
10766
- "/v1/collections/{slug}": {
10767
- parameters: {
10768
- query?: never;
10769
- header?: never;
10770
- path?: never;
10771
- cookie?: never;
10772
- };
10773
- /**
10774
- * Get a collection
10775
- * @description Get a collection by slug. `includeHistory=true` embeds the append-only schema version history.
10776
- */
10777
- get: {
10778
- parameters: {
10779
- query?: {
10780
- includeHistory?: string;
10781
- };
10782
- header?: never;
10783
- path: {
10784
- slug: string;
10785
- };
10786
- cookie?: never;
10787
- };
10788
- requestBody?: never;
10789
- responses: {
10790
- /** @description Collection */
10791
- 200: {
10792
- headers: {
10793
- [name: string]: unknown;
10794
- };
10795
- content: {
10796
- "application/json": {
10797
- createdAt: string;
10798
- description: string | null;
10799
- displayName: string;
10800
- history?: {
10801
- /** @enum {string} */
10802
- changeKind: "additive" | "breaking";
10803
- changedBy: string | null;
10804
- createdAt: string;
10805
- /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10806
- schema: {
10807
- [key: string]: unknown;
10808
- } | null;
10809
- version: number;
10810
- }[];
10811
- icon: string | null;
10812
- id: string;
10813
- indexedFields: string[];
10814
- recordCount?: number;
10815
- /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10816
- schema: {
10817
- [key: string]: unknown;
10818
- } | null;
10819
- schemaVersion: number;
10820
- slug: string;
10821
- updatedAt: string;
10822
- /** @enum {string} */
10823
- validationMode: "off" | "warn" | "enforce";
10824
- };
10825
- };
10826
- };
10827
- /** @description Unauthorized */
10828
- 401: {
10798
+ /** @description Insufficient permissions */
10799
+ 403: {
10829
10800
  headers: {
10830
10801
  [name: string]: unknown;
10831
10802
  };
@@ -10833,22 +10804,22 @@ interface paths {
10833
10804
  "application/json": components["schemas"]["Error"];
10834
10805
  };
10835
10806
  };
10836
- /** @description Insufficient permissions */
10837
- 403: {
10807
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
10808
+ 409: {
10838
10809
  headers: {
10839
10810
  [name: string]: unknown;
10840
10811
  };
10841
10812
  content: {
10842
- "application/json": components["schemas"]["Error"];
10813
+ "application/json": components["schemas"]["CollectionEnsureConflict"];
10843
10814
  };
10844
10815
  };
10845
- /** @description Not found */
10846
- 404: {
10816
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
10817
+ 422: {
10847
10818
  headers: {
10848
10819
  [name: string]: unknown;
10849
10820
  };
10850
10821
  content: {
10851
- "application/json": components["schemas"]["Error"];
10822
+ "application/json": components["schemas"]["CollectionEnsureHashMismatch"];
10852
10823
  };
10853
10824
  };
10854
10825
  /** @description Internal server error */
@@ -10862,32 +10833,39 @@ interface paths {
10862
10833
  };
10863
10834
  };
10864
10835
  };
10865
- put?: never;
10866
- post?: never;
10836
+ delete?: never;
10837
+ options?: never;
10838
+ head?: never;
10839
+ patch?: never;
10840
+ trace?: never;
10841
+ };
10842
+ "/v1/collections/types.d.ts": {
10843
+ parameters: {
10844
+ query?: never;
10845
+ header?: never;
10846
+ path?: never;
10847
+ cookie?: never;
10848
+ };
10867
10849
  /**
10868
- * Delete a collection
10869
- * @description Delete the collection REGISTRATION only. Records of this type are not touched — they revert to schemaless behavior. Deleting records is a separate, explicit operation.
10850
+ * Generate TypeScript types for schematized collections
10851
+ * @description Emit a TypeScript `.d.ts` module (one interface per schematized collection plus a `declare module '@runtypelabs/sdk'` augmentation of `RecordCollections`) so `client.records.from('<slug>')` types record metadata. Fetch it with `runtype records typegen`; commit and diff-check the output in CI to catch collection-schema drift.
10870
10852
  */
10871
- delete: {
10853
+ get: {
10872
10854
  parameters: {
10873
10855
  query?: never;
10874
10856
  header?: never;
10875
- path: {
10876
- slug: string;
10877
- };
10857
+ path?: never;
10878
10858
  cookie?: never;
10879
10859
  };
10880
10860
  requestBody?: never;
10881
10861
  responses: {
10882
- /** @description Deleted */
10862
+ /** @description A TypeScript declaration module */
10883
10863
  200: {
10884
10864
  headers: {
10885
10865
  [name: string]: unknown;
10886
10866
  };
10887
10867
  content: {
10888
- "application/json": {
10889
- success: boolean;
10890
- };
10868
+ "text/plain": string;
10891
10869
  };
10892
10870
  };
10893
10871
  /** @description Unauthorized */
@@ -10908,15 +10886,6 @@ interface paths {
10908
10886
  "application/json": components["schemas"]["Error"];
10909
10887
  };
10910
10888
  };
10911
- /** @description Not found */
10912
- 404: {
10913
- headers: {
10914
- [name: string]: unknown;
10915
- };
10916
- content: {
10917
- "application/json": components["schemas"]["Error"];
10918
- };
10919
- };
10920
10889
  /** @description Internal server error */
10921
10890
  500: {
10922
10891
  headers: {
@@ -10928,84 +10897,261 @@ interface paths {
10928
10897
  };
10929
10898
  };
10930
10899
  };
10900
+ put?: never;
10901
+ post?: never;
10902
+ delete?: never;
10931
10903
  options?: never;
10932
10904
  head?: never;
10905
+ patch?: never;
10906
+ trace?: never;
10907
+ };
10908
+ "/v1/collections/{slug}": {
10909
+ parameters: {
10910
+ query?: never;
10911
+ header?: never;
10912
+ path?: never;
10913
+ cookie?: never;
10914
+ };
10933
10915
  /**
10934
- * Update a collection
10935
- * @description Update display fields, validation mode, or the schema. Schema changes are classified additive vs breaking; breaking changes are rejected while the resulting mode is `enforce` (drop to `warn`, migrate, re-enforce). Every schema change bumps `schemaVersion` and appends a history row. When the mode transitions to `enforce`, the response includes `enforceCheck` — a bounded dry-run of existing records against the schema.
10916
+ * Get a collection
10917
+ * @description Get a collection by slug. `includeHistory=true` embeds the append-only schema version history.
10936
10918
  */
10937
- patch: {
10919
+ get: {
10938
10920
  parameters: {
10939
- query?: never;
10921
+ query?: {
10922
+ includeHistory?: string;
10923
+ };
10940
10924
  header?: never;
10941
10925
  path: {
10942
10926
  slug: string;
10943
10927
  };
10944
10928
  cookie?: never;
10945
10929
  };
10946
- requestBody?: {
10947
- content: {
10948
- "application/json": {
10949
- description?: string | null;
10950
- displayName?: string;
10951
- icon?: string | null;
10952
- /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10953
- schema?: {
10954
- [key: string]: unknown;
10955
- } | null;
10956
- slug?: string;
10957
- /** @enum {string} */
10958
- validationMode?: "off" | "warn" | "enforce";
10959
- };
10960
- };
10961
- };
10930
+ requestBody?: never;
10962
10931
  responses: {
10963
- /** @description Updated collection */
10932
+ /** @description Collection */
10964
10933
  200: {
10965
10934
  headers: {
10966
10935
  [name: string]: unknown;
10967
10936
  };
10968
10937
  content: {
10969
10938
  "application/json": {
10970
- collection: {
10939
+ createdAt: string;
10940
+ description: string | null;
10941
+ displayName: string;
10942
+ history?: {
10943
+ /** @enum {string} */
10944
+ changeKind: "additive" | "breaking";
10945
+ changedBy: string | null;
10971
10946
  createdAt: string;
10972
- description: string | null;
10973
- displayName: string;
10974
- icon: string | null;
10975
- id: string;
10976
- indexedFields: string[];
10977
- recordCount?: number;
10978
10947
  /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10979
10948
  schema: {
10980
10949
  [key: string]: unknown;
10981
10950
  } | null;
10982
- schemaVersion: number;
10983
- slug: string;
10984
- updatedAt: string;
10985
- /** @enum {string} */
10986
- validationMode: "off" | "warn" | "enforce";
10987
- };
10988
- enforceCheck?: {
10989
- checked: number;
10990
- failed: number;
10991
- truncated: boolean;
10992
- };
10993
- schemaChange?: {
10994
- breakingChanges: string[];
10995
- /** @enum {string} */
10996
- kind: "additive" | "breaking";
10997
- };
10998
- };
10999
- };
11000
- };
11001
- /** @description Invalid input, immutable slug (SLUG_IMMUTABLE), or breaking change while enforcing (BREAKING_SCHEMA_CHANGE_REQUIRES_WARN_MODE) */
11002
- 400: {
11003
- headers: {
11004
- [name: string]: unknown;
11005
- };
11006
- content: {
11007
- "application/json": components["schemas"]["Error"] & {
11008
- code?: string;
10951
+ version: number;
10952
+ }[];
10953
+ icon: string | null;
10954
+ id: string;
10955
+ indexedFields: string[];
10956
+ /** @description Who last wrote the definition (e.g. dashboard, api, sdk); sdk/terraform mean managed in code. */
10957
+ lastModifiedSource: string | null;
10958
+ recordCount?: number;
10959
+ /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
10960
+ schema: {
10961
+ [key: string]: unknown;
10962
+ } | null;
10963
+ schemaVersion: number;
10964
+ slug: string;
10965
+ updatedAt: string;
10966
+ /** @enum {string} */
10967
+ validationMode: "off" | "warn" | "enforce";
10968
+ };
10969
+ };
10970
+ };
10971
+ /** @description Unauthorized */
10972
+ 401: {
10973
+ headers: {
10974
+ [name: string]: unknown;
10975
+ };
10976
+ content: {
10977
+ "application/json": components["schemas"]["Error"];
10978
+ };
10979
+ };
10980
+ /** @description Insufficient permissions */
10981
+ 403: {
10982
+ headers: {
10983
+ [name: string]: unknown;
10984
+ };
10985
+ content: {
10986
+ "application/json": components["schemas"]["Error"];
10987
+ };
10988
+ };
10989
+ /** @description Not found */
10990
+ 404: {
10991
+ headers: {
10992
+ [name: string]: unknown;
10993
+ };
10994
+ content: {
10995
+ "application/json": components["schemas"]["Error"];
10996
+ };
10997
+ };
10998
+ /** @description Internal server error */
10999
+ 500: {
11000
+ headers: {
11001
+ [name: string]: unknown;
11002
+ };
11003
+ content: {
11004
+ "application/json": components["schemas"]["Error"];
11005
+ };
11006
+ };
11007
+ };
11008
+ };
11009
+ put?: never;
11010
+ post?: never;
11011
+ /**
11012
+ * Delete a collection
11013
+ * @description Delete the collection REGISTRATION only. Records of this type are not touched — they revert to schemaless behavior. Deleting records is a separate, explicit operation.
11014
+ */
11015
+ delete: {
11016
+ parameters: {
11017
+ query?: never;
11018
+ header?: never;
11019
+ path: {
11020
+ slug: string;
11021
+ };
11022
+ cookie?: never;
11023
+ };
11024
+ requestBody?: never;
11025
+ responses: {
11026
+ /** @description Deleted */
11027
+ 200: {
11028
+ headers: {
11029
+ [name: string]: unknown;
11030
+ };
11031
+ content: {
11032
+ "application/json": {
11033
+ success: boolean;
11034
+ };
11035
+ };
11036
+ };
11037
+ /** @description Unauthorized */
11038
+ 401: {
11039
+ headers: {
11040
+ [name: string]: unknown;
11041
+ };
11042
+ content: {
11043
+ "application/json": components["schemas"]["Error"];
11044
+ };
11045
+ };
11046
+ /** @description Insufficient permissions */
11047
+ 403: {
11048
+ headers: {
11049
+ [name: string]: unknown;
11050
+ };
11051
+ content: {
11052
+ "application/json": components["schemas"]["Error"];
11053
+ };
11054
+ };
11055
+ /** @description Not found */
11056
+ 404: {
11057
+ headers: {
11058
+ [name: string]: unknown;
11059
+ };
11060
+ content: {
11061
+ "application/json": components["schemas"]["Error"];
11062
+ };
11063
+ };
11064
+ /** @description Internal server error */
11065
+ 500: {
11066
+ headers: {
11067
+ [name: string]: unknown;
11068
+ };
11069
+ content: {
11070
+ "application/json": components["schemas"]["Error"];
11071
+ };
11072
+ };
11073
+ };
11074
+ };
11075
+ options?: never;
11076
+ head?: never;
11077
+ /**
11078
+ * Update a collection
11079
+ * @description Update display fields, validation mode, or the schema. Schema changes are classified additive vs breaking; breaking changes are rejected while the resulting mode is `enforce` (drop to `warn`, migrate, re-enforce). Every schema change bumps `schemaVersion` and appends a history row. When the mode transitions to `enforce`, the response includes `enforceCheck` — a bounded dry-run of existing records against the schema.
11080
+ */
11081
+ patch: {
11082
+ parameters: {
11083
+ query?: never;
11084
+ header?: never;
11085
+ path: {
11086
+ slug: string;
11087
+ };
11088
+ cookie?: never;
11089
+ };
11090
+ requestBody?: {
11091
+ content: {
11092
+ "application/json": {
11093
+ description?: string | null;
11094
+ displayName?: string;
11095
+ icon?: string | null;
11096
+ /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
11097
+ schema?: {
11098
+ [key: string]: unknown;
11099
+ } | null;
11100
+ slug?: string;
11101
+ /** @enum {string} */
11102
+ validationMode?: "off" | "warn" | "enforce";
11103
+ };
11104
+ };
11105
+ };
11106
+ responses: {
11107
+ /** @description Updated collection */
11108
+ 200: {
11109
+ headers: {
11110
+ [name: string]: unknown;
11111
+ };
11112
+ content: {
11113
+ "application/json": {
11114
+ collection: {
11115
+ createdAt: string;
11116
+ description: string | null;
11117
+ displayName: string;
11118
+ icon: string | null;
11119
+ id: string;
11120
+ indexedFields: string[];
11121
+ /** @description Who last wrote the definition (e.g. dashboard, api, sdk); sdk/terraform mean managed in code. */
11122
+ lastModifiedSource: string | null;
11123
+ recordCount?: number;
11124
+ /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
11125
+ schema: {
11126
+ [key: string]: unknown;
11127
+ } | null;
11128
+ schemaVersion: number;
11129
+ slug: string;
11130
+ updatedAt: string;
11131
+ /** @enum {string} */
11132
+ validationMode: "off" | "warn" | "enforce";
11133
+ };
11134
+ enforceCheck?: {
11135
+ checked: number;
11136
+ failed: number;
11137
+ truncated: boolean;
11138
+ };
11139
+ schemaChange?: {
11140
+ breakingChanges: string[];
11141
+ /** @enum {string} */
11142
+ kind: "additive" | "breaking";
11143
+ };
11144
+ };
11145
+ };
11146
+ };
11147
+ /** @description Invalid input, immutable slug (SLUG_IMMUTABLE), or breaking change while enforcing (BREAKING_SCHEMA_CHANGE_REQUIRES_WARN_MODE) */
11148
+ 400: {
11149
+ headers: {
11150
+ [name: string]: unknown;
11151
+ };
11152
+ content: {
11153
+ "application/json": components["schemas"]["Error"] & {
11154
+ code?: string;
11009
11155
  };
11010
11156
  };
11011
11157
  };
@@ -11143,6 +11289,83 @@ interface paths {
11143
11289
  patch?: never;
11144
11290
  trace?: never;
11145
11291
  };
11292
+ "/v1/collections/{slug}/pull": {
11293
+ parameters: {
11294
+ query?: never;
11295
+ header?: never;
11296
+ path?: never;
11297
+ cookie?: never;
11298
+ };
11299
+ /**
11300
+ * Pull collection definition (config-as-code)
11301
+ * @description Return the canonical config-as-code definition and provenance for a collection — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live collection, so it is accurate even immediately after a dashboard edit.
11302
+ */
11303
+ get: {
11304
+ parameters: {
11305
+ query?: never;
11306
+ header?: never;
11307
+ path: {
11308
+ slug: string;
11309
+ };
11310
+ cookie?: never;
11311
+ };
11312
+ requestBody?: never;
11313
+ responses: {
11314
+ /** @description Canonical definition + provenance */
11315
+ 200: {
11316
+ headers: {
11317
+ [name: string]: unknown;
11318
+ };
11319
+ content: {
11320
+ "application/json": components["schemas"]["CollectionPullResponse"];
11321
+ };
11322
+ };
11323
+ /** @description Unauthorized */
11324
+ 401: {
11325
+ headers: {
11326
+ [name: string]: unknown;
11327
+ };
11328
+ content: {
11329
+ "application/json": components["schemas"]["Error"];
11330
+ };
11331
+ };
11332
+ /** @description Insufficient permissions */
11333
+ 403: {
11334
+ headers: {
11335
+ [name: string]: unknown;
11336
+ };
11337
+ content: {
11338
+ "application/json": components["schemas"]["Error"];
11339
+ };
11340
+ };
11341
+ /** @description No collection with that slug in the account scope */
11342
+ 404: {
11343
+ headers: {
11344
+ [name: string]: unknown;
11345
+ };
11346
+ content: {
11347
+ "application/json": components["schemas"]["Error"];
11348
+ };
11349
+ };
11350
+ /** @description Internal server error */
11351
+ 500: {
11352
+ headers: {
11353
+ [name: string]: unknown;
11354
+ };
11355
+ content: {
11356
+ "application/json": components["schemas"]["Error"];
11357
+ };
11358
+ };
11359
+ };
11360
+ };
11361
+ put?: never;
11362
+ post?: never;
11363
+ delete?: never;
11364
+ options?: never;
11365
+ head?: never;
11366
+ patch?: never;
11367
+ trace?: never;
11368
+ };
11146
11369
  "/v1/collections/{slug}/validate-existing": {
11147
11370
  parameters: {
11148
11371
  query?: never;
@@ -15791,7 +16014,7 @@ interface paths {
15791
16014
  put?: never;
15792
16015
  /**
15793
16016
  * Ensure eval suite (config-as-code converge)
15794
- * @description Idempotently converge a repo-defined eval suite (target + cases + graders) onto the platform. Identity is the suite name + account scope; the target flow/agent is resolved by name. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the suite or replace its cases when the canonical content hash differs. Non-executing: never runs the eval. The response always carries the server-computed canonical hash.
16017
+ * @description Idempotently converge a repo-defined eval suite (target + cases + graders) onto the platform. Identity is the suite name + account scope; the target flow/agent is resolved by name. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the suite or replace the cases ensure owns when the canonical content hash differs. Cases saved from runs, added in the dashboard, or owned by a product are never replaced. Set dryRun to plan without writing (CI drift gate), and onConflict: "overwrite" to converge over dashboard/API edits. Non-executing: never runs the eval. The response always carries the server-computed canonical hash.
15795
16018
  */
15796
16019
  post: {
15797
16020
  parameters: {
@@ -15855,12 +16078,16 @@ interface paths {
15855
16078
  };
15856
16079
  virtual?: boolean;
15857
16080
  };
16081
+ dryRun?: boolean;
16082
+ expectedRemoteHash?: string;
15858
16083
  name: string;
16084
+ /** @enum {string} */
16085
+ onConflict?: "error" | "overwrite";
15859
16086
  };
15860
16087
  };
15861
16088
  };
15862
16089
  responses: {
15863
- /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) */
16090
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
15864
16091
  200: {
15865
16092
  headers: {
15866
16093
  [name: string]: unknown;
@@ -15896,6 +16123,15 @@ interface paths {
15896
16123
  "application/json": components["schemas"]["Error"];
15897
16124
  };
15898
16125
  };
16126
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
16127
+ 409: {
16128
+ headers: {
16129
+ [name: string]: unknown;
16130
+ };
16131
+ content: {
16132
+ "application/json": components["schemas"]["EvalEnsureConflict"];
16133
+ };
16134
+ };
15899
16135
  /** @description Submitted contentHash does not match the server-recomputed canonical hash */
15900
16136
  422: {
15901
16137
  headers: {
@@ -16180,7 +16416,7 @@ interface paths {
16180
16416
  };
16181
16417
  /**
16182
16418
  * Pull eval suite definition (config-as-code)
16183
- * @description Return the canonical config-as-code definition and provenance for an eval suite by name — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live suite state.
16419
+ * @description Return the canonical config-as-code definition and provenance for an eval suite by name — the absorb-drift direction of the ensure protocol. The definition carries the cases ensure owns (or, for a suite ensure never wrote, its unowned cases), and the contentHash is recomputed from that live state.
16184
16420
  */
16185
16421
  get: {
16186
16422
  parameters: {
@@ -16920,7 +17156,7 @@ interface paths {
16920
17156
  name: string;
16921
17157
  notes?: string;
16922
17158
  /**
16923
- * @description Case provenance. Defaults to "manual" when omitted.
17159
+ * @description Case provenance. Defaults to "manual" when omitted. "ensure" is reserved for config-as-code converges.
16924
17160
  * @enum {string}
16925
17161
  */
16926
17162
  origin?: "manual" | "saved_from_run" | "generated" | "imported" | "fpo";
@@ -17326,7 +17562,7 @@ interface paths {
17326
17562
  name: string;
17327
17563
  notes?: string;
17328
17564
  /**
17329
- * @description Case provenance. Defaults to "manual" when omitted.
17565
+ * @description Case provenance. Defaults to "manual" when omitted. "ensure" is reserved for config-as-code converges.
17330
17566
  * @enum {string}
17331
17567
  */
17332
17568
  origin?: "manual" | "saved_from_run" | "generated" | "imported" | "fpo";
@@ -18833,6 +19069,10 @@ interface paths {
18833
19069
  executionLane?: "durable" | "in_process";
18834
19070
  httpStatus?: number;
18835
19071
  result?: unknown;
19072
+ /** @description Present and `true` when the execution settled but its result was too large to store or could not be retrieved; `result` then holds only a summary and `resultUnavailableReason` explains why. `error` keeps describing an execution failure; on an otherwise completed execution it repeats the reason. */
19073
+ resultUnavailable?: boolean;
19074
+ /** @description Why the result is unavailable. Present exactly when `resultUnavailable` is `true`. */
19075
+ resultUnavailableReason?: string;
18836
19076
  /** @enum {string} */
18837
19077
  status: "queued" | "running" | "paused" | "completed" | "failed" | "cancelled";
18838
19078
  targetId?: string;
@@ -28736,7 +28976,7 @@ interface paths {
28736
28976
  /** @enum {string} */
28737
28977
  executorProvider?: "openai" | "anthropic" | "google" | "xai" | "vertex" | "vertex-anthropic" | "bedrock" | "tinfoil" | "vercel" | "generic-openai";
28738
28978
  inputCostPer1kTokens: number;
28739
- /** @default 4096 */
28979
+ /** @default 32768 */
28740
28980
  maxOutputTokens?: number;
28741
28981
  /**
28742
28982
  * @description Where a system message that follows a conversation turn lands on this endpoint. Omitted keeps it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); "hoist" folds it for any endpoint whose chat template rejects a non-leading system role.
@@ -29407,7 +29647,7 @@ interface paths {
29407
29647
  /** @enum {string} */
29408
29648
  executorProvider?: "openai" | "anthropic" | "google" | "xai" | "vertex" | "vertex-anthropic" | "bedrock" | "tinfoil" | "vercel" | "generic-openai";
29409
29649
  inputCostPer1kTokens: number;
29410
- /** @default 4096 */
29650
+ /** @default 32768 */
29411
29651
  maxOutputTokens?: number;
29412
29652
  /**
29413
29653
  * @description Where a system message that follows a conversation turn lands on this endpoint. Omitted keeps it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); "hoist" folds it for any endpoint whose chat template rejects a non-leading system role.
@@ -30692,6 +30932,7 @@ interface paths {
30692
30932
  productGoal?: string;
30693
30933
  /** @enum {string} */
30694
30934
  productStage?: "idea" | "prototype" | "beta" | "production" | "scaling";
30935
+ stack?: components["schemas"]["ProductStack"];
30695
30936
  targetAudience?: string;
30696
30937
  techStack?: {
30697
30938
  backend?: string[];
@@ -30793,7 +31034,7 @@ interface paths {
30793
31034
  put?: never;
30794
31035
  /**
30795
31036
  * Ensure full product (config-as-code converge of the whole FPO)
30796
- * @description Idempotently converge an entire Full Product Object (the nested product graph) in one shot. Fans out to the per-entity ensure services in dependency order (product → capability backing flows/agents → capability-as-tool composition → capability links → surfaces + surface items → records → schedules → secret bindings), returning a per-entity report. Identity is the product name + account scope. NON-atomic by design: a per-entity failure is reported in `entities[].result = "failed"` (and `hasFailures`) and a re-run self-heals; only a top-level product reject aborts. Set dryRun to plan without writing. Set prune to remove product-scoped capabilities/surfaces (and their items) absent from the FPO (account-scoped flows/agents/tools/records are never removed). Whole-FPO fast-probe is not yet supported (PR3). API keys converge each nested flow, agent, schedule, record, eval suite and skill only with that entity kind's own write scope (FLOWS:WRITE, AGENTS:WRITE or AGENTS:CREATE/UPDATE, SCHEDULES:WRITE, RECORDS:WRITE, EVALS:WRITE, SKILLS:WRITE) on top of the product scope; otherwise that entity reports `failed`. Binding a skill to an agent also needs agent update scope. Schedules also honor the plan's active-schedule limit and minimum frequency.
31037
+ * @description Idempotently converge an entire Full Product Object (the nested product graph) in one shot. Fans out to the per-entity ensure services in dependency order (product → capability backing flows/agents → capability-as-tool composition → capability links → surfaces + surface items → records → schedules → secret bindings), returning a per-entity report. Identity is the product name + account scope. NON-atomic by design: a per-entity failure is reported in `entities[].result = "failed"` (and `hasFailures`) and a re-run self-heals; only a top-level product reject aborts. Converged capability agents and flows are published to `live` by default; set release to "none" to save changes as drafts. Set dryRun to plan without writing. Set prune to remove product-scoped capabilities/surfaces (and their items) absent from the FPO (account-scoped flows/agents/tools/records are never removed). A hash-only probe (`name` + `contentHash`, no fpo) with release "none" answers `unchanged` when the live graph reconstructs (as GET /products/pull-fpo does) to that hash, else `definitionRequired` (retry with the full fpo); a probe that publishes (the default release) always answers `definitionRequired`, because only a full converge can publish drafts that are not yet live. The probe, the dryRun `remoteHash` and expectedRemoteHash read the live graph, so API keys need PRODUCTS:READ for them. A dryRun reports the live graph's `remoteHash`; pass it as expectedRemoteHash on the apply to refuse the write (409 remote_changed) if the product changed in between. The guard compares what GET /products/pull-fpo reconstructs, so edits to seed records, schedules or secrets (which pull-fpo omits) do not trip it. When pull-fpo has to omit part of the product (a capability, surface, schedule, eval suite or skill it cannot represent), a probe answers `definitionRequired`, a dryRun reports no `remoteHash`, and expectedRemoteHash is refused with 409. The guard is re-checked immediately before the first write but does not lock the graph, so an edit that lands while the apply is running can still be overwritten. API keys need PRODUCTS:CREATE to create the product and PRODUCTS:UPDATE to change an existing one (PRODUCTS:WRITE covers both). API keys converge each nested flow, agent, tool, surface, schedule, record, eval suite and skill only with that entity kind's own write scope (FLOWS:WRITE, AGENTS:WRITE or AGENTS:CREATE/UPDATE, TOOLS:WRITE, PRODUCTS:SURFACES:WRITE, SCHEDULES:WRITE, RECORDS:WRITE, EVALS:WRITE, SKILLS:WRITE) on top of the product scope; otherwise that entity reports `failed`. Adding or changing a capability on an existing product needs PRODUCTS:CAPABILITIES:WRITE, and adding a route to an existing surface needs PRODUCTS:SURFACES:WRITE. Prune needs PRODUCTS:CAPABILITIES:WRITE to remove capabilities and PRODUCTS:SURFACES:WRITE to remove surfaces or their items, and a pruned surface's client tokens are revoked. Binding a skill to an agent also needs agent update scope. Schedules also honor the plan's active-schedule limit and minimum frequency.
30797
31038
  */
30798
31039
  post: {
30799
31040
  parameters: {
@@ -30805,12 +31046,18 @@ interface paths {
30805
31046
  requestBody?: {
30806
31047
  content: {
30807
31048
  "application/json": {
31049
+ /** @description Hash-only probe: the canonical FPO hash the caller holds. Answers `unchanged` when the live graph reconstructs (as pull-fpo does) to this hash, else `definitionRequired`. Only valid without `fpo`. */
31050
+ contentHash?: string;
30808
31051
  /** @description Plan without writing — returns a per-entity plan (CI drift gate). */
30809
31052
  dryRun?: boolean;
30810
- /** @description A complete Full Product Object (FPO): the nested product graph (product, capabilities, tools, surfaces, ...). Validated server-side via the shared FPO validator. */
30811
- fpo: {
31053
+ /** @description TOCTOU guard binding a dry run to its apply: the write proceeds only while the live graph still hashes to this value (the dry run's `remoteHash`); otherwise 409 remote_changed. */
31054
+ expectedRemoteHash?: string;
31055
+ /** @description A complete Full Product Object (FPO): the nested product graph (product, capabilities, tools, surfaces, ...). Validated server-side via the shared FPO validator. Omit it only for a hash-only probe (`name` + `contentHash`). */
31056
+ fpo?: {
30812
31057
  [key: string]: unknown;
30813
31058
  };
31059
+ /** @description The product name a hash-only probe resolves. Only valid without `fpo`. */
31060
+ name?: string;
30814
31061
  /**
30815
31062
  * @description Per nested entity: "overwrite" converges over dashboard/API edits.
30816
31063
  * @enum {string}
@@ -30818,11 +31065,16 @@ interface paths {
30818
31065
  onConflict?: "error" | "overwrite";
30819
31066
  /** @description Opt-in removal of product-scoped capabilities/surfaces (and their items) absent from the FPO, after the converge passes. NEVER touches account-scoped flows/agents/tools/records. Honors createPolicy:"skip". With dryRun, reports would-be removals as `pruned` plan rows. */
30820
31067
  prune?: boolean;
31068
+ /**
31069
+ * @description Whether converged capability agents and flows go live. Defaults to "publish": an agent or flow whose converged content is not yet live is versioned and published (the agent's `live` alias moves to that version), matching product creation. "none" saves changes as drafts and leaves `live` where it was. Publishing needs update authority over that entity kind, and for an agent the live deploy scope (AGENTS:DEPLOY:LIVE; AGENTS:WRITE or AGENTS:UPDATE also accepted); an API key without it converges that kind as "none".
31070
+ * @enum {string}
31071
+ */
31072
+ release?: "none" | "publish";
30821
31073
  };
30822
31074
  };
30823
31075
  };
30824
31076
  responses: {
30825
- /** @description Converge result: unchanged | converged | plan (dryRun), with a per-entity report. */
31077
+ /** @description Converge result: unchanged | converged | plan (dryRun), with a per-entity report; or definitionRequired (hash-only probe miss — retry with the full fpo). */
30826
31078
  200: {
30827
31079
  headers: {
30828
31080
  [name: string]: unknown;
@@ -30858,7 +31110,7 @@ interface paths {
30858
31110
  "application/json": components["schemas"]["Error"];
30859
31111
  };
30860
31112
  };
30861
- /** @description Conflict converging the top-level product: external_modification or remote_changed. */
31113
+ /** @description Conflict: external_modification converging the top-level product, or remote_changed (expectedRemoteHash guard). */
30862
31114
  409: {
30863
31115
  headers: {
30864
31116
  [name: string]: unknown;
@@ -33110,7 +33362,7 @@ interface paths {
33110
33362
  put?: never;
33111
33363
  /**
33112
33364
  * Ensure surface (config-as-code converge)
33113
- * @description Idempotently converge a repo-defined surface definition onto a product. Identity is name + product. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the surface or update it when the canonical content hash differs. The response always carries the server-computed canonical hash. Set dryRun to plan without writing (CI drift gate), and onConflict: "overwrite" to converge over dashboard/API edits. Surfaces have no version snapshots, so there is no publish option.
33365
+ * @description Idempotently converge a repo-defined surface definition onto a product. Identity is name + product. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the surface or update it when the canonical content hash differs. The response always carries the server-computed canonical hash. Set dryRun to plan without writing (CI drift gate), and onConflict: "overwrite" to converge over dashboard/API edits. Surfaces have no version snapshots, so there is no publish option. inbound/outbound are excluded from the content hash, so a request carrying them must send the full definition; changes to them are reported in changedKeys (as inbound.<key> / outbound.<key>) and converge as "updated".
33114
33366
  */
33115
33367
  post: {
33116
33368
  parameters: {
@@ -33131,13 +33383,15 @@ interface paths {
33131
33383
  };
33132
33384
  /** @enum {string} */
33133
33385
  environment?: "production" | "development";
33386
+ /** @description Inbound channel config. Omit to keep the stored value; null clears it. A credential value of "<redacted>" (as returned by pull) keeps the stored credential. */
33134
33387
  inbound?: {
33135
33388
  [key: string]: unknown;
33136
- };
33389
+ } | null;
33137
33390
  name: string;
33391
+ /** @description Outbound channel config. Omit to keep the stored value; null clears it. A credential value of "<redacted>" (as returned by pull) keeps the stored credential. */
33138
33392
  outbound?: {
33139
33393
  [key: string]: unknown;
33140
- };
33394
+ } | null;
33141
33395
  /** @enum {string} */
33142
33396
  status?: "draft" | "active" | "paused";
33143
33397
  /** @enum {string} */
@@ -33241,7 +33495,7 @@ interface paths {
33241
33495
  };
33242
33496
  /**
33243
33497
  * Pull surface definition (config-as-code)
33244
- * @description Return the canonical config-as-code definition and provenance for a surface by name within a product — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live surface state, so it is accurate even immediately after a dashboard edit.
33498
+ * @description Return the canonical config-as-code definition and provenance for a surface by name within a product — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live surface state, so it is accurate even immediately after a dashboard edit. Configured inbound/outbound credentials are returned as the "<redacted>" placeholder, which ensure accepts to keep the stored value; inbound/outbound are null when the surface has none.
33245
33499
  */
33246
33500
  get: {
33247
33501
  parameters: {
@@ -39594,47 +39848,72 @@ interface paths {
39594
39848
  patch?: never;
39595
39849
  trace?: never;
39596
39850
  };
39597
- "/v1/question-sets/{id}": {
39851
+ "/v1/question-sets/ensure": {
39598
39852
  parameters: {
39599
39853
  query?: never;
39600
39854
  header?: never;
39601
39855
  path?: never;
39602
39856
  cookie?: never;
39603
39857
  };
39858
+ get?: never;
39859
+ put?: never;
39604
39860
  /**
39605
- * Get a question set
39606
- * @description A question set with its versions, newest first.
39861
+ * Ensure question set (config-as-code converge)
39862
+ * @description Idempotently converge a repo-defined question set. Identity is the slug within the organization. A hash-only probe skips the payload in the steady state (a miss is a normal 200 `definitionRequired`, not an error); a full request creates the set, or appends a draft version when the questions, input mapping or model differ. Set dryRun to plan without writing, onConflict: "overwrite" to converge over dashboard or API edits, expectedRemoteHash to bind an apply to its dry run, and release: "publish" to publish the latest version. Ensure never deletes a set or a version.
39607
39863
  */
39608
- get: {
39864
+ post: {
39609
39865
  parameters: {
39610
39866
  query?: never;
39611
39867
  header?: never;
39612
- path: {
39613
- id: string;
39614
- };
39868
+ path?: never;
39615
39869
  cookie?: never;
39616
39870
  };
39617
- requestBody?: never;
39871
+ requestBody?: {
39872
+ content: {
39873
+ "application/json": {
39874
+ contentHash?: string;
39875
+ definition?: {
39876
+ description?: string | null;
39877
+ inputMapping?: {
39878
+ [key: string]: string;
39879
+ } | null;
39880
+ model?: string | null;
39881
+ name: string;
39882
+ /** @description Judgment questions keyed by question id, validated like `POST /v1/question-sets`. */
39883
+ questions: {
39884
+ [key: string]: unknown;
39885
+ };
39886
+ };
39887
+ dryRun?: boolean;
39888
+ expectedRemoteHash?: string;
39889
+ /** @enum {string} */
39890
+ onConflict?: "error" | "overwrite";
39891
+ /** @enum {string} */
39892
+ release?: "none" | "publish";
39893
+ /** @description Identity, unique in the organization: lowercase letters, digits, `-` and `_`, up to 64. */
39894
+ slug: string;
39895
+ };
39896
+ };
39897
+ };
39618
39898
  responses: {
39619
- /** @description Question set */
39899
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss; retry with the full definition) | plan (dryRun) */
39620
39900
  200: {
39621
39901
  headers: {
39622
39902
  [name: string]: unknown;
39623
39903
  };
39624
39904
  content: {
39625
- "application/json": {
39626
- questionSet: components["schemas"]["QuestionSet"];
39627
- versions: components["schemas"]["QuestionSetVersion"][];
39628
- };
39905
+ "application/json": components["schemas"]["QuestionSetEnsureResponse"];
39629
39906
  };
39630
39907
  };
39631
- /** @description Invalid request */
39908
+ /** @description Invalid request or invalid questions */
39632
39909
  400: {
39633
39910
  headers: {
39634
39911
  [name: string]: unknown;
39635
39912
  };
39636
39913
  content: {
39637
- "application/json": components["schemas"]["QuestionSetError"];
39914
+ "application/json": components["schemas"]["Error"] & {
39915
+ code?: string;
39916
+ };
39638
39917
  };
39639
39918
  };
39640
39919
  /** @description Unauthorized */
@@ -39655,79 +39934,37 @@ interface paths {
39655
39934
  "application/json": components["schemas"]["Error"];
39656
39935
  };
39657
39936
  };
39658
- /** @description Not found */
39937
+ /** @description The question set was removed while the converge ran */
39659
39938
  404: {
39660
39939
  headers: {
39661
39940
  [name: string]: unknown;
39662
39941
  };
39663
39942
  content: {
39664
- "application/json": components["schemas"]["QuestionSetError"];
39665
- };
39666
- };
39667
- };
39668
- };
39669
- /**
39670
- * Update a question set
39671
- * @description Update the name or description, and append a new draft version when `questions`, `inputMapping` or `model` is present. Fields left out of a new version carry over from the latest version. No existing version is changed, and the slug is fixed.
39672
- */
39673
- put: {
39674
- parameters: {
39675
- query?: never;
39676
- header?: never;
39677
- path: {
39678
- id: string;
39679
- };
39680
- cookie?: never;
39681
- };
39682
- requestBody?: {
39683
- content: {
39684
- "application/json": {
39685
- description?: string | null;
39686
- inputMapping?: {
39687
- [key: string]: string;
39688
- } | null;
39689
- model?: string | null;
39690
- name?: string;
39691
- /** @description Judgment questions keyed by question id. Each is `{ type: "boolean" | "choice" | "score", instructions, criteria }`. The id is never sent to the model, so instructions and criteria carry the meaning. */
39692
- questions?: {
39693
- [key: string]: unknown;
39694
- };
39695
- };
39696
- };
39697
- };
39698
- responses: {
39699
- /** @description Updated */
39700
- 200: {
39701
- headers: {
39702
- [name: string]: unknown;
39703
- };
39704
- content: {
39705
- "application/json": {
39706
- questionSet: components["schemas"]["QuestionSet"];
39707
- version: components["schemas"]["QuestionSetVersion"] & (Record<string, never> | null);
39943
+ "application/json": components["schemas"]["Error"] & {
39944
+ code?: string;
39708
39945
  };
39709
39946
  };
39710
39947
  };
39711
- /** @description Invalid request */
39712
- 400: {
39948
+ /** @description Conflict: external_modification (the last write was not ensure; pass onConflict: "overwrite"), remote_changed (expectedRemoteHash guard), or a concurrent write */
39949
+ 409: {
39713
39950
  headers: {
39714
39951
  [name: string]: unknown;
39715
39952
  };
39716
39953
  content: {
39717
- "application/json": components["schemas"]["QuestionSetError"];
39954
+ "application/json": components["schemas"]["QuestionSetEnsureConflict"];
39718
39955
  };
39719
39956
  };
39720
- /** @description Unauthorized */
39721
- 401: {
39957
+ /** @description The submitted contentHash does not match the server-recomputed canonical hash */
39958
+ 422: {
39722
39959
  headers: {
39723
39960
  [name: string]: unknown;
39724
39961
  };
39725
39962
  content: {
39726
- "application/json": components["schemas"]["Error"];
39963
+ "application/json": components["schemas"]["QuestionSetEnsureHashMismatch"];
39727
39964
  };
39728
39965
  };
39729
- /** @description Insufficient permissions, or no organization context */
39730
- 403: {
39966
+ /** @description Internal server error */
39967
+ 500: {
39731
39968
  headers: {
39732
39969
  [name: string]: unknown;
39733
39970
  };
@@ -39735,34 +39972,15 @@ interface paths {
39735
39972
  "application/json": components["schemas"]["Error"];
39736
39973
  };
39737
39974
  };
39738
- /** @description Not found */
39739
- 404: {
39740
- headers: {
39741
- [name: string]: unknown;
39742
- };
39743
- content: {
39744
- "application/json": components["schemas"]["QuestionSetError"];
39745
- };
39746
- };
39747
- /** @description Conflict */
39748
- 409: {
39749
- headers: {
39750
- [name: string]: unknown;
39751
- };
39752
- content: {
39753
- "application/json": components["schemas"]["QuestionSetError"];
39754
- };
39755
- };
39756
39975
  };
39757
39976
  };
39758
- post?: never;
39759
39977
  delete?: never;
39760
39978
  options?: never;
39761
39979
  head?: never;
39762
39980
  patch?: never;
39763
39981
  trace?: never;
39764
39982
  };
39765
- "/v1/question-sets/{id}/resolved": {
39983
+ "/v1/question-sets/pull": {
39766
39984
  parameters: {
39767
39985
  query?: never;
39768
39986
  header?: never;
@@ -39770,38 +39988,28 @@ interface paths {
39770
39988
  cookie?: never;
39771
39989
  };
39772
39990
  /**
39773
- * Resolve a question set
39774
- * @description The question set exactly as an execution receives it: the current published version (or the published `version` named), with its current calibration. A draft-only set answers 404 QUESTION_SET_UNRESOLVED.
39991
+ * Pull question set definition (config-as-code)
39992
+ * @description Return the canonical config-as-code definition and provenance for a question set by slug. The definition is the latest version, and the contentHash is recomputed from the live row, so it is accurate right after a dashboard edit.
39775
39993
  */
39776
39994
  get: {
39777
39995
  parameters: {
39778
- query?: {
39779
- version?: number;
39996
+ query: {
39997
+ /** @description Identity, unique in the organization: lowercase letters, digits, `-` and `_`, up to 64. */
39998
+ slug: string;
39780
39999
  };
39781
40000
  header?: never;
39782
- path: {
39783
- id: string;
39784
- };
40001
+ path?: never;
39785
40002
  cookie?: never;
39786
40003
  };
39787
40004
  requestBody?: never;
39788
40005
  responses: {
39789
- /** @description Resolved */
40006
+ /** @description Canonical definition and provenance */
39790
40007
  200: {
39791
40008
  headers: {
39792
40009
  [name: string]: unknown;
39793
40010
  };
39794
40011
  content: {
39795
- "application/json": components["schemas"]["ResolvedQuestionSet"];
39796
- };
39797
- };
39798
- /** @description Invalid request */
39799
- 400: {
39800
- headers: {
39801
- [name: string]: unknown;
39802
- };
39803
- content: {
39804
- "application/json": components["schemas"]["QuestionSetError"];
40012
+ "application/json": components["schemas"]["QuestionSetPullResponse"];
39805
40013
  };
39806
40014
  };
39807
40015
  /** @description Unauthorized */
@@ -39822,69 +40030,8 @@ interface paths {
39822
40030
  "application/json": components["schemas"]["Error"];
39823
40031
  };
39824
40032
  };
39825
- /** @description Not found */
40033
+ /** @description No question set with that slug in the organization */
39826
40034
  404: {
39827
- headers: {
39828
- [name: string]: unknown;
39829
- };
39830
- content: {
39831
- "application/json": components["schemas"]["QuestionSetError"];
39832
- };
39833
- };
39834
- };
39835
- };
39836
- put?: never;
39837
- post?: never;
39838
- delete?: never;
39839
- options?: never;
39840
- head?: never;
39841
- patch?: never;
39842
- trace?: never;
39843
- };
39844
- "/v1/question-sets/{id}/versions": {
39845
- parameters: {
39846
- query?: never;
39847
- header?: never;
39848
- path?: never;
39849
- cookie?: never;
39850
- };
39851
- /**
39852
- * List a question set's versions
39853
- * @description Every version, newest first.
39854
- */
39855
- get: {
39856
- parameters: {
39857
- query?: never;
39858
- header?: never;
39859
- path: {
39860
- id: string;
39861
- };
39862
- cookie?: never;
39863
- };
39864
- requestBody?: never;
39865
- responses: {
39866
- /** @description Versions */
39867
- 200: {
39868
- headers: {
39869
- [name: string]: unknown;
39870
- };
39871
- content: {
39872
- "application/json": {
39873
- data: components["schemas"]["QuestionSetVersion"][];
39874
- };
39875
- };
39876
- };
39877
- /** @description Invalid request */
39878
- 400: {
39879
- headers: {
39880
- [name: string]: unknown;
39881
- };
39882
- content: {
39883
- "application/json": components["schemas"]["QuestionSetError"];
39884
- };
39885
- };
39886
- /** @description Unauthorized */
39887
- 401: {
39888
40035
  headers: {
39889
40036
  [name: string]: unknown;
39890
40037
  };
@@ -39892,8 +40039,8 @@ interface paths {
39892
40039
  "application/json": components["schemas"]["Error"];
39893
40040
  };
39894
40041
  };
39895
- /** @description Insufficient permissions, or no organization context */
39896
- 403: {
40042
+ /** @description Internal server error */
40043
+ 500: {
39897
40044
  headers: {
39898
40045
  [name: string]: unknown;
39899
40046
  };
@@ -39901,15 +40048,6 @@ interface paths {
39901
40048
  "application/json": components["schemas"]["Error"];
39902
40049
  };
39903
40050
  };
39904
- /** @description Not found */
39905
- 404: {
39906
- headers: {
39907
- [name: string]: unknown;
39908
- };
39909
- content: {
39910
- "application/json": components["schemas"]["QuestionSetError"];
39911
- };
39912
- };
39913
40051
  };
39914
40052
  };
39915
40053
  put?: never;
@@ -39920,7 +40058,7 @@ interface paths {
39920
40058
  patch?: never;
39921
40059
  trace?: never;
39922
40060
  };
39923
- "/v1/question-sets/{id}/versions/{versionNumber}/calibrations": {
40061
+ "/v1/question-sets/{id}": {
39924
40062
  parameters: {
39925
40063
  query?: never;
39926
40064
  header?: never;
@@ -39928,35 +40066,361 @@ interface paths {
39928
40066
  cookie?: never;
39929
40067
  };
39930
40068
  /**
39931
- * List a question set version's calibrations
39932
- * @description The calibration history of one version, newest first, with cursor pagination.
40069
+ * Get a question set
40070
+ * @description A question set with its versions, newest first.
39933
40071
  */
39934
40072
  get: {
39935
40073
  parameters: {
39936
- query?: {
39937
- /** @description 1-200, default 50. */
39938
- limit?: string;
39939
- /** @description `pagination.nextCursor` from a previous page. */
39940
- cursor?: string;
39941
- };
40074
+ query?: never;
39942
40075
  header?: never;
39943
40076
  path: {
39944
40077
  id: string;
39945
- versionNumber: number;
39946
40078
  };
39947
40079
  cookie?: never;
39948
40080
  };
39949
40081
  requestBody?: never;
39950
40082
  responses: {
39951
- /** @description Calibrations */
40083
+ /** @description Question set */
39952
40084
  200: {
39953
40085
  headers: {
39954
40086
  [name: string]: unknown;
39955
40087
  };
39956
40088
  content: {
39957
40089
  "application/json": {
39958
- data: components["schemas"]["JudgmentCalibrationRecord"][];
39959
- pagination: components["schemas"]["Pagination"];
40090
+ questionSet: components["schemas"]["QuestionSet"];
40091
+ versions: components["schemas"]["QuestionSetVersion"][];
40092
+ };
40093
+ };
40094
+ };
40095
+ /** @description Invalid request */
40096
+ 400: {
40097
+ headers: {
40098
+ [name: string]: unknown;
40099
+ };
40100
+ content: {
40101
+ "application/json": components["schemas"]["QuestionSetError"];
40102
+ };
40103
+ };
40104
+ /** @description Unauthorized */
40105
+ 401: {
40106
+ headers: {
40107
+ [name: string]: unknown;
40108
+ };
40109
+ content: {
40110
+ "application/json": components["schemas"]["Error"];
40111
+ };
40112
+ };
40113
+ /** @description Insufficient permissions, or no organization context */
40114
+ 403: {
40115
+ headers: {
40116
+ [name: string]: unknown;
40117
+ };
40118
+ content: {
40119
+ "application/json": components["schemas"]["Error"];
40120
+ };
40121
+ };
40122
+ /** @description Not found */
40123
+ 404: {
40124
+ headers: {
40125
+ [name: string]: unknown;
40126
+ };
40127
+ content: {
40128
+ "application/json": components["schemas"]["QuestionSetError"];
40129
+ };
40130
+ };
40131
+ };
40132
+ };
40133
+ /**
40134
+ * Update a question set
40135
+ * @description Update the name or description, and append a new draft version when `questions`, `inputMapping` or `model` is present. Fields left out of a new version carry over from the latest version. No existing version is changed, and the slug is fixed.
40136
+ */
40137
+ put: {
40138
+ parameters: {
40139
+ query?: never;
40140
+ header?: never;
40141
+ path: {
40142
+ id: string;
40143
+ };
40144
+ cookie?: never;
40145
+ };
40146
+ requestBody?: {
40147
+ content: {
40148
+ "application/json": {
40149
+ description?: string | null;
40150
+ inputMapping?: {
40151
+ [key: string]: string;
40152
+ } | null;
40153
+ model?: string | null;
40154
+ name?: string;
40155
+ /** @description Judgment questions keyed by question id. Each is `{ type: "boolean" | "choice" | "score", instructions, criteria }`. The id is never sent to the model, so instructions and criteria carry the meaning. */
40156
+ questions?: {
40157
+ [key: string]: unknown;
40158
+ };
40159
+ };
40160
+ };
40161
+ };
40162
+ responses: {
40163
+ /** @description Updated */
40164
+ 200: {
40165
+ headers: {
40166
+ [name: string]: unknown;
40167
+ };
40168
+ content: {
40169
+ "application/json": {
40170
+ questionSet: components["schemas"]["QuestionSet"];
40171
+ version: components["schemas"]["QuestionSetVersion"] & (Record<string, never> | null);
40172
+ };
40173
+ };
40174
+ };
40175
+ /** @description Invalid request */
40176
+ 400: {
40177
+ headers: {
40178
+ [name: string]: unknown;
40179
+ };
40180
+ content: {
40181
+ "application/json": components["schemas"]["QuestionSetError"];
40182
+ };
40183
+ };
40184
+ /** @description Unauthorized */
40185
+ 401: {
40186
+ headers: {
40187
+ [name: string]: unknown;
40188
+ };
40189
+ content: {
40190
+ "application/json": components["schemas"]["Error"];
40191
+ };
40192
+ };
40193
+ /** @description Insufficient permissions, or no organization context */
40194
+ 403: {
40195
+ headers: {
40196
+ [name: string]: unknown;
40197
+ };
40198
+ content: {
40199
+ "application/json": components["schemas"]["Error"];
40200
+ };
40201
+ };
40202
+ /** @description Not found */
40203
+ 404: {
40204
+ headers: {
40205
+ [name: string]: unknown;
40206
+ };
40207
+ content: {
40208
+ "application/json": components["schemas"]["QuestionSetError"];
40209
+ };
40210
+ };
40211
+ /** @description Conflict */
40212
+ 409: {
40213
+ headers: {
40214
+ [name: string]: unknown;
40215
+ };
40216
+ content: {
40217
+ "application/json": components["schemas"]["QuestionSetError"];
40218
+ };
40219
+ };
40220
+ };
40221
+ };
40222
+ post?: never;
40223
+ delete?: never;
40224
+ options?: never;
40225
+ head?: never;
40226
+ patch?: never;
40227
+ trace?: never;
40228
+ };
40229
+ "/v1/question-sets/{id}/resolved": {
40230
+ parameters: {
40231
+ query?: never;
40232
+ header?: never;
40233
+ path?: never;
40234
+ cookie?: never;
40235
+ };
40236
+ /**
40237
+ * Resolve a question set
40238
+ * @description The question set exactly as an execution receives it: the current published version (or the published `version` named), with its current calibration. A draft-only set answers 404 QUESTION_SET_UNRESOLVED.
40239
+ */
40240
+ get: {
40241
+ parameters: {
40242
+ query?: {
40243
+ version?: number;
40244
+ };
40245
+ header?: never;
40246
+ path: {
40247
+ id: string;
40248
+ };
40249
+ cookie?: never;
40250
+ };
40251
+ requestBody?: never;
40252
+ responses: {
40253
+ /** @description Resolved */
40254
+ 200: {
40255
+ headers: {
40256
+ [name: string]: unknown;
40257
+ };
40258
+ content: {
40259
+ "application/json": components["schemas"]["ResolvedQuestionSet"];
40260
+ };
40261
+ };
40262
+ /** @description Invalid request */
40263
+ 400: {
40264
+ headers: {
40265
+ [name: string]: unknown;
40266
+ };
40267
+ content: {
40268
+ "application/json": components["schemas"]["QuestionSetError"];
40269
+ };
40270
+ };
40271
+ /** @description Unauthorized */
40272
+ 401: {
40273
+ headers: {
40274
+ [name: string]: unknown;
40275
+ };
40276
+ content: {
40277
+ "application/json": components["schemas"]["Error"];
40278
+ };
40279
+ };
40280
+ /** @description Insufficient permissions, or no organization context */
40281
+ 403: {
40282
+ headers: {
40283
+ [name: string]: unknown;
40284
+ };
40285
+ content: {
40286
+ "application/json": components["schemas"]["Error"];
40287
+ };
40288
+ };
40289
+ /** @description Not found */
40290
+ 404: {
40291
+ headers: {
40292
+ [name: string]: unknown;
40293
+ };
40294
+ content: {
40295
+ "application/json": components["schemas"]["QuestionSetError"];
40296
+ };
40297
+ };
40298
+ };
40299
+ };
40300
+ put?: never;
40301
+ post?: never;
40302
+ delete?: never;
40303
+ options?: never;
40304
+ head?: never;
40305
+ patch?: never;
40306
+ trace?: never;
40307
+ };
40308
+ "/v1/question-sets/{id}/versions": {
40309
+ parameters: {
40310
+ query?: never;
40311
+ header?: never;
40312
+ path?: never;
40313
+ cookie?: never;
40314
+ };
40315
+ /**
40316
+ * List a question set's versions
40317
+ * @description Every version, newest first.
40318
+ */
40319
+ get: {
40320
+ parameters: {
40321
+ query?: never;
40322
+ header?: never;
40323
+ path: {
40324
+ id: string;
40325
+ };
40326
+ cookie?: never;
40327
+ };
40328
+ requestBody?: never;
40329
+ responses: {
40330
+ /** @description Versions */
40331
+ 200: {
40332
+ headers: {
40333
+ [name: string]: unknown;
40334
+ };
40335
+ content: {
40336
+ "application/json": {
40337
+ data: components["schemas"]["QuestionSetVersion"][];
40338
+ };
40339
+ };
40340
+ };
40341
+ /** @description Invalid request */
40342
+ 400: {
40343
+ headers: {
40344
+ [name: string]: unknown;
40345
+ };
40346
+ content: {
40347
+ "application/json": components["schemas"]["QuestionSetError"];
40348
+ };
40349
+ };
40350
+ /** @description Unauthorized */
40351
+ 401: {
40352
+ headers: {
40353
+ [name: string]: unknown;
40354
+ };
40355
+ content: {
40356
+ "application/json": components["schemas"]["Error"];
40357
+ };
40358
+ };
40359
+ /** @description Insufficient permissions, or no organization context */
40360
+ 403: {
40361
+ headers: {
40362
+ [name: string]: unknown;
40363
+ };
40364
+ content: {
40365
+ "application/json": components["schemas"]["Error"];
40366
+ };
40367
+ };
40368
+ /** @description Not found */
40369
+ 404: {
40370
+ headers: {
40371
+ [name: string]: unknown;
40372
+ };
40373
+ content: {
40374
+ "application/json": components["schemas"]["QuestionSetError"];
40375
+ };
40376
+ };
40377
+ };
40378
+ };
40379
+ put?: never;
40380
+ post?: never;
40381
+ delete?: never;
40382
+ options?: never;
40383
+ head?: never;
40384
+ patch?: never;
40385
+ trace?: never;
40386
+ };
40387
+ "/v1/question-sets/{id}/versions/{versionNumber}/calibrations": {
40388
+ parameters: {
40389
+ query?: never;
40390
+ header?: never;
40391
+ path?: never;
40392
+ cookie?: never;
40393
+ };
40394
+ /**
40395
+ * List a question set version's calibrations
40396
+ * @description The calibration history of one version, newest first, with cursor pagination.
40397
+ */
40398
+ get: {
40399
+ parameters: {
40400
+ query?: {
40401
+ /** @description 1-200, default 50. */
40402
+ limit?: string;
40403
+ /** @description `pagination.nextCursor` from a previous page. */
40404
+ cursor?: string;
40405
+ };
40406
+ header?: never;
40407
+ path: {
40408
+ id: string;
40409
+ versionNumber: number;
40410
+ };
40411
+ cookie?: never;
40412
+ };
40413
+ requestBody?: never;
40414
+ responses: {
40415
+ /** @description Calibrations */
40416
+ 200: {
40417
+ headers: {
40418
+ [name: string]: unknown;
40419
+ };
40420
+ content: {
40421
+ "application/json": {
40422
+ data: components["schemas"]["JudgmentCalibrationRecord"][];
40423
+ pagination: components["schemas"]["Pagination"];
39960
40424
  };
39961
40425
  };
39962
40426
  };
@@ -40115,7 +40579,10 @@ interface paths {
40115
40579
  */
40116
40580
  post: {
40117
40581
  parameters: {
40118
- query?: never;
40582
+ query?: {
40583
+ /** @description A set managed by code (`lastModifiedSource` is `sdk` or `terraform`) answers 409 `managed_by_code_conflict` unless this is `overwrite`. */
40584
+ onConflict?: "error" | "overwrite";
40585
+ };
40119
40586
  header?: never;
40120
40587
  path: {
40121
40588
  id: string;
@@ -40173,6 +40640,15 @@ interface paths {
40173
40640
  "application/json": components["schemas"]["QuestionSetError"];
40174
40641
  };
40175
40642
  };
40643
+ /** @description Conflict */
40644
+ 409: {
40645
+ headers: {
40646
+ [name: string]: unknown;
40647
+ };
40648
+ content: {
40649
+ "application/json": components["schemas"]["QuestionSetError"];
40650
+ };
40651
+ };
40176
40652
  };
40177
40653
  };
40178
40654
  delete?: never;
@@ -44012,7 +44488,239 @@ interface paths {
44012
44488
  patch?: never;
44013
44489
  trace?: never;
44014
44490
  };
44015
- "/v1/schedules/batch/{batchId}/results": {
44491
+ "/v1/schedules/batch/{batchId}/results": {
44492
+ parameters: {
44493
+ query?: never;
44494
+ header?: never;
44495
+ path?: never;
44496
+ cookie?: never;
44497
+ };
44498
+ /**
44499
+ * Get results for a batch execution
44500
+ * @description Returns the per-record results for a batch execution.
44501
+ */
44502
+ get: {
44503
+ parameters: {
44504
+ query?: {
44505
+ limit?: string;
44506
+ offset?: string;
44507
+ status?: string;
44508
+ };
44509
+ header?: never;
44510
+ path: {
44511
+ batchId: string;
44512
+ };
44513
+ cookie?: never;
44514
+ };
44515
+ requestBody?: never;
44516
+ responses: {
44517
+ /** @description Batch results */
44518
+ 200: {
44519
+ headers: {
44520
+ [name: string]: unknown;
44521
+ };
44522
+ content: {
44523
+ "application/json": {
44524
+ data: {
44525
+ agentExecutionId: string | null;
44526
+ createdAt: string;
44527
+ durationMs: number | null;
44528
+ error: string | null;
44529
+ executedAt: string | null;
44530
+ /**
44531
+ * @description Engine that actually executed this record execution ('runtime' | 'legacy' | 'external'). Recorded at write time from the committed lane decision; never inferred later. 'external' marks a run a customer executed outside Runtype and reported through ingest. Null for rows written before attribution shipped and for units that never started executing.
44532
+ * @enum {string|null}
44533
+ */
44534
+ executionEngine?: "runtime" | "legacy" | "external" | null;
44535
+ failedAt: string | null;
44536
+ failedStepCount: number | null;
44537
+ flowId: string | null;
44538
+ flowName: string | null;
44539
+ record: {
44540
+ id: string;
44541
+ name: string;
44542
+ type: string;
44543
+ } | null;
44544
+ recordId: string;
44545
+ recordResultId: string | null;
44546
+ result?: unknown;
44547
+ status: string;
44548
+ stepCount: number | null;
44549
+ }[];
44550
+ pagination: {
44551
+ hasMore: boolean;
44552
+ limit: number;
44553
+ offset: number;
44554
+ total: number;
44555
+ };
44556
+ summary?: {
44557
+ recordsWithFailedSteps: number;
44558
+ };
44559
+ };
44560
+ };
44561
+ };
44562
+ /** @description Unauthorized */
44563
+ 401: {
44564
+ headers: {
44565
+ [name: string]: unknown;
44566
+ };
44567
+ content: {
44568
+ "application/json": components["schemas"]["Error"];
44569
+ };
44570
+ };
44571
+ /** @description Insufficient permissions */
44572
+ 403: {
44573
+ headers: {
44574
+ [name: string]: unknown;
44575
+ };
44576
+ content: {
44577
+ "application/json": components["schemas"]["Error"];
44578
+ };
44579
+ };
44580
+ /** @description Batch not found */
44581
+ 404: {
44582
+ headers: {
44583
+ [name: string]: unknown;
44584
+ };
44585
+ content: {
44586
+ "application/json": components["schemas"]["Error"];
44587
+ };
44588
+ };
44589
+ };
44590
+ };
44591
+ put?: never;
44592
+ post?: never;
44593
+ delete?: never;
44594
+ options?: never;
44595
+ head?: never;
44596
+ patch?: never;
44597
+ trace?: never;
44598
+ };
44599
+ "/v1/schedules/ensure": {
44600
+ parameters: {
44601
+ query?: never;
44602
+ header?: never;
44603
+ path?: never;
44604
+ cookie?: never;
44605
+ };
44606
+ get?: never;
44607
+ put?: never;
44608
+ /**
44609
+ * Ensure schedule (config-as-code converge)
44610
+ * @description Idempotently converge a repo-defined schedule on a standalone flow or agent. Identity is name + target + account scope; the target may name the flow or agent instead of carrying its id, so one definition works in every environment. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response); full requests create the schedule or update it when the canonical content hash differs. Set dryRun to plan without writing (CI drift gate) and onConflict: "overwrite" to converge over dashboard/API edits. Omit `enabled` to leave a paused schedule paused. Ensure never deletes; schedules owned by a product surface are never matched.
44611
+ */
44612
+ post: {
44613
+ parameters: {
44614
+ query?: never;
44615
+ header?: never;
44616
+ path?: never;
44617
+ cookie?: never;
44618
+ };
44619
+ requestBody?: {
44620
+ content: {
44621
+ "application/json": {
44622
+ contentHash?: string;
44623
+ definition?: components["schemas"]["ScheduleEnsureDefinition"];
44624
+ dryRun?: boolean;
44625
+ expectedRemoteHash?: string;
44626
+ name: string;
44627
+ /** @enum {string} */
44628
+ onConflict?: "error" | "overwrite";
44629
+ target: components["schemas"]["ScheduleEnsureTarget"];
44630
+ };
44631
+ };
44632
+ };
44633
+ responses: {
44634
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
44635
+ 200: {
44636
+ headers: {
44637
+ [name: string]: unknown;
44638
+ };
44639
+ content: {
44640
+ "application/json": components["schemas"]["ScheduleEnsureResponse"];
44641
+ };
44642
+ };
44643
+ /** @description Validation error */
44644
+ 400: {
44645
+ headers: {
44646
+ [name: string]: unknown;
44647
+ };
44648
+ content: {
44649
+ "application/json": components["schemas"]["Error"];
44650
+ };
44651
+ };
44652
+ /** @description Unauthorized */
44653
+ 401: {
44654
+ headers: {
44655
+ [name: string]: unknown;
44656
+ };
44657
+ content: {
44658
+ "application/json": components["schemas"]["Error"];
44659
+ };
44660
+ };
44661
+ /** @description Plan limit exceeded (cron frequency or active schedule count) */
44662
+ 402: {
44663
+ headers: {
44664
+ [name: string]: unknown;
44665
+ };
44666
+ content: {
44667
+ "application/json": components["schemas"]["ScheduleEntitlementError"];
44668
+ };
44669
+ };
44670
+ /** @description Insufficient permissions */
44671
+ 403: {
44672
+ headers: {
44673
+ [name: string]: unknown;
44674
+ };
44675
+ content: {
44676
+ "application/json": components["schemas"]["Error"];
44677
+ };
44678
+ };
44679
+ /** @description Target not found */
44680
+ 404: {
44681
+ headers: {
44682
+ [name: string]: unknown;
44683
+ };
44684
+ content: {
44685
+ "application/json": components["schemas"]["Error"];
44686
+ };
44687
+ };
44688
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
44689
+ 409: {
44690
+ headers: {
44691
+ [name: string]: unknown;
44692
+ };
44693
+ content: {
44694
+ "application/json": components["schemas"]["ScheduleEnsureConflict"];
44695
+ };
44696
+ };
44697
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
44698
+ 422: {
44699
+ headers: {
44700
+ [name: string]: unknown;
44701
+ };
44702
+ content: {
44703
+ "application/json": components["schemas"]["ScheduleEnsureHashMismatch"];
44704
+ };
44705
+ };
44706
+ /** @description Internal server error */
44707
+ 500: {
44708
+ headers: {
44709
+ [name: string]: unknown;
44710
+ };
44711
+ content: {
44712
+ "application/json": components["schemas"]["Error"];
44713
+ };
44714
+ };
44715
+ };
44716
+ };
44717
+ delete?: never;
44718
+ options?: never;
44719
+ head?: never;
44720
+ patch?: never;
44721
+ trace?: never;
44722
+ };
44723
+ "/v1/schedules/pull": {
44016
44724
  parameters: {
44017
44725
  query?: never;
44018
44726
  header?: never;
@@ -44020,67 +44728,40 @@ interface paths {
44020
44728
  cookie?: never;
44021
44729
  };
44022
44730
  /**
44023
- * Get results for a batch execution
44024
- * @description Returns the per-record results for a batch execution.
44731
+ * Pull schedule definition (config-as-code)
44732
+ * @description Return the canonical config-as-code definition and provenance for a standalone schedule by name and target — the absorb-drift direction of the ensure protocol. The target is echoed in the form the query used, and the definition always declares `enabled`.
44025
44733
  */
44026
44734
  get: {
44027
44735
  parameters: {
44028
- query?: {
44029
- limit?: string;
44030
- offset?: string;
44031
- status?: string;
44736
+ query: {
44737
+ name: string;
44738
+ flowId?: string;
44739
+ agentId?: string;
44740
+ flowName?: string;
44741
+ agentName?: string;
44032
44742
  };
44033
44743
  header?: never;
44034
- path: {
44035
- batchId: string;
44036
- };
44744
+ path?: never;
44037
44745
  cookie?: never;
44038
44746
  };
44039
44747
  requestBody?: never;
44040
44748
  responses: {
44041
- /** @description Batch results */
44749
+ /** @description Canonical definition + provenance */
44042
44750
  200: {
44043
44751
  headers: {
44044
44752
  [name: string]: unknown;
44045
44753
  };
44046
44754
  content: {
44047
- "application/json": {
44048
- data: {
44049
- agentExecutionId: string | null;
44050
- createdAt: string;
44051
- durationMs: number | null;
44052
- error: string | null;
44053
- executedAt: string | null;
44054
- /**
44055
- * @description Engine that actually executed this record execution ('runtime' | 'legacy' | 'external'). Recorded at write time from the committed lane decision; never inferred later. 'external' marks a run a customer executed outside Runtype and reported through ingest. Null for rows written before attribution shipped and for units that never started executing.
44056
- * @enum {string|null}
44057
- */
44058
- executionEngine?: "runtime" | "legacy" | "external" | null;
44059
- failedAt: string | null;
44060
- failedStepCount: number | null;
44061
- flowId: string | null;
44062
- flowName: string | null;
44063
- record: {
44064
- id: string;
44065
- name: string;
44066
- type: string;
44067
- } | null;
44068
- recordId: string;
44069
- recordResultId: string | null;
44070
- result?: unknown;
44071
- status: string;
44072
- stepCount: number | null;
44073
- }[];
44074
- pagination: {
44075
- hasMore: boolean;
44076
- limit: number;
44077
- offset: number;
44078
- total: number;
44079
- };
44080
- summary?: {
44081
- recordsWithFailedSteps: number;
44082
- };
44083
- };
44755
+ "application/json": components["schemas"]["SchedulePullResponse"];
44756
+ };
44757
+ };
44758
+ /** @description Validation error */
44759
+ 400: {
44760
+ headers: {
44761
+ [name: string]: unknown;
44762
+ };
44763
+ content: {
44764
+ "application/json": components["schemas"]["Error"];
44084
44765
  };
44085
44766
  };
44086
44767
  /** @description Unauthorized */
@@ -44101,7 +44782,7 @@ interface paths {
44101
44782
  "application/json": components["schemas"]["Error"];
44102
44783
  };
44103
44784
  };
44104
- /** @description Batch not found */
44785
+ /** @description No schedule with that name on that target in the account scope */
44105
44786
  404: {
44106
44787
  headers: {
44107
44788
  [name: string]: unknown;
@@ -44110,6 +44791,15 @@ interface paths {
44110
44791
  "application/json": components["schemas"]["Error"];
44111
44792
  };
44112
44793
  };
44794
+ /** @description Internal server error */
44795
+ 500: {
44796
+ headers: {
44797
+ [name: string]: unknown;
44798
+ };
44799
+ content: {
44800
+ "application/json": components["schemas"]["Error"];
44801
+ };
44802
+ };
44113
44803
  };
44114
44804
  };
44115
44805
  put?: never;
@@ -46508,7 +47198,7 @@ interface paths {
46508
47198
  put?: never;
46509
47199
  /**
46510
47200
  * Ensure skill (config-as-code converge)
46511
- * @description Idempotently converge a repo-defined skill (SKILL.md manifest) onto the platform. Identity is name + account scope. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the skill or append a new version when the canonical content hash differs. The response always carries the server-computed canonical hash + the version id. Set dryRun to plan without writing (CI drift gate), onConflict: "overwrite" to converge over dashboard/API edits, and release: "publish" to publish the converged version. Admin/control plane only — no review queue.
47201
+ * @description Idempotently converge a repo-defined skill (SKILL.md manifest) onto the platform. Identity is name + account scope. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the skill or append a new version when the canonical content hash differs. The response always carries the server-computed canonical hash + the version id. Set dryRun to plan without writing (CI drift gate), onConflict: "overwrite" to converge over dashboard/API edits, and release: "publish" to publish the converged version. Optional version.label / version.notes stamp provenance (a git SHA, a release tag) on the appended version row. Admin/control plane only — no review queue.
46512
47202
  */
46513
47203
  post: {
46514
47204
  parameters: {
@@ -46535,6 +47225,7 @@ interface paths {
46535
47225
  onConflict?: "error" | "overwrite";
46536
47226
  /** @enum {string} */
46537
47227
  release?: "none" | "publish";
47228
+ version?: components["schemas"]["EnsureVersionMetadata"];
46538
47229
  };
46539
47230
  };
46540
47231
  };
@@ -50669,6 +51360,36 @@ interface components {
50669
51360
  code?: "alias_requires_organization";
50670
51361
  error: string;
50671
51362
  };
51363
+ AgentEnsureCapability: {
51364
+ /** @description The name of another agent in this account scope, called as a sub-agent. */
51365
+ agent?: string;
51366
+ description?: string;
51367
+ /** @description Defaults to true. */
51368
+ enabled?: boolean;
51369
+ /** @description The name of a flow in this account scope. */
51370
+ flow?: string;
51371
+ /** @description JSON Schema for the capability's input. Omit to derive it from the flow's inputs or the tool's own schema. */
51372
+ parametersSchema?: {
51373
+ [key: string]: unknown;
51374
+ };
51375
+ /** @description The name of a saved tool in this account scope. */
51376
+ tool?: string;
51377
+ /** @description The name the agent calls this capability by. */
51378
+ toolName: string;
51379
+ };
51380
+ AgentEnsureCapabilityChange: {
51381
+ /**
51382
+ * @description What this converge did (on a dry run, would do) to the capability.
51383
+ * @enum {string}
51384
+ */
51385
+ action: "add" | "update" | "remove" | "unchanged";
51386
+ enabled: boolean;
51387
+ /** @enum {string|null} */
51388
+ kind: "flow" | "agent" | "tool" | null;
51389
+ /** @description The flow, agent or tool name the capability calls. */
51390
+ source: string | null;
51391
+ toolName: string;
51392
+ };
50672
51393
  AgentEnsureConflict: {
50673
51394
  /** @enum {string} */
50674
51395
  code: "external_modification" | "remote_changed";
@@ -50689,6 +51410,10 @@ interface components {
50689
51410
  AgentEnsureDeployment: {
50690
51411
  /** @description The release alias this converge aimed. */
50691
51412
  alias: string;
51413
+ /** @description Per-alias secret binding names in force after this converge (on a dry run carrying deploy.bindings, the names it would leave in force). Never values. */
51414
+ bindingNames?: string[];
51415
+ /** @description Present on a dry run carrying deploy.bindings: whether the binding names differ from the ones the alias carries now. */
51416
+ bindingsChanged?: boolean;
50692
51417
  /** @description Whether this converge moved the pointer (on a dry run, whether it would move it). */
50693
51418
  changed: boolean;
50694
51419
  /** @description The deployment receipt this converge appended. Absent when the pointer did not move. */
@@ -50723,6 +51448,8 @@ interface components {
50723
51448
  };
50724
51449
  AgentEnsureResponse: {
50725
51450
  agentId: string;
51451
+ /** @description Present when the request carried capabilities: one row per declared capability, then removals. */
51452
+ capabilityChanges?: components["schemas"]["AgentEnsureCapabilityChange"][];
50726
51453
  /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
50727
51454
  contentHash: string;
50728
51455
  deployment?: components["schemas"]["AgentEnsureDeployment"];
@@ -50730,6 +51457,8 @@ interface components {
50730
51457
  remoteHash?: string;
50731
51458
  /** @enum {string} */
50732
51459
  result: "unchanged" | "created" | "updated";
51460
+ /** @description Present when the request carried skills: one row per declared binding, then unbinds. */
51461
+ skillBindings?: components["schemas"]["AgentEnsureSkillBindingChange"][];
50733
51462
  /** @description The version snapshot backing this state (null if snapshotting failed). */
50734
51463
  versionId: string | null;
50735
51464
  } | {
@@ -50737,6 +51466,8 @@ interface components {
50737
51466
  result: "definitionRequired";
50738
51467
  } | {
50739
51468
  agentId?: string;
51469
+ /** @description Present when the request carried capabilities: one row per declared capability, then removals. */
51470
+ capabilityChanges?: components["schemas"]["AgentEnsureCapabilityChange"][];
50740
51471
  changedKeys: string[];
50741
51472
  /** @enum {string} */
50742
51473
  changes: "none" | "create" | "update";
@@ -50745,6 +51476,8 @@ interface components {
50745
51476
  remoteHash?: string;
50746
51477
  /** @enum {string} */
50747
51478
  result: "plan";
51479
+ /** @description Present when the request carried skills: one row per declared binding, then unbinds. */
51480
+ skillBindings?: components["schemas"]["AgentEnsureSkillBindingChange"][];
50748
51481
  };
50749
51482
  AgentEnsureServerError: {
50750
51483
  /** @description The release alias whose activation failed. No pointer was moved. */
@@ -50753,8 +51486,31 @@ interface components {
50753
51486
  code?: "alias_activation_failed";
50754
51487
  error: string;
50755
51488
  };
51489
+ AgentEnsureSkillBinding: {
51490
+ /** @description Defaults to true. */
51491
+ enabled?: boolean;
51492
+ /** @description The skill slug. */
51493
+ name: string;
51494
+ /** @description Pin this skill versionNumber. Omit to follow the skill's published version. */
51495
+ version?: number;
51496
+ };
51497
+ AgentEnsureSkillBindingChange: {
51498
+ /**
51499
+ * @description What this converge did (on a dry run, would do) to the binding.
51500
+ * @enum {string}
51501
+ */
51502
+ action: "bind" | "update" | "unbind" | "unchanged";
51503
+ enabled: boolean;
51504
+ /** @description The skill slug. */
51505
+ name: string;
51506
+ skillId: string;
51507
+ /** @description The pinned versionNumber; null follows the published version. */
51508
+ version: number | null;
51509
+ };
50756
51510
  AgentPullResponse: {
50757
51511
  agentId: string;
51512
+ /** @description The agent's capabilities in display order, in the shape ensure's capabilities accepts. parametersSchema appears only when it differs from the one ensure would derive. */
51513
+ capabilities: components["schemas"]["AgentEnsureCapability"][];
50758
51514
  contentHash: string;
50759
51515
  definition: {
50760
51516
  config?: {
@@ -51005,6 +51761,11 @@ interface components {
51005
51761
  };
51006
51762
  };
51007
51763
  toolIds?: string[];
51764
+ toolSearch?: {
51765
+ alwaysLoaded?: string[];
51766
+ enabled?: boolean;
51767
+ threshold?: number;
51768
+ };
51008
51769
  };
51009
51770
  topK?: number;
51010
51771
  topP?: number;
@@ -51050,6 +51811,8 @@ interface components {
51050
51811
  name: string;
51051
51812
  };
51052
51813
  lastModifiedSource: string | null;
51814
+ /** @description The agent's skill bindings in load order, in the shape ensure's skills accepts. */
51815
+ skills: components["schemas"]["AgentEnsureSkillBinding"][];
51053
51816
  updatedAt: string | null;
51054
51817
  versionId: string | null;
51055
51818
  /** @description Present only when a raw tool_… reference could not be emitted as a portable tool:<name> (the tool was deleted, or its name is shadowed by an older same-named tool). Those references are left as raw ids, which the ensure surface rejects; each warning explains how to fix it. */
@@ -51236,6 +51999,57 @@ interface components {
51236
51999
  /** @enum {string} */
51237
52000
  status: "pending" | "applied" | "settled" | "not_applied";
51238
52001
  };
52002
+ CollectionEnsureConflict: {
52003
+ /** @enum {string} */
52004
+ code: "external_modification" | "remote_changed";
52005
+ currentHash?: string | null;
52006
+ error: string;
52007
+ lastModifiedSource?: string;
52008
+ modifiedAt?: string | null;
52009
+ };
52010
+ CollectionEnsureHashMismatch: {
52011
+ /** @enum {string} */
52012
+ code: "content_hash_mismatch";
52013
+ /** @description The server-computed canonical hash of the submitted definition. */
52014
+ contentHash: string;
52015
+ error: string;
52016
+ };
52017
+ CollectionEnsureResponse: {
52018
+ collectionId: string;
52019
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
52020
+ contentHash: string;
52021
+ /** @description Present when this ensure moved validationMode to enforce: a bounded dry-run of existing records against the schema, as PATCH reports. */
52022
+ enforceCheck?: {
52023
+ checked: number;
52024
+ failed: number;
52025
+ truncated: boolean;
52026
+ };
52027
+ /** @enum {string} */
52028
+ result: "unchanged" | "created" | "updated";
52029
+ schemaChange?: {
52030
+ breakingChanges: string[];
52031
+ /** @enum {string} */
52032
+ kind: "additive" | "breaking";
52033
+ };
52034
+ } | {
52035
+ /** @enum {string} */
52036
+ result: "definitionRequired";
52037
+ } | {
52038
+ changedKeys: string[];
52039
+ /** @enum {string} */
52040
+ changes: "none" | "create" | "update";
52041
+ collectionId?: string;
52042
+ contentHash: string;
52043
+ remoteHash?: string;
52044
+ /** @enum {string} */
52045
+ result: "plan";
52046
+ /** @description How the schema would change. A breaking change is rejected when the resulting validationMode is enforce. */
52047
+ schemaChange?: {
52048
+ breakingChanges: string[];
52049
+ /** @enum {string} */
52050
+ kind: "additive" | "breaking";
52051
+ };
52052
+ };
51239
52053
  CollectionLookupFailedError: {
51240
52054
  /** @enum {string} */
51241
52055
  code: "COLLECTION_LOOKUP_FAILED";
@@ -51246,6 +52060,24 @@ interface components {
51246
52060
  recordId?: string;
51247
52061
  recordName?: string;
51248
52062
  };
52063
+ CollectionPullResponse: {
52064
+ collectionId: string;
52065
+ contentHash: string;
52066
+ definition: {
52067
+ description: string | null;
52068
+ displayName: string;
52069
+ icon: string | null;
52070
+ /** @description Constrained JSON Schema dialect: root object with string/number/boolean/array/object properties, one nesting level, no $ref/oneOf/pattern */
52071
+ schema: {
52072
+ [key: string]: unknown;
52073
+ } | null;
52074
+ slug: string;
52075
+ /** @enum {string} */
52076
+ validationMode: "off" | "warn" | "enforce";
52077
+ };
52078
+ lastModifiedSource: string | null;
52079
+ updatedAt: string | null;
52080
+ };
51249
52081
  ContextBlocks: {
51250
52082
  blocks: {
51251
52083
  /** @description The block text, scrubbed of secrets. */
@@ -51706,6 +52538,11 @@ interface components {
51706
52538
  };
51707
52539
  };
51708
52540
  toolIds?: string[];
52541
+ toolSearch?: {
52542
+ alwaysLoaded?: string[];
52543
+ enabled?: boolean;
52544
+ threshold?: number;
52545
+ } | null;
51709
52546
  };
51710
52547
  topK?: number;
51711
52548
  topP?: number;
@@ -51829,7 +52666,12 @@ interface components {
51829
52666
  };
51830
52667
  DispatchAgentJsonResponse: {
51831
52668
  agentExecutionId?: string;
51832
- /** @description The published agent version the run executed. Absent when no stored version ran. */
52669
+ /**
52670
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
52671
+ * @enum {string}
52672
+ */
52673
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
52674
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
51833
52675
  agentVersionId?: string;
51834
52676
  /** @description The release alias (for example `live`) the version was resolved through, when one was. */
51835
52677
  alias?: string;
@@ -51889,6 +52731,15 @@ interface components {
51889
52731
  status: "running";
51890
52732
  };
51891
52733
  DispatchDetachedToolOutputJsonResponse: {
52734
+ /**
52735
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
52736
+ * @enum {string}
52737
+ */
52738
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
52739
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
52740
+ agentVersionId?: string;
52741
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
52742
+ alias?: string;
51892
52743
  executionId: string;
51893
52744
  /** @enum {string} */
51894
52745
  pauseKind: "client_tool" | "elicitation";
@@ -51939,6 +52790,15 @@ interface components {
51939
52790
  };
51940
52791
  DispatchResumeJsonResponse: components["schemas"]["DispatchToolOutputContinuationJsonResponse"] | components["schemas"]["DispatchDetachedToolOutputJsonResponse"];
51941
52792
  DispatchToolOutputContinuationJsonResponse: {
52793
+ /**
52794
+ * @description How the run selected its definition: `alias` or `version` for a request that named a selector, `legacy-live-row` for a run that read the mutable agent row. Matches `GET /v1/executions/{executionId}/status`.
52795
+ * @enum {string}
52796
+ */
52797
+ agentTargetResolution?: "alias" | "version" | "legacy-live-row";
52798
+ /** @description The agent version recorded for the run. When `agentTargetResolution` is `legacy-live-row`, this is the version the agent row pointed at, and the run read the mutable row rather than that version. Absent when neither exists. */
52799
+ agentVersionId?: string;
52800
+ /** @description The release alias (for example `live`) the version was resolved through, when one was. */
52801
+ alias?: string;
51942
52802
  blockReason?: string;
51943
52803
  code?: string;
51944
52804
  error?: string;
@@ -52148,6 +53008,14 @@ interface components {
52148
53008
  name: string;
52149
53009
  }[];
52150
53010
  };
53011
+ EvalEnsureConflict: {
53012
+ /** @enum {string} */
53013
+ code: "external_modification" | "remote_changed";
53014
+ currentHash?: string | null;
53015
+ error: string;
53016
+ lastModifiedSource?: string;
53017
+ modifiedAt?: string | null;
53018
+ };
52151
53019
  EvalEnsureResponse: {
52152
53020
  /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
52153
53021
  contentHash: string;
@@ -52157,6 +53025,15 @@ interface components {
52157
53025
  } | {
52158
53026
  /** @enum {string} */
52159
53027
  result: "definitionRequired";
53028
+ } | {
53029
+ changedKeys: string[];
53030
+ /** @enum {string} */
53031
+ changes: "none" | "create" | "update";
53032
+ contentHash: string;
53033
+ remoteHash?: string;
53034
+ /** @enum {string} */
53035
+ result: "plan";
53036
+ suiteId?: string;
52160
53037
  };
52161
53038
  /** @description Canonical eval override field. Replaces `stepOverrides` (and its `"*"` key), `claudeManagedOverride` and `advisorOverride`; setting both spellings of one channel is a 400. */
52162
53039
  EvalOverrides: {
@@ -53182,6 +54059,8 @@ interface components {
53182
54059
  changes: "none" | "create" | "update";
53183
54060
  contentHash: string;
53184
54061
  flowId?: string;
54062
+ /** @description Present when the dry run carried release: "publish": whether the converge would re-aim the published version. */
54063
+ publishPending?: boolean;
53185
54064
  remoteHash?: string;
53186
54065
  /** @enum {string} */
53187
54066
  result: "plan";
@@ -53457,11 +54336,16 @@ interface components {
53457
54336
  /** @description True when one or more entities failed to converge (re-run to self-heal). */
53458
54337
  hasFailures: boolean;
53459
54338
  productId?: string;
54339
+ /** @description dryRun only: the live graph's pull-fpo hash, absent when the product does not exist or the caller cannot read every section. Pass it back as expectedRemoteHash to guard the apply. */
54340
+ remoteHash?: string;
53460
54341
  /**
53461
- * @description `unchanged` when every entity was unchanged, `converged` when at least one was created/updated, `plan` for dryRun.
54342
+ * @description `unchanged` when every entity was unchanged (a matching hash-only probe reports no entities), `converged` when at least one was created/updated, `plan` for dryRun.
53462
54343
  * @enum {string}
53463
54344
  */
53464
54345
  result: "unchanged" | "converged" | "plan";
54346
+ } | {
54347
+ /** @enum {string} */
54348
+ result: "definitionRequired";
53465
54349
  };
53466
54350
  ProductFpoPullResponse: {
53467
54351
  /** @description Server-computed canonical whole-FPO content hash. */
@@ -53512,6 +54396,7 @@ interface components {
53512
54396
  productGoal?: string;
53513
54397
  /** @enum {string} */
53514
54398
  productStage?: "idea" | "prototype" | "beta" | "production" | "scaling";
54399
+ stack?: components["schemas"]["ProductStack"];
53515
54400
  targetAudience?: string;
53516
54401
  techStack?: {
53517
54402
  backend?: string[];
@@ -53567,11 +54452,52 @@ interface components {
53567
54452
  currentVersionId: string | null;
53568
54453
  description: string | null;
53569
54454
  id: string;
54455
+ /** @description The surface that last wrote the set; `sdk` or `terraform` means it is managed by code through ensure. */
54456
+ lastModifiedSource?: string | null;
53570
54457
  name: string;
53571
54458
  organizationId: string;
53572
54459
  slug: string;
53573
54460
  updatedAt: string;
53574
54461
  };
54462
+ QuestionSetEnsureConflict: {
54463
+ /** @description external_modification, remote_changed, or a question set code such as QUESTION_SET_SLUG_TAKEN. */
54464
+ code: string;
54465
+ currentHash?: string | null;
54466
+ error: string;
54467
+ lastModifiedSource?: string;
54468
+ modifiedAt?: string | null;
54469
+ };
54470
+ QuestionSetEnsureHashMismatch: {
54471
+ /** @enum {string} */
54472
+ code: "content_hash_mismatch";
54473
+ /** @description The server-computed canonical hash of the submitted definition. */
54474
+ contentHash: string;
54475
+ error: string;
54476
+ };
54477
+ QuestionSetEnsureResponse: {
54478
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
54479
+ contentHash: string;
54480
+ /** @description The version executions resolve when they name none; null until a publish. */
54481
+ publishedVersionNumber: number | null;
54482
+ questionSetId: string;
54483
+ /** @enum {string} */
54484
+ result: "unchanged" | "created" | "updated";
54485
+ /** @description The latest version, which the converged definition matches. */
54486
+ versionId: string | null;
54487
+ versionNumber: number | null;
54488
+ } | {
54489
+ /** @enum {string} */
54490
+ result: "definitionRequired";
54491
+ } | {
54492
+ changedKeys: string[];
54493
+ /** @enum {string} */
54494
+ changes: "none" | "create" | "update";
54495
+ contentHash: string;
54496
+ questionSetId?: string;
54497
+ remoteHash?: string;
54498
+ /** @enum {string} */
54499
+ result: "plan";
54500
+ };
53575
54501
  QuestionSetError: components["schemas"]["Error"] & {
53576
54502
  /** @description Stable code, e.g. QUESTION_SET_INVALID or QUESTION_SET_UNRESOLVED. */
53577
54503
  code?: string;
@@ -53580,6 +54506,26 @@ interface components {
53580
54506
  currentVersionNumber: number | null;
53581
54507
  latestVersionNumber: number;
53582
54508
  };
54509
+ QuestionSetPullResponse: {
54510
+ contentHash: string;
54511
+ definition: {
54512
+ description?: string | null;
54513
+ inputMapping?: {
54514
+ [key: string]: string;
54515
+ } | null;
54516
+ model?: string | null;
54517
+ name: string;
54518
+ questions: {
54519
+ [key: string]: unknown;
54520
+ };
54521
+ slug: string;
54522
+ };
54523
+ lastModifiedSource: string | null;
54524
+ publishedVersionNumber: number | null;
54525
+ questionSetId: string;
54526
+ updatedAt: string | null;
54527
+ versionNumber: number | null;
54528
+ };
53583
54529
  QuestionSetVersion: {
53584
54530
  createdAt: string;
53585
54531
  createdByUserId: string | null;
@@ -53881,6 +54827,84 @@ interface components {
53881
54827
  kind: string;
53882
54828
  reason: string;
53883
54829
  };
54830
+ ScheduleEnsureConflict: {
54831
+ /** @enum {string} */
54832
+ code: "external_modification" | "remote_changed";
54833
+ currentHash?: string | null;
54834
+ error: string;
54835
+ lastModifiedSource?: string;
54836
+ modifiedAt?: string | null;
54837
+ };
54838
+ ScheduleEnsureDefinition: {
54839
+ /** @description Omit to leave the current paused/active state untouched; new schedules start enabled. */
54840
+ enabled?: boolean;
54841
+ executionOptions?: {
54842
+ chunkSize?: number;
54843
+ flowTimeoutMs?: number;
54844
+ /** @enum {string} */
54845
+ loggingPolicy?: "default" | "on" | "off";
54846
+ maxRetries?: number;
54847
+ modelOverride?: string;
54848
+ progressFlushSize?: number;
54849
+ recordConcurrency?: number;
54850
+ skipCacheWarm?: boolean;
54851
+ stepTimeoutMs?: number;
54852
+ timeoutMs?: number;
54853
+ };
54854
+ inputs?: {
54855
+ [key: string]: unknown;
54856
+ };
54857
+ messages?: {
54858
+ [key: string]: unknown;
54859
+ }[];
54860
+ name: string;
54861
+ recordFilter?: {
54862
+ [key: string]: unknown;
54863
+ };
54864
+ recordIds?: string[];
54865
+ recordType?: string;
54866
+ target: components["schemas"]["ScheduleEnsureTarget"];
54867
+ trigger: {
54868
+ cron?: string;
54869
+ /** Format: date-time */
54870
+ runAt?: string;
54871
+ timezone?: string;
54872
+ /** @enum {string} */
54873
+ type: "recurring" | "one_time";
54874
+ };
54875
+ };
54876
+ ScheduleEnsureHashMismatch: {
54877
+ /** @enum {string} */
54878
+ code: "content_hash_mismatch";
54879
+ /** @description The server-computed canonical hash of the submitted definition. */
54880
+ contentHash: string;
54881
+ error: string;
54882
+ };
54883
+ ScheduleEnsureResponse: {
54884
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
54885
+ contentHash: string;
54886
+ /** @enum {string} */
54887
+ result: "unchanged" | "created" | "updated";
54888
+ scheduleId: string;
54889
+ } | {
54890
+ /** @enum {string} */
54891
+ result: "definitionRequired";
54892
+ } | {
54893
+ changedKeys: string[];
54894
+ /** @enum {string} */
54895
+ changes: "none" | "create" | "update";
54896
+ contentHash: string;
54897
+ remoteHash?: string;
54898
+ /** @enum {string} */
54899
+ result: "plan";
54900
+ scheduleId?: string;
54901
+ };
54902
+ ScheduleEnsureTarget: {
54903
+ agentId?: string;
54904
+ agentName?: string;
54905
+ flowId?: string;
54906
+ flowName?: string;
54907
+ };
53884
54908
  ScheduleEntitlementError: components["schemas"]["Error"] & {
53885
54909
  /** @description Stable error code (e.g. ACTIVE_SCHEDULE_LIMIT, SCHEDULE_FREQUENCY_LIMIT). */
53886
54910
  code?: string;
@@ -53889,6 +54913,13 @@ interface components {
53889
54913
  /** @description Dashboard-relative URL to the billing/upgrade page. */
53890
54914
  upgradeUrl?: string;
53891
54915
  };
54916
+ SchedulePullResponse: {
54917
+ contentHash: string;
54918
+ definition: components["schemas"]["ScheduleEnsureDefinition"];
54919
+ lastModifiedSource: string | null;
54920
+ scheduleId: string;
54921
+ updatedAt: string | null;
54922
+ };
53892
54923
  ScheduleRunLink: {
53893
54924
  /** @description The agent_executions ROW id the scheduled run stored. Provenance only: a different id space from executionId, and never a /v1/runs key. */
53894
54925
  agentExecutionRowId: string | null;
@@ -54010,13 +55041,15 @@ interface components {
54010
55041
  };
54011
55042
  /** @enum {string} */
54012
55043
  environment?: "production" | "development";
55044
+ /** @description Inbound channel config. Omit to keep the stored value; null clears it. A credential value of "<redacted>" (as returned by pull) keeps the stored credential. */
54013
55045
  inbound?: {
54014
55046
  [key: string]: unknown;
54015
- };
55047
+ } | null;
54016
55048
  name: string;
55049
+ /** @description Outbound channel config. Omit to keep the stored value; null clears it. A credential value of "<redacted>" (as returned by pull) keeps the stored credential. */
54017
55050
  outbound?: {
54018
55051
  [key: string]: unknown;
54019
- };
55052
+ } | null;
54020
55053
  /** @enum {string} */
54021
55054
  status?: "draft" | "active" | "paused";
54022
55055
  /** @enum {string} */
@@ -56955,14 +57988,14 @@ export interface ScheduleMessageSet {
56955
57988
  messages: ScheduleMessage[];
56956
57989
  }
56957
57990
  export type ScheduleMessages = ScheduleMessage[] | ScheduleMessageSet[];
56958
- export interface ScheduleTarget {
57991
+ interface ScheduleTarget$1 {
56959
57992
  flowId?: string;
56960
57993
  agentId?: string;
56961
57994
  recordIds?: string[];
56962
57995
  recordType?: string;
56963
57996
  recordFilter?: JsonValue | null;
56964
57997
  }
56965
- export interface ScheduleTrigger {
57998
+ interface ScheduleTrigger$1 {
56966
57999
  type: 'one_time' | 'recurring';
56967
58000
  /** ISO 8601 datetime — required for `one_time` triggers. */
56968
58001
  runAt?: string;
@@ -56978,8 +58011,8 @@ export interface ScheduleTrigger {
56978
58011
  */
56979
58012
  export type Schedule = paths['/v1/schedules/{id}']['get']['responses'][200]['content']['application/json'];
56980
58013
  export interface CreateScheduleRequest {
56981
- target: ScheduleTarget;
56982
- trigger: ScheduleTrigger;
58014
+ target: ScheduleTarget$1;
58015
+ trigger: ScheduleTrigger$1;
56983
58016
  messages?: ScheduleMessages | null;
56984
58017
  executionOptions?: ScheduleExecutionOptions;
56985
58018
  /** Top-level input variables; keys must not start with `_`. */
@@ -57920,6 +58953,54 @@ interface EnsureEvalResult {
57920
58953
  /** The server-computed canonical hash (echo this — never your own). */
57921
58954
  contentHash: string;
57922
58955
  }
58956
+ /** The dry-run outcome of `client.evals.ensure(definition, { dryRun: true })`. */
58957
+ interface EnsureEvalPlan {
58958
+ result: 'plan';
58959
+ changes: 'none' | 'create' | 'update';
58960
+ /** Coarse keys that differ: `target`, `cases`, `recordedToolMode`, `recordedToolUnmatchedPolicy`. */
58961
+ changedKeys: string[];
58962
+ contentHash: string;
58963
+ /** The live suite's hash, computed over the cases ensure owns; bind an apply to it with `expectedRemoteHash`. */
58964
+ remoteHash?: string;
58965
+ suiteId?: string;
58966
+ }
58967
+ interface EnsureEvalOptions {
58968
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
58969
+ dryRun?: boolean;
58970
+ /**
58971
+ * What to do when the suite's last write came from the dashboard/API rather
58972
+ * than ensure. Default 'error' (HTTP 409 → EvalEnsureConflictError).
58973
+ */
58974
+ onConflict?: 'error' | 'overwrite';
58975
+ /** TOCTOU guard binding a dry run to its apply (409 remote_changed otherwise). */
58976
+ expectedRemoteHash?: string;
58977
+ /** Implies dryRun; throws EvalDriftError unless the plan is 'none'. */
58978
+ expectNoChanges?: boolean;
58979
+ }
58980
+ /** Options for a converging (non-plan) ensure. */
58981
+ type EnsureEvalApplyOptions = Omit<EnsureEvalOptions, 'dryRun' | 'expectNoChanges'> & {
58982
+ dryRun?: false;
58983
+ expectNoChanges?: false;
58984
+ };
58985
+ /** A 409 from the eval ensure protocol (external_modification or remote_changed). */
58986
+ export declare class EvalEnsureConflictError extends Error {
58987
+ readonly code: 'external_modification' | 'remote_changed';
58988
+ readonly lastModifiedSource?: string;
58989
+ readonly modifiedAt?: string | null;
58990
+ readonly currentHash?: string | null;
58991
+ constructor(body: {
58992
+ error?: string;
58993
+ code: 'external_modification' | 'remote_changed';
58994
+ lastModifiedSource?: string;
58995
+ modifiedAt?: string | null;
58996
+ currentHash?: string | null;
58997
+ });
58998
+ }
58999
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
59000
+ export declare class EvalDriftError extends Error {
59001
+ readonly plan: EnsureEvalPlan;
59002
+ constructor(plan: EnsureEvalPlan);
59003
+ }
57923
59004
  /** The canonical definition + provenance returned by `client.evals.pull(name)`. */
57924
59005
  interface EvalPullResult {
57925
59006
  suiteId: string;
@@ -58124,15 +59205,17 @@ type RunEvalInput = {
58124
59205
  };
58125
59206
  /**
58126
59207
  * Idempotently converge an eval suite definition onto the platform. Hash-first:
58127
- * probes with a content hash, and only ships the full definition when the
58128
- * server reports a miss (`definitionRequired`). Upserts the suite + replaces
58129
- * its cases; never executes the eval (use the `runtype eval` CLI / `/eval`
58130
- * submit surface to run it).
58131
- *
58132
- * `virtual: true` definitions are ephemeral and have nothing durable to
58133
- * converge — ensure rejects them. Run a virtual eval directly instead.
59208
+ * probes with a content hash, and only ships the full definition on a miss.
59209
+ * Replaces only the cases ensure owns: cases saved from runs or added in the
59210
+ * dashboard survive. Never executes the eval. Virtual evals cannot be ensured.
58134
59211
  */
58135
- export declare function ensureEval(client: RuntypeClient$1, definition: EvalDefinition): Promise<EnsureEvalResult>;
59212
+ export declare function ensureEval(client: RuntypeClient$1, definition: EvalDefinition, options: EnsureEvalOptions & ({
59213
+ dryRun: true;
59214
+ } | {
59215
+ expectNoChanges: true;
59216
+ })): Promise<EnsureEvalPlan>;
59217
+ export declare function ensureEval(client: RuntypeClient$1, definition: EvalDefinition, options?: EnsureEvalApplyOptions): Promise<EnsureEvalResult>;
59218
+ export declare function ensureEval(client: RuntypeClient$1, definition: EvalDefinition, options?: EnsureEvalOptions): Promise<EnsureEvalResult | EnsureEvalPlan>;
58136
59219
  /**
58137
59220
  * Pull the canonical definition + provenance for an eval suite by name — the
58138
59221
  * absorb-drift direction of the ensure protocol. The contentHash reflects the
@@ -58232,6 +59315,7 @@ interface EnsureFlowOptions {
58232
59315
  /**
58233
59316
  * What to do when the flow's last write came from the dashboard/API
58234
59317
  * rather than ensure. Default 'error' (HTTP 409 → FlowEnsureConflictError).
59318
+ * Also applies to the flow's inline evals (409 → EvalEnsureConflictError).
58235
59319
  */
58236
59320
  onConflict?: 'error' | 'overwrite';
58237
59321
  /** 'publish' also re-aims the published-version pointer. Default 'none'. */
@@ -58247,7 +59331,10 @@ interface EnsureFlowOptions {
58247
59331
  * server-generated notes.
58248
59332
  */
58249
59333
  version?: components['schemas']['EnsureVersionMetadata'];
58250
- /** Implies dryRun; throws FlowDriftError unless the plan is 'none'. */
59334
+ /**
59335
+ * Implies dryRun; throws FlowDriftError unless the plan is 'none' and, with
59336
+ * `release: 'publish'`, no publish is pending.
59337
+ */
58251
59338
  expectNoChanges?: boolean;
58252
59339
  }
58253
59340
  interface EnsureFlowConverged {
@@ -58272,6 +59359,8 @@ interface EnsureFlowPlan {
58272
59359
  contentHash: string;
58273
59360
  remoteHash?: string;
58274
59361
  flowId?: string;
59362
+ /** Present when the dry run carried `release: 'publish'`: whether it would re-aim the published version. */
59363
+ publishPending?: boolean;
58275
59364
  }
58276
59365
  type EnsureFlowResult = EnsureFlowConverged | EnsureFlowPlan;
58277
59366
  interface FlowPullResult {
@@ -58896,7 +59985,7 @@ interface EvalSuiteDetail extends EvalSuiteSummary {
58896
59985
  } | null;
58897
59986
  }
58898
59987
  /** Case provenance (mirror of `EvalCaseOrigin` in `@runtypelabs/shared`). */
58899
- type EvalCaseOrigin = 'manual' | 'saved_from_run' | 'generated' | 'imported' | 'fpo';
59988
+ type EvalCaseOrigin = 'manual' | 'saved_from_run' | 'generated' | 'imported' | 'fpo' | 'ensure';
58900
59989
  /** One case to create. */
58901
59990
  interface EvalSuiteCaseInput {
58902
59991
  name: string;
@@ -59427,7 +60516,9 @@ export declare class EvalsNamespace {
59427
60516
  * Idempotently converge a `defineEval` suite definition onto the platform —
59428
60517
  * the deploy-time, non-executing converge for code-colocated evals. Hash-first:
59429
60518
  * the steady state is one tiny probe request. Upserts the eval suite + replaces
59430
- * its cases; never runs the eval.
60519
+ * the cases ensure owns (captured and dashboard cases survive); never runs the
60520
+ * eval. `dryRun` / `expectNoChanges` plan without writing; a dashboard edit
60521
+ * answers 409 unless `onConflict: 'overwrite'`.
59431
60522
  *
59432
60523
  * @example
59433
60524
  * ```typescript
@@ -59439,7 +60530,13 @@ export declare class EvalsNamespace {
59439
60530
  * const result = await Runtype.evals.ensure(suite)
59440
60531
  * ```
59441
60532
  */
59442
- ensure(definition: EvalDefinition): Promise<EnsureEvalResult>;
60533
+ ensure(definition: EvalDefinition, options: EnsureEvalOptions & ({
60534
+ dryRun: true;
60535
+ } | {
60536
+ expectNoChanges: true;
60537
+ })): Promise<EnsureEvalPlan>;
60538
+ ensure(definition: EvalDefinition, options?: EnsureEvalApplyOptions): Promise<EnsureEvalResult>;
60539
+ ensure(definition: EvalDefinition, options?: EnsureEvalOptions): Promise<EnsureEvalResult | EnsureEvalPlan>;
59443
60540
  /**
59444
60541
  * Pull the canonical definition + provenance for an eval suite by name — the
59445
60542
  * absorb-drift direction of the ensure protocol.
@@ -59762,6 +60859,12 @@ interface EnsureSkillOptions {
59762
60859
  * remote still hashes to this value (409 remote_changed otherwise).
59763
60860
  */
59764
60861
  expectedRemoteHash?: string;
60862
+ /**
60863
+ * Provenance stamped on the version row this converge appends (a git SHA, a
60864
+ * release tag). Omit to keep the default 'sdk-ensure' label and the
60865
+ * server-generated notes.
60866
+ */
60867
+ version?: components['schemas']['EnsureVersionMetadata'];
59765
60868
  /** Implies dryRun; throws SkillDriftError unless the plan is 'none'. */
59766
60869
  expectNoChanges?: boolean;
59767
60870
  }
@@ -59905,7 +61008,7 @@ interface SkillVersion {
59905
61008
  createdAt: string;
59906
61009
  }
59907
61010
  /** An agent ↔ skill binding row. */
59908
- interface AgentSkillBinding {
61011
+ interface AgentSkillBinding$1 {
59909
61012
  id: string;
59910
61013
  agentId: string;
59911
61014
  skillId: string;
@@ -59920,7 +61023,7 @@ interface AgentSkillBinding {
59920
61023
  * {@link SkillsNamespace.listBindingsForSkill}, the by-skill twin of
59921
61024
  * {@link SkillsNamespace.listBindings}.
59922
61025
  */
59923
- interface SkillBindingWithAgent extends AgentSkillBinding {
61026
+ interface SkillBindingWithAgent extends AgentSkillBinding$1 {
59924
61027
  agent: {
59925
61028
  id: string;
59926
61029
  name: string;
@@ -60188,7 +61291,7 @@ export declare class SkillsNamespace {
60188
61291
  * Bind a skill to an agent. Both the agent and the skill must be owned by the
60189
61292
  * caller.
60190
61293
  */
60191
- bind(input: BindSkillInput): Promise<AgentSkillBinding>;
61294
+ bind(input: BindSkillInput): Promise<AgentSkillBinding$1>;
60192
61295
  /**
60193
61296
  * Remove a skill binding by its binding id.
60194
61297
  */
@@ -60201,7 +61304,7 @@ export declare class SkillsNamespace {
60201
61304
  * const bindings = await Runtype.skills.listBindings('agent_123')
60202
61305
  * ```
60203
61306
  */
60204
- listBindings(agentId: string): Promise<AgentSkillBinding[]>;
61307
+ listBindings(agentId: string): Promise<AgentSkillBinding$1[]>;
60205
61308
  /**
60206
61309
  * List every agent a skill is bound to, each row joined with the agent's name
60207
61310
  * and type. The by-agent twin is {@link listBindings}.
@@ -60532,6 +61635,11 @@ interface AgentDefinitionConfig {
60532
61635
  }>;
60533
61636
  subagentConfig?: Record<string, unknown>;
60534
61637
  codeModeConfig?: Record<string, unknown>;
61638
+ toolSearch?: {
61639
+ enabled?: boolean;
61640
+ threshold?: number;
61641
+ alwaysLoaded?: string[];
61642
+ };
60535
61643
  };
60536
61644
  artifacts?: {
60537
61645
  enabled: true;
@@ -60661,8 +61769,61 @@ interface EnsureAgentOptions {
60661
61769
  * server-generated notes.
60662
61770
  */
60663
61771
  version?: components['schemas']['EnsureVersionMetadata'];
60664
- /** Implies dryRun; throws AgentDriftError unless the plan is 'none'. */
61772
+ /**
61773
+ * Implies dryRun; throws AgentDriftError unless the plan is 'none', no skill
61774
+ * binding would change and, with `release` or `deploy`, the alias would not move.
61775
+ */
60665
61776
  expectNoChanges?: boolean;
61777
+ /**
61778
+ * The complete set of skills bound to the agent, in load order. `version`
61779
+ * pins a skill versionNumber; omit it to follow the published version.
61780
+ * Bound skills absent here are unbound; omit the option to leave bindings alone.
61781
+ */
61782
+ skills?: AgentSkillBinding[];
61783
+ /**
61784
+ * The complete set of capabilities (flow, sub-agent and saved-tool
61785
+ * attachments) in display order. Capabilities absent here are removed; omit
61786
+ * the option to leave them alone. When present they are part of the content hash.
61787
+ */
61788
+ capabilities?: AgentCapabilityDeclaration[];
61789
+ }
61790
+ /** @example `{ toolName: 'lookup_order', flow: 'Order Lookup' }` attaches the flow named "Order Lookup". */
61791
+ interface AgentCapabilityDeclaration {
61792
+ /** The name the agent calls this capability by. */
61793
+ toolName: string;
61794
+ /** Exactly one of `flow`, `agent` or `tool`: the source's name in this account. */
61795
+ flow?: string;
61796
+ agent?: string;
61797
+ tool?: string;
61798
+ description?: string;
61799
+ /** Omit to derive it from the flow's inputs or the tool's own schema. */
61800
+ parametersSchema?: Record<string, unknown>;
61801
+ enabled?: boolean;
61802
+ }
61803
+ /** What one ensure did (or, on a dry run, would do) to a declared or removed capability. */
61804
+ interface AgentCapabilityChange {
61805
+ toolName: string;
61806
+ action: 'add' | 'update' | 'remove' | 'unchanged';
61807
+ kind: 'flow' | 'agent' | 'tool' | null;
61808
+ /** The flow, agent or tool name the capability calls. */
61809
+ source: string | null;
61810
+ enabled: boolean;
61811
+ }
61812
+ /** @example `{ name: 'refund-policy', version: 3 }` pins version 3; `{ name: 'tone-guide' }` follows published. */
61813
+ interface AgentSkillBinding {
61814
+ /** The skill slug. */
61815
+ name: string;
61816
+ version?: number;
61817
+ enabled?: boolean;
61818
+ }
61819
+ /** What one ensure did (or, on a dry run, would do) to a declared or removed binding. */
61820
+ interface AgentSkillBindingChange {
61821
+ name: string;
61822
+ skillId: string;
61823
+ action: 'bind' | 'update' | 'unbind' | 'unchanged';
61824
+ /** The pinned versionNumber; null follows the published version. */
61825
+ version: number | null;
61826
+ enabled: boolean;
60666
61827
  }
60667
61828
  interface EnsureAgentConverged {
60668
61829
  result: 'unchanged' | 'created' | 'updated';
@@ -60674,6 +61835,10 @@ interface EnsureAgentConverged {
60674
61835
  remoteHash?: string;
60675
61836
  /** The pointer this converge aimed, present only when it carried release or deploy. */
60676
61837
  deployment?: AgentEnsureDeployment;
61838
+ /** Present when the request carried `skills`. */
61839
+ skillBindings?: AgentSkillBindingChange[];
61840
+ /** Present when the request carried `capabilities`. */
61841
+ capabilityChanges?: AgentCapabilityChange[];
60677
61842
  }
60678
61843
  interface EnsureAgentPlan {
60679
61844
  result: 'plan';
@@ -60684,6 +61849,10 @@ interface EnsureAgentPlan {
60684
61849
  agentId?: string;
60685
61850
  /** The pointer this dry run would aim, and whether it would move. */
60686
61851
  deployment?: AgentEnsureDeployment;
61852
+ /** Present when the request carried `skills`. */
61853
+ skillBindings?: AgentSkillBindingChange[];
61854
+ /** Present when the request carried `capabilities`. */
61855
+ capabilityChanges?: AgentCapabilityChange[];
60687
61856
  }
60688
61857
  type EnsureAgentResult = EnsureAgentConverged | EnsureAgentPlan;
60689
61858
  interface AgentPullResult {
@@ -60700,6 +61869,10 @@ interface AgentPullResult {
60700
61869
  * `defineAgent`/`ensure` reject — so each warning explains how to fix it.
60701
61870
  */
60702
61871
  warnings?: string[];
61872
+ /** The agent's skill bindings, ready to pass back as the `skills` ensure option. */
61873
+ skills: AgentSkillBinding[];
61874
+ /** The agent's capabilities, ready to pass back as the `capabilities` ensure option. */
61875
+ capabilities: AgentCapabilityDeclaration[];
60703
61876
  }
60704
61877
  /** A 409 from the ensure protocol (external_modification or remote_changed). */
60705
61878
  export declare class AgentEnsureConflictError extends Error {
@@ -61082,6 +62255,115 @@ export declare class ToolsNamespace {
61082
62255
  pull(name: string): Promise<ToolPullResult>;
61083
62256
  }
61084
62257
  //#endregion
62258
+ //#region src/question-sets-ensure.d.ts
62259
+ /** A question set declared in code. `slug` is its identity within the organization. */
62260
+ interface QuestionSetDefinition {
62261
+ slug: string;
62262
+ name: string;
62263
+ description?: string | null;
62264
+ /** Judgment questions keyed by question id, e.g. `{ urgent: { type: 'boolean', instructions: '...' } }`. */
62265
+ questions: Record<string, unknown>;
62266
+ inputMapping?: Record<string, string> | null;
62267
+ model?: string | null;
62268
+ }
62269
+ /** Canonical form of a question set definition, without its slug. */
62270
+ export declare function normalizeQuestionSetDefinition(definition: QuestionSetDefinition): Record<string, unknown>;
62271
+ /** SHA-256 (hex) over the canonical question set definition. */
62272
+ export declare function computeQuestionSetContentHash(definition: QuestionSetDefinition): Promise<string>;
62273
+ /**
62274
+ * Pure local constructor for a question set definition. Checks the structure
62275
+ * and rejects unknown fields; the server validates the questions at ensure time.
62276
+ *
62277
+ * @example
62278
+ * ```typescript
62279
+ * const triage = defineQuestionSet({
62280
+ * slug: 'ticket-triage',
62281
+ * name: 'Ticket triage',
62282
+ * questions: { urgent: { type: 'boolean', instructions: 'Is the ticket urgent?' } },
62283
+ * })
62284
+ * ```
62285
+ */
62286
+ export declare function defineQuestionSet(input: QuestionSetDefinition): QuestionSetDefinition;
62287
+ interface EnsureQuestionSetOptions {
62288
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
62289
+ dryRun?: boolean;
62290
+ /** What to do when the last write came from the dashboard or API. Default 'error' (409). */
62291
+ onConflict?: 'error' | 'overwrite';
62292
+ /** 'publish' makes the latest version the one executions resolve. Default 'none'. */
62293
+ release?: 'none' | 'publish';
62294
+ /** Apply only if the remote still hashes to this value (409 remote_changed otherwise). */
62295
+ expectedRemoteHash?: string;
62296
+ /** Implies dryRun; throws QuestionSetDriftError unless the plan is 'none'. */
62297
+ expectNoChanges?: boolean;
62298
+ }
62299
+ interface EnsureQuestionSetConverged {
62300
+ result: 'unchanged' | 'created' | 'updated';
62301
+ questionSetId: string;
62302
+ versionId: string | null;
62303
+ versionNumber: number | null;
62304
+ publishedVersionNumber: number | null;
62305
+ /** The server-computed canonical hash; echo this one, never your own. */
62306
+ contentHash: string;
62307
+ }
62308
+ interface EnsureQuestionSetPlan {
62309
+ result: 'plan';
62310
+ changes: 'none' | 'create' | 'update';
62311
+ changedKeys: string[];
62312
+ contentHash: string;
62313
+ remoteHash?: string;
62314
+ questionSetId?: string;
62315
+ }
62316
+ type EnsureQuestionSetResult = EnsureQuestionSetConverged | EnsureQuestionSetPlan;
62317
+ interface QuestionSetPullResult {
62318
+ questionSetId: string;
62319
+ definition: QuestionSetDefinition;
62320
+ contentHash: string;
62321
+ lastModifiedSource: string | null;
62322
+ updatedAt: string | null;
62323
+ versionNumber: number | null;
62324
+ publishedVersionNumber: number | null;
62325
+ }
62326
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
62327
+ export declare class QuestionSetEnsureConflictError extends Error {
62328
+ readonly code: 'external_modification' | 'remote_changed';
62329
+ readonly lastModifiedSource?: string;
62330
+ readonly modifiedAt?: string | null;
62331
+ readonly currentHash?: string | null;
62332
+ constructor(body: {
62333
+ error?: string;
62334
+ code: 'external_modification' | 'remote_changed';
62335
+ lastModifiedSource?: string;
62336
+ modifiedAt?: string | null;
62337
+ currentHash?: string | null;
62338
+ });
62339
+ }
62340
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when the remote differs. */
62341
+ export declare class QuestionSetDriftError extends Error {
62342
+ readonly plan: EnsureQuestionSetPlan;
62343
+ constructor(slug: string, plan: EnsureQuestionSetPlan);
62344
+ }
62345
+ //#endregion
62346
+ //#region src/question-sets-namespace.d.ts
62347
+ /** Question set config-as-code: `ensure` and `pull`. */
62348
+ export declare class QuestionSetsNamespace {
62349
+ private getClient;
62350
+ constructor(getClient: () => RuntypeClient$1);
62351
+ /**
62352
+ * Converge a `defineQuestionSet` definition. The steady state is one hash
62353
+ * probe. Pass `release: 'publish'` so flows and agents can resolve the
62354
+ * latest version.
62355
+ *
62356
+ * @example
62357
+ * ```typescript
62358
+ * await Runtype.questionSets.ensure(triage, { release: 'publish' })
62359
+ * await Runtype.questionSets.ensure(triage, { expectNoChanges: true })
62360
+ * ```
62361
+ */
62362
+ ensure(definition: QuestionSetDefinition, options?: EnsureQuestionSetOptions): Promise<EnsureQuestionSetResult>;
62363
+ /** Pull the live definition and provenance for a slug, to absorb a dashboard edit. */
62364
+ pull(slug: string): Promise<QuestionSetPullResult>;
62365
+ }
62366
+ //#endregion
61085
62367
  //#region src/products-ensure.d.ts
61086
62368
  /** Canonical normalized form of a product definition (name + canvas excluded). */
61087
62369
  export declare function normalizeProductDefinition(definition: ProductContentInput): {
@@ -61214,6 +62496,28 @@ interface EnsureFpoOptions {
61214
62496
  * plan rows.
61215
62497
  */
61216
62498
  prune?: boolean;
62499
+ /** Implies dryRun; throws FpoDriftError when any entity would be created, updated, pruned or fails. */
62500
+ expectNoChanges?: boolean;
62501
+ /**
62502
+ * TOCTOU guard: pass the dry run's `remoteHash`; the write proceeds only while
62503
+ * the live graph still hashes to it (ProductEnsureConflictError `remote_changed`
62504
+ * otherwise). The hash covers what `pullFpo` reconstructs, so seed records,
62505
+ * schedules and secrets are outside it.
62506
+ */
62507
+ expectedRemoteHash?: string;
62508
+ /**
62509
+ * With `release: 'none'`, send a hash-only probe first and skip the full FPO
62510
+ * when the live graph reconstructs to the same hash. A publishing converge
62511
+ * (the default release) always ships the full FPO, since only it can publish
62512
+ * drafts that are not yet live.
62513
+ */
62514
+ hashProbe?: boolean;
62515
+ /**
62516
+ * Whether converged capability agents and flows go live. The server defaults
62517
+ * to `'publish'` (version, publish and move the agent's `live` alias, as
62518
+ * product creation does); `'none'` saves changes as drafts.
62519
+ */
62520
+ release?: 'none' | 'publish';
61217
62521
  }
61218
62522
  /** One nested entity's converge result. */
61219
62523
  interface FpoEntityOutcome {
@@ -61228,9 +62532,17 @@ interface EnsureFpoResult {
61228
62532
  result: 'unchanged' | 'converged' | 'plan';
61229
62533
  productId?: string;
61230
62534
  contentHash: string;
62535
+ /** dryRun only: the live graph's hash, to pass back as `expectedRemoteHash`. */
62536
+ remoteHash?: string;
61231
62537
  entities: FpoEntityOutcome[];
61232
62538
  hasFailures: boolean;
61233
62539
  }
62540
+ /** Thrown by `ensureFpo(fpo, { expectNoChanges: true })` when the plan is not clean. */
62541
+ export declare class FpoDriftError extends Error {
62542
+ readonly plan: EnsureFpoResult;
62543
+ constructor(plan: EnsureFpoResult);
62544
+ }
62545
+ export declare function fpoPlanHasDrift(plan: EnsureFpoResult): boolean;
61234
62546
  interface PullFpoResult {
61235
62547
  productId: string;
61236
62548
  /**
@@ -61244,10 +62556,10 @@ interface PullFpoResult {
61244
62556
  warnings?: string[];
61245
62557
  }
61246
62558
  /**
61247
- * Converge an entire FPO onto the platform. Ships the full FPO (no hash-only
61248
- * probe in this release); the server fans out to the per-entity ensure services
61249
- * and returns the whole-FPO hash + per-entity report. Non-atomic: inspect
61250
- * `result.hasFailures` / `entities[].result` and re-run to self-heal.
62559
+ * Converge an entire FPO onto the platform. Ships the full FPO unless a
62560
+ * drafts-only `hashProbe` finds the live graph already matches; the server fans out to the
62561
+ * per-entity ensure services and returns the whole-FPO hash + per-entity report.
62562
+ * Non-atomic: inspect `result.hasFailures` / `entities[].result` and re-run to self-heal.
61251
62563
  */
61252
62564
  export declare function ensureFpo(client: RuntypeClient$1, fpo: FpoInput, options?: EnsureFpoOptions): Promise<EnsureFpoResult>;
61253
62565
  /**
@@ -61376,8 +62688,10 @@ interface DefineSurfaceInput {
61376
62688
  name: string;
61377
62689
  type: SurfaceDefinitionType;
61378
62690
  behavior?: Record<string, unknown>;
61379
- inbound?: Record<string, unknown>;
61380
- outbound?: Record<string, unknown>;
62691
+ /** Omit to keep the stored value; null clears it; a `'<redacted>'` credential keeps the stored secret. */
62692
+ inbound?: Record<string, unknown> | null;
62693
+ /** Omit to keep the stored value; null clears it; a `'<redacted>'` credential keeps the stored secret. */
62694
+ outbound?: Record<string, unknown> | null;
61381
62695
  status?: SurfaceDefinitionStatus;
61382
62696
  }
61383
62697
  /** The canonical (wire) definition produced by `defineSurface`. */
@@ -61385,8 +62699,10 @@ interface SurfaceDefinition {
61385
62699
  name: string;
61386
62700
  type: SurfaceDefinitionType;
61387
62701
  behavior?: Record<string, unknown>;
61388
- inbound?: Record<string, unknown>;
61389
- outbound?: Record<string, unknown>;
62702
+ /** Omit to keep the stored value; null clears it; a `'<redacted>'` credential keeps the stored secret. */
62703
+ inbound?: Record<string, unknown> | null;
62704
+ /** Omit to keep the stored value; null clears it; a `'<redacted>'` credential keeps the stored secret. */
62705
+ outbound?: Record<string, unknown> | null;
61390
62706
  status?: SurfaceDefinitionStatus;
61391
62707
  }
61392
62708
  /**
@@ -62214,6 +63530,23 @@ export declare class Runtype {
62214
63530
  * ```
62215
63531
  */
62216
63532
  static get tools(): ToolsNamespace;
63533
+ /**
63534
+ * Question sets namespace - Question set config-as-code (define / ensure / pull)
63535
+ *
63536
+ * @example
63537
+ * ```typescript
63538
+ * import { defineQuestionSet, Runtype } from '@runtypelabs/sdk'
63539
+ *
63540
+ * const triage = defineQuestionSet({
63541
+ * slug: 'ticket-triage',
63542
+ * name: 'Ticket triage',
63543
+ * questions: { urgent: { type: 'boolean', instructions: 'Is the ticket urgent?' } },
63544
+ * })
63545
+ *
63546
+ * await Runtype.questionSets.ensure(triage, { release: 'publish' })
63547
+ * ```
63548
+ */
63549
+ static get questionSets(): QuestionSetsNamespace;
62217
63550
  /**
62218
63551
  * Products namespace - Product config-as-code (define / ensure / pull)
62219
63552
  *
@@ -62411,6 +63744,238 @@ interface PromoteAgentResult {
62411
63744
  */
62412
63745
  export declare function promoteAgent(input: PromoteAgentInput): Promise<PromoteAgentResult>;
62413
63746
  //#endregion
63747
+ //#region src/schedules-ensure.d.ts
63748
+ /** Exactly one key: a flow or agent by id, or by name (portable across environments). */
63749
+ export type ScheduleTarget = {
63750
+ flowId: string;
63751
+ } | {
63752
+ agentId: string;
63753
+ } | {
63754
+ flowName: string;
63755
+ } | {
63756
+ agentName: string;
63757
+ };
63758
+ export type ScheduleTrigger = {
63759
+ type: 'recurring';
63760
+ cron: string;
63761
+ timezone: string;
63762
+ runAt?: string;
63763
+ } | {
63764
+ type: 'one_time';
63765
+ runAt: string;
63766
+ cron?: string;
63767
+ timezone?: string;
63768
+ };
63769
+ type ScheduleDefinitionMessage = {
63770
+ role: 'system' | 'user' | 'assistant';
63771
+ content: unknown;
63772
+ } | {
63773
+ name?: string;
63774
+ messages: Array<{
63775
+ role: 'system' | 'user' | 'assistant';
63776
+ content: unknown;
63777
+ }>;
63778
+ };
63779
+ /** The canonical (wire) definition produced by `defineSchedule`. */
63780
+ interface ScheduleDefinition {
63781
+ name: string;
63782
+ target: ScheduleTarget;
63783
+ trigger: ScheduleTrigger;
63784
+ recordIds?: string[];
63785
+ recordType?: string;
63786
+ recordFilter?: Record<string, unknown>;
63787
+ messages?: ScheduleDefinitionMessage[];
63788
+ inputs?: Record<string, unknown>;
63789
+ executionOptions?: Record<string, unknown>;
63790
+ /** Omit to leave the schedule's paused/active state alone; new schedules start enabled. */
63791
+ enabled?: boolean;
63792
+ }
63793
+ type DefineScheduleInput = ScheduleDefinition;
63794
+ interface ScheduleContentInput {
63795
+ triggerType: string;
63796
+ cron?: string | null;
63797
+ timezone?: string | null;
63798
+ runAt?: string | Date | null;
63799
+ recordIds?: string[] | null;
63800
+ recordType?: string | null;
63801
+ recordFilter?: Record<string, unknown> | null;
63802
+ messages?: unknown[] | null;
63803
+ inputs?: Record<string, unknown> | null;
63804
+ executionOptions?: Record<string, unknown> | null;
63805
+ enabled?: boolean | null;
63806
+ }
63807
+ /** Canonical normalized schedule content (name and target excluded — identity). */
63808
+ export declare function normalizeScheduleContent(definition: ScheduleContentInput): Record<string, unknown>;
63809
+ /** SHA-256 (hex) over canonical schedule content, in the flat content shape. */
63810
+ export declare function computeScheduleContentHash(definition: ScheduleContentInput): Promise<string>;
63811
+ /** The content hash of a `defineSchedule` definition. */
63812
+ export declare function computeScheduleDefinitionHash(definition: ScheduleDefinition): Promise<string>;
63813
+ /**
63814
+ * Pure-local declarative constructor for a standalone schedule. No I/O.
63815
+ * Validates structure; cron, timezone, record filter and plan limits are
63816
+ * checked server-side at ensure time.
63817
+ *
63818
+ * @example
63819
+ * ```typescript
63820
+ * const nightly = defineSchedule({
63821
+ * name: 'Nightly digest',
63822
+ * target: { flowName: 'Digest' },
63823
+ * trigger: { type: 'recurring', cron: '0 2 * * *', timezone: 'UTC' },
63824
+ * })
63825
+ * ```
63826
+ */
63827
+ export declare function defineSchedule(input: DefineScheduleInput): ScheduleDefinition;
63828
+ interface EnsureScheduleOptions {
63829
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
63830
+ dryRun?: boolean;
63831
+ /** What to do when the last write was not ensure. Default 'error' (409). */
63832
+ onConflict?: 'error' | 'overwrite';
63833
+ /** TOCTOU guard from a dry run; the full definition is always sent with it. */
63834
+ expectedRemoteHash?: string;
63835
+ /** Implies dryRun; throws ScheduleDriftError unless the plan is 'none'. */
63836
+ expectNoChanges?: boolean;
63837
+ }
63838
+ interface EnsureScheduleConverged {
63839
+ result: 'unchanged' | 'created' | 'updated';
63840
+ scheduleId: string;
63841
+ /** The server-computed canonical hash (echo this — never your own). */
63842
+ contentHash: string;
63843
+ }
63844
+ interface EnsureSchedulePlan {
63845
+ result: 'plan';
63846
+ changes: 'none' | 'create' | 'update';
63847
+ changedKeys: string[];
63848
+ contentHash: string;
63849
+ remoteHash?: string;
63850
+ scheduleId?: string;
63851
+ }
63852
+ type EnsureScheduleResult = EnsureScheduleConverged | EnsureSchedulePlan;
63853
+ interface SchedulePullResult {
63854
+ scheduleId: string;
63855
+ definition: ScheduleDefinition;
63856
+ contentHash: string;
63857
+ lastModifiedSource: string | null;
63858
+ updatedAt: string | null;
63859
+ }
63860
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
63861
+ export declare class ScheduleEnsureConflictError extends Error {
63862
+ readonly code: 'external_modification' | 'remote_changed';
63863
+ readonly lastModifiedSource?: string;
63864
+ readonly modifiedAt?: string | null;
63865
+ readonly currentHash?: string | null;
63866
+ constructor(body: {
63867
+ error?: string;
63868
+ code: 'external_modification' | 'remote_changed';
63869
+ lastModifiedSource?: string;
63870
+ modifiedAt?: string | null;
63871
+ currentHash?: string | null;
63872
+ });
63873
+ }
63874
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
63875
+ export declare class ScheduleDriftError extends Error {
63876
+ readonly plan: EnsureSchedulePlan;
63877
+ constructor(plan: EnsureSchedulePlan);
63878
+ }
63879
+ /** The request surface ensure needs; both SDK clients satisfy it. */
63880
+ interface ScheduleEnsureTransport {
63881
+ get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
63882
+ post<T>(path: string, data?: unknown): Promise<T>;
63883
+ }
63884
+ /**
63885
+ * Idempotently converge a standalone schedule. Hash-first: probes with a
63886
+ * content hash and ships the full definition only on a miss. Never deletes.
63887
+ */
63888
+ export declare function ensureSchedule(client: ScheduleEnsureTransport, definition: ScheduleDefinition, options?: EnsureScheduleOptions): Promise<EnsureScheduleResult>;
63889
+ /** Pull the canonical definition + provenance for a schedule by name and target. */
63890
+ export declare function pullSchedule(client: ScheduleEnsureTransport, name: string, target: ScheduleTarget): Promise<SchedulePullResult>;
63891
+ //#endregion
63892
+ //#region src/collections-ensure.d.ts
63893
+ type RecordCollectionValidationMode = 'off' | 'warn' | 'enforce';
63894
+ /** A repo-declared record collection. `slug` is identity; omitted fields converge to create defaults. */
63895
+ interface RecordCollectionDefinition {
63896
+ slug: string;
63897
+ displayName: string;
63898
+ description?: string | null;
63899
+ icon?: string | null;
63900
+ schema?: Record<string, unknown> | null;
63901
+ validationMode?: RecordCollectionValidationMode;
63902
+ }
63903
+ /** Canonical normalized form of a collection definition (slug excluded — identity). */
63904
+ export declare function normalizeRecordCollectionDefinition(definition: RecordCollectionDefinition): {
63905
+ displayName: string;
63906
+ description?: string;
63907
+ icon?: string;
63908
+ schema?: Record<string, unknown>;
63909
+ validationMode: string;
63910
+ };
63911
+ /** SHA-256 (hex) over the canonical normalized collection definition. */
63912
+ export declare function computeRecordCollectionContentHash(definition: RecordCollectionDefinition): Promise<string>;
63913
+ interface EnsureCollectionOptions {
63914
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
63915
+ dryRun?: boolean;
63916
+ /** What to do when the last write came from the dashboard/API. Default 'error' (409). */
63917
+ onConflict?: 'error' | 'overwrite';
63918
+ /** TOCTOU guard binding a dry run to its apply (409 remote_changed otherwise). */
63919
+ expectedRemoteHash?: string;
63920
+ /** Implies dryRun; throws CollectionDriftError unless the plan is 'none'. */
63921
+ expectNoChanges?: boolean;
63922
+ }
63923
+ interface CollectionSchemaChange {
63924
+ kind: 'additive' | 'breaking';
63925
+ breakingChanges: string[];
63926
+ }
63927
+ interface EnsureCollectionConverged {
63928
+ result: 'unchanged' | 'created' | 'updated';
63929
+ collectionId: string;
63930
+ /** The server-computed canonical hash (echo this — never your own). */
63931
+ contentHash: string;
63932
+ schemaChange?: CollectionSchemaChange;
63933
+ /** Present when this ensure moved validationMode to `enforce`: existing records checked against the schema. */
63934
+ enforceCheck?: {
63935
+ checked: number;
63936
+ failed: number;
63937
+ truncated: boolean;
63938
+ };
63939
+ }
63940
+ interface EnsureCollectionPlan {
63941
+ result: 'plan';
63942
+ changes: 'none' | 'create' | 'update';
63943
+ changedKeys: string[];
63944
+ contentHash: string;
63945
+ remoteHash?: string;
63946
+ collectionId?: string;
63947
+ schemaChange?: CollectionSchemaChange;
63948
+ }
63949
+ type EnsureCollectionResult = EnsureCollectionConverged | EnsureCollectionPlan;
63950
+ interface CollectionPullResult {
63951
+ collectionId: string;
63952
+ definition: Required<Omit<RecordCollectionDefinition, 'validationMode'>> & {
63953
+ validationMode: RecordCollectionValidationMode;
63954
+ };
63955
+ contentHash: string;
63956
+ lastModifiedSource: string | null;
63957
+ updatedAt: string | null;
63958
+ }
63959
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
63960
+ export declare class CollectionEnsureConflictError extends Error {
63961
+ readonly code: 'external_modification' | 'remote_changed';
63962
+ readonly lastModifiedSource?: string;
63963
+ readonly modifiedAt?: string | null;
63964
+ readonly currentHash?: string | null;
63965
+ constructor(body: {
63966
+ error?: string;
63967
+ code: 'external_modification' | 'remote_changed';
63968
+ lastModifiedSource?: string;
63969
+ modifiedAt?: string | null;
63970
+ currentHash?: string | null;
63971
+ });
63972
+ }
63973
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
63974
+ export declare class CollectionDriftError extends Error {
63975
+ readonly plan: EnsureCollectionPlan;
63976
+ constructor(slug: string, plan: EnsureCollectionPlan);
63977
+ }
63978
+ //#endregion
62414
63979
  //#region src/api-key-request-types.d.ts
62415
63980
  /**
62416
63981
  * Agent API key request types.
@@ -63148,6 +64713,24 @@ export declare class CollectionsEndpoint {
63148
64713
  * `RecordCollections` map so `client.records.from(slug)` types metadata.
63149
64714
  */
63150
64715
  typegen(): Promise<string>;
64716
+ /**
64717
+ * Idempotently converge a repo-declared collection (display fields, schema,
64718
+ * validationMode) by slug. Hash-first; `dryRun` / `expectNoChanges` plan
64719
+ * without writing. Never deletes a collection or touches records.
64720
+ *
64721
+ * @example
64722
+ * ```typescript
64723
+ * await client.collections.ensure({
64724
+ * slug: 'customers',
64725
+ * displayName: 'Customers',
64726
+ * schema: { type: 'object', properties: { status: { type: 'string' } } },
64727
+ * validationMode: 'warn',
64728
+ * })
64729
+ * ```
64730
+ */
64731
+ ensure(definition: RecordCollectionDefinition, options?: EnsureCollectionOptions): Promise<EnsureCollectionResult>;
64732
+ /** Pull the canonical definition and provenance for a collection — the absorb-drift direction. */
64733
+ pull(slug: string): Promise<CollectionPullResult>;
63151
64734
  }
63152
64735
  /**
63153
64736
  * Agent API key REQUESTS — a device-authorization-style grant.
@@ -65489,6 +67072,17 @@ export declare class SchedulesEndpoint {
65489
67072
  * Create a schedule. Provide exactly one of `target.flowId` or `target.agentId`.
65490
67073
  */
65491
67074
  create(data: CreateScheduleRequest): Promise<ScheduleMutationResponse>;
67075
+ /**
67076
+ * Idempotently converge a `defineSchedule` definition on a standalone flow or
67077
+ * agent. Identity is name + target; the steady state is one hash probe. Never
67078
+ * deletes, and an omitted `enabled` leaves a paused schedule paused.
67079
+ */
67080
+ ensure(definition: ScheduleDefinition, options?: EnsureScheduleOptions): Promise<EnsureScheduleResult>;
67081
+ /**
67082
+ * Pull the canonical definition + provenance for a schedule by name and
67083
+ * target — the absorb-drift direction of `ensure`.
67084
+ */
67085
+ pull(name: string, target: ScheduleTarget): Promise<SchedulePullResult>;
65492
67086
  /**
65493
67087
  * Update a schedule (partial update supported).
65494
67088
  */
@@ -67390,5 +68984,5 @@ export declare function getLikelySupportingCandidatePaths(bestCandidatePath: str
67390
68984
  export declare function getDefaultPlanPath(taskName: string): string;
67391
68985
  export declare function sanitizeTaskSlug(taskName: string): string;
67392
68986
  //#endregion
67393
- export type { AIGrader, ActivateAgentAliasInput, ActivateAgentPromotionInput, AgentAlias, AgentAliasActivation, AgentAliasArchiveFailure, AgentAliasArchived, AgentAliasList, AgentAliasTransport, AgentDefinition, AgentDefinitionConfig, AgentDeploymentList, AgentDeploymentPromotion, AgentDeploymentReceipt, AgentPromotionManifest, AgentPromotionTransport, AgentPromotionValidation, AgentPullResult, AgentStreamEvent, ApiKeyRequest, ApiKeyRequestDelivery, ApiKeyRequestEnvironment, ApiKeyRequestHandoff, ApiKeyRequestListParams, ApiKeyRequestRequester, ApiKeyRequestStatus, ApplyGeneratedProposalOptions, ApplyGeneratedProposalResult, ArchiveAgentAliasEverywhereResult, ArchiveAgentAliasInput, AttachRuntimeToolsOptions, BatchClient, BatchListParams, BatchOptions, BatchRequest, BatchResult, BatchScheduleConfig, BatchStatus, BindSkillInput, BuiltInGraderId, CaseExpected, CheckGrader, ClaimApiKeyRequestInput, ClaimApiKeyRequestResponse, ClientConversation, ClientToken, ClientTokenConfig, ClientTokenDefinition, ClientTokenEnvironment, ClientTokenVersionPin, ClientWidgetTheme, ConditionalGetResult, ConditionalStepConfig, ContextErrorHandling, ContextFallback, CreateApiKeyRequestInput, CreateApiKeyRequestResponse, CreateClientTokenRequest, CreateClientTokenResponse, CreateEvalSuiteInput, CreatePromptData, DecomposeCriteriaResult, DefineAgentInput, DefineEvalCaseInput, DefineEvalInput, DefineFlowInput, DefineProductInput, DefineSkillInput, DefineSurfaceInput, DefineToolInput, DetachedReattach, DetachedReconnectOptions, DispatchClient, DispatchEvent, DispatchOptions, EnsureAgentConverged, EnsureAgentOptions, EnsureAgentPlan, EnsureAgentResult, EnsureClientTokenConverged, EnsureClientTokenOptions, EnsureClientTokenPlan, EnsureClientTokenResult, EnsureEvalResult, EnsureFlowConverged, EnsureFlowOptions, EnsureFlowPlan, EnsureFlowResult, EnsureFpoOptions, EnsureFpoResult, EnsureProductConverged, EnsureProductOptions, EnsureProductPlan, EnsureProductResult, EnsureSkillConverged, EnsureSkillOptions, EnsureSkillPlan, EnsureSkillResult, EnsureSurfaceConverged, EnsureSurfaceOptions, EnsureSurfacePlan, EnsureSurfaceResult, EnsureToolConverged, EnsureToolOptions, EnsureToolPlan, EnsureToolResult, ErrorHandlingMode, EvalAgentSelector, EvalAgentTargetResolution, EvalCaseDefinition, EvalCaseInput, EvalCaseProposal, EvalCaseProposalAccepted, EvalCaseProposalListResult, EvalCasesGenerated, EvalClient, EvalDefinition, EvalListParams, EvalMessage, EvalOptions, EvalProposalSource, EvalProposalStatus, EvalProposedCase, EvalPullResult, EvalRecord, EvalRequest, EvalResult, EvalRunCaseScores, EvalRunConfig, EvalRunEvidence, EvalRunScores, EvalStatus, EvalSuiteCase, EvalSuiteCaseInput, EvalSuiteCoverage, EvalSuiteDetail, EvalSuiteLatestRun, EvalSuiteListResult, EvalSuiteRunQueued, EvalSuiteRunResult, EvalSuiteSummary, EvalTarget, ExecutionStreamEvent, FallbackFailEvent, FallbackStartEvent, FallbackSuccessEvent, FallbackTrigger, FallbackTriggerType, FallbacksExhaustedEvent, FallbacksInitiatedEvent, FetchUrlStepConfig, FieldFormat, FlowCompleteEvent, FlowConfig, FlowDefinition, FlowDefinitionStep, FlowErrorEvent, FlowFallback, FlowInlineEvalInput, FlowPausedEvent, FlowPullResult, FlowStartEvent, FlowStreamEvent, FlowSummary, FlowValidationClient, FlowValidationIssue, FlowValidationResult, FpoEntityOutcome, FpoInput, GenerateEmbeddingStepConfig, GenerateEvalCasesInput, GeneratedRuntimeToolGateDecision, GeneratedRuntimeToolGateOptions, GetApiKeyRequestResponse, GetRecordStepConfig, Gradeable, GraderConfig, GraderOutcome, GraderSeverity, HumanVerdict, ListAgentAliasesOptions, ListAgentDeploymentsOptions, ListConversationsResponse, ListRecordsStepConfig, LoopStepConfig, Message, MessageFallback, ModelFallback, ModelOverride, OrganizationAgentAlias, OrganizationAgentAliasList, PersistedGraderOutcome, PrepareAgentPromotionInput, ProductDefinition, ProductPullResult, PromoteAgentInput, PromoteAgentResult, PromptErrorHandling, PromptFallback, PromptListParams, PromptStepConfig, PullFpoResult, RecordConfig, RecordFilter, RecordFilterCondition, RecordFilterGroup, RecordFilterOperator, RetrieveRecordStepConfig, RetryFallback, RollbackAgentAliasInput, RunEvalCaseResult, RunEvalInput, RunEvalResult, RunListParams, RunListResponse, RunListRow, AgentSkillBinding as RuntypeAgentSkillBinding, ConditionalStepConfig$1 as RuntypeConditionalStepConfig, RuntypeConfig, FetchUrlStepConfig$1 as RuntypeFetchUrlStepConfig, FlowConfig$1 as RuntypeFlowConfig, GenerateEmbeddingStepConfig$1 as RuntypeGenerateEmbeddingStepConfig, GetRecordStepConfig$1 as RuntypeGetRecordStepConfig, ListRecordsStepConfig$1 as RuntypeListRecordsStepConfig, LoopStepConfig$1 as RuntypeLoopStepConfig, Message$1 as RuntypeMessage, ModelOverride$1 as RuntypeModelOverride, Prompt$1 as RuntypePrompt, PromptStepConfig$1 as RuntypePromptStepConfig, RecordConfig$1 as RuntypeRecordConfig, RetrieveRecordStepConfig$1 as RuntypeRetrieveRecordStepConfig, SearchStepConfig as RuntypeSearchStepConfig, SendEmailStepConfig as RuntypeSendEmailStepConfig, SendEventStepConfig as RuntypeSendEventStepConfig, SendStreamStepConfig as RuntypeSendStreamStepConfig, SetVariableStepConfig as RuntypeSetVariableStepConfig, Skill as RuntypeSkill, SkillBindingWithAgent as RuntypeSkillBindingWithAgent, SkillCapabilities as RuntypeSkillCapabilities, SkillFrontmatter as RuntypeSkillFrontmatter, SkillManifest as RuntypeSkillManifest, SkillProposal as RuntypeSkillProposal, SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, SkillVersion as RuntypeSkillVersion, TransformDataStepConfig as RuntypeTransformDataStepConfig, UpsertFlowConfig as RuntypeUpsertFlowConfig, UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, VectorSearchStepConfig as RuntypeVectorSearchStepConfig, WaitUntilStepConfig as RuntypeWaitUntilStepConfig, SearchStepConfig$1 as SearchStepConfig, SendEmailStepConfig$1 as SendEmailStepConfig, SendEventStepConfig$1 as SendEventStepConfig, SendStreamStepConfig$1 as SendStreamStepConfig, SetVariableStepConfig$1 as SetVariableStepConfig, SkillDefinition, SkillListPage, SkillListPagination, SkillListParams, SkillManifestInput, SkillMarkdownInput, SkillOrigin, SkillProposalStatus, SkillPullResult, SkillStatus, SkillTrustLevel, SkillVersionStatus, SkillWithVersion, SkillWriteInput, StepCompleteEvent, StepDeltaEvent, StepFallback, StepFieldMeta, StepStartEvent, StepWaitingLocalEvent, StreamCallbacks, StreamConsumeOptions, StreamEvent, StreamEventOf, SurfaceDefinition, SurfaceDefinitionStatus, SurfaceDefinitionType, SurfacePullResult, ToolDefinition, ToolDefinitionType, ToolPullResult, TransformDataStepConfig$1 as TransformDataStepConfig, UpdateClientTokenRequest, UpdateEvalCaseInput, UpdateEvalSuiteInput, UpdatePromptData, UpsertFlowConfig$1 as UpsertFlowConfig, UpsertRecordStepConfig$1 as UpsertRecordStepConfig, ValidateAgentPromotionInput, VectorSearchStepConfig$1 as VectorSearchStepConfig, WaitUntilStepConfig$1 as WaitUntilStepConfig, WorkflowCompileDeps, WorkflowCompletionCriteriaConfig, WorkflowConfig, WorkflowConfigFactory, WorkflowHookEntry, WorkflowHookKind, WorkflowHookRef, WorkflowHookSignatures, WorkflowMilestoneConfig, WorkflowPolicyConfig, WorkflowRecoveryConfig, WorkflowSlot };
68987
+ export type { AIGrader, ActivateAgentAliasInput, ActivateAgentPromotionInput, AgentAlias, AgentAliasActivation, AgentAliasArchiveFailure, AgentAliasArchived, AgentAliasList, AgentAliasTransport, AgentCapabilityChange, AgentCapabilityDeclaration, AgentDefinition, AgentDefinitionConfig, AgentDeploymentList, AgentDeploymentPromotion, AgentDeploymentReceipt, AgentPromotionManifest, AgentPromotionTransport, AgentPromotionValidation, AgentPullResult, AgentSkillBinding, AgentSkillBindingChange, AgentStreamEvent, ApiKeyRequest, ApiKeyRequestDelivery, ApiKeyRequestEnvironment, ApiKeyRequestHandoff, ApiKeyRequestListParams, ApiKeyRequestRequester, ApiKeyRequestStatus, ApplyGeneratedProposalOptions, ApplyGeneratedProposalResult, ArchiveAgentAliasEverywhereResult, ArchiveAgentAliasInput, AttachRuntimeToolsOptions, BatchClient, BatchListParams, BatchOptions, BatchRequest, BatchResult, BatchScheduleConfig, BatchStatus, BindSkillInput, BuiltInGraderId, CaseExpected, CheckGrader, ClaimApiKeyRequestInput, ClaimApiKeyRequestResponse, ClientConversation, ClientToken, ClientTokenConfig, ClientTokenDefinition, ClientTokenEnvironment, ClientTokenVersionPin, ClientWidgetTheme, CollectionPullResult, CollectionSchemaChange, ConditionalGetResult, ConditionalStepConfig, ContextErrorHandling, ContextFallback, CreateApiKeyRequestInput, CreateApiKeyRequestResponse, CreateClientTokenRequest, CreateClientTokenResponse, CreateEvalSuiteInput, CreatePromptData, DecomposeCriteriaResult, DefineAgentInput, DefineEvalCaseInput, DefineEvalInput, DefineFlowInput, DefineProductInput, DefineScheduleInput, DefineSkillInput, DefineSurfaceInput, DefineToolInput, DetachedReattach, DetachedReconnectOptions, DispatchClient, DispatchEvent, DispatchOptions, EnsureAgentConverged, EnsureAgentOptions, EnsureAgentPlan, EnsureAgentResult, EnsureClientTokenConverged, EnsureClientTokenOptions, EnsureClientTokenPlan, EnsureClientTokenResult, EnsureCollectionConverged, EnsureCollectionOptions, EnsureCollectionPlan, EnsureCollectionResult, EnsureEvalApplyOptions, EnsureEvalOptions, EnsureEvalPlan, EnsureEvalResult, EnsureFlowConverged, EnsureFlowOptions, EnsureFlowPlan, EnsureFlowResult, EnsureFpoOptions, EnsureFpoResult, EnsureProductConverged, EnsureProductOptions, EnsureProductPlan, EnsureProductResult, EnsureQuestionSetConverged, EnsureQuestionSetOptions, EnsureQuestionSetPlan, EnsureQuestionSetResult, EnsureScheduleConverged, EnsureScheduleOptions, EnsureSchedulePlan, EnsureScheduleResult, EnsureSkillConverged, EnsureSkillOptions, EnsureSkillPlan, EnsureSkillResult, EnsureSurfaceConverged, EnsureSurfaceOptions, EnsureSurfacePlan, EnsureSurfaceResult, EnsureToolConverged, EnsureToolOptions, EnsureToolPlan, EnsureToolResult, ErrorHandlingMode, EvalAgentSelector, EvalAgentTargetResolution, EvalCaseDefinition, EvalCaseInput, EvalCaseProposal, EvalCaseProposalAccepted, EvalCaseProposalListResult, EvalCasesGenerated, EvalClient, EvalDefinition, EvalListParams, EvalMessage, EvalOptions, EvalProposalSource, EvalProposalStatus, EvalProposedCase, EvalPullResult, EvalRecord, EvalRequest, EvalResult, EvalRunCaseScores, EvalRunConfig, EvalRunEvidence, EvalRunScores, EvalStatus, EvalSuiteCase, EvalSuiteCaseInput, EvalSuiteCoverage, EvalSuiteDetail, EvalSuiteLatestRun, EvalSuiteListResult, EvalSuiteRunQueued, EvalSuiteRunResult, EvalSuiteSummary, EvalTarget, ExecutionStreamEvent, FallbackFailEvent, FallbackStartEvent, FallbackSuccessEvent, FallbackTrigger, FallbackTriggerType, FallbacksExhaustedEvent, FallbacksInitiatedEvent, FetchUrlStepConfig, FieldFormat, FlowCompleteEvent, FlowConfig, FlowDefinition, FlowDefinitionStep, FlowErrorEvent, FlowFallback, FlowInlineEvalInput, FlowPausedEvent, FlowPullResult, FlowStartEvent, FlowStreamEvent, FlowSummary, FlowValidationClient, FlowValidationIssue, FlowValidationResult, FpoEntityOutcome, FpoInput, GenerateEmbeddingStepConfig, GenerateEvalCasesInput, GeneratedRuntimeToolGateDecision, GeneratedRuntimeToolGateOptions, GetApiKeyRequestResponse, GetRecordStepConfig, Gradeable, GraderConfig, GraderOutcome, GraderSeverity, HumanVerdict, ListAgentAliasesOptions, ListAgentDeploymentsOptions, ListConversationsResponse, ListRecordsStepConfig, LoopStepConfig, Message, MessageFallback, ModelFallback, ModelOverride, OrganizationAgentAlias, OrganizationAgentAliasList, PersistedGraderOutcome, PrepareAgentPromotionInput, ProductDefinition, ProductPullResult, PromoteAgentInput, PromoteAgentResult, PromptErrorHandling, PromptFallback, PromptListParams, PromptStepConfig, PullFpoResult, QuestionSetDefinition, QuestionSetPullResult, RecordCollectionDefinition, RecordCollectionValidationMode, RecordConfig, RecordFilter, RecordFilterCondition, RecordFilterGroup, RecordFilterOperator, RetrieveRecordStepConfig, RetryFallback, RollbackAgentAliasInput, RunEvalCaseResult, RunEvalInput, RunEvalResult, RunListParams, RunListResponse, RunListRow, AgentSkillBinding$1 as RuntypeAgentSkillBinding, ConditionalStepConfig$1 as RuntypeConditionalStepConfig, RuntypeConfig, FetchUrlStepConfig$1 as RuntypeFetchUrlStepConfig, FlowConfig$1 as RuntypeFlowConfig, GenerateEmbeddingStepConfig$1 as RuntypeGenerateEmbeddingStepConfig, GetRecordStepConfig$1 as RuntypeGetRecordStepConfig, ListRecordsStepConfig$1 as RuntypeListRecordsStepConfig, LoopStepConfig$1 as RuntypeLoopStepConfig, Message$1 as RuntypeMessage, ModelOverride$1 as RuntypeModelOverride, Prompt$1 as RuntypePrompt, PromptStepConfig$1 as RuntypePromptStepConfig, RecordConfig$1 as RuntypeRecordConfig, RetrieveRecordStepConfig$1 as RuntypeRetrieveRecordStepConfig, SearchStepConfig as RuntypeSearchStepConfig, SendEmailStepConfig as RuntypeSendEmailStepConfig, SendEventStepConfig as RuntypeSendEventStepConfig, SendStreamStepConfig as RuntypeSendStreamStepConfig, SetVariableStepConfig as RuntypeSetVariableStepConfig, Skill as RuntypeSkill, SkillBindingWithAgent as RuntypeSkillBindingWithAgent, SkillCapabilities as RuntypeSkillCapabilities, SkillFrontmatter as RuntypeSkillFrontmatter, SkillManifest as RuntypeSkillManifest, SkillProposal as RuntypeSkillProposal, SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, SkillVersion as RuntypeSkillVersion, TransformDataStepConfig as RuntypeTransformDataStepConfig, UpsertFlowConfig as RuntypeUpsertFlowConfig, UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, VectorSearchStepConfig as RuntypeVectorSearchStepConfig, WaitUntilStepConfig as RuntypeWaitUntilStepConfig, ScheduleDefinition, ScheduleDefinitionMessage, ScheduleEnsureTransport, SchedulePullResult, SearchStepConfig$1 as SearchStepConfig, SendEmailStepConfig$1 as SendEmailStepConfig, SendEventStepConfig$1 as SendEventStepConfig, SendStreamStepConfig$1 as SendStreamStepConfig, SetVariableStepConfig$1 as SetVariableStepConfig, SkillDefinition, SkillListPage, SkillListPagination, SkillListParams, SkillManifestInput, SkillMarkdownInput, SkillOrigin, SkillProposalStatus, SkillPullResult, SkillStatus, SkillTrustLevel, SkillVersionStatus, SkillWithVersion, SkillWriteInput, StepCompleteEvent, StepDeltaEvent, StepFallback, StepFieldMeta, StepStartEvent, StepWaitingLocalEvent, StreamCallbacks, StreamConsumeOptions, StreamEvent, StreamEventOf, SurfaceDefinition, SurfaceDefinitionStatus, SurfaceDefinitionType, SurfacePullResult, ToolDefinition, ToolDefinitionType, ToolPullResult, TransformDataStepConfig$1 as TransformDataStepConfig, UpdateClientTokenRequest, UpdateEvalCaseInput, UpdateEvalSuiteInput, UpdatePromptData, UpsertFlowConfig$1 as UpsertFlowConfig, UpsertRecordStepConfig$1 as UpsertRecordStepConfig, ValidateAgentPromotionInput, VectorSearchStepConfig$1 as VectorSearchStepConfig, WaitUntilStepConfig$1 as WaitUntilStepConfig, WorkflowCompileDeps, WorkflowCompletionCriteriaConfig, WorkflowConfig, WorkflowConfigFactory, WorkflowHookEntry, WorkflowHookKind, WorkflowHookRef, WorkflowHookSignatures, WorkflowMilestoneConfig, WorkflowPolicyConfig, WorkflowRecoveryConfig, WorkflowSlot };
67394
68988
  export {}