@runtypelabs/sdk 1.21.0 → 1.21.2
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 +174 -589
- package/dist/index.d.ts +174 -589
- package/package.json +2 -1
package/dist/index.d.cts
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
|
}
|
|
@@ -278,7 +287,7 @@ type MessageContent = string | Array<TextContentPart | ImageContentPart | FileCo
|
|
|
278
287
|
/**
|
|
279
288
|
* Options for upsert mode - controls conflict detection and versioning
|
|
280
289
|
*/
|
|
281
|
-
interface UpsertOptions$
|
|
290
|
+
interface UpsertOptions$1 {
|
|
282
291
|
/** Whether to create a version snapshot before updating (default: true) */
|
|
283
292
|
createVersionOnChange?: boolean;
|
|
284
293
|
/** Allow overwriting changes made via dashboard/API (default: false) */
|
|
@@ -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,19 +323,13 @@ 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';
|
|
340
329
|
versionLabel?: string;
|
|
341
330
|
versionNotes?: string;
|
|
342
331
|
flowVersionId?: string;
|
|
343
|
-
upsertOptions?: UpsertOptions$
|
|
332
|
+
upsertOptions?: UpsertOptions$1;
|
|
344
333
|
flowTimeoutMs?: number;
|
|
345
334
|
stepTimeoutMs?: number;
|
|
346
335
|
};
|
|
@@ -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
|
/**
|
|
@@ -907,6 +682,123 @@ interface ContextErrorHandling {
|
|
|
907
682
|
fallbacks?: ContextFallback[];
|
|
908
683
|
}
|
|
909
684
|
|
|
685
|
+
/**
|
|
686
|
+
* FlowResult - Wrapper for streaming flow execution responses
|
|
687
|
+
*
|
|
688
|
+
* Provides convenient methods for processing streaming responses
|
|
689
|
+
* from the Runtype API dispatch endpoint.
|
|
690
|
+
*/
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Result wrapper for flow execution
|
|
694
|
+
*
|
|
695
|
+
* Provides multiple ways to consume the streaming response:
|
|
696
|
+
* - `.stream(callbacks)` - Process with callbacks
|
|
697
|
+
* - `.getResult(stepName)` - Get result from a specific step
|
|
698
|
+
* - `.getAllResults()` - Get all step results
|
|
699
|
+
* - `.raw` - Access the raw Response for manual handling
|
|
700
|
+
*
|
|
701
|
+
* @example
|
|
702
|
+
* ```typescript
|
|
703
|
+
* const result = await flow.run(apiClient, options)
|
|
704
|
+
*
|
|
705
|
+
* // Option 1: Process with callbacks
|
|
706
|
+
* const summary = await result.stream({
|
|
707
|
+
* onStepDelta: (text) => process.stdout.write(text),
|
|
708
|
+
* })
|
|
709
|
+
*
|
|
710
|
+
* // Option 2: Just get a specific step's result
|
|
711
|
+
* const analysis = await result.getResult('Analyze Data')
|
|
712
|
+
*
|
|
713
|
+
* // Option 3: Get all results
|
|
714
|
+
* const allResults = await result.getAllResults()
|
|
715
|
+
* ```
|
|
716
|
+
*/
|
|
717
|
+
declare class FlowResult {
|
|
718
|
+
private response;
|
|
719
|
+
private consumed;
|
|
720
|
+
private cachedSummary;
|
|
721
|
+
constructor(response: Response, summary?: FlowSummary);
|
|
722
|
+
/**
|
|
723
|
+
* Get the raw Response object for manual handling
|
|
724
|
+
*
|
|
725
|
+
* Note: The response body can only be consumed once.
|
|
726
|
+
* Using this will prevent using other methods like stream() or getResult().
|
|
727
|
+
*/
|
|
728
|
+
get raw(): Response;
|
|
729
|
+
/**
|
|
730
|
+
* Check if the response has already been consumed
|
|
731
|
+
*/
|
|
732
|
+
get isConsumed(): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Process the streaming response with callbacks
|
|
735
|
+
*
|
|
736
|
+
* @param callbacks - Callbacks for different event types
|
|
737
|
+
* @returns Promise resolving to FlowSummary when complete
|
|
738
|
+
*
|
|
739
|
+
* @example
|
|
740
|
+
* ```typescript
|
|
741
|
+
* const summary = await result.stream({
|
|
742
|
+
* onStepStart: (event) => console.log('Starting:', event.name),
|
|
743
|
+
* onStepDelta: (text) => process.stdout.write(text),
|
|
744
|
+
* onStepComplete: (result, event) => console.log('Done:', event.name),
|
|
745
|
+
* onFlowComplete: (event) => console.log('Flow complete!'),
|
|
746
|
+
* })
|
|
747
|
+
* ```
|
|
748
|
+
*/
|
|
749
|
+
stream(callbacks?: StreamCallbacks): Promise<FlowSummary>;
|
|
750
|
+
/**
|
|
751
|
+
* Get the result from a specific step by its name
|
|
752
|
+
*
|
|
753
|
+
* Matches against the `name` property you set when creating the step.
|
|
754
|
+
* - **Case-sensitive**: `'Analyze'` ≠ `'analyze'`
|
|
755
|
+
* - **Exact match only**: no partial or fuzzy matching
|
|
756
|
+
* - Returns `undefined` if no step with that name is found
|
|
757
|
+
*
|
|
758
|
+
* @param stepName - The exact step name (from the `name` property when creating the step)
|
|
759
|
+
* @returns The step's result, or undefined if not found
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
* ```typescript
|
|
763
|
+
* // When building:
|
|
764
|
+
* .prompt({ name: 'Analyze Screenshot', model: 'gpt-4', ... })
|
|
765
|
+
*
|
|
766
|
+
* // When retrieving (must match exactly):
|
|
767
|
+
* const analysis = await result.getResult('Analyze Screenshot') // ✓ Works
|
|
768
|
+
* const analysis = await result.getResult('analyze screenshot') // ✗ undefined
|
|
769
|
+
* ```
|
|
770
|
+
*/
|
|
771
|
+
getResult(stepName: string): Promise<any>;
|
|
772
|
+
/**
|
|
773
|
+
* Get all step results as a Map
|
|
774
|
+
*
|
|
775
|
+
* @returns Map of step name to result
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* ```typescript
|
|
779
|
+
* const allResults = await result.getAllResults()
|
|
780
|
+
* for (const [stepName, result] of allResults) {
|
|
781
|
+
* console.log(stepName, result)
|
|
782
|
+
* }
|
|
783
|
+
* ```
|
|
784
|
+
*/
|
|
785
|
+
getAllResults(): Promise<Map<string, any>>;
|
|
786
|
+
/**
|
|
787
|
+
* Get the flow summary after processing
|
|
788
|
+
*
|
|
789
|
+
* @returns FlowSummary with execution details
|
|
790
|
+
*/
|
|
791
|
+
getSummary(): Promise<FlowSummary>;
|
|
792
|
+
/**
|
|
793
|
+
* Ensure the stream has been processed and return the summary
|
|
794
|
+
*/
|
|
795
|
+
private ensureSummary;
|
|
796
|
+
/**
|
|
797
|
+
* Ensure the response hasn't been consumed yet
|
|
798
|
+
*/
|
|
799
|
+
private ensureNotConsumed;
|
|
800
|
+
}
|
|
801
|
+
|
|
910
802
|
/**
|
|
911
803
|
* FlowBuilder - Fluent builder for constructing dispatch configurations
|
|
912
804
|
*
|
|
@@ -1230,7 +1122,7 @@ interface RecordConfig$1 {
|
|
|
1230
1122
|
/**
|
|
1231
1123
|
* Options for upsert mode - controls conflict detection and versioning
|
|
1232
1124
|
*/
|
|
1233
|
-
interface UpsertOptions
|
|
1125
|
+
interface UpsertOptions {
|
|
1234
1126
|
/** Whether to create a version snapshot before updating (default: true) */
|
|
1235
1127
|
createVersionOnChange?: boolean;
|
|
1236
1128
|
/** Allow overwriting changes made via dashboard/API (default: false) */
|
|
@@ -1250,7 +1142,7 @@ interface DispatchOptions$1 {
|
|
|
1250
1142
|
versionNotes?: string;
|
|
1251
1143
|
flowVersionId?: string;
|
|
1252
1144
|
/** Options for upsert mode (only used when flowMode is 'upsert') */
|
|
1253
|
-
upsertOptions?: UpsertOptions
|
|
1145
|
+
upsertOptions?: UpsertOptions;
|
|
1254
1146
|
flowTimeoutMs?: number;
|
|
1255
1147
|
stepTimeoutMs?: number;
|
|
1256
1148
|
}
|
|
@@ -1788,362 +1680,55 @@ declare function createExternalTool(config: {
|
|
|
1788
1680
|
}): RuntimeTool;
|
|
1789
1681
|
|
|
1790
1682
|
/**
|
|
1791
|
-
*
|
|
1683
|
+
* FlowsNamespace - Static namespace for flow operations
|
|
1792
1684
|
*
|
|
1793
|
-
* Provides
|
|
1794
|
-
*
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
/**
|
|
1798
|
-
* Result wrapper for flow execution
|
|
1799
|
-
*
|
|
1800
|
-
* Provides multiple ways to consume the streaming response:
|
|
1801
|
-
* - `.stream(callbacks)` - Process with callbacks
|
|
1802
|
-
* - `.getResult(stepName)` - Get result from a specific step
|
|
1803
|
-
* - `.getAllResults()` - Get all step results
|
|
1804
|
-
* - `.raw` - Access the raw Response for manual handling
|
|
1805
|
-
*
|
|
1806
|
-
* @example
|
|
1807
|
-
* ```typescript
|
|
1808
|
-
* const result = await flow.run(apiClient, options)
|
|
1809
|
-
*
|
|
1810
|
-
* // Option 1: Process with callbacks
|
|
1811
|
-
* const summary = await result.stream({
|
|
1812
|
-
* onStepDelta: (text) => process.stdout.write(text),
|
|
1813
|
-
* })
|
|
1814
|
-
*
|
|
1815
|
-
* // Option 2: Just get a specific step's result
|
|
1816
|
-
* const analysis = await result.getResult('Analyze Data')
|
|
1817
|
-
*
|
|
1818
|
-
* // Option 3: Get all results
|
|
1819
|
-
* const allResults = await result.getAllResults()
|
|
1820
|
-
* ```
|
|
1821
|
-
*/
|
|
1822
|
-
declare class FlowResult {
|
|
1823
|
-
private response;
|
|
1824
|
-
private consumed;
|
|
1825
|
-
private cachedSummary;
|
|
1826
|
-
constructor(response: Response, summary?: FlowSummary);
|
|
1827
|
-
/**
|
|
1828
|
-
* Get the raw Response object for manual handling
|
|
1829
|
-
*
|
|
1830
|
-
* Note: The response body can only be consumed once.
|
|
1831
|
-
* Using this will prevent using other methods like stream() or getResult().
|
|
1832
|
-
*/
|
|
1833
|
-
get raw(): Response;
|
|
1834
|
-
/**
|
|
1835
|
-
* Check if the response has already been consumed
|
|
1836
|
-
*/
|
|
1837
|
-
get isConsumed(): boolean;
|
|
1838
|
-
/**
|
|
1839
|
-
* Process the streaming response with callbacks
|
|
1840
|
-
*
|
|
1841
|
-
* @param callbacks - Callbacks for different event types
|
|
1842
|
-
* @returns Promise resolving to FlowSummary when complete
|
|
1843
|
-
*
|
|
1844
|
-
* @example
|
|
1845
|
-
* ```typescript
|
|
1846
|
-
* const summary = await result.stream({
|
|
1847
|
-
* onStepStart: (event) => console.log('Starting:', event.name),
|
|
1848
|
-
* onStepDelta: (text) => process.stdout.write(text),
|
|
1849
|
-
* onStepComplete: (result, event) => console.log('Done:', event.name),
|
|
1850
|
-
* onFlowComplete: (event) => console.log('Flow complete!'),
|
|
1851
|
-
* })
|
|
1852
|
-
* ```
|
|
1853
|
-
*/
|
|
1854
|
-
stream(callbacks?: StreamCallbacks): Promise<FlowSummary>;
|
|
1855
|
-
/**
|
|
1856
|
-
* Get the result from a specific step by its name
|
|
1857
|
-
*
|
|
1858
|
-
* Matches against the `name` property you set when creating the step.
|
|
1859
|
-
* - **Case-sensitive**: `'Analyze'` ≠ `'analyze'`
|
|
1860
|
-
* - **Exact match only**: no partial or fuzzy matching
|
|
1861
|
-
* - Returns `undefined` if no step with that name is found
|
|
1862
|
-
*
|
|
1863
|
-
* @param stepName - The exact step name (from the `name` property when creating the step)
|
|
1864
|
-
* @returns The step's result, or undefined if not found
|
|
1865
|
-
*
|
|
1866
|
-
* @example
|
|
1867
|
-
* ```typescript
|
|
1868
|
-
* // When building:
|
|
1869
|
-
* .prompt({ name: 'Analyze Screenshot', model: 'gpt-4', ... })
|
|
1870
|
-
*
|
|
1871
|
-
* // When retrieving (must match exactly):
|
|
1872
|
-
* const analysis = await result.getResult('Analyze Screenshot') // ✓ Works
|
|
1873
|
-
* const analysis = await result.getResult('analyze screenshot') // ✗ undefined
|
|
1874
|
-
* ```
|
|
1875
|
-
*/
|
|
1876
|
-
getResult(stepName: string): Promise<any>;
|
|
1877
|
-
/**
|
|
1878
|
-
* Get all step results as a Map
|
|
1879
|
-
*
|
|
1880
|
-
* @returns Map of step name to result
|
|
1881
|
-
*
|
|
1882
|
-
* @example
|
|
1883
|
-
* ```typescript
|
|
1884
|
-
* const allResults = await result.getAllResults()
|
|
1885
|
-
* for (const [stepName, result] of allResults) {
|
|
1886
|
-
* console.log(stepName, result)
|
|
1887
|
-
* }
|
|
1888
|
-
* ```
|
|
1889
|
-
*/
|
|
1890
|
-
getAllResults(): Promise<Map<string, any>>;
|
|
1891
|
-
/**
|
|
1892
|
-
* Get the flow summary after processing
|
|
1893
|
-
*
|
|
1894
|
-
* @returns FlowSummary with execution details
|
|
1895
|
-
*/
|
|
1896
|
-
getSummary(): Promise<FlowSummary>;
|
|
1897
|
-
/**
|
|
1898
|
-
* Ensure the stream has been processed and return the summary
|
|
1899
|
-
*/
|
|
1900
|
-
private ensureSummary;
|
|
1901
|
-
/**
|
|
1902
|
-
* Ensure the response hasn't been consumed yet
|
|
1903
|
-
*/
|
|
1904
|
-
private ensureNotConsumed;
|
|
1905
|
-
}
|
|
1906
|
-
|
|
1907
|
-
/**
|
|
1908
|
-
* FlowsNamespace - Static namespace for flow operations
|
|
1909
|
-
*
|
|
1910
|
-
* Provides factory methods for creating flow builders with different modes:
|
|
1911
|
-
* - upsert: Create or update a flow by name
|
|
1912
|
-
* - virtual: One-off execution without saving
|
|
1913
|
-
* - use: Execute an existing flow by ID
|
|
1685
|
+
* Provides factory methods for creating flow builders with different modes:
|
|
1686
|
+
* - upsert: Create or update a flow by name
|
|
1687
|
+
* - virtual: One-off execution without saving
|
|
1688
|
+
* - use: Execute an existing flow by ID
|
|
1914
1689
|
*/
|
|
1915
1690
|
|
|
1916
1691
|
interface LocalToolsOptions {
|
|
1917
1692
|
localTools?: Record<string, (args: unknown) => Promise<unknown>>;
|
|
1918
1693
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}
|
|
1923
|
-
interface UpsertFlowConfig extends FlowConfig {
|
|
1924
|
-
/** Whether to create a version snapshot before updating (default: true) */
|
|
1925
|
-
createVersionOnChange?: boolean;
|
|
1926
|
-
/** Allow overwriting changes made via dashboard/API (default: false) */
|
|
1927
|
-
allowOverwriteExternalChanges?: boolean;
|
|
1928
|
-
}
|
|
1929
|
-
interface RecordConfig {
|
|
1930
|
-
id?: number | string;
|
|
1931
|
-
name?: string;
|
|
1932
|
-
type?: string;
|
|
1694
|
+
type FlowConfig = FlowConfig$1;
|
|
1695
|
+
type UpsertFlowConfig = UpsertFlowConfig$1;
|
|
1696
|
+
type RecordConfig = Omit<RecordConfig$1, 'metadata'> & {
|
|
1933
1697
|
metadata?: JsonObject;
|
|
1934
|
-
}
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
userPrompt: string;
|
|
1943
|
-
systemPrompt?: string;
|
|
1944
|
-
previousMessages?: string | Array<{
|
|
1945
|
-
role: string;
|
|
1946
|
-
content: string;
|
|
1947
|
-
}>;
|
|
1948
|
-
outputVariable?: string;
|
|
1949
|
-
responseFormat?: 'text' | 'json';
|
|
1950
|
-
temperature?: number;
|
|
1951
|
-
topP?: number;
|
|
1952
|
-
topK?: number;
|
|
1953
|
-
frequencyPenalty?: number;
|
|
1954
|
-
presencePenalty?: number;
|
|
1955
|
-
seed?: number;
|
|
1956
|
-
maxTokens?: number;
|
|
1957
|
-
/** Enable reasoning/extended thinking. Use `true` for defaults or `ReasoningConfig` for fine-grained control */
|
|
1958
|
-
reasoning?: boolean | ReasoningConfig;
|
|
1959
|
-
streamOutput?: boolean;
|
|
1960
|
-
tools?: {
|
|
1961
|
-
toolIds?: string[];
|
|
1962
|
-
[key: string]: unknown;
|
|
1963
|
-
};
|
|
1964
|
-
/** Error handling configuration - supports simple mode or fallback chains */
|
|
1965
|
-
errorHandling?: ErrorHandlingMode | PromptErrorHandling;
|
|
1966
|
-
enabled?: boolean;
|
|
1967
|
-
}
|
|
1968
|
-
interface FetchUrlStepConfig {
|
|
1969
|
-
name: string;
|
|
1970
|
-
url: string;
|
|
1971
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
1972
|
-
headers?: Record<string, string>;
|
|
1973
|
-
body?: string;
|
|
1974
|
-
responseType?: 'json' | 'text' | 'xml';
|
|
1975
|
-
markdownIfAvailable?: boolean;
|
|
1976
|
-
outputVariable?: string;
|
|
1977
|
-
fetchMethod?: 'http' | 'firecrawl';
|
|
1698
|
+
};
|
|
1699
|
+
type Message = Message$1;
|
|
1700
|
+
type NamespaceStepConfig<T> = Omit<T, 'when'>;
|
|
1701
|
+
type FetchUrlNamespaceConfig = NamespaceStepConfig<FetchUrlStepConfig$1>;
|
|
1702
|
+
type ConditionalNamespaceConfig = NamespaceStepConfig<ConditionalStepConfig$1>;
|
|
1703
|
+
type SendEventNamespaceConfig = NamespaceStepConfig<SendEventStepConfig$1>;
|
|
1704
|
+
type PromptStepConfig = NamespaceStepConfig<PromptStepConfig$1>;
|
|
1705
|
+
type FetchUrlStepConfig = Omit<FetchUrlNamespaceConfig, 'firecrawl'> & {
|
|
1978
1706
|
firecrawl?: {
|
|
1979
1707
|
formats?: string[];
|
|
1980
1708
|
[key: string]: unknown;
|
|
1981
1709
|
};
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
}
|
|
1987
|
-
interface TransformDataStepConfig {
|
|
1988
|
-
name: string;
|
|
1989
|
-
script: string;
|
|
1990
|
-
outputVariable?: string;
|
|
1991
|
-
streamOutput?: boolean;
|
|
1992
|
-
enabled?: boolean;
|
|
1993
|
-
}
|
|
1994
|
-
interface SetVariableStepConfig {
|
|
1995
|
-
name: string;
|
|
1996
|
-
variableName: string;
|
|
1997
|
-
value: string | number | boolean | object;
|
|
1998
|
-
enabled?: boolean;
|
|
1999
|
-
}
|
|
2000
|
-
interface ConditionalStepConfig {
|
|
2001
|
-
name: string;
|
|
2002
|
-
condition: string;
|
|
1710
|
+
};
|
|
1711
|
+
type TransformDataStepConfig = Omit<NamespaceStepConfig<TransformDataStepConfig$1>, 'sandboxProvider'>;
|
|
1712
|
+
type SetVariableStepConfig = NamespaceStepConfig<SetVariableStepConfig$1>;
|
|
1713
|
+
type ConditionalStepConfig = Omit<ConditionalNamespaceConfig, 'trueSteps' | 'falseSteps'> & {
|
|
2003
1714
|
trueSteps?: unknown[];
|
|
2004
1715
|
falseSteps?: unknown[];
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
errorHandling?: ErrorHandlingMode | ContextErrorHandling;
|
|
2016
|
-
streamOutput?: boolean;
|
|
2017
|
-
enabled?: boolean;
|
|
2018
|
-
}
|
|
2019
|
-
interface SendEmailStepConfig {
|
|
2020
|
-
name: string;
|
|
2021
|
-
to: string;
|
|
2022
|
-
from?: string;
|
|
2023
|
-
subject: string;
|
|
2024
|
-
html: string;
|
|
2025
|
-
outputVariable?: string;
|
|
2026
|
-
/** Error handling configuration - supports simple mode or fallback chains */
|
|
2027
|
-
errorHandling?: ErrorHandlingMode | ContextErrorHandling;
|
|
2028
|
-
streamOutput?: boolean;
|
|
2029
|
-
enabled?: boolean;
|
|
2030
|
-
}
|
|
2031
|
-
interface SendStreamStepConfig {
|
|
2032
|
-
name: string;
|
|
2033
|
-
message: string;
|
|
2034
|
-
enabled?: boolean;
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
interface RetrieveRecordStepConfig {
|
|
2038
|
-
name: string;
|
|
2039
|
-
recordType?: string;
|
|
2040
|
-
recordName?: string;
|
|
2041
|
-
/** Chip-style filter (metadata + top-level columns). See flow-builder.ts. */
|
|
2042
|
-
recordFilter?: RecordFilter;
|
|
2043
|
-
fieldsToInclude?: string[];
|
|
2044
|
-
fieldsToExclude?: string[];
|
|
2045
|
-
outputVariable?: string;
|
|
2046
|
-
streamOutput?: boolean;
|
|
2047
|
-
enabled?: boolean;
|
|
2048
|
-
}
|
|
2049
|
-
interface UpsertRecordStepConfig {
|
|
2050
|
-
name: string;
|
|
2051
|
-
recordType: string;
|
|
2052
|
-
recordName?: string;
|
|
2053
|
-
sourceVariable?: string;
|
|
2054
|
-
mergeStrategy?: 'merge' | 'replace';
|
|
2055
|
-
outputVariable?: string;
|
|
2056
|
-
/** Error handling configuration - supports simple mode or fallback chains */
|
|
2057
|
-
errorHandling?: ErrorHandlingMode | ContextErrorHandling;
|
|
2058
|
-
streamOutput?: boolean;
|
|
2059
|
-
enabled?: boolean;
|
|
2060
|
-
}
|
|
2061
|
-
interface VectorSearchStepConfig {
|
|
2062
|
-
name: string;
|
|
2063
|
-
query: string;
|
|
2064
|
-
recordType?: string;
|
|
2065
|
-
embeddingModel?: string;
|
|
2066
|
-
limit?: number;
|
|
2067
|
-
threshold?: number;
|
|
2068
|
-
outputVariable?: string;
|
|
2069
|
-
streamOutput?: boolean;
|
|
2070
|
-
enabled?: boolean;
|
|
2071
|
-
}
|
|
2072
|
-
interface GenerateEmbeddingStepConfig {
|
|
2073
|
-
name: string;
|
|
2074
|
-
text: string;
|
|
2075
|
-
embeddingModel?: string;
|
|
2076
|
-
maxLength?: number;
|
|
2077
|
-
outputVariable?: string;
|
|
2078
|
-
streamOutput?: boolean;
|
|
2079
|
-
enabled?: boolean;
|
|
2080
|
-
}
|
|
2081
|
-
interface WaitUntilStepConfig {
|
|
2082
|
-
name: string;
|
|
2083
|
-
delayMs?: number;
|
|
2084
|
-
continueOnTimeout?: boolean;
|
|
2085
|
-
poll?: {
|
|
2086
|
-
enabled: boolean;
|
|
2087
|
-
intervalMs?: number;
|
|
2088
|
-
maxAttempts?: number;
|
|
2089
|
-
condition?: string;
|
|
2090
|
-
};
|
|
2091
|
-
outputVariable?: string;
|
|
2092
|
-
/** Error handling configuration - supports simple mode or fallback chains */
|
|
2093
|
-
errorHandling?: ErrorHandlingMode | ContextErrorHandling;
|
|
2094
|
-
streamOutput?: boolean;
|
|
2095
|
-
enabled?: boolean;
|
|
2096
|
-
}
|
|
2097
|
-
interface SendEventStepConfig {
|
|
2098
|
-
name: string;
|
|
2099
|
-
provider: string;
|
|
2100
|
-
eventName: string;
|
|
1716
|
+
};
|
|
1717
|
+
type SearchStepConfig = NamespaceStepConfig<SearchStepConfig$1>;
|
|
1718
|
+
type SendEmailStepConfig = NamespaceStepConfig<SendEmailStepConfig$1>;
|
|
1719
|
+
type SendStreamStepConfig = NamespaceStepConfig<SendStreamStepConfig$1>;
|
|
1720
|
+
type RetrieveRecordStepConfig = NamespaceStepConfig<RetrieveRecordStepConfig$1>;
|
|
1721
|
+
type UpsertRecordStepConfig = NamespaceStepConfig<UpsertRecordStepConfig$1>;
|
|
1722
|
+
type VectorSearchStepConfig = NamespaceStepConfig<VectorSearchStepConfig$1>;
|
|
1723
|
+
type GenerateEmbeddingStepConfig = NamespaceStepConfig<GenerateEmbeddingStepConfig$1>;
|
|
1724
|
+
type WaitUntilStepConfig = NamespaceStepConfig<WaitUntilStepConfig$1>;
|
|
1725
|
+
type SendEventStepConfig = Omit<SendEventNamespaceConfig, 'properties'> & {
|
|
2101
1726
|
properties?: Record<string, unknown>;
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
}
|
|
2108
|
-
interface SendTextStepConfig {
|
|
2109
|
-
name: string;
|
|
2110
|
-
to: string;
|
|
2111
|
-
from?: string;
|
|
2112
|
-
message: string;
|
|
2113
|
-
outputVariable?: string;
|
|
2114
|
-
/** Error handling configuration - supports simple mode or fallback chains */
|
|
2115
|
-
errorHandling?: ErrorHandlingMode | ContextErrorHandling;
|
|
2116
|
-
streamOutput?: boolean;
|
|
2117
|
-
enabled?: boolean;
|
|
2118
|
-
}
|
|
2119
|
-
interface FetchGitHubStepConfig {
|
|
2120
|
-
name: string;
|
|
2121
|
-
repository: string;
|
|
2122
|
-
branch?: string;
|
|
2123
|
-
path?: string;
|
|
2124
|
-
outputVariable?: string;
|
|
2125
|
-
streamOutput?: boolean;
|
|
2126
|
-
enabled?: boolean;
|
|
2127
|
-
}
|
|
2128
|
-
interface UpsertOptions {
|
|
2129
|
-
createVersionOnChange?: boolean;
|
|
2130
|
-
allowOverwriteExternalChanges?: boolean;
|
|
2131
|
-
}
|
|
2132
|
-
interface DispatchOptions {
|
|
2133
|
-
streamResponse?: boolean;
|
|
2134
|
-
modelOverride?: string;
|
|
2135
|
-
recordMode?: 'existing' | 'create' | 'virtual';
|
|
2136
|
-
flowMode?: 'existing' | 'create' | 'virtual' | 'upsert';
|
|
2137
|
-
storeResults?: boolean;
|
|
2138
|
-
autoAppendMetadata?: boolean;
|
|
2139
|
-
debugMode?: boolean;
|
|
2140
|
-
createVersion?: boolean;
|
|
2141
|
-
versionType?: 'published' | 'draft' | 'test' | 'virtual';
|
|
2142
|
-
versionLabel?: string;
|
|
2143
|
-
versionNotes?: string;
|
|
2144
|
-
flowVersionId?: string;
|
|
2145
|
-
upsertOptions?: UpsertOptions;
|
|
2146
|
-
}
|
|
1727
|
+
};
|
|
1728
|
+
type SendTextStepConfig = NamespaceStepConfig<SendTextStepConfig$1>;
|
|
1729
|
+
type FetchGitHubStepConfig = NamespaceStepConfig<FetchGitHubStepConfig$1>;
|
|
1730
|
+
|
|
1731
|
+
type DispatchOptions = Omit<DispatchOptions$1, 'flowTimeoutMs' | 'stepTimeoutMs'>;
|
|
2147
1732
|
declare class FlowsNamespace {
|
|
2148
1733
|
private getClient;
|
|
2149
1734
|
constructor(getClient: () => RuntypeClient$1);
|
|
@@ -5846,4 +5431,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
|
|
|
5846
5431
|
declare function getDefaultPlanPath(taskName: string): string;
|
|
5847
5432
|
declare function sanitizeTaskSlug(taskName: string): string;
|
|
5848
5433
|
|
|
5849
|
-
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$
|
|
5434
|
+
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$1 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 };
|