@botbotgo/agent-harness 0.0.39 → 0.0.40
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.
|
@@ -58,7 +58,7 @@ spec:
|
|
|
58
58
|
# regex:
|
|
59
59
|
# - "\\b(create|build|implement|fix|review|debug|inspect|analy[sz]e|download|clone)\\b"
|
|
60
60
|
rules:
|
|
61
|
-
- agentId:
|
|
61
|
+
- agentId: orchestra
|
|
62
62
|
contains: ["latest", "recent", "today", "current", "news", "最新", "最近", "今天", "当前", "新闻", "头条", "研究", "调研"]
|
|
63
63
|
- agentId: orchestra
|
|
64
64
|
regex:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.39";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.39";
|
|
@@ -5,7 +5,7 @@ import { validateAgent, validateTopology } from "./validate.js";
|
|
|
5
5
|
import { compileBinding } from "./agent-binding-compiler.js";
|
|
6
6
|
import { discoverSubagents, ensureDiscoverySources } from "./support/discovery.js";
|
|
7
7
|
import { collectAgentDiscoverySourceRefs, collectToolSourceRefs } from "./support/source-collectors.js";
|
|
8
|
-
import { resolveRefId } from "./support/workspace-ref-utils.js";
|
|
8
|
+
import { getRoutingDefaultAgentId, getRoutingRules, resolveRefId, } from "./support/workspace-ref-utils.js";
|
|
9
9
|
import { hydrateAgentMcpTools, hydrateResourceAndExternalTools } from "./tool-hydration.js";
|
|
10
10
|
function collectParsedResources(refs) {
|
|
11
11
|
const embeddings = new Map();
|
|
@@ -70,6 +70,20 @@ function compileBindings(workspaceRoot, refs, agentsList, models, tools) {
|
|
|
70
70
|
}
|
|
71
71
|
return bindings;
|
|
72
72
|
}
|
|
73
|
+
function validateRoutingTargets(refs, agentsList) {
|
|
74
|
+
const hostFacingAgentIds = new Set(agentsList
|
|
75
|
+
.filter((agent) => !agentsList.some((owner) => owner.subagentRefs.some((ref) => resolveRefId(ref) === agent.id)))
|
|
76
|
+
.map((agent) => agent.id));
|
|
77
|
+
const defaultAgentId = getRoutingDefaultAgentId(refs);
|
|
78
|
+
if (defaultAgentId && !hostFacingAgentIds.has(defaultAgentId)) {
|
|
79
|
+
throw new Error(`Runtime routing.defaultAgentId references unknown host-facing agent ${defaultAgentId}`);
|
|
80
|
+
}
|
|
81
|
+
for (const rule of getRoutingRules(refs)) {
|
|
82
|
+
if (!hostFacingAgentIds.has(rule.agentId)) {
|
|
83
|
+
throw new Error(`Runtime routing.rules references unknown host-facing agent ${rule.agentId}`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
73
87
|
export async function loadWorkspace(workspaceRoot, options = {}) {
|
|
74
88
|
const loaded = await loadWorkspaceObjects(workspaceRoot, options);
|
|
75
89
|
loaded.agents = await discoverSubagents(loaded.agents, workspaceRoot);
|
|
@@ -84,6 +98,7 @@ export async function loadWorkspace(workspaceRoot, options = {}) {
|
|
|
84
98
|
await ensureResourceSources(toolSourceRefs, workspaceRoot);
|
|
85
99
|
await hydrateResourceAndExternalTools(tools, toolSourceRefs, workspaceRoot);
|
|
86
100
|
validateWorkspaceResources(embeddings, mcpServers, models, vectorStores, tools, loaded.agents);
|
|
101
|
+
validateRoutingTargets(loaded.refs, loaded.agents);
|
|
87
102
|
return {
|
|
88
103
|
workspaceRoot,
|
|
89
104
|
resourceSources: [...toolSourceRefs],
|