@agentgrader/agent-acp 2.0.0 → 2.0.2
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/dist/index.js +13 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { ndJsonStream, ClientSideConnection, PROTOCOL_VERSION, RequestError } fr
|
|
|
5
5
|
|
|
6
6
|
// src/index.ts
|
|
7
7
|
var DEFAULT_WORKSPACE_ROOT = "/app";
|
|
8
|
+
var TERMINAL_OUTPUT_TRUNCATE_LIMIT = 4e3;
|
|
8
9
|
function resolveAcpSpawn(config) {
|
|
9
10
|
if (!config.acp_command) {
|
|
10
11
|
throw new Error(
|
|
@@ -199,6 +200,12 @@ var SandboxAcpClient = class {
|
|
|
199
200
|
tool: "terminal/output",
|
|
200
201
|
content: params.terminalId
|
|
201
202
|
});
|
|
203
|
+
this.emitStep({
|
|
204
|
+
kind: "tool_result",
|
|
205
|
+
tool: "terminal/output",
|
|
206
|
+
content: TERMINAL_OUTPUT_TRUNCATE_LIMIT < output.length ? `${output.slice(0, TERMINAL_OUTPUT_TRUNCATE_LIMIT)}
|
|
207
|
+
... (truncated)` : output
|
|
208
|
+
});
|
|
202
209
|
return {
|
|
203
210
|
output,
|
|
204
211
|
truncated: false,
|
|
@@ -365,12 +372,17 @@ var AcpAgentAdapter = class {
|
|
|
365
372
|
});
|
|
366
373
|
const stepTimeoutMs = config.step_timeout_ms ?? 12e4;
|
|
367
374
|
let timedOut = false;
|
|
375
|
+
const promptBlocks = [];
|
|
376
|
+
if (config.system_prompt) {
|
|
377
|
+
promptBlocks.push({ type: "text", text: config.system_prompt });
|
|
378
|
+
}
|
|
379
|
+
promptBlocks.push({ type: "text", text: prompt });
|
|
368
380
|
let promptResponse;
|
|
369
381
|
try {
|
|
370
382
|
promptResponse = await Promise.race([
|
|
371
383
|
connection.prompt({
|
|
372
384
|
sessionId: session.sessionId,
|
|
373
|
-
prompt:
|
|
385
|
+
prompt: promptBlocks
|
|
374
386
|
}),
|
|
375
387
|
new Promise((_, reject) => {
|
|
376
388
|
setTimeout(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentgrader/agent-acp",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Agent Client Protocol (ACP) adapter for the Agentgrader framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@agentclientprotocol/sdk": "^0.25.1",
|
|
25
|
-
"@agentgrader/core": "^1.3.
|
|
25
|
+
"@agentgrader/core": "^1.3.1",
|
|
26
26
|
"zod": "^3.23.8"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"tsup": "^8.5.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@agentgrader/core": "^1.3.
|
|
32
|
+
"@agentgrader/core": "^1.3.1"
|
|
33
33
|
}
|
|
34
34
|
}
|