@wolfx/opencode-magic-context 0.21.8-patch.1 → 0.21.8
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/hooks/auto-update-checker/constants.d.ts +1 -1
- package/dist/hooks/auto-update-checker/constants.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/shared/conflict-detector.test.ts +4 -4
- package/src/shared/conflict-detector.ts +1 -1
- package/src/shared/conflict-fixer.test.ts +2 -2
- package/src/shared/tui-config.ts +2 -2
- package/src/tui/index.tsx +4 -4
- package/src/tui/slots/sidebar-content.tsx +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PACKAGE_NAME = "@
|
|
1
|
+
export declare const PACKAGE_NAME = "@cortexkit/opencode-magic-context";
|
|
2
2
|
export declare const NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
3
3
|
export declare const NPM_FETCH_TIMEOUT = 10000;
|
|
4
4
|
/** Root directory OpenCode uses for cached npm plugin wrapper installs. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-update-checker/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/auto-update-checker/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,sCAAsC,CAAC;AAChE,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAC7D,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAgBxC,2EAA2E;AAC3E,eAAO,MAAM,SAAS,QAA2C,CAAC;AAElE,gEAAgE;AAChE,eAAO,MAAM,oBAAoB,QAAiD,CAAC;AAEnF,yEAAyE;AACzE,eAAO,MAAM,0BAA0B,QAAkD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -161250,7 +161250,7 @@ function formatConflictShort(result) {
|
|
|
161250
161250
|
"",
|
|
161251
161251
|
...result.reasons.map((r) => `• ${r}`),
|
|
161252
161252
|
"",
|
|
161253
|
-
"Fix: run `npx @
|
|
161253
|
+
"Fix: run `npx @cortexkit/opencode-magic-context@latest doctor`"
|
|
161254
161254
|
];
|
|
161255
161255
|
return lines.join(`
|
|
161256
161256
|
`);
|
|
@@ -167981,7 +167981,7 @@ import { fileURLToPath } from "node:url";
|
|
|
167981
167981
|
// src/hooks/auto-update-checker/constants.ts
|
|
167982
167982
|
import { homedir as homedir4, platform } from "node:os";
|
|
167983
167983
|
import { join as join8 } from "node:path";
|
|
167984
|
-
var PACKAGE_NAME = "@
|
|
167984
|
+
var PACKAGE_NAME = "@cortexkit/opencode-magic-context";
|
|
167985
167985
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
167986
167986
|
var NPM_FETCH_TIMEOUT = 1e4;
|
|
167987
167987
|
function getOpenCodeCacheRoot() {
|
|
@@ -168473,7 +168473,7 @@ async function runStartupCheck(ctx, options) {
|
|
|
168473
168473
|
return;
|
|
168474
168474
|
}
|
|
168475
168475
|
if (options.showStartupToast) {
|
|
168476
|
-
showToast(ctx, `Magic Context ${displayVersion ?? "unknown"}`, "@
|
|
168476
|
+
showToast(ctx, `Magic Context ${displayVersion ?? "unknown"}`, "@cortexkit/opencode-magic-context is active.", "info");
|
|
168477
168477
|
}
|
|
168478
168478
|
await runBackgroundUpdateCheck(ctx, options);
|
|
168479
168479
|
}
|
|
@@ -168499,7 +168499,7 @@ async function runBackgroundUpdateCheck(ctx, options) {
|
|
|
168499
168499
|
});
|
|
168500
168500
|
if (!latestVersion) {
|
|
168501
168501
|
warn3(`[auto-update-checker] Failed to fetch latest version for channel: ${channel}`);
|
|
168502
|
-
showToast(ctx, "Magic Context update check failed", "Could not check npm for @
|
|
168502
|
+
showToast(ctx, "Magic Context update check failed", "Could not check npm for @cortexkit/opencode-magic-context updates. Continuing with the cached version.", "warning", 8000);
|
|
168503
168503
|
return;
|
|
168504
168504
|
}
|
|
168505
168505
|
if (currentVersion === latestVersion) {
|
package/package.json
CHANGED
|
@@ -182,7 +182,7 @@ describe("detectConflicts", () => {
|
|
|
182
182
|
});
|
|
183
183
|
|
|
184
184
|
it("returns no conflicts for unrelated plugins", () => {
|
|
185
|
-
writeProjectConfig(["@
|
|
185
|
+
writeProjectConfig(["@cortexkit/opencode-magic-context@latest", "some-other-plugin"]);
|
|
186
186
|
const result = detectConflicts(projectDir);
|
|
187
187
|
expect(result.hasConflict).toBe(false);
|
|
188
188
|
});
|
|
@@ -195,7 +195,7 @@ describe("detectConflicts", () => {
|
|
|
195
195
|
describe("tuple plugin entries (issue #49)", () => {
|
|
196
196
|
it("does not crash when a plugin is defined as a [name, options] tuple", () => {
|
|
197
197
|
writeProjectConfig([
|
|
198
|
-
"@
|
|
198
|
+
"@cortexkit/opencode-magic-context@latest",
|
|
199
199
|
["@plannotator/opencode@latest", { workflow: "plan-agent" }],
|
|
200
200
|
]);
|
|
201
201
|
expect(() => detectConflicts(projectDir)).not.toThrow();
|
|
@@ -203,7 +203,7 @@ describe("detectConflicts", () => {
|
|
|
203
203
|
|
|
204
204
|
it("detects DCP conflict when DCP is expressed as a tuple", () => {
|
|
205
205
|
writeProjectConfig([
|
|
206
|
-
"@
|
|
206
|
+
"@cortexkit/opencode-magic-context@latest",
|
|
207
207
|
["@tarquinen/opencode-dcp@latest", {}],
|
|
208
208
|
]);
|
|
209
209
|
const result = detectConflicts(projectDir);
|
|
@@ -223,7 +223,7 @@ describe("detectConflicts", () => {
|
|
|
223
223
|
"@plannotator/opencode@latest",
|
|
224
224
|
{ workflow: "plan-agent", planningAgents: ["plan"] },
|
|
225
225
|
],
|
|
226
|
-
"@
|
|
226
|
+
"@cortexkit/opencode-magic-context@latest",
|
|
227
227
|
]);
|
|
228
228
|
const result = detectConflicts(projectDir);
|
|
229
229
|
expect(result.hasConflict).toBe(false);
|
|
@@ -365,7 +365,7 @@ export function formatConflictShort(result: ConflictResult): string {
|
|
|
365
365
|
"",
|
|
366
366
|
...result.reasons.map((r) => `• ${r}`),
|
|
367
367
|
"",
|
|
368
|
-
"Fix: run `npx @
|
|
368
|
+
"Fix: run `npx @cortexkit/opencode-magic-context@latest doctor`",
|
|
369
369
|
];
|
|
370
370
|
return lines.join("\n");
|
|
371
371
|
}
|
|
@@ -50,7 +50,7 @@ describe("fixConflicts", () => {
|
|
|
50
50
|
"plugin": [
|
|
51
51
|
["@plannotator/opencode@latest", { "workflow": "plan-agent" }],
|
|
52
52
|
["@tarquinen/opencode-dcp@latest", { "enabled": true }],
|
|
53
|
-
"@
|
|
53
|
+
"@cortexkit/opencode-magic-context@latest"
|
|
54
54
|
],
|
|
55
55
|
"compaction": {
|
|
56
56
|
// keep this compaction comment
|
|
@@ -76,7 +76,7 @@ describe("fixConflicts", () => {
|
|
|
76
76
|
expect(updated.compaction).toEqual({ auto: false, prune: false });
|
|
77
77
|
expect(updated.plugin).toEqual([
|
|
78
78
|
["@plannotator/opencode@latest", { workflow: "plan-agent" }],
|
|
79
|
-
"@
|
|
79
|
+
"@cortexkit/opencode-magic-context@latest",
|
|
80
80
|
]);
|
|
81
81
|
});
|
|
82
82
|
|
package/src/shared/tui-config.ts
CHANGED
|
@@ -15,8 +15,8 @@ const PLUGIN_ENTRY = `${PLUGIN_NAME}@latest`;
|
|
|
15
15
|
/**
|
|
16
16
|
* Detect whether a tui.json plugin entry already references magic-context, in
|
|
17
17
|
* any form. Covers:
|
|
18
|
-
* - Bare npm name: "@
|
|
19
|
-
* - Versioned npm: "@
|
|
18
|
+
* - Bare npm name: "@cortexkit/opencode-magic-context"
|
|
19
|
+
* - Versioned npm: "@cortexkit/opencode-magic-context@latest" / "@0.15.7" / etc.
|
|
20
20
|
* - Local dev directory path (absolute or relative): ".../magic-context"
|
|
21
21
|
* or ".../magic-context/packages/plugin"
|
|
22
22
|
* - file:// URLs pointing at the same paths
|
package/src/tui/index.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import { fixConflicts } from "../shared/conflict-fixer"
|
|
|
13
13
|
import { readJsoncFile } from "../shared/jsonc-parser"
|
|
14
14
|
import { getOpenCodeConfigPaths } from "../shared/opencode-config-dir"
|
|
15
15
|
|
|
16
|
-
const PLUGIN_NAME = "@
|
|
16
|
+
const PLUGIN_NAME = "@cortexkit/opencode-magic-context"
|
|
17
17
|
|
|
18
18
|
function ensureParentDir(filePath: string) {
|
|
19
19
|
mkdirSync(dirname(filePath), { recursive: true })
|
|
@@ -104,7 +104,7 @@ function showConflictDialog(api: TuiPluginApi, directory: string, reasons: strin
|
|
|
104
104
|
}, 50)
|
|
105
105
|
}}
|
|
106
106
|
onCancel={() => {
|
|
107
|
-
api.ui.toast({ message: "Magic Context remains disabled. Run: npx @
|
|
107
|
+
api.ui.toast({ message: "Magic Context remains disabled. Run: npx @cortexkit/opencode-magic-context@latest doctor", variant: "warning", duration: 5000 })
|
|
108
108
|
}}
|
|
109
109
|
/>
|
|
110
110
|
))
|
|
@@ -130,7 +130,7 @@ function showTuiSetupDialog(api: TuiPluginApi) {
|
|
|
130
130
|
api.ui.dialog.replace(() => (
|
|
131
131
|
<api.ui.DialogAlert
|
|
132
132
|
title="❌ Setup Failed"
|
|
133
|
-
message={'Could not update tui.json automatically. Add the plugin manually:\n\n { "plugin": ["@
|
|
133
|
+
message={'Could not update tui.json automatically. Add the plugin manually:\n\n { "plugin": ["@cortexkit/opencode-magic-context"] }'}
|
|
134
134
|
onConfirm={() => {
|
|
135
135
|
api.ui.toast({ message: "Add plugin to tui.json manually", variant: "warning", duration: 5000 })
|
|
136
136
|
}}
|
|
@@ -153,7 +153,7 @@ function showTuiSetupDialog(api: TuiPluginApi) {
|
|
|
153
153
|
}, 50)
|
|
154
154
|
}}
|
|
155
155
|
onCancel={() => {
|
|
156
|
-
api.ui.toast({ message: "You can add the sidebar later via: npx @
|
|
156
|
+
api.ui.toast({ message: "You can add the sidebar later via: npx @cortexkit/opencode-magic-context@latest doctor", variant: "info", duration: 5000 })
|
|
157
157
|
}}
|
|
158
158
|
/>
|
|
159
159
|
))
|
|
@@ -319,7 +319,7 @@ const SidebarContent = (props: {
|
|
|
319
319
|
borderColor={props.theme.borderActive}
|
|
320
320
|
paddingTop={1}
|
|
321
321
|
paddingBottom={1}
|
|
322
|
-
paddingLeft={
|
|
322
|
+
paddingLeft={1}
|
|
323
323
|
paddingRight={1}
|
|
324
324
|
>
|
|
325
325
|
{/* Header */}
|
|
@@ -465,7 +465,7 @@ const SidebarContent = (props: {
|
|
|
465
465
|
|
|
466
466
|
export function createSidebarContentSlot(api: TuiPluginApi): TuiSlotPlugin {
|
|
467
467
|
return {
|
|
468
|
-
order:
|
|
468
|
+
order: 150,
|
|
469
469
|
slots: {
|
|
470
470
|
sidebar_content: (ctx, value) => {
|
|
471
471
|
const theme = createMemo(() => ctx.theme.current)
|