@botbotgo/agent-harness 0.0.41 → 0.0.42
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 +86 -86
- package/dist/contracts/types.d.ts +8 -1
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/agent-runtime-adapter.d.ts +0 -1
- package/dist/runtime/agent-runtime-adapter.js +9 -41
- package/dist/runtime/checkpoint-maintenance.js +1 -1
- package/dist/runtime/declared-middleware.d.ts +8 -1
- package/dist/runtime/declared-middleware.js +18 -1
- package/dist/runtime/harness.d.ts +4 -0
- package/dist/runtime/harness.js +303 -255
- package/dist/runtime/support/runtime-factories.d.ts +1 -1
- package/dist/runtime/support/runtime-factories.js +3 -0
- package/dist/workspace/agent-binding-compiler.js +11 -8
- package/dist/workspace/object-loader.js +7 -2
- package/dist/workspace/support/workspace-ref-utils.d.ts +4 -0
- package/dist/workspace/support/workspace-ref-utils.js +15 -1
- package/dist/workspace/validate.js +5 -0
- package/package.json +2 -2
|
@@ -133,21 +133,24 @@ function resolveBackendConfig(agent) {
|
|
|
133
133
|
return backendConfig ? { config: backendConfig } : undefined;
|
|
134
134
|
}
|
|
135
135
|
function resolveStoreConfig(agent) {
|
|
136
|
-
if (agent.executionMode !== "deepagent") {
|
|
137
|
-
return undefined;
|
|
138
|
-
}
|
|
139
136
|
const inlineStore = typeof agent.deepAgentConfig?.store === "object" && agent.deepAgentConfig.store
|
|
140
137
|
? agent.deepAgentConfig.store
|
|
141
|
-
:
|
|
138
|
+
: typeof agent.langchainAgentConfig?.store === "object" && agent.langchainAgentConfig.store
|
|
139
|
+
? agent.langchainAgentConfig.store
|
|
140
|
+
: undefined;
|
|
142
141
|
return inlineStore ? { config: inlineStore } : undefined;
|
|
143
142
|
}
|
|
144
143
|
function resolveCheckpointerConfig(agent) {
|
|
145
144
|
const inlineAgentCheckpointer = typeof agent.deepAgentConfig?.checkpointer === "object" && agent.deepAgentConfig.checkpointer
|
|
146
145
|
? agent.deepAgentConfig.checkpointer
|
|
147
|
-
: typeof agent.
|
|
148
|
-
? agent.
|
|
149
|
-
:
|
|
150
|
-
|
|
146
|
+
: typeof agent.deepAgentConfig?.checkpointer === "boolean"
|
|
147
|
+
? agent.deepAgentConfig.checkpointer
|
|
148
|
+
: typeof agent.langchainAgentConfig?.checkpointer === "object" && agent.langchainAgentConfig.checkpointer
|
|
149
|
+
? agent.langchainAgentConfig.checkpointer
|
|
150
|
+
: typeof agent.langchainAgentConfig?.checkpointer === "boolean"
|
|
151
|
+
? agent.langchainAgentConfig.checkpointer
|
|
152
|
+
: undefined;
|
|
153
|
+
return inlineAgentCheckpointer !== undefined ? { config: inlineAgentCheckpointer } : undefined;
|
|
151
154
|
}
|
|
152
155
|
export function compileBinding(workspaceRoot, agent, agents, referencedSubagentIds, refs, models, tools) {
|
|
153
156
|
const internalSubagent = referencedSubagentIds.has(agent.id);
|
|
@@ -213,7 +213,9 @@ function readSharedAgentConfig(item) {
|
|
|
213
213
|
const middleware = readMiddlewareArray(item.middleware);
|
|
214
214
|
return {
|
|
215
215
|
...(typeof item.systemPrompt === "string" ? { systemPrompt: item.systemPrompt } : {}),
|
|
216
|
-
...(typeof item.checkpointer === "object" && item.checkpointer
|
|
216
|
+
...((typeof item.checkpointer === "object" && item.checkpointer) || typeof item.checkpointer === "boolean"
|
|
217
|
+
? { checkpointer: item.checkpointer }
|
|
218
|
+
: {}),
|
|
217
219
|
...(typeof item.interruptOn === "object" && item.interruptOn ? { interruptOn: item.interruptOn } : {}),
|
|
218
220
|
...(item.stateSchema !== undefined ? { stateSchema: item.stateSchema } : {}),
|
|
219
221
|
...(item.responseFormat !== undefined ? { responseFormat: item.responseFormat } : {}),
|
|
@@ -224,7 +226,10 @@ function readSharedAgentConfig(item) {
|
|
|
224
226
|
};
|
|
225
227
|
}
|
|
226
228
|
function readLangchainAgentConfig(item) {
|
|
227
|
-
return
|
|
229
|
+
return {
|
|
230
|
+
...readSharedAgentConfig(item),
|
|
231
|
+
...(typeof item.store === "object" && item.store ? { store: item.store } : {}),
|
|
232
|
+
};
|
|
228
233
|
}
|
|
229
234
|
function readDeepAgentConfig(item) {
|
|
230
235
|
return {
|
|
@@ -21,10 +21,14 @@ export type RecoveryConfig = {
|
|
|
21
21
|
resumeResumingRunsOnStartup: boolean;
|
|
22
22
|
maxRecoveryAttempts: number;
|
|
23
23
|
};
|
|
24
|
+
export type ConcurrencyConfig = {
|
|
25
|
+
maxConcurrentRuns?: number;
|
|
26
|
+
};
|
|
24
27
|
export declare function getWorkspaceObject(refs: Map<string, WorkspaceObject | ParsedAgentObject>, ref: string | undefined): WorkspaceObject | undefined;
|
|
25
28
|
export declare function getRuntimeDefaults(refs: Map<string, WorkspaceObject | ParsedAgentObject>): Record<string, unknown> | undefined;
|
|
26
29
|
export declare function getRuntimeRecoveryConfig(refs: Map<string, WorkspaceObject | ParsedAgentObject>): RuntimeRecoveryConfig;
|
|
27
30
|
export declare function getRecoveryConfig(refs: Map<string, WorkspaceObject | ParsedAgentObject>): RecoveryConfig;
|
|
31
|
+
export declare function getConcurrencyConfig(refs: Map<string, WorkspaceObject | ParsedAgentObject>): ConcurrencyConfig;
|
|
28
32
|
export declare function getRoutingSystemPrompt(refs: Map<string, WorkspaceObject | ParsedAgentObject>): string | undefined;
|
|
29
33
|
export declare function getRoutingDefaultAgentId(refs: Map<string, WorkspaceObject | ParsedAgentObject>): string | undefined;
|
|
30
34
|
export declare function isModelRoutingEnabled(refs: Map<string, WorkspaceObject | ParsedAgentObject>): boolean;
|
|
@@ -47,10 +47,24 @@ export function getRecoveryConfig(refs) {
|
|
|
47
47
|
: 3;
|
|
48
48
|
return {
|
|
49
49
|
enabled: recovery.enabled !== false,
|
|
50
|
-
resumeResumingRunsOnStartup: recovery.resumeResumingRunsOnStartup
|
|
50
|
+
resumeResumingRunsOnStartup: typeof recovery.resumeResumingRunsOnStartup === "boolean"
|
|
51
|
+
? recovery.resumeResumingRunsOnStartup
|
|
52
|
+
: recovery.resumeOnStartup !== false,
|
|
51
53
|
maxRecoveryAttempts,
|
|
52
54
|
};
|
|
53
55
|
}
|
|
56
|
+
export function getConcurrencyConfig(refs) {
|
|
57
|
+
const runtimeDefaults = getRuntimeDefaults(refs);
|
|
58
|
+
const concurrency = typeof runtimeDefaults?.concurrency === "object" && runtimeDefaults.concurrency
|
|
59
|
+
? runtimeDefaults.concurrency
|
|
60
|
+
: {};
|
|
61
|
+
const maxConcurrentRuns = typeof concurrency.maxConcurrentRuns === "number" &&
|
|
62
|
+
Number.isFinite(concurrency.maxConcurrentRuns) &&
|
|
63
|
+
concurrency.maxConcurrentRuns > 0
|
|
64
|
+
? Math.floor(concurrency.maxConcurrentRuns)
|
|
65
|
+
: undefined;
|
|
66
|
+
return { maxConcurrentRuns };
|
|
67
|
+
}
|
|
54
68
|
export function getRoutingSystemPrompt(refs) {
|
|
55
69
|
const routing = getRoutingObject(refs);
|
|
56
70
|
return typeof routing?.systemPrompt === "string" && routing.systemPrompt.trim() ? routing.systemPrompt : undefined;
|
|
@@ -4,7 +4,12 @@ function hasPromptContent(value) {
|
|
|
4
4
|
}
|
|
5
5
|
function validateCheckpointerConfig(agent) {
|
|
6
6
|
const checkpointer = (typeof agent.deepAgentConfig?.checkpointer === "object" && agent.deepAgentConfig.checkpointer) ||
|
|
7
|
+
(typeof agent.deepAgentConfig?.checkpointer === "boolean" ? agent.deepAgentConfig.checkpointer : undefined) ||
|
|
8
|
+
(typeof agent.langchainAgentConfig?.checkpointer === "boolean" ? agent.langchainAgentConfig.checkpointer : undefined) ||
|
|
7
9
|
(typeof agent.langchainAgentConfig?.checkpointer === "object" && agent.langchainAgentConfig.checkpointer);
|
|
10
|
+
if (typeof checkpointer === "boolean") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
8
13
|
if (!checkpointer) {
|
|
9
14
|
return;
|
|
10
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botbotgo/agent-harness",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"description": "Workspace runtime for multi-agent applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "npm@10.9.2",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "rm -rf dist tsconfig.tsbuildinfo && tsc -p tsconfig.json && cp -R config dist/",
|
|
52
52
|
"check": "tsc -p tsconfig.json --noEmit",
|
|
53
|
-
"test": "vitest run test/public-api.test.ts test/resource-optional-provider.test.ts test/resource-isolation.test.ts test/stock-research-app-load-harness.test.ts test/stock-research-app-run.test.ts test/release-workflow.test.ts test/release-version.test.ts test/gitignore.test.ts test/package-lock.test.ts test/readme.test.ts test/runtime-adapter-regressions.test.ts test/runtime-recovery.test.ts test/tool-extension-gaps.test.ts test/checkpoint-maintenance.test.ts test/llamaindex-dependency-compat.test.ts test/skill-standard.test.ts test/routing-config.test.ts test/workspace-compat-regressions.test.ts",
|
|
53
|
+
"test": "vitest run test/public-api.test.ts test/resource-optional-provider.test.ts test/resource-isolation.test.ts test/stock-research-app-load-harness.test.ts test/stock-research-app-run.test.ts test/release-workflow.test.ts test/release-version.test.ts test/gitignore.test.ts test/package-lock.test.ts test/readme.test.ts test/runtime-adapter-regressions.test.ts test/runtime-recovery.test.ts test/tool-extension-gaps.test.ts test/checkpoint-maintenance.test.ts test/llamaindex-dependency-compat.test.ts test/skill-standard.test.ts test/routing-config.test.ts test/workspace-compat-regressions.test.ts test/upstream-compat-regressions.test.ts",
|
|
54
54
|
"test:real-providers": "vitest run test/real-provider-harness.test.ts",
|
|
55
55
|
"release:prepare": "npm version patch --no-git-tag-version && node ./scripts/sync-example-version.mjs",
|
|
56
56
|
"release:pack": "npm pack --dry-run",
|