palmier 0.5.8 → 0.6.0
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/rpc-handler.js +7 -1
- package/package.json +1 -1
- package/src/rpc-handler.ts +6 -1
package/dist/rpc-handler.js
CHANGED
|
@@ -41,7 +41,13 @@ function parseResultFrontmatter(raw) {
|
|
|
41
41
|
// determine if it's a task run or follow-up
|
|
42
42
|
const activeStates = ["started", "monitoring", "confirmation"];
|
|
43
43
|
let runningState;
|
|
44
|
-
if (
|
|
44
|
+
if (lastStatus?.type === "monitoring") {
|
|
45
|
+
// Only show monitoring if no assistant/user message came after it
|
|
46
|
+
const lastStatusIdx = messages.lastIndexOf(lastStatus);
|
|
47
|
+
const hasMessageAfter = messages.slice(lastStatusIdx + 1).some((m) => m.role === "assistant" || m.role === "user");
|
|
48
|
+
runningState = hasMessageAfter ? "started" : "monitoring";
|
|
49
|
+
}
|
|
50
|
+
else if (activeStates.includes(lastStatus?.type ?? "")) {
|
|
45
51
|
runningState = terminalMsg ? "followup" : "started";
|
|
46
52
|
}
|
|
47
53
|
else {
|
package/package.json
CHANGED
package/src/rpc-handler.ts
CHANGED
|
@@ -51,7 +51,12 @@ function parseResultFrontmatter(raw: string): Record<string, unknown> {
|
|
|
51
51
|
// determine if it's a task run or follow-up
|
|
52
52
|
const activeStates = ["started", "monitoring", "confirmation"];
|
|
53
53
|
let runningState: string | undefined;
|
|
54
|
-
if (
|
|
54
|
+
if (lastStatus?.type === "monitoring") {
|
|
55
|
+
// Only show monitoring if no assistant/user message came after it
|
|
56
|
+
const lastStatusIdx = messages.lastIndexOf(lastStatus);
|
|
57
|
+
const hasMessageAfter = messages.slice(lastStatusIdx + 1).some((m: ConversationMessage) => m.role === "assistant" || m.role === "user");
|
|
58
|
+
runningState = hasMessageAfter ? "started" : "monitoring";
|
|
59
|
+
} else if (activeStates.includes(lastStatus?.type ?? "")) {
|
|
55
60
|
runningState = terminalMsg ? "followup" : "started";
|
|
56
61
|
} else {
|
|
57
62
|
runningState = lastStatus?.type;
|