@botbotgo/agent-harness 0.0.91 → 0.0.93
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/README.md +138 -31
- package/README.zh.md +93 -28
- package/dist/benchmark/upstream-runtime-ab-benchmark.d.ts +1 -1
- package/dist/benchmark/upstream-runtime-ab-benchmark.js +2 -1
- package/dist/config/workflows/langgraph-workflows.yaml +292 -0
- package/dist/contracts/types.d.ts +8 -3
- package/dist/init-project.js +7 -7
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/agent-runtime-adapter.d.ts +48 -1
- package/dist/runtime/agent-runtime-adapter.js +1001 -50
- package/dist/runtime/harness.d.ts +2 -0
- package/dist/runtime/harness.js +55 -11
- package/dist/runtime/inventory.d.ts +1 -1
- package/dist/runtime/inventory.js +1 -1
- package/dist/runtime/langgraph-presets.d.ts +23 -0
- package/dist/runtime/langgraph-presets.js +165 -0
- package/dist/runtime/policy-engine.js +0 -5
- package/dist/runtime/support/compiled-binding.d.ts +4 -1
- package/dist/runtime/support/compiled-binding.js +24 -2
- package/dist/runtime/support/harness-support.js +3 -3
- package/dist/runtime/support/runtime-entry.js +1 -1
- package/dist/workspace/agent-binding-compiler.js +82 -8
- package/dist/workspace/compile.js +1 -3
- package/dist/workspace/object-loader.js +47 -6
- package/dist/workspace/support/agent-capabilities.js +2 -2
- package/dist/workspace/support/workspace-ref-utils.d.ts +2 -1
- package/dist/workspace/support/workspace-ref-utils.js +21 -0
- package/dist/workspace/validate.js +1 -1
- package/package.json +2 -2
- /package/dist/config/{backends.yaml → catalogs/backends.yaml} +0 -0
- /package/dist/config/{embedding-models.yaml → catalogs/embedding-models.yaml} +0 -0
- /package/dist/config/{mcp.yaml → catalogs/mcp.yaml} +0 -0
- /package/dist/config/{models.yaml → catalogs/models.yaml} +0 -0
- /package/dist/config/{stores.yaml → catalogs/stores.yaml} +0 -0
- /package/dist/config/{tools.yaml → catalogs/tools.yaml} +0 -0
- /package/dist/config/{vector-stores.yaml → catalogs/vector-stores.yaml} +0 -0
- /package/dist/config/{runtime-memory.yaml → runtime/runtime-memory.yaml} +0 -0
- /package/dist/config/{workspace.yaml → runtime/workspace.yaml} +0 -0
|
@@ -150,6 +150,8 @@ function normalizeKind(kind) {
|
|
|
150
150
|
return "runtime";
|
|
151
151
|
case "RuntimeMemory":
|
|
152
152
|
return "runtime-memory";
|
|
153
|
+
case "LangGraphWorkflow":
|
|
154
|
+
return "langgraph-workflow";
|
|
153
155
|
case "Prompt":
|
|
154
156
|
return "prompt";
|
|
155
157
|
case "McpServer":
|
|
@@ -245,6 +247,29 @@ function readExecutionAgentConfig(item) {
|
|
|
245
247
|
function readRuntimeConfig(item) {
|
|
246
248
|
return asMutableObject(item.runtime);
|
|
247
249
|
}
|
|
250
|
+
function readRuntimeModelRefs(runtime) {
|
|
251
|
+
if (!runtime) {
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
const modelRefs = {
|
|
255
|
+
...(typeof runtime.routingModelRef === "string" && runtime.routingModelRef.trim()
|
|
256
|
+
? { routing: runtime.routingModelRef.trim() }
|
|
257
|
+
: {}),
|
|
258
|
+
...(typeof runtime.planningModelRef === "string" && runtime.planningModelRef.trim()
|
|
259
|
+
? { planning: runtime.planningModelRef.trim() }
|
|
260
|
+
: {}),
|
|
261
|
+
...(typeof runtime.executionModelRef === "string" && runtime.executionModelRef.trim()
|
|
262
|
+
? { execution: runtime.executionModelRef.trim() }
|
|
263
|
+
: {}),
|
|
264
|
+
...(typeof runtime.reviewModelRef === "string" && runtime.reviewModelRef.trim()
|
|
265
|
+
? { review: runtime.reviewModelRef.trim() }
|
|
266
|
+
: {}),
|
|
267
|
+
...(typeof runtime.finalModelRef === "string" && runtime.finalModelRef.trim()
|
|
268
|
+
? { final: runtime.finalModelRef.trim() }
|
|
269
|
+
: {}),
|
|
270
|
+
};
|
|
271
|
+
return Object.keys(modelRefs).length > 0 ? modelRefs : undefined;
|
|
272
|
+
}
|
|
248
273
|
function cloneConfigValue(value) {
|
|
249
274
|
if (Array.isArray(value)) {
|
|
250
275
|
return value.map((item) => cloneConfigValue(item));
|
|
@@ -301,6 +326,9 @@ function resolveExecutionBackend(item, current) {
|
|
|
301
326
|
if (backend === "langchain-v1") {
|
|
302
327
|
return "langchain-v1";
|
|
303
328
|
}
|
|
329
|
+
if (backend === "langgraph") {
|
|
330
|
+
return "langgraph";
|
|
331
|
+
}
|
|
304
332
|
if (backend === "deepagent") {
|
|
305
333
|
return "deepagent";
|
|
306
334
|
}
|
|
@@ -408,6 +436,7 @@ export function parseAgentItem(item, sourcePath) {
|
|
|
408
436
|
return {
|
|
409
437
|
id: String(item.id),
|
|
410
438
|
executionMode: executionMode,
|
|
439
|
+
runtimeModelRefs: readRuntimeModelRefs(runtime),
|
|
411
440
|
capabilities: readCapabilities(item.capabilities) ?? (executionMode === "deepagent"
|
|
412
441
|
? { delegation: true, memory: true }
|
|
413
442
|
: { delegation: true, memory: true }),
|
|
@@ -441,8 +470,10 @@ async function objectItemsFromDocument(document, sourcePath) {
|
|
|
441
470
|
: catalogKind === "Tools"
|
|
442
471
|
? normalizeCatalogSpec(document, { defaultKind: "Tool" })
|
|
443
472
|
: catalogKind === "McpServers"
|
|
444
|
-
? normalizeCatalogSpec(document)
|
|
445
|
-
:
|
|
473
|
+
? normalizeCatalogSpec(document, { defaultKind: "McpServer" })
|
|
474
|
+
: catalogKind === "LangGraphWorkflows"
|
|
475
|
+
? normalizeCatalogSpec(document, { defaultKind: "LangGraphWorkflow" })
|
|
476
|
+
: [];
|
|
446
477
|
if (catalogItems.length > 0) {
|
|
447
478
|
return catalogItems;
|
|
448
479
|
}
|
|
@@ -678,12 +709,22 @@ async function readNamedYamlItems(root, filenames) {
|
|
|
678
709
|
return records;
|
|
679
710
|
}
|
|
680
711
|
async function readNamedModelItems(root) {
|
|
681
|
-
const
|
|
712
|
+
const filePaths = new Set();
|
|
682
713
|
for (const filename of MODEL_FILENAMES) {
|
|
683
|
-
const
|
|
684
|
-
if (
|
|
685
|
-
|
|
714
|
+
const directPath = path.join(root, filename);
|
|
715
|
+
if (await fileExists(directPath)) {
|
|
716
|
+
filePaths.add(directPath);
|
|
686
717
|
}
|
|
718
|
+
}
|
|
719
|
+
for (const extension of [".yaml", ".yml"]) {
|
|
720
|
+
for (const filePath of await listFilesRecursive(root, extension)) {
|
|
721
|
+
if (MODEL_FILENAMES.includes(path.basename(filePath))) {
|
|
722
|
+
filePaths.add(filePath);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
const records = [];
|
|
727
|
+
for (const filePath of [...filePaths].sort()) {
|
|
687
728
|
const parsedDocuments = parseAllDocuments(await readYamlOrJson(filePath));
|
|
688
729
|
for (const parsedDocument of parsedDocuments) {
|
|
689
730
|
for (const item of await objectItemsFromDocument(parsedDocument.toJSON(), filePath)) {
|
|
@@ -9,8 +9,8 @@ export function inferAgentCapabilities(agent) {
|
|
|
9
9
|
return normalizeCapabilities(agent.capabilities);
|
|
10
10
|
}
|
|
11
11
|
return {
|
|
12
|
-
delegation: agent.executionMode === "deepagent" || agent.executionMode === "langchain-v1",
|
|
13
|
-
memory: agent.executionMode === "deepagent" || agent.executionMode === "langchain-v1",
|
|
12
|
+
delegation: agent.executionMode === "deepagent" || agent.executionMode === "langchain-v1" || agent.executionMode === "langgraph",
|
|
13
|
+
memory: agent.executionMode === "deepagent" || agent.executionMode === "langchain-v1" || agent.executionMode === "langgraph",
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
export function inferBindingCapabilities(binding) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ParsedAgentObject, WorkspaceObject } from "../../contracts/types.js";
|
|
1
|
+
import type { ParsedAgentObject, RuntimeModelRefMap, WorkspaceObject } from "../../contracts/types.js";
|
|
2
2
|
export type RoutingRule = {
|
|
3
3
|
agentId: string;
|
|
4
4
|
equals?: string[];
|
|
@@ -34,6 +34,7 @@ export type ResilienceConfig = {
|
|
|
34
34
|
export declare function getWorkspaceObject(refs: Map<string, WorkspaceObject | ParsedAgentObject>, ref: string | undefined): WorkspaceObject | undefined;
|
|
35
35
|
export declare function getRuntimeDefaults(refs: Map<string, WorkspaceObject | ParsedAgentObject>): Record<string, unknown> | undefined;
|
|
36
36
|
export declare function getRuntimeMemoryDefaults(refs: Map<string, WorkspaceObject | ParsedAgentObject>): Record<string, unknown> | undefined;
|
|
37
|
+
export declare function getRuntimeModelDefaults(refs: Map<string, WorkspaceObject | ParsedAgentObject>): RuntimeModelRefMap | undefined;
|
|
37
38
|
export declare function getRecoveryConfig(refs: Map<string, WorkspaceObject | ParsedAgentObject>): RecoveryConfig;
|
|
38
39
|
export declare function getConcurrencyConfig(refs: Map<string, WorkspaceObject | ParsedAgentObject>): ConcurrencyConfig;
|
|
39
40
|
export declare function getResilienceConfig(refs: Map<string, WorkspaceObject | ParsedAgentObject>): ResilienceConfig;
|
|
@@ -36,6 +36,27 @@ export function getRuntimeMemoryDefaults(refs) {
|
|
|
36
36
|
}
|
|
37
37
|
return runtimeMemories[0].value;
|
|
38
38
|
}
|
|
39
|
+
export function getRuntimeModelDefaults(refs) {
|
|
40
|
+
const runtimeDefaults = getRuntimeDefaults(refs);
|
|
41
|
+
const modelRefs = {
|
|
42
|
+
...(typeof runtimeDefaults?.routingModelRef === "string" && runtimeDefaults.routingModelRef.trim()
|
|
43
|
+
? { routing: runtimeDefaults.routingModelRef.trim() }
|
|
44
|
+
: {}),
|
|
45
|
+
...(typeof runtimeDefaults?.planningModelRef === "string" && runtimeDefaults.planningModelRef.trim()
|
|
46
|
+
? { planning: runtimeDefaults.planningModelRef.trim() }
|
|
47
|
+
: {}),
|
|
48
|
+
...(typeof runtimeDefaults?.executionModelRef === "string" && runtimeDefaults.executionModelRef.trim()
|
|
49
|
+
? { execution: runtimeDefaults.executionModelRef.trim() }
|
|
50
|
+
: {}),
|
|
51
|
+
...(typeof runtimeDefaults?.reviewModelRef === "string" && runtimeDefaults.reviewModelRef.trim()
|
|
52
|
+
? { review: runtimeDefaults.reviewModelRef.trim() }
|
|
53
|
+
: {}),
|
|
54
|
+
...(typeof runtimeDefaults?.finalModelRef === "string" && runtimeDefaults.finalModelRef.trim()
|
|
55
|
+
? { final: runtimeDefaults.finalModelRef.trim() }
|
|
56
|
+
: {}),
|
|
57
|
+
};
|
|
58
|
+
return Object.keys(modelRefs).length > 0 ? modelRefs : undefined;
|
|
59
|
+
}
|
|
39
60
|
export function getRecoveryConfig(refs) {
|
|
40
61
|
const runtimeDefaults = getRuntimeDefaults(refs);
|
|
41
62
|
const recovery = typeof runtimeDefaults?.recovery === "object" && runtimeDefaults.recovery
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hasAgentSystemPrompt, isDelegationCapableAgent, isMemoryCapableAgent, } from "./support/agent-capabilities.js";
|
|
2
|
-
const allowedExecutionModes = new Set(["deepagent", "langchain-v1"]);
|
|
2
|
+
const allowedExecutionModes = new Set(["deepagent", "langchain-v1", "langgraph"]);
|
|
3
3
|
function validateCheckpointerConfig(agent) {
|
|
4
4
|
const checkpointer = (typeof agent.deepAgentConfig?.checkpointer === "object" && agent.deepAgentConfig.checkpointer) ||
|
|
5
5
|
(typeof agent.deepAgentConfig?.checkpointer === "boolean" ? agent.deepAgentConfig.checkpointer : undefined) ||
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botbotgo/agent-harness",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
4
4
|
"description": "Workspace runtime for multi-agent applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "npm@10.9.2",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@langchain/community": "^1.1.24",
|
|
37
37
|
"@langchain/core": "^1.1.33",
|
|
38
38
|
"@langchain/google": "^0.1.7",
|
|
39
|
-
"@langchain/langgraph": "^1.2.
|
|
39
|
+
"@langchain/langgraph": "^1.2.6",
|
|
40
40
|
"@langchain/langgraph-checkpoint-sqlite": "^1.0.1",
|
|
41
41
|
"@langchain/ollama": "^1.2.6",
|
|
42
42
|
"@langchain/openai": "^1.1.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|