@runtypelabs/sdk 1.13.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1974,11 +1974,7 @@ var DEFAULT_BLOCKED_CODE_PATTERNS = [
1974
1974
  /\bsubprocess\b/i,
1975
1975
  /\bos\.system\s*\(/i
1976
1976
  ];
1977
- var DEFAULT_ALLOWED_SANDBOX_PROVIDERS = [
1978
- "quickjs",
1979
- "daytona",
1980
- "cloudflare-worker"
1981
- ];
1977
+ var DEFAULT_ALLOWED_SANDBOX_PROVIDERS = ["quickjs", "daytona", "cloudflare-worker", "cloudflare-sandbox"];
1982
1978
  var DEFAULT_ALLOWED_LANGUAGES = [
1983
1979
  "javascript",
1984
1980
  "typescript",
@@ -4212,16 +4208,16 @@ var ToolsEndpoint = class {
4212
4208
  return this.client.delete(`/tools/sandbox/${sandboxId}`);
4213
4209
  }
4214
4210
  /**
4215
- * Deploy code to a persistent Cloudflare Shell Dynamic Worker and get a preview URL
4211
+ * Deploy code to a persistent Cloudflare Sandbox container and get a preview URL
4216
4212
  */
4217
- async deployCfShell(data) {
4218
- return this.client.post("/tools/sandbox/cf-shell/deploy", data);
4213
+ async deployCfSandbox(data) {
4214
+ return this.client.post("/tools/sandbox/cf-sandbox/deploy", data);
4219
4215
  }
4220
4216
  /**
4221
- * Cleanup a deployed Cloudflare Shell Dynamic Worker
4217
+ * Cleanup a deployed Cloudflare Sandbox container
4222
4218
  */
4223
- async cleanupCfShell(workerId) {
4224
- return this.client.delete(`/tools/sandbox/cf-shell/${workerId}`);
4219
+ async cleanupCfSandbox(sandboxId) {
4220
+ return this.client.delete(`/tools/sandbox/cf-sandbox/${sandboxId}`);
4225
4221
  }
4226
4222
  };
4227
4223
  var EvalEndpoint = class {
@@ -6067,12 +6063,6 @@ var _AgentsEndpoint = class _AgentsEndpoint {
6067
6063
  if ((state.consecutiveBlockedVerificationSessions || 0) >= 2 && state.verificationRequired) {
6068
6064
  state.verificationRequired = false;
6069
6065
  state.lastVerificationPassed = true;
6070
- if (!state.planWritten) {
6071
- state.planWritten = true;
6072
- }
6073
- if (!state.bestCandidateVerified) {
6074
- state.bestCandidateVerified = true;
6075
- }
6076
6066
  }
6077
6067
  const modelKey = options.model || "default";
6078
6068
  if (!state.costByModel) state.costByModel = {};
@@ -6133,12 +6123,6 @@ var _AgentsEndpoint = class _AgentsEndpoint {
6133
6123
  if ((state.consecutiveBlockedVerificationSessions || 0) >= 2) {
6134
6124
  state.verificationRequired = false;
6135
6125
  state.lastVerificationPassed = true;
6136
- if (!state.planWritten) {
6137
- state.planWritten = true;
6138
- }
6139
- if (!state.bestCandidateVerified) {
6140
- state.bestCandidateVerified = true;
6141
- }
6142
6126
  }
6143
6127
  }
6144
6128
  } else {
@@ -6151,7 +6135,11 @@ var _AgentsEndpoint = class _AgentsEndpoint {
6151
6135
  state.consecutiveEmptySessions = (state.consecutiveEmptySessions || 0) + 1;
6152
6136
  }
6153
6137
  if (sessionResult.stopReason === "complete" && !detectedTaskCompletion) {
6154
- state.status = "complete";
6138
+ const currentPhase = workflow.phases.find((p) => p.name === state.workflowPhase);
6139
+ const gatesSatisfied = currentPhase?.canAcceptCompletion ? currentPhase.canAcceptCompletion(state, sessionTrace) : true;
6140
+ if (gatesSatisfied) {
6141
+ state.status = "complete";
6142
+ }
6155
6143
  } else if (sessionResult.stopReason === "error") {
6156
6144
  if (_AgentsEndpoint.isRetryableSessionError(sessionResult.error) && consecutiveServerNetworkErrors < maxServerNetworkRetries) {
6157
6145
  consecutiveServerNetworkErrors++;
@@ -7575,7 +7563,8 @@ function createExternalTool(config) {
7575
7563
  config: {
7576
7564
  url: config.url,
7577
7565
  method: config.method || "POST",
7578
- headers: config.headers
7566
+ headers: config.headers,
7567
+ body: config.body
7579
7568
  }
7580
7569
  };
7581
7570
  }
package/dist/index.d.cts CHANGED
@@ -389,6 +389,7 @@ interface ExternalToolConfig {
389
389
  url: string;
390
390
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
391
391
  headers?: Record<string, string>;
392
+ body?: string;
392
393
  authType?: 'none' | 'bearer' | 'api_key';
393
394
  }
394
395
  interface LocalToolConfig {
@@ -398,7 +399,7 @@ interface BuiltInTool {
398
399
  id: string;
399
400
  name: string;
400
401
  description: string;
401
- category: 'image_generation' | 'web_search' | 'web_scraping' | 'code_execution' | 'file_operations' | 'data_analysis' | 'knowledge_retrieval' | 'text_to_speech' | 'voice_processing' | 'third_party_api' | 'data_management';
402
+ category: 'image_generation' | 'web_search' | 'web_scraping' | 'code_execution' | 'file_operations' | 'data_analysis' | 'knowledge_retrieval' | 'text_to_speech' | 'voice_processing' | 'third_party_api' | 'artifact' | 'data_management' | 'commerce';
402
403
  providers: string[];
403
404
  parametersSchema: JSONSchema;
404
405
  defaultConfig?: JsonObject;
@@ -458,16 +459,17 @@ interface DeploySandboxResponse {
458
459
  status: 'running' | 'error';
459
460
  error?: string;
460
461
  }
461
- interface DeployCfShellRequest {
462
+ interface DeployCfSandboxRequest {
462
463
  code: string;
463
464
  packageJson?: string;
464
- language?: 'javascript' | 'typescript';
465
+ language?: 'javascript' | 'typescript' | 'python';
465
466
  port?: number;
466
- workerId?: string;
467
+ sandboxId?: string;
468
+ startCommand?: string;
467
469
  files?: Record<string, string>;
468
470
  }
469
- interface DeployCfShellResponse {
470
- workerId: string;
471
+ interface DeployCfSandboxResponse {
472
+ sandboxId: string;
471
473
  previewUrl: string;
472
474
  output: string;
473
475
  status: 'running' | 'error';
@@ -574,6 +576,7 @@ interface RuntimeExternalToolConfig {
574
576
  url: string;
575
577
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
576
578
  headers?: Record<string, string>;
579
+ body?: string;
577
580
  }
578
581
  /**
579
582
  * Tools configuration for prompt steps.
@@ -1564,6 +1567,7 @@ declare function createExternalTool(config: {
1564
1567
  url: string;
1565
1568
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
1566
1569
  headers?: Record<string, string>;
1570
+ body?: string;
1567
1571
  }): RuntimeTool;
1568
1572
 
1569
1573
  /**
@@ -3066,8 +3070,8 @@ interface GeneratedRuntimeToolGateOptions {
3066
3070
  * Defaults to ['custom'] because this gate is intended for generated code tools.
3067
3071
  */
3068
3072
  allowedToolTypes?: Array<'custom' | 'external' | 'flow' | 'local'>;
3069
- /** Allowed sandbox providers for generated custom tools. Defaults to ['quickjs', 'daytona', 'cloudflare-worker']. */
3070
- allowedSandboxProviders?: Array<'quickjs' | 'daytona' | 'cloudflare-worker'>;
3073
+ /** Allowed sandbox providers for generated custom tools. Defaults to ['quickjs', 'daytona', 'cloudflare-worker', 'cloudflare-sandbox']. */
3074
+ allowedSandboxProviders?: Array<'quickjs' | 'daytona' | 'cloudflare-worker' | 'cloudflare-sandbox'>;
3071
3075
  /** Allowed languages for generated custom tools. Defaults to JS/TS/Python. */
3072
3076
  allowedLanguages?: Array<'javascript' | 'typescript' | 'python'>;
3073
3077
  /** Maximum allowed code size in characters (default 12000). */
@@ -3825,13 +3829,13 @@ declare class ToolsEndpoint {
3825
3829
  */
3826
3830
  cleanupSandbox(sandboxId: string): Promise<void>;
3827
3831
  /**
3828
- * Deploy code to a persistent Cloudflare Shell Dynamic Worker and get a preview URL
3832
+ * Deploy code to a persistent Cloudflare Sandbox container and get a preview URL
3829
3833
  */
3830
- deployCfShell(data: DeployCfShellRequest): Promise<DeployCfShellResponse>;
3834
+ deployCfSandbox(data: DeployCfSandboxRequest): Promise<DeployCfSandboxResponse>;
3831
3835
  /**
3832
- * Cleanup a deployed Cloudflare Shell Dynamic Worker
3836
+ * Cleanup a deployed Cloudflare Sandbox container
3833
3837
  */
3834
- cleanupCfShell(workerId: string): Promise<void>;
3838
+ cleanupCfSandbox(sandboxId: string): Promise<void>;
3835
3839
  }
3836
3840
  /**
3837
3841
  * Eval endpoint handlers
@@ -5429,4 +5433,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5429
5433
  declare function getDefaultPlanPath(taskName: string): string;
5430
5434
  declare function sanitizeTaskSlug(taskName: string): string;
5431
5435
 
5432
- export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfShellRequest, type DeployCfShellResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, FlowStepsEndpoint, type FlowSummary, type FlowToolConfig, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type Message$1 as Message, type MessageContent, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5436
+ export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, FlowStepsEndpoint, type FlowSummary, type FlowToolConfig, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type Message$1 as Message, type MessageContent, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
package/dist/index.d.ts CHANGED
@@ -389,6 +389,7 @@ interface ExternalToolConfig {
389
389
  url: string;
390
390
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
391
391
  headers?: Record<string, string>;
392
+ body?: string;
392
393
  authType?: 'none' | 'bearer' | 'api_key';
393
394
  }
394
395
  interface LocalToolConfig {
@@ -398,7 +399,7 @@ interface BuiltInTool {
398
399
  id: string;
399
400
  name: string;
400
401
  description: string;
401
- category: 'image_generation' | 'web_search' | 'web_scraping' | 'code_execution' | 'file_operations' | 'data_analysis' | 'knowledge_retrieval' | 'text_to_speech' | 'voice_processing' | 'third_party_api' | 'data_management';
402
+ category: 'image_generation' | 'web_search' | 'web_scraping' | 'code_execution' | 'file_operations' | 'data_analysis' | 'knowledge_retrieval' | 'text_to_speech' | 'voice_processing' | 'third_party_api' | 'artifact' | 'data_management' | 'commerce';
402
403
  providers: string[];
403
404
  parametersSchema: JSONSchema;
404
405
  defaultConfig?: JsonObject;
@@ -458,16 +459,17 @@ interface DeploySandboxResponse {
458
459
  status: 'running' | 'error';
459
460
  error?: string;
460
461
  }
461
- interface DeployCfShellRequest {
462
+ interface DeployCfSandboxRequest {
462
463
  code: string;
463
464
  packageJson?: string;
464
- language?: 'javascript' | 'typescript';
465
+ language?: 'javascript' | 'typescript' | 'python';
465
466
  port?: number;
466
- workerId?: string;
467
+ sandboxId?: string;
468
+ startCommand?: string;
467
469
  files?: Record<string, string>;
468
470
  }
469
- interface DeployCfShellResponse {
470
- workerId: string;
471
+ interface DeployCfSandboxResponse {
472
+ sandboxId: string;
471
473
  previewUrl: string;
472
474
  output: string;
473
475
  status: 'running' | 'error';
@@ -574,6 +576,7 @@ interface RuntimeExternalToolConfig {
574
576
  url: string;
575
577
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
576
578
  headers?: Record<string, string>;
579
+ body?: string;
577
580
  }
578
581
  /**
579
582
  * Tools configuration for prompt steps.
@@ -1564,6 +1567,7 @@ declare function createExternalTool(config: {
1564
1567
  url: string;
1565
1568
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
1566
1569
  headers?: Record<string, string>;
1570
+ body?: string;
1567
1571
  }): RuntimeTool;
1568
1572
 
1569
1573
  /**
@@ -3066,8 +3070,8 @@ interface GeneratedRuntimeToolGateOptions {
3066
3070
  * Defaults to ['custom'] because this gate is intended for generated code tools.
3067
3071
  */
3068
3072
  allowedToolTypes?: Array<'custom' | 'external' | 'flow' | 'local'>;
3069
- /** Allowed sandbox providers for generated custom tools. Defaults to ['quickjs', 'daytona', 'cloudflare-worker']. */
3070
- allowedSandboxProviders?: Array<'quickjs' | 'daytona' | 'cloudflare-worker'>;
3073
+ /** Allowed sandbox providers for generated custom tools. Defaults to ['quickjs', 'daytona', 'cloudflare-worker', 'cloudflare-sandbox']. */
3074
+ allowedSandboxProviders?: Array<'quickjs' | 'daytona' | 'cloudflare-worker' | 'cloudflare-sandbox'>;
3071
3075
  /** Allowed languages for generated custom tools. Defaults to JS/TS/Python. */
3072
3076
  allowedLanguages?: Array<'javascript' | 'typescript' | 'python'>;
3073
3077
  /** Maximum allowed code size in characters (default 12000). */
@@ -3825,13 +3829,13 @@ declare class ToolsEndpoint {
3825
3829
  */
3826
3830
  cleanupSandbox(sandboxId: string): Promise<void>;
3827
3831
  /**
3828
- * Deploy code to a persistent Cloudflare Shell Dynamic Worker and get a preview URL
3832
+ * Deploy code to a persistent Cloudflare Sandbox container and get a preview URL
3829
3833
  */
3830
- deployCfShell(data: DeployCfShellRequest): Promise<DeployCfShellResponse>;
3834
+ deployCfSandbox(data: DeployCfSandboxRequest): Promise<DeployCfSandboxResponse>;
3831
3835
  /**
3832
- * Cleanup a deployed Cloudflare Shell Dynamic Worker
3836
+ * Cleanup a deployed Cloudflare Sandbox container
3833
3837
  */
3834
- cleanupCfShell(workerId: string): Promise<void>;
3838
+ cleanupCfSandbox(sandboxId: string): Promise<void>;
3835
3839
  }
3836
3840
  /**
3837
3841
  * Eval endpoint handlers
@@ -5429,4 +5433,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5429
5433
  declare function getDefaultPlanPath(taskName: string): string;
5430
5434
  declare function sanitizeTaskSlug(taskName: string): string;
5431
5435
 
5432
- export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfShellRequest, type DeployCfShellResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, FlowStepsEndpoint, type FlowSummary, type FlowToolConfig, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type Message$1 as Message, type MessageContent, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5436
+ export { type Agent, type AgentCompleteEvent, type AgentErrorEvent, type AgentEvent, type AgentEventType, type AgentExecuteRequest, type AgentExecuteResponse, type AgentIterationCompleteEvent, type AgentIterationStartEvent, type AgentMessage, type AgentPausedEvent, type AgentPingEvent, type AgentReflectionEvent, type AgentRuntimeToolDefinition, type AgentStartEvent, type AgentStreamCallbacks, type AgentToolCompleteEvent, type AgentToolDeltaEvent, type AgentToolInputCompleteEvent, type AgentToolInputDeltaEvent, type AgentToolStartEvent, type AgentTurnCompleteEvent, type AgentTurnDeltaEvent, type AgentTurnStartEvent, AgentsEndpoint, AnalyticsEndpoint, type ApiClient, type ApiKey, ApiKeysEndpoint, type ApiResponse, type ApplyGeneratedProposalOptions, type ApplyGeneratedProposalResult, type AttachRuntimeToolsOptions, type BaseAgentEvent, BatchBuilder, type BatchClient, type BatchListParams, type BatchOptions, type BatchRequest, type BatchResult, type BatchScheduleConfig, type BatchStatus, BatchesNamespace, type BuiltInTool, type BulkEditCondition, type BulkEditRequest, type BulkEditResponse, type BulkEditResult, ChatEndpoint, ClientBatchBuilder, type ClientConfig, type ClientConversation, ClientEvalBuilder, ClientFlowBuilder, type ClientToken, type ClientTokenConfig, type ClientTokenEnvironment, type ClientTokenVersionPin, ClientTokensEndpoint, type ClientWidgetTheme, type ConditionalStepConfig$1 as ConditionalStepConfig, type ContextErrorHandling, type ContextFallback, ContextTemplatesEndpoint, type CreateApiKeyRequest, type CreateClientTokenRequest, type CreateClientTokenResponse, type CreateFlowRequest, type CreateModelConfigRequest, type CreatePromptData, type CreatePromptRequest, type CreateProviderKeyRequest, type CreateRecordRequest, type CreateToolRequest, type CustomMCPServer, type CustomMCPServerAuth, type CustomToolConfig, type DeployCfSandboxRequest, type DeployCfSandboxResponse, type DeploySandboxRequest, type DeploySandboxResponse, type DispatchClient, DispatchEndpoint, type DispatchEnvironment, type DispatchOptions$1 as DispatchOptions, type DispatchRequest, type ErrorHandlingMode, EvalBuilder, type EvalClient, EvalEndpoint, type EvalListParams, type EvalOptions, type EvalRecord, type EvalRequest, type EvalResult, type EvalRunConfig, EvalRunner, type EvalStatus, EvalsNamespace, type ExecuteToolRequest, type ExecuteToolResponse, type ExternalToolConfig, type FallbackFailEvent, type FallbackStartEvent, type FallbackSuccessEvent, type FallbacksExhaustedEvent, type FallbacksInitiatedEvent, type FetchGitHubStepConfig$1 as FetchGitHubStepConfig, type FetchUrlStepConfig$1 as FetchUrlStepConfig, type FileContentPart, type Flow, type FlowAttachment, FlowBuilder, type FlowCompleteEvent, type FlowConfig$1 as FlowConfig, type FlowErrorEvent, type FlowFallback, type FlowPausedEvent, FlowResult, type FlowStartEvent, type FlowStep, FlowStepsEndpoint, type FlowSummary, type FlowToolConfig, FlowsEndpoint, FlowsNamespace, type GenerateEmbeddingStepConfig$1 as GenerateEmbeddingStepConfig, type GeneratedRuntimeToolGateDecision, type GeneratedRuntimeToolGateOptions, type ImageContentPart, type JSONSchema, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ListConversationsResponse, type ListParams, type LocalToolConfig, type LocalToolDefinition, type LocalToolExecutionCompleteEvent, type LocalToolExecutionLoopSnapshotSlice, type LocalToolExecutionStartEvent, type Message$1 as Message, type MessageContent, type Metadata, type ModelConfig, ModelConfigsEndpoint, type ModelFallback, type ModelOverride, type ModelUsageDetail, type ModelUsageQueryParams, type ModelUsageResponse, type ModelUsageSummary, type ModelUsageTimeSeries, type PaginationResponse, type Prompt$1 as Prompt, type PromptErrorHandling, type PromptFallback, type PromptListParams, type PromptRunOptions, PromptRunner, type PromptStepConfig$1 as PromptStepConfig, PromptsEndpoint, PromptsNamespace, type ProviderApiKey, type ReasoningConfig, type ReasoningValue, type RecordConfig$1 as RecordConfig, type RecordListParams, RecordsEndpoint, type RetrieveRecordStepConfig$1 as RetrieveRecordStepConfig, type RetryFallback, type RunTaskContextBudgetBreakdown, type RunTaskContextCompactionEvent, type RunTaskContextCompactionStrategy, type RunTaskContextNoticeEvent, type RunTaskContinuation, type RunTaskOnContextCompaction, type RunTaskOnContextNotice, type RunTaskOnSession, type RunTaskOptions, type RunTaskResult, type RunTaskResumeState, type RunTaskSessionSummary, type RunTaskState, type RunTaskStateSlice, type RunTaskStatus, type RunTaskToolTraceSlice, type RuntimeCustomToolConfig, type RuntimeExternalToolConfig, type RuntimeFlowToolConfig, type RuntimeLocalToolConfig, type RuntimeTool, type RuntimeToolConfig, Runtype, RuntypeApiError, RuntypeClient, type ConditionalStepConfig as RuntypeConditionalStepConfig, type RuntypeConfig, type FetchGitHubStepConfig as RuntypeFetchGitHubStepConfig, type FetchUrlStepConfig as RuntypeFetchUrlStepConfig, RuntypeFlowBuilder, type FlowConfig as RuntypeFlowConfig, type GenerateEmbeddingStepConfig as RuntypeGenerateEmbeddingStepConfig, type Message as RuntypeMessage, type ModelOverride$1 as RuntypeModelOverride, type Prompt as RuntypePrompt, type PromptStepConfig as RuntypePromptStepConfig, type RuntypeRecord, type RecordConfig as RuntypeRecordConfig, type RetrieveRecordStepConfig as RuntypeRetrieveRecordStepConfig, type SearchStepConfig as RuntypeSearchStepConfig, type SendEmailStepConfig as RuntypeSendEmailStepConfig, type SendEventStepConfig as RuntypeSendEventStepConfig, type SendStreamStepConfig as RuntypeSendStreamStepConfig, type SendTextStepConfig as RuntypeSendTextStepConfig, type SetVariableStepConfig as RuntypeSetVariableStepConfig, type TransformDataStepConfig as RuntypeTransformDataStepConfig, type UpsertFlowConfig as RuntypeUpsertFlowConfig, type UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, type VectorSearchStepConfig as RuntypeVectorSearchStepConfig, type WaitUntilStepConfig as RuntypeWaitUntilStepConfig, type SearchStepConfig$1 as SearchStepConfig, type SendEmailStepConfig$1 as SendEmailStepConfig, type SendEventStepConfig$1 as SendEventStepConfig, type SendStreamStepConfig$1 as SendStreamStepConfig, type SendTextStepConfig$1 as SendTextStepConfig, type SetVariableStepConfig$1 as SetVariableStepConfig, type StepChunkEvent, type StepCompleteEvent, type StepDeltaEvent, type StepFallback, type StepStartEvent, type StepWaitingLocalEvent, type StreamCallbacks, type StreamEvent, type TextContentPart, type Tool, type ToolConfig, type ToolExecution, type ToolsConfig, ToolsEndpoint, type TransformDataStepConfig$1 as TransformDataStepConfig, type UpdateClientTokenRequest, type UpdatePromptData, type UpdateProviderKeyRequest, type UpdateToolRequest, type UpsertFlowConfig$1 as UpsertFlowConfig, type UpsertOptions$2 as UpsertOptions, type UpsertRecordStepConfig$1 as UpsertRecordStepConfig, type UserProfile, UsersEndpoint, type VectorSearchStepConfig$1 as VectorSearchStepConfig, type WaitUntilStepConfig$1 as WaitUntilStepConfig, type WorkflowContext, type WorkflowDefinition, type WorkflowPhase, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildGeneratedRuntimeToolGateOutput, createClient, createExternalTool, defaultWorkflow, deployWorkflow, evaluateGeneratedRuntimeToolProposal, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
package/dist/index.mjs CHANGED
@@ -1904,11 +1904,7 @@ var DEFAULT_BLOCKED_CODE_PATTERNS = [
1904
1904
  /\bsubprocess\b/i,
1905
1905
  /\bos\.system\s*\(/i
1906
1906
  ];
1907
- var DEFAULT_ALLOWED_SANDBOX_PROVIDERS = [
1908
- "quickjs",
1909
- "daytona",
1910
- "cloudflare-worker"
1911
- ];
1907
+ var DEFAULT_ALLOWED_SANDBOX_PROVIDERS = ["quickjs", "daytona", "cloudflare-worker", "cloudflare-sandbox"];
1912
1908
  var DEFAULT_ALLOWED_LANGUAGES = [
1913
1909
  "javascript",
1914
1910
  "typescript",
@@ -4142,16 +4138,16 @@ var ToolsEndpoint = class {
4142
4138
  return this.client.delete(`/tools/sandbox/${sandboxId}`);
4143
4139
  }
4144
4140
  /**
4145
- * Deploy code to a persistent Cloudflare Shell Dynamic Worker and get a preview URL
4141
+ * Deploy code to a persistent Cloudflare Sandbox container and get a preview URL
4146
4142
  */
4147
- async deployCfShell(data) {
4148
- return this.client.post("/tools/sandbox/cf-shell/deploy", data);
4143
+ async deployCfSandbox(data) {
4144
+ return this.client.post("/tools/sandbox/cf-sandbox/deploy", data);
4149
4145
  }
4150
4146
  /**
4151
- * Cleanup a deployed Cloudflare Shell Dynamic Worker
4147
+ * Cleanup a deployed Cloudflare Sandbox container
4152
4148
  */
4153
- async cleanupCfShell(workerId) {
4154
- return this.client.delete(`/tools/sandbox/cf-shell/${workerId}`);
4149
+ async cleanupCfSandbox(sandboxId) {
4150
+ return this.client.delete(`/tools/sandbox/cf-sandbox/${sandboxId}`);
4155
4151
  }
4156
4152
  };
4157
4153
  var EvalEndpoint = class {
@@ -5997,12 +5993,6 @@ var _AgentsEndpoint = class _AgentsEndpoint {
5997
5993
  if ((state.consecutiveBlockedVerificationSessions || 0) >= 2 && state.verificationRequired) {
5998
5994
  state.verificationRequired = false;
5999
5995
  state.lastVerificationPassed = true;
6000
- if (!state.planWritten) {
6001
- state.planWritten = true;
6002
- }
6003
- if (!state.bestCandidateVerified) {
6004
- state.bestCandidateVerified = true;
6005
- }
6006
5996
  }
6007
5997
  const modelKey = options.model || "default";
6008
5998
  if (!state.costByModel) state.costByModel = {};
@@ -6063,12 +6053,6 @@ var _AgentsEndpoint = class _AgentsEndpoint {
6063
6053
  if ((state.consecutiveBlockedVerificationSessions || 0) >= 2) {
6064
6054
  state.verificationRequired = false;
6065
6055
  state.lastVerificationPassed = true;
6066
- if (!state.planWritten) {
6067
- state.planWritten = true;
6068
- }
6069
- if (!state.bestCandidateVerified) {
6070
- state.bestCandidateVerified = true;
6071
- }
6072
6056
  }
6073
6057
  }
6074
6058
  } else {
@@ -6081,7 +6065,11 @@ var _AgentsEndpoint = class _AgentsEndpoint {
6081
6065
  state.consecutiveEmptySessions = (state.consecutiveEmptySessions || 0) + 1;
6082
6066
  }
6083
6067
  if (sessionResult.stopReason === "complete" && !detectedTaskCompletion) {
6084
- state.status = "complete";
6068
+ const currentPhase = workflow.phases.find((p) => p.name === state.workflowPhase);
6069
+ const gatesSatisfied = currentPhase?.canAcceptCompletion ? currentPhase.canAcceptCompletion(state, sessionTrace) : true;
6070
+ if (gatesSatisfied) {
6071
+ state.status = "complete";
6072
+ }
6085
6073
  } else if (sessionResult.stopReason === "error") {
6086
6074
  if (_AgentsEndpoint.isRetryableSessionError(sessionResult.error) && consecutiveServerNetworkErrors < maxServerNetworkRetries) {
6087
6075
  consecutiveServerNetworkErrors++;
@@ -7505,7 +7493,8 @@ function createExternalTool(config) {
7505
7493
  config: {
7506
7494
  url: config.url,
7507
7495
  method: config.method || "POST",
7508
- headers: config.headers
7496
+ headers: config.headers,
7497
+ body: config.body
7509
7498
  }
7510
7499
  };
7511
7500
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "1.13.1",
3
+ "version": "1.15.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",