@botbotgo/agent-harness 0.0.374 → 0.0.376

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.
@@ -1,2 +1,2 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.374";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.376";
2
2
  export declare const AGENT_HARNESS_RELEASE_DATE = "2026-04-30";
@@ -1,2 +1,2 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.374";
1
+ export const AGENT_HARNESS_VERSION = "0.0.376";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-04-30";
@@ -153,6 +153,39 @@ function parseCompactRouterSelection(value, subagentNames) {
153
153
  }
154
154
  return null;
155
155
  }
156
+ function inferCompactRouterSelectionFromRequest(requestText, subagents) {
157
+ const normalized = requestText.toLowerCase();
158
+ const score = (subagent) => {
159
+ const name = subagent.name.toLowerCase();
160
+ const description = (subagent.description ?? "").toLowerCase();
161
+ let value = 0;
162
+ if (normalized.includes(name))
163
+ value += 4;
164
+ const keywordGroups = {
165
+ k8s: ["k8s", "kubernetes", "kubectl", "cluster", "pod", "node", "节点", "集群", "调度"],
166
+ software: ["code", "repo", "implementation", "debug", "代码", "仓库", "实现", "配置"],
167
+ ops: ["ci", "cd", "github actions", "disk", "storage", "deploy", "磁盘", "存储", "运维"],
168
+ qa: ["test", "coverage", "regression", "验证", "测试", "回归"],
169
+ release: ["release", "publish", "version", "tag", "发版", "发布", "版本"],
170
+ research: ["research", "web", "latest", "调查资料", "外部", "搜索"],
171
+ secretary: ["summary", "transcript", "youtube", "brief", "摘要", "讲稿", "转写"],
172
+ };
173
+ const keywords = keywordGroups[name] ?? [];
174
+ for (const keyword of keywords) {
175
+ if (normalized.includes(keyword))
176
+ value += description.includes(keyword) || name.includes(keyword) ? 3 : 1;
177
+ }
178
+ return value;
179
+ };
180
+ const ranked = subagents
181
+ .map((subagent) => ({ name: subagent.name, score: score(subagent) }))
182
+ .filter((item) => item.score > 0)
183
+ .sort((left, right) => right.score - left.score);
184
+ if (ranked.length === 0 || (ranked[1] && ranked[1].score === ranked[0].score)) {
185
+ return null;
186
+ }
187
+ return ranked[0].name;
188
+ }
156
189
  function isDelegationOnlyDeepAgentBinding(binding) {
157
190
  return isDeepAgentBinding(binding)
158
191
  && getBindingSubagents(binding).length > 0
@@ -846,6 +879,8 @@ export class AgentRuntimeAdapter {
846
879
  }
847
880
  const subagents = getBindingSubagents(binding);
848
881
  const subagentNames = new Set(subagents.map((subagent) => subagent.name));
882
+ const inferredSubagent = inferCompactRouterSelectionFromRequest(requestText, subagents);
883
+ let selection = inferredSubagent ? { subagentType: inferredSubagent } : null;
849
884
  const subagentCatalog = subagents
850
885
  .map((subagent) => `- ${subagent.name}: ${subagent.description}`)
851
886
  .join("\n");
@@ -907,7 +942,6 @@ export class AgentRuntimeAdapter {
907
942
  requestText,
908
943
  ].filter(Boolean).join("\n\n"),
909
944
  ];
910
- let selection = null;
911
945
  let previousRawText = "";
912
946
  for (let index = 0; index < routerPrompts.length && !selection; index += 1) {
913
947
  const activePrompt = index <= 1 || !previousRawText
@@ -1211,6 +1245,8 @@ export class AgentRuntimeAdapter {
1211
1245
  }
1212
1246
  const subagents = getBindingSubagents(binding);
1213
1247
  const subagentNames = new Set(subagents.map((subagent) => subagent.name));
1248
+ const inferredSubagent = inferCompactRouterSelectionFromRequest(requestText, subagents);
1249
+ let selection = inferredSubagent ? { subagentType: inferredSubagent } : null;
1214
1250
  const subagentCatalog = subagents
1215
1251
  .map((subagent) => `- ${subagent.name}: ${subagent.description}`)
1216
1252
  .join("\n");
@@ -1272,7 +1308,6 @@ export class AgentRuntimeAdapter {
1272
1308
  requestText,
1273
1309
  ].filter(Boolean).join("\n\n"),
1274
1310
  ];
1275
- let selection = null;
1276
1311
  let previousRawText = "";
1277
1312
  for (let index = 0; index < routerPrompts.length && !selection; index += 1) {
1278
1313
  const activePrompt = index <= 1 || !previousRawText
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.374",
3
+ "version": "0.0.376",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",