turbowrap-issue-widget 1.0.17 → 1.0.19
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/issue-widget.es.js
CHANGED
|
@@ -82,7 +82,7 @@ class Un {
|
|
|
82
82
|
const i = new TextDecoder();
|
|
83
83
|
let a = "";
|
|
84
84
|
const o = (c) => {
|
|
85
|
-
if (!c.trim()) return;
|
|
85
|
+
if (console.log("[SSE] processEventBlock called, length:", c.length), !c.trim()) return;
|
|
86
86
|
const l = c.split(`
|
|
87
87
|
`);
|
|
88
88
|
let w = "", u = "";
|
|
@@ -94,32 +94,41 @@ class Un {
|
|
|
94
94
|
u += u ? `
|
|
95
95
|
` + Q : Q;
|
|
96
96
|
}
|
|
97
|
-
if (u)
|
|
97
|
+
if (console.log("[SSE] Parsed:", { currentEvent: w, hasData: !!u, dataPreview: u.substring(0, 100) }), u)
|
|
98
98
|
try {
|
|
99
99
|
const g = JSON.parse(u);
|
|
100
|
-
if (w === "error" || g.error) {
|
|
100
|
+
if (console.log("[SSE] JSON parsed, keys:", Object.keys(g)), w === "error" || g.error) {
|
|
101
101
|
s(String(g.error || g.message || "Unknown error"));
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
g.message && (w === "progress" || w === "log") && e(String(g.message)),
|
|
104
|
+
if (g.message && (w === "progress" || w === "log") && e(String(g.message)), g.questions) {
|
|
105
|
+
console.log("[IssueAPIClient] ✅ Found questions in data, calling onData"), t(g);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (g.identifier || w === "complete") {
|
|
109
|
+
console.log("[IssueAPIClient] SSE complete/data event:", w, g), t(g);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
105
112
|
} catch (g) {
|
|
106
|
-
console.warn("Failed to parse
|
|
113
|
+
console.warn("[SSE] Failed to parse JSON:", g, "Raw data:", u.substring(0, 200));
|
|
107
114
|
}
|
|
108
115
|
};
|
|
109
116
|
try {
|
|
110
117
|
for (; ; ) {
|
|
111
118
|
const { done: c, value: l } = await n.read();
|
|
112
119
|
if (c) {
|
|
113
|
-
a.trim() && (console.log("[IssueAPIClient] Processing remaining buffer on stream end"), o(a));
|
|
120
|
+
console.log("[SSE] Stream done, remaining buffer length:", a.length), a.trim() && (console.log("[IssueAPIClient] Processing remaining buffer on stream end"), o(a));
|
|
114
121
|
break;
|
|
115
122
|
}
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
const w = i.decode(l, { stream: !0 });
|
|
124
|
+
console.log("[SSE] Received chunk, length:", w.length, "preview:", w.substring(0, 80)), a += w.replace(/\r\n/g, `
|
|
125
|
+
`);
|
|
126
|
+
const u = a.split(`
|
|
118
127
|
|
|
119
128
|
`);
|
|
120
|
-
a =
|
|
121
|
-
for (const
|
|
122
|
-
o(
|
|
129
|
+
a = u.pop() || "", console.log("[SSE] Split into", u.length, "events, remaining buffer length:", a.length);
|
|
130
|
+
for (const g of u)
|
|
131
|
+
o(g);
|
|
123
132
|
}
|
|
124
133
|
} finally {
|
|
125
134
|
n.releaseLock();
|
|
@@ -6307,7 +6316,7 @@ const $c = `
|
|
|
6307
6316
|
<line x1="22" y1="2" x2="11" y2="13"/>
|
|
6308
6317
|
<polygon points="22 2 15 22 11 13 2 9 22 2"/>
|
|
6309
6318
|
</svg>`
|
|
6310
|
-
}, cs = "1.0.
|
|
6319
|
+
}, cs = "1.0.19", ls = 100, jc = 50;
|
|
6311
6320
|
class Al {
|
|
6312
6321
|
constructor(A) {
|
|
6313
6322
|
$(this, "config");
|