@cortexkit/opencode-magic-context 0.8.3 → 0.8.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/README.md +17 -7
- package/dist/cli.js +4 -3
- package/dist/config/index.d.ts +3 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29591 -60964
- package/dist/plugin/rpc-handlers.d.ts +11 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -0
- package/dist/shared/conflict-detector.d.ts +0 -4
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/rpc-client.d.ts +16 -0
- package/dist/shared/rpc-client.d.ts.map +1 -0
- package/dist/shared/rpc-notifications.d.ts +21 -0
- package/dist/shared/rpc-notifications.d.ts.map +1 -0
- package/dist/shared/rpc-server.d.ts +17 -0
- package/dist/shared/rpc-server.d.ts.map +1 -0
- package/dist/shared/rpc-types.d.ts +59 -0
- package/dist/shared/rpc-types.d.ts.map +1 -0
- package/dist/shared/rpc-utils.d.ts +8 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -0
- package/dist/tui/data/context-db.d.ts +17 -69
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/shared/conflict-detector.ts +1 -17
- package/src/shared/logger.ts +6 -1
- package/src/shared/rpc-client.ts +123 -0
- package/src/shared/rpc-notifications.ts +44 -0
- package/src/shared/rpc-server.ts +136 -0
- package/src/shared/rpc-types.ts +58 -0
- package/src/shared/rpc-utils.ts +16 -0
- package/src/tui/data/context-db.ts +99 -625
- package/src/tui/index.tsx +53 -55
- package/src/tui/slots/sidebar-content.tsx +8 -7
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<a href="https://www.npmjs.com/package/@cortexkit/opencode-magic-context"><img src="https://img.shields.io/npm/v/@cortexkit/opencode-magic-context?color=blue&style=flat-square" alt="npm"></a>
|
|
10
|
-
<a href="https://www.npmjs.com/package/@cortexkit/opencode-magic-context"><img src="https://img.shields.io/npm/dm/@cortexkit/opencode-magic-context?color=brightgreen&style=flat-square&label=downloads" alt="downloads"></a>
|
|
11
10
|
<a href="https://github.com/cortexkit/opencode-magic-context/stargazers"><img src="https://img.shields.io/github/stars/cortexkit/opencode-magic-context?style=flat-square&color=yellow" alt="stars"></a>
|
|
12
11
|
<a href="https://github.com/cortexkit/opencode-magic-context/commits"><img src="https://img.shields.io/github/last-commit/cortexkit/opencode-magic-context?style=flat-square&color=green" alt="last commit"></a>
|
|
13
12
|
<a href="https://github.com/cortexkit/opencode-magic-context/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT License"></a>
|
|
@@ -71,7 +70,7 @@ irm https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/sc
|
|
|
71
70
|
|
|
72
71
|
**Or run directly (any OS):**
|
|
73
72
|
```bash
|
|
74
|
-
bunx @cortexkit/opencode-magic-context setup
|
|
73
|
+
bunx @cortexkit/opencode-magic-context@latest setup
|
|
75
74
|
```
|
|
76
75
|
|
|
77
76
|
The wizard will:
|
|
@@ -137,7 +136,7 @@ The setup wizard handles this automatically if it detects an oh-my-openagent or
|
|
|
137
136
|
Already installed but something isn't working? Run the doctor to check and auto-fix configuration issues:
|
|
138
137
|
|
|
139
138
|
```bash
|
|
140
|
-
bunx @cortexkit/opencode-magic-context doctor
|
|
139
|
+
bunx @cortexkit/opencode-magic-context@latest doctor
|
|
141
140
|
```
|
|
142
141
|
|
|
143
142
|
Doctor checks for conflicts (compaction, DCP, OMO hooks), ensures the TUI sidebar is configured, verifies the plugin is registered, and checks the npm cache — fixing what it can automatically.
|
|
@@ -145,7 +144,7 @@ Doctor checks for conflicts (compaction, DCP, OMO hooks), ensures the TUI sideba
|
|
|
145
144
|
Use `--force` to force-clear the plugin cache even when versions match (fixes broken transitive dependencies):
|
|
146
145
|
|
|
147
146
|
```bash
|
|
148
|
-
bunx @cortexkit/opencode-magic-context doctor --force
|
|
147
|
+
bunx @cortexkit/opencode-magic-context@latest doctor --force
|
|
149
148
|
```
|
|
150
149
|
|
|
151
150
|
---
|
|
@@ -307,7 +306,7 @@ The TUI plugin is configured automatically by the setup wizard and the `doctor`
|
|
|
307
306
|
|
|
308
307
|
### Startup conflict detection
|
|
309
308
|
|
|
310
|
-
On startup, Magic Context checks for common configuration problems — OpenCode's built-in compaction being enabled, DCP plugin being active alongside Magic Context, or conflicting oh-my-openagent hooks. When conflicts are detected, it warns the active session with a fix suggestion pointing to `bunx @cortexkit/opencode-magic-context doctor`.
|
|
309
|
+
On startup, Magic Context checks for common configuration problems — OpenCode's built-in compaction being enabled, DCP plugin being active alongside Magic Context, or conflicting oh-my-openagent hooks. When conflicts are detected, it warns the active session with a fix suggestion pointing to `bunx @cortexkit/opencode-magic-context@latest doctor`.
|
|
311
310
|
|
|
312
311
|
---
|
|
313
312
|
|
|
@@ -328,8 +327,7 @@ On startup, Magic Context checks for common configuration problems — OpenCode'
|
|
|
328
327
|
A companion desktop app for browsing and managing Magic Context state outside of OpenCode.
|
|
329
328
|
|
|
330
329
|
<p align="center">
|
|
331
|
-
|
|
332
|
-
</p>
|
|
330
|
+
<a href="https://github.com/cortexkit/opencode-magic-context/releases/tag/dashboard-v0.2.4"><strong>⬇️ Download for macOS · Windows · Linux</strong></a></p>
|
|
333
331
|
|
|
334
332
|
**Features:**
|
|
335
333
|
- **Memory Browser** — search, filter, and edit project memories with category and project filtering
|
|
@@ -387,6 +385,18 @@ All durable states live in a local SQLite database. If the database can't be ope
|
|
|
387
385
|
|
|
388
386
|
---
|
|
389
387
|
|
|
388
|
+
## Star History
|
|
389
|
+
|
|
390
|
+
<a href="https://www.star-history.com/?repos=cortexkit%2Fopencode-magic-context&type=date&legend=bottom-right">
|
|
391
|
+
<picture>
|
|
392
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=cortexkit/opencode-magic-context&type=date&theme=dark&legend=top-left" />
|
|
393
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=cortexkit/opencode-magic-context&type=date&legend=top-left" />
|
|
394
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=cortexkit/opencode-magic-context&type=date&legend=top-left" />
|
|
395
|
+
</picture>
|
|
396
|
+
</a>
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
390
400
|
## Development
|
|
391
401
|
|
|
392
402
|
**Requirements:** [Bun](https://bun.sh) ≥ 1.0
|
package/dist/cli.js
CHANGED
|
@@ -8355,7 +8355,8 @@ function log(message, data) {
|
|
|
8355
8355
|
return;
|
|
8356
8356
|
try {
|
|
8357
8357
|
const timestamp = new Date().toISOString();
|
|
8358
|
-
const serialized = data === undefined ? "" : ` ${
|
|
8358
|
+
const serialized = data === undefined ? "" : data instanceof Error ? ` ${data.message}${data.stack ? `
|
|
8359
|
+
${data.stack}` : ""}` : ` ${JSON.stringify(data)}`;
|
|
8359
8360
|
buffer.push(`[${timestamp}] ${message}${serialized}
|
|
8360
8361
|
`);
|
|
8361
8362
|
if (buffer.length >= BUFFER_SIZE_LIMIT) {
|
|
@@ -10116,8 +10117,8 @@ if (command === "setup") {
|
|
|
10116
10117
|
console.log(" doctor --force Force clear plugin cache (fixes broken dependencies)");
|
|
10117
10118
|
console.log("");
|
|
10118
10119
|
console.log(" Usage:");
|
|
10119
|
-
console.log(" bunx @cortexkit/opencode-magic-context setup");
|
|
10120
|
-
console.log(" bunx @cortexkit/opencode-magic-context doctor");
|
|
10120
|
+
console.log(" bunx @cortexkit/opencode-magic-context@latest setup");
|
|
10121
|
+
console.log(" bunx @cortexkit/opencode-magic-context@latest doctor");
|
|
10121
10122
|
console.log("");
|
|
10122
10123
|
process.exit(command ? 1 : 0);
|
|
10123
10124
|
}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -9,5 +9,7 @@ export interface MagicContextPluginConfig extends MagicContextConfig {
|
|
|
9
9
|
subtask?: boolean;
|
|
10
10
|
}>;
|
|
11
11
|
}
|
|
12
|
-
export declare function loadPluginConfig(directory: string): MagicContextPluginConfig
|
|
12
|
+
export declare function loadPluginConfig(directory: string): MagicContextPluginConfig & {
|
|
13
|
+
configWarnings?: string[];
|
|
14
|
+
};
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAE3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAE3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;AAyID,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,MAAM,GAClB,wBAAwB,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAmC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/features/builtin-commands/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/features/builtin-commands/commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,8BAA8B,IAAI,oBAAoB,CAwBrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-handler.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/command-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EACH,KAAK,cAAc,EAGtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"command-handler.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/command-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EACH,KAAK,cAAc,EAGtB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,KAAK,EAAE,aAAa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AAE,MAAM,CAAC;QAC1B,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;KACnC,CAAC;IACF,OAAO,CAAC,EAAE;QACN,MAAM,EAAE,aAAa,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;QACrE,wBAAwB,CAAC,EAAE;YAAE,OAAO,EAAE,OAAO,CAAC;YAAC,kBAAkB,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5E,uBAAuB,CAAC,EAAE;YACtB,OAAO,EAAE,OAAO,CAAC;YACjB,YAAY,EAAE,MAAM,CAAC;YACrB,SAAS,EAAE,MAAM,CAAC;SACrB,CAAC;KACL,CAAC;CACL;sCASkB,mBAAmB,WACjB,oBAAoB,WACpB,kBAAkB,KAC5B,OAAO,CAAC,IAAI,CAAC;EA0GvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-session-notification.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/send-session-notification.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAoDD,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,kBAAkB,GAC3B,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"send-session-notification.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/send-session-notification.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAoDD,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,kBAAkB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAyEf;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAChC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAyBlD,QAAA,MAAM,MAAM,EAAE,MA2Ob,CAAC;AAEF,eAAe,MAAM,CAAC"}
|