@cortexkit/opencode-magic-context 0.49.36 → 0.49.37
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-969z683s.js → context-ngk2jz60.js} +16 -6
- package/dist/index.js +2 -2
- package/dist/v2/{context-bxr039be.js → context-05x7kr7f.js} +16 -6
- package/dist/v2/fold/host-media.d.ts +7 -3
- package/dist/v2/fold/host-media.d.ts.map +1 -1
- package/dist/v2/server.js +2 -2
- package/package.json +1 -1
|
@@ -739,12 +739,22 @@ function decodeThroughHostSchema(encoded) {
|
|
|
739
739
|
const assetSchema = mediaPart?.fields?.media;
|
|
740
740
|
const encoding = assetSchema?.ast?.encoding;
|
|
741
741
|
const decode = Array.isArray(encoding) ? encoding[0]?.transformation?.decode : undefined;
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
742
|
+
const getter = decode;
|
|
743
|
+
let asset;
|
|
744
|
+
if (getter?._tag === "Transform") {
|
|
745
|
+
if (typeof getter.transform !== "function")
|
|
746
|
+
return "host media schema has no decode transformation";
|
|
747
|
+
asset = getter.transform(encoded);
|
|
748
|
+
} else {
|
|
749
|
+
if (getter?._tag !== undefined)
|
|
750
|
+
return `host media schema has unsupported decode transformation: ${String(getter._tag)}`;
|
|
751
|
+
const run = getter?.run;
|
|
752
|
+
if (typeof run !== "function")
|
|
753
|
+
return "host media schema has no decode transformation";
|
|
754
|
+
const result = run.call(decode, { _tag: "Some", value: encoded }, {});
|
|
755
|
+
const option = result?._tag === "Success" ? result.value : undefined;
|
|
756
|
+
asset = option?._tag === "Some" ? option.value : undefined;
|
|
757
|
+
}
|
|
748
758
|
if (!isClassInstance(asset) || asset.source !== source)
|
|
749
759
|
return "host media schema decode did not return an asset";
|
|
750
760
|
return asset;
|
package/dist/index.js
CHANGED
|
@@ -8205,7 +8205,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8205
8205
|
// package.json
|
|
8206
8206
|
var package_default = {
|
|
8207
8207
|
name: "@cortexkit/opencode-magic-context",
|
|
8208
|
-
version: "0.49.
|
|
8208
|
+
version: "0.49.37",
|
|
8209
8209
|
type: "module",
|
|
8210
8210
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8211
8211
|
main: "dist/index.js",
|
|
@@ -12059,7 +12059,7 @@ async function setup(context) {
|
|
|
12059
12059
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12060
12060
|
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.`);
|
|
12061
12061
|
}
|
|
12062
|
-
const { registerContext } = await import("./context-
|
|
12062
|
+
const { registerContext } = await import("./context-ngk2jz60.js");
|
|
12063
12063
|
setHarness2("opencode2");
|
|
12064
12064
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12065
12065
|
const duties = await registerContext(context);
|
|
@@ -25424,12 +25424,22 @@ function decodeThroughHostSchema(encoded) {
|
|
|
25424
25424
|
const assetSchema = mediaPart?.fields?.media;
|
|
25425
25425
|
const encoding = assetSchema?.ast?.encoding;
|
|
25426
25426
|
const decode = Array.isArray(encoding) ? encoding[0]?.transformation?.decode : undefined;
|
|
25427
|
-
const
|
|
25428
|
-
|
|
25429
|
-
|
|
25430
|
-
|
|
25431
|
-
|
|
25432
|
-
|
|
25427
|
+
const getter = decode;
|
|
25428
|
+
let asset;
|
|
25429
|
+
if (getter?._tag === "Transform") {
|
|
25430
|
+
if (typeof getter.transform !== "function")
|
|
25431
|
+
return "host media schema has no decode transformation";
|
|
25432
|
+
asset = getter.transform(encoded);
|
|
25433
|
+
} else {
|
|
25434
|
+
if (getter?._tag !== undefined)
|
|
25435
|
+
return `host media schema has unsupported decode transformation: ${String(getter._tag)}`;
|
|
25436
|
+
const run = getter?.run;
|
|
25437
|
+
if (typeof run !== "function")
|
|
25438
|
+
return "host media schema has no decode transformation";
|
|
25439
|
+
const result = run.call(decode, { _tag: "Some", value: encoded }, {});
|
|
25440
|
+
const option = result?._tag === "Success" ? result.value : undefined;
|
|
25441
|
+
asset = option?._tag === "Some" ? option.value : undefined;
|
|
25442
|
+
}
|
|
25433
25443
|
if (!isClassInstance(asset) || asset.source !== source)
|
|
25434
25444
|
return "host media schema decode did not return an asset";
|
|
25435
25445
|
return asset;
|
|
@@ -15,9 +15,13 @@
|
|
|
15
15
|
* 2. The host's own schema, reached from the draft message's class:
|
|
16
16
|
* `Message.fields.content.value` (the content-part union) → the member whose `type` is
|
|
17
17
|
* the literal "media" → `fields.media` (`Media.AssetSchema`) → `ast.encoding[0]
|
|
18
|
-
* .transformation.decode
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* .transformation.decode`. OpenCode 2.0.22 (Effect 4.0.0-rc.112) exposes a getter whose
|
|
19
|
+
* `run(some(encoded), {})` returns `Success(some(asset))`. OpenCode 2.2.3 (Effect 4.0.6)
|
|
20
|
+
* uses a plain `{ _tag: "Transform", transform }` getter whose `transform(encoded)`
|
|
21
|
+
* returns the asset directly. Both invoke the host's `new Asset(encoded)`. Other getter
|
|
22
|
+
* tags are unavailable: they need optional/effectful evaluation rather than a direct
|
|
23
|
+
* synchronous transform. This depends on Effect Schema internals, so every step is
|
|
24
|
+
* checked and any mismatch counts as unavailable.
|
|
21
25
|
*/
|
|
22
26
|
type Part = Record<string, unknown>;
|
|
23
27
|
/** Test hook: forget what earlier drafts taught this process. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-media.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/host-media.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"host-media.d.ts","sourceRoot":"","sources":["../../../src/v2/fold/host-media.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAgBpC,iEAAiE;AACjE,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C;AAED,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,IAAI,CAgBxE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAe7C;AAwCD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE/E;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CA0BjE"}
|
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.37",
|
|
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-05x7kr7f.js");
|
|
8200
8200
|
setHarness2("opencode2");
|
|
8201
8201
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
8202
8202
|
const duties = await registerContext(context);
|
package/package.json
CHANGED