@runtypelabs/sdk 9.13.0 → 9.15.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
@@ -2711,6 +2711,8 @@ interface paths {
2711
2711
  data: {
2712
2712
  alias: string;
2713
2713
  archivedAt: string | null;
2714
+ /** @description Names of the per-alias secret bindings in force at this pointer. Executions that resolve through it read these ahead of the organization secret of the same name. Names only: a binding value is never returned by any read. */
2715
+ bindingNames: string[];
2714
2716
  contentHash: string | null;
2715
2717
  createdAt: string;
2716
2718
  expiresAt: string | null;
@@ -2720,6 +2722,8 @@ interface paths {
2720
2722
  versionId: string;
2721
2723
  versionNumber: number | null;
2722
2724
  }[];
2725
+ /** @description Whether an execution that names no version selector already resolves this agent through its `live` alias. False means a save still changes what runs, so moving production needs a publish; true means `live` is authoritative and moving production is an alias activation. */
2726
+ liveDefault: boolean;
2723
2727
  nextCursor: string | null;
2724
2728
  };
2725
2729
  };
@@ -2813,6 +2817,8 @@ interface paths {
2813
2817
  "application/json": {
2814
2818
  alias: string;
2815
2819
  archivedAt: string | null;
2820
+ /** @description Names of the per-alias secret bindings in force at this pointer. Executions that resolve through it read these ahead of the organization secret of the same name. Names only: a binding value is never returned by any read. */
2821
+ bindingNames: string[];
2816
2822
  contentHash: string | null;
2817
2823
  createdAt: string;
2818
2824
  expiresAt: string | null;
@@ -2916,6 +2922,8 @@ interface paths {
2916
2922
  /** @description How many preview aliases this agent has active after the write. Null for `live`, which is never counted. Read it beside `previewLimit` to see a per-pull-request pipeline filling up before an activation is refused with PREVIEW_ALIAS_LIMIT. */
2917
2923
  activePreviewCount: number | null;
2918
2924
  alias: string;
2925
+ /** @description Per-alias secret binding names in force after this activation. Names only, never values. */
2926
+ bindingNames: string[];
2919
2927
  changed: boolean;
2920
2928
  /** @description The active-preview ceiling this agent is counted against. Null for `live`. */
2921
2929
  previewLimit: number | null;
@@ -3150,6 +3158,344 @@ interface paths {
3150
3158
  patch?: never;
3151
3159
  trace?: never;
3152
3160
  };
3161
+ "/v1/agents/{id}/aliases/{alias}/bindings": {
3162
+ parameters: {
3163
+ query?: never;
3164
+ header?: never;
3165
+ path?: never;
3166
+ cookie?: never;
3167
+ };
3168
+ /**
3169
+ * Read the secret binding names of a release alias
3170
+ * @description The per-alias secret binding NAMES this pointer carries. A binding value is write-only: no read surface returns it, and it never appears on a receipt, an audit envelope or a log line.
3171
+ */
3172
+ get: {
3173
+ parameters: {
3174
+ query?: never;
3175
+ header?: never;
3176
+ path: {
3177
+ id: string;
3178
+ alias: string;
3179
+ };
3180
+ cookie?: never;
3181
+ };
3182
+ requestBody?: never;
3183
+ responses: {
3184
+ /** @description Binding names */
3185
+ 200: {
3186
+ headers: {
3187
+ [name: string]: unknown;
3188
+ };
3189
+ content: {
3190
+ "application/json": {
3191
+ alias: string;
3192
+ /** @description Present on a write: false when the set was already identical and nothing moved. */
3193
+ changed?: boolean;
3194
+ names: string[];
3195
+ /** @description The `bind` receipt this write appended, or null when it changed nothing. */
3196
+ receiptId?: string | null;
3197
+ revision: number;
3198
+ };
3199
+ };
3200
+ };
3201
+ /** @description Invalid request */
3202
+ 400: {
3203
+ headers: {
3204
+ [name: string]: unknown;
3205
+ };
3206
+ content: {
3207
+ "application/json": components["schemas"]["Error"];
3208
+ };
3209
+ };
3210
+ /** @description Unauthorized */
3211
+ 401: {
3212
+ headers: {
3213
+ [name: string]: unknown;
3214
+ };
3215
+ content: {
3216
+ "application/json": components["schemas"]["Error"];
3217
+ };
3218
+ };
3219
+ /** @description Insufficient permissions */
3220
+ 403: {
3221
+ headers: {
3222
+ [name: string]: unknown;
3223
+ };
3224
+ content: {
3225
+ "application/json": components["schemas"]["Error"];
3226
+ };
3227
+ };
3228
+ /** @description Alias or agent not found */
3229
+ 404: {
3230
+ headers: {
3231
+ [name: string]: unknown;
3232
+ };
3233
+ content: {
3234
+ "application/json": components["schemas"]["Error"] & {
3235
+ agentId: string;
3236
+ alias: string;
3237
+ /** @enum {string} */
3238
+ code: "alias_not_found";
3239
+ };
3240
+ };
3241
+ };
3242
+ /** @description Internal server error */
3243
+ 500: {
3244
+ headers: {
3245
+ [name: string]: unknown;
3246
+ };
3247
+ content: {
3248
+ "application/json": components["schemas"]["Error"];
3249
+ };
3250
+ };
3251
+ };
3252
+ };
3253
+ /**
3254
+ * Replace the secret bindings of a release alias
3255
+ * @description Replace the complete set of `{{secret:NAME}}` values executions resolve when they reach this agent through this pointer. A binding wins over the organization secret of the same name, so one preview per pull request can aim its HTTP tools at that pull request environment while the version content stays byte-identical to what `live` runs. Whole-set replacement: a name you stop sending stops resolving. Values are encrypted at rest and never returned. Names beginning RUNTYPE_, PLATFORM_, CLOUDFLARE_ or INTERNAL_ are refused because they are platform-resolved before the alias plane. A change bumps the alias revision and appends a `bind` receipt; an identical set writes nothing. Requires the same deploy scope as activating this alias.
3256
+ */
3257
+ put: {
3258
+ parameters: {
3259
+ query?: never;
3260
+ header?: {
3261
+ /** @description The alias revision this write expects. Required on a `live` alias that already exists (428 without it) and refused with 412 when the stored revision has moved on. Optional on preview aliases and on the first `live` deployment, which has no revision yet. */
3262
+ "if-match"?: string;
3263
+ /** @description Replay key. Repeating an activation with the same key returns the receipt the first call produced instead of moving the pointer twice. */
3264
+ "idempotency-key"?: string;
3265
+ };
3266
+ path: {
3267
+ id: string;
3268
+ alias: string;
3269
+ };
3270
+ cookie?: never;
3271
+ };
3272
+ requestBody?: {
3273
+ content: {
3274
+ "application/json": {
3275
+ /** @description The complete binding set, NAME to value. An empty object clears every binding. */
3276
+ bindings: {
3277
+ [key: string]: string;
3278
+ };
3279
+ /** @description Why this binding write happened, recorded on the receipt for humans. */
3280
+ reason?: string;
3281
+ };
3282
+ };
3283
+ };
3284
+ responses: {
3285
+ /** @description Bindings replaced */
3286
+ 200: {
3287
+ headers: {
3288
+ [name: string]: unknown;
3289
+ };
3290
+ content: {
3291
+ "application/json": {
3292
+ alias: string;
3293
+ /** @description Present on a write: false when the set was already identical and nothing moved. */
3294
+ changed?: boolean;
3295
+ names: string[];
3296
+ /** @description The `bind` receipt this write appended, or null when it changed nothing. */
3297
+ receiptId?: string | null;
3298
+ revision: number;
3299
+ };
3300
+ };
3301
+ };
3302
+ /** @description Binding name or value rejected */
3303
+ 400: {
3304
+ headers: {
3305
+ [name: string]: unknown;
3306
+ };
3307
+ content: {
3308
+ "application/json": components["schemas"]["Error"] & {
3309
+ /** @enum {string} */
3310
+ code: "alias_binding_invalid";
3311
+ };
3312
+ };
3313
+ };
3314
+ /** @description Unauthorized */
3315
+ 401: {
3316
+ headers: {
3317
+ [name: string]: unknown;
3318
+ };
3319
+ content: {
3320
+ "application/json": components["schemas"]["Error"];
3321
+ };
3322
+ };
3323
+ /** @description Insufficient permissions */
3324
+ 403: {
3325
+ headers: {
3326
+ [name: string]: unknown;
3327
+ };
3328
+ content: {
3329
+ "application/json": components["schemas"]["Error"];
3330
+ };
3331
+ };
3332
+ /** @description Alias or agent not found */
3333
+ 404: {
3334
+ headers: {
3335
+ [name: string]: unknown;
3336
+ };
3337
+ content: {
3338
+ "application/json": components["schemas"]["Error"] & {
3339
+ agentId: string;
3340
+ alias: string;
3341
+ /** @enum {string} */
3342
+ code: "alias_not_found";
3343
+ };
3344
+ };
3345
+ };
3346
+ /** @description Alias revision mismatch */
3347
+ 412: {
3348
+ headers: {
3349
+ [name: string]: unknown;
3350
+ };
3351
+ content: {
3352
+ "application/json": components["schemas"]["Error"] & {
3353
+ actual: number | null;
3354
+ /** @enum {string} */
3355
+ code: "alias_revision_mismatch";
3356
+ expected: number;
3357
+ };
3358
+ };
3359
+ };
3360
+ /** @description If-Match required for the live alias */
3361
+ 428: {
3362
+ headers: {
3363
+ [name: string]: unknown;
3364
+ };
3365
+ content: {
3366
+ "application/json": components["schemas"]["Error"];
3367
+ };
3368
+ };
3369
+ /** @description Internal server error */
3370
+ 500: {
3371
+ headers: {
3372
+ [name: string]: unknown;
3373
+ };
3374
+ content: {
3375
+ "application/json": components["schemas"]["Error"];
3376
+ };
3377
+ };
3378
+ };
3379
+ };
3380
+ post?: never;
3381
+ /**
3382
+ * Clear the secret bindings of a release alias
3383
+ * @description Remove every per-alias secret binding from this pointer, so its executions fall back to the organization secrets. Equivalent to replacing the set with an empty object.
3384
+ */
3385
+ delete: {
3386
+ parameters: {
3387
+ query?: never;
3388
+ header?: {
3389
+ /** @description The alias revision this write expects. Required on a `live` alias that already exists (428 without it) and refused with 412 when the stored revision has moved on. Optional on preview aliases and on the first `live` deployment, which has no revision yet. */
3390
+ "if-match"?: string;
3391
+ /** @description Replay key. Repeating an activation with the same key returns the receipt the first call produced instead of moving the pointer twice. */
3392
+ "idempotency-key"?: string;
3393
+ };
3394
+ path: {
3395
+ id: string;
3396
+ alias: string;
3397
+ };
3398
+ cookie?: never;
3399
+ };
3400
+ requestBody?: never;
3401
+ responses: {
3402
+ /** @description Bindings cleared */
3403
+ 200: {
3404
+ headers: {
3405
+ [name: string]: unknown;
3406
+ };
3407
+ content: {
3408
+ "application/json": {
3409
+ alias: string;
3410
+ /** @description Present on a write: false when the set was already identical and nothing moved. */
3411
+ changed?: boolean;
3412
+ names: string[];
3413
+ /** @description The `bind` receipt this write appended, or null when it changed nothing. */
3414
+ receiptId?: string | null;
3415
+ revision: number;
3416
+ };
3417
+ };
3418
+ };
3419
+ /** @description Invalid request */
3420
+ 400: {
3421
+ headers: {
3422
+ [name: string]: unknown;
3423
+ };
3424
+ content: {
3425
+ "application/json": components["schemas"]["Error"];
3426
+ };
3427
+ };
3428
+ /** @description Unauthorized */
3429
+ 401: {
3430
+ headers: {
3431
+ [name: string]: unknown;
3432
+ };
3433
+ content: {
3434
+ "application/json": components["schemas"]["Error"];
3435
+ };
3436
+ };
3437
+ /** @description Insufficient permissions */
3438
+ 403: {
3439
+ headers: {
3440
+ [name: string]: unknown;
3441
+ };
3442
+ content: {
3443
+ "application/json": components["schemas"]["Error"];
3444
+ };
3445
+ };
3446
+ /** @description Alias or agent not found */
3447
+ 404: {
3448
+ headers: {
3449
+ [name: string]: unknown;
3450
+ };
3451
+ content: {
3452
+ "application/json": components["schemas"]["Error"] & {
3453
+ agentId: string;
3454
+ alias: string;
3455
+ /** @enum {string} */
3456
+ code: "alias_not_found";
3457
+ };
3458
+ };
3459
+ };
3460
+ /** @description Alias revision mismatch */
3461
+ 412: {
3462
+ headers: {
3463
+ [name: string]: unknown;
3464
+ };
3465
+ content: {
3466
+ "application/json": components["schemas"]["Error"] & {
3467
+ actual: number | null;
3468
+ /** @enum {string} */
3469
+ code: "alias_revision_mismatch";
3470
+ expected: number;
3471
+ };
3472
+ };
3473
+ };
3474
+ /** @description If-Match required for the live alias */
3475
+ 428: {
3476
+ headers: {
3477
+ [name: string]: unknown;
3478
+ };
3479
+ content: {
3480
+ "application/json": components["schemas"]["Error"];
3481
+ };
3482
+ };
3483
+ /** @description Internal server error */
3484
+ 500: {
3485
+ headers: {
3486
+ [name: string]: unknown;
3487
+ };
3488
+ content: {
3489
+ "application/json": components["schemas"]["Error"];
3490
+ };
3491
+ };
3492
+ };
3493
+ };
3494
+ options?: never;
3495
+ head?: never;
3496
+ patch?: never;
3497
+ trace?: never;
3498
+ };
3153
3499
  "/v1/agents/{id}/aliases/{alias}/rollback": {
3154
3500
  parameters: {
3155
3501
  query?: never;
@@ -3198,6 +3544,8 @@ interface paths {
3198
3544
  /** @description How many preview aliases this agent has active after the write. Null for `live`, which is never counted. Read it beside `previewLimit` to see a per-pull-request pipeline filling up before an activation is refused with PREVIEW_ALIAS_LIMIT. */
3199
3545
  activePreviewCount: number | null;
3200
3546
  alias: string;
3547
+ /** @description Per-alias secret binding names in force after this activation. Names only, never values. */
3548
+ bindingNames: string[];
3201
3549
  changed: boolean;
3202
3550
  /** @description The active-preview ceiling this agent is counted against. Null for `live`. */
3203
3551
  previewLimit: number | null;
@@ -3761,6 +4109,10 @@ interface paths {
3761
4109
  actorUserId: string | null;
3762
4110
  alias: string;
3763
4111
  aliasRevision: number;
4112
+ /** @description The per-alias secret binding NAMES in force when this receipt was written, as `{ names: [...] }`. Null when the pointer carried none. Values never appear here. */
4113
+ bindings: {
4114
+ [key: string]: unknown;
4115
+ } | null;
3764
4116
  createdAt: string;
3765
4117
  dependencies: {
3766
4118
  [key: string]: unknown;
@@ -4197,6 +4549,7 @@ interface paths {
4197
4549
  /** @enum {string} */
4198
4550
  executionMode: "attached" | "detached";
4199
4551
  expiresAt: string | null;
4552
+ externalObservedApprovals: components["schemas"]["ExternalObservedApprovals"];
4200
4553
  finalOutput?: unknown;
4201
4554
  id: string;
4202
4555
  inputMessages?: unknown;
@@ -4701,7 +5054,7 @@ interface paths {
4701
5054
  };
4702
5055
  /**
4703
5056
  * Export agent for runtime
4704
- * @description Export a fully-resolved, self-contained agent definition that the @runtypelabs/runtime package can consume directly at boot. Capabilities, flows, and nested sub-agents are inlined recursively (up to 3 levels). MCP credential values and external-agent auth credentials are replaced with secret-name references.
5057
+ * @description Export a fully-resolved, self-contained agent definition that the @runtypelabs/runtime package can consume directly at boot. Capabilities, flows, and nested sub-agents are inlined recursively (up to 3 levels). MCP credential values and external-agent auth credentials are replaced with secret-name references. Requires the `RUNTIME:EXPORT` scope and an Enterprise plan (the `byoc` entitlement); an unentitled account receives `403` with code `BYOC_PLAN_REQUIRED` in every environment.
4705
5058
  *
4706
5059
  * The response carries `hostDependencies`: the runtime seams the exported artifact needs a host to wire before it can run everything it describes. A durable-class step (`wait-until` or `crawl`) anywhere in the agent's executable closure declares a `durable-pause-host` dependency; a detached-capable dynamic subagent pool or a detached inline subagent tool declares a `background-run-coordinator` dependency. The array is empty when nothing needs wiring.
4707
5060
  */
@@ -12650,6 +13003,11 @@ interface paths {
12650
13003
  name?: string;
12651
13004
  steps?: unknown[];
12652
13005
  };
13006
+ /**
13007
+ * @description Where this turn's prior history comes from. "inline" (the default, and today's behavior) replays exactly the `messages` sent here. "stored" replays the transcript saved on the `conversationId` conversation, treats `messages` as the new delta, and appends both the delta and the settled assistant turn back onto it; it requires a saved `agent.agentId` and a `conversationId`, and is refused for a flow dispatch, an inline or `claude_managed` agent, `Prefer: respond-async`, a join, or a resume.
13008
+ * @enum {string}
13009
+ */
13010
+ history?: "inline" | "stored";
12653
13011
  /** @description Customer-native auth proof for the Identity Exchange. When present and the surface has a matching integration, the verified tenant/end-user replace any body-asserted tenant/endUser (which are never trusted for web-embedded callers). When Identity Exchange admission is disabled for the caller, the proof is accepted but ignored and confers no trust. */
12654
13012
  identityProof?: {
12655
13013
  provider: string;
@@ -12658,7 +13016,7 @@ interface paths {
12658
13016
  inputs?: {
12659
13017
  [key: string]: unknown;
12660
13018
  };
12661
- /** @description Conversation history for this turn. A `system` message that is not the first message keeps its position on OpenAI-family models (so a per-turn system message sent last leaves the cached leading prompt untouched) and is folded into the leading system prompt on providers that require a single leading system turn. */
13019
+ /** @description Conversation history for this turn, or with `history: "stored"` only the new delta. A `system` message that is not the first message keeps its position on OpenAI-family models (so a per-turn system message sent last leaves the cached leading prompt untouched) and is folded into the leading system prompt on providers that require a single leading system turn. A `tool` message must carry `toolResults` answering an assistant `toolCalls` entry issued earlier in the array. */
12662
13020
  messages?: {
12663
13021
  content: string | ({
12664
13022
  text: string;
@@ -12684,7 +13042,30 @@ interface paths {
12684
13042
  type: "reasoning";
12685
13043
  })[];
12686
13044
  /** @enum {string} */
12687
- role: "system" | "user" | "assistant";
13045
+ role: "system" | "user" | "assistant" | "tool";
13046
+ /** @description Assistant messages only. Every entry must be answered by the next tool message. */
13047
+ toolCalls?: {
13048
+ /** @default {} */
13049
+ args?: {
13050
+ [key: string]: unknown;
13051
+ };
13052
+ providerOptions?: {
13053
+ [key: string]: unknown;
13054
+ };
13055
+ toolCallId: string;
13056
+ toolName: string;
13057
+ }[];
13058
+ /** @description Tool messages only, and required on them. */
13059
+ toolResults?: {
13060
+ providerOptions?: {
13061
+ [key: string]: unknown;
13062
+ };
13063
+ /** @description Whatever the tool returned. */
13064
+ result?: unknown;
13065
+ /** @description Must answer a toolCalls entry issued earlier. */
13066
+ toolCallId: string;
13067
+ toolName: string;
13068
+ }[];
12688
13069
  }[];
12689
13070
  /**
12690
13071
  * @default {
@@ -13070,6 +13451,11 @@ interface paths {
13070
13451
  name?: string;
13071
13452
  steps?: unknown[];
13072
13453
  };
13454
+ /**
13455
+ * @description Where this turn's prior history comes from. "inline" (the default, and today's behavior) replays exactly the `messages` sent here. "stored" replays the transcript saved on the `conversationId` conversation, treats `messages` as the new delta, and appends both the delta and the settled assistant turn back onto it; it requires a saved `agent.agentId` and a `conversationId`, and is refused for a flow dispatch, an inline or `claude_managed` agent, `Prefer: respond-async`, a join, or a resume.
13456
+ * @enum {string}
13457
+ */
13458
+ history?: "inline" | "stored";
13073
13459
  /** @description Customer-native auth proof for the Identity Exchange. When present and the surface has a matching integration, the verified tenant/end-user replace any body-asserted tenant/endUser (which are never trusted for web-embedded callers). When Identity Exchange admission is disabled for the caller, the proof is accepted but ignored and confers no trust. */
13074
13460
  identityProof?: {
13075
13461
  provider: string;
@@ -13078,7 +13464,7 @@ interface paths {
13078
13464
  inputs?: {
13079
13465
  [key: string]: unknown;
13080
13466
  };
13081
- /** @description Conversation history for this turn. A `system` message that is not the first message keeps its position on OpenAI-family models (so a per-turn system message sent last leaves the cached leading prompt untouched) and is folded into the leading system prompt on providers that require a single leading system turn. */
13467
+ /** @description Conversation history for this turn, or with `history: "stored"` only the new delta. A `system` message that is not the first message keeps its position on OpenAI-family models (so a per-turn system message sent last leaves the cached leading prompt untouched) and is folded into the leading system prompt on providers that require a single leading system turn. A `tool` message must carry `toolResults` answering an assistant `toolCalls` entry issued earlier in the array. */
13082
13468
  messages?: {
13083
13469
  content: string | ({
13084
13470
  text: string;
@@ -13104,7 +13490,30 @@ interface paths {
13104
13490
  type: "reasoning";
13105
13491
  })[];
13106
13492
  /** @enum {string} */
13107
- role: "system" | "user" | "assistant";
13493
+ role: "system" | "user" | "assistant" | "tool";
13494
+ /** @description Assistant messages only. Every entry must be answered by the next tool message. */
13495
+ toolCalls?: {
13496
+ /** @default {} */
13497
+ args?: {
13498
+ [key: string]: unknown;
13499
+ };
13500
+ providerOptions?: {
13501
+ [key: string]: unknown;
13502
+ };
13503
+ toolCallId: string;
13504
+ toolName: string;
13505
+ }[];
13506
+ /** @description Tool messages only, and required on them. */
13507
+ toolResults?: {
13508
+ providerOptions?: {
13509
+ [key: string]: unknown;
13510
+ };
13511
+ /** @description Whatever the tool returned. */
13512
+ result?: unknown;
13513
+ /** @description Must answer a toolCalls entry issued earlier. */
13514
+ toolCallId: string;
13515
+ toolName: string;
13516
+ }[];
13108
13517
  }[];
13109
13518
  /**
13110
13519
  * @default {
@@ -24634,7 +25043,7 @@ interface paths {
24634
25043
  content: {
24635
25044
  "application/json": {
24636
25045
  data: {
24637
- /** @description True when part of the window could not be read, so entries are missing: historical (R2 SQL) logs were unavailable, or the recent hot tier failed. Rows the hot tier evicted are served from R2 instead, so an eviction sets this only for the part too recent for R2 to have ingested. Absent on healthy responses. */
25046
+ /** @description True when part of the window could not be read, so entries may be missing. Evicted ordinary rows are recovered from R2 when old enough; receipt-backed recovery remains degraded when source time cannot prove ingestion. Absent on healthy responses. */
24638
25047
  degraded?: boolean;
24639
25048
  entries: {
24640
25049
  [key: string]: unknown;
@@ -24827,7 +25236,7 @@ interface paths {
24827
25236
  byType: {
24828
25237
  [key: string]: number;
24829
25238
  };
24830
- /** @description True when part of the window could not be read, so counts are partial: historical (R2 SQL) counts were unavailable, or the recent hot tier failed. Rows the hot tier evicted are counted from R2 instead, so an eviction sets this only for the part too recent for R2 to have ingested. Absent on healthy responses, which are the only ones cached. */
25239
+ /** @description True when part of the window could not be read, so counts may be partial. Evicted ordinary rows are counted from R2 when old enough; receipt-backed recovery remains degraded when source time cannot prove ingestion. Absent on healthy responses, which are the only ones cached. */
24831
25240
  degraded?: boolean;
24832
25241
  histogram: {
24833
25242
  bucket: string;
@@ -27322,6 +27731,11 @@ interface paths {
27322
27731
  inputCostPer1kTokens: number;
27323
27732
  /** @default 4096 */
27324
27733
  maxOutputTokens?: number;
27734
+ /**
27735
+ * @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.
27736
+ * @enum {string}
27737
+ */
27738
+ midConversationSystemMessages?: "preserve" | "hoist";
27325
27739
  outputCostPer1kTokens: number;
27326
27740
  reasoning?: {
27327
27741
  defaultEffort?: string;
@@ -27988,6 +28402,11 @@ interface paths {
27988
28402
  inputCostPer1kTokens: number;
27989
28403
  /** @default 4096 */
27990
28404
  maxOutputTokens?: number;
28405
+ /**
28406
+ * @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.
28407
+ * @enum {string}
28408
+ */
28409
+ midConversationSystemMessages?: "preserve" | "hoist";
27991
28410
  outputCostPer1kTokens: number;
27992
28411
  reasoning?: {
27993
28412
  defaultEffort?: string;
@@ -36364,6 +36783,11 @@ interface paths {
36364
36783
  id: string;
36365
36784
  inputCostPer1kTokens?: number;
36366
36785
  maxOutputTokens?: number;
36786
+ /**
36787
+ * @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.
36788
+ * @enum {string}
36789
+ */
36790
+ midConversationSystemMessages?: "preserve" | "hoist";
36367
36791
  outputCostPer1kTokens?: number;
36368
36792
  reasoning?: {
36369
36793
  defaultEffort?: string;
@@ -44583,6 +45007,26 @@ interface paths {
44583
45007
  patch?: never;
44584
45008
  trace?: never;
44585
45009
  };
45010
+ "/v1/telemetry/ingest-health": {
45011
+ parameters: {
45012
+ query?: never;
45013
+ header?: never;
45014
+ path?: never;
45015
+ cookie?: never;
45016
+ };
45017
+ /**
45018
+ * Inspect OTLP admission, queryability, and durable recovery debt
45019
+ * @description Owner-scoped delivery receipts retained for 30 days. Lag is acceptance to the first positive query probe, not stream ACK latency or a production SLO guarantee. Idle is not proof of sink health. No transcripts or retained payloads are returned. Requires ANALYTICS:READ or AGENTS:READ; TELEMETRY:WRITE alone is append-only.
45020
+ */
45021
+ get: operations["getOtlpIngestHealth"];
45022
+ put?: never;
45023
+ post?: never;
45024
+ delete?: never;
45025
+ options?: never;
45026
+ head?: never;
45027
+ patch?: never;
45028
+ trace?: never;
45029
+ };
44586
45030
  "/v1/tool-approval-grants": {
44587
45031
  parameters: {
44588
45032
  query?: never;
@@ -47403,6 +47847,10 @@ interface components {
47403
47847
  /** @description Atomically save this definition and activate it at a release alias. Use { alias: "live" } to deploy to production, or any name matching ^[a-z0-9][a-z0-9-]{0,62}$ for a preview pointer. A non-live alias appends a candidate version and moves that one pointer: it never writes the agent row, its config hash, its capabilities, its draft pointer or its live pointer, so onConflict and expectedRemoteHash describe writes it never performs and are rejected with a 400 alongside it. A release alias is organization-owned, so a non-live deploy on a personal-scope agent is a 400 with code alias_requires_organization. Mutually exclusive with release. */
47404
47848
  AgentEnsureDeployTarget: {
47405
47849
  alias: string;
47850
+ /** @description The complete set of `{{secret:NAME}}` values executions resolve when they reach this agent through this pointer, ahead of the organization secret of the same name. One preview per pull request can aim its HTTP tools at that pull request environment while the version content stays byte-identical to what `live` runs. Whole-set replacement: a name you stop sending stops resolving, and an empty object clears them. Values are encrypted at rest and never returned; only their names appear on the deployment receipt. */
47851
+ bindings?: {
47852
+ [key: string]: string;
47853
+ };
47406
47854
  };
47407
47855
  /** @description Present when the converge carried release or deploy and the activation was applied. */
47408
47856
  AgentEnsureDeployment: {
@@ -47915,7 +48363,7 @@ interface components {
47915
48363
  };
47916
48364
  /** @description Import provenance, stored as metadata.importSource. */
47917
48365
  ConversationSource: {
47918
- /** @description The conversation id in the source system. */
48366
+ /** @description The conversation id in the source system. Re-creating with the same system and externalId returns the existing conversation with imported: false instead of a duplicate. */
47919
48367
  externalId?: string;
47920
48368
  /** Format: date-time */
47921
48369
  importedAt?: string;
@@ -47924,6 +48372,7 @@ interface components {
47924
48372
  };
47925
48373
  ConversationTranscriptMessage: {
47926
48374
  author?: components["schemas"]["ConversationMessageAuthor"];
48375
+ /** @description Plain string, or an array of {type:"text"|"image"|"file"|"reasoning"|"asset_ref"} parts. */
47927
48376
  content: string | (({
47928
48377
  text: string;
47929
48378
  /** @enum {string} */
@@ -47967,12 +48416,14 @@ interface components {
47967
48416
  })[];
47968
48417
  /** @description ISO 8601 when Runtype mints it; any string is accepted on import. */
47969
48418
  createdAt?: string;
48419
+ /** @description Minted when omitted. Use the source system id to make an import resumable. */
47970
48420
  id?: string;
47971
48421
  metadata?: {
47972
48422
  [key: string]: unknown;
47973
48423
  };
47974
48424
  /** @enum {string} */
47975
48425
  role: "system" | "user" | "assistant" | "tool";
48426
+ /** @description Assistant messages only. Every entry must be answered by the next tool message. */
47976
48427
  toolCalls?: {
47977
48428
  /** @default {} */
47978
48429
  args: {
@@ -47984,11 +48435,14 @@ interface components {
47984
48435
  toolCallId: string;
47985
48436
  toolName: string;
47986
48437
  }[];
48438
+ /** @description Tool messages only, and required on them. */
47987
48439
  toolResults?: {
47988
48440
  providerOptions?: {
47989
48441
  [key: string]: unknown;
47990
48442
  };
48443
+ /** @description Whatever the tool returned. */
47991
48444
  result?: unknown;
48445
+ /** @description Must answer a toolCalls entry issued earlier. */
47992
48446
  toolCallId: string;
47993
48447
  toolName: string;
47994
48448
  }[];
@@ -48607,6 +49061,12 @@ interface components {
48607
49061
  /** @enum {string} */
48608
49062
  targetType: "flow" | "agent";
48609
49063
  updatedAt: string;
49064
+ /** @description Non-blocking findings about this suite. `AGENT_NOT_DEPLOYED` means the target agent has no runnable `live` version, so a run that names no version selector refuses once the live default is on for the organization. */
49065
+ warnings?: {
49066
+ agentId?: string;
49067
+ code: string;
49068
+ message: string;
49069
+ }[];
48610
49070
  };
48611
49071
  EvalSuiteLatestRun: {
48612
49072
  completedAt: string | null;
@@ -48681,6 +49141,12 @@ interface components {
48681
49141
  /** @enum {string} */
48682
49142
  targetType: "flow" | "agent";
48683
49143
  updatedAt: string;
49144
+ /** @description Non-blocking findings about this suite. `AGENT_NOT_DEPLOYED` means the target agent has no runnable `live` version, so a run that names no version selector refuses once the live default is on for the organization. */
49145
+ warnings?: {
49146
+ agentId?: string;
49147
+ code: string;
49148
+ message: string;
49149
+ }[];
48684
49150
  };
48685
49151
  ExecutionStreamEvent: {
48686
49152
  agentId?: string;
@@ -49259,6 +49725,41 @@ interface components {
49259
49725
  type: "custom";
49260
49726
  value?: unknown;
49261
49727
  };
49728
+ /** @description Read-only approval observations within producer traces. Null means history unavailable; an empty lifecycle list means none observed. Structural history survives ingest-fact expiry and is retained when verbose logging is off. */
49729
+ ExternalObservedApprovals: {
49730
+ /** @enum {string} */
49731
+ availability: "observed";
49732
+ lifecycles: {
49733
+ /** @enum {string} */
49734
+ decision: "requested" | "approved" | "denied" | "conflicted";
49735
+ key: string;
49736
+ observations: {
49737
+ key: string;
49738
+ /** Format: date-time */
49739
+ observedAt?: string;
49740
+ source: {
49741
+ /** @enum {string} */
49742
+ attribute: "cloudflare.agents.tool.approval.state";
49743
+ /** @enum {string} */
49744
+ kind: "cloudflare-agents";
49745
+ spanId: string;
49746
+ traceId: string;
49747
+ };
49748
+ /** @enum {string} */
49749
+ state: "requested" | "approved" | "denied";
49750
+ }[];
49751
+ rawStates: ("requested" | "approved" | "denied")[];
49752
+ /** @enum {boolean} */
49753
+ sourceConflict?: true;
49754
+ toolCallId: string;
49755
+ toolName?: string;
49756
+ toolType?: string;
49757
+ }[];
49758
+ /** @enum {boolean} */
49759
+ truncated?: true;
49760
+ /** @enum {number} */
49761
+ version: 1;
49762
+ } | null;
49262
49763
  FlowEnsureConflict: {
49263
49764
  /** @enum {string} */
49264
49765
  code: "external_modification" | "remote_changed";
@@ -49932,6 +50433,135 @@ interface components {
49932
50433
  headers: never;
49933
50434
  pathItems: never;
49934
50435
  }
50436
+ interface operations {
50437
+ getOtlpIngestHealth: {
50438
+ parameters: {
50439
+ query?: {
50440
+ traceId?: string;
50441
+ };
50442
+ header?: never;
50443
+ path?: never;
50444
+ cookie?: never;
50445
+ };
50446
+ requestBody?: never;
50447
+ responses: {
50448
+ /** @description Admission and observed delivery health */
50449
+ 200: {
50450
+ headers: {
50451
+ [name: string]: unknown;
50452
+ };
50453
+ content: {
50454
+ "application/json": {
50455
+ admission: {
50456
+ activeRequests: number;
50457
+ availableBytes: number;
50458
+ availableRecords: number;
50459
+ maximumConcurrentRequests: number;
50460
+ };
50461
+ errors: {
50462
+ code: string;
50463
+ records: number;
50464
+ }[];
50465
+ lastAcceptedAt: string | null;
50466
+ observedAt: string;
50467
+ receiptHistoryDays: number;
50468
+ /** @enum {string} */
50469
+ status: "idle" | "observing" | "degraded" | "queryable";
50470
+ tiers: {
50471
+ canonical: {
50472
+ confirmed: number;
50473
+ maximumConfirmedLagMs: number | null;
50474
+ oldestPendingAgeMs: number | null;
50475
+ repairs: number;
50476
+ waiting: number;
50477
+ };
50478
+ hot: {
50479
+ confirmed: number;
50480
+ maximumConfirmedLagMs: number | null;
50481
+ oldestPendingAgeMs: number | null;
50482
+ repairs: number;
50483
+ waiting: number;
50484
+ };
50485
+ raw: {
50486
+ confirmed: number;
50487
+ maximumConfirmedLagMs: number | null;
50488
+ oldestPendingAgeMs: number | null;
50489
+ repairs: number;
50490
+ waiting: number;
50491
+ };
50492
+ };
50493
+ totals: {
50494
+ accepted: number;
50495
+ claimConflicts: number;
50496
+ complete: number;
50497
+ deleted: number;
50498
+ exhaustedAttempts: number;
50499
+ expired: number;
50500
+ pending: number;
50501
+ pendingBytes: number;
50502
+ suppressed: number;
50503
+ };
50504
+ trace: {
50505
+ acceptedAt: string;
50506
+ completeness: string;
50507
+ /** @description Receipt counts for this trace only; confirmations require positive tier reads, not stream acknowledgments. */
50508
+ delivery: {
50509
+ accepted: number;
50510
+ canonicalConfirmed: number;
50511
+ complete: number;
50512
+ hotConfirmed: number;
50513
+ pending: number;
50514
+ rawConfirmed: number;
50515
+ };
50516
+ diagnostics: {
50517
+ [key: string]: unknown;
50518
+ };
50519
+ expiresAt: string;
50520
+ revision: number;
50521
+ traceId: string;
50522
+ } | null;
50523
+ };
50524
+ };
50525
+ };
50526
+ /** @description Invalid trace identity */
50527
+ 400: {
50528
+ headers: {
50529
+ [name: string]: unknown;
50530
+ };
50531
+ content: {
50532
+ "application/json": components["schemas"]["Error"];
50533
+ };
50534
+ };
50535
+ /** @description Unauthenticated */
50536
+ 401: {
50537
+ headers: {
50538
+ [name: string]: unknown;
50539
+ };
50540
+ content: {
50541
+ "application/json": components["schemas"]["Error"];
50542
+ };
50543
+ };
50544
+ /** @description Read scope required */
50545
+ 403: {
50546
+ headers: {
50547
+ [name: string]: unknown;
50548
+ };
50549
+ content: {
50550
+ "application/json": components["schemas"]["Error"];
50551
+ };
50552
+ };
50553
+ /** @description Health state temporarily unavailable */
50554
+ 503: {
50555
+ headers: {
50556
+ [name: string]: unknown;
50557
+ };
50558
+ content: {
50559
+ "application/json": components["schemas"]["Error"];
50560
+ };
50561
+ };
50562
+ };
50563
+ };
50564
+ }
49935
50565
 
49936
50566
  /**
49937
50567
  * Hand-maintained, thin aliases over the GENERATED OpenAPI types.
@@ -50102,6 +50732,8 @@ type OrganizationAgentAliasList = paths['/v1/agent-aliases']['get']['responses']
50102
50732
  type OrganizationAgentAlias = OrganizationAgentAliasList['data'][number];
50103
50733
  /** What activating or rolling back a pointer reports back. */
50104
50734
  type AgentAliasActivation = paths['/v1/agents/{id}/aliases/{alias}']['put']['responses'][200]['content']['application/json'];
50735
+ /** The per-alias secret binding NAMES a pointer carries. Values are write-only. */
50736
+ type AgentAliasBindings = paths['/v1/agents/{id}/aliases/{alias}/bindings']['get']['responses'][200]['content']['application/json'];
50105
50737
  /** What archiving a pointer reports back. */
50106
50738
  type AgentAliasArchived = paths['/v1/agents/{id}/aliases/{alias}']['delete']['responses'][200]['content']['application/json'];
50107
50739
  /** One append-only deployment receipt. */
@@ -51724,6 +52356,12 @@ interface ProviderKeyModel {
51724
52356
  supported: boolean;
51725
52357
  defaultEffort?: string;
51726
52358
  };
52359
+ /**
52360
+ * Where a `system` message that follows a conversation turn lands on this endpoint. Omitted keeps
52361
+ * it at its position (Mistral- and Gemma-family ids fold it into the leading prompt); `hoist` folds
52362
+ * it for an endpoint whose chat template rejects a non-leading system role.
52363
+ */
52364
+ midConversationSystemMessages?: 'preserve' | 'hoist';
51727
52365
  }
51728
52366
  /** Content part types for multi-modal messages */
51729
52367
  interface TextContentPart {
@@ -51941,8 +52579,7 @@ type DispatchRecordInput = Omit<NonNullable<GeneratedDispatchRequest['record']>,
51941
52579
  };
51942
52580
  type DispatchRequestEnvelope = Omit<CanonicalDispatchRequestEnvelope, 'record' | 'messages' | 'clientTools'> & {
51943
52581
  record?: DispatchRecordInput;
51944
- messages?: Array<{
51945
- role: 'system' | 'user' | 'assistant';
52582
+ messages?: Array<Omit<NonNullable<GeneratedDispatchRequest['messages']>[number], 'content'> & {
51946
52583
  content: DispatchMessageContent;
51947
52584
  }>;
51948
52585
  /**
@@ -54165,6 +54802,18 @@ interface EvalSuiteSummary {
54165
54802
  latestRun: EvalSuiteLatestRun | null;
54166
54803
  createdAt: string;
54167
54804
  updatedAt: string;
54805
+ /**
54806
+ * Non-blocking findings about this suite. `AGENT_NOT_DEPLOYED` means the
54807
+ * target agent archived its `live` alias, so a run naming no version
54808
+ * selector refuses once the live default is on for the organization.
54809
+ */
54810
+ warnings?: EvalSuiteWarning[];
54811
+ }
54812
+ /** One non-blocking finding about a suite's target. */
54813
+ interface EvalSuiteWarning {
54814
+ code: string;
54815
+ message: string;
54816
+ agentId?: string;
54168
54817
  }
54169
54818
  /** A persisted test case. */
54170
54819
  interface EvalSuiteCase {
@@ -55613,6 +56262,15 @@ interface RollbackAgentAliasInput {
55613
56262
  revision?: number;
55614
56263
  reason?: string;
55615
56264
  }
56265
+ interface SetAgentAliasBindingsInput {
56266
+ /** The complete set, NAME to value. An empty object clears every binding. */
56267
+ bindings: Record<string, string>;
56268
+ revision?: number;
56269
+ reason?: string;
56270
+ }
56271
+ interface ClearAgentAliasBindingsInput {
56272
+ revision?: number;
56273
+ }
55616
56274
  /**
55617
56275
  * One pointer an {@link AgentAliasesNamespace.archiveEverywhere} pass could not
55618
56276
  * archive. A stale revision (412) or a concurrent archive (404) is reported
@@ -55684,6 +56342,16 @@ declare class AgentAliasesNamespace {
55684
56342
  archive(agentId: string, alias: string, input?: ArchiveAgentAliasInput): Promise<AgentAliasArchived>;
55685
56343
  /** Re-aim a pointer at the version its receipt history records before this one. */
55686
56344
  rollback(agentId: string, alias: string, input?: RollbackAgentAliasInput): Promise<AgentAliasActivation>;
56345
+ /** The per-alias secret binding NAMES this pointer carries. Values are write-only. */
56346
+ getBindings(agentId: string, alias: string): Promise<AgentAliasBindings>;
56347
+ /**
56348
+ * Replace the complete set of `{{secret:NAME}}` values executions resolve
56349
+ * when they reach this agent through this pointer, ahead of the organization
56350
+ * secret of the same name. A name you stop sending stops resolving.
56351
+ */
56352
+ setBindings(agentId: string, alias: string, input: SetAgentAliasBindingsInput): Promise<AgentAliasBindings>;
56353
+ /** Drop every binding, so this pointer's executions fall back to organization secrets. */
56354
+ clearBindings(agentId: string, alias: string, input?: ClearAgentAliasBindingsInput): Promise<AgentAliasBindings>;
55687
56355
  private run;
55688
56356
  }
55689
56357
  /**
@@ -55881,6 +56549,13 @@ interface EnsureAgentOptions {
55881
56549
  */
55882
56550
  deploy?: {
55883
56551
  alias: string;
56552
+ /**
56553
+ * The complete set of `{{secret:NAME}}` values executions resolve when they
56554
+ * reach this agent through this pointer, ahead of the organization secret
56555
+ * of the same name. Whole-set replacement; an empty object clears them.
56556
+ * Values are write-only and never returned.
56557
+ */
56558
+ bindings?: Record<string, string>;
55884
56559
  };
55885
56560
  /**
55886
56561
  * TOCTOU guard binding a dry run to its apply: the write only proceeds if