@librechat/agents 4.2.10 → 4.2.11
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/runtime/admission.cjs +135 -0
- package/dist/cjs/runtime/admission.cjs.map +1 -0
- package/dist/cjs/runtime/checkpoint.cjs +40 -0
- package/dist/cjs/runtime/checkpoint.cjs.map +1 -0
- package/dist/cjs/runtime/client.cjs +435 -0
- package/dist/cjs/runtime/client.cjs.map +1 -0
- package/dist/cjs/runtime/files.cjs +301 -0
- package/dist/cjs/runtime/files.cjs.map +1 -0
- package/dist/cjs/runtime/hostTools.cjs +165 -0
- package/dist/cjs/runtime/hostTools.cjs.map +1 -0
- package/dist/cjs/runtime/index.cjs +11 -0
- package/dist/cjs/runtime/model.cjs +303 -0
- package/dist/cjs/runtime/model.cjs.map +1 -0
- package/dist/cjs/runtime/peer.cjs +209 -0
- package/dist/cjs/runtime/peer.cjs.map +1 -0
- package/dist/cjs/runtime/policy.cjs +77 -0
- package/dist/cjs/runtime/policy.cjs.map +1 -0
- package/dist/cjs/runtime/recovery/client.cjs +172 -0
- package/dist/cjs/runtime/recovery/client.cjs.map +1 -0
- package/dist/cjs/runtime/recovery/log.cjs +47 -0
- package/dist/cjs/runtime/recovery/log.cjs.map +1 -0
- package/dist/cjs/runtime/recovery/redis.cjs +239 -0
- package/dist/cjs/runtime/recovery/redis.cjs.map +1 -0
- package/dist/cjs/runtime/recovery/server.cjs +190 -0
- package/dist/cjs/runtime/recovery/server.cjs.map +1 -0
- package/dist/cjs/runtime/recovery/socket.cjs +298 -0
- package/dist/cjs/runtime/recovery/socket.cjs.map +1 -0
- package/dist/cjs/runtime/resume.cjs +115 -0
- package/dist/cjs/runtime/resume.cjs.map +1 -0
- package/dist/cjs/runtime/sealed.cjs +107 -0
- package/dist/cjs/runtime/sealed.cjs.map +1 -0
- package/dist/cjs/runtime/server.cjs +415 -0
- package/dist/cjs/runtime/server.cjs.map +1 -0
- package/dist/cjs/runtime/snapshot.cjs +61 -0
- package/dist/cjs/runtime/snapshot.cjs.map +1 -0
- package/dist/cjs/runtime/types.cjs +20 -0
- package/dist/cjs/runtime/types.cjs.map +1 -0
- package/dist/cjs/runtime/wire.cjs +84 -0
- package/dist/cjs/runtime/wire.cjs.map +1 -0
- package/dist/esm/runtime/admission.mjs +133 -0
- package/dist/esm/runtime/admission.mjs.map +1 -0
- package/dist/esm/runtime/checkpoint.mjs +39 -0
- package/dist/esm/runtime/checkpoint.mjs.map +1 -0
- package/dist/esm/runtime/client.mjs +432 -0
- package/dist/esm/runtime/client.mjs.map +1 -0
- package/dist/esm/runtime/files.mjs +299 -0
- package/dist/esm/runtime/files.mjs.map +1 -0
- package/dist/esm/runtime/hostTools.mjs +164 -0
- package/dist/esm/runtime/hostTools.mjs.map +1 -0
- package/dist/esm/runtime/index.mjs +5 -0
- package/dist/esm/runtime/model.mjs +301 -0
- package/dist/esm/runtime/model.mjs.map +1 -0
- package/dist/esm/runtime/peer.mjs +209 -0
- package/dist/esm/runtime/peer.mjs.map +1 -0
- package/dist/esm/runtime/policy.mjs +75 -0
- package/dist/esm/runtime/policy.mjs.map +1 -0
- package/dist/esm/runtime/recovery/client.mjs +172 -0
- package/dist/esm/runtime/recovery/client.mjs.map +1 -0
- package/dist/esm/runtime/recovery/log.mjs +46 -0
- package/dist/esm/runtime/recovery/log.mjs.map +1 -0
- package/dist/esm/runtime/recovery/redis.mjs +239 -0
- package/dist/esm/runtime/recovery/redis.mjs.map +1 -0
- package/dist/esm/runtime/recovery/server.mjs +189 -0
- package/dist/esm/runtime/recovery/server.mjs.map +1 -0
- package/dist/esm/runtime/recovery/socket.mjs +297 -0
- package/dist/esm/runtime/recovery/socket.mjs.map +1 -0
- package/dist/esm/runtime/resume.mjs +111 -0
- package/dist/esm/runtime/resume.mjs.map +1 -0
- package/dist/esm/runtime/sealed.mjs +106 -0
- package/dist/esm/runtime/sealed.mjs.map +1 -0
- package/dist/esm/runtime/server.mjs +413 -0
- package/dist/esm/runtime/server.mjs.map +1 -0
- package/dist/esm/runtime/snapshot.mjs +60 -0
- package/dist/esm/runtime/snapshot.mjs.map +1 -0
- package/dist/esm/runtime/types.mjs +19 -0
- package/dist/esm/runtime/types.mjs.map +1 -0
- package/dist/esm/runtime/wire.mjs +80 -0
- package/dist/esm/runtime/wire.mjs.map +1 -0
- package/dist/types/agents/AgentContext.d.ts +4 -4
- package/dist/types/agents/projection.d.ts +1 -1
- package/dist/types/events.d.ts +2 -2
- package/dist/types/graphs/Graph.d.ts +13 -13
- package/dist/types/graphs/MultiAgentGraph.d.ts +2 -2
- package/dist/types/graphs/acceptedModelResponse.d.ts +1 -1
- package/dist/types/graphs/createGraph.d.ts +4 -4
- package/dist/types/graphs/graphFactory.d.ts +1 -1
- package/dist/types/graphs/handoff.d.ts +1 -1
- package/dist/types/harness/index.d.ts +2 -2
- package/dist/types/harness/model.d.ts +3 -3
- package/dist/types/harness/providerText.d.ts +2 -2
- package/dist/types/hitl/approvalReview.d.ts +1 -1
- package/dist/types/hitl/askUserQuestion.d.ts +1 -1
- package/dist/types/hitl/askUserQuestions.d.ts +1 -1
- package/dist/types/hitl/askUserQuestionsInterrupt.d.ts +1 -1
- package/dist/types/hooks/types.d.ts +2 -2
- package/dist/types/instrumentation.d.ts +1 -1
- package/dist/types/langfuse.d.ts +3 -3
- package/dist/types/langfuseConfig.d.ts +2 -2
- package/dist/types/langfuseRuntimeContext.d.ts +1 -1
- package/dist/types/langfuseRuntimeScope.d.ts +2 -2
- package/dist/types/langfuseSpanRegistry.d.ts +1 -1
- package/dist/types/langfuseToolOutputTracing.d.ts +3 -3
- package/dist/types/llm/anthropic/index.d.ts +1 -1
- package/dist/types/llm/bedrock/index.d.ts +1 -1
- package/dist/types/llm/bedrock/toolCache.d.ts +2 -2
- package/dist/types/llm/contextOverflowRecovery.d.ts +2 -2
- package/dist/types/llm/contextPressureMeter.d.ts +2 -2
- package/dist/types/llm/google/index.d.ts +1 -1
- package/dist/types/llm/init.d.ts +1 -1
- package/dist/types/llm/invoke.d.ts +9 -9
- package/dist/types/llm/mistral/index.d.ts +1 -1
- package/dist/types/llm/openai/index.d.ts +2 -2
- package/dist/types/llm/openrouter/index.d.ts +2 -2
- package/dist/types/llm/openrouter/toolCache.d.ts +2 -2
- package/dist/types/llm/prepareProviderRequest.d.ts +3 -3
- package/dist/types/llm/promptCacheTools.d.ts +1 -1
- package/dist/types/llm/providerRegistry.d.ts +1 -1
- package/dist/types/llm/providerTextBoundary.d.ts +2 -2
- package/dist/types/llm/providerTextControls.d.ts +1 -1
- package/dist/types/llm/providers.d.ts +2 -2
- package/dist/types/llm/request.d.ts +1 -1
- package/dist/types/llm/stream/chunkAdapters.d.ts +1 -1
- package/dist/types/llm/streamLimits.d.ts +1 -1
- package/dist/types/llm/truncation.d.ts +1 -1
- package/dist/types/llm/vertexai/index.d.ts +1 -1
- package/dist/types/messages/alternation.d.ts +1 -1
- package/dist/types/messages/anthropicToolCache.d.ts +2 -2
- package/dist/types/messages/assistantPhase.d.ts +3 -3
- package/dist/types/messages/budget.d.ts +1 -1
- package/dist/types/messages/cache.d.ts +1 -1
- package/dist/types/messages/contextPruning.d.ts +2 -2
- package/dist/types/messages/core.d.ts +1 -1
- package/dist/types/messages/fading.d.ts +1 -1
- package/dist/types/messages/format.d.ts +2 -2
- package/dist/types/messages/ids.d.ts +2 -2
- package/dist/types/messages/injected.d.ts +1 -1
- package/dist/types/messages/langchain.d.ts +1 -1
- package/dist/types/messages/prune.d.ts +4 -4
- package/dist/types/messages/recency.d.ts +1 -1
- package/dist/types/messages/toolResultTypes.d.ts +1 -1
- package/dist/types/openai/arguments.d.ts +1 -1
- package/dist/types/openai/index.d.ts +1 -1
- package/dist/types/openai/toolProjection.d.ts +1 -1
- package/dist/types/prompts/activityLabel.d.ts +2 -2
- package/dist/types/prompts/reasoningLabel.d.ts +1 -1
- package/dist/types/rerank/search.d.ts +1 -1
- package/dist/types/responses/index.d.ts +1 -1
- package/dist/types/run.d.ts +3 -3
- package/dist/types/runtime/admission.d.ts +30 -0
- package/dist/types/runtime/checkpoint.d.ts +14 -0
- package/dist/types/runtime/client.d.ts +12 -0
- package/dist/types/runtime/files.d.ts +75 -0
- package/dist/types/runtime/hostTools.d.ts +22 -0
- package/dist/types/runtime/identity.d.ts +2 -0
- package/dist/types/runtime/index.d.ts +12 -0
- package/dist/types/runtime/model.d.ts +42 -0
- package/dist/types/runtime/peer.d.ts +55 -0
- package/dist/types/runtime/policy.d.ts +43 -0
- package/dist/types/runtime/recovery/client.d.ts +12 -0
- package/dist/types/runtime/recovery/journal.d.ts +62 -0
- package/dist/types/runtime/recovery/log.d.ts +9 -0
- package/dist/types/runtime/recovery/redis.d.ts +17 -0
- package/dist/types/runtime/recovery/server.d.ts +37 -0
- package/dist/types/runtime/recovery/socket.d.ts +72 -0
- package/dist/types/runtime/resume.d.ts +66 -0
- package/dist/types/runtime/sealed.d.ts +19 -0
- package/dist/types/runtime/server.d.ts +21 -0
- package/dist/types/runtime/snapshot.d.ts +12 -0
- package/dist/types/runtime/types.d.ts +125 -0
- package/dist/types/runtime/wire.d.ts +3 -0
- package/dist/types/session/handlers.d.ts +1 -1
- package/dist/types/session/types.d.ts +1 -1
- package/dist/types/stream.d.ts +3 -3
- package/dist/types/summarization/index.d.ts +1 -1
- package/dist/types/summarization/input.d.ts +1 -1
- package/dist/types/summarization/node.d.ts +6 -6
- package/dist/types/summarization/retry.d.ts +2 -2
- package/dist/types/summarization/semanticIndex.d.ts +2 -2
- package/dist/types/summarization/toolBudget.d.ts +1 -1
- package/dist/types/summarization/usage.d.ts +1 -1
- package/dist/types/tools/ArtifactDelivery.d.ts +1 -1
- package/dist/types/tools/ArtifactTruncation.d.ts +1 -1
- package/dist/types/tools/BashExecutor.d.ts +2 -2
- package/dist/types/tools/BashProgrammaticToolCalling.d.ts +2 -2
- package/dist/types/tools/CallerCapabilities.d.ts +1 -1
- package/dist/types/tools/CodeExecutor.d.ts +4 -4
- package/dist/types/tools/CodeSessionFileSummary.d.ts +1 -1
- package/dist/types/tools/ProgrammaticCallerPolicy.d.ts +1 -1
- package/dist/types/tools/ProgrammaticToolCalling.d.ts +2 -2
- package/dist/types/tools/ReadFile.d.ts +1 -1
- package/dist/types/tools/SkillTool.d.ts +1 -1
- package/dist/types/tools/SubagentTool.d.ts +3 -3
- package/dist/types/tools/ToolNode.d.ts +5 -5
- package/dist/types/tools/ToolSearch.d.ts +2 -2
- package/dist/types/tools/cloudflare/CloudflareBridgeRuntime.d.ts +1 -1
- package/dist/types/tools/cloudflare/CloudflareProgrammaticToolCalling.d.ts +1 -1
- package/dist/types/tools/cloudflare/CloudflareSandboxExecutionEngine.d.ts +2 -2
- package/dist/types/tools/cloudflare/CloudflareSandboxTools.d.ts +1 -1
- package/dist/types/tools/diagnostics.d.ts +1 -1
- package/dist/types/tools/eagerEventExecution.d.ts +1 -1
- package/dist/types/tools/handlers.d.ts +3 -3
- package/dist/types/tools/intentArg.d.ts +1 -1
- package/dist/types/tools/local/CompileCheckTool.d.ts +2 -2
- package/dist/types/tools/local/FileCheckpointer.d.ts +1 -1
- package/dist/types/tools/local/LocalCodingTools.d.ts +2 -2
- package/dist/types/tools/local/LocalExecutionEngine.d.ts +1 -1
- package/dist/types/tools/local/LocalExecutionTools.d.ts +1 -1
- package/dist/types/tools/local/LocalProgrammaticToolCalling.d.ts +1 -1
- package/dist/types/tools/local/bashAst.d.ts +1 -1
- package/dist/types/tools/local/resolveLocalExecutionTools.d.ts +1 -1
- package/dist/types/tools/local/syntaxCheck.d.ts +1 -1
- package/dist/types/tools/ptcTimeout.d.ts +1 -1
- package/dist/types/tools/runStepResume.d.ts +1 -1
- package/dist/types/tools/schema.d.ts +1 -1
- package/dist/types/tools/search/anthropic.d.ts +1 -1
- package/dist/types/tools/skillCatalog.d.ts +1 -1
- package/dist/types/tools/subagent/InMemorySubagentTaskStore.d.ts +1 -1
- package/dist/types/tools/subagent/SubagentExecutor.d.ts +5 -5
- package/dist/types/tools/subagent/SubagentReplay.d.ts +3 -3
- package/dist/types/tools/subagent/childGraphConfig.d.ts +2 -2
- package/dist/types/tools/subagent/diagnostics.d.ts +2 -2
- package/dist/types/tools/subagent/hostArgs.d.ts +2 -2
- package/dist/types/tools/toolBatchReplay.d.ts +3 -3
- package/dist/types/types/activityLabel.d.ts +2 -2
- package/dist/types/types/graph.d.ts +10 -10
- package/dist/types/types/llm.d.ts +9 -9
- package/dist/types/types/reasoningLabel.d.ts +1 -1
- package/dist/types/types/run.d.ts +8 -8
- package/dist/types/types/stream.d.ts +5 -5
- package/dist/types/types/summarize.d.ts +2 -2
- package/dist/types/types/tools.d.ts +8 -8
- package/dist/types/utils/errors.d.ts +1 -1
- package/dist/types/utils/events.d.ts +3 -3
- package/dist/types/utils/handlers.d.ts +3 -3
- package/dist/types/utils/llm.d.ts +2 -2
- package/dist/types/utils/llmConfig.d.ts +1 -1
- package/dist/types/utils/title.d.ts +1 -1
- package/dist/types/utils/toolSessions.d.ts +1 -1
- package/package.json +22 -3
- package/src/runtime/admission.ts +224 -0
- package/src/runtime/checkpoint.ts +66 -0
- package/src/runtime/client.ts +674 -0
- package/src/runtime/files.ts +503 -0
- package/src/runtime/hostTools.ts +243 -0
- package/src/runtime/identity.ts +3 -0
- package/src/runtime/index.ts +33 -0
- package/src/runtime/model.ts +452 -0
- package/src/runtime/peer.ts +262 -0
- package/src/runtime/policy.ts +150 -0
- package/src/runtime/recovery/client.ts +232 -0
- package/src/runtime/recovery/journal.ts +88 -0
- package/src/runtime/recovery/log.ts +70 -0
- package/src/runtime/recovery/redis.ts +342 -0
- package/src/runtime/recovery/server.ts +280 -0
- package/src/runtime/recovery/socket.ts +422 -0
- package/src/runtime/resume.ts +268 -0
- package/src/runtime/sealed.ts +144 -0
- package/src/runtime/server.ts +653 -0
- package/src/runtime/snapshot.ts +87 -0
- package/src/runtime/types.ts +184 -0
- package/src/runtime/wire.ts +96 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { EventHandler, MessageContentComplex, RunStep } from '../index.js';
|
|
2
|
+
import type { RemoteSdkSnapshot } from './types';
|
|
3
|
+
type ResumableRunStep = {
|
|
4
|
+
id: string;
|
|
5
|
+
index: number;
|
|
6
|
+
stepDetails: {
|
|
7
|
+
type: string;
|
|
8
|
+
tool_calls?: readonly {
|
|
9
|
+
id?: string;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare function normalizeResumeRunStepIndices<T extends ResumableRunStep>(runSteps: readonly T[], seedContent?: readonly ({
|
|
14
|
+
type?: string;
|
|
15
|
+
tool_call?: {
|
|
16
|
+
id?: string;
|
|
17
|
+
};
|
|
18
|
+
} | undefined)[]): T[];
|
|
19
|
+
/**
|
|
20
|
+
* Restore the streamed run-step sidecars that a fresh SDK Run cannot recover
|
|
21
|
+
* from the LangGraph checkpoint by itself.
|
|
22
|
+
*
|
|
23
|
+
* Human-review resume can happen in a later request or process. The checkpoint
|
|
24
|
+
* restarts directly inside ToolNode, so it does not replay ON_RUN_STEP before
|
|
25
|
+
* dispatching ON_RUN_STEP_COMPLETED. Seeding both maps lets the ToolNode emit
|
|
26
|
+
* the original step id and lets the content aggregator resolve that id back to
|
|
27
|
+
* the already-rendered tool card.
|
|
28
|
+
*/
|
|
29
|
+
export declare function hydrateResumeRunSteps(runSteps: readonly RunStep[], stepMap: Map<string, RunStep | undefined> | undefined, graph: {
|
|
30
|
+
toolCallStepIds?: Map<string, string>;
|
|
31
|
+
} | null | undefined, seedContent?: readonly ({
|
|
32
|
+
type?: string;
|
|
33
|
+
tool_call?: {
|
|
34
|
+
id?: string;
|
|
35
|
+
};
|
|
36
|
+
} | undefined)[]): void;
|
|
37
|
+
/**
|
|
38
|
+
* Wrap a resume run's event handlers so every content index the rebuilt graph
|
|
39
|
+
* emits is shifted past the pre-pause content.
|
|
40
|
+
*
|
|
41
|
+
* WHY: a resumed run rebuilds the graph from the checkpoint, and the fresh
|
|
42
|
+
* graph assigns content indices from its own empty `contentData` — starting at
|
|
43
|
+
* 0. The host, meanwhile, seeds the (also fresh) content aggregator with the
|
|
44
|
+
* pre-pause parts, which occupy exactly those low indices. Without an offset
|
|
45
|
+
* the resumed model turn collides with the seed: when the types match at an
|
|
46
|
+
* index the new text silently MERGES into a pre-pause part, and when they
|
|
47
|
+
* don't (e.g. a reasoning/`think` part at index 0 with Anthropic models) every
|
|
48
|
+
* delta is dropped with `Content type mismatch` — the entire post-resume
|
|
49
|
+
* output vanishes from both the live stream and the saved message.
|
|
50
|
+
*
|
|
51
|
+
* The index enters the pipeline at exactly one point: `ON_RUN_STEP`'s payload
|
|
52
|
+
* (the `RunStep`, whose `index` every subsequent delta resolves through the
|
|
53
|
+
* aggregator's `stepMap`). `ON_AGENT_UPDATE` carries its own inline index and
|
|
54
|
+
* is offset likewise. All other handlers pass through untouched — same object
|
|
55
|
+
* references, so stateful handler instances keep working.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createContentIndexOffsetHandlers(handlers: Record<string, EventHandler> | undefined, seedContent?: Array<{
|
|
58
|
+
type?: string;
|
|
59
|
+
tool_call?: {
|
|
60
|
+
id?: string;
|
|
61
|
+
output?: unknown;
|
|
62
|
+
};
|
|
63
|
+
}>): Record<string, EventHandler> | undefined;
|
|
64
|
+
/** Merge a worker continuation with the host’s already rendered prefix. */
|
|
65
|
+
export declare function reconcileRemoteResumeContent(seededProjection: readonly (MessageContentComplex | undefined)[], snapshot: RemoteSdkSnapshot): MessageContentComplex[];
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
type Purpose = 'provider-text' | 'model' | 'files';
|
|
3
|
+
declare const envelopeSchema: z.ZodObject<{
|
|
4
|
+
version: z.ZodLiteral<1>;
|
|
5
|
+
publicKey: z.ZodString;
|
|
6
|
+
nonce: z.ZodString;
|
|
7
|
+
tag: z.ZodString;
|
|
8
|
+
ciphertext: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
type Envelope = z.infer<typeof envelopeSchema>;
|
|
11
|
+
/** Per-run private key stays with its recipient; recovery journals receive ciphertext and public keys only. */
|
|
12
|
+
export declare function createPolicyReceiver(maxBytes: number, purpose?: Purpose): {
|
|
13
|
+
publicKey: string;
|
|
14
|
+
open(envelope: unknown): string;
|
|
15
|
+
dispose(): void;
|
|
16
|
+
};
|
|
17
|
+
/** Encrypt before handing the candidate to a peer, queue, or replay log. */
|
|
18
|
+
export declare function createPolicySender(receiverKey: string, maxBytes: number, purpose?: Purpose): (text: string) => Envelope;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Server } from 'node:http';
|
|
2
|
+
import type { RemoteSdkFactoryInput, RemoteSdkLimits, SdkRun } from './types';
|
|
3
|
+
import type { RuntimeRecoveryOptions } from './recovery/server';
|
|
4
|
+
import type { SdkAgentIdentity } from './identity';
|
|
5
|
+
export interface RemoteSdkServerOptions extends Partial<RemoteSdkLimits> {
|
|
6
|
+
recovery?: RuntimeRecoveryOptions;
|
|
7
|
+
runtimeId: string;
|
|
8
|
+
secret: string;
|
|
9
|
+
/** Authorize the signed saved-agent identity against this worker's deployment policy. */
|
|
10
|
+
authorize: (identity: Readonly<SdkAgentIdentity>, signal: AbortSignal) => boolean | Promise<boolean>;
|
|
11
|
+
createRun: (input: RemoteSdkFactoryInput) => Promise<SdkRun>;
|
|
12
|
+
maxConcurrentRuns?: number;
|
|
13
|
+
maxReplayEntries?: number;
|
|
14
|
+
/** Trusted operator diagnostics; errors are never forwarded over the bridge. */
|
|
15
|
+
onError?: (error: unknown) => void;
|
|
16
|
+
}
|
|
17
|
+
/** A separately hosted, operator-trusted SDK runtime. The caller owns listen/TLS and shutdown. */
|
|
18
|
+
export declare function createRemoteSdkServer(options: RemoteSdkServerOptions): {
|
|
19
|
+
server: Server;
|
|
20
|
+
close: () => Promise<void>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RemoteSdkSnapshot, RemoteSdkLimits } from './types';
|
|
2
|
+
/** One bounded transfer per execution; chunks precede the terminal receipt in the ordered durable stream. */
|
|
3
|
+
export declare function createSnapshotReceiver(maxBytes: number): {
|
|
4
|
+
accept(data: unknown): null;
|
|
5
|
+
finish(data: unknown): RemoteSdkSnapshot;
|
|
6
|
+
};
|
|
7
|
+
export declare function sendSnapshot(peer: {
|
|
8
|
+
send: (frame: {
|
|
9
|
+
type: 'snapshot' | 'done';
|
|
10
|
+
data: unknown;
|
|
11
|
+
}) => void;
|
|
12
|
+
}, snapshot: RemoteSdkSnapshot, limits: RemoteSdkLimits, flush?: () => Promise<void>): Promise<void>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { RunStep, AgentInputs, createHostFileService, HostFileBindings, HostFileDescriptor, HostFileServiceDescriptor, createHostProviderTextService, createHostModelService, HostModelDescriptor, HostChatModel, HostProviderTextDescriptor, HostToolDescriptor, HostToolBindings, Run, RunConfig, EventHandler, IState, HookEvent } from '../index.js';
|
|
2
|
+
import type { HostModelLifecycle } from './admission';
|
|
3
|
+
import type { SdkAgentIdentity } from './identity';
|
|
4
|
+
export interface RemoteSdkRecoveryOptions {
|
|
5
|
+
/** Operator-allowlisted direct worker routes, keyed by stable owner identity. */
|
|
6
|
+
routes?: Record<string, string>;
|
|
7
|
+
maxDisconnectMs: number;
|
|
8
|
+
retryDelayMs: number;
|
|
9
|
+
maxJournalBytes: number;
|
|
10
|
+
}
|
|
11
|
+
export interface RemoteSdkOptions {
|
|
12
|
+
/** Opt in to the saved-agent host model, configured by the operator. */
|
|
13
|
+
hostModel?: boolean;
|
|
14
|
+
/** Opt in to native host attachment reads. */
|
|
15
|
+
hostFiles?: boolean;
|
|
16
|
+
recovery?: RemoteSdkRecoveryOptions;
|
|
17
|
+
url: string;
|
|
18
|
+
secret: string;
|
|
19
|
+
connectTimeoutMs?: number;
|
|
20
|
+
rpcTimeoutMs?: number;
|
|
21
|
+
maxFrameBytes?: number;
|
|
22
|
+
maxBufferedBytes?: number;
|
|
23
|
+
maxRunMs?: number;
|
|
24
|
+
/** Trusted host diagnostics; never delivered to the browser or runtime. */
|
|
25
|
+
onError?: (error: unknown) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface RemoteSdkLimits {
|
|
28
|
+
connectTimeoutMs: number;
|
|
29
|
+
rpcTimeoutMs: number;
|
|
30
|
+
maxFrameBytes: number;
|
|
31
|
+
maxBufferedBytes: number;
|
|
32
|
+
maxRunMs: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function remoteSdkLimits(options: Partial<RemoteSdkLimits>): RemoteSdkLimits;
|
|
35
|
+
export type SdkRun = Awaited<ReturnType<typeof Run.create>>;
|
|
36
|
+
export type SdkRunInput = Parameters<SdkRun['processStream']>[0];
|
|
37
|
+
export type SdkRunOptions = Parameters<SdkRun['processStream']>[1];
|
|
38
|
+
export type SdkEventData = Parameters<EventHandler['handle']>[1];
|
|
39
|
+
/** Public primary-model configuration required by the worker graph. */
|
|
40
|
+
export interface RemoteSdkModelProfile {
|
|
41
|
+
provider: AgentInputs['provider'];
|
|
42
|
+
name: string;
|
|
43
|
+
streaming: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Explicit host-owned capabilities; never reconstructed from worker claims or YAML. */
|
|
46
|
+
export interface RemoteSdkHostServices {
|
|
47
|
+
/** Already authorized host binding; storage credentials and policy stay with the host. */
|
|
48
|
+
files?: ReturnType<typeof createHostFileService> & {
|
|
49
|
+
sources: readonly HostFileDescriptor[];
|
|
50
|
+
};
|
|
51
|
+
modelLifecycle?: HostModelLifecycle;
|
|
52
|
+
modelProfile?: RemoteSdkModelProfile;
|
|
53
|
+
model?: ReturnType<typeof createHostModelService>;
|
|
54
|
+
providerText?: ReturnType<typeof createHostProviderTextService>;
|
|
55
|
+
}
|
|
56
|
+
export interface RemoteSdkStart {
|
|
57
|
+
transportVersion: 2;
|
|
58
|
+
files?: {
|
|
59
|
+
version: 1;
|
|
60
|
+
publicKey: string;
|
|
61
|
+
descriptor: HostFileServiceDescriptor;
|
|
62
|
+
sources: HostFileDescriptor[];
|
|
63
|
+
};
|
|
64
|
+
modelAdmission?: {
|
|
65
|
+
version: 1;
|
|
66
|
+
maxEntries: number;
|
|
67
|
+
};
|
|
68
|
+
model?: {
|
|
69
|
+
version: 1;
|
|
70
|
+
publicKey: string;
|
|
71
|
+
descriptor: HostModelDescriptor;
|
|
72
|
+
};
|
|
73
|
+
providerText?: {
|
|
74
|
+
version: 1;
|
|
75
|
+
publicKey: string;
|
|
76
|
+
limits: HostProviderTextDescriptor;
|
|
77
|
+
};
|
|
78
|
+
hostTools?: HostToolDescriptor[];
|
|
79
|
+
operation: 'start' | 'resume';
|
|
80
|
+
input: IState;
|
|
81
|
+
resume?: unknown;
|
|
82
|
+
commandOptions?: Parameters<SdkRun['resume']>[3];
|
|
83
|
+
options: Pick<SdkRunOptions, 'recursionLimit' | 'configurable'>;
|
|
84
|
+
handlers: string[];
|
|
85
|
+
hooks: HookEvent[];
|
|
86
|
+
checkpoint: boolean;
|
|
87
|
+
humanInTheLoop?: RunConfig['humanInTheLoop'];
|
|
88
|
+
streamLimits?: RunConfig['streamLimits'];
|
|
89
|
+
agent: {
|
|
90
|
+
id: string;
|
|
91
|
+
name?: string;
|
|
92
|
+
instructions?: string;
|
|
93
|
+
model?: RemoteSdkModelProfile;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export interface RemoteSdkSnapshot {
|
|
97
|
+
state?: {
|
|
98
|
+
[K in 'getDiscoveredTools' | 'getCalibrationRatio' | 'getFadingTier' | 'getFadingTiers' | 'getFadingTierResetAgentIds' | 'getResolvedInstructionOverhead' | 'getToolCount' | 'getOutputTruncated' | 'getHandoffOutcome']: ReturnType<SdkRun[K]>;
|
|
99
|
+
};
|
|
100
|
+
content?: ReturnType<NonNullable<SdkRun['Graph']>['getContentParts']>;
|
|
101
|
+
messages?: ReturnType<SdkRun['getRunMessages']>;
|
|
102
|
+
interrupt?: ReturnType<SdkRun['getInterrupt']>;
|
|
103
|
+
haltReason?: string;
|
|
104
|
+
runSteps?: ReturnType<NonNullable<SdkRun['Graph']>['createRunStepResumeState']>;
|
|
105
|
+
}
|
|
106
|
+
export interface RemoteSdkFactoryInput {
|
|
107
|
+
hostFiles?: HostFileBindings & {
|
|
108
|
+
readonly sources: readonly HostFileDescriptor[];
|
|
109
|
+
};
|
|
110
|
+
/** Retain this model as Graph.overrideModel when supplied by the authenticated host. */
|
|
111
|
+
hostModel?: ReturnType<HostChatModel['bindTools']>;
|
|
112
|
+
hostTools?: HostToolBindings;
|
|
113
|
+
identity: Readonly<SdkAgentIdentity>;
|
|
114
|
+
/** Host-owned event, hook, and checkpoint adapters. Retain these in the returned Run. */
|
|
115
|
+
config: Pick<RunConfig, 'runId' | 'customHandlers' | 'hooks' | 'humanInTheLoop' | 'streamLimits' | 'providerTextProtection'>;
|
|
116
|
+
compileOptions: NonNullable<RunConfig['graphConfig']['compileOptions']>;
|
|
117
|
+
signal: AbortSignal;
|
|
118
|
+
agent: RemoteSdkStart['agent'];
|
|
119
|
+
}
|
|
120
|
+
export interface RemoteSdkResumeState {
|
|
121
|
+
content: NonNullable<RemoteSdkSnapshot['content']>;
|
|
122
|
+
steps: RunStep[];
|
|
123
|
+
}
|
|
124
|
+
/** Missing environment substitutions must never become predictable signing keys. */
|
|
125
|
+
export declare function isRemoteSdkSecret(secret: unknown): secret is string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
2
2
|
import type { BaseCheckpointSaver } from '@langchain/langgraph';
|
|
3
3
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
4
|
-
import type * as t from '
|
|
4
|
+
import type * as t from '../types/index.js';
|
|
5
5
|
export type JsonPrimitive = string | number | boolean | null;
|
|
6
6
|
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
7
7
|
[key: string]: JsonValue;
|
package/dist/types/stream.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AIMessageChunk } from '@langchain/core/messages';
|
|
2
|
-
import type { AgentContext } from '
|
|
3
|
-
import type { StandardGraph } from '
|
|
4
|
-
import type * as t from '
|
|
2
|
+
import type { AgentContext } from './agents/AgentContext.js';
|
|
3
|
+
import type { StandardGraph } from './graphs/index.js';
|
|
4
|
+
import type * as t from './types/index.js';
|
|
5
5
|
export declare function getChunkContent({ chunk, provider, reasoningKey, }: {
|
|
6
6
|
chunk?: Partial<AIMessageChunk>;
|
|
7
7
|
provider?: t.ProviderName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SummarizationTrigger } from '
|
|
1
|
+
import type { SummarizationTrigger } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* The summary-boundary seam a caller compacting outside a run needs. The two
|
|
4
4
|
* default prompts stay out of it: LibreChat's manual flow deliberately words
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
2
|
-
import type { ProviderName, TokenCounter } from '
|
|
2
|
+
import type { ProviderName, TokenCounter } from '../types/index.js';
|
|
3
3
|
export declare const DEFAULT_SUMMARY_OUTPUT_TOKENS = 4096;
|
|
4
4
|
export declare const DEFAULT_RETAIN_RECENT_TOKENS = 16000;
|
|
5
5
|
export declare class SummarizationInputTooLargeError extends Error {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
2
2
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
3
|
-
import type { StreamLimitState } from '
|
|
4
|
-
import type { AgentContext } from '
|
|
5
|
-
import type { HookRegistry } from '
|
|
6
|
-
import type { OnChunk } from '
|
|
7
|
-
import type * as t from '
|
|
8
|
-
import { type PromptCacheTtl } from '
|
|
3
|
+
import type { StreamLimitState } from '../llm/streamLimits.js';
|
|
4
|
+
import type { AgentContext } from '../agents/AgentContext.js';
|
|
5
|
+
import type { HookRegistry } from '../hooks/index.js';
|
|
6
|
+
import type { OnChunk } from '../llm/invoke.js';
|
|
7
|
+
import type * as t from '../types/index.js';
|
|
8
|
+
import { type PromptCacheTtl } from '../messages/cache.js';
|
|
9
9
|
/**
|
|
10
10
|
* What one summarization round has streamed. Deltas go out as the provider
|
|
11
11
|
* produces them, so an attempt that is then abandoned has already published
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SummarizationErrorCode } from '
|
|
2
|
-
import type * as t from '
|
|
1
|
+
import type { SummarizationErrorCode } from '../types/summarize.js';
|
|
2
|
+
import type * as t from '../types/index.js';
|
|
3
3
|
/** Compaction owns retries; model/transport defaults must not multiply attempts. */
|
|
4
4
|
export declare function withSummarizationRetryOwner<T extends object>(provider: t.ProviderName, clientOptions: T): T & {
|
|
5
5
|
maxRetries: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
2
|
-
import type { CompactionSemanticIndex } from '
|
|
3
|
-
export { COMPACTION_SEMANTIC_INDEX_LIMITS } from '
|
|
2
|
+
import type { CompactionSemanticIndex } from '../types/index.js';
|
|
3
|
+
export { COMPACTION_SEMANTIC_INDEX_LIMITS } from '../common/index.js';
|
|
4
4
|
/** Records producer-side omissions without retaining the discarded entries. */
|
|
5
5
|
export declare function setCompactionSemanticIndexProvidedEntryCount(index: CompactionSemanticIndex, providedEntryCount: number): void;
|
|
6
6
|
/** Reads producer-side cardinality without exposing snapshot bookkeeping. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphTools, ProviderName, ClientOptions, TokenCounter } from '
|
|
1
|
+
import type { GraphTools, ProviderName, ClientOptions, TokenCounter } from '../types/index.js';
|
|
2
2
|
/** Counts only the resolved bound inventory, using the serving model's counter. */
|
|
3
3
|
export declare function countSummarizationToolTokens({ tools, provider, clientOptions, count, }: {
|
|
4
4
|
tools?: GraphTools;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UsageMetadata, BaseMessage } from '@langchain/core/messages';
|
|
2
|
-
import type { SummarizationAttemptUsage } from '
|
|
2
|
+
import type { SummarizationAttemptUsage } from '../types/summarize.js';
|
|
3
3
|
export declare function readSummarizationUsage(response: BaseMessage | undefined): Partial<UsageMetadata> | undefined;
|
|
4
4
|
export declare function buildSummarizationStepUsage(attempts: readonly SummarizationAttemptUsage[]): {
|
|
5
5
|
prompt_tokens: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArtifactDeliveryFailure } from '
|
|
1
|
+
import type { ArtifactDeliveryFailure } from '../types/index.js';
|
|
2
2
|
export declare const ARTIFACT_DELIVERY_WARNING_PREFIX = "Artifact delivery warning:";
|
|
3
3
|
export declare function normalizeArtifactDeliveryFailure(value: unknown): ArtifactDeliveryFailure | undefined;
|
|
4
4
|
export declare function appendArtifactDeliveryWarning(output: string, delivery: ArtifactDeliveryFailure | undefined): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ArtifactTruncation } from '
|
|
1
|
+
import type { ArtifactTruncation } from '../types/index.js';
|
|
2
2
|
export declare function normalizeArtifactTruncation(value: unknown): ArtifactTruncation | undefined;
|
|
3
3
|
export declare function appendArtifactTruncationWarning(output: string, truncation: ArtifactTruncation | undefined): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
3
|
-
import { Constants } from '
|
|
2
|
+
import type * as t from '../types/index.js';
|
|
3
|
+
import { Constants } from '../common/index.js';
|
|
4
4
|
export declare const BashExecutionToolSchema: {
|
|
5
5
|
readonly type: "object";
|
|
6
6
|
readonly properties: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
2
|
import type { ProgrammaticToolCallingJsonSchema } from './ptcTimeout';
|
|
3
|
-
import type * as t from '
|
|
4
|
-
import { Constants } from '
|
|
3
|
+
import type * as t from '../types/index.js';
|
|
4
|
+
import { Constants } from '../common/index.js';
|
|
5
5
|
export declare function createBashProgrammaticToolCallingSchema(maxRunTimeoutMs?: number): ProgrammaticToolCallingJsonSchema;
|
|
6
6
|
export declare const BashProgrammaticToolCallingSchema: ProgrammaticToolCallingJsonSchema;
|
|
7
7
|
export declare const BashProgrammaticToolCallingName = Constants.BASH_PROGRAMMATIC_TOOL_CALLING;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type { CodeApiMethod } from '
|
|
3
|
-
import type * as t from '
|
|
4
|
-
import { Constants } from '
|
|
5
|
-
export { appendCodeSessionFileSummary, stripCodeSessionFileSummary, } from '
|
|
2
|
+
import type { CodeApiMethod } from './diagnostics.js';
|
|
3
|
+
import type * as t from '../types/index.js';
|
|
4
|
+
import { Constants } from '../common/index.js';
|
|
5
|
+
export { appendCodeSessionFileSummary, stripCodeSessionFileSummary, } from './CodeSessionFileSummary.js';
|
|
6
6
|
export declare const getCodeBaseURL: () => string;
|
|
7
7
|
export declare function buildCodeApiEndpoint(baseUrl: string, route: string): string;
|
|
8
8
|
export declare function selectRuntimeSessionHint(factoryHint?: string, injectedHint?: string): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type * as t from '
|
|
1
|
+
import type * as t from '../types/index.js';
|
|
2
2
|
export declare function stripCodeSessionFileSummary(output: string): string;
|
|
3
3
|
export declare function appendCodeSessionFileSummary(output: string, files: t.FileRefs | undefined): string;
|
|
4
4
|
/** Attached-worker artifacts are delivered out of execution-private scratch,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
2
|
import type { ProgrammaticToolCallingJsonSchema } from './ptcTimeout';
|
|
3
|
-
import type * as t from '
|
|
4
|
-
import { Constants } from '
|
|
3
|
+
import type * as t from '../types/index.js';
|
|
4
|
+
import { Constants } from '../common/index.js';
|
|
5
5
|
export declare function createProgrammaticToolCallingSchema(maxRunTimeoutMs?: number): ProgrammaticToolCallingJsonSchema;
|
|
6
6
|
export declare const ProgrammaticToolCallingSchema: ProgrammaticToolCallingJsonSchema;
|
|
7
7
|
export declare const ProgrammaticToolCallingName = Constants.PROGRAMMATIC_TOOL_CALLING;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Constants } from '
|
|
1
|
+
import { Constants } from '../common/index.js';
|
|
2
2
|
export declare const ReadFileToolName = Constants.READ_FILE;
|
|
3
3
|
export declare const ReadFileToolDescription = "Read the contents of a file. Returns text content with line numbers for easy reference.\n\nFor skill files, use the path format: {skillName}/{filePath} (e.g. \"pdf-analyzer/src/utils.py\", \"code-review/SKILL.md\").\n\nBEHAVIOR:\n- Text files: returned with numbered lines.\n- Images (png, jpeg, gif, webp): returned as visual content the model can see.\n- PDFs: returned as document content.\n- Other binary files: metadata returned with a note to use bash for processing.\n- Large files (>256KB text, >10MB binary): metadata only.\n- SKILL.md: returns the skill's instructions directly.\n\nCONSTRAINTS:\n- Only files from invoked skills or code execution output are accessible.\n- Do not guess file paths. Use paths from the skill documentation or tool output.";
|
|
4
4
|
export declare const ReadFileToolSchema: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Constants } from '
|
|
1
|
+
import { Constants } from '../common/index.js';
|
|
2
2
|
export declare const SkillToolName = Constants.SKILL_TOOL;
|
|
3
3
|
export declare const SkillToolDescription = "Invoke a skill from the user's library. Skills provide domain-specific instructions loaded into the conversation context, and may also provide files accessible via available tools depending on the runtime environment.\n\nWHEN TO USE:\n- The user's request matches a skill listed in the \"Available Skills\" section of the system prompt.\n- You MUST invoke the matching skill BEFORE attempting the task yourself.\n\nWHAT HAPPENS:\n- The skill's full instructions are loaded into the conversation as context.\n- Files bundled with the skill may become accessible via available tools.\n- Follow the skill's instructions to complete the task.\n\nCONSTRAINTS:\n- Do not invoke a skill that is already active in this conversation.\n- Skill names come from the catalog only. Do not guess names.";
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { JsonSchemaType, LCTool } from '
|
|
2
|
-
import type { SubagentConfig } from '
|
|
3
|
-
import { Constants } from '
|
|
1
|
+
import type { JsonSchemaType, LCTool } from '../types/tools.js';
|
|
2
|
+
import type { SubagentConfig } from '../types/index.js';
|
|
3
|
+
import { Constants } from '../common/index.js';
|
|
4
4
|
export declare const SubagentToolName = Constants.SUBAGENT;
|
|
5
5
|
export declare const SubagentToolDescription = "Delegate a task to a specialized subagent or bounded agent team that runs in an isolated context window. The delegated execution returns only its designated final text result \u2014 all intermediate tool calls, reasoning, and context stay isolated.\n\nWHEN TO USE:\n- The task is self-contained and can be described in a single prompt.\n- You want to offload verbose or exploratory work without bloating your own context.\n- A specialized subagent is available for the task domain.\n\nWHAT HAPPENS:\n- A fresh agent or configured agent graph is created with the task description as its only input, unless the host enables child-thread continuation and you provide a saved thread id.\n- The delegated agent or team runs to completion using isolated tools and context.\n- Only the single agent's final response or the graph's designated result-agent response is returned to you.\n\nCONSTRAINTS:\n- subagent_type must match one of the available types listed below.\n- The subagent cannot see your conversation history.";
|
|
6
6
|
export declare const SubagentToolSchema: {
|
|
@@ -2,11 +2,11 @@ import { ToolCall } from '@langchain/core/messages/tool';
|
|
|
2
2
|
import { END, Command, MessagesAnnotation } from '@langchain/langgraph';
|
|
3
3
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
4
4
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
5
|
-
import type { ToolOutputResolveView, ToolOutputReferenceState, ResolvedArgsByCallId, ResolveResult } from '
|
|
6
|
-
import type { SubagentToolNodeResumeState } from '
|
|
7
|
-
import type * as t from '
|
|
8
|
-
import { ToolOutputReferenceRegistry } from '
|
|
9
|
-
import { RunnableCallable } from '
|
|
5
|
+
import type { ToolOutputResolveView, ToolOutputReferenceState, ResolvedArgsByCallId, ResolveResult } from './toolOutputReferences.js';
|
|
6
|
+
import type { SubagentToolNodeResumeState } from './subagent/SubagentReplay.js';
|
|
7
|
+
import type * as t from '../types/index.js';
|
|
8
|
+
import { ToolOutputReferenceRegistry } from './toolOutputReferences.js';
|
|
9
|
+
import { RunnableCallable } from '../utils/index.js';
|
|
10
10
|
/**
|
|
11
11
|
* Per-call batch context for `runTool`. Bundles every optional
|
|
12
12
|
* batch-scoped value the method needs so the signature stays at
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
3
|
-
import { Constants } from '
|
|
2
|
+
import type * as t from '../types/index.js';
|
|
3
|
+
import { Constants } from '../common/index.js';
|
|
4
4
|
export declare const ToolSearchToolName = Constants.TOOL_SEARCH;
|
|
5
5
|
export declare const ToolSearchToolDescription = "Searches deferred tools using BM25 ranking. Multi-word queries supported. Use mcp_server param to filter by server.";
|
|
6
6
|
export declare const ToolSearchToolSchema: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
export declare function createCloudflareProgrammaticToolCallingTool(cloudflareConfig: t.CloudflareSandboxExecutionConfig): DynamicStructuredTool;
|
|
4
4
|
export declare function createCloudflareBashProgrammaticToolCallingTool(cloudflareConfig: t.CloudflareSandboxExecutionConfig): DynamicStructuredTool;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { WorkspaceFS } from '
|
|
2
|
-
import type * as t from '
|
|
1
|
+
import type { WorkspaceFS } from '../local/workspaceFS.js';
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
type SpawnResult = {
|
|
4
4
|
stdout: string;
|
|
5
5
|
stderr: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
export declare const CLOUDFLARE_CODING_TOOL_NAMES: readonly string[];
|
|
4
4
|
export declare const CLOUDFLARE_BASH_CODING_TOOL_NAMES: readonly string[];
|
|
5
5
|
export declare const CloudflareCodeExecutionToolDescription: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolCall, ToolCallChunk } from '@langchain/core/messages/tool';
|
|
2
|
-
import type { Graph, MultiAgentGraph, StandardGraph } from '
|
|
3
|
-
import type { AgentContext } from '
|
|
4
|
-
import type * as t from '
|
|
2
|
+
import type { Graph, MultiAgentGraph, StandardGraph } from '../graphs/index.js';
|
|
3
|
+
import type { AgentContext } from '../agents/AgentContext.js';
|
|
4
|
+
import type * as t from '../types/index.js';
|
|
5
5
|
export declare function handleToolCallChunks({ graph, stepKey, toolCallChunks, metadata, observedAt, }: {
|
|
6
6
|
graph: StandardGraph | MultiAgentGraph;
|
|
7
7
|
stepKey: string;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* must call {@link stripIntent} before using their args so no tool receives a
|
|
19
19
|
* parameter it did not declare.
|
|
20
20
|
*/
|
|
21
|
-
import type { JsonSchemaType, OutcomePatch } from '
|
|
21
|
+
import type { JsonSchemaType, OutcomePatch } from '../types/index.js';
|
|
22
22
|
/** Argument carrying the model-authored label for a tool call. */
|
|
23
23
|
export declare const INTENT_ARG = "intent";
|
|
24
24
|
/**
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
* exit code is reported.
|
|
24
24
|
*/
|
|
25
25
|
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
26
|
-
import type * as t from '
|
|
27
|
-
import { Constants } from '
|
|
26
|
+
import type * as t from '../../types/index.js';
|
|
27
|
+
import { Constants } from '../../common/index.js';
|
|
28
28
|
/** Back-compat alias; canonical name lives on `Constants.COMPILE_CHECK`. */
|
|
29
29
|
export declare const CompileCheckToolName = Constants.COMPILE_CHECK;
|
|
30
30
|
export declare function createCompileCheckTool(config?: t.LocalExecutionConfig): DynamicStructuredTool;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceFS } from './workspaceFS';
|
|
2
|
-
import type * as t from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Per-Run snapshot store for write_file / edit_file. Captures the
|
|
5
5
|
* pre-write byte content of every path the local engine is about to
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
3
|
-
import { Constants } from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
|
+
import { Constants } from '../../common/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Tool name aliases retained for back-compat with consumers that imported
|
|
6
6
|
* the per-file `Local*ToolName` constants. The canonical names live on
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceFS } from './workspaceFS';
|
|
2
|
-
import type * as t from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
/** Produces a stable, non-plaintext key for environment-sensitive probes. */
|
|
4
4
|
export declare function commandAvailabilityEnvCacheKey(env: NodeJS.ProcessEnv | undefined): string;
|
|
5
5
|
/** Adds a probe entry while bounding retained environment variants. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
export declare const LocalCodeExecutionToolDescription: string;
|
|
4
4
|
export declare const LocalBashExecutionToolDescription: string;
|
|
5
5
|
export declare function createLocalCodeExecutionTool(config?: t.LocalExecutionConfig): DynamicStructuredTool;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicStructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import type * as t from '
|
|
2
|
+
import type * as t from '../../types/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Run the host's `PreToolUse` hook chain for a single bridge call.
|
|
5
5
|
* Returns the (possibly rewritten) input and a `denyReason` if any
|