@cortexkit/opencode-magic-context 0.49.78 → 0.49.79
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-6pxdmpay.js → context-gb3gjahp.js} +14 -14
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts +1 -1
- package/dist/features/magic-context/dreamer/curate-category-rotation.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/curate-memory-safety.d.ts +5 -1
- package/dist/features/magic-context/dreamer/curate-memory-safety.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts +2 -0
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/hooks/magic-context/image-token-estimate.d.ts.map +1 -1
- package/dist/{index-c7xvvhdd.js → index-2dadxknq.js} +110 -59
- package/dist/{index-8mt6vvwx.js → index-2q0t43fy.js} +1 -1
- package/dist/{index-1pfjvk89.js → index-8ykmp4jv.js} +6 -6
- package/dist/{index-kn23xzst.js → index-aawwdt26.js} +1 -1
- package/dist/{index-xkn7vq89.js → index-f619wjj9.js} +3 -3
- package/dist/{index-c3a833vk.js → index-hgdkwp21.js} +2 -2
- package/dist/{index-72qk8fs8.js → index-m0tbtzqh.js} +3 -3
- package/dist/{index-r865s8hf.js → index-m6rkq3t4.js} +1 -1
- package/dist/{index-dcdk1thy.js → index-sy5wbbw6.js} +5 -5
- package/dist/{index-7jj5jk78.js → index-tvkzkk4s.js} +5 -5
- package/dist/{index-k6b1av2m.js → index-twmeey4h.js} +2 -2
- package/dist/{index-cssarkg7.js → index-v8x07j6c.js} +3 -3
- package/dist/{index-rjm4hjyb.js → index-xsdaz3mq.js} +1 -1
- package/dist/{index-bdnak4d0.js → index-y208s7zx.js} +5 -3
- package/dist/{index-vr6t0y4w.js → index-zzvd4a9z.js} +1 -1
- package/dist/index.js +18 -18
- package/dist/{message-index-bounded-s0bckzqz.js → message-index-bounded-cfkeyf72.js} +3 -3
- package/dist/migration-worker.js +1 -1
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-kqyb1y8c.js → read-session-chunk-s3qac56g.js} +2 -2
- package/dist/{recomp-orchestrator-38ed4yhj.js → recomp-orchestrator-jf60eef6.js} +7 -7
- package/dist/{render-8s531gd5.js → render-bjxgkrk6.js} +6 -6
- package/dist/{search-archive-2f1j2dh8.js → search-archive-a60k0x2n.js} +4 -4
- package/dist/{search-m4r4v4aw.js → search-mpde08f1.js} +5 -5
- package/dist/shared/subagent-runner.d.ts +9 -0
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/{storage-tags-d3nqrva7.js → storage-tags-6e83pvff.js} +1 -1
- package/dist/{transform-postprocess-phase-ch5fsw7h.js → transform-postprocess-phase-m1be339w.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-h3r9gxrd.js → context-fzp6ynz4.js} +107 -56
- package/dist/v2/{message-index-bounded-vfx2zx9y.js → message-index-bounded-0xy4dn04.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-bh402br0.js → read-session-chunk-6mt2t6dy.js} +2 -2
- package/dist/v2/{recomp-orchestrator-43grkr1k.js → recomp-orchestrator-4r63zen2.js} +6 -6
- package/dist/v2/{render-90pve6jf.js → render-7tr9d67f.js} +6 -6
- package/dist/v2/{search-archive-ha08g13n.js → search-archive-2ck9sbsc.js} +4 -4
- package/dist/v2/{search-xr5wb3a3.js → search-y01mww69.js} +4 -4
- package/dist/v2/{server-86vydsx9.js → server-0dmzr7f9.js} +2 -2
- package/dist/v2/{server-92fhew3p.js → server-1svqwm7m.js} +5 -5
- package/dist/v2/{server-6jxvkyrr.js → server-2gcfmd47.js} +1 -1
- package/dist/v2/{server-fjd90bk0.js → server-d7dbk2h6.js} +2 -2
- package/dist/v2/{server-gsz7h1zr.js → server-dhdn8mwq.js} +1 -1
- package/dist/v2/{server-qcbxjpkv.js → server-qpnjsg1v.js} +3 -3
- package/dist/v2/{server-fw2sjpkx.js → server-r00xyx66.js} +1 -1
- package/dist/v2/{server-b8qp1ark.js → server-r9xsgnez.js} +1 -1
- package/dist/v2/{server-65r7p1z4.js → server-tkznm2j9.js} +2 -2
- package/dist/v2/{server-cxkb9725.js → server-xdh4r20h.js} +5 -3
- package/dist/v2/server.js +2 -2
- package/dist/v2/{storage-tags-j4he6hwe.js → storage-tags-z8j8wq34.js} +1 -1
- package/dist/v2/{v2-archive-reader-xs0d7yyr.js → v2-archive-reader-jatkdt2s.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-ghbsa00k.js → wrapup-orchestrator-z91sebhb.js} +6 -6
- package/dist/{v2-archive-reader-maj9xst8.js → v2-archive-reader-sw01917z.js} +1 -1
- package/dist/{wrapup-orchestrator-q12ejyw9.js → wrapup-orchestrator-1k48hzxg.js} +8 -8
- package/package.json +1 -1
- package/src/shared/subagent-runner.ts +10 -0
|
@@ -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-sw4z2ptg.js"),
|
|
34
|
-
import("./search-
|
|
34
|
+
import("./search-mpde08f1.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-sy5wbbw6.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-2dadxknq.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-y208s7zx.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-2q0t43fy.js";
|
|
217
|
+
import"./index-zzvd4a9z.js";
|
|
218
218
|
import"./index-s32f8y67.js";
|
|
219
219
|
import {
|
|
220
220
|
scheduleClearAndReindex
|
|
221
|
-
} from "./index-
|
|
221
|
+
} from "./index-m6rkq3t4.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-xsdaz3mq.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-aawwdt26.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-8ykmp4jv.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-m0tbtzqh.js";
|
|
318
|
+
import"./index-f619wjj9.js";
|
|
319
319
|
import"./index-98qy103c.js";
|
|
320
320
|
import {
|
|
321
321
|
detectConflicts
|
|
@@ -342,10 +342,10 @@ import {
|
|
|
342
342
|
createV2RawMessageProvider2
|
|
343
343
|
} from "./index-enpatj5k.js";
|
|
344
344
|
import"./index-fmsr7v69.js";
|
|
345
|
-
import"./index-
|
|
345
|
+
import"./index-twmeey4h.js";
|
|
346
346
|
import"./index-52x68mj4.js";
|
|
347
|
-
import"./index-
|
|
348
|
-
import"./index-
|
|
347
|
+
import"./index-v8x07j6c.js";
|
|
348
|
+
import"./index-hgdkwp21.js";
|
|
349
349
|
import {
|
|
350
350
|
isDreamerRunnable,
|
|
351
351
|
isSmartNoteSurfaceAvailable,
|
|
@@ -14,7 +14,7 @@ export declare function peekCurateCategoryScope<T extends {
|
|
|
14
14
|
export declare function beginCurateCategoryRun<T extends {
|
|
15
15
|
category: string;
|
|
16
16
|
}>(db: Database, projectIdentity: string, memories: readonly T[]): CurateCategoryScope<T> | null;
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function curateTaskStateAfterCategoryTurn(db: Database, projectIdentity: string, category: CurateMemoryCategory): string;
|
|
18
18
|
export declare function getActiveCurateCategory(db: Database, projectIdentity: string): CurateMemoryCategory | null;
|
|
19
19
|
export declare function getCurateCategoryScopeRefusal(args: {
|
|
20
20
|
scope: CurateMemoryCategory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curate-category-rotation.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/curate-category-rotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD,eAAO,MAAM,wBAAwB,sFAAuB,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAY7E,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAI7F;AAYD,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE;IAC/D,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,CAAC,EAAE,CAAC;CACjB;AAuCD,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EAClE,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,SAAS,CAAC,EAAE,GACvB,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAgB/B;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EACjE,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,SAAS,CAAC,EAAE,GACvB,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAiB/B;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"curate-category-rotation.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/curate-category-rotation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD,eAAO,MAAM,wBAAwB,sFAAuB,CAAC;AAE7D,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAY7E,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAI7F;AAYD,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE;IAC/D,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,CAAC,EAAE,CAAC;CACjB;AAuCD,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EAClE,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,SAAS,CAAC,EAAE,GACvB,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAgB/B;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,EACjE,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,SAAS,CAAC,EAAE,GACvB,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,CAiB/B;AAED,wBAAgB,gCAAgC,CAC5C,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,oBAAoB,GAC/B,MAAM,CASR;AAED,wBAAgB,uBAAuB,CACnC,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,GACxB,oBAAoB,GAAG,IAAI,CAG7B;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAChD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAChD,GAAG,MAAM,GAAG,IAAI,CAWhB"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Memory } from "../memory";
|
|
2
2
|
export type CurateMutationVerdict = "archive" | "update";
|
|
3
|
-
|
|
3
|
+
declare const CURATE_SAFETY_REFUSAL_REASONS: readonly ["missing-active-same-category-successor", "user-profile-is-not-project-memory", "directive-shaped-project-rule", "content-loss"];
|
|
4
|
+
export type CurateSafetyRefusalReason = (typeof CURATE_SAFETY_REFUSAL_REASONS)[number];
|
|
5
|
+
/** Read the reason labels for one refused call. The `refused=` field counts memories across the child session, not operations in this result. */
|
|
6
|
+
export declare function parseCurateSafetyRefusal(action: unknown, output: string): CurateSafetyRefusalReason[] | null;
|
|
4
7
|
export interface CurateSafetyRefusal {
|
|
5
8
|
memoryId: number;
|
|
6
9
|
verdict: CurateMutationVerdict;
|
|
@@ -18,4 +21,5 @@ export declare function assessCurateMutationSafety(args: {
|
|
|
18
21
|
}): CurateSafetyRefusal | null;
|
|
19
22
|
export declare function recordCurateSafetyRefusal(sessionId: string, refusal: CurateSafetyRefusal): number;
|
|
20
23
|
export declare function takeCurateSafetyRefusalCount(sessionId: string): number;
|
|
24
|
+
export {};
|
|
21
25
|
//# sourceMappingURL=curate-memory-safety.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curate-memory-safety.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/curate-memory-safety.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOxC,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACzD,MAAM,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"curate-memory-safety.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/curate-memory-safety.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOxC,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACzD,QAAA,MAAM,6BAA6B,4IAKzB,CAAC;AACX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAIvF,iJAAiJ;AACjJ,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACf,yBAAyB,EAAE,GAAG,IAAI,CAapC;AAED,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,qBAAqB,CAAC;IAC/B,MAAM,EAAE,yBAAyB,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAoBD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,qBAAqB,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C,GAAG,mBAAmB,GAAG,IAAI,CAgD7B;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAWjG;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAItE"}
|
|
@@ -4,6 +4,7 @@ import type { PluginContext } from "../../../plugin/types";
|
|
|
4
4
|
import type { ModelInput } from "../../../shared/model-resolution";
|
|
5
5
|
import type { Database } from "../../../shared/sqlite";
|
|
6
6
|
import { type ClassifyModuleClient } from "./classify";
|
|
7
|
+
import { type CurateSafetyRefusalReason } from "./curate-memory-safety";
|
|
7
8
|
import { type RetrospectiveRawProvider } from "./retrospective-raw-provider";
|
|
8
9
|
import { type DreamTaskName, type DreamTaskProgress } from "./task-registry";
|
|
9
10
|
import type { TaskExecutor } from "./task-scheduler";
|
|
@@ -74,6 +75,7 @@ export interface DreamTaskExecutorDeps {
|
|
|
74
75
|
interface CurateMemoryOperationSummary {
|
|
75
76
|
totalCalls: number;
|
|
76
77
|
completedActions: string[];
|
|
78
|
+
refusals: CurateSafetyRefusalReason[][];
|
|
77
79
|
}
|
|
78
80
|
export declare function inspectCurateMemoryOperations(messages: unknown): CurateMemoryOperationSummary;
|
|
79
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-executor.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/task-executor.ts"],"names":[],"mappings":"AAcA,OAAO,EAEH,KAAK,wBAAwB,EAGhC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAK1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AASnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAiBvD,OAAO,EAAE,KAAK,oBAAoB,EAAe,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"task-executor.d.ts","sourceRoot":"","sources":["../../../../src/features/magic-context/dreamer/task-executor.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAkED,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"}
|
|
@@ -196,7 +196,7 @@ import {
|
|
|
196
196
|
snapRangeToCompartments,
|
|
197
197
|
getActiveCompartmentRun,
|
|
198
198
|
startCompartmentAgent
|
|
199
|
-
} from "./index-
|
|
199
|
+
} from "./index-sy5wbbw6.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-y208s7zx.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-2q0t43fy.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-aawwdt26.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-xsdaz3mq.js";
|
|
573
573
|
import {
|
|
574
574
|
getLastIndexedOrdinal
|
|
575
|
-
} from "./index-
|
|
575
|
+
} from "./index-zzvd4a9z.js";
|
|
576
576
|
import {
|
|
577
577
|
SESSION_NOTE_CONDITION_ERROR,
|
|
578
578
|
getNoteByIdInScope,
|
|
@@ -704,13 +704,13 @@ import {
|
|
|
704
704
|
resolveMemoriesByIdsForSearch2,
|
|
705
705
|
unifiedSearch2,
|
|
706
706
|
formatSearchResults2
|
|
707
|
-
} from "./index-
|
|
707
|
+
} from "./index-m0tbtzqh.js";
|
|
708
708
|
import {
|
|
709
709
|
scheduleReconciliation,
|
|
710
710
|
scheduleIncrementalIndex,
|
|
711
711
|
getMessageIndexQueueHeapStats,
|
|
712
712
|
clearSessionTracking
|
|
713
|
-
} from "./index-
|
|
713
|
+
} from "./index-m6rkq3t4.js";
|
|
714
714
|
import {
|
|
715
715
|
flushIgnoredMessages2,
|
|
716
716
|
clearIgnoredMessages2,
|
|
@@ -720,7 +720,7 @@ import {
|
|
|
720
720
|
import {
|
|
721
721
|
setRecompStarting2,
|
|
722
722
|
setRecompTerminal2
|
|
723
|
-
} from "./index-
|
|
723
|
+
} from "./index-f619wjj9.js";
|
|
724
724
|
import {
|
|
725
725
|
makeToolCompositeKey,
|
|
726
726
|
searchMessageHistoryOffThread,
|
|
@@ -805,7 +805,7 @@ import {
|
|
|
805
805
|
abortSessionFailClosed2,
|
|
806
806
|
evaluateEmergencyFailClosed2,
|
|
807
807
|
runPostTransformPhase2
|
|
808
|
-
} from "./index-
|
|
808
|
+
} from "./index-8ykmp4jv.js";
|
|
809
809
|
import {
|
|
810
810
|
ANNOUNCEMENT_VERSION2,
|
|
811
811
|
ANNOUNCEMENT_FEATURES2,
|
|
@@ -820,13 +820,13 @@ import {
|
|
|
820
820
|
renderMessageByOrdinal2,
|
|
821
821
|
renderVerboseRangeForTool2,
|
|
822
822
|
renderItemByTag2
|
|
823
|
-
} from "./index-
|
|
823
|
+
} from "./index-twmeey4h.js";
|
|
824
824
|
import {
|
|
825
825
|
readV2ArchiveOffThread2
|
|
826
|
-
} from "./index-
|
|
826
|
+
} from "./index-v8x07j6c.js";
|
|
827
827
|
import {
|
|
828
828
|
renderSearchArchiveOffThread2
|
|
829
|
-
} from "./index-
|
|
829
|
+
} from "./index-hgdkwp21.js";
|
|
830
830
|
import {
|
|
831
831
|
COMPACTION_ENABLED_PATH,
|
|
832
832
|
isDreamerRunnable,
|
|
@@ -4011,7 +4011,7 @@ function beginCurateCategoryRun(db, projectIdentity, memories) {
|
|
|
4011
4011
|
}));
|
|
4012
4012
|
return scope;
|
|
4013
4013
|
}
|
|
4014
|
-
function
|
|
4014
|
+
function curateTaskStateAfterCategoryTurn(db, projectIdentity, category) {
|
|
4015
4015
|
const state = readState(db, projectIdentity);
|
|
4016
4016
|
return JSON.stringify({
|
|
4017
4017
|
...state,
|
|
@@ -4055,6 +4055,22 @@ function isDirectiveShapedProjectRule(category, content) {
|
|
|
4055
4055
|
// src/features/magic-context/dreamer/curate-memory-safety.ts
|
|
4056
4056
|
var PROJECT_SCOPED_CATEGORIES = new Set(V2_MEMORY_CATEGORIES);
|
|
4057
4057
|
var USER_PROFILE_REFERENCE = /\buser(?:[\s_-]+)(?:profile|preferences?)\b|\bU\d+\b/i;
|
|
4058
|
+
var CURATE_SAFETY_REFUSAL_REASONS = [
|
|
4059
|
+
"missing-active-same-category-successor",
|
|
4060
|
+
"user-profile-is-not-project-memory",
|
|
4061
|
+
"directive-shaped-project-rule",
|
|
4062
|
+
"content-loss"
|
|
4063
|
+
];
|
|
4064
|
+
var refusalReasons = new Set(CURATE_SAFETY_REFUSAL_REASONS);
|
|
4065
|
+
function parseCurateSafetyRefusal(action, output) {
|
|
4066
|
+
if (action !== "archive" && action !== "update")
|
|
4067
|
+
return null;
|
|
4068
|
+
const refusal = /^Skipped (archive|update) for memory \[ID: -?\d+(?:, -?\d+)*\]: curate safety refusal \(([a-z,-]+)\); refused=[1-9]\d*\.$/.exec(output);
|
|
4069
|
+
if (refusal?.[1] !== action || !refusal[2])
|
|
4070
|
+
return null;
|
|
4071
|
+
const reasons = [...new Set(refusal[2].split(","))];
|
|
4072
|
+
return reasons.every((reason) => refusalReasons.has(reason)) ? reasons : null;
|
|
4073
|
+
}
|
|
4058
4074
|
var refusalCountsBySession = new Map;
|
|
4059
4075
|
function isSurvivingConsolidationTarget(memory, successor, projectIdentity) {
|
|
4060
4076
|
return successor !== null && successor.id !== memory.id && successor.status === "active" && successor.supersededByMemoryId === null && (successor.expiresAt === null || successor.expiresAt > Date.now()) && projectIdentity(successor) === projectIdentity(memory) && successor.category === memory.category;
|
|
@@ -10053,8 +10069,11 @@ function validateCurateAssistantText(text) {
|
|
|
10053
10069
|
}
|
|
10054
10070
|
return text;
|
|
10055
10071
|
}
|
|
10072
|
+
function emptyCurateMemoryOperations() {
|
|
10073
|
+
return { totalCalls: 0, completedActions: [], refusals: [] };
|
|
10074
|
+
}
|
|
10056
10075
|
function inspectCurateMemoryOperations(messages) {
|
|
10057
|
-
const summary =
|
|
10076
|
+
const summary = emptyCurateMemoryOperations();
|
|
10058
10077
|
if (!Array.isArray(messages))
|
|
10059
10078
|
return summary;
|
|
10060
10079
|
for (const message of messages) {
|
|
@@ -10069,28 +10088,69 @@ function inspectCurateMemoryOperations(messages) {
|
|
|
10069
10088
|
const toolName = part.tool ?? part.name;
|
|
10070
10089
|
if (toolName !== "ctx_memory")
|
|
10071
10090
|
continue;
|
|
10091
|
+
const state = isRecord(part.state) ? part.state : null;
|
|
10092
|
+
const input = isRecord(state?.input) ? state.input : null;
|
|
10093
|
+
const action = input?.action;
|
|
10094
|
+
const output = state?.status === "completed" && typeof state.output === "string" ? state.output : null;
|
|
10095
|
+
if (output && (action === "get" || action === "list") && /^(?:Found \d+ (?:active )?memor(?:y|ies):|No active memories found\.$|id -?\d+: not found or not visible from this project)/.test(output))
|
|
10096
|
+
continue;
|
|
10072
10097
|
summary.totalCalls += 1;
|
|
10073
|
-
if (!
|
|
10098
|
+
if (!output)
|
|
10074
10099
|
continue;
|
|
10075
|
-
|
|
10076
|
-
const action = input?.action;
|
|
10077
|
-
const output = typeof part.state.output === "string" ? part.state.output : "";
|
|
10078
|
-
if (output === "completed" && (action === "merge" || action === "archive" || action === "update") || action === "merge" && output.startsWith("Merged memories") || action === "archive" && output.startsWith("Archived memor") || action === "update" && output.startsWith("Updated memory"))
|
|
10100
|
+
if (action === "merge" && output.startsWith("Merged memories") || action === "archive" && output.startsWith("Archived memor") || action === "update" && output.startsWith("Updated memory")) {
|
|
10079
10101
|
summary.completedActions.push(action);
|
|
10102
|
+
} else {
|
|
10103
|
+
const reasons = parseCurateSafetyRefusal(action, output);
|
|
10104
|
+
if (reasons)
|
|
10105
|
+
summary.refusals.push(reasons);
|
|
10106
|
+
}
|
|
10080
10107
|
}
|
|
10081
10108
|
}
|
|
10082
10109
|
return summary;
|
|
10083
10110
|
}
|
|
10111
|
+
function unrecognisedCurateOperations(operations) {
|
|
10112
|
+
return operations.totalCalls - operations.completedActions.length - operations.refusals.length;
|
|
10113
|
+
}
|
|
10114
|
+
function validateCurateOutput(messages, text, transport) {
|
|
10115
|
+
const operations = inspectCurateMemoryOperations(messages);
|
|
10116
|
+
if (text)
|
|
10117
|
+
validateCurateAssistantText(text);
|
|
10118
|
+
if (operations.completedActions.length || operations.refusals.length && !unrecognisedCurateOperations(operations))
|
|
10119
|
+
return operations;
|
|
10120
|
+
if (!text && transport === "child")
|
|
10121
|
+
throw new Error("Dreamer returned no assistant output.");
|
|
10122
|
+
if (operations.totalCalls > 0)
|
|
10123
|
+
throw new Error("Curate returned no completed ctx_memory tool result.");
|
|
10124
|
+
if (!text)
|
|
10125
|
+
throw new Error("Dreamer returned no assistant output.");
|
|
10126
|
+
return operations;
|
|
10127
|
+
}
|
|
10084
10128
|
function formatExpiredArchiveProgress(count) {
|
|
10085
10129
|
return `curate: archived ${count} expired ${count === 1 ? "memory" : "memories"}`;
|
|
10086
10130
|
}
|
|
10087
|
-
function formatCurateMemoryOperations(
|
|
10131
|
+
function formatCurateMemoryOperations(operations) {
|
|
10132
|
+
const { completedActions: actions, refusals } = operations;
|
|
10133
|
+
if (!actions.length && !refusals.length)
|
|
10134
|
+
return null;
|
|
10088
10135
|
const actionCounts = new Map;
|
|
10089
10136
|
for (const action of actions)
|
|
10090
10137
|
actionCounts.set(action, (actionCounts.get(action) ?? 0) + 1);
|
|
10091
10138
|
const actionDetail = [...actionCounts].map(([action, count]) => count === 1 ? action : `${action} ×${count}`).join(", ");
|
|
10092
|
-
const
|
|
10093
|
-
|
|
10139
|
+
const applied = actions.length ? `${actions.length} memory ${actions.length === 1 ? "operation" : "operations"} applied (${actionDetail})` : "no changes";
|
|
10140
|
+
const detail = [`curate: ${applied}`];
|
|
10141
|
+
if (refusals.length) {
|
|
10142
|
+
const reasonCounts = new Map;
|
|
10143
|
+
for (const reasons of refusals) {
|
|
10144
|
+
for (const reason of reasons)
|
|
10145
|
+
reasonCounts.set(reason, (reasonCounts.get(reason) ?? 0) + 1);
|
|
10146
|
+
}
|
|
10147
|
+
const countedReasons = [...reasonCounts].sort(([a], [b]) => a.localeCompare(b)).map(([reason, count]) => `${reason} ×${count}`).join(", ");
|
|
10148
|
+
detail.push(`${refusals.length} ${refusals.length === 1 ? "operation" : "operations"} refused (${countedReasons})`);
|
|
10149
|
+
}
|
|
10150
|
+
const unrecognised = unrecognisedCurateOperations(operations);
|
|
10151
|
+
if (unrecognised)
|
|
10152
|
+
detail.push(`${unrecognised} with an unrecognised result`);
|
|
10153
|
+
return detail.join("; ");
|
|
10094
10154
|
}
|
|
10095
10155
|
function requireDreamClient(client) {
|
|
10096
10156
|
if (!client)
|
|
@@ -10298,6 +10358,7 @@ function createDreamTaskExecutor(deps) {
|
|
|
10298
10358
|
};
|
|
10299
10359
|
return writtenIds.length || deletedIds.length || archivedIds.length || mergedIds.length ? changes : null;
|
|
10300
10360
|
}
|
|
10361
|
+
let curateCategory;
|
|
10301
10362
|
try {
|
|
10302
10363
|
const skip = (reason) => {
|
|
10303
10364
|
log2(`[dreamer] ${config.task}: skipped (${reason})`);
|
|
@@ -10609,7 +10670,10 @@ function createDreamTaskExecutor(deps) {
|
|
|
10609
10670
|
computeMemoryDelta,
|
|
10610
10671
|
reportProgress,
|
|
10611
10672
|
leaseAcquisition,
|
|
10612
|
-
moduleRoute
|
|
10673
|
+
moduleRoute,
|
|
10674
|
+
onCurateCategory: (category) => {
|
|
10675
|
+
curateCategory = category;
|
|
10676
|
+
}
|
|
10613
10677
|
});
|
|
10614
10678
|
} catch (error) {
|
|
10615
10679
|
if (error instanceof DreamTokenBudgetExceeded) {
|
|
@@ -10627,7 +10691,11 @@ function createDreamTaskExecutor(deps) {
|
|
|
10627
10691
|
transient,
|
|
10628
10692
|
error: brief,
|
|
10629
10693
|
failureDetail: formatDreamRunFailure(failure),
|
|
10630
|
-
...retrospectiveOverflow ? { schedulePatch: retrospectiveOverflow.schedulePatch } : {
|
|
10694
|
+
...retrospectiveOverflow ? { schedulePatch: retrospectiveOverflow.schedulePatch } : curateCategory && !transient ? {
|
|
10695
|
+
schedulePatch: {
|
|
10696
|
+
taskStateJson: curateTaskStateAfterCategoryTurn(db, projectIdentity, curateCategory)
|
|
10697
|
+
}
|
|
10698
|
+
} : {}
|
|
10631
10699
|
};
|
|
10632
10700
|
} finally {
|
|
10633
10701
|
deps.onProgress?.(null, config.task);
|
|
@@ -11134,6 +11202,8 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11134
11202
|
const scope = beginCurateCategoryRun(db, projectIdentity, loadActiveMemoryPromptMemories(db, projectIdentity));
|
|
11135
11203
|
curateMemories = scope?.memories ?? [];
|
|
11136
11204
|
curateCategory = scope?.category;
|
|
11205
|
+
if (curateCategory)
|
|
11206
|
+
helpers.onCurateCategory(curateCategory);
|
|
11137
11207
|
log2(`[dreamer] curate pool: category=${curateCategory ?? "none"} in_scope=${curateMemories.length} expired_archived=${expiredArchived}`);
|
|
11138
11208
|
if (curateMemories.length === 0) {
|
|
11139
11209
|
const progress = expiredArchived > 0 ? formatExpiredArchiveProgress(expiredArchived) : "curate: no populated project-memory category";
|
|
@@ -11169,7 +11239,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11169
11239
|
}
|
|
11170
11240
|
const curateChunks = curateMemories ? chunkCurateMemories(curateMemories, Math.max(4000, Math.floor(resolveRetrospectiveUsableInputTokens(config, deps) * 2))) : [];
|
|
11171
11241
|
const batches = task === "curate" ? curateChunks : [{ memories: [], crossChunkCandidates: [] }];
|
|
11172
|
-
const
|
|
11242
|
+
const curateOperations = emptyCurateMemoryOperations();
|
|
11173
11243
|
let curateRefused = 0;
|
|
11174
11244
|
let run = {
|
|
11175
11245
|
output: [],
|
|
@@ -11218,14 +11288,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11218
11288
|
parseDocsProposalOutput(text);
|
|
11219
11289
|
if (task !== "curate")
|
|
11220
11290
|
return text;
|
|
11221
|
-
|
|
11222
|
-
if (text)
|
|
11223
|
-
validateCurateAssistantText(text);
|
|
11224
|
-
if (memoryOperations.totalCalls > 0 && memoryOperations.completedActions.length === 0)
|
|
11225
|
-
throw new Error("Curate returned no completed ctx_memory tool result.");
|
|
11226
|
-
if (!text && memoryOperations.completedActions.length === 0)
|
|
11227
|
-
throw new Error("Dreamer returned no assistant output.");
|
|
11228
|
-
return { text: text || null, memoryOperations };
|
|
11291
|
+
return validateCurateOutput(completion.messages, text, "hidden");
|
|
11229
11292
|
}
|
|
11230
11293
|
});
|
|
11231
11294
|
childSessionId = hidden.childSessionId;
|
|
@@ -11284,24 +11347,15 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11284
11347
|
parseDocsProposalOutput(text);
|
|
11285
11348
|
return text;
|
|
11286
11349
|
}
|
|
11287
|
-
|
|
11288
|
-
if (text)
|
|
11289
|
-
validateCurateAssistantText(text);
|
|
11290
|
-
if (memoryOperations.completedActions.length > 0) {
|
|
11291
|
-
return { text, memoryOperations };
|
|
11292
|
-
}
|
|
11293
|
-
if (!text)
|
|
11294
|
-
throw new Error("Dreamer returned no assistant output.");
|
|
11295
|
-
if (memoryOperations.totalCalls > 0) {
|
|
11296
|
-
throw new Error("Curate returned no completed ctx_memory tool result.");
|
|
11297
|
-
}
|
|
11298
|
-
return { text, memoryOperations };
|
|
11350
|
+
return validateCurateOutput(messages, text, "child");
|
|
11299
11351
|
}
|
|
11300
11352
|
});
|
|
11301
11353
|
promptSettled = true;
|
|
11302
11354
|
}
|
|
11303
|
-
if (
|
|
11304
|
-
|
|
11355
|
+
if (typeof run.validated !== "string") {
|
|
11356
|
+
curateOperations.totalCalls += run.validated.totalCalls;
|
|
11357
|
+
curateOperations.completedActions.push(...run.validated.completedActions);
|
|
11358
|
+
curateOperations.refusals.push(...run.validated.refusals);
|
|
11305
11359
|
curateRefused += takeCurateSafetyRefusalCount(childSessionId ?? "");
|
|
11306
11360
|
}
|
|
11307
11361
|
if (childSessionId && !deps.hiddenCompletionExecutor) {
|
|
@@ -11317,17 +11371,15 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11317
11371
|
childSessionId = null;
|
|
11318
11372
|
}
|
|
11319
11373
|
}
|
|
11320
|
-
if (task === "curate")
|
|
11321
|
-
run.validated = {
|
|
11322
|
-
text: null,
|
|
11323
|
-
memoryOperations: { totalCalls: completedActions.length, completedActions }
|
|
11324
|
-
};
|
|
11325
11374
|
if (leaseLost)
|
|
11326
11375
|
throw new Error("Dream lease lost during task");
|
|
11327
11376
|
if (curateRefused > 0) {
|
|
11328
11377
|
helpers.reportProgress(curateRefused, curateRefused);
|
|
11329
11378
|
log2(`[dreamer] curate safety summary: refused=${curateRefused}`);
|
|
11330
11379
|
}
|
|
11380
|
+
const unrecognised = unrecognisedCurateOperations(curateOperations);
|
|
11381
|
+
if (unrecognised > 0)
|
|
11382
|
+
log2(`[dreamer] curate result summary: unrecognised=${unrecognised}`);
|
|
11331
11383
|
recordInvocation("completed", run.output);
|
|
11332
11384
|
if (task === "maintain-docs" && docsHashes && changes) {
|
|
11333
11385
|
try {
|
|
@@ -11347,13 +11399,12 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11347
11399
|
return { status: "failed", error: reason };
|
|
11348
11400
|
}
|
|
11349
11401
|
}
|
|
11350
|
-
const curateOutput = task === "curate" ? run.validated : undefined;
|
|
11351
11402
|
const curateScopeProgress = task === "curate" && curateCategory && curateMemories ? `curate: ${curateCategory} (${curateMemories.length})` : null;
|
|
11352
11403
|
const progress = [
|
|
11353
11404
|
curateScopeProgress,
|
|
11354
11405
|
expiredArchived > 0 ? formatExpiredArchiveProgress(expiredArchived) : null,
|
|
11355
|
-
|
|
11356
|
-
curateRefused > 0 ? `curate: refused ${curateRefused} unsafe mutation(s)` : null
|
|
11406
|
+
formatCurateMemoryOperations(curateOperations),
|
|
11407
|
+
curateRefused > 0 && !curateOperations.refusals.length ? `curate: refused ${curateRefused} unsafe mutation(s)` : null
|
|
11357
11408
|
].filter((value) => Boolean(value)).join("; ");
|
|
11358
11409
|
const curateCount = task === "curate" && curateCategory ? loadActiveMemoryPromptMemories(db, projectIdentity).filter((memory) => curateCategoryForMemoryCategory(memory.category) === curateCategory).length : undefined;
|
|
11359
11410
|
const curateBacklog = curateCount !== undefined && curateCategory ? {
|
|
@@ -11372,7 +11423,7 @@ async function runAgenticTask(config, ctx, helpers) {
|
|
|
11372
11423
|
...curateBacklog ? { backlog: curateBacklog } : {},
|
|
11373
11424
|
...curateCategory ? {
|
|
11374
11425
|
schedulePatch: {
|
|
11375
|
-
taskStateJson:
|
|
11426
|
+
taskStateJson: curateTaskStateAfterCategoryTurn(db, projectIdentity, curateCategory)
|
|
11376
11427
|
}
|
|
11377
11428
|
} : {}
|
|
11378
11429
|
};
|
|
@@ -16568,7 +16619,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16568
16619
|
const db = readDatabase();
|
|
16569
16620
|
if (!db)
|
|
16570
16621
|
return { ok: false, error: "db unavailable" };
|
|
16571
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16622
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-jf60eef6.js"));
|
|
16572
16623
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-ykvt5k2s.js"));
|
|
16573
16624
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16574
16625
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -16653,7 +16704,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16653
16704
|
const db = readDatabase();
|
|
16654
16705
|
if (!db)
|
|
16655
16706
|
return { ok: false, error: "db unavailable" };
|
|
16656
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16707
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-1k48hzxg.js"));
|
|
16657
16708
|
const model = await args.readSelectedSessionModel?.(sessionId) ?? liveSessionState.liveModelBySession.get(sessionId);
|
|
16658
16709
|
const window = resolveOpenCodeWrapupWindow(db, sessionId, model);
|
|
16659
16710
|
if (!window)
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
adoptNullOwnerToolTag2,
|
|
172
172
|
getCandidateToolOwners2,
|
|
173
173
|
pickNearestPriorOwner2
|
|
174
|
-
} from "./index-
|
|
174
|
+
} from "./index-y208s7zx.js";
|
|
175
175
|
import {
|
|
176
176
|
textMentionsRecentCommit,
|
|
177
177
|
hasMeaningfulUserText2,
|
|
@@ -225,11 +225,11 @@ import {
|
|
|
225
225
|
saveSourceContent,
|
|
226
226
|
replaceSourceContent,
|
|
227
227
|
getSourceContents
|
|
228
|
-
} from "./index-
|
|
228
|
+
} from "./index-xsdaz3mq.js";
|
|
229
229
|
import {
|
|
230
230
|
cleanSearchText,
|
|
231
231
|
matchedSearchSnippet
|
|
232
|
-
} from "./index-
|
|
232
|
+
} from "./index-zzvd4a9z.js";
|
|
233
233
|
import {
|
|
234
234
|
getProjectEmbeddingSnapshot2,
|
|
235
235
|
embedTextForProject2,
|
|
@@ -245,7 +245,7 @@ import {
|
|
|
245
245
|
getMessageIndexEpoch,
|
|
246
246
|
isMessageIndexSearchable,
|
|
247
247
|
createAutoSearchDiagnostics
|
|
248
|
-
} from "./index-
|
|
248
|
+
} from "./index-m6rkq3t4.js";
|
|
249
249
|
import {
|
|
250
250
|
openCodeDbExists,
|
|
251
251
|
withReadOnlySessionDb,
|
|
@@ -263,7 +263,7 @@ import {
|
|
|
263
263
|
extractToolCallObservation,
|
|
264
264
|
ToolMutationBatch,
|
|
265
265
|
createToolDropTarget
|
|
266
|
-
} from "./index-
|
|
266
|
+
} from "./index-2q0t43fy.js";
|
|
267
267
|
import {
|
|
268
268
|
compareOpenCodeMessagesByCanonicalOrder,
|
|
269
269
|
startCompactionMarkerCandidatePreparation,
|
|
@@ -285,7 +285,7 @@ import {
|
|
|
285
285
|
peekNoteNudgeText,
|
|
286
286
|
markNoteNudgeDelivered,
|
|
287
287
|
getActiveCompartmentRun
|
|
288
|
-
} from "./index-
|
|
288
|
+
} from "./index-sy5wbbw6.js";
|
|
289
289
|
import {
|
|
290
290
|
getErrorMessage
|
|
291
291
|
} from "./index-y8v6yerm.js";
|
|
@@ -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-s3qac56g.js"));
|
|
1025
1025
|
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-pz5981mf.js"));
|
|
1026
1026
|
if (signal.aborted)
|
|
1027
1027
|
return;
|