@runtypelabs/sdk 10.17.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -460,9 +460,18 @@ interface paths {
460
460
  [name: string]: unknown;
461
461
  };
462
462
  content: {
463
- "application/json": components["schemas"]["Error"] & {
464
- message?: string;
465
- };
463
+ "application/json": components["schemas"]["InternalError"];
464
+ };
465
+ };
466
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
467
+ 503: {
468
+ headers: {
469
+ /** @description Advisory wait before retrying, in whole seconds. */
470
+ "Retry-After": string;
471
+ [name: string]: unknown;
472
+ };
473
+ content: {
474
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
466
475
  };
467
476
  };
468
477
  };
@@ -618,9 +627,18 @@ interface paths {
618
627
  [name: string]: unknown;
619
628
  };
620
629
  content: {
621
- "application/json": components["schemas"]["Error"] & {
622
- message?: string;
623
- };
630
+ "application/json": components["schemas"]["InternalError"];
631
+ };
632
+ };
633
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
634
+ 503: {
635
+ headers: {
636
+ /** @description Advisory wait before retrying, in whole seconds. */
637
+ "Retry-After": string;
638
+ [name: string]: unknown;
639
+ };
640
+ content: {
641
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
624
642
  };
625
643
  };
626
644
  };
@@ -703,9 +721,18 @@ interface paths {
703
721
  [name: string]: unknown;
704
722
  };
705
723
  content: {
706
- "application/json": components["schemas"]["Error"] & {
707
- message?: string;
708
- };
724
+ "application/json": components["schemas"]["InternalError"];
725
+ };
726
+ };
727
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
728
+ 503: {
729
+ headers: {
730
+ /** @description Advisory wait before retrying, in whole seconds. */
731
+ "Retry-After": string;
732
+ [name: string]: unknown;
733
+ };
734
+ content: {
735
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
709
736
  };
710
737
  };
711
738
  };
@@ -800,9 +827,18 @@ interface paths {
800
827
  [name: string]: unknown;
801
828
  };
802
829
  content: {
803
- "application/json": components["schemas"]["Error"] & {
804
- message?: string;
805
- };
830
+ "application/json": components["schemas"]["InternalError"];
831
+ };
832
+ };
833
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
834
+ 503: {
835
+ headers: {
836
+ /** @description Advisory wait before retrying, in whole seconds. */
837
+ "Retry-After": string;
838
+ [name: string]: unknown;
839
+ };
840
+ content: {
841
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
806
842
  };
807
843
  };
808
844
  };
@@ -3316,7 +3352,11 @@ interface paths {
3316
3352
  [name: string]: unknown;
3317
3353
  };
3318
3354
  content: {
3319
- "application/json": components["schemas"]["Error"];
3355
+ "application/json": components["schemas"]["Error"] & {
3356
+ alias: string;
3357
+ /** @enum {string} */
3358
+ code: "alias_revision_required";
3359
+ };
3320
3360
  };
3321
3361
  };
3322
3362
  /** @description Internal server error */
@@ -3655,7 +3695,11 @@ interface paths {
3655
3695
  [name: string]: unknown;
3656
3696
  };
3657
3697
  content: {
3658
- "application/json": components["schemas"]["Error"];
3698
+ "application/json": components["schemas"]["Error"] & {
3699
+ alias: string;
3700
+ /** @enum {string} */
3701
+ code: "alias_revision_required";
3702
+ };
3659
3703
  };
3660
3704
  };
3661
3705
  /** @description Internal server error */
@@ -3769,7 +3813,11 @@ interface paths {
3769
3813
  [name: string]: unknown;
3770
3814
  };
3771
3815
  content: {
3772
- "application/json": components["schemas"]["Error"];
3816
+ "application/json": components["schemas"]["Error"] & {
3817
+ alias: string;
3818
+ /** @enum {string} */
3819
+ code: "alias_revision_required";
3820
+ };
3773
3821
  };
3774
3822
  };
3775
3823
  /** @description Internal server error */
@@ -3920,7 +3968,11 @@ interface paths {
3920
3968
  [name: string]: unknown;
3921
3969
  };
3922
3970
  content: {
3923
- "application/json": components["schemas"]["Error"];
3971
+ "application/json": components["schemas"]["Error"] & {
3972
+ alias: string;
3973
+ /** @enum {string} */
3974
+ code: "alias_revision_required";
3975
+ };
3924
3976
  };
3925
3977
  };
3926
3978
  /** @description Internal server error */
@@ -5746,11 +5798,11 @@ interface paths {
5746
5798
  };
5747
5799
  /**
5748
5800
  * Export agent for runtime
5749
- * @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). Skills bound to the agent are snapshotted into `skills`, each with the skill version it resolved to, and the runtime loads them with no host wiring. MCP credential values and external-agent auth credentials are replaced with secret-name references. An export that would carry a literal credential typed into a tool config or MCP server is refused with `422` and code `raw_credential_in_export`. 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.
5801
+ * @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). Skills bound to the agent are snapshotted into `skills`, each with the skill version it resolved to, and the runtime loads them with no host wiring. MCP credential values and external-agent auth credentials are replaced with secret-name references. A configured `decision_judge` tool carries its published question set (questions, model, version, input mapping and current calibration) at `config.questionSet`, resolved once at export so a self-hosted runtime never looks the question set up; a question set that is missing, unpublished, owned by another account, or pinned to an unpublished version is reported in `warnings` with reason `question_set_unresolved` instead of failing the export. An export that would carry a literal credential typed into a tool config or MCP server is refused with `422` and code `raw_credential_in_export`. 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.
5750
5802
  *
5751
5803
  * 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.
5752
5804
  *
5753
- * The response also carries `warnings`: each referenced sub-agent or flow the export could not embed, with the reason (`not_found`, `claude_managed_unsupported`, `max_depth_exceeded` for nesting deeper than 3 levels, `invalid_flow_config`, `unresolved_tool_ref`, or `unsupported_mcp_auth`). The export still returns `200` and leaves the referencing capability or tool out of the artifact. The array is empty when every child was embedded.
5805
+ * The response also carries `warnings`: each referenced sub-agent or flow the export could not embed, with the reason (`not_found`, `claude_managed_unsupported`, `max_depth_exceeded` for nesting deeper than 3 levels, `invalid_flow_config`, `unresolved_tool_ref`, or `unsupported_mcp_auth`), and each configured decision tool whose question set could not be resolved (`question_set_unresolved`). The export still returns `200` and leaves the referencing capability or tool out of the artifact; a decision tool stays in, without `config.questionSet`. The array is empty when every child was embedded.
5754
5806
  *
5755
5807
  * Pass at most one release selector. `versionId` exports that published version; `alias` exports the version a release alias (for example `staging`, `live` or `pr-42`) currently points at, resolved exactly as the execution selector `agent: { agentId, alias }` resolves it. With neither, the export follows the agent's default target: the version its `live` alias names when the org runs on release aliases, otherwise the agent's current definition. A version-backed export carries `release` with the resolved `versionId`, plus `alias` and `aliasRevision` when an alias selected it. An unknown version or alias, or an archived or expired alias, answers `404`.
5756
5808
  */
@@ -5802,7 +5854,7 @@ interface paths {
5802
5854
  };
5803
5855
  /** @description Skills bound to the agent, snapshotted with the skill version each resolved to. `executeAgent` loads them with no host wiring. Absent when the agent has no bound skills. */
5804
5856
  skills?: components["schemas"]["RuntimeExportedSkill"][];
5805
- /** @description Referenced sub-agents and flows the export could not embed, each with the reason. The export still returns `200`; a tool or capability that names a dropped child is absent from the artifact. Empty when every child was embedded. */
5857
+ /** @description Referenced sub-agents, flows and question sets the export could not embed, each with the reason. The export still returns `200`; a tool or capability that names a dropped child is absent from the artifact. Empty when every child was embedded. */
5806
5858
  warnings: components["schemas"]["RuntimeExportWarning"][];
5807
5859
  };
5808
5860
  "application/zip": string;
@@ -7326,11 +7378,7 @@ interface paths {
7326
7378
  [name: string]: unknown;
7327
7379
  };
7328
7380
  content: {
7329
- "application/json": {
7330
- /** @enum {string} */
7331
- code: "invalid_request" | "storage_not_configured" | "store_failed";
7332
- error: string;
7333
- };
7381
+ "application/json": components["schemas"]["InternalError"];
7334
7382
  };
7335
7383
  };
7336
7384
  /** @description Asset storage is not configured in this environment */
@@ -9697,7 +9745,7 @@ interface paths {
9697
9745
  put?: never;
9698
9746
  /**
9699
9747
  * Send a client chat message
9700
- * @description Send a message for a browser client-token chat session. The request streams flow/agent events over Server-Sent Events. `turnId` and `submitMode` are optional and let newer Persona clients suppress stale interrupted responses; older clients can omit both fields. Opt-in `steer` accepts exactly one new user message whose `id` equals `turnId` for visitor-owned native durable agents. A new execution streams SSE; steering an existing execution returns a 202 delivery receipt without replacing its response. `auto` takes the same shape as `steer` and lets a classifier choose while a turn runs: a message that belongs to the running work steers it (202 delivery receipt), and an independent one queues as the next turn (202 queued handle); with nothing running it is an ordinary turn with no route report. A routed or downgraded answer carries `X-Runtype-Busy-Message-Route` and `X-Runtype-Busy-Message-Source` (plus `-Probability` and `-Model` when the classifier answered), repeated as `busyMessageRoute` on JSON bodies. Where `auto` cannot route (another lane, another message shape) it behaves as `normal` and reports source `disabled`. Retry with the same turn and message IDs. Send `voice: { spoken: true }` when the user turn came from a live voice call and the reply will be spoken by a voice model; the turn then runs with a per-turn instruction to lead with a short, speakable answer, which is not stored in the conversation.
9748
+ * @description Send a message for a browser client-token chat session. The request streams flow/agent events over Server-Sent Events. `turnId` and `submitMode` are optional and let newer Persona clients suppress stale interrupted responses; older clients can omit both fields. Opt-in `steer` accepts exactly one new user message whose `id` equals `turnId` for visitor-owned native durable agents. A new execution streams SSE; steering an existing execution returns a 202 delivery receipt without replacing its response. `auto` takes the same shape as `steer` and lets a classifier choose while a turn runs: a message that belongs to the running work steers it (202 delivery receipt), and an independent one queues as the next turn (202 queued handle); with nothing running it is an ordinary turn with no route report. A routed or downgraded answer carries `X-Runtype-Busy-Message-Route` and `X-Runtype-Busy-Message-Source` (plus `-Probability` and `-Model` when the classifier answered), repeated as `busyMessageRoute` on JSON bodies. Where `auto` cannot route (another lane, another message shape) it behaves as `normal` and reports source `disabled`. Retry with the same turn and message IDs. Send `voice: { spoken: true }` when the user turn came from a live voice call and the reply will be spoken by a voice model; the turn then runs with a per-turn instruction to lead with a short, speakable answer, which is not stored in the conversation. Only the fields in the request body schema are supported. The schema has no `options` object, so run options such as `options.stepTimeoutMs` and `options.flowTimeoutMs` cannot be set on this route. To set them, call `POST /v1/dispatch` with an API key.
9701
9749
  */
9702
9750
  post: {
9703
9751
  parameters: {
@@ -9781,6 +9829,15 @@ interface paths {
9781
9829
  turnId?: string;
9782
9830
  /** @description Voice context for this turn. Omit for typed chat; behavior is unchanged when absent. */
9783
9831
  voice?: {
9832
+ /** @description Page tools the voice call already ran this turn. Replayed to the model as answered calls to the offered `clientTools`, deduplicated by `toolCallId`, so the agent narrates rather than re-calls. At most 8 entries; the JSON `arguments` plus `result` of each entry may total 32,768 characters. */
9833
+ priorToolResults?: {
9834
+ arguments: {
9835
+ [key: string]: unknown;
9836
+ };
9837
+ name: string;
9838
+ result?: unknown;
9839
+ toolCallId: string;
9840
+ }[];
9784
9841
  /** @description The user turn came from a live voice call and the reply will be spoken by a voice model. The turn runs with a per-turn instruction to lead with a short, speakable answer; the instruction is never stored in the conversation. */
9785
9842
  spoken?: boolean;
9786
9843
  };
@@ -10806,7 +10863,18 @@ interface paths {
10806
10863
  [name: string]: unknown;
10807
10864
  };
10808
10865
  content: {
10809
- "application/json": components["schemas"]["Error"];
10866
+ "application/json": components["schemas"]["InternalError"];
10867
+ };
10868
+ };
10869
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
10870
+ 503: {
10871
+ headers: {
10872
+ /** @description Advisory wait before retrying, in whole seconds. */
10873
+ "Retry-After": string;
10874
+ [name: string]: unknown;
10875
+ };
10876
+ content: {
10877
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
10810
10878
  };
10811
10879
  };
10812
10880
  };
@@ -16622,7 +16690,18 @@ interface paths {
16622
16690
  [name: string]: unknown;
16623
16691
  };
16624
16692
  content: {
16625
- "application/json": components["schemas"]["Error"];
16693
+ "application/json": components["schemas"]["InternalError"];
16694
+ };
16695
+ };
16696
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
16697
+ 503: {
16698
+ headers: {
16699
+ /** @description Advisory wait before retrying, in whole seconds. */
16700
+ "Retry-After": string;
16701
+ [name: string]: unknown;
16702
+ };
16703
+ content: {
16704
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
16626
16705
  };
16627
16706
  };
16628
16707
  };
@@ -16697,7 +16776,18 @@ interface paths {
16697
16776
  [name: string]: unknown;
16698
16777
  };
16699
16778
  content: {
16700
- "application/json": components["schemas"]["Error"];
16779
+ "application/json": components["schemas"]["InternalError"];
16780
+ };
16781
+ };
16782
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
16783
+ 503: {
16784
+ headers: {
16785
+ /** @description Advisory wait before retrying, in whole seconds. */
16786
+ "Retry-After": string;
16787
+ [name: string]: unknown;
16788
+ };
16789
+ content: {
16790
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
16701
16791
  };
16702
16792
  };
16703
16793
  };
@@ -16809,7 +16899,18 @@ interface paths {
16809
16899
  [name: string]: unknown;
16810
16900
  };
16811
16901
  content: {
16812
- "application/json": components["schemas"]["Error"];
16902
+ "application/json": components["schemas"]["InternalError"];
16903
+ };
16904
+ };
16905
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
16906
+ 503: {
16907
+ headers: {
16908
+ /** @description Advisory wait before retrying, in whole seconds. */
16909
+ "Retry-After": string;
16910
+ [name: string]: unknown;
16911
+ };
16912
+ content: {
16913
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
16813
16914
  };
16814
16915
  };
16815
16916
  };
@@ -16919,6 +17020,101 @@ interface paths {
16919
17020
  };
16920
17021
  };
16921
17022
  /** @description Internal server error */
17023
+ 500: {
17024
+ headers: {
17025
+ [name: string]: unknown;
17026
+ };
17027
+ content: {
17028
+ "application/json": components["schemas"]["InternalError"];
17029
+ };
17030
+ };
17031
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
17032
+ 503: {
17033
+ headers: {
17034
+ /** @description Advisory wait before retrying, in whole seconds. */
17035
+ "Retry-After": string;
17036
+ [name: string]: unknown;
17037
+ };
17038
+ content: {
17039
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
17040
+ };
17041
+ };
17042
+ };
17043
+ };
17044
+ delete?: never;
17045
+ options?: never;
17046
+ head?: never;
17047
+ patch?: never;
17048
+ trace?: never;
17049
+ };
17050
+ "/v1/eval/default-suites": {
17051
+ parameters: {
17052
+ query?: never;
17053
+ header?: never;
17054
+ path?: never;
17055
+ cookie?: never;
17056
+ };
17057
+ get?: never;
17058
+ put?: never;
17059
+ /**
17060
+ * Ensure default eval suites
17061
+ * @description Give each named flow and agent that has no eval suite an empty default suite named `<name> eval`. Idempotent: a target that already has any suite is left alone. Unknown or unowned ids are skipped.
17062
+ */
17063
+ post: {
17064
+ parameters: {
17065
+ query?: never;
17066
+ header?: never;
17067
+ path?: never;
17068
+ cookie?: never;
17069
+ };
17070
+ requestBody?: {
17071
+ content: {
17072
+ "application/json": {
17073
+ agentIds?: string[];
17074
+ flowIds?: string[];
17075
+ };
17076
+ };
17077
+ };
17078
+ responses: {
17079
+ /** @description Default suites ensured */
17080
+ 200: {
17081
+ headers: {
17082
+ [name: string]: unknown;
17083
+ };
17084
+ content: {
17085
+ "application/json": {
17086
+ created: number;
17087
+ };
17088
+ };
17089
+ };
17090
+ /** @description Invalid request */
17091
+ 400: {
17092
+ headers: {
17093
+ [name: string]: unknown;
17094
+ };
17095
+ content: {
17096
+ "application/json": components["schemas"]["Error"];
17097
+ };
17098
+ };
17099
+ /** @description Unauthorized */
17100
+ 401: {
17101
+ headers: {
17102
+ [name: string]: unknown;
17103
+ };
17104
+ content: {
17105
+ "application/json": components["schemas"]["Error"];
17106
+ };
17107
+ };
17108
+ /** @description Forbidden */
17109
+ 403: {
17110
+ headers: {
17111
+ [name: string]: unknown;
17112
+ };
17113
+ content: {
17114
+ "application/json": components["schemas"]["Error"];
17115
+ };
17116
+ };
17117
+ /** @description Internal server error */
16922
17118
  500: {
16923
17119
  headers: {
16924
17120
  [name: string]: unknown;
@@ -17355,7 +17551,18 @@ interface paths {
17355
17551
  [name: string]: unknown;
17356
17552
  };
17357
17553
  content: {
17358
- "application/json": components["schemas"]["Error"];
17554
+ "application/json": components["schemas"]["InternalError"];
17555
+ };
17556
+ };
17557
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
17558
+ 503: {
17559
+ headers: {
17560
+ /** @description Advisory wait before retrying, in whole seconds. */
17561
+ "Retry-After": string;
17562
+ [name: string]: unknown;
17563
+ };
17564
+ content: {
17565
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
17359
17566
  };
17360
17567
  };
17361
17568
  };
@@ -17593,7 +17800,7 @@ interface paths {
17593
17800
  [name: string]: unknown;
17594
17801
  };
17595
17802
  content: {
17596
- "application/json": components["schemas"]["Error"];
17803
+ "application/json": components["schemas"]["EvalQuotaExceededError"];
17597
17804
  };
17598
17805
  };
17599
17806
  /** @description Forbidden */
@@ -17620,7 +17827,18 @@ interface paths {
17620
17827
  [name: string]: unknown;
17621
17828
  };
17622
17829
  content: {
17623
- "application/json": components["schemas"]["Error"];
17830
+ "application/json": components["schemas"]["InternalError"];
17831
+ };
17832
+ };
17833
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
17834
+ 503: {
17835
+ headers: {
17836
+ /** @description Advisory wait before retrying, in whole seconds. */
17837
+ "Retry-After": string;
17838
+ [name: string]: unknown;
17839
+ };
17840
+ content: {
17841
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
17624
17842
  };
17625
17843
  };
17626
17844
  };
@@ -17867,7 +18085,7 @@ interface paths {
17867
18085
  [name: string]: unknown;
17868
18086
  };
17869
18087
  content: {
17870
- "application/json": components["schemas"]["Error"];
18088
+ "application/json": components["schemas"]["EvalQuotaExceededError"];
17871
18089
  };
17872
18090
  };
17873
18091
  /** @description Forbidden */
@@ -17885,7 +18103,18 @@ interface paths {
17885
18103
  [name: string]: unknown;
17886
18104
  };
17887
18105
  content: {
17888
- "application/json": components["schemas"]["Error"];
18106
+ "application/json": components["schemas"]["InternalError"];
18107
+ };
18108
+ };
18109
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
18110
+ 503: {
18111
+ headers: {
18112
+ /** @description Advisory wait before retrying, in whole seconds. */
18113
+ "Retry-After": string;
18114
+ [name: string]: unknown;
18115
+ };
18116
+ content: {
18117
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
17889
18118
  };
17890
18119
  };
17891
18120
  };
@@ -17922,6 +18151,10 @@ interface paths {
17922
18151
  agent?: components["schemas"]["EvalAgentSelector"] & unknown;
17923
18152
  evalConfig?: components["schemas"]["EvalConfigRequest"];
17924
18153
  evalConfigs?: components["schemas"]["EvalConfigRequest"][];
18154
+ /** @description Flow input variables applied to every record execution, as on POST /batch/flow: they override same-named record metadata at the top level and leave _record.metadata unchanged. Flow targets only. */
18155
+ inputs?: {
18156
+ [key: string]: unknown;
18157
+ } | null;
17925
18158
  } & {
17926
18159
  [key: string]: unknown;
17927
18160
  };
@@ -17974,7 +18207,7 @@ interface paths {
17974
18207
  [name: string]: unknown;
17975
18208
  };
17976
18209
  content: {
17977
- "application/json": components["schemas"]["Error"];
18210
+ "application/json": components["schemas"]["EvalQuotaExceededError"];
17978
18211
  };
17979
18212
  };
17980
18213
  /** @description Forbidden */
@@ -18001,7 +18234,18 @@ interface paths {
18001
18234
  [name: string]: unknown;
18002
18235
  };
18003
18236
  content: {
18004
- "application/json": components["schemas"]["Error"];
18237
+ "application/json": components["schemas"]["InternalError"];
18238
+ };
18239
+ };
18240
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
18241
+ 503: {
18242
+ headers: {
18243
+ /** @description Advisory wait before retrying, in whole seconds. */
18244
+ "Retry-After": string;
18245
+ [name: string]: unknown;
18246
+ };
18247
+ content: {
18248
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
18005
18249
  };
18006
18250
  };
18007
18251
  };
@@ -18145,6 +18389,14 @@ interface paths {
18145
18389
  toolName: string;
18146
18390
  }[];
18147
18391
  }[];
18392
+ /** @description The record this case runs on, read by the flow as _record.name, _record.type and _record.metadata.*. Omitted fields keep the defaults: a record of type "eval" with empty metadata. Case variables still override same-named metadata fields at the top level. */
18393
+ record?: {
18394
+ metadata?: {
18395
+ [key: string]: unknown;
18396
+ };
18397
+ name?: string;
18398
+ type?: string;
18399
+ };
18148
18400
  /** @description Product tenant this case runs within (exposed as _tenant.*). Overrides the suite identityDefaults.tenant. */
18149
18401
  tenant?: {
18150
18402
  id: string;
@@ -18596,6 +18848,14 @@ interface paths {
18596
18848
  toolName: string;
18597
18849
  }[];
18598
18850
  }[];
18851
+ /** @description The record this case runs on, read by the flow as _record.name, _record.type and _record.metadata.*. Omitted fields keep the defaults: a record of type "eval" with empty metadata. Case variables still override same-named metadata fields at the top level. */
18852
+ record?: {
18853
+ metadata?: {
18854
+ [key: string]: unknown;
18855
+ };
18856
+ name?: string;
18857
+ type?: string;
18858
+ };
18599
18859
  /** @description Product tenant this case runs within (exposed as _tenant.*). Overrides the suite identityDefaults.tenant. */
18600
18860
  tenant?: {
18601
18861
  id: string;
@@ -18927,6 +19187,14 @@ interface paths {
18927
19187
  toolName: string;
18928
19188
  }[];
18929
19189
  }[];
19190
+ /** @description The record this case runs on, read by the flow as _record.name, _record.type and _record.metadata.*. Omitted fields keep the defaults: a record of type "eval" with empty metadata. Case variables still override same-named metadata fields at the top level. */
19191
+ record?: {
19192
+ metadata?: {
19193
+ [key: string]: unknown;
19194
+ };
19195
+ name?: string;
19196
+ type?: string;
19197
+ };
18930
19198
  /** @description Product tenant this case runs within (exposed as _tenant.*). Overrides the suite identityDefaults.tenant. */
18931
19199
  tenant?: {
18932
19200
  id: string;
@@ -19168,7 +19436,7 @@ interface paths {
19168
19436
  [name: string]: unknown;
19169
19437
  };
19170
19438
  content: {
19171
- "application/json": components["schemas"]["Error"];
19439
+ "application/json": components["schemas"]["EvalQuotaExceededError"];
19172
19440
  };
19173
19441
  };
19174
19442
  /** @description Forbidden */
@@ -19646,7 +19914,7 @@ interface paths {
19646
19914
  [name: string]: unknown;
19647
19915
  };
19648
19916
  content: {
19649
- "application/json": components["schemas"]["Error"];
19917
+ "application/json": components["schemas"]["EvalQuotaExceededError"];
19650
19918
  };
19651
19919
  };
19652
19920
  /** @description Forbidden */
@@ -19682,7 +19950,18 @@ interface paths {
19682
19950
  [name: string]: unknown;
19683
19951
  };
19684
19952
  content: {
19685
- "application/json": components["schemas"]["Error"];
19953
+ "application/json": components["schemas"]["InternalError"];
19954
+ };
19955
+ };
19956
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
19957
+ 503: {
19958
+ headers: {
19959
+ /** @description Advisory wait before retrying, in whole seconds. */
19960
+ "Retry-After": string;
19961
+ [name: string]: unknown;
19962
+ };
19963
+ content: {
19964
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
19686
19965
  };
19687
19966
  };
19688
19967
  };
@@ -19825,7 +20104,18 @@ interface paths {
19825
20104
  [name: string]: unknown;
19826
20105
  };
19827
20106
  content: {
19828
- "application/json": components["schemas"]["Error"];
20107
+ "application/json": components["schemas"]["InternalError"];
20108
+ };
20109
+ };
20110
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
20111
+ 503: {
20112
+ headers: {
20113
+ /** @description Advisory wait before retrying, in whole seconds. */
20114
+ "Retry-After": string;
20115
+ [name: string]: unknown;
20116
+ };
20117
+ content: {
20118
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
19829
20119
  };
19830
20120
  };
19831
20121
  };
@@ -20400,7 +20690,18 @@ interface paths {
20400
20690
  [name: string]: unknown;
20401
20691
  };
20402
20692
  content: {
20403
- "application/json": components["schemas"]["Error"];
20693
+ "application/json": components["schemas"]["InternalError"];
20694
+ };
20695
+ };
20696
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
20697
+ 503: {
20698
+ headers: {
20699
+ /** @description Advisory wait before retrying, in whole seconds. */
20700
+ "Retry-After": string;
20701
+ [name: string]: unknown;
20702
+ };
20703
+ content: {
20704
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
20404
20705
  };
20405
20706
  };
20406
20707
  };
@@ -20804,6 +21105,8 @@ interface paths {
20804
21105
  };
20805
21106
  content: {
20806
21107
  "application/json": {
21108
+ draftVersionId: string | null;
21109
+ draftVersionMatchesConfig?: boolean;
20807
21110
  flowId: string;
20808
21111
  publishedVersionId: string | null;
20809
21112
  versions: {
@@ -20811,8 +21114,11 @@ interface paths {
20811
21114
  id: string;
20812
21115
  label: string | null;
20813
21116
  notes: string | null;
21117
+ publishedAt: string | null;
21118
+ savedVersionNumber: number | null;
20814
21119
  stepCount: number;
20815
21120
  stepSummary: string | null;
21121
+ userId: string;
20816
21122
  versionNumber: number;
20817
21123
  versionType: string;
20818
21124
  }[];
@@ -20852,9 +21158,18 @@ interface paths {
20852
21158
  [name: string]: unknown;
20853
21159
  };
20854
21160
  content: {
20855
- "application/json": components["schemas"]["Error"] & {
20856
- message?: string;
20857
- };
21161
+ "application/json": components["schemas"]["InternalError"];
21162
+ };
21163
+ };
21164
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
21165
+ 503: {
21166
+ headers: {
21167
+ /** @description Advisory wait before retrying, in whole seconds. */
21168
+ "Retry-After": string;
21169
+ [name: string]: unknown;
21170
+ };
21171
+ content: {
21172
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
20858
21173
  };
20859
21174
  };
20860
21175
  };
@@ -20978,9 +21293,18 @@ interface paths {
20978
21293
  [name: string]: unknown;
20979
21294
  };
20980
21295
  content: {
20981
- "application/json": components["schemas"]["Error"] & {
20982
- message?: string;
20983
- };
21296
+ "application/json": components["schemas"]["InternalError"];
21297
+ };
21298
+ };
21299
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
21300
+ 503: {
21301
+ headers: {
21302
+ /** @description Advisory wait before retrying, in whole seconds. */
21303
+ "Retry-After": string;
21304
+ [name: string]: unknown;
21305
+ };
21306
+ content: {
21307
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
20984
21308
  };
20985
21309
  };
20986
21310
  };
@@ -21025,6 +21349,9 @@ interface paths {
21025
21349
  id: string;
21026
21350
  label: string | null;
21027
21351
  notes: string | null;
21352
+ publishedAt: string | null;
21353
+ savedVersionNumber: number | null;
21354
+ userId: string;
21028
21355
  versionNumber: number;
21029
21356
  versionType: string;
21030
21357
  };
@@ -21063,9 +21390,18 @@ interface paths {
21063
21390
  [name: string]: unknown;
21064
21391
  };
21065
21392
  content: {
21066
- "application/json": components["schemas"]["Error"] & {
21067
- message?: string;
21068
- };
21393
+ "application/json": components["schemas"]["InternalError"];
21394
+ };
21395
+ };
21396
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
21397
+ 503: {
21398
+ headers: {
21399
+ /** @description Advisory wait before retrying, in whole seconds. */
21400
+ "Retry-After": string;
21401
+ [name: string]: unknown;
21402
+ };
21403
+ content: {
21404
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
21069
21405
  };
21070
21406
  };
21071
21407
  };
@@ -21113,6 +21449,9 @@ interface paths {
21113
21449
  id: string;
21114
21450
  label: string | null;
21115
21451
  notes: string | null;
21452
+ publishedAt: string | null;
21453
+ savedVersionNumber: number | null;
21454
+ userId: string;
21116
21455
  versionNumber: number;
21117
21456
  versionType: string;
21118
21457
  };
@@ -21160,9 +21499,18 @@ interface paths {
21160
21499
  [name: string]: unknown;
21161
21500
  };
21162
21501
  content: {
21163
- "application/json": components["schemas"]["Error"] & {
21164
- message?: string;
21165
- };
21502
+ "application/json": components["schemas"]["InternalError"];
21503
+ };
21504
+ };
21505
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
21506
+ 503: {
21507
+ headers: {
21508
+ /** @description Advisory wait before retrying, in whole seconds. */
21509
+ "Retry-After": string;
21510
+ [name: string]: unknown;
21511
+ };
21512
+ content: {
21513
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
21166
21514
  };
21167
21515
  };
21168
21516
  };
@@ -21196,6 +21544,8 @@ interface paths {
21196
21544
  search?: string;
21197
21545
  /** @description Response representation. `full` (default) preserves complete values; `compact` shortens every string value longer than 100 characters to a 100-character preview followed by `…`. */
21198
21546
  view?: "full" | "compact";
21547
+ /** @description usage adds each flow usage: the model ids its steps name and the record types its steps write. */
21548
+ include?: "usage";
21199
21549
  };
21200
21550
  header?: never;
21201
21551
  path?: never;
@@ -21217,6 +21567,13 @@ interface paths {
21217
21567
  lastRunAt: string | null;
21218
21568
  name: string;
21219
21569
  updatedAt: string;
21570
+ /** @description What the saved flow steps reach. Present only when the request asked for include=usage. */
21571
+ usage?: {
21572
+ /** @description Model ids the flow steps name, each once. */
21573
+ models: string[];
21574
+ /** @description Record types the upsert-record and update-record steps write, each once. */
21575
+ recordTypesWritten: string[];
21576
+ };
21220
21577
  }[];
21221
21578
  pagination: components["schemas"]["Pagination"];
21222
21579
  };
@@ -21320,6 +21677,7 @@ interface paths {
21320
21677
  createdAt: string;
21321
21678
  dashboardUrl?: string;
21322
21679
  description?: string | null;
21680
+ draftVersionId?: string | null;
21323
21681
  flowSteps: {
21324
21682
  config?: {
21325
21683
  [key: string]: unknown;
@@ -21335,6 +21693,7 @@ interface paths {
21335
21693
  lastRunAt?: string | null;
21336
21694
  name: string;
21337
21695
  organizationId: string | null;
21696
+ publishedVersionId?: string | null;
21338
21697
  sampleMetadata?: {
21339
21698
  [key: string]: unknown;
21340
21699
  };
@@ -21617,6 +21976,7 @@ interface paths {
21617
21976
  createdAt: string;
21618
21977
  dashboardUrl?: string;
21619
21978
  description?: string | null;
21979
+ draftVersionId?: string | null;
21620
21980
  flowSteps: {
21621
21981
  config?: {
21622
21982
  [key: string]: unknown;
@@ -21632,6 +21992,7 @@ interface paths {
21632
21992
  lastRunAt?: string | null;
21633
21993
  name: string;
21634
21994
  organizationId: string | null;
21995
+ publishedVersionId?: string | null;
21635
21996
  sampleMetadata?: {
21636
21997
  [key: string]: unknown;
21637
21998
  };
@@ -21738,6 +22099,7 @@ interface paths {
21738
22099
  lastRunAt?: string | null;
21739
22100
  name: string;
21740
22101
  organizationId: string | null;
22102
+ publishedVersionId?: string | null;
21741
22103
  sampleMetadata?: {
21742
22104
  [key: string]: unknown;
21743
22105
  };
@@ -21878,11 +22240,11 @@ interface paths {
21878
22240
  };
21879
22241
  /**
21880
22242
  * Export flow for runtime (limited preview)
21881
- * @description Export a fully-resolved, self-contained flow definition that the @runtypelabs/runtime package can consume directly at boot. All step configs are inlined; no live DB queries are needed at execution time. An export that would carry a literal credential typed into a tool config or MCP server is refused with `422` and code `raw_credential_in_export`. 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.
22243
+ * @description Export a fully-resolved, self-contained flow definition that the @runtypelabs/runtime package can consume directly at boot. All step configs are inlined; no live DB queries are needed at execution time. A configured `decision_judge` tool carries its published question set (questions, model, version, input mapping and current calibration) at `config.questionSet`, resolved once at export so a self-hosted runtime never looks the question set up; a question set that is missing, unpublished, owned by another account, or pinned to an unpublished version is reported in `warnings` with reason `question_set_unresolved` instead of failing the export. An export that would carry a literal credential typed into a tool config or MCP server is refused with `422` and code `raw_credential_in_export`. 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.
21882
22244
  *
21883
22245
  * 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 flow'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, and the export is never refused for a declared dependency.
21884
22246
  *
21885
- * The response also carries `warnings`: each Claude Managed agent the flow references (embedded only as a stub the runtime cannot run), and each child flow or sub-agent that an embedded agent could not include, with the reason. The array is empty when every child was embedded.
22247
+ * The response also carries `warnings`: each Claude Managed agent the flow references (embedded only as a stub the runtime cannot run), and each child flow or sub-agent that an embedded agent could not include, with the reason, and each configured decision tool whose question set could not be resolved (`question_set_unresolved`). The array is empty when every child was embedded.
21886
22248
  */
21887
22249
  get: {
21888
22250
  parameters: {
@@ -21917,7 +22279,7 @@ interface paths {
21917
22279
  steps: {
21918
22280
  [key: string]: unknown;
21919
22281
  }[];
21920
- /** @description Referenced sub-agents and flows the export could not embed, each with the reason. The export still returns `200`; a tool or capability that names a dropped child is absent from the artifact. Empty when every child was embedded. */
22282
+ /** @description Referenced sub-agents, flows and question sets the export could not embed, each with the reason. The export still returns `200`; a tool or capability that names a dropped child is absent from the artifact. Empty when every child was embedded. */
21921
22283
  warnings: components["schemas"]["RuntimeExportWarning"][];
21922
22284
  };
21923
22285
  };
@@ -22059,6 +22421,17 @@ interface paths {
22059
22421
  "application/json": components["schemas"]["Error"];
22060
22422
  };
22061
22423
  };
22424
+ /** @description Flow is managed by code */
22425
+ 409: {
22426
+ headers: {
22427
+ [name: string]: unknown;
22428
+ };
22429
+ content: {
22430
+ "application/json": components["schemas"]["Error"] & {
22431
+ code: string;
22432
+ };
22433
+ };
22434
+ };
22062
22435
  /** @description Internal server error */
22063
22436
  500: {
22064
22437
  headers: {
@@ -26704,7 +27077,18 @@ interface paths {
26704
27077
  [name: string]: unknown;
26705
27078
  };
26706
27079
  content: {
26707
- "application/json": components["schemas"]["Error"];
27080
+ "application/json": components["schemas"]["InternalError"];
27081
+ };
27082
+ };
27083
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
27084
+ 503: {
27085
+ headers: {
27086
+ /** @description Advisory wait before retrying, in whole seconds. */
27087
+ "Retry-After": string;
27088
+ [name: string]: unknown;
27089
+ };
27090
+ content: {
27091
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
26708
27092
  };
26709
27093
  };
26710
27094
  };
@@ -26798,7 +27182,18 @@ interface paths {
26798
27182
  [name: string]: unknown;
26799
27183
  };
26800
27184
  content: {
26801
- "application/json": components["schemas"]["Error"];
27185
+ "application/json": components["schemas"]["InternalError"];
27186
+ };
27187
+ };
27188
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
27189
+ 503: {
27190
+ headers: {
27191
+ /** @description Advisory wait before retrying, in whole seconds. */
27192
+ "Retry-After": string;
27193
+ [name: string]: unknown;
27194
+ };
27195
+ content: {
27196
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
26802
27197
  };
26803
27198
  };
26804
27199
  };
@@ -29676,15 +30071,29 @@ interface paths {
29676
30071
  "application/json": components["schemas"]["Error"];
29677
30072
  };
29678
30073
  };
29679
- /** @description Internal server error */
30074
+ /** @description The SMTP server rejected the test email (`success: false`), or an internal error occurred */
29680
30075
  500: {
29681
30076
  headers: {
29682
30077
  [name: string]: unknown;
29683
30078
  };
29684
30079
  content: {
29685
30080
  "application/json": {
29686
- [key: string]: unknown;
29687
- };
30081
+ /** @description The SMTP rejection, e.g. an authentication or relay refusal. */
30082
+ error: string;
30083
+ /** @enum {boolean} */
30084
+ success: false;
30085
+ } | components["schemas"]["InternalError"];
30086
+ };
30087
+ };
30088
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
30089
+ 503: {
30090
+ headers: {
30091
+ /** @description Advisory wait before retrying, in whole seconds. */
30092
+ "Retry-After": string;
30093
+ [name: string]: unknown;
30094
+ };
30095
+ content: {
30096
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
29688
30097
  };
29689
30098
  };
29690
30099
  };
@@ -30193,7 +30602,7 @@ interface paths {
30193
30602
  };
30194
30603
  /**
30195
30604
  * List model configurations
30196
- * @description Get the authenticated user's model configurations with enriched catalog metadata. Auto-provisions a default if none exist.
30605
+ * @description Get every model the account can run, with enriched catalog metadata: its model configurations plus the models its organization custom inference endpoints declare (`configScope: organization_connection`). `credentialPolicy` states which providers may serve a call. Auto-provisions a default if none exist.
30197
30606
  */
30198
30607
  get: {
30199
30608
  parameters: {
@@ -30211,7 +30620,24 @@ interface paths {
30211
30620
  };
30212
30621
  content: {
30213
30622
  "application/json": {
30623
+ /** @description Which providers may serve a model call for this account. A model whose `keyStatus` is `needs_setup` is refused at execution. */
30624
+ credentialPolicy?: {
30625
+ /** @description Providers organization policy refuses until a credential is connected. */
30626
+ blockedProviders: string[];
30627
+ /** @description Providers served by the account own credentials. `generic-openai` is its custom inference endpoint. */
30628
+ byokProviders: string[];
30629
+ /**
30630
+ * @description `byok_only`: the organization requires its own model keys; only `byokProviders` serve calls and Runtype platform keys are never used. `mixed`: some providers run on the account credentials and others on platform keys. `platform`: the account has connected no provider credentials.
30631
+ * @enum {string}
30632
+ */
30633
+ mode: "byok_only" | "mixed" | "platform";
30634
+ /** @description Providers served by Runtype platform keys. */
30635
+ platformProviders: string[];
30636
+ /** @description Plain-language statement of the same facts. */
30637
+ summary: string;
30638
+ };
30214
30639
  data: {
30640
+ /** @description `personal` or `organization` for a stored configuration. `organization_connection` marks a model an organization custom inference endpoint declares that the caller has no stored configuration for: it is runnable, and its `id` cannot be updated, toggled, or deleted (change the connection model list instead). */
30215
30641
  configScope?: string;
30216
30642
  /**
30217
30643
  * @description Organization configuration readiness. `needs_configuration` means conflicting legacy teammate settings were preserved and execution fails closed until an authorized actor deliberately updates the canonical row.
@@ -30385,6 +30811,7 @@ interface paths {
30385
30811
  };
30386
30812
  content: {
30387
30813
  "application/json": {
30814
+ /** @description `personal` or `organization` for a stored configuration. `organization_connection` marks a model an organization custom inference endpoint declares that the caller has no stored configuration for: it is runnable, and its `id` cannot be updated, toggled, or deleted (change the connection model list instead). */
30388
30815
  configScope?: string;
30389
30816
  /**
30390
30817
  * @description Organization configuration readiness. `needs_configuration` means conflicting legacy teammate settings were preserved and execution fails closed until an authorized actor deliberately updates the canonical row.
@@ -30565,6 +30992,22 @@ interface paths {
30565
30992
  };
30566
30993
  content: {
30567
30994
  "application/json": {
30995
+ /** @description Which providers may serve a model call for this account. A model whose `keyStatus` is `needs_setup` is refused at execution. */
30996
+ credentialPolicy?: {
30997
+ /** @description Providers organization policy refuses until a credential is connected. */
30998
+ blockedProviders: string[];
30999
+ /** @description Providers served by the account own credentials. `generic-openai` is its custom inference endpoint. */
31000
+ byokProviders: string[];
31001
+ /**
31002
+ * @description `byok_only`: the organization requires its own model keys; only `byokProviders` serve calls and Runtype platform keys are never used. `mixed`: some providers run on the account credentials and others on platform keys. `platform`: the account has connected no provider credentials.
31003
+ * @enum {string}
31004
+ */
31005
+ mode: "byok_only" | "mixed" | "platform";
31006
+ /** @description Providers served by Runtype platform keys. */
31007
+ platformProviders: string[];
31008
+ /** @description Plain-language statement of the same facts. */
31009
+ summary: string;
31010
+ };
30568
31011
  data: {
30569
31012
  contextLength?: number;
30570
31013
  costPer1kTokens: number;
@@ -30637,7 +31080,7 @@ interface paths {
30637
31080
  };
30638
31081
  /**
30639
31082
  * Get grouped models
30640
- * @description Get models grouped by base model with all provider options. Supports filtering to configured-only models.
31083
+ * @description Get models grouped by base model with all provider options. Supports filtering to configured-only models. The account custom models (`isCustom: true`) always follow the catalog groups; `category=custom` returns only them. `credentialPolicy` states which providers may serve a call.
30641
31084
  */
30642
31085
  get: {
30643
31086
  parameters: {
@@ -30659,6 +31102,22 @@ interface paths {
30659
31102
  };
30660
31103
  content: {
30661
31104
  "application/json": {
31105
+ /** @description Which providers may serve a model call for this account. A model whose `keyStatus` is `needs_setup` is refused at execution. */
31106
+ credentialPolicy?: {
31107
+ /** @description Providers organization policy refuses until a credential is connected. */
31108
+ blockedProviders: string[];
31109
+ /** @description Providers served by the account own credentials. `generic-openai` is its custom inference endpoint. */
31110
+ byokProviders: string[];
31111
+ /**
31112
+ * @description `byok_only`: the organization requires its own model keys; only `byokProviders` serve calls and Runtype platform keys are never used. `mixed`: some providers run on the account credentials and others on platform keys. `platform`: the account has connected no provider credentials.
31113
+ * @enum {string}
31114
+ */
31115
+ mode: "byok_only" | "mixed" | "platform";
31116
+ /** @description Providers served by Runtype platform keys. */
31117
+ platformProviders: string[];
31118
+ /** @description Plain-language statement of the same facts. */
31119
+ summary: string;
31120
+ };
30662
31121
  data: {
30663
31122
  baseModel: string;
30664
31123
  configuredConfigs: {
@@ -30676,6 +31135,8 @@ interface paths {
30676
31135
  creditPromoMultiplier?: number;
30677
31136
  displayName: string;
30678
31137
  isConfigured: boolean;
31138
+ /** @description True for a model the account declared itself that the platform catalog does not list. `baseModel` is then the exact model id to run. */
31139
+ isCustom?: boolean;
30679
31140
  lowestCost: number;
30680
31141
  maxOutputTokens: number;
30681
31142
  providers: {
@@ -31058,6 +31519,7 @@ interface paths {
31058
31519
  };
31059
31520
  content: {
31060
31521
  "application/json": {
31522
+ /** @description `personal` or `organization` for a stored configuration. `organization_connection` marks a model an organization custom inference endpoint declares that the caller has no stored configuration for: it is runnable, and its `id` cannot be updated, toggled, or deleted (change the connection model list instead). */
31061
31523
  configScope?: string;
31062
31524
  /**
31063
31525
  * @description Organization configuration readiness. `needs_configuration` means conflicting legacy teammate settings were preserved and execution fails closed until an authorized actor deliberately updates the canonical row.
@@ -31336,6 +31798,7 @@ interface paths {
31336
31798
  content: {
31337
31799
  "application/json": {
31338
31800
  data: {
31801
+ /** @description `personal` or `organization` for a stored configuration. `organization_connection` marks a model an organization custom inference endpoint declares that the caller has no stored configuration for: it is runnable, and its `id` cannot be updated, toggled, or deleted (change the connection model list instead). */
31339
31802
  configScope?: string;
31340
31803
  /**
31341
31804
  * @description Organization configuration readiness. `needs_configuration` means conflicting legacy teammate settings were preserved and execution fails closed until an authorized actor deliberately updates the canonical row.
@@ -31701,7 +32164,7 @@ interface paths {
31701
32164
  [name: string]: unknown;
31702
32165
  };
31703
32166
  content: {
31704
- "application/json": components["schemas"]["Error"];
32167
+ "application/json": components["schemas"]["InternalError"];
31705
32168
  };
31706
32169
  };
31707
32170
  /** @description Analytics Engine not configured */
@@ -31815,7 +32278,7 @@ interface paths {
31815
32278
  [name: string]: unknown;
31816
32279
  };
31817
32280
  content: {
31818
- "application/json": components["schemas"]["Error"];
32281
+ "application/json": components["schemas"]["InternalError"];
31819
32282
  };
31820
32283
  };
31821
32284
  /** @description Analytics Engine not configured */
@@ -31880,8 +32343,22 @@ interface paths {
31880
32343
  capabilityCount: number;
31881
32344
  createdAt: string;
31882
32345
  description: string | null;
32346
+ /** @description What a Runs elsewhere product was imported from; null for any other product */
32347
+ externalSource: {
32348
+ /** @enum {string} */
32349
+ kind: "mcp" | "openapi" | "a2a";
32350
+ /** @description The saved MCP connection the import signed in through */
32351
+ savedServerName?: string;
32352
+ serverName: string | null;
32353
+ url: string;
32354
+ } | null;
31883
32355
  icon: string | null;
31884
32356
  id: string;
32357
+ /**
32358
+ * @description Derived on read: `external` (Runs elsewhere) for a product imported from a server it does not run, `spec_only` for one with no capability and no surface, otherwise `runtype`
32359
+ * @enum {string}
32360
+ */
32361
+ kind: "runtype" | "external" | "spec_only";
31885
32362
  name: string;
31886
32363
  spec?: unknown;
31887
32364
  surfaceCount: number;
@@ -31993,9 +32470,11 @@ interface paths {
31993
32470
  };
31994
32471
  quickStartImport?: {
31995
32472
  /** @enum {string} */
31996
- documentKind: "a2a-agent" | "fpo" | "fpo-template";
32473
+ documentKind: "a2a-agent" | "fpo" | "fpo-template" | "mcp-server";
31997
32474
  importedAt: string;
31998
32475
  normalizedSourceUrl?: string;
32476
+ savedServerName?: string;
32477
+ serverName?: string;
31999
32478
  /** @enum {string} */
32000
32479
  sourceKind: "url" | "json";
32001
32480
  sourceUrl?: string;
@@ -32187,6 +32666,8 @@ interface paths {
32187
32666
  surfaceItemIds: string[];
32188
32667
  type: string;
32189
32668
  }[];
32669
+ /** @description Non-fatal advisories, e.g. a remapped deprecated field or seed data skipped because an existing enforce collection outside the FPO refuses it. */
32670
+ warnings?: string[];
32190
32671
  };
32191
32672
  };
32192
32673
  };
@@ -32732,6 +33213,10 @@ interface paths {
32732
33213
  publishedVersionIds?: {
32733
33214
  [key: string]: string | null;
32734
33215
  };
33216
+ /** @description The live version number per capability flow or agent id (a flow reads its saved number), as `Live · vN` names it; null when never published */
33217
+ publishedVersionNumbers?: {
33218
+ [key: string]: number | null;
33219
+ };
32735
33220
  /** @description Display name per capability flow or agent id */
32736
33221
  resourceNames?: {
32737
33222
  [key: string]: string;
@@ -32745,8 +33230,22 @@ interface paths {
32745
33230
  [key: string]: string[];
32746
33231
  };
32747
33232
  };
33233
+ /** @description What a Runs elsewhere product was imported from; null for any other product */
33234
+ externalSource: {
33235
+ /** @enum {string} */
33236
+ kind: "mcp" | "openapi" | "a2a";
33237
+ /** @description The saved MCP connection the import signed in through */
33238
+ savedServerName?: string;
33239
+ serverName: string | null;
33240
+ url: string;
33241
+ } | null;
32748
33242
  icon: string | null;
32749
33243
  id: string;
33244
+ /**
33245
+ * @description Derived on read: `external` (Runs elsewhere) for a product imported from a server it does not run, `spec_only` for one with no capability and no surface, otherwise `runtype`
33246
+ * @enum {string}
33247
+ */
33248
+ kind: "runtype" | "external" | "spec_only";
32750
33249
  name: string;
32751
33250
  pendingConfigurationCount?: number;
32752
33251
  spec?: unknown;
@@ -32854,9 +33353,11 @@ interface paths {
32854
33353
  };
32855
33354
  quickStartImport?: {
32856
33355
  /** @enum {string} */
32857
- documentKind: "a2a-agent" | "fpo" | "fpo-template";
33356
+ documentKind: "a2a-agent" | "fpo" | "fpo-template" | "mcp-server";
32858
33357
  importedAt: string;
32859
33358
  normalizedSourceUrl?: string;
33359
+ savedServerName?: string;
33360
+ serverName?: string;
32860
33361
  /** @enum {string} */
32861
33362
  sourceKind: "url" | "json";
32862
33363
  sourceUrl?: string;
@@ -33142,6 +33643,8 @@ interface paths {
33142
33643
  fidelityTier: string | null;
33143
33644
  /** @description Flow that ran. */
33144
33645
  flowId: string | null;
33646
+ /** @description Exact saved flow version or test capture that ran. Absent means the overlay did not answer, which is not false and not null. */
33647
+ flowVersionId?: string | null;
33145
33648
  /** @description True when the dispatch carried a complete inline agent definition (name and model) beside or instead of an agentId, so the run executed that inline config and no stored version; such a row stamps no agentVersionId. False when the run executed the saved definition by reference. NULL when the header states nothing: a flow run, a lane that resolves no agent definition, or a row that predates the field. */
33146
33649
  inlineDefinition: boolean | null;
33147
33650
  /** @description Messages the run started from. Absent means the overlay did not answer, which is not false and not null. */
@@ -33221,13 +33724,13 @@ interface paths {
33221
33724
  traceId: string | null;
33222
33725
  /** @description How the run started, for a Via column. Forward-only for schedule, api key, cli, mcp and eval detail: a header written before those stamps reads null, or falls back to the coarse origin/surface facts when they alone answer it. A label is a snapshot or a lookup and never authority; mcp, cli and sdk are self-declared by the client. */
33223
33726
  via?: {
33224
- /** @description The thing that started it: the schedule id (schedule), product surface id (surface), API key id (api), the acting user id (cli) or eval suite id (eval). Null for mcp and test, and for an api run whose header predates key stamping. */
33727
+ /** @description The thing that started it: the schedule id (schedule), product surface id (surface), API key id (api), the acting user id (cli), eval suite id (eval) or simulation run id (simulation). Null for mcp and test, and for an api run whose header predates key stamping. */
33225
33728
  id: string | null;
33226
33729
  /**
33227
33730
  * @description One word for the way the run started.
33228
33731
  * @enum {string}
33229
33732
  */
33230
- kind: "schedule" | "surface" | "api" | "mcp" | "cli" | "test" | "eval";
33733
+ kind: "schedule" | "surface" | "api" | "mcp" | "cli" | "test" | "eval" | "simulation";
33231
33734
  /** @description Its display name when the API could resolve one: schedule name, surface name, API key name as it was at dispatch, MCP client name, the acting user's first name, or eval suite name. Null when unresolved, for example a deleted schedule. */
33232
33735
  label: string | null;
33233
33736
  } | null;
@@ -34616,7 +35119,18 @@ interface paths {
34616
35119
  [name: string]: unknown;
34617
35120
  };
34618
35121
  content: {
34619
- "application/json": components["schemas"]["Error"];
35122
+ "application/json": components["schemas"]["InternalError"];
35123
+ };
35124
+ };
35125
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
35126
+ 503: {
35127
+ headers: {
35128
+ /** @description Advisory wait before retrying, in whole seconds. */
35129
+ "Retry-After": string;
35130
+ [name: string]: unknown;
35131
+ };
35132
+ content: {
35133
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
34620
35134
  };
34621
35135
  };
34622
35136
  };
@@ -36950,7 +37464,18 @@ interface paths {
36950
37464
  [name: string]: unknown;
36951
37465
  };
36952
37466
  content: {
36953
- "application/json": components["schemas"]["Error"];
37467
+ "application/json": components["schemas"]["InternalError"];
37468
+ };
37469
+ };
37470
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
37471
+ 503: {
37472
+ headers: {
37473
+ /** @description Advisory wait before retrying, in whole seconds. */
37474
+ "Retry-After": string;
37475
+ [name: string]: unknown;
37476
+ };
37477
+ content: {
37478
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
36954
37479
  };
36955
37480
  };
36956
37481
  };
@@ -42184,7 +42709,18 @@ interface paths {
42184
42709
  [name: string]: unknown;
42185
42710
  };
42186
42711
  content: {
42187
- "application/json": components["schemas"]["Error"];
42712
+ "application/json": components["schemas"]["InternalError"];
42713
+ };
42714
+ };
42715
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
42716
+ 503: {
42717
+ headers: {
42718
+ /** @description Advisory wait before retrying, in whole seconds. */
42719
+ "Retry-After": string;
42720
+ [name: string]: unknown;
42721
+ };
42722
+ content: {
42723
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
42188
42724
  };
42189
42725
  };
42190
42726
  };
@@ -42315,7 +42851,7 @@ interface paths {
42315
42851
  [name: string]: unknown;
42316
42852
  };
42317
42853
  content: {
42318
- "application/json": components["schemas"]["Error"];
42854
+ "application/json": components["schemas"]["InternalError"];
42319
42855
  };
42320
42856
  };
42321
42857
  /** @description The type's collection schema could not be loaded, so the write was refused rather than left unvalidated; retry */
@@ -42670,7 +43206,18 @@ interface paths {
42670
43206
  [name: string]: unknown;
42671
43207
  };
42672
43208
  content: {
42673
- "application/json": components["schemas"]["Error"];
43209
+ "application/json": components["schemas"]["InternalError"];
43210
+ };
43211
+ };
43212
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
43213
+ 503: {
43214
+ headers: {
43215
+ /** @description Advisory wait before retrying, in whole seconds. */
43216
+ "Retry-After": string;
43217
+ [name: string]: unknown;
43218
+ };
43219
+ content: {
43220
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
42674
43221
  };
42675
43222
  };
42676
43223
  };
@@ -43990,11 +44537,13 @@ interface paths {
43990
44537
  source?: "hosted" | "ingested";
43991
44538
  /** @description status accepts only running, completed or failed. queued, awaiting and cancelled exist only in the live overlay, which may never change which rows a page holds, so the server cannot filter on them. */
43992
44539
  status?: "running" | "completed" | "failed";
44540
+ /** @description live keeps runs real users and integrations started; test keeps runs started from the dashboard (Test, step tests, Ask); eval keeps eval-batch runs; sim keeps simulation turns; all, or omitted, keeps every run. A simulation turn is sim even when a schedule started it, a schedule run is live, and an eval batch run is eval whoever started it. */
44541
+ traffic?: "live" | "test" | "eval" | "sim" | "all";
43993
44542
  /** @description Window start (ISO 8601). Defaults to 24 hours ago. */
43994
44543
  from?: string;
43995
44544
  /** @description Window end (ISO 8601). Defaults to now. */
43996
44545
  to?: string;
43997
- /** @description full (the default) returns every field. compact omits exactly these 15: stopReason, iterations, inputPreview, agentVersionId, agentVersionLabel, agentVersionNumber, agentTargetResolution, otelProducer, lastHeartbeatAt, expiresAt, cancelRequestedAt, progress, pendingApproval, budgetExhausted and inputMessages. The status is still overlay-corrected on a compact page; only the fields differ. */
44546
+ /** @description full (the default) returns every field. compact omits exactly these 16: stopReason, iterations, inputPreview, flowVersionId, agentVersionId, agentVersionLabel, agentVersionNumber, agentTargetResolution, otelProducer, lastHeartbeatAt, expiresAt, cancelRequestedAt, progress, pendingApproval, budgetExhausted and inputMessages. The status is still overlay-corrected on a compact page; only the fields differ. */
43998
44547
  view?: "compact" | "full";
43999
44548
  /** @description live adds control-plane fields; defaults to live for a session, none for an API key. */
44000
44549
  overlay?: "live" | "none";
@@ -44075,6 +44624,137 @@ interface paths {
44075
44624
  "application/json": components["schemas"]["Error"];
44076
44625
  };
44077
44626
  };
44627
+ /** @description Run store temporarily unavailable; nothing could be read. Retry after the `Retry-After` interval (seconds). */
44628
+ 503: {
44629
+ headers: {
44630
+ /** @description Advisory wait before retrying, in whole seconds. */
44631
+ "Retry-After": string;
44632
+ [name: string]: unknown;
44633
+ };
44634
+ content: {
44635
+ "application/json": components["schemas"]["RunStoreUnavailableError"];
44636
+ };
44637
+ };
44638
+ };
44639
+ };
44640
+ put?: never;
44641
+ post?: never;
44642
+ delete?: never;
44643
+ options?: never;
44644
+ head?: never;
44645
+ patch?: never;
44646
+ trace?: never;
44647
+ };
44648
+ "/v1/runs/stats": {
44649
+ parameters: {
44650
+ query?: never;
44651
+ header?: never;
44652
+ path?: never;
44653
+ cookie?: never;
44654
+ };
44655
+ /**
44656
+ * Count runs
44657
+ * @description Totals, failures, latency percentiles and cost over exactly the runs `GET /v1/runs` lists for the same filters and window, grouped by flow, agent and surface. `failed` uses the list's own `status=failed` predicate, so a count and the rows it describes cannot disagree. `traffic` narrows to live, test, eval or sim runs; `byTraffic` reports all four before that filter. Cost never counts an unknown run as zero: `cost.unpricedRuns` says how many settled runs have no known cost.
44658
+ */
44659
+ get: {
44660
+ parameters: {
44661
+ query?: {
44662
+ /** @description Filter by agent id; repeat for a set. */
44663
+ agentId?: string | string[];
44664
+ /** @description Filter by flow id; repeat for a set. */
44665
+ flowId?: string | string[];
44666
+ /** @description Filter by conversation id. */
44667
+ conversationId?: string;
44668
+ /** @description Filter by surface id. */
44669
+ surfaceId?: string;
44670
+ /** @description Filter by surface family. */
44671
+ surfaceType?: string;
44672
+ /** @description Filter by record id. */
44673
+ recordId?: string;
44674
+ /** @description Filter by batch id; repeat for a set. */
44675
+ batchExecutionId?: string | string[];
44676
+ /** @description true restores the flat enumeration on the UNSCOPED feed, in which a subagent run and a nested-flow run list beside their parent. The unscoped feed is roots only by default: a row whose parentExecutionId is set folds under its parent and is read with parentExecutionId=<executionId>. Any filter that scopes to a resource — agentId, flowId, conversationId, surfaceId, recordId, batchExecutionId, parentExecutionId, rootExecutionId or executionId — is already an explicit selection and never folds, so an agent that only ever runs as a subagent still lists under agentId. This parameter changes nothing on a scoped request. */
44677
+ includeChildren?: "true" | "false";
44678
+ /** @description Filter by producing lane. */
44679
+ source?: "hosted" | "ingested";
44680
+ /** @description status accepts only running, completed or failed. queued, awaiting and cancelled exist only in the live overlay, which may never change which rows a page holds, so the server cannot filter on them. */
44681
+ status?: "running" | "completed" | "failed";
44682
+ /** @description live keeps runs real users and integrations started; test keeps runs started from the dashboard (Test, step tests, Ask); eval keeps eval-batch runs; sim keeps simulation turns; all, or omitted, keeps every run. A simulation turn is sim even when a schedule started it, a schedule run is live, and an eval batch run is eval whoever started it. */
44683
+ traffic?: "live" | "test" | "eval" | "sim" | "all";
44684
+ /** @description Window start (ISO 8601). Defaults to 24 hours ago. */
44685
+ from?: string;
44686
+ /** @description Window end (ISO 8601). Defaults to now. */
44687
+ to?: string;
44688
+ };
44689
+ header?: never;
44690
+ path?: never;
44691
+ cookie?: never;
44692
+ };
44693
+ requestBody?: never;
44694
+ responses: {
44695
+ /** @description Run counts returned */
44696
+ 200: {
44697
+ headers: {
44698
+ [name: string]: unknown;
44699
+ };
44700
+ content: {
44701
+ "application/json": {
44702
+ data: components["schemas"]["RunStats"];
44703
+ /** @description The started_at window the query resolved to, after defaults. */
44704
+ window: {
44705
+ from: string;
44706
+ to: string;
44707
+ };
44708
+ };
44709
+ };
44710
+ };
44711
+ /** @description Invalid request, including a filter whose value could not be read */
44712
+ 400: {
44713
+ headers: {
44714
+ [name: string]: unknown;
44715
+ };
44716
+ content: {
44717
+ "application/json": components["schemas"]["Error"];
44718
+ };
44719
+ };
44720
+ /** @description Unauthorized */
44721
+ 401: {
44722
+ headers: {
44723
+ [name: string]: unknown;
44724
+ };
44725
+ content: {
44726
+ "application/json": components["schemas"]["Error"];
44727
+ };
44728
+ };
44729
+ /** @description Insufficient API key permissions */
44730
+ 403: {
44731
+ headers: {
44732
+ [name: string]: unknown;
44733
+ };
44734
+ content: {
44735
+ "application/json": components["schemas"]["Error"];
44736
+ };
44737
+ };
44738
+ /** @description Internal server error */
44739
+ 500: {
44740
+ headers: {
44741
+ [name: string]: unknown;
44742
+ };
44743
+ content: {
44744
+ "application/json": components["schemas"]["Error"];
44745
+ };
44746
+ };
44747
+ /** @description Run store temporarily unavailable; nothing could be read. Retry after the `Retry-After` interval (seconds). */
44748
+ 503: {
44749
+ headers: {
44750
+ /** @description Advisory wait before retrying, in whole seconds. */
44751
+ "Retry-After": string;
44752
+ [name: string]: unknown;
44753
+ };
44754
+ content: {
44755
+ "application/json": components["schemas"]["RunStoreUnavailableError"];
44756
+ };
44757
+ };
44078
44758
  };
44079
44759
  };
44080
44760
  put?: never;
@@ -44101,7 +44781,7 @@ interface paths {
44101
44781
  query?: {
44102
44782
  /** @description live adds control-plane fields; defaults to live for a session, none for an API key. */
44103
44783
  overlay?: "live" | "none";
44104
- /** @description full (the default) returns every field. compact omits exactly these 15: stopReason, iterations, inputPreview, agentVersionId, agentVersionLabel, agentVersionNumber, agentTargetResolution, otelProducer, lastHeartbeatAt, expiresAt, cancelRequestedAt, progress, pendingApproval, budgetExhausted and inputMessages. The status is still overlay-corrected on a compact page; only the fields differ. */
44784
+ /** @description full (the default) returns every field. compact omits exactly these 16: stopReason, iterations, inputPreview, flowVersionId, agentVersionId, agentVersionLabel, agentVersionNumber, agentTargetResolution, otelProducer, lastHeartbeatAt, expiresAt, cancelRequestedAt, progress, pendingApproval, budgetExhausted and inputMessages. The status is still overlay-corrected on a compact page; only the fields differ. */
44105
44785
  view?: "compact" | "full";
44106
44786
  };
44107
44787
  header?: never;
@@ -44168,6 +44848,17 @@ interface paths {
44168
44848
  "application/json": components["schemas"]["Error"];
44169
44849
  };
44170
44850
  };
44851
+ /** @description Run store temporarily unavailable; nothing could be read. Retry after the `Retry-After` interval (seconds). */
44852
+ 503: {
44853
+ headers: {
44854
+ /** @description Advisory wait before retrying, in whole seconds. */
44855
+ "Retry-After": string;
44856
+ [name: string]: unknown;
44857
+ };
44858
+ content: {
44859
+ "application/json": components["schemas"]["RunStoreUnavailableError"];
44860
+ };
44861
+ };
44171
44862
  };
44172
44863
  };
44173
44864
  put?: never;
@@ -44576,6 +45267,139 @@ interface paths {
44576
45267
  patch?: never;
44577
45268
  trace?: never;
44578
45269
  };
45270
+ "/v1/runtime/judgments": {
45271
+ parameters: {
45272
+ query?: never;
45273
+ header?: never;
45274
+ path?: never;
45275
+ cookie?: never;
45276
+ };
45277
+ get?: never;
45278
+ put?: never;
45279
+ /**
45280
+ * Ask for a judgment (hosted DecisionProvider)
45281
+ * @description The runtime-family judgment contract consumed by `@runtypelabs/runtime`’s HostedDecisionProvider, so a self-hosted runtime on platform or hybrid keys judges through Runtype with a Self-hosted Runtime key (`RUNTIME:EXECUTE`). Answers like `builtin:decision_judge`: with `questionSetId` the published question set supplies the questions (configured mode, and `questions` is refused); without it the call supplies `questions` (ad hoc mode). Billed and recorded like a decision tool call. Requires an Enterprise plan: ineligible accounts receive 403 (code `BYOC_PLAN_REQUIRED`).
45282
+ */
45283
+ post: {
45284
+ parameters: {
45285
+ query?: never;
45286
+ header?: never;
45287
+ path?: never;
45288
+ cookie?: never;
45289
+ };
45290
+ requestBody?: {
45291
+ content: {
45292
+ "application/json": components["schemas"]["RuntimeJudgmentRequest"];
45293
+ };
45294
+ };
45295
+ responses: {
45296
+ /** @description The answers and the judgment metadata */
45297
+ 200: {
45298
+ headers: {
45299
+ [name: string]: unknown;
45300
+ };
45301
+ content: {
45302
+ "application/json": components["schemas"]["RuntimeJudgmentResponse"];
45303
+ };
45304
+ };
45305
+ /** @description Invalid state, questions or configuration (see `code`) */
45306
+ 400: {
45307
+ headers: {
45308
+ [name: string]: unknown;
45309
+ };
45310
+ content: {
45311
+ "application/json": components["schemas"]["Error"] & {
45312
+ /** @description Stable code for a caller-fixable failure, e.g. JUDGMENT_QUESTIONS_INVALID, JUDGMENT_CONFIGURED_QUESTIONS_REJECTED or QUESTION_SET_UNRESOLVED. */
45313
+ code?: string;
45314
+ details?: {
45315
+ [key: string]: unknown;
45316
+ };
45317
+ };
45318
+ };
45319
+ };
45320
+ /** @description Unauthorized */
45321
+ 401: {
45322
+ headers: {
45323
+ [name: string]: unknown;
45324
+ };
45325
+ content: {
45326
+ "application/json": components["schemas"]["Error"];
45327
+ };
45328
+ };
45329
+ /** @description Monthly spend limit exceeded */
45330
+ 402: {
45331
+ headers: {
45332
+ [name: string]: unknown;
45333
+ };
45334
+ content: {
45335
+ "application/json": components["schemas"]["Error"];
45336
+ };
45337
+ };
45338
+ /** @description Not an API key, the key lacks an execute permission, or the account is not on an Enterprise plan (code `BYOC_PLAN_REQUIRED`) */
45339
+ 403: {
45340
+ headers: {
45341
+ [name: string]: unknown;
45342
+ };
45343
+ content: {
45344
+ "application/json": components["schemas"]["Error"];
45345
+ };
45346
+ };
45347
+ /** @description The question set is missing, unpublished or not owned by the caller (code `QUESTION_SET_UNRESOLVED`) */
45348
+ 404: {
45349
+ headers: {
45350
+ [name: string]: unknown;
45351
+ };
45352
+ content: {
45353
+ "application/json": components["schemas"]["Error"] & {
45354
+ /** @description Stable code for a caller-fixable failure, e.g. JUDGMENT_QUESTIONS_INVALID, JUDGMENT_CONFIGURED_QUESTIONS_REJECTED or QUESTION_SET_UNRESOLVED. */
45355
+ code?: string;
45356
+ details?: {
45357
+ [key: string]: unknown;
45358
+ };
45359
+ };
45360
+ };
45361
+ };
45362
+ /** @description The decision model is not served or no credential can pay for it (see `code`) */
45363
+ 422: {
45364
+ headers: {
45365
+ [name: string]: unknown;
45366
+ };
45367
+ content: {
45368
+ "application/json": components["schemas"]["Error"] & {
45369
+ /** @description Stable code for a caller-fixable failure, e.g. JUDGMENT_QUESTIONS_INVALID, JUDGMENT_CONFIGURED_QUESTIONS_REJECTED or QUESTION_SET_UNRESOLVED. */
45370
+ code?: string;
45371
+ details?: {
45372
+ [key: string]: unknown;
45373
+ };
45374
+ };
45375
+ };
45376
+ };
45377
+ /** @description Daily execution limit or rate limit exceeded */
45378
+ 429: {
45379
+ headers: {
45380
+ [name: string]: unknown;
45381
+ };
45382
+ content: {
45383
+ "application/json": components["schemas"]["Error"];
45384
+ };
45385
+ };
45386
+ /** @description Judgment failed */
45387
+ 500: {
45388
+ headers: {
45389
+ [name: string]: unknown;
45390
+ };
45391
+ content: {
45392
+ "application/json": components["schemas"]["Error"];
45393
+ };
45394
+ };
45395
+ };
45396
+ };
45397
+ delete?: never;
45398
+ options?: never;
45399
+ head?: never;
45400
+ patch?: never;
45401
+ trace?: never;
45402
+ };
44579
45403
  "/v1/runtime/memory/recall": {
44580
45404
  parameters: {
44581
45405
  query?: never;
@@ -45099,6 +45923,17 @@ interface paths {
45099
45923
  };
45100
45924
  };
45101
45925
  };
45926
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
45927
+ 503: {
45928
+ headers: {
45929
+ /** @description Advisory wait before retrying, in whole seconds. */
45930
+ "Retry-After": string;
45931
+ [name: string]: unknown;
45932
+ };
45933
+ content: {
45934
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
45935
+ };
45936
+ };
45102
45937
  };
45103
45938
  };
45104
45939
  delete?: never;
@@ -45257,6 +46092,17 @@ interface paths {
45257
46092
  };
45258
46093
  };
45259
46094
  };
46095
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
46096
+ 503: {
46097
+ headers: {
46098
+ /** @description Advisory wait before retrying, in whole seconds. */
46099
+ "Retry-After": string;
46100
+ [name: string]: unknown;
46101
+ };
46102
+ content: {
46103
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
46104
+ };
46105
+ };
45260
46106
  };
45261
46107
  };
45262
46108
  delete?: never;
@@ -45395,6 +46241,17 @@ interface paths {
45395
46241
  };
45396
46242
  };
45397
46243
  };
46244
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
46245
+ 503: {
46246
+ headers: {
46247
+ /** @description Advisory wait before retrying, in whole seconds. */
46248
+ "Retry-After": string;
46249
+ [name: string]: unknown;
46250
+ };
46251
+ content: {
46252
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
46253
+ };
46254
+ };
45398
46255
  };
45399
46256
  };
45400
46257
  delete?: never;
@@ -45535,6 +46392,17 @@ interface paths {
45535
46392
  };
45536
46393
  };
45537
46394
  };
46395
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
46396
+ 503: {
46397
+ headers: {
46398
+ /** @description Advisory wait before retrying, in whole seconds. */
46399
+ "Retry-After": string;
46400
+ [name: string]: unknown;
46401
+ };
46402
+ content: {
46403
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
46404
+ };
46405
+ };
45538
46406
  };
45539
46407
  };
45540
46408
  delete?: never;
@@ -47334,7 +48202,18 @@ interface paths {
47334
48202
  [name: string]: unknown;
47335
48203
  };
47336
48204
  content: {
47337
- "application/json": components["schemas"]["Error"];
48205
+ "application/json": components["schemas"]["InternalError"];
48206
+ };
48207
+ };
48208
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
48209
+ 503: {
48210
+ headers: {
48211
+ /** @description Advisory wait before retrying, in whole seconds. */
48212
+ "Retry-After": string;
48213
+ [name: string]: unknown;
48214
+ };
48215
+ content: {
48216
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
47338
48217
  };
47339
48218
  };
47340
48219
  };
@@ -49556,7 +50435,18 @@ interface paths {
49556
50435
  [name: string]: unknown;
49557
50436
  };
49558
50437
  content: {
49559
- "application/json": components["schemas"]["Error"];
50438
+ "application/json": components["schemas"]["InternalError"];
50439
+ };
50440
+ };
50441
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
50442
+ 503: {
50443
+ headers: {
50444
+ /** @description Advisory wait before retrying, in whole seconds. */
50445
+ "Retry-After": string;
50446
+ [name: string]: unknown;
50447
+ };
50448
+ content: {
50449
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
49560
50450
  };
49561
50451
  };
49562
50452
  };
@@ -50982,7 +51872,18 @@ interface paths {
50982
51872
  [name: string]: unknown;
50983
51873
  };
50984
51874
  content: {
50985
- "application/json": components["schemas"]["Error"];
51875
+ "application/json": components["schemas"]["InternalError"];
51876
+ };
51877
+ };
51878
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
51879
+ 503: {
51880
+ headers: {
51881
+ /** @description Advisory wait before retrying, in whole seconds. */
51882
+ "Retry-After": string;
51883
+ [name: string]: unknown;
51884
+ };
51885
+ content: {
51886
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
50986
51887
  };
50987
51888
  };
50988
51889
  };
@@ -51942,7 +52843,18 @@ interface paths {
51942
52843
  [name: string]: unknown;
51943
52844
  };
51944
52845
  content: {
51945
- "application/json": components["schemas"]["Error"];
52846
+ "application/json": components["schemas"]["InternalError"];
52847
+ };
52848
+ };
52849
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
52850
+ 503: {
52851
+ headers: {
52852
+ /** @description Advisory wait before retrying, in whole seconds. */
52853
+ "Retry-After": string;
52854
+ [name: string]: unknown;
52855
+ };
52856
+ content: {
52857
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
51946
52858
  };
51947
52859
  };
51948
52860
  };
@@ -52008,7 +52920,18 @@ interface paths {
52008
52920
  [name: string]: unknown;
52009
52921
  };
52010
52922
  content: {
52011
- "application/json": components["schemas"]["Error"];
52923
+ "application/json": components["schemas"]["InternalError"];
52924
+ };
52925
+ };
52926
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
52927
+ 503: {
52928
+ headers: {
52929
+ /** @description Advisory wait before retrying, in whole seconds. */
52930
+ "Retry-After": string;
52931
+ [name: string]: unknown;
52932
+ };
52933
+ content: {
52934
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
52012
52935
  };
52013
52936
  };
52014
52937
  };
@@ -52293,6 +53216,7 @@ interface paths {
52293
53216
  enableWorkspaceModel: boolean;
52294
53217
  externalTelemetryAllowed?: boolean;
52295
53218
  modelCreditPromoMultiplier?: number;
53219
+ simulationsAvailable?: boolean;
52296
53220
  workspaceModelEligible: boolean;
52297
53221
  workspaceModelReady: boolean;
52298
53222
  };
@@ -52551,7 +53475,18 @@ interface paths {
52551
53475
  [name: string]: unknown;
52552
53476
  };
52553
53477
  content: {
52554
- "application/json": components["schemas"]["Error"];
53478
+ "application/json": components["schemas"]["InternalError"];
53479
+ };
53480
+ };
53481
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
53482
+ 503: {
53483
+ headers: {
53484
+ /** @description Advisory wait before retrying, in whole seconds. */
53485
+ "Retry-After": string;
53486
+ [name: string]: unknown;
53487
+ };
53488
+ content: {
53489
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
52555
53490
  };
52556
53491
  };
52557
53492
  };
@@ -52637,7 +53572,18 @@ interface paths {
52637
53572
  [name: string]: unknown;
52638
53573
  };
52639
53574
  content: {
52640
- "application/json": components["schemas"]["Error"];
53575
+ "application/json": components["schemas"]["InternalError"];
53576
+ };
53577
+ };
53578
+ /** @description Database temporarily unavailable; nothing was read or written. Retry after the `Retry-After` interval (seconds). */
53579
+ 503: {
53580
+ headers: {
53581
+ /** @description Advisory wait before retrying, in whole seconds. */
53582
+ "Retry-After": string;
53583
+ [name: string]: unknown;
53584
+ };
53585
+ content: {
53586
+ "application/json": components["schemas"]["DatabaseUnavailableError"];
52641
53587
  };
52642
53588
  };
52643
53589
  };
@@ -53419,7 +54365,7 @@ interface components {
53419
54365
  reasons: string[];
53420
54366
  };
53421
54367
  BuiltinToolExecuteResult: {
53422
- /** @description Execution metadata for the caller, never part of a model-facing tool result. builtin:typesafe_judge sets metadata.judgment: requestedModel, resolvedModelId (null when not reported), provider, route, calibrationId (null when absent), keySource, questionSetId and questionSetVersion (configured mode), usage { inputTokens, outputTokens, reported }, and estimatedCostUsd (provider rates, before margin). */
54368
+ /** @description Execution metadata for the caller, never part of a model-facing tool result. builtin:decision_judge sets metadata.judgment: requestedModel, resolvedModelId (null when not reported), provider, route, calibrationId (null when absent), keySource, questionSetId and questionSetVersion (configured mode), usage { inputTokens, outputTokens, reported }, and estimatedCostUsd (provider rates, before margin). */
53423
54369
  metadata?: {
53424
54370
  [key: string]: unknown;
53425
54371
  };
@@ -54192,6 +55138,12 @@ interface components {
54192
55138
  tier: string;
54193
55139
  };
54194
55140
  };
55141
+ DatabaseUnavailableError: components["schemas"]["Error"] & {
55142
+ /** @enum {string} */
55143
+ code: "DATABASE_UNAVAILABLE";
55144
+ /** @description The `X-Runtype-Request-ID` of the failed request, for support. */
55145
+ requestId?: string;
55146
+ };
54195
55147
  DecisionModel: {
54196
55148
  contextWindow: number | null;
54197
55149
  credentialRequirements: {
@@ -54505,7 +55457,7 @@ interface components {
54505
55457
  /** @description Per-case graders that REPLACE the suite graders for this case, or null when the case uses the suite graders. */
54506
55458
  graders: unknown[] | null;
54507
55459
  id: string;
54508
- /** @description { variables?, messages?, toolMocks?, endUser?, tenant? } — what the case feeds the target and the identity it runs as. */
55460
+ /** @description { variables?, messages?, toolMocks?, endUser?, tenant?, record? } — what the case feeds the target, the identity it runs as, and the record it runs on. */
54509
55461
  input?: unknown;
54510
55462
  name: string;
54511
55463
  notes: string | null;
@@ -54746,6 +55698,22 @@ interface components {
54746
55698
  suiteId: string;
54747
55699
  updatedAt: string | null;
54748
55700
  };
55701
+ EvalQuotaExceededError: components["schemas"]["Error"] & {
55702
+ /** @description Stable error code. DAILY_EVAL_LIMIT: the daily eval count of the plan is used up; retry after `stats.resetsAt`. SPEND_LIMIT_EXCEEDED: the monthly spend cap is reached. CLAUDE_MANAGED_AGENTS_DENIED: the account cannot evaluate a Claude Managed agent. */
55703
+ code: string;
55704
+ /** @description Human-readable reason, including the limit and when it resets. */
55705
+ message: string;
55706
+ /** @description Daily eval usage at the moment of a DAILY_EVAL_LIMIT or SPEND_LIMIT_EXCEEDED refusal. */
55707
+ stats?: {
55708
+ /** @description Daily eval limit; -1 means unlimited. */
55709
+ evalLimit: number;
55710
+ evalsUsed: number;
55711
+ isAtLimit: boolean;
55712
+ remaining: number | null;
55713
+ /** @description ISO 8601 instant the daily count resets (midnight UTC). */
55714
+ resetsAt: string;
55715
+ };
55716
+ };
54749
55717
  EvalRunScoresResponse: {
54750
55718
  /** @description The release alias the run resolved through, when it resolved through one. */
54751
55719
  agentTargetAlias?: string | null;
@@ -55823,6 +56791,12 @@ interface components {
55823
56791
  /** @enum {string} */
55824
56792
  status: "pending" | "applied" | "settled" | "not_applied";
55825
56793
  };
56794
+ InternalError: components["schemas"]["Error"] & {
56795
+ /** @description Stable error code: `INTERNAL_ERROR` unless the route documents its own. */
56796
+ code: string;
56797
+ /** @description The `X-Runtype-Request-ID` of the failed request, for support. */
56798
+ requestId?: string;
56799
+ };
55826
56800
  JudgmentCalibrationRecord: {
55827
56801
  createdAt: string;
55828
56802
  createdByUserId: string | null;
@@ -56004,7 +56978,7 @@ interface components {
56004
56978
  /** @description Resulting platform id (absent on failure/skip/pruned). */
56005
56979
  id?: string;
56006
56980
  /** @enum {string} */
56007
- kind: "product" | "flow" | "agent" | "capability" | "tool" | "surface" | "record" | "schedule" | "eval" | "skill";
56981
+ kind: "product" | "flow" | "agent" | "capability" | "tool" | "surface" | "record" | "schedule" | "eval" | "skill" | "collection" | "questionSet";
56008
56982
  name: string;
56009
56983
  /** @description The FPO-local ref (capability id / entity name) for correlation. */
56010
56984
  ref: string;
@@ -56406,6 +57380,8 @@ interface components {
56406
57380
  fidelityTier: string | null;
56407
57381
  /** @description Flow that ran. */
56408
57382
  flowId: string | null;
57383
+ /** @description Exact saved flow version or test capture that ran. Absent means the overlay did not answer, which is not false and not null. */
57384
+ flowVersionId?: string | null;
56409
57385
  /** @description True when the dispatch carried a complete inline agent definition (name and model) beside or instead of an agentId, so the run executed that inline config and no stored version; such a row stamps no agentVersionId. False when the run executed the saved definition by reference. NULL when the header states nothing: a flow run, a lane that resolves no agent definition, or a row that predates the field. */
56410
57386
  inlineDefinition: boolean | null;
56411
57387
  /** @description Messages the run started from. Absent means the overlay did not answer, which is not false and not null. */
@@ -56485,17 +57461,198 @@ interface components {
56485
57461
  traceId: string | null;
56486
57462
  /** @description How the run started, for a Via column. Forward-only for schedule, api key, cli, mcp and eval detail: a header written before those stamps reads null, or falls back to the coarse origin/surface facts when they alone answer it. A label is a snapshot or a lookup and never authority; mcp, cli and sdk are self-declared by the client. */
56487
57463
  via?: {
56488
- /** @description The thing that started it: the schedule id (schedule), product surface id (surface), API key id (api), the acting user id (cli) or eval suite id (eval). Null for mcp and test, and for an api run whose header predates key stamping. */
57464
+ /** @description The thing that started it: the schedule id (schedule), product surface id (surface), API key id (api), the acting user id (cli), eval suite id (eval) or simulation run id (simulation). Null for mcp and test, and for an api run whose header predates key stamping. */
56489
57465
  id: string | null;
56490
57466
  /**
56491
57467
  * @description One word for the way the run started.
56492
57468
  * @enum {string}
56493
57469
  */
56494
- kind: "schedule" | "surface" | "api" | "mcp" | "cli" | "test" | "eval";
57470
+ kind: "schedule" | "surface" | "api" | "mcp" | "cli" | "test" | "eval" | "simulation";
56495
57471
  /** @description Its display name when the API could resolve one: schedule name, surface name, API key name as it was at dispatch, MCP client name, the acting user's first name, or eval suite name. Null when unresolved, for example a deleted schedule. */
56496
57472
  label: string | null;
56497
57473
  } | null;
56498
57474
  };
57475
+ RunStats: {
57476
+ /** @description Runs grouped by agent id. */
57477
+ byAgentId: {
57478
+ [key: string]: {
57479
+ cost: {
57480
+ /** @description Sum of total cost over runs whose cost is known. Never includes an unknown cost as 0. */
57481
+ known: number;
57482
+ /** @description Settled runs with a known cost. */
57483
+ pricedRuns: number;
57484
+ /** @description Settled runs with no known cost, usually a model or tool with no price set. When this is above 0, `known` is a lower bound. */
57485
+ unpricedRuns: number;
57486
+ };
57487
+ /** @description Runs that read as failed in `/v1/runs` (the same predicate as `status=failed`). */
57488
+ failed: number;
57489
+ /** @description Start of the newest run in the bucket (ISO 8601). */
57490
+ lastStartedAt: string | null;
57491
+ /** @description Median duration of settled runs, or null when none settled. */
57492
+ p50DurationMs: number | null;
57493
+ /** @description 95th percentile duration of settled runs, or null when none settled. */
57494
+ p95DurationMs: number | null;
57495
+ /** @description Runs still running. */
57496
+ running: number;
57497
+ /** @description Runs in the bucket. */
57498
+ total: number;
57499
+ };
57500
+ };
57501
+ /** @description Runs grouped by agent and surface, keyed `<agentId>:<surfaceId>`. */
57502
+ byAgentSurface: {
57503
+ [key: string]: {
57504
+ cost: {
57505
+ /** @description Sum of total cost over runs whose cost is known. Never includes an unknown cost as 0. */
57506
+ known: number;
57507
+ /** @description Settled runs with a known cost. */
57508
+ pricedRuns: number;
57509
+ /** @description Settled runs with no known cost, usually a model or tool with no price set. When this is above 0, `known` is a lower bound. */
57510
+ unpricedRuns: number;
57511
+ };
57512
+ /** @description Runs that read as failed in `/v1/runs` (the same predicate as `status=failed`). */
57513
+ failed: number;
57514
+ /** @description Start of the newest run in the bucket (ISO 8601). */
57515
+ lastStartedAt: string | null;
57516
+ /** @description Median duration of settled runs, or null when none settled. */
57517
+ p50DurationMs: number | null;
57518
+ /** @description 95th percentile duration of settled runs, or null when none settled. */
57519
+ p95DurationMs: number | null;
57520
+ /** @description Runs still running. */
57521
+ running: number;
57522
+ /** @description Runs in the bucket. */
57523
+ total: number;
57524
+ };
57525
+ };
57526
+ /** @description Runs grouped by flow id. */
57527
+ byFlowId: {
57528
+ [key: string]: {
57529
+ cost: {
57530
+ /** @description Sum of total cost over runs whose cost is known. Never includes an unknown cost as 0. */
57531
+ known: number;
57532
+ /** @description Settled runs with a known cost. */
57533
+ pricedRuns: number;
57534
+ /** @description Settled runs with no known cost, usually a model or tool with no price set. When this is above 0, `known` is a lower bound. */
57535
+ unpricedRuns: number;
57536
+ };
57537
+ /** @description Runs that read as failed in `/v1/runs` (the same predicate as `status=failed`). */
57538
+ failed: number;
57539
+ /** @description Start of the newest run in the bucket (ISO 8601). */
57540
+ lastStartedAt: string | null;
57541
+ /** @description Median duration of settled runs, or null when none settled. */
57542
+ p50DurationMs: number | null;
57543
+ /** @description 95th percentile duration of settled runs, or null when none settled. */
57544
+ p95DurationMs: number | null;
57545
+ /** @description Runs still running. */
57546
+ running: number;
57547
+ /** @description Runs in the bucket. */
57548
+ total: number;
57549
+ };
57550
+ };
57551
+ /** @description Runs grouped by flow and surface, keyed `<flowId>:<surfaceId>`. */
57552
+ byFlowSurface: {
57553
+ [key: string]: {
57554
+ cost: {
57555
+ /** @description Sum of total cost over runs whose cost is known. Never includes an unknown cost as 0. */
57556
+ known: number;
57557
+ /** @description Settled runs with a known cost. */
57558
+ pricedRuns: number;
57559
+ /** @description Settled runs with no known cost, usually a model or tool with no price set. When this is above 0, `known` is a lower bound. */
57560
+ unpricedRuns: number;
57561
+ };
57562
+ /** @description Runs that read as failed in `/v1/runs` (the same predicate as `status=failed`). */
57563
+ failed: number;
57564
+ /** @description Start of the newest run in the bucket (ISO 8601). */
57565
+ lastStartedAt: string | null;
57566
+ /** @description Median duration of settled runs, or null when none settled. */
57567
+ p50DurationMs: number | null;
57568
+ /** @description 95th percentile duration of settled runs, or null when none settled. */
57569
+ p95DurationMs: number | null;
57570
+ /** @description Runs still running. */
57571
+ running: number;
57572
+ /** @description Runs in the bucket. */
57573
+ total: number;
57574
+ };
57575
+ };
57576
+ /** @description Runs grouped by surface id. */
57577
+ bySurfaceId: {
57578
+ [key: string]: {
57579
+ cost: {
57580
+ /** @description Sum of total cost over runs whose cost is known. Never includes an unknown cost as 0. */
57581
+ known: number;
57582
+ /** @description Settled runs with a known cost. */
57583
+ pricedRuns: number;
57584
+ /** @description Settled runs with no known cost, usually a model or tool with no price set. When this is above 0, `known` is a lower bound. */
57585
+ unpricedRuns: number;
57586
+ };
57587
+ /** @description Runs that read as failed in `/v1/runs` (the same predicate as `status=failed`). */
57588
+ failed: number;
57589
+ /** @description Start of the newest run in the bucket (ISO 8601). */
57590
+ lastStartedAt: string | null;
57591
+ /** @description Median duration of settled runs, or null when none settled. */
57592
+ p50DurationMs: number | null;
57593
+ /** @description 95th percentile duration of settled runs, or null when none settled. */
57594
+ p95DurationMs: number | null;
57595
+ /** @description Runs still running. */
57596
+ running: number;
57597
+ /** @description Runs in the bucket. */
57598
+ total: number;
57599
+ };
57600
+ };
57601
+ /** @description The same runs before the `traffic` filter, split by kind, so a live view can say "plus 4 test runs". */
57602
+ byTraffic: {
57603
+ eval: {
57604
+ /** @description Failed runs of this traffic kind in the window. */
57605
+ failed: number;
57606
+ /** @description Runs of this traffic kind in the window. */
57607
+ total: number;
57608
+ };
57609
+ live: {
57610
+ /** @description Failed runs of this traffic kind in the window. */
57611
+ failed: number;
57612
+ /** @description Runs of this traffic kind in the window. */
57613
+ total: number;
57614
+ };
57615
+ sim: {
57616
+ /** @description Failed runs of this traffic kind in the window. */
57617
+ failed: number;
57618
+ /** @description Runs of this traffic kind in the window. */
57619
+ total: number;
57620
+ };
57621
+ test: {
57622
+ /** @description Failed runs of this traffic kind in the window. */
57623
+ failed: number;
57624
+ /** @description Runs of this traffic kind in the window. */
57625
+ total: number;
57626
+ };
57627
+ };
57628
+ /** @description Every run the filters match, `traffic` included. */
57629
+ totals: {
57630
+ cost: {
57631
+ /** @description Sum of total cost over runs whose cost is known. Never includes an unknown cost as 0. */
57632
+ known: number;
57633
+ /** @description Settled runs with a known cost. */
57634
+ pricedRuns: number;
57635
+ /** @description Settled runs with no known cost, usually a model or tool with no price set. When this is above 0, `known` is a lower bound. */
57636
+ unpricedRuns: number;
57637
+ };
57638
+ /** @description Runs that read as failed in `/v1/runs` (the same predicate as `status=failed`). */
57639
+ failed: number;
57640
+ /** @description Start of the newest run in the bucket (ISO 8601). */
57641
+ lastStartedAt: string | null;
57642
+ /** @description Median duration of settled runs, or null when none settled. */
57643
+ p50DurationMs: number | null;
57644
+ /** @description 95th percentile duration of settled runs, or null when none settled. */
57645
+ p95DurationMs: number | null;
57646
+ /** @description Runs still running. */
57647
+ running: number;
57648
+ /** @description Runs in the bucket. */
57649
+ total: number;
57650
+ };
57651
+ };
57652
+ RunStoreUnavailableError: components["schemas"]["Error"] & {
57653
+ /** @enum {string} */
57654
+ code: "RUN_STORE_UNAVAILABLE";
57655
+ };
56499
57656
  RuntimeEmailAdmissionError: {
56500
57657
  code?: string;
56501
57658
  error: string;
@@ -56507,10 +57664,13 @@ interface components {
56507
57664
  };
56508
57665
  RuntimeExportWarning: {
56509
57666
  childId?: string;
56510
- /** @enum {string} */
56511
- childKind: "agent" | "flow";
56512
57667
  /**
56513
- * @description `child_dropped`: the child is absent from the artifact. `child_stubbed`: the artifact carries a stub the runtime cannot run.
57668
+ * @description What kind of child the warning is about. `question_set` names the question set id in `childId`.
57669
+ * @enum {string}
57670
+ */
57671
+ childKind: "agent" | "flow" | "question_set";
57672
+ /**
57673
+ * @description `child_dropped`: the child is absent from the artifact. `child_stubbed`: the artifact carries a stub the runtime cannot run, or a configured decision tool without its question set.
56514
57674
  * @enum {string}
56515
57675
  */
56516
57676
  code: "child_dropped" | "child_stubbed";
@@ -56518,10 +57678,10 @@ interface components {
56518
57678
  /** @description The agent whose capability referenced the child, when the child came from one. */
56519
57679
  parentId?: string;
56520
57680
  /**
56521
- * @description Why the export could not embed the child.
57681
+ * @description Why the export could not embed the child. `question_set_unresolved`: a configured `decision_judge` tool references a question set that is missing, unpublished, owned by another account, or pinned to a version that is not published; the tool stays in the artifact without `config.questionSet`, so a self-hosted runtime in own-key mode refuses its calls (platform and hybrid modes resolve it through Runtype).
56522
57682
  * @enum {string}
56523
57683
  */
56524
- reason: "not_found" | "claude_managed_unsupported" | "max_depth_exceeded" | "invalid_flow_config" | "unresolved_tool_ref" | "unsupported_mcp_auth";
57684
+ reason: "not_found" | "claude_managed_unsupported" | "max_depth_exceeded" | "invalid_flow_config" | "unresolved_tool_ref" | "unsupported_mcp_auth" | "question_set_unresolved";
56525
57685
  /** @description The capability or tool name that referenced the child. */
56526
57686
  toolName?: string;
56527
57687
  };
@@ -56568,6 +57728,49 @@ interface components {
56568
57728
  kind: string;
56569
57729
  reason: string;
56570
57730
  };
57731
+ RuntimeJudgmentMetadata: {
57732
+ calibrationId: string | null;
57733
+ /** @description Provider rates, before margin. */
57734
+ estimatedCostUsd?: number;
57735
+ /** @enum {string} */
57736
+ keySource: "user" | "platform";
57737
+ provider: string;
57738
+ questionSetId?: string;
57739
+ questionSetVersion?: number;
57740
+ requestedModel: string;
57741
+ resolvedModelId: string | null;
57742
+ route: string;
57743
+ usage: {
57744
+ inputTokens: number;
57745
+ outputTokens: number;
57746
+ reported: boolean;
57747
+ };
57748
+ };
57749
+ RuntimeJudgmentRequest: {
57750
+ /** @description The self-hosted execution asking, recorded on the judgment telemetry. */
57751
+ executionId?: string;
57752
+ /** @description Decision model id. In configured mode it outranks the question set version model. */
57753
+ model?: string;
57754
+ /** @description A question set owned by the caller; its published version supplies the questions. */
57755
+ questionSetId?: string;
57756
+ /** @description Ad hoc questions keyed by question id, each `{ type: "boolean" | "choice" | "score", instructions, criteria }`. Refused with `JUDGMENT_CONFIGURED_QUESTIONS_REJECTED` when `questionSetId` is set. */
57757
+ questions?: {
57758
+ [key: string]: unknown;
57759
+ };
57760
+ /** @description The text, JSON object or JSON array to judge. Never echoed in errors or logs. */
57761
+ state: string | {
57762
+ [key: string]: unknown;
57763
+ } | unknown[];
57764
+ /** @description Published question set version to use; omit for the current version. Without `questionSetId` the call is refused with 400 `JUDGMENT_VERSION_WITHOUT_QUESTION_SET`. */
57765
+ version?: number;
57766
+ };
57767
+ RuntimeJudgmentResponse: {
57768
+ /** @description One answer per question id, exactly as the decision model returned it. */
57769
+ answers: {
57770
+ [key: string]: unknown;
57771
+ };
57772
+ judgment: components["schemas"]["RuntimeJudgmentMetadata"];
57773
+ };
56571
57774
  ScheduleEnsureConflict: {
56572
57775
  /** @enum {string} */
56573
57776
  code: "external_modification" | "remote_changed";
@@ -58921,8 +60124,24 @@ export interface ModelConfig {
58921
60124
  requiresIntegration?: string;
58922
60125
  apiKey?: string;
58923
60126
  scope?: 'personal' | 'organization';
60127
+ /**
60128
+ * `organization_connection` marks a model declared by an organization custom inference endpoint with
60129
+ * no stored configuration for the caller: runnable, but its `id` cannot be updated, toggled, or deleted.
60130
+ */
60131
+ configScope?: 'personal' | 'organization' | 'organization_connection';
58924
60132
  organizationId?: string;
58925
60133
  }
60134
+ /** Which providers may serve a model call for the account, and under whose credential. */
60135
+ export interface ModelCredentialPolicy {
60136
+ /** `byok_only`: only models from `byokProviders` run. */
60137
+ mode: 'byok_only' | 'mixed' | 'platform';
60138
+ /** Providers served by the account's own credentials; `generic-openai` is its custom inference endpoint. */
60139
+ byokProviders: string[];
60140
+ platformProviders: string[];
60141
+ /** Providers an organization policy refuses until a credential is connected. */
60142
+ blockedProviders: string[];
60143
+ summary: string;
60144
+ }
58926
60145
  export type UserProfile = paths['/v1/users/profile']['get']['responses'][200]['content']['application/json'];
58927
60146
  type CreateFlowRequestBody = NonNullable<paths['/v1/flows']['post']['requestBody']>['content']['application/json'];
58928
60147
  type UpdateFlowRequestBody = NonNullable<paths['/v1/flows/{id}']['put']['requestBody']>['content']['application/json'];
@@ -59100,7 +60319,8 @@ export type SelectOrganizationProviderCredentialRequest = NonNullable<paths['/v1
59100
60319
  export type SelectOrganizationProviderCredentialResponse = paths['/v1/provider-keys/organization-policy']['put']['responses'][200]['content']['application/json'];
59101
60320
  export interface CreateApiKeyRequest {
59102
60321
  name: string;
59103
- permissions?: string[];
60322
+ /** Required, at least one scope; the API has no default. `apiKeys.getPermissionOptions()` lists them. */
60323
+ permissions: string[];
59104
60324
  expiresAt?: string;
59105
60325
  allowedIps?: string[];
59106
60326
  environment?: 'test' | 'production';
@@ -60063,21 +61283,8 @@ export interface AgentVersionPublishResponse {
60063
61283
  export interface VersionPublishOptions {
60064
61284
  onConflict?: 'error' | 'overwrite';
60065
61285
  }
60066
- export interface FlowVersionListItem {
60067
- id: string;
60068
- versionNumber: number;
60069
- versionType: string;
60070
- label: string | null;
60071
- notes: string | null;
60072
- stepSummary: string | null;
60073
- stepCount: number;
60074
- createdAt: string;
60075
- }
60076
- export interface FlowVersionsListResponse {
60077
- flowId: string;
60078
- publishedVersionId: string | null;
60079
- versions: FlowVersionListItem[];
60080
- }
61286
+ export type FlowVersionsListResponse = paths['/v1/flow-versions/{flowId}']['get']['responses'][200]['content']['application/json'];
61287
+ export type FlowVersionListItem = FlowVersionsListResponse['versions'][number];
60081
61288
  export type FlowVersionDetail = paths['/v1/flow-versions/{flowId}/{versionId}']['get']['responses'][200]['content']['application/json'];
60082
61289
  export interface FlowVersionPublishResponse {
60083
61290
  success: boolean;
@@ -63823,6 +65030,7 @@ interface RunListRow {
63823
65030
  kind: 'agent' | 'flow';
63824
65031
  agentId: string | null;
63825
65032
  flowId: string | null;
65033
+ flowVersionId?: string | null;
63826
65034
  conversationId: string | null;
63827
65035
  surfaceId: string | null;
63828
65036
  surfaceType: string | null;
@@ -64402,9 +65610,13 @@ interface EnsureFpoOptions {
64402
65610
  */
64403
65611
  release?: 'none' | 'publish';
64404
65612
  }
65613
+ type GeneratedFpoEnsureResponse = Extract<components['schemas']['ProductFpoEnsureResponse'], {
65614
+ entities: unknown;
65615
+ }>;
65616
+ type GeneratedFpoEntityOutcome = GeneratedFpoEnsureResponse['entities'][number];
64405
65617
  /** One nested entity's converge result. */
64406
65618
  interface FpoEntityOutcome {
64407
- kind: 'product' | 'flow' | 'agent' | 'capability' | 'tool' | 'surface' | 'record' | 'schedule' | 'eval' | 'skill';
65619
+ kind: GeneratedFpoEntityOutcome['kind'];
64408
65620
  ref: string;
64409
65621
  name: string;
64410
65622
  result: 'created' | 'updated' | 'unchanged' | 'failed' | 'skipped' | 'pruned';
@@ -65665,7 +66877,7 @@ interface PromoteAgentResult {
65665
66877
  */
65666
66878
  export declare function promoteAgent(input: PromoteAgentInput): Promise<PromoteAgentResult>;
65667
66879
  //#endregion
65668
- //#region ../shared/dist/models-wYIgT_ZG.d.ts
66880
+ //#region ../shared/dist/models-BFb-uNHy.d.ts
65669
66881
  //#region src/generated-evaluation-models.d.ts
65670
66882
  /**
65671
66883
  * Per-token USD exactly as the gateway listed it, plus the per-million figures
@@ -66873,7 +68085,7 @@ export declare class ModelConfigsEndpoint {
66873
68085
  private client;
66874
68086
  constructor(client: ApiClient);
66875
68087
  /**
66876
- * Get available models catalog
68088
+ * Get the available models catalog, followed by the account's custom models (`uiCategory: 'custom'`)
66877
68089
  */
66878
68090
  getAvailable(): Promise<ModelConfig[]>;
66879
68091
  /**
@@ -66885,9 +68097,15 @@ export declare class ModelConfigsEndpoint {
66885
68097
  */
66886
68098
  getSearchConfigured(): Promise<ModelConfig[]>;
66887
68099
  /**
66888
- * List user's model configurations
68100
+ * List every model the account can run: its model configurations plus the models its organization's
68101
+ * custom inference endpoints declare (`configScope: 'organization_connection'`)
66889
68102
  */
66890
68103
  list(): Promise<ModelConfig[]>;
68104
+ /**
68105
+ * Get which providers may serve a model call for the account. When `mode` is `byok_only`,
68106
+ * only models from `byokProviders` run.
68107
+ */
68108
+ getCredentialPolicy(): Promise<ModelCredentialPolicy | undefined>;
66891
68109
  /**
66892
68110
  * Create a new model configuration
66893
68111
  */