@sema-agent/client-core 0.106.0 → 0.108.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 (114) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/README.md +35 -26
  3. package/dist/adapter/activeRunSelfHeal.d.ts +10 -0
  4. package/dist/adapter/activeRunSelfHeal.js +68 -23
  5. package/dist/checkpointRowVerdict.d.ts +11 -0
  6. package/dist/checkpointRowVerdict.js +35 -0
  7. package/dist/cloudConfigWireCaps.d.ts +10 -0
  8. package/dist/cloudConfigWireCaps.js +33 -0
  9. package/dist/coreValuePorts.d.ts +17 -1
  10. package/dist/coreValuePorts.js +5 -0
  11. package/dist/decideReceipt.js +2 -1
  12. package/dist/displayUntrusted.d.ts +5 -3
  13. package/dist/displayUntrusted.js +50 -41
  14. package/dist/engineErrorCodes.d.ts +5 -0
  15. package/dist/engineErrorCodes.js +5 -0
  16. package/dist/engineNoticeCodes.d.ts +31 -1
  17. package/dist/engineNoticeCodes.js +182 -9
  18. package/dist/engineTargetSeat.js +1 -0
  19. package/dist/errorSupplementRoles.js +4 -1
  20. package/dist/eventLeg.js +1 -1
  21. package/dist/executionLaneCapability.js +3 -2
  22. package/dist/executionLaneWords.d.ts +1 -0
  23. package/dist/executionLaneWords.js +4 -0
  24. package/dist/gateOutcome.d.ts +10 -1
  25. package/dist/gateOutcome.js +48 -1
  26. package/dist/generated/engineFactTables.d.ts +1 -0
  27. package/dist/generated/engineFactTables.js +5 -0
  28. package/dist/generated/engineNoticeTables.js +12 -3
  29. package/dist/generated/settingsSchemaFns.d.ts +4 -2
  30. package/dist/generated/settingsSchemaFns.js +9 -3
  31. package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
  32. package/dist/generated/settingsSchemaMcpRequestEntry.js +9 -18
  33. package/dist/generated/settingsSchemaReservedMemberName.d.ts +1 -0
  34. package/dist/generated/settingsSchemaReservedMemberName.js +7 -0
  35. package/dist/generated/settingsSchemaTables.d.ts +2 -0
  36. package/dist/generated/settingsSchemaTables.js +10 -0
  37. package/dist/generated/settingsSchemaWireName.d.ts +1 -0
  38. package/dist/generated/settingsSchemaWireName.js +8 -0
  39. package/dist/headlessReconnectWire.js +12 -7
  40. package/dist/hitl/approvalAskers.d.ts +13 -0
  41. package/dist/hitl/approvalAskers.js +79 -0
  42. package/dist/hitl/approvalResolution.d.ts +8 -1
  43. package/dist/hitl/approvalResolution.js +37 -2
  44. package/dist/hitl/approvalsFeed.js +5 -13
  45. package/dist/hitl/askParkRowRouting.js +17 -1
  46. package/dist/hitl/decisionRefusal.d.ts +1 -0
  47. package/dist/hitl/decisionRefusal.js +5 -2
  48. package/dist/hitl/decisionSend.d.ts +2 -0
  49. package/dist/hitl/decisionSend.js +22 -12
  50. package/dist/hitl/frameRouter.d.ts +3 -2
  51. package/dist/hitl/frameRouter.js +28 -6
  52. package/dist/hitl/gateLedger.d.ts +2 -0
  53. package/dist/hitl/gateLedger.js +3 -1
  54. package/dist/hitl/hitlBridge.d.ts +5 -1
  55. package/dist/hitl/hitlBridge.js +26 -2
  56. package/dist/hitl/livePendingAsk.js +4 -2
  57. package/dist/hitl/parkOwnership.js +4 -5
  58. package/dist/hitl/parkResolver.js +34 -21
  59. package/dist/hitl/parkRowBirthWait.d.ts +9 -0
  60. package/dist/hitl/parkRowBirthWait.js +8 -1
  61. package/dist/hitl/parkRowDelegation.d.ts +6 -0
  62. package/dist/hitl/parkRowDelegation.js +33 -0
  63. package/dist/hitl/persistedRulesWire.d.ts +19 -3
  64. package/dist/hitl/persistedRulesWire.js +118 -20
  65. package/dist/hitl/planReviewWire.js +16 -18
  66. package/dist/hitl/policyDenyCause.d.ts +3 -0
  67. package/dist/hitl/policyDenyCause.js +16 -0
  68. package/dist/hitl/sessionAllowRoute.d.ts +5 -0
  69. package/dist/hitl/sessionAllowRoute.js +42 -0
  70. package/dist/hitl/sessionPolicyDeliverable.js +1 -1
  71. package/dist/hitl/standingRows.js +10 -10
  72. package/dist/hitl/toolApprovalWire.d.ts +8 -2
  73. package/dist/hitl/toolApprovalWire.js +44 -11
  74. package/dist/hooksReaderGenerations.d.ts +1 -0
  75. package/dist/hooksReaderGenerations.js +12 -0
  76. package/dist/hooksWireCaps.js +8 -4
  77. package/dist/i18n/messages.en.d.ts +43 -0
  78. package/dist/i18n/messages.en.js +47 -4
  79. package/dist/i18n/messages.zh.js +53 -4
  80. package/dist/index.d.ts +7 -1
  81. package/dist/index.js +5 -1
  82. package/dist/injectionLaneNotice.js +2 -1
  83. package/dist/liveModelCatalog.d.ts +4 -2
  84. package/dist/liveModelCatalog.js +164 -26
  85. package/dist/model/catalogDefault.d.ts +25 -0
  86. package/dist/model/catalogDefault.js +44 -0
  87. package/dist/noticePresentation.js +2 -0
  88. package/dist/permissionWireCaps.d.ts +1 -0
  89. package/dist/permissionWireCaps.js +11 -0
  90. package/dist/pluginHooksWire.d.ts +5 -3
  91. package/dist/pluginHooksWire.js +116 -7
  92. package/dist/queuedDelivery.d.ts +1 -0
  93. package/dist/queuedDelivery.js +12 -0
  94. package/dist/resultFrameKeys.js +4 -2
  95. package/dist/resumeRefusalCopy.js +15 -8
  96. package/dist/runPermissionModeSwitch.d.ts +2 -1
  97. package/dist/runPermissionModeSwitch.js +16 -6
  98. package/dist/sdkWireTransit.d.ts +1 -1
  99. package/dist/seatContract.d.ts +64 -10
  100. package/dist/seatContract.js +167 -12
  101. package/dist/sessionEngine.d.ts +2 -1
  102. package/dist/sessionEngine.js +5 -0
  103. package/dist/settingsHooksSalvage.d.ts +5 -0
  104. package/dist/settingsHooksSalvage.js +54 -0
  105. package/dist/subagentContentStore.js +1 -1
  106. package/dist/supportFloor.js +2 -0
  107. package/dist/taskNotificationAdmission.d.ts +19 -0
  108. package/dist/taskNotificationAdmission.js +84 -0
  109. package/dist/toolResult.js +2 -1
  110. package/dist/webSearchWireCaps.js +9 -4
  111. package/dist/wireRefusalCopy.d.ts +7 -1
  112. package/dist/wireRefusalCopy.js +7 -1
  113. package/docs/INTEGRATION-CLIENTS.md +1189 -18
  114. package/package.json +5 -5
@@ -957,13 +957,14 @@ function hiddenHostEnd(text, from, unitAt) {
957
957
  const c = text.charCodeAt(k);
958
958
  return endsSchemelessHost(c) || c === 0x40 ? k : -1;
959
959
  }
960
+ const IDEOGRAPHIC_SPACE = 0x3000;
960
961
  const NAME_BLANK_RANGES = [
961
962
  [0x00a0, 0x00a0],
962
963
  [0x1680, 0x1680],
963
964
  [0x2000, 0x200a],
964
965
  [0x202f, 0x202f],
965
966
  [0x205f, 0x205f],
966
- [0x3000, 0x3000],
967
+ [IDEOGRAPHIC_SPACE, IDEOGRAPHIC_SPACE],
967
968
  [0x115f, 0x1160],
968
969
  [0x3164, 0x3164],
969
970
  [0xffa0, 0xffa0],
@@ -3593,7 +3594,7 @@ const FACE_MARKED_CHAR = new RegExp(`^(?:[${C0_ALL}${DEL_C1}${LONE_SURROGATE}${L
3593
3594
  const isStrippableControl = (c) => (c <= 0x1f && (c < 0x09 || c > 0x0d)) || (c >= 0x7f && c <= 0x9f);
3594
3595
  class SequenceReader {
3595
3596
  text;
3596
- atomicBlanks;
3597
+ blanks;
3597
3598
  foldBlanks;
3598
3599
  terminator;
3599
3600
  lineBreak;
@@ -3602,9 +3603,9 @@ class SequenceReader {
3602
3603
  breakFrom = -1;
3603
3604
  breakAt = -1;
3604
3605
  foldSpaces;
3605
- constructor(text, atomicBlanks, foldBlanks = false, foldSpaces = false) {
3606
+ constructor(text, blanks, foldBlanks = false, foldSpaces = false) {
3606
3607
  this.text = text;
3607
- this.atomicBlanks = atomicBlanks;
3608
+ this.blanks = blanks;
3608
3609
  this.foldBlanks = foldBlanks;
3609
3610
  this.foldSpaces = foldSpaces;
3610
3611
  this.terminator = /[\u0007\u009c]|\u001b\\|\\u(?:0007|009[cC]|001[bB]\\)/g;
@@ -3615,12 +3616,7 @@ class SequenceReader {
3615
3616
  return false;
3616
3617
  if (escapeTokenAt(this.text, at) !== null)
3617
3618
  return true;
3618
- if (this.atomicBlanks === 'none')
3619
- return false;
3620
- const cp = nameBlankTokenAt(this.text, at);
3621
- if (this.atomicBlanks === 'fillers')
3622
- return cp !== -1 && !isFoldedBlank(cp);
3623
- return this.atomicBlanks === 'all' ? cp !== -1 : isFoldedBlank(cp);
3619
+ return isMarkedNameBlank(this.blanks, nameBlankTokenAt(this.text, at));
3624
3620
  }
3625
3621
  intermediateAt(at) {
3626
3622
  const c = this.text.charCodeAt(at);
@@ -3628,11 +3624,12 @@ class SequenceReader {
3628
3624
  return 1;
3629
3625
  if (this.foldSpaces && ((c >= 0x09 && c <= 0x0d) || c === 0x2028 || c === 0x2029))
3630
3626
  return 1;
3631
- if (!this.foldBlanks)
3632
- return 0;
3633
- if (isFoldedBlank(c))
3627
+ if (this.blankAsSpace(c))
3634
3628
  return 1;
3635
- return c === 0x5c && isFoldedBlank(nameBlankTokenAt(this.text, at)) ? 6 : 0;
3629
+ return c === 0x5c && this.blankAsSpace(nameBlankTokenAt(this.text, at)) ? 6 : 0;
3630
+ }
3631
+ blankAsSpace(cp) {
3632
+ return isFoldedBlank(cp) && (this.foldBlanks || isMarkedNameBlank(this.blanks, cp));
3636
3633
  }
3637
3634
  interruptsAt(at) {
3638
3635
  if (at >= this.text.length)
@@ -3738,7 +3735,7 @@ function nameBlankTokenAt(text, at) {
3738
3735
  return isNameBlank(cp) ? cp : -1;
3739
3736
  }
3740
3737
  function isMarkedNameBlank(net, c) {
3741
- return net === 1 ? isNameBlank(c) : net === 2 ? isNameBlank(c) && !isRegexSpace(c) : false;
3738
+ return net === 1 ? isNameBlank(c) : net === 2 ? isNameBlank(c) && c !== IDEOGRAPHIC_SPACE : false;
3742
3739
  }
3743
3740
  function buildScanView(text, o) {
3744
3741
  const chars = [];
@@ -3748,7 +3745,7 @@ function buildScanView(text, o) {
3748
3745
  const dropped = [];
3749
3746
  const spaceUnits = [];
3750
3747
  const contents = [];
3751
- const seq = new SequenceReader(text, o.blanks === 1 ? 'all' : o.blanks === 2 ? 'fillers' : 'none', o.blanks === 1 || o.fold, o.fold);
3748
+ const seq = new SequenceReader(text, o.blanks, o.fold, o.fold);
3752
3749
  const keep = (ch, s, e, unit = UNIT_NONE) => {
3753
3750
  chars.push(ch);
3754
3751
  starts.push(s);
@@ -3945,7 +3942,7 @@ function screenSurfaces(text, o) {
3945
3942
  if (face === null)
3946
3943
  return { surfaces: [], rawSoft: null, rawPlain: null, contents: [] };
3947
3944
  const unsafe = face.unsafe === null ? null : new RegExp(face.unsafe.source, 'u');
3948
- const keepBlanks = face.keepBlanks === true;
3945
+ const blankNet = face.blanks ?? 0;
3949
3946
  const chars = [];
3950
3947
  const ps = [];
3951
3948
  const pe = [];
@@ -3955,7 +3952,7 @@ function screenSurfaces(text, o) {
3955
3952
  let changed = false;
3956
3953
  const foldable = (at) => {
3957
3954
  const c = text.codePointAt(at) ?? 0;
3958
- return isRegexSpace(c) && !(keepBlanks && isNameBlank(c));
3955
+ return isRegexSpace(c) && !isMarkedNameBlank(blankNet, c);
3959
3956
  };
3960
3957
  let lo = 0;
3961
3958
  let hi = text.length;
@@ -4648,7 +4645,7 @@ export function washCredentials(text) {
4648
4645
  return scanAndMask(text, WASH_OPTIONS, false).text;
4649
4646
  }
4650
4647
  const NAME_BLANKS = NAME_BLANK_RANGES.map(([a, b]) => (a === b ? classEscape(a) : `${classEscape(a)}-${classEscape(b)}`)).join('');
4651
- const NAME_FILLERS = NAME_BLANK_RANGES.filter(([a, b]) => !isRegexSpace(a) && !isRegexSpace(b))
4648
+ const NAME_BLANKS_EXCEPT_IDEOGRAPHIC = NAME_BLANK_RANGES.filter(([a, b]) => !(a <= IDEOGRAPHIC_SPACE && IDEOGRAPHIC_SPACE <= b))
4652
4649
  .map(([a, b]) => (a === b ? classEscape(a) : `${classEscape(a)}-${classEscape(b)}`))
4653
4650
  .join('');
4654
4651
  function classEscape(cp) {
@@ -4777,17 +4774,17 @@ function markOf(ch, mark) {
4777
4774
  return code > 0xffff ? `\\u{${hex}}` : `\\u${hex.padStart(4, '0')}`;
4778
4775
  }
4779
4776
  const FOLD_RUN = /\s+/g;
4780
- const FOLD_RUN_KEEPING_BLANKS = new RegExp(`[^\\S${NAME_BLANKS}]+`, 'g');
4777
+ const FOLD_RUN_BY_NET = [FOLD_RUN, new RegExp(`[^\\S${NAME_BLANKS}]+`, 'g'), new RegExp(`[^\\S${NAME_BLANKS_EXCEPT_IDEOGRAPHIC}]+`, 'g')];
4781
4778
  const EDGE_SPACE = /^ | $/g;
4782
- const foldWhitespace = (s, keepBlanks = false) => keepBlanks ? s.replace(FOLD_RUN_KEEPING_BLANKS, ' ').replace(EDGE_SPACE, '') : s.replace(FOLD_RUN, ' ').trim();
4779
+ const foldWhitespace = (s, net = 0) => net !== 0 ? s.replace(FOLD_RUN_BY_NET[net] ?? FOLD_RUN, ' ').replace(EDGE_SPACE, '') : s.replace(FOLD_RUN, ' ').trim();
4783
4780
  export function applyDisplayFace(text, face) {
4784
4781
  const markAll = (s) => face.unsafe === null ? s : s.replace(face.unsafe, (ch, at, whole) => (faceHitKept(ch, at, whole, face.keepCrlf === true) ? ch : markOf(ch, face.mark)));
4785
- const keepBlanks = face.keepBlanks === true;
4782
+ const net = face.blanks ?? 0;
4786
4783
  if (face.mark === 'space') {
4787
4784
  const marked = markAll(text);
4788
- return face.fold ? foldWhitespace(marked, keepBlanks) : marked;
4785
+ return face.fold ? foldWhitespace(marked, net) : marked;
4789
4786
  }
4790
- return markAll(face.fold ? foldWhitespace(text, keepBlanks) : text);
4787
+ return markAll(face.fold ? foldWhitespace(text, net) : text);
4791
4788
  }
4792
4789
  function markTracked(t, re, mark, ledger, crlf = false) {
4793
4790
  const parts = [];
@@ -4820,11 +4817,11 @@ function markTracked(t, re, mark, ledger, crlf = false) {
4820
4817
  keep(cursor, t.text.length);
4821
4818
  return { text: parts.join(''), ids: Int32Array.from(ids) };
4822
4819
  }
4823
- function foldTracked(t, keepBlanks) {
4820
+ function foldTracked(t, net) {
4824
4821
  const parts = [];
4825
4822
  const ids = [];
4826
4823
  let cursor = 0;
4827
- for (const run of t.text.matchAll(keepBlanks ? FOLD_RUN_KEEPING_BLANKS : FOLD_RUN)) {
4824
+ for (const run of t.text.matchAll(FOLD_RUN_BY_NET[net] ?? FOLD_RUN)) {
4828
4825
  const at = run.index ?? 0;
4829
4826
  parts.push(t.text.slice(cursor, at));
4830
4827
  for (let k = cursor; k < at; k++)
@@ -4849,14 +4846,14 @@ function foldTracked(t, keepBlanks) {
4849
4846
  return { text: folded.slice(from, to), ids: Int32Array.from(ids.slice(from, to)) };
4850
4847
  }
4851
4848
  function faceTracked(t, face, ledger) {
4852
- const keepBlanks = face.keepBlanks === true;
4849
+ const net = face.blanks ?? 0;
4853
4850
  const unsafe = face.unsafe;
4854
4851
  const markAll = (x) => (unsafe === null ? x : markTracked(x, unsafe, face.mark, ledger, face.keepCrlf === true));
4855
4852
  if (face.mark === 'space') {
4856
4853
  const marked = markAll(t);
4857
- return face.fold ? foldTracked(marked, keepBlanks) : marked;
4854
+ return face.fold ? foldTracked(marked, net) : marked;
4858
4855
  }
4859
- return markAll(face.fold ? foldTracked(t, keepBlanks) : t);
4856
+ return markAll(face.fold ? foldTracked(t, net) : t);
4860
4857
  }
4861
4858
  function carryIds(ids, origin) {
4862
4859
  if (origin === undefined)
@@ -4933,7 +4930,7 @@ function collectMarks(t, ledger) {
4933
4930
  export const DISPLAY_DECISION_BODY = Object.freeze({
4934
4931
  foldLines: false,
4935
4932
  keepLayout: 'crlf',
4936
- blanks: 'fillers',
4933
+ blanks: 'except-ideographic',
4937
4934
  mark: 'escape',
4938
4935
  });
4939
4936
  const PUBLIC_UNSAFE_BY_NETS = Object.freeze(Array.from({ length: 24 }, (_, i) => {
@@ -4942,12 +4939,12 @@ const PUBLIC_UNSAFE_BY_NETS = Object.freeze(Array.from({ length: 24 }, (_, i) =>
4942
4939
  const controls = (rest & 4) !== 0;
4943
4940
  const bidi = (rest & 2) !== 0;
4944
4941
  const keep = (rest & 1) !== 0;
4945
- const blanks = net === 1 ? NAME_BLANKS : net === 2 ? NAME_FILLERS : '';
4942
+ const blanks = net === 1 ? NAME_BLANKS : net === 2 ? NAME_BLANKS_EXCEPT_IDEOGRAPHIC : '';
4946
4943
  const members = `${controls ? `${keep ? C0_KEEP_LAYOUT : C0_ALL}${DEL_C1}${LONE_SURROGATE}` : ''}${bidi ? LINE_SEPARATORS : ''}${blanks}`;
4947
4944
  return unsafeClass(members, bidi);
4948
4945
  }));
4949
4946
  function blankNetOf(opts) {
4950
- return opts.blanks === true ? 1 : opts.blanks === 'fillers' ? 2 : 0;
4947
+ return opts.blanks === true ? 1 : opts.blanks === 'except-ideographic' ? 2 : 0;
4951
4948
  }
4952
4949
  const keepsLayout = (opts) => opts.keepLayout === true || opts.keepLayout === 'crlf';
4953
4950
  function publicFace(opts) {
@@ -4955,7 +4952,7 @@ function publicFace(opts) {
4955
4952
  const keep = !fold && keepsLayout(opts);
4956
4953
  const net = blankNetOf(opts);
4957
4954
  const index = ((opts.controls !== false ? 4 : 0) + (opts.bidi !== false ? 2 : 0) + (keep ? 1 : 0)) * 3 + net;
4958
- const face = { unsafe: PUBLIC_UNSAFE_BY_NETS[index] ?? null, fold, mark: opts.mark ?? 'escape', keepBlanks: net === 1 };
4955
+ const face = { unsafe: PUBLIC_UNSAFE_BY_NETS[index] ?? null, fold, mark: opts.mark ?? 'escape', blanks: net };
4959
4956
  return keep && opts.keepLayout === 'crlf' && opts.controls !== false ? { ...face, keepCrlf: true } : face;
4960
4957
  }
4961
4958
  export const ESCAPE_FACE = Object.freeze({ ...publicFace({ foldLines: false }) });
@@ -5074,13 +5071,22 @@ function displayInputText(text) {
5074
5071
  return text === null ? '' : REDACTED_SECRET;
5075
5072
  }
5076
5073
  }
5074
+ const ENCODED_FORM = /\\\\|\\u(?:[0-9A-Fa-f]{4}|\{[0-9A-Fa-f]{1,6}\})/;
5075
+ function pairsByItself(form) {
5076
+ return ENCODED_FORM.test(form.text);
5077
+ }
5078
+ function pairModeOf(o, face) {
5079
+ if (face.mark === 'dot' || face.mark === 'space')
5080
+ return 'off';
5081
+ return o.escapeBackslashes === true ? 'on' : o.escapeBackslashes === 'auto' ? 'auto' : 'off';
5082
+ }
5077
5083
  function renderUntrusted(text, opts, ledger, queryByShape = false, wholeAddress = false) {
5078
5084
  const input = displayInputText(text);
5079
5085
  const o = opts ?? {};
5080
5086
  const face = publicFace(o);
5081
5087
  const scan = scanOptionsOf(o, face, queryByShape, wholeAddress);
5082
- const pairBackslashes = o.escapeBackslashes === true && face.mark !== 'dot' && face.mark !== 'space';
5083
- const book = ledger ?? (pairBackslashes ? { cps: [], lens: [] } : null);
5088
+ const mode = pairModeOf(o, face);
5089
+ const book = ledger ?? (mode !== 'off' ? { cps: [], lens: [] } : null);
5084
5090
  if (book === null) {
5085
5091
  return runDisplaySteps(input, {
5086
5092
  wash: (s) => scanAndMask(s, scan, false).text,
@@ -5089,6 +5095,7 @@ function renderUntrusted(text, opts, ledger, queryByShape = false, wholeAddress
5089
5095
  text: (s) => s,
5090
5096
  });
5091
5097
  }
5098
+ let paired = mode === 'on';
5092
5099
  const out = runDisplaySteps({ text: input, ids: new Int32Array(input.length).fill(-1) }, {
5093
5100
  wash: (t) => {
5094
5101
  const r = scanAndMask(t.text, scan, true);
@@ -5096,18 +5103,20 @@ function renderUntrusted(text, opts, ledger, queryByShape = false, wholeAddress
5096
5103
  },
5097
5104
  paint: (t) => faceTracked(t, face, book),
5098
5105
  cap: (t) => {
5099
- if (pairBackslashes)
5106
+ if (mode === 'auto' && !paired)
5107
+ paired = pairsByItself(t);
5108
+ if (paired)
5100
5109
  return capPaired(t, o.max);
5101
5110
  const cut = capDisplay(t.text, o.max, face.mark);
5102
5111
  return cut === t.text ? t : { text: cut, ids: t.ids.slice(0, cut.length) };
5103
5112
  },
5104
5113
  text: (t) => t.text,
5105
5114
  });
5106
- return pairBackslashes ? pairLiteralBackslashes(out) : out;
5115
+ return { tracked: paired ? pairLiteralBackslashes(out) : out, exact: paired };
5107
5116
  }
5108
5117
  export function displayUntrusted(text, opts = {}) {
5109
5118
  const out = renderUntrusted(text, opts, null);
5110
- return typeof out === 'string' ? out : out.text;
5119
+ return typeof out === 'string' ? out : out.tracked.text;
5111
5120
  }
5112
5121
  export function cleanUntrustedScalar(v) {
5113
5122
  return displayUntrusted(String(v ?? ''), { credentialUrls: false, credentialWords: false, foldLines: false });
@@ -5354,7 +5363,7 @@ export function queryCarriesCredential(query) {
5354
5363
  export function displayConfiguredUrl(url, opts = {}) {
5355
5364
  const reading = typeof url === 'string' ? configuredAddressReading(url) : null;
5356
5365
  const out = renderUntrusted(reading === null ? url : reading.withheld ? REDACTED_SECRET : reading.text, opts, null, 'relaxed', true);
5357
- return typeof out === 'string' ? out : out.text;
5366
+ return typeof out === 'string' ? out : out.tracked.text;
5358
5367
  }
5359
5368
  function parserViewOf(url) {
5360
5369
  return url.replace(/[\t\n\r]/g, '').replace(/^[\u0000-\u0020]+/, '');
@@ -5773,7 +5782,7 @@ export function displayUntrustedMarks(text, opts = {}) {
5773
5782
  const ledger = { cps: [], lens: [] };
5774
5783
  const out = renderUntrusted(text, opts, ledger);
5775
5784
  if (typeof out === 'string')
5776
- return { text: out, marks: [] };
5777
- return { text: out.text, marks: collectMarks(out, ledger) };
5785
+ return { text: out, marks: [], exact: false };
5786
+ return { text: out.tracked.text, marks: collectMarks(out.tracked, ledger), exact: out.exact };
5778
5787
  }
5779
5788
  const isQuoteChar = (c) => c.charCodeAt(0) === 0x22 || c.charCodeAt(0) === 0x27;
@@ -99,6 +99,11 @@ export declare function refusalSaysStillPending(err: object): boolean;
99
99
  export declare function refusalRetriableReading(err: object): boolean | undefined;
100
100
  export type StatusDerivedCoarseCode = (typeof SDK_STATUS_DERIVED_COARSE_CODES)[number];
101
101
  export declare const RESUME_PLACEMENT_MISMATCH = "resume.placement_mismatch";
102
+ export declare const RESUME_PRINCIPAL_MISMATCH = "resume.principal_mismatch";
103
+ export declare const RESUME_COMPOSITION_MISMATCH = "resume.composition_mismatch";
104
+ export declare const RESUME_PARENT_CONSTRAINT_MISSING = "resume.parent_constraint_missing";
105
+ export declare const RESUME_PARENT_CONSTRAINT_MISMATCH = "resume.parent_constraint_mismatch";
106
+ export declare const RESUME_CONSTRAINT_UNPROJECTABLE = "resume.constraint_unprojectable";
102
107
  export declare const RESUME_CONTEXT_UNAVAILABLE = "conflict.resume_context_unavailable";
103
108
  export declare const RESUME_RETRY_LATER_CODES: readonly string[];
104
109
  export declare const RESUME_ENV_FAILED = "resume.env_failed";
@@ -177,6 +177,11 @@ export function refusalRetriableReading(err) {
177
177
  }
178
178
  }
179
179
  export const RESUME_PLACEMENT_MISMATCH = 'resume.placement_mismatch';
180
+ export const RESUME_PRINCIPAL_MISMATCH = 'resume.principal_mismatch';
181
+ export const RESUME_COMPOSITION_MISMATCH = 'resume.composition_mismatch';
182
+ export const RESUME_PARENT_CONSTRAINT_MISSING = 'resume.parent_constraint_missing';
183
+ export const RESUME_PARENT_CONSTRAINT_MISMATCH = 'resume.parent_constraint_mismatch';
184
+ export const RESUME_CONSTRAINT_UNPROJECTABLE = 'resume.constraint_unprojectable';
180
185
  export const RESUME_CONTEXT_UNAVAILABLE = 'conflict.resume_context_unavailable';
181
186
  export const RESUME_RETRY_LATER_CODES = Object.freeze([
182
187
  RESUME_USAGE_WINDOW_EXHAUSTED,
@@ -14,9 +14,23 @@ export interface McpInjectionDropFactsView {
14
14
  field?: string;
15
15
  }
16
16
  export declare function readMcpInjectionDrop(notice: unknown): McpInjectionDropFactsView | undefined;
17
+ export type NoticeLegView = {
18
+ readonly kind: 'self';
19
+ } | {
20
+ readonly kind: 'delegated';
21
+ readonly sourceSessionId: string;
22
+ readonly agentId?: string;
23
+ } | {
24
+ readonly kind: 'unreadable';
25
+ };
26
+ export declare function noticeCallSessionOf(facts: {
27
+ readonly sessionId?: string | undefined;
28
+ readonly leg: NoticeLegView;
29
+ }): string | undefined;
17
30
  export declare const ASK_UNRESOLVABLE_CAUSES: readonly string[];
18
31
  export interface AskUnresolvableFactsView {
19
32
  sessionId: string;
33
+ leg: NoticeLegView;
20
34
  toolName: string;
21
35
  toolCallId: string;
22
36
  cause: string;
@@ -108,6 +122,7 @@ export interface ClassifierUnavailableFactsView {
108
122
  disposition: ClassifierUnavailableDispositionWord;
109
123
  sessionId?: string;
110
124
  runId?: string;
125
+ leg: NoticeLegView;
111
126
  }
112
127
  export declare function readClassifierUnavailable(notice: unknown): ClassifierUnavailableFactsView | undefined;
113
128
  export declare const PERMISSION_MODE_FOLD_REASONS: readonly string[];
@@ -129,6 +144,7 @@ export interface AskReleasedByModeFactsView {
129
144
  firstToolCallId: string;
130
145
  sessionId?: string;
131
146
  runId?: string;
147
+ leg: NoticeLegView;
132
148
  }
133
149
  export declare function readAskReleasedByMode(notice: unknown): AskReleasedByModeFactsView | undefined;
134
150
  export interface ReadDenyUnappliedFactsView {
@@ -139,6 +155,7 @@ export interface ReadDenyUnappliedFactsView {
139
155
  rowCount: number;
140
156
  sessionId: string;
141
157
  runId: string;
158
+ leg: NoticeLegView;
142
159
  }
143
160
  export declare function readReadDenyUnapplied(notice: unknown): ReadDenyUnappliedFactsView | undefined;
144
161
  export interface ToolTurnRepairView {
@@ -197,9 +214,21 @@ export interface UserInputUndrainedFactsView {
197
214
  sessionId?: string;
198
215
  runId?: string;
199
216
  childSessionId?: string;
217
+ inputIds?: readonly string[];
218
+ inputKind?: 'steer' | 'approval_feedback';
200
219
  }
201
220
  export declare function readUserInputUndrained(notice: unknown): UserInputUndrainedFactsView | undefined;
202
- export declare function userInputUndrainedNotice(facts: Pick<UserInputUndrainedFactsView, 'kind' | 'count' | 'cause' | 'childSessionId'>): string | undefined;
221
+ export interface UndrainedInputsLedger {
222
+ readonly handed?: readonly string[];
223
+ readonly redelivered?: readonly string[];
224
+ }
225
+ export interface UndrainedInputsVerdict {
226
+ readonly redeliver: readonly string[];
227
+ readonly askUser: readonly string[];
228
+ readonly unattributed: number;
229
+ }
230
+ export declare function undrainedInputsVerdict(facts: Pick<UserInputUndrainedFactsView, 'count' | 'cause' | 'inputIds' | 'childSessionId'> | null | undefined, ledger: UndrainedInputsLedger | null | undefined): UndrainedInputsVerdict | undefined;
231
+ export declare function userInputUndrainedNotice(facts: Pick<UserInputUndrainedFactsView, 'kind' | 'count' | 'cause' | 'childSessionId' | 'inputKind'>, lang?: UiLanguage): string | undefined;
203
232
  export interface TurnInterruptedFactsView {
204
233
  lane: 'input_now' | 'user_halt' | 'unrecognized';
205
234
  inputId?: string;
@@ -285,6 +314,7 @@ export declare const ENGINE_NOTICE_FACT_READERS: Readonly<{
285
314
  readonly 'route.stream_end_ignored': typeof readStreamEndIgnored;
286
315
  readonly 'mcp.authorization_required': typeof readMcpAuthorizationRequired;
287
316
  readonly 'context.media_removed': typeof readContextMediaRemoved;
317
+ readonly 'context.image_removed': typeof readContextMediaRemoved;
288
318
  readonly 'session.lineage_rerooted': typeof readSessionLineageRerooted;
289
319
  }>;
290
320
  type FactReaderTable = typeof ENGINE_NOTICE_FACT_READERS;