agentfootprint 2.14.5 → 3.1.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 +1 -1
- package/dist/cache/CacheDecisionSubflow.js +13 -16
- package/dist/cache/CacheDecisionSubflow.js.map +1 -1
- package/dist/cache/CacheGateDecider.js +18 -3
- package/dist/cache/CacheGateDecider.js.map +1 -1
- package/dist/cache/cacheRecorder.js +12 -3
- package/dist/cache/cacheRecorder.js.map +1 -1
- package/dist/conventions.js +155 -4
- package/dist/conventions.js.map +1 -1
- package/dist/core/Agent.js +115 -32
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/LLMCall.js +213 -41
- package/dist/core/LLMCall.js.map +1 -1
- package/dist/core/RunnerBase.js +187 -0
- package/dist/core/RunnerBase.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +127 -48
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildAgentMessageApiChart.js +201 -0
- package/dist/core/agent/buildAgentMessageApiChart.js.map +1 -0
- package/dist/core/agent/buildCacheSubflow.js +62 -0
- package/dist/core/agent/buildCacheSubflow.js.map +1 -0
- package/dist/core/agent/buildDynamicAgentChart.js +364 -0
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -0
- package/dist/core/agent/buildMessageApiChart.js +154 -0
- package/dist/core/agent/buildMessageApiChart.js.map +1 -0
- package/dist/core/agent/stages/callLLM.js +11 -0
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/reliabilityExecution.js +64 -9
- package/dist/core/agent/stages/reliabilityExecution.js.map +1 -1
- package/dist/core/humanizeLLMError.js +66 -0
- package/dist/core/humanizeLLMError.js.map +1 -0
- package/dist/core/runner.js +4 -3
- package/dist/core/runner.js.map +1 -1
- package/dist/core/slots/buildMessagesSlot.js +2 -2
- package/dist/core/slots/buildMessagesSlot.js.map +1 -1
- package/dist/core/slots/buildSystemPromptSlot.js +1 -1
- package/dist/core/slots/buildSystemPromptSlot.js.map +1 -1
- package/dist/core/slots/buildThinkingSubflow.js +1 -1
- package/dist/core/slots/buildThinkingSubflow.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +3 -1
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/core/translator.js +32 -0
- package/dist/core/translator.js.map +1 -0
- package/dist/core-flow/Conditional.js +72 -10
- package/dist/core-flow/Conditional.js.map +1 -1
- package/dist/core-flow/Loop.js +59 -16
- package/dist/core-flow/Loop.js.map +1 -1
- package/dist/core-flow/Parallel.js +239 -92
- package/dist/core-flow/Parallel.js.map +1 -1
- package/dist/core-flow/Sequence.js +50 -8
- package/dist/core-flow/Sequence.js.map +1 -1
- package/dist/esm/cache/CacheDecisionSubflow.js +11 -15
- package/dist/esm/cache/CacheDecisionSubflow.js.map +1 -1
- package/dist/esm/cache/CacheGateDecider.js +18 -3
- package/dist/esm/cache/CacheGateDecider.js.map +1 -1
- package/dist/esm/cache/cacheRecorder.js +12 -3
- package/dist/esm/cache/cacheRecorder.js.map +1 -1
- package/dist/esm/conventions.js +151 -3
- package/dist/esm/conventions.js.map +1 -1
- package/dist/esm/core/Agent.js +116 -33
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/LLMCall.js +213 -41
- package/dist/esm/core/LLMCall.js.map +1 -1
- package/dist/esm/core/RunnerBase.js +187 -0
- package/dist/esm/core/RunnerBase.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.js +128 -49
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildAgentMessageApiChart.js +197 -0
- package/dist/esm/core/agent/buildAgentMessageApiChart.js.map +1 -0
- package/dist/esm/core/agent/buildCacheSubflow.js +58 -0
- package/dist/esm/core/agent/buildCacheSubflow.js.map +1 -0
- package/dist/esm/core/agent/buildDynamicAgentChart.js +360 -0
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -0
- package/dist/esm/core/agent/buildMessageApiChart.js +150 -0
- package/dist/esm/core/agent/buildMessageApiChart.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM.js +11 -0
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/reliabilityExecution.js +64 -9
- package/dist/esm/core/agent/stages/reliabilityExecution.js.map +1 -1
- package/dist/esm/core/humanizeLLMError.js +61 -0
- package/dist/esm/core/humanizeLLMError.js.map +1 -0
- package/dist/esm/core/runner.js +4 -3
- package/dist/esm/core/runner.js.map +1 -1
- package/dist/esm/core/slots/buildMessagesSlot.js +2 -2
- package/dist/esm/core/slots/buildMessagesSlot.js.map +1 -1
- package/dist/esm/core/slots/buildSystemPromptSlot.js +1 -1
- package/dist/esm/core/slots/buildSystemPromptSlot.js.map +1 -1
- package/dist/esm/core/slots/buildThinkingSubflow.js +1 -1
- package/dist/esm/core/slots/buildThinkingSubflow.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.js +3 -1
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/core/translator.js +31 -0
- package/dist/esm/core/translator.js.map +1 -0
- package/dist/esm/core-flow/Conditional.js +72 -10
- package/dist/esm/core-flow/Conditional.js.map +1 -1
- package/dist/esm/core-flow/Loop.js +59 -16
- package/dist/esm/core-flow/Loop.js.map +1 -1
- package/dist/esm/core-flow/Parallel.js +240 -93
- package/dist/esm/core-flow/Parallel.js.map +1 -1
- package/dist/esm/core-flow/Sequence.js +50 -8
- package/dist/esm/core-flow/Sequence.js.map +1 -1
- package/dist/esm/events/registry.js +10 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.js +22 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +16 -9
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/esm/memory/causal/snapshotPipeline.js +6 -2
- package/dist/esm/memory/causal/snapshotPipeline.js.map +1 -1
- package/dist/esm/memory/pipeline/auto.js +2 -2
- package/dist/esm/memory/pipeline/auto.js.map +1 -1
- package/dist/esm/memory/pipeline/default.js +4 -2
- package/dist/esm/memory/pipeline/default.js.map +1 -1
- package/dist/esm/memory/pipeline/ephemeral.js +3 -1
- package/dist/esm/memory/pipeline/ephemeral.js.map +1 -1
- package/dist/esm/memory/pipeline/fact.js +4 -2
- package/dist/esm/memory/pipeline/fact.js.map +1 -1
- package/dist/esm/memory/pipeline/narrative.js +4 -2
- package/dist/esm/memory/pipeline/narrative.js.map +1 -1
- package/dist/esm/memory/pipeline/semantic.js +2 -2
- package/dist/esm/memory/pipeline/semantic.js.map +1 -1
- package/dist/esm/observe.js +1 -1
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/patterns/MapReduce.js +5 -5
- package/dist/esm/patterns/MapReduce.js.map +1 -1
- package/dist/esm/patterns/Swarm.js +1 -1
- package/dist/esm/patterns/Swarm.js.map +1 -1
- package/dist/esm/recorders/core/ContextEvaluatedRecorder.js +31 -0
- package/dist/esm/recorders/core/ContextEvaluatedRecorder.js.map +1 -0
- package/dist/esm/recorders/core/ContextRecorder.js +12 -14
- package/dist/esm/recorders/core/ContextRecorder.js.map +1 -1
- package/dist/esm/recorders/core/ErrorBridge.js +59 -0
- package/dist/esm/recorders/core/ErrorBridge.js.map +1 -0
- package/dist/esm/recorders/core/ReliabilityRecorder.js +29 -0
- package/dist/esm/recorders/core/ReliabilityRecorder.js.map +1 -0
- package/dist/esm/recorders/observability/BoundaryRecorder.js +338 -36
- package/dist/esm/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/FlowchartRecorder.js +10 -0
- package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/LiveStateRecorder.js +120 -21
- package/dist/esm/recorders/observability/LiveStateRecorder.js.map +1 -1
- package/dist/esm/recorders/observability/RunStepRecorder.js +652 -0
- package/dist/esm/recorders/observability/RunStepRecorder.js.map +1 -0
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.js +1 -0
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
- package/dist/esm/recorders/observability/internal/ActorArrowClassifier.js +34 -0
- package/dist/esm/recorders/observability/internal/ActorArrowClassifier.js.map +1 -0
- package/dist/esm/recorders/observability/internal/CandidateAnswerBuffer.js +32 -0
- package/dist/esm/recorders/observability/internal/CandidateAnswerBuffer.js.map +1 -0
- package/dist/esm/recorders/observability/internal/ForkTracker.js +84 -0
- package/dist/esm/recorders/observability/internal/ForkTracker.js.map +1 -0
- package/dist/esm/recorders/observability/internal/RootInferrer.js +114 -0
- package/dist/esm/recorders/observability/internal/RootInferrer.js.map +1 -0
- package/dist/esm/recorders/observability/internal/SequenceSiblingTracker.js +31 -0
- package/dist/esm/recorders/observability/internal/SequenceSiblingTracker.js.map +1 -0
- package/dist/esm/recorders/observability/observeRunId.js +21 -0
- package/dist/esm/recorders/observability/observeRunId.js.map +1 -0
- package/dist/esm/reliability/buildReliabilityGateChart.js +11 -5
- package/dist/esm/reliability/buildReliabilityGateChart.js.map +1 -1
- package/dist/events/registry.js +10 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +16 -9
- package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/memory/causal/snapshotPipeline.js +6 -2
- package/dist/memory/causal/snapshotPipeline.js.map +1 -1
- package/dist/memory/pipeline/auto.js +2 -2
- package/dist/memory/pipeline/auto.js.map +1 -1
- package/dist/memory/pipeline/default.js +4 -2
- package/dist/memory/pipeline/default.js.map +1 -1
- package/dist/memory/pipeline/ephemeral.js +3 -1
- package/dist/memory/pipeline/ephemeral.js.map +1 -1
- package/dist/memory/pipeline/fact.js +4 -2
- package/dist/memory/pipeline/fact.js.map +1 -1
- package/dist/memory/pipeline/narrative.js +4 -2
- package/dist/memory/pipeline/narrative.js.map +1 -1
- package/dist/memory/pipeline/semantic.js +2 -2
- package/dist/memory/pipeline/semantic.js.map +1 -1
- package/dist/observe.js +1 -1
- package/dist/observe.js.map +1 -1
- package/dist/patterns/MapReduce.js +5 -5
- package/dist/patterns/MapReduce.js.map +1 -1
- package/dist/patterns/Swarm.js +1 -1
- package/dist/patterns/Swarm.js.map +1 -1
- package/dist/recorders/core/ContextEvaluatedRecorder.js +35 -0
- package/dist/recorders/core/ContextEvaluatedRecorder.js.map +1 -0
- package/dist/recorders/core/ContextRecorder.js +11 -13
- package/dist/recorders/core/ContextRecorder.js.map +1 -1
- package/dist/recorders/core/ErrorBridge.js +64 -0
- package/dist/recorders/core/ErrorBridge.js.map +1 -0
- package/dist/recorders/core/ReliabilityRecorder.js +33 -0
- package/dist/recorders/core/ReliabilityRecorder.js.map +1 -0
- package/dist/recorders/observability/BoundaryRecorder.js +337 -35
- package/dist/recorders/observability/BoundaryRecorder.js.map +1 -1
- package/dist/recorders/observability/FlowchartRecorder.js +10 -0
- package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
- package/dist/recorders/observability/LiveStateRecorder.js +119 -20
- package/dist/recorders/observability/LiveStateRecorder.js.map +1 -1
- package/dist/recorders/observability/RunStepRecorder.js +658 -0
- package/dist/recorders/observability/RunStepRecorder.js.map +1 -0
- package/dist/recorders/observability/commentary/commentaryTemplates.js +1 -0
- package/dist/recorders/observability/commentary/commentaryTemplates.js.map +1 -1
- package/dist/recorders/observability/internal/ActorArrowClassifier.js +38 -0
- package/dist/recorders/observability/internal/ActorArrowClassifier.js.map +1 -0
- package/dist/recorders/observability/internal/CandidateAnswerBuffer.js +36 -0
- package/dist/recorders/observability/internal/CandidateAnswerBuffer.js.map +1 -0
- package/dist/recorders/observability/internal/ForkTracker.js +88 -0
- package/dist/recorders/observability/internal/ForkTracker.js.map +1 -0
- package/dist/recorders/observability/internal/RootInferrer.js +118 -0
- package/dist/recorders/observability/internal/RootInferrer.js.map +1 -0
- package/dist/recorders/observability/internal/SequenceSiblingTracker.js +35 -0
- package/dist/recorders/observability/internal/SequenceSiblingTracker.js.map +1 -0
- package/dist/recorders/observability/observeRunId.js +25 -0
- package/dist/recorders/observability/observeRunId.js.map +1 -0
- package/dist/reliability/buildReliabilityGateChart.js +11 -5
- package/dist/reliability/buildReliabilityGateChart.js.map +1 -1
- package/dist/types/cache/CacheDecisionSubflow.d.ts +7 -10
- package/dist/types/cache/CacheDecisionSubflow.d.ts.map +1 -1
- package/dist/types/cache/CacheGateDecider.d.ts +16 -2
- package/dist/types/cache/CacheGateDecider.d.ts.map +1 -1
- package/dist/types/cache/cacheRecorder.d.ts.map +1 -1
- package/dist/types/conventions.d.ts +101 -1
- package/dist/types/conventions.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +28 -18
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/LLMCall.d.ts +73 -11
- package/dist/types/core/LLMCall.d.ts.map +1 -1
- package/dist/types/core/RunnerBase.d.ts +136 -4
- package/dist/types/core/RunnerBase.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +38 -19
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentMessageApiChart.d.ts +41 -0
- package/dist/types/core/agent/buildAgentMessageApiChart.d.ts.map +1 -0
- package/dist/types/core/agent/buildCacheSubflow.d.ts +36 -0
- package/dist/types/core/agent/buildCacheSubflow.d.ts.map +1 -0
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts +57 -0
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -0
- package/dist/types/core/agent/buildMessageApiChart.d.ts +48 -0
- package/dist/types/core/agent/buildMessageApiChart.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/agent/stages/reliabilityExecution.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +96 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/humanizeLLMError.d.ts +24 -0
- package/dist/types/core/humanizeLLMError.d.ts.map +1 -0
- package/dist/types/core/runner.d.ts +51 -5
- package/dist/types/core/runner.d.ts.map +1 -1
- package/dist/types/core/slots/buildMessagesSlot.d.ts.map +1 -1
- package/dist/types/core/slots/buildSystemPromptSlot.d.ts.map +1 -1
- package/dist/types/core/slots/buildThinkingSubflow.d.ts.map +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/core/translator.d.ts +95 -0
- package/dist/types/core/translator.d.ts.map +1 -0
- package/dist/types/core-flow/Conditional.d.ts +48 -4
- package/dist/types/core-flow/Conditional.d.ts.map +1 -1
- package/dist/types/core-flow/Loop.d.ts +42 -3
- package/dist/types/core-flow/Loop.d.ts.map +1 -1
- package/dist/types/core-flow/Parallel.d.ts +99 -4
- package/dist/types/core-flow/Parallel.d.ts.map +1 -1
- package/dist/types/core-flow/Sequence.d.ts +49 -3
- package/dist/types/core-flow/Sequence.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +99 -1
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +11 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
- package/dist/types/memory/causal/snapshotPipeline.d.ts.map +1 -1
- package/dist/types/memory/pipeline/auto.d.ts.map +1 -1
- package/dist/types/memory/pipeline/default.d.ts.map +1 -1
- package/dist/types/memory/pipeline/ephemeral.d.ts.map +1 -1
- package/dist/types/memory/pipeline/fact.d.ts.map +1 -1
- package/dist/types/memory/pipeline/narrative.d.ts.map +1 -1
- package/dist/types/memory/pipeline/semantic.d.ts.map +1 -1
- package/dist/types/observe.d.ts +2 -2
- package/dist/types/observe.d.ts.map +1 -1
- package/dist/types/recorders/core/ContextEvaluatedRecorder.d.ts +24 -0
- package/dist/types/recorders/core/ContextEvaluatedRecorder.d.ts.map +1 -0
- package/dist/types/recorders/core/ContextRecorder.d.ts +0 -2
- package/dist/types/recorders/core/ContextRecorder.d.ts.map +1 -1
- package/dist/types/recorders/core/ErrorBridge.d.ts +39 -0
- package/dist/types/recorders/core/ErrorBridge.d.ts.map +1 -0
- package/dist/types/recorders/core/ReliabilityRecorder.d.ts +25 -0
- package/dist/types/recorders/core/ReliabilityRecorder.d.ts.map +1 -0
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts +167 -6
- package/dist/types/recorders/observability/BoundaryRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/LiveStateRecorder.d.ts +42 -6
- package/dist/types/recorders/observability/LiveStateRecorder.d.ts.map +1 -1
- package/dist/types/recorders/observability/RunStepRecorder.d.ts +232 -0
- package/dist/types/recorders/observability/RunStepRecorder.d.ts.map +1 -0
- package/dist/types/recorders/observability/commentary/commentaryTemplates.d.ts.map +1 -1
- package/dist/types/recorders/observability/internal/ActorArrowClassifier.d.ts +26 -0
- package/dist/types/recorders/observability/internal/ActorArrowClassifier.d.ts.map +1 -0
- package/dist/types/recorders/observability/internal/CandidateAnswerBuffer.d.ts +29 -0
- package/dist/types/recorders/observability/internal/CandidateAnswerBuffer.d.ts.map +1 -0
- package/dist/types/recorders/observability/internal/ForkTracker.d.ts +61 -0
- package/dist/types/recorders/observability/internal/ForkTracker.d.ts.map +1 -0
- package/dist/types/recorders/observability/internal/RootInferrer.d.ts +52 -0
- package/dist/types/recorders/observability/internal/RootInferrer.d.ts.map +1 -0
- package/dist/types/recorders/observability/internal/SequenceSiblingTracker.d.ts +25 -0
- package/dist/types/recorders/observability/internal/SequenceSiblingTracker.d.ts.map +1 -0
- package/dist/types/recorders/observability/observeRunId.d.ts +37 -0
- package/dist/types/recorders/observability/observeRunId.d.ts.map +1 -0
- package/dist/types/reliability/buildReliabilityGateChart.d.ts.map +1 -1
- package/package.json +6 -5
- package/dist/core/agent/stages/iterationStart.js +0 -24
- package/dist/core/agent/stages/iterationStart.js.map +0 -1
- package/dist/esm/core/agent/stages/iterationStart.js +0 -20
- package/dist/esm/core/agent/stages/iterationStart.js.map +0 -1
- package/dist/types/core/agent/stages/iterationStart.d.ts +0 -16
- package/dist/types/core/agent/stages/iterationStart.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheGateDecider.d.ts","sourceRoot":"","sources":["../../../src/cache/CacheGateDecider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAU,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;CACxD;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EACxC,UAAU,GAAE,MAA2B,EACvC,SAAS,GAAE,MAA8B,GACxC,OAAO,CAQT;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,YAAY,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,GAAG,cAAc,CAsBjF;AAED
|
|
1
|
+
{"version":3,"file":"CacheGateDec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file":"cacheRecorder.d.ts","sourceRoot":"","sources":["../../../src/cache/cacheRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cacheRecorder.d.ts","sourceRoot":"","sources":["../../../src/cache/cacheRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKpD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,UAAU,YAAY;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,YAAY,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;CACxC;AAED,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;IAChD,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;;OAIG;IACH,MAAM,IAAI,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CAqGrF"}
|
|
@@ -15,6 +15,10 @@ export declare const SUBFLOW_IDS: {
|
|
|
15
15
|
/** Injection Engine subflow. Evaluates every Injection's trigger
|
|
16
16
|
* and writes activeInjections[] for the slot subflows to consume. */
|
|
17
17
|
readonly INJECTION_ENGINE: "sf-injection-engine";
|
|
18
|
+
/** Inner subflow inside LLMCall that wraps the invocation
|
|
19
|
+
* (seed + slots + call-llm + optional thinking + extract-final).
|
|
20
|
+
* Mounted by LLMCall's outer `client` chart. */
|
|
21
|
+
readonly LLM_CALL: "sf-llm-call";
|
|
18
22
|
/** System-prompt slot subflow. Observed by ContextRecorder. */
|
|
19
23
|
readonly SYSTEM_PROMPT: "sf-system-prompt";
|
|
20
24
|
/** Messages slot subflow. */
|
|
@@ -33,8 +37,18 @@ export declare const SUBFLOW_IDS: {
|
|
|
33
37
|
* decider returns `'final'` as a routing value AND the same string
|
|
34
38
|
* becomes the subflow's id. */
|
|
35
39
|
readonly FINAL: "final";
|
|
40
|
+
/** Cache subflow (v2.14). Wraps the whole per-turn cache machinery —
|
|
41
|
+
* decide markers → CacheGate decider → apply/skip — as ONE collapsible
|
|
42
|
+
* boundary in the chart. Provider-independent decision layer; the
|
|
43
|
+
* attached provider's CacheStrategy turns markers into wire format.
|
|
44
|
+
* UpdateSkillHistory stays OUTSIDE (in the main loop) so the rolling
|
|
45
|
+
* skillHistory window persists across iterations without round-tripping
|
|
46
|
+
* through this subflow. */
|
|
47
|
+
readonly CACHE: "sf-cache";
|
|
36
48
|
/** Cache decision subflow (v2.6). Walks activeInjections, emits
|
|
37
|
-
* agnostic CacheMarker[]. Provider-independent.
|
|
49
|
+
* agnostic CacheMarker[]. Provider-independent. Standalone building
|
|
50
|
+
* block; the agent now uses the `decideCacheMarkers` stage inside
|
|
51
|
+
* `sf-cache` instead of mounting this directly. */
|
|
38
52
|
readonly CACHE_DECISION: "sf-cache-decision";
|
|
39
53
|
/** Thinking-normalization mount (v2.14). Wraps the consumer's
|
|
40
54
|
* ThinkingHandler.normalize() in a real footprintjs subflow so it
|
|
@@ -48,7 +62,24 @@ export type SubflowId = (typeof SUBFLOW_IDS)[keyof typeof SUBFLOW_IDS];
|
|
|
48
62
|
/** Stage IDs — plain function stages that builders mount. */
|
|
49
63
|
export declare const STAGE_IDS: {
|
|
50
64
|
readonly SEED: "seed";
|
|
65
|
+
/** Context-assembly selector stage. Runs AFTER InjectionEngine and
|
|
66
|
+
* fans the 3 slot subflows (system-prompt / messages / tools) out in
|
|
67
|
+
* PARALLEL (selector picks all 3 every iteration; failFast so a
|
|
68
|
+
* required slot's throw aborts the turn). They converge before
|
|
69
|
+
* CacheDecision. Shared by buildAgentChart + buildDynamicAgentChart;
|
|
70
|
+
* the flat viz proof chart uses the same id as its root selector. */
|
|
71
|
+
readonly CONTEXT: "context";
|
|
72
|
+
/** Outer "client" stage in LLMCall's wrapped chart. Receives args on
|
|
73
|
+
* the first visit, $break()s on the second (post-loop) visit with
|
|
74
|
+
* the LLM answer as TraversalResult. This is the lens-friendly
|
|
75
|
+
* affordance — the User pill maps to this stage. */
|
|
76
|
+
readonly CLIENT: "client";
|
|
51
77
|
readonly CALL_LLM: "call-llm";
|
|
78
|
+
/** Final-response extraction stage that runs after CallLLM (and
|
|
79
|
+
* optional sf-thinking). For LLMCall this is mostly symmetric with
|
|
80
|
+
* Agent's `sf-final` branch — gives lens a "Final" node and a
|
|
81
|
+
* clear commit boundary marking "we have the answer." */
|
|
82
|
+
readonly EXTRACT_FINAL: "extract-final";
|
|
52
83
|
readonly FINAL: "final";
|
|
53
84
|
readonly FORMAT_MERGE: "format-merge";
|
|
54
85
|
readonly MERGE_LLM: "merge-llm";
|
|
@@ -74,10 +105,79 @@ export type StageId = (typeof STAGE_IDS)[keyof typeof STAGE_IDS];
|
|
|
74
105
|
export declare function isSlotSubflow(id: string): id is typeof SUBFLOW_IDS.SYSTEM_PROMPT | typeof SUBFLOW_IDS.MESSAGES | typeof SUBFLOW_IDS.TOOLS;
|
|
75
106
|
/** Map a slot subflow id to its ContextSlot type. Undefined for non-slot ids. */
|
|
76
107
|
export declare function slotFromSubflowId(id: string): ContextSlot | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Resolve the context slot a scope write belongs to FROM THE WRITE'S OWN
|
|
110
|
+
* `runtimeStageId` — not from a "currently-open slot" stack.
|
|
111
|
+
*
|
|
112
|
+
* Why: once the 3 slot subflows run in PARALLEL (selector fan-out), their
|
|
113
|
+
* entry/write/exit events INTERLEAVE — a stack top is unreliable, so a write
|
|
114
|
+
* inside `sf-messages` could be attributed to (or dropped against)
|
|
115
|
+
* `sf-tools`. The write's `runtimeStageId` (`[subflowPath/]stageId#index`)
|
|
116
|
+
* always encodes which slot subflow enclosed it; we scan the path segments
|
|
117
|
+
* innermost-first for a slot id. Matches the sequential result exactly
|
|
118
|
+
* (the write is still inside its own slot), so it is behavior-preserving.
|
|
119
|
+
*/
|
|
120
|
+
export declare function slotFromRuntimeStageId(runtimeStageId: string): ContextSlot | undefined;
|
|
77
121
|
/** True when an id is any of the library's known subflow IDs. */
|
|
78
122
|
export declare function isKnownSubflow(id: string): id is SubflowId;
|
|
79
123
|
/** True when an id is any of the library's known stage IDs. */
|
|
80
124
|
export declare function isKnownStage(id: string): id is StageId;
|
|
125
|
+
/**
|
|
126
|
+
* Semantic role of a stage, used by renderers to decide visual emphasis.
|
|
127
|
+
*
|
|
128
|
+
* The agent's chart mixes a handful of stages users actually care about
|
|
129
|
+
* (the HEROES — what context was built, what the model decided, what it did)
|
|
130
|
+
* with mechanism stages (PLUMBING). This is the ONE place that says which is
|
|
131
|
+
* which; renderers stay generic and style purely off this role (e.g. heroes
|
|
132
|
+
* prominent, plumbing muted). Keeping it here — the semantic owner — avoids
|
|
133
|
+
* the "name-based filter list duplicated across renderers" anti-pattern.
|
|
134
|
+
*
|
|
135
|
+
* - `hero-slot` — a context slot (system-prompt / messages / tools)
|
|
136
|
+
* - `hero-llm` — the LLM invocation
|
|
137
|
+
* - `hero-action` — tool execution (the agent's actions)
|
|
138
|
+
* - `plumbing` — mechanism (injection engine, cache, route, thinking, …)
|
|
139
|
+
* - `boundary` — neutral chart boundaries (Initialize root, Final) +
|
|
140
|
+
* anything unrecognised (rendered normally, never muted)
|
|
141
|
+
*/
|
|
142
|
+
export type StageRole = 'hero-slot' | 'hero-llm' | 'hero-action' | 'plumbing' | 'boundary';
|
|
143
|
+
/**
|
|
144
|
+
* Classify a stage id into its {@link StageRole}. Accepts a path-qualified id
|
|
145
|
+
* (`sf-llm-call/call-llm`) — only the LOCAL segment matters, so it works at
|
|
146
|
+
* any nesting depth. Built entirely from the id constants above, so adding a
|
|
147
|
+
* stage to the chart only requires listing it here.
|
|
148
|
+
*/
|
|
149
|
+
export declare function stageRole(id: string): StageRole;
|
|
150
|
+
/**
|
|
151
|
+
* A {@link Milestone}'s kind — the domain vocabulary for "meaningful step you'd
|
|
152
|
+
* scrub to" in the agent's run.
|
|
153
|
+
*/
|
|
154
|
+
export type MilestoneKind = 'iteration' | 'slot' | 'llm-turn' | 'tool-call' | 'decision';
|
|
155
|
+
/**
|
|
156
|
+
* A time-travel milestone: a domain-declared scrub stop. Conceptually each
|
|
157
|
+
* milestone marks the boundary of a COLLECTION of commits (the commits that
|
|
158
|
+
* belong to that step) — so the Lens slider can step stage-by-stage
|
|
159
|
+
* (iteration → llm-turn → tool-call → …) instead of stopping only on
|
|
160
|
+
* structural subflow boundaries. The renderer iterates whatever the domain
|
|
161
|
+
* classifies; it never hardcodes agent vocabulary.
|
|
162
|
+
*/
|
|
163
|
+
export interface Milestone {
|
|
164
|
+
readonly kind: MilestoneKind;
|
|
165
|
+
/** Human-readable base label ("LLM turn"); the renderer may add an ordinal. */
|
|
166
|
+
readonly label: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Classify a stage id into a {@link Milestone}, or `null` when the stage is NOT
|
|
170
|
+
* a milestone boundary (its commits fold into the surrounding milestone's
|
|
171
|
+
* collection). This is the DOMAIN's declaration of which steps are scrub-worthy;
|
|
172
|
+
* the Lens consumes it to build the time-travel slider (see
|
|
173
|
+
* agentfootprint-lens `cursorPositionsAtDrill`).
|
|
174
|
+
*
|
|
175
|
+
* Mirrors {@link stageRole}: accepts a runtimeStageId (`call-llm#17`), a
|
|
176
|
+
* path-qualified id (`sf-llm-call/call-llm`), or a bare local id — only the
|
|
177
|
+
* LOCAL stage segment matters, so it works at any nesting depth and for both
|
|
178
|
+
* commit ids and subflow-group ids.
|
|
179
|
+
*/
|
|
180
|
+
export declare function milestoneFor(id: string): Milestone | null;
|
|
81
181
|
/**
|
|
82
182
|
* Scope-key convention for context injections.
|
|
83
183
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventions.d.ts","sourceRoot":"","sources":["../../src/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"conventions.d.ts","sourceRoot":"","sources":["../../src/conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,gEAAgE;AAChE,eAAO,MAAM,WAAW;IACtB;0EACsE;;IAEtE;;qDAEiD;;IAEj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;AA6B3F;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAY/C;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAEzF;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAiCzD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF,6CAA6C;AAC7C,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,CAS9F;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,YAAY,CAE/D"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* agentfootprint.stream.tool_start / tool_end
|
|
14
14
|
* agentfootprint.context.* (via ContextRecorder)
|
|
15
15
|
*/
|
|
16
|
-
import { type CombinedNarrativeEntry, type
|
|
16
|
+
import { type CombinedNarrativeEntry, type FlowchartCheckpoint, type RunOptions, type RuntimeSnapshot } from 'footprintjs';
|
|
17
17
|
import type { CachePolicy, CacheStrategy } from '../cache/types.js';
|
|
18
18
|
import type { ReliabilityConfig } from '../reliability/types.js';
|
|
19
19
|
import { type RunnerPauseOutcome } from './pause.js';
|
|
@@ -81,21 +81,6 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
81
81
|
readonly commentaryTemplates: Readonly<Record<string, string>>;
|
|
82
82
|
readonly thinkingTemplates: Readonly<Record<string, string>>;
|
|
83
83
|
private currentRunContext;
|
|
84
|
-
/**
|
|
85
|
-
* Reference to the most recent executor. Set on every `createExecutor()`
|
|
86
|
-
* call (i.e., every `run()` and `resume()`); read by `getLastSnapshot()`
|
|
87
|
-
* / `getLastNarrativeEntries()` so post-run UIs (Lens Trace tab,
|
|
88
|
-
* ExplainableShell) can pull execution state without intercepting the
|
|
89
|
-
* call. `undefined` until the first run.
|
|
90
|
-
*/
|
|
91
|
-
private lastExecutor?;
|
|
92
|
-
/**
|
|
93
|
-
* Reference to the FlowChart compiled for the most recent run. Cached
|
|
94
|
-
* here rather than recomputed via `buildChart()` so `getSpec()` returns
|
|
95
|
-
* the SAME spec the executor traced — important when the spec is used
|
|
96
|
-
* to reconcile `getLastSnapshot()` for ExplainableShell.
|
|
97
|
-
*/
|
|
98
|
-
private lastFlowChart?;
|
|
99
84
|
/**
|
|
100
85
|
* Memory subsystems registered via `.memory()`. Each definition mounts
|
|
101
86
|
* its `read` subflow before the InjectionEngine on every turn; per-id
|
|
@@ -152,13 +137,28 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
152
137
|
* wire format. Undefined = no thinking activation (default behavior).
|
|
153
138
|
*/
|
|
154
139
|
private readonly thinkingBudget?;
|
|
140
|
+
/** Threaded to footprintjs `flowChart()` so every node the Agent
|
|
141
|
+
* builder creates is observed by these recorders at build time. Set
|
|
142
|
+
* from `opts.structureRecorders`; undefined when consumer didn't
|
|
143
|
+
* attach any. */
|
|
144
|
+
private readonly structureRecorders?;
|
|
145
|
+
/** Per-COMPOSITION translator (L1b). Set from `opts.groupTranslator`;
|
|
146
|
+
* undefined when consumer didn't attach one. */
|
|
147
|
+
private readonly agentGroupTranslator?;
|
|
148
|
+
/** ReAct chart shape — 'flat' (default, bare call-llm stage) or
|
|
149
|
+
* 'subflow' (LLM turn wrapped in sf-llm-call). Set from
|
|
150
|
+
* `opts.reactStructure`. */
|
|
151
|
+
private readonly reactStructure;
|
|
152
|
+
/** ReAct loop SEMANTICS — 'dynamic' (default, re-engineer all slots each
|
|
153
|
+
* turn, loop→InjectionEngine) or 'classic' (engineer context once,
|
|
154
|
+
* loop→Messages only). Set from `opts.reactMode`. See AgentOptions. */
|
|
155
|
+
private readonly reactMode;
|
|
155
156
|
constructor(opts: AgentOptions, systemPromptValue: string, registry: readonly ToolRegistryEntry[], voice: {
|
|
156
157
|
readonly appName: string;
|
|
157
158
|
readonly commentaryTemplates: Readonly<Record<string, string>>;
|
|
158
159
|
readonly thinkingTemplates: Readonly<Record<string, string>>;
|
|
159
160
|
}, injections?: readonly Injection[], memories?: readonly MemoryDefinition[], outputSchemaParser?: OutputSchemaParser<unknown>, toolProvider?: ToolProvider, systemPromptCachePolicy?: CachePolicy, cachingDisabled?: boolean, cacheStrategy?: CacheStrategy, outputFallbackCfg?: ResolvedOutputFallback<unknown>, reliabilityConfig?: ReliabilityConfig, thinkingHandlerValue?: ThinkingHandler | null, thinkingBudgetValue?: number);
|
|
160
161
|
static create(opts: AgentOptions): AgentBuilder;
|
|
161
|
-
toFlowChart(): FlowChart;
|
|
162
162
|
/**
|
|
163
163
|
* Cache policy for the base system prompt. Read by the CacheDecision
|
|
164
164
|
* subflow (v2.6 Phase 4) to know how to treat the SystemPrompt slot's
|
|
@@ -192,7 +192,17 @@ export declare class Agent extends RunnerBase<AgentInput, AgentOutput> {
|
|
|
192
192
|
* `getLastSnapshot()` traced, otherwise the Trace view's stage tree
|
|
193
193
|
* desyncs from the snapshot's runtime tree.
|
|
194
194
|
*/
|
|
195
|
-
|
|
195
|
+
protected getGroupTranslator(): import('./translator.js').GroupTranslator | undefined;
|
|
196
|
+
/** Agent has no nested-runner members (tools are function executors,
|
|
197
|
+
* not Runner instances). Slot ids + tool names live in `extra` so
|
|
198
|
+
* Lens can render an Agent card with slot rows + a tool list without
|
|
199
|
+
* inspecting `buildTimeStructure`.
|
|
200
|
+
*
|
|
201
|
+
* Memories are NOT included as members — they're an internal
|
|
202
|
+
* mechanism, not a composition-level concept. Consumers who need
|
|
203
|
+
* memory visibility should listen for `agentfootprint.memory.*`
|
|
204
|
+
* events at runtime. */
|
|
205
|
+
protected buildUIGroupMetadata(): import('./translator.js').GroupMetadata;
|
|
196
206
|
/**
|
|
197
207
|
* Parse + validate a raw agent answer against the agent's
|
|
198
208
|
* `outputSchema` parser. Throws `OutputSchemaError` on JSON parse
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../src/core/Agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../../src/core/Agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,sBAAsB,EAE3B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAOjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAqBrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAKlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAKL,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwC,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EA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Q,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC;IAiB1E,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAwD7F;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,aAAa,CACjB,UAAU,EAAE,kBAAkB,GAAG,OAAO,EACxC,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAQ5C;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAyB1B,MAAM,CACV,UAAU,EAAE,mBAAmB,EAC/B,KAAK,CAAC,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,WAAW,GAAG,kBAAkB,CAAC;IAW5C,OAAO,CAAC,cAAc;IA+CtB,OAAO,CAAC,cAAc;IA8FtB,OAAO,CAAC,UAAU;CA6JnB"}
|
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* LLMCall — the leaf primitive for a single LLM invocation (no tools
|
|
2
|
+
* LLMCall — the leaf primitive for a single LLM invocation (no tools).
|
|
3
3
|
*
|
|
4
4
|
* Pattern: Builder (GoF) → produces a Runner backed by a footprintjs FlowChart.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Chart shape — outer client wrapper around an inner llm-subflow:
|
|
7
|
+
*
|
|
8
|
+
* Client → sf-llm-call → loopTo(client)
|
|
9
|
+
*
|
|
10
|
+
* Outer `Client` stage:
|
|
11
|
+
* - First visit: receives args, writes userMessage to scope.
|
|
12
|
+
* - Second visit (after the loop completes): $break()s with
|
|
13
|
+
* scope.answer as the chart's TraversalResult.
|
|
14
|
+
*
|
|
15
|
+
* Inner `sf-llm-call` subflow (drill-down view):
|
|
16
|
+
* Initialize → sf-system-prompt → sf-messages → call-llm
|
|
17
|
+
* → [sf-thinking if handler] → extract-final
|
|
18
|
+
*
|
|
19
|
+
* NO `sf-tools` slot — LLMCall has no tools by design (that's Agent's
|
|
20
|
+
* territory). Atomic LLMCall's lens chart is a clean 3-node top-level
|
|
21
|
+
* view (Client + LLM + loop edge) that drills into the real flowchart
|
|
22
|
+
* below.
|
|
23
|
+
*
|
|
24
|
+
* Loop semantics: LLMCall is one-shot. The loop fires once; the
|
|
25
|
+
* second Client visit immediately breaks. The shape is identical to
|
|
26
|
+
* chat-mode (future): swap `$break()` for `pause()` and the same
|
|
27
|
+
* chart supports multi-turn conversation.
|
|
28
|
+
*
|
|
29
|
+
* Slot subflows write convention-keyed injections observed by
|
|
30
|
+
* ContextRecorder. The call-llm stage typedEmits stream.llm_start
|
|
31
|
+
* and stream.llm_end observed by StreamRecorder. When a
|
|
32
|
+
* `ThinkingHandler` resolves for the provider, `sf-thinking` mounts
|
|
33
|
+
* automatically (auto-wired by provider.name — same convention Agent
|
|
34
|
+
* uses).
|
|
35
|
+
*
|
|
36
|
+
* Emits (through internally-attached recorders):
|
|
37
|
+
* agentfootprint.stream.llm_start / llm_end
|
|
38
|
+
* agentfootprint.context.injected / slot_composed
|
|
39
|
+
* agentfootprint.stream.thinking_end (when sf-thinking mounted)
|
|
13
40
|
*/
|
|
14
|
-
import { type
|
|
41
|
+
import { type FlowchartCheckpoint, type RunOptions, type StructureRecorder } from 'footprintjs';
|
|
42
|
+
import type { GroupMetadata, GroupTranslator } from './translator.js';
|
|
15
43
|
import type { RunnerPauseOutcome } from './pause.js';
|
|
16
44
|
import type { LLMProvider, PricingTable } from '../adapters/types.js';
|
|
17
45
|
import { RunnerBase } from './RunnerBase.js';
|
|
@@ -40,6 +68,24 @@ export interface LLMCallOptions {
|
|
|
40
68
|
* — consumers choose whether to abort by listening to the event.
|
|
41
69
|
*/
|
|
42
70
|
readonly costBudget?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Optional build-time recorders threaded into footprintjs's
|
|
73
|
+
* `flowChart()` factory. Each recorder observes per-node build
|
|
74
|
+
* events (`onStageAdded` / `onSubflowMounted` / etc.) for this
|
|
75
|
+
* LLMCall's internal chart (Initialize + slot mounts + CallLLM). When
|
|
76
|
+
* omitted, no build-time observation is wired up.
|
|
77
|
+
*/
|
|
78
|
+
readonly structureRecorders?: readonly StructureRecorder[];
|
|
79
|
+
/**
|
|
80
|
+
* Optional per-COMPOSITION translator (UI-agnostic). See
|
|
81
|
+
* `core/translator.ts`. When attached, `runner.getUIGroup()` invokes
|
|
82
|
+
* it with the LLMCall's `GroupMetadata` (kind `'LLMCall'`, id, name,
|
|
83
|
+
* empty `members[]`, plus `extra.slots` with the three slot ids —
|
|
84
|
+
* `system-prompt`, `messages`, `tools` — so Lens can render the slot
|
|
85
|
+
* cards inside an LLMCall card without inspecting `buildTimeStructure`).
|
|
86
|
+
* Returns `undefined` when omitted.
|
|
87
|
+
*/
|
|
88
|
+
readonly groupTranslator?: GroupTranslator;
|
|
43
89
|
}
|
|
44
90
|
export interface LLMCallInput {
|
|
45
91
|
readonly message: string;
|
|
@@ -55,10 +101,26 @@ export declare class LLMCall extends RunnerBase<LLMCallInput, LLMCallOutput> {
|
|
|
55
101
|
private readonly systemPromptValue;
|
|
56
102
|
private readonly pricingTable?;
|
|
57
103
|
private readonly costBudget?;
|
|
104
|
+
private readonly structureRecorders?;
|
|
105
|
+
private readonly groupTranslator?;
|
|
106
|
+
/** Auto-resolved from provider.name at construction time (same
|
|
107
|
+
* convention Agent uses — see findThinkingHandler). When undefined,
|
|
108
|
+
* sf-thinking is NOT mounted and the chart has zero thinking
|
|
109
|
+
* overhead (build-time conditional mount). */
|
|
110
|
+
private readonly thinkingHandler?;
|
|
58
111
|
private currentRunContext;
|
|
59
112
|
constructor(opts: LLMCallOptions, systemPromptValue: string);
|
|
60
113
|
static create(opts: LLMCallOptions): LLMCallBuilder;
|
|
61
|
-
|
|
114
|
+
protected getGroupTranslator(): GroupTranslator | undefined;
|
|
115
|
+
/** LLMCall has no nested-runner members (slots are subflows of
|
|
116
|
+
* the LLMCall's own chart, not Runner instances). The slot ids
|
|
117
|
+
* are surfaced via `extra` so Lens can render the slot cards
|
|
118
|
+
* inside an LLMCall card without inspecting `buildTimeStructure`.
|
|
119
|
+
*
|
|
120
|
+
* TWO slots only — LLMCall does not have tools (that's Agent's
|
|
121
|
+
* affordance). Atomic LLMCall renders as a clean 2-pill card in
|
|
122
|
+
* collapsed (top-level) view. */
|
|
123
|
+
protected buildUIGroupMetadata(): GroupMetadata;
|
|
62
124
|
run(input: LLMCallInput, options?: RunOptions): Promise<LLMCallOutput | RunnerPauseOutcome>;
|
|
63
125
|
resume(checkpoint: FlowchartCheckpoint, input?: unknown, options?: RunOptions): Promise<LLMCallOutput | RunnerPauseOutcome>;
|
|
64
126
|
private createExecutor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LLMCall.d.ts","sourceRoot":"","sources":["../../../src/core/LLMCall.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"LLMCall.d.ts","sourceRoot":"","sources":["../../../src/core/LLMCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,iBAAiB,EAEvB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAYrD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAC;AAOxD,M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AO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAA+B;IACnE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAkB;IACnD;;;mDAG+C;IAC/C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAkB;IAGnD,OAAO,CAAC,iBAAiB,CAIvB;gBAEU,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM;IA4B3D,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc;cAQhC,kBAAkB,IAAI,eAAe,GAAG,SAAS;IAIpE;;;;;;;sCAOkC;cACf,oBAAoB,IAAI,aAAa;IAYlD,GAAG,CACP,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,aAAa,GAAG,kBAAkB,CAAC;IAUxC,MAAM,CACV,UAAU,EAAE,mBAAmB,EAC/B,KAAK,CAAC,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,aAAa,GAAG,kBAAkB,CAAC;IAQ9C,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,cAAc;IAsBtB,OAAO,CAAC,UAAU;CAqNnB;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiB;IACtC,OAAO,CAAC,iBAAiB,CAAM;gBAEnB,IAAI,EAAE,cAAc;IAIhC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK5B,KAAK,IAAI,OAAO;CAGjB"}
|
|
@@ -22,13 +22,145 @@ export declare abstract class RunnerBase<TIn = unknown, TOut = unknown> implemen
|
|
|
22
22
|
protected readonly dispatcher: EventDispatcher;
|
|
23
23
|
protected readonly attachedRecorders: CombinedRecorder[];
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* The most recently used FlowChartExecutor — set by subclasses in
|
|
26
|
+
* `run()` so consumers can read the canonical structural snapshot
|
|
27
|
+
* via `getLastSnapshot()`. Single source of structural truth: this
|
|
28
|
+
* is footprintjs's snapshot, NOT a domain re-derivation.
|
|
27
29
|
*/
|
|
28
|
-
|
|
30
|
+
protected lastExecutor: FlowChartExecutor | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Cached footprintjs FlowChart, built ONCE at construction time via
|
|
33
|
+
* `initChart()`. Subsequent `getSpec()` calls return this same
|
|
34
|
+
* object — reference-stable across all consumers (Lens spec memos,
|
|
35
|
+
* footprintjs's OpenAPI/MCP caches, recorder-side correlation).
|
|
36
|
+
*
|
|
37
|
+
* Set via `initChart(builder)`, called from the subclass constructor
|
|
38
|
+
* AFTER all instance fields are populated. Read via `getSpec()`.
|
|
39
|
+
*
|
|
40
|
+
* Why eager construction: the `StructureRecorder` contract is
|
|
41
|
+
* "fires once per node at build time" — lazy construction would
|
|
42
|
+
* fire each recorder every `getSpec()` / `run()` call (2N invocations
|
|
43
|
+
* per run instead of N), break reference equality, and trigger
|
|
44
|
+
* `_mergeStageMap` false-positive collisions on second build.
|
|
45
|
+
* See `RunnerBase.initChart` for details.
|
|
46
|
+
*
|
|
47
|
+
* Visibility note: `private` (not `protected`) so subclasses cannot
|
|
48
|
+
* bypass the `initChart()` double-init guard by writing the field
|
|
49
|
+
* directly. All legitimate access goes through `getSpec()` and
|
|
50
|
+
* `initChart()`.
|
|
51
|
+
*/
|
|
52
|
+
private chart;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the footprintjs snapshot from the most recent run (or
|
|
55
|
+
* undefined if no run has completed). The snapshot is the CANONICAL
|
|
56
|
+
* STRUCTURE: nodes, edges, executionTree, runtimeStageId, commitLog.
|
|
57
|
+
*
|
|
58
|
+
* Domain consumers (Lens, Trace, dashboards) read this for shape
|
|
59
|
+
* and join their own per-stage payload by `runtimeStageId`. They
|
|
60
|
+
* MUST NOT re-derive structure from typed events — that's the
|
|
61
|
+
* design footprintjs's CLAUDE.md Convention 1 explicitly forbids.
|
|
62
|
+
*
|
|
63
|
+
* Returns `undefined` before the first `run()` completes. After,
|
|
64
|
+
* always returns the snapshot of the most recent run (including
|
|
65
|
+
* across multi-turn reuse of the same runner instance).
|
|
66
|
+
*/
|
|
67
|
+
getLastSnapshot(): ReturnType<FlowChartExecutor['getSnapshot']> | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Alias for `getLastSnapshot()` that mirrors `FlowChartExecutor.getSnapshot()`
|
|
70
|
+
* so consumers (lens, playground, ExplainableShell) can read the live or
|
|
71
|
+
* just-completed snapshot through the same method name they'd use on a
|
|
72
|
+
* footprintjs executor — without having to know whether they're holding
|
|
73
|
+
* an agentfootprint Runner or a raw executor.
|
|
74
|
+
*
|
|
75
|
+
* During an active run, returns the live snapshot (commit log + execution
|
|
76
|
+
* tree built incrementally as stages execute). Between runs, returns the
|
|
77
|
+
* last completed run's snapshot. Undefined before any run has started.
|
|
78
|
+
*/
|
|
79
|
+
getSnapshot(): ReturnType<FlowChartExecutor['getSnapshot']> | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Return the footprintjs FlowChart for this runner — the canonical
|
|
82
|
+
* design-time blueprint. STABLE REFERENCE across calls (`getSpec()
|
|
83
|
+
* === getSpec()`). Set once at construction via `initChart()`.
|
|
84
|
+
*
|
|
85
|
+
* Pairs with the run-time getters (`getLastSnapshot`,
|
|
86
|
+
* `getCommitCount`) and matches `ExplainableShell.spec` +
|
|
87
|
+
* `specToReactFlow(spec, ...)` consumer conventions.
|
|
88
|
+
*
|
|
89
|
+
* DO NOT OVERRIDE in subclasses — the reference-identity contract
|
|
90
|
+
* (Lens / OpenAPI / MCP caches memo on this returning the same
|
|
91
|
+
* object) depends on the inherited body returning `this.chart`
|
|
92
|
+
* directly. To customise build behaviour, override `buildChart()`
|
|
93
|
+
* instead; this getter must remain a thin cache-read.
|
|
94
|
+
*/
|
|
95
|
+
getSpec(): FlowChart;
|
|
96
|
+
/**
|
|
97
|
+
* Cached `getUIGroup()` output. Computed lazily on first read so the
|
|
98
|
+
* subclass constructor doesn't need to run the translator before all
|
|
99
|
+
* its members exist (e.g., Parallel builds its branches list mid-
|
|
100
|
+
* construction). After first invocation, subsequent calls return the
|
|
101
|
+
* same reference — reference-stable, matches the `getSpec()` contract.
|
|
102
|
+
*
|
|
103
|
+
* `null` (not `undefined`) is the explicit "computed; result was
|
|
104
|
+
* undefined" marker so we can distinguish from "not yet computed."
|
|
105
|
+
* Consumers see `undefined` when no translator was attached.
|
|
106
|
+
*/
|
|
107
|
+
private uiGroupCache;
|
|
108
|
+
/**
|
|
109
|
+
* Return the consumer-shaped UI group for this composition — produced
|
|
110
|
+
* by invoking the consumer's `groupTranslator` (if attached) with this
|
|
111
|
+
* runner's `GroupMetadata`. Returns `undefined` when no translator was
|
|
112
|
+
* attached.
|
|
113
|
+
*
|
|
114
|
+
* STABLE REFERENCE across calls. Computed on first access and cached;
|
|
115
|
+
* subsequent calls return the same value. Pairs with `getSpec()` —
|
|
116
|
+
* library shape on one side, consumer-shaped UI on the other.
|
|
117
|
+
*
|
|
118
|
+
* Subclasses MUST override `buildUIGroupMetadata()` (the next hook) to
|
|
119
|
+
* supply the `GroupMetadata` for their composition kind. This method
|
|
120
|
+
* (the public surface) is `final`-by-convention — do not override.
|
|
121
|
+
*/
|
|
122
|
+
getUIGroup<T = unknown>(): T | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Subclass hook — returns the consumer's translator if one was
|
|
125
|
+
* provided at construction time. Default: no translator (returns
|
|
126
|
+
* undefined). Each composition overrides to surface its own
|
|
127
|
+
* `opts.groupTranslator`.
|
|
128
|
+
*/
|
|
129
|
+
protected getGroupTranslator(): import('./translator.js').GroupTranslator | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Translate this runner's group metadata with a CALLER-SUPPLIED
|
|
132
|
+
* translator that overrides the runner's own default. Used by
|
|
133
|
+
* parent compositions to apply per-method translator overrides.
|
|
134
|
+
* See the `Runner.getUIGroupWith` JSDoc for the contract.
|
|
135
|
+
*/
|
|
136
|
+
getUIGroupWith<T = unknown>(override: import('./translator.js').GroupTranslator): T | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Subclass hook — returns the `GroupMetadata` for this composition.
|
|
139
|
+
* Default: undefined, meaning "no group translation for this runner
|
|
140
|
+
* kind." Compositions override to supply their members + kind. Called
|
|
141
|
+
* AT MOST ONCE per runner (result is cached by `getUIGroup()`).
|
|
142
|
+
*/
|
|
143
|
+
protected buildUIGroupMetadata(): import('./translator.js').GroupMetadata | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Build + cache the runner's `FlowChart` exactly once. Called by the
|
|
146
|
+
* subclass constructor AFTER all instance fields are set, so the
|
|
147
|
+
* builder lambda can close over them safely.
|
|
148
|
+
*
|
|
149
|
+
* Throws if called twice on the same instance — the chart is meant
|
|
150
|
+
* to be immutable post-construction. Each `run()` reuses the same
|
|
151
|
+
* chart in a fresh `FlowChartExecutor`.
|
|
152
|
+
*
|
|
153
|
+
* Implementation invariant (per footprintjs inventor review):
|
|
154
|
+
* each attached `StructureRecorder` fires exactly N times per
|
|
155
|
+
* construction (N = node count). Two `getSpec()` calls return the
|
|
156
|
+
* same `FlowChart` object reference. `_mergeStageMap` collision
|
|
157
|
+
* guards never see false-positives because each child runner's
|
|
158
|
+
* stage functions are created once and reused.
|
|
159
|
+
*/
|
|
160
|
+
protected initChart(builder: () => FlowChart): void;
|
|
29
161
|
/**
|
|
30
162
|
* Execute the runner. Subclass may override for specialized input
|
|
31
|
-
* mapping, but default invokes
|
|
163
|
+
* mapping, but default invokes getSpec() + FlowChartExecutor.
|
|
32
164
|
*/
|
|
33
165
|
abstract run(input: TIn, options?: RunOptions): Promise<TOut | RunnerPauseOutcome>;
|
|
34
166
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunnerBase.d.ts","sourceRoot":"","sources":["../../../src/core/RunnerBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;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