@engineeros/connector 0.8.5 → 0.8.7
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 +19 -7
- package/package.json +1 -1
- package/src/runner.mjs +44 -10
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
executeWorkspaceAssessment,
|
|
18
18
|
inspectCodingAgent,
|
|
19
19
|
promptProgressMessage,
|
|
20
|
+
promptQueueMessage,
|
|
20
21
|
stopProcess,
|
|
21
22
|
workspaceSnapshot,
|
|
22
23
|
} from "../src/runner.mjs";
|
|
@@ -199,11 +200,16 @@ async function connect() {
|
|
|
199
200
|
return;
|
|
200
201
|
}
|
|
201
202
|
if (message.type === "prompt.execute") {
|
|
203
|
+
let added = false;
|
|
202
204
|
if (
|
|
203
205
|
active?.runId !== message.prompt_id &&
|
|
204
206
|
!prompts.some((candidate) => candidate.prompt_id === message.prompt_id)
|
|
205
207
|
) {
|
|
206
208
|
prompts.push(message);
|
|
209
|
+
added = true;
|
|
210
|
+
}
|
|
211
|
+
if (added && active) {
|
|
212
|
+
sendPromptProgress(message.prompt_id, promptQueueMessage(active.kind));
|
|
207
213
|
}
|
|
208
214
|
pump();
|
|
209
215
|
return;
|
|
@@ -345,6 +351,17 @@ function startPings() {
|
|
|
345
351
|
}, 10_000);
|
|
346
352
|
}
|
|
347
353
|
|
|
354
|
+
function sendPromptProgress(promptId, message) {
|
|
355
|
+
if (!message || socket.readyState !== WebSocket.OPEN) return;
|
|
356
|
+
socket.send(
|
|
357
|
+
JSON.stringify({
|
|
358
|
+
type: "prompt.progress",
|
|
359
|
+
prompt_id: promptId,
|
|
360
|
+
message: String(message).slice(0, 500),
|
|
361
|
+
}),
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
348
365
|
function pump() {
|
|
349
366
|
if (active || socket.readyState !== WebSocket.OPEN) return;
|
|
350
367
|
const prompt = prompts.shift();
|
|
@@ -397,14 +414,9 @@ async function executePrompt(assignment) {
|
|
|
397
414
|
return;
|
|
398
415
|
}
|
|
399
416
|
lastProgressMessage = message;
|
|
400
|
-
|
|
401
|
-
JSON.stringify({
|
|
402
|
-
type: "prompt.progress",
|
|
403
|
-
prompt_id: promptId,
|
|
404
|
-
message: String(message).slice(0, 500),
|
|
405
|
-
}),
|
|
406
|
-
);
|
|
417
|
+
sendPromptProgress(promptId, message);
|
|
407
418
|
};
|
|
419
|
+
sendPromptProgress(promptId, "Coding agent started this request");
|
|
408
420
|
console.log(
|
|
409
421
|
`Answering ${assignment.purpose || "project"} prompt with ${codingAgent.name}.`,
|
|
410
422
|
);
|
package/package.json
CHANGED
package/src/runner.mjs
CHANGED
|
@@ -595,6 +595,19 @@ export function promptProgressMessage(event) {
|
|
|
595
595
|
return null;
|
|
596
596
|
}
|
|
597
597
|
|
|
598
|
+
export function promptQueueMessage(activeKind) {
|
|
599
|
+
if (activeKind === "assessment") {
|
|
600
|
+
return "Queued: coding agent is finishing the workspace assessment";
|
|
601
|
+
}
|
|
602
|
+
if (activeKind === "goal") {
|
|
603
|
+
return "Queued: coding agent is finishing an active Goal";
|
|
604
|
+
}
|
|
605
|
+
if (activeKind === "prompt") {
|
|
606
|
+
return "Queued: coding agent is finishing another request";
|
|
607
|
+
}
|
|
608
|
+
return "Coding agent accepted the request";
|
|
609
|
+
}
|
|
610
|
+
|
|
598
611
|
function assessmentCommandMilestone(command) {
|
|
599
612
|
const value = Array.isArray(command)
|
|
600
613
|
? command.join(" ")
|
|
@@ -869,22 +882,29 @@ export function codexExecutionArgs({
|
|
|
869
882
|
if (profile.reasoning_effort) {
|
|
870
883
|
optionArgs.push(
|
|
871
884
|
"--config",
|
|
872
|
-
|
|
885
|
+
codexConfigArgument(
|
|
886
|
+
`model_reasoning_effort=${tomlLiteralString(profile.reasoning_effort)}`,
|
|
887
|
+
),
|
|
873
888
|
);
|
|
874
889
|
}
|
|
875
890
|
if (mcpServer) {
|
|
891
|
+
const mcpArgs = [
|
|
892
|
+
mcpServer.connectorBin,
|
|
893
|
+
"mcp",
|
|
894
|
+
"--workspace",
|
|
895
|
+
mcpServer.workspace,
|
|
896
|
+
"--run-id",
|
|
897
|
+
mcpServer.runId,
|
|
898
|
+
];
|
|
876
899
|
optionArgs.push(
|
|
877
900
|
"--config",
|
|
878
|
-
|
|
901
|
+
codexConfigArgument(
|
|
902
|
+
`mcp_servers.engineeros.command=${tomlLiteralString(process.execPath)}`,
|
|
903
|
+
),
|
|
879
904
|
"--config",
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
"--workspace",
|
|
884
|
-
mcpServer.workspace,
|
|
885
|
-
"--run-id",
|
|
886
|
-
mcpServer.runId,
|
|
887
|
-
])}`,
|
|
905
|
+
codexConfigArgument(
|
|
906
|
+
`mcp_servers.engineeros.args=[${mcpArgs.map(tomlLiteralString).join(",")}]`,
|
|
907
|
+
),
|
|
888
908
|
);
|
|
889
909
|
}
|
|
890
910
|
return previousSessionId
|
|
@@ -892,6 +912,20 @@ export function codexExecutionArgs({
|
|
|
892
912
|
: ["exec", ...optionArgs, "--sandbox", sandbox, "-C", workspace, "-"];
|
|
893
913
|
}
|
|
894
914
|
|
|
915
|
+
function tomlLiteralString(value) {
|
|
916
|
+
const text = String(value);
|
|
917
|
+
if (text.includes("'''")) {
|
|
918
|
+
throw new Error(
|
|
919
|
+
"Codex configuration values cannot contain three consecutive apostrophes.",
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
return `'''${text}'''`;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
function codexConfigArgument(override) {
|
|
926
|
+
return process.platform === "win32" ? `"${override}"` : override;
|
|
927
|
+
}
|
|
928
|
+
|
|
895
929
|
function launchAgentProcess(
|
|
896
930
|
workspace,
|
|
897
931
|
prompt,
|