@retaw106/mmc-oc 2.1.0 → 2.1.2
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/{context-vhcstgs3.js → context-gxm0q7tz.js} +65 -49
- package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/{index-dr0gepzw.js → index-cszxqtev.js} +2 -0
- package/dist/{index-n0vnzz6h.js → index-pynrjyjy.js} +1 -1
- package/dist/{index-wtb9hzk6.js → index-ys43j25b.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{read-session-chunk-82rkqa8j.js → read-session-chunk-e4dby3pb.js} +1 -1
- package/dist/{recomp-orchestrator-vc5dkzy2.js → recomp-orchestrator-xg3jm3s2.js} +3 -3
- package/dist/tools/ctx-expand/constants.d.ts +1 -1
- package/dist/tools/ctx-expand/constants.d.ts.map +1 -1
- package/dist/tools/ctx-expand/render.d.ts +3 -2
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/server.js +65 -47
- package/dist/web/context-store.d.ts +2 -0
- package/dist/web/context-store.d.ts.map +1 -1
- package/dist/web/main.js +169 -12
- package/dist/web/ui/panel.css +1 -0
- package/dist/web/ui/panel.js +18 -5
- package/dist/web/views.d.ts +21 -0
- package/dist/web/views.d.ts.map +1 -1
- package/dist/{wrapup-orchestrator-x9xamts2.js → wrapup-orchestrator-9spy01n8.js} +3 -3
- package/package.json +1 -1
- package/src/shared/prompt-surface-a1-golden.md +2 -2
|
@@ -255,7 +255,7 @@ import {
|
|
|
255
255
|
recordHighPressureNoEligibleHead,
|
|
256
256
|
getActiveCompartmentRun,
|
|
257
257
|
startCompartmentAgent
|
|
258
|
-
} from "./index-
|
|
258
|
+
} from "./index-ys43j25b.js";
|
|
259
259
|
import {
|
|
260
260
|
getHarness,
|
|
261
261
|
getDataDir,
|
|
@@ -416,7 +416,7 @@ import {
|
|
|
416
416
|
primeInMemoryTailRawMessageCache2,
|
|
417
417
|
readRawSessionMessageById2,
|
|
418
418
|
readSessionChunk2
|
|
419
|
-
} from "./index-
|
|
419
|
+
} from "./index-cszxqtev.js";
|
|
420
420
|
import {
|
|
421
421
|
getSqliteMemoryStats,
|
|
422
422
|
withSqliteBackgroundWriter,
|
|
@@ -13058,6 +13058,9 @@ function hasRecentAssistantCommit(messages) {
|
|
|
13058
13058
|
}
|
|
13059
13059
|
return false;
|
|
13060
13060
|
}
|
|
13061
|
+
function isVolatileDeepworkTextPart(part) {
|
|
13062
|
+
return isTextPart(part) && isRecord(part) && part.synthetic === true && isRecord(part.metadata) && part.metadata["oh-my-opencode-slim.deepworkGoal"] === true;
|
|
13063
|
+
}
|
|
13061
13064
|
function tagMessages(sessionId, messages, tagger, db, options = {}) {
|
|
13062
13065
|
const protectedThinkingParts = new Set([...options.protectedThinkingMessages ?? []].flatMap((message) => message.parts));
|
|
13063
13066
|
const skipPrefixInjection = options.skipPrefixInjection === true;
|
|
@@ -13114,6 +13117,9 @@ function tagMessages(sessionId, messages, tagger, db, options = {}) {
|
|
|
13114
13117
|
if (message.info.role === "user") {
|
|
13115
13118
|
precedingThinkingParts = [];
|
|
13116
13119
|
}
|
|
13120
|
+
if (message.info.role === "user" && message.parts.length === 1 && isVolatileDeepworkTextPart(message.parts[0])) {
|
|
13121
|
+
continue;
|
|
13122
|
+
}
|
|
13117
13123
|
const messageThinkingParts = message.parts.filter(isThinkingPart);
|
|
13118
13124
|
if (messageThinkingParts.length > 0) {
|
|
13119
13125
|
reasoningByMessage.set(message, messageThinkingParts);
|
|
@@ -13619,6 +13625,8 @@ function applyHeuristicCleanup(sessionId, db, targets, messageTagNumbers, config
|
|
|
13619
13625
|
continue;
|
|
13620
13626
|
const strippedSource = stripTagPrefix(stripped);
|
|
13621
13627
|
if (strippedSource.trim().length === 0) {
|
|
13628
|
+
if (target.thinkingDropProtected)
|
|
13629
|
+
continue;
|
|
13622
13630
|
const dropResult = target.drop?.() ?? "absent";
|
|
13623
13631
|
const replacement = `[dropped §${tag.tagNumber}§]`;
|
|
13624
13632
|
const didReplace = dropResult === "absent" ? target.setContent(replacement) : false;
|
|
@@ -18050,7 +18058,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
18050
18058
|
const db = readDatabase();
|
|
18051
18059
|
if (!db)
|
|
18052
18060
|
return { ok: false, error: "db unavailable" };
|
|
18053
|
-
const { runManagedRecomp } = await import("./recomp-orchestrator-
|
|
18061
|
+
const { runManagedRecomp } = await import("./recomp-orchestrator-xg3jm3s2.js");
|
|
18054
18062
|
const { sendIgnoredMessage } = await import("./send-session-notification-rnc4nrsr.js");
|
|
18055
18063
|
log(`[rpc] recomp requested for session ${sessionId}`);
|
|
18056
18064
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -18100,7 +18108,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
18100
18108
|
const db = readDatabase();
|
|
18101
18109
|
if (!db)
|
|
18102
18110
|
return { ok: false, error: "db unavailable" };
|
|
18103
|
-
const { runManagedWrapup } = await import("./wrapup-orchestrator-
|
|
18111
|
+
const { runManagedWrapup } = await import("./wrapup-orchestrator-9spy01n8.js");
|
|
18104
18112
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
18105
18113
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
18106
18114
|
const ctx = {
|
|
@@ -21890,7 +21898,7 @@ function projectRawMessages(rows, ordinalFor) {
|
|
|
21890
21898
|
`) ?? ""
|
|
21891
21899
|
}
|
|
21892
21900
|
};
|
|
21893
|
-
}) : [{ type: "text", text: row.data.text ?? "" }]
|
|
21901
|
+
}) : row.type === "user" ? restoreRow(row, NO_MODEL)[0]?.content ?? [] : [{ type: "text", text: row.data.text ?? "" }]
|
|
21894
21902
|
};
|
|
21895
21903
|
Object.defineProperty(message, "storeType", { value: row.type, enumerable: false });
|
|
21896
21904
|
if (!hostServesRowById(row))
|
|
@@ -22141,7 +22149,7 @@ Returns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversiz
|
|
|
22141
22149
|
|
|
22142
22150
|
Finer recovery:
|
|
22143
22151
|
- verbose=true lists each message separately with its ordinal and a per-part preview (tool calls with output sizes) so you can pick one.
|
|
22144
|
-
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with mmc_reduce; if the message
|
|
22152
|
+
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with mmc_reduce; if the message is no longer in stored history it says so.`;
|
|
22145
22153
|
var CTX_EXPAND_TOKEN_BUDGET = 15000;
|
|
22146
22154
|
|
|
22147
22155
|
// src/features/magic-context/tag-input.ts
|
|
@@ -22367,7 +22375,7 @@ function renderMessageByOrdinal(sessionId, ordinal) {
|
|
|
22367
22375
|
});
|
|
22368
22376
|
const msg = found[0];
|
|
22369
22377
|
if (!msg) {
|
|
22370
|
-
return `No message at ordinal ${ordinal} in this session's stored history — it
|
|
22378
|
+
return `No message at ordinal ${ordinal} is currently in this session's stored history — ` + `it may have been removed by a session prune/revert, or the ordinal may be wrong. ` + `Re-run the tool if you still need the data.`;
|
|
22371
22379
|
}
|
|
22372
22380
|
const rendered = msg.parts.map(renderPartFull).filter((l) => l !== null);
|
|
22373
22381
|
const lines = [`[${msg.ordinal}] ${roleLabel(msg.role)} — full recovery:`, ""];
|
|
@@ -22440,7 +22448,10 @@ function renderItemByTag(db, sessionId, number, textIndexDomain = "part") {
|
|
|
22440
22448
|
const part = message.parts[index];
|
|
22441
22449
|
const matching = derived ? piText.filter((part) => isRecord4(part) && typeof part.text === "string" && createHash8("sha256").update(part.text).digest("hex") === derived[3]) : [];
|
|
22442
22450
|
const selected = derived ? matching[Number(derived[4])] : textIndexDomain === "text" ? piText[index] : part;
|
|
22443
|
-
|
|
22451
|
+
if (!selected)
|
|
22452
|
+
return `Tag ${number}'s original text part is no longer in stored history.`;
|
|
22453
|
+
const renderedPart = renderPartFull(selected);
|
|
22454
|
+
return renderedPart !== null ? renderedPart : `Tag ${number}'s stored text part has no renderable content (empty or structural-only); the requested content was not recovered.`;
|
|
22444
22455
|
}
|
|
22445
22456
|
|
|
22446
22457
|
// src/tools/ctx-expand/tools.ts
|
|
@@ -22466,52 +22477,57 @@ function createCtxExpandTool(deps) {
|
|
|
22466
22477
|
message: "number"
|
|
22467
22478
|
});
|
|
22468
22479
|
const sessionId = toolContext.sessionID;
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
if (mode.kind === "tag") {
|
|
22474
|
-
return renderItemByTag(deps.db, sessionId, mode.tag);
|
|
22475
|
-
}
|
|
22476
|
-
if (mode.kind === "message") {
|
|
22477
|
-
return renderMessageByOrdinal(sessionId, mode.message);
|
|
22478
|
-
}
|
|
22479
|
-
const { start, end, verbose } = mode;
|
|
22480
|
-
const lastCompartmentEnd = getLastCompartmentEndMessage(deps.db, sessionId);
|
|
22481
|
-
if (lastCompartmentEnd >= 0 && start > lastCompartmentEnd) {
|
|
22482
|
-
return `Range ${start}-${end} is entirely within the live tail (after the last compacted message ${lastCompartmentEnd}); those messages are already visible in context.`;
|
|
22483
|
-
}
|
|
22484
|
-
const effectiveEnd = lastCompartmentEnd >= 0 ? Math.min(end, lastCompartmentEnd) : end;
|
|
22485
|
-
if (verbose) {
|
|
22486
|
-
const v = renderVerboseRange(sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET, deps.expandTools);
|
|
22487
|
-
if (!v.text) {
|
|
22488
|
-
return `No messages found in range ${start}-${effectiveEnd}. The range may be outside this session's history.`;
|
|
22480
|
+
try {
|
|
22481
|
+
const mode = resolveCtxExpandMode(args, "positive");
|
|
22482
|
+
if (mode.kind === "error") {
|
|
22483
|
+
return mode.message;
|
|
22489
22484
|
}
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22485
|
+
if (mode.kind === "tag") {
|
|
22486
|
+
return renderItemByTag(deps.db, sessionId, mode.tag);
|
|
22487
|
+
}
|
|
22488
|
+
if (mode.kind === "message") {
|
|
22489
|
+
return renderMessageByOrdinal(sessionId, mode.message);
|
|
22490
|
+
}
|
|
22491
|
+
const { start, end, verbose } = mode;
|
|
22492
|
+
const lastCompartmentEnd = getLastCompartmentEndMessage(deps.db, sessionId);
|
|
22493
|
+
if (lastCompartmentEnd >= 0 && start > lastCompartmentEnd) {
|
|
22494
|
+
return `Range ${start}-${end} is entirely within the live tail (after the last compacted message ${lastCompartmentEnd}); those messages are already visible in context.`;
|
|
22497
22495
|
}
|
|
22498
|
-
|
|
22496
|
+
const effectiveEnd = lastCompartmentEnd >= 0 ? Math.min(end, lastCompartmentEnd) : end;
|
|
22497
|
+
if (verbose) {
|
|
22498
|
+
const v = renderVerboseRange(sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET, deps.expandTools);
|
|
22499
|
+
if (!v.text) {
|
|
22500
|
+
return `No messages found in range ${start}-${effectiveEnd}. The range may be outside this session's history.`;
|
|
22501
|
+
}
|
|
22502
|
+
const out = [
|
|
22503
|
+
`Messages ${start}-${v.lastOrdinal} (verbose). Recover any one in full with mmc_expand(message=<ordinal>):`,
|
|
22504
|
+
"",
|
|
22505
|
+
v.text
|
|
22506
|
+
];
|
|
22507
|
+
if (v.truncated) {
|
|
22508
|
+
out.push("", `Truncated at message ${v.lastOrdinal} (budget: ~${CTX_EXPAND_TOKEN_BUDGET} tokens). Call again with start=${v.lastOrdinal + 1} end=${effectiveEnd} verbose=true for more.`);
|
|
22509
|
+
}
|
|
22510
|
+
return out.join(`
|
|
22499
22511
|
`);
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
lines.push("");
|
|
22508
|
-
lines.push(chunk.text);
|
|
22509
|
-
if (chunk.endIndex < effectiveEnd) {
|
|
22512
|
+
}
|
|
22513
|
+
const chunk = readSessionChunk2(sessionId, CTX_EXPAND_TOKEN_BUDGET, start, effectiveEnd + 1, { expand: false });
|
|
22514
|
+
if (!chunk.text || chunk.messageCount === 0) {
|
|
22515
|
+
return `No messages found in range ${start}-${end}. The range may be outside this session's history.`;
|
|
22516
|
+
}
|
|
22517
|
+
const lines = [];
|
|
22518
|
+
lines.push(`Messages ${chunk.startIndex}-${chunk.endIndex} (${chunk.messageCount} messages, ~${chunk.tokenEstimate} tokens):`);
|
|
22510
22519
|
lines.push("");
|
|
22511
|
-
lines.push(
|
|
22512
|
-
|
|
22513
|
-
|
|
22520
|
+
lines.push(chunk.text);
|
|
22521
|
+
if (chunk.endIndex < effectiveEnd) {
|
|
22522
|
+
lines.push("");
|
|
22523
|
+
lines.push(`Truncated at message ${chunk.endIndex} (budget: ~${CTX_EXPAND_TOKEN_BUDGET} tokens). Call again with start=${chunk.endIndex + 1} end=${effectiveEnd} for more.`);
|
|
22524
|
+
}
|
|
22525
|
+
return lines.join(`
|
|
22514
22526
|
`);
|
|
22527
|
+
} catch (error) {
|
|
22528
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
22529
|
+
return `Error: mmc_expand failed to read this session's stored history: ${message}`;
|
|
22530
|
+
}
|
|
22515
22531
|
}
|
|
22516
22532
|
});
|
|
22517
22533
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heuristic-cleanup.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/heuristic-cleanup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAY5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,EAAuB,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,CAAC,EAAE,QAAQ,EAAE,GAC3B;IACC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,wBAAwB,EAAE,MAAM,CAAC;IACjC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;CACnD,CA6SA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-session-true-raw-tokens.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-true-raw-tokens.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACnC,oBAAoB,EAAE,aAAa,GAAG,cAAc,CAAC;IACrD,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC;CACnD;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACnD,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACjD,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAClE,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACjD,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9F;AAED,MAAM,WAAW,OAAO;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,iGAAiG;AACjG,wBAAgB,+BAA+B,CAC3C,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAET;AAED,MAAM,WAAW,6BAA8B,SAAQ,sBAAsB;IACzE,cAAc,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,WAAW,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9E;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,GAAG,IAAI,CAAC;IAC/D;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"read-session-true-raw-tokens.d.ts","sourceRoot":"","sources":["../../../src/hooks/magic-context/read-session-true-raw-tokens.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;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;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAC;IACrD;;;;OAIG;IACH,cAAc,CAAC,EAAE,WAAW,EAAE,CAAC;IAC/B,oEAAoE;IACpE,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACzE;AAID;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAYlF;AAYD,wBAAgB,WAAW,CACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,kBAAuB,GACjC,iBAAiB,CA8lBnB"}
|
|
@@ -4363,6 +4363,8 @@ function estimateNonToolPart(part, options, breakdown) {
|
|
|
4363
4363
|
addBreakdown(breakdown, "reasoning", estimateTokens(reasoningText));
|
|
4364
4364
|
return true;
|
|
4365
4365
|
}
|
|
4366
|
+
if (type === "media" && part.mediaType === "application/pdf")
|
|
4367
|
+
return true;
|
|
4366
4368
|
if (looksImageLike(part)) {
|
|
4367
4369
|
addBreakdown(breakdown, "image", options.imageTokenHeuristic?.(part) ?? defaultImageTokenHeuristic(part));
|
|
4368
4370
|
const altText = firstStringField(part, ["alt", "text", "description"]);
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
getRawSessionTagKeysThrough2,
|
|
73
73
|
getLegacyProtectedTailStartOrdinal2,
|
|
74
74
|
readSessionChunk2
|
|
75
|
-
} from "./index-
|
|
75
|
+
} from "./index-cszxqtev.js";
|
|
76
76
|
import {
|
|
77
77
|
piModelRefToCanonical,
|
|
78
78
|
modelRefLookupOrder,
|
|
@@ -11532,7 +11532,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
11532
11532
|
startMessageFtsRowidMapBackfill(db).then(async () => {
|
|
11533
11533
|
if (!readsOpenCodeStore)
|
|
11534
11534
|
return;
|
|
11535
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await import("./read-session-chunk-
|
|
11535
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await import("./read-session-chunk-e4dby3pb.js");
|
|
11536
11536
|
const { startMessageTimeBackfill } = await import("./message-time-backfill-phrwp2fz.js");
|
|
11537
11537
|
await startMessageTimeBackfill(db, Object.assign(readRawSessionMessages, {
|
|
11538
11538
|
readPage: readRawSessionMessagePage
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ async function setup(context) {
|
|
|
16
16
|
log("v2 setup() called on a host without session.hook; v1 server lane owns this host, v2 lane inert");
|
|
17
17
|
return async () => {};
|
|
18
18
|
}
|
|
19
|
-
const { registerContext } = await import("./context-
|
|
19
|
+
const { registerContext } = await import("./context-gxm0q7tz.js");
|
|
20
20
|
setHarness("opencode2");
|
|
21
21
|
const duties = await registerContext(context);
|
|
22
22
|
log("[magic-context] @retaw106/mmc-oc v2 setup");
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
getRawSessionTagKeysThrough2,
|
|
24
24
|
getLegacyProtectedTailStartOrdinal2,
|
|
25
25
|
readSessionChunk2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-cszxqtev.js";
|
|
27
27
|
import"./index-ramz5kkm.js";
|
|
28
28
|
import"./index-1j34a56j.js";
|
|
29
29
|
import"./index-x37vg474.js";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
setRecompStarting2,
|
|
3
3
|
setRecompTerminal2,
|
|
4
4
|
runManagedRecomp2
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
5
|
+
} from "./index-pynrjyjy.js";
|
|
6
|
+
import"./index-ys43j25b.js";
|
|
7
7
|
import"./index-amycb7b1.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-cszxqtev.js";
|
|
9
9
|
import"./index-ramz5kkm.js";
|
|
10
10
|
import"./index-33gprt9g.js";
|
|
11
11
|
import"./index-1j34a56j.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const CTX_EXPAND_DESCRIPTION = "Recover original content that is no longer on your desk. It takes two kinds of number, and they are never interchangeable:\n- `tag=N`: the number from a \u00A7N\u00A7 tag or a `[dropped \u00A7N\u00A7]` placeholder. Returns that one item whole: a text, or a tool call with its full input and output.\n- `message=N`, `start`/`end`: message ordinals, the positions shown in `<session-history>` headings (`## start-end`) and in `mmc_search` hits. An ordinal counts whole messages; a tag counts each text and tool result separately, so the same number points at different things.\n\nEarlier turns are summarized in <session-history> under `## start-end \u00B7 date \u00B7 title` headings; each heading stands for the raw messages in that ordinal range. When the summary isn't enough \u2014 exact wording, a value, an error message, the reasoning behind a decision \u2014 expand the range: mmc_expand(start=120, end=245). Also works around a mmc_search message hit: start=N-10, end=N+5. Ranges after the last compartment are your live tail \u2014 already visible, not expandable.\n\nReturns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversized range returns the head and says where to continue.\n\nFiner recovery:\n- verbose=true lists each message separately with its ordinal and a per-part preview (tool calls with output sizes) so you can pick one.\n- message=N returns that one message in full \u2014 every text part and every tool call's complete input and output \u2014 from stored history. This is the way back to a tool output you released with mmc_reduce; if the message
|
|
1
|
+
export declare const CTX_EXPAND_DESCRIPTION = "Recover original content that is no longer on your desk. It takes two kinds of number, and they are never interchangeable:\n- `tag=N`: the number from a \u00A7N\u00A7 tag or a `[dropped \u00A7N\u00A7]` placeholder. Returns that one item whole: a text, or a tool call with its full input and output.\n- `message=N`, `start`/`end`: message ordinals, the positions shown in `<session-history>` headings (`## start-end`) and in `mmc_search` hits. An ordinal counts whole messages; a tag counts each text and tool result separately, so the same number points at different things.\n\nEarlier turns are summarized in <session-history> under `## start-end \u00B7 date \u00B7 title` headings; each heading stands for the raw messages in that ordinal range. When the summary isn't enough \u2014 exact wording, a value, an error message, the reasoning behind a decision \u2014 expand the range: mmc_expand(start=120, end=245). Also works around a mmc_search message hit: start=N-10, end=N+5. Ranges after the last compartment are your live tail \u2014 already visible, not expandable.\n\nReturns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversized range returns the head and says where to continue.\n\nFiner recovery:\n- verbose=true lists each message separately with its ordinal and a per-part preview (tool calls with output sizes) so you can pick one.\n- message=N returns that one message in full \u2014 every text part and every tool call's complete input and output \u2014 from stored history. This is the way back to a tool output you released with mmc_reduce; if the message is no longer in stored history it says so.";
|
|
2
2
|
export declare const CTX_EXPAND_TOKEN_BUDGET = 15000;
|
|
3
3
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,2mDAUiO,CAAC;AAErQ,eAAO,MAAM,uBAAuB,QAAS,CAAC"}
|
|
@@ -25,8 +25,9 @@ import type { ToolExpansionMap } from "../../shared/historian-tool-template";
|
|
|
25
25
|
/**
|
|
26
26
|
* Full untruncated recovery of one message by its ORDINAL — the same `[N]`
|
|
27
27
|
* identifier the agent already uses everywhere (compartment start/end, mmc_search
|
|
28
|
-
* hits, the verbose range view). Returns a
|
|
29
|
-
* at that ordinal (pruned/reverted or wrong ordinal)
|
|
28
|
+
* hits, the verbose range view). Returns a not-found message when no message
|
|
29
|
+
* sits at that ordinal (pruned/reverted or wrong ordinal) — stated as absence
|
|
30
|
+
* from stored history, never as permanent deletion.
|
|
30
31
|
*/
|
|
31
32
|
export declare function renderMessageByOrdinal(sessionId: string, ordinal: number): string;
|
|
32
33
|
export interface VerboseRangeResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,sCAAsC,CAAC;AAQxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAkM7E
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,KAAK,eAAe,EAAc,MAAM,sCAAsC,CAAC;AAQxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAkM7E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBjF;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,gBAAgB,GAC/B,kBAAkB,CA2BpB;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAC3B,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,eAAe,GAAE,MAAM,GAAG,MAAe,GAC1C,MAAM,CA+DR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;IACpB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAClC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-expand/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,eAAe,CAAC;IACpB,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAClC;AA2ID,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,KAAK,EACR,UAAU,EACV,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EAClB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAGH,KAAK,QAAQ,EACb,KAAK,aAAa,EACrB,MAAM,iBAAiB,CAAC;AAWzB;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAExD;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks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AClB,yBAAyB,CAoB3B"}
|
package/dist/v2/server.js
CHANGED
|
@@ -20974,6 +20974,8 @@ function estimateNonToolPart(part, options, breakdown) {
|
|
|
20974
20974
|
addBreakdown(breakdown, "reasoning", estimateTokens(reasoningText));
|
|
20975
20975
|
return true;
|
|
20976
20976
|
}
|
|
20977
|
+
if (type === "media" && part.mediaType === "application/pdf")
|
|
20978
|
+
return true;
|
|
20977
20979
|
if (looksImageLike(part)) {
|
|
20978
20980
|
addBreakdown(breakdown, "image", options.imageTokenHeuristic?.(part) ?? defaultImageTokenHeuristic(part));
|
|
20979
20981
|
const altText = firstStringField(part, ["alt", "text", "description"]);
|
|
@@ -52382,6 +52384,9 @@ function hasRecentAssistantCommit(messages) {
|
|
|
52382
52384
|
}
|
|
52383
52385
|
return false;
|
|
52384
52386
|
}
|
|
52387
|
+
function isVolatileDeepworkTextPart(part) {
|
|
52388
|
+
return isTextPart(part) && isRecord2(part) && part.synthetic === true && isRecord2(part.metadata) && part.metadata["oh-my-opencode-slim.deepworkGoal"] === true;
|
|
52389
|
+
}
|
|
52385
52390
|
function tagMessages(sessionId, messages, tagger, db, options = {}) {
|
|
52386
52391
|
const protectedThinkingParts = new Set([...options.protectedThinkingMessages ?? []].flatMap((message) => message.parts));
|
|
52387
52392
|
const skipPrefixInjection = options.skipPrefixInjection === true;
|
|
@@ -52438,6 +52443,9 @@ function tagMessages(sessionId, messages, tagger, db, options = {}) {
|
|
|
52438
52443
|
if (message.info.role === "user") {
|
|
52439
52444
|
precedingThinkingParts = [];
|
|
52440
52445
|
}
|
|
52446
|
+
if (message.info.role === "user" && message.parts.length === 1 && isVolatileDeepworkTextPart(message.parts[0])) {
|
|
52447
|
+
continue;
|
|
52448
|
+
}
|
|
52441
52449
|
const messageThinkingParts = message.parts.filter(isThinkingPart);
|
|
52442
52450
|
if (messageThinkingParts.length > 0) {
|
|
52443
52451
|
reasoningByMessage.set(message, messageThinkingParts);
|
|
@@ -52961,6 +52969,8 @@ function applyHeuristicCleanup(sessionId, db, targets, messageTagNumbers, config
|
|
|
52961
52969
|
continue;
|
|
52962
52970
|
const strippedSource = stripTagPrefix(stripped);
|
|
52963
52971
|
if (strippedSource.trim().length === 0) {
|
|
52972
|
+
if (target.thinkingDropProtected)
|
|
52973
|
+
continue;
|
|
52964
52974
|
const dropResult = target.drop?.() ?? "absent";
|
|
52965
52975
|
const replacement = `[dropped §${tag.tagNumber}§]`;
|
|
52966
52976
|
const didReplace = dropResult === "absent" ? target.setContent(replacement) : false;
|
|
@@ -62157,7 +62167,7 @@ function projectRawMessages(rows, ordinalFor) {
|
|
|
62157
62167
|
`) ?? ""
|
|
62158
62168
|
}
|
|
62159
62169
|
};
|
|
62160
|
-
}) : [{ type: "text", text: row.data.text ?? "" }]
|
|
62170
|
+
}) : row.type === "user" ? restoreRow(row, NO_MODEL)[0]?.content ?? [] : [{ type: "text", text: row.data.text ?? "" }]
|
|
62161
62171
|
};
|
|
62162
62172
|
Object.defineProperty(message, "storeType", { value: row.type, enumerable: false });
|
|
62163
62173
|
if (!hostServesRowById(row))
|
|
@@ -75070,7 +75080,7 @@ Returns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversiz
|
|
|
75070
75080
|
|
|
75071
75081
|
Finer recovery:
|
|
75072
75082
|
- verbose=true lists each message separately with its ordinal and a per-part preview (tool calls with output sizes) so you can pick one.
|
|
75073
|
-
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with mmc_reduce; if the message
|
|
75083
|
+
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with mmc_reduce; if the message is no longer in stored history it says so.`, CTX_EXPAND_TOKEN_BUDGET = 15000;
|
|
75074
75084
|
|
|
75075
75085
|
// src/features/magic-context/tag-input.ts
|
|
75076
75086
|
function parseTagInput(value) {
|
|
@@ -75296,7 +75306,7 @@ function renderMessageByOrdinal(sessionId, ordinal) {
|
|
|
75296
75306
|
});
|
|
75297
75307
|
const msg = found[0];
|
|
75298
75308
|
if (!msg) {
|
|
75299
|
-
return `No message at ordinal ${ordinal} in this session's stored history — it
|
|
75309
|
+
return `No message at ordinal ${ordinal} is currently in this session's stored history — ` + `it may have been removed by a session prune/revert, or the ordinal may be wrong. ` + `Re-run the tool if you still need the data.`;
|
|
75300
75310
|
}
|
|
75301
75311
|
const rendered = msg.parts.map(renderPartFull).filter((l) => l !== null);
|
|
75302
75312
|
const lines = [`[${msg.ordinal}] ${roleLabel(msg.role)} — full recovery:`, ""];
|
|
@@ -75369,7 +75379,10 @@ function renderItemByTag(db, sessionId, number, textIndexDomain = "part") {
|
|
|
75369
75379
|
const part = message.parts[index];
|
|
75370
75380
|
const matching = derived ? piText.filter((part) => isRecord7(part) && typeof part.text === "string" && createHash22("sha256").update(part.text).digest("hex") === derived[3]) : [];
|
|
75371
75381
|
const selected = derived ? matching[Number(derived[4])] : textIndexDomain === "text" ? piText[index] : part;
|
|
75372
|
-
|
|
75382
|
+
if (!selected)
|
|
75383
|
+
return `Tag ${number}'s original text part is no longer in stored history.`;
|
|
75384
|
+
const renderedPart = renderPartFull(selected);
|
|
75385
|
+
return renderedPart !== null ? renderedPart : `Tag ${number}'s stored text part has no renderable content (empty or structural-only); the requested content was not recovered.`;
|
|
75373
75386
|
}
|
|
75374
75387
|
var init_render = __esm(async () => {
|
|
75375
75388
|
init_read_session_formatting();
|
|
@@ -75395,52 +75408,57 @@ function createCtxExpandTool(deps) {
|
|
|
75395
75408
|
message: "number"
|
|
75396
75409
|
});
|
|
75397
75410
|
const sessionId = toolContext.sessionID;
|
|
75398
|
-
|
|
75399
|
-
|
|
75400
|
-
|
|
75401
|
-
|
|
75402
|
-
|
|
75403
|
-
|
|
75404
|
-
|
|
75405
|
-
|
|
75406
|
-
|
|
75407
|
-
|
|
75408
|
-
|
|
75409
|
-
|
|
75410
|
-
|
|
75411
|
-
|
|
75412
|
-
|
|
75413
|
-
|
|
75414
|
-
|
|
75415
|
-
|
|
75416
|
-
|
|
75417
|
-
|
|
75418
|
-
|
|
75419
|
-
|
|
75420
|
-
|
|
75421
|
-
|
|
75422
|
-
|
|
75423
|
-
|
|
75424
|
-
|
|
75425
|
-
|
|
75426
|
-
|
|
75427
|
-
|
|
75411
|
+
try {
|
|
75412
|
+
const mode = resolveCtxExpandMode(args, "positive");
|
|
75413
|
+
if (mode.kind === "error") {
|
|
75414
|
+
return mode.message;
|
|
75415
|
+
}
|
|
75416
|
+
if (mode.kind === "tag") {
|
|
75417
|
+
return renderItemByTag(deps.db, sessionId, mode.tag);
|
|
75418
|
+
}
|
|
75419
|
+
if (mode.kind === "message") {
|
|
75420
|
+
return renderMessageByOrdinal(sessionId, mode.message);
|
|
75421
|
+
}
|
|
75422
|
+
const { start, end, verbose } = mode;
|
|
75423
|
+
const lastCompartmentEnd = getLastCompartmentEndMessage(deps.db, sessionId);
|
|
75424
|
+
if (lastCompartmentEnd >= 0 && start > lastCompartmentEnd) {
|
|
75425
|
+
return `Range ${start}-${end} is entirely within the live tail (after the last compacted message ${lastCompartmentEnd}); those messages are already visible in context.`;
|
|
75426
|
+
}
|
|
75427
|
+
const effectiveEnd = lastCompartmentEnd >= 0 ? Math.min(end, lastCompartmentEnd) : end;
|
|
75428
|
+
if (verbose) {
|
|
75429
|
+
const v = renderVerboseRange(sessionId, start, effectiveEnd, CTX_EXPAND_TOKEN_BUDGET, deps.expandTools);
|
|
75430
|
+
if (!v.text) {
|
|
75431
|
+
return `No messages found in range ${start}-${effectiveEnd}. The range may be outside this session's history.`;
|
|
75432
|
+
}
|
|
75433
|
+
const out = [
|
|
75434
|
+
`Messages ${start}-${v.lastOrdinal} (verbose). Recover any one in full with mmc_expand(message=<ordinal>):`,
|
|
75435
|
+
"",
|
|
75436
|
+
v.text
|
|
75437
|
+
];
|
|
75438
|
+
if (v.truncated) {
|
|
75439
|
+
out.push("", `Truncated at message ${v.lastOrdinal} (budget: ~${CTX_EXPAND_TOKEN_BUDGET} tokens). Call again with start=${v.lastOrdinal + 1} end=${effectiveEnd} verbose=true for more.`);
|
|
75440
|
+
}
|
|
75441
|
+
return out.join(`
|
|
75428
75442
|
`);
|
|
75429
|
-
|
|
75430
|
-
|
|
75431
|
-
|
|
75432
|
-
|
|
75433
|
-
|
|
75434
|
-
|
|
75435
|
-
|
|
75436
|
-
lines.push("");
|
|
75437
|
-
lines.push(chunk.text);
|
|
75438
|
-
if (chunk.endIndex < effectiveEnd) {
|
|
75443
|
+
}
|
|
75444
|
+
const chunk = readSessionChunk(sessionId, CTX_EXPAND_TOKEN_BUDGET, start, effectiveEnd + 1, { expand: false });
|
|
75445
|
+
if (!chunk.text || chunk.messageCount === 0) {
|
|
75446
|
+
return `No messages found in range ${start}-${end}. The range may be outside this session's history.`;
|
|
75447
|
+
}
|
|
75448
|
+
const lines = [];
|
|
75449
|
+
lines.push(`Messages ${chunk.startIndex}-${chunk.endIndex} (${chunk.messageCount} messages, ~${chunk.tokenEstimate} tokens):`);
|
|
75439
75450
|
lines.push("");
|
|
75440
|
-
lines.push(
|
|
75441
|
-
|
|
75442
|
-
|
|
75451
|
+
lines.push(chunk.text);
|
|
75452
|
+
if (chunk.endIndex < effectiveEnd) {
|
|
75453
|
+
lines.push("");
|
|
75454
|
+
lines.push(`Truncated at message ${chunk.endIndex} (budget: ~${CTX_EXPAND_TOKEN_BUDGET} tokens). Call again with start=${chunk.endIndex + 1} end=${effectiveEnd} for more.`);
|
|
75455
|
+
}
|
|
75456
|
+
return lines.join(`
|
|
75443
75457
|
`);
|
|
75458
|
+
} catch (error) {
|
|
75459
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
75460
|
+
return `Error: mmc_expand failed to read this session's stored history: ${message}`;
|
|
75461
|
+
}
|
|
75444
75462
|
}
|
|
75445
75463
|
});
|
|
75446
75464
|
}
|
|
@@ -51,6 +51,8 @@ export interface WebSessionRef {
|
|
|
51
51
|
harness: string;
|
|
52
52
|
lastActivityAt: number | null;
|
|
53
53
|
compartmentCount: number;
|
|
54
|
+
/** Persisted/default processing eligibility, not proof of current use or health. */
|
|
55
|
+
processingEligibility: "primary" | "reduced-subagent" | "unknown";
|
|
54
56
|
}
|
|
55
57
|
export interface ProjectSessionRef {
|
|
56
58
|
projectPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-store.d.ts","sourceRoot":"","sources":["../../src/web/context-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAmB,MAAM,SAAS,CAAC;AAEtF,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;CAC3C;AAED,MAAM,MAAM,sBAAsB,GAC5B;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,GACnD;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAEpD,kFAAkF;AAClF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CA+C/E;AAED,MAAM,WAAW,iBAAiB;IAC9B,wFAAwF;IACxF,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,2FAA2F;IAC3F,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,UAAU,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,iBAAiB,EAAE,CAkD3E;AAED,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,C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EAAE,MAAM,CAAC;IACzB,oFAAoF;IACpF,qBAAqB,EAAE,SAAS,GAAG,kBAAkB,GAAG,SAAS,CAAC;CACrE;AAED,MAAM,WAAW,iBAAiB;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,eAAe,GAAG,iBAAiB,EAAE,CAuBlF;AAED,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,GAAG,aAAa,EAAE,CAqChG;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,qGAAqG;AACrG,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAChB,cAAc,EAAE,CAqClB"}
|
package/dist/web/main.js
CHANGED
|
@@ -3149,7 +3149,9 @@ function listProjectSessions(store, projectPath) {
|
|
|
3149
3149
|
sp.harness AS harness,
|
|
3150
3150
|
MAX(sp.updated_at) AS last_activity,
|
|
3151
3151
|
(SELECT COUNT(*) FROM compartments c
|
|
3152
|
-
WHERE c.session_id = sp.session_id AND c.harness = sp.harness) AS compartment_count
|
|
3152
|
+
WHERE c.session_id = sp.session_id AND c.harness = sp.harness) AS compartment_count,
|
|
3153
|
+
(SELECT is_subagent FROM session_meta sm
|
|
3154
|
+
WHERE sm.session_id = sp.session_id LIMIT 1) AS is_subagent
|
|
3153
3155
|
FROM session_projects sp
|
|
3154
3156
|
WHERE sp.project_path = ?
|
|
3155
3157
|
GROUP BY sp.session_id, sp.harness
|
|
@@ -3159,7 +3161,8 @@ function listProjectSessions(store, projectPath) {
|
|
|
3159
3161
|
sessionId: r.session_id,
|
|
3160
3162
|
harness: r.harness,
|
|
3161
3163
|
lastActivityAt: typeof r.last_activity === "number" ? r.last_activity : null,
|
|
3162
|
-
compartmentCount: typeof r.compartment_count === "number" ? r.compartment_count : 0
|
|
3164
|
+
compartmentCount: typeof r.compartment_count === "number" ? r.compartment_count : 0,
|
|
3165
|
+
processingEligibility: r.is_subagent === 1 ? "reduced-subagent" : r.is_subagent === 0 ? "primary" : "unknown"
|
|
3163
3166
|
};
|
|
3164
3167
|
});
|
|
3165
3168
|
}
|
|
@@ -3371,6 +3374,7 @@ function seedContextDb(dbPath, options) {
|
|
|
3371
3374
|
initializeDatabase(db);
|
|
3372
3375
|
runMigrations(db);
|
|
3373
3376
|
seedSessionProjects(db);
|
|
3377
|
+
seedPanelSessionFacts(db);
|
|
3374
3378
|
seedCompartments(db);
|
|
3375
3379
|
seedNotes(db);
|
|
3376
3380
|
seedMemories(db);
|
|
@@ -3381,6 +3385,19 @@ function seedContextDb(dbPath, options) {
|
|
|
3381
3385
|
db.close();
|
|
3382
3386
|
}
|
|
3383
3387
|
}
|
|
3388
|
+
function seedPanelSessionFacts(db) {
|
|
3389
|
+
const meta = db.prepare("INSERT INTO session_meta (session_id, harness, is_subagent) VALUES (?, ?, ?)");
|
|
3390
|
+
meta.run(FIXTURE_SEED.oc2Session, "opencode2", 0);
|
|
3391
|
+
meta.run(FIXTURE_SEED.treeChainRoot, "opencode2", 0);
|
|
3392
|
+
meta.run(FIXTURE_SEED.treeChainChild, "opencode2", 1);
|
|
3393
|
+
meta.run(FIXTURE_SEED.treeChainGrandchild, "opencode2", 1);
|
|
3394
|
+
meta.run(FIXTURE_SEED.piSessionId, "pi", 1);
|
|
3395
|
+
const tags = db.prepare("INSERT INTO tags (session_id, message_id, type, status, byte_size, tag_number, harness) VALUES (?, ?, 'message', 'active', 10, ?, ?)");
|
|
3396
|
+
tags.run(FIXTURE_SEED.oc2Session, "msg_fixture_u1:p0", 101, "opencode2");
|
|
3397
|
+
tags.run(FIXTURE_SEED.oc2Session, "msg_fixture_a4:p0", 102, "opencode2");
|
|
3398
|
+
tags.run(FIXTURE_SEED.piSessionId, "aaaaaaaa:p0", 201, "pi");
|
|
3399
|
+
db.prepare("INSERT INTO tags (session_id, message_id, type, status, byte_size, tag_number, harness, tool_owner_message_id) VALUES (?, ?, 'tool', 'active', 10, ?, ?, ?)").run(FIXTURE_SEED.piSessionId, "call-pi-1", 202, "pi", "bbbbbbbb");
|
|
3400
|
+
}
|
|
3384
3401
|
function seedSessionProjects(db) {
|
|
3385
3402
|
const insert = db.prepare("INSERT INTO session_projects (session_id, harness, project_path, updated_at) VALUES (?, ?, ?, ?)");
|
|
3386
3403
|
insert.run(FIXTURE_SEED.oc2Session, "opencode2", FIXTURE_SEED.projectCore, T0 + 9000);
|
|
@@ -3523,7 +3540,8 @@ function seedOc2Store(dbPath, generation) {
|
|
|
3523
3540
|
}
|
|
3524
3541
|
var PI_BRANCH_FILES = [
|
|
3525
3542
|
"2026-01-01T00-00-07-000Z_f1a0c0de-0000-4000-8000-000000000001.jsonl",
|
|
3526
|
-
"2026-01-01T00-00-09-000Z_f1a0c0de-0000-4000-8000-000000000001.jsonl"
|
|
3543
|
+
"2026-01-01T00-00-09-000Z_f1a0c0de-0000-4000-8000-000000000001.jsonl",
|
|
3544
|
+
"2026-01-01T00-00-11-000Z_f1a0c0de-0000-4000-8000-000000000001.jsonl"
|
|
3527
3545
|
];
|
|
3528
3546
|
function seedPiSessions(sessionsRoot) {
|
|
3529
3547
|
const dir = join4(sessionsRoot, "--fixture-project--");
|
|
@@ -3576,6 +3594,21 @@ function seedPiSessions(sessionsRoot) {
|
|
|
3576
3594
|
}),
|
|
3577
3595
|
""
|
|
3578
3596
|
].join(`
|
|
3597
|
+
`));
|
|
3598
|
+
writeFileSync(join4(dir, PI_BRANCH_FILES[2]), [
|
|
3599
|
+
header,
|
|
3600
|
+
entry("orphan-result", null, "toolResult", {
|
|
3601
|
+
toolCallId: "call-pi-1",
|
|
3602
|
+
content: [
|
|
3603
|
+
{
|
|
3604
|
+
type: "tool",
|
|
3605
|
+
callID: "call-pi-1",
|
|
3606
|
+
state: { output: "fixture: 无法可靠归属的结果" }
|
|
3607
|
+
}
|
|
3608
|
+
]
|
|
3609
|
+
}),
|
|
3610
|
+
""
|
|
3611
|
+
].join(`
|
|
3579
3612
|
`));
|
|
3580
3613
|
writeFileSync(join4(dir, "2026-01-01T00-10-00-000Z_f1a0c0de-0000-4000-8000-000000000002.jsonl"), [
|
|
3581
3614
|
headerFor(FIXTURE_SEED.piTreeSessionId, "2026-01-01T00:10:00.000Z"),
|
|
@@ -5022,7 +5055,7 @@ function projectRawMessages(rows, ordinalFor) {
|
|
|
5022
5055
|
`) ?? ""
|
|
5023
5056
|
}
|
|
5024
5057
|
};
|
|
5025
|
-
}) : [{ type: "text", text: row.data.text ?? "" }]
|
|
5058
|
+
}) : row.type === "user" ? restoreRow(row, NO_MODEL)[0]?.content ?? [] : [{ type: "text", text: row.data.text ?? "" }]
|
|
5026
5059
|
};
|
|
5027
5060
|
Object.defineProperty(message, "storeType", { value: row.type, enumerable: false });
|
|
5028
5061
|
if (!hostServesRowById(row))
|
|
@@ -5209,6 +5242,9 @@ function listProjectSessionViews(sources, projectPath, options = {}) {
|
|
|
5209
5242
|
title,
|
|
5210
5243
|
parentId: meta?.parentId ?? null,
|
|
5211
5244
|
forkSessionId: meta?.forkSessionId ?? null,
|
|
5245
|
+
registered: true,
|
|
5246
|
+
childIdentity: isPi || !meta ? "unknown" : meta.parentId ? "child" : "root",
|
|
5247
|
+
processingEligibility: row.processingEligibility,
|
|
5212
5248
|
hostTimeCreated: meta?.timeCreated ?? null,
|
|
5213
5249
|
hostTimeUpdated: meta?.timeUpdated ?? null,
|
|
5214
5250
|
maintenance: isPi ? null : classifyMaintenance(title),
|
|
@@ -5433,6 +5469,7 @@ function oc2MessagePage(sources, sessionId, options) {
|
|
|
5433
5469
|
}
|
|
5434
5470
|
const last = kept.at(-1);
|
|
5435
5471
|
const partsById = new Map(rawMessagePage(kept, 0).map((message) => [message.id, message.parts]));
|
|
5472
|
+
const tagNumbers = tagNumbersByMessageId(sources, sessionId, kept.map((row) => row.id), new Map(kept.map((row) => [row.id, extractToolCallIds(partsById.get(row.id))])));
|
|
5436
5473
|
return {
|
|
5437
5474
|
source: "oc2-host",
|
|
5438
5475
|
rows: kept.map((row) => ({
|
|
@@ -5440,7 +5477,12 @@ function oc2MessagePage(sources, sessionId, options) {
|
|
|
5440
5477
|
id: row.id,
|
|
5441
5478
|
role: row.type,
|
|
5442
5479
|
timeCreated: typeof row.time_created === "number" ? row.time_created : null,
|
|
5443
|
-
parts: truncateParts(partsById.get(row.id), outputLimit)
|
|
5480
|
+
parts: truncateParts(partsById.get(row.id), outputLimit),
|
|
5481
|
+
coordinates: {
|
|
5482
|
+
hostSeq: row.seq,
|
|
5483
|
+
rawOrdinal: reader.messageOrdinalById(sessionId, row.id),
|
|
5484
|
+
tagNumbers: tagNumbers.get(row.id) ?? null
|
|
5485
|
+
}
|
|
5444
5486
|
})),
|
|
5445
5487
|
nextAfter: last ? last.seq : options.after ?? null,
|
|
5446
5488
|
hasMore
|
|
@@ -5468,6 +5510,7 @@ function piMessagePage(sources, sessionId, options) {
|
|
|
5468
5510
|
const end = options.end;
|
|
5469
5511
|
const selected = projection.messages.filter((message) => message.ordinal > after && (end === undefined || message.ordinal <= end));
|
|
5470
5512
|
const page = selected.slice(0, limit);
|
|
5513
|
+
const tagNumbers = tagNumbersByMessageId(sources, sessionId, page.map((message) => message.id), new Map(page.map((message) => [message.id, extractToolCallIds(message.parts)])));
|
|
5471
5514
|
return {
|
|
5472
5515
|
source: "pi-jsonl",
|
|
5473
5516
|
branch: { fileName: file.fileName, directoryName: file.directoryName },
|
|
@@ -5476,12 +5519,96 @@ function piMessagePage(sources, sessionId, options) {
|
|
|
5476
5519
|
id: message.id,
|
|
5477
5520
|
role: message.role,
|
|
5478
5521
|
timeCreated: null,
|
|
5479
|
-
parts: truncateParts(message.parts, outputLimit)
|
|
5522
|
+
parts: truncateParts(message.parts, outputLimit),
|
|
5523
|
+
coordinates: {
|
|
5524
|
+
hostSeq: null,
|
|
5525
|
+
rawOrdinal: message.ordinal,
|
|
5526
|
+
tagNumbers: tagNumbers.get(message.id) ?? null
|
|
5527
|
+
}
|
|
5480
5528
|
})),
|
|
5481
5529
|
nextAfter: page.length > 0 ? page[page.length - 1].ordinal : after,
|
|
5482
5530
|
hasMore: selected.length > limit
|
|
5483
5531
|
};
|
|
5484
5532
|
}
|
|
5533
|
+
function tagNumbersByMessageId(sources, sessionId, messageIds, toolCallIdsByMessageId = new Map) {
|
|
5534
|
+
const result = new Map(messageIds.map((id) => [id, []]));
|
|
5535
|
+
const uncertain = new Set;
|
|
5536
|
+
const opened = openContextFor(sources);
|
|
5537
|
+
if (!opened.store)
|
|
5538
|
+
return new Map(messageIds.map((id) => [id, null]));
|
|
5539
|
+
try {
|
|
5540
|
+
for (let offset = 0;offset < messageIds.length; offset += 100) {
|
|
5541
|
+
const batch = messageIds.slice(offset, offset + 100);
|
|
5542
|
+
if (batch.length === 0)
|
|
5543
|
+
continue;
|
|
5544
|
+
const predicates = batch.map(() => "(message_id = ? OR (message_id >= ? AND message_id < ?) OR tool_owner_message_id = ?)").join(" OR ");
|
|
5545
|
+
const parameters = batch.flatMap((id) => [id, `${id}:`, `${id};`, id]);
|
|
5546
|
+
const rows = opened.store.db.prepare(`SELECT tag_number, type, message_id, tool_owner_message_id
|
|
5547
|
+
FROM tags
|
|
5548
|
+
WHERE session_id = ? AND tag_number IS NOT NULL AND (${predicates})`).all(sessionId, ...parameters);
|
|
5549
|
+
for (const row of rows) {
|
|
5550
|
+
if (!Number.isSafeInteger(row.tag_number))
|
|
5551
|
+
continue;
|
|
5552
|
+
const owner = row.tool_owner_message_id;
|
|
5553
|
+
const exact = row.message_id;
|
|
5554
|
+
if (row.type === "tool") {
|
|
5555
|
+
if (owner && result.has(owner))
|
|
5556
|
+
result.get(owner)?.push(row.tag_number);
|
|
5557
|
+
continue;
|
|
5558
|
+
}
|
|
5559
|
+
const target = exact ? batch.find((id) => exact === id || exact >= `${id}:` && exact < `${id};`) : undefined;
|
|
5560
|
+
if (target !== undefined)
|
|
5561
|
+
result.get(target)?.push(row.tag_number);
|
|
5562
|
+
}
|
|
5563
|
+
}
|
|
5564
|
+
const toolCallIds = [
|
|
5565
|
+
...new Set(messageIds.flatMap((id) => toolCallIdsByMessageId.get(id) ?? []))
|
|
5566
|
+
];
|
|
5567
|
+
for (let offset = 0;offset < toolCallIds.length; offset += 100) {
|
|
5568
|
+
const batch = toolCallIds.slice(offset, offset + 100);
|
|
5569
|
+
const placeholders = batch.map(() => "?").join(", ");
|
|
5570
|
+
const rows = opened.store.db.prepare(`SELECT tag_number, message_id, tool_owner_message_id
|
|
5571
|
+
FROM tags
|
|
5572
|
+
WHERE session_id = ? AND type = 'tool' AND message_id IN (${placeholders})`).all(sessionId, ...batch);
|
|
5573
|
+
for (const row of rows) {
|
|
5574
|
+
if (!Number.isSafeInteger(row.tag_number))
|
|
5575
|
+
continue;
|
|
5576
|
+
for (const messageId of messageIds) {
|
|
5577
|
+
if (!(toolCallIdsByMessageId.get(messageId) ?? []).includes(row.message_id)) {
|
|
5578
|
+
continue;
|
|
5579
|
+
}
|
|
5580
|
+
if (row.tool_owner_message_id === messageId) {
|
|
5581
|
+
result.get(messageId)?.push(row.tag_number);
|
|
5582
|
+
} else {
|
|
5583
|
+
uncertain.add(messageId);
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
}
|
|
5587
|
+
}
|
|
5588
|
+
for (const [id, numbers] of result) {
|
|
5589
|
+
result.set(id, uncertain.has(id) ? null : [...new Set(numbers ?? [])].sort((left, right) => left - right));
|
|
5590
|
+
}
|
|
5591
|
+
return result;
|
|
5592
|
+
} catch {
|
|
5593
|
+
return new Map(messageIds.map((id) => [id, null]));
|
|
5594
|
+
} finally {
|
|
5595
|
+
opened.store.db.close();
|
|
5596
|
+
}
|
|
5597
|
+
}
|
|
5598
|
+
function extractToolCallIds(parts) {
|
|
5599
|
+
if (!Array.isArray(parts))
|
|
5600
|
+
return [];
|
|
5601
|
+
return parts.flatMap((part) => {
|
|
5602
|
+
if (!part || typeof part !== "object" || Array.isArray(part))
|
|
5603
|
+
return [];
|
|
5604
|
+
const record = part;
|
|
5605
|
+
const type = typeof record.type === "string" ? record.type : "";
|
|
5606
|
+
if (type !== "tool" && type !== "toolCall" && type !== "tool_use" && type !== "tool_result")
|
|
5607
|
+
return [];
|
|
5608
|
+
const id = record.callID ?? record.toolCallId ?? record.id;
|
|
5609
|
+
return typeof id === "string" && id.length > 0 ? [id] : [];
|
|
5610
|
+
});
|
|
5611
|
+
}
|
|
5485
5612
|
function isRawType(type) {
|
|
5486
5613
|
return RAW_MESSAGE_TYPES.includes(type);
|
|
5487
5614
|
}
|
|
@@ -5576,9 +5703,33 @@ function oc2AnchorsAndCounts(sources, sessionId, rows) {
|
|
|
5576
5703
|
if (!opened.store)
|
|
5577
5704
|
return { anchors, counts };
|
|
5578
5705
|
try {
|
|
5579
|
-
const
|
|
5706
|
+
const boundaryIds = [
|
|
5707
|
+
...new Set(rows.flatMap((row) => [row.start_message_id, row.end_message_id]).filter(Boolean))
|
|
5708
|
+
];
|
|
5709
|
+
if (boundaryIds.length === 0)
|
|
5710
|
+
return { anchors, counts };
|
|
5711
|
+
const messages = [];
|
|
5712
|
+
for (let offset = 0;offset < boundaryIds.length; offset += 400) {
|
|
5713
|
+
const batch = boundaryIds.slice(offset, offset + 400);
|
|
5714
|
+
const placeholders = batch.map(() => "?").join(", ");
|
|
5715
|
+
messages.push(...opened.store.metaDb.prepare(`SELECT id, seq FROM session_message
|
|
5716
|
+
WHERE session_id = ? AND id IN (${placeholders})`).all(sessionId, ...batch));
|
|
5717
|
+
}
|
|
5718
|
+
const tagNumbers = tagNumbersByMessageId(sources, sessionId, boundaryIds);
|
|
5719
|
+
const rawOrdinals = new Map(messages.map((message) => [
|
|
5720
|
+
message.id,
|
|
5721
|
+
opened.store.reader.messageOrdinalById(sessionId, message.id)
|
|
5722
|
+
]));
|
|
5580
5723
|
for (const message of messages) {
|
|
5581
|
-
anchors.set(message.id, {
|
|
5724
|
+
anchors.set(message.id, {
|
|
5725
|
+
state: "resolved",
|
|
5726
|
+
anchor: message.seq,
|
|
5727
|
+
coordinates: {
|
|
5728
|
+
hostSeq: message.seq,
|
|
5729
|
+
rawOrdinal: rawOrdinals.get(message.id) ?? null,
|
|
5730
|
+
tagNumbers: tagNumbers.get(message.id) ?? null
|
|
5731
|
+
}
|
|
5732
|
+
});
|
|
5582
5733
|
}
|
|
5583
5734
|
const queries = [];
|
|
5584
5735
|
for (const row of rows) {
|
|
@@ -5613,6 +5764,7 @@ function piAnchorsAndCounts(sources, sessionId, rows, branch) {
|
|
|
5613
5764
|
if (projection.status.kind !== "ok")
|
|
5614
5765
|
return { anchors, counts };
|
|
5615
5766
|
const aliases = sources.piAliasBuilder?.(projection.entries);
|
|
5767
|
+
const tagNumbers = tagNumbersByMessageId(sources, sessionId, projection.messages.map((message) => message.id));
|
|
5616
5768
|
for (const row of rows) {
|
|
5617
5769
|
for (const messageId of [row.start_message_id, row.end_message_id]) {
|
|
5618
5770
|
if (messageId === "")
|
|
@@ -5620,7 +5772,7 @@ function piAnchorsAndCounts(sources, sessionId, rows, branch) {
|
|
|
5620
5772
|
const resolved = resolvePiBoundary(messageId, projection.messages, aliases);
|
|
5621
5773
|
if (resolved.state === "empty-id")
|
|
5622
5774
|
continue;
|
|
5623
|
-
anchors.set(messageId, boundaryFromResolution(resolved));
|
|
5775
|
+
anchors.set(messageId, boundaryFromResolution(resolved, tagNumbers.get(resolved.messageId) ?? null));
|
|
5624
5776
|
}
|
|
5625
5777
|
}
|
|
5626
5778
|
const prefix = buildOrdinalPrefix(projection.messages);
|
|
@@ -5633,15 +5785,20 @@ function piAnchorsAndCounts(sources, sessionId, rows, branch) {
|
|
|
5633
5785
|
}
|
|
5634
5786
|
return { anchors, counts };
|
|
5635
5787
|
}
|
|
5636
|
-
function boundaryFromResolution(resolution) {
|
|
5788
|
+
function boundaryFromResolution(resolution, tagNumbers) {
|
|
5637
5789
|
if (resolution.state === "resolved") {
|
|
5638
|
-
return {
|
|
5790
|
+
return {
|
|
5791
|
+
state: "resolved",
|
|
5792
|
+
anchor: resolution.ordinal,
|
|
5793
|
+
coordinates: { hostSeq: null, rawOrdinal: resolution.ordinal, tagNumbers }
|
|
5794
|
+
};
|
|
5639
5795
|
}
|
|
5640
5796
|
if (resolution.state === "synth-resolved") {
|
|
5641
5797
|
return {
|
|
5642
5798
|
state: "synth-resolved",
|
|
5643
5799
|
anchor: resolution.ordinal,
|
|
5644
|
-
aliasedTo: resolution.aliasedTo
|
|
5800
|
+
aliasedTo: resolution.aliasedTo,
|
|
5801
|
+
coordinates: { hostSeq: null, rawOrdinal: resolution.ordinal, tagNumbers }
|
|
5645
5802
|
};
|
|
5646
5803
|
}
|
|
5647
5804
|
return { state: "unresolved" };
|
package/dist/web/ui/panel.css
CHANGED
|
@@ -13,3 +13,4 @@
|
|
|
13
13
|
.comp-counts{margin-top:2px;color:#77837b;font:9px var(--mono);cursor:help}.expandable-text{white-space:pre-wrap;overflow-wrap:anywhere}.expandable-preview,.expandable-full{white-space:inherit}.expandable-preview[hidden],.expandable-full[hidden]{display:none}.preview-toggle{border:0;background:none;color:var(--accent);padding:4px 3px;min-height:32px;cursor:pointer;font:10px var(--mono);vertical-align:baseline}.preview-toggle:hover{text-decoration:underline}.preview-toggle:active{transform:scale(.96)}
|
|
14
14
|
.session-counts,.memory-counts{padding:8px 12px;color:#aeb9b0;font:10px var(--mono);border-bottom:1px solid #27312d;background:#111614;white-space:nowrap}.session-tree-node{border-bottom:1px solid #222b27;padding:7px 8px 7px 10px;transition:background .16s,border-color .16s}.session-tree-node:hover{background:#1b231f}.session-tree-node.selected{background:#263321;border-left:3px solid var(--accent);padding-left:7px}.session-tree-node.context-ancestor{opacity:.68}.session-row{display:flex;align-items:flex-start;gap:6px;min-width:0}.session-toggle,.session-toggle-spacer{width:30px;height:30px;min-width:30px;display:grid;place-items:center;border:1px solid #344139;border-radius:7px;background:#171e1a;color:var(--accent);font:16px var(--mono);cursor:pointer}.session-toggle:hover{background:#263321;border-color:#70845b}.session-toggle-spacer{border-color:transparent;background:transparent}.session-open{display:grid;grid-template-columns:minmax(0,1fr);gap:3px;flex:1;min-width:0;padding:2px 3px;border:0;background:none;text-align:left;cursor:pointer}.session-open:hover .item-title{color:#d9ff9c}.session-open .item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-open .item-meta{display:flex;justify-content:space-between;gap:8px}.session-time{color:#b7c5b7;white-space:nowrap}.session-time[title]{cursor:help}.session-children{margin:5px 0 0 19px;padding-left:8px;border-left:1px solid #3b493e}.session-children[hidden]{display:none}.session-tree-node[aria-level="3"]{padding-top:5px;padding-bottom:5px}.session-tree-node[aria-level="3"] .session-open .item-title{font-size:11px}.context-label,.relation-note{color:#aab89c;font:9px var(--mono)}.relation-note{color:var(--amber)}.maintenance-badge{color:#f0ce91;background:#3b2d1b;border-color:#74582f}.orphan-group{margin:10px;border:1px solid #5a4930;border-radius:9px;background:#1a1712;overflow:hidden}.orphan-heading{display:flex;align-items:center;gap:7px;padding:8px 9px;color:#efd69d}.orphan-heading strong{font-size:11px}.orphan-body{border-top:1px solid #4a3c29}.orphan-body[hidden]{display:none}.orphan-body .session-tree-node{border-bottom-color:#3d3427}.memory-category-options{display:flex;flex-wrap:wrap;gap:5px;padding:3px 0}.category-chip{display:inline-flex;align-items:center;gap:5px;padding:5px 7px;border:1px solid #334038;border-radius:999px;background:#171e1a;color:#aeb9b0;font-size:10px;cursor:pointer}.category-chip:has(input:checked){border-color:#849d62;background:#293522;color:#e2f7c5}.category-chip input{accent-color:var(--accent);margin:0}.memory-actions{align-items:center}.list-error{margin:10px;border:1px solid #704038;background:#2a1c1a;border-radius:9px;color:#f3c0b7}.list-error strong{color:#ffb8aa}.list-error .link-button{margin-top:7px}.item-list>.item-card{margin-left:10px;margin-right:10px}.branch-box{min-width:0}.session-open .item-sub{overflow-wrap:anywhere}.session-tree-node button:active,.orphan-heading button:active{transform:scale(.96)}
|
|
15
15
|
@media(max-width:760px){.session-counts,.memory-counts{white-space:normal;line-height:1.6}.control-row{flex-wrap:wrap}.list-controls{gap:7px}.memory-category-options{padding:2px 0}.category-chip{min-height:34px}.session-children{margin-left:12px}.session-toggle,.session-toggle-spacer{width:34px;min-width:34px;height:34px}.session-open{padding-top:4px;padding-bottom:4px}}
|
|
16
|
+
.session-facts{color:#b9c9a9}.bound-coordinates{color:#9eaca2;font:9px var(--mono);overflow-wrap:anywhere}.message-index{overflow-wrap:anywhere}
|
package/dist/web/ui/panel.js
CHANGED
|
@@ -88,6 +88,18 @@
|
|
|
88
88
|
}
|
|
89
89
|
const sessionTitle = (session) => session.title || (session.harness === "pi" ? "Pi 会话 · 无标题" : "OpenCode 2 会话 · 无标题");
|
|
90
90
|
const number = (value) => value == null ? "—" : new Intl.NumberFormat("zh-CN").format(value);
|
|
91
|
+
function coordinateText(coordinates) {
|
|
92
|
+
const host = coordinates?.hostSeq == null ? "宿主序未知" : `宿主序 #${number(coordinates.hostSeq)}`;
|
|
93
|
+
const raw = coordinates?.rawOrdinal == null ? "原文序未知" : `原文序 #${number(coordinates.rawOrdinal)}`;
|
|
94
|
+
const tags = coordinates?.tagNumbers == null ? "标签未知" : coordinates.tagNumbers.length ? `标签 §${coordinates.tagNumbers.join("、")}§` : "无标签";
|
|
95
|
+
return `${host} · ${raw} · ${tags}`;
|
|
96
|
+
}
|
|
97
|
+
function sessionFacts(session) {
|
|
98
|
+
const identity = session?.childIdentity === "child" ? "子会话" : session?.childIdentity === "root" ? "主会话" : "身份未知";
|
|
99
|
+
const eligibility = session?.processingEligibility === "reduced-subagent" ? "子代理精简资格" : session?.processingEligibility === "primary" ? "主会话资格" : "资格未知";
|
|
100
|
+
return `已登记 · ${identity} · ${eligibility}`;
|
|
101
|
+
}
|
|
102
|
+
const SESSION_FACTS_TITLE = "登记资格,不保证当前启用或健康";
|
|
91
103
|
const setReadAt = (data) => { if (data?.readAt) $("#read-at").textContent = `读取于 ${formatTime(data.readAt)}`; };
|
|
92
104
|
async function api(url) {
|
|
93
105
|
const response = await fetch(url, { method: "GET", cache: "no-store", headers: { Accept: "application/json" } });
|
|
@@ -301,7 +313,7 @@
|
|
|
301
313
|
if (children.length) { const toggle = btn(expanded ? "−" : "+", "toggle-session", "session-toggle"); toggle.dataset.sessionKey = key; toggle.setAttribute("aria-expanded", String(expanded)); toggle.setAttribute("aria-controls", id); toggle.setAttribute("aria-label", `${expanded ? "收起" : "展开"}${sessionTitle(session)}的子会话`); row.append(toggle); } else row.append(el("span", "session-toggle-spacer"));
|
|
302
314
|
const open = btn("", "session", "session-open"); open.dataset.sid = session.sessionId; open.dataset.harness = session.harness; open.setAttribute("aria-label", `打开会话:${sessionTitle(session)}`); open.append(el("span", "item-title", sessionTitle(session)));
|
|
303
315
|
const meta = el("span", "item-meta"); const time = el("time", "session-time", sessionTimeText(session)); time.title = sessionTimeTitle(session); meta.append(el("span", "", session.harness === "pi" ? "Pi" : "OpenCode 2"), time); open.append(meta);
|
|
304
|
-
const foot = el("span", "item-sub", `${session.sessionId} · ${number(session.compartmentCount)} 段摘要${children.length ? ` · ${number(children.length)} 个子会话` : ""}`); open.append(foot); if (item.context) open.append(el("span", "context-label", "用于定位")); if (session.maintenance) open.append(el("span", "badge maintenance-badge", `维护 · ${session.maintenance}`)); if (session.relation?.state === "orphan") open.append(el("span", "relation-note", RELATION_REASON[session.relation.reason] || "未归属子会话")); if (session.forkSessionId) { const source = el("span", "item-sub", `来源:${session.forkSessionId}`); source.title = "forkSessionId 仅表示来源,不是父子关系"; open.append(source); } row.append(open); node.append(row);
|
|
316
|
+
const foot = el("span", "item-sub", `${session.sessionId} · ${number(session.compartmentCount)} 段摘要${children.length ? ` · ${number(children.length)} 个子会话` : ""}`); open.append(foot); const facts = el("span", "item-sub session-facts", sessionFacts(session)); facts.title = SESSION_FACTS_TITLE; open.append(facts); if (item.context) open.append(el("span", "context-label", "用于定位")); if (session.maintenance) open.append(el("span", "badge maintenance-badge", `维护 · ${session.maintenance}`)); if (session.relation?.state === "orphan") open.append(el("span", "relation-note", RELATION_REASON[session.relation.reason] || "未归属子会话")); if (session.forkSessionId) { const source = el("span", "item-sub", `来源:${session.forkSessionId}`); source.title = "forkSessionId 仅表示来源,不是父子关系"; open.append(source); } row.append(open); node.append(row);
|
|
305
317
|
if (session.harness === "pi") { const branches = session.piBranches || []; const box = el("div", "branch-box"); box.append(el("span", "item-sub", branches.length ? `Pi 分支文件 · ${branches.length}` : "Pi 原文文件未找到")); for (const branch of branches) { const b = btn(`${branch.fileName} · ${branch.directoryName}`, "branch", "link-button branch-button"); b.dataset.sid = session.sessionId; b.dataset.harness = session.harness; b.dataset.branch = branch.fileName; b.title = branch.headerTimestamp || "时间未知"; box.append(b); } node.append(box); }
|
|
306
318
|
if (children.length) { const group = el("div", "session-children"); group.id = id; group.setAttribute("role", "group"); group.hidden = !expanded; if (expanded) for (const child of children) renderSessionNode(group, child, level + 1); node.append(group); } parent.append(node);
|
|
307
319
|
}
|
|
@@ -364,7 +376,7 @@
|
|
|
364
376
|
const root = $("#detail"); root.classList.remove("detail-empty"); root.replaceChildren(); if (!state.session) return;
|
|
365
377
|
const wrap = el("div", "detail-content"); addMobileBack(wrap, "list", "返回列表");
|
|
366
378
|
const s = state.session; wrap.append(el("div", "detail-kicker", `${s.harness === "pi" ? "PI SESSION" : "OPENCODE 2 SESSION"}${state.branch ? " · BRANCH SELECTED" : ""}`));
|
|
367
|
-
wrap.append(el("h2", "detail-title", sessionTitle(s))); const meta = el("div", "detail-meta"); meta.append(el("span", "badge", s.sessionId), el("span", "badge", `${number(s.compartmentCount)} 个摘要段`), el("span", "", sessionTimeText(s))); if (state.branch) meta.append(el("span", "badge", state.branch)); wrap.append(meta);
|
|
379
|
+
wrap.append(el("h2", "detail-title", sessionTitle(s))); const meta = el("div", "detail-meta"); const eligibility = el("span", "badge", sessionFacts(s).replace("已登记 · ", "")); eligibility.title = SESSION_FACTS_TITLE; meta.append(el("span", "badge", s.sessionId), el("span", "badge", "已登记"), eligibility, el("span", "badge", `${number(s.compartmentCount)} 个摘要段`), el("span", "", sessionTimeText(s))); if (state.branch) meta.append(el("span", "badge", state.branch)); wrap.append(meta);
|
|
368
380
|
if (s.harness === "pi" && !state.branch) { const prompt = section(wrap, "选择 Pi 分支", "Pi 原文与摘要按分支独立读取"); prompt.append(el("p", "boundary-warning", "请回到会话卡,选择具体分支文件后再查看摘要和原文。面板不会猜测默认分支。")); root.append(wrap); return; }
|
|
369
381
|
const comps = section(wrap, "摘要分段", "层级为审阅展示,不是存储字段");
|
|
370
382
|
if (state.detailErrors?.compartments) errorBox(comps, state.detailErrors.compartments);
|
|
@@ -387,14 +399,15 @@
|
|
|
387
399
|
const bounds = c.bounds || {}; const boundRow = el("div", "bound-row"); boundRow.append(el("span", "", "边界")); for (const [side, label] of [["start", "起点"], ["end", "终点"]]) {
|
|
388
400
|
const bound = bounds[side] || { state: "unresolved" }; const stateName = bound.state === "synth-resolved" ? "经别名解析" : bound.state === "resolved" ? "已关联" : bound.state === "unlinked" ? "无边界 id" : "边界无法解析";
|
|
389
401
|
boundRow.append(el("span", "badge", `${label} · ${stateName}`));
|
|
390
|
-
if (bound.state === "resolved" || bound.state === "synth-resolved") { const jump = btn(`跳到${label}
|
|
402
|
+
if (bound.state === "resolved" || bound.state === "synth-resolved") { boundRow.append(el("span", "bound-coordinates", coordinateText(bound.coordinates))); const jump = btn(`跳到${label}`, "jump", "link-button"); jump.dataset.anchor = bound.anchor; boundRow.append(jump); if (bound.aliasedTo) boundRow.append(el("span", "section-note", `→ ${bound.aliasedTo}`)); } else boundRow.append(el("span", "bound-coordinates", coordinateText(null)));
|
|
391
403
|
}
|
|
392
404
|
card.append(boundRow);
|
|
393
|
-
const range = compartmentRange(c); if (range) { const view = getSegmentView(c); const raw = el("details", "comp-raw"); raw.dataset.compartmentKey = segmentKey(c); raw.open = view.open; raw.append(el("summary", "link-summary", `展开该段原文 · ${
|
|
405
|
+
const range = compartmentRange(c); if (range) { const view = getSegmentView(c); const raw = el("details", "comp-raw"); raw.dataset.compartmentKey = segmentKey(c); raw.open = view.open; raw.append(el("summary", "link-summary", `展开该段原文 · ${compartmentRangeLabel(c)}`)); const body = el("div", "comp-message-panel"); raw.append(body); raw.addEventListener("toggle", () => { view.open = raw.open; if (raw.open) { if (view.skipToggleRequest) view.skipToggleRequest = false; else loadSegmentMessages(c, segmentKey(c), body); } }); card.append(raw); } else card.append(el("p", "boundary-warning", "原文归属:未分组。请在下方“边界未确认的原文”中按需读取。")); parent.append(card);
|
|
394
406
|
}
|
|
395
407
|
function segmentKey(c) { return String(c.id ?? `sequence-${c.sequence}`); }
|
|
396
408
|
function numericBoundary(bound) { return (bound?.state === "resolved" || bound?.state === "synth-resolved") && Number.isSafeInteger(bound.anchor) ? bound.anchor : null; }
|
|
397
409
|
function compartmentRange(c) { const start = numericBoundary(c.bounds?.start); const end = numericBoundary(c.bounds?.end); return start !== null && end !== null && start <= end ? { start, end } : null; }
|
|
410
|
+
function compartmentRangeLabel(c) { const start = c.bounds?.start?.coordinates; const end = c.bounds?.end?.coordinates; if (start?.hostSeq != null && end?.hostSeq != null) return `宿主序 ${start.hostSeq}–${end.hostSeq}`; if (start?.rawOrdinal != null && end?.rawOrdinal != null) return `原文序 ${start.rawOrdinal}–${end.rawOrdinal}`; return "坐标未知"; }
|
|
398
411
|
function boundaryReason(c) { const bounds = c.bounds || {}; return ["start", "end"].map((side) => { const value = bounds[side]?.state; return `${side === "start" ? "起点" : "终点"}:${value === "unlinked" ? "无边界 id" : value === "synth-resolved" || value === "resolved" ? "数字边界无效" : "边界无法解析"}`; }).join(";"); }
|
|
399
412
|
function getSegmentView(c) { const key = segmentKey(c); let view = state.segmentViews.get(key); if (!view) { const range = compartmentRange(c); view = { open: false, after: range ? range.start - 1 : null, cursors: [], page: null, loading: false, error: null, fullOutputs: false, openToolOutputs: new Set(), request: 0 }; state.segmentViews.set(key, view); } return view; }
|
|
400
413
|
function renderUngroupedSection(parent, title, note, reason, initialAfter = null) {
|
|
@@ -408,7 +421,7 @@
|
|
|
408
421
|
const role = row.role === "user" ? "用户" : row.role === "assistant" ? "助手" : row.role || "未知角色";
|
|
409
422
|
head.append(el("strong", "message-role", role));
|
|
410
423
|
const identity = el("span", "message-aux");
|
|
411
|
-
identity.append(el("span", "message-index",
|
|
424
|
+
identity.append(el("span", "message-index", coordinateText(row.coordinates)));
|
|
412
425
|
const messageId = String(row.id || "无 ID"); const idLabel = messageId.length > 32 ? `${messageId.slice(0, 15)}…${messageId.slice(-10)}` : messageId;
|
|
413
426
|
const id = el("span", "message-id", idLabel); id.title = `消息 ID:${messageId}`; identity.append(id); head.append(identity, el("time", "message-time", formatTime(row.timeCreated))); card.append(head);
|
|
414
427
|
for (const [index, part] of (row.parts || []).entries()) renderPart(card, part, row, index, scope);
|
package/dist/web/views.d.ts
CHANGED
|
@@ -77,6 +77,12 @@ export interface PanelSessionNode {
|
|
|
77
77
|
maintenance: MaintenanceKind | null;
|
|
78
78
|
/** Source provenance only — never a parent relation (plan 15: fork ≠ parent). */
|
|
79
79
|
forkSessionId: string | null;
|
|
80
|
+
/** The registration is the only identity fact guaranteed by this list. */
|
|
81
|
+
registered: true;
|
|
82
|
+
/** Host/session metadata only; never a health verdict. */
|
|
83
|
+
childIdentity: "root" | "child" | "unknown";
|
|
84
|
+
/** Persisted/default eligibility, not proof of current use or health. */
|
|
85
|
+
processingEligibility: "primary" | "reduced-subagent" | "unknown";
|
|
80
86
|
/** Children counted within THIS pruned response, not globally. */
|
|
81
87
|
childCount: number;
|
|
82
88
|
compartmentCount: number;
|
|
@@ -111,6 +117,14 @@ export interface PanelMessageRow {
|
|
|
111
117
|
role: string;
|
|
112
118
|
timeCreated: number | null;
|
|
113
119
|
parts: unknown[];
|
|
120
|
+
/** Separate coordinate spaces; null means this projection cannot prove one. */
|
|
121
|
+
coordinates: PanelMessageCoordinates;
|
|
122
|
+
}
|
|
123
|
+
export interface PanelMessageCoordinates {
|
|
124
|
+
hostSeq: number | null;
|
|
125
|
+
rawOrdinal: number | null;
|
|
126
|
+
/** All tag numbers attached to this raw row's content; null means unknown. */
|
|
127
|
+
tagNumbers: number[] | null;
|
|
114
128
|
}
|
|
115
129
|
export interface PanelMessagePage {
|
|
116
130
|
source: "oc2-host" | "pi-jsonl";
|
|
@@ -136,13 +150,20 @@ export type PanelBoundary = {
|
|
|
136
150
|
} | {
|
|
137
151
|
state: "resolved";
|
|
138
152
|
anchor: number;
|
|
153
|
+
coordinates: PanelBoundaryCoordinates;
|
|
139
154
|
} | {
|
|
140
155
|
state: "synth-resolved";
|
|
141
156
|
anchor: number;
|
|
142
157
|
aliasedTo: string;
|
|
158
|
+
coordinates: PanelBoundaryCoordinates;
|
|
143
159
|
} | {
|
|
144
160
|
state: "unresolved";
|
|
145
161
|
};
|
|
162
|
+
export interface PanelBoundaryCoordinates {
|
|
163
|
+
hostSeq: number | null;
|
|
164
|
+
rawOrdinal: number | null;
|
|
165
|
+
tagNumbers: number[] | null;
|
|
166
|
+
}
|
|
146
167
|
export type PanelCompartmentRenderTier = "full" | "decayed";
|
|
147
168
|
export interface PanelCompartment {
|
|
148
169
|
id: number;
|
package/dist/web/views.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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AAgB,EAAE,CA2EpB;AAkLD,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAClB,SAAS,EAAE,CAgCb;AAsBD,qBAAa,eAAgB,SAAQ,KAAK;CAAG;AAC7C,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAC3C,qBAAa,sBAAuB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBACb,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM;CAKtE;AACD,qBAAa,4BAA6B,SAAQ,KAAK;IACnD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;gBACb,MAAM,EAAE,OAAO;CAI9B"}
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
getActiveCompartmentRun,
|
|
22
22
|
markActiveCompartmentRunPublished,
|
|
23
23
|
registerActiveCompartmentRun
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-ys43j25b.js";
|
|
25
25
|
import"./index-1j34a56j.js";
|
|
26
26
|
import"./index-x37vg474.js";
|
|
27
|
-
import"./index-
|
|
27
|
+
import"./index-cszxqtev.js";
|
|
28
28
|
import"./index-ramz5kkm.js";
|
|
29
29
|
import {
|
|
30
30
|
pushNotification2
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
import {
|
|
38
38
|
setRecompStarting2,
|
|
39
39
|
setRecompTerminal2
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-pynrjyjy.js";
|
|
41
41
|
import"./index-33gprt9g.js";
|
|
42
42
|
|
|
43
43
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
package/package.json
CHANGED
|
@@ -149,7 +149,7 @@ Look at each tag before stamping it; never blanket-stamp a range like "1-50". Ma
|
|
|
149
149
|
}
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
### mmc_expand — description ~
|
|
152
|
+
### mmc_expand — description ~393 tokens, params ~189 tokens (total ~582)
|
|
153
153
|
|
|
154
154
|
**Description:**
|
|
155
155
|
|
|
@@ -164,7 +164,7 @@ Returns the raw transcript as [N] U:/A: lines, capped at ~15K tokens; an oversiz
|
|
|
164
164
|
|
|
165
165
|
Finer recovery:
|
|
166
166
|
- verbose=true lists each message separately with its ordinal and a per-part preview (tool calls with output sizes) so you can pick one.
|
|
167
|
-
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with mmc_reduce; if the message
|
|
167
|
+
- message=N returns that one message in full — every text part and every tool call's complete input and output — from stored history. This is the way back to a tool output you released with mmc_reduce; if the message is no longer in stored history it says so.
|
|
168
168
|
```
|
|
169
169
|
|
|
170
170
|
**Parameters (JSON Schema per parameter, as serialized to the provider):**
|