@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,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { type PermissionsKeptReason } from '../permissionsDeclaration.js';
|
|
2
|
+
import type { PermissionsAllowGrantReading } from '../permissionsAllowGrantCapability.js';
|
|
3
|
+
export type StandingRowWhy = 'given' | 'card_unreadable' | 'remember_refused' | 'remember_unreadable' | 'route_cannot_carry' | 'classes_unreadable' | 'not_deployment_list_question' | 'evidence_unreadable' | 'offers_unreadable' | 'engine_lane_closed' | 'args_unavailable' | 'grant_binding' | 'tool_name_unreadable' | 'rule_cannot_clear' | 'host_fact_missing' | 'card_face_absent' | 'face_not_generic' | 'rule_not_sent';
|
|
2
4
|
export type StandingPersistentRow = 'engine_offer' | 'local_whole_tool' | 'none';
|
|
3
5
|
export interface StandingRowsWhy {
|
|
4
6
|
readonly session: StandingRowWhy;
|
|
@@ -12,8 +14,24 @@ export interface StandingRows {
|
|
|
12
14
|
readonly why: StandingRowsWhy;
|
|
13
15
|
}
|
|
14
16
|
export interface StandingRowsHostFacts {
|
|
15
|
-
readonly cardFace?: string;
|
|
16
17
|
readonly wholeToolRuleSent?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare function standingRowsOf(card: object | null | undefined, host?: StandingRowsHostFacts | null): StandingRows;
|
|
19
20
|
export declare function seatSessionRowOf(card: object | null | undefined, requestId: string | undefined): boolean;
|
|
21
|
+
export type RememberOffer = 'offerable' | 'refused' | 'unknown';
|
|
22
|
+
export interface RememberOfferable {
|
|
23
|
+
readonly session: RememberOffer;
|
|
24
|
+
readonly persistentRule: RememberOffer;
|
|
25
|
+
readonly deploymentList: RememberOffer;
|
|
26
|
+
}
|
|
27
|
+
export declare function rememberOfferable(card: object | null | undefined, host?: StandingRowsHostFacts | null): RememberOfferable;
|
|
28
|
+
export interface LocalAllowRuleHostFacts {
|
|
29
|
+
readonly hostLadderEnforces?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface LocalAllowRuleEnforcement {
|
|
32
|
+
readonly enforceable: boolean;
|
|
33
|
+
readonly by?: 'host_ladder' | 'engine_grant';
|
|
34
|
+
readonly engine: 'sent' | 'kept' | 'unreadable';
|
|
35
|
+
readonly keptReason?: PermissionsKeptReason;
|
|
36
|
+
}
|
|
37
|
+
export declare function localAllowRuleEnforceable(rule: string, caps: PermissionsAllowGrantReading, host?: LocalAllowRuleHostFacts | null): LocalAllowRuleEnforcement;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { readAskClassPairState } from './askClassPair.js';
|
|
1
|
+
import { DEPLOYMENT_LIST_ASK_CLASSES, readAskClassPairState } from './askClassPair.js';
|
|
2
2
|
import { automaticAnswerVerdict } from './automaticAnswerVerdict.js';
|
|
3
|
-
import { readRuleOffers } from './toolApprovalWire.js';
|
|
3
|
+
import { readApprovalCardWord, readRuleOffers } from './toolApprovalWire.js';
|
|
4
|
+
import { CORE_SKILL_TOOL_NAME } from '../generated/toolNameTables.js';
|
|
4
5
|
import { toolPermissionRequestIdDomain } from '../seatContract.js';
|
|
5
|
-
|
|
6
|
+
import { permissionsDeclarationReport } from '../permissionsDeclaration.js';
|
|
6
7
|
const UNREADABLE = Symbol('unreadable');
|
|
7
8
|
function ownData(v, key) {
|
|
8
9
|
try {
|
|
@@ -65,15 +66,17 @@ function persistentRowOf(card, host, evidenceUnreadable) {
|
|
|
65
66
|
const tool = ownData(card, 'toolName');
|
|
66
67
|
if (typeof tool !== 'string' || tool.length === 0)
|
|
67
68
|
return { row: 'none', why: 'tool_name_unreadable' };
|
|
69
|
+
if (tool === CORE_SKILL_TOOL_NAME)
|
|
70
|
+
return { row: 'none', why: 'grant_binding' };
|
|
68
71
|
if (automaticAnswerVerdict(card, 'standing_rule').kind !== 'may_answer')
|
|
69
72
|
return { row: 'none', why: 'rule_cannot_clear' };
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (typeof face !== 'string')
|
|
74
|
-
return { row: 'none', why: 'host_fact_missing' };
|
|
73
|
+
const face = readApprovalCardWord(card);
|
|
74
|
+
if (face === undefined)
|
|
75
|
+
return { row: 'none', why: 'card_face_absent' };
|
|
75
76
|
if (face !== 'generic')
|
|
76
77
|
return { row: 'none', why: 'face_not_generic' };
|
|
78
|
+
if (typeof host !== 'object' || host === null)
|
|
79
|
+
return { row: 'none', why: 'host_fact_missing' };
|
|
77
80
|
const sent = ownData(host, 'wholeToolRuleSent');
|
|
78
81
|
if (typeof sent !== 'boolean')
|
|
79
82
|
return { row: 'none', why: 'host_fact_missing' };
|
|
@@ -146,3 +149,61 @@ export function seatSessionRowOf(card, requestId) {
|
|
|
146
149
|
return false;
|
|
147
150
|
}
|
|
148
151
|
}
|
|
152
|
+
const SESSION_OFFER = Object.freeze({
|
|
153
|
+
given: 'offerable',
|
|
154
|
+
card_unreadable: 'unknown',
|
|
155
|
+
remember_refused: 'refused',
|
|
156
|
+
remember_unreadable: 'unknown',
|
|
157
|
+
route_cannot_carry: 'refused',
|
|
158
|
+
classes_unreadable: 'unknown',
|
|
159
|
+
not_deployment_list_question: 'refused',
|
|
160
|
+
evidence_unreadable: 'unknown',
|
|
161
|
+
offers_unreadable: 'unknown',
|
|
162
|
+
engine_lane_closed: 'refused',
|
|
163
|
+
args_unavailable: 'refused',
|
|
164
|
+
grant_binding: 'refused',
|
|
165
|
+
tool_name_unreadable: 'unknown',
|
|
166
|
+
rule_cannot_clear: 'refused',
|
|
167
|
+
host_fact_missing: 'unknown',
|
|
168
|
+
card_face_absent: 'unknown',
|
|
169
|
+
face_not_generic: 'refused',
|
|
170
|
+
rule_not_sent: 'refused',
|
|
171
|
+
});
|
|
172
|
+
const PERSISTENT_OFFER = Object.freeze({ ...SESSION_OFFER, remember_refused: 'unknown' });
|
|
173
|
+
export function rememberOfferable(card, host) {
|
|
174
|
+
const rows = standingRowsOf(card, host);
|
|
175
|
+
return Object.freeze({
|
|
176
|
+
session: SESSION_OFFER[rows.why.session],
|
|
177
|
+
persistentRule: PERSISTENT_OFFER[rows.why.persistent],
|
|
178
|
+
deploymentList: SESSION_OFFER[rows.why.deploymentList],
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
export function localAllowRuleEnforceable(rule, caps, host) {
|
|
182
|
+
const ladder = typeof host === 'object' && host !== null && ownData(host, 'hostLadderEnforces') === true;
|
|
183
|
+
let engine = 'unreadable';
|
|
184
|
+
let keptReason;
|
|
185
|
+
if (typeof rule === 'string' && rule.trim() !== '') {
|
|
186
|
+
try {
|
|
187
|
+
const report = permissionsDeclarationReport({ deny: [], ask: [], allow: [rule], settingsRead: 'clean' }, caps);
|
|
188
|
+
const kept = report.kept.find((k) => k.bucket === 'allow' && k.rule === rule);
|
|
189
|
+
if (kept !== undefined) {
|
|
190
|
+
engine = 'kept';
|
|
191
|
+
keptReason = kept.reason;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
const sentAs = report.rewritten.find((r) => r.bucket === 'allow' && r.from === rule)?.to ?? rule;
|
|
195
|
+
engine = report.permissions?.allow?.includes(sentAs) === true ? 'sent' : 'unreadable';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
engine = 'unreadable';
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const by = ladder ? 'host_ladder' : engine === 'sent' ? 'engine_grant' : undefined;
|
|
203
|
+
return Object.freeze({
|
|
204
|
+
enforceable: by !== undefined,
|
|
205
|
+
...(by !== undefined ? { by } : {}),
|
|
206
|
+
engine,
|
|
207
|
+
...(keptReason !== undefined ? { keptReason } : {}),
|
|
208
|
+
});
|
|
209
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UiLanguage } from '../env/uiLanguage.js';
|
|
1
2
|
export type SuspendedReopenReading = {
|
|
2
3
|
readonly kind: 'reopened';
|
|
3
4
|
readonly code: string;
|
|
@@ -13,4 +14,4 @@ export interface ResumeReopenDetail {
|
|
|
13
14
|
retriable: true;
|
|
14
15
|
}
|
|
15
16
|
export declare function resumeReopenFromError(err: unknown): ResumeReopenDetail | null;
|
|
16
|
-
export declare function resumeReopenContent(detail: ResumeReopenDetail): string;
|
|
17
|
+
export declare function resumeReopenContent(detail: ResumeReopenDetail, lang?: UiLanguage): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RESUME_REOPEN_CODES, RESUME_ENV_FAILED, RESUME_TOOL_UNAVAILABLE, refusalSaysStillPending } from '../engineErrorCodes.js';
|
|
2
|
+
import { msg, renderMessage } from '../i18n/translate.js';
|
|
2
3
|
import { guardedRead, ownDataField } from '../ownKey.js';
|
|
3
4
|
const UNSTATED = Object.freeze({ kind: 'unstated' });
|
|
4
5
|
const NOT_REOPENED = Object.freeze({ kind: 'not_reopened' });
|
|
@@ -31,15 +32,11 @@ export function resumeReopenFromError(err) {
|
|
|
31
32
|
const reason = code.slice('resume.'.length);
|
|
32
33
|
return { code, reason, retriable: true };
|
|
33
34
|
}
|
|
34
|
-
export function resumeReopenContent(detail) {
|
|
35
|
-
const first = detail.code === RESUME_ENV_FAILED
|
|
36
|
-
? '
|
|
35
|
+
export function resumeReopenContent(detail, lang) {
|
|
36
|
+
const first = msg(detail.code === RESUME_ENV_FAILED
|
|
37
|
+
? 'resume.reopen.first.envFailed'
|
|
37
38
|
: detail.code === RESUME_TOOL_UNAVAILABLE
|
|
38
|
-
? '
|
|
39
|
-
: '
|
|
40
|
-
return
|
|
41
|
-
first,
|
|
42
|
-
'The engine re-parked the work before consuming anything — the approval is still pending and your decision was not consumed',
|
|
43
|
-
'Re-fetch the pending approvals and decide again on an engine where the same tool is available',
|
|
44
|
-
].join(' · ');
|
|
39
|
+
? 'resume.reopen.first.toolUnavailable'
|
|
40
|
+
: 'resume.reopen.first.toolContractMismatch');
|
|
41
|
+
return renderMessage(msg('resume.reopen.content', { first }), lang);
|
|
45
42
|
}
|
|
@@ -1,52 +1,20 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type HitlClientLike, type DecideOperationObserver } from './hitlBridge.js';
|
|
2
|
+
import { type ApprovalAllowRuleShadow } from './allowRuleShadow.js';
|
|
3
|
+
import type { UiLanguage } from '../env/uiLanguage.js';
|
|
4
|
+
import type { SessionRuleInertReason } from './sessionPolicyWire.js';
|
|
5
|
+
import { type ApprovalCardClaim } from './approvalHolds.js';
|
|
6
|
+
import { type ApprovalResolution } from './approvalResolution.js';
|
|
3
7
|
import { type ApprovalMandateWord } from '../gateVocabulary.js';
|
|
4
8
|
import type { ToolPermissionRequest } from '../seatContract.js';
|
|
5
|
-
import { type DenyAttributionRefusalDetail } from '../wireRefusalCopy.js';
|
|
6
9
|
import { type ApprovalDecidedByReading } from '../approvalDecidedByCapability.js';
|
|
7
|
-
import { type DecideReceiptView } from '../decideReceipt.js';
|
|
8
10
|
import { RULE_OFFER_MATCHES, RULE_OFFER_BATCH_MEMBER_KINDS, RULE_OFFER_UNCOVERED_REASONS, RULE_OFFERS_ABSENCE_REASONS } from '@sema-agent/sdk';
|
|
9
|
-
import type { ApprovalDecidedBy,
|
|
11
|
+
import type { ApprovalDecidedBy, ToolApprovalDecision as SdkToolApprovalDecision, ToolApprovalRespondAck, ToolApprovalRespondReplayed, PersistedRuleAnchor, RuleOfferMatch, RuleOfferBatchMember, RuleOfferUncoveredDetail, RuleOfferUncoveredReason, AskOrigin, RuleOffersAbsence, DenialLimitKind, DenialLimitFallback, ToolApprovalFrame, RuleOffer as SdkRuleOffer, ToolApprovalCardWord } from '@sema-agent/sdk';
|
|
10
12
|
export declare function toolNameIsFsWrite(name: string): boolean;
|
|
11
13
|
export declare function toolNameIsShellExec(name: string): boolean;
|
|
12
14
|
export declare function isToolApprovalGate(gate: {
|
|
13
15
|
kind?: unknown;
|
|
14
16
|
toolName?: unknown;
|
|
15
17
|
} | undefined | null): boolean;
|
|
16
|
-
export type FsApprovalOutcome = {
|
|
17
|
-
kind: 'decided';
|
|
18
|
-
gatedCallId?: string | undefined;
|
|
19
|
-
denied?: boolean | undefined;
|
|
20
|
-
denySettledBy?: ApprovalDenySettledBy | undefined;
|
|
21
|
-
denyReason?: string | undefined;
|
|
22
|
-
denyAttributionDropped?: true;
|
|
23
|
-
denyAttributionRenamed?: true;
|
|
24
|
-
receipt?: DecideReceiptView | undefined;
|
|
25
|
-
joinedInFlight?: true;
|
|
26
|
-
} | {
|
|
27
|
-
kind: 'aborted';
|
|
28
|
-
gatedCallId?: string | undefined;
|
|
29
|
-
joinedInFlight?: true;
|
|
30
|
-
} | {
|
|
31
|
-
kind: 'retracted';
|
|
32
|
-
gatedCallId?: string | undefined;
|
|
33
|
-
joinedInFlight?: true;
|
|
34
|
-
} | {
|
|
35
|
-
kind: 'failed';
|
|
36
|
-
stage: HitlFailureStage;
|
|
37
|
-
gatedCallId?: string | undefined;
|
|
38
|
-
reason: string;
|
|
39
|
-
code?: 'no_pending' | 'wrong_gate' | undefined;
|
|
40
|
-
errorCode?: string | undefined;
|
|
41
|
-
blockedBy?: string | undefined;
|
|
42
|
-
retriable?: true;
|
|
43
|
-
safetyCode?: HitlSafetyCode | undefined;
|
|
44
|
-
retryExhausted?: true;
|
|
45
|
-
currentPending?: GateCurrentPending | undefined;
|
|
46
|
-
denyAttributionRefusal?: DenyAttributionRefusalDetail | undefined;
|
|
47
|
-
editRefused?: true;
|
|
48
|
-
joinedInFlight?: true;
|
|
49
|
-
};
|
|
50
18
|
export interface FsApprovalWireDeps {
|
|
51
19
|
client: HitlClientLike;
|
|
52
20
|
onPresented?: () => void;
|
|
@@ -54,41 +22,27 @@ export interface FsApprovalWireDeps {
|
|
|
54
22
|
approvalDecidedBy?: ApprovalDecidedByReading | undefined;
|
|
55
23
|
}
|
|
56
24
|
export declare function structurallyEqual(a: unknown, b: unknown): boolean;
|
|
57
|
-
export type RuleOfferMatch
|
|
58
|
-
export type RuleOfferBatchMember
|
|
59
|
-
export type RuleOfferUncoveredDetail
|
|
60
|
-
export type RuleOfferUncoveredReason
|
|
25
|
+
export type { RuleOfferMatch };
|
|
26
|
+
export type { RuleOfferBatchMember };
|
|
27
|
+
export type { RuleOfferUncoveredDetail };
|
|
28
|
+
export type { RuleOfferUncoveredReason };
|
|
61
29
|
export { RULE_OFFER_MATCHES, RULE_OFFER_BATCH_MEMBER_KINDS, RULE_OFFER_UNCOVERED_REASONS };
|
|
62
|
-
export type AskOrigin
|
|
63
|
-
export type RuleOffersAbsence
|
|
64
|
-
export type DenialLimitKind
|
|
65
|
-
export type DenialLimitFallback
|
|
30
|
+
export type { AskOrigin };
|
|
31
|
+
export type { RuleOffersAbsence };
|
|
32
|
+
export type { DenialLimitKind };
|
|
33
|
+
export type { DenialLimitFallback };
|
|
66
34
|
export { RULE_OFFERS_ABSENCE_REASONS };
|
|
67
35
|
export declare const ASK_ORIGIN_WORDS: readonly string[];
|
|
68
|
-
export type
|
|
69
|
-
kind: 'single';
|
|
70
|
-
rule: string;
|
|
71
|
-
match: RuleOfferMatch;
|
|
72
|
-
command: string;
|
|
73
|
-
} | {
|
|
74
|
-
kind: 'batch';
|
|
75
|
-
rules: readonly RuleOfferBatchMember[];
|
|
76
|
-
uncoveredSegments: number;
|
|
77
|
-
uncoveredDetail?: readonly RuleOfferUncoveredDetail[];
|
|
78
|
-
};
|
|
79
|
-
export type RuleOffer = {
|
|
36
|
+
export type RuleOfferReading = (Extract<SdkRuleOffer, {
|
|
80
37
|
kind: 'single';
|
|
38
|
+
}> & {
|
|
81
39
|
offerIndex: number;
|
|
82
|
-
|
|
83
|
-
match: RuleOfferMatch;
|
|
84
|
-
command: string;
|
|
85
|
-
} | {
|
|
40
|
+
}) | (Omit<Extract<SdkRuleOffer, {
|
|
86
41
|
kind: 'batch';
|
|
42
|
+
}>, 'uncoveredDetail'> & {
|
|
87
43
|
offerIndex: number;
|
|
88
|
-
rules: RuleOfferBatchMember[];
|
|
89
|
-
uncoveredSegments: number;
|
|
90
44
|
uncoveredDetail?: readonly RuleOfferUncoveredDetail[];
|
|
91
|
-
};
|
|
45
|
+
});
|
|
92
46
|
export interface ApprovalCardAllowDecision {
|
|
93
47
|
kind: 'allow';
|
|
94
48
|
allowSession: boolean;
|
|
@@ -96,6 +50,7 @@ export interface ApprovalCardAllowDecision {
|
|
|
96
50
|
persistRule?: string;
|
|
97
51
|
persistRuleEdited?: true;
|
|
98
52
|
persistRuleBatchOfferIndex?: number;
|
|
53
|
+
note?: string;
|
|
99
54
|
}
|
|
100
55
|
export interface ApprovalCardDenyDecision {
|
|
101
56
|
kind: 'deny';
|
|
@@ -129,8 +84,8 @@ export interface ApprovalCardRequest {
|
|
|
129
84
|
argsUnavailable?: true;
|
|
130
85
|
governanceForced?: true;
|
|
131
86
|
delegation?: ToolApprovalDelegation;
|
|
132
|
-
ruleOffers?:
|
|
133
|
-
ruleOffersReadOnly?:
|
|
87
|
+
ruleOffers?: RuleOfferReading[];
|
|
88
|
+
ruleOffersReadOnly?: RuleOfferReading[];
|
|
134
89
|
inputHasBidi?: true;
|
|
135
90
|
hasBidiControls?: true;
|
|
136
91
|
allowRuleShadow?: ApprovalAllowRuleShadow;
|
|
@@ -159,6 +114,21 @@ export interface ApprovalCardRequest {
|
|
|
159
114
|
unreadableEvidence?: readonly string[];
|
|
160
115
|
classifierNoRuling?: string;
|
|
161
116
|
priorCardsForCall?: readonly ApprovalPriorCard[];
|
|
117
|
+
message?: string;
|
|
118
|
+
cardPayloadUnreadable?: true;
|
|
119
|
+
supersedes?: ApprovalCardSupersedes;
|
|
120
|
+
parkRow?: ApprovalCardParkRow;
|
|
121
|
+
}
|
|
122
|
+
export interface ApprovalCardSupersedes {
|
|
123
|
+
readonly approvalId?: string;
|
|
124
|
+
readonly parked?: true;
|
|
125
|
+
readonly priorAnswer?: ToolApprovalRespondDecision;
|
|
126
|
+
readonly priorAnswerOutcome?: 'not_sent' | 'not_accepted' | 'unconfirmed';
|
|
127
|
+
}
|
|
128
|
+
export interface ApprovalCardParkRow {
|
|
129
|
+
readonly taskId: string;
|
|
130
|
+
readonly gatedCallId?: string;
|
|
131
|
+
readonly deadlineMs?: number;
|
|
162
132
|
}
|
|
163
133
|
export interface ApprovalPriorCard {
|
|
164
134
|
readonly approvalId?: string;
|
|
@@ -180,53 +150,13 @@ export declare function surfaceApprovalCard(req: ApprovalCardRequest): Promise<A
|
|
|
180
150
|
declare const REMEMBER_REFUSAL_CODES: readonly ["remember_not_in_proof", "remember_requires_binding", "capability.store_required", "decide.workflow_remember_unsupported", "decide.parked_remember_unsupported"];
|
|
181
151
|
export type RememberRefusalCode = (typeof REMEMBER_REFUSAL_CODES)[number];
|
|
182
152
|
export declare function rememberRefusalOf(error: unknown): RememberRefusalCode | undefined;
|
|
183
|
-
export declare function surfaceFsApprovalAndDecide(deps: FsApprovalWireDeps, taskId: string, argsByCall: Map<string, unknown>, signal?: AbortSignal, parkGatedCallId?: string, parkToolName?: string): Promise<
|
|
153
|
+
export declare function surfaceFsApprovalAndDecide(deps: FsApprovalWireDeps, taskId: string, argsByCall: Map<string, unknown>, signal?: AbortSignal, parkGatedCallId?: string, parkToolName?: string): Promise<ApprovalResolution>;
|
|
184
154
|
export interface BoundSkillGrantsWire {
|
|
185
155
|
readonly skill: string | null;
|
|
186
156
|
readonly allowedTools: readonly string[];
|
|
187
157
|
readonly disallowedTools: readonly string[];
|
|
188
158
|
}
|
|
189
|
-
export
|
|
190
|
-
type: 'tool_approval' | 'tool_approval_complete';
|
|
191
|
-
approvalId: string;
|
|
192
|
-
toolName?: string;
|
|
193
|
-
toolCallId?: string;
|
|
194
|
-
message?: string;
|
|
195
|
-
args?: unknown;
|
|
196
|
-
argsOmitted?: boolean;
|
|
197
|
-
outcome?: 'allowed' | 'denied' | 'expired';
|
|
198
|
-
cause?: ApprovalSettleCause;
|
|
199
|
-
sourceTaskId?: string;
|
|
200
|
-
fromSubagent?: true;
|
|
201
|
-
sourceAgentName?: string;
|
|
202
|
-
governanceForced?: true;
|
|
203
|
-
delegation?: ToolApprovalDelegation;
|
|
204
|
-
ruleOffers?: readonly WireRuleOffer[];
|
|
205
|
-
ruleOffersAbsence?: string;
|
|
206
|
-
denialLimitFallback?: DenialLimitFallback;
|
|
207
|
-
persistedRuleShadowed?: string;
|
|
208
|
-
allowRuleShadowed?: readonly AllowRuleShadowedWireMember[];
|
|
209
|
-
boundGrantDigest?: string;
|
|
210
|
-
boundGrants?: BoundSkillGrantsWire;
|
|
211
|
-
classifierNoRuling?: string;
|
|
212
|
-
probeCause?: unknown;
|
|
213
|
-
probeReason?: string;
|
|
214
|
-
rememberRefused?: true;
|
|
215
|
-
ruleEvidence?: unknown;
|
|
216
|
-
requiresRealApproval?: true;
|
|
217
|
-
mandated?: true;
|
|
218
|
-
mandate?: string;
|
|
219
|
-
origin?: string;
|
|
220
|
-
approvalCard?: string;
|
|
221
|
-
askClass?: string;
|
|
222
|
-
classes?: readonly string[];
|
|
223
|
-
inputHasBidi?: true;
|
|
224
|
-
parked?: true;
|
|
225
|
-
expiresInMs?: number;
|
|
226
|
-
expiresAtMs?: number;
|
|
227
|
-
serverNowMs?: number;
|
|
228
|
-
readRootCandidate?: ReadRootCandidateView;
|
|
229
|
-
}
|
|
159
|
+
export type { ToolApprovalFrame };
|
|
230
160
|
export interface ReadRootCandidateView {
|
|
231
161
|
dir: string;
|
|
232
162
|
clearsThisAsk: true;
|
|
@@ -237,7 +167,7 @@ export interface ToolApprovalDelegation {
|
|
|
237
167
|
depth: number;
|
|
238
168
|
agentName?: string;
|
|
239
169
|
}
|
|
240
|
-
export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "governanceForced", "ruleOffers", "ruleOffersAbsence", "denialLimitFallback", "readRootCandidate", "mandated", "mandate", "origin", "approvalCard", "askClass", "classes", "inputHasBidi", "parked", "persistedRuleShadowed", "allowRuleShadowed", "probeCause", "probeReason", "rememberRefused", "boundGrantDigest", "boundGrants", "classifierNoRuling", "ruleEvidence", "requiresRealApproval", "expiresInMs", "expiresAtMs", "serverNowMs", "delegation", "outcome", "cause"];
|
|
170
|
+
export declare const TOOL_APPROVAL_FRAME_KEYS_MIRROR: readonly ["type", "approvalId", "toolCallId", "toolName", "sourceTaskId", "fromSubagent", "sourceAgentName", "message", "args", "argsOmitted", "governanceForced", "ruleOffers", "ruleOffersAbsence", "denialLimitFallback", "readRootCandidate", "mandated", "mandate", "origin", "approvalCard", "askClass", "classes", "inputHasBidi", "parked", "persistedRuleShadowed", "allowRuleShadowed", "probeCause", "probeReason", "rememberRefused", "boundGrantDigest", "boundGrantAbsence", "boundGrants", "classifierNoRuling", "ruleEvidence", "requiresRealApproval", "expiresInMs", "expiresAtMs", "serverNowMs", "delegation", "outcome", "cause"];
|
|
241
171
|
export interface ApprovalMandatedFacts {
|
|
242
172
|
readonly mandated?: true;
|
|
243
173
|
readonly ruleOffersAbsence?: string;
|
|
@@ -250,7 +180,37 @@ export declare function readApprovalMandate(v: {
|
|
|
250
180
|
export declare function readApprovalCardWord(carrier: unknown): ToolApprovalCardWord | undefined;
|
|
251
181
|
export declare function toolPermissionRequestAskBits(card: object | null | undefined, requestId?: string): Pick<ToolPermissionRequest, 'mandated' | 'mandate' | 'origin' | 'ruleOffersAbsence' | 'askClass' | 'classes' | 'sessionRow'>;
|
|
252
182
|
export declare function isFromSubagent(frame: ToolApprovalFrame): boolean;
|
|
253
|
-
export type ToolApprovalRespondDecision =
|
|
183
|
+
export type ToolApprovalRespondDecision = SdkToolApprovalDecision;
|
|
184
|
+
export declare const RESPOND_DECISIONS: readonly ["allow", "allow_session", "deny"];
|
|
185
|
+
export type AnswerPayloadLane = 'respond' | 'decide';
|
|
186
|
+
export interface AnswerPayloadCaps {
|
|
187
|
+
readonly approvalDecisionNoteCapable?: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface RespondAnswerPayload extends Pick<RespondToolApprovalOpts, 'updatedInput' | 'note'> {
|
|
190
|
+
readonly decision: ToolApprovalRespondDecision;
|
|
191
|
+
}
|
|
192
|
+
export interface DecideApprovePayload extends Pick<ApprovalCardAllowDecision, 'updatedInput'> {
|
|
193
|
+
readonly decision: 'approve';
|
|
194
|
+
readonly remember?: 'session';
|
|
195
|
+
}
|
|
196
|
+
export interface DecideDenyPayload {
|
|
197
|
+
readonly decision: 'deny';
|
|
198
|
+
readonly reason: string;
|
|
199
|
+
}
|
|
200
|
+
export type DecideAnswerPayload = DecideApprovePayload | DecideDenyPayload;
|
|
201
|
+
export declare function answerPayloadFor(answer: ApprovalCardDecision, lane: 'respond', caps?: AnswerPayloadCaps | null): RespondAnswerPayload | undefined;
|
|
202
|
+
export declare function answerPayloadFor(answer: ApprovalCardDecision, lane: 'decide', caps?: AnswerPayloadCaps | null): DecideAnswerPayload | undefined;
|
|
203
|
+
export interface AnswerCarriage {
|
|
204
|
+
readonly allowNote: 'model' | 'none';
|
|
205
|
+
}
|
|
206
|
+
export declare function answerCarriage(card: Pick<ApprovalCardRequest, 'callKey'> | null | undefined): AnswerCarriage;
|
|
207
|
+
export interface ApprovalAnswerCommitted {
|
|
208
|
+
readonly callKey: string;
|
|
209
|
+
readonly lane: AnswerPayloadLane;
|
|
210
|
+
readonly answer: ApprovalCardDecision;
|
|
211
|
+
readonly payload: RespondAnswerPayload | DecideAnswerPayload;
|
|
212
|
+
}
|
|
213
|
+
export declare function observeApprovalAnswerCommitted(listener: (event: ApprovalAnswerCommitted) => void): () => void;
|
|
254
214
|
export interface RespondToolApprovalOpts {
|
|
255
215
|
signal?: AbortSignal;
|
|
256
216
|
updatedInput?: unknown;
|
|
@@ -263,7 +223,8 @@ export interface RespondToolApprovalOpts {
|
|
|
263
223
|
}
|
|
264
224
|
export type RespondToolApprovalFn = (approvalId: string, decision: ToolApprovalRespondDecision, opts?: RespondToolApprovalOpts) => Promise<ToolApprovalRespondAck | void>;
|
|
265
225
|
export type ToolApprovalRespondAckView = ToolApprovalRespondAck;
|
|
266
|
-
export
|
|
226
|
+
export declare function isToolApprovalRespondReplayed(ack: ToolApprovalRespondAckView): ack is ToolApprovalRespondReplayed;
|
|
227
|
+
export type { PersistedRuleAnchor };
|
|
267
228
|
export declare function readToolApprovalRespondAck(v: unknown): ToolApprovalRespondAckView | undefined;
|
|
268
229
|
export interface ToolApprovalRespondParkingView {
|
|
269
230
|
readonly approvalId: string;
|
|
@@ -283,54 +244,35 @@ export declare function decisionAttributionKeyOf(reading: ApprovalDecidedByReadi
|
|
|
283
244
|
} | {
|
|
284
245
|
settledBy: 'policy';
|
|
285
246
|
} | Record<never, never>;
|
|
286
|
-
export interface ToolApprovalFrameOutcome {
|
|
287
|
-
decision: ToolApprovalRespondDecision | 'unresolved';
|
|
288
|
-
ack?: ToolApprovalRespondAckView;
|
|
289
|
-
respondRefusal?: ToolApprovalRespondRefusal;
|
|
290
|
-
editRefused?: true;
|
|
291
|
-
retracted?: true;
|
|
292
|
-
aborted?: true;
|
|
293
|
-
joinedInFlight?: true;
|
|
294
|
-
denySettledBy?: ApprovalDenySettledBy;
|
|
295
|
-
denyReason?: string;
|
|
296
|
-
denyAttributionRefusal?: DenyAttributionRefusalDetail;
|
|
297
|
-
denyAttributionDropped?: true;
|
|
298
|
-
denyAttributionRenamed?: true;
|
|
299
|
-
parking?: ToolApprovalRespondParkingView;
|
|
300
|
-
}
|
|
301
|
-
interface ToolApprovalRespondRefusalFields {
|
|
302
|
-
status?: number;
|
|
303
|
-
errorCode?: string;
|
|
304
|
-
message?: string;
|
|
305
|
-
retriable?: true;
|
|
306
|
-
extra?: {
|
|
307
|
-
readonly cause?: string;
|
|
308
|
-
readonly field?: string;
|
|
309
|
-
};
|
|
310
|
-
unreadable?: true;
|
|
311
|
-
}
|
|
312
|
-
export type ToolApprovalRespondRefusal = (ToolApprovalRespondRefusalFields & {
|
|
313
|
-
status: number;
|
|
314
|
-
}) | (ToolApprovalRespondRefusalFields & {
|
|
315
|
-
errorCode: string;
|
|
316
|
-
}) | (ToolApprovalRespondRefusalFields & {
|
|
317
|
-
message: string;
|
|
318
|
-
});
|
|
319
|
-
export declare function readToolApprovalRespondRefusal(err: unknown): ToolApprovalRespondRefusal | undefined;
|
|
320
247
|
export declare function isToolApprovalFrame(ev: unknown): ev is ToolApprovalFrame;
|
|
321
|
-
export declare function askProbeReasonDetail(card: Pick<ApprovalCardRequest, 'probeReason' | 'probeCause'> | null | undefined): string | undefined;
|
|
248
|
+
export declare function askProbeReasonDetail(card: Pick<ApprovalCardRequest, 'probeReason' | 'probeCause'> | null | undefined, lang?: UiLanguage): string | undefined;
|
|
322
249
|
export declare function readApprovalRememberRefused(v: unknown): boolean;
|
|
323
250
|
export declare function readApprovalBoundGrants(v: unknown): BoundSkillGrantsWire | undefined;
|
|
251
|
+
export type BoundGrantEntryReading = {
|
|
252
|
+
readonly kind: 'rule';
|
|
253
|
+
} | {
|
|
254
|
+
readonly kind: 'reads_as_nothing';
|
|
255
|
+
readonly reason?: SessionRuleInertReason;
|
|
256
|
+
};
|
|
257
|
+
export declare function readBoundGrantEntry(entry: string): BoundGrantEntryReading | undefined;
|
|
324
258
|
export type ApprovalGrantBinding = 'bound' | 'none' | 'unreadable';
|
|
325
259
|
export declare function readApprovalClassifierNoRuling(v: unknown): string | undefined;
|
|
326
|
-
export declare function classifierNoRulingDetail(word: string | undefined): string;
|
|
327
|
-
export declare function approvalBoundGrantsDetail(grants: BoundSkillGrantsWire | null | undefined): string | undefined;
|
|
328
|
-
export declare function approvalPriorCardsDetail(card: Pick<ApprovalCardRequest, 'priorCardsForCall' | 'origin'> | null | undefined): string | undefined;
|
|
260
|
+
export declare function classifierNoRulingDetail(word: string | undefined, lang?: UiLanguage): string;
|
|
261
|
+
export declare function approvalBoundGrantsDetail(grants: BoundSkillGrantsWire | null | undefined, lang?: UiLanguage): string | undefined;
|
|
262
|
+
export declare function approvalPriorCardsDetail(card: Pick<ApprovalCardRequest, 'priorCardsForCall' | 'origin'> | null | undefined, lang?: UiLanguage): string | undefined;
|
|
263
|
+
export declare function approvalSupersedesDetail(card: Pick<ApprovalCardRequest, 'supersedes'> | null | undefined): string | undefined;
|
|
329
264
|
export declare function readDenialLimitFallback(v: unknown): DenialLimitFallback | undefined;
|
|
330
|
-
export declare function readRuleOffers(v: unknown):
|
|
331
|
-
export declare function readRuleOfferSupply(offers: unknown):
|
|
332
|
-
export type ApprovalCardV1Facts = Pick<ApprovalCardRequest, 'toolName' | 'args'> & Pick<ApprovalCardRequest, 'toolCallId' | 'workerBadge' | 'wireNote' | 'argsUnavailable' | 'governanceForced' | 'delegation' | 'ruleOffersReadOnly' | 'inputHasBidi' | 'allowRuleShadow' | 'probeCause' | 'rememberRefused' | 'ruleEvidence' | 'requiresRealApproval' | 'ruleOffersAbsence' | 'denialLimitFallback' | 'askClass' | 'classes' | 'grantBinding' | 'unreadableEvidence'>;
|
|
265
|
+
export declare function readRuleOffers(v: unknown): RuleOfferReading[] | undefined;
|
|
266
|
+
export declare function readRuleOfferSupply(offers: unknown): RuleOfferReading[] | undefined;
|
|
267
|
+
export type ApprovalCardV1Facts = Pick<ApprovalCardRequest, 'toolName' | 'args'> & Pick<ApprovalCardRequest, 'toolCallId' | 'workerBadge' | 'wireNote' | 'argsUnavailable' | 'governanceForced' | 'delegation' | 'ruleOffersReadOnly' | 'inputHasBidi' | 'allowRuleShadow' | 'probeCause' | 'rememberRefused' | 'ruleEvidence' | 'requiresRealApproval' | 'ruleOffersAbsence' | 'denialLimitFallback' | 'askClass' | 'classes' | 'grantBinding' | 'unreadableEvidence' | 'message'>;
|
|
268
|
+
export type ApprovalCardFacts = ApprovalCardV1Facts & Pick<ApprovalCardRequest, 'ruleOffers' | 'probeReason' | 'mandated' | 'mandate' | 'readRootCandidate' | 'origin' | 'approvalCard' | 'boundGrants' | 'classifierNoRuling' | 'allowSessionCarried' | 'cardPayloadUnreadable'>;
|
|
269
|
+
export interface ApprovalCardFrameFactsOptions {
|
|
270
|
+
readonly streamArgs?: object;
|
|
271
|
+
readonly argsUnavailable?: true;
|
|
272
|
+
}
|
|
333
273
|
export declare function approvalCardFactsOfV1(card: object | null | undefined): Readonly<ApprovalCardV1Facts> | undefined;
|
|
274
|
+
export declare function approvalCardFactsOfFrame(frame: object | null | undefined, opts?: ApprovalCardFrameFactsOptions | null): Readonly<ApprovalCardFacts> | undefined;
|
|
275
|
+
export declare function approvalCardFactsOfGeneric(card: object | null | undefined): Readonly<ApprovalCardFacts> | undefined;
|
|
334
276
|
export interface ToolApprovalFrameLaneOpts {
|
|
335
277
|
approvalDecisionNoteCapable?: boolean;
|
|
336
278
|
respondFreeFormRulesCapable?: boolean;
|
|
@@ -342,7 +284,7 @@ export interface ToolApprovalFrameLaneOpts {
|
|
|
342
284
|
export declare function surfaceToolApprovalFrameAndRespond(frame: ToolApprovalFrame, respond: RespondToolApprovalFn, streamArgs: unknown | undefined, signal?: AbortSignal, lane?: ToolApprovalFrameLaneOpts, run?: {
|
|
343
285
|
readonly taskId?: string;
|
|
344
286
|
readonly sessionId?: string;
|
|
345
|
-
}): Promise<
|
|
287
|
+
}): Promise<ApprovalResolution>;
|
|
346
288
|
export interface ApprovalHolderIdentity {
|
|
347
289
|
readonly approvalId?: string;
|
|
348
290
|
readonly taskId?: string;
|
|
@@ -351,8 +293,13 @@ export interface ApprovalHolderIdentity {
|
|
|
351
293
|
}
|
|
352
294
|
export type ApprovalHolderJoin = {
|
|
353
295
|
readonly kind: 'joined';
|
|
354
|
-
readonly outcome:
|
|
296
|
+
readonly outcome: ApprovalResolution;
|
|
355
297
|
} | {
|
|
356
298
|
readonly kind: 'free';
|
|
357
299
|
};
|
|
358
300
|
export declare function joinApprovalHolder(identity: ApprovalHolderIdentity, signal?: AbortSignal): Promise<ApprovalHolderJoin>;
|
|
301
|
+
export interface ApprovalCardClaimOptions {
|
|
302
|
+
readonly signal?: AbortSignal;
|
|
303
|
+
}
|
|
304
|
+
export declare function claimApprovalCard(identity: ApprovalHolderIdentity, options?: ApprovalCardClaimOptions): Promise<ApprovalCardClaim>;
|
|
305
|
+
export type { ApprovalCardClaim, HostApprovalCardHold } from './approvalHolds.js';
|