@raidiant/notifai 11.7.1 → 12.0.0-beta.11

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 (409) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/NOTICE +16 -0
  3. package/THIRD_PARTY_NOTICES +725 -0
  4. package/bin/notifai.mjs +11420 -0
  5. package/data/install.ps1 +318 -0
  6. package/data/release.json +1 -0
  7. package/inventory.json +1 -0
  8. package/npm-adapter-files.json +52 -0
  9. package/package.json +14 -44
  10. package/README.md +0 -168
  11. package/dist/agent-update-notice.d.ts +0 -7
  12. package/dist/agent-update-notice.js +0 -77
  13. package/dist/agent-update-notice.js.map +0 -1
  14. package/dist/atomic-file.d.ts +0 -30
  15. package/dist/atomic-file.js +0 -148
  16. package/dist/atomic-file.js.map +0 -1
  17. package/dist/attendant-update.d.ts +0 -15
  18. package/dist/attendant-update.js +0 -96
  19. package/dist/attendant-update.js.map +0 -1
  20. package/dist/claude-wake.d.ts +0 -108
  21. package/dist/claude-wake.js +0 -369
  22. package/dist/claude-wake.js.map +0 -1
  23. package/dist/cli-bin.d.ts +0 -26
  24. package/dist/cli-bin.js +0 -220
  25. package/dist/cli-bin.js.map +0 -1
  26. package/dist/cli-contract.d.ts +0 -16
  27. package/dist/cli-contract.js +0 -27
  28. package/dist/cli-contract.js.map +0 -1
  29. package/dist/cli-release.d.ts +0 -36
  30. package/dist/cli-release.js +0 -85
  31. package/dist/cli-release.js.map +0 -1
  32. package/dist/client.d.ts +0 -109
  33. package/dist/client.js +0 -217
  34. package/dist/client.js.map +0 -1
  35. package/dist/codex-answer-control.d.ts +0 -14
  36. package/dist/codex-answer-control.js +0 -41
  37. package/dist/codex-answer-control.js.map +0 -1
  38. package/dist/codex-answer-presentation.d.ts +0 -18
  39. package/dist/codex-answer-presentation.js +0 -113
  40. package/dist/codex-answer-presentation.js.map +0 -1
  41. package/dist/codex-input-lifecycle.d.ts +0 -10
  42. package/dist/codex-input-lifecycle.js +0 -63
  43. package/dist/codex-input-lifecycle.js.map +0 -1
  44. package/dist/codex-native-control.d.ts +0 -13
  45. package/dist/codex-native-control.js +0 -120
  46. package/dist/codex-native-control.js.map +0 -1
  47. package/dist/codex-native-turn.d.ts +0 -37
  48. package/dist/codex-native-turn.js +0 -155
  49. package/dist/codex-native-turn.js.map +0 -1
  50. package/dist/codex-question-bindings.d.ts +0 -76
  51. package/dist/codex-question-bindings.js +0 -151
  52. package/dist/codex-question-bindings.js.map +0 -1
  53. package/dist/codex-queue-control.d.ts +0 -21
  54. package/dist/codex-queue-control.js +0 -59
  55. package/dist/codex-queue-control.js.map +0 -1
  56. package/dist/codex-tool-messages.d.ts +0 -7
  57. package/dist/codex-tool-messages.js +0 -126
  58. package/dist/codex-tool-messages.js.map +0 -1
  59. package/dist/codex-wake.d.ts +0 -58
  60. package/dist/codex-wake.js +0 -135
  61. package/dist/codex-wake.js.map +0 -1
  62. package/dist/command-session.d.ts +0 -14
  63. package/dist/command-session.js +0 -31
  64. package/dist/command-session.js.map +0 -1
  65. package/dist/commands-acknowledge.d.ts +0 -13
  66. package/dist/commands-acknowledge.js +0 -116
  67. package/dist/commands-acknowledge.js.map +0 -1
  68. package/dist/commands-agent-sessions.d.ts +0 -6
  69. package/dist/commands-agent-sessions.js +0 -51
  70. package/dist/commands-agent-sessions.js.map +0 -1
  71. package/dist/commands-ask.d.ts +0 -62
  72. package/dist/commands-ask.js +0 -503
  73. package/dist/commands-ask.js.map +0 -1
  74. package/dist/commands-auth.d.ts +0 -76
  75. package/dist/commands-auth.js +0 -421
  76. package/dist/commands-auth.js.map +0 -1
  77. package/dist/commands-close.d.ts +0 -6
  78. package/dist/commands-close.js +0 -273
  79. package/dist/commands-close.js.map +0 -1
  80. package/dist/commands-config.d.ts +0 -31
  81. package/dist/commands-config.js +0 -272
  82. package/dist/commands-config.js.map +0 -1
  83. package/dist/commands-core.d.ts +0 -145
  84. package/dist/commands-core.js +0 -190
  85. package/dist/commands-core.js.map +0 -1
  86. package/dist/commands-devices.d.ts +0 -41
  87. package/dist/commands-devices.js +0 -144
  88. package/dist/commands-devices.js.map +0 -1
  89. package/dist/commands-doctor.d.ts +0 -25
  90. package/dist/commands-doctor.js +0 -1553
  91. package/dist/commands-doctor.js.map +0 -1
  92. package/dist/commands-guidance.d.ts +0 -27
  93. package/dist/commands-guidance.js +0 -150
  94. package/dist/commands-guidance.js.map +0 -1
  95. package/dist/commands-harness-context.d.ts +0 -57
  96. package/dist/commands-harness-context.js +0 -102
  97. package/dist/commands-harness-context.js.map +0 -1
  98. package/dist/commands-hook-attend.d.ts +0 -70
  99. package/dist/commands-hook-attend.js +0 -655
  100. package/dist/commands-hook-attend.js.map +0 -1
  101. package/dist/commands-hook-diagnostics.d.ts +0 -37
  102. package/dist/commands-hook-diagnostics.js +0 -136
  103. package/dist/commands-hook-diagnostics.js.map +0 -1
  104. package/dist/commands-hook-install.d.ts +0 -26
  105. package/dist/commands-hook-install.js +0 -784
  106. package/dist/commands-hook-install.js.map +0 -1
  107. package/dist/commands-hook-run.d.ts +0 -29
  108. package/dist/commands-hook-run.js +0 -933
  109. package/dist/commands-hook-run.js.map +0 -1
  110. package/dist/commands-hook-shape.d.ts +0 -19
  111. package/dist/commands-hook-shape.js +0 -48
  112. package/dist/commands-hook-shape.js.map +0 -1
  113. package/dist/commands-init.d.ts +0 -42
  114. package/dist/commands-init.js +0 -901
  115. package/dist/commands-init.js.map +0 -1
  116. package/dist/commands-io.d.ts +0 -2
  117. package/dist/commands-io.js +0 -117
  118. package/dist/commands-io.js.map +0 -1
  119. package/dist/commands-logs.d.ts +0 -30
  120. package/dist/commands-logs.js +0 -201
  121. package/dist/commands-logs.js.map +0 -1
  122. package/dist/commands-native-acknowledge.d.ts +0 -8
  123. package/dist/commands-native-acknowledge.js +0 -114
  124. package/dist/commands-native-acknowledge.js.map +0 -1
  125. package/dist/commands-project.d.ts +0 -4
  126. package/dist/commands-project.js +0 -41
  127. package/dist/commands-project.js.map +0 -1
  128. package/dist/commands-receive.d.ts +0 -3
  129. package/dist/commands-receive.js +0 -59
  130. package/dist/commands-receive.js.map +0 -1
  131. package/dist/commands-send-support.d.ts +0 -59
  132. package/dist/commands-send-support.js +0 -258
  133. package/dist/commands-send-support.js.map +0 -1
  134. package/dist/commands-send.d.ts +0 -34
  135. package/dist/commands-send.js +0 -900
  136. package/dist/commands-send.js.map +0 -1
  137. package/dist/commands-setup-proof.d.ts +0 -43
  138. package/dist/commands-setup-proof.js +0 -134
  139. package/dist/commands-setup-proof.js.map +0 -1
  140. package/dist/commands-skill.d.ts +0 -21
  141. package/dist/commands-skill.js +0 -199
  142. package/dist/commands-skill.js.map +0 -1
  143. package/dist/commands-sounds.d.ts +0 -12
  144. package/dist/commands-sounds.js +0 -35
  145. package/dist/commands-sounds.js.map +0 -1
  146. package/dist/commands-update-check.d.ts +0 -6
  147. package/dist/commands-update-check.js +0 -102
  148. package/dist/commands-update-check.js.map +0 -1
  149. package/dist/commands-update-resume.d.ts +0 -7
  150. package/dist/commands-update-resume.js +0 -143
  151. package/dist/commands-update-resume.js.map +0 -1
  152. package/dist/commands-update-skill.d.ts +0 -5
  153. package/dist/commands-update-skill.js +0 -36
  154. package/dist/commands-update-skill.js.map +0 -1
  155. package/dist/commands-update.d.ts +0 -11
  156. package/dist/commands-update.js +0 -286
  157. package/dist/commands-update.js.map +0 -1
  158. package/dist/commands.d.ts +0 -26
  159. package/dist/commands.js +0 -27
  160. package/dist/commands.js.map +0 -1
  161. package/dist/config-schema.d.ts +0 -62
  162. package/dist/config-schema.js +0 -302
  163. package/dist/config-schema.js.map +0 -1
  164. package/dist/config.d.ts +0 -181
  165. package/dist/config.js +0 -357
  166. package/dist/config.js.map +0 -1
  167. package/dist/credentials.d.ts +0 -96
  168. package/dist/credentials.js +0 -342
  169. package/dist/credentials.js.map +0 -1
  170. package/dist/file-lock.d.ts +0 -34
  171. package/dist/file-lock.js +0 -367
  172. package/dist/file-lock.js.map +0 -1
  173. package/dist/generated-session-label.d.ts +0 -2
  174. package/dist/generated-session-label.js +0 -152
  175. package/dist/generated-session-label.js.map +0 -1
  176. package/dist/guidance-content.d.ts +0 -53
  177. package/dist/guidance-content.js +0 -248
  178. package/dist/guidance-content.js.map +0 -1
  179. package/dist/guidance-render.d.ts +0 -25
  180. package/dist/guidance-render.js +0 -47
  181. package/dist/guidance-render.js.map +0 -1
  182. package/dist/guidance.d.ts +0 -69
  183. package/dist/guidance.js +0 -173
  184. package/dist/guidance.js.map +0 -1
  185. package/dist/harness-session-title.d.ts +0 -22
  186. package/dist/harness-session-title.js +0 -74
  187. package/dist/harness-session-title.js.map +0 -1
  188. package/dist/harnesses.d.ts +0 -65
  189. package/dist/harnesses.js +0 -159
  190. package/dist/harnesses.js.map +0 -1
  191. package/dist/hermes-attendant.d.ts +0 -38
  192. package/dist/hermes-attendant.js +0 -337
  193. package/dist/hermes-attendant.js.map +0 -1
  194. package/dist/hermes-plugin.d.ts +0 -11
  195. package/dist/hermes-plugin.js +0 -299
  196. package/dist/hermes-plugin.js.map +0 -1
  197. package/dist/hook-acknowledgements.d.ts +0 -70
  198. package/dist/hook-acknowledgements.js +0 -490
  199. package/dist/hook-acknowledgements.js.map +0 -1
  200. package/dist/hook-adapter.d.ts +0 -48
  201. package/dist/hook-adapter.js +0 -419
  202. package/dist/hook-adapter.js.map +0 -1
  203. package/dist/hook-events.d.ts +0 -105
  204. package/dist/hook-events.js +0 -130
  205. package/dist/hook-events.js.map +0 -1
  206. package/dist/hook-gates.d.ts +0 -7
  207. package/dist/hook-gates.js +0 -20
  208. package/dist/hook-gates.js.map +0 -1
  209. package/dist/hook-input.d.ts +0 -10
  210. package/dist/hook-input.js +0 -64
  211. package/dist/hook-input.js.map +0 -1
  212. package/dist/hook-lifecycle.d.ts +0 -112
  213. package/dist/hook-lifecycle.js +0 -2031
  214. package/dist/hook-lifecycle.js.map +0 -1
  215. package/dist/hook-project-sessions.d.ts +0 -28
  216. package/dist/hook-project-sessions.js +0 -141
  217. package/dist/hook-project-sessions.js.map +0 -1
  218. package/dist/hook-question-lock.d.ts +0 -29
  219. package/dist/hook-question-lock.js +0 -217
  220. package/dist/hook-question-lock.js.map +0 -1
  221. package/dist/hook-question-retirement.d.ts +0 -74
  222. package/dist/hook-question-retirement.js +0 -314
  223. package/dist/hook-question-retirement.js.map +0 -1
  224. package/dist/hook-question-state.d.ts +0 -58
  225. package/dist/hook-question-state.js +0 -239
  226. package/dist/hook-question-state.js.map +0 -1
  227. package/dist/hook-session-state.d.ts +0 -127
  228. package/dist/hook-session-state.js +0 -488
  229. package/dist/hook-session-state.js.map +0 -1
  230. package/dist/hook-types.d.ts +0 -476
  231. package/dist/hook-types.js +0 -4
  232. package/dist/hook-types.js.map +0 -1
  233. package/dist/injection-render.d.ts +0 -36
  234. package/dist/injection-render.js +0 -61
  235. package/dist/injection-render.js.map +0 -1
  236. package/dist/install-hooks.d.ts +0 -470
  237. package/dist/install-hooks.js +0 -1622
  238. package/dist/install-hooks.js.map +0 -1
  239. package/dist/integration-health.d.ts +0 -26
  240. package/dist/integration-health.js +0 -133
  241. package/dist/integration-health.js.map +0 -1
  242. package/dist/interactive.d.ts +0 -22
  243. package/dist/interactive.js +0 -644
  244. package/dist/interactive.js.map +0 -1
  245. package/dist/invocation-context.d.ts +0 -47
  246. package/dist/invocation-context.js +0 -164
  247. package/dist/invocation-context.js.map +0 -1
  248. package/dist/local-path.d.ts +0 -7
  249. package/dist/local-path.js +0 -27
  250. package/dist/local-path.js.map +0 -1
  251. package/dist/logging.d.ts +0 -157
  252. package/dist/logging.js +0 -599
  253. package/dist/logging.js.map +0 -1
  254. package/dist/main-run.d.ts +0 -1
  255. package/dist/main-run.js +0 -42
  256. package/dist/main-run.js.map +0 -1
  257. package/dist/main.d.ts +0 -2
  258. package/dist/main.js +0 -12
  259. package/dist/main.js.map +0 -1
  260. package/dist/native-answer-operation.d.ts +0 -70
  261. package/dist/native-answer-operation.js +0 -247
  262. package/dist/native-answer-operation.js.map +0 -1
  263. package/dist/native-skills.d.ts +0 -64
  264. package/dist/native-skills.js +0 -167
  265. package/dist/native-skills.js.map +0 -1
  266. package/dist/node-floor.d.ts +0 -19
  267. package/dist/node-floor.js +0 -32
  268. package/dist/node-floor.js.map +0 -1
  269. package/dist/npm-invocation.d.ts +0 -34
  270. package/dist/npm-invocation.js +0 -53
  271. package/dist/npm-invocation.js.map +0 -1
  272. package/dist/openclaw-continuation-bridge.d.ts +0 -7
  273. package/dist/openclaw-continuation-bridge.js +0 -64
  274. package/dist/openclaw-continuation-bridge.js.map +0 -1
  275. package/dist/openclaw-gateway-readiness.d.ts +0 -1
  276. package/dist/openclaw-gateway-readiness.js +0 -24
  277. package/dist/openclaw-gateway-readiness.js.map +0 -1
  278. package/dist/openclaw-generation.d.ts +0 -21
  279. package/dist/openclaw-generation.js +0 -115
  280. package/dist/openclaw-generation.js.map +0 -1
  281. package/dist/openclaw-message-bridge.d.ts +0 -8
  282. package/dist/openclaw-message-bridge.js +0 -93
  283. package/dist/openclaw-message-bridge.js.map +0 -1
  284. package/dist/openclaw-pending.d.ts +0 -8
  285. package/dist/openclaw-pending.js +0 -47
  286. package/dist/openclaw-pending.js.map +0 -1
  287. package/dist/openclaw-plugin.d.ts +0 -75
  288. package/dist/openclaw-plugin.js +0 -1353
  289. package/dist/openclaw-plugin.js.map +0 -1
  290. package/dist/openclaw-session-access.d.ts +0 -12
  291. package/dist/openclaw-session-access.js +0 -79
  292. package/dist/openclaw-session-access.js.map +0 -1
  293. package/dist/opencode-plugin.d.ts +0 -88
  294. package/dist/opencode-plugin.js +0 -286
  295. package/dist/opencode-plugin.js.map +0 -1
  296. package/dist/orca-session-title.d.ts +0 -11
  297. package/dist/orca-session-title.js +0 -111
  298. package/dist/orca-session-title.js.map +0 -1
  299. package/dist/pack-feedback-slice.d.ts +0 -35
  300. package/dist/pack-feedback-slice.js +0 -126
  301. package/dist/pack-feedback-slice.js.map +0 -1
  302. package/dist/pairing-qr.d.ts +0 -5
  303. package/dist/pairing-qr.js +0 -24
  304. package/dist/pairing-qr.js.map +0 -1
  305. package/dist/pending-pairing.d.ts +0 -38
  306. package/dist/pending-pairing.js +0 -70
  307. package/dist/pending-pairing.js.map +0 -1
  308. package/dist/platform.d.ts +0 -67
  309. package/dist/platform.js +0 -140
  310. package/dist/platform.js.map +0 -1
  311. package/dist/process-identity.d.ts +0 -26
  312. package/dist/process-identity.js +0 -82
  313. package/dist/process-identity.js.map +0 -1
  314. package/dist/program.d.ts +0 -59
  315. package/dist/program.js +0 -691
  316. package/dist/program.js.map +0 -1
  317. package/dist/project-enablement.d.ts +0 -21
  318. package/dist/project-enablement.js +0 -71
  319. package/dist/project-enablement.js.map +0 -1
  320. package/dist/question-settlement-process.d.ts +0 -17
  321. package/dist/question-settlement-process.js +0 -35
  322. package/dist/question-settlement-process.js.map +0 -1
  323. package/dist/question-timing.d.ts +0 -46
  324. package/dist/question-timing.js +0 -48
  325. package/dist/question-timing.js.map +0 -1
  326. package/dist/readiness.d.ts +0 -153
  327. package/dist/readiness.js +0 -149
  328. package/dist/readiness.js.map +0 -1
  329. package/dist/release.d.ts +0 -31
  330. package/dist/release.js +0 -52
  331. package/dist/release.js.map +0 -1
  332. package/dist/send-attempts.d.ts +0 -26
  333. package/dist/send-attempts.js +0 -139
  334. package/dist/send-attempts.js.map +0 -1
  335. package/dist/send.d.ts +0 -115
  336. package/dist/send.js +0 -421
  337. package/dist/send.js.map +0 -1
  338. package/dist/session-activation.d.ts +0 -13
  339. package/dist/session-activation.js +0 -64
  340. package/dist/session-activation.js.map +0 -1
  341. package/dist/session-attendant-probe.d.ts +0 -85
  342. package/dist/session-attendant-probe.js +0 -173
  343. package/dist/session-attendant-probe.js.map +0 -1
  344. package/dist/session-attendant-state.d.ts +0 -70
  345. package/dist/session-attendant-state.js +0 -256
  346. package/dist/session-attendant-state.js.map +0 -1
  347. package/dist/session-attendant.d.ts +0 -143
  348. package/dist/session-attendant.js +0 -520
  349. package/dist/session-attendant.js.map +0 -1
  350. package/dist/session-delivery.d.ts +0 -249
  351. package/dist/session-delivery.js +0 -576
  352. package/dist/session-delivery.js.map +0 -1
  353. package/dist/session-handoff.d.ts +0 -98
  354. package/dist/session-handoff.js +0 -118
  355. package/dist/session-handoff.js.map +0 -1
  356. package/dist/session-input-wakes.d.ts +0 -78
  357. package/dist/session-input-wakes.js +0 -239
  358. package/dist/session-input-wakes.js.map +0 -1
  359. package/dist/session-inputs.d.ts +0 -57
  360. package/dist/session-inputs.js +0 -434
  361. package/dist/session-inputs.js.map +0 -1
  362. package/dist/session-labels.d.ts +0 -56
  363. package/dist/session-labels.js +0 -396
  364. package/dist/session-labels.js.map +0 -1
  365. package/dist/session-message-handoff.d.ts +0 -39
  366. package/dist/session-message-handoff.js +0 -107
  367. package/dist/session-message-handoff.js.map +0 -1
  368. package/dist/setup-destinations.d.ts +0 -23
  369. package/dist/setup-destinations.js +0 -44
  370. package/dist/setup-destinations.js.map +0 -1
  371. package/dist/skill-integrity.d.ts +0 -54
  372. package/dist/skill-integrity.js +0 -164
  373. package/dist/skill-integrity.js.map +0 -1
  374. package/dist/skill-source/manifest.json +0 -40
  375. package/dist/skill-source/notifai/SKILL.md +0 -350
  376. package/dist/skill-source/notifai/references/diagnostics.md +0 -36
  377. package/dist/skill-source/notifai/references/harness-setup.md +0 -384
  378. package/dist/skill-source/notifai/references/native-questions.md +0 -51
  379. package/dist/skill-source/notifai/references/notes-and-edits.md +0 -54
  380. package/dist/skill-source/notifai/references/send-details.md +0 -14
  381. package/dist/skill-source/notifai/references/updates.md +0 -116
  382. package/dist/skill-source/notifai/references/writing-examples.md +0 -56
  383. package/dist/sound-ref.d.ts +0 -23
  384. package/dist/sound-ref.js +0 -28
  385. package/dist/sound-ref.js.map +0 -1
  386. package/dist/ui/banner.d.ts +0 -22
  387. package/dist/ui/banner.js +0 -87
  388. package/dist/ui/banner.js.map +0 -1
  389. package/dist/ui/config-view.d.ts +0 -30
  390. package/dist/ui/config-view.js +0 -108
  391. package/dist/ui/config-view.js.map +0 -1
  392. package/dist/ui/help.d.ts +0 -44
  393. package/dist/ui/help.js +0 -107
  394. package/dist/ui/help.js.map +0 -1
  395. package/dist/ui/theme.d.ts +0 -90
  396. package/dist/ui/theme.js +0 -244
  397. package/dist/ui/theme.js.map +0 -1
  398. package/dist/update-handoff.d.ts +0 -29
  399. package/dist/update-handoff.js +0 -69
  400. package/dist/update-handoff.js.map +0 -1
  401. package/dist/url-policy.d.ts +0 -85
  402. package/dist/url-policy.js +0 -369
  403. package/dist/url-policy.js.map +0 -1
  404. package/dist/version.d.ts +0 -40
  405. package/dist/version.js +0 -132
  406. package/dist/version.js.map +0 -1
  407. package/dist/wake-support.d.ts +0 -40
  408. package/dist/wake-support.js +0 -95
  409. package/dist/wake-support.js.map +0 -1
@@ -1,470 +0,0 @@
1
- import { hookHostPlatform, type HookHostPlatform } from './hook-adapter.js';
2
- import { type HookInstallableHarness } from './harnesses.js';
3
- /**
4
- * Harness hook installation.
5
- *
6
- * Notifai owns exactly one lifecycle mechanism per harness, in the current
7
- * User's account and that harness's active home. There is no second install
8
- * scope: whether Notifai activates in a Project is Project Enablement's
9
- * question, and Project-scoped hook files are read only as migration evidence
10
- * to remove.
11
- *
12
- * Claude Code's `settings.json` and Codex's hook files use the same shape —
13
- * `hooks` maps an event name to matcher groups, each holding command handlers
14
- * with an optional timeout — so one generator serves both. Only the file
15
- * location and the event set differ. Codex supports either a dedicated
16
- * `hooks.json` or inline `[hooks]` tables in the same layer's `config.toml`;
17
- * a fresh install writes `hooks.json`, except when the User's own hooks already
18
- * live inline. Notifai-owned inline handlers with no foreign inline neighbours
19
- * are moved to `hooks.json`. Notifai lives in one of them, never both.
20
- *
21
- * Cursor's native format is flat and lower-camel-cased, while OpenCode's
22
- * extension point is a JavaScript plugin module. Each therefore has a bounded
23
- * adapter instead of being forced through this shared document shape.
24
- */
25
- export interface HookHandler {
26
- type: 'command';
27
- command: string;
28
- timeout?: number;
29
- async?: boolean;
30
- asyncRewake?: boolean;
31
- statusMessage?: string;
32
- /**
33
- * Codex-only. Approximate token threshold for spilling `additionalContext`.
34
- * Unset uses Codex's 2,500-token default; `0` passes the full context.
35
- */
36
- additionalContextLimit?: number;
37
- }
38
- export interface HookGroup {
39
- matcher?: string;
40
- hooks: HookHandler[];
41
- }
42
- export type HookConfig = Record<string, HookGroup[]>;
43
- export interface HookCommandOptions {
44
- platform?: NodeJS.Platform | HookHostPlatform;
45
- /** Registered Node used to interpret the Windows adapter. Ignored on POSIX. */
46
- nodePath?: string;
47
- }
48
- /**
49
- * The command each hook runs. Harness definitions know only the stable
50
- * user-level adapter. Mutable Node, package-manager, version, and checkout
51
- * paths live behind that seam and never enter a trusted hook identity —
52
- * except on Windows, where CreateProcess cannot run the adapter without an
53
- * explicit Node executable, so the registered interpreter is named first.
54
- */
55
- export declare function hookCommand(adapterPath: string, event: string, harness?: HookInstallableHarness, options?: HookCommandOptions): string;
56
- /** The leading argv that every Notifai handler must start with. */
57
- export declare function hookCommandPrefix(adapterPath: string, options?: HookCommandOptions): string;
58
- /**
59
- * Says "Notifai installed this" without saying which checkout did.
60
- *
61
- * Ownership used to be matched on the absolute script path, so installing from
62
- * a second checkout did not recognise the first one's handlers as ours. Both
63
- * stayed, the harness ran both, and one question produced two notifications;
64
- * uninstalling the second silently left the first running. A marker that every
65
- * Notifai build writes and no build's path appears in fixes that by making
66
- * ownership a property of the handler rather than of the machine it was
67
- * installed from.
68
- *
69
- * It is a real (ignored) CLI flag rather than a comment because not every
70
- * harness runs the command through a shell.
71
- */
72
- export declare const OWNER_MARKER = "--owner notifai";
73
- /**
74
- * Quote one Windows argv element so CommandLineToArgvW / CreateProcess keep
75
- * it as a single argument. Always used for the Node and adapter paths, which
76
- * routinely contain spaces (`Program Files`) and must not use POSIX quotes
77
- * inside JSON or TOML harness documents.
78
- */
79
- export declare function quoteWindowsArg(value: string): string;
80
- export interface BuildOptions {
81
- /** Stable user-level executable installed by the hook adapter module. */
82
- adapterPath: string;
83
- /** The installed adapter stamps its exact harness into project pointers. */
84
- harness?: HookInstallableHarness;
85
- platform?: NodeJS.Platform | HookHostPlatform;
86
- /** Registered Node named first in Windows hook commands. */
87
- nodePath?: string;
88
- }
89
- /**
90
- * Harnesses without asynchronous Question Routing use this short Stop budget.
91
- * Claude Code and Codex use `QUESTION_STOP_TIMEOUT_SECONDS` instead.
92
- */
93
- export declare const NON_ROUTING_BLOCKING_STOP_TIMEOUT_SECONDS = 540;
94
- export { QUESTION_STOP_TIMEOUT_SECONDS } from './question-timing.js';
95
- /**
96
- * Codex's Session Attendant lifetime. Codex kills an async hook at its
97
- * declared timeout, so the attendant declares the same complete window a
98
- * question owner does; the next prompt or turn end starts another.
99
- */
100
- export declare const CODEX_ATTEND_TIMEOUT_SECONDS: number;
101
- /** Codex clamps an Interrupt hook to three seconds; declaring it keeps the definition honest. */
102
- export declare const CODEX_INTERRUPT_TIMEOUT_SECONDS = 3;
103
- /**
104
- * Whether this harness's Stop handler runs detached from the turn.
105
- *
106
- * The installer and doctor share this predicate so they agree which harnesses
107
- * run out of band. Owner lifetime is route-neutral and lives in
108
- * `question-timing.ts`.
109
- *
110
- * Codex is detached on every platform because its delivery route is a write to
111
- * the thread's own durable inbox rather than this hook's stdout: there is no
112
- * continuation to keep a turn open for, and the queue has no platform
113
- * dependency to gate on. Claude Code still needs its turn held on Windows,
114
- * where no inbox socket exists.
115
- */
116
- export declare function stopHandlerIsDetached(harness: HookInstallableHarness | undefined, platform?: Parameters<typeof hookHostPlatform>[0]): boolean;
117
- /**
118
- * The turn-end handler, whose shape is the whole per-harness difference.
119
- *
120
- * Claude Code takes the answer over its own inbox socket and Codex takes it
121
- * through its thread's durable inbox, so both Stop hooks are `async: true`:
122
- * they return immediately, the terminal is never held, and the waiter finishes
123
- * out of band. Only Claude on Windows still blocks and prints a continuation to
124
- * stdout, because no inbox socket exists there. Every Question Routing owner
125
- * declares the same complete-window timeout, because the detached waiter must
126
- * outlive the answer window in every case; what changed for Codex is that a
127
- * short or missing timeout no longer truncates a held *turn*. Blocking hosts
128
- * also set `statusMessage` so the held turn is not mistaken for a hang.
129
- */
130
- export declare const BLOCKING_STOP_STATUS_MESSAGE = "Notifai: waiting for your answer";
131
- export declare function buildHookConfig(options: BuildOptions): HookConfig;
132
- export interface CursorHookHandler {
133
- command: string;
134
- timeout?: number;
135
- loop_limit?: number | null;
136
- }
137
- export type CursorHookConfig = Record<string, CursorHookHandler[]>;
138
- interface CursorSettingsDocument {
139
- version?: number;
140
- hooks?: CursorHookConfig;
141
- [key: string]: unknown;
142
- }
143
- /** Cursor's native schema is flat and uses lower-camel lifecycle event names. */
144
- export declare function buildCursorHookConfig(options: BuildOptions): CursorHookConfig;
145
- /**
146
- * The one file each harness reads Notifai's lifecycle wiring from: the current
147
- * User's account, in that harness's active home.
148
- */
149
- export declare function settingsFile(harness: HookInstallableHarness, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string;
150
- /**
151
- * Files an older build may have left inside this Project, which Notifai now
152
- * only ever reads in order to remove.
153
- *
154
- * Nothing installs here any more. Every path is still enumerated because a
155
- * leftover Project-scoped handler keeps firing beside the Machine one, and
156
- * silently leaving it would be exactly the duplicate-routing defect dropping
157
- * the second scope was meant to end.
158
- */
159
- export declare function legacyProjectHookFiles(harness: HookInstallableHarness, cwd: string): string[];
160
- /**
161
- * The account home harness config roots are resolved against.
162
- *
163
- * Delegates to the shared process/path `accountHome` so Cursor, OpenCode,
164
- * Claude, and Codex follow the same Windows USERPROFILE / MSYS HOME rules.
165
- */
166
- export declare function harnessAccountHome(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string;
167
- /**
168
- * Where Codex looks for a project's hooks — the **main** repository, not the
169
- * working directory.
170
- *
171
- * Run from a linked git worktree, Codex reads `<main repo>/.codex/config.toml`
172
- * (or a leftover `hooks.json`) and never looks at the worktree's own. Proven 2026-08-03 in an isolated
173
- * `CODEX_HOME`: with cwd set to a worktree, a handler at the main repo root
174
- * fired and an identical one at the worktree root did not; removing the main
175
- * one left nothing firing at all. Writing to cwd therefore produces a silent
176
- * no-op for anyone whose agent runs in a worktree, which is the normal case
177
- * under tooling like Orca.
178
- *
179
- * Claude Code does not share this behaviour — it reads the worktree's own
180
- * `.claude/settings.local.json` — so this deliberately applies to Codex only.
181
- */
182
- export declare function codexProjectRoot(cwd: string): string;
183
- /**
184
- * Harness-specific home variables relocate the whole active harness home.
185
- * This matters under session managers that give each Codex account its own
186
- * `CODEX_HOME`: writing to the OS account's ~/.codex would configure a
187
- * different Codex installation than the one running the command.
188
- */
189
- export declare function configHome(env: NodeJS.ProcessEnv, variable: string, fallback: string, platform?: NodeJS.Platform | HookHostPlatform): string;
190
- /**
191
- * User-global Codex config directory for the *running* Codex installation.
192
- *
193
- * `CODEX_HOME` replaces the home; it does not shadow it. `codex doctor` with
194
- * the variable set reports that directory for every path it resolves and never
195
- * consults `~/.codex` at all. So a session manager that points Codex at its own
196
- * home makes `~/.codex` inert for those sessions, and installing there would
197
- * write hooks the running agent never reads while reporting success.
198
- *
199
- * Following the variable is therefore correct even though it means install and
200
- * doctor resolve different homes when run from different shells. Doctor names
201
- * the home it inspected for exactly that reason — see `codexHomeNote`.
202
- */
203
- export declare function codexGlobalDir(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string;
204
- export interface CodexLayerPaths {
205
- dir: string;
206
- hooksJson: string;
207
- configToml: string;
208
- }
209
- /** The two files Codex will look at in the Machine layer Notifai installs into. */
210
- export declare function codexMachineLayerPaths(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): CodexLayerPaths;
211
- /**
212
- * Project layers an older build may have written into, for removal only.
213
- *
214
- * Codex resolves a project hook file against the main repository, so a linked
215
- * worktree has two candidate directories: the main checkout's `.codex`, which
216
- * Codex reads, and the worktree's own, which older builds sometimes created and
217
- * Codex never reads. Both are legacy residue and both are enumerated here.
218
- */
219
- export declare function codexLegacyProjectLayers(cwd: string): CodexLayerPaths[];
220
- export interface CodexLayerInspection {
221
- paths: CodexLayerPaths;
222
- /** Every event this file defines a handler for, whoever owns it. */
223
- jsonEvents: string[];
224
- tomlEvents: string[];
225
- /** The subset of those events whose handlers are Notifai's own. */
226
- ourJsonEvents: string[];
227
- ourTomlEvents: string[];
228
- /** Whether `config.toml` holds at least one hook handler Notifai does not own. */
229
- foreignTomlHooks: boolean;
230
- writeTarget: string;
231
- }
232
- /**
233
- * Where Notifai writes in this Codex layer.
234
- *
235
- * `config.toml` is the User's whole Codex configuration and Codex rewrites it
236
- * itself for `[hooks.state]`; keeping Notifai out of it bounds the blast radius
237
- * to hooks, removes a second writer racing those trust records, and replaces
238
- * TOML splicing with the same JSON merge Claude Code uses. Joining an inline
239
- * layer that already has the User's handlers is the one exception, and it
240
- * exists only so Codex never prints its dual-representation warning.
241
- *
242
- * A fresh installation uses `hooks.json` unless foreign inline handlers make
243
- * `config.toml` the layer's established representation. Notifai-owned inline
244
- * handlers with no foreign inline neighbours are moved to `hooks.json`. Codex
245
- * keys approval by source path, so that move is a User-owned `/hooks` review,
246
- * not a silent identity-preserving refresh. `[hooks.state]` is the trust store
247
- * rather than a hook definition, so it never counts as a representation and is
248
- * preserved through every write.
249
- */
250
- export declare function inspectCodexLayer(paths: CodexLayerPaths): CodexLayerInspection;
251
- /**
252
- * Serialize one Notifai transaction across both representations in a Codex
253
- * layer, then inspect that layer only after acquiring the shared anchor.
254
- */
255
- export declare function withCodexLayerTransaction<T>(paths: CodexLayerPaths, action: (inspection: CodexLayerInspection) => T): T;
256
- /** Every Machine-layer file this harness might already be reading hooks from. */
257
- export declare function machineHookFiles(harness: HookInstallableHarness, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string[];
258
- /**
259
- * The Machine layer with *Notifai* installed in both Codex representations.
260
- *
261
- * A layer that uses `hooks.json` and inline `[hooks]` at once is not by itself
262
- * a Notifai fault: Codex supports both, loads both, runs every matching
263
- * handler, and already prints its own "prefer a single representation" warning
264
- * at startup. Foreign handlers in the other file are the user's — often written
265
- * by another tool that manages that file — and repeating Codex's warning as a
266
- * Notifai failure demanded an edit to configuration Notifai does not own, for a
267
- * condition where every handler still fires exactly once.
268
- *
269
- * What is ours to diagnose is Notifai in both files. Then one event really does
270
- * send two Notification Requests per turn, and the copy outside the write
271
- * target keeps firing an older definition after the next install refreshes only
272
- * the other one. Uninstall strips Notifai from both files, so the remedy is
273
- * exact — and it never touches a foreign handler.
274
- */
275
- export declare function codexRepresentationProblems(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string[];
276
- /**
277
- * The Machine layer where Notifai and someone else each own one Codex
278
- * representation.
279
- *
280
- * This is not a fault and never fails a check. Codex loads `hooks.json` and
281
- * inline `[hooks]` together and runs every matching handler, so both sets fire
282
- * exactly once — but Codex also prints "prefer one representation per layer"
283
- * at startup, and a user who sees that warning deserves to know which file is
284
- * Notifai's, which is not, and that Notifai will not touch the one it does not
285
- * own. Saying nothing here is what made the warning look like Notifai's bug.
286
- */
287
- export declare function codexCoexistenceNotes(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string[];
288
- /**
289
- * What `CODEX_HOME` is doing to this shell, when it is doing anything.
290
- *
291
- * Codex replaces its whole home when the variable is set, so hooks installed
292
- * from a shell without it are simply absent here, and its trust store is keyed
293
- * by absolute file path — a config copied between homes arrives untrusted.
294
- * Both facts turn into "Notifai is not wired" reports that look like a bug in
295
- * the installer, so doctor names the home it actually inspected.
296
- */
297
- export declare function codexHomeNote(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): string | null;
298
- /**
299
- * Every supported harness this project or machine shows evidence of, in
300
- * declared order. Project markers come first, then machine installs that the
301
- * project did not already name.
302
- *
303
- * `AGENTS.md` still counts for nothing — see `localHarnessEvidence`.
304
- */
305
- export declare function detectedHarnesses(cwd: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): HookInstallableHarness[];
306
- /**
307
- * Which *single* harness to wire when a caller still needs exactly one, or
308
- * null when it is genuinely unclear.
309
- *
310
- * Project evidence decides, and machine evidence is consulted only when the
311
- * project offers none. Several markers are not a failure of detection — they
312
- * are several harnesses. `detectedHarnesses` is the default for install;
313
- * this helper stays for uninstall and any caller that cannot take a list.
314
- */
315
- export declare function detectHarness(cwd: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): HookInstallableHarness | null;
316
- export interface SettingsDocument {
317
- hooks?: HookConfig;
318
- [key: string]: unknown;
319
- }
320
- export declare function mergeCursorHooks(existing: CursorSettingsDocument, incoming: CursorHookConfig, scriptPath: string): {
321
- document: CursorSettingsDocument;
322
- added: string[];
323
- replaced: string[];
324
- removed: string[];
325
- };
326
- export declare function removeCursorHooks(existing: CursorSettingsDocument, scriptPath: string): {
327
- document: CursorSettingsDocument;
328
- added: string[];
329
- replaced: string[];
330
- removed: string[];
331
- };
332
- export interface MergeResult {
333
- document: SettingsDocument;
334
- added: string[];
335
- replaced: string[];
336
- /** Events an older build installed that this one no longer serves. */
337
- removed: string[];
338
- }
339
- /**
340
- * Refresh owned handlers in their existing slots. Codex's approval identity
341
- * includes group and handler indices, so stripping then appending an unchanged
342
- * handler can revoke its approval and stale an active session's Stop definition.
343
- * Missing handlers append after existing slots; foreign handlers and matcher
344
- * metadata stay in place.
345
- *
346
- * Retired handlers are considered in every event. Hosts without index-based
347
- * approval can remove them; strict Codex repair refuses ambiguous removal so
348
- * an explicit migration can account for native trust and active sessions.
349
- */
350
- export declare function mergeHooks(existing: SettingsDocument, incoming: HookConfig, scriptPath: string, options?: {
351
- preserveIdentities?: boolean;
352
- }): MergeResult;
353
- export declare function removeHooks(existing: SettingsDocument, scriptPath: string): MergeResult;
354
- /**
355
- * Writes the settings file the way a tool that does not own it should.
356
- *
357
- * Truncating in place lost the user's whole harness configuration if the write
358
- * failed halfway, and clobbered a concurrent editor's changes; following a
359
- * symlink wrote through to a target they never named. So: refuse
360
- * anything that is not a regular file, write a sibling temp file, fsync it, and
361
- * rename over the original — atomic within a directory on every platform we
362
- * support.
363
- */
364
- export declare function applyPlan(file: string, document: SettingsDocument | CursorSettingsDocument): void;
365
- /** Validate a proposed document before any file in a multi-file edit changes. */
366
- export declare function preparePlan(file: string, document: SettingsDocument | CursorSettingsDocument, previous?: string | null): () => void;
367
- /** Delete an emptied Codex hooks.json and a now-empty layer directory. */
368
- export declare function cleanupEmptiedCodexLayer(paths: CodexLayerPaths): void;
369
- export declare function loadSettings(file: string): SettingsDocument;
370
- export declare function isTomlSettingsPath(file: string): boolean;
371
- export declare function loadCursorSettings(file: string): CursorSettingsDocument;
372
- /** One of our handlers as it sits in a settings file, with its position. */
373
- export interface InstalledHandler {
374
- event: string;
375
- /** Index of the matcher group within the event, as the harness sees it. */
376
- groupIndex: number;
377
- /** Index of the handler within its group. */
378
- handlerIndex: number;
379
- command: string;
380
- /** Declared process lifetime, used to detect config/install drift. */
381
- timeout?: number;
382
- async?: boolean;
383
- asyncRewake?: boolean;
384
- statusMessage?: string;
385
- additionalContextLimit?: number;
386
- }
387
- export interface Installation {
388
- harness: HookInstallableHarness;
389
- file: string;
390
- handlers: InstalledHandler[];
391
- /** Structural defects that require reinstalling this generated adapter. */
392
- problems?: string[];
393
- }
394
- export declare function codexHookIdentityHash(handler: InstalledHandler): string;
395
- /** Best-effort mirror of current Codex's persisted key for one handler. */
396
- export declare function codexTrustKey(installation: Installation, handler: InstalledHandler): string;
397
- /**
398
- * Stable identity of the one Codex Stop definition an Agent Session loaded.
399
- *
400
- * Codex materializes hook handlers into the session runtime. A later config
401
- * change can therefore make the file on disk current while an older session
402
- * keeps executing the definition it loaded at activation. Include Codex's
403
- * source key as well as the normalized handler identity so moving an otherwise
404
- * byte-identical definition between project and global layers also requires a
405
- * fresh session.
406
- */
407
- export declare function codexStopDefinitionFingerprint(installations: Installation[]): string | undefined;
408
- /**
409
- * Trust defects that make installed Codex handlers look present while Codex
410
- * skips them. Trust is user-owned; the supported repair is Codex's `/hooks`
411
- * review UI, never writing the trust store on the user's behalf. Because the
412
- * persisted shape is not a public Codex contract, this diagnosis can drift;
413
- * `/hooks` remains the source of truth.
414
- */
415
- export declare function codexTrustProblems(installations: Installation[], env?: NodeJS.ProcessEnv): string[];
416
- /**
417
- * Trust defects in the handlers Question Routing runs. The Session Attendant
418
- * is presence, never a routing gate: an attend handler still awaiting
419
- * approval is reported by doctor and init and never refuses a question.
420
- */
421
- export declare function codexRoutingTrustProblems(installations: Installation[], env?: NodeJS.ProcessEnv): string[];
422
- export declare function notifaiNativePluginEnablementKeys(value: unknown): string[];
423
- export declare function stripObsoleteNotifaiPluginEnablement(document: SettingsDocument): {
424
- document: SettingsDocument;
425
- removed: string[];
426
- };
427
- /**
428
- * Remove enabled Notifai plugin tables only after lexical ownership and full
429
- * semantic preservation are proven. Unsupported dotted/inline definitions
430
- * fail before mutation, rather than silently leaving a second firing path.
431
- */
432
- export declare function spliceOutNotifaiPluginTables(source: string): {
433
- next: string;
434
- removed: string[];
435
- };
436
- export interface ObsoleteNativePluginWiring {
437
- harness: 'claude-code' | 'codex';
438
- file: string;
439
- keys: string[];
440
- }
441
- /**
442
- * Leftover native plugin enablement that would fire beside document hooks.
443
- *
444
- * Reads only harness settings files this installer already owns inspecting.
445
- * It never shells out to a plugin CLI and never writes a plugin.
446
- */
447
- export declare function findObsoleteNotifaiPluginWiring(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform | HookHostPlatform): ObsoleteNativePluginWiring[];
448
- /**
449
- * Plan native plugin retirement without changing configuration. The caller
450
- * validates every destination before applying this plan under the layer lock.
451
- */
452
- export declare function prepareCodexPluginCleanup(file: string): {
453
- source: string | null;
454
- removed: string[];
455
- apply: () => void;
456
- };
457
- /**
458
- * The one Machine installation each harness would read a Notifai handler from.
459
- */
460
- export declare function findInstallations(env?: NodeJS.ProcessEnv, adapterHome?: string, platform?: NodeJS.Platform | HookHostPlatform): Installation[];
461
- /**
462
- * Notifai handlers a previous build left in Project-scoped files.
463
- *
464
- * These are never an install target and never a fallback: they are residue to
465
- * report and remove once the Machine installation is proven current. Foreign
466
- * handlers sharing those files are not returned and are never touched.
467
- */
468
- export declare function findLegacyProjectInstallations(cwd: string, env?: NodeJS.ProcessEnv, adapterHome?: string, platform?: NodeJS.Platform | HookHostPlatform): Installation[];
469
- /** The hook event a handler's command actually invokes, e.g. `stop`. */
470
- export declare function handlerEvent(command: string): string | null;