@cortexkit/opencode-magic-context 0.23.0 → 0.24.0
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 +6 -0
- package/dist/config/schema/magic-context.d.ts +10 -3
- 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-chunk-embedding.d.ts +70 -0
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-embedding.d.ts +22 -26
- package/dist/features/magic-context/compartment-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-backfill.d.ts +3 -2
- package/dist/features/magic-context/memory/embedding-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-cache.d.ts +3 -2
- package/dist/features/magic-context/memory/embedding-cache.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts +2 -1
- package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-openai.d.ts +3 -0
- package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-provider.d.ts +2 -0
- package/dist/features/magic-context/memory/embedding-provider.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/storage-memory-embeddings.d.ts +5 -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 -7
- package/dist/features/magic-context/memory/storage-memory-fts.d.ts.map +1 -1
- package/dist/features/magic-context/memory/storage-memory.d.ts +18 -12
- package/dist/features/magic-context/memory/storage-memory.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +53 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +14 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-storage.d.ts +17 -0
- package/dist/features/magic-context/session-project-storage.d.ts.map +1 -0
- package/dist/features/magic-context/storage-db.d.ts +1 -1
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts +2 -0
- package/dist/features/magic-context/storage-memory-mutation-log.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +16 -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 +3 -2
- package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +3 -2
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tool-definition-tokens.d.ts +0 -21
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
- package/dist/features/magic-context/types.d.ts +1 -0
- package/dist/features/magic-context/types.d.ts.map +1 -1
- package/dist/features/magic-context/workspaces.d.ts +20 -0
- package/dist/features/magic-context/workspaces.d.ts.map +1 -0
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-hint.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +5 -0
- package/dist/hooks/magic-context/command-handler.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-partial-recomp.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 +11 -1
- package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/ctx-reduce-availability.d.ts +18 -0
- package/dist/hooks/magic-context/ctx-reduce-availability.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 +23 -5
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-135-wire-fixtures.d.ts +8 -0
- package/dist/hooks/magic-context/issue-135-wire-fixtures.d.ts.map +1 -0
- package/dist/hooks/magic-context/openai-compat-adjacency.d.ts +38 -0
- package/dist/hooks/magic-context/openai-compat-adjacency.d.ts.map +1 -0
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts +1 -1
- package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
- package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -1
- package/dist/hooks/magic-context/sentinel.d.ts +33 -28
- package/dist/hooks/magic-context/sentinel.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-content.d.ts +34 -17
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +5 -7
- package/dist/hooks/magic-context/strip-structural-noise.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +4 -5
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +0 -8
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/index.js +2387 -348
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/shared/announcement.d.ts +1 -1
- package/dist/shared/rpc-types.d.ts +1 -1
- package/dist/shared/rpc-types.d.ts.map +1 -1
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/announcement.ts +6 -6
- package/src/shared/rpc-types.ts +1 -1
- package/src/tui/index.tsx +5 -3
- package/src/tui/slots/sidebar-content.tsx +24 -5
|
@@ -2,6 +2,7 @@ import { Buffer } from "node:buffer";
|
|
|
2
2
|
import { type Compartment, type SessionFact } from "../../features/magic-context/compartment-storage";
|
|
3
3
|
import type { Memory } from "../../features/magic-context/memory/types";
|
|
4
4
|
import { type UserMemory } from "../../features/magic-context/user-memory/storage-user-memory";
|
|
5
|
+
import { type WorkspaceIdentitySet } from "../../features/magic-context/workspaces";
|
|
5
6
|
import type { Database } from "../../shared/sqlite";
|
|
6
7
|
import { type KeyFilesConfigForRender } from "./key-files-block";
|
|
7
8
|
import type { MessageLike } from "./tag-messages";
|
|
@@ -55,6 +56,7 @@ export declare function prepareCompartmentInjection(db: Database, sessionId: str
|
|
|
55
56
|
export declare function renderCompartmentInjection(sessionId: string, messages: MessageLike[], prepared: PreparedCompartmentInjection): CompartmentInjectionResult;
|
|
56
57
|
export interface M0SnapshotMarkers {
|
|
57
58
|
projectMemoryEpoch: number;
|
|
59
|
+
workspaceFingerprint: string | null;
|
|
58
60
|
projectUserProfileVersion: number;
|
|
59
61
|
maxCompartmentSeq: number;
|
|
60
62
|
maxMemoryId: number;
|
|
@@ -65,7 +67,6 @@ export interface M0SnapshotMarkers {
|
|
|
65
67
|
sessionFactsVersion: number;
|
|
66
68
|
upgradeState: string | null;
|
|
67
69
|
systemHash: string;
|
|
68
|
-
toolSetHash: string;
|
|
69
70
|
modelKey: string;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
@@ -76,7 +77,6 @@ export interface M0SnapshotMarkers {
|
|
|
76
77
|
*/
|
|
77
78
|
export interface M0HardSignals {
|
|
78
79
|
systemHash: string;
|
|
79
|
-
toolSetHash: string;
|
|
80
80
|
modelKey: string;
|
|
81
81
|
/** True when the provider cache TTL has elapsed since lastResponseTime. */
|
|
82
82
|
cacheExpired: boolean;
|
|
@@ -89,6 +89,7 @@ export interface M0M1State {
|
|
|
89
89
|
cachedM0Bytes: Buffer | null;
|
|
90
90
|
cachedM1Bytes: Buffer | null;
|
|
91
91
|
cachedM0ProjectMemoryEpoch: number | null;
|
|
92
|
+
cachedM0WorkspaceFingerprint: string | null;
|
|
92
93
|
cachedM0ProjectUserProfileVersion: number | null;
|
|
93
94
|
cachedM0MaxCompartmentSeq: number | null;
|
|
94
95
|
cachedM0MaxMemoryId: number | null;
|
|
@@ -118,6 +119,7 @@ export interface M0M1RenderOptions {
|
|
|
118
119
|
/** Provider-side cache-eviction signals for HARD-bust detection. */
|
|
119
120
|
hardSignals?: M0HardSignals;
|
|
120
121
|
preRenderedKeyFilesBlock?: string | null;
|
|
122
|
+
workspaceIdentitySet?: WorkspaceIdentitySet;
|
|
121
123
|
beforePhase3ForTest?: () => void;
|
|
122
124
|
}
|
|
123
125
|
export interface MaterializeDecision {
|
|
@@ -154,12 +156,25 @@ export declare class RenderM1InvalidMarkersError extends Error {
|
|
|
154
156
|
type M0Compartment = Compartment;
|
|
155
157
|
export declare const DEFAULT_MEMORY_BUDGET_TOKENS = 8000;
|
|
156
158
|
export declare const DEFAULT_USER_PROFILE_BUDGET_TOKENS = 4000;
|
|
159
|
+
export interface WorkspaceRenderContext {
|
|
160
|
+
identities: string[];
|
|
161
|
+
expandedIdentities: string[];
|
|
162
|
+
ownIdentities: string[];
|
|
163
|
+
shareCategories: string[] | null;
|
|
164
|
+
namesByIdentity: Map<string, string>;
|
|
165
|
+
canonicalIdentityByStoredPath: Map<string, string>;
|
|
166
|
+
isWorkspaced: boolean;
|
|
167
|
+
}
|
|
168
|
+
export interface MemoryRenderOptions {
|
|
169
|
+
sourceNameByMemoryId?: ReadonlyMap<number, string>;
|
|
170
|
+
}
|
|
157
171
|
export declare function readCurrentM0SnapshotMarkers(args: {
|
|
158
172
|
db: Database;
|
|
159
173
|
sessionId: string;
|
|
160
174
|
projectPath?: string;
|
|
161
175
|
projectDirectory?: string;
|
|
162
176
|
hardSignals?: M0HardSignals;
|
|
177
|
+
workspaceIdentitySet?: WorkspaceIdentitySet;
|
|
163
178
|
}): M0SnapshotMarkers;
|
|
164
179
|
/**
|
|
165
180
|
* The materialization decision, organized around the bust taxonomy:
|
|
@@ -184,12 +199,14 @@ export declare function mustMaterialize(args: {
|
|
|
184
199
|
projectPath?: string;
|
|
185
200
|
projectDirectory?: string;
|
|
186
201
|
hardSignals?: M0HardSignals;
|
|
202
|
+
workspaceIdentitySet?: WorkspaceIdentitySet;
|
|
187
203
|
}): MaterializeDecision;
|
|
188
204
|
export interface TrimMemoriesResultV2 {
|
|
189
205
|
selected: Memory[];
|
|
190
206
|
renderOrder: Memory[];
|
|
191
207
|
}
|
|
192
|
-
export declare function trimMemoriesToBudgetV2(sessionId: string, memories: Memory[], budgetTokens: number): TrimMemoriesResultV2;
|
|
208
|
+
export declare function trimMemoriesToBudgetV2(sessionId: string, memories: Memory[], budgetTokens: number, renderOptions?: MemoryRenderOptions): TrimMemoriesResultV2;
|
|
209
|
+
export declare function trimWorkspaceMemoriesToBudgetV2(sessionId: string, memories: Memory[], budgetTokens: number, workspace: WorkspaceRenderContext, renderOptions?: MemoryRenderOptions): TrimMemoriesResultV2;
|
|
193
210
|
export declare function trimUserMemoriesToBudget(memories: UserMemory[], budgetTokens: number): UserMemory[];
|
|
194
211
|
/**
|
|
195
212
|
* Render ONE memory's v2 line exactly as it lands in the <project-memory> block.
|
|
@@ -199,14 +216,15 @@ export declare function trimUserMemoriesToBudget(memories: UserMemory[], budgetT
|
|
|
199
216
|
* lighter shape (e.g. "- content") under-counts and lets the injected block
|
|
200
217
|
* exceed the configured budget.
|
|
201
218
|
*/
|
|
202
|
-
export declare function renderMemoryLineV2(memory: Memory): string;
|
|
203
|
-
export declare function renderMemoryBlockV2(memories: Memory[], wrapper?: string): string;
|
|
219
|
+
export declare function renderMemoryLineV2(memory: Memory, sourceName?: string): string;
|
|
220
|
+
export declare function renderMemoryBlockV2(memories: Memory[], wrapper?: string, renderOptions?: MemoryRenderOptions): string;
|
|
204
221
|
export declare function renderM0(args: {
|
|
205
222
|
projectDocs: string;
|
|
206
223
|
userProfileBaseline: UserMemory[];
|
|
207
224
|
compartments: M0Compartment[];
|
|
208
225
|
memories: Memory[];
|
|
209
226
|
facts: SessionFact[];
|
|
227
|
+
memoryRenderOptions?: MemoryRenderOptions;
|
|
210
228
|
historyBudgetTokens?: number;
|
|
211
229
|
userProfileBudgetTokens?: number;
|
|
212
230
|
decayPressureMultiplier?: number;
|
|
@@ -1 +1 @@
|
|
|
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,EAMhB,KAAK,WAAW,EACnB,MAAM,kDAAkD,CAAC;
|
|
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,EAMhB,KAAK,WAAW,EACnB,MAAM,kDAAkD,CAAC;AAe1D,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,2CAA2C,CAAC;AAaxF,OAAO,EAEH,KAAK,UAAU,EAClB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAOH,KAAK,oBAAoB,EAC5B,MAAM,yCAAyC,CAAC;AAGjD,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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AAE,mBAAwB,GACxC,MAAM,CAQR;AA8BD,wBAAgB,QAAQ,CAAC,IAAI,EAAE;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,UAAU,EAAE,CAAC;IAClC,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC,GAAG,MAAM,CAiCT;AAgDD,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CAuQ7E;AAED,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,SAAI,GACf,mBAAmB,CAcrB;AA+LD,wBAAgB,QAAQ,CACpB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,iBAAiB,EAC1B,iBAAiB,GAAE,SAAS,MAAM,EAAO,GAC1C,MAAM,CAER;AAyVD,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CA8LvE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captured openai-compat wire fixtures from issue #135 pinning harness.
|
|
3
|
+
* Source: scripts/experiments/issue-135-pinning-harness.ts (case 1c).
|
|
4
|
+
*/
|
|
5
|
+
import type { OpenAiCompatWireMessage } from "./openai-compat-adjacency";
|
|
6
|
+
/** Known FAIL: [dropped] assistant between tool_calls and tool result. */
|
|
7
|
+
export declare const ISSUE_135_ORPHAN_WIRE: OpenAiCompatWireMessage[];
|
|
8
|
+
//# sourceMappingURL=issue-135-wire-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-135-wire-fixtures.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/issue-135-wire-fixtures.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,0EAA0E;AAC1E,eAAO,MAAM,qBAAqB,EAAE,uBAAuB,EAe1D,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI-compatible chat adjacency invariant used by GitHub Copilot's wire format.
|
|
3
|
+
*
|
|
4
|
+
* Every assistant message with `tool_calls` must be immediately followed by
|
|
5
|
+
* `role: "tool"` messages whose `tool_call_id` values cover exactly the ids
|
|
6
|
+
* declared on that assistant message (order among tool messages may vary).
|
|
7
|
+
*
|
|
8
|
+
* Copilot re-translates this shape to Bedrock/Claude server-side; violating
|
|
9
|
+
* adjacency here reproduces issue #135 (`tool_use` without adjacent `tool_result`).
|
|
10
|
+
*/
|
|
11
|
+
export type OpenAiCompatWireMessage = {
|
|
12
|
+
role: string;
|
|
13
|
+
content?: string | null | unknown;
|
|
14
|
+
tool_calls?: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
type?: string;
|
|
17
|
+
function?: {
|
|
18
|
+
name: string;
|
|
19
|
+
arguments: string;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
tool_call_id?: string;
|
|
23
|
+
};
|
|
24
|
+
export type AdjacencyViolation = {
|
|
25
|
+
index: number;
|
|
26
|
+
kind: "missing_tool_messages" | "orphan_tool_message" | "unmatched_tool_call_id";
|
|
27
|
+
assistantToolCallIds?: string[];
|
|
28
|
+
followingRoles?: string[];
|
|
29
|
+
toolCallId?: string;
|
|
30
|
+
detail: string;
|
|
31
|
+
};
|
|
32
|
+
export type AdjacencyResult = {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
violations: AdjacencyViolation[];
|
|
35
|
+
};
|
|
36
|
+
export declare function assertOpenAiCompatAdjacency(messages: OpenAiCompatWireMessage[]): AdjacencyResult;
|
|
37
|
+
export declare function formatWireSlice(messages: OpenAiCompatWireMessage[], centerIndex: number, radius?: number): string;
|
|
38
|
+
//# sourceMappingURL=openai-compat-adjacency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-compat-adjacency.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/openai-compat-adjacency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,KAAK,CAAC;QACf,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;KAClD,CAAC,CAAC;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,uBAAuB,GAAG,qBAAqB,GAAG,wBAAwB,CAAC;IACjF,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,UAAU,EAAE,kBAAkB,EAAE,CAAC;CACpC,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,uBAAuB,EAAE,GAAG,eAAe,CAyFhG;AAED,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,uBAAuB,EAAE,EACnC,WAAW,EAAE,MAAM,EACnB,MAAM,SAAI,GACX,MAAM,CAmBR"}
|
|
@@ -88,7 +88,7 @@ export declare function contextualizeUpgradeReason(reason: string): string;
|
|
|
88
88
|
* sidebar stays blank until the first per-pass emit, which can be 60-90s into a
|
|
89
89
|
* fallback-heavy run (dogfood 2026-05-30). `totalMessages: 0` renders an
|
|
90
90
|
* indeterminate "Starting…" state until the loop knows the real range. */
|
|
91
|
-
export declare function setRecompStarting(liveSessionState: LiveSessionState, sessionId: string, note: string, kind?: "recomp" | "upgrade"): void;
|
|
91
|
+
export declare function setRecompStarting(liveSessionState: LiveSessionState, sessionId: string, note: string, kind?: "recomp" | "upgrade" | "embed"): void;
|
|
92
92
|
/** Update only the transient `note` on the active recomp progress entry (e.g.
|
|
93
93
|
* "trying fallback sonnet-4.6…") without disturbing the bar's counters. No-op
|
|
94
94
|
* if there's no active non-terminal entry. */
|
|
@@ -1 +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,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAYtE;;;;;;;;;;;;;;;;GAgBG;AAEH;;mBAEmB;AACnB,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,EAAE,EAAE,QAAQ,CAAC;IACb,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,8EAA8E;IAC9E,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;6EAGyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uFAAuF;IACvF,YAAY,EAAE,OAAO,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,kBAAkB,CAAC;IACjE,uBAAuB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF;AAED;qEACqE;AACrE,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;gFAGgF;AAChF,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;iFASiF;AACjF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;6BAG6B;AAC7B,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMjE;AAID;;;;;2EAK2E;AAC3E,wBAAgB,iBAAiB,CAC7B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,QAAQ,GAAG,
|
|
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,KAA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AAG,OAAO,CAEzD;AAED;;;6BAG6B;AAC7B,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMjE;AAID;;;;;2EAK2E;AAC3E,wBAAgB,iBAAiB,CAC7B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,QAAQ,GAAG,SAAS,GAAG,OAAkB,GAChD,IAAI,CAaN;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,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,GAChB,IAAI,CAyBN;AA2ED;;;;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,CA6BjB;AAED,wBAAsB,iBAAiB,CACnC,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA+GjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-retrieval.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/reference-retrieval.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reference-retrieval.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/reference-retrieval.ts"],"names":[],"mappings":"AAsBA,OAA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Ae,CAMlB"}
|
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Whole-message sentinel placeholder for providers that
|
|
3
|
-
*
|
|
2
|
+
* Whole-message sentinel placeholder for providers that must not receive empty
|
|
3
|
+
* assistant content on the wire.
|
|
4
4
|
*
|
|
5
5
|
* Background: when `stripDroppedPlaceholderMessages` /
|
|
6
|
-
* `stripSystemInjectedMessages` / `replaySentinelByMessageIds` reduce a
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ...) do not, and the empty-content message reaches the wire — and is
|
|
13
|
-
* rejected by stricter backends (e.g. Moonshot/Kimi: "must not be empty").
|
|
6
|
+
* `stripSystemInjectedMessages` / `replaySentinelByMessageIds` reduce a whole
|
|
7
|
+
* assistant message to one sentinel part, the resulting AI-SDK `ModelMessage`
|
|
8
|
+
* can become `{ role: "assistant", content: "" }`. OpenCode's canonical
|
|
9
|
+
* Anthropic adapter filters that empty message before the wire; most other
|
|
10
|
+
* providers can forward it and stricter backends reject it (e.g. Moonshot/Kimi:
|
|
11
|
+
* "must not be empty").
|
|
14
12
|
*
|
|
15
|
-
* Using a non-empty placeholder text whose value won't be filtered keeps
|
|
16
|
-
*
|
|
17
|
-
* was dropped. For Anthropic/Bedrock we still emit `""` so their existing
|
|
18
|
-
* filter continues removing the message — no wire-shape change for them.
|
|
13
|
+
* Using a non-empty placeholder text whose value won't be filtered keeps the
|
|
14
|
+
* wire valid while still telling the model honestly that something was dropped.
|
|
19
15
|
*/
|
|
20
16
|
export declare const WHOLE_MESSAGE_PLACEHOLDER_TEXT = "[dropped]";
|
|
17
|
+
/**
|
|
18
|
+
* Decide whether empty-text sentinels are safe for the provider's wire path.
|
|
19
|
+
*
|
|
20
|
+
* The gate is deliberately canonical-Anthropic only. OpenCode filters empty
|
|
21
|
+
* text/reasoning parts only in the `@ai-sdk/anthropic` branch before sending
|
|
22
|
+
* to the provider; github-copilot and other non-Anthropic adapters forward
|
|
23
|
+
* `{type:"text", text:""}` parts as real content blocks. Bedrock also filters
|
|
24
|
+
* empty text later, but native `step-start` boundaries and empty sentinels are
|
|
25
|
+
* not byte-equivalent before that filter runs. Google Vertex Anthropic maps to
|
|
26
|
+
* an Anthropic SDK key but does not enter OpenCode's `@ai-sdk/anthropic`
|
|
27
|
+
* empty-part filter.
|
|
28
|
+
*
|
|
29
|
+
* Unknown or non-canonical providers therefore must keep native parts (or use
|
|
30
|
+
* non-empty whole-message placeholders) rather than producing empty sentinels.
|
|
31
|
+
*/
|
|
32
|
+
export declare function modelAcceptsEmptyContent(providerID?: string): boolean;
|
|
21
33
|
/**
|
|
22
34
|
* Create an empty-text sentinel to replace a stripped message PART (not a
|
|
23
35
|
* whole message) while preserving the array's length and index positions
|
|
24
36
|
* across passes.
|
|
25
37
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Why sentinels exist: some providers (Antigravity/Gemini-routed-Claude,
|
|
31
|
-
* some OpenRouter configs) hash the full serialized messages[] array as
|
|
32
|
-
* their prompt-cache key. Any array-length change between turns busts the
|
|
33
|
-
* cache. Replacing removed parts with inert `{type:"text", text:""}`
|
|
34
|
-
* placeholders keeps the array shape stable so subsequent turns can hit
|
|
35
|
-
* cache on the unchanged prefix.
|
|
38
|
+
* Why sentinels exist: Anthropic prompt caching is sensitive to serialized
|
|
39
|
+
* message-array shape. Replacing removed parts with inert `{type:"text",
|
|
40
|
+
* text:""}` placeholders keeps indices stable across passes, and OpenCode's
|
|
41
|
+
* canonical Anthropic adapter filters those empty text parts before the wire.
|
|
36
42
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* previous `.filter()`/`.splice()` behavior.
|
|
43
|
+
* Call sites must gate this helper with `modelAcceptsEmptyContent()`. For
|
|
44
|
+
* non-Anthropic providers the empty text part can survive onto the wire and
|
|
45
|
+
* break provider-specific adjacency or non-empty-content invariants.
|
|
41
46
|
*
|
|
42
47
|
* `cache_control` inheritance: if the original part carried provider-side
|
|
43
48
|
* cache-breakpoint metadata (`cache_control` / `cacheControl`), the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/sentinel.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"sentinel.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/sentinel.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,8BAA8B,cAAc,CAAC;AAE1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAErE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,OAAO,GAAG;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAc1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACpC,UAAU,CAAC,EAAE,MAAM,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAK1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAKjD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACtC,QAAQ,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,EAC5D,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,EAChB,UAAU,CAAC,EAAE,MAAM,GACpB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAiB5C"}
|
|
@@ -72,18 +72,10 @@ export declare function clearOldReasoning(messages: MessageLike[], reasoningByMe
|
|
|
72
72
|
* "[cleared]" by clearOldReasoning). Replaces them in place with empty-text
|
|
73
73
|
* sentinels so message.parts length stays constant between passes.
|
|
74
74
|
*
|
|
75
|
-
* See strip-structural-noise.ts for the cache-safety rationale.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* mid-pipeline array mutation.
|
|
80
|
-
*
|
|
81
|
-
* Providers with `capabilities.interleaved.field` (e.g. Moonshot/Kimi
|
|
82
|
-
* `reasoning_content`) used to need a special gate to keep typed reasoning
|
|
83
|
-
* intact. OpenCode PR #24146 (preserve empty reasoning_content for DeepSeek
|
|
84
|
-
* V4 thinking mode) made the provider/transform layer always emit the
|
|
85
|
-
* interleaved field — empty when no reasoning parts remain — so the gate
|
|
86
|
-
* is no longer needed here.
|
|
75
|
+
* See strip-structural-noise.ts for the cache-safety rationale. Caller contract:
|
|
76
|
+
* run only when `modelAcceptsEmptyContent(providerID)` is true. OpenCode's
|
|
77
|
+
* canonical Anthropic adapter filters empty text sentinels before the wire;
|
|
78
|
+
* other adapters can forward them as real content blocks.
|
|
87
79
|
*/
|
|
88
80
|
export declare function stripClearedReasoning(messages: MessageLike[]): number;
|
|
89
81
|
export declare function stripInlineThinking(messages: MessageLike[], messageTagNumbers: Map<MessageLike, number>, clearReasoningAge: number): number;
|
|
@@ -129,12 +121,37 @@ export declare function truncateErroredTools(messages: MessageLike[], watermark:
|
|
|
129
121
|
* fixed for Bedrock in vercel/ai#13583/#13972.
|
|
130
122
|
*/
|
|
131
123
|
export declare function stripReasoningFromMergedAssistants(messages: MessageLike[], providerID?: string): number;
|
|
124
|
+
export interface StripProcessedImagesResult {
|
|
125
|
+
stripped: number;
|
|
126
|
+
newlyStrippedIds: string[];
|
|
127
|
+
}
|
|
132
128
|
/**
|
|
133
129
|
* Neutralize large image-data-URL file parts on already-processed user
|
|
134
|
-
* messages
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
130
|
+
* messages, replacing them in place with empty-text sentinels (which the
|
|
131
|
+
* Anthropic adapter then filters off the wire entirely).
|
|
132
|
+
*
|
|
133
|
+
* REPLAY/DETECT split — mirrors `dropStaleReduceCalls`, and for the same
|
|
134
|
+
* reason. The empty sentinel is filtered for Anthropic, so the FIRST time a
|
|
135
|
+
* message is sentinelized its image blocks VANISH from the wire — a real byte
|
|
136
|
+
* change. The earlier "strip every pass when `maxTag <= watermark`" version
|
|
137
|
+
* keyed that first-strip on the live watermark, which advances with tail
|
|
138
|
+
* growth: a DEFER pass could newly cross an older image message and strip it
|
|
139
|
+
* mid-prefix, busting the Anthropic cache on a pass that must replay
|
|
140
|
+
* byte-identically (observed live — a processed-screenshot message lost its
|
|
141
|
+
* images on a defer pass and collapsed the cached prefix). Freezing the id set
|
|
142
|
+
* on cache-busting passes and replaying it everywhere removes the moving
|
|
143
|
+
* boundary: DETECT (cache-busting passes only) finds newly-aged processed image
|
|
144
|
+
* messages, strips them, and returns their ids to persist; REPLAY (every pass,
|
|
145
|
+
* incl. defer) re-strips only already-frozen ids, byte-identical regardless of
|
|
146
|
+
* how the live array grew.
|
|
147
|
+
*
|
|
148
|
+
* Caller contract: run only when `modelAcceptsEmptyContent(providerID)` is
|
|
149
|
+
* true, because non-Anthropic adapters can forward the empty text replacement
|
|
150
|
+
* to the wire.
|
|
138
151
|
*/
|
|
139
|
-
export declare function stripProcessedImages(messages: MessageLike[],
|
|
152
|
+
export declare function stripProcessedImages(messages: MessageLike[], frozenIds: Set<string>, options: {
|
|
153
|
+
detect: boolean;
|
|
154
|
+
watermark: number;
|
|
155
|
+
messageTagNumbers: Map<MessageLike, number>;
|
|
156
|
+
}): StripProcessedImagesResult;
|
|
140
157
|
//# sourceMappingURL=strip-content.d.ts.map
|
|
@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AAC,EAC3C,iBAAiB,EAAE,MAAM,GAC1B,MAAM,CA2BR;AAYD;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,CA6BrE;AAID,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,WAAW,EAAE,EACvB,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,EAC3C,iBAAiB,EAAE,MAAM,GAC1B,MAAM,CAsBR;AAED,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,WAAW,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,GAC5C,MAAM,CAsBR;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,kCAAkC,CAC9C,QAAQ,EAAE,WAAW,EAAE,EACvB,UAAU,CAAC,EAAE,MAAM,GACpB,MAAM,CAiFR;AAED,MAAM,WAAW,0BAA0B;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,WAAW,EAAE,EACvB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,OAAO,EAAE;IACL,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;CAC/C,GACF,0BAA0B,CAqD5B"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { MessageLike } from "./tag-messages";
|
|
2
2
|
/**
|
|
3
3
|
* Replace structural/cleared parts with empty-text sentinels instead of removing
|
|
4
|
-
* them. Preserves message.parts length between passes so
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* them. Preserves message.parts length between passes so Anthropic prompt-cache
|
|
5
|
+
* prefixes stay byte-stable while OpenCode filters the empty text parts before
|
|
6
|
+
* the wire.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* producing the same wire shape as the previous behavior but avoiding
|
|
11
|
-
* mid-pipeline array mutation.
|
|
8
|
+
* Caller contract: run only when `modelAcceptsEmptyContent(providerID)` is true.
|
|
9
|
+
* Non-Anthropic adapters can forward empty text parts as real wire content.
|
|
12
10
|
*
|
|
13
11
|
* Idempotent: sentinels are themselves recognized on subsequent passes and
|
|
14
12
|
* skipped (not re-mutated, not re-counted).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strip-structural-noise.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/strip-structural-noise.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoBlD
|
|
1
|
+
{"version":3,"file":"strip-structural-noise.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/strip-structural-noise.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoBlD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,CAkBpE"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAW9C;;;;;GAKG;AACH,wBAAgB,4BAA4B,CACxC,SA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AS,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C,CA0RA"}
|
|
@@ -81,12 +81,11 @@ interface RunPostTransformPhaseArgs {
|
|
|
81
81
|
minChars: number;
|
|
82
82
|
};
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
85
|
-
* sentinel
|
|
86
|
-
*
|
|
87
|
-
* providers that don't filter empties — Kimi/Moonshot, etc.).
|
|
84
|
+
* Provider resolved once by the main transform for this pass. Used for every
|
|
85
|
+
* empty-sentinel gate and whole-message placeholder choice so postprocess
|
|
86
|
+
* cannot diverge from the main transform on cold DB-recovered passes.
|
|
88
87
|
*/
|
|
89
|
-
|
|
88
|
+
resolvedProviderID?: string;
|
|
90
89
|
historyRefreshSessions?: Set<string>;
|
|
91
90
|
m0M1?: {
|
|
92
91
|
projectPath?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-postprocess-phase.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform-postprocess-phase.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transform-postprocess-phase.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform-postprocess-phase.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,eAAe,EAmBvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAShF,OAAO,EAIH,KAAK,aAAa,EAGlB,KAAK,4BAA4B,EAEpC,MAAM,uBAAuB,CAAC;AAkB/B,OAAO,EAEH,KAAK,WAAW,EAEhB,KAAK,SAAS,EAEjB,MAAM,wBAAwB,CAAC;AAQhC,wBAAgB,uBAAuB,CAAC,SAAS,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AE,OAAO,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,CAAC;QACrD,WAAW,CAAC,EAAE,aAAa,CAAC;KAC/B,CAAC;CACL;AAED,MAAM,WAAW,wBAAwB;IACrC,gCAAgC,EAAE,OAAO,CAAC;IAC1C,gCAAgC,EAAE,OAAO,CAAC;CAC7C;AAED,wBAAsB,qBAAqB,CACvC,IAAI,EAAE,yBAAyB,GAChC,OAAO,CAAC,wBAAwB,CAAC,CA28BnC;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAChD,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,8BAA8B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxC,GAAG,OAAO,CAaV"}
|
|
@@ -97,14 +97,6 @@ export interface TransformDeps {
|
|
|
97
97
|
getNotificationParams?: (sessionId: string) => import("./send-session-notification").NotificationParams;
|
|
98
98
|
getModelKey?: (sessionId: string) => string | undefined;
|
|
99
99
|
getFallbackModelId?: (sessionId: string) => string | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* Combined fingerprint of the current tool set for this session's
|
|
102
|
-
* provider/model/agent, used as a HARD-bust marker (the provider `tools`
|
|
103
|
-
* block sits before `system` and a tool change is invisible to the system
|
|
104
|
-
* hash). Returns "" when unknown (no tool.definition fire yet) → treated as
|
|
105
|
-
* "no signal", never a spurious fold.
|
|
106
|
-
*/
|
|
107
|
-
getToolSetHash?: (sessionId: string) => string;
|
|
108
100
|
projectPath?: string;
|
|
109
101
|
experimentalUserMemories?: boolean;
|
|
110
102
|
experimentalPinKeyFiles?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/transform.ts"],"names":[],"mappings":"AAGA,OAA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