@dougbots/avenor-core 0.3.2 → 0.3.4
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/dist/index.js +10 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -579,9 +579,11 @@ function sentinelStatusToResult(sentinelStatus) {
|
|
|
579
579
|
}
|
|
580
580
|
function translateStatus(rawPhase, sentinelData) {
|
|
581
581
|
const sentinelStatus = sentinelData?._status;
|
|
582
|
+
if (sentinelStatus && (rawPhase === "running" || rawPhase === "idle")) return sentinelStatusToResult(sentinelStatus);
|
|
582
583
|
switch (rawPhase) {
|
|
583
584
|
case "idle": return sentinelStatus ? sentinelStatusToResult(sentinelStatus) : "running";
|
|
584
585
|
case "running": return "running";
|
|
586
|
+
case "waiting": return "waiting";
|
|
585
587
|
case "ended": return sentinelStatus ? sentinelStatusToResult(sentinelStatus) : "running";
|
|
586
588
|
case "DONE": return "done";
|
|
587
589
|
case "FAILED": return "failed";
|
|
@@ -796,16 +798,15 @@ async function followUpTool(args) {
|
|
|
796
798
|
const followUpRunId = crypto.randomUUID();
|
|
797
799
|
const followUpLabel = args.label ?? `${args.runId}-followup`;
|
|
798
800
|
const { sentinelPath: followUpSentinelPath, eventLogPath } = ensureRunPaths(followUpRunId);
|
|
799
|
-
await client.spawn({
|
|
800
|
-
agent,
|
|
801
|
-
prompt: args.message,
|
|
802
|
-
label: followUpLabel,
|
|
803
|
-
session_id: sentinel.SESSION,
|
|
804
|
-
sentinel_file: followUpSentinelPath,
|
|
805
|
-
on_event: eventLogPath
|
|
806
|
-
});
|
|
807
801
|
return {
|
|
808
|
-
run_id:
|
|
802
|
+
run_id: (await client.spawn({
|
|
803
|
+
agent,
|
|
804
|
+
prompt: args.message,
|
|
805
|
+
label: followUpLabel,
|
|
806
|
+
session_id: sentinel.SESSION,
|
|
807
|
+
sentinel_file: followUpSentinelPath,
|
|
808
|
+
on_event: eventLogPath
|
|
809
|
+
})).runtime_id ?? followUpRunId,
|
|
809
810
|
label: followUpLabel
|
|
810
811
|
};
|
|
811
812
|
} finally {
|