agentfootprint 6.44.0 → 6.45.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/ai-instructions/setup.sh +0 -0
- package/dist/core/agent/buildAgentChart.js +2 -1
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +3 -1
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/stages/pickEntry.js +3 -1
- package/dist/core/agent/stages/pickEntry.js.map +1 -1
- package/dist/esm/adapters/identity/agentcore.d.ts +100 -0
- package/dist/esm/adapters/llm/AnthropicProvider.d.ts +130 -0
- package/dist/esm/adapters/llm/BedrockProvider.d.ts +100 -0
- package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +41 -0
- package/dist/esm/adapters/llm/BrowserOpenAIProvider.d.ts +95 -0
- package/dist/esm/adapters/llm/MockProvider.d.ts +153 -0
- package/dist/esm/adapters/llm/OpenAIProvider.d.ts +220 -0
- package/dist/esm/adapters/llm/createProvider.d.ts +85 -0
- package/dist/esm/adapters/memory/agentcore.d.ts +146 -0
- package/dist/esm/adapters/memory/bedrockAgentMemory.d.ts +95 -0
- package/dist/esm/adapters/memory/redis.d.ts +127 -0
- package/dist/esm/adapters/observability/agentcore.d.ts +67 -0
- package/dist/esm/adapters/observability/audit.d.ts +254 -0
- package/dist/esm/adapters/observability/cloudwatch.d.ts +96 -0
- package/dist/esm/adapters/observability/otel.d.ts +237 -0
- package/dist/esm/adapters/observability/xray.d.ts +88 -0
- package/dist/esm/adapters/types.d.ts +378 -0
- package/dist/esm/bridge/eventMeta.d.ts +59 -0
- package/dist/esm/cache/CacheDecisionSubflow.d.ts +85 -0
- package/dist/esm/cache/CacheGateDecider.d.ts +127 -0
- package/dist/esm/cache/applyCachePolicy.d.ts +37 -0
- package/dist/esm/cache/cacheRecorder.d.ts +85 -0
- package/dist/esm/cache/index.d.ts +33 -0
- package/dist/esm/cache/strategies/AnthropicCacheStrategy.d.ts +38 -0
- package/dist/esm/cache/strategies/BedrockCacheStrategy.d.ts +33 -0
- package/dist/esm/cache/strategies/NoOpCacheStrategy.d.ts +29 -0
- package/dist/esm/cache/strategies/OpenAICacheStrategy.d.ts +36 -0
- package/dist/esm/cache/strategyRegistry.d.ts +45 -0
- package/dist/esm/cache/types.d.ts +243 -0
- package/dist/esm/conventions.d.ts +203 -0
- package/dist/esm/core/Agent.d.ts +355 -0
- package/dist/esm/core/LLMCall.d.ts +139 -0
- package/dist/esm/core/RunnerBase.d.ts +267 -0
- package/dist/esm/core/agent/AgentBuilder.d.ts +565 -0
- package/dist/esm/core/agent/buildAgentChart.d.ts +109 -0
- package/dist/esm/core/agent/buildAgentChart.js +2 -1
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildAgentMessageApiChart.d.ts +40 -0
- package/dist/esm/core/agent/buildCacheSubflow.d.ts +35 -0
- package/dist/esm/core/agent/buildDynamicAgentChart.d.ts +56 -0
- package/dist/esm/core/agent/buildDynamicAgentChart.js +3 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildMessageApiChart.d.ts +47 -0
- package/dist/esm/core/agent/buildToolRegistry.d.ts +61 -0
- package/dist/esm/core/agent/memoryRecallInjections.d.ts +8 -0
- package/dist/esm/core/agent/stages/breakFinal.d.ts +22 -0
- package/dist/esm/core/agent/stages/callLLM.d.ts +74 -0
- package/dist/esm/core/agent/stages/pickEntry.d.ts +19 -0
- package/dist/esm/core/agent/stages/pickEntry.js +3 -1
- package/dist/esm/core/agent/stages/pickEntry.js.map +1 -1
- package/dist/esm/core/agent/stages/prepareFinal.d.ts +19 -0
- package/dist/esm/core/agent/stages/reliabilityExecution.d.ts +135 -0
- package/dist/esm/core/agent/stages/route.d.ts +18 -0
- package/dist/esm/core/agent/stages/seed.d.ts +53 -0
- package/dist/esm/core/agent/stages/toolCalls.d.ts +76 -0
- package/dist/esm/core/agent/toolArgsValidation.d.ts +62 -0
- package/dist/esm/core/agent/types.d.ts +382 -0
- package/dist/esm/core/agent/validators.d.ts +52 -0
- package/dist/esm/core/cost.d.ts +38 -0
- package/dist/esm/core/flowchartAsTool.d.ts +200 -0
- package/dist/esm/core/humanizeLLMError.d.ts +23 -0
- package/dist/esm/core/outputFallback.d.ts +139 -0
- package/dist/esm/core/outputSchema.d.ts +127 -0
- package/dist/esm/core/pause.d.ts +74 -0
- package/dist/esm/core/runCheckpoint.d.ts +179 -0
- package/dist/esm/core/runner.d.ts +203 -0
- package/dist/esm/core/slots/buildMessagesSlot.d.ts +40 -0
- package/dist/esm/core/slots/buildSystemPromptSlot.d.ts +41 -0
- package/dist/esm/core/slots/buildThinkingSubflow.d.ts +40 -0
- package/dist/esm/core/slots/buildToolsSlot.d.ts +60 -0
- package/dist/esm/core/slots/helpers.d.ts +27 -0
- package/dist/esm/core/toolContract.d.ts +43 -0
- package/dist/esm/core/tools.d.ts +90 -0
- package/dist/esm/core/translator.d.ts +94 -0
- package/dist/esm/core-flow/Conditional.d.ts +119 -0
- package/dist/esm/core-flow/Loop.d.ts +160 -0
- package/dist/esm/core-flow/Parallel.d.ts +360 -0
- package/dist/esm/core-flow/Sequence.d.ts +133 -0
- package/dist/esm/events/dispatcher.d.ts +134 -0
- package/dist/esm/events/payloads.d.ts +761 -0
- package/dist/esm/events/registry.d.ts +198 -0
- package/dist/esm/events/types.d.ts +70 -0
- package/dist/esm/identity/kinds.d.ts +36 -0
- package/dist/esm/identity/staticTokens.d.ts +28 -0
- package/dist/esm/identity/types.d.ts +113 -0
- package/dist/esm/identity/withCredentialRetry.d.ts +64 -0
- package/dist/esm/identity.d.ts +31 -0
- package/dist/esm/index.d.ts +64 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/injection-engine.d.ts +4 -0
- package/dist/esm/lib/canonicalJson.d.ts +56 -0
- package/dist/esm/lib/context-bisect/ablation.d.ts +109 -0
- package/dist/esm/lib/context-bisect/bisect.d.ts +75 -0
- package/dist/esm/lib/context-bisect/cost.d.ts +37 -0
- package/dist/esm/lib/context-bisect/index.d.ts +31 -0
- package/dist/esm/lib/context-bisect/index.js +3 -0
- package/dist/esm/lib/context-bisect/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/llmEdgeWeigher.d.ts +124 -0
- package/dist/esm/lib/context-bisect/localize.d.ts +152 -0
- package/dist/esm/lib/context-bisect/localize.js +2 -0
- package/dist/esm/lib/context-bisect/localize.js.map +1 -1
- package/dist/esm/lib/context-bisect/loop-recall.d.ts +97 -0
- package/dist/esm/lib/context-bisect/missingContext.d.ts +71 -0
- package/dist/esm/lib/context-bisect/restoration.d.ts +39 -0
- package/dist/esm/lib/context-bisect/toBacktrackTrace.d.ts +138 -0
- package/dist/esm/lib/context-bisect/trajectory.d.ts +168 -0
- package/dist/esm/lib/context-bisect/types.d.ts +448 -0
- package/dist/esm/lib/context-bisect/walk-to-root.d.ts +103 -0
- package/dist/esm/lib/influence-core/attributability.d.ts +72 -0
- package/dist/esm/lib/influence-core/cache.d.ts +94 -0
- package/dist/esm/lib/influence-core/contrastive.d.ts +26 -0
- package/dist/esm/lib/influence-core/index.d.ts +34 -0
- package/dist/esm/lib/influence-core/margin.d.ts +33 -0
- package/dist/esm/lib/influence-core/signals.d.ts +128 -0
- package/dist/esm/lib/influence-core/similarity.d.ts +25 -0
- package/dist/esm/lib/influence-core/types.d.ts +252 -0
- package/dist/esm/lib/injection-engine/SkillRegistry.d.ts +147 -0
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.d.ts +110 -0
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +1 -0
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/esm/lib/injection-engine/entryScorer.d.ts +93 -0
- package/dist/esm/lib/injection-engine/entryScorer.js +172 -0
- package/dist/esm/lib/injection-engine/entryScorer.js.map +1 -0
- package/dist/esm/lib/injection-engine/evaluator.d.ts +24 -0
- package/dist/esm/lib/injection-engine/factories/defineFact.d.ts +60 -0
- package/dist/esm/lib/injection-engine/factories/defineInjection.d.ts +41 -0
- package/dist/esm/lib/injection-engine/factories/defineInstruction.d.ts +78 -0
- package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.d.ts +26 -0
- package/dist/esm/lib/injection-engine/factories/defineSkill.d.ts +160 -0
- package/dist/esm/lib/injection-engine/factories/defineSteering.d.ts +39 -0
- package/dist/esm/lib/injection-engine/index.d.ts +22 -0
- package/dist/esm/lib/injection-engine/index.js +1 -0
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillContract.d.ts +29 -0
- package/dist/esm/lib/injection-engine/skillGraph.d.ts +289 -0
- package/dist/esm/lib/injection-engine/skillGraph.js +35 -41
- package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +49 -0
- package/dist/esm/lib/injection-engine/skillTools.d.ts +72 -0
- package/dist/esm/lib/injection-engine/softmax.d.ts +11 -0
- package/dist/esm/lib/injection-engine/types.d.ts +229 -0
- package/dist/esm/lib/injection-engine/types.js.map +1 -1
- package/dist/esm/lib/lazyRequire.d.ts +29 -0
- package/dist/esm/lib/mcp/index.d.ts +9 -0
- package/dist/esm/lib/mcp/mcpClient.d.ts +46 -0
- package/dist/esm/lib/mcp/mockMcpClient.d.ts +65 -0
- package/dist/esm/lib/mcp/types.d.ts +133 -0
- package/dist/esm/lib/rag/defineRAG.d.ts +139 -0
- package/dist/esm/lib/rag/index.d.ts +7 -0
- package/dist/esm/lib/rag/indexDocuments.d.ts +105 -0
- package/dist/esm/lib/tool-lint/analyze.d.ts +83 -0
- package/dist/esm/lib/tool-lint/cli.d.ts +43 -0
- package/dist/esm/lib/tool-lint/format.d.ts +18 -0
- package/dist/esm/lib/tool-lint/index.d.ts +23 -0
- package/dist/esm/lib/tool-lint/rules.d.ts +85 -0
- package/dist/esm/lib/tool-lint/types.d.ts +155 -0
- package/dist/esm/lib/trace-toolpack/bounded.d.ts +47 -0
- package/dist/esm/lib/trace-toolpack/debugPrompt.d.ts +19 -0
- package/dist/esm/lib/trace-toolpack/index.d.ts +20 -0
- package/dist/esm/lib/trace-toolpack/lazyToolpack.d.ts +35 -0
- package/dist/esm/lib/trace-toolpack/selfExplain.d.ts +100 -0
- package/dist/esm/lib/trace-toolpack/traceDebugAgent.d.ts +42 -0
- package/dist/esm/lib/trace-toolpack/traceToolpack.d.ts +69 -0
- package/dist/esm/lib/trace-toolpack/types.d.ts +59 -0
- package/dist/esm/llm-providers.d.ts +26 -0
- package/dist/esm/locales/index.d.ts +132 -0
- package/dist/esm/memory/beats/extractBeats.d.ts +61 -0
- package/dist/esm/memory/beats/extractor.d.ts +47 -0
- package/dist/esm/memory/beats/formatAsNarrative.d.ts +62 -0
- package/dist/esm/memory/beats/heuristicExtractor.d.ts +37 -0
- package/dist/esm/memory/beats/index.d.ts +12 -0
- package/dist/esm/memory/beats/llmExtractor.d.ts +56 -0
- package/dist/esm/memory/beats/types.d.ts +60 -0
- package/dist/esm/memory/beats/writeBeats.d.ts +22 -0
- package/dist/esm/memory/causal/evidenceRecorder.d.ts +66 -0
- package/dist/esm/memory/causal/index.d.ts +6 -0
- package/dist/esm/memory/causal/loadSnapshot.d.ts +51 -0
- package/dist/esm/memory/causal/snapshotPipeline.d.ts +35 -0
- package/dist/esm/memory/causal/types.d.ts +130 -0
- package/dist/esm/memory/causal/writeSnapshot.d.ts +73 -0
- package/dist/esm/memory/define.d.ts +63 -0
- package/dist/esm/memory/define.types.d.ts +276 -0
- package/dist/esm/memory/define.types.js +1 -1
- package/dist/esm/memory/embedding/cosine.d.ts +18 -0
- package/dist/esm/memory/embedding/embedMessages.d.ts +58 -0
- package/dist/esm/memory/embedding/index.d.ts +8 -0
- package/dist/esm/memory/embedding/loadRelevant.d.ts +51 -0
- package/dist/esm/memory/embedding/mockEmbedder.d.ts +22 -0
- package/dist/esm/memory/embedding/types.d.ts +46 -0
- package/dist/esm/memory/entry/decay.d.ts +36 -0
- package/dist/esm/memory/entry/index.d.ts +2 -0
- package/dist/esm/memory/entry/types.d.ts +140 -0
- package/dist/esm/memory/facts/extractFacts.d.ts +50 -0
- package/dist/esm/memory/facts/extractor.d.ts +33 -0
- package/dist/esm/memory/facts/formatFacts.d.ts +60 -0
- package/dist/esm/memory/facts/index.d.ts +14 -0
- package/dist/esm/memory/facts/llmFactExtractor.d.ts +64 -0
- package/dist/esm/memory/facts/loadFacts.d.ts +43 -0
- package/dist/esm/memory/facts/patternFactExtractor.d.ts +2 -0
- package/dist/esm/memory/facts/types.d.ts +68 -0
- package/dist/esm/memory/facts/writeFacts.d.ts +19 -0
- package/dist/esm/memory/identity/index.d.ts +2 -0
- package/dist/esm/memory/identity/types.d.ts +49 -0
- package/dist/esm/memory/index.d.ts +19 -0
- package/dist/esm/memory/pipeline/auto.d.ts +59 -0
- package/dist/esm/memory/pipeline/default.d.ts +49 -0
- package/dist/esm/memory/pipeline/ephemeral.d.ts +28 -0
- package/dist/esm/memory/pipeline/fact.d.ts +26 -0
- package/dist/esm/memory/pipeline/index.d.ts +13 -0
- package/dist/esm/memory/pipeline/narrative.d.ts +35 -0
- package/dist/esm/memory/pipeline/semantic.d.ts +37 -0
- package/dist/esm/memory/pipeline/types.d.ts +31 -0
- package/dist/esm/memory/stages/formatDefault.d.ts +64 -0
- package/dist/esm/memory/stages/index.d.ts +13 -0
- package/dist/esm/memory/stages/loadRecent.d.ts +49 -0
- package/dist/esm/memory/stages/pickByBudget.d.ts +63 -0
- package/dist/esm/memory/stages/summarize.d.ts +87 -0
- package/dist/esm/memory/stages/tokenize.d.ts +43 -0
- package/dist/esm/memory/stages/types.d.ts +75 -0
- package/dist/esm/memory/stages/writeMessages.d.ts +71 -0
- package/dist/esm/memory/store/InMemoryStore.d.ts +62 -0
- package/dist/esm/memory/store/index.d.ts +2 -0
- package/dist/esm/memory/store/types.d.ts +223 -0
- package/dist/esm/memory/wire/index.d.ts +2 -0
- package/dist/esm/memory/wire/mountMemoryPipeline.d.ts +108 -0
- package/dist/esm/memory-providers.d.ts +37 -0
- package/dist/esm/observability/contextError/finders/compareFinders.d.ts +19 -0
- package/dist/esm/observability/contextError/finders/index.d.ts +22 -0
- package/dist/esm/observability/contextError/finders/rankSuspects.d.ts +2 -0
- package/dist/esm/observability/contextError/finders/removeAndRetry.d.ts +11 -0
- package/dist/esm/observability/contextError/finders/shrinkToCause.d.ts +11 -0
- package/dist/esm/observability/contextError/finders/testManyCombos.d.ts +11 -0
- package/dist/esm/observability/contextError/finders/traceSteps.d.ts +2 -0
- package/dist/esm/observability/contextError/finders/types.d.ts +88 -0
- package/dist/esm/observability-providers.d.ts +46 -0
- package/dist/esm/observe.d.ts +62 -0
- package/dist/esm/patterns/Debate.d.ts +39 -0
- package/dist/esm/patterns/MapReduce.d.ts +66 -0
- package/dist/esm/patterns/Reflection.d.ts +51 -0
- package/dist/esm/patterns/SelfConsistency.d.ts +43 -0
- package/dist/esm/patterns/Swarm.d.ts +60 -0
- package/dist/esm/patterns/ToT.d.ts +53 -0
- package/dist/esm/patterns/index.d.ts +22 -0
- package/dist/esm/providers.d.ts +33 -0
- package/dist/esm/recorders/core/AgentRecorder.d.ts +15 -0
- package/dist/esm/recorders/core/CompositionRecorder.d.ts +17 -0
- package/dist/esm/recorders/core/ContextEvaluatedRecorder.d.ts +23 -0
- package/dist/esm/recorders/core/ContextRecorder.d.ts +47 -0
- package/dist/esm/recorders/core/CostRecorder.d.ts +14 -0
- package/dist/esm/recorders/core/EmitBridge.d.ts +30 -0
- package/dist/esm/recorders/core/ErrorBridge.d.ts +38 -0
- package/dist/esm/recorders/core/EvalRecorder.d.ts +16 -0
- package/dist/esm/recorders/core/MemoryRecorder.d.ts +17 -0
- package/dist/esm/recorders/core/PermissionRecorder.d.ts +16 -0
- package/dist/esm/recorders/core/ReliabilityRecorder.d.ts +24 -0
- package/dist/esm/recorders/core/SkillRecorder.d.ts +14 -0
- package/dist/esm/recorders/core/StreamRecorder.d.ts +15 -0
- package/dist/esm/recorders/core/ToolsRecorder.d.ts +18 -0
- package/dist/esm/recorders/core/ValidationRecorder.d.ts +16 -0
- package/dist/esm/recorders/core/contextEngineering.d.ts +136 -0
- package/dist/esm/recorders/core/typedEmit.d.ts +34 -0
- package/dist/esm/recorders/core/types.d.ts +97 -0
- package/dist/esm/recorders/observability/AgentThinkingTraceRecorder.d.ts +117 -0
- package/dist/esm/recorders/observability/BoundaryRecorder.d.ts +546 -0
- package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +220 -0
- package/dist/esm/recorders/observability/LiveStateRecorder.d.ts +250 -0
- package/dist/esm/recorders/observability/LoggingRecorder.d.ts +91 -0
- package/dist/esm/recorders/observability/RouteRecorder.d.ts +83 -0
- package/dist/esm/recorders/observability/RunStepRecorder.d.ts +231 -0
- package/dist/esm/recorders/observability/StatusRecorder.d.ts +36 -0
- package/dist/esm/recorders/observability/ToolChoiceRecorder.d.ts +164 -0
- package/dist/esm/recorders/observability/ToolLineageRecorder.d.ts +71 -0
- package/dist/esm/recorders/observability/commentary/commentaryTemplates.d.ts +105 -0
- package/dist/esm/recorders/observability/internal/ActorArrowClassifier.d.ts +25 -0
- package/dist/esm/recorders/observability/internal/CandidateAnswerBuffer.d.ts +28 -0
- package/dist/esm/recorders/observability/internal/ForkTracker.d.ts +60 -0
- package/dist/esm/recorders/observability/internal/RootInferrer.d.ts +51 -0
- package/dist/esm/recorders/observability/internal/SequenceSiblingTracker.d.ts +24 -0
- package/dist/esm/recorders/observability/localObservability.d.ts +48 -0
- package/dist/esm/recorders/observability/observeRunId.d.ts +36 -0
- package/dist/esm/recorders/observability/status/statusTemplates.d.ts +106 -0
- package/dist/esm/recorders/observability/trace.d.ts +119 -0
- package/dist/esm/reliability/CircuitBreaker.d.ts +75 -0
- package/dist/esm/reliability/buildReliabilityGateChart.d.ts +53 -0
- package/dist/esm/reliability/classifyError.d.ts +28 -0
- package/dist/esm/reliability/index.d.ts +35 -0
- package/dist/esm/reliability/types.d.ts +327 -0
- package/dist/esm/resilience/fallbackProvider.d.ts +33 -0
- package/dist/esm/resilience/index.d.ts +21 -0
- package/dist/esm/resilience/withCircuitBreaker.d.ts +129 -0
- package/dist/esm/resilience/withFallback.d.ts +45 -0
- package/dist/esm/resilience/withRetry.d.ts +71 -0
- package/dist/esm/security/PermissionPolicy.d.ts +124 -0
- package/dist/esm/security/PolicyHaltError.d.ts +72 -0
- package/dist/esm/security/extractSequence.d.ts +46 -0
- package/dist/esm/security/index.d.ts +44 -0
- package/dist/esm/security/thinkingRedaction.d.ts +50 -0
- package/dist/esm/status.d.ts +48 -0
- package/dist/esm/strategies/attach.d.ts +47 -0
- package/dist/esm/strategies/compose.d.ts +48 -0
- package/dist/esm/strategies/defaults/chatBubbleLiveStatus.d.ts +36 -0
- package/dist/esm/strategies/defaults/consoleObservability.d.ts +42 -0
- package/dist/esm/strategies/defaults/inMemorySinkCost.d.ts +50 -0
- package/dist/esm/strategies/defaults/index.d.ts +30 -0
- package/dist/esm/strategies/defaults/noopLens.d.ts +28 -0
- package/dist/esm/strategies/index.d.ts +36 -0
- package/dist/esm/strategies/registry.d.ts +70 -0
- package/dist/esm/strategies/types.d.ts +303 -0
- package/dist/esm/stream.d.ts +82 -0
- package/dist/esm/thinking/AnthropicThinkingHandler.d.ts +42 -0
- package/dist/esm/thinking/MockThinkingHandler.d.ts +50 -0
- package/dist/esm/thinking/OpenAIThinkingHandler.d.ts +37 -0
- package/dist/esm/thinking/index.d.ts +51 -0
- package/dist/esm/thinking/registry.d.ts +33 -0
- package/dist/esm/thinking/types.d.ts +162 -0
- package/dist/esm/tool-providers/gatedTools.d.ts +36 -0
- package/dist/esm/tool-providers/index.d.ts +41 -0
- package/dist/esm/tool-providers/skillScopedTools.d.ts +45 -0
- package/dist/esm/tool-providers/staticTools.d.ts +21 -0
- package/dist/esm/tool-providers/types.d.ts +138 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/context-bisect/index.js +3 -0
- package/dist/lib/context-bisect/index.js.map +1 -1
- package/dist/lib/context-bisect/localize.js +2 -0
- package/dist/lib/context-bisect/localize.js.map +1 -1
- package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +1 -0
- package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/lib/injection-engine/entryScorer.js +178 -0
- package/dist/lib/injection-engine/entryScorer.js.map +1 -0
- package/dist/lib/injection-engine/index.js +5 -1
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillGraph.js +35 -41
- package/dist/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/lib/injection-engine/types.js.map +1 -1
- package/dist/memory/define.types.js +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/stages/pickEntry.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +8 -4
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/index.d.ts +3 -0
- package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/localize.d.ts +2 -0
- package/dist/types/lib/context-bisect/localize.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/entryScorer.d.ts +94 -0
- package/dist/types/lib/injection-engine/entryScorer.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/index.d.ts +1 -0
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraph.d.ts +21 -24
- package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/types.d.ts +9 -4
- package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
- package/dist/types/memory/define.types.d.ts +1 -1
- package/package.json +203 -56
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event registry — every typed `agentfootprint.*` event (see ALL_EVENT_TYPES;
|
|
3
|
+
* the event/domain counts in the docs are asserted against this file by
|
|
4
|
+
* test/events/unit/registry.test.ts, so don't hardcode counts here).
|
|
5
|
+
*
|
|
6
|
+
* Pattern: Discriminated Union + Typed Factory (Gang of Four adapted for TS).
|
|
7
|
+
* Role: The stable public event contract — the "ports" of the hexagonal
|
|
8
|
+
* architecture (Cockburn, 2005).
|
|
9
|
+
* Emits: N/A — this file DEFINES event types and factory helpers.
|
|
10
|
+
*
|
|
11
|
+
* Consumers subscribe via `.on(type, listener)`. Emitters construct events
|
|
12
|
+
* via typed helpers (e.g. `makeContextInjected(payload)`) rather than raw
|
|
13
|
+
* strings — compile-time safety prevents typos and payload drift.
|
|
14
|
+
*
|
|
15
|
+
* Events are additive within a major version; breaking changes require a
|
|
16
|
+
* major bump. See agentfootprint_v2_detailed_design.md for rules.
|
|
17
|
+
*/
|
|
18
|
+
import type { AgentfootprintEventEnvelope } from './types.js';
|
|
19
|
+
import type { AgentHandoffPayload, AgentIterationEndPayload, AgentIterationStartPayload, AgentRouteDecidedPayload, AgentTurnEndPayload, AgentTurnStartPayload, CompositionEnterPayload, CompositionExitPayload, ConditionalRouteDecidedPayload, ContextBudgetPressurePayload, ContextEvaluatedPayload, ContextEvictedPayload, ContextInjectedPayload, ContextSlotComposedPayload, CostLimitHitPayload, CostTickPayload, EmbeddingGeneratedPayload, ErrorFatalPayload, ErrorRecoveredPayload, ErrorRetriedPayload, EvalScorePayload, EvalThresholdCrossedPayload, AgentOutputSchemaValidationFailedPayload, AgentThinkingParseFailedPayload, StreamThinkingDeltaPayload, StreamThinkingEndPayload, FallbackTriggeredPayload, LLMEndPayload, LLMStartPayload, LLMTokenPayload, LoopIterationExitPayload, LoopIterationStartPayload, MemoryAttachedPayload, MemoryDetachedPayload, MemoryStrategyAppliedPayload, MemoryWrittenPayload, ParallelBranchCompletePayload, ParallelForkStartPayload, ParallelMergeEndPayload, PauseRequestPayload, PauseResumePayload, PermissionCheckPayload, PermissionGateClosedPayload, PermissionHaltPayload, PermissionGateOpenedPayload, CredentialRequestedPayload, CredentialAcquiredPayload, CredentialAuthorizationRequiredPayload, CredentialFailedPayload, ReliabilityFailFastPayload, ReliabilityRetriedPayload, ReliabilityRecoveredPayload, RiskFlaggedPayload, SkillActivatedPayload, SkillDeactivatedPayload, SkillRejectedPayload, ToolEndPayload, ToolsActivatedPayload, ToolsDeactivatedPayload, ToolsDiscoveryStartedPayload, ToolsDiscoveryCompletedPayload, ToolsDiscoveryFailedPayload, ToolsOfferedPayload, ToolStartPayload, ValidationArgsInvalidPayload } from './payloads.js';
|
|
20
|
+
export declare const EVENT_NAMES: {
|
|
21
|
+
readonly composition: {
|
|
22
|
+
readonly enter: "agentfootprint.composition.enter";
|
|
23
|
+
readonly exit: "agentfootprint.composition.exit";
|
|
24
|
+
readonly forkStart: "agentfootprint.composition.fork_start";
|
|
25
|
+
readonly branchComplete: "agentfootprint.composition.branch_complete";
|
|
26
|
+
readonly mergeEnd: "agentfootprint.composition.merge_end";
|
|
27
|
+
readonly routeDecided: "agentfootprint.composition.route_decided";
|
|
28
|
+
readonly iterationStart: "agentfootprint.composition.iteration_start";
|
|
29
|
+
readonly iterationExit: "agentfootprint.composition.iteration_exit";
|
|
30
|
+
};
|
|
31
|
+
readonly agent: {
|
|
32
|
+
readonly turnStart: "agentfootprint.agent.turn_start";
|
|
33
|
+
readonly turnEnd: "agentfootprint.agent.turn_end";
|
|
34
|
+
readonly iterationStart: "agentfootprint.agent.iteration_start";
|
|
35
|
+
readonly iterationEnd: "agentfootprint.agent.iteration_end";
|
|
36
|
+
readonly routeDecided: "agentfootprint.agent.route_decided";
|
|
37
|
+
readonly handoff: "agentfootprint.agent.handoff";
|
|
38
|
+
readonly outputSchemaValidationFailed: "agentfootprint.agent.output_schema_validation_failed";
|
|
39
|
+
readonly thinkingParseFailed: "agentfootprint.agent.thinking_parse_failed";
|
|
40
|
+
};
|
|
41
|
+
readonly stream: {
|
|
42
|
+
readonly llmStart: "agentfootprint.stream.llm_start";
|
|
43
|
+
readonly llmEnd: "agentfootprint.stream.llm_end";
|
|
44
|
+
readonly token: "agentfootprint.stream.token";
|
|
45
|
+
readonly toolStart: "agentfootprint.stream.tool_start";
|
|
46
|
+
readonly toolEnd: "agentfootprint.stream.tool_end";
|
|
47
|
+
readonly thinkingDelta: "agentfootprint.stream.thinking_delta";
|
|
48
|
+
readonly thinkingEnd: "agentfootprint.stream.thinking_end";
|
|
49
|
+
};
|
|
50
|
+
readonly context: {
|
|
51
|
+
readonly injected: "agentfootprint.context.injected";
|
|
52
|
+
readonly evicted: "agentfootprint.context.evicted";
|
|
53
|
+
readonly slotComposed: "agentfootprint.context.slot_composed";
|
|
54
|
+
readonly budgetPressure: "agentfootprint.context.budget_pressure";
|
|
55
|
+
readonly evaluated: "agentfootprint.context.evaluated";
|
|
56
|
+
};
|
|
57
|
+
readonly memory: {
|
|
58
|
+
readonly strategyApplied: "agentfootprint.memory.strategy_applied";
|
|
59
|
+
readonly attached: "agentfootprint.memory.attached";
|
|
60
|
+
readonly detached: "agentfootprint.memory.detached";
|
|
61
|
+
readonly written: "agentfootprint.memory.written";
|
|
62
|
+
};
|
|
63
|
+
readonly tools: {
|
|
64
|
+
readonly offered: "agentfootprint.tools.offered";
|
|
65
|
+
readonly activated: "agentfootprint.tools.activated";
|
|
66
|
+
readonly deactivated: "agentfootprint.tools.deactivated";
|
|
67
|
+
readonly discoveryStarted: "agentfootprint.tools.discovery_started";
|
|
68
|
+
readonly discoveryCompleted: "agentfootprint.tools.discovery_completed";
|
|
69
|
+
readonly discoveryFailed: "agentfootprint.tools.discovery_failed";
|
|
70
|
+
};
|
|
71
|
+
readonly skill: {
|
|
72
|
+
readonly activated: "agentfootprint.skill.activated";
|
|
73
|
+
readonly deactivated: "agentfootprint.skill.deactivated";
|
|
74
|
+
readonly rejected: "agentfootprint.skill.rejected";
|
|
75
|
+
};
|
|
76
|
+
readonly validation: {
|
|
77
|
+
readonly argsInvalid: "agentfootprint.validation.args_invalid";
|
|
78
|
+
};
|
|
79
|
+
readonly permission: {
|
|
80
|
+
readonly check: "agentfootprint.permission.check";
|
|
81
|
+
readonly gateOpened: "agentfootprint.permission.gate_opened";
|
|
82
|
+
readonly gateClosed: "agentfootprint.permission.gate_closed";
|
|
83
|
+
readonly halt: "agentfootprint.permission.halt";
|
|
84
|
+
};
|
|
85
|
+
readonly credential: {
|
|
86
|
+
readonly requested: "agentfootprint.credential.requested";
|
|
87
|
+
readonly acquired: "agentfootprint.credential.acquired";
|
|
88
|
+
readonly authorizationRequired: "agentfootprint.credential.authorization_required";
|
|
89
|
+
readonly failed: "agentfootprint.credential.failed";
|
|
90
|
+
};
|
|
91
|
+
readonly risk: {
|
|
92
|
+
readonly flagged: "agentfootprint.risk.flagged";
|
|
93
|
+
};
|
|
94
|
+
readonly fallback: {
|
|
95
|
+
readonly triggered: "agentfootprint.fallback.triggered";
|
|
96
|
+
};
|
|
97
|
+
readonly cost: {
|
|
98
|
+
readonly tick: "agentfootprint.cost.tick";
|
|
99
|
+
readonly limitHit: "agentfootprint.cost.limit_hit";
|
|
100
|
+
};
|
|
101
|
+
readonly eval: {
|
|
102
|
+
readonly score: "agentfootprint.eval.score";
|
|
103
|
+
readonly thresholdCrossed: "agentfootprint.eval.threshold_crossed";
|
|
104
|
+
};
|
|
105
|
+
readonly error: {
|
|
106
|
+
readonly retried: "agentfootprint.error.retried";
|
|
107
|
+
readonly recovered: "agentfootprint.error.recovered";
|
|
108
|
+
readonly fatal: "agentfootprint.error.fatal";
|
|
109
|
+
};
|
|
110
|
+
readonly reliability: {
|
|
111
|
+
readonly failFast: "agentfootprint.reliability.fail_fast";
|
|
112
|
+
readonly retried: "agentfootprint.reliability.retried";
|
|
113
|
+
readonly recovered: "agentfootprint.reliability.recovered";
|
|
114
|
+
};
|
|
115
|
+
readonly pause: {
|
|
116
|
+
readonly request: "agentfootprint.pause.request";
|
|
117
|
+
readonly resume: "agentfootprint.pause.resume";
|
|
118
|
+
};
|
|
119
|
+
readonly embedding: {
|
|
120
|
+
readonly generated: "agentfootprint.embedding.generated";
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
export interface AgentfootprintEventMap {
|
|
124
|
+
'agentfootprint.composition.enter': AgentfootprintEventEnvelope<'agentfootprint.composition.enter', CompositionEnterPayload>;
|
|
125
|
+
'agentfootprint.composition.exit': AgentfootprintEventEnvelope<'agentfootprint.composition.exit', CompositionExitPayload>;
|
|
126
|
+
'agentfootprint.composition.fork_start': AgentfootprintEventEnvelope<'agentfootprint.composition.fork_start', ParallelForkStartPayload>;
|
|
127
|
+
'agentfootprint.composition.branch_complete': AgentfootprintEventEnvelope<'agentfootprint.composition.branch_complete', ParallelBranchCompletePayload>;
|
|
128
|
+
'agentfootprint.composition.merge_end': AgentfootprintEventEnvelope<'agentfootprint.composition.merge_end', ParallelMergeEndPayload>;
|
|
129
|
+
'agentfootprint.composition.route_decided': AgentfootprintEventEnvelope<'agentfootprint.composition.route_decided', ConditionalRouteDecidedPayload>;
|
|
130
|
+
'agentfootprint.composition.iteration_start': AgentfootprintEventEnvelope<'agentfootprint.composition.iteration_start', LoopIterationStartPayload>;
|
|
131
|
+
'agentfootprint.composition.iteration_exit': AgentfootprintEventEnvelope<'agentfootprint.composition.iteration_exit', LoopIterationExitPayload>;
|
|
132
|
+
'agentfootprint.agent.turn_start': AgentfootprintEventEnvelope<'agentfootprint.agent.turn_start', AgentTurnStartPayload>;
|
|
133
|
+
'agentfootprint.agent.turn_end': AgentfootprintEventEnvelope<'agentfootprint.agent.turn_end', AgentTurnEndPayload>;
|
|
134
|
+
'agentfootprint.agent.iteration_start': AgentfootprintEventEnvelope<'agentfootprint.agent.iteration_start', AgentIterationStartPayload>;
|
|
135
|
+
'agentfootprint.agent.iteration_end': AgentfootprintEventEnvelope<'agentfootprint.agent.iteration_end', AgentIterationEndPayload>;
|
|
136
|
+
'agentfootprint.agent.route_decided': AgentfootprintEventEnvelope<'agentfootprint.agent.route_decided', AgentRouteDecidedPayload>;
|
|
137
|
+
'agentfootprint.agent.handoff': AgentfootprintEventEnvelope<'agentfootprint.agent.handoff', AgentHandoffPayload>;
|
|
138
|
+
'agentfootprint.agent.output_schema_validation_failed': AgentfootprintEventEnvelope<'agentfootprint.agent.output_schema_validation_failed', AgentOutputSchemaValidationFailedPayload>;
|
|
139
|
+
'agentfootprint.agent.thinking_parse_failed': AgentfootprintEventEnvelope<'agentfootprint.agent.thinking_parse_failed', AgentThinkingParseFailedPayload>;
|
|
140
|
+
'agentfootprint.stream.llm_start': AgentfootprintEventEnvelope<'agentfootprint.stream.llm_start', LLMStartPayload>;
|
|
141
|
+
'agentfootprint.stream.llm_end': AgentfootprintEventEnvelope<'agentfootprint.stream.llm_end', LLMEndPayload>;
|
|
142
|
+
'agentfootprint.stream.token': AgentfootprintEventEnvelope<'agentfootprint.stream.token', LLMTokenPayload>;
|
|
143
|
+
'agentfootprint.stream.tool_start': AgentfootprintEventEnvelope<'agentfootprint.stream.tool_start', ToolStartPayload>;
|
|
144
|
+
'agentfootprint.stream.tool_end': AgentfootprintEventEnvelope<'agentfootprint.stream.tool_end', ToolEndPayload>;
|
|
145
|
+
'agentfootprint.stream.thinking_delta': AgentfootprintEventEnvelope<'agentfootprint.stream.thinking_delta', StreamThinkingDeltaPayload>;
|
|
146
|
+
'agentfootprint.stream.thinking_end': AgentfootprintEventEnvelope<'agentfootprint.stream.thinking_end', StreamThinkingEndPayload>;
|
|
147
|
+
'agentfootprint.context.injected': AgentfootprintEventEnvelope<'agentfootprint.context.injected', ContextInjectedPayload>;
|
|
148
|
+
'agentfootprint.context.evicted': AgentfootprintEventEnvelope<'agentfootprint.context.evicted', ContextEvictedPayload>;
|
|
149
|
+
'agentfootprint.context.slot_composed': AgentfootprintEventEnvelope<'agentfootprint.context.slot_composed', ContextSlotComposedPayload>;
|
|
150
|
+
'agentfootprint.context.budget_pressure': AgentfootprintEventEnvelope<'agentfootprint.context.budget_pressure', ContextBudgetPressurePayload>;
|
|
151
|
+
'agentfootprint.context.evaluated': AgentfootprintEventEnvelope<'agentfootprint.context.evaluated', ContextEvaluatedPayload>;
|
|
152
|
+
'agentfootprint.memory.strategy_applied': AgentfootprintEventEnvelope<'agentfootprint.memory.strategy_applied', MemoryStrategyAppliedPayload>;
|
|
153
|
+
'agentfootprint.memory.attached': AgentfootprintEventEnvelope<'agentfootprint.memory.attached', MemoryAttachedPayload>;
|
|
154
|
+
'agentfootprint.memory.detached': AgentfootprintEventEnvelope<'agentfootprint.memory.detached', MemoryDetachedPayload>;
|
|
155
|
+
'agentfootprint.memory.written': AgentfootprintEventEnvelope<'agentfootprint.memory.written', MemoryWrittenPayload>;
|
|
156
|
+
'agentfootprint.tools.offered': AgentfootprintEventEnvelope<'agentfootprint.tools.offered', ToolsOfferedPayload>;
|
|
157
|
+
'agentfootprint.tools.activated': AgentfootprintEventEnvelope<'agentfootprint.tools.activated', ToolsActivatedPayload>;
|
|
158
|
+
'agentfootprint.tools.deactivated': AgentfootprintEventEnvelope<'agentfootprint.tools.deactivated', ToolsDeactivatedPayload>;
|
|
159
|
+
'agentfootprint.tools.discovery_started': AgentfootprintEventEnvelope<'agentfootprint.tools.discovery_started', ToolsDiscoveryStartedPayload>;
|
|
160
|
+
'agentfootprint.tools.discovery_completed': AgentfootprintEventEnvelope<'agentfootprint.tools.discovery_completed', ToolsDiscoveryCompletedPayload>;
|
|
161
|
+
'agentfootprint.tools.discovery_failed': AgentfootprintEventEnvelope<'agentfootprint.tools.discovery_failed', ToolsDiscoveryFailedPayload>;
|
|
162
|
+
'agentfootprint.skill.activated': AgentfootprintEventEnvelope<'agentfootprint.skill.activated', SkillActivatedPayload>;
|
|
163
|
+
'agentfootprint.skill.deactivated': AgentfootprintEventEnvelope<'agentfootprint.skill.deactivated', SkillDeactivatedPayload>;
|
|
164
|
+
'agentfootprint.skill.rejected': AgentfootprintEventEnvelope<'agentfootprint.skill.rejected', SkillRejectedPayload>;
|
|
165
|
+
'agentfootprint.validation.args_invalid': AgentfootprintEventEnvelope<'agentfootprint.validation.args_invalid', ValidationArgsInvalidPayload>;
|
|
166
|
+
'agentfootprint.permission.check': AgentfootprintEventEnvelope<'agentfootprint.permission.check', PermissionCheckPayload>;
|
|
167
|
+
'agentfootprint.permission.gate_opened': AgentfootprintEventEnvelope<'agentfootprint.permission.gate_opened', PermissionGateOpenedPayload>;
|
|
168
|
+
'agentfootprint.permission.gate_closed': AgentfootprintEventEnvelope<'agentfootprint.permission.gate_closed', PermissionGateClosedPayload>;
|
|
169
|
+
'agentfootprint.permission.halt': AgentfootprintEventEnvelope<'agentfootprint.permission.halt', PermissionHaltPayload>;
|
|
170
|
+
'agentfootprint.credential.requested': AgentfootprintEventEnvelope<'agentfootprint.credential.requested', CredentialRequestedPayload>;
|
|
171
|
+
'agentfootprint.credential.acquired': AgentfootprintEventEnvelope<'agentfootprint.credential.acquired', CredentialAcquiredPayload>;
|
|
172
|
+
'agentfootprint.credential.authorization_required': AgentfootprintEventEnvelope<'agentfootprint.credential.authorization_required', CredentialAuthorizationRequiredPayload>;
|
|
173
|
+
'agentfootprint.credential.failed': AgentfootprintEventEnvelope<'agentfootprint.credential.failed', CredentialFailedPayload>;
|
|
174
|
+
'agentfootprint.risk.flagged': AgentfootprintEventEnvelope<'agentfootprint.risk.flagged', RiskFlaggedPayload>;
|
|
175
|
+
'agentfootprint.fallback.triggered': AgentfootprintEventEnvelope<'agentfootprint.fallback.triggered', FallbackTriggeredPayload>;
|
|
176
|
+
'agentfootprint.cost.tick': AgentfootprintEventEnvelope<'agentfootprint.cost.tick', CostTickPayload>;
|
|
177
|
+
'agentfootprint.cost.limit_hit': AgentfootprintEventEnvelope<'agentfootprint.cost.limit_hit', CostLimitHitPayload>;
|
|
178
|
+
'agentfootprint.eval.score': AgentfootprintEventEnvelope<'agentfootprint.eval.score', EvalScorePayload>;
|
|
179
|
+
'agentfootprint.eval.threshold_crossed': AgentfootprintEventEnvelope<'agentfootprint.eval.threshold_crossed', EvalThresholdCrossedPayload>;
|
|
180
|
+
'agentfootprint.error.retried': AgentfootprintEventEnvelope<'agentfootprint.error.retried', ErrorRetriedPayload>;
|
|
181
|
+
'agentfootprint.error.recovered': AgentfootprintEventEnvelope<'agentfootprint.error.recovered', ErrorRecoveredPayload>;
|
|
182
|
+
'agentfootprint.error.fatal': AgentfootprintEventEnvelope<'agentfootprint.error.fatal', ErrorFatalPayload>;
|
|
183
|
+
'agentfootprint.reliability.fail_fast': AgentfootprintEventEnvelope<'agentfootprint.reliability.fail_fast', ReliabilityFailFastPayload>;
|
|
184
|
+
'agentfootprint.reliability.retried': AgentfootprintEventEnvelope<'agentfootprint.reliability.retried', ReliabilityRetriedPayload>;
|
|
185
|
+
'agentfootprint.reliability.recovered': AgentfootprintEventEnvelope<'agentfootprint.reliability.recovered', ReliabilityRecoveredPayload>;
|
|
186
|
+
'agentfootprint.pause.request': AgentfootprintEventEnvelope<'agentfootprint.pause.request', PauseRequestPayload>;
|
|
187
|
+
'agentfootprint.pause.resume': AgentfootprintEventEnvelope<'agentfootprint.pause.resume', PauseResumePayload>;
|
|
188
|
+
'agentfootprint.embedding.generated': AgentfootprintEventEnvelope<'agentfootprint.embedding.generated', EmbeddingGeneratedPayload>;
|
|
189
|
+
}
|
|
190
|
+
/** Union of every typed event. Consumers use this for exhaustive `switch`. */
|
|
191
|
+
export type AgentfootprintEvent = AgentfootprintEventMap[keyof AgentfootprintEventMap];
|
|
192
|
+
/** Every known event-type string, useful for runtime lookups / lints. */
|
|
193
|
+
export type AgentfootprintEventType = keyof AgentfootprintEventMap;
|
|
194
|
+
/**
|
|
195
|
+
* Complete list of every registered event type, for lint / runtime validation.
|
|
196
|
+
* A new event MUST be added here or the exhaustiveness tests fail.
|
|
197
|
+
*/
|
|
198
|
+
export declare const ALL_EVENT_TYPES: readonly AgentfootprintEventType[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventMeta + shared event vocabulary.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Domain-Driven Design value objects (Evans, 2003).
|
|
5
|
+
* Role: Shared vocabulary for the typed events in registry.ts.
|
|
6
|
+
* Emits: (types only — no runtime behavior here).
|
|
7
|
+
*/
|
|
8
|
+
export type ContextSlot = 'system-prompt' | 'messages' | 'tools';
|
|
9
|
+
/**
|
|
10
|
+
* The origin / flavor of a context injection.
|
|
11
|
+
*
|
|
12
|
+
* BASELINE sources (regular LLM-API flow — NOT context engineering):
|
|
13
|
+
* - `user` → the user's message (current turn or history replay)
|
|
14
|
+
* - `tool-result` → tool return for a tool call (current or history)
|
|
15
|
+
* - `assistant` → prior-turn assistant output replayed as history
|
|
16
|
+
* - `base` → static system prompt configured at build time
|
|
17
|
+
* - `registry` → static tool registry configured at build time
|
|
18
|
+
*
|
|
19
|
+
* ENGINEERED sources (context engineering flavors — the teaching layer):
|
|
20
|
+
* - `rag` → retrieval-augmented injection
|
|
21
|
+
* - `skill` → skill activation (LLM-guided via read_skill)
|
|
22
|
+
* - `memory` → memory strategy re-injection
|
|
23
|
+
* - `instructions` → rule-based behavior guidance
|
|
24
|
+
* - `steering` → always-on policy / persona / format rule
|
|
25
|
+
* - `fact` → developer-supplied data (user profile, env, …)
|
|
26
|
+
* - `custom` → consumer-defined (anything bespoke)
|
|
27
|
+
*
|
|
28
|
+
* Adding a new source is NOT a breaking change; removing one IS.
|
|
29
|
+
*/
|
|
30
|
+
export type ContextSource = 'rag' | 'skill' | 'memory' | 'instructions' | 'steering' | 'fact' | 'custom' | 'user' | 'tool-result' | 'assistant' | 'base' | 'registry';
|
|
31
|
+
export type ContextRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
32
|
+
export type ContextRecency = 'latest' | 'earlier';
|
|
33
|
+
export type ContextLifetime = 'iteration' | 'turn' | 'run' | 'persistent';
|
|
34
|
+
export type LLMProviderName = 'anthropic' | 'openai' | 'google' | 'cohere' | 'local' | 'custom' | 'mock' | (string & {});
|
|
35
|
+
export type ToolProtocol = 'native' | 'mcp' | 'http' | 'python-fn';
|
|
36
|
+
export type CompositionKind = 'Sequence' | 'Parallel' | 'Conditional' | 'Loop';
|
|
37
|
+
/**
|
|
38
|
+
* Metadata attached by the dispatcher to every event. Consumers never
|
|
39
|
+
* construct this manually — the dispatcher fills it in.
|
|
40
|
+
*/
|
|
41
|
+
export interface EventMeta {
|
|
42
|
+
/** Wall-clock ms — for external correlation / dashboards. */
|
|
43
|
+
readonly wallClockMs: number;
|
|
44
|
+
/** ms since run start — deterministic replay. */
|
|
45
|
+
readonly runOffsetMs: number;
|
|
46
|
+
/** footprintjs universal stage key. */
|
|
47
|
+
readonly runtimeStageId: string;
|
|
48
|
+
/** Subflow path parsed from runtimeStageId. */
|
|
49
|
+
readonly subflowPath: readonly string[];
|
|
50
|
+
/** Composition ancestry — e.g. ['Sequence:pipeline','Agent:ethics']. */
|
|
51
|
+
readonly compositionPath: readonly string[];
|
|
52
|
+
/** Turn index (Agent context only). */
|
|
53
|
+
readonly turnIndex?: number;
|
|
54
|
+
/** Iteration index (Agent context only). */
|
|
55
|
+
readonly iterIndex?: number;
|
|
56
|
+
/** OTEL trace id (when env.traceId is set). */
|
|
57
|
+
readonly traceId?: string;
|
|
58
|
+
/** OTEL span id for the current composition boundary. */
|
|
59
|
+
readonly spanId?: string;
|
|
60
|
+
/** Domain correlation id — ties retrieval → injection → LLM. */
|
|
61
|
+
readonly correlationId?: string;
|
|
62
|
+
/** Run id — demultiplex concurrent runs sharing one dispatcher. */
|
|
63
|
+
readonly runId: string;
|
|
64
|
+
}
|
|
65
|
+
/** Discriminated-union envelope every event implements. */
|
|
66
|
+
export interface AgentfootprintEventEnvelope<TType extends string, TPayload> {
|
|
67
|
+
readonly type: TType;
|
|
68
|
+
readonly payload: TPayload;
|
|
69
|
+
readonly meta: EventMeta;
|
|
70
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in credential kinds — small strategies implementing the {@link Credential}
|
|
3
|
+
* protocol. Each is a factory returning `{ kind, ...rawFields, toHeaders() }`.
|
|
4
|
+
*
|
|
5
|
+
* The framework + tools only ever call `cred.toHeaders()` (generic — no `kind`
|
|
6
|
+
* switching); the raw fields are there for the rare non-HTTP case. A custom kind
|
|
7
|
+
* is any object implementing `Credential` — no library change needed.
|
|
8
|
+
*/
|
|
9
|
+
import type { Credential } from './types.js';
|
|
10
|
+
export interface BearerCredential extends Credential {
|
|
11
|
+
readonly kind: 'bearer';
|
|
12
|
+
readonly token: string;
|
|
13
|
+
}
|
|
14
|
+
/** OAuth / bearer token → `Authorization: Bearer <token>`. */
|
|
15
|
+
export declare function bearer(token: string): BearerCredential;
|
|
16
|
+
export interface ApiKeyCredential extends Credential {
|
|
17
|
+
readonly kind: 'apiKey';
|
|
18
|
+
readonly key: string;
|
|
19
|
+
readonly headerName: string;
|
|
20
|
+
}
|
|
21
|
+
/** API key → a single header (default `x-api-key`). */
|
|
22
|
+
export declare function apiKey(key: string, headerName?: string): ApiKeyCredential;
|
|
23
|
+
export interface BasicCredential extends Credential {
|
|
24
|
+
readonly kind: 'basic';
|
|
25
|
+
readonly username: string;
|
|
26
|
+
readonly password: string;
|
|
27
|
+
}
|
|
28
|
+
/** HTTP Basic auth → `Authorization: Basic base64(user:pass)`. */
|
|
29
|
+
export declare function basic(username: string, password: string): BasicCredential;
|
|
30
|
+
export interface HeadersCredential extends Credential {
|
|
31
|
+
readonly kind: 'headers';
|
|
32
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
33
|
+
}
|
|
34
|
+
/** The universal escape: arbitrary auth headers. Any scheme reduces to this, so
|
|
35
|
+
* a provider with no matching typed kind can always return `headers(...)`. */
|
|
36
|
+
export declare function headers(map: Readonly<Record<string, string>>): HeadersCredential;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* staticTokens — a dev/test {@link CredentialProvider} backed by canned credentials.
|
|
3
|
+
*
|
|
4
|
+
* No network, no SDK. Use it to develop tools that need credentials without
|
|
5
|
+
* standing up AgentCore Identity (or any IdP). Production swaps it for
|
|
6
|
+
* `agentCoreIdentity()` — the tool code never changes.
|
|
7
|
+
*
|
|
8
|
+
* // a plain string is treated as a bearer token (the common case):
|
|
9
|
+
* const credentials = staticTokens({ github: 'ghp_dev_xxx' });
|
|
10
|
+
* // …or give an explicit kind:
|
|
11
|
+
* const credentials = staticTokens({ internal: apiKey('k', 'x-internal-key') });
|
|
12
|
+
*
|
|
13
|
+
* const r = await credentials.getCredential({ service: 'github' });
|
|
14
|
+
* if (isCredentialIssued(r)) callGithub({ headers: r.credential.toHeaders() });
|
|
15
|
+
*/
|
|
16
|
+
import type { Credential, CredentialProvider } from './types.js';
|
|
17
|
+
export interface StaticTokensOptions {
|
|
18
|
+
/** Optional id (defaults to 'static-tokens'). */
|
|
19
|
+
readonly id?: string;
|
|
20
|
+
/** Optional fixed expiry (unix seconds) applied to every credential. */
|
|
21
|
+
readonly expiresAt?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build a {@link CredentialProvider} from a `service → credential` map. A plain
|
|
25
|
+
* string value is treated as a bearer token; a {@link Credential} is used as-is.
|
|
26
|
+
* Always 2-legged (issues directly); throws if a requested service has none.
|
|
27
|
+
*/
|
|
28
|
+
export declare function staticTokens(creds: Readonly<Record<string, string | Credential>>, options?: StaticTokensOptions): CredentialProvider;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentfootprint/identity — the CredentialProvider port.
|
|
3
|
+
*
|
|
4
|
+
* OUTBOUND auth: vend a credential/token so a tool can call a downstream service
|
|
5
|
+
* (GitHub, Slack, Google…) on behalf of the agent or the end user. This is
|
|
6
|
+
* DISTINCT from `agentfootprint/security` (authorization — "is this tool
|
|
7
|
+
* allowed"); identity answers "get me a token to call X".
|
|
8
|
+
*
|
|
9
|
+
* Pattern: Port (Hexagonal). Vendors plug in as adapters:
|
|
10
|
+
* - `agentCoreIdentity()` — AWS Bedrock AgentCore Identity (token vault + OAuth)
|
|
11
|
+
* - `staticTokens()` — dev/test (canned tokens, no network)
|
|
12
|
+
*
|
|
13
|
+
* Two flows, mirroring OAuth (and AgentCore's `M2M` vs `USER_FEDERATION`):
|
|
14
|
+
* - `mode: 'machine'` (2-legged) — client-credentials; returns a token directly.
|
|
15
|
+
* - `mode: 'user'` (3-legged) — user-delegated; may need consent. When it
|
|
16
|
+
* does, the provider returns `authorization-required` with a URL; the agent
|
|
17
|
+
* surfaces it to the human (e.g. via pause/resume) and retries after consent.
|
|
18
|
+
* (Most calls skip consent — providers cache refresh tokens.)
|
|
19
|
+
*
|
|
20
|
+
* **Security invariant:** a vended token is a SECRET. Callers MUST use it locally
|
|
21
|
+
* (e.g. as an HTTP header inside a tool's `execute`) and MUST NOT write it to
|
|
22
|
+
* tracked scope (`setValue`) — tracked writes flow to the commit log, recorders,
|
|
23
|
+
* and observability exporters, which would leak the token into the trace. Pair
|
|
24
|
+
* with `RedactionPolicy` for defence in depth.
|
|
25
|
+
*/
|
|
26
|
+
/** What a tool/agent asks for. `service` ↔ the provider's downstream service id. */
|
|
27
|
+
export interface CredentialRequest {
|
|
28
|
+
/** Downstream service id, e.g. 'github', 'slack', 'google'. */
|
|
29
|
+
readonly service: string;
|
|
30
|
+
/** OAuth scopes to request. */
|
|
31
|
+
readonly scopes?: readonly string[];
|
|
32
|
+
/** `machine` = 2-legged (M2M); `user` = 3-legged (on behalf of a user). Default `machine`. */
|
|
33
|
+
readonly mode?: 'machine' | 'user';
|
|
34
|
+
/** The principal/tenant the token is for (the agent + end-user identity). */
|
|
35
|
+
readonly identity?: {
|
|
36
|
+
readonly principal?: string;
|
|
37
|
+
readonly tenant?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Force a fresh authorization, bypassing any cached/refresh token. */
|
|
40
|
+
readonly forceReauth?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A credential, ready to apply to a downstream request. It carries its `kind`
|
|
44
|
+
* (so you can read the raw value when you must) AND a **universal applicator**
|
|
45
|
+
* `toHeaders()` — the way to USE it without switching on `kind`. Built-in kinds
|
|
46
|
+
* (`bearer`/`apiKey`/`basic`/`headers`) live in `./kinds`; a custom kind is any
|
|
47
|
+
* object implementing this protocol — so new credential types plug in with no
|
|
48
|
+
* library change.
|
|
49
|
+
*
|
|
50
|
+
* **SECRET.** Use it locally (e.g. `headers: cred.toHeaders()`) inside a tool;
|
|
51
|
+
* never write it to tracked scope. It is a live object (carries `toHeaders`),
|
|
52
|
+
* so it is intentionally NOT serializable — credentials are used immediately
|
|
53
|
+
* and never persisted/traced.
|
|
54
|
+
*/
|
|
55
|
+
export interface Credential {
|
|
56
|
+
/** Discriminator: 'bearer' | 'apiKey' | 'basic' | 'headers' | <your kind>. */
|
|
57
|
+
readonly kind: string;
|
|
58
|
+
/** The auth header(s) to add to a downstream HTTP request. Universal across kinds. */
|
|
59
|
+
toHeaders(): Record<string, string>;
|
|
60
|
+
}
|
|
61
|
+
/** The provider issued a credential (the 2-legged / refreshed-3-legged happy path). */
|
|
62
|
+
export interface CredentialIssued {
|
|
63
|
+
readonly status: 'issued';
|
|
64
|
+
readonly credential: Credential;
|
|
65
|
+
/** Unix seconds when it expires, if known. */
|
|
66
|
+
readonly expiresAt?: number;
|
|
67
|
+
}
|
|
68
|
+
/** 3-legged consent is required: surface `authorizationUrl` to the user, then
|
|
69
|
+
* retry `getCredential` after they authorize (`sessionId` correlates the flow). */
|
|
70
|
+
export interface CredentialAuthorizationRequired {
|
|
71
|
+
readonly status: 'authorization-required';
|
|
72
|
+
readonly authorizationUrl: string;
|
|
73
|
+
readonly sessionId: string;
|
|
74
|
+
}
|
|
75
|
+
export type CredentialResult = CredentialIssued | CredentialAuthorizationRequired;
|
|
76
|
+
/**
|
|
77
|
+
* The port. An adapter implements this against a specific identity backend.
|
|
78
|
+
*
|
|
79
|
+
* **Security contract for implementers:** a thrown error's `message` is surfaced
|
|
80
|
+
* to the LLM (as the tool result) AND emitted on `agentfootprint.credential.failed`
|
|
81
|
+
* — so a provider MUST NOT include the secret/token (or an `Authorization` header)
|
|
82
|
+
* in thrown error messages. (Some OAuth/HTTP SDKs echo request details into 401/403
|
|
83
|
+
* text — scrub those before throwing.) Defence in depth: consumers can also apply
|
|
84
|
+
* footprintjs `RedactionPolicy.emitPatterns: [/credential\.failed/]`.
|
|
85
|
+
*/
|
|
86
|
+
export interface CredentialProvider {
|
|
87
|
+
/** Stable id (for logging / "which provider vended this"). */
|
|
88
|
+
readonly id: string;
|
|
89
|
+
getCredential(req: CredentialRequest): Promise<CredentialResult>;
|
|
90
|
+
}
|
|
91
|
+
/** Narrow a {@link CredentialResult} to the issued-credential branch. */
|
|
92
|
+
export declare function isCredentialIssued(r: CredentialResult): r is CredentialIssued;
|
|
93
|
+
/**
|
|
94
|
+
* What a tool DECLARES it needs (declare-and-push). The framework resolves this
|
|
95
|
+
* with the attached provider BEFORE invoking the tool, and injects the result as
|
|
96
|
+
* `ctx.credential`. `credential` is the service id the provider understands.
|
|
97
|
+
*/
|
|
98
|
+
export interface CredentialNeed {
|
|
99
|
+
readonly credential: string;
|
|
100
|
+
readonly scopes?: readonly string[];
|
|
101
|
+
/** `machine` = 2-legged/M2M; `user` = 3-legged on-behalf-of-user (consent).
|
|
102
|
+
* **Omitted → `machine`** — declare `mode: 'user'` explicitly for delegated
|
|
103
|
+
* access, or you'll silently get a machine token. */
|
|
104
|
+
readonly mode?: 'machine' | 'user';
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A fail-closed {@link CredentialProvider} used when none is attached. Every call
|
|
108
|
+
* throws loudly — so `ctx.credentials` is never `undefined` (no silent
|
|
109
|
+
* optional-chaining bypass), and a tool that needs a credential without one
|
|
110
|
+
* configured fails LOUD, not open. Use `ctx.hasCredentials` to branch when a tool
|
|
111
|
+
* intentionally supports a no-credential (degraded) mode.
|
|
112
|
+
*/
|
|
113
|
+
export declare function unconfiguredCredentialProvider(): CredentialProvider;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* withCredentialRetry — CredentialProvider decorator that retries transient
|
|
3
|
+
* `getCredential` failures with exponential backoff.
|
|
4
|
+
*
|
|
5
|
+
* Pattern: Decorator (GoF) — the credential twin of `withRetry` (resilience)
|
|
6
|
+
* for LLM providers. SAME option vocabulary (`maxAttempts` /
|
|
7
|
+
* `initialDelayMs` / `backoffFactor` / `maxDelayMs` / `shouldRetry` /
|
|
8
|
+
* `onRetry`) and the SAME default transience policy (the shared
|
|
9
|
+
* `defaultShouldRetry`: skip AbortError + 4xx except 429; retry 5xx,
|
|
10
|
+
* network errors, unknown shapes). AgentCore's documented transient
|
|
11
|
+
* errors (`InternalServerException` 500, `ThrottlingException` 429)
|
|
12
|
+
* retry out of the box.
|
|
13
|
+
*
|
|
14
|
+
* Why a decorator and not a reliability rule: the rules-based reliability
|
|
15
|
+
* subsystem (`Agent.create(...).reliability({...})`) is LLM-call-scoped —
|
|
16
|
+
* `ReliabilityScope` carries `request: LLMRequest` and the gate chart loops
|
|
17
|
+
* around the CallLLM stage with provider failover. Credential resolution
|
|
18
|
+
* happens at a different boundary (the tool-dispatch loop, declare-and-push);
|
|
19
|
+
* promoting it to a chart-level gate is the deferred `sf-credential` node.
|
|
20
|
+
* Until that exists, retry is a TRANSPORT property of the credential provider
|
|
21
|
+
* — exactly like `withRetry` is for LLM transports.
|
|
22
|
+
*
|
|
23
|
+
* Semantics:
|
|
24
|
+
* • Only THROWN errors retry. Both result branches return immediately:
|
|
25
|
+
* `issued` is success; `authorization-required` is a HUMAN flow (3LO
|
|
26
|
+
* consent), not a transient fault — retrying it would hammer the IdP
|
|
27
|
+
* without the user having authorized anything.
|
|
28
|
+
* • After retries exhaust, the LAST error is rethrown — the call site
|
|
29
|
+
* behaves byte-identically to an unwrapped provider (fail-closed:
|
|
30
|
+
* `agentfootprint.credential.failed` emit + error tool result; the tool
|
|
31
|
+
* does NOT run).
|
|
32
|
+
* • Visibility: the agent trace brackets the whole retried resolution with
|
|
33
|
+
* `credential.requested` → `credential.acquired` / `credential.failed`.
|
|
34
|
+
* Per-attempt visibility is consumer-wired via `onRetry` — the established
|
|
35
|
+
* decorator contract (same as `withRetry`; the `agentfootprint.error.*`
|
|
36
|
+
* event family is reserved for these decorators, see events/payloads.ts).
|
|
37
|
+
* No new event types.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* import { agentCoreIdentity, withCredentialRetry } from 'agentfootprint/identity';
|
|
41
|
+
*
|
|
42
|
+
* const credentials = withCredentialRetry(agentCoreIdentity({ region: 'us-east-1' }), {
|
|
43
|
+
* maxAttempts: 3,
|
|
44
|
+
* onRetry: (err, attempt, ms) => console.warn(`credential retry ${attempt} in ${ms}ms`, err),
|
|
45
|
+
* });
|
|
46
|
+
* const agent = Agent.create({ provider, model, credentials }).tools([...]).build();
|
|
47
|
+
*/
|
|
48
|
+
import { type WithRetryOptions } from '../resilience/withRetry.js';
|
|
49
|
+
import type { CredentialProvider } from './types.js';
|
|
50
|
+
/**
|
|
51
|
+
* Same vocabulary as the LLM-provider `withRetry` — one retry language across
|
|
52
|
+
* both decorators. `shouldRetry` sees only THROWN errors (never an
|
|
53
|
+
* `authorization-required` result, which returns immediately).
|
|
54
|
+
*/
|
|
55
|
+
export type WithCredentialRetryOptions = WithRetryOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Wrap a {@link CredentialProvider} so transient `getCredential` failures
|
|
58
|
+
* retry with exponential backoff before failing closed.
|
|
59
|
+
*
|
|
60
|
+
* Defaults mirror `withRetry`: 3 attempts total, 200ms → 400ms → 800ms
|
|
61
|
+
* backoff capped at 10s, retry on 5xx/429/network/unknown, never on
|
|
62
|
+
* AbortError or other 4xx.
|
|
63
|
+
*/
|
|
64
|
+
export declare function withCredentialRetry(provider: CredentialProvider, options?: WithCredentialRetryOptions): CredentialProvider;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentfootprint/identity — outbound credential vending for agent tools.
|
|
3
|
+
*
|
|
4
|
+
* The {@link CredentialProvider} port + adapters. A tool calls
|
|
5
|
+
* `provider.getCredential({ service })` to get a token for a downstream service;
|
|
6
|
+
* `agentCoreIdentity()` backs it with AWS Bedrock AgentCore Identity, or
|
|
7
|
+
* `staticTokens()` for dev/test.
|
|
8
|
+
*
|
|
9
|
+
* SECURITY: a vended token is a secret — use it locally inside a tool's
|
|
10
|
+
* `execute` (e.g. an HTTP header); never write it to tracked scope. See
|
|
11
|
+
* `./identity/types` for the full invariant.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { agentCoreIdentity } from 'agentfootprint/identity';
|
|
16
|
+
*
|
|
17
|
+
* const credentials = agentCoreIdentity({ region: 'us-east-1' });
|
|
18
|
+
* const r = await credentials.getCredential({ service: 'github', mode: 'user', scopes: ['repo'] });
|
|
19
|
+
* if (r.status === 'authorization-required') {
|
|
20
|
+
* // surface r.authorizationUrl to the user (e.g. pause the run), then retry.
|
|
21
|
+
* } else {
|
|
22
|
+
* callGitHub({ headers: r.credential.toHeaders() }); // universal applicator
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export type { Credential, CredentialProvider, CredentialRequest, CredentialResult, CredentialIssued, CredentialAuthorizationRequired, CredentialNeed, } from './identity/types.js';
|
|
27
|
+
export { isCredentialIssued, unconfiguredCredentialProvider } from './identity/types.js';
|
|
28
|
+
export { bearer, apiKey, basic, headers, type BearerCredential, type ApiKeyCredential, type BasicCredential, type HeadersCredential, } from './identity/kinds.js';
|
|
29
|
+
export { staticTokens, type StaticTokensOptions } from './identity/staticTokens.js';
|
|
30
|
+
export { withCredentialRetry, type WithCredentialRetryOptions, } from './identity/withCredentialRetry.js';
|
|
31
|
+
export { agentCoreIdentity, type AgentCoreIdentityOptions, type AgentCoreIdentityClientLike, type AgentCoreOauthResponse, } from './adapters/identity/agentcore.js';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentfootprint — public barrel.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: Facade (GoF) over the typed sublayers.
|
|
5
|
+
* Role: Single entry point consumers import from.
|
|
6
|
+
* Emits: N/A.
|
|
7
|
+
*/
|
|
8
|
+
import './cache/strategies/AnthropicCacheStrategy.js';
|
|
9
|
+
import './cache/strategies/OpenAICacheStrategy.js';
|
|
10
|
+
import './cache/strategies/BedrockCacheStrategy.js';
|
|
11
|
+
export type { CombinedRecorder, ScopeRecorder, FlowRecorder, EmitRecorder, WriteEvent, ReadEvent, CommitEvent, StageEvent, ErrorEvent, FlowStageEvent, FlowNextEvent, FlowDecisionEvent, FlowForkEvent, FlowSelectedEvent, FlowSubflowEvent, FlowSubflowRegisteredEvent, FlowLoopEvent, FlowBreakEvent, FlowErrorEvent, TraversalContext, EmitEvent, RedactionPolicy, RedactionReport, } from 'footprintjs';
|
|
12
|
+
export * from './events/types.js';
|
|
13
|
+
export type * as Payloads from './events/payloads.js';
|
|
14
|
+
export { EVENT_NAMES, ALL_EVENT_TYPES, type AgentfootprintEvent, type AgentfootprintEventMap, type AgentfootprintEventType, } from './events/registry.js';
|
|
15
|
+
export { EventDispatcher, type EventListener, type WildcardListener, type ListenOptions, type Unsubscribe, type DomainWildcard, type AllWildcard, type WildcardSubscription, } from './events/dispatcher.js';
|
|
16
|
+
export * from './adapters/types.js';
|
|
17
|
+
export { INJECTION_KEYS, injectionKeyForSlot, isInjectionKey, type InjectionKey, stageRole, type StageRole, milestoneFor, type Milestone, type MilestoneKind, } from './conventions.js';
|
|
18
|
+
export { COMPOSITION_KEYS, type BudgetPressureRecord, type CompositionKey, type EvictionRecord, type InjectionRecord, type SlotComposition, } from './recorders/core/types.js';
|
|
19
|
+
export { buildEventMeta, parseSubflowPath, type RunContext } from './bridge/eventMeta.js';
|
|
20
|
+
export { contextEngineering, isEngineeredSource, isBaselineSource, ENGINEERED_SOURCES, BASELINE_SOURCES, type ContextEngineeringHandle, type ContextEngineeringUnsubscribe, type ContextInjectedEvent, type ContextInjectedListener, } from './recorders/core/contextEngineering.js';
|
|
21
|
+
export { EmitBridge, type EmitBridgeOptions } from './recorders/core/EmitBridge.js';
|
|
22
|
+
export { typedEmit } from './recorders/core/typedEmit.js';
|
|
23
|
+
export type { EmittedEvent, EnableNamespace, Runner } from './core/runner.js';
|
|
24
|
+
export { RunnerBase, makeRunId } from './core/RunnerBase.js';
|
|
25
|
+
export type { GroupKind, GroupMember, GroupMetadata, GroupTranslator } from './core/translator.js';
|
|
26
|
+
export { pauseHere, askHuman, isPauseRequest, isPaused, type RunnerPauseOutcome, } from './core/pause.js';
|
|
27
|
+
export type { FlowchartHandle, FlowchartOptions, } from './recorders/observability/FlowchartRecorder.js';
|
|
28
|
+
export { defaultCommentaryTemplates, extractAgentName, extractCommentaryVars, renderCommentary, selectCommentaryKey, type CommentaryContext, type CommentaryTemplates, } from './recorders/observability/commentary/commentaryTemplates.js';
|
|
29
|
+
export { defaultStatusTemplates, selectStatus, renderStatusLine, type StatusContext, type StatusState, type StatusKind, type StatusTemplates, } from './recorders/observability/status/statusTemplates.js';
|
|
30
|
+
export { LLMCall, LLMCallBuilder, type LLMCallInput, type LLMCallOptions, type LLMCallOutput, } from './core/LLMCall.js';
|
|
31
|
+
export { buildMessageApiChart, type MessageApiChartDeps, } from './core/agent/buildMessageApiChart.js';
|
|
32
|
+
export { buildAgentMessageApiChart, type AgentMessageApiChartDeps, } from './core/agent/buildAgentMessageApiChart.js';
|
|
33
|
+
export { Agent, AgentBuilder, type AgentInput, type AgentOptions, type AgentOutput, type ObserverDeliveryOptions, } from './core/Agent.js';
|
|
34
|
+
export type { SelfExplainOptions } from './lib/trace-toolpack/selfExplain.js';
|
|
35
|
+
export type { ObserverDrainResult, ObserverStats } from 'footprintjs';
|
|
36
|
+
export type { ToolArgValidationMode } from './core/agent/toolArgsValidation.js';
|
|
37
|
+
export type { ReadSummaryMarker, ReadTrackingMode } from 'footprintjs';
|
|
38
|
+
export { OutputSchemaError, applyOutputSchema, buildDefaultInstruction, type OutputSchemaParser, type OutputSchemaOptions, } from './core/outputSchema.js';
|
|
39
|
+
export { type OutputFallbackOptions, type OutputFallbackFn } from './core/outputFallback.js';
|
|
40
|
+
export { RunCheckpointError, type AgentRunCheckpoint } from './core/runCheckpoint.js';
|
|
41
|
+
export { flowchartAsTool, type FlowchartAsToolOptions, type FlowchartResultMapper, type FlowchartToolSnapshot, } from './core/flowchartAsTool.js';
|
|
42
|
+
export type { Tool, ToolExecutionContext, ToolRegistryEntry, DefineToolOptions, } from './core/tools.js';
|
|
43
|
+
export { defineTool, assertValidToolName, warnIfInvalidToolName } from './core/tools.js';
|
|
44
|
+
export { toolContractCheckup, formatToolContractCheckup, type ToolContractCheckup, type ToolContractProblem, type ToolContractCode, type ServerToolEntry, } from './core/toolContract.js';
|
|
45
|
+
export { Sequence, SequenceBuilder, type SequenceInput, type SequenceOptions, type SequenceOutput, } from './core-flow/Sequence.js';
|
|
46
|
+
export { Parallel, ParallelBuilder, type BranchOutcome, type MergeFn, type MergeOutcomesFn, type MergeWithLLMOptions, type ParallelBranchOptions, type ParallelInput, type ParallelOptions, type ParallelOutput, } from './core-flow/Parallel.js';
|
|
47
|
+
export { Conditional, ConditionalBuilder, type ConditionalInput, type ConditionalOptions, type ConditionalOutput, type Predicate, } from './core-flow/Conditional.js';
|
|
48
|
+
export { Loop, LoopBuilder, type LoopInput, type LoopOptions, type LoopOutput, type UntilGuard, } from './core-flow/Loop.js';
|
|
49
|
+
export { MockProvider, mock, type MockProviderOptions, type MockReply, } from './adapters/llm/MockProvider.js';
|
|
50
|
+
export { browserAnthropic, BrowserAnthropicProvider, type BrowserAnthropicProviderOptions, } from './adapters/llm/BrowserAnthropicProvider.js';
|
|
51
|
+
export { browserOpenai, BrowserOpenAIProvider, type BrowserOpenAIProviderOptions, browserAzureOpenai, BrowserAzureOpenAIProvider, type BrowserAzureOpenAIProviderOptions, } from './adapters/llm/BrowserOpenAIProvider.js';
|
|
52
|
+
export { createProvider, providerFromEnv, type ProviderKind, type CreateProviderOptions, type ProviderFromEnv, } from './adapters/llm/createProvider.js';
|
|
53
|
+
export { toSSE, SSEFormatter, encodeSSE, type ToSSEOptions } from './stream.js';
|
|
54
|
+
export { type Injection, type InjectionTrigger, type InjectionContent, type InjectionContext, type InjectionEvaluation, evaluateInjections, buildInjectionEngineSubflow, projectActiveInjection, type InjectionEngineConfig, type ActiveInjection, defineInstruction, type DefineInstructionOptions, defineRelevanceHint, type RelevanceHintOptions, defineSkill, resolveSurfaceMode, SkillRegistry, type SkillRegistryOptions, buildListSkillsTool, buildReadSkillTool, type SkillToolPair, type DefineSkillOptions, type SurfaceMode, type RefreshPolicy, type AutoActivateMode, defineSteering, type DefineSteeringOptions, defineFact, type DefineFactOptions, defineInjection, type DefineInjectionOptions, type InjectionFlavor, skillGraph, decide, SKILL_GRAPH_METADATA_KEY, type SkillGraph, type SkillGraphBuilder, type SkillRouteOptions, type SkillEntryOptions, type TreeOptions, type SkillEdge, type SkillEdgeKind, type SkillNode, type DecisionNode, type SkillRouting, type SkillRoutingStep, type EntryScore, type EntryScoring, type SkillGraphConfig, type BuildOptions, type GraphCheckMode, type GraphCheckup, type GraphProblem, type GraphProblemCode, keywordScorer, embeddingScorer, rankEntries, type EntryScorer, type EntryScorerInput, type EntryCandidate, checkSkillContract, checkSkillContracts, skillToolNames, } from './lib/injection-engine/index.js';
|
|
55
|
+
export * from './patterns/index.js';
|
|
56
|
+
export { defaultPipeline, ephemeralPipeline, factPipeline, narrativePipeline, semanticPipeline, autoPipeline, } from './memory/pipeline/index.js';
|
|
57
|
+
export { heuristicExtractor, llmExtractor, } from './memory/beats/index.js';
|
|
58
|
+
export { patternFactExtractor, llmFactExtractor, } from './memory/facts/index.js';
|
|
59
|
+
export { defineMemory, MEMORY_TYPES, MEMORY_STRATEGIES, MEMORY_TIMING, SNAPSHOT_PROJECTIONS, type MemoryType, type MemoryStrategyKind, type MemoryTiming, type SnapshotProjection, type Strategy, type MemoryDefinition, type DefineMemoryOptions, InMemoryStore, mockEmbedder, identityNamespace, type MemoryIdentity, type Embedder, } from './memory/index.js';
|
|
60
|
+
export { defineRAG, type DefineRAGOptions, indexDocuments, type IndexDocumentsOptions, type RagDocument, } from './lib/rag/index.js';
|
|
61
|
+
export { mcpClient, mockMcpClient, type McpClient, type McpClientOptions, type McpHttpTransport, type McpStdioTransport, type McpTransport, type McpSdkClient, type MockMcpClientOptions, type MockMcpTool, } from './lib/mcp/index.js';
|
|
62
|
+
export { staticTools, gatedTools, skillScopedTools, type ToolProvider, type ToolDispatchContext, type ToolGatePredicate, } from './tool-providers/index.js';
|
|
63
|
+
export { PermissionPolicy, PolicyHaltError, type PolicyHaltContext, type RoleAllowlist, type PermissionPolicyOptions, } from './security/index.js';
|
|
64
|
+
export { defaultCommentaryMessages, defaultThinkingMessages, composeMessages, validateMessages, type MessageCatalog, } from './locales/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -136,6 +136,8 @@ defineInstruction, defineRelevanceHint, defineSkill, resolveSurfaceMode, SkillRe
|
|
|
136
136
|
defineInjection,
|
|
137
137
|
// Declarative skill graph (proposal 002)
|
|
138
138
|
skillGraph, decide, SKILL_GRAPH_METADATA_KEY,
|
|
139
|
+
// Pluggable entry-relevance scorer strategy + built-ins (keyword / embedding)
|
|
140
|
+
keywordScorer, embeddingScorer, rankEntries,
|
|
139
141
|
// Proposal 009 Tier 1 — skill-body ↔ tool-contract consistency check
|
|
140
142
|
checkSkillContract, checkSkillContracts, skillToolNames, } from './lib/injection-engine/index.js';
|
|
141
143
|
// Patterns — factory functions composing primitives + core-flow into
|