@tryarcanist/cli 0.1.205 → 0.1.206
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 +24 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2402,6 +2402,7 @@ function createFlattenState() {
|
|
|
2402
2402
|
toolCallIndexById: /* @__PURE__ */ new Map(),
|
|
2403
2403
|
agentProgressIndexByKey: /* @__PURE__ */ new Map(),
|
|
2404
2404
|
questionIndexById: /* @__PURE__ */ new Map(),
|
|
2405
|
+
narrationIndex: null,
|
|
2405
2406
|
malformedSearchBlockedPromptIds: /* @__PURE__ */ new Set(),
|
|
2406
2407
|
malformedSearchBlockedWithoutPrompt: false
|
|
2407
2408
|
};
|
|
@@ -2733,6 +2734,23 @@ function applyTodoUpdate(data, state) {
|
|
|
2733
2734
|
}
|
|
2734
2735
|
}
|
|
2735
2736
|
}
|
|
2737
|
+
function projectNarration(data, state) {
|
|
2738
|
+
const text = typeof data?.text === "string" ? data.text.trim() : "";
|
|
2739
|
+
if (!text) return;
|
|
2740
|
+
const promptId = resolvePromptId(data);
|
|
2741
|
+
const event = {
|
|
2742
|
+
type: "narration",
|
|
2743
|
+
id: "narration",
|
|
2744
|
+
text,
|
|
2745
|
+
...promptId ? { promptId } : {}
|
|
2746
|
+
};
|
|
2747
|
+
if (state.narrationIndex === null) {
|
|
2748
|
+
state.narrationIndex = state.merged.length;
|
|
2749
|
+
state.merged.push(event);
|
|
2750
|
+
} else {
|
|
2751
|
+
state.merged[state.narrationIndex] = event;
|
|
2752
|
+
}
|
|
2753
|
+
}
|
|
2736
2754
|
function flattenSessionEvents(raw) {
|
|
2737
2755
|
const state = createFlattenState();
|
|
2738
2756
|
const normalizedEvents = normalizeRawSessionEvents(raw);
|
|
@@ -2806,6 +2824,9 @@ function flattenSessionEvents(raw) {
|
|
|
2806
2824
|
case "question":
|
|
2807
2825
|
projectQuestion(data, state);
|
|
2808
2826
|
break;
|
|
2827
|
+
case "narration":
|
|
2828
|
+
projectNarration(data, state);
|
|
2829
|
+
break;
|
|
2809
2830
|
}
|
|
2810
2831
|
}
|
|
2811
2832
|
return suppressMalformedSearchSegments(state);
|
|
@@ -3135,6 +3156,9 @@ ${event.answer ? `**Answer:** ${event.answer}
|
|
|
3135
3156
|
return "";
|
|
3136
3157
|
case "agent_progress":
|
|
3137
3158
|
return `*[${event.label}]*
|
|
3159
|
+
`;
|
|
3160
|
+
case "narration":
|
|
3161
|
+
return `*[Currently: ${event.text}]*
|
|
3138
3162
|
`;
|
|
3139
3163
|
case "raw_agent_runtime":
|
|
3140
3164
|
return "";
|