@ariaflowagents/core 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -1
- package/dist/agents/Agent.d.ts +188 -9
- package/dist/agents/Agent.d.ts.map +1 -1
- package/dist/agents/Agent.js +246 -24
- package/dist/agents/Agent.js.map +1 -1
- package/dist/agents/CompositeAgent.d.ts +4 -3
- package/dist/agents/CompositeAgent.d.ts.map +1 -1
- package/dist/agents/CompositeAgent.js +19 -9
- package/dist/agents/CompositeAgent.js.map +1 -1
- package/dist/agents/FlowAgent.d.ts +3 -2
- package/dist/agents/FlowAgent.d.ts.map +1 -1
- package/dist/agents/FlowAgent.js +16 -6
- package/dist/agents/FlowAgent.js.map +1 -1
- package/dist/agents/TriageAgent.d.ts +8 -2
- package/dist/agents/TriageAgent.d.ts.map +1 -1
- package/dist/agents/TriageAgent.js +39 -6
- package/dist/agents/TriageAgent.js.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +0 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/capabilities/AutoRetrieveCapability.d.ts +30 -0
- package/dist/capabilities/AutoRetrieveCapability.d.ts.map +1 -0
- package/dist/capabilities/AutoRetrieveCapability.js +36 -0
- package/dist/capabilities/AutoRetrieveCapability.js.map +1 -0
- package/dist/capabilities/ExtractionCapability.d.ts +25 -0
- package/dist/capabilities/ExtractionCapability.d.ts.map +1 -0
- package/dist/capabilities/ExtractionCapability.js +74 -0
- package/dist/capabilities/ExtractionCapability.js.map +1 -0
- package/dist/capabilities/FlowCapability.d.ts +81 -0
- package/dist/capabilities/FlowCapability.d.ts.map +1 -0
- package/dist/capabilities/FlowCapability.js +482 -0
- package/dist/capabilities/FlowCapability.js.map +1 -0
- package/dist/capabilities/GuardrailCapability.d.ts +30 -0
- package/dist/capabilities/GuardrailCapability.d.ts.map +1 -0
- package/dist/capabilities/GuardrailCapability.js +38 -0
- package/dist/capabilities/GuardrailCapability.js.map +1 -0
- package/dist/capabilities/HandoffCapability.d.ts +19 -0
- package/dist/capabilities/HandoffCapability.d.ts.map +1 -0
- package/dist/capabilities/HandoffCapability.js +58 -0
- package/dist/capabilities/HandoffCapability.js.map +1 -0
- package/dist/capabilities/LivePromptAssembler.d.ts +108 -0
- package/dist/capabilities/LivePromptAssembler.d.ts.map +1 -0
- package/dist/capabilities/LivePromptAssembler.js +157 -0
- package/dist/capabilities/LivePromptAssembler.js.map +1 -0
- package/dist/capabilities/TriageCapability.d.ts +16 -0
- package/dist/capabilities/TriageCapability.d.ts.map +1 -0
- package/dist/capabilities/TriageCapability.js +61 -0
- package/dist/capabilities/TriageCapability.js.map +1 -0
- package/dist/capabilities/adapters/ai-sdk.d.ts +14 -0
- package/dist/capabilities/adapters/ai-sdk.d.ts.map +1 -0
- package/dist/capabilities/adapters/ai-sdk.js +29 -0
- package/dist/capabilities/adapters/ai-sdk.js.map +1 -0
- package/dist/capabilities/adapters/gemini.d.ts +15 -0
- package/dist/capabilities/adapters/gemini.d.ts.map +1 -0
- package/dist/capabilities/adapters/gemini.js +40 -0
- package/dist/capabilities/adapters/gemini.js.map +1 -0
- package/dist/capabilities/index.d.ts +154 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +128 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/eval/EvalRunner.d.ts +12 -0
- package/dist/eval/EvalRunner.d.ts.map +1 -0
- package/dist/eval/EvalRunner.js +64 -0
- package/dist/eval/EvalRunner.js.map +1 -0
- package/dist/eval/scoring.d.ts +15 -0
- package/dist/eval/scoring.d.ts.map +1 -0
- package/dist/eval/scoring.js +152 -0
- package/dist/eval/scoring.js.map +1 -0
- package/dist/eval/types.d.ts +59 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +2 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/flows/FlowGraph.d.ts +3 -1
- package/dist/flows/FlowGraph.d.ts.map +1 -1
- package/dist/flows/FlowGraph.js +5 -0
- package/dist/flows/FlowGraph.js.map +1 -1
- package/dist/flows/FlowManager.d.ts +68 -1
- package/dist/flows/FlowManager.d.ts.map +1 -1
- package/dist/flows/FlowManager.js +499 -36
- package/dist/flows/FlowManager.js.map +1 -1
- package/dist/flows/extraction.d.ts +16 -1
- package/dist/flows/extraction.d.ts.map +1 -1
- package/dist/flows/extraction.js +34 -0
- package/dist/flows/extraction.js.map +1 -1
- package/dist/flows/index.d.ts +2 -0
- package/dist/flows/index.d.ts.map +1 -1
- package/dist/flows/index.js +1 -0
- package/dist/flows/index.js.map +1 -1
- package/dist/flows/validation.d.ts +1 -1
- package/dist/flows/validation.d.ts.map +1 -1
- package/dist/flows/validation.js +13 -1
- package/dist/flows/validation.js.map +1 -1
- package/dist/foundation/AgentDefinition.d.ts +18 -0
- package/dist/foundation/AgentDefinition.d.ts.map +1 -0
- package/dist/foundation/AgentDefinition.js +2 -0
- package/dist/foundation/AgentDefinition.js.map +1 -0
- package/dist/foundation/AgentStateController.d.ts +26 -0
- package/dist/foundation/AgentStateController.d.ts.map +1 -0
- package/dist/foundation/AgentStateController.js +2 -0
- package/dist/foundation/AgentStateController.js.map +1 -0
- package/dist/foundation/ConversationEventLog.d.ts +72 -0
- package/dist/foundation/ConversationEventLog.d.ts.map +1 -0
- package/dist/foundation/ConversationEventLog.js +2 -0
- package/dist/foundation/ConversationEventLog.js.map +1 -0
- package/dist/foundation/ConversationState.d.ts +31 -0
- package/dist/foundation/ConversationState.d.ts.map +1 -0
- package/dist/foundation/ConversationState.js +2 -0
- package/dist/foundation/ConversationState.js.map +1 -0
- package/dist/foundation/DefaultAgentStateController.d.ts +24 -0
- package/dist/foundation/DefaultAgentStateController.d.ts.map +1 -0
- package/dist/foundation/DefaultAgentStateController.js +49 -0
- package/dist/foundation/DefaultAgentStateController.js.map +1 -0
- package/dist/foundation/DefaultConversationEventLog.d.ts +28 -0
- package/dist/foundation/DefaultConversationEventLog.d.ts.map +1 -0
- package/dist/foundation/DefaultConversationEventLog.js +195 -0
- package/dist/foundation/DefaultConversationEventLog.js.map +1 -0
- package/dist/foundation/DefaultConversationState.d.ts +34 -0
- package/dist/foundation/DefaultConversationState.d.ts.map +1 -0
- package/dist/foundation/DefaultConversationState.js +100 -0
- package/dist/foundation/DefaultConversationState.js.map +1 -0
- package/dist/foundation/DefaultToolExecutor.d.ts +58 -0
- package/dist/foundation/DefaultToolExecutor.d.ts.map +1 -0
- package/dist/foundation/DefaultToolExecutor.js +128 -0
- package/dist/foundation/DefaultToolExecutor.js.map +1 -0
- package/dist/foundation/ToolExecutor.d.ts +44 -0
- package/dist/foundation/ToolExecutor.d.ts.map +1 -0
- package/dist/foundation/ToolExecutor.js +2 -0
- package/dist/foundation/ToolExecutor.js.map +1 -0
- package/dist/foundation/createFoundation.d.ts +33 -0
- package/dist/foundation/createFoundation.d.ts.map +1 -0
- package/dist/foundation/createFoundation.js +34 -0
- package/dist/foundation/createFoundation.js.map +1 -0
- package/dist/foundation/index.d.ts +15 -0
- package/dist/foundation/index.d.ts.map +1 -0
- package/dist/foundation/index.js +8 -0
- package/dist/foundation/index.js.map +1 -0
- package/dist/hooks/HookRunner.d.ts +5 -1
- package/dist/hooks/HookRunner.d.ts.map +1 -1
- package/dist/hooks/HookRunner.js +7 -0
- package/dist/hooks/HookRunner.js.map +1 -1
- package/dist/hooks/builtin/metrics.d.ts.map +1 -1
- package/dist/hooks/builtin/metrics.js +12 -0
- package/dist/hooks/builtin/metrics.js.map +1 -1
- package/dist/hooks/builtin/observability.d.ts +21 -0
- package/dist/hooks/builtin/observability.d.ts.map +1 -0
- package/dist/hooks/builtin/observability.js +535 -0
- package/dist/hooks/builtin/observability.js.map +1 -0
- package/dist/index.d.ts +24 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/memory/MemoryService.d.ts +40 -0
- package/dist/memory/MemoryService.d.ts.map +1 -0
- package/dist/memory/MemoryService.js +2 -0
- package/dist/memory/MemoryService.js.map +1 -0
- package/dist/memory/index.d.ts +5 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +3 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/preloadMemory.d.ts +17 -0
- package/dist/memory/preloadMemory.d.ts.map +1 -0
- package/dist/memory/preloadMemory.js +62 -0
- package/dist/memory/preloadMemory.js.map +1 -0
- package/dist/memory/stores/InMemoryMemoryService.d.ts +20 -0
- package/dist/memory/stores/InMemoryMemoryService.d.ts.map +1 -0
- package/dist/memory/stores/InMemoryMemoryService.js +92 -0
- package/dist/memory/stores/InMemoryMemoryService.js.map +1 -0
- package/dist/memory/types.d.ts +49 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +8 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/orchestration/DefaultOrchestrationAuthority.d.ts +91 -0
- package/dist/orchestration/DefaultOrchestrationAuthority.d.ts.map +1 -0
- package/dist/orchestration/DefaultOrchestrationAuthority.js +786 -0
- package/dist/orchestration/DefaultOrchestrationAuthority.js.map +1 -0
- package/dist/orchestration/OrchestrationAuthority.d.ts +119 -0
- package/dist/orchestration/OrchestrationAuthority.d.ts.map +1 -0
- package/dist/orchestration/OrchestrationAuthority.js +2 -0
- package/dist/orchestration/OrchestrationAuthority.js.map +1 -0
- package/dist/orchestration/RealtimeExtractionRunner.d.ts +25 -0
- package/dist/orchestration/RealtimeExtractionRunner.d.ts.map +1 -0
- package/dist/orchestration/RealtimeExtractionRunner.js +62 -0
- package/dist/orchestration/RealtimeExtractionRunner.js.map +1 -0
- package/dist/orchestration/index.d.ts +5 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +4 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/types.d.ts +134 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +2 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/prompts/AgentPrompt.d.ts +110 -0
- package/dist/prompts/AgentPrompt.d.ts.map +1 -0
- package/dist/prompts/AgentPrompt.js +373 -0
- package/dist/prompts/AgentPrompt.js.map +1 -0
- package/dist/prompts/PromptAssembly.d.ts +119 -0
- package/dist/prompts/PromptAssembly.d.ts.map +1 -0
- package/dist/prompts/PromptAssembly.js +150 -0
- package/dist/prompts/PromptAssembly.js.map +1 -0
- package/dist/prompts/PromptBuilder.d.ts +22 -3
- package/dist/prompts/PromptBuilder.d.ts.map +1 -1
- package/dist/prompts/PromptBuilder.js +242 -13
- package/dist/prompts/PromptBuilder.js.map +1 -1
- package/dist/prompts/PromptRenderer.d.ts +43 -0
- package/dist/prompts/PromptRenderer.d.ts.map +1 -0
- package/dist/prompts/PromptRenderer.js +114 -0
- package/dist/prompts/PromptRenderer.js.map +1 -0
- package/dist/prompts/brandVoice.d.ts +10 -0
- package/dist/prompts/brandVoice.d.ts.map +1 -0
- package/dist/prompts/brandVoice.js +87 -0
- package/dist/prompts/brandVoice.js.map +1 -0
- package/dist/prompts/index.d.ts +11 -4
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +7 -2
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/security.d.ts +5 -0
- package/dist/prompts/security.d.ts.map +1 -0
- package/dist/prompts/security.js +52 -0
- package/dist/prompts/security.js.map +1 -0
- package/dist/prompts/types.d.ts +65 -1
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/prompts/types.js +26 -0
- package/dist/prompts/types.js.map +1 -1
- package/dist/realtime/RealtimeAudioClient.d.ts +105 -0
- package/dist/realtime/RealtimeAudioClient.d.ts.map +1 -0
- package/dist/realtime/RealtimeAudioClient.js +15 -0
- package/dist/realtime/RealtimeAudioClient.js.map +1 -0
- package/dist/realtime/RealtimeRuntime.d.ts +136 -0
- package/dist/realtime/RealtimeRuntime.d.ts.map +1 -0
- package/dist/realtime/RealtimeRuntime.js +270 -0
- package/dist/realtime/RealtimeRuntime.js.map +1 -0
- package/dist/realtime/index.d.ts +4 -0
- package/dist/realtime/index.d.ts.map +1 -0
- package/dist/realtime/index.js +2 -0
- package/dist/realtime/index.js.map +1 -0
- package/dist/runtime/ContextBudget.d.ts +57 -0
- package/dist/runtime/ContextBudget.d.ts.map +1 -0
- package/dist/runtime/ContextBudget.js +103 -0
- package/dist/runtime/ContextBudget.js.map +1 -0
- package/dist/runtime/ContextManager.d.ts +8 -5
- package/dist/runtime/ContextManager.d.ts.map +1 -1
- package/dist/runtime/ContextManager.js +47 -14
- package/dist/runtime/ContextManager.js.map +1 -1
- package/dist/runtime/ExtractionEngine.d.ts +2 -1
- package/dist/runtime/ExtractionEngine.d.ts.map +1 -1
- package/dist/runtime/ExtractionEngine.js +11 -0
- package/dist/runtime/ExtractionEngine.js.map +1 -1
- package/dist/runtime/FlowExecutor.d.ts +22 -15
- package/dist/runtime/FlowExecutor.d.ts.map +1 -1
- package/dist/runtime/FlowExecutor.js +102 -149
- package/dist/runtime/FlowExecutor.js.map +1 -1
- package/dist/runtime/Runtime.d.ts +53 -78
- package/dist/runtime/Runtime.d.ts.map +1 -1
- package/dist/runtime/Runtime.js +272 -1406
- package/dist/runtime/Runtime.js.map +1 -1
- package/dist/runtime/SessionCache.d.ts +16 -0
- package/dist/runtime/SessionCache.d.ts.map +1 -0
- package/dist/runtime/SessionCache.js +49 -0
- package/dist/runtime/SessionCache.js.map +1 -0
- package/dist/runtime/SessionMutex.d.ts +37 -0
- package/dist/runtime/SessionMutex.d.ts.map +1 -0
- package/dist/runtime/SessionMutex.js +59 -0
- package/dist/runtime/SessionMutex.js.map +1 -0
- package/dist/runtime/StreamEmitter.d.ts +34 -0
- package/dist/runtime/StreamEmitter.d.ts.map +1 -0
- package/dist/runtime/StreamEmitter.js +91 -0
- package/dist/runtime/StreamEmitter.js.map +1 -0
- package/dist/runtime/handoffFilters.d.ts +60 -0
- package/dist/runtime/handoffFilters.d.ts.map +1 -0
- package/dist/runtime/handoffFilters.js +95 -0
- package/dist/runtime/handoffFilters.js.map +1 -0
- package/dist/runtime/pipeline/AgentExecuteStage.d.ts +22 -0
- package/dist/runtime/pipeline/AgentExecuteStage.d.ts.map +1 -0
- package/dist/runtime/pipeline/AgentExecuteStage.js +958 -0
- package/dist/runtime/pipeline/AgentExecuteStage.js.map +1 -0
- package/dist/runtime/pipeline/ContextAssembleStage.d.ts +26 -0
- package/dist/runtime/pipeline/ContextAssembleStage.d.ts.map +1 -0
- package/dist/runtime/pipeline/ContextAssembleStage.js +253 -0
- package/dist/runtime/pipeline/ContextAssembleStage.js.map +1 -0
- package/dist/runtime/pipeline/ContextGatherStage.d.ts +21 -0
- package/dist/runtime/pipeline/ContextGatherStage.d.ts.map +1 -0
- package/dist/runtime/pipeline/ContextGatherStage.js +161 -0
- package/dist/runtime/pipeline/ContextGatherStage.js.map +1 -0
- package/dist/runtime/pipeline/IntakeStage.d.ts +25 -0
- package/dist/runtime/pipeline/IntakeStage.d.ts.map +1 -0
- package/dist/runtime/pipeline/IntakeStage.js +126 -0
- package/dist/runtime/pipeline/IntakeStage.js.map +1 -0
- package/dist/runtime/pipeline/PostStreamStage.d.ts +26 -0
- package/dist/runtime/pipeline/PostStreamStage.d.ts.map +1 -0
- package/dist/runtime/pipeline/PostStreamStage.js +129 -0
- package/dist/runtime/pipeline/PostStreamStage.js.map +1 -0
- package/dist/runtime/pipeline/TurnPipeline.d.ts +54 -0
- package/dist/runtime/pipeline/TurnPipeline.d.ts.map +1 -0
- package/dist/runtime/pipeline/TurnPipeline.js +15 -0
- package/dist/runtime/pipeline/TurnPipeline.js.map +1 -0
- package/dist/runtime/pipeline/TurnServices.d.ts +48 -0
- package/dist/runtime/pipeline/TurnServices.d.ts.map +1 -0
- package/dist/runtime/pipeline/TurnServices.js +2 -0
- package/dist/runtime/pipeline/TurnServices.js.map +1 -0
- package/dist/runtime/pipeline/agentTypeGuards.d.ts +4 -0
- package/dist/runtime/pipeline/agentTypeGuards.d.ts.map +1 -0
- package/dist/runtime/pipeline/agentTypeGuards.js +7 -0
- package/dist/runtime/pipeline/agentTypeGuards.js.map +1 -0
- package/dist/runtime/pipeline/index.d.ts +11 -0
- package/dist/runtime/pipeline/index.d.ts.map +1 -0
- package/dist/runtime/pipeline/index.js +13 -0
- package/dist/runtime/pipeline/index.js.map +1 -0
- package/dist/runtime/pipeline/outputProcessing.d.ts +23 -0
- package/dist/runtime/pipeline/outputProcessing.d.ts.map +1 -0
- package/dist/runtime/pipeline/outputProcessing.js +63 -0
- package/dist/runtime/pipeline/outputProcessing.js.map +1 -0
- package/dist/runtime/pipeline/sessionUtils.d.ts +12 -0
- package/dist/runtime/pipeline/sessionUtils.d.ts.map +1 -0
- package/dist/runtime/pipeline/sessionUtils.js +73 -0
- package/dist/runtime/pipeline/sessionUtils.js.map +1 -0
- package/dist/tools/Tool.d.ts +7 -0
- package/dist/tools/Tool.d.ts.map +1 -1
- package/dist/tools/Tool.js +12 -3
- package/dist/tools/Tool.js.map +1 -1
- package/dist/tools/memory.d.ts +26 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +51 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/types/index.d.ts +238 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/telemetry.d.ts +107 -0
- package/dist/types/telemetry.d.ts.map +1 -1
- package/guides/AGENTS.md +173 -0
- package/guides/README.md +12 -0
- package/guides/TOOLS.md +93 -27
- package/package.json +25 -4
- package/dist/agents/LLMAgent.d.ts +0 -11
- package/dist/agents/LLMAgent.d.ts.map +0 -1
- package/dist/agents/LLMAgent.js +0 -31
- package/dist/agents/LLMAgent.js.map +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IntakeStage — Stage 1 of the turn pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Session load (from cache or store)
|
|
6
|
+
* - Triage routing decisions
|
|
7
|
+
* - Abort controller setup
|
|
8
|
+
* - Global input processor execution
|
|
9
|
+
* - User message persistence
|
|
10
|
+
*/
|
|
11
|
+
import crypto from 'node:crypto';
|
|
12
|
+
import { runInputProcessors } from '../../processors/ProcessorRunner.js';
|
|
13
|
+
import { InjectionQueue, getPolicyProfileInjections } from '../InjectionQueue.js';
|
|
14
|
+
import { isFlowAgent, isTriageAgent } from './agentTypeGuards.js';
|
|
15
|
+
import { getFlowState, appendSessionMessage } from './sessionUtils.js';
|
|
16
|
+
/**
|
|
17
|
+
* Runs Stage 1: Intake — loads session, runs input processors, appends user message.
|
|
18
|
+
*/
|
|
19
|
+
export async function* runIntakeStage(options, services) {
|
|
20
|
+
const { userId, abortSignal, agentId: forcedAgentId } = options;
|
|
21
|
+
const input = options.input;
|
|
22
|
+
if (typeof input !== 'string') {
|
|
23
|
+
throw new Error('Runtime.stream: "input" is required and must be a string.');
|
|
24
|
+
}
|
|
25
|
+
const effectiveSessionId = options.sessionId ?? crypto.randomUUID();
|
|
26
|
+
let session;
|
|
27
|
+
if (options.sessionId) {
|
|
28
|
+
const existing = services.sessionCache
|
|
29
|
+
? await services.sessionCache.getOrLoad(options.sessionId, services.sessionStore)
|
|
30
|
+
: await services.sessionStore.get(options.sessionId);
|
|
31
|
+
session = existing ?? services.conversationState.createSession(effectiveSessionId, services.defaultAgentId, userId);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
session = services.conversationState.createSession(effectiveSessionId, services.defaultAgentId, userId);
|
|
35
|
+
}
|
|
36
|
+
// Triage routing
|
|
37
|
+
if (forcedAgentId && services.agents.has(forcedAgentId)) {
|
|
38
|
+
services.agentStateController.setActiveAgent(session, forcedAgentId);
|
|
39
|
+
}
|
|
40
|
+
else if (services.alwaysRouteThroughTriage) {
|
|
41
|
+
const currentAgentId = services.agentStateController.getActiveAgent(session, services.defaultAgentId);
|
|
42
|
+
const currentAgent = services.agents.get(currentAgentId);
|
|
43
|
+
const hasActiveFlow = Boolean(currentAgent) &&
|
|
44
|
+
isFlowAgent(currentAgent) &&
|
|
45
|
+
Boolean(getFlowState(session, currentAgent.id)?.initialized) &&
|
|
46
|
+
!Boolean(getFlowState(session, currentAgent.id)?.flowEnded);
|
|
47
|
+
if (!hasActiveFlow) {
|
|
48
|
+
const triageId = services.triageAgentId ?? services.defaultAgentId;
|
|
49
|
+
const triageAgent = services.agents.get(triageId);
|
|
50
|
+
if (triageAgent && isTriageAgent(triageAgent)) {
|
|
51
|
+
services.agentStateController.setActiveAgent(session, triageId);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const activeAgentId = services.agentStateController.getActiveAgent(session, services.defaultAgentId);
|
|
56
|
+
services.agentStateController.setActiveAgent(session, activeAgentId);
|
|
57
|
+
const context = {
|
|
58
|
+
session,
|
|
59
|
+
agentId: activeAgentId,
|
|
60
|
+
stepCount: 0,
|
|
61
|
+
totalTokens: 0,
|
|
62
|
+
handoffStack: [],
|
|
63
|
+
startTime: Date.now(),
|
|
64
|
+
consecutiveErrors: 0,
|
|
65
|
+
toolCallHistory: [],
|
|
66
|
+
};
|
|
67
|
+
services.conversationState.bumpSessionTurn(session);
|
|
68
|
+
const injectionQueue = buildPolicyInjectionQueue(services);
|
|
69
|
+
yield* services.streamEmitter.emit(context, { type: 'input', text: input, userId: session.userId || undefined });
|
|
70
|
+
const controller = new AbortController();
|
|
71
|
+
await services.hookRunner.onStart(context);
|
|
72
|
+
// Run global input processors
|
|
73
|
+
let processedInput = input;
|
|
74
|
+
const turnInputProcessors = [...services.inputProcessors];
|
|
75
|
+
if (turnInputProcessors.length > 0) {
|
|
76
|
+
const candidateMessages = [
|
|
77
|
+
...session.messages,
|
|
78
|
+
{ role: 'user', content: processedInput },
|
|
79
|
+
];
|
|
80
|
+
const procCtx = {
|
|
81
|
+
session,
|
|
82
|
+
agentId: activeAgentId,
|
|
83
|
+
toolCallHistory: context.toolCallHistory,
|
|
84
|
+
abortSignal: controller.signal,
|
|
85
|
+
};
|
|
86
|
+
const outcome = await runInputProcessors({
|
|
87
|
+
processors: turnInputProcessors,
|
|
88
|
+
input: processedInput,
|
|
89
|
+
messages: candidateMessages,
|
|
90
|
+
context: procCtx,
|
|
91
|
+
});
|
|
92
|
+
if (outcome.blocked) {
|
|
93
|
+
yield* services.streamEmitter.emit(context, {
|
|
94
|
+
type: 'tripwire',
|
|
95
|
+
phase: 'input',
|
|
96
|
+
processorId: outcome.processorId,
|
|
97
|
+
reason: outcome.reason,
|
|
98
|
+
message: outcome.message,
|
|
99
|
+
});
|
|
100
|
+
yield* services.streamEmitter.emit(context, { type: 'text-delta', text: outcome.message });
|
|
101
|
+
yield* services.streamEmitter.emit(context, { type: 'turn-end' });
|
|
102
|
+
await services.hookRunner.onEnd(context, { success: true });
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
processedInput = outcome.input;
|
|
106
|
+
}
|
|
107
|
+
// Persist user message
|
|
108
|
+
appendSessionMessage(session, { role: 'user', content: processedInput }, services.conversationState);
|
|
109
|
+
return {
|
|
110
|
+
session,
|
|
111
|
+
context,
|
|
112
|
+
processedInput,
|
|
113
|
+
injectionQueue,
|
|
114
|
+
controller,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function buildPolicyInjectionQueue(services) {
|
|
118
|
+
const queue = new InjectionQueue();
|
|
119
|
+
const profile = services.config.policyProfile ?? 'minimal';
|
|
120
|
+
queue.addBatch(getPolicyProfileInjections(profile));
|
|
121
|
+
if (services.config.policyInjections && services.config.policyInjections.length > 0) {
|
|
122
|
+
queue.addBatch(services.config.policyInjections);
|
|
123
|
+
}
|
|
124
|
+
return queue;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=IntakeStage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntakeStage.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/IntakeStage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAE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,IAAI,SAAS,CAAC;IAC3D,KAAK,CAAC,QAAQ,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,IAAI,QAAQ,CAAC,MAAM,CAAC,gBAAgB,IAAI,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpF,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostStreamStage -- Stage 5 of the turn pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Emit done event
|
|
6
|
+
* - Session checkpoint persistence (deferred with retry, or blocking)
|
|
7
|
+
* - Memory ingestion (blocking or fire-and-forget)
|
|
8
|
+
* - Abort controller cleanup
|
|
9
|
+
*/
|
|
10
|
+
import type { HarnessStreamPart, RunContext, Session } from '../../types/index.js';
|
|
11
|
+
import type { TurnServices } from './TurnServices.js';
|
|
12
|
+
/**
|
|
13
|
+
* Runs Stage 5: Post-Stream -- handles persistence and done event emission.
|
|
14
|
+
*
|
|
15
|
+
* Default behavior (deferPersistence !== false):
|
|
16
|
+
* 1. Emit 'done' immediately so the client sees completion
|
|
17
|
+
* 2. Clone the session and persist in the background with retry
|
|
18
|
+
* 3. On final failure, call onPersistenceError hook (if configured)
|
|
19
|
+
*
|
|
20
|
+
* Blocking behavior (deferPersistence === false):
|
|
21
|
+
* 1. Persist session synchronously
|
|
22
|
+
* 2. Run memory ingestion synchronously
|
|
23
|
+
* 3. Emit 'done' after everything is saved
|
|
24
|
+
*/
|
|
25
|
+
export declare function runPostStreamStage(context: RunContext, session: Session, services: TurnServices): AsyncGenerator<HarnessStreamPart>;
|
|
26
|
+
//# sourceMappingURL=PostStreamStage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostStreamStage.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/PostStreamStage.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,OAAO,EACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQtD;;;;;;;;;;;;GAYG;AACH,wBAAuB,kBAAkB,CACvC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,GACrB,cAAc,CAAC,iBAAiB,CAAC,CA8BnC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostStreamStage -- Stage 5 of the turn pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Responsibilities:
|
|
5
|
+
* - Emit done event
|
|
6
|
+
* - Session checkpoint persistence (deferred with retry, or blocking)
|
|
7
|
+
* - Memory ingestion (blocking or fire-and-forget)
|
|
8
|
+
* - Abort controller cleanup
|
|
9
|
+
*/
|
|
10
|
+
/** Maximum number of retry attempts for background persistence. */
|
|
11
|
+
const PERSIST_MAX_RETRIES = 3;
|
|
12
|
+
/** Base delay in milliseconds before the first retry (doubled each attempt). */
|
|
13
|
+
const PERSIST_BASE_DELAY_MS = 200;
|
|
14
|
+
/**
|
|
15
|
+
* Runs Stage 5: Post-Stream -- handles persistence and done event emission.
|
|
16
|
+
*
|
|
17
|
+
* Default behavior (deferPersistence !== false):
|
|
18
|
+
* 1. Emit 'done' immediately so the client sees completion
|
|
19
|
+
* 2. Clone the session and persist in the background with retry
|
|
20
|
+
* 3. On final failure, call onPersistenceError hook (if configured)
|
|
21
|
+
*
|
|
22
|
+
* Blocking behavior (deferPersistence === false):
|
|
23
|
+
* 1. Persist session synchronously
|
|
24
|
+
* 2. Run memory ingestion synchronously
|
|
25
|
+
* 3. Emit 'done' after everything is saved
|
|
26
|
+
*/
|
|
27
|
+
export async function* runPostStreamStage(context, session, services) {
|
|
28
|
+
// Default: true (deferred). Only block when explicitly set to false.
|
|
29
|
+
const shouldDefer = services.config.deferPersistence !== false;
|
|
30
|
+
if (shouldDefer) {
|
|
31
|
+
// Emit done FIRST -- user sees completion immediately
|
|
32
|
+
yield* services.streamEmitter.emit(context, {
|
|
33
|
+
type: 'done',
|
|
34
|
+
sessionId: session.id,
|
|
35
|
+
userId: session.userId,
|
|
36
|
+
});
|
|
37
|
+
// Background persistence with retry on a cloned snapshot
|
|
38
|
+
const sessionSnapshot = structuredClone(session);
|
|
39
|
+
const contextSnapshot = { ...context, session: sessionSnapshot };
|
|
40
|
+
runBackgroundPersistence(contextSnapshot, sessionSnapshot, services).catch(() => {
|
|
41
|
+
// Final error handling is inside runBackgroundPersistence.
|
|
42
|
+
// This catch prevents unhandled promise rejection.
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// Blocking: persist before done
|
|
47
|
+
await saveSessionCheckpoint(session, services);
|
|
48
|
+
await runMemoryIngestion(context, session, services);
|
|
49
|
+
yield* services.streamEmitter.emit(context, {
|
|
50
|
+
type: 'done',
|
|
51
|
+
sessionId: session.id,
|
|
52
|
+
userId: session.userId,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function saveSessionCheckpoint(session, services) {
|
|
57
|
+
await services.eventLog.checkpoint(session);
|
|
58
|
+
if (services.sessionCache) {
|
|
59
|
+
services.sessionCache.put(session);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Background persistence with exponential-backoff retry.
|
|
64
|
+
*
|
|
65
|
+
* Attempts to save the session up to PERSIST_MAX_RETRIES times.
|
|
66
|
+
* On final failure, invokes the onPersistenceError hook if configured,
|
|
67
|
+
* otherwise logs to console.error.
|
|
68
|
+
*/
|
|
69
|
+
async function runBackgroundPersistence(context, session, services) {
|
|
70
|
+
let lastError;
|
|
71
|
+
for (let attempt = 0; attempt < PERSIST_MAX_RETRIES; attempt++) {
|
|
72
|
+
try {
|
|
73
|
+
await saveSessionCheckpoint(session, services);
|
|
74
|
+
// Success -- proceed to memory ingestion
|
|
75
|
+
await runMemoryIngestion(context, session, services);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
lastError = err;
|
|
80
|
+
// Don't retry on the last attempt
|
|
81
|
+
if (attempt < PERSIST_MAX_RETRIES - 1) {
|
|
82
|
+
const delay = PERSIST_BASE_DELAY_MS * Math.pow(2, attempt);
|
|
83
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// All retries exhausted -- invoke the recovery hook or log
|
|
88
|
+
if (services.config.hooks?.onPersistenceError) {
|
|
89
|
+
try {
|
|
90
|
+
await services.config.hooks.onPersistenceError(session, lastError);
|
|
91
|
+
}
|
|
92
|
+
catch (hookErr) {
|
|
93
|
+
console.error('[AriaFlow] onPersistenceError hook threw:', hookErr);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
console.error(`[AriaFlow] Background persistence failed after ${PERSIST_MAX_RETRIES} attempts ` +
|
|
98
|
+
`for session ${session.id}:`, lastError);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Run memory ingestion if configured and applicable.
|
|
103
|
+
*/
|
|
104
|
+
async function runMemoryIngestion(context, session, services) {
|
|
105
|
+
if (!services.memoryService ||
|
|
106
|
+
!session.userId ||
|
|
107
|
+
services.config.memoryIngestion === 'manual') {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
let shouldIngest = true;
|
|
112
|
+
if (services.config.memoryIngestion === 'hook' &&
|
|
113
|
+
services.config.hooks?.onMemoryIngest) {
|
|
114
|
+
const hookResult = await services.config.hooks.onMemoryIngest(context, session);
|
|
115
|
+
if (hookResult === false)
|
|
116
|
+
shouldIngest = false;
|
|
117
|
+
}
|
|
118
|
+
if (shouldIngest) {
|
|
119
|
+
await services.memoryService.addSessionToMemory(session);
|
|
120
|
+
if (services.config.hooks?.onMemoryIngested) {
|
|
121
|
+
await services.config.hooks.onMemoryIngested(context, session);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
console.error('[AriaFlow] Memory ingestion failed:', err);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=PostStreamStage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostStreamStage.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/PostStreamStage.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,mEAAmE;AACnE,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,kBAAkB,CACvC,OAAmB,EACnB,OAAgB,EAChB,QAAsB;IAEtB,qEAAqE;IACrE,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,KAAK,KAAK,CAAC;IAE/D,IAAI,WAAW,EAAE,CAAC;QAChB,sDAAsD;QACtD,KAAK,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE;YAC1C,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QAEH,yDAAyD;QACzD,MAAM,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,eAAe,GAAG,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;QACjE,wBAAwB,CAAC,eAAe,EAAE,eAAe,EAAE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UAAU,KAAK,KAAK;gBAAE,YAAY,GAAG,KAAK,CAAC;QACjD,CAAC;QACD,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;YACzD,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC;gBAC5C,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 8: TurnPipeline — 5-stage pipeline architecture for Runtime.stream().
|
|
3
|
+
*
|
|
4
|
+
* Pipeline stages:
|
|
5
|
+
* 1. INTAKE — Session load, triage routing, input processors, user message
|
|
6
|
+
* 2. CONTEXT GATHER — autoRetrieve + extraction + memory + routes (parallel)
|
|
7
|
+
* 3. CONTEXT ASSEMBLE — System prompt + single context manager pass
|
|
8
|
+
* 4. AGENT EXECUTE — Routing, streamText / FlowManager, tool loop, handoffs
|
|
9
|
+
* 5. POST-STREAM — done event, persistence (blocking or deferred)
|
|
10
|
+
*
|
|
11
|
+
* Each stage is implemented in its own file. Runtime.ts delegates to these stages
|
|
12
|
+
* where possible, while maintaining backward compatibility.
|
|
13
|
+
*/
|
|
14
|
+
import type { AgentConfig, AgentRoute, ExtractionSnapshot, HarnessStreamPart, RunContext } from '../../types/index.js';
|
|
15
|
+
import type { InjectionQueue } from '../InjectionQueue.js';
|
|
16
|
+
/** Output of the context gather stage (Stage 2). */
|
|
17
|
+
export interface ContextGatherResult {
|
|
18
|
+
/** Events collected from autoRetrieve to emit after gather completes. */
|
|
19
|
+
autoRetrieveEvents: HarnessStreamPart[];
|
|
20
|
+
/** Auto-context for system prompt injection. */
|
|
21
|
+
autoContext?: {
|
|
22
|
+
label: string;
|
|
23
|
+
text: string;
|
|
24
|
+
};
|
|
25
|
+
/** Extraction snapshot for inclusion in system prompt. */
|
|
26
|
+
extractionSnapshot: ExtractionSnapshot | null;
|
|
27
|
+
/** Pre-fetched long-term memory context. */
|
|
28
|
+
preloadedMemory: string | null;
|
|
29
|
+
/** Active routes after condition evaluation (for triage agents). */
|
|
30
|
+
activeRoutes?: AgentRoute[];
|
|
31
|
+
}
|
|
32
|
+
/** Output of the context assemble stage (Stage 3). */
|
|
33
|
+
export interface ContextAssembleResult {
|
|
34
|
+
/** Fully assembled system prompt. */
|
|
35
|
+
systemPrompt: string;
|
|
36
|
+
}
|
|
37
|
+
/** Generic pipeline stage interface. */
|
|
38
|
+
export interface PipelineStage<TInput, TOutput> {
|
|
39
|
+
run(input: TInput): AsyncGenerator<HarnessStreamPart, TOutput>;
|
|
40
|
+
}
|
|
41
|
+
/** Configuration for a full turn pipeline execution. */
|
|
42
|
+
export interface TurnPipelineConfig {
|
|
43
|
+
/** Agent resolved for this turn. */
|
|
44
|
+
agent: AgentConfig;
|
|
45
|
+
/** Runtime context for this turn. */
|
|
46
|
+
context: RunContext;
|
|
47
|
+
/** User input after processing. */
|
|
48
|
+
input: string;
|
|
49
|
+
/** Policy injection queue for this turn. */
|
|
50
|
+
injectionQueue: InjectionQueue;
|
|
51
|
+
/** Abort signal for cancellation. */
|
|
52
|
+
abortSignal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=TurnPipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnPipeline.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/TurnPipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM3D,oDAAoD;AACpD,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,gDAAgD;IAChD,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,0DAA0D;IAC1D,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC9C,4CAA4C;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oEAAoE;IACpE,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;CAC7B;AAED,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wCAAwC;AACxC,MAAM,WAAW,aAAa,CAAC,MAAM,EAAE,OAAO;IAC5C,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;CAChE;AAED,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,KAAK,EAAE,WAAW,CAAC;IACnB,qCAAqC;IACrC,OAAO,EAAE,UAAU,CAAC;IACpB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,cAAc,EAAE,cAAc,CAAC;IAC/B,qCAAqC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 8: TurnPipeline — 5-stage pipeline architecture for Runtime.stream().
|
|
3
|
+
*
|
|
4
|
+
* Pipeline stages:
|
|
5
|
+
* 1. INTAKE — Session load, triage routing, input processors, user message
|
|
6
|
+
* 2. CONTEXT GATHER — autoRetrieve + extraction + memory + routes (parallel)
|
|
7
|
+
* 3. CONTEXT ASSEMBLE — System prompt + single context manager pass
|
|
8
|
+
* 4. AGENT EXECUTE — Routing, streamText / FlowManager, tool loop, handoffs
|
|
9
|
+
* 5. POST-STREAM — done event, persistence (blocking or deferred)
|
|
10
|
+
*
|
|
11
|
+
* Each stage is implemented in its own file. Runtime.ts delegates to these stages
|
|
12
|
+
* where possible, while maintaining backward compatibility.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=TurnPipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnPipeline.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/TurnPipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AgentConfig, HarnessConfig, InputProcessor, OutputProcessor, StopCondition } from '../../types/index.js';
|
|
2
|
+
import type { HookRunner } from '../../hooks/HookRunner.js';
|
|
3
|
+
import type { ContextManager } from '../ContextManager.js';
|
|
4
|
+
import type { ToolEnforcer } from '../../guards/ToolEnforcer.js';
|
|
5
|
+
import type { ExtractionEngine } from '../ExtractionEngine.js';
|
|
6
|
+
import type { MemoryService } from '../../memory/MemoryService.js';
|
|
7
|
+
import type { SessionStore } from '../../session/SessionStore.js';
|
|
8
|
+
import type { SessionCache } from '../SessionCache.js';
|
|
9
|
+
import type { StreamEmitter } from '../StreamEmitter.js';
|
|
10
|
+
import type { AgentStateController } from '../../foundation/AgentStateController.js';
|
|
11
|
+
import type { ConversationState } from '../../foundation/ConversationState.js';
|
|
12
|
+
import type { ConversationEventLog } from '../../foundation/ConversationEventLog.js';
|
|
13
|
+
import type { ToolExecutor } from '../../foundation/ToolExecutor.js';
|
|
14
|
+
import type { SuggestionManager } from '../SuggestionManager.js';
|
|
15
|
+
import type { FlowExecutor } from '../FlowExecutor.js';
|
|
16
|
+
export interface TurnServices {
|
|
17
|
+
readonly conversationState: ConversationState;
|
|
18
|
+
readonly agentStateController: AgentStateController;
|
|
19
|
+
readonly eventLog: ConversationEventLog;
|
|
20
|
+
readonly toolExecutor: ToolExecutor;
|
|
21
|
+
readonly streamEmitter: StreamEmitter;
|
|
22
|
+
readonly hookRunner: HookRunner;
|
|
23
|
+
readonly enforcer: ToolEnforcer;
|
|
24
|
+
readonly extractionEngine: ExtractionEngine;
|
|
25
|
+
readonly suggestionManager: SuggestionManager;
|
|
26
|
+
readonly flowExecutor: FlowExecutor;
|
|
27
|
+
readonly contextManager: ContextManager | undefined;
|
|
28
|
+
readonly memoryService: MemoryService | undefined;
|
|
29
|
+
readonly sessionCache: SessionCache | undefined;
|
|
30
|
+
readonly sessionStore: SessionStore;
|
|
31
|
+
readonly agents: ReadonlyMap<string, AgentConfig>;
|
|
32
|
+
readonly config: HarnessConfig;
|
|
33
|
+
readonly defaultAgentId: string;
|
|
34
|
+
readonly defaultModel: HarnessConfig['defaultModel'];
|
|
35
|
+
readonly maxSteps: number;
|
|
36
|
+
readonly maxHandoffs: number;
|
|
37
|
+
readonly stopConditions: StopCondition[];
|
|
38
|
+
readonly inputProcessors: InputProcessor[];
|
|
39
|
+
readonly outputProcessors: OutputProcessor[];
|
|
40
|
+
readonly outputProcessorMode: string;
|
|
41
|
+
readonly outputRedactions?: Array<{
|
|
42
|
+
re: RegExp;
|
|
43
|
+
replacement: string;
|
|
44
|
+
}>;
|
|
45
|
+
readonly alwaysRouteThroughTriage: boolean;
|
|
46
|
+
readonly triageAgentId?: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=TurnServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnServices.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/TurnServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EAEX,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,EAEd,MAAM,sBAAsB,CAAC;AAC9B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iBAAiB,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,cAAc,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAGpC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAGlD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,EAAE,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;IAC3C,QAAQ,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnServices.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/TurnServices.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentConfig, FlowAgentConfig, TriageAgentConfig } from '../../types/index.js';
|
|
2
|
+
export declare function isFlowAgent(agent: AgentConfig): agent is FlowAgentConfig;
|
|
3
|
+
export declare function isTriageAgent(agent: AgentConfig): agent is TriageAgentConfig;
|
|
4
|
+
//# sourceMappingURL=agentTypeGuards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentTypeGuards.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/agentTypeGuards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,IAAI,eAAe,CAExE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,IAAI,iBAAiB,CAE5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentTypeGuards.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/agentTypeGuards.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,KAAkB;IAC5C,OAAQ,KAAyB,CAAC,IAAI,KAAK,MAAM,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAkB;IAC9C,OAAQ,KAA2B,CAAC,IAAI,KAAK,QAAQ,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { ContextGatherResult, ContextAssembleResult, PipelineStage, TurnPipelineConfig, } from './TurnPipeline.js';
|
|
2
|
+
export type { TurnServices } from './TurnServices.js';
|
|
3
|
+
export { isFlowAgent, isTriageAgent } from './agentTypeGuards.js';
|
|
4
|
+
export { getFlowState, setFlowState, clearFlowState, updateFlowStateSnapshot, normalizeSessionHistory, appendSessionMessage, appendSessionMessages, buildAgentContext, } from './sessionUtils.js';
|
|
5
|
+
export { runOutputProcessing, postProcessPersistedAssistantMessages, getAgentOutputProcessors, buildProcessorContext, } from './outputProcessing.js';
|
|
6
|
+
export { runIntakeStage, type IntakeResult } from './IntakeStage.js';
|
|
7
|
+
export { runContextGatherStage, emitGatherEvents } from './ContextGatherStage.js';
|
|
8
|
+
export { runContextAssembleStage, buildStructuredTriagePrompt, type ContextAssembleInput } from './ContextAssembleStage.js';
|
|
9
|
+
export { runAgentExecuteStage, type AgentExecuteInput } from './AgentExecuteStage.js';
|
|
10
|
+
export { runPostStreamStage } from './PostStreamStage.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,mBAAmB,EACnB,qCAAqC,EACrC,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC5H,OAAO,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Type guards
|
|
2
|
+
export { isFlowAgent, isTriageAgent } from './agentTypeGuards.js';
|
|
3
|
+
// Session utilities
|
|
4
|
+
export { getFlowState, setFlowState, clearFlowState, updateFlowStateSnapshot, normalizeSessionHistory, appendSessionMessage, appendSessionMessages, buildAgentContext, } from './sessionUtils.js';
|
|
5
|
+
// Output processing
|
|
6
|
+
export { runOutputProcessing, postProcessPersistedAssistantMessages, getAgentOutputProcessors, buildProcessorContext, } from './outputProcessing.js';
|
|
7
|
+
// Stage implementations
|
|
8
|
+
export { runIntakeStage } from './IntakeStage.js';
|
|
9
|
+
export { runContextGatherStage, emitGatherEvents } from './ContextGatherStage.js';
|
|
10
|
+
export { runContextAssembleStage, buildStructuredTriagePrompt } from './ContextAssembleStage.js';
|
|
11
|
+
export { runAgentExecuteStage } from './AgentExecuteStage.js';
|
|
12
|
+
export { runPostStreamStage } from './PostStreamStage.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/index.ts"],"names":[],"mappings":"AAWA,cAAc;AACd,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAElE,oBAAoB;AACpB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,oBAAoB;AACpB,OAAO,EACL,mBAAmB,EACnB,qCAAqC,EACrC,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAE/B,wBAAwB;AACxB,OAAO,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAA6B,MAAM,2BAA2B,CAAC;AAC5H,OAAO,EAAE,oBAAoB,EAA0B,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AgentConfig, OutputProcessor, ProcessorContext, RunContext } from '../../types/index.js';
|
|
2
|
+
export declare function getAgentOutputProcessors(agent: AgentConfig, globalProcessors: OutputProcessor[]): OutputProcessor[];
|
|
3
|
+
export declare function buildProcessorContext(context: RunContext, abortSignal?: AbortSignal): ProcessorContext;
|
|
4
|
+
export declare function runOutputProcessing(agent: AgentConfig, context: RunContext, text: string, globalProcessors: OutputProcessor[], outputRedactions: Array<{
|
|
5
|
+
re: RegExp;
|
|
6
|
+
replacement: string;
|
|
7
|
+
}> | undefined, getAbortSignal?: () => AbortSignal | undefined): Promise<{
|
|
8
|
+
text: string;
|
|
9
|
+
tripwire?: {
|
|
10
|
+
processorId: string;
|
|
11
|
+
reason: string;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
}>;
|
|
15
|
+
export declare function postProcessPersistedAssistantMessages(agent: AgentConfig, context: RunContext, startIndex: number, globalProcessors: OutputProcessor[], outputRedactions: Array<{
|
|
16
|
+
re: RegExp;
|
|
17
|
+
replacement: string;
|
|
18
|
+
}> | undefined, getAbortSignal?: () => AbortSignal | undefined): Promise<Array<{
|
|
19
|
+
processorId: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}>>;
|
|
23
|
+
//# sourceMappingURL=outputProcessing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputProcessing.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/outputProcessing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,UAAU,EACX,MAAM,sBAAsB,CAAC;AAG9B,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,WAAW,EAClB,gBAAgB,EAAE,eAAe,EAAE,GAClC,eAAe,EAAE,CAKnB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,UAAU,EACnB,WAAW,CAAC,EAAE,WAAW,GACxB,gBAAgB,CAOlB;AAED,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,eAAe,EAAE,EACnC,gBAAgB,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,EACxE,cAAc,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,GAC7C,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,CAsBhG;AAED,wBAAsB,qCAAqC,CACzD,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,eAAe,EAAE,EACnC,gBAAgB,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,EACxE,cAAc,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,GAC7C,OAAO,CAAC,KAAK,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAa1E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { runOutputProcessors } from '../../processors/ProcessorRunner.js';
|
|
2
|
+
export function getAgentOutputProcessors(agent, globalProcessors) {
|
|
3
|
+
return [
|
|
4
|
+
...globalProcessors,
|
|
5
|
+
...(agent.outputProcessors ?? []),
|
|
6
|
+
];
|
|
7
|
+
}
|
|
8
|
+
export function buildProcessorContext(context, abortSignal) {
|
|
9
|
+
return {
|
|
10
|
+
session: context.session,
|
|
11
|
+
agentId: context.agentId,
|
|
12
|
+
toolCallHistory: context.toolCallHistory,
|
|
13
|
+
abortSignal,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export async function runOutputProcessing(agent, context, text, globalProcessors, outputRedactions, getAbortSignal) {
|
|
17
|
+
const processors = getAgentOutputProcessors(agent, globalProcessors);
|
|
18
|
+
let cur = text;
|
|
19
|
+
if (processors.length > 0) {
|
|
20
|
+
const abortSignal = getAbortSignal?.();
|
|
21
|
+
const outcome = await runOutputProcessors({
|
|
22
|
+
processors,
|
|
23
|
+
text: cur,
|
|
24
|
+
messages: context.session.messages,
|
|
25
|
+
context: buildProcessorContext(context, abortSignal),
|
|
26
|
+
});
|
|
27
|
+
if (outcome.blocked) {
|
|
28
|
+
const msg = applyRedactionsToText(outcome.message, outputRedactions);
|
|
29
|
+
return {
|
|
30
|
+
text: msg,
|
|
31
|
+
tripwire: { processorId: outcome.processorId, reason: outcome.reason, message: msg },
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
cur = outcome.text;
|
|
35
|
+
}
|
|
36
|
+
cur = applyRedactionsToText(cur, outputRedactions);
|
|
37
|
+
return { text: cur };
|
|
38
|
+
}
|
|
39
|
+
export async function postProcessPersistedAssistantMessages(agent, context, startIndex, globalProcessors, outputRedactions, getAbortSignal) {
|
|
40
|
+
const tripwires = [];
|
|
41
|
+
const msgs = context.session.messages;
|
|
42
|
+
for (let i = startIndex; i < msgs.length; i++) {
|
|
43
|
+
const m = msgs[i];
|
|
44
|
+
if (!m || m.role !== 'assistant' || typeof m.content !== 'string')
|
|
45
|
+
continue;
|
|
46
|
+
const res = await runOutputProcessing(agent, context, m.content, globalProcessors, outputRedactions, getAbortSignal);
|
|
47
|
+
msgs[i] = { ...m, content: res.text };
|
|
48
|
+
if (res.tripwire) {
|
|
49
|
+
tripwires.push(res.tripwire);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return tripwires;
|
|
53
|
+
}
|
|
54
|
+
function applyRedactionsToText(text, outputRedactions) {
|
|
55
|
+
if (!outputRedactions || outputRedactions.length === 0)
|
|
56
|
+
return text;
|
|
57
|
+
let out = text;
|
|
58
|
+
for (const r of outputRedactions) {
|
|
59
|
+
out = out.replace(r.re, r.replacement);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=outputProcessing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputProcessing.js","sourceRoot":"","sources":["../../../src/runtime/pipeline/outputProcessing.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,MAAM,UAAU,wBAAwB,CACtC,KAAkB,EAClB,gBAAmC;IAEnC,OAAO;QACL,GAAG,gBAAgB;QACnB,GAAG,CAAC,KAAK,CAAC,gBAAgB,IAAI,EAAE,CAAC;KAClC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,OAAmB,EACnB,WAAyB;IAEzB,OAAO;QACL,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,WAAW;KACZ,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAkB,EAClB,OAAmB,EACnB,IAAY,EACZ,gBAAmC,EACnC,gBAAwE,EACxE,cAA8C;IAE9C,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACrE,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,IAAI,UAAU,CAAC,MAAM,GAAG,CA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AAE,SAAS;QAC5E,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;QACrH,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YACjB,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,qBAAqB,CAC5B,IAAY,EACZ,gBAAwE;IAExE,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpE,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,MAAM,CAAC,IAAI,gBAAgB,EAAE,CAAC;QACjC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ModelMessage } from 'ai';
|
|
2
|
+
import type { AgentContext, FlowManagerState, RunContext, Session } from '../../types/index.js';
|
|
3
|
+
import type { ConversationState } from '../../foundation/ConversationState.js';
|
|
4
|
+
export declare function getFlowState(session: Session, agentId: string): FlowManagerState | undefined;
|
|
5
|
+
export declare function setFlowState(session: Session, agentId: string, state: FlowManagerState, conversationState: ConversationState): void;
|
|
6
|
+
export declare function clearFlowState(session: Session, agentId: string, conversationState: ConversationState): void;
|
|
7
|
+
export declare function updateFlowStateSnapshot(session: Session, agentId: string, state: FlowManagerState): void;
|
|
8
|
+
export declare function normalizeSessionHistory(messages: ModelMessage[]): ModelMessage[];
|
|
9
|
+
export declare function appendSessionMessage(session: Session, message: ModelMessage, conversationState: ConversationState): void;
|
|
10
|
+
export declare function appendSessionMessages(session: Session, messages: ModelMessage[], conversationState: ConversationState): void;
|
|
11
|
+
export declare function buildAgentContext(input: string, context: RunContext, conversationState: ConversationState, abortSignal?: AbortSignal): AgentContext;
|
|
12
|
+
//# sourceMappingURL=sessionUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionUtils.d.ts","sourceRoot":"","sources":["../../../src/runtime/pipeline/sessionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,KAAK,EAEV,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,OAAO,EACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAI/E,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAI5F;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,gBAAgB,EACvB,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAQN;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAGN;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,gBAAgB,GACtB,IAAI,CAiBN;AAMD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAShF;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,YAAY,EACrB,iBAAiB,EAAE,iBAAiB,GACnC,IA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