@tryvira/opencode 0.1.44 → 0.1.46
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 +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1954,9 +1954,10 @@ var v1Fallback = { async server(rawContext = {}) {
|
|
|
1954
1954
|
const persistCompletedText = async (raw) => {
|
|
1955
1955
|
const event = asRecord(raw);
|
|
1956
1956
|
const data = asRecord(event.data ?? event.properties);
|
|
1957
|
-
if (text2(event.type) !== "session.
|
|
1958
|
-
const
|
|
1959
|
-
const
|
|
1957
|
+
if (text2(event.type) !== "session.text.ended") return;
|
|
1958
|
+
const part = asRecord(data.part ?? data.message ?? data.output);
|
|
1959
|
+
const sessionID = text2(data.sessionID ?? data.sessionId ?? part.sessionID ?? part.sessionId);
|
|
1960
|
+
const output = text2(data.text ?? data.content ?? part.text ?? part.content);
|
|
1960
1961
|
if (!sessionID || !output.trim()) return;
|
|
1961
1962
|
const current = identity({ sessionID });
|
|
1962
1963
|
const messageID = text2(data.assistantMessageID) || text2(data.textID) || digest2(output).slice(0, 16);
|