@runtypelabs/sdk 1.20.0 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +253 -0
- package/dist/index.d.cts +75 -243
- package/dist/index.d.ts +75 -243
- package/dist/index.mjs +251 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* SDK type definitions — self-contained for zero-dependency npm distribution.
|
|
3
|
+
*
|
|
4
|
+
* These types mirror the canonical entity definitions in @runtypelabs/shared
|
|
5
|
+
* (packages/shared/src/types/entities.ts and client-types.ts). When adding or
|
|
6
|
+
* modifying entity fields, update both locations.
|
|
4
7
|
*/
|
|
5
8
|
type JsonPrimitive = string | number | boolean | null;
|
|
6
9
|
type JsonArray = JsonValue[];
|
|
@@ -52,24 +55,29 @@ interface ApiResponse<T> {
|
|
|
52
55
|
}
|
|
53
56
|
interface FlowStep {
|
|
54
57
|
id: string;
|
|
58
|
+
flowId: string;
|
|
55
59
|
type: string;
|
|
56
60
|
name: string;
|
|
57
61
|
order: number;
|
|
58
62
|
enabled: boolean;
|
|
59
|
-
config:
|
|
63
|
+
config: Record<string, unknown>;
|
|
64
|
+
outputVariable?: string | null;
|
|
65
|
+
streamOutput?: boolean;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
updatedAt: string;
|
|
60
68
|
}
|
|
61
69
|
interface Flow {
|
|
62
70
|
id: string;
|
|
63
71
|
name: string;
|
|
64
|
-
description?: string;
|
|
72
|
+
description?: string | null;
|
|
65
73
|
status: 'draft' | 'active' | 'paused' | 'failed';
|
|
74
|
+
config?: JsonObject;
|
|
66
75
|
userId: string;
|
|
67
|
-
organizationId
|
|
76
|
+
organizationId: string | null;
|
|
68
77
|
createdAt: string;
|
|
69
78
|
updatedAt: string;
|
|
70
|
-
lastRunAt?: string;
|
|
71
|
-
|
|
72
|
-
/** Flow steps embedded in the flow response (consolidated from flow_steps endpoint) */
|
|
79
|
+
lastRunAt?: string | null;
|
|
80
|
+
/** Flow steps embedded in the flow response */
|
|
73
81
|
flowSteps?: FlowStep[];
|
|
74
82
|
/** Number of steps in the flow */
|
|
75
83
|
stepCount?: number;
|
|
@@ -124,6 +132,7 @@ interface RuntypeRecord {
|
|
|
124
132
|
}> | null;
|
|
125
133
|
availableFields?: string[];
|
|
126
134
|
userId: string;
|
|
135
|
+
organizationId?: string | null;
|
|
127
136
|
createdAt: string;
|
|
128
137
|
updatedAt: string;
|
|
129
138
|
}
|
|
@@ -286,8 +295,6 @@ interface UpsertOptions$2 {
|
|
|
286
295
|
}
|
|
287
296
|
/**
|
|
288
297
|
* Environment type for dispatch requests
|
|
289
|
-
* - 'development': Use development credentials (default for testing in dashboard)
|
|
290
|
-
* - 'production': Use production credentials (shows warning in UI)
|
|
291
298
|
*/
|
|
292
299
|
type DispatchEnvironment = 'development' | 'production';
|
|
293
300
|
interface DispatchRequest {
|
|
@@ -306,19 +313,7 @@ interface DispatchRequest {
|
|
|
306
313
|
role: 'system' | 'user' | 'assistant';
|
|
307
314
|
content: MessageContent;
|
|
308
315
|
}>;
|
|
309
|
-
/**
|
|
310
|
-
* Secure credentials for tool authentication
|
|
311
|
-
* - Never logged or returned in responses
|
|
312
|
-
* - Only used for variable substitution in tool headers/URLs
|
|
313
|
-
* - Available as {{secrets.key_name}} in tool configurations
|
|
314
|
-
*/
|
|
315
316
|
secrets?: Record<string, string>;
|
|
316
|
-
/**
|
|
317
|
-
* Top-level input variables accessible as {{varName}} in templates
|
|
318
|
-
* - Allows simple syntax without _record.metadata prefix
|
|
319
|
-
* - Takes precedence over record.metadata when resolving variables
|
|
320
|
-
* - Keys cannot start with '_' (reserved for system variables)
|
|
321
|
-
*/
|
|
322
317
|
inputs?: Record<string, unknown>;
|
|
323
318
|
options?: {
|
|
324
319
|
streamResponse?: boolean;
|
|
@@ -328,12 +323,6 @@ interface DispatchRequest {
|
|
|
328
323
|
storeResults?: boolean;
|
|
329
324
|
autoAppendMetadata?: boolean;
|
|
330
325
|
debugMode?: boolean;
|
|
331
|
-
/**
|
|
332
|
-
* Environment for credential lookup
|
|
333
|
-
* - 'development': Use development credentials (default)
|
|
334
|
-
* - 'production': Use production credentials
|
|
335
|
-
* Credentials are looked up with environment-specific first, then fallback to "all environments"
|
|
336
|
-
*/
|
|
337
326
|
environment?: DispatchEnvironment;
|
|
338
327
|
createVersion?: boolean;
|
|
339
328
|
versionType?: 'published' | 'draft' | 'test' | 'virtual';
|
|
@@ -398,33 +387,15 @@ interface ExternalToolConfig {
|
|
|
398
387
|
interface LocalToolConfig {
|
|
399
388
|
[key: string]: JsonValue;
|
|
400
389
|
}
|
|
401
|
-
/**
|
|
402
|
-
* Subagent tool configuration (surfaces A + B in the subagent design plan).
|
|
403
|
-
*
|
|
404
|
-
* Surface A — saved subagent: set `agentId` to a saved agent in the same org.
|
|
405
|
-
* Surface B — inline subagent: set `agent` to a full exported agent JSON shape
|
|
406
|
-
* validated by the API at dispatch time.
|
|
407
|
-
*
|
|
408
|
-
* Exactly one of `agentId` / `agent` must be present; the API validator enforces this.
|
|
409
|
-
*/
|
|
410
390
|
interface SubagentToolConfig {
|
|
411
|
-
/** (A) Saved agent — org-scoped, ownership-checked at dispatch. */
|
|
412
391
|
agentId?: string;
|
|
413
|
-
/** (B) Inline agent definition. Full exported-agent JSON shape. */
|
|
414
392
|
agent?: JsonObject;
|
|
415
|
-
/** Tool subset granted to the child. REQUIRED. Must be a subset of the parent's resolved tools. */
|
|
416
393
|
allowedTools: string[];
|
|
417
|
-
/** Override the child agent's loop maxTurns. Default 5. */
|
|
418
394
|
maxTurns?: number;
|
|
419
|
-
/** Optional cap on the child's running cost. Default: inherits parent budget. */
|
|
420
395
|
maxCost?: number;
|
|
421
|
-
/** Per-invocation timeout in ms. Default 300_000 (5 min). */
|
|
422
396
|
timeoutMs?: number;
|
|
423
|
-
/** How the child's result is returned. Default 'text'. */
|
|
424
397
|
outputFormat?: 'text' | 'json' | 'last_message';
|
|
425
|
-
/** If true, prepend the parent's current messages to the child's initial context. Default false. */
|
|
426
398
|
inheritMessages?: boolean;
|
|
427
|
-
/** Optional template rendering the child's initial user message from the tool-call `parameters`. */
|
|
428
399
|
taskTemplate?: string;
|
|
429
400
|
}
|
|
430
401
|
interface BuiltInTool {
|
|
@@ -505,10 +476,6 @@ interface DeployCfSandboxResponse {
|
|
|
505
476
|
previewUrl: string;
|
|
506
477
|
output: string;
|
|
507
478
|
status: 'running' | 'error';
|
|
508
|
-
/**
|
|
509
|
-
* Last pipeline step that ran. On failure, identifies where it failed
|
|
510
|
-
* (e.g. 'npm_install', 'start_process').
|
|
511
|
-
*/
|
|
512
479
|
stage?: 'validate_port' | 'validate_files' | 'write_package_json' | 'npm_install' | 'write_main_file' | 'write_additional_files' | 'start_process' | 'expose_port';
|
|
513
480
|
error?: string;
|
|
514
481
|
}
|
|
@@ -554,36 +521,6 @@ interface ModelUsageResponse {
|
|
|
554
521
|
usageByModel: Record<string, ModelUsageDetail>;
|
|
555
522
|
timeSeries?: ModelUsageTimeSeries[];
|
|
556
523
|
}
|
|
557
|
-
/**
|
|
558
|
-
* Runtime tool definition for inline tool definitions in requests.
|
|
559
|
-
* These are not persisted - they're defined and used within a single request.
|
|
560
|
-
*
|
|
561
|
-
* Runtime tools allow you to define tools dynamically without saving them
|
|
562
|
-
* to the database. They support the same tool types as saved tools:
|
|
563
|
-
* - external: HTTP API calls with variable substitution
|
|
564
|
-
* - custom: JavaScript/Python code execution
|
|
565
|
-
* - flow: Execute another Runtype flow
|
|
566
|
-
*
|
|
567
|
-
* @example
|
|
568
|
-
* ```typescript
|
|
569
|
-
* const runtimeTool: RuntimeTool = {
|
|
570
|
-
* name: 'list_flows',
|
|
571
|
-
* description: 'List all flows in the workspace',
|
|
572
|
-
* toolType: 'external',
|
|
573
|
-
* parametersSchema: {
|
|
574
|
-
* type: 'object',
|
|
575
|
-
* properties: {
|
|
576
|
-
* limit: { type: 'number', default: 20 }
|
|
577
|
-
* }
|
|
578
|
-
* },
|
|
579
|
-
* config: {
|
|
580
|
-
* url: 'https://api.runtype.com/v1/flows',
|
|
581
|
-
* method: 'GET',
|
|
582
|
-
* headers: { Authorization: '{{_internal.auth_token}}' }
|
|
583
|
-
* }
|
|
584
|
-
* }
|
|
585
|
-
* ```
|
|
586
|
-
*/
|
|
587
524
|
interface RuntimeTool {
|
|
588
525
|
name: string;
|
|
589
526
|
description: string;
|
|
@@ -591,9 +528,6 @@ interface RuntimeTool {
|
|
|
591
528
|
parametersSchema: JSONSchema;
|
|
592
529
|
config?: RuntimeToolConfig;
|
|
593
530
|
}
|
|
594
|
-
/**
|
|
595
|
-
* Config options for runtime tools
|
|
596
|
-
*/
|
|
597
531
|
type RuntimeToolConfig = RuntimeFlowToolConfig | RuntimeCustomToolConfig | RuntimeExternalToolConfig | RuntimeLocalToolConfig | RuntimeSubagentToolConfig;
|
|
598
532
|
interface RuntimeLocalToolConfig {
|
|
599
533
|
[key: string]: JsonValue;
|
|
@@ -616,80 +550,22 @@ interface RuntimeExternalToolConfig {
|
|
|
616
550
|
headers?: Record<string, string>;
|
|
617
551
|
body?: string;
|
|
618
552
|
}
|
|
619
|
-
/**
|
|
620
|
-
* Runtime subagent tool config — inline form used when passing a subagent
|
|
621
|
-
* tool via `runtimeTools[]` rather than saving it.
|
|
622
|
-
*
|
|
623
|
-
* Structurally identical to `SubagentToolConfig`: the API validates the same
|
|
624
|
-
* fields on both paths, so keeping a single source of truth avoids silent
|
|
625
|
-
* divergence if a field is added on one side only. Kept as a named alias for
|
|
626
|
-
* readability at call sites that deal with runtime-only tools.
|
|
627
|
-
*/
|
|
628
553
|
type RuntimeSubagentToolConfig = SubagentToolConfig;
|
|
629
|
-
/**
|
|
630
|
-
* Opt-in configuration for agent-driven dynamic subagent spawning (surface C
|
|
631
|
-
* of the subagent design).
|
|
632
|
-
*
|
|
633
|
-
* When present on a prompt step's `tools.subagentConfig`, the API synthesizes
|
|
634
|
-
* a `spawn_subagent` tool that the parent LLM can call at runtime to spin off
|
|
635
|
-
* a focused child agent. The child's tools are drawn from `toolPool`, which
|
|
636
|
-
* must be a subset of the parent step's resolved tools.
|
|
637
|
-
*/
|
|
638
554
|
interface AgentSubagentConfig {
|
|
639
|
-
/** Pool of tool IDs the parent is permitted to grant. Supports wildcards (e.g. `mcp:*`). */
|
|
640
555
|
toolPool: string[];
|
|
641
|
-
/** Default iteration cap for spawned subagents. Default 5. */
|
|
642
556
|
defaultMaxTurns?: number;
|
|
643
|
-
/** Hard ceiling a subagent may request via maxTurns. Default 10. */
|
|
644
557
|
maxTurnsLimit?: number;
|
|
645
|
-
/** Total spawns per top-level parent run. Default 5. */
|
|
646
558
|
maxSpawnsPerRun?: number;
|
|
647
|
-
/** Default model for spawned subagents. Defaults to parent's model. */
|
|
648
559
|
defaultModel?: string;
|
|
649
|
-
/** Whether spawned subagents can themselves spawn. Default false. */
|
|
650
560
|
allowNesting?: boolean;
|
|
651
|
-
/** Default per-spawn timeout. Default 300_000. */
|
|
652
561
|
defaultTimeoutMs?: number;
|
|
653
562
|
}
|
|
654
|
-
/**
|
|
655
|
-
* Tools configuration for prompt steps.
|
|
656
|
-
* Supports both saved tools (by ID) and runtime tools (inline definitions).
|
|
657
|
-
*
|
|
658
|
-
* @example
|
|
659
|
-
* ```typescript
|
|
660
|
-
* const toolsConfig: ToolsConfig = {
|
|
661
|
-
* // Reference saved tools by ID
|
|
662
|
-
* toolIds: ['tool_abc123', 'tool_def456'],
|
|
663
|
-
* // Or define tools inline
|
|
664
|
-
* runtimeTools: [
|
|
665
|
-
* {
|
|
666
|
-
* name: 'search_docs',
|
|
667
|
-
* description: 'Search documentation',
|
|
668
|
-
* toolType: 'external',
|
|
669
|
-
* parametersSchema: { ... },
|
|
670
|
-
* config: { url: '...', method: 'GET' }
|
|
671
|
-
* }
|
|
672
|
-
* ],
|
|
673
|
-
* maxToolCalls: 10,
|
|
674
|
-
* toolCallStrategy: 'auto'
|
|
675
|
-
* }
|
|
676
|
-
* ```
|
|
677
|
-
*/
|
|
678
|
-
/**
|
|
679
|
-
* Authentication configuration for custom MCP servers
|
|
680
|
-
*/
|
|
681
563
|
interface CustomMCPServerAuth {
|
|
682
|
-
/** Authentication type */
|
|
683
564
|
type: 'bearer' | 'api_key' | 'basic' | 'custom_header' | 'oauth2' | 'none';
|
|
684
|
-
/** Header name for api_key or custom_header auth types */
|
|
685
565
|
headerName?: string;
|
|
686
|
-
/** Token/key value for bearer, api_key, or custom_header */
|
|
687
566
|
token?: string;
|
|
688
|
-
/** Username for basic auth */
|
|
689
567
|
username?: string;
|
|
690
|
-
/** Password for basic auth */
|
|
691
568
|
password?: string;
|
|
692
|
-
/** OAuth2 credentials (for oauth2 auth type) */
|
|
693
569
|
oauth2?: {
|
|
694
570
|
accessToken?: string;
|
|
695
571
|
refreshToken?: string;
|
|
@@ -701,135 +577,34 @@ interface CustomMCPServerAuth {
|
|
|
701
577
|
issuer?: string;
|
|
702
578
|
};
|
|
703
579
|
}
|
|
704
|
-
/**
|
|
705
|
-
* Custom MCP server configuration for runtime use.
|
|
706
|
-
*
|
|
707
|
-
* Allows connecting to custom MCP-compatible servers at dispatch time,
|
|
708
|
-
* with credentials passed inline (never logged or stored).
|
|
709
|
-
*
|
|
710
|
-
* @example
|
|
711
|
-
* ```typescript
|
|
712
|
-
* const mcpServer: CustomMCPServer = {
|
|
713
|
-
* id: 'notion',
|
|
714
|
-
* name: 'Notion Integration',
|
|
715
|
-
* url: 'https://my-notion-mcp.example.com/mcp',
|
|
716
|
-
* auth: {
|
|
717
|
-
* type: 'bearer',
|
|
718
|
-
* token: process.env.NOTION_MCP_TOKEN
|
|
719
|
-
* },
|
|
720
|
-
* timeout: 30000,
|
|
721
|
-
* allowedTools: ['create_page', 'search_pages']
|
|
722
|
-
* }
|
|
723
|
-
* ```
|
|
724
|
-
*/
|
|
725
580
|
interface CustomMCPServer {
|
|
726
|
-
/** Unique identifier for this server instance (used in tool IDs: mcp:custom_{id}:toolname) */
|
|
727
581
|
id: string;
|
|
728
|
-
/** Display name for UI/logging */
|
|
729
582
|
name?: string;
|
|
730
|
-
/** Server URL (required) */
|
|
731
583
|
url: string;
|
|
732
|
-
/** Authentication configuration (treated as secret, never logged) */
|
|
733
584
|
auth?: CustomMCPServerAuth;
|
|
734
|
-
/** Optional: filter to only allow specific tools (by name) */
|
|
735
585
|
allowedTools?: string[];
|
|
736
|
-
/** Optional: timeout in milliseconds (default: 30000, max: 60000) */
|
|
737
586
|
timeout?: number;
|
|
738
|
-
/** Optional: transport type (default: 'streamable_http') */
|
|
739
587
|
transport?: 'streamable_http' | 'rest';
|
|
740
|
-
/** Optional: whether the server is enabled (default: true) */
|
|
741
588
|
enabled?: boolean;
|
|
742
589
|
}
|
|
743
590
|
interface ToolsConfig {
|
|
744
|
-
/** IDs of saved tools to use */
|
|
745
591
|
toolIds?: string[];
|
|
746
|
-
/** Inline runtime tool definitions (not persisted) */
|
|
747
592
|
runtimeTools?: RuntimeTool[];
|
|
748
|
-
/**
|
|
749
|
-
* Opt-in agent-driven subagent spawning. When set, the API synthesizes a
|
|
750
|
-
* `spawn_subagent` tool that the step's model can call at runtime. Pool
|
|
751
|
-
* entries must be a subset of the parent step's resolved tools.
|
|
752
|
-
*/
|
|
753
593
|
subagentConfig?: AgentSubagentConfig;
|
|
754
|
-
/**
|
|
755
|
-
* Custom MCP servers with credentials passed at runtime.
|
|
756
|
-
* Maximum 5 servers per step.
|
|
757
|
-
*
|
|
758
|
-
* @example
|
|
759
|
-
* ```typescript
|
|
760
|
-
* mcpServers: [{
|
|
761
|
-
* id: 'notion',
|
|
762
|
-
* url: 'https://my-mcp.example.com/mcp',
|
|
763
|
-
* auth: { type: 'bearer', token: process.env.MCP_TOKEN }
|
|
764
|
-
* }]
|
|
765
|
-
* ```
|
|
766
|
-
*/
|
|
767
594
|
mcpServers?: CustomMCPServer[];
|
|
768
|
-
/** Maximum number of tool calls allowed per step */
|
|
769
595
|
maxToolCalls?: number;
|
|
770
|
-
/** Tool call strategy: 'auto' (model decides), 'required' (must call), 'none' (disabled) */
|
|
771
596
|
toolCallStrategy?: 'auto' | 'required' | 'none';
|
|
772
|
-
/** Whether to allow parallel tool calls */
|
|
773
597
|
parallelCalls?: boolean;
|
|
774
|
-
/** Per-tool configuration overrides */
|
|
775
598
|
toolConfigs?: Record<string, JsonObject>;
|
|
776
599
|
}
|
|
777
|
-
/**
|
|
778
|
-
* Reasoning configuration for AI models that support extended thinking.
|
|
779
|
-
*
|
|
780
|
-
* Enables models like GPT-5, Claude 4, Gemini 2.5 to show their reasoning process.
|
|
781
|
-
* Different providers have different configuration options.
|
|
782
|
-
*
|
|
783
|
-
* @example Simple boolean (uses provider defaults)
|
|
784
|
-
* ```typescript
|
|
785
|
-
* reasoning: true
|
|
786
|
-
* ```
|
|
787
|
-
*
|
|
788
|
-
* @example GPT-5 with detailed reasoning
|
|
789
|
-
* ```typescript
|
|
790
|
-
* reasoning: {
|
|
791
|
-
* enabled: true,
|
|
792
|
-
* reasoningEffort: 'high',
|
|
793
|
-
* reasoningSummary: 'detailed'
|
|
794
|
-
* }
|
|
795
|
-
* ```
|
|
796
|
-
*
|
|
797
|
-
* @example Claude with thinking budget
|
|
798
|
-
* ```typescript
|
|
799
|
-
* reasoning: {
|
|
800
|
-
* enabled: true,
|
|
801
|
-
* budgetTokens: 16000
|
|
802
|
-
* }
|
|
803
|
-
* ```
|
|
804
|
-
*/
|
|
805
600
|
interface ReasoningConfig {
|
|
806
|
-
/** Enable reasoning (required) */
|
|
807
601
|
enabled: boolean;
|
|
808
|
-
/** Reasoning effort level for OpenAI models. 'xhigh' only available for GPT-5.1-Codex-Max */
|
|
809
602
|
reasoningEffort?: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
810
|
-
/** Reasoning summary mode - required for GPT-5 streaming. 'auto' for condensed, 'detailed' for comprehensive */
|
|
811
603
|
reasoningSummary?: 'auto' | 'detailed';
|
|
812
|
-
/** Maximum tokens for Claude extended thinking */
|
|
813
604
|
budgetTokens?: number;
|
|
814
|
-
/** Maximum tokens for Gemini thinking */
|
|
815
605
|
thinkingBudget?: number;
|
|
816
|
-
/** Whether to include thinking in the response */
|
|
817
606
|
includeThoughts?: boolean;
|
|
818
607
|
}
|
|
819
|
-
/**
|
|
820
|
-
* Reasoning configuration value - either a simple boolean or detailed config.
|
|
821
|
-
*
|
|
822
|
-
* @example Simple enable/disable
|
|
823
|
-
* ```typescript
|
|
824
|
-
* reasoning: true // Enable with provider defaults
|
|
825
|
-
* reasoning: false // Explicitly disable
|
|
826
|
-
* ```
|
|
827
|
-
*
|
|
828
|
-
* @example Detailed configuration
|
|
829
|
-
* ```typescript
|
|
830
|
-
* reasoning: { enabled: true, reasoningEffort: 'high' }
|
|
831
|
-
* ```
|
|
832
|
-
*/
|
|
833
608
|
type ReasoningValue = boolean | ReasoningConfig;
|
|
834
609
|
|
|
835
610
|
/**
|
|
@@ -5721,6 +5496,63 @@ declare class ClientEvalBuilder extends EvalBuilder {
|
|
|
5721
5496
|
run(): Promise<EvalResult>;
|
|
5722
5497
|
}
|
|
5723
5498
|
|
|
5499
|
+
/**
|
|
5500
|
+
* SDK Code Generation Metadata
|
|
5501
|
+
*
|
|
5502
|
+
* Type-safe field registry for generating SDK code from flow step configs.
|
|
5503
|
+
* Co-located with the step config interfaces so that adding or removing a
|
|
5504
|
+
* field on any config interface produces a compile error here, preventing
|
|
5505
|
+
* silent drift between the SDK and downstream code generators (e.g. the
|
|
5506
|
+
* dashboard's sdk-code-generator.ts).
|
|
5507
|
+
*/
|
|
5508
|
+
|
|
5509
|
+
/** How to serialize a field value into TypeScript source code. */
|
|
5510
|
+
type FieldFormat = 'json' | 'template' | 'raw' | 'value';
|
|
5511
|
+
/** Describes one field in a step config for code emission. */
|
|
5512
|
+
interface StepFieldMeta {
|
|
5513
|
+
/** Field key in the SDK config interface (emitted as the property name). */
|
|
5514
|
+
key: string;
|
|
5515
|
+
/** Serialization format. */
|
|
5516
|
+
format: FieldFormat;
|
|
5517
|
+
/**
|
|
5518
|
+
* Dot-path to read the value from the internal step config when it differs
|
|
5519
|
+
* from `key` (e.g. `'http.url'` for fetch-url).
|
|
5520
|
+
*/
|
|
5521
|
+
source?: string;
|
|
5522
|
+
/** Skip emission when the runtime value strictly equals this. */
|
|
5523
|
+
skipDefault?: unknown;
|
|
5524
|
+
/** Only emit when the value is truthy ('truthy') or falsy ('falsy'). */
|
|
5525
|
+
emitWhen?: 'truthy' | 'falsy';
|
|
5526
|
+
/**
|
|
5527
|
+
* Dot-path to a nested field that must be truthy for this field to emit.
|
|
5528
|
+
* Example: `'poll.enabled'` — emit the `poll` object only when `poll.enabled` is true.
|
|
5529
|
+
*/
|
|
5530
|
+
sourceCheck?: string;
|
|
5531
|
+
}
|
|
5532
|
+
/**
|
|
5533
|
+
* Maps step types to their field metadata arrays. Used by code generators to
|
|
5534
|
+
* iterate fields generically instead of maintaining per-step switch blocks.
|
|
5535
|
+
*
|
|
5536
|
+
* Step types with typed SDK config interfaces get compile-time checked entries.
|
|
5537
|
+
* Step types without interfaces (template, store-asset, generate-pdf) have
|
|
5538
|
+
* untyped field arrays matching the old switch-block behavior.
|
|
5539
|
+
*
|
|
5540
|
+
* Step types without typed interfaces or old switch-cases (tool-call,
|
|
5541
|
+
* paginate-api, store-vector, execute-agent) get a minimal entry with
|
|
5542
|
+
* just outputVariable and errorHandling (the common fields the old code
|
|
5543
|
+
* emitted for all step types).
|
|
5544
|
+
*
|
|
5545
|
+
* `api-call` shares fields with `fetch-url`; `update-record` shares with
|
|
5546
|
+
* `upsert-record`.
|
|
5547
|
+
*/
|
|
5548
|
+
declare const STEP_FIELD_REGISTRY: Record<string, readonly StepFieldMeta[]>;
|
|
5549
|
+
/**
|
|
5550
|
+
* Maps every step type to its FlowBuilder method name. Covers all known step
|
|
5551
|
+
* types including those without typed config interfaces. Code generators use
|
|
5552
|
+
* this instead of maintaining their own mapping.
|
|
5553
|
+
*/
|
|
5554
|
+
declare const STEP_TYPE_TO_METHOD: Record<string, string>;
|
|
5555
|
+
|
|
5724
5556
|
/**
|
|
5725
5557
|
* Default marathon workflow: research → planning → execution.
|
|
5726
5558
|
*
|
|
@@ -5789,4 +5621,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
|
|
|
5789
5621
|
declare function getDefaultPlanPath(taskName: string): string;
|
|
5790
5622
|
declare function sanitizeTaskSlug(taskName: string): string;
|
|
5791
5623
|
|
|
5792
|
-
export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, 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 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 };
|
|
5624
|
+
export { type Agent, type AgentApprovalCompleteEvent, type AgentApprovalStartEvent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMediaEvent, 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 FieldFormat, 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, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, 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 StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepFieldMeta, 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 };
|