@cortexkit/opencode-magic-context 0.21.8 → 0.22.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 +124 -323
- package/dist/agents/magic-context-prompt.d.ts.map +1 -1
- package/dist/agents/permissions.d.ts +29 -14
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/migrate-experimental.d.ts +29 -0
- package/dist/config/migrate-experimental.d.ts.map +1 -0
- package/dist/config/schema/agent-overrides.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +95 -104
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/features/builtin-commands/commands.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-embedding.d.ts +34 -0
- package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-events.d.ts +50 -0
- package/dist/features/magic-context/compartment-events.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-storage.d.ts +22 -0
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/queue.d.ts +13 -2
- package/dist/features/magic-context/dreamer/queue.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/runner.d.ts +11 -0
- package/dist/features/magic-context/dreamer/runner.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts +1 -1
- package/dist/features/magic-context/dreamer/task-prompts.d.ts.map +1 -1
- package/dist/features/magic-context/git-commits/git-log-reader.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/project-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/memory/constants.d.ts +4 -0
- package/dist/features/magic-context/memory/constants.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-identity.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-openai.d.ts +6 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-probe.d.ts +5 -0
- package/dist/features/magic-context/memory/embedding-probe.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/index.d.ts +1 -1
- package/dist/features/magic-context/memory/index.d.ts.map +1 -1
- package/dist/features/magic-context/memory/memory-migration.d.ts +133 -0
- package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -0
- package/dist/features/magic-context/memory/project-identity.d.ts +38 -7
- package/dist/features/magic-context/memory/project-identity.d.ts.map +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 +15 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/memory/types.d.ts +3 -1
- package/dist/features/magic-context/memory/types.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +7 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/project-docs-hash.d.ts +6 -0
- package/dist/features/magic-context/project-docs-hash.d.ts.map +1 -0
- package/dist/features/magic-context/project-identity.d.ts +2 -0
- package/dist/features/magic-context/project-identity.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +51 -7
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-historian-runs.d.ts +73 -0
- package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -0
- package/dist/features/magic-context/storage-identity-rekey-map.d.ts +11 -0
- package/dist/features/magic-context/storage-identity-rekey-map.d.ts.map +1 -0
- package/dist/features/magic-context/storage-m0-mutation-log.d.ts +22 -0
- package/dist/features/magic-context/storage-m0-mutation-log.d.ts.map +1 -0
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts +25 -0
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts.map +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +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 +44 -0
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -0
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-project-state.d.ts +19 -0
- package/dist/features/magic-context/storage-project-state.d.ts.map +1 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts +9 -0
- package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +21 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage-v22-backfill-failures.d.ts +24 -0
- package/dist/features/magic-context/storage-v22-backfill-failures.d.ts.map +1 -0
- package/dist/features/magic-context/storage.d.ts +12 -3
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts +1 -1
- package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +15 -1
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/types.d.ts +21 -0
- package/dist/features/magic-context/types.d.ts.map +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.map +1 -1
- package/dist/features/magic-context/v22-deferred-backfill.d.ts +46 -0
- package/dist/features/magic-context/v22-deferred-backfill.d.ts.map +1 -0
- package/dist/features/magic-context/work-metrics.d.ts +66 -0
- package/dist/features/magic-context/work-metrics.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/cache.d.ts.map +1 -1
- package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +9 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +13 -1
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-parser.d.ts +25 -0
- package/dist/hooks/magic-context/compartment-parser.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-prompt.d.ts +27 -16
- package/dist/hooks/magic-context/compartment-prompt.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts +6 -2
- package/dist/hooks/magic-context/compartment-runner-mapping.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts +9 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts +67 -4
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/decay-curve.d.ts +78 -0
- package/dist/hooks/magic-context/decay-curve.d.ts.map +1 -0
- package/dist/hooks/magic-context/decay-render.d.ts +67 -0
- package/dist/hooks/magic-context/decay-render.d.ts.map +1 -0
- package/dist/hooks/magic-context/event-handler.d.ts +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts +17 -0
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts +2 -0
- package/dist/hooks/magic-context/historian-prompt.generated.d.ts.map +1 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts +3 -0
- package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +9 -21
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts +126 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/key-files-block.d.ts.map +1 -1
- package/dist/hooks/magic-context/live-session-state.d.ts +9 -0
- package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts +35 -0
- package/dist/hooks/magic-context/m0-token-breakdown.d.ts.map +1 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts +9 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-db.d.ts +7 -0
- package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +104 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -0
- package/dist/hooks/magic-context/reference-retrieval.d.ts +61 -0
- package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -0
- package/dist/hooks/magic-context/reference-seeds.generated.d.ts +8 -0
- package/dist/hooks/magic-context/reference-seeds.generated.d.ts.map +1 -0
- package/dist/hooks/magic-context/send-session-notification.d.ts +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 +5 -6
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts +6 -0
- package/dist/hooks/magic-context/tokenizer-calibration.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts +0 -7
- package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +18 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +9 -7
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/upgrade-reminder.d.ts +73 -0
- package/dist/hooks/magic-context/upgrade-reminder.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9435 -4001
- package/dist/plugin/conflict-warning-hook.d.ts +13 -0
- package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
- package/dist/plugin/dream-timer.d.ts.map +1 -1
- package/dist/plugin/event.d.ts +10 -0
- package/dist/plugin/event.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/messages-transform.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/shared/announcement.d.ts +17 -1
- package/dist/shared/announcement.d.ts.map +1 -1
- package/dist/shared/models-dev-cache.d.ts.map +1 -1
- package/dist/shared/rpc-client.d.ts +1 -0
- package/dist/shared/rpc-client.d.ts.map +1 -1
- package/dist/shared/rpc-notifications.d.ts +27 -5
- package/dist/shared/rpc-notifications.d.ts.map +1 -1
- package/dist/shared/rpc-server.d.ts +1 -0
- package/dist/shared/rpc-server.d.ts.map +1 -1
- package/dist/shared/rpc-types.d.ts +30 -2
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/shared/rpc-utils.d.ts +9 -0
- package/dist/shared/rpc-utils.d.ts.map +1 -1
- package/dist/shared/sqlite-helpers.d.ts +7 -7
- package/dist/shared/sqlite.d.ts +23 -14
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts +10 -1
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts +5 -1
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tui/data/context-db.d.ts +16 -1
- package/dist/tui/data/context-db.d.ts.map +1 -1
- package/package.json +5 -7
- package/src/shared/announcement.test.ts +23 -7
- package/src/shared/announcement.ts +30 -8
- package/src/shared/conflict-detector.test.ts +15 -2
- package/src/shared/conflict-fixer.test.ts +5 -1
- package/src/shared/models-dev-cache.test.ts +72 -4
- package/src/shared/models-dev-cache.ts +47 -8
- package/src/shared/opencode-compaction-detector.test.ts +10 -2
- package/src/shared/rpc-client.test.ts +54 -3
- package/src/shared/rpc-client.ts +19 -9
- package/src/shared/rpc-notifications.test.ts +54 -1
- package/src/shared/rpc-notifications.ts +82 -13
- package/src/shared/rpc-server.ts +33 -4
- package/src/shared/rpc-types.ts +30 -2
- package/src/shared/rpc-utils.ts +10 -0
- package/src/shared/sqlite-helpers.ts +9 -9
- package/src/shared/sqlite.ts +99 -80
- package/src/shared/tag-transcript.test.ts +280 -0
- package/src/shared/tag-transcript.ts +162 -33
- package/src/tui/data/context-db.ts +75 -11
- package/src/tui/index.tsx +223 -32
- package/src/tui/slots/sidebar-content.tsx +366 -34
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts +0 -87
- package/dist/hooks/magic-context/compartment-runner-compressor.d.ts.map +0 -1
- package/dist/shared/native-binding.d.ts +0 -87
- package/dist/shared/native-binding.d.ts.map +0 -1
- package/src/shared/native-binding.ts +0 -311
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { type Compartment, type SessionFact } from "../../features/magic-context/compartment-storage";
|
|
1
3
|
import type { Memory } from "../../features/magic-context/memory/types";
|
|
4
|
+
import { type UserMemory } from "../../features/magic-context/user-memory/storage-user-memory";
|
|
2
5
|
import type { Database } from "../../shared/sqlite";
|
|
6
|
+
import { type KeyFilesConfigForRender } from "./key-files-block";
|
|
3
7
|
import type { MessageLike } from "./tag-messages";
|
|
4
8
|
export interface PreparedCompartmentInjection {
|
|
5
9
|
block: string;
|
|
@@ -49,4 +53,126 @@ export declare function renderMemoryBlock(memories: Memory[]): string | null;
|
|
|
49
53
|
export declare function trimMemoriesToBudget(sessionId: string, memories: Memory[], budgetTokens: number): Memory[];
|
|
50
54
|
export declare function prepareCompartmentInjection(db: Database, sessionId: string, messages: MessageLike[], isCacheBusting: boolean, projectPath?: string, injectionBudgetTokens?: number, temporalAwareness?: boolean): PreparedCompartmentInjection | null;
|
|
51
55
|
export declare function renderCompartmentInjection(sessionId: string, messages: MessageLike[], prepared: PreparedCompartmentInjection): CompartmentInjectionResult;
|
|
56
|
+
export interface M0SnapshotMarkers {
|
|
57
|
+
projectMemoryEpoch: number;
|
|
58
|
+
projectUserProfileVersion: number;
|
|
59
|
+
maxCompartmentSeq: number;
|
|
60
|
+
maxMemoryId: number;
|
|
61
|
+
maxMutationId: number;
|
|
62
|
+
maxMemoryMutationId: number;
|
|
63
|
+
projectDocsHash: string;
|
|
64
|
+
materializedAt: number;
|
|
65
|
+
sessionFactsVersion: number;
|
|
66
|
+
upgradeState: string | null;
|
|
67
|
+
}
|
|
68
|
+
export interface M0M1State {
|
|
69
|
+
sessionId: string;
|
|
70
|
+
isSubagent?: boolean;
|
|
71
|
+
cachedM0Bytes: Buffer | null;
|
|
72
|
+
cachedM1Bytes: Buffer | null;
|
|
73
|
+
cachedM0ProjectMemoryEpoch: number | null;
|
|
74
|
+
cachedM0ProjectUserProfileVersion: number | null;
|
|
75
|
+
cachedM0MaxCompartmentSeq: number | null;
|
|
76
|
+
cachedM0MaxMemoryId: number | null;
|
|
77
|
+
cachedM0MaxMutationId: number | null;
|
|
78
|
+
cachedM0MaxMemoryMutationId: number | null;
|
|
79
|
+
cachedM0ProjectDocsHash: string | null;
|
|
80
|
+
cachedM0MaterializedAt: number | null;
|
|
81
|
+
cachedM0SessionFactsVersion: number | null;
|
|
82
|
+
cachedM0UpgradeState: string | null;
|
|
83
|
+
snapshotMarkers?: M0SnapshotMarkers | null;
|
|
84
|
+
}
|
|
85
|
+
export interface M0M1RenderOptions {
|
|
86
|
+
db: Database;
|
|
87
|
+
sessionId: string;
|
|
88
|
+
messages?: MessageLike[];
|
|
89
|
+
state: M0M1State;
|
|
90
|
+
projectPath?: string;
|
|
91
|
+
projectDirectory?: string;
|
|
92
|
+
memoryInjectionBudgetTokens?: number;
|
|
93
|
+
historyBudgetTokens?: number;
|
|
94
|
+
userProfileBudgetTokens?: number;
|
|
95
|
+
keyFiles?: KeyFilesConfigForRender;
|
|
96
|
+
isCacheBustingPass?: boolean;
|
|
97
|
+
preRenderedKeyFilesBlock?: string | null;
|
|
98
|
+
beforePhase3ForTest?: () => void;
|
|
99
|
+
}
|
|
100
|
+
export interface MaterializeDecision {
|
|
101
|
+
value: boolean;
|
|
102
|
+
reason: string | null;
|
|
103
|
+
}
|
|
104
|
+
export interface MaterializeM0Result {
|
|
105
|
+
m0Bytes: Buffer;
|
|
106
|
+
m0Text: string;
|
|
107
|
+
m1Bytes: Buffer;
|
|
108
|
+
m1Text: string;
|
|
109
|
+
snapshotMarkers: M0SnapshotMarkers;
|
|
110
|
+
renderedMemoryIds: number[];
|
|
111
|
+
}
|
|
112
|
+
export interface InjectM0M1Result {
|
|
113
|
+
injected: boolean;
|
|
114
|
+
m0RematerializedThisPass: boolean;
|
|
115
|
+
materializationContentionRetryExhausted: boolean;
|
|
116
|
+
decision: MaterializeDecision;
|
|
117
|
+
m0Bytes: Buffer | null;
|
|
118
|
+
m1Text: string | null;
|
|
119
|
+
}
|
|
120
|
+
export declare class MaterializeContentionError extends Error {
|
|
121
|
+
readonly retries: number;
|
|
122
|
+
readonly reason: string;
|
|
123
|
+
constructor(args?: {
|
|
124
|
+
retries?: number;
|
|
125
|
+
reason?: string;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
export declare class RenderM1InvalidMarkersError extends Error {
|
|
129
|
+
constructor(sessionId: string);
|
|
130
|
+
}
|
|
131
|
+
type M0Compartment = Compartment;
|
|
132
|
+
export declare const DEFAULT_MEMORY_BUDGET_TOKENS = 8000;
|
|
133
|
+
export declare const DEFAULT_USER_PROFILE_BUDGET_TOKENS = 4000;
|
|
134
|
+
export declare function readCurrentM0SnapshotMarkers(args: {
|
|
135
|
+
db: Database;
|
|
136
|
+
sessionId: string;
|
|
137
|
+
projectPath?: string;
|
|
138
|
+
projectDirectory?: string;
|
|
139
|
+
}): M0SnapshotMarkers;
|
|
140
|
+
export declare function mustMaterialize(args: {
|
|
141
|
+
db: Database;
|
|
142
|
+
sessionId: string;
|
|
143
|
+
state: M0M1State;
|
|
144
|
+
projectPath?: string;
|
|
145
|
+
projectDirectory?: string;
|
|
146
|
+
}): MaterializeDecision;
|
|
147
|
+
export interface TrimMemoriesResultV2 {
|
|
148
|
+
selected: Memory[];
|
|
149
|
+
renderOrder: Memory[];
|
|
150
|
+
}
|
|
151
|
+
export declare function trimMemoriesToBudgetV2(sessionId: string, memories: Memory[], budgetTokens: number): TrimMemoriesResultV2;
|
|
152
|
+
export declare function trimUserMemoriesToBudget(memories: UserMemory[], budgetTokens: number): UserMemory[];
|
|
153
|
+
/**
|
|
154
|
+
* Render ONE memory's v2 line exactly as it lands in the <project-memory> block.
|
|
155
|
+
* Shared by renderMemoryBlockV2 (the wire render) and trimMemoriesToBudgetV2
|
|
156
|
+
* (the budget accounting) so the budget is measured against the SAME bytes that
|
|
157
|
+
* get injected — including the id/category/importance attributes. Measuring a
|
|
158
|
+
* lighter shape (e.g. "- content") under-counts and lets the injected block
|
|
159
|
+
* exceed the configured budget.
|
|
160
|
+
*/
|
|
161
|
+
export declare function renderMemoryLineV2(memory: Memory): string;
|
|
162
|
+
export declare function renderMemoryBlockV2(memories: Memory[], wrapper?: string): string;
|
|
163
|
+
export declare function renderM0(args: {
|
|
164
|
+
projectDocs: string;
|
|
165
|
+
userProfileBaseline: UserMemory[];
|
|
166
|
+
compartments: M0Compartment[];
|
|
167
|
+
memories: Memory[];
|
|
168
|
+
facts: SessionFact[];
|
|
169
|
+
historyBudgetTokens?: number;
|
|
170
|
+
userProfileBudgetTokens?: number;
|
|
171
|
+
decayPressureMultiplier?: number;
|
|
172
|
+
}): string;
|
|
173
|
+
export declare function materializeM0(options: M0M1RenderOptions): MaterializeM0Result;
|
|
174
|
+
export declare function materializeWithRetry(options: M0M1RenderOptions, maxRetries?: number): MaterializeM0Result;
|
|
175
|
+
export declare function renderM1(options: M0M1RenderOptions, markers: M0SnapshotMarkers, renderedMemoryIds?: readonly number[]): string;
|
|
176
|
+
export declare function injectM0M1(options: M0M1RenderOptions): InjectM0M1Result;
|
|
177
|
+
export {};
|
|
52
178
|
//# sourceMappingURL=inject-compartments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-compartments.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/inject-compartments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inject-compartments.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/inject-compartments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAEH,KAAK,WAAW,EAKhB,KAAK,WAAW,EACnB,MAAM,kDAAkD,CAAC;AAY1D,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,2CAA2C,CAAC;AAWxF,OAAO,EAEH,KAAK,UAAU,EAClB,MAAM,8DAA8D,CAAC;AAGtE,OAAO,KAAK,EAAE,QAAQ,EAAkC,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAsB,KAAK,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAGrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,MAAM,WAAW,4BAA4B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,GAAG,IAAI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c,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,uBAAuB,CAAC;CACpC,GAAG,MAAM,GAAG,IAAI,CA2BhB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RecompProgress } from "./compartment-runner-types";
|
|
1
2
|
import type { AgentBySession, LiveModelBySession, VariantBySession } from "./hook-handlers";
|
|
2
3
|
/**
|
|
3
4
|
* Plugin-process-scoped shared state. Lives in `index.ts` and is threaded into
|
|
@@ -37,6 +38,14 @@ export interface LiveSessionState {
|
|
|
37
38
|
* Populated on first successful resolution; cleared on `session.deleted`.
|
|
38
39
|
*/
|
|
39
40
|
sessionDirectoryBySession: Map<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Live recomp / session-upgrade progress, keyed by sessionId. Written by the
|
|
43
|
+
* RPC recomp/upgrade handlers (via the runner's `onRecompProgress` callback
|
|
44
|
+
* plus their own migration/terminal updates) and read by `buildSidebarSnapshot`
|
|
45
|
+
* so the TUI sidebar + /ctx-status can show a live progress bar. In-memory
|
|
46
|
+
* only — a process restart interrupts the recomp anyway.
|
|
47
|
+
*/
|
|
48
|
+
recompProgressBySession: Map<string, RecompProgress>;
|
|
40
49
|
}
|
|
41
50
|
export declare function createLiveSessionState(): LiveSessionState;
|
|
42
51
|
//# sourceMappingURL=live-session-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-session-state.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/live-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC7B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,EAAE,cAAc,CAAC;IAC/B,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,8BAA8B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,8BAA8B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,+BAA+B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7C;;;;;;;;;;;OAWG;IACH,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"live-session-state.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/live-session-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC7B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,EAAE,cAAc,CAAC;IAC/B,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,8BAA8B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,8BAA8B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,+BAA+B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7C;;;;;;;;;;;OAWG;IACH,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C;;;;;;OAMG;IACH,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACxD;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAazD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ContextDatabase } from "../../features/magic-context/storage";
|
|
2
|
+
/**
|
|
3
|
+
* Per-block token attribution for the synthetic m[0] message, shared by BOTH
|
|
4
|
+
* harnesses (OpenCode sidebar/RPC + Pi /ctx-status dialog) so they NEVER
|
|
5
|
+
* diverge on what the categories are or how they're measured.
|
|
6
|
+
*
|
|
7
|
+
* v2 reality this encodes:
|
|
8
|
+
* - Compartments are DECAY-RENDERED — the real on-wire `<session-history>`
|
|
9
|
+
* slice is far smaller than Σ(full p1 content), so we measure the ACTUAL
|
|
10
|
+
* slice of the persisted m[0] snapshot (cached_m0_bytes), not Σp1.
|
|
11
|
+
* - `<project-docs>` and `<user-profile>` moved into m[0] (out of the system
|
|
12
|
+
* prompt) — they are their own buckets, not Conversation.
|
|
13
|
+
* - Memories render as the v2 `<project-memory>` slice (id/category/importance
|
|
14
|
+
* attributes), not the legacy v1 `memory_block_cache` "- content" shape.
|
|
15
|
+
* - Facts are RETIRED as a render source (promoted to memories) → factTokens
|
|
16
|
+
* is always 0; the field is kept only for dashboard/back-compat shape.
|
|
17
|
+
*
|
|
18
|
+
* Cold-start fallbacks (no materialized m[0] yet) mirror what WILL be injected
|
|
19
|
+
* on first render: Σp1 for compartments and an on-demand v2 memory render.
|
|
20
|
+
*/
|
|
21
|
+
export interface M0BlockTokens {
|
|
22
|
+
docsTokens: number;
|
|
23
|
+
profileTokens: number;
|
|
24
|
+
memoryTokens: number;
|
|
25
|
+
compartmentTokens: number;
|
|
26
|
+
/** Always 0 in v2 (facts promoted to memories); kept for shape stability. */
|
|
27
|
+
factTokens: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function computeM0BlockTokens(db: ContextDatabase, sessionId: string, args: {
|
|
30
|
+
m0Text: string;
|
|
31
|
+
projectIdentity: string | undefined;
|
|
32
|
+
injectionBudgetTokens: number | undefined;
|
|
33
|
+
memoryBlockCount: number;
|
|
34
|
+
}): M0BlockTokens;
|
|
35
|
+
//# sourceMappingURL=m0-token-breakdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"m0-token-breakdown.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/m0-token-breakdown.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAK5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,aAAa;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IACF,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC;CAC5B,GACF,aAAa,CAkEf"}
|
|
@@ -39,6 +39,15 @@ export declare function setRawMessageProvider(sessionId: string, provider: RawMe
|
|
|
39
39
|
* Run `fn` with a temporary per-session provider override. Cleans up
|
|
40
40
|
* on return regardless of throw — preferred over manual
|
|
41
41
|
* `setRawMessageProvider` / `cleanup()` pairs.
|
|
42
|
+
*
|
|
43
|
+
* ASYNC-SAFE: if `fn` returns a promise, cleanup is deferred until that promise
|
|
44
|
+
* settles, so the provider stays registered for the WHOLE async scope. A bare
|
|
45
|
+
* synchronous `finally` would unregister at `fn`'s FIRST `await` (the function
|
|
46
|
+
* returns a pending promise immediately), leaving later awaited reads —
|
|
47
|
+
* e.g. Pi's post-commit `queueDropsForCompartmentalizedMessages` — with no
|
|
48
|
+
* provider, so they fall through to OpenCode's session DB. For a Pi session
|
|
49
|
+
* that DB is the wrong source (empty), and on a Pi-only install it does not
|
|
50
|
+
* exist at all, throwing `unable to open database file`.
|
|
42
51
|
*/
|
|
43
52
|
export declare function withRawMessageProvider<T>(sessionId: string, provider: RawMessageProvider, fn: () => T): T;
|
|
44
53
|
/** Strip system-reminder blocks and OMO markers from user text for chunk compaction. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-session-chunk.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-chunk.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-session-chunk.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-chunk.ts"],"names":[],"mappings":"AAOA,OAAO,EAWH,KAAK,gBAAgB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,UAAU,EAGlB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIhF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,kBAAkB;IAC/B,YAAY,IAAI,UAAU,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,GAAG,IAAI,CAAC;IAC3D,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC;CAClC;AAID;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,GAAG,MAAM,IAAI,CAMjG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,kBAAkB,EAC5B,EAAE,EAAE,MAAM,CAAC,GACZ,CAAC,CAkBH;AAED,wFAAwF;AACxF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,MAAM,WAAW,YAAY;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,Y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AAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAK9F"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { Database } from "../../shared/sqlite";
|
|
2
|
+
/**
|
|
3
|
+
* Whether OpenCode's session DB file exists. Raw-message readers consult this
|
|
4
|
+
* before opening it so a harness with no OpenCode DB (a Pi-only install, or a
|
|
5
|
+
* transform whose per-session RawMessageProvider was unregistered out-of-band)
|
|
6
|
+
* degrades to "no messages" instead of throwing `unable to open database file`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function openCodeDbExists(): boolean;
|
|
2
9
|
export declare function withReadOnlySessionDb<T>(fn: (db: Database) => T): T;
|
|
3
10
|
export declare function closeReadOnlySessionDb(): void;
|
|
4
11
|
export declare function getRawSessionMessageCountFromDb(db: Database, sessionId: string): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-session-db.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-db.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-session-db.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-db.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAoB/C;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AA8BD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,CAAC,GAAG,CAAC,CAEnE;AAGD,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,wBAAgB,+BAA+B,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAYvF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAOpE;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CA6BhF;AAoBD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CACzC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,SAAS,MAAM,EAAE,GAC9B,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAyBrB;AAED,wBAAgB,oCAAoC,CAChD,SAAS,EAAE,MAAM,GAClB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgChE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { PluginContext } from "../../plugin/types";
|
|
2
|
+
import type { Database } from "../../shared/sqlite";
|
|
3
|
+
import { type PartialRecompRange } from "./compartment-runner";
|
|
4
|
+
import type { LiveSessionState } from "./live-session-state";
|
|
5
|
+
import type { NotificationParams } from "./send-session-notification";
|
|
6
|
+
/**
|
|
7
|
+
* Single source of truth for recomp + session-upgrade orchestration.
|
|
8
|
+
*
|
|
9
|
+
* Before this module there were THREE diverged implementations — the RPC
|
|
10
|
+
* `recomp` handler, the RPC `upgrade` handler, and the hook-side `executeRecomp`
|
|
11
|
+
* closure (used by `/ctx-recomp` and `/ctx-session-upgrade`). They drifted: the
|
|
12
|
+
* RPC handlers had live progress but no model fallback, while the hook path had
|
|
13
|
+
* fallback but no progress. The dogfood failure on 2026-05-30 was exactly this —
|
|
14
|
+
* the dialog "Run upgrade now" button (RPC, no fallback) failed when the primary
|
|
15
|
+
* historian model returned empty, while `/ctx-session-upgrade` (hook, with
|
|
16
|
+
* fallback) succeeded via the kimi fallback, leaving the sidebar stuck on a
|
|
17
|
+
* stale "failed" because the command path never updated progress.
|
|
18
|
+
*
|
|
19
|
+
* `runManagedRecomp` / `runManagedUpgrade` give EVERY caller the full set:
|
|
20
|
+
* fallback resilience (config chain + live-session-model last resort), live
|
|
21
|
+
* progress (sidebar / status), and consistent terminal-state + messaging.
|
|
22
|
+
*/
|
|
23
|
+
/** Config-shape-agnostic context. Callers resolve config values and pass them
|
|
24
|
+
* in, so this module never couples to the loose RPC config record vs the typed
|
|
25
|
+
* hook config. */
|
|
26
|
+
export interface ManagedRecompContext {
|
|
27
|
+
client: PluginContext["client"];
|
|
28
|
+
db: Database;
|
|
29
|
+
liveSessionState: LiveSessionState;
|
|
30
|
+
/** Plugin-startup directory — last-resort fallback for session-dir resolution. */
|
|
31
|
+
directory: string;
|
|
32
|
+
historianChunkTokens: number;
|
|
33
|
+
historianTimeoutMs: number;
|
|
34
|
+
memoryEnabled: boolean;
|
|
35
|
+
autoPromote: boolean;
|
|
36
|
+
/** Resolved historian fallback chain (config `fallback_models` → builtin). */
|
|
37
|
+
fallbackModels: readonly string[];
|
|
38
|
+
/** Pre-resolved last-resort model key (the live session model). When omitted,
|
|
39
|
+
* the orchestrator resolves it from `liveModelBySession`. The hook path passes
|
|
40
|
+
* this explicitly so it can include its OpenCode-DB fallback (the live map can
|
|
41
|
+
* be empty when `/ctx-recomp` runs before the first transform pass). */
|
|
42
|
+
fallbackModelId?: string;
|
|
43
|
+
/** Gate the upgrade's memory-migration step (memory enabled + historian model set). */
|
|
44
|
+
runMigration: boolean;
|
|
45
|
+
userMemoriesEnabled: boolean;
|
|
46
|
+
/** Two-pass historian (editor cleanup) — config `historian.two_pass`. */
|
|
47
|
+
historianTwoPass?: boolean;
|
|
48
|
+
getNotificationParams: (sessionId: string) => NotificationParams;
|
|
49
|
+
ensureProjectRegistered?: (directory: string, db: Database) => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
/** The runner's outcome messages are headed "## Magic Recomp — <Status>" /
|
|
52
|
+
* "## Session Upgrade — <Status>". Failed/Skipped wrote nothing. */
|
|
53
|
+
export declare function isRecompFailure(message: string): boolean;
|
|
54
|
+
/** Positive full-success predicate: the recomp rebuilt the ENTIRE requested
|
|
55
|
+
* range, headed "## Magic Recomp — Complete". This is stricter than
|
|
56
|
+
* `!isRecompFailure(...)`: a "— Partial" outcome publishes a valid prefix
|
|
57
|
+
* (`published===true`) but did NOT cover the full range, and a lease-busy
|
|
58
|
+
* no-op returns a heading with no status suffix at all. Gating the upgrade on
|
|
59
|
+
* this — not on `!isRecompFailure` — prevents declaring "Complete" + running
|
|
60
|
+
* the project-wide memory migration when compartments were only partially
|
|
61
|
+
* rebuilt (tierless legacy rows would remain while memories migrated). A
|
|
62
|
+
* Partial is reported as Incomplete; re-running the upgrade continues the
|
|
63
|
+
* rebuild (the upgrade gate still sees the un-rebuilt legacy/tierless rows). */
|
|
64
|
+
export declare function isRecompComplete(message: string): boolean;
|
|
65
|
+
/** Strip markdown headings + blank lines from a runner outcome message, leaving
|
|
66
|
+
* the human reason for compact sidebar/status display. Fixes the dogfood
|
|
67
|
+
* 2026-05-30 cosmetic bug where a raw "## Magic Recomp — Failed" heading leaked
|
|
68
|
+
* into the sidebar line. */
|
|
69
|
+
export declare function extractRecompReason(raw: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Rewrite a recomp-flow reason string for the UPGRADE flow surface. The shared
|
|
72
|
+
* recomp runner emits lease/active-run skip text that names `/ctx-recomp` — but
|
|
73
|
+
* a user in the upgrade flow must be told to retry `/ctx-session-upgrade`, not
|
|
74
|
+
* `/ctx-recomp` (they are different commands). The dominant skip cause on an
|
|
75
|
+
* active session is the incremental historian briefly holding the
|
|
76
|
+
* compartment-state lease while it comparts the live tail, which is transient,
|
|
77
|
+
* so reframe the guidance as "retry in a moment" rather than a hard failure.
|
|
78
|
+
*/
|
|
79
|
+
export declare function contextualizeUpgradeReason(reason: string): string;
|
|
80
|
+
/** Emit an IMMEDIATE "recomp" progress entry the instant an upgrade/recomp is
|
|
81
|
+
* requested — before any async work (session-dir resolution, child-session
|
|
82
|
+
* creation, the first slow historian attempt + fallback). Without this the
|
|
83
|
+
* sidebar stays blank until the first per-pass emit, which can be 60-90s into a
|
|
84
|
+
* fallback-heavy run (dogfood 2026-05-30). `totalMessages: 0` renders an
|
|
85
|
+
* indeterminate "Starting…" state until the loop knows the real range. */
|
|
86
|
+
export declare function setRecompStarting(liveSessionState: LiveSessionState, sessionId: string, note: string): void;
|
|
87
|
+
/** Update only the transient `note` on the active recomp progress entry (e.g.
|
|
88
|
+
* "trying fallback sonnet-4.6…") without disturbing the bar's counters. No-op
|
|
89
|
+
* if there's no active non-terminal entry. */
|
|
90
|
+
export declare function setRecompNote(liveSessionState: LiveSessionState, sessionId: string, note: string): void;
|
|
91
|
+
/** Record a terminal recomp/upgrade phase ("done"/"failed") so the TUI shows the
|
|
92
|
+
* OUTCOME (not a missed toast). "done" auto-clears after a grace period; "failed"
|
|
93
|
+
* persists until the next run so the reason stays visible. */
|
|
94
|
+
export declare function setRecompTerminal(liveSessionState: LiveSessionState, sessionId: string, phase: "done" | "failed", message: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Run a recomp (full or partial), with fallback + live progress + terminal state.
|
|
97
|
+
* Returns the runner's outcome message; the CALLER delivers it (so it can choose
|
|
98
|
+
* force-persist vs toast). Used by `/ctx-recomp` and the RPC `recomp` handler.
|
|
99
|
+
*/
|
|
100
|
+
export declare function runManagedRecomp(ctx: ManagedRecompContext, sessionId: string, options?: {
|
|
101
|
+
range?: PartialRecompRange;
|
|
102
|
+
}): Promise<string>;
|
|
103
|
+
export declare function runManagedUpgrade(ctx: ManagedRecompContext, sessionId: string): Promise<string>;
|
|
104
|
+
//# sourceMappingURL=recomp-orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recomp-orchestrator.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/recomp-orchestrator.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAGH,KAAK,kBAAkB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAs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B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACb,IAAI,CAYN;AAED;;+CAE+C;AAC/C,wBAAgB,aAAa,CACzB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACb,IAAI,CAQN;AAED;;+DAE+D;AAC/D,wBAAgB,iBAAiB,CAC7B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,QAAQ,EACxB,OAAO,EAAE,MAAM,GAChB,IAAI,CAoBN;AAoED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAClC,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAAE,GACzC,OAAO,CAAC,MAAM,CAAC,CAqBjB;AAED,wBAAsB,iBAAiB,CACnC,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA+GjB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type ReferenceSeed } from "./reference-seeds.generated";
|
|
2
|
+
/**
|
|
3
|
+
* Structural minimum a compartment must satisfy to render as a session
|
|
4
|
+
* reference. Both `Compartment` (stored rows, incremental runner) and
|
|
5
|
+
* `CandidateCompartment` (in-flight recomp staging) are assignable — they
|
|
6
|
+
* differ only in null/undefined widening on the tier/importance fields.
|
|
7
|
+
*/
|
|
8
|
+
export interface ReferenceCompartment {
|
|
9
|
+
startMessage: number;
|
|
10
|
+
endMessage: number;
|
|
11
|
+
title: string;
|
|
12
|
+
content: string;
|
|
13
|
+
p1?: string | null;
|
|
14
|
+
p2?: string | null;
|
|
15
|
+
p3?: string | null;
|
|
16
|
+
p4?: string | null;
|
|
17
|
+
importance?: number | null;
|
|
18
|
+
episodeType?: string | null;
|
|
19
|
+
}
|
|
20
|
+
/** Permanent seed floor — never drops, even when the session is mature. */
|
|
21
|
+
export declare const SEED_FLOOR = 4;
|
|
22
|
+
/** Recency window of this-session compartments shown for continuity/calibration. */
|
|
23
|
+
export declare const SESSION_REF_WINDOW = 6;
|
|
24
|
+
/**
|
|
25
|
+
* Select 4 diverse, importance-band-spanning seeds, deterministically rotated
|
|
26
|
+
* by (sessionId, chunkStart) so different runs see different 4-seed combos
|
|
27
|
+
* (≈15 distinct combinations before repeat across the 60-seed corpus) while a
|
|
28
|
+
* given chunk always resolves to the same 4.
|
|
29
|
+
*
|
|
30
|
+
* Strategy: pick one seed from each of the first SEED_FLOOR bands (very-high,
|
|
31
|
+
* high, mid, low-mid by default), rotating WITHIN each band by the hash so the
|
|
32
|
+
* specific seed varies run to run. This guarantees band coverage on every run
|
|
33
|
+
* (never 4 high-importance seeds) while still rotating the corpus.
|
|
34
|
+
*/
|
|
35
|
+
export declare function selectSeeds(sessionId: string, chunkStart: number, count?: number): ReferenceSeed[];
|
|
36
|
+
/** Render the cross-project calibration block. Empty string if no seeds. */
|
|
37
|
+
export declare function renderSeedExamplesBlock(seeds: ReferenceSeed[]): string;
|
|
38
|
+
/**
|
|
39
|
+
* Render the continuity block from the last `SESSION_REF_WINDOW` persisted
|
|
40
|
+
* compartments. `allCompartments` is the session's full ordered compartment
|
|
41
|
+
* list (ascending by sequence/endMessage). Empty string when the session has
|
|
42
|
+
* no prior compartments (young session — seeds carry calibration alone).
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderSessionReferencesBlock(allCompartments: ReferenceCompartment[]): string;
|
|
45
|
+
export interface ReferenceBlocks {
|
|
46
|
+
/** `<compartment_examples_from_other_projects>` — always present (4-seed floor). */
|
|
47
|
+
seedExamples: string;
|
|
48
|
+
/** `<session_references>` — empty for a young session with no prior compartments. */
|
|
49
|
+
sessionReferences: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build both reference blocks for a historian run. Pure + deterministic for a
|
|
53
|
+
* given (sessionId, chunkStart, compartments) — no embedding, no DB, no clock.
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildReferenceBlocks(args: {
|
|
56
|
+
sessionId: string;
|
|
57
|
+
chunkStart: number;
|
|
58
|
+
/** Full ordered list of this session's persisted compartments (asc). */
|
|
59
|
+
sessionCompartments: ReferenceCompartment[];
|
|
60
|
+
}): ReferenceBlocks;
|
|
61
|
+
//# sourceMappingURL=reference-retrieval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-retrieval.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/reference-retrieval.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAElF;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,2EAA2E;AAC3E,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAmDpC;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,KAAK,SAAa,GACnB,aAAa,EAAE,CAoCjB;AAED,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CAItE;AAsCD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,eAAe,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAK5F;AAED,MAAM,WAAW,eAAe;IAC5B,oFAAoF;IACpF,YAAY,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,mBAAmB,EAAE,oBAAoB,EAAE,CAAC;CAC/C,GAAG,eAAe,CAMlB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ReferenceSeed {
|
|
2
|
+
/** importance score parsed from the seed's <compartment importance="N"> attribute */
|
|
3
|
+
readonly importance: number;
|
|
4
|
+
/** full example XML unit (compartment + optional facts/events/user_observations) */
|
|
5
|
+
readonly block: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const REFERENCE_SEEDS: ReadonlyArray<ReferenceSeed>;
|
|
8
|
+
//# sourceMappingURL=reference-seeds.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-seeds.generated.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/reference-seeds.generated.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,aAAa;IAC1B,qFAAqF;IACrF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,aAAa,CAiPxD,CAAC"}
|
|
@@ -4,7 +4,7 @@ export interface NotificationParams {
|
|
|
4
4
|
providerId?: string;
|
|
5
5
|
modelId?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function sendIgnoredMessage(client: unknown, sessionId: string, text: string, params: NotificationParams): Promise<void>;
|
|
7
|
+
export declare function sendIgnoredMessage(client: unknown, sessionId: string, text: string, params: NotificationParams, forcePersist?: boolean): Promise<void>;
|
|
8
8
|
/**
|
|
9
9
|
* Send a real user prompt that will be processed by the model (not ignored).
|
|
10
10
|
* Used by /ctx-aug to inject the augmented prompt after sidekick completes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-session-notification.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/send-session-notification.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAoDD,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"send-session-notification.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/send-session-notification.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAoDD,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,kBAAkB,EAK1B,YAAY,UAAQ,GACrB,OAAO,CAAC,IAAI,CAAC,CAyEf;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAChC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
|
@@ -50,9 +50,8 @@ export declare function createSystemPromptHashHandler(deps: {
|
|
|
50
50
|
lastHeuristicsTurnId: Map<string, string>;
|
|
51
51
|
/**
|
|
52
52
|
* Issue #53: when false, Magic Context skips ALL system-prompt injection
|
|
53
|
-
* for ALL agents. Global escape hatch for users who don't want
|
|
54
|
-
*
|
|
55
|
-
* touching the system prompt. (default: true)
|
|
53
|
+
* for ALL agents. Global escape hatch for users who don't want Magic
|
|
54
|
+
* Context guidance / sticky date touching the system prompt. (default: true)
|
|
56
55
|
*/
|
|
57
56
|
injectionEnabled?: boolean;
|
|
58
57
|
/**
|
|
@@ -63,11 +62,11 @@ export declare function createSystemPromptHashHandler(deps: {
|
|
|
63
62
|
* globally.
|
|
64
63
|
*/
|
|
65
64
|
injectionSkipSignatures?: string[];
|
|
66
|
-
/**
|
|
65
|
+
/** @deprecated user memories now render in m[0]/m[1], not system prompt. */
|
|
67
66
|
experimentalUserMemories?: boolean;
|
|
68
|
-
/**
|
|
67
|
+
/** @deprecated key files now render in m[1], not system prompt. */
|
|
69
68
|
experimentalPinKeyFiles?: boolean;
|
|
70
|
-
/**
|
|
69
|
+
/** @deprecated key files now render in m[1], not system prompt. */
|
|
71
70
|
experimentalPinKeyFilesTokenBudget?: number;
|
|
72
71
|
/** When true, add a temporal-awareness guidance paragraph + surface compartment dates */
|
|
73
72
|
experimentalTemporalAwareness?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt-hash.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/system-prompt-hash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system-prompt-hash.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/system-prompt-hash.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,eAAe,EAGvB,MAAM,sCAAsC,CAAC;AAU9C;;;;;GAKG;AACH,wBAAgB,4BAA4B,CACxC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE;IACR,mBAAm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A;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CAmPA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-messages.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/tag-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAQ5E,OAAO,EAAwB,KAAK,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAaxF,OAAO,EAGH,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"tag-messages.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/tag-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAQ5E,OAAO,EAAwB,KAAK,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAaxF,OAAO,EAGH,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,iBAAiB,EACpB,MAAM,oBAAoB,CAAC;AAgF5B,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,SAAS,GAAG;IACpB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,cAAc,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,cAAc,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAChC,kBAAkB,EAAE,GAAG,CAAC,WAAW,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACzD,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC5C,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,iBAAiB,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,eAAe,EAAE,OAAO,CAAC;CAC5B;AAkED,MAAM,WAAW,kBAAkB;IAC/B;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,wBAAgB,WAAW,CACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,kBAAuB,GACjC,iBAAiB,CA6WnB"}
|
|
@@ -63,6 +63,8 @@ export interface CalibratedBuckets {
|
|
|
63
63
|
compartmentTokens: number;
|
|
64
64
|
factTokens: number;
|
|
65
65
|
memoryTokens: number;
|
|
66
|
+
docsTokens: number;
|
|
67
|
+
profileTokens: number;
|
|
66
68
|
conversationTokens: number;
|
|
67
69
|
toolCallTokens: number;
|
|
68
70
|
}
|
|
@@ -76,6 +78,10 @@ export interface CalibrationInput {
|
|
|
76
78
|
compartmentsLocal: number;
|
|
77
79
|
factsLocal: number;
|
|
78
80
|
memoriesLocal: number;
|
|
81
|
+
/** Verbatim — <project-docs> block in m[0] (stable scaffolding, own budget). */
|
|
82
|
+
docsLocal: number;
|
|
83
|
+
/** Verbatim — <user-profile> block in m[0] (stable scaffolding, own budget). */
|
|
84
|
+
profileLocal: number;
|
|
79
85
|
/** Residual absorbers — proportionally scaled to absorb the remainder. */
|
|
80
86
|
conversationLocal: number;
|
|
81
87
|
toolCallsLocal: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenizer-calibration.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/tokenizer-calibration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"tokenizer-calibration.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/tokenizer-calibration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAgFD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC5B,gBAAgB,CAYlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,iBAAiB;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,gBAAgB,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAmK3E"}
|
|
@@ -2,7 +2,6 @@ import { type ContextDatabase } from "../../features/magic-context/storage";
|
|
|
2
2
|
import type { PluginContext } from "../../plugin/types";
|
|
3
3
|
import { type PreparedCompartmentInjection } from "./inject-compartments";
|
|
4
4
|
import type { MessageLike } from "./transform-operations";
|
|
5
|
-
export declare function clearCompressorCooldown(sessionId: string): void;
|
|
6
5
|
interface RunCompartmentPhaseArgs {
|
|
7
6
|
canRunCompartments: boolean;
|
|
8
7
|
fullFeatureMode: boolean;
|
|
@@ -41,12 +40,6 @@ interface RunCompartmentPhaseArgs {
|
|
|
41
40
|
experimentalTemporalAwareness?: boolean;
|
|
42
41
|
/** When true, run a second editor pass after historian to clean U: lines. */
|
|
43
42
|
historianTwoPass?: boolean;
|
|
44
|
-
/** Compressor floor ratio: floor = ceil(lastEndMessage / minCompartmentRatio). */
|
|
45
|
-
compressorMinCompartmentRatio?: number;
|
|
46
|
-
/** Compressor max merge depth (1-5). Compartments at or above this depth are skipped. */
|
|
47
|
-
compressorMaxMergeDepth?: number;
|
|
48
|
-
/** Compressor cooldown in milliseconds between background runs. */
|
|
49
|
-
compressorCooldownMs?: number;
|
|
50
43
|
/** Cross-session memory feature gate (`memory.enabled`). Issue #44. */
|
|
51
44
|
memoryEnabled?: boolean;
|
|
52
45
|
/** Auto-promotion gate (`memory.auto_promote`). Issue #44. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-compartment-phase.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform-compartment-phase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transform-compartment-phase.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform-compartment-phase.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,sCAAsC,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQxD,OAAO,EACH,KAAK,4BAA4B,EAEpC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,UAAU,uBAAuB;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE;QAAE,qBAAqB,EAAE,OAAO,CAAA;KAAE,CAAC;IAChD,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,2BAA2B,EAAE,4BAA4B,GAAG,IAAI,CAAC;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