@elizaos/plugin-personal-assistant 2.0.3-beta.6 → 2.0.3-beta.7

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 (1317) hide show
  1. package/dist/actions/app-block.d.ts +15 -0
  2. package/dist/actions/app-block.d.ts.map +1 -0
  3. package/dist/actions/app-block.js +349 -0
  4. package/dist/actions/app-block.js.map +1 -0
  5. package/dist/actions/autofill.d.ts +20 -0
  6. package/dist/actions/autofill.d.ts.map +1 -0
  7. package/dist/actions/autofill.js +370 -0
  8. package/dist/actions/autofill.js.map +1 -0
  9. package/dist/actions/block.d.ts +30 -0
  10. package/dist/actions/block.d.ts.map +1 -0
  11. package/dist/actions/block.js +326 -0
  12. package/dist/actions/block.js.map +1 -0
  13. package/dist/actions/book-travel.d.ts +10 -0
  14. package/dist/actions/book-travel.d.ts.map +1 -0
  15. package/dist/actions/book-travel.js +467 -0
  16. package/dist/actions/book-travel.js.map +1 -0
  17. package/dist/actions/brief.d.ts +60 -0
  18. package/dist/actions/brief.d.ts.map +1 -0
  19. package/dist/actions/brief.js +485 -0
  20. package/dist/actions/brief.js.map +1 -0
  21. package/dist/actions/calendar.d.ts +22 -0
  22. package/dist/actions/calendar.d.ts.map +1 -0
  23. package/dist/actions/calendar.js +832 -0
  24. package/dist/actions/calendar.js.map +1 -0
  25. package/dist/actions/conflict-detect.d.ts +67 -0
  26. package/dist/actions/conflict-detect.d.ts.map +1 -0
  27. package/dist/actions/conflict-detect.js +310 -0
  28. package/dist/actions/conflict-detect.js.map +1 -0
  29. package/dist/actions/connector.d.ts +5 -0
  30. package/dist/actions/connector.d.ts.map +1 -0
  31. package/dist/actions/connector.js +1354 -0
  32. package/dist/actions/connector.js.map +1 -0
  33. package/dist/actions/credentials.d.ts +14 -0
  34. package/dist/actions/credentials.d.ts.map +1 -0
  35. package/dist/actions/credentials.js +191 -0
  36. package/dist/actions/credentials.js.map +1 -0
  37. package/dist/actions/document.d.ts +36 -0
  38. package/dist/actions/document.d.ts.map +1 -0
  39. package/dist/actions/document.js +613 -0
  40. package/dist/actions/document.js.map +1 -0
  41. package/dist/actions/entity.d.ts +20 -0
  42. package/dist/actions/entity.d.ts.map +1 -0
  43. package/dist/actions/entity.js +785 -0
  44. package/dist/actions/entity.js.map +1 -0
  45. package/dist/actions/health.d.ts +4 -0
  46. package/dist/actions/health.d.ts.map +1 -0
  47. package/dist/actions/health.js +37 -0
  48. package/dist/actions/health.js.map +1 -0
  49. package/dist/actions/inbox.d.ts +12 -0
  50. package/dist/actions/inbox.d.ts.map +1 -0
  51. package/dist/actions/inbox.js +13 -0
  52. package/dist/actions/inbox.js.map +1 -0
  53. package/dist/actions/lib/calendly-handler.d.ts +3 -0
  54. package/dist/actions/lib/calendly-handler.d.ts.map +1 -0
  55. package/dist/actions/lib/calendly-handler.js +506 -0
  56. package/dist/actions/lib/calendly-handler.js.map +1 -0
  57. package/dist/actions/lib/extract-goal-plan.d.ts +69 -0
  58. package/dist/actions/lib/extract-goal-plan.d.ts.map +1 -0
  59. package/dist/actions/lib/extract-goal-plan.js +488 -0
  60. package/dist/actions/lib/extract-goal-plan.js.map +1 -0
  61. package/dist/actions/lib/extract-life-operation.d.ts +18 -0
  62. package/dist/actions/lib/extract-life-operation.d.ts.map +1 -0
  63. package/dist/actions/lib/extract-life-operation.js +318 -0
  64. package/dist/actions/lib/extract-life-operation.js.map +1 -0
  65. package/dist/actions/lib/extract-task-plan.d.ts +78 -0
  66. package/dist/actions/lib/extract-task-plan.d.ts.map +1 -0
  67. package/dist/actions/lib/extract-task-plan.js +355 -0
  68. package/dist/actions/lib/extract-task-plan.js.map +1 -0
  69. package/dist/actions/lib/extract-update-fields.d.ts +27 -0
  70. package/dist/actions/lib/extract-update-fields.d.ts.map +1 -0
  71. package/dist/actions/lib/extract-update-fields.js +172 -0
  72. package/dist/actions/lib/extract-update-fields.js.map +1 -0
  73. package/dist/actions/lib/lifeops-deferred-draft.d.ts +68 -0
  74. package/dist/actions/lib/lifeops-deferred-draft.d.ts.map +1 -0
  75. package/dist/actions/lib/lifeops-deferred-draft.js +315 -0
  76. package/dist/actions/lib/lifeops-deferred-draft.js.map +1 -0
  77. package/dist/actions/lib/messaging-helpers.d.ts +20 -0
  78. package/dist/actions/lib/messaging-helpers.d.ts.map +1 -0
  79. package/dist/actions/lib/messaging-helpers.js +103 -0
  80. package/dist/actions/lib/messaging-helpers.js.map +1 -0
  81. package/dist/actions/lib/owner-policy-writes.d.ts +49 -0
  82. package/dist/actions/lib/owner-policy-writes.d.ts.map +1 -0
  83. package/dist/actions/lib/owner-policy-writes.js +157 -0
  84. package/dist/actions/lib/owner-policy-writes.js.map +1 -0
  85. package/dist/actions/lib/prompt-format.d.ts +3 -0
  86. package/dist/actions/lib/prompt-format.d.ts.map +1 -0
  87. package/dist/actions/lib/prompt-format.js +42 -0
  88. package/dist/actions/lib/prompt-format.js.map +1 -0
  89. package/dist/actions/lib/scheduling-handler.d.ts +93 -0
  90. package/dist/actions/lib/scheduling-handler.d.ts.map +1 -0
  91. package/dist/actions/lib/scheduling-handler.js +868 -0
  92. package/dist/actions/lib/scheduling-handler.js.map +1 -0
  93. package/dist/actions/life.d.ts +13 -0
  94. package/dist/actions/life.d.ts.map +1 -0
  95. package/dist/actions/life.js +2524 -0
  96. package/dist/actions/life.js.map +1 -0
  97. package/dist/actions/money.d.ts +24 -0
  98. package/dist/actions/money.d.ts.map +1 -0
  99. package/dist/actions/money.js +41 -0
  100. package/dist/actions/money.js.map +1 -0
  101. package/dist/actions/owner-surfaces.d.ts +11 -0
  102. package/dist/actions/owner-surfaces.d.ts.map +1 -0
  103. package/dist/actions/owner-surfaces.js +493 -0
  104. package/dist/actions/owner-surfaces.js.map +1 -0
  105. package/dist/actions/password-manager.d.ts +10 -0
  106. package/dist/actions/password-manager.d.ts.map +1 -0
  107. package/dist/actions/password-manager.js +195 -0
  108. package/dist/actions/password-manager.js.map +1 -0
  109. package/dist/actions/payments.d.ts +10 -0
  110. package/dist/actions/payments.d.ts.map +1 -0
  111. package/dist/actions/payments.js +5 -0
  112. package/dist/actions/payments.js.map +1 -0
  113. package/dist/actions/prioritize.d.ts +49 -0
  114. package/dist/actions/prioritize.d.ts.map +1 -0
  115. package/dist/actions/prioritize.js +313 -0
  116. package/dist/actions/prioritize.js.map +1 -0
  117. package/dist/actions/remote-desktop.d.ts +13 -0
  118. package/dist/actions/remote-desktop.d.ts.map +1 -0
  119. package/dist/actions/remote-desktop.js +11 -0
  120. package/dist/actions/remote-desktop.js.map +1 -0
  121. package/dist/actions/resolve-request.d.ts +12 -0
  122. package/dist/actions/resolve-request.d.ts.map +1 -0
  123. package/dist/actions/resolve-request.js +427 -0
  124. package/dist/actions/resolve-request.js.map +1 -0
  125. package/dist/actions/schedule.d.ts +10 -0
  126. package/dist/actions/schedule.d.ts.map +1 -0
  127. package/dist/actions/schedule.js +113 -0
  128. package/dist/actions/schedule.js.map +1 -0
  129. package/dist/actions/scheduled-task.d.ts +32 -0
  130. package/dist/actions/scheduled-task.d.ts.map +1 -0
  131. package/dist/actions/scheduled-task.js +661 -0
  132. package/dist/actions/scheduled-task.js.map +1 -0
  133. package/dist/actions/screen-time.d.ts +4 -0
  134. package/dist/actions/screen-time.d.ts.map +1 -0
  135. package/dist/actions/screen-time.js +47 -0
  136. package/dist/actions/screen-time.js.map +1 -0
  137. package/dist/actions/subscriptions.d.ts +8 -0
  138. package/dist/actions/subscriptions.d.ts.map +1 -0
  139. package/dist/actions/subscriptions.js +327 -0
  140. package/dist/actions/subscriptions.js.map +1 -0
  141. package/dist/actions/voice-call.d.ts +16 -0
  142. package/dist/actions/voice-call.d.ts.map +1 -0
  143. package/dist/actions/voice-call.js +756 -0
  144. package/dist/actions/voice-call.js.map +1 -0
  145. package/dist/actions/website-block.d.ts +15 -0
  146. package/dist/actions/website-block.d.ts.map +1 -0
  147. package/dist/actions/website-block.js +719 -0
  148. package/dist/actions/website-block.js.map +1 -0
  149. package/dist/actions/work-thread.d.ts +5 -0
  150. package/dist/actions/work-thread.d.ts.map +1 -0
  151. package/dist/actions/work-thread.js +556 -0
  152. package/dist/actions/work-thread.js.map +1 -0
  153. package/dist/activity-profile/activity-tracker-repo.d.ts +28 -0
  154. package/dist/activity-profile/activity-tracker-repo.d.ts.map +1 -0
  155. package/dist/activity-profile/activity-tracker-repo.js +61 -0
  156. package/dist/activity-profile/activity-tracker-repo.js.map +1 -0
  157. package/dist/activity-profile/activity-tracker-reporting.d.ts +52 -0
  158. package/dist/activity-profile/activity-tracker-reporting.d.ts.map +1 -0
  159. package/dist/activity-profile/activity-tracker-reporting.js +119 -0
  160. package/dist/activity-profile/activity-tracker-reporting.js.map +1 -0
  161. package/dist/activity-profile/activity-tracker-service.d.ts +36 -0
  162. package/dist/activity-profile/activity-tracker-service.d.ts.map +1 -0
  163. package/dist/activity-profile/activity-tracker-service.js +187 -0
  164. package/dist/activity-profile/activity-tracker-service.js.map +1 -0
  165. package/dist/activity-profile/analyzer.d.ts +23 -0
  166. package/dist/activity-profile/analyzer.d.ts.map +1 -0
  167. package/dist/activity-profile/analyzer.js +485 -0
  168. package/dist/activity-profile/analyzer.js.map +1 -0
  169. package/dist/activity-profile/presence-signal-bridge-service.d.ts +14 -0
  170. package/dist/activity-profile/presence-signal-bridge-service.d.ts.map +1 -0
  171. package/dist/activity-profile/presence-signal-bridge-service.js +159 -0
  172. package/dist/activity-profile/presence-signal-bridge-service.js.map +1 -0
  173. package/dist/activity-profile/proactive-inbox-digest.d.ts +3 -0
  174. package/dist/activity-profile/proactive-inbox-digest.d.ts.map +1 -0
  175. package/dist/activity-profile/proactive-inbox-digest.js +21 -0
  176. package/dist/activity-profile/proactive-inbox-digest.js.map +1 -0
  177. package/dist/activity-profile/proactive-planner.d.ts +150 -0
  178. package/dist/activity-profile/proactive-planner.d.ts.map +1 -0
  179. package/dist/activity-profile/proactive-planner.js +529 -0
  180. package/dist/activity-profile/proactive-planner.js.map +1 -0
  181. package/dist/activity-profile/proactive-worker.d.ts +33 -0
  182. package/dist/activity-profile/proactive-worker.d.ts.map +1 -0
  183. package/dist/activity-profile/proactive-worker.js +779 -0
  184. package/dist/activity-profile/proactive-worker.js.map +1 -0
  185. package/dist/activity-profile/profile-metadata.d.ts +10 -0
  186. package/dist/activity-profile/profile-metadata.d.ts.map +1 -0
  187. package/dist/activity-profile/profile-metadata.js +16 -0
  188. package/dist/activity-profile/profile-metadata.js.map +1 -0
  189. package/dist/activity-profile/redactor.d.ts +15 -0
  190. package/dist/activity-profile/redactor.d.ts.map +1 -0
  191. package/dist/activity-profile/redactor.js +22 -0
  192. package/dist/activity-profile/redactor.js.map +1 -0
  193. package/dist/activity-profile/service.d.ts +11 -0
  194. package/dist/activity-profile/service.d.ts.map +1 -0
  195. package/dist/activity-profile/service.js +272 -0
  196. package/dist/activity-profile/service.js.map +1 -0
  197. package/dist/activity-profile/types.d.ts +97 -0
  198. package/dist/activity-profile/types.d.ts.map +1 -0
  199. package/dist/activity-profile/types.js +36 -0
  200. package/dist/activity-profile/types.js.map +1 -0
  201. package/dist/agent-lifeops.d.ts +2 -0
  202. package/dist/agent-lifeops.d.ts.map +1 -0
  203. package/dist/agent-lifeops.js +2 -0
  204. package/dist/agent-lifeops.js.map +1 -0
  205. package/dist/api/client-lifeops.d.ts +319 -0
  206. package/dist/api/client-lifeops.d.ts.map +1 -0
  207. package/dist/api/client-lifeops.js +794 -0
  208. package/dist/api/client-lifeops.js.map +1 -0
  209. package/dist/automation-node-contributor.d.ts +2 -0
  210. package/dist/automation-node-contributor.d.ts.map +1 -0
  211. package/dist/automation-node-contributor.js +184 -0
  212. package/dist/automation-node-contributor.js.map +1 -0
  213. package/dist/client.d.ts +16 -0
  214. package/dist/client.d.ts.map +1 -0
  215. package/dist/client.js +18 -0
  216. package/dist/client.js.map +1 -0
  217. package/dist/components/AppBlockerSettingsCard.d.ts +3 -0
  218. package/dist/components/AppBlockerSettingsCard.d.ts.map +1 -0
  219. package/dist/components/AppBlockerSettingsCard.js +538 -0
  220. package/dist/components/AppBlockerSettingsCard.js.map +1 -0
  221. package/dist/components/WebsiteBlockerSettingsCard.d.ts +3 -0
  222. package/dist/components/WebsiteBlockerSettingsCard.d.ts.map +1 -0
  223. package/dist/components/WebsiteBlockerSettingsCard.js +148 -0
  224. package/dist/components/WebsiteBlockerSettingsCard.js.map +1 -0
  225. package/dist/contracts/index.d.ts +2 -0
  226. package/dist/contracts/index.d.ts.map +1 -0
  227. package/dist/contracts/index.js +2 -0
  228. package/dist/contracts/index.js.map +1 -0
  229. package/dist/contracts/lifeops.d.ts +2 -0
  230. package/dist/contracts/lifeops.d.ts.map +1 -0
  231. package/dist/contracts/lifeops.js +2 -0
  232. package/dist/contracts/lifeops.js.map +1 -0
  233. package/dist/default-packs/autofill-whitelist-pack.d.ts +17 -0
  234. package/dist/default-packs/autofill-whitelist-pack.d.ts.map +1 -0
  235. package/dist/default-packs/autofill-whitelist-pack.js +56 -0
  236. package/dist/default-packs/autofill-whitelist-pack.js.map +1 -0
  237. package/dist/default-packs/consolidation-policies.d.ts +14 -0
  238. package/dist/default-packs/consolidation-policies.d.ts.map +1 -0
  239. package/dist/default-packs/consolidation-policies.js +17 -0
  240. package/dist/default-packs/consolidation-policies.js.map +1 -0
  241. package/dist/default-packs/contract-types.d.ts +200 -0
  242. package/dist/default-packs/contract-types.d.ts.map +1 -0
  243. package/dist/default-packs/contract-types.js +1 -0
  244. package/dist/default-packs/contract-types.js.map +1 -0
  245. package/dist/default-packs/daily-rhythm.d.ts +28 -0
  246. package/dist/default-packs/daily-rhythm.d.ts.map +1 -0
  247. package/dist/default-packs/daily-rhythm.js +136 -0
  248. package/dist/default-packs/daily-rhythm.js.map +1 -0
  249. package/dist/default-packs/escalation-ladders.d.ts +18 -0
  250. package/dist/default-packs/escalation-ladders.d.ts.map +1 -0
  251. package/dist/default-packs/escalation-ladders.js +17 -0
  252. package/dist/default-packs/escalation-ladders.js.map +1 -0
  253. package/dist/default-packs/executive-assistant.d.ts +50 -0
  254. package/dist/default-packs/executive-assistant.d.ts.map +1 -0
  255. package/dist/default-packs/executive-assistant.js +745 -0
  256. package/dist/default-packs/executive-assistant.js.map +1 -0
  257. package/dist/default-packs/followup-starter.d.ts +49 -0
  258. package/dist/default-packs/followup-starter.d.ts.map +1 -0
  259. package/dist/default-packs/followup-starter.js +104 -0
  260. package/dist/default-packs/followup-starter.js.map +1 -0
  261. package/dist/default-packs/habit-starters.d.ts +37 -0
  262. package/dist/default-packs/habit-starters.d.ts.map +1 -0
  263. package/dist/default-packs/habit-starters.js +255 -0
  264. package/dist/default-packs/habit-starters.js.map +1 -0
  265. package/dist/default-packs/inbox-triage-starter.d.ts +23 -0
  266. package/dist/default-packs/inbox-triage-starter.d.ts.map +1 -0
  267. package/dist/default-packs/inbox-triage-starter.js +61 -0
  268. package/dist/default-packs/inbox-triage-starter.js.map +1 -0
  269. package/dist/default-packs/index.d.ts +54 -0
  270. package/dist/default-packs/index.d.ts.map +1 -0
  271. package/dist/default-packs/index.js +150 -0
  272. package/dist/default-packs/index.js.map +1 -0
  273. package/dist/default-packs/lint.d.ts +62 -0
  274. package/dist/default-packs/lint.d.ts.map +1 -0
  275. package/dist/default-packs/lint.js +161 -0
  276. package/dist/default-packs/lint.js.map +1 -0
  277. package/dist/default-packs/morning-brief.d.ts +44 -0
  278. package/dist/default-packs/morning-brief.d.ts.map +1 -0
  279. package/dist/default-packs/morning-brief.js +69 -0
  280. package/dist/default-packs/morning-brief.js.map +1 -0
  281. package/dist/default-packs/quiet-user-watcher.d.ts +49 -0
  282. package/dist/default-packs/quiet-user-watcher.d.ts.map +1 -0
  283. package/dist/default-packs/quiet-user-watcher.js +92 -0
  284. package/dist/default-packs/quiet-user-watcher.js.map +1 -0
  285. package/dist/default-packs/registry-types.d.ts +51 -0
  286. package/dist/default-packs/registry-types.d.ts.map +1 -0
  287. package/dist/default-packs/registry-types.js +1 -0
  288. package/dist/default-packs/registry-types.js.map +1 -0
  289. package/dist/default-packs/task-definitions.d.ts +88 -0
  290. package/dist/default-packs/task-definitions.d.ts.map +1 -0
  291. package/dist/default-packs/task-definitions.js +87 -0
  292. package/dist/default-packs/task-definitions.js.map +1 -0
  293. package/dist/events/index.d.ts +34 -0
  294. package/dist/events/index.d.ts.map +1 -0
  295. package/dist/events/index.js +30 -0
  296. package/dist/events/index.js.map +1 -0
  297. package/dist/followup/actions/listOverdueFollowups.d.ts +3 -0
  298. package/dist/followup/actions/listOverdueFollowups.d.ts.map +1 -0
  299. package/dist/followup/actions/listOverdueFollowups.js +90 -0
  300. package/dist/followup/actions/listOverdueFollowups.js.map +1 -0
  301. package/dist/followup/actions/markFollowupDone.d.ts +3 -0
  302. package/dist/followup/actions/markFollowupDone.d.ts.map +1 -0
  303. package/dist/followup/actions/markFollowupDone.js +171 -0
  304. package/dist/followup/actions/markFollowupDone.js.map +1 -0
  305. package/dist/followup/actions/setFollowupThreshold.d.ts +3 -0
  306. package/dist/followup/actions/setFollowupThreshold.d.ts.map +1 -0
  307. package/dist/followup/actions/setFollowupThreshold.js +171 -0
  308. package/dist/followup/actions/setFollowupThreshold.js.map +1 -0
  309. package/dist/followup/followup-tracker.d.ts +83 -0
  310. package/dist/followup/followup-tracker.d.ts.map +1 -0
  311. package/dist/followup/followup-tracker.js +311 -0
  312. package/dist/followup/followup-tracker.js.map +1 -0
  313. package/dist/followup/index.d.ts +5 -0
  314. package/dist/followup/index.d.ts.map +1 -0
  315. package/dist/followup/index.js +39 -0
  316. package/dist/followup/index.js.map +1 -0
  317. package/dist/hooks/connector-error.d.ts +2 -0
  318. package/dist/hooks/connector-error.d.ts.map +1 -0
  319. package/dist/hooks/connector-error.js +13 -0
  320. package/dist/hooks/connector-error.js.map +1 -0
  321. package/dist/hooks/useDiscordConnector.d.ts +11 -0
  322. package/dist/hooks/useDiscordConnector.d.ts.map +1 -0
  323. package/dist/hooks/useDiscordConnector.js +95 -0
  324. package/dist/hooks/useDiscordConnector.js.map +1 -0
  325. package/dist/hooks/useGoogleLifeOpsConnector.d.ts +23 -0
  326. package/dist/hooks/useGoogleLifeOpsConnector.d.ts.map +1 -0
  327. package/dist/hooks/useGoogleLifeOpsConnector.js +630 -0
  328. package/dist/hooks/useGoogleLifeOpsConnector.js.map +1 -0
  329. package/dist/hooks/useIMessageConnector.d.ts +10 -0
  330. package/dist/hooks/useIMessageConnector.d.ts.map +1 -0
  331. package/dist/hooks/useIMessageConnector.js +57 -0
  332. package/dist/hooks/useIMessageConnector.js.map +1 -0
  333. package/dist/hooks/useInbox.d.ts +36 -0
  334. package/dist/hooks/useInbox.d.ts.map +1 -0
  335. package/dist/hooks/useInbox.js +96 -0
  336. package/dist/hooks/useInbox.js.map +1 -0
  337. package/dist/hooks/useLifeOpsActivitySignals.d.ts +2 -0
  338. package/dist/hooks/useLifeOpsActivitySignals.d.ts.map +1 -0
  339. package/dist/hooks/useLifeOpsActivitySignals.js +358 -0
  340. package/dist/hooks/useLifeOpsActivitySignals.js.map +1 -0
  341. package/dist/hooks/useLifeOpsAppState.d.ts +9 -0
  342. package/dist/hooks/useLifeOpsAppState.d.ts.map +1 -0
  343. package/dist/hooks/useLifeOpsAppState.js +79 -0
  344. package/dist/hooks/useLifeOpsAppState.js.map +1 -0
  345. package/dist/hooks/useLifeOpsCapabilitiesStatus.d.ts +8 -0
  346. package/dist/hooks/useLifeOpsCapabilitiesStatus.d.ts.map +1 -0
  347. package/dist/hooks/useLifeOpsCapabilitiesStatus.js +60 -0
  348. package/dist/hooks/useLifeOpsCapabilitiesStatus.js.map +1 -0
  349. package/dist/hooks/useLifeOpsXConnector.d.ts +11 -0
  350. package/dist/hooks/useLifeOpsXConnector.d.ts.map +1 -0
  351. package/dist/hooks/useLifeOpsXConnector.js +92 -0
  352. package/dist/hooks/useLifeOpsXConnector.js.map +1 -0
  353. package/dist/hooks/useSignalConnector.d.ts +14 -0
  354. package/dist/hooks/useSignalConnector.d.ts.map +1 -0
  355. package/dist/hooks/useSignalConnector.js +89 -0
  356. package/dist/hooks/useSignalConnector.js.map +1 -0
  357. package/dist/hooks/useTelegramConnector.d.ts +14 -0
  358. package/dist/hooks/useTelegramConnector.d.ts.map +1 -0
  359. package/dist/hooks/useTelegramConnector.js +97 -0
  360. package/dist/hooks/useTelegramConnector.js.map +1 -0
  361. package/dist/hooks/useWhatsAppConnector.d.ts +8 -0
  362. package/dist/hooks/useWhatsAppConnector.d.ts.map +1 -0
  363. package/dist/hooks/useWhatsAppConnector.js +62 -0
  364. package/dist/hooks/useWhatsAppConnector.js.map +1 -0
  365. package/dist/inbox/message-fetcher.d.ts +11 -0
  366. package/dist/inbox/message-fetcher.d.ts.map +1 -0
  367. package/dist/inbox/message-fetcher.js +13 -0
  368. package/dist/inbox/message-fetcher.js.map +1 -0
  369. package/dist/inbox/repository.d.ts +11 -0
  370. package/dist/inbox/repository.d.ts.map +1 -0
  371. package/dist/inbox/repository.js +5 -0
  372. package/dist/inbox/repository.js.map +1 -0
  373. package/dist/inbox/types.d.ts +10 -0
  374. package/dist/inbox/types.d.ts.map +1 -0
  375. package/dist/inbox/types.js +2 -0
  376. package/dist/inbox/types.js.map +1 -0
  377. package/dist/index.d.ts +36 -0
  378. package/dist/index.d.ts.map +1 -0
  379. package/dist/index.js +188 -0
  380. package/dist/index.js.map +1 -0
  381. package/dist/lifeops/access.d.ts +29 -0
  382. package/dist/lifeops/access.d.ts.map +1 -0
  383. package/dist/lifeops/access.js +56 -0
  384. package/dist/lifeops/access.js.map +1 -0
  385. package/dist/lifeops/app-state.d.ts +22 -0
  386. package/dist/lifeops/app-state.d.ts.map +1 -0
  387. package/dist/lifeops/app-state.js +67 -0
  388. package/dist/lifeops/app-state.js.map +1 -0
  389. package/dist/lifeops/apple-reminders.d.ts +67 -0
  390. package/dist/lifeops/apple-reminders.d.ts.map +1 -0
  391. package/dist/lifeops/apple-reminders.js +396 -0
  392. package/dist/lifeops/apple-reminders.js.map +1 -0
  393. package/dist/lifeops/approval-queue.d.ts +38 -0
  394. package/dist/lifeops/approval-queue.d.ts.map +1 -0
  395. package/dist/lifeops/approval-queue.js +575 -0
  396. package/dist/lifeops/approval-queue.js.map +1 -0
  397. package/dist/lifeops/approval-queue.types.d.ts +172 -0
  398. package/dist/lifeops/approval-queue.types.d.ts.map +1 -0
  399. package/dist/lifeops/approval-queue.types.js +27 -0
  400. package/dist/lifeops/approval-queue.types.js.map +1 -0
  401. package/dist/lifeops/autofill-whitelist.d.ts +20 -0
  402. package/dist/lifeops/autofill-whitelist.d.ts.map +1 -0
  403. package/dist/lifeops/autofill-whitelist.js +59 -0
  404. package/dist/lifeops/autofill-whitelist.js.map +1 -0
  405. package/dist/lifeops/background-planner-dispatch.d.ts +60 -0
  406. package/dist/lifeops/background-planner-dispatch.d.ts.map +1 -0
  407. package/dist/lifeops/background-planner-dispatch.js +113 -0
  408. package/dist/lifeops/background-planner-dispatch.js.map +1 -0
  409. package/dist/lifeops/background-planner.d.ts +140 -0
  410. package/dist/lifeops/background-planner.d.ts.map +1 -0
  411. package/dist/lifeops/background-planner.js +359 -0
  412. package/dist/lifeops/background-planner.js.map +1 -0
  413. package/dist/lifeops/bill-extraction.d.ts +46 -0
  414. package/dist/lifeops/bill-extraction.d.ts.map +1 -0
  415. package/dist/lifeops/bill-extraction.js +325 -0
  416. package/dist/lifeops/bill-extraction.js.map +1 -0
  417. package/dist/lifeops/browser-constants.d.ts +4 -0
  418. package/dist/lifeops/browser-constants.d.ts.map +1 -0
  419. package/dist/lifeops/browser-constants.js +27 -0
  420. package/dist/lifeops/browser-constants.js.map +1 -0
  421. package/dist/lifeops/browser-extension-store.d.ts +61 -0
  422. package/dist/lifeops/browser-extension-store.d.ts.map +1 -0
  423. package/dist/lifeops/browser-extension-store.js +176 -0
  424. package/dist/lifeops/browser-extension-store.js.map +1 -0
  425. package/dist/lifeops/browser-session-lifecycle.d.ts +57 -0
  426. package/dist/lifeops/browser-session-lifecycle.d.ts.map +1 -0
  427. package/dist/lifeops/browser-session-lifecycle.js +308 -0
  428. package/dist/lifeops/browser-session-lifecycle.js.map +1 -0
  429. package/dist/lifeops/bulk-review.d.ts +333 -0
  430. package/dist/lifeops/bulk-review.d.ts.map +1 -0
  431. package/dist/lifeops/bulk-review.js +1120 -0
  432. package/dist/lifeops/bulk-review.js.map +1 -0
  433. package/dist/lifeops/calendar-gate.d.ts +20 -0
  434. package/dist/lifeops/calendar-gate.d.ts.map +1 -0
  435. package/dist/lifeops/calendar-gate.js +30 -0
  436. package/dist/lifeops/calendar-gate.js.map +1 -0
  437. package/dist/lifeops/channels/contract.d.ts +47 -0
  438. package/dist/lifeops/channels/contract.d.ts.map +1 -0
  439. package/dist/lifeops/channels/contract.js +1 -0
  440. package/dist/lifeops/channels/contract.js.map +1 -0
  441. package/dist/lifeops/channels/default-pack.d.ts +26 -0
  442. package/dist/lifeops/channels/default-pack.d.ts.map +1 -0
  443. package/dist/lifeops/channels/default-pack.js +243 -0
  444. package/dist/lifeops/channels/default-pack.js.map +1 -0
  445. package/dist/lifeops/channels/index.d.ts +5 -0
  446. package/dist/lifeops/channels/index.d.ts.map +1 -0
  447. package/dist/lifeops/channels/index.js +23 -0
  448. package/dist/lifeops/channels/index.js.map +1 -0
  449. package/dist/lifeops/channels/priority-posture.d.ts +36 -0
  450. package/dist/lifeops/channels/priority-posture.d.ts.map +1 -0
  451. package/dist/lifeops/channels/priority-posture.js +27 -0
  452. package/dist/lifeops/channels/priority-posture.js.map +1 -0
  453. package/dist/lifeops/channels/registry.d.ts +7 -0
  454. package/dist/lifeops/channels/registry.d.ts.map +1 -0
  455. package/dist/lifeops/channels/registry.js +49 -0
  456. package/dist/lifeops/channels/registry.js.map +1 -0
  457. package/dist/lifeops/checkin/checkin-service.d.ts +66 -0
  458. package/dist/lifeops/checkin/checkin-service.d.ts.map +1 -0
  459. package/dist/lifeops/checkin/checkin-service.js +1084 -0
  460. package/dist/lifeops/checkin/checkin-service.js.map +1 -0
  461. package/dist/lifeops/checkin/schedule-resolver.d.ts +17 -0
  462. package/dist/lifeops/checkin/schedule-resolver.d.ts.map +1 -0
  463. package/dist/lifeops/checkin/schedule-resolver.js +26 -0
  464. package/dist/lifeops/checkin/schedule-resolver.js.map +1 -0
  465. package/dist/lifeops/checkin/types.d.ts +106 -0
  466. package/dist/lifeops/checkin/types.d.ts.map +1 -0
  467. package/dist/lifeops/checkin/types.js +1 -0
  468. package/dist/lifeops/checkin/types.js.map +1 -0
  469. package/dist/lifeops/connectors/_helpers.d.ts +51 -0
  470. package/dist/lifeops/connectors/_helpers.d.ts.map +1 -0
  471. package/dist/lifeops/connectors/_helpers.js +104 -0
  472. package/dist/lifeops/connectors/_helpers.js.map +1 -0
  473. package/dist/lifeops/connectors/calendly.d.ts +11 -0
  474. package/dist/lifeops/connectors/calendly.d.ts.map +1 -0
  475. package/dist/lifeops/connectors/calendly.js +61 -0
  476. package/dist/lifeops/connectors/calendly.js.map +1 -0
  477. package/dist/lifeops/connectors/contract.d.ts +88 -0
  478. package/dist/lifeops/connectors/contract.d.ts.map +1 -0
  479. package/dist/lifeops/connectors/contract.js +1 -0
  480. package/dist/lifeops/connectors/contract.js.map +1 -0
  481. package/dist/lifeops/connectors/default-pack.d.ts +35 -0
  482. package/dist/lifeops/connectors/default-pack.d.ts.map +1 -0
  483. package/dist/lifeops/connectors/default-pack.js +37 -0
  484. package/dist/lifeops/connectors/default-pack.js.map +1 -0
  485. package/dist/lifeops/connectors/discord.d.ts +8 -0
  486. package/dist/lifeops/connectors/discord.d.ts.map +1 -0
  487. package/dist/lifeops/connectors/discord.js +53 -0
  488. package/dist/lifeops/connectors/discord.js.map +1 -0
  489. package/dist/lifeops/connectors/dispatch-policy.d.ts +75 -0
  490. package/dist/lifeops/connectors/dispatch-policy.d.ts.map +1 -0
  491. package/dist/lifeops/connectors/dispatch-policy.js +35 -0
  492. package/dist/lifeops/connectors/dispatch-policy.js.map +1 -0
  493. package/dist/lifeops/connectors/duffel.d.ts +11 -0
  494. package/dist/lifeops/connectors/duffel.d.ts.map +1 -0
  495. package/dist/lifeops/connectors/duffel.js +74 -0
  496. package/dist/lifeops/connectors/duffel.js.map +1 -0
  497. package/dist/lifeops/connectors/google.d.ts +27 -0
  498. package/dist/lifeops/connectors/google.d.ts.map +1 -0
  499. package/dist/lifeops/connectors/google.js +80 -0
  500. package/dist/lifeops/connectors/google.js.map +1 -0
  501. package/dist/lifeops/connectors/imessage.d.ts +11 -0
  502. package/dist/lifeops/connectors/imessage.d.ts.map +1 -0
  503. package/dist/lifeops/connectors/imessage.js +55 -0
  504. package/dist/lifeops/connectors/imessage.js.map +1 -0
  505. package/dist/lifeops/connectors/index.d.ts +5 -0
  506. package/dist/lifeops/connectors/index.d.ts.map +1 -0
  507. package/dist/lifeops/connectors/index.js +23 -0
  508. package/dist/lifeops/connectors/index.js.map +1 -0
  509. package/dist/lifeops/connectors/mockoon-redirect.d.ts +54 -0
  510. package/dist/lifeops/connectors/mockoon-redirect.d.ts.map +1 -0
  511. package/dist/lifeops/connectors/mockoon-redirect.js +71 -0
  512. package/dist/lifeops/connectors/mockoon-redirect.js.map +1 -0
  513. package/dist/lifeops/connectors/registry.d.ts +7 -0
  514. package/dist/lifeops/connectors/registry.d.ts.map +1 -0
  515. package/dist/lifeops/connectors/registry.js +55 -0
  516. package/dist/lifeops/connectors/registry.js.map +1 -0
  517. package/dist/lifeops/connectors/signal.d.ts +8 -0
  518. package/dist/lifeops/connectors/signal.d.ts.map +1 -0
  519. package/dist/lifeops/connectors/signal.js +60 -0
  520. package/dist/lifeops/connectors/signal.js.map +1 -0
  521. package/dist/lifeops/connectors/telegram.d.ts +12 -0
  522. package/dist/lifeops/connectors/telegram.d.ts.map +1 -0
  523. package/dist/lifeops/connectors/telegram.js +65 -0
  524. package/dist/lifeops/connectors/telegram.js.map +1 -0
  525. package/dist/lifeops/connectors/twilio.d.ts +15 -0
  526. package/dist/lifeops/connectors/twilio.d.ts.map +1 -0
  527. package/dist/lifeops/connectors/twilio.js +126 -0
  528. package/dist/lifeops/connectors/twilio.js.map +1 -0
  529. package/dist/lifeops/connectors/whatsapp.d.ts +10 -0
  530. package/dist/lifeops/connectors/whatsapp.d.ts.map +1 -0
  531. package/dist/lifeops/connectors/whatsapp.js +56 -0
  532. package/dist/lifeops/connectors/whatsapp.js.map +1 -0
  533. package/dist/lifeops/connectors/x.d.ts +8 -0
  534. package/dist/lifeops/connectors/x.d.ts.map +1 -0
  535. package/dist/lifeops/connectors/x.js +62 -0
  536. package/dist/lifeops/connectors/x.js.map +1 -0
  537. package/dist/lifeops/contact-route-policy.d.ts +27 -0
  538. package/dist/lifeops/contact-route-policy.d.ts.map +1 -0
  539. package/dist/lifeops/contact-route-policy.js +153 -0
  540. package/dist/lifeops/contact-route-policy.js.map +1 -0
  541. package/dist/lifeops/continuity-probe.d.ts +49 -0
  542. package/dist/lifeops/continuity-probe.d.ts.map +1 -0
  543. package/dist/lifeops/continuity-probe.js +161 -0
  544. package/dist/lifeops/continuity-probe.js.map +1 -0
  545. package/dist/lifeops/cross-channel-search.d.ts +108 -0
  546. package/dist/lifeops/cross-channel-search.d.ts.map +1 -0
  547. package/dist/lifeops/cross-channel-search.js +888 -0
  548. package/dist/lifeops/cross-channel-search.js.map +1 -0
  549. package/dist/lifeops/defaults.d.ts +30 -0
  550. package/dist/lifeops/defaults.d.ts.map +1 -0
  551. package/dist/lifeops/defaults.js +206 -0
  552. package/dist/lifeops/defaults.js.map +1 -0
  553. package/dist/lifeops/device-bus-service.d.ts +16 -0
  554. package/dist/lifeops/device-bus-service.d.ts.map +1 -0
  555. package/dist/lifeops/device-bus-service.js +20 -0
  556. package/dist/lifeops/device-bus-service.js.map +1 -0
  557. package/dist/lifeops/device-identity.d.ts +31 -0
  558. package/dist/lifeops/device-identity.d.ts.map +1 -0
  559. package/dist/lifeops/device-identity.js +94 -0
  560. package/dist/lifeops/device-identity.js.map +1 -0
  561. package/dist/lifeops/document-review.d.ts +264 -0
  562. package/dist/lifeops/document-review.d.ts.map +1 -0
  563. package/dist/lifeops/document-review.js +925 -0
  564. package/dist/lifeops/document-review.js.map +1 -0
  565. package/dist/lifeops/email-classifier.d.ts +9 -0
  566. package/dist/lifeops/email-classifier.d.ts.map +1 -0
  567. package/dist/lifeops/email-classifier.js +15 -0
  568. package/dist/lifeops/email-classifier.js.map +1 -0
  569. package/dist/lifeops/email-curation.d.ts +13 -0
  570. package/dist/lifeops/email-curation.d.ts.map +1 -0
  571. package/dist/lifeops/email-curation.js +2 -0
  572. package/dist/lifeops/email-curation.js.map +1 -0
  573. package/dist/lifeops/email-unsubscribe-types.d.ts +7 -0
  574. package/dist/lifeops/email-unsubscribe-types.d.ts.map +1 -0
  575. package/dist/lifeops/email-unsubscribe-types.js +1 -0
  576. package/dist/lifeops/email-unsubscribe-types.js.map +1 -0
  577. package/dist/lifeops/enforcement-windows.d.ts +34 -0
  578. package/dist/lifeops/enforcement-windows.d.ts.map +1 -0
  579. package/dist/lifeops/enforcement-windows.js +80 -0
  580. package/dist/lifeops/enforcement-windows.js.map +1 -0
  581. package/dist/lifeops/engine.d.ts +8 -0
  582. package/dist/lifeops/engine.d.ts.map +1 -0
  583. package/dist/lifeops/engine.js +540 -0
  584. package/dist/lifeops/engine.js.map +1 -0
  585. package/dist/lifeops/entities/index.d.ts +4 -0
  586. package/dist/lifeops/entities/index.d.ts.map +1 -0
  587. package/dist/lifeops/entities/index.js +29 -0
  588. package/dist/lifeops/entities/index.js.map +1 -0
  589. package/dist/lifeops/entities/merge.d.ts +9 -0
  590. package/dist/lifeops/entities/merge.d.ts.map +1 -0
  591. package/dist/lifeops/entities/merge.js +17 -0
  592. package/dist/lifeops/entities/merge.js.map +1 -0
  593. package/dist/lifeops/entities/store.d.ts +13 -0
  594. package/dist/lifeops/entities/store.d.ts.map +1 -0
  595. package/dist/lifeops/entities/store.js +7 -0
  596. package/dist/lifeops/entities/store.js.map +1 -0
  597. package/dist/lifeops/entities/types.d.ts +9 -0
  598. package/dist/lifeops/entities/types.d.ts.map +1 -0
  599. package/dist/lifeops/entities/types.js +13 -0
  600. package/dist/lifeops/entities/types.js.map +1 -0
  601. package/dist/lifeops/entities/voice-attribution.d.ts +70 -0
  602. package/dist/lifeops/entities/voice-attribution.d.ts.map +1 -0
  603. package/dist/lifeops/entities/voice-attribution.js +121 -0
  604. package/dist/lifeops/entities/voice-attribution.js.map +1 -0
  605. package/dist/lifeops/entities/voice-observer-bridge.d.ts +32 -0
  606. package/dist/lifeops/entities/voice-observer-bridge.d.ts.map +1 -0
  607. package/dist/lifeops/entities/voice-observer-bridge.js +68 -0
  608. package/dist/lifeops/entities/voice-observer-bridge.js.map +1 -0
  609. package/dist/lifeops/entities/voice-observer.d.ts +72 -0
  610. package/dist/lifeops/entities/voice-observer.d.ts.map +1 -0
  611. package/dist/lifeops/entities/voice-observer.js +97 -0
  612. package/dist/lifeops/entities/voice-observer.js.map +1 -0
  613. package/dist/lifeops/escalation-ladders.d.ts +28 -0
  614. package/dist/lifeops/escalation-ladders.d.ts.map +1 -0
  615. package/dist/lifeops/escalation-ladders.js +17 -0
  616. package/dist/lifeops/escalation-ladders.js.map +1 -0
  617. package/dist/lifeops/fda-probe.d.ts +23 -0
  618. package/dist/lifeops/fda-probe.d.ts.map +1 -0
  619. package/dist/lifeops/fda-probe.js +59 -0
  620. package/dist/lifeops/fda-probe.js.map +1 -0
  621. package/dist/lifeops/feature-flags.d.ts +24 -0
  622. package/dist/lifeops/feature-flags.d.ts.map +1 -0
  623. package/dist/lifeops/feature-flags.js +261 -0
  624. package/dist/lifeops/feature-flags.js.map +1 -0
  625. package/dist/lifeops/feature-flags.types.d.ts +156 -0
  626. package/dist/lifeops/feature-flags.types.d.ts.map +1 -0
  627. package/dist/lifeops/feature-flags.types.js +129 -0
  628. package/dist/lifeops/feature-flags.types.js.map +1 -0
  629. package/dist/lifeops/first-run/defaults.d.ts +57 -0
  630. package/dist/lifeops/first-run/defaults.d.ts.map +1 -0
  631. package/dist/lifeops/first-run/defaults.js +159 -0
  632. package/dist/lifeops/first-run/defaults.js.map +1 -0
  633. package/dist/lifeops/first-run/questions.d.ts +74 -0
  634. package/dist/lifeops/first-run/questions.d.ts.map +1 -0
  635. package/dist/lifeops/first-run/questions.js +184 -0
  636. package/dist/lifeops/first-run/questions.js.map +1 -0
  637. package/dist/lifeops/first-run/replay.d.ts +41 -0
  638. package/dist/lifeops/first-run/replay.d.ts.map +1 -0
  639. package/dist/lifeops/first-run/replay.js +34 -0
  640. package/dist/lifeops/first-run/replay.js.map +1 -0
  641. package/dist/lifeops/first-run/service.d.ts +147 -0
  642. package/dist/lifeops/first-run/service.d.ts.map +1 -0
  643. package/dist/lifeops/first-run/service.js +455 -0
  644. package/dist/lifeops/first-run/service.js.map +1 -0
  645. package/dist/lifeops/first-run/state.d.ts +36 -0
  646. package/dist/lifeops/first-run/state.d.ts.map +1 -0
  647. package/dist/lifeops/first-run/state.js +128 -0
  648. package/dist/lifeops/first-run/state.js.map +1 -0
  649. package/dist/lifeops/global-pause/store.d.ts +22 -0
  650. package/dist/lifeops/global-pause/store.d.ts.map +1 -0
  651. package/dist/lifeops/global-pause/store.js +18 -0
  652. package/dist/lifeops/global-pause/store.js.map +1 -0
  653. package/dist/lifeops/goal-grounding.d.ts +9 -0
  654. package/dist/lifeops/goal-grounding.d.ts.map +1 -0
  655. package/dist/lifeops/goal-grounding.js +19 -0
  656. package/dist/lifeops/goal-grounding.js.map +1 -0
  657. package/dist/lifeops/goal-semantic-evaluator.d.ts +8 -0
  658. package/dist/lifeops/goal-semantic-evaluator.d.ts.map +1 -0
  659. package/dist/lifeops/goal-semantic-evaluator.js +7 -0
  660. package/dist/lifeops/goal-semantic-evaluator.js.map +1 -0
  661. package/dist/lifeops/google/format-helpers.d.ts +63 -0
  662. package/dist/lifeops/google/format-helpers.d.ts.map +1 -0
  663. package/dist/lifeops/google/format-helpers.js +597 -0
  664. package/dist/lifeops/google/format-helpers.js.map +1 -0
  665. package/dist/lifeops/google-plugin-delegates.d.ts +59 -0
  666. package/dist/lifeops/google-plugin-delegates.d.ts.map +1 -0
  667. package/dist/lifeops/google-plugin-delegates.js +408 -0
  668. package/dist/lifeops/google-plugin-delegates.js.map +1 -0
  669. package/dist/lifeops/google-scopes.d.ts +15 -0
  670. package/dist/lifeops/google-scopes.d.ts.map +1 -0
  671. package/dist/lifeops/google-scopes.js +118 -0
  672. package/dist/lifeops/google-scopes.js.map +1 -0
  673. package/dist/lifeops/handoff/store.d.ts +23 -0
  674. package/dist/lifeops/handoff/store.d.ts.map +1 -0
  675. package/dist/lifeops/handoff/store.js +20 -0
  676. package/dist/lifeops/handoff/store.js.map +1 -0
  677. package/dist/lifeops/i18n/localized-examples-provider.d.ts +16 -0
  678. package/dist/lifeops/i18n/localized-examples-provider.d.ts.map +1 -0
  679. package/dist/lifeops/i18n/localized-examples-provider.js +33 -0
  680. package/dist/lifeops/i18n/localized-examples-provider.js.map +1 -0
  681. package/dist/lifeops/i18n/localized-examples-resolver.d.ts +32 -0
  682. package/dist/lifeops/i18n/localized-examples-resolver.d.ts.map +1 -0
  683. package/dist/lifeops/i18n/localized-examples-resolver.js +28 -0
  684. package/dist/lifeops/i18n/localized-examples-resolver.js.map +1 -0
  685. package/dist/lifeops/i18n/prompt-registry.d.ts +64 -0
  686. package/dist/lifeops/i18n/prompt-registry.d.ts.map +1 -0
  687. package/dist/lifeops/i18n/prompt-registry.js +283 -0
  688. package/dist/lifeops/i18n/prompt-registry.js.map +1 -0
  689. package/dist/lifeops/imessage-outbound-probe.d.ts +7 -0
  690. package/dist/lifeops/imessage-outbound-probe.d.ts.map +1 -0
  691. package/dist/lifeops/imessage-outbound-probe.js +81 -0
  692. package/dist/lifeops/imessage-outbound-probe.js.map +1 -0
  693. package/dist/lifeops/index.d.ts +24 -0
  694. package/dist/lifeops/index.d.ts.map +1 -0
  695. package/dist/lifeops/index.js +24 -0
  696. package/dist/lifeops/index.js.map +1 -0
  697. package/dist/lifeops/intent-sync.d.ts +64 -0
  698. package/dist/lifeops/intent-sync.d.ts.map +1 -0
  699. package/dist/lifeops/intent-sync.js +321 -0
  700. package/dist/lifeops/intent-sync.js.map +1 -0
  701. package/dist/lifeops/messaging/index.d.ts +2 -0
  702. package/dist/lifeops/messaging/index.d.ts.map +1 -0
  703. package/dist/lifeops/messaging/index.js +5 -0
  704. package/dist/lifeops/messaging/index.js.map +1 -0
  705. package/dist/lifeops/messaging/owner-send-policy.d.ts +3 -0
  706. package/dist/lifeops/messaging/owner-send-policy.d.ts.map +1 -0
  707. package/dist/lifeops/messaging/owner-send-policy.js +83 -0
  708. package/dist/lifeops/messaging/owner-send-policy.js.map +1 -0
  709. package/dist/lifeops/notifications-push.d.ts +37 -0
  710. package/dist/lifeops/notifications-push.d.ts.map +1 -0
  711. package/dist/lifeops/notifications-push.js +95 -0
  712. package/dist/lifeops/notifications-push.js.map +1 -0
  713. package/dist/lifeops/optimized-prompt-instructions.d.ts +5 -0
  714. package/dist/lifeops/optimized-prompt-instructions.d.ts.map +1 -0
  715. package/dist/lifeops/optimized-prompt-instructions.js +48 -0
  716. package/dist/lifeops/optimized-prompt-instructions.js.map +1 -0
  717. package/dist/lifeops/owner/fact-store.d.ts +143 -0
  718. package/dist/lifeops/owner/fact-store.d.ts.map +1 -0
  719. package/dist/lifeops/owner/fact-store.js +446 -0
  720. package/dist/lifeops/owner/fact-store.js.map +1 -0
  721. package/dist/lifeops/owner/profile-extraction-evaluator.d.ts +3 -0
  722. package/dist/lifeops/owner/profile-extraction-evaluator.d.ts.map +1 -0
  723. package/dist/lifeops/owner/profile-extraction-evaluator.js +241 -0
  724. package/dist/lifeops/owner/profile-extraction-evaluator.js.map +1 -0
  725. package/dist/lifeops/owner-profile.d.ts +61 -0
  726. package/dist/lifeops/owner-profile.d.ts.map +1 -0
  727. package/dist/lifeops/owner-profile.js +407 -0
  728. package/dist/lifeops/owner-profile.js.map +1 -0
  729. package/dist/lifeops/pending-prompts/store.d.ts +23 -0
  730. package/dist/lifeops/pending-prompts/store.d.ts.map +1 -0
  731. package/dist/lifeops/pending-prompts/store.js +16 -0
  732. package/dist/lifeops/pending-prompts/store.js.map +1 -0
  733. package/dist/lifeops/policy-memory.d.ts +190 -0
  734. package/dist/lifeops/policy-memory.d.ts.map +1 -0
  735. package/dist/lifeops/policy-memory.js +1026 -0
  736. package/dist/lifeops/policy-memory.js.map +1 -0
  737. package/dist/lifeops/priority-scoring.d.ts +51 -0
  738. package/dist/lifeops/priority-scoring.d.ts.map +1 -0
  739. package/dist/lifeops/priority-scoring.js +305 -0
  740. package/dist/lifeops/priority-scoring.js.map +1 -0
  741. package/dist/lifeops/privacy-egress.d.ts +92 -0
  742. package/dist/lifeops/privacy-egress.d.ts.map +1 -0
  743. package/dist/lifeops/privacy-egress.js +230 -0
  744. package/dist/lifeops/privacy-egress.js.map +1 -0
  745. package/dist/lifeops/privacy.d.ts +49 -0
  746. package/dist/lifeops/privacy.d.ts.map +1 -0
  747. package/dist/lifeops/privacy.js +66 -0
  748. package/dist/lifeops/privacy.js.map +1 -0
  749. package/dist/lifeops/redact-sensitive-data.d.ts +32 -0
  750. package/dist/lifeops/redact-sensitive-data.d.ts.map +1 -0
  751. package/dist/lifeops/redact-sensitive-data.js +98 -0
  752. package/dist/lifeops/redact-sensitive-data.js.map +1 -0
  753. package/dist/lifeops/registries/app-blocker-contribution.d.ts +13 -0
  754. package/dist/lifeops/registries/app-blocker-contribution.d.ts.map +1 -0
  755. package/dist/lifeops/registries/app-blocker-contribution.js +73 -0
  756. package/dist/lifeops/registries/app-blocker-contribution.js.map +1 -0
  757. package/dist/lifeops/registries/blocker-registry.d.ts +76 -0
  758. package/dist/lifeops/registries/blocker-registry.d.ts.map +1 -0
  759. package/dist/lifeops/registries/blocker-registry.js +40 -0
  760. package/dist/lifeops/registries/blocker-registry.js.map +1 -0
  761. package/dist/lifeops/registries/event-kind-registry.d.ts +57 -0
  762. package/dist/lifeops/registries/event-kind-registry.d.ts.map +1 -0
  763. package/dist/lifeops/registries/event-kind-registry.js +82 -0
  764. package/dist/lifeops/registries/event-kind-registry.js.map +1 -0
  765. package/dist/lifeops/registries/family-registry.d.ts +72 -0
  766. package/dist/lifeops/registries/family-registry.d.ts.map +1 -0
  767. package/dist/lifeops/registries/family-registry.js +98 -0
  768. package/dist/lifeops/registries/family-registry.js.map +1 -0
  769. package/dist/lifeops/registries/feature-flag-default-pack.d.ts +32 -0
  770. package/dist/lifeops/registries/feature-flag-default-pack.d.ts.map +1 -0
  771. package/dist/lifeops/registries/feature-flag-default-pack.js +36 -0
  772. package/dist/lifeops/registries/feature-flag-default-pack.js.map +1 -0
  773. package/dist/lifeops/registries/feature-flag-registry.d.ts +76 -0
  774. package/dist/lifeops/registries/feature-flag-registry.d.ts.map +1 -0
  775. package/dist/lifeops/registries/feature-flag-registry.js +68 -0
  776. package/dist/lifeops/registries/feature-flag-registry.js.map +1 -0
  777. package/dist/lifeops/registries/index.d.ts +24 -0
  778. package/dist/lifeops/registries/index.d.ts.map +1 -0
  779. package/dist/lifeops/registries/index.js +115 -0
  780. package/dist/lifeops/registries/index.js.map +1 -0
  781. package/dist/lifeops/registries/website-blocker-contribution.d.ts +21 -0
  782. package/dist/lifeops/registries/website-blocker-contribution.d.ts.map +1 -0
  783. package/dist/lifeops/registries/website-blocker-contribution.js +76 -0
  784. package/dist/lifeops/registries/website-blocker-contribution.js.map +1 -0
  785. package/dist/lifeops/registries/workflow-step-default-pack.d.ts +30 -0
  786. package/dist/lifeops/registries/workflow-step-default-pack.d.ts.map +1 -0
  787. package/dist/lifeops/registries/workflow-step-default-pack.js +315 -0
  788. package/dist/lifeops/registries/workflow-step-default-pack.js.map +1 -0
  789. package/dist/lifeops/registries/workflow-step-registry.d.ts +101 -0
  790. package/dist/lifeops/registries/workflow-step-registry.d.ts.map +1 -0
  791. package/dist/lifeops/registries/workflow-step-registry.js +56 -0
  792. package/dist/lifeops/registries/workflow-step-registry.js.map +1 -0
  793. package/dist/lifeops/relationships/extraction.d.ts +77 -0
  794. package/dist/lifeops/relationships/extraction.d.ts.map +1 -0
  795. package/dist/lifeops/relationships/extraction.js +146 -0
  796. package/dist/lifeops/relationships/extraction.js.map +1 -0
  797. package/dist/lifeops/relationships/index.d.ts +4 -0
  798. package/dist/lifeops/relationships/index.d.ts.map +1 -0
  799. package/dist/lifeops/relationships/index.js +19 -0
  800. package/dist/lifeops/relationships/index.js.map +1 -0
  801. package/dist/lifeops/relationships/mapping.d.ts +34 -0
  802. package/dist/lifeops/relationships/mapping.d.ts.map +1 -0
  803. package/dist/lifeops/relationships/mapping.js +87 -0
  804. package/dist/lifeops/relationships/mapping.js.map +1 -0
  805. package/dist/lifeops/relationships/store.d.ts +12 -0
  806. package/dist/lifeops/relationships/store.d.ts.map +1 -0
  807. package/dist/lifeops/relationships/store.js +5 -0
  808. package/dist/lifeops/relationships/store.js.map +1 -0
  809. package/dist/lifeops/relationships/types.d.ts +9 -0
  810. package/dist/lifeops/relationships/types.d.ts.map +1 -0
  811. package/dist/lifeops/relationships/types.js +11 -0
  812. package/dist/lifeops/relationships/types.js.map +1 -0
  813. package/dist/lifeops/relative-schedule-resolver.d.ts +13 -0
  814. package/dist/lifeops/relative-schedule-resolver.d.ts.map +1 -0
  815. package/dist/lifeops/relative-schedule-resolver.js +107 -0
  816. package/dist/lifeops/relative-schedule-resolver.js.map +1 -0
  817. package/dist/lifeops/relative-time.d.ts +15 -0
  818. package/dist/lifeops/relative-time.d.ts.map +1 -0
  819. package/dist/lifeops/relative-time.js +191 -0
  820. package/dist/lifeops/relative-time.js.map +1 -0
  821. package/dist/lifeops/repository.d.ts +638 -0
  822. package/dist/lifeops/repository.d.ts.map +1 -0
  823. package/dist/lifeops/repository.js +6289 -0
  824. package/dist/lifeops/repository.js.map +1 -0
  825. package/dist/lifeops/runtime-cache.d.ts +4 -0
  826. package/dist/lifeops/runtime-cache.d.ts.map +1 -0
  827. package/dist/lifeops/runtime-cache.js +7 -0
  828. package/dist/lifeops/runtime-cache.js.map +1 -0
  829. package/dist/lifeops/runtime-service-delegates.d.ts +236 -0
  830. package/dist/lifeops/runtime-service-delegates.d.ts.map +1 -0
  831. package/dist/lifeops/runtime-service-delegates.js +839 -0
  832. package/dist/lifeops/runtime-service-delegates.js.map +1 -0
  833. package/dist/lifeops/runtime.d.ts +13 -0
  834. package/dist/lifeops/runtime.d.ts.map +1 -0
  835. package/dist/lifeops/runtime.js +104 -0
  836. package/dist/lifeops/runtime.js.map +1 -0
  837. package/dist/lifeops/schedule-insight.d.ts +133 -0
  838. package/dist/lifeops/schedule-insight.d.ts.map +1 -0
  839. package/dist/lifeops/schedule-insight.js +726 -0
  840. package/dist/lifeops/schedule-insight.js.map +1 -0
  841. package/dist/lifeops/schedule-state.d.ts +39 -0
  842. package/dist/lifeops/schedule-state.d.ts.map +1 -0
  843. package/dist/lifeops/schedule-state.js +671 -0
  844. package/dist/lifeops/schedule-state.js.map +1 -0
  845. package/dist/lifeops/schedule-sync-config.d.ts +3 -0
  846. package/dist/lifeops/schedule-sync-config.d.ts.map +1 -0
  847. package/dist/lifeops/schedule-sync-config.js +23 -0
  848. package/dist/lifeops/schedule-sync-config.js.map +1 -0
  849. package/dist/lifeops/schedule-sync-contracts.d.ts +2 -0
  850. package/dist/lifeops/schedule-sync-contracts.d.ts.map +1 -0
  851. package/dist/lifeops/schedule-sync-contracts.js +2 -0
  852. package/dist/lifeops/schedule-sync-contracts.js.map +1 -0
  853. package/dist/lifeops/scheduled-task/index.d.ts +13 -0
  854. package/dist/lifeops/scheduled-task/index.d.ts.map +1 -0
  855. package/dist/lifeops/scheduled-task/index.js +14 -0
  856. package/dist/lifeops/scheduled-task/index.js.map +1 -0
  857. package/dist/lifeops/scheduled-task/runtime-wiring.d.ts +33 -0
  858. package/dist/lifeops/scheduled-task/runtime-wiring.d.ts.map +1 -0
  859. package/dist/lifeops/scheduled-task/runtime-wiring.js +334 -0
  860. package/dist/lifeops/scheduled-task/runtime-wiring.js.map +1 -0
  861. package/dist/lifeops/scheduled-task/scheduler.d.ts +28 -0
  862. package/dist/lifeops/scheduled-task/scheduler.d.ts.map +1 -0
  863. package/dist/lifeops/scheduled-task/scheduler.js +202 -0
  864. package/dist/lifeops/scheduled-task/scheduler.js.map +1 -0
  865. package/dist/lifeops/scheduled-task/service.d.ts +61 -0
  866. package/dist/lifeops/scheduled-task/service.d.ts.map +1 -0
  867. package/dist/lifeops/scheduled-task/service.js +64 -0
  868. package/dist/lifeops/scheduled-task/service.js.map +1 -0
  869. package/dist/lifeops/scheduler-task.d.ts +19 -0
  870. package/dist/lifeops/scheduler-task.d.ts.map +1 -0
  871. package/dist/lifeops/scheduler-task.js +201 -0
  872. package/dist/lifeops/scheduler-task.js.map +1 -0
  873. package/dist/lifeops/schema.d.ts +28068 -0
  874. package/dist/lifeops/schema.d.ts.map +1 -0
  875. package/dist/lifeops/schema.js +1689 -0
  876. package/dist/lifeops/schema.js.map +1 -0
  877. package/dist/lifeops/screen-context.d.ts +66 -0
  878. package/dist/lifeops/screen-context.d.ts.map +1 -0
  879. package/dist/lifeops/screen-context.js +347 -0
  880. package/dist/lifeops/screen-context.js.map +1 -0
  881. package/dist/lifeops/seed-routine-migration/migrator.d.ts +113 -0
  882. package/dist/lifeops/seed-routine-migration/migrator.d.ts.map +1 -0
  883. package/dist/lifeops/seed-routine-migration/migrator.js +142 -0
  884. package/dist/lifeops/seed-routine-migration/migrator.js.map +1 -0
  885. package/dist/lifeops/seed-routines.d.ts +24 -0
  886. package/dist/lifeops/seed-routines.d.ts.map +1 -0
  887. package/dist/lifeops/seed-routines.js +140 -0
  888. package/dist/lifeops/seed-routines.js.map +1 -0
  889. package/dist/lifeops/send-policy/contract.d.ts +81 -0
  890. package/dist/lifeops/send-policy/contract.d.ts.map +1 -0
  891. package/dist/lifeops/send-policy/contract.js +1 -0
  892. package/dist/lifeops/send-policy/contract.js.map +1 -0
  893. package/dist/lifeops/send-policy/index.d.ts +3 -0
  894. package/dist/lifeops/send-policy/index.d.ts.map +1 -0
  895. package/dist/lifeops/send-policy/index.js +13 -0
  896. package/dist/lifeops/send-policy/index.js.map +1 -0
  897. package/dist/lifeops/send-policy/registry.d.ts +7 -0
  898. package/dist/lifeops/send-policy/registry.d.ts.map +1 -0
  899. package/dist/lifeops/send-policy/registry.js +62 -0
  900. package/dist/lifeops/send-policy/registry.js.map +1 -0
  901. package/dist/lifeops/sensitive-request-delivery.d.ts +46 -0
  902. package/dist/lifeops/sensitive-request-delivery.d.ts.map +1 -0
  903. package/dist/lifeops/sensitive-request-delivery.js +103 -0
  904. package/dist/lifeops/sensitive-request-delivery.js.map +1 -0
  905. package/dist/lifeops/service-constants.d.ts +10 -0
  906. package/dist/lifeops/service-constants.d.ts.map +1 -0
  907. package/dist/lifeops/service-constants.js +129 -0
  908. package/dist/lifeops/service-constants.js.map +1 -0
  909. package/dist/lifeops/service-helpers-browser.d.ts +41 -0
  910. package/dist/lifeops/service-helpers-browser.d.ts.map +1 -0
  911. package/dist/lifeops/service-helpers-browser.js +290 -0
  912. package/dist/lifeops/service-helpers-browser.js.map +1 -0
  913. package/dist/lifeops/service-helpers-misc.d.ts +68 -0
  914. package/dist/lifeops/service-helpers-misc.d.ts.map +1 -0
  915. package/dist/lifeops/service-helpers-misc.js +531 -0
  916. package/dist/lifeops/service-helpers-misc.js.map +1 -0
  917. package/dist/lifeops/service-helpers-occurrence.d.ts +23 -0
  918. package/dist/lifeops/service-helpers-occurrence.d.ts.map +1 -0
  919. package/dist/lifeops/service-helpers-occurrence.js +257 -0
  920. package/dist/lifeops/service-helpers-occurrence.js.map +1 -0
  921. package/dist/lifeops/service-helpers-reminder.d.ts +260 -0
  922. package/dist/lifeops/service-helpers-reminder.d.ts.map +1 -0
  923. package/dist/lifeops/service-helpers-reminder.js +1186 -0
  924. package/dist/lifeops/service-helpers-reminder.js.map +1 -0
  925. package/dist/lifeops/service-mixin-browser.d.ts +31 -0
  926. package/dist/lifeops/service-mixin-browser.d.ts.map +1 -0
  927. package/dist/lifeops/service-mixin-browser.js +975 -0
  928. package/dist/lifeops/service-mixin-browser.js.map +1 -0
  929. package/dist/lifeops/service-mixin-calendar.d.ts +53 -0
  930. package/dist/lifeops/service-mixin-calendar.d.ts.map +1 -0
  931. package/dist/lifeops/service-mixin-calendar.js +68 -0
  932. package/dist/lifeops/service-mixin-calendar.js.map +1 -0
  933. package/dist/lifeops/service-mixin-core.d.ts +51 -0
  934. package/dist/lifeops/service-mixin-core.d.ts.map +1 -0
  935. package/dist/lifeops/service-mixin-core.js +500 -0
  936. package/dist/lifeops/service-mixin-core.js.map +1 -0
  937. package/dist/lifeops/service-mixin-definitions.d.ts +14 -0
  938. package/dist/lifeops/service-mixin-definitions.d.ts.map +1 -0
  939. package/dist/lifeops/service-mixin-definitions.js +470 -0
  940. package/dist/lifeops/service-mixin-definitions.js.map +1 -0
  941. package/dist/lifeops/service-mixin-discord.d.ts +49 -0
  942. package/dist/lifeops/service-mixin-discord.d.ts.map +1 -0
  943. package/dist/lifeops/service-mixin-discord.js +1253 -0
  944. package/dist/lifeops/service-mixin-discord.js.map +1 -0
  945. package/dist/lifeops/service-mixin-drive.d.ts +96 -0
  946. package/dist/lifeops/service-mixin-drive.d.ts.map +1 -0
  947. package/dist/lifeops/service-mixin-drive.js +213 -0
  948. package/dist/lifeops/service-mixin-drive.js.map +1 -0
  949. package/dist/lifeops/service-mixin-email-unsubscribe.d.ts +23 -0
  950. package/dist/lifeops/service-mixin-email-unsubscribe.d.ts.map +1 -0
  951. package/dist/lifeops/service-mixin-email-unsubscribe.js +27 -0
  952. package/dist/lifeops/service-mixin-email-unsubscribe.js.map +1 -0
  953. package/dist/lifeops/service-mixin-gmail.d.ts +43 -0
  954. package/dist/lifeops/service-mixin-gmail.d.ts.map +1 -0
  955. package/dist/lifeops/service-mixin-gmail.js +727 -0
  956. package/dist/lifeops/service-mixin-gmail.js.map +1 -0
  957. package/dist/lifeops/service-mixin-goals.d.ts +22 -0
  958. package/dist/lifeops/service-mixin-goals.d.ts.map +1 -0
  959. package/dist/lifeops/service-mixin-goals.js +884 -0
  960. package/dist/lifeops/service-mixin-goals.js.map +1 -0
  961. package/dist/lifeops/service-mixin-google.d.ts +13 -0
  962. package/dist/lifeops/service-mixin-google.d.ts.map +1 -0
  963. package/dist/lifeops/service-mixin-google.js +398 -0
  964. package/dist/lifeops/service-mixin-google.js.map +1 -0
  965. package/dist/lifeops/service-mixin-health.d.ts +27 -0
  966. package/dist/lifeops/service-mixin-health.d.ts.map +1 -0
  967. package/dist/lifeops/service-mixin-health.js +670 -0
  968. package/dist/lifeops/service-mixin-health.js.map +1 -0
  969. package/dist/lifeops/service-mixin-imessage.d.ts +106 -0
  970. package/dist/lifeops/service-mixin-imessage.d.ts.map +1 -0
  971. package/dist/lifeops/service-mixin-imessage.js +303 -0
  972. package/dist/lifeops/service-mixin-imessage.js.map +1 -0
  973. package/dist/lifeops/service-mixin-inbox.d.ts +55 -0
  974. package/dist/lifeops/service-mixin-inbox.d.ts.map +1 -0
  975. package/dist/lifeops/service-mixin-inbox.js +597 -0
  976. package/dist/lifeops/service-mixin-inbox.js.map +1 -0
  977. package/dist/lifeops/service-mixin-relationships.d.ts +65 -0
  978. package/dist/lifeops/service-mixin-relationships.d.ts.map +1 -0
  979. package/dist/lifeops/service-mixin-relationships.js +150 -0
  980. package/dist/lifeops/service-mixin-relationships.js.map +1 -0
  981. package/dist/lifeops/service-mixin-reminders.d.ts +62 -0
  982. package/dist/lifeops/service-mixin-reminders.d.ts.map +1 -0
  983. package/dist/lifeops/service-mixin-reminders.js +4003 -0
  984. package/dist/lifeops/service-mixin-reminders.js.map +1 -0
  985. package/dist/lifeops/service-mixin-scheduling.d.ts +53 -0
  986. package/dist/lifeops/service-mixin-scheduling.d.ts.map +1 -0
  987. package/dist/lifeops/service-mixin-scheduling.js +405 -0
  988. package/dist/lifeops/service-mixin-scheduling.js.map +1 -0
  989. package/dist/lifeops/service-mixin-screentime.d.ts +71 -0
  990. package/dist/lifeops/service-mixin-screentime.d.ts.map +1 -0
  991. package/dist/lifeops/service-mixin-screentime.js +530 -0
  992. package/dist/lifeops/service-mixin-screentime.js.map +1 -0
  993. package/dist/lifeops/service-mixin-signal.d.ts +74 -0
  994. package/dist/lifeops/service-mixin-signal.d.ts.map +1 -0
  995. package/dist/lifeops/service-mixin-signal.js +214 -0
  996. package/dist/lifeops/service-mixin-signal.js.map +1 -0
  997. package/dist/lifeops/service-mixin-sleep.d.ts +68 -0
  998. package/dist/lifeops/service-mixin-sleep.d.ts.map +1 -0
  999. package/dist/lifeops/service-mixin-sleep.js +43 -0
  1000. package/dist/lifeops/service-mixin-sleep.js.map +1 -0
  1001. package/dist/lifeops/service-mixin-status.d.ts +31 -0
  1002. package/dist/lifeops/service-mixin-status.d.ts.map +1 -0
  1003. package/dist/lifeops/service-mixin-status.js +373 -0
  1004. package/dist/lifeops/service-mixin-status.js.map +1 -0
  1005. package/dist/lifeops/service-mixin-subscriptions.d.ts +101 -0
  1006. package/dist/lifeops/service-mixin-subscriptions.d.ts.map +1 -0
  1007. package/dist/lifeops/service-mixin-subscriptions.js +50 -0
  1008. package/dist/lifeops/service-mixin-subscriptions.js.map +1 -0
  1009. package/dist/lifeops/service-mixin-telegram.d.ts +104 -0
  1010. package/dist/lifeops/service-mixin-telegram.d.ts.map +1 -0
  1011. package/dist/lifeops/service-mixin-telegram.js +280 -0
  1012. package/dist/lifeops/service-mixin-telegram.js.map +1 -0
  1013. package/dist/lifeops/service-mixin-travel.d.ts +66 -0
  1014. package/dist/lifeops/service-mixin-travel.d.ts.map +1 -0
  1015. package/dist/lifeops/service-mixin-travel.js +275 -0
  1016. package/dist/lifeops/service-mixin-travel.js.map +1 -0
  1017. package/dist/lifeops/service-mixin-whatsapp.d.ts +96 -0
  1018. package/dist/lifeops/service-mixin-whatsapp.d.ts.map +1 -0
  1019. package/dist/lifeops/service-mixin-whatsapp.js +186 -0
  1020. package/dist/lifeops/service-mixin-whatsapp.js.map +1 -0
  1021. package/dist/lifeops/service-mixin-workflows.d.ts +15 -0
  1022. package/dist/lifeops/service-mixin-workflows.d.ts.map +1 -0
  1023. package/dist/lifeops/service-mixin-workflows.js +710 -0
  1024. package/dist/lifeops/service-mixin-workflows.js.map +1 -0
  1025. package/dist/lifeops/service-mixin-x-read.d.ts +31 -0
  1026. package/dist/lifeops/service-mixin-x-read.d.ts.map +1 -0
  1027. package/dist/lifeops/service-mixin-x-read.js +267 -0
  1028. package/dist/lifeops/service-mixin-x-read.js.map +1 -0
  1029. package/dist/lifeops/service-mixin-x.d.ts +66 -0
  1030. package/dist/lifeops/service-mixin-x.d.ts.map +1 -0
  1031. package/dist/lifeops/service-mixin-x.js +501 -0
  1032. package/dist/lifeops/service-mixin-x.js.map +1 -0
  1033. package/dist/lifeops/service-normalize-connector.d.ts +19 -0
  1034. package/dist/lifeops/service-normalize-connector.d.ts.map +1 -0
  1035. package/dist/lifeops/service-normalize-connector.js +816 -0
  1036. package/dist/lifeops/service-normalize-connector.js.map +1 -0
  1037. package/dist/lifeops/service-normalize-gmail.d.ts +11 -0
  1038. package/dist/lifeops/service-normalize-gmail.d.ts.map +1 -0
  1039. package/dist/lifeops/service-normalize-gmail.js +85 -0
  1040. package/dist/lifeops/service-normalize-gmail.js.map +1 -0
  1041. package/dist/lifeops/service-normalize-task.d.ts +9 -0
  1042. package/dist/lifeops/service-normalize-task.d.ts.map +1 -0
  1043. package/dist/lifeops/service-normalize-task.js +567 -0
  1044. package/dist/lifeops/service-normalize-task.js.map +1 -0
  1045. package/dist/lifeops/service-normalize.d.ts +9 -0
  1046. package/dist/lifeops/service-normalize.d.ts.map +1 -0
  1047. package/dist/lifeops/service-normalize.js +53 -0
  1048. package/dist/lifeops/service-normalize.js.map +1 -0
  1049. package/dist/lifeops/service-types.d.ts +75 -0
  1050. package/dist/lifeops/service-types.d.ts.map +1 -0
  1051. package/dist/lifeops/service-types.js +5 -0
  1052. package/dist/lifeops/service-types.js.map +1 -0
  1053. package/dist/lifeops/service.d.ts +482 -0
  1054. package/dist/lifeops/service.d.ts.map +1 -0
  1055. package/dist/lifeops/service.js +62 -0
  1056. package/dist/lifeops/service.js.map +1 -0
  1057. package/dist/lifeops/signal-runtime-config.d.ts +13 -0
  1058. package/dist/lifeops/signal-runtime-config.d.ts.map +1 -0
  1059. package/dist/lifeops/signal-runtime-config.js +44 -0
  1060. package/dist/lifeops/signal-runtime-config.js.map +1 -0
  1061. package/dist/lifeops/signals/bus.d.ts +78 -0
  1062. package/dist/lifeops/signals/bus.d.ts.map +1 -0
  1063. package/dist/lifeops/signals/bus.js +117 -0
  1064. package/dist/lifeops/signals/bus.js.map +1 -0
  1065. package/dist/lifeops/sql.d.ts +65 -0
  1066. package/dist/lifeops/sql.d.ts.map +1 -0
  1067. package/dist/lifeops/sql.js +182 -0
  1068. package/dist/lifeops/sql.js.map +1 -0
  1069. package/dist/lifeops/stretch-decider.d.ts +73 -0
  1070. package/dist/lifeops/stretch-decider.d.ts.map +1 -0
  1071. package/dist/lifeops/stretch-decider.js +49 -0
  1072. package/dist/lifeops/stretch-decider.js.map +1 -0
  1073. package/dist/lifeops/telemetry-mapping.d.ts +14 -0
  1074. package/dist/lifeops/telemetry-mapping.d.ts.map +1 -0
  1075. package/dist/lifeops/telemetry-mapping.js +115 -0
  1076. package/dist/lifeops/telemetry-mapping.js.map +1 -0
  1077. package/dist/lifeops/telemetry-retention.d.ts +21 -0
  1078. package/dist/lifeops/telemetry-retention.d.ts.map +1 -0
  1079. package/dist/lifeops/telemetry-retention.js +13 -0
  1080. package/dist/lifeops/telemetry-retention.js.map +1 -0
  1081. package/dist/lifeops/time/timezone.d.ts +4 -0
  1082. package/dist/lifeops/time/timezone.d.ts.map +1 -0
  1083. package/dist/lifeops/time/timezone.js +154 -0
  1084. package/dist/lifeops/time/timezone.js.map +1 -0
  1085. package/dist/lifeops/time-util.d.ts +10 -0
  1086. package/dist/lifeops/time-util.d.ts.map +1 -0
  1087. package/dist/lifeops/time-util.js +14 -0
  1088. package/dist/lifeops/time-util.js.map +1 -0
  1089. package/dist/lifeops/time.d.ts +17 -0
  1090. package/dist/lifeops/time.d.ts.map +1 -0
  1091. package/dist/lifeops/time.js +152 -0
  1092. package/dist/lifeops/time.js.map +1 -0
  1093. package/dist/lifeops/travel-booking.types.d.ts +46 -0
  1094. package/dist/lifeops/travel-booking.types.d.ts.map +1 -0
  1095. package/dist/lifeops/travel-booking.types.js +1 -0
  1096. package/dist/lifeops/travel-booking.types.js.map +1 -0
  1097. package/dist/lifeops/triggers/schedule-once.d.ts +19 -0
  1098. package/dist/lifeops/triggers/schedule-once.d.ts.map +1 -0
  1099. package/dist/lifeops/triggers/schedule-once.js +99 -0
  1100. package/dist/lifeops/triggers/schedule-once.js.map +1 -0
  1101. package/dist/lifeops/validate/coding-task-request.d.ts +18 -0
  1102. package/dist/lifeops/validate/coding-task-request.d.ts.map +1 -0
  1103. package/dist/lifeops/validate/coding-task-request.js +16 -0
  1104. package/dist/lifeops/validate/coding-task-request.js.map +1 -0
  1105. package/dist/lifeops/voice/grounded-reply.d.ts +41 -0
  1106. package/dist/lifeops/voice/grounded-reply.d.ts.map +1 -0
  1107. package/dist/lifeops/voice/grounded-reply.js +24 -0
  1108. package/dist/lifeops/voice/grounded-reply.js.map +1 -0
  1109. package/dist/lifeops/voice-affect.d.ts +79 -0
  1110. package/dist/lifeops/voice-affect.d.ts.map +1 -0
  1111. package/dist/lifeops/voice-affect.js +253 -0
  1112. package/dist/lifeops/voice-affect.js.map +1 -0
  1113. package/dist/lifeops/wave1-types.d.ts +125 -0
  1114. package/dist/lifeops/wave1-types.d.ts.map +1 -0
  1115. package/dist/lifeops/wave1-types.js +1 -0
  1116. package/dist/lifeops/wave1-types.js.map +1 -0
  1117. package/dist/lifeops/work-threads/field-evaluator-thread-ops.d.ts +33 -0
  1118. package/dist/lifeops/work-threads/field-evaluator-thread-ops.d.ts.map +1 -0
  1119. package/dist/lifeops/work-threads/field-evaluator-thread-ops.js +226 -0
  1120. package/dist/lifeops/work-threads/field-evaluator-thread-ops.js.map +1 -0
  1121. package/dist/lifeops/work-threads/index.d.ts +3 -0
  1122. package/dist/lifeops/work-threads/index.d.ts.map +1 -0
  1123. package/dist/lifeops/work-threads/index.js +7 -0
  1124. package/dist/lifeops/work-threads/index.js.map +1 -0
  1125. package/dist/lifeops/work-threads/store.d.ts +91 -0
  1126. package/dist/lifeops/work-threads/store.d.ts.map +1 -0
  1127. package/dist/lifeops/work-threads/store.js +245 -0
  1128. package/dist/lifeops/work-threads/store.js.map +1 -0
  1129. package/dist/lifeops/work-threads/types.d.ts +58 -0
  1130. package/dist/lifeops/work-threads/types.d.ts.map +1 -0
  1131. package/dist/lifeops/work-threads/types.js +1 -0
  1132. package/dist/lifeops/work-threads/types.js.map +1 -0
  1133. package/dist/platform/host.d.ts +16 -0
  1134. package/dist/platform/host.d.ts.map +1 -0
  1135. package/dist/platform/host.js +22 -0
  1136. package/dist/platform/host.js.map +1 -0
  1137. package/dist/platform/index.d.ts +3 -0
  1138. package/dist/platform/index.d.ts.map +1 -0
  1139. package/dist/platform/index.js +3 -0
  1140. package/dist/platform/index.js.map +1 -0
  1141. package/dist/platform/lifeops-github.d.ts +15 -0
  1142. package/dist/platform/lifeops-github.d.ts.map +1 -0
  1143. package/dist/platform/lifeops-github.js +146 -0
  1144. package/dist/platform/lifeops-github.js.map +1 -0
  1145. package/dist/plugin.d.ts +106 -0
  1146. package/dist/plugin.d.ts.map +1 -0
  1147. package/dist/plugin.js +989 -0
  1148. package/dist/plugin.js.map +1 -0
  1149. package/dist/provider.d.ts +4 -0
  1150. package/dist/provider.d.ts.map +1 -0
  1151. package/dist/provider.js +108 -0
  1152. package/dist/provider.js.map +1 -0
  1153. package/dist/providers/activity-profile.d.ts +3 -0
  1154. package/dist/providers/activity-profile.d.ts.map +1 -0
  1155. package/dist/providers/activity-profile.js +140 -0
  1156. package/dist/providers/activity-profile.js.map +1 -0
  1157. package/dist/providers/cross-channel-context.d.ts +29 -0
  1158. package/dist/providers/cross-channel-context.d.ts.map +1 -0
  1159. package/dist/providers/cross-channel-context.js +206 -0
  1160. package/dist/providers/cross-channel-context.js.map +1 -0
  1161. package/dist/providers/first-run.d.ts +22 -0
  1162. package/dist/providers/first-run.d.ts.map +1 -0
  1163. package/dist/providers/first-run.js +93 -0
  1164. package/dist/providers/first-run.js.map +1 -0
  1165. package/dist/providers/health.d.ts +2 -0
  1166. package/dist/providers/health.d.ts.map +1 -0
  1167. package/dist/providers/health.js +14 -0
  1168. package/dist/providers/health.js.map +1 -0
  1169. package/dist/providers/inbox-triage.d.ts +3 -0
  1170. package/dist/providers/inbox-triage.d.ts.map +1 -0
  1171. package/dist/providers/inbox-triage.js +134 -0
  1172. package/dist/providers/inbox-triage.js.map +1 -0
  1173. package/dist/providers/lifeops.d.ts +3 -0
  1174. package/dist/providers/lifeops.d.ts.map +1 -0
  1175. package/dist/providers/lifeops.js +548 -0
  1176. package/dist/providers/lifeops.js.map +1 -0
  1177. package/dist/providers/pending-prompts.d.ts +38 -0
  1178. package/dist/providers/pending-prompts.d.ts.map +1 -0
  1179. package/dist/providers/pending-prompts.js +81 -0
  1180. package/dist/providers/pending-prompts.js.map +1 -0
  1181. package/dist/providers/recent-task-states.d.ts +52 -0
  1182. package/dist/providers/recent-task-states.d.ts.map +1 -0
  1183. package/dist/providers/recent-task-states.js +166 -0
  1184. package/dist/providers/recent-task-states.js.map +1 -0
  1185. package/dist/providers/room-policy.d.ts +16 -0
  1186. package/dist/providers/room-policy.d.ts.map +1 -0
  1187. package/dist/providers/room-policy.js +71 -0
  1188. package/dist/providers/room-policy.js.map +1 -0
  1189. package/dist/providers/work-threads.d.ts +3 -0
  1190. package/dist/providers/work-threads.d.ts.map +1 -0
  1191. package/dist/providers/work-threads.js +97 -0
  1192. package/dist/providers/work-threads.js.map +1 -0
  1193. package/dist/public.d.ts +3 -0
  1194. package/dist/public.d.ts.map +1 -0
  1195. package/dist/public.js +17 -0
  1196. package/dist/public.js.map +1 -0
  1197. package/dist/routes/cloud-features-routes.d.ts +9 -0
  1198. package/dist/routes/cloud-features-routes.d.ts.map +1 -0
  1199. package/dist/routes/cloud-features-routes.js +164 -0
  1200. package/dist/routes/cloud-features-routes.js.map +1 -0
  1201. package/dist/routes/entities.d.ts +14 -0
  1202. package/dist/routes/entities.d.ts.map +1 -0
  1203. package/dist/routes/entities.js +203 -0
  1204. package/dist/routes/entities.js.map +1 -0
  1205. package/dist/routes/lifeops-routes.d.ts +20 -0
  1206. package/dist/routes/lifeops-routes.d.ts.map +1 -0
  1207. package/dist/routes/lifeops-routes.js +2337 -0
  1208. package/dist/routes/lifeops-routes.js.map +1 -0
  1209. package/dist/routes/plugin.d.ts +9 -0
  1210. package/dist/routes/plugin.d.ts.map +1 -0
  1211. package/dist/routes/plugin.js +568 -0
  1212. package/dist/routes/plugin.js.map +1 -0
  1213. package/dist/routes/relationships.d.ts +13 -0
  1214. package/dist/routes/relationships.d.ts.map +1 -0
  1215. package/dist/routes/relationships.js +195 -0
  1216. package/dist/routes/relationships.js.map +1 -0
  1217. package/dist/routes/scheduled-tasks.d.ts +102 -0
  1218. package/dist/routes/scheduled-tasks.d.ts.map +1 -0
  1219. package/dist/routes/scheduled-tasks.js +322 -0
  1220. package/dist/routes/scheduled-tasks.js.map +1 -0
  1221. package/dist/routes/sleep-routes.d.ts +3 -0
  1222. package/dist/routes/sleep-routes.d.ts.map +1 -0
  1223. package/dist/routes/sleep-routes.js +33 -0
  1224. package/dist/routes/sleep-routes.js.map +1 -0
  1225. package/dist/routes/travel-provider-relay-routes.d.ts +2 -0
  1226. package/dist/routes/travel-provider-relay-routes.d.ts.map +1 -0
  1227. package/dist/routes/travel-provider-relay-routes.js +7 -0
  1228. package/dist/routes/travel-provider-relay-routes.js.map +1 -0
  1229. package/dist/routes/website-blocker-routes.d.ts +6 -0
  1230. package/dist/routes/website-blocker-routes.d.ts.map +1 -0
  1231. package/dist/routes/website-blocker-routes.js +218 -0
  1232. package/dist/routes/website-blocker-routes.js.map +1 -0
  1233. package/dist/security/action-confirmation.d.ts +12 -0
  1234. package/dist/security/action-confirmation.d.ts.map +1 -0
  1235. package/dist/security/action-confirmation.js +36 -0
  1236. package/dist/security/action-confirmation.js.map +1 -0
  1237. package/dist/service.d.ts +34 -0
  1238. package/dist/service.d.ts.map +1 -0
  1239. package/dist/service.js +111 -0
  1240. package/dist/service.js.map +1 -0
  1241. package/dist/travel-time/calendar-create.d.ts +17 -0
  1242. package/dist/travel-time/calendar-create.d.ts.map +1 -0
  1243. package/dist/travel-time/calendar-create.js +28 -0
  1244. package/dist/travel-time/calendar-create.js.map +1 -0
  1245. package/dist/travel-time/service.d.ts +114 -0
  1246. package/dist/travel-time/service.d.ts.map +1 -0
  1247. package/dist/travel-time/service.js +209 -0
  1248. package/dist/travel-time/service.js.map +1 -0
  1249. package/dist/types/app-blocker-settings-card.d.ts +2 -0
  1250. package/dist/types/app-blocker-settings-card.d.ts.map +1 -0
  1251. package/dist/types/app-blocker-settings-card.js +1 -0
  1252. package/dist/types/app-blocker-settings-card.js.map +1 -0
  1253. package/dist/types/briefing.d.ts +59 -0
  1254. package/dist/types/briefing.d.ts.map +1 -0
  1255. package/dist/types/briefing.js +1 -0
  1256. package/dist/types/briefing.js.map +1 -0
  1257. package/dist/types/document-request.d.ts +41 -0
  1258. package/dist/types/document-request.d.ts.map +1 -0
  1259. package/dist/types/document-request.js +1 -0
  1260. package/dist/types/document-request.js.map +1 -0
  1261. package/dist/types/index.d.ts +5 -0
  1262. package/dist/types/index.d.ts.map +1 -0
  1263. package/dist/types/index.js +1 -0
  1264. package/dist/types/index.js.map +1 -0
  1265. package/dist/types/website-blocker-settings-card.d.ts +2 -0
  1266. package/dist/types/website-blocker-settings-card.d.ts.map +1 -0
  1267. package/dist/types/website-blocker-settings-card.js +1 -0
  1268. package/dist/types/website-blocker-settings-card.js.map +1 -0
  1269. package/dist/ui.d.ts +13 -0
  1270. package/dist/ui.d.ts.map +1 -0
  1271. package/dist/ui.js +25 -0
  1272. package/dist/ui.js.map +1 -0
  1273. package/dist/utils/format-duration.d.ts +2 -0
  1274. package/dist/utils/format-duration.d.ts.map +1 -0
  1275. package/dist/utils/format-duration.js +13 -0
  1276. package/dist/utils/format-duration.js.map +1 -0
  1277. package/dist/utils/index.d.ts +3 -0
  1278. package/dist/utils/index.d.ts.map +1 -0
  1279. package/dist/utils/index.js +3 -0
  1280. package/dist/utils/index.js.map +1 -0
  1281. package/dist/utils/lifeops-url.d.ts +3 -0
  1282. package/dist/utils/lifeops-url.d.ts.map +1 -0
  1283. package/dist/utils/lifeops-url.js +28 -0
  1284. package/dist/utils/lifeops-url.js.map +1 -0
  1285. package/dist/website-blocker/chat-integration/block-activator.d.ts +32 -0
  1286. package/dist/website-blocker/chat-integration/block-activator.d.ts.map +1 -0
  1287. package/dist/website-blocker/chat-integration/block-activator.js +30 -0
  1288. package/dist/website-blocker/chat-integration/block-activator.js.map +1 -0
  1289. package/dist/website-blocker/chat-integration/block-rule-reconciler.d.ts +7 -0
  1290. package/dist/website-blocker/chat-integration/block-rule-reconciler.d.ts.map +1 -0
  1291. package/dist/website-blocker/chat-integration/block-rule-reconciler.js +115 -0
  1292. package/dist/website-blocker/chat-integration/block-rule-reconciler.js.map +1 -0
  1293. package/dist/website-blocker/chat-integration/block-rule-schema.d.ts +39 -0
  1294. package/dist/website-blocker/chat-integration/block-rule-schema.d.ts.map +1 -0
  1295. package/dist/website-blocker/chat-integration/block-rule-schema.js +133 -0
  1296. package/dist/website-blocker/chat-integration/block-rule-schema.js.map +1 -0
  1297. package/dist/website-blocker/chat-integration/block-rule-service.d.ts +21 -0
  1298. package/dist/website-blocker/chat-integration/block-rule-service.d.ts.map +1 -0
  1299. package/dist/website-blocker/chat-integration/block-rule-service.js +230 -0
  1300. package/dist/website-blocker/chat-integration/block-rule-service.js.map +1 -0
  1301. package/dist/website-blocker/chat-integration/harsh-mode-check.d.ts +13 -0
  1302. package/dist/website-blocker/chat-integration/harsh-mode-check.d.ts.map +1 -0
  1303. package/dist/website-blocker/chat-integration/harsh-mode-check.js +22 -0
  1304. package/dist/website-blocker/chat-integration/harsh-mode-check.js.map +1 -0
  1305. package/dist/website-blocker/chat-integration/index.d.ts +5 -0
  1306. package/dist/website-blocker/chat-integration/index.d.ts.map +1 -0
  1307. package/dist/website-blocker/chat-integration/index.js +26 -0
  1308. package/dist/website-blocker/chat-integration/index.js.map +1 -0
  1309. package/dist/website-blocker/proactive-block-bridge.d.ts +75 -0
  1310. package/dist/website-blocker/proactive-block-bridge.d.ts.map +1 -0
  1311. package/dist/website-blocker/proactive-block-bridge.js +154 -0
  1312. package/dist/website-blocker/proactive-block-bridge.js.map +1 -0
  1313. package/dist/website-blocker/public.d.ts +12 -0
  1314. package/dist/website-blocker/public.d.ts.map +1 -0
  1315. package/dist/website-blocker/public.js +51 -0
  1316. package/dist/website-blocker/public.js.map +1 -0
  1317. package/package.json +28 -28
@@ -0,0 +1,2337 @@
1
+ import {
2
+ checkRateLimit,
3
+ createIntegrationTelemetrySpan
4
+ } from "@elizaos/agent";
5
+ import { handleCalendarRoutes } from "@elizaos/plugin-calendar/routes/calendar-routes";
6
+ import {
7
+ logger,
8
+ requireConfirmation
9
+ } from "@elizaos/core";
10
+ import {
11
+ LIFEOPS_SCHEDULE_STATE_SCOPES
12
+ } from "@elizaos/plugin-elizacloud/cloud/lifeops-schedule-sync-contracts";
13
+ import {
14
+ LIFEOPS_ACTIVITY_SIGNAL_STATES,
15
+ LIFEOPS_CONNECTOR_MODES,
16
+ LIFEOPS_CONNECTOR_SIDES,
17
+ LIFEOPS_GMAIL_SPAM_REVIEW_STATUSES,
18
+ LIFEOPS_HEALTH_CONNECTOR_PROVIDERS,
19
+ LIFEOPS_INBOX_CACHE_MODES,
20
+ LIFEOPS_INBOX_CHANNELS,
21
+ LIFEOPS_SCREEN_TIME_RANGES
22
+ } from "../contracts/index.js";
23
+ import {
24
+ loadLifeOpsAppState,
25
+ saveLifeOpsAppState
26
+ } from "../lifeops/app-state.js";
27
+ import {
28
+ FinancesService,
29
+ sanitizePaymentSourceForClient
30
+ } from "@elizaos/plugin-finances/finances-service";
31
+ import { FinancesServiceError } from "@elizaos/plugin-finances/finance-normalize";
32
+ import { probeFullDiskAccess } from "../lifeops/fda-probe.js";
33
+ import { LifeOpsRepository } from "../lifeops/repository.js";
34
+ import { LifeOpsService, LifeOpsServiceError } from "../lifeops/service.js";
35
+ function requireAuthorizedRouteContext(ctx) {
36
+ if (!ctx.state.runtime) {
37
+ ctx.error(ctx.res, "Agent runtime is not available", 503);
38
+ return false;
39
+ }
40
+ return true;
41
+ }
42
+ function getService(ctx) {
43
+ if (!requireAuthorizedRouteContext(ctx)) {
44
+ return null;
45
+ }
46
+ const runtime = ctx.state.runtime;
47
+ if (!runtime) {
48
+ return null;
49
+ }
50
+ return new LifeOpsService(runtime, {
51
+ ownerEntityId: ctx.state.adminEntityId
52
+ });
53
+ }
54
+ function getFinancesService(ctx) {
55
+ if (!requireAuthorizedRouteContext(ctx)) {
56
+ return null;
57
+ }
58
+ const runtime = ctx.state.runtime;
59
+ if (!runtime) {
60
+ return null;
61
+ }
62
+ return new FinancesService(runtime, {
63
+ ownerEntityId: ctx.state.adminEntityId
64
+ });
65
+ }
66
+ const LIFEOPS_RATE_LIMITS = {
67
+ google_api_read: { maxRequests: 120, windowMs: 6e4 },
68
+ google_api_write: { maxRequests: 30, windowMs: 6e4 },
69
+ reminders_process: { maxRequests: 10, windowMs: 6e4 },
70
+ task_create: { maxRequests: 30, windowMs: 6e4 },
71
+ task_update: { maxRequests: 30, windowMs: 6e4 },
72
+ gmail_draft: { maxRequests: 20, windowMs: 6e4 },
73
+ // Tightened from 5/min: composing and sending email is the most sensitive
74
+ // outbound action LifeOps takes; cap the burst at 2/min so a bug or a
75
+ // confused operator cannot machine-gun the user's contacts.
76
+ gmail_send: { maxRequests: 2, windowMs: 6e4 },
77
+ calendar_create: { maxRequests: 20, windowMs: 6e4 },
78
+ calendar_update: { maxRequests: 20, windowMs: 6e4 },
79
+ calendar_delete: { maxRequests: 10, windowMs: 6e4 },
80
+ // OAuth + connector lifecycle: tight cap because these mutate stored
81
+ // credentials or initiate consent flows.
82
+ oauth_init: { maxRequests: 5, windowMs: 6e4 },
83
+ connector_write: { maxRequests: 10, windowMs: 6e4 },
84
+ // Generic outbound messaging (X DMs, iMessage, signal, telegram). Tighter
85
+ // than the default to limit blast radius.
86
+ outbound_message: { maxRequests: 5, windowMs: 6e4 },
87
+ default: { maxRequests: 60, windowMs: 6e4 }
88
+ };
89
+ const ACTIVITY_SIGNALS_DEFAULT_LIMIT = 200;
90
+ const ACTIVITY_SIGNALS_MAX_LIMIT = 500;
91
+ const MS_PER_DAY = 864e5;
92
+ const MAX_SCREEN_TIME_WINDOW_DAYS = 31;
93
+ const MAX_SCREEN_TIME_WINDOW_MS = MAX_SCREEN_TIME_WINDOW_DAYS * MS_PER_DAY;
94
+ const routeSchemaBootstraps = /* @__PURE__ */ new WeakMap();
95
+ async function ensureRouteSchema(runtime) {
96
+ if (!runtime) return;
97
+ const adapter = runtime.adapter;
98
+ if (!adapter || typeof adapter.runPluginMigrations !== "function") return;
99
+ if (typeof adapter.isReady === "function" && !await adapter.isReady()) {
100
+ return;
101
+ }
102
+ let bootstrap = routeSchemaBootstraps.get(runtime);
103
+ if (!bootstrap) {
104
+ bootstrap = LifeOpsRepository.bootstrapSchema(runtime).catch((error) => {
105
+ routeSchemaBootstraps.delete(runtime);
106
+ throw error;
107
+ });
108
+ routeSchemaBootstraps.set(runtime, bootstrap);
109
+ }
110
+ await bootstrap;
111
+ }
112
+ function rateLimitRequest(ctx, operation) {
113
+ const agentId = String(ctx.state.runtime?.agentId ?? "unknown");
114
+ const limitKey = `${agentId}:${operation}`;
115
+ const config = LIFEOPS_RATE_LIMITS[operation];
116
+ const { allowed, retryAfterMs } = checkRateLimit(limitKey, config);
117
+ if (!allowed) {
118
+ ctx.res.writeHead(429, {
119
+ "Retry-After": String(Math.ceil(retryAfterMs / 1e3))
120
+ });
121
+ ctx.res.end(JSON.stringify({ error: "Rate limit exceeded", retryAfterMs }));
122
+ return true;
123
+ }
124
+ return false;
125
+ }
126
+ function routeOperation(ctx) {
127
+ return `${ctx.method.toUpperCase()} ${ctx.pathname}`;
128
+ }
129
+ function errorMessage(error) {
130
+ return error instanceof Error ? error.message : String(error);
131
+ }
132
+ function occurrenceStateToTodoStatus(state) {
133
+ switch (state) {
134
+ case "snoozed":
135
+ return "in_progress";
136
+ case "completed":
137
+ return "completed";
138
+ default:
139
+ return "pending";
140
+ }
141
+ }
142
+ function decodeMatchedPathComponent(ctx, match, index, res, label) {
143
+ const raw = match?.[index];
144
+ return raw ? ctx.decodePathComponent(raw, res, label) : null;
145
+ }
146
+ function parseRouteInput(ctx, parser) {
147
+ try {
148
+ return parser();
149
+ } catch (error) {
150
+ if (error instanceof LifeOpsServiceError) {
151
+ ctx.error(ctx.res, error.message, error.status);
152
+ return null;
153
+ }
154
+ throw error;
155
+ }
156
+ }
157
+ function parsePositiveIntegerQuery(value, field, options = {}) {
158
+ const normalized = value?.trim();
159
+ if (!normalized) {
160
+ return null;
161
+ }
162
+ if (!/^\d+$/.test(normalized)) {
163
+ throw new LifeOpsServiceError(400, `${field} must be a positive integer`);
164
+ }
165
+ const parsed = Number.parseInt(normalized, 10);
166
+ if (parsed <= 0) {
167
+ throw new LifeOpsServiceError(400, `${field} must be a positive integer`);
168
+ }
169
+ if (options.max !== void 0 && parsed > options.max) {
170
+ throw new LifeOpsServiceError(
171
+ 400,
172
+ `${field} must be less than or equal to ${options.max}`
173
+ );
174
+ }
175
+ return parsed;
176
+ }
177
+ function isOneOf(value, values) {
178
+ return values.some((allowed) => allowed === value);
179
+ }
180
+ function parseConnectorModeQuery(value) {
181
+ const normalized = value?.trim().toLowerCase();
182
+ if (!normalized) {
183
+ return void 0;
184
+ }
185
+ if (!isOneOf(normalized, LIFEOPS_CONNECTOR_MODES)) {
186
+ throw new LifeOpsServiceError(
187
+ 400,
188
+ `mode must be one of: ${LIFEOPS_CONNECTOR_MODES.join(", ")}`
189
+ );
190
+ }
191
+ return normalized;
192
+ }
193
+ function parseConnectorModeInput(value) {
194
+ if (value === void 0 || value === null || value === "") {
195
+ return void 0;
196
+ }
197
+ if (typeof value !== "string") {
198
+ throw new LifeOpsServiceError(
199
+ 400,
200
+ `mode must be one of: ${LIFEOPS_CONNECTOR_MODES.join(", ")}`
201
+ );
202
+ }
203
+ return parseConnectorModeQuery(value);
204
+ }
205
+ function parseConnectorSideQuery(value) {
206
+ const normalized = value?.trim().toLowerCase();
207
+ if (!normalized) {
208
+ return void 0;
209
+ }
210
+ if (!isOneOf(normalized, LIFEOPS_CONNECTOR_SIDES)) {
211
+ throw new LifeOpsServiceError(
212
+ 400,
213
+ `side must be one of: ${LIFEOPS_CONNECTOR_SIDES.join(", ")}`
214
+ );
215
+ }
216
+ return normalized;
217
+ }
218
+ function parseConnectorSideInput(value) {
219
+ if (value === void 0 || value === null || value === "") {
220
+ return void 0;
221
+ }
222
+ if (typeof value !== "string") {
223
+ throw new LifeOpsServiceError(
224
+ 400,
225
+ `side must be one of: ${LIFEOPS_CONNECTOR_SIDES.join(", ")}`
226
+ );
227
+ }
228
+ return parseConnectorSideQuery(value);
229
+ }
230
+ function parseConnectorSideFromRequest(url, body) {
231
+ const querySide = parseConnectorSideQuery(url.searchParams.get("side"));
232
+ const bodySide = parseConnectorSideInput(body?.side);
233
+ if (querySide && bodySide && querySide !== bodySide) {
234
+ throw new LifeOpsServiceError(
235
+ 400,
236
+ "side must match between query string and request body"
237
+ );
238
+ }
239
+ return bodySide ?? querySide;
240
+ }
241
+ function parseHealthConnectorProvider(value) {
242
+ const normalized = value.trim().toLowerCase();
243
+ if (!isOneOf(normalized, LIFEOPS_HEALTH_CONNECTOR_PROVIDERS)) {
244
+ throw new LifeOpsServiceError(
245
+ 400,
246
+ `provider must be one of: ${LIFEOPS_HEALTH_CONNECTOR_PROVIDERS.join(", ")}`
247
+ );
248
+ }
249
+ return normalized;
250
+ }
251
+ function parseOptionalHealthConnectorProvider(value) {
252
+ const normalized = value?.trim();
253
+ return normalized ? parseHealthConnectorProvider(normalized) : null;
254
+ }
255
+ function parseHealthConnectorProviderPath(ctx, match) {
256
+ return parseRouteInput(ctx, () => {
257
+ const provider = decodeMatchedPathComponent(
258
+ ctx,
259
+ match,
260
+ 1,
261
+ ctx.res,
262
+ "provider"
263
+ );
264
+ return provider ? parseHealthConnectorProvider(provider) : null;
265
+ });
266
+ }
267
+ function parseDateOnlyQuery(value, field) {
268
+ const normalized = value?.trim();
269
+ if (!normalized) {
270
+ return null;
271
+ }
272
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(normalized)) {
273
+ throw new LifeOpsServiceError(400, `${field} must be a YYYY-MM-DD date`);
274
+ }
275
+ return normalized;
276
+ }
277
+ function parseGmailSpamReviewStatusInput(value, field) {
278
+ if (value === void 0 || value === null || value === "") {
279
+ return void 0;
280
+ }
281
+ if (typeof value !== "string") {
282
+ throw new LifeOpsServiceError(
283
+ 400,
284
+ `${field} must be one of: ${LIFEOPS_GMAIL_SPAM_REVIEW_STATUSES.join(", ")}`
285
+ );
286
+ }
287
+ const normalized = value.trim().toLowerCase();
288
+ if (!normalized) {
289
+ return void 0;
290
+ }
291
+ if (!isOneOf(normalized, LIFEOPS_GMAIL_SPAM_REVIEW_STATUSES)) {
292
+ throw new LifeOpsServiceError(
293
+ 400,
294
+ `${field} must be one of: ${LIFEOPS_GMAIL_SPAM_REVIEW_STATUSES.join(", ")}`
295
+ );
296
+ }
297
+ return normalized;
298
+ }
299
+ function parseGmailSpamReviewStatusQuery(value) {
300
+ return parseGmailSpamReviewStatusInput(value, "status");
301
+ }
302
+ function parseBooleanQuery(value, field) {
303
+ if (value === null) {
304
+ return void 0;
305
+ }
306
+ const normalized = value.trim().toLowerCase();
307
+ if (normalized === "true" || normalized === "1") {
308
+ return true;
309
+ }
310
+ if (normalized === "false" || normalized === "0") {
311
+ return false;
312
+ }
313
+ throw new LifeOpsServiceError(400, `${field} must be a boolean`);
314
+ }
315
+ function requireBodyString(body, field) {
316
+ const value = body[field];
317
+ if (typeof value !== "string") {
318
+ throw new LifeOpsServiceError(400, `${field} is required`);
319
+ }
320
+ const trimmed = value.trim();
321
+ if (!trimmed) {
322
+ throw new LifeOpsServiceError(400, `${field} is required`);
323
+ }
324
+ return trimmed;
325
+ }
326
+ function parseOptionalBodyString(body, field) {
327
+ const value = body[field];
328
+ if (value === void 0 || value === null || value === "") {
329
+ return void 0;
330
+ }
331
+ if (typeof value !== "string") {
332
+ throw new LifeOpsServiceError(400, `${field} must be a string`);
333
+ }
334
+ const trimmed = value.trim();
335
+ return trimmed.length > 0 ? trimmed : void 0;
336
+ }
337
+ function parseOptionalBodyBoolean(body, field) {
338
+ const value = body[field];
339
+ if (value === void 0 || value === null) {
340
+ return void 0;
341
+ }
342
+ if (typeof value !== "boolean") {
343
+ throw new LifeOpsServiceError(400, `${field} must be a boolean`);
344
+ }
345
+ return value;
346
+ }
347
+ function parseOptionalBodyStringArray(body, field) {
348
+ const value = body[field];
349
+ if (value === void 0 || value === null) {
350
+ return void 0;
351
+ }
352
+ if (!Array.isArray(value)) {
353
+ throw new LifeOpsServiceError(400, `${field} must be an array of strings`);
354
+ }
355
+ const parsed = value.map((entry) => {
356
+ if (typeof entry !== "string") {
357
+ throw new LifeOpsServiceError(
358
+ 400,
359
+ `${field} must be an array of strings`
360
+ );
361
+ }
362
+ return entry.trim();
363
+ });
364
+ if (parsed.some((entry) => entry.length === 0)) {
365
+ throw new LifeOpsServiceError(
366
+ 400,
367
+ `${field} must be an array of non-empty strings`
368
+ );
369
+ }
370
+ return parsed;
371
+ }
372
+ function parseActivitySignalStates(url) {
373
+ const rawValues = [
374
+ ...url.searchParams.getAll("state"),
375
+ ...url.searchParams.getAll("states").flatMap((value) => value.split(","))
376
+ ].map((value) => value.trim()).filter((value) => value.length > 0);
377
+ if (rawValues.length === 0) {
378
+ return null;
379
+ }
380
+ const states = [];
381
+ for (const value of rawValues) {
382
+ if (!isOneOf(value, LIFEOPS_ACTIVITY_SIGNAL_STATES)) {
383
+ throw new LifeOpsServiceError(
384
+ 400,
385
+ `state must be one of: ${LIFEOPS_ACTIVITY_SIGNAL_STATES.join(", ")}`
386
+ );
387
+ }
388
+ states.push(value);
389
+ }
390
+ return states;
391
+ }
392
+ function parseScreenTimeSourceQuery(value) {
393
+ const normalized = value?.trim().toLowerCase();
394
+ if (!normalized) {
395
+ return void 0;
396
+ }
397
+ if (normalized !== "app" && normalized !== "website") {
398
+ throw new LifeOpsServiceError(400, "source must be app or website");
399
+ }
400
+ return normalized;
401
+ }
402
+ function parseScreenTimeIdentifierQuery(value) {
403
+ const normalized = value?.trim();
404
+ return normalized && normalized.length > 0 ? normalized : void 0;
405
+ }
406
+ function parseScreenTimeRangeQuery(value) {
407
+ const normalized = value?.trim().toLowerCase() || "today";
408
+ if (!isOneOf(normalized, LIFEOPS_SCREEN_TIME_RANGES)) {
409
+ throw new LifeOpsServiceError(
410
+ 400,
411
+ `range must be one of: ${LIFEOPS_SCREEN_TIME_RANGES.join(", ")}`
412
+ );
413
+ }
414
+ return normalized;
415
+ }
416
+ const ISO_INSTANT_QUERY_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/;
417
+ function parseRequiredIsoQuery(url, field) {
418
+ const value = url.searchParams.get(field)?.trim();
419
+ if (!value) {
420
+ throw new LifeOpsServiceError(400, `${field} is required`);
421
+ }
422
+ if (!ISO_INSTANT_QUERY_RE.test(value) || !Number.isFinite(Date.parse(value))) {
423
+ throw new LifeOpsServiceError(400, `${field} must be a valid ISO string`);
424
+ }
425
+ return value;
426
+ }
427
+ function parseOptionalIsoQuery(value, field) {
428
+ const normalized = value?.trim();
429
+ if (!normalized) {
430
+ return null;
431
+ }
432
+ if (!Number.isFinite(Date.parse(normalized))) {
433
+ throw new LifeOpsServiceError(400, `${field} must be a valid ISO string`);
434
+ }
435
+ return normalized;
436
+ }
437
+ function parseBoundedIsoWindowQuery(url) {
438
+ const since = parseRequiredIsoQuery(url, "since");
439
+ const until = parseRequiredIsoQuery(url, "until");
440
+ const sinceMs = Date.parse(since);
441
+ const untilMs = Date.parse(until);
442
+ if (untilMs <= sinceMs) {
443
+ throw new LifeOpsServiceError(400, "until must be after since");
444
+ }
445
+ if (untilMs - sinceMs > MAX_SCREEN_TIME_WINDOW_MS) {
446
+ throw new LifeOpsServiceError(
447
+ 400,
448
+ `window must be ${MAX_SCREEN_TIME_WINDOW_DAYS} days or less`
449
+ );
450
+ }
451
+ return { since, until };
452
+ }
453
+ async function runRoute(ctx, fn) {
454
+ const operation = routeOperation(ctx);
455
+ const span = createIntegrationTelemetrySpan({
456
+ boundary: "lifeops",
457
+ operation
458
+ });
459
+ const service = getService(ctx);
460
+ if (!service) {
461
+ logger.info(
462
+ {
463
+ boundary: "lifeops",
464
+ operation,
465
+ statusCode: 503
466
+ },
467
+ "[lifeops] Route rejected because agent runtime is unavailable"
468
+ );
469
+ span.failure({
470
+ statusCode: 503,
471
+ errorKind: "runtime_unavailable"
472
+ });
473
+ return true;
474
+ }
475
+ try {
476
+ await ensureRouteSchema(ctx.state.runtime);
477
+ await fn(service);
478
+ span.success({
479
+ statusCode: ctx.res.statusCode >= 400 ? ctx.res.statusCode : 200
480
+ });
481
+ return true;
482
+ } catch (error) {
483
+ if (error instanceof LifeOpsServiceError) {
484
+ const logFn = error.status === 401 ? logger.debug.bind(logger) : logger.warn.bind(logger);
485
+ logFn(
486
+ {
487
+ boundary: "lifeops",
488
+ operation,
489
+ statusCode: error.status
490
+ },
491
+ `[lifeops] Route failed: ${error.message}`
492
+ );
493
+ span.failure({
494
+ statusCode: error.status,
495
+ error,
496
+ errorKind: error.status === 401 ? "lifeops_auth_invalid" : "lifeops_service_error"
497
+ });
498
+ ctx.error(ctx.res, error.message, error.status);
499
+ return true;
500
+ }
501
+ logger.error(
502
+ {
503
+ boundary: "lifeops",
504
+ operation
505
+ },
506
+ `[lifeops] Route crashed: ${errorMessage(error)}`
507
+ );
508
+ span.failure({
509
+ error,
510
+ errorKind: "unhandled_error"
511
+ });
512
+ throw error;
513
+ }
514
+ }
515
+ async function runFinancesRoute(ctx, fn) {
516
+ const operation = routeOperation(ctx);
517
+ const span = createIntegrationTelemetrySpan({
518
+ boundary: "lifeops",
519
+ operation
520
+ });
521
+ const service = getFinancesService(ctx);
522
+ if (!service) {
523
+ logger.info(
524
+ {
525
+ boundary: "lifeops",
526
+ operation,
527
+ statusCode: 503
528
+ },
529
+ "[lifeops] Route rejected because agent runtime is unavailable"
530
+ );
531
+ span.failure({
532
+ statusCode: 503,
533
+ errorKind: "runtime_unavailable"
534
+ });
535
+ return true;
536
+ }
537
+ try {
538
+ await ensureRouteSchema(ctx.state.runtime);
539
+ await fn(service);
540
+ span.success({
541
+ statusCode: ctx.res.statusCode >= 400 ? ctx.res.statusCode : 200
542
+ });
543
+ return true;
544
+ } catch (error) {
545
+ if (error instanceof FinancesServiceError) {
546
+ const logFn = error.status === 401 ? logger.debug.bind(logger) : logger.warn.bind(logger);
547
+ logFn(
548
+ {
549
+ boundary: "lifeops",
550
+ operation,
551
+ statusCode: error.status
552
+ },
553
+ `[lifeops] Route failed: ${error.message}`
554
+ );
555
+ span.failure({
556
+ statusCode: error.status,
557
+ error,
558
+ errorKind: error.status === 401 ? "lifeops_auth_invalid" : "lifeops_service_error"
559
+ });
560
+ ctx.error(ctx.res, error.message, error.status);
561
+ return true;
562
+ }
563
+ logger.error(
564
+ {
565
+ boundary: "lifeops",
566
+ operation
567
+ },
568
+ `[lifeops] Route crashed: ${errorMessage(error)}`
569
+ );
570
+ span.failure({
571
+ error,
572
+ errorKind: "unhandled_error"
573
+ });
574
+ throw error;
575
+ }
576
+ }
577
+ function parseConnectorRefreshDetailFromQuery(ctx, defaults) {
578
+ return parseRouteInput(ctx, () => ({
579
+ side: parseConnectorSideQuery(ctx.url.searchParams.get("side")) ?? defaults.side,
580
+ mode: parseConnectorModeQuery(ctx.url.searchParams.get("mode")) ?? defaults.mode
581
+ }));
582
+ }
583
+ function escapeHtml(value) {
584
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
585
+ }
586
+ function serializeInlineScriptValue(value) {
587
+ return JSON.stringify(value).replace(/</g, "\\u003c");
588
+ }
589
+ function writeHtml(res, status, title, message, refreshDetail) {
590
+ const refreshScript = refreshDetail ? `
591
+ <script>
592
+ (() => {
593
+ const payload = ${serializeInlineScriptValue({
594
+ type: "lifeops-google-connector-refresh",
595
+ detail: {
596
+ ...refreshDetail,
597
+ source: "callback"
598
+ }
599
+ })};
600
+ if (window.opener && typeof window.opener.postMessage === "function") {
601
+ window.opener.postMessage(payload, "*");
602
+ }
603
+ if (typeof BroadcastChannel === "function") {
604
+ for (const channelName of [
605
+ "elizaos:lifeops:google-connector",
606
+ "eliza:lifeops:google-connector",
607
+ ]) {
608
+ const channel = new BroadcastChannel(channelName);
609
+ channel.postMessage(payload);
610
+ channel.close();
611
+ }
612
+ }
613
+ if (typeof localStorage !== "undefined") {
614
+ for (const storageKey of [
615
+ "elizaos:lifeops:google-connector-refresh",
616
+ "eliza:lifeops:google-connector-refresh",
617
+ ]) {
618
+ localStorage.setItem(
619
+ storageKey,
620
+ JSON.stringify({
621
+ ...payload,
622
+ at: Date.now(),
623
+ }),
624
+ );
625
+ localStorage.removeItem(storageKey);
626
+ }
627
+ }
628
+ })();
629
+ </script>` : "";
630
+ res.statusCode = status;
631
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
632
+ res.end(`<!doctype html>
633
+ <html lang="en">
634
+ <head>
635
+ <meta charset="utf-8" />
636
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
637
+ <title>${escapeHtml(title)}</title>
638
+ <style>
639
+ body {
640
+ margin: 0;
641
+ min-height: 100vh;
642
+ display: grid;
643
+ place-items: center;
644
+ background: #f5f1e8;
645
+ color: #18120d;
646
+ font-family: "IBM Plex Sans", "Helvetica Neue", sans-serif;
647
+ }
648
+ main {
649
+ width: min(32rem, calc(100vw - 2rem));
650
+ padding: 2rem;
651
+ border: 1px solid rgba(24, 18, 13, 0.12);
652
+ border-radius: 1.25rem;
653
+ background: rgba(255, 255, 255, 0.92);
654
+ box-shadow: 0 24px 80px rgba(24, 18, 13, 0.08);
655
+ }
656
+ h1 {
657
+ margin: 0 0 0.75rem;
658
+ font-size: 1.25rem;
659
+ }
660
+ p {
661
+ margin: 0;
662
+ line-height: 1.5;
663
+ color: rgba(24, 18, 13, 0.78);
664
+ }
665
+ </style>
666
+ </head>
667
+ <body>
668
+ <main>
669
+ <h1>${escapeHtml(title)}</h1>
670
+ <p>${escapeHtml(message)}</p>
671
+ </main>
672
+ ${refreshScript}
673
+ <script>
674
+ window.setTimeout(() => {
675
+ if (typeof window.close === "function") {
676
+ window.close();
677
+ }
678
+ }, 250);
679
+ </script>
680
+ </body>
681
+ </html>`);
682
+ }
683
+ async function handleLifeOpsRoutes(ctx) {
684
+ const { req, res, method, pathname, url, json, readJsonBody } = ctx;
685
+ if (await handleCalendarRoutes({
686
+ method,
687
+ pathname,
688
+ url,
689
+ runRoute: (fn) => runRoute(ctx, fn),
690
+ rateLimit: (key) => rateLimitRequest(ctx, key),
691
+ json: (data, status) => json(res, data, status),
692
+ readJsonBody: () => readJsonBody(req, res),
693
+ decodePathComponent: (raw, label) => ctx.decodePathComponent(raw, res, label),
694
+ parseConnectorMode: (value) => parseConnectorModeQuery(value),
695
+ parseConnectorSide: (value) => parseConnectorSideQuery(value),
696
+ parseBoolean: (value, field) => parseBooleanQuery(value, field),
697
+ serviceError: (status, message) => new LifeOpsServiceError(status, message)
698
+ })) {
699
+ return true;
700
+ }
701
+ if (method === "GET" && pathname === "/api/lifeops/app-state") {
702
+ if (!requireAuthorizedRouteContext(ctx)) return true;
703
+ const runtime = ctx.state.runtime;
704
+ if (!runtime) return true;
705
+ json(res, await loadLifeOpsAppState(runtime));
706
+ return true;
707
+ }
708
+ if (method === "POST" && pathname === "/api/lifeops/features/toggle") {
709
+ if (!requireAuthorizedRouteContext(ctx)) return true;
710
+ if (rateLimitRequest(ctx, "default")) return true;
711
+ const runtime = ctx.state.runtime;
712
+ if (!runtime) return true;
713
+ const body = await readJsonBody(req, res);
714
+ if (!body) {
715
+ return true;
716
+ }
717
+ const { getFeatureFlagRegistry } = await import("../lifeops/registries/feature-flag-registry.js");
718
+ const featureFlagRegistry = getFeatureFlagRegistry(runtime);
719
+ if (!featureFlagRegistry) {
720
+ ctx.error(res, "feature flag registry not initialized", 503);
721
+ return true;
722
+ }
723
+ if (typeof body.featureKey !== "string" || !featureFlagRegistry.has(body.featureKey)) {
724
+ ctx.error(
725
+ res,
726
+ `featureKey must be a registered feature flag (one of: ${featureFlagRegistry.list().map((c) => c.key).join(", ")})`,
727
+ 400
728
+ );
729
+ return true;
730
+ }
731
+ if (typeof body.enabled !== "boolean") {
732
+ ctx.error(res, "enabled must be a boolean", 400);
733
+ return true;
734
+ }
735
+ const { createFeatureFlagService } = await import("../lifeops/feature-flags.js");
736
+ const service = createFeatureFlagService(runtime);
737
+ const next = body.enabled ? await service.enable(body.featureKey, "local", null) : await service.disable(body.featureKey, "local", null);
738
+ json(res, {
739
+ feature: {
740
+ featureKey: next.featureKey,
741
+ enabled: next.enabled,
742
+ source: next.source,
743
+ label: next.label,
744
+ description: next.description,
745
+ costsMoney: next.costsMoney,
746
+ enabledAt: next.enabledAt ? next.enabledAt.toISOString() : null,
747
+ enabledBy: next.enabledBy,
748
+ packageId: typeof next.metadata.packageId === "string" ? next.metadata.packageId : null
749
+ }
750
+ });
751
+ return true;
752
+ }
753
+ if (method === "PUT" && pathname === "/api/lifeops/app-state") {
754
+ if (!requireAuthorizedRouteContext(ctx)) return true;
755
+ if (rateLimitRequest(ctx, "default")) return true;
756
+ const runtime = ctx.state.runtime;
757
+ if (!runtime) return true;
758
+ const body = await readJsonBody(req, res);
759
+ if (!body) {
760
+ return true;
761
+ }
762
+ if (typeof body.enabled !== "boolean") {
763
+ ctx.error(res, "enabled must be a boolean", 400);
764
+ return true;
765
+ }
766
+ const previous = await loadLifeOpsAppState(runtime);
767
+ let priorityScoring = previous.priorityScoring;
768
+ if (body.priorityScoring !== void 0) {
769
+ if (!body.priorityScoring || typeof body.priorityScoring !== "object" || Array.isArray(body.priorityScoring)) {
770
+ ctx.error(res, "priorityScoring must be an object", 400);
771
+ return true;
772
+ }
773
+ const ps = body.priorityScoring;
774
+ const enabled = typeof ps.enabled === "boolean" ? ps.enabled : priorityScoring.enabled;
775
+ let model = priorityScoring.model;
776
+ if (ps.model === null) {
777
+ model = null;
778
+ } else if (typeof ps.model === "string") {
779
+ const trimmed = ps.model.trim();
780
+ model = trimmed.length > 0 ? trimmed : null;
781
+ } else if (ps.model !== void 0) {
782
+ ctx.error(res, "priorityScoring.model must be a string or null", 400);
783
+ return true;
784
+ }
785
+ priorityScoring = { enabled, model };
786
+ }
787
+ try {
788
+ const saved = await saveLifeOpsAppState(runtime, {
789
+ enabled: body.enabled,
790
+ priorityScoring
791
+ });
792
+ json(res, saved);
793
+ } catch (error) {
794
+ ctx.error(
795
+ res,
796
+ `failed to persist LifeOps app state: ${error instanceof Error ? error.message : String(error)}`,
797
+ 500
798
+ );
799
+ }
800
+ return true;
801
+ }
802
+ if (method === "GET" && pathname === "/api/lifeops/gmail/triage") {
803
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
804
+ return runRoute(ctx, async (service) => {
805
+ const request = {
806
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
807
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
808
+ forceSync: parseBooleanQuery(
809
+ url.searchParams.get("forceSync"),
810
+ "forceSync"
811
+ ),
812
+ maxResults: parsePositiveIntegerQuery(
813
+ url.searchParams.get("maxResults"),
814
+ "maxResults"
815
+ ) ?? void 0,
816
+ grantId: url.searchParams.get("grantId") ?? void 0
817
+ };
818
+ json(res, await service.getGmailTriage(url, request));
819
+ });
820
+ }
821
+ if (method === "GET" && pathname === "/api/lifeops/gmail/search") {
822
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
823
+ return runRoute(ctx, async (service) => {
824
+ const query = url.searchParams.get("query");
825
+ const request = {
826
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
827
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
828
+ forceSync: parseBooleanQuery(
829
+ url.searchParams.get("forceSync"),
830
+ "forceSync"
831
+ ),
832
+ maxResults: parsePositiveIntegerQuery(
833
+ url.searchParams.get("maxResults"),
834
+ "maxResults"
835
+ ) ?? void 0,
836
+ query: query ?? "",
837
+ replyNeededOnly: parseBooleanQuery(
838
+ url.searchParams.get("replyNeededOnly"),
839
+ "replyNeededOnly"
840
+ ),
841
+ includeSpamTrash: parseBooleanQuery(
842
+ url.searchParams.get("includeSpamTrash"),
843
+ "includeSpamTrash"
844
+ ),
845
+ grantId: url.searchParams.get("grantId") ?? void 0
846
+ };
847
+ json(res, await service.getGmailSearch(url, request));
848
+ });
849
+ }
850
+ if (method === "GET" && pathname === "/api/lifeops/gmail/needs-response") {
851
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
852
+ return runRoute(ctx, async (service) => {
853
+ const request = {
854
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
855
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
856
+ forceSync: parseBooleanQuery(
857
+ url.searchParams.get("forceSync"),
858
+ "forceSync"
859
+ ),
860
+ maxResults: parsePositiveIntegerQuery(
861
+ url.searchParams.get("maxResults"),
862
+ "maxResults"
863
+ ) ?? void 0,
864
+ grantId: url.searchParams.get("grantId") ?? void 0
865
+ };
866
+ json(res, await service.getGmailNeedsResponse(url, request));
867
+ });
868
+ }
869
+ if (method === "GET" && pathname === "/api/lifeops/gmail/recommendations") {
870
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
871
+ return runRoute(ctx, async (service) => {
872
+ const query = url.searchParams.get("query");
873
+ const request = {
874
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
875
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
876
+ forceSync: parseBooleanQuery(
877
+ url.searchParams.get("forceSync"),
878
+ "forceSync"
879
+ ),
880
+ maxResults: parsePositiveIntegerQuery(
881
+ url.searchParams.get("maxResults"),
882
+ "maxResults"
883
+ ) ?? void 0,
884
+ query: query ?? void 0,
885
+ replyNeededOnly: parseBooleanQuery(
886
+ url.searchParams.get("replyNeededOnly"),
887
+ "replyNeededOnly"
888
+ ),
889
+ includeSpamTrash: parseBooleanQuery(
890
+ url.searchParams.get("includeSpamTrash"),
891
+ "includeSpamTrash"
892
+ ),
893
+ grantId: url.searchParams.get("grantId") ?? void 0
894
+ };
895
+ json(res, await service.getGmailRecommendations(url, request));
896
+ });
897
+ }
898
+ if (method === "GET" && pathname === "/api/lifeops/gmail/spam-review") {
899
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
900
+ return runRoute(ctx, async (service) => {
901
+ const request = {
902
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
903
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
904
+ grantId: url.searchParams.get("grantId") ?? void 0,
905
+ status: parseGmailSpamReviewStatusQuery(url.searchParams.get("status")),
906
+ maxResults: parsePositiveIntegerQuery(
907
+ url.searchParams.get("maxResults"),
908
+ "maxResults"
909
+ ) ?? void 0
910
+ };
911
+ json(res, await service.getGmailSpamReviewItems(url, request));
912
+ });
913
+ }
914
+ const gmailSpamReviewMatch = pathname.match(
915
+ /^\/api\/lifeops\/gmail\/spam-review\/([^/]+)$/
916
+ );
917
+ if (method === "PATCH" && gmailSpamReviewMatch) {
918
+ if (rateLimitRequest(ctx, "google_api_write")) return true;
919
+ const itemId = decodeMatchedPathComponent(
920
+ ctx,
921
+ gmailSpamReviewMatch,
922
+ 1,
923
+ res,
924
+ "itemId"
925
+ );
926
+ if (!itemId) return true;
927
+ const body = await readJsonBody(
928
+ req,
929
+ res
930
+ );
931
+ if (!body) return true;
932
+ return runRoute(ctx, async (service) => {
933
+ const status = parseGmailSpamReviewStatusInput(body.status, "status");
934
+ if (!status) {
935
+ throw new LifeOpsServiceError(400, "status is required");
936
+ }
937
+ json(
938
+ res,
939
+ await service.updateGmailSpamReviewItem(url, itemId, { status })
940
+ );
941
+ });
942
+ }
943
+ if (method === "GET" && pathname === "/api/lifeops/gmail/unresponded") {
944
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
945
+ return runRoute(ctx, async (service) => {
946
+ const request = {
947
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
948
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
949
+ maxResults: parsePositiveIntegerQuery(
950
+ url.searchParams.get("maxResults"),
951
+ "maxResults"
952
+ ) ?? void 0,
953
+ olderThanDays: parsePositiveIntegerQuery(
954
+ url.searchParams.get("olderThanDays"),
955
+ "olderThanDays"
956
+ ) ?? void 0,
957
+ grantId: url.searchParams.get("grantId") ?? void 0
958
+ };
959
+ json(res, await service.getGmailUnresponded(url, request));
960
+ });
961
+ }
962
+ if (method === "GET" && pathname === "/api/lifeops/inbox") {
963
+ return runRoute(ctx, async (service) => {
964
+ const limit = parsePositiveIntegerQuery(url.searchParams.get("limit"), "limit") ?? void 0;
965
+ const rawChannels = url.searchParams.get("channels");
966
+ let channels;
967
+ if (rawChannels !== null && rawChannels.trim().length > 0) {
968
+ const parsed = rawChannels.split(",").map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);
969
+ const parsedChannels = [];
970
+ for (const value of parsed) {
971
+ if (!isOneOf(value, LIFEOPS_INBOX_CHANNELS)) {
972
+ throw new LifeOpsServiceError(
973
+ 400,
974
+ `channels must be a comma-separated subset of: ${LIFEOPS_INBOX_CHANNELS.join(", ")}`
975
+ );
976
+ }
977
+ parsedChannels.push(value);
978
+ }
979
+ channels = parsedChannels;
980
+ }
981
+ const groupByThread = url.searchParams.get("groupByThread") === "true";
982
+ const rawChatTypeFilter = url.searchParams.get("chatTypeFilter");
983
+ let chatTypeFilter;
984
+ if (rawChatTypeFilter !== null && rawChatTypeFilter.trim().length > 0) {
985
+ const parsed = rawChatTypeFilter.split(",").map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0);
986
+ const allowed = [];
987
+ for (const value of parsed) {
988
+ if (value !== "dm" && value !== "group" && value !== "channel") {
989
+ throw new LifeOpsServiceError(
990
+ 400,
991
+ "chatTypeFilter must be a comma-separated subset of: dm, group, channel"
992
+ );
993
+ }
994
+ allowed.push(value);
995
+ }
996
+ if (allowed.length > 0) chatTypeFilter = allowed;
997
+ }
998
+ const maxParticipants = parsePositiveIntegerQuery(
999
+ url.searchParams.get("maxParticipants"),
1000
+ "maxParticipants"
1001
+ ) ?? void 0;
1002
+ const gmailAccountIdRaw = url.searchParams.get("gmailAccountId");
1003
+ const gmailAccountId = gmailAccountIdRaw !== null && gmailAccountIdRaw.trim().length > 0 ? gmailAccountIdRaw.trim() : void 0;
1004
+ const phoneAccountIds = url.searchParams.get("phoneAccountIds")?.split(",").map((value) => value.trim()).filter(Boolean);
1005
+ const missedOnly = url.searchParams.get("missedOnly") === "true";
1006
+ const sortByPriority = url.searchParams.get("sortByPriority") === "true";
1007
+ const rawCacheMode = url.searchParams.get("cacheMode");
1008
+ let cacheMode;
1009
+ if (rawCacheMode !== null && rawCacheMode.trim().length > 0) {
1010
+ const parsedCacheMode = rawCacheMode.trim().toLowerCase();
1011
+ if (!isOneOf(parsedCacheMode, LIFEOPS_INBOX_CACHE_MODES)) {
1012
+ throw new LifeOpsServiceError(
1013
+ 400,
1014
+ `cacheMode must be one of: ${LIFEOPS_INBOX_CACHE_MODES.join(", ")}`
1015
+ );
1016
+ }
1017
+ cacheMode = parsedCacheMode;
1018
+ }
1019
+ const cacheLimit = parsePositiveIntegerQuery(
1020
+ url.searchParams.get("cacheLimit"),
1021
+ "cacheLimit"
1022
+ ) ?? void 0;
1023
+ const request = {
1024
+ limit,
1025
+ channels,
1026
+ groupByThread: groupByThread || void 0,
1027
+ chatTypeFilter,
1028
+ maxParticipants,
1029
+ gmailAccountId,
1030
+ phoneAccountIds: phoneAccountIds && phoneAccountIds.length > 0 ? phoneAccountIds : void 0,
1031
+ missedOnly: missedOnly || void 0,
1032
+ sortByPriority: sortByPriority || void 0,
1033
+ cacheMode,
1034
+ cacheLimit
1035
+ };
1036
+ json(res, await service.getInbox(request));
1037
+ });
1038
+ }
1039
+ if (method === "POST" && pathname === "/api/lifeops/gmail/reply-drafts") {
1040
+ if (rateLimitRequest(ctx, "gmail_draft")) return true;
1041
+ const body = await readJsonBody(
1042
+ req,
1043
+ res
1044
+ );
1045
+ if (!body) return true;
1046
+ return runRoute(ctx, async (service) => {
1047
+ json(res, { draft: await service.createGmailReplyDraft(url, body) }, 201);
1048
+ });
1049
+ }
1050
+ if (method === "POST" && pathname === "/api/lifeops/gmail/batch-reply-drafts") {
1051
+ if (rateLimitRequest(ctx, "gmail_draft")) return true;
1052
+ const body = await readJsonBody(
1053
+ req,
1054
+ res
1055
+ );
1056
+ if (!body) return true;
1057
+ return runRoute(ctx, async (service) => {
1058
+ json(
1059
+ res,
1060
+ { batch: await service.createGmailBatchReplyDrafts(url, body) },
1061
+ 201
1062
+ );
1063
+ });
1064
+ }
1065
+ if (method === "POST" && pathname === "/api/lifeops/gmail/reply-send") {
1066
+ if (rateLimitRequest(ctx, "gmail_send")) return true;
1067
+ const body = await readJsonBody(req, res);
1068
+ if (!body) return true;
1069
+ return runRoute(ctx, async (service) => {
1070
+ json(res, await service.sendGmailReply(url, body));
1071
+ });
1072
+ }
1073
+ if (method === "POST" && pathname === "/api/lifeops/gmail/message-send") {
1074
+ if (rateLimitRequest(ctx, "gmail_send")) return true;
1075
+ const body = await readJsonBody(req, res);
1076
+ if (!body) return true;
1077
+ return runRoute(ctx, async (service) => {
1078
+ json(res, await service.sendGmailMessage(url, body));
1079
+ });
1080
+ }
1081
+ if (method === "POST" && pathname === "/api/lifeops/gmail/batch-reply-send") {
1082
+ if (rateLimitRequest(ctx, "gmail_send")) return true;
1083
+ const body = await readJsonBody(
1084
+ req,
1085
+ res
1086
+ );
1087
+ if (!body) return true;
1088
+ return runRoute(ctx, async (service) => {
1089
+ json(res, await service.sendGmailReplies(url, body));
1090
+ });
1091
+ }
1092
+ if (method === "POST" && pathname === "/api/lifeops/gmail/manage") {
1093
+ if (rateLimitRequest(ctx, "google_api_write")) return true;
1094
+ const body = await readJsonBody(
1095
+ req,
1096
+ res
1097
+ );
1098
+ if (!body) return true;
1099
+ return runRoute(ctx, async (service) => {
1100
+ json(res, await service.manageGmailMessages(url, body));
1101
+ });
1102
+ }
1103
+ if (method === "POST" && pathname === "/api/lifeops/gmail/events/ingest") {
1104
+ if (rateLimitRequest(ctx, "google_api_write")) return true;
1105
+ const body = await readJsonBody(req, res);
1106
+ if (!body) return true;
1107
+ return runRoute(ctx, async (service) => {
1108
+ json(res, await service.ingestGmailEvent(url, body), 202);
1109
+ });
1110
+ }
1111
+ if (method === "GET" && pathname === "/api/lifeops/connectors/health/status") {
1112
+ if (rateLimitRequest(ctx, "default")) return true;
1113
+ return runRoute(ctx, async (service) => {
1114
+ json(
1115
+ res,
1116
+ await service.getHealthDataConnectorStatuses(
1117
+ url,
1118
+ parseConnectorModeQuery(url.searchParams.get("mode")),
1119
+ parseConnectorSideQuery(url.searchParams.get("side"))
1120
+ )
1121
+ );
1122
+ });
1123
+ }
1124
+ const healthStatusMatch = pathname.match(
1125
+ /^\/api\/lifeops\/connectors\/health\/([^/]+)\/status$/
1126
+ );
1127
+ if (method === "GET" && healthStatusMatch) {
1128
+ if (rateLimitRequest(ctx, "default")) return true;
1129
+ const provider = parseHealthConnectorProviderPath(ctx, healthStatusMatch);
1130
+ if (!provider) return true;
1131
+ return runRoute(ctx, async (service) => {
1132
+ json(
1133
+ res,
1134
+ await service.getHealthDataConnectorStatus(
1135
+ provider,
1136
+ url,
1137
+ parseConnectorModeQuery(url.searchParams.get("mode")),
1138
+ parseConnectorSideQuery(url.searchParams.get("side"))
1139
+ )
1140
+ );
1141
+ });
1142
+ }
1143
+ const healthCallbackMatch = pathname.match(
1144
+ /^\/api\/lifeops\/connectors\/health\/([^/]+)\/callback$/
1145
+ );
1146
+ if (method === "GET" && healthCallbackMatch) {
1147
+ const provider = parseHealthConnectorProviderPath(ctx, healthCallbackMatch);
1148
+ if (!provider) return true;
1149
+ const service = getService(ctx);
1150
+ if (!service) return true;
1151
+ try {
1152
+ await ensureRouteSchema(ctx.state.runtime);
1153
+ const status = await service.completeHealthConnectorCallback(url);
1154
+ if (status.provider !== provider) {
1155
+ throw new LifeOpsServiceError(
1156
+ 409,
1157
+ "Health connector callback provider did not match the request path."
1158
+ );
1159
+ }
1160
+ writeHtml(
1161
+ res,
1162
+ 200,
1163
+ `${provider} Connected`,
1164
+ `${provider} health data is now available in Eliza. You can close this window.`
1165
+ );
1166
+ return true;
1167
+ } catch (error) {
1168
+ if (error instanceof LifeOpsServiceError) {
1169
+ writeHtml(res, error.status, "Health Connection Failed", error.message);
1170
+ return true;
1171
+ }
1172
+ throw error;
1173
+ }
1174
+ }
1175
+ const healthSuccessMatch = pathname.match(
1176
+ /^\/api\/lifeops\/connectors\/health\/([^/]+)\/success$/
1177
+ );
1178
+ if (method === "GET" && healthSuccessMatch) {
1179
+ const provider = parseHealthConnectorProviderPath(ctx, healthSuccessMatch);
1180
+ if (!provider) return true;
1181
+ writeHtml(
1182
+ res,
1183
+ 200,
1184
+ `${provider} Connected`,
1185
+ `${provider} health data is now available in Eliza. You can close this window.`
1186
+ );
1187
+ return true;
1188
+ }
1189
+ if (method === "GET" && pathname === "/api/lifeops/health/summary") {
1190
+ if (rateLimitRequest(ctx, "default")) return true;
1191
+ return runRoute(ctx, async (service) => {
1192
+ const request = {
1193
+ provider: parseOptionalHealthConnectorProvider(
1194
+ url.searchParams.get("provider")
1195
+ ),
1196
+ mode: parseConnectorModeQuery(url.searchParams.get("mode")),
1197
+ side: parseConnectorSideQuery(url.searchParams.get("side")),
1198
+ days: parsePositiveIntegerQuery(url.searchParams.get("days"), "days", {
1199
+ max: 31
1200
+ }) ?? void 0,
1201
+ startDate: parseDateOnlyQuery(
1202
+ url.searchParams.get("startDate"),
1203
+ "startDate"
1204
+ ),
1205
+ endDate: parseDateOnlyQuery(url.searchParams.get("endDate"), "endDate"),
1206
+ forceSync: url.searchParams.get("forceSync") === "true"
1207
+ };
1208
+ json(res, await service.getHealthSummary(request));
1209
+ });
1210
+ }
1211
+ if (method === "GET" && pathname === "/api/lifeops/connectors/x/status") {
1212
+ return runRoute(ctx, async (service) => {
1213
+ json(
1214
+ res,
1215
+ await service.getXConnectorStatus(
1216
+ parseConnectorModeQuery(url.searchParams.get("mode")),
1217
+ parseConnectorSideQuery(url.searchParams.get("side"))
1218
+ )
1219
+ );
1220
+ });
1221
+ }
1222
+ if (method === "POST" && pathname === "/api/lifeops/x/posts") {
1223
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1224
+ const body = await readJsonBody(req, res);
1225
+ if (!body) return true;
1226
+ return runRoute(ctx, async (service) => {
1227
+ json(res, await service.createXPost(body), 201);
1228
+ });
1229
+ }
1230
+ if (method === "GET" && pathname === "/api/lifeops/x/dms/digest") {
1231
+ return runRoute(ctx, async (service) => {
1232
+ const limit = parsePositiveIntegerQuery(url.searchParams.get("limit"), "limit", {
1233
+ max: 100
1234
+ }) ?? void 0;
1235
+ const conversationId = url.searchParams.get("conversationId")?.trim();
1236
+ json(
1237
+ res,
1238
+ await service.getXDmDigest({
1239
+ limit,
1240
+ conversationId: conversationId?.length ? conversationId : void 0
1241
+ })
1242
+ );
1243
+ });
1244
+ }
1245
+ if (method === "POST" && pathname === "/api/lifeops/x/dms/curate") {
1246
+ if (rateLimitRequest(ctx, "default")) return true;
1247
+ const body = await readJsonBody(req, res);
1248
+ if (!body) return true;
1249
+ return runRoute(ctx, async (service) => {
1250
+ json(
1251
+ res,
1252
+ await service.curateXDms({
1253
+ messageIds: parseOptionalBodyStringArray(body, "messageIds"),
1254
+ conversationId: parseOptionalBodyString(body, "conversationId"),
1255
+ markRead: parseOptionalBodyBoolean(body, "markRead"),
1256
+ markReplied: parseOptionalBodyBoolean(body, "markReplied")
1257
+ })
1258
+ );
1259
+ });
1260
+ }
1261
+ if (method === "POST" && pathname === "/api/lifeops/x/dms/send") {
1262
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1263
+ const body = await readJsonBody(req, res);
1264
+ if (!body) return true;
1265
+ return runRoute(ctx, async (service) => {
1266
+ json(
1267
+ res,
1268
+ await service.sendXDirectMessage({
1269
+ participantId: requireBodyString(body, "participantId"),
1270
+ text: requireBodyString(body, "text"),
1271
+ confirmSend: parseOptionalBodyBoolean(body, "confirmSend"),
1272
+ mode: parseConnectorModeInput(body.mode),
1273
+ side: parseConnectorSideInput(body.side)
1274
+ }),
1275
+ 201
1276
+ );
1277
+ });
1278
+ }
1279
+ if (method === "GET" && pathname === "/api/lifeops/connectors/imessage/status") {
1280
+ return runRoute(ctx, async (service) => {
1281
+ json(res, await service.getIMessageConnectorStatus());
1282
+ });
1283
+ }
1284
+ if (method === "GET" && pathname === "/api/lifeops/connectors/imessage/chats") {
1285
+ return runRoute(ctx, async (service) => {
1286
+ const chats = await service.listIMessageChats();
1287
+ json(res, { chats, count: chats.length });
1288
+ });
1289
+ }
1290
+ if (method === "GET" && pathname === "/api/lifeops/connectors/imessage/messages") {
1291
+ return runRoute(ctx, async (service) => {
1292
+ const query = {
1293
+ chatId: url.searchParams.get("chatId")?.trim() || void 0,
1294
+ since: url.searchParams.get("since")?.trim() || void 0,
1295
+ limit: parsePositiveIntegerQuery(url.searchParams.get("limit"), "limit", {
1296
+ max: 250
1297
+ }) ?? void 0
1298
+ };
1299
+ const messages = await service.readIMessages(query);
1300
+ json(res, { messages, count: messages.length });
1301
+ });
1302
+ }
1303
+ if (method === "POST" && pathname === "/api/lifeops/connectors/imessage/send") {
1304
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1305
+ const body = await readJsonBody(req, res);
1306
+ if (!body) return true;
1307
+ return runRoute(ctx, async (service) => {
1308
+ json(
1309
+ res,
1310
+ await service.sendIMessage({
1311
+ to: requireBodyString(body, "to"),
1312
+ text: requireBodyString(body, "text"),
1313
+ attachmentPaths: parseOptionalBodyStringArray(
1314
+ body,
1315
+ "attachmentPaths"
1316
+ )
1317
+ }),
1318
+ 201
1319
+ );
1320
+ });
1321
+ }
1322
+ if (method === "GET" && pathname === "/api/lifeops/connectors/telegram/status") {
1323
+ return runRoute(ctx, async (service) => {
1324
+ json(
1325
+ res,
1326
+ await service.getTelegramConnectorStatus(
1327
+ parseConnectorSideQuery(url.searchParams.get("side"))
1328
+ )
1329
+ );
1330
+ });
1331
+ }
1332
+ if (method === "POST" && pathname === "/api/lifeops/connectors/telegram/verify") {
1333
+ if (rateLimitRequest(ctx, "oauth_init")) return true;
1334
+ const body = await readJsonBody(
1335
+ req,
1336
+ res
1337
+ );
1338
+ if (!body) return true;
1339
+ return runRoute(ctx, async (service) => {
1340
+ json(res, await service.verifyTelegramConnector(body));
1341
+ });
1342
+ }
1343
+ if (method === "GET" && pathname === "/api/lifeops/connectors/signal/status") {
1344
+ return runRoute(ctx, async (service) => {
1345
+ json(
1346
+ res,
1347
+ await service.getSignalConnectorStatus(
1348
+ parseConnectorSideQuery(url.searchParams.get("side"))
1349
+ )
1350
+ );
1351
+ });
1352
+ }
1353
+ if (method === "GET" && pathname === "/api/lifeops/connectors/signal/messages") {
1354
+ return runRoute(ctx, async (service) => {
1355
+ const limit = parsePositiveIntegerQuery(url.searchParams.get("limit"), "limit", {
1356
+ max: 100
1357
+ }) ?? 25;
1358
+ const messages = await service.readSignalInbound(limit);
1359
+ json(res, { messages, count: messages.length });
1360
+ });
1361
+ }
1362
+ if (method === "POST" && pathname === "/api/lifeops/connectors/signal/send") {
1363
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1364
+ const body = await readJsonBody(req, res);
1365
+ if (!body) return true;
1366
+ return runRoute(ctx, async (service) => {
1367
+ json(
1368
+ res,
1369
+ await service.sendSignalMessage({
1370
+ side: parseConnectorSideFromRequest(url, body),
1371
+ recipient: requireBodyString(body, "recipient"),
1372
+ text: requireBodyString(body, "text")
1373
+ }),
1374
+ 201
1375
+ );
1376
+ });
1377
+ }
1378
+ if (method === "GET" && pathname === "/api/lifeops/connectors/discord/status") {
1379
+ return runRoute(ctx, async (service) => {
1380
+ json(
1381
+ res,
1382
+ await service.getDiscordConnectorStatus(
1383
+ parseConnectorSideQuery(url.searchParams.get("side"))
1384
+ )
1385
+ );
1386
+ });
1387
+ }
1388
+ if (method === "POST" && pathname === "/api/lifeops/connectors/discord/send") {
1389
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1390
+ const body = await readJsonBody(req, res);
1391
+ if (!body) return true;
1392
+ return runRoute(ctx, async (service) => {
1393
+ json(
1394
+ res,
1395
+ await service.sendDiscordMessage({
1396
+ side: parseConnectorSideFromRequest(url, body),
1397
+ channelId: parseOptionalBodyString(body, "channelId"),
1398
+ text: requireBodyString(body, "text")
1399
+ }),
1400
+ 201
1401
+ );
1402
+ });
1403
+ }
1404
+ if (method === "POST" && pathname === "/api/lifeops/connectors/discord/verify") {
1405
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1406
+ const body = await readJsonBody(req, res);
1407
+ if (!body) return true;
1408
+ return runRoute(ctx, async (service) => {
1409
+ json(
1410
+ res,
1411
+ await service.verifyDiscordConnector({
1412
+ side: parseConnectorSideFromRequest(url, body),
1413
+ channelId: parseOptionalBodyString(body, "channelId"),
1414
+ sendMessage: parseOptionalBodyString(body, "sendMessage")
1415
+ })
1416
+ );
1417
+ });
1418
+ }
1419
+ if (method === "GET" && pathname === "/api/lifeops/connectors/whatsapp/status") {
1420
+ return runRoute(ctx, async (service) => {
1421
+ json(res, await service.getWhatsAppConnectorStatus());
1422
+ });
1423
+ }
1424
+ if (method === "POST" && pathname === "/api/lifeops/connectors/whatsapp/send") {
1425
+ if (rateLimitRequest(ctx, "outbound_message")) return true;
1426
+ const body = await readJsonBody(req, res);
1427
+ if (!body) return true;
1428
+ return runRoute(ctx, async (service) => {
1429
+ json(
1430
+ res,
1431
+ await service.sendWhatsAppMessage({
1432
+ to: requireBodyString(body, "to"),
1433
+ text: requireBodyString(body, "text"),
1434
+ replyToMessageId: parseOptionalBodyString(body, "replyToMessageId")
1435
+ }),
1436
+ 201
1437
+ );
1438
+ });
1439
+ }
1440
+ if (method === "GET" && pathname === "/api/lifeops/connectors/whatsapp/messages") {
1441
+ return runRoute(ctx, async (service) => {
1442
+ const limit = parsePositiveIntegerQuery(url.searchParams.get("limit"), "limit", {
1443
+ max: 500
1444
+ }) ?? 25;
1445
+ json(res, await service.pullWhatsAppRecent(limit));
1446
+ });
1447
+ }
1448
+ if (method === "GET" && pathname === "/api/lifeops/channel-policies") {
1449
+ return runRoute(ctx, async (service) => {
1450
+ json(res, { policies: await service.listChannelPolicies() });
1451
+ });
1452
+ }
1453
+ if (method === "POST" && pathname === "/api/lifeops/channel-policies") {
1454
+ if (rateLimitRequest(ctx, "default")) return true;
1455
+ const body = await readJsonBody(
1456
+ req,
1457
+ res
1458
+ );
1459
+ if (!body) return true;
1460
+ return runRoute(ctx, async (service) => {
1461
+ json(res, { policy: await service.upsertChannelPolicy(body) }, 201);
1462
+ });
1463
+ }
1464
+ if (method === "POST" && pathname === "/api/lifeops/channels/phone-consent") {
1465
+ if (rateLimitRequest(ctx, "default")) return true;
1466
+ const body = await readJsonBody(
1467
+ req,
1468
+ res
1469
+ );
1470
+ if (!body) return true;
1471
+ return runRoute(ctx, async (service) => {
1472
+ json(res, await service.capturePhoneConsent(body), 201);
1473
+ });
1474
+ }
1475
+ if (method === "GET" && pathname === "/api/lifeops/activity-signals") {
1476
+ return runRoute(ctx, async (service) => {
1477
+ await ensureRouteSchema(ctx.state.runtime);
1478
+ json(res, {
1479
+ signals: await service.listActivitySignals({
1480
+ sinceAt: parseOptionalIsoQuery(
1481
+ url.searchParams.get("sinceAt"),
1482
+ "sinceAt"
1483
+ ),
1484
+ limit: parsePositiveIntegerQuery(url.searchParams.get("limit"), "limit", {
1485
+ max: ACTIVITY_SIGNALS_MAX_LIMIT
1486
+ }) ?? ACTIVITY_SIGNALS_DEFAULT_LIMIT,
1487
+ states: parseActivitySignalStates(url)
1488
+ })
1489
+ });
1490
+ });
1491
+ }
1492
+ if (method === "POST" && pathname === "/api/lifeops/activity-signals") {
1493
+ if (rateLimitRequest(ctx, "default")) return true;
1494
+ const body = await readJsonBody(
1495
+ req,
1496
+ res
1497
+ );
1498
+ if (!body) return true;
1499
+ return runRoute(ctx, async (service) => {
1500
+ await ensureRouteSchema(ctx.state.runtime);
1501
+ json(res, { signal: await service.captureActivitySignal(body) }, 201);
1502
+ });
1503
+ }
1504
+ if (method === "POST" && pathname === "/api/lifeops/manual-override") {
1505
+ if (rateLimitRequest(ctx, "default")) return true;
1506
+ const body = await readJsonBody(
1507
+ req,
1508
+ res
1509
+ );
1510
+ if (!body) return true;
1511
+ return runRoute(ctx, async (service) => {
1512
+ json(res, await service.captureManualOverride(body), 201);
1513
+ });
1514
+ }
1515
+ if (method === "POST" && pathname === "/api/lifeops/reminders/process") {
1516
+ if (rateLimitRequest(ctx, "reminders_process")) return true;
1517
+ const body = await readJsonBody(req, res);
1518
+ if (!body) return true;
1519
+ return runRoute(ctx, async (service) => {
1520
+ json(res, await service.processReminders(body));
1521
+ });
1522
+ }
1523
+ if (method === "GET" && pathname === "/api/lifeops/reminder-preferences") {
1524
+ return runRoute(ctx, async (service) => {
1525
+ json(
1526
+ res,
1527
+ await service.getReminderPreference(
1528
+ url.searchParams.get("definitionId") ?? void 0
1529
+ )
1530
+ );
1531
+ });
1532
+ }
1533
+ if (method === "POST" && pathname === "/api/lifeops/reminder-preferences") {
1534
+ if (rateLimitRequest(ctx, "default")) return true;
1535
+ const body = await readJsonBody(
1536
+ req,
1537
+ res
1538
+ );
1539
+ if (!body) return true;
1540
+ return runRoute(ctx, async (service) => {
1541
+ json(res, await service.setReminderPreference(body), 201);
1542
+ });
1543
+ }
1544
+ if (method === "POST" && pathname === "/api/lifeops/reminders/acknowledge") {
1545
+ if (rateLimitRequest(ctx, "default")) return true;
1546
+ const body = await readJsonBody(
1547
+ req,
1548
+ res
1549
+ );
1550
+ if (!body) return true;
1551
+ return runRoute(ctx, async (service) => {
1552
+ json(res, await service.acknowledgeReminder(body));
1553
+ });
1554
+ }
1555
+ if (method === "POST" && pathname === "/api/lifeops/website-access/relock") {
1556
+ if (rateLimitRequest(ctx, "default")) return true;
1557
+ const body = await readJsonBody(
1558
+ req,
1559
+ res
1560
+ );
1561
+ if (!body) return true;
1562
+ return runRoute(ctx, async (service) => {
1563
+ json(res, await service.relockWebsiteAccessGroup(body.groupKey));
1564
+ });
1565
+ }
1566
+ const websiteAccessCallbackMatch = pathname.match(
1567
+ /^\/api\/lifeops\/website-access\/callbacks\/([^/]+)\/resolve$/
1568
+ );
1569
+ if (method === "POST" && websiteAccessCallbackMatch) {
1570
+ if (rateLimitRequest(ctx, "default")) return true;
1571
+ const callbackKey = decodeMatchedPathComponent(
1572
+ ctx,
1573
+ websiteAccessCallbackMatch,
1574
+ 1,
1575
+ res,
1576
+ "website access callback key"
1577
+ );
1578
+ if (!callbackKey) return true;
1579
+ const body = await readJsonBody(
1580
+ req,
1581
+ res
1582
+ );
1583
+ if (body === null) return true;
1584
+ return runRoute(ctx, async (service) => {
1585
+ json(
1586
+ res,
1587
+ await service.resolveWebsiteAccessCallback(
1588
+ body.callbackKey || callbackKey
1589
+ )
1590
+ );
1591
+ });
1592
+ }
1593
+ if (method === "GET" && pathname === "/api/lifeops/reminders/inspection") {
1594
+ return runRoute(ctx, async (service) => {
1595
+ const ownerType = url.searchParams.get("ownerType");
1596
+ const ownerId = url.searchParams.get("ownerId");
1597
+ if (ownerType !== "occurrence" && ownerType !== "calendar_event") {
1598
+ throw new LifeOpsServiceError(
1599
+ 400,
1600
+ "ownerType must be occurrence or calendar_event"
1601
+ );
1602
+ }
1603
+ if (!ownerId) {
1604
+ throw new LifeOpsServiceError(400, "ownerId is required");
1605
+ }
1606
+ json(res, await service.inspectReminder(ownerType, ownerId));
1607
+ });
1608
+ }
1609
+ if (method === "GET" && pathname === "/api/lifeops/workflows") {
1610
+ return runRoute(ctx, async (service) => {
1611
+ json(res, { workflows: await service.listWorkflows() });
1612
+ });
1613
+ }
1614
+ if (method === "POST" && pathname === "/api/lifeops/workflows") {
1615
+ if (rateLimitRequest(ctx, "task_create")) return true;
1616
+ const body = await readJsonBody(req, res);
1617
+ if (!body) return true;
1618
+ return runRoute(ctx, async (service) => {
1619
+ json(res, await service.createWorkflow(body), 201);
1620
+ });
1621
+ }
1622
+ if (method === "POST" && pathname === "/api/lifeops/schedule/observations") {
1623
+ if (rateLimitRequest(ctx, "default")) return true;
1624
+ const body = await readJsonBody(
1625
+ req,
1626
+ res
1627
+ );
1628
+ if (!body) return true;
1629
+ return runRoute(ctx, async (service) => {
1630
+ json(res, await service.ingestScheduleObservations(body));
1631
+ });
1632
+ }
1633
+ if (method === "GET" && pathname === "/api/lifeops/schedule/merged-state") {
1634
+ const scopeParam = url.searchParams.get("scope");
1635
+ const scope = scopeParam?.trim() ?? "";
1636
+ if (scope.length > 0 && !LIFEOPS_SCHEDULE_STATE_SCOPES.includes(
1637
+ scope
1638
+ ) && scope !== "effective") {
1639
+ ctx.error(res, "scope must be local, cloud, or effective", 400);
1640
+ return true;
1641
+ }
1642
+ const refreshParam = url.searchParams.get("refresh")?.trim().toLowerCase();
1643
+ if (refreshParam && refreshParam !== "1" && refreshParam !== "0" && refreshParam !== "true" && refreshParam !== "false") {
1644
+ ctx.error(res, "refresh must be true, false, 1, or 0", 400);
1645
+ return true;
1646
+ }
1647
+ const refresh = refreshParam === "1" || refreshParam === "true";
1648
+ return runRoute(ctx, async (service) => {
1649
+ json(res, {
1650
+ mergedState: await service.getScheduleMergedState({
1651
+ timezone: url.searchParams.get("timezone"),
1652
+ scope: scope.length > 0 ? scope : void 0,
1653
+ refresh
1654
+ })
1655
+ });
1656
+ });
1657
+ }
1658
+ if (method === "GET" && pathname === "/api/lifeops/schedule/inspection") {
1659
+ const timezoneParam = url.searchParams.get("timezone")?.trim() || "UTC";
1660
+ return runRoute(ctx, async (service) => {
1661
+ json(res, await service.inspectSchedule({ timezone: timezoneParam }));
1662
+ });
1663
+ }
1664
+ if (method === "GET" && pathname === "/api/lifeops/schedule/summary") {
1665
+ const timezoneParam = url.searchParams.get("timezone")?.trim() || "UTC";
1666
+ return runRoute(ctx, async (service) => {
1667
+ json(res, await service.readScheduleSummary({ timezone: timezoneParam }));
1668
+ });
1669
+ }
1670
+ if (method === "GET" && pathname === "/api/lifeops/permissions/full-disk-access") {
1671
+ return runRoute(ctx, async () => {
1672
+ json(res, await probeFullDiskAccess());
1673
+ });
1674
+ }
1675
+ if (method === "GET" && pathname === "/api/lifeops/screen-time/summary") {
1676
+ return runRoute(ctx, async (service) => {
1677
+ const window = parseBoundedIsoWindowQuery(url);
1678
+ json(
1679
+ res,
1680
+ await service.getScreenTimeSummary({
1681
+ since: window.since,
1682
+ until: window.until,
1683
+ source: parseScreenTimeSourceQuery(url.searchParams.get("source")),
1684
+ identifier: parseScreenTimeIdentifierQuery(
1685
+ url.searchParams.get("identifier")
1686
+ ),
1687
+ topN: parsePositiveIntegerQuery(url.searchParams.get("topN"), "topN", {
1688
+ max: 20
1689
+ }) ?? void 0
1690
+ })
1691
+ );
1692
+ });
1693
+ }
1694
+ if (method === "GET" && pathname === "/api/lifeops/screen-time/breakdown") {
1695
+ return runRoute(ctx, async (service) => {
1696
+ const window = parseBoundedIsoWindowQuery(url);
1697
+ json(
1698
+ res,
1699
+ await service.getScreenTimeBreakdown({
1700
+ since: window.since,
1701
+ until: window.until,
1702
+ source: parseScreenTimeSourceQuery(url.searchParams.get("source")),
1703
+ identifier: parseScreenTimeIdentifierQuery(
1704
+ url.searchParams.get("identifier")
1705
+ ),
1706
+ topN: parsePositiveIntegerQuery(url.searchParams.get("topN"), "topN", {
1707
+ max: 50
1708
+ }) ?? void 0
1709
+ })
1710
+ );
1711
+ });
1712
+ }
1713
+ if (method === "GET" && pathname === "/api/lifeops/screen-time/history") {
1714
+ return runRoute(ctx, async (service) => {
1715
+ json(
1716
+ res,
1717
+ await service.getScreenTimeHistory({
1718
+ range: parseScreenTimeRangeQuery(url.searchParams.get("range")),
1719
+ topN: parsePositiveIntegerQuery(url.searchParams.get("topN"), "topN", {
1720
+ max: 50
1721
+ }) ?? void 0,
1722
+ socialTopN: parsePositiveIntegerQuery(
1723
+ url.searchParams.get("socialTopN"),
1724
+ "socialTopN",
1725
+ { max: 50 }
1726
+ ) ?? void 0
1727
+ })
1728
+ );
1729
+ });
1730
+ }
1731
+ if (method === "GET" && pathname === "/api/lifeops/social/summary") {
1732
+ return runRoute(ctx, async (service) => {
1733
+ const window = parseBoundedIsoWindowQuery(url);
1734
+ json(
1735
+ res,
1736
+ await service.getSocialHabitSummary({
1737
+ since: window.since,
1738
+ until: window.until,
1739
+ topN: parsePositiveIntegerQuery(url.searchParams.get("topN"), "topN", {
1740
+ max: 50
1741
+ }) ?? void 0
1742
+ })
1743
+ );
1744
+ });
1745
+ }
1746
+ if (method === "GET" && pathname === "/api/lifeops/capabilities") {
1747
+ return runRoute(ctx, async (service) => {
1748
+ json(res, await service.getCapabilityStatus());
1749
+ });
1750
+ }
1751
+ if (method === "GET" && pathname === "/api/lifeops/overview") {
1752
+ return runRoute(ctx, async (service) => {
1753
+ json(res, await service.getOverview());
1754
+ });
1755
+ }
1756
+ if (method === "GET" && pathname === "/api/lifeops/todos") {
1757
+ return runRoute(ctx, async (service) => {
1758
+ const overview = await service.getOverview();
1759
+ const todos = overview.owner.occurrences.map((occurrence) => ({
1760
+ id: occurrence.id,
1761
+ title: occurrence.title,
1762
+ status: occurrenceStateToTodoStatus(occurrence.state),
1763
+ dueDate: occurrence.dueAt
1764
+ }));
1765
+ json(res, { todos });
1766
+ });
1767
+ }
1768
+ if (method === "GET" && pathname === "/api/lifeops/money/dashboard") {
1769
+ return runFinancesRoute(ctx, async (service) => {
1770
+ const windowDaysRaw = url.searchParams.get("windowDays");
1771
+ const windowDays = windowDaysRaw ? Number(windowDaysRaw) : null;
1772
+ json(
1773
+ res,
1774
+ await service.getPaymentsDashboard({
1775
+ windowDays: Number.isFinite(windowDays) ? windowDays : null
1776
+ })
1777
+ );
1778
+ });
1779
+ }
1780
+ if (method === "GET" && pathname === "/api/lifeops/money/sources") {
1781
+ return runFinancesRoute(ctx, async (service) => {
1782
+ json(res, { sources: await service.listPaymentSources() });
1783
+ });
1784
+ }
1785
+ if (method === "POST" && pathname === "/api/lifeops/money/sources") {
1786
+ if (rateLimitRequest(ctx, "connector_write")) return true;
1787
+ const body = await readJsonBody(req, res);
1788
+ if (!body) return true;
1789
+ return runFinancesRoute(ctx, async (service) => {
1790
+ const source = await service.addPaymentSource(body);
1791
+ json(res, { source: sanitizePaymentSourceForClient(source) }, 201);
1792
+ });
1793
+ }
1794
+ if (method === "DELETE" && pathname.startsWith("/api/lifeops/money/sources/")) {
1795
+ if (rateLimitRequest(ctx, "connector_write")) return true;
1796
+ const sourceId = pathname.slice("/api/lifeops/money/sources/".length);
1797
+ if (!sourceId) {
1798
+ ctx.error(res, "sourceId required", 400);
1799
+ return true;
1800
+ }
1801
+ return runFinancesRoute(ctx, async (service) => {
1802
+ await service.deletePaymentSource(decodeURIComponent(sourceId));
1803
+ json(res, { ok: true });
1804
+ });
1805
+ }
1806
+ if (method === "POST" && pathname === "/api/lifeops/money/import-csv") {
1807
+ if (rateLimitRequest(ctx, "default")) return true;
1808
+ const body = await readJsonBody(req, res);
1809
+ if (!body) return true;
1810
+ return runFinancesRoute(ctx, async (service) => {
1811
+ const result = await service.importTransactionsCsv(body);
1812
+ json(res, result);
1813
+ });
1814
+ }
1815
+ if (method === "GET" && pathname === "/api/lifeops/money/transactions") {
1816
+ return runFinancesRoute(ctx, async (service) => {
1817
+ const sourceId = url.searchParams.get("sourceId");
1818
+ const limitRaw = url.searchParams.get("limit");
1819
+ const limit = limitRaw ? Number(limitRaw) : null;
1820
+ const merchantContains = url.searchParams.get("merchantContains");
1821
+ const onlyDebitsRaw = url.searchParams.get("onlyDebits");
1822
+ const transactions = await service.listTransactions({
1823
+ sourceId: sourceId ?? null,
1824
+ limit: Number.isFinite(limit) ? limit : null,
1825
+ merchantContains: merchantContains ?? null,
1826
+ onlyDebits: onlyDebitsRaw === "true" ? true : null
1827
+ });
1828
+ json(res, { transactions });
1829
+ });
1830
+ }
1831
+ if (method === "GET" && pathname === "/api/lifeops/money/recurring") {
1832
+ return runFinancesRoute(ctx, async (service) => {
1833
+ const sourceId = url.searchParams.get("sourceId");
1834
+ const sinceDaysRaw = url.searchParams.get("sinceDays");
1835
+ const sinceDays = sinceDaysRaw ? Number(sinceDaysRaw) : null;
1836
+ const charges = await service.getRecurringCharges({
1837
+ sourceId: sourceId ?? null,
1838
+ sinceDays: Number.isFinite(sinceDays) ? sinceDays : null
1839
+ });
1840
+ json(res, { charges });
1841
+ });
1842
+ }
1843
+ if (method === "POST" && pathname === "/api/lifeops/money/plaid/link-token") {
1844
+ if (rateLimitRequest(ctx, "oauth_init")) return true;
1845
+ return runFinancesRoute(ctx, async (service) => {
1846
+ const result = await service.createPlaidLinkToken();
1847
+ json(res, result);
1848
+ });
1849
+ }
1850
+ if (method === "POST" && pathname === "/api/lifeops/money/plaid/complete") {
1851
+ if (rateLimitRequest(ctx, "oauth_init")) return true;
1852
+ const body = await readJsonBody(req, res);
1853
+ if (!body) return true;
1854
+ return runFinancesRoute(ctx, async (service) => {
1855
+ const source = await service.completePlaidLink({
1856
+ publicToken: body.publicToken,
1857
+ label: body.label ?? null
1858
+ });
1859
+ json(
1860
+ res,
1861
+ {
1862
+ source: sanitizePaymentSourceForClient(source)
1863
+ },
1864
+ 201
1865
+ );
1866
+ });
1867
+ }
1868
+ if (method === "POST" && pathname === "/api/lifeops/money/plaid/sync") {
1869
+ if (rateLimitRequest(ctx, "default")) return true;
1870
+ const body = await readJsonBody(req, res);
1871
+ if (!body) return true;
1872
+ return runFinancesRoute(ctx, async (service) => {
1873
+ const result = await service.syncPlaidTransactions({
1874
+ sourceId: body.sourceId
1875
+ });
1876
+ json(res, result);
1877
+ });
1878
+ }
1879
+ if (method === "POST" && pathname === "/api/lifeops/money/paypal/authorize-url") {
1880
+ if (rateLimitRequest(ctx, "oauth_init")) return true;
1881
+ const body = await readJsonBody(req, res);
1882
+ if (!body) return true;
1883
+ return runFinancesRoute(ctx, async (service) => {
1884
+ const result = await service.createPaypalAuthorizeUrl({
1885
+ state: body.state
1886
+ });
1887
+ json(res, result);
1888
+ });
1889
+ }
1890
+ if (method === "POST" && pathname === "/api/lifeops/money/paypal/complete") {
1891
+ if (rateLimitRequest(ctx, "oauth_init")) return true;
1892
+ const body = await readJsonBody(req, res);
1893
+ if (!body) return true;
1894
+ return runFinancesRoute(ctx, async (service) => {
1895
+ const { source, capability } = await service.completePaypalLink({
1896
+ code: body.code,
1897
+ label: body.label ?? null
1898
+ });
1899
+ json(
1900
+ res,
1901
+ {
1902
+ source: sanitizePaymentSourceForClient(source),
1903
+ capability
1904
+ },
1905
+ 201
1906
+ );
1907
+ });
1908
+ }
1909
+ if (method === "POST" && pathname === "/api/lifeops/money/paypal/sync") {
1910
+ if (rateLimitRequest(ctx, "default")) return true;
1911
+ const body = await readJsonBody(req, res);
1912
+ if (!body) return true;
1913
+ return runFinancesRoute(ctx, async (service) => {
1914
+ const result = await service.syncPaypalTransactions({
1915
+ sourceId: body.sourceId,
1916
+ windowDays: body.windowDays ?? null
1917
+ });
1918
+ json(res, result);
1919
+ });
1920
+ }
1921
+ if (method === "GET" && pathname === "/api/lifeops/smart-features/settings") {
1922
+ return runRoute(ctx, async (service) => {
1923
+ const get = (key) => {
1924
+ const value = service.runtime.getSetting(key);
1925
+ if (value === void 0 || value === null) return null;
1926
+ return typeof value === "string" ? value : String(value);
1927
+ };
1928
+ json(res, {
1929
+ emailClassifierEnabled: (get("lifeops.emailClassifier.enabled") ?? "true") !== "false",
1930
+ emailClassifierModel: get("lifeops.emailClassifier.model") ?? "TEXT_SMALL",
1931
+ billsAutoExtract: (get("lifeops.bills.autoExtract") ?? "true") !== "false"
1932
+ });
1933
+ });
1934
+ }
1935
+ if (method === "POST" && pathname === "/api/lifeops/smart-features/settings") {
1936
+ if (rateLimitRequest(ctx, "default")) return true;
1937
+ const body = await readJsonBody(req, res);
1938
+ if (!body) return true;
1939
+ return runRoute(ctx, async (service) => {
1940
+ const setRuntime = service.runtime.setSetting.bind(service.runtime);
1941
+ if (typeof setRuntime !== "function") {
1942
+ ctx.error(res, "Runtime does not support setSetting", 501);
1943
+ return;
1944
+ }
1945
+ if (typeof body.emailClassifierEnabled === "boolean") {
1946
+ setRuntime(
1947
+ "lifeops.emailClassifier.enabled",
1948
+ body.emailClassifierEnabled ? "true" : "false",
1949
+ false
1950
+ );
1951
+ }
1952
+ if (typeof body.emailClassifierModel === "string") {
1953
+ setRuntime(
1954
+ "lifeops.emailClassifier.model",
1955
+ body.emailClassifierModel.trim() || "TEXT_SMALL",
1956
+ false
1957
+ );
1958
+ }
1959
+ if (typeof body.billsAutoExtract === "boolean") {
1960
+ setRuntime(
1961
+ "lifeops.bills.autoExtract",
1962
+ body.billsAutoExtract ? "true" : "false",
1963
+ false
1964
+ );
1965
+ }
1966
+ json(res, { ok: true });
1967
+ });
1968
+ }
1969
+ if (method === "GET" && pathname === "/api/lifeops/money/bills") {
1970
+ return runFinancesRoute(ctx, async (service) => {
1971
+ const bills = await service.getUpcomingBills({});
1972
+ json(res, { bills });
1973
+ });
1974
+ }
1975
+ if (method === "POST" && pathname === "/api/lifeops/money/bills/mark-paid") {
1976
+ if (rateLimitRequest(ctx, "task_update")) return true;
1977
+ const body = await readJsonBody(
1978
+ req,
1979
+ res
1980
+ );
1981
+ if (!body) return true;
1982
+ return runFinancesRoute(ctx, async (service) => {
1983
+ const result = await service.markBillPaid({
1984
+ billId: body.billId,
1985
+ paidAt: body.paidAt ?? null
1986
+ });
1987
+ json(res, result);
1988
+ });
1989
+ }
1990
+ if (method === "POST" && pathname === "/api/lifeops/money/bills/snooze") {
1991
+ if (rateLimitRequest(ctx, "task_update")) return true;
1992
+ const body = await readJsonBody(
1993
+ req,
1994
+ res
1995
+ );
1996
+ if (!body) return true;
1997
+ return runFinancesRoute(ctx, async (service) => {
1998
+ const result = await service.snoozeBill({
1999
+ billId: body.billId,
2000
+ days: body.days ?? 7
2001
+ });
2002
+ json(res, result);
2003
+ });
2004
+ }
2005
+ if (method === "GET" && pathname === "/api/lifeops/subscriptions/playbook-lookup") {
2006
+ return runRoute(ctx, async (service) => {
2007
+ const merchant = url.searchParams.get("merchant") ?? "";
2008
+ const playbook = service.findSubscriptionPlaybookForMerchant(merchant);
2009
+ json(res, { playbook });
2010
+ });
2011
+ }
2012
+ if (method === "GET" && pathname === "/api/lifeops/subscriptions/playbooks") {
2013
+ return runRoute(ctx, async (service) => {
2014
+ const playbooks = await service.listSubscriptionPlaybooks();
2015
+ const summary = playbooks.filter((playbook) => !playbook.key.startsWith("fixture_")).map((playbook) => ({
2016
+ key: playbook.key,
2017
+ serviceName: playbook.serviceName,
2018
+ aliases: playbook.aliases,
2019
+ managementUrl: playbook.managementUrl,
2020
+ executorPreference: playbook.executorPreference
2021
+ }));
2022
+ json(res, { playbooks: summary });
2023
+ });
2024
+ }
2025
+ if (method === "POST" && pathname === "/api/lifeops/subscriptions/cancel") {
2026
+ if (rateLimitRequest(ctx, "default")) return true;
2027
+ const body = await readJsonBody(req, res);
2028
+ if (!body) return true;
2029
+ return runRoute(ctx, async (service) => {
2030
+ const summary = await service.cancelSubscription({
2031
+ candidateId: body.candidateId ?? null,
2032
+ serviceName: body.serviceName ?? null,
2033
+ serviceSlug: body.serviceSlug ?? null,
2034
+ executor: body.executor ?? null,
2035
+ confirmed: body.confirmed ?? false
2036
+ });
2037
+ json(res, summary);
2038
+ });
2039
+ }
2040
+ if (method === "POST" && pathname === "/api/lifeops/email-unsubscribe/scan") {
2041
+ if (rateLimitRequest(ctx, "google_api_read")) return true;
2042
+ return runRoute(ctx, async (service) => {
2043
+ const requestUrl = ctx.url;
2044
+ const result = await service.scanEmailSubscriptions(requestUrl, {});
2045
+ json(res, result);
2046
+ });
2047
+ }
2048
+ if (method === "POST" && pathname === "/api/lifeops/email-unsubscribe/unsubscribe") {
2049
+ if (rateLimitRequest(ctx, "google_api_write")) return true;
2050
+ const body = await readJsonBody(req, res);
2051
+ if (!body) return true;
2052
+ return runRoute(ctx, async (service) => {
2053
+ const runtime = ctx.state.runtime;
2054
+ if (!runtime) {
2055
+ ctx.error(res, "Agent runtime is not available", 503);
2056
+ return;
2057
+ }
2058
+ const senderEmail = body.senderEmail?.trim();
2059
+ if (!senderEmail) {
2060
+ ctx.error(res, "senderEmail is required", 400);
2061
+ return;
2062
+ }
2063
+ const entityId = String(ctx.state.adminEntityId ?? "lifeops-owner");
2064
+ const confirmMessage = {
2065
+ entityId,
2066
+ roomId: entityId,
2067
+ content: {
2068
+ text: typeof body.userConfirmationText === "string" ? body.userConfirmationText : "",
2069
+ source: "lifeops-api"
2070
+ },
2071
+ createdAt: Date.now()
2072
+ };
2073
+ const preview = `Unsubscribe from ${senderEmail}?`;
2074
+ const decision = await requireConfirmation({
2075
+ runtime,
2076
+ message: confirmMessage,
2077
+ actionName: "EMAIL_UNSUBSCRIBE",
2078
+ pendingKey: senderEmail.toLowerCase(),
2079
+ prompt: preview
2080
+ });
2081
+ if (decision.status !== "confirmed") {
2082
+ json(
2083
+ res,
2084
+ {
2085
+ requiresConfirmation: decision.status === "pending",
2086
+ awaitingUserInput: decision.status === "pending",
2087
+ cancelled: decision.status === "cancelled",
2088
+ preview: `${preview} Reply yes to confirm or no to cancel.`
2089
+ },
2090
+ decision.status === "pending" ? 409 : 200
2091
+ );
2092
+ return;
2093
+ }
2094
+ const requestUrl = ctx.url;
2095
+ const result = await service.unsubscribeEmailSender(requestUrl, {
2096
+ senderEmail,
2097
+ blockAfter: body.blockAfter ?? false,
2098
+ trashExisting: body.trashExisting ?? false,
2099
+ userAuthorization: true
2100
+ });
2101
+ json(res, result);
2102
+ });
2103
+ }
2104
+ if (method === "GET" && pathname === "/api/lifeops/definitions") {
2105
+ return runRoute(ctx, async (service) => {
2106
+ json(res, { definitions: await service.listDefinitions() });
2107
+ });
2108
+ }
2109
+ if (method === "POST" && pathname === "/api/lifeops/definitions") {
2110
+ if (rateLimitRequest(ctx, "task_create")) return true;
2111
+ const body = await readJsonBody(req, res);
2112
+ if (!body) return true;
2113
+ return runRoute(ctx, async (service) => {
2114
+ json(res, await service.createDefinition(body), 201);
2115
+ });
2116
+ }
2117
+ const definitionMatch = pathname.match(
2118
+ /^\/api\/lifeops\/definitions\/([^/]+)$/
2119
+ );
2120
+ if (definitionMatch) {
2121
+ const definitionId = decodeMatchedPathComponent(
2122
+ ctx,
2123
+ definitionMatch,
2124
+ 1,
2125
+ res,
2126
+ "definition id"
2127
+ );
2128
+ if (!definitionId) return true;
2129
+ if (method === "GET") {
2130
+ return runRoute(ctx, async (service) => {
2131
+ json(res, await service.getDefinition(definitionId));
2132
+ });
2133
+ }
2134
+ if (method === "PUT") {
2135
+ if (rateLimitRequest(ctx, "task_update")) return true;
2136
+ const body = await readJsonBody(req, res);
2137
+ if (!body) return true;
2138
+ return runRoute(ctx, async (service) => {
2139
+ json(res, await service.updateDefinition(definitionId, body));
2140
+ });
2141
+ }
2142
+ if (method === "DELETE") {
2143
+ if (rateLimitRequest(ctx, "task_update")) return true;
2144
+ return runRoute(ctx, async (service) => {
2145
+ await service.deleteDefinition(definitionId);
2146
+ json(res, { deleted: true });
2147
+ });
2148
+ }
2149
+ }
2150
+ if (method === "GET" && pathname === "/api/lifeops/goals") {
2151
+ return runRoute(ctx, async (service) => {
2152
+ json(res, { goals: await service.listGoals() });
2153
+ });
2154
+ }
2155
+ if (method === "POST" && pathname === "/api/lifeops/goals") {
2156
+ if (rateLimitRequest(ctx, "task_create")) return true;
2157
+ const body = await readJsonBody(req, res);
2158
+ if (!body) return true;
2159
+ return runRoute(ctx, async (service) => {
2160
+ json(res, await service.createGoal(body), 201);
2161
+ });
2162
+ }
2163
+ const goalMatch = pathname.match(/^\/api\/lifeops\/goals\/([^/]+)$/);
2164
+ if (goalMatch) {
2165
+ const goalId = decodeMatchedPathComponent(
2166
+ ctx,
2167
+ goalMatch,
2168
+ 1,
2169
+ res,
2170
+ "goal id"
2171
+ );
2172
+ if (!goalId) return true;
2173
+ if (method === "GET") {
2174
+ return runRoute(ctx, async (service) => {
2175
+ json(res, await service.getGoal(goalId));
2176
+ });
2177
+ }
2178
+ if (method === "PUT") {
2179
+ if (rateLimitRequest(ctx, "task_update")) return true;
2180
+ const body = await readJsonBody(req, res);
2181
+ if (!body) return true;
2182
+ return runRoute(ctx, async (service) => {
2183
+ json(res, await service.updateGoal(goalId, body));
2184
+ });
2185
+ }
2186
+ if (method === "DELETE") {
2187
+ if (rateLimitRequest(ctx, "task_update")) return true;
2188
+ return runRoute(ctx, async (service) => {
2189
+ await service.deleteGoal(goalId);
2190
+ json(res, { deleted: true });
2191
+ });
2192
+ }
2193
+ }
2194
+ const goalReviewMatch = pathname.match(
2195
+ /^\/api\/lifeops\/goals\/([^/]+)\/review$/
2196
+ );
2197
+ if (goalReviewMatch && method === "GET") {
2198
+ const goalId = decodeMatchedPathComponent(
2199
+ ctx,
2200
+ goalReviewMatch,
2201
+ 1,
2202
+ res,
2203
+ "goal id"
2204
+ );
2205
+ if (!goalId) return true;
2206
+ return runRoute(ctx, async (service) => {
2207
+ json(res, await service.reviewGoal(goalId));
2208
+ });
2209
+ }
2210
+ const workflowMatch = pathname.match(/^\/api\/lifeops\/workflows\/([^/]+)$/);
2211
+ if (workflowMatch) {
2212
+ const workflowId = decodeMatchedPathComponent(
2213
+ ctx,
2214
+ workflowMatch,
2215
+ 1,
2216
+ res,
2217
+ "workflow id"
2218
+ );
2219
+ if (!workflowId) return true;
2220
+ if (method === "GET") {
2221
+ return runRoute(ctx, async (service) => {
2222
+ json(res, await service.getWorkflow(workflowId));
2223
+ });
2224
+ }
2225
+ if (method === "PUT") {
2226
+ if (rateLimitRequest(ctx, "task_update")) return true;
2227
+ const body = await readJsonBody(req, res);
2228
+ if (!body) return true;
2229
+ return runRoute(ctx, async (service) => {
2230
+ json(res, await service.updateWorkflow(workflowId, body));
2231
+ });
2232
+ }
2233
+ }
2234
+ const workflowRunMatch = pathname.match(
2235
+ /^\/api\/lifeops\/workflows\/([^/]+)\/run$/
2236
+ );
2237
+ if (method === "POST" && workflowRunMatch) {
2238
+ if (rateLimitRequest(ctx, "task_create")) return true;
2239
+ const workflowId = decodeMatchedPathComponent(
2240
+ ctx,
2241
+ workflowRunMatch,
2242
+ 1,
2243
+ res,
2244
+ "workflow id"
2245
+ );
2246
+ if (!workflowId) return true;
2247
+ const body = await readJsonBody(req, res);
2248
+ if (!body) return true;
2249
+ return runRoute(ctx, async (service) => {
2250
+ json(res, { run: await service.runWorkflow(workflowId, body) }, 201);
2251
+ });
2252
+ }
2253
+ const occurrenceExplanationMatch = pathname.match(
2254
+ /^\/api\/lifeops\/occurrences\/([^/]+)\/explanation$/
2255
+ );
2256
+ if (occurrenceExplanationMatch && method === "GET") {
2257
+ const occurrenceId = decodeMatchedPathComponent(
2258
+ ctx,
2259
+ occurrenceExplanationMatch,
2260
+ 1,
2261
+ res,
2262
+ "occurrence id"
2263
+ );
2264
+ if (!occurrenceId) return true;
2265
+ return runRoute(ctx, async (service) => {
2266
+ json(res, await service.explainOccurrence(occurrenceId));
2267
+ });
2268
+ }
2269
+ const completeMatch = pathname.match(
2270
+ /^\/api\/lifeops\/occurrences\/([^/]+)\/complete$/
2271
+ );
2272
+ if (method === "POST" && completeMatch) {
2273
+ if (rateLimitRequest(ctx, "task_update")) return true;
2274
+ const occurrenceId = decodeMatchedPathComponent(
2275
+ ctx,
2276
+ completeMatch,
2277
+ 1,
2278
+ res,
2279
+ "occurrence id"
2280
+ );
2281
+ if (!occurrenceId) return true;
2282
+ const body = await readJsonBody(req, res);
2283
+ if (!body) return true;
2284
+ return runRoute(ctx, async (service) => {
2285
+ json(res, {
2286
+ occurrence: await service.completeOccurrence(occurrenceId, body)
2287
+ });
2288
+ });
2289
+ }
2290
+ const skipMatch = pathname.match(
2291
+ /^\/api\/lifeops\/occurrences\/([^/]+)\/skip$/
2292
+ );
2293
+ if (method === "POST" && skipMatch) {
2294
+ if (rateLimitRequest(ctx, "task_update")) return true;
2295
+ const occurrenceId = decodeMatchedPathComponent(
2296
+ ctx,
2297
+ skipMatch,
2298
+ 1,
2299
+ res,
2300
+ "occurrence id"
2301
+ );
2302
+ if (!occurrenceId) return true;
2303
+ const body = await readJsonBody(req, res);
2304
+ if (!body) return true;
2305
+ return runRoute(ctx, async (service) => {
2306
+ json(res, {
2307
+ occurrence: await service.skipOccurrence(occurrenceId)
2308
+ });
2309
+ });
2310
+ }
2311
+ const snoozeMatch = pathname.match(
2312
+ /^\/api\/lifeops\/occurrences\/([^/]+)\/snooze$/
2313
+ );
2314
+ if (method === "POST" && snoozeMatch) {
2315
+ if (rateLimitRequest(ctx, "task_update")) return true;
2316
+ const occurrenceId = decodeMatchedPathComponent(
2317
+ ctx,
2318
+ snoozeMatch,
2319
+ 1,
2320
+ res,
2321
+ "occurrence id"
2322
+ );
2323
+ if (!occurrenceId) return true;
2324
+ const body = await readJsonBody(req, res);
2325
+ if (!body) return true;
2326
+ return runRoute(ctx, async (service) => {
2327
+ json(res, {
2328
+ occurrence: await service.snoozeOccurrence(occurrenceId, body)
2329
+ });
2330
+ });
2331
+ }
2332
+ return false;
2333
+ }
2334
+ export {
2335
+ handleLifeOpsRoutes
2336
+ };
2337
+ //# sourceMappingURL=lifeops-routes.js.map