@runtypelabs/sdk 4.11.0 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -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;
@@ -31962,6 +32087,7 @@ interface paths {
31962
32087
  description: string | null;
31963
32088
  id: string;
31964
32089
  isActive: boolean;
32090
+ lastModifiedSource?: string | null;
31965
32091
  name: string;
31966
32092
  organizationId: string | null;
31967
32093
  parametersSchema?: {
@@ -32299,6 +32425,122 @@ interface paths {
32299
32425
  patch?: never;
32300
32426
  trace?: never;
32301
32427
  };
32428
+ "/v1/tools/ensure": {
32429
+ parameters: {
32430
+ query?: never;
32431
+ header?: never;
32432
+ path?: never;
32433
+ cookie?: never;
32434
+ };
32435
+ get?: never;
32436
+ put?: never;
32437
+ /**
32438
+ * Ensure tool (config-as-code converge)
32439
+ * @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.
32440
+ */
32441
+ post: {
32442
+ parameters: {
32443
+ query?: never;
32444
+ header?: never;
32445
+ path?: never;
32446
+ cookie?: never;
32447
+ };
32448
+ requestBody?: {
32449
+ content: {
32450
+ "application/json": {
32451
+ contentHash?: string;
32452
+ definition?: {
32453
+ config: {
32454
+ [key: string]: unknown;
32455
+ };
32456
+ description: string;
32457
+ name: string;
32458
+ parametersSchema: {
32459
+ [key: string]: unknown;
32460
+ };
32461
+ /** @enum {string} */
32462
+ toolType: "flow" | "custom" | "external" | "graphql" | "mcp" | "local" | "subagent";
32463
+ };
32464
+ dryRun?: boolean;
32465
+ expectedRemoteHash?: string;
32466
+ name: string;
32467
+ /** @enum {string} */
32468
+ onConflict?: "error" | "overwrite";
32469
+ };
32470
+ };
32471
+ };
32472
+ responses: {
32473
+ /** @description Converge result: unchanged | created | updated | definitionRequired (hash miss — retry with the full definition) | plan (dryRun) */
32474
+ 200: {
32475
+ headers: {
32476
+ [name: string]: unknown;
32477
+ };
32478
+ content: {
32479
+ "application/json": components["schemas"]["ToolEnsureResponse"];
32480
+ };
32481
+ };
32482
+ /** @description Validation error */
32483
+ 400: {
32484
+ headers: {
32485
+ [name: string]: unknown;
32486
+ };
32487
+ content: {
32488
+ "application/json": components["schemas"]["Error"];
32489
+ };
32490
+ };
32491
+ /** @description Unauthorized */
32492
+ 401: {
32493
+ headers: {
32494
+ [name: string]: unknown;
32495
+ };
32496
+ content: {
32497
+ "application/json": components["schemas"]["Error"];
32498
+ };
32499
+ };
32500
+ /** @description Insufficient permissions */
32501
+ 403: {
32502
+ headers: {
32503
+ [name: string]: unknown;
32504
+ };
32505
+ content: {
32506
+ "application/json": components["schemas"]["Error"];
32507
+ };
32508
+ };
32509
+ /** @description Conflict: external_modification (last write was not ensure; pass onConflict: "overwrite") or remote_changed (expectedRemoteHash guard) */
32510
+ 409: {
32511
+ headers: {
32512
+ [name: string]: unknown;
32513
+ };
32514
+ content: {
32515
+ "application/json": components["schemas"]["ToolEnsureConflict"];
32516
+ };
32517
+ };
32518
+ /** @description Submitted contentHash does not match the server-recomputed canonical hash */
32519
+ 422: {
32520
+ headers: {
32521
+ [name: string]: unknown;
32522
+ };
32523
+ content: {
32524
+ "application/json": components["schemas"]["ToolEnsureHashMismatch"];
32525
+ };
32526
+ };
32527
+ /** @description Internal server error */
32528
+ 500: {
32529
+ headers: {
32530
+ [name: string]: unknown;
32531
+ };
32532
+ content: {
32533
+ "application/json": components["schemas"]["Error"];
32534
+ };
32535
+ };
32536
+ };
32537
+ };
32538
+ delete?: never;
32539
+ options?: never;
32540
+ head?: never;
32541
+ patch?: never;
32542
+ trace?: never;
32543
+ };
32302
32544
  "/v1/tools/flows/{flowId}/convert-to-tool": {
32303
32545
  parameters: {
32304
32546
  query?: never;
@@ -32343,6 +32585,7 @@ interface paths {
32343
32585
  description: string | null;
32344
32586
  id: string;
32345
32587
  isActive: boolean;
32588
+ lastModifiedSource?: string | null;
32346
32589
  name: string;
32347
32590
  organizationId: string | null;
32348
32591
  parametersSchema?: {
@@ -32418,6 +32661,83 @@ interface paths {
32418
32661
  patch?: never;
32419
32662
  trace?: never;
32420
32663
  };
32664
+ "/v1/tools/pull": {
32665
+ parameters: {
32666
+ query?: never;
32667
+ header?: never;
32668
+ path?: never;
32669
+ cookie?: never;
32670
+ };
32671
+ /**
32672
+ * Pull tool definition (config-as-code)
32673
+ * @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.
32674
+ */
32675
+ get: {
32676
+ parameters: {
32677
+ query: {
32678
+ name: string;
32679
+ };
32680
+ header?: never;
32681
+ path?: never;
32682
+ cookie?: never;
32683
+ };
32684
+ requestBody?: never;
32685
+ responses: {
32686
+ /** @description Canonical definition + provenance */
32687
+ 200: {
32688
+ headers: {
32689
+ [name: string]: unknown;
32690
+ };
32691
+ content: {
32692
+ "application/json": components["schemas"]["ToolPullResponse"];
32693
+ };
32694
+ };
32695
+ /** @description Unauthorized */
32696
+ 401: {
32697
+ headers: {
32698
+ [name: string]: unknown;
32699
+ };
32700
+ content: {
32701
+ "application/json": components["schemas"]["Error"];
32702
+ };
32703
+ };
32704
+ /** @description Insufficient permissions */
32705
+ 403: {
32706
+ headers: {
32707
+ [name: string]: unknown;
32708
+ };
32709
+ content: {
32710
+ "application/json": components["schemas"]["Error"];
32711
+ };
32712
+ };
32713
+ /** @description No tool with that name in the account scope */
32714
+ 404: {
32715
+ headers: {
32716
+ [name: string]: unknown;
32717
+ };
32718
+ content: {
32719
+ "application/json": components["schemas"]["Error"];
32720
+ };
32721
+ };
32722
+ /** @description Internal server error */
32723
+ 500: {
32724
+ headers: {
32725
+ [name: string]: unknown;
32726
+ };
32727
+ content: {
32728
+ "application/json": components["schemas"]["Error"];
32729
+ };
32730
+ };
32731
+ };
32732
+ };
32733
+ put?: never;
32734
+ post?: never;
32735
+ delete?: never;
32736
+ options?: never;
32737
+ head?: never;
32738
+ patch?: never;
32739
+ trace?: never;
32740
+ };
32421
32741
  "/v1/tools/sandbox/cf-sandbox/deploy": {
32422
32742
  parameters: {
32423
32743
  query?: never;
@@ -32865,6 +33185,7 @@ interface paths {
32865
33185
  description: string | null;
32866
33186
  id: string;
32867
33187
  isActive: boolean;
33188
+ lastModifiedSource?: string | null;
32868
33189
  name: string;
32869
33190
  organizationId: string | null;
32870
33191
  parametersSchema?: {
@@ -32957,6 +33278,7 @@ interface paths {
32957
33278
  description: string | null;
32958
33279
  id: string;
32959
33280
  isActive: boolean;
33281
+ lastModifiedSource?: string | null;
32960
33282
  name: string;
32961
33283
  organizationId: string | null;
32962
33284
  parametersSchema?: {
@@ -33590,6 +33912,7 @@ interface paths {
33590
33912
  enableAgentSkills: boolean;
33591
33913
  enableChromeSurface: boolean;
33592
33914
  enableDashboardAssistant: boolean;
33915
+ enableRuntypeApps: boolean;
33593
33916
  productGeneratorModel: string;
33594
33917
  };
33595
33918
  id: string;
@@ -34245,6 +34568,8 @@ interface components {
34245
34568
  lastModifiedSource: string | null;
34246
34569
  updatedAt: string | null;
34247
34570
  versionId: string | null;
34571
+ /** @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. */
34572
+ warnings?: string[];
34248
34573
  };
34249
34574
  AgentSSEEvent: {
34250
34575
  agentId: string;
@@ -35383,6 +35708,8 @@ interface components {
35383
35708
  lastModifiedSource: string | null;
35384
35709
  updatedAt: string | null;
35385
35710
  versionId: string | null;
35711
+ /** @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. */
35712
+ warnings?: string[];
35386
35713
  };
35387
35714
  FlowSSEEvent: {
35388
35715
  executionContext?: {
@@ -35781,6 +36108,58 @@ interface components {
35781
36108
  skillVersionId: string;
35782
36109
  status: string;
35783
36110
  };
36111
+ ToolEnsureConflict: {
36112
+ /** @enum {string} */
36113
+ code: "external_modification" | "remote_changed";
36114
+ currentHash?: string | null;
36115
+ error: string;
36116
+ lastModifiedSource?: string;
36117
+ modifiedAt?: string | null;
36118
+ };
36119
+ ToolEnsureHashMismatch: {
36120
+ /** @enum {string} */
36121
+ code: "content_hash_mismatch";
36122
+ /** @description The server-computed canonical hash of the submitted definition. */
36123
+ contentHash: string;
36124
+ error: string;
36125
+ };
36126
+ ToolEnsureResponse: {
36127
+ /** @description Server-computed canonical content hash. Clients should echo this hash in probes. */
36128
+ contentHash: string;
36129
+ /** @enum {string} */
36130
+ result: "unchanged" | "created" | "updated";
36131
+ toolId: string;
36132
+ } | {
36133
+ /** @enum {string} */
36134
+ result: "definitionRequired";
36135
+ } | {
36136
+ changedKeys: string[];
36137
+ /** @enum {string} */
36138
+ changes: "none" | "create" | "update";
36139
+ contentHash: string;
36140
+ remoteHash?: string;
36141
+ /** @enum {string} */
36142
+ result: "plan";
36143
+ toolId?: string;
36144
+ };
36145
+ ToolPullResponse: {
36146
+ contentHash: string;
36147
+ definition: {
36148
+ config: {
36149
+ [key: string]: unknown;
36150
+ };
36151
+ description: string;
36152
+ name: string;
36153
+ parametersSchema: {
36154
+ [key: string]: unknown;
36155
+ };
36156
+ /** @enum {string} */
36157
+ toolType: "flow" | "custom" | "external" | "graphql" | "mcp" | "local" | "subagent";
36158
+ };
36159
+ lastModifiedSource: string | null;
36160
+ toolId: string;
36161
+ updatedAt: string | null;
36162
+ };
35784
36163
  UpdateUserProfileResponse: {
35785
36164
  email?: string;
35786
36165
  firstName?: string;
@@ -37186,6 +37565,77 @@ interface BulkEditResponse {
37186
37565
  data: BulkEditResult[];
37187
37566
  recordIds?: number[];
37188
37567
  }
37568
+ /** A single unified step-level execution result for a record. */
37569
+ interface RecordStepResult {
37570
+ id: string;
37571
+ userId: string;
37572
+ organizationId: string | null;
37573
+ batchExecutionId: string | null;
37574
+ executionSessionId: string | null;
37575
+ flowId: string | null;
37576
+ flowVersionId: string | null;
37577
+ recordId: string | null;
37578
+ recordName: string | null;
37579
+ recordMetadata?: JsonValue | null;
37580
+ stepId: string | null;
37581
+ stepType: string;
37582
+ stepName: string;
37583
+ order: number | null;
37584
+ status: string;
37585
+ startedAt: string | null;
37586
+ completedAt: string | null;
37587
+ durationMs: number | null;
37588
+ outputPreview: string | null;
37589
+ stepConfig?: JsonValue | null;
37590
+ inputVariables?: JsonValue | null;
37591
+ resolvedPrompt?: string | null;
37592
+ modelUsed?: string | null;
37593
+ promptTokens?: number | null;
37594
+ completionTokens?: number | null;
37595
+ totalTokens?: number | null;
37596
+ estimatedCost?: string | null;
37597
+ errorMessage?: string | null;
37598
+ retryCount?: number | null;
37599
+ createdAt: string;
37600
+ }
37601
+ /** Query parameters for {@link RecordsEndpoint.getStepResults}. */
37602
+ interface RecordStepResultsParams {
37603
+ flowId?: string;
37604
+ batchId?: string;
37605
+ status?: string;
37606
+ from?: string;
37607
+ to?: string;
37608
+ sortBy?: string;
37609
+ sortOrder?: 'asc' | 'desc';
37610
+ limit?: number;
37611
+ offset?: number;
37612
+ }
37613
+ /** Paginated response from {@link RecordsEndpoint.getStepResults}. */
37614
+ interface RecordStepResultsResponse {
37615
+ data: RecordStepResult[];
37616
+ pagination: {
37617
+ limit: number;
37618
+ offset: number;
37619
+ returned: number;
37620
+ hasMore: boolean;
37621
+ };
37622
+ }
37623
+ /** Per-model cost line within a {@link RecordCostAggregation}. */
37624
+ interface RecordCostModelBreakdown {
37625
+ model: string;
37626
+ cost: number;
37627
+ tokens: number;
37628
+ count: number;
37629
+ }
37630
+ /** Aggregated cost breakdown for a record from {@link RecordsEndpoint.getCosts}. */
37631
+ interface RecordCostAggregation {
37632
+ totalCost: number;
37633
+ totalTokens: number;
37634
+ promptTokens: number;
37635
+ completionTokens: number;
37636
+ executionCount: number;
37637
+ modelBreakdown: RecordCostModelBreakdown[];
37638
+ }
37189
37639
  type ProviderApiKey = paths['/v1/provider-keys']['get']['responses'][200]['content']['application/json']['providerKeys'][number];
37190
37640
  /**
37191
37641
  * Provider enum for creating a provider key, derived from the generated OpenAPI
@@ -38089,6 +38539,13 @@ interface FlowPullResult {
38089
38539
  lastModifiedSource: string | null;
38090
38540
  updatedAt: string | null;
38091
38541
  versionId: string | null;
38542
+ /**
38543
+ * Present only when a raw `tool_…` reference could not be emitted as a
38544
+ * portable `tool:<name>` (the tool was deleted, or its name is shadowed by an
38545
+ * older same-named tool). Those references are left as raw ids — which
38546
+ * `defineFlow`/`ensure` reject — so each warning explains how to fix it.
38547
+ */
38548
+ warnings?: string[];
38092
38549
  }
38093
38550
  /** A 409 from the ensure protocol (external_modification or remote_changed). */
38094
38551
  declare class FlowEnsureConflictError extends Error {
@@ -39659,6 +40116,13 @@ interface AgentPullResult {
39659
40116
  lastModifiedSource: string | null;
39660
40117
  updatedAt: string | null;
39661
40118
  versionId: string | null;
40119
+ /**
40120
+ * Present only when a raw `tool_…` reference could not be emitted as a
40121
+ * portable `tool:<name>` (the tool was deleted, or its name is shadowed by an
40122
+ * older same-named tool). Those references are left as raw ids — which
40123
+ * `defineAgent`/`ensure` reject — so each warning explains how to fix it.
40124
+ */
40125
+ warnings?: string[];
39662
40126
  }
39663
40127
  /** A 409 from the ensure protocol (external_modification or remote_changed). */
39664
40128
  declare class AgentEnsureConflictError extends Error {
@@ -39715,6 +40179,190 @@ declare class AgentsNamespace {
39715
40179
  private request;
39716
40180
  }
39717
40181
 
40182
+ /**
40183
+ * Tool config-as-code: `defineTool`, `tools.ensure`, `tools.pull`.
40184
+ *
40185
+ * The deploy-time convergence postcondition for saved tools: "make the
40186
+ * platform's definition of this tool match this object; no-op if it already
40187
+ * does." Identity is name + account scope (the API key's org, else personal);
40188
+ * environment is whichever API the client points at. `ensure` never deletes,
40189
+ * and renaming a definition orphans the old tool and creates a new one.
40190
+ *
40191
+ * Wire protocol (POST /v1/tools/ensure — APQ-shaped, both APQ scars fixed):
40192
+ * 1. Hash-only probe `{ name, contentHash }`. A match is
40193
+ * `{ result: 'unchanged' }`; a miss is a NORMAL 200
40194
+ * `{ result: 'definitionRequired' }`, never an error.
40195
+ * 2. On a miss, retry with the full `definition`. The server recomputes the
40196
+ * canonical hash itself and returns it on every response — this SDK
40197
+ * echoes the server's hash (memoized per client instance) rather than
40198
+ * trusting its own serialization.
40199
+ *
40200
+ * Unlike agents/flows, tools have NO version snapshots: there is no
40201
+ * `release: 'publish'` option and no `versionId` on the result.
40202
+ *
40203
+ * The content hash is the canonical tool hash (`computeToolContentHash` —
40204
+ * mirrored from `packages/shared/src/utils/tool-content-hash.ts`; this package
40205
+ * is dependency-free by convention) over `{ toolType, description,
40206
+ * parametersSchema, config }`. `name` is identity, not content, so it is
40207
+ * excluded from the hash.
40208
+ *
40209
+ * See docs/adr/0003-agent-config-as-code-ensure.md for the design rationale.
40210
+ */
40211
+
40212
+ /** Canonical normalized form of a tool definition (name excluded — identity). */
40213
+ declare function normalizeToolDefinition(definition: ToolContentInput): {
40214
+ toolType: string;
40215
+ description?: string;
40216
+ parametersSchema: Record<string, unknown>;
40217
+ config: Record<string, unknown>;
40218
+ };
40219
+ /** SHA-256 (hex) over the canonical normalized tool definition. */
40220
+ declare function computeToolContentHash(definition: ToolContentInput): Promise<string>;
40221
+ interface ToolContentInput {
40222
+ description?: string | null;
40223
+ toolType: string;
40224
+ parametersSchema?: Record<string, unknown> | null;
40225
+ config?: Record<string, unknown> | null;
40226
+ }
40227
+ /** The tool types `ensure` accepts (mirrors the server's CreateToolSchema). */
40228
+ type ToolDefinitionType = 'flow' | 'custom' | 'external' | 'graphql' | 'mcp' | 'local' | 'subagent';
40229
+ /** `defineTool` input: identity (name) + the convergeable content fields. */
40230
+ interface DefineToolInput {
40231
+ name: string;
40232
+ description: string;
40233
+ toolType: ToolDefinitionType;
40234
+ parametersSchema: Record<string, unknown>;
40235
+ config: Record<string, unknown>;
40236
+ }
40237
+ /** The canonical (wire) definition produced by `defineTool`. */
40238
+ interface ToolDefinition {
40239
+ name: string;
40240
+ description: string;
40241
+ toolType: ToolDefinitionType;
40242
+ parametersSchema: Record<string, unknown>;
40243
+ config: Record<string, unknown>;
40244
+ }
40245
+ /**
40246
+ * Pure-local declarative constructor for a tool definition. No I/O. Validates
40247
+ * structure and rejects unknown fields. Deep validation (custom-tool code
40248
+ * preflight, {{secret:KEY}} reference rules) happens server-side at ensure
40249
+ * time, mirroring the create/update routes.
40250
+ *
40251
+ * @example
40252
+ * ```typescript
40253
+ * const weather = defineTool({
40254
+ * name: 'Weather Lookup',
40255
+ * description: 'Fetch the current weather for a city',
40256
+ * toolType: 'external',
40257
+ * parametersSchema: {
40258
+ * type: 'object',
40259
+ * properties: { city: { type: 'string' } },
40260
+ * required: ['city'],
40261
+ * },
40262
+ * config: { url: 'https://api.example.com/weather?q={{city}}', method: 'GET' },
40263
+ * })
40264
+ * ```
40265
+ */
40266
+ declare function defineTool(input: DefineToolInput): ToolDefinition;
40267
+ interface EnsureToolOptions {
40268
+ /** Plan without writing (the CI drift gate). Sends the full definition. */
40269
+ dryRun?: boolean;
40270
+ /**
40271
+ * What to do when the tool's last write came from the dashboard/API rather
40272
+ * than ensure. Default 'error' (HTTP 409 → ToolEnsureConflictError).
40273
+ */
40274
+ onConflict?: 'error' | 'overwrite';
40275
+ /**
40276
+ * TOCTOU guard binding a dry run to its apply: the write only proceeds if
40277
+ * the remote still hashes to this value (409 remote_changed otherwise).
40278
+ */
40279
+ expectedRemoteHash?: string;
40280
+ /** Implies dryRun; throws ToolDriftError unless the plan is 'none'. */
40281
+ expectNoChanges?: boolean;
40282
+ }
40283
+ interface EnsureToolConverged {
40284
+ result: 'unchanged' | 'created' | 'updated';
40285
+ toolId: string;
40286
+ /** The server-computed canonical hash (echo this — never your own). */
40287
+ contentHash: string;
40288
+ }
40289
+ interface EnsureToolPlan {
40290
+ result: 'plan';
40291
+ changes: 'none' | 'create' | 'update';
40292
+ changedKeys: string[];
40293
+ contentHash: string;
40294
+ remoteHash?: string;
40295
+ toolId?: string;
40296
+ }
40297
+ type EnsureToolResult = EnsureToolConverged | EnsureToolPlan;
40298
+ interface ToolPullResult {
40299
+ toolId: string;
40300
+ definition: ToolDefinition;
40301
+ contentHash: string;
40302
+ lastModifiedSource: string | null;
40303
+ updatedAt: string | null;
40304
+ }
40305
+ /** A 409 from the ensure protocol (external_modification or remote_changed). */
40306
+ declare class ToolEnsureConflictError extends Error {
40307
+ readonly code: 'external_modification' | 'remote_changed';
40308
+ readonly lastModifiedSource?: string;
40309
+ readonly modifiedAt?: string | null;
40310
+ readonly currentHash?: string | null;
40311
+ constructor(body: {
40312
+ error?: string;
40313
+ code: 'external_modification' | 'remote_changed';
40314
+ lastModifiedSource?: string;
40315
+ modifiedAt?: string | null;
40316
+ currentHash?: string | null;
40317
+ });
40318
+ }
40319
+ /** Thrown by `ensure(def, { expectNoChanges: true })` when drift is detected. */
40320
+ declare class ToolDriftError extends Error {
40321
+ readonly plan: EnsureToolPlan;
40322
+ constructor(plan: EnsureToolPlan);
40323
+ }
40324
+
40325
+ /**
40326
+ * ToolsNamespace — config-as-code operations for saved tools.
40327
+ *
40328
+ * `tools.ensure` is the deploy-time, non-executing converge (create-or-update a
40329
+ * tool by name + account scope); `tools.pull` is the absorb-drift direction.
40330
+ * Both delegate to the implementation in `tools-ensure.ts`.
40331
+ */
40332
+
40333
+ declare class ToolsNamespace {
40334
+ private getClient;
40335
+ constructor(getClient: () => RuntypeClient$1);
40336
+ /**
40337
+ * Idempotently converge a `defineTool` definition onto the platform.
40338
+ * Hash-first: the steady state is one tiny probe request. Creates or updates
40339
+ * the saved tool; never deletes. Identity is name + account scope.
40340
+ *
40341
+ * @example
40342
+ * ```typescript
40343
+ * const weather = defineTool({
40344
+ * name: 'Weather Lookup',
40345
+ * description: 'Fetch the current weather for a city',
40346
+ * toolType: 'external',
40347
+ * parametersSchema: { type: 'object', properties: { city: { type: 'string' } } },
40348
+ * config: { url: 'https://api.example.com/weather', method: 'GET' },
40349
+ * })
40350
+ *
40351
+ * // Converge (CI/deploy).
40352
+ * const result = await Runtype.tools.ensure(weather)
40353
+ *
40354
+ * // PR drift gate.
40355
+ * await Runtype.tools.ensure(weather, { expectNoChanges: true })
40356
+ * ```
40357
+ */
40358
+ ensure(definition: ToolDefinition, options?: EnsureToolOptions): Promise<EnsureToolResult>;
40359
+ /**
40360
+ * Pull the canonical definition + provenance for a tool by name — the
40361
+ * absorb-drift direction of the ensure protocol.
40362
+ */
40363
+ pull(name: string): Promise<ToolPullResult>;
40364
+ }
40365
+
39718
40366
  /**
39719
40367
  * Runtype - The unified SDK client for building and executing flows, batches, evals, and prompts
39720
40368
  *
@@ -39990,6 +40638,32 @@ declare class Runtype {
39990
40638
  * ```
39991
40639
  */
39992
40640
  static get agents(): AgentsNamespace;
40641
+ /**
40642
+ * Tools namespace - Tool config-as-code (define / ensure / pull)
40643
+ *
40644
+ * @example
40645
+ * ```typescript
40646
+ * import { defineTool, Runtype } from '@runtypelabs/sdk'
40647
+ *
40648
+ * const weather = defineTool({
40649
+ * name: 'Weather Lookup',
40650
+ * description: 'Fetch the current weather for a city',
40651
+ * toolType: 'external',
40652
+ * parametersSchema: { type: 'object', properties: { city: { type: 'string' } } },
40653
+ * config: { url: 'https://api.example.com/weather', method: 'GET' },
40654
+ * })
40655
+ *
40656
+ * // Converge at deploy time (idempotent; one tiny probe in steady state)
40657
+ * await Runtype.tools.ensure(weather)
40658
+ *
40659
+ * // CI drift gate
40660
+ * await Runtype.tools.ensure(weather, { expectNoChanges: true })
40661
+ *
40662
+ * // Absorb a dashboard edit back into the repo
40663
+ * const { definition } = await Runtype.tools.pull('Weather Lookup')
40664
+ * ```
40665
+ */
40666
+ static get tools(): ToolsNamespace;
39993
40667
  }
39994
40668
 
39995
40669
  /**
@@ -40511,6 +41185,15 @@ declare class RecordsEndpoint {
40511
41185
  fromDate?: string;
40512
41186
  toDate?: string;
40513
41187
  }): Promise<any[]>;
41188
+ /**
41189
+ * Get unified step-level execution results for a record, with filtering and
41190
+ * pagination.
41191
+ */
41192
+ getStepResults(id: string, params?: RecordStepResultsParams): Promise<RecordStepResultsResponse>;
41193
+ /**
41194
+ * Get the aggregated cost breakdown (by model) for a record's executions.
41195
+ */
41196
+ getCosts(id: string): Promise<RecordCostAggregation>;
40514
41197
  /**
40515
41198
  * Delete a specific result for a record
40516
41199
  */
@@ -41850,6 +42533,20 @@ type RunTaskOnContextNotice = (event: RunTaskContextNoticeEvent) => void | Promi
41850
42533
  /**
41851
42534
  * Options for `agents.runTask()`
41852
42535
  */
42536
+ /**
42537
+ * Storage seam for hot-tail tool-output offloads. Given a large tool result
42538
+ * the SDK has already decided to offload (above its inline threshold), the
42539
+ * recorder persists the content however it likes and returns the reference
42540
+ * string to splice into the send view in place of the raw output. Return
42541
+ * `undefined` to decline and let the SDK fall back to its built-in store.
42542
+ */
42543
+ type RunTaskOffloadRecorder = (details: {
42544
+ toolCallId: string;
42545
+ toolName: string;
42546
+ content: string;
42547
+ }) => {
42548
+ reference: string;
42549
+ } | undefined;
41853
42550
  interface RunTaskOptions {
41854
42551
  /** The user message / task instruction for the agent */
41855
42552
  message: string;
@@ -41902,6 +42599,18 @@ interface RunTaskOptions {
41902
42599
  onContextNotice?: RunTaskOnContextNotice;
41903
42600
  /** Saved workflow state to seed a resumed or restarted marathon run */
41904
42601
  resumeState?: RunTaskResumeState;
42602
+ /**
42603
+ * Optional storage seam for hot-tail tool-output offloads. When supplied,
42604
+ * `offloadToolResult` delegates persistence to the recorder instead of the
42605
+ * built-in `.runtype/marathons/<slug>/tool-outputs/` fallback, and returns
42606
+ * the recorder's reference in place of the file-pointer marker. The CLI
42607
+ * backs this with its content-addressed ledger store so the 500–100k char
42608
+ * band becomes a first-class ledger citizen (content-addressed, hashed,
42609
+ * `read_offloaded_output`-resolvable, deduped). Returning `undefined` (or
42610
+ * throwing) falls back to the built-in store. A future server-side artifact
42611
+ * upload plugs into this same seam.
42612
+ */
42613
+ offloadRecorder?: RunTaskOffloadRecorder;
41905
42614
  /** How tool results are stored in message history for continuation.
41906
42615
  * 'hot-tail' (default): recent results inline, older offloaded to disk.
41907
42616
  * 'observation-mask': recent results inline, older replaced with placeholder.
@@ -44330,4 +45039,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
44330
45039
  declare function getDefaultPlanPath(taskName: string): string;
44331
45040
  declare function sanitizeTaskSlug(taskName: string): string;
44332
45041
 
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 };
45042
+ 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, 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 };