@cortexkit/opencode-magic-context 0.8.11 → 0.8.13
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 +5 -5
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli.js +126 -24
- package/dist/config/schema/magic-context.d.ts +3 -3
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +1 -1
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -1
- package/dist/features/magic-context/key-files/identify-key-files.d.ts +1 -1
- package/dist/features/magic-context/key-files/identify-key-files.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +1 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts +6 -1
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +4 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/live-session-state.d.ts +8 -0
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -21
- package/dist/plugin/hooks/create-session-hooks.d.ts +3 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts +2 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/tui-action-consumer.d.ts +2 -0
- package/dist/plugin/tui-action-consumer.d.ts.map +1 -1
- package/dist/shared/tui-config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/conflict-detector.ts +1 -1
- package/src/shared/tui-config.ts +8 -2
- package/src/tui/index.tsx +2 -2
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ irm https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/sc
|
|
|
70
70
|
|
|
71
71
|
**Or run directly (any OS):**
|
|
72
72
|
```bash
|
|
73
|
-
bunx @cortexkit/opencode-magic-context@latest setup
|
|
73
|
+
bunx --bun @cortexkit/opencode-magic-context@latest setup
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
The wizard will:
|
|
@@ -136,7 +136,7 @@ The setup wizard handles this automatically if it detects an oh-my-openagent or
|
|
|
136
136
|
Already installed but something isn't working? Run the doctor to check and auto-fix configuration issues:
|
|
137
137
|
|
|
138
138
|
```bash
|
|
139
|
-
bunx @cortexkit/opencode-magic-context@latest doctor
|
|
139
|
+
bunx --bun @cortexkit/opencode-magic-context@latest doctor
|
|
140
140
|
```
|
|
141
141
|
|
|
142
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.
|
|
@@ -144,13 +144,13 @@ Doctor checks for conflicts (compaction, DCP, OMO hooks), ensures the TUI sideba
|
|
|
144
144
|
Use `--force` to force-clear the plugin cache even when versions match (fixes broken transitive dependencies):
|
|
145
145
|
|
|
146
146
|
```bash
|
|
147
|
-
bunx @cortexkit/opencode-magic-context@latest doctor --force
|
|
147
|
+
bunx --bun @cortexkit/opencode-magic-context@latest doctor --force
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
Hit a real bug? Use `--issue` to collect environment, sanitized config, and the last 200 log lines into a ready-to-submit report. It can also open the issue directly via `gh` if you have it installed:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
bunx @cortexkit/opencode-magic-context@latest doctor --issue
|
|
153
|
+
bunx --bun @cortexkit/opencode-magic-context@latest doctor --issue
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
---
|
|
@@ -312,7 +312,7 @@ The TUI plugin is configured automatically by the setup wizard and the `doctor`
|
|
|
312
312
|
|
|
313
313
|
### Startup conflict detection
|
|
314
314
|
|
|
315
|
-
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`.
|
|
315
|
+
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 --bun @cortexkit/opencode-magic-context@latest doctor`.
|
|
316
316
|
|
|
317
317
|
---
|
|
318
318
|
|
package/dist/cli/doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4MA,wBAAsB,SAAS,CAC3B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4MA,wBAAsB,SAAS,CAC3B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,OAAO,CAAC,MAAM,CAAC,CA8VjB"}
|
package/dist/cli.js
CHANGED
|
@@ -7851,7 +7851,7 @@ var require_src3 = __commonJS((exports, module) => {
|
|
|
7851
7851
|
// src/cli/doctor.ts
|
|
7852
7852
|
var import_comment_json3 = __toESM(require_src2(), 1);
|
|
7853
7853
|
import { execSync as execSync2, spawnSync } from "node:child_process";
|
|
7854
|
-
import { existsSync as
|
|
7854
|
+
import { existsSync as existsSync6, readdirSync as readdirSync2, readFileSync as readFileSync5, rmSync, statSync as statSync2, writeFileSync as writeFileSync4 } from "node:fs";
|
|
7855
7855
|
import { createRequire as createRequire3 } from "node:module";
|
|
7856
7856
|
import { homedir as homedir5, platform, tmpdir as tmpdir3 } from "node:os";
|
|
7857
7857
|
import { join as join9 } from "node:path";
|
|
@@ -8398,7 +8398,12 @@ function ensureTuiPluginEntry() {
|
|
|
8398
8398
|
if (plugins[existingIdx] === PLUGIN_ENTRY) {
|
|
8399
8399
|
return false;
|
|
8400
8400
|
}
|
|
8401
|
-
plugins[existingIdx]
|
|
8401
|
+
const existing = plugins[existingIdx];
|
|
8402
|
+
if (existing === PLUGIN_NAME) {
|
|
8403
|
+
plugins[existingIdx] = PLUGIN_ENTRY;
|
|
8404
|
+
} else {
|
|
8405
|
+
return false;
|
|
8406
|
+
}
|
|
8402
8407
|
} else {
|
|
8403
8408
|
plugins.push(PLUGIN_ENTRY);
|
|
8404
8409
|
}
|
|
@@ -10014,13 +10019,13 @@ function getOpenCodeCacheDir2() {
|
|
|
10014
10019
|
async function clearPluginCache(force = false) {
|
|
10015
10020
|
const cacheDir = getOpenCodeCacheDir2();
|
|
10016
10021
|
const pluginCacheDir = join9(cacheDir, "packages", PLUGIN_ENTRY_WITH_VERSION2);
|
|
10017
|
-
if (!
|
|
10022
|
+
if (!existsSync6(pluginCacheDir)) {
|
|
10018
10023
|
return { action: "not_found", path: pluginCacheDir };
|
|
10019
10024
|
}
|
|
10020
10025
|
let cachedVersion;
|
|
10021
10026
|
try {
|
|
10022
10027
|
const installedPkgPath = join9(pluginCacheDir, "node_modules", "@cortexkit", "opencode-magic-context", "package.json");
|
|
10023
|
-
if (
|
|
10028
|
+
if (existsSync6(installedPkgPath)) {
|
|
10024
10029
|
const pkg = JSON.parse(readFileSync5(installedPkgPath, "utf-8"));
|
|
10025
10030
|
if (typeof pkg?.version === "string") {
|
|
10026
10031
|
cachedVersion = pkg.version;
|
|
@@ -10152,12 +10157,38 @@ async function runDoctor(options = {}) {
|
|
|
10152
10157
|
} else {
|
|
10153
10158
|
R2.success(`OpenCode config: ${paths.opencodeConfig}`);
|
|
10154
10159
|
}
|
|
10155
|
-
if (
|
|
10160
|
+
if (existsSync6(paths.magicContextConfig)) {
|
|
10156
10161
|
R2.success(`Magic Context config: ${paths.magicContextConfig}`);
|
|
10157
10162
|
} else {
|
|
10158
10163
|
R2.warn(`No magic-context.jsonc found — using defaults`);
|
|
10159
10164
|
R2.info(" Run 'setup' to create one with model recommendations");
|
|
10160
10165
|
}
|
|
10166
|
+
if (existsSync6(paths.magicContextConfig)) {
|
|
10167
|
+
try {
|
|
10168
|
+
const mcRaw = readFileSync5(paths.magicContextConfig, "utf-8");
|
|
10169
|
+
const mcConfig = import_comment_json3.parse(mcRaw);
|
|
10170
|
+
let mcChanged = false;
|
|
10171
|
+
const experimental = mcConfig.experimental;
|
|
10172
|
+
if (experimental && "compaction_markers" in experimental) {
|
|
10173
|
+
if (!("compaction_markers" in mcConfig)) {
|
|
10174
|
+
mcConfig.compaction_markers = experimental.compaction_markers;
|
|
10175
|
+
}
|
|
10176
|
+
delete experimental.compaction_markers;
|
|
10177
|
+
mcChanged = true;
|
|
10178
|
+
if (Object.keys(experimental).length === 0) {
|
|
10179
|
+
delete mcConfig.experimental;
|
|
10180
|
+
}
|
|
10181
|
+
R2.success("Migrated experimental.compaction_markers → compaction_markers (now default: true)");
|
|
10182
|
+
fixed++;
|
|
10183
|
+
}
|
|
10184
|
+
if (mcChanged) {
|
|
10185
|
+
writeFileSync4(paths.magicContextConfig, `${import_comment_json3.stringify(mcConfig, null, 2)}
|
|
10186
|
+
`);
|
|
10187
|
+
}
|
|
10188
|
+
} catch {
|
|
10189
|
+
R2.warn("Could not migrate deprecated config keys in magic-context.jsonc");
|
|
10190
|
+
}
|
|
10191
|
+
}
|
|
10161
10192
|
if (paths.opencodeConfigFormat !== "none") {
|
|
10162
10193
|
try {
|
|
10163
10194
|
const raw = readFileSync5(paths.opencodeConfig, "utf-8");
|
|
@@ -10170,12 +10201,17 @@ async function runDoctor(options = {}) {
|
|
|
10170
10201
|
R2.success(`Plugin registered in ${configName}`);
|
|
10171
10202
|
} else if (existingIdx >= 0) {
|
|
10172
10203
|
const oldEntry = pluginList[existingIdx];
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10204
|
+
const isPinned = oldEntry !== PLUGIN_NAME3 && oldEntry !== PLUGIN_ENTRY_WITH_VERSION2 && /^@cortexkit\/opencode-magic-context@\d/.test(oldEntry);
|
|
10205
|
+
if (isPinned && !options.force) {
|
|
10206
|
+
R2.warn(`Plugin pinned to ${oldEntry} in ${configName} — use 'doctor --force' to upgrade`);
|
|
10207
|
+
} else {
|
|
10208
|
+
pluginList[existingIdx] = PLUGIN_ENTRY_WITH_VERSION2;
|
|
10209
|
+
config.plugin = pluginList;
|
|
10210
|
+
writeFileSync4(paths.opencodeConfig, `${import_comment_json3.stringify(config, null, 2)}
|
|
10176
10211
|
`);
|
|
10177
|
-
|
|
10178
|
-
|
|
10212
|
+
R2.success(`Upgraded plugin entry in ${configName}: ${oldEntry} → ${PLUGIN_ENTRY_WITH_VERSION2}`);
|
|
10213
|
+
fixed++;
|
|
10214
|
+
}
|
|
10179
10215
|
} else {
|
|
10180
10216
|
pluginList.push(PLUGIN_ENTRY_WITH_VERSION2);
|
|
10181
10217
|
config.plugin = pluginList;
|
|
@@ -10211,14 +10247,37 @@ async function runDoctor(options = {}) {
|
|
|
10211
10247
|
R2.success("Added TUI sidebar plugin to tui.json");
|
|
10212
10248
|
R2.warn("Restart OpenCode to see the sidebar");
|
|
10213
10249
|
fixed++;
|
|
10214
|
-
} else {
|
|
10215
|
-
|
|
10250
|
+
} else if (existsSync6(paths.tuiConfig)) {
|
|
10251
|
+
try {
|
|
10252
|
+
const tuiRaw = readFileSync5(paths.tuiConfig, "utf-8");
|
|
10253
|
+
const tuiConfig = import_comment_json3.parse(tuiRaw);
|
|
10254
|
+
const tuiPlugins = Array.isArray(tuiConfig?.plugin) ? tuiConfig.plugin.filter((p) => typeof p === "string") : [];
|
|
10255
|
+
const tuiIdx = tuiPlugins.findIndex((p) => p === PLUGIN_NAME3 || p.startsWith(`${PLUGIN_NAME3}@`));
|
|
10256
|
+
if (tuiIdx >= 0) {
|
|
10257
|
+
const tuiEntry = tuiPlugins[tuiIdx];
|
|
10258
|
+
const tuiPinned = tuiEntry !== PLUGIN_NAME3 && tuiEntry !== PLUGIN_ENTRY_WITH_VERSION2 && /^@cortexkit\/opencode-magic-context@\d/.test(tuiEntry);
|
|
10259
|
+
if (tuiPinned && !options.force) {
|
|
10260
|
+
R2.warn(`TUI plugin pinned to ${tuiEntry} — use 'doctor --force' to upgrade`);
|
|
10261
|
+
} else if (tuiPinned && options.force) {
|
|
10262
|
+
tuiPlugins[tuiIdx] = PLUGIN_ENTRY_WITH_VERSION2;
|
|
10263
|
+
tuiConfig.plugin = tuiPlugins;
|
|
10264
|
+
writeFileSync4(paths.tuiConfig, `${import_comment_json3.stringify(tuiConfig, null, 2)}
|
|
10265
|
+
`);
|
|
10266
|
+
R2.success(`Upgraded TUI plugin: ${tuiEntry} → ${PLUGIN_ENTRY_WITH_VERSION2}`);
|
|
10267
|
+
fixed++;
|
|
10268
|
+
} else {
|
|
10269
|
+
R2.success("TUI sidebar plugin configured");
|
|
10270
|
+
}
|
|
10271
|
+
} else {
|
|
10272
|
+
R2.success("TUI sidebar plugin configured");
|
|
10273
|
+
}
|
|
10274
|
+
} catch {
|
|
10216
10275
|
R2.success("TUI sidebar plugin configured");
|
|
10217
|
-
} else {
|
|
10218
|
-
R2.success("TUI sidebar plugin configured (tui.json created)");
|
|
10219
10276
|
}
|
|
10277
|
+
} else {
|
|
10278
|
+
R2.success("TUI sidebar plugin configured (tui.json created)");
|
|
10220
10279
|
}
|
|
10221
|
-
if (
|
|
10280
|
+
if (existsSync6(paths.magicContextConfig)) {
|
|
10222
10281
|
try {
|
|
10223
10282
|
const mcRaw = readFileSync5(paths.magicContextConfig, "utf-8");
|
|
10224
10283
|
const mcConfig = import_comment_json3.parse(mcRaw);
|
|
@@ -10247,8 +10306,51 @@ async function runDoctor(options = {}) {
|
|
|
10247
10306
|
} else {
|
|
10248
10307
|
R2.success("Plugin cache clean (no cached version found)");
|
|
10249
10308
|
}
|
|
10309
|
+
{
|
|
10310
|
+
const ageWarnings = [];
|
|
10311
|
+
const npmrcPath = join9(homedir5(), ".npmrc");
|
|
10312
|
+
if (existsSync6(npmrcPath)) {
|
|
10313
|
+
try {
|
|
10314
|
+
const npmrc = readFileSync5(npmrcPath, "utf-8");
|
|
10315
|
+
for (const line of npmrc.split(`
|
|
10316
|
+
`)) {
|
|
10317
|
+
const trimmed = line.trim();
|
|
10318
|
+
if (trimmed.startsWith("#") || trimmed.startsWith(";"))
|
|
10319
|
+
continue;
|
|
10320
|
+
const [key] = trimmed.split("=").map((s) => s.trim());
|
|
10321
|
+
if (key === "min-release-age" || key === "before") {
|
|
10322
|
+
ageWarnings.push(`~/.npmrc has '${trimmed}'`);
|
|
10323
|
+
}
|
|
10324
|
+
}
|
|
10325
|
+
} catch {}
|
|
10326
|
+
}
|
|
10327
|
+
const bunfigPath = join9(homedir5(), ".bunfig.toml");
|
|
10328
|
+
if (existsSync6(bunfigPath)) {
|
|
10329
|
+
try {
|
|
10330
|
+
const bunfig = readFileSync5(bunfigPath, "utf-8");
|
|
10331
|
+
for (const line of bunfig.split(`
|
|
10332
|
+
`)) {
|
|
10333
|
+
const trimmed = line.trim();
|
|
10334
|
+
if (trimmed.startsWith("#"))
|
|
10335
|
+
continue;
|
|
10336
|
+
if (/minimumReleaseAge\s*=/.test(trimmed)) {
|
|
10337
|
+
ageWarnings.push(`~/.bunfig.toml has '${trimmed}'`);
|
|
10338
|
+
}
|
|
10339
|
+
}
|
|
10340
|
+
} catch {}
|
|
10341
|
+
}
|
|
10342
|
+
if (ageWarnings.length > 0) {
|
|
10343
|
+
R2.warn("Package manager min-release-age restriction detected — this can prevent OpenCode from installing the latest plugin version");
|
|
10344
|
+
for (const w of ageWarnings) {
|
|
10345
|
+
R2.info(` ${w}`);
|
|
10346
|
+
}
|
|
10347
|
+
R2.info(" If the plugin stays on an old version after doctor --force, this is the likely cause.");
|
|
10348
|
+
R2.info(" Workaround: temporarily remove the restriction, restart OpenCode, then re-enable it.");
|
|
10349
|
+
issues++;
|
|
10350
|
+
}
|
|
10351
|
+
}
|
|
10250
10352
|
const logPath = join9(tmpdir3(), "magic-context.log");
|
|
10251
|
-
if (
|
|
10353
|
+
if (existsSync6(logPath)) {
|
|
10252
10354
|
const logStat = statSync2(logPath);
|
|
10253
10355
|
const sizeKb = (logStat.size / 1024).toFixed(0);
|
|
10254
10356
|
R2.info(`Log file: ${logPath} (${sizeKb} KB)`);
|
|
@@ -10256,7 +10358,7 @@ async function runDoctor(options = {}) {
|
|
|
10256
10358
|
R2.info(`Log file: ${logPath} (not yet created)`);
|
|
10257
10359
|
}
|
|
10258
10360
|
const historianDumpDir = join9(tmpdir3(), "magic-context-historian");
|
|
10259
|
-
if (
|
|
10361
|
+
if (existsSync6(historianDumpDir)) {
|
|
10260
10362
|
try {
|
|
10261
10363
|
const dumps = readdirSync2(historianDumpDir).filter((f) => f.endsWith(".xml")).map((f) => ({
|
|
10262
10364
|
name: f,
|
|
@@ -10294,12 +10396,12 @@ async function runDoctor(options = {}) {
|
|
|
10294
10396
|
|
|
10295
10397
|
// src/cli/setup.ts
|
|
10296
10398
|
var import_comment_json4 = __toESM(require_src2(), 1);
|
|
10297
|
-
import { existsSync as
|
|
10399
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "node:fs";
|
|
10298
10400
|
import { dirname as dirname3 } from "node:path";
|
|
10299
10401
|
var PLUGIN_NAME4 = "@cortexkit/opencode-magic-context";
|
|
10300
10402
|
var PLUGIN_ENTRY2 = "@cortexkit/opencode-magic-context@latest";
|
|
10301
10403
|
function ensureDir(dir) {
|
|
10302
|
-
if (!
|
|
10404
|
+
if (!existsSync7(dir)) {
|
|
10303
10405
|
mkdirSync3(dir, { recursive: true });
|
|
10304
10406
|
}
|
|
10305
10407
|
}
|
|
@@ -10363,7 +10465,7 @@ function addPluginToTuiConfig(configPath, format) {
|
|
|
10363
10465
|
`);
|
|
10364
10466
|
}
|
|
10365
10467
|
function writeMagicContextConfig(configPath, options) {
|
|
10366
|
-
const config = (
|
|
10468
|
+
const config = (existsSync7(configPath) ? readJsonc(configPath) : null) ?? {};
|
|
10367
10469
|
if (!config.$schema) {
|
|
10368
10470
|
config.$schema = "https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/assets/magic-context.schema.json";
|
|
10369
10471
|
}
|
|
@@ -10429,7 +10531,7 @@ async function runSetup() {
|
|
|
10429
10531
|
R2.warn("You can configure models manually in magic-context.jsonc later");
|
|
10430
10532
|
}
|
|
10431
10533
|
const paths = detectConfigPaths();
|
|
10432
|
-
const hadExistingSetup = paths.opencodeConfigFormat !== "none" ||
|
|
10534
|
+
const hadExistingSetup = paths.opencodeConfigFormat !== "none" || existsSync7(paths.magicContextConfig) || paths.tuiConfigFormat !== "none";
|
|
10433
10535
|
addPluginToOpenCodeConfig(paths.opencodeConfig, paths.opencodeConfigFormat);
|
|
10434
10536
|
R2.success(`Plugin added to ${paths.opencodeConfig}`);
|
|
10435
10537
|
R2.info("Disabled built-in compaction (auto=false, prune=false)");
|
|
@@ -10606,9 +10708,9 @@ if (command === "setup") {
|
|
|
10606
10708
|
console.log(" doctor --issue Collect diagnostics and open a GitHub issue");
|
|
10607
10709
|
console.log("");
|
|
10608
10710
|
console.log(" Usage:");
|
|
10609
|
-
console.log(" bunx @cortexkit/opencode-magic-context@latest setup");
|
|
10610
|
-
console.log(" bunx @cortexkit/opencode-magic-context@latest doctor");
|
|
10611
|
-
console.log(" bunx @cortexkit/opencode-magic-context@latest doctor --issue");
|
|
10711
|
+
console.log(" bunx --bun @cortexkit/opencode-magic-context@latest setup");
|
|
10712
|
+
console.log(" bunx --bun @cortexkit/opencode-magic-context@latest doctor");
|
|
10713
|
+
console.log(" bunx --bun @cortexkit/opencode-magic-context@latest doctor --issue");
|
|
10612
10714
|
console.log("");
|
|
10613
10715
|
process.exit(command ? 1 : 0);
|
|
10614
10716
|
}
|
|
@@ -190,8 +190,8 @@ export interface MagicContextConfig {
|
|
|
190
190
|
enabled: boolean;
|
|
191
191
|
min_clusters: number;
|
|
192
192
|
};
|
|
193
|
+
compaction_markers: boolean;
|
|
193
194
|
experimental: {
|
|
194
|
-
compaction_markers: boolean;
|
|
195
195
|
user_memories: {
|
|
196
196
|
enabled: boolean;
|
|
197
197
|
promotion_threshold: number;
|
|
@@ -347,6 +347,7 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
347
347
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
348
348
|
min_clusters: z.ZodDefault<z.ZodNumber>;
|
|
349
349
|
}, z.core.$strip>>;
|
|
350
|
+
compaction_markers: z.ZodDefault<z.ZodBoolean>;
|
|
350
351
|
embedding: z.ZodDefault<z.ZodPipe<z.ZodObject<{
|
|
351
352
|
provider: z.ZodDefault<z.ZodEnum<{
|
|
352
353
|
local: "local";
|
|
@@ -374,7 +375,6 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
374
375
|
api_key?: string | undefined;
|
|
375
376
|
}>>>;
|
|
376
377
|
experimental: z.ZodDefault<z.ZodObject<{
|
|
377
|
-
compaction_markers: z.ZodDefault<z.ZodBoolean>;
|
|
378
378
|
user_memories: z.ZodDefault<z.ZodObject<{
|
|
379
379
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
380
380
|
promotion_threshold: z.ZodDefault<z.ZodNumber>;
|
|
@@ -467,6 +467,7 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
467
467
|
enabled: boolean;
|
|
468
468
|
min_clusters: number;
|
|
469
469
|
};
|
|
470
|
+
compaction_markers: boolean;
|
|
470
471
|
embedding: {
|
|
471
472
|
provider: "local";
|
|
472
473
|
model: string;
|
|
@@ -480,7 +481,6 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
480
481
|
model?: undefined;
|
|
481
482
|
};
|
|
482
483
|
experimental: {
|
|
483
|
-
compaction_markers: boolean;
|
|
484
484
|
user_memories: {
|
|
485
485
|
enabled: boolean;
|
|
486
486
|
promotion_threshold: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-context.d.ts","sourceRoot":"","sources":["../../../src/config/schema/magic-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,eAAO,MAAM,6BAA6B,QAAS,CAAC;AACpD,eAAO,MAAM,oCAAoC,KAAK,CAAC;AACvD,eAAO,MAAM,gCAAgC,QAAS,CAAC;AACvD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AAEvE,eAAO,MAAM,aAAa,iFAMhB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;EAAwB,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAK/C,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe/B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAIpB,CAAC;AACd,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AA2B/E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;GAmBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0H/B,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the transform hook receives only post-boundary messages instead
|
|
7
7
|
* of the full session history.
|
|
8
8
|
*
|
|
9
|
-
* Gated behind `
|
|
9
|
+
* Gated behind the `compaction_markers` config flag (default: true).
|
|
10
10
|
*
|
|
11
11
|
* ## What gets injected (3 rows):
|
|
12
12
|
* 1. A `compaction` part on the boundary user message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA2C3D,UAAU,6BAA6B;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAE9F;AAMD,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE;QACH,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,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C,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,uBAAuB,CAAC,EAAE,6BAA6B,CAAC;CAC3D,GAAG,OAAO,CAAC,cAAc,CAAC,CA+U1B;AA0LD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC1C,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5E,uBAAuB,CAAC,EAAE,6BAA6B,CAAC;CAC3D,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAyDjC"}
|
|
@@ -17,7 +17,7 @@ export declare function parseKeyFilesOutput(text: string): Array<{
|
|
|
17
17
|
* Get candidate files for key-file analysis from OpenCode's DB.
|
|
18
18
|
* Returns files with full reads >= minReads and size under half the budget.
|
|
19
19
|
*/
|
|
20
|
-
export declare function getKeyFileCandidates(openCodeDb: Database, sessionId: string, minReads: number, tokenBudget: number): FileReadStat[];
|
|
20
|
+
export declare function getKeyFileCandidates(openCodeDb: Database, sessionId: string, minReads: number, tokenBudget: number, projectDirectory?: string): FileReadStat[];
|
|
21
21
|
/**
|
|
22
22
|
* Apply LLM-ranked results through the knapsack solver and persist.
|
|
23
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identify-key-files.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/key-files/identify-key-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,cAAc,CAAC;AAGtE,eAAO,MAAM,uBAAuB,yLACsJ,CAAC;AAE3L;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,UAAU,EAAE,YAAY,EAAE,EAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACjB,MAAM,CAqCR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqB7F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"identify-key-files.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/key-files/identify-key-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,cAAc,CAAC;AAGtE,eAAO,MAAM,uBAAuB,yLACsJ,CAAC;AAE3L;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,UAAU,EAAE,YAAY,EAAE,EAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACjB,MAAM,CAqCR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqB7F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,QAAQ,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,gBAAgB,CAAC,EAAE,MAAM,GAC1B,YAAY,EAAE,CAYhB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,KAAK,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EACtD,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAC7B;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAelD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,YAAY,EAAE,EAC1B,WAAW,EAAE,MAAM,GACpB;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAmBlD"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Coordinates compaction marker injection/update/removal with historian
|
|
5
5
|
* publication. Called after compartments are published, behind the
|
|
6
|
-
* `
|
|
6
|
+
* `compaction_markers` config flag (default: true).
|
|
7
7
|
*
|
|
8
8
|
* The marker summary text is a static placeholder — the real <session-history>
|
|
9
9
|
* is injected by the transform pipeline via inject-compartments.ts. The marker
|
|
@@ -5,12 +5,14 @@ export type LiveModelBySession = Map<string, {
|
|
|
5
5
|
modelID: string;
|
|
6
6
|
}>;
|
|
7
7
|
export type VariantBySession = Map<string, string | undefined>;
|
|
8
|
+
export type AgentBySession = Map<string, string>;
|
|
8
9
|
export type RecentReduceBySession = Map<string, number>;
|
|
9
10
|
export type ToolUsageSinceUserTurn = Map<string, number>;
|
|
10
11
|
export type FlushedSessions = Set<string>;
|
|
11
12
|
export type LastHeuristicsTurnId = Map<string, string>;
|
|
12
13
|
export type EmergencyNudgeFired = Set<string>;
|
|
13
|
-
export declare function getLiveNotificationParams(sessionId: string, liveModelBySession: LiveModelBySession, variantBySession: VariantBySession): {
|
|
14
|
+
export declare function getLiveNotificationParams(sessionId: string, liveModelBySession: LiveModelBySession, variantBySession: VariantBySession, agentBySession?: AgentBySession): {
|
|
15
|
+
agent?: string;
|
|
14
16
|
variant?: string;
|
|
15
17
|
providerId?: string;
|
|
16
18
|
modelId?: string;
|
|
@@ -20,12 +22,14 @@ export declare function createChatMessageHook(args: {
|
|
|
20
22
|
toolUsageSinceUserTurn: ToolUsageSinceUserTurn;
|
|
21
23
|
recentReduceBySession: RecentReduceBySession;
|
|
22
24
|
variantBySession: VariantBySession;
|
|
25
|
+
agentBySession: AgentBySession;
|
|
23
26
|
flushedSessions: FlushedSessions;
|
|
24
27
|
lastHeuristicsTurnId: LastHeuristicsTurnId;
|
|
25
28
|
ctxReduceEnabled?: boolean;
|
|
26
29
|
}): (input: {
|
|
27
30
|
sessionID?: string;
|
|
28
31
|
variant?: string;
|
|
32
|
+
agent?: string;
|
|
29
33
|
}) => Promise<void>;
|
|
30
34
|
export declare function createEventHook(args: {
|
|
31
35
|
eventHandler: (input: {
|
|
@@ -44,6 +48,7 @@ export declare function createEventHook(args: {
|
|
|
44
48
|
db: Parameters<typeof getOrCreateSessionMeta>[0];
|
|
45
49
|
liveModelBySession: LiveModelBySession;
|
|
46
50
|
variantBySession: VariantBySession;
|
|
51
|
+
agentBySession: AgentBySession;
|
|
47
52
|
recentReduceBySession: RecentReduceBySession;
|
|
48
53
|
toolUsageSinceUserTurn: ToolUsageSinceUserTurn;
|
|
49
54
|
emergencyNudgeFired: EmergencyNudgeFired;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-handlers.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/hook-handlers.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,sBAAsB,EAEzB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAYxD,MAAM,MAAM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OAAO,CAAC,OAAO,CAAC,CAAC;CACzB,IACiB,OAAO,OAAO,EAAE,QAAQ,OAAO,sBAmBhD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC7C,EAAE,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,sBAAsB,EAAE,sBAAsB,CAAC;CAClD,IACiB,OAAO,OAAO,mBA4B/B"}
|
|
@@ -4,6 +4,7 @@ import type { Scheduler } from "../../features/magic-context/scheduler";
|
|
|
4
4
|
import type { Tagger } from "../../features/magic-context/tagger";
|
|
5
5
|
import type { PluginContext } from "../../plugin/types";
|
|
6
6
|
export type { CommandExecuteInput, CommandExecuteOutput } from "./command-handler";
|
|
7
|
+
import type { LiveSessionState } from "./live-session-state";
|
|
7
8
|
export interface MagicContextDeps {
|
|
8
9
|
client: PluginContext["client"];
|
|
9
10
|
directory: string;
|
|
@@ -11,6 +12,7 @@ export interface MagicContextDeps {
|
|
|
11
12
|
scheduler: Scheduler;
|
|
12
13
|
onSessionCacheInvalidated?: (sessionId: string) => void;
|
|
13
14
|
compactionHandler: ReturnType<typeof createCompactionHandler>;
|
|
15
|
+
liveSessionState?: LiveSessionState;
|
|
14
16
|
config: {
|
|
15
17
|
protected_tags: number;
|
|
16
18
|
ctx_reduce_enabled?: boolean;
|
|
@@ -38,8 +40,8 @@ export interface MagicContextDeps {
|
|
|
38
40
|
enabled: boolean;
|
|
39
41
|
min_clusters: number;
|
|
40
42
|
};
|
|
43
|
+
compaction_markers?: boolean;
|
|
41
44
|
experimental?: {
|
|
42
|
-
compaction_markers?: boolean;
|
|
43
45
|
user_memories?: {
|
|
44
46
|
enabled: boolean;
|
|
45
47
|
promotion_threshold: number;
|
|
@@ -71,6 +73,7 @@ export declare function createMagicContextHook(deps: MagicContextDeps): {
|
|
|
71
73
|
"chat.message": (input: {
|
|
72
74
|
sessionID?: string;
|
|
73
75
|
variant?: string;
|
|
76
|
+
agent?: string;
|
|
74
77
|
}) => Promise<void>;
|
|
75
78
|
event: (input: {
|
|
76
79
|
event: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,aAAa,EAClB,KAAK,cAAc,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAOvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAMxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,aAAa,EAClB,KAAK,cAAc,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAOvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAMxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAUnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ7D,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAA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EAAE;gBAAE,OAAO,EAAE,OAAO,CAAC;gBAAC,mBAAmB,EAAE,MAAM,CAAA;aAAE,CAAC;YAClE,aAAa,CAAC,EAAE;gBAAE,OAAO,EAAE,OAAO,CAAC;gBAAC,YAAY,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;SACjF,CAAC;KACL,CAAC;CACL;AAqCD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB;;;;;iBAzC7B,CAAC;;;;;;;;;;;;iBAtBzB,CAAC;eAAiB,CAAC;aACnB,CAAH;;mBAuVwB;QAAE,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE;;;SAa7E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentBySession, LiveModelBySession, VariantBySession } from "./hook-handlers";
|
|
2
|
+
export interface LiveSessionState {
|
|
3
|
+
liveModelBySession: LiveModelBySession;
|
|
4
|
+
variantBySession: VariantBySession;
|
|
5
|
+
agentBySession: AgentBySession;
|
|
6
|
+
}
|
|
7
|
+
export declare function createLiveSessionState(): LiveSessionState;
|
|
8
|
+
//# sourceMappingURL=live-session-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-session-state.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/live-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5F,MAAM,WAAW,gBAAgB;IAC7B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,EAAE,cAAc,CAAC;CAClC;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAMzD"}
|
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;AA0BlD,QAAA,MAAM,MAAM,EAAE,MAiPb,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14163,12 +14163,12 @@ var init_magic_context = __esm(() => {
|
|
|
14163
14163
|
enabled: exports_external.boolean().default(true),
|
|
14164
14164
|
min_clusters: exports_external.number().min(1).default(3)
|
|
14165
14165
|
}).default({ enabled: true, min_clusters: 3 }),
|
|
14166
|
+
compaction_markers: exports_external.boolean().default(true),
|
|
14166
14167
|
embedding: EmbeddingConfigSchema.default({
|
|
14167
14168
|
provider: "local",
|
|
14168
14169
|
model: DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
14169
14170
|
}),
|
|
14170
14171
|
experimental: exports_external.object({
|
|
14171
|
-
compaction_markers: exports_external.boolean().default(false),
|
|
14172
14172
|
user_memories: exports_external.object({
|
|
14173
14173
|
enabled: exports_external.boolean().default(false),
|
|
14174
14174
|
promotion_threshold: exports_external.number().min(2).max(20).default(3)
|
|
@@ -14179,7 +14179,6 @@ var init_magic_context = __esm(() => {
|
|
|
14179
14179
|
min_reads: exports_external.number().min(2).max(20).default(4)
|
|
14180
14180
|
}).default({ enabled: false, token_budget: 1e4, min_reads: 4 })
|
|
14181
14181
|
}).default({
|
|
14182
|
-
compaction_markers: false,
|
|
14183
14182
|
user_memories: { enabled: false, promotion_threshold: 3 },
|
|
14184
14183
|
pin_key_files: { enabled: false, token_budget: 1e4, min_reads: 4 }
|
|
14185
14184
|
}),
|
|
@@ -15072,7 +15071,7 @@ function formatConflictShort(result) {
|
|
|
15072
15071
|
"",
|
|
15073
15072
|
...result.reasons.map((r) => `\u2022 ${r}`),
|
|
15074
15073
|
"",
|
|
15075
|
-
"Fix: run `bunx @cortexkit/opencode-magic-context@latest doctor`"
|
|
15074
|
+
"Fix: run `bunx --bun @cortexkit/opencode-magic-context@latest doctor`"
|
|
15076
15075
|
];
|
|
15077
15076
|
return lines.join(`
|
|
15078
15077
|
`);
|
|
@@ -28228,7 +28227,12 @@ function ensureTuiPluginEntry() {
|
|
|
28228
28227
|
if (plugins[existingIdx] === PLUGIN_ENTRY) {
|
|
28229
28228
|
return false;
|
|
28230
28229
|
}
|
|
28231
|
-
plugins[existingIdx]
|
|
28230
|
+
const existing = plugins[existingIdx];
|
|
28231
|
+
if (existing === PLUGIN_NAME) {
|
|
28232
|
+
plugins[existingIdx] = PLUGIN_ENTRY;
|
|
28233
|
+
} else {
|
|
28234
|
+
return false;
|
|
28235
|
+
}
|
|
28232
28236
|
} else {
|
|
28233
28237
|
plugins.push(PLUGIN_ENTRY);
|
|
28234
28238
|
}
|
|
@@ -28844,6 +28848,17 @@ async function runSidekick(deps) {
|
|
|
28844
28848
|
|
|
28845
28849
|
// src/index.ts
|
|
28846
28850
|
init_compartment_prompt();
|
|
28851
|
+
|
|
28852
|
+
// src/hooks/magic-context/live-session-state.ts
|
|
28853
|
+
function createLiveSessionState() {
|
|
28854
|
+
return {
|
|
28855
|
+
liveModelBySession: new Map,
|
|
28856
|
+
variantBySession: new Map,
|
|
28857
|
+
agentBySession: new Map
|
|
28858
|
+
};
|
|
28859
|
+
}
|
|
28860
|
+
|
|
28861
|
+
// src/index.ts
|
|
28847
28862
|
init_conflict_warning_hook();
|
|
28848
28863
|
|
|
28849
28864
|
// src/features/magic-context/dreamer/storage-dream-state.ts
|
|
@@ -29166,10 +29181,11 @@ function parseKeyFilesOutput(text) {
|
|
|
29166
29181
|
return [];
|
|
29167
29182
|
}
|
|
29168
29183
|
}
|
|
29169
|
-
function getKeyFileCandidates(openCodeDb, sessionId, minReads, tokenBudget) {
|
|
29184
|
+
function getKeyFileCandidates(openCodeDb, sessionId, minReads, tokenBudget, projectDirectory) {
|
|
29170
29185
|
const stats = getSessionReadStats(openCodeDb, sessionId, minReads);
|
|
29171
29186
|
const maxPerFileTokens = Math.min(tokenBudget / 2, 5000);
|
|
29172
|
-
|
|
29187
|
+
const projectPrefix = projectDirectory ? projectDirectory.replace(/\/$/, "") + "/" : undefined;
|
|
29188
|
+
return stats.filter((s) => s.latestReadTokens > 0 && s.latestReadTokens <= maxPerFileTokens && (!projectPrefix || s.filePath.startsWith(projectPrefix)));
|
|
29173
29189
|
}
|
|
29174
29190
|
function applyKeyFileResults(db, sessionId, llmRanked, tokenBudget, candidatePaths) {
|
|
29175
29191
|
const filtered = candidatePaths ? llmRanked.filter((f) => candidatePaths.has(f.filePath)) : llmRanked;
|
|
@@ -29427,7 +29443,8 @@ async function getActiveProjectSessionIds(args) {
|
|
|
29427
29443
|
try {
|
|
29428
29444
|
const { withReadOnlySessionDb: withReadOnlySessionDb2 } = await Promise.resolve().then(() => (init_read_session_db(), exports_read_session_db));
|
|
29429
29445
|
const projectSessionIds = withReadOnlySessionDb2((openCodeDb) => {
|
|
29430
|
-
const
|
|
29446
|
+
const bareIdentity = args.projectIdentity.replace(/^git:/, "");
|
|
29447
|
+
const rows = openCodeDb.prepare("SELECT id FROM session WHERE project_id = ? AND parent_id IS NULL ORDER BY time_updated DESC").all(bareIdentity);
|
|
29431
29448
|
return new Set(rows.map((r) => r.id));
|
|
29432
29449
|
});
|
|
29433
29450
|
if (projectSessionIds.size === 0) {
|
|
@@ -29456,7 +29473,7 @@ async function identifyKeyFilesForSession(args) {
|
|
|
29456
29473
|
if (!openCodeDb) {
|
|
29457
29474
|
return;
|
|
29458
29475
|
}
|
|
29459
|
-
const candidates = getKeyFileCandidates(openCodeDb, args.sessionId, args.config.min_reads, args.config.token_budget);
|
|
29476
|
+
const candidates = getKeyFileCandidates(openCodeDb, args.sessionId, args.config.min_reads, args.config.token_budget, args.sessionDirectory);
|
|
29460
29477
|
if (candidates.length === 0) {
|
|
29461
29478
|
log(`[key-files][${args.sessionId}] no candidates found \u2014 skipping`);
|
|
29462
29479
|
return;
|
|
@@ -33704,10 +33721,12 @@ var TOOL_HEAVY_TURN_REMINDER_THRESHOLD = 5;
|
|
|
33704
33721
|
var TOOL_HEAVY_TURN_REMINDER_TEXT = `
|
|
33705
33722
|
|
|
33706
33723
|
<instruction name="ctx_reduce_turn_cleanup">Also drop via \`ctx_reduce\` things you don't need anymore from the last turn before continuing.</instruction>`;
|
|
33707
|
-
function getLiveNotificationParams(sessionId, liveModelBySession, variantBySession) {
|
|
33724
|
+
function getLiveNotificationParams(sessionId, liveModelBySession, variantBySession, agentBySession) {
|
|
33708
33725
|
const model = liveModelBySession.get(sessionId);
|
|
33709
33726
|
const variant = variantBySession.get(sessionId);
|
|
33727
|
+
const agent = agentBySession?.get(sessionId);
|
|
33710
33728
|
return {
|
|
33729
|
+
...agent ? { agent } : {},
|
|
33711
33730
|
...variant ? { variant } : {},
|
|
33712
33731
|
...model ? { providerId: model.providerID, modelId: model.modelID } : {}
|
|
33713
33732
|
};
|
|
@@ -33728,6 +33747,9 @@ function createChatMessageHook(args) {
|
|
|
33728
33747
|
args.toolUsageSinceUserTurn.set(sessionId, 0);
|
|
33729
33748
|
const previousVariant = args.variantBySession.get(sessionId);
|
|
33730
33749
|
args.variantBySession.set(sessionId, input.variant);
|
|
33750
|
+
if (input.agent) {
|
|
33751
|
+
args.agentBySession.set(sessionId, input.agent);
|
|
33752
|
+
}
|
|
33731
33753
|
if (previousVariant !== undefined && input.variant !== undefined && previousVariant !== input.variant) {
|
|
33732
33754
|
sessionLog(sessionId, `variant changed (${previousVariant} -> ${input.variant}), triggering flush`);
|
|
33733
33755
|
args.flushedSessions.add(sessionId);
|
|
@@ -33759,6 +33781,7 @@ function createEventHook(args) {
|
|
|
33759
33781
|
if (input.event.type === "session.deleted") {
|
|
33760
33782
|
args.liveModelBySession.delete(sessionId);
|
|
33761
33783
|
args.variantBySession.delete(sessionId);
|
|
33784
|
+
args.agentBySession.delete(sessionId);
|
|
33762
33785
|
args.recentReduceBySession.delete(sessionId);
|
|
33763
33786
|
args.toolUsageSinceUserTurn.delete(sessionId);
|
|
33764
33787
|
args.emergencyNudgeFired.delete(sessionId);
|
|
@@ -33793,6 +33816,7 @@ function createEventHook(args) {
|
|
|
33793
33816
|
try {
|
|
33794
33817
|
const model = args.liveModelBySession.get(sessionId);
|
|
33795
33818
|
const variant = args.variantBySession.get(sessionId);
|
|
33819
|
+
const agent = args.agentBySession.get(sessionId);
|
|
33796
33820
|
const c = args.client;
|
|
33797
33821
|
if (typeof c.session?.promptAsync !== "function") {
|
|
33798
33822
|
sessionLog(sessionId, "emergency nudge: promptAsync unavailable");
|
|
@@ -33802,6 +33826,7 @@ function createEventHook(args) {
|
|
|
33802
33826
|
await c.session.promptAsync({
|
|
33803
33827
|
path: { id: sessionId },
|
|
33804
33828
|
body: {
|
|
33829
|
+
...agent ? { agent } : {},
|
|
33805
33830
|
...model ? { model } : {},
|
|
33806
33831
|
...variant ? { variant } : {},
|
|
33807
33832
|
parts: [{ type: "text", text: nudgeText }]
|
|
@@ -34310,8 +34335,9 @@ function createMagicContextHook(deps) {
|
|
|
34310
34335
|
const flushedSessions = new Set;
|
|
34311
34336
|
const lastHeuristicsTurnId = new Map;
|
|
34312
34337
|
const commitSeenLastPass = new Map;
|
|
34313
|
-
const variantBySession = new Map;
|
|
34314
|
-
const liveModelBySession = new Map;
|
|
34338
|
+
const variantBySession = deps.liveSessionState?.variantBySession ?? new Map;
|
|
34339
|
+
const liveModelBySession = deps.liveSessionState?.liveModelBySession ?? new Map;
|
|
34340
|
+
const agentBySession = deps.liveSessionState?.agentBySession ?? new Map;
|
|
34315
34341
|
const recentReduceBySession = new Map;
|
|
34316
34342
|
const toolUsageSinceUserTurn = new Map;
|
|
34317
34343
|
const ctxReduceEnabled = deps.config.ctx_reduce_enabled !== false;
|
|
@@ -34346,7 +34372,7 @@ function createMagicContextHook(deps) {
|
|
|
34346
34372
|
historyBudgetPercentage: deps.config.history_budget_percentage,
|
|
34347
34373
|
executeThresholdPercentage: deps.config.execute_threshold_percentage,
|
|
34348
34374
|
historianTimeoutMs: deps.config.historian_timeout_ms ?? DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
34349
|
-
getNotificationParams: (sessionId) => getLiveNotificationParams(sessionId, liveModelBySession, variantBySession),
|
|
34375
|
+
getNotificationParams: (sessionId) => getLiveNotificationParams(sessionId, liveModelBySession, variantBySession, agentBySession),
|
|
34350
34376
|
getModelKey: (sessionId) => {
|
|
34351
34377
|
const model = liveModelBySession.get(sessionId);
|
|
34352
34378
|
return resolveModelKey(model?.providerID, model?.modelID);
|
|
@@ -34356,7 +34382,7 @@ function createMagicContextHook(deps) {
|
|
|
34356
34382
|
return model ? `${model.providerID}/${model.modelID}` : undefined;
|
|
34357
34383
|
},
|
|
34358
34384
|
projectPath,
|
|
34359
|
-
experimentalCompactionMarkers: deps.config.
|
|
34385
|
+
experimentalCompactionMarkers: deps.config.compaction_markers,
|
|
34360
34386
|
experimentalUserMemories: deps.config.experimental?.user_memories?.enabled,
|
|
34361
34387
|
liveModelBySession
|
|
34362
34388
|
});
|
|
@@ -34430,11 +34456,11 @@ function createMagicContextHook(deps) {
|
|
|
34430
34456
|
const model = liveModelBySession.get(sessionId);
|
|
34431
34457
|
return model ? `${model.providerID}/${model.modelID}` : undefined;
|
|
34432
34458
|
})(),
|
|
34433
|
-
getNotificationParams: () => getLiveNotificationParams(sessionId, liveModelBySession, variantBySession)
|
|
34459
|
+
getNotificationParams: () => getLiveNotificationParams(sessionId, liveModelBySession, variantBySession, agentBySession)
|
|
34434
34460
|
}),
|
|
34435
34461
|
sendNotification: async (sessionId, text, params) => {
|
|
34436
34462
|
await sendIgnoredMessage(deps.client, sessionId, text, {
|
|
34437
|
-
...getLiveNotificationParams(sessionId, liveModelBySession, variantBySession),
|
|
34463
|
+
...getLiveNotificationParams(sessionId, liveModelBySession, variantBySession, agentBySession),
|
|
34438
34464
|
...params
|
|
34439
34465
|
});
|
|
34440
34466
|
},
|
|
@@ -34481,6 +34507,7 @@ function createMagicContextHook(deps) {
|
|
|
34481
34507
|
db,
|
|
34482
34508
|
liveModelBySession,
|
|
34483
34509
|
variantBySession,
|
|
34510
|
+
agentBySession,
|
|
34484
34511
|
recentReduceBySession,
|
|
34485
34512
|
toolUsageSinceUserTurn,
|
|
34486
34513
|
emergencyNudgeFired,
|
|
@@ -34500,6 +34527,7 @@ function createMagicContextHook(deps) {
|
|
|
34500
34527
|
toolUsageSinceUserTurn,
|
|
34501
34528
|
recentReduceBySession,
|
|
34502
34529
|
variantBySession,
|
|
34530
|
+
agentBySession,
|
|
34503
34531
|
flushedSessions,
|
|
34504
34532
|
lastHeuristicsTurnId,
|
|
34505
34533
|
ctxReduceEnabled
|
|
@@ -34520,7 +34548,7 @@ function createMagicContextHook(deps) {
|
|
|
34520
34548
|
}
|
|
34521
34549
|
// src/plugin/hooks/create-session-hooks.ts
|
|
34522
34550
|
function createSessionHooks(args) {
|
|
34523
|
-
const { ctx, pluginConfig } = args;
|
|
34551
|
+
const { ctx, pluginConfig, liveSessionState } = args;
|
|
34524
34552
|
if (pluginConfig.enabled !== true) {
|
|
34525
34553
|
return { magicContext: null };
|
|
34526
34554
|
}
|
|
@@ -34536,6 +34564,7 @@ function createSessionHooks(args) {
|
|
|
34536
34564
|
tagger,
|
|
34537
34565
|
scheduler: scheduler2,
|
|
34538
34566
|
compactionHandler,
|
|
34567
|
+
liveSessionState,
|
|
34539
34568
|
config: {
|
|
34540
34569
|
protected_tags: pluginConfig.protected_tags ?? DEFAULT_PROTECTED_TAGS,
|
|
34541
34570
|
ctx_reduce_enabled: pluginConfig.ctx_reduce_enabled,
|
|
@@ -34833,8 +34862,9 @@ ${c.content}
|
|
|
34833
34862
|
return detail;
|
|
34834
34863
|
}
|
|
34835
34864
|
function registerRpcHandlers(rpcServer, args) {
|
|
34836
|
-
const { directory, config: config2 } = args;
|
|
34865
|
+
const { directory, config: config2, liveSessionState } = args;
|
|
34837
34866
|
const rawConfig = config2;
|
|
34867
|
+
const getNotificationParams = (sessionId) => getLiveNotificationParams(sessionId, liveSessionState.liveModelBySession, liveSessionState.variantBySession, liveSessionState.agentBySession);
|
|
34838
34868
|
rpcServer.handle("sidebar-snapshot", async (params) => {
|
|
34839
34869
|
const sessionId = String(params.sessionId ?? "");
|
|
34840
34870
|
const dir = String(params.directory ?? directory);
|
|
@@ -34883,9 +34913,9 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
34883
34913
|
tokenBudget: config2.compartment_token_budget ?? DEFAULT_COMPARTMENT_TOKEN_BUDGET2,
|
|
34884
34914
|
historianTimeoutMs: config2.historian_timeout_ms ?? DEFAULT_HISTORIAN_TIMEOUT_MS2,
|
|
34885
34915
|
directory,
|
|
34886
|
-
getNotificationParams: () => (
|
|
34916
|
+
getNotificationParams: () => getNotificationParams(sessionId)
|
|
34887
34917
|
}).then((result) => {
|
|
34888
|
-
sendIgnoredMessage2(args.client, sessionId, result,
|
|
34918
|
+
sendIgnoredMessage2(args.client, sessionId, result, getNotificationParams(sessionId)).catch(() => {});
|
|
34889
34919
|
}).catch((error48) => {
|
|
34890
34920
|
log("[rpc] recomp failed:", error48);
|
|
34891
34921
|
});
|
|
@@ -36244,9 +36274,11 @@ var plugin = async (ctx) => {
|
|
|
36244
36274
|
log("[magic-context] no conflicts detected, plugin enabled");
|
|
36245
36275
|
}
|
|
36246
36276
|
}
|
|
36277
|
+
const liveSessionState = createLiveSessionState();
|
|
36247
36278
|
const hooks = createSessionHooks({
|
|
36248
36279
|
ctx,
|
|
36249
|
-
pluginConfig
|
|
36280
|
+
pluginConfig,
|
|
36281
|
+
liveSessionState
|
|
36250
36282
|
});
|
|
36251
36283
|
const tools5 = createToolRegistry({
|
|
36252
36284
|
ctx,
|
|
@@ -36274,7 +36306,8 @@ var plugin = async (ctx) => {
|
|
|
36274
36306
|
registerRpcHandlers(rpcServer, {
|
|
36275
36307
|
directory: ctx.directory,
|
|
36276
36308
|
config: pluginConfig,
|
|
36277
|
-
client: ctx.client
|
|
36309
|
+
client: ctx.client,
|
|
36310
|
+
liveSessionState
|
|
36278
36311
|
});
|
|
36279
36312
|
rpcServer.start().catch((err) => {
|
|
36280
36313
|
log(`[magic-context] RPC server failed to start: ${err}`);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { MagicContextPluginConfig } from "../../config";
|
|
2
|
+
import type { LiveSessionState } from "../../hooks/magic-context/live-session-state";
|
|
2
3
|
import type { PluginContext } from "../types";
|
|
3
4
|
export declare function createSessionHooks(args: {
|
|
4
5
|
ctx: PluginContext;
|
|
5
6
|
pluginConfig: MagicContextPluginConfig;
|
|
7
|
+
liveSessionState: LiveSessionState;
|
|
6
8
|
}): {
|
|
7
9
|
magicContext: {
|
|
8
10
|
"experimental.chat.messages.transform": (_input: Record<string, never>, output: {
|
|
@@ -23,6 +25,7 @@ export declare function createSessionHooks(args: {
|
|
|
23
25
|
"chat.message": (input: {
|
|
24
26
|
sessionID?: string;
|
|
25
27
|
variant?: string;
|
|
28
|
+
agent?: string;
|
|
26
29
|
}) => Promise<void>;
|
|
27
30
|
event: (input: {
|
|
28
31
|
event: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;CACtC;;;;;;qBA8CgrB,CAAC;;;;;;;;;;;;qBAR/pB,CAAC;mBAAiB,CAAC;iBACtB,CAAP;;;;;0BAOkza,CAAC;;;;;;EAD3za"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MagicContextConfig } from "../config/schema/magic-context";
|
|
2
|
+
import type { LiveSessionState } from "../hooks/magic-context/live-session-state";
|
|
2
3
|
import type { MagicContextRpcServer } from "../shared/rpc-server";
|
|
3
4
|
/**
|
|
4
5
|
* Register all RPC handlers on the server.
|
|
@@ -7,5 +8,6 @@ export declare function registerRpcHandlers(rpcServer: MagicContextRpcServer, ar
|
|
|
7
8
|
directory: string;
|
|
8
9
|
config: MagicContextConfig;
|
|
9
10
|
client: unknown;
|
|
11
|
+
liveSessionState: LiveSessionState;
|
|
10
12
|
}): void;
|
|
11
13
|
//# sourceMappingURL=rpc-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAmZlE;;GAEG;AACH,wBAAgB,mBAAmB,CAC/B,SAAS,EAAE,qBAAqB,EAChC,IAAI,EAAE;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,gBAAgB,CAAC;CACtC,GACF,IAAI,CA+FN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MagicContextConfig } from "../config/schema/magic-context";
|
|
2
|
+
import type { LiveSessionState } from "../hooks/magic-context/live-session-state";
|
|
2
3
|
import type { PluginContext } from "./types";
|
|
3
4
|
/**
|
|
4
5
|
* Start a server-side consumer that polls plugin_messages for TUI→server
|
|
@@ -9,5 +10,6 @@ export declare function startTuiActionConsumer(args: {
|
|
|
9
10
|
client: PluginContext["client"];
|
|
10
11
|
directory: string;
|
|
11
12
|
config: MagicContextConfig;
|
|
13
|
+
liveSessionState: LiveSessionState;
|
|
12
14
|
}): (() => void) | undefined;
|
|
13
15
|
//# sourceMappingURL=tui-action-consumer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-action-consumer.d.ts","sourceRoot":"","sources":["../../src/plugin/tui-action-consumer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"tui-action-consumer.d.ts","sourceRoot":"","sources":["../../src/plugin/tui-action-consumer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAGlF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7C;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IACzC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;CACtC,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA2E3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-config.d.ts","sourceRoot":"","sources":["../../src/shared/tui-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"tui-config.d.ts","sourceRoot":"","sources":["../../src/shared/tui-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CA4C9C"}
|
package/package.json
CHANGED
|
@@ -288,7 +288,7 @@ export function formatConflictShort(result: ConflictResult): string {
|
|
|
288
288
|
"",
|
|
289
289
|
...result.reasons.map((r) => `• ${r}`),
|
|
290
290
|
"",
|
|
291
|
-
"Fix: run `bunx @cortexkit/opencode-magic-context@latest doctor`",
|
|
291
|
+
"Fix: run `bunx --bun @cortexkit/opencode-magic-context@latest doctor`",
|
|
292
292
|
];
|
|
293
293
|
return lines.join("\n");
|
|
294
294
|
}
|
package/src/shared/tui-config.ts
CHANGED
|
@@ -47,8 +47,14 @@ export function ensureTuiPluginEntry(): boolean {
|
|
|
47
47
|
if (plugins[existingIdx] === PLUGIN_ENTRY) {
|
|
48
48
|
return false; // Already @latest
|
|
49
49
|
}
|
|
50
|
-
//
|
|
51
|
-
|
|
50
|
+
// Only upgrade versionless entries (bare package name) to @latest.
|
|
51
|
+
// Pinned versions (e.g. @0.8.10) are left as-is — user chose them intentionally.
|
|
52
|
+
const existing = plugins[existingIdx];
|
|
53
|
+
if (existing === PLUGIN_NAME) {
|
|
54
|
+
plugins[existingIdx] = PLUGIN_ENTRY;
|
|
55
|
+
} else {
|
|
56
|
+
return false; // Pinned version — don't touch
|
|
57
|
+
}
|
|
52
58
|
} else {
|
|
53
59
|
plugins.push(PLUGIN_ENTRY);
|
|
54
60
|
}
|
package/src/tui/index.tsx
CHANGED
|
@@ -103,7 +103,7 @@ function showConflictDialog(api: TuiPluginApi, directory: string, reasons: strin
|
|
|
103
103
|
}, 50)
|
|
104
104
|
}}
|
|
105
105
|
onCancel={() => {
|
|
106
|
-
api.ui.toast({ message: "Magic Context remains disabled. Run: bunx @cortexkit/opencode-magic-context@latest doctor", variant: "warning", duration: 5000 })
|
|
106
|
+
api.ui.toast({ message: "Magic Context remains disabled. Run: bunx --bun @cortexkit/opencode-magic-context@latest doctor", variant: "warning", duration: 5000 })
|
|
107
107
|
}}
|
|
108
108
|
/>
|
|
109
109
|
))
|
|
@@ -152,7 +152,7 @@ function showTuiSetupDialog(api: TuiPluginApi) {
|
|
|
152
152
|
}, 50)
|
|
153
153
|
}}
|
|
154
154
|
onCancel={() => {
|
|
155
|
-
api.ui.toast({ message: "You can add the sidebar later via: bunx @cortexkit/opencode-magic-context@latest doctor", variant: "info", duration: 5000 })
|
|
155
|
+
api.ui.toast({ message: "You can add the sidebar later via: bunx --bun @cortexkit/opencode-magic-context@latest doctor", variant: "info", duration: 5000 })
|
|
156
156
|
}}
|
|
157
157
|
/>
|
|
158
158
|
))
|