@botbotgo/agent-harness 0.0.82 → 0.0.83

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 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.81";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.82";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.81";
1
+ export const AGENT_HARNESS_VERSION = "0.0.82";
@@ -52,7 +52,9 @@ export declare class AgentRuntimeAdapter {
52
52
  private invokeBuiltinTaskTool;
53
53
  private resolveBuiltinMiddlewareTools;
54
54
  private canReplayToolCallsLocally;
55
+ private resolveAutomaticSummarizationMiddleware;
55
56
  private resolveLangChainAutomaticMiddleware;
57
+ private resolveDeepAgentAutomaticMiddleware;
56
58
  private resolveMiddleware;
57
59
  private resolveCheckpointer;
58
60
  private buildRouteSystemPrompt;
@@ -200,6 +200,9 @@ function hasConfiguredSubagentSupport(binding) {
200
200
  }
201
201
  return (params.subagents?.length ?? 0) > 0 || params.generalPurposeAgent === true || Boolean(params.taskDescription?.trim());
202
202
  }
203
+ function hasConfiguredMiddlewareKind(binding, kind) {
204
+ return getBindingMiddlewareConfigs(binding)?.some((entry) => entry.kind === kind) ?? false;
205
+ }
203
206
  function instantiateProviderTool(compiledTool) {
204
207
  const providerTool = asRecord(compiledTool.config?.providerTool);
205
208
  const provider = typeof providerTool?.provider === "string" ? providerTool.provider.trim().toLowerCase() : "";
@@ -1111,6 +1114,22 @@ export class AgentRuntimeAdapter {
1111
1114
  return builtinExecutable !== undefined;
1112
1115
  });
1113
1116
  }
1117
+ async resolveAutomaticSummarizationMiddleware(binding) {
1118
+ if (hasConfiguredMiddlewareKind(binding, "summarization")) {
1119
+ return [];
1120
+ }
1121
+ const primaryModel = getBindingPrimaryModel(binding);
1122
+ if (!primaryModel) {
1123
+ return [];
1124
+ }
1125
+ return resolveDeclaredMiddleware([{ kind: "summarization", model: primaryModel }], {
1126
+ resolveModel: (model) => this.resolveModel(model),
1127
+ resolveBackend: (resolvedBinding) => this.options.backendResolver?.(resolvedBinding ?? binding),
1128
+ resolveFilesystemBackend: (resolvedBinding) => this.resolveFilesystemBackend(resolvedBinding ?? binding),
1129
+ resolveCustom: this.options.declaredMiddlewareResolver,
1130
+ binding,
1131
+ });
1132
+ }
1114
1133
  async resolveLangChainAutomaticMiddleware(binding) {
1115
1134
  const params = getBindingLangChainParams(binding);
1116
1135
  if (!params) {
@@ -1118,6 +1137,7 @@ export class AgentRuntimeAdapter {
1118
1137
  }
1119
1138
  const automaticMiddleware = [];
1120
1139
  automaticMiddleware.push(createPatchToolCallsMiddleware());
1140
+ automaticMiddleware.push(...(await this.resolveAutomaticSummarizationMiddleware(binding)));
1121
1141
  if ((params.skills?.length ?? 0) > 0) {
1122
1142
  automaticMiddleware.push(createSkillsMiddleware({
1123
1143
  backend: this.resolveFilesystemBackend(binding),
@@ -1142,6 +1162,12 @@ export class AgentRuntimeAdapter {
1142
1162
  }
1143
1163
  return automaticMiddleware;
1144
1164
  }
1165
+ async resolveDeepAgentAutomaticMiddleware(binding) {
1166
+ if (!isDeepAgentBinding(binding)) {
1167
+ return [];
1168
+ }
1169
+ return this.resolveAutomaticSummarizationMiddleware(binding);
1170
+ }
1145
1171
  async resolveMiddleware(binding, interruptOn) {
1146
1172
  const declarativeMiddleware = await resolveDeclaredMiddleware(getBindingMiddlewareConfigs(binding), {
1147
1173
  resolveModel: (model) => this.resolveModel(model),
@@ -1152,7 +1178,7 @@ export class AgentRuntimeAdapter {
1152
1178
  });
1153
1179
  const automaticMiddleware = isLangChainBinding(binding)
1154
1180
  ? await this.resolveLangChainAutomaticMiddleware(binding)
1155
- : [];
1181
+ : await this.resolveDeepAgentAutomaticMiddleware(binding);
1156
1182
  const middleware = [
1157
1183
  ...declarativeMiddleware,
1158
1184
  ...automaticMiddleware,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "type": "module",
6
6
  "packageManager": "npm@10.9.2",