@runtypelabs/sdk 1.15.3 → 1.17.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
@@ -367,14 +367,14 @@ interface Tool {
367
367
  organizationId?: string;
368
368
  name: string;
369
369
  description: string;
370
- toolType: 'flow' | 'custom' | 'external' | 'local';
370
+ toolType: 'flow' | 'custom' | 'external' | 'local' | 'subagent';
371
371
  parametersSchema: JSONSchema;
372
372
  config: ToolConfig;
373
373
  isActive: boolean;
374
374
  createdAt: string;
375
375
  updatedAt: string;
376
376
  }
377
- type ToolConfig = FlowToolConfig | CustomToolConfig | ExternalToolConfig | LocalToolConfig;
377
+ type ToolConfig = FlowToolConfig | CustomToolConfig | ExternalToolConfig | LocalToolConfig | SubagentToolConfig;
378
378
  interface FlowToolConfig {
379
379
  flowId: string;
380
380
  parameterMapping: Record<string, string>;
@@ -395,6 +395,35 @@ interface ExternalToolConfig {
395
395
  interface LocalToolConfig {
396
396
  [key: string]: JsonValue;
397
397
  }
398
+ /**
399
+ * Subagent tool configuration (surfaces A + B in the subagent design plan).
400
+ *
401
+ * Surface A — saved subagent: set `agentId` to a saved agent in the same org.
402
+ * Surface B — inline subagent: set `agent` to a full exported agent JSON shape
403
+ * validated by the API at dispatch time.
404
+ *
405
+ * Exactly one of `agentId` / `agent` must be present; the API validator enforces this.
406
+ */
407
+ interface SubagentToolConfig {
408
+ /** (A) Saved agent — org-scoped, ownership-checked at dispatch. */
409
+ agentId?: string;
410
+ /** (B) Inline agent definition. Full exported-agent JSON shape. */
411
+ agent?: JsonObject;
412
+ /** Tool subset granted to the child. REQUIRED. Must be a subset of the parent's resolved tools. */
413
+ allowedTools: string[];
414
+ /** Override the child agent's loop maxTurns. Default 5. */
415
+ maxTurns?: number;
416
+ /** Optional cap on the child's running cost. Default: inherits parent budget. */
417
+ maxCost?: number;
418
+ /** Per-invocation timeout in ms. Default 300_000 (5 min). */
419
+ timeoutMs?: number;
420
+ /** How the child's result is returned. Default 'text'. */
421
+ outputFormat?: 'text' | 'json' | 'last_message';
422
+ /** If true, prepend the parent's current messages to the child's initial context. Default false. */
423
+ inheritMessages?: boolean;
424
+ /** Optional template rendering the child's initial user message from the tool-call `parameters`. */
425
+ taskTemplate?: string;
426
+ }
398
427
  interface BuiltInTool {
399
428
  id: string;
400
429
  name: string;
@@ -421,7 +450,7 @@ interface ToolExecution {
421
450
  interface CreateToolRequest {
422
451
  name: string;
423
452
  description: string;
424
- toolType: 'flow' | 'custom' | 'external';
453
+ toolType: 'flow' | 'custom' | 'external' | 'subagent';
425
454
  parametersSchema: JSONSchema;
426
455
  config: ToolConfig;
427
456
  }
@@ -555,14 +584,14 @@ interface ModelUsageResponse {
555
584
  interface RuntimeTool {
556
585
  name: string;
557
586
  description: string;
558
- toolType: 'flow' | 'custom' | 'external' | 'local';
587
+ toolType: 'flow' | 'custom' | 'external' | 'local' | 'subagent';
559
588
  parametersSchema: JSONSchema;
560
589
  config?: RuntimeToolConfig;
561
590
  }
562
591
  /**
563
592
  * Config options for runtime tools
564
593
  */
565
- type RuntimeToolConfig = RuntimeFlowToolConfig | RuntimeCustomToolConfig | RuntimeExternalToolConfig | RuntimeLocalToolConfig;
594
+ type RuntimeToolConfig = RuntimeFlowToolConfig | RuntimeCustomToolConfig | RuntimeExternalToolConfig | RuntimeLocalToolConfig | RuntimeSubagentToolConfig;
566
595
  interface RuntimeLocalToolConfig {
567
596
  [key: string]: JsonValue;
568
597
  }
@@ -583,6 +612,41 @@ interface RuntimeExternalToolConfig {
583
612
  headers?: Record<string, string>;
584
613
  body?: string;
585
614
  }
615
+ /**
616
+ * Runtime subagent tool config — inline form used when passing a subagent
617
+ * tool via `runtimeTools[]` rather than saving it.
618
+ *
619
+ * Structurally identical to `SubagentToolConfig`: the API validates the same
620
+ * fields on both paths, so keeping a single source of truth avoids silent
621
+ * divergence if a field is added on one side only. Kept as a named alias for
622
+ * readability at call sites that deal with runtime-only tools.
623
+ */
624
+ type RuntimeSubagentToolConfig = SubagentToolConfig;
625
+ /**
626
+ * Opt-in configuration for agent-driven dynamic subagent spawning (surface C
627
+ * of the subagent design).
628
+ *
629
+ * When present on a prompt step's `tools.subagentConfig`, the API synthesizes
630
+ * a `spawn_subagent` tool that the parent LLM can call at runtime to spin off
631
+ * a focused child agent. The child's tools are drawn from `toolPool`, which
632
+ * must be a subset of the parent step's resolved tools.
633
+ */
634
+ interface AgentSubagentConfig {
635
+ /** Pool of tool IDs the parent is permitted to grant. Supports wildcards (e.g. `mcp:*`). */
636
+ toolPool: string[];
637
+ /** Default iteration cap for spawned subagents. Default 5. */
638
+ defaultMaxTurns?: number;
639
+ /** Hard ceiling a subagent may request via maxTurns. Default 10. */
640
+ maxTurnsLimit?: number;
641
+ /** Total spawns per top-level parent run. Default 5. */
642
+ maxSpawnsPerRun?: number;
643
+ /** Default model for spawned subagents. Defaults to parent's model. */
644
+ defaultModel?: string;
645
+ /** Whether spawned subagents can themselves spawn. Default false. */
646
+ allowNesting?: boolean;
647
+ /** Default per-spawn timeout. Default 300_000. */
648
+ defaultTimeoutMs?: number;
649
+ }
586
650
  /**
587
651
  * Tools configuration for prompt steps.
588
652
  * Supports both saved tools (by ID) and runtime tools (inline definitions).
@@ -677,6 +741,12 @@ interface ToolsConfig {
677
741
  toolIds?: string[];
678
742
  /** Inline runtime tool definitions (not persisted) */
679
743
  runtimeTools?: RuntimeTool[];
744
+ /**
745
+ * Opt-in agent-driven subagent spawning. When set, the API synthesizes a
746
+ * `spawn_subagent` tool that the step's model can call at runtime. Pool
747
+ * entries must be a subset of the parent step's resolved tools.
748
+ */
749
+ subagentConfig?: AgentSubagentConfig;
680
750
  /**
681
751
  * Custom MCP servers with credentials passed at runtime.
682
752
  * Maximum 5 servers per step.
@@ -788,6 +858,11 @@ interface ModelFallback extends BaseFallback {
788
858
  model: string;
789
859
  temperature?: number;
790
860
  maxTokens?: number;
861
+ topP?: number;
862
+ topK?: number;
863
+ frequencyPenalty?: number;
864
+ presencePenalty?: number;
865
+ seed?: number;
791
866
  }
792
867
  /**
793
868
  * Step fallback for context steps - run a different step type
@@ -795,7 +870,7 @@ interface ModelFallback extends BaseFallback {
795
870
  interface StepFallback extends BaseFallback {
796
871
  type: 'step';
797
872
  stepType: string;
798
- stepConfig: Record<string, any>;
873
+ stepConfig: Record<string, unknown>;
799
874
  }
800
875
  /**
801
876
  * Flow fallback - call another flow
@@ -803,7 +878,7 @@ interface StepFallback extends BaseFallback {
803
878
  interface FlowFallback extends BaseFallback {
804
879
  type: 'flow';
805
880
  flowId: string;
806
- inputs?: Record<string, any>;
881
+ inputs?: Record<string, unknown>;
807
882
  }
808
883
  /**
809
884
  * Union of all prompt fallback types
@@ -860,6 +935,11 @@ interface PromptStepConfig$1 {
860
935
  outputVariable?: string;
861
936
  responseFormat?: 'text' | 'json';
862
937
  temperature?: number;
938
+ topP?: number;
939
+ topK?: number;
940
+ frequencyPenalty?: number;
941
+ presencePenalty?: number;
942
+ seed?: number;
863
943
  maxTokens?: number;
864
944
  /**
865
945
  * Enable reasoning/extended thinking for models that support it.
@@ -1415,6 +1495,64 @@ declare class FlowBuilder {
1415
1495
  * Add a fetch GitHub step
1416
1496
  */
1417
1497
  fetchGitHub(config: FetchGitHubStepConfig$1): this;
1498
+ /**
1499
+ * Attach a subagent runtime tool to the most recent prompt step.
1500
+ *
1501
+ * A subagent tool spawns a focused child agent in its own context window
1502
+ * when the parent's model calls it. The child runs with a whitelisted tool
1503
+ * subset drawn from `allowedTools` (every entry must be available on the
1504
+ * parent step). The parent only sees the child's final result.
1505
+ *
1506
+ * Pass either `agentId` (for a saved agent in the same org) or `agent`
1507
+ * (an inline exported-agent JSON shape) — exactly one is required.
1508
+ *
1509
+ * @example
1510
+ * ```typescript
1511
+ * new FlowBuilder()
1512
+ * .createFlow({ name: 'Research' })
1513
+ * .prompt({ name: 'Plan', model: 'claude-sonnet-4-5', userPrompt: '...' })
1514
+ * .withSubagentTool('research_topic', {
1515
+ * agentId: 'agent_01h...',
1516
+ * allowedTools: ['builtin:exa_search'],
1517
+ * outputFormat: 'text',
1518
+ * })
1519
+ * ```
1520
+ */
1521
+ withSubagentTool(name: string, opts: {
1522
+ description?: string;
1523
+ agentId?: string;
1524
+ agent?: JsonObject;
1525
+ allowedTools: string[];
1526
+ parametersSchema?: JSONSchema;
1527
+ maxTurns?: number;
1528
+ maxCost?: number;
1529
+ timeoutMs?: number;
1530
+ outputFormat?: 'text' | 'json' | 'last_message';
1531
+ inheritMessages?: boolean;
1532
+ taskTemplate?: string;
1533
+ }): this;
1534
+ /**
1535
+ * Enable agent-driven dynamic subagent spawning on the most recent prompt
1536
+ * step (surface C of the subagent design).
1537
+ *
1538
+ * When set, the API synthesizes a `spawn_subagent` tool the parent's model
1539
+ * can call at runtime to spin off a focused child agent. The child's tools
1540
+ * are drawn from `toolPool`, which must be a subset of the parent step's
1541
+ * resolved tools. The API validates pool entries and rejects escalation.
1542
+ *
1543
+ * @example
1544
+ * ```typescript
1545
+ * new FlowBuilder()
1546
+ * .createFlow({ name: 'Explore' })
1547
+ * .prompt({ name: 'Research', model: 'claude-sonnet-4-5', userPrompt: '...' })
1548
+ * .withSubagents({
1549
+ * toolPool: ['builtin:exa_search', 'mcp:*'],
1550
+ * maxSpawnsPerRun: 3,
1551
+ * allowNesting: false,
1552
+ * })
1553
+ * ```
1554
+ */
1555
+ withSubagents(opts: AgentSubagentConfig): this;
1418
1556
  /**
1419
1557
  * Build the final dispatch request configuration
1420
1558
  */
@@ -1702,7 +1840,7 @@ declare class FlowResult {
1702
1840
  */
1703
1841
 
1704
1842
  interface LocalToolsOptions {
1705
- localTools?: Record<string, (args: any) => Promise<any>>;
1843
+ localTools?: Record<string, (args: unknown) => Promise<unknown>>;
1706
1844
  }
1707
1845
  interface FlowConfig {
1708
1846
  name: string;
@@ -1718,7 +1856,7 @@ interface RecordConfig {
1718
1856
  id?: number | string;
1719
1857
  name?: string;
1720
1858
  type?: string;
1721
- metadata?: Record<string, any>;
1859
+ metadata?: JsonObject;
1722
1860
  }
1723
1861
  interface Message {
1724
1862
  role: 'system' | 'user' | 'assistant';
@@ -1736,13 +1874,18 @@ interface PromptStepConfig {
1736
1874
  outputVariable?: string;
1737
1875
  responseFormat?: 'text' | 'json';
1738
1876
  temperature?: number;
1877
+ topP?: number;
1878
+ topK?: number;
1879
+ frequencyPenalty?: number;
1880
+ presencePenalty?: number;
1881
+ seed?: number;
1739
1882
  maxTokens?: number;
1740
1883
  /** Enable reasoning/extended thinking. Use `true` for defaults or `ReasoningConfig` for fine-grained control */
1741
1884
  reasoning?: boolean | ReasoningConfig;
1742
1885
  streamOutput?: boolean;
1743
1886
  tools?: {
1744
1887
  toolIds?: string[];
1745
- [key: string]: any;
1888
+ [key: string]: unknown;
1746
1889
  };
1747
1890
  /** Error handling configuration - supports simple mode or fallback chains */
1748
1891
  errorHandling?: ErrorHandlingMode | PromptErrorHandling;
@@ -1760,7 +1903,7 @@ interface FetchUrlStepConfig {
1760
1903
  fetchMethod?: 'http' | 'firecrawl';
1761
1904
  firecrawl?: {
1762
1905
  formats?: string[];
1763
- [key: string]: any;
1906
+ [key: string]: unknown;
1764
1907
  };
1765
1908
  /** Error handling configuration - supports simple mode or fallback chains */
1766
1909
  errorHandling?: ErrorHandlingMode | ContextErrorHandling;
@@ -1783,8 +1926,8 @@ interface SetVariableStepConfig {
1783
1926
  interface ConditionalStepConfig {
1784
1927
  name: string;
1785
1928
  condition: string;
1786
- trueSteps?: any[];
1787
- falseSteps?: any[];
1929
+ trueSteps?: unknown[];
1930
+ falseSteps?: unknown[];
1788
1931
  enabled?: boolean;
1789
1932
  }
1790
1933
  interface SearchStepConfig {
@@ -1878,7 +2021,7 @@ interface SendEventStepConfig {
1878
2021
  name: string;
1879
2022
  provider: string;
1880
2023
  eventName: string;
1881
- properties?: Record<string, any>;
2024
+ properties?: Record<string, unknown>;
1882
2025
  outputVariable?: string;
1883
2026
  /** Error handling configuration - supports simple mode or fallback chains */
1884
2027
  errorHandling?: ErrorHandlingMode | ContextErrorHandling;
@@ -2124,7 +2267,7 @@ declare class RuntypeFlowBuilder {
2124
2267
  * @param localTools - Map of tool names to async functions that execute the tool logic
2125
2268
  * @returns The final result of the flow execution
2126
2269
  */
2127
- runWithLocalTools(localTools: Record<string, (args: any) => Promise<any>>, callbacks?: StreamCallbacks): Promise<FlowResult>;
2270
+ runWithLocalTools(localTools: Record<string, (args: unknown) => Promise<unknown>>, callbacks?: StreamCallbacks): Promise<FlowResult>;
2128
2271
  build(): DispatchRequest;
2129
2272
  private addStep;
2130
2273
  }
@@ -2275,6 +2418,16 @@ interface ModelOverride$1 {
2275
2418
  model: string;
2276
2419
  /** Optional temperature override */
2277
2420
  temperature?: number;
2421
+ /** Optional top-p (nucleus sampling) override */
2422
+ topP?: number;
2423
+ /** Optional top-k override */
2424
+ topK?: number;
2425
+ /** Optional frequency penalty override */
2426
+ frequencyPenalty?: number;
2427
+ /** Optional presence penalty override */
2428
+ presencePenalty?: number;
2429
+ /** Optional seed override */
2430
+ seed?: number;
2278
2431
  /** Optional max tokens override */
2279
2432
  maxTokens?: number;
2280
2433
  }
@@ -2284,7 +2437,7 @@ interface EvalRunConfig {
2284
2437
  /** Virtual flow definition (alternative to flowId) */
2285
2438
  flow?: {
2286
2439
  name: string;
2287
- steps: any[];
2440
+ steps: unknown[];
2288
2441
  };
2289
2442
  /** Record type to evaluate against */
2290
2443
  recordType?: string;
@@ -2292,7 +2445,7 @@ interface EvalRunConfig {
2292
2445
  records?: Array<{
2293
2446
  name: string;
2294
2447
  type: string;
2295
- metadata: Record<string, any>;
2448
+ metadata: Record<string, unknown>;
2296
2449
  }>;
2297
2450
  /** Model overrides for single-model evaluation */
2298
2451
  models?: ModelOverride$1[];
@@ -2307,7 +2460,7 @@ interface EvalRunConfig {
2307
2460
  /** Continue on individual record failures */
2308
2461
  continueOnError?: boolean;
2309
2462
  /** Optional filter for records */
2310
- filter?: Record<string, any>;
2463
+ filter?: Record<string, unknown>;
2311
2464
  /** Optional limit on number of records */
2312
2465
  limit?: number;
2313
2466
  }
@@ -2322,7 +2475,7 @@ interface EvalStatus {
2322
2475
  records: Array<{
2323
2476
  recordId: string;
2324
2477
  status: 'success' | 'error';
2325
- result?: any;
2478
+ result?: unknown;
2326
2479
  error?: string;
2327
2480
  executionTime: number;
2328
2481
  }>;
@@ -2486,6 +2639,16 @@ interface CreatePromptData {
2486
2639
  responseFormat?: 'text' | 'json' | 'markdown';
2487
2640
  /** Temperature */
2488
2641
  temperature?: number;
2642
+ /** Top-p (nucleus) sampling */
2643
+ topP?: number;
2644
+ /** Top-k sampling */
2645
+ topK?: number;
2646
+ /** Frequency penalty */
2647
+ frequencyPenalty?: number;
2648
+ /** Presence penalty */
2649
+ presencePenalty?: number;
2650
+ /** Seed for reproducible sampling */
2651
+ seed?: number;
2489
2652
  /** Max tokens */
2490
2653
  maxTokens?: number;
2491
2654
  /** Enable reasoning/extended thinking. Use `true` for defaults or `ReasoningConfig` for fine-grained control */
@@ -2508,6 +2671,16 @@ interface UpdatePromptData {
2508
2671
  responseFormat?: 'text' | 'json' | 'markdown';
2509
2672
  /** Temperature */
2510
2673
  temperature?: number;
2674
+ /** Top-p (nucleus) sampling */
2675
+ topP?: number;
2676
+ /** Top-k sampling */
2677
+ topK?: number;
2678
+ /** Frequency penalty */
2679
+ frequencyPenalty?: number;
2680
+ /** Presence penalty */
2681
+ presencePenalty?: number;
2682
+ /** Seed for reproducible sampling */
2683
+ seed?: number;
2511
2684
  /** Max tokens */
2512
2685
  maxTokens?: number;
2513
2686
  /** Enable reasoning/extended thinking. Use `true` for defaults or `ReasoningConfig` for fine-grained control */
@@ -2523,6 +2696,11 @@ interface Prompt {
2523
2696
  userPrompt: string;
2524
2697
  responseFormat?: string;
2525
2698
  temperature?: number;
2699
+ topP?: number;
2700
+ topK?: number;
2701
+ frequencyPenalty?: number;
2702
+ presencePenalty?: number;
2703
+ seed?: number;
2526
2704
  maxTokens?: number;
2527
2705
  reasoning?: boolean | ReasoningConfig;
2528
2706
  createdAt: string;
@@ -2535,12 +2713,22 @@ interface PromptRunOptions {
2535
2713
  record?: {
2536
2714
  name?: string;
2537
2715
  type?: string;
2538
- metadata?: Record<string, any>;
2716
+ metadata?: Record<string, unknown>;
2539
2717
  };
2540
2718
  /** Model override */
2541
2719
  modelOverride?: string;
2542
2720
  /** Temperature override */
2543
2721
  temperature?: number;
2722
+ /** Top-p (nucleus) sampling override */
2723
+ topP?: number;
2724
+ /** Top-k sampling override */
2725
+ topK?: number;
2726
+ /** Frequency penalty override */
2727
+ frequencyPenalty?: number;
2728
+ /** Presence penalty override */
2729
+ presencePenalty?: number;
2730
+ /** Seed override */
2731
+ seed?: number;
2544
2732
  /** Max tokens override */
2545
2733
  maxTokens?: number;
2546
2734
  /** Store the result */
@@ -4005,7 +4193,7 @@ interface AgentToolStartEvent extends BaseAgentEvent {
4005
4193
  iteration: number;
4006
4194
  toolCallId: string;
4007
4195
  toolName: string;
4008
- toolType: 'flow' | 'mcp' | 'builtin' | 'custom' | 'external';
4196
+ toolType: 'flow' | 'mcp' | 'builtin' | 'custom' | 'external' | 'advisor' | 'subagent';
4009
4197
  parameters?: Record<string, unknown>;
4010
4198
  }
4011
4199
  /**
@@ -4223,7 +4411,7 @@ interface LocalToolDefinition {
4223
4411
  interface AgentRuntimeToolDefinition {
4224
4412
  name: string;
4225
4413
  description: string;
4226
- toolType: 'flow' | 'custom' | 'external' | 'local';
4414
+ toolType: 'flow' | 'custom' | 'external' | 'local' | 'subagent';
4227
4415
  parametersSchema: Record<string, unknown>;
4228
4416
  config?: Record<string, unknown>;
4229
4417
  }
@@ -4241,6 +4429,16 @@ interface AgentExecuteRequest {
4241
4429
  debugMode?: boolean;
4242
4430
  /** Model ID to use for this session (overrides agent config) */
4243
4431
  model?: string;
4432
+ /** Nucleus sampling override */
4433
+ topP?: number;
4434
+ /** Top-k sampling override */
4435
+ topK?: number;
4436
+ /** Frequency penalty override */
4437
+ frequencyPenalty?: number;
4438
+ /** Presence penalty override */
4439
+ presencePenalty?: number;
4440
+ /** Deterministic seed override */
4441
+ seed?: number;
4244
4442
  /** Enable reasoning/thinking for models that support it (e.g. Gemini 3, o-series) */
4245
4443
  reasoning?: boolean;
4246
4444
  /** Runtime tools to make available during execution */
@@ -5196,6 +5394,16 @@ interface ModelOverride {
5196
5394
  model: string;
5197
5395
  /** Optional temperature override */
5198
5396
  temperature?: number;
5397
+ /** Optional top-p override */
5398
+ topP?: number;
5399
+ /** Optional top-k override */
5400
+ topK?: number;
5401
+ /** Optional frequency penalty override */
5402
+ frequencyPenalty?: number;
5403
+ /** Optional presence penalty override */
5404
+ presencePenalty?: number;
5405
+ /** Optional seed override */
5406
+ seed?: number;
5199
5407
  /** Optional max tokens override */
5200
5408
  maxTokens?: number;
5201
5409
  }
@@ -5215,7 +5423,7 @@ interface EvalRecord {
5215
5423
  /** Record type */
5216
5424
  type: string;
5217
5425
  /** Record metadata */
5218
- metadata: Record<string, any>;
5426
+ metadata: Record<string, unknown>;
5219
5427
  }
5220
5428
  interface EvalRequest {
5221
5429
  /** Flow ID (for existing flow) */
@@ -5223,7 +5431,7 @@ interface EvalRequest {
5223
5431
  /** Virtual flow definition */
5224
5432
  flow?: {
5225
5433
  name: string;
5226
- steps: any[];
5434
+ steps: unknown[];
5227
5435
  };
5228
5436
  /** Record type to evaluate against */
5229
5437
  recordType?: string;
@@ -5236,7 +5444,7 @@ interface EvalRequest {
5236
5444
  /** Eval options */
5237
5445
  options?: EvalOptions;
5238
5446
  /** Optional filter for records */
5239
- filter?: Record<string, any>;
5447
+ filter?: Record<string, unknown>;
5240
5448
  /** Optional limit on number of records */
5241
5449
  limit?: number;
5242
5450
  }
@@ -5252,7 +5460,7 @@ interface EvalResult {
5252
5460
  records: Array<{
5253
5461
  recordId: string;
5254
5462
  status: 'success' | 'error';
5255
- result?: any;
5463
+ result?: unknown;
5256
5464
  error?: string;
5257
5465
  executionTime: number;
5258
5466
  }>;
@@ -5335,7 +5543,7 @@ declare class EvalBuilder {
5335
5543
  /**
5336
5544
  * Filter records to evaluate
5337
5545
  */
5338
- withFilter(filter: Record<string, any>): this;
5546
+ withFilter(filter: Record<string, unknown>): this;
5339
5547
  /**
5340
5548
  * Limit the number of records to evaluate
5341
5549
  */
@@ -5438,4 +5646,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5438
5646
  declare function getDefaultPlanPath(taskName: string): string;
5439
5647
  declare function sanitizeTaskSlug(taskName: string): string;
5440
5648
 
5441
- export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, 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 ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, 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 ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, FlowStepsEndpoint, type FlowSummary, type FlowToolConfig, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type Message$1 as Message, type MessageContent, 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 ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, 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 RuntimeTool, type RuntimeToolConfig, Runtype, 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 TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, 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 StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5649
+ export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentSubagentConfig, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, 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 ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, 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 ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, FlowStepsEndpoint, type FlowSummary, type FlowToolConfig, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type Message$1 as Message, type MessageContent, 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 ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, 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, 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 TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, 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 StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type SubagentToolConfig, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };