opencode-lore 0.1.0 → 0.1.1
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/index.ts +6 -3
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -224,9 +224,6 @@ export const LorePlugin: Plugin = async (ctx) => {
|
|
|
224
224
|
|
|
225
225
|
const sessionID = output.messages[0]?.info.sessionID;
|
|
226
226
|
|
|
227
|
-
const lastUserMsg = [...output.messages].reverse().find((m) => m.info.role === "user");
|
|
228
|
-
const statsPart = lastUserMsg?.parts.find((p) => p.type === "text");
|
|
229
|
-
|
|
230
227
|
const result = transform({
|
|
231
228
|
messages: output.messages,
|
|
232
229
|
projectPath,
|
|
@@ -252,6 +249,12 @@ export const LorePlugin: Plugin = async (ctx) => {
|
|
|
252
249
|
backgroundDistill(sessionID);
|
|
253
250
|
}
|
|
254
251
|
|
|
252
|
+
// Look up statsPart AFTER the transform so the PATCHed text is clean
|
|
253
|
+
// (system-reminder wrappers stripped). Looking up before would persist
|
|
254
|
+
// ephemeral system-reminder content, making it visible in the UI.
|
|
255
|
+
const lastUserMsg = [...output.messages].reverse().find((m) => m.info.role === "user");
|
|
256
|
+
const statsPart = lastUserMsg?.parts.find((p) => p.type === "text");
|
|
257
|
+
|
|
255
258
|
if (sessionID && statsPart && lastUserMsg) {
|
|
256
259
|
const loreMeta = {
|
|
257
260
|
layer: result.layer,
|