@botbotgo/agent-harness 0.0.44 → 0.0.46
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 +369 -29
- package/dist/config/embedding-models.yaml +28 -0
- package/dist/config/mcp.yaml +3 -18
- package/dist/config/models.yaml +19 -19
- package/dist/config/stores.yaml +10 -12
- package/dist/config/tools.yaml +3 -11
- package/dist/config/vector-stores.yaml +25 -0
- package/dist/config/workspace.yaml +20 -18
- package/dist/contracts/types.d.ts +4 -2
- package/dist/extensions.js +3 -0
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/persistence/file-store.d.ts +9 -1
- package/dist/persistence/file-store.js +16 -0
- package/dist/resource/resource-impl.d.ts +1 -0
- package/dist/runtime/harness.d.ts +3 -0
- package/dist/runtime/harness.js +262 -112
- package/dist/runtime/thread-memory-sync.js +2 -0
- package/dist/tool-modules.d.ts +1 -0
- package/dist/tool-modules.js +11 -0
- package/dist/tools.d.ts +2 -0
- package/dist/workspace/object-loader.js +23 -12
- package/dist/workspace/resource-compilers.js +1 -0
- package/dist/workspace/support/workspace-ref-utils.d.ts +1 -1
- package/dist/workspace/support/workspace-ref-utils.js +1 -1
- package/dist/workspace/tool-hydration.js +1 -0
- package/package.json +1 -1
- package/dist/config/embedding-model.yaml +0 -29
- package/dist/config/vector-store.yaml +0 -26
|
@@ -22,6 +22,11 @@ spec:
|
|
|
22
22
|
# Value options: relative workspace path like `./.agent`, or an absolute filesystem path.
|
|
23
23
|
runRoot: ./.agent
|
|
24
24
|
|
|
25
|
+
# agent-harness feature: runtime-level task queue and maximum number of concurrent runs.
|
|
26
|
+
# Additional runs wait in the harness queue until a slot becomes available.
|
|
27
|
+
concurrency:
|
|
28
|
+
maxConcurrentRuns: 3
|
|
29
|
+
|
|
25
30
|
# agent-harness feature: optional host-router prompt override used when the runtime chooses between
|
|
26
31
|
# top-level host agents such as a main execution host and an optional low-latency side host.
|
|
27
32
|
# Use placeholders so the same prompt can survive host renames:
|
|
@@ -90,19 +95,17 @@ spec:
|
|
|
90
95
|
# - oldest-first deletion by time policy and/or size policy
|
|
91
96
|
# - background scheduling inside the harness lifecycle
|
|
92
97
|
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
# sweepBatchSize: 200
|
|
105
|
-
# vacuum: false
|
|
98
|
+
maintenance:
|
|
99
|
+
checkpoints:
|
|
100
|
+
enabled: true
|
|
101
|
+
schedule:
|
|
102
|
+
intervalSeconds: 3600
|
|
103
|
+
runOnStartup: true
|
|
104
|
+
policies:
|
|
105
|
+
maxAgeSeconds: 604800
|
|
106
|
+
sqlite:
|
|
107
|
+
sweepBatchSize: 200
|
|
108
|
+
vacuum: false
|
|
106
109
|
|
|
107
110
|
# agent-harness feature: runtime-managed recovery policy for interrupted runs.
|
|
108
111
|
# This keeps checkpoint resume as an internal lifecycle concern instead of a primary user-facing API concept.
|
|
@@ -112,8 +115,7 @@ spec:
|
|
|
112
115
|
# - persisted approval-decision intent for cross-restart resume continuation
|
|
113
116
|
# - bounded retry attempts to avoid infinite restart loops
|
|
114
117
|
#
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
# maxRecoveryAttempts: 3
|
|
118
|
+
recovery:
|
|
119
|
+
enabled: true
|
|
120
|
+
resumeResumingRunsOnStartup: true
|
|
121
|
+
maxRecoveryAttempts: 3
|
|
@@ -4,7 +4,7 @@ export type RuntimeCapabilities = {
|
|
|
4
4
|
delegation?: boolean;
|
|
5
5
|
memory?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export type RunState = "running" | "waiting_for_approval" | "resuming" | "completed" | "failed";
|
|
7
|
+
export type RunState = "queued" | "running" | "waiting_for_approval" | "resuming" | "completed" | "failed";
|
|
8
8
|
export type ParsedAgentObject = {
|
|
9
9
|
id: string;
|
|
10
10
|
executionMode: ExecutionMode;
|
|
@@ -85,6 +85,7 @@ export type ParsedToolObject = {
|
|
|
85
85
|
enabled: boolean;
|
|
86
86
|
allow?: Array<"approve" | "edit" | "reject">;
|
|
87
87
|
};
|
|
88
|
+
retryable?: boolean;
|
|
88
89
|
sourcePath: string;
|
|
89
90
|
};
|
|
90
91
|
export type LangChainAgentParams = {
|
|
@@ -172,6 +173,7 @@ export type CompiledTool = {
|
|
|
172
173
|
enabled: boolean;
|
|
173
174
|
allow: Array<"approve" | "edit" | "reject">;
|
|
174
175
|
};
|
|
176
|
+
retryable?: boolean;
|
|
175
177
|
runtimeValue: {
|
|
176
178
|
name: string;
|
|
177
179
|
description: string;
|
|
@@ -221,7 +223,7 @@ export type ThreadSummary = {
|
|
|
221
223
|
status: RunState;
|
|
222
224
|
};
|
|
223
225
|
export type SessionRecord = ThreadSummary;
|
|
224
|
-
export type KnownHarnessEventType = "run.created" | "run.state.changed" | "run.resumed" | "approval.requested" | "approval.resolved" | "artifact.created" | "output.delta" | "reasoning.delta" | "runtime.synthetic_fallback";
|
|
226
|
+
export type KnownHarnessEventType = "run.created" | "run.queued" | "run.dequeued" | "run.state.changed" | "run.resumed" | "approval.requested" | "approval.resolved" | "artifact.created" | "output.delta" | "reasoning.delta" | "runtime.synthetic_fallback";
|
|
225
227
|
export type HarnessEventType = KnownHarnessEventType | (string & {});
|
|
226
228
|
export type HarnessEvent = {
|
|
227
229
|
eventId: string;
|
package/dist/extensions.js
CHANGED
|
@@ -126,6 +126,7 @@ registerToolKind({
|
|
|
126
126
|
allow: tool.hitl.allow ?? ["approve", "edit", "reject"],
|
|
127
127
|
}
|
|
128
128
|
: undefined,
|
|
129
|
+
retryable: tool.retryable,
|
|
129
130
|
runtimeValue: { name: tool.name, description: tool.description, type: "function" },
|
|
130
131
|
},
|
|
131
132
|
];
|
|
@@ -158,6 +159,7 @@ registerToolKind({
|
|
|
158
159
|
allow: tool.hitl.allow ?? ["approve", "edit", "reject"],
|
|
159
160
|
}
|
|
160
161
|
: undefined,
|
|
162
|
+
retryable: tool.retryable,
|
|
161
163
|
runtimeValue: { name: tool.name, description: tool.description, type: "backend" },
|
|
162
164
|
},
|
|
163
165
|
];
|
|
@@ -190,6 +192,7 @@ registerToolKind({
|
|
|
190
192
|
allow: tool.hitl.allow ?? ["approve", "edit", "reject"],
|
|
191
193
|
}
|
|
192
194
|
: undefined,
|
|
195
|
+
retryable: tool.retryable,
|
|
193
196
|
runtimeValue: { name: tool.name, description: tool.description, type: "mcp" },
|
|
194
197
|
},
|
|
195
198
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.45";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.45";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArtifactListing, ArtifactRecord, DelegationRecord, HarnessEvent, InternalApprovalRecord, RunState, ThreadSummary, ThreadRunRecord, TranscriptMessage } from "../contracts/types.js";
|
|
1
|
+
import type { ArtifactListing, ArtifactRecord, DelegationRecord, HarnessEvent, InternalApprovalRecord, InvocationEnvelope, MessageContent, RunState, ThreadSummary, ThreadRunRecord, TranscriptMessage } from "../contracts/types.js";
|
|
2
2
|
type ThreadMeta = {
|
|
3
3
|
threadId: string;
|
|
4
4
|
workspaceId: string;
|
|
@@ -39,6 +39,11 @@ type RecoveryIntent = {
|
|
|
39
39
|
resumePayload: unknown;
|
|
40
40
|
attempts: number;
|
|
41
41
|
};
|
|
42
|
+
type PersistedRunRequest = {
|
|
43
|
+
input: MessageContent;
|
|
44
|
+
invocation?: InvocationEnvelope;
|
|
45
|
+
savedAt: string;
|
|
46
|
+
};
|
|
42
47
|
export declare class FilePersistence {
|
|
43
48
|
private readonly runRoot;
|
|
44
49
|
constructor(runRoot: string);
|
|
@@ -73,6 +78,9 @@ export declare class FilePersistence {
|
|
|
73
78
|
getRunApprovals(threadId: string, runId: string): Promise<InternalApprovalRecord[]>;
|
|
74
79
|
getRunMeta(threadId: string, runId: string): Promise<RunMeta>;
|
|
75
80
|
getRunLifecycle(threadId: string, runId: string): Promise<Lifecycle>;
|
|
81
|
+
saveRunRequest(threadId: string, runId: string, request: PersistedRunRequest): Promise<void>;
|
|
82
|
+
getRunRequest(threadId: string, runId: string): Promise<PersistedRunRequest | null>;
|
|
83
|
+
clearRunRequest(threadId: string, runId: string): Promise<void>;
|
|
76
84
|
listDelegations(): Promise<DelegationRecord[]>;
|
|
77
85
|
createApproval(record: InternalApprovalRecord): Promise<void>;
|
|
78
86
|
resolveApproval(threadId: string, runId: string, approvalId: string, status: InternalApprovalRecord["status"]): Promise<InternalApprovalRecord>;
|
|
@@ -266,6 +266,22 @@ export class FilePersistence {
|
|
|
266
266
|
async getRunLifecycle(threadId, runId) {
|
|
267
267
|
return readJson(path.join(this.runDir(threadId, runId), "lifecycle.json"));
|
|
268
268
|
}
|
|
269
|
+
async saveRunRequest(threadId, runId, request) {
|
|
270
|
+
await writeJson(path.join(this.runDir(threadId, runId), "request.json"), request);
|
|
271
|
+
}
|
|
272
|
+
async getRunRequest(threadId, runId) {
|
|
273
|
+
const requestPath = path.join(this.runDir(threadId, runId), "request.json");
|
|
274
|
+
if (!(await fileExists(requestPath))) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
return readJson(requestPath);
|
|
278
|
+
}
|
|
279
|
+
async clearRunRequest(threadId, runId) {
|
|
280
|
+
const requestPath = path.join(this.runDir(threadId, runId), "request.json");
|
|
281
|
+
if (await fileExists(requestPath)) {
|
|
282
|
+
await rm(requestPath, { force: true });
|
|
283
|
+
}
|
|
284
|
+
}
|
|
269
285
|
async listDelegations() {
|
|
270
286
|
const delegationsDir = path.join(this.runRoot, "indexes", "delegations");
|
|
271
287
|
if (!(await fileExists(delegationsDir))) {
|
|
@@ -40,6 +40,7 @@ export declare class AgentHarnessRuntime {
|
|
|
40
40
|
private getBinding;
|
|
41
41
|
private listAgentTools;
|
|
42
42
|
private resolveAgentTools;
|
|
43
|
+
private supportsRunningReplay;
|
|
43
44
|
listThreads(filter?: {
|
|
44
45
|
agentId?: string;
|
|
45
46
|
}): Promise<ThreadSummary[]>;
|
|
@@ -62,6 +63,8 @@ export declare class AgentHarnessRuntime {
|
|
|
62
63
|
private loadRunInput;
|
|
63
64
|
private appendAssistantMessage;
|
|
64
65
|
private invokeWithHistory;
|
|
66
|
+
private buildPersistedRunRequest;
|
|
67
|
+
private executeQueuedRun;
|
|
65
68
|
private checkpointRefForState;
|
|
66
69
|
private finalizeContinuedRun;
|
|
67
70
|
private emitOutputDeltaAndCreateItem;
|