@cortexkit/opencode-magic-context 0.42.1 → 0.42.3
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/{conflict-warning-hook-6p3xqeac.js → conflict-warning-hook-aedp084d.js} +3 -3
- package/dist/features/magic-context/compaction-marker.d.ts +4 -10
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/expire-memories.d.ts +15 -0
- package/dist/features/magic-context/dreamer/expire-memories.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/module-apply.d.ts +4 -2
- package/dist/features/magic-context/dreamer/module-apply.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts +6 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +4 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +4 -6
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +2 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +4 -4
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/{index-36wd1d6k.js → index-ecz14qke.js} +1 -1
- package/dist/{index-nqgjwfzn.js → index-gynz8qdc.js} +1 -1
- package/dist/{index-jmtjh2d3.js → index-sf6x1ga9.js} +1 -1
- package/dist/{index-1q9kay7n.js → index-wde5446v.js} +86 -59
- package/dist/{index-1974jvn3.js → index-z8552w7e.js} +1 -1
- package/dist/index.js +331 -125
- package/dist/plugin/dream-timer-module-client.d.ts +2 -2
- package/dist/plugin/dream-timer-module-client.d.ts.map +1 -1
- package/dist/{recomp-orchestrator-m33b3rk9.js → recomp-orchestrator-447vycpt.js} +4 -4
- package/dist/{send-session-notification-1qeqkswb.js → send-session-notification-2mzgd3zf.js} +2 -2
- package/dist/shared/transcript.d.ts +2 -1
- package/dist/shared/transcript.d.ts.map +1 -1
- package/dist/{storage-meta-session-e6g0mmec.js → storage-meta-session-fkmfhswa.js} +2 -2
- package/dist/v2/server.d.ts +6 -0
- package/dist/v2/server.d.ts.map +1 -0
- package/dist/v2/server.js +10 -0
- package/dist/v2/store-reader.d.ts +63 -0
- package/dist/v2/store-reader.d.ts.map +1 -0
- package/package.json +7 -2
- package/src/shared/tag-transcript.ts +14 -7
- package/src/shared/transcript.ts +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AuthorityStatus } from "../features/magic-context/context-authority";
|
|
1
|
+
import type { AuthorityModuleClient, AuthorityStatus } from "../features/magic-context/context-authority";
|
|
2
2
|
import type { ClassifyModuleClient } from "../features/magic-context/dreamer/classify";
|
|
3
3
|
import type { RustModeModuleClient } from "../hooks/magic-context/rust-mode-transform";
|
|
4
|
-
export type DreamTimerModuleClient = ClassifyModuleClient & {
|
|
4
|
+
export type DreamTimerModuleClient = ClassifyModuleClient & Pick<AuthorityModuleClient, "mirrorPull"> & {
|
|
5
5
|
authorityStatus?: (args: {
|
|
6
6
|
context_store_uuid: string;
|
|
7
7
|
project: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dream-timer-module-client.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer-module-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dream-timer-module-client.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer-module-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,qBAAqB,EACrB,eAAe,EAClB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAER,oBAAoB,EACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,GACrD,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,GAAG;IACxC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE;QACrB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;KAChC,KAAK,OAAO,CAAC;QAAE,SAAS,EAAE,eAAe,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACxD,CAAC;AAEN;;;GAGG;AACH,wBAAgB,4BAA4B,CACxC,YAAY,EAAE,oBAAoB,GAAG,SAAS,GAC/C,sBAAsB,GAAG,SAAS,CAsBpC"}
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
setRecompTerminal2,
|
|
4
4
|
runManagedRecomp2,
|
|
5
5
|
runManagedUpgrade2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-wde5446v.js";
|
|
7
7
|
import"./index-xdtge3y2.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-sf6x1ga9.js";
|
|
9
9
|
import"./index-sd3egckz.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
import"./index-gynz8qdc.js";
|
|
11
|
+
import"./index-z8552w7e.js";
|
|
12
12
|
import"./index-jdxxq8cz.js";
|
|
13
13
|
import"./index-dkv2dn46.js";
|
|
14
14
|
export {
|
package/dist/{send-session-notification-1qeqkswb.js → send-session-notification-2mzgd3zf.js}
RENAMED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
clearIgnoredMessages2,
|
|
6
6
|
observeIgnoredNotificationEvent2,
|
|
7
7
|
sendStatusNotification2
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-gynz8qdc.js";
|
|
9
|
+
import"./index-z8552w7e.js";
|
|
10
10
|
import"./index-dkv2dn46.js";
|
|
11
11
|
export {
|
|
12
12
|
clearIgnoredMessages2 as clearIgnoredMessages,
|
|
@@ -150,7 +150,8 @@ export interface TranscriptPart {
|
|
|
150
150
|
/** Remove one half of a complete tool arc. Callers must remove both halves together. */
|
|
151
151
|
remove?(): boolean;
|
|
152
152
|
/** Refuse structural deletion when the adapter cannot match provider-native identity safely. */
|
|
153
|
-
|
|
153
|
+
/** A deferred durable decision vetoes the whole drop, including sentinel fallback. */
|
|
154
|
+
canRemove?(): boolean | "defer";
|
|
154
155
|
/**
|
|
155
156
|
* Optional: serialized byte size of the part's REAL payload, including
|
|
156
157
|
* non-text content (images, structured data) that `getText()` can't
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../src/shared/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GACxB,MAAM,GACN,UAAU,GACV,UAAU,GACV,aAAa,GACb,OAAO,GACP,MAAM,GACN,YAAY,GACZ,SAAS,CAAC;AAEhB;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAElC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC;;;;;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;GASG;AACH,MAAM,WAAW,UAAU;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAEvC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAE5B;;;;;;;;;;;;;OAaG;IACH,MAAM,IAAI,IAAI,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAAiC,CAAC"}
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
retryPendingSessionCleanups2,
|
|
7
7
|
retryPendingRustSessionCleanupsForProject2,
|
|
8
8
|
clearSession2
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-sf6x1ga9.js";
|
|
10
|
+
import"./index-z8552w7e.js";
|
|
11
11
|
import"./index-dkv2dn46.js";
|
|
12
12
|
export {
|
|
13
13
|
advanceToolReclaimWatermark2 as advanceToolReclaimWatermark,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/v2/server.ts"],"names":[],"mappings":";;;;AACA,wBAKE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Source rule: oc-audit-7a31b5c0f7.md:186-202; sanitization follows owner R16.
|
|
2
|
+
* The real GA CLI 2.0.3 placement probe confirms OPENCODE_DB is honoured.
|
|
3
|
+
* Isolation must still use private XDG roots, not rely solely on the filename.
|
|
4
|
+
*/
|
|
5
|
+
export declare function sourceDatabaseFilename(channel: string, env?: NodeJS.ProcessEnv): string;
|
|
6
|
+
/** GA data root: aft-playbook-fe8d4871f.md:46-48, with the CLI filename rule. */
|
|
7
|
+
export declare function gaDatabasePath(dataHome: string, channel?: string, env?: NodeJS.ProcessEnv): string;
|
|
8
|
+
export type MessageType = "agent-switched" | "model-switched" | "location-switched" | "user" | "synthetic" | "system" | "skill" | "shell" | "assistant" | "compaction" | "idle";
|
|
9
|
+
export interface MessageData {
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
content?: Array<Record<string, unknown>>;
|
|
12
|
+
text?: string;
|
|
13
|
+
tokens?: {
|
|
14
|
+
input: number;
|
|
15
|
+
output: number;
|
|
16
|
+
reasoning: number;
|
|
17
|
+
cache: {
|
|
18
|
+
read: number;
|
|
19
|
+
write: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
time?: {
|
|
23
|
+
created: number;
|
|
24
|
+
completed?: number;
|
|
25
|
+
streamed?: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface IdleData extends MessageData {
|
|
29
|
+
outcome: "succeeded" | "failed" | "interrupted";
|
|
30
|
+
}
|
|
31
|
+
export interface CompactionData extends MessageData {
|
|
32
|
+
status: string;
|
|
33
|
+
summary?: string;
|
|
34
|
+
recent?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface StoreRow<T extends MessageType = MessageType> {
|
|
37
|
+
id: string;
|
|
38
|
+
session_id: string;
|
|
39
|
+
type: T;
|
|
40
|
+
seq: number;
|
|
41
|
+
data: T extends "idle" ? IdleData : T extends "compaction" ? CompactionData : MessageData;
|
|
42
|
+
}
|
|
43
|
+
/** Opens an existing store read-only; missing/corrupt stores propagate errors, never an empty history. */
|
|
44
|
+
export declare class V2StoreReader {
|
|
45
|
+
private readonly db;
|
|
46
|
+
constructor(path: string);
|
|
47
|
+
close(): void;
|
|
48
|
+
/** Exclusive cursor, ascending seq. IDs are not chronological in the v2 store. */
|
|
49
|
+
page(sessionID: string, options?: {
|
|
50
|
+
after?: number;
|
|
51
|
+
limit?: number;
|
|
52
|
+
type?: MessageType;
|
|
53
|
+
}): {
|
|
54
|
+
rows: StoreRow[];
|
|
55
|
+
cursor: number | undefined;
|
|
56
|
+
};
|
|
57
|
+
latestCompaction(sessionID: string): StoreRow<"compaction"> | undefined;
|
|
58
|
+
idleRows(sessionID: string, after?: number): StoreRow<"idle">[];
|
|
59
|
+
/** Include the completed checkpoint itself, matching the host history cut. */
|
|
60
|
+
window(sessionID: string): StoreRow[];
|
|
61
|
+
private all;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=store-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-reader.d.ts","sourceRoot":"","sources":["../../src/v2/store-reader.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,UAAwB,GACrC,MAAM,CASR;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,SAAW,EAClB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACrC,MAAM,CAGR;AAGD,MAAM,MAAM,WAAW,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,MAAM,GACN,WAAW,GACX,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,GACX,YAAY,GACZ,MAAM,CAAC;AACb,MAAM,WAAW,WAAW;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KAC1C,CAAC;IACF,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE;AACD,MAAM,WAAW,QAAS,SAAQ,WAAW;IACzC,OAAO,EAA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"name": "@cortexkit/opencode-magic-context",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "tsc -p ../retina-local-fs/tsconfig.build.json && bun run build:tui && rm -f dist/index.js dist/transformers-web.js dist/transformers-node-wasm.js dist/*-*.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
|
|
37
|
+
"build": "tsc -p ../retina-local-fs/tsconfig.build.json && bun run build:tui && rm -f dist/index.js dist/transformers-web.js dist/transformers-node-wasm.js dist/*-*.js && bun build src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --external onnxruntime-node --external onnxruntime-web --external sharp --external bun:sqlite --external node:sqlite && bun run build:v2 && tsc --emitDeclarationOnly",
|
|
38
|
+
"build:v2": "bun build src/v2/server.ts --outfile dist/v2/server.js --target node --format esm --external @opencode/plugin && bun test src/v2/server.test.ts",
|
|
38
39
|
"build:tui": "bun scripts/build-tui.ts",
|
|
39
40
|
"check:tui-compiled": "bun run build:tui && git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
|
|
40
41
|
"check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
|
|
@@ -69,6 +70,10 @@
|
|
|
69
70
|
"sharp": "^0.35.0"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
73
|
+
"@opencode/plugin": "2.0.3",
|
|
74
|
+
"@opencode/cli": "2.0.3",
|
|
75
|
+
"@opencode/client": "2.0.3",
|
|
76
|
+
"effect": "4.0.0-rc.112",
|
|
72
77
|
"@ai-sdk/anthropic": "3.0.82",
|
|
73
78
|
"@huggingface/transformers": "^4.1.0",
|
|
74
79
|
"@ai-sdk/openai-compatible": "2.0.41",
|
|
@@ -1063,13 +1063,20 @@ function buildAggregateTarget(
|
|
|
1063
1063
|
occurrences.some((occ) => occ.kind === "tool_use") &&
|
|
1064
1064
|
occurrences.some((occ) => occ.kind === "tool_result");
|
|
1065
1065
|
if (!complete) return "incomplete";
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1066
|
+
if (!requiresToolArcSkeleton) {
|
|
1067
|
+
const authorization = occurrences.map((occ) => occ.part.canRemove?.());
|
|
1068
|
+
// A failed durable marker is not permission to substitute a new
|
|
1069
|
+
// skeleton. Keep both halves unchanged and leave the drop queued.
|
|
1070
|
+
if (authorization.includes("defer")) return "incomplete";
|
|
1071
|
+
if (
|
|
1072
|
+
occurrences.every(
|
|
1073
|
+
(occ, index) => occ.part.remove && authorization[index] !== false,
|
|
1074
|
+
)
|
|
1075
|
+
) {
|
|
1076
|
+
let removed = false;
|
|
1077
|
+
for (const occ of occurrences) removed = occ.part.remove?.() || removed;
|
|
1078
|
+
return removed ? "removed" : "absent";
|
|
1079
|
+
}
|
|
1073
1080
|
}
|
|
1074
1081
|
// Adapters without structural removal retain paired sentinels.
|
|
1075
1082
|
const sentinel = `[dropped \u00a7${tagId}\u00a7]`;
|
package/src/shared/transcript.ts
CHANGED
|
@@ -170,7 +170,8 @@ export interface TranscriptPart {
|
|
|
170
170
|
/** Remove one half of a complete tool arc. Callers must remove both halves together. */
|
|
171
171
|
remove?(): boolean;
|
|
172
172
|
/** Refuse structural deletion when the adapter cannot match provider-native identity safely. */
|
|
173
|
-
|
|
173
|
+
/** A deferred durable decision vetoes the whole drop, including sentinel fallback. */
|
|
174
|
+
canRemove?(): boolean | "defer";
|
|
174
175
|
|
|
175
176
|
/**
|
|
176
177
|
* Optional: serialized byte size of the part's REAL payload, including
|