@runtypelabs/sdk 4.15.0 → 4.16.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.cts CHANGED
@@ -723,6 +723,10 @@ interface paths {
723
723
  };
724
724
  tools?: {
725
725
  approval?: {
726
+ choices?: {
727
+ alwaysAllow?: boolean;
728
+ alwaysDeny?: boolean;
729
+ };
726
730
  requestReason?: boolean;
727
731
  require: string[] | boolean;
728
732
  timeout?: number;
@@ -1092,6 +1096,10 @@ interface paths {
1092
1096
  };
1093
1097
  tools?: {
1094
1098
  approval?: {
1099
+ choices?: {
1100
+ alwaysAllow?: boolean;
1101
+ alwaysDeny?: boolean;
1102
+ };
1095
1103
  requestReason?: boolean;
1096
1104
  require: string[] | boolean;
1097
1105
  timeout?: number;
@@ -1733,6 +1741,10 @@ interface paths {
1733
1741
  };
1734
1742
  tools?: {
1735
1743
  approval?: {
1744
+ choices?: {
1745
+ alwaysAllow?: boolean;
1746
+ alwaysDeny?: boolean;
1747
+ };
1736
1748
  requestReason?: boolean;
1737
1749
  require: string[] | boolean;
1738
1750
  timeout?: number;
@@ -21744,6 +21756,227 @@ interface paths {
21744
21756
  patch?: never;
21745
21757
  trace?: never;
21746
21758
  };
21759
+ "/v1/products/{id}/surfaces/ensure": {
21760
+ parameters: {
21761
+ query?: never;
21762
+ header?: never;
21763
+ path?: never;
21764
+ cookie?: never;
21765
+ };
21766
+ get?: never;
21767
+ put?: never;
21768
+ /**
21769
+ * Ensure surface (config-as-code converge)
21770
+ * @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.
21771
+ */
21772
+ post: {
21773
+ parameters: {
21774
+ query?: never;
21775
+ header?: never;
21776
+ path: {
21777
+ id: string;
21778
+ };
21779
+ cookie?: never;
21780
+ };
21781
+ requestBody?: {
21782
+ content: {
21783
+ "application/json": {
21784
+ contentHash?: string;
21785
+ definition?: {
21786
+ behavior?: {
21787
+ [key: string]: unknown;
21788
+ };
21789
+ /** @enum {string} */
21790
+ environment?: "production" | "development";
21791
+ inbound?: {
21792
+ [key: string]: unknown;
21793
+ };
21794
+ name: string;
21795
+ outbound?: {
21796
+ [key: string]: unknown;
21797
+ };
21798
+ /** @enum {string} */
21799
+ status?: "draft" | "active" | "paused";
21800
+ /** @enum {string} */
21801
+ type: "chat" | "mcp" | "mcp_code" | "api" | "webhook" | "schedule" | "a2a" | "email" | "slack" | "sms" | "imessage" | "discord" | "whatsapp" | "telegram" | "hosted-page" | "chrome_extension";
21802
+ };
21803
+ dryRun?: boolean;
21804
+ expectedRemoteHash?: string;
21805
+ name: string;
21806
+ /** @enum {string} */
21807
+ onConflict?: "error" | "overwrite";
21808
+ };
21809
+ };
21810
+ };
21811
+ responses: {
21812
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
21813
+ 200: {
21814
+ headers: {
21815
+ [name: string]: unknown;
21816
+ };
21817
+ content: {
21818
+ "application/json": components["schemas"]["SurfaceEnsureResponse"];
21819
+ };
21820
+ };
21821
+ /** @description Validation error */
21822
+ 400: {
21823
+ headers: {
21824
+ [name: string]: unknown;
21825
+ };
21826
+ content: {
21827
+ "application/json": components["schemas"]["Error"];
21828
+ };
21829
+ };
21830
+ /** @description Unauthorized */
21831
+ 401: {
21832
+ headers: {
21833
+ [name: string]: unknown;
21834
+ };
21835
+ content: {
21836
+ "application/json": components["schemas"]["Error"];
21837
+ };
21838
+ };
21839
+ /** @description Plan surface limit reached for the target environment (only a create counts against the quota) */
21840
+ 402: {
21841
+ headers: {
21842
+ [name: string]: unknown;
21843
+ };
21844
+ content: {
21845
+ "application/json": components["schemas"]["Error"];
21846
+ };
21847
+ };
21848
+ /** @description Insufficient permissions */
21849
+ 403: {
21850
+ headers: {
21851
+ [name: string]: unknown;
21852
+ };
21853
+ content: {
21854
+ "application/json": components["schemas"]["Error"];
21855
+ };
21856
+ };
21857
+ /** @description Product not found */
21858
+ 404: {
21859
+ headers: {
21860
+ [name: string]: unknown;
21861
+ };
21862
+ content: {
21863
+ "application/json": components["schemas"]["Error"];
21864
+ };
21865
+ };
21866
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
21867
+ 409: {
21868
+ headers: {
21869
+ [name: string]: unknown;
21870
+ };
21871
+ content: {
21872
+ "application/json": components["schemas"]["SurfaceEnsureConflict"];
21873
+ };
21874
+ };
21875
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
21876
+ 422: {
21877
+ headers: {
21878
+ [name: string]: unknown;
21879
+ };
21880
+ content: {
21881
+ "application/json": components["schemas"]["SurfaceEnsureHashMismatch"];
21882
+ };
21883
+ };
21884
+ /** @description Internal server error */
21885
+ 500: {
21886
+ headers: {
21887
+ [name: string]: unknown;
21888
+ };
21889
+ content: {
21890
+ "application/json": components["schemas"]["Error"];
21891
+ };
21892
+ };
21893
+ };
21894
+ };
21895
+ delete?: never;
21896
+ options?: never;
21897
+ head?: never;
21898
+ patch?: never;
21899
+ trace?: never;
21900
+ };
21901
+ "/v1/products/{id}/surfaces/pull": {
21902
+ parameters: {
21903
+ query?: never;
21904
+ header?: never;
21905
+ path?: never;
21906
+ cookie?: never;
21907
+ };
21908
+ /**
21909
+ * Pull surface definition (config-as-code)
21910
+ * @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.
21911
+ */
21912
+ get: {
21913
+ parameters: {
21914
+ query: {
21915
+ name: string;
21916
+ };
21917
+ header?: never;
21918
+ path: {
21919
+ id: string;
21920
+ };
21921
+ cookie?: never;
21922
+ };
21923
+ requestBody?: never;
21924
+ responses: {
21925
+ /** @description Canonical definition + provenance */
21926
+ 200: {
21927
+ headers: {
21928
+ [name: string]: unknown;
21929
+ };
21930
+ content: {
21931
+ "application/json": components["schemas"]["SurfacePullResponse"];
21932
+ };
21933
+ };
21934
+ /** @description Unauthorized */
21935
+ 401: {
21936
+ headers: {
21937
+ [name: string]: unknown;
21938
+ };
21939
+ content: {
21940
+ "application/json": components["schemas"]["Error"];
21941
+ };
21942
+ };
21943
+ /** @description Insufficient permissions */
21944
+ 403: {
21945
+ headers: {
21946
+ [name: string]: unknown;
21947
+ };
21948
+ content: {
21949
+ "application/json": components["schemas"]["Error"];
21950
+ };
21951
+ };
21952
+ /** @description Product not found, or no surface with that name in the product */
21953
+ 404: {
21954
+ headers: {
21955
+ [name: string]: unknown;
21956
+ };
21957
+ content: {
21958
+ "application/json": components["schemas"]["Error"];
21959
+ };
21960
+ };
21961
+ /** @description Internal server error */
21962
+ 500: {
21963
+ headers: {
21964
+ [name: string]: unknown;
21965
+ };
21966
+ content: {
21967
+ "application/json": components["schemas"]["Error"];
21968
+ };
21969
+ };
21970
+ };
21971
+ };
21972
+ put?: never;
21973
+ post?: never;
21974
+ delete?: never;
21975
+ options?: never;
21976
+ head?: never;
21977
+ patch?: never;
21978
+ trace?: never;
21979
+ };
21747
21980
  "/v1/products/{id}/surfaces/{surfaceId}": {
21748
21981
  parameters: {
21749
21982
  query?: never;
@@ -31692,7 +31925,7 @@ interface paths {
31692
31925
  patch?: never;
31693
31926
  trace?: never;
31694
31927
  };
31695
- "/v1/skills/import": {
31928
+ "/v1/skills/ensure": {
31696
31929
  parameters: {
31697
31930
  query?: never;
31698
31931
  header?: never;
@@ -31702,8 +31935,8 @@ interface paths {
31702
31935
  get?: never;
31703
31936
  put?: never;
31704
31937
  /**
31705
- * Import a SKILL.md
31706
- * @description Import a single SKILL.md document. Lands with trustLevel=imported.
31938
+ * Ensure skill (config-as-code converge)
31939
+ * @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.
31707
31940
  */
31708
31941
  post: {
31709
31942
  parameters: {
@@ -31715,23 +31948,35 @@ interface paths {
31715
31948
  requestBody?: {
31716
31949
  content: {
31717
31950
  "application/json": {
31718
- markdown: string;
31951
+ contentHash?: string;
31952
+ definition?: {
31953
+ body?: string;
31954
+ frontmatter?: {
31955
+ [key: string]: unknown;
31956
+ };
31957
+ markdown?: string;
31958
+ };
31959
+ dryRun?: boolean;
31960
+ expectedRemoteHash?: string;
31961
+ name: string;
31962
+ /** @enum {string} */
31963
+ onConflict?: "error" | "overwrite";
31964
+ /** @enum {string} */
31965
+ release?: "none" | "publish";
31719
31966
  };
31720
31967
  };
31721
31968
  };
31722
31969
  responses: {
31723
- /** @description Imported */
31724
- 201: {
31970
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
31971
+ 200: {
31725
31972
  headers: {
31726
31973
  [name: string]: unknown;
31727
31974
  };
31728
31975
  content: {
31729
- "application/json": {
31730
- [key: string]: unknown;
31731
- };
31976
+ "application/json": components["schemas"]["SkillEnsureResponse"];
31732
31977
  };
31733
31978
  };
31734
- /** @description Invalid manifest */
31979
+ /** @description Validation error / invalid manifest */
31735
31980
  400: {
31736
31981
  headers: {
31737
31982
  [name: string]: unknown;
@@ -31758,8 +32003,26 @@ interface paths {
31758
32003
  "application/json": components["schemas"]["Error"];
31759
32004
  };
31760
32005
  };
31761
- /** @description Unsupported capability */
32006
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
32007
+ 409: {
32008
+ headers: {
32009
+ [name: string]: unknown;
32010
+ };
32011
+ content: {
32012
+ "application/json": components["schemas"]["SkillEnsureConflict"];
32013
+ };
32014
+ };
32015
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash (code: content_hash_mismatch), or the manifest carries an unsupported capability such as mcpServers (code: unsupported_capability) */
31762
32016
  422: {
32017
+ headers: {
32018
+ [name: string]: unknown;
32019
+ };
32020
+ content: {
32021
+ "application/json": components["schemas"]["SkillEnsureUnprocessable"];
32022
+ };
32023
+ };
32024
+ /** @description Internal server error */
32025
+ 500: {
31763
32026
  headers: {
31764
32027
  [name: string]: unknown;
31765
32028
  };
@@ -31775,7 +32038,7 @@ interface paths {
31775
32038
  patch?: never;
31776
32039
  trace?: never;
31777
32040
  };
31778
- "/v1/skills/propose": {
32041
+ "/v1/skills/import": {
31779
32042
  parameters: {
31780
32043
  query?: never;
31781
32044
  header?: never;
@@ -31785,8 +32048,8 @@ interface paths {
31785
32048
  get?: never;
31786
32049
  put?: never;
31787
32050
  /**
31788
- * Propose a skill (deployed-agent data plane)
31789
- * @description Agent self-authoring endpoint hit by the `propose_skill` runtime tool. Review-by-default; auto-publishes only under the owner-set opt-out. NOT the admin create path.
32051
+ * Import a SKILL.md
32052
+ * @description Import a single SKILL.md document. Lands with trustLevel=imported.
31790
32053
  */
31791
32054
  post: {
31792
32055
  parameters: {
@@ -31798,20 +32061,103 @@ interface paths {
31798
32061
  requestBody?: {
31799
32062
  content: {
31800
32063
  "application/json": {
31801
- body: string;
31802
- capabilities?: {
31803
- [key: string]: unknown;
31804
- };
31805
- description: string;
31806
- name: string;
31807
- proposingAgentExecutionId: string;
31808
- proposingAgentId: string;
32064
+ markdown: string;
31809
32065
  };
31810
32066
  };
31811
32067
  };
31812
32068
  responses: {
31813
- /** @description Proposal outcome */
31814
- 200: {
32069
+ /** @description Imported */
32070
+ 201: {
32071
+ headers: {
32072
+ [name: string]: unknown;
32073
+ };
32074
+ content: {
32075
+ "application/json": {
32076
+ [key: string]: unknown;
32077
+ };
32078
+ };
32079
+ };
32080
+ /** @description Invalid manifest */
32081
+ 400: {
32082
+ headers: {
32083
+ [name: string]: unknown;
32084
+ };
32085
+ content: {
32086
+ "application/json": components["schemas"]["Error"];
32087
+ };
32088
+ };
32089
+ /** @description Unauthorized */
32090
+ 401: {
32091
+ headers: {
32092
+ [name: string]: unknown;
32093
+ };
32094
+ content: {
32095
+ "application/json": components["schemas"]["Error"];
32096
+ };
32097
+ };
32098
+ /** @description Insufficient permissions */
32099
+ 403: {
32100
+ headers: {
32101
+ [name: string]: unknown;
32102
+ };
32103
+ content: {
32104
+ "application/json": components["schemas"]["Error"];
32105
+ };
32106
+ };
32107
+ /** @description Unsupported capability */
32108
+ 422: {
32109
+ headers: {
32110
+ [name: string]: unknown;
32111
+ };
32112
+ content: {
32113
+ "application/json": components["schemas"]["Error"];
32114
+ };
32115
+ };
32116
+ };
32117
+ };
32118
+ delete?: never;
32119
+ options?: never;
32120
+ head?: never;
32121
+ patch?: never;
32122
+ trace?: never;
32123
+ };
32124
+ "/v1/skills/propose": {
32125
+ parameters: {
32126
+ query?: never;
32127
+ header?: never;
32128
+ path?: never;
32129
+ cookie?: never;
32130
+ };
32131
+ get?: never;
32132
+ put?: never;
32133
+ /**
32134
+ * Propose a skill (deployed-agent data plane)
32135
+ * @description Agent self-authoring endpoint hit by the `propose_skill` runtime tool. Review-by-default; auto-publishes only under the owner-set opt-out. NOT the admin create path.
32136
+ */
32137
+ post: {
32138
+ parameters: {
32139
+ query?: never;
32140
+ header?: never;
32141
+ path?: never;
32142
+ cookie?: never;
32143
+ };
32144
+ requestBody?: {
32145
+ content: {
32146
+ "application/json": {
32147
+ body: string;
32148
+ capabilities?: {
32149
+ [key: string]: unknown;
32150
+ };
32151
+ description: string;
32152
+ name: string;
32153
+ proposingAgentExecutionId: string;
32154
+ proposingAgentId: string;
32155
+ };
32156
+ };
32157
+ };
32158
+ responses: {
32159
+ /** @description Proposal outcome */
32160
+ 200: {
31815
32161
  headers: {
31816
32162
  [name: string]: unknown;
31817
32163
  };
@@ -31856,6 +32202,157 @@ interface paths {
31856
32202
  patch?: never;
31857
32203
  trace?: never;
31858
32204
  };
32205
+ "/v1/skills/pull": {
32206
+ parameters: {
32207
+ query?: never;
32208
+ header?: never;
32209
+ path?: never;
32210
+ cookie?: never;
32211
+ };
32212
+ /**
32213
+ * Pull skill definition (config-as-code)
32214
+ * @description Return the canonical config-as-code definition and provenance for a skill by name — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live skill state, so it is accurate even immediately after a dashboard edit.
32215
+ */
32216
+ get: {
32217
+ parameters: {
32218
+ query: {
32219
+ name: string;
32220
+ };
32221
+ header?: never;
32222
+ path?: never;
32223
+ cookie?: never;
32224
+ };
32225
+ requestBody?: never;
32226
+ responses: {
32227
+ /** @description Canonical definition + provenance */
32228
+ 200: {
32229
+ headers: {
32230
+ [name: string]: unknown;
32231
+ };
32232
+ content: {
32233
+ "application/json": components["schemas"]["SkillPullResponse"];
32234
+ };
32235
+ };
32236
+ /** @description Unauthorized */
32237
+ 401: {
32238
+ headers: {
32239
+ [name: string]: unknown;
32240
+ };
32241
+ content: {
32242
+ "application/json": components["schemas"]["Error"];
32243
+ };
32244
+ };
32245
+ /** @description Insufficient permissions */
32246
+ 403: {
32247
+ headers: {
32248
+ [name: string]: unknown;
32249
+ };
32250
+ content: {
32251
+ "application/json": components["schemas"]["Error"];
32252
+ };
32253
+ };
32254
+ /** @description No skill with that name in the account scope */
32255
+ 404: {
32256
+ headers: {
32257
+ [name: string]: unknown;
32258
+ };
32259
+ content: {
32260
+ "application/json": components["schemas"]["Error"];
32261
+ };
32262
+ };
32263
+ /** @description Internal server error */
32264
+ 500: {
32265
+ headers: {
32266
+ [name: string]: unknown;
32267
+ };
32268
+ content: {
32269
+ "application/json": components["schemas"]["Error"];
32270
+ };
32271
+ };
32272
+ };
32273
+ };
32274
+ put?: never;
32275
+ post?: never;
32276
+ delete?: never;
32277
+ options?: never;
32278
+ head?: never;
32279
+ patch?: never;
32280
+ trace?: never;
32281
+ };
32282
+ "/v1/skills/scan": {
32283
+ parameters: {
32284
+ query?: never;
32285
+ header?: never;
32286
+ path?: never;
32287
+ cookie?: never;
32288
+ };
32289
+ get?: never;
32290
+ put?: never;
32291
+ /**
32292
+ * Scan a skill for malicious patterns
32293
+ * @description Statically scan a SKILL.md string (`markdown`) or structured manifest (`frontmatter` + `body`) and return a two-tier verdict (warning when suspected malicious, error when high-confidence malicious). Does not persist or gate.
32294
+ */
32295
+ post: {
32296
+ parameters: {
32297
+ query?: never;
32298
+ header?: never;
32299
+ path?: never;
32300
+ cookie?: never;
32301
+ };
32302
+ requestBody?: {
32303
+ content: {
32304
+ "application/json": {
32305
+ [key: string]: unknown;
32306
+ };
32307
+ };
32308
+ };
32309
+ responses: {
32310
+ /** @description Scan verdict */
32311
+ 200: {
32312
+ headers: {
32313
+ [name: string]: unknown;
32314
+ };
32315
+ content: {
32316
+ "application/json": {
32317
+ [key: string]: unknown;
32318
+ };
32319
+ };
32320
+ };
32321
+ /** @description Invalid manifest */
32322
+ 400: {
32323
+ headers: {
32324
+ [name: string]: unknown;
32325
+ };
32326
+ content: {
32327
+ "application/json": components["schemas"]["Error"];
32328
+ };
32329
+ };
32330
+ /** @description Unauthorized */
32331
+ 401: {
32332
+ headers: {
32333
+ [name: string]: unknown;
32334
+ };
32335
+ content: {
32336
+ "application/json": components["schemas"]["Error"];
32337
+ };
32338
+ };
32339
+ /** @description Insufficient permissions */
32340
+ 403: {
32341
+ headers: {
32342
+ [name: string]: unknown;
32343
+ };
32344
+ content: {
32345
+ "application/json": components["schemas"]["Error"];
32346
+ };
32347
+ };
32348
+ };
32349
+ };
32350
+ delete?: never;
32351
+ options?: never;
32352
+ head?: never;
32353
+ patch?: never;
32354
+ trace?: never;
32355
+ };
31859
32356
  "/v1/skills/{id}": {
31860
32357
  parameters: {
31861
32358
  query?: never;
@@ -32322,6 +32819,119 @@ interface paths {
32322
32819
  patch?: never;
32323
32820
  trace?: never;
32324
32821
  };
32822
+ "/v1/tool-approval-grants": {
32823
+ parameters: {
32824
+ query?: never;
32825
+ header?: never;
32826
+ path?: never;
32827
+ cookie?: never;
32828
+ };
32829
+ /**
32830
+ * List remembered tool-approval grants
32831
+ * @description List the authenticated owner's active cross-session "Always allow" grants. Optionally filter to a single agent with ?agentId=. A null endUserRef is an account-level grant.
32832
+ */
32833
+ get: {
32834
+ parameters: {
32835
+ query?: {
32836
+ agentId?: string;
32837
+ };
32838
+ header?: never;
32839
+ path?: never;
32840
+ cookie?: never;
32841
+ };
32842
+ requestBody?: never;
32843
+ responses: {
32844
+ /** @description Active grants */
32845
+ 200: {
32846
+ headers: {
32847
+ [name: string]: unknown;
32848
+ };
32849
+ content: {
32850
+ "application/json": {
32851
+ data: components["schemas"]["ToolApprovalGrant"][];
32852
+ };
32853
+ };
32854
+ };
32855
+ /** @description Unauthorized */
32856
+ 401: {
32857
+ headers: {
32858
+ [name: string]: unknown;
32859
+ };
32860
+ content: {
32861
+ "application/json": components["schemas"]["Error"];
32862
+ };
32863
+ };
32864
+ };
32865
+ };
32866
+ put?: never;
32867
+ post?: never;
32868
+ delete?: never;
32869
+ options?: never;
32870
+ head?: never;
32871
+ patch?: never;
32872
+ trace?: never;
32873
+ };
32874
+ "/v1/tool-approval-grants/{id}": {
32875
+ parameters: {
32876
+ query?: never;
32877
+ header?: never;
32878
+ path?: never;
32879
+ cookie?: never;
32880
+ };
32881
+ get?: never;
32882
+ put?: never;
32883
+ post?: never;
32884
+ /**
32885
+ * Revoke a remembered tool-approval grant
32886
+ * @description Revoke (soft-delete) a grant so the tool prompts for approval again on future dispatches. Ownership-scoped.
32887
+ */
32888
+ delete: {
32889
+ parameters: {
32890
+ query?: never;
32891
+ header?: never;
32892
+ path: {
32893
+ id: string;
32894
+ };
32895
+ cookie?: never;
32896
+ };
32897
+ requestBody?: never;
32898
+ responses: {
32899
+ /** @description Revoked */
32900
+ 200: {
32901
+ headers: {
32902
+ [name: string]: unknown;
32903
+ };
32904
+ content: {
32905
+ "application/json": {
32906
+ revoked: boolean;
32907
+ };
32908
+ };
32909
+ };
32910
+ /** @description Unauthorized */
32911
+ 401: {
32912
+ headers: {
32913
+ [name: string]: unknown;
32914
+ };
32915
+ content: {
32916
+ "application/json": components["schemas"]["Error"];
32917
+ };
32918
+ };
32919
+ /** @description Grant not found */
32920
+ 404: {
32921
+ headers: {
32922
+ [name: string]: unknown;
32923
+ };
32924
+ content: {
32925
+ "application/json": components["schemas"]["Error"];
32926
+ };
32927
+ };
32928
+ };
32929
+ };
32930
+ options?: never;
32931
+ head?: never;
32932
+ patch?: never;
32933
+ trace?: never;
32934
+ };
32325
32935
  "/v1/tools": {
32326
32936
  parameters: {
32327
32937
  query?: never;
@@ -34283,6 +34893,7 @@ interface paths {
34283
34893
  enableChromeSurface: boolean;
34284
34894
  enableDashboardAssistant: boolean;
34285
34895
  enableRuntypeApps: boolean;
34896
+ enableSkillScanner: boolean;
34286
34897
  productGeneratorModel: string;
34287
34898
  };
34288
34899
  id: string;
@@ -34853,6 +35464,10 @@ interface components {
34853
35464
  };
34854
35465
  tools?: {
34855
35466
  approval?: {
35467
+ choices?: {
35468
+ alwaysAllow?: boolean;
35469
+ alwaysDeny?: boolean;
35470
+ };
34856
35471
  requestReason?: boolean;
34857
35472
  require: string[] | boolean;
34858
35473
  timeout?: number;
@@ -35619,6 +36234,7 @@ interface components {
35619
36234
  /** @enum {string} */
35620
36235
  type: "flow_start";
35621
36236
  } | {
36237
+ claudeManagedAgentId?: string;
35622
36238
  completedAt?: string;
35623
36239
  completedSteps?: number;
35624
36240
  duration?: number;
@@ -36103,6 +36719,7 @@ interface components {
36103
36719
  /** @enum {string} */
36104
36720
  type: "flow_start";
36105
36721
  } | {
36722
+ claudeManagedAgentId?: string;
36106
36723
  completedAt?: string;
36107
36724
  completedSteps?: number;
36108
36725
  duration?: number;
@@ -36552,6 +37169,47 @@ interface components {
36552
37169
  op: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "between" | "contains" | "startsWith" | "endsWith" | "in" | "notIn" | "isSet" | "isNotSet" | "isTrue" | "isFalse" | "withinLastDays" | "olderThanDays";
36553
37170
  value?: unknown;
36554
37171
  };
37172
+ SkillEnsureConflict: {
37173
+ /** @enum {string} */
37174
+ code: "external_modification" | "remote_changed";
37175
+ currentHash?: string | null;
37176
+ error: string;
37177
+ lastModifiedSource?: string;
37178
+ modifiedAt?: string | null;
37179
+ };
37180
+ SkillEnsureHashMismatch: {
37181
+ /** @enum {string} */
37182
+ code: "content_hash_mismatch";
37183
+ /** @description The server-computed canonical hash of the submitted manifest. */
37184
+ contentHash: string;
37185
+ error: string;
37186
+ };
37187
+ SkillEnsureResponse: {
37188
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
37189
+ contentHash: string;
37190
+ /** @enum {string} */
37191
+ result: "unchanged" | "created" | "updated";
37192
+ skillId: string;
37193
+ versionId: string | null;
37194
+ } | {
37195
+ /** @enum {string} */
37196
+ result: "definitionRequired";
37197
+ } | {
37198
+ changedKeys: string[];
37199
+ /** @enum {string} */
37200
+ changes: "none" | "create" | "update";
37201
+ contentHash: string;
37202
+ remoteHash?: string;
37203
+ /** @enum {string} */
37204
+ result: "plan";
37205
+ skillId?: string;
37206
+ };
37207
+ SkillEnsureUnprocessable: components["schemas"]["SkillEnsureHashMismatch"] | components["schemas"]["SkillEnsureUnsupportedCapability"];
37208
+ SkillEnsureUnsupportedCapability: {
37209
+ /** @enum {string} */
37210
+ code: "unsupported_capability";
37211
+ error: string;
37212
+ };
36555
37213
  SkillProposal: {
36556
37214
  createdAt: string;
36557
37215
  id: string;
@@ -36564,6 +37222,89 @@ interface components {
36564
37222
  skillVersionId: string;
36565
37223
  status: string;
36566
37224
  };
37225
+ SkillPullResponse: {
37226
+ contentHash: string;
37227
+ definition: {
37228
+ manifest: {
37229
+ [key: string]: unknown;
37230
+ };
37231
+ name: string;
37232
+ };
37233
+ lastModifiedSource: string | null;
37234
+ skillId: string;
37235
+ updatedAt: string | null;
37236
+ versionId: string | null;
37237
+ };
37238
+ SurfaceEnsureConflict: {
37239
+ /** @enum {string} */
37240
+ code: "external_modification" | "remote_changed";
37241
+ currentHash?: string | null;
37242
+ error: string;
37243
+ lastModifiedSource?: string;
37244
+ modifiedAt?: string | null;
37245
+ };
37246
+ SurfaceEnsureHashMismatch: {
37247
+ /** @enum {string} */
37248
+ code: "content_hash_mismatch";
37249
+ /** @description The server-computed canonical hash of the submitted definition. */
37250
+ contentHash: string;
37251
+ error: string;
37252
+ };
37253
+ SurfaceEnsureResponse: {
37254
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
37255
+ contentHash: string;
37256
+ /** @enum {string} */
37257
+ result: "unchanged" | "created" | "updated";
37258
+ surfaceId: string;
37259
+ } | {
37260
+ /** @enum {string} */
37261
+ result: "definitionRequired";
37262
+ } | {
37263
+ changedKeys: string[];
37264
+ /** @enum {string} */
37265
+ changes: "none" | "create" | "update";
37266
+ contentHash: string;
37267
+ remoteHash?: string;
37268
+ /** @enum {string} */
37269
+ result: "plan";
37270
+ surfaceId?: string;
37271
+ };
37272
+ SurfacePullResponse: {
37273
+ contentHash: string;
37274
+ definition: {
37275
+ behavior?: {
37276
+ [key: string]: unknown;
37277
+ };
37278
+ /** @enum {string} */
37279
+ environment?: "production" | "development";
37280
+ inbound?: {
37281
+ [key: string]: unknown;
37282
+ };
37283
+ name: string;
37284
+ outbound?: {
37285
+ [key: string]: unknown;
37286
+ };
37287
+ /** @enum {string} */
37288
+ status?: "draft" | "active" | "paused";
37289
+ /** @enum {string} */
37290
+ type: "chat" | "mcp" | "mcp_code" | "api" | "webhook" | "schedule" | "a2a" | "email" | "slack" | "sms" | "imessage" | "discord" | "whatsapp" | "telegram" | "hosted-page" | "chrome_extension";
37291
+ };
37292
+ lastModifiedSource: string | null;
37293
+ surfaceId: string;
37294
+ updatedAt: string | null;
37295
+ };
37296
+ ToolApprovalGrant: {
37297
+ agentId: string;
37298
+ createdAt: string;
37299
+ decision: string;
37300
+ endUserRef: string | null;
37301
+ expiresAt: string | null;
37302
+ id: string;
37303
+ sourceApprovalId: string | null;
37304
+ sourceExecutionId: string | null;
37305
+ toolName: string;
37306
+ toolType: string;
37307
+ };
36567
37308
  ToolEnsureConflict: {
36568
37309
  /** @enum {string} */
36569
37310
  code: "external_modification" | "remote_changed";
@@ -36922,7 +37663,7 @@ interface FetchUrlStepConfig$1 {
36922
37663
  [key: string]: any;
36923
37664
  };
36924
37665
  /** Error handling configuration - supports simple mode or fallback chains */
36925
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37666
+ errorHandling?: ContextErrorHandling;
36926
37667
  defaultValue?: unknown;
36927
37668
  streamOutput?: boolean;
36928
37669
  enabled?: boolean;
@@ -36951,7 +37692,7 @@ interface CrawlStepConfig$1 {
36951
37692
  jsonOptions?: Record<string, unknown>;
36952
37693
  outputVariable?: string;
36953
37694
  streamOutput?: boolean;
36954
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37695
+ errorHandling?: ContextErrorHandling;
36955
37696
  pollIntervalMs?: number;
36956
37697
  completionTimeoutMs?: number;
36957
37698
  defaultValue?: unknown;
@@ -36974,7 +37715,7 @@ interface TransformDataStepConfig$1 {
36974
37715
  networkAccess?: 'off' | 'on' | {
36975
37716
  allowedHostnames: string[];
36976
37717
  };
36977
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37718
+ errorHandling?: ContextErrorHandling;
36978
37719
  defaultValue?: unknown;
36979
37720
  tools?: {
36980
37721
  toolIds?: string[];
@@ -37026,7 +37767,7 @@ interface SearchStepConfig$1 {
37026
37767
  outputVariable?: string;
37027
37768
  returnCitations?: boolean;
37028
37769
  /** Error handling configuration - supports simple mode or fallback chains */
37029
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37770
+ errorHandling?: ContextErrorHandling;
37030
37771
  streamOutput?: boolean;
37031
37772
  enabled?: boolean;
37032
37773
  /** JavaScript predicate evaluated at runtime. If falsy, the step is skipped. */
@@ -37049,7 +37790,7 @@ interface SendEmailStepConfig$1 {
37049
37790
  }>;
37050
37791
  outputVariable?: string;
37051
37792
  /** Error handling configuration - supports simple mode or fallback chains */
37052
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37793
+ errorHandling?: ContextErrorHandling;
37053
37794
  defaultValue?: unknown;
37054
37795
  streamOutput?: boolean;
37055
37796
  enabled?: boolean;
@@ -37114,7 +37855,7 @@ interface UpsertRecordStepConfig$1 {
37114
37855
  mergeStrategy?: 'merge' | 'replace';
37115
37856
  outputVariable?: string;
37116
37857
  /** Error handling configuration - supports simple mode or fallback chains */
37117
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37858
+ errorHandling?: ContextErrorHandling;
37118
37859
  streamOutput?: boolean;
37119
37860
  enabled?: boolean;
37120
37861
  /** JavaScript predicate evaluated at runtime. If falsy, the step is skipped. */
@@ -37176,7 +37917,7 @@ interface WaitUntilStepConfig$1 {
37176
37917
  };
37177
37918
  outputVariable?: string;
37178
37919
  /** Error handling configuration - supports simple mode or fallback chains */
37179
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37920
+ errorHandling?: ContextErrorHandling;
37180
37921
  streamOutput?: boolean;
37181
37922
  enabled?: boolean;
37182
37923
  /** JavaScript predicate evaluated at runtime. If falsy, the step is skipped. */
@@ -37189,7 +37930,7 @@ interface SendEventStepConfig$1 {
37189
37930
  properties?: Record<string, any>;
37190
37931
  outputVariable?: string;
37191
37932
  /** Error handling configuration - supports simple mode or fallback chains */
37192
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37933
+ errorHandling?: ContextErrorHandling;
37193
37934
  streamOutput?: boolean;
37194
37935
  enabled?: boolean;
37195
37936
  /** JavaScript predicate evaluated at runtime. If falsy, the step is skipped. */
@@ -37202,7 +37943,7 @@ interface SendTextStepConfig$1 {
37202
37943
  message: string;
37203
37944
  outputVariable?: string;
37204
37945
  /** Error handling configuration - supports simple mode or fallback chains */
37205
- errorHandling?: ErrorHandlingMode | ContextErrorHandling;
37946
+ errorHandling?: ContextErrorHandling;
37206
37947
  streamOutput?: boolean;
37207
37948
  enabled?: boolean;
37208
37949
  /** JavaScript predicate evaluated at runtime. If falsy, the step is skipped. */
@@ -40025,6 +40766,144 @@ declare class PromptsNamespace {
40025
40766
  delete(promptId: string): Promise<void>;
40026
40767
  }
40027
40768
 
40769
+ /**
40770
+ * Skill config-as-code: `defineSkill`, `skills.ensure`, `skills.pull`.
40771
+ *
40772
+ * The deploy-time convergence postcondition for Agent Skills: "make the
40773
+ * platform's definition of this skill match this manifest; no-op if it already
40774
+ * does." Identity is name + account scope (the API key's org, else personal);
40775
+ * environment is whichever API the client points at. `ensure` never deletes,
40776
+ * and renaming a manifest orphans the old skill and creates a new one.
40777
+ *
40778
+ * This is the admin/control-plane converge — API scopes only, no review queue.
40779
+ * It is NOT the deployed-agent `propose_skill` data plane.
40780
+ *
40781
+ * Wire protocol (POST /v1/skills/ensure — APQ-shaped, both APQ scars fixed):
40782
+ * 1. Hash-only probe `{ name, contentHash }`. A match is
40783
+ * `{ result: 'unchanged' }`; a miss is a NORMAL 200
40784
+ * `{ result: 'definitionRequired' }`, never an error.
40785
+ * 2. On a miss, retry with the full `definition`. The server recomputes the
40786
+ * canonical hash itself and returns it on every response — this SDK echoes
40787
+ * the server's hash (memoized per client instance) rather than trusting its
40788
+ * own serialization.
40789
+ *
40790
+ * Like agents/flows (and unlike tools), skills HAVE version snapshots: every
40791
+ * change appends an immutable version, the result carries a `versionId`, and
40792
+ * `release: 'publish'` re-aims the published-version pointer.
40793
+ *
40794
+ * The content hash is the canonical skill hash (`computeSkillContentHash` —
40795
+ * mirrored from `packages/shared/src/utils/skill-content-hash.ts`; this package
40796
+ * is dependency-free by convention) over the manifest `{ frontmatter (name
40797
+ * excluded), runtype, body }`. `name` is identity, not content.
40798
+ *
40799
+ * See docs/adr/0003-agent-config-as-code-ensure.md for the design rationale.
40800
+ */
40801
+
40802
+ interface SkillContentInput {
40803
+ /** Identity — excluded from the hash. */
40804
+ name: string;
40805
+ manifest: SkillManifest | Record<string, unknown>;
40806
+ }
40807
+ /** Canonical normalized form of a skill manifest (frontmatter name excluded). */
40808
+ declare function normalizeSkillDefinition(definition: SkillContentInput): {
40809
+ frontmatter: Record<string, unknown>;
40810
+ runtype: Record<string, unknown>;
40811
+ body: string;
40812
+ };
40813
+ /** SHA-256 (hex) over the canonical normalized skill manifest. */
40814
+ declare function computeSkillContentHash(definition: SkillContentInput): Promise<string>;
40815
+ /** `defineSkill` input: identity (name) + the convergeable manifest content. */
40816
+ interface DefineSkillInput {
40817
+ name: string;
40818
+ manifest: SkillManifest;
40819
+ }
40820
+ /** The canonical (wire) definition produced by `defineSkill`. */
40821
+ interface SkillDefinition {
40822
+ name: string;
40823
+ manifest: SkillManifest;
40824
+ }
40825
+ /**
40826
+ * Pure-local declarative constructor for a skill definition. No I/O. Validates
40827
+ * structure, rejects unknown fields, and asserts the manifest's frontmatter
40828
+ * name matches the identity name. Deep validation (capability gate, length
40829
+ * limits) happens server-side at ensure time, mirroring the create/update
40830
+ * routes.
40831
+ *
40832
+ * @example
40833
+ * ```typescript
40834
+ * const reviewer = defineSkill({
40835
+ * name: 'code_reviewer',
40836
+ * manifest: {
40837
+ * frontmatter: { name: 'code_reviewer', description: 'Reviews pull requests' },
40838
+ * runtype: { trustLevel: 'org' },
40839
+ * body: '# Code Reviewer\n\nReview the diff for bugs...',
40840
+ * },
40841
+ * })
40842
+ * ```
40843
+ */
40844
+ declare function defineSkill(input: DefineSkillInput): SkillDefinition;
40845
+ interface EnsureSkillOptions {
40846
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
40847
+ dryRun?: boolean;
40848
+ /**
40849
+ * What to do when the skill's last write came from the dashboard/API rather
40850
+ * than ensure. Default 'error' (HTTP 409 → SkillEnsureConflictError).
40851
+ */
40852
+ onConflict?: 'error' | 'overwrite';
40853
+ /** 'publish' also re-aims the published-version pointer. Default 'none'. */
40854
+ release?: 'none' | 'publish';
40855
+ /**
40856
+ * TOCTOU guard binding a dry run to its apply: the write only proceeds if the
40857
+ * remote still hashes to this value (409 remote_changed otherwise).
40858
+ */
40859
+ expectedRemoteHash?: string;
40860
+ /** Implies dryRun; throws SkillDriftError unless the plan is 'none'. */
40861
+ expectNoChanges?: boolean;
40862
+ }
40863
+ interface EnsureSkillConverged {
40864
+ result: 'unchanged' | 'created' | 'updated';
40865
+ skillId: string;
40866
+ versionId: string | null;
40867
+ /** The server-computed canonical hash (echo this — never your own). */
40868
+ contentHash: string;
40869
+ }
40870
+ interface EnsureSkillPlan {
40871
+ result: 'plan';
40872
+ changes: 'none' | 'create' | 'update';
40873
+ changedKeys: string[];
40874
+ contentHash: string;
40875
+ remoteHash?: string;
40876
+ skillId?: string;
40877
+ }
40878
+ type EnsureSkillResult = EnsureSkillConverged | EnsureSkillPlan;
40879
+ interface SkillPullResult {
40880
+ skillId: string;
40881
+ definition: SkillDefinition;
40882
+ contentHash: string;
40883
+ lastModifiedSource: string | null;
40884
+ updatedAt: string | null;
40885
+ versionId: string | null;
40886
+ }
40887
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
40888
+ declare class SkillEnsureConflictError extends Error {
40889
+ readonly code: 'external_modification' | 'remote_changed';
40890
+ readonly lastModifiedSource?: string;
40891
+ readonly modifiedAt?: string | null;
40892
+ readonly currentHash?: string | null;
40893
+ constructor(body: {
40894
+ error?: string;
40895
+ code: 'external_modification' | 'remote_changed';
40896
+ lastModifiedSource?: string;
40897
+ modifiedAt?: string | null;
40898
+ currentHash?: string | null;
40899
+ });
40900
+ }
40901
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
40902
+ declare class SkillDriftError extends Error {
40903
+ readonly plan: EnsureSkillPlan;
40904
+ constructor(plan: EnsureSkillPlan);
40905
+ }
40906
+
40028
40907
  /**
40029
40908
  * SkillsNamespace — admin/control-plane operations for Agent Skills.
40030
40909
  *
@@ -40221,6 +41100,43 @@ interface SkillManifestInput {
40221
41100
  }
40222
41101
  /** A skill create/update payload — either a SKILL.md string or a manifest. */
40223
41102
  type SkillWriteInput = SkillMarkdownInput | SkillManifestInput;
41103
+ /** Per-finding tier surfaced to the user. */
41104
+ interface SkillScanFinding {
41105
+ ruleId: string;
41106
+ category: string | null;
41107
+ severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
41108
+ confidence: number;
41109
+ tier: 'warning' | 'error';
41110
+ hardBlock: boolean;
41111
+ message: string;
41112
+ file: string;
41113
+ startLine: number;
41114
+ remediation: string | null;
41115
+ }
41116
+ /** Two-tier verdict over a skill scan. `tier` is authoritative. */
41117
+ interface SkillScanVerdict {
41118
+ tier: 'clean' | 'warning' | 'error';
41119
+ riskScore: number;
41120
+ riskSeverity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
41121
+ recommendation: 'SAFE' | 'CAUTION' | 'DO_NOT_INSTALL';
41122
+ errors: SkillScanFinding[];
41123
+ warnings: SkillScanFinding[];
41124
+ summary: string;
41125
+ scannerVersion: string;
41126
+ verdictVersion: number;
41127
+ }
41128
+ /** The `POST /v1/skills/scan` response. */
41129
+ interface SkillScanResult {
41130
+ status: 'passed' | 'warning' | 'blocked' | 'scanner_error';
41131
+ verdict: SkillScanVerdict;
41132
+ reportBody: string;
41133
+ scannerVersion: string;
41134
+ completedAt: string;
41135
+ error?: {
41136
+ code: string;
41137
+ message: string;
41138
+ };
41139
+ }
40224
41140
  /** Options for binding a skill to an agent. */
40225
41141
  interface BindSkillInput {
40226
41142
  agentId: string;
@@ -40381,6 +41297,19 @@ declare class SkillsNamespace {
40381
41297
  * ```
40382
41298
  */
40383
41299
  publishVersion(skillId: string, versionId: string): Promise<void>;
41300
+ /**
41301
+ * Statically scan a SKILL.md document for malicious patterns and return a
41302
+ * two-tier verdict — `warning` when a skill appears suspicious (low–medium
41303
+ * confidence), `error` when high-confidence malicious. Does not persist or
41304
+ * gate; use it as a "scan before save" affordance.
41305
+ *
41306
+ * @example
41307
+ * ```typescript
41308
+ * const { verdict } = await Runtype.skills.scan(skillMarkdown)
41309
+ * if (verdict.tier === 'error') console.warn(verdict.summary)
41310
+ * ```
41311
+ */
41312
+ scan(markdown: string): Promise<SkillScanResult>;
40384
41313
  /**
40385
41314
  * Import a single SKILL.md document. The imported skill lands with
40386
41315
  * `trustLevel: 'imported'` and a draft version.
@@ -40409,6 +41338,36 @@ declare class SkillsNamespace {
40409
41338
  * ```
40410
41339
  */
40411
41340
  listBindings(agentId: string): Promise<AgentSkillBinding[]>;
41341
+ /**
41342
+ * Idempotently converge a `defineSkill` definition onto the platform.
41343
+ * Hash-first: the steady state is one tiny probe request. Creates or appends a
41344
+ * new version; never deletes. Identity is name + account scope. Pass
41345
+ * `release: 'publish'` to publish the converged version.
41346
+ *
41347
+ * @example
41348
+ * ```typescript
41349
+ * const reviewer = defineSkill({
41350
+ * name: 'code_reviewer',
41351
+ * manifest: {
41352
+ * frontmatter: { name: 'code_reviewer', description: 'Reviews pull requests' },
41353
+ * runtype: { trustLevel: 'org' },
41354
+ * body: '# Code Reviewer\n\nReview the diff...',
41355
+ * },
41356
+ * })
41357
+ *
41358
+ * // Converge + publish (CI/deploy).
41359
+ * const result = await Runtype.skills.ensure(reviewer, { release: 'publish' })
41360
+ *
41361
+ * // PR drift gate.
41362
+ * await Runtype.skills.ensure(reviewer, { expectNoChanges: true })
41363
+ * ```
41364
+ */
41365
+ ensure(definition: SkillDefinition, options?: EnsureSkillOptions): Promise<EnsureSkillResult>;
41366
+ /**
41367
+ * Pull the canonical definition + provenance for a skill by name — the
41368
+ * absorb-drift direction of the ensure protocol.
41369
+ */
41370
+ pull(name: string): Promise<SkillPullResult>;
40412
41371
  }
40413
41372
 
40414
41373
  /**
@@ -41025,6 +41984,200 @@ declare class ProductsNamespace {
41025
41984
  pull(name: string): Promise<ProductPullResult>;
41026
41985
  }
41027
41986
 
41987
+ /**
41988
+ * Surface config-as-code: `defineSurface`, `surfaces.ensure`, `surfaces.pull`.
41989
+ *
41990
+ * The deploy-time convergence postcondition for product surfaces: "make the
41991
+ * platform's definition of this surface match this object; no-op if it already
41992
+ * does." Surfaces are PRODUCT-scoped: identity is (productId, name) — NOT
41993
+ * account scope. `ensure` never deletes, and renaming a definition orphans the
41994
+ * old surface and creates a new one.
41995
+ *
41996
+ * Wire protocol (POST /v1/products/{id}/surfaces/ensure — APQ-shaped, both APQ
41997
+ * scars fixed):
41998
+ * 1. Hash-only probe `{ name, contentHash }`. A match is
41999
+ * `{ result: 'unchanged' }`; a miss is a NORMAL 200
42000
+ * `{ result: 'definitionRequired' }`, never an error.
42001
+ * 2. On a miss, retry with the full `definition`. The server recomputes the
42002
+ * canonical hash itself and returns it on every response — this SDK echoes
42003
+ * the server's hash (memoized per client instance) rather than trusting
42004
+ * its own serialization.
42005
+ *
42006
+ * Unlike agents/flows, surfaces have NO version snapshots: there is no
42007
+ * `release: 'publish'` option and no `versionId` on the result.
42008
+ *
42009
+ * The content hash is the canonical surface hash (`computeSurfaceContentHash` —
42010
+ * mirrored from `packages/shared/src/utils/surface-content-hash.ts`; this
42011
+ * package is dependency-free by convention) over `{ type, behavior, inbound,
42012
+ * outbound, status, environment }`. `name` is identity, not content, so it is
42013
+ * excluded from the hash.
42014
+ *
42015
+ * See docs/adr/0003-agent-config-as-code-ensure.md for the design rationale.
42016
+ */
42017
+
42018
+ /**
42019
+ * Canonical normalized form of a surface definition (name excluded — identity).
42020
+ * `inbound` / `outbound` are EXCLUDED — they carry sealed secrets that hash
42021
+ * non-deterministically against the stored row. MUST stay in sync with the
42022
+ * canonical copy in @runtypelabs/shared (utils/surface-content-hash.ts).
42023
+ */
42024
+ declare function normalizeSurfaceDefinition(definition: SurfaceContentInput): {
42025
+ type: string;
42026
+ behavior: Record<string, unknown>;
42027
+ status: string;
42028
+ environment: string;
42029
+ };
42030
+ /** SHA-256 (hex) over the canonical normalized surface definition. */
42031
+ declare function computeSurfaceContentHash(definition: SurfaceContentInput): Promise<string>;
42032
+ interface SurfaceContentInput {
42033
+ type: string;
42034
+ behavior?: Record<string, unknown> | null;
42035
+ inbound?: Record<string, unknown> | null;
42036
+ outbound?: Record<string, unknown> | null;
42037
+ status?: string | null;
42038
+ environment?: string | null;
42039
+ }
42040
+ /** The surface types `ensure` accepts (mirrors the server's createSurfaceSchema). */
42041
+ type SurfaceDefinitionType = 'chat' | 'mcp' | 'mcp_code' | 'api' | 'webhook' | 'schedule' | 'a2a' | 'email' | 'slack' | 'sms' | 'imessage' | 'discord' | 'whatsapp' | 'telegram' | 'hosted-page' | 'chrome_extension';
42042
+ type SurfaceDefinitionStatus = 'draft' | 'active' | 'paused';
42043
+ type SurfaceDefinitionEnvironment = 'production' | 'development';
42044
+ /** `defineSurface` input: identity (name) + the convergeable content fields. */
42045
+ interface DefineSurfaceInput {
42046
+ name: string;
42047
+ type: SurfaceDefinitionType;
42048
+ behavior?: Record<string, unknown>;
42049
+ inbound?: Record<string, unknown>;
42050
+ outbound?: Record<string, unknown>;
42051
+ status?: SurfaceDefinitionStatus;
42052
+ environment?: SurfaceDefinitionEnvironment;
42053
+ }
42054
+ /** The canonical (wire) definition produced by `defineSurface`. */
42055
+ interface SurfaceDefinition {
42056
+ name: string;
42057
+ type: SurfaceDefinitionType;
42058
+ behavior?: Record<string, unknown>;
42059
+ inbound?: Record<string, unknown>;
42060
+ outbound?: Record<string, unknown>;
42061
+ status?: SurfaceDefinitionStatus;
42062
+ environment?: SurfaceDefinitionEnvironment;
42063
+ }
42064
+ /**
42065
+ * Pure-local declarative constructor for a surface definition. No I/O.
42066
+ * Validates structure and rejects unknown fields. Deep validation (credential
42067
+ * sealing, prerelease-type-in-production guard) happens server-side at ensure
42068
+ * time, mirroring the create/update routes.
42069
+ *
42070
+ * @example
42071
+ * ```typescript
42072
+ * const chat = defineSurface({
42073
+ * name: 'Support Chat',
42074
+ * type: 'chat',
42075
+ * behavior: { type: 'chat', greeting: 'Hi there!' },
42076
+ * status: 'active',
42077
+ * })
42078
+ * ```
42079
+ */
42080
+ declare function defineSurface(input: DefineSurfaceInput): SurfaceDefinition;
42081
+ interface EnsureSurfaceOptions {
42082
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
42083
+ dryRun?: boolean;
42084
+ /**
42085
+ * What to do when the surface's last write came from the dashboard/API
42086
+ * rather than ensure. Default 'error' (HTTP 409 → SurfaceEnsureConflictError).
42087
+ */
42088
+ onConflict?: 'error' | 'overwrite';
42089
+ /**
42090
+ * TOCTOU guard binding a dry run to its apply: the write only proceeds if
42091
+ * the remote still hashes to this value (409 remote_changed otherwise).
42092
+ */
42093
+ expectedRemoteHash?: string;
42094
+ /** Implies dryRun; throws SurfaceDriftError unless the plan is 'none'. */
42095
+ expectNoChanges?: boolean;
42096
+ }
42097
+ interface EnsureSurfaceConverged {
42098
+ result: 'unchanged' | 'created' | 'updated';
42099
+ surfaceId: string;
42100
+ /** The server-computed canonical hash (echo this — never your own). */
42101
+ contentHash: string;
42102
+ }
42103
+ interface EnsureSurfacePlan {
42104
+ result: 'plan';
42105
+ changes: 'none' | 'create' | 'update';
42106
+ changedKeys: string[];
42107
+ contentHash: string;
42108
+ remoteHash?: string;
42109
+ surfaceId?: string;
42110
+ }
42111
+ type EnsureSurfaceResult = EnsureSurfaceConverged | EnsureSurfacePlan;
42112
+ interface SurfacePullResult {
42113
+ surfaceId: string;
42114
+ definition: SurfaceDefinition;
42115
+ contentHash: string;
42116
+ lastModifiedSource: string | null;
42117
+ updatedAt: string | null;
42118
+ }
42119
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
42120
+ declare class SurfaceEnsureConflictError extends Error {
42121
+ readonly code: 'external_modification' | 'remote_changed';
42122
+ readonly lastModifiedSource?: string;
42123
+ readonly modifiedAt?: string | null;
42124
+ readonly currentHash?: string | null;
42125
+ constructor(body: {
42126
+ error?: string;
42127
+ code: 'external_modification' | 'remote_changed';
42128
+ lastModifiedSource?: string;
42129
+ modifiedAt?: string | null;
42130
+ currentHash?: string | null;
42131
+ });
42132
+ }
42133
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
42134
+ declare class SurfaceDriftError extends Error {
42135
+ readonly plan: EnsureSurfacePlan;
42136
+ constructor(plan: EnsureSurfacePlan);
42137
+ }
42138
+
42139
+ /**
42140
+ * SurfacesNamespace — config-as-code operations for product surfaces.
42141
+ *
42142
+ * `surfaces.ensure` is the deploy-time, non-executing converge (create-or-update
42143
+ * a surface by name within a product); `surfaces.pull` is the absorb-drift
42144
+ * direction. Both delegate to the implementation in `surfaces-ensure.ts`.
42145
+ *
42146
+ * Surfaces are PRODUCT-scoped: every operation takes the owning `productId`.
42147
+ */
42148
+
42149
+ declare class SurfacesNamespace {
42150
+ private getClient;
42151
+ constructor(getClient: () => RuntypeClient$1);
42152
+ /**
42153
+ * Idempotently converge a `defineSurface` definition onto a product.
42154
+ * Hash-first: the steady state is one tiny probe request. Creates or updates
42155
+ * the surface; never deletes. Identity is name + product.
42156
+ *
42157
+ * @example
42158
+ * ```typescript
42159
+ * const chat = defineSurface({
42160
+ * name: 'Support Chat',
42161
+ * type: 'chat',
42162
+ * behavior: { type: 'chat', greeting: 'Hi there!' },
42163
+ * status: 'active',
42164
+ * })
42165
+ *
42166
+ * // Converge (CI/deploy).
42167
+ * const result = await Runtype.surfaces.ensure('product_abc', chat)
42168
+ *
42169
+ * // PR drift gate.
42170
+ * await Runtype.surfaces.ensure('product_abc', chat, { expectNoChanges: true })
42171
+ * ```
42172
+ */
42173
+ ensure(productId: string, definition: SurfaceDefinition, options?: EnsureSurfaceOptions): Promise<EnsureSurfaceResult>;
42174
+ /**
42175
+ * Pull the canonical definition + provenance for a surface by name within a
42176
+ * product — the absorb-drift direction of the ensure protocol.
42177
+ */
42178
+ pull(productId: string, name: string): Promise<SurfacePullResult>;
42179
+ }
42180
+
41028
42181
  /**
41029
42182
  * Runtype - The unified SDK client for building and executing flows, batches, evals, and prompts
41030
42183
  *
@@ -41355,6 +42508,33 @@ declare class Runtype {
41355
42508
  * ```
41356
42509
  */
41357
42510
  static get products(): ProductsNamespace;
42511
+ /**
42512
+ * Config-as-code operations for product surfaces. `surfaces.ensure` is the
42513
+ * deploy-time, non-executing converge (create-or-update a surface by name
42514
+ * within a product); `surfaces.pull` is the absorb-drift direction.
42515
+ *
42516
+ * @example
42517
+ * ```typescript
42518
+ * import { Runtype, defineSurface } from '@runtypelabs/sdk'
42519
+ *
42520
+ * const chat = defineSurface({
42521
+ * name: 'Support Chat',
42522
+ * type: 'chat',
42523
+ * behavior: { type: 'chat', greeting: 'Hi there!' },
42524
+ * status: 'active',
42525
+ * })
42526
+ *
42527
+ * // Converge at deploy time (idempotent; one tiny probe in steady state)
42528
+ * await Runtype.surfaces.ensure('product_abc', chat)
42529
+ *
42530
+ * // CI drift gate
42531
+ * await Runtype.surfaces.ensure('product_abc', chat, { expectNoChanges: true })
42532
+ *
42533
+ * // Absorb a dashboard edit back into the repo
42534
+ * const { definition } = await Runtype.surfaces.pull('product_abc', 'Support Chat')
42535
+ * ```
42536
+ */
42537
+ static get surfaces(): SurfacesNamespace;
41358
42538
  }
41359
42539
 
41360
42540
  /**
@@ -44055,6 +45235,45 @@ interface UpdateAppRequest {
44055
45235
  visibility?: 'public' | 'unlisted';
44056
45236
  status?: 'active' | 'suspended';
44057
45237
  }
45238
+ /**
45239
+ * Tool approval grant (cross-session "Always allow") returned by the grants
45240
+ * API. A null `endUserRef` is an account-level grant.
45241
+ */
45242
+ interface ToolApprovalGrant {
45243
+ id: string;
45244
+ agentId: string;
45245
+ endUserRef: string | null;
45246
+ toolType: string;
45247
+ toolName: string;
45248
+ decision: string;
45249
+ sourceExecutionId: string | null;
45250
+ sourceApprovalId: string | null;
45251
+ createdAt: string;
45252
+ expiresAt: string | null;
45253
+ }
45254
+ /**
45255
+ * Tool Approval Grants API
45256
+ *
45257
+ * Manage cross-session "Always allow" tool-approval grants: list the
45258
+ * authenticated owner's remembered approvals and revoke them so the tool
45259
+ * prompts for approval again on future dispatches.
45260
+ */
45261
+ declare class ToolApprovalGrantsEndpoint {
45262
+ private client;
45263
+ constructor(client: ApiClient);
45264
+ /**
45265
+ * List active remembered tool-approval grants for the authenticated owner,
45266
+ * optionally filtered to a single agent.
45267
+ */
45268
+ list(agentId?: string): Promise<ToolApprovalGrant[]>;
45269
+ /**
45270
+ * Revoke (soft-delete) a remembered grant so the tool prompts for approval
45271
+ * again on future dispatches.
45272
+ */
45273
+ revoke(id: string): Promise<{
45274
+ revoked: boolean;
45275
+ }>;
45276
+ }
44058
45277
  /**
44059
45278
  * Apps endpoint handlers — Runtype Apps are hosted AI apps served at
44060
45279
  * {slug}-{shortId}.runtype.run. Deploy = upload a version (zip), then
@@ -44185,6 +45404,7 @@ declare class RuntypeClient implements ApiClient {
44185
45404
  flowVersions: FlowVersionsEndpoint;
44186
45405
  integrations: IntegrationsEndpoint;
44187
45406
  billing: BillingEndpoint;
45407
+ toolApprovalGrants: ToolApprovalGrantsEndpoint;
44188
45408
  constructor(config?: ClientConfig);
44189
45409
  /**
44190
45410
  * Set the API key for authentication
@@ -45753,4 +46973,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
45753
46973
  declare function getDefaultPlanPath(taskName: string): string;
45754
46974
  declare function sanitizeTaskSlug(taskName: string): string;
45755
46975
 
45756
- export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AssetReferenceContentPart, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineProductInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureProductConverged, type EnsureProductOptions, type EnsureProductPlan, type EnsureProductResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type ProductDefinition, ProductDriftError, ProductEnsureConflictError, type ProductPullResult, ProductsNamespace, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceListParams, SurfacesEndpoint, type TextContentPart, type Tool, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeProductContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, definePlaybook, defineProduct, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeProductDefinition, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };
46976
+ export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AssetReferenceContentPart, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineProductInput, type DefineSkillInput, type DefineSurfaceInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureProductConverged, type EnsureProductOptions, type EnsureProductPlan, type EnsureProductResult, type EnsureSkillConverged, type EnsureSkillOptions, type EnsureSkillPlan, type EnsureSkillResult, type EnsureSurfaceConverged, type EnsureSurfaceOptions, type EnsureSurfacePlan, type EnsureSurfaceResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type ProductDefinition, ProductDriftError, ProductEnsureConflictError, type ProductPullResult, ProductsNamespace, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillScanFinding as RuntypeSkillScanFinding, type SkillScanResult as RuntypeSkillScanResult, type SkillScanVerdict as RuntypeSkillScanVerdict, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillDefinition, SkillDriftError, SkillEnsureConflictError, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillPullResult, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceDefinition, type SurfaceDefinitionEnvironment, type SurfaceDefinitionStatus, type SurfaceDefinitionType, SurfaceDriftError, SurfaceEnsureConflictError, type SurfaceListParams, type SurfacePullResult, SurfacesEndpoint, SurfacesNamespace, type TextContentPart, type Tool, type ToolApprovalGrant, ToolApprovalGrantsEndpoint, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeProductContentHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, definePlaybook, defineProduct, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeProductDefinition, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };