@librechat/agents 3.7.1 → 3.7.3
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/cjs/eventActor/EventActorExecutor.cjs +797 -0
- package/dist/cjs/eventActor/EventActorExecutor.cjs.map +1 -0
- package/dist/cjs/eventActor/index.cjs +1 -0
- package/dist/cjs/main.cjs +4 -0
- package/dist/cjs/tools/BashProgrammaticToolCalling.cjs +6 -1
- package/dist/cjs/tools/BashProgrammaticToolCalling.cjs.map +1 -1
- package/dist/esm/eventActor/EventActorExecutor.mjs +796 -0
- package/dist/esm/eventActor/EventActorExecutor.mjs.map +1 -0
- package/dist/esm/eventActor/index.mjs +2 -0
- package/dist/esm/main.mjs +3 -1
- package/dist/esm/tools/BashProgrammaticToolCalling.mjs +6 -1
- package/dist/esm/tools/BashProgrammaticToolCalling.mjs.map +1 -1
- package/dist/types/eventActor/EventActorExecutor.d.ts +18 -0
- package/dist/types/eventActor/index.d.ts +2 -0
- package/dist/types/eventActor/types.d.ts +193 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +68 -79
- package/src/eventActor/EventActorExecutor.ts +1499 -0
- package/src/eventActor/index.ts +32 -0
- package/src/eventActor/types.ts +250 -0
- package/src/index.ts +3 -0
- package/src/tools/BashProgrammaticToolCalling.ts +11 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventActorExecutor.mjs","names":["#adapter","#maxDepth","#dormantCheckpointTtlMs","#preparationSigningKey","#issuedSettlements","#preparationPhases","#signPreparation","#createTimedPreparationDigest","#preparationSignatureMatches","#validateTimedPreparationDigest","#nextPhaseExpiry","#prunePreparationPhases","#validatePrepareRequest","readyPreparation","#createPreparedInvocation","#discardInvocationReference","unavailablePreparation","#getPreparationPhase","#setTerminalPreparationPhase","#validatePreparedInvocation","#invokeWithConfig","#issueSettlement"],"sources":["../../../src/eventActor/EventActorExecutor.ts"],"mappings":";;;;AAkCA,MAAM,oBAAoB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SAAS,OAAO;GACd,OAAO;IACL,GAAG,0BAA0B,qBAAqB,KAAK;IACvD;GACF;EACF;EACA,IAAI,mBAAmB,uBAAuB;GAC5C,IAAI;GACJ,IAAI;IACF,SACE,SAAS,WAAW,KAAA,IAChB,KAAA,IACA,cAAc,SAAS,MAAM;GACrC,SAAS,OAAO;IACd,MAAM,KAAKA,4BACT,qBACA,qBACF;IACA,OAAO;KAAE,QAAQ;KAAU,OAAO,QAAQ,KAAK;KAAG;IAAa;GACjE;GACA,MAAM,KAAKA,4BACT,qBACA,qBACF;GACA,OAAO;IACL,QAAQ;IACR,GAAI,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO;IACzC;GACF;EACF;EACA,IAAI,mBAAmB,WACrB,OAAO;GACL,GAAG,0BACD,qCACA,IAAI,MAAM,mDAAmD,CAC/D;GACA;EACF;EAEF,MAAM,kBAAkB,wBACtB,qBACA,QAIF;EACA,IAAI,gBAAgB,WAAW,wBAC7B,OAAO;GAAE,GAAG;GAAiB;EAAa;EAE5C,MAAM,kBAAkB,KAAKM,iBAAiB,eAAe;EAC7D,MAAM,YAAY,MAAM,KAAK,OAAO,eAAe;EACnD,IAAI,UAAU,WAAW,wBACvB,OAAO;GACL,GAAG;GACH;EACF;EAEF,IAAI,UAAU,WAAW,SACvB,OAAO;GACL,QAAQ;GACR,QAAQ,gBAAgB;GACxB,YAAY,EAAE,GAAG,gBAAgB,WAAW;GAC5C,GAAI,UAAU,QAAQ,OAClB,CAAC,IACD,EAAE,MAAM,aAAa,UAAU,IAAI,EAAE;GACzC;EACF;EAEF,OAAO;GACL,QAAQ;GACR,QAAQ,gBAAgB;GACxB,MAAM,UAAU;GAChB;EACF;CACF;AACF;AAEA,SAAgB,yBAId,SACA,UAAqC,CAAC,GACD;CACrC,OAAO,IAAI,mBAAmB,SAAS,OAAO;AAChD"}
|
package/dist/esm/main.mjs
CHANGED
|
@@ -104,6 +104,8 @@ import { JsonlSessionStore, SessionManager } from "./session/JsonlSessionStore.m
|
|
|
104
104
|
import { createRunHandlers } from "./session/handlers.mjs";
|
|
105
105
|
import { AgentSession, createAgentSession } from "./session/AgentSession.mjs";
|
|
106
106
|
import "./session/index.mjs";
|
|
107
|
+
import { EventActorExecutor, createEventActorExecutor } from "./eventActor/EventActorExecutor.mjs";
|
|
108
|
+
import "./eventActor/index.mjs";
|
|
107
109
|
import { askUserQuestion } from "./hitl/askUserQuestion.mjs";
|
|
108
110
|
import { ASK_USER_QUESTION_ID_PATTERN, MAX_ASK_USER_QUESTIONS, isAskUserQuestionsInterrupt } from "./hitl/askUserQuestionsInterrupt.mjs";
|
|
109
111
|
import { askUserQuestions } from "./hitl/askUserQuestions.mjs";
|
|
@@ -116,4 +118,4 @@ import "./langchain/index.mjs";
|
|
|
116
118
|
import "./provider-registration.mjs";
|
|
117
119
|
import { DEFAULT_STREAM_DELAY, computeAdaptivePieceSize, resolveStreamDelay, smoothStream } from "./llm/stream/smoother.mjs";
|
|
118
120
|
import { BaseCheckpointSaver, Command, INTERRUPT, MemorySaver, interrupt, isInterrupted } from "@langchain/langgraph";
|
|
119
|
-
export { ACTIVITY_LABEL_RUN_NAME, ACTIVITY_PHASE_LABEL_RUN_NAME, ACTIVITY_PHASE_RUN_NAME, AGENT_MODEL_CALL_RUN_NAME, AIMessage, AIMessageChunk, ANTHROPIC_TOOL_TOKEN_MULTIPLIER, ASK_USER_QUESTION_ID_PATTERN, AgentSession, BASH_SHELL_GUIDANCE, BaseCheckpointSaver, BaseMessage, BaseMessageChunk, BashExecutionToolDefinition, BashExecutionToolDescription, BashExecutionToolName, BashExecutionToolSchema, BashProgrammaticToolCallingDefinition, BashProgrammaticToolCallingDescription, BashProgrammaticToolCallingName, BashProgrammaticToolCallingSchema, BashToolOutputReferencesGuide, CALIBRATION_RATIO_MAX, CALIBRATION_RATIO_MIN, CLOUDFLARE_BASH_CODING_TOOL_NAMES, CLOUDFLARE_CODING_TOOL_NAMES, CODE_API_AUTHORIZATION_ERROR_MESSAGE, CODE_API_EXECUTION_FAILED_ERROR_MESSAGE, CODE_API_EXPECTED_PROFILE_HEADER, CODE_API_INVALID_REQUEST_ERROR_MESSAGE, CODE_API_RATE_LIMITED_ERROR_MESSAGE, CODE_API_UNAVAILABLE_ERROR_MESSAGE, CODE_ARTIFACT_PATH_GUIDANCE, CODE_EXECUTION_TOOLS, Calculator, CalculatorSchema, CalculatorToolDefinition, CalculatorToolDescription, CalculatorToolName, Callback, ChatModelStreamHandler, CloudflareBashExecutionToolDescription, CloudflareCodeExecutionToolDescription, CodeApiRequestError, CodeExecutionToolDefinition, CodeExecutionToolDescription, CodeExecutionToolName, CodeExecutionToolSchema, Command, CommonEvents, CompileCheckToolName, Constants, ContentTypes, DATE_RANGE, DEFAULT_CONTEXT_PRUNING_SETTINGS, DEFAULT_COUNTRY_DESCRIPTION, DEFAULT_HOOK_TIMEOUT_MS, DEFAULT_INTRA_TURN_RETAIN_RATIO, DEFAULT_MAX_SEALS, DEFAULT_MAX_TOOL_CALL_ARG_BYTES, DEFAULT_PROMPT_CACHE_TTL, DEFAULT_QUERY_DESCRIPTION, DEFAULT_RECURSION_LIMIT, DEFAULT_RESERVE_RATIO, DEFAULT_RETAIN_RECENT_TURNS, DEFAULT_STREAM_DELAY, DEFAULT_SUBAGENT_DESCRIPTION, DEFAULT_TOOL_TOKEN_MULTIPLIER, DynamicStructuredTool, EnvVar, FAILED_EXECUTION_FILE_REMINDER, FakeChatModel, Graph, GraphEvents, GraphNodeActions, GraphNodeKeys, HARD_MAX_TOOL_RESULT_CHARS, HARD_MAX_TOTAL_TOOL_OUTPUT_SIZE, HOOK_EVENTS, HOOK_INJECTED_MESSAGES_CAPABLE, HOOK_PREEMPT_BOUNDARY_CAPABLE, HandlerRegistry, HookRegistry, HumanMessage, IMAGE_TOKEN_SAFETY_MARGIN, INTENT_ARG, INTENT_DESCRIPTION, INTENT_LABEL_MARKER, INTENT_PROPERTY, INTERRUPT, InMemorySubagentTaskStore, JsonlSessionStore, LLMStreamHandler, LOCAL_CODING_BUNDLE_NAMES, LOCAL_CODING_TOOL_NAMES, LOCAL_SPAWN_TIMEOUT_MS, LocalBashExecutionToolDescription, LocalCodeExecutionToolDescription, LocalEditFileToolName, LocalEditFileToolSchema, LocalFileCheckpointerImpl, LocalGlobSearchToolName, LocalGlobSearchToolSchema, LocalGrepSearchToolName, LocalGrepSearchToolSchema, LocalListDirectoryToolName, LocalListDirectoryToolSchema, LocalReadFileToolSchema, LocalWriteFileToolName, LocalWriteFileToolSchema, MAX_ASK_USER_QUESTIONS, MAX_CACHE_SIZE, MAX_PATTERN_LENGTH, MULTI_AGENT_GRAPH_RUN_NAME, MemorySaver, ModelEndHandler, MultiAgentGraph, OPENAI_RESPONSES_ACTIVE_REASONING_ID_KEY, OPENAI_RESPONSES_REPLAY_POSITIONS_KEY, ORIGINAL_CONTENT_MAX_CHARS, PREDECESSOR_HANDOFF_CUE, PREEMPT_BOUNDARY_HOOK_TIMEOUT_MS, PROVIDER_MESSAGE_PROVENANCE_LIMITS, PROVIDER_MESSAGE_PROVENANCE_VERSION, ProgrammaticToolCallingDefinition, ProgrammaticToolCallingDescription, ProgrammaticToolCallingName, ProgrammaticToolCallingSchema, PromptTemplate, ProviderMessageProjectionInvariantError, Providers, REASONING_LABEL_RUN_NAME, REMOVE_ALL_MESSAGES, REPLY_PRIMER_TOKENS, ReadFileToolDefinition, ReadFileToolDescription, ReadFileToolName, ReadFileToolSchema, Run, Runnable, RunnableCallable, RunnableLambda, RunnableSequence, SDK_STREAM_DISPATCH, STANDARD_GRAPH_RUN_NAME, STATEFUL_BASH_NOTE, STATEFUL_ENV_NOTE, SessionManager, SkillToolDefinition, SkillToolDescription, SkillToolName, SkillToolSchema, StandardGraph, StatefulBashExecutionToolDescription, StatefulCodeExecutionToolDescription, StepTypes, StreamLimitExceededError, StructuredTool, SubagentExecutor, SubagentToolDefinition, SubagentToolDescription, SubagentToolName, SubagentToolSchema, SystemMessage, TMP_SCRATCH_OUTPUT_REMINDER, TOOL_APPROVAL_EXECUTION_SCOPE_CONFIG_KEY, TestChatStreamHandler, TestLLMStreamHandler, TitleMethod, TokenEncoderManager, Tool, ToolCallTypes, ToolEndHandler, ToolMessage, ToolNode, ToolSearchToolDefinition, ToolSearchToolDescription, ToolSearchToolName, ToolSearchToolSchema, UnsafeTokenMeasurementError, WebSearchToolDefinition, WebSearchToolDescription, WebSearchToolName, WebSearchToolSchema, _createBashProgramForTests, _resetLocalEngineWarningsForTests, _resetRipgrepCacheForTests, _resetSyntaxCheckProbeCacheForTests, _resetUnrecognizedTriggerWarnings, addBedrockCacheControl, addBedrockTailCacheControl, addCacheControl, addCacheControlToStablePrefixMessages, addCodeApiExecutionProfileHeader, addTailCacheControl, appendCodeSessionFileSummary, appendFailedExecutionFileReminder, appendPredecessorHandoffCue, appendProviderMessageProvenance, appendTmpScratchReminder, applyContextPruning, applyEdit, applyOutcome, applyPreToolUseHooksForBridge, apportionTokenCounts, askUserQuestion, askUserQuestions, attemptInvoke, bashAstFindingsToErrors, buildAnthropicCacheControl, buildBashExecutionToolDescription, buildBashExecutionToolSchema, buildBedrockCachePoint, buildChildInputs, buildCodeApiEndpoint, buildCodeApiExecutionErrorMessage, buildCodeApiHttpErrorMessage, buildCodeExecutionToolDescription, buildCodeExecutionToolSchema, buildSandboxRuntimeConfig, buildSubagentToolParams, calculateMaxToolCallInputChars, calculateMaxToolResultChars, calculateMaxTotalToolOutputSize, calculateTotalTokens, canSealPreempt, checkValidNumber, clampCalibrationRatio, classifyAttachment, clientExecTimeoutMs, clientFsTimeoutMs, cloneMessage, coalesceAdjacentUserTurns, commandAvailabilityEnvCacheKey, compactSyntheticProviderContextMessage, composeAbortSignals, composeEventHandlers, computeAdaptivePieceSize, constructorChainHasLcName, convertInjectedMessages, convertMessagesToContent, countNestedGroups, countrySchema, createAgentSession, createBashExecutionTool, createBashProgrammaticToolCallingSchema, createBashProgrammaticToolCallingTool, createCloudflareBashExecutionTool, createCloudflareBashProgrammaticToolCallingTool, createCloudflareBridgeRuntime, createCloudflareCodeExecutionTool, createCloudflareCodingToolBundle, createCloudflareCodingTools, createCloudflareExecutionTool, createCloudflareExecutionWorld, createCloudflareLocalExecutionConfig, createCloudflareProgrammaticToolCallingTool, createCloudflareWorkspaceFS, createCodeExecutionTool, createCompileCheckTool, createCompileCheckToolDefinition, createContentAggregator, createFakeStreamingLLM, createGraph, createHandlers, createLocalBashExecutionTool, createLocalBashProgrammaticToolCallingTool, createLocalCodeExecutionTool, createLocalCodingToolBundle, createLocalCodingToolDefinitions, createLocalCodingToolRegistry, createLocalCodingTools, createLocalEditFileTool, createLocalFileCheckpointer, createLocalGlobSearchTool, createLocalGrepSearchTool, createLocalListDirectoryTool, createLocalProgrammaticToolCallingTool, createLocalReadFileTool, createLocalWriteFileTool, createMetadataAggregator, createProgrammaticToolCallingSchema, createProgrammaticToolCallingTool, createPruneMessages, createRemoveAllMessage, createRunHandlers, createSchemaOnlyTool, createSchemaOnlyTools, createSearchTool, createSubagentToolDefinition, createTokenCounter, createToolErrorOwnership, createToolPolicyHook, createToolSearch, createWorkspacePolicyHook, dateSchema, decodeFile, defaultOmitOptions, deriveMessages, deserializeMessage, dispatchesChatModelStream, dropIncompleteToolStreamContent, emptyOutputMessage, encodeFile, encodingForModel, enforceOriginalContentCap, ensureThinkingBlockInMessages, escapeRegexSpecialChars, estimateAnthropicImageTokens, estimateDocumentBlockTokens, estimateImageBlockTokens, estimateOpenAIImageTokens, estimateTimedMediaBlockTokens, execWithClientTimeout, executeCloudflareBash, executeCloudflareCode, executeHooks, executeLocalBash, executeLocalBashWithArgs, executeLocalCode, executeParallelSearches, executeTools, extractErrorMessage, extractImageDimensions, extractMcpServerName, extractTextFromContent, extractToolDiscoveries, extractUsedBashToolNames, extractUsedToolNames, fetchSessionFiles, filterBashToolsByUsage, filterGraphSubagentResult, filterSubagentResult, filterToolsByUsage, findLastIndex, flattenLegacyContent, foldToolBlocksForToollessAgent, formatAgentMessages, formatAnthropicArtifactContent, formatAnthropicMessage, formatArtifactPayload, formatCloudflareOutput, formatCompletedResponse, formatContentStrings, formatFromLangChain, formatLangChainMessages, formatMediaMessage, formatMessage, formatServerListing, formatSkillCatalog, getAssistantTextPhase, getAvailableMcpServers, getBaseToolName, getBufferString, getChatModelClass, getChunkContent, getCloudflareWorkspaceRoot, getCodeBaseURL, getContextOverflowInfo, getConverseOverrideMessage, getDeferredToolsListing, getExecutionWorld, getLocalCwd, getLocalSessionId, getMaxOutputTokensKey, getMessageCreationContentMetadata, getMessageId, getMessagesWithinTokenLimit, getProviderMessageProvenance, getProviderSourceMessageIds, getReadRoots, getSpawn, getTokenCountForMessage, getWorkspaceFS, getWorkspaceRoots, getWriteRoots, handleServerToolResult, handleToolCallChunks, handleToolCalls, hasBijectiveProviderContentPartMapping, hasNestedQuantifier, hasNestedQuantifiers, hasToolSearchInCurrentTurn, hasUnsafeStructuredSerialization, imageAttachmentContent, imagesSchema, initializeModel, inspectProviderMessageProjection, inspectProviderMessageProvenance, inspectProviderSourceMessageIds, interrupt, isAIMessage, isAnthropicLike, isAskUserQuestionsInterrupt, isBaseMessage, isContextOverflowError, isDangerousPattern, isFromAnyMcpServer, isFromMcpServer, isGoogleLike, isGraphSubagentConfig, isIntentLabelProperty, isInterrupted, isLegacyConvertible, isLibreChatOpenAIModel, isLikelyContextOverflowError, isOpenAILike, isPresent, isProgrammaticRunnerAutoBound, isProgrammaticRunnerResolvedDirectly, isSyntheticProviderContextMessage, isThinkingEnabled, isToolMessage, isZodSchema, joinKeys, labelContentByAgent, locateEdit, makeIsDeferred, makeRequest, mapChatMessagesToStoredMessages, mapStoredMessagesToChatMessages, markTokenCounterCacheCompatible, maskConsumedToolResults, matchesQuery, messagesStateReducer, modifyDeltaProperties, newsSchema, nodeExecutionWorld, normalizeBashToolResultsForReplay, normalizeCodeApiRequestError, normalizeServerFilter, normalizeSubagentConfigEntries, normalizeSubagentConfigs, normalizeToBashIdentifier, normalizeToPythonIdentifier, outcomeFieldsFromResult, parseBooleanEnv, partitionAndMarkAnthropicToolCache, performLocalSearch, preFlightTruncateToolCallInputs, preFlightTruncateToolResults, prepareProviderRequest, probeLocalCommandAvailability, projectAgentContextUsage, projectAnthropicArtifactContent, projectArtifactPayload, projectCacheControlledToolOutputsToText, projectComputerCallOutputsToText, projectOpenAIChatToolMessageContent, projectOpenAIResponsesToolMessageContent, projectOpenAIToolMessageContent, projectOpenRouterToolMessageContent, projectSingleTextToolOutputsToText, projectStructuredToolOutputsToText, projectToolCallInputs, projectToolMessagesForProvider, projectToolStreamContentForProvider, querySchema, readIntent, readOutcomeFields, registerProvider, removePredecessorHandoffCue, repairOrphanedToolMessages, resetIfNotEmpty, resolveBedrockPromptCacheTtl, resolveCloudflareSandbox, resolveCodeApiAuthHeaders, resolveContextPruningSettings, resolveFetchProxyAgent, resolveIntraTurnRetainTokens, resolveLocalExecutionConfig, resolveLocalExecutionTools, resolveLocalImplementationNames, resolveLocalToolRegistry, resolveLocalToolsForBinding, resolvePromptCacheTtl, resolveProviderMessageProjectionInvariantMode, resolveSearchOutcome, resolveStreamDelay, resolveStreamLimits, resolveSubagentConfigEntries, resolveSubagentConfigs, resolveToolOutcome, resolveWorkspacePath, resolveWorkspacePathSafe, runBashAstChecks, runPostEditSyntaxCheck, sanitizeOrphanToolBlocks, sanitizeRegex, selectRuntimeSessionHint, serializeMessage, serializeToolCallInput, setCommandAvailabilityCacheEntry, setFreshProviderMessageProvenance, setInvalidProviderMessageProvenance, setProviderMessageProvenance, shellQuote, shiftIndexTokenCountMap, shouldBypassProxy, shouldTriggerSummarization, sleep, smoothStream, spawnLocalProcess, splitAssistantTextContentByPhase, splitAtRecencyBoundary, stampSyntheticProviderMessage, strictAlternationProviders, stripAnthropicCacheControl, stripBedrockCacheControl, stripCodeSessionFileSummary, stripIntent, summarizeEvent, supportsBedrockToolCache, syncBudgetDerivedFields, toJsonSchema, tool, toolResultTypes, toolsCondition, truncateLocalOutput, truncateToolInput, truncateToolResultContent, tryFallbackProviders, unescapeObject, unwrapToolResponse, validateBashCommand, validateCloudflareBashCommand, videosSchema, withClientTimeout, withIntent, withMessageRole, withoutIntent };
|
|
121
|
+
export { ACTIVITY_LABEL_RUN_NAME, ACTIVITY_PHASE_LABEL_RUN_NAME, ACTIVITY_PHASE_RUN_NAME, AGENT_MODEL_CALL_RUN_NAME, AIMessage, AIMessageChunk, ANTHROPIC_TOOL_TOKEN_MULTIPLIER, ASK_USER_QUESTION_ID_PATTERN, AgentSession, BASH_SHELL_GUIDANCE, BaseCheckpointSaver, BaseMessage, BaseMessageChunk, BashExecutionToolDefinition, BashExecutionToolDescription, BashExecutionToolName, BashExecutionToolSchema, BashProgrammaticToolCallingDefinition, BashProgrammaticToolCallingDescription, BashProgrammaticToolCallingName, BashProgrammaticToolCallingSchema, BashToolOutputReferencesGuide, CALIBRATION_RATIO_MAX, CALIBRATION_RATIO_MIN, CLOUDFLARE_BASH_CODING_TOOL_NAMES, CLOUDFLARE_CODING_TOOL_NAMES, CODE_API_AUTHORIZATION_ERROR_MESSAGE, CODE_API_EXECUTION_FAILED_ERROR_MESSAGE, CODE_API_EXPECTED_PROFILE_HEADER, CODE_API_INVALID_REQUEST_ERROR_MESSAGE, CODE_API_RATE_LIMITED_ERROR_MESSAGE, CODE_API_UNAVAILABLE_ERROR_MESSAGE, CODE_ARTIFACT_PATH_GUIDANCE, CODE_EXECUTION_TOOLS, Calculator, CalculatorSchema, CalculatorToolDefinition, CalculatorToolDescription, CalculatorToolName, Callback, ChatModelStreamHandler, CloudflareBashExecutionToolDescription, CloudflareCodeExecutionToolDescription, CodeApiRequestError, CodeExecutionToolDefinition, CodeExecutionToolDescription, CodeExecutionToolName, CodeExecutionToolSchema, Command, CommonEvents, CompileCheckToolName, Constants, ContentTypes, DATE_RANGE, DEFAULT_CONTEXT_PRUNING_SETTINGS, DEFAULT_COUNTRY_DESCRIPTION, DEFAULT_HOOK_TIMEOUT_MS, DEFAULT_INTRA_TURN_RETAIN_RATIO, DEFAULT_MAX_SEALS, DEFAULT_MAX_TOOL_CALL_ARG_BYTES, DEFAULT_PROMPT_CACHE_TTL, DEFAULT_QUERY_DESCRIPTION, DEFAULT_RECURSION_LIMIT, DEFAULT_RESERVE_RATIO, DEFAULT_RETAIN_RECENT_TURNS, DEFAULT_STREAM_DELAY, DEFAULT_SUBAGENT_DESCRIPTION, DEFAULT_TOOL_TOKEN_MULTIPLIER, DynamicStructuredTool, EnvVar, EventActorExecutor, FAILED_EXECUTION_FILE_REMINDER, FakeChatModel, Graph, GraphEvents, GraphNodeActions, GraphNodeKeys, HARD_MAX_TOOL_RESULT_CHARS, HARD_MAX_TOTAL_TOOL_OUTPUT_SIZE, HOOK_EVENTS, HOOK_INJECTED_MESSAGES_CAPABLE, HOOK_PREEMPT_BOUNDARY_CAPABLE, HandlerRegistry, HookRegistry, HumanMessage, IMAGE_TOKEN_SAFETY_MARGIN, INTENT_ARG, INTENT_DESCRIPTION, INTENT_LABEL_MARKER, INTENT_PROPERTY, INTERRUPT, InMemorySubagentTaskStore, JsonlSessionStore, LLMStreamHandler, LOCAL_CODING_BUNDLE_NAMES, LOCAL_CODING_TOOL_NAMES, LOCAL_SPAWN_TIMEOUT_MS, LocalBashExecutionToolDescription, LocalCodeExecutionToolDescription, LocalEditFileToolName, LocalEditFileToolSchema, LocalFileCheckpointerImpl, LocalGlobSearchToolName, LocalGlobSearchToolSchema, LocalGrepSearchToolName, LocalGrepSearchToolSchema, LocalListDirectoryToolName, LocalListDirectoryToolSchema, LocalReadFileToolSchema, LocalWriteFileToolName, LocalWriteFileToolSchema, MAX_ASK_USER_QUESTIONS, MAX_CACHE_SIZE, MAX_PATTERN_LENGTH, MULTI_AGENT_GRAPH_RUN_NAME, MemorySaver, ModelEndHandler, MultiAgentGraph, OPENAI_RESPONSES_ACTIVE_REASONING_ID_KEY, OPENAI_RESPONSES_REPLAY_POSITIONS_KEY, ORIGINAL_CONTENT_MAX_CHARS, PREDECESSOR_HANDOFF_CUE, PREEMPT_BOUNDARY_HOOK_TIMEOUT_MS, PROVIDER_MESSAGE_PROVENANCE_LIMITS, PROVIDER_MESSAGE_PROVENANCE_VERSION, ProgrammaticToolCallingDefinition, ProgrammaticToolCallingDescription, ProgrammaticToolCallingName, ProgrammaticToolCallingSchema, PromptTemplate, ProviderMessageProjectionInvariantError, Providers, REASONING_LABEL_RUN_NAME, REMOVE_ALL_MESSAGES, REPLY_PRIMER_TOKENS, ReadFileToolDefinition, ReadFileToolDescription, ReadFileToolName, ReadFileToolSchema, Run, Runnable, RunnableCallable, RunnableLambda, RunnableSequence, SDK_STREAM_DISPATCH, STANDARD_GRAPH_RUN_NAME, STATEFUL_BASH_NOTE, STATEFUL_ENV_NOTE, SessionManager, SkillToolDefinition, SkillToolDescription, SkillToolName, SkillToolSchema, StandardGraph, StatefulBashExecutionToolDescription, StatefulCodeExecutionToolDescription, StepTypes, StreamLimitExceededError, StructuredTool, SubagentExecutor, SubagentToolDefinition, SubagentToolDescription, SubagentToolName, SubagentToolSchema, SystemMessage, TMP_SCRATCH_OUTPUT_REMINDER, TOOL_APPROVAL_EXECUTION_SCOPE_CONFIG_KEY, TestChatStreamHandler, TestLLMStreamHandler, TitleMethod, TokenEncoderManager, Tool, ToolCallTypes, ToolEndHandler, ToolMessage, ToolNode, ToolSearchToolDefinition, ToolSearchToolDescription, ToolSearchToolName, ToolSearchToolSchema, UnsafeTokenMeasurementError, WebSearchToolDefinition, WebSearchToolDescription, WebSearchToolName, WebSearchToolSchema, _createBashProgramForTests, _resetLocalEngineWarningsForTests, _resetRipgrepCacheForTests, _resetSyntaxCheckProbeCacheForTests, _resetUnrecognizedTriggerWarnings, addBedrockCacheControl, addBedrockTailCacheControl, addCacheControl, addCacheControlToStablePrefixMessages, addCodeApiExecutionProfileHeader, addTailCacheControl, appendCodeSessionFileSummary, appendFailedExecutionFileReminder, appendPredecessorHandoffCue, appendProviderMessageProvenance, appendTmpScratchReminder, applyContextPruning, applyEdit, applyOutcome, applyPreToolUseHooksForBridge, apportionTokenCounts, askUserQuestion, askUserQuestions, attemptInvoke, bashAstFindingsToErrors, buildAnthropicCacheControl, buildBashExecutionToolDescription, buildBashExecutionToolSchema, buildBedrockCachePoint, buildChildInputs, buildCodeApiEndpoint, buildCodeApiExecutionErrorMessage, buildCodeApiHttpErrorMessage, buildCodeExecutionToolDescription, buildCodeExecutionToolSchema, buildSandboxRuntimeConfig, buildSubagentToolParams, calculateMaxToolCallInputChars, calculateMaxToolResultChars, calculateMaxTotalToolOutputSize, calculateTotalTokens, canSealPreempt, checkValidNumber, clampCalibrationRatio, classifyAttachment, clientExecTimeoutMs, clientFsTimeoutMs, cloneMessage, coalesceAdjacentUserTurns, commandAvailabilityEnvCacheKey, compactSyntheticProviderContextMessage, composeAbortSignals, composeEventHandlers, computeAdaptivePieceSize, constructorChainHasLcName, convertInjectedMessages, convertMessagesToContent, countNestedGroups, countrySchema, createAgentSession, createBashExecutionTool, createBashProgrammaticToolCallingSchema, createBashProgrammaticToolCallingTool, createCloudflareBashExecutionTool, createCloudflareBashProgrammaticToolCallingTool, createCloudflareBridgeRuntime, createCloudflareCodeExecutionTool, createCloudflareCodingToolBundle, createCloudflareCodingTools, createCloudflareExecutionTool, createCloudflareExecutionWorld, createCloudflareLocalExecutionConfig, createCloudflareProgrammaticToolCallingTool, createCloudflareWorkspaceFS, createCodeExecutionTool, createCompileCheckTool, createCompileCheckToolDefinition, createContentAggregator, createEventActorExecutor, createFakeStreamingLLM, createGraph, createHandlers, createLocalBashExecutionTool, createLocalBashProgrammaticToolCallingTool, createLocalCodeExecutionTool, createLocalCodingToolBundle, createLocalCodingToolDefinitions, createLocalCodingToolRegistry, createLocalCodingTools, createLocalEditFileTool, createLocalFileCheckpointer, createLocalGlobSearchTool, createLocalGrepSearchTool, createLocalListDirectoryTool, createLocalProgrammaticToolCallingTool, createLocalReadFileTool, createLocalWriteFileTool, createMetadataAggregator, createProgrammaticToolCallingSchema, createProgrammaticToolCallingTool, createPruneMessages, createRemoveAllMessage, createRunHandlers, createSchemaOnlyTool, createSchemaOnlyTools, createSearchTool, createSubagentToolDefinition, createTokenCounter, createToolErrorOwnership, createToolPolicyHook, createToolSearch, createWorkspacePolicyHook, dateSchema, decodeFile, defaultOmitOptions, deriveMessages, deserializeMessage, dispatchesChatModelStream, dropIncompleteToolStreamContent, emptyOutputMessage, encodeFile, encodingForModel, enforceOriginalContentCap, ensureThinkingBlockInMessages, escapeRegexSpecialChars, estimateAnthropicImageTokens, estimateDocumentBlockTokens, estimateImageBlockTokens, estimateOpenAIImageTokens, estimateTimedMediaBlockTokens, execWithClientTimeout, executeCloudflareBash, executeCloudflareCode, executeHooks, executeLocalBash, executeLocalBashWithArgs, executeLocalCode, executeParallelSearches, executeTools, extractErrorMessage, extractImageDimensions, extractMcpServerName, extractTextFromContent, extractToolDiscoveries, extractUsedBashToolNames, extractUsedToolNames, fetchSessionFiles, filterBashToolsByUsage, filterGraphSubagentResult, filterSubagentResult, filterToolsByUsage, findLastIndex, flattenLegacyContent, foldToolBlocksForToollessAgent, formatAgentMessages, formatAnthropicArtifactContent, formatAnthropicMessage, formatArtifactPayload, formatCloudflareOutput, formatCompletedResponse, formatContentStrings, formatFromLangChain, formatLangChainMessages, formatMediaMessage, formatMessage, formatServerListing, formatSkillCatalog, getAssistantTextPhase, getAvailableMcpServers, getBaseToolName, getBufferString, getChatModelClass, getChunkContent, getCloudflareWorkspaceRoot, getCodeBaseURL, getContextOverflowInfo, getConverseOverrideMessage, getDeferredToolsListing, getExecutionWorld, getLocalCwd, getLocalSessionId, getMaxOutputTokensKey, getMessageCreationContentMetadata, getMessageId, getMessagesWithinTokenLimit, getProviderMessageProvenance, getProviderSourceMessageIds, getReadRoots, getSpawn, getTokenCountForMessage, getWorkspaceFS, getWorkspaceRoots, getWriteRoots, handleServerToolResult, handleToolCallChunks, handleToolCalls, hasBijectiveProviderContentPartMapping, hasNestedQuantifier, hasNestedQuantifiers, hasToolSearchInCurrentTurn, hasUnsafeStructuredSerialization, imageAttachmentContent, imagesSchema, initializeModel, inspectProviderMessageProjection, inspectProviderMessageProvenance, inspectProviderSourceMessageIds, interrupt, isAIMessage, isAnthropicLike, isAskUserQuestionsInterrupt, isBaseMessage, isContextOverflowError, isDangerousPattern, isFromAnyMcpServer, isFromMcpServer, isGoogleLike, isGraphSubagentConfig, isIntentLabelProperty, isInterrupted, isLegacyConvertible, isLibreChatOpenAIModel, isLikelyContextOverflowError, isOpenAILike, isPresent, isProgrammaticRunnerAutoBound, isProgrammaticRunnerResolvedDirectly, isSyntheticProviderContextMessage, isThinkingEnabled, isToolMessage, isZodSchema, joinKeys, labelContentByAgent, locateEdit, makeIsDeferred, makeRequest, mapChatMessagesToStoredMessages, mapStoredMessagesToChatMessages, markTokenCounterCacheCompatible, maskConsumedToolResults, matchesQuery, messagesStateReducer, modifyDeltaProperties, newsSchema, nodeExecutionWorld, normalizeBashToolResultsForReplay, normalizeCodeApiRequestError, normalizeServerFilter, normalizeSubagentConfigEntries, normalizeSubagentConfigs, normalizeToBashIdentifier, normalizeToPythonIdentifier, outcomeFieldsFromResult, parseBooleanEnv, partitionAndMarkAnthropicToolCache, performLocalSearch, preFlightTruncateToolCallInputs, preFlightTruncateToolResults, prepareProviderRequest, probeLocalCommandAvailability, projectAgentContextUsage, projectAnthropicArtifactContent, projectArtifactPayload, projectCacheControlledToolOutputsToText, projectComputerCallOutputsToText, projectOpenAIChatToolMessageContent, projectOpenAIResponsesToolMessageContent, projectOpenAIToolMessageContent, projectOpenRouterToolMessageContent, projectSingleTextToolOutputsToText, projectStructuredToolOutputsToText, projectToolCallInputs, projectToolMessagesForProvider, projectToolStreamContentForProvider, querySchema, readIntent, readOutcomeFields, registerProvider, removePredecessorHandoffCue, repairOrphanedToolMessages, resetIfNotEmpty, resolveBedrockPromptCacheTtl, resolveCloudflareSandbox, resolveCodeApiAuthHeaders, resolveContextPruningSettings, resolveFetchProxyAgent, resolveIntraTurnRetainTokens, resolveLocalExecutionConfig, resolveLocalExecutionTools, resolveLocalImplementationNames, resolveLocalToolRegistry, resolveLocalToolsForBinding, resolvePromptCacheTtl, resolveProviderMessageProjectionInvariantMode, resolveSearchOutcome, resolveStreamDelay, resolveStreamLimits, resolveSubagentConfigEntries, resolveSubagentConfigs, resolveToolOutcome, resolveWorkspacePath, resolveWorkspacePathSafe, runBashAstChecks, runPostEditSyntaxCheck, sanitizeOrphanToolBlocks, sanitizeRegex, selectRuntimeSessionHint, serializeMessage, serializeToolCallInput, setCommandAvailabilityCacheEntry, setFreshProviderMessageProvenance, setInvalidProviderMessageProvenance, setProviderMessageProvenance, shellQuote, shiftIndexTokenCountMap, shouldBypassProxy, shouldTriggerSummarization, sleep, smoothStream, spawnLocalProcess, splitAssistantTextContentByPhase, splitAtRecencyBoundary, stampSyntheticProviderMessage, strictAlternationProviders, stripAnthropicCacheControl, stripBedrockCacheControl, stripCodeSessionFileSummary, stripIntent, summarizeEvent, supportsBedrockToolCache, syncBudgetDerivedFields, toJsonSchema, tool, toolResultTypes, toolsCondition, truncateLocalOutput, truncateToolInput, truncateToolResultContent, tryFallbackProviders, unescapeObject, unwrapToolResponse, validateBashCommand, validateCloudflareBashCommand, videosSchema, withClientTimeout, withIntent, withMessageRole, withoutIntent };
|
|
@@ -11,6 +11,7 @@ import { config } from "dotenv";
|
|
|
11
11
|
config();
|
|
12
12
|
const DEFAULT_MAX_ROUND_TRIPS = 20;
|
|
13
13
|
const DEFAULT_RUN_TIMEOUT_MS = resolveCodeApiRunTimeoutMs();
|
|
14
|
+
const BASH_LAST_BACKGROUND_PID_GUARD = ": &\nwait \"$!\"";
|
|
14
15
|
const BASH_RESERVED = new Set([
|
|
15
16
|
"if",
|
|
16
17
|
"then",
|
|
@@ -113,6 +114,9 @@ const BashProgrammaticToolCallingDefinition = {
|
|
|
113
114
|
description: BashProgrammaticToolCallingDescription,
|
|
114
115
|
schema: BashProgrammaticToolCallingSchema
|
|
115
116
|
};
|
|
117
|
+
function prepareBashProgrammaticCode(code) {
|
|
118
|
+
return `${BASH_LAST_BACKGROUND_PID_GUARD}\n${code}`;
|
|
119
|
+
}
|
|
116
120
|
function maybeParseJsonResultString(result) {
|
|
117
121
|
if (typeof result !== "string") return result;
|
|
118
122
|
const trimmed = result.trim();
|
|
@@ -174,6 +178,7 @@ function createBashProgrammaticToolCallingTool(initParams = {}) {
|
|
|
174
178
|
return tool(async (rawParams, config) => {
|
|
175
179
|
const params = rawParams;
|
|
176
180
|
const { code } = params;
|
|
181
|
+
const preparedCode = prepareBashProgrammaticCode(code);
|
|
177
182
|
const timeout = clampCodeApiRunTimeoutMs(params.timeout, maxRunTimeoutMs);
|
|
178
183
|
const toolCall = config.toolCall ?? {};
|
|
179
184
|
const { toolMap, disallowedToolDefs, session_id, _injected_files, _runtime_session_hint } = toolCall;
|
|
@@ -198,7 +203,7 @@ function createBashProgrammaticToolCallingTool(initParams = {}) {
|
|
|
198
203
|
const runtimeSessionHint = initParams.executionProfile !== "default" && typeof selectedRuntimeSessionHint === "string" && selectedRuntimeSessionHint !== "" ? selectedRuntimeSessionHint : void 0;
|
|
199
204
|
let response = await makeRequest(EXEC_ENDPOINT, {
|
|
200
205
|
lang: "bash",
|
|
201
|
-
code,
|
|
206
|
+
code: preparedCode,
|
|
202
207
|
tools: effectiveTools,
|
|
203
208
|
session_id,
|
|
204
209
|
timeout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BashProgrammaticToolCalling.mjs","names":[],"sources":["../../../src/tools/BashProgrammaticToolCalling.ts"],"mappings":";;;;;;;;;;AAkCA,OAAO;AAMP,MAAM,0BAA0B;AAChC,MAAM,yBAAyB,2BAA2B;
|
|
1
|
+
{"version":3,"file":"BashProgrammaticToolCalling.mjs","names":[],"sources":["../../../src/tools/BashProgrammaticToolCalling.ts"],"mappings":";;;;;;;;;;AAkCA,OAAO;AAMP,MAAM,0BAA0B;AAChC,MAAM,yBAAyB,2BAA2B;AAC1D,MAAM,iCAAiC;AAGvC,MAAM,gBAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;CACA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AM;IACN,MAAM;IACN,OAAO;IACP;IACA;IACA,GAAI,SAAS,MAAM,SAAS,IAAI,EAAE,MAAM,IAAI,CAAC;IAC7C,GAAI,sBAAsB,OACtB,EAAE,sBAAsB,mBAAmB,IAC3C,CAAC;GACP,GACA,OACA,WAAW,aACX,WAAW,gBACb;GAMA,OAAO,SAAS,WAAW,sBAAsB;IAC/C;IAEA,IAAI,YAAY,eACd,MAAM,IAAI,MACR,iCAAiC,cAAc,4FAGjD;IAGF,IAAI,OAEF,QAAQ,IACN,8BAA8B,UAAU,IAAI,SAAS,YAAY,UAAU,EAAE,oBAC/E;IAGF,MAAM,cAAc,kCAClB,MAAM,aACJ,SAAS,cAAc,CAAC,GACxB,kBAAA,qBAEF,CACF;IAEA,WAAW,MAAM,YACf,eACA;KACE,oBAAoB,SAAS;KAC7B,cAAc;IAChB,GACA,OACA,WAAW,aACX,WAAW,gBACb;GACF;GAMA,IAAI,SAAS,WAAW,aACtB,OAAO,wBAAwB,UAAU,IAAI;GAG/C,IAAI,SAAS,WAAW,SACtB,MAAM,IAAI,MAAM,kCAAkC,QAAQ,CAAC;GAG7D,MAAM,IAAI,oBAAoB;EAChC,SAAS,OAAO;GACd,MAAM,sBAAsB,kCACzB,MAAgB,SACjB,IACF;GACA,MAAM,IAAI,MACR,uCAAuC,qBACzC;EACF;CACF,GACA;EACE,MAAA;EACA,aAAa;EACb,QAAQ,wCAAwC,eAAe;EAC/D,gBAAA;CACF,CACF;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EventActorAppliedResult, EventActorDiscardReason, EventActorEvent, EventActorExecutionRequest, EventActorExecutionResult, EventActorExecutorOptions, EventActorHostAdapter, EventActorInvocationResult, EventActorPreparedInvocation, EventActorPrepareRequest, EventActorPreparation, EventActorSettlementResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Runs one event against an isolated checkpoint fork and advances the stable
|
|
4
|
+
* actor head only through the host's atomic commit interface.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EventActorExecutor<TEvent extends EventActorEvent, TResult extends EventActorEvent> {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(adapter: EventActorHostAdapter<TEvent, TResult>, options?: EventActorExecutorOptions);
|
|
9
|
+
prepare(request: EventActorPrepareRequest<TEvent>, signal?: AbortSignal): Promise<EventActorPreparation<TEvent>>;
|
|
10
|
+
coldContinue(preparation: Extract<EventActorPreparation<TEvent>, {
|
|
11
|
+
status: 'checkpoint_unavailable';
|
|
12
|
+
}>, signal?: AbortSignal): Promise<EventActorPreparedInvocation<TEvent>>;
|
|
13
|
+
invoke(invocation: EventActorPreparedInvocation<TEvent>, signal?: AbortSignal): Promise<EventActorInvocationResult<TResult>>;
|
|
14
|
+
commit(settlement: EventActorAppliedResult<TResult>): Promise<EventActorSettlementResult<TResult>>;
|
|
15
|
+
discard(invocation: EventActorPreparedInvocation<TEvent>, reason: EventActorDiscardReason): Promise<void>;
|
|
16
|
+
execute(request: EventActorExecutionRequest<TEvent>): Promise<EventActorExecutionResult<TResult>>;
|
|
17
|
+
}
|
|
18
|
+
export declare function createEventActorExecutor<TEvent extends EventActorEvent, TResult extends EventActorEvent>(adapter: EventActorHostAdapter<TEvent, TResult>, options?: EventActorExecutorOptions): EventActorExecutor<TEvent, TResult>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { EventActorExecutor, createEventActorExecutor, } from './EventActorExecutor';
|
|
2
|
+
export type { EventActorAdapterPrepareRequest, EventActorAdapterPreparation, EventActorAppliedResult, EventActorCheckpointFork, EventActorCheckpointReference, EventActorCommitRequest, EventActorCommitResult, EventActorDiscardReason, EventActorDiscardRequest, EventActorEvent, EventActorExecutionRequest, EventActorExecutionResult, EventActorExecutorOptions, EventActorHead, EventActorHostAdapter, EventActorInvocation, EventActorInvocationContext, EventActorIndeterminateResult, EventActorInvocationReference, EventActorInvocationResult, EventActorPreparation, EventActorPreparationContext, EventActorPreparedInvocation, EventActorPrepareRequest, EventActorSettlementResult, EventActorTerminalResult, } from './types';
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
|
+
/** Durable event payload accepted by the actor lifecycle. */
|
|
3
|
+
export type EventActorEvent = null | boolean | number | string | readonly EventActorEvent[] | {
|
|
4
|
+
readonly [key: string]: EventActorEvent;
|
|
5
|
+
};
|
|
6
|
+
/** Stable reference to one persisted LangGraph checkpoint. */
|
|
7
|
+
export interface EventActorCheckpointReference {
|
|
8
|
+
threadId: string;
|
|
9
|
+
checkpointId?: string;
|
|
10
|
+
checkpointNs: string;
|
|
11
|
+
}
|
|
12
|
+
/** Committed logical head read before an event invocation is prepared. */
|
|
13
|
+
export interface EventActorHead {
|
|
14
|
+
actorThreadId: string;
|
|
15
|
+
generation: number;
|
|
16
|
+
checkpoint?: EventActorCheckpointReference;
|
|
17
|
+
}
|
|
18
|
+
/** Invocation-owned checkpoint fork that cannot become authoritative in place. */
|
|
19
|
+
export interface EventActorCheckpointFork extends EventActorCheckpointReference {
|
|
20
|
+
invocationId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface EventActorInvocationReference {
|
|
23
|
+
actorThreadId: string;
|
|
24
|
+
invocationId: string;
|
|
25
|
+
depth: number;
|
|
26
|
+
continuation: 'warm' | 'cold';
|
|
27
|
+
base: EventActorHead;
|
|
28
|
+
fork: EventActorCheckpointFork;
|
|
29
|
+
}
|
|
30
|
+
export interface EventActorInvocation<TEvent extends EventActorEvent> extends EventActorInvocationReference {
|
|
31
|
+
event: TEvent;
|
|
32
|
+
}
|
|
33
|
+
export interface EventActorPreparedInvocation<TEvent extends EventActorEvent> extends EventActorInvocation<TEvent> {
|
|
34
|
+
/**
|
|
35
|
+
* Executor-authenticated, time-bounded binding over the complete prepared
|
|
36
|
+
* invocation. Its wire representation is opaque to callers.
|
|
37
|
+
*/
|
|
38
|
+
preparationDigest: string;
|
|
39
|
+
}
|
|
40
|
+
export type EventActorAdapterPreparation<TEvent extends EventActorEvent> = {
|
|
41
|
+
status: 'ready';
|
|
42
|
+
invocation: EventActorInvocation<TEvent>;
|
|
43
|
+
} | {
|
|
44
|
+
status: 'checkpoint_unavailable';
|
|
45
|
+
head: EventActorHead;
|
|
46
|
+
};
|
|
47
|
+
export type EventActorPreparation<TEvent extends EventActorEvent> = {
|
|
48
|
+
status: 'ready';
|
|
49
|
+
invocation: EventActorPreparedInvocation<TEvent>;
|
|
50
|
+
} | {
|
|
51
|
+
status: 'checkpoint_unavailable';
|
|
52
|
+
request: EventActorPrepareRequest<TEvent>;
|
|
53
|
+
head: EventActorHead;
|
|
54
|
+
/** Executor-authenticated binding over this exact request/head pair. */
|
|
55
|
+
preparationDigest: string;
|
|
56
|
+
};
|
|
57
|
+
export type EventActorTerminalResult<TResult extends EventActorEvent> = {
|
|
58
|
+
status: 'applied';
|
|
59
|
+
result: TResult;
|
|
60
|
+
checkpoint: EventActorCheckpointFork;
|
|
61
|
+
} | {
|
|
62
|
+
status: 'completed_no_action';
|
|
63
|
+
result?: TResult;
|
|
64
|
+
};
|
|
65
|
+
export type EventActorAppliedResult<TResult extends EventActorEvent> = Extract<EventActorTerminalResult<TResult>, {
|
|
66
|
+
status: 'applied';
|
|
67
|
+
}> & {
|
|
68
|
+
/** Executor-issued one-shot settlement for the invocation that produced this action. */
|
|
69
|
+
invocation: EventActorInvocationReference;
|
|
70
|
+
};
|
|
71
|
+
export interface EventActorIndeterminateResult<TResult extends EventActorEvent> {
|
|
72
|
+
/** Applied handling cannot be proven safe to retry; retain its fork. */
|
|
73
|
+
status: 'commit_indeterminate';
|
|
74
|
+
result?: TResult;
|
|
75
|
+
checkpoint: EventActorCheckpointFork;
|
|
76
|
+
error: Error;
|
|
77
|
+
}
|
|
78
|
+
export type EventActorInvocationResult<TResult extends EventActorEvent> = EventActorAppliedResult<TResult> | EventActorIndeterminateResult<TResult> | Extract<EventActorTerminalResult<TResult>, {
|
|
79
|
+
status: 'completed_no_action';
|
|
80
|
+
}>;
|
|
81
|
+
export interface EventActorInvocationContext {
|
|
82
|
+
signal: AbortSignal;
|
|
83
|
+
config: RunnableConfig;
|
|
84
|
+
}
|
|
85
|
+
export interface EventActorPreparationContext {
|
|
86
|
+
/** Explicit task-owned cancellation; parent-run ambient signals are excluded. */
|
|
87
|
+
signal: AbortSignal;
|
|
88
|
+
}
|
|
89
|
+
export interface EventActorPrepareRequest<TEvent extends EventActorEvent> {
|
|
90
|
+
actorThreadId: string;
|
|
91
|
+
invocationId: string;
|
|
92
|
+
depth: number;
|
|
93
|
+
event: TEvent;
|
|
94
|
+
}
|
|
95
|
+
export interface EventActorAdapterPrepareRequest<TEvent extends EventActorEvent> extends EventActorPrepareRequest<TEvent> {
|
|
96
|
+
/** Unique execution-attempt namespace; invocationId remains the logical idempotency key. */
|
|
97
|
+
checkpointNs: string;
|
|
98
|
+
}
|
|
99
|
+
export interface EventActorCommitRequest<TResult extends EventActorEvent> {
|
|
100
|
+
invocation: EventActorInvocationReference;
|
|
101
|
+
expectedHead: EventActorHead;
|
|
102
|
+
checkpoint: EventActorCheckpointFork;
|
|
103
|
+
result: TResult;
|
|
104
|
+
retention: {
|
|
105
|
+
committedCheckpoints: 2;
|
|
106
|
+
dormantCheckpointTtlMs: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export type EventActorCommitResult = {
|
|
110
|
+
status: 'committed';
|
|
111
|
+
head: EventActorHead;
|
|
112
|
+
} | {
|
|
113
|
+
status: 'stale';
|
|
114
|
+
head?: EventActorHead;
|
|
115
|
+
};
|
|
116
|
+
/** Public settlement outcome after an action has already been applied. */
|
|
117
|
+
export type EventActorSettlementResult<TResult extends EventActorEvent> = EventActorCommitResult | EventActorIndeterminateResult<TResult>;
|
|
118
|
+
export type EventActorDiscardReason = 'cancelled' | 'completed_no_action' | 'failed';
|
|
119
|
+
export interface EventActorDiscardRequest {
|
|
120
|
+
invocation: EventActorInvocationReference;
|
|
121
|
+
reason: EventActorDiscardReason;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Host adapter for durable actor state and the concrete agent invocation.
|
|
125
|
+
* `commit` must compare both the expected generation and checkpoint identity
|
|
126
|
+
* atomically before advancing the logical actor head. The host mailbox
|
|
127
|
+
* deduplicates the logical `invocationId` before entering this seam, while each
|
|
128
|
+
* SDK execution attempt receives a distinct checkpoint namespace. Preparation
|
|
129
|
+
* methods own rollback until they return a ready invocation and must treat the
|
|
130
|
+
* request event as immutable. On cancellation they roll back and reject with
|
|
131
|
+
* `context.signal.reason`; cleanup failures reject with their own error so they
|
|
132
|
+
* remain observable. `invoke` returns only after its provider, stream, timer,
|
|
133
|
+
* and executor resources have been released. Once qualifying action evidence
|
|
134
|
+
* exists, `invoke` must return `applied` even if a later abort or provider
|
|
135
|
+
* failure occurs; a thrown error is therefore a definite no-action failure
|
|
136
|
+
* whose fork is safe to discard. `commit` must not reclaim an applied stale
|
|
137
|
+
* fork: the SDK retains and surfaces it as `commit_conflict` for host
|
|
138
|
+
* reconciliation. `discard` must be idempotent for the same invocation because
|
|
139
|
+
* an ambiguous cleanup failure can be retried through the public lifecycle.
|
|
140
|
+
*/
|
|
141
|
+
export interface EventActorHostAdapter<TEvent extends EventActorEvent, TResult extends EventActorEvent> {
|
|
142
|
+
prepare(request: EventActorAdapterPrepareRequest<TEvent>, context: EventActorPreparationContext): Promise<EventActorAdapterPreparation<TEvent>>;
|
|
143
|
+
coldContinue(request: EventActorAdapterPrepareRequest<TEvent>, head: EventActorHead, context: EventActorPreparationContext): Promise<EventActorInvocation<TEvent>>;
|
|
144
|
+
invoke(invocation: EventActorInvocation<TEvent>, context: EventActorInvocationContext): Promise<EventActorTerminalResult<TResult>>;
|
|
145
|
+
commit(request: EventActorCommitRequest<TResult>): Promise<EventActorCommitResult>;
|
|
146
|
+
discard(request: EventActorDiscardRequest): Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
export interface EventActorExecutionRequest<TEvent extends EventActorEvent> {
|
|
149
|
+
actorThreadId: string;
|
|
150
|
+
invocationId: string;
|
|
151
|
+
event: TEvent;
|
|
152
|
+
depth?: number;
|
|
153
|
+
/** Explicit task-owned signal. Ambient parent-run signals are ignored. */
|
|
154
|
+
signal?: AbortSignal;
|
|
155
|
+
}
|
|
156
|
+
export type EventActorExecutionResult<TResult extends EventActorEvent> = {
|
|
157
|
+
status: 'applied';
|
|
158
|
+
result: TResult;
|
|
159
|
+
head: EventActorHead;
|
|
160
|
+
continuation: 'warm' | 'cold';
|
|
161
|
+
} | {
|
|
162
|
+
status: 'completed_no_action';
|
|
163
|
+
result?: TResult;
|
|
164
|
+
continuation: 'warm' | 'cold';
|
|
165
|
+
} | {
|
|
166
|
+
status: 'cancelled';
|
|
167
|
+
continuation: 'warm' | 'cold';
|
|
168
|
+
} | {
|
|
169
|
+
/** The action happened, but another head won the CAS. Reconcile; do not retry. */
|
|
170
|
+
status: 'commit_conflict';
|
|
171
|
+
result: TResult;
|
|
172
|
+
checkpoint: EventActorCheckpointFork;
|
|
173
|
+
head?: EventActorHead;
|
|
174
|
+
continuation: 'warm' | 'cold';
|
|
175
|
+
} | {
|
|
176
|
+
/** Applied handling cannot be proven safe to retry; retain its fork. */
|
|
177
|
+
status: 'commit_indeterminate';
|
|
178
|
+
result?: TResult;
|
|
179
|
+
checkpoint: EventActorCheckpointFork;
|
|
180
|
+
error: Error;
|
|
181
|
+
continuation: 'warm' | 'cold';
|
|
182
|
+
} | {
|
|
183
|
+
status: 'failed';
|
|
184
|
+
error: Error;
|
|
185
|
+
continuation: 'warm' | 'cold';
|
|
186
|
+
};
|
|
187
|
+
export interface EventActorExecutorOptions {
|
|
188
|
+
maxDepth?: number;
|
|
189
|
+
/** Also bounds signed preparation authority and local terminal fences. */
|
|
190
|
+
dormantCheckpointTtlMs?: number;
|
|
191
|
+
/** Stable private key of at least 32 bytes for cross-lifetime handoffs. */
|
|
192
|
+
preparationSigningKey?: string | Uint8Array;
|
|
193
|
+
}
|
package/dist/types/index.d.ts
CHANGED