@sema-agent/client-core 0.77.0 → 0.77.2

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 (382) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/README.md +5 -4
  3. package/dist/abortableSleep.d.ts +0 -28
  4. package/dist/abortableSleep.js +0 -28
  5. package/dist/adapt/arms.d.ts +0 -46
  6. package/dist/adapt/arms.js +9 -544
  7. package/dist/adapt/ids.d.ts +0 -58
  8. package/dist/adapt/ids.js +0 -63
  9. package/dist/adapt/instanceLedger.d.ts +0 -25
  10. package/dist/adapt/instanceLedger.js +0 -20
  11. package/dist/adapt/panelTasks.d.ts +0 -69
  12. package/dist/adapt/panelTasks.js +0 -95
  13. package/dist/adapt/textSegmentAuthority.d.ts +1 -137
  14. package/dist/adapt/textSegmentAuthority.js +0 -54
  15. package/dist/adapt/textStream.d.ts +0 -252
  16. package/dist/adapt/textStream.js +2 -281
  17. package/dist/adapt/toolCards.d.ts +0 -46
  18. package/dist/adapt/toolCards.js +0 -23
  19. package/dist/adapt/turnFlags.d.ts +0 -54
  20. package/dist/adapt/turnFlags.js +1 -17
  21. package/dist/adapt/wireShapes.d.ts +0 -92
  22. package/dist/adapt/wireShapes.js +0 -83
  23. package/dist/adapt.d.ts +0 -55
  24. package/dist/adapt.js +1 -120
  25. package/dist/adapter/activeRunSelfHeal.d.ts +22 -515
  26. package/dist/adapter/activeRunSelfHeal.js +10 -625
  27. package/dist/adapter/downstream/eventToSdkMessage.d.ts +2 -305
  28. package/dist/adapter/downstream/eventToSdkMessage.js +2 -867
  29. package/dist/adapter/downstream/terminalToSdkResult.d.ts +2 -314
  30. package/dist/adapter/downstream/terminalToSdkResult.js +13 -560
  31. package/dist/adapter/downstream/turnUsageToModelUsage.d.ts +0 -95
  32. package/dist/adapter/downstream/turnUsageToModelUsage.js +2 -31
  33. package/dist/adapter/runStream.d.ts +0 -206
  34. package/dist/adapter/runStream.js +6 -596
  35. package/dist/adapter/types.d.ts +0 -111
  36. package/dist/adapter/types.js +0 -29
  37. package/dist/agentSession/backgroundView.d.ts +0 -106
  38. package/dist/agentSession/backgroundView.js +3 -49
  39. package/dist/agentSession/contract.d.ts +0 -98
  40. package/dist/agentSession/contract.js +0 -12
  41. package/dist/agentsWireCaps.d.ts +0 -72
  42. package/dist/agentsWireCaps.js +4 -72
  43. package/dist/approvalsStreamLiveCapability.d.ts +0 -25
  44. package/dist/approvalsStreamLiveCapability.js +0 -31
  45. package/dist/argvFlagValue.d.ts +0 -33
  46. package/dist/argvFlagValue.js +3 -35
  47. package/dist/attachmentsWireCaps.d.ts +0 -127
  48. package/dist/attachmentsWireCaps.js +0 -144
  49. package/dist/autoModeUnavailable.d.ts +0 -120
  50. package/dist/autoModeUnavailable.js +0 -144
  51. package/dist/classifierStatus.d.ts +0 -72
  52. package/dist/classifierStatus.js +0 -167
  53. package/dist/classifierVerdictWire.d.ts +0 -54
  54. package/dist/classifierVerdictWire.js +0 -133
  55. package/dist/clientContextWireCaps.d.ts +0 -37
  56. package/dist/clientContextWireCaps.js +0 -36
  57. package/dist/clientSlice.d.ts +0 -63
  58. package/dist/clientSlice.js +0 -45
  59. package/dist/cloudConfigWireCaps.d.ts +0 -86
  60. package/dist/cloudConfigWireCaps.js +2 -65
  61. package/dist/compensations.d.ts +0 -52
  62. package/dist/compensations.js +2 -63
  63. package/dist/controlRouter.d.ts +2 -208
  64. package/dist/controlRouter.js +1 -129
  65. package/dist/coreValuePorts.d.ts +0 -84
  66. package/dist/coreValuePorts.js +0 -29
  67. package/dist/decideReceipt.d.ts +0 -110
  68. package/dist/decideReceipt.js +0 -84
  69. package/dist/detachWire.d.ts +0 -130
  70. package/dist/detachWire.js +1 -130
  71. package/dist/deviceExecutorManagementCapability.d.ts +2 -35
  72. package/dist/deviceExecutorManagementCapability.js +1 -37
  73. package/dist/diagnostics.d.ts +0 -8
  74. package/dist/diagnostics.js +0 -8
  75. package/dist/diff/patch.d.ts +0 -17
  76. package/dist/diff/patch.js +0 -19
  77. package/dist/effectiveFacts.d.ts +0 -40
  78. package/dist/effectiveFacts.js +0 -22
  79. package/dist/effortWire.d.ts +0 -11
  80. package/dist/effortWire.js +0 -12
  81. package/dist/engineAgentPanelStore.d.ts +0 -169
  82. package/dist/engineAgentPanelStore.js +13 -293
  83. package/dist/engineCapReader.d.ts +0 -62
  84. package/dist/engineCapReader.js +1 -43
  85. package/dist/engineCapsCache.d.ts +0 -177
  86. package/dist/engineCapsCache.js +0 -199
  87. package/dist/engineCapsGenerationGuard.d.ts +0 -2
  88. package/dist/engineCapsGenerationGuard.js +0 -11
  89. package/dist/engineErrorCodes.d.ts +1 -316
  90. package/dist/engineErrorCodes.js +0 -427
  91. package/dist/engineHttpTools.d.ts +0 -29
  92. package/dist/engineHttpTools.js +0 -29
  93. package/dist/engineIdentity.d.ts +0 -83
  94. package/dist/engineIdentity.js +0 -88
  95. package/dist/engineInlineTaskStats.d.ts +0 -57
  96. package/dist/engineInlineTaskStats.js +1 -42
  97. package/dist/engineNoticeCodes.d.ts +0 -190
  98. package/dist/engineNoticeCodes.js +0 -182
  99. package/dist/engineSessionParam.d.ts +0 -30
  100. package/dist/engineSessionParam.js +0 -52
  101. package/dist/engineToolLabelStore.d.ts +0 -29
  102. package/dist/engineToolLabelStore.js +0 -31
  103. package/dist/engineWireSdk.d.ts +0 -90
  104. package/dist/engineWireSdk.js +0 -74
  105. package/dist/engineWireTarget.d.ts +0 -14
  106. package/dist/engineWireTarget.js +0 -39
  107. package/dist/env/localeGeo.d.ts +0 -12
  108. package/dist/env/localeGeo.js +2 -77
  109. package/dist/env/localeTag.d.ts +0 -34
  110. package/dist/env/localeTag.js +0 -32
  111. package/dist/env/uiLanguage.d.ts +0 -13
  112. package/dist/env/uiLanguage.js +0 -25
  113. package/dist/envFlag.d.ts +0 -37
  114. package/dist/envFlag.js +0 -40
  115. package/dist/executionLaneCapability.d.ts +0 -48
  116. package/dist/executionLaneCapability.js +0 -54
  117. package/dist/finalVerifyWire.d.ts +0 -67
  118. package/dist/finalVerifyWire.js +3 -43
  119. package/dist/fleet/fleetLedger.d.ts +0 -308
  120. package/dist/fleet/fleetLedger.js +10 -429
  121. package/dist/fleet/fleetProjection.d.ts +0 -240
  122. package/dist/fleet/fleetProjection.js +0 -189
  123. package/dist/fleet/fleetRowAgentType.d.ts +0 -6
  124. package/dist/fleet/fleetRowAgentType.js +1 -32
  125. package/dist/fleet/workflowSizeWarning.d.ts +0 -47
  126. package/dist/fleet/workflowSizeWarning.js +1 -46
  127. package/dist/fleetAgentPanelProjection.d.ts +0 -48
  128. package/dist/fleetAgentPanelProjection.js +8 -173
  129. package/dist/fleetTaskDesc.d.ts +0 -39
  130. package/dist/fleetTaskDesc.js +0 -69
  131. package/dist/forkWireCaps.d.ts +0 -23
  132. package/dist/forkWireCaps.js +1 -24
  133. package/dist/gateOutcome.d.ts +0 -140
  134. package/dist/gateOutcome.js +0 -85
  135. package/dist/gateVocabulary.d.ts +0 -114
  136. package/dist/gateVocabulary.js +1 -161
  137. package/dist/goalStopHook.d.ts +0 -127
  138. package/dist/goalStopHook.js +0 -178
  139. package/dist/headlessPermissionModeWire.d.ts +0 -76
  140. package/dist/headlessPermissionModeWire.js +1 -155
  141. package/dist/headlessReconnectWire.d.ts +0 -84
  142. package/dist/headlessReconnectWire.js +13 -67
  143. package/dist/hitl/approvalDecisionNoteAudit.d.ts +0 -49
  144. package/dist/hitl/approvalDecisionNoteAudit.js +0 -56
  145. package/dist/hitl/approvalOutcomeNote.d.ts +0 -2
  146. package/dist/hitl/approvalOutcomeNote.js +0 -20
  147. package/dist/hitl/approvalResolution.d.ts +0 -113
  148. package/dist/hitl/approvalResolution.js +0 -66
  149. package/dist/hitl/approvalsFeed.d.ts +0 -183
  150. package/dist/hitl/approvalsFeed.js +12 -243
  151. package/dist/hitl/armedGateRegistry.d.ts +0 -55
  152. package/dist/hitl/armedGateRegistry.js +0 -146
  153. package/dist/hitl/askGateWire.d.ts +0 -86
  154. package/dist/hitl/askGateWire.js +1 -95
  155. package/dist/hitl/askParkRowRouting.d.ts +0 -123
  156. package/dist/hitl/askParkRowRouting.js +1 -89
  157. package/dist/hitl/crashConverged.d.ts +0 -148
  158. package/dist/hitl/crashConverged.js +0 -214
  159. package/dist/hitl/editedRuleTextPrecheck.d.ts +0 -109
  160. package/dist/hitl/editedRuleTextPrecheck.js +0 -71
  161. package/dist/hitl/frameRouter.d.ts +0 -134
  162. package/dist/hitl/frameRouter.js +6 -378
  163. package/dist/hitl/gateIdentity.d.ts +0 -39
  164. package/dist/hitl/gateIdentity.js +0 -41
  165. package/dist/hitl/gateLedger.d.ts +0 -267
  166. package/dist/hitl/gateLedger.js +0 -121
  167. package/dist/hitl/hitlBridge.d.ts +7 -431
  168. package/dist/hitl/hitlBridge.js +7 -476
  169. package/dist/hitl/hitlHostSurface.d.ts +0 -150
  170. package/dist/hitl/hitlHostSurface.js +0 -169
  171. package/dist/hitl/livePendingAsk.d.ts +0 -91
  172. package/dist/hitl/livePendingAsk.js +0 -74
  173. package/dist/hitl/localAllowRule.d.ts +0 -62
  174. package/dist/hitl/localAllowRule.js +1 -33
  175. package/dist/hitl/parkOwnership.d.ts +0 -56
  176. package/dist/hitl/parkOwnership.js +0 -22
  177. package/dist/hitl/parkResolver.d.ts +3 -88
  178. package/dist/hitl/parkResolver.js +8 -349
  179. package/dist/hitl/parkRowBirthWait.d.ts +2 -26
  180. package/dist/hitl/parkRowBirthWait.js +3 -93
  181. package/dist/hitl/persistedRulesWire.d.ts +13 -358
  182. package/dist/hitl/persistedRulesWire.js +0 -310
  183. package/dist/hitl/planReviewWire.d.ts +4 -176
  184. package/dist/hitl/planReviewWire.js +9 -312
  185. package/dist/hitl/resumeRunningCard.d.ts +0 -105
  186. package/dist/hitl/resumeRunningCard.js +0 -105
  187. package/dist/hitl/sessionPolicyWire.d.ts +11 -191
  188. package/dist/hitl/sessionPolicyWire.js +0 -149
  189. package/dist/hitl/suspendedReopen.d.ts +3 -24
  190. package/dist/hitl/suspendedReopen.js +0 -14
  191. package/dist/hitl/toolApprovalWire.d.ts +5 -1308
  192. package/dist/hitl/toolApprovalWire.js +5 -945
  193. package/dist/hooksWireCaps.d.ts +0 -38
  194. package/dist/hooksWireCaps.js +0 -190
  195. package/dist/host.d.ts +0 -105
  196. package/dist/host.js +0 -33
  197. package/dist/hostEnv.d.ts +0 -14
  198. package/dist/hostEnv.js +0 -13
  199. package/dist/imagesWireCaps.d.ts +0 -21
  200. package/dist/imagesWireCaps.js +0 -22
  201. package/dist/index.d.ts +0 -134
  202. package/dist/index.js +0 -476
  203. package/dist/interactiveHalt.d.ts +5 -153
  204. package/dist/interactiveHalt.js +0 -111
  205. package/dist/interactiveToolsWire.d.ts +0 -62
  206. package/dist/interactiveToolsWire.js +1 -67
  207. package/dist/leaderConflict.d.ts +0 -59
  208. package/dist/leaderConflict.js +0 -48
  209. package/dist/limitsWire.d.ts +0 -125
  210. package/dist/limitsWire.js +2 -120
  211. package/dist/liveInitToolFace.d.ts +0 -77
  212. package/dist/liveInitToolFace.js +1 -109
  213. package/dist/liveModelCatalog.d.ts +0 -52
  214. package/dist/liveModelCatalog.js +0 -48
  215. package/dist/liveQuestionStore.d.ts +0 -87
  216. package/dist/liveQuestionStore.js +1 -56
  217. package/dist/mcpLiveness.d.ts +0 -151
  218. package/dist/mcpLiveness.js +0 -122
  219. package/dist/mcpPanel.d.ts +0 -104
  220. package/dist/mcpPanel.js +0 -49
  221. package/dist/mcpReconnect.d.ts +0 -58
  222. package/dist/mcpReconnect.js +1 -69
  223. package/dist/mcpWireCaps.d.ts +0 -55
  224. package/dist/mcpWireCaps.js +1 -13
  225. package/dist/memoryComplianceCapability.d.ts +3 -57
  226. package/dist/memoryComplianceCapability.js +0 -57
  227. package/dist/memoryEntriesWire.d.ts +6 -198
  228. package/dist/memoryEntriesWire.js +0 -144
  229. package/dist/memoryOriginCapability.d.ts +3 -53
  230. package/dist/memoryOriginCapability.js +0 -50
  231. package/dist/memorySpecWire.d.ts +0 -116
  232. package/dist/memorySpecWire.js +0 -150
  233. package/dist/model/catalog.d.ts +0 -111
  234. package/dist/model/catalog.js +0 -87
  235. package/dist/model/catalogLoader.d.ts +0 -114
  236. package/dist/model/catalogLoader.js +2 -139
  237. package/dist/model/modelSupplyRules.d.ts +1 -55
  238. package/dist/model/modelSupplyRules.js +0 -62
  239. package/dist/model/providerAuth.d.ts +0 -103
  240. package/dist/model/providerAuth.js +2 -38
  241. package/dist/model/providerCatalog.d.ts +0 -45
  242. package/dist/model/providerCatalog.js +0 -37
  243. package/dist/model/providerPresets.d.ts +0 -33
  244. package/dist/model/providerPresets.js +2 -91
  245. package/dist/model/tierVocabulary.d.ts +0 -31
  246. package/dist/model/tierVocabulary.js +0 -27
  247. package/dist/modelBudgetRule.d.ts +0 -39
  248. package/dist/modelBudgetRule.js +0 -39
  249. package/dist/modelCapabilityProbe.d.ts +0 -175
  250. package/dist/modelCapabilityProbe.js +0 -147
  251. package/dist/modelWireCaps.d.ts +0 -13
  252. package/dist/modelWireCaps.js +0 -13
  253. package/dist/notifications.d.ts +0 -233
  254. package/dist/notifications.js +14 -492
  255. package/dist/oneShotWireCaps.d.ts +0 -34
  256. package/dist/oneShotWireCaps.js +0 -35
  257. package/dist/ownKey.d.ts +0 -33
  258. package/dist/ownKey.js +0 -33
  259. package/dist/panelRunningHistory.d.ts +0 -28
  260. package/dist/panelRunningHistory.js +0 -43
  261. package/dist/peerFrames.d.ts +0 -71
  262. package/dist/peerFrames.js +0 -168
  263. package/dist/peerLaneCapability.d.ts +0 -44
  264. package/dist/peerLaneCapability.js +0 -52
  265. package/dist/permissionRuleIssue.d.ts +0 -30
  266. package/dist/permissionRuleIssue.js +0 -78
  267. package/dist/permissionRulesWriteCapability.d.ts +0 -46
  268. package/dist/permissionRulesWriteCapability.js +0 -54
  269. package/dist/permissionWireCaps.d.ts +0 -37
  270. package/dist/permissionWireCaps.js +0 -37
  271. package/dist/postureKnob.d.ts +0 -71
  272. package/dist/postureKnob.js +0 -86
  273. package/dist/principalWire.d.ts +0 -17
  274. package/dist/principalWire.js +0 -17
  275. package/dist/printToolResultFrame.d.ts +0 -100
  276. package/dist/printToolResultFrame.js +0 -33
  277. package/dist/promptProfileWireCaps.d.ts +0 -13
  278. package/dist/promptProfileWireCaps.js +0 -13
  279. package/dist/readFacePosture.d.ts +0 -43
  280. package/dist/readFacePosture.js +0 -46
  281. package/dist/request/printNotification.d.ts +0 -20
  282. package/dist/request/printNotification.js +0 -55
  283. package/dist/request/taskRequest.d.ts +0 -249
  284. package/dist/request/taskRequest.js +10 -496
  285. package/dist/resumeRefusalCopy.d.ts +0 -136
  286. package/dist/resumeRefusalCopy.js +1 -117
  287. package/dist/retainBackgroundWireCaps.d.ts +0 -48
  288. package/dist/retainBackgroundWireCaps.js +0 -48
  289. package/dist/retryStatus.d.ts +2 -221
  290. package/dist/retryStatus.js +0 -107
  291. package/dist/rewindWireCaps.d.ts +0 -27
  292. package/dist/rewindWireCaps.js +0 -24
  293. package/dist/runCancelContext.d.ts +1 -20
  294. package/dist/runCancelContext.js +0 -34
  295. package/dist/runTerminal.d.ts +0 -273
  296. package/dist/runTerminal.js +0 -177
  297. package/dist/sandboxWire.d.ts +0 -38
  298. package/dist/sandboxWire.js +0 -82
  299. package/dist/scenarioWire.d.ts +0 -60
  300. package/dist/scenarioWire.js +0 -68
  301. package/dist/scratchpadWireCaps.d.ts +0 -11
  302. package/dist/scratchpadWireCaps.js +0 -32
  303. package/dist/sdkWireTransit.d.ts +0 -38
  304. package/dist/sdkWireTransit.js +0 -30
  305. package/dist/seam.d.ts +18 -853
  306. package/dist/seam.js +0 -52
  307. package/dist/seatContract.d.ts +0 -555
  308. package/dist/seatContract.js +5 -304
  309. package/dist/selfOrchestrationDenial.d.ts +0 -189
  310. package/dist/selfOrchestrationDenial.js +0 -162
  311. package/dist/selfOrchestrationWireCaps.d.ts +0 -38
  312. package/dist/selfOrchestrationWireCaps.js +0 -38
  313. package/dist/sessionMap.d.ts +0 -60
  314. package/dist/sessionMap.js +0 -37
  315. package/dist/sessionMemoryStatus.d.ts +11 -114
  316. package/dist/sessionMemoryStatus.js +0 -112
  317. package/dist/sessionModelLatch.d.ts +0 -29
  318. package/dist/sessionModelLatch.js +0 -40
  319. package/dist/sessionPolicyCapability.d.ts +3 -53
  320. package/dist/sessionPolicyCapability.js +0 -52
  321. package/dist/sessionSlot.d.ts +0 -26
  322. package/dist/sessionSlot.js +0 -17
  323. package/dist/skillsWireCaps.d.ts +0 -87
  324. package/dist/skillsWireCaps.js +0 -38
  325. package/dist/sqlEngineCapability.d.ts +0 -118
  326. package/dist/sqlEngineCapability.js +0 -134
  327. package/dist/sseIdleTriage.d.ts +0 -79
  328. package/dist/sseIdleTriage.js +1 -80
  329. package/dist/steering.d.ts +0 -54
  330. package/dist/steering.js +0 -63
  331. package/dist/subagent/engineCompactWire.d.ts +0 -34
  332. package/dist/subagent/engineCompactWire.js +4 -134
  333. package/dist/subagent/engineDelegatedPrompt.d.ts +0 -31
  334. package/dist/subagent/engineDelegatedPrompt.js +1 -103
  335. package/dist/subagent/engineRowStopGate.d.ts +0 -20
  336. package/dist/subagent/engineRowStopGate.js +0 -49
  337. package/dist/subagent/engineSubagentOutput.d.ts +0 -7
  338. package/dist/subagent/engineSubagentOutput.js +1 -51
  339. package/dist/subagent/engineSubagentResume.d.ts +2 -279
  340. package/dist/subagent/engineSubagentResume.js +2 -129
  341. package/dist/subagent/engineSubagentSteer.d.ts +0 -26
  342. package/dist/subagent/engineSubagentSteer.js +0 -63
  343. package/dist/subagent/engineSubagentTail.d.ts +0 -38
  344. package/dist/subagent/engineSubagentTail.js +2 -110
  345. package/dist/subagent/engineTaskHandleWire.d.ts +11 -65
  346. package/dist/subagent/engineTaskHandleWire.js +20 -131
  347. package/dist/subagent/subagentOwnerAbsence.d.ts +0 -2
  348. package/dist/subagent/subagentOwnerAbsence.js +0 -25
  349. package/dist/subagentContentStore.d.ts +3 -260
  350. package/dist/subagentContentStore.js +7 -540
  351. package/dist/systemReminderTag.d.ts +0 -49
  352. package/dist/systemReminderTag.js +0 -61
  353. package/dist/toolResult.d.ts +1 -211
  354. package/dist/toolResult.js +1 -358
  355. package/dist/toolRoster.d.ts +0 -140
  356. package/dist/toolRoster.js +0 -66
  357. package/dist/typePins.d.ts +0 -46
  358. package/dist/types/engineState.d.ts +0 -71
  359. package/dist/types/engineState.js +0 -16
  360. package/dist/ultracodeWireCaps.d.ts +0 -75
  361. package/dist/ultracodeWireCaps.js +0 -92
  362. package/dist/unrefTimer.d.ts +0 -27
  363. package/dist/webSearchBackendCapability.d.ts +0 -72
  364. package/dist/webSearchBackendCapability.js +0 -79
  365. package/dist/webSearchWireCaps.d.ts +0 -37
  366. package/dist/webSearchWireCaps.js +0 -34
  367. package/dist/websearch/searchProviderPresets.d.ts +0 -81
  368. package/dist/websearch/searchProviderPresets.js +0 -27
  369. package/dist/wireErrorTriage.d.ts +4 -160
  370. package/dist/wireErrorTriage.js +0 -171
  371. package/dist/wireRefusalCopy.d.ts +0 -28
  372. package/dist/wireRefusalCopy.js +0 -28
  373. package/dist/workflow.d.ts +0 -40
  374. package/dist/workflow.js +0 -52
  375. package/dist/workflowClient.d.ts +0 -122
  376. package/dist/workflowClient.js +8 -360
  377. package/dist/workflowMonitor.d.ts +2 -72
  378. package/dist/workflowMonitor.js +0 -26
  379. package/dist/writeProtectionCapability.d.ts +0 -112
  380. package/dist/writeProtectionCapability.js +0 -109
  381. package/docs/INTEGRATION-CLIENTS.md +62 -1
  382. package/package.json +1 -1
@@ -2,46 +2,8 @@ import { type HookFailureNotice } from './notifications.js';
2
2
  import type { WireHooksConfig } from './finalVerifyWire.js';
3
3
  export { GOAL_STOP_HOOK_WIRE_ENV, CC_STOP_SEMANTICS_MIN_SERVER, ccStopSemanticsFromVersion, engineCcStopSemantics, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, getWireSessionStopHookCcSemantics, buildGoalStopHookPrompt, } from './goalStopHook.js';
4
4
  export type { WireHooksConfig };
5
- /**
6
- * The merged, GOVERNANCE-GATED settings-file hooks for the wire, or undefined when none apply.
7
- * Per-event arrays concatenate across sources (policy → user → project → local).
8
- */
9
5
  export declare function hooksForWire(): WireHooksConfig | undefined;
10
- /** 测试钩:清 `/goal` 锁存(壳里靠进程边界隔离;包内同进程多组断言必须能清)。 */
11
6
  export declare function __resetHooksWireCapsForTests(): void;
12
- /**
13
- * 这台引擎会不会发 `hook_non_blocking_failure` 观测帧(hook 自己坏了的那一族)。
14
- *
15
- * 🔴 **能力位嵌在 `fleet` 对象里**,不是顶层键 —— server `dist/http/routes/capabilities.js:52`:
16
- * `fleet: { stream, sessionScope, observe, resume, bgNotifyFailClosed, steerPriority,
17
- * hookFailureNotice: true }`。拿平铺口 `engineCapTrue(base,'hookFailureNotice')` 去读**恒 false**
18
- * (白读),而白读的后果不是报错、是安静地把新车道判成没有。
19
- * 🔴 未判/父键缺席/父键为 `false`(整族不供)/子键缺席 ⇒ **false** = fail-closed。
20
- *
21
- * 🔴 **它是 affordance 判据,不是上屏闸**:一帧真到货的故障通知**不该**被本位闸掉 —— 帧在手里
22
- * 就是最强证据,而能力位在探测落地前恒 false,拿它闸会把早到的真实故障静默掉(方向与 #281 相反)。
23
- * 本位的正当用途 = 「要不要在设置/状态面声称有这项监测」。判定口见 `notifications.ts`
24
- * 的 `classifyHookFailureFrame`(那里刻意不读本位)。
25
- */
26
7
  export declare function fleetHookFailureNoticeCapable(baseUrl: string | undefined): boolean;
27
- /** footer 横幅文案前缀(测试锁字面;与 `HOOK_NOTICE_WARN_PREFIX` 同族风格)。 */
28
8
  export declare const HOOK_FAILURE_WARN_PREFIX = "Hook error";
29
- /**
30
- * 「这个 hook 自己坏了」的**单行**横幅文案(hook 名 + 故障形/退出码 + stderr 摘要)。
31
- *
32
- * 🔴 **为什么在本文件而不是 `notifications.ts`**:文案口要过展示消毒单源 `collapseLabel`
33
- * (在 `fleetTaskDesc.ts`),而 `notifications.ts` 在 **A 层闭包**内(portability 门只降棘轮)——
34
- * 从那里 import 会让闭包涨一格,手抄第二份字符集又是 `fleetTaskDesc` 顶注点名禁止的形。
35
- * ⇒ 判定留 `notifications.ts`(它只交出**原文**),展示归本层。
36
- *
37
- * 🔴 **绝不编造退出码**:`timeout` / `spawn_failed` 上没有 `exitCode`,那两形只报故障词
38
- * (写 `exit 0` 会让人去查一个根本不存在的退出码)。
39
- * 🔴 **两位都是 UNTRUSTED-for-display**(异源对抗复审二轮 [medium] 采纳):`hookName` 的一手源是
40
- * **用户 settings 里自己写的** `statusMessage` / command / url / prompt;`stderr` 是**坏 hook 自己吐的
41
- * 流**。server 只做脱敏 + 截断、**不做控制符消毒**(与 `workerBadge.name` / fleet 行标签同一条分工)。
42
- * 不消毒的后果不是难看:一个带 `\n` / ESC / RLO 的 hook 名能把「**哪个**安全 hook 失效了」这条
43
- * **唯一**告警重排、截断或整段藏掉,而这条横幅存在的全部理由就是让那件事看得见。
44
- * 🔴 **单行**:渲染面是 `wrap="truncate"` 的一行;`collapseLabel` 同时做 `\s+` 折平与控制符/双向符/
45
- * 孤代理项可见化转义,两件事一把做完(不在这里手抄第二份字符集)。
46
- */
47
9
  export declare function hookFailureNoticeText(n: HookFailureNotice): string;
@@ -1,122 +1,10 @@
1
- /**
2
- * ⇄ B6 批搬迁(2026-07-27,设计稿 §3 B6 · B2 判给后批的**宿主耦合六件**之一,也是最后一件大的):
3
- * cli `src/sema/hooksWireCaps.ts` 整搬。B2 当时不搬的唯一理由 = 它读三层 settings 文件 +
4
- * 工作区信任门,而那时还没有 `SettingsPort`;B4 把口定出来了(host.ts `SettingsPort`),本批接线。
5
- *
6
- * 🔴 搬迁四处差分(端资产上移到 port,行为一字节不变):
7
- * ① `getSettingsForSource`(cli `utils/settings/settings.ts`)→ `hostSettings()?.getSettingsForSource`;
8
- * ② `shouldSkipHookDueToTrust`(cli `utils/hooks.ts`,原文用 **lazy `require()`** 避免把大图拖进
9
- * 静态依赖)→ `hostSettings()?.shouldSkipHookDueToTrust` —— port 化之后 lazy require 的理由
10
- * 连同 `require` 本身一起消失(本包零 CJS,portability 门的产物断言盯着 `require(`);
11
- * ③ `logForDebugging` → `hostLog('debug', …)`;
12
- * ④ `process.env` 缺省参 → `hostEnv()`。
13
- *
14
- * 🔴 **SettingsPort 缺席的后果不是「少读一层配置」,是把治理门整个拆了**:
15
- * `shouldSkipHookDueToTrust` 是**安全门**(未受信工作区的 hook 绝不上 wire)。端不实现它 =
16
- * 信任门在引擎腿上不存在。所以本文件在 port 缺席时**整体 fail-closed 返回 undefined**
17
- * (= 一条 hook 都不投),而不是「读不到 settings 就当没有治理策略、把 goal 钩子照投」。
18
- * ⚠️ 这与壳侧原文那条「早启动就 fall through」的 catch **不同**,是本批唯一的语义差:
19
- * 壳里那条 catch 的前提是「本地执行器仍会 per-fire 把门」(单进程);库里没有那个兜底,
20
- * 端要么装 port 要么这条腿不启用。`hostPortMisses().settings` 会把漏装喊出来。
21
- *
22
- * 🔴 模块级状态:`wireSessionStopHookPrompt` / `wireSessionStopHookCcSemantics`(`/goal` 的会话级
23
- * Stop 钩子锁存)——写口 `setWireSessionStopHook`(命令层)、读口 `hooksForWire`(每 turn 请求
24
- * 构造期)与 `getWireSessionStopHook`(`/goal clear` 回显)。两份实例 = 设了目标却投不出去
25
- * (而两边代码看着都对)。单实例清单登记项。
26
- * ⇄ REF-CC-156(midband-04,split,2026-08-02):这份状态 + 版本判档 + prompt 组装已拆到
27
- * `./goalStopHook.ts`(原文件那一半占体量 57%、是独立关注点——`/goal` 命令专属,与本文件剩下
28
- * 的「通用 settings-file hooks 投影 + 治理门」不是同一件事)。本文件只在 `hooksForWire()` 尾部
29
- * 调 `goalStopHookMatcher()` 合流一次;所有对外名字原样从这里 re-export,调用方 import 路径
30
- * 零改动。
31
- *
32
- * ── 以下为原文件的领域说明(逐字保留)────────────────────────────────────────────────────────
33
- *
34
- * hooksWireCaps — project the user's settings-file hooks onto the wire (`TaskRequest.settings.hooks`).
35
- *
36
- * service 1.131.0 hook-runner 阶段一([495]①,契约 = @sema-ai/registry-core/hooks 0.1.51, CC 2.1.198
37
- * 逐字形状):引擎消费 `body.settings.hooks`,当前点亮 PreToolUse + PostToolUse × command 条目(真
38
- * /bin/sh -c,exit-2 阻断 stderr 喂模型,matcher 精确/`a|b`/锚定正则);其余事件配置合法不点亮
39
- * (`hook_events_not_fired` 记账,后续阶段自动亮)。这正是 live 模式的空缺半场:工具在引擎执行,
40
- * 壳本地永远 fire 不了工具链 hooks — 30 事件枚举里的 ENGINE_OWNED 常量(rc.36 壳半场)壳侧只做
41
- * schema 合法,不触发,所以整份投影零双跑。
42
- *
43
- * GOVERNANCE GATES (对抗复审 rc.41 review HIGH — the wire must honor the SAME gates the local executor
44
- * honors, or a fleet-managed policy is silently bypassed by the engine leg):
45
- * - workspace trust: interactive sessions with the trust dialog unaccepted ship NO hooks
46
- * (shouldSkipHookDueToTrust — the rc.36 "hooks 全被 trust 门禁" invariant, engine leg included);
47
- * - `disableAllHooks` (managed/policy settings): ships NO hooks;
48
- * - `allowManagedHooksOnly`: ONLY the policy-settings hooks ship; user/project/local are blocked;
49
- * - `strictPluginOnlyCustomization` covering the "hooks" surface (L-67④, 0.52.0): same disposition as
50
- * `allowManagedHooksOnly` — ONLY the policy-settings hooks ship. Verbatim parity with the local
51
- * executor's `isRestrictedToPluginOnly('hooks')` is argued clause-by-clause on
52
- * {@link hooksLockedToPluginOnly}.
53
- *
54
- * 🔴 **在册缺口(同形族扫所得,本批刻意未修 —— 别把它读成「已经守住了」)**:cli 本地执行器
55
- * (`src/utils/hooks/hooksConfigSnapshot.ts:getHooksFromAllowedSources`)还有**第四条**腿 ——
56
- * `disableAllHooks` 出现在**非** managed 的来源(user/project/local)时,按 CC 语义降级成
57
- * 「只跑 managed hooks」(非 managed 设置不能禁掉 managed hooks,但能禁掉自己)。本文件今天
58
- * **只读 `policySettings.disableAllHooks`** ⇒ 这一形在引擎腿上不成立(用户把自己的 hooks 关了,
59
- * 引擎照投照跑)。**为什么本批不修**:cli 那条腿读的是**合并后**的标量
60
- * (`getSettings_DEPRECATED().disableAllHooks`,四源按 policy→user→project→local 后写覆盖前写),
61
- * 而本包的 `SettingsPort` 只有 per-source 读口 —— 拿「任一来源为 true」去近似合并结果会在
62
- * 「user 写 true、local 写 false」这一形上判反(cli 那边是**不**限制)。忠实复刻需要给
63
- * `SettingsPort` 加一个合并读口 = **公面改动**,属另一批(端要跟车实现)。
64
- * ⇒ 登记在此,不做单边近似([honest-absence-not-fabricated-zero]:守不住就说守不住,
65
- * 别用一个会判反的近似冒充守住了)。
66
- *
67
- * Projection semantics (CC settings merge, verbatim shapes):
68
- * - Sources: policy → user → project → local settings files, per-event arrays CONCATENATED in that
69
- * order (CC's own multi-source hook semantics — later scopes append, they don't shadow).
70
- * - Values pass through AS-IS including malformed entries (对抗复审 MED: dropping them client-side is a
71
- * silent-fallback; the service 400s fail-loud with a field path, which the turn error card shows).
72
- * - Presence is the opt-in: no hooks configured ⇒ undefined ⇒ no stamp ⇒ request shape unchanged.
73
- * - Session-scoped runtime hooks and plugin/skill hooks are NOT projected in phase one (they carry
74
- * pluginRoot/skillRoot expansion contexts the wire contract doesn't model yet).
75
- * - Multi-tenant deployments advertise `taskSettings.hooks:false` and warn+ignore server-side, so
76
- * the shell does not pre-gate on capabilities (single-user TOC is always true — [495]① note ①).
77
- *
78
- * Secrets: hook processes run under the SERVICE's env allowlist (PATH/HOME/locale + CLAUDE_PROJECT_DIR)
79
- * and never inherit engine secrets; user-defined variables must ride `settings.env` — nothing for the
80
- * shell to scrub here (commands are the user's own text).
81
- */
82
1
  import { engineCapNestedTrue } from './engineCapsCache.js';
83
2
  import { collapseLabel } from './fleetTaskDesc.js';
84
3
  import { hostLog, hostSettings } from './host.js';
85
4
  import { MAX_HOOK_NOTICE_TEXT_CHARS } from './notifications.js';
86
- // REF-CC-156(split):`/goal` 版本判档 + prompt 组装 + 模块状态搬到 goalStopHook.ts。
87
- // `goalStopHookMatcher`/`__resetGoalStopHookForTests` 是两文件间的私有接口(不 re-export);
88
- // 其余七个名字原样 re-export,外部 import 路径(index 的 `export *`)零改动。
89
5
  import { goalStopHookMatcher, __resetGoalStopHookForTests } from './goalStopHook.js';
90
6
  export { GOAL_STOP_HOOK_WIRE_ENV, CC_STOP_SEMANTICS_MIN_SERVER, ccStopSemanticsFromVersion, engineCcStopSemantics, isGoalStopHookWireArmed, setWireSessionStopHook, getWireSessionStopHook, getWireSessionStopHookCcSemantics, buildGoalStopHookPrompt, } from './goalStopHook.js';
91
7
  const EDITABLE_HOOK_SOURCES = ['userSettings', 'projectSettings', 'localSettings'];
92
- /**
93
- * managed `strictPluginOnlyCustomization` 对 **hooks 面**的锁判定(L-67④,0.52.0)。
94
- *
95
- * 🔴 病(修前):`hooksForWire()` 过了 `disableAllHooks` / `allowManagedHooksOnly` 两道 managed 治理门,
96
- * **没过**这一道 —— 而本文件头注自己写着「the wire must honor the SAME gates the local executor
97
- * honors, or a fleet-managed policy is silently bypassed by the engine leg」。后果:管理侧把 hooks
98
- * 面锁成 plugin-only 之后,壳的**本地执行器**不再跑 user/project/local 的 hooks,而**引擎腿**照投
99
- * 照跑 —— 禁令只在一半的执行面上成立,而这一半恰好是工具真正执行的那一半。
100
- *
101
- * 🔴 与 cli 本地执行器 `src/utils/settings/pluginOnlyPolicy.ts:isRestrictedToPluginOnly('hooks')`
102
- * **逐条对照,差异为零**:
103
- * · `=== true`(布尔真)⇒ 锁(cli 原文 `if (policy === true) return true`:`true` 锁**全部四个面**,
104
- * hooks 在内)。⚠️ 本条是必须实现的一形 —— 只认数组形会把「一个字就锁全部」的管理写法整个放过,
105
- * 而那正是本件要堵的洞;
106
- * · 数组且含 `'hooks'` ⇒ 锁;数组不含 ⇒ **不锁**(锁的是别的面:skills/agents/mcp,与 hooks 无关);
107
- * · 其余一切值形(缺席 / `false` / 串 / 对象 / 数字)⇒ **不锁**(当未设),**不** fail-closed 整条腿。
108
- *
109
- * 🔴 「非数组非 true ⇒ 当未设」为什么与 cli 差异为零(而不是本包自己另立一条宽口):cli 侧读到这个字段
110
- * 之前先过 `SettingsSchema`,该字段的 `.preprocess(...).catch(undefined)`(cli `settings/types.ts`
111
- * 逐字注释:「Non-array invalid values ("skills" string, {object}) … .catch drops the field to
112
- * undefined instead. Degrades to unlocked-for-this-field, never to everything-broken.」)已经把脏值形
113
- * 丢成 `undefined` ⇒ 到达 `isRestrictedToPluginOnly` 的值形只有 boolean / 字符串数组两种,本函数对这
114
- * 两种与 cli **逐条同判**;而对**没过 schema** 的脏值形(别的宿主可能把盘上原文直接交上来),本函数
115
- * 的处置方向与 cli 那条 schema 腿**同向**(degrade to unlocked-for-this-field)。
116
- * 🔴 与相邻两道门的 fail-closed 纪律**不矛盾**:那两条 fail-closed 守的是「读取**抛出**」(治理策略
117
- * 读不出来 = 当作有限制);本条守的是「读到了、但值是个坏形」—— 值在手里,方向由字段属主(schema)
118
- * 定,不是未知态。两件事别混。
119
- */
120
8
  function hooksLockedToPluginOnly(policyValue) {
121
9
  if (policyValue === true)
122
10
  return true;
@@ -124,13 +12,6 @@ function hooksLockedToPluginOnly(policyValue) {
124
12
  return policyValue.includes('hooks');
125
13
  return false;
126
14
  }
127
- /**
128
- * REF-CC-155(midband-03,fix-outright):此前这里是静默 `catch { return null }` —— 零 hostLog、零
129
- * 注释说明「为什么这次失败可以死」。settings 读取失败(格式损坏 / 端内部错误)会被悄悄当成
130
- * 「该来源没配 hooks」处理,与真实的「没配」在结果上不可分辨,排查只能靠猜。补一行 debug 记录被吞的
131
- * 异常(与本文件其余分支的记账习惯一致);这一处仍按「无 hooks」降级 —— 单来源读失败不是安全门
132
- * (信任门/policy 门另有专门处置,见 hooksForWire),不必 fail-closed 整条腿。
133
- */
134
15
  function hooksOfSource(source) {
135
16
  try {
136
17
  const s = hostSettings()?.getSettingsForSource(source);
@@ -141,25 +22,10 @@ function hooksOfSource(source) {
141
22
  return null;
142
23
  }
143
24
  }
144
- /**
145
- * The merged, GOVERNANCE-GATED settings-file hooks for the wire, or undefined when none apply.
146
- * Per-event arrays concatenate across sources (policy → user → project → local).
147
- */
148
25
  export function hooksForWire() {
149
- // 🔴 port 缺席 = **整条腿 fail-closed**(见文件头第三段):端没装 SettingsPort 就没有信任门,
150
- // 而信任门是安全门。`hostSettings()` 自己会计 miss 并喊一次,宿主自检读得到。
151
26
  const settings = hostSettings();
152
27
  if (settings === undefined)
153
28
  return undefined;
154
- // trust gate first (cheapest + broadest): untrusted interactive workspace ⇒ no hooks anywhere,
155
- // the engine leg included — same invariant the local executor enforces per-fire.
156
- // [2393] F-2(fix-outright):此前这条 catch 是 **fail-OPEN**(fall through),理由句写「端侧本地
157
- // 执行器仍 per-fire 把门」—— 那句在本包语境下是**假话**,本文件头第三段自己写明:壳里那条
158
- // catch 的前提是单进程本地执行器,**库里没有那个兜底**。后果是「未受信工作区的 hooks 绝不上
159
- // wire」这条被文件头称作安全门的不变量,在 SettingsPort 抛错时整个失效(用户/项目 settings 里的
160
- // `command` 型 hook 照投给引擎真执行)。而同一函数下方对**同类失败**(port 抛)的 policy 读已选
161
- // fail-closed 并写明「治理策略读不出来时更安全的默认应是当作有限制」—— 两道门相邻、同类输入,
162
- // 结论必须一致,更敏感的那道不许留在宽的一侧。改成 fail-closed:信任查不出来 = 当作未受信。
163
29
  try {
164
30
  if (settings.shouldSkipHookDueToTrust()) {
165
31
  hostLog('debug', 'hooksWireCaps: workspace not trusted — no hooks projected to the engine');
@@ -171,12 +37,6 @@ export function hooksForWire() {
171
37
  return undefined;
172
38
  }
173
39
  let policy = null;
174
- // REF-CC-155(midband-03,fix-outright,行为面已裁 GO — 安全敏感面 [2374] 背书):policy 是
175
- // `disableAllHooks`/`allowManagedHooksOnly` 两道治理门的唯一读口。此前读取失败(格式损坏 / 端内部
176
- // 错误)与「本来就没配 policy」在这里被静默折成同一个 `policy = null` ⇒ 等价于「无限制」——而这条
177
- // 恰恰是安全敏感面:治理策略读不出来时,更安全的默认应是「当作有限制」而不是「当作无限制」。改成
178
- // fail-closed:读取真的**抛出**(不是「值合法地缺席」)⇒ 整条腿按 disableAllHooks 同款处置,不再
179
- // 往下算 managedOnly / 拼装钩子。
180
40
  try {
181
41
  policy = settings.getSettingsForSource('policySettings');
182
42
  }
@@ -188,18 +48,10 @@ export function hooksForWire() {
188
48
  hostLog('debug', 'hooksWireCaps: disableAllHooks (managed) — no hooks projected to the engine');
189
49
  return undefined;
190
50
  }
191
- // L-67④(0.52.0):第三道 managed 治理门 —— `strictPluginOnlyCustomization` 含 hooks 面。
192
- // 🔴 **顺序与 `allowManagedHooksOnly` 无关**(两者同时在场时无论谁先判,结论都是同一个
193
- // `['policySettings']`,处置逐字相同 —— 它们是**同一个动作**的两个理由,不是两级策略);
194
- // 真正有顺序的只有 `disableAllHooks`:它在上面**先**判且**恒赢**(连 policy 自己的都不投),
195
- // 本门只在它没命中时才有机会求值。
196
51
  const pluginOnlyHooks = hooksLockedToPluginOnly(policy?.strictPluginOnlyCustomization);
197
52
  if (pluginOnlyHooks) {
198
53
  hostLog('debug', 'hooksWireCaps: strictPluginOnlyCustomization locks the hooks surface (managed) — only policySettings hooks projected to the engine');
199
54
  }
200
- // 🔴 `managedOnly` 这个名字下面还被 `/goal` overlay 的分道复用(用户态 goal 钩子必须与
201
- // EDITABLE_HOOK_SOURCES 同进退)——所以本门**合流进同一个量**,而不是只改 `sources`:
202
- // 只改 sources 会让 plugin-only 锁下 user 态的 goal 钩子照投,那是同一个洞换了个入口。
203
55
  const managedOnly = policy?.allowManagedHooksOnly === true || pluginOnlyHooks;
204
56
  const sources = managedOnly
205
57
  ? ['policySettings']
@@ -212,68 +64,26 @@ export function hooksForWire() {
212
64
  for (const [event, groups] of Object.entries(hooks)) {
213
65
  if (!Array.isArray(groups) || groups.length === 0)
214
66
  continue;
215
- // Verbatim passthrough INCLUDING malformed entries — the service is the single validator
216
- // (400 fail-loud with a field path); a client-side drop would be a silent fallback.
217
67
  merged[event] = [...(merged[event] ?? []), ...groups];
218
68
  }
219
69
  }
220
- // `/goal` 的会话级 Stop×prompt 钩子(CC 220 Xdr)——在治理门之后合并,所以 trust /
221
- // disableAllHooks / allowManagedHooksOnly 任一命中时它同样不投影(managedOnly 下用户态的
222
- // goal 钩子也一并禁掉,与 EDITABLE_HOOK_SOURCES 被排除同理)。默认开,见上方 overlay 注释。
223
- // REF-CC-156(split):判档/锁存态/包装全归 goalStopHook.ts,本文件只调尾部合流点。
224
70
  const goalMatcher = goalStopHookMatcher(managedOnly);
225
71
  if (goalMatcher !== null) {
226
72
  merged['Stop'] = [...(merged['Stop'] ?? []), goalMatcher];
227
73
  }
228
74
  return Object.keys(merged).length > 0 ? merged : undefined;
229
75
  }
230
- /** 测试钩:清 `/goal` 锁存(壳里靠进程边界隔离;包内同进程多组断言必须能清)。 */
231
76
  export function __resetHooksWireCapsForTests() {
232
77
  __resetGoalStopHookForTests();
233
78
  }
234
- // ── hook 观测面的能力位(#281 / server ≥7.48.0)──────────────────────────────────────────────
235
- /**
236
- * 这台引擎会不会发 `hook_non_blocking_failure` 观测帧(hook 自己坏了的那一族)。
237
- *
238
- * 🔴 **能力位嵌在 `fleet` 对象里**,不是顶层键 —— server `dist/http/routes/capabilities.js:52`:
239
- * `fleet: { stream, sessionScope, observe, resume, bgNotifyFailClosed, steerPriority,
240
- * hookFailureNotice: true }`。拿平铺口 `engineCapTrue(base,'hookFailureNotice')` 去读**恒 false**
241
- * (白读),而白读的后果不是报错、是安静地把新车道判成没有。
242
- * 🔴 未判/父键缺席/父键为 `false`(整族不供)/子键缺席 ⇒ **false** = fail-closed。
243
- *
244
- * 🔴 **它是 affordance 判据,不是上屏闸**:一帧真到货的故障通知**不该**被本位闸掉 —— 帧在手里
245
- * 就是最强证据,而能力位在探测落地前恒 false,拿它闸会把早到的真实故障静默掉(方向与 #281 相反)。
246
- * 本位的正当用途 = 「要不要在设置/状态面声称有这项监测」。判定口见 `notifications.ts`
247
- * 的 `classifyHookFailureFrame`(那里刻意不读本位)。
248
- */
249
79
  export function fleetHookFailureNoticeCapable(baseUrl) {
250
80
  return engineCapNestedTrue(baseUrl, 'fleet', 'hookFailureNotice');
251
81
  }
252
- /** footer 横幅文案前缀(测试锁字面;与 `HOOK_NOTICE_WARN_PREFIX` 同族风格)。 */
253
82
  export const HOOK_FAILURE_WARN_PREFIX = 'Hook error';
254
- /**
255
- * 「这个 hook 自己坏了」的**单行**横幅文案(hook 名 + 故障形/退出码 + stderr 摘要)。
256
- *
257
- * 🔴 **为什么在本文件而不是 `notifications.ts`**:文案口要过展示消毒单源 `collapseLabel`
258
- * (在 `fleetTaskDesc.ts`),而 `notifications.ts` 在 **A 层闭包**内(portability 门只降棘轮)——
259
- * 从那里 import 会让闭包涨一格,手抄第二份字符集又是 `fleetTaskDesc` 顶注点名禁止的形。
260
- * ⇒ 判定留 `notifications.ts`(它只交出**原文**),展示归本层。
261
- *
262
- * 🔴 **绝不编造退出码**:`timeout` / `spawn_failed` 上没有 `exitCode`,那两形只报故障词
263
- * (写 `exit 0` 会让人去查一个根本不存在的退出码)。
264
- * 🔴 **两位都是 UNTRUSTED-for-display**(异源对抗复审二轮 [medium] 采纳):`hookName` 的一手源是
265
- * **用户 settings 里自己写的** `statusMessage` / command / url / prompt;`stderr` 是**坏 hook 自己吐的
266
- * 流**。server 只做脱敏 + 截断、**不做控制符消毒**(与 `workerBadge.name` / fleet 行标签同一条分工)。
267
- * 不消毒的后果不是难看:一个带 `\n` / ESC / RLO 的 hook 名能把「**哪个**安全 hook 失效了」这条
268
- * **唯一**告警重排、截断或整段藏掉,而这条横幅存在的全部理由就是让那件事看得见。
269
- * 🔴 **单行**:渲染面是 `wrap="truncate"` 的一行;`collapseLabel` 同时做 `\s+` 折平与控制符/双向符/
270
- * 孤代理项可见化转义,两件事一把做完(不在这里手抄第二份字符集)。
271
- */
272
83
  export function hookFailureNoticeText(n) {
273
84
  const code = n.exitCode !== undefined ? `exit ${n.exitCode}` : n.reason;
274
85
  const name = collapseLabel(n.hookName);
275
86
  const tail = n.stderr !== undefined ? `: ${collapseLabel(n.stderr)}` : '';
276
87
  const line = `${HOOK_FAILURE_WARN_PREFIX}: ${name} (${code})${tail}`;
277
- // 有界兜底(与铸点同上限;消毒在前、截断在后 —— 反过来会把一个转义序列切成半截)。
278
88
  return line.length <= MAX_HOOK_NOTICE_TEXT_CHARS ? line : line.slice(0, MAX_HOOK_NOTICE_TEXT_CHARS);
279
89
  }
package/dist/host.d.ts CHANGED
@@ -1,149 +1,44 @@
1
- /**
2
- * host.ts — **包级宿主装配**(B4;B3 交接报告的建议件 + 设计稿 §5.4 「web 宿主的最小接入面」)。
3
- *
4
- * ## 两种口,别混
5
- *
6
- * · `AdapterContext`(seam.ts)= **per-turn 切片** —— 时钟、铸号、signal、定时器、攒批节拍。
7
- * 它随每个 `adapt()` 调用传进来,因为这些东西**每个 turn 可以不一样**(比如这一 turn 可中断)。
8
- * · `installHost()`(本文件)= **进程/端级装配** —— settings 读取、fs、通知队列。
9
- * 它们在会话开始之前就该在位,而且被**请求构造期**的代码调用(`hooksForWire()` /
10
- * `scratchpadDirField()`),那时候根本没有 `ctx` 可传。
11
- *
12
- * ⇒ 判据:**这个能力是不是每 turn 会变?** 会 ⇒ ctx;不会 ⇒ installHost。
13
- *
14
- * ## 缺席语义(与 AdapterContext 同一条纪律)
15
- *
16
- * 🔴 缺席 = **该能力不启用**,不是报错、更不是「换个方式偷偷做」。库绝不 `require('fs')`、
17
- * 绝不 `console.log`、绝不读 `process.env` 兜底 —— 那正是搬迁要切掉的东西。
18
- * 但「静默不启用」有个已知的失败形:**宿主漏装了,而症状是某个面悄悄空掉**。所以每个口都带
19
- * miss 计数(`hostPortMisses()`),宿主自检断言它恒为 0 —— 与 `notificationQueuePortMisses()`
20
- * 同一套姿势([probe-must-prove-it-speaks]:不能让「什么都没有」看起来像「一切正常」)。
21
- */
22
1
  import type { AdapterLogLevel, TimerHandle } from './seam.js';
23
2
  import { type NotificationQueuePort } from './notifications.js';
24
- /**
25
- * settings 文件的顶层文档形状(TYPESHAPE-11)。开集是**有理由的**:settings 文件本身是用户
26
- * 自由格式(壳三层合并后的 JSON、web center 下发、桌面主进程各自的形状都不同),库不认识
27
- * 具体键——窄化点在各消费者(如 hooksWireCaps)按各自需要的子形状 cast。缺席该来源的
28
- * settings ⇒ `null`(与本包既有 mock/消费点已经在用的口径一致,不是新增语义)。
29
- */
30
3
  export type SettingsDocument = Record<string, unknown>;
31
- /**
32
- * settings 口 —— 用户 settings 文件的读取面(壳=三层合并后的文件读;web=center 下发;桌面=主进程)。
33
- *
34
- * 🔴 `shouldSkipHookDueToTrust` 是**安全门**不是取值:未受信目录的 hook 绝不上 wire。
35
- * 端必须真实现它;不实现(端返回恒 false)= 把信任门拆了。所以它在 required 清单里。
36
- */
37
4
  export interface SettingsPort {
38
- /** 按来源取 settings(cli `utils/settings/settings.ts` 的 `getSettingsForSource`)。 */
39
5
  getSettingsForSource(source: string): SettingsDocument | null;
40
- /**
41
- * 信任门:hook 是否因工作区未受信而跳过。**返回 true = 跳过**。
42
- * 🔴 B6 更正:壳侧真身 `utils/hooks.shouldSkipHookDueToTrust()` 是**零参**的(门是工作区级、
43
- * 不是逐条 hook 级)。B4 定口时按「逐条判」写了一个必填参,与真身不符 —— 改成可选参:
44
- * 既容得下零参真身,也不妨碍将来某个端要做逐条判。库内唯一调用点(hooksWireCaps)不传参。
45
- */
46
6
  shouldSkipHookDueToTrust(hook?: unknown): boolean;
47
7
  }
48
- /**
49
- * fs 口 —— scratchpad 目录族(cli `utils/permissions/filesystem.ts`)。
50
- * `ensureScratchpadDir` 是**真 IO**(mkdir);浏览器宿主整个口省略即可(⇒ 不 stamp scratchpadDir,
51
- * additive 字段缺席对引擎无害)。
52
- */
53
8
  export interface FsPort {
54
9
  getScratchpadDir(): string | undefined;
55
10
  isScratchpadEnabled(): boolean;
56
- /** 🔴 壳侧真身是 **async**(mkdir 0o700);端可返 void 或 Promise,库两种都吞(fire-and-forget)。 */
57
11
  ensureScratchpadDir(): void | Promise<void>;
58
12
  }
59
- /**
60
- * 定时器口(进程级默认;`ctx.setTimer` 仍可按 turn 覆盖)。
61
- * 🔴 TYPESHAPE-10:句柄用 seam.ts 已有的命名不透明别名 `TimerHandle`(不透明本身不变 —— Node 是
62
- * Timeout 对象、浏览器是 number,库侧只负责回传;只是把裸 `unknown` 收进一个有名字的口)。
63
- */
64
13
  export interface TimersPort {
65
14
  setTimer(ms: number, fn: () => void): TimerHandle;
66
15
  clearTimer(handle: TimerHandle): void;
67
16
  }
68
- /**
69
- * session 口(**B6 引入**)—— 「现在是哪个会话 / 哪个 run 在飞」。
70
- *
71
- * 为什么必须是端给:这两个量在壳里分别住在 `liveSessionStore`(引擎首轮 done 回填的权威值)+
72
- * `bootstrap/state`(壳 boot 时生成的 uuidv7)与 `engineToolDetach`(pty 绑定的活跃 run),
73
- * **三个都是宿主生命周期资产**;web 宿主是路由参数 + BFF 会话,桌面是主进程 session-host。
74
- *
75
- * 🔴 缺席后果**不是**「少个装饰」:`engineSessionParam()` 恒 undefined ⇒ durable 面
76
- * (taskOutput/taskStop/subagentOutput)对 session-bound run 一律 **404 fail-closed**
77
- * ([1501]§三 / [1498]③),整条子代读面静默哑掉。所以本口**计 miss**。
78
- *
79
- * 🔴 `currentSessionId()` 绝不返回空串 —— `?session=`(空值)按「带了且不匹配」判 404
80
- * ([1501] 空串陷阱);端返空串时库当缺席处理(下面 `engineSessionParam` 有归一)。
81
- */
82
17
  export interface SessionPort {
83
- /** 当前会话 id(壳:引擎捕获值优先、退 boot-time id);两源都缺 ⇒ undefined。 */
84
18
  currentSessionId(): string | undefined;
85
- /**
86
- * 当前**活跃引擎 run** 的 id(壳 = `engineToolDetach.getActiveEngineTaskId()`,由
87
- * X-Task-Id 响应头早捕获)。没有在飞的 turn ⇒ undefined/null 都收。
88
- */
89
19
  activeRunId(): string | undefined | null;
90
20
  }
91
- /** `installHost` 的入参 —— 全部可选,缺席即该能力不启用。 */
92
21
  export interface HostPorts {
93
22
  log?(level: AdapterLogLevel, msg: string, data?: unknown): void;
94
23
  probe?(channel: string, line: string): void;
95
- /** 通知队列(B2 引入)。经本口装 == 直接调 `installNotificationQueuePort`,单一真源不分裂。 */
96
24
  queue?: NotificationQueuePort | null;
97
25
  timers?: TimersPort;
98
26
  settings?: SettingsPort;
99
27
  fs?: FsPort;
100
- /** B6:会话/活跃 run 口(缺席 ⇒ durable 子代面对 session-bound run 恒 404,见 SessionPort)。 */
101
28
  session?: SessionPort;
102
29
  }
103
- /**
104
- * 装配宿主口。**可多次调用做增量装配**(只覆盖本次给出的键),便于分模块装。
105
- * 传 `queue` 会直通 `installNotificationQueuePort` —— 队列的真源仍在 notifications.ts,
106
- * 本文件不另存一份([paired-mechanisms-must-share-premise]:两处各存一份 = 装了 A 读了 B)。
107
- * 返回一个还原函数(测试/热重载用)。
108
- */
109
30
  export declare function installHost(ports: HostPorts): () => void;
110
- /**
111
- * W1 带 key 变体:装配某会话的宿主口(多会话宿主每会话一键,互不顶盖;合并语义与零参同)。
112
- * ⚠️ 入参不含 `queue` —— 通知队列在 W1 仍是包级单例(notifications.ts 不在五槽位切口内),
113
- * per-session 队列归后续工单;要装队列走零参 `installHost({ queue })`。
114
- */
115
31
  export declare function installHostFor(sessionKey: string, ports: Omit<HostPorts, 'queue'>): () => void;
116
- /** 日志(缺席 = 静默,**不计 miss**:诊断面本就是可选的)。 */
117
32
  export declare function hostLog(level: AdapterLogLevel, msg: string, data?: unknown): void;
118
- /** 行式探针(缺席 = 静默,不计 miss:同上)。 */
119
33
  export declare function hostProbe(channel: string, line: string): void;
120
- /** settings 口(缺席 = undefined + 计 miss:漏装会让 hooks 整条 wire 静默空掉)。 */
121
34
  export declare function hostSettings(): SettingsPort | undefined;
122
- /** W1 带 key 变体(缺席语义与零参同:undefined + 计该键 miss)。 */
123
35
  export declare function hostSettingsFor(sessionKey: string): SettingsPort | undefined;
124
- /** fs 口(缺席 = undefined + 计 miss)。 */
125
36
  export declare function hostFs(): FsPort | undefined;
126
- /** W1 带 key 变体。 */
127
37
  export declare function hostFsFor(sessionKey: string): FsPort | undefined;
128
- /** 定时器口(缺席 = undefined,不计 miss:T40 竞速本就允许不启用)。 */
129
38
  export declare function hostTimers(): TimersPort | undefined;
130
- /** W1 带 key 变体(同零参:不计 miss)。 */
131
39
  export declare function hostTimersFor(sessionKey: string): TimersPort | undefined;
132
- /** session 口(缺席 = undefined + 计 miss:漏装会让整条 durable 子代读面 404 静默哑掉)。 */
133
40
  export declare function hostSession(): SessionPort | undefined;
134
- /** W1 带 key 变体。 */
135
41
  export declare function hostSessionFor(sessionKey: string): SessionPort | undefined;
136
- /**
137
- * 🔴 宿主自检出口 —— 恒应为空对象。非空 = 有口漏装,**对应的面已经在静默失效**。
138
- * 含通知队列的 miss(从 notifications.ts 汇过来,宿主只需看这一个数)。
139
- */
140
42
  export declare function hostPortMisses(): Record<string, number>;
141
- /** W1 带 key 变体。⚠️ 通知队列是包级单例,其 miss 只折进 DEFAULT_SESSION_KEY 键的视图。 */
142
43
  export declare function hostPortMissesFor(sessionKey: string): Record<string, number>;
143
- /**
144
- * 测试钩:清空装配与计数。
145
- * 🔴 队列那一路必须走 `_resetNotificationQueuePortForTest()` 而不是 `installNotificationQueuePort(null)`
146
- * —— 后者只卸口、**不清 miss 计数**,于是 `hostPortMisses()` 会带着上一段测试的历史 miss,
147
- * 让「未装配时 misses 为空」这类断言恒假(B4 首写时就撞上了)。
148
- */
149
44
  export declare function _resetHostForTest(): void;
package/dist/host.js CHANGED
@@ -14,7 +14,6 @@ function miss(sessionKey, name) {
14
14
  slot.misses[name] = (slot.misses[name] ?? 0) + 1;
15
15
  if (!slot.warned.has(name)) {
16
16
  slot.warned.add(name);
17
- // eslint-disable-next-line no-console
18
17
  console.error(`[client-core] host port "${name}" NOT installed — the surface it drives is silently inert. ` +
19
18
  'Host must call installHost({ ' +
20
19
  name +
@@ -22,23 +21,12 @@ function miss(sessionKey, name) {
22
21
  }
23
22
  return undefined;
24
23
  }
25
- /**
26
- * 装配宿主口。**可多次调用做增量装配**(只覆盖本次给出的键),便于分模块装。
27
- * 传 `queue` 会直通 `installNotificationQueuePort` —— 队列的真源仍在 notifications.ts,
28
- * 本文件不另存一份([paired-mechanisms-must-share-premise]:两处各存一份 = 装了 A 读了 B)。
29
- * 返回一个还原函数(测试/热重载用)。
30
- */
31
24
  export function installHost(ports) {
32
25
  const restore = installHostFor(DEFAULT_SESSION_KEY, ports);
33
26
  if ('queue' in ports)
34
27
  installNotificationQueuePort(ports.queue ?? null);
35
28
  return restore;
36
29
  }
37
- /**
38
- * W1 带 key 变体:装配某会话的宿主口(多会话宿主每会话一键,互不顶盖;合并语义与零参同)。
39
- * ⚠️ 入参不含 `queue` —— 通知队列在 W1 仍是包级单例(notifications.ts 不在五槽位切口内),
40
- * per-session 队列归后续工单;要装队列走零参 `installHost({ queue })`。
41
- */
42
30
  export function installHostFor(sessionKey, ports) {
43
31
  const slot = hostSlot(sessionKey);
44
32
  const prev = { ...slot.state };
@@ -58,54 +46,39 @@ export function installHostFor(sessionKey, ports) {
58
46
  slot.state = prev;
59
47
  };
60
48
  }
61
- /** 日志(缺席 = 静默,**不计 miss**:诊断面本就是可选的)。 */
62
49
  export function hostLog(level, msg, data) {
63
50
  hostSlot(DEFAULT_SESSION_KEY).state.log?.(level, msg, data);
64
51
  }
65
- /** 行式探针(缺席 = 静默,不计 miss:同上)。 */
66
52
  export function hostProbe(channel, line) {
67
53
  hostSlot(DEFAULT_SESSION_KEY).state.probe?.(channel, line);
68
54
  }
69
- /** settings 口(缺席 = undefined + 计 miss:漏装会让 hooks 整条 wire 静默空掉)。 */
70
55
  export function hostSettings() {
71
56
  return hostSettingsFor(DEFAULT_SESSION_KEY);
72
57
  }
73
- /** W1 带 key 变体(缺席语义与零参同:undefined + 计该键 miss)。 */
74
58
  export function hostSettingsFor(sessionKey) {
75
59
  return hostSlot(sessionKey).state.settings ?? miss(sessionKey, 'settings');
76
60
  }
77
- /** fs 口(缺席 = undefined + 计 miss)。 */
78
61
  export function hostFs() {
79
62
  return hostFsFor(DEFAULT_SESSION_KEY);
80
63
  }
81
- /** W1 带 key 变体。 */
82
64
  export function hostFsFor(sessionKey) {
83
65
  return hostSlot(sessionKey).state.fs ?? miss(sessionKey, 'fs');
84
66
  }
85
- /** 定时器口(缺席 = undefined,不计 miss:T40 竞速本就允许不启用)。 */
86
67
  export function hostTimers() {
87
68
  return hostTimersFor(DEFAULT_SESSION_KEY);
88
69
  }
89
- /** W1 带 key 变体(同零参:不计 miss)。 */
90
70
  export function hostTimersFor(sessionKey) {
91
71
  return hostSlot(sessionKey).state.timers;
92
72
  }
93
- /** session 口(缺席 = undefined + 计 miss:漏装会让整条 durable 子代读面 404 静默哑掉)。 */
94
73
  export function hostSession() {
95
74
  return hostSessionFor(DEFAULT_SESSION_KEY);
96
75
  }
97
- /** W1 带 key 变体。 */
98
76
  export function hostSessionFor(sessionKey) {
99
77
  return hostSlot(sessionKey).state.session ?? miss(sessionKey, 'session');
100
78
  }
101
- /**
102
- * 🔴 宿主自检出口 —— 恒应为空对象。非空 = 有口漏装,**对应的面已经在静默失效**。
103
- * 含通知队列的 miss(从 notifications.ts 汇过来,宿主只需看这一个数)。
104
- */
105
79
  export function hostPortMisses() {
106
80
  return hostPortMissesFor(DEFAULT_SESSION_KEY);
107
81
  }
108
- /** W1 带 key 变体。⚠️ 通知队列是包级单例,其 miss 只折进 DEFAULT_SESSION_KEY 键的视图。 */
109
82
  export function hostPortMissesFor(sessionKey) {
110
83
  const out = { ...hostSlot(sessionKey).misses };
111
84
  if (sessionKey === DEFAULT_SESSION_KEY) {
@@ -115,12 +88,6 @@ export function hostPortMissesFor(sessionKey) {
115
88
  }
116
89
  return out;
117
90
  }
118
- /**
119
- * 测试钩:清空装配与计数。
120
- * 🔴 队列那一路必须走 `_resetNotificationQueuePortForTest()` 而不是 `installNotificationQueuePort(null)`
121
- * —— 后者只卸口、**不清 miss 计数**,于是 `hostPortMisses()` 会带着上一段测试的历史 miss,
122
- * 让「未装配时 misses 为空」这类断言恒假(B4 首写时就撞上了)。
123
- */
124
91
  export function _resetHostForTest() {
125
92
  hostByKey.clear();
126
93
  _resetNotificationQueuePortForTest();
package/dist/hostEnv.d.ts CHANGED
@@ -1,16 +1,2 @@
1
- /**
2
- * hostEnv.ts — B2 批引入的**唯一**宿主环境读口(多端改造设计稿 §5.2 浏览器可移植性)。
3
- *
4
- * 为什么需要:搬入的 `*WireCaps` 族有 11 个函数签名是 `(env: NodeJS.ProcessEnv = process.env)`
5
- * —— 两个问题:① `NodeJS` 命名空间在本包(tsconfig `types: []`、无 @types/node)不存在;
6
- * ② 浏览器里 `process` 未定义,**不传参调用会 ReferenceError**(不是类型问题,是运行时崩)。
7
- *
8
- * 🔴 等价性记账(逐字):Node 下 `hostEnv()` 返回的就是 `process.env` 那个**同一对象**
9
- * (`globalThis.process === process`),所以壳侧既有「不传 env 参数」的调用点行为一字节不变;
10
- * 浏览器/worker 下返回 `{}` —— 相当于「所有 env 旋钮未设置」,即各函数自己的缺省档。
11
- * `EnvLike` 与 `NodeJS.ProcessEnv`(= `Dict<string>`)结构等价,壳侧传 `process.env` 照样过型。
12
- */
13
- /** `process.env` 的结构等价形(`NodeJS.ProcessEnv` 的包内替身)。 */
14
1
  export type EnvLike = Record<string, string | undefined>;
15
- /** 宿主 env(Node = 真 `process.env` 同一对象;无 process 的宿主 = 空表)。 */
16
2
  export declare function hostEnv(): EnvLike;
package/dist/hostEnv.js CHANGED
@@ -1,16 +1,3 @@
1
- /**
2
- * hostEnv.ts — B2 批引入的**唯一**宿主环境读口(多端改造设计稿 §5.2 浏览器可移植性)。
3
- *
4
- * 为什么需要:搬入的 `*WireCaps` 族有 11 个函数签名是 `(env: NodeJS.ProcessEnv = process.env)`
5
- * —— 两个问题:① `NodeJS` 命名空间在本包(tsconfig `types: []`、无 @types/node)不存在;
6
- * ② 浏览器里 `process` 未定义,**不传参调用会 ReferenceError**(不是类型问题,是运行时崩)。
7
- *
8
- * 🔴 等价性记账(逐字):Node 下 `hostEnv()` 返回的就是 `process.env` 那个**同一对象**
9
- * (`globalThis.process === process`),所以壳侧既有「不传 env 参数」的调用点行为一字节不变;
10
- * 浏览器/worker 下返回 `{}` —— 相当于「所有 env 旋钮未设置」,即各函数自己的缺省档。
11
- * `EnvLike` 与 `NodeJS.ProcessEnv`(= `Dict<string>`)结构等价,壳侧传 `process.env` 照样过型。
12
- */
13
- /** 宿主 env(Node = 真 `process.env` 同一对象;无 process 的宿主 = 空表)。 */
14
1
  export function hostEnv() {
15
2
  const p = globalThis.process;
16
3
  return p?.env ?? {};
@@ -1,28 +1,7 @@
1
- /**
2
- * ⇄ B2 批搬迁(2026-07-27,多端改造设计稿 §3 B2):cli src/sema/imagesWireCaps.ts 逐字搬入(零依赖)。
3
- */
4
- /**
5
- * src/sema/imagesWireCaps.ts — PURE projection of a CC user message's IMAGE content blocks → engine ImageInput[]
6
- * (CC paste-image / drag-image parity). seamQuery imports it.
7
- *
8
- * The signature "壳渲染后端空" hole: REPL.tsx:3444 builds Anthropic image blocks
9
- * { type:'image', source:{ type:'base64', media_type, data } } (or { type:'url', url })
10
- * into the user message's `content` block array, but seamQuery.objectiveFromMessage kept ONLY `type==='text'`
11
- * blocks — so pasted images RENDERED but never reached the live engine. core/service already consume
12
- * `body.images` (main.ts:1296 → core `TaskSpec.images?: ImageInput[]`, types.ts:416 + brain toUserBlocks); this
13
- * is purely the missing shell-side projection. config-class (model-content the caller chose for their OWN turn).
14
- *
15
- * core ImageInput = `{ data: base64, mimeType } | { url }`. We map the Anthropic base64 source
16
- * (`source.media_type`/`source.data`) → `{ data, mimeType }`, and a url source → `{ url }`.
17
- */
18
1
  export type ImageInput = {
19
2
  data: string;
20
3
  mimeType: string;
21
4
  } | {
22
5
  url: string;
23
6
  };
24
- /**
25
- * Extract the IMAGE blocks of a CC user message → ImageInput[]. Reads `message.content` (string | block[]) the
26
- * same way objectiveFromMessage reads its text; a bare-string content has no images ⇒ []. Malformed blocks drop.
27
- */
28
7
  export declare function imagesFromMessage(msg: unknown): ImageInput[];