@botbotgo/agent-harness 0.0.105 → 0.0.106
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/routing.d.ts +2 -2
- package/dist/runtime/harness/run/routing.js +3 -4
- package/dist/runtime/harness/system/inventory.js +1 -2
- package/dist/runtime/harness.d.ts +0 -1
- package/dist/runtime/harness.js +4 -6
- package/dist/runtime/support/harness-support.d.ts +0 -2
- package/dist/runtime/support/harness-support.js +5 -35
- package/dist/workspace/agent-binding-compiler.js +0 -3
- package/package.json +1 -1
- package/dist/runtime/support/runtime-entry.d.ts +0 -2
- package/dist/runtime/support/runtime-entry.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.105";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.105";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type MessageContent, type ThreadSummary, type WorkspaceBundle } from "../../../contracts/types.js";
|
|
2
|
-
export declare function getDefaultHostAgentId(workspace: WorkspaceBundle, preferredHostAgentId
|
|
2
|
+
export declare function getDefaultHostAgentId(workspace: WorkspaceBundle, preferredHostAgentId?: string): string;
|
|
3
3
|
export declare function resolveSelectedAgentId(options: {
|
|
4
4
|
workspace: WorkspaceBundle;
|
|
5
5
|
input: MessageContent;
|
|
6
6
|
requestedAgentId?: string;
|
|
7
7
|
threadId?: string;
|
|
8
|
-
preferredHostAgentId
|
|
8
|
+
preferredHostAgentId?: string;
|
|
9
9
|
getThreadSummary: (threadId: string) => Promise<ThreadSummary | null>;
|
|
10
10
|
}): Promise<string>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AUTO_AGENT_ID } from "../../../contracts/types.js";
|
|
2
2
|
import { inferRoutingBindings } from "../../support/harness-support.js";
|
|
3
|
-
import { isRuntimeEntryBinding } from "../../support/runtime-entry.js";
|
|
4
3
|
export function getDefaultHostAgentId(workspace, preferredHostAgentId) {
|
|
5
|
-
const preferredBinding = workspace.bindings.get(preferredHostAgentId);
|
|
6
|
-
if (preferredBinding
|
|
4
|
+
const preferredBinding = preferredHostAgentId ? workspace.bindings.get(preferredHostAgentId) : undefined;
|
|
5
|
+
if (preferredBinding) {
|
|
7
6
|
return preferredBinding.agent.id;
|
|
8
7
|
}
|
|
9
8
|
return inferRoutingBindings(workspace).primaryBinding?.agent.id ?? "agent";
|
|
@@ -14,7 +13,7 @@ export async function resolveSelectedAgentId(options) {
|
|
|
14
13
|
if (threadId) {
|
|
15
14
|
const thread = await getThreadSummary(threadId);
|
|
16
15
|
const threadBinding = thread ? workspace.bindings.get(thread.agentId) : undefined;
|
|
17
|
-
if (thread?.agentId && threadBinding
|
|
16
|
+
if (thread?.agentId && threadBinding) {
|
|
18
17
|
return thread.agentId;
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -2,9 +2,8 @@ import { readSkillMetadata } from "../../support/skill-metadata.js";
|
|
|
2
2
|
import { getBindingPrimaryTools } from "../../support/compiled-binding.js";
|
|
3
3
|
import { assessSkillRequirements, } from "./skill-requirements.js";
|
|
4
4
|
import { createRuntimeEnv } from "../../support/runtime-env.js";
|
|
5
|
-
import { isRuntimeEntryBinding } from "../../support/runtime-entry.js";
|
|
6
5
|
function listHostBindings(workspace) {
|
|
7
|
-
return Array.from(workspace.bindings.values())
|
|
6
|
+
return Array.from(workspace.bindings.values());
|
|
8
7
|
}
|
|
9
8
|
export function findAgentBinding(workspace, agentId) {
|
|
10
9
|
return workspace.bindings.get(agentId);
|
|
@@ -5,7 +5,6 @@ import type { RequirementAssessmentOptions } from "./harness/system/skill-requir
|
|
|
5
5
|
export declare class AgentHarnessRuntime {
|
|
6
6
|
private readonly workspace;
|
|
7
7
|
private readonly runtimeAdapterOptions;
|
|
8
|
-
private static readonly DEFAULT_HOST_AGENT_ID;
|
|
9
8
|
private static readonly BACKGROUND_EVENT_TYPES;
|
|
10
9
|
private readonly eventBus;
|
|
11
10
|
private readonly persistence;
|
package/dist/runtime/harness.js
CHANGED
|
@@ -23,7 +23,6 @@ import { getDefaultHostAgentId, resolveSelectedAgentId } from "./harness/run/rou
|
|
|
23
23
|
import { resolveCheckpointer, resolveEmbeddingModel, resolveStore, resolveStoreFromConfig, resolveVectorStore, } from "./harness/run/resources.js";
|
|
24
24
|
import { createToolMcpServerFromTools, serveToolsOverStdioFromHarness } from "../mcp.js";
|
|
25
25
|
import { getBindingAdapterKind, getBindingPrimaryTools, getBindingStoreConfig } from "./support/compiled-binding.js";
|
|
26
|
-
import { isRuntimeEntryBinding } from "./support/runtime-entry.js";
|
|
27
26
|
import { describeWorkspaceInventory, listAgentSkills as listWorkspaceAgentSkills, } from "./harness/system/inventory.js";
|
|
28
27
|
import { createDefaultHealthSnapshot, isInventoryEnabled, isThreadMemorySyncEnabled, } from "./harness/runtime-defaults.js";
|
|
29
28
|
import { initializeHarnessRuntime, isStaleRunningRun as isHarnessStaleRunningRun, } from "./harness/run/startup-runtime.js";
|
|
@@ -32,7 +31,6 @@ import { deleteThreadRecord, getPublicApproval, getThreadRecord, listPublicAppro
|
|
|
32
31
|
export class AgentHarnessRuntime {
|
|
33
32
|
workspace;
|
|
34
33
|
runtimeAdapterOptions;
|
|
35
|
-
static DEFAULT_HOST_AGENT_ID = "orchestra";
|
|
36
34
|
static BACKGROUND_EVENT_TYPES = new Set([
|
|
37
35
|
"run.created",
|
|
38
36
|
"run.queued",
|
|
@@ -72,7 +70,7 @@ export class AgentHarnessRuntime {
|
|
|
72
70
|
`${this.workspace.workspaceRoot}/run-data`);
|
|
73
71
|
}
|
|
74
72
|
getDefaultHostAgentId() {
|
|
75
|
-
return getDefaultHostAgentId(this.workspace, this.routingDefaultAgentId
|
|
73
|
+
return getDefaultHostAgentId(this.workspace, this.routingDefaultAgentId);
|
|
76
74
|
}
|
|
77
75
|
async resolveSelectedAgentId(input, requestedAgentId, threadId) {
|
|
78
76
|
return resolveSelectedAgentId({
|
|
@@ -80,7 +78,7 @@ export class AgentHarnessRuntime {
|
|
|
80
78
|
input,
|
|
81
79
|
requestedAgentId,
|
|
82
80
|
threadId,
|
|
83
|
-
preferredHostAgentId: this.routingDefaultAgentId
|
|
81
|
+
preferredHostAgentId: this.routingDefaultAgentId,
|
|
84
82
|
getThreadSummary: (currentThreadId) => this.getSession(currentThreadId),
|
|
85
83
|
});
|
|
86
84
|
}
|
|
@@ -264,14 +262,14 @@ export class AgentHarnessRuntime {
|
|
|
264
262
|
const configuredRule = this.routingRules.find((rule) => matchRoutingRule(rawInput, rule, options));
|
|
265
263
|
if (configuredRule) {
|
|
266
264
|
const configuredBinding = this.workspace.bindings.get(configuredRule.agentId);
|
|
267
|
-
if (configuredBinding
|
|
265
|
+
if (configuredBinding) {
|
|
268
266
|
return configuredBinding.agent.id;
|
|
269
267
|
}
|
|
270
268
|
}
|
|
271
269
|
const defaultBinding = this.routingDefaultAgentId
|
|
272
270
|
? this.workspace.bindings.get(this.routingDefaultAgentId)
|
|
273
271
|
: undefined;
|
|
274
|
-
if (defaultBinding
|
|
272
|
+
if (defaultBinding) {
|
|
275
273
|
return defaultBinding.agent.id;
|
|
276
274
|
}
|
|
277
275
|
return this.getDefaultHostAgentId();
|
|
@@ -11,7 +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
|
-
secondaryBinding: import("../../contracts/workspace.js").CompiledAgentBinding | undefined;
|
|
15
|
-
researchBinding: import("../../contracts/workspace.js").CompiledAgentBinding | undefined;
|
|
16
14
|
hostBindings: import("../../contracts/workspace.js").CompiledAgentBinding[];
|
|
17
15
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createPersistentId } from "../../utils/id.js";
|
|
2
2
|
import { isDelegationCapableBinding } from "../../workspace/support/agent-capabilities.js";
|
|
3
|
-
import { isRuntimeEntryBinding } from "./runtime-entry.js";
|
|
4
3
|
export function renderRuntimeFailure(error) {
|
|
5
4
|
const message = error instanceof Error ? error.message : String(error);
|
|
6
5
|
return `runtime_error=${message}`.trim();
|
|
@@ -87,38 +86,9 @@ export function createPendingApproval(threadId, runId, checkpointRef, input, int
|
|
|
87
86
|
};
|
|
88
87
|
}
|
|
89
88
|
export function inferRoutingBindings(workspace) {
|
|
90
|
-
const
|
|
91
|
-
const orchestrationHosts =
|
|
92
|
-
const routingHosts = orchestrationHosts.length > 0 ? orchestrationHosts :
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const researchBinding = routingHosts.find((binding) => binding.agent.id === "research-lite" || binding.agent.id === "research");
|
|
96
|
-
const directBinding = routingHosts.find((binding) => binding.agent.id === "direct");
|
|
97
|
-
const delegationHosts = routingHosts.filter((binding) => isDelegationCapableBinding(binding));
|
|
98
|
-
const deepAgentDelegationHosts = deepAgentHosts.filter((binding) => isDelegationCapableBinding(binding));
|
|
99
|
-
const nonDeepAgentDelegationHosts = nonDeepAgentHosts.filter((binding) => isDelegationCapableBinding(binding));
|
|
100
|
-
const lightweightHosts = routingHosts.filter((binding) => !isDelegationCapableBinding(binding));
|
|
101
|
-
const defaultOrchestratingHost = routingHosts.find((binding) => binding.agent.id === "orchestra") ??
|
|
102
|
-
deepAgentDelegationHosts.find((binding) => (binding.deepAgentParams?.subagents.length ?? 0) > 0) ??
|
|
103
|
-
deepAgentDelegationHosts[0] ??
|
|
104
|
-
deepAgentHosts[0] ??
|
|
105
|
-
nonDeepAgentDelegationHosts.find((binding) => (binding.deepAgentParams?.subagents.length ?? 0) > 0) ??
|
|
106
|
-
nonDeepAgentDelegationHosts[0] ??
|
|
107
|
-
nonDeepAgentHosts[0];
|
|
108
|
-
const delegationPreferredSecondary = deepAgentDelegationHosts.find((binding) => (binding.deepAgentParams?.subagents.length ?? 0) > 0) ??
|
|
109
|
-
deepAgentDelegationHosts[0] ??
|
|
110
|
-
nonDeepAgentDelegationHosts.find((binding) => (binding.deepAgentParams?.subagents.length ?? 0) > 0) ??
|
|
111
|
-
nonDeepAgentDelegationHosts[0] ??
|
|
112
|
-
delegationHosts[0];
|
|
113
|
-
const genericLightweightHost = lightweightHosts.find((binding) => binding.agent.id !== researchBinding?.agent.id);
|
|
114
|
-
const primaryBinding = defaultOrchestratingHost ?? directBinding ?? genericLightweightHost ?? routingHosts[0] ?? runtimeEntryBindings[0];
|
|
115
|
-
const secondaryBinding = genericLightweightHost && genericLightweightHost.agent.id !== primaryBinding?.agent.id
|
|
116
|
-
? genericLightweightHost
|
|
117
|
-
: directBinding && directBinding.agent.id !== primaryBinding?.agent.id
|
|
118
|
-
? directBinding
|
|
119
|
-
: delegationPreferredSecondary && delegationPreferredSecondary.agent.id !== primaryBinding?.agent.id
|
|
120
|
-
? delegationPreferredSecondary
|
|
121
|
-
: routingHosts.find((binding) => binding.agent.id !== primaryBinding?.agent.id) ??
|
|
122
|
-
(orchestrationHosts.length > 0 ? undefined : runtimeEntryBindings.find((binding) => binding.agent.id !== primaryBinding?.agent.id));
|
|
123
|
-
return { primaryBinding, secondaryBinding, researchBinding, hostBindings: runtimeEntryBindings };
|
|
89
|
+
const hostBindings = Array.from(workspace.bindings.values());
|
|
90
|
+
const orchestrationHosts = hostBindings.filter((binding) => binding.agent.executionMode === "deepagent" || Boolean(binding.deepAgentParams));
|
|
91
|
+
const routingHosts = orchestrationHosts.length > 0 ? orchestrationHosts : hostBindings;
|
|
92
|
+
const primaryBinding = routingHosts.find((binding) => isDelegationCapableBinding(binding)) ?? routingHosts[0] ?? hostBindings[0];
|
|
93
|
+
return { primaryBinding, hostBindings };
|
|
124
94
|
}
|
|
@@ -72,9 +72,6 @@ function resolveAgentRuntimeName(agent) {
|
|
|
72
72
|
if (normalizedSourcePath.includes("/packages/framework/")) {
|
|
73
73
|
return `core.${baseName}`;
|
|
74
74
|
}
|
|
75
|
-
if (["direct", "orchestra", "research-lite"].includes(baseName)) {
|
|
76
|
-
return `core.${baseName}`;
|
|
77
|
-
}
|
|
78
75
|
return baseName;
|
|
79
76
|
}
|
|
80
77
|
export function requireTools(tools, refs, ownerId) {
|
package/package.json
CHANGED