@runtypelabs/sdk 10.1.2 → 10.2.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.cjs CHANGED
@@ -13854,7 +13854,10 @@ var Runtype = class {
13854
13854
  }
13855
13855
  /**
13856
13856
  * Runs namespace - the one list of agent and flow runs, read from the span
13857
- * store. Includes runs dispatched with `storeResults: false` as `test: true`.
13857
+ * store. Each row states two separate facts: `origin` (who dispatched, from
13858
+ * the caller's principal; `test` is its deprecated alias) and `storeResults`
13859
+ * (whether the transcript was kept). A run that wrote no control-plane row
13860
+ * is still listed.
13858
13861
  *
13859
13862
  * @example
13860
13863
  * ```typescript
@@ -14146,7 +14149,7 @@ function transformQueryParams(params) {
14146
14149
 
14147
14150
  // src/version.ts
14148
14151
  var FALLBACK_VERSION = "0.0.0";
14149
- var SDK_VERSION = "10.1.2".length > 0 ? "10.1.2" : FALLBACK_VERSION;
14152
+ var SDK_VERSION = "10.2.0".length > 0 ? "10.2.0" : FALLBACK_VERSION;
14150
14153
  var RUNTYPE_CLIENT_KIND = "sdk";
14151
14154
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
14152
14155
 
package/dist/index.d.cts CHANGED
@@ -8682,7 +8682,7 @@ interface paths {
8682
8682
  };
8683
8683
  };
8684
8684
  };
8685
- /** @description Forbidden. Either the client token is inactive or the origin is not allowed, or the tenancy lock-down refused the execution: the agent requires an end-user scope and no valid `identityProof` was supplied (`end_user_scope_required`), or this session's conversation record belongs to a different signed-in end user (`conversation_scope_mismatch`; start a new conversation). */
8685
+ /** @description Forbidden. Either the client token is inactive or the origin is not allowed, or the tenancy lock-down refused the execution: the agent requires an end-user scope and no valid `identityProof` was supplied (`end_user_scope_required`), or this session's conversation record belongs to a different signed-in end user (`conversation_scope_mismatch`; start a new conversation), or a Claude Managed target's conversation is not owned by the visitor making the request (`CLIENT_CONVERSATION_NOT_VISITOR_OWNED`; initialize with `durableRecovery: true` and send `X-Visitor-Token`). */
8686
8686
  403: {
8687
8687
  headers: {
8688
8688
  [name: string]: unknown;
@@ -8700,7 +8700,7 @@ interface paths {
8700
8700
  "application/json": components["schemas"]["Error"];
8701
8701
  };
8702
8702
  };
8703
- /** @description Conflict. Either the client tools registry fingerprint was not found (`client_tools_resend_required`; resend the full `clientTools[]` with the fingerprint), or this turn was superseded by a newer interrupting turn before it could start (`turn_superseded`). The body carries `error` alone. */
8703
+ /** @description Conflict. Either the client tools registry fingerprint was not found (`client_tools_resend_required`; resend the full `clientTools[]` with the fingerprint), this turn was superseded by a newer interrupting turn before it could start (`turn_superseded`), or a Claude Managed target was refused because the caller has not opted into durable turns (`CLAUDE_MANAGED_DURABLE_TURNS_REQUIRED`; `hint` names the exact opt-in) or the session carries no conversation record (`CLAUDE_MANAGED_CONVERSATION_REQUIRED`). A join refusal uses `JOIN_UNAVAILABLE`. */
8704
8704
  409: {
8705
8705
  headers: {
8706
8706
  [name: string]: unknown;
@@ -8977,8 +8977,8 @@ interface paths {
8977
8977
  get?: never;
8978
8978
  put?: never;
8979
8979
  /**
8980
- * Stop a native durable client execution
8981
- * @description Cancel the specified execution without starting a replacement. Pending inputs become not applied. Requires the exact visitor and session bound to the conversation.
8980
+ * Stop a durable client execution
8981
+ * @description Cancel the specified execution without starting a replacement. For a native agent, pending inputs become not applied; for a Claude Managed agent, the hosted session is interrupted and stays resumable. Requires the exact visitor and session bound to the conversation.
8982
8982
  */
8983
8983
  post: {
8984
8984
  parameters: {
@@ -9047,6 +9047,7 @@ interface paths {
9047
9047
  "application/json": {
9048
9048
  accepted: boolean;
9049
9049
  executionId: string;
9050
+ reason?: string;
9050
9051
  };
9051
9052
  };
9052
9053
  };
@@ -9736,7 +9737,7 @@ interface paths {
9736
9737
  conversationRevision: string;
9737
9738
  /** @description Returned when the request negotiates `durableRecovery`. Older servers omit it; clients must then keep ordinary streaming behavior. */
9738
9739
  durableRecovery?: {
9739
- /** @description Whether this initialized client-token session has the visitor credential and surface policy needed to use the durable execution reconnect route. Reporting only: individual turns still self-identify as durable through replay cursors. */
9740
+ /** @description Whether this initialized client-token session has the visitor credential and the durable-turns opt-in needed to use the durable execution reconnect route. The opt-in is the chat surface `behavior.durableTurns.enabled` for a surface-bound token and `config.durableTurns.enabled` for a standalone token. Reporting only: individual turns still self-identify as durable through replay cursors. */
9740
9741
  enabled: boolean;
9741
9742
  /** @description Whether the native durable target supports non-interrupting user-message delivery. */
9742
9743
  join?: boolean;
@@ -25156,7 +25157,7 @@ interface paths {
25156
25157
  };
25157
25158
  /**
25158
25159
  * Query customer logs
25159
- * @description Query persisted customer logs via R2 SQL with filtering, pagination, and search.
25160
+ * @description Query persisted customer logs with filtering, pagination, and search. When `data.live` is present the page came from the span store: one entry is one execution seam, so sub-seam rows (step skips, sources, context notices, artifacts, state snapshots, custom events) are not listed, a start/complete pair is one row carrying a duration, runs still in progress appear once they finish, and `search` matches a span's message, name, operation, tool name or error class. Otherwise each entry is one event. Requests naming `audit` or `schedule`, and an audit-entitled unfiltered read, are always served from the event tier.
25160
25161
  */
25161
25162
  get: {
25162
25163
  parameters: {
@@ -25169,9 +25170,9 @@ interface paths {
25169
25170
  startTime?: string;
25170
25171
  /** @description Alias for to. Ignored when to is also given. */
25171
25172
  endTime?: string;
25172
- /** @description Comma-separated log levels (debug,info,warn,error) */
25173
+ /** @description Comma-separated log levels (debug,info,warn,error). An unknown value is rejected with 400. */
25173
25174
  level?: string;
25174
- /** @description Comma-separated categories */
25175
+ /** @description Comma-separated categories (execution,agent,tool,model,system,error,schedule,batch,audit). An unknown value is rejected with 400. */
25175
25176
  category?: string;
25176
25177
  /** @description Filter by flow ID */
25177
25178
  flowId?: string;
@@ -25206,13 +25207,25 @@ interface paths {
25206
25207
  content: {
25207
25208
  "application/json": {
25208
25209
  data: {
25210
+ /** @description True when the historical segment was served by the flat fallback plan because the deduplicating one was rejected, so a re-sent delivery can appear more than once. Absent on healthy responses. */
25211
+ dedupeFallback?: boolean;
25209
25212
  /** @description True when part of the window could not be read, so entries may be missing. Evicted ordinary rows are recovered from R2 when old enough; receipt-backed recovery remains degraded when source time cannot prove ingestion. Absent on healthy responses. */
25210
25213
  degraded?: boolean;
25211
25214
  entries: {
25212
25215
  [key: string]: unknown;
25213
25216
  }[];
25217
+ /** @description Present only when the page was served from the span store. Runs still in progress appear once they finish; the minutes above the cut-line come from the live tier when it answers in time. Absent otherwise. */
25218
+ live?: {
25219
+ /** @description Entries at or below this instant came from the span store; newer ones from the live tier. */
25220
+ cutline: string;
25221
+ /** @enum {string} */
25222
+ reason?: "hot_tier_failed" | "outside_window";
25223
+ served: boolean;
25224
+ };
25214
25225
  pagination: {
25215
25226
  cursor: string | null;
25227
+ /** @description True when the supplied cursor could not be honoured and the read restarted at page one. A paging client must stop rather than follow the fresh cursor. Absent otherwise. */
25228
+ cursorReset?: boolean;
25216
25229
  hasMore: boolean;
25217
25230
  };
25218
25231
  };
@@ -25346,15 +25359,19 @@ interface paths {
25346
25359
  };
25347
25360
  /**
25348
25361
  * Read one log entry in full
25349
- * @description Returns a single log entry addressed by its execution and timestamp, including the model-call transcript the paged list projection omits. Bounded to one millisecond of one execution, so a detail read never costs a page.
25362
+ * @description Returns a single log entry, including the model-call transcript the paged list projection omits. Address it either by the span key (traceId, spanId and timestamp) or by the legacy triple (executionId and timestamp, optionally narrowed by requestId, seq or eventName). Bounded to one millisecond of one execution, so a detail read never costs a page.
25350
25363
  */
25351
25364
  get: {
25352
25365
  parameters: {
25353
25366
  query: {
25354
- /** @description Runtime execution_id / executionSessionId the entry belongs to */
25355
- executionId: string;
25367
+ /** @description Runtime execution_id / executionSessionId the entry belongs to. Required unless traceId and spanId are given. */
25368
+ executionId?: string;
25356
25369
  /** @description The entry's exact timestamp (ISO 8601) */
25357
25370
  timestamp: string;
25371
+ /** @description Trace the span belongs to. Required with spanId; a span id is unique only within its trace. */
25372
+ traceId?: string;
25373
+ /** @description Span to read, from a list row’s otlpSpanId. Requires traceId. */
25374
+ spanId?: string;
25358
25375
  /** @description Narrow to one request */
25359
25376
  requestId?: string;
25360
25377
  /** @description Narrow to one sequence number */
@@ -25443,9 +25460,9 @@ interface paths {
25443
25460
  startTime?: string;
25444
25461
  /** @description Alias for to. Ignored when to is also given. */
25445
25462
  endTime?: string;
25446
- /** @description Comma-separated log levels (debug,info,warn,error) */
25463
+ /** @description Comma-separated log levels (debug,info,warn,error). An unknown value is rejected with 400. */
25447
25464
  level?: string;
25448
- /** @description Comma-separated categories */
25465
+ /** @description Comma-separated categories (execution,agent,tool,model,system,error,schedule,batch,audit). An unknown value is rejected with 400. */
25449
25466
  category?: string;
25450
25467
  /** @description Filter by flow ID */
25451
25468
  flowId?: string;
@@ -25494,6 +25511,8 @@ interface paths {
25494
25511
  byType: {
25495
25512
  [key: string]: number;
25496
25513
  };
25514
+ /** @description True when counts came from the flat fallback plan because the deduplicating one was rejected, so a re-sent delivery can be counted more than once. Such a response is never cached. Absent on healthy responses. */
25515
+ dedupeFallback?: boolean;
25497
25516
  /** @description True when part of the window could not be read, so counts may be partial. Evicted ordinary rows are counted from R2 when old enough; receipt-backed recovery remains degraded when source time cannot prove ingestion. Absent on healthy responses, which are the only ones cached. */
25498
25517
  degraded?: boolean;
25499
25518
  histogram: {
@@ -30801,6 +30820,8 @@ interface paths {
30801
30820
  budgetExhausted?: boolean | null;
30802
30821
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
30803
30822
  cancelRequestedAt?: string | null;
30823
+ /** @description How many runs name this one as their parent. The unscoped feed returns roots only, so this is the size of the fold underneath a row; read the children with parentExecutionId=<executionId>. It is populated on a resource-scoped page too, where nothing is folded, so a surface can still offer the same expansion. WHICH children are counted depends on the arm that served the row: the span store counts every child, agent and nested-flow alike, while the legacy control-plane fallback counts agent children only, so on that arm a parent whose only child is a nested flow reports 0. That is deliberate — the fallback arm cannot enumerate a nested-flow child either, so counting one would advertise a fold that opens on nothing. It counts only children the CALLER may read: a credential holding one execution family (AGENTS:READ or FLOWS:READ alone) counts the children of that family and no others, so a count never discloses a run the same credential could not list. NULL means the arm cannot count children at all, which is not zero. */
30824
+ childCount: number | null;
30804
30825
  /**
30805
30826
  * @description Storage completeness; null on a row the control-plane arm served.
30806
30827
  * @enum {string|null}
@@ -30820,9 +30841,11 @@ interface paths {
30820
30841
  fidelityTier: string | null;
30821
30842
  /** @description Flow that ran. */
30822
30843
  flowId: string | null;
30844
+ /** @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. */
30845
+ inlineDefinition: boolean | null;
30823
30846
  /** @description Messages the run started from. Absent means the overlay did not answer, which is not false and not null. */
30824
30847
  inputMessages?: unknown;
30825
- /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false test run) has none. */
30848
+ /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false run) has none. */
30826
30849
  inputPreview?: string | null;
30827
30850
  /** @description Input tokens reported. */
30828
30851
  inputTokens: number | null;
@@ -30835,6 +30858,11 @@ interface paths {
30835
30858
  kind: "agent" | "flow";
30836
30859
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
30837
30860
  lastHeartbeatAt?: string | null;
30861
+ /**
30862
+ * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field. ANY entrance that resolves a principal stamps it: a Clerk session answers dashboard; a management API key answers api, which includes the Runtype MCP server's tools and Code Mode, since both reach dispatch with a management key; and Runtype's own internal caller answers internal, for example the hosted /v1/mcp proxy. A lane that resolves NO principal carries NULL BY DESIGN: schedule, webhook, messaging, A2A, an agent exposed AS an MCP surface, subagent, nested flow, a client-token product surface (an end user is none of the three origins) and an ingested OTLP run. So NULL says "no authenticated principal at this entrance" rather than "unknown caller". The one NULL that is not a statement about the lane is a row whose header predates the field or came from the backfill: it stamps nothing even for a run that did resolve a principal.
30863
+ * @enum {string|null}
30864
+ */
30865
+ origin: "dashboard" | "api" | "internal" | null;
30838
30866
  /** @description Framework identity the producer reported, for a versionless run group. Absent means the overlay did not answer, which is not false and not null. */
30839
30867
  otelProducer?: unknown;
30840
30868
  /** @description Output tokens reported. */
@@ -30871,11 +30899,16 @@ interface paths {
30871
30899
  status: "queued" | "running" | "awaiting" | "completed" | "failed" | "cancelled";
30872
30900
  /** @description Stop reason from the terminal frame. */
30873
30901
  stopReason?: string | null;
30902
+ /** @description The persistence posture the dispatch declared. FALSE means the run wrote no control-plane row, no journal outputs and no span content, so a surface that reports a missing transcript keys on this and never on origin. NULL means the header states nothing, which is not "true": a lane that takes no such flag carries no stamp, and an ingested (OTLP) run declared none. A row served from the legacy control-plane lane answers true, because that row exists only when the run stored. */
30903
+ storeResults: boolean | null;
30874
30904
  /** @description Product surface that entered this run. */
30875
30905
  surfaceId: string | null;
30876
30906
  /** @description Surface family (api, chat, webhook, schedule, ...). */
30877
30907
  surfaceType: string | null;
30878
- /** @description True when the run was dispatched with storeResults: false, so it has no control-plane row and no overlay. NULL means the header states nothing about it, which is not false: headers written before this field shipped, and lanes that take no such flag, carry no dispatch stamp and are never backfilled. */
30908
+ /**
30909
+ * @deprecated
30910
+ * @description DEPRECATED: a derived alias of origin, kept for one release — read origin instead. True when the run came from the dashboard, i.e. origin === "dashboard"; NULL exactly when origin is NULL. It is never derived from storeResults, which defaults to false across the whole flow lane and which an API caller sets for its own privacy reasons: reading it as "test" labelled production runs as tests. A run whose header predates origin therefore reads NULL rather than claiming either answer.
30911
+ */
30879
30912
  test: boolean | null;
30880
30913
  /** @description Metered cost as a decimal string. */
30881
30914
  totalCost: string | null;
@@ -40043,7 +40076,7 @@ interface paths {
40043
40076
  };
40044
40077
  /**
40045
40078
  * List runs
40046
- * @description Every agent and flow run in the span store, newest start first. A run dispatched with `storeResults: false` is listed with `test: true` rather than being invisible. `overlay=live` adds live control-plane fields; the overlay never adds, drops or reorders a row. Returns 404 with `code: "run_history_unavailable"` when neither plane can serve the page, which a client renders as "no run history here" rather than as a failed read.
40079
+ * @description Every agent and flow run in the span store, newest start first, including runs that write no control-plane row. The UNSCOPED feed is ROOT runs only: a subagent or nested-flow run folds under its parent, `childCount` says how many are folded there, and `parentExecutionId=<id>` reads them. Pass `includeChildren=true` for the flat enumeration. Any resource-scoped filter (`agentId`, `flowId`, `conversationId`, `surfaceId`, `recordId`, `batchExecutionId`, `parentExecutionId`, `rootExecutionId`, `executionId`) is already an explicit selection and never folds, so an agent that only ever runs as a subagent still lists under `agentId`. Each row carries `origin` (dashboard | api | internal | null), read from the caller's authenticated principal, and `test` as its derived alias for `origin === "dashboard"`; any entrance that resolves a principal stamps origin, including the Runtype MCP server tools and Code Mode (`api`) and the hosted `/v1/mcp` proxy (`internal`). A lane with no principal answers null for both by design: schedule, webhook, messaging, A2A, an agent exposed as an MCP surface, subagent, nested flow, a client-token product surface, an ingested run, and any row whose header predates the field. `overlay=live` adds live control-plane fields; the overlay never adds, drops or reorders a row. Returns 404 with `code: "run_history_unavailable"` when neither plane can serve the page, which a client renders as "no run history here" rather than as a failed read.
40047
40080
  */
40048
40081
  get: {
40049
40082
  parameters: {
@@ -40066,6 +40099,8 @@ interface paths {
40066
40099
  parentExecutionId?: string;
40067
40100
  /** @description Runs in this execution tree. */
40068
40101
  rootExecutionId?: string;
40102
+ /** @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. */
40103
+ includeChildren?: "true" | "false";
40069
40104
  /** @description Read specific runs by id; at most 100 per request. */
40070
40105
  executionId?: string | string[];
40071
40106
  /** @description Filter by producing lane. */
@@ -50939,6 +50974,8 @@ interface components {
50939
50974
  budgetExhausted?: boolean | null;
50940
50975
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
50941
50976
  cancelRequestedAt?: string | null;
50977
+ /** @description How many runs name this one as their parent. The unscoped feed returns roots only, so this is the size of the fold underneath a row; read the children with parentExecutionId=<executionId>. It is populated on a resource-scoped page too, where nothing is folded, so a surface can still offer the same expansion. WHICH children are counted depends on the arm that served the row: the span store counts every child, agent and nested-flow alike, while the legacy control-plane fallback counts agent children only, so on that arm a parent whose only child is a nested flow reports 0. That is deliberate — the fallback arm cannot enumerate a nested-flow child either, so counting one would advertise a fold that opens on nothing. It counts only children the CALLER may read: a credential holding one execution family (AGENTS:READ or FLOWS:READ alone) counts the children of that family and no others, so a count never discloses a run the same credential could not list. NULL means the arm cannot count children at all, which is not zero. */
50978
+ childCount: number | null;
50942
50979
  /**
50943
50980
  * @description Storage completeness; null on a row the control-plane arm served.
50944
50981
  * @enum {string|null}
@@ -50958,9 +50995,11 @@ interface components {
50958
50995
  fidelityTier: string | null;
50959
50996
  /** @description Flow that ran. */
50960
50997
  flowId: string | null;
50998
+ /** @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. */
50999
+ inlineDefinition: boolean | null;
50961
51000
  /** @description Messages the run started from. Absent means the overlay did not answer, which is not false and not null. */
50962
51001
  inputMessages?: unknown;
50963
- /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false test run) has none. */
51002
+ /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false run) has none. */
50964
51003
  inputPreview?: string | null;
50965
51004
  /** @description Input tokens reported. */
50966
51005
  inputTokens: number | null;
@@ -50973,6 +51012,11 @@ interface components {
50973
51012
  kind: "agent" | "flow";
50974
51013
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
50975
51014
  lastHeartbeatAt?: string | null;
51015
+ /**
51016
+ * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field. ANY entrance that resolves a principal stamps it: a Clerk session answers dashboard; a management API key answers api, which includes the Runtype MCP server's tools and Code Mode, since both reach dispatch with a management key; and Runtype's own internal caller answers internal, for example the hosted /v1/mcp proxy. A lane that resolves NO principal carries NULL BY DESIGN: schedule, webhook, messaging, A2A, an agent exposed AS an MCP surface, subagent, nested flow, a client-token product surface (an end user is none of the three origins) and an ingested OTLP run. So NULL says "no authenticated principal at this entrance" rather than "unknown caller". The one NULL that is not a statement about the lane is a row whose header predates the field or came from the backfill: it stamps nothing even for a run that did resolve a principal.
51017
+ * @enum {string|null}
51018
+ */
51019
+ origin: "dashboard" | "api" | "internal" | null;
50976
51020
  /** @description Framework identity the producer reported, for a versionless run group. Absent means the overlay did not answer, which is not false and not null. */
50977
51021
  otelProducer?: unknown;
50978
51022
  /** @description Output tokens reported. */
@@ -51009,11 +51053,16 @@ interface components {
51009
51053
  status: "queued" | "running" | "awaiting" | "completed" | "failed" | "cancelled";
51010
51054
  /** @description Stop reason from the terminal frame. */
51011
51055
  stopReason?: string | null;
51056
+ /** @description The persistence posture the dispatch declared. FALSE means the run wrote no control-plane row, no journal outputs and no span content, so a surface that reports a missing transcript keys on this and never on origin. NULL means the header states nothing, which is not "true": a lane that takes no such flag carries no stamp, and an ingested (OTLP) run declared none. A row served from the legacy control-plane lane answers true, because that row exists only when the run stored. */
51057
+ storeResults: boolean | null;
51012
51058
  /** @description Product surface that entered this run. */
51013
51059
  surfaceId: string | null;
51014
51060
  /** @description Surface family (api, chat, webhook, schedule, ...). */
51015
51061
  surfaceType: string | null;
51016
- /** @description True when the run was dispatched with storeResults: false, so it has no control-plane row and no overlay. NULL means the header states nothing about it, which is not false: headers written before this field shipped, and lanes that take no such flag, carry no dispatch stamp and are never backfilled. */
51062
+ /**
51063
+ * @deprecated
51064
+ * @description DEPRECATED: a derived alias of origin, kept for one release — read origin instead. True when the run came from the dashboard, i.e. origin === "dashboard"; NULL exactly when origin is NULL. It is never derived from storeResults, which defaults to false across the whole flow lane and which an API caller sets for its own privacy reasons: reading it as "test" labelled production runs as tests. A run whose header predates origin therefore reads NULL rather than claiming either answer.
51065
+ */
51017
51066
  test: boolean | null;
51018
51067
  /** @description Metered cost as a decimal string. */
51019
51068
  totalCost: string | null;
@@ -57899,6 +57948,18 @@ interface RunListRow {
57899
57948
  parentExecutionId: string | null;
57900
57949
  parentToolCallId: string | null;
57901
57950
  rootExecutionId: string | null;
57951
+ /**
57952
+ * How many runs name this one as their parent. The unscoped feed returns
57953
+ * roots only, so this is the size of the fold underneath a row; read the
57954
+ * children with `parentExecutionId`. It is populated on a resource-scoped
57955
+ * page too. The span store counts agent and nested-flow children alike; the
57956
+ * legacy control-plane fallback counts agent children only, so a
57957
+ * nested-flow-only parent reports 0 there — that arm cannot enumerate such a
57958
+ * child either. It counts only children the caller may read, so a
57959
+ * single-family credential never learns the other family's children exist.
57960
+ * NULL when the serving arm cannot count at all.
57961
+ */
57962
+ childCount: number | null;
57902
57963
  source: 'hosted' | 'ingested';
57903
57964
  fidelityTier: string | null;
57904
57965
  completeness: 'partial' | 'complete' | 'conflicted' | 'expired' | 'deleted' | null;
@@ -57909,9 +57970,30 @@ interface RunListRow {
57909
57970
  totalCost: string | null;
57910
57971
  selfReportedCost: string | null;
57911
57972
  /**
57912
- * True when the run was dispatched with `storeResults: false`, such as an
57913
- * editor test. NULL means the header states nothing about it, which is not
57914
- * `false`: headers written before the field shipped carry no dispatch stamp.
57973
+ * Where the run was dispatched from, taken from the caller's authenticated
57974
+ * principal and never from a request field. Any entrance that resolves a
57975
+ * principal stamps it (MCP tools and Code Mode answer `api`, the hosted
57976
+ * `/v1/mcp` proxy `internal`); a lane with none carries NULL by design.
57977
+ */
57978
+ origin: 'dashboard' | 'api' | 'internal' | null;
57979
+ /**
57980
+ * The persistence posture the dispatch declared. `false` means the run kept no
57981
+ * control-plane row, no journal outputs and no span content, so a surface
57982
+ * reporting a missing transcript reads this and never `origin`.
57983
+ */
57984
+ storeResults: boolean | null;
57985
+ /**
57986
+ * True when the dispatch carried a complete inline definition, so the run
57987
+ * executed that config and stamps no `agentVersionId`. False for a run of the
57988
+ * saved definition by reference. NULL when the header states nothing.
57989
+ */
57990
+ inlineDefinition: boolean | null;
57991
+ /**
57992
+ * True when the run came from the dashboard (`origin === 'dashboard'`), such
57993
+ * as an editor test.
57994
+ * @deprecated Derived alias of `origin`; read `origin` instead. Kept for one
57995
+ * release. NULL exactly when `origin` is NULL, including on a run whose header
57996
+ * predates the field.
57915
57997
  */
57916
57998
  test: boolean | null;
57917
57999
  stopReason?: string | null;
@@ -57948,6 +58030,13 @@ interface RunListParams {
57948
58030
  parentExecutionId?: string;
57949
58031
  rootExecutionId?: string;
57950
58032
  executionId?: string | string[];
58033
+ /**
58034
+ * `'true'` restores the flat enumeration on the unscoped feed, which is roots
58035
+ * only by default: a subagent or nested-flow run folds under its parent. Any
58036
+ * resource-scoped filter is already an explicit selection and never folds, so
58037
+ * this changes nothing there.
58038
+ */
58039
+ includeChildren?: 'true' | 'false';
57951
58040
  source?: 'hosted' | 'ingested';
57952
58041
  /**
57953
58042
  * `running`, `completed` or `failed` only. `queued`, `awaiting` and
@@ -57976,8 +58065,8 @@ interface RunListResponse {
57976
58065
  }
57977
58066
  /**
57978
58067
  * Read-only namespace over `/v1/runs`, the one list of agent and flow runs.
57979
- * A run dispatched with `storeResults: false` is listed with `test: true`
57980
- * rather than being absent.
58068
+ * A dashboard editor test is listed with `origin: 'dashboard'` (and its `test`
58069
+ * alias) rather than being absent.
57981
58070
  */
57982
58071
  declare class RunsNamespace {
57983
58072
  private readonly getClient;
@@ -58948,7 +59037,10 @@ declare class Runtype {
58948
59037
  static get executions(): ExecutionsNamespace;
58949
59038
  /**
58950
59039
  * Runs namespace - the one list of agent and flow runs, read from the span
58951
- * store. Includes runs dispatched with `storeResults: false` as `test: true`.
59040
+ * store. Each row states two separate facts: `origin` (who dispatched, from
59041
+ * the caller's principal; `test` is its deprecated alias) and `storeResults`
59042
+ * (whether the transcript was kept). A run that wrote no control-plane row
59043
+ * is still listed.
58952
59044
  *
58953
59045
  * @example
58954
59046
  * ```typescript
@@ -59379,6 +59471,14 @@ interface ClientTokenConfig {
59379
59471
  theme?: ClientWidgetTheme;
59380
59472
  /** Custom data passed to flows */
59381
59473
  customData?: Record<string, unknown>;
59474
+ /**
59475
+ * Durable-turn opt-in for a token with no product surface. A surface-bound
59476
+ * token reads the surface's `behavior.durableTurns` instead and ignores this.
59477
+ */
59478
+ durableTurns?: {
59479
+ /** Defaults to false when absent. */
59480
+ enabled?: boolean;
59481
+ };
59382
59482
  }
59383
59483
  /**
59384
59484
  * Client token data returned from the API
package/dist/index.d.ts CHANGED
@@ -8682,7 +8682,7 @@ interface paths {
8682
8682
  };
8683
8683
  };
8684
8684
  };
8685
- /** @description Forbidden. Either the client token is inactive or the origin is not allowed, or the tenancy lock-down refused the execution: the agent requires an end-user scope and no valid `identityProof` was supplied (`end_user_scope_required`), or this session's conversation record belongs to a different signed-in end user (`conversation_scope_mismatch`; start a new conversation). */
8685
+ /** @description Forbidden. Either the client token is inactive or the origin is not allowed, or the tenancy lock-down refused the execution: the agent requires an end-user scope and no valid `identityProof` was supplied (`end_user_scope_required`), or this session's conversation record belongs to a different signed-in end user (`conversation_scope_mismatch`; start a new conversation), or a Claude Managed target's conversation is not owned by the visitor making the request (`CLIENT_CONVERSATION_NOT_VISITOR_OWNED`; initialize with `durableRecovery: true` and send `X-Visitor-Token`). */
8686
8686
  403: {
8687
8687
  headers: {
8688
8688
  [name: string]: unknown;
@@ -8700,7 +8700,7 @@ interface paths {
8700
8700
  "application/json": components["schemas"]["Error"];
8701
8701
  };
8702
8702
  };
8703
- /** @description Conflict. Either the client tools registry fingerprint was not found (`client_tools_resend_required`; resend the full `clientTools[]` with the fingerprint), or this turn was superseded by a newer interrupting turn before it could start (`turn_superseded`). The body carries `error` alone. */
8703
+ /** @description Conflict. Either the client tools registry fingerprint was not found (`client_tools_resend_required`; resend the full `clientTools[]` with the fingerprint), this turn was superseded by a newer interrupting turn before it could start (`turn_superseded`), or a Claude Managed target was refused because the caller has not opted into durable turns (`CLAUDE_MANAGED_DURABLE_TURNS_REQUIRED`; `hint` names the exact opt-in) or the session carries no conversation record (`CLAUDE_MANAGED_CONVERSATION_REQUIRED`). A join refusal uses `JOIN_UNAVAILABLE`. */
8704
8704
  409: {
8705
8705
  headers: {
8706
8706
  [name: string]: unknown;
@@ -8977,8 +8977,8 @@ interface paths {
8977
8977
  get?: never;
8978
8978
  put?: never;
8979
8979
  /**
8980
- * Stop a native durable client execution
8981
- * @description Cancel the specified execution without starting a replacement. Pending inputs become not applied. Requires the exact visitor and session bound to the conversation.
8980
+ * Stop a durable client execution
8981
+ * @description Cancel the specified execution without starting a replacement. For a native agent, pending inputs become not applied; for a Claude Managed agent, the hosted session is interrupted and stays resumable. Requires the exact visitor and session bound to the conversation.
8982
8982
  */
8983
8983
  post: {
8984
8984
  parameters: {
@@ -9047,6 +9047,7 @@ interface paths {
9047
9047
  "application/json": {
9048
9048
  accepted: boolean;
9049
9049
  executionId: string;
9050
+ reason?: string;
9050
9051
  };
9051
9052
  };
9052
9053
  };
@@ -9736,7 +9737,7 @@ interface paths {
9736
9737
  conversationRevision: string;
9737
9738
  /** @description Returned when the request negotiates `durableRecovery`. Older servers omit it; clients must then keep ordinary streaming behavior. */
9738
9739
  durableRecovery?: {
9739
- /** @description Whether this initialized client-token session has the visitor credential and surface policy needed to use the durable execution reconnect route. Reporting only: individual turns still self-identify as durable through replay cursors. */
9740
+ /** @description Whether this initialized client-token session has the visitor credential and the durable-turns opt-in needed to use the durable execution reconnect route. The opt-in is the chat surface `behavior.durableTurns.enabled` for a surface-bound token and `config.durableTurns.enabled` for a standalone token. Reporting only: individual turns still self-identify as durable through replay cursors. */
9740
9741
  enabled: boolean;
9741
9742
  /** @description Whether the native durable target supports non-interrupting user-message delivery. */
9742
9743
  join?: boolean;
@@ -25156,7 +25157,7 @@ interface paths {
25156
25157
  };
25157
25158
  /**
25158
25159
  * Query customer logs
25159
- * @description Query persisted customer logs via R2 SQL with filtering, pagination, and search.
25160
+ * @description Query persisted customer logs with filtering, pagination, and search. When `data.live` is present the page came from the span store: one entry is one execution seam, so sub-seam rows (step skips, sources, context notices, artifacts, state snapshots, custom events) are not listed, a start/complete pair is one row carrying a duration, runs still in progress appear once they finish, and `search` matches a span's message, name, operation, tool name or error class. Otherwise each entry is one event. Requests naming `audit` or `schedule`, and an audit-entitled unfiltered read, are always served from the event tier.
25160
25161
  */
25161
25162
  get: {
25162
25163
  parameters: {
@@ -25169,9 +25170,9 @@ interface paths {
25169
25170
  startTime?: string;
25170
25171
  /** @description Alias for to. Ignored when to is also given. */
25171
25172
  endTime?: string;
25172
- /** @description Comma-separated log levels (debug,info,warn,error) */
25173
+ /** @description Comma-separated log levels (debug,info,warn,error). An unknown value is rejected with 400. */
25173
25174
  level?: string;
25174
- /** @description Comma-separated categories */
25175
+ /** @description Comma-separated categories (execution,agent,tool,model,system,error,schedule,batch,audit). An unknown value is rejected with 400. */
25175
25176
  category?: string;
25176
25177
  /** @description Filter by flow ID */
25177
25178
  flowId?: string;
@@ -25206,13 +25207,25 @@ interface paths {
25206
25207
  content: {
25207
25208
  "application/json": {
25208
25209
  data: {
25210
+ /** @description True when the historical segment was served by the flat fallback plan because the deduplicating one was rejected, so a re-sent delivery can appear more than once. Absent on healthy responses. */
25211
+ dedupeFallback?: boolean;
25209
25212
  /** @description True when part of the window could not be read, so entries may be missing. Evicted ordinary rows are recovered from R2 when old enough; receipt-backed recovery remains degraded when source time cannot prove ingestion. Absent on healthy responses. */
25210
25213
  degraded?: boolean;
25211
25214
  entries: {
25212
25215
  [key: string]: unknown;
25213
25216
  }[];
25217
+ /** @description Present only when the page was served from the span store. Runs still in progress appear once they finish; the minutes above the cut-line come from the live tier when it answers in time. Absent otherwise. */
25218
+ live?: {
25219
+ /** @description Entries at or below this instant came from the span store; newer ones from the live tier. */
25220
+ cutline: string;
25221
+ /** @enum {string} */
25222
+ reason?: "hot_tier_failed" | "outside_window";
25223
+ served: boolean;
25224
+ };
25214
25225
  pagination: {
25215
25226
  cursor: string | null;
25227
+ /** @description True when the supplied cursor could not be honoured and the read restarted at page one. A paging client must stop rather than follow the fresh cursor. Absent otherwise. */
25228
+ cursorReset?: boolean;
25216
25229
  hasMore: boolean;
25217
25230
  };
25218
25231
  };
@@ -25346,15 +25359,19 @@ interface paths {
25346
25359
  };
25347
25360
  /**
25348
25361
  * Read one log entry in full
25349
- * @description Returns a single log entry addressed by its execution and timestamp, including the model-call transcript the paged list projection omits. Bounded to one millisecond of one execution, so a detail read never costs a page.
25362
+ * @description Returns a single log entry, including the model-call transcript the paged list projection omits. Address it either by the span key (traceId, spanId and timestamp) or by the legacy triple (executionId and timestamp, optionally narrowed by requestId, seq or eventName). Bounded to one millisecond of one execution, so a detail read never costs a page.
25350
25363
  */
25351
25364
  get: {
25352
25365
  parameters: {
25353
25366
  query: {
25354
- /** @description Runtime execution_id / executionSessionId the entry belongs to */
25355
- executionId: string;
25367
+ /** @description Runtime execution_id / executionSessionId the entry belongs to. Required unless traceId and spanId are given. */
25368
+ executionId?: string;
25356
25369
  /** @description The entry's exact timestamp (ISO 8601) */
25357
25370
  timestamp: string;
25371
+ /** @description Trace the span belongs to. Required with spanId; a span id is unique only within its trace. */
25372
+ traceId?: string;
25373
+ /** @description Span to read, from a list row’s otlpSpanId. Requires traceId. */
25374
+ spanId?: string;
25358
25375
  /** @description Narrow to one request */
25359
25376
  requestId?: string;
25360
25377
  /** @description Narrow to one sequence number */
@@ -25443,9 +25460,9 @@ interface paths {
25443
25460
  startTime?: string;
25444
25461
  /** @description Alias for to. Ignored when to is also given. */
25445
25462
  endTime?: string;
25446
- /** @description Comma-separated log levels (debug,info,warn,error) */
25463
+ /** @description Comma-separated log levels (debug,info,warn,error). An unknown value is rejected with 400. */
25447
25464
  level?: string;
25448
- /** @description Comma-separated categories */
25465
+ /** @description Comma-separated categories (execution,agent,tool,model,system,error,schedule,batch,audit). An unknown value is rejected with 400. */
25449
25466
  category?: string;
25450
25467
  /** @description Filter by flow ID */
25451
25468
  flowId?: string;
@@ -25494,6 +25511,8 @@ interface paths {
25494
25511
  byType: {
25495
25512
  [key: string]: number;
25496
25513
  };
25514
+ /** @description True when counts came from the flat fallback plan because the deduplicating one was rejected, so a re-sent delivery can be counted more than once. Such a response is never cached. Absent on healthy responses. */
25515
+ dedupeFallback?: boolean;
25497
25516
  /** @description True when part of the window could not be read, so counts may be partial. Evicted ordinary rows are counted from R2 when old enough; receipt-backed recovery remains degraded when source time cannot prove ingestion. Absent on healthy responses, which are the only ones cached. */
25498
25517
  degraded?: boolean;
25499
25518
  histogram: {
@@ -30801,6 +30820,8 @@ interface paths {
30801
30820
  budgetExhausted?: boolean | null;
30802
30821
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
30803
30822
  cancelRequestedAt?: string | null;
30823
+ /** @description How many runs name this one as their parent. The unscoped feed returns roots only, so this is the size of the fold underneath a row; read the children with parentExecutionId=<executionId>. It is populated on a resource-scoped page too, where nothing is folded, so a surface can still offer the same expansion. WHICH children are counted depends on the arm that served the row: the span store counts every child, agent and nested-flow alike, while the legacy control-plane fallback counts agent children only, so on that arm a parent whose only child is a nested flow reports 0. That is deliberate — the fallback arm cannot enumerate a nested-flow child either, so counting one would advertise a fold that opens on nothing. It counts only children the CALLER may read: a credential holding one execution family (AGENTS:READ or FLOWS:READ alone) counts the children of that family and no others, so a count never discloses a run the same credential could not list. NULL means the arm cannot count children at all, which is not zero. */
30824
+ childCount: number | null;
30804
30825
  /**
30805
30826
  * @description Storage completeness; null on a row the control-plane arm served.
30806
30827
  * @enum {string|null}
@@ -30820,9 +30841,11 @@ interface paths {
30820
30841
  fidelityTier: string | null;
30821
30842
  /** @description Flow that ran. */
30822
30843
  flowId: string | null;
30844
+ /** @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. */
30845
+ inlineDefinition: boolean | null;
30823
30846
  /** @description Messages the run started from. Absent means the overlay did not answer, which is not false and not null. */
30824
30847
  inputMessages?: unknown;
30825
- /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false test run) has none. */
30848
+ /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false run) has none. */
30826
30849
  inputPreview?: string | null;
30827
30850
  /** @description Input tokens reported. */
30828
30851
  inputTokens: number | null;
@@ -30835,6 +30858,11 @@ interface paths {
30835
30858
  kind: "agent" | "flow";
30836
30859
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
30837
30860
  lastHeartbeatAt?: string | null;
30861
+ /**
30862
+ * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field. ANY entrance that resolves a principal stamps it: a Clerk session answers dashboard; a management API key answers api, which includes the Runtype MCP server's tools and Code Mode, since both reach dispatch with a management key; and Runtype's own internal caller answers internal, for example the hosted /v1/mcp proxy. A lane that resolves NO principal carries NULL BY DESIGN: schedule, webhook, messaging, A2A, an agent exposed AS an MCP surface, subagent, nested flow, a client-token product surface (an end user is none of the three origins) and an ingested OTLP run. So NULL says "no authenticated principal at this entrance" rather than "unknown caller". The one NULL that is not a statement about the lane is a row whose header predates the field or came from the backfill: it stamps nothing even for a run that did resolve a principal.
30863
+ * @enum {string|null}
30864
+ */
30865
+ origin: "dashboard" | "api" | "internal" | null;
30838
30866
  /** @description Framework identity the producer reported, for a versionless run group. Absent means the overlay did not answer, which is not false and not null. */
30839
30867
  otelProducer?: unknown;
30840
30868
  /** @description Output tokens reported. */
@@ -30871,11 +30899,16 @@ interface paths {
30871
30899
  status: "queued" | "running" | "awaiting" | "completed" | "failed" | "cancelled";
30872
30900
  /** @description Stop reason from the terminal frame. */
30873
30901
  stopReason?: string | null;
30902
+ /** @description The persistence posture the dispatch declared. FALSE means the run wrote no control-plane row, no journal outputs and no span content, so a surface that reports a missing transcript keys on this and never on origin. NULL means the header states nothing, which is not "true": a lane that takes no such flag carries no stamp, and an ingested (OTLP) run declared none. A row served from the legacy control-plane lane answers true, because that row exists only when the run stored. */
30903
+ storeResults: boolean | null;
30874
30904
  /** @description Product surface that entered this run. */
30875
30905
  surfaceId: string | null;
30876
30906
  /** @description Surface family (api, chat, webhook, schedule, ...). */
30877
30907
  surfaceType: string | null;
30878
- /** @description True when the run was dispatched with storeResults: false, so it has no control-plane row and no overlay. NULL means the header states nothing about it, which is not false: headers written before this field shipped, and lanes that take no such flag, carry no dispatch stamp and are never backfilled. */
30908
+ /**
30909
+ * @deprecated
30910
+ * @description DEPRECATED: a derived alias of origin, kept for one release — read origin instead. True when the run came from the dashboard, i.e. origin === "dashboard"; NULL exactly when origin is NULL. It is never derived from storeResults, which defaults to false across the whole flow lane and which an API caller sets for its own privacy reasons: reading it as "test" labelled production runs as tests. A run whose header predates origin therefore reads NULL rather than claiming either answer.
30911
+ */
30879
30912
  test: boolean | null;
30880
30913
  /** @description Metered cost as a decimal string. */
30881
30914
  totalCost: string | null;
@@ -40043,7 +40076,7 @@ interface paths {
40043
40076
  };
40044
40077
  /**
40045
40078
  * List runs
40046
- * @description Every agent and flow run in the span store, newest start first. A run dispatched with `storeResults: false` is listed with `test: true` rather than being invisible. `overlay=live` adds live control-plane fields; the overlay never adds, drops or reorders a row. Returns 404 with `code: "run_history_unavailable"` when neither plane can serve the page, which a client renders as "no run history here" rather than as a failed read.
40079
+ * @description Every agent and flow run in the span store, newest start first, including runs that write no control-plane row. The UNSCOPED feed is ROOT runs only: a subagent or nested-flow run folds under its parent, `childCount` says how many are folded there, and `parentExecutionId=<id>` reads them. Pass `includeChildren=true` for the flat enumeration. Any resource-scoped filter (`agentId`, `flowId`, `conversationId`, `surfaceId`, `recordId`, `batchExecutionId`, `parentExecutionId`, `rootExecutionId`, `executionId`) is already an explicit selection and never folds, so an agent that only ever runs as a subagent still lists under `agentId`. Each row carries `origin` (dashboard | api | internal | null), read from the caller's authenticated principal, and `test` as its derived alias for `origin === "dashboard"`; any entrance that resolves a principal stamps origin, including the Runtype MCP server tools and Code Mode (`api`) and the hosted `/v1/mcp` proxy (`internal`). A lane with no principal answers null for both by design: schedule, webhook, messaging, A2A, an agent exposed as an MCP surface, subagent, nested flow, a client-token product surface, an ingested run, and any row whose header predates the field. `overlay=live` adds live control-plane fields; the overlay never adds, drops or reorders a row. Returns 404 with `code: "run_history_unavailable"` when neither plane can serve the page, which a client renders as "no run history here" rather than as a failed read.
40047
40080
  */
40048
40081
  get: {
40049
40082
  parameters: {
@@ -40066,6 +40099,8 @@ interface paths {
40066
40099
  parentExecutionId?: string;
40067
40100
  /** @description Runs in this execution tree. */
40068
40101
  rootExecutionId?: string;
40102
+ /** @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. */
40103
+ includeChildren?: "true" | "false";
40069
40104
  /** @description Read specific runs by id; at most 100 per request. */
40070
40105
  executionId?: string | string[];
40071
40106
  /** @description Filter by producing lane. */
@@ -50939,6 +50974,8 @@ interface components {
50939
50974
  budgetExhausted?: boolean | null;
50940
50975
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
50941
50976
  cancelRequestedAt?: string | null;
50977
+ /** @description How many runs name this one as their parent. The unscoped feed returns roots only, so this is the size of the fold underneath a row; read the children with parentExecutionId=<executionId>. It is populated on a resource-scoped page too, where nothing is folded, so a surface can still offer the same expansion. WHICH children are counted depends on the arm that served the row: the span store counts every child, agent and nested-flow alike, while the legacy control-plane fallback counts agent children only, so on that arm a parent whose only child is a nested flow reports 0. That is deliberate — the fallback arm cannot enumerate a nested-flow child either, so counting one would advertise a fold that opens on nothing. It counts only children the CALLER may read: a credential holding one execution family (AGENTS:READ or FLOWS:READ alone) counts the children of that family and no others, so a count never discloses a run the same credential could not list. NULL means the arm cannot count children at all, which is not zero. */
50978
+ childCount: number | null;
50942
50979
  /**
50943
50980
  * @description Storage completeness; null on a row the control-plane arm served.
50944
50981
  * @enum {string|null}
@@ -50958,9 +50995,11 @@ interface components {
50958
50995
  fidelityTier: string | null;
50959
50996
  /** @description Flow that ran. */
50960
50997
  flowId: string | null;
50998
+ /** @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. */
50999
+ inlineDefinition: boolean | null;
50961
51000
  /** @description Messages the run started from. Absent means the overlay did not answer, which is not false and not null. */
50962
51001
  inputMessages?: unknown;
50963
- /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false test run) has none. */
51002
+ /** @description The run's first user message, secret-scrubbed and cut to 160 characters, so a list can say what a run was asked to do without reading content. Absent means no input text is recorded for this run, which is not an empty message: the span store holds no run-level input at all, so a run with no control-plane row (a flow leg, a storeResults:false run) has none. */
50964
51003
  inputPreview?: string | null;
50965
51004
  /** @description Input tokens reported. */
50966
51005
  inputTokens: number | null;
@@ -50973,6 +51012,11 @@ interface components {
50973
51012
  kind: "agent" | "flow";
50974
51013
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
50975
51014
  lastHeartbeatAt?: string | null;
51015
+ /**
51016
+ * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field. ANY entrance that resolves a principal stamps it: a Clerk session answers dashboard; a management API key answers api, which includes the Runtype MCP server's tools and Code Mode, since both reach dispatch with a management key; and Runtype's own internal caller answers internal, for example the hosted /v1/mcp proxy. A lane that resolves NO principal carries NULL BY DESIGN: schedule, webhook, messaging, A2A, an agent exposed AS an MCP surface, subagent, nested flow, a client-token product surface (an end user is none of the three origins) and an ingested OTLP run. So NULL says "no authenticated principal at this entrance" rather than "unknown caller". The one NULL that is not a statement about the lane is a row whose header predates the field or came from the backfill: it stamps nothing even for a run that did resolve a principal.
51017
+ * @enum {string|null}
51018
+ */
51019
+ origin: "dashboard" | "api" | "internal" | null;
50976
51020
  /** @description Framework identity the producer reported, for a versionless run group. Absent means the overlay did not answer, which is not false and not null. */
50977
51021
  otelProducer?: unknown;
50978
51022
  /** @description Output tokens reported. */
@@ -51009,11 +51053,16 @@ interface components {
51009
51053
  status: "queued" | "running" | "awaiting" | "completed" | "failed" | "cancelled";
51010
51054
  /** @description Stop reason from the terminal frame. */
51011
51055
  stopReason?: string | null;
51056
+ /** @description The persistence posture the dispatch declared. FALSE means the run wrote no control-plane row, no journal outputs and no span content, so a surface that reports a missing transcript keys on this and never on origin. NULL means the header states nothing, which is not "true": a lane that takes no such flag carries no stamp, and an ingested (OTLP) run declared none. A row served from the legacy control-plane lane answers true, because that row exists only when the run stored. */
51057
+ storeResults: boolean | null;
51012
51058
  /** @description Product surface that entered this run. */
51013
51059
  surfaceId: string | null;
51014
51060
  /** @description Surface family (api, chat, webhook, schedule, ...). */
51015
51061
  surfaceType: string | null;
51016
- /** @description True when the run was dispatched with storeResults: false, so it has no control-plane row and no overlay. NULL means the header states nothing about it, which is not false: headers written before this field shipped, and lanes that take no such flag, carry no dispatch stamp and are never backfilled. */
51062
+ /**
51063
+ * @deprecated
51064
+ * @description DEPRECATED: a derived alias of origin, kept for one release — read origin instead. True when the run came from the dashboard, i.e. origin === "dashboard"; NULL exactly when origin is NULL. It is never derived from storeResults, which defaults to false across the whole flow lane and which an API caller sets for its own privacy reasons: reading it as "test" labelled production runs as tests. A run whose header predates origin therefore reads NULL rather than claiming either answer.
51065
+ */
51017
51066
  test: boolean | null;
51018
51067
  /** @description Metered cost as a decimal string. */
51019
51068
  totalCost: string | null;
@@ -57899,6 +57948,18 @@ interface RunListRow {
57899
57948
  parentExecutionId: string | null;
57900
57949
  parentToolCallId: string | null;
57901
57950
  rootExecutionId: string | null;
57951
+ /**
57952
+ * How many runs name this one as their parent. The unscoped feed returns
57953
+ * roots only, so this is the size of the fold underneath a row; read the
57954
+ * children with `parentExecutionId`. It is populated on a resource-scoped
57955
+ * page too. The span store counts agent and nested-flow children alike; the
57956
+ * legacy control-plane fallback counts agent children only, so a
57957
+ * nested-flow-only parent reports 0 there — that arm cannot enumerate such a
57958
+ * child either. It counts only children the caller may read, so a
57959
+ * single-family credential never learns the other family's children exist.
57960
+ * NULL when the serving arm cannot count at all.
57961
+ */
57962
+ childCount: number | null;
57902
57963
  source: 'hosted' | 'ingested';
57903
57964
  fidelityTier: string | null;
57904
57965
  completeness: 'partial' | 'complete' | 'conflicted' | 'expired' | 'deleted' | null;
@@ -57909,9 +57970,30 @@ interface RunListRow {
57909
57970
  totalCost: string | null;
57910
57971
  selfReportedCost: string | null;
57911
57972
  /**
57912
- * True when the run was dispatched with `storeResults: false`, such as an
57913
- * editor test. NULL means the header states nothing about it, which is not
57914
- * `false`: headers written before the field shipped carry no dispatch stamp.
57973
+ * Where the run was dispatched from, taken from the caller's authenticated
57974
+ * principal and never from a request field. Any entrance that resolves a
57975
+ * principal stamps it (MCP tools and Code Mode answer `api`, the hosted
57976
+ * `/v1/mcp` proxy `internal`); a lane with none carries NULL by design.
57977
+ */
57978
+ origin: 'dashboard' | 'api' | 'internal' | null;
57979
+ /**
57980
+ * The persistence posture the dispatch declared. `false` means the run kept no
57981
+ * control-plane row, no journal outputs and no span content, so a surface
57982
+ * reporting a missing transcript reads this and never `origin`.
57983
+ */
57984
+ storeResults: boolean | null;
57985
+ /**
57986
+ * True when the dispatch carried a complete inline definition, so the run
57987
+ * executed that config and stamps no `agentVersionId`. False for a run of the
57988
+ * saved definition by reference. NULL when the header states nothing.
57989
+ */
57990
+ inlineDefinition: boolean | null;
57991
+ /**
57992
+ * True when the run came from the dashboard (`origin === 'dashboard'`), such
57993
+ * as an editor test.
57994
+ * @deprecated Derived alias of `origin`; read `origin` instead. Kept for one
57995
+ * release. NULL exactly when `origin` is NULL, including on a run whose header
57996
+ * predates the field.
57915
57997
  */
57916
57998
  test: boolean | null;
57917
57999
  stopReason?: string | null;
@@ -57948,6 +58030,13 @@ interface RunListParams {
57948
58030
  parentExecutionId?: string;
57949
58031
  rootExecutionId?: string;
57950
58032
  executionId?: string | string[];
58033
+ /**
58034
+ * `'true'` restores the flat enumeration on the unscoped feed, which is roots
58035
+ * only by default: a subagent or nested-flow run folds under its parent. Any
58036
+ * resource-scoped filter is already an explicit selection and never folds, so
58037
+ * this changes nothing there.
58038
+ */
58039
+ includeChildren?: 'true' | 'false';
57951
58040
  source?: 'hosted' | 'ingested';
57952
58041
  /**
57953
58042
  * `running`, `completed` or `failed` only. `queued`, `awaiting` and
@@ -57976,8 +58065,8 @@ interface RunListResponse {
57976
58065
  }
57977
58066
  /**
57978
58067
  * Read-only namespace over `/v1/runs`, the one list of agent and flow runs.
57979
- * A run dispatched with `storeResults: false` is listed with `test: true`
57980
- * rather than being absent.
58068
+ * A dashboard editor test is listed with `origin: 'dashboard'` (and its `test`
58069
+ * alias) rather than being absent.
57981
58070
  */
57982
58071
  declare class RunsNamespace {
57983
58072
  private readonly getClient;
@@ -58948,7 +59037,10 @@ declare class Runtype {
58948
59037
  static get executions(): ExecutionsNamespace;
58949
59038
  /**
58950
59039
  * Runs namespace - the one list of agent and flow runs, read from the span
58951
- * store. Includes runs dispatched with `storeResults: false` as `test: true`.
59040
+ * store. Each row states two separate facts: `origin` (who dispatched, from
59041
+ * the caller's principal; `test` is its deprecated alias) and `storeResults`
59042
+ * (whether the transcript was kept). A run that wrote no control-plane row
59043
+ * is still listed.
58952
59044
  *
58953
59045
  * @example
58954
59046
  * ```typescript
@@ -59379,6 +59471,14 @@ interface ClientTokenConfig {
59379
59471
  theme?: ClientWidgetTheme;
59380
59472
  /** Custom data passed to flows */
59381
59473
  customData?: Record<string, unknown>;
59474
+ /**
59475
+ * Durable-turn opt-in for a token with no product surface. A surface-bound
59476
+ * token reads the surface's `behavior.durableTurns` instead and ignores this.
59477
+ */
59478
+ durableTurns?: {
59479
+ /** Defaults to false when absent. */
59480
+ enabled?: boolean;
59481
+ };
59382
59482
  }
59383
59483
  /**
59384
59484
  * Client token data returned from the API
package/dist/index.mjs CHANGED
@@ -13639,7 +13639,10 @@ var Runtype = class {
13639
13639
  }
13640
13640
  /**
13641
13641
  * Runs namespace - the one list of agent and flow runs, read from the span
13642
- * store. Includes runs dispatched with `storeResults: false` as `test: true`.
13642
+ * store. Each row states two separate facts: `origin` (who dispatched, from
13643
+ * the caller's principal; `test` is its deprecated alias) and `storeResults`
13644
+ * (whether the transcript was kept). A run that wrote no control-plane row
13645
+ * is still listed.
13643
13646
  *
13644
13647
  * @example
13645
13648
  * ```typescript
@@ -13931,7 +13934,7 @@ function transformQueryParams(params) {
13931
13934
 
13932
13935
  // src/version.ts
13933
13936
  var FALLBACK_VERSION = "0.0.0";
13934
- var SDK_VERSION = "10.1.2".length > 0 ? "10.1.2" : FALLBACK_VERSION;
13937
+ var SDK_VERSION = "10.2.0".length > 0 ? "10.2.0" : FALLBACK_VERSION;
13935
13938
  var RUNTYPE_CLIENT_KIND = "sdk";
13936
13939
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
13937
13940
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "10.1.2",
3
+ "version": "10.2.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {},
26
26
  "devDependencies": {
27
- "@runtypelabs/shared": "3.57.3",
27
+ "@runtypelabs/shared": "3.59.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsup": "^8.0.2",
30
30
  "typescript": "^6.0.3",