@cortexkit/opencode-magic-context 0.2.2 → 0.2.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/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
- # Windows (PowerShell)
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
- # Or run directly (any OS)
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.
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAUA,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAKlF;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,CAmBjB;AAED,wBAAsB,cAAc,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAC5C,OAAO,CAAC,MAAM,EAAE,CAAC,CAcnB"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAwBA,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,UAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAKlF;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,CAmBjB;AAED,wBAAsB,cAAc,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAC5C,OAAO,CAAC,MAAM,EAAE,CAAC,CAcnB"}
package/dist/cli.js CHANGED
@@ -153,8 +153,17 @@ function buildModelSelection(allModels, role) {
153
153
  }
154
154
 
155
155
  // src/cli/prompts.ts
156
+ import { createReadStream } from "node:fs";
156
157
  import { createInterface } from "node:readline";
157
- var rl = createInterface({ input: process.stdin, output: process.stdout });
158
+ function getInput() {
159
+ if (!process.stdin.isTTY) {
160
+ try {
161
+ return createReadStream("/dev/tty");
162
+ } catch {}
163
+ }
164
+ return process.stdin;
165
+ }
166
+ var rl = createInterface({ input: getInput(), output: process.stdout });
158
167
  function ask(question) {
159
168
  return new Promise((resolve) => {
160
169
  rl.question(question, (answer) => resolve(answer.trim()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.2.2",
3
+ "version": "0.2.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",
@@ -16,11 +16,11 @@ main() {
16
16
  if command -v bun &>/dev/null; then
17
17
  echo " → Using bun"
18
18
  echo ""
19
- bunx "$PACKAGE" setup
19
+ bunx "$PACKAGE" setup </dev/tty
20
20
  elif command -v npx &>/dev/null; then
21
21
  echo " → Using npx"
22
22
  echo ""
23
- npx -y "$PACKAGE" setup
23
+ npx -y "$PACKAGE" setup </dev/tty
24
24
  else
25
25
  echo " ✗ Neither bun nor npx found."
26
26
  echo ""