@retaw106/mmc-oc 2.1.2 → 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.
Files changed (98) hide show
  1. package/dist/agents/memory-maintainer.d.ts +9 -0
  2. package/dist/agents/memory-maintainer.d.ts.map +1 -1
  3. package/dist/cli.js +0 -1
  4. package/dist/config/project-security.d.ts +0 -2
  5. package/dist/config/project-security.d.ts.map +1 -1
  6. package/dist/config/schema/magic-context.d.ts +0 -5
  7. package/dist/config/schema/magic-context.d.ts.map +1 -1
  8. package/dist/config-init.js +0 -1
  9. package/dist/{context-gxm0q7tz.js → context-mrvm92n8.js} +3462 -3133
  10. package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts +0 -6
  11. package/dist/features/magic-context/memory-maintainer/oc2-adapter.d.ts.map +1 -1
  12. package/dist/features/magic-context/migrations.d.ts +5 -0
  13. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  14. package/dist/features/magic-context/session-project-backfill.d.ts +1 -1
  15. package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
  16. package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
  17. package/dist/features/magic-context/storage-db.d.ts +8 -0
  18. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  19. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  20. package/dist/features/magic-context/storage.d.ts +1 -1
  21. package/dist/features/magic-context/storage.d.ts.map +1 -1
  22. package/dist/hooks/magic-context/cache-busting-signals.d.ts +6 -3
  23. package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
  24. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts +0 -1
  25. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  26. package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
  27. package/dist/hooks/magic-context/compartment-trigger.d.ts.map +1 -1
  28. package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts +37 -0
  29. package/dist/hooks/magic-context/default-protection-pressure.test-support.d.ts.map +1 -0
  30. package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts +4 -0
  31. package/dist/hooks/magic-context/drop-stale-reduce-calls.d.ts.map +1 -1
  32. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  33. package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +61 -0
  34. package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -0
  35. package/dist/hooks/magic-context/lkg-replay.d.ts +9 -0
  36. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  37. package/dist/hooks/magic-context/lkg-slot.d.ts +2 -0
  38. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  39. package/dist/hooks/magic-context/read-session-chunk.d.ts +8 -1
  40. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  41. package/dist/hooks/magic-context/strip-content.d.ts +4 -2
  42. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  43. package/dist/hooks/magic-context/system-injection-stripper.d.ts +7 -0
  44. package/dist/hooks/magic-context/system-injection-stripper.d.ts.map +1 -1
  45. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  46. package/dist/hooks/magic-context/tool-drop-target.d.ts +5 -0
  47. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  48. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +23 -7
  49. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  50. package/dist/hooks/magic-context/transform.d.ts +0 -6
  51. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  52. package/dist/{index-ys43j25b.js → index-5b7x80ec.js} +126 -44
  53. package/dist/{index-cszxqtev.js → index-btp5tdc8.js} +180 -31
  54. package/dist/{index-pynrjyjy.js → index-g2z2k5m4.js} +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  57. package/dist/{read-session-chunk-e4dby3pb.js → read-session-chunk-2xm4sc4y.js} +1 -1
  58. package/dist/{recomp-orchestrator-xg3jm3s2.js → recomp-orchestrator-frmwj9hz.js} +3 -3
  59. package/dist/shared/pi-executable.d.ts +1 -1
  60. package/dist/shared/pi-executable.d.ts.map +1 -1
  61. package/dist/shared/prompt-surface-runtime.d.ts +1 -1
  62. package/dist/shared/subagent-runner.d.ts +22 -1
  63. package/dist/shared/subagent-runner.d.ts.map +1 -1
  64. package/dist/tools/light-descriptions.d.ts +1 -1
  65. package/dist/tools/light-descriptions.d.ts.map +1 -1
  66. package/dist/tools/parameter-descriptions.d.ts +1 -3
  67. package/dist/tools/parameter-descriptions.d.ts.map +1 -1
  68. package/dist/v2/hooks/context.d.ts.map +1 -1
  69. package/dist/v2/hooks/hidden-child.d.ts +15 -2
  70. package/dist/v2/hooks/hidden-child.d.ts.map +1 -1
  71. package/dist/v2/server.js +3463 -2906
  72. package/dist/web/main.js +8 -2
  73. package/dist/{wrapup-orchestrator-9spy01n8.js → wrapup-orchestrator-yknks3ad.js} +3 -3
  74. package/package.json +1 -1
  75. package/src/agents/memory-maintainer.ts +12 -0
  76. package/src/config/index.test.ts +0 -17
  77. package/src/config/project-security.test.ts +0 -8
  78. package/src/config/project-security.ts +0 -9
  79. package/src/config/protected-tools.test.ts +72 -0
  80. package/src/config/schema/magic-context.test.ts +0 -6
  81. package/src/config/schema/magic-context.ts +1 -10
  82. package/src/shared/fold-render-lock-fence.test.ts +84 -0
  83. package/src/shared/fold-render-lock-fixtures.test.ts +270 -0
  84. package/src/shared/pi-executable.ts +3 -3
  85. package/src/shared/rpc-utils.test.ts +4 -5
  86. package/src/shared/sqlite-640-review.test.ts +184 -0
  87. package/src/shared/sqlite-context-pragmas.test.ts +105 -0
  88. package/src/shared/sqlite-writer-diagnostics.test.ts +136 -0
  89. package/src/shared/subagent-runner.ts +24 -0
  90. package/src/shared/tag-transcript.test.ts +55 -0
  91. package/src/shared/tag-transcript.ts +6 -0
  92. package/src/shared/write-transaction-attribution.test.ts +4 -0
  93. package/src/shared/write-transaction-timing.test.ts +39 -0
  94. package/dist/hooks/magic-context/historian-state-file.d.ts +0 -43
  95. package/dist/hooks/magic-context/historian-state-file.d.ts.map +0 -1
  96. package/dist/shared/auto-update-provenance.d.ts +0 -9
  97. package/dist/shared/auto-update-provenance.d.ts.map +0 -1
  98. 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.filter((tag) => tag.status === "active" && tag.type === "tool"));
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 = input.protectedToolTags ?? protectedToolTagNumbers(input.tags, protectedToolsPolicy);
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.replace(CONTENT_ID_SUFFIX, "");
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.replace(CONTENT_ID_SUFFIX, "");
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);
@@ -4628,6 +4628,88 @@ function computeRawRangeFingerprint(messages, startInclusive, endExclusive) {
4628
4628
  return pieces.join("|");
4629
4629
  }
4630
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
+
4631
4713
  // src/hooks/magic-context/tag-part-guards.ts
4632
4714
  function isTextPart(part) {
4633
4715
  if (part === null || typeof part !== "object")
@@ -5384,6 +5466,33 @@ function extractErrorMessage(error) {
5384
5466
  }
5385
5467
  return String(error);
5386
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
+ }
5387
5496
  var PREFIX_BOUND_THINKING_MODELS = [
5388
5497
  ["fable", 5, 1],
5389
5498
  ["opus", 5, 5],
@@ -5396,6 +5505,11 @@ function isPrefixBoundThinkingModel(_providerID, modelID) {
5396
5505
  return false;
5397
5506
  return PREFIX_BOUND_THINKING_PATTERN.test(modelID);
5398
5507
  }
5508
+ function isFable51ThinkingBindingModel(providerID, modelID) {
5509
+ if (providerID?.toLowerCase() !== "anthropic" || !modelID)
5510
+ return false;
5511
+ return /(?:^|[-_.])fable[-_.]?5[-_.]1(?:$|[-_.])/i.test(modelID);
5512
+ }
5399
5513
  function detectOverflow(error) {
5400
5514
  const message = extractErrorMessage(error);
5401
5515
  if (!message) {
@@ -5531,7 +5645,7 @@ var VARIANT_CACHE_PRESERVING_MODELS = {
5531
5645
  function canonicalVariantModelIdentity(providerID, modelID) {
5532
5646
  const normalizedProviderID = providerID.toLowerCase();
5533
5647
  const isAnthropicFamily = normalizedProviderID === "anthropic" || normalizedProviderID === "google-vertex-anthropic" || normalizedProviderID.includes("bedrock");
5534
- if (isAnthropicFamily && isPrefixBoundThinkingModel("anthropic", modelID)) {
5648
+ if (isAnthropicFamily && isFable51ThinkingBindingModel("anthropic", modelID)) {
5535
5649
  return "anthropic/claude-fable-5-1";
5536
5650
  }
5537
5651
  return canonicalModelIdentity(`${providerID}/${modelID}`).toLowerCase();
@@ -5975,6 +6089,8 @@ function createToolDropTarget(compositeKey, thinkingParts, index, batch, tagId)
5975
6089
  return "truncated";
5976
6090
  };
5977
6091
  return {
6092
+ dropReasoningParts: thinkingParts,
6093
+ mutationParts: index.get(compositeKey)?.occurrences.map(({ message, part }) => ({ message, part })) ?? [],
5978
6094
  measureReclaim: (skeleton) => {
5979
6095
  const entry = index.get(compositeKey);
5980
6096
  const parts = entry?.occurrences.map((occ) => occ.part) ?? [];
@@ -6084,29 +6200,62 @@ var sessionProviders = new Map;
6084
6200
  function resolveHostServedBoundaryId2(sessionId, messageId) {
6085
6201
  if (messageId.length === 0)
6086
6202
  return messageId;
6087
- return sessionProviders.get(sessionId)?.readServedBoundaryId?.(messageId) ?? messageId;
6203
+ return sessionProviders.get(sessionId)?.provider.readServedBoundaryId?.(messageId) ?? messageId;
6088
6204
  }
6089
6205
  function hasRawMessageProvider2(sessionId) {
6090
6206
  return sessionProviders.has(sessionId);
6091
6207
  }
6092
6208
  function setRawMessageProvider(sessionId, provider) {
6093
- sessionProviders.set(sessionId, provider);
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;
6094
6214
  return () => {
6095
- const current = sessionProviders.get(sessionId);
6096
- if (current === provider)
6215
+ if (!active)
6216
+ return;
6217
+ active = false;
6218
+ registration.scopes -= 1;
6219
+ if (registration.scopes === 0 && sessionProviders.get(sessionId) === registration) {
6097
6220
  sessionProviders.delete(sessionId);
6221
+ }
6098
6222
  };
6099
6223
  }
6224
+ var boundedProviderWrappers = new WeakMap;
6100
6225
  function setBoundedRawMessageProvider2(sessionId, provider) {
6101
- return setRawMessageProvider(sessionId, {
6102
- ...provider,
6103
- readMessages: () => {
6104
- throw new Error("Bounded raw-message providers cannot read complete history; full reads are reserved for store-generation conversion");
6105
- }
6106
- });
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);
6107
6237
  }
6238
+ var SYSTEM_REMINDER_BLOCK_REGEX = /<system-reminder>[\s\S]*?<\/system-reminder>/gi;
6108
6239
  function cleanUserText2(text) {
6109
- return removeSystemReminders(text).replace(OMO_INTERNAL_INITIATOR_MARKER, "").trim();
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;
6110
6259
  }
6111
6260
  function withRawSessionMessageCache2(fn) {
6112
6261
  const outerCache = activeRawMessageCache;
@@ -6142,7 +6291,7 @@ function readRawSessionMessages2(sessionId) {
6142
6291
  return readRawSessionMessagesFromSource(sessionId);
6143
6292
  }
6144
6293
  function readRawSessionMessagePage2(sessionId, afterOrdinal, limit, finalWatermark, after) {
6145
- const provider = sessionProviders.get(sessionId);
6294
+ const provider = sessionProviders.get(sessionId)?.provider;
6146
6295
  if (provider?.readMessagePage) {
6147
6296
  return provider.readMessagePage(afterOrdinal, limit, finalWatermark, after);
6148
6297
  }
@@ -6154,7 +6303,7 @@ function readRawSessionMessagePage2(sessionId, afterOrdinal, limit, finalWaterma
6154
6303
  return withReadOnlySessionDb((db) => readRawSessionMessagePageFromDb(db, sessionId, afterOrdinal, limit, finalWatermark, after));
6155
6304
  }
6156
6305
  function getRawSessionMessageOrdinalCount2(sessionId) {
6157
- const provider = sessionProviders.get(sessionId);
6306
+ const provider = sessionProviders.get(sessionId)?.provider;
6158
6307
  if (provider) {
6159
6308
  if (provider.getMessageCount)
6160
6309
  return provider.getMessageCount();
@@ -6167,7 +6316,7 @@ function getRawSessionMessageOrdinalCount2(sessionId) {
6167
6316
  }
6168
6317
  var RAW_MESSAGE_RANGE_PAGE_SIZE = 100;
6169
6318
  function readRawSessionMessageRangeFromSource(sessionId, fromOrdinal, toOrdinal) {
6170
- const provider = sessionProviders.get(sessionId);
6319
+ const provider = sessionProviders.get(sessionId)?.provider;
6171
6320
  if (provider?.iterateMessageRange)
6172
6321
  return [...provider.iterateMessageRange(fromOrdinal, toOrdinal)];
6173
6322
  if (provider && !provider.readMessagePage) {
@@ -6204,7 +6353,7 @@ function visitRawSessionMessages2(sessionId, fromOrdinal, toOrdinal, visit, opti
6204
6353
  const to = Math.floor(toOrdinal);
6205
6354
  if (to < from)
6206
6355
  return;
6207
- const provider = sessionProviders.get(sessionId);
6356
+ const provider = sessionProviders.get(sessionId)?.provider;
6208
6357
  if (provider?.iterateMessageRange) {
6209
6358
  for (const message of provider.iterateMessageRange(from, to)) {
6210
6359
  if (!visit(message))
@@ -6281,7 +6430,7 @@ function primeTailRawMessageCache2(args) {
6281
6430
  return false;
6282
6431
  if (lastCompartmentEnd < 1 || !anchorMessageId)
6283
6432
  return false;
6284
- const provider = sessionProviders.get(sessionId);
6433
+ const provider = sessionProviders.get(sessionId)?.provider;
6285
6434
  if (provider) {
6286
6435
  if (!provider.readMessagePage || !provider.getMessageCount)
6287
6436
  return false;
@@ -6333,7 +6482,7 @@ function readRawSessionMessageIdOrdinalsForRange2(sessionId, fromOrdinal, toOrdi
6333
6482
  const to = Math.floor(toOrdinal);
6334
6483
  if (to < from)
6335
6484
  return new Map;
6336
- const provider = sessionProviders.get(sessionId);
6485
+ const provider = sessionProviders.get(sessionId)?.provider;
6337
6486
  if (provider?.readMessageIdOrdinalsForRange) {
6338
6487
  return provider.readMessageIdOrdinalsForRange(from, to);
6339
6488
  }
@@ -6344,7 +6493,7 @@ function readRawSessionMessageIdOrdinalsForRange2(sessionId, fromOrdinal, toOrdi
6344
6493
  return new Map([...all].filter(([, ordinal]) => ordinal >= from && ordinal <= to));
6345
6494
  }
6346
6495
  function hasRawSessionMessageById2(sessionId, messageId) {
6347
- const provider = sessionProviders.get(sessionId);
6496
+ const provider = sessionProviders.get(sessionId)?.provider;
6348
6497
  if (provider?.hasMessageById)
6349
6498
  return provider.hasMessageById(messageId);
6350
6499
  if (!provider)
@@ -6352,7 +6501,7 @@ function hasRawSessionMessageById2(sessionId, messageId) {
6352
6501
  return readRawSessionMessageById2(sessionId, messageId) !== null;
6353
6502
  }
6354
6503
  function readRawSessionMessageOrdinalById2(sessionId, messageId) {
6355
- const provider = sessionProviders.get(sessionId);
6504
+ const provider = sessionProviders.get(sessionId)?.provider;
6356
6505
  if (provider?.readMessageOrdinalById) {
6357
6506
  return provider.readMessageOrdinalById(messageId);
6358
6507
  }
@@ -6389,7 +6538,7 @@ function readRawSessionMessageOrdinalById2(sessionId, messageId) {
6389
6538
  return withReadOnlySessionDb((db) => readRawSessionMessageOrdinalByIdFromDb(db, sessionId, messageId));
6390
6539
  }
6391
6540
  function compareRawSessionMessageOrder2(sessionId, leftId, rightId) {
6392
- const provider = sessionProviders.get(sessionId);
6541
+ const provider = sessionProviders.get(sessionId)?.provider;
6393
6542
  if (provider) {
6394
6543
  if (!provider.readMessageOrdinalById)
6395
6544
  return null;
@@ -6413,7 +6562,7 @@ function compareRawSessionMessageOrder2(sessionId, leftId, rightId) {
6413
6562
  });
6414
6563
  }
6415
6564
  function readRawSessionMessageById2(sessionId, messageId) {
6416
- const provider = sessionProviders.get(sessionId);
6565
+ const provider = sessionProviders.get(sessionId)?.provider;
6417
6566
  if (provider?.readMessageById) {
6418
6567
  return provider.readMessageById(messageId);
6419
6568
  }
@@ -6425,7 +6574,7 @@ function readRawSessionMessageById2(sessionId, messageId) {
6425
6574
  return withReadOnlySessionDb((db) => readRawSessionMessageByIdFromDb(db, sessionId, messageId));
6426
6575
  }
6427
6576
  function readRawSessionMessagesFromSource(sessionId) {
6428
- const provider = sessionProviders.get(sessionId);
6577
+ const provider = sessionProviders.get(sessionId)?.provider;
6429
6578
  if (provider)
6430
6579
  return provider.readMessages();
6431
6580
  if (!openCodeDbExists())
@@ -6433,7 +6582,7 @@ function readRawSessionMessagesFromSource(sessionId) {
6433
6582
  return withReadOnlySessionDb((db) => readRawSessionMessagesFromDb(db, sessionId));
6434
6583
  }
6435
6584
  function getRawSessionMessageCount2(sessionId) {
6436
- const provider = sessionProviders.get(sessionId);
6585
+ const provider = sessionProviders.get(sessionId)?.provider;
6437
6586
  if (provider) {
6438
6587
  if (provider.getMessageCount)
6439
6588
  return provider.getMessageCount();
@@ -6703,7 +6852,7 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
6703
6852
  const meta = { ordinal: msg.ordinal, messageId: msg.id };
6704
6853
  if (isHostUnservedRow(msg))
6705
6854
  markHostUnservedRow(meta);
6706
- if (msg.role === "user" && !hasMeaningfulUserText2(msg.parts)) {
6855
+ if (msg.role === "user" && !hasMeaningfulChunkUserText(msg.parts)) {
6707
6856
  const tcSummaries = msg.parts.flatMap((part) => {
6708
6857
  if (expandedResults.has(part))
6709
6858
  return [];
@@ -6841,4 +6990,4 @@ function readSessionChunk2(sessionId, tokenBudget, offset = 1, eligibleEndOrdina
6841
6990
  toolResultBoundaries
6842
6991
  };
6843
6992
  }
6844
- 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 };
@@ -4,7 +4,7 @@ import {
4
4
  renderUserFacingFailure,
5
5
  userFacingFailureCode,
6
6
  executeContextRecomp
7
- } from "./index-ys43j25b.js";
7
+ } from "./index-5b7x80ec.js";
8
8
  import {
9
9
  sessionLog
10
10
  } from "./index-qbkzdkk0.js";
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-gxm0q7tz.js");
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;AAmBzE,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,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,qBAAqB,CAAC,EAAE,MAAM,EAC9B,iBAAiB,UAAO,GACzB,Y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D,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-cszxqtev.js";
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-pynrjyjy.js";
6
- import"./index-ys43j25b.js";
5
+ } from "./index-g2z2k5m4.js";
6
+ import"./index-5b7x80ec.js";
7
7
  import"./index-amycb7b1.js";
8
- import"./index-cszxqtev.js";
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;AAE3C,2DAA2D;AAC3D,eAAO,MAAM,cAAc,aAA4B,CAAC;AAExD,wFAAwF;AACxF,wBAAgB,2BAA2B,CACvC,KAAK,EAAE,MAAM,GAAG,SAAS,GAC1B,uBAAuB,GAAG,SAAS,CAWrC"}
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 the archive — everything that ever happened here that is 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), note (parked follow-ups). Memory ids alone (`#7234`) resolve directly. from/to restrict every source to an inclusive UTC date range.";
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;I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IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,iBAAiB,GACvB;IACI,EAAE,EAAE,IAAI,CAAC;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;qEACiE;IACjE,kBAAkB,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GACD;IACI,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EACA,gBAAgB,GAChB,SAAS,GACT,OAAO,GACP,YAAY,GACZ,cAAc,GACd,WAAW,GACX,cAAc,GACd,eAAe,GACf,cAAc,GACd,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAER;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B,yEAAyE;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 the archive \u2014 everything that ever happened here that is 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), note (parked follow-ups). Memory ids alone (`#7234`) resolve directly. from/to restrict every source to an inclusive UTC date range.";
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,kpBAC0lB,CAAC"}
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: "Restrict to these sources; omit for all.";
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC9B,CAAC;AAEX,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC/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
+ {"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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