@illuma-ai/agents 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/agents/AgentContext.cjs +2 -2
- package/dist/cjs/agents/AgentContext.cjs.map +1 -1
- package/dist/cjs/common/enum.cjs +12 -12
- package/dist/cjs/common/enum.cjs.map +1 -1
- package/dist/cjs/graphs/Graph.cjs +5 -5
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/graphs/MultiAgentGraph.cjs +1 -1
- package/dist/cjs/graphs/MultiAgentGraph.cjs.map +1 -1
- package/dist/cjs/graphs/phases/memoryFlushPhase.cjs +1 -1
- package/dist/cjs/graphs/phases/memoryFlushPhase.cjs.map +1 -1
- package/dist/cjs/hooks/HookRegistry.cjs +1 -1
- package/dist/cjs/hooks/HookRegistry.cjs.map +1 -1
- package/dist/cjs/hooks/matchers.cjs +2 -2
- package/dist/cjs/hooks/matchers.cjs.map +1 -1
- package/dist/cjs/hooks/types.cjs +1 -1
- package/dist/cjs/hooks/types.cjs.map +1 -1
- package/dist/cjs/llm/bedrock/cacheSupport.cjs +1 -1
- package/dist/cjs/llm/bedrock/cacheSupport.cjs.map +1 -1
- package/dist/cjs/llm/bedrock/index.cjs +2 -2
- package/dist/cjs/llm/bedrock/index.cjs.map +1 -1
- package/dist/cjs/llm/openai/index.cjs +1 -1
- package/dist/cjs/llm/openai/index.cjs.map +1 -1
- package/dist/cjs/llm/openai/utils/index.cjs +2 -2
- package/dist/cjs/llm/openai/utils/index.cjs.map +1 -1
- package/dist/cjs/memory/citations.cjs +4 -4
- package/dist/cjs/memory/citations.cjs.map +1 -1
- package/dist/cjs/memory/constants.cjs +17 -17
- package/dist/cjs/memory/constants.cjs.map +1 -1
- package/dist/cjs/memory/mmr.cjs +1 -1
- package/dist/cjs/memory/mmr.cjs.map +1 -1
- package/dist/cjs/memory/paths.cjs +1 -1
- package/dist/cjs/memory/paths.cjs.map +1 -1
- package/dist/cjs/memory/recallTracking.cjs +3 -3
- package/dist/cjs/memory/recallTracking.cjs.map +1 -1
- package/dist/cjs/memory/temporalDecay.cjs +2 -2
- package/dist/cjs/memory/temporalDecay.cjs.map +1 -1
- package/dist/cjs/messages/format.cjs +3 -3
- package/dist/cjs/messages/format.cjs.map +1 -1
- package/dist/cjs/tools/CodeExecutor.cjs +4 -3
- package/dist/cjs/tools/CodeExecutor.cjs.map +1 -1
- package/dist/cjs/tools/ToolNode.cjs +5 -5
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/memory/memoryAppendTool.cjs +1 -1
- package/dist/cjs/tools/memory/memoryAppendTool.cjs.map +1 -1
- package/dist/cjs/tools/memory/memoryGetTool.cjs +2 -2
- package/dist/cjs/tools/memory/memoryGetTool.cjs.map +1 -1
- package/dist/cjs/tools/memory/memorySearchTool.cjs +3 -3
- package/dist/cjs/tools/memory/memorySearchTool.cjs.map +1 -1
- package/dist/cjs/tools/memory/shared.cjs +1 -1
- package/dist/cjs/tools/memory/shared.cjs.map +1 -1
- package/dist/cjs/types/agent-cache.cjs +6 -5
- package/dist/cjs/types/agent-cache.cjs.map +1 -1
- package/dist/cjs/types/graph.cjs.map +1 -1
- package/dist/esm/agents/AgentContext.mjs +2 -2
- package/dist/esm/agents/AgentContext.mjs.map +1 -1
- package/dist/esm/common/enum.mjs +12 -12
- package/dist/esm/common/enum.mjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +5 -5
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/graphs/MultiAgentGraph.mjs +1 -1
- package/dist/esm/graphs/MultiAgentGraph.mjs.map +1 -1
- package/dist/esm/graphs/phases/memoryFlushPhase.mjs +1 -1
- package/dist/esm/graphs/phases/memoryFlushPhase.mjs.map +1 -1
- package/dist/esm/hooks/HookRegistry.mjs +1 -1
- package/dist/esm/hooks/HookRegistry.mjs.map +1 -1
- package/dist/esm/hooks/matchers.mjs +2 -2
- package/dist/esm/hooks/matchers.mjs.map +1 -1
- package/dist/esm/hooks/types.mjs +1 -1
- package/dist/esm/hooks/types.mjs.map +1 -1
- package/dist/esm/llm/bedrock/cacheSupport.mjs +1 -1
- package/dist/esm/llm/bedrock/cacheSupport.mjs.map +1 -1
- package/dist/esm/llm/bedrock/index.mjs +2 -2
- package/dist/esm/llm/bedrock/index.mjs.map +1 -1
- package/dist/esm/llm/openai/index.mjs +1 -1
- package/dist/esm/llm/openai/index.mjs.map +1 -1
- package/dist/esm/llm/openai/utils/index.mjs +2 -2
- package/dist/esm/llm/openai/utils/index.mjs.map +1 -1
- package/dist/esm/memory/citations.mjs +4 -4
- package/dist/esm/memory/citations.mjs.map +1 -1
- package/dist/esm/memory/constants.mjs +17 -17
- package/dist/esm/memory/constants.mjs.map +1 -1
- package/dist/esm/memory/mmr.mjs +1 -1
- package/dist/esm/memory/mmr.mjs.map +1 -1
- package/dist/esm/memory/paths.mjs +1 -1
- package/dist/esm/memory/paths.mjs.map +1 -1
- package/dist/esm/memory/recallTracking.mjs +3 -3
- package/dist/esm/memory/recallTracking.mjs.map +1 -1
- package/dist/esm/memory/temporalDecay.mjs +2 -2
- package/dist/esm/memory/temporalDecay.mjs.map +1 -1
- package/dist/esm/messages/format.mjs +3 -3
- package/dist/esm/messages/format.mjs.map +1 -1
- package/dist/esm/tools/CodeExecutor.mjs +4 -3
- package/dist/esm/tools/CodeExecutor.mjs.map +1 -1
- package/dist/esm/tools/ToolNode.mjs +5 -5
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/memory/memoryAppendTool.mjs +1 -1
- package/dist/esm/tools/memory/memoryAppendTool.mjs.map +1 -1
- package/dist/esm/tools/memory/memoryGetTool.mjs +2 -2
- package/dist/esm/tools/memory/memoryGetTool.mjs.map +1 -1
- package/dist/esm/tools/memory/memorySearchTool.mjs +3 -3
- package/dist/esm/tools/memory/memorySearchTool.mjs.map +1 -1
- package/dist/esm/tools/memory/shared.mjs +1 -1
- package/dist/esm/tools/memory/shared.mjs.map +1 -1
- package/dist/esm/types/agent-cache.mjs +6 -5
- package/dist/esm/types/agent-cache.mjs.map +1 -1
- package/dist/esm/types/graph.mjs.map +1 -1
- package/dist/types/agents/AgentContext.d.ts +1 -1
- package/dist/types/common/enum.d.ts +12 -12
- package/dist/types/graphs/Graph.d.ts +2 -2
- package/dist/types/graphs/phases/memoryFlushPhase.d.ts +2 -2
- package/dist/types/hooks/HookRegistry.d.ts +1 -1
- package/dist/types/hooks/matchers.d.ts +2 -2
- package/dist/types/hooks/types.d.ts +1 -1
- package/dist/types/llm/bedrock/cacheSupport.d.ts +1 -1
- package/dist/types/llm/bedrock/index.d.ts +2 -2
- package/dist/types/llm/openai/index.d.ts +1 -1
- package/dist/types/memory/citations.d.ts +4 -4
- package/dist/types/memory/constants.d.ts +17 -17
- package/dist/types/memory/mmr.d.ts +3 -3
- package/dist/types/memory/paths.d.ts +1 -1
- package/dist/types/memory/temporalDecay.d.ts +2 -2
- package/dist/types/memory/types.d.ts +3 -3
- package/dist/types/messages/format.d.ts +1 -1
- package/dist/types/tools/ToolNode.d.ts +3 -3
- package/dist/types/tools/memory/shared.d.ts +1 -1
- package/dist/types/types/agent-cache.d.ts +6 -5
- package/dist/types/types/graph.d.ts +7 -6
- package/dist/types/types/messages.d.ts +1 -1
- package/dist/types/types/run.d.ts +1 -1
- package/dist/types/types/tools.d.ts +5 -5
- package/package.json +1 -1
- package/src/agents/AgentContext.ts +2 -2
- package/src/agents/__tests__/AgentContext.crossAgentTier1.live.test.ts +5 -3
- package/src/agents/__tests__/AgentContext.test.ts +1 -1
- package/src/common/__tests__/enum.test.ts +1 -1
- package/src/common/enum.ts +12 -12
- package/src/graphs/Graph.ts +5 -5
- package/src/graphs/MultiAgentGraph.ts +1 -1
- package/src/graphs/gapFeatures.test.ts +1 -1
- package/src/graphs/phases/__tests__/memoryFlushPhase.test.ts +1 -1
- package/src/graphs/phases/memoryFlushPhase.ts +2 -2
- package/src/hooks/HookRegistry.ts +1 -1
- package/src/hooks/index.ts +1 -1
- package/src/hooks/matchers.ts +2 -2
- package/src/hooks/types.ts +1 -1
- package/src/llm/anthropic/utils/server-tool-inputs.test.ts +7 -7
- package/src/llm/bedrock/__tests__/bedrock-caching.test.ts +2 -2
- package/src/llm/bedrock/cacheSupport.ts +1 -1
- package/src/llm/bedrock/index.ts +2 -2
- package/src/llm/openai/index.ts +2 -2
- package/src/llm/openai/utils/index.ts +2 -2
- package/src/memory/citations.ts +4 -4
- package/src/memory/constants.ts +17 -17
- package/src/memory/mmr.ts +3 -3
- package/src/memory/paths.ts +1 -1
- package/src/memory/recallTracking.ts +3 -3
- package/src/memory/temporalDecay.ts +2 -2
- package/src/memory/types.ts +3 -3
- package/src/messages/cache.test.ts +1 -1
- package/src/messages/ensureThinkingBlock.test.ts +1 -1
- package/src/messages/format.ts +4 -4
- package/src/messages/formatAgentMessages.test.ts +1 -1
- package/src/scripts/subagent-event-driven-debug.ts +2 -2
- package/src/specs/anthropic.simple.test.ts +1 -1
- package/src/specs/prune.orphans.test.ts +1 -1
- package/src/tools/CodeExecutor.ts +4 -3
- package/src/tools/ToolNode.ts +6 -6
- package/src/tools/__tests__/CodeExecutor.test.ts +3 -3
- package/src/tools/memory/memoryAppendTool.ts +1 -1
- package/src/tools/memory/memoryGetTool.ts +2 -2
- package/src/tools/memory/memorySearchTool.ts +3 -3
- package/src/tools/memory/shared.ts +1 -1
- package/src/types/agent-cache.ts +6 -5
- package/src/types/graph.ts +7 -6
- package/src/types/messages.ts +1 -1
- package/src/types/run.ts +1 -1
- package/src/types/tools.ts +5 -5
- package/dist/types/tools/search/test.d.ts +0 -1
- package/src/agents/AgentContext.js.map +0 -1
- package/src/agents/AgentContext.test.js.map +0 -1
- package/src/agents/__tests__/AgentContext.test.js.map +0 -1
- package/src/agents/__tests__/resolveStructuredOutputMode.test.js.map +0 -1
- package/src/common/enum.js.map +0 -1
- package/src/common/index.js.map +0 -1
- package/src/events.js.map +0 -1
- package/src/graphs/Graph.js.map +0 -1
- package/src/graphs/MultiAgentGraph.js.map +0 -1
- package/src/graphs/__tests__/structured-output.integration.test.js.map +0 -1
- package/src/graphs/__tests__/structured-output.test.js.map +0 -1
- package/src/graphs/contextManagement.e2e.test.js.map +0 -1
- package/src/graphs/contextManagement.test.js.map +0 -1
- package/src/graphs/handoffValidation.test.js.map +0 -1
- package/src/graphs/index.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/instrumentation.js.map +0 -1
- package/src/llm/anthropic/index.js.map +0 -1
- package/src/llm/anthropic/types.js.map +0 -1
- package/src/llm/anthropic/utils/message_inputs.js.map +0 -1
- package/src/llm/anthropic/utils/message_outputs.js.map +0 -1
- package/src/llm/anthropic/utils/output_parsers.js.map +0 -1
- package/src/llm/anthropic/utils/tools.js.map +0 -1
- package/src/llm/bedrock/__tests__/bedrock-caching.test.js.map +0 -1
- package/src/llm/bedrock/index.js.map +0 -1
- package/src/llm/bedrock/types.js.map +0 -1
- package/src/llm/bedrock/utils/index.js.map +0 -1
- package/src/llm/bedrock/utils/message_inputs.js.map +0 -1
- package/src/llm/bedrock/utils/message_outputs.js.map +0 -1
- package/src/llm/fake.js.map +0 -1
- package/src/llm/google/index.js.map +0 -1
- package/src/llm/google/types.js.map +0 -1
- package/src/llm/google/utils/common.js.map +0 -1
- package/src/llm/google/utils/tools.js.map +0 -1
- package/src/llm/google/utils/zod_to_genai_parameters.js.map +0 -1
- package/src/llm/openai/index.js.map +0 -1
- package/src/llm/openai/types.js.map +0 -1
- package/src/llm/openai/utils/index.js.map +0 -1
- package/src/llm/openai/utils/isReasoningModel.test.js.map +0 -1
- package/src/llm/openrouter/index.js.map +0 -1
- package/src/llm/openrouter/reasoning.test.js.map +0 -1
- package/src/llm/providers.js.map +0 -1
- package/src/llm/text.js.map +0 -1
- package/src/llm/vertexai/index.js.map +0 -1
- package/src/messages/__tests__/tools.test.js.map +0 -1
- package/src/messages/cache.js.map +0 -1
- package/src/messages/cache.test.js.map +0 -1
- package/src/messages/content.js.map +0 -1
- package/src/messages/content.test.js.map +0 -1
- package/src/messages/core.js.map +0 -1
- package/src/messages/ensureThinkingBlock.test.js.map +0 -1
- package/src/messages/format.js.map +0 -1
- package/src/messages/formatAgentMessages.test.js.map +0 -1
- package/src/messages/formatAgentMessages.tools.test.js.map +0 -1
- package/src/messages/formatMessage.test.js.map +0 -1
- package/src/messages/ids.js.map +0 -1
- package/src/messages/index.js.map +0 -1
- package/src/messages/labelContentByAgent.test.js.map +0 -1
- package/src/messages/prune.js.map +0 -1
- package/src/messages/reducer.js.map +0 -1
- package/src/messages/shiftIndexTokenCountMap.test.js.map +0 -1
- package/src/messages/summarize.js.map +0 -1
- package/src/messages/summarize.test.js.map +0 -1
- package/src/messages/tools.js.map +0 -1
- package/src/mockStream.js.map +0 -1
- package/src/prompts/collab.js.map +0 -1
- package/src/prompts/index.js.map +0 -1
- package/src/prompts/taskmanager.js.map +0 -1
- package/src/run.js.map +0 -1
- package/src/schemas/index.js.map +0 -1
- package/src/schemas/schema-preparation.test.js.map +0 -1
- package/src/schemas/validate.js.map +0 -1
- package/src/schemas/validate.test.js.map +0 -1
- package/src/scripts/abort.js.map +0 -1
- package/src/scripts/ant_web_search.js.map +0 -1
- package/src/scripts/ant_web_search_edge_case.js.map +0 -1
- package/src/scripts/ant_web_search_error_edge_case.js.map +0 -1
- package/src/scripts/args.js.map +0 -1
- package/src/scripts/bedrock-cache-debug.js.map +0 -1
- package/src/scripts/bedrock-content-aggregation-test.js.map +0 -1
- package/src/scripts/bedrock-merge-test.js.map +0 -1
- package/src/scripts/bedrock-parallel-tools-test.js.map +0 -1
- package/src/scripts/caching.js.map +0 -1
- package/src/scripts/cli.js.map +0 -1
- package/src/scripts/cli2.js.map +0 -1
- package/src/scripts/cli3.js.map +0 -1
- package/src/scripts/cli4.js.map +0 -1
- package/src/scripts/cli5.js.map +0 -1
- package/src/scripts/code_exec.js.map +0 -1
- package/src/scripts/code_exec_files.js.map +0 -1
- package/src/scripts/code_exec_multi_session.js.map +0 -1
- package/src/scripts/code_exec_ptc.js.map +0 -1
- package/src/scripts/code_exec_session.js.map +0 -1
- package/src/scripts/code_exec_simple.js.map +0 -1
- package/src/scripts/content.js.map +0 -1
- package/src/scripts/empty_input.js.map +0 -1
- package/src/scripts/handoff-test.js.map +0 -1
- package/src/scripts/image.js.map +0 -1
- package/src/scripts/memory.js.map +0 -1
- package/src/scripts/multi-agent-chain.js.map +0 -1
- package/src/scripts/multi-agent-conditional.js.map +0 -1
- package/src/scripts/multi-agent-document-review-chain.js.map +0 -1
- package/src/scripts/multi-agent-hybrid-flow.js.map +0 -1
- package/src/scripts/multi-agent-parallel-start.js.map +0 -1
- package/src/scripts/multi-agent-parallel.js.map +0 -1
- package/src/scripts/multi-agent-sequence.js.map +0 -1
- package/src/scripts/multi-agent-supervisor.js.map +0 -1
- package/src/scripts/multi-agent-test.js.map +0 -1
- package/src/scripts/parallel-asymmetric-tools-test.js.map +0 -1
- package/src/scripts/parallel-full-metadata-test.js.map +0 -1
- package/src/scripts/parallel-tools-test.js.map +0 -1
- package/src/scripts/programmatic_exec.js.map +0 -1
- package/src/scripts/programmatic_exec_agent.js.map +0 -1
- package/src/scripts/search.js.map +0 -1
- package/src/scripts/sequential-full-metadata-test.js.map +0 -1
- package/src/scripts/simple.js.map +0 -1
- package/src/scripts/single-agent-metadata-test.js.map +0 -1
- package/src/scripts/stream.js.map +0 -1
- package/src/scripts/test-custom-prompt-key.js.map +0 -1
- package/src/scripts/test-handoff-input.js.map +0 -1
- package/src/scripts/test-handoff-preamble.js.map +0 -1
- package/src/scripts/test-handoff-steering.js.map +0 -1
- package/src/scripts/test-multi-agent-list-handoff.js.map +0 -1
- package/src/scripts/test-parallel-agent-labeling.js.map +0 -1
- package/src/scripts/test-parallel-handoffs.js.map +0 -1
- package/src/scripts/test-thinking-handoff-bedrock.js.map +0 -1
- package/src/scripts/test-thinking-handoff.js.map +0 -1
- package/src/scripts/test-thinking-to-thinking-handoff-bedrock.js.map +0 -1
- package/src/scripts/test-tool-before-handoff-role-order.js.map +0 -1
- package/src/scripts/test-tools-before-handoff.js.map +0 -1
- package/src/scripts/test_code_api.js.map +0 -1
- package/src/scripts/thinking-bedrock.js.map +0 -1
- package/src/scripts/thinking-vertexai.js.map +0 -1
- package/src/scripts/thinking.js.map +0 -1
- package/src/scripts/tool_search.js.map +0 -1
- package/src/scripts/tools.js.map +0 -1
- package/src/specs/agent-handoffs-bedrock.integration.test.js.map +0 -1
- package/src/specs/agent-handoffs.test.js.map +0 -1
- package/src/specs/anthropic.simple.test.js.map +0 -1
- package/src/specs/azure.simple.test.js.map +0 -1
- package/src/specs/cache.simple.test.js.map +0 -1
- package/src/specs/custom-event-await.test.js.map +0 -1
- package/src/specs/deepseek.simple.test.js.map +0 -1
- package/src/specs/emergency-prune.test.js.map +0 -1
- package/src/specs/moonshot.simple.test.js.map +0 -1
- package/src/specs/observability.integration.test.js.map +0 -1
- package/src/specs/openai.simple.test.js.map +0 -1
- package/src/specs/openrouter.simple.test.js.map +0 -1
- package/src/specs/prune.test.js.map +0 -1
- package/src/specs/reasoning.test.js.map +0 -1
- package/src/specs/spec.utils.js.map +0 -1
- package/src/specs/thinking-handoff.test.js.map +0 -1
- package/src/specs/thinking-prune.test.js.map +0 -1
- package/src/specs/token-distribution-edge-case.test.js.map +0 -1
- package/src/specs/token-memoization.test.js.map +0 -1
- package/src/specs/tokens.test.js.map +0 -1
- package/src/specs/tool-error.test.js.map +0 -1
- package/src/splitStream.js.map +0 -1
- package/src/splitStream.test.js.map +0 -1
- package/src/stream.js.map +0 -1
- package/src/stream.test.js.map +0 -1
- package/src/test/mockTools.js.map +0 -1
- package/src/tools/BrowserTools.js.map +0 -1
- package/src/tools/Calculator.js.map +0 -1
- package/src/tools/Calculator.test.js.map +0 -1
- package/src/tools/CodeExecutor.js.map +0 -1
- package/src/tools/ProgrammaticToolCalling.js.map +0 -1
- package/src/tools/StreamingToolCallBuffer.js.map +0 -1
- package/src/tools/ToolNode.js.map +0 -1
- package/src/tools/ToolSearch.js.map +0 -1
- package/src/tools/__tests__/BrowserTools.test.js.map +0 -1
- package/src/tools/__tests__/ProgrammaticToolCalling.integration.test.js.map +0 -1
- package/src/tools/__tests__/ProgrammaticToolCalling.test.js.map +0 -1
- package/src/tools/__tests__/StreamingToolCallBuffer.test.js.map +0 -1
- package/src/tools/__tests__/ToolApproval.test.js.map +0 -1
- package/src/tools/__tests__/ToolNode.recovery.test.js.map +0 -1
- package/src/tools/__tests__/ToolNode.session.test.js.map +0 -1
- package/src/tools/__tests__/ToolSearch.integration.test.js.map +0 -1
- package/src/tools/__tests__/ToolSearch.test.js.map +0 -1
- package/src/tools/__tests__/handlers.test.js.map +0 -1
- package/src/tools/__tests__/truncation-recovery.integration.test.js.map +0 -1
- package/src/tools/handlers.js.map +0 -1
- package/src/tools/schema.js.map +0 -1
- package/src/tools/search/anthropic.js.map +0 -1
- package/src/tools/search/content.js.map +0 -1
- package/src/tools/search/content.test.js.map +0 -1
- package/src/tools/search/firecrawl.js.map +0 -1
- package/src/tools/search/format.js.map +0 -1
- package/src/tools/search/highlights.js.map +0 -1
- package/src/tools/search/index.js.map +0 -1
- package/src/tools/search/jina-reranker.test.js.map +0 -1
- package/src/tools/search/output.md +0 -2775
- package/src/tools/search/rerankers.js.map +0 -1
- package/src/tools/search/schema.js.map +0 -1
- package/src/tools/search/search.js.map +0 -1
- package/src/tools/search/serper-scraper.js.map +0 -1
- package/src/tools/search/test.html +0 -884
- package/src/tools/search/test.js.map +0 -1
- package/src/tools/search/test.md +0 -643
- package/src/tools/search/test.ts +0 -159
- package/src/tools/search/tool.js.map +0 -1
- package/src/tools/search/types.js.map +0 -1
- package/src/tools/search/utils.js.map +0 -1
- package/src/types/graph.js.map +0 -1
- package/src/types/graph.test.js.map +0 -1
- package/src/types/index.js.map +0 -1
- package/src/types/llm.js.map +0 -1
- package/src/types/messages.js.map +0 -1
- package/src/types/run.js.map +0 -1
- package/src/types/stream.js.map +0 -1
- package/src/types/tools.js.map +0 -1
- package/src/utils/contextAnalytics.js.map +0 -1
- package/src/utils/contextAnalytics.test.js.map +0 -1
- package/src/utils/events.js.map +0 -1
- package/src/utils/graph.js.map +0 -1
- package/src/utils/handlers.js.map +0 -1
- package/src/utils/index.js.map +0 -1
- package/src/utils/llm.js.map +0 -1
- package/src/utils/llmConfig.js.map +0 -1
- package/src/utils/logging.js.map +0 -1
- package/src/utils/misc.js.map +0 -1
- package/src/utils/run.js.map +0 -1
- package/src/utils/schema.js.map +0 -1
- package/src/utils/title.js.map +0 -1
- package/src/utils/tokens.js.map +0 -1
- package/src/utils/toonFormat.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Maximal Marginal Relevance (MMR) re-ranking — Phase 2.
|
|
3
3
|
*
|
|
4
|
-
* Ported from
|
|
4
|
+
* Ported from a reference implementation `extensions/memory-core/src/memory/mmr.ts` with
|
|
5
5
|
* minor adaptation for our `MemoryEntry` shape (content vs snippet, id vs
|
|
6
6
|
* path+startLine). Behavior is identical: normalize scores, iteratively
|
|
7
7
|
* pick the item that maximizes `λ * relevance - (1-λ) * max_similarity`
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* @see Carbonell & Goldstein, "The Use of MMR, Diversity-Based Reranking" (1998)
|
|
11
11
|
*/
|
|
12
12
|
export interface MMRConfig {
|
|
13
|
-
/** Opt-in.
|
|
13
|
+
/** Opt-in. Default is false. */
|
|
14
14
|
enabled: boolean;
|
|
15
|
-
/** 0 = max diversity, 1 = max relevance.
|
|
15
|
+
/** 0 = max diversity, 1 = max relevance. Default 0.7. */
|
|
16
16
|
lambda: number;
|
|
17
17
|
}
|
|
18
18
|
export declare const DEFAULT_MMR_CONFIG: MMRConfig;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Temporal decay — Phase 2.
|
|
3
3
|
*
|
|
4
|
-
* Ported from
|
|
4
|
+
* Ported from a reference implementation `extensions/memory-core/src/memory/temporal-decay.ts`.
|
|
5
5
|
* Ages dated memory files (`memory/YYYY-MM-DD.md`) using exponential decay
|
|
6
6
|
* `multiplier = exp(-ln(2) / halfLifeDays * ageInDays)`. At half-life, the
|
|
7
7
|
* score is exactly halved.
|
|
8
8
|
*
|
|
9
9
|
* Evergreen files (MEMORY.md, memory/topics.md, any non-dated file inside
|
|
10
10
|
* memory/) do NOT decay — they represent durable knowledge and should stay
|
|
11
|
-
* hot regardless of age. This mirrors
|
|
11
|
+
* hot regardless of age. This mirrors the standard `isEvergreenMemoryPath`.
|
|
12
12
|
*
|
|
13
13
|
* Since our pgvector rows carry `createdAt`, we don't need filesystem stat
|
|
14
14
|
* fallback — the row timestamp is authoritative for any file without a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Autonomous memory — core types.
|
|
3
3
|
*
|
|
4
|
-
* Ported from
|
|
4
|
+
* Ported from the reference implementation's memory-core pattern, adapted for Postgres + pgvector
|
|
5
5
|
* and shaped so a future graph-backend layer (Graphiti, Neo4j agent-memory, etc.)
|
|
6
6
|
* can be added alongside the vector store without changing the tool contracts.
|
|
7
7
|
*
|
|
@@ -75,7 +75,7 @@ export interface MemorySearchOptions {
|
|
|
75
75
|
minScore?: number;
|
|
76
76
|
/**
|
|
77
77
|
* Phase 2 toggles — when the backend supports them. Each is independently
|
|
78
|
-
* opt-in; all false =
|
|
78
|
+
* opt-in; all false = Phase 1 behavior.
|
|
79
79
|
*/
|
|
80
80
|
mmr?: {
|
|
81
81
|
enabled?: boolean;
|
|
@@ -144,7 +144,7 @@ export interface MemoryConfig {
|
|
|
144
144
|
search?: {
|
|
145
145
|
maxResults?: number;
|
|
146
146
|
maxInjectedChars?: number;
|
|
147
|
-
/** Phase 2 — enable MMR reranking (
|
|
147
|
+
/** Phase 2 — enable MMR reranking (defaults when true). */
|
|
148
148
|
mmr?: {
|
|
149
149
|
enabled?: boolean;
|
|
150
150
|
lambda?: number;
|
|
@@ -110,7 +110,7 @@ export declare const labelContentByAgent: (contentParts: MessageContentComplex[]
|
|
|
110
110
|
* When SkillTool is invoked, the body is injected as a HumanMessage into LangGraph state
|
|
111
111
|
* but NOT persisted to conversation history. On follow-up runs the skill body is lost.
|
|
112
112
|
* Pass `skills` to reconstruct the HumanMessage at the right position after each skill
|
|
113
|
-
* ToolMessage.
|
|
113
|
+
* ToolMessage. PRs #96 / #97.
|
|
114
114
|
* @returns - Object containing formatted messages and updated indexTokenCountMap if provided.
|
|
115
115
|
*/
|
|
116
116
|
export declare const formatAgentMessages: (payload: TPayload, indexTokenCountMap?: Record<number, number | undefined>, tools?: Set<string>, skills?: Map<string, string>, options?: FormatAgentMessagesOptions) => {
|
|
@@ -9,7 +9,7 @@ import type { ResolvedArgsByCallId } from '@/tools/toolOutputReferences';
|
|
|
9
9
|
/**
|
|
10
10
|
* Per-call batch context for `runTool`. Bundles every optional batch-scoped
|
|
11
11
|
* value the method needs so the signature stays at three positional params
|
|
12
|
-
* even as new context fields are added.
|
|
12
|
+
* even as new context fields are added. (PR #117).
|
|
13
13
|
*/
|
|
14
14
|
type RunToolBatchContext = {
|
|
15
15
|
/** Position of this call within the parent ToolNode batch. */
|
|
@@ -51,7 +51,7 @@ export declare class ToolNode<T = any> extends RunnableCallable<T, T> {
|
|
|
51
51
|
private hookRegistry?;
|
|
52
52
|
/**
|
|
53
53
|
* Tool output reference registry threaded down from Run / Graph
|
|
54
|
-
* (
|
|
54
|
+
* (PR #114). When set, dispatchToolEvents resolves
|
|
55
55
|
* `{{tool<i>turn<n>}}` placeholders in args before invoking each tool
|
|
56
56
|
* and stores successful outputs under their stable reference keys for
|
|
57
57
|
* subsequent calls in the same run to pipe through.
|
|
@@ -112,7 +112,7 @@ export declare class ToolNode<T = any> extends RunnableCallable<T, T> {
|
|
|
112
112
|
/**
|
|
113
113
|
* Runs a single tool call with error handling.
|
|
114
114
|
*
|
|
115
|
-
* @param batchContext Optional per-batch context (
|
|
115
|
+
* @param batchContext Optional per-batch context (PR #117).
|
|
116
116
|
* Threaded from `run()` for tool output reference annotation. The
|
|
117
117
|
* `batchScopeId` field carries an anonymous synthetic scope when the
|
|
118
118
|
* caller has no `run_id`, so concurrent batches don't collide on the
|
|
@@ -67,7 +67,7 @@ export interface MemoryGetToolResult {
|
|
|
67
67
|
export declare function buildMemorySearchUnavailableResult(error: string | undefined): MemorySearchToolResult;
|
|
68
68
|
/**
|
|
69
69
|
* Clamp a ranked result list to a total character budget.
|
|
70
|
-
* Ported from
|
|
70
|
+
* Ported from a reference implementation `tools.citations.ts::clampResultsByInjectedChars`.
|
|
71
71
|
*/
|
|
72
72
|
export declare function clampResultsByInjectedChars<T extends {
|
|
73
73
|
content: string;
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
* for the active provider; consumers decide what content to put in each
|
|
10
10
|
* block.
|
|
11
11
|
*
|
|
12
|
-
* Why this is generic rather than
|
|
12
|
+
* Why this is generic rather than tier-named
|
|
13
13
|
* ------------------------------------------------
|
|
14
14
|
* Earlier iterations exposed `platform_instructions` and `cache_ttl:
|
|
15
|
-
* { platform, agent }` — vocabulary borrowed from a
|
|
16
|
-
* platform
|
|
17
|
-
* the library and made it confusing for other consumers
|
|
18
|
-
* desktop apps, gateways) which have no notion of
|
|
15
|
+
* { platform, agent }` — vocabulary borrowed from a specific consumer's
|
|
16
|
+
* multi-tenant chat-platform mental model. That leaked one consumer's
|
|
17
|
+
* domain into the library and made it confusing for other consumers
|
|
18
|
+
* (CLI tools, desktop apps, gateways) which have no notion of
|
|
19
|
+
* "platforms" or "agents".
|
|
19
20
|
*
|
|
20
21
|
* The current shape lets every consumer define their own cache-tier
|
|
21
22
|
* organization without the library knowing or caring.
|
|
@@ -264,10 +264,11 @@ export type GraphEdge = {
|
|
|
264
264
|
/**
|
|
265
265
|
* EdgeType.HANDOFF — one-way routing: parent emits an `lc_transfer_to_*`
|
|
266
266
|
* tool call and exits, child takes over and responds directly to the
|
|
267
|
-
* user. Aligns with
|
|
267
|
+
* user. Aligns with the standard handoff semantics.
|
|
268
268
|
* EdgeType.DIRECT — fixed graph edges for automatic sequential / parallel
|
|
269
|
-
* transitions.
|
|
270
|
-
* parallel groups,
|
|
269
|
+
* transitions. Downstream consumers may layer additional wiring on top
|
|
270
|
+
* (fan-in with prompt, parallel groups, approval-gate nodes,
|
|
271
|
+
* excludeResults / agentMessages).
|
|
271
272
|
*/
|
|
272
273
|
edgeType?: import('@/common').EdgeType;
|
|
273
274
|
/**
|
|
@@ -458,7 +459,7 @@ export interface SummarizationConfig {
|
|
|
458
459
|
*/
|
|
459
460
|
initialSummary?: string;
|
|
460
461
|
/**
|
|
461
|
-
*
|
|
462
|
+
* optional fields. When the host wants the summarization
|
|
462
463
|
* pass to run on a different LLM than the agent's own (e.g. a cheaper
|
|
463
464
|
* model for compaction), these provider/model overrides flow through to
|
|
464
465
|
* the summarize callback.
|
|
@@ -622,9 +623,9 @@ export interface AgentInputs {
|
|
|
622
623
|
tokenCount: number;
|
|
623
624
|
};
|
|
624
625
|
/**
|
|
625
|
-
*
|
|
626
|
+
* opt-in for summarization. When false, the agent never
|
|
626
627
|
* invokes the summarize callback regardless of context utilization.
|
|
627
|
-
* Defaults to undefined (treated as enabled
|
|
628
|
+
* Defaults to undefined (treated as enabled by default to preserve prior
|
|
628
629
|
* behaviour); hosts that want strict opt-in semantics should set it
|
|
629
630
|
* explicitly.
|
|
630
631
|
*/
|
|
@@ -4,7 +4,7 @@ export type AnthropicMessages = Array<AnthropicMessage | BaseMessage>;
|
|
|
4
4
|
export type AnthropicMessage = Anthropic.MessageParam;
|
|
5
5
|
/**
|
|
6
6
|
* Per-message ref metadata stamped onto a `ToolMessage` at execution time
|
|
7
|
-
* (
|
|
7
|
+
* (PR #117). Read by `annotateMessagesForLLM` to apply transient
|
|
8
8
|
* annotation to a copy of the message right before it goes on the wire to
|
|
9
9
|
* the provider. Never read after the run-scoped registry has been cleared.
|
|
10
10
|
*
|
|
@@ -121,7 +121,7 @@ export type RunConfig = {
|
|
|
121
121
|
*/
|
|
122
122
|
hooks?: HookRegistry;
|
|
123
123
|
/**
|
|
124
|
-
* Tool output reference configuration (
|
|
124
|
+
* Tool output reference configuration (PRs #114 / #117).
|
|
125
125
|
* When `enabled` is true, the Run constructs a single
|
|
126
126
|
* ToolOutputReferenceRegistry and threads it to every ToolNode built by
|
|
127
127
|
* the graph so `{{tool<i>turn<n>}}` placeholders resolve across agents.
|
|
@@ -60,13 +60,13 @@ export type ToolNodeOptions = {
|
|
|
60
60
|
/**
|
|
61
61
|
* Maximum characters for a single tool result (head+tail truncation).
|
|
62
62
|
* When omitted, derived from the agent's `maxContextTokens` (30%
|
|
63
|
-
* heuristic), capped at HARD_MAX_TOOL_RESULT_CHARS.
|
|
64
|
-
*
|
|
65
|
-
* this option keeps the test surface portable.
|
|
63
|
+
* heuristic), capped at HARD_MAX_TOOL_RESULT_CHARS. —
|
|
64
|
+
* downstream consumers may drive truncation through other knobs;
|
|
65
|
+
* accepting this option keeps the test surface portable.
|
|
66
66
|
*/
|
|
67
67
|
maxToolResultChars?: number;
|
|
68
68
|
/**
|
|
69
|
-
* Run-scoped tool output reference configuration (
|
|
69
|
+
* Run-scoped tool output reference configuration (PR #114).
|
|
70
70
|
* When `enabled` is true, ToolNode registers successful outputs and
|
|
71
71
|
* substitutes `{{tool<i>turn<n>}}` placeholders found in string args.
|
|
72
72
|
* Ignored when `toolOutputRegistry` is also provided (the host-supplied
|
|
@@ -255,7 +255,7 @@ export type ToolExecuteResult = {
|
|
|
255
255
|
/** Map of tool names to tool definitions */
|
|
256
256
|
export type LCToolRegistry = Map<string, LCTool>;
|
|
257
257
|
/**
|
|
258
|
-
* Configuration for the tool output reference feature (
|
|
258
|
+
* Configuration for the tool output reference feature (PR #114).
|
|
259
259
|
*
|
|
260
260
|
* When `enabled: true`, ToolNode stores each successful tool output under
|
|
261
261
|
* a stable key `tool<idx>turn<turn>` and the LLM can pipe a previous output
|
package/package.json
CHANGED
|
@@ -108,7 +108,7 @@ export class AgentContext {
|
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
-
* Track
|
|
111
|
+
* Track subagent inputs on the context. `_sourceInputs`
|
|
112
112
|
* preserves the original AgentInputs so SubagentExecutor can self-spawn
|
|
113
113
|
* (`SubagentConfig.self === true`) without separate config; the other
|
|
114
114
|
* two flow straight from agentConfig.
|
|
@@ -1004,7 +1004,7 @@ export class AgentContext {
|
|
|
1004
1004
|
* appended unfiltered; outside event-driven mode they pass through
|
|
1005
1005
|
* `filterToolsForBinding`. Centralizing the decision here prevents the
|
|
1006
1006
|
* accounting/binding paths from drifting apart, which was the root
|
|
1007
|
-
* cause of the original miscount (Fixes
|
|
1007
|
+
* cause of the original miscount (Fixes #121).
|
|
1008
1008
|
*/
|
|
1009
1009
|
private getEffectiveInstanceTools(): t.GraphTools | undefined {
|
|
1010
1010
|
if (!this.tools) {
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* traffic).
|
|
12
12
|
*
|
|
13
13
|
* What it does NOT prove (out of scope here):
|
|
14
|
-
* - That
|
|
15
|
-
*
|
|
14
|
+
* - That a downstream consumer's actual system-block-assembly logic
|
|
15
|
+
* produces a byte-identical Tier 1. That's the consumer's
|
|
16
|
+
* responsibility (and its own tests).
|
|
16
17
|
*
|
|
17
18
|
* Run:
|
|
18
19
|
* BEDROCK_AWS_REGION=us-east-1 \
|
|
@@ -52,7 +53,8 @@ const describeFn = haveBedrock ? describe : describe.skip;
|
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
55
|
* Tier 1 — platform-wide content. Same string for every "agent" in this
|
|
55
|
-
* test, mimicking
|
|
56
|
+
* test, mimicking a multi-tenant platform's shared branding + tool-routing
|
|
57
|
+
* + common-tool documentation block.
|
|
56
58
|
* Padded above 1024 tokens so Bedrock will write/read the cache (1024-token
|
|
57
59
|
* minimum cache write threshold).
|
|
58
60
|
*/
|
|
@@ -377,7 +377,7 @@ describe('AgentContext', () => {
|
|
|
377
377
|
});
|
|
378
378
|
|
|
379
379
|
it('excludes deferred-undiscovered instance tools from token accounting', async () => {
|
|
380
|
-
/* Regression for
|
|
380
|
+
/* Regression for #122 / #121.
|
|
381
381
|
* `calculateInstructionTokens` previously summed every entry in
|
|
382
382
|
* `this.tools` regardless of whether `getToolsForBinding` would
|
|
383
383
|
* actually emit it. That over-reported tokens and triggered
|
|
@@ -22,7 +22,7 @@ describe('EdgeType enum', () => {
|
|
|
22
22
|
expect(EdgeType.HANDOFF).toBe('handoff');
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
it('has correct DIRECT value (fixed graph edges
|
|
25
|
+
it('has correct DIRECT value (fixed graph edges, consumers may layer fan-in / parallel / approval-gate logic)', () => {
|
|
26
26
|
expect(EdgeType.DIRECT).toBe('direct');
|
|
27
27
|
});
|
|
28
28
|
|
package/src/common/enum.ts
CHANGED
|
@@ -103,19 +103,19 @@ export enum Providers {
|
|
|
103
103
|
|
|
104
104
|
export enum EdgeType {
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
* handoff: one-way routing where the parent agent exits
|
|
107
107
|
* via a `lc_transfer_to_<destination>` tool call, the child takes over,
|
|
108
108
|
* and the child responds directly to the user. Replaces what used to be
|
|
109
|
-
* called "TRANSFER" in
|
|
109
|
+
* called "TRANSFER" in older versions; the parent-calls-child
|
|
110
110
|
* supervisor pattern (formerly `EdgeType.HANDOFF`) is gone — use the
|
|
111
111
|
* Subagent primitive (Tier 5) for deep delegation instead.
|
|
112
112
|
*/
|
|
113
113
|
HANDOFF = 'handoff',
|
|
114
114
|
/**
|
|
115
|
-
* Fixed graph edges for automatic transitions.
|
|
116
|
-
*
|
|
117
|
-
* fan-in with prompt + {results}, parallel groups,
|
|
118
|
-
* insertion, and the `excludeResults` agentMessages channel.
|
|
115
|
+
* Fixed graph edges for automatic transitions. Standard naming.
|
|
116
|
+
* Downstream consumers may layer additional wiring on top of this edge
|
|
117
|
+
* type: fan-in with prompt + {results}, parallel groups, approval-gate
|
|
118
|
+
* node insertion, and the `excludeResults` agentMessages channel.
|
|
119
119
|
*/
|
|
120
120
|
DIRECT = 'direct',
|
|
121
121
|
}
|
|
@@ -195,15 +195,15 @@ export enum Callback {
|
|
|
195
195
|
export enum Constants {
|
|
196
196
|
OFFICIAL_CODE_BASEURL = 'https://api.illuma.ai/v1',
|
|
197
197
|
EXECUTE_CODE = 'execute_code',
|
|
198
|
-
/** Tool name for the bash execution primitive (
|
|
198
|
+
/** Tool name for the bash execution primitive (Tier 3). */
|
|
199
199
|
BASH_TOOL = 'execute_bash',
|
|
200
|
-
/** Tool name for the bash programmatic-tool-calling variant (
|
|
200
|
+
/** Tool name for the bash programmatic-tool-calling variant (Tier 3). */
|
|
201
201
|
BASH_PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_bash',
|
|
202
|
-
/** Tool name for the read-file primitive (
|
|
202
|
+
/** Tool name for the read-file primitive (Tier 3). */
|
|
203
203
|
READ_FILE = 'read_file',
|
|
204
|
-
/** Tool name for the SkillTool primitive (
|
|
204
|
+
/** Tool name for the SkillTool primitive (Tier 2). */
|
|
205
205
|
SKILL_TOOL = 'skill',
|
|
206
|
-
/** Tool name for the Subagent primitive (
|
|
206
|
+
/** Tool name for the Subagent primitive (Tier 5). */
|
|
207
207
|
SUBAGENT = 'subagent',
|
|
208
208
|
TOOL_SEARCH = 'tool_search',
|
|
209
209
|
PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_code',
|
|
@@ -270,7 +270,7 @@ export enum MessageTypes {
|
|
|
270
270
|
/**
|
|
271
271
|
* Tool names that use the code execution environment (shared session, file
|
|
272
272
|
* tracking). Used by ToolNode to inject session context + file refs into
|
|
273
|
-
* `invokeParams` before tool execution.
|
|
273
|
+
* `invokeParams` before tool execution. constant.
|
|
274
274
|
*/
|
|
275
275
|
export const CODE_EXECUTION_TOOLS: ReadonlySet<string> = new Set([
|
|
276
276
|
Constants.EXECUTE_CODE,
|
package/src/graphs/Graph.ts
CHANGED
|
@@ -187,7 +187,7 @@ export abstract class Graph<
|
|
|
187
187
|
hookRegistry?: import('@/hooks').HookRegistry;
|
|
188
188
|
/**
|
|
189
189
|
* Optional tool-output reference registry threaded down from Run
|
|
190
|
-
* (
|
|
190
|
+
* (PR #114). When set, every ToolNode built by this graph
|
|
191
191
|
* stores successful outputs here and resolves `{{tool<i>turn<n>}}`
|
|
192
192
|
* placeholders in args before invoking the tool.
|
|
193
193
|
*
|
|
@@ -198,7 +198,7 @@ export abstract class Graph<
|
|
|
198
198
|
*/
|
|
199
199
|
toolOutputRegistry?: import('@/tools/toolOutputReferences').ToolOutputReferenceRegistry;
|
|
200
200
|
/**
|
|
201
|
-
* Run-scoped tool output reference configuration (
|
|
201
|
+
* Run-scoped tool output reference configuration (PR #117).
|
|
202
202
|
* When `enabled` is true, the graph lazily allocates a single
|
|
203
203
|
* `ToolOutputReferenceRegistry` on first `getOrCreateToolOutputRegistry()`
|
|
204
204
|
* call and shares it with every ToolNode the graph compiles, so
|
|
@@ -1109,7 +1109,7 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
1111
|
/**
|
|
1112
|
-
* Lazy tool-output reference annotation (
|
|
1112
|
+
* Lazy tool-output reference annotation (PR #117). Right
|
|
1113
1113
|
* before the message array hits the provider, walk it and apply
|
|
1114
1114
|
* `[ref: tool<i>turn<n>]` prefixes / `_ref` JSON fields to a
|
|
1115
1115
|
* transient copy. The persisted ToolMessages stay clean — only what
|
|
@@ -1720,7 +1720,7 @@ export class StandardGraph extends Graph<t.BaseGraphState, t.GraphNode> {
|
|
|
1720
1720
|
* Fire PreCompact (#103) before the LLM call. Observational —
|
|
1721
1721
|
* hosts may use the input to schedule auxiliary work, but a
|
|
1722
1722
|
* deny/ask decision does NOT block compaction here because
|
|
1723
|
-
*
|
|
1723
|
+
* the summarizer runs in the background and a refusal
|
|
1724
1724
|
* has nowhere to go: pruning still needs to happen at 100%
|
|
1725
1725
|
* regardless. Errors are swallowed so a hook bug cannot
|
|
1726
1726
|
* masquerade as a context-overflow failure.
|
|
@@ -2716,7 +2716,7 @@ If I seem to be missing something we discussed earlier, just give me a quick rem
|
|
|
2716
2716
|
}
|
|
2717
2717
|
|
|
2718
2718
|
/**
|
|
2719
|
-
* Subagent injection (
|
|
2719
|
+
* Subagent injection (Tier 5): when the agent has SubagentConfig
|
|
2720
2720
|
* entries and depth budget remaining, inject a `subagent` DynamicStructuredTool
|
|
2721
2721
|
* into graphTools. The tool's executor receives this graph's hookRegistry and
|
|
2722
2722
|
* a lazy handler-registry getter (Run wires handlerRegistry AFTER createWorkflow,
|
|
@@ -1006,7 +1006,7 @@ export class MultiAgentGraph extends StandardGraph {
|
|
|
1006
1006
|
|
|
1007
1007
|
/**
|
|
1008
1008
|
* Add approval-gate nodes for sequence edges that declare an approvalGate
|
|
1009
|
-
* config (
|
|
1009
|
+
* config (consumer extension, not part of the standard interface). Gates fire
|
|
1010
1010
|
* regardless of ExecutionContext and sit between source and destination.
|
|
1011
1011
|
*/
|
|
1012
1012
|
const gatedEdges = new Set<t.GraphEdge>();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { shouldFlushMemory } from '../memoryFlushPhase';
|
|
2
2
|
|
|
3
3
|
describe('shouldFlushMemory', () => {
|
|
4
|
-
// Use
|
|
4
|
+
// Use defaults: soft=4000, reserve=20000 means a 200k
|
|
5
5
|
// window fires at 176k. Explicit numbers here keep the test independent
|
|
6
6
|
// from the constants file.
|
|
7
7
|
const base = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Memory flush phase — trigger logic + reflection invocation.
|
|
3
3
|
*
|
|
4
|
-
* Ported from
|
|
4
|
+
* Ported from the reference implementation's post-turn flush handler. The agent is re-invoked
|
|
5
5
|
* with a reflection system prompt and the `memory_append` tool unlocked;
|
|
6
6
|
* it writes notes to its future self, then the graph returns to normal.
|
|
7
7
|
*
|
|
@@ -45,7 +45,7 @@ export interface ShouldFlushInput {
|
|
|
45
45
|
/**
|
|
46
46
|
* Pure trigger function: fires when the current context is within
|
|
47
47
|
* `softThreshold + reserveFloor` tokens of the model window. Matches
|
|
48
|
-
*
|
|
48
|
+
* the standard formula.
|
|
49
49
|
*/
|
|
50
50
|
export function shouldFlushMemory(input: ShouldFlushInput): boolean {
|
|
51
51
|
if (
|
|
@@ -24,7 +24,7 @@ type MatcherBucket = Partial<Record<HookEvent, HookMatcher<HookEvent>[]>>;
|
|
|
24
24
|
*
|
|
25
25
|
* ## Why `Map<sessionId, MatcherBucket>` and not `Record`
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* Real consumers run thousands of parallel sessions in one Node process, and
|
|
28
28
|
* hook registration happens inside hot paths (tool loading, agent spawning).
|
|
29
29
|
* A `Record<sessionId, ...>` has to be spread on every insertion, which is
|
|
30
30
|
* O(n) per call and O(n²) total for a batch of parallel registrations. A
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/hooks/index.ts
|
|
2
2
|
//
|
|
3
|
-
// Hook lifecycle system for `@
|
|
3
|
+
// Hook lifecycle system for `@illuma-ai/agents`. Re-exported from
|
|
4
4
|
// `src/index.ts` and consumed by `Run.processStream` (RunStart,
|
|
5
5
|
// UserPromptSubmit, Stop, StopFailure), `ToolNode.dispatchToolEvents`
|
|
6
6
|
// (PreToolUse, PostToolUse, PostToolUseFailure, PermissionDenied),
|
package/src/hooks/matchers.ts
CHANGED
|
@@ -129,7 +129,7 @@ function skipGroupSyntaxPrefix(pattern: string, start: number): number {
|
|
|
129
129
|
* This catches the common forms but not all. Ambiguous-alternation ReDoS
|
|
130
130
|
* like `(a|a)+` is not detected. Pathologically long patterns are also
|
|
131
131
|
* caught by {@link MAX_PATTERN_LENGTH}. Hosts that accept user-supplied
|
|
132
|
-
* patterns must still validate
|
|
132
|
+
* patterns must still validate standard.
|
|
133
133
|
*/
|
|
134
134
|
export function hasNestedQuantifier(pattern: string): boolean {
|
|
135
135
|
const stack: QuantifierFrame[] = [];
|
|
@@ -248,7 +248,7 @@ function compile(pattern: string): RegExp | null {
|
|
|
248
248
|
* never re-enter the regex compiler.
|
|
249
249
|
*
|
|
250
250
|
* These are a floor, not a ceiling. Hosts that accept user-supplied
|
|
251
|
-
* patterns should still validate
|
|
251
|
+
* patterns should still validate standard. The design report §3.8 routes
|
|
252
252
|
* persistable hooks through a host-side compiler before they reach this
|
|
253
253
|
* module.
|
|
254
254
|
*/
|
package/src/hooks/types.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { BaseMessage } from '@langchain/core/messages';
|
|
|
7
7
|
* These mirror the subset of Claude Code's event surface that makes sense
|
|
8
8
|
* for a library context (no filesystem/CLI-specific events). See
|
|
9
9
|
* `docs/hooks-design-report.md` §3.2 for the mapping to existing
|
|
10
|
-
* `@
|
|
10
|
+
* `@illuma-ai/agents` emission points.
|
|
11
11
|
*/
|
|
12
12
|
export const HOOK_EVENTS = [
|
|
13
13
|
'RunStart',
|
|
@@ -4,11 +4,11 @@ import type { BaseMessage } from '@langchain/core/messages';
|
|
|
4
4
|
import { _convertMessagesToAnthropicPayload } from './message_inputs';
|
|
5
5
|
|
|
6
6
|
describe('_convertMessagesToAnthropicPayload — server tool use (web search) multi-turn', () => {
|
|
7
|
-
/* Skipped:
|
|
7
|
+
/* Skipped: this fork intentionally diverged from the reference implementation's
|
|
8
8
|
* `_convertLangChainToolCallToAnthropic` — local always emits
|
|
9
9
|
* `tool_use` regardless of `srvtoolu_` ID prefix (see message_inputs.ts
|
|
10
|
-
* line ~144). These tests assert
|
|
11
|
-
* which
|
|
10
|
+
* line ~144). These tests assert the standard server_tool_use emission
|
|
11
|
+
* which this fork does not implement. The text→server_tool_use correction
|
|
12
12
|
* test (next, "corrects text-typed server tool blocks") still passes
|
|
13
13
|
* because that path lives in `_formatContent`. */
|
|
14
14
|
it.skip('corrects tool_use blocks with srvtoolu_ IDs to server_tool_use', () => {
|
|
@@ -161,7 +161,7 @@ describe('_convertMessagesToAnthropicPayload — server tool use (web search) mu
|
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
-
/* Skipped: depends on
|
|
164
|
+
/* Skipped: depends on the standard server_tool_use emission, see header. */
|
|
165
165
|
it.skip('filters server tool calls when content is a string', () => {
|
|
166
166
|
const messageHistory: BaseMessage[] = [
|
|
167
167
|
new HumanMessage('search for X'),
|
|
@@ -204,7 +204,7 @@ describe('_convertMessagesToAnthropicPayload — server tool use (web search) mu
|
|
|
204
204
|
expect(serverToolBlocks).toHaveLength(0);
|
|
205
205
|
});
|
|
206
206
|
|
|
207
|
-
/* Skipped: depends on
|
|
207
|
+
/* Skipped: depends on the standard server_tool_use emission, see header. */
|
|
208
208
|
it.skip('handles empty string content with only server tool calls', () => {
|
|
209
209
|
const messageHistory: BaseMessage[] = [
|
|
210
210
|
new HumanMessage('search for X'),
|
|
@@ -229,7 +229,7 @@ describe('_convertMessagesToAnthropicPayload — server tool use (web search) mu
|
|
|
229
229
|
expect(assistantContent[0].text).toBe(' ');
|
|
230
230
|
});
|
|
231
231
|
|
|
232
|
-
/* Skipped: depends on
|
|
232
|
+
/* Skipped: depends on the standard server_tool_use emission, see header. */
|
|
233
233
|
it.skip('preserves regular tool_use blocks alongside corrected server tool blocks', () => {
|
|
234
234
|
const messageHistory: BaseMessage[] = [
|
|
235
235
|
new HumanMessage('search for X and calculate 2+2'),
|
|
@@ -358,7 +358,7 @@ describe('_convertMessagesToAnthropicPayload — server tool use (web search) mu
|
|
|
358
358
|
});
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
|
-
* Regression for
|
|
361
|
+
* Regression for discussion #12806.
|
|
362
362
|
*
|
|
363
363
|
* Anthropic web_search responses can include text blocks whose text is
|
|
364
364
|
* whitespace-only (e.g. ' ', '\n', '\t') alongside server_tool_use and
|
|
@@ -361,7 +361,7 @@ describe('Bedrock Prompt Caching', () => {
|
|
|
361
361
|
};
|
|
362
362
|
|
|
363
363
|
describe('Bedrock system message with promptCache: true', () => {
|
|
364
|
-
/* Updated contract (2026-05-01,
|
|
364
|
+
/* Updated contract (2026-05-01, PR #128 alignment): Bedrock
|
|
365
365
|
* system message gets a `cachePoint` block inline so the system
|
|
366
366
|
* prefix is cached at the AWS account level (cross-user). Previously
|
|
367
367
|
* cachePoint was only added at the tool level, leaving the system
|
|
@@ -487,7 +487,7 @@ describe('Bedrock Prompt Caching', () => {
|
|
|
487
487
|
|
|
488
488
|
// Bedrock system messages now carry an inline cachePoint so the
|
|
489
489
|
// system prefix gets cached at the AWS account level (matching
|
|
490
|
-
//
|
|
490
|
+
// PR #128). Tool-level cachePoint from
|
|
491
491
|
// IllumaBedrockConverse.invocationParams() runs independently.
|
|
492
492
|
expect(Array.isArray(content)).toBe(true);
|
|
493
493
|
expect(content.some((c) => 'cachePoint' in c)).toBe(true);
|
package/src/llm/bedrock/index.ts
CHANGED
|
@@ -77,8 +77,8 @@ export type ToolGroupSelector = (toolName: string) => string;
|
|
|
77
77
|
/**
|
|
78
78
|
* Default group selector — puts all tools in a single group named 'core'.
|
|
79
79
|
* Equivalent to 'single' strategy but explicit. Consumers override this
|
|
80
|
-
* to enable per-source grouping (e.g.
|
|
81
|
-
* separate
|
|
80
|
+
* to enable per-source grouping (e.g. by inspecting tool-name substrings
|
|
81
|
+
* to separate stable framework tools from volatile MCP-sourced tools).
|
|
82
82
|
*/
|
|
83
83
|
export const DEFAULT_TOOL_GROUP_SELECTOR: ToolGroupSelector = () => 'core';
|
|
84
84
|
|
package/src/llm/openai/index.ts
CHANGED
|
@@ -896,8 +896,8 @@ export interface XAIUsageMetadata
|
|
|
896
896
|
}
|
|
897
897
|
|
|
898
898
|
export class ChatMoonshot extends ChatOpenAI {
|
|
899
|
-
static lc_name(): '
|
|
900
|
-
return '
|
|
899
|
+
static lc_name(): 'IllumaMoonshot' {
|
|
900
|
+
return 'IllumaMoonshot';
|
|
901
901
|
}
|
|
902
902
|
|
|
903
903
|
protected _convertMessages(messages: BaseMessage[]): OpenAICompletionParam[] {
|
|
@@ -302,7 +302,7 @@ export function _convertMessagesToOpenAIParams(
|
|
|
302
302
|
model?: string,
|
|
303
303
|
options?: ConvertMessagesOptions
|
|
304
304
|
): OpenAICompletionParam[] {
|
|
305
|
-
/* DeepSeek reasoning roundtrip (
|
|
305
|
+
/* DeepSeek reasoning roundtrip (PR #136): reasoning_content on
|
|
306
306
|
* an AI message must be re-sent only when the message participates in a
|
|
307
307
|
* tool-call exchange. Track context across the message flat-map. */
|
|
308
308
|
let hasReasoningToolCallContext = false;
|
|
@@ -454,7 +454,7 @@ export function _convertMessagesToOpenAIParams(
|
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
/* DeepSeek reasoning roundtrip (
|
|
457
|
+
/* DeepSeek reasoning roundtrip (PR #136): emit
|
|
458
458
|
* reasoning_content only when the message is part of a tool-call
|
|
459
459
|
* exchange — either the message itself has tool_calls, or a previous
|
|
460
460
|
* AI/tool message established the context. Skipping the gate causes
|