@cortexkit/opencode-magic-context 0.15.0 → 0.15.2

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.
Files changed (37) hide show
  1. package/README.md +12 -6
  2. package/dist/agents/magic-context-prompt.d.ts.map +1 -1
  3. package/dist/cli/diagnostics.d.ts.map +1 -1
  4. package/dist/cli/doctor.d.ts.map +1 -1
  5. package/dist/cli.js +71 -82
  6. package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
  7. package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -1
  8. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  9. package/dist/features/magic-context/storage-db.d.ts +20 -0
  10. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  11. package/dist/features/magic-context/tool-definition-tokens.d.ts +45 -0
  12. package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -0
  13. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  14. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  15. package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -1
  16. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3459 -3328
  19. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  20. package/dist/shared/bounded-session-map.d.ts +45 -0
  21. package/dist/shared/bounded-session-map.d.ts.map +1 -0
  22. package/dist/shared/data-path.d.ts +12 -0
  23. package/dist/shared/data-path.d.ts.map +1 -1
  24. package/dist/shared/models-dev-cache.d.ts.map +1 -1
  25. package/dist/shared/rpc-types.d.ts +15 -5
  26. package/dist/shared/rpc-types.d.ts.map +1 -1
  27. package/dist/tui/data/context-db.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/shared/bounded-session-map.test.ts +97 -0
  30. package/src/shared/bounded-session-map.ts +84 -0
  31. package/src/shared/data-path.test.ts +69 -0
  32. package/src/shared/data-path.ts +18 -0
  33. package/src/shared/models-dev-cache.ts +5 -10
  34. package/src/shared/rpc-types.ts +15 -5
  35. package/src/tui/data/context-db.ts +1 -0
  36. package/src/tui/index.tsx +13 -4
  37. package/src/tui/slots/sidebar-content.tsx +33 -11
package/README.md CHANGED
@@ -48,16 +48,22 @@ Keep using the **same session** for **weeks**, **months**, or even **years**. **
48
48
 
49
49
  ---
50
50
 
51
- ### ✨ New Features Graduated in v0.14
51
+ ### ✨ Recent Highlights
52
52
 
53
- **User Memories** — now enabled by default under `dreamer.user_memories`. Historian extracts behavioral observations about you alongside its normal compartment output (communication style, expertise level, review focus, working patterns). Recurring observations are promoted by the dreamer to stable user memories that appear in all sessions via `<user-profile>`. Set `dreamer.user_memories.enabled: false` to opt out. Requires dreamer.
53
+ **Subagents now self-manage context (v0.15)** — subagent sessions (historian, dreamer, Athena council members, any `mode: "subagent"` agent) now run age-based tool drops, reasoning clearing, and structural stripping at the execute threshold the same way primary sessions with `ctx_reduce_enabled: false` behave. Previously they had no automatic reduction and grew silently until overflow. Nudges, historian/compartment runs, and the `<session-history>` block remain primary-only subagents stay lean and parent-driven.
54
54
 
55
- **Key File Pinning** — now under `dreamer.pin_key_files`, still opt-in. Dreamer analyzes which files your agent reads most frequently across the session. Core orientation files (architecture, config, types) that get re-read after every context drop are pinned into the system prompt as `<key-files>`, so the agent always has them without needing to re-read from disk. Files are read fresh on each cache-busting pass. Enable with `dreamer.pin_key_files.enabled: true`.
55
+ **Lean sessions when `ctx_reduce_enabled: false` (v0.15)** — when you opt out of agent-driven reduction, the `§N§` tag prefix on user/assistant text and tool output is no longer injected, saving several thousand tokens per long session. The injected prompt guidance also switches to the no-reduce variant so the agent isn't told about a tool it can't use. DB tag records still exist (heuristic cleanup, persistence, and replay all depend on them); only the agent-visible prefix is skipped.
56
+
57
+ **User Memories (v0.14)** — enabled by default under `dreamer.user_memories`. Historian extracts behavioral observations about you alongside its normal compartment output (communication style, expertise level, review focus, working patterns). Recurring observations are promoted by the dreamer to stable user memories that appear in all sessions via `<user-profile>`. Set `dreamer.user_memories.enabled: false` to opt out. Requires dreamer.
58
+
59
+ **Key File Pinning (v0.14)** — under `dreamer.pin_key_files`, still opt-in. Dreamer analyzes which files your agent reads most frequently across the session. Core orientation files (architecture, config, types) that get re-read after every context drop are pinned into the system prompt as `<key-files>`, so the agent always has them without needing to re-read from disk. Files are read fresh on each cache-busting pass. Enable with `dreamer.pin_key_files.enabled: true`.
56
60
 
57
61
  > Migrating from an earlier version? Running `bunx --bun @cortexkit/opencode-magic-context@latest doctor` rewrites old `experimental.user_memories.*` and `experimental.pin_key_files.*` keys into their new `dreamer.*` homes, preserving any `enabled` state you had.
58
62
 
59
63
  ### 🧪 New Experimental Features
60
64
 
65
+ **Age-tier caveman text compression (v0.15)** — opt-in companion to `ctx_reduce_enabled: false`. Older user/assistant text parts are progressively compressed using deterministic [caveman rules](https://github.com/cortexkit/opencode-magic-context/blob/master/packages/plugin/src/hooks/magic-context/caveman.ts) — the oldest 20% go to ultra-compressed, next 20% to full, next 20% to lite, newest 40% untouched. Tier shifts always recompress from the pristine original, never from an already-cavemaned intermediate, so the result is stable across passes. Cache-safe by design. Enable with `experimental.caveman_text_compression: { enabled: true }`. Only active when `ctx_reduce_enabled: false`.
66
+
61
67
  **Temporal Awareness** — gives the agent real-time perception. Each user message gets a small `<!-- +5m -->`/`<!-- +2h 15m -->`/`<!-- +3d 4h -->` gap marker showing time since the previous message, and every compartment in `<session-history>` carries `start-date`/`end-date` attributes. Lets the agent reason correctly about how long a build ran, when a decision was made, or how stale a prior session is. Cache-safe — markers derive from immutable timestamps. Enable with `experimental.temporal_awareness: true`.
62
68
 
63
69
  **Git Commit Indexing** — indexes HEAD git commits (skipping merges) from the project and makes them searchable through `ctx_search`. Commits are embedded so semantic queries like "when did we change the auth pattern" or "why did we pick X over Y" surface the right work. HEAD-only, windowed to the last year by default, capped at 2000 commits per project with oldest evicted. Enable with `experimental.git_commit_indexing.enabled: true`.
@@ -161,7 +167,7 @@ Use `--force` to force-clear the plugin cache even when versions match (fixes br
161
167
  bunx --bun @cortexkit/opencode-magic-context@latest doctor --force
162
168
  ```
163
169
 
164
- 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:
170
+ Hit a real bug? Use `--issue` to collect environment, sanitized config, and the last 400 log lines into a ready-to-submit report. It can also open the issue directly via `gh` if you have it installed:
165
171
 
166
172
  ```bash
167
173
  bunx --bun @cortexkit/opencode-magic-context@latest doctor --issue
@@ -272,7 +278,7 @@ A **separate compressor** pass fires when the rendered history block exceeds the
272
278
 
273
279
  ### Nudging
274
280
 
275
- As context usage grows, Magic Context sends rolling reminders suggesting the agent reduce. Cadence tightens as usage approaches the threshold — from gentle reminders to urgent warnings. If the agent recently called `ctx_reduce`, reminders are suppressed. An emergency nudge at 80% always fires.
281
+ As context usage grows, Magic Context sends rolling reminders suggesting the agent reduce. Cadence tightens as usage approaches the threshold — from gentle reminders to urgent warnings. If the agent recently called `ctx_reduce`, reminders are suppressed. At 85% Magic Context force-materializes queued drops and emergency cleanup; at 95% it blocks the turn until background historian completes.
276
282
 
277
283
  ### Cross-session memory
278
284
 
@@ -308,7 +314,7 @@ Stable user memories are visible and manageable in the dashboard's User Memories
308
314
 
309
315
  When running in OpenCode's terminal UI, Magic Context shows a live sidebar panel with:
310
316
 
311
- - **Context breakdown bar** — visual token split across System Prompt, Compartments, Facts, Memories, and Conversation
317
+ - **Context breakdown bar** — visual token split across System Prompt, Compartments, Facts, Memories, Conversation, Tool Calls, Tool Definitions (measured from the `tool.definition` hook), and Overhead. Cool palette for structured injections, warm palette for user/tool traffic.
312
318
  - **Historian status** — idle, running, or compartment/fact counts
313
319
  - **Memory counts** — total project memories and how many are injected
314
320
  - **Dreamer status** — last run time
@@ -1 +1 @@
1
- {"version":3,"file":"magic-context-prompt.d.ts","sourceRoot":"","sources":["../../src/agents/magic-context-prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,SAAS,GACR,UAAU,GACV,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,QAAQ,GACR,QAAQ,GACR,eAAe,CAAC;AAyMtB;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOlF;AAID,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,aAAa,EAAE,MAAM,EACrB,gBAAgB,UAAO,EACvB,cAAc,UAAQ,EACtB,iBAAiB,UAAO,EACxB,wBAAwB,UAAQ,GACjC,MAAM,CAWR"}
1
+ {"version":3,"file":"magic-context-prompt.d.ts","sourceRoot":"","sources":["../../src/agents/magic-context-prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,SAAS,GACR,UAAU,GACV,OAAO,GACP,YAAY,GACZ,iBAAiB,GACjB,QAAQ,GACR,QAAQ,GACR,eAAe,CAAC;AA4MtB;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAOlF;AAID,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,aAAa,EAAE,MAAM,EACrB,gBAAgB,UAAO,EACvB,cAAc,UAAQ,EACtB,iBAAiB,UAAO,EACxB,wBAAwB,UAAQ,GACjC,MAAM,CAWR"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/cli/diagnostics.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAMrE,MAAM,WAAW,gBAAgB;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC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AAM,GAAG,IAAI,CAAC;IAC/B,kDAAkD;IAClD,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,2CAA2C;IAC3C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kGAAkG;IAClG,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;CACzB;AAoOD,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAgDpE;AASD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA8E1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA+XA,wBAAsB,SAAS,CAC3B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,OAAO,CAAC,MAAM,CAAC,CAyejB"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA4WA,wBAAsB,SAAS,CAC3B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,OAAO,CAAC,MAAM,CAAC,CAyejB"}
package/dist/cli.js CHANGED
@@ -7853,8 +7853,8 @@ var import_comment_json3 = __toESM(require_src2(), 1);
7853
7853
  import { execSync as execSync2, spawnSync } from "node:child_process";
7854
7854
  import { existsSync as existsSync7, readdirSync as readdirSync2, readFileSync as readFileSync6, rmSync, statSync as statSync2, writeFileSync as writeFileSync4 } from "node:fs";
7855
7855
  import { createRequire as createRequire3 } from "node:module";
7856
- import { homedir as homedir6, platform, tmpdir as tmpdir3 } from "node:os";
7857
- import { join as join9 } from "node:path";
7856
+ import { homedir as homedir7, tmpdir as tmpdir3 } from "node:os";
7857
+ import { join as join10 } from "node:path";
7858
7858
 
7859
7859
  // src/config/variable.ts
7860
7860
  import { existsSync, readFileSync } from "node:fs";
@@ -8482,16 +8482,26 @@ function fixConflicts(directory, conflicts) {
8482
8482
  return actions;
8483
8483
  }
8484
8484
 
8485
+ // src/shared/data-path.ts
8486
+ import * as os from "node:os";
8487
+ import * as path from "node:path";
8488
+ function getCacheDir() {
8489
+ return process.env.XDG_CACHE_HOME ?? path.join(os.homedir(), ".cache");
8490
+ }
8491
+ function getOpenCodeCacheDir() {
8492
+ return path.join(getCacheDir(), "opencode");
8493
+ }
8494
+
8485
8495
  // src/shared/tui-config.ts
8486
8496
  var import_comment_json = __toESM(require_src2(), 1);
8487
8497
  import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
8488
- import { dirname as dirname3, join as join5 } from "node:path";
8498
+ import { dirname as dirname3, join as join6 } from "node:path";
8489
8499
 
8490
8500
  // src/shared/logger.ts
8491
8501
  import * as fs from "node:fs";
8492
- import * as os from "node:os";
8493
- import * as path from "node:path";
8494
- var logFile = path.join(os.tmpdir(), "magic-context.log");
8502
+ import * as os2 from "node:os";
8503
+ import * as path2 from "node:path";
8504
+ var logFile = path2.join(os2.tmpdir(), "magic-context.log");
8495
8505
  var isTestEnv = false;
8496
8506
  var buffer = [];
8497
8507
  var flushTimer = null;
@@ -8543,8 +8553,8 @@ var PLUGIN_NAME = "@cortexkit/opencode-magic-context";
8543
8553
  var PLUGIN_ENTRY = `${PLUGIN_NAME}@latest`;
8544
8554
  function resolveTuiConfigPath() {
8545
8555
  const configDir = getOpenCodeConfigPaths({ binary: "opencode" }).configDir;
8546
- const jsoncPath = join5(configDir, "tui.jsonc");
8547
- const jsonPath = join5(configDir, "tui.json");
8556
+ const jsoncPath = join6(configDir, "tui.jsonc");
8557
+ const jsonPath = join6(configDir, "tui.json");
8548
8558
  if (existsSync4(jsoncPath))
8549
8559
  return jsoncPath;
8550
8560
  if (existsSync4(jsonPath))
@@ -8588,24 +8598,24 @@ function ensureTuiPluginEntry() {
8588
8598
 
8589
8599
  // src/cli/config-paths.ts
8590
8600
  import { existsSync as existsSync5 } from "node:fs";
8591
- import { homedir as homedir3 } from "node:os";
8592
- import { join as join6 } from "node:path";
8601
+ import { homedir as homedir4 } from "node:os";
8602
+ import { join as join7 } from "node:path";
8593
8603
  function getConfigDir() {
8594
8604
  const envDir = process.env.OPENCODE_CONFIG_DIR?.trim();
8595
8605
  if (envDir)
8596
8606
  return envDir;
8597
8607
  if (process.platform === "win32") {
8598
- return join6(homedir3(), ".config", "opencode");
8608
+ return join7(homedir4(), ".config", "opencode");
8599
8609
  }
8600
- const xdgConfig = process.env.XDG_CONFIG_HOME || join6(homedir3(), ".config");
8601
- return join6(xdgConfig, "opencode");
8610
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join7(homedir4(), ".config");
8611
+ return join7(xdgConfig, "opencode");
8602
8612
  }
8603
8613
  function findOmoConfig(configDir) {
8604
8614
  const locations = [
8605
- join6(configDir, "oh-my-openagent.jsonc"),
8606
- join6(configDir, "oh-my-openagent.json"),
8607
- join6(configDir, "oh-my-opencode.jsonc"),
8608
- join6(configDir, "oh-my-opencode.json")
8615
+ join7(configDir, "oh-my-openagent.jsonc"),
8616
+ join7(configDir, "oh-my-openagent.json"),
8617
+ join7(configDir, "oh-my-opencode.jsonc"),
8618
+ join7(configDir, "oh-my-opencode.json")
8609
8619
  ];
8610
8620
  for (const loc of locations) {
8611
8621
  if (existsSync5(loc))
@@ -8619,8 +8629,8 @@ function detectConfigPaths() {
8619
8629
  let opencodeConfigFormat;
8620
8630
  let tuiConfig;
8621
8631
  let tuiConfigFormat;
8622
- const jsoncPath = join6(configDir, "opencode.jsonc");
8623
- const jsonPath = join6(configDir, "opencode.json");
8632
+ const jsoncPath = join7(configDir, "opencode.jsonc");
8633
+ const jsonPath = join7(configDir, "opencode.json");
8624
8634
  if (existsSync5(jsoncPath)) {
8625
8635
  opencodeConfig = jsoncPath;
8626
8636
  opencodeConfigFormat = "jsonc";
@@ -8631,8 +8641,8 @@ function detectConfigPaths() {
8631
8641
  opencodeConfig = jsonPath;
8632
8642
  opencodeConfigFormat = "none";
8633
8643
  }
8634
- const tuiJsoncPath = join6(configDir, "tui.jsonc");
8635
- const tuiJsonPath = join6(configDir, "tui.json");
8644
+ const tuiJsoncPath = join7(configDir, "tui.jsonc");
8645
+ const tuiJsonPath = join7(configDir, "tui.json");
8636
8646
  if (existsSync5(tuiJsoncPath)) {
8637
8647
  tuiConfig = tuiJsoncPath;
8638
8648
  tuiConfigFormat = "jsonc";
@@ -8647,7 +8657,7 @@ function detectConfigPaths() {
8647
8657
  configDir,
8648
8658
  opencodeConfig,
8649
8659
  opencodeConfigFormat,
8650
- magicContextConfig: join6(configDir, "magic-context.jsonc"),
8660
+ magicContextConfig: join7(configDir, "magic-context.jsonc"),
8651
8661
  omoConfig: findOmoConfig(configDir),
8652
8662
  tuiConfig,
8653
8663
  tuiConfigFormat
@@ -8659,8 +8669,8 @@ var import_comment_json2 = __toESM(require_src2(), 1);
8659
8669
  import { Database } from "bun:sqlite";
8660
8670
  import { existsSync as existsSync6, readdirSync, readFileSync as readFileSync4, statSync } from "node:fs";
8661
8671
  import { createRequire as createRequire2 } from "node:module";
8662
- import { homedir as homedir4, tmpdir as tmpdir2, userInfo } from "node:os";
8663
- import { join as join7 } from "node:path";
8672
+ import { homedir as homedir5, tmpdir as tmpdir2, userInfo } from "node:os";
8673
+ import { join as join8 } from "node:path";
8664
8674
 
8665
8675
  // src/hooks/magic-context/compartment-parser.ts
8666
8676
  var COMPARTMENT_REGEX = /<compartment\s+(?:id="[^"]*"\s+)?start="(\d+)"\s+end="(\d+)"\s+title="([^"]+)"\s*>(.*?)<\/compartment>/gs;
@@ -8800,21 +8810,11 @@ function getSelfVersion() {
8800
8810
  }
8801
8811
  return "unknown";
8802
8812
  }
8803
- function getOpenCodeCacheDir() {
8804
- const xdgCache = process.env.XDG_CACHE_HOME;
8805
- if (xdgCache)
8806
- return join7(xdgCache, "opencode");
8807
- if (process.platform === "win32") {
8808
- const localAppData = process.env.LOCALAPPDATA ?? join7(homedir4(), "AppData", "Local");
8809
- return join7(localAppData, "opencode");
8810
- }
8811
- return join7(homedir4(), ".cache", "opencode");
8812
- }
8813
8813
  function getPluginCacheInfo() {
8814
- const path2 = join7(getOpenCodeCacheDir(), "packages", PLUGIN_ENTRY_WITH_VERSION);
8814
+ const path3 = join8(getOpenCodeCacheDir(), "packages", PLUGIN_ENTRY_WITH_VERSION);
8815
8815
  let cached;
8816
8816
  try {
8817
- const installedPkgPath = join7(path2, "node_modules", "@cortexkit", "opencode-magic-context", "package.json");
8817
+ const installedPkgPath = join8(path3, "node_modules", "@cortexkit", "opencode-magic-context", "package.json");
8818
8818
  if (existsSync6(installedPkgPath)) {
8819
8819
  const pkg = JSON.parse(readFileSync4(installedPkgPath, "utf-8"));
8820
8820
  cached = typeof pkg.version === "string" ? pkg.version : undefined;
@@ -8822,15 +8822,15 @@ function getPluginCacheInfo() {
8822
8822
  } catch {
8823
8823
  cached = undefined;
8824
8824
  }
8825
- return { path: path2, cached, latest: getSelfVersion() };
8825
+ return { path: path3, cached, latest: getSelfVersion() };
8826
8826
  }
8827
8827
  function getStorageDir() {
8828
- const dataHome = process.env.XDG_DATA_HOME || join7(homedir4(), ".local", "share");
8829
- return join7(dataHome, "opencode", "storage", "plugin", "magic-context");
8828
+ const dataHome = process.env.XDG_DATA_HOME || join8(homedir5(), ".local", "share");
8829
+ return join8(dataHome, "opencode", "storage", "plugin", "magic-context");
8830
8830
  }
8831
- function fileSize(path2) {
8831
+ function fileSize(path3) {
8832
8832
  try {
8833
- return existsSync6(path2) ? statSync(path2).size : 0;
8833
+ return existsSync6(path3) ? statSync(path3).size : 0;
8834
8834
  } catch {
8835
8835
  return 0;
8836
8836
  }
@@ -8839,7 +8839,7 @@ function escapeRegex(value) {
8839
8839
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
8840
8840
  }
8841
8841
  function sanitizeString(value) {
8842
- const home = homedir4();
8842
+ const home = homedir5();
8843
8843
  const username = userInfo().username;
8844
8844
  let sanitized = value;
8845
8845
  if (home) {
@@ -8863,11 +8863,11 @@ function sanitizeValue(value) {
8863
8863
  }
8864
8864
  return value;
8865
8865
  }
8866
- function readConfig2(path2) {
8867
- if (!existsSync6(path2))
8866
+ function readConfig2(path3) {
8867
+ if (!existsSync6(path3))
8868
8868
  return { value: null };
8869
8869
  try {
8870
- const raw = readFileSync4(path2, "utf-8");
8870
+ const raw = readFileSync4(path3, "utf-8");
8871
8871
  const value = import_comment_json2.parse(raw);
8872
8872
  return { value };
8873
8873
  } catch (error) {
@@ -8888,9 +8888,9 @@ function configHasPluginEntry(config) {
8888
8888
  return false;
8889
8889
  });
8890
8890
  }
8891
- function parseHistorianDumpMeta(path2) {
8891
+ function parseHistorianDumpMeta(path3) {
8892
8892
  try {
8893
- const xml = readFileSync4(path2, "utf-8");
8893
+ const xml = readFileSync4(path3, "utf-8");
8894
8894
  const parsed = parseCompartmentOutput(xml);
8895
8895
  const factCountByCategory = {};
8896
8896
  for (const fact of parsed.facts) {
@@ -8923,13 +8923,13 @@ function parseHistorianDumpMeta(path2) {
8923
8923
  }
8924
8924
  }
8925
8925
  function collectHistorianDumps() {
8926
- const dir = join7(tmpdir2(), "magic-context-historian");
8926
+ const dir = join8(tmpdir2(), "magic-context-historian");
8927
8927
  if (!existsSync6(dir)) {
8928
8928
  return { dir, count: 0, recent: [] };
8929
8929
  }
8930
8930
  try {
8931
8931
  const entries = readdirSync(dir).filter((name) => name.endsWith(".xml")).map((name) => {
8932
- const stat = statSync(join7(dir, name));
8932
+ const stat = statSync(join8(dir, name));
8933
8933
  return {
8934
8934
  name,
8935
8935
  mtime: stat.mtimeMs,
@@ -8938,7 +8938,7 @@ function collectHistorianDumps() {
8938
8938
  }).sort((a, b) => b.mtime - a.mtime);
8939
8939
  const now = Date.now();
8940
8940
  const recent = entries.slice(0, 5).map((entry) => {
8941
- const meta = parseHistorianDumpMeta(join7(dir, entry.name));
8941
+ const meta = parseHistorianDumpMeta(join8(dir, entry.name));
8942
8942
  const summary = {
8943
8943
  name: entry.name,
8944
8944
  ageMinutes: Math.round((now - entry.mtime) / 60000),
@@ -8957,7 +8957,7 @@ function collectHistorianDumps() {
8957
8957
  }
8958
8958
  }
8959
8959
  function collectHistorianFailures(storageDirPath) {
8960
- const contextDbPath = join7(storageDirPath, "context.db");
8960
+ const contextDbPath = join8(storageDirPath, "context.db");
8961
8961
  if (!existsSync6(contextDbPath))
8962
8962
  return [];
8963
8963
  let db = null;
@@ -8987,8 +8987,8 @@ async function collectDiagnostics() {
8987
8987
  const tuiConfig = readConfig2(configPaths.tuiConfig);
8988
8988
  const magicContextConfig = readConfig2(configPaths.magicContextConfig);
8989
8989
  const storageDirPath = getStorageDir();
8990
- const contextDbPath = join7(storageDirPath, "context.db");
8991
- const logPath = join7(tmpdir2(), "magic-context.log");
8990
+ const contextDbPath = join8(storageDirPath, "context.db");
8991
+ const logPath = join8(tmpdir2(), "magic-context.log");
8992
8992
  const logFileSize = existsSync6(logPath) ? statSync(logPath).size : 0;
8993
8993
  const conflictResult = detectConflicts(process.cwd());
8994
8994
  return {
@@ -9111,13 +9111,13 @@ function renderDiagnosticsMarkdown(report) {
9111
9111
 
9112
9112
  // src/cli/logs.ts
9113
9113
  import { readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "node:fs";
9114
- import { homedir as homedir5, userInfo as userInfo2 } from "node:os";
9115
- import { join as join8 } from "node:path";
9114
+ import { homedir as homedir6, userInfo as userInfo2 } from "node:os";
9115
+ import { join as join9 } from "node:path";
9116
9116
  function escapeRegex2(value) {
9117
9117
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
9118
9118
  }
9119
9119
  function sanitizeLogContent(content) {
9120
- const home = homedir5();
9120
+ const home = homedir6();
9121
9121
  const username = userInfo2().username;
9122
9122
  let sanitized = content;
9123
9123
  if (home) {
@@ -9174,7 +9174,7 @@ async function bundleIssueReport(report, description, _title) {
9174
9174
  `));
9175
9175
  const historianFailureLines = extractHistorianFailureLines(historianScanWindow, 30);
9176
9176
  const configBody = JSON.stringify(report.magicContextConfig.flags, null, 2);
9177
- const sanitizedConfigPath = report.configPaths.magicContextConfig.replace(homedir5(), "~");
9177
+ const sanitizedConfigPath = report.configPaths.magicContextConfig.replace(homedir6(), "~");
9178
9178
  const bodyMarkdown = [
9179
9179
  "## Description",
9180
9180
  description,
@@ -9205,10 +9205,10 @@ async function bundleIssueReport(report, description, _title) {
9205
9205
  "```"
9206
9206
  ].join(`
9207
9207
  `);
9208
- const path2 = join8(process.cwd(), `magic-context-issue-${formatTimestamp(new Date)}.md`);
9209
- writeFileSync3(path2, `${bodyMarkdown}
9208
+ const path3 = join9(process.cwd(), `magic-context-issue-${formatTimestamp(new Date)}.md`);
9209
+ writeFileSync3(path3, `${bodyMarkdown}
9210
9210
  `);
9211
- return { path: path2, bodyMarkdown };
9211
+ return { path: path3, bodyMarkdown };
9212
9212
  }
9213
9213
 
9214
9214
  // ../../node_modules/.bun/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
@@ -10323,26 +10323,15 @@ async function selectOne(message, options) {
10323
10323
  // src/cli/doctor.ts
10324
10324
  var PLUGIN_NAME3 = "@cortexkit/opencode-magic-context";
10325
10325
  var PLUGIN_ENTRY_WITH_VERSION2 = `${PLUGIN_NAME3}@latest`;
10326
- function getOpenCodeCacheDir2() {
10327
- const xdgCache = process.env.XDG_CACHE_HOME;
10328
- if (xdgCache)
10329
- return join9(xdgCache, "opencode");
10330
- const os2 = platform();
10331
- if (os2 === "win32") {
10332
- const localAppData = process.env.LOCALAPPDATA ?? join9(homedir6(), "AppData", "Local");
10333
- return join9(localAppData, "opencode");
10334
- }
10335
- return join9(homedir6(), ".cache", "opencode");
10336
- }
10337
10326
  async function clearPluginCache(force = false) {
10338
- const cacheDir = getOpenCodeCacheDir2();
10339
- const pluginCacheDir = join9(cacheDir, "packages", PLUGIN_ENTRY_WITH_VERSION2);
10327
+ const cacheDir = getOpenCodeCacheDir();
10328
+ const pluginCacheDir = join10(cacheDir, "packages", PLUGIN_ENTRY_WITH_VERSION2);
10340
10329
  if (!existsSync7(pluginCacheDir)) {
10341
10330
  return { action: "not_found", path: pluginCacheDir };
10342
10331
  }
10343
10332
  let cachedVersion;
10344
10333
  try {
10345
- const installedPkgPath = join9(pluginCacheDir, "node_modules", "@cortexkit", "opencode-magic-context", "package.json");
10334
+ const installedPkgPath = join10(pluginCacheDir, "node_modules", "@cortexkit", "opencode-magic-context", "package.json");
10346
10335
  if (existsSync7(installedPkgPath)) {
10347
10336
  const pkg = JSON.parse(readFileSync6(installedPkgPath, "utf-8"));
10348
10337
  if (typeof pkg?.version === "string") {
@@ -10797,7 +10786,7 @@ async function runDoctor(options = {}) {
10797
10786
  }
10798
10787
  {
10799
10788
  const ageWarnings = [];
10800
- const npmrcPath = join9(homedir6(), ".npmrc");
10789
+ const npmrcPath = join10(homedir7(), ".npmrc");
10801
10790
  if (existsSync7(npmrcPath)) {
10802
10791
  try {
10803
10792
  const npmrc = readFileSync6(npmrcPath, "utf-8");
@@ -10813,7 +10802,7 @@ async function runDoctor(options = {}) {
10813
10802
  }
10814
10803
  } catch {}
10815
10804
  }
10816
- const bunfigPath = join9(homedir6(), ".bunfig.toml");
10805
+ const bunfigPath = join10(homedir7(), ".bunfig.toml");
10817
10806
  if (existsSync7(bunfigPath)) {
10818
10807
  try {
10819
10808
  const bunfig = readFileSync6(bunfigPath, "utf-8");
@@ -10838,7 +10827,7 @@ async function runDoctor(options = {}) {
10838
10827
  issues++;
10839
10828
  }
10840
10829
  }
10841
- const logPath = join9(tmpdir3(), "magic-context.log");
10830
+ const logPath = join10(tmpdir3(), "magic-context.log");
10842
10831
  if (existsSync7(logPath)) {
10843
10832
  const logStat = statSync2(logPath);
10844
10833
  const sizeKb = (logStat.size / 1024).toFixed(0);
@@ -10846,12 +10835,12 @@ async function runDoctor(options = {}) {
10846
10835
  } else {
10847
10836
  R2.info(`Log file: ${logPath} (not yet created)`);
10848
10837
  }
10849
- const historianDumpDir = join9(tmpdir3(), "magic-context-historian");
10838
+ const historianDumpDir = join10(tmpdir3(), "magic-context-historian");
10850
10839
  if (existsSync7(historianDumpDir)) {
10851
10840
  try {
10852
10841
  const dumps = readdirSync2(historianDumpDir).filter((f) => f.endsWith(".xml")).map((f) => ({
10853
10842
  name: f,
10854
- mtime: statSync2(join9(historianDumpDir, f)).mtimeMs
10843
+ mtime: statSync2(join10(historianDumpDir, f)).mtimeMs
10855
10844
  })).sort((a, b) => b.mtime - a.mtime);
10856
10845
  if (dumps.length > 0) {
10857
10846
  R2.warn(`Historian debug dumps: ${dumps.length} file(s) in ${historianDumpDir}`);
@@ -10894,12 +10883,12 @@ function ensureDir(dir) {
10894
10883
  mkdirSync3(dir, { recursive: true });
10895
10884
  }
10896
10885
  }
10897
- function readJsonc(path2) {
10898
- const content = readFileSync7(path2, "utf-8");
10886
+ function readJsonc(path3) {
10887
+ const content = readFileSync7(path3, "utf-8");
10899
10888
  try {
10900
10889
  return import_comment_json4.parse(content);
10901
10890
  } catch (err) {
10902
- console.error(` ⚠ Failed to parse ${path2}: ${err instanceof Error ? err.message : err}`);
10891
+ console.error(` ⚠ Failed to parse ${path3}: ${err instanceof Error ? err.message : err}`);
10903
10892
  return null;
10904
10893
  }
10905
10894
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA+BH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAE3E;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAExE;AA8BD,wBAAgB,uBAAuB,IAAI,IAAI,CAS9C;AAID,UAAU,mBAAmB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACnB,mBAAmB,GAAG,IAAI,CAkC5B;AAID,UAAU,qBAAqB;IAC3B,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;CACzB;AAID,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,0BAA0B,GACjC,qBAAqB,GAAG,IAAI,CAiF9B;AAID;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAgB5E"}
1
+ {"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA+BH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAE3E;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,MAAM,CAExE;AAsGD,wBAAgB,uBAAuB,IAAI,IAAI,CAY9C;AAID,UAAU,mBAAmB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACnB,mBAAmB,GAAG,IAAI,CAgC5B;AAID,UAAU,qBAAqB;IAC3B,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;CACzB;AAID,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,0BAA0B,GACjC,qBAAqB,GAAG,IAAI,CAwF9B;AAID;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAgB5E"}
@@ -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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AAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,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,CAqV1B;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA8O3C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAkChD"}
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/migrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAsQ3C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAkChD"}
@@ -1,5 +1,25 @@
1
1
  import { Database } from "bun:sqlite";
2
2
  export declare function initializeDatabase(db: Database): void;
3
+ /**
4
+ * Heal NULL columns added via ensureColumn against pre-existing rows.
5
+ *
6
+ * SQLite does NOT backfill column defaults when ALTER TABLE ADD COLUMN runs
7
+ * on an already-populated table — old rows get NULL regardless of the
8
+ * DEFAULT clause. isSessionMetaRow used to require strict typeof === "string"
9
+ * / "number", which NULL fails, so rows with NULL columns were rejected,
10
+ * getOrCreateSessionMeta returned zeroed defaults (lastResponseTime=0,
11
+ * cacheTtl="5m"), the scheduler returned "execute" forever, and every
12
+ * execute pass mutated message content — a sustained cache-bust cascade.
13
+ *
14
+ * The validator now tolerates NULL, but we normalize the data too so every
15
+ * code path sees well-formed values. Each UPDATE is best-effort: if a column
16
+ * doesn't exist yet (migration ran on a DB older than the ensureColumn call),
17
+ * the UPDATE throws and we move on — the next schema upgrade runs ensureColumn
18
+ * first, then this heal again.
19
+ *
20
+ * Exported so migration v5 can call it. Not exported from any barrel.
21
+ */
22
+ export declare function healAllNullColumns(db: Database): void;
3
23
  export declare function openDatabase(): Database;
4
24
  export declare function isDatabasePersisted(db: Database): boolean;
5
25
  export declare function getDatabasePersistenceError(db: Database): string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"storage-db.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/storage-db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkBtC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAoVrD;AAsHD,wBAAgB,YAAY,IAAI,QAAQ,CAsCvC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAED,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAEvE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAUpC;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"storage-db.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/storage-db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkBtC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CA8TrD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAIrD;AAsHD,wBAAgB,YAAY,IAAI,QAAQ,CAsCvC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAED,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAEvE;AAED,wBAAgB,aAAa,IAAI,IAAI,CAUpC;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Tool-definition token measurement store.
3
+ *
4
+ * OpenCode's `tool.definition` hook fires once per tool per
5
+ * `ToolRegistry.tools()` call, with `{ toolID }` as input and
6
+ * `{ description, parameters }` as output. Crucially the hook input does NOT
7
+ * carry `sessionID` — the tool set is computed per
8
+ * `{providerID, modelID, agent}` combination, independent of session.
9
+ *
10
+ * We measure each tool's description + JSON-schema parameters, tokenize with
11
+ * the same Claude tokenizer used everywhere else in the plugin, and store
12
+ * per-tool totals keyed by `${providerID}/${modelID}/${agentName}`. Inner map
13
+ * keys on `toolID` so every hook fire idempotently overwrites its own slot
14
+ * (same tool set on each turn → same key → same measured total).
15
+ *
16
+ * Consumers (RPC sidebar/status handlers) look up the active session's
17
+ * measurement via `getMeasuredToolDefinitionTokens(providerID, modelID,
18
+ * agentName)`. Returns `undefined` when the key has never been measured — the
19
+ * caller is expected to fall back to residual math or show zero.
20
+ *
21
+ * The store lives entirely in-memory. A process restart re-measures on the
22
+ * first turn, which is essentially free; persisting these values across
23
+ * restarts would add schema/migration cost for no user-visible benefit.
24
+ */
25
+ /**
26
+ * Tokenize a single tool's schema and store it under the given key. Called
27
+ * from the `tool.definition` plugin hook once per tool per flight. Same
28
+ * toolID on a later flight overwrites its slot — the total for the key stays
29
+ * consistent even if descriptions or parameters drift between turns.
30
+ */
31
+ export declare function recordToolDefinition(providerID: string, modelID: string, agentName: string | undefined, toolID: string, description: string, parameters: unknown): void;
32
+ /**
33
+ * Returns the summed measured tokens for a `{provider, model, agent}` key,
34
+ * or `undefined` when never measured (e.g. fresh session before first turn).
35
+ */
36
+ export declare function getMeasuredToolDefinitionTokens(providerID: string, modelID: string, agentName: string | undefined): number | undefined;
37
+ /** Test helper: reset the store so suites don't leak measurements. */
38
+ export declare function __resetToolDefinitionMeasurements(): void;
39
+ /** Inspection helper: snapshot the current store (for debug logging/tests). */
40
+ export declare function getToolDefinitionSnapshot(): Array<{
41
+ key: string;
42
+ totalTokens: number;
43
+ toolCount: number;
44
+ }>;
45
+ //# sourceMappingURL=tool-definition-tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-definition-tokens.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/tool-definition-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAaH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,OAAO,GACpB,IAAI,CA0BN;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC3C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,GAAG,SAAS,CAOpB;AAED,sEAAsE;AACtE,wBAAgB,iCAAiC,IAAI,IAAI,CAExD;AAED,+EAA+E;AAC/E,wBA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G,CAAC,MAAM,CAAC,CAAC;IAC7B,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,kFAAkF;IAClF,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,2EAA2E;IAC3E,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,2DAA2D;IAC3D,kCAAkC,CAAC,EAAE,MAAM,CAAC;IAC5C,yFAAyF;IACzF,6BAA6B,CAAC,EAAE,OAAO,CAAC;CAC3C,GAAG;IACA,OAAO,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CA4SA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tag-content-primitives.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/tag-content-primitives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAKvD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,gBAAgB,CAItE"}
1
+ {"version":3,"file":"tag-content-primitives.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/tag-content-primitives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAuCvD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM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AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,IAK3C,QAAQ,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC7B,QAAQ;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,KAChC,OAAO,CAAC,IAAI,CAAC,CAuyBnB"}
@@ -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;AA4BlD,QAAA,MAAM,MAAM,EAAE,MA8Rb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA6BlD,QAAA,MAAM,MAAM,EAAE,MAsUb,CAAC;AAEF,eAAe,MAAM,CAAC"}