@runtypelabs/sdk 9.1.0 → 9.1.1

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
@@ -404,7 +404,8 @@ function createAgentEventTranslator() {
404
404
  agentName: data.agentName,
405
405
  maxTurns: data.maxTurns,
406
406
  startedAt: data.startedAt,
407
- config: data.config
407
+ config: data.config,
408
+ resumed: data.resumed
408
409
  })
409
410
  ];
410
411
  case "turn_start":
@@ -542,6 +543,10 @@ function createAgentEventTranslator() {
542
543
  toolName: data.toolName,
543
544
  success: data.success,
544
545
  result: data.result,
546
+ // A failure's reason travels on the frame's `error` field — the
547
+ // only carrier for complete-only failures like the MCP discovery
548
+ // connection pseudo-tool, which no longer emits an `error` frame.
549
+ error: str(data.error),
545
550
  executionTime: data.executionTime
546
551
  })
547
552
  ];
@@ -6437,7 +6442,7 @@ var Runtype = class {
6437
6442
 
6438
6443
  // src/version.ts
6439
6444
  var FALLBACK_VERSION = "0.0.0";
6440
- var SDK_VERSION = "9.1.0".length > 0 ? "9.1.0" : FALLBACK_VERSION;
6445
+ var SDK_VERSION = "9.1.1".length > 0 ? "9.1.1" : FALLBACK_VERSION;
6441
6446
  var RUNTYPE_CLIENT_KIND = "sdk";
6442
6447
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
6443
6448
 
@@ -10005,7 +10010,7 @@ var _AgentsEndpoint = class _AgentsEndpoint {
10005
10010
  ...callbacks,
10006
10011
  onAgentStart: (event) => {
10007
10012
  lastSeenExecutionId = event.executionId;
10008
- callbacks?.onAgentStart?.(event);
10013
+ if (!event.resumed) callbacks?.onAgentStart?.(event);
10009
10014
  },
10010
10015
  onTurnDelta: (event) => {
10011
10016
  if (event.contentType === "text") {
package/dist/index.d.cts CHANGED
@@ -17448,6 +17448,8 @@ interface paths {
17448
17448
  * @description **Limited preview — not yet generally available.** This endpoint is dark-launched and returns `404 Not Found` in production until GA; it is only reachable in non-production environments today.
17449
17449
  *
17450
17450
  * Export a fully-resolved, self-contained flow definition that the @runtypelabs/runtime package can consume directly at boot. All step configs are inlined; no live DB queries are needed at execution time.
17451
+ *
17452
+ * Flows containing a durable-class step (`wait-until` or `crawl`) are rejected with `422 Unprocessable Entity` (code `DURABLE_FLOW_EXPORT_UNSUPPORTED`): those steps park their pause on a Cloudflare Workflow, which cannot run inside an exported runtime artifact, so durable flows run hosted only.
17451
17453
  */
17452
17454
  get: {
17453
17455
  parameters: {
@@ -17520,6 +17522,23 @@ interface paths {
17520
17522
  "application/json": components["schemas"]["Error"];
17521
17523
  };
17522
17524
  };
17525
+ /** @description The flow contains durable-class steps and runs hosted only (code `DURABLE_FLOW_EXPORT_UNSUPPORTED`) */
17526
+ 422: {
17527
+ headers: {
17528
+ [name: string]: unknown;
17529
+ };
17530
+ content: {
17531
+ "application/json": {
17532
+ /** @enum {string} */
17533
+ code: "DURABLE_FLOW_EXPORT_UNSUPPORTED";
17534
+ durableSteps: {
17535
+ stepId: string;
17536
+ stepType: string;
17537
+ }[];
17538
+ error: string;
17539
+ };
17540
+ };
17541
+ };
17523
17542
  /** @description Internal server error */
17524
17543
  500: {
17525
17544
  headers: {
@@ -45333,6 +45352,7 @@ interface components {
45333
45352
  /** @enum {string} */
45334
45353
  kind: "agent" | "flow";
45335
45354
  maxTurns?: number;
45355
+ resumed?: boolean;
45336
45356
  seq: number;
45337
45357
  source?: string;
45338
45358
  startedAt: string;
@@ -54483,6 +54503,15 @@ interface AgentStartEvent extends BaseAgentEvent {
54483
54503
  model?: string;
54484
54504
  enableReflection?: boolean;
54485
54505
  };
54506
+ /**
54507
+ * `true` when this start opens the RESUME leg of a paused run (approval or
54508
+ * client-tool continuation) rather than a new run. The runtime opens every
54509
+ * response with a start frame; keep run-level state (turn counts, spend
54510
+ * totals, accumulated output) across a resumed start instead of resetting.
54511
+ * `executeWithLocalTools` already folds resumed starts away — its
54512
+ * `onAgentStart` fires once per session.
54513
+ */
54514
+ resumed?: boolean;
54486
54515
  }
54487
54516
  /**
54488
54517
  * Agent iteration start event
@@ -54599,6 +54628,8 @@ interface AgentToolCompleteEvent extends BaseAgentEvent {
54599
54628
  toolName: string;
54600
54629
  success: boolean;
54601
54630
  result?: unknown;
54631
+ /** Failure reason when `success` is false (e.g. an MCP discovery connection failure). */
54632
+ error?: string;
54602
54633
  executionTime?: number;
54603
54634
  }
54604
54635
  interface AgentMediaEvent extends BaseAgentEvent {
package/dist/index.d.ts CHANGED
@@ -17448,6 +17448,8 @@ interface paths {
17448
17448
  * @description **Limited preview — not yet generally available.** This endpoint is dark-launched and returns `404 Not Found` in production until GA; it is only reachable in non-production environments today.
17449
17449
  *
17450
17450
  * Export a fully-resolved, self-contained flow definition that the @runtypelabs/runtime package can consume directly at boot. All step configs are inlined; no live DB queries are needed at execution time.
17451
+ *
17452
+ * Flows containing a durable-class step (`wait-until` or `crawl`) are rejected with `422 Unprocessable Entity` (code `DURABLE_FLOW_EXPORT_UNSUPPORTED`): those steps park their pause on a Cloudflare Workflow, which cannot run inside an exported runtime artifact, so durable flows run hosted only.
17451
17453
  */
17452
17454
  get: {
17453
17455
  parameters: {
@@ -17520,6 +17522,23 @@ interface paths {
17520
17522
  "application/json": components["schemas"]["Error"];
17521
17523
  };
17522
17524
  };
17525
+ /** @description The flow contains durable-class steps and runs hosted only (code `DURABLE_FLOW_EXPORT_UNSUPPORTED`) */
17526
+ 422: {
17527
+ headers: {
17528
+ [name: string]: unknown;
17529
+ };
17530
+ content: {
17531
+ "application/json": {
17532
+ /** @enum {string} */
17533
+ code: "DURABLE_FLOW_EXPORT_UNSUPPORTED";
17534
+ durableSteps: {
17535
+ stepId: string;
17536
+ stepType: string;
17537
+ }[];
17538
+ error: string;
17539
+ };
17540
+ };
17541
+ };
17523
17542
  /** @description Internal server error */
17524
17543
  500: {
17525
17544
  headers: {
@@ -45333,6 +45352,7 @@ interface components {
45333
45352
  /** @enum {string} */
45334
45353
  kind: "agent" | "flow";
45335
45354
  maxTurns?: number;
45355
+ resumed?: boolean;
45336
45356
  seq: number;
45337
45357
  source?: string;
45338
45358
  startedAt: string;
@@ -54483,6 +54503,15 @@ interface AgentStartEvent extends BaseAgentEvent {
54483
54503
  model?: string;
54484
54504
  enableReflection?: boolean;
54485
54505
  };
54506
+ /**
54507
+ * `true` when this start opens the RESUME leg of a paused run (approval or
54508
+ * client-tool continuation) rather than a new run. The runtime opens every
54509
+ * response with a start frame; keep run-level state (turn counts, spend
54510
+ * totals, accumulated output) across a resumed start instead of resetting.
54511
+ * `executeWithLocalTools` already folds resumed starts away — its
54512
+ * `onAgentStart` fires once per session.
54513
+ */
54514
+ resumed?: boolean;
54486
54515
  }
54487
54516
  /**
54488
54517
  * Agent iteration start event
@@ -54599,6 +54628,8 @@ interface AgentToolCompleteEvent extends BaseAgentEvent {
54599
54628
  toolName: string;
54600
54629
  success: boolean;
54601
54630
  result?: unknown;
54631
+ /** Failure reason when `success` is false (e.g. an MCP discovery connection failure). */
54632
+ error?: string;
54602
54633
  executionTime?: number;
54603
54634
  }
54604
54635
  interface AgentMediaEvent extends BaseAgentEvent {
package/dist/index.mjs CHANGED
@@ -216,7 +216,8 @@ function createAgentEventTranslator() {
216
216
  agentName: data.agentName,
217
217
  maxTurns: data.maxTurns,
218
218
  startedAt: data.startedAt,
219
- config: data.config
219
+ config: data.config,
220
+ resumed: data.resumed
220
221
  })
221
222
  ];
222
223
  case "turn_start":
@@ -354,6 +355,10 @@ function createAgentEventTranslator() {
354
355
  toolName: data.toolName,
355
356
  success: data.success,
356
357
  result: data.result,
358
+ // A failure's reason travels on the frame's `error` field — the
359
+ // only carrier for complete-only failures like the MCP discovery
360
+ // connection pseudo-tool, which no longer emits an `error` frame.
361
+ error: str(data.error),
357
362
  executionTime: data.executionTime
358
363
  })
359
364
  ];
@@ -6249,7 +6254,7 @@ var Runtype = class {
6249
6254
 
6250
6255
  // src/version.ts
6251
6256
  var FALLBACK_VERSION = "0.0.0";
6252
- var SDK_VERSION = "9.1.0".length > 0 ? "9.1.0" : FALLBACK_VERSION;
6257
+ var SDK_VERSION = "9.1.1".length > 0 ? "9.1.1" : FALLBACK_VERSION;
6253
6258
  var RUNTYPE_CLIENT_KIND = "sdk";
6254
6259
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
6255
6260
 
@@ -9817,7 +9822,7 @@ var _AgentsEndpoint = class _AgentsEndpoint {
9817
9822
  ...callbacks,
9818
9823
  onAgentStart: (event) => {
9819
9824
  lastSeenExecutionId = event.executionId;
9820
- callbacks?.onAgentStart?.(event);
9825
+ if (!event.resumed) callbacks?.onAgentStart?.(event);
9821
9826
  },
9822
9827
  onTurnDelta: (event) => {
9823
9828
  if (event.contentType === "text") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
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",