@engineeros/connector 0.8.5 → 0.8.6
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 +13 -0
|
@@ -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(" ")
|