opencode-supermemory 0.1.4 → 0.1.5
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 +18 -7
- package/dist/services/compaction.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14136,7 +14136,7 @@ function createCompactionHook(ctx, tags, options) {
|
|
|
14136
14136
|
const projectMemories = await fetchProjectMemoriesForCompaction();
|
|
14137
14137
|
const prompt = createCompactionPrompt(projectMemories);
|
|
14138
14138
|
const success2 = injectHookMessage(summarizeCtx.sessionID, prompt, {
|
|
14139
|
-
agent:
|
|
14139
|
+
agent: summarizeCtx.agent,
|
|
14140
14140
|
model: { providerID: summarizeCtx.providerID, modelID: summarizeCtx.modelID },
|
|
14141
14141
|
path: { cwd: summarizeCtx.directory }
|
|
14142
14142
|
});
|
|
@@ -14175,8 +14175,18 @@ ${summaryContent}`, tags.project, { type: "conversation" });
|
|
|
14175
14175
|
const tokens = lastAssistant.tokens;
|
|
14176
14176
|
if (!tokens)
|
|
14177
14177
|
return;
|
|
14178
|
-
|
|
14179
|
-
|
|
14178
|
+
let modelID = lastAssistant.modelID ?? "";
|
|
14179
|
+
let providerID = lastAssistant.providerID ?? "";
|
|
14180
|
+
let agent;
|
|
14181
|
+
const messageDir = getMessageDir(sessionID);
|
|
14182
|
+
const storedMessage = messageDir ? findNearestMessageWithFields(messageDir) : null;
|
|
14183
|
+
if (!providerID || !modelID) {
|
|
14184
|
+
if (storedMessage?.model?.providerID)
|
|
14185
|
+
providerID = storedMessage.model.providerID;
|
|
14186
|
+
if (storedMessage?.model?.modelID)
|
|
14187
|
+
modelID = storedMessage.model.modelID;
|
|
14188
|
+
}
|
|
14189
|
+
agent = storedMessage?.agent;
|
|
14180
14190
|
if (!isSupportedModel(modelID)) {
|
|
14181
14191
|
log("[compaction] skipping unsupported model", { modelID });
|
|
14182
14192
|
return;
|
|
@@ -14217,7 +14227,8 @@ ${summaryContent}`, tags.project, { type: "conversation" });
|
|
|
14217
14227
|
providerID,
|
|
14218
14228
|
modelID,
|
|
14219
14229
|
usageRatio,
|
|
14220
|
-
directory: ctx.directory
|
|
14230
|
+
directory: ctx.directory,
|
|
14231
|
+
agent
|
|
14221
14232
|
});
|
|
14222
14233
|
state.summarizedSessions.add(sessionID);
|
|
14223
14234
|
await ctx.client.session.summarize({
|
|
@@ -14236,12 +14247,12 @@ ${summaryContent}`, tags.project, { type: "conversation" });
|
|
|
14236
14247
|
state.compactionInProgress.delete(sessionID);
|
|
14237
14248
|
setTimeout(async () => {
|
|
14238
14249
|
try {
|
|
14239
|
-
const
|
|
14240
|
-
const
|
|
14250
|
+
const messageDir2 = getMessageDir(sessionID);
|
|
14251
|
+
const storedMessage2 = messageDir2 ? findNearestMessageWithFields(messageDir2) : null;
|
|
14241
14252
|
await ctx.client.session.promptAsync({
|
|
14242
14253
|
path: { id: sessionID },
|
|
14243
14254
|
body: {
|
|
14244
|
-
agent:
|
|
14255
|
+
agent: storedMessage2?.agent,
|
|
14245
14256
|
parts: [{ type: "text", text: "Continue" }]
|
|
14246
14257
|
},
|
|
14247
14258
|
query: { directory: ctx.directory }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/services/compaction.ts"],"names":[],"mappings":"AAsBA,UAAU,SAAS;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACxC;AAED,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CA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