@botbotgo/agent-harness 0.0.108 → 0.0.110
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/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/adapter/execution-context.d.ts +7 -0
- package/dist/runtime/adapter/execution-context.js +9 -2
- package/dist/runtime/adapter/middleware-assembly.js +2 -2
- package/dist/runtime/adapter/runnable-config.d.ts +44 -0
- package/dist/runtime/adapter/runnable-config.js +51 -0
- package/dist/runtime/adapter/runtime-adapter-support.d.ts +0 -1
- package/dist/runtime/adapter/runtime-adapter-support.js +1 -4
- package/dist/runtime/agent-runtime-adapter.d.ts +1 -0
- package/dist/runtime/agent-runtime-adapter.js +37 -20
- package/dist/runtime/harness/events/listener-runtime.d.ts +18 -0
- package/dist/runtime/harness/events/listener-runtime.js +9 -0
- package/dist/runtime/harness/events/runtime-event-operations.d.ts +17 -0
- package/dist/runtime/harness/events/runtime-event-operations.js +9 -0
- package/dist/runtime/harness/run/recovery.d.ts +1 -1
- package/dist/runtime/harness/run/recovery.js +65 -47
- package/dist/runtime/harness/run/routing.d.ts +8 -0
- package/dist/runtime/harness/run/routing.js +21 -0
- package/dist/runtime/harness/run/run-operations.d.ts +47 -0
- package/dist/runtime/harness/run/run-operations.js +108 -6
- package/dist/runtime/harness/run/start-run.d.ts +82 -0
- package/dist/runtime/harness/run/start-run.js +88 -0
- package/dist/runtime/harness/run/startup-runtime.d.ts +2 -1
- package/dist/runtime/harness/run/startup-runtime.js +38 -3
- package/dist/runtime/harness.d.ts +5 -3
- package/dist/runtime/harness.js +163 -238
- package/dist/runtime/support/runtime-adapter-options.d.ts +17 -0
- package/dist/runtime/support/runtime-adapter-options.js +29 -0
- package/dist/workspace/agent-binding-compiler.js +24 -88
- package/dist/workspace/support/agent-capabilities.js +2 -6
- package/dist/workspace/support/agent-execution-config.d.ts +18 -0
- package/dist/workspace/support/agent-execution-config.js +35 -0
- package/dist/workspace/validate.js +6 -11
- package/package.json +1 -1
- package/dist/runtime/adapter/deepagent-runnable-config.d.ts +0 -13
- package/dist/runtime/adapter/deepagent-runnable-config.js +0 -29
- package/dist/runtime/adapter/langchain-runnable-config.d.ts +0 -11
- package/dist/runtime/adapter/langchain-runnable-config.js +0 -24
|
@@ -2,6 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { getSkillInheritancePolicy, resolveToolTargets } from "../extensions.js";
|
|
3
3
|
import { compileModel, compileTool } from "./resource-compilers.js";
|
|
4
4
|
import { inferAgentCapabilities } from "./support/agent-capabilities.js";
|
|
5
|
+
import { getAgentExecutionConfigValue, getAgentExecutionObject, getAgentExecutionString } from "./support/agent-execution-config.js";
|
|
5
6
|
import { discoverSkillPaths } from "./support/discovery.js";
|
|
6
7
|
import { compileAgentMemories, getResilienceConfig, getRuntimeDefaults, getRuntimeMemoryDefaults, getRuntimeModelDefaults, getWorkspaceObject, resolvePromptValue, resolveRefId } from "./support/workspace-ref-utils.js";
|
|
7
8
|
const WORKSPACE_BOUNDARY_GUIDANCE = "Keep repository and file exploration bounded to the current workspace root unless the user explicitly asks for broader host or filesystem access. " +
|
|
@@ -11,9 +12,7 @@ function requireSkills(pathEntries, workspaceRoot) {
|
|
|
11
12
|
return Array.from(new Set(discoverSkillPaths(pathEntries, workspaceRoot)));
|
|
12
13
|
}
|
|
13
14
|
function resolveInheritancePolicy(agent) {
|
|
14
|
-
|
|
15
|
-
const deepagentPolicy = typeof agent.deepAgentConfig?.skillInheritancePolicy === "string" ? agent.deepAgentConfig.skillInheritancePolicy : undefined;
|
|
16
|
-
return (langchainPolicy ?? deepagentPolicy ?? "default").trim();
|
|
15
|
+
return getAgentExecutionString(agent, "skillInheritancePolicy") ?? "default";
|
|
17
16
|
}
|
|
18
17
|
export function compileAgentSkills(workspaceRoot, agent, parentSkills = []) {
|
|
19
18
|
const policyName = resolveInheritancePolicy(agent);
|
|
@@ -106,40 +105,28 @@ function buildSubagent(agent, workspaceRoot, models, tools, parentSkills, parent
|
|
|
106
105
|
passthrough: execution.passthrough,
|
|
107
106
|
};
|
|
108
107
|
}
|
|
109
|
-
function resolveDirectPrompt(agent) {
|
|
110
|
-
return resolvePromptValue(agent.langchainAgentConfig?.systemPrompt);
|
|
111
|
-
}
|
|
112
108
|
function resolveSystemPrompt(agent) {
|
|
109
|
+
const prompt = resolvePromptValue(getAgentExecutionConfigValue(agent, "systemPrompt"));
|
|
113
110
|
if (agent.executionMode !== "deepagent") {
|
|
114
|
-
return
|
|
111
|
+
return prompt;
|
|
115
112
|
}
|
|
116
|
-
|
|
117
|
-
return [deepagentPrompt ?? resolveDirectPrompt(agent), WORKSPACE_BOUNDARY_GUIDANCE].filter(Boolean).join("\n\n");
|
|
113
|
+
return [prompt, WORKSPACE_BOUNDARY_GUIDANCE].filter(Boolean).join("\n\n");
|
|
118
114
|
}
|
|
119
115
|
function resolveInterruptOn(agent) {
|
|
120
|
-
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
return (agent.deepAgentConfig?.interruptOn ??
|
|
124
|
-
agent.langchainAgentConfig?.interruptOn);
|
|
116
|
+
return getAgentExecutionObject(agent, "interruptOn");
|
|
125
117
|
}
|
|
126
118
|
function resolveResponseFormat(agent) {
|
|
127
|
-
return agent
|
|
119
|
+
return getAgentExecutionConfigValue(agent, "responseFormat");
|
|
128
120
|
}
|
|
129
121
|
function resolveContextSchema(agent) {
|
|
130
|
-
return agent
|
|
122
|
+
return getAgentExecutionConfigValue(agent, "contextSchema");
|
|
131
123
|
}
|
|
132
124
|
function resolveCompiledMiddleware(agent, models) {
|
|
133
|
-
const middleware = agent
|
|
134
|
-
agent.langchainAgentConfig?.middleware;
|
|
125
|
+
const middleware = getAgentExecutionConfigValue(agent, "middleware");
|
|
135
126
|
return compileMiddlewareConfigs(middleware, models, agent.id);
|
|
136
127
|
}
|
|
137
128
|
function resolvePassthrough(agent) {
|
|
138
|
-
const passthrough =
|
|
139
|
-
? agent.deepAgentConfig.passthrough
|
|
140
|
-
: typeof agent.langchainAgentConfig?.passthrough === "object" && agent.langchainAgentConfig.passthrough
|
|
141
|
-
? agent.langchainAgentConfig.passthrough
|
|
142
|
-
: undefined;
|
|
129
|
+
const passthrough = getAgentExecutionObject(agent, "passthrough");
|
|
143
130
|
return passthrough ? { ...passthrough } : undefined;
|
|
144
131
|
}
|
|
145
132
|
function compileSubagents(agent, agents, workspaceRoot, models, tools, compiledAgentSkills, compiledAgentModel, compiledAgentMemory) {
|
|
@@ -166,9 +153,7 @@ function resolveBackendConfig(agent, refs) {
|
|
|
166
153
|
if (agent.executionMode !== "deepagent") {
|
|
167
154
|
return undefined;
|
|
168
155
|
}
|
|
169
|
-
const backendConfig =
|
|
170
|
-
? agent.deepAgentConfig.backend
|
|
171
|
-
: undefined;
|
|
156
|
+
const backendConfig = getAgentExecutionObject(agent, "backend");
|
|
172
157
|
if (!backendConfig) {
|
|
173
158
|
return undefined;
|
|
174
159
|
}
|
|
@@ -221,11 +206,7 @@ function materializeWorkspaceObjectConfig(refs, ref, allowedKinds, ownerLabel) {
|
|
|
221
206
|
return config;
|
|
222
207
|
}
|
|
223
208
|
function resolveStoreConfig(agent, refs) {
|
|
224
|
-
const inlineStore =
|
|
225
|
-
? agent.deepAgentConfig.store
|
|
226
|
-
: typeof agent.langchainAgentConfig?.store === "object" && agent.langchainAgentConfig.store
|
|
227
|
-
? agent.langchainAgentConfig.store
|
|
228
|
-
: undefined;
|
|
209
|
+
const inlineStore = getAgentExecutionObject(agent, "store");
|
|
229
210
|
if (!inlineStore) {
|
|
230
211
|
return undefined;
|
|
231
212
|
}
|
|
@@ -237,15 +218,7 @@ function resolveStoreConfig(agent, refs) {
|
|
|
237
218
|
return { config: inlineStore };
|
|
238
219
|
}
|
|
239
220
|
function resolveCheckpointerConfig(agent, refs) {
|
|
240
|
-
const inlineAgentCheckpointer =
|
|
241
|
-
? agent.deepAgentConfig.checkpointer
|
|
242
|
-
: typeof agent.deepAgentConfig?.checkpointer === "boolean"
|
|
243
|
-
? agent.deepAgentConfig.checkpointer
|
|
244
|
-
: typeof agent.langchainAgentConfig?.checkpointer === "object" && agent.langchainAgentConfig.checkpointer
|
|
245
|
-
? agent.langchainAgentConfig.checkpointer
|
|
246
|
-
: typeof agent.langchainAgentConfig?.checkpointer === "boolean"
|
|
247
|
-
? agent.langchainAgentConfig.checkpointer
|
|
248
|
-
: undefined;
|
|
221
|
+
const inlineAgentCheckpointer = getAgentExecutionConfigValue(agent, "checkpointer");
|
|
249
222
|
if (inlineAgentCheckpointer === undefined) {
|
|
250
223
|
return undefined;
|
|
251
224
|
}
|
|
@@ -260,11 +233,7 @@ function resolveCheckpointerConfig(agent, refs) {
|
|
|
260
233
|
return { config: inlineAgentCheckpointer };
|
|
261
234
|
}
|
|
262
235
|
function resolveRuntimeMemoryConfig(agent, refs) {
|
|
263
|
-
const inlineRuntimeMemory =
|
|
264
|
-
? agent.deepAgentConfig.runtimeMemory
|
|
265
|
-
: typeof agent.langchainAgentConfig?.runtimeMemory === "object" && agent.langchainAgentConfig.runtimeMemory
|
|
266
|
-
? agent.langchainAgentConfig.runtimeMemory
|
|
267
|
-
: undefined;
|
|
236
|
+
const inlineRuntimeMemory = getAgentExecutionObject(agent, "runtimeMemory");
|
|
268
237
|
if (inlineRuntimeMemory) {
|
|
269
238
|
if (isRefConfig(inlineRuntimeMemory)) {
|
|
270
239
|
return {
|
|
@@ -276,34 +245,6 @@ function resolveRuntimeMemoryConfig(agent, refs) {
|
|
|
276
245
|
const runtimeMemoryDefaults = getRuntimeMemoryDefaults(refs);
|
|
277
246
|
return runtimeMemoryDefaults ? { config: runtimeMemoryDefaults } : undefined;
|
|
278
247
|
}
|
|
279
|
-
function resolveLangGraphWorkflowConfig(agent, refs) {
|
|
280
|
-
const workflowConfig = typeof agent.langchainAgentConfig?.workflow === "object" && agent.langchainAgentConfig.workflow
|
|
281
|
-
? agent.langchainAgentConfig.workflow
|
|
282
|
-
: typeof agent.langchainAgentConfig?.langgraph === "object" && agent.langchainAgentConfig.langgraph
|
|
283
|
-
? agent.langchainAgentConfig.langgraph
|
|
284
|
-
: typeof agent.langchainAgentConfig?.passthrough === "object" &&
|
|
285
|
-
agent.langchainAgentConfig.passthrough &&
|
|
286
|
-
typeof agent.langchainAgentConfig.passthrough.workflow === "object" &&
|
|
287
|
-
agent.langchainAgentConfig.passthrough.workflow
|
|
288
|
-
? agent.langchainAgentConfig.passthrough.workflow
|
|
289
|
-
: typeof agent.langchainAgentConfig?.passthrough === "object" &&
|
|
290
|
-
agent.langchainAgentConfig.passthrough &&
|
|
291
|
-
typeof agent.langchainAgentConfig.passthrough.langgraph === "object" &&
|
|
292
|
-
agent.langchainAgentConfig.passthrough.langgraph
|
|
293
|
-
? agent.langchainAgentConfig.passthrough.langgraph
|
|
294
|
-
: undefined;
|
|
295
|
-
if (!workflowConfig) {
|
|
296
|
-
return undefined;
|
|
297
|
-
}
|
|
298
|
-
if (isRefConfig(workflowConfig)) {
|
|
299
|
-
return {
|
|
300
|
-
config: materializeWorkspaceObjectConfig(refs, workflowConfig.ref, [], `Agent ${agent.id} workflow`),
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
return {
|
|
304
|
-
config: workflowConfig,
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
248
|
function resolveRuntimeModelRefs(agent, refs) {
|
|
308
249
|
const merged = {
|
|
309
250
|
...(getRuntimeModelDefaults(refs) ?? {}),
|
|
@@ -365,28 +306,25 @@ export function compileBinding(workspaceRoot, agent, agents, referencedSubagentI
|
|
|
365
306
|
},
|
|
366
307
|
};
|
|
367
308
|
if (agent.executionMode !== "deepagent") {
|
|
309
|
+
const langchainVersion = getAgentExecutionConfigValue(agent, "version", { executionMode: "langchain-v1" });
|
|
368
310
|
const langchainAgentParams = {
|
|
369
311
|
model: execution.model,
|
|
370
312
|
tools: execution.tools,
|
|
371
313
|
systemPrompt: execution.systemPrompt,
|
|
372
|
-
stateSchema: agent
|
|
314
|
+
stateSchema: getAgentExecutionConfigValue(agent, "stateSchema", { executionMode: "langchain-v1" }),
|
|
373
315
|
responseFormat: execution.responseFormat,
|
|
374
316
|
contextSchema: execution.contextSchema,
|
|
375
|
-
filesystem:
|
|
376
|
-
? { ...agent.langchainAgentConfig.filesystem }
|
|
377
|
-
: undefined,
|
|
317
|
+
filesystem: getAgentExecutionObject(agent, "filesystem", { executionMode: "langchain-v1" }),
|
|
378
318
|
middleware: execution.middleware,
|
|
379
319
|
passthrough: execution.passthrough,
|
|
380
320
|
subagents: compileSubagents(agent, agents, workspaceRoot, models, tools, compiledAgentSkills, compiledAgentModel, compiledAgentMemory),
|
|
381
321
|
memory: compiledAgentMemory,
|
|
382
322
|
skills: compiledAgentSkills,
|
|
383
|
-
generalPurposeAgent:
|
|
384
|
-
taskDescription:
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
version: agent.langchainAgentConfig?.version === "v1" || agent.langchainAgentConfig?.version === "v2"
|
|
389
|
-
? agent.langchainAgentConfig.version
|
|
323
|
+
generalPurposeAgent: getAgentExecutionConfigValue(agent, "generalPurposeAgent", { executionMode: "langchain-v1" }),
|
|
324
|
+
taskDescription: getAgentExecutionString(agent, "taskDescription", { executionMode: "langchain-v1" }),
|
|
325
|
+
includeAgentName: getAgentExecutionConfigValue(agent, "includeAgentName", { executionMode: "langchain-v1" }) === "inline" ? "inline" : undefined,
|
|
326
|
+
version: langchainVersion === "v1" || langchainVersion === "v2"
|
|
327
|
+
? langchainVersion
|
|
390
328
|
: undefined,
|
|
391
329
|
name: resolveAgentRuntimeName(agent),
|
|
392
330
|
description: agent.description,
|
|
@@ -418,10 +356,8 @@ export function compileBinding(workspaceRoot, agent, agents, referencedSubagentI
|
|
|
418
356
|
name: resolveAgentRuntimeName(agent),
|
|
419
357
|
memory: compiledAgentMemory,
|
|
420
358
|
skills: compiledAgentSkills,
|
|
421
|
-
generalPurposeAgent:
|
|
422
|
-
taskDescription:
|
|
423
|
-
? agent.deepAgentConfig.taskDescription
|
|
424
|
-
: undefined,
|
|
359
|
+
generalPurposeAgent: getAgentExecutionConfigValue(agent, "generalPurposeAgent", { executionMode: "deepagent" }),
|
|
360
|
+
taskDescription: getAgentExecutionString(agent, "taskDescription", { executionMode: "deepagent" }),
|
|
425
361
|
};
|
|
426
362
|
return {
|
|
427
363
|
...base,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getAgentExecutionString } from "./agent-execution-config.js";
|
|
1
2
|
function normalizeCapabilities(capabilities) {
|
|
2
3
|
return {
|
|
3
4
|
delegation: capabilities?.delegation === true,
|
|
@@ -29,12 +30,7 @@ export function isMemoryCapableBinding(binding) {
|
|
|
29
30
|
return inferBindingCapabilities(binding).memory === true;
|
|
30
31
|
}
|
|
31
32
|
export function getAgentSystemPrompt(agent) {
|
|
32
|
-
|
|
33
|
-
if (deepagentPrompt) {
|
|
34
|
-
return deepagentPrompt;
|
|
35
|
-
}
|
|
36
|
-
const langchainPrompt = typeof agent.langchainAgentConfig?.systemPrompt === "string" ? agent.langchainAgentConfig.systemPrompt.trim() : "";
|
|
37
|
-
return langchainPrompt || undefined;
|
|
33
|
+
return getAgentExecutionString(agent, "systemPrompt");
|
|
38
34
|
}
|
|
39
35
|
export function hasAgentSystemPrompt(agent) {
|
|
40
36
|
return typeof getAgentSystemPrompt(agent) === "string";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExecutionMode } from "../../contracts/core.js";
|
|
2
|
+
import type { ParsedAgentObject } from "../../contracts/types.js";
|
|
3
|
+
type AgentExecutionConfig = Record<string, unknown>;
|
|
4
|
+
export declare function getAgentExecutionConfigs(agent: ParsedAgentObject, executionMode?: ExecutionMode): AgentExecutionConfig[];
|
|
5
|
+
export declare function getAgentExecutionConfigValue<T = unknown>(agent: ParsedAgentObject, key: string, options?: {
|
|
6
|
+
aliases?: string[];
|
|
7
|
+
executionMode?: ExecutionMode;
|
|
8
|
+
}): T | undefined;
|
|
9
|
+
export declare function getAgentExecutionObject(agent: ParsedAgentObject, key: string, options?: {
|
|
10
|
+
aliases?: string[];
|
|
11
|
+
executionMode?: ExecutionMode;
|
|
12
|
+
}): AgentExecutionConfig | undefined;
|
|
13
|
+
export declare function getAgentExecutionString(agent: ParsedAgentObject, key: string, options?: {
|
|
14
|
+
aliases?: string[];
|
|
15
|
+
executionMode?: ExecutionMode;
|
|
16
|
+
trim?: boolean;
|
|
17
|
+
}): string | undefined;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function asRecord(value) {
|
|
2
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
3
|
+
? value
|
|
4
|
+
: undefined;
|
|
5
|
+
}
|
|
6
|
+
function getConfigsForMode(agent, executionMode = agent.executionMode) {
|
|
7
|
+
const primary = executionMode === "deepagent" ? asRecord(agent.deepAgentConfig) : asRecord(agent.langchainAgentConfig);
|
|
8
|
+
const fallback = executionMode === "deepagent" ? asRecord(agent.langchainAgentConfig) : asRecord(agent.deepAgentConfig);
|
|
9
|
+
return [primary, fallback].filter((config) => config !== undefined);
|
|
10
|
+
}
|
|
11
|
+
export function getAgentExecutionConfigs(agent, executionMode = agent.executionMode) {
|
|
12
|
+
return getConfigsForMode(agent, executionMode);
|
|
13
|
+
}
|
|
14
|
+
export function getAgentExecutionConfigValue(agent, key, options = {}) {
|
|
15
|
+
const keys = [key, ...(options.aliases ?? [])];
|
|
16
|
+
for (const config of getConfigsForMode(agent, options.executionMode)) {
|
|
17
|
+
for (const candidate of keys) {
|
|
18
|
+
const value = config[candidate];
|
|
19
|
+
if (value !== undefined) {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
export function getAgentExecutionObject(agent, key, options = {}) {
|
|
27
|
+
return asRecord(getAgentExecutionConfigValue(agent, key, options));
|
|
28
|
+
}
|
|
29
|
+
export function getAgentExecutionString(agent, key, options = {}) {
|
|
30
|
+
const value = getAgentExecutionConfigValue(agent, key, options);
|
|
31
|
+
if (typeof value !== "string") {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
return options.trim === false ? value : value.trim() || undefined;
|
|
35
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { hasAgentSystemPrompt, isDelegationCapableAgent, isMemoryCapableAgent, } from "./support/agent-capabilities.js";
|
|
2
|
+
import { getAgentExecutionConfigValue, getAgentExecutionConfigs } from "./support/agent-execution-config.js";
|
|
2
3
|
const allowedExecutionModes = new Set(["deepagent", "langchain-v1"]);
|
|
3
4
|
function validateCheckpointerConfig(agent) {
|
|
4
|
-
const checkpointer = (
|
|
5
|
-
(typeof agent.deepAgentConfig?.checkpointer === "boolean" ? agent.deepAgentConfig.checkpointer : undefined) ||
|
|
6
|
-
(typeof agent.langchainAgentConfig?.checkpointer === "boolean" ? agent.langchainAgentConfig.checkpointer : undefined) ||
|
|
7
|
-
(typeof agent.langchainAgentConfig?.checkpointer === "object" && agent.langchainAgentConfig.checkpointer);
|
|
5
|
+
const checkpointer = getAgentExecutionConfigValue(agent, "checkpointer");
|
|
8
6
|
if (typeof checkpointer === "boolean") {
|
|
9
7
|
return;
|
|
10
8
|
}
|
|
@@ -19,10 +17,10 @@ function validateCheckpointerConfig(agent) {
|
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
function validateMiddlewareConfig(agent) {
|
|
22
|
-
const middlewareConfigs =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const middlewareConfigs = getAgentExecutionConfigs(agent).flatMap((config) => {
|
|
21
|
+
const middleware = config.middleware;
|
|
22
|
+
return Array.isArray(middleware) ? middleware : [];
|
|
23
|
+
});
|
|
26
24
|
for (const config of middlewareConfigs) {
|
|
27
25
|
if (typeof config !== "object" || config === null || Array.isArray(config)) {
|
|
28
26
|
throw new Error(`Agent ${agent.id} middleware entries must be objects`);
|
|
@@ -59,9 +57,6 @@ export function validateAgent(agent) {
|
|
|
59
57
|
if (!agent.description.trim()) {
|
|
60
58
|
throw new Error(`Agent ${agent.id} description must not be empty`);
|
|
61
59
|
}
|
|
62
|
-
if (!isDelegationCapableAgent(agent) && (agent.subagentRefs.length > 0 || agent.subagentPathRefs.length > 0)) {
|
|
63
|
-
throw new Error(`Agent ${agent.id} cannot define subagents unless it uses a delegation-capable backend`);
|
|
64
|
-
}
|
|
65
60
|
if (!isMemoryCapableAgent(agent) && agent.memorySources.length > 0) {
|
|
66
61
|
throw new Error(`Agent ${agent.id} cannot define memory unless it uses a memory-capable backend`);
|
|
67
62
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { DeepAgentParams } from "../../contracts/types.js";
|
|
2
|
-
export declare function buildDeepAgentRunnableConfig(params: {
|
|
3
|
-
compatibleParams: DeepAgentParams;
|
|
4
|
-
resolvedModel: unknown;
|
|
5
|
-
resolvedTools: unknown[];
|
|
6
|
-
resolvedMiddleware: unknown[];
|
|
7
|
-
resolvedSubagents: unknown[];
|
|
8
|
-
resolvedCheckpointer: unknown;
|
|
9
|
-
resolvedStore: unknown;
|
|
10
|
-
resolvedBackend: unknown;
|
|
11
|
-
resolvedInterruptOn: unknown;
|
|
12
|
-
resolvedSkills: string[];
|
|
13
|
-
}): Record<string, unknown>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { buildResolvedRunnableConfig } from "./runnable-config.js";
|
|
2
|
-
export function buildDeepAgentRunnableConfig(params) {
|
|
3
|
-
const { compatibleParams, resolvedModel, resolvedTools, resolvedMiddleware, resolvedSubagents, resolvedCheckpointer, resolvedStore, resolvedBackend, resolvedInterruptOn, resolvedSkills, } = params;
|
|
4
|
-
return buildResolvedRunnableConfig({
|
|
5
|
-
passthrough: compatibleParams.passthrough ?? {},
|
|
6
|
-
staticConfig: {
|
|
7
|
-
systemPrompt: compatibleParams.systemPrompt,
|
|
8
|
-
responseFormat: compatibleParams.responseFormat,
|
|
9
|
-
contextSchema: compatibleParams.contextSchema,
|
|
10
|
-
name: compatibleParams.name,
|
|
11
|
-
memory: compatibleParams.memory,
|
|
12
|
-
skills: resolvedSkills,
|
|
13
|
-
generalPurposeAgent: compatibleParams.generalPurposeAgent,
|
|
14
|
-
taskDescription: compatibleParams.taskDescription,
|
|
15
|
-
},
|
|
16
|
-
resolved: {
|
|
17
|
-
resolvedModel: resolvedModel,
|
|
18
|
-
resolvedTools: resolvedTools,
|
|
19
|
-
resolvedMiddleware: resolvedMiddleware,
|
|
20
|
-
resolvedCheckpointer: resolvedCheckpointer,
|
|
21
|
-
resolvedStore: resolvedStore,
|
|
22
|
-
},
|
|
23
|
-
extraConfig: {
|
|
24
|
-
subagents: resolvedSubagents,
|
|
25
|
-
backend: resolvedBackend,
|
|
26
|
-
interruptOn: resolvedInterruptOn,
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { LangChainAgentParams } from "../../contracts/types.js";
|
|
2
|
-
export declare function buildLangChainRunnableConfig(params: {
|
|
3
|
-
langchainParams: LangChainAgentParams;
|
|
4
|
-
resolvedModel: unknown;
|
|
5
|
-
resolvedTools: unknown[];
|
|
6
|
-
resolvedMiddleware: unknown[];
|
|
7
|
-
resolvedCheckpointer: unknown;
|
|
8
|
-
resolvedStore: unknown;
|
|
9
|
-
passthroughOverride?: Record<string, unknown>;
|
|
10
|
-
systemPromptOverride?: string;
|
|
11
|
-
}): Record<string, unknown>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { buildResolvedRunnableConfig } from "./runnable-config.js";
|
|
2
|
-
export function buildLangChainRunnableConfig(params) {
|
|
3
|
-
const { langchainParams, resolvedModel, resolvedTools, resolvedMiddleware, resolvedCheckpointer, resolvedStore, passthroughOverride, systemPromptOverride, } = params;
|
|
4
|
-
return buildResolvedRunnableConfig({
|
|
5
|
-
passthrough: (passthroughOverride ?? langchainParams.passthrough ?? {}),
|
|
6
|
-
staticConfig: {
|
|
7
|
-
systemPrompt: systemPromptOverride ?? langchainParams.systemPrompt,
|
|
8
|
-
stateSchema: langchainParams.stateSchema,
|
|
9
|
-
responseFormat: langchainParams.responseFormat,
|
|
10
|
-
contextSchema: langchainParams.contextSchema,
|
|
11
|
-
includeAgentName: langchainParams.includeAgentName,
|
|
12
|
-
version: langchainParams.version,
|
|
13
|
-
name: langchainParams.name,
|
|
14
|
-
description: langchainParams.description,
|
|
15
|
-
},
|
|
16
|
-
resolved: {
|
|
17
|
-
resolvedModel: resolvedModel,
|
|
18
|
-
resolvedTools: resolvedTools,
|
|
19
|
-
resolvedMiddleware: resolvedMiddleware,
|
|
20
|
-
resolvedCheckpointer: resolvedCheckpointer,
|
|
21
|
-
resolvedStore: resolvedStore,
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
}
|