@cortexkit/opencode-magic-context 0.2.2 → 0.2.4
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 +21 -18
- package/dist/cli/prompts.d.ts +2 -5
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli.js +1172 -119
- package/package.json +2 -1
- package/scripts/install.sh +2 -2
package/README.md
CHANGED
|
@@ -25,22 +25,39 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
## What is Magic Context?
|
|
29
|
+
|
|
30
|
+
Your agent should never stop working to manage its own context. Magic Context is an OpenCode plugin that handles it entirely in the background:
|
|
31
|
+
|
|
32
|
+
**1.** Transparent context compaction via a background historian — the main agent keeps working while a separate model compresses older conversation. All operations are **cache-aware** and deferred to avoid wasting cached prefixes.
|
|
33
|
+
|
|
34
|
+
**2.** Cross-session project memory — architecture decisions, constraints, and preferences persist across conversations.
|
|
35
|
+
|
|
36
|
+
**3.** Overnight dreamer agent that consolidates, deduplicates, and promotes memories into canonical facts, plus maintains codebase documentation.
|
|
37
|
+
|
|
38
|
+
**4.** On-demand sidekick that augments prompts with relevant project context.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
28
42
|
## Get Started
|
|
29
43
|
|
|
30
44
|
### Quick Setup (Recommended)
|
|
31
45
|
|
|
32
46
|
Run the interactive setup wizard — it detects your models, configures everything, and handles compatibility:
|
|
33
47
|
|
|
48
|
+
**macOS / Linux:**
|
|
34
49
|
```bash
|
|
35
|
-
# macOS / Linux
|
|
36
50
|
curl -fsSL https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/scripts/install.sh | bash
|
|
51
|
+
```
|
|
37
52
|
|
|
38
|
-
|
|
53
|
+
**Windows (PowerShell):**
|
|
54
|
+
```powershell
|
|
39
55
|
irm https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/scripts/install.ps1 | iex
|
|
56
|
+
```
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
**Or run directly (any OS):**
|
|
59
|
+
```bash
|
|
42
60
|
bunx @cortexkit/opencode-magic-context setup
|
|
43
|
-
npx @cortexkit/opencode-magic-context setup
|
|
44
61
|
```
|
|
45
62
|
|
|
46
63
|
The wizard will:
|
|
@@ -100,20 +117,6 @@ The setup wizard handles this automatically if it detects an oh-my-opencode conf
|
|
|
100
117
|
|
|
101
118
|
---
|
|
102
119
|
|
|
103
|
-
## What is Magic Context?
|
|
104
|
-
|
|
105
|
-
AI coding agents forget everything the moment a conversation gets long enough. Context windows fill up, old messages get dropped, and the agent loses track of decisions it made twenty minutes ago.
|
|
106
|
-
|
|
107
|
-
Magic Context fixes this with a background historian — a separate, lightweight model that compresses older conversation into structured summaries and durable facts while the main agent keeps working. The agent never stops to summarize its own history. It never notices the rewriting happening beneath it.
|
|
108
|
-
|
|
109
|
-
Every mutation is **cache-aware**. Drops and rewrites are queued until the provider's cached prefix expires, so you're not paying to throw away work that's already cached.
|
|
110
|
-
|
|
111
|
-
Across sessions, architecture decisions, constraints, and preferences persist in a **cross-session memory** system. A new conversation starts with everything the previous one learned, without replaying old transcripts.
|
|
112
|
-
|
|
113
|
-
And overnight, a **dreamer** agent consolidates, verifies, and improves memories — checking them against the actual codebase and merging duplicates into clean canonical facts.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
120
|
## What Your Agent Gets
|
|
118
121
|
|
|
119
122
|
Magic Context injects structured context automatically and gives the agent five tools.
|
package/dist/cli/prompts.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { intro, log, note, outro, spinner } from "@clack/prompts";
|
|
2
|
+
export { intro, log, note, outro, spinner };
|
|
2
3
|
export declare function confirm(message: string, defaultYes?: boolean): Promise<boolean>;
|
|
3
4
|
export declare function selectOne(message: string, options: {
|
|
4
5
|
label: string;
|
|
5
6
|
value: string;
|
|
6
7
|
recommended?: boolean;
|
|
7
8
|
}[]): Promise<string>;
|
|
8
|
-
export declare function selectMultiple(message: string, options: {
|
|
9
|
-
label: string;
|
|
10
|
-
value: string;
|
|
11
|
-
}[]): Promise<string[]>;
|
|
12
9
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,EAEL,GAAG,EACH,IAAI,EACJ,KAAK,EAEL,OAAO,EACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAS5C,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAOlF;AAED,wBAAsB,SAAS,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,GACnE,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
package/dist/cli/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/cli/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/cli/setup.ts"],"names":[],"mappings":"AAgIA,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAoJhD"}
|