@sema-agent/client-core 0.97.1 → 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.
Files changed (281) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +74 -37
  3. package/dist/adapt/arms.d.ts +1 -0
  4. package/dist/adapt/arms.js +128 -34
  5. package/dist/adapt/ids.d.ts +12 -1
  6. package/dist/adapt/ids.js +59 -8
  7. package/dist/adapt/instanceLedger.d.ts +50 -0
  8. package/dist/adapt/instanceLedger.js +147 -0
  9. package/dist/adapt/textStream.d.ts +1 -0
  10. package/dist/adapt/textStream.js +24 -7
  11. package/dist/adapt/toolCards.d.ts +27 -5
  12. package/dist/adapt/toolCards.js +39 -6
  13. package/dist/adapt/wireShapes.js +6 -2
  14. package/dist/adapt.d.ts +2 -0
  15. package/dist/adapt.js +8 -3
  16. package/dist/adapter/activeRunSelfHeal.d.ts +5 -0
  17. package/dist/adapter/activeRunSelfHeal.js +51 -28
  18. package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
  19. package/dist/adapter/downstream/eventToSdkMessage.js +27 -34
  20. package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
  21. package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
  22. package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
  23. package/dist/adapter/runStream.js +29 -13
  24. package/dist/adapter/types.d.ts +4 -4
  25. package/dist/agentSession/backgroundView.js +2 -1
  26. package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
  27. package/dist/agentSession/engineAgentRegistryRead.js +12 -13
  28. package/dist/agentsWireCaps.d.ts +8 -8
  29. package/dist/agentsWireCaps.js +168 -175
  30. package/dist/approvalDecidedByCapability.d.ts +0 -4
  31. package/dist/approvalDecidedByCapability.js +0 -6
  32. package/dist/approvalsStreamLiveCapability.d.ts +0 -4
  33. package/dist/approvalsStreamLiveCapability.js +0 -6
  34. package/dist/assistantInbox.d.ts +34 -0
  35. package/dist/assistantInbox.js +118 -0
  36. package/dist/centerWiringCapability.js +9 -1
  37. package/dist/clientSlice.d.ts +0 -9
  38. package/dist/clientSlice.js +0 -3
  39. package/dist/cloudConfigWireCaps.d.ts +4 -2
  40. package/dist/cloudConfigWireCaps.js +81 -61
  41. package/dist/compensations.js +1 -1
  42. package/dist/connectorStatus.d.ts +21 -0
  43. package/dist/connectorStatus.js +112 -0
  44. package/dist/controlRouter.d.ts +14 -1
  45. package/dist/controlRouter.js +68 -17
  46. package/dist/coreValuePorts.d.ts +3 -3
  47. package/dist/decideReceipt.d.ts +2 -2
  48. package/dist/decideReceipt.js +5 -2
  49. package/dist/declared/supportFloorDeclared.js +3 -3
  50. package/dist/deviceExecutorManagementCapability.d.ts +0 -4
  51. package/dist/deviceExecutorManagementCapability.js +0 -6
  52. package/dist/deviceRebind.d.ts +49 -1
  53. package/dist/deviceRebind.js +221 -3
  54. package/dist/displayUntrusted.d.ts +1 -0
  55. package/dist/displayUntrusted.js +250 -76
  56. package/dist/engineAgentAbsence.d.ts +1 -1
  57. package/dist/engineAgentPanelStore.d.ts +5 -4
  58. package/dist/engineAgentPanelStore.js +3 -12
  59. package/dist/engineCapReader.d.ts +0 -4
  60. package/dist/engineCapReader.js +1 -5
  61. package/dist/engineCapsCache.d.ts +4 -0
  62. package/dist/engineCapsCache.js +17 -12
  63. package/dist/engineClosedSets.d.ts +1 -0
  64. package/dist/engineClosedSets.js +4 -1
  65. package/dist/engineErrorCodes.d.ts +9 -2
  66. package/dist/engineErrorCodes.js +9 -1
  67. package/dist/engineIdentity.d.ts +1 -0
  68. package/dist/engineIdentity.js +8 -0
  69. package/dist/engineRowRef.d.ts +28 -0
  70. package/dist/engineRowRef.js +111 -0
  71. package/dist/engineSessionMessages.d.ts +67 -0
  72. package/dist/engineSessionMessages.js +364 -0
  73. package/dist/engineToolDirectory.d.ts +0 -9
  74. package/dist/engineToolDirectory.js +1 -94
  75. package/dist/engineUrl.d.ts +18 -0
  76. package/dist/engineUrl.js +52 -0
  77. package/dist/env/uiLanguage.d.ts +9 -0
  78. package/dist/env/uiLanguage.js +35 -0
  79. package/dist/eventLeg.d.ts +92 -0
  80. package/dist/eventLeg.js +285 -0
  81. package/dist/executionLaneCapability.d.ts +0 -4
  82. package/dist/executionLaneCapability.js +3 -16
  83. package/dist/fileHistoryCaptureCapability.d.ts +0 -4
  84. package/dist/fileHistoryCaptureCapability.js +5 -7
  85. package/dist/fleet/fleetLedger.d.ts +0 -3
  86. package/dist/fleet/fleetLedger.js +21 -36
  87. package/dist/fleet/fleetProjection.d.ts +2 -2
  88. package/dist/fleet/fleetProjection.js +10 -8
  89. package/dist/frameBinding.d.ts +5 -0
  90. package/dist/frameBinding.js +23 -0
  91. package/dist/gateFailureCodes.d.ts +2 -0
  92. package/dist/gateFailureCodes.js +15 -0
  93. package/dist/gateOutcome.d.ts +3 -1
  94. package/dist/gateOutcome.js +25 -6
  95. package/dist/gateVocabulary.d.ts +5 -0
  96. package/dist/gateVocabulary.js +64 -2
  97. package/dist/generated/engineAskFaceTables.js +2 -2
  98. package/dist/generated/engineFactTables.d.ts +6 -3
  99. package/dist/generated/engineFactTables.js +22 -4
  100. package/dist/generated/engineNoticeTables.js +9 -0
  101. package/dist/generated/toolNameTables.d.ts +1 -0
  102. package/dist/generated/toolNameTables.js +1 -0
  103. package/dist/hitl/allowRuleShadow.d.ts +6 -1
  104. package/dist/hitl/allowRuleShadow.js +21 -17
  105. package/dist/hitl/approvalCardReading.d.ts +15 -0
  106. package/dist/hitl/approvalCardReading.js +154 -0
  107. package/dist/hitl/approvalCardReasons.d.ts +13 -0
  108. package/dist/hitl/approvalCardReasons.js +120 -0
  109. package/dist/hitl/approvalHolds.d.ts +47 -15
  110. package/dist/hitl/approvalHolds.js +134 -28
  111. package/dist/hitl/approvalResolution.d.ts +51 -26
  112. package/dist/hitl/approvalResolution.js +86 -122
  113. package/dist/hitl/approvalsFeed.js +6 -18
  114. package/dist/hitl/askClassPair.d.ts +2 -0
  115. package/dist/hitl/askClassPair.js +1 -0
  116. package/dist/hitl/askGateWire.d.ts +20 -2
  117. package/dist/hitl/askGateWire.js +49 -1
  118. package/dist/hitl/askParkRowRouting.d.ts +5 -0
  119. package/dist/hitl/askParkRowRouting.js +32 -1
  120. package/dist/hitl/askSettlementLine.d.ts +18 -0
  121. package/dist/hitl/askSettlementLine.js +79 -0
  122. package/dist/hitl/automaticAnswerVerdict.d.ts +1 -1
  123. package/dist/hitl/automaticAnswerVerdict.js +21 -5
  124. package/dist/hitl/crashConverged.d.ts +11 -20
  125. package/dist/hitl/crashConverged.js +56 -0
  126. package/dist/hitl/crashConvergedNotice.d.ts +3 -1
  127. package/dist/hitl/crashConvergedNotice.js +48 -11
  128. package/dist/hitl/decisionConflict.js +3 -10
  129. package/dist/hitl/decisionRefusal.d.ts +40 -1
  130. package/dist/hitl/decisionRefusal.js +199 -42
  131. package/dist/hitl/frameRouter.d.ts +5 -2
  132. package/dist/hitl/frameRouter.js +20 -16
  133. package/dist/hitl/gateLedger.d.ts +2 -0
  134. package/dist/hitl/gateLedger.js +50 -13
  135. package/dist/hitl/hitlBridge.d.ts +1 -2
  136. package/dist/hitl/hitlBridge.js +10 -7
  137. package/dist/hitl/livePendingAsk.d.ts +3 -3
  138. package/dist/hitl/livePendingAsk.js +7 -18
  139. package/dist/hitl/parkResolver.d.ts +2 -24
  140. package/dist/hitl/parkResolver.js +61 -97
  141. package/dist/hitl/persistedRulesWire.d.ts +24 -0
  142. package/dist/hitl/persistedRulesWire.js +122 -2
  143. package/dist/hitl/planReviewWire.d.ts +26 -13
  144. package/dist/hitl/planReviewWire.js +112 -78
  145. package/dist/hitl/refusedToolNameProse.d.ts +0 -1
  146. package/dist/hitl/refusedToolNameProse.js +0 -3
  147. package/dist/hitl/replayedApproval.d.ts +4 -3
  148. package/dist/hitl/replayedApproval.js +7 -4
  149. package/dist/hitl/sessionPolicyDeliverable.js +2 -4
  150. package/dist/hitl/sessionPolicyWire.d.ts +32 -20
  151. package/dist/hitl/sessionPolicyWire.js +162 -52
  152. package/dist/hitl/standingRows.d.ts +20 -2
  153. package/dist/hitl/standingRows.js +69 -8
  154. package/dist/hitl/toolApprovalWire.d.ts +87 -152
  155. package/dist/hitl/toolApprovalWire.js +591 -380
  156. package/dist/hookMatcherVerdict.d.ts +6 -1
  157. package/dist/hookMatcherVerdict.js +14 -7
  158. package/dist/hooksWireCaps.d.ts +2 -2
  159. package/dist/hooksWireCaps.js +59 -55
  160. package/dist/i18n/messages.en.d.ts +121 -0
  161. package/dist/i18n/messages.en.js +119 -0
  162. package/dist/i18n/messages.zh.d.ts +3 -0
  163. package/dist/i18n/messages.zh.js +120 -0
  164. package/dist/i18n/translate.d.ts +25 -0
  165. package/dist/i18n/translate.js +127 -0
  166. package/dist/index.d.ts +53 -20
  167. package/dist/index.js +38 -11
  168. package/dist/inheritEnvCapability.d.ts +31 -0
  169. package/dist/inheritEnvCapability.js +104 -0
  170. package/dist/liveModelCatalog.d.ts +1 -2
  171. package/dist/liveModelCatalog.js +2 -6
  172. package/dist/liveQuestionStore.d.ts +2 -21
  173. package/dist/mcpLiveness.d.ts +2 -1
  174. package/dist/mcpProbeWire.d.ts +6 -1
  175. package/dist/mcpProbeWire.js +1 -1
  176. package/dist/mcpWireCaps.d.ts +13 -2
  177. package/dist/mcpWireCaps.js +48 -0
  178. package/dist/memoryEntriesWire.d.ts +4 -9
  179. package/dist/model/modelSupplyRules.d.ts +0 -2
  180. package/dist/model/modelSupplyRules.js +3 -12
  181. package/dist/model/modelsPolicy.d.ts +0 -5
  182. package/dist/model/modelsPolicy.js +6 -36
  183. package/dist/model/subagentModelWord.d.ts +31 -0
  184. package/dist/model/subagentModelWord.js +261 -0
  185. package/dist/notifications.d.ts +6 -0
  186. package/dist/notifications.js +71 -23
  187. package/dist/outputStyleSeatCapability.d.ts +0 -3
  188. package/dist/outputStyleSeatCapability.js +0 -3
  189. package/dist/ownKey.d.ts +15 -0
  190. package/dist/ownKey.js +60 -3
  191. package/dist/panelReduce.d.ts +15 -9
  192. package/dist/panelReduce.js +680 -549
  193. package/dist/panelStateHolder.d.ts +3 -7
  194. package/dist/panelStateHolder.js +14 -130
  195. package/dist/peerLaneCapability.d.ts +0 -4
  196. package/dist/peerLaneCapability.js +0 -6
  197. package/dist/permissionRulesWriteCapability.d.ts +0 -4
  198. package/dist/permissionRulesWriteCapability.js +0 -6
  199. package/dist/permissionWireCaps.d.ts +2 -2
  200. package/dist/permissionWireCaps.js +2 -0
  201. package/dist/permissionsAllowGrantCapability.d.ts +0 -4
  202. package/dist/permissionsAllowGrantCapability.js +0 -6
  203. package/dist/permissionsDeclaration.d.ts +0 -11
  204. package/dist/permissionsDeclaration.js +60 -53
  205. package/dist/pluginHooksWire.d.ts +1 -1
  206. package/dist/pluginHooksWire.js +3 -6
  207. package/dist/preemptWire.d.ts +44 -0
  208. package/dist/preemptWire.js +83 -0
  209. package/dist/printToolResultFrame.js +15 -4
  210. package/dist/replayBody.d.ts +3 -0
  211. package/dist/replayBody.js +14 -0
  212. package/dist/request/taskRequest.d.ts +0 -1
  213. package/dist/request/taskRequest.js +0 -3
  214. package/dist/resumeRefusalCopy.d.ts +2 -1
  215. package/dist/resumeRefusalCopy.js +38 -2
  216. package/dist/retryStatus.d.ts +8 -0
  217. package/dist/retryStatus.js +106 -1
  218. package/dist/rewindArchiveCapability.d.ts +0 -4
  219. package/dist/rewindArchiveCapability.js +2 -10
  220. package/dist/rewindArchiveReading.d.ts +0 -1
  221. package/dist/rewindArchiveReading.js +0 -3
  222. package/dist/runCancelContext.d.ts +2 -1
  223. package/dist/runCancelContext.js +4 -2
  224. package/dist/runReattachPolicy.d.ts +31 -0
  225. package/dist/runReattachPolicy.js +46 -0
  226. package/dist/runTerminal.d.ts +3 -6
  227. package/dist/runTerminal.js +8 -9
  228. package/dist/sandboxWire.d.ts +3 -1
  229. package/dist/sandboxWire.js +76 -27
  230. package/dist/scenarioWire.js +1 -1
  231. package/dist/seam.d.ts +24 -2
  232. package/dist/seam.js +15 -3
  233. package/dist/seatContract.d.ts +53 -10
  234. package/dist/seatContract.js +132 -81
  235. package/dist/sessionPolicyCapability.d.ts +0 -4
  236. package/dist/sessionPolicyCapability.js +0 -6
  237. package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
  238. package/dist/sessionSyncFileHistoryCapability.js +0 -3
  239. package/dist/skillToolListsCapability.d.ts +0 -3
  240. package/dist/skillToolListsCapability.js +0 -3
  241. package/dist/sqlEngineCapability.d.ts +0 -4
  242. package/dist/sqlEngineCapability.js +0 -6
  243. package/dist/steerPriorityCapability.d.ts +0 -3
  244. package/dist/steerPriorityCapability.js +0 -3
  245. package/dist/streamDrainingLegs.d.ts +4 -0
  246. package/dist/streamDrainingLegs.js +6 -1
  247. package/dist/subagent/engineCompactWire.d.ts +0 -1
  248. package/dist/subagent/engineCompactWire.js +7 -5
  249. package/dist/subagent/engineTaskHandleWire.js +4 -7
  250. package/dist/subagentContentStore.js +1 -11
  251. package/dist/submitReopen.d.ts +24 -0
  252. package/dist/submitReopen.js +75 -0
  253. package/dist/terminalStatuses.d.ts +3 -0
  254. package/dist/terminalStatuses.js +10 -2
  255. package/dist/toolResult.d.ts +10 -1
  256. package/dist/toolResult.js +34 -6
  257. package/dist/toolRoster.d.ts +0 -2
  258. package/dist/toolRoster.js +0 -2
  259. package/dist/turnFailurePresentation.d.ts +28 -0
  260. package/dist/turnFailurePresentation.js +205 -0
  261. package/dist/userInvokedSkillsCapability.d.ts +0 -3
  262. package/dist/userInvokedSkillsCapability.js +0 -3
  263. package/dist/webSearchBackendCapability.d.ts +0 -4
  264. package/dist/webSearchBackendCapability.js +0 -6
  265. package/dist/wireErrorTriage.js +5 -24
  266. package/dist/wireFailureShape.d.ts +62 -5
  267. package/dist/wireFailureShape.js +105 -5
  268. package/dist/wireRefusalCopy.d.ts +12 -2
  269. package/dist/wireRefusalCopy.js +50 -52
  270. package/dist/workflowsJournalCapability.d.ts +0 -4
  271. package/dist/workflowsJournalCapability.js +0 -6
  272. package/dist/writeProtectionCapability.d.ts +0 -4
  273. package/dist/writeProtectionCapability.js +0 -6
  274. package/docs/INTEGRATION-CLIENTS.md +1253 -46
  275. package/package.json +5 -4
  276. package/dist/attachmentSeatCapability.d.ts +0 -12
  277. package/dist/attachmentSeatCapability.js +0 -23
  278. package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
  279. package/dist/hitl/approvalOutcomeNote.js +0 -29
  280. package/dist/sessionReadRedactionCapability.d.ts +0 -13
  281. package/dist/sessionReadRedactionCapability.js +0 -35
@@ -1,52 +1,18 @@
1
- import { type GateCurrentPending, type HitlFailureStage, type HitlSafetyCode, type HitlClientLike, type DecideOperationObserver } from './hitlBridge.js';
2
- import { type AllowRuleShadowedWireMember, type ApprovalAllowRuleShadow } from './allowRuleShadow.js';
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, ApprovalSettleCause, ToolApprovalRespondAck, PersistedRuleAnchor as SdkPersistedRuleAnchor, RuleOfferMatch as SdkRuleOfferMatch, RuleOfferBatchMember as SdkRuleOfferBatchMember, RuleOfferUncoveredDetail as SdkRuleOfferUncoveredDetail, RuleOfferUncoveredReason as SdkRuleOfferUncoveredReason, AskOrigin as SdkAskOrigin, RuleOffersAbsence as SdkRuleOffersAbsence, DenialLimitKind as SdkDenialLimitKind, DenialLimitFallback as SdkDenialLimitFallback, ToolApprovalCardWord } from '@sema-agent/sdk';
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 = SdkRuleOfferMatch;
58
- export type RuleOfferBatchMember = SdkRuleOfferBatchMember;
59
- export type RuleOfferUncoveredDetail = SdkRuleOfferUncoveredDetail;
60
- export type RuleOfferUncoveredReason = SdkRuleOfferUncoveredReason;
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 = SdkAskOrigin;
63
- export type RuleOffersAbsence = SdkRuleOffersAbsence;
64
- export type DenialLimitKind = SdkDenialLimitKind;
65
- export type DenialLimitFallback = SdkDenialLimitFallback;
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 WireRuleOffer = {
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
- rule: string;
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?: RuleOffer[];
133
- ruleOffersReadOnly?: RuleOffer[];
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<FsApprovalOutcome>;
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 interface ToolApprovalFrame {
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 = 'allow' | 'allow_session' | 'deny';
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 type PersistedRuleAnchor = SdkPersistedRuleAnchor;
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): RuleOffer[] | undefined;
331
- export declare function readRuleOfferSupply(offers: unknown): RuleOffer[] | undefined;
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<ToolApprovalFrameOutcome>;
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: ToolApprovalFrameOutcome;
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';