@botbotgo/agent-harness 0.0.118 → 0.0.120
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/contracts/runtime.d.ts +4 -68
- package/dist/contracts/workspace.d.ts +43 -12
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/adapter/middleware-assembly.d.ts +28 -4
- package/dist/runtime/adapter/middleware-assembly.js +65 -30
- package/dist/runtime/adapter/stream-event-projection.js +104 -2
- package/dist/runtime/agent-runtime-adapter.d.ts +2 -2
- package/dist/runtime/agent-runtime-adapter.js +39 -29
- package/dist/runtime/harness/run/routing.d.ts +2 -0
- package/dist/runtime/harness/run/routing.js +7 -3
- package/dist/runtime/harness/run/start-run.js +3 -3
- package/dist/runtime/harness.d.ts +3 -3
- package/dist/runtime/harness.js +15 -15
- package/dist/runtime/parsing/index.d.ts +2 -1
- package/dist/runtime/parsing/index.js +1 -1
- package/dist/runtime/parsing/stream-event-parsing.d.ts +1 -2
- package/dist/runtime/parsing/stream-event-parsing.js +0 -99
- package/dist/runtime/parsing/stream-event-types.d.ts +62 -0
- package/dist/runtime/parsing/stream-event-types.js +1 -0
- package/dist/runtime/support/compiled-binding.d.ts +7 -5
- package/dist/runtime/support/compiled-binding.js +140 -47
- package/dist/runtime/support/harness-support.d.ts +1 -1
- package/dist/runtime/support/harness-support.js +5 -5
- package/dist/utils/compiled-binding.d.ts +3 -0
- package/dist/utils/compiled-binding.js +33 -0
- package/dist/workspace/agent-binding-compiler.js +66 -55
- package/package.json +1 -1
|
@@ -1,31 +1,93 @@
|
|
|
1
|
+
import { attachLegacyExecutionAliases, stripLegacyExecutionAliases } from "../../utils/compiled-binding.js";
|
|
1
2
|
import { asRecord } from "../../utils/object.js";
|
|
2
3
|
const bindingExecutionViewCache = new WeakMap();
|
|
3
4
|
function getLegacyAdapterParams(binding) {
|
|
4
5
|
return asRecord(binding.adapter?.config?.params);
|
|
5
6
|
}
|
|
7
|
+
function inferBindingAdapterKind(binding) {
|
|
8
|
+
if (binding.adapter?.kind) {
|
|
9
|
+
return binding.adapter.kind;
|
|
10
|
+
}
|
|
11
|
+
if (binding.execution?.kind === "langchain-v1" || binding.execution?.kind === "deepagent") {
|
|
12
|
+
return binding.execution.kind;
|
|
13
|
+
}
|
|
14
|
+
if (binding.langchainAgentParams) {
|
|
15
|
+
return "langchain-v1";
|
|
16
|
+
}
|
|
17
|
+
if (binding.deepAgentParams) {
|
|
18
|
+
return "deepagent";
|
|
19
|
+
}
|
|
20
|
+
return binding.agent.executionMode;
|
|
21
|
+
}
|
|
22
|
+
function normalizeBindingExecution(binding) {
|
|
23
|
+
const adapterKind = inferBindingAdapterKind(binding);
|
|
24
|
+
if (binding.execution?.kind === "langchain-v1") {
|
|
25
|
+
attachLegacyExecutionAliases(binding);
|
|
26
|
+
return { adapterKind, execution: binding.execution };
|
|
27
|
+
}
|
|
28
|
+
if (binding.execution?.kind === "deepagent") {
|
|
29
|
+
attachLegacyExecutionAliases(binding);
|
|
30
|
+
return { adapterKind, execution: binding.execution };
|
|
31
|
+
}
|
|
32
|
+
if (adapterKind !== "langchain-v1" && adapterKind !== "deepagent") {
|
|
33
|
+
return { adapterKind };
|
|
34
|
+
}
|
|
35
|
+
if (binding.langchainAgentParams) {
|
|
36
|
+
const execution = {
|
|
37
|
+
kind: "langchain-v1",
|
|
38
|
+
params: binding.langchainAgentParams,
|
|
39
|
+
};
|
|
40
|
+
binding.execution = execution;
|
|
41
|
+
attachLegacyExecutionAliases(binding);
|
|
42
|
+
return { adapterKind, execution };
|
|
43
|
+
}
|
|
44
|
+
if (binding.deepAgentParams) {
|
|
45
|
+
const execution = {
|
|
46
|
+
kind: "deepagent",
|
|
47
|
+
params: binding.deepAgentParams,
|
|
48
|
+
};
|
|
49
|
+
binding.execution = execution;
|
|
50
|
+
attachLegacyExecutionAliases(binding);
|
|
51
|
+
return { adapterKind, execution };
|
|
52
|
+
}
|
|
53
|
+
const legacyAdapterParams = getLegacyAdapterParams(binding);
|
|
54
|
+
if (adapterKind === "langchain-v1" && legacyAdapterParams) {
|
|
55
|
+
const params = legacyAdapterParams;
|
|
56
|
+
binding.execution = {
|
|
57
|
+
kind: "langchain-v1",
|
|
58
|
+
params,
|
|
59
|
+
};
|
|
60
|
+
attachLegacyExecutionAliases(binding);
|
|
61
|
+
return { adapterKind, execution: binding.execution };
|
|
62
|
+
}
|
|
63
|
+
if (adapterKind === "deepagent" && legacyAdapterParams) {
|
|
64
|
+
const params = legacyAdapterParams;
|
|
65
|
+
binding.execution = {
|
|
66
|
+
kind: "deepagent",
|
|
67
|
+
params,
|
|
68
|
+
};
|
|
69
|
+
attachLegacyExecutionAliases(binding);
|
|
70
|
+
return { adapterKind, execution: binding.execution };
|
|
71
|
+
}
|
|
72
|
+
return { adapterKind };
|
|
73
|
+
}
|
|
6
74
|
function deriveBindingExecutionView(binding) {
|
|
7
75
|
const cached = bindingExecutionViewCache.get(binding);
|
|
8
76
|
if (cached) {
|
|
9
77
|
return cached;
|
|
10
78
|
}
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
? legacyAdapterParams
|
|
18
|
-
: undefined);
|
|
19
|
-
const deepAgentParams = (compiledExecution?.kind === "deepagent" ? compiledExecution.params : undefined) ??
|
|
20
|
-
binding.deepAgentParams ??
|
|
21
|
-
(adapterKind === "deepagent" && legacyAdapterParams
|
|
22
|
-
? legacyAdapterParams
|
|
23
|
-
: undefined);
|
|
79
|
+
const normalized = normalizeBindingExecution(binding);
|
|
80
|
+
const adapterKind = normalized.adapterKind;
|
|
81
|
+
const langchainParams = normalized.execution?.kind === "langchain-v1" ? binding.langchainAgentParams : undefined;
|
|
82
|
+
const deepAgentParams = normalized.execution?.kind === "deepagent" ? binding.deepAgentParams : undefined;
|
|
83
|
+
const canonicalLangchainParams = normalized.execution?.kind === "langchain-v1" ? normalized.execution.params : undefined;
|
|
84
|
+
const canonicalDeepAgentParams = normalized.execution?.kind === "deepagent" ? normalized.execution.params : undefined;
|
|
24
85
|
const primaryTools = langchainParams?.tools ?? deepAgentParams?.tools ?? [];
|
|
25
86
|
const middlewareConfigs = langchainParams?.middleware ?? deepAgentParams?.middleware;
|
|
26
87
|
const middlewareKinds = new Set((middlewareConfigs ?? [])
|
|
27
88
|
.map((entry) => typeof entry.kind === "string" ? entry.kind : "")
|
|
28
89
|
.filter(Boolean));
|
|
90
|
+
const langchainRuntimeConfig = binding.harnessRuntime?.langchain;
|
|
29
91
|
const view = {
|
|
30
92
|
adapterKind,
|
|
31
93
|
langchainParams,
|
|
@@ -37,13 +99,14 @@ function deriveBindingExecutionView(binding) {
|
|
|
37
99
|
systemPrompt: langchainParams?.systemPrompt ?? deepAgentParams?.systemPrompt,
|
|
38
100
|
middlewareConfigs,
|
|
39
101
|
middlewareKinds,
|
|
40
|
-
interruptCompatibilityRules:
|
|
102
|
+
interruptCompatibilityRules: langchainRuntimeConfig?.interruptOn ??
|
|
103
|
+
langchainParams?.interruptOn ??
|
|
41
104
|
deepAgentParams?.interruptOn,
|
|
42
|
-
storeConfig:
|
|
43
|
-
langChainSubagentSupport: (
|
|
44
|
-
langchainParams?.generalPurposeAgent === true ||
|
|
45
|
-
Boolean(langchainParams?.taskDescription?.trim()),
|
|
46
|
-
deepAgentSubagentCount:
|
|
105
|
+
storeConfig: canonicalDeepAgentParams?.store ?? binding.harnessRuntime?.store,
|
|
106
|
+
langChainSubagentSupport: (langchainRuntimeConfig?.subagents?.length ?? 0) > 0 ||
|
|
107
|
+
(langchainRuntimeConfig?.generalPurposeAgent ?? langchainParams?.generalPurposeAgent) === true ||
|
|
108
|
+
Boolean((langchainRuntimeConfig?.taskDescription ?? langchainParams?.taskDescription)?.trim()),
|
|
109
|
+
deepAgentSubagentCount: canonicalDeepAgentParams?.subagents?.length ?? 0,
|
|
47
110
|
};
|
|
48
111
|
bindingExecutionViewCache.set(binding, view);
|
|
49
112
|
return view;
|
|
@@ -54,6 +117,12 @@ export function getBindingExecutionView(binding) {
|
|
|
54
117
|
export function getBindingAdapterKind(binding) {
|
|
55
118
|
return getBindingExecutionView(binding).adapterKind;
|
|
56
119
|
}
|
|
120
|
+
export function getBindingCanonicalExecution(binding) {
|
|
121
|
+
return normalizeBindingExecution(binding).execution;
|
|
122
|
+
}
|
|
123
|
+
export function getBindingRuntimeExecutionMode(binding) {
|
|
124
|
+
return getBindingExecutionKind(binding) ?? getBindingAdapterKind(binding);
|
|
125
|
+
}
|
|
57
126
|
export function getBindingLangChainParams(binding) {
|
|
58
127
|
return getBindingExecutionView(binding).langchainParams;
|
|
59
128
|
}
|
|
@@ -64,17 +133,8 @@ export function getBindingExecutionParams(binding) {
|
|
|
64
133
|
return getBindingExecutionView(binding).executionParams;
|
|
65
134
|
}
|
|
66
135
|
export function getBindingExecutionKind(binding) {
|
|
67
|
-
const execution = binding
|
|
68
|
-
|
|
69
|
-
return execution.kind;
|
|
70
|
-
}
|
|
71
|
-
if (getBindingAdapterKind(binding) === "langchain-v1" || binding.langchainAgentParams) {
|
|
72
|
-
return "langchain-v1";
|
|
73
|
-
}
|
|
74
|
-
if (getBindingAdapterKind(binding) === "deepagent" || binding.deepAgentParams) {
|
|
75
|
-
return "deepagent";
|
|
76
|
-
}
|
|
77
|
-
return undefined;
|
|
136
|
+
const execution = getBindingCanonicalExecution(binding);
|
|
137
|
+
return execution?.kind;
|
|
78
138
|
}
|
|
79
139
|
export function withUpdatedBindingExecutionParams(binding, updater) {
|
|
80
140
|
const kind = getBindingExecutionKind(binding);
|
|
@@ -84,48 +144,78 @@ export function withUpdatedBindingExecutionParams(binding, updater) {
|
|
|
84
144
|
}
|
|
85
145
|
const updatedParams = updater(params);
|
|
86
146
|
if (kind === "langchain-v1") {
|
|
87
|
-
return {
|
|
88
|
-
...binding,
|
|
147
|
+
return attachLegacyExecutionAliases({
|
|
148
|
+
...stripLegacyExecutionAliases(binding),
|
|
89
149
|
execution: {
|
|
90
150
|
kind,
|
|
91
151
|
params: updatedParams,
|
|
92
152
|
},
|
|
93
|
-
|
|
94
|
-
};
|
|
153
|
+
});
|
|
95
154
|
}
|
|
96
|
-
return {
|
|
97
|
-
...binding,
|
|
155
|
+
return attachLegacyExecutionAliases({
|
|
156
|
+
...stripLegacyExecutionAliases(binding),
|
|
98
157
|
execution: {
|
|
99
158
|
kind,
|
|
100
159
|
params: updatedParams,
|
|
101
160
|
},
|
|
102
|
-
|
|
103
|
-
};
|
|
161
|
+
});
|
|
104
162
|
}
|
|
105
163
|
export function getBindingSkills(binding) {
|
|
164
|
+
const langchainSkills = binding.harnessRuntime?.langchain?.skills;
|
|
165
|
+
if (Array.isArray(langchainSkills)) {
|
|
166
|
+
return langchainSkills;
|
|
167
|
+
}
|
|
168
|
+
const legacyLangchainSkills = binding.langchainAgentParams?.skills;
|
|
169
|
+
if (Array.isArray(legacyLangchainSkills)) {
|
|
170
|
+
return legacyLangchainSkills;
|
|
171
|
+
}
|
|
106
172
|
const execution = getBindingExecutionParams(binding);
|
|
107
|
-
return Array.isArray(execution?.skills)
|
|
173
|
+
return Array.isArray(execution?.skills)
|
|
174
|
+
? (execution.skills)
|
|
175
|
+
: [];
|
|
108
176
|
}
|
|
109
177
|
export function getBindingMemorySources(binding) {
|
|
178
|
+
const langchainMemory = binding.harnessRuntime?.langchain?.memory;
|
|
179
|
+
if (Array.isArray(langchainMemory)) {
|
|
180
|
+
return langchainMemory;
|
|
181
|
+
}
|
|
182
|
+
const legacyLangchainMemory = binding.langchainAgentParams?.memory;
|
|
183
|
+
if (Array.isArray(legacyLangchainMemory)) {
|
|
184
|
+
return legacyLangchainMemory;
|
|
185
|
+
}
|
|
110
186
|
const execution = getBindingExecutionParams(binding);
|
|
111
187
|
return Array.isArray(execution?.memory)
|
|
112
188
|
? (execution.memory)
|
|
113
189
|
: [];
|
|
114
190
|
}
|
|
115
191
|
export function getBindingSubagents(binding) {
|
|
192
|
+
const langchainSubagents = binding.harnessRuntime?.langchain?.subagents;
|
|
193
|
+
if (Array.isArray(langchainSubagents)) {
|
|
194
|
+
return langchainSubagents;
|
|
195
|
+
}
|
|
196
|
+
const legacyLangchainSubagents = binding.langchainAgentParams?.subagents;
|
|
197
|
+
if (Array.isArray(legacyLangchainSubagents)) {
|
|
198
|
+
return legacyLangchainSubagents;
|
|
199
|
+
}
|
|
116
200
|
const execution = getBindingExecutionParams(binding);
|
|
117
201
|
return Array.isArray(execution?.subagents)
|
|
118
202
|
? (execution.subagents)
|
|
119
203
|
: [];
|
|
120
204
|
}
|
|
121
205
|
export function getBindingGeneralPurposeAgent(binding) {
|
|
122
|
-
const
|
|
123
|
-
|
|
206
|
+
const langchainGeneralPurposeAgent = binding.harnessRuntime?.langchain?.generalPurposeAgent;
|
|
207
|
+
if (typeof langchainGeneralPurposeAgent === "boolean") {
|
|
208
|
+
return langchainGeneralPurposeAgent;
|
|
209
|
+
}
|
|
210
|
+
const value = binding.langchainAgentParams?.generalPurposeAgent;
|
|
124
211
|
return typeof value === "boolean" ? value : undefined;
|
|
125
212
|
}
|
|
126
213
|
export function getBindingTaskDescription(binding) {
|
|
127
|
-
const
|
|
128
|
-
|
|
214
|
+
const langchainTaskDescription = binding.harnessRuntime?.langchain?.taskDescription;
|
|
215
|
+
if (typeof langchainTaskDescription === "string" && langchainTaskDescription.trim().length > 0) {
|
|
216
|
+
return langchainTaskDescription;
|
|
217
|
+
}
|
|
218
|
+
const value = binding.langchainAgentParams?.taskDescription;
|
|
129
219
|
return typeof value === "string" && value.trim().length > 0 ? value : undefined;
|
|
130
220
|
}
|
|
131
221
|
export function getBindingBackendConfig(binding) {
|
|
@@ -134,15 +224,18 @@ export function getBindingBackendConfig(binding) {
|
|
|
134
224
|
return typeof backend === "object" && backend ? backend : undefined;
|
|
135
225
|
}
|
|
136
226
|
export function getBindingFilesystemConfig(binding) {
|
|
137
|
-
const
|
|
138
|
-
|
|
227
|
+
const langchainFilesystem = binding.harnessRuntime?.langchain?.filesystem;
|
|
228
|
+
if (typeof langchainFilesystem === "object" && langchainFilesystem) {
|
|
229
|
+
return langchainFilesystem;
|
|
230
|
+
}
|
|
231
|
+
const filesystem = binding.langchainAgentParams?.filesystem;
|
|
139
232
|
return typeof filesystem === "object" && filesystem ? filesystem : undefined;
|
|
140
233
|
}
|
|
141
234
|
export function isLangChainBinding(binding) {
|
|
142
|
-
return
|
|
235
|
+
return getBindingExecutionKind(binding) === "langchain-v1";
|
|
143
236
|
}
|
|
144
237
|
export function isDeepAgentBinding(binding) {
|
|
145
|
-
return
|
|
238
|
+
return getBindingExecutionKind(binding) === "deepagent";
|
|
146
239
|
}
|
|
147
240
|
export function getBindingPrimaryTools(binding) {
|
|
148
241
|
return getBindingExecutionView(binding).primaryTools;
|
|
@@ -11,5 +11,5 @@ export declare function createHarnessEvent(threadId: string, runId: string, sequ
|
|
|
11
11
|
export declare function createPendingApproval(threadId: string, runId: string, checkpointRef: string, input: string, interruptContent?: string): InternalApprovalRecord;
|
|
12
12
|
export declare function inferRoutingBindings(workspace: WorkspaceBundle): {
|
|
13
13
|
primaryBinding: import("../../contracts/workspace.js").CompiledAgentBinding;
|
|
14
|
-
|
|
14
|
+
runtimeEntryBindings: import("../../contracts/workspace.js").CompiledAgentBinding[];
|
|
15
15
|
};
|
|
@@ -87,9 +87,9 @@ export function createPendingApproval(threadId, runId, checkpointRef, input, int
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
export function inferRoutingBindings(workspace) {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
const primaryBinding =
|
|
94
|
-
return { primaryBinding,
|
|
90
|
+
const runtimeEntryBindings = Array.from(workspace.bindings.values());
|
|
91
|
+
const orchestrationRuntimeEntries = runtimeEntryBindings.filter((binding) => isDeepAgentBinding(binding));
|
|
92
|
+
const routingEntries = orchestrationRuntimeEntries.length > 0 ? orchestrationRuntimeEntries : runtimeEntryBindings;
|
|
93
|
+
const primaryBinding = routingEntries.find((binding) => isDelegationCapableBinding(binding)) ?? routingEntries[0] ?? runtimeEntryBindings[0];
|
|
94
|
+
return { primaryBinding, runtimeEntryBindings };
|
|
95
95
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompiledAgentBinding } from "../contracts/types.js";
|
|
2
|
+
export declare function attachLegacyExecutionAliases(binding: CompiledAgentBinding): CompiledAgentBinding;
|
|
3
|
+
export declare function stripLegacyExecutionAliases(binding: CompiledAgentBinding): CompiledAgentBinding;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function defineExecutionAlias(binding, property, kind) {
|
|
2
|
+
if (Object.prototype.hasOwnProperty.call(binding, property)) {
|
|
3
|
+
return;
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(binding, property, {
|
|
6
|
+
configurable: true,
|
|
7
|
+
enumerable: false,
|
|
8
|
+
get() {
|
|
9
|
+
return binding.execution?.kind === kind ? binding.execution.params : undefined;
|
|
10
|
+
},
|
|
11
|
+
set(value) {
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
if (binding.execution?.kind === kind) {
|
|
14
|
+
delete binding.execution;
|
|
15
|
+
}
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
binding.execution = {
|
|
19
|
+
kind,
|
|
20
|
+
params: value,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function attachLegacyExecutionAliases(binding) {
|
|
26
|
+
defineExecutionAlias(binding, "langchainAgentParams", "langchain-v1");
|
|
27
|
+
defineExecutionAlias(binding, "deepAgentParams", "deepagent");
|
|
28
|
+
return binding;
|
|
29
|
+
}
|
|
30
|
+
export function stripLegacyExecutionAliases(binding) {
|
|
31
|
+
const { langchainAgentParams: _langchainAgentParams, deepAgentParams: _deepAgentParams, ...rest } = binding;
|
|
32
|
+
return rest;
|
|
33
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { getSkillInheritancePolicy, resolveToolTargets } from "../extensions.js";
|
|
3
|
+
import { attachLegacyExecutionAliases } from "../utils/compiled-binding.js";
|
|
3
4
|
import { compileModel, compileTool } from "./resource-compilers.js";
|
|
4
5
|
import { inferAgentCapabilities } from "./support/agent-capabilities.js";
|
|
5
6
|
import { getAgentExecutionConfigValue, getAgentExecutionObject, getAgentExecutionString } from "./support/agent-execution-config.js";
|
|
@@ -142,7 +143,6 @@ function compileExecutionCore(agent, models, tools) {
|
|
|
142
143
|
responseFormat: resolveResponseFormat(agent),
|
|
143
144
|
contextSchema: resolveContextSchema(agent),
|
|
144
145
|
middleware: resolveCompiledMiddleware(agent, models),
|
|
145
|
-
passthrough: resolvePassthrough(agent),
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
function resolveBackendConfig(agent, refs) {
|
|
@@ -247,11 +247,12 @@ export function compileBinding(workspaceRoot, agent, agents, referencedSubagentI
|
|
|
247
247
|
const resilience = getResilienceConfig(refs);
|
|
248
248
|
const compiledAgentSkills = compileAgentSkills(workspaceRoot, agent);
|
|
249
249
|
const compiledAgentMemory = compileAgentMemories(workspaceRoot, agent.memorySources);
|
|
250
|
-
const
|
|
250
|
+
const executionCore = compileExecutionCore({
|
|
251
251
|
...agent,
|
|
252
252
|
modelRef: agent.modelRef || (internalSubagent ? "model/default" : ""),
|
|
253
253
|
}, models, tools);
|
|
254
|
-
const
|
|
254
|
+
const passthrough = resolvePassthrough(agent);
|
|
255
|
+
const compiledAgentModel = executionCore.model;
|
|
255
256
|
const backend = resolveBackendConfig(agent, refs);
|
|
256
257
|
const store = resolveStoreConfig(agent, refs);
|
|
257
258
|
const checkpointer = resolveCheckpointerConfig(agent, refs);
|
|
@@ -268,6 +269,28 @@ export function compileBinding(workspaceRoot, agent, agents, referencedSubagentI
|
|
|
268
269
|
workspaceRoot,
|
|
269
270
|
capabilities: inferAgentCapabilities(agent),
|
|
270
271
|
resilience,
|
|
272
|
+
...(agent.executionMode === "deepagent"
|
|
273
|
+
? {
|
|
274
|
+
deepagent: {
|
|
275
|
+
description: agent.description,
|
|
276
|
+
passthrough,
|
|
277
|
+
},
|
|
278
|
+
}
|
|
279
|
+
: {}),
|
|
280
|
+
...(agent.executionMode === "langchain-v1"
|
|
281
|
+
? {
|
|
282
|
+
langchain: {
|
|
283
|
+
passthrough,
|
|
284
|
+
interruptOn: resolveInterruptOn(agent),
|
|
285
|
+
filesystem: getAgentExecutionObject(agent, "filesystem", { executionMode: "langchain-v1" }),
|
|
286
|
+
subagents: compileSubagents(agent, agents, workspaceRoot, models, tools, compiledAgentSkills, compiledAgentModel),
|
|
287
|
+
memory: compiledAgentMemory,
|
|
288
|
+
skills: compiledAgentSkills,
|
|
289
|
+
generalPurposeAgent: getAgentExecutionConfigValue(agent, "generalPurposeAgent", { executionMode: "langchain-v1" }),
|
|
290
|
+
taskDescription: getAgentExecutionString(agent, "taskDescription", { executionMode: "langchain-v1" }),
|
|
291
|
+
},
|
|
292
|
+
}
|
|
293
|
+
: {}),
|
|
271
294
|
...(checkpointer ? { checkpointer: checkpointer.config } : {}),
|
|
272
295
|
...(store ? { store: store.config } : {}),
|
|
273
296
|
...(runtimeMemory ? { runtimeMemory: runtimeMemory.config } : {}),
|
|
@@ -275,61 +298,49 @@ export function compileBinding(workspaceRoot, agent, agents, referencedSubagentI
|
|
|
275
298
|
};
|
|
276
299
|
if (agent.executionMode !== "deepagent") {
|
|
277
300
|
const langchainVersion = getAgentExecutionConfigValue(agent, "version", { executionMode: "langchain-v1" });
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
includeAgentName: getAgentExecutionConfigValue(agent, "includeAgentName", { executionMode: "langchain-v1" }) === "inline" ? "inline" : undefined,
|
|
295
|
-
version: langchainVersion === "v1" || langchainVersion === "v2"
|
|
296
|
-
? langchainVersion
|
|
297
|
-
: undefined,
|
|
298
|
-
name: resolveAgentRuntimeName(agent),
|
|
299
|
-
description: agent.description,
|
|
300
|
-
};
|
|
301
|
-
return {
|
|
302
|
-
...base,
|
|
303
|
-
execution: {
|
|
304
|
-
kind: "langchain-v1",
|
|
305
|
-
params: langchainAgentParams,
|
|
301
|
+
const executionBinding = {
|
|
302
|
+
kind: "langchain-v1",
|
|
303
|
+
params: {
|
|
304
|
+
model: executionCore.model,
|
|
305
|
+
tools: executionCore.tools,
|
|
306
|
+
systemPrompt: executionCore.systemPrompt,
|
|
307
|
+
stateSchema: getAgentExecutionConfigValue(agent, "stateSchema", { executionMode: "langchain-v1" }),
|
|
308
|
+
responseFormat: executionCore.responseFormat,
|
|
309
|
+
contextSchema: executionCore.contextSchema,
|
|
310
|
+
middleware: executionCore.middleware,
|
|
311
|
+
includeAgentName: getAgentExecutionConfigValue(agent, "includeAgentName", { executionMode: "langchain-v1" }) === "inline" ? "inline" : undefined,
|
|
312
|
+
version: langchainVersion === "v1" || langchainVersion === "v2"
|
|
313
|
+
? langchainVersion
|
|
314
|
+
: undefined,
|
|
315
|
+
name: resolveAgentRuntimeName(agent),
|
|
316
|
+
description: agent.description,
|
|
306
317
|
},
|
|
307
|
-
langchainAgentParams,
|
|
308
318
|
};
|
|
319
|
+
return attachLegacyExecutionAliases({
|
|
320
|
+
...base,
|
|
321
|
+
execution: executionBinding,
|
|
322
|
+
});
|
|
309
323
|
}
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
};
|
|
327
|
-
return {
|
|
328
|
-
...base,
|
|
329
|
-
execution: {
|
|
330
|
-
kind: "deepagent",
|
|
331
|
-
params: deepAgentParams,
|
|
324
|
+
const executionBinding = {
|
|
325
|
+
kind: "deepagent",
|
|
326
|
+
params: {
|
|
327
|
+
model: executionCore.model,
|
|
328
|
+
tools: executionCore.tools,
|
|
329
|
+
systemPrompt: executionCore.systemPrompt,
|
|
330
|
+
responseFormat: executionCore.responseFormat,
|
|
331
|
+
contextSchema: executionCore.contextSchema,
|
|
332
|
+
middleware: executionCore.middleware,
|
|
333
|
+
subagents: compileSubagents(agent, agents, workspaceRoot, models, tools, compiledAgentSkills, compiledAgentModel),
|
|
334
|
+
interruptOn: resolveInterruptOn(agent),
|
|
335
|
+
...(backend ? { backend: backend.config } : {}),
|
|
336
|
+
...(store ? { store: store.config } : {}),
|
|
337
|
+
name: resolveAgentRuntimeName(agent),
|
|
338
|
+
memory: compiledAgentMemory,
|
|
339
|
+
skills: compiledAgentSkills,
|
|
332
340
|
},
|
|
333
|
-
deepAgentParams,
|
|
334
341
|
};
|
|
342
|
+
return attachLegacyExecutionAliases({
|
|
343
|
+
...base,
|
|
344
|
+
execution: executionBinding,
|
|
345
|
+
});
|
|
335
346
|
}
|