@botbotgo/agent-harness 0.0.274 → 0.0.276
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.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.275";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.275";
|
|
@@ -39,7 +39,7 @@ export declare function streamRuntimeExecution(options: {
|
|
|
39
39
|
output: string;
|
|
40
40
|
metadata?: Record<string, unknown>;
|
|
41
41
|
}>;
|
|
42
|
-
|
|
42
|
+
applyToolRecoveryInstruction: (binding: CompiledAgentBinding, instruction: string) => CompiledAgentBinding;
|
|
43
43
|
getSystemPrompt: (binding: CompiledAgentBinding) => string | undefined;
|
|
44
44
|
isLangChainBinding: (binding: CompiledAgentBinding) => boolean;
|
|
45
45
|
isDeepAgentBinding: (binding: CompiledAgentBinding) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isToolCallRecoveryFailure, sanitizeVisibleText, } from "../../parsing/output-parsing.js";
|
|
1
|
+
import { isToolCallRecoveryFailure, resolveToolCallRecoveryInstruction, sanitizeVisibleText, } from "../../parsing/output-parsing.js";
|
|
2
2
|
import { buildInvocationRequest } from "../model/invocation-request.js";
|
|
3
3
|
import { buildRawModelMessages } from "../model/message-assembly.js";
|
|
4
4
|
import { projectRuntimeStreamEvent, createStreamEventProjectionState } from "../stream-event-projection.js";
|
|
@@ -85,7 +85,11 @@ export async function* streamRuntimeExecution(options) {
|
|
|
85
85
|
if (!isToolCallRecoveryFailure(error)) {
|
|
86
86
|
throw error;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const recoveryInstruction = resolveToolCallRecoveryInstruction(error);
|
|
89
|
+
if (!recoveryInstruction) {
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
const retried = await options.invoke(options.applyToolRecoveryInstruction(options.binding, recoveryInstruction), options.input, options.threadId, options.runtimeOptions.runId ?? options.threadId, undefined, options.history, options.runtimeOptions);
|
|
89
93
|
if (retried.output) {
|
|
90
94
|
yield { kind: "content", content: sanitizeVisibleText(retried.output) };
|
|
91
95
|
}
|
|
@@ -7,7 +7,7 @@ import { resolveDeepAgentSkillSourcePaths, } from "./adapter/compat/deepagent-co
|
|
|
7
7
|
import { buildToolNameMapping, } from "./adapter/tool/tool-name-mapping.js";
|
|
8
8
|
import { executeRuntimeInvocation } from "./adapter/flow/invocation-flow.js";
|
|
9
9
|
import { streamRuntimeExecution } from "./adapter/flow/stream-runtime.js";
|
|
10
|
-
import { applyStrictToolJsonInstruction as applyStrictToolJsonInstructionHelper, callRuntimeWithToolParseRecovery as callRuntimeWithToolParseRecoveryHelper, createModelFallbackRunnable as createModelFallbackRunnableHelper, invokeWithProviderRetry as invokeWithProviderRetryHelper, iterateWithTimeout as iterateWithTimeoutHelper, materializeModelStream as materializeModelStreamHelper, RuntimeOperationTimeoutError, withRuntimeTimeout, } from "./adapter/runtime-shell.js";
|
|
10
|
+
import { applyToolRecoveryInstruction as applyToolRecoveryInstructionHelper, applyStrictToolJsonInstruction as applyStrictToolJsonInstructionHelper, callRuntimeWithToolParseRecovery as callRuntimeWithToolParseRecoveryHelper, createModelFallbackRunnable as createModelFallbackRunnableHelper, invokeWithProviderRetry as invokeWithProviderRetryHelper, iterateWithTimeout as iterateWithTimeoutHelper, materializeModelStream as materializeModelStreamHelper, RuntimeOperationTimeoutError, withRuntimeTimeout, } from "./adapter/runtime-shell.js";
|
|
11
11
|
import { invokeBuiltinTaskTool as invokeBuiltinTaskToolHelper, materializeAutomaticSummarizationMiddleware as materializeAutomaticSummarizationMiddlewareHelper, resolveBuiltinMiddlewareBackend as resolveBuiltinMiddlewareBackendHelper, resolveBuiltinMiddlewareTools as resolveBuiltinMiddlewareToolsHelper, resolveLangChainRuntimeExtensionMiddleware as resolveLangChainRuntimeExtensionMiddlewareHelper, resolveMiddleware as resolveMiddlewareHelper, resolveSubagents as resolveSubagentsHelper, } from "./adapter/middleware-assembly.js";
|
|
12
12
|
import { computeRemainingTimeoutMs, resolveBindingTimeout, resolveStreamIdleTimeout, } from "./adapter/resilience.js";
|
|
13
13
|
import { createResolvedModel } from "./adapter/model/model-providers.js";
|
|
@@ -544,7 +544,7 @@ export class AgentRuntimeAdapter {
|
|
|
544
544
|
streamIdleTimeoutMs,
|
|
545
545
|
streamDeadlineAt,
|
|
546
546
|
invoke: (activeBinding, activeInput, activeThreadId, runId, resumePayload, activeHistory, invokeOptions) => this.invoke(activeBinding, activeInput, activeThreadId, runId, resumePayload, activeHistory, invokeOptions),
|
|
547
|
-
|
|
547
|
+
applyToolRecoveryInstruction: (activeBinding, instruction) => applyToolRecoveryInstructionHelper(activeBinding, instruction),
|
|
548
548
|
getSystemPrompt: (activeBinding) => getBindingSystemPrompt(activeBinding),
|
|
549
549
|
isLangChainBinding,
|
|
550
550
|
isDeepAgentBinding,
|