@runtypelabs/sdk 10.1.4 → 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
@@ -14149,7 +14149,7 @@ function transformQueryParams(params) {
14149
14149
 
14150
14150
  // src/version.ts
14151
14151
  var FALLBACK_VERSION = "0.0.0";
14152
- var SDK_VERSION = "10.1.4".length > 0 ? "10.1.4" : FALLBACK_VERSION;
14152
+ var SDK_VERSION = "10.2.0".length > 0 ? "10.2.0" : FALLBACK_VERSION;
14153
14153
  var RUNTYPE_CLIENT_KIND = "sdk";
14154
14154
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
14155
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;
@@ -25213,8 +25214,18 @@ interface paths {
25213
25214
  entries: {
25214
25215
  [key: string]: unknown;
25215
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
+ };
25216
25225
  pagination: {
25217
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;
25218
25229
  hasMore: boolean;
25219
25230
  };
25220
25231
  };
@@ -25348,15 +25359,19 @@ interface paths {
25348
25359
  };
25349
25360
  /**
25350
25361
  * Read one log entry in full
25351
- * @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.
25352
25363
  */
25353
25364
  get: {
25354
25365
  parameters: {
25355
25366
  query: {
25356
- /** @description Runtime execution_id / executionSessionId the entry belongs to */
25357
- executionId: string;
25367
+ /** @description Runtime execution_id / executionSessionId the entry belongs to. Required unless traceId and spanId are given. */
25368
+ executionId?: string;
25358
25369
  /** @description The entry's exact timestamp (ISO 8601) */
25359
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;
25360
25375
  /** @description Narrow to one request */
25361
25376
  requestId?: string;
25362
25377
  /** @description Narrow to one sequence number */
@@ -25445,9 +25460,9 @@ interface paths {
25445
25460
  startTime?: string;
25446
25461
  /** @description Alias for to. Ignored when to is also given. */
25447
25462
  endTime?: string;
25448
- /** @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. */
25449
25464
  level?: string;
25450
- /** @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. */
25451
25466
  category?: string;
25452
25467
  /** @description Filter by flow ID */
25453
25468
  flowId?: string;
@@ -30805,6 +30820,8 @@ interface paths {
30805
30820
  budgetExhausted?: boolean | null;
30806
30821
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
30807
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;
30808
30825
  /**
30809
30826
  * @description Storage completeness; null on a row the control-plane arm served.
30810
30827
  * @enum {string|null}
@@ -30842,7 +30859,7 @@ interface paths {
30842
30859
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
30843
30860
  lastHeartbeatAt?: string | null;
30844
30861
  /**
30845
- * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field: dashboard for a Clerk session, api for a management API key, internal for a Runtype worker. NULL means the header states nothing about it, which is not "unknown caller": headers written before this field shipped, lanes that never see an auth principal, and every backfilled row carry no origin stamp.
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.
30846
30863
  * @enum {string|null}
30847
30864
  */
30848
30865
  origin: "dashboard" | "api" | "internal" | null;
@@ -40059,7 +40076,7 @@ interface paths {
40059
40076
  };
40060
40077
  /**
40061
40078
  * List runs
40062
- * @description Every agent and flow run in the span store, newest start first, including runs that write no control-plane row. Each row carries `origin` (dashboard | api | internal | null), read from the caller's authenticated principal, and `test` as its derived alias for `origin === "dashboard"`; both are null when the header states nothing. `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.
40063
40080
  */
40064
40081
  get: {
40065
40082
  parameters: {
@@ -40082,6 +40099,8 @@ interface paths {
40082
40099
  parentExecutionId?: string;
40083
40100
  /** @description Runs in this execution tree. */
40084
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";
40085
40104
  /** @description Read specific runs by id; at most 100 per request. */
40086
40105
  executionId?: string | string[];
40087
40106
  /** @description Filter by producing lane. */
@@ -50955,6 +50974,8 @@ interface components {
50955
50974
  budgetExhausted?: boolean | null;
50956
50975
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
50957
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;
50958
50979
  /**
50959
50980
  * @description Storage completeness; null on a row the control-plane arm served.
50960
50981
  * @enum {string|null}
@@ -50992,7 +51013,7 @@ interface components {
50992
51013
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
50993
51014
  lastHeartbeatAt?: string | null;
50994
51015
  /**
50995
- * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field: dashboard for a Clerk session, api for a management API key, internal for a Runtype worker. NULL means the header states nothing about it, which is not "unknown caller": headers written before this field shipped, lanes that never see an auth principal, and every backfilled row carry no origin stamp.
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.
50996
51017
  * @enum {string|null}
50997
51018
  */
50998
51019
  origin: "dashboard" | "api" | "internal" | null;
@@ -57927,6 +57948,18 @@ interface RunListRow {
57927
57948
  parentExecutionId: string | null;
57928
57949
  parentToolCallId: string | null;
57929
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;
57930
57963
  source: 'hosted' | 'ingested';
57931
57964
  fidelityTier: string | null;
57932
57965
  completeness: 'partial' | 'complete' | 'conflicted' | 'expired' | 'deleted' | null;
@@ -57938,8 +57971,9 @@ interface RunListRow {
57938
57971
  selfReportedCost: string | null;
57939
57972
  /**
57940
57973
  * Where the run was dispatched from, taken from the caller's authenticated
57941
- * principal and never from a request field. NULL means the header states
57942
- * nothing about it: a lane that sees no principal, or a backfilled row.
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.
57943
57977
  */
57944
57978
  origin: 'dashboard' | 'api' | 'internal' | null;
57945
57979
  /**
@@ -57996,6 +58030,13 @@ interface RunListParams {
57996
58030
  parentExecutionId?: string;
57997
58031
  rootExecutionId?: string;
57998
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';
57999
58040
  source?: 'hosted' | 'ingested';
58000
58041
  /**
58001
58042
  * `running`, `completed` or `failed` only. `queued`, `awaiting` and
@@ -59430,6 +59471,14 @@ interface ClientTokenConfig {
59430
59471
  theme?: ClientWidgetTheme;
59431
59472
  /** Custom data passed to flows */
59432
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
+ };
59433
59482
  }
59434
59483
  /**
59435
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;
@@ -25213,8 +25214,18 @@ interface paths {
25213
25214
  entries: {
25214
25215
  [key: string]: unknown;
25215
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
+ };
25216
25225
  pagination: {
25217
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;
25218
25229
  hasMore: boolean;
25219
25230
  };
25220
25231
  };
@@ -25348,15 +25359,19 @@ interface paths {
25348
25359
  };
25349
25360
  /**
25350
25361
  * Read one log entry in full
25351
- * @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.
25352
25363
  */
25353
25364
  get: {
25354
25365
  parameters: {
25355
25366
  query: {
25356
- /** @description Runtime execution_id / executionSessionId the entry belongs to */
25357
- executionId: string;
25367
+ /** @description Runtime execution_id / executionSessionId the entry belongs to. Required unless traceId and spanId are given. */
25368
+ executionId?: string;
25358
25369
  /** @description The entry's exact timestamp (ISO 8601) */
25359
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;
25360
25375
  /** @description Narrow to one request */
25361
25376
  requestId?: string;
25362
25377
  /** @description Narrow to one sequence number */
@@ -25445,9 +25460,9 @@ interface paths {
25445
25460
  startTime?: string;
25446
25461
  /** @description Alias for to. Ignored when to is also given. */
25447
25462
  endTime?: string;
25448
- /** @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. */
25449
25464
  level?: string;
25450
- /** @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. */
25451
25466
  category?: string;
25452
25467
  /** @description Filter by flow ID */
25453
25468
  flowId?: string;
@@ -30805,6 +30820,8 @@ interface paths {
30805
30820
  budgetExhausted?: boolean | null;
30806
30821
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
30807
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;
30808
30825
  /**
30809
30826
  * @description Storage completeness; null on a row the control-plane arm served.
30810
30827
  * @enum {string|null}
@@ -30842,7 +30859,7 @@ interface paths {
30842
30859
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
30843
30860
  lastHeartbeatAt?: string | null;
30844
30861
  /**
30845
- * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field: dashboard for a Clerk session, api for a management API key, internal for a Runtype worker. NULL means the header states nothing about it, which is not "unknown caller": headers written before this field shipped, lanes that never see an auth principal, and every backfilled row carry no origin stamp.
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.
30846
30863
  * @enum {string|null}
30847
30864
  */
30848
30865
  origin: "dashboard" | "api" | "internal" | null;
@@ -40059,7 +40076,7 @@ interface paths {
40059
40076
  };
40060
40077
  /**
40061
40078
  * List runs
40062
- * @description Every agent and flow run in the span store, newest start first, including runs that write no control-plane row. Each row carries `origin` (dashboard | api | internal | null), read from the caller's authenticated principal, and `test` as its derived alias for `origin === "dashboard"`; both are null when the header states nothing. `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.
40063
40080
  */
40064
40081
  get: {
40065
40082
  parameters: {
@@ -40082,6 +40099,8 @@ interface paths {
40082
40099
  parentExecutionId?: string;
40083
40100
  /** @description Runs in this execution tree. */
40084
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";
40085
40104
  /** @description Read specific runs by id; at most 100 per request. */
40086
40105
  executionId?: string | string[];
40087
40106
  /** @description Filter by producing lane. */
@@ -50955,6 +50974,8 @@ interface components {
50955
50974
  budgetExhausted?: boolean | null;
50956
50975
  /** @description Cancel request. Absent means the overlay did not answer, which is not false and not null. */
50957
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;
50958
50979
  /**
50959
50980
  * @description Storage completeness; null on a row the control-plane arm served.
50960
50981
  * @enum {string|null}
@@ -50992,7 +51013,7 @@ interface components {
50992
51013
  /** @description Last heartbeat. Absent means the overlay did not answer, which is not false and not null. */
50993
51014
  lastHeartbeatAt?: string | null;
50994
51015
  /**
50995
- * @description Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field: dashboard for a Clerk session, api for a management API key, internal for a Runtype worker. NULL means the header states nothing about it, which is not "unknown caller": headers written before this field shipped, lanes that never see an auth principal, and every backfilled row carry no origin stamp.
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.
50996
51017
  * @enum {string|null}
50997
51018
  */
50998
51019
  origin: "dashboard" | "api" | "internal" | null;
@@ -57927,6 +57948,18 @@ interface RunListRow {
57927
57948
  parentExecutionId: string | null;
57928
57949
  parentToolCallId: string | null;
57929
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;
57930
57963
  source: 'hosted' | 'ingested';
57931
57964
  fidelityTier: string | null;
57932
57965
  completeness: 'partial' | 'complete' | 'conflicted' | 'expired' | 'deleted' | null;
@@ -57938,8 +57971,9 @@ interface RunListRow {
57938
57971
  selfReportedCost: string | null;
57939
57972
  /**
57940
57973
  * Where the run was dispatched from, taken from the caller's authenticated
57941
- * principal and never from a request field. NULL means the header states
57942
- * nothing about it: a lane that sees no principal, or a backfilled row.
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.
57943
57977
  */
57944
57978
  origin: 'dashboard' | 'api' | 'internal' | null;
57945
57979
  /**
@@ -57996,6 +58030,13 @@ interface RunListParams {
57996
58030
  parentExecutionId?: string;
57997
58031
  rootExecutionId?: string;
57998
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';
57999
58040
  source?: 'hosted' | 'ingested';
58000
58041
  /**
58001
58042
  * `running`, `completed` or `failed` only. `queued`, `awaiting` and
@@ -59430,6 +59471,14 @@ interface ClientTokenConfig {
59430
59471
  theme?: ClientWidgetTheme;
59431
59472
  /** Custom data passed to flows */
59432
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
+ };
59433
59482
  }
59434
59483
  /**
59435
59484
  * Client token data returned from the API
package/dist/index.mjs CHANGED
@@ -13934,7 +13934,7 @@ function transformQueryParams(params) {
13934
13934
 
13935
13935
  // src/version.ts
13936
13936
  var FALLBACK_VERSION = "0.0.0";
13937
- var SDK_VERSION = "10.1.4".length > 0 ? "10.1.4" : FALLBACK_VERSION;
13937
+ var SDK_VERSION = "10.2.0".length > 0 ? "10.2.0" : FALLBACK_VERSION;
13938
13938
  var RUNTYPE_CLIENT_KIND = "sdk";
13939
13939
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
13940
13940
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "10.1.4",
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.58.1",
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",