@sema-agent/client-core 0.94.0 → 0.95.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 (255) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/README.md +70 -47
  3. package/dist/adapt/arms.js +5 -6
  4. package/dist/adapt/panelTasks.js +4 -10
  5. package/dist/adapt/toolCards.js +2 -2
  6. package/dist/adapt/wireShapes.js +3 -8
  7. package/dist/adapter/activeRunSelfHeal.d.ts +8 -3
  8. package/dist/adapter/activeRunSelfHeal.js +20 -12
  9. package/dist/adapter/downstream/eventToSdkMessage.js +24 -17
  10. package/dist/adapter/downstream/terminalToSdkResult.js +11 -3
  11. package/dist/adapter/runStream.js +2 -1
  12. package/dist/adapter/types.d.ts +7 -0
  13. package/dist/adapter/types.js +15 -0
  14. package/dist/agentSession/backgroundView.js +5 -1
  15. package/dist/agentSession/engineAgentRegistryRead.js +2 -1
  16. package/dist/agentSession/engineSessionBackgroundStop.js +3 -2
  17. package/dist/agentsWireCaps.d.ts +2 -0
  18. package/dist/approvalDecidedByCapability.d.ts +0 -1
  19. package/dist/approvalDecidedByCapability.js +2 -7
  20. package/dist/approvalsStreamLiveCapability.d.ts +0 -1
  21. package/dist/approvalsStreamLiveCapability.js +2 -6
  22. package/dist/atMostOnce.d.ts +8 -0
  23. package/dist/atMostOnce.js +36 -0
  24. package/dist/attachmentSeatCapability.d.ts +0 -1
  25. package/dist/attachmentSeatCapability.js +0 -3
  26. package/dist/attachmentsWireCaps.js +11 -6
  27. package/dist/bashExitReading.d.ts +10 -0
  28. package/dist/bashExitReading.js +12 -0
  29. package/dist/callerCwdCapability.d.ts +0 -1
  30. package/dist/callerCwdCapability.js +2 -7
  31. package/dist/centerWiringCapability.d.ts +1 -3
  32. package/dist/centerWiringCapability.js +18 -21
  33. package/dist/classifierStatus.js +4 -4
  34. package/dist/cloudConfigWireCaps.js +43 -21
  35. package/dist/compensations.js +1 -1
  36. package/dist/cycleOrder.d.ts +15 -0
  37. package/dist/cycleOrder.js +45 -0
  38. package/dist/decideFailureNote.js +4 -1
  39. package/dist/decideReceipt.d.ts +2 -1
  40. package/dist/decideReceipt.js +41 -13
  41. package/dist/declared/supportFloorDeclared.d.ts +1 -0
  42. package/dist/declared/supportFloorDeclared.js +5 -0
  43. package/dist/deviceExecutorManagementCapability.d.ts +0 -1
  44. package/dist/deviceExecutorManagementCapability.js +7 -16
  45. package/dist/deviceRebind.d.ts +88 -0
  46. package/dist/deviceRebind.js +242 -0
  47. package/dist/displayUntrusted.d.ts +1 -0
  48. package/dist/displayUntrusted.js +313 -11
  49. package/dist/engineAgentAbsence.d.ts +2 -2
  50. package/dist/engineAgentPanelStore.d.ts +8 -18
  51. package/dist/engineAgentPanelStore.js +19 -537
  52. package/dist/engineCapReader.d.ts +6 -6
  53. package/dist/engineCapReader.js +30 -43
  54. package/dist/engineCapsCache.d.ts +7 -2
  55. package/dist/engineCapsCache.js +64 -26
  56. package/dist/engineCredentialRequirement.d.ts +9 -0
  57. package/dist/engineCredentialRequirement.js +23 -0
  58. package/dist/engineEnvSourcing.d.ts +53 -0
  59. package/dist/engineEnvSourcing.js +81 -0
  60. package/dist/engineErrorCodes.d.ts +14 -3
  61. package/dist/engineErrorCodes.js +31 -10
  62. package/dist/engineIdentity.js +2 -0
  63. package/dist/engineWireSdk.js +2 -2
  64. package/dist/executionLaneCapability.d.ts +2 -3
  65. package/dist/executionLaneCapability.js +18 -23
  66. package/dist/fileHistoryCaptureCapability.d.ts +0 -1
  67. package/dist/fileHistoryCaptureCapability.js +2 -6
  68. package/dist/fileHistoryLegNotice.d.ts +3 -2
  69. package/dist/fileHistoryLegNotice.js +51 -2
  70. package/dist/fleet/fleetLedger.d.ts +2 -0
  71. package/dist/fleet/fleetLedger.js +69 -52
  72. package/dist/fleet/fleetProjection.d.ts +0 -3
  73. package/dist/fleet/fleetProjection.js +9 -16
  74. package/dist/fleetAgentPanelProjection.d.ts +4 -17
  75. package/dist/fleetAgentPanelProjection.js +7 -197
  76. package/dist/fleetAgentRowLike.d.ts +16 -0
  77. package/dist/fleetAgentRowLike.js +1 -0
  78. package/dist/gateOutcome.js +30 -18
  79. package/dist/generated/sdkFactTables.d.ts +2 -0
  80. package/dist/generated/sdkFactTables.js +17 -0
  81. package/dist/generated/settingsSchemaFns.d.ts +10 -0
  82. package/dist/generated/settingsSchemaFns.js +22 -0
  83. package/dist/headlessPermissionModeWire.d.ts +1 -1
  84. package/dist/headlessPermissionModeWire.js +1 -1
  85. package/dist/headlessReconnectWire.js +49 -20
  86. package/dist/hitl/allowRuleShadow.d.ts +1 -1
  87. package/dist/hitl/allowRuleShadow.js +49 -8
  88. package/dist/hitl/approvalCompleteParked.d.ts +1 -0
  89. package/dist/hitl/approvalCompleteParked.js +14 -0
  90. package/dist/hitl/approvalEndingCause.d.ts +5 -0
  91. package/dist/hitl/approvalEndingCause.js +61 -0
  92. package/dist/hitl/approvalHolds.d.ts +12 -2
  93. package/dist/hitl/approvalHolds.js +53 -2
  94. package/dist/hitl/approvalsFeed.js +23 -11
  95. package/dist/hitl/askGateWire.d.ts +2 -1
  96. package/dist/hitl/askGateWire.js +26 -1
  97. package/dist/hitl/automaticAnswerVerdict.js +2 -2
  98. package/dist/hitl/crashConverged.js +2 -0
  99. package/dist/hitl/decisionConflict.d.ts +3 -0
  100. package/dist/hitl/decisionConflict.js +43 -0
  101. package/dist/hitl/decisionRefusal.d.ts +4 -0
  102. package/dist/hitl/decisionRefusal.js +26 -1
  103. package/dist/hitl/frameRouter.js +26 -43
  104. package/dist/hitl/gateLedger.d.ts +5 -0
  105. package/dist/hitl/gateLedger.js +21 -0
  106. package/dist/hitl/hitlBridge.d.ts +12 -1
  107. package/dist/hitl/hitlBridge.js +68 -53
  108. package/dist/hitl/hitlHostSurface.js +3 -11
  109. package/dist/hitl/livePendingAsk.d.ts +16 -6
  110. package/dist/hitl/livePendingAsk.js +36 -4
  111. package/dist/hitl/parkExpiryJudgements.d.ts +19 -0
  112. package/dist/hitl/parkExpiryJudgements.js +46 -0
  113. package/dist/hitl/parkResolver.d.ts +3 -7
  114. package/dist/hitl/parkResolver.js +50 -26
  115. package/dist/hitl/persistedRulesWire.js +5 -1
  116. package/dist/hitl/planReviewWire.d.ts +2 -2
  117. package/dist/hitl/planReviewWire.js +56 -30
  118. package/dist/hitl/replayedApproval.d.ts +8 -0
  119. package/dist/hitl/replayedApproval.js +125 -10
  120. package/dist/hitl/resumeRunningCard.d.ts +2 -0
  121. package/dist/hitl/resumeRunningCard.js +15 -4
  122. package/dist/hitl/toolApprovalWire.d.ts +24 -4
  123. package/dist/hitl/toolApprovalWire.js +115 -38
  124. package/dist/hooksWireCaps.js +38 -6
  125. package/dist/host.d.ts +5 -0
  126. package/dist/host.js +3 -1
  127. package/dist/hostCallbackGuard.d.ts +1 -0
  128. package/dist/hostCallbackGuard.js +25 -0
  129. package/dist/index.d.ts +30 -11
  130. package/dist/index.js +20 -8
  131. package/dist/interactiveInterrupt.d.ts +8 -0
  132. package/dist/interactiveInterrupt.js +54 -0
  133. package/dist/limitsWire.d.ts +5 -0
  134. package/dist/limitsWire.js +49 -3
  135. package/dist/liveModelCatalog.d.ts +95 -0
  136. package/dist/liveModelCatalog.js +297 -32
  137. package/dist/mcpEngineLeg.d.ts +25 -0
  138. package/dist/mcpEngineLeg.js +71 -15
  139. package/dist/mcpPanel.js +2 -1
  140. package/dist/mcpProbeCapability.d.ts +0 -1
  141. package/dist/mcpProbeCapability.js +2 -6
  142. package/dist/mcpReconnect.d.ts +1 -3
  143. package/dist/mcpReconnect.js +10 -5
  144. package/dist/memoryComplianceCapability.d.ts +0 -1
  145. package/dist/memoryComplianceCapability.js +2 -6
  146. package/dist/memoryOriginCapability.d.ts +0 -1
  147. package/dist/memoryOriginCapability.js +2 -6
  148. package/dist/memoryVerbsWire.d.ts +1 -1
  149. package/dist/memoryVerbsWire.js +4 -0
  150. package/dist/model/liveCatalogShape.d.ts +14 -0
  151. package/dist/model/liveCatalogShape.js +71 -0
  152. package/dist/model/modelSupplyRules.d.ts +1 -0
  153. package/dist/model/modelSupplyRules.js +30 -9
  154. package/dist/model/modelsPolicy.d.ts +21 -0
  155. package/dist/model/modelsPolicy.js +90 -0
  156. package/dist/modelIdentityResolvability.d.ts +1 -1
  157. package/dist/modelIdentityResolvability.js +5 -12
  158. package/dist/modelSwitchFallback.d.ts +69 -0
  159. package/dist/modelSwitchFallback.js +206 -0
  160. package/dist/notifications.js +12 -11
  161. package/dist/outputStyleSeatCapability.d.ts +0 -1
  162. package/dist/outputStyleSeatCapability.js +2 -7
  163. package/dist/ownKey.d.ts +6 -0
  164. package/dist/ownKey.js +48 -0
  165. package/dist/panelReduce.d.ts +114 -0
  166. package/dist/panelReduce.js +1135 -0
  167. package/dist/panelStateHolder.d.ts +17 -0
  168. package/dist/panelStateHolder.js +201 -0
  169. package/dist/peerLaneCapability.d.ts +0 -1
  170. package/dist/peerLaneCapability.js +2 -6
  171. package/dist/permissionModesCapability.d.ts +0 -1
  172. package/dist/permissionModesCapability.js +5 -10
  173. package/dist/permissionRulesWriteCapability.d.ts +0 -1
  174. package/dist/permissionRulesWriteCapability.js +2 -6
  175. package/dist/permissionsAllowGrantCapability.d.ts +0 -1
  176. package/dist/permissionsAllowGrantCapability.js +3 -9
  177. package/dist/permissionsDeclaration.d.ts +6 -0
  178. package/dist/permissionsDeclaration.js +45 -0
  179. package/dist/printToolResultFrame.js +2 -10
  180. package/dist/promptDelivery.js +0 -8
  181. package/dist/resumeRefusalCopy.d.ts +18 -1
  182. package/dist/resumeRefusalCopy.js +126 -15
  183. package/dist/rewindArchiveCapability.d.ts +2 -1
  184. package/dist/rewindArchiveCapability.js +15 -7
  185. package/dist/rewindEngineAction.d.ts +21 -0
  186. package/dist/rewindEngineAction.js +36 -0
  187. package/dist/rewindWireCaps.d.ts +2 -1
  188. package/dist/rewindWireCaps.js +1 -0
  189. package/dist/runTerminal.d.ts +0 -11
  190. package/dist/runTerminal.js +4 -27
  191. package/dist/sdkRegistryTransit.d.ts +2 -1
  192. package/dist/sdkRegistryTransit.js +1 -0
  193. package/dist/sealedKeyCapability.d.ts +0 -1
  194. package/dist/sealedKeyCapability.js +3 -9
  195. package/dist/seatContract.d.ts +54 -25
  196. package/dist/seatContract.js +394 -171
  197. package/dist/sessionIdSegment.d.ts +1 -0
  198. package/dist/sessionIdSegment.js +11 -0
  199. package/dist/sessionMemoryErase.d.ts +1 -1
  200. package/dist/sessionMemoryErase.js +6 -1
  201. package/dist/sessionMemoryStatus.js +3 -2
  202. package/dist/sessionPolicyCapability.d.ts +0 -1
  203. package/dist/sessionPolicyCapability.js +2 -6
  204. package/dist/sessionReadRedactionCapability.d.ts +0 -1
  205. package/dist/sessionReadRedactionCapability.js +2 -7
  206. package/dist/sessionSyncFileHistoryCapability.d.ts +0 -1
  207. package/dist/sessionSyncFileHistoryCapability.js +2 -6
  208. package/dist/skillToolListsCapability.d.ts +0 -1
  209. package/dist/skillToolListsCapability.js +2 -6
  210. package/dist/skillsWireCaps.d.ts +4 -0
  211. package/dist/skillsWireCaps.js +66 -1
  212. package/dist/sqlEngineCapability.d.ts +0 -1
  213. package/dist/sqlEngineCapability.js +9 -14
  214. package/dist/steerPriorityCapability.d.ts +0 -1
  215. package/dist/steerPriorityCapability.js +3 -9
  216. package/dist/storePostureCapability.d.ts +1 -1
  217. package/dist/storePostureCapability.js +16 -16
  218. package/dist/streamDrainingLegs.d.ts +6 -0
  219. package/dist/streamDrainingLegs.js +23 -0
  220. package/dist/subagent/engineCompactWire.js +13 -38
  221. package/dist/subagent/engineDelegatedPrompt.js +10 -6
  222. package/dist/subagent/engineSubagentOutput.d.ts +0 -1
  223. package/dist/subagent/engineSubagentOutput.js +5 -20
  224. package/dist/subagent/engineSubagentTail.d.ts +0 -1
  225. package/dist/subagent/engineSubagentTail.js +7 -32
  226. package/dist/subagentContentStore.js +3 -3
  227. package/dist/supportFloor.js +2 -5
  228. package/dist/terminalStatuses.d.ts +30 -0
  229. package/dist/terminalStatuses.js +67 -0
  230. package/dist/toolResult.d.ts +5 -0
  231. package/dist/toolResult.js +88 -36
  232. package/dist/types/engineState.d.ts +2 -1
  233. package/dist/usageAnalytics.d.ts +146 -0
  234. package/dist/usageAnalytics.js +311 -0
  235. package/dist/userInvokedSkillsCapability.d.ts +0 -1
  236. package/dist/userInvokedSkillsCapability.js +2 -6
  237. package/dist/webSearchBackendCapability.d.ts +0 -1
  238. package/dist/webSearchBackendCapability.js +3 -7
  239. package/dist/webSearchWireCaps.js +3 -11
  240. package/dist/wireFailureShape.d.ts +4 -0
  241. package/dist/wireFailureShape.js +42 -2
  242. package/dist/wireRefusalCopy.js +2 -18
  243. package/dist/workflowClient.js +7 -11
  244. package/dist/workflowsJournalCapability.d.ts +0 -1
  245. package/dist/workflowsJournalCapability.js +2 -6
  246. package/dist/writeProtectionCapability.d.ts +0 -1
  247. package/dist/writeProtectionCapability.js +5 -10
  248. package/docs/INTEGRATION-CLIENTS.md +1033 -26
  249. package/package.json +5 -5
  250. package/dist/engineCapsGenerationGuard.d.ts +0 -4
  251. package/dist/engineCapsGenerationGuard.js +0 -19
  252. package/dist/panelRunningHistory.d.ts +0 -22
  253. package/dist/panelRunningHistory.js +0 -82
  254. package/dist/registryConflict.d.ts +0 -3
  255. package/dist/registryConflict.js +0 -44
@@ -1,22 +1,22 @@
1
- import { APPROVAL_CARD_PORT_KEY_MISMATCH_REASON, DEFAULT_DENY_REASON, DecideTransportRetryExhaustedError, HitlBridge, NO_APPROVAL_CARD_PORT_REASON, HitlSafetyError, denyReasonForWire, findPendingForTask, readDecideCurrentPending, readWireErrorCode, } from './hitlBridge.js';
1
+ import { APPROVAL_CARD_PORT_KEY_MISMATCH_REASON, DEFAULT_DENY_REASON, DecideTransportRetryExhaustedError, HitlBridge, NO_APPROVAL_CARD_PORT_REASON, denyReasonForWire, findPendingForTask, hitlSafetyCodeOf, readDecideCurrentPending, readWireErrorCode, readWireErrorCodeReading, } from './hitlBridge.js';
2
2
  import { askParkRowArm } from './askParkRowRouting.js';
3
3
  import { hostLog } from '../host.js';
4
- import { readOwnDataNonEmptyString, readOwnDataValue, readOwnNonEmptyString } from '../ownKey.js';
4
+ import { readAskOrigin, readOwnDataNonEmptyString, readOwnDataValue, readOwnNonEmptyString } from '../ownKey.js';
5
5
  import { readAskClassPair } from './askClassPair.js';
6
- import { legacyShadowedRuleTextOf, readAllowRuleShadowFromWire } from './allowRuleShadow.js';
6
+ import { readAllowRuleShadowFromWire } from './allowRuleShadow.js';
7
7
  import { createSessionSlot, DEFAULT_SESSION_KEY } from '../sessionSlot.js';
8
8
  import { readEngineActiveBgTasks } from '../fleet/fleetLedger.js';
9
9
  import { INTERRUPT_DENY_REASON, observeCancelByDeny, surfaceApprovalParking, surfaceRememberNotApplied, surfaceEditNotForwarded, surfaceEditRefusedOnBlindAsk, surfaceRuleArmNotSent, surfaceRuleArmRejected } from './hitlHostSurface.js';
10
10
  import { approvalCallKey, liveFrameCallKey } from './gateIdentity.js';
11
11
  import { displayUntrusted } from '../displayUntrusted.js';
12
- import { approvalDecisionHolds, holdLiveCard, joinLiveCard, liveCardHoldOf } from './approvalHolds.js';
12
+ import { approvalDecisionHolds, awaitLiveCardHolder, holdLiveCard, joinLiveCard, liveCardHoldFor, liveCardHoldOf } from './approvalHolds.js';
13
13
  import { approvalResolutionOf } from './approvalResolution.js';
14
14
  import { isApprovalMandateWord } from '../gateVocabulary.js';
15
15
  import { denyAttributionRefusalFromError } from '../wireRefusalCopy.js';
16
16
  import { approvalDecidedByAdmitted } from '../approvalDecidedByCapability.js';
17
17
  import { decideFailureNote } from '../decideFailureNote.js';
18
- import { wireFailureTextsOf } from '../wireFailureShape.js';
19
- import { refusalSaysStillPending } from '../engineErrorCodes.js';
18
+ import { thrownIsInstanceOf, wireFailureTextsOf } from '../wireFailureShape.js';
19
+ import { DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED, refusalSaysStillPending } from '../engineErrorCodes.js';
20
20
  import { readDecideReceipt } from '../decideReceipt.js';
21
21
  import { RULE_OFFER_MATCHES, RULE_OFFER_BATCH_MEMBER_KINDS, RULE_OFFER_UNCOVERED_REASONS, RULE_OFFERS_ABSENCE_REASONS, ASK_ORIGINS, PERSISTED_RULE_MANDATES, } from '@sema-agent/sdk';
22
22
  export function isFsApprovalGate(gate) {
@@ -132,17 +132,26 @@ function cardPortMissReason() {
132
132
  return APPROVAL_CARD_PORT_KEY_MISMATCH_REASON;
133
133
  return NO_APPROVAL_CARD_PORT_REASON;
134
134
  }
135
- function rememberRefusedByServer(e) {
136
- switch (readWireErrorCode(e)) {
137
- case 'remember_not_in_proof':
138
- case 'remember_requires_binding':
139
- case 'capability.store_required':
140
- case 'decide.workflow_remember_unsupported':
141
- case 'decide.parked_remember_unsupported':
142
- return true;
143
- default:
144
- return false;
145
- }
135
+ const REMEMBER_REFUSAL_CODES = Object.freeze([
136
+ 'remember_not_in_proof',
137
+ 'remember_requires_binding',
138
+ 'capability.store_required',
139
+ DECIDE_WORKFLOW_REMEMBER_UNSUPPORTED,
140
+ 'decide.parked_remember_unsupported',
141
+ ]);
142
+ export function rememberRefusalOf(error) {
143
+ return rememberRefusalIn(readWireErrorCodeReading(error));
144
+ }
145
+ function rememberRefusalIn(reading) {
146
+ return reading.state === 'code' ? REMEMBER_REFUSAL_CODES.find((c) => c === reading.code) : undefined;
147
+ }
148
+ function rememberFallbackKind(e) {
149
+ const reading = readWireErrorCodeReading(e);
150
+ if (rememberRefusalIn(reading) !== undefined)
151
+ return 'refused';
152
+ if (reading.state !== 'absent')
153
+ return undefined;
154
+ return readToolApprovalRespondRefusal(e)?.status === 400 ? 'legacy' : undefined;
146
155
  }
147
156
  function logAfterDecided(msg) {
148
157
  try {
@@ -281,6 +290,13 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
281
290
  return { kind: 'failed', stage: 'fetch', reason: found.reason, ...(found.code !== undefined ? { code: found.code } : {}) };
282
291
  if (held !== undefined)
283
292
  return joinDurableDecision(held, deps, signal);
293
+ const liveHolder = liveCardHoldFor(parkRowHolderIdentity(found.pending, found.gatedCallId));
294
+ if (liveHolder !== undefined) {
295
+ const joined = await awaitLiveCardHolder(liveHolder, signal);
296
+ if (joined !== undefined)
297
+ return fsOutcomeOfJoinedLiveCard(joined, found.gatedCallId);
298
+ return surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signal, parkGatedCallId);
299
+ }
284
300
  const callKey = approvalCallKey(found.gatedCallId, taskId);
285
301
  const fetched = found;
286
302
  return holdDurableDecision(durableHoldKey(fetched.pending, callKey), signal, async (hold) => {
@@ -290,6 +306,33 @@ export async function surfaceFsApprovalAndDecide(deps, taskId, argsByCall, signa
290
306
  return out;
291
307
  });
292
308
  }
309
+ function parkRowHolderIdentity(row, gatedCallId) {
310
+ return {
311
+ ...(typeof row.taskId === 'string' && row.taskId !== '' ? { taskId: row.taskId } : {}),
312
+ ...(gatedCallId !== undefined && gatedCallId !== '' ? { toolCallId: gatedCallId } : {}),
313
+ ...(typeof row.sessionId === 'string' && row.sessionId !== '' ? { sessionId: row.sessionId } : {}),
314
+ };
315
+ }
316
+ function fsOutcomeOfJoinedLiveCard(o, gatedCallId) {
317
+ if (o.aborted === true)
318
+ return { kind: 'aborted', gatedCallId, joinedInFlight: true };
319
+ if (o.decision === 'unresolved')
320
+ return { kind: 'retracted', gatedCallId, joinedInFlight: true };
321
+ return {
322
+ kind: 'decided',
323
+ gatedCallId,
324
+ ...(o.decision === 'deny'
325
+ ? {
326
+ denied: true,
327
+ ...(o.denySettledBy !== undefined ? { denySettledBy: o.denySettledBy } : {}),
328
+ ...(o.denyReason !== undefined ? { denyReason: o.denyReason } : {}),
329
+ }
330
+ : {}),
331
+ ...(o.denyAttributionDropped === true ? { denyAttributionDropped: true } : {}),
332
+ ...(o.denyAttributionRenamed === true ? { denyAttributionRenamed: true } : {}),
333
+ joinedInFlight: true,
334
+ };
335
+ }
293
336
  async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, found, decidedByReading, callKey, hold, ledgerSlot) {
294
337
  const { pending, gatedCallId } = found;
295
338
  const toolName = typeof pending.toolName === 'string' ? pending.toolName : '';
@@ -329,16 +372,15 @@ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, foun
329
372
  ...(pending.requiresRealApproval === true ? { requiresRealApproval: true } : {}),
330
373
  ...(hasOwnStrictTrue(pending, 'mandated') ? { mandated: true } : {}),
331
374
  ...((w) => (w !== undefined ? { mandate: w } : {}))(readApprovalMandate(pending)),
332
- ...((o) => (o !== undefined ? { origin: o } : {}))(readOwnNonEmptyString(pending, 'origin')),
375
+ ...((o) => (o !== undefined ? { origin: o } : {}))(readAskOrigin(pending)),
333
376
  ...(readAskClassPair(pending) ?? {}),
334
377
  ...(pending.gateKind === 'irreversible_ask' ? { irreversibleParkGate: true } : {}),
335
378
  ...(pending.hasBidiControls === true ? { hasBidiControls: true } : {}),
336
379
  ...(ruleOffersReadOnly !== undefined ? { ruleOffersReadOnly } : {}),
337
380
  ...(isWireRecordCarrier(durableProbeCause) ? { probeCause: durableProbeCause } : {}),
338
381
  ...(durableProbeReason !== undefined ? { probeReason: durableProbeReason } : {}),
339
- ...(readRememberRefused(pending) ? { rememberRefused: true } : {}),
382
+ ...(readApprovalRememberRefused(pending) ? { rememberRefused: true } : {}),
340
383
  ...(durableShadow !== undefined ? { allowRuleShadow: durableShadow } : {}),
341
- ...((t) => (t !== undefined ? { persistedRuleShadowed: t } : {}))(legacyShadowedRuleTextOf(durableShadow)),
342
384
  ...(typeof durableRuleOffersAbsence === 'string' && durableRuleOffersAbsence !== ''
343
385
  ? { ruleOffersAbsence: durableRuleOffersAbsence }
344
386
  : {}),
@@ -379,12 +421,11 @@ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, foun
379
421
  sessionDecided = true;
380
422
  }
381
423
  catch (e) {
382
- if (e instanceof HitlSafetyError || e instanceof DecideTransportRetryExhaustedError)
383
- throw e;
384
- if (readDecideCurrentPending(e) !== undefined)
424
+ const fallbackKind = rememberFallbackKind(e);
425
+ if (fallbackKind === undefined)
385
426
  throw e;
386
- rememberRefused = rememberRefusedByServer(e);
387
- logAfterDecided(`liveToolApprovalWire: decide(approve+remember) failed (${String(e)}) — falling back to plain approve`);
427
+ rememberRefused = fallbackKind === 'refused';
428
+ logAfterDecided(`liveToolApprovalWire: decide(approve+remember) refused the remember part (${String(e)}) — falling back to plain approve`);
388
429
  }
389
430
  if (sessionDecided) {
390
431
  if (sessionReceipt?.rememberApplied === false)
@@ -402,7 +443,7 @@ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, foun
402
443
  const currentPending = readDecideCurrentPending(e);
403
444
  const wireCode = readWireErrorCode(e);
404
445
  const wireRetriable = typeof e === 'object' && e !== null && refusalSaysStillPending(e);
405
- const safetyCode = e instanceof HitlSafetyError ? e.code : undefined;
446
+ const safetyCode = hitlSafetyCodeOf(e);
406
447
  const failureTexts = wireFailureTextsOf(e);
407
448
  hostLog('debug', `liveToolApprovalWire: decide(approve) failed: ${failureTexts.log}`);
408
449
  return {
@@ -410,7 +451,7 @@ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, foun
410
451
  stage: 'decide',
411
452
  gatedCallId,
412
453
  reason: `decide(approve) failed: ${failureTexts.reason}${decideFailureNote(e, 'approve')}`,
413
- ...(e instanceof DecideTransportRetryExhaustedError ? { retryExhausted: true } : {}),
454
+ ...(thrownIsInstanceOf(e, DecideTransportRetryExhaustedError) ? { retryExhausted: true } : {}),
414
455
  ...(currentPending !== undefined ? { currentPending } : {}),
415
456
  ...(wireCode !== undefined ? { errorCode: wireCode } : {}),
416
457
  ...(wireRetriable ? { retriable: true } : {}),
@@ -488,7 +529,7 @@ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, foun
488
529
  const currentPending = readDecideCurrentPending(e);
489
530
  const wireCode = readWireErrorCode(e);
490
531
  const wireRetriable = typeof e === 'object' && e !== null && refusalSaysStillPending(e);
491
- const safetyCode = e instanceof HitlSafetyError ? e.code : undefined;
532
+ const safetyCode = hitlSafetyCodeOf(e);
492
533
  const attributionRefusal = denyAttributionRefusalFromError(e, lastSendCarriedAttribution);
493
534
  const failureTexts = wireFailureTextsOf(e);
494
535
  hostLog('debug', `liveToolApprovalWire: decide(deny) failed: ${failureTexts.log}`);
@@ -497,7 +538,7 @@ async function presentFsApprovalAndDecide(deps, taskId, argsByCall, signal, foun
497
538
  stage: 'decide',
498
539
  gatedCallId,
499
540
  reason: `decide(deny) failed: ${failureTexts.reason}${decideFailureNote(e, 'deny')}`,
500
- ...(e instanceof DecideTransportRetryExhaustedError ? { retryExhausted: true } : {}),
541
+ ...(thrownIsInstanceOf(e, DecideTransportRetryExhaustedError) ? { retryExhausted: true } : {}),
501
542
  ...(currentPending !== undefined ? { currentPending } : {}),
502
543
  ...(wireCode !== undefined ? { errorCode: wireCode } : {}),
503
544
  ...(wireRetriable ? { retriable: true } : {}),
@@ -562,6 +603,7 @@ export const TOOL_APPROVAL_FRAME_KEYS_MIRROR = [
562
603
  'serverNowMs',
563
604
  'delegation',
564
605
  'outcome',
606
+ 'cause',
565
607
  ];
566
608
  const _mirrorPin = [true, true];
567
609
  void _mirrorPin;
@@ -588,7 +630,7 @@ export function toolPermissionRequestAskBits(card) {
588
630
  return {};
589
631
  const mandated = hasOwnStrictTrue(card, 'mandated');
590
632
  const mandate = readApprovalMandate(card);
591
- const origin = readOwnNonEmptyString(card, 'origin');
633
+ const origin = readAskOrigin(card);
592
634
  const ruleOffersAbsence = readOwnNonEmptyString(card, 'ruleOffersAbsence');
593
635
  const askClassPair = readAskClassPair(card);
594
636
  return {
@@ -874,7 +916,7 @@ export function askProbeReasonDetail(card) {
874
916
  const head = 'An automatic check could not clear this call, so it is asking you; the engine did not say the specific reason';
875
917
  return typeof code === 'string' && PROBE_CAUSE_CODE_WORD.test(code) ? `${head} (check code: ${code}).` : `${head}.`;
876
918
  }
877
- function readRememberRefused(v) {
919
+ export function readApprovalRememberRefused(v) {
878
920
  try {
879
921
  return typeof v === 'object' && v !== null && Object.hasOwn(v, 'rememberRefused') && v.rememberRefused === true;
880
922
  }
@@ -1208,19 +1250,55 @@ function subagentBadgeFor(frame) {
1208
1250
  return { name, color: 'cyan' };
1209
1251
  }
1210
1252
  const MAX_RESPOND_NOTE_CHARS = 2048;
1211
- export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamArgs, signal, lane) {
1253
+ export async function surfaceToolApprovalFrameAndRespond(frame, respond, streamArgs, signal, lane, run) {
1212
1254
  const approvalId = frame.approvalId;
1213
- const key = liveFrameCallKey(approvalId);
1214
- const held = liveCardHoldOf(key);
1255
+ const held = liveCardHoldOf(liveFrameCallKey(approvalId));
1215
1256
  if (held !== undefined)
1216
1257
  return joinLiveCard(held, signal);
1217
- return holdLiveCard(key, signal, async (hold) => {
1258
+ return holdLiveCard(liveCardIdentityOf(approvalId, frame, run), signal, async (hold) => {
1218
1259
  const slot = {};
1219
1260
  const out = await presentToolApprovalFrameAndRespond(frame, approvalId, respond, streamArgs, signal, lane, hold, slot);
1220
1261
  noteCallOutcome(slot, out);
1221
1262
  return out;
1222
1263
  });
1223
1264
  }
1265
+ function liveCardIdentityOf(approvalId, frame, run) {
1266
+ const toolCallId = typeof frame.toolCallId === 'string' && frame.toolCallId !== '' ? frame.toolCallId : undefined;
1267
+ const fromSubagent = isFromSubagent(frame);
1268
+ const ownRun = fromSubagent ? frame.sourceTaskId : run?.taskId;
1269
+ const taskId = typeof ownRun === 'string' && ownRun !== '' ? ownRun : undefined;
1270
+ const sessionId = !fromSubagent && typeof run?.sessionId === 'string' && run.sessionId !== '' ? run.sessionId : undefined;
1271
+ return {
1272
+ approvalId,
1273
+ ...(toolCallId !== undefined ? { toolCallId } : {}),
1274
+ ...(taskId !== undefined ? { taskId } : {}),
1275
+ ...(sessionId !== undefined ? { sessionId } : {}),
1276
+ };
1277
+ }
1278
+ function readApprovalHolderIdentity(v) {
1279
+ if (typeof v !== 'object' || v === null)
1280
+ return {};
1281
+ const out = {};
1282
+ try {
1283
+ for (const k of ['approvalId', 'taskId', 'toolCallId', 'sessionId']) {
1284
+ const d = Object.getOwnPropertyDescriptor(v, k);
1285
+ const x = d !== undefined && Object.hasOwn(d, 'value') ? d.value : undefined;
1286
+ if (typeof x === 'string' && x !== '')
1287
+ out[k] = x;
1288
+ }
1289
+ }
1290
+ catch {
1291
+ return {};
1292
+ }
1293
+ return out;
1294
+ }
1295
+ export async function joinApprovalHolder(identity, signal) {
1296
+ const hold = liveCardHoldFor(readApprovalHolderIdentity(identity));
1297
+ if (hold === undefined)
1298
+ return { kind: 'free' };
1299
+ const joined = await awaitLiveCardHolder(hold, signal);
1300
+ return joined !== undefined ? { kind: 'joined', outcome: joined } : { kind: 'free' };
1301
+ }
1224
1302
  async function presentToolApprovalFrameAndRespond(frame, approvalId, respond, streamArgs, signal, lane, hold, ledgerSlot) {
1225
1303
  const frameToolCallId = typeof frame.toolCallId === 'string' && frame.toolCallId !== '' ? frame.toolCallId : undefined;
1226
1304
  const decidedByReading = decidedByReadingSnapshotOf(lane);
@@ -1278,10 +1356,9 @@ async function presentToolApprovalFrameAndRespond(frame, approvalId, respond, st
1278
1356
  : {}),
1279
1357
  ...(ruleOffers !== undefined ? { ruleOffers } : {}),
1280
1358
  ...((sh) => (sh !== undefined ? { allowRuleShadow: sh } : {}))(frameShadow),
1281
- ...((t) => (t !== undefined ? { persistedRuleShadowed: t } : {}))(legacyShadowedRuleTextOf(frameShadow)),
1282
1359
  ...(isWireRecordCarrier(frame.probeCause) ? { probeCause: frame.probeCause } : {}),
1283
1360
  ...((r) => (r !== undefined ? { probeReason: r } : {}))(readProbeReason(frame)),
1284
- ...(readRememberRefused(frame) ? { rememberRefused: true } : {}),
1361
+ ...(readApprovalRememberRefused(frame) ? { rememberRefused: true } : {}),
1285
1362
  ...(isWireRecordCarrier(frame.ruleEvidence) ? { ruleEvidence: frame.ruleEvidence } : {}),
1286
1363
  ...(frame.requiresRealApproval === true ? { requiresRealApproval: true } : {}),
1287
1364
  ...(hasOwnStrictTrue(frame, 'mandated') ? { mandated: true } : {}),
@@ -1292,7 +1369,7 @@ async function presentToolApprovalFrameAndRespond(frame, approvalId, respond, st
1292
1369
  ? { ruleOffersAbsence: frame.ruleOffersAbsence }
1293
1370
  : {}),
1294
1371
  ...(denialLimitFallback !== undefined ? { denialLimitFallback } : {}),
1295
- ...((o) => (o !== undefined ? { origin: o } : {}))(readOwnNonEmptyString(frame, 'origin')),
1372
+ ...((o) => (o !== undefined ? { origin: o } : {}))(readAskOrigin(frame)),
1296
1373
  ...(readAskClassPair(frame) ?? {}),
1297
1374
  ...((g) => (g !== undefined ? { boundGrants: g } : {}))(readApprovalBoundGrants(frame)),
1298
1375
  ...((w) => (w !== undefined ? { classifierNoRuling: w } : {}))(readApprovalClassifierNoRuling(frame)),
@@ -71,6 +71,35 @@ function startupModeWord(settings) {
71
71
  hostLog('debug', `hooksWireCaps: hooksStartupMode() returned ${describeStartupModeValue(v)}, which is neither 'safe' nor 'bare' — treated as neither mode (settings hooks not narrowed)`);
72
72
  return undefined;
73
73
  }
74
+ const MANAGED_POLICY_STATES = ['absent', 'in-effect', 'unreadable'];
75
+ const _managedPolicyStatesPin = [true, true];
76
+ void _managedPolicyStatesPin;
77
+ function managedPolicyUnreadable(settings) {
78
+ try {
79
+ const member = settings.managedPolicyReading;
80
+ if (member === undefined)
81
+ return false;
82
+ if (typeof member !== 'function') {
83
+ hostLog('debug', `hooksWireCaps: managedPolicyReading is ${describeStartupModeValue(member)}, not a method — fail-closed (no hooks projected to the engine)`);
84
+ return true;
85
+ }
86
+ const r = member.call(settings);
87
+ const state = typeof r === 'object' && r !== null && !Array.isArray(r) ? r.state : undefined;
88
+ const word = MANAGED_POLICY_STATES.find((w) => w === state);
89
+ if (word === 'absent' || word === 'in-effect')
90
+ return false;
91
+ if (word === 'unreadable') {
92
+ hostLog('debug', 'hooksWireCaps: managed policy layer reported unreadable — fail-closed (no hooks projected to the engine)');
93
+ return true;
94
+ }
95
+ hostLog('debug', `hooksWireCaps: managedPolicyReading() returned ${describeStartupModeValue(state)} as its state, which is none of 'absent' / 'in-effect' / 'unreadable' — fail-closed (no hooks projected to the engine)`);
96
+ return true;
97
+ }
98
+ catch (err) {
99
+ hostLog('debug', `hooksWireCaps: managedPolicyReading() threw — fail-closed (no hooks projected to the engine): ${String(err)}`);
100
+ return true;
101
+ }
102
+ }
74
103
  function hooksOfSource(source) {
75
104
  try {
76
105
  const s = hostSettings()?.getSettingsForSource(source);
@@ -183,11 +212,12 @@ export function hooksWirePlan(opts = {}) {
183
212
  const shellRuns = (event, type) => {
184
213
  if (!shellEvents.has(event))
185
214
  return false;
186
- const types = typesByEvent?.get(event);
215
+ if (typesByEvent === undefined)
216
+ return type !== 'prompt' && type !== 'agent';
217
+ const types = typesByEvent.get(event);
187
218
  return types === undefined || (typeof type === 'string' && types.has(type));
188
219
  };
189
- const settingsShellRuns = typesByEvent !== undefined ? shellRuns : (event, type) => type !== 'prompt' && type !== 'agent' && shellRuns(event, type);
190
- return buildHooksWirePlan(engine, shellRuns, true, promptAuthoredByUserOf(o), settingsShellRuns);
220
+ return buildHooksWirePlan(engine, shellRuns, true, promptAuthoredByUserOf(o));
191
221
  }
192
222
  function taskHooksCapability(baseUrl) {
193
223
  const v = engineCapValue(baseUrl, 'taskSettings');
@@ -218,7 +248,7 @@ function shellHookTypesOf(o) {
218
248
  return out;
219
249
  }
220
250
  catch (err) {
221
- hostLog('debug', `hooksWirePlan: shellHookTypesByEvent is malformed — treated as absent (command and http hooks count as running on every reported event; prompt and agent hooks from settings stay with the engine): ${String(err)}`);
251
+ hostLog('debug', `hooksWirePlan: shellHookTypesByEvent is malformed — treated as absent (command and http hooks count as running on every reported event; prompt and agent hooks are not counted as running locally): ${String(err)}`);
222
252
  return undefined;
223
253
  }
224
254
  }
@@ -238,11 +268,11 @@ function promptAuthoredByUserOf(o) {
238
268
  }
239
269
  return true;
240
270
  }
241
- function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser, settingsShellRuns = shellRuns) {
271
+ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser) {
242
272
  const settingsDropped = [];
243
273
  const settingsVerdicts = [];
244
274
  const settingsExcluded = [];
245
- const judge = withPlugins ? createSettingsHookJudge(engine, settingsShellRuns, promptAuthoredByUser) : undefined;
275
+ const judge = withPlugins ? createSettingsHookJudge(engine, shellRuns, promptAuthoredByUser) : undefined;
246
276
  let settingsStripped = 0;
247
277
  const planOf = (pluginReader, wire, verdicts = [], excluded = []) => ({ engine, pluginReader, verdicts, excluded, settingsDropped, settingsVerdicts, settingsExcluded, wire });
248
278
  const closedPlan = (settings, reason) => {
@@ -278,6 +308,8 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
278
308
  hostLog('debug', `hooksWireCaps: workspace trust check threw — fail-closed (no hooks projected to the engine): ${String(err)}`);
279
309
  return closedPlan(settings, 'governance_unreadable');
280
310
  }
311
+ if (managedPolicyUnreadable(settings))
312
+ return closedPlan(settings, 'governance_unreadable');
281
313
  let policy = null;
282
314
  try {
283
315
  policy = settings.getSettingsForSource('policySettings');
package/dist/host.d.ts CHANGED
@@ -8,6 +8,11 @@ export interface SettingsPort {
8
8
  mergedDisableAllHooks?(): boolean | undefined;
9
9
  enabledPluginHooks?(): PluginHooksReading;
10
10
  hooksStartupMode?(): HooksStartupMode | undefined;
11
+ managedPolicyReading?(): ManagedPolicyReading;
12
+ }
13
+ export type ManagedPolicyState = 'absent' | 'in-effect' | 'unreadable';
14
+ export interface ManagedPolicyReading {
15
+ readonly state: ManagedPolicyState;
11
16
  }
12
17
  export type HooksStartupMode = 'safe' | 'bare';
13
18
  export type PluginHookOptionValue = string | number | boolean;
package/dist/host.js CHANGED
@@ -48,7 +48,9 @@ export function installHostFor(sessionKey, ports) {
48
48
  }
49
49
  function callDiagnosticPort(call) {
50
50
  try {
51
- call();
51
+ const out = call();
52
+ if (out !== undefined && out !== null)
53
+ void Promise.resolve(out).then(undefined, () => undefined);
52
54
  return true;
53
55
  }
54
56
  catch {
@@ -0,0 +1 @@
1
+ export declare function invokeHostCallbackIsolated(label: string, call: () => void): void;
@@ -0,0 +1,25 @@
1
+ import { hostLog } from './host.js';
2
+ function faultText(e) {
3
+ try {
4
+ return String(e).slice(0, 160);
5
+ }
6
+ catch {
7
+ return '(unprintable)';
8
+ }
9
+ }
10
+ function reportHostCallbackFault(label, what, e) {
11
+ hostLog('debug', `${label} ${what}: ${faultText(e)}`);
12
+ }
13
+ export function invokeHostCallbackIsolated(label, call) {
14
+ try {
15
+ const out = call();
16
+ if (out && typeof out.then === 'function') {
17
+ void Promise.resolve(out).then(undefined, (e) => {
18
+ reportHostCallbackFault(label, 'rejected', e);
19
+ });
20
+ }
21
+ }
22
+ catch (e) {
23
+ reportHostCallbackFault(label, 'threw', e);
24
+ }
25
+ }
package/dist/index.d.ts CHANGED
@@ -18,6 +18,8 @@ export type { BgTerminalFacts, SubagentContentEvent, SubagentContentItem, Subage
18
18
  export * from './engineAgentPanelStore.js';
19
19
  export * from './engineAgentAbsence.js';
20
20
  export * from './fleetAgentPanelProjection.js';
21
+ export { reducePanelFrame, createPanelReduceState, PANEL_DELTA_OPS } from './panelReduce.js';
22
+ export type { PanelFrame, PanelDelta, PanelRowFields, PanelReduceState } from './panelReduce.js';
21
23
  export { _resetLiveQuestionStore, hasLocalQuestionResponder, hasQuestionOverlay, hasQuestionOverlayFor, onQuestionFrame, onQuestionFrameFor, publishQuestionFrame, publishQuestionFrameFor, registerLocalQuestionResponder, respondToQuestion, setQuestionRespond, } from './liveQuestionStore.js';
22
24
  export type { AskQuestion, AskQuestionOption, QuestionAnswer, QuestionFrame, } from './liveQuestionStore.js';
23
25
  export * from './engineInlineTaskStats.js';
@@ -31,7 +33,7 @@ export * from './executionLaneCapability.js';
31
33
  export * from './approvalsStreamLiveCapability.js';
32
34
  export * from './peerLaneCapability.js';
33
35
  export * from './permissionRulesWriteCapability.js';
34
- export { __resetPermissionsAllowGrantReadingsForTests, forgetPermissionsAllowGrantReading, noteEngineCapsForPermissionsAllowGrant, observedPermissionsAllowGrant, permissionsAllowGrantAvailable, permissionsAllowGrantDoctorDetail, projectPermissionsAllowGrantCapability, } from './permissionsAllowGrantCapability.js';
36
+ export { __resetPermissionsAllowGrantReadingsForTests, noteEngineCapsForPermissionsAllowGrant, observedPermissionsAllowGrant, permissionsAllowGrantAvailable, permissionsAllowGrantDoctorDetail, projectPermissionsAllowGrantCapability, } from './permissionsAllowGrantCapability.js';
35
37
  export type { PermissionsAllowGrantReading } from './permissionsAllowGrantCapability.js';
36
38
  export * from './sessionPolicyCapability.js';
37
39
  export * from './memoryComplianceCapability.js';
@@ -40,9 +42,13 @@ export * from './memoryEntriesWire.js';
40
42
  export * from './memoryVerbsWire.js';
41
43
  export * from './deviceExecutorManagementCapability.js';
42
44
  export * from './mcpReconnect.js';
45
+ export * from './hitl/parkExpiryJudgements.js';
46
+ export * from './usageAnalytics.js';
43
47
  export * from './leaderConflict.js';
44
48
  export * from './runTerminal.js';
45
- export { providerRejectionResend, type ProviderRejectionResend } from './providerRejection.js';
49
+ export { CORE_SEMA_TASK_TERMINAL_STATUSES, CORE_TASK_NOTIFICATION_TERMINAL_STATUSES, CORE_TERMINAL_CAUSE_KINDS, SDK_FLEET_TASK_TERMINAL_STATUSES, SDK_RUN_TERMINAL_STATUSES, ccTaskTerminalStatusOf, isCoreSemaTaskTerminal, isCoreTaskNotificationTerminal, isCoreTaskNotificationTerminalNotSuccess, isCoreTerminalCauseKind, isSdkFleetTaskTerminal, isSdkFleetTaskTerminalNotSuccess, isSdkRunTerminal, isSdkRunTerminalNotSuccess, } from './terminalStatuses.js';
50
+ export type { CcTaskTerminalStatus, CoreSemaTaskTerminalStatus, CoreTaskNotificationTerminalStatus, CoreTerminalCauseKind, SdkFleetTaskTerminalStatus, SdkRunTerminalStatus, } from './terminalStatuses.js';
51
+ export type { ProviderRejectionResend } from './providerRejection.js';
46
52
  export * from './runCancelContext.js';
47
53
  export * from './argvFlagValue.js';
48
54
  export * from './readFacePosture.js';
@@ -104,6 +110,7 @@ export * from './retainBackgroundWireCaps.js';
104
110
  export * from './oneShotWireCaps.js';
105
111
  export * from './rewindWireCaps.js';
106
112
  export * from './rewindArchiveCapability.js';
113
+ export * from './rewindEngineAction.js';
107
114
  export * from './fileHistoryCaptureCapability.js';
108
115
  export { FILE_HISTORY_LEG_VERDICTS, fileHistoryLegNoticeVerdict, fileHistoryLegNoticeSentence, fileHistoryDeclarationOfBody, createFileHistoryDeclarationLedger, } from './fileHistoryLegNotice.js';
109
116
  export type { FileHistoryDeclarationFact, FileHistoryLegNoticeVerdict, FileHistoryLegNoticeInput, FileHistoryDeclarationLedger } from './fileHistoryLegNotice.js';
@@ -123,6 +130,7 @@ export * from './liveModelCatalog.js';
123
130
  export * from './modelBudgetRule.js';
124
131
  export * from './modelIdentityResolvability.js';
125
132
  export * from './sessionModelLatch.js';
133
+ export * from './modelSwitchFallback.js';
126
134
  export * from './effortWire.js';
127
135
  export * from './adapter/types.js';
128
136
  export * from './adapter/downstream/turnUsageToModelUsage.js';
@@ -137,8 +145,8 @@ export { disableSkillsDeclaration, disableSkillsDeclarationSettled } from './dis
137
145
  export { approvalReachDeclaration, approvalReachDeclarationSettled } from './approvalReachWire.js';
138
146
  export type { ApprovalReachDeclaration, ApprovalReachWithheldCause, ApprovalReachWord } from './approvalReachWire.js';
139
147
  export type { DisableSkillsDeclaration } from './disableSkillsWire.js';
140
- export { PERMISSIONS_KEPT_REASONS, WIRE_RULE_TRUST_ORDER, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
141
- export type { PermissionsClientOwnedStatement, PermissionsDeclaration, PermissionsDeclarationBuckets, PermissionsDeclarationInput, PermissionsDeclarationReport, PermissionsKeptReason, PermissionsKeptRule, PermissionsRewrittenRule, PermissionsUncheckedRule, PermissionsUnreachableRule, WireRuleOrigin, WireRuleOrigins, } from './permissionsDeclaration.js';
148
+ export { PERMISSIONS_KEPT_REASONS, WIRE_RULE_TRUST_ORDER, permissionsAllowKeptNotice, permissionsDeclaration, permissionsDeclarationReport } from './permissionsDeclaration.js';
149
+ export type { PermissionsAllowKeptFacts, PermissionsClientOwnedStatement, PermissionsDeclaration, PermissionsDeclarationBuckets, PermissionsDeclarationInput, PermissionsDeclarationReport, PermissionsKeptReason, PermissionsKeptRule, PermissionsRewrittenRule, PermissionsUncheckedRule, PermissionsUnreachableRule, WireRuleOrigin, WireRuleOrigins, } from './permissionsDeclaration.js';
142
150
  export * from './clientSlice.js';
143
151
  export * from './host.js';
144
152
  export { abortableSleep } from './abortableSleep.js';
@@ -153,7 +161,7 @@ export * from './limitsWire.js';
153
161
  export * from './interactiveToolsWire.js';
154
162
  export * from './headlessPermissionModeWire.js';
155
163
  export * from './headlessReconnectWire.js';
156
- export { coerceTaskStatus, coerceWorkflowStatus, CONTROL_TOOL_VERBS, FLEET_TASK_ROW_KEYS_NOT_PROJECTED, FLEET_TASK_ROW_WIRE_KEYS, FLEET_TASK_VIEW_KEYS, FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED, FLEET_WORKFLOW_ROW_WIRE_KEYS, FLEET_WORKFLOW_VIEW_KEYS, projectDescription, projectTasks, projectWorkflows, TERMINAL_FLEET_TASK_STATUSES, wireResumable, wireRowUsage, } from './fleet/fleetProjection.js';
164
+ export { coerceTaskStatus, coerceWorkflowStatus, CONTROL_TOOL_VERBS, FLEET_TASK_ROW_KEYS_NOT_PROJECTED, FLEET_TASK_ROW_WIRE_KEYS, FLEET_TASK_VIEW_KEYS, FLEET_WORKFLOW_ROW_KEYS_NOT_PROJECTED, FLEET_WORKFLOW_ROW_WIRE_KEYS, FLEET_WORKFLOW_VIEW_KEYS, projectDescription, projectTasks, projectWorkflows, wireResumable, wireRowUsage, } from './fleet/fleetProjection.js';
157
165
  export type { FleetRowUsage, FleetTaskStatus, FleetTaskView, FleetWorkflowView, NotProjectedEntry, ProjectTasksOptions, } from './fleet/fleetProjection.js';
158
166
  export * from './fleet/fleetLedger.js';
159
167
  export * from './fleet/workflowSizeWarning.js';
@@ -178,8 +186,6 @@ export * from './corruptSessionCopy.js';
178
186
  export { classifyToolHistoryMismatch, readToolHistoryMismatchKey, resolveToolHistoryRewindTarget } from './toolHistoryMismatch.js';
179
187
  export type { ToolHistoryMismatchRowKey } from './toolHistoryMismatch.js';
180
188
  export { toolHistoryBadTurnSentence } from './toolHistoryBadTurn.js';
181
- export { classifyRegistryConflict, isScopeGoneError } from './registryConflict.js';
182
- export type { RegistryConflictClass } from './registryConflict.js';
183
189
  export { deviceFlowPollingPlan } from './deviceFlowPolling.js';
184
190
  export type { DeviceFlowPollingPlan } from './deviceFlowPolling.js';
185
191
  export { createPromptDeliveryLedger, promptKnownUndelivered, withoutUndeliveredPrompts } from './promptDelivery.js';
@@ -188,7 +194,7 @@ export { mintUserAttachmentEnvelope } from './userAttachmentEnvelope.js';
188
194
  export type { UserAttachmentDescriptor, UserAttachmentNotebookCell } from './userAttachmentEnvelope.js';
189
195
  export { encodeHumanTurn, deliveredUuidsOf } from './humanTurn.js';
190
196
  export type { HumanTurnInput, HumanTurnItem, HumanTurnAttachment, HumanTurnRider, HumanTurnMissing, HumanTurnCaps, HumanTurnEncoding, HumanTurnShare, HumanTurnSharePart, HumanTurnDegraded, HumanTurnDelivered, } from './humanTurn.js';
191
- export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, forgetAttachmentSeatReading, __resetAttachmentSeatReadingsForTests, } from './attachmentSeatCapability.js';
197
+ export { noteEngineCapsForAttachmentSeat, observedAttachmentSeat, __resetAttachmentSeatReadingsForTests, } from './attachmentSeatCapability.js';
192
198
  export type { AttachmentSeatReading } from './attachmentSeatCapability.js';
193
199
  export * from './resumeRefusalCopy.js';
194
200
  export * from './wireRefusalCopy.js';
@@ -236,17 +242,27 @@ export * from './hitl/sessionPolicyWire.js';
236
242
  export * from './hitl/sessionPolicyDeliverable.js';
237
243
  export * from './hitl/approvalsFeed.js';
238
244
  export * from './hitl/livePendingAsk.js';
239
- export { replayedApprovalDisposition } from './hitl/replayedApproval.js';
245
+ export { replayedApprovalDisposition, replayedApprovalSentence } from './hitl/replayedApproval.js';
240
246
  export type { ReplayedApprovalDisposition, ReplayPendingBasis } from './hitl/replayedApproval.js';
247
+ export { hasLedgerPositionKey } from './hitl/gateLedger.js';
241
248
  export { MODE_ARBITRATION, automaticAnswerVerdict, mandatedApprovalDetailOf, permissionRequestHookScope, type AutomaticAnswerLane, type AutomaticAnswerAskFace, type AutomaticAnswerFacts, type AutomaticAnswerRoad, type AutomaticAnswerUnknownWhy, type AutomaticAnswerVerdict, type PermissionRequestHookScope, } from './hitl/automaticAnswerVerdict.js';
242
- export { classifyDecisionRefusal, liveAskPendingReading, decisionRefusalClosesOut, undeliverableDecisionContent, type DecisionRefusalStanding, type DecisionRefusalClassified, type LiveAskPendingReading, type UndeliverableDecisionEnd, type UndeliverableDecisionFacts, } from './hitl/decisionRefusal.js';
249
+ export { classifyDecisionRefusal, liveAskPendingReading, decisionRefusalClosesOut, undeliverableDecisionContent, type DecisionRefusalStanding, type DecisionRefusalClassified, type DecisionRefusalConflict, type LiveAskPendingReading, type UndeliverableDecisionEnd, type UndeliverableDecisionFacts, } from './hitl/decisionRefusal.js';
243
250
  export { noAllowCauseOf, type NoAllowCause, type RuleLadderNoAllowFacts } from './hitl/noAllowCause.js';
244
251
  export { policyDenyReason, type PolicyDenyLane, type PolicyDenyReasonFacts } from './hitl/frameRouter.js';
245
- export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, type ApprovalAllowRuleShadow, type ApprovalAllowRuleShadowMember, type AllowRuleShadowedWireMember, } from './hitl/allowRuleShadow.js';
252
+ export { readApprovalAllowRuleShadow, approvalAllowRuleShadowed, allowRuleShadowSentence, type ApprovalAllowRuleShadow, type ApprovalAllowRuleShadowMember, type AllowRuleShadowedWireMember, } from './hitl/allowRuleShadow.js';
246
253
  export { projectCrashConverged } from './hitl/crashConverged.js';
247
254
  export type { ApprovalsListEnvelope, CrashConvergedOrphanState, CrashConvergedProjection, CrashConvergedRow } from './hitl/crashConverged.js';
248
255
  export * from './hitl/crashConvergedNotice.js';
256
+ export { approvalCompleteParked } from './hitl/approvalCompleteParked.js';
257
+ export { approvalCompleteCauseOf } from './hitl/approvalEndingCause.js';
249
258
  export * from './interactiveHalt.js';
259
+ export { fireInteractiveInterrupt } from './interactiveInterrupt.js';
260
+ export type { InteractiveInterruptRuns, InteractiveInterruptOptions } from './interactiveInterrupt.js';
261
+ export { listDevices, readSessionBinding, rebindSession, reconcileRebindOutcome, rebindProvesRequestNotApplied } from './deviceRebind.js';
262
+ export type { DeviceSummary, DeviceListResult, DeviceBinding, DeviceSessionBinding, DeviceRebindRequest, DeviceRevokeRequest, DeviceRebindResult, DeviceEnrollToken, DeviceEnrollRequest, DeviceEnrollResult, DeviceRevokeResult, } from '@sema-agent/sdk';
263
+ export type { DeviceListVerb, DeviceSessionBindingVerb, DeviceRebindVerb, DeviceRosterRow, DeviceBindingReading, DeviceRefused, DeviceLaneAbsent, DeviceTransport, DeviceUnreadable, DeviceUnarmed, DeviceListOutcome, DeviceSessionBindingOutcome, DeviceRebindInput, DeviceRebindUnconfirmed, DeviceRebindOutcome, DeviceRebindReconcileVerdict, } from './deviceRebind.js';
264
+ export { resolveEngineEnvSourcing, engineEnvView } from './engineEnvSourcing.js';
265
+ export type { EngineEnvView, EngineEnvGroupDecl, EngineEnvSourcingInput, EngineEnvTouchedKey, EngineEnvGroupReading, EngineEnvKeyReason, EngineEnvSourcingVerdict, } from './engineEnvSourcing.js';
250
266
  export * from './compensations.js';
251
267
  export * from './request/printNotification.js';
252
268
  export * from './seatContract.js';
@@ -271,3 +287,6 @@ export * from './env/localeTag.js';
271
287
  export * from './env/uiLanguage.js';
272
288
  export type { PendingCheckpoint, RuleSuggestion } from '@sema-agent/sdk';
273
289
  export * from './ruleRemovalConsequence.js';
290
+ export { engineCredentialRequirementOf } from './engineCredentialRequirement.js';
291
+ export type { EngineProbeAnswer, EngineCredentialNeed } from './engineCredentialRequirement.js';
292
+ export { isSessionIdPathSegment } from './sessionIdSegment.js';