@sema-agent/client-core 0.97.1 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/CHANGELOG.md +607 -0
  2. package/README.md +96 -46
  3. package/dist/adapt/arms.d.ts +1 -0
  4. package/dist/adapt/arms.js +188 -53
  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/panelTasks.d.ts +1 -1
  10. package/dist/adapt/panelTasks.js +2 -2
  11. package/dist/adapt/textStream.d.ts +1 -0
  12. package/dist/adapt/textStream.js +24 -7
  13. package/dist/adapt/toolCards.d.ts +27 -5
  14. package/dist/adapt/toolCards.js +39 -6
  15. package/dist/adapt/wireShapes.js +6 -2
  16. package/dist/adapt.d.ts +2 -0
  17. package/dist/adapt.js +8 -3
  18. package/dist/adapter/activeRunSelfHeal.d.ts +9 -3
  19. package/dist/adapter/activeRunSelfHeal.js +205 -313
  20. package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -5
  21. package/dist/adapter/downstream/eventToSdkMessage.js +77 -36
  22. package/dist/adapter/downstream/terminalToSdkResult.js +11 -4
  23. package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +5 -2
  24. package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -0
  25. package/dist/adapter/runStream.js +79 -48
  26. package/dist/adapter/types.d.ts +4 -4
  27. package/dist/adapter/types.js +2 -1
  28. package/dist/agentSession/backgroundView.js +2 -1
  29. package/dist/agentSession/engineAgentRegistryRead.d.ts +2 -2
  30. package/dist/agentSession/engineAgentRegistryRead.js +12 -13
  31. package/dist/agentSession/engineSessionBackgroundStop.js +16 -8
  32. package/dist/agentsWireCaps.d.ts +8 -11
  33. package/dist/agentsWireCaps.js +196 -194
  34. package/dist/approvalDecidedByCapability.d.ts +0 -4
  35. package/dist/approvalDecidedByCapability.js +0 -6
  36. package/dist/approvalsStreamLiveCapability.d.ts +0 -4
  37. package/dist/approvalsStreamLiveCapability.js +0 -6
  38. package/dist/assistantInbox.d.ts +34 -0
  39. package/dist/assistantInbox.js +118 -0
  40. package/dist/centerWiringCapability.js +9 -1
  41. package/dist/clientSlice.d.ts +0 -9
  42. package/dist/clientSlice.js +0 -3
  43. package/dist/cloudConfigWireCaps.d.ts +5 -3
  44. package/dist/cloudConfigWireCaps.js +106 -64
  45. package/dist/compensations.js +1 -1
  46. package/dist/connectorStatus.d.ts +21 -0
  47. package/dist/connectorStatus.js +112 -0
  48. package/dist/controlRouter.d.ts +18 -3
  49. package/dist/controlRouter.js +106 -67
  50. package/dist/coreValuePorts.d.ts +29 -4
  51. package/dist/coreValuePorts.js +10 -0
  52. package/dist/corruptSessionCopy.d.ts +2 -1
  53. package/dist/corruptSessionCopy.js +3 -3
  54. package/dist/decideReceipt.d.ts +2 -2
  55. package/dist/decideReceipt.js +5 -2
  56. package/dist/declared/supportFloorDeclared.js +3 -3
  57. package/dist/detachWire.js +3 -2
  58. package/dist/deviceExecutorManagementCapability.d.ts +0 -4
  59. package/dist/deviceExecutorManagementCapability.js +0 -6
  60. package/dist/deviceRebind.d.ts +49 -1
  61. package/dist/deviceRebind.js +221 -3
  62. package/dist/devicesFace.d.ts +34 -0
  63. package/dist/devicesFace.js +90 -0
  64. package/dist/displayUntrusted.d.ts +2 -0
  65. package/dist/displayUntrusted.js +253 -76
  66. package/dist/engineAgentAbsence.d.ts +1 -1
  67. package/dist/engineAgentPanelStore.d.ts +12 -4
  68. package/dist/engineAgentPanelStore.js +16 -11
  69. package/dist/engineCapReader.d.ts +2 -5
  70. package/dist/engineCapReader.js +8 -10
  71. package/dist/engineCapsCache.d.ts +12 -0
  72. package/dist/engineCapsCache.js +76 -18
  73. package/dist/engineCapsChange.d.ts +2 -0
  74. package/dist/engineCapsChange.js +9 -0
  75. package/dist/engineClosedSets.d.ts +1 -0
  76. package/dist/engineClosedSets.js +4 -1
  77. package/dist/engineErrorCodes.d.ts +11 -3
  78. package/dist/engineErrorCodes.js +11 -8
  79. package/dist/engineIdentity.d.ts +1 -0
  80. package/dist/engineIdentity.js +8 -0
  81. package/dist/engineRowRef.d.ts +28 -0
  82. package/dist/engineRowRef.js +114 -0
  83. package/dist/engineSessionMessages.d.ts +68 -0
  84. package/dist/engineSessionMessages.js +370 -0
  85. package/dist/engineTargetSeat.d.ts +27 -0
  86. package/dist/engineTargetSeat.js +199 -0
  87. package/dist/engineToolDirectory.d.ts +0 -9
  88. package/dist/engineToolDirectory.js +1 -94
  89. package/dist/engineUrl.d.ts +18 -0
  90. package/dist/engineUrl.js +52 -0
  91. package/dist/engineWireFor.js +3 -8
  92. package/dist/env/uiLanguage.d.ts +11 -1
  93. package/dist/env/uiLanguage.js +38 -2
  94. package/dist/eventLeg.d.ts +100 -0
  95. package/dist/eventLeg.js +305 -0
  96. package/dist/executionLaneCapability.d.ts +0 -4
  97. package/dist/executionLaneCapability.js +3 -16
  98. package/dist/fileHistoryCaptureCapability.d.ts +2 -5
  99. package/dist/fileHistoryCaptureCapability.js +13 -21
  100. package/dist/fileHistoryLegNotice.d.ts +2 -1
  101. package/dist/fileHistoryLegNotice.js +3 -3
  102. package/dist/fleet/fleetLedger.d.ts +0 -3
  103. package/dist/fleet/fleetLedger.js +21 -36
  104. package/dist/fleet/fleetProjection.d.ts +2 -2
  105. package/dist/fleet/fleetProjection.js +10 -8
  106. package/dist/frameBinding.d.ts +8 -0
  107. package/dist/frameBinding.js +35 -0
  108. package/dist/gateFailureCodes.d.ts +2 -0
  109. package/dist/gateFailureCodes.js +15 -0
  110. package/dist/gateOutcome.d.ts +3 -1
  111. package/dist/gateOutcome.js +41 -8
  112. package/dist/gateVocabulary.d.ts +10 -4
  113. package/dist/gateVocabulary.js +107 -47
  114. package/dist/generated/engineAskFaceTables.js +2 -2
  115. package/dist/generated/engineFactTables.d.ts +22 -3
  116. package/dist/generated/engineFactTables.js +51 -4
  117. package/dist/generated/engineNoticeTables.js +18 -3
  118. package/dist/generated/settingsSchemaFns.d.ts +6 -0
  119. package/dist/generated/settingsSchemaFns.js +57 -0
  120. package/dist/generated/settingsSchemaHooksClassifier.d.ts +2 -0
  121. package/dist/generated/settingsSchemaHooksClassifier.js +254 -0
  122. package/dist/generated/settingsSchemaTables.d.ts +1 -0
  123. package/dist/generated/settingsSchemaTables.js +4 -0
  124. package/dist/generated/settingsSchemaTypes.d.ts +105 -0
  125. package/dist/generated/settingsSchemaTypes.js +1 -0
  126. package/dist/generated/toolNameTables.d.ts +1 -0
  127. package/dist/generated/toolNameTables.js +1 -0
  128. package/dist/hitl/allowRuleShadow.d.ts +8 -2
  129. package/dist/hitl/allowRuleShadow.js +36 -29
  130. package/dist/hitl/approvalCardReading.d.ts +15 -0
  131. package/dist/hitl/approvalCardReading.js +154 -0
  132. package/dist/hitl/approvalCardReasons.d.ts +14 -0
  133. package/dist/hitl/approvalCardReasons.js +119 -0
  134. package/dist/hitl/approvalHolds.d.ts +50 -15
  135. package/dist/hitl/approvalHolds.js +177 -27
  136. package/dist/hitl/approvalResolution.d.ts +51 -26
  137. package/dist/hitl/approvalResolution.js +86 -122
  138. package/dist/hitl/approvalsFeed.js +6 -18
  139. package/dist/hitl/askClassPair.d.ts +2 -0
  140. package/dist/hitl/askClassPair.js +17 -0
  141. package/dist/hitl/askGateWire.d.ts +20 -2
  142. package/dist/hitl/askGateWire.js +50 -1
  143. package/dist/hitl/askParkRowRouting.d.ts +5 -0
  144. package/dist/hitl/askParkRowRouting.js +32 -1
  145. package/dist/hitl/askSettlementLine.d.ts +28 -0
  146. package/dist/hitl/askSettlementLine.js +99 -0
  147. package/dist/hitl/automaticAnswerVerdict.d.ts +3 -2
  148. package/dist/hitl/automaticAnswerVerdict.js +29 -13
  149. package/dist/hitl/crashConverged.d.ts +11 -20
  150. package/dist/hitl/crashConverged.js +56 -0
  151. package/dist/hitl/crashConvergedNotice.d.ts +6 -3
  152. package/dist/hitl/crashConvergedNotice.js +48 -24
  153. package/dist/hitl/decisionConflict.js +3 -10
  154. package/dist/hitl/decisionRefusal.d.ts +40 -1
  155. package/dist/hitl/decisionRefusal.js +199 -42
  156. package/dist/hitl/frameRouter.d.ts +5 -2
  157. package/dist/hitl/frameRouter.js +27 -24
  158. package/dist/hitl/gateLedger.d.ts +2 -0
  159. package/dist/hitl/gateLedger.js +50 -13
  160. package/dist/hitl/hitlBridge.d.ts +2 -2
  161. package/dist/hitl/hitlBridge.js +13 -10
  162. package/dist/hitl/livePendingAsk.d.ts +3 -3
  163. package/dist/hitl/livePendingAsk.js +7 -18
  164. package/dist/hitl/parkResolver.d.ts +2 -24
  165. package/dist/hitl/parkResolver.js +61 -97
  166. package/dist/hitl/persistedRulesWire.d.ts +25 -0
  167. package/dist/hitl/persistedRulesWire.js +104 -2
  168. package/dist/hitl/planReviewWire.d.ts +31 -13
  169. package/dist/hitl/planReviewWire.js +120 -78
  170. package/dist/hitl/refusedToolNameProse.d.ts +0 -1
  171. package/dist/hitl/refusedToolNameProse.js +0 -3
  172. package/dist/hitl/replayedApproval.d.ts +4 -3
  173. package/dist/hitl/replayedApproval.js +7 -4
  174. package/dist/hitl/sessionPolicyDeliverable.d.ts +2 -0
  175. package/dist/hitl/sessionPolicyDeliverable.js +48 -7
  176. package/dist/hitl/sessionPolicyWire.d.ts +34 -21
  177. package/dist/hitl/sessionPolicyWire.js +179 -70
  178. package/dist/hitl/standingRows.d.ts +20 -2
  179. package/dist/hitl/standingRows.js +69 -8
  180. package/dist/hitl/suspendedReopen.d.ts +2 -1
  181. package/dist/hitl/suspendedReopen.js +7 -10
  182. package/dist/hitl/toolApprovalWire.d.ts +103 -156
  183. package/dist/hitl/toolApprovalWire.js +661 -411
  184. package/dist/hookMatcherVerdict.d.ts +6 -1
  185. package/dist/hookMatcherVerdict.js +14 -7
  186. package/dist/hooksWireCaps.d.ts +2 -2
  187. package/dist/hooksWireCaps.js +174 -81
  188. package/dist/host.d.ts +21 -0
  189. package/dist/hostTurnSettings.d.ts +71 -0
  190. package/dist/hostTurnSettings.js +291 -0
  191. package/dist/humanTurn.d.ts +14 -1
  192. package/dist/humanTurn.js +100 -12
  193. package/dist/humanTurnRead.d.ts +2 -0
  194. package/dist/humanTurnRead.js +22 -1
  195. package/dist/i18n/messages.en.d.ts +703 -0
  196. package/dist/i18n/messages.en.js +701 -0
  197. package/dist/i18n/messages.zh.d.ts +3 -0
  198. package/dist/i18n/messages.zh.js +837 -0
  199. package/dist/i18n/translate.d.ts +25 -0
  200. package/dist/i18n/translate.js +127 -0
  201. package/dist/index.d.ts +78 -29
  202. package/dist/index.js +54 -18
  203. package/dist/inheritEnvCapability.d.ts +32 -0
  204. package/dist/inheritEnvCapability.js +104 -0
  205. package/dist/inheritEnvWire.d.ts +3 -2
  206. package/dist/inheritEnvWire.js +12 -14
  207. package/dist/interactiveHalt.js +17 -6
  208. package/dist/liveModelCatalog.d.ts +3 -3
  209. package/dist/liveModelCatalog.js +15 -13
  210. package/dist/liveQuestionStore.d.ts +2 -21
  211. package/dist/mcpLiveness.d.ts +2 -1
  212. package/dist/mcpPanel.d.ts +10 -1
  213. package/dist/mcpPanel.js +40 -13
  214. package/dist/mcpProbeCapability.d.ts +2 -1
  215. package/dist/mcpProbeCapability.js +7 -11
  216. package/dist/mcpProbeWire.d.ts +9 -2
  217. package/dist/mcpProbeWire.js +6 -1
  218. package/dist/mcpWireCaps.d.ts +47 -2
  219. package/dist/mcpWireCaps.js +164 -16
  220. package/dist/memoryEntriesWire.d.ts +4 -9
  221. package/dist/memoryEntriesWire.js +5 -10
  222. package/dist/model/modelSupplyRules.d.ts +0 -2
  223. package/dist/model/modelSupplyRules.js +3 -12
  224. package/dist/model/modelsPolicy.d.ts +0 -5
  225. package/dist/model/modelsPolicy.js +6 -36
  226. package/dist/model/onboardJudgement.d.ts +93 -0
  227. package/dist/model/onboardJudgement.js +415 -0
  228. package/dist/model/subagentModelWord.d.ts +31 -0
  229. package/dist/model/subagentModelWord.js +261 -0
  230. package/dist/model/tierVocabulary.d.ts +2 -0
  231. package/dist/model/tierVocabulary.js +17 -5
  232. package/dist/modelCapabilityProbe.d.ts +64 -0
  233. package/dist/modelCapabilityProbe.js +600 -0
  234. package/dist/modelIdentityResolvability.d.ts +3 -0
  235. package/dist/modelIdentityResolvability.js +26 -17
  236. package/dist/notifications.d.ts +6 -0
  237. package/dist/notifications.js +71 -23
  238. package/dist/outputStyleSeatCapability.d.ts +0 -3
  239. package/dist/outputStyleSeatCapability.js +0 -3
  240. package/dist/ownKey.d.ts +22 -0
  241. package/dist/ownKey.js +94 -3
  242. package/dist/panelReduce.d.ts +21 -10
  243. package/dist/panelReduce.js +728 -550
  244. package/dist/panelStateHolder.d.ts +3 -7
  245. package/dist/panelStateHolder.js +14 -130
  246. package/dist/peerLaneCapability.d.ts +0 -4
  247. package/dist/peerLaneCapability.js +0 -6
  248. package/dist/permissionRuleIssue.js +2 -0
  249. package/dist/permissionRulesWriteCapability.d.ts +2 -5
  250. package/dist/permissionRulesWriteCapability.js +8 -12
  251. package/dist/permissionWireCaps.d.ts +2 -2
  252. package/dist/permissionWireCaps.js +2 -0
  253. package/dist/permissionsAllowGrantCapability.d.ts +0 -4
  254. package/dist/permissionsAllowGrantCapability.js +0 -6
  255. package/dist/permissionsDeclaration.d.ts +0 -11
  256. package/dist/permissionsDeclaration.js +60 -53
  257. package/dist/pluginHooksWire.d.ts +46 -3
  258. package/dist/pluginHooksWire.js +219 -16
  259. package/dist/preemptWire.d.ts +44 -0
  260. package/dist/preemptWire.js +83 -0
  261. package/dist/printModelStatus.d.ts +63 -0
  262. package/dist/printModelStatus.js +155 -0
  263. package/dist/printToolResultFrame.js +15 -4
  264. package/dist/replayBody.d.ts +3 -0
  265. package/dist/replayBody.js +14 -0
  266. package/dist/request/taskRequest.d.ts +11 -6
  267. package/dist/request/taskRequest.js +112 -19
  268. package/dist/resumeRefusalCopy.d.ts +13 -9
  269. package/dist/resumeRefusalCopy.js +81 -118
  270. package/dist/retryStatus.d.ts +45 -0
  271. package/dist/retryStatus.js +185 -1
  272. package/dist/rewindArchiveCapability.d.ts +0 -4
  273. package/dist/rewindArchiveCapability.js +2 -10
  274. package/dist/rewindArchiveReading.d.ts +0 -1
  275. package/dist/rewindArchiveReading.js +0 -3
  276. package/dist/runCancelContext.d.ts +2 -1
  277. package/dist/runCancelContext.js +4 -2
  278. package/dist/runReattachPolicy.d.ts +31 -0
  279. package/dist/runReattachPolicy.js +46 -0
  280. package/dist/runTerminal.d.ts +3 -6
  281. package/dist/runTerminal.js +8 -9
  282. package/dist/sandboxWire.d.ts +3 -1
  283. package/dist/sandboxWire.js +76 -27
  284. package/dist/scenarioRefusal.d.ts +9 -0
  285. package/dist/scenarioRefusal.js +111 -0
  286. package/dist/scenarioWire.js +1 -1
  287. package/dist/seam.d.ts +48 -2
  288. package/dist/seam.js +25 -4
  289. package/dist/seatContract.d.ts +311 -18
  290. package/dist/seatContract.js +824 -100
  291. package/dist/selfOrchestrationDenial.js +7 -19
  292. package/dist/sessionIdSegment.d.ts +6 -0
  293. package/dist/sessionIdSegment.js +24 -0
  294. package/dist/sessionMemoryStatus.js +6 -11
  295. package/dist/sessionPolicyCapability.d.ts +2 -5
  296. package/dist/sessionPolicyCapability.js +8 -12
  297. package/dist/sessionSyncFileHistoryCapability.d.ts +0 -3
  298. package/dist/sessionSyncFileHistoryCapability.js +0 -3
  299. package/dist/settingsHooksSalvage.d.ts +44 -0
  300. package/dist/settingsHooksSalvage.js +211 -0
  301. package/dist/skillToolListsCapability.d.ts +2 -4
  302. package/dist/skillToolListsCapability.js +8 -9
  303. package/dist/sqlEngineCapability.d.ts +0 -4
  304. package/dist/sqlEngineCapability.js +0 -6
  305. package/dist/sseIdleTriage.js +3 -2
  306. package/dist/steerPriorityCapability.d.ts +0 -3
  307. package/dist/steerPriorityCapability.js +0 -3
  308. package/dist/streamDrainingLegs.d.ts +4 -0
  309. package/dist/streamDrainingLegs.js +6 -1
  310. package/dist/subagent/engineCompactWire.d.ts +0 -1
  311. package/dist/subagent/engineCompactWire.js +7 -5
  312. package/dist/subagent/engineSubagentResume.js +15 -9
  313. package/dist/subagent/engineTaskHandleWire.js +4 -7
  314. package/dist/subagentContentStore.d.ts +3 -0
  315. package/dist/subagentContentStore.js +22 -10
  316. package/dist/submitReopen.d.ts +24 -0
  317. package/dist/submitReopen.js +75 -0
  318. package/dist/terminalStatuses.d.ts +3 -0
  319. package/dist/terminalStatuses.js +10 -2
  320. package/dist/toolHistoryMismatch.js +3 -2
  321. package/dist/toolResult.d.ts +10 -1
  322. package/dist/toolResult.js +34 -6
  323. package/dist/toolRoster.d.ts +3 -4
  324. package/dist/toolRoster.js +21 -22
  325. package/dist/turnFailurePresentation.d.ts +39 -0
  326. package/dist/turnFailurePresentation.js +402 -0
  327. package/dist/usageAnalytics.js +6 -11
  328. package/dist/userAttachmentEnvelope.d.ts +1 -0
  329. package/dist/userAttachmentEnvelope.js +37 -7
  330. package/dist/userAttachmentSeat.d.ts +21 -0
  331. package/dist/userAttachmentSeat.js +75 -0
  332. package/dist/userInvokedSkillsCapability.d.ts +11 -4
  333. package/dist/userInvokedSkillsCapability.js +31 -10
  334. package/dist/webSearchBackendCapability.d.ts +0 -4
  335. package/dist/webSearchBackendCapability.js +0 -6
  336. package/dist/wireErrorTriage.d.ts +7 -0
  337. package/dist/wireErrorTriage.js +26 -23
  338. package/dist/wireFailureShape.d.ts +62 -5
  339. package/dist/wireFailureShape.js +106 -5
  340. package/dist/wireRefusalCopy.d.ts +25 -3
  341. package/dist/wireRefusalCopy.js +74 -80
  342. package/dist/workflowsJournalCapability.d.ts +2 -5
  343. package/dist/workflowsJournalCapability.js +8 -12
  344. package/dist/writeProtectionCapability.d.ts +0 -4
  345. package/dist/writeProtectionCapability.js +0 -6
  346. package/docs/INTEGRATION-CLIENTS.md +1775 -56
  347. package/package.json +6 -5
  348. package/dist/attachmentSeatCapability.d.ts +0 -12
  349. package/dist/attachmentSeatCapability.js +0 -23
  350. package/dist/hitl/approvalOutcomeNote.d.ts +0 -10
  351. package/dist/hitl/approvalOutcomeNote.js +0 -29
  352. package/dist/sessionReadRedactionCapability.d.ts +0 -13
  353. package/dist/sessionReadRedactionCapability.js +0 -35
@@ -1,4 +1,5 @@
1
- export type HookMatcherUnjudgedReason = 'event_out_of_scope' | 'not_a_string' | 'oversize' | 'invalid_pattern' | 'pattern_unsupported' | 'over_budget';
1
+ export type HookMatcherUnjudgedReason = 'event_out_of_scope' | 'not_a_string' | 'oversize' | 'pattern_unsupported' | 'over_budget';
2
+ export type HookMatcherRefusedReason = 'alias_without_canonical' | 'invalid_regex';
2
3
  export type HookMatcherVerdict = {
3
4
  readonly kind: 'matchesAll';
4
5
  } | {
@@ -14,6 +15,10 @@ export type HookMatcherVerdict = {
14
15
  readonly reading: 'names' | 'pattern';
15
16
  readonly alias: string;
16
17
  readonly canonical: string;
18
+ } | {
19
+ readonly kind: 'refused';
20
+ readonly reason: 'invalid_regex';
21
+ readonly reading: 'pattern';
17
22
  } | {
18
23
  readonly kind: 'unjudged';
19
24
  readonly reason: HookMatcherUnjudgedReason;
@@ -12,6 +12,9 @@ function unjudged(reason) {
12
12
  function refused(reading, p) {
13
13
  return Object.freeze({ kind: 'refused', reason: 'alias_without_canonical', reading, alias: p.alias, canonical: p.canonical });
14
14
  }
15
+ function refusedInvalidRegex() {
16
+ return Object.freeze({ kind: 'refused', reason: 'invalid_regex', reading: 'pattern' });
17
+ }
15
18
  function aliasPairs() {
16
19
  return Object.entries(HOOK_TOOL_ALIASES).map(([alias, canonical]) => ({ alias, canonical }));
17
20
  }
@@ -185,7 +188,7 @@ export function hookMatcherVerdict(event, matcher) {
185
188
  return unjudged('oversize');
186
189
  const form = SETTINGS_HOOK_MATCHER_FORM(matcher);
187
190
  if (form === 'invalid')
188
- return unjudged('invalid_pattern');
191
+ return refusedInvalidRegex();
189
192
  const pairs = aliasPairs();
190
193
  if (form === 'regex' && matcher !== undefined) {
191
194
  const subjects = pairs.flatMap((p) => [p.alias, p.canonical]);
@@ -199,10 +202,10 @@ export function hookMatcherVerdict(event, matcher) {
199
202
  const selects = (name) => {
200
203
  try {
201
204
  const v = SETTINGS_HOOK_MATCHER_SELECTS(matcher, name);
202
- return typeof v === 'boolean' ? v : undefined;
205
+ return v === true ? true : v === false ? false : 'invalid';
203
206
  }
204
207
  catch {
205
- return undefined;
208
+ return 'threw';
206
209
  }
207
210
  };
208
211
  if (form === 'literal' && selects('') === true)
@@ -211,13 +214,17 @@ export function hookMatcherVerdict(event, matcher) {
211
214
  const selected = [];
212
215
  for (const p of pairs) {
213
216
  const a = selects(p.alias);
214
- if (a === undefined)
215
- return unjudged('invalid_pattern');
217
+ if (a === 'invalid')
218
+ return refusedInvalidRegex();
219
+ if (a === 'threw')
220
+ return unjudged('pattern_unsupported');
216
221
  if (!a)
217
222
  continue;
218
223
  const c = selects(p.canonical);
219
- if (c === undefined)
220
- return unjudged('invalid_pattern');
224
+ if (c === 'invalid')
225
+ return refusedInvalidRegex();
226
+ if (c === 'threw')
227
+ return unjudged('pattern_unsupported');
221
228
  if (!c)
222
229
  return refused(reading, p);
223
230
  selected.push(p);
@@ -4,9 +4,9 @@ import type { WireHooksConfig } from './finalVerifyWire.js';
4
4
  export { GOAL_STOP_HOOK_WIRE_ENV, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, } from './goalStopHook.js';
5
5
  export type { WireHooksConfig };
6
6
  export interface HooksForWireOptions {
7
- readonly plan?: HooksWirePlan;
7
+ readonly plan: HooksWirePlan;
8
8
  }
9
- export declare function hooksForWire(opts?: HooksForWireOptions): WireHooksConfig | undefined;
9
+ export declare function hooksForWire(opts: HooksForWireOptions): WireHooksConfig | undefined;
10
10
  export declare function hooksWirePlan(opts?: HooksWirePlanOptions): HooksWirePlan;
11
11
  export declare function __resetHooksWireCapsForTests(): void;
12
12
  export declare function fleetHookFailureNoticeCapable(baseUrl: string | undefined): boolean;
@@ -1,8 +1,9 @@
1
1
  import { engineCapNestedTrue, engineCapState, engineCapValue } from './engineCapsCache.js';
2
- import { displayUntrusted } from './displayUntrusted.js';
2
+ import { msg, renderMessage } from './i18n/translate.js';
3
3
  import { capForDisplay, collapseLabel } from './fleetTaskDesc.js';
4
4
  import { hostLog, hostSettings } from './host.js';
5
- import { createSettingsHookJudge, decidePluginHooks, dedupeSettingsHookGroups, filterSettingsHookGroups, occupancyOf, settingsHookDropText, } from './pluginHooksWire.js';
5
+ import { hooksSalvageMaskOf, salvageSettingsHooksEntries, settingsHooksSalvageNotice } from './settingsHooksSalvage.js';
6
+ import { createSettingsHookJudge, decidePluginHooks, decideSessionHooks, dedupeSettingsHookGroups, filterSettingsHookGroups, hooksWirePlanShapeOf, occupancyOf, } from './pluginHooksWire.js';
6
7
  import { MAX_HOOK_NOTICE_TEXT_CHARS } from './notifications.js';
7
8
  import { goalStopHookMatcher, __resetGoalStopHookForTests } from './goalStopHook.js';
8
9
  export { GOAL_STOP_HOOK_WIRE_ENV, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, } from './goalStopHook.js';
@@ -100,26 +101,43 @@ function managedPolicyUnreadable(settings) {
100
101
  return true;
101
102
  }
102
103
  }
103
- function hooksOfSource(source) {
104
+ const NO_LAYER = Object.freeze({ hooks: null, mask: undefined });
105
+ function layerOfDoc(source, doc) {
104
106
  try {
105
- const s = hostSettings()?.getSettingsForSource(source);
106
- return s?.hooks && typeof s.hooks === 'object' && !Array.isArray(s.hooks) ? s.hooks : null;
107
+ return classifyLayer(source, doc);
108
+ }
109
+ catch (err) {
110
+ hostLog('debug', `hooksWireCaps: ${source} settings could not be read by the hooks reader — treated as no hooks from this source: ${String(err)}`);
111
+ return NO_LAYER;
112
+ }
113
+ }
114
+ function classifyLayer(source, doc) {
115
+ const salvage = salvageSettingsHooksEntries(doc);
116
+ const hooks = typeof doc === 'object' && doc !== null && !Array.isArray(doc) ? doc.hooks : undefined;
117
+ const original = typeof hooks === 'object' && hooks !== null && !Array.isArray(hooks) ? hooks : null;
118
+ if (salvage.outcome === 'loaded')
119
+ return { hooks: original, mask: undefined };
120
+ const notice = settingsHooksSalvageNotice(salvage, source, doc) ?? '';
121
+ const row = Object.freeze({ source, outcome: salvage.outcome, dropped: salvage.dropped, rejections: salvage.rejections, notice });
122
+ if (salvage.outcome === 'rejected')
123
+ return { hooks: null, mask: undefined, row };
124
+ return { hooks: original, mask: hooksSalvageMaskOf(salvage.dropped), row };
125
+ }
126
+ function layerOfSource(source) {
127
+ let doc;
128
+ try {
129
+ doc = hostSettings()?.getSettingsForSource(source);
107
130
  }
108
131
  catch (err) {
109
132
  hostLog('debug', `hooksWireCaps: ${source} settings read threw — treated as no hooks from this source: ${String(err)}`);
110
- return null;
133
+ return NO_LAYER;
111
134
  }
135
+ return layerOfDoc(source, doc);
112
136
  }
113
137
  let warnedNoPluginReader = new WeakSet();
114
138
  const NO_PLUGIN_READER_WARNING = 'client-core: the installed settings port does not implement enabledPluginHooks() — ' +
115
139
  'plugin hooks are not sent to the engine and are not reported as not running. ' +
116
140
  'Implement SettingsPort.enabledPluginHooks() to list the enabled plugins and their hooks.';
117
- let warnedNoPlanDrops = new WeakMap();
118
- function noPlanDropWarning(event, reason) {
119
- return (`client-core: ${displayUntrusted(event, { credentialUrls: false, credentialWords: false })} hooks from settings are not sent to the engine (${reason}), so they do not run there — ` +
120
- `${settingsHookDropText(reason)}. Build the request with hooksForWire({ plan }) from hooksWirePlan() and show ` +
121
- 'hooksNotRunNotice(plan) to tell the user which hooks will not run.');
122
- }
123
141
  function guardPluginTraversal(run) {
124
142
  try {
125
143
  return run();
@@ -150,48 +168,87 @@ function readPluginHooks(settings, warnIfAbsent) {
150
168
  }
151
169
  return { state: 'absent' };
152
170
  }
153
- const NO_PLAN_ENGINE = { ownedByThisShell: null, pluginHooksCapable: null, hooksCapable: null };
154
- export function hooksForWire(opts = {}) {
155
- const given = opts?.plan;
156
- if (isHooksWirePlan(given))
157
- return given.wire;
158
- if (given !== undefined && given !== null) {
159
- hostLog('debug', 'hooksForWire: opts.plan is not a plan from hooksWirePlan() — treated as absent (settings hooks only)');
160
- }
161
- if (isHooksWirePlan(opts))
162
- return opts.wire;
163
- return buildHooksWirePlan(NO_PLAN_ENGINE, () => false, false, true).wire;
164
- }
165
- function isHooksWirePlan(v) {
171
+ function readSessionHooks(settings) {
166
172
  try {
167
- if (typeof v !== 'object' || v === null || Array.isArray(v))
168
- return false;
169
- const o = v;
170
- for (const k of PLAN_KEYS)
171
- if (!Object.hasOwn(o, k) && k !== 'settingsVerdicts' && k !== 'settingsExcluded')
172
- return false;
173
- const reader = o.pluginReader;
174
- const engineFacts = o.engine;
175
- const wire = o.wire;
176
- const arrayOrAbsent = (k) => !Object.hasOwn(o, k) || Array.isArray(o[k]);
177
- return (Array.isArray(o.verdicts) &&
178
- Array.isArray(o.excluded) &&
179
- Array.isArray(o.settingsDropped) &&
180
- arrayOrAbsent('settingsVerdicts') &&
181
- arrayOrAbsent('settingsExcluded') &&
182
- (reader === 'present' || reader === 'absent' || reader === 'failed') &&
183
- typeof engineFacts === 'object' &&
184
- engineFacts !== null &&
185
- (wire === undefined || (typeof wire === 'object' && wire !== null && !Array.isArray(wire))));
173
+ const member = settings.sessionHooks;
174
+ if (member === undefined)
175
+ return { state: 'absent' };
176
+ if (typeof member !== 'function') {
177
+ hostLog('debug', 'hooksWireCaps: sessionHooks is not a method — no session hooks judged this turn');
178
+ return { state: 'failed' };
179
+ }
180
+ const r = member.call(settings);
181
+ const sources = typeof r === 'object' && r !== null ? r.sources : undefined;
182
+ if (Array.isArray(sources))
183
+ return { state: 'present', sources };
184
+ hostLog('debug', 'hooksWireCaps: sessionHooks() returned a malformed reading — no session hooks judged this turn');
185
+ return { state: 'failed' };
186
186
  }
187
187
  catch (err) {
188
- hostLog('debug', `hooksForWire: a value offered as a plan threw while being read — treated as not a plan: ${String(err)}`);
189
- return false;
188
+ hostLog('debug', `hooksWireCaps: sessionHooks() threw — no session hooks judged this turn: ${String(err)}`);
189
+ return { state: 'failed' };
190
+ }
191
+ }
192
+ function suppressedLocallyOf(o) {
193
+ let raw;
194
+ try {
195
+ raw = o.suppressedLocally;
196
+ }
197
+ catch {
198
+ hostLog('debug', 'hooksWirePlan: suppressedLocally threw while being read — treated as absent (no plugin suppressed locally)');
199
+ return undefined;
200
+ }
201
+ if (raw === undefined)
202
+ return undefined;
203
+ if (!Array.isArray(raw) || !raw.every((x) => typeof x === 'string')) {
204
+ hostLog('debug', 'hooksWirePlan: suppressedLocally is not an array of plugin ids — treated as absent (no plugin suppressed locally)');
205
+ return undefined;
206
+ }
207
+ return new Set(raw);
208
+ }
209
+ function usageError(sentence) {
210
+ return new TypeError(renderMessage(sentence));
211
+ }
212
+ function hostValueShape(v) {
213
+ try {
214
+ if (v === undefined)
215
+ return msg('config.hooks.valueShape.nothing');
216
+ if (v === null)
217
+ return msg('config.hooks.valueShape.null');
218
+ if (Array.isArray(v))
219
+ return msg('config.hooks.valueShape.array');
220
+ return typeof v === 'object' ? msg('config.hooks.valueShape.object') : msg('config.hooks.valueShape.typeof', { type: typeof v });
221
+ }
222
+ catch {
223
+ return msg('config.hooks.valueShape.unreadable');
224
+ }
225
+ }
226
+ export function hooksForWire(opts) {
227
+ if (typeof opts !== 'object' || opts === null)
228
+ throw usageError(msg('config.hooks.forWire.gotShape', { shape: hostValueShape(opts) }));
229
+ let given;
230
+ try {
231
+ given = opts.plan;
190
232
  }
233
+ catch {
234
+ throw usageError(msg('config.hooks.forWire.readPlanThrew'));
235
+ }
236
+ const shape = planShapeOf(given);
237
+ if (shape === 'plan') {
238
+ try {
239
+ return given.wire;
240
+ }
241
+ catch {
242
+ throw usageError(msg('config.hooks.forWire.readWireThrew'));
243
+ }
244
+ }
245
+ if (shape === 'threw')
246
+ throw usageError(msg('config.hooks.forWire.planUnreadable'));
247
+ if (given === undefined && planShapeOf(opts) === 'plan')
248
+ throw usageError(msg('config.hooks.forWire.planPassedBare'));
249
+ throw usageError(given === undefined ? msg('config.hooks.forWire.planMissing') : msg('config.hooks.forWire.planNotPlan', { shape: hostValueShape(given) }));
191
250
  }
192
- const PLAN_KEYS = ['engine', 'pluginReader', 'verdicts', 'excluded', 'settingsDropped', 'settingsVerdicts', 'settingsExcluded', 'wire'];
193
- const _planKeysPin = [true, true];
194
- void _planKeysPin;
251
+ const planShapeOf = hooksWirePlanShapeOf;
195
252
  export function hooksWirePlan(opts = {}) {
196
253
  const o = opts ?? {};
197
254
  const owned = o.engineOwnedByThisShell;
@@ -217,7 +274,7 @@ export function hooksWirePlan(opts = {}) {
217
274
  const types = typesByEvent.get(event);
218
275
  return types === undefined || (typeof type === 'string' && types.has(type));
219
276
  };
220
- return buildHooksWirePlan(engine, shellRuns, true, promptAuthoredByUserOf(o));
277
+ return buildHooksWirePlan(engine, shellRuns, promptAuthoredByUserOf(o), suppressedLocallyOf(o));
221
278
  }
222
279
  function taskHooksCapability(baseUrl) {
223
280
  const v = engineCapValue(baseUrl, 'taskSettings');
@@ -268,16 +325,34 @@ function promptAuthoredByUserOf(o) {
268
325
  }
269
326
  return true;
270
327
  }
271
- function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser) {
328
+ function buildHooksWirePlan(engine, shellRuns, promptAuthoredByUser, suppressedLocally) {
272
329
  const settingsDropped = [];
273
330
  const settingsVerdicts = [];
274
331
  const settingsExcluded = [];
275
- const judge = withPlugins ? createSettingsHookJudge(engine, shellRuns, promptAuthoredByUser) : undefined;
332
+ const settingsSalvage = [];
333
+ let sessionVerdicts = [];
334
+ let sessionReader = 'absent';
335
+ let closedBy = null;
336
+ const judge = createSettingsHookJudge(engine, shellRuns, promptAuthoredByUser);
276
337
  let settingsStripped = 0;
277
- const planOf = (pluginReader, wire, verdicts = [], excluded = []) => ({ engine, pluginReader, verdicts, excluded, settingsDropped, settingsVerdicts, settingsExcluded, wire });
338
+ const planOf = (pluginReader, wire, verdicts = [], excluded = [], moduleVerdicts = []) => ({
339
+ engine,
340
+ pluginReader,
341
+ verdicts,
342
+ excluded,
343
+ settingsDropped,
344
+ settingsVerdicts,
345
+ settingsExcluded,
346
+ settingsSalvage,
347
+ moduleVerdicts,
348
+ sessionVerdicts,
349
+ sessionReader,
350
+ closedBy,
351
+ wire,
352
+ });
278
353
  const closedPlan = (settings, reason) => {
279
- if (!withPlugins)
280
- return planOf('absent', undefined);
354
+ closedBy = reason;
355
+ sessionReader = readSessionHooks(settings).state;
281
356
  const read = readPluginHooks(settings, false);
282
357
  if (read.reading === undefined)
283
358
  return planOf(read.state, undefined);
@@ -311,13 +386,28 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
311
386
  if (managedPolicyUnreadable(settings))
312
387
  return closedPlan(settings, 'governance_unreadable');
313
388
  let policy = null;
389
+ let policyDoc;
314
390
  try {
315
- policy = settings.getSettingsForSource('policySettings');
391
+ policyDoc = settings.getSettingsForSource('policySettings');
392
+ policy = policyDoc;
316
393
  }
317
394
  catch (err) {
318
395
  hostLog('debug', `hooksWireCaps: policySettings read threw — fail-closed (no hooks projected to the engine): ${String(err)}`);
319
396
  return closedPlan(settings, 'governance_unreadable');
320
397
  }
398
+ let policyLayer;
399
+ try {
400
+ policyLayer = classifyLayer('policySettings', policyDoc);
401
+ }
402
+ catch (err) {
403
+ hostLog('debug', `hooksWireCaps: managed settings could not be read by the hooks reader — fail-closed (no hooks projected to the engine): ${String(err)}`);
404
+ return closedPlan(settings, 'governance_unreadable');
405
+ }
406
+ if (policyLayer.row?.outcome === 'rejected') {
407
+ settingsSalvage.push(policyLayer.row);
408
+ hostLog('debug', 'hooksWireCaps: managed settings hooks rejected by the hooks reader — fail-closed (no hooks projected to the engine)');
409
+ return closedPlan(settings, 'governance_unreadable');
410
+ }
321
411
  if (policy?.disableAllHooks === true) {
322
412
  hostLog('debug', 'hooksWireCaps: disableAllHooks (managed) — no hooks projected to the engine');
323
413
  return closedPlan(settings, 'policy_disable_all');
@@ -334,10 +424,25 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
334
424
  hostLog('debug', 'hooksWireCaps: disableAllHooks (merged, non-managed) — only policySettings hooks projected to the engine');
335
425
  }
336
426
  const managedOnly = managedByPolicy || disabledByNonManaged;
337
- const read = withPlugins ? readPluginHooks(settings, true) : undefined;
427
+ {
428
+ const sr = readSessionHooks(settings);
429
+ sessionReader = sr.state;
430
+ if (sr.sources !== undefined && !managedOnly) {
431
+ const sources = sr.sources;
432
+ const ds = guardPluginTraversal(() => decideSessionHooks({ sources, engine, shellRuns, promptAuthoredByUser }));
433
+ if (ds === undefined)
434
+ sessionReader = 'failed';
435
+ else {
436
+ sessionVerdicts = ds.verdicts;
437
+ if (ds.unreadable > 0)
438
+ hostLog('debug', `hooksWireCaps: ${ds.unreadable} session hook source(s) or group(s) unreadable — skipped`);
439
+ }
440
+ }
441
+ }
442
+ const read = readPluginHooks(settings, true);
338
443
  let oldStartupBit;
339
444
  let pluginDataThrew = false;
340
- if (read?.reading !== undefined) {
445
+ if (read.reading !== undefined) {
341
446
  const reading = read.reading;
342
447
  const bit = guardPluginTraversal(() => reading.suppressedByStartupMode === true);
343
448
  if (bit === undefined)
@@ -356,13 +461,18 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
356
461
  const merged = {};
357
462
  const sourced = new Map();
358
463
  for (const source of sources) {
359
- const hooks = hooksOfSource(source);
464
+ const layer = source === 'policySettings' ? policyLayer : layerOfSource(source);
465
+ if (layer.row !== undefined)
466
+ settingsSalvage.push(layer.row);
467
+ const hooks = layer.hooks;
360
468
  if (!hooks)
361
469
  continue;
362
470
  for (const [event, groups] of Object.entries(hooks)) {
471
+ if (layer.mask !== undefined && layer.mask.eventDropped(event))
472
+ continue;
363
473
  if (!Array.isArray(groups) || groups.length === 0)
364
474
  continue;
365
- const kept = filterSettingsHookGroups(source, event, groups, engine.pluginHooksCapable === true, (type) => shellRuns(event, type), !withPlugins, judge);
475
+ const kept = filterSettingsHookGroups(source, event, groups, engine.pluginHooksCapable === true, (type) => shellRuns(event, type), judge, layer.mask);
366
476
  settingsDropped.push(...kept.drops);
367
477
  settingsVerdicts.push(...kept.verdicts);
368
478
  settingsExcluded.push(...kept.excluded);
@@ -401,25 +511,8 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
401
511
  'stripped before sending (plugin context is only minted for entries from the plugin reader)');
402
512
  }
403
513
  const wireOf = () => (Object.keys(merged).length > 0 ? merged : undefined);
404
- if (!withPlugins) {
405
- let seen = warnedNoPlanDrops.get(settings);
406
- for (const d of settingsDropped) {
407
- if (!d.notRun)
408
- continue;
409
- const key = `${d.event}\u0000${d.reason}`;
410
- if (seen?.has(key) === true)
411
- continue;
412
- if (seen === undefined) {
413
- seen = new Set();
414
- warnedNoPlanDrops.set(settings, seen);
415
- }
416
- seen.add(key);
417
- hostLog('warn', noPlanDropWarning(d.event, d.reason));
418
- }
419
- return planOf('absent', wireOf());
420
- }
421
- if (read?.reading === undefined)
422
- return planOf(read?.state ?? 'absent', wireOf());
514
+ if (read.reading === undefined)
515
+ return planOf(read.state, wireOf());
423
516
  if (pluginDataThrew)
424
517
  return planOf('failed', wireOf());
425
518
  const reading = read.reading;
@@ -436,6 +529,7 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
436
529
  shellRuns,
437
530
  promptAuthoredByUser,
438
531
  occupied,
532
+ ...(suppressedLocally !== undefined ? { suppressedLocally } : {}),
439
533
  });
440
534
  });
441
535
  if (d === undefined)
@@ -445,13 +539,12 @@ function buildHooksWirePlan(engine, shellRuns, withPlugins, promptAuthoredByUser
445
539
  }
446
540
  for (const [event, groups] of d.projected)
447
541
  merged[event] = [...(merged[event] ?? []), ...groups];
448
- return planOf('present', wireOf(), d.verdicts, d.excluded);
542
+ return planOf('present', wireOf(), d.verdicts, d.excluded, d.modules);
449
543
  }
450
544
  export function __resetHooksWireCapsForTests() {
451
545
  __resetGoalStopHookForTests();
452
546
  warnedNoMergedReader = new WeakSet();
453
547
  warnedNoPluginReader = new WeakSet();
454
- warnedNoPlanDrops = new WeakMap();
455
548
  }
456
549
  export function fleetHookFailureNoticeCapable(baseUrl) {
457
550
  return engineCapNestedTrue(baseUrl, 'fleet', 'hookFailureNotice');
package/dist/host.d.ts CHANGED
@@ -9,6 +9,7 @@ export interface SettingsPort {
9
9
  enabledPluginHooks?(): PluginHooksReading;
10
10
  hooksStartupMode?(): HooksStartupMode | undefined;
11
11
  managedPolicyReading?(): ManagedPolicyReading;
12
+ sessionHooks?(): SessionHooksReading;
12
13
  }
13
14
  export type ManagedPolicyState = 'absent' | 'in-effect' | 'unreadable';
14
15
  export interface ManagedPolicyReading {
@@ -32,6 +33,26 @@ export interface PluginHookSource {
32
33
  readonly managed: boolean;
33
34
  readonly options?: Readonly<Record<string, PluginHookOption>>;
34
35
  readonly hooks: WireHooksConfig;
36
+ readonly hooksModule?: boolean;
37
+ }
38
+ export type SessionHookOrigin = 'skill' | 'agent' | 'sdk_host';
39
+ export interface SessionHookSource {
40
+ readonly origin: SessionHookOrigin;
41
+ readonly name: string;
42
+ readonly hooks: WireHooksConfig | {
43
+ readonly [event: string]: readonly {
44
+ readonly matcher?: string;
45
+ readonly hooks: readonly (NonNullable<WireHooksConfig[string]>[number]['hooks'][number] | SessionLocalHook)[];
46
+ }[] | undefined;
47
+ };
48
+ }
49
+ export interface SessionLocalHook {
50
+ readonly type: 'callback' | 'function';
51
+ readonly callback?: (...args: never[]) => void;
52
+ readonly timeout?: number;
53
+ }
54
+ export interface SessionHooksReading {
55
+ readonly sources: readonly SessionHookSource[];
35
56
  }
36
57
  export interface PluginHooksReading {
37
58
  readonly plugins: readonly PluginHookSource[];
@@ -0,0 +1,71 @@
1
+ import type { WireHooksConfig } from './finalVerifyWire.js';
2
+ import type { SettingsDocument } from './host.js';
3
+ import { type HookSettingsSource, type HooksWirePlan } from './pluginHooksWire.js';
4
+ export declare const HOST_SUPPLIED_KEYS: readonly ["settings.hooks", "settings.resolved", "settings.webSearch", "settings.outputStyle"];
5
+ export type HostSuppliedKey = (typeof HOST_SUPPLIED_KEYS)[number];
6
+ export declare const HOST_SETTING_CAUSES: readonly ["carried", "entries_dropped", "source_rejected", "projection_failed", "source_unreadable", "empty", "no_source", "host_port_missing"];
7
+ export type HostSettingCause = (typeof HOST_SETTING_CAUSES)[number];
8
+ export declare const HOST_SETTING_DISPOSITIONS: readonly ["carry", "carry_partial", "withhold_notice", "refuse_turn", "unwired", "nothing_to_carry"];
9
+ export type HostSettingDisposition = (typeof HOST_SETTING_DISPOSITIONS)[number];
10
+ export type HostSettingPlane = 'turn' | 'session' | 'diagnostic';
11
+ export type HostSettingNoticeId = 'HS-UNWIRED' | 'HS-MANAGED-REJECTED' | 'HS-PROJECTION' | 'HS-SOURCE-UNREADABLE';
12
+ export interface HostSettingRow {
13
+ readonly key: HostSuppliedKey;
14
+ readonly cause: HostSettingCause;
15
+ readonly disposition: HostSettingDisposition;
16
+ readonly layers?: readonly HookSettingsSource[];
17
+ }
18
+ export interface HostSettingNotice {
19
+ readonly id: HostSettingNoticeId;
20
+ readonly plane: HostSettingPlane;
21
+ readonly text: string;
22
+ }
23
+ export type HostTurnVerdict = {
24
+ readonly kind: 'send';
25
+ } | {
26
+ readonly kind: 'refuse';
27
+ readonly notice: HostSettingNotice;
28
+ };
29
+ export interface HostTurnSettingsSources {
30
+ readonly hooks: {
31
+ readonly plan: HooksWirePlan;
32
+ } | 'none';
33
+ readonly resolved: {
34
+ readonly snapshot: SettingsDocument;
35
+ } | 'none';
36
+ readonly webSearch: {
37
+ readonly settings: SettingsDocument;
38
+ } | 'none';
39
+ readonly outputStyle: {
40
+ readonly name: string;
41
+ } | 'none';
42
+ }
43
+ export interface HostTurnSettingsInput {
44
+ readonly sources: HostTurnSettingsSources;
45
+ }
46
+ export interface HostSettingsCarried {
47
+ readonly hooks?: WireHooksConfig;
48
+ readonly resolved?: SettingsDocument;
49
+ readonly webSearch?: SettingsDocument;
50
+ readonly outputStyle?: string;
51
+ }
52
+ declare const hostTurnSettingsBrand: unique symbol;
53
+ export interface HostTurnSettings {
54
+ readonly [hostTurnSettingsBrand]: true;
55
+ readonly verdict: HostTurnVerdict;
56
+ readonly rows: readonly HostSettingRow[];
57
+ readonly notices: readonly HostSettingNotice[];
58
+ readonly hooks: HooksWirePlan | undefined;
59
+ readonly carried: HostSettingsCarried;
60
+ }
61
+ export declare function rethrowHostResolvedDeferred(product: HostTurnSettings): void;
62
+ export type HostResolvedMaterializer = (snapshot: SettingsDocument) => SettingsDocument;
63
+ export declare function buildHostTurnSettings(input: HostTurnSettingsInput, materialize: HostResolvedMaterializer): HostTurnSettings;
64
+ export declare function hostSettingsSelfCheck(product: HostTurnSettings): readonly HostSuppliedKey[];
65
+ export declare class HostSettingsRefused extends Error {
66
+ readonly notice: HostSettingNotice;
67
+ constructor(n: HostSettingNotice);
68
+ }
69
+ export declare function hostTurnSettingsOf(v: unknown, depth?: 'shape' | 'full'): HostTurnSettings | undefined;
70
+ export declare const UNWIRED_HOST_TURN_SETTINGS: HostTurnSettings;
71
+ export {};