@librechat/agents 4.2.12 → 4.2.14
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/graphs/Graph.cjs +56 -6
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/harness/providerText.cjs +1 -0
- package/dist/cjs/harness/providerText.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/index.cjs +4 -3
- package/dist/cjs/llm/anthropic/index.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/container.cjs +37 -0
- package/dist/cjs/llm/anthropic/utils/container.cjs.map +1 -0
- package/dist/cjs/llm/anthropic/utils/message_inputs.cjs +25 -23
- package/dist/cjs/llm/anthropic/utils/message_inputs.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/message_outputs.cjs +15 -21
- package/dist/cjs/llm/anthropic/utils/message_outputs.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/stream_events.cjs +16 -14
- package/dist/cjs/llm/anthropic/utils/stream_events.cjs.map +1 -1
- package/dist/cjs/llm/bedrock/index.cjs +1 -1
- package/dist/cjs/llm/bedrock/index.cjs.map +1 -1
- package/dist/cjs/llm/bedrock/toolCache.cjs +1 -1
- package/dist/cjs/llm/bedrock/utils/message_inputs.cjs +19 -13
- package/dist/cjs/llm/bedrock/utils/message_inputs.cjs.map +1 -1
- package/dist/cjs/llm/google/utils/common.cjs +59 -13
- package/dist/cjs/llm/google/utils/common.cjs.map +1 -1
- package/dist/cjs/llm/google/utils/signatures.cjs +22 -14
- package/dist/cjs/llm/google/utils/signatures.cjs.map +1 -1
- package/dist/cjs/llm/init.cjs +12 -2
- package/dist/cjs/llm/init.cjs.map +1 -1
- package/dist/cjs/llm/invoke.cjs +122 -13
- package/dist/cjs/llm/invoke.cjs.map +1 -1
- package/dist/cjs/llm/openai/index.cjs +9 -3
- package/dist/cjs/llm/openai/index.cjs.map +1 -1
- package/dist/cjs/llm/openai/typedContent.cjs +94 -0
- package/dist/cjs/llm/openai/typedContent.cjs.map +1 -0
- package/dist/cjs/llm/openrouter/toolCache.cjs +1 -1
- package/dist/cjs/llm/prepareProviderRequest.cjs +81 -4
- package/dist/cjs/llm/prepareProviderRequest.cjs.map +1 -1
- package/dist/cjs/llm/providerTextBatch.cjs +128 -0
- package/dist/cjs/llm/providerTextBatch.cjs.map +1 -0
- package/dist/cjs/llm/providerTextBoundary.cjs +81 -12
- package/dist/cjs/llm/providerTextBoundary.cjs.map +1 -1
- package/dist/cjs/main.cjs +8 -3
- package/dist/cjs/messages/alternation.cjs +1 -1
- package/dist/cjs/messages/anthropicServerTools.cjs +20 -0
- package/dist/cjs/messages/anthropicServerTools.cjs.map +1 -0
- package/dist/cjs/messages/budget.cjs +1 -1
- package/dist/cjs/messages/core.cjs +3 -2
- package/dist/cjs/messages/core.cjs.map +1 -1
- package/dist/cjs/messages/format.cjs +2 -2
- package/dist/cjs/messages/index.cjs +1 -1
- package/dist/cjs/messages/prune.cjs +1 -1
- package/dist/cjs/messages/recency.cjs +1 -1
- package/dist/cjs/messages/toolResultTypes.cjs +21 -45
- package/dist/cjs/messages/toolResultTypes.cjs.map +1 -1
- package/dist/cjs/protection/providerText.cjs +60 -6
- package/dist/cjs/protection/providerText.cjs.map +1 -1
- package/dist/cjs/protection/providerTextAdmission.cjs +5 -0
- package/dist/cjs/protection/providerTextAdmission.cjs.map +1 -1
- package/dist/cjs/protection/toolResult.cjs +119 -0
- package/dist/cjs/protection/toolResult.cjs.map +1 -0
- package/dist/cjs/run.cjs +14 -3
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/runtime/client.cjs +4 -0
- package/dist/cjs/runtime/client.cjs.map +1 -1
- package/dist/cjs/stream.cjs +10 -2
- package/dist/cjs/stream.cjs.map +1 -1
- package/dist/cjs/summarization/node.cjs +1 -1
- package/dist/cjs/tools/ToolNode.cjs +46 -13
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/handlers.cjs +47 -1
- package/dist/cjs/tools/handlers.cjs.map +1 -1
- package/dist/cjs/tools/search/citations.cjs +194 -0
- package/dist/cjs/tools/search/citations.cjs.map +1 -0
- package/dist/cjs/tools/search/content.cjs +163 -42
- package/dist/cjs/tools/search/content.cjs.map +1 -1
- package/dist/cjs/tools/search/firecrawl.cjs +4 -9
- package/dist/cjs/tools/search/firecrawl.cjs.map +1 -1
- package/dist/cjs/tools/search/google.cjs +68 -0
- package/dist/cjs/tools/search/google.cjs.map +1 -0
- package/dist/cjs/tools/search/openai.cjs +80 -0
- package/dist/cjs/tools/search/openai.cjs.map +1 -0
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs +4 -0
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
- package/dist/cjs/utils/tokens.cjs +12 -2
- package/dist/cjs/utils/tokens.cjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +57 -7
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/harness/providerText.mjs +1 -0
- package/dist/esm/harness/providerText.mjs.map +1 -1
- package/dist/esm/llm/anthropic/index.mjs +4 -3
- package/dist/esm/llm/anthropic/index.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/container.mjs +37 -0
- package/dist/esm/llm/anthropic/utils/container.mjs.map +1 -0
- package/dist/esm/llm/anthropic/utils/message_inputs.mjs +25 -23
- package/dist/esm/llm/anthropic/utils/message_inputs.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/message_outputs.mjs +15 -21
- package/dist/esm/llm/anthropic/utils/message_outputs.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/stream_events.mjs +16 -14
- package/dist/esm/llm/anthropic/utils/stream_events.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/bedrock/toolCache.mjs +1 -1
- package/dist/esm/llm/bedrock/utils/message_inputs.mjs +19 -14
- package/dist/esm/llm/bedrock/utils/message_inputs.mjs.map +1 -1
- package/dist/esm/llm/google/utils/common.mjs +59 -13
- package/dist/esm/llm/google/utils/common.mjs.map +1 -1
- package/dist/esm/llm/google/utils/signatures.mjs +22 -14
- package/dist/esm/llm/google/utils/signatures.mjs.map +1 -1
- package/dist/esm/llm/init.mjs +12 -2
- package/dist/esm/llm/init.mjs.map +1 -1
- package/dist/esm/llm/invoke.mjs +124 -15
- package/dist/esm/llm/invoke.mjs.map +1 -1
- package/dist/esm/llm/openai/index.mjs +9 -3
- package/dist/esm/llm/openai/index.mjs.map +1 -1
- package/dist/esm/llm/openai/typedContent.mjs +93 -0
- package/dist/esm/llm/openai/typedContent.mjs.map +1 -0
- package/dist/esm/llm/openrouter/toolCache.mjs +1 -1
- package/dist/esm/llm/prepareProviderRequest.mjs +81 -4
- package/dist/esm/llm/prepareProviderRequest.mjs.map +1 -1
- package/dist/esm/llm/providerTextBatch.mjs +128 -0
- package/dist/esm/llm/providerTextBatch.mjs.map +1 -0
- package/dist/esm/llm/providerTextBoundary.mjs +81 -12
- package/dist/esm/llm/providerTextBoundary.mjs.map +1 -1
- package/dist/esm/main.mjs +7 -6
- package/dist/esm/messages/alternation.mjs +1 -1
- package/dist/esm/messages/anthropicServerTools.mjs +18 -0
- package/dist/esm/messages/anthropicServerTools.mjs.map +1 -0
- package/dist/esm/messages/budget.mjs +1 -1
- package/dist/esm/messages/core.mjs +3 -2
- package/dist/esm/messages/core.mjs.map +1 -1
- package/dist/esm/messages/format.mjs +2 -2
- package/dist/esm/messages/index.mjs +1 -1
- package/dist/esm/messages/prune.mjs +1 -1
- package/dist/esm/messages/recency.mjs +1 -1
- package/dist/esm/messages/toolResultTypes.mjs +21 -45
- package/dist/esm/messages/toolResultTypes.mjs.map +1 -1
- package/dist/esm/protection/providerText.mjs +58 -7
- package/dist/esm/protection/providerText.mjs.map +1 -1
- package/dist/esm/protection/providerTextAdmission.mjs +5 -0
- package/dist/esm/protection/providerTextAdmission.mjs.map +1 -1
- package/dist/esm/protection/toolResult.mjs +114 -0
- package/dist/esm/protection/toolResult.mjs.map +1 -0
- package/dist/esm/run.mjs +14 -3
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/runtime/client.mjs +4 -0
- package/dist/esm/runtime/client.mjs.map +1 -1
- package/dist/esm/stream.mjs +10 -2
- package/dist/esm/stream.mjs.map +1 -1
- package/dist/esm/summarization/node.mjs +1 -1
- package/dist/esm/tools/ToolNode.mjs +46 -13
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/handlers.mjs +47 -2
- package/dist/esm/tools/handlers.mjs.map +1 -1
- package/dist/esm/tools/search/citations.mjs +190 -0
- package/dist/esm/tools/search/citations.mjs.map +1 -0
- package/dist/esm/tools/search/content.mjs +163 -42
- package/dist/esm/tools/search/content.mjs.map +1 -1
- package/dist/esm/tools/search/firecrawl.mjs +4 -9
- package/dist/esm/tools/search/firecrawl.mjs.map +1 -1
- package/dist/esm/tools/search/google.mjs +67 -0
- package/dist/esm/tools/search/google.mjs.map +1 -0
- package/dist/esm/tools/search/openai.mjs +80 -0
- package/dist/esm/tools/search/openai.mjs.map +1 -0
- package/dist/esm/tools/subagent/SubagentExecutor.mjs +4 -0
- package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
- package/dist/esm/utils/tokens.mjs +12 -2
- package/dist/esm/utils/tokens.mjs.map +1 -1
- package/dist/types/common/index.d.ts +2 -2
- package/dist/types/decisions/breaker.d.ts +2 -2
- package/dist/types/decisions/core.d.ts +13 -13
- package/dist/types/decisions/dialect.d.ts +1 -1
- package/dist/types/decisions/http.d.ts +2 -2
- package/dist/types/decisions/index.d.ts +5 -5
- package/dist/types/decisions/node.d.ts +2 -2
- package/dist/types/decisions/presets.d.ts +2 -2
- package/dist/types/decisions/probe.d.ts +1 -1
- package/dist/types/decisions/questions.d.ts +1 -1
- package/dist/types/decisions/structuredChat.d.ts +2 -2
- package/dist/types/decisions/transport.d.ts +1 -1
- package/dist/types/eventActor/EventActorExecutor.d.ts +1 -1
- package/dist/types/eventActor/index.d.ts +2 -2
- package/dist/types/graphs/Graph.d.ts +18 -2
- package/dist/types/graphs/MultiAgentGraph.d.ts +1 -1
- package/dist/types/graphs/applyGraphRuntimeConfig.d.ts +1 -1
- package/dist/types/graphs/graphFactory.d.ts +1 -1
- package/dist/types/graphs/index.d.ts +5 -5
- package/dist/types/harness/fileBindings.d.ts +2 -2
- package/dist/types/harness/fileService.d.ts +2 -2
- package/dist/types/harness/fileStream.d.ts +1 -1
- package/dist/types/harness/index.d.ts +15 -15
- package/dist/types/harness/model.d.ts +1 -1
- package/dist/types/harness/modelService.d.ts +2 -2
- package/dist/types/harness/modelStreamCallbacks.d.ts +1 -1
- package/dist/types/harness/providerText.d.ts +1 -1
- package/dist/types/hitl/index.d.ts +3 -3
- package/dist/types/hooks/HookRegistry.d.ts +1 -1
- package/dist/types/hooks/createToolPolicyHook.d.ts +1 -1
- package/dist/types/hooks/createWorkspacePolicyHook.d.ts +1 -1
- package/dist/types/hooks/executeHooks.d.ts +2 -2
- package/dist/types/hooks/index.d.ts +11 -11
- package/dist/types/index.d.ts +62 -60
- package/dist/types/langchain/index.d.ts +8 -8
- package/dist/types/llm/anthropic/utils/container.d.ts +4 -0
- package/dist/types/llm/anthropic/utils/message_inputs.d.ts +1 -1
- package/dist/types/llm/anthropic/utils/message_outputs.d.ts +1 -1
- package/dist/types/llm/anthropic/utils/stream_events.d.ts +1 -1
- package/dist/types/llm/bedrock/index.d.ts +2 -3
- package/dist/types/llm/bedrock/utils/harmony.d.ts +1 -1
- package/dist/types/llm/bedrock/utils/index.d.ts +2 -2
- package/dist/types/llm/bedrock/utils/message_inputs.d.ts +3 -12
- package/dist/types/llm/bedrock/utils/message_outputs.d.ts +1 -1
- package/dist/types/llm/google/index.d.ts +2 -2
- package/dist/types/llm/google/utils/common.d.ts +1 -1
- package/dist/types/llm/google/utils/tools.d.ts +1 -1
- package/dist/types/llm/openai/index.d.ts +1 -1
- package/dist/types/llm/openai/typedContent.d.ts +14 -0
- package/dist/types/llm/providerRegistry.d.ts +1 -1
- package/dist/types/llm/providerTextBatch.d.ts +26 -0
- package/dist/types/llm/providerTextBoundary.d.ts +7 -1
- package/dist/types/llm/providers.d.ts +1 -1
- package/dist/types/messages/anthropicServerTools.d.ts +13 -0
- package/dist/types/messages/contextPruning.d.ts +1 -1
- package/dist/types/messages/core.d.ts +4 -4
- package/dist/types/messages/format.d.ts +1 -1
- package/dist/types/messages/index.d.ts +21 -21
- package/dist/types/messages/prune.d.ts +1 -1
- package/dist/types/openai/index.d.ts +2 -2
- package/dist/types/openai/toolProjection.d.ts +1 -1
- package/dist/types/prompts/index.d.ts +2 -2
- package/dist/types/protection/providerText.d.ts +32 -2
- package/dist/types/protection/providerTextAdmission.d.ts +1 -0
- package/dist/types/protection/toolResult.d.ts +69 -0
- package/dist/types/provider-registration.d.ts +1 -1
- package/dist/types/rerank/bm25.d.ts +1 -1
- package/dist/types/rerank/core.d.ts +17 -17
- package/dist/types/rerank/crossEncoder.d.ts +3 -3
- package/dist/types/rerank/fallback.d.ts +1 -1
- package/dist/types/rerank/index.d.ts +2 -2
- package/dist/types/rerank/outcome.d.ts +2 -2
- package/dist/types/rerank/pin.d.ts +2 -2
- package/dist/types/rerank/search.d.ts +1 -1
- package/dist/types/rerank/systemone.d.ts +4 -4
- package/dist/types/rerank/types.d.ts +1 -1
- package/dist/types/run.d.ts +1 -0
- package/dist/types/runtime/admission.d.ts +1 -1
- package/dist/types/runtime/checkpoint.d.ts +1 -1
- package/dist/types/runtime/client.d.ts +2 -2
- package/dist/types/runtime/files.d.ts +3 -3
- package/dist/types/runtime/hostTools.d.ts +2 -2
- package/dist/types/runtime/index.d.ts +12 -12
- package/dist/types/runtime/model.d.ts +5 -5
- package/dist/types/runtime/policy.d.ts +3 -3
- package/dist/types/runtime/recovery/client.d.ts +3 -3
- package/dist/types/runtime/recovery/log.d.ts +2 -2
- package/dist/types/runtime/recovery/redis.d.ts +1 -1
- package/dist/types/runtime/recovery/server.d.ts +3 -3
- package/dist/types/runtime/resume.d.ts +1 -1
- package/dist/types/runtime/server.d.ts +3 -3
- package/dist/types/runtime/snapshot.d.ts +1 -1
- package/dist/types/runtime/types.d.ts +2 -2
- package/dist/types/session/AgentSession.d.ts +2 -2
- package/dist/types/session/JsonlSessionStore.d.ts +1 -1
- package/dist/types/session/deriveMessages.d.ts +1 -1
- package/dist/types/session/handlers.d.ts +1 -1
- package/dist/types/session/index.d.ts +7 -7
- package/dist/types/session/messageSerialization.d.ts +1 -1
- package/dist/types/session/sessionProjection.d.ts +3 -3
- package/dist/types/summarization/index.d.ts +2 -2
- package/dist/types/tools/BashProgrammaticToolCalling.d.ts +1 -1
- package/dist/types/tools/GitHubCompare.d.ts +6 -6
- package/dist/types/tools/ProgrammaticToolCalling.d.ts +1 -1
- package/dist/types/tools/ReadFile.d.ts +6 -6
- package/dist/types/tools/SkillTool.d.ts +6 -6
- package/dist/types/tools/ToolNode.d.ts +5 -1
- package/dist/types/tools/cloudflare/index.d.ts +4 -4
- package/dist/types/tools/handlers.d.ts +13 -0
- package/dist/types/tools/local/FileCheckpointer.d.ts +1 -1
- package/dist/types/tools/local/LocalExecutionEngine.d.ts +1 -1
- package/dist/types/tools/local/attachments.d.ts +1 -1
- package/dist/types/tools/local/index.d.ts +12 -12
- package/dist/types/tools/search/anthropic.d.ts +1 -1
- package/dist/types/tools/search/citations.d.ts +88 -0
- package/dist/types/tools/search/content.d.ts +38 -1
- package/dist/types/tools/search/crw-scraper.d.ts +1 -1
- package/dist/types/tools/search/crw-search.d.ts +1 -1
- package/dist/types/tools/search/firecrawl.d.ts +4 -2
- package/dist/types/tools/search/format.d.ts +1 -1
- package/dist/types/tools/search/google.d.ts +11 -0
- package/dist/types/tools/search/highlights.d.ts +1 -1
- package/dist/types/tools/search/index.d.ts +3 -3
- package/dist/types/tools/search/keenable-scraper.d.ts +1 -1
- package/dist/types/tools/search/keenable-search.d.ts +1 -1
- package/dist/types/tools/search/metrics.d.ts +1 -1
- package/dist/types/tools/search/openai.d.ts +3 -0
- package/dist/types/tools/search/rerankers.d.ts +1 -1
- package/dist/types/tools/search/schema.d.ts +6 -6
- package/dist/types/tools/search/search.d.ts +1 -1
- package/dist/types/tools/search/serper-scraper.d.ts +1 -1
- package/dist/types/tools/search/tavily-scraper.d.ts +1 -1
- package/dist/types/tools/search/tavily-search.d.ts +1 -1
- package/dist/types/tools/search/tool.d.ts +3 -3
- package/dist/types/tools/search/types.d.ts +26 -2
- package/dist/types/tools/search/utils.d.ts +3 -3
- package/dist/types/tools/subagent/SubagentExecutionRegistry.d.ts +1 -1
- package/dist/types/tools/subagent/SubagentExecutor.d.ts +6 -3
- package/dist/types/tools/subagent/diagnostics.d.ts +1 -1
- package/dist/types/tools/subagent/index.d.ts +7 -7
- package/dist/types/types/attachments.d.ts +1 -1
- package/dist/types/types/graph.d.ts +4 -1
- package/dist/types/types/index.d.ts +14 -14
- package/dist/types/types/llm.d.ts +2 -2
- package/dist/types/types/run.d.ts +3 -1
- package/dist/types/types/stream.d.ts +12 -0
- package/dist/types/types/subagentTasks.d.ts +2 -2
- package/dist/types/types/tools.d.ts +6 -3
- package/dist/types/utils/index.d.ts +10 -10
- package/dist/types/utils/tokens.d.ts +2 -0
- package/package.json +3 -2
- package/src/graphs/Graph.ts +125 -3
- package/src/harness/providerText.ts +1 -0
- package/src/index.ts +10 -0
- package/src/llm/anthropic/index.ts +11 -3
- package/src/llm/anthropic/utils/container.ts +63 -0
- package/src/llm/anthropic/utils/message_inputs.ts +57 -51
- package/src/llm/anthropic/utils/message_outputs.ts +12 -39
- package/src/llm/anthropic/utils/stream_events.ts +17 -12
- package/src/llm/bedrock/index.ts +7 -5
- package/src/llm/bedrock/utils/message_inputs.ts +28 -35
- package/src/llm/google/utils/common.ts +88 -36
- package/src/llm/google/utils/signatures.ts +52 -36
- package/src/llm/init.ts +35 -3
- package/src/llm/invoke.ts +160 -16
- package/src/llm/openai/index.ts +18 -5
- package/src/llm/openai/typedContent.ts +110 -0
- package/src/llm/prepareProviderRequest.ts +154 -4
- package/src/llm/providerTextBatch.ts +158 -0
- package/src/llm/providerTextBoundary.ts +119 -13
- package/src/messages/anthropicServerTools.ts +24 -0
- package/src/messages/core.ts +12 -11
- package/src/messages/toolResultTypes.ts +80 -88
- package/src/protection/providerText.ts +222 -46
- package/src/protection/providerTextAdmission.ts +6 -0
- package/src/protection/toolResult.ts +272 -0
- package/src/run.ts +37 -5
- package/src/runtime/client.ts +6 -0
- package/src/stream.ts +23 -2
- package/src/tools/ToolNode.ts +112 -17
- package/src/tools/handlers.ts +110 -5
- package/src/tools/search/citations.ts +375 -0
- package/src/tools/search/content.ts +282 -62
- package/src/tools/search/firecrawl.ts +13 -16
- package/src/tools/search/google.ts +122 -0
- package/src/tools/search/openai.ts +118 -0
- package/src/tools/search/types.ts +21 -0
- package/src/tools/subagent/SubagentExecutor.ts +6 -0
- package/src/types/graph.ts +3 -0
- package/src/types/run.ts +3 -0
- package/src/types/stream.ts +9 -0
- package/src/types/tools.ts +3 -0
- package/src/utils/tokens.ts +37 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OpenAIClient } from '@langchain/openai';
|
|
2
|
+
type Chunk = OpenAIClient.Chat.Completions.ChatCompletionChunk;
|
|
3
|
+
type Completion = OpenAIClient.Chat.Completions.ChatCompletion;
|
|
4
|
+
/**
|
|
5
|
+
* Rewrites a streamed chunk whose `delta.content` is a typed list as string
|
|
6
|
+
* content with the reasoning in `reasoning_content`, or returns `undefined`
|
|
7
|
+
* when the content is not a list. The chunk that closes the reasoning also
|
|
8
|
+
* opens the answer or a tool call, so it splits in two: the reasoning first,
|
|
9
|
+
* then the rest of the delta.
|
|
10
|
+
*/
|
|
11
|
+
export declare function splitTypedDeltaContent(chunk: Chunk): Chunk[] | undefined;
|
|
12
|
+
/** Rewrites the typed `message.content` lists of a non-streamed completion. */
|
|
13
|
+
export declare function flattenTypedMessageContent(completion: Completion): Completion;
|
|
14
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
-
import type { ProviderFamily, ProviderRegistrationOptions } from '../provider-registration';
|
|
2
|
+
import type { ProviderFamily, ProviderRegistrationOptions } from '../provider-registration.js';
|
|
3
3
|
import type { ProviderModelConstructor, ProviderName } from '../types/index.js';
|
|
4
4
|
type ProviderModelClass = new (config: never) => BaseChatModel;
|
|
5
5
|
/** Registers one host provider until the returned disposer is called. */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ChatGenerationChunk } from '@langchain/core/outputs';
|
|
2
|
+
import type { ProviderTextAttempt, ProviderTextBatching } from '../protection/providerText.js';
|
|
3
|
+
/** A single provider read can overlap inspection or downstream publication. */
|
|
4
|
+
export declare class ProviderTextBatch {
|
|
5
|
+
private readonly attempt;
|
|
6
|
+
private readonly options;
|
|
7
|
+
private readonly admit;
|
|
8
|
+
private parts;
|
|
9
|
+
private freshBytes;
|
|
10
|
+
private bytes;
|
|
11
|
+
private stagedText;
|
|
12
|
+
private stagedControl;
|
|
13
|
+
private reading;
|
|
14
|
+
private next?;
|
|
15
|
+
private timer?;
|
|
16
|
+
private deadline;
|
|
17
|
+
private wake?;
|
|
18
|
+
private closed;
|
|
19
|
+
constructor(attempt: ProviderTextAttempt, options: ProviderTextBatching, admit: (chunk: ChatGenerationChunk) => number);
|
|
20
|
+
private prefetch;
|
|
21
|
+
read(source: AsyncGenerator<ChatGenerationChunk>): Promise<IteratorResult<ChatGenerationChunk> | 'flush'>;
|
|
22
|
+
append(text: string): void;
|
|
23
|
+
flush(final: boolean): Promise<string>;
|
|
24
|
+
private resetTimer;
|
|
25
|
+
close(): void;
|
|
26
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ProviderTextProtection } from '../protection/providerText.js';
|
|
2
2
|
import type { ChatModel, ProviderName } from '../types/index.js';
|
|
3
|
+
import { ProviderTextAttempt } from '../protection/providerText.js';
|
|
4
|
+
interface BatchInvocation {
|
|
5
|
+
getAttempt: (signal?: AbortSignal) => ProviderTextAttempt;
|
|
6
|
+
dispatchStart?: (attempt: ProviderTextAttempt) => void | Promise<void>;
|
|
7
|
+
}
|
|
3
8
|
/** Clone only known runnable shells. Never mutate a shared provider or its callback configuration. */
|
|
4
|
-
export declare function withProviderTextBoundary(model: ChatModel, policy: ProviderTextProtection, provider?: ProviderName): ChatModel;
|
|
9
|
+
export declare function withProviderTextBoundary(model: ChatModel, policy: ProviderTextProtection, provider?: ProviderName, batchInvocation?: BatchInvocation): ChatModel;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ProviderModelConstructor, ProviderName } from '../types/index.js';
|
|
2
2
|
export declare const getChatModelClass: <P extends ProviderName>(provider: P) => ProviderModelConstructor<P>;
|
|
3
3
|
export { getProviderFamily, providerRequiresStrictAlternation, providerUsesManualToolStream, registerProvider, } from './providerRegistry.js';
|
|
4
|
-
export type { ProviderFamily, ProviderRegistrationOptions, } from '../provider-registration';
|
|
4
|
+
export type { ProviderFamily, ProviderRegistrationOptions, } from '../provider-registration.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ANTHROPIC_SERVER_TOOL_NAMES_BY_RESULT_TYPE: {
|
|
2
|
+
readonly advisor_tool_result: readonly ["advisor"];
|
|
3
|
+
readonly bash_code_execution_tool_result: readonly ["bash_code_execution"];
|
|
4
|
+
readonly code_execution_tool_result: readonly ["code_execution"];
|
|
5
|
+
readonly text_editor_code_execution_tool_result: readonly ["text_editor_code_execution"];
|
|
6
|
+
readonly tool_search_tool_result: readonly ["tool_search_tool_regex", "tool_search_tool_bm25"];
|
|
7
|
+
readonly web_fetch_tool_result: readonly ["web_fetch"];
|
|
8
|
+
readonly web_search_tool_result: readonly ["web_search"];
|
|
9
|
+
};
|
|
10
|
+
type AnthropicServerToolResultType = keyof typeof ANTHROPIC_SERVER_TOOL_NAMES_BY_RESULT_TYPE;
|
|
11
|
+
export declare const ANTHROPIC_SERVER_TOOL_RESULT_TYPES: AnthropicServerToolResultType[];
|
|
12
|
+
export declare function isAnthropicServerToolResultType(type: string | undefined): type is AnthropicServerToolResultType;
|
|
13
|
+
export {};
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* they fit; oversized inline payloads are replaced with bounded placeholders.
|
|
14
14
|
*/
|
|
15
15
|
import { type BaseMessage } from '@langchain/core/messages';
|
|
16
|
-
import type { ContextPruningSettings } from './contextPruningSettings';
|
|
16
|
+
import type { ContextPruningSettings } from './contextPruningSettings.js';
|
|
17
17
|
import type { ContextPruningConfig } from '../types/graph.js';
|
|
18
18
|
import type { TokenCounter } from '../types/run.js';
|
|
19
19
|
export interface ContextPruningResult {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIMessage, BaseMessage, ToolMessage, HumanMessage, AIMessageChunk } from '@langchain/core/messages';
|
|
2
|
+
import type { ToolHistoryPreparation } from './toolHistoryProjection.js';
|
|
2
3
|
import type * as t from '../types/index.js';
|
|
3
|
-
import type { ToolHistoryPreparation } from './toolHistoryProjection';
|
|
4
4
|
export declare function getConverseOverrideMessage({ userMessage, lastMessageX, lastMessageY, }: {
|
|
5
5
|
userMessage: string[];
|
|
6
6
|
lastMessageX: AIMessageChunk | null;
|
|
@@ -20,15 +20,15 @@ export declare function getConverseOverrideMessage({ userMessage, lastMessageX,
|
|
|
20
20
|
* Exact matching prevents unrelated custom block types that happen to share a
|
|
21
21
|
* prefix from being silently classified as hidden reasoning.
|
|
22
22
|
*/
|
|
23
|
-
export { isReasoningContentBlock } from './reasoningTypes';
|
|
23
|
+
export { isReasoningContentBlock } from './reasoningTypes.js';
|
|
24
24
|
export declare function modifyDeltaProperties(provider: t.ProviderName, obj?: AIMessageChunk): AIMessageChunk | undefined;
|
|
25
25
|
export declare function formatAnthropicMessage(message: AIMessageChunk): AIMessage;
|
|
26
26
|
export declare function convertMessagesToContent(messages: BaseMessage[]): t.MessageContentComplex[];
|
|
27
27
|
type ResponsesReplayProjection = 'fallback' | 'native';
|
|
28
|
-
export { OPENAI_RESPONSES_REPLAY_POSITIONS_KEY } from './toolHistoryProjection';
|
|
28
|
+
export { OPENAI_RESPONSES_REPLAY_POSITIONS_KEY } from './toolHistoryProjection.js';
|
|
29
29
|
/** Reasoning item currently streaming, so a terminal ciphertext seals against its own id. */
|
|
30
30
|
export declare const OPENAI_RESPONSES_ACTIVE_REASONING_ID_KEY = "__openai_responses_active_reasoning_id__";
|
|
31
|
-
export type { ResponsesReplayPosition } from './toolHistoryProjection';
|
|
31
|
+
export type { ResponsesReplayPosition } from './toolHistoryProjection.js';
|
|
32
32
|
/** Drops incomplete streamed text blocks before provider-facing tool shaping. */
|
|
33
33
|
export declare function dropIncompleteToolStreamContent(content: AIMessage['content']): AIMessage['content'];
|
|
34
34
|
/** Applies sealed-Responses safety and drops incomplete streamed text input. */
|
|
@@ -2,7 +2,7 @@ import { AIMessage, ToolMessage, BaseMessage, HumanMessage, SystemMessage } from
|
|
|
2
2
|
import type { MessageContentImageUrl } from '@langchain/core/messages';
|
|
3
3
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
4
4
|
import type { MessageContentComplex, TPayload, ProviderName, CompactionSemanticIndex, CompactionSemanticIndexSnapshot } from '../types/index.js';
|
|
5
|
-
import type { ToolHistoryPreparation } from './toolHistoryProjection';
|
|
5
|
+
import type { ToolHistoryPreparation } from './toolHistoryProjection.js';
|
|
6
6
|
import { Providers } from '../common/index.js';
|
|
7
7
|
interface MediaMessageParams {
|
|
8
8
|
message: {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export * from './ids';
|
|
3
|
-
export * from './prune';
|
|
4
|
-
export { syncBudgetDerivedFields } from './budget';
|
|
5
|
-
export * from './format';
|
|
6
|
-
export * from './cache';
|
|
7
|
-
export * from './anthropicToolCache';
|
|
8
|
-
export * from './content';
|
|
9
|
-
export * from './tools';
|
|
10
|
-
export * from './injected';
|
|
11
|
-
export * from './alternation';
|
|
12
|
-
export * from './handoffCue';
|
|
13
|
-
export * from './contextPruning';
|
|
14
|
-
export * from './contextPruningSettings';
|
|
15
|
-
export * from './reducer';
|
|
16
|
-
export * from './recency';
|
|
17
|
-
export * from './assistantPhase';
|
|
18
|
-
export * from './provenance';
|
|
19
|
-
export * from './projectionInvariant';
|
|
20
|
-
export * from './fading';
|
|
21
|
-
export { toStoredMessage } from './stored';
|
|
1
|
+
export * from './core.js';
|
|
2
|
+
export * from './ids.js';
|
|
3
|
+
export * from './prune.js';
|
|
4
|
+
export { syncBudgetDerivedFields } from './budget.js';
|
|
5
|
+
export * from './format.js';
|
|
6
|
+
export * from './cache.js';
|
|
7
|
+
export * from './anthropicToolCache.js';
|
|
8
|
+
export * from './content.js';
|
|
9
|
+
export * from './tools.js';
|
|
10
|
+
export * from './injected.js';
|
|
11
|
+
export * from './alternation.js';
|
|
12
|
+
export * from './handoffCue.js';
|
|
13
|
+
export * from './contextPruning.js';
|
|
14
|
+
export * from './contextPruningSettings.js';
|
|
15
|
+
export * from './reducer.js';
|
|
16
|
+
export * from './recency.js';
|
|
17
|
+
export * from './assistantPhase.js';
|
|
18
|
+
export * from './provenance.js';
|
|
19
|
+
export * from './projectionInvariant.js';
|
|
20
|
+
export * from './fading.js';
|
|
21
|
+
export { toStoredMessage } from './stored.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseMessage, UsageMetadata } from '@langchain/core/messages';
|
|
2
2
|
import type { ContextPruningConfig, FadingTier } from '../types/graph.js';
|
|
3
|
-
import type { FadingCaps } from './fading';
|
|
3
|
+
import type { FadingCaps } from './fading.js';
|
|
4
4
|
import type { TokenCounter } from '../types/run.js';
|
|
5
5
|
import type { ProviderName } from '../types/index.js';
|
|
6
6
|
import { ContentTypes } from '../common/index.js';
|
|
@@ -73,5 +73,5 @@ export declare function createChatCompletionUsageChunk(context: OpenAIResponseCo
|
|
|
73
73
|
export declare function writeOpenAISSE(writer: OpenAICompatibleWriter, data: OpenAIChatCompletionChunk | '[DONE]'): Promise<void>;
|
|
74
74
|
export declare function createOpenAIHandlers(config: OpenAIHandlerConfig): Record<string, t.EventHandler>;
|
|
75
75
|
export declare function sendOpenAIFinalChunk(config: OpenAIHandlerConfig, finishReason?: OpenAIChatCompletionChunkChoice['finish_reason']): Promise<void>;
|
|
76
|
-
export { createOpenAIToolCallStream } from './toolProjection';
|
|
77
|
-
export type { OpenAIToolCallStream, OpenAIToolCallStreamConfig, } from './toolProjection';
|
|
76
|
+
export { createOpenAIToolCallStream } from './toolProjection.js';
|
|
77
|
+
export type { OpenAIToolCallStream, OpenAIToolCallStreamConfig, } from './toolProjection.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OpenAIChatCompletionChunkChoice, OpenAIToolCall, OpenAIStreamTracker } from './index';
|
|
1
|
+
import type { OpenAIChatCompletionChunkChoice, OpenAIToolCall, OpenAIStreamTracker } from './index.js';
|
|
2
2
|
import type { EventHandler } from '../types/index.js';
|
|
3
3
|
interface OpenAIToolCallStreamOptions {
|
|
4
4
|
/** Synchronous framing only. Async transport/backpressure is a separate boundary. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './collab';
|
|
2
|
-
export * from './taskmanager';
|
|
1
|
+
export * from './collab.js';
|
|
2
|
+
export * from './taskmanager.js';
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import type { ProviderTextAdmission } from './providerTextAdmission';
|
|
1
|
+
import type { ProviderTextAdmission } from './providerTextAdmission.js';
|
|
2
2
|
export declare const PROVIDER_TEXT_PROTECTION_VERSION = 1;
|
|
3
|
+
export declare const PROVIDER_TEXT_BATCHING_VERSION = 1;
|
|
4
|
+
export declare const BATCHED_PROVIDER_EVENT_OWNER = "librechat:batched-provider-event-owner";
|
|
5
|
+
/**
|
|
6
|
+
* Opt in only when every rule is substring-local with a certified maximum match width.
|
|
7
|
+
* No anchors, surrounding-context assertions, or partial rewrites. Classification and
|
|
8
|
+
* inspection must be valid over overlapping UTF-16 windows. Omit this option to inspect
|
|
9
|
+
* the whole reply without releasing any prose early.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProviderTextBatching {
|
|
12
|
+
readonly version: 1;
|
|
13
|
+
readonly batchBytes: number;
|
|
14
|
+
readonly flushMs: number;
|
|
15
|
+
readonly maxMatchChars: number;
|
|
16
|
+
}
|
|
3
17
|
export type ProviderTextProtectionErrorCode = 'blocked' | 'unavailable' | 'timeout' | 'overflow' | 'cancelled' | 'unsupported' | 'incompatible';
|
|
4
18
|
export type ProviderTextProtectionResult = {
|
|
5
19
|
readonly version: 1;
|
|
@@ -26,6 +40,7 @@ export interface ProviderTextProtection {
|
|
|
26
40
|
readonly maxAttemptBytes: number;
|
|
27
41
|
/** Shared across all attempts using this policy, including child graphs. */
|
|
28
42
|
readonly maxBufferedBytes: number;
|
|
43
|
+
readonly batching?: ProviderTextBatching;
|
|
29
44
|
readonly classify: (content: string) => 'prose' | 'unsupported';
|
|
30
45
|
readonly inspect: (input: {
|
|
31
46
|
readonly version: 1;
|
|
@@ -74,9 +89,15 @@ export declare class ProviderTextAttempt {
|
|
|
74
89
|
private readonly timer;
|
|
75
90
|
private readonly abort;
|
|
76
91
|
private finished;
|
|
92
|
+
private publishedText;
|
|
93
|
+
private finishHeld;
|
|
94
|
+
private finishPending;
|
|
77
95
|
private readonly admission?;
|
|
78
96
|
constructor(policy: ProviderTextProtection, parent?: AbortSignal | undefined, options?: ProviderTextAttemptOptions);
|
|
79
97
|
get signal(): AbortSignal;
|
|
98
|
+
followSignal(signal?: AbortSignal): (() => void) | undefined;
|
|
99
|
+
get hasPublishedText(): boolean;
|
|
100
|
+
markTextPublished(): void;
|
|
80
101
|
check(): void;
|
|
81
102
|
private charge;
|
|
82
103
|
append(text: string, cumulativeReplay?: boolean): void;
|
|
@@ -84,8 +105,17 @@ export declare class ProviderTextAttempt {
|
|
|
84
105
|
private hasCandidatePrefix;
|
|
85
106
|
matchesText(text: string): boolean;
|
|
86
107
|
retain(bytes: number): void;
|
|
108
|
+
/** Release staged window charges after its raw references and inspector have settled. */
|
|
109
|
+
releaseWindow(bytes: number): void;
|
|
110
|
+
stop(error: ProviderTextProtectionError): void;
|
|
87
111
|
observeChunk(): void;
|
|
88
|
-
|
|
112
|
+
/** Approved-text callbacks can stop blocking cleanup without retaining raw capacity. */
|
|
113
|
+
wait<T>(work: Promise<T>, retain?: boolean): Promise<T>;
|
|
114
|
+
inspect(content: string): Promise<string>;
|
|
89
115
|
release(): Promise<string>;
|
|
116
|
+
/** Native prefetch can end the iterator while the invocation still dispatches its final chunk. */
|
|
117
|
+
holdFinish(): () => void;
|
|
90
118
|
finish(): void;
|
|
91
119
|
}
|
|
120
|
+
/** Returns the canonical text of a host inspection result, or throws its failure code. */
|
|
121
|
+
export declare function readProviderTextResult(result: ProviderTextProtectionResult): string;
|
|
@@ -12,6 +12,7 @@ export interface ProviderTextAdmissionSnapshot {
|
|
|
12
12
|
/** Internal ownership lease; only the attempt that acquires it may release it. */
|
|
13
13
|
export interface ProviderTextAdmissionLease {
|
|
14
14
|
charge(bytes: number): void;
|
|
15
|
+
uncharge(bytes: number): void;
|
|
15
16
|
retain(): void;
|
|
16
17
|
release(): void;
|
|
17
18
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ToolMessage } from '@langchain/core/messages';
|
|
2
|
+
import type { ProviderTextProtection, ProviderTextProtectionResult, ProviderTextProtectionErrorCode } from './providerText.js';
|
|
3
|
+
import type { ToolExecuteResult } from '../types/tools.js';
|
|
4
|
+
import { ProviderTextProtectionError } from './providerText.js';
|
|
5
|
+
export declare const TOOL_RESULT_PROTECTION_VERSION = 1;
|
|
6
|
+
export type ToolResultProtectionResult = ProviderTextProtectionResult;
|
|
7
|
+
/**
|
|
8
|
+
* Host inspection of the text returned by selected tools. Default off.
|
|
9
|
+
*
|
|
10
|
+
* The SDK calls `inspect` on a selected tool's text before anything else reads
|
|
11
|
+
* it: hooks, completion events, the output reference registry, checkpoints and
|
|
12
|
+
* the model all receive the inspected text. A failed inspection ends the run
|
|
13
|
+
* with a {@link ToolResultProtectionError}.
|
|
14
|
+
*
|
|
15
|
+
* Trust boundary: the tool's text is untrusted data; code running in the host
|
|
16
|
+
* process is trusted. Tools, hooks, event handlers, callbacks and checkpoint
|
|
17
|
+
* savers are not defended against, text they author is not inspected, and
|
|
18
|
+
* history the host supplies is the host's to have inspected. Tracing observes
|
|
19
|
+
* a selected tool's raw result; redact those tools with the tracing
|
|
20
|
+
* configuration.
|
|
21
|
+
*
|
|
22
|
+
* Selected tools must return plain text. A structured result, an artifact or a
|
|
23
|
+
* `Command` fails as `unsupported`. Selected tools are not offered to
|
|
24
|
+
* programmatic tool calling, are not started eagerly, and cannot be client
|
|
25
|
+
* delegated. Unselected tools are untouched.
|
|
26
|
+
*/
|
|
27
|
+
export interface ToolResultProtection {
|
|
28
|
+
readonly version: 1;
|
|
29
|
+
readonly toolNames: readonly string[];
|
|
30
|
+
readonly timeoutMs: number;
|
|
31
|
+
readonly maxAttemptBytes: number;
|
|
32
|
+
/** Shared across all inspections using this policy, including child graphs. */
|
|
33
|
+
readonly maxBufferedBytes: number;
|
|
34
|
+
readonly classify: (content: string) => 'prose' | 'unsupported';
|
|
35
|
+
readonly inspect: (input: {
|
|
36
|
+
readonly version: 1;
|
|
37
|
+
readonly content: string;
|
|
38
|
+
readonly toolName: string;
|
|
39
|
+
readonly toolCallId: string;
|
|
40
|
+
readonly target: {
|
|
41
|
+
readonly source: 'tool_argument';
|
|
42
|
+
readonly field: 'output';
|
|
43
|
+
readonly provenance: 'tool';
|
|
44
|
+
readonly outcome: ToolResultOutcome;
|
|
45
|
+
};
|
|
46
|
+
readonly signal: AbortSignal;
|
|
47
|
+
}) => ToolResultProtectionResult | Promise<ToolResultProtectionResult>;
|
|
48
|
+
}
|
|
49
|
+
export declare class ToolResultProtectionError extends ProviderTextProtectionError {
|
|
50
|
+
constructor(code: ProviderTextProtectionErrorCode);
|
|
51
|
+
}
|
|
52
|
+
export type ToolResultOutcome = 'success' | 'error';
|
|
53
|
+
export interface ToolResultCall {
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly id: string;
|
|
56
|
+
}
|
|
57
|
+
/** A validated policy. One per policy object, so every graph of a run shares its byte budget. */
|
|
58
|
+
export interface ToolResultGate {
|
|
59
|
+
readonly policy: ToolResultProtection;
|
|
60
|
+
readonly toolNames: ReadonlySet<string>;
|
|
61
|
+
readonly budget: ProviderTextProtection;
|
|
62
|
+
}
|
|
63
|
+
export declare function createToolResultGate(policy: ToolResultProtection): ToolResultGate;
|
|
64
|
+
/** Returns the inspected text, or throws; the raw text and inspector errors never leave. */
|
|
65
|
+
export declare function inspectToolText(gate: ToolResultGate, call: ToolResultCall, content: string, outcome: ToolResultOutcome, signal?: AbortSignal): Promise<string>;
|
|
66
|
+
/** Inspects what a selected in-process tool returned. */
|
|
67
|
+
export declare function inspectToolOutput(gate: ToolResultGate, call: ToolResultCall, output: unknown, signal?: AbortSignal): Promise<ToolMessage | string>;
|
|
68
|
+
/** Inspects what the host returned for a selected tool call. */
|
|
69
|
+
export declare function inspectToolExecuteResult(gate: ToolResultGate, call: ToolResultCall, result: ToolExecuteResult, signal?: AbortSignal): Promise<ToolExecuteResult>;
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
* import. The web-search adapter stays on the root entry because it extends
|
|
6
6
|
* the search tool's reranker.
|
|
7
7
|
*/
|
|
8
|
-
export type * from './types';
|
|
9
|
-
export { createSystemOneReranker } from './systemone';
|
|
10
|
-
export type { SystemOnePin, SystemOneMode, SystemOneReranker, SystemOneRerankerOptions, } from './systemone';
|
|
11
|
-
export { createCrossEncoderReranker } from './crossEncoder';
|
|
12
|
-
export type { CrossEncoderRerankerOptions } from './crossEncoder';
|
|
13
|
-
export { createBm25Reranker, corpusStats, tokenizeCode } from './bm25';
|
|
14
|
-
export type { Bm25RerankerOptions, CorpusStats, Tokenize } from './bm25';
|
|
15
|
-
export { noneReranker, withFallback, STEP_GRACE_MS } from './fallback';
|
|
16
|
-
export type { FallbackStep, FallbackOptions, FallbackReranker, } from './fallback';
|
|
17
|
-
export { probePin, PIN_SENTINEL_MODEL } from './pin';
|
|
18
|
-
export type { PinProbe, PinProbeOptions } from './pin';
|
|
19
|
-
export { createSemaphore } from './semaphore';
|
|
20
|
-
export type { RerankSemaphore } from './semaphore';
|
|
21
|
-
export { createScoreCache } from './cache';
|
|
22
|
-
export type { RerankCacheKey, RerankScoreCache, MemoryScoreCache, ScoreCacheOptions, } from './cache';
|
|
23
|
-
export { rerankCost, rankedEntries, estimatedUsage, identityOutcome, emptyRerankUsage, toOutcomeReranker, isRerankPermutation, ESTIMATED_TOKENS_PER_DOCUMENT, } from './outcome';
|
|
24
|
-
export type { RerankCost, RerankPrice, RerankPrices } from './outcome';
|
|
8
|
+
export type * from './types.js';
|
|
9
|
+
export { createSystemOneReranker } from './systemone.js';
|
|
10
|
+
export type { SystemOnePin, SystemOneMode, SystemOneReranker, SystemOneRerankerOptions, } from './systemone.js';
|
|
11
|
+
export { createCrossEncoderReranker } from './crossEncoder.js';
|
|
12
|
+
export type { CrossEncoderRerankerOptions } from './crossEncoder.js';
|
|
13
|
+
export { createBm25Reranker, corpusStats, tokenizeCode } from './bm25.js';
|
|
14
|
+
export type { Bm25RerankerOptions, CorpusStats, Tokenize } from './bm25.js';
|
|
15
|
+
export { noneReranker, withFallback, STEP_GRACE_MS } from './fallback.js';
|
|
16
|
+
export type { FallbackStep, FallbackOptions, FallbackReranker, } from './fallback.js';
|
|
17
|
+
export { probePin, PIN_SENTINEL_MODEL } from './pin.js';
|
|
18
|
+
export type { PinProbe, PinProbeOptions } from './pin.js';
|
|
19
|
+
export { createSemaphore } from './semaphore.js';
|
|
20
|
+
export type { RerankSemaphore } from './semaphore.js';
|
|
21
|
+
export { createScoreCache } from './cache.js';
|
|
22
|
+
export type { RerankCacheKey, RerankScoreCache, MemoryScoreCache, ScoreCacheOptions, } from './cache.js';
|
|
23
|
+
export { rerankCost, rankedEntries, estimatedUsage, identityOutcome, emptyRerankUsage, toOutcomeReranker, isRerankPermutation, ESTIMATED_TOKENS_PER_DOCUMENT, } from './outcome.js';
|
|
24
|
+
export type { RerankCost, RerankPrice, RerankPrices } from './outcome.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { OutcomeReranker } from './types';
|
|
2
|
-
import type { DecisionCredential } from '../decisions/types';
|
|
3
|
-
import type { DecisionFetch } from '../decisions/transport';
|
|
1
|
+
import type { OutcomeReranker } from './types.js';
|
|
2
|
+
import type { DecisionCredential } from '../decisions/types.js';
|
|
3
|
+
import type { DecisionFetch } from '../decisions/transport.js';
|
|
4
4
|
export interface CrossEncoderRerankerOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Full URL of a Cohere-shaped rerank endpoint: Cohere's `/v2/rerank`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RerankOutcome, OutcomeReranker } from './types';
|
|
1
|
+
import type { RerankOutcome, OutcomeReranker } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Identity order, never a request: the last step of a chain, or the whole
|
|
4
4
|
* chain when nothing is configured. Its one attempt is `skipped` with
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export { createWebSearchReranker } from './search';
|
|
1
|
+
export * from './core.js';
|
|
2
|
+
export { createWebSearchReranker } from './search.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Reranker, RerankKind, RerankEntry, RerankUsage, RerankReason, RerankOutcome, OutcomeReranker } from './types';
|
|
2
|
-
import { DecisionError } from '../decisions/types';
|
|
1
|
+
import type { Reranker, RerankKind, RerankEntry, RerankUsage, RerankReason, RerankOutcome, OutcomeReranker } from './types.js';
|
|
2
|
+
import { DecisionError } from '../decisions/types.js';
|
|
3
3
|
/** Longest deadline a step may have; matches `withDecisionDeadline`. */
|
|
4
4
|
export declare const MAX_RERANK_DEADLINE_MS = 3600000;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DecisionModel } from '../decisions/types';
|
|
2
|
-
import type { RerankReason } from './types';
|
|
1
|
+
import type { DecisionModel } from '../decisions/types.js';
|
|
2
|
+
import type { RerankReason } from './types.js';
|
|
3
3
|
/** A model id no host serves: a host that answers it echoes whatever it is asked, so its echo proves nothing. */
|
|
4
4
|
export declare const PIN_SENTINEL_MODEL = "jev-0.0.0-pin-sentinel";
|
|
5
5
|
export interface PinProbeOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Logger, SearchReranker } from '../tools/search/types.js';
|
|
2
|
-
import type { Reranker } from './types';
|
|
2
|
+
import type { Reranker } from './types.js';
|
|
3
3
|
/** Adapts index-based rankings to web-search highlights and its existing metrics/fallback policy. */
|
|
4
4
|
export declare function createWebSearchReranker(reranker: Reranker, options?: {
|
|
5
5
|
timeoutMs?: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Reranker, OutcomeReranker } from './types';
|
|
2
|
-
import type { DecisionText, DecisionState, DecisionModel } from '../decisions/types';
|
|
3
|
-
import type { RerankScoreCache } from './cache';
|
|
4
|
-
import type { RerankSemaphore } from './semaphore';
|
|
1
|
+
import type { Reranker, OutcomeReranker } from './types.js';
|
|
2
|
+
import type { DecisionText, DecisionState, DecisionModel } from '../decisions/types.js';
|
|
3
|
+
import type { RerankScoreCache } from './cache.js';
|
|
4
|
+
import type { RerankSemaphore } from './semaphore.js';
|
|
5
5
|
/**
|
|
6
6
|
* `document` (the default) asks one score question per candidate, one request
|
|
7
7
|
* each. `batch` asks every candidate in one request; its scores follow input
|
package/dist/types/run.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class Run<_T extends t.BaseGraphState> {
|
|
|
22
22
|
private preemption?;
|
|
23
23
|
private maxStopContinuations;
|
|
24
24
|
private providerTextProtection?;
|
|
25
|
+
private toolResultProtection?;
|
|
25
26
|
private resolveAttachment?;
|
|
26
27
|
private streamLimits?;
|
|
27
28
|
private subagentTasks?;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { Callbacks } from '@langchain/core/callbacks/manager';
|
|
3
3
|
import type { BaseCallbackHandler } from '@langchain/core/callbacks/base';
|
|
4
|
-
import type { SdkRpc } from './peer';
|
|
4
|
+
import type { SdkRpc } from './peer.js';
|
|
5
5
|
import { HostChatModel } from '../index.js';
|
|
6
6
|
export interface RemoteModelAttempt {
|
|
7
7
|
nodeId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RunConfig } from '../index.js';
|
|
2
|
-
import type { RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState } from './types';
|
|
3
|
-
import type { SdkAgentIdentity } from './identity';
|
|
2
|
+
import type { RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState } from './types.js';
|
|
3
|
+
import type { SdkAgentIdentity } from './identity.js';
|
|
4
4
|
import { Run } from '../index.js';
|
|
5
5
|
/** Construct a real local Run whose execution is delegated to one operator-trusted runtime. */
|
|
6
6
|
export declare function createRemoteSdkRun({ config, identity, remote, resumeState, hostServices, }: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { HostFileDescriptor, HostFileBindings } from '../index.js';
|
|
3
|
-
import type { RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types';
|
|
4
|
-
import type { SdkAgentIdentity } from './identity';
|
|
5
|
-
import type { SdkRpc } from './peer';
|
|
3
|
+
import type { RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types.js';
|
|
4
|
+
import type { SdkAgentIdentity } from './identity.js';
|
|
5
|
+
import type { SdkRpc } from './peer.js';
|
|
6
6
|
export declare const fileChannelSchema: z.ZodObject<{
|
|
7
7
|
version: z.ZodLiteral<1>;
|
|
8
8
|
publicKey: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EventHandler, HostToolDescriptor, HostToolService, ToolExecuteResult } from '../index.js';
|
|
2
|
-
import type { SdkAgentIdentity } from './identity';
|
|
3
|
-
import type { SdkRpc } from './peer';
|
|
2
|
+
import type { SdkAgentIdentity } from './identity.js';
|
|
3
|
+
import type { SdkRpc } from './peer.js';
|
|
4
4
|
/** Local credentials/configuration are supplied by the authenticated host, never by the worker. */
|
|
5
5
|
export declare function createHostToolService(options: {
|
|
6
6
|
identity: Readonly<SdkAgentIdentity>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { createRemoteSdkServer } from './server';
|
|
2
|
-
export { createRemoteSdkRun } from './client';
|
|
3
|
-
export { createRedisRuntimeJournal } from './recovery/redis';
|
|
4
|
-
export type { RemoteSdkServerOptions } from './server';
|
|
5
|
-
export type { SdkAgentIdentity } from './identity';
|
|
6
|
-
export type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState, RemoteSdkLimits, RemoteSdkModelProfile, } from './types';
|
|
7
|
-
export type { HostModelLifecycle, RemoteModelAttempt } from './admission';
|
|
8
|
-
export type { RuntimeJournalRedis, RuntimeJournalLimits, } from './recovery/redis';
|
|
9
|
-
export type { RuntimeJournal, RuntimeJournalSession, RuntimeJournalLease, RuntimeJournalResult, RuntimeJournalState, RuntimeJournalFailure, } from './recovery/journal';
|
|
10
|
-
export type { RuntimeRecoveryOptions } from './recovery/server';
|
|
11
|
-
export type { RemoteSdkRecoveryOptions } from './types';
|
|
12
|
-
export { normalizeResumeRunStepIndices, hydrateResumeRunSteps, createContentIndexOffsetHandlers, } from './resume';
|
|
1
|
+
export { createRemoteSdkServer } from './server.js';
|
|
2
|
+
export { createRemoteSdkRun } from './client.js';
|
|
3
|
+
export { createRedisRuntimeJournal } from './recovery/redis.js';
|
|
4
|
+
export type { RemoteSdkServerOptions } from './server.js';
|
|
5
|
+
export type { SdkAgentIdentity } from './identity.js';
|
|
6
|
+
export type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkOptions, RemoteSdkResumeState, RemoteSdkLimits, RemoteSdkModelProfile, } from './types.js';
|
|
7
|
+
export type { HostModelLifecycle, RemoteModelAttempt } from './admission.js';
|
|
8
|
+
export type { RuntimeJournalRedis, RuntimeJournalLimits, } from './recovery/redis.js';
|
|
9
|
+
export type { RuntimeJournal, RuntimeJournalSession, RuntimeJournalLease, RuntimeJournalResult, RuntimeJournalState, RuntimeJournalFailure, } from './recovery/journal.js';
|
|
10
|
+
export type { RuntimeRecoveryOptions } from './recovery/server.js';
|
|
11
|
+
export type { RemoteSdkRecoveryOptions } from './types.js';
|
|
12
|
+
export { normalizeResumeRunStepIndices, hydrateResumeRunSteps, createContentIndexOffsetHandlers, } from './resume.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types';
|
|
1
|
+
import type { RemoteSdkFactoryInput, RemoteSdkHostServices, RemoteSdkLimits, RemoteSdkStart } from './types.js';
|
|
2
2
|
import type { HostModelErrorCode } from '../index.js';
|
|
3
|
-
import type { HostModelLifecycle, WorkerModelLifecycle } from './admission';
|
|
4
|
-
import type { SdkAgentIdentity } from './identity';
|
|
5
|
-
import type { SdkRpc } from './peer';
|
|
6
|
-
import { createPolicySender } from './sealed';
|
|
3
|
+
import type { HostModelLifecycle, WorkerModelLifecycle } from './admission.js';
|
|
4
|
+
import type { SdkAgentIdentity } from './identity.js';
|
|
5
|
+
import type { SdkRpc } from './peer.js';
|
|
6
|
+
import { createPolicySender } from './sealed.js';
|
|
7
7
|
type ModelFailure = {
|
|
8
8
|
version: 1;
|
|
9
9
|
ok: false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { HostProviderTextDescriptor, ProviderTextProtectionErrorCode, ProviderTextProtection } from '../index.js';
|
|
3
|
-
import type { RemoteSdkHostServices, RemoteSdkStart, RemoteSdkLimits } from './types';
|
|
4
|
-
import type { SdkAgentIdentity } from './identity';
|
|
5
|
-
import type { SdkRpc } from './peer';
|
|
3
|
+
import type { RemoteSdkHostServices, RemoteSdkStart, RemoteSdkLimits } from './types.js';
|
|
4
|
+
import type { SdkAgentIdentity } from './identity.js';
|
|
5
|
+
import type { SdkRpc } from './peer.js';
|
|
6
6
|
export declare const policyDescriptorSchema: z.ZodObject<{
|
|
7
7
|
version: z.ZodLiteral<1>;
|
|
8
8
|
publicKey: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RemoteSdkLimits, RemoteSdkRecoveryOptions } from '../types';
|
|
2
|
-
import type { RecoveryClaim } from './server';
|
|
3
|
-
import { RecoverySocket } from './socket';
|
|
1
|
+
import type { RemoteSdkLimits, RemoteSdkRecoveryOptions } from '../types.js';
|
|
2
|
+
import type { RecoveryClaim } from './server.js';
|
|
3
|
+
import { RecoverySocket } from './socket.js';
|
|
4
4
|
export declare function connectRecoveringSdkSocket(options: {
|
|
5
5
|
url: string;
|
|
6
6
|
token: (claim: RecoveryClaim) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RuntimeJournal, RuntimeJournalLease, RuntimeJournalSession, RuntimeJournalResult } from './journal';
|
|
2
|
-
import type { RecoveryLog } from './socket';
|
|
1
|
+
import type { RuntimeJournal, RuntimeJournalLease, RuntimeJournalSession, RuntimeJournalResult } from './journal.js';
|
|
2
|
+
import type { RecoveryLog } from './socket.js';
|
|
3
3
|
export declare function journalValue<T>(result: RuntimeJournalResult<T>): T;
|
|
4
4
|
export declare function createJournalRecoveryLog(options: {
|
|
5
5
|
journal: RuntimeJournal;
|