@engineeros/connector 0.8.4 → 0.8.5
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 +21 -0
- package/package.json +1 -1
- package/src/runner.mjs +25 -0
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
executeConnectedPrompt,
|
|
17
17
|
executeWorkspaceAssessment,
|
|
18
18
|
inspectCodingAgent,
|
|
19
|
+
promptProgressMessage,
|
|
19
20
|
stopProcess,
|
|
20
21
|
workspaceSnapshot,
|
|
21
22
|
} from "../src/runner.mjs";
|
|
@@ -385,6 +386,25 @@ function pump() {
|
|
|
385
386
|
|
|
386
387
|
async function executePrompt(assignment) {
|
|
387
388
|
const promptId = assignment.prompt_id;
|
|
389
|
+
let lastProgressMessage;
|
|
390
|
+
const reportProgress = (message) => {
|
|
391
|
+
if (
|
|
392
|
+
!message ||
|
|
393
|
+
message === lastProgressMessage ||
|
|
394
|
+
socket.readyState !== WebSocket.OPEN ||
|
|
395
|
+
active?.runId !== promptId
|
|
396
|
+
) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
lastProgressMessage = message;
|
|
400
|
+
socket.send(
|
|
401
|
+
JSON.stringify({
|
|
402
|
+
type: "prompt.progress",
|
|
403
|
+
prompt_id: promptId,
|
|
404
|
+
message: String(message).slice(0, 500),
|
|
405
|
+
}),
|
|
406
|
+
);
|
|
407
|
+
};
|
|
388
408
|
console.log(
|
|
389
409
|
`Answering ${assignment.purpose || "project"} prompt with ${codingAgent.name}.`,
|
|
390
410
|
);
|
|
@@ -393,6 +413,7 @@ async function executePrompt(assignment) {
|
|
|
393
413
|
onProcess: (child) => {
|
|
394
414
|
if (active?.runId === promptId) active.child = child;
|
|
395
415
|
},
|
|
416
|
+
onEvent: (event) => reportProgress(promptProgressMessage(event)),
|
|
396
417
|
});
|
|
397
418
|
config = {
|
|
398
419
|
...config,
|
package/package.json
CHANGED
package/src/runner.mjs
CHANGED
|
@@ -570,6 +570,31 @@ export function assessmentProgressMessage(event) {
|
|
|
570
570
|
return null;
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
+
export function promptProgressMessage(event) {
|
|
574
|
+
if (!event || typeof event !== "object") return null;
|
|
575
|
+
if (event.type === "turn.started")
|
|
576
|
+
return "Reviewing the request and workspace context";
|
|
577
|
+
if (event.type === "item.started") {
|
|
578
|
+
if (event.item?.type === "command_execution") {
|
|
579
|
+
return assessmentCommandMilestone(event.item.command);
|
|
580
|
+
}
|
|
581
|
+
if (event.item?.type === "mcp_tool_call")
|
|
582
|
+
return "Checking connected project evidence";
|
|
583
|
+
if (event.item?.type === "web_search")
|
|
584
|
+
return "Checking an external technical reference";
|
|
585
|
+
return null;
|
|
586
|
+
}
|
|
587
|
+
if (event.type === "item.completed" && event.item?.type === "agent_message") {
|
|
588
|
+
return "Preparing the response";
|
|
589
|
+
}
|
|
590
|
+
if (event.type === "agent.connected") return "Connected to the coding agent";
|
|
591
|
+
if (event.type === "acp.tool_call" || event.type === "acp.tool_call_update") {
|
|
592
|
+
return "Inspecting the workspace with the coding agent";
|
|
593
|
+
}
|
|
594
|
+
if (event.type === "acp.agent_message_chunk") return "Preparing the response";
|
|
595
|
+
return null;
|
|
596
|
+
}
|
|
597
|
+
|
|
573
598
|
function assessmentCommandMilestone(command) {
|
|
574
599
|
const value = Array.isArray(command)
|
|
575
600
|
? command.join(" ")
|