@sema-agent/client-core 0.97.1 → 0.99.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 (353) hide show
  1. package/CHANGELOG.md +607 -0
  2. package/README.md +96 -46
  3. package/dist/adapt/arms.d.ts +1 -0
  4. package/dist/adapt/arms.js +188 -53
  5. package/dist/adapt/ids.d.ts +12 -1
  6. package/dist/adapt/ids.js +59 -8
  7. package/dist/adapt/instanceLedger.d.ts +50 -0
  8. package/dist/adapt/instanceLedger.js +147 -0
  9. package/dist/adapt/panelTasks.d.ts +1 -1
  10. package/dist/adapt/panelTasks.js +2 -2
  11. package/dist/adapt/textStream.d.ts +1 -0
  12. package/dist/adapt/textStream.js +24 -7
  13. package/dist/adapt/toolCards.d.ts +27 -5
  14. package/dist/adapt/toolCards.js +39 -6
  15. package/dist/adapt/wireShapes.js +6 -2
  16. package/dist/adapt.d.ts +2 -0
  17. package/dist/adapt.js +8 -3
  18. package/dist/adapter/activeRunSelfHeal.d.ts +9 -3
  19. package/dist/adapter/activeRunSelfHeal.js +205 -313
  20. package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
  21. package/dist/adapter/downstream/eventToSdkMessage.js +77 -36
  22. package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
  23. package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
  24. package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
  25. package/dist/adapter/runStream.js +79 -48
  26. package/dist/adapter/types.d.ts +4 -4
  27. package/dist/adapter/types.js +2 -1
  28. package/dist/agentSession/backgroundView.js +2 -1
  29. package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
  30. package/dist/agentSession/engineAgentRegistryRead.js +12 -13
  31. package/dist/agentSession/engineSessionBackgroundStop.js +16 -8
  32. package/dist/agentsWireCaps.d.ts +8 -11
  33. package/dist/agentsWireCaps.js +196 -194
  34. package/dist/approvalDecidedByCapability.d.ts +0 -4
  35. package/dist/approvalDecidedByCapability.js +0 -6
  36. package/dist/approvalsStreamLiveCapability.d.ts +0 -4
  37. package/dist/approvalsStreamLiveCapability.js +0 -6
  38. package/dist/assistantInbox.d.ts +34 -0
  39. package/dist/assistantInbox.js +118 -0
  40. package/dist/centerWiringCapability.js +9 -1
  41. package/dist/clientSlice.d.ts +0 -9
  42. package/dist/clientSlice.js +0 -3
  43. package/dist/cloudConfigWireCaps.d.ts +5 -3
  44. package/dist/cloudConfigWireCaps.js +106 -64
  45. package/dist/compensations.js +1 -1
  46. package/dist/connectorStatus.d.ts +21 -0
  47. package/dist/connectorStatus.js +112 -0
  48. package/dist/controlRouter.d.ts +18 -3
  49. package/dist/controlRouter.js +106 -67
  50. package/dist/coreValuePorts.d.ts +29 -4
  51. package/dist/coreValuePorts.js +10 -0
  52. package/dist/corruptSessionCopy.d.ts +2 -1
  53. package/dist/corruptSessionCopy.js +3 -3
  54. package/dist/decideReceipt.d.ts +2 -2
  55. package/dist/decideReceipt.js +5 -2
  56. package/dist/declared/supportFloorDeclared.js +3 -3
  57. package/dist/detachWire.js +3 -2
  58. package/dist/deviceExecutorManagementCapability.d.ts +0 -4
  59. package/dist/deviceExecutorManagementCapability.js +0 -6
  60. package/dist/deviceRebind.d.ts +49 -1
  61. package/dist/deviceRebind.js +221 -3
  62. package/dist/devicesFace.d.ts +34 -0
  63. package/dist/devicesFace.js +90 -0
  64. package/dist/displayUntrusted.d.ts +2 -0
  65. package/dist/displayUntrusted.js +253 -76
  66. package/dist/engineAgentAbsence.d.ts +1 -1
  67. package/dist/engineAgentPanelStore.d.ts +12 -4
  68. package/dist/engineAgentPanelStore.js +16 -11
  69. package/dist/engineCapReader.d.ts +2 -5
  70. package/dist/engineCapReader.js +8 -10
  71. package/dist/engineCapsCache.d.ts +12 -0
  72. package/dist/engineCapsCache.js +76 -18
  73. package/dist/engineCapsChange.d.ts +2 -0
  74. package/dist/engineCapsChange.js +9 -0
  75. package/dist/engineClosedSets.d.ts +1 -0
  76. package/dist/engineClosedSets.js +4 -1
  77. package/dist/engineErrorCodes.d.ts +11 -3
  78. package/dist/engineErrorCodes.js +11 -8
  79. package/dist/engineIdentity.d.ts +1 -0
  80. package/dist/engineIdentity.js +8 -0
  81. package/dist/engineRowRef.d.ts +28 -0
  82. package/dist/engineRowRef.js +114 -0
  83. package/dist/engineSessionMessages.d.ts +68 -0
  84. package/dist/engineSessionMessages.js +370 -0
  85. package/dist/engineTargetSeat.d.ts +27 -0
  86. package/dist/engineTargetSeat.js +199 -0
  87. package/dist/engineToolDirectory.d.ts +0 -9
  88. package/dist/engineToolDirectory.js +1 -94
  89. package/dist/engineUrl.d.ts +18 -0
  90. package/dist/engineUrl.js +52 -0
  91. package/dist/engineWireFor.js +3 -8
  92. package/dist/env/uiLanguage.d.ts +11 -1
  93. package/dist/env/uiLanguage.js +38 -2
  94. package/dist/eventLeg.d.ts +100 -0
  95. package/dist/eventLeg.js +305 -0
  96. package/dist/executionLaneCapability.d.ts +0 -4
  97. package/dist/executionLaneCapability.js +3 -16
  98. package/dist/fileHistoryCaptureCapability.d.ts +2 -5
  99. package/dist/fileHistoryCaptureCapability.js +13 -21
  100. package/dist/fileHistoryLegNotice.d.ts +2 -1
  101. package/dist/fileHistoryLegNotice.js +3 -3
  102. package/dist/fleet/fleetLedger.d.ts +0 -3
  103. package/dist/fleet/fleetLedger.js +21 -36
  104. package/dist/fleet/fleetProjection.d.ts +2 -2
  105. package/dist/fleet/fleetProjection.js +10 -8
  106. package/dist/frameBinding.d.ts +8 -0
  107. package/dist/frameBinding.js +35 -0
  108. package/dist/gateFailureCodes.d.ts +2 -0
  109. package/dist/gateFailureCodes.js +15 -0
  110. package/dist/gateOutcome.d.ts +3 -1
  111. package/dist/gateOutcome.js +41 -8
  112. package/dist/gateVocabulary.d.ts +10 -4
  113. package/dist/gateVocabulary.js +107 -47
  114. package/dist/generated/engineAskFaceTables.js +2 -2
  115. package/dist/generated/engineFactTables.d.ts +22 -3
  116. package/dist/generated/engineFactTables.js +51 -4
  117. package/dist/generated/engineNoticeTables.js +18 -3
  118. package/dist/generated/settingsSchemaFns.d.ts +6 -0
  119. package/dist/generated/settingsSchemaFns.js +57 -0
  120. package/dist/generated/settingsSchemaHooksClassifier.d.ts +2 -0
  121. package/dist/generated/settingsSchemaHooksClassifier.js +254 -0
  122. package/dist/generated/settingsSchemaTables.d.ts +1 -0
  123. package/dist/generated/settingsSchemaTables.js +4 -0
  124. package/dist/generated/settingsSchemaTypes.d.ts +105 -0
  125. package/dist/generated/settingsSchemaTypes.js +1 -0
  126. package/dist/generated/toolNameTables.d.ts +1 -0
  127. package/dist/generated/toolNameTables.js +1 -0
  128. package/dist/hitl/allowRuleShadow.d.ts +8 -2
  129. package/dist/hitl/allowRuleShadow.js +36 -29
  130. package/dist/hitl/approvalCardReading.d.ts +15 -0
  131. package/dist/hitl/approvalCardReading.js +154 -0
  132. package/dist/hitl/approvalCardReasons.d.ts +14 -0
  133. package/dist/hitl/approvalCardReasons.js +119 -0
  134. package/dist/hitl/approvalHolds.d.ts +50 -15
  135. package/dist/hitl/approvalHolds.js +177 -27
  136. package/dist/hitl/approvalResolution.d.ts +51 -26
  137. package/dist/hitl/approvalResolution.js +86 -122
  138. package/dist/hitl/approvalsFeed.js +6 -18
  139. package/dist/hitl/askClassPair.d.ts +2 -0
  140. package/dist/hitl/askClassPair.js +17 -0
  141. package/dist/hitl/askGateWire.d.ts +20 -2
  142. package/dist/hitl/askGateWire.js +50 -1
  143. package/dist/hitl/askParkRowRouting.d.ts +5 -0
  144. package/dist/hitl/askParkRowRouting.js +32 -1
  145. package/dist/hitl/askSettlementLine.d.ts +28 -0
  146. package/dist/hitl/askSettlementLine.js +99 -0
  147. package/dist/hitl/automaticAnswerVerdict.d.ts +3 -2
  148. package/dist/hitl/automaticAnswerVerdict.js +29 -13
  149. package/dist/hitl/crashConverged.d.ts +11 -20
  150. package/dist/hitl/crashConverged.js +56 -0
  151. package/dist/hitl/crashConvergedNotice.d.ts +6 -3
  152. package/dist/hitl/crashConvergedNotice.js +48 -24
  153. package/dist/hitl/decisionConflict.js +3 -10
  154. package/dist/hitl/decisionRefusal.d.ts +40 -1
  155. package/dist/hitl/decisionRefusal.js +199 -42
  156. package/dist/hitl/frameRouter.d.ts +5 -2
  157. package/dist/hitl/frameRouter.js +27 -24
  158. package/dist/hitl/gateLedger.d.ts +2 -0
  159. package/dist/hitl/gateLedger.js +50 -13
  160. package/dist/hitl/hitlBridge.d.ts +2 -2
  161. package/dist/hitl/hitlBridge.js +13 -10
  162. package/dist/hitl/livePendingAsk.d.ts +3 -3
  163. package/dist/hitl/livePendingAsk.js +7 -18
  164. package/dist/hitl/parkResolver.d.ts +2 -24
  165. package/dist/hitl/parkResolver.js +61 -97
  166. package/dist/hitl/persistedRulesWire.d.ts +25 -0
  167. package/dist/hitl/persistedRulesWire.js +104 -2
  168. package/dist/hitl/planReviewWire.d.ts +31 -13
  169. package/dist/hitl/planReviewWire.js +120 -78
  170. package/dist/hitl/refusedToolNameProse.d.ts +0 -1
  171. package/dist/hitl/refusedToolNameProse.js +0 -3
  172. package/dist/hitl/replayedApproval.d.ts +4 -3
  173. package/dist/hitl/replayedApproval.js +7 -4
  174. package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
  175. package/dist/hitl/sessionPolicyDeliverable.js +48 -7
  176. package/dist/hitl/sessionPolicyWire.d.ts +34 -21
  177. package/dist/hitl/sessionPolicyWire.js +179 -70
  178. package/dist/hitl/standingRows.d.ts +20 -2
  179. package/dist/hitl/standingRows.js +69 -8
  180. package/dist/hitl/suspendedReopen.d.ts +2 -1
  181. package/dist/hitl/suspendedReopen.js +7 -10
  182. package/dist/hitl/toolApprovalWire.d.ts +103 -156
  183. package/dist/hitl/toolApprovalWire.js +661 -411
  184. package/dist/hookMatcherVerdict.d.ts +6 -1
  185. package/dist/hookMatcherVerdict.js +14 -7
  186. package/dist/hooksWireCaps.d.ts +2 -2
  187. package/dist/hooksWireCaps.js +174 -81
  188. package/dist/host.d.ts +21 -0
  189. package/dist/hostTurnSettings.d.ts +71 -0
  190. package/dist/hostTurnSettings.js +291 -0
  191. package/dist/humanTurn.d.ts +14 -1
  192. package/dist/humanTurn.js +100 -12
  193. package/dist/humanTurnRead.d.ts +2 -0
  194. package/dist/humanTurnRead.js +22 -1
  195. package/dist/i18n/messages.en.d.ts +703 -0
  196. package/dist/i18n/messages.en.js +701 -0
  197. package/dist/i18n/messages.zh.d.ts +3 -0
  198. package/dist/i18n/messages.zh.js +837 -0
  199. package/dist/i18n/translate.d.ts +25 -0
  200. package/dist/i18n/translate.js +127 -0
  201. package/dist/index.d.ts +78 -29
  202. package/dist/index.js +54 -18
  203. package/dist/inheritEnvCapability.d.ts +32 -0
  204. package/dist/inheritEnvCapability.js +104 -0
  205. package/dist/inheritEnvWire.d.ts +3 -2
  206. package/dist/inheritEnvWire.js +12 -14
  207. package/dist/interactiveHalt.js +17 -6
  208. package/dist/liveModelCatalog.d.ts +3 -3
  209. package/dist/liveModelCatalog.js +15 -13
  210. package/dist/liveQuestionStore.d.ts +2 -21
  211. package/dist/mcpLiveness.d.ts +2 -1
  212. package/dist/mcpPanel.d.ts +10 -1
  213. package/dist/mcpPanel.js +40 -13
  214. package/dist/mcpProbeCapability.d.ts +2 -1
  215. package/dist/mcpProbeCapability.js +7 -11
  216. package/dist/mcpProbeWire.d.ts +9 -2
  217. package/dist/mcpProbeWire.js +6 -1
  218. package/dist/mcpWireCaps.d.ts +47 -2
  219. package/dist/mcpWireCaps.js +164 -16
  220. package/dist/memoryEntriesWire.d.ts +4 -9
  221. package/dist/memoryEntriesWire.js +5 -10
  222. package/dist/model/modelSupplyRules.d.ts +0 -2
  223. package/dist/model/modelSupplyRules.js +3 -12
  224. package/dist/model/modelsPolicy.d.ts +0 -5
  225. package/dist/model/modelsPolicy.js +6 -36
  226. package/dist/model/onboardJudgement.d.ts +93 -0
  227. package/dist/model/onboardJudgement.js +415 -0
  228. package/dist/model/subagentModelWord.d.ts +31 -0
  229. package/dist/model/subagentModelWord.js +261 -0
  230. package/dist/model/tierVocabulary.d.ts +2 -0
  231. package/dist/model/tierVocabulary.js +17 -5
  232. package/dist/modelCapabilityProbe.d.ts +64 -0
  233. package/dist/modelCapabilityProbe.js +600 -0
  234. package/dist/modelIdentityResolvability.d.ts +3 -0
  235. package/dist/modelIdentityResolvability.js +26 -17
  236. package/dist/notifications.d.ts +6 -0
  237. package/dist/notifications.js +71 -23
  238. package/dist/outputStyleSeatCapability.d.ts +0 -3
  239. package/dist/outputStyleSeatCapability.js +0 -3
  240. package/dist/ownKey.d.ts +22 -0
  241. package/dist/ownKey.js +94 -3
  242. package/dist/panelReduce.d.ts +21 -10
  243. package/dist/panelReduce.js +728 -550
  244. package/dist/panelStateHolder.d.ts +3 -7
  245. package/dist/panelStateHolder.js +14 -130
  246. package/dist/peerLaneCapability.d.ts +0 -4
  247. package/dist/peerLaneCapability.js +0 -6
  248. package/dist/permissionRuleIssue.js +2 -0
  249. package/dist/permissionRulesWriteCapability.d.ts +2 -5
  250. package/dist/permissionRulesWriteCapability.js +8 -12
  251. package/dist/permissionWireCaps.d.ts +2 -2
  252. package/dist/permissionWireCaps.js +2 -0
  253. package/dist/permissionsAllowGrantCapability.d.ts +0 -4
  254. package/dist/permissionsAllowGrantCapability.js +0 -6
  255. package/dist/permissionsDeclaration.d.ts +0 -11
  256. package/dist/permissionsDeclaration.js +60 -53
  257. package/dist/pluginHooksWire.d.ts +46 -3
  258. package/dist/pluginHooksWire.js +219 -16
  259. package/dist/preemptWire.d.ts +44 -0
  260. package/dist/preemptWire.js +83 -0
  261. package/dist/printModelStatus.d.ts +63 -0
  262. package/dist/printModelStatus.js +155 -0
  263. package/dist/printToolResultFrame.js +15 -4
  264. package/dist/replayBody.d.ts +3 -0
  265. package/dist/replayBody.js +14 -0
  266. package/dist/request/taskRequest.d.ts +11 -6
  267. package/dist/request/taskRequest.js +112 -19
  268. package/dist/resumeRefusalCopy.d.ts +13 -9
  269. package/dist/resumeRefusalCopy.js +81 -118
  270. package/dist/retryStatus.d.ts +45 -0
  271. package/dist/retryStatus.js +185 -1
  272. package/dist/rewindArchiveCapability.d.ts +0 -4
  273. package/dist/rewindArchiveCapability.js +2 -10
  274. package/dist/rewindArchiveReading.d.ts +0 -1
  275. package/dist/rewindArchiveReading.js +0 -3
  276. package/dist/runCancelContext.d.ts +2 -1
  277. package/dist/runCancelContext.js +4 -2
  278. package/dist/runReattachPolicy.d.ts +31 -0
  279. package/dist/runReattachPolicy.js +46 -0
  280. package/dist/runTerminal.d.ts +3 -6
  281. package/dist/runTerminal.js +8 -9
  282. package/dist/sandboxWire.d.ts +3 -1
  283. package/dist/sandboxWire.js +76 -27
  284. package/dist/scenarioRefusal.d.ts +9 -0
  285. package/dist/scenarioRefusal.js +111 -0
  286. package/dist/scenarioWire.js +1 -1
  287. package/dist/seam.d.ts +48 -2
  288. package/dist/seam.js +25 -4
  289. package/dist/seatContract.d.ts +311 -18
  290. package/dist/seatContract.js +824 -100
  291. package/dist/selfOrchestrationDenial.js +7 -19
  292. package/dist/sessionIdSegment.d.ts +6 -0
  293. package/dist/sessionIdSegment.js +24 -0
  294. package/dist/sessionMemoryStatus.js +6 -11
  295. package/dist/sessionPolicyCapability.d.ts +2 -5
  296. package/dist/sessionPolicyCapability.js +8 -12
  297. package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
  298. package/dist/sessionSyncFileHistoryCapability.js +0 -3
  299. package/dist/settingsHooksSalvage.d.ts +44 -0
  300. package/dist/settingsHooksSalvage.js +211 -0
  301. package/dist/skillToolListsCapability.d.ts +2 -4
  302. package/dist/skillToolListsCapability.js +8 -9
  303. package/dist/sqlEngineCapability.d.ts +0 -4
  304. package/dist/sqlEngineCapability.js +0 -6
  305. package/dist/sseIdleTriage.js +3 -2
  306. package/dist/steerPriorityCapability.d.ts +0 -3
  307. package/dist/steerPriorityCapability.js +0 -3
  308. package/dist/streamDrainingLegs.d.ts +4 -0
  309. package/dist/streamDrainingLegs.js +6 -1
  310. package/dist/subagent/engineCompactWire.d.ts +0 -1
  311. package/dist/subagent/engineCompactWire.js +7 -5
  312. package/dist/subagent/engineSubagentResume.js +15 -9
  313. package/dist/subagent/engineTaskHandleWire.js +4 -7
  314. package/dist/subagentContentStore.d.ts +3 -0
  315. package/dist/subagentContentStore.js +22 -10
  316. package/dist/submitReopen.d.ts +24 -0
  317. package/dist/submitReopen.js +75 -0
  318. package/dist/terminalStatuses.d.ts +3 -0
  319. package/dist/terminalStatuses.js +10 -2
  320. package/dist/toolHistoryMismatch.js +3 -2
  321. package/dist/toolResult.d.ts +10 -1
  322. package/dist/toolResult.js +34 -6
  323. package/dist/toolRoster.d.ts +3 -4
  324. package/dist/toolRoster.js +21 -22
  325. package/dist/turnFailurePresentation.d.ts +39 -0
  326. package/dist/turnFailurePresentation.js +402 -0
  327. package/dist/usageAnalytics.js +6 -11
  328. package/dist/userAttachmentEnvelope.d.ts +1 -0
  329. package/dist/userAttachmentEnvelope.js +37 -7
  330. package/dist/userAttachmentSeat.d.ts +21 -0
  331. package/dist/userAttachmentSeat.js +75 -0
  332. package/dist/userInvokedSkillsCapability.d.ts +11 -4
  333. package/dist/userInvokedSkillsCapability.js +31 -10
  334. package/dist/webSearchBackendCapability.d.ts +0 -4
  335. package/dist/webSearchBackendCapability.js +0 -6
  336. package/dist/wireErrorTriage.d.ts +7 -0
  337. package/dist/wireErrorTriage.js +26 -23
  338. package/dist/wireFailureShape.d.ts +62 -5
  339. package/dist/wireFailureShape.js +106 -5
  340. package/dist/wireRefusalCopy.d.ts +25 -3
  341. package/dist/wireRefusalCopy.js +74 -80
  342. package/dist/workflowsJournalCapability.d.ts +2 -5
  343. package/dist/workflowsJournalCapability.js +8 -12
  344. package/dist/writeProtectionCapability.d.ts +0 -4
  345. package/dist/writeProtectionCapability.js +0 -6
  346. package/docs/INTEGRATION-CLIENTS.md +1775 -56
  347. package/package.json +6 -5
  348. package/dist/attachmentSeatCapability.d.ts +0 -12
  349. package/dist/attachmentSeatCapability.js +0 -23
  350. package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
  351. package/dist/hitl/approvalOutcomeNote.js +0 -29
  352. package/dist/sessionReadRedactionCapability.d.ts +0 -13
  353. package/dist/sessionReadRedactionCapability.js +0 -35
@@ -1,20 +1,23 @@
1
1
  import { CORE_MODE_ARBITRATION, CORE_MODE_RELEASE_REASONS } from '../generated/engineFactTables.js';
2
2
  import { CORE_RELEASABLE_ASK_CLASSES_BY_FACE, CORE_SHELL_FACE_TOOL_NAMES } from '../generated/engineAskFaceTables.js';
3
3
  import { mandatedApprovalDetail } from '../gateVocabulary.js';
4
+ import { msg, renderMessage } from '../i18n/translate.js';
4
5
  import { readAskOrigin, readOwnNonEmptyString } from '../ownKey.js';
5
6
  import { readAskClassPairState } from './askClassPair.js';
6
- import { approvalAllowRuleShadowed } from './allowRuleShadow.js';
7
+ import { readRequiresRealApproval } from './approvalCardReading.js';
8
+ import { approvalAllowRuleShadowed, retiredAllowRuleShadowKeyPresent } from './allowRuleShadow.js';
7
9
  import { approvalIsMandated, readApprovalMandate } from './toolApprovalWire.js';
8
10
  export const MODE_ARBITRATION = CORE_MODE_ARBITRATION;
9
11
  const TABLE = CORE_MODE_ARBITRATION;
10
12
  const ORIGIN_IMPLIES_CLASS = Object.freeze({
11
13
  content_question: 'content_question',
12
- org_unavailable: 'governance_unavailable',
14
+ org_unavailable: 'rule_unreadable',
13
15
  org_rule: 'org_rule',
14
16
  hook: 'hook',
15
17
  ask_rule: 'ask_rule',
16
18
  denial_limit_fallback: 'denial_limit_fallback',
17
19
  });
20
+ const RULE_LANE_COULD_CLEAR = 'lane_cannot_speak';
18
21
  function mandateWordClass(raw) {
19
22
  if (raw === 'operator_always')
20
23
  return 'shell_floor';
@@ -102,6 +105,17 @@ export function automaticAnswerVerdict(card, lane, facts) {
102
105
  try {
103
106
  if (typeof card !== 'object' || card === null)
104
107
  return UNKNOWN.card_unreadable;
108
+ if (card.cardPayloadUnreadable === true)
109
+ return UNKNOWN.card_unreadable;
110
+ const unreadable = card.unreadableEvidence;
111
+ if (unreadable !== undefined) {
112
+ if (!Array.isArray(unreadable) || unreadable.some((k) => typeof k !== 'string'))
113
+ return UNKNOWN.card_unreadable;
114
+ if (unreadable.some((k) => k !== 'rememberRefused' && k !== 'ruleOffers'))
115
+ return UNKNOWN.card_unreadable;
116
+ }
117
+ if (!approvalAllowRuleShadowed(card) && retiredAllowRuleShadowKeyPresent(card, 'frame'))
118
+ return UNKNOWN.card_unreadable;
105
119
  const face = lane === 'mode_posture' ? askFaceOfCard(card) : undefined;
106
120
  const origin = readAskOrigin(evidenceView(card, 'origin'));
107
121
  if (origin !== undefined && Object.hasOwn(ORIGIN_IMPLIES_CLASS, origin)) {
@@ -109,7 +123,7 @@ export function automaticAnswerVerdict(card, lane, facts) {
109
123
  if (classBlocks(lane, cls, face))
110
124
  return mustAsk('origin', { origin, askClass: cls });
111
125
  }
112
- if (lane !== 'mode_posture' && evidenceView(card, 'requiresRealApproval').requiresRealApproval === true)
126
+ if (lane !== 'mode_posture' && readRequiresRealApproval(card))
113
127
  return mustAsk('requires_real_approval');
114
128
  if (evidenceView(card, 'governanceForced').governanceForced === true)
115
129
  return mustAsk('governance');
@@ -123,8 +137,11 @@ export function automaticAnswerVerdict(card, lane, facts) {
123
137
  const mandateView = evidenceView(card, 'mandated', 'ruleOffersAbsence', 'mandate');
124
138
  if (approvalIsMandated(mandateView))
125
139
  return mustAsk('mandated');
126
- if (lane === 'standing_rule' && (approvalAllowRuleShadowed(card) || readOwnNonEmptyString(mandateView, 'ruleOffersAbsence') === 'shadowed'))
127
- return mustAsk('allow_rule_shadow');
140
+ if (lane === 'standing_rule') {
141
+ const absence = readOwnNonEmptyString(mandateView, 'ruleOffersAbsence');
142
+ if (approvalAllowRuleShadowed(card) || (absence !== undefined && absence !== RULE_LANE_COULD_CLEAR))
143
+ return mustAsk('allow_rule_shadow');
144
+ }
128
145
  }
129
146
  const pair = readAskClassPairState(card);
130
147
  if (pair.state === 'malformed')
@@ -163,26 +180,25 @@ export function automaticAnswerVerdict(card, lane, facts) {
163
180
  return UNKNOWN.card_unreadable;
164
181
  }
165
182
  }
166
- export function mandatedApprovalDetailOf(card) {
183
+ export function mandatedApprovalDetailOf(card, lang) {
167
184
  try {
168
185
  if (typeof card !== 'object' || card === null)
169
- return mandatedApprovalDetail();
186
+ return mandatedApprovalDetail(lang);
170
187
  const pair = readAskClassPairState(card);
171
188
  if (pair.state !== 'pair')
172
- return mandatedApprovalDetail();
189
+ return mandatedApprovalDetail(lang);
173
190
  const classes = pair.classes;
174
191
  if (classes.some((c) => !Object.hasOwn(TABLE, c)))
175
- return mandatedApprovalDetail();
192
+ return mandatedApprovalDetail(lang);
176
193
  const row = foldModeArbitrationRow(classes);
177
194
  if (row.classifierEligible || row.sandboxAdmission)
178
- return mandatedApprovalDetail();
179
- return MANDATED_NO_AUTOMATIC_CHECK_DETAIL;
195
+ return mandatedApprovalDetail(lang);
196
+ return renderMessage(msg('approval.mandate.noAutomaticCheck'), lang);
180
197
  }
181
198
  catch {
182
- return mandatedApprovalDetail();
199
+ return mandatedApprovalDetail(lang);
183
200
  }
184
201
  }
185
- const MANDATED_NO_AUTOMATIC_CHECK_DETAIL = 'no saved allow rule and no remembered answer can retire this question, and no automatic check answers it; each call is settled on its own, by you here, and an answer covers only that call';
186
202
  export function permissionRequestHookScope(verdict) {
187
203
  try {
188
204
  const kind = typeof verdict === 'object' && verdict !== null ? verdict.kind : undefined;
@@ -1,31 +1,18 @@
1
- import type { PendingCheckpoint } from '@sema-agent/sdk';
1
+ import type { CrashConvergedRow, PendingCheckpoint } from '@sema-agent/sdk';
2
2
  export type CrashConvergedOrphanState = 'pending' | 'decided';
3
- export interface CrashConvergedRow {
4
- readonly approvalId: string;
5
- readonly toolName: string;
6
- readonly taskId: string;
7
- readonly sessionId?: string;
8
- readonly ts: number;
9
- readonly expiresAtMs: number;
10
- readonly decision: 'denied';
11
- readonly cause: 'crashed_before_park' | 'shutdown_before_park';
12
- readonly orphanState: CrashConvergedOrphanState;
13
- readonly originalDecision?: 'approve';
14
- readonly decidedAtMs?: number;
15
- readonly convergedAtMs: number;
16
- readonly resumeSafe: boolean;
3
+ export interface CrashConvergedRowReading extends Readonly<CrashConvergedRow> {
17
4
  readonly needsHumanReason?: 'approved_then_interrupted' | 'pending_unsafe' | 'unstable_row' | 'contradictory';
18
5
  }
19
- export declare const isCrashConvergedCause: (v: unknown) => v is CrashConvergedRow["cause"];
6
+ export declare const isCrashConvergedCause: (v: unknown) => v is CrashConvergedRowReading["cause"];
20
7
  export interface ApprovalsListEnvelope {
21
8
  pending: PendingCheckpoint[];
22
9
  livePending?: unknown[];
23
- crashConverged?: CrashConvergedRow[];
10
+ crashConverged?: CrashConvergedRowReading[];
24
11
  }
25
12
  export interface CrashConvergedProjection {
26
13
  readonly total: number;
27
- readonly resumeSafe: readonly CrashConvergedRow[];
28
- readonly needsHuman: readonly CrashConvergedRow[];
14
+ readonly resumeSafe: readonly CrashConvergedRowReading[];
15
+ readonly needsHuman: readonly CrashConvergedRowReading[];
29
16
  readonly dropped: number;
30
17
  }
31
18
  export declare function projectCrashConverged(env: unknown): CrashConvergedProjection | undefined;
@@ -33,6 +20,10 @@ export interface CrashConvergedNoticeFacts {
33
20
  readonly total: number;
34
21
  readonly dropped: number;
35
22
  readonly needsHumanReasons: readonly (string | undefined)[];
36
- readonly causes: readonly CrashConvergedRow['cause'][] | undefined;
23
+ readonly causes: readonly CrashConvergedRowReading['cause'][] | undefined;
37
24
  }
25
+ export declare function crashConvergedRowInProjection(projection: CrashConvergedProjection | undefined, row: Pick<CrashConvergedRowReading, 'approvalId'>): {
26
+ readonly bucket: 'resumeSafe' | 'needsHuman';
27
+ readonly row: CrashConvergedRowReading;
28
+ } | undefined;
38
29
  export declare function readCrashConvergedNoticeFacts(projection: CrashConvergedProjection | undefined): CrashConvergedNoticeFacts | undefined;
@@ -168,6 +168,62 @@ function causeWordsOf(rows) {
168
168
  }
169
169
  return seen;
170
170
  }
171
+ function rowRecordsAgreeUnexecuted(row) {
172
+ try {
173
+ if (typeof row !== 'object' || row === null)
174
+ return false;
175
+ const own = (k) => Object.getOwnPropertyDescriptor(row, k);
176
+ const valueIs = (k, want) => {
177
+ const d = own(k);
178
+ return d !== undefined && Object.hasOwn(d, 'value') && d.value === want;
179
+ };
180
+ const noValue = (k) => {
181
+ const d = own(k);
182
+ return d === undefined || (Object.hasOwn(d, 'value') && d.value === undefined);
183
+ };
184
+ return valueIs('orphanState', 'pending') && valueIs('resumeSafe', true) && noValue('originalDecision') && noValue('decidedAtMs');
185
+ }
186
+ catch {
187
+ return false;
188
+ }
189
+ }
190
+ export function crashConvergedRowInProjection(projection, row) {
191
+ try {
192
+ if (typeof row !== 'object' || row === null)
193
+ return undefined;
194
+ const id = ownDataValue(row, 'approvalId');
195
+ if (typeof id !== 'string' || id === '')
196
+ return undefined;
197
+ if (typeof projection !== 'object' || projection === null)
198
+ return undefined;
199
+ const total = ownDataValue(projection, 'total');
200
+ if (!isCount(total) || total > MAX_CRASH_CONVERGED_ROWS)
201
+ return undefined;
202
+ const safe = bucketRowsOf(ownDataValue(projection, 'resumeSafe'));
203
+ const human = bucketRowsOf(ownDataValue(projection, 'needsHuman'));
204
+ if (safe === undefined || human === undefined || safe.length + human.length !== total)
205
+ return undefined;
206
+ const find = (rows) => {
207
+ for (const r of rows) {
208
+ if (typeof r === 'object' && r !== null && ownDataValue(r, 'approvalId') === id)
209
+ return r;
210
+ }
211
+ return undefined;
212
+ };
213
+ const inSafe = find(safe);
214
+ const inHuman = find(human);
215
+ if (inSafe !== undefined && inHuman !== undefined)
216
+ return undefined;
217
+ if (inSafe !== undefined)
218
+ return rowRecordsAgreeUnexecuted(inSafe) ? { bucket: 'resumeSafe', row: inSafe } : undefined;
219
+ if (inHuman !== undefined)
220
+ return { bucket: 'needsHuman', row: inHuman };
221
+ return undefined;
222
+ }
223
+ catch {
224
+ return undefined;
225
+ }
226
+ }
171
227
  export function readCrashConvergedNoticeFacts(projection) {
172
228
  try {
173
229
  if (typeof projection !== 'object' || projection === null)
@@ -1,4 +1,7 @@
1
- import type { CrashConvergedProjection } from './crashConverged.js';
1
+ import type { UiLanguage } from '../env/uiLanguage.js';
2
+ import type { CrashConvergedProjection, CrashConvergedRowReading } from './crashConverged.js';
2
3
  export declare const NEEDS_HUMAN_REASON_ORDER: readonly ["approved_then_interrupted", "pending_unsafe", "contradictory", "unstable_row"];
3
- export declare function crashConvergedNeedsHumanSentence(reason: string | undefined, n: number, total: number): string | undefined;
4
- export declare function crashConvergedNotice(projection: CrashConvergedProjection | undefined): string | undefined;
4
+ export declare function crashConvergedNeedsHumanSentence(reason: string | undefined, n: number, total: number, lang?: UiLanguage): string | undefined;
5
+ export declare function crashConvergedNotice(projection: CrashConvergedProjection | undefined, lang?: UiLanguage): string | undefined;
6
+ export declare function crashConvergedRowSentence(projection: CrashConvergedProjection | undefined, row: Pick<CrashConvergedRowReading, 'approvalId'>, lang?: UiLanguage): string | undefined;
7
+ export declare function crashConvergedCauseSentence(cause: string | undefined, lang?: UiLanguage): string | undefined;
@@ -1,4 +1,6 @@
1
- import { readCrashConvergedNoticeFacts } from './crashConverged.js';
1
+ import { msg, renderMessage } from '../i18n/translate.js';
2
+ import { askEndingCauseClause } from './askSettlementLine.js';
3
+ import { crashConvergedRowInProjection, isCrashConvergedCause, readCrashConvergedNoticeFacts } from './crashConverged.js';
2
4
  export const NEEDS_HUMAN_REASON_ORDER = Object.freeze(['approved_then_interrupted', 'pending_unsafe', 'contradictory', 'unstable_row']);
3
5
  const _orderCoversReasons = true;
4
6
  const _orderInsideReasons = true;
@@ -6,39 +8,40 @@ const _orderHasNoDuplicate = true;
6
8
  void _orderCoversReasons;
7
9
  void _orderInsideReasons;
8
10
  void _orderHasNoDuplicate;
9
- const RECORDED = 'based on what was recorded';
10
- const NO_AUTO_RERUN = 'sema has not re-run anything';
11
11
  const plural = (n, one, many) => (n === 1 ? one : many);
12
- const SENTENCE = Object.freeze({
13
- approved_then_interrupted: (n, total) => `${n} of ${total} had already been approved and may have been running when the previous engine run ended, so a side effect may have partly landed`,
14
- pending_unsafe: (n, total) => `${n} of ${total} had not started, ${RECORDED}, but the engine did not mark ${plural(n, 'it', 'them')} as safe to re-run`,
15
- contradictory: (n, total) => `${n} of ${total} ${plural(n, 'has a contradictory record', 'have contradictory records')}`,
16
- unstable_row: (n, total) => `${n} of ${total} ${plural(n, 'has a record that read differently each time it was read', 'have records that read differently each time they were read')}`,
12
+ const NEEDS_HUMAN_CLAUSES = Object.freeze({
13
+ approved_then_interrupted: { one: 'session.crashConverged.reason.approvedThenInterrupted.one', many: 'session.crashConverged.reason.approvedThenInterrupted.many' },
14
+ pending_unsafe: { one: 'session.crashConverged.reason.pendingUnsafe.one', many: 'session.crashConverged.reason.pendingUnsafe.many' },
15
+ contradictory: { one: 'session.crashConverged.reason.contradictory.one', many: 'session.crashConverged.reason.contradictory.many' },
16
+ unstable_row: { one: 'session.crashConverged.reason.unstableRow.one', many: 'session.crashConverged.reason.unstableRow.many' },
17
17
  });
18
- const fallbackSentence = (n, total) => `${n} of ${total} had already been approved, or cannot be accounted for, so a side effect may have partly landed`;
19
- const isNeedsHumanReason = (v) => typeof v === 'string' && Object.hasOwn(SENTENCE, v);
20
- export function crashConvergedNeedsHumanSentence(reason, n, total) {
18
+ const FALLBACK_CLAUSE = Object.freeze({ one: 'session.crashConverged.fallback.one', many: 'session.crashConverged.fallback.many' });
19
+ const RESUME_SAFE_CLAUSE = 'session.crashConverged.resumeSafe';
20
+ const countedClause = (clause, n, total, lang) => renderMessage(msg('session.crashConverged.counted', { n, total, clause: msg(n === 1 ? clause.one : clause.many) }), lang);
21
+ const isNeedsHumanReason = (v) => typeof v === 'string' && Object.hasOwn(NEEDS_HUMAN_CLAUSES, v);
22
+ export function crashConvergedNeedsHumanSentence(reason, n, total, lang) {
21
23
  if (!isNeedsHumanReason(reason))
22
24
  return undefined;
23
25
  if (typeof n !== 'number' || !Number.isSafeInteger(n) || n < 1)
24
26
  return undefined;
25
27
  if (typeof total !== 'number' || !Number.isSafeInteger(total) || total < n)
26
28
  return undefined;
27
- return SENTENCE[reason](n, total);
29
+ return countedClause(NEEDS_HUMAN_CLAUSES[reason], n, total, lang);
28
30
  }
29
- function needsHumanClauses(reasons, total) {
31
+ function needsHumanClauses(reasons, total, lang) {
30
32
  const clauses = [];
31
33
  for (const reason of NEEDS_HUMAN_REASON_ORDER) {
32
34
  const n = reasons.filter((r) => r === reason).length;
33
35
  if (n > 0)
34
- clauses.push(SENTENCE[reason](n, total));
36
+ clauses.push(countedClause(NEEDS_HUMAN_CLAUSES[reason], n, total, lang));
35
37
  }
36
38
  const fallback = reasons.filter((r) => !isNeedsHumanReason(r)).length;
37
39
  if (fallback > 0)
38
- clauses.push(fallbackSentence(fallback, total));
39
- return `${clauses.join('; ')} — check ${plural(reasons.length, 'it', 'them')} by hand before re-running`;
40
+ clauses.push(countedClause(FALLBACK_CLAUSE, fallback, total, lang));
41
+ const joined = clauses.join(renderMessage(msg('session.crashConverged.clauseJoin'), lang));
42
+ return renderMessage(msg(plural(reasons.length, 'session.crashConverged.needsHumanBody.one', 'session.crashConverged.needsHumanBody.many'), { clauses: joined }), lang);
40
43
  }
41
- export function crashConvergedNotice(projection) {
44
+ export function crashConvergedNotice(projection, lang) {
42
45
  const facts = readCrashConvergedNoticeFacts(projection);
43
46
  if (facts === undefined)
44
47
  return undefined;
@@ -46,12 +49,33 @@ export function crashConvergedNotice(projection) {
46
49
  if (total === 0 && dropped === 0)
47
50
  return undefined;
48
51
  if (total === 0) {
49
- return `the previous session left ${dropped} crash-converged approval ${plural(dropped, 'record', 'records')} that this version could not read. ${NO_AUTO_RERUN}.`;
52
+ return renderMessage(msg(plural(dropped, 'session.crashConverged.droppedOnly.one', 'session.crashConverged.droppedOnly.many'), { count: dropped }), lang);
50
53
  }
51
- const recordedAs = causes !== undefined && causes.length > 0 ? ` (recorded as ${causes.join(', ')})` : '';
52
- const head = `the previous engine run ended with ${total} ${plural(total, 'approval', 'approvals')} still waiting${recordedAs}, ` +
53
- `and the engine converged ${plural(total, 'it', 'them')} to denied`;
54
- const body = needsHumanReasons.length > 0 ? needsHumanClauses(needsHumanReasons, total) : `${RECORDED}, ${plural(total, 'it', 'they')} can be re-run`;
55
- const droppedClause = dropped > 0 ? ` (${dropped} further ${plural(dropped, 'record', 'records')} could not be read.)` : '';
56
- return `${head}; ${body}. ${NO_AUTO_RERUN}.${droppedClause}`;
54
+ const recordedAs = causes !== undefined && causes.length > 0 ? msg('session.crashConverged.recordedAs', { causes: causes.join(', ') }) : '';
55
+ const head = renderMessage(msg(plural(total, 'session.crashConverged.head.one', 'session.crashConverged.head.many'), { total, recorded: recordedAs }), lang);
56
+ const body = needsHumanReasons.length > 0 ? needsHumanClauses(needsHumanReasons, total, lang) : renderMessage(msg(plural(total, 'session.crashConverged.rerunnable.one', 'session.crashConverged.rerunnable.many')), lang);
57
+ const droppedClause = dropped > 0 ? msg(plural(dropped, 'session.crashConverged.droppedTail.one', 'session.crashConverged.droppedTail.many'), { count: dropped }) : '';
58
+ return renderMessage(msg('session.crashConverged.line', { head, body, dropped: droppedClause }), lang);
59
+ }
60
+ export function crashConvergedRowSentence(projection, row, lang) {
61
+ const hit = crashConvergedRowInProjection(projection, row);
62
+ if (hit === undefined)
63
+ return undefined;
64
+ let descriptor;
65
+ try {
66
+ descriptor = Object.getOwnPropertyDescriptor(hit.row, 'needsHumanReason');
67
+ }
68
+ catch {
69
+ return undefined;
70
+ }
71
+ if (hit.bucket === 'resumeSafe')
72
+ return descriptor === undefined ? renderMessage(msg(RESUME_SAFE_CLAUSE), lang) : undefined;
73
+ const reason = descriptor !== undefined && Object.hasOwn(descriptor, 'value') ? descriptor.value : undefined;
74
+ return renderMessage(msg((isNeedsHumanReason(reason) ? NEEDS_HUMAN_CLAUSES[reason] : FALLBACK_CLAUSE).one), lang);
75
+ }
76
+ export function crashConvergedCauseSentence(cause, lang) {
77
+ if (typeof cause !== 'string' || cause === '')
78
+ return undefined;
79
+ const clause = isCrashConvergedCause(cause) ? askEndingCauseClause(cause, lang) : undefined;
80
+ return renderMessage(clause === undefined ? msg('session.crashConverged.cause.neutral') : msg('session.crashConverged.cause.withClause', { clause }), lang);
57
81
  }
@@ -1,29 +1,22 @@
1
1
  import { APPROVAL_BINDING_MISMATCH, CHECKPOINT_UNSUPPORTED_VERSION, RESUME_OUTCOME_INVALID } from '../engineErrorCodes.js';
2
2
  import { ownDataField } from '../ownKey.js';
3
- import { readRefusalField } from '../wireFailureShape.js';
3
+ import { PROTOCOL_ERROR_NAME, protocolErrorNameOf, readRefusalField } from '../wireFailureShape.js';
4
4
  const BINDING_SEAT_FIELDS = new Set(['boundCallId', 'boundInputHash']);
5
5
  const ANSWER_FIELD = 'answer';
6
- const BINDING_MISMATCH_ERROR_NAME = 'ApprovalBindingMismatchError';
7
6
  export function decisionConflictOf(err) {
8
7
  if (typeof err !== 'object' || err === null)
9
8
  return undefined;
10
9
  let code;
11
- let name;
12
10
  try {
13
11
  code = ownDataField(err, 'errorCode');
14
12
  }
15
13
  catch {
16
14
  return undefined;
17
15
  }
18
- try {
19
- name = ownDataField(err, 'name');
20
- }
21
- catch {
22
- name = undefined;
23
- }
16
+ const protocolName = protocolErrorNameOf(err);
24
17
  if (code === CHECKPOINT_UNSUPPORTED_VERSION)
25
18
  return 'format_version';
26
- const bindingFamily = code === APPROVAL_BINDING_MISMATCH || (code === undefined && name === BINDING_MISMATCH_ERROR_NAME);
19
+ const bindingFamily = code === APPROVAL_BINDING_MISMATCH || (code === undefined && protocolName === PROTOCOL_ERROR_NAME.ApprovalBindingMismatchError);
27
20
  if (!bindingFamily && code !== RESUME_OUTCOME_INVALID)
28
21
  return undefined;
29
22
  let field;
@@ -1,6 +1,23 @@
1
+ import { type GateCurrentPending, type HitlSafetyCode } from './hitlBridge.js';
1
2
  import { type DecisionRefusalConflict } from './decisionConflict.js';
3
+ import { type ProtocolErrorName } from '../wireFailureShape.js';
4
+ import { type DenyAttributionRefusalDetail } from '../wireRefusalCopy.js';
2
5
  export type DecisionRefusalStanding = 'settled-elsewhere' | 'ambiguous' | 'refused-pending';
3
6
  export type { DecisionRefusalConflict } from './decisionConflict.js';
7
+ export interface RefusalCarrier {
8
+ readonly local?: HitlSafetyCode;
9
+ readonly carrier: {} | null | undefined;
10
+ }
11
+ export declare function refusalCarrierOf(err: {} | null | undefined): RefusalCarrier;
12
+ export interface RefusalRouteContext {
13
+ readonly route?: 'approval_decide' | 'live_respond' | 'ask_decide' | 'plan_review' | 'compact';
14
+ }
15
+ export interface RefusalDelivery {
16
+ readonly delivery: 'refused' | 'ambiguous' | 'no_answer';
17
+ readonly status?: number;
18
+ readonly errorCode?: string;
19
+ }
20
+ export declare function refusalDeliveryOf(err: {} | null | undefined, context?: RefusalRouteContext): RefusalDelivery;
4
21
  export declare function decisionRefusalSaysAskGone(err: unknown): boolean;
5
22
  export type DecisionRefusalAskReading = 'settled' | 'not_settled' | 'unreadable';
6
23
  interface DecisionRefusalAskFacts {
@@ -10,6 +27,28 @@ interface DecisionRefusalAskFacts {
10
27
  }
11
28
  export declare function readDecisionRefusalAsk(failure: unknown): DecisionRefusalAskFacts;
12
29
  export declare function decisionRefusalAskReading(failure: unknown): DecisionRefusalAskReading;
30
+ export interface DecisionRefusalReading {
31
+ readonly status?: number;
32
+ readonly errorCode?: string;
33
+ readonly message?: string;
34
+ readonly retriable?: true;
35
+ readonly protocolName?: ProtocolErrorName;
36
+ readonly extra?: {
37
+ readonly cause?: string;
38
+ readonly field?: string;
39
+ };
40
+ readonly blockedBy?: string;
41
+ readonly currentPending?: GateCurrentPending;
42
+ readonly denyAttributionRefusal?: DenyAttributionRefusalDetail;
43
+ readonly ask: DecisionRefusalAskReading;
44
+ readonly gateMoved?: true;
45
+ readonly wordingHint?: true;
46
+ readonly standing?: DecisionRefusalStanding;
47
+ readonly transient?: true;
48
+ readonly conflict?: DecisionRefusalConflict;
49
+ }
50
+ export declare function mintDecisionRefusalReading(err: {} | null | undefined, context?: RefusalRouteContext, attributionCarried?: boolean): DecisionRefusalReading;
51
+ export declare function readDecisionRefusalReading(err: {} | null | undefined, context?: RefusalRouteContext): DecisionRefusalReading;
13
52
  export interface DecisionRefusalClassified {
14
53
  readonly standing: DecisionRefusalStanding;
15
54
  readonly status: number;
@@ -17,7 +56,7 @@ export interface DecisionRefusalClassified {
17
56
  readonly transient?: true;
18
57
  readonly conflict?: DecisionRefusalConflict;
19
58
  }
20
- export declare function classifyDecisionRefusal(err: unknown): DecisionRefusalClassified | undefined;
59
+ export declare function classifyDecisionRefusal(err: unknown, context?: RefusalRouteContext): DecisionRefusalClassified | undefined;
21
60
  export type LiveAskPendingReading = 'pending' | 'not_pending' | 'unknown';
22
61
  export declare function liveAskPendingReading(envelope: unknown, approvalId: string): LiveAskPendingReading;
23
62
  export declare function decisionRefusalClosesOut(refusal: DecisionRefusalClassified | undefined, pending: LiveAskPendingReading): boolean;