@retaw106/mmc-oc 2.1.1 → 2.2.0
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/agents/memory-maintainer.d.ts +9 -0
- package/dist/agents/memory-maintainer.d.ts.map +1 -1
- package/dist/cli.js +0 -1
- package/dist/config/project-security.d.ts +0 -2
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +0 -5
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/config-init.js +0 -1
- package/dist/{context-cx3y8abt.js → context-mrvm92n8.js} +3469 -3134
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts +0 -6
- package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts.map +1 -1
- package/dist/features/magic-context/migrations.d.ts +5 -0
- package/dist/features/magic-context/migrations.d.ts.map +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts +1 -1
- package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
- package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +8 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +6 -3
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +0 -1
- package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
- package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts +37 -0
- package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts.map +1 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts +4 -0
- package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +61 -0
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts +9 -0
- package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts +2 -0
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +8 -1
- package/dist/hooks/magic-context/read-session-chunk.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/strip-content.d.ts +4 -2
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/system-injection-stripper.d.ts +7 -0
- package/dist/hooks/magic-context/system-injection-stripper.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts +5 -0
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +23 -7
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +0 -6
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-wtb9hzk6.js → index-5b7x80ec.js} +126 -44
- package/dist/{index-dr0gepzw.js → index-btp5tdc8.js} +182 -31
- package/dist/{index-n0vnzz6h.js → index-g2z2k5m4.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{read-session-chunk-82rkqa8j.js → read-session-chunk-2xm4sc4y.js} +1 -1
- package/dist/{recomp-orchestrator-vc5dkzy2.js → recomp-orchestrator-frmwj9hz.js} +3 -3
- package/dist/shared/pi-executable.d.ts +1 -1
- package/dist/shared/pi-executable.d.ts.map +1 -1
- package/dist/shared/prompt-surface-runtime.d.ts +1 -1
- package/dist/shared/subagent-runner.d.ts +22 -1
- package/dist/shared/subagent-runner.d.ts.map +1 -1
- package/dist/tools/light-descriptions.d.ts +1 -1
- package/dist/tools/light-descriptions.d.ts.map +1 -1
- package/dist/tools/parameter-descriptions.d.ts +1 -3
- package/dist/tools/parameter-descriptions.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/hidden-child.d.ts +15 -2
- package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/server.js +3472 -2907
- package/dist/web/main.js +9 -3
- package/dist/{wrapup-orchestrator-x9xamts2.js → wrapup-orchestrator-yknks3ad.js} +3 -3
- package/package.json +1 -1
- package/src/agents/memory-maintainer.ts +12 -0
- package/src/config/index.test.ts +0 -17
- package/src/config/project-security.test.ts +0 -8
- package/src/config/project-security.ts +0 -9
- package/src/config/protected-tools.test.ts +72 -0
- package/src/config/schema/magic-context.test.ts +0 -6
- package/src/config/schema/magic-context.ts +1 -10
- package/src/shared/fold-render-lock-fence.test.ts +84 -0
- package/src/shared/fold-render-lock-fixtures.test.ts +270 -0
- package/src/shared/pi-executable.ts +3 -3
- package/src/shared/rpc-utils.test.ts +4 -5
- package/src/shared/sqlite-640-review.test.ts +184 -0
- package/src/shared/sqlite-context-pragmas.test.ts +105 -0
- package/src/shared/sqlite-writer-diagnostics.test.ts +136 -0
- package/src/shared/subagent-runner.ts +24 -0
- package/src/shared/tag-transcript.test.ts +55 -0
- package/src/shared/tag-transcript.ts +6 -0
- package/src/shared/write-transaction-attribution.test.ts +4 -0
- package/src/shared/write-transaction-timing.test.ts +39 -0
- package/dist/hooks/magic-context/historian-state-file.d.ts +0 -43
- package/dist/hooks/magic-context/historian-state-file.d.ts.map +0 -1
- package/dist/shared/auto-update-provenance.d.ts +0 -9
- package/dist/shared/auto-update-provenance.d.ts.map +0 -1
- package/src/shared/auto-update-provenance.ts +0 -42
|
@@ -1114,7 +1114,7 @@ function messageIdForTag(tag) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
function resolveProtectedTagNumbers(tags, protectedTagNumbersInput, protectedToolTags) {
|
|
1116
1116
|
const protectedNumbers = new Set(protectedTagNumbersInput);
|
|
1117
|
-
const protectedExemplars = protectedToolTags ?? protectedToolTagNumbers(tags
|
|
1117
|
+
const protectedExemplars = protectedToolTags ?? protectedToolTagNumbers(tags);
|
|
1118
1118
|
for (const tagNumber of protectedExemplars)
|
|
1119
1119
|
protectedNumbers.add(tagNumber);
|
|
1120
1120
|
return protectedNumbers;
|
|
@@ -1682,7 +1682,7 @@ function freezeTailHygieneMeasurement(measured) {
|
|
|
1682
1682
|
}
|
|
1683
1683
|
function refreshTailHygieneBaseline(input) {
|
|
1684
1684
|
const protectedToolsPolicy = adoptedProtectedToolsPolicy(input.protectedTools, input.previous?.protectedToolsPolicy, input.cacheBusting, !!input.previous);
|
|
1685
|
-
const protectedToolTags =
|
|
1685
|
+
const protectedToolTags = protectedToolTagNumbers(input.tags, protectedToolsPolicy);
|
|
1686
1686
|
input = {
|
|
1687
1687
|
...input,
|
|
1688
1688
|
protectedToolTags,
|
|
@@ -1770,6 +1770,7 @@ function refreshTailHygieneBaseline(input) {
|
|
|
1770
1770
|
}
|
|
1771
1771
|
return {
|
|
1772
1772
|
...input.previous,
|
|
1773
|
+
protectedToolsPolicy,
|
|
1773
1774
|
turnDeltaU,
|
|
1774
1775
|
turnDeltaT,
|
|
1775
1776
|
evaluable: true,
|
|
@@ -2430,14 +2431,13 @@ function getUpdateTagDropModeStatement(db) {
|
|
|
2430
2431
|
}
|
|
2431
2432
|
var updateTagByteSizeStatements = new WeakMap;
|
|
2432
2433
|
var updateTagInputByteSizeStatements = new WeakMap;
|
|
2433
|
-
var CONTENT_ID_SUFFIX = /:(?:p|file)\d+$/;
|
|
2434
2434
|
var RECENT_OWNER_SCAN_PAGE_SIZE = 128;
|
|
2435
2435
|
var recentTagOwnerStatements = new WeakMap;
|
|
2436
2436
|
function ownerMessageIdForTagRow(row) {
|
|
2437
2437
|
if (row.type === "tool") {
|
|
2438
2438
|
return row.tool_owner_message_id ?? row.message_id;
|
|
2439
2439
|
}
|
|
2440
|
-
return row.message_id
|
|
2440
|
+
return contentTagOwnerMessageId(row.message_id);
|
|
2441
2441
|
}
|
|
2442
2442
|
function getRecentTagOwnerStatement(db) {
|
|
2443
2443
|
let statement = recentTagOwnerStatements.get(db);
|
|
@@ -2462,7 +2462,7 @@ function getRecentTagOwnerMessageIds(db, sessionId, maxOwners) {
|
|
|
2462
2462
|
for (const row of rows) {
|
|
2463
2463
|
if (typeof row.type !== "string" || typeof row.message_id !== "string")
|
|
2464
2464
|
continue;
|
|
2465
|
-
const ownerId = row.type === "tool" ? typeof row.tool_owner_message_id === "string" ? row.tool_owner_message_id : null : row.message_id
|
|
2465
|
+
const ownerId = row.type === "tool" ? typeof row.tool_owner_message_id === "string" ? row.tool_owner_message_id : null : contentTagOwnerMessageId(row.message_id);
|
|
2466
2466
|
if (!ownerId || recent.has(ownerId))
|
|
2467
2467
|
continue;
|
|
2468
2468
|
recent.add(ownerId);
|
|
@@ -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"]);
|
|
@@ -4626,6 +4628,88 @@ function computeRawRangeFingerprint(messages, startInclusive, endExclusive) {
|
|
|
4626
4628
|
return pieces.join("|");
|
|
4627
4629
|
}
|
|
4628
4630
|
|
|
4631
|
+
// src/hooks/magic-context/system-injection-stripper.ts
|
|
4632
|
+
var SYSTEM_INJECTION_MARKERS = [
|
|
4633
|
+
"<!-- OMO_INTERNAL_INITIATOR -->",
|
|
4634
|
+
"[SYSTEM DIRECTIVE: MAGIC-CONTEXT",
|
|
4635
|
+
"[SYSTEM DIRECTIVE: OH-MY-OPENCODE",
|
|
4636
|
+
"[Category+Skill Reminder]",
|
|
4637
|
+
"[EDIT ERROR - IMMEDIATE ACTION REQUIRED]",
|
|
4638
|
+
"[task CALL FAILED - IMMEDIATE RETRY REQUIRED]",
|
|
4639
|
+
"[EMERGENCY CONTEXT WINDOW WARNING]",
|
|
4640
|
+
"Unstable background agent appears idle",
|
|
4641
|
+
"**THE SUBAGENT JUST CLAIMED THIS TASK IS DONE."
|
|
4642
|
+
];
|
|
4643
|
+
var SYSTEM_REMINDER_REGEX = /<system-reminder>[\s\S]*?<\/system-reminder>/gi;
|
|
4644
|
+
var OMO_MARKER_REGEX = /<!-- OMO_INTERNAL_INITIATOR -->/g;
|
|
4645
|
+
var STEERING_WRAPPER_REGEX = /<system-reminder>\nThe user sent the following message:\n[\s\S]*?\n\nPlease address this message and continue with your tasks\.\n<\/system-reminder>/g;
|
|
4646
|
+
function stripSystemInjection(text) {
|
|
4647
|
+
STEERING_WRAPPER_REGEX.lastIndex = 0;
|
|
4648
|
+
if (!STEERING_WRAPPER_REGEX.test(text))
|
|
4649
|
+
return stripInjectedRegions(text);
|
|
4650
|
+
STEERING_WRAPPER_REGEX.lastIndex = 0;
|
|
4651
|
+
let result = "";
|
|
4652
|
+
let changed = false;
|
|
4653
|
+
let cursor = 0;
|
|
4654
|
+
const keepOrStrip = (segment) => {
|
|
4655
|
+
const stripped = stripInjectedRegions(segment);
|
|
4656
|
+
if (stripped === null) {
|
|
4657
|
+
result += segment;
|
|
4658
|
+
} else {
|
|
4659
|
+
result += stripped;
|
|
4660
|
+
changed = true;
|
|
4661
|
+
}
|
|
4662
|
+
};
|
|
4663
|
+
for (const match of text.matchAll(STEERING_WRAPPER_REGEX)) {
|
|
4664
|
+
keepOrStrip(text.slice(cursor, match.index));
|
|
4665
|
+
result += match[0];
|
|
4666
|
+
cursor = match.index + match[0].length;
|
|
4667
|
+
}
|
|
4668
|
+
keepOrStrip(text.slice(cursor));
|
|
4669
|
+
return changed ? result.trim() : null;
|
|
4670
|
+
}
|
|
4671
|
+
function stripOutsideSteeringWrappers(text, strip) {
|
|
4672
|
+
STEERING_WRAPPER_REGEX.lastIndex = 0;
|
|
4673
|
+
let result = "";
|
|
4674
|
+
let cursor = 0;
|
|
4675
|
+
for (const match of text.matchAll(STEERING_WRAPPER_REGEX)) {
|
|
4676
|
+
result += strip(text.slice(cursor, match.index));
|
|
4677
|
+
result += match[0];
|
|
4678
|
+
cursor = match.index + match[0].length;
|
|
4679
|
+
}
|
|
4680
|
+
return result + strip(text.slice(cursor));
|
|
4681
|
+
}
|
|
4682
|
+
function stripInjectedRegions(text) {
|
|
4683
|
+
let hasInjection = false;
|
|
4684
|
+
for (const marker of SYSTEM_INJECTION_MARKERS) {
|
|
4685
|
+
if (text.includes(marker)) {
|
|
4686
|
+
hasInjection = true;
|
|
4687
|
+
break;
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
if (SYSTEM_REMINDER_REGEX.test(text))
|
|
4691
|
+
hasInjection = true;
|
|
4692
|
+
SYSTEM_REMINDER_REGEX.lastIndex = 0;
|
|
4693
|
+
if (!hasInjection)
|
|
4694
|
+
return null;
|
|
4695
|
+
let cleaned = text;
|
|
4696
|
+
cleaned = cleaned.replace(SYSTEM_REMINDER_REGEX, "");
|
|
4697
|
+
cleaned = cleaned.replace(OMO_MARKER_REGEX, "");
|
|
4698
|
+
cleaned = cleaned.replace(/\[SYSTEM DIRECTIVE: OH-MY-(?:OPENCODE|CLAUDE)[^\]]*\][\s\S]*?(?=\n\n(?!\s*[-*])|$)/g, "");
|
|
4699
|
+
for (const marker of SYSTEM_INJECTION_MARKERS) {
|
|
4700
|
+
if (marker.startsWith("<!-- ") || marker.startsWith("[SYSTEM DIRECTIVE"))
|
|
4701
|
+
continue;
|
|
4702
|
+
const idx = cleaned.indexOf(marker);
|
|
4703
|
+
if (idx === -1)
|
|
4704
|
+
continue;
|
|
4705
|
+
const blockEnd = cleaned.indexOf(`
|
|
4706
|
+
|
|
4707
|
+
`, idx + marker.length);
|
|
4708
|
+
cleaned = blockEnd !== -1 ? cleaned.slice(0, idx) + cleaned.slice(blockEnd) : cleaned.slice(0, idx);
|
|
4709
|
+
}
|
|
4710
|
+
return cleaned.trim();
|
|
4711
|
+
}
|
|
4712
|
+
|
|
4629
4713
|
// src/hooks/magic-context/tag-part-guards.ts
|
|
4630
4714
|
function isTextPart(part) {
|
|
4631
4715
|
if (part === null || typeof part !== "object")
|
|
@@ -5382,6 +5466,33 @@ function extractErrorMessage(error) {
|
|
|
5382
5466
|
}
|
|
5383
5467
|
return String(error);
|
|
5384
5468
|
}
|
|
5469
|
+
function extractExplicitHttpStatus(error) {
|
|
5470
|
+
if (!error || typeof error !== "object")
|
|
5471
|
+
return;
|
|
5472
|
+
const seen = new Set;
|
|
5473
|
+
const queue = [error];
|
|
5474
|
+
while (queue.length > 0) {
|
|
5475
|
+
const current = queue.shift();
|
|
5476
|
+
if (!current || seen.has(current))
|
|
5477
|
+
continue;
|
|
5478
|
+
seen.add(current);
|
|
5479
|
+
const record = current;
|
|
5480
|
+
for (const key of ["status", "statusCode", "status_code"]) {
|
|
5481
|
+
const value = record[key];
|
|
5482
|
+
if (typeof value === "number")
|
|
5483
|
+
return value;
|
|
5484
|
+
}
|
|
5485
|
+
for (const value of Object.values(record)) {
|
|
5486
|
+
if (value && typeof value === "object")
|
|
5487
|
+
queue.push(value);
|
|
5488
|
+
}
|
|
5489
|
+
}
|
|
5490
|
+
return;
|
|
5491
|
+
}
|
|
5492
|
+
function detectLatestTurnThinkingMismatch(error) {
|
|
5493
|
+
const status = extractExplicitHttpStatus(error);
|
|
5494
|
+
return (status === undefined || status === 400) && /(?:thinking|redacted_thinking)[\s\S]*latest assistant (?:message|turn)[\s\S]*cannot be modified/i.test(extractErrorMessage(error));
|
|
5495
|
+
}
|
|
5385
5496
|
var PREFIX_BOUND_THINKING_MODELS = [
|
|
5386
5497
|
["fable", 5, 1],
|
|
5387
5498
|
["opus", 5, 5],
|
|
@@ -5394,6 +5505,11 @@ function isPrefixBoundThinkingModel(_providerID, modelID) {
|
|
|
5394
5505
|
return false;
|
|
5395
5506
|
return PREFIX_BOUND_THINKING_PATTERN.test(modelID);
|
|
5396
5507
|
}
|
|
5508
|
+
function isFable51ThinkingBindingModel(providerID, modelID) {
|
|
5509
|
+
if (providerID?.toLowerCase() !== "anthropic" || !modelID)
|
|
5510
|
+
return false;
|
|
5511
|
+
return /(?:^|[-_.])fable[-_.]?5[-_.]1(?:$|[-_.])/i.test(modelID);
|
|
5512
|
+
}
|
|
5397
5513
|
function detectOverflow(error) {
|
|
5398
5514
|
const message = extractErrorMessage(error);
|
|
5399
5515
|
if (!message) {
|
|
@@ -5529,7 +5645,7 @@ var VARIANT_CACHE_PRESERVING_MODELS = {
|
|
|
5529
5645
|
function canonicalVariantModelIdentity(providerID, modelID) {
|
|
5530
5646
|
const normalizedProviderID = providerID.toLowerCase();
|
|
5531
5647
|
const isAnthropicFamily = normalizedProviderID === "anthropic" || normalizedProviderID === "google-vertex-anthropic" || normalizedProviderID.includes("bedrock");
|
|
5532
|
-
if (isAnthropicFamily &&
|
|
5648
|
+
if (isAnthropicFamily && isFable51ThinkingBindingModel("anthropic", modelID)) {
|
|
5533
5649
|
return "anthropic/claude-fable-5-1";
|
|
5534
5650
|
}
|
|
5535
5651
|
return canonicalModelIdentity(`${providerID}/${modelID}`).toLowerCase();
|
|
@@ -5973,6 +6089,8 @@ function createToolDropTarget(compositeKey, thinkingParts, index, batch, tagId)
|
|
|
5973
6089
|
return "truncated";
|
|
5974
6090
|
};
|
|
5975
6091
|
return {
|
|
6092
|
+
dropReasoningParts: thinkingParts,
|
|
6093
|
+
mutationParts: index.get(compositeKey)?.occurrences.map(({ message, part }) => ({ message, part })) ?? [],
|
|
5976
6094
|
measureReclaim: (skeleton) => {
|
|
5977
6095
|
const entry = index.get(compositeKey);
|
|
5978
6096
|
const parts = entry?.occurrences.map((occ) => occ.part) ?? [];
|
|
@@ -6082,29 +6200,62 @@ var sessionProviders = new Map;
|
|
|
6082
6200
|
function resolveHostServedBoundaryId2(sessionId, messageId) {
|
|
6083
6201
|
if (messageId.length === 0)
|
|
6084
6202
|
return messageId;
|
|
6085
|
-
return sessionProviders.get(sessionId)?.readServedBoundaryId?.(messageId) ?? messageId;
|
|
6203
|
+
return sessionProviders.get(sessionId)?.provider.readServedBoundaryId?.(messageId) ?? messageId;
|
|
6086
6204
|
}
|
|
6087
6205
|
function hasRawMessageProvider2(sessionId) {
|
|
6088
6206
|
return sessionProviders.has(sessionId);
|
|
6089
6207
|
}
|
|
6090
6208
|
function setRawMessageProvider(sessionId, provider) {
|
|
6091
|
-
sessionProviders.
|
|
6209
|
+
const current = sessionProviders.get(sessionId);
|
|
6210
|
+
const registration = current?.provider === provider ? current : { provider, scopes: 0 };
|
|
6211
|
+
registration.scopes += 1;
|
|
6212
|
+
sessionProviders.set(sessionId, registration);
|
|
6213
|
+
let active = true;
|
|
6092
6214
|
return () => {
|
|
6093
|
-
|
|
6094
|
-
|
|
6215
|
+
if (!active)
|
|
6216
|
+
return;
|
|
6217
|
+
active = false;
|
|
6218
|
+
registration.scopes -= 1;
|
|
6219
|
+
if (registration.scopes === 0 && sessionProviders.get(sessionId) === registration) {
|
|
6095
6220
|
sessionProviders.delete(sessionId);
|
|
6221
|
+
}
|
|
6096
6222
|
};
|
|
6097
6223
|
}
|
|
6224
|
+
var boundedProviderWrappers = new WeakMap;
|
|
6098
6225
|
function setBoundedRawMessageProvider2(sessionId, provider) {
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6226
|
+
let wrapper = boundedProviderWrappers.get(provider);
|
|
6227
|
+
if (!wrapper) {
|
|
6228
|
+
wrapper = {
|
|
6229
|
+
...provider,
|
|
6230
|
+
readMessages: () => {
|
|
6231
|
+
throw new Error("Bounded raw-message providers cannot read complete history; full reads are reserved for store-generation conversion");
|
|
6232
|
+
}
|
|
6233
|
+
};
|
|
6234
|
+
boundedProviderWrappers.set(provider, wrapper);
|
|
6235
|
+
}
|
|
6236
|
+
return setRawMessageProvider(sessionId, wrapper);
|
|
6105
6237
|
}
|
|
6238
|
+
var SYSTEM_REMINDER_BLOCK_REGEX = /<system-reminder>[\s\S]*?<\/system-reminder>/gi;
|
|
6106
6239
|
function cleanUserText2(text) {
|
|
6107
|
-
return
|
|
6240
|
+
return stripOutsideSteeringWrappers(text, (segment) => segment.replace(SYSTEM_REMINDER_BLOCK_REGEX, "").replace(OMO_INTERNAL_INITIATOR_MARKER, "")).trim();
|
|
6241
|
+
}
|
|
6242
|
+
function hasMeaningfulChunkUserText(parts) {
|
|
6243
|
+
for (const part of parts) {
|
|
6244
|
+
if (part === null || typeof part !== "object")
|
|
6245
|
+
continue;
|
|
6246
|
+
const candidate = part;
|
|
6247
|
+
if (candidate.type !== "text" || typeof candidate.text !== "string")
|
|
6248
|
+
continue;
|
|
6249
|
+
if (candidate.ignored === true)
|
|
6250
|
+
continue;
|
|
6251
|
+
const cleaned = cleanUserText2(candidate.text);
|
|
6252
|
+
if (!cleaned)
|
|
6253
|
+
continue;
|
|
6254
|
+
if (isSystemDirective(cleaned))
|
|
6255
|
+
continue;
|
|
6256
|
+
return true;
|
|
6257
|
+
}
|
|
6258
|
+
return false;
|
|
6108
6259
|
}
|
|
6109
6260
|
function withRawSessionMessageCache2(fn) {
|
|
6110
6261
|
const outerCache = activeRawMessageCache;
|
|
@@ -6140,7 +6291,7 @@ function readRawSessionMessages2(sessionId) {
|
|
|
6140
6291
|
return readRawSessionMessagesFromSource(sessionId);
|
|
6141
6292
|
}
|
|
6142
6293
|
function readRawSessionMessagePage2(sessionId, afterOrdinal, limit, finalWatermark, after) {
|
|
6143
|
-
const provider = sessionProviders.get(sessionId);
|
|
6294
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6144
6295
|
if (provider?.readMessagePage) {
|
|
6145
6296
|
return provider.readMessagePage(afterOrdinal, limit, finalWatermark, after);
|
|
6146
6297
|
}
|
|
@@ -6152,7 +6303,7 @@ function readRawSessionMessagePage2(sessionId, afterOrdinal, limit, finalWaterma
|
|
|
6152
6303
|
return withReadOnlySessionDb((db) => readRawSessionMessagePageFromDb(db, sessionId, afterOrdinal, limit, finalWatermark, after));
|
|
6153
6304
|
}
|
|
6154
6305
|
function getRawSessionMessageOrdinalCount2(sessionId) {
|
|
6155
|
-
const provider = sessionProviders.get(sessionId);
|
|
6306
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6156
6307
|
if (provider) {
|
|
6157
6308
|
if (provider.getMessageCount)
|
|
6158
6309
|
return provider.getMessageCount();
|
|
@@ -6165,7 +6316,7 @@ function getRawSessionMessageOrdinalCount2(sessionId) {
|
|
|
6165
6316
|
}
|
|
6166
6317
|
var RAW_MESSAGE_RANGE_PAGE_SIZE = 100;
|
|
6167
6318
|
function readRawSessionMessageRangeFromSource(sessionId, fromOrdinal, toOrdinal) {
|
|
6168
|
-
const provider = sessionProviders.get(sessionId);
|
|
6319
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6169
6320
|
if (provider?.iterateMessageRange)
|
|
6170
6321
|
return [...provider.iterateMessageRange(fromOrdinal, toOrdinal)];
|
|
6171
6322
|
if (provider && !provider.readMessagePage) {
|
|
@@ -6202,7 +6353,7 @@ function visitRawSessionMessages2(sessionId, fromOrdinal, toOrdinal, visit, opti
|
|
|
6202
6353
|
const to = Math.floor(toOrdinal);
|
|
6203
6354
|
if (to < from)
|
|
6204
6355
|
return;
|
|
6205
|
-
const provider = sessionProviders.get(sessionId);
|
|
6356
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6206
6357
|
if (provider?.iterateMessageRange) {
|
|
6207
6358
|
for (const message of provider.iterateMessageRange(from, to)) {
|
|
6208
6359
|
if (!visit(message))
|
|
@@ -6279,7 +6430,7 @@ function primeTailRawMessageCache2(args) {
|
|
|
6279
6430
|
return false;
|
|
6280
6431
|
if (lastCompartmentEnd < 1 || !anchorMessageId)
|
|
6281
6432
|
return false;
|
|
6282
|
-
const provider = sessionProviders.get(sessionId);
|
|
6433
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6283
6434
|
if (provider) {
|
|
6284
6435
|
if (!provider.readMessagePage || !provider.getMessageCount)
|
|
6285
6436
|
return false;
|
|
@@ -6331,7 +6482,7 @@ function readRawSessionMessageIdOrdinalsForRange2(sessionId, fromOrdinal, toOrdi
|
|
|
6331
6482
|
const to = Math.floor(toOrdinal);
|
|
6332
6483
|
if (to < from)
|
|
6333
6484
|
return new Map;
|
|
6334
|
-
const provider = sessionProviders.get(sessionId);
|
|
6485
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6335
6486
|
if (provider?.readMessageIdOrdinalsForRange) {
|
|
6336
6487
|
return provider.readMessageIdOrdinalsForRange(from, to);
|
|
6337
6488
|
}
|
|
@@ -6342,7 +6493,7 @@ function readRawSessionMessageIdOrdinalsForRange2(sessionId, fromOrdinal, toOrdi
|
|
|
6342
6493
|
return new Map([...all].filter(([, ordinal]) => ordinal >= from && ordinal <= to));
|
|
6343
6494
|
}
|
|
6344
6495
|
function hasRawSessionMessageById2(sessionId, messageId) {
|
|
6345
|
-
const provider = sessionProviders.get(sessionId);
|
|
6496
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6346
6497
|
if (provider?.hasMessageById)
|
|
6347
6498
|
return provider.hasMessageById(messageId);
|
|
6348
6499
|
if (!provider)
|
|
@@ -6350,7 +6501,7 @@ function hasRawSessionMessageById2(sessionId, messageId) {
|
|
|
6350
6501
|
return readRawSessionMessageById2(sessionId, messageId) !== null;
|
|
6351
6502
|
}
|
|
6352
6503
|
function readRawSessionMessageOrdinalById2(sessionId, messageId) {
|
|
6353
|
-
const provider = sessionProviders.get(sessionId);
|
|
6504
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6354
6505
|
if (provider?.readMessageOrdinalById) {
|
|
6355
6506
|
return provider.readMessageOrdinalById(messageId);
|
|
6356
6507
|
}
|
|
@@ -6387,7 +6538,7 @@ function readRawSessionMessageOrdinalById2(sessionId, messageId) {
|
|
|
6387
6538
|
return withReadOnlySessionDb((db) => readRawSessionMessageOrdinalByIdFromDb(db, sessionId, messageId));
|
|
6388
6539
|
}
|
|
6389
6540
|
function compareRawSessionMessageOrder2(sessionId, leftId, rightId) {
|
|
6390
|
-
const provider = sessionProviders.get(sessionId);
|
|
6541
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6391
6542
|
if (provider) {
|
|
6392
6543
|
if (!provider.readMessageOrdinalById)
|
|
6393
6544
|
return null;
|
|
@@ -6411,7 +6562,7 @@ function compareRawSessionMessageOrder2(sessionId, leftId, rightId) {
|
|
|
6411
6562
|
});
|
|
6412
6563
|
}
|
|
6413
6564
|
function readRawSessionMessageById2(sessionId, messageId) {
|
|
6414
|
-
const provider = sessionProviders.get(sessionId);
|
|
6565
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6415
6566
|
if (provider?.readMessageById) {
|
|
6416
6567
|
return provider.readMessageById(messageId);
|
|
6417
6568
|
}
|
|
@@ -6423,7 +6574,7 @@ function readRawSessionMessageById2(sessionId, messageId) {
|
|
|
6423
6574
|
return withReadOnlySessionDb((db) => readRawSessionMessageByIdFromDb(db, sessionId, messageId));
|
|
6424
6575
|
}
|
|
6425
6576
|
function readRawSessionMessagesFromSource(sessionId) {
|
|
6426
|
-
const provider = sessionProviders.get(sessionId);
|
|
6577
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6427
6578
|
if (provider)
|
|
6428
6579
|
return provider.readMessages();
|
|
6429
6580
|
if (!openCodeDbExists())
|
|
@@ -6431,7 +6582,7 @@ function readRawSessionMessagesFromSource(sessionId) {
|
|
|
6431
6582
|
return withReadOnlySessionDb((db) => readRawSessionMessagesFromDb(db, sessionId));
|
|
6432
6583
|
}
|
|
6433
6584
|
function getRawSessionMessageCount2(sessionId) {
|
|
6434
|
-
const provider = sessionProviders.get(sessionId);
|
|
6585
|
+
const provider = sessionProviders.get(sessionId)?.provider;
|
|
6435
6586
|
if (provider) {
|
|
6436
6587
|
if (provider.getMessageCount)
|
|
6437
6588
|
return provider.getMessageCount();
|
|
@@ -6701,7 +6852,7 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
|
|
|
6701
6852
|
const meta = { ordinal: msg.ordinal, messageId: msg.id };
|
|
6702
6853
|
if (isHostUnservedRow(msg))
|
|
6703
6854
|
markHostUnservedRow(meta);
|
|
6704
|
-
if (msg.role === "user" && !
|
|
6855
|
+
if (msg.role === "user" && !hasMeaningfulChunkUserText(msg.parts)) {
|
|
6705
6856
|
const tcSummaries = msg.parts.flatMap((part) => {
|
|
6706
6857
|
if (expandedResults.has(part))
|
|
6707
6858
|
return [];
|
|
@@ -6839,4 +6990,4 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
|
|
|
6839
6990
|
toolResultBoundaries
|
|
6840
6991
|
};
|
|
6841
6992
|
}
|
|
6842
|
-
export { toolTemplateError, DEFAULT_PROTECTED_TOOLS, normalizeProtectedToolName, mergeProtectedTools, isRecord, isPrefixBoundThinkingModel, detectOverflow, protectedToolTagNumbers, protectedToolTokenCount, textMentionsRecentCommit, removeSystemReminders, hasMeaningfulUserText2, extractTexts2, getTokenizerNativeMemoryStats, preloadTokenizer, estimateTokens, estimateFixedPromptTokens, stripWellFormedLeadingTagPrefix, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, isThinkingPart, stableStringify, contentTagOwnerMessageId, estimateImageTokensFromDataUrl, estimateToolAttachmentImageTokens, normalizeTodoStateJson, buildSyntheticTodoPart, isSyntheticTodoPart, countRealUserMessages, tailHygieneStructuralSignature, sameTailHygieneStructuralSignature, formatTailHygienePrefixMismatch, refreshTailHygieneBaseline, effectiveTailHygiene, assertTailHygieneContentUnchangedIfEnabled, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, isDroppedToolOutput, toolOutputTokens, decideChannel1, evaluateChannel2, formatChannel1Evaluation, formatChannel2Evaluation, reclaimableToolOutputCount, buildChannel2Reminder, buildChannel1Reminder, estimateEmergencyDropReclaimTokens, planEmergencyDrop, measureEmergencyTag, installV3PerfSchema, queuePendingOp, queuePendingDropForUnchangedTag, getPendingOps, getPendingOpsCount, clearPendingOps, removePendingOp, getRecentTagOwnerMessageIds, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, getActiveTagTokenTotalsByMessage, getAllStatusTagTokenTotalsFlat, getReasoningTokenEstimatesByMessage, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, markWhitespaceAssistantTagInert, getInertWhitespaceAssistantTags, updateTagDropMode, updateCavemanDepth, updateTagMessageId, foldShrunkPartTags, markTagsCompactedByMessageIds, getMaxTagNumberBySession, getTagNumberByMessageId, getAssignableTagNumberByMessageId, deriveTagLoadFloor, TAG_SELECT_COLUMNS, getTagsBySession, getActiveTagsBySession, getTailHygieneTags, getTagsByNumbers, getNewestToolTagNumbers, getDroppedTagsByNumbers, getMaxDroppedTagNumber, getTagById, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, getCandidateToolOwners, pickNearestPriorOwner, expandToolPart, markHostUnservedRow, retreatPastHostUnservedRows, snapTerminalCompartmentToServedRow, isHostRenderedSystemMessage, isStrictGapHealingMessage, extractInMemoryMessageViews, buildInMemoryTailRawMessages, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, isTextPart, isToolPartWithOutput, isFilePart, buildFileSourceContent, toolPartHasUserAnswer, recordToolParameters, createDroppedInputGuard, assertExecutableToolInput, isEditTool, getCurrentToolSetHash, setDatabase, loadToolDefinitionMeasurements, recordToolDefinition, getMeasuredToolDefinitionTokens, describeFinalWireTail, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, neutralizedReasoningSource, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, SKELETON_REAL_INPUT_MAX_BYTES, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, resolveHostServedBoundaryId2, hasRawMessageProvider2, setBoundedRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, visitRawSessionMessages2, readRawSessionMessageRange2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageIdOrdinalsForRange2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, readSessionChunk2 };
|
|
6993
|
+
export { toolTemplateError, DEFAULT_PROTECTED_TOOLS, normalizeProtectedToolName, mergeProtectedTools, isRecord, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, protectedToolTagNumbers, protectedToolTokenCount, textMentionsRecentCommit, removeSystemReminders, hasMeaningfulUserText2, extractTexts2, getTokenizerNativeMemoryStats, preloadTokenizer, estimateTokens, estimateFixedPromptTokens, stripWellFormedLeadingTagPrefix, byteSize, stripTagPrefix, peelLeadingMcTagNotation, prependTag, isThinkingPart, stableStringify, contentTagOwnerMessageId, estimateImageTokensFromDataUrl, estimateToolAttachmentImageTokens, normalizeTodoStateJson, buildSyntheticTodoPart, isSyntheticTodoPart, countRealUserMessages, tailHygieneStructuralSignature, sameTailHygieneStructuralSignature, formatTailHygienePrefixMismatch, refreshTailHygieneBaseline, effectiveTailHygiene, assertTailHygieneContentUnchangedIfEnabled, CHANNEL1_SENTINEL, CHANNEL1_FLOOR_TOKENS, isDroppedToolOutput, toolOutputTokens, decideChannel1, evaluateChannel2, formatChannel1Evaluation, formatChannel2Evaluation, reclaimableToolOutputCount, buildChannel2Reminder, buildChannel1Reminder, estimateEmergencyDropReclaimTokens, planEmergencyDrop, measureEmergencyTag, installV3PerfSchema, queuePendingOp, queuePendingDropForUnchangedTag, getPendingOps, getPendingOpsCount, clearPendingOps, removePendingOp, getRecentTagOwnerMessageIds, AGE_RECLAIM_MIN_TOKENS, getOldestActiveUnprotectedToolTags, getActiveToolTagsForAgeReclaim, getTriggerTagTokenUpperBound, getActiveTagTokenTotalsByMessage, getAllStatusTagTokenTotalsFlat, getReasoningTokenEstimatesByMessage, tagTokenCountIsNull, backfillTagTokenCounts, insertTag, updateTagStatus, markWhitespaceAssistantTagInert, getInertWhitespaceAssistantTags, updateTagDropMode, updateCavemanDepth, updateTagMessageId, foldShrunkPartTags, markTagsCompactedByMessageIds, getMaxTagNumberBySession, getTagNumberByMessageId, getAssignableTagNumberByMessageId, deriveTagLoadFloor, TAG_SELECT_COLUMNS, getTagsBySession, getActiveTagsBySession, getTailHygieneTags, getTagsByNumbers, getNewestToolTagNumbers, getDroppedTagsByNumbers, getMaxDroppedTagNumber, getTagById, getToolTagNumberByOwner, getNullOwnerToolTag, adoptNullOwnerToolTag, getCandidateToolOwners, pickNearestPriorOwner, expandToolPart, markHostUnservedRow, retreatPastHostUnservedRows, snapTerminalCompartmentToServedRow, isHostRenderedSystemMessage, isStrictGapHealingMessage, extractInMemoryMessageViews, buildInMemoryTailRawMessages, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, stripSystemInjection, isTextPart, isToolPartWithOutput, isFilePart, buildFileSourceContent, toolPartHasUserAnswer, recordToolParameters, createDroppedInputGuard, assertExecutableToolInput, isEditTool, getCurrentToolSetHash, setDatabase, loadToolDefinitionMeasurements, recordToolDefinition, getMeasuredToolDefinitionTokens, describeFinalWireTail, estimateMessageTokens, wireContentBytes, createFinalWireUsageTracker, estimateFinalWireInputTokens, modelAcceptsEmptyContent, isAnthropicFamilyRoute, neutralizeDroppedReasoningPart, restoreNeutralizedReasoningPart, isNeutralizedReasoningPart, neutralizedReasoningSource, variantChangeBustsProviderCache, makeSentinel, makeWholeMessageSentinel, isSentinel, replaySentinelByMessageIds, SKELETON_REAL_INPUT_MAX_BYTES, partHasCompletedResult, extractToolCallObservation, ToolMutationBatch, createToolDropTarget, resolveHostServedBoundaryId2, hasRawMessageProvider2, setBoundedRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, visitRawSessionMessages2, readRawSessionMessageRange2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageIdOrdinalsForRange2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, readSessionChunk2 };
|
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-mrvm92n8.js");
|
|
20
20
|
setHarness("opencode2");
|
|
21
21
|
const duties = await registerContext(context);
|
|
22
22
|
log("[magic-context] @retaw106/mmc-oc v2 setup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-handlers.d.ts","sourceRoot":"","sources":["../../src/plugin/rpc-handlers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAoBzE,OAAO,EACH,KAAK,eAAe,IAAI,QAAQ,EAGnC,MAAM,mCAAmC,CAAC;AAe3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAQhG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AASlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAcvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAGR,wBAAwB,EACxB,eAAe,EACf,YAAY,EACf,MAAM,qBAAqB,CAAC;AAyF7B,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAK9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,iBAAiB,UAAO,GACzB,eAAe,CAsSjB;AAED,wBAAgB,iBAAiB,CAC7B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB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BAAgB,CAAC;IACnC,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,wBAAwB,CAAC,EAAE,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IAC5E,qFAAqF;IACrF,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,yBAAyB,GAAG,SAAS,CAAC;IACpE;0EACsE;IACtE,WAAW,CAAC,EAAE,MAAM,QAAQ,GAAG,IAAI,CAAC;CACvC,GACF,IAAI,CAmSN"}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
getRawSessionTagKeysThrough2,
|
|
24
24
|
getLegacyProtectedTailStartOrdinal2,
|
|
25
25
|
readSessionChunk2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-btp5tdc8.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-g2z2k5m4.js";
|
|
6
|
+
import"./index-5b7x80ec.js";
|
|
7
7
|
import"./index-amycb7b1.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-btp5tdc8.js";
|
|
9
9
|
import"./index-ramz5kkm.js";
|
|
10
10
|
import"./index-33gprt9g.js";
|
|
11
11
|
import"./index-1j34a56j.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type PiExecutableHarnessKind = "pi";
|
|
1
|
+
export type PiExecutableHarnessKind = "pi" | "omp";
|
|
2
2
|
/** Executable images recognized as Pi-compatible hosts. */
|
|
3
3
|
export declare const PI_IMAGE_NAMES: Set<string>;
|
|
4
4
|
/** Classify a process title or executable path using the shared Pi image vocabulary. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi-executable.d.ts","sourceRoot":"","sources":["../../src/shared/pi-executable.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"pi-executable.d.ts","sourceRoot":"","sources":["../../src/shared/pi-executable.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,IAAI,GAAG,KAAK,CAAC;AAEnD,2DAA2D;AAC3D,eAAO,MAAM,cAAc,aAA+C,CAAC;AAE3E,wFAAwF;AACxF,wBAAgB,2BAA2B,CACvC,KAAK,EAAE,MAAM,GAAG,SAAS,GAC1B,uBAAuB,GAAG,SAAS,CAWrC"}
|
|
@@ -14,7 +14,7 @@ export declare const LIGHT_TOOL_DESCRIPTIONS: {
|
|
|
14
14
|
readonly mmc_expand: "Recover one item with tag=N (a §N§ or dropped placeholder number), not a message ordinal; text or one tool call with full input/output. message=N and start/end are whole-message ordinals from history/search, never tag numbers. Recover raw conversation behind a <session-history> heading or around a mmc_search hit: mmc_expand(start, end) returns [N] U:/A: lines (~15K-token cap; oversized ranges return the head and where to continue). verbose=true lists messages with per-part previews to pick one; message=N returns that message in full, including a tool output released with mmc_reduce. Ranges after the last compartment are your live tail, not expandable.";
|
|
15
15
|
readonly mmc_note: "Session notes are pending intentions: work you intend to return to, with findings attached (\"take a note\" always qualifies). Not active steps, an executing plan, or restart insurance; a record of how things stand (world-state, a design at a point in time) with nothing you intend to do about it — that goes stale silently; a fact worth keeping is memory, the rest is nothing. First line = title (<80 chars). write saves; read lists rows (note_ids for bodies); update changes one; dismiss retires 1–50. Dismiss a note when its work lands or is abandoned; a queue you never dismiss from stops being read.";
|
|
16
16
|
readonly mmc_memory: "Durable facts about this project, shared with every agent on it and kept for the months this work lasts; active ones are already in <project-memory> as `#id: fact`. Write one standalone fact when it must not have to be found again — a rule, an architecture fact, a constraint, a config value, a naming convention — especially what cost you turns. A pending intention with evidence is mmc_note, not memory. write (content + category); update one id (content; category optional); archive one or more ids (reason optional); merge two or more ids (content); get 1–20 ids in any status.";
|
|
17
|
-
readonly mmc_search: "Search
|
|
17
|
+
readonly mmc_search: "Search past context not on your desk: memories not in <project-memory>, compacted conversation, notes. Phrase query as a natural-language question carrying the exact terms you expect (\"where is the opencode source code path?\", \"why did we choose SQLite over postgres?\", \"how does the historian lease work?\") — a keyword stack finds less. Sources (omit for all): memory (rules, conventions), message (compacted conversation; hits carry ordinals for mmc_expand), primer (stored project Q&A), note (parked follow-ups). Memory ids alone (`#7234`) resolve directly. from/to restrict every source to an inclusive UTC date range.";
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* Preserve the existing full-preset hash exactly while giving other presets a
|
|
@@ -29,6 +29,16 @@
|
|
|
29
29
|
* the runner contract is purely additive on the OpenCode side.
|
|
30
30
|
*/
|
|
31
31
|
import type { ModelInput } from "./model-resolution";
|
|
32
|
+
/**
|
|
33
|
+
* Hard ceiling on historian carrier steps per invocation (upstream 1c8526be
|
|
34
|
+
* parity: `hidden-agent-registrations` caps historian/recomp/editor at 4 —
|
|
35
|
+
* each pass emits one XML answer, so a small fixed cap bounds a runaway
|
|
36
|
+
* zero-tool loop; a per-request output cap or a timeout cannot bound step
|
|
37
|
+
* count). Shared by both harnesses: the OpenCode registration and executor
|
|
38
|
+
* safeguard clamp to it, and the Pi runner enforces it against assistant
|
|
39
|
+
* steps in the child's event stream.
|
|
40
|
+
*/
|
|
41
|
+
export declare const HISTORIAN_STEP_CAP = 4;
|
|
32
42
|
/**
|
|
33
43
|
* Configuration for one subagent invocation.
|
|
34
44
|
*
|
|
@@ -81,6 +91,15 @@ export interface SubagentRunOptions {
|
|
|
81
91
|
* speed (local models), or "medium"/"high" for better quality.
|
|
82
92
|
*/
|
|
83
93
|
thinkingLevel?: string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Pi only: hard cap on assistant steps for this child run (kill with
|
|
96
|
+
* `step_limit` past it). OpenCode ignores this field — its step caps ride
|
|
97
|
+
* the host agent registration plus the hidden-child executor wiring.
|
|
98
|
+
* Absent on Pi → the historian default (`HISTORIAN_STEP_CAP`); used by
|
|
99
|
+
* the Pi maintenance runner (stage A fixed cap, stage B per-round
|
|
100
|
+
* remaining-budget cap).
|
|
101
|
+
*/
|
|
102
|
+
stepCap?: number | undefined;
|
|
84
103
|
/**
|
|
85
104
|
* Optional progress callback. The runner invokes it for milestone events
|
|
86
105
|
* during the run: spawn, first event received, terminal stop reason
|
|
@@ -162,6 +181,8 @@ export type SubagentProgressEvent = {
|
|
|
162
181
|
* - `reason`: failure category, one of:
|
|
163
182
|
* - `"invalid_prompt"`: a known zero-tool child was given no system prompt
|
|
164
183
|
* - `"timeout"`: hit `timeoutMs` before the child finished
|
|
184
|
+
* - `"step_limit"`: the child exceeded its per-agent step cap
|
|
185
|
+
* (historian; `HISTORIAN_STEP_CAP`)
|
|
165
186
|
* - `"abort"`: caller's `signal` was triggered
|
|
166
187
|
* - `"model_failed"`: every configured model + fallback returned an error
|
|
167
188
|
* - `"truncated"`: child stopped because model output hit length limits
|
|
@@ -200,7 +221,7 @@ export type SubagentRunResult = {
|
|
|
200
221
|
meta?: Record<string, unknown>;
|
|
201
222
|
} | {
|
|
202
223
|
ok: false;
|
|
203
|
-
reason: "invalid_prompt" | "timeout" | "abort" | "model_failed" | "truncated" | "spawn_failed" | "non_zero_exit" | "no_assistant" | "parse_failed";
|
|
224
|
+
reason: "invalid_prompt" | "timeout" | "abort" | "step_limit" | "model_failed" | "truncated" | "spawn_failed" | "non_zero_exit" | "no_assistant" | "parse_failed";
|
|
204
225
|
error: string;
|
|
205
226
|
durationMs: number;
|
|
206
227
|
/** True when the caller should retry the task rather than advance its schedule. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-runner.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-runner.ts"],"names":[],"mappings":"AAAA;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;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChE"}
|
|
@@ -2,5 +2,5 @@ export declare const CTX_REDUCE_LIGHT_DESCRIPTION = "Stamp an item as no longer
|
|
|
2
2
|
export declare const CTX_EXPAND_LIGHT_DESCRIPTION = "Recover one item with tag=N (a \u00A7N\u00A7 or dropped placeholder number), not a message ordinal; text or one tool call with full input/output. message=N and start/end are whole-message ordinals from history/search, never tag numbers. Recover raw conversation behind a <session-history> heading or around a mmc_search hit: mmc_expand(start, end) returns [N] U:/A: lines (~15K-token cap; oversized ranges return the head and where to continue). verbose=true lists messages with per-part previews to pick one; message=N returns that message in full, including a tool output released with mmc_reduce. Ranges after the last compartment are your live tail, not expandable.";
|
|
3
3
|
export declare const CTX_NOTE_LIGHT_DESCRIPTION = "Session notes are pending intentions: work you intend to return to, with findings attached (\"take a note\" always qualifies). Not active steps, an executing plan, or restart insurance; a record of how things stand (world-state, a design at a point in time) with nothing you intend to do about it \u2014 that goes stale silently; a fact worth keeping is memory, the rest is nothing. First line = title (<80 chars). write saves; read lists rows (note_ids for bodies); update changes one; dismiss retires 1\u201350. Dismiss a note when its work lands or is abandoned; a queue you never dismiss from stops being read.";
|
|
4
4
|
export declare const CTX_MEMORY_LIGHT_DESCRIPTION = "Durable facts about this project, shared with every agent on it and kept for the months this work lasts; active ones are already in <project-memory> as `#id: fact`. Write one standalone fact when it must not have to be found again \u2014 a rule, an architecture fact, a constraint, a config value, a naming convention \u2014 especially what cost you turns. A pending intention with evidence is mmc_note, not memory. write (content + category); update one id (content; category optional); archive one or more ids (reason optional); merge two or more ids (content); get 1\u201320 ids in any status.";
|
|
5
|
-
export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "Search
|
|
5
|
+
export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "Search past context not on your desk: memories not in <project-memory>, compacted conversation, notes. Phrase query as a natural-language question carrying the exact terms you expect (\"where is the opencode source code path?\", \"why did we choose SQLite over postgres?\", \"how does the historian lease work?\") \u2014 a keyword stack finds less. Sources (omit for all): memory (rules, conventions), message (compacted conversation; hits carry ordinals for mmc_expand), primer (stored project Q&A), note (parked follow-ups). Memory ids alone (`#7234`) resolve directly. from/to restrict every source to an inclusive UTC date range.";
|
|
6
6
|
//# sourceMappingURL=light-descriptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,0wBAAivB,CAAC;AAE3xB,eAAO,MAAM,4BAA4B,kqBACgnB,CAAC;AAE1pB,eAAO,MAAM,0BAA0B,2mBACyjB,CAAC;AAEjmB,eAAO,MAAM,4BAA4B,ylBACkiB,CAAC;AAE5kB,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,0wBAAivB,CAAC;AAE3xB,eAAO,MAAM,4BAA4B,kqBACgnB,CAAC;AAE1pB,eAAO,MAAM,0BAA0B,2mBACyjB,CAAC;AAEjmB,eAAO,MAAM,4BAA4B,ylBACkiB,CAAC;AAE5kB,eAAO,MAAM,4BAA4B,8nBAC2kB,CAAC"}
|
|
@@ -23,7 +23,6 @@ export declare const FULL_PARAMETER_DESCRIPTIONS: {
|
|
|
23
23
|
readonly content: "The memory text — one standalone fact (write, update, merge).";
|
|
24
24
|
readonly category: "Kind of fact (required for write; on update/merge optional, omitted keeps the current category).";
|
|
25
25
|
readonly ids: "Memory ids from <project-memory>: one for update, one or more for archive, two or more for merge, 1–20 for get.";
|
|
26
|
-
readonly limit: "Max results for list (default 10).";
|
|
27
26
|
readonly reason: "Why it is being archived (optional).";
|
|
28
27
|
};
|
|
29
28
|
readonly mmc_search: {
|
|
@@ -58,13 +57,12 @@ export declare const LIGHT_PARAMETER_DESCRIPTIONS: {
|
|
|
58
57
|
readonly content: "One standalone fact (write, update, merge).";
|
|
59
58
|
readonly category: "Kind of fact (required for write; optional on update/merge).";
|
|
60
59
|
readonly ids: "Ids from <project-memory>: one for update, 1+ for archive, 2+ for merge, 1–20 for get.";
|
|
61
|
-
readonly limit: "Max results for list (default 10).";
|
|
62
60
|
readonly reason: "Why it is archived (optional).";
|
|
63
61
|
};
|
|
64
62
|
readonly mmc_search: {
|
|
65
63
|
readonly query: "A natural-language question carrying the exact terms you expect in the answer.";
|
|
66
64
|
readonly limit: "Maximum results (default 10).";
|
|
67
|
-
readonly sources: "
|
|
65
|
+
readonly sources: "Sources; omit or [] for all.";
|
|
68
66
|
readonly from: "Earliest date, YYYY-MM-DD (inclusive).";
|
|
69
67
|
readonly to: "Latest date, YYYY-MM-DD (inclusive; default open).";
|
|
70
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameter-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/parameter-descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"parameter-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/parameter-descriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC9B,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC/B,CAAC;AAEX,MAAM,MAAM,4BAA4B,GAAG,MAAM,OAAO,2BAA2B,CAAC;AAEpF,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,mBAAmB,GAC5B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAI9C;AAED,wBAAgB,oCAAoC,CAChD,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,mBAAmB,GAC5B,IAAI,CAWN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/context.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAiDxD,OAAO,EACH,KAAK,qBAAqB,EAE7B,MAAM,mDAAmD,CAAC;AA0B3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAIH,KAAK,aAAa,EACrB,MAAM,qCAAqC,CAAC;AAmB7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAGH,KAAK,oBAAoB,EAC5B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACH,KAAK,QAAQ,EAMhB,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,EAAkB,KAAK,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AA2CxF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAa,MAAM,SAAS,CAAC;AAUpE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQlE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,kBAAkB,GAAG,eAAe,CAAC,EACjE,SAAS,EAAE,MAAM,GAClB,qBAAqB,GAAG,SAAS,CAanC;AAED;;;;;;;;;;GAUG;AACH,wBAAs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