@cortexkit/opencode-magic-context 0.49.23 → 0.49.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -26
- package/dist/agents/permissions.d.ts +8 -3
- package/dist/agents/permissions.d.ts.map +1 -1
- package/dist/auto-search-worker.js +4 -4
- package/dist/chunk-embedding-write-worker.js +5 -5
- package/dist/{compartment-chunk-embedding-he60aaa2.js → compartment-chunk-embedding-eypvn607.js} +3 -3
- package/dist/{conflict-warning-hook-2r32hyx6.js → conflict-warning-hook-a27bhggg.js} +4 -4
- package/dist/{context-j7hp43a0.js → context-keb00be8.js} +30 -24
- package/dist/{embedding-backfill-dtke6tck.js → embedding-backfill-vddgmem3.js} +5 -5
- package/dist/features/magic-context/dreamer/primer-seed.d.ts.map +1 -1
- package/dist/features/magic-context/tool-definition-tokens.d.ts +113 -57
- package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/ask-answer-notice.d.ts +25 -0
- package/dist/hooks/magic-context/ask-answer-notice.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts +12 -4
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-measured-request.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-replay-fit.d.ts.map +1 -1
- package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +8 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +10 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/signed-thinking-fit-snapshot.d.ts +42 -0
- package/dist/hooks/magic-context/signed-thinking-fit-snapshot.d.ts.map +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-y76rhsnr.js → index-0s8454t2.js} +50 -31
- package/dist/{index-1gtfne2c.js → index-2haxh8h3.js} +1 -1
- package/dist/{index-m32esgmj.js → index-3d5wnkq7.js} +1 -1
- package/dist/{index-jfem3dgz.js → index-7tdtpqrg.js} +5 -1
- package/dist/{index-mnnkgq0q.js → index-awcftgmx.js} +7 -49
- package/dist/{index-1kbznkft.js → index-axjgxeww.js} +10 -8
- package/dist/{index-j32jj2t8.js → index-bhyksfyy.js} +3 -3
- package/dist/{index-ksq50rg0.js → index-c9zrgcnt.js} +1 -1
- package/dist/index-cfaet9cg.js +405 -0
- package/dist/{index-jmq8kfe7.js → index-ebsvmc5s.js} +4 -4
- package/dist/{index-66eby7hx.js → index-jcr6pe7z.js} +1 -1
- package/dist/{index-syaazvy2.js → index-n18sch77.js} +5 -5
- package/dist/{index-a9zvn5fe.js → index-q7ywt6xt.js} +3 -3
- package/dist/{index-x6cbrv9h.js → index-szf8r0ba.js} +1 -1
- package/dist/{index-rxqr723x.js → index-t6j3qxnd.js} +1 -1
- package/dist/{index-11gzxvf4.js → index-y6xpzjzr.js} +98 -48
- package/dist/{index-mnhcdfxg.js → index-yrrsp47d.js} +91 -17
- package/dist/{index-zy67whjr.js → index-z05n7702.js} +1 -1
- package/dist/{index-3svaejkh.js → index-z928hmnp.js} +1 -1
- package/dist/{index-ffzhwfzy.js → index-zzrzjnx5.js} +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -38
- package/dist/{message-fts-rowid-map-e79b7b6x.js → message-fts-rowid-map-9e1getgs.js} +2 -2
- package/dist/{message-index-4q8ek2fc.js → message-index-3g966xn7.js} +7 -7
- package/dist/{message-index-bounded-rydsg9r5.js → message-index-bounded-vaeqhp9w.js} +7 -7
- package/dist/migration-worker.js +4 -4
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-hn529988.js → project-embedding-registry-rstzmb60.js} +4 -4
- package/dist/raw-ordinal-warmup-worker.js +6 -6
- package/dist/{read-session-chunk-t039f0m5.js → read-session-chunk-z5gnc0zb.js} +4 -4
- package/dist/{read-session-raw-aw6jgvwg.js → read-session-raw-s4amywnh.js} +3 -1
- package/dist/{recomp-orchestrator-hbm53jj5.js → recomp-orchestrator-qwqeskhq.js} +14 -14
- package/dist/{search-hea079d7.js → search-84zfqeky.js} +11 -11
- package/dist/{search-archive-weh164mh.js → search-archive-mfabzyn2.js} +5 -5
- package/dist/{send-session-notification-gqzkz7da.js → send-session-notification-ygj4mja0.js} +3 -3
- package/dist/shared/slow-test.d.ts +7 -0
- package/dist/shared/slow-test.d.ts.map +1 -0
- package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
- package/dist/tools/ctx-note/tools.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +6 -6
- package/dist/tools/parameter-descriptions.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-0b04tm1p.js → transform-postprocess-phase-hr1ntmjj.js} +14 -14
- package/dist/v2/auto-search-worker.js +4 -4
- package/dist/v2/chunk-embedding-write-worker.js +5 -5
- package/dist/v2/{compartment-chunk-embedding-8jjmcgeg.js → compartment-chunk-embedding-tk6g4q80.js} +3 -3
- package/dist/v2/{context-ea3x7smm.js → context-y7wfvdve.js} +106 -50
- package/dist/v2/{embedding-backfill-5e74ae0m.js → embedding-backfill-w5qp7t28.js} +5 -5
- package/dist/v2/hooks/context.d.ts +4 -0
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/{message-fts-rowid-map-n8fdg2ja.js → message-fts-rowid-map-pqk3a55v.js} +2 -2
- package/dist/v2/{message-index-bounded-8rcd7qq9.js → message-index-bounded-te303atj.js} +6 -6
- package/dist/v2/{message-index-qz9wdp82.js → message-index-fz6b4jeh.js} +6 -6
- package/dist/v2/migration-worker.js +4 -4
- package/dist/v2/{project-embedding-registry-v38q4xd5.js → project-embedding-registry-e7zftfvj.js} +4 -4
- package/dist/v2/raw-ordinal-warmup-worker.js +6 -6
- package/dist/v2/{read-session-chunk-wazfyxcg.js → read-session-chunk-knvkq1hf.js} +3 -3
- package/dist/v2/{read-session-raw-b70cpwzj.js → read-session-raw-ppjxnqk4.js} +3 -1
- package/dist/v2/{recomp-orchestrator-b12zaptj.js → recomp-orchestrator-e8a4jpvr.js} +11 -11
- package/dist/v2/{search-archive-x64rtz1z.js → search-archive-vrwgxv6z.js} +4 -4
- package/dist/v2/{search-hza9x72a.js → search-hav4dggf.js} +10 -10
- package/dist/v2/{send-session-notification-8eqe259v.js → send-session-notification-f8scq6ae.js} +1 -1
- package/dist/v2/{server-m4bfaevz.js → server-5brp2rfn.js} +90 -16
- package/dist/v2/{server-ppcd1qxh.js → server-6a8pxpxg.js} +7 -49
- package/dist/v2/server-7d6m1p2b.js +361 -0
- package/dist/v2/{server-zg5y109h.js → server-7weh65vd.js} +45 -27
- package/dist/v2/{server-qteg2kt9.js → server-8j2e7t31.js} +1 -1
- package/dist/v2/{server-d48x3m4x.js → server-9xbbaekh.js} +1 -1
- package/dist/v2/{server-j8h7bsca.js → server-e75vag9d.js} +3 -3
- package/dist/v2/{server-132h8twc.js → server-m6yyn961.js} +2 -2
- package/dist/v2/{server-62g58aaz.js → server-pw21ypwb.js} +1 -1
- package/dist/v2/{server-ad18djzs.js → server-q5z0gag0.js} +1 -1
- package/dist/v2/{server-4kjmrjn4.js → server-swvhxhxz.js} +5 -1
- package/dist/v2/{server-33nqbqkw.js → server-tfawsj08.js} +5 -5
- package/dist/v2/{server-dtp8hcjh.js → server-wxrdher8.js} +1 -1
- package/dist/v2/server.js +5 -5
- package/dist/v2/{wrapup-orchestrator-3ssd5yy1.js → wrapup-orchestrator-ycs8y6n4.js} +11 -11
- package/dist/{wrapup-orchestrator-5vpcd1zx.js → wrapup-orchestrator-f642w8n3.js} +15 -15
- package/package.json +4 -4
- package/src/agents/permissions.ts +22 -6
- package/src/agents/smart-notes-dreamer-gate.golden.json +241 -241
- package/src/agents/smart-notes-on.golden.json +4 -4
- package/src/config/compaction-accessor-guard.test.ts +0 -5
- package/src/config/removed-config-keys.test.ts +12 -26
- package/src/shared/announcement.test.ts +55 -59
- package/src/shared/prompt-surface-a1-golden.md +6 -7
- package/src/shared/slow-test.ts +24 -0
- package/src/shared/stable-json-linear.test.ts +18 -10
- package/dist/index-j76ah6d7.js +0 -120
- package/dist/v2/server-d1dzgvwd.js +0 -120
- package/src/config/latch-permanence-guard.test.ts +0 -258
|
@@ -70,18 +70,18 @@ import {
|
|
|
70
70
|
readRawSeedTailFromDb2,
|
|
71
71
|
readRawSessionBoundaryEndpointsFromDb2,
|
|
72
72
|
prewarmRawSessionOrdinalsForDb
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-7tdtpqrg.js";
|
|
74
74
|
import {
|
|
75
75
|
openCodeDbExists,
|
|
76
76
|
withReadOnlySessionDb,
|
|
77
77
|
getRawSessionMessageCountFromDb,
|
|
78
78
|
getMessageTimesFromOpenCodeDb
|
|
79
|
-
} from "./index-
|
|
79
|
+
} from "./index-c9zrgcnt.js";
|
|
80
80
|
import {
|
|
81
81
|
getToolDefinitionMeasurementSignature,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} from "./index-
|
|
82
|
+
getMeasuredToolDefinitionTokens,
|
|
83
|
+
getSessionToolDefinitionTokens
|
|
84
|
+
} from "./index-cfaet9cg.js";
|
|
85
85
|
import {
|
|
86
86
|
canonicalModelIdentity,
|
|
87
87
|
piModelRefToCanonical
|
|
@@ -492,6 +492,70 @@ function expandToolPart(part, overrides, legacyPreview = false) {
|
|
|
492
492
|
return renderToolTemplate(template, input, state?.output ?? state?.error, legacyPreview);
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
+
// src/hooks/magic-context/ask-answer-notice.ts
|
|
496
|
+
var ANSWER_HEADER_PREFIX = /^Inbox [^\n]* notice from user via user_answer \(user_answer\)/;
|
|
497
|
+
var ANSWER_TRAILER = /\n([\s\S]*?)\nThis ask is now closed; no dismiss is needed\. Continue accordingly\.$/;
|
|
498
|
+
var ANSWER_ANSWER_LINE = /^The user answered your parked question (\S+)\.\nQuestion: ([^\n]+)\nAnswer: /;
|
|
499
|
+
var ANSWER_QUESTION_LINE = /^Question: ([^\n]+)\nAnswer: /;
|
|
500
|
+
var reminderEnvelopePattern = /<system-reminder>([\s\S]*?)<\/system-reminder>/gi;
|
|
501
|
+
function reminderBodies(text) {
|
|
502
|
+
reminderEnvelopePattern.lastIndex = 0;
|
|
503
|
+
const bodies = [];
|
|
504
|
+
for (const match of text.matchAll(reminderEnvelopePattern)) {
|
|
505
|
+
const body = match[1];
|
|
506
|
+
if (body !== undefined)
|
|
507
|
+
bodies.push(body);
|
|
508
|
+
}
|
|
509
|
+
return bodies;
|
|
510
|
+
}
|
|
511
|
+
function parseAnswerBody(body) {
|
|
512
|
+
const lines = body.replace(/\r\n/g, `
|
|
513
|
+
`).replace(/^\n+|\n+$/g, "");
|
|
514
|
+
if (!ANSWER_HEADER_PREFIX.test(lines))
|
|
515
|
+
return null;
|
|
516
|
+
if (lines.includes("The user dismissed this question"))
|
|
517
|
+
return null;
|
|
518
|
+
const framed = ANSWER_TRAILER.exec(lines);
|
|
519
|
+
if (framed === null)
|
|
520
|
+
return null;
|
|
521
|
+
const content = framed[1] ?? "";
|
|
522
|
+
const narrated = ANSWER_ANSWER_LINE.exec(content);
|
|
523
|
+
if (narrated !== null) {
|
|
524
|
+
const question = narrated[2] ?? "";
|
|
525
|
+
const answer = content.slice(narrated[0].length);
|
|
526
|
+
return closedAnswer(question, answer);
|
|
527
|
+
}
|
|
528
|
+
const bare = ANSWER_QUESTION_LINE.exec(content);
|
|
529
|
+
if (bare !== null) {
|
|
530
|
+
const question = bare[1] ?? "";
|
|
531
|
+
const answer = content.slice(bare[0].length);
|
|
532
|
+
return closedAnswer(question, answer);
|
|
533
|
+
}
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
function closedAnswer(question, answer) {
|
|
537
|
+
if (question.trim().length === 0)
|
|
538
|
+
return null;
|
|
539
|
+
if (answer.trim().length === 0)
|
|
540
|
+
return null;
|
|
541
|
+
return { question, answer };
|
|
542
|
+
}
|
|
543
|
+
function extractAskAnswerNotices(text) {
|
|
544
|
+
const notices = [];
|
|
545
|
+
for (const body of reminderBodies(text)) {
|
|
546
|
+
const notice = parseAnswerBody(body);
|
|
547
|
+
if (notice !== null)
|
|
548
|
+
notices.push(notice);
|
|
549
|
+
}
|
|
550
|
+
return notices;
|
|
551
|
+
}
|
|
552
|
+
function formatAskAnswerNotice(notice) {
|
|
553
|
+
return `U (answered "${notice.question}"): ${notice.answer}`;
|
|
554
|
+
}
|
|
555
|
+
function askAnswerLines(text) {
|
|
556
|
+
return extractAskAnswerNotices(text).map(formatAskAnswerNotice);
|
|
557
|
+
}
|
|
558
|
+
|
|
495
559
|
// src/hooks/magic-context/host-served-rows.ts
|
|
496
560
|
var HOST_UNSERVED_ROW = "hostUnservedRow";
|
|
497
561
|
function markHostUnservedRow(target) {
|
|
@@ -5791,7 +5855,7 @@ function createFinalWireUsageTracker() {
|
|
|
5791
5855
|
const envelopeFor = (input) => {
|
|
5792
5856
|
if (!input.providerID || !input.modelID || !input.systemPromptHash)
|
|
5793
5857
|
return;
|
|
5794
|
-
const tools = getToolDefinitionMeasurementSignature(input.providerID, input.modelID, input.agentName);
|
|
5858
|
+
const tools = getToolDefinitionMeasurementSignature(input.providerID, input.modelID, input.agentName, input.sessionId);
|
|
5795
5859
|
if (!tools)
|
|
5796
5860
|
return;
|
|
5797
5861
|
return JSON.stringify([
|
|
@@ -5804,7 +5868,8 @@ function createFinalWireUsageTracker() {
|
|
|
5804
5868
|
]);
|
|
5805
5869
|
};
|
|
5806
5870
|
return {
|
|
5807
|
-
estimate(sessionId,
|
|
5871
|
+
estimate(sessionId, request, limit) {
|
|
5872
|
+
const input = { ...request, sessionId: request.sessionId ?? sessionId };
|
|
5808
5873
|
let measuredPrefix;
|
|
5809
5874
|
try {
|
|
5810
5875
|
const previous = served.get(sessionId);
|
|
@@ -5835,7 +5900,8 @@ function createFinalWireUsageTracker() {
|
|
|
5835
5900
|
}
|
|
5836
5901
|
return estimateOutgoingWireForRefusal({ ...input, measuredPrefix }, limit);
|
|
5837
5902
|
},
|
|
5838
|
-
capture(sessionId,
|
|
5903
|
+
capture(sessionId, request) {
|
|
5904
|
+
const input = { ...request, sessionId: request.sessionId ?? sessionId };
|
|
5839
5905
|
const previous = served.get(sessionId);
|
|
5840
5906
|
served.delete(sessionId);
|
|
5841
5907
|
try {
|
|
@@ -5906,7 +5972,7 @@ function estimateOutgoingWireForRefusal(input, limit) {
|
|
|
5906
5972
|
if (bytes) {
|
|
5907
5973
|
const lower = baseline + Math.ceil(bytes.bytes / 4);
|
|
5908
5974
|
const calibration = resolveDecisionCalibration(input.providerID, input.modelID);
|
|
5909
|
-
const tools = input.providerID && input.modelID ? getMeasuredToolDefinitionTokens(input.providerID, input.modelID, input.agentName) : undefined;
|
|
5975
|
+
const tools = input.providerID && input.modelID ? getMeasuredToolDefinitionTokens(input.providerID, input.modelID, input.agentName, input.sessionId) : undefined;
|
|
5910
5976
|
const envelope = measured ? baseline : tools !== undefined && Number.isFinite(input.systemPromptTokens) && input.systemPromptTokens > 0 ? providerMass({ system: input.systemPromptTokens, tools }, calibration, true) : undefined;
|
|
5911
5977
|
const upper = envelope === undefined ? undefined : envelope + Math.ceil(bytes.bytes * Math.max(UNKNOWN_FIT_RATIO, calibration.toolsRatio, calibration.proseRatio));
|
|
5912
5978
|
if (bytes.aborted || lower > limit || upper !== undefined && upper <= limit) {
|
|
@@ -5934,17 +6000,17 @@ function estimateFinalWireInputTokens(input) {
|
|
|
5934
6000
|
total.toolCall += next.toolCall;
|
|
5935
6001
|
return total;
|
|
5936
6002
|
}, { conversation: 0, toolCall: 0 });
|
|
5937
|
-
const measuredToolDefinitions = input.toolDefinitionTokens ?? (input.providerID && input.modelID ? getMeasuredToolDefinitionTokens(input.providerID, input.modelID, input.agentName) : undefined);
|
|
6003
|
+
const measuredToolDefinitions = input.toolDefinitionTokens ?? (input.providerID && input.modelID ? getMeasuredToolDefinitionTokens(input.providerID, input.modelID, input.agentName, input.sessionId) : undefined);
|
|
5938
6004
|
const calibration = resolveDecisionCalibration(input.providerID, input.modelID);
|
|
5939
|
-
const
|
|
5940
|
-
const toolDefinitions = measuredToolDefinitions ?? (
|
|
6005
|
+
const borrowedToolDefinitions = measuredToolDefinitions === undefined ? getSessionToolDefinitionTokens(input.sessionId) : undefined;
|
|
6006
|
+
const toolDefinitions = measuredToolDefinitions ?? (borrowedToolDefinitions === undefined ? undefined : Math.ceil(borrowedToolDefinitions * UNKNOWN_FIT_RATIO / (calibration.seeded ? calibration.toolsRatio : UNKNOWN_FIT_RATIO)));
|
|
5941
6007
|
const rawComponents = {
|
|
5942
6008
|
system: input.systemPromptTokens,
|
|
5943
6009
|
tools: (toolDefinitions ?? 0) + messageTokens.toolCall,
|
|
5944
6010
|
prose: messageTokens.conversation
|
|
5945
6011
|
};
|
|
5946
6012
|
const tokens = providerMass(rawComponents, calibration, true);
|
|
5947
|
-
const pressureToolDefinitions = measuredToolDefinitions ??
|
|
6013
|
+
const pressureToolDefinitions = measuredToolDefinitions ?? borrowedToolDefinitions ?? 0;
|
|
5948
6014
|
const pressureTokens = providerMass({
|
|
5949
6015
|
system: rawComponents.system,
|
|
5950
6016
|
tools: pressureToolDefinitions + messageTokens.toolCall,
|
|
@@ -6604,6 +6670,9 @@ function withRawMessageProvider2(sessionId, provider, fn) {
|
|
|
6604
6670
|
function cleanUserText2(text) {
|
|
6605
6671
|
return stripOutsideSteeringWrappers(text, (segment) => removeSystemReminders(segment).replace(OMO_INTERNAL_INITIATOR_MARKER, "")).trim();
|
|
6606
6672
|
}
|
|
6673
|
+
function answerLineParts(rawText) {
|
|
6674
|
+
return askAnswerLines(rawText).map(normalizeText).filter((value) => value.length > 0);
|
|
6675
|
+
}
|
|
6607
6676
|
function hasMeaningfulChunkUserText(parts) {
|
|
6608
6677
|
for (const part of parts) {
|
|
6609
6678
|
if (part === null || typeof part !== "object")
|
|
@@ -6620,7 +6689,7 @@ function hasMeaningfulChunkUserText(parts) {
|
|
|
6620
6689
|
continue;
|
|
6621
6690
|
return true;
|
|
6622
6691
|
}
|
|
6623
|
-
return
|
|
6692
|
+
return parts.some((part) => part !== null && typeof part === "object" && part.type === "text" && typeof part.text === "string" && part.ignored !== true && askAnswerLines(part.text).length > 0);
|
|
6624
6693
|
}
|
|
6625
6694
|
function withRawSessionMessageCache2(fn) {
|
|
6626
6695
|
const outerCache = activeRawMessageCache;
|
|
@@ -7374,8 +7443,10 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
|
|
|
7374
7443
|
}
|
|
7375
7444
|
const role = compactRole(msg.role);
|
|
7376
7445
|
const textParts = extractTexts2(msg.parts).map((t) => msg.role === "user" ? cleanUserText2(t) : t).map(normalizeText).filter((value) => value.length > 0);
|
|
7446
|
+
const answerParts = msg.role === "user" ? extractTexts2(msg.parts).flatMap((text) => answerLineParts(text)) : [];
|
|
7447
|
+
const userParts = answerParts.length > 0 ? [...textParts, ...answerParts] : textParts;
|
|
7377
7448
|
const allParts = options.expand === false ? [
|
|
7378
|
-
...
|
|
7449
|
+
...userParts,
|
|
7379
7450
|
...textParts.length === 0 ? extractToolCallSummaries(msg.parts) : []
|
|
7380
7451
|
] : msg.parts.flatMap((part) => {
|
|
7381
7452
|
if (expandedResults.has(part))
|
|
@@ -7384,6 +7455,9 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
|
|
|
7384
7455
|
if (expansion !== null)
|
|
7385
7456
|
return [`TC: ${expansion}`];
|
|
7386
7457
|
const texts = extractTexts2([part]).map((t) => msg.role === "user" ? cleanUserText2(t) : t).map(normalizeText).filter(Boolean);
|
|
7458
|
+
if (msg.role === "user") {
|
|
7459
|
+
texts.push(...extractTexts2([part]).flatMap((text) => answerLineParts(text)));
|
|
7460
|
+
}
|
|
7387
7461
|
return texts.length ? texts : textParts.length === 0 ? extractToolCallSummaries([part]) : [];
|
|
7388
7462
|
});
|
|
7389
7463
|
const compacted = compactTextForSummary(allParts.join(" / "), msg.role);
|
|
@@ -7392,7 +7466,7 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
|
|
|
7392
7466
|
recordFilteredNoise(meta);
|
|
7393
7467
|
continue;
|
|
7394
7468
|
}
|
|
7395
|
-
const msgHasNarrative =
|
|
7469
|
+
const msgHasNarrative = userParts.length > 0;
|
|
7396
7470
|
if (currentBlock && currentBlock.role === role) {
|
|
7397
7471
|
currentBlock.endOrdinal = msg.ordinal;
|
|
7398
7472
|
currentBlock.parts.push(text);
|
|
@@ -7494,4 +7568,4 @@ function readRawSessionSeedTail2(sessionId, boundaryId, onQuery) {
|
|
|
7494
7568
|
});
|
|
7495
7569
|
}
|
|
7496
7570
|
|
|
7497
|
-
export { isToolFreeHiddenAgent, TOOL_USE_DISABLED, ZEN_READ_AGENT_SUFFIX, needsBlockedRead, withBlockedReadInstruction, rememberV1HiddenRun, shapeV1HiddenMessage, expandToolPart, markHostUnservedRow, retreatPastHostUnservedRows, snapTerminalCompartmentToServedRow, isHostRenderedSystemMessage, markCoveredInstructionRow, isCoveredInstructionRow, takeCoveredInstructionRows, cloneKeepingCoveredInstructionMarks, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripSystemInjection, isTextPart, isToolPartWithOutput, isFilePart, toolPartHasUserAnswer, DreamTokenBudgetExceeded, TOKEN_BUDGET_FINALIZE_MESSAGE, registerBudgetFinalizeChild, releaseBudgetFinalizeChild, createDreamTokenBudget, recordToolParameters, createDroppedInputGuard, assertExecutableToolInput, createDroppedInputToolExecuteBeforeHook, isEditTool, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, MAX_EXECUTE_THRESHOLD, escalationBands, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, clearCachedM0, withReplayEnvelopeSnapshot, invalidateReplayEnvelopeSnapshot, isRustMarkerAdmissionFenced, setRustMarkerAdmissionFence, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, resetProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, removeNoteNudgeAnchorByMessageId, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, compactionOffThinkingFrozenId, compactionOffFrozenThinkingIds, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, getProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, replacePendingCompactionMarkerStateIf, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingMarker, setSessionWorkMetrics, getObservedEpochFloor, resolveEpochFloorForPass, getReasoningRemovalState, addRemovedReasoningIds, markDropLeavesReasoning, detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, markServedShapeRepair, prepareServedShapeRepair, stripSystemInjectedMessages, stripDroppedPlaceholderMessages, replayClearedReasoning, replayStrippedInlineThinking, clearOldReasoning, stripClearedReasoning, captureInlineThinkingRepairs, stripInlineThinking, findReasoningBearingAssistantIds, findLatestAssistantReasoningMutationExemptMessage, snapshotTrailingBlankSourceDecisions, findTrailingBlankDecisionCandidates, applyFrozenTrailingBlankDecisions, stripReasoningFromAssistantIds, findMergedReasoningStripDecisions, stripReasoningFromMergedAssistants, getEmptyImageParts, stripProcessedImages, projectOpencodeReasoningBudgetCutoff, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opencodeReasoningBudgetCutoff, describeFinalWireTail, estimatePartImageTokens, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, estimateAppendedWireTokens, SKELETON_REAL_INPUT_MAX_BYTES, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, resolveHostServedBoundaryId2, hasRawMessageProvider2, setRawMessageProvider2, setBoundedRawMessageProvider2, withRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, RAW_MESSAGE_VISIT_PAGE_SIZE2, visitRawSessionMessages2, visitRawSessionMessagesAsync2, readRawSessionMessageRange2, prepareRawSessionOrdinals2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageOrdinalPage2, getRawSessionStoredMessageCount2, readRawSessionMessageIdOrdinalsForRange2, readRawSessionMessageIdOrdinals2, readRawSessionMessagePartsById2, readRawSessionBoundaryEndpoints2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, RAW_SESSION_TAG_KEY_PAGE_SIZE2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, getProtectedTailStartOrdinal2, readSessionChunk2, getRawSessionMessageIdsThrough2, readRawSessionSeedTail2 };
|
|
7571
|
+
export { isToolFreeHiddenAgent, TOOL_USE_DISABLED, ZEN_READ_AGENT_SUFFIX, needsBlockedRead, withBlockedReadInstruction, rememberV1HiddenRun, shapeV1HiddenMessage, expandToolPart, askAnswerLines, markHostUnservedRow, retreatPastHostUnservedRows, snapTerminalCompartmentToServedRow, isHostRenderedSystemMessage, markCoveredInstructionRow, isCoveredInstructionRow, takeCoveredInstructionRows, cloneKeepingCoveredInstructionMarks, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripSystemInjection, isTextPart, isToolPartWithOutput, isFilePart, toolPartHasUserAnswer, DreamTokenBudgetExceeded, TOKEN_BUDGET_FINALIZE_MESSAGE, registerBudgetFinalizeChild, releaseBudgetFinalizeChild, createDreamTokenBudget, recordToolParameters, createDroppedInputGuard, assertExecutableToolInput, createDroppedInputToolExecuteBeforeHook, isEditTool, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, MAX_EXECUTE_THRESHOLD, escalationBands, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, clearCachedM0, withReplayEnvelopeSnapshot, invalidateReplayEnvelopeSnapshot, isRustMarkerAdmissionFenced, setRustMarkerAdmissionFence, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isEmergencyRecoveryArmed, isProviderOverflowReconfirmed, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadPersistedUsage, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, resetProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, getPersistedReasoningWatermark, setPersistedReasoningWatermark, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, removeNoteNudgeAnchorByMessageId, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, removeAutoSearchHintDecisionByMessageId, getPersistedTodoPermissionDenied, setPersistedTodoPermissionDenied, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, loadTransformPassStateSnapshot, recordOverflowDetected, recordDetectedContextLimit, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, setPersistedCompactionMarkerState, getDeferredClearedCompactionMarkerState, retireDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, removeStrippedPlaceholderId, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, compactionOffThinkingFrozenId, compactionOffFrozenThinkingIds, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getTrailingBlankDecisions, addTrailingBlankDecisions, demoteTrailingBlankKeepDecisions, getStaleReduceStrippedIds, addStaleReduceStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, getProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, setPendingCompactionMarkerState, replacePendingCompactionMarkerStateIf, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingMarker, setSessionWorkMetrics, getObservedEpochFloor, resolveEpochFloorForPass, getReasoningRemovalState, addRemovedReasoningIds, markDropLeavesReasoning, detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, markServedShapeRepair, prepareServedShapeRepair, stripSystemInjectedMessages, stripDroppedPlaceholderMessages, replayClearedReasoning, replayStrippedInlineThinking, clearOldReasoning, stripClearedReasoning, captureInlineThinkingRepairs, stripInlineThinking, findReasoningBearingAssistantIds, findLatestAssistantReasoningMutationExemptMessage, snapshotTrailingBlankSourceDecisions, findTrailingBlankDecisionCandidates, applyFrozenTrailingBlankDecisions, stripReasoningFromAssistantIds, findMergedReasoningStripDecisions, stripReasoningFromMergedAssistants, getEmptyImageParts, stripProcessedImages, projectOpencodeReasoningBudgetCutoff, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opencodeReasoningBudgetCutoff, describeFinalWireTail, estimatePartImageTokens, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, estimateAppendedWireTokens, SKELETON_REAL_INPUT_MAX_BYTES, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, resolveHostServedBoundaryId2, hasRawMessageProvider2, setRawMessageProvider2, setBoundedRawMessageProvider2, withRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, RAW_MESSAGE_VISIT_PAGE_SIZE2, visitRawSessionMessages2, visitRawSessionMessagesAsync2, readRawSessionMessageRange2, prepareRawSessionOrdinals2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageOrdinalPage2, getRawSessionStoredMessageCount2, readRawSessionMessageIdOrdinalsForRange2, readRawSessionMessageIdOrdinals2, readRawSessionMessagePartsById2, readRawSessionBoundaryEndpoints2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, RAW_SESSION_TAG_KEY_PAGE_SIZE2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, getProtectedTailStartOrdinal2, readSessionChunk2, getRawSessionMessageIdsThrough2, readRawSessionSeedTail2 };
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
countSessionCompartmentEmbedCoverage2,
|
|
42
42
|
countSessionCompartmentEmbedCoveragePolite2,
|
|
43
43
|
countUnembeddedSessionCompartmentsPolite2
|
|
44
|
-
} from "./index-
|
|
44
|
+
} from "./index-3d5wnkq7.js";
|
|
45
45
|
import {
|
|
46
46
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
47
47
|
} from "./index-nxrsns5x.js";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./index-h7tgn49j.js";
|
|
4
4
|
import {
|
|
5
5
|
clearEmergencyRecovery
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-yrrsp47d.js";
|
|
7
7
|
import {
|
|
8
8
|
requestPendingMaterialization,
|
|
9
9
|
dropSlot,
|
|
10
10
|
executeContextRecomp
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-0s8454t2.js";
|
|
12
12
|
import {
|
|
13
13
|
renderUserFacingFailure,
|
|
14
14
|
userFacingFailureCode
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-z928hmnp.js";
|
|
16
16
|
|
|
17
17
|
// src/hooks/magic-context/recomp-orchestrator.ts
|
|
18
18
|
function resolveLiveModelKey(liveSessionState, sessionId) {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmHvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAmHvE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAikCpC,QAAA,MAAM,MAAM,EAAE,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAIjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
detectOverflow,
|
|
29
29
|
isAnthropicFamilyRoute,
|
|
30
30
|
readRawSessionMessages2
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-yrrsp47d.js";
|
|
32
32
|
import {
|
|
33
33
|
setHarness2
|
|
34
34
|
} from "./index-pavzsdc6.js";
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
checkCompactionMarkerConsistency,
|
|
98
98
|
clearInjectionCache,
|
|
99
99
|
clearNoteNudgeTriggerOnly
|
|
100
|
-
} from "./index-
|
|
100
|
+
} from "./index-0s8454t2.js";
|
|
101
101
|
import"./index-sd3egckz.js";
|
|
102
102
|
import {
|
|
103
103
|
hasTrustedAbsoluteWall,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
parameterDescriptionsFor,
|
|
186
186
|
MagicContextRpcServer,
|
|
187
187
|
applyHiddenSubagentTemperature
|
|
188
|
-
} from "./index-
|
|
188
|
+
} from "./index-y6xpzjzr.js";
|
|
189
189
|
import {
|
|
190
190
|
resolveOpenCodeDbPath,
|
|
191
191
|
openCodeDbPathExists,
|
|
@@ -209,7 +209,7 @@ import {
|
|
|
209
209
|
openDatabaseAsync,
|
|
210
210
|
isDatabasePersisted,
|
|
211
211
|
getDatabasePersistenceError
|
|
212
|
-
} from "./index-
|
|
212
|
+
} from "./index-q7ywt6xt.js";
|
|
213
213
|
import {
|
|
214
214
|
setHomeProjectPermission,
|
|
215
215
|
ProjectIdentityError,
|
|
@@ -225,11 +225,10 @@ import {
|
|
|
225
225
|
deleteTemporalDecision
|
|
226
226
|
} from "./index-x9k3mqrf.js";
|
|
227
227
|
import {
|
|
228
|
-
BoundedSessionMap,
|
|
229
228
|
observeSessionActivity,
|
|
230
229
|
backfillSessionActivity,
|
|
231
230
|
deleteIndexedMessage2
|
|
232
|
-
} from "./index-
|
|
231
|
+
} from "./index-awcftgmx.js";
|
|
233
232
|
import {
|
|
234
233
|
recordSessionProjectIdentity
|
|
235
234
|
} from "./index-kfyb3k6n.js";
|
|
@@ -242,33 +241,34 @@ import {
|
|
|
242
241
|
import"./index-cpjk5jd2.js";
|
|
243
242
|
import {
|
|
244
243
|
forgetRawSessionOrdinalWatermark2
|
|
245
|
-
} from "./index-
|
|
246
|
-
import"./index-
|
|
244
|
+
} from "./index-7tdtpqrg.js";
|
|
245
|
+
import"./index-szf8r0ba.js";
|
|
247
246
|
import"./index-9q1g3c5q.js";
|
|
248
247
|
import"./index-fr0wbhdn.js";
|
|
249
248
|
import {
|
|
250
249
|
preloadTokenizer
|
|
251
250
|
} from "./index-b88dwwrh.js";
|
|
252
251
|
import {
|
|
253
|
-
|
|
254
|
-
recordToolDefinition
|
|
255
|
-
|
|
252
|
+
BoundedSessionMap,
|
|
253
|
+
recordToolDefinition,
|
|
254
|
+
getCurrentToolSetHash
|
|
255
|
+
} from "./index-cfaet9cg.js";
|
|
256
256
|
import"./index-wfybj1dw.js";
|
|
257
257
|
import {
|
|
258
258
|
getDefaultSubcConnectionFile,
|
|
259
259
|
SubcModuleTransport
|
|
260
|
-
} from "./index-
|
|
260
|
+
} from "./index-n18sch77.js";
|
|
261
261
|
import"./index-qt1qqasc.js";
|
|
262
262
|
import"./index-rrv26qjz.js";
|
|
263
263
|
import {
|
|
264
264
|
observeOpenCodeTurnEvent,
|
|
265
265
|
clearTrackedOpenCodeSession,
|
|
266
266
|
findLastAssistantModelFromOpenCodeDb
|
|
267
|
-
} from "./index-
|
|
267
|
+
} from "./index-c9zrgcnt.js";
|
|
268
268
|
import {
|
|
269
269
|
sendCommandResult2,
|
|
270
270
|
sendStatusNotification2
|
|
271
|
-
} from "./index-
|
|
271
|
+
} from "./index-jcr6pe7z.js";
|
|
272
272
|
import {
|
|
273
273
|
detectConflicts,
|
|
274
274
|
resolveCompactionForBoot
|
|
@@ -276,7 +276,7 @@ import {
|
|
|
276
276
|
import {
|
|
277
277
|
sendConflictWarning2,
|
|
278
278
|
cleanupConflictWarnings2
|
|
279
|
-
} from "./index-
|
|
279
|
+
} from "./index-2haxh8h3.js";
|
|
280
280
|
import"./index-1zx87sdm.js";
|
|
281
281
|
import {
|
|
282
282
|
stripPersistedAssistantText,
|
|
@@ -292,15 +292,15 @@ import {
|
|
|
292
292
|
getEmbedDrainUiStatus,
|
|
293
293
|
clearEmbedSessionState,
|
|
294
294
|
getEmbeddingCoverageStatus2
|
|
295
|
-
} from "./index-
|
|
296
|
-
import"./index-
|
|
297
|
-
import"./index-
|
|
295
|
+
} from "./index-z05n7702.js";
|
|
296
|
+
import"./index-3d5wnkq7.js";
|
|
297
|
+
import"./index-z928hmnp.js";
|
|
298
298
|
import {
|
|
299
299
|
pushNotification2
|
|
300
300
|
} from "./index-x8a7jmkh.js";
|
|
301
301
|
import"./index-51rdvtkz.js";
|
|
302
302
|
import"./index-4dhv7mqz.js";
|
|
303
|
-
import"./index-
|
|
303
|
+
import"./index-t6j3qxnd.js";
|
|
304
304
|
import"./index-jjvbk92s.js";
|
|
305
305
|
import"./index-qgh1qwjj.js";
|
|
306
306
|
import {
|
|
@@ -309,10 +309,10 @@ import {
|
|
|
309
309
|
setCtxReduceRegisteredGlobally,
|
|
310
310
|
clearToolPermissionDenied,
|
|
311
311
|
resetDegradedCacheCount2
|
|
312
|
-
} from "./index-
|
|
312
|
+
} from "./index-axjgxeww.js";
|
|
313
313
|
import {
|
|
314
314
|
runManagedRecomp2
|
|
315
|
-
} from "./index-
|
|
315
|
+
} from "./index-zzrzjnx5.js";
|
|
316
316
|
import {
|
|
317
317
|
isValidSemver,
|
|
318
318
|
compareSemverCore
|
|
@@ -320,9 +320,9 @@ import {
|
|
|
320
320
|
import"./index-fmsr7v69.js";
|
|
321
321
|
import {
|
|
322
322
|
runManagedWrapup2
|
|
323
|
-
} from "./index-
|
|
323
|
+
} from "./index-ebsvmc5s.js";
|
|
324
324
|
import"./index-kaqs6h31.js";
|
|
325
|
-
import"./index-
|
|
325
|
+
import"./index-bhyksfyy.js";
|
|
326
326
|
import {
|
|
327
327
|
isDreamerRunnable,
|
|
328
328
|
isSmartNoteSurfaceAvailable,
|
|
@@ -8190,7 +8190,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8190
8190
|
// package.json
|
|
8191
8191
|
var package_default = {
|
|
8192
8192
|
name: "@cortexkit/opencode-magic-context",
|
|
8193
|
-
version: "0.49.
|
|
8193
|
+
version: "0.49.25",
|
|
8194
8194
|
type: "module",
|
|
8195
8195
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8196
8196
|
main: "dist/index.js",
|
|
@@ -8233,8 +8233,8 @@ var package_default = {
|
|
|
8233
8233
|
"check:tui-compiled": 'git diff --exit-code -- src/tui-compiled && test -z "$(git status --porcelain -- src/tui-compiled)"',
|
|
8234
8234
|
"check:transformers-node-wasm": "bun scripts/verify-transformers-node-wasm.ts",
|
|
8235
8235
|
typecheck: "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
|
|
8236
|
-
test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile &&
|
|
8237
|
-
"test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern '
|
|
8236
|
+
test: "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && MC_SLOW_TESTS=0 MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --parallel=4 --timeout 30000 --test-name-pattern '^(?!.*\\[slow\\] )'",
|
|
8237
|
+
"test:active-session-backfill": "MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test src/hooks/magic-context/auto-embed-session.test.ts --test-name-pattern 're-embeds old chunks' --timeout 120000",
|
|
8238
8238
|
"test:serial": "bun install --frozen-lockfile && MC_REVIEW_ASSERT_LIVENESS=1 BUN_JSC_useOMGJIT=0 bun test --timeout 30000",
|
|
8239
8239
|
"test:parallel:probe": "bun scripts/verify-parallel-db-isolation.ts",
|
|
8240
8240
|
lint: "bun ../../scripts/check-bun.mjs && biome check .",
|
|
@@ -8245,7 +8245,7 @@ var package_default = {
|
|
|
8245
8245
|
prepublishOnly: "bun run build && bun run check:tui-compiled"
|
|
8246
8246
|
},
|
|
8247
8247
|
"//check:tui-compiled": "Check drift on output already generated by build or build:tui; this check never regenerates files. CI and prepublishOnly build first.",
|
|
8248
|
-
"//test": "
|
|
8248
|
+
"//test": "Unit shards run small behavioral fixtures. The nightly/check-branch slow-unit lane runs full scale and latency gates in fresh processes once per mode, not once per shard. JSC's optimizing WebAssembly tier stays disabled in tests; production host options are unchanged.",
|
|
8249
8249
|
dependencies: {
|
|
8250
8250
|
"@cortexkit/subc-client": "0.11.1",
|
|
8251
8251
|
"@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
|
|
@@ -10541,7 +10541,7 @@ function createMagicContextHook(deps) {
|
|
|
10541
10541
|
const model = liveModelBySession.get(sessionId);
|
|
10542
10542
|
if (!model)
|
|
10543
10543
|
return "";
|
|
10544
|
-
return getCurrentToolSetHash(model.providerID, model.modelID, agentBySession.get(sessionId));
|
|
10544
|
+
return getCurrentToolSetHash(model.providerID, model.modelID, agentBySession.get(sessionId), sessionId);
|
|
10545
10545
|
},
|
|
10546
10546
|
getFallbackModelId: (sessionId) => {
|
|
10547
10547
|
const model = liveModelBySession.get(sessionId);
|
|
@@ -12043,7 +12043,7 @@ async function setup(context) {
|
|
|
12043
12043
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12044
12044
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
12045
12045
|
}
|
|
12046
|
-
const { registerContext } = await import("./context-
|
|
12046
|
+
const { registerContext } = await import("./context-keb00be8.js");
|
|
12047
12047
|
setHarness2("opencode2");
|
|
12048
12048
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12049
12049
|
const duties = await registerContext(context);
|
|
@@ -12122,7 +12122,7 @@ var server = async (ctx) => {
|
|
|
12122
12122
|
if (hasBannerEntries)
|
|
12123
12123
|
setTimeout(async () => {
|
|
12124
12124
|
try {
|
|
12125
|
-
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-
|
|
12125
|
+
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-ygj4mja0.js"));
|
|
12126
12126
|
const clientWithSessions = ctx.client;
|
|
12127
12127
|
const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
|
|
12128
12128
|
const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
|
|
@@ -12140,7 +12140,7 @@ var server = async (ctx) => {
|
|
|
12140
12140
|
log2(`[magic-context] opencode_db_missing path=${openCodeDbResolution.path} source=${openCodeDbResolution.source}`);
|
|
12141
12141
|
setTimeout(async () => {
|
|
12142
12142
|
try {
|
|
12143
|
-
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-
|
|
12143
|
+
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-ygj4mja0.js"));
|
|
12144
12144
|
const clientWithSessions = ctx.client;
|
|
12145
12145
|
const sessions = await Promise.resolve(clientWithSessions.session?.list?.()).catch(() => null);
|
|
12146
12146
|
const sessionList = Array.isArray(sessions) ? sessions : sessions?.data;
|
|
@@ -12417,12 +12417,12 @@ var server = async (ctx) => {
|
|
|
12417
12417
|
{
|
|
12418
12418
|
const fence = getSchemaFenceRejection();
|
|
12419
12419
|
if (fence) {
|
|
12420
|
-
importPluginModule(() => import("./conflict-warning-hook-
|
|
12420
|
+
importPluginModule(() => import("./conflict-warning-hook-a27bhggg.js")).then(({ sendSchemaFenceWarning }) => sendSchemaFenceWarning(ctx.client, ctx.directory, fence)).catch((error) => log2("[magic-context] schema-fence warning unavailable:", error));
|
|
12421
12421
|
}
|
|
12422
12422
|
}
|
|
12423
12423
|
const serverUrl = ctx.serverUrl;
|
|
12424
12424
|
const serverUrlStr = serverUrl instanceof URL ? serverUrl.toString().replace(/\/$/, "") : typeof serverUrl === "string" ? serverUrl.replace(/\/$/, "") : undefined;
|
|
12425
|
-
importPluginModule(() => import("./send-session-notification-
|
|
12425
|
+
importPluginModule(() => import("./send-session-notification-ygj4mja0.js")).then(({ setNotificationServerUrl }) => {
|
|
12426
12426
|
setNotificationServerUrl(serverUrlStr);
|
|
12427
12427
|
}).catch((error) => log2("[magic-context] notification transport unavailable:", error));
|
|
12428
12428
|
if (conflictResult?.hasConflict) {
|
|
@@ -12445,7 +12445,7 @@ var server = async (ctx) => {
|
|
|
12445
12445
|
}) => {
|
|
12446
12446
|
if (!shouldShowAnnouncement())
|
|
12447
12447
|
return;
|
|
12448
|
-
return importPluginModule(() => import("./conflict-warning-hook-
|
|
12448
|
+
return importPluginModule(() => import("./conflict-warning-hook-a27bhggg.js")).then(({ sendStartupAnnouncement }) => sendStartupAnnouncement(ctx.client, ctx.directory, ANNOUNCEMENT_VERSION, ANNOUNCEMENT_FEATURES, ANNOUNCEMENT_FOOTER, markAnnouncementSeen));
|
|
12449
12449
|
}).catch(() => {});
|
|
12450
12450
|
}, 8000);
|
|
12451
12451
|
}
|
|
@@ -12519,8 +12519,8 @@ var server = async (ctx) => {
|
|
|
12519
12519
|
tryReopenStorage,
|
|
12520
12520
|
rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
|
|
12521
12521
|
onStorageBusyRefusal: async (sessionId, message) => {
|
|
12522
|
-
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-
|
|
12523
|
-
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-
|
|
12522
|
+
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-ygj4mja0.js"));
|
|
12523
|
+
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-hr1ntmjj.js"));
|
|
12524
12524
|
await sendStatusNotification(ctx.client, sessionId, message, {
|
|
12525
12525
|
toastDurationMs: 15000
|
|
12526
12526
|
});
|
|
@@ -12539,7 +12539,12 @@ var server = async (ctx) => {
|
|
|
12539
12539
|
const provId = typed.model?.providerID;
|
|
12540
12540
|
const modId = typed.model?.modelID;
|
|
12541
12541
|
const agent = typed.agent;
|
|
12542
|
-
lastChatContext = provId && modId ? {
|
|
12542
|
+
lastChatContext = provId && modId ? {
|
|
12543
|
+
providerID: provId,
|
|
12544
|
+
modelID: modId,
|
|
12545
|
+
agentName: agent || "default",
|
|
12546
|
+
sessionID: input.sessionID
|
|
12547
|
+
} : null;
|
|
12543
12548
|
shapeV1HiddenMessage(input.sessionID, output.message);
|
|
12544
12549
|
await magicContextRuntime.magicContext?.["chat.message"]?.(input, output);
|
|
12545
12550
|
},
|
|
@@ -12551,7 +12556,7 @@ var server = async (ctx) => {
|
|
|
12551
12556
|
recordToolParameters(typedInput.toolID, typedOutput.parameters);
|
|
12552
12557
|
if (!lastChatContext)
|
|
12553
12558
|
return;
|
|
12554
|
-
recordToolDefinition(lastChatContext.providerID, lastChatContext.modelID, lastChatContext.agentName, typedInput.toolID, typeof typedOutput.description === "string" ? typedOutput.description : "", typedOutput.parameters);
|
|
12559
|
+
recordToolDefinition(lastChatContext.providerID, lastChatContext.modelID, lastChatContext.agentName, typedInput.toolID, typeof typedOutput.description === "string" ? typedOutput.description : "", typedOutput.parameters, lastChatContext.sessionID);
|
|
12555
12560
|
},
|
|
12556
12561
|
"tool.execute.before": async (input, output) => {
|
|
12557
12562
|
await magicContextRuntime.magicContext?.["tool.execute.before"]?.(input, output);
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
messageFtsOrdinalRangeIsMapped2,
|
|
7
7
|
getMessageFtsRowidMapBackfillProgress2,
|
|
8
8
|
deleteUnmappedMessageFtsRows2
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-szf8r0ba.js";
|
|
10
|
+
import"./index-7tdtpqrg.js";
|
|
11
11
|
import"./index-v0p37hm2.js";
|
|
12
12
|
import"./index-t5pck3ss.js";
|
|
13
13
|
import"./index-gzy5w8ya.js";
|
|
@@ -17,20 +17,20 @@ import {
|
|
|
17
17
|
indexMessagesAfterOrdinal2,
|
|
18
18
|
indexSourcesAfterOrdinal2,
|
|
19
19
|
sweepOrphanedOpenCodeMessageIndexesCooperatively2
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-
|
|
20
|
+
} from "./index-awcftgmx.js";
|
|
21
|
+
import"./index-yrrsp47d.js";
|
|
22
22
|
import"./index-whcgcfrv.js";
|
|
23
23
|
import"./index-1zx87sdm.js";
|
|
24
|
-
import"./index-
|
|
24
|
+
import"./index-c9zrgcnt.js";
|
|
25
25
|
import"./index-nxrsns5x.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-3d5wnkq7.js";
|
|
27
27
|
import"./index-wfybj1dw.js";
|
|
28
|
-
import"./index-
|
|
28
|
+
import"./index-szf8r0ba.js";
|
|
29
29
|
import"./index-c7phnbvk.js";
|
|
30
|
-
import"./index-
|
|
30
|
+
import"./index-cfaet9cg.js";
|
|
31
31
|
import"./index-x9k3mqrf.js";
|
|
32
32
|
import"./index-58e3y90n.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-7tdtpqrg.js";
|
|
34
34
|
import"./index-v0p37hm2.js";
|
|
35
35
|
import"./index-t5pck3ss.js";
|
|
36
36
|
import"./index-b88dwwrh.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
markMessageIndexDirty2,
|
|
15
15
|
getIndexableContent2,
|
|
16
16
|
indexSingleMessage2
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-awcftgmx.js";
|
|
18
18
|
import"./index-1zx87sdm.js";
|
|
19
19
|
import"./index-whcgcfrv.js";
|
|
20
20
|
import"./index-b88dwwrh.js";
|
|
@@ -22,14 +22,14 @@ import"./index-x9k3mqrf.js";
|
|
|
22
22
|
import"./index-nxrsns5x.js";
|
|
23
23
|
import"./index-v0p37hm2.js";
|
|
24
24
|
import"./index-cpjk5jd2.js";
|
|
25
|
-
import"./index-
|
|
25
|
+
import"./index-7tdtpqrg.js";
|
|
26
26
|
import"./index-58e3y90n.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
27
|
+
import"./index-c9zrgcnt.js";
|
|
28
|
+
import"./index-yrrsp47d.js";
|
|
29
|
+
import"./index-cfaet9cg.js";
|
|
30
|
+
import"./index-szf8r0ba.js";
|
|
31
31
|
import"./index-wfybj1dw.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-3d5wnkq7.js";
|
|
33
33
|
import"./index-t5pck3ss.js";
|
|
34
34
|
|
|
35
35
|
// src/features/magic-context/message-index-bounded.ts
|
package/dist/migration-worker.js
CHANGED
|
@@ -19,13 +19,13 @@ import"./index-fb3zxn06.js";
|
|
|
19
19
|
import {
|
|
20
20
|
setSqlitePragmaConfig,
|
|
21
21
|
initializeDatabase
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-q7ywt6xt.js";
|
|
23
23
|
import"./index-v0p37hm2.js";
|
|
24
24
|
import"./index-cpjk5jd2.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
25
|
+
import"./index-7tdtpqrg.js";
|
|
26
|
+
import"./index-szf8r0ba.js";
|
|
27
27
|
import"./index-b88dwwrh.js";
|
|
28
|
-
import"./index-
|
|
28
|
+
import"./index-cfaet9cg.js";
|
|
29
29
|
import {
|
|
30
30
|
closeQuietly
|
|
31
31
|
} from "./index-8ajstryz.js";
|