@sema-agent/client-core 0.97.0 → 0.98.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 +429 -0
- package/README.md +74 -36
- package/dist/adapt/arms.d.ts +1 -0
- package/dist/adapt/arms.js +128 -34
- 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/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 +5 -0
- package/dist/adapter/activeRunSelfHeal.js +51 -28
- package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
- package/dist/adapter/downstream/eventToSdkMessage.js +27 -34
- 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 +29 -13
- package/dist/adapter/types.d.ts +4 -4
- package/dist/agentSession/backgroundView.js +2 -1
- package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
- package/dist/agentSession/engineAgentRegistryRead.js +12 -13
- package/dist/agentsWireCaps.d.ts +8 -6
- package/dist/agentsWireCaps.js +177 -162
- 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 +4 -2
- package/dist/cloudConfigWireCaps.js +81 -61
- package/dist/compensations.js +1 -1
- package/dist/connectorStatus.d.ts +21 -0
- package/dist/connectorStatus.js +112 -0
- package/dist/controlRouter.d.ts +14 -1
- package/dist/controlRouter.js +68 -17
- package/dist/coreValuePorts.d.ts +3 -3
- package/dist/decideReceipt.d.ts +2 -2
- package/dist/decideReceipt.js +5 -2
- package/dist/declared/supportFloorDeclared.js +3 -3
- 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/displayUntrusted.d.ts +1 -0
- package/dist/displayUntrusted.js +250 -76
- package/dist/engineAgentAbsence.d.ts +1 -1
- package/dist/engineAgentPanelStore.d.ts +5 -4
- package/dist/engineAgentPanelStore.js +3 -12
- package/dist/engineCapReader.d.ts +0 -4
- package/dist/engineCapReader.js +1 -5
- package/dist/engineCapsCache.d.ts +4 -0
- package/dist/engineCapsCache.js +17 -12
- package/dist/engineClosedSets.d.ts +1 -0
- package/dist/engineClosedSets.js +4 -1
- package/dist/engineErrorCodes.d.ts +9 -2
- package/dist/engineErrorCodes.js +9 -1
- package/dist/engineIdentity.d.ts +1 -0
- package/dist/engineIdentity.js +8 -0
- package/dist/engineRowRef.d.ts +28 -0
- package/dist/engineRowRef.js +111 -0
- package/dist/engineSessionMessages.d.ts +67 -0
- package/dist/engineSessionMessages.js +364 -0
- package/dist/engineToolDirectory.d.ts +18 -0
- package/dist/engineToolDirectory.js +85 -0
- package/dist/engineUrl.d.ts +18 -0
- package/dist/engineUrl.js +52 -0
- package/dist/env/uiLanguage.d.ts +9 -0
- package/dist/env/uiLanguage.js +35 -0
- package/dist/eventLeg.d.ts +92 -0
- package/dist/eventLeg.js +285 -0
- package/dist/executionLaneCapability.d.ts +0 -4
- package/dist/executionLaneCapability.js +3 -16
- package/dist/fileHistoryCaptureCapability.d.ts +0 -4
- package/dist/fileHistoryCaptureCapability.js +5 -7
- 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 +5 -0
- package/dist/frameBinding.js +23 -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 +25 -6
- package/dist/gateVocabulary.d.ts +5 -0
- package/dist/gateVocabulary.js +64 -2
- package/dist/generated/engineAskFaceTables.js +2 -2
- package/dist/generated/engineFactTables.d.ts +6 -3
- package/dist/generated/engineFactTables.js +22 -4
- package/dist/generated/engineNoticeTables.js +9 -0
- package/dist/generated/toolNameTables.d.ts +1 -0
- package/dist/generated/toolNameTables.js +1 -0
- package/dist/hitl/allowRuleShadow.d.ts +6 -1
- package/dist/hitl/allowRuleShadow.js +21 -17
- package/dist/hitl/approvalCardReading.d.ts +15 -0
- package/dist/hitl/approvalCardReading.js +154 -0
- package/dist/hitl/approvalCardReasons.d.ts +13 -0
- package/dist/hitl/approvalCardReasons.js +120 -0
- package/dist/hitl/approvalHolds.d.ts +47 -15
- package/dist/hitl/approvalHolds.js +134 -28
- 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 +1 -0
- package/dist/hitl/askGateWire.d.ts +20 -2
- package/dist/hitl/askGateWire.js +49 -1
- package/dist/hitl/askParkRowRouting.d.ts +5 -0
- package/dist/hitl/askParkRowRouting.js +32 -1
- package/dist/hitl/askSettlementLine.d.ts +18 -0
- package/dist/hitl/askSettlementLine.js +79 -0
- package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
- package/dist/hitl/automaticAnswerVerdict.js +21 -5
- package/dist/hitl/crashConverged.d.ts +11 -20
- package/dist/hitl/crashConverged.js +56 -0
- package/dist/hitl/crashConvergedNotice.d.ts +3 -1
- package/dist/hitl/crashConvergedNotice.js +48 -11
- 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 +20 -16
- package/dist/hitl/gateLedger.d.ts +2 -0
- package/dist/hitl/gateLedger.js +50 -13
- package/dist/hitl/hitlBridge.d.ts +1 -2
- package/dist/hitl/hitlBridge.js +10 -7
- 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 +24 -0
- package/dist/hitl/persistedRulesWire.js +122 -2
- package/dist/hitl/planReviewWire.d.ts +26 -13
- package/dist/hitl/planReviewWire.js +112 -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.js +2 -4
- package/dist/hitl/sessionPolicyWire.d.ts +32 -20
- package/dist/hitl/sessionPolicyWire.js +162 -52
- package/dist/hitl/standingRows.d.ts +20 -2
- package/dist/hitl/standingRows.js +69 -8
- package/dist/hitl/toolApprovalWire.d.ts +87 -152
- package/dist/hitl/toolApprovalWire.js +591 -380
- package/dist/hookMatcherVerdict.d.ts +6 -1
- package/dist/hookMatcherVerdict.js +14 -7
- package/dist/hooksWireCaps.d.ts +2 -2
- package/dist/hooksWireCaps.js +59 -55
- package/dist/i18n/messages.en.d.ts +121 -0
- package/dist/i18n/messages.en.js +119 -0
- package/dist/i18n/messages.zh.d.ts +3 -0
- package/dist/i18n/messages.zh.js +120 -0
- package/dist/i18n/translate.d.ts +25 -0
- package/dist/i18n/translate.js +127 -0
- package/dist/index.d.ts +53 -18
- package/dist/index.js +38 -10
- package/dist/inheritEnvCapability.d.ts +31 -0
- package/dist/inheritEnvCapability.js +104 -0
- package/dist/liveModelCatalog.d.ts +1 -2
- package/dist/liveModelCatalog.js +2 -6
- package/dist/liveQuestionStore.d.ts +2 -21
- package/dist/mcpLiveness.d.ts +2 -1
- package/dist/mcpProbeWire.d.ts +6 -1
- package/dist/mcpProbeWire.js +1 -1
- package/dist/mcpWireCaps.d.ts +13 -2
- package/dist/mcpWireCaps.js +48 -0
- package/dist/memoryEntriesWire.d.ts +4 -9
- 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/subagentModelWord.d.ts +31 -0
- package/dist/model/subagentModelWord.js +261 -0
- 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 +15 -0
- package/dist/ownKey.js +60 -3
- package/dist/panelReduce.d.ts +15 -9
- package/dist/panelReduce.js +680 -549
- 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/permissionRulesWriteCapability.d.ts +0 -4
- package/dist/permissionRulesWriteCapability.js +0 -6
- 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 +1 -1
- package/dist/pluginHooksWire.js +3 -6
- package/dist/preemptWire.d.ts +44 -0
- package/dist/preemptWire.js +83 -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 +0 -1
- package/dist/request/taskRequest.js +0 -3
- package/dist/resumeRefusalCopy.d.ts +2 -1
- package/dist/resumeRefusalCopy.js +38 -2
- package/dist/retryStatus.d.ts +8 -0
- package/dist/retryStatus.js +106 -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/scenarioWire.js +1 -1
- package/dist/seam.d.ts +24 -2
- package/dist/seam.js +15 -3
- package/dist/seatContract.d.ts +53 -10
- package/dist/seatContract.js +132 -81
- package/dist/sessionPolicyCapability.d.ts +0 -4
- package/dist/sessionPolicyCapability.js +0 -6
- package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
- package/dist/sessionSyncFileHistoryCapability.js +0 -3
- package/dist/skillToolListsCapability.d.ts +0 -3
- package/dist/skillToolListsCapability.js +0 -3
- package/dist/sqlEngineCapability.d.ts +0 -4
- package/dist/sqlEngineCapability.js +0 -6
- 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/engineTaskHandleWire.js +4 -7
- package/dist/subagentContentStore.js +1 -11
- 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/toolResult.d.ts +10 -1
- package/dist/toolResult.js +34 -6
- package/dist/toolRoster.d.ts +0 -2
- package/dist/toolRoster.js +0 -2
- package/dist/turnFailurePresentation.d.ts +28 -0
- package/dist/turnFailurePresentation.js +205 -0
- package/dist/userInvokedSkillsCapability.d.ts +0 -3
- package/dist/userInvokedSkillsCapability.js +0 -3
- package/dist/webSearchBackendCapability.d.ts +0 -4
- package/dist/webSearchBackendCapability.js +0 -6
- package/dist/wireErrorTriage.js +5 -24
- package/dist/wireFailureShape.d.ts +62 -5
- package/dist/wireFailureShape.js +105 -5
- package/dist/wireRefusalCopy.d.ts +12 -2
- package/dist/wireRefusalCopy.js +50 -52
- package/dist/workflowsJournalCapability.d.ts +0 -4
- package/dist/workflowsJournalCapability.js +0 -6
- package/dist/writeProtectionCapability.d.ts +0 -4
- package/dist/writeProtectionCapability.js +0 -6
- package/docs/INTEGRATION-CLIENTS.md +1305 -46
- package/package.json +5 -4
- 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,52 +1,18 @@
|
|
|
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 ApprovalCardClaim } from './approvalHolds.js';
|
|
4
|
+
import { type ApprovalResolution } from './approvalResolution.js';
|
|
3
5
|
import { type ApprovalMandateWord } from '../gateVocabulary.js';
|
|
4
6
|
import type { ToolPermissionRequest } from '../seatContract.js';
|
|
5
|
-
import { type DenyAttributionRefusalDetail } from '../wireRefusalCopy.js';
|
|
6
7
|
import { type ApprovalDecidedByReading } from '../approvalDecidedByCapability.js';
|
|
7
|
-
import { type DecideReceiptView } from '../decideReceipt.js';
|
|
8
8
|
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,
|
|
9
|
+
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
10
|
export declare function toolNameIsFsWrite(name: string): boolean;
|
|
11
11
|
export declare function toolNameIsShellExec(name: string): boolean;
|
|
12
12
|
export declare function isToolApprovalGate(gate: {
|
|
13
13
|
kind?: unknown;
|
|
14
14
|
toolName?: unknown;
|
|
15
15
|
} | 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
16
|
export interface FsApprovalWireDeps {
|
|
51
17
|
client: HitlClientLike;
|
|
52
18
|
onPresented?: () => void;
|
|
@@ -54,41 +20,27 @@ export interface FsApprovalWireDeps {
|
|
|
54
20
|
approvalDecidedBy?: ApprovalDecidedByReading | undefined;
|
|
55
21
|
}
|
|
56
22
|
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
|
|
23
|
+
export type { RuleOfferMatch };
|
|
24
|
+
export type { RuleOfferBatchMember };
|
|
25
|
+
export type { RuleOfferUncoveredDetail };
|
|
26
|
+
export type { RuleOfferUncoveredReason };
|
|
61
27
|
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
|
|
28
|
+
export type { AskOrigin };
|
|
29
|
+
export type { RuleOffersAbsence };
|
|
30
|
+
export type { DenialLimitKind };
|
|
31
|
+
export type { DenialLimitFallback };
|
|
66
32
|
export { RULE_OFFERS_ABSENCE_REASONS };
|
|
67
33
|
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 = {
|
|
34
|
+
export type RuleOfferReading = (Extract<SdkRuleOffer, {
|
|
80
35
|
kind: 'single';
|
|
36
|
+
}> & {
|
|
81
37
|
offerIndex: number;
|
|
82
|
-
|
|
83
|
-
match: RuleOfferMatch;
|
|
84
|
-
command: string;
|
|
85
|
-
} | {
|
|
38
|
+
}) | (Omit<Extract<SdkRuleOffer, {
|
|
86
39
|
kind: 'batch';
|
|
40
|
+
}>, 'uncoveredDetail'> & {
|
|
87
41
|
offerIndex: number;
|
|
88
|
-
rules: RuleOfferBatchMember[];
|
|
89
|
-
uncoveredSegments: number;
|
|
90
42
|
uncoveredDetail?: readonly RuleOfferUncoveredDetail[];
|
|
91
|
-
};
|
|
43
|
+
});
|
|
92
44
|
export interface ApprovalCardAllowDecision {
|
|
93
45
|
kind: 'allow';
|
|
94
46
|
allowSession: boolean;
|
|
@@ -96,6 +48,7 @@ export interface ApprovalCardAllowDecision {
|
|
|
96
48
|
persistRule?: string;
|
|
97
49
|
persistRuleEdited?: true;
|
|
98
50
|
persistRuleBatchOfferIndex?: number;
|
|
51
|
+
note?: string;
|
|
99
52
|
}
|
|
100
53
|
export interface ApprovalCardDenyDecision {
|
|
101
54
|
kind: 'deny';
|
|
@@ -129,8 +82,8 @@ export interface ApprovalCardRequest {
|
|
|
129
82
|
argsUnavailable?: true;
|
|
130
83
|
governanceForced?: true;
|
|
131
84
|
delegation?: ToolApprovalDelegation;
|
|
132
|
-
ruleOffers?:
|
|
133
|
-
ruleOffersReadOnly?:
|
|
85
|
+
ruleOffers?: RuleOfferReading[];
|
|
86
|
+
ruleOffersReadOnly?: RuleOfferReading[];
|
|
134
87
|
inputHasBidi?: true;
|
|
135
88
|
hasBidiControls?: true;
|
|
136
89
|
allowRuleShadow?: ApprovalAllowRuleShadow;
|
|
@@ -159,6 +112,21 @@ export interface ApprovalCardRequest {
|
|
|
159
112
|
unreadableEvidence?: readonly string[];
|
|
160
113
|
classifierNoRuling?: string;
|
|
161
114
|
priorCardsForCall?: readonly ApprovalPriorCard[];
|
|
115
|
+
message?: string;
|
|
116
|
+
cardPayloadUnreadable?: true;
|
|
117
|
+
supersedes?: ApprovalCardSupersedes;
|
|
118
|
+
parkRow?: ApprovalCardParkRow;
|
|
119
|
+
}
|
|
120
|
+
export interface ApprovalCardSupersedes {
|
|
121
|
+
readonly approvalId?: string;
|
|
122
|
+
readonly parked?: true;
|
|
123
|
+
readonly priorAnswer?: ToolApprovalRespondDecision;
|
|
124
|
+
readonly priorAnswerOutcome?: 'not_sent' | 'not_accepted' | 'unconfirmed';
|
|
125
|
+
}
|
|
126
|
+
export interface ApprovalCardParkRow {
|
|
127
|
+
readonly taskId: string;
|
|
128
|
+
readonly gatedCallId?: string;
|
|
129
|
+
readonly deadlineMs?: number;
|
|
162
130
|
}
|
|
163
131
|
export interface ApprovalPriorCard {
|
|
164
132
|
readonly approvalId?: string;
|
|
@@ -180,53 +148,13 @@ export declare function surfaceApprovalCard(req: ApprovalCardRequest): Promise<A
|
|
|
180
148
|
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
149
|
export type RememberRefusalCode = (typeof REMEMBER_REFUSAL_CODES)[number];
|
|
182
150
|
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<
|
|
151
|
+
export declare function surfaceFsApprovalAndDecide(deps: FsApprovalWireDeps, taskId: string, argsByCall: Map<string, unknown>, signal?: AbortSignal, parkGatedCallId?: string, parkToolName?: string): Promise<ApprovalResolution>;
|
|
184
152
|
export interface BoundSkillGrantsWire {
|
|
185
153
|
readonly skill: string | null;
|
|
186
154
|
readonly allowedTools: readonly string[];
|
|
187
155
|
readonly disallowedTools: readonly string[];
|
|
188
156
|
}
|
|
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
|
-
}
|
|
157
|
+
export type { ToolApprovalFrame };
|
|
230
158
|
export interface ReadRootCandidateView {
|
|
231
159
|
dir: string;
|
|
232
160
|
clearsThisAsk: true;
|
|
@@ -237,7 +165,7 @@ export interface ToolApprovalDelegation {
|
|
|
237
165
|
depth: number;
|
|
238
166
|
agentName?: string;
|
|
239
167
|
}
|
|
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"];
|
|
168
|
+
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
169
|
export interface ApprovalMandatedFacts {
|
|
242
170
|
readonly mandated?: true;
|
|
243
171
|
readonly ruleOffersAbsence?: string;
|
|
@@ -250,7 +178,37 @@ export declare function readApprovalMandate(v: {
|
|
|
250
178
|
export declare function readApprovalCardWord(carrier: unknown): ToolApprovalCardWord | undefined;
|
|
251
179
|
export declare function toolPermissionRequestAskBits(card: object | null | undefined, requestId?: string): Pick<ToolPermissionRequest, 'mandated' | 'mandate' | 'origin' | 'ruleOffersAbsence' | 'askClass' | 'classes' | 'sessionRow'>;
|
|
252
180
|
export declare function isFromSubagent(frame: ToolApprovalFrame): boolean;
|
|
253
|
-
export type ToolApprovalRespondDecision =
|
|
181
|
+
export type ToolApprovalRespondDecision = SdkToolApprovalDecision;
|
|
182
|
+
export declare const RESPOND_DECISIONS: readonly ["allow", "allow_session", "deny"];
|
|
183
|
+
export type AnswerPayloadLane = 'respond' | 'decide';
|
|
184
|
+
export interface AnswerPayloadCaps {
|
|
185
|
+
readonly approvalDecisionNoteCapable?: boolean;
|
|
186
|
+
}
|
|
187
|
+
export interface RespondAnswerPayload extends Pick<RespondToolApprovalOpts, 'updatedInput' | 'note'> {
|
|
188
|
+
readonly decision: ToolApprovalRespondDecision;
|
|
189
|
+
}
|
|
190
|
+
export interface DecideApprovePayload extends Pick<ApprovalCardAllowDecision, 'updatedInput'> {
|
|
191
|
+
readonly decision: 'approve';
|
|
192
|
+
readonly remember?: 'session';
|
|
193
|
+
}
|
|
194
|
+
export interface DecideDenyPayload {
|
|
195
|
+
readonly decision: 'deny';
|
|
196
|
+
readonly reason: string;
|
|
197
|
+
}
|
|
198
|
+
export type DecideAnswerPayload = DecideApprovePayload | DecideDenyPayload;
|
|
199
|
+
export declare function answerPayloadFor(answer: ApprovalCardDecision, lane: 'respond', caps?: AnswerPayloadCaps | null): RespondAnswerPayload | undefined;
|
|
200
|
+
export declare function answerPayloadFor(answer: ApprovalCardDecision, lane: 'decide', caps?: AnswerPayloadCaps | null): DecideAnswerPayload | undefined;
|
|
201
|
+
export interface AnswerCarriage {
|
|
202
|
+
readonly allowNote: 'model' | 'none';
|
|
203
|
+
}
|
|
204
|
+
export declare function answerCarriage(card: Pick<ApprovalCardRequest, 'callKey'> | null | undefined): AnswerCarriage;
|
|
205
|
+
export interface ApprovalAnswerCommitted {
|
|
206
|
+
readonly callKey: string;
|
|
207
|
+
readonly lane: AnswerPayloadLane;
|
|
208
|
+
readonly answer: ApprovalCardDecision;
|
|
209
|
+
readonly payload: RespondAnswerPayload | DecideAnswerPayload;
|
|
210
|
+
}
|
|
211
|
+
export declare function observeApprovalAnswerCommitted(listener: (event: ApprovalAnswerCommitted) => void): () => void;
|
|
254
212
|
export interface RespondToolApprovalOpts {
|
|
255
213
|
signal?: AbortSignal;
|
|
256
214
|
updatedInput?: unknown;
|
|
@@ -263,7 +221,8 @@ export interface RespondToolApprovalOpts {
|
|
|
263
221
|
}
|
|
264
222
|
export type RespondToolApprovalFn = (approvalId: string, decision: ToolApprovalRespondDecision, opts?: RespondToolApprovalOpts) => Promise<ToolApprovalRespondAck | void>;
|
|
265
223
|
export type ToolApprovalRespondAckView = ToolApprovalRespondAck;
|
|
266
|
-
export
|
|
224
|
+
export declare function isToolApprovalRespondReplayed(ack: ToolApprovalRespondAckView): ack is ToolApprovalRespondReplayed;
|
|
225
|
+
export type { PersistedRuleAnchor };
|
|
267
226
|
export declare function readToolApprovalRespondAck(v: unknown): ToolApprovalRespondAckView | undefined;
|
|
268
227
|
export interface ToolApprovalRespondParkingView {
|
|
269
228
|
readonly approvalId: string;
|
|
@@ -283,40 +242,6 @@ export declare function decisionAttributionKeyOf(reading: ApprovalDecidedByReadi
|
|
|
283
242
|
} | {
|
|
284
243
|
settledBy: 'policy';
|
|
285
244
|
} | 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
245
|
export declare function isToolApprovalFrame(ev: unknown): ev is ToolApprovalFrame;
|
|
321
246
|
export declare function askProbeReasonDetail(card: Pick<ApprovalCardRequest, 'probeReason' | 'probeCause'> | null | undefined): string | undefined;
|
|
322
247
|
export declare function readApprovalRememberRefused(v: unknown): boolean;
|
|
@@ -326,11 +251,19 @@ export declare function readApprovalClassifierNoRuling(v: unknown): string | und
|
|
|
326
251
|
export declare function classifierNoRulingDetail(word: string | undefined): string;
|
|
327
252
|
export declare function approvalBoundGrantsDetail(grants: BoundSkillGrantsWire | null | undefined): string | undefined;
|
|
328
253
|
export declare function approvalPriorCardsDetail(card: Pick<ApprovalCardRequest, 'priorCardsForCall' | 'origin'> | null | undefined): string | undefined;
|
|
254
|
+
export declare function approvalSupersedesDetail(card: Pick<ApprovalCardRequest, 'supersedes'> | null | undefined): string | undefined;
|
|
329
255
|
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'>;
|
|
256
|
+
export declare function readRuleOffers(v: unknown): RuleOfferReading[] | undefined;
|
|
257
|
+
export declare function readRuleOfferSupply(offers: unknown): RuleOfferReading[] | undefined;
|
|
258
|
+
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'>;
|
|
259
|
+
export type ApprovalCardFacts = ApprovalCardV1Facts & Pick<ApprovalCardRequest, 'ruleOffers' | 'probeReason' | 'mandated' | 'mandate' | 'readRootCandidate' | 'origin' | 'approvalCard' | 'boundGrants' | 'classifierNoRuling' | 'allowSessionCarried' | 'cardPayloadUnreadable'>;
|
|
260
|
+
export interface ApprovalCardFrameFactsOptions {
|
|
261
|
+
readonly streamArgs?: object;
|
|
262
|
+
readonly argsUnavailable?: true;
|
|
263
|
+
}
|
|
333
264
|
export declare function approvalCardFactsOfV1(card: object | null | undefined): Readonly<ApprovalCardV1Facts> | undefined;
|
|
265
|
+
export declare function approvalCardFactsOfFrame(frame: object | null | undefined, opts?: ApprovalCardFrameFactsOptions | null): Readonly<ApprovalCardFacts> | undefined;
|
|
266
|
+
export declare function approvalCardFactsOfGeneric(card: object | null | undefined): Readonly<ApprovalCardFacts> | undefined;
|
|
334
267
|
export interface ToolApprovalFrameLaneOpts {
|
|
335
268
|
approvalDecisionNoteCapable?: boolean;
|
|
336
269
|
respondFreeFormRulesCapable?: boolean;
|
|
@@ -342,7 +275,7 @@ export interface ToolApprovalFrameLaneOpts {
|
|
|
342
275
|
export declare function surfaceToolApprovalFrameAndRespond(frame: ToolApprovalFrame, respond: RespondToolApprovalFn, streamArgs: unknown | undefined, signal?: AbortSignal, lane?: ToolApprovalFrameLaneOpts, run?: {
|
|
343
276
|
readonly taskId?: string;
|
|
344
277
|
readonly sessionId?: string;
|
|
345
|
-
}): Promise<
|
|
278
|
+
}): Promise<ApprovalResolution>;
|
|
346
279
|
export interface ApprovalHolderIdentity {
|
|
347
280
|
readonly approvalId?: string;
|
|
348
281
|
readonly taskId?: string;
|
|
@@ -351,8 +284,10 @@ export interface ApprovalHolderIdentity {
|
|
|
351
284
|
}
|
|
352
285
|
export type ApprovalHolderJoin = {
|
|
353
286
|
readonly kind: 'joined';
|
|
354
|
-
readonly outcome:
|
|
287
|
+
readonly outcome: ApprovalResolution;
|
|
355
288
|
} | {
|
|
356
289
|
readonly kind: 'free';
|
|
357
290
|
};
|
|
358
291
|
export declare function joinApprovalHolder(identity: ApprovalHolderIdentity, signal?: AbortSignal): Promise<ApprovalHolderJoin>;
|
|
292
|
+
export declare function claimApprovalCard(identity: ApprovalHolderIdentity, signal?: AbortSignal): Promise<ApprovalCardClaim>;
|
|
293
|
+
export type { ApprovalCardClaim, HostApprovalCardHold } from './approvalHolds.js';
|