@botbotgo/agent-harness 0.0.260 → 0.0.261
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/harness/run/startup-runtime.d.ts +1 -0
- package/dist/runtime/harness/run/startup-runtime.js +7 -1
- package/dist/runtime/harness.d.ts +1 -0
- package/dist/runtime/harness.js +5 -1
- package/dist/workspace/compile.js +20 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.260";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.260";
|
|
@@ -8,6 +8,7 @@ type Startable = {
|
|
|
8
8
|
export declare function initializeHarnessRuntime(input: {
|
|
9
9
|
persistence: RuntimePersistence;
|
|
10
10
|
healthMonitor: Startable | null;
|
|
11
|
+
scheduleBackgroundTask?: (task: Promise<void>) => void;
|
|
11
12
|
}): Promise<void>;
|
|
12
13
|
export declare function recoverStartupRuns(input: {
|
|
13
14
|
recoveryConfig: RecoveryConfig;
|
|
@@ -3,7 +3,13 @@ import { traceStartupStage } from "../../startup-tracing.js";
|
|
|
3
3
|
export async function initializeHarnessRuntime(input) {
|
|
4
4
|
await traceStartupStage("runtime.initialize.persistence", () => input.persistence.initialize());
|
|
5
5
|
if (input.healthMonitor) {
|
|
6
|
-
|
|
6
|
+
const healthMonitorStartTask = traceStartupStage("runtime.initialize.healthMonitor", () => input.healthMonitor.start());
|
|
7
|
+
if (input.scheduleBackgroundTask) {
|
|
8
|
+
input.scheduleBackgroundTask(healthMonitorStartTask);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
await healthMonitorStartTask;
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
14
|
}
|
|
9
15
|
export async function recoverStartupRuns(input) {
|
|
@@ -127,6 +127,7 @@ export declare class AgentHarnessRuntime {
|
|
|
127
127
|
}): Promise<string>;
|
|
128
128
|
private emit;
|
|
129
129
|
private trackBackgroundTask;
|
|
130
|
+
private scheduleBackgroundStartupTask;
|
|
130
131
|
private resolveToolMcpServerTools;
|
|
131
132
|
private loadPriorHistory;
|
|
132
133
|
private loadRunInput;
|
package/dist/runtime/harness.js
CHANGED
|
@@ -332,8 +332,9 @@ export class AgentHarnessRuntime {
|
|
|
332
332
|
await initializeHarnessRuntime({
|
|
333
333
|
persistence: this.persistence,
|
|
334
334
|
healthMonitor: this.healthMonitor,
|
|
335
|
+
scheduleBackgroundTask: (task) => this.scheduleBackgroundStartupTask(task),
|
|
335
336
|
});
|
|
336
|
-
|
|
337
|
+
this.scheduleBackgroundStartupTask(traceStartupStage("runtime.initialize.startupRecovery", () => this.recoverStartupRuns()));
|
|
337
338
|
this.initialized = true;
|
|
338
339
|
}
|
|
339
340
|
subscribe(listener) {
|
|
@@ -962,6 +963,9 @@ export class AgentHarnessRuntime {
|
|
|
962
963
|
this.backgroundTasks.delete(task);
|
|
963
964
|
});
|
|
964
965
|
}
|
|
966
|
+
scheduleBackgroundStartupTask(task) {
|
|
967
|
+
this.trackBackgroundTask(task.then(() => undefined).catch(() => undefined));
|
|
968
|
+
}
|
|
965
969
|
resolveToolMcpServerTools(agentId) {
|
|
966
970
|
return resolveWorkspaceAgentTools({
|
|
967
971
|
workspace: this.workspace,
|
|
@@ -267,8 +267,25 @@ export async function loadWorkspace(workspaceRoot, options = {}) {
|
|
|
267
267
|
...(localResourceRoot ? [localResourceRoot] : []),
|
|
268
268
|
...collectedResources,
|
|
269
269
|
]));
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
await traceStartupStage("workspace.validate.resources", async () => {
|
|
271
|
+
validateWorkspaceResources(embeddings, mcpServers, models, vectorStores, tools, loaded.agents);
|
|
272
|
+
}, {
|
|
273
|
+
workspaceRoot,
|
|
274
|
+
agentCount: loaded.agents.length,
|
|
275
|
+
toolCount: tools.size,
|
|
276
|
+
modelCount: models.size,
|
|
277
|
+
mcpServerCount: mcpServers.size,
|
|
278
|
+
});
|
|
279
|
+
await traceStartupStage("workspace.validate.routingTargets", async () => {
|
|
280
|
+
validateRoutingTargets(loaded.refs, loaded.agents);
|
|
281
|
+
}, {
|
|
282
|
+
workspaceRoot,
|
|
283
|
+
agentCount: loaded.agents.length,
|
|
284
|
+
});
|
|
285
|
+
const bindings = await traceStartupStage("workspace.compile.bindings", async () => compileBindings(workspaceRoot, loaded.refs, loaded.agents, models, tools), {
|
|
286
|
+
workspaceRoot,
|
|
287
|
+
agentCount: loaded.agents.length,
|
|
288
|
+
});
|
|
272
289
|
return {
|
|
273
290
|
workspaceRoot,
|
|
274
291
|
resources,
|
|
@@ -279,6 +296,6 @@ export async function loadWorkspace(workspaceRoot, options = {}) {
|
|
|
279
296
|
vectorStores,
|
|
280
297
|
tools,
|
|
281
298
|
agents: new Map(loaded.agents.map((agent) => [agent.id, agent])),
|
|
282
|
-
bindings
|
|
299
|
+
bindings,
|
|
283
300
|
};
|
|
284
301
|
}
|