@xqli02/mneme 0.1.10 → 0.1.12
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/package.json +1 -1
- package/src/commands/auto.mjs +1183 -208
- package/src/opencode-client.mjs +11 -1
package/src/opencode-client.mjs
CHANGED
|
@@ -65,7 +65,17 @@ export function createClient(baseUrl) {
|
|
|
65
65
|
} else if (line.startsWith("data:")) {
|
|
66
66
|
const data = line.slice(5).trim();
|
|
67
67
|
try {
|
|
68
|
-
|
|
68
|
+
const parsed = JSON.parse(data);
|
|
69
|
+
// opencode sends all fields in data JSON: {type, properties, ...}
|
|
70
|
+
// Merge into currentEvent, but prefer explicit event: line if present
|
|
71
|
+
if (parsed && typeof parsed === "object") {
|
|
72
|
+
if (!currentEvent.type && parsed.type) {
|
|
73
|
+
currentEvent.type = parsed.type;
|
|
74
|
+
}
|
|
75
|
+
currentEvent.properties = parsed.properties || parsed;
|
|
76
|
+
} else {
|
|
77
|
+
currentEvent.properties = parsed;
|
|
78
|
+
}
|
|
69
79
|
} catch {
|
|
70
80
|
currentEvent.properties = data;
|
|
71
81
|
}
|