@sema-agent/client-core 0.100.0 → 0.101.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 +395 -0
- package/README.md +164 -117
- package/dist/adapt/arms.js +51 -16
- package/dist/adapt/textStream.js +7 -4
- package/dist/adapt/toolCards.js +9 -8
- package/dist/adapt.js +7 -1
- package/dist/adapter/activeRunSelfHeal.d.ts +24 -2
- package/dist/adapter/activeRunSelfHeal.js +108 -6
- package/dist/adapter/downstream/eventToSdkMessage.js +33 -12
- package/dist/adapter/downstream/terminalToSdkResult.d.ts +60 -1
- package/dist/adapter/downstream/terminalToSdkResult.js +209 -39
- package/dist/adapter/runStream.d.ts +4 -4
- package/dist/adapter/runStream.js +158 -43
- package/dist/agentsWireCaps.d.ts +2 -7
- package/dist/agentsWireCaps.js +1 -2
- package/dist/approvalDecidedByCapability.js +2 -2
- package/dist/approvalFrameFamilies.d.ts +33 -0
- package/dist/approvalFrameFamilies.js +120 -0
- package/dist/approvalsStreamLiveCapability.js +2 -2
- package/dist/attachmentsWireCaps.js +41 -13
- package/dist/callerCwdCapability.js +2 -2
- package/dist/centerWiringCapability.js +2 -2
- package/dist/clockReading.d.ts +2 -0
- package/dist/clockReading.js +4 -0
- package/dist/cloudConfigWireCaps.d.ts +19 -5
- package/dist/cloudConfigWireCaps.js +193 -56
- package/dist/coreValuePorts.d.ts +12 -2
- package/dist/coreValuePorts.js +9 -0
- package/dist/decideFailureNote.js +5 -3
- package/dist/decideReceipt.js +2 -2
- package/dist/deviceExecutorManagementCapability.js +2 -2
- package/dist/deviceFlowPolling.js +1 -1
- package/dist/disableSkillsWire.d.ts +1 -1
- package/dist/disableSkillsWire.js +4 -3
- package/dist/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +65 -8
- package/dist/engineCapReader.js +1 -1
- package/dist/engineConfigDrift.js +1 -1
- package/dist/engineErrorCodes.d.ts +14 -5
- package/dist/engineErrorCodes.js +27 -6
- package/dist/engineGenerationConvergence.d.ts +39 -0
- package/dist/engineGenerationConvergence.js +95 -0
- package/dist/engineGenerationPort.d.ts +61 -0
- package/dist/engineGenerationPort.js +144 -0
- package/dist/engineHealthFacts.d.ts +23 -0
- package/dist/engineHealthFacts.js +92 -0
- package/dist/engineIdentity.d.ts +4 -0
- package/dist/engineIdentity.js +11 -0
- package/dist/engineNoticeCodes.d.ts +2 -5
- package/dist/engineRowRef.js +3 -0
- package/dist/engineSessionMessages.js +2 -2
- package/dist/engineToolDirectory.js +2 -2
- package/dist/engineWireFor.d.ts +99 -0
- package/dist/engineWireFor.js +248 -6
- package/dist/engineWireTarget.d.ts +1 -0
- package/dist/engineWireTarget.js +8 -0
- package/dist/env/uiLanguage.js +1 -1
- package/dist/errorSupplementRoles.d.ts +3 -0
- package/dist/errorSupplementRoles.js +37 -0
- package/dist/executionLaneCapability.js +2 -2
- package/dist/fileHistoryCaptureCapability.js +3 -3
- package/dist/finalVerifyWire.d.ts +6 -3
- package/dist/finalVerifyWire.js +6 -23
- package/dist/flagInput.d.ts +4 -0
- package/dist/flagInput.js +24 -0
- package/dist/fleet/fleetLedger.js +5 -2
- package/dist/fleet/fleetProjection.d.ts +1 -0
- package/dist/fleet/fleetProjection.js +15 -2
- package/dist/gateVocabulary.js +3 -0
- package/dist/generated/engineFactTables.d.ts +7 -3
- package/dist/generated/engineFactTables.js +52 -0
- package/dist/generated/engineNoticeTables.js +12 -0
- package/dist/generated/settingsSchemaActiveTiers.d.ts +1 -0
- package/dist/generated/settingsSchemaActiveTiers.js +14 -0
- package/dist/generated/settingsSchemaCallerTextEcho.d.ts +1 -0
- package/dist/generated/settingsSchemaCallerTextEcho.js +8 -0
- package/dist/generated/settingsSchemaControlAndBidi.d.ts +1 -0
- package/dist/generated/settingsSchemaControlAndBidi.js +8 -0
- package/dist/generated/settingsSchemaDefaultModel.d.ts +11 -0
- package/dist/generated/settingsSchemaDefaultModel.js +25 -0
- package/dist/generated/settingsSchemaFns.d.ts +54 -0
- package/dist/generated/settingsSchemaFns.js +26 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -1
- package/dist/generated/settingsSchemaMcpRequestEntry.js +1 -7
- package/dist/generated/settingsSchemaSafetyMergeSpec.d.ts +1 -0
- package/dist/generated/settingsSchemaSafetyMergeSpec.js +95 -0
- package/dist/generated/settingsSchemaSettingsSources.d.ts +1 -0
- package/dist/generated/settingsSchemaSettingsSources.js +58 -0
- package/dist/generated/settingsSchemaTables.d.ts +2 -0
- package/dist/generated/settingsSchemaTables.js +13 -0
- package/dist/generated/settingsSchemaUrlPattern.d.ts +1 -0
- package/dist/generated/settingsSchemaUrlPattern.js +183 -0
- package/dist/headlessPermissionModeWire.d.ts +18 -2
- package/dist/headlessPermissionModeWire.js +30 -19
- package/dist/hitl/allowRuleShadow.js +7 -5
- package/dist/hitl/approvalCardReading.d.ts +3 -0
- package/dist/hitl/approvalCardReading.js +17 -0
- package/dist/hitl/approvalCompleteParked.js +1 -1
- package/dist/hitl/approvalDelivery.d.ts +87 -0
- package/dist/hitl/approvalDelivery.js +193 -0
- package/dist/hitl/approvalResolution.d.ts +11 -0
- package/dist/hitl/approvalResolution.js +50 -11
- package/dist/hitl/askClassPair.d.ts +6 -0
- package/dist/hitl/askClassPair.js +30 -3
- package/dist/hitl/askParkAutoReopenBlock.d.ts +30 -0
- package/dist/hitl/askParkAutoReopenBlock.js +117 -0
- package/dist/hitl/askParkRowRouting.js +4 -1
- package/dist/hitl/attributionLadder.d.ts +42 -3
- package/dist/hitl/attributionLadder.js +79 -8
- package/dist/hitl/automaticAnswerVerdict.d.ts +6 -1
- package/dist/hitl/automaticAnswerVerdict.js +46 -11
- package/dist/hitl/crashConverged.js +2 -2
- package/dist/hitl/decisionConflict.d.ts +6 -2
- package/dist/hitl/decisionConflict.js +24 -9
- package/dist/hitl/decisionRefusal.d.ts +20 -10
- package/dist/hitl/decisionRefusal.js +99 -54
- package/dist/hitl/decisionSend.d.ts +3 -0
- package/dist/hitl/decisionSend.js +87 -103
- package/dist/hitl/frameRouter.d.ts +1 -0
- package/dist/hitl/frameRouter.js +9 -2
- package/dist/hitl/hitlBridge.d.ts +18 -6
- package/dist/hitl/hitlBridge.js +41 -37
- package/dist/hitl/livePendingAsk.js +4 -3
- package/dist/hitl/noAllowCause.js +1 -1
- package/dist/hitl/parkResolver.js +3 -2
- package/dist/hitl/persistedRulesWire.js +1 -0
- package/dist/hitl/planReviewWire.d.ts +4 -0
- package/dist/hitl/planReviewWire.js +59 -30
- package/dist/hitl/resumeRunningCard.d.ts +3 -2
- package/dist/hitl/resumeRunningCard.js +17 -11
- package/dist/hitl/sessionPolicyDeliverable.d.ts +5 -2
- package/dist/hitl/sessionPolicyDeliverable.js +62 -29
- package/dist/hitl/sessionPolicyWire.d.ts +13 -3
- package/dist/hitl/sessionPolicyWire.js +81 -16
- package/dist/hitl/standingRows.js +1 -1
- package/dist/hitl/toolApprovalWire.d.ts +9 -10
- package/dist/hitl/toolApprovalWire.js +72 -54
- package/dist/hookMatcherVerdict.d.ts +2 -0
- package/dist/hookMatcherVerdict.js +12 -0
- package/dist/hooksCompactTransition.d.ts +19 -0
- package/dist/hooksCompactTransition.js +41 -0
- package/dist/hooksWireCaps.d.ts +1 -1
- package/dist/hooksWireCaps.js +202 -203
- package/dist/host.d.ts +1 -14
- package/dist/host.js +0 -8
- package/dist/hostCallbackGuard.d.ts +1 -0
- package/dist/hostCallbackGuard.js +1 -1
- package/dist/hostSettingsSource.d.ts +172 -0
- package/dist/hostSettingsSource.js +675 -0
- package/dist/hostTurnSettings.d.ts +73 -17
- package/dist/hostTurnSettings.js +594 -97
- package/dist/httpHookPolicy.d.ts +37 -0
- package/dist/httpHookPolicy.js +176 -0
- package/dist/humanTurn.d.ts +2 -1
- package/dist/humanTurn.js +37 -7
- package/dist/humanTurnRead.js +4 -3
- package/dist/humanTurnSentences.d.ts +10 -0
- package/dist/humanTurnSentences.js +74 -0
- package/dist/i18n/messages.en.d.ts +184 -2
- package/dist/i18n/messages.en.js +187 -5
- package/dist/i18n/messages.zh.js +197 -5
- package/dist/i18n/translate.js +3 -3
- package/dist/index.d.ts +69 -15
- package/dist/index.js +45 -13
- package/dist/inheritEnvCapability.d.ts +3 -1
- package/dist/inheritEnvCapability.js +31 -17
- package/dist/inheritEnvWire.d.ts +2 -1
- package/dist/inheritEnvWire.js +11 -5
- package/dist/interactiveToolsWire.d.ts +4 -2
- package/dist/interactiveToolsWire.js +5 -5
- package/dist/jsonFaithful.d.ts +20 -0
- package/dist/jsonFaithful.js +152 -0
- package/dist/limitsWire.d.ts +7 -2
- package/dist/limitsWire.js +19 -13
- package/dist/liveInitToolFace.d.ts +6 -1
- package/dist/liveInitToolFace.js +5 -3
- package/dist/liveModelCatalog.d.ts +22 -0
- package/dist/liveModelCatalog.js +132 -18
- package/dist/mcpPanel.js +1 -1
- package/dist/mcpProbeCapability.js +2 -2
- package/dist/mcpStatusSupersetKeys.d.ts +24 -0
- package/dist/mcpStatusSupersetKeys.js +45 -0
- package/dist/mcpToolToggles.js +2 -1
- package/dist/mcpWireCaps.d.ts +39 -1
- package/dist/mcpWireCaps.js +254 -50
- package/dist/memoryComplianceCapability.js +2 -2
- package/dist/memoryOriginCapability.js +2 -2
- package/dist/model/catalogDefault.d.ts +24 -0
- package/dist/model/catalogDefault.js +4 -0
- package/dist/model/liveCatalogShape.js +5 -4
- package/dist/model/modelsPolicy.js +4 -3
- package/dist/model/onboardJudgement.d.ts +1 -0
- package/dist/model/onboardJudgement.js +1 -1
- package/dist/model/subagentModelWord.js +2 -2
- package/dist/modelCapabilityProbe.js +6 -6
- package/dist/modelIdentityResolvability.d.ts +10 -1
- package/dist/modelIdentityResolvability.js +62 -39
- package/dist/modsKernelIdentity.d.ts +10 -0
- package/dist/modsKernelIdentity.js +103 -0
- package/dist/modsKernelTransit.d.ts +8 -0
- package/dist/modsKernelTransit.js +6 -0
- package/dist/notifications.d.ts +30 -12
- package/dist/notifications.js +241 -53
- package/dist/outputStyleSeatCapability.js +2 -2
- package/dist/ownKey.d.ts +11 -0
- package/dist/ownKey.js +164 -3
- package/dist/panelReduce.js +1 -1
- package/dist/peerFrames.d.ts +1 -1
- package/dist/peerFrames.js +6 -2
- package/dist/peerLaneCapability.js +2 -2
- package/dist/permissionModesCapability.js +4 -4
- package/dist/permissionRuleIssue.js +2 -0
- package/dist/permissionRulesWriteCapability.js +2 -2
- package/dist/permissionsAllowGrantCapability.js +2 -2
- package/dist/permissionsDeclaration.d.ts +43 -4
- package/dist/permissionsDeclaration.js +102 -35
- package/dist/pluginHooksWire.d.ts +20 -4
- package/dist/pluginHooksWire.js +92 -53
- package/dist/prepareRefusal.d.ts +3 -2
- package/dist/prepareRefusal.js +27 -9
- package/dist/printInitToolFace.js +2 -2
- package/dist/printModelStatus.js +1 -1
- package/dist/projectMemory.d.ts +32 -0
- package/dist/projectMemory.js +70 -0
- package/dist/promptBlockedCopy.d.ts +2 -1
- package/dist/promptBlockedCopy.js +2 -1
- package/dist/promptDelivery.d.ts +23 -3
- package/dist/promptDelivery.js +169 -30
- package/dist/providerRejection.d.ts +19 -1
- package/dist/providerRejection.js +75 -4
- package/dist/queuedDelivery.d.ts +48 -0
- package/dist/queuedDelivery.js +233 -0
- package/dist/reattachWindow.d.ts +94 -0
- package/dist/reattachWindow.js +127 -0
- package/dist/request/printNotification.d.ts +1 -1
- package/dist/request/printNotification.js +5 -1
- package/dist/request/submissionIdentity.d.ts +37 -0
- package/dist/request/submissionIdentity.js +65 -0
- package/dist/request/taskRequest.d.ts +12 -4
- package/dist/request/taskRequest.js +221 -152
- package/dist/resultFrameKeys.d.ts +1 -0
- package/dist/resultFrameKeys.js +4 -1
- package/dist/retryStatus.d.ts +8 -0
- package/dist/retryStatus.js +57 -9
- package/dist/rewindArchiveCapability.js +2 -2
- package/dist/rewindEngineAction.d.ts +2 -0
- package/dist/rewindEngineAction.js +23 -1
- package/dist/rowKind.d.ts +36 -0
- package/dist/rowKind.js +97 -0
- package/dist/ruleCompileVerdict.d.ts +18 -0
- package/dist/ruleCompileVerdict.js +67 -2
- package/dist/ruleReadings.d.ts +58 -0
- package/dist/ruleReadings.js +132 -0
- package/dist/ruleRefusalSentence.d.ts +4 -0
- package/dist/ruleRefusalSentence.js +9 -3
- package/dist/runCancelContext.d.ts +0 -1
- package/dist/runCancelContext.js +1 -2
- package/dist/runTerminal.d.ts +5 -0
- package/dist/runTerminal.js +52 -17
- package/dist/sandboxWire.d.ts +1 -1
- package/dist/sandboxWire.js +4 -6
- package/dist/scenarioRefusal.js +1 -1
- package/dist/scenarioSkills.d.ts +20 -0
- package/dist/scenarioSkills.js +72 -0
- package/dist/scenarioWire.d.ts +5 -2
- package/dist/scenarioWire.js +9 -9
- package/dist/sealedKeyCapability.js +2 -2
- package/dist/seam.d.ts +2 -0
- package/dist/seam.js +2 -2
- package/dist/seatContract.d.ts +46 -1
- package/dist/seatContract.js +49 -19
- package/dist/selfOrchestrationDenial.js +1 -1
- package/dist/sessionPolicyCapability.js +2 -2
- package/dist/sessionRulesChildrenReadLive.d.ts +6 -0
- package/dist/sessionRulesChildrenReadLive.js +5 -0
- package/dist/sessionRulesNamespaceFormsCapability.d.ts +12 -0
- package/dist/sessionRulesNamespaceFormsCapability.js +29 -0
- package/dist/sessionSyncFileHistoryCapability.js +2 -2
- package/dist/settingsCredentialKeyPaths.js +60 -5
- package/dist/settingsHooksSalvage.d.ts +1 -0
- package/dist/settingsHooksSalvage.js +7 -1
- package/dist/settingsLayerAdmission.d.ts +4 -0
- package/dist/settingsLayerAdmission.js +16 -0
- package/dist/skillToolListsCapability.js +6 -5
- package/dist/skillsWireCaps.d.ts +14 -0
- package/dist/skillsWireCaps.js +47 -16
- package/dist/slashCommandGate.d.ts +24 -0
- package/dist/slashCommandGate.js +74 -0
- package/dist/slashCommandTable.d.ts +14 -0
- package/dist/slashCommandTable.js +99 -0
- package/dist/sqlEngineCapability.js +2 -2
- package/dist/steerPriorityCapability.js +2 -2
- package/dist/storePostureCapability.js +2 -2
- package/dist/subagent/agentStateDetail.js +1 -1
- package/dist/subagent/engineDelegatedPrompt.d.ts +9 -0
- package/dist/subagent/engineDelegatedPrompt.js +38 -7
- package/dist/subagent/engineRowStopGate.js +2 -2
- package/dist/subagent/engineSubagentResume.js +3 -3
- package/dist/subagent/engineTaskHandleWire.d.ts +1 -0
- package/dist/subagent/engineTaskHandleWire.js +10 -0
- package/dist/submitFailure.d.ts +8 -0
- package/dist/submitFailure.js +17 -0
- package/dist/supportFloor.d.ts +1 -0
- package/dist/supportFloor.js +7 -0
- package/dist/terminationIntent.d.ts +55 -0
- package/dist/terminationIntent.js +352 -0
- package/dist/toolHistoryMismatch.d.ts +8 -0
- package/dist/toolHistoryMismatch.js +37 -6
- package/dist/toolResult.d.ts +13 -3
- package/dist/toolResult.js +158 -9
- package/dist/toolResultContent.d.ts +13 -0
- package/dist/toolResultContent.js +82 -7
- package/dist/toolRoster.d.ts +18 -0
- package/dist/toolRoster.js +64 -0
- package/dist/turnFailurePresentation.js +27 -90
- package/dist/usageLimitAutoResume.d.ts +74 -0
- package/dist/usageLimitAutoResume.js +227 -0
- package/dist/userAttachmentEnvelope.js +1 -1
- package/dist/userAttachmentSeat.js +5 -5
- package/dist/userInvokedSkillsCapability.js +2 -2
- package/dist/webSearchBackendCapability.js +2 -2
- package/dist/wireErrorTriage.js +99 -50
- package/dist/wireFailureShape.d.ts +25 -1
- package/dist/wireFailureShape.js +92 -5
- package/dist/wireRefusalCopy.d.ts +24 -1
- package/dist/wireRefusalCopy.js +253 -32
- package/dist/wiringFleetDoctor.d.ts +3 -0
- package/dist/wiringFleetDoctor.js +21 -0
- package/dist/workflow.d.ts +2 -1
- package/dist/workflow.js +38 -1
- package/dist/workflowClient.d.ts +2 -7
- package/dist/workflowsJournalCapability.js +2 -2
- package/dist/writeProtectionCapability.js +2 -2
- package/docs/INTEGRATION-CLIENTS.md +607 -181
- package/package.json +14 -3
|
@@ -1,5 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type DenyAttributionRefusalDetail } from '../wireRefusalCopy.js';
|
|
2
|
+
import { type AnswerCapture, type CapturedLocalCode, type CauseSlotRead, type TopCauseReading, type TopLocalCodeReading, type UnansweredCapture } from '../engineWireFor.js';
|
|
3
|
+
import { type RefusalCarrier, type SafetyStopHead } from './hitlBridge.js';
|
|
4
|
+
import type { SettledFailureReading, TransportClass, TransportReading } from './approvalDelivery.js';
|
|
5
|
+
export interface DeliveredReading {
|
|
6
|
+
readonly cls?: TransportClass;
|
|
7
|
+
readonly answered?: AnswerCapture;
|
|
8
|
+
readonly unanswered?: UnansweredCapture;
|
|
9
|
+
readonly carrierReads?: readonly {
|
|
10
|
+
readonly thrown: object;
|
|
11
|
+
readonly read: RefusalCarrier;
|
|
12
|
+
}[];
|
|
13
|
+
readonly topLocalCode?: TopLocalCodeReading;
|
|
14
|
+
readonly bindingMismatchWrapper?: true;
|
|
15
|
+
readonly topCause?: TopCauseReading;
|
|
16
|
+
readonly safetyStop?: true;
|
|
17
|
+
}
|
|
18
|
+
export declare function isLocalSafetyStop(read: RefusalCarrier, reading: DeliveredReading | 'carrier'): boolean;
|
|
19
|
+
export declare function topCauseReadOf(delivered: DeliveredReading | undefined, x: object): CauseSlotRead | undefined;
|
|
20
|
+
export declare function localCodeReadOf(delivered: DeliveredReading | undefined, x: object): {
|
|
21
|
+
readonly value: CapturedLocalCode;
|
|
22
|
+
} | undefined;
|
|
23
|
+
export declare function carrierReadOf(thrown: {} | null | undefined, delivered: DeliveredReading | undefined): RefusalCarrier;
|
|
24
|
+
export declare function attributionRefusalOfReading(thrown: {} | null | undefined, delivered: DeliveredReading | undefined, sentAttributionKey: boolean): DenyAttributionRefusalDetail | null;
|
|
25
|
+
export declare function attributionRefusalOf(read: RefusalCarrier, reading: DeliveredReading | 'carrier', sentAttributionKey: boolean): DenyAttributionRefusalDetail | null;
|
|
26
|
+
export interface LadderSafetyStop {
|
|
27
|
+
readonly thrown: object;
|
|
28
|
+
readonly head: SafetyStopHead;
|
|
29
|
+
readonly triaged: TransportReading;
|
|
30
|
+
readonly settled?: SettledFailureReading;
|
|
31
|
+
}
|
|
32
|
+
export type LadderReadingSource = {
|
|
33
|
+
readonly kind: 'delivered';
|
|
34
|
+
readonly readingOf: (thrown: {} | null | undefined) => DeliveredReading | undefined;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'direct';
|
|
37
|
+
readonly stopOf: (thrown: {} | null | undefined) => LadderSafetyStop | undefined;
|
|
38
|
+
};
|
|
39
|
+
export declare function shouldResendWithoutAttribution(refusal: DenyAttributionRefusalDetail | null, sentAttributionKey: boolean, signal?: AbortSignal): boolean;
|
|
40
|
+
export declare function shouldResendUnderSuccessorKey(refusal: DenyAttributionRefusalDetail | null, lastSendCarriedRetiredKey: boolean, signal?: AbortSignal): boolean;
|
|
3
41
|
export declare function carriesAttributionKey(body: object): boolean;
|
|
4
42
|
export declare function withoutAttributionKey<T extends {
|
|
5
43
|
settledBy?: unknown;
|
|
@@ -15,9 +53,10 @@ export interface AttributionLadderState {
|
|
|
15
53
|
lastCarried: boolean;
|
|
16
54
|
dropped: boolean;
|
|
17
55
|
renamed: boolean;
|
|
56
|
+
safetyStop?: LadderSafetyStop | undefined;
|
|
18
57
|
}
|
|
19
58
|
export type AttributionLadderStep = 'dropped' | 'renamed' | 'renamed_then_dropped';
|
|
20
59
|
export declare function deliverWithAttributionLadder<B extends {
|
|
21
60
|
settledBy?: unknown;
|
|
22
61
|
decidedBy?: unknown;
|
|
23
|
-
}, R>(body: B, send: (b: B) => Promise<R>, signal: AbortSignal | undefined, state: AttributionLadderState, onStep
|
|
62
|
+
}, R>(body: B, send: (b: B) => Promise<R>, signal: AbortSignal | undefined, state: AttributionLadderState, onStep: ((step: AttributionLadderStep) => void) | undefined, source: LadderReadingSource): Promise<R>;
|
|
@@ -1,17 +1,86 @@
|
|
|
1
1
|
import { denyAttributionRefusalFromError } from '../wireRefusalCopy.js';
|
|
2
|
-
|
|
2
|
+
import { ownReadingSlot } from '../engineWireFor.js';
|
|
3
|
+
import { guardedRead } from '../ownKey.js';
|
|
4
|
+
import { isSlotCarrier, readRefusalField } from '../wireFailureShape.js';
|
|
5
|
+
import { refusalCarrierOf } from './hitlBridge.js';
|
|
6
|
+
export function isLocalSafetyStop(read, reading) {
|
|
7
|
+
if (reading !== 'carrier' && ownReadingSlot(reading, 'safetyStop') === true)
|
|
8
|
+
return true;
|
|
9
|
+
return ownReadingSlot(read, 'local') !== undefined;
|
|
10
|
+
}
|
|
11
|
+
export function topCauseReadOf(delivered, x) {
|
|
12
|
+
const t = ownReadingSlot(delivered, 'topCause');
|
|
13
|
+
return t !== undefined && t.layer === x ? t.read : undefined;
|
|
14
|
+
}
|
|
15
|
+
export function localCodeReadOf(delivered, x) {
|
|
16
|
+
const a = ownReadingSlot(delivered, 'answered');
|
|
17
|
+
if (a !== undefined && a.layer === x)
|
|
18
|
+
return { value: a.localCode };
|
|
19
|
+
const u = ownReadingSlot(delivered, 'unanswered');
|
|
20
|
+
if (u !== undefined && u.layer === x)
|
|
21
|
+
return { value: u.localCode };
|
|
22
|
+
const t = ownReadingSlot(delivered, 'topLocalCode');
|
|
23
|
+
return t !== undefined && t.layer === x ? { value: t.localCode } : undefined;
|
|
24
|
+
}
|
|
25
|
+
function bindingMismatchWrapperOver(thrown, delivered) {
|
|
26
|
+
return ownReadingSlot(delivered, 'bindingMismatchWrapper') === true && ownReadingSlot(delivered, 'answered')?.layer === thrown;
|
|
27
|
+
}
|
|
28
|
+
export function carrierReadOf(thrown, delivered) {
|
|
29
|
+
const read = recordedCarrierReadOf(thrown, delivered);
|
|
30
|
+
if (!bindingMismatchWrapperOver(thrown, delivered) || ownReadingSlot(read, 'local') === 'binding_mismatch')
|
|
31
|
+
return read;
|
|
32
|
+
return Object.freeze({ carrier: read.carrier, local: 'binding_mismatch' });
|
|
33
|
+
}
|
|
34
|
+
function recordedCarrierReadOf(thrown, delivered) {
|
|
35
|
+
const list = ownReadingSlot(delivered, 'carrierReads');
|
|
36
|
+
if (list !== undefined) {
|
|
37
|
+
for (let i = 0; i < list.length; i++) {
|
|
38
|
+
const c = list[i];
|
|
39
|
+
if (c !== undefined && c.thrown === thrown)
|
|
40
|
+
return c.read;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return isSlotCarrier(thrown) ? refusalCarrierOf(thrown, localCodeReadOf(delivered, thrown), false, topCauseReadOf(delivered, thrown)) : refusalCarrierOf(thrown);
|
|
44
|
+
}
|
|
45
|
+
export function attributionRefusalOfReading(thrown, delivered, sentAttributionKey) {
|
|
46
|
+
if (delivered === undefined)
|
|
47
|
+
return null;
|
|
48
|
+
return attributionRefusalOf(carrierReadOf(thrown, delivered), delivered, sentAttributionKey);
|
|
49
|
+
}
|
|
50
|
+
export function attributionRefusalOf(read, reading, sentAttributionKey) {
|
|
51
|
+
if (isLocalSafetyStop(read, reading))
|
|
52
|
+
return null;
|
|
53
|
+
if (reading === 'carrier')
|
|
54
|
+
return denyAttributionRefusalFromError(read.carrier, sentAttributionKey);
|
|
55
|
+
const delivered = reading;
|
|
56
|
+
const a = ownReadingSlot(delivered, 'answered');
|
|
57
|
+
if (a === undefined || a.layer !== read.carrier || a.code.state !== 'read' || a.code.wire === undefined)
|
|
58
|
+
return null;
|
|
59
|
+
const field = guardedRead(() => readRefusalField(a.layer));
|
|
60
|
+
return denyAttributionRefusalFromError(Object.freeze({ status: a.status, errorCode: a.code.wire, ...(field !== undefined ? { field } : {}) }), sentAttributionKey);
|
|
61
|
+
}
|
|
62
|
+
function ladderRefusalOf(thrown, source, state) {
|
|
63
|
+
if (source.kind === 'delivered')
|
|
64
|
+
return attributionRefusalOfReading(thrown, source.readingOf(thrown), true);
|
|
65
|
+
const stop = source.stopOf(thrown);
|
|
66
|
+
if (stop === undefined)
|
|
67
|
+
return attributionRefusalOf({ carrier: thrown }, 'carrier', true);
|
|
68
|
+
state.safetyStop = stop;
|
|
69
|
+
return attributionRefusalOf(stop.head.local !== undefined ? { carrier: thrown, local: stop.head.local } : { carrier: thrown }, stop.triaged, true);
|
|
70
|
+
}
|
|
71
|
+
export function shouldResendWithoutAttribution(refusal, sentAttributionKey, signal) {
|
|
3
72
|
if (!sentAttributionKey)
|
|
4
73
|
return false;
|
|
5
74
|
if (signal?.aborted === true)
|
|
6
75
|
return false;
|
|
7
|
-
return
|
|
76
|
+
return refusal?.kind === 'not_in_proof';
|
|
8
77
|
}
|
|
9
|
-
export function shouldResendUnderSuccessorKey(
|
|
78
|
+
export function shouldResendUnderSuccessorKey(refusal, lastSendCarriedRetiredKey, signal) {
|
|
10
79
|
if (!lastSendCarriedRetiredKey)
|
|
11
80
|
return false;
|
|
12
81
|
if (signal?.aborted === true)
|
|
13
82
|
return false;
|
|
14
|
-
return
|
|
83
|
+
return refusal?.kind === 'retired_key';
|
|
15
84
|
}
|
|
16
85
|
export function carriesAttributionKey(body) {
|
|
17
86
|
return Object.hasOwn(body, 'settledBy') || Object.hasOwn(body, 'decidedBy');
|
|
@@ -27,15 +96,17 @@ export function withAttributionKeyRenamed(body) {
|
|
|
27
96
|
void _replaced;
|
|
28
97
|
return settledBy === undefined ? rest : { ...rest, decidedBy: settledBy };
|
|
29
98
|
}
|
|
30
|
-
export async function deliverWithAttributionLadder(body, send, signal, state, onStep) {
|
|
99
|
+
export async function deliverWithAttributionLadder(body, send, signal, state, onStep, source) {
|
|
31
100
|
state.lastCarried = carriesAttributionKey(body);
|
|
32
101
|
state.dropped = false;
|
|
33
102
|
state.renamed = false;
|
|
103
|
+
state.safetyStop = undefined;
|
|
34
104
|
try {
|
|
35
105
|
return await send(body);
|
|
36
106
|
}
|
|
37
107
|
catch (first) {
|
|
38
|
-
|
|
108
|
+
const firstRefusal = ladderRefusalOf(first, source, state);
|
|
109
|
+
if (shouldResendWithoutAttribution(firstRefusal, state.lastCarried, signal)) {
|
|
39
110
|
const withoutAttribution = withoutAttributionKey(body);
|
|
40
111
|
state.lastCarried = false;
|
|
41
112
|
onStep?.('dropped');
|
|
@@ -43,7 +114,7 @@ export async function deliverWithAttributionLadder(body, send, signal, state, on
|
|
|
43
114
|
state.dropped = true;
|
|
44
115
|
return r;
|
|
45
116
|
}
|
|
46
|
-
if (shouldResendUnderSuccessorKey(
|
|
117
|
+
if (shouldResendUnderSuccessorKey(firstRefusal, Object.hasOwn(body, 'settledBy'), signal)) {
|
|
47
118
|
const renamed = withAttributionKeyRenamed(body);
|
|
48
119
|
onStep?.('renamed');
|
|
49
120
|
try {
|
|
@@ -52,7 +123,7 @@ export async function deliverWithAttributionLadder(body, send, signal, state, on
|
|
|
52
123
|
return r;
|
|
53
124
|
}
|
|
54
125
|
catch (second) {
|
|
55
|
-
if (!shouldResendWithoutAttribution(second, true, signal))
|
|
126
|
+
if (!shouldResendWithoutAttribution(ladderRefusalOf(second, source, state), true, signal))
|
|
56
127
|
throw second;
|
|
57
128
|
const renamedWithoutAttribution = withoutAttributionKey(renamed);
|
|
58
129
|
state.lastCarried = false;
|
|
@@ -20,9 +20,14 @@ export type AutomaticAnswerVerdict = {
|
|
|
20
20
|
readonly kind: 'unknown';
|
|
21
21
|
readonly why: AutomaticAnswerUnknownWhy;
|
|
22
22
|
};
|
|
23
|
-
export declare const MODE_ARBITRATION: Readonly<Record<"hook" | "write_protection" | "mode" | "target_unresolved" | "content_question" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "operator_forced" | "shell_floor" | "probe" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
|
|
23
|
+
export declare const MODE_ARBITRATION: Readonly<Record<"hook" | "write_protection" | "mode" | "target_unresolved" | "content_question" | "ancestor" | "dangerous_delete" | "unverifiable_delete" | "unverifiable_shell_text" | "transcript_write" | "org_rule" | "rule_unreadable" | "ask_rule" | "denial_limit_fallback" | "classifier_no_ruling" | "requires_user_interaction" | "cross_boundary" | "operator_forced" | "shell_floor" | "probe" | "tool_marks_mcp" | "tool_marks_a2a" | "policy_rra" | "artifact_shared_read" | "unstated" | "ordinary", CoreModeArbitrationRow>>;
|
|
24
24
|
export declare function foldModeArbitrationRow(classes: Iterable<string>, askFace?: AutomaticAnswerAskFace): CoreModeArbitrationRow;
|
|
25
25
|
export declare function automaticAnswerVerdict(card: object | null | undefined, lane: AutomaticAnswerLane, facts?: AutomaticAnswerFacts | null): AutomaticAnswerVerdict;
|
|
26
26
|
export declare function mandatedApprovalDetailOf(card: object | null | undefined, lang?: UiLanguage): string;
|
|
27
|
+
export interface CrossBoundaryTaintReading {
|
|
28
|
+
readonly taint: true;
|
|
29
|
+
}
|
|
30
|
+
export declare function crossBoundaryTaintOf(carrier: object | null | undefined): CrossBoundaryTaintReading | undefined;
|
|
31
|
+
export declare function crossBoundaryTaintWayOutOf(carrier: object | null | undefined, lang?: UiLanguage): string | undefined;
|
|
27
32
|
export type PermissionRequestHookScope = 'allow_or_deny' | 'deny_only' | 'skip';
|
|
28
33
|
export declare function permissionRequestHookScope(verdict: AutomaticAnswerVerdict | null | undefined): PermissionRequestHookScope;
|
|
@@ -2,7 +2,7 @@ import { CORE_MODE_ARBITRATION, CORE_MODE_RELEASE_REASONS } from '../generated/e
|
|
|
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
4
|
import { msg, renderMessage } from '../i18n/translate.js';
|
|
5
|
-
import { readAskOrigin, readOwnNonEmptyString } from '../ownKey.js';
|
|
5
|
+
import { guardedRead, readAskOrigin, readOwnDataValue, readOwnNonEmptyString } from '../ownKey.js';
|
|
6
6
|
import { readAskClassPairState } from './askClassPair.js';
|
|
7
7
|
import { readRequiresRealApproval } from './approvalCardReading.js';
|
|
8
8
|
import { approvalAllowRuleShadowed, retiredAllowRuleShadowKeyPresent } from './allowRuleShadow.js';
|
|
@@ -31,7 +31,7 @@ function bypassImmuneOn(c, face) {
|
|
|
31
31
|
function askFaceOfCard(card) {
|
|
32
32
|
try {
|
|
33
33
|
const d = Object.getOwnPropertyDescriptor(card, 'toolName');
|
|
34
|
-
return d !== undefined && 'value'
|
|
34
|
+
return d !== undefined && Object.hasOwn(d, 'value') && typeof d.value === 'string' && CORE_SHELL_FACE_TOOL_NAMES.includes(d.value) ? 'shell' : 'other';
|
|
35
35
|
}
|
|
36
36
|
catch {
|
|
37
37
|
return 'other';
|
|
@@ -61,11 +61,11 @@ export function foldModeArbitrationRow(classes, askFace) {
|
|
|
61
61
|
return Object.freeze({ bypassImmune, classifierEligible, sandboxAdmission, ruleMayClear, hookAskFloor });
|
|
62
62
|
}
|
|
63
63
|
function rowBlocks(lane, row) {
|
|
64
|
-
return lane === 'mode_posture' ? row.bypassImmune :
|
|
64
|
+
return lane === 'mode_posture' ? row.bypassImmune : !row.ruleMayClear;
|
|
65
65
|
}
|
|
66
66
|
function classBlocks(lane, c, face) {
|
|
67
67
|
const row = TABLE[c];
|
|
68
|
-
return lane === 'mode_posture' ? bypassImmuneOn(c, face) :
|
|
68
|
+
return lane === 'mode_posture' ? bypassImmuneOn(c, face) : !row.ruleMayClear;
|
|
69
69
|
}
|
|
70
70
|
function mustAsk(road, extra) {
|
|
71
71
|
return Object.freeze({ kind: 'must_ask', road, ...(extra?.askClass !== undefined ? { askClass: extra.askClass } : {}), ...(extra?.origin !== undefined ? { origin: extra.origin } : {}) });
|
|
@@ -91,13 +91,8 @@ function evidenceView(card, ...keys) {
|
|
|
91
91
|
function readHostAskRuleMatched(facts) {
|
|
92
92
|
if (typeof facts !== 'object' || facts === null)
|
|
93
93
|
return undefined;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return d !== undefined && 'value' in d && typeof d.value === 'boolean' ? d.value : undefined;
|
|
97
|
-
}
|
|
98
|
-
catch {
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
94
|
+
const v = guardedRead(() => readOwnDataValue(facts, 'settingsAskRuleMatched'));
|
|
95
|
+
return typeof v === 'boolean' ? v : undefined;
|
|
101
96
|
}
|
|
102
97
|
export function automaticAnswerVerdict(card, lane, facts) {
|
|
103
98
|
if (lane !== 'mode_posture' && lane !== 'standing_rule' && lane !== 'permission_request_hook')
|
|
@@ -199,6 +194,46 @@ export function mandatedApprovalDetailOf(card, lang) {
|
|
|
199
194
|
return mandatedApprovalDetail(lang);
|
|
200
195
|
}
|
|
201
196
|
}
|
|
197
|
+
const CROSS_BOUNDARY_CLASS = 'cross_boundary';
|
|
198
|
+
const CROSS_BOUNDARY_MANDATE = 'cross_boundary_taint';
|
|
199
|
+
const TAINTED = Object.freeze({ taint: true });
|
|
200
|
+
function snapshotOf(carrier) {
|
|
201
|
+
const out = {};
|
|
202
|
+
for (const key of ['mandate', 'askClass', 'classes']) {
|
|
203
|
+
const v = guardedRead(() => readOwnDataValue(carrier, key));
|
|
204
|
+
if (v !== undefined)
|
|
205
|
+
out[key] = v;
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
}
|
|
209
|
+
function classEvidence(carrier) {
|
|
210
|
+
try {
|
|
211
|
+
const pair = readAskClassPairState(carrier);
|
|
212
|
+
return pair.state === 'pair' && pair.classes.includes(CROSS_BOUNDARY_CLASS) ? true : undefined;
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
return undefined;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function mandateEvidence(carrier) {
|
|
219
|
+
return readApprovalMandate(carrier) === CROSS_BOUNDARY_MANDATE ? true : undefined;
|
|
220
|
+
}
|
|
221
|
+
export function crossBoundaryTaintOf(carrier) {
|
|
222
|
+
if (typeof carrier !== 'object' || carrier === null)
|
|
223
|
+
return undefined;
|
|
224
|
+
const snapshot = snapshotOf(carrier);
|
|
225
|
+
return classEvidence(snapshot) === true || mandateEvidence(snapshot) === true ? TAINTED : undefined;
|
|
226
|
+
}
|
|
227
|
+
export function crossBoundaryTaintWayOutOf(carrier, lang) {
|
|
228
|
+
try {
|
|
229
|
+
if (crossBoundaryTaintOf(carrier) === undefined)
|
|
230
|
+
return undefined;
|
|
231
|
+
return renderMessage(msg('approval.mandate.wayOut.crossBoundaryTaint'), lang);
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
202
237
|
export function permissionRequestHookScope(verdict) {
|
|
203
238
|
try {
|
|
204
239
|
const kind = typeof verdict === 'object' && verdict !== null ? verdict.kind : undefined;
|
|
@@ -10,7 +10,7 @@ const isNumber = (v) => typeof v === 'number';
|
|
|
10
10
|
const nonEmptyString = (v) => typeof v === 'string' && v.length > 0;
|
|
11
11
|
const ownDataValue = (obj, key) => {
|
|
12
12
|
const d = Object.getOwnPropertyDescriptor(obj, key);
|
|
13
|
-
if (d === undefined || 'get'
|
|
13
|
+
if (d === undefined || Object.hasOwn(d, 'get') || Object.hasOwn(d, 'set'))
|
|
14
14
|
return undefined;
|
|
15
15
|
return d.value;
|
|
16
16
|
};
|
|
@@ -30,7 +30,7 @@ function readCrashConvergedRow(v) {
|
|
|
30
30
|
const d = descs[k];
|
|
31
31
|
if (d === undefined || d.enumerable !== true)
|
|
32
32
|
continue;
|
|
33
|
-
if ('get'
|
|
33
|
+
if (Object.hasOwn(d, 'get') || Object.hasOwn(d, 'set')) {
|
|
34
34
|
unstable = true;
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { UiLanguage } from '../env/uiLanguage.js';
|
|
2
|
+
import type { CapturedCode } from '../engineWireFor.js';
|
|
3
|
+
import { type ProtocolErrorNameReading } from '../wireFailureShape.js';
|
|
4
|
+
export type DecisionRefusalConflict = 'binding_mismatch' | 'row_integrity' | 'format_version' | 'answer_invalid' | 'grant_changed';
|
|
5
|
+
export declare function decisionConflictOf(err: unknown, captured?: CapturedCode, protocolNameRead?: ProtocolErrorNameReading): DecisionRefusalConflict | undefined;
|
|
3
6
|
export declare const DECISION_ANSWER_INVALID_CONTENT = "The engine rejected the answer itself because it does not fit the question that was asked \u00B7 Nothing was decided and the question is still waiting \u00B7 Correct the answer and send it again";
|
|
7
|
+
export declare function decisionGrantChangedContent(lang?: UiLanguage): string;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { APPROVAL_BINDING_MISMATCH, CHECKPOINT_UNSUPPORTED_VERSION, RESUME_OUTCOME_INVALID } from '../engineErrorCodes.js';
|
|
2
|
+
import { msg, renderMessage } from '../i18n/translate.js';
|
|
2
3
|
import { ownDataField } from '../ownKey.js';
|
|
3
|
-
import { PROTOCOL_ERROR_NAME, protocolErrorNameOf, readRefusalField } from '../wireFailureShape.js';
|
|
4
|
+
import { isSlotCarrier, PROTOCOL_ERROR_NAME, protocolErrorNameOf, readRefusalField } from '../wireFailureShape.js';
|
|
4
5
|
const BINDING_SEAT_FIELDS = new Set(['boundCallId', 'boundInputHash']);
|
|
5
6
|
const ANSWER_FIELD = 'answer';
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const GRANT_DIGEST_FIELD = 'boundGrantDigest';
|
|
8
|
+
function namedProtocolOf(r) {
|
|
9
|
+
return r.state === 'named' ? r.name : undefined;
|
|
10
|
+
}
|
|
11
|
+
export function decisionConflictOf(err, captured, protocolNameRead) {
|
|
12
|
+
if (!isSlotCarrier(err))
|
|
8
13
|
return undefined;
|
|
9
14
|
let code;
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
if (captured !== undefined) {
|
|
16
|
+
if (captured.state !== 'read')
|
|
17
|
+
return undefined;
|
|
18
|
+
code = captured.wire;
|
|
12
19
|
}
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
else {
|
|
21
|
+
try {
|
|
22
|
+
code = ownDataField(err, 'errorCode');
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
15
27
|
}
|
|
16
|
-
const protocolName = protocolErrorNameOf(err);
|
|
28
|
+
const protocolName = protocolNameRead !== undefined ? namedProtocolOf(protocolNameRead) : protocolErrorNameOf(err);
|
|
17
29
|
if (code === CHECKPOINT_UNSUPPORTED_VERSION)
|
|
18
30
|
return 'format_version';
|
|
19
31
|
const bindingFamily = code === APPROVAL_BINDING_MISMATCH || (code === undefined && protocolName === PROTOCOL_ERROR_NAME.ApprovalBindingMismatchError);
|
|
@@ -27,9 +39,12 @@ export function decisionConflictOf(err) {
|
|
|
27
39
|
field = undefined;
|
|
28
40
|
}
|
|
29
41
|
if (code === RESUME_OUTCOME_INVALID)
|
|
30
|
-
return field === ANSWER_FIELD ? 'answer_invalid' : undefined;
|
|
42
|
+
return field === ANSWER_FIELD ? 'answer_invalid' : field === GRANT_DIGEST_FIELD ? 'grant_changed' : undefined;
|
|
31
43
|
if (field === undefined)
|
|
32
44
|
return 'row_integrity';
|
|
33
45
|
return BINDING_SEAT_FIELDS.has(field) ? 'binding_mismatch' : undefined;
|
|
34
46
|
}
|
|
35
47
|
export const DECISION_ANSWER_INVALID_CONTENT = 'The engine rejected the answer itself because it does not fit the question that was asked · Nothing was decided and the question is still waiting · Correct the answer and send it again';
|
|
48
|
+
export function decisionGrantChangedContent(lang) {
|
|
49
|
+
return renderMessage(msg('approval.decision.grantChanged'), lang);
|
|
50
|
+
}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type UiLanguage } from '../env/uiLanguage.js';
|
|
2
|
+
import { type GateCurrentPending, type RefusalCarrier } from './hitlBridge.js';
|
|
2
3
|
import { type DecisionRefusalConflict } from './decisionConflict.js';
|
|
3
|
-
import { type ProtocolErrorName } from '../wireFailureShape.js';
|
|
4
|
-
import {
|
|
4
|
+
import { type ProtocolErrorName, type ProtocolErrorNameReading } from '../wireFailureShape.js';
|
|
5
|
+
import type { DenyAttributionRefusalDetail } from '../wireRefusalCopy.js';
|
|
6
|
+
import { type DeliveredReading } from './attributionLadder.js';
|
|
7
|
+
import { type AnswerCapture, type UnansweredCapture } from '../engineWireFor.js';
|
|
5
8
|
export declare const ASK_DECIDED_CODE = "conflict.ask_decided";
|
|
6
9
|
export type DecisionRefusalStanding = 'settled-elsewhere' | 'ambiguous' | 'refused-pending';
|
|
7
10
|
export type { DecisionRefusalConflict } from './decisionConflict.js';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
export { refusalCarrierOf, type RefusalCarrier } from './hitlBridge.js';
|
|
12
|
+
declare const DELIVERED_UNREADABLE: unique symbol;
|
|
13
|
+
type DeliveredAnswer = AnswerCapture | UnansweredCapture | typeof DELIVERED_UNREADABLE;
|
|
14
|
+
interface CarrierRead extends RefusalCarrier {
|
|
15
|
+
readonly protocolName: ProtocolErrorNameReading;
|
|
11
16
|
}
|
|
12
|
-
export declare function refusalCarrierOf(err: {} | null | undefined): RefusalCarrier;
|
|
13
17
|
export interface RefusalRouteContext {
|
|
14
18
|
readonly route?: 'approval_decide' | 'live_respond' | 'ask_decide' | 'plan_review' | 'compact';
|
|
19
|
+
readonly afterRetry?: true;
|
|
15
20
|
}
|
|
21
|
+
export declare function notPendingAfterRetry(status: number | undefined, retried: boolean): boolean;
|
|
16
22
|
export interface RefusalDelivery {
|
|
17
23
|
readonly delivery: 'refused' | 'ambiguous' | 'no_answer';
|
|
18
24
|
readonly status?: number;
|
|
19
25
|
readonly errorCode?: string;
|
|
20
26
|
}
|
|
21
|
-
export declare function refusalDeliveryOf(err: {} | null | undefined, context?: RefusalRouteContext): RefusalDelivery;
|
|
27
|
+
export declare function refusalDeliveryOf(err: {} | null | undefined, context?: RefusalRouteContext, answer?: DeliveredAnswer, read?: RefusalCarrier): RefusalDelivery;
|
|
22
28
|
export declare function decisionRefusalSaysAskGone(err: unknown): boolean;
|
|
23
29
|
export type DecisionRefusalAskReading = 'settled' | 'not_settled' | 'unreadable';
|
|
24
30
|
interface DecisionRefusalAskFacts {
|
|
@@ -26,7 +32,7 @@ interface DecisionRefusalAskFacts {
|
|
|
26
32
|
readonly gateMoved: boolean;
|
|
27
33
|
readonly wordingHint: boolean;
|
|
28
34
|
}
|
|
29
|
-
export declare function readDecisionRefusalAsk(failure: unknown): DecisionRefusalAskFacts;
|
|
35
|
+
export declare function readDecisionRefusalAsk(failure: unknown, answer?: DeliveredAnswer, read?: CarrierRead): DecisionRefusalAskFacts;
|
|
30
36
|
export declare function decisionRefusalAskReading(failure: unknown): DecisionRefusalAskReading;
|
|
31
37
|
export interface DecisionRefusalReading {
|
|
32
38
|
readonly status?: number;
|
|
@@ -47,8 +53,9 @@ export interface DecisionRefusalReading {
|
|
|
47
53
|
readonly standing?: DecisionRefusalStanding;
|
|
48
54
|
readonly transient?: true;
|
|
49
55
|
readonly conflict?: DecisionRefusalConflict;
|
|
56
|
+
readonly unrecoverable?: true;
|
|
50
57
|
}
|
|
51
|
-
export declare function mintDecisionRefusalReading(err: {} | null | undefined, context?: RefusalRouteContext, attributionCarried?: boolean): DecisionRefusalReading;
|
|
58
|
+
export declare function mintDecisionRefusalReading(err: {} | null | undefined, context?: RefusalRouteContext, attributionCarried?: boolean, delivered?: DeliveredReading, carried?: RefusalCarrier): DecisionRefusalReading;
|
|
52
59
|
export declare function readDecisionRefusalReading(err: {} | null | undefined, context?: RefusalRouteContext): DecisionRefusalReading;
|
|
53
60
|
export interface DecisionRefusalClassified {
|
|
54
61
|
readonly standing: DecisionRefusalStanding;
|
|
@@ -56,8 +63,10 @@ export interface DecisionRefusalClassified {
|
|
|
56
63
|
readonly errorCode?: string;
|
|
57
64
|
readonly transient?: true;
|
|
58
65
|
readonly conflict?: DecisionRefusalConflict;
|
|
66
|
+
readonly unrecoverable?: true;
|
|
59
67
|
}
|
|
60
68
|
export declare function classifyDecisionRefusal(err: unknown, context?: RefusalRouteContext): DecisionRefusalClassified | undefined;
|
|
69
|
+
export declare function classifyDeliveredDecisionRefusal(err: {} | null | undefined, delivered: DeliveredReading): DecisionRefusalClassified | undefined;
|
|
61
70
|
export type LiveAskPendingReading = 'pending' | 'not_pending' | 'unknown';
|
|
62
71
|
export declare function liveAskPendingReading(envelope: unknown, approvalId: string): LiveAskPendingReading;
|
|
63
72
|
export declare function decisionRefusalClosesOut(refusal: DecisionRefusalClassified | undefined, pending: LiveAskPendingReading): boolean;
|
|
@@ -69,3 +78,4 @@ export interface UndeliverableDecisionFacts {
|
|
|
69
78
|
readonly runId?: string;
|
|
70
79
|
}
|
|
71
80
|
export declare function undeliverableDecisionContent(facts: UndeliverableDecisionFacts): string;
|
|
81
|
+
export declare function decideRowUnrevivableNotice(lang?: UiLanguage | (string & {})): string;
|