@engineeros/connector 0.9.1 → 0.10.1
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/bin/engineeros-connector.mjs +42 -0
- package/package.json +40 -40
- package/src/acp-client.mjs +381 -373
- package/src/agent-harness.mjs +196 -183
- package/src/codex-app-server.mjs +139 -0
- package/src/runner.mjs +1368 -1316
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "../src/config.mjs";
|
|
14
14
|
import {
|
|
15
15
|
assessmentProgressMessage,
|
|
16
|
+
assessmentStreamDelta,
|
|
16
17
|
applyAcceptedChange,
|
|
17
18
|
executeAssignment,
|
|
18
19
|
executeConnectedPrompt,
|
|
@@ -555,6 +556,9 @@ async function executeAssessment(assignment) {
|
|
|
555
556
|
const assessmentId = assignment.assessment_id;
|
|
556
557
|
console.log(`Agent is assessing the workspace (${assessmentId}).`);
|
|
557
558
|
let progress = 10;
|
|
559
|
+
let outputBuffer = "";
|
|
560
|
+
let outputLength = 0;
|
|
561
|
+
let outputTimer;
|
|
558
562
|
const reportedMilestones = new Set();
|
|
559
563
|
const reportProgress = (message, { milestone = true } = {}) => {
|
|
560
564
|
if (socket.readyState !== WebSocket.OPEN || active?.runId !== assessmentId)
|
|
@@ -570,6 +574,40 @@ async function executeAssessment(assignment) {
|
|
|
570
574
|
}),
|
|
571
575
|
);
|
|
572
576
|
};
|
|
577
|
+
const flushOutput = () => {
|
|
578
|
+
if (outputTimer) clearTimeout(outputTimer);
|
|
579
|
+
outputTimer = undefined;
|
|
580
|
+
const output = outputBuffer;
|
|
581
|
+
outputBuffer = "";
|
|
582
|
+
if (
|
|
583
|
+
!output ||
|
|
584
|
+
socket.readyState !== WebSocket.OPEN ||
|
|
585
|
+
active?.runId !== assessmentId
|
|
586
|
+
) {
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
for (let offset = 0; offset < output.length; offset += 50_000) {
|
|
590
|
+
socket.send(
|
|
591
|
+
JSON.stringify({
|
|
592
|
+
type: "workspace.assessment.output",
|
|
593
|
+
assessment_id: assessmentId,
|
|
594
|
+
delta: output.slice(offset, offset + 50_000),
|
|
595
|
+
}),
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
const reportOutput = (delta) => {
|
|
600
|
+
const remaining = 120_000 - outputLength;
|
|
601
|
+
if (!delta || remaining <= 0) return;
|
|
602
|
+
const bounded = String(delta).slice(0, remaining);
|
|
603
|
+
outputBuffer += bounded;
|
|
604
|
+
outputLength += bounded.length;
|
|
605
|
+
if (outputBuffer.length >= 50_000) {
|
|
606
|
+
flushOutput();
|
|
607
|
+
} else if (!outputTimer) {
|
|
608
|
+
outputTimer = setTimeout(flushOutput, 500);
|
|
609
|
+
}
|
|
610
|
+
};
|
|
573
611
|
reportProgress("Starting read-only repository assessment");
|
|
574
612
|
const heartbeat = setInterval(() => {
|
|
575
613
|
progress = Math.min(90, progress + 5);
|
|
@@ -585,10 +623,12 @@ async function executeAssessment(assignment) {
|
|
|
585
623
|
if (active?.runId === assessmentId) active.child = child;
|
|
586
624
|
},
|
|
587
625
|
onEvent: (event) => {
|
|
626
|
+
reportOutput(assessmentStreamDelta(event));
|
|
588
627
|
const message = assessmentProgressMessage(event);
|
|
589
628
|
if (message) reportProgress(message);
|
|
590
629
|
},
|
|
591
630
|
});
|
|
631
|
+
flushOutput();
|
|
592
632
|
const response = await fetch(
|
|
593
633
|
assessmentResultUrl(config.server_url, config.connector_id, assessmentId),
|
|
594
634
|
{
|
|
@@ -607,6 +647,7 @@ async function executeAssessment(assignment) {
|
|
|
607
647
|
}
|
|
608
648
|
console.log("Workspace assessment is current in EngineerOS.");
|
|
609
649
|
} catch (error) {
|
|
650
|
+
flushOutput();
|
|
610
651
|
if (socket.readyState === WebSocket.OPEN) {
|
|
611
652
|
socket.send(
|
|
612
653
|
JSON.stringify({
|
|
@@ -618,6 +659,7 @@ async function executeAssessment(assignment) {
|
|
|
618
659
|
}
|
|
619
660
|
console.error(error instanceof Error ? error.message : String(error));
|
|
620
661
|
} finally {
|
|
662
|
+
if (outputTimer) clearTimeout(outputTimer);
|
|
621
663
|
clearInterval(heartbeat);
|
|
622
664
|
active = null;
|
|
623
665
|
pump();
|
package/package.json
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@engineeros/connector",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Connect a local coding agent to EngineerOS, using ACP when supported.",
|
|
5
|
-
"private": false,
|
|
6
|
-
"type": "module",
|
|
7
|
-
"license": "UNLICENSED",
|
|
8
|
-
"files": [
|
|
9
|
-
"bin",
|
|
10
|
-
"src",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"bin": {
|
|
14
|
-
"engineeros-connector": "bin/engineeros-connector.mjs"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"start": "node ./bin/engineeros-connector.mjs",
|
|
18
|
-
"prepublishOnly": "node ./scripts/release.mjs check",
|
|
19
|
-
"release:patch": "node ./scripts/release.mjs patch",
|
|
20
|
-
"test": "node --test --test-concurrency=1",
|
|
21
|
-
"type-check": "node --check ./bin/engineeros-connector.mjs && node --check ./scripts/release.mjs && node --check ./src/acp-client.mjs && node --check ./src/agent-harness.mjs && node --check ./src/agent-registry.mjs && node --check ./src/capabilities.mjs && node --check ./src/cli-args.mjs && node --check ./src/config.mjs && node --check ./src/connection.mjs && node --check ./src/mcp-server.mjs && node --check ./src/runner.mjs"
|
|
22
|
-
},
|
|
23
|
-
"engines": {
|
|
24
|
-
"node": ">=22"
|
|
25
|
-
},
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/vinpuli/engineerosv2.git",
|
|
29
|
-
"directory": "packages/engineeros-connector"
|
|
30
|
-
},
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/vinpuli/engineerosv2/issues"
|
|
33
|
-
},
|
|
34
|
-
"publishConfig": {
|
|
35
|
-
"access": "public"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@agentclientprotocol/sdk": "1.3.0"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@engineeros/connector",
|
|
3
|
+
"version": "0.10.1",
|
|
4
|
+
"description": "Connect a local coding agent to EngineerOS, using ACP when supported.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "UNLICENSED",
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"src",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"engineeros-connector": "bin/engineeros-connector.mjs"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"start": "node ./bin/engineeros-connector.mjs",
|
|
18
|
+
"prepublishOnly": "node ./scripts/release.mjs check",
|
|
19
|
+
"release:patch": "node ./scripts/release.mjs patch",
|
|
20
|
+
"test": "node --test --test-concurrency=1",
|
|
21
|
+
"type-check": "node --check ./bin/engineeros-connector.mjs && node --check ./scripts/release.mjs && node --check ./src/acp-client.mjs && node --check ./src/agent-harness.mjs && node --check ./src/agent-registry.mjs && node --check ./src/capabilities.mjs && node --check ./src/cli-args.mjs && node --check ./src/config.mjs && node --check ./src/connection.mjs && node --check ./src/mcp-server.mjs && node --check ./src/runner.mjs"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=22"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/vinpuli/engineerosv2.git",
|
|
29
|
+
"directory": "packages/engineeros-connector"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/vinpuli/engineerosv2/issues"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@agentclientprotocol/sdk": "1.3.0"
|
|
39
|
+
}
|
|
40
|
+
}
|