@cortexkit/pi-magic-context 0.49.10 → 0.49.12
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/dist/auto-search-worker.js +4 -4
- package/dist/{compaction-marker-candidates-n4dphyz4.js → compaction-marker-candidates-k4tqg4jb.js} +2 -2
- package/dist/compaction-marker-candidates-worker.js +1 -1
- package/dist/embedding-backfill-14tqcfrn.js +20 -0
- package/dist/embedding-worker-process.js +1 -1
- package/dist/embedding-worker.js +5 -5
- package/dist/historian-calibration-extension.js +1 -1
- package/dist/{index-ta0ed2nc.js → index-1k729e4f.js} +15 -15
- package/dist/{index-g13fb2sj.js → index-3cnarwf8.js} +4 -4
- package/dist/{index-729kkhmf.js → index-46q4e104.js} +1 -1
- package/dist/{index-9vzkrnrf.js → index-53xdqb3d.js} +30 -26
- package/dist/{index-szh001qb.js → index-6dz2ed1v.js} +2 -2
- package/dist/{index-gqxsds3q.js → index-6ex901g3.js} +187 -27
- package/dist/{index-h160xxaq.js → index-6hex51s9.js} +8 -8
- package/dist/{index-gycf3sp7.js → index-7bqrfyny.js} +46 -2
- package/dist/{index-6e3yv1jt.js → index-af9nb5db.js} +243 -135
- package/dist/{index-3veejgp8.js → index-apgwdby5.js} +1 -1
- package/dist/{index-43zqh10z.js → index-d4dt19md.js} +1 -1
- package/dist/{index-fdxzpnbj.js → index-djxc8w8c.js} +1 -1
- package/dist/{index-x7426vy4.js → index-ed9d2ded.js} +18 -5
- package/dist/{index-kh3jt7t9.js → index-f18ec69t.js} +1 -1
- package/dist/{index-qc8e13wc.js → index-f6e8jsrh.js} +140 -17
- package/dist/{index-4pxydwvg.js → index-g4jf772p.js} +1 -1
- package/dist/{index-ns319t8e.js → index-gykw2zhn.js} +16 -11
- package/dist/{index-4vj37yw9.js → index-he9s4qsj.js} +16 -6
- package/dist/{index-8yjhda46.js → index-j24916mq.js} +3 -3
- package/dist/{index-ttxsmaj5.js → index-jrap43gc.js} +1 -1
- package/dist/{index-v26j81w6.js → index-xpsht877.js} +5 -5
- package/dist/{index-243wh86p.js → index-z5ftst3e.js} +9 -9
- package/dist/{index-rkwh9kce.js → index-zapgkmp7.js} +58 -34
- package/dist/index.js +453 -240
- package/dist/{logger-qg51hmp7.js → logger-dygt96rn.js} +1 -1
- package/dist/{message-index-bounded-y1c88n9a.js → message-index-bounded-ws37m1nt.js} +13 -13
- package/dist/{message-index-ejaa9may.js → message-index-dfs6k35a.js} +13 -13
- package/dist/{message-time-backfill-q9s88zdv.js → message-time-backfill-r2ar1qvk.js} +2 -2
- package/dist/migration-worker.js +9 -9
- package/dist/{project-embedding-registry-bxawck58.js → project-embedding-registry-ymvne11v.js} +10 -10
- package/dist/raw-ordinal-warmup-worker.js +12 -7
- package/dist/{read-session-chunk-4094zemt.js → read-session-chunk-83864b37.js} +8 -8
- package/dist/{read-session-raw-hm7ptnrh.js → read-session-raw-azkqjgzg.js} +6 -2
- package/dist/{safe-notification-target-62ty6rvp.js → safe-notification-target-2rkvkmw8.js} +2 -2
- package/dist/{search-hsr95vex.js → search-85e21wb8.js} +19 -19
- package/dist/{storage-tags-zh23ynsh.js → storage-tags-zmf30zqp.js} +6 -4
- package/dist/subagent-entry.js +22 -22
- package/package.json +1 -1
- package/dist/embedding-backfill-chva00z3.js +0 -20
|
@@ -18,15 +18,15 @@ var [
|
|
|
18
18
|
{ Database, registerSqliteDiagnosticSink },
|
|
19
19
|
{ log }
|
|
20
20
|
] = await Promise.all([
|
|
21
|
-
import("./embedding-backfill-
|
|
21
|
+
import("./embedding-backfill-14tqcfrn.js"),
|
|
22
22
|
import("./embedding-cache-7rp4gqzr.js"),
|
|
23
23
|
import("./storage-memory-axnsk5t1.js"),
|
|
24
|
-
import("./project-embedding-registry-
|
|
25
|
-
import("./search-
|
|
24
|
+
import("./project-embedding-registry-ymvne11v.js"),
|
|
25
|
+
import("./search-85e21wb8.js"),
|
|
26
26
|
import("./embedding-activity-ew6dshfd.js"),
|
|
27
27
|
import("./harness-9872e0ym.js"),
|
|
28
28
|
import("./sqlite-adjpy399.js"),
|
|
29
|
-
import("./logger-
|
|
29
|
+
import("./logger-dygt96rn.js")
|
|
30
30
|
]);
|
|
31
31
|
setHarness(input.harness);
|
|
32
32
|
registerSqliteDiagnosticSink(log, getHarness);
|
package/dist/{compaction-marker-candidates-n4dphyz4.js → compaction-marker-candidates-k4tqg4jb.js}
RENAMED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readMarkerCandidateBasis2,
|
|
5
5
|
prepareMarkerCandidateBasis2,
|
|
6
6
|
scanMarkerCandidateSnapshot2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-46q4e104.js";
|
|
8
8
|
import"./index-399p688g.js";
|
|
9
9
|
import"./index-asrxgdt4.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-7bqrfyny.js";
|
|
11
11
|
import"./index-0h2mkab2.js";
|
|
12
12
|
export {
|
|
13
13
|
invalidateMarkerCandidateBasis2 as invalidateMarkerCandidateBasis,
|
|
@@ -6,7 +6,7 @@ if (!port)
|
|
|
6
6
|
port.postMessage({ kind: "accepted" });
|
|
7
7
|
var [{ Database }, { scanMarkerCandidateSnapshot }] = await Promise.all([
|
|
8
8
|
import("./sqlite-adjpy399.js"),
|
|
9
|
-
import("./compaction-marker-candidates-
|
|
9
|
+
import("./compaction-marker-candidates-k4tqg4jb.js")
|
|
10
10
|
]);
|
|
11
11
|
var input = workerData;
|
|
12
12
|
var db;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureMemoryEmbeddings2
|
|
3
|
+
} from "./index-xpsht877.js";
|
|
4
|
+
import"./index-f6e8jsrh.js";
|
|
5
|
+
import"./index-9p40dgkm.js";
|
|
6
|
+
import"./index-af9nb5db.js";
|
|
7
|
+
import"./index-yhzhdp3m.js";
|
|
8
|
+
import"./index-j24916mq.js";
|
|
9
|
+
import"./index-6dz2ed1v.js";
|
|
10
|
+
import"./index-1k729e4f.js";
|
|
11
|
+
import"./index-6ex901g3.js";
|
|
12
|
+
import"./index-djxc8w8c.js";
|
|
13
|
+
import"./index-d4dt19md.js";
|
|
14
|
+
import"./index-g4jf772p.js";
|
|
15
|
+
import"./index-asrxgdt4.js";
|
|
16
|
+
import"./index-7bqrfyny.js";
|
|
17
|
+
import"./index-0h2mkab2.js";
|
|
18
|
+
export {
|
|
19
|
+
ensureMemoryEmbeddings2 as ensureMemoryEmbeddings
|
|
20
|
+
};
|
package/dist/embedding-worker.js
CHANGED
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./index-0h2mkab2.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
6
|
+
} from "./index-7bqrfyny.js";
|
|
7
|
+
import"./index-1k729e4f.js";
|
|
8
|
+
import"./index-6dz2ed1v.js";
|
|
9
|
+
import"./index-g4jf772p.js";
|
|
10
10
|
import"./index-asrxgdt4.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveLocalEmbeddingWorkerRuntime,
|
|
13
13
|
getLocalEmbeddingNativeMemoryStats,
|
|
14
14
|
LocalEmbeddingProvider
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-j24916mq.js";
|
|
16
16
|
import {
|
|
17
17
|
setStoragePrivatePermissionEnforcement
|
|
18
18
|
} from "./index-81nthk8j.js";
|
|
@@ -5541,7 +5541,7 @@ var DreamTasksSchema = object({
|
|
|
5541
5541
|
max_tokens: 12000
|
|
5542
5542
|
})),
|
|
5543
5543
|
"evaluate-smart-notes": DreamTaskBaseConfigSchema.default(() => DreamTaskBaseConfigSchema.parse(defaultTaskConfig("evaluate-smart-notes"))),
|
|
5544
|
-
"review-user-memories": ReviewUserMemoriesTaskConfigSchema.default(() => ReviewUserMemoriesTaskConfigSchema.parse(defaultTaskConfig("review-user-memories"))),
|
|
5544
|
+
"review-user-memories": ReviewUserMemoriesTaskConfigSchema.default(() => ReviewUserMemoriesTaskConfigSchema.parse(defaultTaskConfig("review-user-memories"))).describe("Promote recurring user observations into the <user-profile> block. A non-empty schedule also makes the historian collect user observations, but only while the dreamer is runnable (dreamer.disable not true); collection and review follow that one gate and do not depend on memory.enabled."),
|
|
5545
5545
|
"promote-primers": PromotePrimersTaskConfigSchema.default(() => PromotePrimersTaskConfigSchema.parse(defaultTaskConfig("promote-primers"))),
|
|
5546
5546
|
"refresh-primers": DreamTaskBaseConfigSchema.default(() => DreamTaskBaseConfigSchema.parse(defaultTaskConfig("refresh-primers")))
|
|
5547
5547
|
}).describe("Harness-independent task metadata. schedule, promotion_threshold, and other task metadata remain here; execution settings live under dreamer.opencode.tasks, dreamer.pi.tasks, or dreamer.omp.tasks.");
|
|
@@ -5559,13 +5559,13 @@ var AgentMetadataSchema = AgentOverrideConfigSchema.pick({
|
|
|
5559
5559
|
maxTokens: true
|
|
5560
5560
|
});
|
|
5561
5561
|
var DreamerConfigSchema = AgentMetadataSchema.extend({
|
|
5562
|
-
disable: boolean2().optional().describe("Disable
|
|
5562
|
+
disable: boolean2().optional().describe("Disable the dreamer: no scheduled or manual dream task runs. Also turns off smart notes (ctx_note drops surface_condition even with smart_notes.enabled true) and the historian's collection of user observations for review-user-memories. dreamer.inject_docs still applies."),
|
|
5563
5563
|
runner: _enum(["broca", "host"]).optional().describe(`Which side runs the dreamer completions the Rust module routes (classify-memories) in Rust transform mode: "host" runs them on this process's carrier, "broca" routes them to the Broca module. When unset, historian.runner applies, and when that is unset too the harness decides the same way it does for the historian. User-level config only.`),
|
|
5564
5564
|
opencode: DreamerOpenCodeHarnessBlockSchema.optional(),
|
|
5565
5565
|
pi: DreamerPiHarnessBlockSchema.optional(),
|
|
5566
5566
|
omp: DreamerOmpHarnessBlockSchema.optional(),
|
|
5567
5567
|
tasks: DreamTasksSchema.default(() => DreamTasksSchema.parse({})),
|
|
5568
|
-
inject_docs: boolean2().default(true).describe("Inject ARCHITECTURE.md and STRUCTURE.md into the m[0] `<project-docs>` block (default true)")
|
|
5568
|
+
inject_docs: boolean2().default(true).describe("Inject ARCHITECTURE.md and STRUCTURE.md into the m[0] `<project-docs>` block (default true). Not a dreamer setting despite its place under dreamer: it applies on every host, also with dreamer.disable true.")
|
|
5569
5569
|
});
|
|
5570
5570
|
var HistorianConfigSchema = AgentMetadataSchema.extend({
|
|
5571
5571
|
expand_tools: record(string2(), union([
|
|
@@ -5704,9 +5704,9 @@ var MagicContextConfigSchema = object({
|
|
|
5704
5704
|
profile: string2().trim().min(1).optional().describe("Select a named user-owned model profile. A valid project name overrides this user default; an empty string, null, or other non-string project value is ignored with a warning so the user selection still applies. Unknown names warn and use the base configuration."),
|
|
5705
5705
|
profiles: ConfigProfilesSchema.optional().describe("User-level named model profiles. A profile may contain only historian/dreamer model, fallback_models, OpenCode variant, and Pi/OMP thinking_level fields; task execution policy (including timeout_minutes) is excluded. Project configs may select a name but cannot define profiles."),
|
|
5706
5706
|
historian: HistorianConfigSchema.describe("Historian metadata plus independent strict OpenCode, Pi, and OMP execution blocks. Retained metadata stays at historian; model, fallback_models, variant, and thinking_level belong only in historian.opencode, historian.pi, or historian.omp."),
|
|
5707
|
-
dreamer: DreamerConfigSchema.optional().describe("Dreamer metadata and scheduling plus independent strict OpenCode, Pi, and OMP execution blocks. schedule and promotion_threshold stay at dreamer.tasks; model, fallback_models, variant, thinking_level, and timeout_minutes belong only in the matching harness block."),
|
|
5707
|
+
dreamer: DreamerConfigSchema.optional().describe("Dreamer metadata and scheduling plus independent strict OpenCode, Pi, and OMP execution blocks. schedule and promotion_threshold stay at dreamer.tasks; model, fallback_models, variant, thinking_level, and timeout_minutes belong only in the matching harness block. Each task follows the setting it serves: memory tasks need memory.enabled, evaluate-smart-notes needs smart_notes.enabled, review-user-memories needs its schedule, maintain-docs only a runnable dreamer."),
|
|
5708
5708
|
smart_notes: object({
|
|
5709
|
-
enabled: boolean2().default(true).describe("Enable smart-note authoring and condition evaluation. User-level only: tool definitions are process-wide. Changes require a host restart and rebuild each session's cached prompt once. Pending notes remain stored and unchecked; already-ready notes still surface."),
|
|
5709
|
+
enabled: boolean2().default(true).describe("Enable smart-note authoring and condition evaluation. Needs a runnable dreamer, which evaluates the conditions: with dreamer.disable true (or no dreamer block) ctx_note offers no surface_condition whatever this says. User-level only: tool definitions are process-wide. Changes require a host restart and rebuild each session's cached prompt once. Pending notes remain stored and unchecked; already-ready notes still surface."),
|
|
5710
5710
|
retina_handoff: boolean2().default(false).describe("When true, dreamer skips smart notes whose surface conditions compiled to retina provider configs at authoring time. Default false keeps both paths active until the retina consumer is deployed.")
|
|
5711
5711
|
}).default({ enabled: true, retina_handoff: false }).describe("Smart-note ownership transition controls."),
|
|
5712
5712
|
cache_ttl: union([string2(), object({ default: string2() }).catchall(string2())]).default("5m").describe(`How long Magic Context assumes the provider's cached prefix stays valid. This is MC's own deferral gate — it does not change the provider's actual cache lifetime. String (e.g. "5m", "1h", "30s") or per-model object ({ default: "5m", "provider/model": "1h", "provider/*": "never" }); keys resolve most-specific first (exact provider/model, bare model ID, shorter dash-prefixes, then the provider/* wildcard, then default). User and project settings, including an explicit "5m" or object default, apply on the next pass. Only built-in defaults are frozen per session, including across restarts: when unset, GPT-5.6 and later (including gpt-6*, through any provider prefix) use 30m, other models use 5m. /ctx-status shows the effective TTL and whether it comes from your config or a frozen built-in default. Editing the TTL does not itself rewrite prompt bytes; a lowered TTL rebuilds only after normal idle expiry. OpenAI documents at least 30 minutes since the latest write or reuse: https://developers.openai.com/api/docs/guides/prompt-caching (Cache lifetime and Summary of model differences). Set to "never" to mean MC never assumes expiry (for lanes kept warm externally by a cache-keep tool) — disables the idle-TTL heuristic so MC never initiates a rebuild based on elapsed time. Provider-side extended TTL is a separate request-level concern (cache_control: { ttl } in the request body).`),
|
|
@@ -5734,11 +5734,11 @@ var MagicContextConfigSchema = object({
|
|
|
5734
5734
|
object({ default: number2().int().min(0).max(1e6).optional() }).catchall(number2().int().min(0).max(1e6))
|
|
5735
5735
|
]).optional().describe("Reasoning tokens to keep on rebuilding passes. Number or per-model object; exact, shorter model keys, provider/*, then default. Omitted: fixed 10,000. 0 removes all eligible historical reasoning; newest and exempt steps always stay."),
|
|
5736
5736
|
history_budget_percentage: number2().min(0.05).max(0.5).default(DEFAULT_HISTORY_BUDGET_PERCENTAGE).describe("Fraction of usable context (context_limit × execute_threshold) reserved for the session history block (default: 0.15)"),
|
|
5737
|
-
historian_timeout_ms: number2().min(60000).default(DEFAULT_HISTORIAN_TIMEOUT_MS).describe("Timeout for each historian prompt call in both TypeScript and Rust transform modes, in milliseconds (default: 600000)"),
|
|
5737
|
+
historian_timeout_ms: number2().min(60000).default(DEFAULT_HISTORIAN_TIMEOUT_MS).describe("Timeout for each historian prompt call in both TypeScript and Rust transform modes, in milliseconds (default: 600000). A historian setting kept at the top level for compatibility; no effect while historian.disable is true or compaction.enabled is false."),
|
|
5738
5738
|
commit_cluster_trigger: object({
|
|
5739
5739
|
enabled: boolean2().default(true).describe("Enable commit-cluster based historian triggering (default: true)"),
|
|
5740
5740
|
min_clusters: number2().min(1).default(3).describe("Minimum commit clusters required to trigger historian (min: 1, default: 3)")
|
|
5741
|
-
}).default({ enabled: true, min_clusters: 3 }).describe("Commit-cluster trigger: fire historian when enough commit clusters accumulate in the unsummarized tail"),
|
|
5741
|
+
}).default({ enabled: true, min_clusters: 3 }).describe("Commit-cluster trigger: fire historian when enough commit clusters accumulate in the unsummarized tail. A historian setting kept at the top level for compatibility; no effect while historian.disable is true or compaction.enabled is false."),
|
|
5742
5742
|
system_prompt_injection: object({
|
|
5743
5743
|
enabled: boolean2().default(true).describe("When false, NO injection happens for ANY agent — global escape hatch. (default: true)"),
|
|
5744
5744
|
skip_signatures: array(string2()).default(["<!-- magic-context: skip -->"]).describe(`Substring opt-out list. If the agent's system prompt contains any of these strings, skip ALL Magic Context injection for that call. Default "<!-- magic-context: skip -->" is meant to be added inside a user's custom agent prompt to opt that agent out.`)
|
|
@@ -5783,20 +5783,20 @@ var MagicContextConfigSchema = object({
|
|
|
5783
5783
|
min_chars: number2().min(100).max(1e4).default(500).describe("Text parts shorter than this (characters) stay untouched. Min 100, max 10000. Default: 500.")
|
|
5784
5784
|
}).default({ enabled: false, min_chars: 500 }).describe("Age-tier caveman compression for long user/assistant text parts. Active for primary sessions when enabled; never for subagents. Oldest 20% of eligible tags (outside protected tail) go to ultra, next 20% to full, next 20% to lite, newest 40% untouched. Graduated from experimental.caveman_text_compression; opt-in, default off (lossy)."),
|
|
5785
5785
|
memory: object({
|
|
5786
|
-
enabled: boolean2().default(true).describe("Enable cross-session memory (default: true). Does not affect history embedding or semantic ctx_search over session history; set embedding.provider to 'off' to stop all embedding."),
|
|
5786
|
+
enabled: boolean2().default(true).describe("Enable cross-session project memory (default: true). Also gates the dreamer's project-memory tasks: while false, map-memories, verify, verify-broad, curate, compress-cues, classify-memories, retrospective, promote-primers and refresh-primers neither run on schedule nor through /ctx-dream; maintain-docs, evaluate-smart-notes and review-user-memories still run. memory.auto_search and memory.git_commit_indexing do not depend on it. Does not affect history embedding or semantic ctx_search over session history; set embedding.provider to 'off' to stop all embedding."),
|
|
5787
5787
|
injection_budget_tokens: number2().min(500).max(20000).default(4000).describe("Token budget for memory injection on session start (min: 500, max: 20000, default: 4000)"),
|
|
5788
|
-
auto_promote: boolean2().default(true).describe("Automatically promote eligible session facts into memory (default: true)"),
|
|
5789
|
-
retrieval_count_promotion_threshold: number2().min(1).default(3).describe("
|
|
5788
|
+
auto_promote: boolean2().default(true).describe("Automatically promote eligible session facts into memory (default: true). No effect while memory.enabled is false."),
|
|
5789
|
+
retrieval_count_promotion_threshold: number2().min(1).default(3).describe("Currently has no effect: no code reads this value, and memories are not promoted to permanent by retrieval count. Kept so existing configs stay valid (min: 1, default: 3)."),
|
|
5790
5790
|
auto_search: object({
|
|
5791
|
-
enabled: boolean2().default(true).describe("Automatically append a compact <ctx-search-hint> to eligible user messages when relevant memories, conversation, or commits are found. Graduated from experimental.auto_search; on by default (set false to opt out). Independent of memory.enabled."),
|
|
5791
|
+
enabled: boolean2().default(true).describe("Automatically append a compact <ctx-search-hint> to eligible user messages when relevant memories, conversation, or commits are found. Graduated from experimental.auto_search; on by default (set false to opt out). Independent of memory.enabled despite its place under memory: with memory off it still searches past conversation and commits, only the memory source is skipped."),
|
|
5792
5792
|
score_threshold: number2().min(0.3).max(0.95).default(0.6).describe("Top hit score must exceed this threshold for the hint to fire (min: 0.3, max: 0.95, default: 0.60)"),
|
|
5793
5793
|
min_prompt_chars: number2().min(5).max(500).default(20).describe("Skip hint when user message is shorter than this (min: 5, max: 500, default: 20)")
|
|
5794
|
-
}).default({ enabled: true, score_threshold: 0.6, min_prompt_chars: 20 }).describe("Auto-search hint: transform-time ctx_search on each new user message; when the top hit clears the threshold, append a compact <ctx-search-hint> block of vague fragments to that user message. Does NOT inject full content. Graduated from experimental.auto_search; enabled by default (set enabled: false to opt out). Independent of memory.enabled."),
|
|
5794
|
+
}).default({ enabled: true, score_threshold: 0.6, min_prompt_chars: 20 }).describe("Auto-search hint: transform-time ctx_search on each new user message; when the top hit clears the threshold, append a compact <ctx-search-hint> block of vague fragments to that user message. Does NOT inject full content. Graduated from experimental.auto_search; enabled by default (set enabled: false to opt out). Independent of memory.enabled despite its place under memory: with memory off it still searches past conversation and commits."),
|
|
5795
5795
|
git_commit_indexing: object({
|
|
5796
|
-
enabled: boolean2().default(false).describe("Index HEAD git commits for ctx_search (git_commit source). Graduated from experimental.git_commit_indexing; opt-in, default off. Independent of memory.enabled."),
|
|
5796
|
+
enabled: boolean2().default(false).describe("Index HEAD git commits for ctx_search (git_commit source). Graduated from experimental.git_commit_indexing; opt-in, default off. Independent of memory.enabled despite its place under memory."),
|
|
5797
5797
|
since_days: number2().min(7).max(3650).default(365).describe("Days of HEAD history to index (min: 7, max: 3650, default: 365)"),
|
|
5798
5798
|
max_commits: number2().min(100).max(20000).default(2000).describe("Max commits kept per project; oldest evicted (min: 100, max: 20000, default: 2000)")
|
|
5799
|
-
}).default({ enabled: false, since_days: 365, max_commits: 2000 }).describe("Index git commit messages from HEAD into ctx_search. Commits become a 4th searchable source alongside memories and session history. Graduated from experimental.git_commit_indexing; opt-in, default off (per-project embedding cost). Independent of memory.enabled.")
|
|
5799
|
+
}).default({ enabled: false, since_days: 365, max_commits: 2000 }).describe("Index git commit messages from HEAD into ctx_search. Commits become a 4th searchable source alongside memories and session history. Graduated from experimental.git_commit_indexing; opt-in, default off (per-project embedding cost). Independent of memory.enabled despite its place under memory.")
|
|
5800
5800
|
}).default({
|
|
5801
5801
|
enabled: true,
|
|
5802
5802
|
injection_budget_tokens: 4000,
|
|
@@ -5804,7 +5804,7 @@ var MagicContextConfigSchema = object({
|
|
|
5804
5804
|
retrieval_count_promotion_threshold: 3,
|
|
5805
5805
|
auto_search: { enabled: true, score_threshold: 0.6, min_prompt_chars: 20 },
|
|
5806
5806
|
git_commit_indexing: { enabled: false, since_days: 365, max_commits: 2000 }
|
|
5807
|
-
}).describe("Cross-session memory configuration")
|
|
5807
|
+
}).describe("Cross-session memory configuration. auto_search and git_commit_indexing sit here for history but work with memory.enabled false.")
|
|
5808
5808
|
}).transform((data) => {
|
|
5809
5809
|
return {
|
|
5810
5810
|
...data,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./index-135e8hvg.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-7bqrfyny.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureColumn,
|
|
9
9
|
healAllNullColumns,
|
|
10
10
|
installV95PerfSchema
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-jrap43gc.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveOpenCodeDbPath,
|
|
14
14
|
openCodeDbPathExists,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
normalizeStoredProjectPath,
|
|
22
22
|
storedPathBelongsToIdentity
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-6ex901g3.js";
|
|
24
24
|
import {
|
|
25
25
|
logSlowWriteTransaction
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-d4dt19md.js";
|
|
27
27
|
|
|
28
28
|
// ../plugin/src/features/magic-context/migrations.ts
|
|
29
29
|
import { isMainThread } from "node:worker_threads";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
renderToolTemplate,
|
|
5
5
|
resolveModelConfigValue,
|
|
6
6
|
deriveDefaultProtectedTokens
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-1k729e4f.js";
|
|
8
8
|
import {
|
|
9
9
|
getHarness2,
|
|
10
10
|
harnessOwnsOpenCodeStore2
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
log2,
|
|
14
14
|
sessionLog2
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-7bqrfyny.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveDecisionCalibration,
|
|
18
18
|
calibrationForModelKey,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TAG_SELECT_COLUMNS2,
|
|
24
24
|
getCandidateToolOwners2,
|
|
25
25
|
pickNearestPriorOwner2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-ed9d2ded.js";
|
|
27
27
|
import {
|
|
28
28
|
OMO_INTERNAL_INITIATOR_MARKER,
|
|
29
29
|
isSystemDirective,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
formatBlock,
|
|
39
39
|
compactTextForSummary,
|
|
40
40
|
mergeCommitHashes
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-g4jf772p.js";
|
|
42
42
|
import {
|
|
43
43
|
Database2,
|
|
44
44
|
prepareCachedStatement2
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
import {
|
|
47
47
|
stableStringify,
|
|
48
48
|
closeQuietly
|
|
49
|
-
} from "./index-
|
|
49
|
+
} from "./index-jrap43gc.js";
|
|
50
50
|
import {
|
|
51
51
|
resolveOpenCodeDbPath,
|
|
52
52
|
assertOpenCodeStoreGeneration,
|
|
@@ -71,10 +71,10 @@ import {
|
|
|
71
71
|
hasRawSessionMessageByIdFromDb2,
|
|
72
72
|
readRawSeedTailFromDb2,
|
|
73
73
|
readRawSessionBoundaryEndpointsFromDb2
|
|
74
|
-
} from "./index-
|
|
74
|
+
} from "./index-he9s4qsj.js";
|
|
75
75
|
import {
|
|
76
76
|
logSlowWriteTransaction
|
|
77
|
-
} from "./index-
|
|
77
|
+
} from "./index-d4dt19md.js";
|
|
78
78
|
|
|
79
79
|
// ../plugin/src/features/magic-context/overflow-detection.ts
|
|
80
80
|
var OVERFLOW_PATTERNS = [
|
|
@@ -2723,20 +2723,24 @@ function resolveEpochFloorForPass(db, sessionId, inputs) {
|
|
|
2723
2723
|
function openCodeDbExists() {
|
|
2724
2724
|
return harnessOwnsOpenCodeStore2() && openCodeDbPathExists(resolveOpenCodeDbPath());
|
|
2725
2725
|
}
|
|
2726
|
-
var
|
|
2727
|
-
|
|
2728
|
-
|
|
2726
|
+
var cachedReadOnlyDbs = {
|
|
2727
|
+
v1: null,
|
|
2728
|
+
v2: null
|
|
2729
|
+
};
|
|
2730
|
+
function closeCachedReadOnlyDb(generation) {
|
|
2731
|
+
const cached = cachedReadOnlyDbs[generation];
|
|
2732
|
+
if (!cached) {
|
|
2729
2733
|
return;
|
|
2730
2734
|
}
|
|
2731
2735
|
try {
|
|
2732
|
-
closeQuietly(
|
|
2736
|
+
closeQuietly(cached.db);
|
|
2733
2737
|
} catch (error) {
|
|
2734
2738
|
log2("[magic-context] failed to close cached OpenCode read-only DB:", error);
|
|
2735
2739
|
} finally {
|
|
2736
|
-
|
|
2740
|
+
cachedReadOnlyDbs[generation] = null;
|
|
2737
2741
|
}
|
|
2738
2742
|
}
|
|
2739
|
-
function getReadOnlySessionDb() {
|
|
2743
|
+
function getReadOnlySessionDb(generation = "v1") {
|
|
2740
2744
|
if (!harnessOwnsOpenCodeStore2()) {
|
|
2741
2745
|
throw new Error("OpenCode session database is not readable from a Pi-compatible process; its history lives in Pi sessions");
|
|
2742
2746
|
}
|
|
@@ -2745,18 +2749,19 @@ function getReadOnlySessionDb() {
|
|
|
2745
2749
|
if (!openCodeDbPathExists(resolution)) {
|
|
2746
2750
|
throw new Error(`OpenCode session database is unavailable at ${dbPath} (source=${resolution.source})`);
|
|
2747
2751
|
}
|
|
2748
|
-
|
|
2749
|
-
|
|
2752
|
+
const cached = cachedReadOnlyDbs[generation];
|
|
2753
|
+
if (cached?.path === dbPath) {
|
|
2754
|
+
return cached.db;
|
|
2750
2755
|
}
|
|
2751
|
-
closeCachedReadOnlyDb();
|
|
2756
|
+
closeCachedReadOnlyDb(generation);
|
|
2752
2757
|
const db = new Database2(dbPath, { readonly: true });
|
|
2753
2758
|
try {
|
|
2754
|
-
assertOpenCodeStoreGeneration(db,
|
|
2759
|
+
assertOpenCodeStoreGeneration(db, generation, dbPath);
|
|
2755
2760
|
} catch (error) {
|
|
2756
2761
|
closeQuietly(db);
|
|
2757
2762
|
throw error;
|
|
2758
2763
|
}
|
|
2759
|
-
|
|
2764
|
+
cachedReadOnlyDbs[generation] = { path: dbPath, db };
|
|
2760
2765
|
clearOpenCodeDbReadFailure();
|
|
2761
2766
|
return db;
|
|
2762
2767
|
}
|
|
@@ -2785,15 +2790,14 @@ function getMessageTimesFromOpenCodeDb(sessionId, messageIds) {
|
|
|
2785
2790
|
if (messageIds.length === 0 || !harnessOwnsOpenCodeStore2())
|
|
2786
2791
|
return result;
|
|
2787
2792
|
try {
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
}
|
|
2793
|
+
const placeholders = messageIds.map(() => "?").join(",");
|
|
2794
|
+
const rows = getHarness2() === "opencode2" ? getReadOnlySessionDb("v2").prepare(`SELECT id, COALESCE(time_created, json_extract(data, '$.time.created')) AS time_created
|
|
2795
|
+
FROM session_message WHERE +session_id = ? AND id IN (${placeholders})`).all(sessionId, ...messageIds) : withReadOnlySessionDb((db) => db.prepare(`SELECT id, time_created FROM message WHERE +session_id = ? AND id IN (${placeholders})`).all(sessionId, ...messageIds));
|
|
2796
|
+
for (const row of rows) {
|
|
2797
|
+
if (typeof row.id === "string" && typeof row.time_created === "number") {
|
|
2798
|
+
result.set(row.id, row.time_created);
|
|
2795
2799
|
}
|
|
2796
|
-
}
|
|
2800
|
+
}
|
|
2797
2801
|
} catch (error) {
|
|
2798
2802
|
logProbeFailureOnce(resolveOpenCodeDbPath(), error);
|
|
2799
2803
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-g4jf772p.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./index-0h2mkab2.js";
|
|
7
7
|
import {
|
|
8
8
|
log2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-7bqrfyny.js";
|
|
10
10
|
import {
|
|
11
11
|
inRootAsyncContext2
|
|
12
12
|
} from "./index-asrxgdt4.js";
|