@engineeros/connector 0.15.2 → 0.15.3
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 +105 -111
- package/bin/engineeros-connector.mjs +1015 -1021
- package/package.json +41 -41
- package/src/acp-client.mjs +60 -60
- package/src/assessment-spool.mjs +260 -260
- package/src/runner.mjs +2101 -2109
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@engineeros/connector",
|
|
3
|
-
"version": "0.15.
|
|
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/assessment-spool.mjs && node --check ./src/capabilities.mjs && node --check ./src/cli-args.mjs && node --check ./src/codex-app-server.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
|
-
"zod": "3.25.76"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@engineeros/connector",
|
|
3
|
+
"version": "0.15.3",
|
|
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/assessment-spool.mjs && node --check ./src/capabilities.mjs && node --check ./src/cli-args.mjs && node --check ./src/codex-app-server.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
|
+
"zod": "3.25.76"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/src/acp-client.mjs
CHANGED
|
@@ -115,10 +115,10 @@ class AcpRuntime {
|
|
|
115
115
|
this.onClose = onClose;
|
|
116
116
|
this.sessions = new Map();
|
|
117
117
|
this.turns = new Map();
|
|
118
|
-
this.stderr = "";
|
|
119
|
-
this.disposed = false;
|
|
120
|
-
this.disposePromise = null;
|
|
121
|
-
this.idleTimer = null;
|
|
118
|
+
this.stderr = "";
|
|
119
|
+
this.disposed = false;
|
|
120
|
+
this.disposePromise = null;
|
|
121
|
+
this.idleTimer = null;
|
|
122
122
|
this.child = spawn(
|
|
123
123
|
config.agent_command,
|
|
124
124
|
Array.isArray(config.agent_args) ? config.agent_args : [],
|
|
@@ -159,13 +159,13 @@ class AcpRuntime {
|
|
|
159
159
|
)
|
|
160
160
|
.connect(stream);
|
|
161
161
|
this.context = this.connection.agent;
|
|
162
|
-
this.ready = this.initialize();
|
|
163
|
-
void this.ready.catch(() => {
|
|
164
|
-
void this.dispose();
|
|
165
|
-
});
|
|
166
|
-
this.child.stdout.once("end", () => this.closed());
|
|
167
|
-
this.child.stdout.once("close", () => this.closed());
|
|
168
|
-
this.child.once("exit", () => this.closed());
|
|
162
|
+
this.ready = this.initialize();
|
|
163
|
+
void this.ready.catch(() => {
|
|
164
|
+
void this.dispose();
|
|
165
|
+
});
|
|
166
|
+
this.child.stdout.once("end", () => this.closed());
|
|
167
|
+
this.child.stdout.once("close", () => this.closed());
|
|
168
|
+
this.child.once("exit", () => this.closed());
|
|
169
169
|
void this.connection.closed.then(
|
|
170
170
|
() => this.closed(),
|
|
171
171
|
() => this.closed(),
|
|
@@ -361,17 +361,17 @@ class AcpRuntime {
|
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
isRunning() {
|
|
365
|
-
return (
|
|
366
|
-
!this.disposed &&
|
|
367
|
-
this.childIsRunning() &&
|
|
368
|
-
!this.connection.signal.aborted
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
childIsRunning() {
|
|
373
|
-
return this.child.exitCode === null && this.child.signalCode === null;
|
|
374
|
-
}
|
|
364
|
+
isRunning() {
|
|
365
|
+
return (
|
|
366
|
+
!this.disposed &&
|
|
367
|
+
this.childIsRunning() &&
|
|
368
|
+
!this.connection.signal.aborted
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
childIsRunning() {
|
|
373
|
+
return this.child.exitCode === null && this.child.signalCode === null;
|
|
374
|
+
}
|
|
375
375
|
|
|
376
376
|
scheduleIdleDisposal() {
|
|
377
377
|
if (this.turns.size || this.disposed) return;
|
|
@@ -393,44 +393,44 @@ class AcpRuntime {
|
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
closed() {
|
|
397
|
-
void this.dispose();
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
async dispose() {
|
|
401
|
-
if (this.disposePromise) return this.disposePromise;
|
|
402
|
-
this.disposed = true;
|
|
403
|
-
this.clearIdleTimer();
|
|
404
|
-
this.onClose?.();
|
|
405
|
-
this.disposePromise = this.releaseResources();
|
|
406
|
-
return this.disposePromise;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
async releaseResources() {
|
|
410
|
-
try {
|
|
411
|
-
this.connection.close();
|
|
412
|
-
} catch {
|
|
413
|
-
// The ACP transport may already be closed.
|
|
414
|
-
}
|
|
415
|
-
if (this.childIsRunning()) {
|
|
416
|
-
this.child.kill("SIGTERM");
|
|
417
|
-
await Promise.race([
|
|
418
|
-
new Promise((resolve) => this.child.once("exit", resolve)),
|
|
419
|
-
new Promise((resolve) => setTimeout(resolve, 500)),
|
|
420
|
-
]);
|
|
421
|
-
}
|
|
422
|
-
if (this.childIsRunning()) {
|
|
423
|
-
this.child.kill("SIGKILL");
|
|
424
|
-
await Promise.race([
|
|
425
|
-
new Promise((resolve) => this.child.once("exit", resolve)),
|
|
426
|
-
new Promise((resolve) => setTimeout(resolve, 500)),
|
|
427
|
-
]);
|
|
428
|
-
}
|
|
429
|
-
this.child.stdin.destroy();
|
|
430
|
-
this.child.stdout.destroy();
|
|
431
|
-
this.child.stderr.destroy();
|
|
432
|
-
}
|
|
433
|
-
}
|
|
396
|
+
closed() {
|
|
397
|
+
void this.dispose();
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
async dispose() {
|
|
401
|
+
if (this.disposePromise) return this.disposePromise;
|
|
402
|
+
this.disposed = true;
|
|
403
|
+
this.clearIdleTimer();
|
|
404
|
+
this.onClose?.();
|
|
405
|
+
this.disposePromise = this.releaseResources();
|
|
406
|
+
return this.disposePromise;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
async releaseResources() {
|
|
410
|
+
try {
|
|
411
|
+
this.connection.close();
|
|
412
|
+
} catch {
|
|
413
|
+
// The ACP transport may already be closed.
|
|
414
|
+
}
|
|
415
|
+
if (this.childIsRunning()) {
|
|
416
|
+
this.child.kill("SIGTERM");
|
|
417
|
+
await Promise.race([
|
|
418
|
+
new Promise((resolve) => this.child.once("exit", resolve)),
|
|
419
|
+
new Promise((resolve) => setTimeout(resolve, 500)),
|
|
420
|
+
]);
|
|
421
|
+
}
|
|
422
|
+
if (this.childIsRunning()) {
|
|
423
|
+
this.child.kill("SIGKILL");
|
|
424
|
+
await Promise.race([
|
|
425
|
+
new Promise((resolve) => this.child.once("exit", resolve)),
|
|
426
|
+
new Promise((resolve) => setTimeout(resolve, 500)),
|
|
427
|
+
]);
|
|
428
|
+
}
|
|
429
|
+
this.child.stdin.destroy();
|
|
430
|
+
this.child.stdout.destroy();
|
|
431
|
+
this.child.stderr.destroy();
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
434
|
|
|
435
435
|
export function normalizeTokenUsage(value) {
|
|
436
436
|
if (!value || typeof value !== "object") return null;
|