@engineeros/connector 0.8.0 → 0.8.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/bin/engineeros-connector.mjs +4 -15
- package/package.json +2 -2
- package/src/cli-args.mjs +18 -0
- package/src/runner.mjs +38 -12
|
@@ -24,8 +24,9 @@ import {
|
|
|
24
24
|
startConnectionWatchdog,
|
|
25
25
|
} from "../src/connection.mjs";
|
|
26
26
|
import { advertisedCapabilities } from "../src/capabilities.mjs";
|
|
27
|
+
import { parseConnectorArgs } from "../src/cli-args.mjs";
|
|
27
28
|
|
|
28
|
-
const { command, positional, flags } =
|
|
29
|
+
const { command, positional, flags } = parseConnectorArgs(process.argv.slice(2));
|
|
29
30
|
|
|
30
31
|
if (command === "status") {
|
|
31
32
|
const config = await loadConfig(flags.workspace || process.cwd());
|
|
@@ -43,7 +44,7 @@ if (command === "pair") {
|
|
|
43
44
|
const pairingCode = positional[0];
|
|
44
45
|
if (!pairingCode)
|
|
45
46
|
fail(
|
|
46
|
-
"Usage: engineeros-connector pair CODE --url URL [--name NAME] [--workspace PATH]",
|
|
47
|
+
"Usage: engineeros-connector pair CODE --url URL [--name NAME] [--workspace PATH] [--skip-git-repo-check]",
|
|
47
48
|
);
|
|
48
49
|
const url = flags.url;
|
|
49
50
|
if (!url) fail("Pairing requires --url with the EngineerOS backend address.");
|
|
@@ -56,6 +57,7 @@ if (command === "pair") {
|
|
|
56
57
|
agent_command: flags["agent-command"] || null,
|
|
57
58
|
agent_args: parseAgentArgs(flags["agent-args"]),
|
|
58
59
|
agent_name: flags["agent-name"] || null,
|
|
60
|
+
skip_git_repo_check: flags["skip-git-repo-check"] === true,
|
|
59
61
|
name:
|
|
60
62
|
flags.name ||
|
|
61
63
|
`${os.hostname()} - ${path.basename(path.resolve(flags.workspace || process.cwd()))}`,
|
|
@@ -565,19 +567,6 @@ async function execute(assignment) {
|
|
|
565
567
|
}
|
|
566
568
|
}
|
|
567
569
|
|
|
568
|
-
function parseArgs(args) {
|
|
569
|
-
const command = args.shift();
|
|
570
|
-
const positional = [];
|
|
571
|
-
const flags = {};
|
|
572
|
-
while (args.length) {
|
|
573
|
-
const value = args.shift();
|
|
574
|
-
if (!value.startsWith("--")) positional.push(value);
|
|
575
|
-
else if (value === "--onboard") flags.onboard = true;
|
|
576
|
-
else flags[value.slice(2)] = args.shift();
|
|
577
|
-
}
|
|
578
|
-
return { command, positional, flags };
|
|
579
|
-
}
|
|
580
|
-
|
|
581
570
|
function parseAgentArgs(value) {
|
|
582
571
|
if (!value) return [];
|
|
583
572
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engineeros/connector",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Connect a local coding agent to EngineerOS, using ACP when supported.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"start": "node ./bin/engineeros-connector.mjs",
|
|
18
18
|
"test": "node --test --test-concurrency=1",
|
|
19
|
-
"type-check": "node --check ./bin/engineeros-connector.mjs && node --check ./src/capabilities.mjs && node --check ./src/connection.mjs && node --check ./src/runner.mjs"
|
|
19
|
+
"type-check": "node --check ./bin/engineeros-connector.mjs && node --check ./src/capabilities.mjs && node --check ./src/cli-args.mjs && node --check ./src/connection.mjs && node --check ./src/runner.mjs"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=22"
|
package/src/cli-args.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const BOOLEAN_FLAGS = new Set(["onboard", "skip-git-repo-check"]);
|
|
2
|
+
|
|
3
|
+
export function parseConnectorArgs(argv) {
|
|
4
|
+
const args = [...argv];
|
|
5
|
+
const command = args.shift();
|
|
6
|
+
const positional = [];
|
|
7
|
+
const flags = {};
|
|
8
|
+
while (args.length) {
|
|
9
|
+
const value = args.shift();
|
|
10
|
+
if (!value.startsWith("--")) {
|
|
11
|
+
positional.push(value);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const name = value.slice(2);
|
|
15
|
+
flags[name] = BOOLEAN_FLAGS.has(name) ? true : args.shift();
|
|
16
|
+
}
|
|
17
|
+
return { command, positional, flags };
|
|
18
|
+
}
|
package/src/runner.mjs
CHANGED
|
@@ -755,21 +755,18 @@ function launchCodexProcess(
|
|
|
755
755
|
callbacks,
|
|
756
756
|
profile = {},
|
|
757
757
|
previousSessionId,
|
|
758
|
+
skipGitRepoCheck = false,
|
|
758
759
|
) {
|
|
759
760
|
const command =
|
|
760
761
|
process.env.CODEX_BIN ||
|
|
761
762
|
(process.platform === "win32" ? "codex.cmd" : "codex");
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
const args = previousSessionId
|
|
771
|
-
? ["exec", "resume", "--json", ...profileArgs, previousSessionId, "-"]
|
|
772
|
-
: ["exec", "--json", "--sandbox", sandbox, "-C", workspace, ...profileArgs, "-"];
|
|
763
|
+
const args = codexExecutionArgs({
|
|
764
|
+
workspace,
|
|
765
|
+
sandbox,
|
|
766
|
+
profile,
|
|
767
|
+
previousSessionId,
|
|
768
|
+
skipGitRepoCheck,
|
|
769
|
+
});
|
|
773
770
|
const child = spawn(command, args, {
|
|
774
771
|
cwd: workspace,
|
|
775
772
|
env: process.env,
|
|
@@ -829,6 +826,27 @@ function launchCodexProcess(
|
|
|
829
826
|
return { child, completed };
|
|
830
827
|
}
|
|
831
828
|
|
|
829
|
+
export function codexExecutionArgs({
|
|
830
|
+
workspace,
|
|
831
|
+
sandbox,
|
|
832
|
+
profile = {},
|
|
833
|
+
previousSessionId,
|
|
834
|
+
skipGitRepoCheck = false,
|
|
835
|
+
}) {
|
|
836
|
+
const optionArgs = ["--json"];
|
|
837
|
+
if (skipGitRepoCheck) optionArgs.push("--skip-git-repo-check");
|
|
838
|
+
if (profile.model) optionArgs.push("--model", profile.model);
|
|
839
|
+
if (profile.reasoning_effort) {
|
|
840
|
+
optionArgs.push(
|
|
841
|
+
"--config",
|
|
842
|
+
`model_reasoning_effort=${JSON.stringify(profile.reasoning_effort)}`,
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
return previousSessionId
|
|
846
|
+
? ["exec", "resume", ...optionArgs, previousSessionId, "-"]
|
|
847
|
+
: ["exec", ...optionArgs, "--sandbox", sandbox, "-C", workspace, "-"];
|
|
848
|
+
}
|
|
849
|
+
|
|
832
850
|
function launchAgentProcess(
|
|
833
851
|
workspace,
|
|
834
852
|
prompt,
|
|
@@ -846,7 +864,15 @@ function launchAgentProcess(
|
|
|
846
864
|
}
|
|
847
865
|
return launchAcpAgent(workspace, prompt, config, callbacks);
|
|
848
866
|
}
|
|
849
|
-
return launchCodexProcess(
|
|
867
|
+
return launchCodexProcess(
|
|
868
|
+
workspace,
|
|
869
|
+
prompt,
|
|
870
|
+
sandbox,
|
|
871
|
+
callbacks,
|
|
872
|
+
profile,
|
|
873
|
+
previousSessionId,
|
|
874
|
+
config.skip_git_repo_check === true,
|
|
875
|
+
);
|
|
850
876
|
}
|
|
851
877
|
|
|
852
878
|
function runCodexCommand(command, args, cwd) {
|