@botbotgo/agent-harness 0.0.131 → 0.0.133
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/README.md +1 -0
- package/README.zh.md +1 -0
- package/dist/contracts/runtime.d.ts +32 -0
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/runtime/harness/bindings.d.ts +6 -1
- package/dist/runtime/harness/bindings.js +31 -0
- package/dist/runtime/harness/index.d.ts +1 -0
- package/dist/runtime/harness/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,6 +115,7 @@ Boundary documents live in:
|
|
|
115
115
|
- `docs/recovery-policy-matrix.md`
|
|
116
116
|
- `docs/operator-timeline.md`
|
|
117
117
|
- `docs/queue-concurrency-inspection.md`
|
|
118
|
+
- `docs/tool-execution-policy.md`
|
|
118
119
|
- `docs/feature-checklist.md`
|
|
119
120
|
- `docs/long-term-memory.md`
|
|
120
121
|
- `docs/app-task-pattern.md`
|
package/README.zh.md
CHANGED
|
@@ -115,6 +115,7 @@ AI 让 agent 逻辑、工具调用和工作流代码更容易生成,真正变
|
|
|
115
115
|
- `docs/recovery-policy-matrix.md`
|
|
116
116
|
- `docs/operator-timeline.md`
|
|
117
117
|
- `docs/queue-concurrency-inspection.md`
|
|
118
|
+
- `docs/tool-execution-policy.md`
|
|
118
119
|
- `docs/feature-checklist.md`
|
|
119
120
|
- `docs/long-term-memory.md`
|
|
120
121
|
- `docs/app-task-pattern.md`
|
|
@@ -67,6 +67,38 @@ export type RuntimeQueueDiagnostics = {
|
|
|
67
67
|
queueEvents: RuntimeTimelineItem[];
|
|
68
68
|
summary: string;
|
|
69
69
|
};
|
|
70
|
+
export type RuntimeToolExecutionToolPolicy = {
|
|
71
|
+
toolId: string;
|
|
72
|
+
name: string;
|
|
73
|
+
retryable: boolean;
|
|
74
|
+
hasInputSchema: boolean;
|
|
75
|
+
requiresApproval: boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Operator-facing projection of tool execution policy already compiled into a binding.
|
|
79
|
+
* This summarizes existing timeout, retry, validation, and retry-safety hints without
|
|
80
|
+
* introducing a second tool framework or stronger guarantees than the runtime provides.
|
|
81
|
+
*/
|
|
82
|
+
export type RuntimeToolExecutionPolicy = {
|
|
83
|
+
agentId: string;
|
|
84
|
+
invokeTimeoutMs?: number;
|
|
85
|
+
streamIdleTimeoutMs: number;
|
|
86
|
+
providerRetries: {
|
|
87
|
+
maxAttempts: number;
|
|
88
|
+
backoffMs: number;
|
|
89
|
+
retryableMessages: string[];
|
|
90
|
+
};
|
|
91
|
+
validation: {
|
|
92
|
+
schemaBoundToolCount: number;
|
|
93
|
+
allToolsHaveSchemas: boolean;
|
|
94
|
+
};
|
|
95
|
+
idempotencyHints: {
|
|
96
|
+
replayEligible: boolean;
|
|
97
|
+
retryableToolCount: number;
|
|
98
|
+
nonRetryableToolCount: number;
|
|
99
|
+
};
|
|
100
|
+
tools: RuntimeToolExecutionToolPolicy[];
|
|
101
|
+
};
|
|
70
102
|
export type RuntimeEventSink = {
|
|
71
103
|
publish: (event: HarnessEvent) => void;
|
|
72
104
|
subscribe: (listener: HarnessEventListener) => () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.132";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.132";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CompiledTool, RuntimeAdapterOptions, WorkspaceBundle } from "../../contracts/types.js";
|
|
1
|
+
import type { CompiledTool, RuntimeAdapterOptions, RuntimeToolExecutionPolicy, WorkspaceBundle } from "../../contracts/types.js";
|
|
2
2
|
type Binding = WorkspaceBundle["bindings"] extends Map<any, infer T> ? T : never;
|
|
3
3
|
export declare function getWorkspaceBinding(workspace: WorkspaceBundle, agentId: string): Binding | undefined;
|
|
4
4
|
export declare function getRequiredWorkspaceBinding(workspace: WorkspaceBundle, agentId: string): Binding;
|
|
@@ -11,4 +11,9 @@ export declare function resolveWorkspaceAgentTools(input: {
|
|
|
11
11
|
resolvedTool: unknown;
|
|
12
12
|
}>;
|
|
13
13
|
export declare function bindingSupportsRunningReplay(binding: Binding): boolean;
|
|
14
|
+
export declare function projectBindingToolExecutionPolicy(binding: Binding): RuntimeToolExecutionPolicy;
|
|
15
|
+
export declare function projectWorkspaceAgentToolExecutionPolicy(input: {
|
|
16
|
+
workspace: WorkspaceBundle;
|
|
17
|
+
agentId: string;
|
|
18
|
+
}): RuntimeToolExecutionPolicy;
|
|
14
19
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveBindingTimeout, resolveProviderRetryPolicy, resolveStreamIdleTimeout } from "../adapter/resilience.js";
|
|
1
2
|
import { getBindingPrimaryTools } from "../support/compiled-binding.js";
|
|
2
3
|
export function getWorkspaceBinding(workspace, agentId) {
|
|
3
4
|
return workspace.bindings.get(agentId);
|
|
@@ -21,3 +22,33 @@ export function resolveWorkspaceAgentTools(input) {
|
|
|
21
22
|
export function bindingSupportsRunningReplay(binding) {
|
|
22
23
|
return getBindingPrimaryTools(binding).every((tool) => tool.retryable === true);
|
|
23
24
|
}
|
|
25
|
+
export function projectBindingToolExecutionPolicy(binding) {
|
|
26
|
+
const tools = getBindingPrimaryTools(binding);
|
|
27
|
+
const projectedTools = tools.map((tool) => ({
|
|
28
|
+
toolId: tool.id,
|
|
29
|
+
name: tool.name,
|
|
30
|
+
retryable: tool.retryable === true,
|
|
31
|
+
hasInputSchema: typeof tool.inputSchemaRef === "string" && tool.inputSchemaRef.trim().length > 0,
|
|
32
|
+
requiresApproval: tool.hitl?.enabled === true,
|
|
33
|
+
}));
|
|
34
|
+
const retryableToolCount = projectedTools.filter((tool) => tool.retryable).length;
|
|
35
|
+
return {
|
|
36
|
+
agentId: binding.agent.id,
|
|
37
|
+
invokeTimeoutMs: resolveBindingTimeout(binding),
|
|
38
|
+
streamIdleTimeoutMs: resolveStreamIdleTimeout(binding) ?? 60_000,
|
|
39
|
+
providerRetries: resolveProviderRetryPolicy(binding),
|
|
40
|
+
validation: {
|
|
41
|
+
schemaBoundToolCount: projectedTools.filter((tool) => tool.hasInputSchema).length,
|
|
42
|
+
allToolsHaveSchemas: projectedTools.length > 0 && projectedTools.every((tool) => tool.hasInputSchema),
|
|
43
|
+
},
|
|
44
|
+
idempotencyHints: {
|
|
45
|
+
replayEligible: bindingSupportsRunningReplay(binding),
|
|
46
|
+
retryableToolCount,
|
|
47
|
+
nonRetryableToolCount: projectedTools.length - retryableToolCount,
|
|
48
|
+
},
|
|
49
|
+
tools: projectedTools,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export function projectWorkspaceAgentToolExecutionPolicy(input) {
|
|
53
|
+
return projectBindingToolExecutionPolicy(getRequiredWorkspaceBinding(input.workspace, input.agentId));
|
|
54
|
+
}
|
|
@@ -2,6 +2,7 @@ export * from "./events/event-bus.js";
|
|
|
2
2
|
export * from "./events/event-sink.js";
|
|
3
3
|
export * from "./events/events.js";
|
|
4
4
|
export * from "./events/timeline.js";
|
|
5
|
+
export * from "./bindings.js";
|
|
5
6
|
export * from "./system/health-monitor.js";
|
|
6
7
|
export * from "./run/helpers.js";
|
|
7
8
|
export * from "./run/queue-diagnostics.js";
|
|
@@ -2,6 +2,7 @@ export * from "./events/event-bus.js";
|
|
|
2
2
|
export * from "./events/event-sink.js";
|
|
3
3
|
export * from "./events/events.js";
|
|
4
4
|
export * from "./events/timeline.js";
|
|
5
|
+
export * from "./bindings.js";
|
|
5
6
|
export * from "./system/health-monitor.js";
|
|
6
7
|
export * from "./run/helpers.js";
|
|
7
8
|
export * from "./run/queue-diagnostics.js";
|