@cortexkit/opencode-magic-context 0.49.67 → 0.49.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-search-worker.js +1 -1
- package/dist/chunk-embedding-write-worker.js +1 -1
- package/dist/{context-1acz1d4x.js → context-45s8k2z1.js} +15 -15
- package/dist/hooks/magic-context/final-wire-completeness.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/image-token-estimate.d.ts +2 -0
- package/dist/hooks/magic-context/image-token-estimate.d.ts.map +1 -1
- package/dist/{index-t20q6aj6.js → index-50kb03a8.js} +44 -4
- package/dist/{index-xmk2a6pq.js → index-6az16nk1.js} +2 -2
- package/dist/{index-g53qhdrb.js → index-8xzxx8ww.js} +1 -1
- package/dist/{index-q73yeb83.js → index-9ej822m7.js} +1 -1
- package/dist/{index-8a1m48va.js → index-9rcfa1mj.js} +3 -3
- package/dist/{index-3v5mfapn.js → index-b4m3e6hp.js} +1 -1
- package/dist/{index-z10dryn5.js → index-gcbwag0s.js} +5 -5
- package/dist/{index-nfvyraa3.js → index-h1r752qh.js} +4 -4
- package/dist/{index-gy33sq5h.js → index-j87shhef.js} +6 -6
- package/dist/{index-w6fh4v87.js → index-ng6gfs0y.js} +6 -3
- package/dist/{index-m6cv2hv3.js → index-nn2tvw8c.js} +3 -3
- package/dist/{index-fybdhbd4.js → index-p18ycyd3.js} +2 -2
- package/dist/{index-m47yte97.js → index-tcsej1z7.js} +5 -5
- package/dist/{index-2t9e10mt.js → index-tdz2yrtq.js} +15 -15
- package/dist/{index-2x46rnct.js → index-vqb038xf.js} +1 -1
- package/dist/{index-ngrrs3yb.js → index-x48amv92.js} +1 -1
- package/dist/index.js +18 -18
- package/dist/{message-index-bounded-f27039js.js → message-index-bounded-gbvck1sn.js} +3 -3
- package/dist/migration-worker.js +1 -1
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-4ma2vsva.js → read-session-chunk-pf17ry28.js} +2 -2
- package/dist/{recomp-orchestrator-p9c4jg9m.js → recomp-orchestrator-xkwv21gx.js} +7 -7
- package/dist/{render-h16ea0th.js → render-fpzx40a6.js} +6 -6
- package/dist/{search-archive-km2ahm3e.js → search-archive-fvswev6b.js} +4 -4
- package/dist/{search-m9rpnh7m.js → search-n3c00q00.js} +5 -5
- package/dist/{storage-tags-ktp70q1e.js → storage-tags-k7r6mh7y.js} +1 -1
- package/dist/{store-h20ny8b8.js → store-h2a1g3wh.js} +1 -1
- package/dist/{transform-postprocess-phase-120s1ep8.js → transform-postprocess-phase-te4p4f1r.js} +8 -8
- package/dist/v2/auto-search-worker.js +1 -1
- package/dist/v2/chunk-embedding-write-worker.js +1 -1
- package/dist/v2/{context-p0z7mrsf.js → context-afpzfn3v.js} +13 -13
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-td516y9c.js → message-index-bounded-6mh661z7.js} +3 -3
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-6dz32wmh.js → read-session-chunk-vzah3d38.js} +2 -2
- package/dist/v2/{recomp-orchestrator-ayy7xzm3.js → recomp-orchestrator-r680z2yp.js} +6 -6
- package/dist/v2/{render-gqp4fwqn.js → render-rreeqwtd.js} +6 -6
- package/dist/v2/{search-archive-qn82j8k0.js → search-archive-jrmydwtk.js} +4 -4
- package/dist/v2/{search-dhekqtfc.js → search-y6xf7rek.js} +4 -4
- package/dist/v2/{server-jew1m85s.js → server-0n9297e9.js} +1 -1
- package/dist/v2/{server-5zzt9rah.js → server-474m6n9v.js} +6 -3
- package/dist/v2/{server-s1a0bwpc.js → server-6j81j52a.js} +1 -1
- package/dist/v2/{server-34vhmd1d.js → server-8p0b0p5q.js} +2 -2
- package/dist/v2/{server-xwcg55a8.js → server-cf2w8xyq.js} +4 -4
- package/dist/v2/{server-77207nf4.js → server-f1ryxejb.js} +2 -2
- package/dist/v2/{server-verzg5w8.js → server-fwxm5t54.js} +44 -4
- package/dist/v2/{server-n6hdj0fn.js → server-j0jy9twd.js} +5 -5
- package/dist/v2/{server-q8ta10e5.js → server-mm00e4hd.js} +1 -1
- package/dist/v2/{server-s66wvkpf.js → server-tky6gx9c.js} +2 -2
- package/dist/v2/{server-166m5nrw.js → server-ygjd2cys.js} +1 -1
- package/dist/v2/server.js +2 -2
- package/dist/v2/{storage-tags-qe8r1n9w.js → storage-tags-nxg71m93.js} +1 -1
- package/dist/v2/{store-skkhh3rd.js → store-4se2a0n0.js} +1 -1
- package/dist/v2/{v2-archive-reader-tbjwxvc5.js → v2-archive-reader-f1k1g9tx.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-ksdzyfby.js → wrapup-orchestrator-kgf60271.js} +6 -6
- package/dist/{v2-archive-reader-j16k987e.js → v2-archive-reader-asajy6ts.js} +1 -1
- package/dist/{wrapup-orchestrator-w09bkgmk.js → wrapup-orchestrator-gr88denr.js} +8 -8
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
31
31
|
import("./embedding-cache-mgyr73ef.js"),
|
|
32
32
|
import("./storage-memory-e6a7mb0k.js"),
|
|
33
33
|
import("./project-embedding-registry-c2sfnamh.js"),
|
|
34
|
-
import("./search-
|
|
34
|
+
import("./search-n3c00q00.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-ymc9mtwv.js"),
|
|
36
36
|
import("./embedding-activity-g1dhes6g.js"),
|
|
37
37
|
import("./harness-e4avh192.js"),
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
rebaseSessionCoordinatesAsync,
|
|
39
39
|
resolveOpenCodeProtectedTailBoundary,
|
|
40
40
|
getActiveCompartmentRun
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-tcsej1z7.js";
|
|
42
42
|
import"./index-sd3egckz.js";
|
|
43
43
|
import {
|
|
44
44
|
getHarness2
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
applyJsonSchemaParameterDescriptions,
|
|
131
131
|
MagicContextRpcServer,
|
|
132
132
|
subagentTemperature
|
|
133
|
-
} from "./index-
|
|
133
|
+
} from "./index-tdz2yrtq.js";
|
|
134
134
|
import {
|
|
135
135
|
resolveHistorianModel2
|
|
136
136
|
} from "./index-5kym00ag.js";
|
|
@@ -187,7 +187,7 @@ import {
|
|
|
187
187
|
markServedShapeRepair,
|
|
188
188
|
getEmptyImageParts,
|
|
189
189
|
estimateFinalWireInputTokens
|
|
190
|
-
} from "./index-
|
|
190
|
+
} from "./index-50kb03a8.js";
|
|
191
191
|
import {
|
|
192
192
|
hasMeaningfulUserText2,
|
|
193
193
|
preloadTokenizer,
|
|
@@ -213,12 +213,12 @@ import {
|
|
|
213
213
|
cleanUserText2,
|
|
214
214
|
readRawSessionMessageIdOrdinalsForRange2,
|
|
215
215
|
readRawSessionMessageOrdinalById2
|
|
216
|
-
} from "./index-
|
|
217
|
-
import"./index-
|
|
216
|
+
} from "./index-9ej822m7.js";
|
|
217
|
+
import"./index-vqb038xf.js";
|
|
218
218
|
import"./index-s32f8y67.js";
|
|
219
219
|
import {
|
|
220
220
|
scheduleClearAndReindex
|
|
221
|
-
} from "./index-
|
|
221
|
+
} from "./index-b4m3e6hp.js";
|
|
222
222
|
import {
|
|
223
223
|
invalidateAutoEmbedSession,
|
|
224
224
|
clearEmbedSessionState
|
|
@@ -262,7 +262,7 @@ import {
|
|
|
262
262
|
getSlot,
|
|
263
263
|
dropSlot,
|
|
264
264
|
copySessionStateForClone
|
|
265
|
-
} from "./index-
|
|
265
|
+
} from "./index-x48amv92.js";
|
|
266
266
|
import {
|
|
267
267
|
startBootDeadline,
|
|
268
268
|
BOOT_SQLITE_BUSY_TIMEOUT_MS,
|
|
@@ -270,7 +270,7 @@ import {
|
|
|
270
270
|
openDatabaseAsync,
|
|
271
271
|
isDatabasePersisted,
|
|
272
272
|
getDatabasePersistenceError
|
|
273
|
-
} from "./index-
|
|
273
|
+
} from "./index-8xzxx8ww.js";
|
|
274
274
|
import"./index-fr0wbhdn.js";
|
|
275
275
|
import"./index-xx05vta0.js";
|
|
276
276
|
import {
|
|
@@ -293,7 +293,7 @@ import {
|
|
|
293
293
|
servedHeadChanged,
|
|
294
294
|
noteHostCheckpointCommit,
|
|
295
295
|
isSyntheticHeadMessage2
|
|
296
|
-
} from "./index-
|
|
296
|
+
} from "./index-j87shhef.js";
|
|
297
297
|
import"./index-832w615x.js";
|
|
298
298
|
import"./index-qt1qqasc.js";
|
|
299
299
|
import {
|
|
@@ -314,8 +314,8 @@ import {
|
|
|
314
314
|
} from "./index-x8a7jmkh.js";
|
|
315
315
|
import"./index-e6ncz7a6.js";
|
|
316
316
|
import"./index-1sq1krqw.js";
|
|
317
|
-
import"./index-
|
|
318
|
-
import"./index-
|
|
317
|
+
import"./index-nn2tvw8c.js";
|
|
318
|
+
import"./index-9rcfa1mj.js";
|
|
319
319
|
import"./index-98qy103c.js";
|
|
320
320
|
import {
|
|
321
321
|
detectConflicts
|
|
@@ -336,12 +336,12 @@ import {
|
|
|
336
336
|
readV2RawMessagePagesForConversion2,
|
|
337
337
|
createV2RawMessageReader2,
|
|
338
338
|
createV2RawMessageProvider2
|
|
339
|
-
} from "./index-
|
|
339
|
+
} from "./index-ng6gfs0y.js";
|
|
340
340
|
import"./index-fmsr7v69.js";
|
|
341
|
-
import"./index-
|
|
341
|
+
import"./index-6az16nk1.js";
|
|
342
342
|
import"./index-52x68mj4.js";
|
|
343
|
-
import"./index-
|
|
344
|
-
import"./index-
|
|
343
|
+
import"./index-h1r752qh.js";
|
|
344
|
+
import"./index-p18ycyd3.js";
|
|
345
345
|
import {
|
|
346
346
|
isDreamerRunnable,
|
|
347
347
|
isSmartNoteSurfaceAvailable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"final-wire-completeness.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/final-wire-completeness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"final-wire-completeness.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/final-wire-completeness.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAgEhE;AAMD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE;;;;;;IAkBnE;AAED,sFAAsF;AACtF,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,IAErD,UAAU;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EAAE,UAAU,SAAS,WAAW,EAAE,KAAG,IAAI,CAQ9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"final-wire-token-estimate.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/final-wire-token-estimate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"final-wire-token-estimate.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/final-wire-token-estimate.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Returns a conservative fallback when parsing fails.
|
|
4
4
|
*/
|
|
5
5
|
export declare function estimateImageTokensFromDataUrl(url: string): number;
|
|
6
|
+
export declare function isInlineNativeMediaImage(part: Record<string, unknown>): boolean;
|
|
7
|
+
export declare function estimateNativeMediaImageTokens(part: Record<string, unknown>): number;
|
|
6
8
|
/**
|
|
7
9
|
* Image tokens of a tool part's `state.attachments`: the images a tool returned next to its
|
|
8
10
|
* text output (OpenCode's `read` on a PNG, for example). The provider bills each one as an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-token-estimate.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/image-token-estimate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-token-estimate.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/image-token-estimate.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlE;AAyDD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAE/E;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAOpF;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAexE"}
|
|
@@ -310,8 +310,9 @@ function estimateImageTokensFromDataUrl(url) {
|
|
|
310
310
|
const comma = url.indexOf(",");
|
|
311
311
|
if (comma < 0)
|
|
312
312
|
return IMAGE_FALLBACK_TOKENS;
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
return estimateImageTokensFromBase64(url.slice(0, comma), url.slice(comma + 1));
|
|
314
|
+
}
|
|
315
|
+
function estimateImageTokensFromBase64(header, payload) {
|
|
315
316
|
const sliceLen = Math.min(512, payload.length);
|
|
316
317
|
const preview = payload.slice(0, sliceLen);
|
|
317
318
|
let bytes;
|
|
@@ -320,12 +321,15 @@ function estimateImageTokensFromDataUrl(url) {
|
|
|
320
321
|
} catch {
|
|
321
322
|
return IMAGE_FALLBACK_TOKENS;
|
|
322
323
|
}
|
|
324
|
+
return estimateImageTokensFromHeader(header, bytes, () => createBase64ByteReader(payload, bytes));
|
|
325
|
+
}
|
|
326
|
+
function estimateImageTokensFromHeader(header, bytes, jpegReader) {
|
|
323
327
|
if (header.includes("image/png")) {
|
|
324
328
|
const dims = parsePngDimensions(bytes);
|
|
325
329
|
if (dims)
|
|
326
330
|
return clampImageTokens(Math.ceil(dims.w * dims.h / IMAGE_TOKEN_DIVISOR));
|
|
327
331
|
} else if (header.includes("image/jpeg") || header.includes("image/jpg")) {
|
|
328
|
-
const dims = parseJpegDimensions(
|
|
332
|
+
const dims = parseJpegDimensions(jpegReader());
|
|
329
333
|
if (dims)
|
|
330
334
|
return clampImageTokens(Math.ceil(dims.w * dims.h / IMAGE_TOKEN_DIVISOR));
|
|
331
335
|
} else if (header.includes("image/webp")) {
|
|
@@ -339,6 +343,36 @@ function estimateImageTokensFromDataUrl(url) {
|
|
|
339
343
|
}
|
|
340
344
|
return IMAGE_FALLBACK_TOKENS;
|
|
341
345
|
}
|
|
346
|
+
function nativeMediaImage(part) {
|
|
347
|
+
if (part.type !== "media" || !isRecord(part.media))
|
|
348
|
+
return;
|
|
349
|
+
const { mediaType, source } = part.media;
|
|
350
|
+
if (typeof mediaType !== "string" || !mediaType.startsWith("image/"))
|
|
351
|
+
return;
|
|
352
|
+
let inline;
|
|
353
|
+
if (isRecord(source)) {
|
|
354
|
+
const { type, data } = source;
|
|
355
|
+
if (type === "base64" && typeof data === "string" && data.length > 0)
|
|
356
|
+
inline = data;
|
|
357
|
+
if (type === "bytes" && data instanceof Uint8Array && data.byteLength > 0)
|
|
358
|
+
inline = data;
|
|
359
|
+
}
|
|
360
|
+
return { mediaType, inline };
|
|
361
|
+
}
|
|
362
|
+
function isInlineNativeMediaImage(part) {
|
|
363
|
+
return nativeMediaImage(part)?.inline !== undefined;
|
|
364
|
+
}
|
|
365
|
+
function estimateNativeMediaImageTokens(part) {
|
|
366
|
+
const image = nativeMediaImage(part);
|
|
367
|
+
if (!image)
|
|
368
|
+
return 0;
|
|
369
|
+
const { mediaType, inline } = image;
|
|
370
|
+
if (typeof inline === "string")
|
|
371
|
+
return estimateImageTokensFromBase64(mediaType, inline);
|
|
372
|
+
if (inline)
|
|
373
|
+
return estimateImageTokensFromHeader(mediaType, inline, () => (i) => inline[i]);
|
|
374
|
+
return IMAGE_FALLBACK_TOKENS;
|
|
375
|
+
}
|
|
342
376
|
function estimateToolAttachmentImageTokens(state) {
|
|
343
377
|
if (!state || typeof state !== "object")
|
|
344
378
|
return 0;
|
|
@@ -2008,9 +2042,12 @@ function incompleteWirePartFields(part) {
|
|
|
2008
2042
|
return missing(p.result !== undefined || p.content !== undefined || p.output !== undefined, "result");
|
|
2009
2043
|
case "step-start":
|
|
2010
2044
|
case "step-finish":
|
|
2045
|
+
case "effort":
|
|
2011
2046
|
return [];
|
|
2012
2047
|
case "file":
|
|
2013
2048
|
return missing(typeof p.url === "string" && p.url.startsWith("data:image/"), "url (data:image/)");
|
|
2049
|
+
case "media":
|
|
2050
|
+
return missing(isInlineNativeMediaImage(p), "media (inline image)");
|
|
2014
2051
|
default:
|
|
2015
2052
|
return ["supported type"];
|
|
2016
2053
|
}
|
|
@@ -6529,11 +6566,13 @@ function serializedTokens(value, bounded = false) {
|
|
|
6529
6566
|
return serialized ? wireTextTokens(serialized) : 0;
|
|
6530
6567
|
}
|
|
6531
6568
|
function estimatePartImageTokens(raw) {
|
|
6532
|
-
if (!raw
|
|
6569
|
+
if (!isRecord(raw))
|
|
6533
6570
|
return 0;
|
|
6534
6571
|
const part = raw;
|
|
6535
6572
|
if (part.ignored)
|
|
6536
6573
|
return 0;
|
|
6574
|
+
if (part.type === "media")
|
|
6575
|
+
return estimateNativeMediaImageTokens(raw);
|
|
6537
6576
|
if (part.type === "file" && part.mime?.startsWith("image/")) {
|
|
6538
6577
|
return typeof part.url === "string" && part.url.startsWith("data:") ? estimateImageTokensFromDataUrl(part.url) : 1200;
|
|
6539
6578
|
}
|
|
@@ -6596,6 +6635,7 @@ function visitWireContent(message, visit) {
|
|
|
6596
6635
|
opaque();
|
|
6597
6636
|
break;
|
|
6598
6637
|
case "file":
|
|
6638
|
+
case "media":
|
|
6599
6639
|
visit.image("conversation", estimatePartImageTokens(part));
|
|
6600
6640
|
break;
|
|
6601
6641
|
case "tool":
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./index-5vsk2cpp.js";
|
|
4
4
|
import {
|
|
5
5
|
getTagById2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-50kb03a8.js";
|
|
7
7
|
import {
|
|
8
8
|
expandToolPart,
|
|
9
9
|
visitRawSessionMessages2,
|
|
10
10
|
readRawSessionMessageById2
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-9ej822m7.js";
|
|
12
12
|
|
|
13
13
|
// src/tools/ctx-expand/render.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -1021,7 +1021,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
1021
1021
|
state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
|
|
1022
1022
|
if (signal.aborted || !readsOpenCodeStore)
|
|
1023
1023
|
return;
|
|
1024
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-
|
|
1024
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-pf17ry28.js"));
|
|
1025
1025
|
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-pz5981mf.js"));
|
|
1026
1026
|
if (signal.aborted)
|
|
1027
1027
|
return;
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./index-ywrz4wy2.js";
|
|
4
4
|
import {
|
|
5
5
|
clearEmergencyRecovery
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-50kb03a8.js";
|
|
7
7
|
import {
|
|
8
8
|
requestPendingMaterialization,
|
|
9
9
|
dropSlot
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-x48amv92.js";
|
|
11
11
|
import {
|
|
12
12
|
executeContextRecomp
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-tcsej1z7.js";
|
|
14
14
|
import {
|
|
15
15
|
renderUserFacingFailure,
|
|
16
16
|
userFacingFailureCode
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
releaseCompartmentLeaseBestEffort,
|
|
9
9
|
getCompartments,
|
|
10
10
|
getLastCompartmentEndMessage
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-x48amv92.js";
|
|
12
12
|
import {
|
|
13
13
|
inRootAsyncContext2
|
|
14
14
|
} from "./index-gzy5w8ya.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
releaseWrapupInProgress,
|
|
20
20
|
getHistorianFailureState,
|
|
21
21
|
clearEmergencyRecovery
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-50kb03a8.js";
|
|
23
23
|
import {
|
|
24
24
|
prepareRawSessionOrdinals2
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-9ej822m7.js";
|
|
26
26
|
import {
|
|
27
27
|
pushNotification2
|
|
28
28
|
} from "./index-x8a7jmkh.js";
|
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
getActiveCompartmentRun,
|
|
35
35
|
markActiveCompartmentRunPublished,
|
|
36
36
|
registerActiveCompartmentRun
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-tcsej1z7.js";
|
|
38
38
|
import {
|
|
39
39
|
sendStatusNotification2
|
|
40
40
|
} from "./index-1sq1krqw.js";
|
|
41
41
|
import {
|
|
42
42
|
setRecompStarting2,
|
|
43
43
|
setRecompTerminal2
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-9rcfa1mj.js";
|
|
45
45
|
|
|
46
46
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
47
47
|
import * as crypto from "node:crypto";
|
|
@@ -138,10 +138,10 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
138
138
|
] = await Promise.all([
|
|
139
139
|
import("./sqlite-zdgm52sv.js"),
|
|
140
140
|
import("./store-reader-3eh1s1m8.js"),
|
|
141
|
-
import("./store-
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
141
|
+
import("./store-h2a1g3wh.js"),
|
|
142
|
+
import("./read-session-chunk-pf17ry28.js"),
|
|
143
|
+
import("./render-fpzx40a6.js"),
|
|
144
|
+
import("./search-archive-fvswev6b.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
adoptNullOwnerToolTag2,
|
|
172
172
|
getCandidateToolOwners2,
|
|
173
173
|
pickNearestPriorOwner2
|
|
174
|
-
} from "./index-
|
|
174
|
+
} from "./index-50kb03a8.js";
|
|
175
175
|
import {
|
|
176
176
|
textMentionsRecentCommit,
|
|
177
177
|
hasMeaningfulUserText2,
|
|
@@ -224,11 +224,11 @@ import {
|
|
|
224
224
|
saveSourceContent,
|
|
225
225
|
replaceSourceContent,
|
|
226
226
|
getSourceContents
|
|
227
|
-
} from "./index-
|
|
227
|
+
} from "./index-x48amv92.js";
|
|
228
228
|
import {
|
|
229
229
|
cleanSearchText,
|
|
230
230
|
matchedSearchSnippet
|
|
231
|
-
} from "./index-
|
|
231
|
+
} from "./index-vqb038xf.js";
|
|
232
232
|
import {
|
|
233
233
|
getProjectEmbeddingSnapshot2,
|
|
234
234
|
embedTextForProject2,
|
|
@@ -241,7 +241,7 @@ import {
|
|
|
241
241
|
getMessageIndexEpoch,
|
|
242
242
|
isMessageIndexSearchable,
|
|
243
243
|
createAutoSearchDiagnostics
|
|
244
|
-
} from "./index-
|
|
244
|
+
} from "./index-b4m3e6hp.js";
|
|
245
245
|
import {
|
|
246
246
|
openCodeDbExists,
|
|
247
247
|
withReadOnlySessionDb,
|
|
@@ -259,7 +259,7 @@ import {
|
|
|
259
259
|
extractToolCallObservation,
|
|
260
260
|
ToolMutationBatch,
|
|
261
261
|
createToolDropTarget
|
|
262
|
-
} from "./index-
|
|
262
|
+
} from "./index-9ej822m7.js";
|
|
263
263
|
import {
|
|
264
264
|
compareOpenCodeMessagesByCanonicalOrder,
|
|
265
265
|
startCompactionMarkerCandidatePreparation,
|
|
@@ -281,7 +281,7 @@ import {
|
|
|
281
281
|
peekNoteNudgeText,
|
|
282
282
|
markNoteNudgeDelivered,
|
|
283
283
|
getActiveCompartmentRun
|
|
284
|
-
} from "./index-
|
|
284
|
+
} from "./index-tcsej1z7.js";
|
|
285
285
|
import {
|
|
286
286
|
userFacingFailureCode
|
|
287
287
|
} from "./index-n6aye6ny.js";
|
|
@@ -142,9 +142,12 @@ function restoreRow(row, model, media) {
|
|
|
142
142
|
}
|
|
143
143
|
if (row.type === "system")
|
|
144
144
|
return [{ role: "system", content: [{ type: "text", text: data.text ?? "" }] }];
|
|
145
|
-
if (row.type === "synthetic"
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
if (row.type === "synthetic") {
|
|
146
|
+
if (isStorageNoticeText(data.text))
|
|
147
|
+
return [];
|
|
148
|
+
return [make("user", [{ type: "text", text: data.text ?? "", synthetic: true }])];
|
|
149
|
+
}
|
|
150
|
+
if (row.type === "skill")
|
|
148
151
|
return [make("user", [{ type: "text", text: data.text ?? "" }])];
|
|
149
152
|
if (row.type === "location-switched")
|
|
150
153
|
return [
|
|
@@ -67,21 +67,21 @@ import {
|
|
|
67
67
|
import {
|
|
68
68
|
matchedSearchSnippet,
|
|
69
69
|
getIndexedMessageCorpusSize
|
|
70
|
-
} from "./index-
|
|
70
|
+
} from "./index-vqb038xf.js";
|
|
71
71
|
import {
|
|
72
72
|
getMessageIndexEpoch,
|
|
73
73
|
isMessageIndexSearchable,
|
|
74
74
|
withMemoryHintContent,
|
|
75
75
|
autoSearchRelevance,
|
|
76
76
|
recordAutoSearchLane
|
|
77
|
-
} from "./index-
|
|
77
|
+
} from "./index-b4m3e6hp.js";
|
|
78
78
|
import {
|
|
79
79
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
80
80
|
withMessageFtsSessionFilter
|
|
81
81
|
} from "./index-52x68mj4.js";
|
|
82
82
|
import {
|
|
83
83
|
isRecord
|
|
84
|
-
} from "./index-
|
|
84
|
+
} from "./index-50kb03a8.js";
|
|
85
85
|
import {
|
|
86
86
|
resolveWorkspaceShareCategories,
|
|
87
87
|
resolveWorkspaceIdentitySet,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
rawMessageWorkerSource2,
|
|
20
20
|
rawMessageOffThreadRangeReader2,
|
|
21
21
|
readRawSessionMessageIdOrdinalsForRange2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-9ej822m7.js";
|
|
23
23
|
import {
|
|
24
24
|
readV2ArchiveOffThread2
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-h1r752qh.js";
|
|
26
26
|
|
|
27
27
|
// src/tools/ctx-expand/search-archive.ts
|
|
28
28
|
var archiveReadsOnThisThread = 0;
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getRawSessionTagKeysThrough2,
|
|
36
36
|
getLegacyProtectedTailStartOrdinal2,
|
|
37
37
|
readSessionChunk2
|
|
38
|
-
} from "./index-
|
|
38
|
+
} from "./index-9ej822m7.js";
|
|
39
39
|
import {
|
|
40
40
|
getHarness2,
|
|
41
41
|
harnessOwnsOpenCodeStore2
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
LATEST_SUPPORTED_VERSION,
|
|
114
114
|
getPersistedSchemaVersion,
|
|
115
115
|
openDatabase
|
|
116
|
-
} from "./index-
|
|
116
|
+
} from "./index-8xzxx8ww.js";
|
|
117
117
|
import {
|
|
118
118
|
areRustHistorianSyntheticParts2,
|
|
119
119
|
isStrictGapHealingMessage2,
|
|
@@ -201,14 +201,14 @@ import {
|
|
|
201
201
|
getProjectState,
|
|
202
202
|
recordSubagentInvocation,
|
|
203
203
|
getLatestHistorianInvocationId
|
|
204
|
-
} from "./index-
|
|
204
|
+
} from "./index-x48amv92.js";
|
|
205
205
|
import {
|
|
206
206
|
clearCompressionDepth,
|
|
207
207
|
clearCompressionDepthRange,
|
|
208
208
|
toMessageIndexSource,
|
|
209
209
|
clearIndexedMessagesInTransaction,
|
|
210
210
|
indexSourcesAfterOrdinal
|
|
211
|
-
} from "./index-
|
|
211
|
+
} from "./index-vqb038xf.js";
|
|
212
212
|
import {
|
|
213
213
|
stripWellFormedLeadingTagPrefix,
|
|
214
214
|
peelLeadingMcTagNotation,
|
|
@@ -258,7 +258,7 @@ import {
|
|
|
258
258
|
foldShrunkPartTags2,
|
|
259
259
|
getTagNumberByMessageId2,
|
|
260
260
|
getActiveTagsBySession2
|
|
261
|
-
} from "./index-
|
|
261
|
+
} from "./index-50kb03a8.js";
|
|
262
262
|
import {
|
|
263
263
|
openCodeDbExists,
|
|
264
264
|
withReadOnlySessionDb,
|
|
@@ -196,7 +196,7 @@ import {
|
|
|
196
196
|
snapRangeToCompartments,
|
|
197
197
|
getActiveCompartmentRun,
|
|
198
198
|
startCompartmentAgent
|
|
199
|
-
} from "./index-
|
|
199
|
+
} from "./index-tcsej1z7.js";
|
|
200
200
|
import {
|
|
201
201
|
hasTrustedAbsoluteWall,
|
|
202
202
|
applyProvenInputFloor,
|
|
@@ -355,7 +355,7 @@ import {
|
|
|
355
355
|
getTagsByNumbers2,
|
|
356
356
|
getDroppedTagsByNumbers2,
|
|
357
357
|
getMaxDroppedTagNumber2
|
|
358
|
-
} from "./index-
|
|
358
|
+
} from "./index-50kb03a8.js";
|
|
359
359
|
import {
|
|
360
360
|
BoundedSessionMap,
|
|
361
361
|
observeTemporalDecisions,
|
|
@@ -427,7 +427,7 @@ import {
|
|
|
427
427
|
readRawSessionMessageById2,
|
|
428
428
|
readSessionChunk2,
|
|
429
429
|
readRawSessionSeedTail2
|
|
430
|
-
} from "./index-
|
|
430
|
+
} from "./index-9ej822m7.js";
|
|
431
431
|
import {
|
|
432
432
|
isFailClosedBlockingError,
|
|
433
433
|
shouldBypassFailClosedBlock,
|
|
@@ -453,7 +453,7 @@ import {
|
|
|
453
453
|
runSqliteOptimize,
|
|
454
454
|
openDatabase,
|
|
455
455
|
openCurrentDatabase
|
|
456
|
-
} from "./index-
|
|
456
|
+
} from "./index-8xzxx8ww.js";
|
|
457
457
|
import {
|
|
458
458
|
unescapeXml,
|
|
459
459
|
resolveWorkspaceShareCategories,
|
|
@@ -569,10 +569,10 @@ import {
|
|
|
569
569
|
GLOBAL_USER_PROFILE_PROJECT_PATH,
|
|
570
570
|
getProjectState,
|
|
571
571
|
bumpProjectUserProfileVersion
|
|
572
|
-
} from "./index-
|
|
572
|
+
} from "./index-x48amv92.js";
|
|
573
573
|
import {
|
|
574
574
|
getLastIndexedOrdinal
|
|
575
|
-
} from "./index-
|
|
575
|
+
} from "./index-vqb038xf.js";
|
|
576
576
|
import {
|
|
577
577
|
SESSION_NOTE_CONDITION_ERROR,
|
|
578
578
|
getNoteByIdInScope,
|
|
@@ -706,13 +706,13 @@ import {
|
|
|
706
706
|
resolveMemoriesByIdsForSearch2,
|
|
707
707
|
unifiedSearch2,
|
|
708
708
|
formatSearchResults2
|
|
709
|
-
} from "./index-
|
|
709
|
+
} from "./index-nn2tvw8c.js";
|
|
710
710
|
import {
|
|
711
711
|
scheduleReconciliation,
|
|
712
712
|
scheduleIncrementalIndex,
|
|
713
713
|
getMessageIndexQueueHeapStats,
|
|
714
714
|
clearSessionTracking
|
|
715
|
-
} from "./index-
|
|
715
|
+
} from "./index-b4m3e6hp.js";
|
|
716
716
|
import {
|
|
717
717
|
flushIgnoredMessages2,
|
|
718
718
|
clearIgnoredMessages2,
|
|
@@ -722,7 +722,7 @@ import {
|
|
|
722
722
|
import {
|
|
723
723
|
setRecompStarting2,
|
|
724
724
|
setRecompTerminal2
|
|
725
|
-
} from "./index-
|
|
725
|
+
} from "./index-9rcfa1mj.js";
|
|
726
726
|
import {
|
|
727
727
|
makeToolCompositeKey,
|
|
728
728
|
searchMessageHistoryOffThread,
|
|
@@ -807,7 +807,7 @@ import {
|
|
|
807
807
|
abortSessionFailClosed2,
|
|
808
808
|
evaluateEmergencyFailClosed2,
|
|
809
809
|
runPostTransformPhase2
|
|
810
|
-
} from "./index-
|
|
810
|
+
} from "./index-j87shhef.js";
|
|
811
811
|
import {
|
|
812
812
|
ANNOUNCEMENT_VERSION2,
|
|
813
813
|
ANNOUNCEMENT_FEATURES2,
|
|
@@ -822,13 +822,13 @@ import {
|
|
|
822
822
|
renderMessageByOrdinal2,
|
|
823
823
|
renderVerboseRangeForTool2,
|
|
824
824
|
renderItemByTag2
|
|
825
|
-
} from "./index-
|
|
825
|
+
} from "./index-6az16nk1.js";
|
|
826
826
|
import {
|
|
827
827
|
readV2ArchiveOffThread2
|
|
828
|
-
} from "./index-
|
|
828
|
+
} from "./index-h1r752qh.js";
|
|
829
829
|
import {
|
|
830
830
|
renderSearchArchiveOffThread2
|
|
831
|
-
} from "./index-
|
|
831
|
+
} from "./index-p18ycyd3.js";
|
|
832
832
|
import {
|
|
833
833
|
COMPACTION_ENABLED_PATH,
|
|
834
834
|
isDreamerRunnable,
|
|
@@ -16468,7 +16468,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16468
16468
|
const db = readDatabase();
|
|
16469
16469
|
if (!db)
|
|
16470
16470
|
return { ok: false, error: "db unavailable" };
|
|
16471
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16471
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-xkwv21gx.js"));
|
|
16472
16472
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-ykvt5k2s.js"));
|
|
16473
16473
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16474
16474
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -16553,7 +16553,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16553
16553
|
const db = readDatabase();
|
|
16554
16554
|
if (!db)
|
|
16555
16555
|
return { ok: false, error: "db unavailable" };
|
|
16556
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16556
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-gr88denr.js"));
|
|
16557
16557
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
16558
16558
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
16559
16559
|
const ctx = {
|