@runtypelabs/sdk 4.11.0 → 4.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4520,6 +4520,131 @@ interface paths {
4520
4520
  patch?: never;
4521
4521
  trace?: never;
4522
4522
  };
4523
+ "/v1/assets/{assetId}/extend": {
4524
+ parameters: {
4525
+ query?: never;
4526
+ header?: never;
4527
+ path?: never;
4528
+ cookie?: never;
4529
+ };
4530
+ get?: never;
4531
+ put?: never;
4532
+ /**
4533
+ * Extend preview expiry
4534
+ * @description Re-up a preview page's expiration, keeping the same URL. Defaults to the caller's current plan TTL; pass `expiresInSeconds` to choose a shorter lifetime (the plan TTL is a hard ceiling — longer requests are clamped). Works on live previews and on previews that have already expired (expired pages keep their stored content; only serving is blocked). Applies to preview-rendering assets created by `publish_page` — download assets are not time-gated at the serving layer and cannot be extended.
4535
+ */
4536
+ post: {
4537
+ parameters: {
4538
+ query?: never;
4539
+ header?: never;
4540
+ path: {
4541
+ /** @description Asset ID (e.g. "asset_01k…"). A trailing file extension (".html") is ignored. */
4542
+ assetId: string;
4543
+ };
4544
+ cookie?: never;
4545
+ };
4546
+ requestBody?: {
4547
+ content: {
4548
+ "application/json": {
4549
+ /** @description New lifetime in seconds (positive integer). Capped at the plan's preview TTL — shorter is honored, longer is clamped. Omit for the plan default. */
4550
+ expiresInSeconds?: number;
4551
+ } & {
4552
+ [key: string]: unknown;
4553
+ };
4554
+ };
4555
+ };
4556
+ responses: {
4557
+ /** @description Expiry extended */
4558
+ 200: {
4559
+ headers: {
4560
+ [name: string]: unknown;
4561
+ };
4562
+ content: {
4563
+ "application/json": {
4564
+ /** @description The asset ID that was extended. */
4565
+ assetId: string;
4566
+ /** @description New expiration timestamp (ISO 8601). null = permanent (plan grants no-expiry previews). */
4567
+ expiresAt: string | null;
4568
+ /** @description Seconds until the new expiration. null = permanent. */
4569
+ expiresIn: number | null;
4570
+ /** @enum {string} */
4571
+ rendering: "preview";
4572
+ /** @description The public URL of the asset (unchanged by extension). */
4573
+ url: string;
4574
+ };
4575
+ };
4576
+ };
4577
+ /** @description Asset is not a preview asset */
4578
+ 400: {
4579
+ headers: {
4580
+ [name: string]: unknown;
4581
+ };
4582
+ content: {
4583
+ "application/json": components["schemas"]["Error"];
4584
+ };
4585
+ };
4586
+ /** @description Unauthorized */
4587
+ 401: {
4588
+ headers: {
4589
+ [name: string]: unknown;
4590
+ };
4591
+ content: {
4592
+ "application/json": components["schemas"]["Error"];
4593
+ };
4594
+ };
4595
+ /** @description Insufficient permissions */
4596
+ 403: {
4597
+ headers: {
4598
+ [name: string]: unknown;
4599
+ };
4600
+ content: {
4601
+ "application/json": components["schemas"]["Error"];
4602
+ };
4603
+ };
4604
+ /** @description Asset not found */
4605
+ 404: {
4606
+ headers: {
4607
+ [name: string]: unknown;
4608
+ };
4609
+ content: {
4610
+ "application/json": components["schemas"]["Error"];
4611
+ };
4612
+ };
4613
+ /** @description Stored content no longer exists */
4614
+ 410: {
4615
+ headers: {
4616
+ [name: string]: unknown;
4617
+ };
4618
+ content: {
4619
+ "application/json": components["schemas"]["Error"];
4620
+ };
4621
+ };
4622
+ /** @description Internal server error */
4623
+ 500: {
4624
+ headers: {
4625
+ [name: string]: unknown;
4626
+ };
4627
+ content: {
4628
+ "application/json": components["schemas"]["Error"];
4629
+ };
4630
+ };
4631
+ /** @description Asset storage not configured */
4632
+ 503: {
4633
+ headers: {
4634
+ [name: string]: unknown;
4635
+ };
4636
+ content: {
4637
+ "application/json": components["schemas"]["Error"];
4638
+ };
4639
+ };
4640
+ };
4641
+ };
4642
+ delete?: never;
4643
+ options?: never;
4644
+ head?: never;
4645
+ patch?: never;
4646
+ trace?: never;
4647
+ };
4523
4648
  "/v1/assets/{orgId}/{assetId}": {
4524
4649
  parameters: {
4525
4650
  query?: never;
@@ -6410,7 +6535,7 @@ interface paths {
6410
6535
  put?: never;
6411
6536
  /**
6412
6537
  * Submit feedback on a message
6413
- * @description Record message-level (`upvote` / `downvote` / `copy`, requires `messageId`) or conversation-level (`csat` 1-5, `nps` 0-10, requires `rating`) feedback for a client-token session. Idempotent per (session, type, message): a matching prior submission is updated. Expired-but-active sessions are accepted so post-conversation surveys still land.
6538
+ * @description Record message-level (`upvote` / `downvote` / `copy`, requires `messageId`) or conversation-level (`csat` 1-5, `nps` 0-10, requires `rating`) feedback for a client-token session. Requires the client `token` (authenticated like `/init` and `/chat`): the token is verified, its origin allowlist is enforced, and the session lookup is scoped to the token. Idempotent per (session, type, message): a matching prior submission is updated. Expired-but-active sessions are accepted so post-conversation surveys still land.
6414
6539
  */
6415
6540
  post: {
6416
6541
  parameters: {
@@ -6429,6 +6554,7 @@ interface paths {
6429
6554
  };
6430
6555
  rating?: number;
6431
6556
  sessionId: string;
6557
+ token: string;
6432
6558
  /** @enum {string} */
6433
6559
  type: "upvote" | "downvote" | "copy" | "csat" | "nps";
6434
6560
  };
@@ -6472,7 +6598,16 @@ interface paths {
6472
6598
  "application/json": components["schemas"]["Error"];
6473
6599
  };
6474
6600
  };
6475
- /** @description Session deactivated, client token inactive, or origin mismatch */
6601
+ /** @description Invalid client token (when a `token` is supplied) */
6602
+ 401: {
6603
+ headers: {
6604
+ [name: string]: unknown;
6605
+ };
6606
+ content: {
6607
+ "application/json": components["schemas"]["Error"];
6608
+ };
6609
+ };
6610
+ /** @description Session deactivated, client token inactive, or origin not allowed */
6476
6611
  403: {
6477
6612
  headers: {
6478
6613
  [name: string]: unknown;
@@ -6481,7 +6616,7 @@ interface paths {
6481
6616
  "application/json": components["schemas"]["Error"];
6482
6617
  };
6483
6618
  };
6484
- /** @description Session not found */
6619
+ /** @description Session not found (or not owned by the supplied token) */
6485
6620
  404: {
6486
6621
  headers: {
6487
6622
  [name: string]: unknown;
@@ -27031,6 +27166,12 @@ interface paths {
27031
27166
  type: string;
27032
27167
  updatedAt: string;
27033
27168
  userId: string;
27169
+ warnings?: {
27170
+ /** @enum {string} */
27171
+ code: "KEY_RENAMED";
27172
+ from: string;
27173
+ to: string;
27174
+ }[];
27034
27175
  };
27035
27176
  };
27036
27177
  };
@@ -27247,6 +27388,12 @@ interface paths {
27247
27388
  id: string;
27248
27389
  }[];
27249
27390
  recordIds: string[];
27391
+ warnings?: {
27392
+ /** @enum {string} */
27393
+ code: "KEY_RENAMED";
27394
+ from: string;
27395
+ to: string;
27396
+ }[];
27250
27397
  };
27251
27398
  };
27252
27399
  };
@@ -27716,6 +27863,12 @@ interface paths {
27716
27863
  type: string;
27717
27864
  }[];
27718
27865
  success: boolean;
27866
+ warnings?: {
27867
+ /** @enum {string} */
27868
+ code: "KEY_RENAMED";
27869
+ from: string;
27870
+ to: string;
27871
+ }[];
27719
27872
  };
27720
27873
  };
27721
27874
  };
@@ -27920,6 +28073,12 @@ interface paths {
27920
28073
  type: string;
27921
28074
  updatedAt: string;
27922
28075
  userId: string;
28076
+ warnings?: {
28077
+ /** @enum {string} */
28078
+ code: "KEY_RENAMED";
28079
+ from: string;
28080
+ to: string;
28081
+ }[];
27923
28082
  };
27924
28083
  };
27925
28084
  };
@@ -31962,6 +32121,7 @@ interface paths {
31962
32121
  description: string | null;
31963
32122
  id: string;
31964
32123
  isActive: boolean;
32124
+ lastModifiedSource?: string | null;
31965
32125
  name: string;
31966
32126
  organizationId: string | null;
31967
32127
  parametersSchema?: {
@@ -32299,6 +32459,122 @@ interface paths {
32299
32459
  patch?: never;
32300
32460
  trace?: never;
32301
32461
  };
32462
+ "/v1/tools/ensure": {
32463
+ parameters: {
32464
+ query?: never;
32465
+ header?: never;
32466
+ path?: never;
32467
+ cookie?: never;
32468
+ };
32469
+ get?: never;
32470
+ put?: never;
32471
+ /**
32472
+ * Ensure tool (config-as-code converge)
32473
+ * @description Idempotently converge a repo-defined tool definition onto the platform. Identity is name + account scope. Hash-only probes skip the payload in the steady state (a miss is a normal 200 `definitionRequired` response, not an error); full requests create the tool or update it when the canonical content hash differs. The response always carries the server-computed canonical hash. Set dryRun to plan without writing (CI drift gate), and onConflict: "overwrite" to converge over dashboard/API edits. Tools have no version snapshots, so there is no publish option.
32474
+ */
32475
+ post: {
32476
+ parameters: {
32477
+ query?: never;
32478
+ header?: never;
32479
+ path?: never;
32480
+ cookie?: never;
32481
+ };
32482
+ requestBody?: {
32483
+ content: {
32484
+ "application/json": {
32485
+ contentHash?: string;
32486
+ definition?: {
32487
+ config: {
32488
+ [key: string]: unknown;
32489
+ };
32490
+ description: string;
32491
+ name: string;
32492
+ parametersSchema: {
32493
+ [key: string]: unknown;
32494
+ };
32495
+ /** @enum {string} */
32496
+ toolType: "flow" | "custom" | "external" | "graphql" | "mcp" | "local" | "subagent";
32497
+ };
32498
+ dryRun?: boolean;
32499
+ expectedRemoteHash?: string;
32500
+ name: string;
32501
+ /** @enum {string} */
32502
+ onConflict?: "error" | "overwrite";
32503
+ };
32504
+ };
32505
+ };
32506
+ responses: {
32507
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
32508
+ 200: {
32509
+ headers: {
32510
+ [name: string]: unknown;
32511
+ };
32512
+ content: {
32513
+ "application/json": components["schemas"]["ToolEnsureResponse"];
32514
+ };
32515
+ };
32516
+ /** @description Validation error */
32517
+ 400: {
32518
+ headers: {
32519
+ [name: string]: unknown;
32520
+ };
32521
+ content: {
32522
+ "application/json": components["schemas"]["Error"];
32523
+ };
32524
+ };
32525
+ /** @description Unauthorized */
32526
+ 401: {
32527
+ headers: {
32528
+ [name: string]: unknown;
32529
+ };
32530
+ content: {
32531
+ "application/json": components["schemas"]["Error"];
32532
+ };
32533
+ };
32534
+ /** @description Insufficient permissions */
32535
+ 403: {
32536
+ headers: {
32537
+ [name: string]: unknown;
32538
+ };
32539
+ content: {
32540
+ "application/json": components["schemas"]["Error"];
32541
+ };
32542
+ };
32543
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
32544
+ 409: {
32545
+ headers: {
32546
+ [name: string]: unknown;
32547
+ };
32548
+ content: {
32549
+ "application/json": components["schemas"]["ToolEnsureConflict"];
32550
+ };
32551
+ };
32552
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
32553
+ 422: {
32554
+ headers: {
32555
+ [name: string]: unknown;
32556
+ };
32557
+ content: {
32558
+ "application/json": components["schemas"]["ToolEnsureHashMismatch"];
32559
+ };
32560
+ };
32561
+ /** @description Internal server error */
32562
+ 500: {
32563
+ headers: {
32564
+ [name: string]: unknown;
32565
+ };
32566
+ content: {
32567
+ "application/json": components["schemas"]["Error"];
32568
+ };
32569
+ };
32570
+ };
32571
+ };
32572
+ delete?: never;
32573
+ options?: never;
32574
+ head?: never;
32575
+ patch?: never;
32576
+ trace?: never;
32577
+ };
32302
32578
  "/v1/tools/flows/{flowId}/convert-to-tool": {
32303
32579
  parameters: {
32304
32580
  query?: never;
@@ -32343,6 +32619,7 @@ interface paths {
32343
32619
  description: string | null;
32344
32620
  id: string;
32345
32621
  isActive: boolean;
32622
+ lastModifiedSource?: string | null;
32346
32623
  name: string;
32347
32624
  organizationId: string | null;
32348
32625
  parametersSchema?: {
@@ -32418,6 +32695,83 @@ interface paths {
32418
32695
  patch?: never;
32419
32696
  trace?: never;
32420
32697
  };
32698
+ "/v1/tools/pull": {
32699
+ parameters: {
32700
+ query?: never;
32701
+ header?: never;
32702
+ path?: never;
32703
+ cookie?: never;
32704
+ };
32705
+ /**
32706
+ * Pull tool definition (config-as-code)
32707
+ * @description Return the canonical config-as-code definition and provenance for a tool by name — the absorb-drift direction of the ensure protocol. The contentHash is recomputed from the live tool state, so it is accurate even immediately after a dashboard edit.
32708
+ */
32709
+ get: {
32710
+ parameters: {
32711
+ query: {
32712
+ name: string;
32713
+ };
32714
+ header?: never;
32715
+ path?: never;
32716
+ cookie?: never;
32717
+ };
32718
+ requestBody?: never;
32719
+ responses: {
32720
+ /** @description Canonical definition + provenance */
32721
+ 200: {
32722
+ headers: {
32723
+ [name: string]: unknown;
32724
+ };
32725
+ content: {
32726
+ "application/json": components["schemas"]["ToolPullResponse"];
32727
+ };
32728
+ };
32729
+ /** @description Unauthorized */
32730
+ 401: {
32731
+ headers: {
32732
+ [name: string]: unknown;
32733
+ };
32734
+ content: {
32735
+ "application/json": components["schemas"]["Error"];
32736
+ };
32737
+ };
32738
+ /** @description Insufficient permissions */
32739
+ 403: {
32740
+ headers: {
32741
+ [name: string]: unknown;
32742
+ };
32743
+ content: {
32744
+ "application/json": components["schemas"]["Error"];
32745
+ };
32746
+ };
32747
+ /** @description No tool with that name in the account scope */
32748
+ 404: {
32749
+ headers: {
32750
+ [name: string]: unknown;
32751
+ };
32752
+ content: {
32753
+ "application/json": components["schemas"]["Error"];
32754
+ };
32755
+ };
32756
+ /** @description Internal server error */
32757
+ 500: {
32758
+ headers: {
32759
+ [name: string]: unknown;
32760
+ };
32761
+ content: {
32762
+ "application/json": components["schemas"]["Error"];
32763
+ };
32764
+ };
32765
+ };
32766
+ };
32767
+ put?: never;
32768
+ post?: never;
32769
+ delete?: never;
32770
+ options?: never;
32771
+ head?: never;
32772
+ patch?: never;
32773
+ trace?: never;
32774
+ };
32421
32775
  "/v1/tools/sandbox/cf-sandbox/deploy": {
32422
32776
  parameters: {
32423
32777
  query?: never;
@@ -32865,6 +33219,7 @@ interface paths {
32865
33219
  description: string | null;
32866
33220
  id: string;
32867
33221
  isActive: boolean;
33222
+ lastModifiedSource?: string | null;
32868
33223
  name: string;
32869
33224
  organizationId: string | null;
32870
33225
  parametersSchema?: {
@@ -32957,6 +33312,7 @@ interface paths {
32957
33312
  description: string | null;
32958
33313
  id: string;
32959
33314
  isActive: boolean;
33315
+ lastModifiedSource?: string | null;
32960
33316
  name: string;
32961
33317
  organizationId: string | null;
32962
33318
  parametersSchema?: {
@@ -33590,6 +33946,7 @@ interface paths {
33590
33946
  enableAgentSkills: boolean;
33591
33947
  enableChromeSurface: boolean;
33592
33948
  enableDashboardAssistant: boolean;
33949
+ enableRuntypeApps: boolean;
33593
33950
  productGeneratorModel: string;
33594
33951
  };
33595
33952
  id: string;
@@ -34245,6 +34602,8 @@ interface components {
34245
34602
  lastModifiedSource: string | null;
34246
34603
  updatedAt: string | null;
34247
34604
  versionId: string | null;
34605
+ /** @description Present only when a raw tool_… reference could not be emitted as a portable tool:<name> (the tool was deleted, or its name is shadowed by an older same-named tool). Those references are left as raw ids, which the ensure surface rejects; each warning explains how to fix it. */
34606
+ warnings?: string[];
34248
34607
  };
34249
34608
  AgentSSEEvent: {
34250
34609
  agentId: string;
@@ -35049,6 +35408,7 @@ interface components {
35049
35408
  };
35050
35409
  /** @enum {string} */
35051
35410
  type: "step_complete";
35411
+ unresolvedVariables?: string[];
35052
35412
  } | {
35053
35413
  error: string;
35054
35414
  executionId?: string;
@@ -35383,6 +35743,8 @@ interface components {
35383
35743
  lastModifiedSource: string | null;
35384
35744
  updatedAt: string | null;
35385
35745
  versionId: string | null;
35746
+ /** @description Present only when a raw tool_… reference could not be emitted as a portable tool:<name> (the tool was deleted, or its name is shadowed by an older same-named tool). Those references are left as raw ids, which the ensure surface rejects; each warning explains how to fix it. */
35747
+ warnings?: string[];
35386
35748
  };
35387
35749
  FlowSSEEvent: {
35388
35750
  executionContext?: {
@@ -35530,6 +35892,7 @@ interface components {
35530
35892
  };
35531
35893
  /** @enum {string} */
35532
35894
  type: "step_complete";
35895
+ unresolvedVariables?: string[];
35533
35896
  } | {
35534
35897
  error: string;
35535
35898
  executionId?: string;
@@ -35781,6 +36144,58 @@ interface components {
35781
36144
  skillVersionId: string;
35782
36145
  status: string;
35783
36146
  };
36147
+ ToolEnsureConflict: {
36148
+ /** @enum {string} */
36149
+ code: "external_modification" | "remote_changed";
36150
+ currentHash?: string | null;
36151
+ error: string;
36152
+ lastModifiedSource?: string;
36153
+ modifiedAt?: string | null;
36154
+ };
36155
+ ToolEnsureHashMismatch: {
36156
+ /** @enum {string} */
36157
+ code: "content_hash_mismatch";
36158
+ /** @description The server-computed canonical hash of the submitted definition. */
36159
+ contentHash: string;
36160
+ error: string;
36161
+ };
36162
+ ToolEnsureResponse: {
36163
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
36164
+ contentHash: string;
36165
+ /** @enum {string} */
36166
+ result: "unchanged" | "created" | "updated";
36167
+ toolId: string;
36168
+ } | {
36169
+ /** @enum {string} */
36170
+ result: "definitionRequired";
36171
+ } | {
36172
+ changedKeys: string[];
36173
+ /** @enum {string} */
36174
+ changes: "none" | "create" | "update";
36175
+ contentHash: string;
36176
+ remoteHash?: string;
36177
+ /** @enum {string} */
36178
+ result: "plan";
36179
+ toolId?: string;
36180
+ };
36181
+ ToolPullResponse: {
36182
+ contentHash: string;
36183
+ definition: {
36184
+ config: {
36185
+ [key: string]: unknown;
36186
+ };
36187
+ description: string;
36188
+ name: string;
36189
+ parametersSchema: {
36190
+ [key: string]: unknown;
36191
+ };
36192
+ /** @enum {string} */
36193
+ toolType: "flow" | "custom" | "external" | "graphql" | "mcp" | "local" | "subagent";
36194
+ };
36195
+ lastModifiedSource: string | null;
36196
+ toolId: string;
36197
+ updatedAt: string | null;
36198
+ };
35784
36199
  UpdateUserProfileResponse: {
35785
36200
  email?: string;
35786
36201
  firstName?: string;
@@ -37081,6 +37496,7 @@ interface FlowAttachment {
37081
37496
  order: number;
37082
37497
  }
37083
37498
  type RuntypeRecord = paths['/v1/records/{id}']['get']['responses'][200]['content']['application/json'];
37499
+ type RecordWriteResponse = paths['/v1/records']['post']['responses'][201]['content']['application/json'];
37084
37500
  type RecordListItem = paths['/v1/records']['get']['responses'][200]['content']['application/json']['data'][number];
37085
37501
  interface ApiKey {
37086
37502
  id: string;
@@ -37185,6 +37601,83 @@ interface BulkEditResult {
37185
37601
  interface BulkEditResponse {
37186
37602
  data: BulkEditResult[];
37187
37603
  recordIds?: number[];
37604
+ /** Deduplicated metadata key-rename notices across the edited records. */
37605
+ warnings?: {
37606
+ code: 'KEY_RENAMED';
37607
+ from: string;
37608
+ to: string;
37609
+ }[];
37610
+ }
37611
+ /** A single unified step-level execution result for a record. */
37612
+ interface RecordStepResult {
37613
+ id: string;
37614
+ userId: string;
37615
+ organizationId: string | null;
37616
+ batchExecutionId: string | null;
37617
+ executionSessionId: string | null;
37618
+ flowId: string | null;
37619
+ flowVersionId: string | null;
37620
+ recordId: string | null;
37621
+ recordName: string | null;
37622
+ recordMetadata?: JsonValue | null;
37623
+ stepId: string | null;
37624
+ stepType: string;
37625
+ stepName: string;
37626
+ order: number | null;
37627
+ status: string;
37628
+ startedAt: string | null;
37629
+ completedAt: string | null;
37630
+ durationMs: number | null;
37631
+ outputPreview: string | null;
37632
+ stepConfig?: JsonValue | null;
37633
+ inputVariables?: JsonValue | null;
37634
+ resolvedPrompt?: string | null;
37635
+ modelUsed?: string | null;
37636
+ promptTokens?: number | null;
37637
+ completionTokens?: number | null;
37638
+ totalTokens?: number | null;
37639
+ estimatedCost?: string | null;
37640
+ errorMessage?: string | null;
37641
+ retryCount?: number | null;
37642
+ createdAt: string;
37643
+ }
37644
+ /** Query parameters for {@link RecordsEndpoint.getStepResults}. */
37645
+ interface RecordStepResultsParams {
37646
+ flowId?: string;
37647
+ batchId?: string;
37648
+ status?: string;
37649
+ from?: string;
37650
+ to?: string;
37651
+ sortBy?: string;
37652
+ sortOrder?: 'asc' | 'desc';
37653
+ limit?: number;
37654
+ offset?: number;
37655
+ }
37656
+ /** Paginated response from {@link RecordsEndpoint.getStepResults}. */
37657
+ interface RecordStepResultsResponse {
37658
+ data: RecordStepResult[];
37659
+ pagination: {
37660
+ limit: number;
37661
+ offset: number;
37662
+ returned: number;
37663
+ hasMore: boolean;
37664
+ };
37665
+ }
37666
+ /** Per-model cost line within a {@link RecordCostAggregation}. */
37667
+ interface RecordCostModelBreakdown {
37668
+ model: string;
37669
+ cost: number;
37670
+ tokens: number;
37671
+ count: number;
37672
+ }
37673
+ /** Aggregated cost breakdown for a record from {@link RecordsEndpoint.getCosts}. */
37674
+ interface RecordCostAggregation {
37675
+ totalCost: number;
37676
+ totalTokens: number;
37677
+ promptTokens: number;
37678
+ completionTokens: number;
37679
+ executionCount: number;
37680
+ modelBreakdown: RecordCostModelBreakdown[];
37188
37681
  }
37189
37682
  type ProviderApiKey = paths['/v1/provider-keys']['get']['responses'][200]['content']['application/json']['providerKeys'][number];
37190
37683
  /**
@@ -38089,6 +38582,13 @@ interface FlowPullResult {
38089
38582
  lastModifiedSource: string | null;
38090
38583
  updatedAt: string | null;
38091
38584
  versionId: string | null;
38585
+ /**
38586
+ * Present only when a raw `tool_…` reference could not be emitted as a
38587
+ * portable `tool:<name>` (the tool was deleted, or its name is shadowed by an
38588
+ * older same-named tool). Those references are left as raw ids — which
38589
+ * `defineFlow`/`ensure` reject — so each warning explains how to fix it.
38590
+ */
38591
+ warnings?: string[];
38092
38592
  }
38093
38593
  /** A 409 from the ensure protocol (external_modification or remote_changed). */
38094
38594
  declare class FlowEnsureConflictError extends Error {
@@ -39659,6 +40159,13 @@ interface AgentPullResult {
39659
40159
  lastModifiedSource: string | null;
39660
40160
  updatedAt: string | null;
39661
40161
  versionId: string | null;
40162
+ /**
40163
+ * Present only when a raw `tool_…` reference could not be emitted as a
40164
+ * portable `tool:<name>` (the tool was deleted, or its name is shadowed by an
40165
+ * older same-named tool). Those references are left as raw ids — which
40166
+ * `defineAgent`/`ensure` reject — so each warning explains how to fix it.
40167
+ */
40168
+ warnings?: string[];
39662
40169
  }
39663
40170
  /** A 409 from the ensure protocol (external_modification or remote_changed). */
39664
40171
  declare class AgentEnsureConflictError extends Error {
@@ -39715,6 +40222,190 @@ declare class AgentsNamespace {
39715
40222
  private request;
39716
40223
  }
39717
40224
 
40225
+ /**
40226
+ * Tool config-as-code: `defineTool`, `tools.ensure`, `tools.pull`.
40227
+ *
40228
+ * The deploy-time convergence postcondition for saved tools: "make the
40229
+ * platform's definition of this tool match this object; no-op if it already
40230
+ * does." Identity is name + account scope (the API key's org, else personal);
40231
+ * environment is whichever API the client points at. `ensure` never deletes,
40232
+ * and renaming a definition orphans the old tool and creates a new one.
40233
+ *
40234
+ * Wire protocol (POST /v1/tools/ensure — APQ-shaped, both APQ scars fixed):
40235
+ * 1. Hash-only probe `{ name, contentHash }`. A match is
40236
+ * `{ result: 'unchanged' }`; a miss is a NORMAL 200
40237
+ * `{ result: 'definitionRequired' }`, never an error.
40238
+ * 2. On a miss, retry with the full `definition`. The server recomputes the
40239
+ * canonical hash itself and returns it on every response — this SDK
40240
+ * echoes the server's hash (memoized per client instance) rather than
40241
+ * trusting its own serialization.
40242
+ *
40243
+ * Unlike agents/flows, tools have NO version snapshots: there is no
40244
+ * `release: 'publish'` option and no `versionId` on the result.
40245
+ *
40246
+ * The content hash is the canonical tool hash (`computeToolContentHash` —
40247
+ * mirrored from `packages/shared/src/utils/tool-content-hash.ts`; this package
40248
+ * is dependency-free by convention) over `{ toolType, description,
40249
+ * parametersSchema, config }`. `name` is identity, not content, so it is
40250
+ * excluded from the hash.
40251
+ *
40252
+ * See docs/adr/0003-agent-config-as-code-ensure.md for the design rationale.
40253
+ */
40254
+
40255
+ /** Canonical normalized form of a tool definition (name excluded — identity). */
40256
+ declare function normalizeToolDefinition(definition: ToolContentInput): {
40257
+ toolType: string;
40258
+ description?: string;
40259
+ parametersSchema: Record<string, unknown>;
40260
+ config: Record<string, unknown>;
40261
+ };
40262
+ /** SHA-256 (hex) over the canonical normalized tool definition. */
40263
+ declare function computeToolContentHash(definition: ToolContentInput): Promise<string>;
40264
+ interface ToolContentInput {
40265
+ description?: string | null;
40266
+ toolType: string;
40267
+ parametersSchema?: Record<string, unknown> | null;
40268
+ config?: Record<string, unknown> | null;
40269
+ }
40270
+ /** The tool types `ensure` accepts (mirrors the server's CreateToolSchema). */
40271
+ type ToolDefinitionType = 'flow' | 'custom' | 'external' | 'graphql' | 'mcp' | 'local' | 'subagent';
40272
+ /** `defineTool` input: identity (name) + the convergeable content fields. */
40273
+ interface DefineToolInput {
40274
+ name: string;
40275
+ description: string;
40276
+ toolType: ToolDefinitionType;
40277
+ parametersSchema: Record<string, unknown>;
40278
+ config: Record<string, unknown>;
40279
+ }
40280
+ /** The canonical (wire) definition produced by `defineTool`. */
40281
+ interface ToolDefinition {
40282
+ name: string;
40283
+ description: string;
40284
+ toolType: ToolDefinitionType;
40285
+ parametersSchema: Record<string, unknown>;
40286
+ config: Record<string, unknown>;
40287
+ }
40288
+ /**
40289
+ * Pure-local declarative constructor for a tool definition. No I/O. Validates
40290
+ * structure and rejects unknown fields. Deep validation (custom-tool code
40291
+ * preflight, {{secret:KEY}} reference rules) happens server-side at ensure
40292
+ * time, mirroring the create/update routes.
40293
+ *
40294
+ * @example
40295
+ * ```typescript
40296
+ * const weather = defineTool({
40297
+ * name: 'Weather Lookup',
40298
+ * description: 'Fetch the current weather for a city',
40299
+ * toolType: 'external',
40300
+ * parametersSchema: {
40301
+ * type: 'object',
40302
+ * properties: { city: { type: 'string' } },
40303
+ * required: ['city'],
40304
+ * },
40305
+ * config: { url: 'https://api.example.com/weather?q={{city}}', method: 'GET' },
40306
+ * })
40307
+ * ```
40308
+ */
40309
+ declare function defineTool(input: DefineToolInput): ToolDefinition;
40310
+ interface EnsureToolOptions {
40311
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
40312
+ dryRun?: boolean;
40313
+ /**
40314
+ * What to do when the tool's last write came from the dashboard/API rather
40315
+ * than ensure. Default 'error' (HTTP 409 → ToolEnsureConflictError).
40316
+ */
40317
+ onConflict?: 'error' | 'overwrite';
40318
+ /**
40319
+ * TOCTOU guard binding a dry run to its apply: the write only proceeds if
40320
+ * the remote still hashes to this value (409 remote_changed otherwise).
40321
+ */
40322
+ expectedRemoteHash?: string;
40323
+ /** Implies dryRun; throws ToolDriftError unless the plan is 'none'. */
40324
+ expectNoChanges?: boolean;
40325
+ }
40326
+ interface EnsureToolConverged {
40327
+ result: 'unchanged' | 'created' | 'updated';
40328
+ toolId: string;
40329
+ /** The server-computed canonical hash (echo this — never your own). */
40330
+ contentHash: string;
40331
+ }
40332
+ interface EnsureToolPlan {
40333
+ result: 'plan';
40334
+ changes: 'none' | 'create' | 'update';
40335
+ changedKeys: string[];
40336
+ contentHash: string;
40337
+ remoteHash?: string;
40338
+ toolId?: string;
40339
+ }
40340
+ type EnsureToolResult = EnsureToolConverged | EnsureToolPlan;
40341
+ interface ToolPullResult {
40342
+ toolId: string;
40343
+ definition: ToolDefinition;
40344
+ contentHash: string;
40345
+ lastModifiedSource: string | null;
40346
+ updatedAt: string | null;
40347
+ }
40348
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
40349
+ declare class ToolEnsureConflictError extends Error {
40350
+ readonly code: 'external_modification' | 'remote_changed';
40351
+ readonly lastModifiedSource?: string;
40352
+ readonly modifiedAt?: string | null;
40353
+ readonly currentHash?: string | null;
40354
+ constructor(body: {
40355
+ error?: string;
40356
+ code: 'external_modification' | 'remote_changed';
40357
+ lastModifiedSource?: string;
40358
+ modifiedAt?: string | null;
40359
+ currentHash?: string | null;
40360
+ });
40361
+ }
40362
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
40363
+ declare class ToolDriftError extends Error {
40364
+ readonly plan: EnsureToolPlan;
40365
+ constructor(plan: EnsureToolPlan);
40366
+ }
40367
+
40368
+ /**
40369
+ * ToolsNamespace — config-as-code operations for saved tools.
40370
+ *
40371
+ * `tools.ensure` is the deploy-time, non-executing converge (create-or-update a
40372
+ * tool by name + account scope); `tools.pull` is the absorb-drift direction.
40373
+ * Both delegate to the implementation in `tools-ensure.ts`.
40374
+ */
40375
+
40376
+ declare class ToolsNamespace {
40377
+ private getClient;
40378
+ constructor(getClient: () => RuntypeClient$1);
40379
+ /**
40380
+ * Idempotently converge a `defineTool` definition onto the platform.
40381
+ * Hash-first: the steady state is one tiny probe request. Creates or updates
40382
+ * the saved tool; never deletes. Identity is name + account scope.
40383
+ *
40384
+ * @example
40385
+ * ```typescript
40386
+ * const weather = defineTool({
40387
+ * name: 'Weather Lookup',
40388
+ * description: 'Fetch the current weather for a city',
40389
+ * toolType: 'external',
40390
+ * parametersSchema: { type: 'object', properties: { city: { type: 'string' } } },
40391
+ * config: { url: 'https://api.example.com/weather', method: 'GET' },
40392
+ * })
40393
+ *
40394
+ * // Converge (CI/deploy).
40395
+ * const result = await Runtype.tools.ensure(weather)
40396
+ *
40397
+ * // PR drift gate.
40398
+ * await Runtype.tools.ensure(weather, { expectNoChanges: true })
40399
+ * ```
40400
+ */
40401
+ ensure(definition: ToolDefinition, options?: EnsureToolOptions): Promise<EnsureToolResult>;
40402
+ /**
40403
+ * Pull the canonical definition + provenance for a tool by name — the
40404
+ * absorb-drift direction of the ensure protocol.
40405
+ */
40406
+ pull(name: string): Promise<ToolPullResult>;
40407
+ }
40408
+
39718
40409
  /**
39719
40410
  * Runtype - The unified SDK client for building and executing flows, batches, evals, and prompts
39720
40411
  *
@@ -39990,6 +40681,32 @@ declare class Runtype {
39990
40681
  * ```
39991
40682
  */
39992
40683
  static get agents(): AgentsNamespace;
40684
+ /**
40685
+ * Tools namespace - Tool config-as-code (define / ensure / pull)
40686
+ *
40687
+ * @example
40688
+ * ```typescript
40689
+ * import { defineTool, Runtype } from '@runtypelabs/sdk'
40690
+ *
40691
+ * const weather = defineTool({
40692
+ * name: 'Weather Lookup',
40693
+ * description: 'Fetch the current weather for a city',
40694
+ * toolType: 'external',
40695
+ * parametersSchema: { type: 'object', properties: { city: { type: 'string' } } },
40696
+ * config: { url: 'https://api.example.com/weather', method: 'GET' },
40697
+ * })
40698
+ *
40699
+ * // Converge at deploy time (idempotent; one tiny probe in steady state)
40700
+ * await Runtype.tools.ensure(weather)
40701
+ *
40702
+ * // CI drift gate
40703
+ * await Runtype.tools.ensure(weather, { expectNoChanges: true })
40704
+ *
40705
+ * // Absorb a dashboard edit back into the repo
40706
+ * const { definition } = await Runtype.tools.pull('Weather Lookup')
40707
+ * ```
40708
+ */
40709
+ static get tools(): ToolsNamespace;
39993
40710
  }
39994
40711
 
39995
40712
  /**
@@ -40481,11 +41198,11 @@ declare class RecordsEndpoint {
40481
41198
  /**
40482
41199
  * Create a new record
40483
41200
  */
40484
- create(data: CreateRecordRequest): Promise<RuntypeRecord>;
41201
+ create(data: CreateRecordRequest): Promise<RecordWriteResponse>;
40485
41202
  /**
40486
41203
  * Update an existing record
40487
41204
  */
40488
- update(id: string, data: Partial<CreateRecordRequest>): Promise<RuntypeRecord>;
41205
+ update(id: string, data: Partial<CreateRecordRequest>): Promise<RecordWriteResponse>;
40489
41206
  /**
40490
41207
  * Delete a record
40491
41208
  */
@@ -40511,6 +41228,15 @@ declare class RecordsEndpoint {
40511
41228
  fromDate?: string;
40512
41229
  toDate?: string;
40513
41230
  }): Promise<any[]>;
41231
+ /**
41232
+ * Get unified step-level execution results for a record, with filtering and
41233
+ * pagination.
41234
+ */
41235
+ getStepResults(id: string, params?: RecordStepResultsParams): Promise<RecordStepResultsResponse>;
41236
+ /**
41237
+ * Get the aggregated cost breakdown (by model) for a record's executions.
41238
+ */
41239
+ getCosts(id: string): Promise<RecordCostAggregation>;
40514
41240
  /**
40515
41241
  * Delete a specific result for a record
40516
41242
  */
@@ -41850,6 +42576,20 @@ type RunTaskOnContextNotice = (event: RunTaskContextNoticeEvent) => void | Promi
41850
42576
  /**
41851
42577
  * Options for `agents.runTask()`
41852
42578
  */
42579
+ /**
42580
+ * Storage seam for hot-tail tool-output offloads. Given a large tool result
42581
+ * the SDK has already decided to offload (above its inline threshold), the
42582
+ * recorder persists the content however it likes and returns the reference
42583
+ * string to splice into the send view in place of the raw output. Return
42584
+ * `undefined` to decline and let the SDK fall back to its built-in store.
42585
+ */
42586
+ type RunTaskOffloadRecorder = (details: {
42587
+ toolCallId: string;
42588
+ toolName: string;
42589
+ content: string;
42590
+ }) => {
42591
+ reference: string;
42592
+ } | undefined;
41853
42593
  interface RunTaskOptions {
41854
42594
  /** The user message / task instruction for the agent */
41855
42595
  message: string;
@@ -41902,6 +42642,18 @@ interface RunTaskOptions {
41902
42642
  onContextNotice?: RunTaskOnContextNotice;
41903
42643
  /** Saved workflow state to seed a resumed or restarted marathon run */
41904
42644
  resumeState?: RunTaskResumeState;
42645
+ /**
42646
+ * Optional storage seam for hot-tail tool-output offloads. When supplied,
42647
+ * `offloadToolResult` delegates persistence to the recorder instead of the
42648
+ * built-in `.runtype/marathons/<slug>/tool-outputs/` fallback, and returns
42649
+ * the recorder's reference in place of the file-pointer marker. The CLI
42650
+ * backs this with its content-addressed ledger store so the 500–100k char
42651
+ * band becomes a first-class ledger citizen (content-addressed, hashed,
42652
+ * `read_offloaded_output`-resolvable, deduped). Returning `undefined` (or
42653
+ * throwing) falls back to the built-in store. A future server-side artifact
42654
+ * upload plugs into this same seam.
42655
+ */
42656
+ offloadRecorder?: RunTaskOffloadRecorder;
41905
42657
  /** How tool results are stored in message history for continuation.
41906
42658
  * 'hot-tail' (default): recent results inline, older offloaded to disk.
41907
42659
  * 'observation-mask': recent results inline, older replaced with placeholder.
@@ -44330,4 +45082,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
44330
45082
  declare function getDefaultPlanPath(taskName: string): string;
44331
45083
  declare function sanitizeTaskSlug(taskName: string): string;
44332
45084
 
44333
- export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceListParams, SurfacesEndpoint, type TextContentPart, type Tool, type ToolConfig, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, definePlaybook, deployWorkflow, ensureDefaultWorkflowHooks, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };
45085
+ export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentDefinition, type AgentDefinitionConfig, AgentDriftError, AgentEnsureConflictError, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentPullResult, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentStreamEvent, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, type AgentVersionDetail, type AgentVersionListItem, type AgentVersionPublishResponse, AgentVersionsEndpoint, type AgentVersionsListResponse, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type App, type AppManifest, type AppVersion, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, AppsEndpoint, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, BillingEndpoint, type BillingSpendAnalyticsParams, type BindSkillInput, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientToolDefinition, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type Conversation, type ConversationListItem, type ConversationListParams, type ConversationMessage, type ConversationSource, ConversationsEndpoint, type ConversationsListResponse, type CreateApiKeyRequest, type CreateAppRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateConversationRequest, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateScheduleRequest, type CreateSecretRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, type DefineAgentInput, type DefineFlowInput, type DefineToolInput, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DiscoveredModel, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchEvent, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type EnsureAgentConverged, type EnsureAgentOptions, type EnsureAgentPlan, type EnsureAgentResult, type EnsureFlowConverged, type EnsureFlowOptions, type EnsureFlowPlan, type EnsureFlowResult, type EnsureToolConverged, type EnsureToolOptions, type EnsureToolPlan, type EnsureToolResult, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalAgentContext, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbackTrigger, type FallbackTriggerType, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FieldFormat, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowDefinition, type FlowDefinitionStep, FlowDriftError, FlowEnsureConflictError, type FlowErrorEvent, type FlowFallback, type FlowListItem, type FlowPausedEvent, type FlowPullResult, FlowResult, type FlowStartEvent, type FlowStep, type FlowStepDefinition, type FlowStepType, FlowStepsEndpoint, type FlowStreamEvent, type FlowSummary, type FlowToolConfig, type FlowValidationClient, type FlowValidationIssue, type FlowValidationResult, type FlowVersionDetail, type FlowVersionListItem, type FlowVersionPublishResponse, FlowVersionsEndpoint, type FlowVersionsListResponse, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type Integration, type IntegrationTool, IntegrationsEndpoint, type IntegrationsListResponse, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LEDGER_ARTIFACT_LINE_PREFIX, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type LogEntry, type LogQueryParams, type LogQueryResponse, type LogQueryResult, type LogStatsParams, type LogStatsResponse, type LogStatsResult, LogsEndpoint, type Message$1 as Message, type MessageContent, type MessageFallback, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ProviderKeyModel, ProviderKeysEndpoint, type ReasoningConfig, type ReasoningContentPart, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordCostAggregation, type RecordCostModelBreakdown, type RecordFilter, type RecordFilterCondition, type RecordFilterGroup, type RecordFilterOperator, type RecordListItem, type RecordListParams, type RecordStepResult, type RecordStepResultsParams, type RecordStepResultsResponse, type RecordWriteResponse, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContextSummaryEntry, type RunTaskContinuation, type RunTaskOffloadRecorder, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeSubagentToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, type AgentSkillBinding as RuntypeAgentSkillBinding, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type Skill as RuntypeSkill, type SkillCapabilities as RuntypeSkillCapabilities, type SkillFrontmatter as RuntypeSkillFrontmatter, type SkillManifest as RuntypeSkillManifest, type SkillProposal as RuntypeSkillProposal, type SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, type SkillVersion as RuntypeSkillVersion, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, type Schedule, type ScheduleExecutionOptions, type ScheduleListParams, type ScheduleMessage, type ScheduleMessageSet, type ScheduleMessages, type ScheduleMutationResponse, type ScheduleRun, type ScheduleRunNowResponse, type ScheduleStatusResponse, type ScheduleTarget, type ScheduleTrigger, SchedulesEndpoint, type SearchStepConfig$1 as SearchStepConfig, type Secret, type SecretCheckResponse, type SecretDeleteResponse, type SecretSetupUrlRequest, type SecretSetupUrlResponse, SecretsEndpoint, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type SkillListPage, type SkillListPagination, type SkillListParams, type SkillManifestInput, type SkillMarkdownInput, type SkillOrigin, type SkillProposalStatus, SkillProposalsNamespace, type SkillStatus, type SkillTrustLevel, type SkillVersionStatus, type SkillWithVersion, type SkillWriteInput, SkillsNamespace, type SlackInstallRequest, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type StreamEventOf, type SubagentToolConfig, type Surface, type SurfaceListParams, SurfacesEndpoint, type TextContentPart, type Tool, type ToolConfig, type ToolDefinition, type ToolDefinitionType, ToolDriftError, ToolEnsureConflictError, type ToolPullResult, type ToolWithValidation, type ToolsConfig, ToolsEndpoint, ToolsNamespace, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateAppRequest, type UpdateClientTokenRequest, type UpdateConversationRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateScheduleRequest, type UpdateSecretRequest, type UpdateToolRequest, type UpdatedFlow, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type VersionType, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowCompileDeps, type WorkflowCompletionCriteriaConfig, type WorkflowConfig, type WorkflowConfigFactory, type WorkflowContext, type WorkflowDefinition, type WorkflowHookEntry, type WorkflowHookKind, type WorkflowHookRef, type WorkflowHookSignatures, type WorkflowMilestoneConfig, type WorkflowPhase, type WorkflowPolicyConfig, type WorkflowRecoveryConfig, type WorkflowSlot, type WorkflowStallPolicy, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildEmptySessionNudge, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildPolicyGuidance, buildSendViewOffloadMarker, compileWorkflowConfig, computeAgentContentHash, computeFlowContentHash, computeToolContentHash, createClient, createExternalTool, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineFlow, definePlaybook, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isWorkflowHookRef, listWorkflowHooks, normalizeAgentDefinition, normalizeCandidatePath, normalizeToolDefinition, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, processStream, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, streamEvents, unregisterWorkflowHook };