@cortexkit/opencode-magic-context 0.49.12 → 0.49.13
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 +3 -3
- package/dist/chunk-embedding-write-worker.js +89 -0
- package/dist/config/schema/agent-overrides.d.ts +12 -12
- package/dist/config/schema/magic-context.d.ts +88 -88
- package/dist/{conflict-warning-hook-f4x5wed7.js → conflict-warning-hook-mgq17yr3.js} +3 -3
- package/dist/{context-dam8p201.js → context-azqk0vfd.js} +31 -65
- package/dist/{derive-budgets-5306b1jt.js → derive-budgets-zn7yzd2d.js} +1 -1
- package/dist/{embedding-backfill-qbfcbp87.js → embedding-backfill-5e1t5wha.js} +6 -5
- package/dist/embedding-worker.js +1 -1
- package/dist/features/magic-context/chunk-embedding-write-worker.d.ts +2 -0
- package/dist/features/magic-context/chunk-embedding-write-worker.d.ts.map +1 -0
- package/dist/features/magic-context/chunk-embedding-writer.d.ts +48 -0
- package/dist/features/magic-context/chunk-embedding-writer.d.ts.map +1 -0
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts +3 -2
- package/dist/features/magic-context/dreamer/hidden-single-shot.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts +8 -1
- package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +2 -0
- package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +5 -0
- package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts +6 -1
- package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify.d.ts +25 -11
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/mural/compress-cues.d.ts +3 -0
- package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +5 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-embed-session.d.ts +10 -0
- package/dist/hooks/magic-context/auto-embed-session.d.ts.map +1 -0
- package/dist/hooks/magic-context/embed-session-state.d.ts +8 -1
- package/dist/hooks/magic-context/embed-session-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +3 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/{index-yx5kgp2x.js → index-2jr1smmh.js} +92 -71
- package/dist/{index-fx90bvjd.js → index-3kdm78zp.js} +2 -2
- package/dist/{index-gf0psee3.js → index-3kx0kg0f.js} +60 -3
- package/dist/{index-6sytd5w3.js → index-aw1bh90w.js} +6 -6
- package/dist/{index-6sz25c3s.js → index-bxdg2nbt.js} +2 -2
- package/dist/{index-7h8a1xpc.js → index-e4dsjj1p.js} +1 -1
- package/dist/{index-05n6ykca.js → index-hnm8raee.js} +2 -2
- package/dist/{index-x2xjyq8f.js → index-qkd9zz0p.js} +8 -8
- package/dist/index-saews2s3.js +229 -0
- package/dist/{index-qtbdx42g.js → index-sj89f3b0.js} +12 -12
- package/dist/{index-wqs4q74r.js → index-v13skev1.js} +7 -7
- package/dist/{index-1wwh38fk.js → index-wj6ht7nm.js} +438 -132
- package/dist/{index-95s8xaj1.js → index-wz6mzzb1.js} +3 -3
- package/dist/{index-7zd5asz9.js → index-y1qysm3q.js} +196 -243
- package/dist/index.js +52 -90
- package/dist/{message-index-bounded-nq6rp8xa.js → message-index-bounded-vm64mqpq.js} +2 -2
- package/dist/{message-index-df7swgy1.js → message-index-seaqpb7c.js} +5 -5
- package/dist/migration-worker.js +2 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/{project-embedding-registry-q0ysjyzc.js → project-embedding-registry-x45bv3qr.js} +5 -4
- package/dist/raw-ordinal-warmup-worker.js +2 -2
- package/dist/{recomp-orchestrator-a0mvby4e.js → recomp-orchestrator-dmbeadwt.js} +21 -20
- package/dist/{search-fm002702.js → search-5yd5ytzs.js} +14 -13
- package/dist/{send-session-notification-y2wg3fkh.js → send-session-notification-24r4esbh.js} +2 -2
- package/dist/shared/model-suggestion-retry.d.ts +2 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-s84rdf32.js → transform-postprocess-phase-72v86syx.js} +21 -20
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +88 -0
- package/dist/v2/{context-x60fa16g.js → context-w055w17c.js} +465 -190
- package/dist/v2/{derive-budgets-z25jw3py.js → derive-budgets-2zh4gm2c.js} +2 -2
- package/dist/v2/{embedding-backfill-mbjyza2a.js → embedding-backfill-jmaf8zrr.js} +6 -5
- package/dist/v2/embedding-worker.js +1 -1
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/transform-features.d.ts +2 -2
- package/dist/v2/hooks/transform-features.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-pgv1ndpb.js → message-index-bounded-wepg5723.js} +2 -2
- package/dist/v2/{message-index-5nayhm1r.js → message-index-gcmd0ng0.js} +5 -5
- package/dist/v2/migration-worker.js +2 -2
- package/dist/v2/{project-embedding-registry-jbmjc0p4.js → project-embedding-registry-0msp56p8.js} +5 -4
- package/dist/v2/raw-ordinal-warmup-worker.js +2 -2
- package/dist/v2/{recomp-orchestrator-8w3449eb.js → recomp-orchestrator-ca7qt75a.js} +21 -20
- package/dist/v2/retrospective-raw-provider.d.ts.map +1 -1
- package/dist/v2/{search-mhmxgq0e.js → search-c86dcv14.js} +14 -13
- package/dist/v2/{send-session-notification-jevgj9fe.js → send-session-notification-8ghn9tnv.js} +2 -2
- package/dist/v2/{server-f7jfmrrz.js → server-34kwfsr4.js} +1 -1
- package/dist/v2/server-4gn3z5an.js +229 -0
- package/dist/v2/{server-4c10404h.js → server-6cdy4rc0.js} +2 -2
- package/dist/v2/{server-5gvkzzrf.js → server-b81w6sw3.js} +92 -69
- package/dist/v2/{server-9ewkzqgd.js → server-ef89gdsx.js} +2 -2
- package/dist/v2/{server-sz8jj92q.js → server-hek6z3w6.js} +194 -241
- package/dist/v2/{server-50mkkhy1.js → server-n8ch9683.js} +8 -8
- package/dist/v2/{server-vknbt0gq.js → server-qhfvvfxj.js} +60 -3
- package/dist/v2/{server-nmrm2rjy.js → server-t4prcjc1.js} +7 -7
- package/dist/v2/{server-25tg45b4.js → server-xh7jar6k.js} +6 -6
- package/dist/v2/{server-37ngj8qw.js → server-zc3e54vy.js} +1 -1
- package/dist/v2/server.js +9 -8
- package/dist/v2/store-reader.d.ts +1 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-r82y780v.js → wrapup-orchestrator-e1a2w6jh.js} +14 -13
- package/dist/{wrapup-orchestrator-vmt6z3q5.js → wrapup-orchestrator-2051r6qm.js} +22 -21
- package/package.json +6 -5
- package/src/shared/model-suggestion-retry.test.ts +34 -0
- package/src/shared/model-suggestion-retry.ts +23 -3
- package/src/shared/prompt-async-transport.test.ts +1 -1
- package/src/shared/prompt-async-transport.ts +16 -3
- package/dist/{index-e6xnpach.js → index-b7p25tm0.js} +0 -0
- package/dist/{index-2pgxcncf.js → index-dgs16axy.js} +0 -0
- package/dist/{index-9vqb5p1s.js → index-e20m7284.js} +0 -0
- package/dist/{index-8ketfacn.js → index-v10f1rjv.js} +3 -3
- package/dist/{index-tdn0zkw4.js → index-wk0n1cgt.js} +0 -0
- package/dist/v2/{index-e6xnpach.js → index-b7p25tm0.js} +0 -0
- package/dist/v2/{server-2x42esxd.js → server-g10mdym6.js} +0 -0
- package/dist/v2/{server-fa75w6gp.js → server-k2bzedxk.js} +0 -0
- package/dist/v2/{server-kn9n2qgd.js → server-tbe1femw.js} +3 -3
- /package/dist/v2/{server-83ygfha2.js → server-vbe4se57.js} +0 -0
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
cortexKitProjectConfigBasePath,
|
|
18
18
|
resolveLegacyConfigSourcesForHarness,
|
|
19
19
|
loadPluginConfigDetailed
|
|
20
|
-
} from "./server-
|
|
20
|
+
} from "./server-zc3e54vy.js";
|
|
21
21
|
import {
|
|
22
22
|
catalogOutputReserve,
|
|
23
23
|
getSdkContextLimit,
|
|
24
24
|
modelSupportsVision,
|
|
25
25
|
getSdkOutputLimit
|
|
26
|
-
} from "./server-
|
|
26
|
+
} from "./server-tbe1femw.js";
|
|
27
27
|
import {
|
|
28
28
|
withContentLanguageDirective,
|
|
29
29
|
buildPrimaryLanguageDirective,
|
|
@@ -31,6 +31,15 @@ import {
|
|
|
31
31
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
32
32
|
LIVE_RELOAD_CONFIG_PATHS
|
|
33
33
|
} from "./server-th4y11y7.js";
|
|
34
|
+
import {
|
|
35
|
+
invalidateAutoEmbedSession,
|
|
36
|
+
drainBackgroundBatches,
|
|
37
|
+
contentSha2562,
|
|
38
|
+
enqueueShadowEmbeddingItems2,
|
|
39
|
+
getProjectChunkEmbeddingModelId2,
|
|
40
|
+
getProjectEmbeddingMaxInputTokens2,
|
|
41
|
+
embedItemsForProject2
|
|
42
|
+
} from "./server-hek6z3w6.js";
|
|
34
43
|
import {
|
|
35
44
|
hasMeaningfulUserText2,
|
|
36
45
|
estimateTokens,
|
|
@@ -53,7 +62,7 @@ import {
|
|
|
53
62
|
replaceCompartmentChunkEmbeddings,
|
|
54
63
|
deleteChunkEmbedBackoffForSession,
|
|
55
64
|
chunkWindowSourceKey
|
|
56
|
-
} from "./server-
|
|
65
|
+
} from "./server-qhfvvfxj.js";
|
|
57
66
|
import {
|
|
58
67
|
isPidAlive
|
|
59
68
|
} from "./server-da07v4xp.js";
|
|
@@ -71,7 +80,7 @@ import {
|
|
|
71
80
|
toMessageIndexSource2,
|
|
72
81
|
clearIndexedMessagesInTransaction2,
|
|
73
82
|
indexSourcesAfterOrdinal2
|
|
74
|
-
} from "./server-
|
|
83
|
+
} from "./server-t4prcjc1.js";
|
|
75
84
|
import {
|
|
76
85
|
detectOverflow,
|
|
77
86
|
SESSION_META_SELECT_COLUMNS,
|
|
@@ -174,7 +183,7 @@ import {
|
|
|
174
183
|
LATEST_SUPPORTED_VERSION,
|
|
175
184
|
getPersistedSchemaVersion,
|
|
176
185
|
openDatabase
|
|
177
|
-
} from "./server-
|
|
186
|
+
} from "./server-n8ch9683.js";
|
|
178
187
|
import {
|
|
179
188
|
providerMass,
|
|
180
189
|
calibrationForModelKey,
|
|
@@ -228,19 +237,11 @@ import {
|
|
|
228
237
|
resolveStoredPathWorkspaceIdentity,
|
|
229
238
|
sourceNameForMemory,
|
|
230
239
|
computeWorkspaceEpochFingerprint
|
|
231
|
-
} from "./server-
|
|
240
|
+
} from "./server-k2bzedxk.js";
|
|
232
241
|
import {
|
|
233
242
|
shouldSkipHomeProjectMemory,
|
|
234
243
|
resolveProjectIdentity
|
|
235
244
|
} from "./server-gvkm8xaj.js";
|
|
236
|
-
import {
|
|
237
|
-
drainBackgroundBatches,
|
|
238
|
-
contentSha2562,
|
|
239
|
-
enqueueShadowEmbeddingItems2,
|
|
240
|
-
getProjectChunkEmbeddingModelId2,
|
|
241
|
-
getProjectEmbeddingMaxInputTokens2,
|
|
242
|
-
embedItemsForProject2
|
|
243
|
-
} from "./server-sz8jj92q.js";
|
|
244
245
|
import {
|
|
245
246
|
getSessionNotes,
|
|
246
247
|
getReadySmartNotes,
|
|
@@ -249,7 +250,7 @@ import {
|
|
|
249
250
|
userFacingFailureCode,
|
|
250
251
|
promoteSessionFactsDurable,
|
|
251
252
|
embedPromotedFacts
|
|
252
|
-
} from "./server-
|
|
253
|
+
} from "./server-6cdy4rc0.js";
|
|
253
254
|
import {
|
|
254
255
|
isMarkerCandidateBasisCurrent2,
|
|
255
256
|
invalidateMarkerCandidateBasis2,
|
|
@@ -271,10 +272,13 @@ import {
|
|
|
271
272
|
deriveTriggerBudget2,
|
|
272
273
|
resolveHistorianProducerLimits2,
|
|
273
274
|
producerSourceLocalBudget2
|
|
274
|
-
} from "./server-
|
|
275
|
+
} from "./server-34kwfsr4.js";
|
|
275
276
|
import {
|
|
276
277
|
sendStatusNotification2
|
|
277
|
-
} from "./server-
|
|
278
|
+
} from "./server-vbe4se57.js";
|
|
279
|
+
import {
|
|
280
|
+
piModelRefToCanonical
|
|
281
|
+
} from "./server-avwt563y.js";
|
|
278
282
|
import {
|
|
279
283
|
sameProjectDirectory
|
|
280
284
|
} from "./server-knvkbfvh.js";
|
|
@@ -282,9 +286,6 @@ import {
|
|
|
282
286
|
getErrorMessage,
|
|
283
287
|
describeError
|
|
284
288
|
} from "./server-y8v6yerm.js";
|
|
285
|
-
import {
|
|
286
|
-
piModelRefToCanonical
|
|
287
|
-
} from "./server-avwt563y.js";
|
|
288
289
|
import {
|
|
289
290
|
closeQuietly
|
|
290
291
|
} from "./server-8ajstryz.js";
|
|
@@ -521,40 +522,6 @@ function withLiveDreamerOutputCap(executor, boot, fresh) {
|
|
|
521
522
|
};
|
|
522
523
|
}
|
|
523
524
|
|
|
524
|
-
// src/hooks/magic-context/embed-session-state.ts
|
|
525
|
-
var embedPauseBySession = new Set;
|
|
526
|
-
var embedRunStateBySession = new Map;
|
|
527
|
-
var autoEmbedAttemptedBySession = new Set;
|
|
528
|
-
var autoEmbedIdentityBySession = new Map;
|
|
529
|
-
function invalidateAutoEmbedSession(sessionId) {
|
|
530
|
-
autoEmbedAttemptedBySession.delete(sessionId);
|
|
531
|
-
autoEmbedIdentityBySession.delete(sessionId);
|
|
532
|
-
}
|
|
533
|
-
function getEmbedDrainUiStatus(sessionId, progress) {
|
|
534
|
-
if (embedPauseBySession.has(sessionId)) {
|
|
535
|
-
return { status: "paused" };
|
|
536
|
-
}
|
|
537
|
-
const activeRun = embedRunStateBySession.get(sessionId);
|
|
538
|
-
if (activeRun && !activeRun.signal.aborted || progress?.kind === "embed" && progress.phase === "recomp") {
|
|
539
|
-
return { status: "running" };
|
|
540
|
-
}
|
|
541
|
-
if (progress?.kind === "embed" && (progress.phase === "failed" || progress.phase === "skipped") && progress.message) {
|
|
542
|
-
if (/provider/i.test(progress.message)) {
|
|
543
|
-
return { status: "stopped", detail: progress.message };
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return { status: "idle" };
|
|
547
|
-
}
|
|
548
|
-
function clearEmbedSessionState(sessionId) {
|
|
549
|
-
embedPauseBySession.delete(sessionId);
|
|
550
|
-
const ctrl = embedRunStateBySession.get(sessionId);
|
|
551
|
-
if (ctrl) {
|
|
552
|
-
ctrl.abort();
|
|
553
|
-
embedRunStateBySession.delete(sessionId);
|
|
554
|
-
}
|
|
555
|
-
invalidateAutoEmbedSession(sessionId);
|
|
556
|
-
}
|
|
557
|
-
|
|
558
525
|
// src/features/magic-context/compartment-lease.ts
|
|
559
526
|
var COMPARTMENT_LEASE_TTL_MS = 5 * 60 * 1000;
|
|
560
527
|
var COMPARTMENT_LEASE_RENEWAL_MS = 60 * 1000;
|
|
@@ -1474,11 +1441,12 @@ class V2StoreReader {
|
|
|
1474
1441
|
const head = Math.floor((maxChars - truncationMarker.length) / 2);
|
|
1475
1442
|
const tail = maxChars - truncationMarker.length - head;
|
|
1476
1443
|
return this.prepare(`WITH users AS (
|
|
1477
|
-
SELECT seq, time_created, data FROM session_message
|
|
1478
|
-
WHERE session_id = ? AND type = 'user' AND time_created ${before ? "<=" : ">"}
|
|
1444
|
+
SELECT session_id, seq, time_created, data FROM session_message
|
|
1445
|
+
WHERE session_id = ? AND type = 'user' AND time_created ${before ? "<=" : ">"}
|
|
1446
|
+
?
|
|
1479
1447
|
ORDER BY time_created ${direction}, seq ${direction} LIMIT ?
|
|
1480
1448
|
), texts AS (
|
|
1481
|
-
SELECT seq, time_created, CASE
|
|
1449
|
+
SELECT session_id, seq, time_created, CASE
|
|
1482
1450
|
WHEN json_extract(data, '$.synthetic') = 1 OR json_extract(data, '$.ignored') = 1 THEN ''
|
|
1483
1451
|
WHEN json_type(data, '$.text') = 'text' THEN json_extract(data, '$.text')
|
|
1484
1452
|
ELSE COALESCE((SELECT group_concat(json_extract(value, '$.text'), char(10))
|
|
@@ -1488,7 +1456,19 @@ class V2StoreReader {
|
|
|
1488
1456
|
AND COALESCE(json_extract(value, '$.ignored'), 0) <> 1), '') END AS text
|
|
1489
1457
|
FROM users WHERE json_valid(data)
|
|
1490
1458
|
) SELECT seq, time_created, CASE WHEN length(text) > ?
|
|
1491
|
-
THEN substr(text, 1, ?) || ? || substr(text, -?) ELSE text END AS text
|
|
1459
|
+
THEN substr(text, 1, ?) || ? || substr(text, -?) ELSE text END AS text,
|
|
1460
|
+
EXISTS (
|
|
1461
|
+
SELECT 1 FROM session_message assistant_reply
|
|
1462
|
+
WHERE assistant_reply.session_id = texts.session_id
|
|
1463
|
+
AND assistant_reply.type = 'assistant'
|
|
1464
|
+
AND assistant_reply.seq < texts.seq
|
|
1465
|
+
AND EXISTS (
|
|
1466
|
+
SELECT 1 FROM session_message prior_user
|
|
1467
|
+
WHERE prior_user.session_id = texts.session_id
|
|
1468
|
+
AND prior_user.type = 'user'
|
|
1469
|
+
AND prior_user.seq < assistant_reply.seq
|
|
1470
|
+
)
|
|
1471
|
+
) AS follows_assistant_reply
|
|
1492
1472
|
FROM texts ORDER BY time_created ${direction}, seq ${direction}`).all(sessionID, boundaryMs, limit, maxChars, head, truncationMarker, tail);
|
|
1493
1473
|
}
|
|
1494
1474
|
storedRowsAfter(sessionID, after) {
|
|
@@ -6524,21 +6504,39 @@ var DREAMER_AGENT = "dreamer";
|
|
|
6524
6504
|
var DREAMER_RETROSPECTIVE_AGENT = "dreamer-retrospective";
|
|
6525
6505
|
var DREAMER_PRIMER_INVESTIGATOR_AGENT = "dreamer-primer-investigator";
|
|
6526
6506
|
var DREAMER_MEMORY_MAPPER_AGENT = "dreamer-memory-mapper";
|
|
6507
|
+
var DREAMER_MEMORY_MAPPER_ALLOWED_TOOLS = [
|
|
6508
|
+
"read",
|
|
6509
|
+
"grep",
|
|
6510
|
+
"glob",
|
|
6511
|
+
"aft_outline",
|
|
6512
|
+
"aft_zoom",
|
|
6513
|
+
"aft_search"
|
|
6514
|
+
];
|
|
6527
6515
|
var DREAMER_CLASSIFIER_AGENT = "dreamer-classifier";
|
|
6528
6516
|
var DREAMER_DOCS_AGENT = "dreamer-docs";
|
|
6529
6517
|
var DREAMER_REVIEWER_AGENT = "dreamer-reviewer";
|
|
6530
6518
|
|
|
6519
|
+
// src/agents/permissions.ts
|
|
6520
|
+
var DREAMER_PRIMER_INVESTIGATOR_ALLOWED_TOOLS = [
|
|
6521
|
+
"read",
|
|
6522
|
+
"grep",
|
|
6523
|
+
"glob",
|
|
6524
|
+
"aft_outline",
|
|
6525
|
+
"aft_zoom",
|
|
6526
|
+
"aft_search",
|
|
6527
|
+
"ctx_search"
|
|
6528
|
+
];
|
|
6529
|
+
|
|
6531
6530
|
// src/v2/hooks/hidden-child.ts
|
|
6532
6531
|
var HIDDEN_HISTORIAN_AGENT = "historian";
|
|
6533
6532
|
var HIDDEN_DREAMER_AGENT = "dreamer-classifier";
|
|
6534
6533
|
var HIDDEN_CURATE_AGENT = DREAMER_AGENT;
|
|
6535
|
-
var READ_TOOLS = ["read", "grep", "glob"];
|
|
6536
6534
|
var AGENT_TOOLS = {
|
|
6537
6535
|
[HIDDEN_HISTORIAN_AGENT]: [],
|
|
6538
6536
|
[HIDDEN_DREAMER_AGENT]: [],
|
|
6539
6537
|
[HIDDEN_CURATE_AGENT]: ["ctx_memory"],
|
|
6540
|
-
[DREAMER_MEMORY_MAPPER_AGENT]:
|
|
6541
|
-
[DREAMER_PRIMER_INVESTIGATOR_AGENT]:
|
|
6538
|
+
[DREAMER_MEMORY_MAPPER_AGENT]: DREAMER_MEMORY_MAPPER_ALLOWED_TOOLS,
|
|
6539
|
+
[DREAMER_PRIMER_INVESTIGATOR_AGENT]: DREAMER_PRIMER_INVESTIGATOR_ALLOWED_TOOLS,
|
|
6542
6540
|
[DREAMER_RETROSPECTIVE_AGENT]: ["ctx_search"]
|
|
6543
6541
|
};
|
|
6544
6542
|
var AGENT_STEPS = {
|
|
@@ -7038,6 +7036,21 @@ function externalAbortMessage(signal) {
|
|
|
7038
7036
|
const reason = signal.reason;
|
|
7039
7037
|
return `prompt aborted by external signal${reason instanceof Error && /^lease_(?:lost|expired):/.test(reason.message) ? `: ${reason.message}` : ""}`;
|
|
7040
7038
|
}
|
|
7039
|
+
function raceWithSignal(work, signal) {
|
|
7040
|
+
work = Promise.resolve(work);
|
|
7041
|
+
if (!signal)
|
|
7042
|
+
return work;
|
|
7043
|
+
return new Promise((resolve, reject) => {
|
|
7044
|
+
const abort = () => reject(new Error(externalAbortMessage(signal)));
|
|
7045
|
+
if (signal.aborted) {
|
|
7046
|
+
work.catch(() => {});
|
|
7047
|
+
abort();
|
|
7048
|
+
return;
|
|
7049
|
+
}
|
|
7050
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
7051
|
+
work.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
|
|
7052
|
+
});
|
|
7053
|
+
}
|
|
7041
7054
|
async function promptWithTimeout(client, args, timeoutMs, signal, transport) {
|
|
7042
7055
|
if (signal?.aborted) {
|
|
7043
7056
|
throw new Error(externalAbortMessage(signal));
|
|
@@ -7049,11 +7062,11 @@ async function promptWithTimeout(client, args, timeoutMs, signal, transport) {
|
|
|
7049
7062
|
try {
|
|
7050
7063
|
const request = { ...args, signal: controller.signal };
|
|
7051
7064
|
if (transport)
|
|
7052
|
-
await transport(request);
|
|
7065
|
+
await raceWithSignal(transport(request), controller.signal);
|
|
7053
7066
|
else {
|
|
7054
7067
|
if (!client)
|
|
7055
7068
|
throw new Error("Hidden completion transport is unavailable");
|
|
7056
|
-
await client.session.prompt(request);
|
|
7069
|
+
await raceWithSignal(client.session.prompt(request), controller.signal);
|
|
7057
7070
|
}
|
|
7058
7071
|
} catch (error) {
|
|
7059
7072
|
if (signal?.aborted) {
|
|
@@ -7255,7 +7268,7 @@ async function attemptAndValidate(client, args, timeoutMs, signal, callContext,
|
|
|
7255
7268
|
}
|
|
7256
7269
|
let output;
|
|
7257
7270
|
try {
|
|
7258
|
-
output = await options.fetchOutput(args, attempt);
|
|
7271
|
+
output = await raceWithSignal(options.fetchOutput(args, attempt), options.signal);
|
|
7259
7272
|
} catch (error) {
|
|
7260
7273
|
throw {
|
|
7261
7274
|
error,
|
|
@@ -7689,10 +7702,20 @@ function createPromptAsyncTransport(client, childSessionId, options = {}) {
|
|
|
7689
7702
|
if (!readChildTokenBudget || !session?.prompt)
|
|
7690
7703
|
return;
|
|
7691
7704
|
return Object.assign(async (request) => {
|
|
7692
|
-
|
|
7693
|
-
const
|
|
7694
|
-
if (
|
|
7695
|
-
|
|
7705
|
+
const previous = readChildTokenBudget(childSessionId);
|
|
7706
|
+
const remaining = options.tokenBudget === undefined ? undefined : options.tokenBudget - (previous?.spent ?? 0);
|
|
7707
|
+
if (remaining !== undefined && remaining <= 0 || previous?.finalizeFired)
|
|
7708
|
+
throw new DreamTokenBudgetExceeded(childSessionId, previous?.spent ?? 0);
|
|
7709
|
+
try {
|
|
7710
|
+
await session.prompt?.({
|
|
7711
|
+
...request,
|
|
7712
|
+
...remaining === undefined ? {} : { tokenBudget: remaining }
|
|
7713
|
+
});
|
|
7714
|
+
} finally {
|
|
7715
|
+
const state = readChildTokenBudget(childSessionId);
|
|
7716
|
+
if (state)
|
|
7717
|
+
options.onBudgetUpdate?.({ ...state, sessionId: childSessionId });
|
|
7718
|
+
}
|
|
7696
7719
|
}, { childSessionId });
|
|
7697
7720
|
}
|
|
7698
7721
|
const budgetGuard = options.tokenBudget ? createDreamTokenBudget(options.tokenBudget) : undefined;
|
|
@@ -19099,4 +19122,4 @@ ${failure}`;
|
|
|
19099
19122
|
}
|
|
19100
19123
|
}
|
|
19101
19124
|
|
|
19102
|
-
export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap,
|
|
19125
|
+
export { historianRunConfig, dreamerRunConfig, pluginConfigReader, currentPluginConfigReader, withLiveDreamerOutputCap, COMPARTMENT_LEASE_RENEWAL_MS, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, queueM0Mutation, getMaxM0MutationId, getCompartments, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getUncoveredCompartmentEndsThrough, providerResponseFailed, isSuccessfulProviderCompletion, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, gaDatabasePath, RAW_MESSAGE_TYPES, V2StoreReaderPool, V2StoreReader, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, clearPendingMaterialization, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, queueMemoryMutation, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, readCoordinateGeneration, rebaseSessionCoordinatesAsync, HiddenCompletionRefusal, getOpenCodeDbPath, compareOpenCodeMessagesByCanonicalOrder, prepareCompactionMarkerCandidates, removeMcOwnedCompactionMarkers, getCompartmentEvents, USER_MEMORY_CANDIDATE_TTL_MS, insertUserMemoryCandidates, getUserMemoryCandidates, deleteUserMemoryCandidates, pruneExpiredUserMemoryCandidates, insertUserMemory, getActiveUserMemories, updateUserMemoryContent, dismissUserMemory, DreamerProviderOutputFailureError, withDreamerModelCooldown, providerOutputFailureFromInvalidManifest, DREAMER_AGENT, DREAMER_RETROSPECTIVE_AGENT, DREAMER_PRIMER_INVESTIGATOR_AGENT, DREAMER_MEMORY_MAPPER_AGENT, DREAMER_CLASSIFIER_AGENT, DREAMER_DOCS_AGENT, DREAMER_REVIEWER_AGENT, HIDDEN_HISTORIAN_AGENT, HIDDEN_DREAMER_AGENT, HIDDEN_CURATE_AGENT, hiddenAgentFor, hiddenToolLoop, hiddenChildPermissions, registerHiddenChildAgents, hiddenToolCallRefusal, HiddenAgentStepLimit, HiddenChildHook, extractLatestAssistantText, hasLengthCappedOutput, parseProviderModel, modelBodyField, toModelEntry, isPromptTimeoutError, getPromptFailureDetail, raceWithSignal, promptSyncWithValidatedOutputRetry, normalizeSDKResponse, failedInvocationStatus, sumTokensFromChildMessages, recordChildInvocation, createPromptAsyncTransport, CTX_NOTE_LIGHT_DESCRIPTION, ACTIVE_TOOL_IDS, systemPromptFingerprint, createPromptSurfaceRuntime, createPromptSurfaceGuidanceEpochCache, MARKER_SUMMARY_TEXT, markerUpdateDefinitelyDidNotCut, applyDeferredCompactionMarker, teardownChildSession, runTokenLog, formatRunTokenLog, createChildSessionWithFence, buildMagicContextSection, getMuralIdentity, getMural, modelKeyAcceptsImages, resolveMuralWire, extractM0Block, formatDate, TEMPORAL_MARKER_REPLAY_PATTERN, collectTemporalCandidates, injectTemporalMarkers, clearInjectionCache, getVisibleMemoryIds, selectHiddenMessagesAtCompactionSeam, prepareCompartmentInjection, renderCompartmentInjection, MaterializeContentionError, mustMaterialize, trimMemoriesToBudgetV2, renderMemoryBlockV2, materializeM0, hydrateCachedM0Mural, resetPrefixTrimFallbackState, findHostCompactionWindow, capturePrefixTrimSourceOrder, prepareCachedM0M1Replay, hasCompleteCachedM0M1, injectM0M1, clampProducerAtomChars, producerInputTokenLimit, historianProducerReserve, producerPromptFailureReason, resolveHiddenCompletionExecutor, createV1HiddenCompletionExecutor, EMPTY_READ_REPLY, noteTouchedAt, renderGlance, renderNotesById, formatWriteReply, observeNoteNudgeServe, onNoteTrigger, peekNoteNudgeText, markNoteNudgeDelivered, clearNoteNudgeTriggerAndCooldown, describeBoundaryDiagnostics, RECOVERY_NO_HEAD_LIMIT, deriveProtectedTailTokenTarget, selectPerRunCap, resolveOpenCodeProtectedTailBoundary, resolveWrapupProtectedTailBoundary, getRawHistoryEligibility, hasRunnableCompartmentWindow, recordHighPressureNoEligibleHead, noteTransformPassForExactOrdinalReads, runCompartmentAgent, getActiveCompartmentRun, markActiveCompartmentRunPublished, registerActiveCompartmentRun, startCompartmentAgent, isRecompFailure2, isRecompSkip2, extractRecompReason2, setRecompStarting2, setRecompNote2, setRecompTerminal2, buildRecompDeps2, runManagedRecomp2 };
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
} from "./server-rrqpvwqd.js";
|
|
11
11
|
import {
|
|
12
12
|
LocalEmbeddingProvider
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-g10mdym6.js";
|
|
14
14
|
import {
|
|
15
15
|
OpenAICompatibleEmbeddingProvider,
|
|
16
16
|
getProjectEmbeddingSnapshot2,
|
|
17
17
|
embedBatchForProject2
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-hek6z3w6.js";
|
|
19
19
|
import {
|
|
20
20
|
isEmbeddingHostBusy2
|
|
21
21
|
} from "./server-qt1qqasc.js";
|