@axlsdk/axl 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +166 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -6
- package/dist/index.d.ts +57 -6
- package/dist/index.js +166 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -4890,10 +4890,7 @@ type WorkflowContextInit = {
|
|
|
4890
4890
|
* fn callbacks). Composed name: `__auto/<primitive>/<n>`.
|
|
4891
4891
|
*
|
|
4892
4892
|
* Root contexts default to a fresh `{ byAgent: new Map(), root: 0 }`. */
|
|
4893
|
-
autoCheckpointCounters?:
|
|
4894
|
-
byAgent: Map<string, number>;
|
|
4895
|
-
root: number;
|
|
4896
|
-
};
|
|
4893
|
+
autoCheckpointCounters?: AutoCheckpointState;
|
|
4897
4894
|
/** Internal: root-shared state for branch continuations that must settle
|
|
4898
4895
|
* before the runtime emits the workflow terminal and snapshots cost. */
|
|
4899
4896
|
branchDrainState?: BranchDrainState;
|
|
@@ -4923,6 +4920,13 @@ type PendingDecisionResolver = {
|
|
|
4923
4920
|
* deleteExecution joins this barrier before its total store sweep. */
|
|
4924
4921
|
cleanupFinished: Promise<void>;
|
|
4925
4922
|
};
|
|
4923
|
+
/** Automatic checkpoint bookkeeping, shared by an execution's child contexts. */
|
|
4924
|
+
type AutoCheckpointState = {
|
|
4925
|
+
byAgent: Map<string, number>;
|
|
4926
|
+
root: number;
|
|
4927
|
+
/** An automatic checkpoint failed to save, so none are saved from here on. */
|
|
4928
|
+
saveFailed?: boolean;
|
|
4929
|
+
};
|
|
4926
4930
|
/**
|
|
4927
4931
|
* The central coordination object for all Axl primitives.
|
|
4928
4932
|
* Carries execution state, tracing, budget tracking, and session history.
|
|
@@ -10012,6 +10016,20 @@ declare class SQLiteStore implements StateStore {
|
|
|
10012
10016
|
deleteCheckpoints(executionId: string): Promise<void>;
|
|
10013
10017
|
}
|
|
10014
10018
|
|
|
10019
|
+
/**
|
|
10020
|
+
* A change in a {@link RedisStore}'s connection, passed to
|
|
10021
|
+
* {@link RedisStoreOptions.onConnectionEvent}.
|
|
10022
|
+
*
|
|
10023
|
+
* - `error`: the connection was lost or a reconnect attempt failed. Arrives
|
|
10024
|
+
* once per attempt while Redis is down.
|
|
10025
|
+
* - `reconnected`: the store is connected again and commands work.
|
|
10026
|
+
*/
|
|
10027
|
+
type RedisConnectionEvent = {
|
|
10028
|
+
type: 'error';
|
|
10029
|
+
error: Error;
|
|
10030
|
+
} | {
|
|
10031
|
+
type: 'reconnected';
|
|
10032
|
+
};
|
|
10015
10033
|
/** Options accepted by {@link RedisStore.create}. */
|
|
10016
10034
|
interface RedisStoreOptions {
|
|
10017
10035
|
/** Redis connection URL (e.g. `redis://localhost:6379`). Defaults to `redis://localhost:6379`. */
|
|
@@ -10036,6 +10054,16 @@ interface RedisStoreOptions {
|
|
|
10036
10054
|
* operator experience.
|
|
10037
10055
|
*/
|
|
10038
10056
|
keyPrefix?: string;
|
|
10057
|
+
/**
|
|
10058
|
+
* Called when the connection is lost, a reconnect attempt fails, or the
|
|
10059
|
+
* connection comes back, for routing to a logger, metrics, or a health check.
|
|
10060
|
+
* Replaces the default logging of one line per outage and one on recovery.
|
|
10061
|
+
*
|
|
10062
|
+
* Not called for a failed `create()`, whose rejection reports the failure,
|
|
10063
|
+
* or after `close()`. A callback that throws or rejects is reported with
|
|
10064
|
+
* `console.error` and otherwise ignored.
|
|
10065
|
+
*/
|
|
10066
|
+
onConnectionEvent?: (event: RedisConnectionEvent) => void;
|
|
10039
10067
|
/**
|
|
10040
10068
|
* Skip the lazy backfill of legacy execution / eval-history entries into
|
|
10041
10069
|
* the sorted-set indexes during `RedisStore.create()`. Default `false`
|
|
@@ -10139,10 +10167,28 @@ interface RedisStoreOptions {
|
|
|
10139
10167
|
* async `RedisStore.create()` factory, which connects before returning.
|
|
10140
10168
|
*/
|
|
10141
10169
|
declare class RedisStore implements StateStore {
|
|
10142
|
-
private
|
|
10170
|
+
private connection;
|
|
10143
10171
|
private keyPrefix;
|
|
10144
10172
|
private ttls;
|
|
10145
10173
|
private constructor();
|
|
10174
|
+
/**
|
|
10175
|
+
* Whether the store can send commands right now, for a health check or for
|
|
10176
|
+
* telling an outage from other failures when a call rejects. `false` while
|
|
10177
|
+
* reconnecting and after `close()`.
|
|
10178
|
+
*/
|
|
10179
|
+
get isConnected(): boolean;
|
|
10180
|
+
/**
|
|
10181
|
+
* The client for sending a command, failing immediately while disconnected.
|
|
10182
|
+
*
|
|
10183
|
+
* Every command goes through here because node-redis's `disableOfflineQueue`
|
|
10184
|
+
* rejects single commands but not `multi().exec()`, which would wait for a
|
|
10185
|
+
* reconnect attempt to fail or succeed. Nothing may `await` between
|
|
10186
|
+
* `client.multi()` and `.exec()`, or a transaction could get past this check.
|
|
10187
|
+
*
|
|
10188
|
+
* A closed store isn't "unavailable": it falls through to node-redis's own
|
|
10189
|
+
* "The client is closed" rejection.
|
|
10190
|
+
*/
|
|
10191
|
+
private get client();
|
|
10146
10192
|
/**
|
|
10147
10193
|
* History kinds with a prune running in this process. A save skips its
|
|
10148
10194
|
* prune while another one of the same kind is in flight: the running one
|
|
@@ -10395,6 +10441,11 @@ declare class RedisStore implements StateStore {
|
|
|
10395
10441
|
* must not get a rejected promise for it. `MemoryStore.close()` and
|
|
10396
10442
|
* better-sqlite3's `close()` are both no-ops the second time; node-redis
|
|
10397
10443
|
* instead rejects with "The client is closed", so absorb that here.
|
|
10444
|
+
*
|
|
10445
|
+
* Bounded, so a shutdown can't hang on Redis. `QUIT` lets queued commands
|
|
10446
|
+
* finish on a healthy connection, but node-redis never settles it if the
|
|
10447
|
+
* socket closes first, and a stalled server may never answer it. While
|
|
10448
|
+
* disconnected it couldn't be sent at all.
|
|
10398
10449
|
*/
|
|
10399
10450
|
close(): Promise<void>;
|
|
10400
10451
|
deleteCheckpoints(executionId: string): Promise<void>;
|
|
@@ -10467,4 +10518,4 @@ declare class NoopSpanManager implements SpanManager {
|
|
|
10467
10518
|
*/
|
|
10468
10519
|
declare function createSpanManager(config?: TelemetryConfig): Promise<SpanManager>;
|
|
10469
10520
|
|
|
10470
|
-
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedExternalRequestRecord, type CapturedJsonValue, type CapturedMessage, type CapturedModelRequestRecord, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionCursor, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationRecord, type ExternalOperationReport, FileDiagnosticArtifactStore, type FinishReason, type FoldedOperationRecord, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HistoryRetentionCursor, type HistoryRetentionKind, type HistoryRetentionOptions, type HistoryRetentionResult, type HistoryTtls, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type MemoryStoreOptions, type ModelCallRecord, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningContextReset, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, RedisStore, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SQLiteStoreOptions, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanAttributeValue, type SpanAttributes, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedModelOptionError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, capturedJournalLineSchema, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, externalOperationRecordSchema, extractJson, extractThinkTags, findConfig, foldJournal, foldedOperationRecordSchema, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, modelCallRecordSchema, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, redactModelCallRecord, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
|
10521
|
+
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedExternalRequestRecord, type CapturedJsonValue, type CapturedMessage, type CapturedModelRequestRecord, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionCursor, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationRecord, type ExternalOperationReport, FileDiagnosticArtifactStore, type FinishReason, type FoldedOperationRecord, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HistoryRetentionCursor, type HistoryRetentionKind, type HistoryRetentionOptions, type HistoryRetentionResult, type HistoryTtls, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type MemoryStoreOptions, type ModelCallRecord, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningContextReset, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, type RedisConnectionEvent, RedisStore, type RedisStoreOptions, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SQLiteStoreOptions, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanAttributeValue, type SpanAttributes, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedModelOptionError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, capturedJournalLineSchema, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, externalOperationRecordSchema, extractJson, extractThinkTags, findConfig, foldJournal, foldedOperationRecordSchema, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, modelCallRecordSchema, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, redactModelCallRecord, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -4890,10 +4890,7 @@ type WorkflowContextInit = {
|
|
|
4890
4890
|
* fn callbacks). Composed name: `__auto/<primitive>/<n>`.
|
|
4891
4891
|
*
|
|
4892
4892
|
* Root contexts default to a fresh `{ byAgent: new Map(), root: 0 }`. */
|
|
4893
|
-
autoCheckpointCounters?:
|
|
4894
|
-
byAgent: Map<string, number>;
|
|
4895
|
-
root: number;
|
|
4896
|
-
};
|
|
4893
|
+
autoCheckpointCounters?: AutoCheckpointState;
|
|
4897
4894
|
/** Internal: root-shared state for branch continuations that must settle
|
|
4898
4895
|
* before the runtime emits the workflow terminal and snapshots cost. */
|
|
4899
4896
|
branchDrainState?: BranchDrainState;
|
|
@@ -4923,6 +4920,13 @@ type PendingDecisionResolver = {
|
|
|
4923
4920
|
* deleteExecution joins this barrier before its total store sweep. */
|
|
4924
4921
|
cleanupFinished: Promise<void>;
|
|
4925
4922
|
};
|
|
4923
|
+
/** Automatic checkpoint bookkeeping, shared by an execution's child contexts. */
|
|
4924
|
+
type AutoCheckpointState = {
|
|
4925
|
+
byAgent: Map<string, number>;
|
|
4926
|
+
root: number;
|
|
4927
|
+
/** An automatic checkpoint failed to save, so none are saved from here on. */
|
|
4928
|
+
saveFailed?: boolean;
|
|
4929
|
+
};
|
|
4926
4930
|
/**
|
|
4927
4931
|
* The central coordination object for all Axl primitives.
|
|
4928
4932
|
* Carries execution state, tracing, budget tracking, and session history.
|
|
@@ -10012,6 +10016,20 @@ declare class SQLiteStore implements StateStore {
|
|
|
10012
10016
|
deleteCheckpoints(executionId: string): Promise<void>;
|
|
10013
10017
|
}
|
|
10014
10018
|
|
|
10019
|
+
/**
|
|
10020
|
+
* A change in a {@link RedisStore}'s connection, passed to
|
|
10021
|
+
* {@link RedisStoreOptions.onConnectionEvent}.
|
|
10022
|
+
*
|
|
10023
|
+
* - `error`: the connection was lost or a reconnect attempt failed. Arrives
|
|
10024
|
+
* once per attempt while Redis is down.
|
|
10025
|
+
* - `reconnected`: the store is connected again and commands work.
|
|
10026
|
+
*/
|
|
10027
|
+
type RedisConnectionEvent = {
|
|
10028
|
+
type: 'error';
|
|
10029
|
+
error: Error;
|
|
10030
|
+
} | {
|
|
10031
|
+
type: 'reconnected';
|
|
10032
|
+
};
|
|
10015
10033
|
/** Options accepted by {@link RedisStore.create}. */
|
|
10016
10034
|
interface RedisStoreOptions {
|
|
10017
10035
|
/** Redis connection URL (e.g. `redis://localhost:6379`). Defaults to `redis://localhost:6379`. */
|
|
@@ -10036,6 +10054,16 @@ interface RedisStoreOptions {
|
|
|
10036
10054
|
* operator experience.
|
|
10037
10055
|
*/
|
|
10038
10056
|
keyPrefix?: string;
|
|
10057
|
+
/**
|
|
10058
|
+
* Called when the connection is lost, a reconnect attempt fails, or the
|
|
10059
|
+
* connection comes back, for routing to a logger, metrics, or a health check.
|
|
10060
|
+
* Replaces the default logging of one line per outage and one on recovery.
|
|
10061
|
+
*
|
|
10062
|
+
* Not called for a failed `create()`, whose rejection reports the failure,
|
|
10063
|
+
* or after `close()`. A callback that throws or rejects is reported with
|
|
10064
|
+
* `console.error` and otherwise ignored.
|
|
10065
|
+
*/
|
|
10066
|
+
onConnectionEvent?: (event: RedisConnectionEvent) => void;
|
|
10039
10067
|
/**
|
|
10040
10068
|
* Skip the lazy backfill of legacy execution / eval-history entries into
|
|
10041
10069
|
* the sorted-set indexes during `RedisStore.create()`. Default `false`
|
|
@@ -10139,10 +10167,28 @@ interface RedisStoreOptions {
|
|
|
10139
10167
|
* async `RedisStore.create()` factory, which connects before returning.
|
|
10140
10168
|
*/
|
|
10141
10169
|
declare class RedisStore implements StateStore {
|
|
10142
|
-
private
|
|
10170
|
+
private connection;
|
|
10143
10171
|
private keyPrefix;
|
|
10144
10172
|
private ttls;
|
|
10145
10173
|
private constructor();
|
|
10174
|
+
/**
|
|
10175
|
+
* Whether the store can send commands right now, for a health check or for
|
|
10176
|
+
* telling an outage from other failures when a call rejects. `false` while
|
|
10177
|
+
* reconnecting and after `close()`.
|
|
10178
|
+
*/
|
|
10179
|
+
get isConnected(): boolean;
|
|
10180
|
+
/**
|
|
10181
|
+
* The client for sending a command, failing immediately while disconnected.
|
|
10182
|
+
*
|
|
10183
|
+
* Every command goes through here because node-redis's `disableOfflineQueue`
|
|
10184
|
+
* rejects single commands but not `multi().exec()`, which would wait for a
|
|
10185
|
+
* reconnect attempt to fail or succeed. Nothing may `await` between
|
|
10186
|
+
* `client.multi()` and `.exec()`, or a transaction could get past this check.
|
|
10187
|
+
*
|
|
10188
|
+
* A closed store isn't "unavailable": it falls through to node-redis's own
|
|
10189
|
+
* "The client is closed" rejection.
|
|
10190
|
+
*/
|
|
10191
|
+
private get client();
|
|
10146
10192
|
/**
|
|
10147
10193
|
* History kinds with a prune running in this process. A save skips its
|
|
10148
10194
|
* prune while another one of the same kind is in flight: the running one
|
|
@@ -10395,6 +10441,11 @@ declare class RedisStore implements StateStore {
|
|
|
10395
10441
|
* must not get a rejected promise for it. `MemoryStore.close()` and
|
|
10396
10442
|
* better-sqlite3's `close()` are both no-ops the second time; node-redis
|
|
10397
10443
|
* instead rejects with "The client is closed", so absorb that here.
|
|
10444
|
+
*
|
|
10445
|
+
* Bounded, so a shutdown can't hang on Redis. `QUIT` lets queued commands
|
|
10446
|
+
* finish on a healthy connection, but node-redis never settles it if the
|
|
10447
|
+
* socket closes first, and a stalled server may never answer it. While
|
|
10448
|
+
* disconnected it couldn't be sent at all.
|
|
10398
10449
|
*/
|
|
10399
10450
|
close(): Promise<void>;
|
|
10400
10451
|
deleteCheckpoints(executionId: string): Promise<void>;
|
|
@@ -10467,4 +10518,4 @@ declare class NoopSpanManager implements SpanManager {
|
|
|
10467
10518
|
*/
|
|
10468
10519
|
declare function createSpanManager(config?: TelemetryConfig): Promise<SpanManager>;
|
|
10469
10520
|
|
|
10470
|
-
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedExternalRequestRecord, type CapturedJsonValue, type CapturedMessage, type CapturedModelRequestRecord, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionCursor, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationRecord, type ExternalOperationReport, FileDiagnosticArtifactStore, type FinishReason, type FoldedOperationRecord, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HistoryRetentionCursor, type HistoryRetentionKind, type HistoryRetentionOptions, type HistoryRetentionResult, type HistoryTtls, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type MemoryStoreOptions, type ModelCallRecord, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningContextReset, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, RedisStore, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SQLiteStoreOptions, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanAttributeValue, type SpanAttributes, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedModelOptionError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, capturedJournalLineSchema, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, externalOperationRecordSchema, extractJson, extractThinkTags, findConfig, foldJournal, foldedOperationRecordSchema, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, modelCallRecordSchema, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, redactModelCallRecord, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
|
10521
|
+
export { AXL_EVENT_TYPES, AXL_EVENT_TYPES_V2, AXL_TOOL_LIFECYCLE_TYPES_V2, AZURE_PROFILE, type Accounting, type AccountingCompleteness, type AccountingReason, type AccountingUsage, AdmissionController, AdmissionDeniedError, type Agent, type AgentCallEndData, type AgentCallInfo, type AgentCallParams, type AgentCallStartData, type AgentConfig, AnthropicProvider, type AnyWorkflow, type ApiKeySource, type ArtifactManifest, type ArtifactOwner, type ArtifactStatus, type ArtifactWriteResult, type AskOptions, type AskScoped, type AuthHeader, type AwaitHumanData, type AwaitHumanOptions, type AwaitHumanResolvedData, type AxlConfig, AxlError, type AxlEvent, type AxlEventBase, AxlEventBus, type AxlEventOf, type AxlEventType, type AxlEventV2, type AxlEventV2Of, AxlRuntime, AxlStream, BEDROCK_PROFILE, BUILTIN_PROFILES, BudgetExceededError, type BudgetOptions, type BudgetResult, CONFIG_CANDIDATES, COST_BEARING_LEAF_TYPES, type CallTiming, type CapabilityFlags, type CaptureCorrelation, type CapturedCorrection, type CapturedError, type CapturedExternalRequestRecord, type CapturedJsonValue, type CapturedMessage, type CapturedModelRequestRecord, type CapturedOperationRef, type CapturedPhase, type CapturedRequest, type CapturedRequestRecord, type CapturedResponse, type ChatMessage, type ChatOptions, type CheckpointEventData, type CoalescedPartialObject, type CostProvenance, type CreateContextOptions, DEEPSEEK_PROFILE, DEFAULT_MAX_QUEUE_BYTES, DEFAULT_MAX_RECORD_BYTES, DEFAULT_MAX_RUN_BYTES, type DecisionCleanupFailedEvent, type DelegateData, type DelegateOptions, type DiagnosticArtifactStore, type DiagnosticArtifactsConfig, type DiagnosticsConfig, type DispatchAdmission, type Effort, type EffortResolution, type EmbedResult, type EmbedUsage, type Embedder, type EvalExecuteWorkflow, type EvalHistoryEntry, type EvalProgressEventShape, type EventStreamOptions, EventStreamOverflowError, type ExecuteOptions, type ExecutionCursor, type ExecutionInfo, type ExecutionInfoV1, type ExecutionInfoV2, type ExecutionState, type ExternalOperationDescriptor, type ExternalOperationRecord, type ExternalOperationReport, FileDiagnosticArtifactStore, type FinishReason, type FoldedOperationRecord, GROQ_PROFILE, GeminiProvider, GeminiTranscriptionProvider, type GuardrailBlockHandler, type GuardrailData, GuardrailError, type GuardrailResult, type GuardrailsConfig, type HandoffDescriptor, type HandoffRecord, type HandoffReturnData, type HandoffStartData, type HistoricalAxlEvent, type HistoricalExecutionInfo, type HistoryRetentionCursor, type HistoryRetentionKind, type HistoryRetentionOptions, type HistoryRetentionResult, type HistoryTtls, type HumanDecision, InMemoryVectorStore, type InputAudioPart, type InputContentPart, type InputGuardrail, type InputImagePart, type InputMediaSource, type InputModalitySupport, type InputTextPart, InvalidModelInputError, InvalidTranscriptionInputError, LLAMACPP_PROFILE, LMSTUDIO_PROFILE, type LegacyAxlEventV1, type LegacyExecutionInfoV1, MAX_INLINE_MODEL_INPUT_BYTES, MAX_INLINE_TRANSCRIPTION_BYTES, MISTRAL_PROFILE, type MapOptions, MaxTurnsError, McpManager, type McpServer, type McpServerConfig, type McpToolDefinition, type McpToolResult, type MemoryConfig, type MemoryEventData, MemoryManager, MemoryStore, type MemoryStoreOptions, type ModelCallRecord, type ModelInput, type ModelInputDescriptor, type ModelTimingRollup, NoConsensus, NoopSpanManager, OLLAMA_PROFILE, OPENAI_PRICING, OPENAI_PROFILE, OPENROUTER_PROFILE, type ObservationStatus, type OpenAICompatibleOptions, OpenAICompatibleProvider, OpenAIEmbedder, OpenAIProvider, OpenAIResponsesProvider, OpenAITranscriptionProvider, OpenRouterTranscriptionProvider, type OpenedArtifact, type OperationKind, type OperationPurpose, type OutputGuardrail, type OutputValidator, type PendingDecision, type PerModel, type PricingSource, type PricingTable, type ProfileInputModalities, type Provider, type ProviderAdapter, type ProviderDiagnosticData, ProviderError, type ProviderInputValidationRequest, type ProviderInputValidationResult, type ProviderProfile, ProviderRegistry, type ProviderResponse, QuorumNotMet, REDACTED, REDACTION_RULES, type RaceOptions, type RateLimitConfig, RateLimiter, type ReasoningCapture, type ReasoningContextReset, type ReasoningEmit, type ReasoningProfile, type ReasoningRoundTrip, type RecallOptions, type RecallResult, type RecordedAudioSource, type RedisConnectionEvent, RedisStore, type RedisStoreOptions, type RememberOptions, type RememberResult, RequestCaptureChannel, type RequestCaptureOptions, type RequestCaptureSink, type RequestCaptureStatus, type ResolvedThinkingOptions, type Result, type RetryFeedbackHook, type RetryFeedbackInfo, type RetryFeedbackResult, type RetryPolicy, type RuntimeEvalConfigShape, SGLANG_PROFILE, SQLiteStore, type SQLiteStoreOptions, type SchemaCheckData, type SchemaDiagnosticData, type SchemaPromptOption, Session, type SessionOptions, type SpanAttributeValue, type SpanAttributes, type SpanHandle, type SpanManager, type SpawnOptions, SqliteVectorStore, type StagedArtifact, StallTimeoutError, type StateStore, type StreamChunk, type StringDeltaData, type StringStreamEvent, type StringStreamFilter, type TelemetryConfig, ThinkTagScanner, type TimeoutBreakdown, TimeoutError, type Tool, type ToolApprovalData, type ToolArgumentIssue, type ToolCallCancellation, type ToolCallData, type ToolCallEndData, type ToolCallFailure, type ToolCallMessage, type ToolCallOutcome, type ToolCallRejectedData, type ToolCallRejectedEvent, type ToolCallStartData, type ToolCallStartDataV2, type ToolChoice, type ToolConfig, type ToolDeniedData, type ToolEventError, ToolFailure, type ToolFailureConstructor, type ToolFailureOptions, type ToolHooks, type ToolLifecycleEventV2, type ToolModelOutput, ToolModelOutputError, type TrackExecutionMetadata, type TrackExecutionResult, type TrackOutcomeOptions, type TrackedOutcome, type Transcript, type TranscriptionCapabilities, TranscriptionOperationError, type TranscriptionProvider, TranscriptionProviderRegistry, type TranscriptionProviderRequest, type TranscriptionProviderResult, type TranscriptionRequest, UnsupportedEventSchemaVersionError, UnsupportedModelInputError, UnsupportedModelOptionError, UnsupportedTranscriptionInputError, VLLM_PROFILE, type ValidateData, type ValidateResult, ValidationError, type VectorEntry, type VectorResult, type VectorStore, type VerifyData, VerifyError, type VerifyOptions, type VerifyRetry, type VoteOptions, type Workflow, type WorkflowConfig, WorkflowContext, type WorkflowContextInit, type WorkflowEndData, type WorkflowStartData, XAI_PROFILE, agent, capturedJournalLineSchema, createSpanManager, defineConfig, estimateOpenAICost, eventCostContribution, expandGlob, externalOperation, externalOperationRecordSchema, extractJson, extractThinkTags, findConfig, foldJournal, foldedOperationRecordSchema, getEventSchemaVersion, getExecutionEventSchemaVersion, hasPositiveBillableWork, hasPositiveTokens, importModule, inputText, isAdmissionDeniedError, isCostBearingLeaf, isRetryableStatus, isRootLevel, isUnpricedLeaf, isUsableCost, modelCallRecordSchema, needsTsxLoader, normalizeStoredExecution, openaiReasoningEmit, parsePartialJson, pickDefault, pickExport, priceFromTable, reasoningEffortEmit, reasoningObjectEmit, redactCapturedRequest, redactEvent, redactHistoricalEvent, redactModelCallRecord, registerConditions, resolveApiKey, resolvePerModel, resolveRuntime, resolveThinkingOptions, stringStreamFromEvents, summarizeModelInput, tool, workflow, zodToJsonSchema };
|
package/dist/index.js
CHANGED
|
@@ -348,7 +348,7 @@ var sharedGuard = typeof installedGuard === "object" && installedGuard !== null
|
|
|
348
348
|
var buildPath = typeof __AXL_BUILD_PATH__ === "string" ? __AXL_BUILD_PATH__ : "<source>";
|
|
349
349
|
var thisCopy = {
|
|
350
350
|
path: buildPath.startsWith("file:") ? fileURLToPath(buildPath) : buildPath,
|
|
351
|
-
version: true ? "0.27.
|
|
351
|
+
version: true ? "0.27.1" : "unknown"
|
|
352
352
|
};
|
|
353
353
|
function warnCrossCopy(other, joined) {
|
|
354
354
|
if (other === thisCopy) return;
|
|
@@ -17026,7 +17026,7 @@ ${appendedSchemaText}`;
|
|
|
17026
17026
|
`ctx.checkpoint name "${name}" is reserved \u2014 names starting with "__auto/" (case-insensitive) are used by the runtime for ask/spawn/race/parallel/map auto-checkpointing.`
|
|
17027
17027
|
);
|
|
17028
17028
|
}
|
|
17029
|
-
return this._checkpoint(name, fn);
|
|
17029
|
+
return this._checkpoint(name, fn, { saveRequired: true });
|
|
17030
17030
|
}
|
|
17031
17031
|
/**
|
|
17032
17032
|
* Internal checkpoint implementation shared by both the public
|
|
@@ -17056,7 +17056,17 @@ ${appendedSchemaText}`;
|
|
|
17056
17056
|
return saved;
|
|
17057
17057
|
}
|
|
17058
17058
|
const result = await fn();
|
|
17059
|
-
|
|
17059
|
+
if (!options?.saveRequired && this.autoCheckpointCounters.saveFailed) return result;
|
|
17060
|
+
try {
|
|
17061
|
+
await this.stateStore.saveCheckpoint(this.executionId, name, result);
|
|
17062
|
+
} catch (err) {
|
|
17063
|
+
if (options?.saveRequired) throw err;
|
|
17064
|
+
this.autoCheckpointCounters.saveFailed = true;
|
|
17065
|
+
console.error(
|
|
17066
|
+
`[axl] Failed to save checkpoint "${name}" for executionId=${this.executionId}; a replay would run this step and later ones again: ${err instanceof Error ? err.message : String(err)}`
|
|
17067
|
+
);
|
|
17068
|
+
return result;
|
|
17069
|
+
}
|
|
17060
17070
|
this.emitEvent({
|
|
17061
17071
|
type: "checkpoint_save",
|
|
17062
17072
|
...agentStamp,
|
|
@@ -19977,11 +19987,18 @@ var Session = class _Session {
|
|
|
19977
19987
|
try {
|
|
19978
19988
|
const completion = axlStream.promise.then(
|
|
19979
19989
|
(result) => this.commitHistory(history, result).catch((err) => {
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
19990
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
19991
|
+
try {
|
|
19992
|
+
this.runtime.emit("error", {
|
|
19993
|
+
type: "session_history_save_failed",
|
|
19994
|
+
sessionId: this.sessionId,
|
|
19995
|
+
error
|
|
19996
|
+
});
|
|
19997
|
+
} catch {
|
|
19998
|
+
console.error(
|
|
19999
|
+
`[axl] Failed to save session history for sessionId=${this.sessionId}: ${error}`
|
|
20000
|
+
);
|
|
20001
|
+
}
|
|
19985
20002
|
}),
|
|
19986
20003
|
() => void 0
|
|
19987
20004
|
);
|
|
@@ -22057,7 +22074,11 @@ var AxlRuntime = class extends EventEmitter2 {
|
|
|
22057
22074
|
observation
|
|
22058
22075
|
});
|
|
22059
22076
|
if (this.stateStore.deleteCheckpoints) {
|
|
22060
|
-
await this.stateStore.deleteCheckpoints(execInfo.executionId)
|
|
22077
|
+
await this.stateStore.deleteCheckpoints(execInfo.executionId).catch((err) => {
|
|
22078
|
+
console.error(
|
|
22079
|
+
`[axl] Failed to delete checkpoints for executionId=${execInfo.executionId}: ` + (err instanceof Error ? err.message : String(err))
|
|
22080
|
+
);
|
|
22081
|
+
});
|
|
22061
22082
|
}
|
|
22062
22083
|
span?.setAttribute("axl.workflow.cost", execInfo.totalCost);
|
|
22063
22084
|
span?.setAttribute("axl.workflow.duration", execInfo.duration);
|
|
@@ -22129,7 +22150,10 @@ var AxlRuntime = class extends EventEmitter2 {
|
|
|
22129
22150
|
const chain = this.stateStore.saveExecution(snapshot).then(() => {
|
|
22130
22151
|
return this.streamingFlusher?.finalize(id).catch(() => {
|
|
22131
22152
|
});
|
|
22132
|
-
}).catch(() => {
|
|
22153
|
+
}).catch((err) => {
|
|
22154
|
+
console.error(
|
|
22155
|
+
`[axl] Failed to save execution history for executionId=${id}: ` + (err instanceof Error ? err.message : String(err))
|
|
22156
|
+
);
|
|
22133
22157
|
}).then(() => void 0);
|
|
22134
22158
|
this.persistInflight.add(chain);
|
|
22135
22159
|
const pending = { snapshot, settled: chain };
|
|
@@ -24552,12 +24576,108 @@ function warnIfRedisExecutionRetentionUnset(opts) {
|
|
|
24552
24576
|
warnExecutionRetentionUnset("RedisStore");
|
|
24553
24577
|
}
|
|
24554
24578
|
}
|
|
24579
|
+
var CLOSE_TIMEOUT_MS = 2e3;
|
|
24580
|
+
function reconnectDelayMs(retries) {
|
|
24581
|
+
return Math.min(2 ** retries * 50, 2e3) + Math.floor(Math.random() * 200);
|
|
24582
|
+
}
|
|
24583
|
+
function abandonConnection(client) {
|
|
24584
|
+
try {
|
|
24585
|
+
client.destroy?.();
|
|
24586
|
+
} catch {
|
|
24587
|
+
}
|
|
24588
|
+
client.unref?.();
|
|
24589
|
+
}
|
|
24590
|
+
function errorMessage(error) {
|
|
24591
|
+
return error instanceof Error ? error.message : String(error);
|
|
24592
|
+
}
|
|
24593
|
+
function connectionEventReporter(client, onConnectionEvent) {
|
|
24594
|
+
if (onConnectionEvent) {
|
|
24595
|
+
const reportFailure = (error) => console.error(`[axl] RedisStore: onConnectionEvent failed: ${errorMessage(error)}`);
|
|
24596
|
+
return (event) => {
|
|
24597
|
+
try {
|
|
24598
|
+
Promise.resolve(onConnectionEvent(event)).catch(reportFailure);
|
|
24599
|
+
} catch (error) {
|
|
24600
|
+
reportFailure(error);
|
|
24601
|
+
}
|
|
24602
|
+
};
|
|
24603
|
+
}
|
|
24604
|
+
let outageLogged = false;
|
|
24605
|
+
return (event) => {
|
|
24606
|
+
if (event.type === "reconnected") {
|
|
24607
|
+
outageLogged = false;
|
|
24608
|
+
console.warn("[axl] RedisStore: reconnected to Redis.");
|
|
24609
|
+
} else if (!outageLogged) {
|
|
24610
|
+
outageLogged = client.isReady === false;
|
|
24611
|
+
console.warn(
|
|
24612
|
+
`[axl] RedisStore: Redis connection lost (${event.error.message}). Store calls fail until it reconnects, which happens automatically.`
|
|
24613
|
+
);
|
|
24614
|
+
}
|
|
24615
|
+
};
|
|
24616
|
+
}
|
|
24617
|
+
async function connectClient(createClient, opts) {
|
|
24618
|
+
let established = false;
|
|
24619
|
+
const client = createClient({
|
|
24620
|
+
...opts.url ? { url: opts.url } : {},
|
|
24621
|
+
// A command accepted just before a drop rejects instead of waiting for
|
|
24622
|
+
// the reconnect.
|
|
24623
|
+
disableOfflineQueue: true,
|
|
24624
|
+
socket: { reconnectStrategy: (retries) => established ? reconnectDelayMs(retries) : false }
|
|
24625
|
+
});
|
|
24626
|
+
const reportConnectionEvent = connectionEventReporter(client, opts.onConnectionEvent);
|
|
24627
|
+
client.on("error", (error) => {
|
|
24628
|
+
if (!established || client.isOpen === false) return;
|
|
24629
|
+
reportConnectionEvent({
|
|
24630
|
+
type: "error",
|
|
24631
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
24632
|
+
});
|
|
24633
|
+
});
|
|
24634
|
+
client.on("connect", () => {
|
|
24635
|
+
if (client.isOpen === false) client.unref?.();
|
|
24636
|
+
});
|
|
24637
|
+
client.on("ready", () => {
|
|
24638
|
+
if (!established) {
|
|
24639
|
+
established = true;
|
|
24640
|
+
} else if (client.isOpen !== false) {
|
|
24641
|
+
reportConnectionEvent({ type: "reconnected" });
|
|
24642
|
+
}
|
|
24643
|
+
});
|
|
24644
|
+
await client.connect();
|
|
24645
|
+
return client;
|
|
24646
|
+
}
|
|
24555
24647
|
var RedisStore = class _RedisStore {
|
|
24556
|
-
constructor(
|
|
24557
|
-
this.
|
|
24648
|
+
constructor(connection, keyPrefix, ttls) {
|
|
24649
|
+
this.connection = connection;
|
|
24558
24650
|
this.keyPrefix = keyPrefix;
|
|
24559
24651
|
this.ttls = ttls;
|
|
24560
24652
|
}
|
|
24653
|
+
/**
|
|
24654
|
+
* Whether the store can send commands right now, for a health check or for
|
|
24655
|
+
* telling an outage from other failures when a call rejects. `false` while
|
|
24656
|
+
* reconnecting and after `close()`.
|
|
24657
|
+
*/
|
|
24658
|
+
get isConnected() {
|
|
24659
|
+
return this.connection.isOpen !== false && this.connection.isReady !== false;
|
|
24660
|
+
}
|
|
24661
|
+
/**
|
|
24662
|
+
* The client for sending a command, failing immediately while disconnected.
|
|
24663
|
+
*
|
|
24664
|
+
* Every command goes through here because node-redis's `disableOfflineQueue`
|
|
24665
|
+
* rejects single commands but not `multi().exec()`, which would wait for a
|
|
24666
|
+
* reconnect attempt to fail or succeed. Nothing may `await` between
|
|
24667
|
+
* `client.multi()` and `.exec()`, or a transaction could get past this check.
|
|
24668
|
+
*
|
|
24669
|
+
* A closed store isn't "unavailable": it falls through to node-redis's own
|
|
24670
|
+
* "The client is closed" rejection.
|
|
24671
|
+
*/
|
|
24672
|
+
get client() {
|
|
24673
|
+
if (this.connection.isOpen !== false && this.connection.isReady === false) {
|
|
24674
|
+
throw new AxlError(
|
|
24675
|
+
"REDIS_UNAVAILABLE",
|
|
24676
|
+
"RedisStore: not connected to Redis, so the command was not sent. The store reconnects automatically; retry once Redis is back."
|
|
24677
|
+
);
|
|
24678
|
+
}
|
|
24679
|
+
return this.connection;
|
|
24680
|
+
}
|
|
24561
24681
|
/**
|
|
24562
24682
|
* History kinds with a prune running in this process. A save skips its
|
|
24563
24683
|
* prune while another one of the same kind is in flight: the running one
|
|
@@ -24627,8 +24747,7 @@ var RedisStore = class _RedisStore {
|
|
|
24627
24747
|
if (err instanceof Error && err.message.includes("createClient")) throw err;
|
|
24628
24748
|
throw new Error("redis is required for RedisStore. Install it with: npm install redis");
|
|
24629
24749
|
}
|
|
24630
|
-
const client =
|
|
24631
|
-
await client.connect();
|
|
24750
|
+
const client = await connectClient(createClient, opts);
|
|
24632
24751
|
const resolveCategory = (override) => {
|
|
24633
24752
|
if (override === null) return null;
|
|
24634
24753
|
if (typeof override === "number") return override;
|
|
@@ -24652,8 +24771,13 @@ var RedisStore = class _RedisStore {
|
|
|
24652
24771
|
const store = new _RedisStore(client, keyPrefix, effectiveTtls);
|
|
24653
24772
|
warnIfRedisExecutionRetentionUnset(opts);
|
|
24654
24773
|
if (!opts.skipMigration) {
|
|
24655
|
-
|
|
24656
|
-
|
|
24774
|
+
try {
|
|
24775
|
+
await store.backfillExecutionIndex();
|
|
24776
|
+
await store.backfillEvalIndex();
|
|
24777
|
+
} catch (error) {
|
|
24778
|
+
abandonConnection(client);
|
|
24779
|
+
throw error;
|
|
24780
|
+
}
|
|
24657
24781
|
}
|
|
24658
24782
|
return store;
|
|
24659
24783
|
}
|
|
@@ -24922,7 +25046,7 @@ var RedisStore = class _RedisStore {
|
|
|
24922
25046
|
}
|
|
24923
25047
|
}
|
|
24924
25048
|
if (dead.length > 0) {
|
|
24925
|
-
this.
|
|
25049
|
+
this.connection.sRem(this.pendingExecSetKey(), dead).catch((err) => {
|
|
24926
25050
|
console.error(
|
|
24927
25051
|
`[axl] RedisStore: failed to prune ${dead.length} stale pending-exec ids: ` + (err instanceof Error ? err.message : String(err))
|
|
24928
25052
|
);
|
|
@@ -24968,7 +25092,7 @@ var RedisStore = class _RedisStore {
|
|
|
24968
25092
|
}
|
|
24969
25093
|
const ttl = this.ttlFor("memory");
|
|
24970
25094
|
if (ttl !== void 0) {
|
|
24971
|
-
this.
|
|
25095
|
+
this.connection.expire(this.memoryKey(scope), ttl).catch((err) => {
|
|
24972
25096
|
console.error(
|
|
24973
25097
|
`[axl] RedisStore: failed to set TTL on migrated memory key ${this.memoryKey(scope)}: ` + (err instanceof Error ? err.message : String(err))
|
|
24974
25098
|
);
|
|
@@ -25260,6 +25384,7 @@ var RedisStore = class _RedisStore {
|
|
|
25260
25384
|
try {
|
|
25261
25385
|
await this.pruneHistory(index);
|
|
25262
25386
|
} catch (err) {
|
|
25387
|
+
if (this.connection.isReady === false) return;
|
|
25263
25388
|
warnDiagnosticOnce(
|
|
25264
25389
|
`redis_history_prune_failed\0${index.kind}`,
|
|
25265
25390
|
`RedisStore: removing expired ${index.label} index entries failed (${err instanceof Error ? err.message : String(err)}). The record was saved; the next save retries the cleanup. Listings stay correct meanwhile. The cleanup runs a Lua script, so the Redis user needs permission to run EVAL.`,
|
|
@@ -25464,10 +25589,31 @@ var RedisStore = class _RedisStore {
|
|
|
25464
25589
|
* must not get a rejected promise for it. `MemoryStore.close()` and
|
|
25465
25590
|
* better-sqlite3's `close()` are both no-ops the second time; node-redis
|
|
25466
25591
|
* instead rejects with "The client is closed", so absorb that here.
|
|
25592
|
+
*
|
|
25593
|
+
* Bounded, so a shutdown can't hang on Redis. `QUIT` lets queued commands
|
|
25594
|
+
* finish on a healthy connection, but node-redis never settles it if the
|
|
25595
|
+
* socket closes first, and a stalled server may never answer it. While
|
|
25596
|
+
* disconnected it couldn't be sent at all.
|
|
25467
25597
|
*/
|
|
25468
25598
|
async close() {
|
|
25469
|
-
if (this.
|
|
25470
|
-
|
|
25599
|
+
if (this.connection.isOpen === false) return;
|
|
25600
|
+
if (this.connection.isReady === false) {
|
|
25601
|
+
abandonConnection(this.connection);
|
|
25602
|
+
return;
|
|
25603
|
+
}
|
|
25604
|
+
let timer;
|
|
25605
|
+
try {
|
|
25606
|
+
await Promise.race([
|
|
25607
|
+
this.connection.quit(),
|
|
25608
|
+
new Promise((_resolve, reject) => {
|
|
25609
|
+
timer = setTimeout(() => reject(new Error("QUIT timed out")), CLOSE_TIMEOUT_MS);
|
|
25610
|
+
})
|
|
25611
|
+
]);
|
|
25612
|
+
} catch {
|
|
25613
|
+
abandonConnection(this.connection);
|
|
25614
|
+
} finally {
|
|
25615
|
+
clearTimeout(timer);
|
|
25616
|
+
}
|
|
25471
25617
|
}
|
|
25472
25618
|
async deleteCheckpoints(executionId) {
|
|
25473
25619
|
await this.client.del(this.checkpointKey(executionId));
|