@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.
- package/CHANGELOG.md +607 -0
- package/README.md +96 -46
- package/dist/adapt/arms.d.ts +1 -0
- package/dist/adapt/arms.js +188 -53
- package/dist/adapt/ids.d.ts +12 -1
- package/dist/adapt/ids.js +59 -8
- package/dist/adapt/instanceLedger.d.ts +50 -0
- package/dist/adapt/instanceLedger.js +147 -0
- package/dist/adapt/panelTasks.d.ts +1 -1
- package/dist/adapt/panelTasks.js +2 -2
- package/dist/adapt/textStream.d.ts +1 -0
- package/dist/adapt/textStream.js +24 -7
- package/dist/adapt/toolCards.d.ts +27 -5
- package/dist/adapt/toolCards.js +39 -6
- package/dist/adapt/wireShapes.js +6 -2
- package/dist/adapt.d.ts +2 -0
- package/dist/adapt.js +8 -3
- package/dist/adapter/activeRunSelfHeal.d.ts +9 -3
- package/dist/adapter/activeRunSelfHeal.js +205 -313
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +77 -36
- package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
- package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
- package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
- package/dist/adapter/runStream.js +79 -48
- package/dist/adapter/types.d.ts +4 -4
- package/dist/adapter/types.js +2 -1
- package/dist/agentSession/backgroundView.js +2 -1
- package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
- package/dist/agentSession/engineAgentRegistryRead.js +12 -13
- package/dist/agentSession/engineSessionBackgroundStop.js +16 -8
- package/dist/agentsWireCaps.d.ts +8 -11
- package/dist/agentsWireCaps.js +196 -194
- package/dist/approvalDecidedByCapability.d.ts +0 -4
- package/dist/approvalDecidedByCapability.js +0 -6
- package/dist/approvalsStreamLiveCapability.d.ts +0 -4
- package/dist/approvalsStreamLiveCapability.js +0 -6
- package/dist/assistantInbox.d.ts +34 -0
- package/dist/assistantInbox.js +118 -0
- package/dist/centerWiringCapability.js +9 -1
- package/dist/clientSlice.d.ts +0 -9
- package/dist/clientSlice.js +0 -3
- package/dist/cloudConfigWireCaps.d.ts +5 -3
- package/dist/cloudConfigWireCaps.js +106 -64
- package/dist/compensations.js +1 -1
- package/dist/connectorStatus.d.ts +21 -0
- package/dist/connectorStatus.js +112 -0
- package/dist/controlRouter.d.ts +18 -3
- package/dist/controlRouter.js +106 -67
- package/dist/coreValuePorts.d.ts +29 -4
- package/dist/coreValuePorts.js +10 -0
- package/dist/corruptSessionCopy.d.ts +2 -1
- package/dist/corruptSessionCopy.js +3 -3
- package/dist/decideReceipt.d.ts +2 -2
- package/dist/decideReceipt.js +5 -2
- package/dist/declared/supportFloorDeclared.js +3 -3
- package/dist/detachWire.js +3 -2
- package/dist/deviceExecutorManagementCapability.d.ts +0 -4
- package/dist/deviceExecutorManagementCapability.js +0 -6
- package/dist/deviceRebind.d.ts +49 -1
- package/dist/deviceRebind.js +221 -3
- package/dist/devicesFace.d.ts +34 -0
- package/dist/devicesFace.js +90 -0
- package/dist/displayUntrusted.d.ts +2 -0
- package/dist/displayUntrusted.js +253 -76
- package/dist/engineAgentAbsence.d.ts +1 -1
- package/dist/engineAgentPanelStore.d.ts +12 -4
- package/dist/engineAgentPanelStore.js +16 -11
- package/dist/engineCapReader.d.ts +2 -5
- package/dist/engineCapReader.js +8 -10
- package/dist/engineCapsCache.d.ts +12 -0
- package/dist/engineCapsCache.js +76 -18
- package/dist/engineCapsChange.d.ts +2 -0
- package/dist/engineCapsChange.js +9 -0
- package/dist/engineClosedSets.d.ts +1 -0
- package/dist/engineClosedSets.js +4 -1
- package/dist/engineErrorCodes.d.ts +11 -3
- package/dist/engineErrorCodes.js +11 -8
- package/dist/engineIdentity.d.ts +1 -0
- package/dist/engineIdentity.js +8 -0
- package/dist/engineRowRef.d.ts +28 -0
- package/dist/engineRowRef.js +114 -0
- package/dist/engineSessionMessages.d.ts +68 -0
- package/dist/engineSessionMessages.js +370 -0
- package/dist/engineTargetSeat.d.ts +27 -0
- package/dist/engineTargetSeat.js +199 -0
- package/dist/engineToolDirectory.d.ts +0 -9
- package/dist/engineToolDirectory.js +1 -94
- package/dist/engineUrl.d.ts +18 -0
- package/dist/engineUrl.js +52 -0
- package/dist/engineWireFor.js +3 -8
- package/dist/env/uiLanguage.d.ts +11 -1
- package/dist/env/uiLanguage.js +38 -2
- package/dist/eventLeg.d.ts +100 -0
- package/dist/eventLeg.js +305 -0
- package/dist/executionLaneCapability.d.ts +0 -4
- package/dist/executionLaneCapability.js +3 -16
- package/dist/fileHistoryCaptureCapability.d.ts +2 -5
- package/dist/fileHistoryCaptureCapability.js +13 -21
- package/dist/fileHistoryLegNotice.d.ts +2 -1
- package/dist/fileHistoryLegNotice.js +3 -3
- package/dist/fleet/fleetLedger.d.ts +0 -3
- package/dist/fleet/fleetLedger.js +21 -36
- package/dist/fleet/fleetProjection.d.ts +2 -2
- package/dist/fleet/fleetProjection.js +10 -8
- package/dist/frameBinding.d.ts +8 -0
- package/dist/frameBinding.js +35 -0
- package/dist/gateFailureCodes.d.ts +2 -0
- package/dist/gateFailureCodes.js +15 -0
- package/dist/gateOutcome.d.ts +3 -1
- package/dist/gateOutcome.js +41 -8
- package/dist/gateVocabulary.d.ts +10 -4
- package/dist/gateVocabulary.js +107 -47
- package/dist/generated/engineAskFaceTables.js +2 -2
- package/dist/generated/engineFactTables.d.ts +22 -3
- package/dist/generated/engineFactTables.js +51 -4
- package/dist/generated/engineNoticeTables.js +18 -3
- package/dist/generated/settingsSchemaFns.d.ts +6 -0
- package/dist/generated/settingsSchemaFns.js +57 -0
- package/dist/generated/settingsSchemaHooksClassifier.d.ts +2 -0
- package/dist/generated/settingsSchemaHooksClassifier.js +254 -0
- package/dist/generated/settingsSchemaTables.d.ts +1 -0
- package/dist/generated/settingsSchemaTables.js +4 -0
- package/dist/generated/settingsSchemaTypes.d.ts +105 -0
- package/dist/generated/settingsSchemaTypes.js +1 -0
- package/dist/generated/toolNameTables.d.ts +1 -0
- package/dist/generated/toolNameTables.js +1 -0
- package/dist/hitl/allowRuleShadow.d.ts +8 -2
- package/dist/hitl/allowRuleShadow.js +36 -29
- package/dist/hitl/approvalCardReading.d.ts +15 -0
- package/dist/hitl/approvalCardReading.js +154 -0
- package/dist/hitl/approvalCardReasons.d.ts +14 -0
- package/dist/hitl/approvalCardReasons.js +119 -0
- package/dist/hitl/approvalHolds.d.ts +50 -15
- package/dist/hitl/approvalHolds.js +177 -27
- package/dist/hitl/approvalResolution.d.ts +51 -26
- package/dist/hitl/approvalResolution.js +86 -122
- package/dist/hitl/approvalsFeed.js +6 -18
- package/dist/hitl/askClassPair.d.ts +2 -0
- package/dist/hitl/askClassPair.js +17 -0
- package/dist/hitl/askGateWire.d.ts +20 -2
- package/dist/hitl/askGateWire.js +50 -1
- package/dist/hitl/askParkRowRouting.d.ts +5 -0
- package/dist/hitl/askParkRowRouting.js +32 -1
- package/dist/hitl/askSettlementLine.d.ts +28 -0
- package/dist/hitl/askSettlementLine.js +99 -0
- package/dist/hitl/automaticAnswerVerdict.d.ts +3 -2
- package/dist/hitl/automaticAnswerVerdict.js +29 -13
- package/dist/hitl/crashConverged.d.ts +11 -20
- package/dist/hitl/crashConverged.js +56 -0
- package/dist/hitl/crashConvergedNotice.d.ts +6 -3
- package/dist/hitl/crashConvergedNotice.js +48 -24
- package/dist/hitl/decisionConflict.js +3 -10
- package/dist/hitl/decisionRefusal.d.ts +40 -1
- package/dist/hitl/decisionRefusal.js +199 -42
- package/dist/hitl/frameRouter.d.ts +5 -2
- package/dist/hitl/frameRouter.js +27 -24
- package/dist/hitl/gateLedger.d.ts +2 -0
- package/dist/hitl/gateLedger.js +50 -13
- package/dist/hitl/hitlBridge.d.ts +2 -2
- package/dist/hitl/hitlBridge.js +13 -10
- package/dist/hitl/livePendingAsk.d.ts +3 -3
- package/dist/hitl/livePendingAsk.js +7 -18
- package/dist/hitl/parkResolver.d.ts +2 -24
- package/dist/hitl/parkResolver.js +61 -97
- package/dist/hitl/persistedRulesWire.d.ts +25 -0
- package/dist/hitl/persistedRulesWire.js +104 -2
- package/dist/hitl/planReviewWire.d.ts +31 -13
- package/dist/hitl/planReviewWire.js +120 -78
- package/dist/hitl/refusedToolNameProse.d.ts +0 -1
- package/dist/hitl/refusedToolNameProse.js +0 -3
- package/dist/hitl/replayedApproval.d.ts +4 -3
- package/dist/hitl/replayedApproval.js +7 -4
- package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
- package/dist/hitl/sessionPolicyDeliverable.js +48 -7
- package/dist/hitl/sessionPolicyWire.d.ts +34 -21
- package/dist/hitl/sessionPolicyWire.js +179 -70
- package/dist/hitl/standingRows.d.ts +20 -2
- package/dist/hitl/standingRows.js +69 -8
- package/dist/hitl/suspendedReopen.d.ts +2 -1
- package/dist/hitl/suspendedReopen.js +7 -10
- package/dist/hitl/toolApprovalWire.d.ts +103 -156
- package/dist/hitl/toolApprovalWire.js +661 -411
- package/dist/hookMatcherVerdict.d.ts +6 -1
- package/dist/hookMatcherVerdict.js +14 -7
- package/dist/hooksWireCaps.d.ts +2 -2
- package/dist/hooksWireCaps.js +174 -81
- package/dist/host.d.ts +21 -0
- package/dist/hostTurnSettings.d.ts +71 -0
- package/dist/hostTurnSettings.js +291 -0
- package/dist/humanTurn.d.ts +14 -1
- package/dist/humanTurn.js +100 -12
- package/dist/humanTurnRead.d.ts +2 -0
- package/dist/humanTurnRead.js +22 -1
- package/dist/i18n/messages.en.d.ts +703 -0
- package/dist/i18n/messages.en.js +701 -0
- package/dist/i18n/messages.zh.d.ts +3 -0
- package/dist/i18n/messages.zh.js +837 -0
- package/dist/i18n/translate.d.ts +25 -0
- package/dist/i18n/translate.js +127 -0
- package/dist/index.d.ts +78 -29
- package/dist/index.js +54 -18
- package/dist/inheritEnvCapability.d.ts +32 -0
- package/dist/inheritEnvCapability.js +104 -0
- package/dist/inheritEnvWire.d.ts +3 -2
- package/dist/inheritEnvWire.js +12 -14
- package/dist/interactiveHalt.js +17 -6
- package/dist/liveModelCatalog.d.ts +3 -3
- package/dist/liveModelCatalog.js +15 -13
- package/dist/liveQuestionStore.d.ts +2 -21
- package/dist/mcpLiveness.d.ts +2 -1
- package/dist/mcpPanel.d.ts +10 -1
- package/dist/mcpPanel.js +40 -13
- package/dist/mcpProbeCapability.d.ts +2 -1
- package/dist/mcpProbeCapability.js +7 -11
- package/dist/mcpProbeWire.d.ts +9 -2
- package/dist/mcpProbeWire.js +6 -1
- package/dist/mcpWireCaps.d.ts +47 -2
- package/dist/mcpWireCaps.js +164 -16
- package/dist/memoryEntriesWire.d.ts +4 -9
- package/dist/memoryEntriesWire.js +5 -10
- package/dist/model/modelSupplyRules.d.ts +0 -2
- package/dist/model/modelSupplyRules.js +3 -12
- package/dist/model/modelsPolicy.d.ts +0 -5
- package/dist/model/modelsPolicy.js +6 -36
- package/dist/model/onboardJudgement.d.ts +93 -0
- package/dist/model/onboardJudgement.js +415 -0
- package/dist/model/subagentModelWord.d.ts +31 -0
- package/dist/model/subagentModelWord.js +261 -0
- package/dist/model/tierVocabulary.d.ts +2 -0
- package/dist/model/tierVocabulary.js +17 -5
- package/dist/modelCapabilityProbe.d.ts +64 -0
- package/dist/modelCapabilityProbe.js +600 -0
- package/dist/modelIdentityResolvability.d.ts +3 -0
- package/dist/modelIdentityResolvability.js +26 -17
- package/dist/notifications.d.ts +6 -0
- package/dist/notifications.js +71 -23
- package/dist/outputStyleSeatCapability.d.ts +0 -3
- package/dist/outputStyleSeatCapability.js +0 -3
- package/dist/ownKey.d.ts +22 -0
- package/dist/ownKey.js +94 -3
- package/dist/panelReduce.d.ts +21 -10
- package/dist/panelReduce.js +728 -550
- package/dist/panelStateHolder.d.ts +3 -7
- package/dist/panelStateHolder.js +14 -130
- package/dist/peerLaneCapability.d.ts +0 -4
- package/dist/peerLaneCapability.js +0 -6
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.d.ts +2 -5
- package/dist/permissionRulesWriteCapability.js +8 -12
- package/dist/permissionWireCaps.d.ts +2 -2
- package/dist/permissionWireCaps.js +2 -0
- package/dist/permissionsAllowGrantCapability.d.ts +0 -4
- package/dist/permissionsAllowGrantCapability.js +0 -6
- package/dist/permissionsDeclaration.d.ts +0 -11
- package/dist/permissionsDeclaration.js +60 -53
- package/dist/pluginHooksWire.d.ts +46 -3
- package/dist/pluginHooksWire.js +219 -16
- package/dist/preemptWire.d.ts +44 -0
- package/dist/preemptWire.js +83 -0
- package/dist/printModelStatus.d.ts +63 -0
- package/dist/printModelStatus.js +155 -0
- package/dist/printToolResultFrame.js +15 -4
- package/dist/replayBody.d.ts +3 -0
- package/dist/replayBody.js +14 -0
- package/dist/request/taskRequest.d.ts +11 -6
- package/dist/request/taskRequest.js +112 -19
- package/dist/resumeRefusalCopy.d.ts +13 -9
- package/dist/resumeRefusalCopy.js +81 -118
- package/dist/retryStatus.d.ts +45 -0
- package/dist/retryStatus.js +185 -1
- package/dist/rewindArchiveCapability.d.ts +0 -4
- package/dist/rewindArchiveCapability.js +2 -10
- package/dist/rewindArchiveReading.d.ts +0 -1
- package/dist/rewindArchiveReading.js +0 -3
- package/dist/runCancelContext.d.ts +2 -1
- package/dist/runCancelContext.js +4 -2
- package/dist/runReattachPolicy.d.ts +31 -0
- package/dist/runReattachPolicy.js +46 -0
- package/dist/runTerminal.d.ts +3 -6
- package/dist/runTerminal.js +8 -9
- package/dist/sandboxWire.d.ts +3 -1
- package/dist/sandboxWire.js +76 -27
- package/dist/scenarioRefusal.d.ts +9 -0
- package/dist/scenarioRefusal.js +111 -0
- package/dist/scenarioWire.js +1 -1
- package/dist/seam.d.ts +48 -2
- package/dist/seam.js +25 -4
- package/dist/seatContract.d.ts +311 -18
- package/dist/seatContract.js +824 -100
- package/dist/selfOrchestrationDenial.js +7 -19
- package/dist/sessionIdSegment.d.ts +6 -0
- package/dist/sessionIdSegment.js +24 -0
- package/dist/sessionMemoryStatus.js +6 -11
- package/dist/sessionPolicyCapability.d.ts +2 -5
- package/dist/sessionPolicyCapability.js +8 -12
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
- package/dist/sessionSyncFileHistoryCapability.js +0 -3
- package/dist/settingsHooksSalvage.d.ts +44 -0
- package/dist/settingsHooksSalvage.js +211 -0
- package/dist/skillToolListsCapability.d.ts +2 -4
- package/dist/skillToolListsCapability.js +8 -9
- package/dist/sqlEngineCapability.d.ts +0 -4
- package/dist/sqlEngineCapability.js +0 -6
- package/dist/sseIdleTriage.js +3 -2
- package/dist/steerPriorityCapability.d.ts +0 -3
- package/dist/steerPriorityCapability.js +0 -3
- package/dist/streamDrainingLegs.d.ts +4 -0
- package/dist/streamDrainingLegs.js +6 -1
- package/dist/subagent/engineCompactWire.d.ts +0 -1
- package/dist/subagent/engineCompactWire.js +7 -5
- package/dist/subagent/engineSubagentResume.js +15 -9
- package/dist/subagent/engineTaskHandleWire.js +4 -7
- package/dist/subagentContentStore.d.ts +3 -0
- package/dist/subagentContentStore.js +22 -10
- package/dist/submitReopen.d.ts +24 -0
- package/dist/submitReopen.js +75 -0
- package/dist/terminalStatuses.d.ts +3 -0
- package/dist/terminalStatuses.js +10 -2
- package/dist/toolHistoryMismatch.js +3 -2
- package/dist/toolResult.d.ts +10 -1
- package/dist/toolResult.js +34 -6
- package/dist/toolRoster.d.ts +3 -4
- package/dist/toolRoster.js +21 -22
- package/dist/turnFailurePresentation.d.ts +39 -0
- package/dist/turnFailurePresentation.js +402 -0
- package/dist/usageAnalytics.js +6 -11
- package/dist/userAttachmentEnvelope.d.ts +1 -0
- package/dist/userAttachmentEnvelope.js +37 -7
- package/dist/userAttachmentSeat.d.ts +21 -0
- package/dist/userAttachmentSeat.js +75 -0
- package/dist/userInvokedSkillsCapability.d.ts +11 -4
- package/dist/userInvokedSkillsCapability.js +31 -10
- package/dist/webSearchBackendCapability.d.ts +0 -4
- package/dist/webSearchBackendCapability.js +0 -6
- package/dist/wireErrorTriage.d.ts +7 -0
- package/dist/wireErrorTriage.js +26 -23
- package/dist/wireFailureShape.d.ts +62 -5
- package/dist/wireFailureShape.js +106 -5
- package/dist/wireRefusalCopy.d.ts +25 -3
- package/dist/wireRefusalCopy.js +74 -80
- package/dist/workflowsJournalCapability.d.ts +2 -5
- package/dist/workflowsJournalCapability.js +8 -12
- package/dist/writeProtectionCapability.d.ts +0 -4
- package/dist/writeProtectionCapability.js +0 -6
- package/docs/INTEGRATION-CLIENTS.md +1775 -56
- package/package.json +6 -5
- package/dist/attachmentSeatCapability.d.ts +0 -12
- package/dist/attachmentSeatCapability.js +0 -23
- package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
- package/dist/hitl/approvalOutcomeNote.js +0 -29
- package/dist/sessionReadRedactionCapability.d.ts +0 -13
- 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 {
|
|
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: '
|
|
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' &&
|
|
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'
|
|
127
|
-
|
|
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
|
|
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
|
|
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?:
|
|
10
|
+
crashConverged?: CrashConvergedRowReading[];
|
|
24
11
|
}
|
|
25
12
|
export interface CrashConvergedProjection {
|
|
26
13
|
readonly total: number;
|
|
27
|
-
readonly resumeSafe: readonly
|
|
28
|
-
readonly needsHuman: readonly
|
|
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
|
|
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 {
|
|
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 {
|
|
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
|
|
13
|
-
approved_then_interrupted:
|
|
14
|
-
pending_unsafe:
|
|
15
|
-
contradictory:
|
|
16
|
-
unstable_row:
|
|
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
|
|
19
|
-
const
|
|
20
|
-
|
|
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
|
|
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(
|
|
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(
|
|
39
|
-
|
|
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
|
|
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 ?
|
|
52
|
-
const head =
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
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 &&
|
|
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;
|