@runtypelabs/sdk 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -3099,6 +3099,7 @@ interface RunTaskStateSlice {
3099
3099
  originalMessage?: string;
3100
3100
  workflowPhase?: string;
3101
3101
  workflowVariant?: string;
3102
+ /** Suggested markdown artifact path for the task */
3102
3103
  planPath?: string;
3103
3104
  planWritten?: boolean;
3104
3105
  bestCandidatePath?: string;
@@ -4123,6 +4124,15 @@ interface AgentExecuteRequest {
4123
4124
  /** IDs of built-in tools to enable (e.g., "exa", "firecrawl", "dalle") */
4124
4125
  toolIds?: string[];
4125
4126
  };
4127
+ /** Context-management hints for long-running marathon sessions */
4128
+ contextManagement?: {
4129
+ compactStrategy?: 'auto' | 'provider_native' | 'summary_fallback';
4130
+ compactInstructions?: string;
4131
+ nativeCompaction?: {
4132
+ provider: 'anthropic';
4133
+ thresholdTokens: number;
4134
+ };
4135
+ };
4126
4136
  }
4127
4137
  /**
4128
4138
  * Agent execute response (non-streaming)
@@ -4258,7 +4268,7 @@ interface RunTaskState {
4258
4268
  bootstrapContext?: string;
4259
4269
  /** Current structured marathon workflow phase (widened to string for custom workflows) */
4260
4270
  workflowPhase?: string;
4261
- /** Suggested markdown plan path for the task */
4271
+ /** Suggested markdown artifact path for the task */
4262
4272
  planPath?: string;
4263
4273
  /** Whether the planning artifact has been written */
4264
4274
  planWritten?: boolean;
@@ -4295,6 +4305,44 @@ type RunTaskResumeState = Pick<RunTaskState, 'originalMessage' | 'bootstrapConte
4295
4305
  * Return `false` to stop the loop early.
4296
4306
  */
4297
4307
  type RunTaskOnSession = (state: RunTaskState) => void | false | Promise<void | false>;
4308
+ type RunTaskContextCompactionStrategy = 'auto' | 'provider_native' | 'summary_fallback';
4309
+ interface RunTaskContextBudgetBreakdown {
4310
+ historyTokens: number;
4311
+ toolOutputTokens: number;
4312
+ currentTurnTokens: number;
4313
+ toolDefinitionTokens: number;
4314
+ summaryTokens?: number;
4315
+ reservedOutputTokens?: number;
4316
+ effectiveInputBudgetTokens?: number;
4317
+ estimatedInputTokens: number;
4318
+ }
4319
+ interface RunTaskContextCompactionEvent {
4320
+ phase: 'start' | 'complete';
4321
+ mode: 'auto' | 'forced';
4322
+ strategy: Exclude<RunTaskContextCompactionStrategy, 'auto'>;
4323
+ sessionIndex: number;
4324
+ model?: string;
4325
+ estimatedTokens?: number;
4326
+ thresholdTokens?: number;
4327
+ contextLimitTokens?: number;
4328
+ effectiveInputBudgetTokens?: number;
4329
+ reservedOutputTokens?: number;
4330
+ beforeTokens?: number;
4331
+ afterTokens?: number;
4332
+ breakdown?: RunTaskContextBudgetBreakdown;
4333
+ }
4334
+ type RunTaskOnContextCompaction = (event: RunTaskContextCompactionEvent) => void | Promise<void>;
4335
+ interface RunTaskContextNoticeEvent {
4336
+ kind: 'provider_native_compaction' | 'tool_definitions_warning';
4337
+ sessionIndex: number;
4338
+ model?: string;
4339
+ message: string;
4340
+ estimatedTokens?: number;
4341
+ contextLimitTokens?: number;
4342
+ effectiveInputBudgetTokens?: number;
4343
+ reservedOutputTokens?: number;
4344
+ }
4345
+ type RunTaskOnContextNotice = (event: RunTaskContextNoticeEvent) => void | Promise<void>;
4298
4346
  /**
4299
4347
  * Options for `agents.runTask()`
4300
4348
  */
@@ -4334,6 +4382,18 @@ interface RunTaskOptions {
4334
4382
  continuationMessage?: string;
4335
4383
  /** Use compact summary instead of full message history for continuation */
4336
4384
  compact?: boolean;
4385
+ /** Estimated input token threshold that triggers compact-summary mode for long histories */
4386
+ autoCompactTokenThreshold?: number;
4387
+ /** Effective context window for the active model, used for compaction UX/status */
4388
+ contextLimitTokens?: number;
4389
+ /** Which compaction strategy to prefer. `auto` defaults to provider-native when supported. */
4390
+ compactStrategy?: RunTaskContextCompactionStrategy;
4391
+ /** Optional instructions to preserve specific context when generating compact summaries. */
4392
+ compactInstructions?: string;
4393
+ /** Called when marathon history compaction starts or completes */
4394
+ onContextCompaction?: RunTaskOnContextCompaction;
4395
+ /** Called when marathon context-management warnings or notices should be surfaced */
4396
+ onContextNotice?: RunTaskOnContextNotice;
4337
4397
  /** Saved workflow state to seed a resumed or restarted marathon run */
4338
4398
  resumeState?: RunTaskResumeState;
4339
4399
  /** How tool results are stored in message history for continuation.
@@ -4385,6 +4445,8 @@ interface Agent {
4385
4445
  */
4386
4446
  declare class AgentsEndpoint {
4387
4447
  private client;
4448
+ private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
4449
+ private static readonly FORCED_COMPACT_SUMMARY_PREFIX;
4388
4450
  constructor(client: ApiClient);
4389
4451
  /**
4390
4452
  * List all agents for the authenticated user
@@ -4550,6 +4612,7 @@ declare class AgentsEndpoint {
4550
4612
  private readonly TOOL_OUTPUT_INLINE_THRESHOLD;
4551
4613
  private offloadToolResult;
4552
4614
  private getDefaultPlanPath;
4615
+ private getDefaultExternalReportPath;
4553
4616
  private dirnameOfCandidatePath;
4554
4617
  private joinCandidatePath;
4555
4618
  private scoreCandidatePath;
@@ -4596,6 +4659,28 @@ declare class AgentsEndpoint {
4596
4659
  * Mirrors the API's detectAutoComplete() for non-loop agents that return 'end_turn'.
4597
4660
  */
4598
4661
  private detectTaskCompletion;
4662
+ private resolveReservedOutputTokens;
4663
+ private resolveEffectiveInputBudgetTokens;
4664
+ private resolveCompactStrategy;
4665
+ private estimateTextTokens;
4666
+ private estimateUnknownTokens;
4667
+ private estimateMessageContentTokens;
4668
+ private estimateToolCallTokens;
4669
+ private estimateToolResultTokens;
4670
+ private estimateMessageTokens;
4671
+ private estimateConversationTokens;
4672
+ private estimateConversationBreakdown;
4673
+ private estimateToolDefinitionTokens;
4674
+ private loadBuiltinToolSchemas;
4675
+ private buildDefaultCompactInstructions;
4676
+ private resolveCompactInstructions;
4677
+ private extractArtifactReferences;
4678
+ private buildContextBudgetBreakdown;
4679
+ private emitContextCompactionEvent;
4680
+ private emitContextNotice;
4681
+ private buildCompactHistoryMessagesWithLifecycle;
4682
+ private buildCompactHistoryMessages;
4683
+ private isCompactHistoryMessageSet;
4599
4684
  /**
4600
4685
  * Generate a compact summary of prior work for continuation context.
4601
4686
  * Used when compact mode is enabled to keep token usage low.
@@ -4606,6 +4691,7 @@ declare class AgentsEndpoint {
4606
4691
  * Optionally accepts continuation context for marathon resume scenarios.
4607
4692
  */
4608
4693
  private buildSessionMessages;
4694
+ private prepareSessionContext;
4609
4695
  /**
4610
4696
  * Upsert a record to sync long-task progress to the dashboard.
4611
4697
  * Creates the record on first call, updates it on subsequent calls.
@@ -5192,4 +5278,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5192
5278
  declare function getDefaultPlanPath(taskName: string): string;
5193
5279
  declare function sanitizeTaskSlug(taskName: string): string;
5194
5280
 
5195
- 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, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5281
+ 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
@@ -3099,6 +3099,7 @@ interface RunTaskStateSlice {
3099
3099
  originalMessage?: string;
3100
3100
  workflowPhase?: string;
3101
3101
  workflowVariant?: string;
3102
+ /** Suggested markdown artifact path for the task */
3102
3103
  planPath?: string;
3103
3104
  planWritten?: boolean;
3104
3105
  bestCandidatePath?: string;
@@ -4123,6 +4124,15 @@ interface AgentExecuteRequest {
4123
4124
  /** IDs of built-in tools to enable (e.g., "exa", "firecrawl", "dalle") */
4124
4125
  toolIds?: string[];
4125
4126
  };
4127
+ /** Context-management hints for long-running marathon sessions */
4128
+ contextManagement?: {
4129
+ compactStrategy?: 'auto' | 'provider_native' | 'summary_fallback';
4130
+ compactInstructions?: string;
4131
+ nativeCompaction?: {
4132
+ provider: 'anthropic';
4133
+ thresholdTokens: number;
4134
+ };
4135
+ };
4126
4136
  }
4127
4137
  /**
4128
4138
  * Agent execute response (non-streaming)
@@ -4258,7 +4268,7 @@ interface RunTaskState {
4258
4268
  bootstrapContext?: string;
4259
4269
  /** Current structured marathon workflow phase (widened to string for custom workflows) */
4260
4270
  workflowPhase?: string;
4261
- /** Suggested markdown plan path for the task */
4271
+ /** Suggested markdown artifact path for the task */
4262
4272
  planPath?: string;
4263
4273
  /** Whether the planning artifact has been written */
4264
4274
  planWritten?: boolean;
@@ -4295,6 +4305,44 @@ type RunTaskResumeState = Pick<RunTaskState, 'originalMessage' | 'bootstrapConte
4295
4305
  * Return `false` to stop the loop early.
4296
4306
  */
4297
4307
  type RunTaskOnSession = (state: RunTaskState) => void | false | Promise<void | false>;
4308
+ type RunTaskContextCompactionStrategy = 'auto' | 'provider_native' | 'summary_fallback';
4309
+ interface RunTaskContextBudgetBreakdown {
4310
+ historyTokens: number;
4311
+ toolOutputTokens: number;
4312
+ currentTurnTokens: number;
4313
+ toolDefinitionTokens: number;
4314
+ summaryTokens?: number;
4315
+ reservedOutputTokens?: number;
4316
+ effectiveInputBudgetTokens?: number;
4317
+ estimatedInputTokens: number;
4318
+ }
4319
+ interface RunTaskContextCompactionEvent {
4320
+ phase: 'start' | 'complete';
4321
+ mode: 'auto' | 'forced';
4322
+ strategy: Exclude<RunTaskContextCompactionStrategy, 'auto'>;
4323
+ sessionIndex: number;
4324
+ model?: string;
4325
+ estimatedTokens?: number;
4326
+ thresholdTokens?: number;
4327
+ contextLimitTokens?: number;
4328
+ effectiveInputBudgetTokens?: number;
4329
+ reservedOutputTokens?: number;
4330
+ beforeTokens?: number;
4331
+ afterTokens?: number;
4332
+ breakdown?: RunTaskContextBudgetBreakdown;
4333
+ }
4334
+ type RunTaskOnContextCompaction = (event: RunTaskContextCompactionEvent) => void | Promise<void>;
4335
+ interface RunTaskContextNoticeEvent {
4336
+ kind: 'provider_native_compaction' | 'tool_definitions_warning';
4337
+ sessionIndex: number;
4338
+ model?: string;
4339
+ message: string;
4340
+ estimatedTokens?: number;
4341
+ contextLimitTokens?: number;
4342
+ effectiveInputBudgetTokens?: number;
4343
+ reservedOutputTokens?: number;
4344
+ }
4345
+ type RunTaskOnContextNotice = (event: RunTaskContextNoticeEvent) => void | Promise<void>;
4298
4346
  /**
4299
4347
  * Options for `agents.runTask()`
4300
4348
  */
@@ -4334,6 +4382,18 @@ interface RunTaskOptions {
4334
4382
  continuationMessage?: string;
4335
4383
  /** Use compact summary instead of full message history for continuation */
4336
4384
  compact?: boolean;
4385
+ /** Estimated input token threshold that triggers compact-summary mode for long histories */
4386
+ autoCompactTokenThreshold?: number;
4387
+ /** Effective context window for the active model, used for compaction UX/status */
4388
+ contextLimitTokens?: number;
4389
+ /** Which compaction strategy to prefer. `auto` defaults to provider-native when supported. */
4390
+ compactStrategy?: RunTaskContextCompactionStrategy;
4391
+ /** Optional instructions to preserve specific context when generating compact summaries. */
4392
+ compactInstructions?: string;
4393
+ /** Called when marathon history compaction starts or completes */
4394
+ onContextCompaction?: RunTaskOnContextCompaction;
4395
+ /** Called when marathon context-management warnings or notices should be surfaced */
4396
+ onContextNotice?: RunTaskOnContextNotice;
4337
4397
  /** Saved workflow state to seed a resumed or restarted marathon run */
4338
4398
  resumeState?: RunTaskResumeState;
4339
4399
  /** How tool results are stored in message history for continuation.
@@ -4385,6 +4445,8 @@ interface Agent {
4385
4445
  */
4386
4446
  declare class AgentsEndpoint {
4387
4447
  private client;
4448
+ private static readonly AUTO_COMPACT_SUMMARY_PREFIX;
4449
+ private static readonly FORCED_COMPACT_SUMMARY_PREFIX;
4388
4450
  constructor(client: ApiClient);
4389
4451
  /**
4390
4452
  * List all agents for the authenticated user
@@ -4550,6 +4612,7 @@ declare class AgentsEndpoint {
4550
4612
  private readonly TOOL_OUTPUT_INLINE_THRESHOLD;
4551
4613
  private offloadToolResult;
4552
4614
  private getDefaultPlanPath;
4615
+ private getDefaultExternalReportPath;
4553
4616
  private dirnameOfCandidatePath;
4554
4617
  private joinCandidatePath;
4555
4618
  private scoreCandidatePath;
@@ -4596,6 +4659,28 @@ declare class AgentsEndpoint {
4596
4659
  * Mirrors the API's detectAutoComplete() for non-loop agents that return 'end_turn'.
4597
4660
  */
4598
4661
  private detectTaskCompletion;
4662
+ private resolveReservedOutputTokens;
4663
+ private resolveEffectiveInputBudgetTokens;
4664
+ private resolveCompactStrategy;
4665
+ private estimateTextTokens;
4666
+ private estimateUnknownTokens;
4667
+ private estimateMessageContentTokens;
4668
+ private estimateToolCallTokens;
4669
+ private estimateToolResultTokens;
4670
+ private estimateMessageTokens;
4671
+ private estimateConversationTokens;
4672
+ private estimateConversationBreakdown;
4673
+ private estimateToolDefinitionTokens;
4674
+ private loadBuiltinToolSchemas;
4675
+ private buildDefaultCompactInstructions;
4676
+ private resolveCompactInstructions;
4677
+ private extractArtifactReferences;
4678
+ private buildContextBudgetBreakdown;
4679
+ private emitContextCompactionEvent;
4680
+ private emitContextNotice;
4681
+ private buildCompactHistoryMessagesWithLifecycle;
4682
+ private buildCompactHistoryMessages;
4683
+ private isCompactHistoryMessageSet;
4599
4684
  /**
4600
4685
  * Generate a compact summary of prior work for continuation context.
4601
4686
  * Used when compact mode is enabled to keep token usage low.
@@ -4606,6 +4691,7 @@ declare class AgentsEndpoint {
4606
4691
  * Optionally accepts continuation context for marathon resume scenarios.
4607
4692
  */
4608
4693
  private buildSessionMessages;
4694
+ private prepareSessionContext;
4609
4695
  /**
4610
4696
  * Upsert a record to sync long-task progress to the dashboard.
4611
4697
  * Creates the record on first call, updates it on subsequent calls.
@@ -5192,4 +5278,4 @@ declare function getLikelySupportingCandidatePaths(bestCandidatePath: string | u
5192
5278
  declare function getDefaultPlanPath(taskName: string): string;
5193
5279
  declare function sanitizeTaskSlug(taskName: string): string;
5194
5280
 
5195
- 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, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, normalizeCandidatePath, parseFinalBuffer, parseSSEChunk, processStream, sanitizeTaskSlug, streamEvents };
5281
+ 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 };