@runtypelabs/sdk 1.7.3 → 1.8.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.d.cts CHANGED
@@ -445,6 +445,7 @@ interface DeploySandboxRequest {
445
445
  port?: number;
446
446
  sandboxId?: string;
447
447
  startCommand?: string;
448
+ files?: Record<string, string>;
448
449
  }
449
450
  interface DeploySandboxResponse {
450
451
  sandboxId: string;
@@ -4119,6 +4120,17 @@ interface AgentExecuteRequest {
4119
4120
  /** Runtime tools to make available during execution */
4120
4121
  tools?: {
4121
4122
  runtimeTools?: AgentRuntimeToolDefinition[];
4123
+ /** IDs of built-in tools to enable (e.g., "exa", "firecrawl", "dalle") */
4124
+ toolIds?: string[];
4125
+ };
4126
+ /** Context-management hints for long-running marathon sessions */
4127
+ contextManagement?: {
4128
+ compactStrategy?: 'auto' | 'provider_native' | 'summary_fallback';
4129
+ compactInstructions?: string;
4130
+ nativeCompaction?: {
4131
+ provider: 'anthropic';
4132
+ thresholdTokens: number;
4133
+ };
4122
4134
  };
4123
4135
  }
4124
4136
  /**
@@ -4129,6 +4141,10 @@ interface AgentExecuteResponse {
4129
4141
  result: string;
4130
4142
  iterations: number;
4131
4143
  totalCost: number;
4144
+ totalTokens?: {
4145
+ input: number;
4146
+ output: number;
4147
+ };
4132
4148
  stopReason: 'complete' | 'end_turn' | 'max_turns' | 'max_cost' | 'timeout' | 'error';
4133
4149
  reflections?: string[];
4134
4150
  error?: string;
@@ -4177,6 +4193,11 @@ interface RunTaskSessionSummary {
4177
4193
  index: number;
4178
4194
  /** Cost of this individual session (USD) */
4179
4195
  cost: number;
4196
+ /** Token counts for this session */
4197
+ totalTokens?: {
4198
+ input: number;
4199
+ output: number;
4200
+ };
4180
4201
  /** Number of loop iterations in this session */
4181
4202
  iterations: number;
4182
4203
  /** Why this session stopped */
@@ -4217,6 +4238,11 @@ interface RunTaskState {
4217
4238
  sessionCount: number;
4218
4239
  /** Total cost across all sessions (USD) */
4219
4240
  totalCost: number;
4241
+ /** Total tokens across all sessions */
4242
+ totalTokens?: {
4243
+ input: number;
4244
+ output: number;
4245
+ };
4220
4246
  /** Last agent output (full text) */
4221
4247
  lastOutput: string;
4222
4248
  /** Last terminal error captured from agent execution */
@@ -4278,6 +4304,44 @@ type RunTaskResumeState = Pick<RunTaskState, 'originalMessage' | 'bootstrapConte
4278
4304
  * Return `false` to stop the loop early.
4279
4305
  */
4280
4306
  type RunTaskOnSession = (state: RunTaskState) => void | false | Promise<void | false>;
4307
+ type RunTaskContextCompactionStrategy = 'auto' | 'provider_native' | 'summary_fallback';
4308
+ interface RunTaskContextBudgetBreakdown {
4309
+ historyTokens: number;
4310
+ toolOutputTokens: number;
4311
+ currentTurnTokens: number;
4312
+ toolDefinitionTokens: number;
4313
+ summaryTokens?: number;
4314
+ reservedOutputTokens?: number;
4315
+ effectiveInputBudgetTokens?: number;
4316
+ estimatedInputTokens: number;
4317
+ }
4318
+ interface RunTaskContextCompactionEvent {
4319
+ phase: 'start' | 'complete';
4320
+ mode: 'auto' | 'forced';
4321
+ strategy: Exclude<RunTaskContextCompactionStrategy, 'auto'>;
4322
+ sessionIndex: number;
4323
+ model?: string;
4324
+ estimatedTokens?: number;
4325
+ thresholdTokens?: number;
4326
+ contextLimitTokens?: number;
4327
+ effectiveInputBudgetTokens?: number;
4328
+ reservedOutputTokens?: number;
4329
+ beforeTokens?: number;
4330
+ afterTokens?: number;
4331
+ breakdown?: RunTaskContextBudgetBreakdown;
4332
+ }
4333
+ type RunTaskOnContextCompaction = (event: RunTaskContextCompactionEvent) => void | Promise<void>;
4334
+ interface RunTaskContextNoticeEvent {
4335
+ kind: 'provider_native_compaction' | 'tool_definitions_warning';
4336
+ sessionIndex: number;
4337
+ model?: string;
4338
+ message: string;
4339
+ estimatedTokens?: number;
4340
+ contextLimitTokens?: number;
4341
+ effectiveInputBudgetTokens?: number;
4342
+ reservedOutputTokens?: number;
4343
+ }
4344
+ type RunTaskOnContextNotice = (event: RunTaskContextNoticeEvent) => void | Promise<void>;
4281
4345
  /**
4282
4346
  * Options for `agents.runTask()`
4283
4347
  */
@@ -4317,6 +4381,18 @@ interface RunTaskOptions {
4317
4381
  continuationMessage?: string;
4318
4382
  /** Use compact summary instead of full message history for continuation */
4319
4383
  compact?: boolean;
4384
+ /** Estimated input token threshold that triggers compact-summary mode for long histories */
4385
+ autoCompactTokenThreshold?: number;
4386
+ /** Effective context window for the active model, used for compaction UX/status */
4387
+ contextLimitTokens?: number;
4388
+ /** Which compaction strategy to prefer. `auto` defaults to provider-native when supported. */
4389
+ compactStrategy?: RunTaskContextCompactionStrategy;
4390
+ /** Optional instructions to preserve specific context when generating compact summaries. */
4391
+ compactInstructions?: string;
4392
+ /** Called when marathon history compaction starts or completes */
4393
+ onContextCompaction?: RunTaskOnContextCompaction;
4394
+ /** Called when marathon context-management warnings or notices should be surfaced */
4395
+ onContextNotice?: RunTaskOnContextNotice;
4320
4396
  /** Saved workflow state to seed a resumed or restarted marathon run */
4321
4397
  resumeState?: RunTaskResumeState;
4322
4398
  /** How tool results are stored in message history for continuation.
@@ -4330,6 +4406,8 @@ interface RunTaskOptions {
4330
4406
  toolWindow?: 'session' | number;
4331
4407
  /** Custom workflow definition (defaults to the built-in research→planning→execution workflow) */
4332
4408
  workflow?: WorkflowDefinition;
4409
+ /** IDs of built-in tools to enable for the agent (e.g., "exa", "firecrawl", "dalle") */
4410
+ toolIds?: string[];
4333
4411
  }
4334
4412
  /**
4335
4413
  * Final result returned by `agents.runTask()`
@@ -4338,6 +4416,10 @@ interface RunTaskResult {
4338
4416
  status: RunTaskStatus;
4339
4417
  sessionCount: number;
4340
4418
  totalCost: number;
4419
+ totalTokens?: {
4420
+ input: number;
4421
+ output: number;
4422
+ };
4341
4423
  lastOutput: string;
4342
4424
  sessions: RunTaskSessionSummary[];
4343
4425
  /** The record ID if trackProgress was enabled */
@@ -4362,6 +4444,8 @@ interface Agent {
4362
4444
  */
4363
4445
  declare class AgentsEndpoint {
4364
4446
  private client;
4447
+ private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
4448
+ private static readonly FORCED_COMPACT_SUMMARY_PREFIX;
4365
4449
  constructor(client: ApiClient);
4366
4450
  /**
4367
4451
  * List all agents for the authenticated user
@@ -4573,6 +4657,28 @@ declare class AgentsEndpoint {
4573
4657
  * Mirrors the API's detectAutoComplete() for non-loop agents that return 'end_turn'.
4574
4658
  */
4575
4659
  private detectTaskCompletion;
4660
+ private resolveReservedOutputTokens;
4661
+ private resolveEffectiveInputBudgetTokens;
4662
+ private resolveCompactStrategy;
4663
+ private estimateTextTokens;
4664
+ private estimateUnknownTokens;
4665
+ private estimateMessageContentTokens;
4666
+ private estimateToolCallTokens;
4667
+ private estimateToolResultTokens;
4668
+ private estimateMessageTokens;
4669
+ private estimateConversationTokens;
4670
+ private estimateConversationBreakdown;
4671
+ private estimateToolDefinitionTokens;
4672
+ private loadBuiltinToolSchemas;
4673
+ private buildDefaultCompactInstructions;
4674
+ private resolveCompactInstructions;
4675
+ private extractArtifactReferences;
4676
+ private buildContextBudgetBreakdown;
4677
+ private emitContextCompactionEvent;
4678
+ private emitContextNotice;
4679
+ private buildCompactHistoryMessagesWithLifecycle;
4680
+ private buildCompactHistoryMessages;
4681
+ private isCompactHistoryMessageSet;
4576
4682
  /**
4577
4683
  * Generate a compact summary of prior work for continuation context.
4578
4684
  * Used when compact mode is enabled to keep token usage low.
@@ -4583,6 +4689,7 @@ declare class AgentsEndpoint {
4583
4689
  * Optionally accepts continuation context for marathon resume scenarios.
4584
4690
  */
4585
4691
  private buildSessionMessages;
4692
+ private prepareSessionContext;
4586
4693
  /**
4587
4694
  * Upsert a record to sync long-task progress to the dashboard.
4588
4695
  * Creates the record on first call, updates it on subsequent calls.
@@ -5127,6 +5234,31 @@ declare const defaultWorkflow: WorkflowDefinition;
5127
5234
 
5128
5235
  declare const deployWorkflow: WorkflowDefinition;
5129
5236
 
5237
+ /**
5238
+ * Game workflow: design → build → verify.
5239
+ *
5240
+ * A three-phase workflow for tasks where the goal is to build a game
5241
+ * (Three.js, Phaser, WebGL, etc.) and deploy it to a Daytona sandbox.
5242
+ *
5243
+ * The key difference from the deploy workflow is that game code often
5244
+ * uses template literals, which break when embedded inside Express
5245
+ * `res.send()` template literals. This workflow instructs the agent to
5246
+ * use the `files` parameter for multi-file deployment (Express static
5247
+ * server + separate HTML/JS/CSS files).
5248
+ *
5249
+ * Phase 1 (design): Understand game requirements. Auto-advances after
5250
+ * the first session.
5251
+ *
5252
+ * Phase 2 (build): Write game code using multi-file deployment. The
5253
+ * agent uses `code` for a minimal Express static server and `files`
5254
+ * for the actual game assets (HTML, JS, CSS).
5255
+ *
5256
+ * Phase 3 (verify): Confirm the game is running and playable. Auto-
5257
+ * accepts completion when deploy_sandbox has succeeded.
5258
+ */
5259
+
5260
+ declare const gameWorkflow: WorkflowDefinition;
5261
+
5130
5262
  /**
5131
5263
  * Utility functions shared between workflow phase handlers and AgentsEndpoint.
5132
5264
  *
@@ -5144,4 +5276,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5144
5276
  declare function getDefaultPlanPath(taskName: string): string;
5145
5277
  declare function sanitizeTaskSlug(taskName: string): string;
5146
5278
 
5147
- export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type 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 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 LocalToolExecutionLoopSnapshotSlice, 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 RunTaskContinuation, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5279
+ export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type 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 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 LocalToolExecutionLoopSnapshotSlice, type Message$1 as Message, type MessageContent, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
package/dist/index.d.ts CHANGED
@@ -445,6 +445,7 @@ interface DeploySandboxRequest {
445
445
  port?: number;
446
446
  sandboxId?: string;
447
447
  startCommand?: string;
448
+ files?: Record<string, string>;
448
449
  }
449
450
  interface DeploySandboxResponse {
450
451
  sandboxId: string;
@@ -4119,6 +4120,17 @@ interface AgentExecuteRequest {
4119
4120
  /** Runtime tools to make available during execution */
4120
4121
  tools?: {
4121
4122
  runtimeTools?: AgentRuntimeToolDefinition[];
4123
+ /** IDs of built-in tools to enable (e.g., "exa", "firecrawl", "dalle") */
4124
+ toolIds?: string[];
4125
+ };
4126
+ /** Context-management hints for long-running marathon sessions */
4127
+ contextManagement?: {
4128
+ compactStrategy?: 'auto' | 'provider_native' | 'summary_fallback';
4129
+ compactInstructions?: string;
4130
+ nativeCompaction?: {
4131
+ provider: 'anthropic';
4132
+ thresholdTokens: number;
4133
+ };
4122
4134
  };
4123
4135
  }
4124
4136
  /**
@@ -4129,6 +4141,10 @@ interface AgentExecuteResponse {
4129
4141
  result: string;
4130
4142
  iterations: number;
4131
4143
  totalCost: number;
4144
+ totalTokens?: {
4145
+ input: number;
4146
+ output: number;
4147
+ };
4132
4148
  stopReason: 'complete' | 'end_turn' | 'max_turns' | 'max_cost' | 'timeout' | 'error';
4133
4149
  reflections?: string[];
4134
4150
  error?: string;
@@ -4177,6 +4193,11 @@ interface RunTaskSessionSummary {
4177
4193
  index: number;
4178
4194
  /** Cost of this individual session (USD) */
4179
4195
  cost: number;
4196
+ /** Token counts for this session */
4197
+ totalTokens?: {
4198
+ input: number;
4199
+ output: number;
4200
+ };
4180
4201
  /** Number of loop iterations in this session */
4181
4202
  iterations: number;
4182
4203
  /** Why this session stopped */
@@ -4217,6 +4238,11 @@ interface RunTaskState {
4217
4238
  sessionCount: number;
4218
4239
  /** Total cost across all sessions (USD) */
4219
4240
  totalCost: number;
4241
+ /** Total tokens across all sessions */
4242
+ totalTokens?: {
4243
+ input: number;
4244
+ output: number;
4245
+ };
4220
4246
  /** Last agent output (full text) */
4221
4247
  lastOutput: string;
4222
4248
  /** Last terminal error captured from agent execution */
@@ -4278,6 +4304,44 @@ type RunTaskResumeState = Pick<RunTaskState, 'originalMessage' | 'bootstrapConte
4278
4304
  * Return `false` to stop the loop early.
4279
4305
  */
4280
4306
  type RunTaskOnSession = (state: RunTaskState) => void | false | Promise<void | false>;
4307
+ type RunTaskContextCompactionStrategy = 'auto' | 'provider_native' | 'summary_fallback';
4308
+ interface RunTaskContextBudgetBreakdown {
4309
+ historyTokens: number;
4310
+ toolOutputTokens: number;
4311
+ currentTurnTokens: number;
4312
+ toolDefinitionTokens: number;
4313
+ summaryTokens?: number;
4314
+ reservedOutputTokens?: number;
4315
+ effectiveInputBudgetTokens?: number;
4316
+ estimatedInputTokens: number;
4317
+ }
4318
+ interface RunTaskContextCompactionEvent {
4319
+ phase: 'start' | 'complete';
4320
+ mode: 'auto' | 'forced';
4321
+ strategy: Exclude<RunTaskContextCompactionStrategy, 'auto'>;
4322
+ sessionIndex: number;
4323
+ model?: string;
4324
+ estimatedTokens?: number;
4325
+ thresholdTokens?: number;
4326
+ contextLimitTokens?: number;
4327
+ effectiveInputBudgetTokens?: number;
4328
+ reservedOutputTokens?: number;
4329
+ beforeTokens?: number;
4330
+ afterTokens?: number;
4331
+ breakdown?: RunTaskContextBudgetBreakdown;
4332
+ }
4333
+ type RunTaskOnContextCompaction = (event: RunTaskContextCompactionEvent) => void | Promise<void>;
4334
+ interface RunTaskContextNoticeEvent {
4335
+ kind: 'provider_native_compaction' | 'tool_definitions_warning';
4336
+ sessionIndex: number;
4337
+ model?: string;
4338
+ message: string;
4339
+ estimatedTokens?: number;
4340
+ contextLimitTokens?: number;
4341
+ effectiveInputBudgetTokens?: number;
4342
+ reservedOutputTokens?: number;
4343
+ }
4344
+ type RunTaskOnContextNotice = (event: RunTaskContextNoticeEvent) => void | Promise<void>;
4281
4345
  /**
4282
4346
  * Options for `agents.runTask()`
4283
4347
  */
@@ -4317,6 +4381,18 @@ interface RunTaskOptions {
4317
4381
  continuationMessage?: string;
4318
4382
  /** Use compact summary instead of full message history for continuation */
4319
4383
  compact?: boolean;
4384
+ /** Estimated input token threshold that triggers compact-summary mode for long histories */
4385
+ autoCompactTokenThreshold?: number;
4386
+ /** Effective context window for the active model, used for compaction UX/status */
4387
+ contextLimitTokens?: number;
4388
+ /** Which compaction strategy to prefer. `auto` defaults to provider-native when supported. */
4389
+ compactStrategy?: RunTaskContextCompactionStrategy;
4390
+ /** Optional instructions to preserve specific context when generating compact summaries. */
4391
+ compactInstructions?: string;
4392
+ /** Called when marathon history compaction starts or completes */
4393
+ onContextCompaction?: RunTaskOnContextCompaction;
4394
+ /** Called when marathon context-management warnings or notices should be surfaced */
4395
+ onContextNotice?: RunTaskOnContextNotice;
4320
4396
  /** Saved workflow state to seed a resumed or restarted marathon run */
4321
4397
  resumeState?: RunTaskResumeState;
4322
4398
  /** How tool results are stored in message history for continuation.
@@ -4330,6 +4406,8 @@ interface RunTaskOptions {
4330
4406
  toolWindow?: 'session' | number;
4331
4407
  /** Custom workflow definition (defaults to the built-in research→planning→execution workflow) */
4332
4408
  workflow?: WorkflowDefinition;
4409
+ /** IDs of built-in tools to enable for the agent (e.g., "exa", "firecrawl", "dalle") */
4410
+ toolIds?: string[];
4333
4411
  }
4334
4412
  /**
4335
4413
  * Final result returned by `agents.runTask()`
@@ -4338,6 +4416,10 @@ interface RunTaskResult {
4338
4416
  status: RunTaskStatus;
4339
4417
  sessionCount: number;
4340
4418
  totalCost: number;
4419
+ totalTokens?: {
4420
+ input: number;
4421
+ output: number;
4422
+ };
4341
4423
  lastOutput: string;
4342
4424
  sessions: RunTaskSessionSummary[];
4343
4425
  /** The record ID if trackProgress was enabled */
@@ -4362,6 +4444,8 @@ interface Agent {
4362
4444
  */
4363
4445
  declare class AgentsEndpoint {
4364
4446
  private client;
4447
+ private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
4448
+ private static readonly FORCED_COMPACT_SUMMARY_PREFIX;
4365
4449
  constructor(client: ApiClient);
4366
4450
  /**
4367
4451
  * List all agents for the authenticated user
@@ -4573,6 +4657,28 @@ declare class AgentsEndpoint {
4573
4657
  * Mirrors the API's detectAutoComplete() for non-loop agents that return 'end_turn'.
4574
4658
  */
4575
4659
  private detectTaskCompletion;
4660
+ private resolveReservedOutputTokens;
4661
+ private resolveEffectiveInputBudgetTokens;
4662
+ private resolveCompactStrategy;
4663
+ private estimateTextTokens;
4664
+ private estimateUnknownTokens;
4665
+ private estimateMessageContentTokens;
4666
+ private estimateToolCallTokens;
4667
+ private estimateToolResultTokens;
4668
+ private estimateMessageTokens;
4669
+ private estimateConversationTokens;
4670
+ private estimateConversationBreakdown;
4671
+ private estimateToolDefinitionTokens;
4672
+ private loadBuiltinToolSchemas;
4673
+ private buildDefaultCompactInstructions;
4674
+ private resolveCompactInstructions;
4675
+ private extractArtifactReferences;
4676
+ private buildContextBudgetBreakdown;
4677
+ private emitContextCompactionEvent;
4678
+ private emitContextNotice;
4679
+ private buildCompactHistoryMessagesWithLifecycle;
4680
+ private buildCompactHistoryMessages;
4681
+ private isCompactHistoryMessageSet;
4576
4682
  /**
4577
4683
  * Generate a compact summary of prior work for continuation context.
4578
4684
  * Used when compact mode is enabled to keep token usage low.
@@ -4583,6 +4689,7 @@ declare class AgentsEndpoint {
4583
4689
  * Optionally accepts continuation context for marathon resume scenarios.
4584
4690
  */
4585
4691
  private buildSessionMessages;
4692
+ private prepareSessionContext;
4586
4693
  /**
4587
4694
  * Upsert a record to sync long-task progress to the dashboard.
4588
4695
  * Creates the record on first call, updates it on subsequent calls.
@@ -5127,6 +5234,31 @@ declare const defaultWorkflow: WorkflowDefinition;
5127
5234
 
5128
5235
  declare const deployWorkflow: WorkflowDefinition;
5129
5236
 
5237
+ /**
5238
+ * Game workflow: design → build → verify.
5239
+ *
5240
+ * A three-phase workflow for tasks where the goal is to build a game
5241
+ * (Three.js, Phaser, WebGL, etc.) and deploy it to a Daytona sandbox.
5242
+ *
5243
+ * The key difference from the deploy workflow is that game code often
5244
+ * uses template literals, which break when embedded inside Express
5245
+ * `res.send()` template literals. This workflow instructs the agent to
5246
+ * use the `files` parameter for multi-file deployment (Express static
5247
+ * server + separate HTML/JS/CSS files).
5248
+ *
5249
+ * Phase 1 (design): Understand game requirements. Auto-advances after
5250
+ * the first session.
5251
+ *
5252
+ * Phase 2 (build): Write game code using multi-file deployment. The
5253
+ * agent uses `code` for a minimal Express static server and `files`
5254
+ * for the actual game assets (HTML, JS, CSS).
5255
+ *
5256
+ * Phase 3 (verify): Confirm the game is running and playable. Auto-
5257
+ * accepts completion when deploy_sandbox has succeeded.
5258
+ */
5259
+
5260
+ declare const gameWorkflow: WorkflowDefinition;
5261
+
5130
5262
  /**
5131
5263
  * Utility functions shared between workflow phase handlers and AgentsEndpoint.
5132
5264
  *
@@ -5144,4 +5276,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5144
5276
  declare function getDefaultPlanPath(taskName: string): string;
5145
5277
  declare function sanitizeTaskSlug(taskName: string): string;
5146
5278
 
5147
- export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type 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 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 LocalToolExecutionLoopSnapshotSlice, 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 RunTaskContinuation, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5279
+ export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type 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 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 LocalToolExecutionLoopSnapshotSlice, type Message$1 as Message, type MessageContent, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };