@cortexkit/opencode-magic-context 0.15.7 → 0.16.1
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 +42 -16
- package/dist/agents/magic-context-prompt.d.ts +2 -13
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +67 -4
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compaction.d.ts +1 -1
- package/dist/features/magic-context/compaction.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts +1 -1
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/compression-depth-storage.d.ts +1 -1
- package/dist/features/magic-context/compression-depth-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/queue.d.ts +8 -3
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/runner.d.ts +1 -1
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/scheduler.d.ts +1 -1
- package/dist/features/magic-context/dreamer/scheduler.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-state.d.ts +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-state.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/indexer.d.ts +1 -1
- package/dist/features/magic-context/git-commits/indexer.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts +1 -1
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commit-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commits.d.ts +1 -1
- package/dist/features/magic-context/git-commits/storage-git-commits.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/features/magic-context/key-files/read-stats.d.ts +1 -1
- package/dist/features/magic-context/key-files/read-stats.d.ts.map +1 -1
- package/dist/features/magic-context/key-files/storage-key-files.d.ts +1 -1
- package/dist/features/magic-context/key-files/storage-key-files.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-backfill.d.ts +1 -1
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/normalize-hash.d.ts.map +1 -1
- package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
- package/dist/features/magic-context/memory/promotion.d.ts +1 -1
- package/dist/features/magic-context/memory/promotion.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts +1 -1
- package/dist/features/magic-context/memory/storage-memory-embeddings.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts +1 -1
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts +1 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/mock-database.d.ts +1 -1
- package/dist/features/magic-context/mock-database.d.ts.map +1 -1
- package/dist/features/magic-context/plugin-messages.d.ts +1 -1
- package/dist/features/magic-context/plugin-messages.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/agent.d.ts +2 -1
- package/dist/features/magic-context/sidekick/agent.d.ts.map +1 -1
- package/dist/features/magic-context/sidekick/core.d.ts +38 -0
- package/dist/features/magic-context/sidekick/core.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +20 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-notes.d.ts +1 -1
- package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
- package/dist/features/magic-context/storage-ops.d.ts +1 -1
- package/dist/features/magic-context/storage-ops.d.ts.map +1 -1
- package/dist/features/magic-context/storage-source.d.ts +1 -1
- package/dist/features/magic-context/storage-source.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +17 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +1 -1
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts +1 -1
- package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +1 -1
- package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts +1 -1
- package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-flush.d.ts +1 -1
- package/dist/hooks/magic-context/execute-flush.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-state-file.d.ts +29 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts +1 -1
- package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
- package/dist/hooks/magic-context/nudge-placement-store.d.ts +1 -1
- package/dist/hooks/magic-context/nudge-placement-store.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +39 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts +6 -5
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.js +8284 -8166
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts +1 -1
- package/dist/plugin/rpc-handlers.d.ts +4 -0
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/shared/conflict-detector.d.ts.map +1 -1
- package/dist/shared/data-path.d.ts +22 -0
- package/dist/shared/data-path.d.ts.map +1 -1
- package/dist/shared/harness.d.ts +43 -0
- package/dist/shared/harness.d.ts.map +1 -0
- package/dist/shared/rpc-notifications.d.ts +4 -2
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/shared/sqlite-helpers.d.ts +16 -0
- package/dist/shared/sqlite-helpers.d.ts.map +1 -0
- package/dist/shared/sqlite.d.ts +55 -0
- package/dist/shared/sqlite.d.ts.map +1 -0
- package/dist/shared/subagent-runner.d.ts +202 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -0
- package/dist/shared/tag-transcript.d.ts +66 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -0
- package/dist/shared/transcript-opencode.d.ts +71 -0
- package/dist/shared/transcript-opencode.d.ts.map +1 -0
- package/dist/shared/transcript.d.ts +212 -0
- package/dist/shared/transcript.d.ts.map +1 -0
- package/dist/shared/tui-config.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/types.d.ts +13 -2
- package/dist/tools/ctx-memory/types.d.ts.map +1 -1
- package/dist/tools/ctx-note/tools.d.ts +8 -2
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts +1 -1
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +8 -2
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +73 -75
- package/src/shared/conflict-detector.test.ts +44 -1
- package/src/shared/conflict-detector.ts +24 -8
- package/src/shared/data-path.test.ts +53 -1
- package/src/shared/data-path.ts +28 -0
- package/src/shared/harness.ts +61 -0
- package/src/shared/rpc-notifications.ts +11 -5
- package/src/shared/sqlite-helpers.ts +27 -0
- package/src/shared/sqlite.ts +91 -0
- package/src/shared/subagent-runner.ts +206 -0
- package/src/shared/tag-transcript.ts +541 -0
- package/src/shared/transcript-opencode.ts +259 -0
- package/src/shared/transcript.ts +226 -0
- package/src/shared/tui-config.ts +34 -8
- package/src/tui/data/context-db.ts +5 -1
- package/dist/cli/config-paths.d.ts +0 -11
- package/dist/cli/config-paths.d.ts.map +0 -1
- package/dist/cli/diagnostics.d.ts +0 -82
- package/dist/cli/diagnostics.d.ts.map +0 -1
- package/dist/cli/doctor.d.ts +0 -5
- package/dist/cli/doctor.d.ts.map +0 -1
- package/dist/cli/index.d.ts +0 -3
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/logs.d.ts +0 -22
- package/dist/cli/logs.d.ts.map +0 -1
- package/dist/cli/opencode-helpers.d.ts +0 -19
- package/dist/cli/opencode-helpers.d.ts.map +0 -1
- package/dist/cli/prompts.d.ts +0 -14
- package/dist/cli/prompts.d.ts.map +0 -1
- package/dist/cli/setup.d.ts +0 -2
- package/dist/cli/setup.d.ts.map +0 -1
- package/dist/cli.js +0 -11287
package/README.md
CHANGED
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<strong>Cache-aware infinite context, cross-session memory, and background history compression for AI coding agents.</strong><br>
|
|
5
|
-
|
|
5
|
+
Keeps your agent's memory intact — no matter how long the session runs.
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://www.npmjs.com/package/@cortexkit/opencode-magic-context"><img src="https://img.shields.io/npm/v/@cortexkit/opencode-magic-context?color=blue&style=flat-square" alt="npm"></a>
|
|
10
|
-
<a href="https://
|
|
11
|
-
<a href="https://github.com/cortexkit/
|
|
12
|
-
<a href="https://github.com/cortexkit/
|
|
9
|
+
<a href="https://www.npmjs.com/package/@cortexkit/opencode-magic-context"><img src="https://img.shields.io/npm/v/@cortexkit/opencode-magic-context?label=opencode&color=blue&style=flat-square" alt="npm @cortexkit/opencode-magic-context"></a>
|
|
10
|
+
<a href="https://www.npmjs.com/package/@cortexkit/pi-magic-context"><img src="https://img.shields.io/npm/v/@cortexkit/pi-magic-context?label=pi&color=purple&style=flat-square" alt="npm @cortexkit/pi-magic-context"></a>
|
|
11
|
+
<a href="https://github.com/cortexkit/magic-context/stargazers"><img src="https://img.shields.io/github/stars/cortexkit/magic-context?style=flat-square&color=yellow" alt="stars"></a>
|
|
12
|
+
<a href="https://github.com/cortexkit/magic-context/commits"><img src="https://img.shields.io/github/last-commit/cortexkit/magic-context?style=flat-square&color=green" alt="last commit"></a>
|
|
13
|
+
<a href="https://github.com/cortexkit/magic-context/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT License"></a>
|
|
13
14
|
</p>
|
|
14
15
|
|
|
15
16
|
<p align="center">
|
|
16
|
-
<
|
|
17
|
+
Available for <a href="https://opencode.ai/">OpenCode</a> and the <a href="https://pi.dev">Pi coding agent</a>. Memories, embeddings, dreamer state, and project knowledge are <strong>shared across both</strong> — write a memory in OpenCode, retrieve it in Pi (and vice versa).
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="https://raw.githubusercontent.com/cortexkit/magic-context/master/packages/plugin/docs/animation/out/optimized2.gif" alt="Magic Context in action" width="720">
|
|
17
22
|
</p>
|
|
18
23
|
|
|
19
24
|
<p align="center">
|
|
@@ -21,7 +26,7 @@
|
|
|
21
26
|
<a href="#what-is-magic-context">What is Magic Context?</a> ·
|
|
22
27
|
<a href="#what-your-agent-gets">What Your Agent Gets</a> ·
|
|
23
28
|
<a href="#how-it-works">How It Works</a> ·
|
|
24
|
-
<a href="#magic-context-app">🖥️ Desktop App
|
|
29
|
+
<a href="#magic-context-app">🖥️ Desktop App</a> ·
|
|
25
30
|
<a href="#commands">Commands</a> ·
|
|
26
31
|
<a href="#configuration">Configuration</a>
|
|
27
32
|
</p>
|
|
@@ -62,7 +67,7 @@ Keep using the **same session** for **weeks**, **months**, or even **years**. **
|
|
|
62
67
|
|
|
63
68
|
### 🧪 New Experimental Features
|
|
64
69
|
|
|
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/
|
|
70
|
+
**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/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
71
|
|
|
67
72
|
**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`.
|
|
68
73
|
|
|
@@ -80,12 +85,12 @@ Run the interactive setup wizard — it detects your models, configures everythi
|
|
|
80
85
|
|
|
81
86
|
**macOS / Linux:**
|
|
82
87
|
```bash
|
|
83
|
-
curl -fsSL https://raw.githubusercontent.com/cortexkit/
|
|
88
|
+
curl -fsSL https://raw.githubusercontent.com/cortexkit/magic-context/master/scripts/install.sh | bash
|
|
84
89
|
```
|
|
85
90
|
|
|
86
91
|
**Windows (PowerShell):**
|
|
87
92
|
```powershell
|
|
88
|
-
irm https://raw.githubusercontent.com/cortexkit/
|
|
93
|
+
irm https://raw.githubusercontent.com/cortexkit/magic-context/master/scripts/install.ps1 | iex
|
|
89
94
|
```
|
|
90
95
|
|
|
91
96
|
**Or run directly (any OS):**
|
|
@@ -119,7 +124,7 @@ Create `magic-context.jsonc` in your project root, `.opencode/`, or `~/.config/o
|
|
|
119
124
|
|
|
120
125
|
```jsonc
|
|
121
126
|
{
|
|
122
|
-
"$schema": "https://raw.githubusercontent.com/cortexkit/
|
|
127
|
+
"$schema": "https://raw.githubusercontent.com/cortexkit/magic-context/master/assets/magic-context.schema.json",
|
|
123
128
|
"enabled": true,
|
|
124
129
|
|
|
125
130
|
// Which model the historian uses for background compression,
|
|
@@ -175,6 +180,27 @@ bunx --bun @cortexkit/opencode-magic-context@latest doctor --issue
|
|
|
175
180
|
|
|
176
181
|
---
|
|
177
182
|
|
|
183
|
+
## Pi coding agent (beta)
|
|
184
|
+
|
|
185
|
+
Magic Context is also available as a [Pi](https://github.com/mariozechner/pi-mono) extension, sharing the **same SQLite database** as the OpenCode plugin. Project memories, embeddings, dreamer state, and key-file pins are pooled across both harnesses; per-session state (tags, compartments, facts, notes) stays harness-scoped.
|
|
186
|
+
|
|
187
|
+
> ⚠️ The Pi extension is published as **beta** while it accumulates real-world usage. Core flows are validated with end-to-end tests; report issues at [github.com/cortexkit/magic-context/issues](https://github.com/cortexkit/magic-context/issues).
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Setup wizard for Pi (analogous to the OpenCode flow above)
|
|
191
|
+
bunx --bun @cortexkit/pi-magic-context@latest setup
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Requires Pi `>= 0.71.0`. The wizard handles registration with Pi (`packages` array in `~/.pi/agent/settings.json`), writes `~/.pi/agent/magic-context.jsonc`, and prompts for historian/dreamer/sidekick model picks. Pi-specific docs and config notes live in [`packages/pi-plugin/README.md`](https://github.com/cortexkit/magic-context/blob/master/packages/pi-plugin/README.md).
|
|
195
|
+
|
|
196
|
+
For health checks:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
bunx --bun @cortexkit/pi-magic-context@latest doctor
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
178
204
|
## What Your Agent Gets
|
|
179
205
|
|
|
180
206
|
Magic Context injects structured context automatically and gives the agent five tools.
|
|
@@ -353,7 +379,7 @@ On startup, Magic Context checks for common configuration problems — OpenCode'
|
|
|
353
379
|
A companion desktop app for browsing and managing Magic Context state outside of OpenCode.
|
|
354
380
|
|
|
355
381
|
<p align="center">
|
|
356
|
-
<a href="https://github.com/cortexkit/
|
|
382
|
+
<a href="https://github.com/cortexkit/magic-context/releases/tag/dashboard-v0.4.0"><strong>⬇️ Download for macOS · Windows · Linux</strong></a></p>
|
|
357
383
|
|
|
358
384
|
**Features:**
|
|
359
385
|
- **Memory Browser** — search, filter, and edit project memories with category and project filtering
|
|
@@ -413,11 +439,11 @@ All durable states live in a local SQLite database. If the database can't be ope
|
|
|
413
439
|
|
|
414
440
|
## Star History
|
|
415
441
|
|
|
416
|
-
<a href="https://www.star-history.com/?repos=cortexkit%
|
|
442
|
+
<a href="https://www.star-history.com/?repos=cortexkit%2Fmagic-context&type=date&legend=bottom-right">
|
|
417
443
|
<picture>
|
|
418
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=cortexkit/
|
|
419
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=cortexkit/
|
|
420
|
-
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=cortexkit/
|
|
444
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=cortexkit/magic-context&type=date&theme=dark&legend=top-left" />
|
|
445
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=cortexkit/magic-context&type=date&legend=top-left" />
|
|
446
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=cortexkit/magic-context&type=date&legend=top-left" />
|
|
421
447
|
</picture>
|
|
422
448
|
</a>
|
|
423
449
|
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* Each agent gets tailored guidance based on its workflow patterns.
|
|
4
|
-
*/
|
|
5
|
-
type AgentType = "sisyphus" | "atlas" | "hephaestus" | "sisyphus-junior" | "oracle" | "athena" | "athena-junior";
|
|
6
|
-
/**
|
|
7
|
-
* Detect which agent is active by scanning the system prompt for known signatures.
|
|
8
|
-
* Returns the detected agent type or null for unknown agents.
|
|
9
|
-
* Order matters — more specific signatures (e.g., "Sisyphus-Junior") are checked first.
|
|
10
|
-
*/
|
|
11
|
-
export declare function detectAgentFromSystemPrompt(systemPrompt: string): AgentType | null;
|
|
12
|
-
export declare function buildMagicContextSection(agent: AgentType | null, protectedTags: number, ctxReduceEnabled?: boolean, dreamerEnabled?: boolean, dropToolStructure?: boolean, temporalAwarenessEnabled?: boolean): string;
|
|
13
|
-
export {};
|
|
1
|
+
/** Generic magic context system prompt section shared by all agents. */
|
|
2
|
+
export declare function buildMagicContextSection(_agent: string | null, protectedTags: number, ctxReduceEnabled?: boolean, dreamerEnabled?: boolean, dropToolStructure?: boolean, temporalAwarenessEnabled?: boolean, cavemanTextCompressionEnabled?: boolean): string;
|
|
14
3
|
//# sourceMappingURL=magic-context-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-context-prompt.d.ts","sourceRoot":"","sources":["../../src/agents/magic-context-prompt.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"magic-context-prompt.d.ts","sourceRoot":"","sources":["../../src/agents/magic-context-prompt.ts"],"names":[],"mappings":"AAAA,wEAAwE;AAmFxE,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,aAAa,EAAE,MAAM,EACrB,gBAAgB,UAAO,EACvB,cAAc,UAAQ,EACtB,iBAAiB,UAAO,EACxB,wBAAwB,UAAQ,EAChC,6BAA6B,UAAQ,GACtC,MAAM,CAiBR"}
|
|
@@ -28,6 +28,18 @@ export declare const DreamingTaskSchema: z.ZodEnum<{
|
|
|
28
28
|
}>;
|
|
29
29
|
export type DreamingTask = z.infer<typeof DreamingTaskSchema>;
|
|
30
30
|
export declare const DEFAULT_DREAMER_TASKS: DreamingTask[];
|
|
31
|
+
/** Valid thinking levels for Pi subagents. Maps to Pi's --thinking CLI flag.
|
|
32
|
+
* Off: disable reasoning. Minimal/low/medium/high/xhigh: increasing reasoning depth.
|
|
33
|
+
* Pi-only — OpenCode uses `variant` in agent config instead. */
|
|
34
|
+
export declare const PiThinkingLevelSchema: z.ZodOptional<z.ZodEnum<{
|
|
35
|
+
off: "off";
|
|
36
|
+
minimal: "minimal";
|
|
37
|
+
low: "low";
|
|
38
|
+
medium: "medium";
|
|
39
|
+
high: "high";
|
|
40
|
+
xhigh: "xhigh";
|
|
41
|
+
}>>;
|
|
42
|
+
export type PiThinkingLevel = z.infer<typeof PiThinkingLevelSchema>;
|
|
31
43
|
/** Combined dreamer agent + scheduling configuration */
|
|
32
44
|
export declare const DreamerConfigSchema: z.ZodObject<{
|
|
33
45
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -99,6 +111,14 @@ export declare const DreamerConfigSchema: z.ZodObject<{
|
|
|
99
111
|
token_budget: z.ZodDefault<z.ZodNumber>;
|
|
100
112
|
min_reads: z.ZodDefault<z.ZodNumber>;
|
|
101
113
|
}, z.core.$strip>>;
|
|
114
|
+
thinking_level: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
off: "off";
|
|
116
|
+
minimal: "minimal";
|
|
117
|
+
low: "low";
|
|
118
|
+
medium: "medium";
|
|
119
|
+
high: "high";
|
|
120
|
+
xhigh: "xhigh";
|
|
121
|
+
}>>;
|
|
102
122
|
}, z.core.$strip>;
|
|
103
123
|
export type DreamerConfig = z.infer<typeof DreamerConfigSchema>;
|
|
104
124
|
export declare const SidekickConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
@@ -153,6 +173,14 @@ export declare const SidekickConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
153
173
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
154
174
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
155
175
|
system_prompt: z.ZodOptional<z.ZodString>;
|
|
176
|
+
thinking_level: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
off: "off";
|
|
178
|
+
minimal: "minimal";
|
|
179
|
+
low: "low";
|
|
180
|
+
medium: "medium";
|
|
181
|
+
high: "high";
|
|
182
|
+
xhigh: "xhigh";
|
|
183
|
+
}>>;
|
|
156
184
|
}, z.core.$strip>>;
|
|
157
185
|
export type SidekickConfig = NonNullable<z.infer<typeof SidekickConfigSchema>>;
|
|
158
186
|
/** Historian agent configuration — includes all agent overrides plus two_pass mode.
|
|
@@ -210,13 +238,21 @@ export declare const HistorianConfigSchema: z.ZodOptional<z.ZodObject<{
|
|
|
210
238
|
variant: z.ZodOptional<z.ZodString>;
|
|
211
239
|
fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
212
240
|
two_pass: z.ZodDefault<z.ZodBoolean>;
|
|
241
|
+
thinking_level: z.ZodOptional<z.ZodEnum<{
|
|
242
|
+
off: "off";
|
|
243
|
+
minimal: "minimal";
|
|
244
|
+
low: "low";
|
|
245
|
+
medium: "medium";
|
|
246
|
+
high: "high";
|
|
247
|
+
xhigh: "xhigh";
|
|
248
|
+
}>>;
|
|
213
249
|
}, z.core.$strip>>;
|
|
214
250
|
export type HistorianConfig = NonNullable<z.infer<typeof HistorianConfigSchema>>;
|
|
215
251
|
export declare const EmbeddingConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
216
252
|
provider: z.ZodDefault<z.ZodEnum<{
|
|
253
|
+
off: "off";
|
|
217
254
|
local: "local";
|
|
218
255
|
"openai-compatible": "openai-compatible";
|
|
219
|
-
off: "off";
|
|
220
256
|
}>>;
|
|
221
257
|
model: z.ZodOptional<z.ZodString>;
|
|
222
258
|
endpoint: z.ZodOptional<z.ZodString>;
|
|
@@ -233,7 +269,7 @@ export declare const EmbeddingConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
233
269
|
provider: "off";
|
|
234
270
|
model?: undefined;
|
|
235
271
|
}, {
|
|
236
|
-
provider: "
|
|
272
|
+
provider: "off" | "local" | "openai-compatible";
|
|
237
273
|
model?: string | undefined;
|
|
238
274
|
endpoint?: string | undefined;
|
|
239
275
|
api_key?: string | undefined;
|
|
@@ -393,6 +429,14 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
393
429
|
variant: z.ZodOptional<z.ZodString>;
|
|
394
430
|
fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
395
431
|
two_pass: z.ZodDefault<z.ZodBoolean>;
|
|
432
|
+
thinking_level: z.ZodOptional<z.ZodEnum<{
|
|
433
|
+
off: "off";
|
|
434
|
+
minimal: "minimal";
|
|
435
|
+
low: "low";
|
|
436
|
+
medium: "medium";
|
|
437
|
+
high: "high";
|
|
438
|
+
xhigh: "xhigh";
|
|
439
|
+
}>>;
|
|
396
440
|
}, z.core.$strip>>;
|
|
397
441
|
dreamer: z.ZodOptional<z.ZodObject<{
|
|
398
442
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -464,6 +508,14 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
464
508
|
token_budget: z.ZodDefault<z.ZodNumber>;
|
|
465
509
|
min_reads: z.ZodDefault<z.ZodNumber>;
|
|
466
510
|
}, z.core.$strip>>;
|
|
511
|
+
thinking_level: z.ZodOptional<z.ZodEnum<{
|
|
512
|
+
off: "off";
|
|
513
|
+
minimal: "minimal";
|
|
514
|
+
low: "low";
|
|
515
|
+
medium: "medium";
|
|
516
|
+
high: "high";
|
|
517
|
+
xhigh: "xhigh";
|
|
518
|
+
}>>;
|
|
467
519
|
}, z.core.$strip>>;
|
|
468
520
|
cache_ttl: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
469
521
|
default: z.ZodString;
|
|
@@ -497,9 +549,9 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
497
549
|
}, z.core.$strip>>;
|
|
498
550
|
embedding: z.ZodDefault<z.ZodPipe<z.ZodObject<{
|
|
499
551
|
provider: z.ZodDefault<z.ZodEnum<{
|
|
552
|
+
off: "off";
|
|
500
553
|
local: "local";
|
|
501
554
|
"openai-compatible": "openai-compatible";
|
|
502
|
-
off: "off";
|
|
503
555
|
}>>;
|
|
504
556
|
model: z.ZodOptional<z.ZodString>;
|
|
505
557
|
endpoint: z.ZodOptional<z.ZodString>;
|
|
@@ -516,7 +568,7 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
516
568
|
provider: "off";
|
|
517
569
|
model?: undefined;
|
|
518
570
|
}, {
|
|
519
|
-
provider: "
|
|
571
|
+
provider: "off" | "local" | "openai-compatible";
|
|
520
572
|
model?: string | undefined;
|
|
521
573
|
endpoint?: string | undefined;
|
|
522
574
|
api_key?: string | undefined;
|
|
@@ -596,6 +648,14 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
596
648
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
597
649
|
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
598
650
|
system_prompt: z.ZodOptional<z.ZodString>;
|
|
651
|
+
thinking_level: z.ZodOptional<z.ZodEnum<{
|
|
652
|
+
off: "off";
|
|
653
|
+
minimal: "minimal";
|
|
654
|
+
low: "low";
|
|
655
|
+
medium: "medium";
|
|
656
|
+
high: "high";
|
|
657
|
+
xhigh: "xhigh";
|
|
658
|
+
}>>;
|
|
599
659
|
}, z.core.$strip>>;
|
|
600
660
|
}, z.core.$strip>, z.ZodTransform<MagicContextConfig, {
|
|
601
661
|
enabled: boolean;
|
|
@@ -686,6 +746,7 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
686
746
|
maxTokens?: number | undefined;
|
|
687
747
|
variant?: string | undefined;
|
|
688
748
|
fallback_models?: string | string[] | undefined;
|
|
749
|
+
thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
689
750
|
} | undefined;
|
|
690
751
|
dreamer?: {
|
|
691
752
|
enabled: boolean;
|
|
@@ -723,6 +784,7 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
723
784
|
maxTokens?: number | undefined;
|
|
724
785
|
variant?: string | undefined;
|
|
725
786
|
fallback_models?: string | string[] | undefined;
|
|
787
|
+
thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
726
788
|
} | undefined;
|
|
727
789
|
execute_threshold_tokens?: {
|
|
728
790
|
[x: string]: number;
|
|
@@ -753,6 +815,7 @@ export declare const MagicContextConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
753
815
|
variant?: string | undefined;
|
|
754
816
|
fallback_models?: string | string[] | undefined;
|
|
755
817
|
system_prompt?: string | undefined;
|
|
818
|
+
thinking_level?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
756
819
|
} | undefined;
|
|
757
820
|
}>>;
|
|
758
821
|
//# sourceMappingURL=magic-context.d.ts.map
|
|
@@ -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;AAKxB,eAAO,MAAM,6BAA6B,QAAS,CAAC;AACpD,eAAO,MAAM,oCAAoC,KAAK,CAAC;AACvD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AACvE,0EAA0E;AAC1E,eAAO,MAAM,wCAAwC,OAAO,CAAC;AAC7D,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,8BAA8B,SAAU,CAAC;AACtD;8FAC8F;AAC9F,eAAO,MAAM,4CAA4C,KAAK,CAAC;AAC/D;;yFAEyF;AACzF,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD;+EAC+E;AAC/E,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMlE,CAAC;AAEF,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
|
|
1
|
+
{"version":3,"file":"magic-context.d.ts","sourceRo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ChC,YAAY,EAAE,OAAO,CAAC;QACtB,mCAAmC,EAAE,MAAM,CAAC;KAC/C,CAAC;IACF,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmN/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;
|
|
1
|
+
{"version":3,"file":"compaction-marker.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAgCH,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":"compaction.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,UAAU,iBAAiB;IACvB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CAAC;CACtD;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAY3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compartment-storage.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compartment-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compartment-storage.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compartment-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AA2BpF,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAsDD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB;AA+DD,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,EAAE,CAQ9E;AAED,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKpF;AAED,wB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AAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAC7C,IAAI,CASN;AAwCD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "
|
|
1
|
+
import type { Database } from "../../shared/sqlite";
|
|
2
2
|
export declare function incrementCompressionDepth(db: Database, sessionId: string, startOrdinal: number, endOrdinal: number): void;
|
|
3
3
|
export declare function getAverageCompressionDepth(db: Database, sessionId: string, startOrdinal: number, endOrdinal: number): number;
|
|
4
4
|
export declare function getMaxCompressionDepth(db: Database, sessionId: string): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compression-depth-storage.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compression-depth-storage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compression-depth-storage.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/compression-depth-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AAyDpF,wBAAgB,yBAAyB,CACrC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACnB,IAAI,CAWN;AAED,wBAAgB,0BAA0B,CACtC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACnB,MAAM,CAaR;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACtC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACnB,IAAI,CAON"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
2
|
export declare function isLeaseActive(db: Database): boolean;
|
|
3
3
|
export declare function getLeaseHolder(db: Database): string | null;
|
|
4
4
|
export declare function acquireLease(db: Database, holderId: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lease.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"lease.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/lease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAkBvD,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAGnD;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAepE;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAWlE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAUjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
2
|
export interface DreamQueueEntry {
|
|
3
3
|
id: number;
|
|
4
4
|
/** Project identity (e.g. "git:<sha>"), NOT a filesystem path */
|
|
@@ -8,8 +8,13 @@ export interface DreamQueueEntry {
|
|
|
8
8
|
startedAt: number | null;
|
|
9
9
|
}
|
|
10
10
|
export declare function ensureDreamQueueTable(db: Database): void;
|
|
11
|
-
/** Enqueue a project for dreaming. Skips if the same project already has any queue entry (queued or running).
|
|
12
|
-
|
|
11
|
+
/** Enqueue a project for dreaming. Skips if the same project already has any queue entry (queued or running).
|
|
12
|
+
*
|
|
13
|
+
* @param force - When true (e.g. manual /ctx-dream), uses the lease TTL (2 min) as the stale threshold
|
|
14
|
+
* instead of the full 2-hour max-runtime window. This lets users re-trigger dreaming after a crash or
|
|
15
|
+
* restart even when the previous queue entry was started only seconds ago.
|
|
16
|
+
*/
|
|
17
|
+
export declare function enqueueDream(db: Database, projectIdentity: string, reason: string, force?: boolean): DreamQueueEntry | null;
|
|
13
18
|
/** Peek at the next unstarted entry without claiming it. */
|
|
14
19
|
export declare function peekQueue(db: Database): DreamQueueEntry | null;
|
|
15
20
|
/** Claim the next unstarted entry atomically by marking started_at. Returns null if queue is empty. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAexD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,UAAQ,GACd,eAAe,GAAG,IAAI,CAkCxB;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,EAAE,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI,CAgB9D;AAED,uGAAuG;AACvG,wBAAgB,WAAW,CAAC,EAAE,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI,CAahE;AAED,yDAAyD;AACzD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAE/D;AAED,uGAAuG;AACvG,wBAAgB,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAI9D;AAED,6CAA6C;AAC7C,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMxE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Database } from "bun:sqlite";
|
|
2
1
|
import type { DreamingTask } from "../../../config/schema/magic-context";
|
|
3
2
|
import type { PluginContext } from "../../../plugin/types";
|
|
3
|
+
import { Database } from "../../../shared/sqlite";
|
|
4
4
|
interface ExperimentalPinKeyFilesConfig {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
token_budget: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/d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AAC;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":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/scheduler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD,MAAM,WAAW,mBAAmB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,MAAM,GACjB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAkBrD;AAaD,6GAA6G;AAC7G,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAYpF;AAED,6GAA6G;AAC7G,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,EAAE,CAkD/D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAwB9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-dream-runs.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/storage-dream-runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"storage-dream-runs.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/storage-dream-runs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,wBAAwB,CAAC;AAEvF,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;CAChD;AAwDD,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,CAarE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,WAAW,EAAE,CAMzF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
2
|
export declare function getDreamState(db: Database, key: string): string | null;
|
|
3
3
|
export declare function setDreamState(db: Database, key: string, value: string): void;
|
|
4
4
|
export declare function deleteDreamState(db: Database, key: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-dream-state.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/storage-dream-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"storage-dream-state.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/storage-dream-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,wBAAwB,CAAC;AAmCvF,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtE;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAE5E;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAEhE"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* scoped to (projectPath, operation) so the dream timer can't spawn parallel
|
|
10
10
|
* sweeps of the same project.
|
|
11
11
|
*/
|
|
12
|
-
import type { Database } from "bun:sqlite";
|
|
13
12
|
import type { EmbeddingConfig } from "../../../config/schema/magic-context";
|
|
13
|
+
import type { Database } from "../../../shared/sqlite";
|
|
14
14
|
export interface IndexCommitsOptions {
|
|
15
15
|
sinceDays: number;
|
|
16
16
|
maxCommits: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/indexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/indexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAwBvD,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB;sEACkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CACxC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,kBAAkB,CAAC,CAgE7B;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CACxC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,eAAe,GACzB,OAAO,CAAC,MAAM,CAAC,CAsDjB;AAED,2CAA2C;AAC3C,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Returns raw scored matches; the caller (unifiedSearch) slots these into
|
|
5
5
|
* the existing merged ranking with source boosts.
|
|
6
6
|
*/
|
|
7
|
-
import type { Database } from "
|
|
7
|
+
import type { Database } from "../../../shared/sqlite";
|
|
8
8
|
import type { StoredGitCommit } from "./storage-git-commits";
|
|
9
9
|
export interface GitCommitSearchHit {
|
|
10
10
|
commit: StoredGitCommit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-git-commits.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/search-git-commits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"search-git-commits.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/search-git-commits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,wBAAwB,CAAC;AAIvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAuE7D,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC;CAC5C;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;wDACoD;IACpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6EAA6E;IAC7E,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACxC;AAOD;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uBAAuB,GACjC,kBAAkB,EAAE,CAmGtB"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* serialized via Float32Array.buffer), so the same cosine-similarity helpers
|
|
7
7
|
* apply without conversion.
|
|
8
8
|
*/
|
|
9
|
-
import type { Database } from "
|
|
9
|
+
import type { Database } from "../../../shared/sqlite";
|
|
10
10
|
export declare function saveCommitEmbedding(db: Database, sha: string, embedding: Float32Array, modelId: string): void;
|
|
11
11
|
export declare function loadProjectCommitEmbeddings(db: Database, projectPath: string): Map<string, Float32Array>;
|
|
12
12
|
export declare function loadUnembeddedCommits(db: Database, projectPath: string, limit: number): Array<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-git-commit-embeddings.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/storage-git-commit-embeddings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"storage-git-commit-embeddings.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/storage-git-commit-embeddings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,wBAAwB,CAAC;AAyFvF,wBAAgB,mBAAmB,CAC/B,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,MAAM,GAChB,IAAI,CAGN;AAED,wBAAgB,2BAA2B,CACvC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,GACpB,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAW3B;AAED,wBAAgB,qBAAqB,CACjC,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,GACd,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAEzC;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEtF"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* embedding rows and FTS triggers remove matching FTS rows, so a single DELETE
|
|
13
13
|
* cleans all three tables.
|
|
14
14
|
*/
|
|
15
|
-
import type { Database } from "
|
|
15
|
+
import type { Database } from "../../../shared/sqlite";
|
|
16
16
|
import type { GitCommit } from "./git-log-reader";
|
|
17
17
|
export interface StoredGitCommit extends GitCommit {
|
|
18
18
|
projectPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-git-commits.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/storage-git-commits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"storage-git-commits.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/git-commits/storage-git-commits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,wBAAwB,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACvB;AAoFD,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAUvF;AAED;uDACuD;AACvD,wBAAgB,aAAa,CACzB,EAAE,EAAE,QAAQ,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,SAAS,EAAE,GACrB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAqCvC;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAGxE;AAED,0EAA0E;AAC1E,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7F;AAED;;;;;;qDAMqD;AACrD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAM5F;AAED;sCACsC;AACtC,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAa/F;AAED;+BAC+B;AAC/B,wBAAgB,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAKhF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Database } from "
|
|
1
|
+
import type { Database } from "../../../shared/sqlite";
|
|
2
2
|
import { type FileReadStat } from "./read-stats";
|
|
3
3
|
export declare const KEY_FILES_SYSTEM_PROMPT = "You are a file importance evaluator. Given read statistics about files in a coding session, identify which are core orientation files worth pinning in context. Return a JSON array.";
|
|
4
4
|
/**
|