@sema-agent/client-core 0.110.0 → 0.111.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 (176) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/README.md +50 -18
  3. package/dist/abortableSleep.d.ts +7 -0
  4. package/dist/abortableSleep.js +37 -0
  5. package/dist/adapt/arms.js +25 -4
  6. package/dist/adapt/toolCards.d.ts +3 -1
  7. package/dist/adapt/toolCards.js +4 -2
  8. package/dist/adapter/activeRunSelfHeal.d.ts +39 -0
  9. package/dist/adapter/activeRunSelfHeal.js +171 -3
  10. package/dist/adapter/downstream/eventToSdkMessage.js +10 -10
  11. package/dist/adapter/downstream/terminalToSdkResult.d.ts +2 -0
  12. package/dist/adapter/downstream/terminalToSdkResult.js +11 -0
  13. package/dist/adapter/runStream.d.ts +5 -0
  14. package/dist/adapter/runStream.js +15 -3
  15. package/dist/attachmentRoute.d.ts +20 -0
  16. package/dist/attachmentRoute.js +39 -0
  17. package/dist/attachmentsWireCaps.js +1 -1
  18. package/dist/builtinOutputStyles.d.ts +12 -0
  19. package/dist/builtinOutputStyles.js +147 -0
  20. package/dist/compactionStatus.d.ts +9 -0
  21. package/dist/compactionStatus.js +29 -5
  22. package/dist/controlRouter.js +2 -1
  23. package/dist/coreValuePorts.d.ts +39 -1
  24. package/dist/coreValuePorts.js +10 -0
  25. package/dist/displayUntrusted.d.ts +1 -0
  26. package/dist/displayUntrusted.js +6 -0
  27. package/dist/engineHealthFacts.d.ts +11 -0
  28. package/dist/engineHealthFacts.js +21 -0
  29. package/dist/engineHealthProbeVerdict.d.ts +23 -0
  30. package/dist/engineHealthProbeVerdict.js +115 -0
  31. package/dist/engineNoticeCodes.js +5 -7
  32. package/dist/engineRepoint.d.ts +12 -5
  33. package/dist/engineRepoint.js +44 -19
  34. package/dist/engineRowRef.d.ts +3 -0
  35. package/dist/engineRowRef.js +11 -1
  36. package/dist/engineSwapCrossing.d.ts +57 -0
  37. package/dist/engineSwapCrossing.js +297 -0
  38. package/dist/engineUnavailable.d.ts +44 -0
  39. package/dist/engineUnavailable.js +492 -0
  40. package/dist/eventLeg.js +3 -3
  41. package/dist/generated/sdkFactTables.d.ts +1 -1
  42. package/dist/generated/sdkFactTables.js +1 -0
  43. package/dist/generated/settingsSchemaTables.d.ts +4 -0
  44. package/dist/generated/settingsSchemaTables.js +1 -0
  45. package/dist/hitl/approvalDelivery.d.ts +1 -0
  46. package/dist/hitl/approvalDelivery.js +1 -1
  47. package/dist/hitl/approvalResolution.d.ts +1 -1
  48. package/dist/hitl/approvalResolution.js +2 -1
  49. package/dist/hitl/askGateWire.js +5 -6
  50. package/dist/hitl/decisionRefusal.d.ts +2 -0
  51. package/dist/hitl/decisionRefusal.js +7 -8
  52. package/dist/hitl/decisionRefusalCarrier.d.ts +3 -0
  53. package/dist/hitl/decisionRefusalCarrier.js +348 -0
  54. package/dist/hitl/decisionSend.d.ts +7 -0
  55. package/dist/hitl/decisionSend.js +34 -12
  56. package/dist/hitl/editedApprovalAcceptance.js +1 -1
  57. package/dist/hitl/elicitationRefusal.d.ts +4 -0
  58. package/dist/hitl/elicitationRefusal.js +23 -0
  59. package/dist/hitl/frameRouter.d.ts +2 -2
  60. package/dist/hitl/frameRouter.js +8 -15
  61. package/dist/hitl/gateIdentity.d.ts +5 -0
  62. package/dist/hitl/gateIdentity.js +23 -0
  63. package/dist/hitl/hitlBridge.d.ts +6 -0
  64. package/dist/hitl/hitlBridge.js +10 -4
  65. package/dist/hitl/hitlHostSurface.d.ts +2 -1
  66. package/dist/hitl/hitlHostSurface.js +7 -2
  67. package/dist/hitl/localAllowRedemption.d.ts +67 -0
  68. package/dist/hitl/localAllowRedemption.js +256 -0
  69. package/dist/hitl/parkResolver.js +7 -4
  70. package/dist/hitl/persistedRulesWire.d.ts +16 -0
  71. package/dist/hitl/persistedRulesWire.js +70 -0
  72. package/dist/hitl/planReviewWire.d.ts +3 -0
  73. package/dist/hitl/planReviewWire.js +23 -6
  74. package/dist/hitl/policyDenyCause.d.ts +1 -1
  75. package/dist/hitl/policyDenyCause.js +1 -1
  76. package/dist/hitl/resumeRunningCard.d.ts +1 -0
  77. package/dist/hitl/resumeRunningCard.js +1 -0
  78. package/dist/hitl/screenCardCarriers.d.ts +15 -0
  79. package/dist/hitl/screenCardCarriers.js +41 -0
  80. package/dist/hitl/screenDecisionCards.d.ts +98 -0
  81. package/dist/hitl/screenDecisionCards.js +362 -0
  82. package/dist/hitl/standingRows.d.ts +3 -1
  83. package/dist/hitl/standingRows.js +18 -0
  84. package/dist/hitl/toolApprovalWire.d.ts +30 -8
  85. package/dist/hitl/toolApprovalWire.js +264 -121
  86. package/dist/hooksWireCaps.js +3 -3
  87. package/dist/hostSettingNoticeArm.d.ts +3 -0
  88. package/dist/hostSettingNoticeArm.js +12 -0
  89. package/dist/hostTurnSettings.d.ts +3 -0
  90. package/dist/hostTurnSettings.js +38 -5
  91. package/dist/humanTurnRead.js +11 -1
  92. package/dist/i18n/messages.en.d.ts +129 -0
  93. package/dist/i18n/messages.en.js +135 -7
  94. package/dist/i18n/messages.zh.js +142 -6
  95. package/dist/i18n/translate.d.ts +3 -0
  96. package/dist/i18n/translate.js +78 -10
  97. package/dist/i18n/zh.d.ts +1 -0
  98. package/dist/i18n/zh.js +1 -0
  99. package/dist/index.d.ts +43 -17
  100. package/dist/index.js +30 -12
  101. package/dist/interactiveHalt.js +2 -1
  102. package/dist/interactiveInterrupt.js +20 -2
  103. package/dist/liveModelCatalog.js +2 -2
  104. package/dist/localEngineSeatReading.d.ts +2 -2
  105. package/dist/localEngineSeatReading.js +5 -3
  106. package/dist/localEngineSpawn.d.ts +0 -7
  107. package/dist/localEngineSpawn.js +0 -92
  108. package/dist/localEngineStep.d.ts +2 -2
  109. package/dist/localEngineStep.js +2 -0
  110. package/dist/mcpReconnect.js +3 -3
  111. package/dist/mcpWireCaps.js +1 -1
  112. package/dist/model/engineModelWords.d.ts +3 -0
  113. package/dist/model/engineModelWords.js +13 -0
  114. package/dist/model/subagentModelWord.d.ts +21 -2
  115. package/dist/model/subagentModelWord.js +100 -29
  116. package/dist/modelCapabilityProbe.js +3 -40
  117. package/dist/notifications.d.ts +19 -0
  118. package/dist/notifications.js +114 -12
  119. package/dist/ownKey.d.ts +6 -0
  120. package/dist/ownKey.js +31 -0
  121. package/dist/pendingUserRow.d.ts +4 -0
  122. package/dist/pendingUserRow.js +16 -0
  123. package/dist/permissionsDeclaration.d.ts +1 -0
  124. package/dist/permissionsDeclaration.js +11 -1
  125. package/dist/planReviewCardFacts.d.ts +3 -0
  126. package/dist/planReviewCardFacts.js +52 -2
  127. package/dist/pluginHooksWire.d.ts +9 -1
  128. package/dist/pluginHooksWire.js +40 -6
  129. package/dist/printToolResultFrame.js +4 -2
  130. package/dist/promptBlockedCopy.js +11 -6
  131. package/dist/promptSuggestionBatch.d.ts +7 -0
  132. package/dist/promptSuggestionBatch.js +9 -0
  133. package/dist/promptSuggestionsTail.d.ts +39 -0
  134. package/dist/promptSuggestionsTail.js +116 -0
  135. package/dist/request/taskRequest.js +10 -6
  136. package/dist/requestCoordinate.d.ts +1 -0
  137. package/dist/requestCoordinate.js +13 -0
  138. package/dist/rewindArchiveReading.js +4 -4
  139. package/dist/runCancelContext.d.ts +2 -1
  140. package/dist/runCancelContext.js +1 -0
  141. package/dist/runPermissionModeSwitch.js +2 -2
  142. package/dist/scenarioRefusal.js +11 -13
  143. package/dist/scenarioSkills.js +11 -6
  144. package/dist/seam.d.ts +16 -2
  145. package/dist/seam.js +10 -0
  146. package/dist/seatContract.d.ts +109 -9
  147. package/dist/seatContract.js +218 -15
  148. package/dist/sessionCostReading.d.ts +70 -0
  149. package/dist/sessionCostReading.js +150 -0
  150. package/dist/sessionHooksRoster.d.ts +4 -0
  151. package/dist/sessionHooksRoster.js +158 -0
  152. package/dist/sessionMemoryStatus.js +2 -2
  153. package/dist/sessionReadRedaction.d.ts +7 -0
  154. package/dist/sessionReadRedaction.js +26 -0
  155. package/dist/sessionSyncFileHistory.js +8 -9
  156. package/dist/settingsHooksSalvage.js +2 -1
  157. package/dist/sseIdleTriage.js +2 -1
  158. package/dist/storeDurabilityWord.d.ts +15 -0
  159. package/dist/storeDurabilityWord.js +18 -0
  160. package/dist/storePostureCapability.d.ts +7 -3
  161. package/dist/storePostureCapability.js +69 -39
  162. package/dist/subagent/engineSubagentResume.js +2 -2
  163. package/dist/subagent/engineSubagentTail.js +2 -1
  164. package/dist/subagentContentStore.d.ts +11 -0
  165. package/dist/subagentContentStore.js +28 -2
  166. package/dist/toolResult.d.ts +1 -0
  167. package/dist/toolResult.js +2 -0
  168. package/dist/userAttachmentEnvelope.d.ts +2 -1
  169. package/dist/userAttachmentEnvelope.js +10 -0
  170. package/dist/wireErrorTriage.js +2 -1
  171. package/dist/wireFailureShape.d.ts +4 -0
  172. package/dist/wireFailureShape.js +141 -19
  173. package/dist/wireRefusalCopy.d.ts +6 -5
  174. package/dist/wireRefusalCopy.js +49 -92
  175. package/docs/INTEGRATION-CLIENTS.md +2118 -17
  176. package/package.json +6 -2
@@ -1,5 +1,5 @@
1
- import { PROTOCOL_ERROR_NAME, REFUSAL_PROBLEMS_READ_MAX, THROWN_SLOT_UNREADABLE, effectiveWireCodeReading, isSlotCarrier, protocolErrorNameOf, readErrorNumber, readErrorPresent, readErrorRecord, readErrorStrictStringList, readErrorString, readErrorStringList, readRefusalField, readRefusalSlots, readThrownSlot, readThrownStatusSlot } from './wireFailureShape.js';
2
- import { appendOwnElement, guardedRead, readOwnDataValue, readOwnNonEmptyString } from './ownKey.js';
1
+ import { PROTOCOL_ERROR_NAME, REFUSAL_PROBLEMS_READ_MAX, THROWN_SLOT_UNREADABLE, effectiveWireCodeReading, isSlotCarrier, protocolErrorNameOf, readErrorNumber, readErrorPresent, readErrorStrictStringList, readErrorString, readErrorStringList, readRefusalField, readRefusalSlots, readThrownExtra, readThrownSlot, readThrownStatusSlot } from './wireFailureShape.js';
2
+ import { appendOwnElement, guardedRead, readOwnDataValue } from './ownKey.js';
3
3
  import { ACTIVE_RUN_BUSY_ERROR_CODE, CONFLICT_SESSION_ARCHIVE_STAMPED, CONFLICT_SESSION_ID_RETIRED, FLEET_LEASE_UNAVAILABLE, LIMIT_RATE_EXCEEDED, RATE_EXCEEDED_RUN_CONCURRENCY_CAP, REQUEST_ENV_CREDENTIAL_REFUSED, REQUEST_AUTONOMY_LANE_REFUSED, REQUEST_FIELD_CONFLICT, RESUME_OUTCOME_INVALID, USAGE_WINDOW_EXHAUSTED, USER_ATTACHMENT_INVALID_ERROR_CODE, USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
4
4
  import { capForDisplay } from './fleetTaskDesc.js';
5
5
  import { quoteUntrustedForSentence } from './displayUntrusted.js';
@@ -342,7 +342,7 @@ export function fieldLimitRefusalFromError(err) {
342
342
  if (coded.code !== FIELD_INVALID)
343
343
  return null;
344
344
  const field = readErrorString(err, 'field');
345
- if (field === undefined || field.length === 0)
345
+ if (field === undefined || field.length === 0 || isSettingsHooksCoordinate(field))
346
346
  return null;
347
347
  const reason = readErrorString(err, 'reason');
348
348
  const folded = coded.folded;
@@ -366,13 +366,6 @@ export function fieldLimitRefusalFromError(err) {
366
366
  return null;
367
367
  }
368
368
  }
369
- function hooksCoordinateOf(path) {
370
- const lead = path !== undefined && path[0] === 'hooks';
371
- let out = lead ? 'settings' : HOOK_MATCHER_REFUSAL_FIELD;
372
- for (const seg of path ?? [])
373
- out += typeof seg === 'number' ? `[${seg}]` : `.${seg}`;
374
- return out;
375
- }
376
369
  export function fieldLimitRefusalOfSettingsHooks(refusal) {
377
370
  try {
378
371
  if (typeof refusal !== 'object' || refusal === null)
@@ -380,25 +373,12 @@ export function fieldLimitRefusalOfSettingsHooks(refusal) {
380
373
  const reason = readOwnDataValue(refusal, 'reason');
381
374
  if (reason !== 'over_cap' && reason !== 'too_long')
382
375
  return null;
383
- const rawPath = readOwnDataValue(refusal, 'path');
384
- let path;
385
- if (Array.isArray(rawPath)) {
386
- const out = [];
387
- for (let i = 0; i < rawPath.length; i++) {
388
- const seg = Object.hasOwn(rawPath, i) ? rawPath[i] : undefined;
389
- if (typeof seg === 'string' || (typeof seg === 'number' && Number.isSafeInteger(seg) && seg >= 0))
390
- out.push(seg);
391
- else {
392
- out.length = 0;
393
- break;
394
- }
395
- }
396
- path = out.length > 0 ? out : undefined;
397
- }
376
+ const rawField = guardedRead(() => readOwnDataValue(refusal, 'field'));
377
+ const field = typeof rawField === 'string' && isSettingsHooksCoordinate(rawField) ? rawField : HOOK_MATCHER_REFUSAL_FIELD;
398
378
  const count = nonNegInt(readOwnDataValue(refusal, 'count'));
399
379
  const cap = posInt(readOwnDataValue(refusal, 'cap'));
400
380
  return Object.freeze({
401
- field: hooksCoordinateOf(path),
381
+ field,
402
382
  reason,
403
383
  ...(count !== undefined ? { count } : {}),
404
384
  ...(cap !== undefined ? { cap } : {}),
@@ -730,26 +710,19 @@ export function hostPostureRefusalContent(detail, lang) {
730
710
  }
731
711
  }
732
712
  const HOOK_MATCHER_REFUSAL_FIELD = 'settings.hooks';
733
- function hooksRefusalPathOf(detail) {
734
- try {
735
- const raw = readOwnDataValue(detail, 'path');
736
- if (!Array.isArray(raw))
713
+ function isSettingsHooksCoordinate(field) {
714
+ return field === HOOK_MATCHER_REFUSAL_FIELD || field.startsWith(`${HOOK_MATCHER_REFUSAL_FIELD}.`) || field.startsWith(`${HOOK_MATCHER_REFUSAL_FIELD}[`);
715
+ }
716
+ function refusalRootReader(err) {
717
+ const bag = readThrownExtra(err);
718
+ return (key) => {
719
+ const top = readThrownSlot(err, key, 'data');
720
+ if (top !== undefined && top !== THROWN_SLOT_UNREADABLE)
721
+ return top;
722
+ if (bag.state !== 'object')
737
723
  return undefined;
738
- const out = [];
739
- for (let i = 0; i < raw.length; i++) {
740
- if (!Object.hasOwn(raw, i))
741
- return undefined;
742
- const v = raw[i];
743
- if (typeof v === 'string' || (typeof v === 'number' && Number.isSafeInteger(v) && v >= 0))
744
- out.push(v);
745
- else
746
- return undefined;
747
- }
748
- return Object.freeze(out);
749
- }
750
- catch {
751
- return undefined;
752
- }
724
+ return guardedRead(() => readOwnDataValue(bag.value, key));
725
+ };
753
726
  }
754
727
  export function settingsHooksRefusalFromError(err) {
755
728
  try {
@@ -757,20 +730,23 @@ export function settingsHooksRefusalFromError(err) {
757
730
  return undefined;
758
731
  if (err.errorCode !== FIELD_INVALID)
759
732
  return undefined;
760
- if (readErrorString(err, 'field') !== HOOK_MATCHER_REFUSAL_FIELD)
761
- return undefined;
762
- const detail = readErrorRecord(err, 'detail');
763
- if (detail === undefined)
733
+ const field = readErrorString(err, 'field');
734
+ if (field === undefined || !isSettingsHooksCoordinate(field))
764
735
  return undefined;
765
- const reasonRaw = readOwnDataValue(detail, 'reason');
766
- const path = hooksRefusalPathOf(detail);
767
- const withPath = (o) => Object.freeze({ ...o, ...(path !== undefined ? { path } : {}) });
768
- const family = (reason, rest = {}) => Object.freeze({ reason, ...(path !== undefined ? { path } : {}), ...rest });
769
- const event = readOwnNonEmptyString(detail, 'event');
736
+ const at = refusalRootReader(err);
737
+ const reasonRaw = at('reason');
738
+ const withField = (o) => Object.freeze({ ...o, field });
739
+ const family = (reason, rest = {}) => Object.freeze({ reason, field, ...rest });
740
+ const nonEmpty = (v) => (typeof v === 'string' && v.length > 0 ? v : undefined);
741
+ const event = nonEmpty(at('event'));
742
+ const groupIndexRaw = at('groupIndex');
743
+ const groupIndex = typeof groupIndexRaw === 'number' && Number.isInteger(groupIndexRaw) && groupIndexRaw >= 0 ? groupIndexRaw : undefined;
770
744
  if (reasonRaw === undefined || reasonRaw === 'dead_alias') {
771
- const alias = readOwnNonEmptyString(detail, 'alias');
772
- const canonical = readOwnNonEmptyString(detail, 'canonical');
773
- const matcher = event !== undefined && alias !== undefined && canonical !== undefined ? withPath({ reason: 'alias_without_canonical', event, alias, canonical }) : undefined;
745
+ const alias = nonEmpty(at('alias'));
746
+ const canonical = nonEmpty(at('canonical'));
747
+ const matcher = event !== undefined && alias !== undefined && canonical !== undefined
748
+ ? withField({ reason: 'alias_without_canonical', event, alias, canonical, ...(groupIndex !== undefined ? { groupIndex } : {}) })
749
+ : undefined;
774
750
  if (reasonRaw === undefined && matcher === undefined)
775
751
  return undefined;
776
752
  return family('dead_alias', matcher !== undefined ? { matcher } : {});
@@ -778,24 +754,22 @@ export function settingsHooksRefusalFromError(err) {
778
754
  if (typeof reasonRaw !== 'string' || reasonRaw.length === 0)
779
755
  return undefined;
780
756
  if (reasonRaw === 'invalid_regex' || reasonRaw === 'over_budget' || reasonRaw === 'budget_exceeded') {
781
- const groupIndex = readOwnDataValue(detail, 'groupIndex');
782
- const okIndex = typeof groupIndex === 'number' && Number.isInteger(groupIndex) && groupIndex >= 0;
783
757
  let matcher;
784
- if (event !== undefined && okIndex) {
758
+ if (event !== undefined && groupIndex !== undefined) {
785
759
  if (reasonRaw === 'invalid_regex')
786
- matcher = withPath({ reason: 'invalid_regex', event, groupIndex });
760
+ matcher = withField({ reason: 'invalid_regex', event, groupIndex });
787
761
  else {
788
762
  const key = reasonRaw === 'over_budget' ? 'budgetMs' : 'totalMs';
789
- const ms = readOwnDataValue(detail, key);
763
+ const ms = at(key);
790
764
  const msBit = typeof ms === 'number' && Number.isFinite(ms) && ms > 0 ? { [key]: ms } : {};
791
- matcher = reasonRaw === 'over_budget' ? withPath({ reason: 'over_budget', event, groupIndex, ...msBit }) : withPath({ reason: 'budget_exceeded', event, groupIndex, ...msBit });
765
+ matcher = reasonRaw === 'over_budget' ? withField({ reason: 'over_budget', event, groupIndex, ...msBit }) : withField({ reason: 'budget_exceeded', event, groupIndex, ...msBit });
792
766
  }
793
767
  }
794
768
  return family(reasonRaw, matcher !== undefined ? { matcher } : {});
795
769
  }
796
770
  if (reasonRaw === 'over_cap' || reasonRaw === 'too_long') {
797
- const count = nonNegInt(readOwnDataValue(detail, 'count'));
798
- const cap = posInt(readOwnDataValue(detail, 'cap'));
771
+ const count = nonNegInt(at('count'));
772
+ const cap = posInt(at('cap'));
799
773
  return family(reasonRaw, { ...(count !== undefined ? { count } : {}), ...(cap !== undefined ? { cap } : {}) });
800
774
  }
801
775
  return family(reasonRaw);
@@ -907,8 +881,8 @@ export function unreadRequestMembersFromError(err) {
907
881
  const effective = effectiveWireCodeReading(err);
908
882
  if (effective.code !== FIELD_INVALID)
909
883
  return null;
910
- const slots = readRefusalSlots(err, ['field', 'reason', 'detail']);
911
- if (slots.reason.present || slots.detail.present)
884
+ const slots = readRefusalSlots(err, ['field', 'reason']);
885
+ if (slots.reason.present)
912
886
  return null;
913
887
  const field = slots.field.word;
914
888
  if (field === undefined)
@@ -998,13 +972,10 @@ export function unsupportedRuleRefusalFromError(err) {
998
972
  const effective = effectiveWireCodeReading(err);
999
973
  if (effective.code !== REQUEST_UNPROCESSABLE)
1000
974
  return null;
1001
- const detail = readErrorRecord(err, 'detail');
1002
- if (detail === undefined)
1003
- return null;
1004
975
  let list;
1005
976
  let length = 0;
1006
977
  try {
1007
- const raw = readOwnDataValue(detail, 'problems');
978
+ const raw = readErrorPresent(err, 'problems');
1008
979
  if (Array.isArray(raw)) {
1009
980
  list = raw;
1010
981
  const n = raw.length;
@@ -1094,7 +1065,8 @@ export function userAttachmentRefusalFromError(err) {
1094
1065
  try {
1095
1066
  if (typeof err !== 'object' || err === null)
1096
1067
  return null;
1097
- let facts;
1068
+ let index;
1069
+ let path;
1098
1070
  const kind = readOwnDataValue(err, 'kind');
1099
1071
  const plane = readOwnDataValue(err, 'plane');
1100
1072
  if (kind === 'failed' && (plane === 'cause' || plane === 'flat')) {
@@ -1102,26 +1074,15 @@ export function userAttachmentRefusalFromError(err) {
1102
1074
  return null;
1103
1075
  const cause = readOwnDataValue(err, 'detail');
1104
1076
  const inner = typeof cause === 'object' && cause !== null && readOwnDataValue(cause, 'kind') === 'coded' ? readOwnDataValue(cause, 'detail') : undefined;
1105
- facts = typeof inner === 'object' && inner !== null && !Array.isArray(inner) ? inner : undefined;
1077
+ const facts = typeof inner === 'object' && inner !== null && !Array.isArray(inner) ? inner : undefined;
1078
+ index = facts === undefined ? undefined : guardedRead(() => readOwnDataValue(facts, 'index'));
1079
+ path = facts === undefined ? undefined : guardedRead(() => readOwnDataValue(facts, 'path'));
1106
1080
  }
1107
1081
  else {
1108
1082
  if (effectiveWireErrorCode(err) !== USER_ATTACHMENT_INVALID_ERROR_CODE)
1109
1083
  return null;
1110
- facts = readErrorRecord(err, 'detail');
1111
- }
1112
- let index;
1113
- let path;
1114
- try {
1115
- index = facts === undefined ? undefined : readOwnDataValue(facts, 'index');
1116
- }
1117
- catch {
1118
- index = undefined;
1119
- }
1120
- try {
1121
- path = facts === undefined ? undefined : readOwnDataValue(facts, 'path');
1122
- }
1123
- catch {
1124
- path = undefined;
1084
+ index = guardedRead(() => readErrorNumber(err, 'index'));
1085
+ path = guardedRead(() => readErrorString(err, 'field'));
1125
1086
  }
1126
1087
  return {
1127
1088
  code: USER_ATTACHMENT_INVALID_ERROR_CODE,
@@ -1139,9 +1100,5 @@ export function userInvokedSkillRefusalFromError(err) {
1139
1100
  }
1140
1101
  const _pinRequestField = [true, true, true, true, true, true, true, true];
1141
1102
  void _pinRequestField;
1142
- const _pinSettingsHooks = [true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true];
1143
- void _pinSettingsHooks;
1144
- const _pinAttachment = [true, true, true];
1145
- void _pinAttachment;
1146
1103
  const _pinWallSource = [true, true, true];
1147
1104
  void _pinWallSource;