@cortexkit/opencode-magic-context 0.49.72 → 0.49.74
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/{context-830ksymq.js → context-966c0vdq.js} +86 -11
- package/dist/features/magic-context/transform-decision-log.d.ts +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +4 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +12 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +4 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/pending-materialization.d.ts +4 -1
- package/dist/hooks/magic-context/pending-materialization.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts +0 -1
- package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
- package/dist/{index-64qpnmjb.js → index-238xbkhk.js} +1 -1
- package/dist/{index-yh7hxjxm.js → index-6qqc8ef2.js} +56 -21
- package/dist/{index-y6q5qvdz.js → index-cpmqvc1c.js} +15 -13
- package/dist/{index-q5rcetym.js → index-h2w3kzkt.js} +2 -2
- package/dist/{index-sc5segqg.js → index-k2rk6z1y.js} +2 -2
- package/dist/{index-cw3j0pwy.js → index-ne2awfqp.js} +10 -1
- package/dist/{index-2m1j98fj.js → index-ypm4aa3h.js} +2 -2
- package/dist/{index-w8sv1v0j.js → index-ztjgymb9.js} +15 -6
- package/dist/index.js +30 -27
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +4 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/raw-ordinal-warmup-worker.js +2 -2
- package/dist/{recomp-orchestrator-sa4f2mkj.js → recomp-orchestrator-z0m2vgbe.js} +3 -3
- package/dist/{render-qkjgrg31.js → render-rf6dmb9v.js} +1 -1
- package/dist/{search-archive-cmfs3myg.js → search-archive-myb6n35b.js} +2 -2
- package/dist/{transform-postprocess-phase-ecrcsc2w.js → transform-postprocess-phase-r6t8m6qq.js} +3 -3
- package/dist/v2/{context-q846asea.js → context-f4v3ptyh.js} +140 -26
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/generate.d.ts +1 -0
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/raw-ordinal-warmup-worker.js +2 -2
- package/dist/v2/{recomp-orchestrator-egbf57qa.js → recomp-orchestrator-14bek576.js} +2 -2
- package/dist/v2/{render-47vjswds.js → render-rw6tk2fj.js} +1 -1
- package/dist/v2/{search-archive-3tpaqkg4.js → search-archive-w33x2z9z.js} +2 -2
- package/dist/v2/{server-canf6f29.js → server-11rbew2r.js} +10 -1
- package/dist/v2/{server-4nh02tdw.js → server-ds7y8nmk.js} +1 -1
- package/dist/v2/{server-3jggqcpa.js → server-kya7jvx5.js} +2 -2
- package/dist/v2/{server-wb00e7b0.js → server-yspcz6v9.js} +2 -2
- package/dist/v2/server.js +2 -2
- package/dist/v2/{v2-archive-reader-x1yvzqs8.js → v2-archive-reader-cw9fm88j.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-5bccsgy0.js → wrapup-orchestrator-sk2zx55m.js} +14 -12
- package/dist/{v2-archive-reader-xnnwexnw.js → v2-archive-reader-42chk89p.js} +1 -1
- package/dist/{wrapup-orchestrator-yrpqmwc7.js → wrapup-orchestrator-4sfkj8z4.js} +4 -4
- package/package.json +1 -1
package/dist/v2/server.js
CHANGED
|
@@ -7875,7 +7875,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
7875
7875
|
// package.json
|
|
7876
7876
|
var package_default = {
|
|
7877
7877
|
name: "@cortexkit/opencode-magic-context",
|
|
7878
|
-
version: "0.49.
|
|
7878
|
+
version: "0.49.74",
|
|
7879
7879
|
type: "module",
|
|
7880
7880
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
7881
7881
|
main: "dist/index.js",
|
|
@@ -8196,7 +8196,7 @@ async function setup(context) {
|
|
|
8196
8196
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
8197
8197
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
8198
8198
|
}
|
|
8199
|
-
const { registerContext } = await import("./context-
|
|
8199
|
+
const { registerContext } = await import("./context-f4v3ptyh.js");
|
|
8200
8200
|
setHarness2("opencode2");
|
|
8201
8201
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
8202
8202
|
const duties = await registerContext(context);
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
renewCompartmentLease,
|
|
11
11
|
releaseCompartmentLeaseBestEffort,
|
|
12
12
|
getCompartments,
|
|
13
|
-
getLastCompartmentEndMessage
|
|
14
|
-
|
|
13
|
+
getLastCompartmentEndMessage,
|
|
14
|
+
requestPendingMaterialization
|
|
15
|
+
} from "./server-11rbew2r.js";
|
|
15
16
|
import"./server-2amn2s73.js";
|
|
16
17
|
import"./server-y8xjr8rx.js";
|
|
17
18
|
import"./server-x6fn9x8q.js";
|
|
@@ -63,7 +64,7 @@ import {
|
|
|
63
64
|
registerActiveCompartmentRun,
|
|
64
65
|
setRecompStarting2,
|
|
65
66
|
setRecompTerminal2
|
|
66
|
-
} from "./server-
|
|
67
|
+
} from "./server-kya7jvx5.js";
|
|
67
68
|
import"./server-qt1qqasc.js";
|
|
68
69
|
import"./server-t091cjj4.js";
|
|
69
70
|
import"./server-jtq03rkb.js";
|
|
@@ -118,11 +119,6 @@ function formatAlreadyRunningMessage(state) {
|
|
|
118
119
|
const through = state.lastCompartmentEnd > 0 ? ` through message ${state.lastCompartmentEnd}` : "";
|
|
119
120
|
return `/ctx-wrapup is already running for this session${chunk}${through}. Wait for it to finish, then run /ctx-wrapup again if more history remains.`;
|
|
120
121
|
}
|
|
121
|
-
function appendFlushHint(ctx, sessionId, message) {
|
|
122
|
-
if (ctx.hasPendingNaturalBust?.(sessionId))
|
|
123
|
-
return message;
|
|
124
|
-
return `${message} If you want it applied on the very next message, run /ctx-flush first.`;
|
|
125
|
-
}
|
|
126
122
|
function buildPlan(ctx, sessionId, messagesToKeep, anchorRawMessageCount) {
|
|
127
123
|
return resolveWrapupProtectedTailBoundary({
|
|
128
124
|
db: ctx.db,
|
|
@@ -308,8 +304,8 @@ ${message}`;
|
|
|
308
304
|
|
|
309
305
|
${message}`;
|
|
310
306
|
}
|
|
311
|
-
|
|
312
|
-
|
|
307
|
+
let startLastEnd = getLastCompartmentEndMessage(ctx.db, sessionId);
|
|
308
|
+
let startCompartmentCount = getCompartments(ctx.db, sessionId).length;
|
|
313
309
|
let chunkIndex = 0;
|
|
314
310
|
let lastEnd = startLastEnd;
|
|
315
311
|
let stoppedForFailure = false;
|
|
@@ -353,6 +349,9 @@ ${message}`;
|
|
|
353
349
|
if (activeAtStart === "timeout") {
|
|
354
350
|
stoppedForFailure = true;
|
|
355
351
|
stoppedReason = "Timed out waiting for the active historian run.";
|
|
352
|
+
} else {
|
|
353
|
+
startLastEnd = lastEnd = getLastCompartmentEndMessage(ctx.db, sessionId);
|
|
354
|
+
startCompartmentCount = getCompartments(ctx.db, sessionId).length;
|
|
356
355
|
}
|
|
357
356
|
if (!stoppedForFailure) {
|
|
358
357
|
try {
|
|
@@ -460,8 +459,11 @@ ${message}`;
|
|
|
460
459
|
try {
|
|
461
460
|
clearEmergencyRecovery(ctx.db, sessionId);
|
|
462
461
|
} catch {}
|
|
463
|
-
|
|
464
|
-
|
|
462
|
+
let message = `Wrapped up ${messagesWrapped} messages into ${compartmentsCreated} compartments.`;
|
|
463
|
+
if (compartmentsCreated > 0) {
|
|
464
|
+
requestPendingMaterialization(ctx.liveSessionState.pendingMaterializationSessions, sessionId, "user_wrapup");
|
|
465
|
+
message += " The compacted history applies on your next message, or on the next rebuild if the host restarts first.";
|
|
466
|
+
}
|
|
465
467
|
setRecompTerminal2(ctx.liveSessionState, sessionId, "done", message);
|
|
466
468
|
return message;
|
|
467
469
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runManagedWrapup2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
5
|
-
import"./index-
|
|
3
|
+
} from "./index-cpmqvc1c.js";
|
|
4
|
+
import"./index-h2w3kzkt.js";
|
|
5
|
+
import"./index-k2rk6z1y.js";
|
|
6
6
|
import"./index-832w615x.js";
|
|
7
7
|
import"./index-sd3egckz.js";
|
|
8
8
|
import"./index-ve863q40.js";
|
|
@@ -10,7 +10,7 @@ import"./index-q9ywd8b2.js";
|
|
|
10
10
|
import"./index-jjvbk92s.js";
|
|
11
11
|
import"./index-9swgykdd.js";
|
|
12
12
|
import"./index-4dhv7mqz.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-ne2awfqp.js";
|
|
14
14
|
import"./index-tebcx987.js";
|
|
15
15
|
import"./index-etm62gd7.js";
|
|
16
16
|
import"./index-2amn2s73.js";
|
package/package.json
CHANGED