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

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 (455) hide show
  1. package/extension/manifest.json +2 -2
  2. package/node_modules/@buddi/cli/dist/.tsbuildinfo +1 -1
  3. package/node_modules/@buddi/cli/dist/args.d.ts +6 -1
  4. package/node_modules/@buddi/cli/dist/args.d.ts.map +1 -1
  5. package/node_modules/@buddi/cli/dist/args.js +7 -2
  6. package/node_modules/@buddi/cli/dist/args.js.map +1 -1
  7. package/node_modules/@buddi/cli/dist/commands.d.ts.map +1 -1
  8. package/node_modules/@buddi/cli/dist/commands.js +13 -3
  9. package/node_modules/@buddi/cli/dist/commands.js.map +1 -1
  10. package/node_modules/@buddi/cli/dist/doctor-probes.d.ts.map +1 -1
  11. package/node_modules/@buddi/cli/dist/doctor-probes.js +2 -1
  12. package/node_modules/@buddi/cli/dist/doctor-probes.js.map +1 -1
  13. package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts +4 -0
  14. package/node_modules/@buddi/cli/dist/jobs-cmd.d.ts.map +1 -1
  15. package/node_modules/@buddi/cli/dist/jobs-cmd.js +53 -4
  16. package/node_modules/@buddi/cli/dist/jobs-cmd.js.map +1 -1
  17. package/node_modules/@buddi/cli/dist/main.d.ts.map +1 -1
  18. package/node_modules/@buddi/cli/dist/main.js +5 -1
  19. package/node_modules/@buddi/cli/dist/main.js.map +1 -1
  20. package/node_modules/@buddi/core/dist/.tsbuildinfo +1 -1
  21. package/node_modules/@buddi/core/dist/lock.d.ts +8 -2
  22. package/node_modules/@buddi/core/dist/lock.d.ts.map +1 -1
  23. package/node_modules/@buddi/core/dist/lock.js +20 -5
  24. package/node_modules/@buddi/core/dist/lock.js.map +1 -1
  25. package/node_modules/@buddi/core/dist/pages.d.ts +3 -1
  26. package/node_modules/@buddi/core/dist/pages.d.ts.map +1 -1
  27. package/node_modules/@buddi/core/dist/pages.js +6 -1
  28. package/node_modules/@buddi/core/dist/pages.js.map +1 -1
  29. package/node_modules/@buddi/core/dist/plugin/index.d.ts +1 -1
  30. package/node_modules/@buddi/core/dist/plugin/index.d.ts.map +1 -1
  31. package/node_modules/@buddi/core/dist/plugin/index.js.map +1 -1
  32. package/node_modules/@buddi/core/dist/plugin/version.d.ts +1 -1
  33. package/node_modules/@buddi/core/dist/plugin/version.js +1 -1
  34. package/node_modules/@buddi/core/dist/queue/failures.d.ts +84 -0
  35. package/node_modules/@buddi/core/dist/queue/failures.d.ts.map +1 -0
  36. package/node_modules/@buddi/core/dist/queue/failures.js +195 -0
  37. package/node_modules/@buddi/core/dist/queue/failures.js.map +1 -0
  38. package/node_modules/@buddi/core/dist/queue/index.d.ts +1 -0
  39. package/node_modules/@buddi/core/dist/queue/index.d.ts.map +1 -1
  40. package/node_modules/@buddi/core/dist/queue/index.js +1 -0
  41. package/node_modules/@buddi/core/dist/queue/index.js.map +1 -1
  42. package/node_modules/@buddi/core/dist/queue/jobs.d.ts +39 -3
  43. package/node_modules/@buddi/core/dist/queue/jobs.d.ts.map +1 -1
  44. package/node_modules/@buddi/core/dist/queue/jobs.js +54 -4
  45. package/node_modules/@buddi/core/dist/queue/jobs.js.map +1 -1
  46. package/node_modules/@buddi/core/dist/queue/types.d.ts +20 -0
  47. package/node_modules/@buddi/core/dist/queue/types.d.ts.map +1 -1
  48. package/node_modules/@buddi/core/dist/queue/types.js +17 -0
  49. package/node_modules/@buddi/core/dist/queue/types.js.map +1 -1
  50. package/node_modules/@buddi/core/dist/secrets/settings.d.ts.map +1 -1
  51. package/node_modules/@buddi/core/dist/secrets/settings.js +23 -3
  52. package/node_modules/@buddi/core/dist/secrets/settings.js.map +1 -1
  53. package/node_modules/@buddi/core/dist/sentinels/digest.d.ts +8 -1
  54. package/node_modules/@buddi/core/dist/sentinels/digest.d.ts.map +1 -1
  55. package/node_modules/@buddi/core/dist/sentinels/digest.js +10 -3
  56. package/node_modules/@buddi/core/dist/sentinels/digest.js.map +1 -1
  57. package/node_modules/@buddi/core/dist/sentinels/index.d.ts +1 -0
  58. package/node_modules/@buddi/core/dist/sentinels/index.d.ts.map +1 -1
  59. package/node_modules/@buddi/core/dist/sentinels/index.js +1 -0
  60. package/node_modules/@buddi/core/dist/sentinels/index.js.map +1 -1
  61. package/node_modules/@buddi/core/dist/sentinels/mutes.d.ts +51 -0
  62. package/node_modules/@buddi/core/dist/sentinels/mutes.d.ts.map +1 -0
  63. package/node_modules/@buddi/core/dist/sentinels/mutes.js +86 -0
  64. package/node_modules/@buddi/core/dist/sentinels/mutes.js.map +1 -0
  65. package/node_modules/@buddi/core/dist/sentinels/run.d.ts +14 -4
  66. package/node_modules/@buddi/core/dist/sentinels/run.d.ts.map +1 -1
  67. package/node_modules/@buddi/core/dist/sentinels/run.js +64 -20
  68. package/node_modules/@buddi/core/dist/sentinels/run.js.map +1 -1
  69. package/node_modules/@buddi/core/dist/sentinels/types.d.ts +152 -2
  70. package/node_modules/@buddi/core/dist/sentinels/types.d.ts.map +1 -1
  71. package/node_modules/@buddi/core/dist/sentinels/types.js +126 -2
  72. package/node_modules/@buddi/core/dist/sentinels/types.js.map +1 -1
  73. package/node_modules/@buddi/core/dist/views.d.ts +112 -112
  74. package/node_modules/@buddi/core/dist/views.d.ts.map +1 -1
  75. package/node_modules/@buddi/core/dist/views.js +2 -0
  76. package/node_modules/@buddi/core/dist/views.js.map +1 -1
  77. package/node_modules/@buddi/core/migrations/066_alert_decisions.sql +45 -0
  78. package/node_modules/@buddi/core/migrations/067_job_acknowledged.sql +21 -0
  79. package/node_modules/@buddi/gateway/dist/.tsbuildinfo +1 -1
  80. package/node_modules/@buddi/gateway/dist/chat/conversations.d.ts.map +1 -1
  81. package/node_modules/@buddi/gateway/dist/chat/conversations.js +8 -2
  82. package/node_modules/@buddi/gateway/dist/chat/conversations.js.map +1 -1
  83. package/node_modules/@buddi/gateway/dist/missions/execute.d.ts.map +1 -1
  84. package/node_modules/@buddi/gateway/dist/missions/execute.js +36 -2
  85. package/node_modules/@buddi/gateway/dist/missions/execute.js.map +1 -1
  86. package/node_modules/@buddi/gateway/dist/missions/goals.d.ts +12 -1
  87. package/node_modules/@buddi/gateway/dist/missions/goals.d.ts.map +1 -1
  88. package/node_modules/@buddi/gateway/dist/missions/goals.js +21 -1
  89. package/node_modules/@buddi/gateway/dist/missions/goals.js.map +1 -1
  90. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.d.ts +3 -0
  91. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.d.ts.map +1 -1
  92. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.js +4 -1
  93. package/node_modules/@buddi/gateway/dist/missions/sentinel-wake.js.map +1 -1
  94. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.d.ts +17 -0
  95. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.d.ts.map +1 -1
  96. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.js +27 -0
  97. package/node_modules/@buddi/gateway/dist/surfaces/offered-actions.js.map +1 -1
  98. package/node_modules/@buddi/gateway/dist/web/alerts.d.ts +179 -0
  99. package/node_modules/@buddi/gateway/dist/web/alerts.d.ts.map +1 -0
  100. package/node_modules/@buddi/gateway/dist/web/alerts.js +363 -0
  101. package/node_modules/@buddi/gateway/dist/web/alerts.js.map +1 -0
  102. package/node_modules/@buddi/gateway/dist/web/api-routes.d.ts.map +1 -1
  103. package/node_modules/@buddi/gateway/dist/web/api-routes.js +45 -6
  104. package/node_modules/@buddi/gateway/dist/web/api-routes.js.map +1 -1
  105. package/node_modules/@buddi/gateway/dist/web/chat.d.ts +1 -0
  106. package/node_modules/@buddi/gateway/dist/web/chat.d.ts.map +1 -1
  107. package/node_modules/@buddi/gateway/dist/web/chat.js +4 -3
  108. package/node_modules/@buddi/gateway/dist/web/chat.js.map +1 -1
  109. package/node_modules/@buddi/gateway/dist/web/lock.d.ts +7 -4
  110. package/node_modules/@buddi/gateway/dist/web/lock.d.ts.map +1 -1
  111. package/node_modules/@buddi/gateway/dist/web/lock.js +20 -14
  112. package/node_modules/@buddi/gateway/dist/web/lock.js.map +1 -1
  113. package/node_modules/@buddi/gateway/dist/web/plugins.d.ts.map +1 -1
  114. package/node_modules/@buddi/gateway/dist/web/plugins.js +17 -3
  115. package/node_modules/@buddi/gateway/dist/web/plugins.js.map +1 -1
  116. package/node_modules/@buddi/gateway/dist/web/read.d.ts +52 -26
  117. package/node_modules/@buddi/gateway/dist/web/read.d.ts.map +1 -1
  118. package/node_modules/@buddi/gateway/dist/web/read.js +52 -36
  119. package/node_modules/@buddi/gateway/dist/web/read.js.map +1 -1
  120. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts +61 -1
  121. package/node_modules/@buddi/gateway/dist/web/secrets.d.ts.map +1 -1
  122. package/node_modules/@buddi/gateway/dist/web/secrets.js +111 -3
  123. package/node_modules/@buddi/gateway/dist/web/secrets.js.map +1 -1
  124. package/node_modules/@buddi/gateway/dist/web/server.d.ts.map +1 -1
  125. package/node_modules/@buddi/gateway/dist/web/server.js +125 -9
  126. package/node_modules/@buddi/gateway/dist/web/server.js.map +1 -1
  127. package/node_modules/@buddi/gateway/dist/web/widgets.d.ts +1 -0
  128. package/node_modules/@buddi/gateway/dist/web/widgets.d.ts.map +1 -1
  129. package/node_modules/@buddi/gateway/dist/web/widgets.js +6 -1
  130. package/node_modules/@buddi/gateway/dist/web/widgets.js.map +1 -1
  131. package/node_modules/@buddi/gateway/dist/web/write.d.ts +23 -0
  132. package/node_modules/@buddi/gateway/dist/web/write.d.ts.map +1 -1
  133. package/node_modules/@buddi/gateway/dist/web/write.js +46 -1
  134. package/node_modules/@buddi/gateway/dist/web/write.js.map +1 -1
  135. package/node_modules/@buddi/install/dist/.tsbuildinfo +1 -1
  136. package/node_modules/@buddi/runtime/dist/.tsbuildinfo +1 -1
  137. package/node_modules/@buddi/runtime/dist/anthropic.d.ts +6 -0
  138. package/node_modules/@buddi/runtime/dist/anthropic.d.ts.map +1 -1
  139. package/node_modules/@buddi/runtime/dist/anthropic.js.map +1 -1
  140. package/node_modules/@buddi/runtime/dist/openai.d.ts +34 -1
  141. package/node_modules/@buddi/runtime/dist/openai.d.ts.map +1 -1
  142. package/node_modules/@buddi/runtime/dist/openai.js +66 -12
  143. package/node_modules/@buddi/runtime/dist/openai.js.map +1 -1
  144. package/node_modules/@buddi/tool-artifacts/dist/.tsbuildinfo +1 -1
  145. package/node_modules/@buddi/tool-browser/dist/.tsbuildinfo +1 -1
  146. package/node_modules/@buddi/tool-email/dist/.tsbuildinfo +1 -1
  147. package/node_modules/@buddi/tool-email/dist/agent.js +1 -1
  148. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.d.ts +8 -0
  149. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.d.ts.map +1 -1
  150. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.js +59 -4
  151. package/node_modules/@buddi/tool-email/dist/imap/imapflow-client.js.map +1 -1
  152. package/node_modules/@buddi/tool-email/dist/mail.d.ts +42 -0
  153. package/node_modules/@buddi/tool-email/dist/mail.d.ts.map +1 -1
  154. package/node_modules/@buddi/tool-email/dist/mail.js +116 -0
  155. package/node_modules/@buddi/tool-email/dist/mail.js.map +1 -1
  156. package/node_modules/@buddi/tool-email/dist/mailbox/select.d.ts +6 -0
  157. package/node_modules/@buddi/tool-email/dist/mailbox/select.d.ts.map +1 -1
  158. package/node_modules/@buddi/tool-email/dist/mailbox/select.js +11 -0
  159. package/node_modules/@buddi/tool-email/dist/mailbox/select.js.map +1 -1
  160. package/node_modules/@buddi/tool-email/dist/metrics.d.ts +5 -6
  161. package/node_modules/@buddi/tool-email/dist/metrics.d.ts.map +1 -1
  162. package/node_modules/@buddi/tool-email/dist/metrics.js +4 -5
  163. package/node_modules/@buddi/tool-email/dist/metrics.js.map +1 -1
  164. package/node_modules/@buddi/tool-email/dist/needs-you.d.ts +58 -0
  165. package/node_modules/@buddi/tool-email/dist/needs-you.d.ts.map +1 -0
  166. package/node_modules/@buddi/tool-email/dist/needs-you.js +97 -0
  167. package/node_modules/@buddi/tool-email/dist/needs-you.js.map +1 -0
  168. package/node_modules/@buddi/tool-email/dist/pages/descriptors.d.ts.map +1 -1
  169. package/node_modules/@buddi/tool-email/dist/pages/descriptors.js +110 -78
  170. package/node_modules/@buddi/tool-email/dist/pages/descriptors.js.map +1 -1
  171. package/node_modules/@buddi/tool-email/dist/pages/drafts-tools.d.ts +2 -2
  172. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts +7 -0
  173. package/node_modules/@buddi/tool-email/dist/pages/queries.d.ts.map +1 -1
  174. package/node_modules/@buddi/tool-email/dist/pages/queries.js +31 -3
  175. package/node_modules/@buddi/tool-email/dist/pages/queries.js.map +1 -1
  176. package/node_modules/@buddi/tool-email/dist/ports.d.ts +8 -0
  177. package/node_modules/@buddi/tool-email/dist/ports.d.ts.map +1 -1
  178. package/node_modules/@buddi/tool-email/dist/ports.js.map +1 -1
  179. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.d.ts.map +1 -1
  180. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.js +4 -1
  181. package/node_modules/@buddi/tool-email/dist/sentinels/suspicious-sender.js.map +1 -1
  182. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.d.ts +18 -21
  183. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.d.ts.map +1 -1
  184. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.js +39 -63
  185. package/node_modules/@buddi/tool-email/dist/sentinels/waiting-on-me.js.map +1 -1
  186. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.d.ts.map +1 -1
  187. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.js +3 -2
  188. package/node_modules/@buddi/tool-email/dist/sources/inbox-poll.js.map +1 -1
  189. package/node_modules/@buddi/tool-email/dist/suspicions-store.d.ts +6 -0
  190. package/node_modules/@buddi/tool-email/dist/suspicions-store.d.ts.map +1 -1
  191. package/node_modules/@buddi/tool-email/dist/suspicions-store.js +16 -1
  192. package/node_modules/@buddi/tool-email/dist/suspicions-store.js.map +1 -1
  193. package/node_modules/@buddi/tool-email/dist/threads.d.ts +17 -2
  194. package/node_modules/@buddi/tool-email/dist/threads.d.ts.map +1 -1
  195. package/node_modules/@buddi/tool-email/dist/threads.js +35 -14
  196. package/node_modules/@buddi/tool-email/dist/threads.js.map +1 -1
  197. package/node_modules/@buddi/tool-email/dist/tools/mailbox.d.ts +3 -0
  198. package/node_modules/@buddi/tool-email/dist/tools/mailbox.d.ts.map +1 -1
  199. package/node_modules/@buddi/tool-email/dist/tools/mailbox.js +5 -0
  200. package/node_modules/@buddi/tool-email/dist/tools/mailbox.js.map +1 -1
  201. package/node_modules/@buddi/tool-email/dist/tools/threads.d.ts +7 -3
  202. package/node_modules/@buddi/tool-email/dist/tools/threads.d.ts.map +1 -1
  203. package/node_modules/@buddi/tool-email/dist/tools/threads.js +18 -5
  204. package/node_modules/@buddi/tool-email/dist/tools/threads.js.map +1 -1
  205. package/node_modules/@buddi/tool-email/dist/watchers.d.ts +91 -7
  206. package/node_modules/@buddi/tool-email/dist/watchers.d.ts.map +1 -1
  207. package/node_modules/@buddi/tool-email/dist/watchers.js +164 -1
  208. package/node_modules/@buddi/tool-email/dist/watchers.js.map +1 -1
  209. package/node_modules/@buddi/tool-email/dist/widgets.d.ts +3 -2
  210. package/node_modules/@buddi/tool-email/dist/widgets.d.ts.map +1 -1
  211. package/node_modules/@buddi/tool-email/dist/widgets.js +2 -2
  212. package/node_modules/@buddi/tool-email/dist/widgets.js.map +1 -1
  213. package/node_modules/@buddi/tool-email/migrations/023_attention.sql +100 -0
  214. package/node_modules/@buddi/tool-email/migrations/024_auth_domain.sql +9 -0
  215. package/node_modules/@buddi/tool-email/migrations/025_thread_ignore.sql +77 -0
  216. package/node_modules/@buddi/tool-email/package.json +1 -1
  217. package/node_modules/@buddi/tool-host/dist/.tsbuildinfo +1 -1
  218. package/node_modules/@buddi/tool-mcp/dist/.tsbuildinfo +1 -1
  219. package/node_modules/@buddi/tool-memory/dist/.tsbuildinfo +1 -1
  220. package/node_modules/@buddi/tool-web/dist/.tsbuildinfo +1 -1
  221. package/node_modules/ip-address/README.md +34 -34
  222. package/node_modules/ip-address/dist/ipv4.js +7 -0
  223. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  224. package/node_modules/ip-address/package.json +1 -1
  225. package/package.json +2 -2
  226. package/packages/cli/dist/.tsbuildinfo +1 -1
  227. package/packages/cli/dist/args.d.ts +6 -1
  228. package/packages/cli/dist/args.d.ts.map +1 -1
  229. package/packages/cli/dist/args.js +7 -2
  230. package/packages/cli/dist/args.js.map +1 -1
  231. package/packages/cli/dist/commands.d.ts.map +1 -1
  232. package/packages/cli/dist/commands.js +13 -3
  233. package/packages/cli/dist/commands.js.map +1 -1
  234. package/packages/cli/dist/doctor-probes.d.ts.map +1 -1
  235. package/packages/cli/dist/doctor-probes.js +2 -1
  236. package/packages/cli/dist/doctor-probes.js.map +1 -1
  237. package/packages/cli/dist/jobs-cmd.d.ts +4 -0
  238. package/packages/cli/dist/jobs-cmd.d.ts.map +1 -1
  239. package/packages/cli/dist/jobs-cmd.js +53 -4
  240. package/packages/cli/dist/jobs-cmd.js.map +1 -1
  241. package/packages/cli/dist/main.d.ts.map +1 -1
  242. package/packages/cli/dist/main.js +5 -1
  243. package/packages/cli/dist/main.js.map +1 -1
  244. package/packages/core/dist/.tsbuildinfo +1 -1
  245. package/packages/core/dist/lock.d.ts +8 -2
  246. package/packages/core/dist/lock.d.ts.map +1 -1
  247. package/packages/core/dist/lock.js +20 -5
  248. package/packages/core/dist/lock.js.map +1 -1
  249. package/packages/core/dist/pages.d.ts +3 -1
  250. package/packages/core/dist/pages.d.ts.map +1 -1
  251. package/packages/core/dist/pages.js +6 -1
  252. package/packages/core/dist/pages.js.map +1 -1
  253. package/packages/core/dist/plugin/index.d.ts +1 -1
  254. package/packages/core/dist/plugin/index.d.ts.map +1 -1
  255. package/packages/core/dist/plugin/index.js.map +1 -1
  256. package/packages/core/dist/plugin/version.d.ts +1 -1
  257. package/packages/core/dist/plugin/version.js +1 -1
  258. package/packages/core/dist/queue/failures.d.ts +84 -0
  259. package/packages/core/dist/queue/failures.d.ts.map +1 -0
  260. package/packages/core/dist/queue/failures.js +195 -0
  261. package/packages/core/dist/queue/failures.js.map +1 -0
  262. package/packages/core/dist/queue/index.d.ts +1 -0
  263. package/packages/core/dist/queue/index.d.ts.map +1 -1
  264. package/packages/core/dist/queue/index.js +1 -0
  265. package/packages/core/dist/queue/index.js.map +1 -1
  266. package/packages/core/dist/queue/jobs.d.ts +39 -3
  267. package/packages/core/dist/queue/jobs.d.ts.map +1 -1
  268. package/packages/core/dist/queue/jobs.js +54 -4
  269. package/packages/core/dist/queue/jobs.js.map +1 -1
  270. package/packages/core/dist/queue/types.d.ts +20 -0
  271. package/packages/core/dist/queue/types.d.ts.map +1 -1
  272. package/packages/core/dist/queue/types.js +17 -0
  273. package/packages/core/dist/queue/types.js.map +1 -1
  274. package/packages/core/dist/secrets/settings.d.ts.map +1 -1
  275. package/packages/core/dist/secrets/settings.js +23 -3
  276. package/packages/core/dist/secrets/settings.js.map +1 -1
  277. package/packages/core/dist/sentinels/digest.d.ts +8 -1
  278. package/packages/core/dist/sentinels/digest.d.ts.map +1 -1
  279. package/packages/core/dist/sentinels/digest.js +10 -3
  280. package/packages/core/dist/sentinels/digest.js.map +1 -1
  281. package/packages/core/dist/sentinels/index.d.ts +1 -0
  282. package/packages/core/dist/sentinels/index.d.ts.map +1 -1
  283. package/packages/core/dist/sentinels/index.js +1 -0
  284. package/packages/core/dist/sentinels/index.js.map +1 -1
  285. package/packages/core/dist/sentinels/mutes.d.ts +51 -0
  286. package/packages/core/dist/sentinels/mutes.d.ts.map +1 -0
  287. package/packages/core/dist/sentinels/mutes.js +86 -0
  288. package/packages/core/dist/sentinels/mutes.js.map +1 -0
  289. package/packages/core/dist/sentinels/run.d.ts +14 -4
  290. package/packages/core/dist/sentinels/run.d.ts.map +1 -1
  291. package/packages/core/dist/sentinels/run.js +64 -20
  292. package/packages/core/dist/sentinels/run.js.map +1 -1
  293. package/packages/core/dist/sentinels/types.d.ts +152 -2
  294. package/packages/core/dist/sentinels/types.d.ts.map +1 -1
  295. package/packages/core/dist/sentinels/types.js +126 -2
  296. package/packages/core/dist/sentinels/types.js.map +1 -1
  297. package/packages/core/dist/views.d.ts +112 -112
  298. package/packages/core/dist/views.d.ts.map +1 -1
  299. package/packages/core/dist/views.js +2 -0
  300. package/packages/core/dist/views.js.map +1 -1
  301. package/packages/core/migrations/066_alert_decisions.sql +45 -0
  302. package/packages/core/migrations/067_job_acknowledged.sql +21 -0
  303. package/packages/gateway/dist/.tsbuildinfo +1 -1
  304. package/packages/gateway/dist/chat/conversations.d.ts.map +1 -1
  305. package/packages/gateway/dist/chat/conversations.js +8 -2
  306. package/packages/gateway/dist/chat/conversations.js.map +1 -1
  307. package/packages/gateway/dist/missions/execute.d.ts.map +1 -1
  308. package/packages/gateway/dist/missions/execute.js +36 -2
  309. package/packages/gateway/dist/missions/execute.js.map +1 -1
  310. package/packages/gateway/dist/missions/goals.d.ts +12 -1
  311. package/packages/gateway/dist/missions/goals.d.ts.map +1 -1
  312. package/packages/gateway/dist/missions/goals.js +21 -1
  313. package/packages/gateway/dist/missions/goals.js.map +1 -1
  314. package/packages/gateway/dist/missions/sentinel-wake.d.ts +3 -0
  315. package/packages/gateway/dist/missions/sentinel-wake.d.ts.map +1 -1
  316. package/packages/gateway/dist/missions/sentinel-wake.js +4 -1
  317. package/packages/gateway/dist/missions/sentinel-wake.js.map +1 -1
  318. package/packages/gateway/dist/surfaces/offered-actions.d.ts +17 -0
  319. package/packages/gateway/dist/surfaces/offered-actions.d.ts.map +1 -1
  320. package/packages/gateway/dist/surfaces/offered-actions.js +27 -0
  321. package/packages/gateway/dist/surfaces/offered-actions.js.map +1 -1
  322. package/packages/gateway/dist/web/alerts.d.ts +179 -0
  323. package/packages/gateway/dist/web/alerts.d.ts.map +1 -0
  324. package/packages/gateway/dist/web/alerts.js +363 -0
  325. package/packages/gateway/dist/web/alerts.js.map +1 -0
  326. package/packages/gateway/dist/web/api-routes.d.ts.map +1 -1
  327. package/packages/gateway/dist/web/api-routes.js +45 -6
  328. package/packages/gateway/dist/web/api-routes.js.map +1 -1
  329. package/packages/gateway/dist/web/chat.d.ts +1 -0
  330. package/packages/gateway/dist/web/chat.d.ts.map +1 -1
  331. package/packages/gateway/dist/web/chat.js +4 -3
  332. package/packages/gateway/dist/web/chat.js.map +1 -1
  333. package/packages/gateway/dist/web/lock.d.ts +7 -4
  334. package/packages/gateway/dist/web/lock.d.ts.map +1 -1
  335. package/packages/gateway/dist/web/lock.js +20 -14
  336. package/packages/gateway/dist/web/lock.js.map +1 -1
  337. package/packages/gateway/dist/web/plugins.d.ts.map +1 -1
  338. package/packages/gateway/dist/web/plugins.js +17 -3
  339. package/packages/gateway/dist/web/plugins.js.map +1 -1
  340. package/packages/gateway/dist/web/read.d.ts +52 -26
  341. package/packages/gateway/dist/web/read.d.ts.map +1 -1
  342. package/packages/gateway/dist/web/read.js +52 -36
  343. package/packages/gateway/dist/web/read.js.map +1 -1
  344. package/packages/gateway/dist/web/secrets.d.ts +61 -1
  345. package/packages/gateway/dist/web/secrets.d.ts.map +1 -1
  346. package/packages/gateway/dist/web/secrets.js +111 -3
  347. package/packages/gateway/dist/web/secrets.js.map +1 -1
  348. package/packages/gateway/dist/web/server.d.ts.map +1 -1
  349. package/packages/gateway/dist/web/server.js +125 -9
  350. package/packages/gateway/dist/web/server.js.map +1 -1
  351. package/packages/gateway/dist/web/widgets.d.ts +1 -0
  352. package/packages/gateway/dist/web/widgets.d.ts.map +1 -1
  353. package/packages/gateway/dist/web/widgets.js +6 -1
  354. package/packages/gateway/dist/web/widgets.js.map +1 -1
  355. package/packages/gateway/dist/web/write.d.ts +23 -0
  356. package/packages/gateway/dist/web/write.d.ts.map +1 -1
  357. package/packages/gateway/dist/web/write.js +46 -1
  358. package/packages/gateway/dist/web/write.js.map +1 -1
  359. package/packages/install/dist/.tsbuildinfo +1 -1
  360. package/packages/runtime/dist/.tsbuildinfo +1 -1
  361. package/packages/runtime/dist/anthropic.d.ts +6 -0
  362. package/packages/runtime/dist/anthropic.d.ts.map +1 -1
  363. package/packages/runtime/dist/anthropic.js.map +1 -1
  364. package/packages/runtime/dist/openai.d.ts +34 -1
  365. package/packages/runtime/dist/openai.d.ts.map +1 -1
  366. package/packages/runtime/dist/openai.js +66 -12
  367. package/packages/runtime/dist/openai.js.map +1 -1
  368. package/packages/tools/artifacts/dist/.tsbuildinfo +1 -1
  369. package/packages/tools/browser/dist/.tsbuildinfo +1 -1
  370. package/packages/tools/email/dist/.tsbuildinfo +1 -1
  371. package/packages/tools/email/dist/agent.js +1 -1
  372. package/packages/tools/email/dist/imap/imapflow-client.d.ts +8 -0
  373. package/packages/tools/email/dist/imap/imapflow-client.d.ts.map +1 -1
  374. package/packages/tools/email/dist/imap/imapflow-client.js +59 -4
  375. package/packages/tools/email/dist/imap/imapflow-client.js.map +1 -1
  376. package/packages/tools/email/dist/mail.d.ts +42 -0
  377. package/packages/tools/email/dist/mail.d.ts.map +1 -1
  378. package/packages/tools/email/dist/mail.js +116 -0
  379. package/packages/tools/email/dist/mail.js.map +1 -1
  380. package/packages/tools/email/dist/mailbox/select.d.ts +6 -0
  381. package/packages/tools/email/dist/mailbox/select.d.ts.map +1 -1
  382. package/packages/tools/email/dist/mailbox/select.js +11 -0
  383. package/packages/tools/email/dist/mailbox/select.js.map +1 -1
  384. package/packages/tools/email/dist/metrics.d.ts +5 -6
  385. package/packages/tools/email/dist/metrics.d.ts.map +1 -1
  386. package/packages/tools/email/dist/metrics.js +4 -5
  387. package/packages/tools/email/dist/metrics.js.map +1 -1
  388. package/packages/tools/email/dist/needs-you.d.ts +58 -0
  389. package/packages/tools/email/dist/needs-you.d.ts.map +1 -0
  390. package/packages/tools/email/dist/needs-you.js +97 -0
  391. package/packages/tools/email/dist/needs-you.js.map +1 -0
  392. package/packages/tools/email/dist/pages/descriptors.d.ts.map +1 -1
  393. package/packages/tools/email/dist/pages/descriptors.js +110 -78
  394. package/packages/tools/email/dist/pages/descriptors.js.map +1 -1
  395. package/packages/tools/email/dist/pages/drafts-tools.d.ts +2 -2
  396. package/packages/tools/email/dist/pages/queries.d.ts +7 -0
  397. package/packages/tools/email/dist/pages/queries.d.ts.map +1 -1
  398. package/packages/tools/email/dist/pages/queries.js +31 -3
  399. package/packages/tools/email/dist/pages/queries.js.map +1 -1
  400. package/packages/tools/email/dist/ports.d.ts +8 -0
  401. package/packages/tools/email/dist/ports.d.ts.map +1 -1
  402. package/packages/tools/email/dist/ports.js.map +1 -1
  403. package/packages/tools/email/dist/sentinels/suspicious-sender.d.ts.map +1 -1
  404. package/packages/tools/email/dist/sentinels/suspicious-sender.js +4 -1
  405. package/packages/tools/email/dist/sentinels/suspicious-sender.js.map +1 -1
  406. package/packages/tools/email/dist/sentinels/waiting-on-me.d.ts +18 -21
  407. package/packages/tools/email/dist/sentinels/waiting-on-me.d.ts.map +1 -1
  408. package/packages/tools/email/dist/sentinels/waiting-on-me.js +39 -63
  409. package/packages/tools/email/dist/sentinels/waiting-on-me.js.map +1 -1
  410. package/packages/tools/email/dist/sources/inbox-poll.d.ts.map +1 -1
  411. package/packages/tools/email/dist/sources/inbox-poll.js +3 -2
  412. package/packages/tools/email/dist/sources/inbox-poll.js.map +1 -1
  413. package/packages/tools/email/dist/suspicions-store.d.ts +6 -0
  414. package/packages/tools/email/dist/suspicions-store.d.ts.map +1 -1
  415. package/packages/tools/email/dist/suspicions-store.js +16 -1
  416. package/packages/tools/email/dist/suspicions-store.js.map +1 -1
  417. package/packages/tools/email/dist/threads.d.ts +17 -2
  418. package/packages/tools/email/dist/threads.d.ts.map +1 -1
  419. package/packages/tools/email/dist/threads.js +35 -14
  420. package/packages/tools/email/dist/threads.js.map +1 -1
  421. package/packages/tools/email/dist/tools/mailbox.d.ts +3 -0
  422. package/packages/tools/email/dist/tools/mailbox.d.ts.map +1 -1
  423. package/packages/tools/email/dist/tools/mailbox.js +5 -0
  424. package/packages/tools/email/dist/tools/mailbox.js.map +1 -1
  425. package/packages/tools/email/dist/tools/threads.d.ts +7 -3
  426. package/packages/tools/email/dist/tools/threads.d.ts.map +1 -1
  427. package/packages/tools/email/dist/tools/threads.js +18 -5
  428. package/packages/tools/email/dist/tools/threads.js.map +1 -1
  429. package/packages/tools/email/dist/watchers.d.ts +91 -7
  430. package/packages/tools/email/dist/watchers.d.ts.map +1 -1
  431. package/packages/tools/email/dist/watchers.js +164 -1
  432. package/packages/tools/email/dist/watchers.js.map +1 -1
  433. package/packages/tools/email/dist/widgets.d.ts +3 -2
  434. package/packages/tools/email/dist/widgets.d.ts.map +1 -1
  435. package/packages/tools/email/dist/widgets.js +2 -2
  436. package/packages/tools/email/dist/widgets.js.map +1 -1
  437. package/packages/tools/email/migrations/023_attention.sql +100 -0
  438. package/packages/tools/email/migrations/024_auth_domain.sql +9 -0
  439. package/packages/tools/email/migrations/025_thread_ignore.sql +77 -0
  440. package/packages/tools/email/package.json +1 -1
  441. package/packages/tools/host/dist/.tsbuildinfo +1 -1
  442. package/packages/tools/mcp/dist/.tsbuildinfo +1 -1
  443. package/packages/tools/memory/dist/.tsbuildinfo +1 -1
  444. package/packages/tools/web/dist/.tsbuildinfo +1 -1
  445. package/packages/web/dist/assets/earth-2560-Ce3xs8Cb.webp +0 -0
  446. package/packages/web/dist/assets/earth-phone-BqC7cDhk.webp +0 -0
  447. package/packages/web/dist/assets/index-WS4UjGsy.js +129 -0
  448. package/packages/web/dist/assets/index-Zrt_o2UG.css +1 -0
  449. package/packages/web/dist/assets/{lottie_light-Cdn77Osu.js → lottie_light-Ls7i1ATS.js} +1 -1
  450. package/packages/web/dist/build.json +1 -1
  451. package/packages/web/dist/index.html +2 -2
  452. package/packages/web/dist/precache.json +4 -4
  453. package/packages/web/dist/sw.js +3 -2
  454. package/packages/web/dist/assets/index-D8_tmf2k.js +0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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 // 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,QA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AC,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.30",
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- Alerts: every row has a primary action and ways out — Not now (back in a week), Stop telling me this (silences that account or sender, or the whole kind; taken back under Silenced in Settings → Watchers) and Clear all with Undo. Stale balances open one quick form listing every account with its last value; an unsent draft offers Open draft, Send (still approved by you) and Discard; files never used offer Review and Not needed; Ask hands the agent the watcher's brief and the thread shows only what you asked about.\n- Failed jobs can be dismissed. Activity → Jobs now opens on what gave up, one row per cause (\"Gemini quota (429) · 4\", \"Gemini thought_signature (400) · 6\") with why in plain words, the agents and when; Retry (the main action when the cause has likely passed — a quota that has reset, a bug fixed since) and Dismiss per group, per job and for all, with Undo. Dismissed jobs stay listed under Dismissed and leave the footer's \"N failed\", Home and `buddi doctor`; a failed job older than 14 days is dismissed on its own. `buddi jobs dismiss <id>|--all`, and `buddi jobs --state failed` says which were dismissed and groups them by cause. `GET /api/jobs/failures`, `POST /api/jobs/dismiss`, `/api/jobs/undismiss` and `/api/jobs/retry` (by ids, group or all).\n- The lock screen has a new background, Earth — a photo of the planet's limb from high above (by ActionVance on Unsplash, credited under the swatches) — and it is the default: a new buddi, and anyone who never picked a background, gets Earth. A background you picked stays. It is the same in light and dark, a phone gets its own portrait crop, and the time and the PIN keep light ink over it.\n- Mail: a Show filter over the conversations — All, Needs a reply, Notifications. Needs a reply is exactly what the Waiting on you widget on Home counts. `email.list_threads` and `email.select_messages` take `needsReply`, and each conversation an agent reads says whether it needs you and why.\n- Plugin host API 1.22: the tile icon `moon-cloud`, a partly cloudy night; and a page's tab bar may hold one tab with a pick, drawn as the pick alone — a filter over one view.\n- Plugin host API 1.23: a watcher's finding carries an owner line (what the owner reads) apart from its brief for the agent, a kind and a subject that group repeats into one row, a group title, and the actions the owner can take from the row — open a page, run one of the plugin's own tools (gated ones still ask), a quick form, ask the agent, or set it aside.\n\n### Changed\n\n- Activity → Alerts lists only what needs a decision, in one plain line each — never the instructions a watcher writes for an agent — with repeats of one kind as one row (\"9 balances not updated in 2+ weeks\", the accounts inside). What the watchers notice in passing goes to the recap: the \"Waiting for the weekly recap\" table is now one line (\"12 notes saved for Friday's recap · Preview\"), and the info/urgent pills are gone, urgent kept as a quiet mark. Home's Needs you says the first decision in the same words; the recap reads the owner lines too.\n- `buddi jobs retry --all` leaves dismissed failed jobs alone; retry one by its id to run it again.\n- Settings → Keys and secrets is redesigned. Secrets sit in groups — Your secrets, Mail, Calendar links (and any other plugin's), Model accounts, Connections — each row named in plain words (\"Gmail app password\", a calendar's name, a model account's label) with one line on where it may go (\"Sent only to calendar.google.com\") and when it was last used, instead of stored names, binding chips and five buttons. A problem is one sentence with its one fix (\"Held back 23 seconds ago: it was asked for at uploads.github.com, where it may not go.\" → Change where it may go; \"No value stored.\" → Set a value; a mailbox its server turned down → Set password on the Email page). Model accounts and connections are read-only here and link to where they are managed. Each row has one ⋯ menu (a sheet on a phone); the stored name, bindings and ids sit under Details in the row's sheet with its usage history in words. A secret nothing uses any more — such as an old `GMAIL_APP_PASSWORD` no mailbox points to — says \"Not used by anything\" and offers Remove; nothing is removed by itself.\n- Keys and secrets: a new place a secret may go starts at \"asks you the first time\" instead of the kind's loosest rule.\n- Restarting buddi from the dashboard — Restart to load it on Plugins, Restart gateway, an upgrade, a restore, leaving recovery mode — now covers the window with a calm \"Restarting buddi\" screen (the Blob, what the restart is for, such as \"Loading weather 0.1.3 and 4 more…\", and the time it has taken), waits until the old process is gone and the new one answers, then reloads the page. After ninety seconds (five minutes for an upgrade) it says buddi may need a hand, names `buddi status` and offers Reload. Stop gateway shows the same screen, still, with `buddi service start`.\n- A restart started elsewhere (another device, `buddi service restart`) shows the same screen instead of red \"buddi isn't answering\" banners: the gateway tells open pages it is closing, and a page that finds a new process after the link comes back reloads too (unless you are typing).\n- `/_buddi/ready` also answers a random `boot` id for the running process, so a page can tell the process that went from the one that came back.\n\n### Fixed\n\n- Gemini 3 models no longer fail with \"Function call is missing a thought_signature\" on the turn after a tool call: the signature Google returns with each call is kept with it in the conversation and sent back to Google's endpoint only. A conversation from before this fix carries on too.\n- Mail no longer says \"Waiting on you\" on every conversation. A conversation waits on you only when someone you've written to before wrote last, or triage judged the message to need a reply — never a no-reply address, a newsletter or mailing list, a muted thread or a sender you ignore, and nothing older than 30 days. Notifications and messages nobody expects an answer to carry no pill; the conversation's State says which it is and why (\"Notification — no reply expected: a no-reply sender\"). The Mail page, the Waiting on you widget, the waiting watcher and the agents' tools now count the same conversations.\n- Mail: a genuine security notice (\"2-Step Verification turned on\") is no longer called phishing. A credential ask that only names a password is not raised at all, and one authenticated (DKIM/SPF/DMARC, read from the receiving server's own header) as coming from a well-known account provider or a domain you write to stays quiet; a transfer asked for from a correspondent's real domain still warns.\n- The lock screen reads every time one way: the line under the PIN (\"Locked by you at …\"), the second clock, the focus and the widgets left on Profile now follow the big clock — 12-hour or 24-hour as picked in Settings → Lock screen, else your Profile, else your browser — instead of the line using another format than the clock (a page that opened locked showed \"18:59\" over \"Locked by you at 6:59 PM\").\n- The lock screen centres its widgets when medium and small ones share rows (it used to size the grid for four columns and leave the fourth empty).\n- Time format choices say what Profile means now — \"Profile (12-hour)\" in Settings → Lock screen and in a widget's settings — instead of a sample time.\n- The weather widget's hourly strip shows the moon at night (a crescent on a clear night, the crescent over a cloud when partly cloudy) instead of the sun, and writes its hours your way (\"6 PM\", \"12 AM\" on a 12-hour clock); it has a Times setting of its own. The Weather page's hours, sunrise and sunset follow your Profile too.\n- The calendar's \"Next meeting\" line on Home writes the time your way (\"at 9:30 AM\" on a 12-hour clock).\n\n…"
21
21
  },
22
22
  "files": [
23
23
  "packages",