@raidiant/notifai 11.7.1-beta.2 → 12.0.0-beta.5

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 +56 -4
  2. package/NOTICE +16 -0
  3. package/THIRD_PARTY_NOTICES +725 -0
  4. package/bin/notifai.mjs +11387 -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
package/dist/ui/theme.js DELETED
@@ -1,244 +0,0 @@
1
- /**
2
- * One visual language for every human-facing surface: help, `config show`,
3
- * `doctor`, and the interactive app.
4
- *
5
- * Two rules hold everything here together.
6
- *
7
- * Colour is decoration, never information. Every state that colour marks also
8
- * carries a glyph and a word, because the output is read through pipes, on
9
- * monochrome terminals, by screen readers, and by people who cannot separate
10
- * red from green. `picocolors` resolves to identity functions when stdout is
11
- * not a TTY or `NO_COLOR` is set, so the plain path is the same code, not a
12
- * second implementation that can drift.
13
- *
14
- * And an agent's bytes are not ours to restyle. Machine-readable output
15
- * (`--json`) never routes through this module, and every non-TTY invocation
16
- * lands on the uncoloured branch by construction.
17
- */
18
- import pc from 'picocolors';
19
- /** True when the terminal can render the box-drawing and status glyphs below. */
20
- export const unicode = process.platform !== 'win32' ||
21
- process.env['WT_SESSION'] !== undefined ||
22
- process.env['TERM_PROGRAM'] === 'vscode' ||
23
- process.env['ConEmuTask'] === '{cmd::Cmder}';
24
- /** True when 24-bit colour is available, which the banner gradient needs. */
25
- function supportsTrueColor(env = process.env) {
26
- if (!pc.isColorSupported)
27
- return false;
28
- const colorterm = env['COLORTERM'] ?? '';
29
- if (/^(truecolor|24bit)$/i.test(colorterm))
30
- return true;
31
- return env['TERM_PROGRAM'] === 'iTerm.app' || env['TERM_PROGRAM'] === 'vscode';
32
- }
33
- /**
34
- * Brand ramp, shared with the companion app icon: pink → coral → rose →
35
- * magenta. Used for the wordmark and for accenting the surfaces a human sees.
36
- */
37
- export const BRAND_RAMP = ['#FF9EC0', '#FF816B', '#EC5A73', '#B84E93'];
38
- function hexToRgb(hex) {
39
- const value = Number.parseInt(hex.slice(1), 16);
40
- return { r: (value >> 16) & 255, g: (value >> 8) & 255, b: value & 255 };
41
- }
42
- function mix(a, b, t) {
43
- return {
44
- r: Math.round(a.r + (b.r - a.r) * t),
45
- g: Math.round(a.g + (b.g - a.g) * t),
46
- b: Math.round(a.b + (b.b - a.b) * t),
47
- };
48
- }
49
- /**
50
- * Sample the brand ramp at `t` in [0, 1]. Multi-stop so the gradient keeps the
51
- * icon's coral midtones instead of washing straight from pink to magenta.
52
- */
53
- function rampAt(t, ramp = BRAND_RAMP) {
54
- const clamped = Math.min(1, Math.max(0, t));
55
- const span = ramp.length - 1;
56
- const scaled = clamped * span;
57
- const index = Math.min(span - 1, Math.floor(scaled));
58
- const { r, g, b } = mix(hexToRgb(ramp[index]), hexToRgb(ramp[index + 1]), scaled - index);
59
- return `[38;2;${r};${g};${b}m`;
60
- }
61
- const RESET = '';
62
- /**
63
- * SGR escape sequences, in the three shapes the helpers below need: stripping
64
- * them to measure, splitting around them to slice, and recognising one on its
65
- * own. Kept together so a change to what counts as an escape lands once.
66
- */
67
- const ANSI_GLOBAL = /\[[0-9;]*m/g;
68
- const ANSI_SPLIT = /(\[[0-9;]*m)/;
69
- const ANSI_ONLY = /^\[[0-9;]*m$/;
70
- /**
71
- * Paint each line of a block so the gradient runs left-to-right across the
72
- * whole block rather than restarting per line. The wordmark is one image, and
73
- * per-line gradients make it read as several.
74
- */
75
- export function gradientBlock(lines, ramp = BRAND_RAMP) {
76
- if (!pc.isColorSupported)
77
- return [...lines];
78
- const width = Math.max(1, ...lines.map((line) => [...line].length));
79
- if (!supportsTrueColor())
80
- return lines.map((line) => pc.magenta(line));
81
- return lines.map((line) => [...line]
82
- .map((char, i) => (char === ' ' ? char : `${rampAt(i / Math.max(1, width - 1), ramp)}${char}`))
83
- .join('') + RESET);
84
- }
85
- // ---------------------------------------------------------------------------
86
- // Semantic styles
87
- // ---------------------------------------------------------------------------
88
- export const style = {
89
- /** A heading that opens a section. */
90
- heading: (text) => pc.bold(text),
91
- /** The brand voice — command names, the product name, the selected thing. */
92
- accent: (text) => pc.magenta(text),
93
- /** Secondary text: hints, provenance, units, defaults. */
94
- dim: (text) => pc.dim(text),
95
- /** Something the reader can type. */
96
- code: (text) => pc.cyan(text),
97
- ok: (text) => pc.green(text),
98
- warn: (text) => pc.yellow(text),
99
- bad: (text) => pc.red(text),
100
- /** A value as it currently stands. */
101
- value: (text) => pc.bold(pc.white(text)),
102
- /** A value that is not set, or is inherited rather than chosen. */
103
- unset: (text) => pc.dim(pc.italic(text)),
104
- };
105
- /**
106
- * Status marks. The glyph and the colour say the same thing twice on purpose;
107
- * either alone is enough to read the line.
108
- */
109
- export const glyph = {
110
- ok: unicode ? '●' : '*',
111
- warn: unicode ? '▲' : '!',
112
- bad: unicode ? '✕' : 'x',
113
- pending: unicode ? '○' : 'o',
114
- bullet: unicode ? '•' : '-',
115
- arrow: unicode ? '→' : '->',
116
- chevron: unicode ? '›' : '>',
117
- bar: unicode ? '│' : '|',
118
- };
119
- /** A coloured glyph for a tone; the caller supplies the words. */
120
- export function mark(tone) {
121
- switch (tone) {
122
- case 'ok':
123
- return style.ok(glyph.ok);
124
- case 'warn':
125
- return style.warn(glyph.warn);
126
- case 'bad':
127
- return style.bad(glyph.bad);
128
- case 'pending':
129
- return style.dim(glyph.pending);
130
- }
131
- }
132
- /** Visible width, ignoring ANSI escapes, for alignment maths. */
133
- export function width(text) {
134
- return [...text.replace(ANSI_GLOBAL, '')].length;
135
- }
136
- /** Pad to `size` using visible width, so colour never breaks a column. */
137
- export function pad(text, size) {
138
- return text + ' '.repeat(Math.max(0, size - width(text)));
139
- }
140
- /**
141
- * Usable terminal width: the real one, capped so paragraphs do not run to 200
142
- * characters on a maximised window.
143
- *
144
- * No lower clamp. Raising a narrow terminal to a comfortable minimum sounds
145
- * harmless and is not — every box drawn to that invented width overflows the
146
- * real one and wraps, which looks far worse than a cramped box that fits.
147
- */
148
- export function terminalWidth(fallback = 80) {
149
- const columns = process.stdout.columns;
150
- if (typeof columns !== 'number' || columns <= 0)
151
- return fallback;
152
- return Math.min(100, columns);
153
- }
154
- /**
155
- * A titled box around `rows`.
156
- *
157
- * Hand-drawn rather than delegated, because the obvious library call sizes
158
- * itself from `process.stdout.columns` and divides by it — a pty that reports
159
- * zero columns (some CI runners, some `script` invocations) makes the padding
160
- * negative and throws, taking the whole screen down with it. A status card is
161
- * decoration; it may degrade, but it must never be what crashes the app.
162
- *
163
- * Rows are measured with `width`, so colour inside them does not skew the
164
- * border, and anything too wide for the terminal is clipped rather than
165
- * wrapped — a status line that wraps stops being a status line.
166
- */
167
- export function card(title, rows, columns = terminalWidth()) {
168
- const [tl, tr, bl, br, h, v] = unicode
169
- ? ['╭', '╮', '╰', '╯', '─', '│']
170
- : ['+', '+', '+', '+', '-', '|'];
171
- const inner = Math.max(20, columns - 4);
172
- const content = rows.map((row) => (width(row) > inner ? clip(row, inner) : row));
173
- const bodyWidth = Math.max(width(title) + 4, ...content.map((row) => width(row)));
174
- const boxWidth = Math.min(inner, bodyWidth);
175
- const heading = `${h} ${style.heading(title)} `;
176
- const lines = [];
177
- lines.push(style.dim(tl) + heading + style.dim(h.repeat(Math.max(0, boxWidth - width(heading) + 2))) + style.dim(tr));
178
- for (const row of content) {
179
- lines.push(`${style.dim(v)} ${pad(row, boxWidth)} ${style.dim(v)}`);
180
- }
181
- lines.push(style.dim(bl + h.repeat(boxWidth + 2) + br));
182
- return lines;
183
- }
184
- /**
185
- * Truncate to a visible width, carrying escape sequences through untouched.
186
- *
187
- * Counting only printable characters is the whole point: slicing a coloured
188
- * string by `String.length` cuts through an escape sequence and spills raw
189
- * `[38;2` into the terminal.
190
- */
191
- export function clip(text, limit) {
192
- if (width(text) <= limit)
193
- return text;
194
- const parts = text.split(ANSI_SPLIT);
195
- let out = '';
196
- let visible = 0;
197
- for (const part of parts) {
198
- if (part === undefined || part === '')
199
- continue;
200
- if (ANSI_ONLY.test(part)) {
201
- out += part;
202
- continue;
203
- }
204
- for (const char of part) {
205
- if (visible >= limit - 1)
206
- return `${out}\u2026${RESET}`;
207
- out += char;
208
- visible += 1;
209
- }
210
- }
211
- return `${out}${RESET}`;
212
- }
213
- /**
214
- * Wrap `text` to `columns`, returning bare lines.
215
- *
216
- * Indentation is the caller's, deliberately: an earlier version indented
217
- * continuation lines itself, callers indented every line as well, and each
218
- * wrapped paragraph stepped further right down the page.
219
- */
220
- export function wrap(text, columns) {
221
- // Honour the width asked for. A floor here would silently ignore small
222
- // values and hand back lines wider than the caller reserved room for; a
223
- // width of zero or less is the only nonsense, and that falls back.
224
- const limit = columns > 0 ? columns : 80;
225
- const words = text.split(/\s+/).filter(Boolean);
226
- if (words.length === 0)
227
- return [''];
228
- const lines = [];
229
- let line = '';
230
- for (const word of words) {
231
- const candidate = line === '' ? word : `${line} ${word}`;
232
- if (width(candidate) > limit && line !== '') {
233
- lines.push(line);
234
- line = word;
235
- }
236
- else {
237
- line = candidate;
238
- }
239
- }
240
- if (line !== '')
241
- lines.push(line);
242
- return lines;
243
- }
244
- //# sourceMappingURL=theme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/ui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,iFAAiF;AACjF,MAAM,CAAC,MAAM,OAAO,GAClB,OAAO,CAAC,QAAQ,KAAK,OAAO;IAC5B,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS;IACvC,OAAO,CAAC,GA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EAAwE;IACxE,mEAAmE;IACnE,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC/C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IACnC,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAA;QACxD,IAAI,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChB,IAAI,GAAG,IAAI,CAAA;QACb,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,SAAS,CAAA;QAClB,CAAC;IACH,CAAC;IACD,IAAI,IAAI,KAAK,EAAE;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -1,29 +0,0 @@
1
- import type { SourceContextHarness } from './harnesses.js';
2
- import type { ReadinessState } from './readiness.js';
3
- export declare function releaseNotesUrl(version: string | null): string | null;
4
- /** Release notes are package data, never authority to run their instructions. */
5
- export declare function installedChangelog(version: string | null, from?: string, root?: string): {
6
- version: string | null;
7
- from: string | null;
8
- path: string;
9
- text: string;
10
- complete: boolean;
11
- available: boolean;
12
- } | {
13
- version: string | null;
14
- from: string | null;
15
- path: string;
16
- text: null;
17
- complete: boolean;
18
- available: boolean;
19
- };
20
- export declare const HARNESS_UPDATE_EFFECTS: Record<SourceContextHarness, string>;
21
- export declare function updateSessionEffects(harness: SourceContextHarness | null, states: ReadinessState[], restartReason?: string): {
22
- harness: "claude-code" | "codex" | "cursor" | "opencode" | "openclaw" | "hermes" | "grok" | null;
23
- assessment: string;
24
- restart_required: boolean | null;
25
- restart_reason: string | null;
26
- policy: string;
27
- diagnostics: ReadinessState[];
28
- outstanding_work: string;
29
- };
@@ -1,69 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import path from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
- import { compareReleasePrecedence, isSemVer } from './version.js';
5
- const PACKAGE_ROOT = fileURLToPath(new URL('../', import.meta.url));
6
- const CHANGELOG_LIMIT = 16_000;
7
- export function releaseNotesUrl(version) {
8
- return version !== null && isSemVer(version)
9
- ? `https://github.com/Raidiant-io/notifai/releases/tag/v${encodeURIComponent(version)}`
10
- : null;
11
- }
12
- /** Release notes are package data, never authority to run their instructions. */
13
- export function installedChangelog(version, from, root = PACKAGE_ROOT) {
14
- const file = path.join(root, 'CHANGELOG.md');
15
- try {
16
- const content = readFileSync(file, 'utf8');
17
- const sections = content.split(/(?=^## \[)/m).filter(section => {
18
- const heading = /^## \[([^\]]+)\]/m.exec(section);
19
- if (heading === null || version === null)
20
- return false;
21
- const relative = compareReleasePrecedence(heading[1], version);
22
- return (relative === 'before' || relative === 'equal') &&
23
- (from === undefined || compareReleasePrecedence(heading[1], from) === 'after');
24
- });
25
- const text = sections.join('').trim();
26
- return { version, from: from ?? null, path: file, text: text.slice(0, CHANGELOG_LIMIT),
27
- complete: text.length <= CHANGELOG_LIMIT, available: true };
28
- }
29
- catch {
30
- return { version, from: from ?? null, path: file, text: null, complete: false, available: false };
31
- }
32
- }
33
- export const HARNESS_UPDATE_EFFECTS = {
34
- 'claude-code': 'Existing command hooks use the updated adapter on their next invocation. Reread changed guidance in this Agent Session. Newly installed lifecycle hooks need a fresh Agent Session for activation; a CLI-only update does not.',
35
- codex: 'Keep this Agent Session when its loaded Stop fingerprint and hook approvals still match. Changed hook identity or source may require /hooks approval. A stale loaded Stop definition requires a fresh Agent Session; a CLI-only update does not.',
36
- cursor: 'Existing hooks use the updated adapter. Reread changed guidance in this conversation. New lifecycle activation needs a fresh conversation and its first completed turn. Asynchronous ask remains unsupported.',
37
- opencode: 'The loaded plugin invokes the updated adapter on later events and refreshes guidance per model request. Restart OpenCode only if the generated plugin changed or lifecycle activation is missing; a CLI-only update does not require it.',
38
- openclaw: 'The Gateway plugin invokes the updated adapter and refreshes guidance before model prompts. Restart the Gateway only if the generated plugin changed or lifecycle activation is missing; a CLI-only update does not require it.',
39
- hermes: 'Use the updated CLI and reread changed guidance in the current local classic CLI Agent Session. Refresh the managed Hermes plugin with `notifai hooks install --harness hermes`, then start a fresh classic CLI Agent Session for its current prompt and Question Routing attendant.',
40
- grok: 'Existing native Grok hooks use the updated adapter on their next invocation. Reread changed guidance in this Agent Session. Hook output does not activate Notifai context; load the Notifai skill directly. A newly installed Stop definition needs a fresh Agent Session.',
41
- };
42
- export function updateSessionEffects(harness, states, restartReason) {
43
- // Unsupported asynchronous routing is a capability limit, not damage caused
44
- // by updating. Keep that information without prescribing reinstall loops.
45
- const blockingOnly = harness !== null && ['cursor', 'opencode', 'openclaw', 'hermes'].includes(harness);
46
- const diagnostics = states.filter(state => state.id.startsWith('hooks') || state.id === 'skill').map(state => {
47
- if (!blockingOnly || !['hooks-question-admission', 'hooks-answer-continuation'].includes(state.id))
48
- return state;
49
- const informational = { ...state, status: 'optional-gap' };
50
- delete informational.remedy;
51
- return informational;
52
- });
53
- const gaps = diagnostics.filter(state => state.status === 'gap' || state.status === 'unknown' ||
54
- (['hooks-active-session', 'hooks-fired', 'hooks-native-activity'].includes(state.id) && state.status !== 'ready'));
55
- const currentNativeProofMissing = harness === 'codex' &&
56
- !diagnostics.some(state => state.id === 'hooks-native-activity' && state.status === 'ready');
57
- const inspected = harness === 'hermes' || diagnostics.some(state => state.id === 'hooks');
58
- return {
59
- harness,
60
- assessment: restartReason !== undefined ? 'fresh_session' : harness === null ? 'unknown' : gaps.length > 0 ? 'needs_attention' : !inspected || currentNativeProofMissing ? 'unknown' : 'continue',
61
- // A diagnosis requiring repair is not itself proof that a restart is needed.
62
- restart_required: restartReason !== undefined ? true : harness === 'hermes' || (harness !== null && inspected && gaps.length === 0 && !currentNativeProofMissing) ? false : null,
63
- restart_reason: restartReason ?? null,
64
- policy: harness === null ? 'No unambiguous active harness was identified. Do not infer a restart requirement.' : HARNESS_UPDATE_EFFECTS[harness],
65
- diagnostics,
66
- outstanding_work: 'Before changing hooks or ending an Agent Session, finish outstanding questions and Agent Acknowledgements. Preserve their IDs and existing waiters. Ending a session can withdraw or retire its questions. npm updates files in place; do not promise uninterrupted hook execution during installation.',
67
- };
68
- }
69
- //# sourceMappingURL=update-handoff.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-handoff.js","sourceRoot":"","sources":["../src/update-handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAIjE,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AACnE,MAAM,eAAe,GAAG,MAAM,CAAA;AAE9B,MAAM,UAAU,eAAe,CAAC,OAAsB;IACpD,OAAO,OAAO,KAAK,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC;QAC1C,CAAC,CAAC,wDAAwD,kBAAkB,CAAC,OAAO,CAAC,EAAE;QACvF,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,kBAAkB,CAAC,OAAsB,EAAE,IAAa,EAAE,IAAI,GAA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y: which network destinations this CLI will touch on
3
- * input it did not author. `docs/TRUST.md` is the written policy; this module
4
- * is its enforcement, and the two must change together.
5
- *
6
- * The threat is not a hostile user — it is hostile *input* reaching a
7
- * trusted user's CLI: a cloned repository, a compromised server response, or
8
- * an agent following text it found in a working tree. Every rule here is
9
- * therefore fail-closed, and every escape hatch resolves only from
10
- * configuration layers the User owns — never from a repository.
11
- */
12
- /** The one dashboard origin the shipped service uses for pairing approval. */
13
- export declare const CANONICAL_DASHBOARD_ORIGIN = "https://app.notifai.sh";
14
- /** Redirect hops a remote image fetch may follow, each re-validated. */
15
- export declare const MEDIA_REDIRECT_LIMIT = 3;
16
- /** One address attempt must not hold an agent command indefinitely. */
17
- export declare const MEDIA_FETCH_TIMEOUT_MS = 15000;
18
- export type UrlRefusal = {
19
- ok: false;
20
- reason: string;
21
- };
22
- /**
23
- * Normalize one configured origin entry to `scheme://host[:port]`, or null
24
- * when the entry is not a bare http(s) origin. Paths, queries, fragments, and
25
- * userinfo are rejected rather than stripped: a config entry that carries
26
- * them says the author expected them to matter, and silently ignoring parts
27
- * of a trust rule is how allowlists rot.
28
- */
29
- export declare function normalizeOrigin(entry: string): string | null;
30
- /** Whether one IP literal is publicly routable. */
31
- export declare function isPublicAddress(address: string): boolean;
32
- export declare function isLoopbackHostname(hostname: string): boolean;
33
- export interface MediaUrlPolicy {
34
- /**
35
- * Extra origins remote media may use beyond public HTTPS — the self-host
36
- * and intranet escape hatch. Entries are normalized origins from
37
- * User-owned configuration (`media_origins`); a repository cannot supply
38
- * them.
39
- */
40
- allowOrigins: readonly string[];
41
- /** Test seam; production resolves with the system resolver. */
42
- lookup?: (hostname: string) => Promise<string[]>;
43
- }
44
- type MediaUrlApproval = {
45
- ok: true;
46
- addresses: readonly string[];
47
- };
48
- /**
49
- * Whether one URL is a destination remote media may be fetched from.
50
- *
51
- * Default policy: `https` to a host every resolved address of which is
52
- * publicly routable. A User-allowed origin skips the scheme and address
53
- * checks — the User said that exact origin is theirs to trust — but nothing
54
- * skips the userinfo refusal, and every redirect hop is checked again.
55
- *
56
- * The approved addresses come back with the verdict rather than being
57
- * rediscovered later: `fetchMediaUrl` connects to one of exactly these, so a
58
- * resolver that would answer differently on a second lookup cannot rebind the
59
- * request onto a private address between the check and the connection.
60
- */
61
- export declare function checkMediaUrl(target: URL, policy: MediaUrlPolicy): Promise<MediaUrlApproval | UrlRefusal>;
62
- /**
63
- * Fetch a remote image under the media URL policy, following at most
64
- * `MEDIA_REDIRECT_LIMIT` redirects and re-validating every hop — a public
65
- * HTTPS URL redirecting into an intranet is the exact attack the per-hop
66
- * check exists for.
67
- */
68
- export declare function fetchMediaUrl(source: string, policy: MediaUrlPolicy, fetchImpl?: typeof fetch): Promise<{
69
- ok: true;
70
- response: Response;
71
- } | UrlRefusal>;
72
- /**
73
- * Whether a server-supplied pairing approval URL may be shown and opened.
74
- *
75
- * The server chooses `approve_url`, so a compromised or misconfigured one
76
- * must not be able to drive this machine's browser to an arbitrary
77
- * destination. Allowed: the canonical dashboard, the exact origin the user
78
- * pointed this pairing at, loopback for local development, and origins the
79
- * User allowed (`approve_origins`) for a self-host whose dashboard lives on
80
- * a different origin than its API.
81
- */
82
- export declare function checkApproveUrl(raw: string, baseUrl: string, allowOrigins: readonly string[]): {
83
- ok: true;
84
- } | UrlRefusal;
85
- export {};