@withbuddi/buddi 0.1.0-pre.29 → 0.1.0-pre.31

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 (696) hide show
  1. package/README.md +58 -368
  2. package/extension/manifest.json +2 -2
  3. package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
  4. package/node_modules/@buddi/cli/dist/args.d.ts +6 -1
  5. package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
  6. package/node_modules/@buddi/cli/dist/args.js +7 -2
  7. package/node_modules/@buddi/cli/dist/args.js.map +1 -1
  8. package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
  9. package/node_modules/@buddi/cli/dist/commands.js +14 -4
  10. package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
  11. package/node_modules/@buddi/cli/dist/doctor-probes.d.ts.map +1 -1
  12. package/node_modules/@buddi/cli/dist/doctor-probes.js +6 -12
  13. package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
  14. package/node_modules/@buddi/cli/dist/doctor.d.ts +16 -0
  15. package/node_modules/@buddi/cli/dist/doctor.d.ts.map +1 -1
  16. package/node_modules/@buddi/cli/dist/doctor.js +30 -0
  17. package/node_modules/@buddi/cli/dist/doctor.js.map +1 -1
  18. package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts +4 -0
  19. package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts.map +1 -1
  20. package/node_modules/@buddi/cli/dist/jobs-cmd.js +53 -4
  21. package/node_modules/@buddi/cli/dist/jobs-cmd.js.map +1 -1
  22. package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
  23. package/node_modules/@buddi/cli/dist/main.js +27 -9
  24. package/node_modules/@buddi/cli/dist/main.js.map +1 -1
  25. package/node_modules/@buddi/cli/dist/mcp/tools.d.ts.map +1 -1
  26. package/node_modules/@buddi/cli/dist/mcp/tools.js +3 -1
  27. package/node_modules/@buddi/cli/dist/mcp/tools.js.map +1 -1
  28. package/node_modules/@buddi/cli/dist/status.d.ts +15 -9
  29. package/node_modules/@buddi/cli/dist/status.d.ts.map +1 -1
  30. package/node_modules/@buddi/cli/dist/status.js +6 -11
  31. package/node_modules/@buddi/cli/dist/status.js.map +1 -1
  32. package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
  33. package/node_modules/@buddi/core/dist/actions/store.d.ts +8 -0
  34. package/node_modules/@buddi/core/dist/actions/store.d.ts.map +1 -1
  35. package/node_modules/@buddi/core/dist/actions/store.js +13 -0
  36. package/node_modules/@buddi/core/dist/actions/store.js.map +1 -1
  37. package/node_modules/@buddi/core/dist/clock-widget.d.ts.map +1 -1
  38. package/node_modules/@buddi/core/dist/clock-widget.js +5 -3
  39. package/node_modules/@buddi/core/dist/clock-widget.js.map +1 -1
  40. package/node_modules/@buddi/core/dist/host/build.d.ts.map +1 -1
  41. package/node_modules/@buddi/core/dist/host/build.js +11 -0
  42. package/node_modules/@buddi/core/dist/host/build.js.map +1 -1
  43. package/node_modules/@buddi/core/dist/host/types.d.ts +7 -0
  44. package/node_modules/@buddi/core/dist/host/types.d.ts.map +1 -1
  45. package/node_modules/@buddi/core/dist/learning/store.d.ts +7 -0
  46. package/node_modules/@buddi/core/dist/learning/store.d.ts.map +1 -1
  47. package/node_modules/@buddi/core/dist/learning/store.js +6 -0
  48. package/node_modules/@buddi/core/dist/learning/store.js.map +1 -1
  49. package/node_modules/@buddi/core/dist/lock.d.ts +8 -2
  50. package/node_modules/@buddi/core/dist/lock.d.ts.map +1 -1
  51. package/node_modules/@buddi/core/dist/lock.js +20 -5
  52. package/node_modules/@buddi/core/dist/lock.js.map +1 -1
  53. package/node_modules/@buddi/core/dist/notifications/agent.d.ts +7 -0
  54. package/node_modules/@buddi/core/dist/notifications/agent.d.ts.map +1 -1
  55. package/node_modules/@buddi/core/dist/notifications/agent.js +2 -0
  56. package/node_modules/@buddi/core/dist/notifications/agent.js.map +1 -1
  57. package/node_modules/@buddi/core/dist/notifications/index.d.ts +1 -0
  58. package/node_modules/@buddi/core/dist/notifications/index.d.ts.map +1 -1
  59. package/node_modules/@buddi/core/dist/notifications/index.js +1 -0
  60. package/node_modules/@buddi/core/dist/notifications/index.js.map +1 -1
  61. package/node_modules/@buddi/core/dist/notifications/needs.d.ts +49 -0
  62. package/node_modules/@buddi/core/dist/notifications/needs.d.ts.map +1 -0
  63. package/node_modules/@buddi/core/dist/notifications/needs.js +41 -0
  64. package/node_modules/@buddi/core/dist/notifications/needs.js.map +1 -0
  65. package/node_modules/@buddi/core/dist/notifications/notify.d.ts.map +1 -1
  66. package/node_modules/@buddi/core/dist/notifications/notify.js +16 -7
  67. package/node_modules/@buddi/core/dist/notifications/notify.js.map +1 -1
  68. package/node_modules/@buddi/core/dist/notifications/store.d.ts.map +1 -1
  69. package/node_modules/@buddi/core/dist/notifications/store.js +2 -1
  70. package/node_modules/@buddi/core/dist/notifications/store.js.map +1 -1
  71. package/node_modules/@buddi/core/dist/notifications/types.d.ts +10 -0
  72. package/node_modules/@buddi/core/dist/notifications/types.d.ts.map +1 -1
  73. package/node_modules/@buddi/core/dist/notifications/types.js.map +1 -1
  74. package/node_modules/@buddi/core/dist/owner-timezone.d.ts +20 -22
  75. package/node_modules/@buddi/core/dist/owner-timezone.d.ts.map +1 -1
  76. package/node_modules/@buddi/core/dist/owner-timezone.js +17 -25
  77. package/node_modules/@buddi/core/dist/owner-timezone.js.map +1 -1
  78. package/node_modules/@buddi/core/dist/pages.d.ts +3 -1
  79. package/node_modules/@buddi/core/dist/pages.d.ts.map +1 -1
  80. package/node_modules/@buddi/core/dist/pages.js +6 -1
  81. package/node_modules/@buddi/core/dist/pages.js.map +1 -1
  82. package/node_modules/@buddi/core/dist/plugin/index.d.ts +1 -1
  83. package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
  84. package/node_modules/@buddi/core/dist/plugin/index.js.map +1 -1
  85. package/node_modules/@buddi/core/dist/plugin/version.d.ts +1 -1
  86. package/node_modules/@buddi/core/dist/plugin/version.js +1 -1
  87. package/node_modules/@buddi/core/dist/queue/failures.d.ts +84 -0
  88. package/node_modules/@buddi/core/dist/queue/failures.d.ts.map +1 -0
  89. package/node_modules/@buddi/core/dist/queue/failures.js +195 -0
  90. package/node_modules/@buddi/core/dist/queue/failures.js.map +1 -0
  91. package/node_modules/@buddi/core/dist/queue/index.d.ts +1 -0
  92. package/node_modules/@buddi/core/dist/queue/index.d.ts.map +1 -1
  93. package/node_modules/@buddi/core/dist/queue/index.js +1 -0
  94. package/node_modules/@buddi/core/dist/queue/index.js.map +1 -1
  95. package/node_modules/@buddi/core/dist/queue/jobs.d.ts +39 -3
  96. package/node_modules/@buddi/core/dist/queue/jobs.d.ts.map +1 -1
  97. package/node_modules/@buddi/core/dist/queue/jobs.js +54 -4
  98. package/node_modules/@buddi/core/dist/queue/jobs.js.map +1 -1
  99. package/node_modules/@buddi/core/dist/queue/types.d.ts +20 -0
  100. package/node_modules/@buddi/core/dist/queue/types.d.ts.map +1 -1
  101. package/node_modules/@buddi/core/dist/queue/types.js +17 -0
  102. package/node_modules/@buddi/core/dist/queue/types.js.map +1 -1
  103. package/node_modules/@buddi/core/dist/scheduler/missions.d.ts +39 -10
  104. package/node_modules/@buddi/core/dist/scheduler/missions.d.ts.map +1 -1
  105. package/node_modules/@buddi/core/dist/scheduler/missions.js +44 -17
  106. package/node_modules/@buddi/core/dist/scheduler/missions.js.map +1 -1
  107. package/node_modules/@buddi/core/dist/scheduler/types.d.ts +7 -0
  108. package/node_modules/@buddi/core/dist/scheduler/types.d.ts.map +1 -1
  109. package/node_modules/@buddi/core/dist/scheduler/types.js +1 -0
  110. package/node_modules/@buddi/core/dist/scheduler/types.js.map +1 -1
  111. package/node_modules/@buddi/core/dist/secrets/settings.d.ts.map +1 -1
  112. package/node_modules/@buddi/core/dist/secrets/settings.js +23 -3
  113. package/node_modules/@buddi/core/dist/secrets/settings.js.map +1 -1
  114. package/node_modules/@buddi/core/dist/sentinels/digest.d.ts +8 -1
  115. package/node_modules/@buddi/core/dist/sentinels/digest.d.ts.map +1 -1
  116. package/node_modules/@buddi/core/dist/sentinels/digest.js +10 -3
  117. package/node_modules/@buddi/core/dist/sentinels/digest.js.map +1 -1
  118. package/node_modules/@buddi/core/dist/sentinels/index.d.ts +1 -0
  119. package/node_modules/@buddi/core/dist/sentinels/index.d.ts.map +1 -1
  120. package/node_modules/@buddi/core/dist/sentinels/index.js +1 -0
  121. package/node_modules/@buddi/core/dist/sentinels/index.js.map +1 -1
  122. package/node_modules/@buddi/core/dist/sentinels/mutes.d.ts +51 -0
  123. package/node_modules/@buddi/core/dist/sentinels/mutes.d.ts.map +1 -0
  124. package/node_modules/@buddi/core/dist/sentinels/mutes.js +86 -0
  125. package/node_modules/@buddi/core/dist/sentinels/mutes.js.map +1 -0
  126. package/node_modules/@buddi/core/dist/sentinels/run.d.ts +14 -4
  127. package/node_modules/@buddi/core/dist/sentinels/run.d.ts.map +1 -1
  128. package/node_modules/@buddi/core/dist/sentinels/run.js +64 -20
  129. package/node_modules/@buddi/core/dist/sentinels/run.js.map +1 -1
  130. package/node_modules/@buddi/core/dist/sentinels/types.d.ts +152 -2
  131. package/node_modules/@buddi/core/dist/sentinels/types.d.ts.map +1 -1
  132. package/node_modules/@buddi/core/dist/sentinels/types.js +126 -2
  133. package/node_modules/@buddi/core/dist/sentinels/types.js.map +1 -1
  134. package/node_modules/@buddi/core/dist/views.d.ts +112 -112
  135. package/node_modules/@buddi/core/dist/views.d.ts.map +1 -1
  136. package/node_modules/@buddi/core/dist/views.js +2 -0
  137. package/node_modules/@buddi/core/dist/views.js.map +1 -1
  138. package/node_modules/@buddi/core/dist/web-settings.d.ts +13 -0
  139. package/node_modules/@buddi/core/dist/web-settings.d.ts.map +1 -1
  140. package/node_modules/@buddi/core/dist/web-settings.js +26 -0
  141. package/node_modules/@buddi/core/dist/web-settings.js.map +1 -1
  142. package/node_modules/@buddi/core/dist/widgets.d.ts +13 -5
  143. package/node_modules/@buddi/core/dist/widgets.d.ts.map +1 -1
  144. package/node_modules/@buddi/core/dist/widgets.js +10 -1
  145. package/node_modules/@buddi/core/dist/widgets.js.map +1 -1
  146. package/node_modules/@buddi/core/migrations/066_alert_decisions.sql +45 -0
  147. package/node_modules/@buddi/core/migrations/067_job_acknowledged.sql +21 -0
  148. package/node_modules/@buddi/core/migrations/068_notification_action.sql +12 -0
  149. package/node_modules/@buddi/core/migrations/069_schedule_zone_explicit.sql +18 -0
  150. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  151. package/node_modules/@buddi/gateway/dist/agents/learning-digest.d.ts +29 -7
  152. package/node_modules/@buddi/gateway/dist/agents/learning-digest.d.ts.map +1 -1
  153. package/node_modules/@buddi/gateway/dist/agents/learning-digest.js +87 -38
  154. package/node_modules/@buddi/gateway/dist/agents/learning-digest.js.map +1 -1
  155. package/node_modules/@buddi/gateway/dist/agents/owner-tools.d.ts.map +1 -1
  156. package/node_modules/@buddi/gateway/dist/agents/owner-tools.js +11 -1
  157. package/node_modules/@buddi/gateway/dist/agents/owner-tools.js.map +1 -1
  158. package/node_modules/@buddi/gateway/dist/agents/platform.d.ts.map +1 -1
  159. package/node_modules/@buddi/gateway/dist/agents/platform.js +2 -0
  160. package/node_modules/@buddi/gateway/dist/agents/platform.js.map +1 -1
  161. package/node_modules/@buddi/gateway/dist/chat/conversations.d.ts.map +1 -1
  162. package/node_modules/@buddi/gateway/dist/chat/conversations.js +8 -2
  163. package/node_modules/@buddi/gateway/dist/chat/conversations.js.map +1 -1
  164. package/node_modules/@buddi/gateway/dist/index.d.ts +1 -0
  165. package/node_modules/@buddi/gateway/dist/index.d.ts.map +1 -1
  166. package/node_modules/@buddi/gateway/dist/index.js +1 -0
  167. package/node_modules/@buddi/gateway/dist/index.js.map +1 -1
  168. package/node_modules/@buddi/gateway/dist/missions/defaults.d.ts +0 -6
  169. package/node_modules/@buddi/gateway/dist/missions/defaults.d.ts.map +1 -1
  170. package/node_modules/@buddi/gateway/dist/missions/defaults.js +4 -8
  171. package/node_modules/@buddi/gateway/dist/missions/defaults.js.map +1 -1
  172. package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
  173. package/node_modules/@buddi/gateway/dist/missions/execute.js +36 -2
  174. package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
  175. package/node_modules/@buddi/gateway/dist/missions/goals.d.ts +12 -1
  176. package/node_modules/@buddi/gateway/dist/missions/goals.d.ts.map +1 -1
  177. package/node_modules/@buddi/gateway/dist/missions/goals.js +21 -1
  178. package/node_modules/@buddi/gateway/dist/missions/goals.js.map +1 -1
  179. package/node_modules/@buddi/gateway/dist/missions/reminders.d.ts.map +1 -1
  180. package/node_modules/@buddi/gateway/dist/missions/reminders.js +4 -1
  181. package/node_modules/@buddi/gateway/dist/missions/reminders.js.map +1 -1
  182. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.d.ts +3 -0
  183. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.d.ts.map +1 -1
  184. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.js +4 -1
  185. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.js.map +1 -1
  186. package/node_modules/@buddi/gateway/dist/missions/zone-provenance.d.ts +13 -0
  187. package/node_modules/@buddi/gateway/dist/missions/zone-provenance.d.ts.map +1 -0
  188. package/node_modules/@buddi/gateway/dist/missions/zone-provenance.js +36 -0
  189. package/node_modules/@buddi/gateway/dist/missions/zone-provenance.js.map +1 -0
  190. package/node_modules/@buddi/gateway/dist/missions-cli.js +2 -2
  191. package/node_modules/@buddi/gateway/dist/missions-cli.js.map +1 -1
  192. package/node_modules/@buddi/gateway/dist/serve.d.ts.map +1 -1
  193. package/node_modules/@buddi/gateway/dist/serve.js +10 -10
  194. package/node_modules/@buddi/gateway/dist/serve.js.map +1 -1
  195. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.d.ts +17 -0
  196. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.d.ts.map +1 -1
  197. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.js +27 -0
  198. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.js.map +1 -1
  199. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts +11 -1
  200. package/node_modules/@buddi/gateway/dist/telegram/channel.d.ts.map +1 -1
  201. package/node_modules/@buddi/gateway/dist/telegram/channel.js +13 -2
  202. package/node_modules/@buddi/gateway/dist/telegram/channel.js.map +1 -1
  203. package/node_modules/@buddi/gateway/dist/web/alerts.d.ts +179 -0
  204. package/node_modules/@buddi/gateway/dist/web/alerts.d.ts.map +1 -0
  205. package/node_modules/@buddi/gateway/dist/web/alerts.js +363 -0
  206. package/node_modules/@buddi/gateway/dist/web/alerts.js.map +1 -0
  207. package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
  208. package/node_modules/@buddi/gateway/dist/web/api-routes.js +53 -9
  209. package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
  210. package/node_modules/@buddi/gateway/dist/web/chat.d.ts +1 -0
  211. package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
  212. package/node_modules/@buddi/gateway/dist/web/chat.js +4 -3
  213. package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
  214. package/node_modules/@buddi/gateway/dist/web/lock.d.ts +12 -5
  215. package/node_modules/@buddi/gateway/dist/web/lock.d.ts.map +1 -1
  216. package/node_modules/@buddi/gateway/dist/web/lock.js +23 -28
  217. package/node_modules/@buddi/gateway/dist/web/lock.js.map +1 -1
  218. package/node_modules/@buddi/gateway/dist/web/needs-you.d.ts +36 -0
  219. package/node_modules/@buddi/gateway/dist/web/needs-you.d.ts.map +1 -0
  220. package/node_modules/@buddi/gateway/dist/web/needs-you.js +65 -0
  221. package/node_modules/@buddi/gateway/dist/web/needs-you.js.map +1 -0
  222. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts +9 -1
  223. package/node_modules/@buddi/gateway/dist/web/notifications.d.ts.map +1 -1
  224. package/node_modules/@buddi/gateway/dist/web/notifications.js +14 -3
  225. package/node_modules/@buddi/gateway/dist/web/notifications.js.map +1 -1
  226. package/node_modules/@buddi/gateway/dist/web/plugins.d.ts.map +1 -1
  227. package/node_modules/@buddi/gateway/dist/web/plugins.js +17 -3
  228. package/node_modules/@buddi/gateway/dist/web/plugins.js.map +1 -1
  229. package/node_modules/@buddi/gateway/dist/web/read.d.ts +69 -27
  230. package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
  231. package/node_modules/@buddi/gateway/dist/web/read.js +103 -43
  232. package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
  233. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts +61 -1
  234. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts.map +1 -1
  235. package/node_modules/@buddi/gateway/dist/web/secrets.js +111 -3
  236. package/node_modules/@buddi/gateway/dist/web/secrets.js.map +1 -1
  237. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  238. package/node_modules/@buddi/gateway/dist/web/server.js +152 -11
  239. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  240. package/node_modules/@buddi/gateway/dist/web/widgets.d.ts +1 -0
  241. package/node_modules/@buddi/gateway/dist/web/widgets.d.ts.map +1 -1
  242. package/node_modules/@buddi/gateway/dist/web/widgets.js +6 -1
  243. package/node_modules/@buddi/gateway/dist/web/widgets.js.map +1 -1
  244. package/node_modules/@buddi/gateway/dist/web/write.d.ts +23 -0
  245. package/node_modules/@buddi/gateway/dist/web/write.d.ts.map +1 -1
  246. package/node_modules/@buddi/gateway/dist/web/write.js +50 -1
  247. package/node_modules/@buddi/gateway/dist/web/write.js.map +1 -1
  248. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  249. package/node_modules/@buddi/install/dist/doctor-timezone.d.ts +17 -0
  250. package/node_modules/@buddi/install/dist/doctor-timezone.d.ts.map +1 -0
  251. package/node_modules/@buddi/install/dist/doctor-timezone.js +34 -0
  252. package/node_modules/@buddi/install/dist/doctor-timezone.js.map +1 -0
  253. package/node_modules/@buddi/install/dist/launcher.d.ts.map +1 -1
  254. package/node_modules/@buddi/install/dist/launcher.js +3 -0
  255. package/node_modules/@buddi/install/dist/launcher.js.map +1 -1
  256. package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
  257. package/node_modules/@buddi/runtime/dist/anthropic.d.ts +6 -0
  258. package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
  259. package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
  260. package/node_modules/@buddi/runtime/dist/openai.d.ts +34 -1
  261. package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
  262. package/node_modules/@buddi/runtime/dist/openai.js +66 -12
  263. package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
  264. package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
  265. package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
  266. package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
  267. package/node_modules/@buddi/tool-email/dist/agent.js +1 -1
  268. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.d.ts +8 -0
  269. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.d.ts.map +1 -1
  270. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.js +59 -4
  271. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.js.map +1 -1
  272. package/node_modules/@buddi/tool-email/dist/mail.d.ts +42 -0
  273. package/node_modules/@buddi/tool-email/dist/mail.d.ts.map +1 -1
  274. package/node_modules/@buddi/tool-email/dist/mail.js +116 -0
  275. package/node_modules/@buddi/tool-email/dist/mail.js.map +1 -1
  276. package/node_modules/@buddi/tool-email/dist/mailbox/select.d.ts +6 -0
  277. package/node_modules/@buddi/tool-email/dist/mailbox/select.d.ts.map +1 -1
  278. package/node_modules/@buddi/tool-email/dist/mailbox/select.js +11 -0
  279. package/node_modules/@buddi/tool-email/dist/mailbox/select.js.map +1 -1
  280. package/node_modules/@buddi/tool-email/dist/metrics.d.ts +5 -6
  281. package/node_modules/@buddi/tool-email/dist/metrics.d.ts.map +1 -1
  282. package/node_modules/@buddi/tool-email/dist/metrics.js +4 -5
  283. package/node_modules/@buddi/tool-email/dist/metrics.js.map +1 -1
  284. package/node_modules/@buddi/tool-email/dist/needs-you.d.ts +61 -0
  285. package/node_modules/@buddi/tool-email/dist/needs-you.d.ts.map +1 -0
  286. package/node_modules/@buddi/tool-email/dist/needs-you.js +99 -0
  287. package/node_modules/@buddi/tool-email/dist/needs-you.js.map +1 -0
  288. package/node_modules/@buddi/tool-email/dist/pages/descriptors.d.ts.map +1 -1
  289. package/node_modules/@buddi/tool-email/dist/pages/descriptors.js +110 -78
  290. package/node_modules/@buddi/tool-email/dist/pages/descriptors.js.map +1 -1
  291. package/node_modules/@buddi/tool-email/dist/pages/drafts-tools.d.ts +2 -2
  292. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts +7 -0
  293. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts.map +1 -1
  294. package/node_modules/@buddi/tool-email/dist/pages/queries.js +31 -3
  295. package/node_modules/@buddi/tool-email/dist/pages/queries.js.map +1 -1
  296. package/node_modules/@buddi/tool-email/dist/ports.d.ts +8 -0
  297. package/node_modules/@buddi/tool-email/dist/ports.d.ts.map +1 -1
  298. package/node_modules/@buddi/tool-email/dist/ports.js.map +1 -1
  299. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.d.ts.map +1 -1
  300. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.js +4 -1
  301. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.js.map +1 -1
  302. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.d.ts +18 -21
  303. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.d.ts.map +1 -1
  304. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.js +39 -63
  305. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.js.map +1 -1
  306. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.d.ts.map +1 -1
  307. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.js +3 -2
  308. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.js.map +1 -1
  309. package/node_modules/@buddi/tool-email/dist/suspicions-store.d.ts +6 -0
  310. package/node_modules/@buddi/tool-email/dist/suspicions-store.d.ts.map +1 -1
  311. package/node_modules/@buddi/tool-email/dist/suspicions-store.js +16 -1
  312. package/node_modules/@buddi/tool-email/dist/suspicions-store.js.map +1 -1
  313. package/node_modules/@buddi/tool-email/dist/threads.d.ts +17 -2
  314. package/node_modules/@buddi/tool-email/dist/threads.d.ts.map +1 -1
  315. package/node_modules/@buddi/tool-email/dist/threads.js +35 -14
  316. package/node_modules/@buddi/tool-email/dist/threads.js.map +1 -1
  317. package/node_modules/@buddi/tool-email/dist/tools/mailbox.d.ts +3 -0
  318. package/node_modules/@buddi/tool-email/dist/tools/mailbox.d.ts.map +1 -1
  319. package/node_modules/@buddi/tool-email/dist/tools/mailbox.js +5 -0
  320. package/node_modules/@buddi/tool-email/dist/tools/mailbox.js.map +1 -1
  321. package/node_modules/@buddi/tool-email/dist/tools/threads.d.ts +7 -3
  322. package/node_modules/@buddi/tool-email/dist/tools/threads.d.ts.map +1 -1
  323. package/node_modules/@buddi/tool-email/dist/tools/threads.js +18 -5
  324. package/node_modules/@buddi/tool-email/dist/tools/threads.js.map +1 -1
  325. package/node_modules/@buddi/tool-email/dist/watchers.d.ts +91 -7
  326. package/node_modules/@buddi/tool-email/dist/watchers.d.ts.map +1 -1
  327. package/node_modules/@buddi/tool-email/dist/watchers.js +164 -1
  328. package/node_modules/@buddi/tool-email/dist/watchers.js.map +1 -1
  329. package/node_modules/@buddi/tool-email/dist/widgets.d.ts +3 -2
  330. package/node_modules/@buddi/tool-email/dist/widgets.d.ts.map +1 -1
  331. package/node_modules/@buddi/tool-email/dist/widgets.js +2 -2
  332. package/node_modules/@buddi/tool-email/dist/widgets.js.map +1 -1
  333. package/node_modules/@buddi/tool-email/migrations/023_attention.sql +100 -0
  334. package/node_modules/@buddi/tool-email/migrations/024_auth_domain.sql +9 -0
  335. package/node_modules/@buddi/tool-email/migrations/025_thread_ignore.sql +77 -0
  336. package/node_modules/@buddi/tool-email/migrations/026_attention_filed.sql +89 -0
  337. package/node_modules/@buddi/tool-email/package.json +1 -1
  338. package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
  339. package/node_modules/@buddi/tool-mcp/dist/.tsbuildinfo +1 -1
  340. package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
  341. package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
  342. package/node_modules/ip-address/README.md +34 -34
  343. package/node_modules/ip-address/dist/ipv4.js +7 -0
  344. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  345. package/node_modules/ip-address/package.json +1 -1
  346. package/package.json +2 -2
  347. package/packages/cli/dist/.tsbuildinfo +1 -1
  348. package/packages/cli/dist/args.d.ts +6 -1
  349. package/packages/cli/dist/args.d.ts.map +1 -1
  350. package/packages/cli/dist/args.js +7 -2
  351. package/packages/cli/dist/args.js.map +1 -1
  352. package/packages/cli/dist/commands.d.ts.map +1 -1
  353. package/packages/cli/dist/commands.js +14 -4
  354. package/packages/cli/dist/commands.js.map +1 -1
  355. package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
  356. package/packages/cli/dist/doctor-probes.js +6 -12
  357. package/packages/cli/dist/doctor-probes.js.map +1 -1
  358. package/packages/cli/dist/doctor.d.ts +16 -0
  359. package/packages/cli/dist/doctor.d.ts.map +1 -1
  360. package/packages/cli/dist/doctor.js +30 -0
  361. package/packages/cli/dist/doctor.js.map +1 -1
  362. package/packages/cli/dist/jobs-cmd.d.ts +4 -0
  363. package/packages/cli/dist/jobs-cmd.d.ts.map +1 -1
  364. package/packages/cli/dist/jobs-cmd.js +53 -4
  365. package/packages/cli/dist/jobs-cmd.js.map +1 -1
  366. package/packages/cli/dist/main.d.ts.map +1 -1
  367. package/packages/cli/dist/main.js +27 -9
  368. package/packages/cli/dist/main.js.map +1 -1
  369. package/packages/cli/dist/mcp/tools.d.ts.map +1 -1
  370. package/packages/cli/dist/mcp/tools.js +3 -1
  371. package/packages/cli/dist/mcp/tools.js.map +1 -1
  372. package/packages/cli/dist/status.d.ts +15 -9
  373. package/packages/cli/dist/status.d.ts.map +1 -1
  374. package/packages/cli/dist/status.js +6 -11
  375. package/packages/cli/dist/status.js.map +1 -1
  376. package/packages/core/dist/.tsbuildinfo +1 -1
  377. package/packages/core/dist/actions/store.d.ts +8 -0
  378. package/packages/core/dist/actions/store.d.ts.map +1 -1
  379. package/packages/core/dist/actions/store.js +13 -0
  380. package/packages/core/dist/actions/store.js.map +1 -1
  381. package/packages/core/dist/clock-widget.d.ts.map +1 -1
  382. package/packages/core/dist/clock-widget.js +5 -3
  383. package/packages/core/dist/clock-widget.js.map +1 -1
  384. package/packages/core/dist/host/build.d.ts.map +1 -1
  385. package/packages/core/dist/host/build.js +11 -0
  386. package/packages/core/dist/host/build.js.map +1 -1
  387. package/packages/core/dist/host/types.d.ts +7 -0
  388. package/packages/core/dist/host/types.d.ts.map +1 -1
  389. package/packages/core/dist/learning/store.d.ts +7 -0
  390. package/packages/core/dist/learning/store.d.ts.map +1 -1
  391. package/packages/core/dist/learning/store.js +6 -0
  392. package/packages/core/dist/learning/store.js.map +1 -1
  393. package/packages/core/dist/lock.d.ts +8 -2
  394. package/packages/core/dist/lock.d.ts.map +1 -1
  395. package/packages/core/dist/lock.js +20 -5
  396. package/packages/core/dist/lock.js.map +1 -1
  397. package/packages/core/dist/notifications/agent.d.ts +7 -0
  398. package/packages/core/dist/notifications/agent.d.ts.map +1 -1
  399. package/packages/core/dist/notifications/agent.js +2 -0
  400. package/packages/core/dist/notifications/agent.js.map +1 -1
  401. package/packages/core/dist/notifications/index.d.ts +1 -0
  402. package/packages/core/dist/notifications/index.d.ts.map +1 -1
  403. package/packages/core/dist/notifications/index.js +1 -0
  404. package/packages/core/dist/notifications/index.js.map +1 -1
  405. package/packages/core/dist/notifications/needs.d.ts +49 -0
  406. package/packages/core/dist/notifications/needs.d.ts.map +1 -0
  407. package/packages/core/dist/notifications/needs.js +41 -0
  408. package/packages/core/dist/notifications/needs.js.map +1 -0
  409. package/packages/core/dist/notifications/notify.d.ts.map +1 -1
  410. package/packages/core/dist/notifications/notify.js +16 -7
  411. package/packages/core/dist/notifications/notify.js.map +1 -1
  412. package/packages/core/dist/notifications/store.d.ts.map +1 -1
  413. package/packages/core/dist/notifications/store.js +2 -1
  414. package/packages/core/dist/notifications/store.js.map +1 -1
  415. package/packages/core/dist/notifications/types.d.ts +10 -0
  416. package/packages/core/dist/notifications/types.d.ts.map +1 -1
  417. package/packages/core/dist/notifications/types.js.map +1 -1
  418. package/packages/core/dist/owner-timezone.d.ts +20 -22
  419. package/packages/core/dist/owner-timezone.d.ts.map +1 -1
  420. package/packages/core/dist/owner-timezone.js +17 -25
  421. package/packages/core/dist/owner-timezone.js.map +1 -1
  422. package/packages/core/dist/pages.d.ts +3 -1
  423. package/packages/core/dist/pages.d.ts.map +1 -1
  424. package/packages/core/dist/pages.js +6 -1
  425. package/packages/core/dist/pages.js.map +1 -1
  426. package/packages/core/dist/plugin/index.d.ts +1 -1
  427. package/packages/core/dist/plugin/index.d.ts.map +1 -1
  428. package/packages/core/dist/plugin/index.js.map +1 -1
  429. package/packages/core/dist/plugin/version.d.ts +1 -1
  430. package/packages/core/dist/plugin/version.js +1 -1
  431. package/packages/core/dist/queue/failures.d.ts +84 -0
  432. package/packages/core/dist/queue/failures.d.ts.map +1 -0
  433. package/packages/core/dist/queue/failures.js +195 -0
  434. package/packages/core/dist/queue/failures.js.map +1 -0
  435. package/packages/core/dist/queue/index.d.ts +1 -0
  436. package/packages/core/dist/queue/index.d.ts.map +1 -1
  437. package/packages/core/dist/queue/index.js +1 -0
  438. package/packages/core/dist/queue/index.js.map +1 -1
  439. package/packages/core/dist/queue/jobs.d.ts +39 -3
  440. package/packages/core/dist/queue/jobs.d.ts.map +1 -1
  441. package/packages/core/dist/queue/jobs.js +54 -4
  442. package/packages/core/dist/queue/jobs.js.map +1 -1
  443. package/packages/core/dist/queue/types.d.ts +20 -0
  444. package/packages/core/dist/queue/types.d.ts.map +1 -1
  445. package/packages/core/dist/queue/types.js +17 -0
  446. package/packages/core/dist/queue/types.js.map +1 -1
  447. package/packages/core/dist/scheduler/missions.d.ts +39 -10
  448. package/packages/core/dist/scheduler/missions.d.ts.map +1 -1
  449. package/packages/core/dist/scheduler/missions.js +44 -17
  450. package/packages/core/dist/scheduler/missions.js.map +1 -1
  451. package/packages/core/dist/scheduler/types.d.ts +7 -0
  452. package/packages/core/dist/scheduler/types.d.ts.map +1 -1
  453. package/packages/core/dist/scheduler/types.js +1 -0
  454. package/packages/core/dist/scheduler/types.js.map +1 -1
  455. package/packages/core/dist/secrets/settings.d.ts.map +1 -1
  456. package/packages/core/dist/secrets/settings.js +23 -3
  457. package/packages/core/dist/secrets/settings.js.map +1 -1
  458. package/packages/core/dist/sentinels/digest.d.ts +8 -1
  459. package/packages/core/dist/sentinels/digest.d.ts.map +1 -1
  460. package/packages/core/dist/sentinels/digest.js +10 -3
  461. package/packages/core/dist/sentinels/digest.js.map +1 -1
  462. package/packages/core/dist/sentinels/index.d.ts +1 -0
  463. package/packages/core/dist/sentinels/index.d.ts.map +1 -1
  464. package/packages/core/dist/sentinels/index.js +1 -0
  465. package/packages/core/dist/sentinels/index.js.map +1 -1
  466. package/packages/core/dist/sentinels/mutes.d.ts +51 -0
  467. package/packages/core/dist/sentinels/mutes.d.ts.map +1 -0
  468. package/packages/core/dist/sentinels/mutes.js +86 -0
  469. package/packages/core/dist/sentinels/mutes.js.map +1 -0
  470. package/packages/core/dist/sentinels/run.d.ts +14 -4
  471. package/packages/core/dist/sentinels/run.d.ts.map +1 -1
  472. package/packages/core/dist/sentinels/run.js +64 -20
  473. package/packages/core/dist/sentinels/run.js.map +1 -1
  474. package/packages/core/dist/sentinels/types.d.ts +152 -2
  475. package/packages/core/dist/sentinels/types.d.ts.map +1 -1
  476. package/packages/core/dist/sentinels/types.js +126 -2
  477. package/packages/core/dist/sentinels/types.js.map +1 -1
  478. package/packages/core/dist/views.d.ts +112 -112
  479. package/packages/core/dist/views.d.ts.map +1 -1
  480. package/packages/core/dist/views.js +2 -0
  481. package/packages/core/dist/views.js.map +1 -1
  482. package/packages/core/dist/web-settings.d.ts +13 -0
  483. package/packages/core/dist/web-settings.d.ts.map +1 -1
  484. package/packages/core/dist/web-settings.js +26 -0
  485. package/packages/core/dist/web-settings.js.map +1 -1
  486. package/packages/core/dist/widgets.d.ts +13 -5
  487. package/packages/core/dist/widgets.d.ts.map +1 -1
  488. package/packages/core/dist/widgets.js +10 -1
  489. package/packages/core/dist/widgets.js.map +1 -1
  490. package/packages/core/migrations/066_alert_decisions.sql +45 -0
  491. package/packages/core/migrations/067_job_acknowledged.sql +21 -0
  492. package/packages/core/migrations/068_notification_action.sql +12 -0
  493. package/packages/core/migrations/069_schedule_zone_explicit.sql +18 -0
  494. package/packages/gateway/dist/.tsbuildinfo +1 -1
  495. package/packages/gateway/dist/agents/learning-digest.d.ts +29 -7
  496. package/packages/gateway/dist/agents/learning-digest.d.ts.map +1 -1
  497. package/packages/gateway/dist/agents/learning-digest.js +87 -38
  498. package/packages/gateway/dist/agents/learning-digest.js.map +1 -1
  499. package/packages/gateway/dist/agents/owner-tools.d.ts.map +1 -1
  500. package/packages/gateway/dist/agents/owner-tools.js +11 -1
  501. package/packages/gateway/dist/agents/owner-tools.js.map +1 -1
  502. package/packages/gateway/dist/agents/platform.d.ts.map +1 -1
  503. package/packages/gateway/dist/agents/platform.js +2 -0
  504. package/packages/gateway/dist/agents/platform.js.map +1 -1
  505. package/packages/gateway/dist/chat/conversations.d.ts.map +1 -1
  506. package/packages/gateway/dist/chat/conversations.js +8 -2
  507. package/packages/gateway/dist/chat/conversations.js.map +1 -1
  508. package/packages/gateway/dist/index.d.ts +1 -0
  509. package/packages/gateway/dist/index.d.ts.map +1 -1
  510. package/packages/gateway/dist/index.js +1 -0
  511. package/packages/gateway/dist/index.js.map +1 -1
  512. package/packages/gateway/dist/missions/defaults.d.ts +0 -6
  513. package/packages/gateway/dist/missions/defaults.d.ts.map +1 -1
  514. package/packages/gateway/dist/missions/defaults.js +4 -8
  515. package/packages/gateway/dist/missions/defaults.js.map +1 -1
  516. package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
  517. package/packages/gateway/dist/missions/execute.js +36 -2
  518. package/packages/gateway/dist/missions/execute.js.map +1 -1
  519. package/packages/gateway/dist/missions/goals.d.ts +12 -1
  520. package/packages/gateway/dist/missions/goals.d.ts.map +1 -1
  521. package/packages/gateway/dist/missions/goals.js +21 -1
  522. package/packages/gateway/dist/missions/goals.js.map +1 -1
  523. package/packages/gateway/dist/missions/reminders.d.ts.map +1 -1
  524. package/packages/gateway/dist/missions/reminders.js +4 -1
  525. package/packages/gateway/dist/missions/reminders.js.map +1 -1
  526. package/packages/gateway/dist/missions/sentinel-wake.d.ts +3 -0
  527. package/packages/gateway/dist/missions/sentinel-wake.d.ts.map +1 -1
  528. package/packages/gateway/dist/missions/sentinel-wake.js +4 -1
  529. package/packages/gateway/dist/missions/sentinel-wake.js.map +1 -1
  530. package/packages/gateway/dist/missions/zone-provenance.d.ts +13 -0
  531. package/packages/gateway/dist/missions/zone-provenance.d.ts.map +1 -0
  532. package/packages/gateway/dist/missions/zone-provenance.js +36 -0
  533. package/packages/gateway/dist/missions/zone-provenance.js.map +1 -0
  534. package/packages/gateway/dist/missions-cli.js +2 -2
  535. package/packages/gateway/dist/missions-cli.js.map +1 -1
  536. package/packages/gateway/dist/serve.d.ts.map +1 -1
  537. package/packages/gateway/dist/serve.js +10 -10
  538. package/packages/gateway/dist/serve.js.map +1 -1
  539. package/packages/gateway/dist/surfaces/offered-actions.d.ts +17 -0
  540. package/packages/gateway/dist/surfaces/offered-actions.d.ts.map +1 -1
  541. package/packages/gateway/dist/surfaces/offered-actions.js +27 -0
  542. package/packages/gateway/dist/surfaces/offered-actions.js.map +1 -1
  543. package/packages/gateway/dist/telegram/channel.d.ts +11 -1
  544. package/packages/gateway/dist/telegram/channel.d.ts.map +1 -1
  545. package/packages/gateway/dist/telegram/channel.js +13 -2
  546. package/packages/gateway/dist/telegram/channel.js.map +1 -1
  547. package/packages/gateway/dist/web/alerts.d.ts +179 -0
  548. package/packages/gateway/dist/web/alerts.d.ts.map +1 -0
  549. package/packages/gateway/dist/web/alerts.js +363 -0
  550. package/packages/gateway/dist/web/alerts.js.map +1 -0
  551. package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
  552. package/packages/gateway/dist/web/api-routes.js +53 -9
  553. package/packages/gateway/dist/web/api-routes.js.map +1 -1
  554. package/packages/gateway/dist/web/chat.d.ts +1 -0
  555. package/packages/gateway/dist/web/chat.d.ts.map +1 -1
  556. package/packages/gateway/dist/web/chat.js +4 -3
  557. package/packages/gateway/dist/web/chat.js.map +1 -1
  558. package/packages/gateway/dist/web/lock.d.ts +12 -5
  559. package/packages/gateway/dist/web/lock.d.ts.map +1 -1
  560. package/packages/gateway/dist/web/lock.js +23 -28
  561. package/packages/gateway/dist/web/lock.js.map +1 -1
  562. package/packages/gateway/dist/web/needs-you.d.ts +36 -0
  563. package/packages/gateway/dist/web/needs-you.d.ts.map +1 -0
  564. package/packages/gateway/dist/web/needs-you.js +65 -0
  565. package/packages/gateway/dist/web/needs-you.js.map +1 -0
  566. package/packages/gateway/dist/web/notifications.d.ts +9 -1
  567. package/packages/gateway/dist/web/notifications.d.ts.map +1 -1
  568. package/packages/gateway/dist/web/notifications.js +14 -3
  569. package/packages/gateway/dist/web/notifications.js.map +1 -1
  570. package/packages/gateway/dist/web/plugins.d.ts.map +1 -1
  571. package/packages/gateway/dist/web/plugins.js +17 -3
  572. package/packages/gateway/dist/web/plugins.js.map +1 -1
  573. package/packages/gateway/dist/web/read.d.ts +69 -27
  574. package/packages/gateway/dist/web/read.d.ts.map +1 -1
  575. package/packages/gateway/dist/web/read.js +103 -43
  576. package/packages/gateway/dist/web/read.js.map +1 -1
  577. package/packages/gateway/dist/web/secrets.d.ts +61 -1
  578. package/packages/gateway/dist/web/secrets.d.ts.map +1 -1
  579. package/packages/gateway/dist/web/secrets.js +111 -3
  580. package/packages/gateway/dist/web/secrets.js.map +1 -1
  581. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  582. package/packages/gateway/dist/web/server.js +152 -11
  583. package/packages/gateway/dist/web/server.js.map +1 -1
  584. package/packages/gateway/dist/web/widgets.d.ts +1 -0
  585. package/packages/gateway/dist/web/widgets.d.ts.map +1 -1
  586. package/packages/gateway/dist/web/widgets.js +6 -1
  587. package/packages/gateway/dist/web/widgets.js.map +1 -1
  588. package/packages/gateway/dist/web/write.d.ts +23 -0
  589. package/packages/gateway/dist/web/write.d.ts.map +1 -1
  590. package/packages/gateway/dist/web/write.js +50 -1
  591. package/packages/gateway/dist/web/write.js.map +1 -1
  592. package/packages/install/dist/.tsbuildinfo +1 -1
  593. package/packages/install/dist/doctor-timezone.d.ts +17 -0
  594. package/packages/install/dist/doctor-timezone.d.ts.map +1 -0
  595. package/packages/install/dist/doctor-timezone.js +34 -0
  596. package/packages/install/dist/doctor-timezone.js.map +1 -0
  597. package/packages/install/dist/launcher.d.ts.map +1 -1
  598. package/packages/install/dist/launcher.js +3 -0
  599. package/packages/install/dist/launcher.js.map +1 -1
  600. package/packages/runtime/dist/.tsbuildinfo +1 -1
  601. package/packages/runtime/dist/anthropic.d.ts +6 -0
  602. package/packages/runtime/dist/anthropic.d.ts.map +1 -1
  603. package/packages/runtime/dist/anthropic.js.map +1 -1
  604. package/packages/runtime/dist/openai.d.ts +34 -1
  605. package/packages/runtime/dist/openai.d.ts.map +1 -1
  606. package/packages/runtime/dist/openai.js +66 -12
  607. package/packages/runtime/dist/openai.js.map +1 -1
  608. package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
  609. package/packages/tools/browser/dist/.tsbuildinfo +1 -1
  610. package/packages/tools/email/dist/.tsbuildinfo +1 -1
  611. package/packages/tools/email/dist/agent.js +1 -1
  612. package/packages/tools/email/dist/imap/imapflow-client.d.ts +8 -0
  613. package/packages/tools/email/dist/imap/imapflow-client.d.ts.map +1 -1
  614. package/packages/tools/email/dist/imap/imapflow-client.js +59 -4
  615. package/packages/tools/email/dist/imap/imapflow-client.js.map +1 -1
  616. package/packages/tools/email/dist/mail.d.ts +42 -0
  617. package/packages/tools/email/dist/mail.d.ts.map +1 -1
  618. package/packages/tools/email/dist/mail.js +116 -0
  619. package/packages/tools/email/dist/mail.js.map +1 -1
  620. package/packages/tools/email/dist/mailbox/select.d.ts +6 -0
  621. package/packages/tools/email/dist/mailbox/select.d.ts.map +1 -1
  622. package/packages/tools/email/dist/mailbox/select.js +11 -0
  623. package/packages/tools/email/dist/mailbox/select.js.map +1 -1
  624. package/packages/tools/email/dist/metrics.d.ts +5 -6
  625. package/packages/tools/email/dist/metrics.d.ts.map +1 -1
  626. package/packages/tools/email/dist/metrics.js +4 -5
  627. package/packages/tools/email/dist/metrics.js.map +1 -1
  628. package/packages/tools/email/dist/needs-you.d.ts +61 -0
  629. package/packages/tools/email/dist/needs-you.d.ts.map +1 -0
  630. package/packages/tools/email/dist/needs-you.js +99 -0
  631. package/packages/tools/email/dist/needs-you.js.map +1 -0
  632. package/packages/tools/email/dist/pages/descriptors.d.ts.map +1 -1
  633. package/packages/tools/email/dist/pages/descriptors.js +110 -78
  634. package/packages/tools/email/dist/pages/descriptors.js.map +1 -1
  635. package/packages/tools/email/dist/pages/drafts-tools.d.ts +2 -2
  636. package/packages/tools/email/dist/pages/queries.d.ts +7 -0
  637. package/packages/tools/email/dist/pages/queries.d.ts.map +1 -1
  638. package/packages/tools/email/dist/pages/queries.js +31 -3
  639. package/packages/tools/email/dist/pages/queries.js.map +1 -1
  640. package/packages/tools/email/dist/ports.d.ts +8 -0
  641. package/packages/tools/email/dist/ports.d.ts.map +1 -1
  642. package/packages/tools/email/dist/ports.js.map +1 -1
  643. package/packages/tools/email/dist/sentinels/suspicious-sender.d.ts.map +1 -1
  644. package/packages/tools/email/dist/sentinels/suspicious-sender.js +4 -1
  645. package/packages/tools/email/dist/sentinels/suspicious-sender.js.map +1 -1
  646. package/packages/tools/email/dist/sentinels/waiting-on-me.d.ts +18 -21
  647. package/packages/tools/email/dist/sentinels/waiting-on-me.d.ts.map +1 -1
  648. package/packages/tools/email/dist/sentinels/waiting-on-me.js +39 -63
  649. package/packages/tools/email/dist/sentinels/waiting-on-me.js.map +1 -1
  650. package/packages/tools/email/dist/sources/inbox-poll.d.ts.map +1 -1
  651. package/packages/tools/email/dist/sources/inbox-poll.js +3 -2
  652. package/packages/tools/email/dist/sources/inbox-poll.js.map +1 -1
  653. package/packages/tools/email/dist/suspicions-store.d.ts +6 -0
  654. package/packages/tools/email/dist/suspicions-store.d.ts.map +1 -1
  655. package/packages/tools/email/dist/suspicions-store.js +16 -1
  656. package/packages/tools/email/dist/suspicions-store.js.map +1 -1
  657. package/packages/tools/email/dist/threads.d.ts +17 -2
  658. package/packages/tools/email/dist/threads.d.ts.map +1 -1
  659. package/packages/tools/email/dist/threads.js +35 -14
  660. package/packages/tools/email/dist/threads.js.map +1 -1
  661. package/packages/tools/email/dist/tools/mailbox.d.ts +3 -0
  662. package/packages/tools/email/dist/tools/mailbox.d.ts.map +1 -1
  663. package/packages/tools/email/dist/tools/mailbox.js +5 -0
  664. package/packages/tools/email/dist/tools/mailbox.js.map +1 -1
  665. package/packages/tools/email/dist/tools/threads.d.ts +7 -3
  666. package/packages/tools/email/dist/tools/threads.d.ts.map +1 -1
  667. package/packages/tools/email/dist/tools/threads.js +18 -5
  668. package/packages/tools/email/dist/tools/threads.js.map +1 -1
  669. package/packages/tools/email/dist/watchers.d.ts +91 -7
  670. package/packages/tools/email/dist/watchers.d.ts.map +1 -1
  671. package/packages/tools/email/dist/watchers.js +164 -1
  672. package/packages/tools/email/dist/watchers.js.map +1 -1
  673. package/packages/tools/email/dist/widgets.d.ts +3 -2
  674. package/packages/tools/email/dist/widgets.d.ts.map +1 -1
  675. package/packages/tools/email/dist/widgets.js +2 -2
  676. package/packages/tools/email/dist/widgets.js.map +1 -1
  677. package/packages/tools/email/migrations/023_attention.sql +100 -0
  678. package/packages/tools/email/migrations/024_auth_domain.sql +9 -0
  679. package/packages/tools/email/migrations/025_thread_ignore.sql +77 -0
  680. package/packages/tools/email/migrations/026_attention_filed.sql +89 -0
  681. package/packages/tools/email/package.json +1 -1
  682. package/packages/tools/host/dist/.tsbuildinfo +1 -1
  683. package/packages/tools/mcp/dist/.tsbuildinfo +1 -1
  684. package/packages/tools/memory/dist/.tsbuildinfo +1 -1
  685. package/packages/tools/web/dist/.tsbuildinfo +1 -1
  686. package/packages/web/dist/assets/earth-2560-Ce3xs8Cb.webp +0 -0
  687. package/packages/web/dist/assets/earth-phone-BqC7cDhk.webp +0 -0
  688. package/packages/web/dist/assets/index-BYRgwiZp.css +1 -0
  689. package/packages/web/dist/assets/index-Qb1N-6kN.js +129 -0
  690. package/packages/web/dist/assets/{lottie_light-Cdn77Osu.js → lottie_light-DU37j1-6.js} +1 -1
  691. package/packages/web/dist/build.json +1 -1
  692. package/packages/web/dist/index.html +2 -2
  693. package/packages/web/dist/precache.json +4 -4
  694. package/packages/web/dist/sw.js +3 -2
  695. package/packages/web/dist/assets/index-D8_tmf2k.js +0 -131
  696. package/packages/web/dist/assets/index-DYQyioa6.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ipv4.js","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,iDAAmC;AACnC,0DAA4C;AAC5C,mDAA+C;AAE/C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YA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AddressError } from './address-error';\n\nconst isCorrect4 = common.isCorrect(constants.BITS);\n\n/**\n * Represents an IPv4 address\n * @param {string} address - An IPv4 address string\n */\nexport class Address4 {\n address: string;\n addressMinusSuffix: string = '';\n groups: number = constants.GROUPS;\n parsedAddress: string[] = [];\n parsedSubnet: string = '';\n subnet: string = '/32';\n subnetMask: number = 32;\n v4: boolean = true;\n private _binaryZeroPad?: string;\n\n constructor(address: string) {\n this.address = address;\n\n const subnet = constants.RE_SUBNET_STRING.exec(address);\n\n if (subnet) {\n this.parsedSubnet = subnet[0].replace('/', '');\n this.subnetMask = parseInt(this.parsedSubnet, 10);\n this.subnet = `/${this.subnetMask}`;\n\n if (this.subnetMask < 0 || this.subnetMask > constants.BITS) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n address = address.replace(constants.RE_SUBNET_STRING, '');\n }\n\n // Four three-digit octets and three dots: the longest well-formed address\n // is 15 characters. Longer input is rejected before parsing, as Address6\n // does at its own limit.\n const longest = constants.GROUPS * 4 - 1;\n\n if (address.length > longest) {\n throw new AddressError(`IPv4 addresses are at most ${longest} characters.`);\n }\n\n this.addressMinusSuffix = address;\n\n this.parsedAddress = this.parse(address);\n }\n\n /**\n * Returns true if the given string is a valid IPv4 address (with optional\n * CIDR subnet), false otherwise. Host bits in the subnet portion are\n * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address\n * validation compare `correctForm()` to `startAddress().correctForm()`,\n * or use `networkForm()`.\n */\n static isValid(address: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new Address4(address);\n\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Parses an IPv4 address string into its four octet groups and stores the\n * result on `this.parsedAddress`. Called automatically by the constructor;\n * you typically don't need to call it directly. Throws `AddressError` if\n * the input is not a valid IPv4 address.\n */\n parse(address: string) {\n const groups = address.split('.');\n\n // Checked before the general match so the error names the actual problem.\n // Address6 rejects the same notation on its v4-in-v6 path.\n if (groups.some((group) => /^0\\d/.test(group))) {\n throw new AddressError(\"IPv4 addresses can't have leading zeroes.\");\n }\n\n if (!address.match(constants.RE_ADDRESS)) {\n throw new AddressError('Invalid IPv4 address.');\n }\n\n return groups;\n }\n\n /**\n * Returns the address in correct form: octets joined with `.` and any\n * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the\n * canonical dotted-decimal representation.\n */\n correctForm(): string {\n return this.parsedAddress.map((part) => parseInt(part, 10)).join('.');\n }\n\n /**\n * Returns true if the address is correct, false otherwise\n * @returns {Boolean}\n */\n isCorrect = isCorrect4;\n\n /**\n * Construct an `Address4` from an address and a dotted-decimal subnet\n * mask given as separate strings (e.g. as returned by Node's\n * `os.networkInterfaces()`). Throws `AddressError` if the mask is\n * non-contiguous (e.g. `255.0.255.0`).\n * @example\n * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0');\n * address.subnetMask; // 24\n */\n static fromAddressAndMask(address: string, mask: string): Address4 {\n const bits = common.prefixLengthFromMask(new Address4(mask).bigInt(), constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from an address and a Cisco-style wildcard mask\n * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard\n * mask is the bitwise inverse of the subnet mask. Throws `AddressError`\n * if the mask is non-contiguous (e.g. `0.255.0.255`).\n * @example\n * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255');\n * address.subnetMask; // 24\n */\n static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4 {\n const wildcard = new Address4(wildcardMask).bigInt();\n const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);\n const mask = wildcard ^ allOnes;\n const bits = common.prefixLengthFromMask(mask, constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from a wildcard pattern with trailing `*`\n * octets. The number of trailing wildcards determines the prefix\n * length: each `*` represents 8 bits.\n *\n * Only trailing whole-octet wildcards are supported. Partial-octet\n * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g.\n * `192.*.0.1`) throw `AddressError`.\n * @example\n * Address4.fromWildcard('192.168.0.*').subnet; // '/24'\n * Address4.fromWildcard('192.168.*.*').subnet; // '/16'\n * Address4.fromWildcard('*.*.*.*').subnet; // '/0'\n */\n static fromWildcard(input: string): Address4 {\n const groups = input.split('.');\n\n if (groups.length !== constants.GROUPS) {\n throw new AddressError('Wildcard pattern must have 4 octets');\n }\n\n let firstWildcard = -1;\n\n for (let i = 0; i < groups.length; i++) {\n if (groups[i] === '*') {\n if (firstWildcard === -1) {\n firstWildcard = i;\n }\n } else if (firstWildcard !== -1) {\n throw new AddressError(\n 'Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)',\n );\n }\n }\n\n const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard;\n const replaced = groups.map((g) => (g === '*' ? '0' : g));\n const subnetBits = constants.BITS - trailing * 8;\n\n return new Address4(`${replaced.join('.')}/${subnetBits}`);\n }\n\n /**\n * Converts a hex string to an IPv4 address object. Accepts 8 hex digits\n * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`).\n * Throws `AddressError` for any other length or for non-hex characters.\n * @param {string} hex - a hex string to convert\n * @returns {Address4}\n */\n static fromHex(hex: string): Address4 {\n const stripped = hex.replace(/:/g, '');\n\n if (!/^[0-9a-fA-F]{8}$/.test(stripped)) {\n throw new AddressError('IPv4 hex must be exactly 8 hex digits');\n }\n\n const groups = [];\n\n for (let i = 0; i < 8; i += 2) {\n groups.push(parseInt(stripped.slice(i, i + 2), 16));\n }\n\n return new Address4(groups.join('.'));\n }\n\n /**\n * Converts an integer into a IPv4 address object. The integer must be a\n * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise\n * `AddressError` is thrown.\n * @param {integer} integer - a number to convert\n * @returns {Address4}\n */\n static fromInteger(integer: number): Address4 {\n if (!Number.isInteger(integer) || integer < 0 || integer > 0xffffffff) {\n throw new AddressError('IPv4 integer must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(integer.toString(16).padStart(8, '0'));\n }\n\n /**\n * Return an address from in-addr.arpa form: the four octets reversed, with\n * or without the `.in-addr.arpa` suffix and root dot, in any case. Throws\n * `AddressError` unless the reversed labels form a valid IPv4 address, so\n * `fromArpa(x.reverseForm())` round-trips {@link reverseForm}.\n * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address\n * @returns {Adress4}\n * @example\n * var address = Address4.fromArpa('42.2.0.192.in-addr.arpa.')\n * address.correctForm(); // '192.0.2.42'\n */\n static fromArpa(arpaFormAddress: string): Address4 {\n // remove an ending \".in-addr.arpa\", in any case and with or without the\n // root dot, as Address6.fromArpa does for \".ip6.arpa\"\n const leader = arpaFormAddress.replace(/(\\.in-addr\\.arpa)?\\.?$/i, '');\n\n const address = leader.split('.').reverse().join('.');\n\n return new Address4(address);\n }\n\n /**\n * Converts an IPv4 address object to a hex string\n * @returns {String}\n */\n toHex(): string {\n return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(':');\n }\n\n /**\n * Converts an IPv4 address object to an array of bytes.\n *\n * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`.\n * @returns {Array}\n */\n toArray(): number[] {\n return this.parsedAddress.map((part) => parseInt(part, 10));\n }\n\n /**\n * Converts an IPv4 address object to an IPv6 address group\n * @returns {String}\n */\n toGroup6(): string {\n const output = [];\n let i;\n\n for (i = 0; i < constants.GROUPS; i += 2) {\n output.push(\n `${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex(\n this.parsedAddress[i + 1],\n )}`,\n );\n }\n\n return output.join(':');\n }\n\n /**\n * Returns the address as a `bigint`\n * @returns {bigint}\n */\n bigInt(): bigint {\n return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join('')}`);\n }\n\n /**\n * Helper function getting start address.\n * @returns {bigint}\n */\n _startAddress(): bigint {\n return BigInt(`0b${this.mask() + '0'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The first address in the range given by this address' subnet.\n * Often referred to as the Network Address.\n * @returns {Address4}\n */\n startAddress(): Address4 {\n return Address4.fromBigInt(this._startAddress());\n }\n\n /**\n * The first host address in the range given by this address's subnet ie\n * the first address after the Network Address\n * @returns {Address4}\n */\n startAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._startAddress() + adjust);\n }\n\n /**\n * Returns the address `n` addresses after this one (or before, when `n` is\n * negative), keeping this address's subnet mask. Throws `AddressError` when\n * the result would fall outside the IPv4 address space or `n` is not an\n * integer.\n * @param {number | bigint} n\n * @returns {Address4}\n * @example\n * new Address4('10.0.0.0/24').offset(1).correctForm(); // '10.0.0.1'\n */\n offset(n: number | bigint): Address4 {\n return Address4.fromBigInt(\n common.offsetBigInt(this.bigInt(), n, constants.BITS, 'IPv4'),\n ).withSubnetMask(this.subnetMask);\n }\n\n /**\n * Returns the network that follows this address's network: the address after\n * {@link endAddress}, with the same subnet mask. Throws `AddressError` when\n * this network is the last one in the address space.\n * @returns {Address4}\n * @example\n * new Address4('10.0.0.0/24').nextNetwork().networkForm(); // '10.0.1.0/24'\n */\n nextNetwork(): Address4 {\n return Address4.fromBigInt(\n common.offsetBigInt(this._endAddress(), 1, constants.BITS, 'IPv4'),\n ).withSubnetMask(this.subnetMask);\n }\n\n private withSubnetMask(subnetMask: number): Address4 {\n return new Address4(`${this.correctForm()}/${subnetMask}`);\n }\n\n /**\n * Helper function getting end address.\n * @returns {bigint}\n */\n _endAddress(): bigint {\n return BigInt(`0b${this.mask() + '1'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The last address in the range given by this address' subnet\n * Often referred to as the Broadcast\n * @returns {Address4}\n */\n endAddress(): Address4 {\n return Address4.fromBigInt(this._endAddress());\n }\n\n /**\n * The last host address in the range given by this address's subnet ie\n * the last address prior to the Broadcast Address\n * @returns {Address4}\n */\n endAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._endAddress() - adjust);\n }\n\n /**\n * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for\n * a `/20`. Returns an `Address4`; call `.correctForm()` for the string.\n * @returns {Address4}\n */\n subnetMaskAddress(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'1'.repeat(this.subnetMask)}${'0'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is\n * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`;\n * call `.correctForm()` for the string.\n * @returns {Address4}\n */\n wildcardMask(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'0'.repeat(this.subnetMask)}${'1'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The network address in CIDR string form, e.g. `192.168.1.0/24` for\n * `192.168.1.5/24`. For an address with no explicit subnet the prefix is\n * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`.\n * @returns {string}\n */\n networkForm(): string {\n return `${this.startAddress().correctForm()}/${this.subnetMask}`;\n }\n\n /**\n * Converts a BigInt to a v4 address object. The value must be in the\n * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown.\n * @param {bigint} bigInt - a BigInt to convert\n * @returns {Address4}\n */\n static fromBigInt(bigInt: bigint): Address4 {\n if (bigInt < BigInt(0) || bigInt > BigInt(0xffffffff)) {\n throw new AddressError('IPv4 BigInt must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(bigInt.toString(16).padStart(8, '0'));\n }\n\n /**\n * Convert a byte array to an Address4 object. Throws `AddressError` unless\n * given exactly 4 integers from 0 to 255. Signed bytes are rejected, so\n * this differs from `Address6.fromByteArray`, which folds them; the two\n * contracts converge on this stricter form in the next major version.\n *\n * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.\n * @param {Array<number>} bytes - an array of 4 bytes (0-255)\n * @returns {Address4}\n */\n static fromByteArray(bytes: Array<number>): Address4 {\n common.assertByteArray(bytes, 4, 'IPv4', 0);\n\n return this.fromUnsignedByteArray(bytes);\n }\n\n /**\n * Convert an unsigned byte array to an Address4 object. Throws\n * `AddressError` unless given exactly 4 bytes, and rejects values outside\n * 0 to 255 when parsing the resulting address.\n *\n * To convert from a Node.js `Buffer`, spread it:\n * `Address4.fromUnsignedByteArray([...buf])`.\n * @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)\n * @returns {Address4}\n */\n static fromUnsignedByteArray(bytes: Array<number>): Address4 {\n if (bytes.length !== 4) {\n throw new AddressError('IPv4 addresses require exactly 4 bytes');\n }\n\n const address = bytes.join('.');\n return new Address4(address);\n }\n\n /**\n * Returns the first n bits of the address, defaulting to the\n * subnet mask\n * @returns {String}\n */\n mask(mask?: number): string {\n if (mask === undefined) {\n mask = this.subnetMask;\n }\n\n return this.getBitsBase2(0, mask);\n }\n\n /**\n * Returns the bits in the given range as a base-2 string\n * @returns {string}\n */\n getBitsBase2(start: number, end: number): string {\n return this.binaryZeroPad().slice(start, end);\n }\n\n /**\n * Return the reversed in-addr.arpa form of the address, e.g.\n * `42.2.0.192.in-addr.arpa.` for `192.0.2.42`.\n * @param {Object} options\n * @param {boolean} options.omitSuffix - omit the \"in-addr.arpa\" suffix\n * @returns {String}\n */\n reverseForm(options?: common.ReverseFormOptions): string {\n if (!options) {\n options = {};\n }\n\n const reversed = this.correctForm().split('.').reverse().join('.');\n\n if (options.omitSuffix) {\n return reversed;\n }\n\n return `${reversed}.in-addr.arpa.`;\n }\n\n /**\n * Returns true if the given address is in the subnet of the current address.\n * An `Address6` is never in the subnet of an `Address4`; convert with\n * `to4()` or `Address6.fromAddress4()` to compare across families.\n * @returns {boolean}\n */\n isInSubnet = common.isInSubnet;\n\n /**\n * Returns true if this address's host bits fall inside the given subnet,\n * ignoring this address's own subnet mask. Prefer this over `isInSubnet`\n * when classifying a single address, so the answer doesn't change with the\n * CIDR suffix the caller happened to write — notably when the address came\n * from untrusted input and the result backs a trust-boundary decision.\n * An `Address6` is never in the subnet of an `Address4`; convert with\n * `to4()` or `Address6.fromAddress4()` to compare across families.\n * @returns {boolean}\n */\n isHostInSubnet = common.isHostInSubnet;\n\n /**\n * Returns true if the given address is a multicast address\n * @returns {boolean}\n */\n isMulticast(): boolean {\n return this.isHostInSubnet(MULTICAST_V4);\n }\n\n /**\n * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).\n * @returns {boolean}\n */\n isPrivate(): boolean {\n return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));\n }\n\n /**\n * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).\n * @returns {boolean}\n */\n isLoopback(): boolean {\n return this.isHostInSubnet(LOOPBACK_V4);\n }\n\n /**\n * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).\n * @returns {boolean}\n */\n isLinkLocal(): boolean {\n return this.isHostInSubnet(LINK_LOCAL_V4);\n }\n\n /**\n * Returns true if the address is the unspecified address `0.0.0.0`.\n * @returns {boolean}\n */\n isUnspecified(): boolean {\n return this.isHostInSubnet(UNSPECIFIED_V4);\n }\n\n /**\n * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).\n * @returns {boolean}\n */\n isBroadcast(): boolean {\n return this.isHostInSubnet(BROADCAST_V4);\n }\n\n /**\n * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).\n * @returns {boolean}\n */\n isCGNAT(): boolean {\n return this.isHostInSubnet(CGNAT_V4);\n }\n\n /**\n * Returns true if the address is in one of the documentation ranges\n * `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24` ([RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737)).\n * @returns {boolean}\n */\n isDocumentation(): boolean {\n return DOCUMENTATION_V4.some((subnet) => this.isHostInSubnet(subnet));\n }\n\n /**\n * Returns true if the address is in the benchmarking range `198.18.0.0/15` ([RFC 2544](https://datatracker.ietf.org/doc/html/rfc2544)).\n * @returns {boolean}\n */\n isBenchmarking(): boolean {\n return this.isHostInSubnet(BENCHMARKING_V4);\n }\n\n /**\n * Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)),\n * which includes the limited broadcast address.\n * @returns {boolean}\n */\n isReserved(): boolean {\n return this.isHostInSubnet(RESERVED_V4);\n }\n\n /**\n * Returns true if the address is globally reachable: not multicast, and not\n * in any block the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/)\n * marks as not globally reachable. That covers everything the individual\n * classifiers name (private, loopback, link-local, CGNAT, unspecified,\n * broadcast, documentation, benchmarking, reserved) and the blocks they do\n * not, such as `0.0.0.0/8` and the IETF protocol assignments in\n * `192.0.0.0/24`. This is the single predicate to use where a request must\n * not reach an internal or special-purpose destination; see SECURITY.md.\n * @returns {boolean}\n */\n isGlobal(): boolean {\n return !this.isMulticast() && common.isGloballyReachable.call(this, SPECIAL_PURPOSE_V4);\n }\n\n /**\n * Returns a zero-padded base-2 string representation of the address\n * @returns {string}\n */\n binaryZeroPad(): string {\n if (this._binaryZeroPad === undefined) {\n this._binaryZeroPad = this.bigInt().toString(2).padStart(constants.BITS, '0');\n }\n return this._binaryZeroPad;\n }\n\n /**\n * Groups an IPv4 address for inclusion at the end of an IPv6 address.\n *\n * Returns an HTML fragment: each half of the address is wrapped in a\n * `<span>` carrying the group classes an address-inspector UI hovers on.\n * The address content is HTML-escaped; anything you concatenate around it\n * is your responsibility.\n * @returns {String}\n */\n groupForV6(): string {\n const segments = this.parsedAddress;\n\n return this.correctForm().replace(\n constants.RE_ADDRESS,\n `<span class=\"hover-group group-v4 group-6\">${segments\n .slice(0, 2)\n .join('.')}</span>.<span class=\"hover-group group-v4 group-7\">${segments\n .slice(2, 4)\n .join('.')}</span>`,\n );\n }\n}\n\nconst MULTICAST_V4 = new Address4('224.0.0.0/4');\nconst PRIVATE_V4 = [\n new Address4('10.0.0.0/8'),\n new Address4('172.16.0.0/12'),\n new Address4('192.168.0.0/16'),\n];\nconst LOOPBACK_V4 = new Address4('127.0.0.0/8');\nconst LINK_LOCAL_V4 = new Address4('169.254.0.0/16');\nconst UNSPECIFIED_V4 = new Address4('0.0.0.0/32');\nconst BROADCAST_V4 = new Address4('255.255.255.255/32');\nconst CGNAT_V4 = new Address4('100.64.0.0/10');\nconst DOCUMENTATION_V4 = [\n new Address4('192.0.2.0/24'),\n new Address4('198.51.100.0/24'),\n new Address4('203.0.113.0/24'),\n];\nconst BENCHMARKING_V4 = new Address4('198.18.0.0/15');\nconst RESERVED_V4 = new Address4('240.0.0.0/4');\nconst SPECIAL_PURPOSE_V4 = constants.SPECIAL_PURPOSE.map(([cidr, , reachable]) => ({\n subnet: new Address4(cidr),\n reachable,\n}));\n"]}
1
+ {"version":3,"file":"ipv4.js","sourceRoot":"","sources":["../src/ipv4.ts"],"names":[],"mappings":";AAAA,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,iDAAmC;AACnC,0DAA4C;AAC5C,mDAA+C;AAE/C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAEpD;;;GAGG;AACH,MAAa,QAAQ;IAWnB,YAAY,OAAe;QAT3B,uBAAkB,GAAW,EAAE,CAAC;QAChC,WAAM,GAAW,SAAS,CAAC,MAAM,CAAC;QAClC,kBAAa,GAAa,EAAE,CAAC;QAC7B,iBAAY,GAAW,EAAE,CAAC;QAC1B,WAAM,GAAW,KAAK,CAAC;QACvB,eAAU,GAAW,EAAE,CAAC;QACxB,OAAE,GAAY,IAAI,CAAC;QAmFnB;;;WAGG;QACH,cAAS,GAAG,UAAU,CAAC;QA+YvB;;;;;WAKG;QACH,eAAU,GAAG,MA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,CAAC,EAAE,CAAC,CAAC;aACX,IAAI,CAAC,GAAG,CAAC,SAAS,CACtB,CAAC;IACJ,CAAC;CACF;AAnoBD,4BAmoBC;AAED,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AACjD,MAAM,UAAU,GAAG;IACjB,IAAI,QAAQ,CAAC,YAAY,CAAC;IAC1B,IAAI,QAAQ,CAAC,eAAe,CAAC;IAC7B,IAAI,QAAQ,CAAC,gBAAgB,CAAC;CAC/B,CAAC;AACF,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACrD,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC;AAClD,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAC;AAC/C,MAAM,gBAAgB,GAAG;IACvB,IAAI,QAAQ,CAAC,cAAc,CAAC;IAC5B,IAAI,QAAQ,CAAC,iBAAiB,CAAC;IAC/B,IAAI,QAAQ,CAAC,gBAAgB,CAAC;CAC/B,CAAC;AACF,MAAM,eAAe,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAC;AACtD,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AAChD,MAAM,kBAAkB,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,AAAD,EAAG,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;IACjF,MAAM,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;IAC1B,SAAS;CACV,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable no-param-reassign */\n\nimport * as common from './common';\nimport * as constants from './v4/constants';\nimport { AddressError } from './address-error';\n\nconst isCorrect4 = common.isCorrect(constants.BITS);\n\n/**\n * Represents an IPv4 address\n * @param {string} address - An IPv4 address string\n */\nexport class Address4 {\n address: string;\n addressMinusSuffix: string = '';\n groups: number = constants.GROUPS;\n parsedAddress: string[] = [];\n parsedSubnet: string = '';\n subnet: string = '/32';\n subnetMask: number = 32;\n v4: boolean = true;\n private _binaryZeroPad?: string;\n\n constructor(address: string) {\n this.address = address;\n\n const subnet = constants.RE_SUBNET_STRING.exec(address);\n\n if (subnet) {\n this.parsedSubnet = subnet[0].replace('/', '');\n this.subnetMask = parseInt(this.parsedSubnet, 10);\n this.subnet = `/${this.subnetMask}`;\n\n if (this.subnetMask < 0 || this.subnetMask > constants.BITS) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n address = address.replace(constants.RE_SUBNET_STRING, '');\n }\n\n // Four three-digit octets and three dots: the longest well-formed address\n // is 15 characters. Longer input is rejected before parsing, as Address6\n // does at its own limit.\n const longest = constants.GROUPS * 4 - 1;\n\n if (address.length > longest) {\n throw new AddressError(`IPv4 addresses are at most ${longest} characters.`);\n }\n\n this.addressMinusSuffix = address;\n\n this.parsedAddress = this.parse(address);\n }\n\n /**\n * Returns true if the given string is a valid IPv4 address (with optional\n * CIDR subnet), false otherwise. Host bits in the subnet portion are\n * allowed (e.g. `192.168.1.5/24` is valid); for strict network-address\n * validation compare `correctForm()` to `startAddress().correctForm()`,\n * or use `networkForm()`.\n */\n static isValid(address: string): boolean {\n try {\n // eslint-disable-next-line no-new\n new Address4(address);\n\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Parses an IPv4 address string into its four octet groups and stores the\n * result on `this.parsedAddress`. Called automatically by the constructor;\n * you typically don't need to call it directly. Throws `AddressError` if\n * the input is not a valid IPv4 address.\n */\n parse(address: string) {\n const groups = address.split('.');\n\n // Checked before the general match so the error names the actual problem.\n // Address6 rejects the same notation on its v4-in-v6 path.\n if (groups.some((group) => /^0\\d/.test(group))) {\n throw new AddressError(\"IPv4 addresses can't have leading zeroes.\");\n }\n\n if (!address.match(constants.RE_ADDRESS)) {\n throw new AddressError('Invalid IPv4 address.');\n }\n\n return groups;\n }\n\n /**\n * Returns the address in correct form: octets joined with `.` and any\n * leading zeros stripped (e.g. `192.168.1.1`). For IPv4 this matches the\n * canonical dotted-decimal representation.\n */\n correctForm(): string {\n return this.parsedAddress.map((part) => parseInt(part, 10)).join('.');\n }\n\n /**\n * Returns true if the address is correct, false otherwise\n * @returns {Boolean}\n */\n isCorrect = isCorrect4;\n\n /**\n * Construct an `Address4` from an address and a dotted-decimal subnet\n * mask given as separate strings (e.g. as returned by Node's\n * `os.networkInterfaces()`). Throws `AddressError` if the mask is\n * non-contiguous (e.g. `255.0.255.0`).\n * @example\n * var address = Address4.fromAddressAndMask('192.168.1.1', '255.255.255.0');\n * address.subnetMask; // 24\n */\n static fromAddressAndMask(address: string, mask: string): Address4 {\n const bits = common.prefixLengthFromMask(new Address4(mask).bigInt(), constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from an address and a Cisco-style wildcard mask\n * given as separate strings (e.g. `0.0.0.255` for a `/24`). The wildcard\n * mask is the bitwise inverse of the subnet mask. Throws `AddressError`\n * if the mask is non-contiguous (e.g. `0.255.0.255`).\n * @example\n * var address = Address4.fromAddressAndWildcardMask('10.0.0.1', '0.0.0.255');\n * address.subnetMask; // 24\n */\n static fromAddressAndWildcardMask(address: string, wildcardMask: string): Address4 {\n const wildcard = new Address4(wildcardMask).bigInt();\n const allOnes = (BigInt(1) << BigInt(constants.BITS)) - BigInt(1);\n const mask = wildcard ^ allOnes;\n const bits = common.prefixLengthFromMask(mask, constants.BITS);\n return new Address4(`${address}/${bits}`);\n }\n\n /**\n * Construct an `Address4` from a wildcard pattern with trailing `*`\n * octets. The number of trailing wildcards determines the prefix\n * length: each `*` represents 8 bits.\n *\n * Only trailing whole-octet wildcards are supported. Partial-octet\n * wildcards (e.g. `192.168.0.1*`) and interior wildcards (e.g.\n * `192.*.0.1`) throw `AddressError`.\n * @example\n * Address4.fromWildcard('192.168.0.*').subnet; // '/24'\n * Address4.fromWildcard('192.168.*.*').subnet; // '/16'\n * Address4.fromWildcard('*.*.*.*').subnet; // '/0'\n */\n static fromWildcard(input: string): Address4 {\n const groups = input.split('.');\n\n if (groups.length !== constants.GROUPS) {\n throw new AddressError('Wildcard pattern must have 4 octets');\n }\n\n let firstWildcard = -1;\n\n for (let i = 0; i < groups.length; i++) {\n if (groups[i] === '*') {\n if (firstWildcard === -1) {\n firstWildcard = i;\n }\n } else if (firstWildcard !== -1) {\n throw new AddressError(\n 'Wildcard `*` must only appear in trailing octets (e.g. `192.168.0.*`)',\n );\n }\n }\n\n const trailing = firstWildcard === -1 ? 0 : groups.length - firstWildcard;\n const replaced = groups.map((g) => (g === '*' ? '0' : g));\n const subnetBits = constants.BITS - trailing * 8;\n\n return new Address4(`${replaced.join('.')}/${subnetBits}`);\n }\n\n /**\n * Converts a hex string to an IPv4 address object. Accepts 8 hex digits\n * with optional `:` separators (e.g. `'7f000001'` or `'7f:00:00:01'`).\n * Throws `AddressError` for any other length or for non-hex characters.\n * @param {string} hex - a hex string to convert\n * @returns {Address4}\n */\n static fromHex(hex: string): Address4 {\n const stripped = hex.replace(/:/g, '');\n\n if (!/^[0-9a-fA-F]{8}$/.test(stripped)) {\n throw new AddressError('IPv4 hex must be exactly 8 hex digits');\n }\n\n const groups = [];\n\n for (let i = 0; i < 8; i += 2) {\n groups.push(parseInt(stripped.slice(i, i + 2), 16));\n }\n\n return new Address4(groups.join('.'));\n }\n\n /**\n * Converts an integer into a IPv4 address object. The integer must be a\n * non-negative safe integer in the range `[0, 2**32 - 1]`; otherwise\n * `AddressError` is thrown.\n * @param {integer} integer - a number to convert\n * @returns {Address4}\n */\n static fromInteger(integer: number): Address4 {\n if (!Number.isInteger(integer) || integer < 0 || integer > 0xffffffff) {\n throw new AddressError('IPv4 integer must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(integer.toString(16).padStart(8, '0'));\n }\n\n /**\n * Return an address from in-addr.arpa form: the four octets reversed, with\n * or without the `.in-addr.arpa` suffix and root dot, in any case. Throws\n * `AddressError` unless the reversed labels form a valid IPv4 address, so\n * `fromArpa(x.reverseForm())` round-trips {@link reverseForm}.\n * @param {string} arpaFormAddress - an 'in-addr.arpa' form ipv4 address\n * @returns {Adress4}\n * @example\n * var address = Address4.fromArpa('42.2.0.192.in-addr.arpa.')\n * address.correctForm(); // '192.0.2.42'\n */\n static fromArpa(arpaFormAddress: string): Address4 {\n // A 15-character address, a \"/32\" prefix length and \".in-addr.arpa.\": the\n // longest name is 32 characters. Longer input is rejected before its\n // labels are split, as the constructor does at its own limit.\n const longest = constants.GROUPS * 4 - 1 + '/32'.length + '.in-addr.arpa.'.length;\n\n if (arpaFormAddress.length > longest) {\n throw new AddressError(`in-addr.arpa names are at most ${longest} characters.`);\n }\n\n // remove an ending \".in-addr.arpa\", in any case and with or without the\n // root dot, as Address6.fromArpa does for \".ip6.arpa\"\n const leader = arpaFormAddress.replace(/(\\.in-addr\\.arpa)?\\.?$/i, '');\n\n const address = leader.split('.').reverse().join('.');\n\n return new Address4(address);\n }\n\n /**\n * Converts an IPv4 address object to a hex string\n * @returns {String}\n */\n toHex(): string {\n return this.parsedAddress.map((part) => common.stringToPaddedHex(part)).join(':');\n }\n\n /**\n * Converts an IPv4 address object to an array of bytes.\n *\n * To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toArray())`.\n * @returns {Array}\n */\n toArray(): number[] {\n return this.parsedAddress.map((part) => parseInt(part, 10));\n }\n\n /**\n * Converts an IPv4 address object to an IPv6 address group\n * @returns {String}\n */\n toGroup6(): string {\n const output = [];\n let i;\n\n for (i = 0; i < constants.GROUPS; i += 2) {\n output.push(\n `${common.stringToPaddedHex(this.parsedAddress[i])}${common.stringToPaddedHex(\n this.parsedAddress[i + 1],\n )}`,\n );\n }\n\n return output.join(':');\n }\n\n /**\n * Returns the address as a `bigint`\n * @returns {bigint}\n */\n bigInt(): bigint {\n return BigInt(`0x${this.parsedAddress.map((n) => common.stringToPaddedHex(n)).join('')}`);\n }\n\n /**\n * Helper function getting start address.\n * @returns {bigint}\n */\n _startAddress(): bigint {\n return BigInt(`0b${this.mask() + '0'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The first address in the range given by this address' subnet.\n * Often referred to as the Network Address.\n * @returns {Address4}\n */\n startAddress(): Address4 {\n return Address4.fromBigInt(this._startAddress());\n }\n\n /**\n * The first host address in the range given by this address's subnet ie\n * the first address after the Network Address\n * @returns {Address4}\n */\n startAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._startAddress() + adjust);\n }\n\n /**\n * Returns the address `n` addresses after this one (or before, when `n` is\n * negative), keeping this address's subnet mask. Throws `AddressError` when\n * the result would fall outside the IPv4 address space or `n` is not an\n * integer.\n * @param {number | bigint} n\n * @returns {Address4}\n * @example\n * new Address4('10.0.0.0/24').offset(1).correctForm(); // '10.0.0.1'\n */\n offset(n: number | bigint): Address4 {\n return Address4.fromBigInt(\n common.offsetBigInt(this.bigInt(), n, constants.BITS, 'IPv4'),\n ).withSubnetMask(this.subnetMask);\n }\n\n /**\n * Returns the network that follows this address's network: the address after\n * {@link endAddress}, with the same subnet mask. Throws `AddressError` when\n * this network is the last one in the address space.\n * @returns {Address4}\n * @example\n * new Address4('10.0.0.0/24').nextNetwork().networkForm(); // '10.0.1.0/24'\n */\n nextNetwork(): Address4 {\n return Address4.fromBigInt(\n common.offsetBigInt(this._endAddress(), 1, constants.BITS, 'IPv4'),\n ).withSubnetMask(this.subnetMask);\n }\n\n private withSubnetMask(subnetMask: number): Address4 {\n return new Address4(`${this.correctForm()}/${subnetMask}`);\n }\n\n /**\n * Helper function getting end address.\n * @returns {bigint}\n */\n _endAddress(): bigint {\n return BigInt(`0b${this.mask() + '1'.repeat(constants.BITS - this.subnetMask)}`);\n }\n\n /**\n * The last address in the range given by this address' subnet\n * Often referred to as the Broadcast\n * @returns {Address4}\n */\n endAddress(): Address4 {\n return Address4.fromBigInt(this._endAddress());\n }\n\n /**\n * The last host address in the range given by this address's subnet ie\n * the last address prior to the Broadcast Address\n * @returns {Address4}\n */\n endAddressExclusive(): Address4 {\n const adjust = BigInt('1');\n return Address4.fromBigInt(this._endAddress() - adjust);\n }\n\n /**\n * The dotted-decimal form of the subnet mask, e.g. `255.255.240.0` for\n * a `/20`. Returns an `Address4`; call `.correctForm()` for the string.\n * @returns {Address4}\n */\n subnetMaskAddress(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'1'.repeat(this.subnetMask)}${'0'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The Cisco-style wildcard mask, e.g. `0.0.0.255` for a `/24`. This is\n * the bitwise inverse of `subnetMaskAddress()`. Returns an `Address4`;\n * call `.correctForm()` for the string.\n * @returns {Address4}\n */\n wildcardMask(): Address4 {\n return Address4.fromBigInt(\n BigInt(`0b${'0'.repeat(this.subnetMask)}${'1'.repeat(constants.BITS - this.subnetMask)}`),\n );\n }\n\n /**\n * The network address in CIDR string form, e.g. `192.168.1.0/24` for\n * `192.168.1.5/24`. For an address with no explicit subnet the prefix is\n * `/32`, e.g. `networkForm()` on `192.168.1.5` returns `192.168.1.5/32`.\n * @returns {string}\n */\n networkForm(): string {\n return `${this.startAddress().correctForm()}/${this.subnetMask}`;\n }\n\n /**\n * Converts a BigInt to a v4 address object. The value must be in the\n * range `[0, 2**32 - 1]`; otherwise `AddressError` is thrown.\n * @param {bigint} bigInt - a BigInt to convert\n * @returns {Address4}\n */\n static fromBigInt(bigInt: bigint): Address4 {\n if (bigInt < BigInt(0) || bigInt > BigInt(0xffffffff)) {\n throw new AddressError('IPv4 BigInt must be in the range 0 to 2**32 - 1');\n }\n\n return Address4.fromHex(bigInt.toString(16).padStart(8, '0'));\n }\n\n /**\n * Convert a byte array to an Address4 object. Throws `AddressError` unless\n * given exactly 4 integers from 0 to 255. Signed bytes are rejected, so\n * this differs from `Address6.fromByteArray`, which folds them; the two\n * contracts converge on this stricter form in the next major version.\n *\n * To convert from a Node.js `Buffer`, spread it: `Address4.fromByteArray([...buf])`.\n * @param {Array<number>} bytes - an array of 4 bytes (0-255)\n * @returns {Address4}\n */\n static fromByteArray(bytes: Array<number>): Address4 {\n common.assertByteArray(bytes, 4, 'IPv4', 0);\n\n return this.fromUnsignedByteArray(bytes);\n }\n\n /**\n * Convert an unsigned byte array to an Address4 object. Throws\n * `AddressError` unless given exactly 4 bytes, and rejects values outside\n * 0 to 255 when parsing the resulting address.\n *\n * To convert from a Node.js `Buffer`, spread it:\n * `Address4.fromUnsignedByteArray([...buf])`.\n * @param {Array<number>} bytes - an array of 4 unsigned bytes (0-255)\n * @returns {Address4}\n */\n static fromUnsignedByteArray(bytes: Array<number>): Address4 {\n if (bytes.length !== 4) {\n throw new AddressError('IPv4 addresses require exactly 4 bytes');\n }\n\n const address = bytes.join('.');\n return new Address4(address);\n }\n\n /**\n * Returns the first n bits of the address, defaulting to the\n * subnet mask\n * @returns {String}\n */\n mask(mask?: number): string {\n if (mask === undefined) {\n mask = this.subnetMask;\n }\n\n return this.getBitsBase2(0, mask);\n }\n\n /**\n * Returns the bits in the given range as a base-2 string\n * @returns {string}\n */\n getBitsBase2(start: number, end: number): string {\n return this.binaryZeroPad().slice(start, end);\n }\n\n /**\n * Return the reversed in-addr.arpa form of the address, e.g.\n * `42.2.0.192.in-addr.arpa.` for `192.0.2.42`.\n * @param {Object} options\n * @param {boolean} options.omitSuffix - omit the \"in-addr.arpa\" suffix\n * @returns {String}\n */\n reverseForm(options?: common.ReverseFormOptions): string {\n if (!options) {\n options = {};\n }\n\n const reversed = this.correctForm().split('.').reverse().join('.');\n\n if (options.omitSuffix) {\n return reversed;\n }\n\n return `${reversed}.in-addr.arpa.`;\n }\n\n /**\n * Returns true if the given address is in the subnet of the current address.\n * An `Address6` is never in the subnet of an `Address4`; convert with\n * `to4()` or `Address6.fromAddress4()` to compare across families.\n * @returns {boolean}\n */\n isInSubnet = common.isInSubnet;\n\n /**\n * Returns true if this address's host bits fall inside the given subnet,\n * ignoring this address's own subnet mask. Prefer this over `isInSubnet`\n * when classifying a single address, so the answer doesn't change with the\n * CIDR suffix the caller happened to write — notably when the address came\n * from untrusted input and the result backs a trust-boundary decision.\n * An `Address6` is never in the subnet of an `Address4`; convert with\n * `to4()` or `Address6.fromAddress4()` to compare across families.\n * @returns {boolean}\n */\n isHostInSubnet = common.isHostInSubnet;\n\n /**\n * Returns true if the given address is a multicast address\n * @returns {boolean}\n */\n isMulticast(): boolean {\n return this.isHostInSubnet(MULTICAST_V4);\n }\n\n /**\n * Returns true if the address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private address ranges (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`).\n * @returns {boolean}\n */\n isPrivate(): boolean {\n return PRIVATE_V4.some((subnet) => this.isHostInSubnet(subnet));\n }\n\n /**\n * Returns true if the address is in the loopback range `127.0.0.0/8` ([RFC 1122](https://datatracker.ietf.org/doc/html/rfc1122)).\n * @returns {boolean}\n */\n isLoopback(): boolean {\n return this.isHostInSubnet(LOOPBACK_V4);\n }\n\n /**\n * Returns true if the address is in the link-local range `169.254.0.0/16` ([RFC 3927](https://datatracker.ietf.org/doc/html/rfc3927)).\n * @returns {boolean}\n */\n isLinkLocal(): boolean {\n return this.isHostInSubnet(LINK_LOCAL_V4);\n }\n\n /**\n * Returns true if the address is the unspecified address `0.0.0.0`.\n * @returns {boolean}\n */\n isUnspecified(): boolean {\n return this.isHostInSubnet(UNSPECIFIED_V4);\n }\n\n /**\n * Returns true if the address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)).\n * @returns {boolean}\n */\n isBroadcast(): boolean {\n return this.isHostInSubnet(BROADCAST_V4);\n }\n\n /**\n * Returns true if the address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)).\n * @returns {boolean}\n */\n isCGNAT(): boolean {\n return this.isHostInSubnet(CGNAT_V4);\n }\n\n /**\n * Returns true if the address is in one of the documentation ranges\n * `192.0.2.0/24`, `198.51.100.0/24`, or `203.0.113.0/24` ([RFC 5737](https://datatracker.ietf.org/doc/html/rfc5737)).\n * @returns {boolean}\n */\n isDocumentation(): boolean {\n return DOCUMENTATION_V4.some((subnet) => this.isHostInSubnet(subnet));\n }\n\n /**\n * Returns true if the address is in the benchmarking range `198.18.0.0/15` ([RFC 2544](https://datatracker.ietf.org/doc/html/rfc2544)).\n * @returns {boolean}\n */\n isBenchmarking(): boolean {\n return this.isHostInSubnet(BENCHMARKING_V4);\n }\n\n /**\n * Returns true if the address is in the reserved range `240.0.0.0/4` ([RFC 1112](https://datatracker.ietf.org/doc/html/rfc1112)),\n * which includes the limited broadcast address.\n * @returns {boolean}\n */\n isReserved(): boolean {\n return this.isHostInSubnet(RESERVED_V4);\n }\n\n /**\n * Returns true if the address is globally reachable: not multicast, and not\n * in any block the [IANA IPv4 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv4-special-registry/)\n * marks as not globally reachable. That covers everything the individual\n * classifiers name (private, loopback, link-local, CGNAT, unspecified,\n * broadcast, documentation, benchmarking, reserved) and the blocks they do\n * not, such as `0.0.0.0/8` and the IETF protocol assignments in\n * `192.0.0.0/24`. This is the single predicate to use where a request must\n * not reach an internal or special-purpose destination; see SECURITY.md.\n * @returns {boolean}\n */\n isGlobal(): boolean {\n return !this.isMulticast() && common.isGloballyReachable.call(this, SPECIAL_PURPOSE_V4);\n }\n\n /**\n * Returns a zero-padded base-2 string representation of the address\n * @returns {string}\n */\n binaryZeroPad(): string {\n if (this._binaryZeroPad === undefined) {\n this._binaryZeroPad = this.bigInt().toString(2).padStart(constants.BITS, '0');\n }\n return this._binaryZeroPad;\n }\n\n /**\n * Groups an IPv4 address for inclusion at the end of an IPv6 address.\n *\n * Returns an HTML fragment: each half of the address is wrapped in a\n * `<span>` carrying the group classes an address-inspector UI hovers on.\n * The address content is HTML-escaped; anything you concatenate around it\n * is your responsibility.\n * @returns {String}\n */\n groupForV6(): string {\n const segments = this.parsedAddress;\n\n return this.correctForm().replace(\n constants.RE_ADDRESS,\n `<span class=\"hover-group group-v4 group-6\">${segments\n .slice(0, 2)\n .join('.')}</span>.<span class=\"hover-group group-v4 group-7\">${segments\n .slice(2, 4)\n .join('.')}</span>`,\n );\n }\n}\n\nconst MULTICAST_V4 = new Address4('224.0.0.0/4');\nconst PRIVATE_V4 = [\n new Address4('10.0.0.0/8'),\n new Address4('172.16.0.0/12'),\n new Address4('192.168.0.0/16'),\n];\nconst LOOPBACK_V4 = new Address4('127.0.0.0/8');\nconst LINK_LOCAL_V4 = new Address4('169.254.0.0/16');\nconst UNSPECIFIED_V4 = new Address4('0.0.0.0/32');\nconst BROADCAST_V4 = new Address4('255.255.255.255/32');\nconst CGNAT_V4 = new Address4('100.64.0.0/10');\nconst DOCUMENTATION_V4 = [\n new Address4('192.0.2.0/24'),\n new Address4('198.51.100.0/24'),\n new Address4('203.0.113.0/24'),\n];\nconst BENCHMARKING_V4 = new Address4('198.18.0.0/15');\nconst RESERVED_V4 = new Address4('240.0.0.0/4');\nconst SPECIAL_PURPOSE_V4 = constants.SPECIAL_PURPOSE.map(([cidr, , reachable]) => ({\n subnet: new Address4(cidr),\n reachable,\n}));\n"]}
@@ -16,7 +16,7 @@
16
16
  "bigint",
17
17
  "browser"
18
18
  ],
19
- "version": "10.7.2",
19
+ "version": "10.7.3",
20
20
  "author": "Beau Gunderson <beau@beaugunderson.com> (https://beaugunderson.com/)",
21
21
  "license": "MIT",
22
22
  "main": "dist/ip-address.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withbuddi/buddi",
3
- "version": "0.1.0-pre.29",
3
+ "version": "0.1.0-pre.31",
4
4
  "type": "module",
5
5
  "description": "Your personal agents, on your computer",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "buddi": "packages/install/dist/launcher.js"
18
18
  },
19
19
  "buddi": {
20
- "notes": "### Added\n\n- Widgets on Home: small live panels from your plugins — the weather at home, today's calendar, who is waiting on your reply — in a Widgets section under Needs you. Pick, order and size them (small or medium) from Edit, by dragging, with the arrow keys or with the move buttons; a widget's ⋯ menu moves, resizes or hides it, with Undo. A widget that fails to refresh keeps its last panel and says how old it is, one that never loaded offers Try again, and a sensitive one is hidden until you show it. The layout is kept by the installation, so your phone shows what your laptop arranged.\n- Widgets have settings of their own: each one on Home (and on the lock screen) can be set apart — the weather's place and units, which calendars and how far ahead, which mailbox, a time format — from Settings… in its ⋯ menu or the gear in Edit, in a sheet that shows it live. The same widget can sit twice (\"Weather\" and \"Weather · Work\"): Add another in Edit.\n- Plugins can export widgets (plugin host API 1.17): a manifest's `widgets`, each a read-only `produce` answering a body from a fixed vocabulary — stat, list, strip, progress, text — that buddi caches for the widget's refresh interval and gives five seconds. The bundled mail plugin adds \"Waiting on you\".\n- Plugin host API 1.19: a widget's settings schema (select, multi-select, toggle, text, place, time format), handed to `produce` resolved; `owner.formats()`; the tile icons `check` and `clock`.\n- The World clock, a widget buddi provides itself: the time at your places in other zones, or towns you pick.\n- The World clock has a Style: Digital, as before, or Analog — faces side by side like a phone's world clock widget, your own zone first and then your places, four at medium and two at small, with hour and minute hands and a thin accent second hand; a face is light while it is day there and dark at night, and under each sit the place, Today, Tomorrow or Yesterday, and the offset (\"+6 h\", \"−1 h 30\", \"Here\"). The faces tick on the page and stop their second hand under reduced motion; on the lock screen they are glass like the tiles. Each face is read aloud as \"Tokyo, 04:05 tomorrow, 8 hours ahead\".\n- Plugin host API 1.21: a widget can answer a `clocks` body — the owner's zone and up to four faces, each a label and an IANA zone — and the page draws and ticks the analog faces itself.\n- A PIN for the dashboard, kept on the server: once you set one, a dashboard session locks after a delay nobody used it for (5 minutes unless you pick 1, 15, 60 or never) or when you lock it, and every API call but the lock screen's own is refused until the PIN is typed — on every device, a remote one included. A new browser session starts locked, five wrong PINs bring a wait that doubles, and `buddi mcp` and Telegram are not covered. Forgot it: `buddi dashboard --unlock` opens the dashboard past it once (with a link for your other devices), `buddi dashboard --remove-pin` removes it.\n- The lock screen: the date and time large, counts of approvals and notifications waiting, your focus, up to four of your widgets (never a sensitive one) and the PIN, on the background you pick (five built-in ones or your own picture), with a pad on a phone. Nothing of the dashboard is drawn under it. Set it up in Settings → Lock screen; lock from the owner menu, the padlock at the end of the status line, or ⌃⌘L (Ctrl+Alt+L off a Mac). Forgot PIN? on the lock screen says what to run.\n- The lock screen keeps its own widgets, apart from Home's, and its own clock: in Settings → Lock screen → What it shows, a live preview beside the time format, the date style, a second clock (one of your places or any town) and up to four widgets, each with its own settings.\n- A tip on Home, \"Lock buddi with a PIN\", while no PIN is set and once there is something to lock — a second device signed in, a mailbox or money connected, or a week of use; it opens Settings → Lock screen, and dismissing it silences it for good.\n- On a phone, the status dot's menu ends with Lock now while a PIN is set, as the footer's padlock does on a wider screen.\n- Screenshots of the lock screen (desk and phone) and of Home with widgets in the README and docs/dashboard.md, from a demo installation.\n- Places in Settings → Profile: Home and Work (offered until you set them) and any other place you name, each with its address, the town it was found as on Open-Meteo, coordinates and its timezone. The front desk knows them, and plugins you allow can read them. The weather plugin's Home and Work move here once, at the first start.\n- Time and Dates in Settings → Profile: Auto (from the browser), 12-hour or 24-hour, and \"Thu, Oct 1\", \"Thursday, 1 October\" or 2026-10-01. Every date and time on the dashboard — Home, the lock screen, the status line, the calendar, tables — reads that way, and agents write them that way too.\n- Plugin host API 1.18: `ctx.buddi.owner.places()` behind the `owner:places` grant (shown on the install card), a manifest's `setup` answer, `requires` (repeated as `buddi.requires`), and `exports` — named read-only queries another plugin that requires it may call through `ctx.buddi.plugins.call`, on the read-only pool, with a timeout, never a tool.\n- A plugin that cannot do anything yet says so: its row on the Plugins page reads \"needs setup\" with what to do first and a Set it up button, the notice after the restart that loads it says the same, and a Home tip can name it.\n- A plugin can require another (`requires`, with a version range): the install card lists each requirement and offers \"Install … first\" for a missing one, and until each is installed, enabled, in range and set up the plugin waits — \"needs weather\" on its row, with the one fix — its tools and widgets off and its data kept. It comes in by itself the moment its requirement is ready.\n- A plugin installed from a folder can be reinstalled from it at the same version: \"Reinstall from folder\" in its row's menu and its detail, and `buddi plugins update <name>`, read and approved like any update, the card saying it is the same version read again.\n- A watcher's wakes can be gathered into one run: a sentinel that sets `coalesce` (plugin host API 1.20) has its wakes for the same agent folded together — the first waits two minutes for company, each that follows pushes it back by two more, none waits past ten — and the agent reads every finding in one run and sends one message. Finance's watchers do, so a bad week is one word from Ledger instead of one per card and bill. The wake mission can also be told to coalesce for every watcher.\n- Owner API tokens, for using buddi from a script or another program without the dashboard: make one in Settings → API tokens or with `buddi api-token create <name>` (shown once, kept only as a SHA-256 fingerprint), send it as `Authorization: Bearer <token>`, list and revoke them in Settings or with `buddi api-token list|revoke`. A token acts as you but never approves anything, writes through a plugin page only by asking (an approval card, never a tool that runs at once), changes an agent's grants, installs code, changes how buddi is reached or unlocked, or reads a secret; a wrong or revoked one counts as a failed sign-in, and the lock screen does not cover it.\n- docs/api.md, the HTTP API reference: every route the dashboard uses (255 of them) by area, with what it takes, what it answers, how it fails, since when, whether an API token may call it and a curl line, plus the base URL, how to authenticate, the error format and the sign-in lockout. Generated from the gateway's route table by `pnpm docs:api`; a test fails when a route has no entry or the page is behind.\n\n…"
20
+ "notes": "### Added\n\n- The buddi extension is on the Chrome Web Store. Computer & browser → Your browser now leads with Add to Chrome (the store listing, in a new tab) and folds the load-unpacked folder under Developer install; Firefox and Safari are told it needs Chrome, Edge, Brave or Arc, and a phone leaves the install out. The dashboard finds and pairs a store-installed extension exactly like the unpacked one.\n- Plugins (host API 1.24): `owner.notify` takes an optional `action`, what the owner is asked to do in at most 80 characters, like an agent's. A plugin's message with one waits in Needs you and counts on every badge; without one it stays information.\n- Plugins (host API 1.24): a `clocks` widget body's faces take optional `latitude` and `longitude`; with them a face is light from sunrise to sunset there.\n\n### Fixed\n\n- Profile: a reload of the same profile no longer wipes Time or Dates you were changing.\n- Home: Done on a Needs you card now sticks. A line held for the end of the day (like \"buddi learned 1 rule: quieted 1 newsletter\") showed in Needs you even after Done and came back on every reload; Needs you now lists only what asks for you now, quiet lines stay in Notifications → Recent and the evening message, and a quiet line that says more later stays read instead of coming back unread.\n- Needs you: a message updated with a new or changed request comes back unseen even when it is not urgent, instead of staying marked as read; the same request sent again stays read.\n- Telegram: the end-of-day message and the one after Do not disturb now say what each item asks of you (\"→ Charged twice: Confirm with the bank?\"), not just its title.\n- Needs you: a request that asks for something waits until you open it, mark it Done or act on it, however long you were away; it no longer drops out after a week.\n- Needs you counts every pending approval, not the first 50, and an agent already waiting for your approval is no longer counted a second time as one to set up when more than 50 approvals are pending.\n- Home: closing several notices at once, or closing one while hiding a glance, keeps every change; one could undo another and come back after a reload.\n- Home: a plugin's card is named by its page (\"Mail\"), not its id (\"email\").\n- Mail: a conversation you archive, label or delete in another mail app (or with a change you approved) no longer says \"Waiting on you\" — on the Mail page, the Waiting on you widget, the waiting watcher and `email.select_messages` alike. Moved back into the inbox, it waits on you again.\n- Schedules follow your timezone. A mission, a recurring reminder or an agent's schedule made without naming a zone now moves when you change the timezone in Settings → Profile, so its next run stays 8 AM where you are — including buddi's own missions made before 0.1.0-pre.29 (a plugin's default missions, the learning digest, an accepted agent's missions), which kept their old zone; any other older schedule keeps its zone, since buddi cannot tell whether it was named on purpose. One whose zone was named on purpose (by the agent, the plugin or you) keeps it. Missions say \"follows your timezone\" instead of the zone.\n- The World clock's analog faces are light from sunrise to sunset at each place, worked out from the place's coordinates, not from 6:00 to 18:00 — a face for a town without coordinates still uses 6 to 18.\n- `buddi doctor` in an installed buddi says which timezone is in use and where it comes from (Settings → Profile, `BUDDI_TZ` or the default), as the checkout's doctor does; both also name this machine's zone when it differs.\n\n### Changed\n\n- The npm page is a product page: what buddi is, the one-line install, screenshots, privacy and links. The repository README is now the developer guide.\n- `buddi status` counts what needs you by the dashboard's rule (the same count as Home, the rail's badge and the lock screen) and says \"3 things need you\", not just approvals and questions. In `--json`, `needsYou` keeps its `approvals` and `questions` and adds `total`, that count.\n- Needs you holds only what you can act on: approvals, the watchers' urgent decisions, a question an agent is holding for your answer (now listed, opening its conversation), a message that carries an action, failed jobs, proposals, a connection to sign in to again or review (moved into Needs you), an agent a plugin needs and a restore's checklist. A mission's report, an agent's plain message and a reminder that fired still reach you on your channel and are listed in Settings → Notifications → Recent (\"All notifications\" on the section), but no longer sit in Needs you or count anywhere. Home's counts, the badge on Home in the rail (which counted approvals and failed jobs only) and the lock screen (which counted every unseen notification, now \"N more need you\" opening Needs you) all read one count, `needsYou` on `GET /api/overview`; `GET /api/notifications?needs=1` lists the messages, each row says `needsOwner`. A watcher's or source's error moved above Needs you.\n- `owner.notify` takes `action`: what the owner is asked to do, in a few words (\"Confirm with the bank?\"). With it the message waits in Needs you until opened or marked done, and Telegram shows the ask as its last line; without it the message is information. The MCP overview's `needsYou` is the same count (the per-agent list is `waiting`).\n- Home: \"What buddi learned this week\" reads like a person wrote it — one line per kind with one place to look (\"Remembered 18 things · See memory\", \"Quieted 26 senders · See rules\", \"Kept 2 skills: …\", \"Your rules handled 436 emails\") — with no raw rule lists, no cut-off notes and no empty sections. It shows for three days after the digest runs and × hides it until next week's. The Telegram digest says the same lines.\n- Home: every notice and section can be closed and stays closed across reloads and browsers — the upgrade notice until the next version, a connection's or a watcher's or source's error until it changes, a plugin's section until shown again in Settings → Appearance → Home sections. `POST /api/home/dismiss`."
21
21
  },
22
22
  "files": [
23
23
  "packages",