@elizaos/agent 2.0.0-alpha.173 → 2.0.0-alpha.192

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 (1393) hide show
  1. package/apps/app-companion/src/actions/emote.d.ts.map +1 -1
  2. package/apps/app-companion/src/actions/emote.js +1 -0
  3. package/apps/app-elizamaker/src/drop-routes.d.ts +22 -0
  4. package/apps/app-elizamaker/src/drop-routes.d.ts.map +1 -0
  5. package/apps/app-elizamaker/src/drop-service.d.ts +26 -0
  6. package/apps/app-elizamaker/src/drop-service.d.ts.map +1 -0
  7. package/apps/app-elizamaker/src/index.d.ts +8 -0
  8. package/apps/app-elizamaker/src/index.d.ts.map +1 -0
  9. package/apps/app-elizamaker/src/index.js +5 -0
  10. package/apps/app-elizamaker/src/merkle-tree.d.ts.map +1 -0
  11. package/apps/app-elizamaker/src/og-tracker.d.ts.map +1 -0
  12. package/apps/app-elizamaker/src/og-tracker.js +60 -0
  13. package/apps/app-elizamaker/src/twitter-verify.d.ts +25 -0
  14. package/apps/app-elizamaker/src/twitter-verify.d.ts.map +1 -0
  15. package/apps/app-elizamaker/src/twitter-verify.js +168 -0
  16. package/apps/app-lifeops/src/actions/activity-report.d.ts +13 -0
  17. package/apps/app-lifeops/src/actions/activity-report.d.ts.map +1 -0
  18. package/apps/app-lifeops/src/actions/activity-report.js +287 -0
  19. package/apps/app-lifeops/src/actions/app-blocker.d.ts +5 -0
  20. package/apps/app-lifeops/src/actions/app-blocker.d.ts.map +1 -0
  21. package/apps/app-lifeops/src/actions/app-blocker.js +446 -0
  22. package/apps/app-lifeops/src/actions/autofill.d.ts +35 -0
  23. package/apps/app-lifeops/src/actions/autofill.d.ts.map +1 -0
  24. package/apps/app-lifeops/src/actions/autofill.js +340 -0
  25. package/apps/app-lifeops/src/actions/browser-extension.d.ts +19 -0
  26. package/apps/app-lifeops/src/actions/browser-extension.d.ts.map +1 -0
  27. package/apps/app-lifeops/src/actions/browser-extension.js +88 -0
  28. package/apps/app-lifeops/src/actions/calendar.d.ts.map +1 -1
  29. package/apps/app-lifeops/src/actions/calendar.js +405 -973
  30. package/apps/app-lifeops/src/actions/calendly.d.ts +3 -0
  31. package/apps/app-lifeops/src/actions/calendly.d.ts.map +1 -0
  32. package/apps/app-lifeops/src/actions/calendly.js +242 -0
  33. package/apps/app-lifeops/src/actions/checkin.d.ts +4 -0
  34. package/apps/app-lifeops/src/actions/checkin.d.ts.map +1 -0
  35. package/apps/app-lifeops/src/actions/checkin.js +72 -0
  36. package/apps/app-lifeops/src/actions/computer-use.d.ts +14 -0
  37. package/apps/app-lifeops/src/actions/computer-use.d.ts.map +1 -0
  38. package/apps/app-lifeops/src/actions/computer-use.js +149 -0
  39. package/apps/app-lifeops/src/actions/cross-channel-send.d.ts +22 -0
  40. package/apps/app-lifeops/src/actions/cross-channel-send.d.ts.map +1 -0
  41. package/apps/app-lifeops/src/actions/cross-channel-send.js +562 -0
  42. package/apps/app-lifeops/src/actions/device-bus.d.ts +19 -0
  43. package/apps/app-lifeops/src/actions/device-bus.d.ts.map +1 -0
  44. package/apps/app-lifeops/src/actions/device-bus.js +233 -0
  45. package/apps/app-lifeops/src/actions/dossier.d.ts +5 -0
  46. package/apps/app-lifeops/src/actions/dossier.d.ts.map +1 -0
  47. package/apps/app-lifeops/src/actions/dossier.js +195 -0
  48. package/apps/app-lifeops/src/actions/gmail.d.ts.map +1 -1
  49. package/apps/app-lifeops/src/actions/gmail.js +73 -37
  50. package/apps/app-lifeops/src/actions/health.d.ts +9 -0
  51. package/apps/app-lifeops/src/actions/health.d.ts.map +1 -0
  52. package/apps/app-lifeops/src/actions/health.js +357 -0
  53. package/apps/app-lifeops/src/actions/inbox.d.ts +3 -1
  54. package/apps/app-lifeops/src/actions/inbox.d.ts.map +1 -1
  55. package/apps/app-lifeops/src/actions/inbox.js +279 -152
  56. package/apps/app-lifeops/src/actions/intent-sync.d.ts +3 -0
  57. package/apps/app-lifeops/src/actions/intent-sync.d.ts.map +1 -0
  58. package/apps/app-lifeops/src/actions/intent-sync.js +258 -0
  59. package/apps/app-lifeops/src/actions/life.d.ts +0 -4
  60. package/apps/app-lifeops/src/actions/life.d.ts.map +1 -1
  61. package/apps/app-lifeops/src/actions/life.js +162 -249
  62. package/apps/app-lifeops/src/actions/lifeops-google-helpers.d.ts.map +1 -1
  63. package/apps/app-lifeops/src/actions/lifeops-google-helpers.js +11 -3
  64. package/apps/app-lifeops/src/actions/list-remote-sessions.d.ts +6 -0
  65. package/apps/app-lifeops/src/actions/list-remote-sessions.d.ts.map +1 -0
  66. package/apps/app-lifeops/src/actions/list-remote-sessions.js +45 -0
  67. package/apps/app-lifeops/src/actions/password-manager.d.ts +3 -0
  68. package/apps/app-lifeops/src/actions/password-manager.d.ts.map +1 -0
  69. package/apps/app-lifeops/src/actions/password-manager.js +182 -0
  70. package/apps/app-lifeops/src/actions/relationships.d.ts +9 -0
  71. package/apps/app-lifeops/src/actions/relationships.d.ts.map +1 -0
  72. package/apps/app-lifeops/src/actions/relationships.js +504 -0
  73. package/apps/app-lifeops/src/actions/remote-desktop.d.ts +3 -0
  74. package/apps/app-lifeops/src/actions/remote-desktop.d.ts.map +1 -0
  75. package/apps/app-lifeops/src/actions/remote-desktop.js +244 -0
  76. package/apps/app-lifeops/src/actions/revoke-remote-session.d.ts +6 -0
  77. package/apps/app-lifeops/src/actions/revoke-remote-session.d.ts.map +1 -0
  78. package/apps/app-lifeops/src/actions/revoke-remote-session.js +73 -0
  79. package/apps/app-lifeops/src/actions/scheduling.d.ts +55 -0
  80. package/apps/app-lifeops/src/actions/scheduling.d.ts.map +1 -0
  81. package/apps/app-lifeops/src/actions/scheduling.js +914 -0
  82. package/apps/app-lifeops/src/actions/screen-time.d.ts +8 -0
  83. package/apps/app-lifeops/src/actions/screen-time.d.ts.map +1 -0
  84. package/apps/app-lifeops/src/actions/screen-time.js +231 -0
  85. package/apps/app-lifeops/src/actions/search-across-channels.d.ts +13 -0
  86. package/apps/app-lifeops/src/actions/search-across-channels.d.ts.map +1 -0
  87. package/apps/app-lifeops/src/actions/search-across-channels.js +340 -0
  88. package/apps/app-lifeops/src/actions/start-remote-session.d.ts +14 -0
  89. package/apps/app-lifeops/src/actions/start-remote-session.d.ts.map +1 -0
  90. package/apps/app-lifeops/src/actions/start-remote-session.js +138 -0
  91. package/apps/app-lifeops/src/actions/twilio-call.d.ts +20 -0
  92. package/apps/app-lifeops/src/actions/twilio-call.d.ts.map +1 -0
  93. package/apps/app-lifeops/src/actions/twilio-call.js +510 -0
  94. package/apps/app-lifeops/src/actions/update-owner-profile.d.ts +3 -1
  95. package/apps/app-lifeops/src/actions/update-owner-profile.d.ts.map +1 -1
  96. package/apps/app-lifeops/src/actions/update-owner-profile.js +52 -31
  97. package/apps/app-lifeops/src/actions/website-blocker.d.ts +10 -0
  98. package/apps/app-lifeops/src/actions/website-blocker.d.ts.map +1 -0
  99. package/apps/app-lifeops/src/actions/website-blocker.js +539 -0
  100. package/apps/app-lifeops/src/actions/x-read.d.ts +3 -0
  101. package/apps/app-lifeops/src/actions/x-read.d.ts.map +1 -0
  102. package/apps/app-lifeops/src/actions/x-read.js +367 -0
  103. package/apps/app-lifeops/src/activity-profile/activity-tracker-repo.d.ts +28 -0
  104. package/apps/app-lifeops/src/activity-profile/activity-tracker-repo.d.ts.map +1 -0
  105. package/apps/app-lifeops/src/activity-profile/activity-tracker-repo.js +62 -0
  106. package/apps/app-lifeops/src/activity-profile/activity-tracker-reporting.d.ts +45 -0
  107. package/apps/app-lifeops/src/activity-profile/activity-tracker-reporting.d.ts.map +1 -0
  108. package/apps/app-lifeops/src/activity-profile/activity-tracker-reporting.js +112 -0
  109. package/apps/app-lifeops/src/activity-profile/activity-tracker-service.d.ts +26 -0
  110. package/apps/app-lifeops/src/activity-profile/activity-tracker-service.d.ts.map +1 -0
  111. package/apps/app-lifeops/src/activity-profile/activity-tracker-service.js +84 -0
  112. package/apps/app-lifeops/src/activity-profile/analyzer.d.ts.map +1 -0
  113. package/apps/app-lifeops/src/activity-profile/analyzer.js +544 -0
  114. package/apps/app-lifeops/src/activity-profile/proactive-planner.d.ts.map +1 -0
  115. package/apps/app-lifeops/src/activity-profile/proactive-planner.js +458 -0
  116. package/apps/app-lifeops/src/activity-profile/proactive-worker.d.ts.map +1 -0
  117. package/apps/app-lifeops/src/activity-profile/proactive-worker.js +571 -0
  118. package/apps/app-lifeops/src/activity-profile/profile-metadata.d.ts.map +1 -0
  119. package/apps/app-lifeops/src/activity-profile/redactor.d.ts +18 -0
  120. package/apps/app-lifeops/src/activity-profile/redactor.d.ts.map +1 -0
  121. package/apps/app-lifeops/src/activity-profile/redactor.js +39 -0
  122. package/apps/app-lifeops/src/activity-profile/service.d.ts +11 -0
  123. package/apps/app-lifeops/src/activity-profile/service.d.ts.map +1 -0
  124. package/apps/app-lifeops/src/activity-profile/service.js +229 -0
  125. package/apps/app-lifeops/src/activity-profile/types.d.ts.map +1 -0
  126. package/apps/app-lifeops/src/app-blocker/access.d.ts +8 -0
  127. package/apps/app-lifeops/src/app-blocker/access.d.ts.map +1 -0
  128. package/apps/app-lifeops/src/app-blocker/access.js +28 -0
  129. package/apps/app-lifeops/src/app-blocker/engine.d.ts +10 -0
  130. package/apps/app-lifeops/src/app-blocker/engine.d.ts.map +1 -0
  131. package/apps/app-lifeops/src/app-blocker/engine.js +43 -0
  132. package/apps/app-lifeops/src/dossier/action.d.ts +9 -0
  133. package/apps/app-lifeops/src/dossier/action.d.ts.map +1 -0
  134. package/apps/app-lifeops/src/dossier/action.js +87 -0
  135. package/apps/app-lifeops/src/dossier/service.d.ts +145 -0
  136. package/apps/app-lifeops/src/dossier/service.d.ts.map +1 -0
  137. package/apps/app-lifeops/src/dossier/service.js +346 -0
  138. package/apps/app-lifeops/src/followup/actions/listOverdueFollowups.d.ts +3 -0
  139. package/apps/app-lifeops/src/followup/actions/listOverdueFollowups.d.ts.map +1 -0
  140. package/apps/app-lifeops/src/followup/actions/listOverdueFollowups.js +47 -0
  141. package/apps/app-lifeops/src/followup/actions/markFollowupDone.d.ts +3 -0
  142. package/apps/app-lifeops/src/followup/actions/markFollowupDone.d.ts.map +1 -0
  143. package/apps/app-lifeops/src/followup/actions/markFollowupDone.js +172 -0
  144. package/apps/app-lifeops/src/followup/actions/setFollowupThreshold.d.ts +3 -0
  145. package/apps/app-lifeops/src/followup/actions/setFollowupThreshold.d.ts.map +1 -0
  146. package/apps/app-lifeops/src/followup/actions/setFollowupThreshold.js +171 -0
  147. package/apps/app-lifeops/src/followup/followup-tracker.d.ts +81 -0
  148. package/apps/app-lifeops/src/followup/followup-tracker.d.ts.map +1 -0
  149. package/apps/app-lifeops/src/followup/followup-tracker.js +251 -0
  150. package/apps/app-lifeops/src/followup/index.d.ts +5 -0
  151. package/apps/app-lifeops/src/followup/index.d.ts.map +1 -0
  152. package/apps/app-lifeops/src/followup/index.js +4 -0
  153. package/apps/app-lifeops/src/inbox/reflection.d.ts +0 -5
  154. package/apps/app-lifeops/src/inbox/reflection.d.ts.map +1 -1
  155. package/apps/app-lifeops/src/inbox/reflection.js +9 -51
  156. package/apps/app-lifeops/src/inbox/repository.d.ts +0 -1
  157. package/apps/app-lifeops/src/inbox/repository.d.ts.map +1 -1
  158. package/apps/app-lifeops/src/inbox/repository.js +18 -118
  159. package/apps/app-lifeops/src/inbox/triage-classifier.d.ts +4 -6
  160. package/apps/app-lifeops/src/inbox/triage-classifier.d.ts.map +1 -1
  161. package/apps/app-lifeops/src/inbox/triage-classifier.js +68 -101
  162. package/apps/app-lifeops/src/inbox/types.d.ts +4 -42
  163. package/apps/app-lifeops/src/inbox/types.d.ts.map +1 -1
  164. package/apps/app-lifeops/src/lifeops/approval-queue.types.d.ts +162 -0
  165. package/apps/app-lifeops/src/lifeops/approval-queue.types.d.ts.map +1 -0
  166. package/apps/app-lifeops/src/lifeops/approval-queue.types.js +41 -0
  167. package/apps/app-lifeops/src/lifeops/autofill-whitelist.d.ts +24 -0
  168. package/apps/app-lifeops/src/lifeops/autofill-whitelist.d.ts.map +1 -0
  169. package/apps/app-lifeops/src/lifeops/autofill-whitelist.js +125 -0
  170. package/apps/app-lifeops/src/lifeops/background-planner-dispatch.d.ts +59 -0
  171. package/apps/app-lifeops/src/lifeops/background-planner-dispatch.d.ts.map +1 -0
  172. package/apps/app-lifeops/src/lifeops/background-planner-dispatch.js +129 -0
  173. package/apps/app-lifeops/src/lifeops/background-planner.d.ts +141 -0
  174. package/apps/app-lifeops/src/lifeops/background-planner.d.ts.map +1 -0
  175. package/apps/app-lifeops/src/lifeops/background-planner.js +308 -0
  176. package/apps/app-lifeops/src/lifeops/browser-extension-store.d.ts +61 -0
  177. package/apps/app-lifeops/src/lifeops/browser-extension-store.d.ts.map +1 -0
  178. package/apps/app-lifeops/src/lifeops/browser-extension-store.js +181 -0
  179. package/apps/app-lifeops/src/lifeops/calendly-client.d.ts +61 -0
  180. package/apps/app-lifeops/src/lifeops/calendly-client.d.ts.map +1 -0
  181. package/apps/app-lifeops/src/lifeops/calendly-client.js +218 -0
  182. package/apps/app-lifeops/src/lifeops/checkin/checkin-service.d.ts +24 -0
  183. package/apps/app-lifeops/src/lifeops/checkin/checkin-service.d.ts.map +1 -0
  184. package/apps/app-lifeops/src/lifeops/checkin/checkin-service.js +216 -0
  185. package/apps/app-lifeops/src/lifeops/checkin/schedule-resolver.d.ts +14 -0
  186. package/apps/app-lifeops/src/lifeops/checkin/schedule-resolver.d.ts.map +1 -0
  187. package/apps/app-lifeops/src/lifeops/checkin/schedule-resolver.js +33 -0
  188. package/apps/app-lifeops/src/lifeops/checkin/types.d.ts +42 -0
  189. package/apps/app-lifeops/src/lifeops/checkin/types.d.ts.map +1 -0
  190. package/apps/app-lifeops/src/lifeops/checkin/types.js +7 -0
  191. package/apps/app-lifeops/src/lifeops/defaults.d.ts +1 -1
  192. package/apps/app-lifeops/src/lifeops/defaults.d.ts.map +1 -1
  193. package/apps/app-lifeops/src/lifeops/defaults.js +8 -1
  194. package/apps/app-lifeops/src/lifeops/discord-browser-scraper.d.ts +106 -0
  195. package/apps/app-lifeops/src/lifeops/discord-browser-scraper.d.ts.map +1 -0
  196. package/apps/app-lifeops/src/lifeops/discord-browser-scraper.js +488 -0
  197. package/apps/app-lifeops/src/lifeops/enforcement-windows.d.ts +34 -0
  198. package/apps/app-lifeops/src/lifeops/enforcement-windows.d.ts.map +1 -0
  199. package/apps/app-lifeops/src/lifeops/enforcement-windows.js +110 -0
  200. package/apps/app-lifeops/src/lifeops/google-connector-gateway.d.ts +13 -0
  201. package/apps/app-lifeops/src/lifeops/google-connector-gateway.d.ts.map +1 -1
  202. package/apps/app-lifeops/src/lifeops/google-connector-gateway.js +23 -0
  203. package/apps/app-lifeops/src/lifeops/google-drive.d.ts +103 -0
  204. package/apps/app-lifeops/src/lifeops/google-drive.d.ts.map +1 -0
  205. package/apps/app-lifeops/src/lifeops/google-drive.js +265 -0
  206. package/apps/app-lifeops/src/lifeops/google-fetch.d.ts +5 -0
  207. package/apps/app-lifeops/src/lifeops/google-fetch.d.ts.map +1 -1
  208. package/apps/app-lifeops/src/lifeops/google-fetch.js +12 -1
  209. package/apps/app-lifeops/src/lifeops/google-gmail.d.ts.map +1 -1
  210. package/apps/app-lifeops/src/lifeops/google-gmail.js +19 -34
  211. package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts +12 -1
  212. package/apps/app-lifeops/src/lifeops/google-managed-client.d.ts.map +1 -1
  213. package/apps/app-lifeops/src/lifeops/google-managed-client.js +32 -12
  214. package/apps/app-lifeops/src/lifeops/google-oauth.d.ts +4 -0
  215. package/apps/app-lifeops/src/lifeops/google-oauth.d.ts.map +1 -1
  216. package/apps/app-lifeops/src/lifeops/google-oauth.js +99 -13
  217. package/apps/app-lifeops/src/lifeops/health-bridge.d.ts +57 -0
  218. package/apps/app-lifeops/src/lifeops/health-bridge.d.ts.map +1 -0
  219. package/apps/app-lifeops/src/lifeops/health-bridge.js +514 -0
  220. package/apps/app-lifeops/src/lifeops/imessage-bridge.d.ts +98 -0
  221. package/apps/app-lifeops/src/lifeops/imessage-bridge.d.ts.map +1 -0
  222. package/apps/app-lifeops/src/lifeops/imessage-bridge.js +537 -0
  223. package/apps/app-lifeops/src/lifeops/intent-sync.d.ts +56 -0
  224. package/apps/app-lifeops/src/lifeops/intent-sync.d.ts.map +1 -0
  225. package/apps/app-lifeops/src/lifeops/intent-sync.js +223 -0
  226. package/apps/app-lifeops/src/lifeops/notifications-push.d.ts +37 -0
  227. package/apps/app-lifeops/src/lifeops/notifications-push.d.ts.map +1 -0
  228. package/apps/app-lifeops/src/lifeops/notifications-push.js +90 -0
  229. package/apps/app-lifeops/src/lifeops/owner-profile.d.ts +29 -1
  230. package/apps/app-lifeops/src/lifeops/owner-profile.d.ts.map +1 -1
  231. package/apps/app-lifeops/src/lifeops/owner-profile.js +106 -0
  232. package/apps/app-lifeops/src/lifeops/password-manager-bridge.d.ts +49 -0
  233. package/apps/app-lifeops/src/lifeops/password-manager-bridge.d.ts.map +1 -0
  234. package/apps/app-lifeops/src/lifeops/password-manager-bridge.js +374 -0
  235. package/apps/app-lifeops/src/lifeops/remote-desktop.d.ts +37 -0
  236. package/apps/app-lifeops/src/lifeops/remote-desktop.d.ts.map +1 -0
  237. package/apps/app-lifeops/src/lifeops/remote-desktop.js +341 -0
  238. package/apps/app-lifeops/src/lifeops/repository.d.ts +69 -3
  239. package/apps/app-lifeops/src/lifeops/repository.d.ts.map +1 -1
  240. package/apps/app-lifeops/src/lifeops/repository.js +1368 -926
  241. package/apps/app-lifeops/src/lifeops/runtime.d.ts +1 -0
  242. package/apps/app-lifeops/src/lifeops/runtime.d.ts.map +1 -1
  243. package/apps/app-lifeops/src/lifeops/runtime.js +119 -9
  244. package/apps/app-lifeops/src/lifeops/schema.d.ts +5022 -0
  245. package/apps/app-lifeops/src/lifeops/schema.d.ts.map +1 -0
  246. package/apps/app-lifeops/src/lifeops/schema.js +207 -0
  247. package/apps/app-lifeops/src/lifeops/service-constants.d.ts +51 -0
  248. package/apps/app-lifeops/src/lifeops/service-constants.d.ts.map +1 -0
  249. package/apps/app-lifeops/src/lifeops/service-constants.js +111 -0
  250. package/apps/app-lifeops/src/lifeops/service-helpers-browser.d.ts +40 -0
  251. package/apps/app-lifeops/src/lifeops/service-helpers-browser.d.ts.map +1 -0
  252. package/apps/app-lifeops/src/lifeops/service-helpers-browser.js +288 -0
  253. package/apps/app-lifeops/src/lifeops/service-helpers-misc.d.ts +68 -0
  254. package/apps/app-lifeops/src/lifeops/service-helpers-misc.d.ts.map +1 -0
  255. package/apps/app-lifeops/src/lifeops/service-helpers-misc.js +493 -0
  256. package/apps/app-lifeops/src/lifeops/service-helpers-occurrence.d.ts +17 -0
  257. package/apps/app-lifeops/src/lifeops/service-helpers-occurrence.d.ts.map +1 -0
  258. package/apps/app-lifeops/src/lifeops/service-helpers-occurrence.js +214 -0
  259. package/apps/app-lifeops/src/lifeops/service-helpers-reminder.d.ts +24 -0
  260. package/apps/app-lifeops/src/lifeops/service-helpers-reminder.d.ts.map +1 -0
  261. package/apps/app-lifeops/src/lifeops/service-helpers-reminder.js +170 -0
  262. package/apps/app-lifeops/src/lifeops/service-mixin-browser.d.ts +2 -0
  263. package/apps/app-lifeops/src/lifeops/service-mixin-browser.d.ts.map +1 -0
  264. package/apps/app-lifeops/src/lifeops/service-mixin-browser.js +769 -0
  265. package/apps/app-lifeops/src/lifeops/service-mixin-calendar.d.ts +2 -0
  266. package/apps/app-lifeops/src/lifeops/service-mixin-calendar.d.ts.map +1 -0
  267. package/apps/app-lifeops/src/lifeops/service-mixin-calendar.js +513 -0
  268. package/apps/app-lifeops/src/lifeops/service-mixin-core.d.ts +49 -0
  269. package/apps/app-lifeops/src/lifeops/service-mixin-core.d.ts.map +1 -0
  270. package/apps/app-lifeops/src/lifeops/service-mixin-core.js +433 -0
  271. package/apps/app-lifeops/src/lifeops/service-mixin-definitions.d.ts +2 -0
  272. package/apps/app-lifeops/src/lifeops/service-mixin-definitions.d.ts.map +1 -0
  273. package/apps/app-lifeops/src/lifeops/service-mixin-definitions.js +353 -0
  274. package/apps/app-lifeops/src/lifeops/service-mixin-discord.d.ts +2 -0
  275. package/apps/app-lifeops/src/lifeops/service-mixin-discord.d.ts.map +1 -0
  276. package/apps/app-lifeops/src/lifeops/service-mixin-discord.js +603 -0
  277. package/apps/app-lifeops/src/lifeops/service-mixin-dossier.d.ts +2 -0
  278. package/apps/app-lifeops/src/lifeops/service-mixin-dossier.d.ts.map +1 -0
  279. package/apps/app-lifeops/src/lifeops/service-mixin-dossier.js +262 -0
  280. package/apps/app-lifeops/src/lifeops/service-mixin-drive.d.ts +12 -0
  281. package/apps/app-lifeops/src/lifeops/service-mixin-drive.d.ts.map +1 -0
  282. package/apps/app-lifeops/src/lifeops/service-mixin-drive.js +230 -0
  283. package/apps/app-lifeops/src/lifeops/service-mixin-gmail.d.ts +2 -0
  284. package/apps/app-lifeops/src/lifeops/service-mixin-gmail.d.ts.map +1 -0
  285. package/apps/app-lifeops/src/lifeops/service-mixin-gmail.js +1013 -0
  286. package/apps/app-lifeops/src/lifeops/service-mixin-goals.d.ts +2 -0
  287. package/apps/app-lifeops/src/lifeops/service-mixin-goals.d.ts.map +1 -0
  288. package/apps/app-lifeops/src/lifeops/service-mixin-goals.js +714 -0
  289. package/apps/app-lifeops/src/lifeops/service-mixin-google.d.ts +2 -0
  290. package/apps/app-lifeops/src/lifeops/service-mixin-google.d.ts.map +1 -0
  291. package/apps/app-lifeops/src/lifeops/service-mixin-google.js +793 -0
  292. package/apps/app-lifeops/src/lifeops/service-mixin-health.d.ts +2 -0
  293. package/apps/app-lifeops/src/lifeops/service-mixin-health.d.ts.map +1 -0
  294. package/apps/app-lifeops/src/lifeops/service-mixin-health.js +55 -0
  295. package/apps/app-lifeops/src/lifeops/service-mixin-imessage.d.ts +3 -0
  296. package/apps/app-lifeops/src/lifeops/service-mixin-imessage.d.ts.map +1 -0
  297. package/apps/app-lifeops/src/lifeops/service-mixin-imessage.js +106 -0
  298. package/apps/app-lifeops/src/lifeops/service-mixin-relationships.d.ts +2 -0
  299. package/apps/app-lifeops/src/lifeops/service-mixin-relationships.d.ts.map +1 -0
  300. package/apps/app-lifeops/src/lifeops/service-mixin-relationships.js +109 -0
  301. package/apps/app-lifeops/src/lifeops/service-mixin-reminders.d.ts +37 -0
  302. package/apps/app-lifeops/src/lifeops/service-mixin-reminders.d.ts.map +1 -0
  303. package/apps/app-lifeops/src/lifeops/service-mixin-reminders.js +2436 -0
  304. package/apps/app-lifeops/src/lifeops/service-mixin-scheduling.d.ts +2 -0
  305. package/apps/app-lifeops/src/lifeops/service-mixin-scheduling.d.ts.map +1 -0
  306. package/apps/app-lifeops/src/lifeops/service-mixin-scheduling.js +149 -0
  307. package/apps/app-lifeops/src/lifeops/service-mixin-screentime.d.ts +2 -0
  308. package/apps/app-lifeops/src/lifeops/service-mixin-screentime.d.ts.map +1 -0
  309. package/apps/app-lifeops/src/lifeops/service-mixin-screentime.js +97 -0
  310. package/apps/app-lifeops/src/lifeops/service-mixin-signal.d.ts +2 -0
  311. package/apps/app-lifeops/src/lifeops/service-mixin-signal.d.ts.map +1 -0
  312. package/apps/app-lifeops/src/lifeops/service-mixin-signal.js +264 -0
  313. package/apps/app-lifeops/src/lifeops/service-mixin-telegram.d.ts +2 -0
  314. package/apps/app-lifeops/src/lifeops/service-mixin-telegram.d.ts.map +1 -0
  315. package/apps/app-lifeops/src/lifeops/service-mixin-telegram.js +270 -0
  316. package/apps/app-lifeops/src/lifeops/service-mixin-whatsapp.d.ts +2 -0
  317. package/apps/app-lifeops/src/lifeops/service-mixin-whatsapp.d.ts.map +1 -0
  318. package/apps/app-lifeops/src/lifeops/service-mixin-whatsapp.js +56 -0
  319. package/apps/app-lifeops/src/lifeops/service-mixin-workflows.d.ts +2 -0
  320. package/apps/app-lifeops/src/lifeops/service-mixin-workflows.d.ts.map +1 -0
  321. package/apps/app-lifeops/src/lifeops/service-mixin-workflows.js +411 -0
  322. package/apps/app-lifeops/src/lifeops/service-mixin-x-read.d.ts +2 -0
  323. package/apps/app-lifeops/src/lifeops/service-mixin-x-read.d.ts.map +1 -0
  324. package/apps/app-lifeops/src/lifeops/service-mixin-x-read.js +190 -0
  325. package/apps/app-lifeops/src/lifeops/service-mixin-x.d.ts +2 -0
  326. package/apps/app-lifeops/src/lifeops/service-mixin-x.d.ts.map +1 -0
  327. package/apps/app-lifeops/src/lifeops/service-mixin-x.js +120 -0
  328. package/apps/app-lifeops/src/lifeops/service-normalize-calendar.d.ts +42 -0
  329. package/apps/app-lifeops/src/lifeops/service-normalize-calendar.d.ts.map +1 -0
  330. package/apps/app-lifeops/src/lifeops/service-normalize-calendar.js +294 -0
  331. package/apps/app-lifeops/src/lifeops/service-normalize-connector.d.ts +18 -0
  332. package/apps/app-lifeops/src/lifeops/service-normalize-connector.d.ts.map +1 -0
  333. package/apps/app-lifeops/src/lifeops/service-normalize-connector.js +317 -0
  334. package/apps/app-lifeops/src/lifeops/service-normalize-gmail.d.ts +63 -0
  335. package/apps/app-lifeops/src/lifeops/service-normalize-gmail.d.ts.map +1 -0
  336. package/apps/app-lifeops/src/lifeops/service-normalize-gmail.js +553 -0
  337. package/apps/app-lifeops/src/lifeops/service-normalize-task.d.ts +8 -0
  338. package/apps/app-lifeops/src/lifeops/service-normalize-task.d.ts.map +1 -0
  339. package/apps/app-lifeops/src/lifeops/service-normalize-task.js +333 -0
  340. package/apps/app-lifeops/src/lifeops/service-normalize.d.ts +27 -0
  341. package/apps/app-lifeops/src/lifeops/service-normalize.d.ts.map +1 -0
  342. package/apps/app-lifeops/src/lifeops/service-normalize.js +193 -0
  343. package/apps/app-lifeops/src/lifeops/service-types.d.ts +43 -0
  344. package/apps/app-lifeops/src/lifeops/service-types.d.ts.map +1 -0
  345. package/apps/app-lifeops/src/lifeops/service-types.js +8 -0
  346. package/apps/app-lifeops/src/lifeops/service.d.ts +1566 -272
  347. package/apps/app-lifeops/src/lifeops/service.d.ts.map +1 -1
  348. package/apps/app-lifeops/src/lifeops/service.js +38 -9256
  349. package/apps/app-lifeops/src/lifeops/signal-auth.d.ts +26 -0
  350. package/apps/app-lifeops/src/lifeops/signal-auth.d.ts.map +1 -0
  351. package/apps/app-lifeops/src/lifeops/signal-auth.js +300 -0
  352. package/apps/app-lifeops/src/lifeops/signal-runtime-config.d.ts +13 -0
  353. package/apps/app-lifeops/src/lifeops/signal-runtime-config.d.ts.map +1 -0
  354. package/apps/app-lifeops/src/lifeops/signal-runtime-config.js +42 -0
  355. package/apps/app-lifeops/src/lifeops/sql.d.ts +0 -5
  356. package/apps/app-lifeops/src/lifeops/sql.d.ts.map +1 -1
  357. package/apps/app-lifeops/src/lifeops/sql.js +5 -125
  358. package/apps/app-lifeops/src/lifeops/telegram-auth.d.ts +62 -0
  359. package/apps/app-lifeops/src/lifeops/telegram-auth.d.ts.map +1 -0
  360. package/apps/app-lifeops/src/lifeops/telegram-auth.js +496 -0
  361. package/apps/app-lifeops/src/lifeops/telegram-local-client.d.ts +118 -0
  362. package/apps/app-lifeops/src/lifeops/telegram-local-client.d.ts.map +1 -0
  363. package/apps/app-lifeops/src/lifeops/telegram-local-client.js +376 -0
  364. package/apps/app-lifeops/src/lifeops/twilio.d.ts.map +1 -1
  365. package/apps/app-lifeops/src/lifeops/twilio.js +2 -1
  366. package/apps/app-lifeops/src/lifeops/unified-search.d.ts +88 -0
  367. package/apps/app-lifeops/src/lifeops/unified-search.d.ts.map +1 -0
  368. package/apps/app-lifeops/src/lifeops/unified-search.js +431 -0
  369. package/apps/app-lifeops/src/lifeops/whatsapp-client.d.ts +47 -0
  370. package/apps/app-lifeops/src/lifeops/whatsapp-client.d.ts.map +1 -0
  371. package/apps/app-lifeops/src/lifeops/whatsapp-client.js +198 -0
  372. package/apps/app-lifeops/src/lifeops/x-poster.d.ts +22 -0
  373. package/apps/app-lifeops/src/lifeops/x-poster.d.ts.map +1 -1
  374. package/apps/app-lifeops/src/lifeops/x-poster.js +67 -3
  375. package/apps/app-lifeops/src/lifeops/x-reader.d.ts +70 -0
  376. package/apps/app-lifeops/src/lifeops/x-reader.d.ts.map +1 -0
  377. package/apps/app-lifeops/src/lifeops/x-reader.js +260 -0
  378. package/apps/app-lifeops/src/plugin.d.ts +12 -1
  379. package/apps/app-lifeops/src/plugin.d.ts.map +1 -1
  380. package/apps/app-lifeops/src/plugin.js +245 -26
  381. package/apps/app-lifeops/src/provider.d.ts.map +1 -1
  382. package/apps/app-lifeops/src/provider.js +1 -0
  383. package/apps/app-lifeops/src/providers/activity-profile.d.ts.map +1 -0
  384. package/apps/app-lifeops/src/providers/activity-profile.js +140 -0
  385. package/apps/app-lifeops/src/providers/app-blocker.d.ts +3 -0
  386. package/apps/app-lifeops/src/providers/app-blocker.d.ts.map +1 -0
  387. package/apps/app-lifeops/src/providers/app-blocker.js +86 -0
  388. package/apps/app-lifeops/src/providers/cross-channel-context.d.ts +29 -0
  389. package/apps/app-lifeops/src/providers/cross-channel-context.d.ts.map +1 -0
  390. package/apps/app-lifeops/src/providers/cross-channel-context.js +193 -0
  391. package/apps/app-lifeops/src/providers/inbox-triage.d.ts.map +1 -1
  392. package/apps/app-lifeops/src/providers/inbox-triage.js +1 -0
  393. package/apps/app-lifeops/src/providers/lifeops.d.ts +1 -1
  394. package/apps/app-lifeops/src/providers/lifeops.d.ts.map +1 -1
  395. package/apps/app-lifeops/src/providers/lifeops.js +39 -11
  396. package/apps/app-lifeops/src/providers/website-blocker.d.ts +4 -0
  397. package/apps/app-lifeops/src/providers/website-blocker.d.ts.map +1 -0
  398. package/apps/app-lifeops/src/providers/website-blocker.js +117 -0
  399. package/apps/app-lifeops/src/remote/pairing-code.d.ts +39 -0
  400. package/apps/app-lifeops/src/remote/pairing-code.d.ts.map +1 -0
  401. package/apps/app-lifeops/src/remote/pairing-code.js +76 -0
  402. package/apps/app-lifeops/src/remote/remote-session-service.d.ts +107 -0
  403. package/apps/app-lifeops/src/remote/remote-session-service.d.ts.map +1 -0
  404. package/apps/app-lifeops/src/remote/remote-session-service.js +253 -0
  405. package/apps/app-lifeops/src/routes/lifeops-browser-packaging.d.ts.map +1 -1
  406. package/apps/app-lifeops/src/routes/lifeops-browser-packaging.js +9 -3
  407. package/apps/app-lifeops/src/routes/lifeops-routes.d.ts +1 -1
  408. package/apps/app-lifeops/src/routes/lifeops-routes.d.ts.map +1 -1
  409. package/apps/app-lifeops/src/routes/lifeops-routes.js +276 -40
  410. package/apps/app-lifeops/src/routes/website-blocker-routes.d.ts.map +1 -1
  411. package/apps/app-lifeops/src/routes/website-blocker-routes.js +8 -13
  412. package/apps/app-lifeops/src/travel-time/action.d.ts +6 -0
  413. package/apps/app-lifeops/src/travel-time/action.d.ts.map +1 -0
  414. package/apps/app-lifeops/src/travel-time/action.js +81 -0
  415. package/apps/app-lifeops/src/travel-time/service.d.ts +61 -0
  416. package/apps/app-lifeops/src/travel-time/service.d.ts.map +1 -0
  417. package/apps/app-lifeops/src/travel-time/service.js +145 -0
  418. package/apps/app-lifeops/src/types/app-blocker-settings-card.d.ts +2 -0
  419. package/apps/app-lifeops/src/types/app-blocker-settings-card.d.ts.map +1 -0
  420. package/apps/app-lifeops/src/types/index.d.ts +3 -0
  421. package/apps/app-lifeops/src/types/index.d.ts.map +1 -0
  422. package/apps/app-lifeops/src/types/website-blocker-settings-card.d.ts +2 -0
  423. package/apps/app-lifeops/src/types/website-blocker-settings-card.d.ts.map +1 -0
  424. package/apps/app-lifeops/src/website-blocker/access.d.ts +8 -0
  425. package/apps/app-lifeops/src/website-blocker/access.d.ts.map +1 -0
  426. package/apps/app-lifeops/src/website-blocker/access.js +32 -0
  427. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/blockUntilTaskComplete.d.ts +3 -0
  428. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/blockUntilTaskComplete.d.ts.map +1 -0
  429. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/blockUntilTaskComplete.js +212 -0
  430. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/listActiveBlocks.d.ts +3 -0
  431. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/listActiveBlocks.d.ts.map +1 -0
  432. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/listActiveBlocks.js +57 -0
  433. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/releaseBlock.d.ts +3 -0
  434. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/releaseBlock.d.ts.map +1 -0
  435. package/apps/app-lifeops/src/website-blocker/chat-integration/actions/releaseBlock.js +98 -0
  436. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-reconciler.d.ts +7 -0
  437. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-reconciler.d.ts.map +1 -0
  438. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-reconciler.js +111 -0
  439. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-schema.d.ts +39 -0
  440. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-schema.d.ts.map +1 -0
  441. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-schema.js +123 -0
  442. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.d.ts +21 -0
  443. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.d.ts.map +1 -0
  444. package/apps/app-lifeops/src/website-blocker/chat-integration/block-rule-service.js +227 -0
  445. package/apps/app-lifeops/src/website-blocker/chat-integration/index.d.ts +8 -0
  446. package/apps/app-lifeops/src/website-blocker/chat-integration/index.d.ts.map +1 -0
  447. package/apps/app-lifeops/src/website-blocker/chat-integration/index.js +6 -0
  448. package/apps/app-lifeops/src/website-blocker/engine.d.ts +116 -0
  449. package/apps/app-lifeops/src/website-blocker/engine.d.ts.map +1 -0
  450. package/apps/app-lifeops/src/website-blocker/engine.js +934 -0
  451. package/apps/app-lifeops/src/website-blocker/permissions.d.ts.map +1 -0
  452. package/apps/app-lifeops/src/website-blocker/permissions.js +1 -0
  453. package/apps/app-lifeops/src/website-blocker/public.d.ts +13 -0
  454. package/apps/app-lifeops/src/website-blocker/public.d.ts.map +1 -0
  455. package/apps/app-lifeops/src/website-blocker/public.js +10 -0
  456. package/apps/app-lifeops/src/website-blocker/roles.d.ts +13 -0
  457. package/apps/app-lifeops/src/website-blocker/roles.d.ts.map +1 -0
  458. package/apps/app-lifeops/src/website-blocker/roles.js +20 -0
  459. package/apps/app-lifeops/src/website-blocker/service.d.ts +21 -0
  460. package/apps/app-lifeops/src/website-blocker/service.d.ts.map +1 -0
  461. package/apps/app-lifeops/src/website-blocker/service.js +268 -0
  462. package/apps/app-steward/src/api/tx-service.d.ts +47 -0
  463. package/apps/app-steward/src/api/tx-service.d.ts.map +1 -0
  464. package/apps/app-steward/src/api/tx-service.js +156 -0
  465. package/apps/app-steward/src/api/wallet-routes.d.ts +1 -9
  466. package/apps/app-steward/src/api/wallet-routes.d.ts.map +1 -1
  467. package/apps/app-steward/src/routes/wallet-export-guard.d.ts +2 -9
  468. package/apps/app-steward/src/routes/wallet-export-guard.d.ts.map +1 -1
  469. package/apps/app-steward/src/types/steward.d.ts +85 -0
  470. package/apps/app-steward/src/types/steward.d.ts.map +1 -0
  471. package/apps/app-steward/src/types/steward.js +9 -0
  472. package/apps/app-training/src/backends/atropos.d.ts +31 -0
  473. package/apps/app-training/src/backends/atropos.d.ts.map +1 -0
  474. package/apps/app-training/src/backends/atropos.js +63 -0
  475. package/apps/app-training/src/backends/native.d.ts +50 -0
  476. package/apps/app-training/src/backends/native.d.ts.map +1 -0
  477. package/apps/app-training/src/backends/native.js +128 -0
  478. package/apps/app-training/src/backends/tinker.d.ts +27 -0
  479. package/apps/app-training/src/backends/tinker.d.ts.map +1 -0
  480. package/apps/app-training/src/backends/tinker.js +56 -0
  481. package/apps/app-training/src/core/privacy-filter.d.ts +73 -0
  482. package/apps/app-training/src/core/privacy-filter.d.ts.map +1 -0
  483. package/apps/app-training/src/core/privacy-filter.js +169 -0
  484. package/apps/app-training/src/core/training-config.d.ts +52 -0
  485. package/apps/app-training/src/core/training-config.d.ts.map +1 -0
  486. package/apps/app-training/src/core/training-config.js +140 -0
  487. package/apps/app-training/src/core/training-orchestrator.d.ts +107 -0
  488. package/apps/app-training/src/core/training-orchestrator.d.ts.map +1 -0
  489. package/apps/app-training/src/core/training-orchestrator.js +409 -0
  490. package/apps/app-training/src/core/trajectory-task-datasets.d.ts +38 -0
  491. package/apps/app-training/src/core/trajectory-task-datasets.d.ts.map +1 -0
  492. package/apps/app-training/src/core/trajectory-task-datasets.js +281 -0
  493. package/apps/app-training/src/optimizers/bootstrap-fewshot.d.ts +42 -0
  494. package/apps/app-training/src/optimizers/bootstrap-fewshot.d.ts.map +1 -0
  495. package/apps/app-training/src/optimizers/bootstrap-fewshot.js +91 -0
  496. package/apps/app-training/src/optimizers/index.d.ts +6 -0
  497. package/apps/app-training/src/optimizers/index.d.ts.map +1 -0
  498. package/apps/app-training/src/optimizers/index.js +4 -0
  499. package/apps/app-training/src/optimizers/instruction-search.d.ts +39 -0
  500. package/apps/app-training/src/optimizers/instruction-search.d.ts.map +1 -0
  501. package/apps/app-training/src/optimizers/instruction-search.js +82 -0
  502. package/apps/app-training/src/optimizers/prompt-evolution.d.ts +39 -0
  503. package/apps/app-training/src/optimizers/prompt-evolution.d.ts.map +1 -0
  504. package/apps/app-training/src/optimizers/prompt-evolution.js +111 -0
  505. package/apps/app-training/src/optimizers/scoring.d.ts +63 -0
  506. package/apps/app-training/src/optimizers/scoring.d.ts.map +1 -0
  507. package/apps/app-training/src/optimizers/scoring.js +117 -0
  508. package/apps/app-training/src/optimizers/types.d.ts +105 -0
  509. package/apps/app-training/src/optimizers/types.d.ts.map +1 -0
  510. package/apps/app-training/src/optimizers/types.js +17 -0
  511. package/apps/app-training/src/services/index.d.ts +1 -0
  512. package/apps/app-training/src/services/index.d.ts.map +1 -1
  513. package/apps/app-training/src/services/index.js +1 -0
  514. package/apps/app-training/src/services/training-trigger.d.ts +166 -0
  515. package/apps/app-training/src/services/training-trigger.d.ts.map +1 -0
  516. package/apps/app-training/src/services/training-trigger.js +376 -0
  517. package/package.json +26 -21
  518. package/packages/agent/src/actions/app-control.js +1 -1
  519. package/packages/agent/src/actions/connector-resolver.d.ts.map +1 -1
  520. package/packages/agent/src/actions/connector-resolver.js +17 -7
  521. package/packages/agent/src/actions/context-signal-lexicon.d.ts +1 -1
  522. package/packages/agent/src/actions/context-signal-lexicon.d.ts.map +1 -1
  523. package/packages/agent/src/actions/context-signal-lexicon.js +7 -1
  524. package/packages/agent/src/actions/context-signal.d.ts +1 -1
  525. package/packages/agent/src/actions/context-signal.d.ts.map +1 -1
  526. package/packages/agent/src/actions/context-signal.js +1 -1
  527. package/packages/agent/src/actions/eject-plugin.d.ts.map +1 -1
  528. package/packages/agent/src/actions/eject-plugin.js +3 -1
  529. package/packages/agent/src/actions/entity-actions.d.ts +1 -0
  530. package/packages/agent/src/actions/entity-actions.d.ts.map +1 -1
  531. package/packages/agent/src/actions/entity-actions.js +233 -1
  532. package/packages/agent/src/actions/get-self-status.d.ts.map +1 -1
  533. package/packages/agent/src/actions/get-self-status.js +12 -1
  534. package/packages/agent/src/actions/grounded-action-reply.d.ts.map +1 -1
  535. package/packages/agent/src/actions/grounded-action-reply.js +1 -1
  536. package/packages/agent/src/actions/index.d.ts +0 -9
  537. package/packages/agent/src/actions/index.d.ts.map +1 -1
  538. package/packages/agent/src/actions/index.js +0 -9
  539. package/packages/agent/src/actions/install-plugin.d.ts.map +1 -1
  540. package/packages/agent/src/actions/install-plugin.js +3 -1
  541. package/packages/agent/src/actions/list-ejected.d.ts.map +1 -1
  542. package/packages/agent/src/actions/list-ejected.js +5 -3
  543. package/packages/agent/src/actions/reinject-plugin.d.ts.map +1 -1
  544. package/packages/agent/src/actions/reinject-plugin.js +3 -1
  545. package/packages/agent/src/actions/set-user-name.d.ts.map +1 -1
  546. package/packages/agent/src/actions/set-user-name.js +1 -1
  547. package/packages/agent/src/actions/sync-plugin.d.ts.map +1 -1
  548. package/packages/agent/src/actions/sync-plugin.js +5 -6
  549. package/packages/agent/src/api/agent-admin-routes.js +1 -1
  550. package/packages/agent/src/api/apps-routes.d.ts +2 -1
  551. package/packages/agent/src/api/apps-routes.d.ts.map +1 -1
  552. package/packages/agent/src/api/apps-routes.js +152 -2
  553. package/packages/agent/src/api/auth-routes.js +1 -1
  554. package/packages/agent/src/api/bsc-trade.d.ts +0 -4
  555. package/packages/agent/src/api/bsc-trade.d.ts.map +1 -1
  556. package/packages/agent/src/api/bsc-trade.js +0 -4
  557. package/packages/agent/src/api/character-routes.d.ts +2 -1
  558. package/packages/agent/src/api/character-routes.d.ts.map +1 -1
  559. package/packages/agent/src/api/chat-augmentation.js +1 -1
  560. package/packages/agent/src/api/chat-routes.d.ts.map +1 -1
  561. package/packages/agent/src/api/chat-routes.js +23 -108
  562. package/packages/agent/src/api/cloud-billing-routes.d.ts +1 -1
  563. package/packages/agent/src/api/cloud-billing-routes.d.ts.map +1 -1
  564. package/packages/agent/src/api/cloud-compat-routes.d.ts +1 -1
  565. package/packages/agent/src/api/cloud-compat-routes.d.ts.map +1 -1
  566. package/packages/agent/src/api/connector-health.d.ts +1 -1
  567. package/packages/agent/src/api/connector-health.d.ts.map +1 -1
  568. package/packages/agent/src/api/conversation-routes.d.ts +2 -2
  569. package/packages/agent/src/api/conversation-routes.d.ts.map +1 -1
  570. package/packages/agent/src/api/conversation-routes.js +1 -1
  571. package/packages/agent/src/api/curated-skills-routes.d.ts +22 -0
  572. package/packages/agent/src/api/curated-skills-routes.d.ts.map +1 -0
  573. package/packages/agent/src/api/curated-skills-routes.js +300 -0
  574. package/packages/agent/src/api/database.d.ts.map +1 -1
  575. package/packages/agent/src/api/database.js +11 -4
  576. package/packages/agent/src/api/discord-profiles.d.ts.map +1 -1
  577. package/packages/agent/src/api/discord-profiles.js +1 -4
  578. package/packages/agent/src/api/index.d.ts +0 -7
  579. package/packages/agent/src/api/index.d.ts.map +1 -1
  580. package/packages/agent/src/api/index.js +0 -7
  581. package/packages/agent/src/api/knowledge-routes.d.ts +22 -1
  582. package/packages/agent/src/api/knowledge-routes.d.ts.map +1 -1
  583. package/packages/agent/src/api/knowledge-routes.js +956 -2
  584. package/packages/agent/src/api/lifeops-browser-packaging.d.ts +1 -1
  585. package/packages/agent/src/api/lifeops-browser-packaging.d.ts.map +1 -1
  586. package/packages/agent/src/api/lifeops-browser-packaging.js +1 -1
  587. package/packages/agent/src/api/misc-routes.d.ts +2 -2
  588. package/packages/agent/src/api/misc-routes.d.ts.map +1 -1
  589. package/packages/agent/src/api/misc-routes.js +43 -6
  590. package/packages/agent/src/api/plugin-discovery-helpers.d.ts.map +1 -1
  591. package/packages/agent/src/api/plugin-discovery-helpers.js +2 -2
  592. package/packages/agent/src/api/plugin-routes.d.ts +1 -1
  593. package/packages/agent/src/api/plugin-routes.d.ts.map +1 -1
  594. package/packages/agent/src/api/plugin-routes.js +11 -2
  595. package/packages/agent/src/api/registry-service.d.ts +1 -1
  596. package/packages/agent/src/api/registry-service.d.ts.map +1 -1
  597. package/packages/agent/src/api/relationships-routes.d.ts.map +1 -1
  598. package/packages/agent/src/api/relationships-routes.js +70 -3
  599. package/packages/agent/src/api/server-auth.d.ts +2 -9
  600. package/packages/agent/src/api/server-auth.d.ts.map +1 -1
  601. package/packages/agent/src/api/server-auth.js +1 -1
  602. package/packages/agent/src/api/server-helpers-auth.d.ts +39 -0
  603. package/packages/agent/src/api/server-helpers-auth.d.ts.map +1 -0
  604. package/packages/agent/src/api/server-helpers-auth.js +432 -0
  605. package/packages/agent/src/api/server-helpers-config.d.ts +37 -0
  606. package/packages/agent/src/api/server-helpers-config.d.ts.map +1 -0
  607. package/packages/agent/src/api/server-helpers-config.js +295 -0
  608. package/packages/agent/src/api/server-helpers-mcp.d.ts +12 -0
  609. package/packages/agent/src/api/server-helpers-mcp.d.ts.map +1 -0
  610. package/packages/agent/src/api/server-helpers-mcp.js +315 -0
  611. package/packages/agent/src/api/server-helpers-plugin.d.ts +13 -0
  612. package/packages/agent/src/api/server-helpers-plugin.d.ts.map +1 -0
  613. package/packages/agent/src/api/server-helpers-plugin.js +158 -0
  614. package/packages/agent/src/api/server-helpers-swarm.d.ts +57 -0
  615. package/packages/agent/src/api/server-helpers-swarm.d.ts.map +1 -0
  616. package/packages/agent/src/api/server-helpers-swarm.js +325 -0
  617. package/packages/agent/src/api/server-helpers-wallet.d.ts +18 -0
  618. package/packages/agent/src/api/server-helpers-wallet.d.ts.map +1 -0
  619. package/packages/agent/src/api/server-helpers-wallet.js +178 -0
  620. package/packages/agent/src/api/server-helpers.d.ts.map +1 -1
  621. package/packages/agent/src/api/server-helpers.js +1 -1
  622. package/packages/agent/src/api/server-types.d.ts +42 -3
  623. package/packages/agent/src/api/server-types.d.ts.map +1 -1
  624. package/packages/agent/src/api/server.d.ts +10 -56
  625. package/packages/agent/src/api/server.d.ts.map +1 -1
  626. package/packages/agent/src/api/server.js +298 -1436
  627. package/packages/agent/src/api/signal-routes.d.ts +1 -1
  628. package/packages/agent/src/api/signal-routes.d.ts.map +1 -1
  629. package/packages/agent/src/api/signal-routes.js +1 -2
  630. package/packages/agent/src/api/skill-discovery-helpers.js +2 -0
  631. package/packages/agent/src/api/skills-routes.d.ts.map +1 -1
  632. package/packages/agent/src/api/skills-routes.js +69 -0
  633. package/packages/agent/src/api/static-file-server.js +1 -1
  634. package/packages/agent/src/api/stream-routes.d.ts +0 -19
  635. package/packages/agent/src/api/stream-routes.d.ts.map +1 -1
  636. package/packages/agent/src/api/trade-safety.d.ts +0 -4
  637. package/packages/agent/src/api/trade-safety.d.ts.map +1 -1
  638. package/packages/agent/src/api/trade-safety.js +0 -4
  639. package/packages/agent/src/api/trigger-routes.d.ts +37 -47
  640. package/packages/agent/src/api/trigger-routes.d.ts.map +1 -1
  641. package/packages/agent/src/api/trigger-routes.js +89 -18
  642. package/packages/agent/src/api/tts-routes.d.ts.map +1 -1
  643. package/packages/agent/src/api/tts-routes.js +1 -1
  644. package/packages/agent/src/api/tx-service.d.ts +0 -4
  645. package/packages/agent/src/api/tx-service.d.ts.map +1 -1
  646. package/packages/agent/src/api/tx-service.js +0 -4
  647. package/packages/agent/src/api/wallet-bsc-routes.d.ts +0 -4
  648. package/packages/agent/src/api/wallet-bsc-routes.d.ts.map +1 -1
  649. package/packages/agent/src/api/wallet-bsc-routes.js +0 -4
  650. package/packages/agent/src/api/wallet-capability.d.ts +0 -5
  651. package/packages/agent/src/api/wallet-capability.d.ts.map +1 -1
  652. package/packages/agent/src/api/wallet-capability.js +0 -5
  653. package/packages/agent/src/api/wallet-dex-prices.d.ts.map +1 -1
  654. package/packages/agent/src/api/wallet-dex-prices.js +0 -4
  655. package/packages/agent/src/api/wallet-env-sync.d.ts.map +1 -1
  656. package/packages/agent/src/api/wallet-env-sync.js +5 -1
  657. package/packages/agent/src/api/wallet-evm-balance.d.ts.map +1 -1
  658. package/packages/agent/src/api/wallet-evm-balance.js +0 -4
  659. package/packages/agent/src/api/wallet-routes.d.ts +1 -14
  660. package/packages/agent/src/api/wallet-routes.d.ts.map +1 -1
  661. package/packages/agent/src/api/wallet-routes.js +9 -15
  662. package/packages/agent/src/api/wallet-rpc.d.ts +0 -5
  663. package/packages/agent/src/api/wallet-rpc.d.ts.map +1 -1
  664. package/packages/agent/src/api/wallet-rpc.js +0 -5
  665. package/packages/agent/src/api/wallet-trade-routes.d.ts +0 -5
  666. package/packages/agent/src/api/wallet-trade-routes.d.ts.map +1 -1
  667. package/packages/agent/src/api/wallet-trade-routes.js +0 -5
  668. package/packages/agent/src/api/wallet-trading-profile.d.ts +2 -27
  669. package/packages/agent/src/api/wallet-trading-profile.d.ts.map +1 -1
  670. package/packages/agent/src/api/wallet-trading-profile.js +0 -5
  671. package/packages/agent/src/api/wallet.d.ts.map +1 -1
  672. package/packages/agent/src/api/wallet.js +0 -4
  673. package/packages/agent/src/api/whatsapp-routes.d.ts +1 -1
  674. package/packages/agent/src/api/whatsapp-routes.d.ts.map +1 -1
  675. package/packages/agent/src/api/whatsapp-routes.js +1 -2
  676. package/packages/agent/src/api/workbench-helpers.d.ts.map +1 -1
  677. package/packages/agent/src/api/workbench-helpers.js +2 -1
  678. package/packages/agent/src/api/workbench-routes.d.ts.map +1 -1
  679. package/packages/agent/src/api/workbench-routes.js +1 -1
  680. package/packages/agent/src/auth/anthropic.d.ts +0 -5
  681. package/packages/agent/src/auth/anthropic.d.ts.map +1 -1
  682. package/packages/agent/src/auth/anthropic.js +0 -5
  683. package/packages/agent/src/auth/openai-codex.d.ts +0 -5
  684. package/packages/agent/src/auth/openai-codex.d.ts.map +1 -1
  685. package/packages/agent/src/auth/openai-codex.js +0 -5
  686. package/packages/agent/src/cloud/cloud-wallet.d.ts +0 -2
  687. package/packages/agent/src/cloud/cloud-wallet.d.ts.map +1 -1
  688. package/packages/agent/src/config/env-vars.d.ts.map +1 -1
  689. package/packages/agent/src/config/env-vars.js +2 -0
  690. package/packages/agent/src/config/includes.js +1 -1
  691. package/packages/agent/src/config/index.d.ts +1 -1
  692. package/packages/agent/src/config/index.d.ts.map +1 -1
  693. package/packages/agent/src/config/index.js +1 -1
  694. package/packages/agent/src/config/plugin-auto-enable.d.ts +8 -0
  695. package/packages/agent/src/config/plugin-auto-enable.d.ts.map +1 -1
  696. package/packages/agent/src/config/plugin-auto-enable.js +28 -0
  697. package/packages/agent/src/config/types.agent-defaults.d.ts +2 -1
  698. package/packages/agent/src/config/types.agent-defaults.d.ts.map +1 -1
  699. package/packages/agent/src/config/types.eliza.d.ts +34 -0
  700. package/packages/agent/src/config/types.eliza.d.ts.map +1 -1
  701. package/packages/agent/src/contracts/index.d.ts +8 -8
  702. package/packages/agent/src/contracts/index.d.ts.map +1 -1
  703. package/packages/agent/src/contracts/index.js +8 -8
  704. package/packages/agent/src/contracts/onboarding-provider-defaults.d.ts +165 -0
  705. package/packages/agent/src/contracts/onboarding-provider-defaults.d.ts.map +1 -0
  706. package/packages/agent/src/contracts/onboarding-provider-defaults.js +189 -0
  707. package/packages/agent/src/index.d.ts +8 -6
  708. package/packages/agent/src/index.d.ts.map +1 -1
  709. package/packages/agent/src/index.js +8 -6
  710. package/packages/agent/src/providers/conversation-utils.d.ts.map +1 -1
  711. package/packages/agent/src/providers/conversation-utils.js +2 -3
  712. package/packages/agent/src/providers/index.d.ts +0 -1
  713. package/packages/agent/src/providers/index.d.ts.map +1 -1
  714. package/packages/agent/src/providers/index.js +0 -1
  715. package/packages/agent/src/providers/user-name.d.ts.map +1 -1
  716. package/packages/agent/src/providers/user-name.js +1 -1
  717. package/packages/agent/src/providers/workspace-provider.d.ts +0 -8
  718. package/packages/agent/src/providers/workspace-provider.d.ts.map +1 -1
  719. package/packages/agent/src/runtime/custom-actions.js +1 -1
  720. package/packages/agent/src/runtime/eliza-plugin.d.ts.map +1 -1
  721. package/packages/agent/src/runtime/eliza-plugin.js +1 -47
  722. package/packages/agent/src/runtime/eliza.d.ts +1 -91
  723. package/packages/agent/src/runtime/eliza.d.ts.map +1 -1
  724. package/packages/agent/src/runtime/eliza.js +109 -12
  725. package/packages/agent/src/runtime/first-time-setup.d.ts +20 -0
  726. package/packages/agent/src/runtime/first-time-setup.d.ts.map +1 -1
  727. package/packages/agent/src/runtime/first-time-setup.js +20 -25
  728. package/packages/agent/src/runtime/index.d.ts +1 -1
  729. package/packages/agent/src/runtime/index.d.ts.map +1 -1
  730. package/packages/agent/src/runtime/index.js +1 -1
  731. package/packages/agent/src/runtime/plugin-collector.d.ts +0 -12
  732. package/packages/agent/src/runtime/plugin-collector.d.ts.map +1 -1
  733. package/packages/agent/src/runtime/plugin-lifecycle.d.ts.map +1 -1
  734. package/packages/agent/src/runtime/plugin-lifecycle.js +6 -2
  735. package/packages/agent/src/runtime/plugin-resolver.d.ts.map +1 -1
  736. package/packages/agent/src/runtime/plugin-resolver.js +6 -7
  737. package/packages/agent/src/runtime/plugin-types.d.ts +0 -6
  738. package/packages/agent/src/runtime/plugin-types.d.ts.map +1 -1
  739. package/packages/agent/src/runtime/roles/src/utils.d.ts +1 -1
  740. package/packages/agent/src/runtime/roles/src/utils.d.ts.map +1 -1
  741. package/packages/agent/src/runtime/roles/src/utils.js +1 -1
  742. package/packages/agent/src/runtime/subagent-output.d.ts +51 -0
  743. package/packages/agent/src/runtime/subagent-output.d.ts.map +1 -0
  744. package/packages/agent/src/runtime/subagent-output.js +173 -0
  745. package/packages/agent/src/runtime/task-heartbeat.d.ts +22 -0
  746. package/packages/agent/src/runtime/task-heartbeat.d.ts.map +1 -0
  747. package/packages/agent/src/runtime/task-heartbeat.js +84 -0
  748. package/packages/agent/src/runtime/trajectory-internals.d.ts +37 -30
  749. package/packages/agent/src/runtime/trajectory-internals.d.ts.map +1 -1
  750. package/packages/agent/src/runtime/trajectory-internals.js +73 -47
  751. package/packages/agent/src/runtime/trajectory-persistence.d.ts +1 -1
  752. package/packages/agent/src/runtime/trajectory-persistence.d.ts.map +1 -1
  753. package/packages/agent/src/runtime/trajectory-persistence.js +1 -1
  754. package/packages/agent/src/runtime/trajectory-storage.d.ts +27 -1
  755. package/packages/agent/src/runtime/trajectory-storage.d.ts.map +1 -1
  756. package/packages/agent/src/runtime/trajectory-storage.js +124 -1
  757. package/packages/agent/src/runtime/web-search-tools.d.ts.map +1 -1
  758. package/packages/agent/src/security/access.d.ts.map +1 -1
  759. package/packages/agent/src/security/access.js +6 -26
  760. package/packages/agent/src/security/audit-log.d.ts +0 -2
  761. package/packages/agent/src/security/audit-log.d.ts.map +1 -1
  762. package/packages/agent/src/security/index.d.ts +1 -0
  763. package/packages/agent/src/security/index.d.ts.map +1 -1
  764. package/packages/agent/src/security/index.js +1 -0
  765. package/packages/agent/src/services/app-manager.d.ts +53 -1
  766. package/packages/agent/src/services/app-manager.d.ts.map +1 -1
  767. package/packages/agent/src/services/app-manager.js +219 -15
  768. package/packages/agent/src/services/app-package-modules.d.ts +3 -12
  769. package/packages/agent/src/services/app-package-modules.d.ts.map +1 -1
  770. package/packages/agent/src/services/app-package-modules.js +78 -11
  771. package/packages/agent/src/services/browser-workspace-desktop.d.ts +22 -0
  772. package/packages/agent/src/services/browser-workspace-desktop.d.ts.map +1 -0
  773. package/packages/agent/src/services/browser-workspace-desktop.js +1379 -0
  774. package/packages/agent/src/services/browser-workspace-elements.d.ts +42 -0
  775. package/packages/agent/src/services/browser-workspace-elements.d.ts.map +1 -0
  776. package/packages/agent/src/services/browser-workspace-elements.js +508 -0
  777. package/packages/agent/src/services/browser-workspace-forms.d.ts +19 -0
  778. package/packages/agent/src/services/browser-workspace-forms.d.ts.map +1 -0
  779. package/packages/agent/src/services/browser-workspace-forms.js +244 -0
  780. package/packages/agent/src/services/browser-workspace-helpers.d.ts +20 -0
  781. package/packages/agent/src/services/browser-workspace-helpers.d.ts.map +1 -0
  782. package/packages/agent/src/services/browser-workspace-helpers.js +121 -0
  783. package/packages/agent/src/services/browser-workspace-jsdom.d.ts +16 -0
  784. package/packages/agent/src/services/browser-workspace-jsdom.d.ts.map +1 -0
  785. package/packages/agent/src/services/browser-workspace-jsdom.js +223 -0
  786. package/packages/agent/src/services/browser-workspace-network.d.ts +7 -0
  787. package/packages/agent/src/services/browser-workspace-network.d.ts.map +1 -0
  788. package/packages/agent/src/services/browser-workspace-network.js +137 -0
  789. package/packages/agent/src/services/browser-workspace-snapshots.d.ts +14 -0
  790. package/packages/agent/src/services/browser-workspace-snapshots.d.ts.map +1 -0
  791. package/packages/agent/src/services/browser-workspace-snapshots.js +144 -0
  792. package/packages/agent/src/services/browser-workspace-state.d.ts +22 -0
  793. package/packages/agent/src/services/browser-workspace-state.d.ts.map +1 -0
  794. package/packages/agent/src/services/browser-workspace-state.js +129 -0
  795. package/packages/agent/src/services/browser-workspace-types.d.ts +262 -0
  796. package/packages/agent/src/services/browser-workspace-types.d.ts.map +1 -0
  797. package/packages/agent/src/services/browser-workspace-types.js +1 -0
  798. package/packages/agent/src/services/browser-workspace-web.d.ts +8 -0
  799. package/packages/agent/src/services/browser-workspace-web.d.ts.map +1 -0
  800. package/packages/agent/src/services/browser-workspace-web.js +1141 -0
  801. package/packages/agent/src/services/browser-workspace.d.ts +22 -165
  802. package/packages/agent/src/services/browser-workspace.d.ts.map +1 -1
  803. package/packages/agent/src/services/browser-workspace.js +89 -4043
  804. package/packages/agent/src/services/built-in-app-routes/hyperscape.d.ts.map +1 -1
  805. package/packages/agent/src/services/built-in-app-routes/hyperscape.js +9 -6
  806. package/packages/agent/src/services/character-persistence.d.ts.map +1 -1
  807. package/packages/agent/src/services/character-persistence.js +1 -2
  808. package/packages/agent/src/services/client-chat-sender.d.ts.map +1 -1
  809. package/packages/agent/src/services/coding-task-executor.d.ts +2 -8
  810. package/packages/agent/src/services/coding-task-executor.d.ts.map +1 -1
  811. package/packages/agent/src/services/coding-task-executor.js +34 -66
  812. package/packages/agent/src/services/connector-setup-service.d.ts +4 -4
  813. package/packages/agent/src/services/connector-setup-service.d.ts.map +1 -1
  814. package/packages/agent/src/services/escalation.d.ts.map +1 -1
  815. package/packages/agent/src/services/escalation.js +1 -1
  816. package/packages/agent/src/services/plugin-manager-types.d.ts +1 -0
  817. package/packages/agent/src/services/plugin-manager-types.d.ts.map +1 -1
  818. package/packages/agent/src/services/privy-wallets.d.ts +0 -5
  819. package/packages/agent/src/services/privy-wallets.d.ts.map +1 -1
  820. package/packages/agent/src/services/privy-wallets.js +0 -5
  821. package/packages/agent/src/services/registry-client-app-meta.d.ts.map +1 -1
  822. package/packages/agent/src/services/registry-client-app-meta.js +1 -0
  823. package/packages/agent/src/services/registry-client-local.d.ts.map +1 -1
  824. package/packages/agent/src/services/registry-client-local.js +1 -0
  825. package/packages/agent/src/services/registry-client-network.d.ts.map +1 -1
  826. package/packages/agent/src/services/registry-client-network.js +1 -0
  827. package/packages/agent/src/services/registry-client-queries.d.ts +11 -0
  828. package/packages/agent/src/services/registry-client-queries.d.ts.map +1 -1
  829. package/packages/agent/src/services/registry-client-queries.js +23 -0
  830. package/packages/agent/src/services/registry-client-types.d.ts +8 -32
  831. package/packages/agent/src/services/registry-client-types.d.ts.map +1 -1
  832. package/packages/agent/src/services/relationships-graph.d.ts +62 -1
  833. package/packages/agent/src/services/relationships-graph.d.ts.map +1 -1
  834. package/packages/agent/src/services/relationships-graph.js +116 -6
  835. package/packages/agent/src/services/signal-pairing.d.ts.map +1 -1
  836. package/packages/agent/src/services/signal-pairing.js +15 -1
  837. package/packages/agent/src/services/steward-evm-account.d.ts +0 -4
  838. package/packages/agent/src/services/steward-evm-account.d.ts.map +1 -1
  839. package/packages/agent/src/services/steward-evm-account.js +0 -4
  840. package/packages/agent/src/services/steward-evm-bridge.d.ts +0 -4
  841. package/packages/agent/src/services/steward-evm-bridge.d.ts.map +1 -1
  842. package/packages/agent/src/services/steward-evm-bridge.js +0 -4
  843. package/packages/agent/src/services/steward-wallet.d.ts +1 -6
  844. package/packages/agent/src/services/steward-wallet.d.ts.map +1 -1
  845. package/packages/agent/src/services/steward-wallet.js +0 -5
  846. package/packages/agent/src/services/tts-stream-bridge.d.ts.map +1 -1
  847. package/packages/agent/src/services/tts-stream-bridge.js +1 -1
  848. package/packages/agent/src/test-support/route-test-helpers.d.ts +2 -2
  849. package/packages/agent/src/test-support/route-test-helpers.d.ts.map +1 -1
  850. package/packages/agent/src/test-support/test-helpers.d.ts +2 -2
  851. package/packages/agent/src/test-support/test-helpers.d.ts.map +1 -1
  852. package/packages/agent/src/triggers/runtime.d.ts +1 -0
  853. package/packages/agent/src/triggers/runtime.d.ts.map +1 -1
  854. package/packages/agent/src/triggers/runtime.js +67 -16
  855. package/packages/agent/src/triggers/scheduling.d.ts +6 -1
  856. package/packages/agent/src/triggers/scheduling.d.ts.map +1 -1
  857. package/packages/agent/src/triggers/scheduling.js +66 -20
  858. package/packages/agent/src/triggers/types.d.ts +14 -37
  859. package/packages/agent/src/triggers/types.d.ts.map +1 -1
  860. package/packages/agent/src/triggers/types.js +1 -1
  861. package/packages/agent/src/types/trajectory.d.ts +42 -1
  862. package/packages/agent/src/types/trajectory.d.ts.map +1 -1
  863. package/packages/agent/src/types/trajectory.js +2 -1
  864. package/packages/agent/src/utils/index.d.ts +1 -1
  865. package/packages/agent/src/utils/index.d.ts.map +1 -1
  866. package/packages/agent/src/utils/index.js +1 -1
  867. package/packages/app-core/src/api/client-types-cloud.d.ts +799 -0
  868. package/packages/app-core/src/api/client-types-cloud.d.ts.map +1 -0
  869. package/packages/app-core/src/api/client-types-cloud.js +57 -0
  870. package/packages/app-core/src/api/client-types-core.d.ts +334 -0
  871. package/packages/app-core/src/api/client-types-core.d.ts.map +1 -0
  872. package/packages/app-core/src/api/client-types-core.js +22 -0
  873. package/packages/app-core/src/api/compat-route-shared.d.ts +2 -2
  874. package/packages/app-core/src/api/compat-route-shared.d.ts.map +1 -1
  875. package/packages/app-core/src/api/server-cloud-tts.js +1 -1
  876. package/packages/app-core/src/bridge/native-plugins.d.ts +290 -0
  877. package/packages/app-core/src/bridge/native-plugins.d.ts.map +1 -0
  878. package/packages/app-core/src/bridge/native-plugins.js +55 -0
  879. package/packages/app-core/src/config/boot-config-store.d.ts +121 -2
  880. package/packages/app-core/src/config/boot-config-store.d.ts.map +1 -1
  881. package/packages/app-core/src/config/boot-config-store.js +16 -7
  882. package/packages/app-core/src/services/plugin-installer.d.ts +93 -0
  883. package/packages/app-core/src/services/plugin-installer.d.ts.map +1 -0
  884. package/packages/app-core/src/services/plugin-installer.js +611 -0
  885. package/packages/app-core/src/utils/env.d.ts.map +1 -1
  886. package/packages/app-core/src/utils/serialise.d.ts +12 -0
  887. package/packages/app-core/src/utils/serialise.d.ts.map +1 -0
  888. package/packages/app-core/src/utils/serialise.js +21 -0
  889. package/packages/native-plugins/activity-tracker/src/index.d.ts +35 -0
  890. package/packages/native-plugins/activity-tracker/src/index.d.ts.map +1 -0
  891. package/packages/native-plugins/activity-tracker/src/index.js +102 -0
  892. package/packages/shared/src/connectors.d.ts.map +1 -1
  893. package/packages/shared/src/connectors.js +8 -3
  894. package/packages/shared/src/contracts/apps.d.ts +53 -0
  895. package/packages/shared/src/contracts/apps.d.ts.map +1 -1
  896. package/packages/shared/src/contracts/cloud-topology.d.ts.map +1 -1
  897. package/packages/shared/src/contracts/cloud-topology.js +2 -4
  898. package/packages/shared/src/contracts/config.d.ts.map +1 -1
  899. package/packages/shared/src/contracts/index.d.ts +1 -1
  900. package/packages/shared/src/contracts/index.d.ts.map +1 -1
  901. package/packages/shared/src/contracts/index.js +1 -1
  902. package/packages/shared/src/contracts/lifeops-extensions.d.ts +181 -0
  903. package/packages/shared/src/contracts/lifeops-extensions.d.ts.map +1 -0
  904. package/packages/shared/src/contracts/lifeops-extensions.js +30 -0
  905. package/packages/shared/src/contracts/lifeops.d.ts +259 -0
  906. package/packages/shared/src/contracts/lifeops.d.ts.map +1 -1
  907. package/packages/shared/src/contracts/lifeops.js +62 -0
  908. package/packages/shared/src/contracts/onboarding.d.ts +5 -0
  909. package/packages/shared/src/contracts/onboarding.d.ts.map +1 -1
  910. package/packages/shared/src/contracts/onboarding.js +7 -6
  911. package/packages/shared/src/contracts/service-routing.d.ts.map +1 -1
  912. package/packages/shared/src/contracts/service-routing.js +1 -3
  913. package/packages/shared/src/contracts/wallet.d.ts +30 -103
  914. package/packages/shared/src/contracts/wallet.d.ts.map +1 -1
  915. package/packages/shared/src/env-utils.impl.d.ts.map +1 -1
  916. package/packages/shared/src/env-utils.impl.js +1 -8
  917. package/packages/shared/src/i18n/keyword-matching.d.ts.map +1 -1
  918. package/packages/shared/src/i18n/validation-keywords.d.ts +1 -1
  919. package/packages/shared/src/i18n/validation-keywords.d.ts.map +1 -1
  920. package/packages/shared/src/i18n/validation-keywords.js +1 -1
  921. package/packages/shared/src/index.d.ts +3 -3
  922. package/packages/shared/src/index.d.ts.map +1 -1
  923. package/packages/shared/src/index.js +3 -3
  924. package/packages/shared/src/onboarding-presets.characters.d.ts.map +1 -1
  925. package/packages/shared/src/onboarding-presets.characters.js +15 -5
  926. package/packages/shared/src/onboarding-presets.d.ts.map +1 -1
  927. package/packages/shared/src/onboarding-presets.js +5 -1
  928. package/packages/shared/src/runtime-env.d.ts.map +1 -1
  929. package/packages/shared/src/runtime-env.js +2 -7
  930. package/packages/shared/src/settings-debug.d.ts.map +1 -1
  931. package/packages/shared/src/settings-debug.js +1 -3
  932. package/packages/skills/src/formatter.d.ts +44 -0
  933. package/packages/skills/src/formatter.d.ts.map +1 -0
  934. package/packages/skills/src/formatter.js +181 -0
  935. package/packages/skills/src/frontmatter.d.ts +51 -0
  936. package/packages/skills/src/frontmatter.d.ts.map +1 -0
  937. package/packages/skills/src/frontmatter.js +155 -0
  938. package/packages/skills/src/index.d.ts +29 -0
  939. package/packages/skills/src/index.d.ts.map +1 -0
  940. package/packages/skills/src/index.js +31 -0
  941. package/packages/skills/src/loader.d.ts +33 -0
  942. package/packages/skills/src/loader.d.ts.map +1 -0
  943. package/packages/skills/src/loader.js +369 -0
  944. package/packages/skills/src/resolver.d.ts +35 -0
  945. package/packages/skills/src/resolver.d.ts.map +1 -0
  946. package/packages/skills/src/resolver.js +146 -0
  947. package/packages/skills/src/types.d.ts +238 -0
  948. package/packages/skills/src/types.d.ts.map +1 -0
  949. package/packages/skills/src/types.js +1 -0
  950. package/packages/typescript/src/action-docs.d.ts.map +1 -1
  951. package/packages/typescript/src/action-docs.js +2 -0
  952. package/packages/typescript/src/actions.d.ts.map +1 -1
  953. package/packages/typescript/src/actions.js +8 -3
  954. package/packages/typescript/src/database/inMemoryAdapter.js +1 -1
  955. package/packages/typescript/src/features/advanced-capabilities/evaluators/factRefinement.d.ts +20 -0
  956. package/packages/typescript/src/features/advanced-capabilities/evaluators/factRefinement.d.ts.map +1 -0
  957. package/packages/typescript/src/features/advanced-capabilities/evaluators/factRefinement.js +362 -0
  958. package/packages/typescript/src/features/advanced-capabilities/evaluators/index.d.ts +3 -0
  959. package/packages/typescript/src/features/advanced-capabilities/evaluators/index.d.ts.map +1 -1
  960. package/packages/typescript/src/features/advanced-capabilities/evaluators/index.js +3 -0
  961. package/packages/typescript/src/features/advanced-capabilities/evaluators/reflection.js +1 -1
  962. package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.d.ts.map +1 -1
  963. package/packages/typescript/src/features/advanced-capabilities/evaluators/relationshipExtraction.js +21 -0
  964. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillExtraction.d.ts +25 -0
  965. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillExtraction.d.ts.map +1 -0
  966. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillExtraction.js +367 -0
  967. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillRefinement.d.ts +21 -0
  968. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillRefinement.d.ts.map +1 -0
  969. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillRefinement.js +545 -0
  970. package/packages/typescript/src/features/advanced-capabilities/form/service.d.ts +1 -5
  971. package/packages/typescript/src/features/advanced-capabilities/form/service.d.ts.map +1 -1
  972. package/packages/typescript/src/features/advanced-capabilities/form/service.js +1 -13
  973. package/packages/typescript/src/features/advanced-capabilities/form/types.d.ts +3 -2
  974. package/packages/typescript/src/features/advanced-capabilities/form/types.d.ts.map +1 -1
  975. package/packages/typescript/src/features/advanced-capabilities/providers/facts.d.ts.map +1 -1
  976. package/packages/typescript/src/features/advanced-capabilities/providers/facts.js +68 -14
  977. package/packages/typescript/src/features/advanced-memory/services/memory-service.d.ts +1 -0
  978. package/packages/typescript/src/features/advanced-memory/services/memory-service.d.ts.map +1 -1
  979. package/packages/typescript/src/features/advanced-memory/services/memory-service.js +31 -11
  980. package/packages/typescript/src/features/autonomy/execution-facade.d.ts +1 -1
  981. package/packages/typescript/src/features/autonomy/execution-facade.d.ts.map +1 -1
  982. package/packages/typescript/src/features/autonomy/execution-facade.js +3 -3
  983. package/packages/typescript/src/features/basic-capabilities/actions/none.js +1 -1
  984. package/packages/typescript/src/features/basic-capabilities/index.d.ts.map +1 -1
  985. package/packages/typescript/src/features/basic-capabilities/index.js +9 -3
  986. package/packages/typescript/src/features/plugin-manager/coreExtensions.d.ts +4 -11
  987. package/packages/typescript/src/features/plugin-manager/coreExtensions.d.ts.map +1 -1
  988. package/packages/typescript/src/features/plugin-manager/coreExtensions.js +0 -23
  989. package/packages/typescript/src/features/plugin-manager/index.d.ts +1 -1
  990. package/packages/typescript/src/features/plugin-manager/index.d.ts.map +1 -1
  991. package/packages/typescript/src/features/plugin-manager/index.js +1 -1
  992. package/packages/typescript/src/features/plugin-manager/providers/relevance.d.ts.map +1 -1
  993. package/packages/typescript/src/features/plugin-manager/providers/relevance.js +1 -3
  994. package/packages/typescript/src/features/trajectories/TrajectoriesService.d.ts +13 -0
  995. package/packages/typescript/src/features/trajectories/TrajectoriesService.d.ts.map +1 -1
  996. package/packages/typescript/src/features/trajectories/TrajectoriesService.js +12 -9
  997. package/packages/typescript/src/features/trajectories/integration.d.ts +1 -1
  998. package/packages/typescript/src/features/trajectories/integration.d.ts.map +1 -1
  999. package/packages/typescript/src/features/trajectories/types.d.ts +19 -1
  1000. package/packages/typescript/src/features/trajectories/types.d.ts.map +1 -1
  1001. package/packages/typescript/src/features/trust/index.d.ts +3 -52
  1002. package/packages/typescript/src/features/trust/index.d.ts.map +1 -1
  1003. package/packages/typescript/src/features/trust/index.js +5 -122
  1004. package/packages/typescript/src/features/trust/services/wrappers.d.ts +56 -0
  1005. package/packages/typescript/src/features/trust/services/wrappers.d.ts.map +1 -0
  1006. package/packages/typescript/src/features/trust/services/wrappers.js +124 -0
  1007. package/packages/typescript/src/generated/action-docs.d.ts +207 -3
  1008. package/packages/typescript/src/generated/action-docs.d.ts.map +1 -1
  1009. package/packages/typescript/src/generated/action-docs.js +271 -2
  1010. package/packages/typescript/src/index.node.d.ts +3 -0
  1011. package/packages/typescript/src/index.node.d.ts.map +1 -1
  1012. package/packages/typescript/src/index.node.js +6 -0
  1013. package/packages/typescript/src/optimization/ab-analysis.d.ts +1 -1
  1014. package/packages/typescript/src/optimization/ab-analysis.d.ts.map +1 -1
  1015. package/packages/typescript/src/optimization/ab-analysis.js +1 -1
  1016. package/packages/typescript/src/optimization-root-dir.d.ts +6 -1
  1017. package/packages/typescript/src/optimization-root-dir.d.ts.map +1 -1
  1018. package/packages/typescript/src/optimization-root-dir.js +6 -1
  1019. package/packages/typescript/src/prompts.d.ts +2 -2
  1020. package/packages/typescript/src/prompts.d.ts.map +1 -1
  1021. package/packages/typescript/src/prompts.js +4 -1
  1022. package/packages/typescript/src/runtime.d.ts +3 -0
  1023. package/packages/typescript/src/runtime.d.ts.map +1 -1
  1024. package/packages/typescript/src/runtime.js +20 -5
  1025. package/packages/typescript/src/schemas/character.d.ts +1 -1
  1026. package/packages/typescript/src/schemas/character.d.ts.map +1 -1
  1027. package/packages/typescript/src/schemas/character.js +1 -1
  1028. package/packages/typescript/src/schemas/entity-identity.d.ts +29 -0
  1029. package/packages/typescript/src/schemas/entity-identity.d.ts.map +1 -0
  1030. package/packages/typescript/src/schemas/entity-identity.js +334 -0
  1031. package/packages/typescript/src/schemas/index.d.ts +3 -1
  1032. package/packages/typescript/src/schemas/index.d.ts.map +1 -1
  1033. package/packages/typescript/src/schemas/index.js +2 -1
  1034. package/packages/typescript/src/search.d.ts +0 -22
  1035. package/packages/typescript/src/search.d.ts.map +1 -1
  1036. package/packages/typescript/src/services/message.d.ts +11 -0
  1037. package/packages/typescript/src/services/message.d.ts.map +1 -1
  1038. package/packages/typescript/src/services/message.js +63 -36
  1039. package/packages/typescript/src/services/optimized-prompt-resolver.d.ts +23 -0
  1040. package/packages/typescript/src/services/optimized-prompt-resolver.d.ts.map +1 -0
  1041. package/packages/typescript/src/services/optimized-prompt-resolver.js +50 -0
  1042. package/packages/typescript/src/services/optimized-prompt.d.ts +117 -0
  1043. package/packages/typescript/src/services/optimized-prompt.d.ts.map +1 -0
  1044. package/packages/typescript/src/services/optimized-prompt.js +262 -0
  1045. package/packages/typescript/src/services/relationships.d.ts +225 -0
  1046. package/packages/typescript/src/services/relationships.d.ts.map +1 -1
  1047. package/packages/typescript/src/services/relationships.js +979 -3
  1048. package/packages/typescript/src/services/trajectories.d.ts +9 -0
  1049. package/packages/typescript/src/services/trajectories.d.ts.map +1 -1
  1050. package/packages/typescript/src/trajectory-context.d.ts +7 -0
  1051. package/packages/typescript/src/trajectory-context.d.ts.map +1 -1
  1052. package/packages/typescript/src/trajectory-utils.d.ts +24 -0
  1053. package/packages/typescript/src/trajectory-utils.d.ts.map +1 -1
  1054. package/packages/typescript/src/trajectory-utils.js +19 -0
  1055. package/packages/typescript/src/types/components.d.ts +6 -0
  1056. package/packages/typescript/src/types/components.d.ts.map +1 -1
  1057. package/packages/typescript/src/types/plugin.d.ts +11 -0
  1058. package/packages/typescript/src/types/plugin.d.ts.map +1 -1
  1059. package/packages/typescript/src/types/runtime.d.ts +12 -0
  1060. package/packages/typescript/src/types/runtime.d.ts.map +1 -1
  1061. package/packages/typescript/src/types/service.d.ts +2 -0
  1062. package/packages/typescript/src/types/service.d.ts.map +1 -1
  1063. package/packages/typescript/src/types/service.js +1 -0
  1064. package/packages/typescript/src/types/trigger.d.ts +4 -0
  1065. package/packages/typescript/src/types/trigger.d.ts.map +1 -1
  1066. package/packages/typescript/src/utils/batch-queue/batch-processor.d.ts +2 -3
  1067. package/packages/typescript/src/utils/batch-queue/batch-processor.d.ts.map +1 -1
  1068. package/packages/typescript/src/utils/batch-queue/batch-processor.js +0 -3
  1069. package/packages/typescript/src/utils/crypto-compat.js +1 -1
  1070. package/packages/typescript/src/utils/union-find.d.ts +30 -0
  1071. package/packages/typescript/src/utils/union-find.d.ts.map +1 -0
  1072. package/packages/typescript/src/utils/union-find.js +81 -0
  1073. package/packages/typescript/src/utils.d.ts +1 -0
  1074. package/packages/typescript/src/utils.d.ts.map +1 -1
  1075. package/packages/typescript/src/utils.js +5 -1
  1076. package/apps/app-lifeops/src/actions/inbox-digest.d.ts +0 -2
  1077. package/apps/app-lifeops/src/actions/inbox-digest.d.ts.map +0 -1
  1078. package/apps/app-lifeops/src/actions/inbox-digest.js +0 -1
  1079. package/apps/app-lifeops/src/actions/inbox-respond.d.ts +0 -2
  1080. package/apps/app-lifeops/src/actions/inbox-respond.d.ts.map +0 -1
  1081. package/apps/app-lifeops/src/actions/inbox-respond.js +0 -1
  1082. package/apps/app-lifeops/src/actions/inbox-triage.d.ts +0 -2
  1083. package/apps/app-lifeops/src/actions/inbox-triage.d.ts.map +0 -1
  1084. package/apps/app-lifeops/src/actions/inbox-triage.js +0 -1
  1085. package/apps/app-lifeops/src/lifeops/index.d.ts +0 -25
  1086. package/apps/app-lifeops/src/lifeops/index.d.ts.map +0 -1
  1087. package/apps/app-lifeops/src/lifeops/index.js +0 -24
  1088. package/apps/app-lifeops/src/selfcontrol/access.d.ts +0 -8
  1089. package/apps/app-lifeops/src/selfcontrol/access.d.ts.map +0 -1
  1090. package/apps/app-lifeops/src/selfcontrol/access.js +0 -16
  1091. package/apps/app-lifeops/src/selfcontrol/action.d.ts +0 -10
  1092. package/apps/app-lifeops/src/selfcontrol/action.d.ts.map +0 -1
  1093. package/apps/app-lifeops/src/selfcontrol/action.js +0 -506
  1094. package/apps/app-lifeops/src/selfcontrol/index.d.ts +0 -13
  1095. package/apps/app-lifeops/src/selfcontrol/index.d.ts.map +0 -1
  1096. package/apps/app-lifeops/src/selfcontrol/index.js +0 -10
  1097. package/apps/app-lifeops/src/selfcontrol/permissions.d.ts.map +0 -1
  1098. package/apps/app-lifeops/src/selfcontrol/provider.d.ts +0 -4
  1099. package/apps/app-lifeops/src/selfcontrol/provider.d.ts.map +0 -1
  1100. package/apps/app-lifeops/src/selfcontrol/provider.js +0 -116
  1101. package/apps/app-lifeops/src/selfcontrol/roles.d.ts +0 -19
  1102. package/apps/app-lifeops/src/selfcontrol/roles.d.ts.map +0 -1
  1103. package/apps/app-lifeops/src/selfcontrol/roles.js +0 -41
  1104. package/apps/app-lifeops/src/selfcontrol/selfcontrol.d.ts +0 -97
  1105. package/apps/app-lifeops/src/selfcontrol/selfcontrol.d.ts.map +0 -1
  1106. package/apps/app-lifeops/src/selfcontrol/selfcontrol.js +0 -949
  1107. package/apps/app-lifeops/src/selfcontrol/service.d.ts +0 -21
  1108. package/apps/app-lifeops/src/selfcontrol/service.d.ts.map +0 -1
  1109. package/apps/app-lifeops/src/selfcontrol/service.js +0 -268
  1110. package/packages/agent/src/actions/calendar.d.ts +0 -2
  1111. package/packages/agent/src/actions/calendar.d.ts.map +0 -1
  1112. package/packages/agent/src/actions/calendar.js +0 -1
  1113. package/packages/agent/src/actions/check-balance.d.ts +0 -17
  1114. package/packages/agent/src/actions/check-balance.d.ts.map +0 -1
  1115. package/packages/agent/src/actions/check-balance.js +0 -167
  1116. package/packages/agent/src/actions/execute-trade.d.ts +0 -17
  1117. package/packages/agent/src/actions/execute-trade.d.ts.map +0 -1
  1118. package/packages/agent/src/actions/execute-trade.js +0 -299
  1119. package/packages/agent/src/actions/gmail.d.ts +0 -2
  1120. package/packages/agent/src/actions/gmail.d.ts.map +0 -1
  1121. package/packages/agent/src/actions/gmail.js +0 -1
  1122. package/packages/agent/src/actions/inbox-digest.d.ts +0 -2
  1123. package/packages/agent/src/actions/inbox-digest.d.ts.map +0 -1
  1124. package/packages/agent/src/actions/inbox-digest.js +0 -1
  1125. package/packages/agent/src/actions/inbox-respond.d.ts +0 -2
  1126. package/packages/agent/src/actions/inbox-respond.d.ts.map +0 -1
  1127. package/packages/agent/src/actions/inbox-respond.js +0 -1
  1128. package/packages/agent/src/actions/inbox-triage.d.ts +0 -2
  1129. package/packages/agent/src/actions/inbox-triage.d.ts.map +0 -1
  1130. package/packages/agent/src/actions/inbox-triage.js +0 -1
  1131. package/packages/agent/src/actions/inbox.d.ts +0 -2
  1132. package/packages/agent/src/actions/inbox.d.ts.map +0 -1
  1133. package/packages/agent/src/actions/inbox.js +0 -1
  1134. package/packages/agent/src/actions/life-goal-extractor.d.ts +0 -2
  1135. package/packages/agent/src/actions/life-goal-extractor.d.ts.map +0 -1
  1136. package/packages/agent/src/actions/life-goal-extractor.js +0 -1
  1137. package/packages/agent/src/actions/life-param-extractor.d.ts +0 -2
  1138. package/packages/agent/src/actions/life-param-extractor.d.ts.map +0 -1
  1139. package/packages/agent/src/actions/life-param-extractor.js +0 -1
  1140. package/packages/agent/src/actions/life-recent-context.d.ts +0 -2
  1141. package/packages/agent/src/actions/life-recent-context.d.ts.map +0 -1
  1142. package/packages/agent/src/actions/life-recent-context.js +0 -1
  1143. package/packages/agent/src/actions/life-update-extractor.d.ts +0 -2
  1144. package/packages/agent/src/actions/life-update-extractor.d.ts.map +0 -1
  1145. package/packages/agent/src/actions/life-update-extractor.js +0 -1
  1146. package/packages/agent/src/actions/life.d.ts +0 -2
  1147. package/packages/agent/src/actions/life.d.ts.map +0 -1
  1148. package/packages/agent/src/actions/life.extractor.d.ts +0 -2
  1149. package/packages/agent/src/actions/life.extractor.d.ts.map +0 -1
  1150. package/packages/agent/src/actions/life.extractor.js +0 -1
  1151. package/packages/agent/src/actions/life.js +0 -1
  1152. package/packages/agent/src/actions/lifeops-extraction-config.d.ts +0 -2
  1153. package/packages/agent/src/actions/lifeops-extraction-config.d.ts.map +0 -1
  1154. package/packages/agent/src/actions/lifeops-extraction-config.js +0 -1
  1155. package/packages/agent/src/actions/lifeops-google-helpers.d.ts +0 -2
  1156. package/packages/agent/src/actions/lifeops-google-helpers.d.ts.map +0 -1
  1157. package/packages/agent/src/actions/lifeops-google-helpers.js +0 -1
  1158. package/packages/agent/src/actions/timezone-normalization.d.ts +0 -2
  1159. package/packages/agent/src/actions/timezone-normalization.d.ts.map +0 -1
  1160. package/packages/agent/src/actions/timezone-normalization.js +0 -1
  1161. package/packages/agent/src/actions/transfer-token.d.ts +0 -17
  1162. package/packages/agent/src/actions/transfer-token.d.ts.map +0 -1
  1163. package/packages/agent/src/actions/transfer-token.js +0 -470
  1164. package/packages/agent/src/actions/update-owner-profile.d.ts +0 -2
  1165. package/packages/agent/src/actions/update-owner-profile.d.ts.map +0 -1
  1166. package/packages/agent/src/actions/update-owner-profile.js +0 -1
  1167. package/packages/agent/src/actions/wallet-action-shared.d.ts +0 -15
  1168. package/packages/agent/src/actions/wallet-action-shared.d.ts.map +0 -1
  1169. package/packages/agent/src/actions/wallet-action-shared.js +0 -24
  1170. package/packages/agent/src/activity-profile/analyzer.d.ts.map +0 -1
  1171. package/packages/agent/src/activity-profile/analyzer.js +0 -531
  1172. package/packages/agent/src/activity-profile/proactive-planner.d.ts.map +0 -1
  1173. package/packages/agent/src/activity-profile/proactive-planner.js +0 -455
  1174. package/packages/agent/src/activity-profile/proactive-worker.d.ts.map +0 -1
  1175. package/packages/agent/src/activity-profile/proactive-worker.js +0 -523
  1176. package/packages/agent/src/activity-profile/profile-metadata.d.ts.map +0 -1
  1177. package/packages/agent/src/activity-profile/service.d.ts +0 -11
  1178. package/packages/agent/src/activity-profile/service.d.ts.map +0 -1
  1179. package/packages/agent/src/activity-profile/service.js +0 -226
  1180. package/packages/agent/src/activity-profile/types.d.ts.map +0 -1
  1181. package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts +0 -2
  1182. package/packages/agent/src/api/coding-agents-auth-sanitize.d.ts.map +0 -1
  1183. package/packages/agent/src/api/coding-agents-auth-sanitize.js +0 -1
  1184. package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts +0 -2
  1185. package/packages/agent/src/api/coding-agents-preflight-normalize.d.ts.map +0 -1
  1186. package/packages/agent/src/api/coding-agents-preflight-normalize.js +0 -1
  1187. package/packages/agent/src/api/coordinator-types.d.ts +0 -2
  1188. package/packages/agent/src/api/coordinator-types.d.ts.map +0 -1
  1189. package/packages/agent/src/api/coordinator-types.js +0 -1
  1190. package/packages/agent/src/api/coordinator-wiring.d.ts +0 -2
  1191. package/packages/agent/src/api/coordinator-wiring.d.ts.map +0 -1
  1192. package/packages/agent/src/api/coordinator-wiring.js +0 -1
  1193. package/packages/agent/src/api/drop-routes.d.ts +0 -22
  1194. package/packages/agent/src/api/drop-routes.d.ts.map +0 -1
  1195. package/packages/agent/src/api/drop-service.d.ts +0 -26
  1196. package/packages/agent/src/api/drop-service.d.ts.map +0 -1
  1197. package/packages/agent/src/api/lifeops-routes.d.ts +0 -2
  1198. package/packages/agent/src/api/lifeops-routes.d.ts.map +0 -1
  1199. package/packages/agent/src/api/lifeops-routes.js +0 -1
  1200. package/packages/agent/src/api/merkle-tree.d.ts.map +0 -1
  1201. package/packages/agent/src/api/nft-verify.d.ts +0 -16
  1202. package/packages/agent/src/api/nft-verify.d.ts.map +0 -1
  1203. package/packages/agent/src/api/nft-verify.js +0 -81
  1204. package/packages/agent/src/api/og-tracker.d.ts.map +0 -1
  1205. package/packages/agent/src/api/og-tracker.js +0 -60
  1206. package/packages/agent/src/api/task-agent-message-routing.d.ts +0 -2
  1207. package/packages/agent/src/api/task-agent-message-routing.d.ts.map +0 -1
  1208. package/packages/agent/src/api/task-agent-message-routing.js +0 -1
  1209. package/packages/agent/src/api/twitter-verify.d.ts +0 -25
  1210. package/packages/agent/src/api/twitter-verify.d.ts.map +0 -1
  1211. package/packages/agent/src/api/twitter-verify.js +0 -168
  1212. package/packages/agent/src/api/website-blocker-routes.d.ts +0 -2
  1213. package/packages/agent/src/api/website-blocker-routes.d.ts.map +0 -1
  1214. package/packages/agent/src/api/website-blocker-routes.js +0 -1
  1215. package/packages/agent/src/config/runtime-env.d.ts +0 -2
  1216. package/packages/agent/src/config/runtime-env.d.ts.map +0 -1
  1217. package/packages/agent/src/config/runtime-env.js +0 -1
  1218. package/packages/agent/src/evals/coordinator-eval-client.d.ts +0 -2
  1219. package/packages/agent/src/evals/coordinator-eval-client.d.ts.map +0 -1
  1220. package/packages/agent/src/evals/coordinator-eval-client.js +0 -1
  1221. package/packages/agent/src/evals/coordinator-live-runner.d.ts +0 -2
  1222. package/packages/agent/src/evals/coordinator-live-runner.d.ts.map +0 -1
  1223. package/packages/agent/src/evals/coordinator-live-runner.js +0 -1
  1224. package/packages/agent/src/evals/coordinator-preflight.d.ts +0 -2
  1225. package/packages/agent/src/evals/coordinator-preflight.d.ts.map +0 -1
  1226. package/packages/agent/src/evals/coordinator-preflight.js +0 -1
  1227. package/packages/agent/src/evals/coordinator-scenarios.d.ts +0 -2
  1228. package/packages/agent/src/evals/coordinator-scenarios.d.ts.map +0 -1
  1229. package/packages/agent/src/evals/coordinator-scenarios.js +0 -1
  1230. package/packages/agent/src/lifeops/app-state.d.ts +0 -2
  1231. package/packages/agent/src/lifeops/app-state.d.ts.map +0 -1
  1232. package/packages/agent/src/lifeops/app-state.js +0 -1
  1233. package/packages/agent/src/lifeops/apple-reminders.d.ts +0 -2
  1234. package/packages/agent/src/lifeops/apple-reminders.d.ts.map +0 -1
  1235. package/packages/agent/src/lifeops/apple-reminders.js +0 -1
  1236. package/packages/agent/src/lifeops/defaults.d.ts +0 -2
  1237. package/packages/agent/src/lifeops/defaults.d.ts.map +0 -1
  1238. package/packages/agent/src/lifeops/defaults.js +0 -1
  1239. package/packages/agent/src/lifeops/engine.d.ts +0 -2
  1240. package/packages/agent/src/lifeops/engine.d.ts.map +0 -1
  1241. package/packages/agent/src/lifeops/engine.js +0 -1
  1242. package/packages/agent/src/lifeops/goal-grounding.d.ts +0 -2
  1243. package/packages/agent/src/lifeops/goal-grounding.d.ts.map +0 -1
  1244. package/packages/agent/src/lifeops/goal-grounding.js +0 -1
  1245. package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts +0 -2
  1246. package/packages/agent/src/lifeops/goal-semantic-evaluator.d.ts.map +0 -1
  1247. package/packages/agent/src/lifeops/goal-semantic-evaluator.js +0 -1
  1248. package/packages/agent/src/lifeops/google-api-error.d.ts +0 -2
  1249. package/packages/agent/src/lifeops/google-api-error.d.ts.map +0 -1
  1250. package/packages/agent/src/lifeops/google-api-error.js +0 -1
  1251. package/packages/agent/src/lifeops/google-calendar.d.ts +0 -2
  1252. package/packages/agent/src/lifeops/google-calendar.d.ts.map +0 -1
  1253. package/packages/agent/src/lifeops/google-calendar.js +0 -1
  1254. package/packages/agent/src/lifeops/google-connector-gateway.d.ts +0 -2
  1255. package/packages/agent/src/lifeops/google-connector-gateway.d.ts.map +0 -1
  1256. package/packages/agent/src/lifeops/google-connector-gateway.js +0 -1
  1257. package/packages/agent/src/lifeops/google-fetch.d.ts +0 -2
  1258. package/packages/agent/src/lifeops/google-fetch.d.ts.map +0 -1
  1259. package/packages/agent/src/lifeops/google-fetch.js +0 -1
  1260. package/packages/agent/src/lifeops/google-gmail.d.ts +0 -2
  1261. package/packages/agent/src/lifeops/google-gmail.d.ts.map +0 -1
  1262. package/packages/agent/src/lifeops/google-gmail.js +0 -1
  1263. package/packages/agent/src/lifeops/google-managed-client.d.ts +0 -2
  1264. package/packages/agent/src/lifeops/google-managed-client.d.ts.map +0 -1
  1265. package/packages/agent/src/lifeops/google-managed-client.js +0 -1
  1266. package/packages/agent/src/lifeops/google-oauth.d.ts +0 -2
  1267. package/packages/agent/src/lifeops/google-oauth.d.ts.map +0 -1
  1268. package/packages/agent/src/lifeops/google-oauth.js +0 -1
  1269. package/packages/agent/src/lifeops/google-scopes.d.ts +0 -2
  1270. package/packages/agent/src/lifeops/google-scopes.d.ts.map +0 -1
  1271. package/packages/agent/src/lifeops/google-scopes.js +0 -1
  1272. package/packages/agent/src/lifeops/index.d.ts +0 -2
  1273. package/packages/agent/src/lifeops/index.d.ts.map +0 -1
  1274. package/packages/agent/src/lifeops/index.js +0 -1
  1275. package/packages/agent/src/lifeops/owner-profile.d.ts +0 -2
  1276. package/packages/agent/src/lifeops/owner-profile.d.ts.map +0 -1
  1277. package/packages/agent/src/lifeops/owner-profile.js +0 -1
  1278. package/packages/agent/src/lifeops/repository.d.ts +0 -2
  1279. package/packages/agent/src/lifeops/repository.d.ts.map +0 -1
  1280. package/packages/agent/src/lifeops/repository.js +0 -1
  1281. package/packages/agent/src/lifeops/runtime.d.ts +0 -2
  1282. package/packages/agent/src/lifeops/runtime.d.ts.map +0 -1
  1283. package/packages/agent/src/lifeops/runtime.js +0 -1
  1284. package/packages/agent/src/lifeops/screen-context.d.ts +0 -2
  1285. package/packages/agent/src/lifeops/screen-context.d.ts.map +0 -1
  1286. package/packages/agent/src/lifeops/screen-context.js +0 -1
  1287. package/packages/agent/src/lifeops/seed-routines.d.ts +0 -2
  1288. package/packages/agent/src/lifeops/seed-routines.d.ts.map +0 -1
  1289. package/packages/agent/src/lifeops/seed-routines.js +0 -1
  1290. package/packages/agent/src/lifeops/service.d.ts +0 -2
  1291. package/packages/agent/src/lifeops/service.d.ts.map +0 -1
  1292. package/packages/agent/src/lifeops/service.js +0 -1
  1293. package/packages/agent/src/lifeops/sql.d.ts +0 -2
  1294. package/packages/agent/src/lifeops/sql.d.ts.map +0 -1
  1295. package/packages/agent/src/lifeops/sql.js +0 -1
  1296. package/packages/agent/src/lifeops/time.d.ts +0 -2
  1297. package/packages/agent/src/lifeops/time.d.ts.map +0 -1
  1298. package/packages/agent/src/lifeops/time.js +0 -1
  1299. package/packages/agent/src/lifeops/twilio.d.ts +0 -2
  1300. package/packages/agent/src/lifeops/twilio.d.ts.map +0 -1
  1301. package/packages/agent/src/lifeops/twilio.js +0 -1
  1302. package/packages/agent/src/lifeops/x-poster.d.ts +0 -2
  1303. package/packages/agent/src/lifeops/x-poster.d.ts.map +0 -1
  1304. package/packages/agent/src/lifeops/x-poster.js +0 -1
  1305. package/packages/agent/src/providers/activity-profile.d.ts.map +0 -1
  1306. package/packages/agent/src/providers/activity-profile.js +0 -140
  1307. package/packages/agent/src/providers/inbox-triage.d.ts +0 -2
  1308. package/packages/agent/src/providers/inbox-triage.d.ts.map +0 -1
  1309. package/packages/agent/src/providers/inbox-triage.js +0 -1
  1310. package/packages/agent/src/providers/lifeops.d.ts +0 -2
  1311. package/packages/agent/src/providers/lifeops.d.ts.map +0 -1
  1312. package/packages/agent/src/providers/lifeops.js +0 -1
  1313. package/packages/agent/src/utils/spoken-text.d.ts +0 -2
  1314. package/packages/agent/src/utils/spoken-text.d.ts.map +0 -1
  1315. package/packages/agent/src/utils/spoken-text.js +0 -1
  1316. package/packages/app-core/src/config/config.d.ts +0 -12
  1317. package/packages/app-core/src/config/config.d.ts.map +0 -1
  1318. package/packages/app-core/src/config/config.js +0 -23
  1319. package/packages/app-core/src/types/index.d.ts +0 -649
  1320. package/packages/app-core/src/types/index.d.ts.map +0 -1
  1321. package/packages/app-core/src/types/lifeops-ui.d.ts +0 -10
  1322. package/packages/app-core/src/types/lifeops-ui.d.ts.map +0 -1
  1323. package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.d.ts +0 -4
  1324. package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.d.ts.map +0 -1
  1325. package/packages/typescript/src/advanced-capabilities/clipboard/actions/append.js +0 -150
  1326. package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.d.ts +0 -4
  1327. package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.d.ts.map +0 -1
  1328. package/packages/typescript/src/advanced-capabilities/clipboard/actions/delete.js +0 -136
  1329. package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.d.ts +0 -4
  1330. package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.d.ts.map +0 -1
  1331. package/packages/typescript/src/advanced-capabilities/clipboard/actions/list.js +0 -84
  1332. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.d.ts +0 -4
  1333. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.d.ts.map +0 -1
  1334. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-attachment.js +0 -107
  1335. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.d.ts +0 -16
  1336. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.d.ts.map +0 -1
  1337. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read-file.js +0 -187
  1338. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.d.ts +0 -4
  1339. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.d.ts.map +0 -1
  1340. package/packages/typescript/src/advanced-capabilities/clipboard/actions/read.js +0 -138
  1341. package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts +0 -4
  1342. package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.d.ts.map +0 -1
  1343. package/packages/typescript/src/advanced-capabilities/clipboard/actions/remove-from-clipboard.js +0 -96
  1344. package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.d.ts +0 -4
  1345. package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.d.ts.map +0 -1
  1346. package/packages/typescript/src/advanced-capabilities/clipboard/actions/search.js +0 -139
  1347. package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.d.ts +0 -4
  1348. package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.d.ts.map +0 -1
  1349. package/packages/typescript/src/advanced-capabilities/clipboard/actions/write.js +0 -138
  1350. package/packages/typescript/src/advanced-capabilities/clipboard/index.d.ts +0 -39
  1351. package/packages/typescript/src/advanced-capabilities/clipboard/index.d.ts.map +0 -1
  1352. package/packages/typescript/src/advanced-capabilities/clipboard/index.js +0 -78
  1353. package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.d.ts +0 -4
  1354. package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.d.ts.map +0 -1
  1355. package/packages/typescript/src/advanced-capabilities/clipboard/providers/clipboard.js +0 -62
  1356. package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.d.ts +0 -16
  1357. package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.d.ts.map +0 -1
  1358. package/packages/typescript/src/advanced-capabilities/clipboard/services/attachmentContext.js +0 -162
  1359. package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.d.ts +0 -65
  1360. package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.d.ts.map +0 -1
  1361. package/packages/typescript/src/advanced-capabilities/clipboard/services/clipboardService.js +0 -352
  1362. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts +0 -24
  1363. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.d.ts.map +0 -1
  1364. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardPersistence.js +0 -63
  1365. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.d.ts +0 -29
  1366. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.d.ts.map +0 -1
  1367. package/packages/typescript/src/advanced-capabilities/clipboard/services/taskClipboardService.js +0 -195
  1368. package/packages/typescript/src/advanced-capabilities/clipboard/specs.d.ts +0 -15
  1369. package/packages/typescript/src/advanced-capabilities/clipboard/specs.d.ts.map +0 -1
  1370. package/packages/typescript/src/advanced-capabilities/clipboard/specs.js +0 -164
  1371. package/packages/typescript/src/advanced-capabilities/clipboard/types.d.ts +0 -92
  1372. package/packages/typescript/src/advanced-capabilities/clipboard/types.d.ts.map +0 -1
  1373. package/packages/typescript/src/advanced-capabilities/clipboard/types.js +0 -4
  1374. package/packages/typescript/src/index.d.ts +0 -12
  1375. package/packages/typescript/src/index.d.ts.map +0 -1
  1376. package/packages/typescript/src/index.js +0 -13
  1377. /package/{packages/agent/src/api → apps/app-elizamaker/src}/drop-routes.js +0 -0
  1378. /package/{packages/agent/src/api → apps/app-elizamaker/src}/drop-service.js +0 -0
  1379. /package/{packages/agent/src/api → apps/app-elizamaker/src}/merkle-tree.d.ts +0 -0
  1380. /package/{packages/agent/src/api → apps/app-elizamaker/src}/merkle-tree.js +0 -0
  1381. /package/{packages/agent/src/api → apps/app-elizamaker/src}/og-tracker.d.ts +0 -0
  1382. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/analyzer.d.ts +0 -0
  1383. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/proactive-planner.d.ts +0 -0
  1384. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/proactive-worker.d.ts +0 -0
  1385. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/profile-metadata.d.ts +0 -0
  1386. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/profile-metadata.js +0 -0
  1387. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/types.d.ts +0 -0
  1388. /package/{packages/agent → apps/app-lifeops}/src/activity-profile/types.js +0 -0
  1389. /package/{packages/agent → apps/app-lifeops}/src/providers/activity-profile.d.ts +0 -0
  1390. /package/apps/app-lifeops/src/{selfcontrol/permissions.js → types/app-blocker-settings-card.js} +0 -0
  1391. /package/{packages/app-core → apps/app-lifeops}/src/types/index.js +0 -0
  1392. /package/{packages/app-core/src/types/lifeops-ui.js → apps/app-lifeops/src/types/website-blocker-settings-card.js} +0 -0
  1393. /package/apps/app-lifeops/src/{selfcontrol → website-blocker}/permissions.d.ts +0 -0
@@ -14,16 +14,25 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
14
14
  return path;
15
15
  };
16
16
  import crypto from "node:crypto";
17
- import { lookup as dnsLookup } from "node:dns/promises";
18
17
  import fs from "node:fs";
19
18
  import http from "node:http";
20
19
  import { createRequire } from "node:module";
20
+ function tokenMatches(expected, provided) {
21
+ const expectedBuf = Buffer.from(expected);
22
+ const providedBuf = Buffer.from(provided);
23
+ return (expectedBuf.length === providedBuf.length &&
24
+ crypto.timingSafeEqual(expectedBuf, providedBuf));
25
+ }
21
26
  const MAX_BODY_BYTES = 1024 * 1024; // 1 MB
22
- import net from "node:net";
23
27
  import os from "node:os";
24
28
  import path from "node:path";
29
+ // Discord local routes extracted to @elizaos/plugin-discord (setup-routes.ts)
30
+ import { DropService, handleDropRoutes } from "@elizaos/app-elizamaker";
25
31
  import { handleKnowledgeRoutes } from "@elizaos/app-knowledge/routes";
32
+ import { handleWebsiteBlockerRoutes } from "@elizaos/app-lifeops/routes/website-blocker-routes";
33
+ import { TxService } from "@elizaos/app-steward/api/tx-service";
26
34
  import { wireCoordinatorBridgesWhenReady } from "@elizaos/app-task-coordinator/api/coordinator-wiring";
35
+ import { routeTaskAgentTextToConnector } from "@elizaos/app-task-coordinator/api/task-agent-message-routing";
27
36
  // Phase 2 extraction: LifeOps routes → app-lifeops/src/routes/plugin.ts (lifeopsPlugin)
28
37
  // import { handleWalletTradeExecuteRoute } from "./wallet-trade-routes.js";
29
38
  // import {
@@ -35,20 +44,19 @@ import { wireCoordinatorBridgesWhenReady } from "@elizaos/app-task-coordinator/a
35
44
  import { handleTrainingRoutes } from "@elizaos/app-training/routes/training";
36
45
  import { handleTrajectoryRoute } from "@elizaos/app-training/routes/trajectory";
37
46
  import { ChannelType, createMessageMemory, logger, stringToUuid, } from "@elizaos/core";
47
+ import { resolveApiBindHost, resolveServerOnlyPort, } from "@elizaos/shared/runtime-env";
38
48
  import { WebSocketServer } from "ws";
39
49
  import { getGlobalAwarenessRegistry } from "../awareness/registry.js";
40
50
  import { CharacterSchema } from "../config/character-schema.js";
41
51
  import { loadElizaConfig, saveElizaConfig, } from "../config/config.js";
42
52
  import { resolveModelsCacheDir, resolveStateDir } from "../config/paths.js";
43
53
  import { isStreamingDestinationConfigured } from "../config/plugin-auto-enable.js";
44
- import { isNullOriginAllowed, resolveAllowedHosts, resolveAllowedOrigins, resolveApiBindHost, resolveApiSecurityConfig, resolveApiToken, resolveServerOnlyPort, setApiToken, stripOptionalHostPort, } from "../config/runtime-env.js";
45
- import { ONBOARDING_CLOUD_PROVIDER_OPTIONS, ONBOARDING_PROVIDER_CATALOG, } from "../contracts/onboarding.js";
46
54
  import { createIntegrationTelemetrySpan } from "../diagnostics/integration-observability.js";
47
55
  import { resolveDefaultAgentWorkspaceDir } from "../providers/workspace.js";
48
56
  import { getAgentEventService, } from "../runtime/agent-event-service.js";
49
57
  import { classifyRegistryPluginRelease } from "../runtime/release-plugin-policy.js";
50
58
  import { AUDIT_EVENT_TYPES, AUDIT_SEVERITIES, getAuditFeedSize, queryAuditFeed, subscribeAuditFeed, } from "../security/audit-log.js";
51
- import { isBlockedPrivateOrLinkLocalIp, isLoopbackHost, normalizeHostLike, } from "../security/network-policy.js";
59
+ import { isLoopbackHost, } from "../security/network-policy.js";
52
60
  import { AgentExportError, estimateExportSize, exportAgent, importAgent, } from "../services/agent-export.js";
53
61
  import { AppManager } from "../services/app-manager.js";
54
62
  import { registerClientChatSendHandler } from "../services/client-chat-sender.js";
@@ -58,6 +66,7 @@ import { ensurePrivyWalletsForCustomUser, isPrivyWalletProvisioningEnabled, } fr
58
66
  // signal-pairing: SignalPairingSession, sanitizeAccountId, signalLogout extracted to @elizaos/plugin-signal
59
67
  import { signalAuthExists } from "../services/signal-pairing.js";
60
68
  import { streamManager } from "../services/stream-manager.js";
69
+ import { clearTelegramAccountAuthState, clearTelegramAccountSession, TelegramAccountAuthSession, telegramAccountAuthStateExists, telegramAccountSessionExists, } from "../services/telegram-account-auth.js";
61
70
  // Telegram account auth: moved to @elizaos/plugin-telegram (account-setup-routes + account-auth-service).
62
71
  // WhatsApp pairing: route handlers moved to @elizaos/plugin-whatsapp.
63
72
  import { executeTriggerTask, getTriggerHealthSnapshot, getTriggerLimit, listTriggerTasks, readTriggerConfig, readTriggerRuns, TRIGGER_TASK_NAME, TRIGGER_TASK_TAGS, taskToTriggerSummary, triggersFeatureEnabled, } from "../triggers/runtime.js";
@@ -89,18 +98,16 @@ import { handleConfigRoutes } from "./config-routes.js";
89
98
  import { ConnectorHealthMonitor } from "./connector-health.js";
90
99
  import { handleConnectorRoutes } from "./connector-routes.js";
91
100
  import { handleConversationRoutes } from "./conversation-routes.js";
101
+ import { handleCuratedSkillsRoutes } from "./curated-skills-routes.js";
92
102
  import { handleDatabaseRoute } from "./database.js";
93
103
  import { handleDiagnosticsRoutes } from "./diagnostics-routes.js";
94
- // Discord local routes extracted to @elizaos/plugin-discord (setup-routes.ts)
95
- import { handleDropRoutes } from "./drop-routes.js";
96
- import { DropService } from "./drop-service.js";
97
104
  import { handleHealthRoutes } from "./health-routes.js";
98
105
  import { readJsonBody as parseJsonBody, readRequestBody, sendJson, sendJsonError, } from "./http-helpers.js";
99
106
  // iMessage routes extracted to @elizaos/plugin-imessage setup-routes.ts (Plugin.routes)
100
107
  // import { handleIMessageRoute } from "./imessage-routes.js";
101
108
  import { handleInboxRoute } from "./inbox-routes.js";
102
109
  import { handleMcpRoutes } from "./mcp-routes.js";
103
- import { pushWithBatchEvict, sweepExpiredEntries } from "./memory-bounds.js";
110
+ import { pushWithBatchEvict } from "./memory-bounds.js";
104
111
  import { handleMemoryRoutes } from "./memory-routes.js";
105
112
  import { handleMiscRoutes } from "./misc-routes.js";
106
113
  import { handleModelsRoutes } from "./models-routes.js";
@@ -115,28 +122,22 @@ import { RegistryService } from "./registry-service.js";
115
122
  import { handleRelationshipsRoutes } from "./relationships-routes.js";
116
123
  import { tryHandleRuntimePluginRoute } from "./runtime-plugin-routes.js";
117
124
  import { handleSandboxRoute } from "./sandbox-routes.js";
118
- import { cloneWithoutBlockedObjectKeys, decodePathComponent, getErrorMessage, hasBlockedObjectKeyDeep, hasPersistedOnboardingState, isUuidLike, patchTouchesProviderSelection, resolveAppUserName, } from "./server-helpers.js";
125
+ import { cloneWithoutBlockedObjectKeys, decodePathComponent, getErrorMessage, hasPersistedOnboardingState, isUuidLike, patchTouchesProviderSelection, resolveAppUserName, } from "./server-helpers.js";
119
126
  // signal-routes: handleSignalRoute dispatch extracted to @elizaos/plugin-signal (setup-routes.ts)
120
127
  import { applySignalQrOverride } from "./signal-routes.js";
121
128
  import { discoverSkills } from "./skill-discovery-helpers.js";
122
129
  import { handleSkillsRoutes } from "./skills-routes.js";
123
130
  import { handleSubscriptionRoutes } from "./subscription-routes.js";
124
- import { routeTaskAgentTextToConnector } from "./task-agent-message-routing.js";
131
+ import { handleTelegramAccountRoute } from "./telegram-account-routes.js";
125
132
  import { handleTriggerRoutes } from "./trigger-routes.js";
126
133
  import { handleTtsRoutes } from "./tts-routes.js";
127
- import { TxService } from "./tx-service.js";
128
134
  import { handleUpdateRoutes } from "./update-routes.js";
129
- import {
130
- // Balance/import/generate helpers moved to @elizaos/app-steward plugin routes.
131
- // fetchEvmBalances, fetchSolanaBalances, fetchSolanaNativeBalanceViaRpc,
132
- // generateWalletForChain, importWallet, validatePrivateKey,
133
- generateWalletKeys, getWalletAddresses, initStewardWalletCache, setSolanaWalletEnv, } from "./wallet.js";
135
+ import { getWalletAddresses, initStewardWalletCache, } from "./wallet.js";
134
136
  // Wallet dispatch moved to @elizaos/app-steward plugin routes.
135
137
  // import { handleWalletBscRoutes } from "./wallet-bsc-routes.js";
136
138
  import { EVM_PLUGIN_PACKAGE, resolveWalletAutomationMode as resolveAgentAutomationModeFromConfig, resolveWalletCapabilityStatus, } from "./wallet-capability.js";
137
139
  import { handleWalletRoutes } from "./wallet-routes.js";
138
140
  import { resolveWalletRpcReadiness } from "./wallet-rpc.js";
139
- import { handleWebsiteBlockerRoutes } from "./website-blocker-routes.js";
140
141
  // handleWhatsAppRoute moved to @elizaos/plugin-whatsapp setup-routes.
141
142
  // applyWhatsAppQrOverride is still used by plugin-status routes.
142
143
  import { applyWhatsAppQrOverride } from "./whatsapp-routes.js";
@@ -148,9 +149,12 @@ export { buildChatAttachments, buildUserMessages, buildWalletActionNotExecutedRe
148
149
  import { getInventoryProviderOptions, getModelOptions, getOrFetchAllProviders, getOrFetchProvider, paramKeyToCategory, providerCachePath, readProviderCache, } from "./model-provider-helpers.js";
149
150
  import { AGENT_EVENT_ALLOWED_STREAMS, aggregateSecrets, BLOCKED_ENV_KEYS, CONFIG_WRITE_ALLOWED_TOP_KEYS, discoverInstalledPlugins, discoverPluginsFromManifest, getReleaseBundledPluginIds, maskValue, } from "./plugin-discovery-helpers.js";
150
151
  const nodeRequire = createRequire(import.meta.url);
152
+ // Dynamic import (not require) because the plugin is ESM-only and bun's
153
+ // createRequire cannot load ESM packages. Top-level await is settled before
154
+ // any consumer reads the binding.
151
155
  let agentOrchestratorCompat = null;
152
156
  try {
153
- agentOrchestratorCompat = nodeRequire("@elizaos/plugin-agent-orchestrator");
157
+ agentOrchestratorCompat = await import("@elizaos/plugin-agent-orchestrator");
154
158
  }
155
159
  catch {
156
160
  agentOrchestratorCompat = null;
@@ -452,7 +456,9 @@ function isModuleResolutionFailure(err) {
452
456
  return false;
453
457
  }
454
458
  const code = "code" in err ? err.code : undefined;
455
- if (code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND") {
459
+ if (code === "MODULE_NOT_FOUND" ||
460
+ code === "ERR_MODULE_NOT_FOUND" ||
461
+ code === "ERR_PACKAGE_PATH_NOT_EXPORTED") {
456
462
  return true;
457
463
  }
458
464
  if (!("message" in err) || typeof err.message !== "string") {
@@ -460,7 +466,8 @@ function isModuleResolutionFailure(err) {
460
466
  }
461
467
  return (err.message.includes("Cannot find module") ||
462
468
  err.message.includes("Cannot find package") ||
463
- err.message.includes("ERR_MODULE_NOT_FOUND"));
469
+ err.message.includes("ERR_MODULE_NOT_FOUND") ||
470
+ err.message.includes('is not defined by "exports"'));
464
471
  }
465
472
  function isWalletBridgeImportFailure(err) {
466
473
  if (isModuleResolutionFailure(err)) {
@@ -497,587 +504,23 @@ function parseBoundedLimit(rawLimit, fallback = 15) {
497
504
  fallback,
498
505
  });
499
506
  }
507
+ // Config redaction, skill validation extracted to server-helpers-config.ts
508
+ // isBlockedObjectKey, redactDeep, redactConfigSecrets, isRedactedSecretValue,
509
+ // stripRedactedPlaceholderValuesDeep imported from server-helpers-config.ts above.
510
+ // isBlockedObjectKey alias for local usage:
511
+ const isBlockedObjectKey = isBlockedObjectKeyFromConfig;
512
+ // MCP validation helpers extracted to server-helpers-mcp.ts
513
+ import { resolveMcpServersRejection as _resolveMcpServersRejection, validateMcpServerConfig as _validateMcpServerConfig, } from "./server-helpers-mcp.js";
514
+ export { resolveMcpServersRejection, validateMcpServerConfig, } from "./server-helpers-mcp.js";
515
+ const validateMcpServerConfig = _validateMcpServerConfig;
516
+ const resolveMcpServersRejection = _resolveMcpServersRejection;
500
517
  // ---------------------------------------------------------------------------
501
- // Config redaction
502
- // ---------------------------------------------------------------------------
503
- /**
504
- * Key patterns that indicate a value is sensitive and must be redacted.
505
- * Matches against the property key at unknown nesting depth. Aligned with
506
- * SENSITIVE_PATTERNS in src/config/schema.ts so every field the UI marks
507
- * as sensitive is also redacted in the API response.
508
- *
509
- * RESIDUAL RISK: Key-based redaction is heuristic — secrets stored under
510
- * generic keys (e.g. "value", "data", "config") will not be caught. A
511
- * stronger approach would be either (a) schema-level `sensitive: true`
512
- * annotations that drive redaction, or (b) an allowlist that only exposes
513
- * known-safe fields and strips everything else. Both require deeper
514
- * changes to the config schema infrastructure.
515
- */
516
- const SENSITIVE_KEY_RE = /password|secret|api.?key|private.?key|seed.?phrase|authorization|connection.?string|credential|(?<!max)tokens?$/i;
517
- function isBlockedObjectKey(key) {
518
- return (key === "__proto__" ||
519
- key === "constructor" ||
520
- key === "prototype" ||
521
- // Block config include directives — if an API caller embeds "$include"
522
- // inside a config patch, the next loadElizaConfig() → resolveConfigIncludes
523
- // pass would read arbitrary local files and merge them into the config.
524
- key === "$include");
525
- }
526
- // hasBlockedObjectKeyDeep and cloneWithoutBlockedObjectKeys imported in the consolidated import at the top
527
- /**
528
- * Replace unknown non-empty value with "[REDACTED]". For arrays, each string
529
- * element is individually redacted; for objects, all string leaves are
530
- * redacted. Non-string primitives (booleans, numbers) are replaced with
531
- * the string "[REDACTED]" to avoid leaking e.g. numeric PINs.
532
- */
533
- function redactValue(val) {
534
- if (val === null || val === undefined)
535
- return val;
536
- if (typeof val === "string")
537
- return val.length > 0 ? "[REDACTED]" : "";
538
- if (typeof val === "number" || typeof val === "boolean")
539
- return "[REDACTED]";
540
- if (Array.isArray(val))
541
- return val.map(redactValue);
542
- if (typeof val === "object") {
543
- const out = {};
544
- for (const [k, v] of Object.entries(val)) {
545
- out[k] = redactValue(v);
546
- }
547
- return out;
548
- }
549
- return "[REDACTED]";
550
- }
551
- /**
552
- * Recursively walk a JSON-safe value. For every object property whose key
553
- * matches SENSITIVE_KEY_RE, redact the **entire value** regardless of type
554
- * (string, array, nested object). This prevents leaks when secrets are
555
- * stored as arrays (e.g. `apiKeys: ["sk-1","sk-2"]`) or objects.
556
- * Returns a deep copy — the original is never mutated.
557
- */
558
- function redactDeep(val) {
559
- if (val === null || val === undefined)
560
- return val;
561
- if (Array.isArray(val))
562
- return val.map(redactDeep);
563
- if (typeof val === "object") {
564
- const out = {};
565
- for (const [key, child] of Object.entries(val)) {
566
- if (SENSITIVE_KEY_RE.test(key)) {
567
- out[key] = redactValue(child);
568
- }
569
- else {
570
- out[key] = redactDeep(child);
571
- }
572
- }
573
- return out;
574
- }
575
- return val;
576
- }
577
- /**
578
- * Return a deep copy of the config with every sensitive value replaced by
579
- * "[REDACTED]". Uses a recursive walk so that ANY future config field
580
- * whose key matches the sensitive pattern is automatically covered —
581
- * no manual enumeration required.
582
- */
583
- function redactConfigSecrets(config) {
584
- return redactDeep(config);
585
- }
586
- function isRedactedSecretValue(value) {
587
- return (typeof value === "string" && value.trim().toUpperCase() === "[REDACTED]");
588
- }
589
- /** Remove UI round-trip placeholders so GET /api/config → PUT never persists "[REDACTED]". */
590
- function stripRedactedPlaceholderValuesDeep(value) {
591
- if (value === null || typeof value !== "object")
592
- return;
593
- if (Array.isArray(value)) {
594
- for (const item of value) {
595
- stripRedactedPlaceholderValuesDeep(item);
596
- }
597
- return;
598
- }
599
- const obj = value;
600
- for (const key of Object.keys(obj)) {
601
- const v = obj[key];
602
- if (isRedactedSecretValue(v)) {
603
- delete obj[key];
604
- }
605
- else if (v !== null && typeof v === "object") {
606
- stripRedactedPlaceholderValuesDeep(v);
607
- }
608
- }
609
- }
610
- // ---------------------------------------------------------------------------
611
- // Skill-ID path-traversal guard
518
+ // Onboarding / config helpers — extracted to server-helpers-config.ts
612
519
  // ---------------------------------------------------------------------------
613
- /**
614
- * Validate that a user-supplied skill ID is safe to use in filesystem paths.
615
- * Rejects IDs containing path separators, ".." sequences, or unknown characters
616
- * outside the safe set used by the marketplace (`safeName()` in
617
- * skill-marketplace.ts). Returns `null` and sends a 400 response if the
618
- * ID is invalid.
619
- */
620
- const SAFE_SKILL_ID_RE = /^[a-zA-Z0-9._-]+$/;
621
- function _validateSkillId(skillId, res) {
622
- if (!skillId ||
623
- !SAFE_SKILL_ID_RE.test(skillId) ||
624
- skillId === "." ||
625
- skillId.includes("..")) {
626
- const safeDisplay = skillId.slice(0, 80).replace(/[^\x20-\x7e]/g, "?");
627
- error(res, `Invalid skill ID: "${safeDisplay}"`, 400);
628
- return null;
629
- }
630
- return skillId;
631
- }
632
- const ALLOWED_MCP_CONFIG_TYPES = new Set([
633
- "stdio",
634
- "http",
635
- "streamable-http",
636
- "sse",
637
- ]);
638
- const ALLOWED_MCP_COMMANDS = new Set([
639
- "npx",
640
- "node",
641
- "bun",
642
- "bunx",
643
- "deno",
644
- "python",
645
- "python3",
646
- "uvx",
647
- "uv",
648
- "docker",
649
- "podman",
650
- ]);
651
- const BLOCKED_MCP_ENV_KEYS = new Set([
652
- "LD_PRELOAD",
653
- "LD_LIBRARY_PATH",
654
- "DYLD_INSERT_LIBRARIES",
655
- "DYLD_LIBRARY_PATH",
656
- "NODE_OPTIONS",
657
- "NODE_EXTRA_CA_CERTS",
658
- "NODE_TLS_REJECT_UNAUTHORIZED",
659
- "HTTP_PROXY",
660
- "HTTPS_PROXY",
661
- "ALL_PROXY",
662
- "NO_PROXY",
663
- "NODE_PATH",
664
- "SSL_CERT_FILE",
665
- "SSL_CERT_DIR",
666
- "CURL_CA_BUNDLE",
667
- "PATH",
668
- "HOME",
669
- "SHELL",
670
- ]);
671
- const INTERPRETER_MCP_COMMANDS = new Set([
672
- "node",
673
- "bun",
674
- "deno",
675
- "python",
676
- "python3",
677
- "uv",
678
- ]);
679
- const PACKAGE_RUNNER_MCP_COMMANDS = new Set(["npx", "bunx", "uvx"]);
680
- const CONTAINER_MCP_COMMANDS = new Set(["docker", "podman"]);
681
- const BLOCKED_INTERPRETER_FLAGS = new Set([
682
- "-e",
683
- "--eval",
684
- "-p",
685
- "--print",
686
- "-r",
687
- "--require",
688
- "--import",
689
- "--loader",
690
- "--experimental-loader",
691
- "--preload",
692
- "-c",
693
- "-m",
694
- // V8 inspector — opens an unauthenticated debug port (default 9229) that
695
- // allows arbitrary code execution via Chrome DevTools Protocol. If bound
696
- // to 0.0.0.0, any network peer can connect → RCE without any token.
697
- "--inspect",
698
- "--inspect-brk",
699
- "--inspect-wait",
700
- "--inspect-port",
701
- "--inspect-publish-uid",
702
- // Policy / diagnostics file access
703
- "--experimental-policy",
704
- "--diagnostic-dir",
705
- ]);
706
- const BLOCKED_PACKAGE_RUNNER_FLAGS = new Set(["-c", "--call", "-e", "--eval"]);
707
- const BLOCKED_CONTAINER_FLAGS = new Set([
708
- "--privileged",
709
- "-v",
710
- "--volume",
711
- "--mount",
712
- "--cap-add",
713
- "--security-opt",
714
- "--pid",
715
- "--network",
716
- "--device",
717
- "--ipc",
718
- "--uts",
719
- "--userns",
720
- "--cgroupns",
721
- ]);
722
- const BLOCKED_DENO_SUBCOMMANDS = new Set(["eval"]);
723
- const BLOCKED_MCP_REMOTE_HOST_LITERALS = new Set([
724
- "localhost",
725
- "metadata.google.internal",
726
- ]);
727
- function normalizeMcpCommand(command) {
728
- const baseName = command.replace(/\\/g, "/").split("/").pop() ?? "";
729
- return baseName.replace(/\.(exe|cmd|bat)$/i, "").toLowerCase();
730
- }
731
- function hasBlockedFlag(args, blockedFlags) {
732
- for (const arg of args) {
733
- const trimmed = arg.trim();
734
- for (const flag of blockedFlags) {
735
- if (trimmed === flag || trimmed.startsWith(`${flag}=`)) {
736
- return flag;
737
- }
738
- // Block attached short-option forms like -cpayload or -epayload.
739
- if (/^-[A-Za-z]$/.test(flag) &&
740
- trimmed.startsWith(flag) &&
741
- trimmed.length > flag.length) {
742
- return flag;
743
- }
744
- }
745
- }
746
- return null;
747
- }
748
- function firstPositionalArg(args) {
749
- for (const arg of args) {
750
- const trimmed = arg.trim();
751
- if (!trimmed || trimmed === "--" || trimmed.startsWith("-"))
752
- continue;
753
- return trimmed.toLowerCase();
754
- }
755
- return null;
756
- }
757
- async function resolveMcpRemoteUrlRejection(rawUrl) {
758
- let parsed;
759
- try {
760
- parsed = new URL(rawUrl);
761
- }
762
- catch {
763
- return "URL must be a valid absolute URL";
764
- }
765
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
766
- return "URL must use http:// or https://";
767
- }
768
- const hostname = normalizeHostLike(parsed.hostname);
769
- if (!hostname)
770
- return "URL hostname is required";
771
- if (BLOCKED_MCP_REMOTE_HOST_LITERALS.has(hostname) ||
772
- hostname.endsWith(".localhost") ||
773
- hostname.endsWith(".local")) {
774
- return `URL host "${hostname}" is blocked for security reasons`;
775
- }
776
- if (net.isIP(hostname)) {
777
- if (isBlockedPrivateOrLinkLocalIp(hostname)) {
778
- return `URL host "${hostname}" is blocked for security reasons`;
779
- }
780
- return null;
781
- }
782
- let addresses;
783
- try {
784
- const resolved = await dnsLookup(hostname, { all: true });
785
- addresses = Array.isArray(resolved) ? resolved : [resolved];
786
- }
787
- catch {
788
- return `Could not resolve URL host "${hostname}"`;
789
- }
790
- if (addresses.length === 0) {
791
- return `Could not resolve URL host "${hostname}"`;
792
- }
793
- for (const entry of addresses) {
794
- if (isBlockedPrivateOrLinkLocalIp(entry.address)) {
795
- return `URL host "${hostname}" resolves to blocked address ${entry.address}`;
796
- }
797
- }
798
- return null;
799
- }
800
- export async function validateMcpServerConfig(config) {
801
- const configType = config.type;
802
- if (typeof configType !== "string" ||
803
- !ALLOWED_MCP_CONFIG_TYPES.has(configType)) {
804
- return `Invalid config type. Must be one of: ${[...ALLOWED_MCP_CONFIG_TYPES].join(", ")}`;
805
- }
806
- if (configType === "stdio") {
807
- const command = typeof config.command === "string" ? config.command.trim() : "";
808
- if (!command) {
809
- return "Command is required for stdio servers";
810
- }
811
- if (!/^[A-Za-z0-9._-]+$/.test(command)) {
812
- return "Command must be a bare executable name without path separators";
813
- }
814
- const normalizedCommand = normalizeMcpCommand(command);
815
- if (!ALLOWED_MCP_COMMANDS.has(normalizedCommand)) {
816
- return (`Command "${command}" is not allowed. ` +
817
- `Allowed commands: ${[...ALLOWED_MCP_COMMANDS].join(", ")}`);
818
- }
819
- if (config.args !== undefined) {
820
- if (!Array.isArray(config.args)) {
821
- return "args must be an array of strings";
822
- }
823
- for (const arg of config.args) {
824
- if (typeof arg !== "string") {
825
- return "Each arg must be a string";
826
- }
827
- }
828
- const args = config.args;
829
- if (INTERPRETER_MCP_COMMANDS.has(normalizedCommand)) {
830
- const blocked = hasBlockedFlag(args, BLOCKED_INTERPRETER_FLAGS);
831
- if (blocked) {
832
- return `Flag "${blocked}" is not allowed for ${normalizedCommand} MCP servers`;
833
- }
834
- }
835
- if (PACKAGE_RUNNER_MCP_COMMANDS.has(normalizedCommand)) {
836
- const blocked = hasBlockedFlag(args, BLOCKED_PACKAGE_RUNNER_FLAGS);
837
- if (blocked) {
838
- return `Flag "${blocked}" is not allowed for ${normalizedCommand} MCP servers`;
839
- }
840
- }
841
- if (CONTAINER_MCP_COMMANDS.has(normalizedCommand)) {
842
- const blocked = hasBlockedFlag(args, BLOCKED_CONTAINER_FLAGS);
843
- if (blocked) {
844
- return `Flag "${blocked}" is not allowed for ${normalizedCommand} MCP servers`;
845
- }
846
- }
847
- if (normalizedCommand === "deno") {
848
- const subcommand = firstPositionalArg(args);
849
- if (subcommand && BLOCKED_DENO_SUBCOMMANDS.has(subcommand)) {
850
- return `Subcommand "${subcommand}" is not allowed for deno MCP servers`;
851
- }
852
- }
853
- }
854
- }
855
- else {
856
- const url = typeof config.url === "string" ? config.url.trim() : "";
857
- if (!url) {
858
- return "URL is required for remote servers";
859
- }
860
- const urlRejection = await resolveMcpRemoteUrlRejection(url);
861
- if (urlRejection)
862
- return urlRejection;
863
- }
864
- if (config.env !== undefined) {
865
- if (typeof config.env !== "object" ||
866
- config.env === null ||
867
- Array.isArray(config.env)) {
868
- return "env must be a plain object of string key-value pairs";
869
- }
870
- for (const [key, value] of Object.entries(config.env)) {
871
- if (isBlockedObjectKey(key)) {
872
- return `env key "${key}" is blocked for security reasons`;
873
- }
874
- if (typeof value !== "string") {
875
- return `env.${key} must be a string`;
876
- }
877
- if (BLOCKED_MCP_ENV_KEYS.has(key.toUpperCase())) {
878
- return `env variable "${key}" is not allowed for security reasons`;
879
- }
880
- }
881
- }
882
- if (config.cwd !== undefined && typeof config.cwd !== "string") {
883
- return "cwd must be a string";
884
- }
885
- if (config.timeoutInMillis !== undefined) {
886
- if (typeof config.timeoutInMillis !== "number" ||
887
- !Number.isFinite(config.timeoutInMillis) ||
888
- config.timeoutInMillis < 0) {
889
- return "timeoutInMillis must be a non-negative number";
890
- }
891
- }
892
- return null;
893
- }
894
- export async function resolveMcpServersRejection(servers) {
895
- for (const [serverName, serverConfig] of Object.entries(servers)) {
896
- if (isBlockedObjectKey(serverName)) {
897
- return `Invalid server name: "${serverName}"`;
898
- }
899
- if (!serverConfig ||
900
- typeof serverConfig !== "object" ||
901
- Array.isArray(serverConfig)) {
902
- return `Server "${serverName}" config must be a JSON object`;
903
- }
904
- if (hasBlockedObjectKeyDeep(serverConfig)) {
905
- return `Server "${serverName}" contains blocked object keys`;
906
- }
907
- const configError = await validateMcpServerConfig(serverConfig);
908
- if (configError) {
909
- return `Server "${serverName}": ${configError}`;
910
- }
911
- }
912
- return null;
913
- }
914
- // ---------------------------------------------------------------------------
915
- // Onboarding helpers
916
- // ---------------------------------------------------------------------------
917
- // Use shared presets for full parity between CLI and GUI onboarding.
918
- import { getDefaultStylePreset, getStylePresets, normalizeCharacterLanguage, resolveStylePresetByAvatarIndex, } from "../onboarding-presets.js";
520
+ import { getStylePresets, normalizeCharacterLanguage, resolveStylePresetByAvatarIndex, } from "@elizaos/shared/onboarding-presets";
919
521
  import { pickRandomNames } from "../runtime/onboarding-names.js";
920
- const DEFAULT_ELEVENLABS_TTS_MODEL = "eleven_flash_v2_5";
921
- const ELEVENLABS_VOICE_ID_BY_PRESET = {
922
- rachel: "21m00Tcm4TlvDq8ikWAM",
923
- sarah: "EXAVITQu4vr4xnSDxMaL",
924
- matilda: "XrExE9yKIg1WjnnlVkGX",
925
- lily: "pFZP5JQG7iQjIQuC4Bku",
926
- alice: "Xb7hH8MSUJpSbSDYk0k2",
927
- brian: "nPczCjzI2devNBz1zQrb",
928
- adam: "pNInz6obpgDQGcFmaJgB",
929
- josh: "TxGEqnHWrfWFTfGW9XjX",
930
- daniel: "onwK4e9ZLuTAKqWW03F9",
931
- liam: "TX3LPaxmHKxFdv7VOQHJ",
932
- gigi: "jBpfuIE2acCO8z3wKNLl",
933
- mimi: "zrHiDhphv9ZnVXBqCLjz",
934
- dorothy: "ThT5KcBeYPX3keUQqHPh",
935
- glinda: "z9fAnlkpzviPz146aGWa",
936
- charlotte: "XB0fDUnXU5powFXDhCwa",
937
- callum: "N2lVS1w4EtoT3dr4eOWO",
938
- momo: "n7Wi4g1bhpw4Bs8HK5ph",
939
- yuki: "4tRn1lSkEn13EVTuqb0g",
940
- rin: "cNYrMw9glwJZXR8RwbuR",
941
- kei: "eadgjmk4R4uojdsheG9t",
942
- jin: "6IwYbsNENZgAB1dtBZDp",
943
- satoshi: "7cOBG34AiHrAzs842Rdi",
944
- ryu: "QzTKubutNn9TjrB7Xb2Q",
945
- };
946
- function readUiLanguageHeader(req) {
947
- if (!req) {
948
- return undefined;
949
- }
950
- const header = req.headers["x-eliza-ui-language"] ?? req.headers["x-eliza-ui-language"];
951
- if (Array.isArray(header)) {
952
- return header.find((value) => value.trim())?.trim();
953
- }
954
- return typeof header === "string" && header.trim()
955
- ? header.trim()
956
- : undefined;
957
- }
958
- function resolveConfiguredCharacterLanguage(config, req) {
959
- const uiLanguage = readUiLanguageHeader(req) ??
960
- config?.ui?.language;
961
- return normalizeCharacterLanguage(uiLanguage);
962
- }
963
- function resolveOnboardingStylePreset(body, language) {
964
- const presets = getStylePresets(language);
965
- const requestedPresetId = typeof body.presetId === "string" ? body.presetId.trim() : "";
966
- if (requestedPresetId) {
967
- const byId = presets.find((preset) => preset.id === requestedPresetId);
968
- if (byId)
969
- return byId;
970
- }
971
- if (typeof body.avatarIndex === "number" &&
972
- Number.isFinite(body.avatarIndex)) {
973
- const byAvatar = presets.find((preset) => preset.avatarIndex === Number(body.avatarIndex));
974
- if (byAvatar)
975
- return byAvatar;
976
- }
977
- const requestedName = typeof body.name === "string" ? body.name.trim() : "";
978
- if (requestedName) {
979
- const byName = presets.find((preset) => preset.name === requestedName);
980
- if (byName)
981
- return byName;
982
- }
983
- return getDefaultStylePreset(language);
984
- }
985
- function applyOnboardingVoicePreset(config, body, language) {
986
- const elevenLabsApiKey = process.env.ELEVENLABS_API_KEY?.trim();
987
- if (!elevenLabsApiKey) {
988
- return;
989
- }
990
- const stylePreset = resolveOnboardingStylePreset(body, language);
991
- const voicePresetId = stylePreset?.voicePresetId?.trim();
992
- if (!voicePresetId) {
993
- return;
994
- }
995
- const voiceId = ELEVENLABS_VOICE_ID_BY_PRESET[voicePresetId];
996
- if (!voiceId) {
997
- return;
998
- }
999
- if (!config.messages || typeof config.messages !== "object") {
1000
- config.messages = {};
1001
- }
1002
- const messages = config.messages;
1003
- const existingTts = messages.tts && typeof messages.tts === "object"
1004
- ? messages.tts
1005
- : {};
1006
- const existingElevenlabs = existingTts.elevenlabs && typeof existingTts.elevenlabs === "object"
1007
- ? existingTts.elevenlabs
1008
- : {};
1009
- messages.tts = {
1010
- ...existingTts,
1011
- provider: "elevenlabs",
1012
- elevenlabs: {
1013
- ...existingElevenlabs,
1014
- voiceId,
1015
- modelId: typeof existingElevenlabs.modelId === "string" &&
1016
- existingElevenlabs.modelId.trim()
1017
- ? existingElevenlabs.modelId.trim()
1018
- : DEFAULT_ELEVENLABS_TTS_MODEL,
1019
- },
1020
- };
1021
- }
1022
- function resolveDefaultAgentName(config, req) {
1023
- const configuredName = config?.ui?.assistant?.name?.trim() ??
1024
- config?.agents?.list?.[0]?.name?.trim();
1025
- if (configuredName) {
1026
- return configuredName;
1027
- }
1028
- return getDefaultStylePreset(resolveConfiguredCharacterLanguage(config, req))
1029
- .name;
1030
- }
1031
- function getProviderOptions() {
1032
- return ONBOARDING_PROVIDER_CATALOG.map((provider) => ({
1033
- id: provider.id,
1034
- name: provider.name,
1035
- envKey: provider.envKey,
1036
- pluginName: provider.pluginName,
1037
- keyPrefix: provider.keyPrefix,
1038
- description: provider.description,
1039
- }));
1040
- }
1041
- function getCloudProviderOptions() {
1042
- return ONBOARDING_CLOUD_PROVIDER_OPTIONS.map((provider) => ({
1043
- id: provider.id,
1044
- name: provider.name,
1045
- description: provider.description,
1046
- }));
1047
- }
1048
- function ensureWalletKeysInEnvAndConfig(config) {
1049
- const missingEvm = typeof process.env.EVM_PRIVATE_KEY !== "string" ||
1050
- !process.env.EVM_PRIVATE_KEY.trim();
1051
- const missingSolana = typeof process.env.SOLANA_PRIVATE_KEY !== "string" ||
1052
- !process.env.SOLANA_PRIVATE_KEY.trim();
1053
- if (!missingEvm && !missingSolana) {
1054
- return false;
1055
- }
1056
- try {
1057
- const walletKeys = generateWalletKeys();
1058
- if (!config.env ||
1059
- typeof config.env !== "object" ||
1060
- Array.isArray(config.env)) {
1061
- config.env = {};
1062
- }
1063
- const envConfig = config.env;
1064
- if (missingEvm) {
1065
- envConfig.EVM_PRIVATE_KEY = walletKeys.evmPrivateKey;
1066
- process.env.EVM_PRIVATE_KEY = walletKeys.evmPrivateKey;
1067
- logger.info(`[eliza-api] Generated EVM wallet: ${walletKeys.evmAddress}`);
1068
- }
1069
- if (missingSolana) {
1070
- envConfig.SOLANA_PRIVATE_KEY = walletKeys.solanaPrivateKey;
1071
- setSolanaWalletEnv(walletKeys.solanaPrivateKey);
1072
- logger.info(`[eliza-api] Generated Solana wallet: ${walletKeys.solanaAddress}`);
1073
- }
1074
- return true;
1075
- }
1076
- catch (err) {
1077
- logger.warn(`[eliza-api] Failed to generate wallet keys: ${err instanceof Error ? err.message : String(err)}`);
1078
- return false;
1079
- }
1080
- }
522
+ import { applyOnboardingVoicePreset, ensureWalletKeysInEnvAndConfig, getCloudProviderOptions, getProviderOptions, isBlockedObjectKey as isBlockedObjectKeyFromConfig, isRedactedSecretValue, isSafeResetStateDir, readUiLanguageHeader, redactConfigSecrets, redactDeep, resolveConfiguredCharacterLanguage, resolveDefaultAgentName, stripRedactedPlaceholderValuesDeep, } from "./server-helpers-config.js";
523
+ export { isSafeResetStateDir } from "./server-helpers-config.js";
1081
524
  // ---------------------------------------------------------------------------
1082
525
  // Trade permission helpers (exported for use by awareness contributors)
1083
526
  // ---------------------------------------------------------------------------
@@ -1188,281 +631,17 @@ function buildPluginEvmDiagnosticEntry(state) {
1188
631
  ],
1189
632
  };
1190
633
  }
1191
- // "send" alone is too broad — "send a slack message" shouldn't trigger wallet
1192
- // mode. Require "send" to appear near a crypto/wallet keyword within 40 chars.
1193
- const _WALLET_CHAT_INTENT_RE = /\b(wallet|privy|onchain|on-chain|address|balance|swap|trade|transfer|token|bnb|t?bnb|eth|sol)\b|(?:\bsend\b(?=[\s\S]{0,40}\b(?:token|eth|sol|t?bnb|wallet|crypto|coin)\b))/i;
1194
- // WALLET_EXECUTION_INTENT_RE, WALLET_PROGRESS_ONLY_RE, isWalletActionRequiredIntent
1195
- // moved to server-helpers.ts; re-exported above.
1196
- // Keep private regex constants here for wallet intent fallback code that stays in server.ts.
1197
- // isWalletActionRequiredIntent, WALLET_EXECUTION_INTENT_RE, WALLET_PROGRESS_ONLY_RE
1198
- // imported in the consolidated import at the top
1199
- const _WALLET_IDENTITY_INTENT_RE = /\b(wallet\s*address|address)\b/i;
1200
- const _WALLET_ACTION_REQUIRED_INTENT_RE = /\b(balance|portfolio|holdings|funds|swap|trade|transfer|send|buy|sell|execute|approve)\b/i;
1201
- const _WALLET_PROGRESS_PREFIX_RE = /^\s*(?:let me|i(?:'ll| will)|checking|fetching|looking up|pulling|one moment|just a second|hold on)[\s\S]{0,120}?(?:now|\.{3}|…)?\s*/i;
1202
- const EVM_ADDRESS_CAPTURE_RE = /\b0x[a-fA-F0-9]{40}\b/g;
1203
- const DECIMAL_AMOUNT_CAPTURE_RE = /\b(\d+(?:\.\d+)?)\b/;
1204
- const SEND_NATIVE_ASSET_RE = /\b(?:t?bnb|bnb|eth|usdt|usdc|busd|dai|weth|wbtc)\b/i;
1205
- const SWAP_ROUTE_PROVIDER_RE = /\b(pancakeswap-v2|0x|auto)\b/i;
1206
- function normalizeWalletAssetSymbol(asset) {
1207
- const normalized = asset.trim().toUpperCase();
1208
- if (normalized === "TBNB")
1209
- return "BNB";
1210
- return normalized;
1211
- }
1212
- function resolveWalletDrillTokenAddress() {
1213
- if (process.env.NODE_ENV === "production" && !process.env.VITEST) {
1214
- return null;
1215
- }
1216
- const raw = process.env.WALLET_DRILL_TOKEN_ADDRESS?.trim();
1217
- return raw && /^0x[a-fA-F0-9]{40}$/.test(raw) ? raw : null;
1218
- }
1219
- function buildWalletParameterFailureReply(actionName, reason) {
1220
- const walletNetwork = process.env.ELIZA_WALLET_NETWORK?.trim().toLowerCase() === "testnet"
1221
- ? "BSC testnet"
1222
- : "BSC";
1223
- return [
1224
- `Action: ${actionName}`,
1225
- `Chain: ${walletNetwork}`,
1226
- "Executed: false",
1227
- `Reason: ${reason}`,
1228
- ].join("\n");
1229
- }
1230
- function inferTransferFallbackAction(prompt) {
1231
- if (!/\b(send|transfer|pay)\b/i.test(prompt))
1232
- return null;
1233
- const recipient = prompt.match(EVM_ADDRESS_CAPTURE_RE)?.[0];
1234
- if (!recipient) {
1235
- return {
1236
- errorText: buildWalletParameterFailureReply("TRANSFER_TOKEN", "I need a recipient EVM address to send funds."),
1237
- };
1238
- }
1239
- const amount = prompt.match(DECIMAL_AMOUNT_CAPTURE_RE)?.[1];
1240
- if (!amount) {
1241
- return {
1242
- errorText: buildWalletParameterFailureReply("TRANSFER_TOKEN", "I need a positive transfer amount."),
1243
- };
1244
- }
1245
- const assetMatch = prompt.match(SEND_NATIVE_ASSET_RE)?.[0];
1246
- if (!assetMatch) {
1247
- return {
1248
- errorText: buildWalletParameterFailureReply("TRANSFER_TOKEN", "I need an asset symbol such as BNB, USDT, or USDC."),
1249
- };
1250
- }
1251
- return {
1252
- action: {
1253
- name: "TRANSFER_TOKEN",
1254
- parameters: {
1255
- toAddress: recipient,
1256
- amount,
1257
- assetSymbol: normalizeWalletAssetSymbol(assetMatch),
1258
- },
1259
- },
1260
- };
1261
- }
1262
- function inferTradeSide(prompt) {
1263
- if (/\bsell\b/i.test(prompt))
1264
- return "sell";
1265
- if (/\b(buy|swap|trade)\b/i.test(prompt))
1266
- return "buy";
1267
- return null;
1268
- }
1269
- function inferTradeFallbackAction(prompt) {
1270
- if (!/\b(swap|trade|buy|sell)\b/i.test(prompt))
1271
- return null;
1272
- const side = inferTradeSide(prompt);
1273
- if (!side) {
1274
- return {
1275
- errorText: buildWalletParameterFailureReply("EXECUTE_TRADE", 'I need a trade side ("buy" or "sell").'),
1276
- };
1277
- }
1278
- const amount = prompt.match(DECIMAL_AMOUNT_CAPTURE_RE)?.[1];
1279
- if (!amount) {
1280
- return {
1281
- errorText: buildWalletParameterFailureReply("EXECUTE_TRADE", "I need a positive trade amount."),
1282
- };
1283
- }
1284
- const addresses = prompt.match(EVM_ADDRESS_CAPTURE_RE) ?? [];
1285
- const drillTokenAddress = resolveWalletDrillTokenAddress();
1286
- const tokenAddress = addresses[0] ?? drillTokenAddress;
1287
- if (!tokenAddress) {
1288
- return {
1289
- errorText: buildWalletParameterFailureReply("EXECUTE_TRADE", drillTokenAddress === null &&
1290
- process.env.NODE_ENV === "production" &&
1291
- !process.env.VITEST
1292
- ? "I need a target token contract address in the prompt."
1293
- : "I need a target token address. Set WALLET_DRILL_TOKEN_ADDRESS or include the token contract address in the prompt."),
1294
- };
1295
- }
1296
- const routeProvider = prompt.match(SWAP_ROUTE_PROVIDER_RE)?.[1]?.toLowerCase() ??
1297
- "pancakeswap-v2";
1298
- return {
1299
- action: {
1300
- name: "EXECUTE_TRADE",
1301
- parameters: {
1302
- side,
1303
- amount,
1304
- tokenAddress,
1305
- routeProvider,
1306
- },
1307
- },
1308
- };
1309
- }
1310
- export function inferWalletExecutionFallback(prompt) {
1311
- return (inferTransferFallbackAction(prompt) ?? inferTradeFallbackAction(prompt));
1312
- }
1313
- export function hasUsableWalletFallbackParams(action) {
1314
- const parameters = action.parameters ?? {};
1315
- if (action.name === "TRANSFER_TOKEN") {
1316
- return (typeof parameters.toAddress === "string" &&
1317
- /^0x[a-fA-F0-9]{40}$/.test(parameters.toAddress) &&
1318
- typeof parameters.amount === "string" &&
1319
- parameters.amount.trim().length > 0 &&
1320
- typeof parameters.assetSymbol === "string" &&
1321
- parameters.assetSymbol.trim().length > 0);
1322
- }
1323
- if (action.name === "EXECUTE_TRADE") {
1324
- return ((parameters.side === "buy" || parameters.side === "sell") &&
1325
- typeof parameters.amount === "string" &&
1326
- parameters.amount.trim().length > 0 &&
1327
- typeof parameters.tokenAddress === "string" &&
1328
- /^0x[a-fA-F0-9]{40}$/.test(parameters.tokenAddress));
1329
- }
1330
- return true;
1331
- }
1332
- // buildWalletActionNotExecutedReply and trimWalletProgressPrefix moved to server-helpers.ts;
1333
- // re-exported above
1334
- // buildWalletActionNotExecutedReply, trimWalletProgressPrefix imported in the consolidated import at the top
1335
- // ── Plugin config intent detection ──────────────────────────────────
1336
- // Matches: "set up telegram", "configure discord plugin", "connect slack",
1337
- // "help me with the openai plugin", etc.
1338
- const PLUGIN_CONFIG_RE = /\b(?:set\s*up|configure|connect|enable|install|setup)\b.*?\b(telegram|discord|twitter|slack|anthropic|openai|openrouter|groq|google|gemini|deepseek|mistral|together|grok|zai|ollama)\b|\b(telegram|discord|twitter|slack|anthropic|openai|openrouter|groq|google|gemini|deepseek|mistral|together|grok|zai|ollama)\b.*?\b(?:plugin|connector|set\s*up|configure|connect|enable|setup)\b/i;
1339
- const PLUGIN_PARAMS = {
1340
- telegram: [
1341
- {
1342
- key: "TELEGRAM_BOT_TOKEN",
1343
- label: "Bot Token (from @BotFather)",
1344
- secret: true,
1345
- },
1346
- ],
1347
- discord: [
1348
- { key: "DISCORD_API_TOKEN", label: "Bot Token", secret: true },
1349
- {
1350
- key: "DISCORD_APPLICATION_ID",
1351
- label: "Application ID (optional, auto-resolved when omitted)",
1352
- secret: false,
1353
- },
1354
- ],
1355
- twitter: [
1356
- { key: "TWITTER_USERNAME", label: "Username", secret: false },
1357
- { key: "TWITTER_PASSWORD", label: "Password", secret: true },
1358
- { key: "TWITTER_EMAIL", label: "Email", secret: false },
1359
- ],
1360
- slack: [
1361
- { key: "SLACK_APP_TOKEN", label: "App Token", secret: true },
1362
- { key: "SLACK_BOT_TOKEN", label: "Bot Token", secret: true },
1363
- { key: "SLACK_SIGNING_SECRET", label: "Signing Secret", secret: true },
1364
- ],
1365
- anthropic: [
1366
- {
1367
- key: "ANTHROPIC_API_KEY",
1368
- label: "API Key (console.anthropic.com)",
1369
- secret: true,
1370
- },
1371
- ],
1372
- openai: [
1373
- {
1374
- key: "OPENAI_API_KEY",
1375
- label: "API Key (platform.openai.com)",
1376
- secret: true,
1377
- },
1378
- ],
1379
- openrouter: [
1380
- {
1381
- key: "OPENROUTER_API_KEY",
1382
- label: "API Key (openrouter.ai)",
1383
- secret: true,
1384
- },
1385
- ],
1386
- groq: [
1387
- { key: "GROQ_API_KEY", label: "API Key (console.groq.com)", secret: true },
1388
- ],
1389
- google: [
1390
- { key: "GOOGLE_GENERATIVE_AI_API_KEY", label: "API Key", secret: true },
1391
- ],
1392
- gemini: [
1393
- { key: "GOOGLE_GENERATIVE_AI_API_KEY", label: "API Key", secret: true },
1394
- ],
1395
- deepseek: [{ key: "DEEPSEEK_API_KEY", label: "API Key", secret: true }],
1396
- mistral: [{ key: "MISTRAL_API_KEY", label: "API Key", secret: true }],
1397
- together: [{ key: "TOGETHER_API_KEY", label: "API Key", secret: true }],
1398
- grok: [{ key: "XAI_API_KEY", label: "API Key", secret: true }],
1399
- zai: [{ key: "ZAI_API_KEY", label: "API Key", secret: true }],
1400
- ollama: [
1401
- {
1402
- key: "OLLAMA_BASE_URL",
1403
- label: "Ollama URL (e.g. http://localhost:11434)",
1404
- secret: false,
1405
- },
1406
- ],
1407
- };
1408
- export async function resolvePluginConfigReply(prompt, _state) {
1409
- const match = prompt.match(PLUGIN_CONFIG_RE);
1410
- if (!match)
1411
- return null;
1412
- const pluginName = (match[1] || match[2]).toLowerCase();
1413
- const params = PLUGIN_PARAMS[pluginName];
1414
- if (!params)
1415
- return null;
1416
- const displayName = pluginName.charAt(0).toUpperCase() + pluginName.slice(1);
1417
- const elements = {};
1418
- const fieldIds = [];
1419
- const state = { pluginId: pluginName };
1420
- elements.title = {
1421
- type: "Heading",
1422
- props: { level: 3, text: `Configure ${displayName}` },
1423
- };
1424
- elements.sep = { type: "Separator", props: {} };
1425
- for (const param of params) {
1426
- const fid = `f_${param.key}`;
1427
- fieldIds.push(fid);
1428
- state[`config.${param.key}`] = "";
1429
- elements[fid] = {
1430
- type: "Input",
1431
- props: {
1432
- label: param.label,
1433
- placeholder: param.key,
1434
- statePath: `config.${param.key}`,
1435
- type: param.secret ? "password" : "text",
1436
- className: "font-mono text-xs",
1437
- },
1438
- };
1439
- }
1440
- elements.fields = { type: "Stack", props: { gap: "3", children: fieldIds } };
1441
- elements.saveBtn = {
1442
- type: "Button",
1443
- props: {
1444
- text: "Save & Enable",
1445
- variant: "default",
1446
- className: "font-semibold",
1447
- on: {
1448
- press: { action: "plugin:save", params: { pluginId: pluginName } },
1449
- },
1450
- },
1451
- };
1452
- elements.actions = {
1453
- type: "Stack",
1454
- props: { direction: "row", gap: "2", children: ["saveBtn"] },
1455
- };
1456
- elements.root = {
1457
- type: "Card",
1458
- props: {
1459
- children: ["title", "sep", "fields", "actions"],
1460
- className: "p-4 space-y-3",
1461
- },
1462
- };
1463
- const spec = JSON.stringify({ version: 1, root: "root", elements, state });
1464
- return `here's the config form for ${displayName} — fill in your credentials and hit save:\n\n\`\`\`json-render\n${spec}\n\`\`\``;
1465
- }
634
+ // Wallet intent/export helpers extracted to server-helpers-wallet.ts
635
+ import { hasUsableWalletFallbackParams as _hasUsableWalletFallbackParams, inferWalletExecutionFallback as _inferWalletExecutionFallback, resolveWalletExportRejection as _resolveWalletExportRejection, } from "./server-helpers-wallet.js";
636
+ export { hasUsableWalletFallbackParams, inferWalletExecutionFallback, resolveWalletExportRejection, } from "./server-helpers-wallet.js";
637
+ const inferWalletExecutionFallback = _inferWalletExecutionFallback;
638
+ const hasUsableWalletFallbackParams = _hasUsableWalletFallbackParams;
639
+ const resolveWalletExportRejection = _resolveWalletExportRejection;
640
+ // Plugin config helpers extracted to server-helpers-plugin.ts
641
+ import { resolvePluginConfigMutationRejections as _resolvePluginConfigMutationRejections, resolvePluginConfigReply as _resolvePluginConfigReply, } from "./server-helpers-plugin.js";
642
+ export { resolvePluginConfigMutationRejections, resolvePluginConfigReply, } from "./server-helpers-plugin.js";
643
+ const resolvePluginConfigReply = _resolvePluginConfigReply;
644
+ const resolvePluginConfigMutationRejections = _resolvePluginConfigMutationRejections;
1466
645
  async function resolveTrainingServiceCtor() {
1467
646
  const candidates = [
1468
647
  "../services/training-service",
@@ -1498,503 +677,48 @@ export function resolveMcpTerminalAuthorizationRejection(req, servers, body) {
1498
677
  }
1499
678
  return resolveTerminalRunRejection(req, body);
1500
679
  }
1501
- const LOCAL_ORIGIN_RE = /^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]|\[0:0:0:0:0:0:0:1\])(:\d+)?$/i;
1502
- const APP_ORIGIN_RE = /^(capacitor|capacitor-electron|app|tauri|file|electrobun):\/\/.*$/i;
1503
- /**
1504
- * Hostname allowlist for DNS rebinding protection.
1505
- * Requests with a Host header that doesn't match a known loopback name are
1506
- * rejected before CORS / auth processing. This prevents a malicious page
1507
- * from rebinding its DNS to 127.0.0.1 and reading the unauthenticated API.
1508
- */
1509
- const LOCAL_HOST_RE = /^(localhost|127\.0\.0\.1|\[?::1\]?|\[?0:0:0:0:0:0:0:1\]?|::ffff:127\.0\.0\.1)$/;
1510
- /** Wildcard bind addresses that listen on all interfaces. */
1511
- const WILDCARD_BIND_RE = /^(0\.0\.0\.0|::|0:0:0:0:0:0:0:0)$/;
1512
- export function isAllowedHost(req) {
1513
- const raw = req.headers.host;
1514
- if (!raw)
1515
- return true; // No Host header → non-browser client (e.g. curl)
1516
- let hostname;
1517
- const trimmed = raw.trim().toLowerCase();
1518
- if (!trimmed)
1519
- return true;
1520
- if (trimmed.startsWith("[")) {
1521
- // Bracketed IPv6: [::1]:31337 → ::1
1522
- const close = trimmed.indexOf("]");
1523
- hostname = close > 0 ? trimmed.slice(1, close) : trimmed.slice(1);
1524
- }
1525
- else if ((trimmed.match(/:/g) || []).length >= 2) {
1526
- // Bare IPv6 (multiple colons, no brackets): ::1 → ::1
1527
- hostname = trimmed;
1528
- }
1529
- else {
1530
- // IPv4 or hostname: localhost:31337 → localhost
1531
- hostname = stripOptionalHostPort(trimmed);
1532
- }
1533
- if (!hostname)
1534
- return true;
1535
- const bindHost = resolveApiBindHost(process.env).toLowerCase();
1536
- // When binding on all interfaces (0.0.0.0 / ::), any Host is acceptable —
1537
- // ensureApiTokenForBindHost already enforces a token for non-loopback binds.
1538
- if (WILDCARD_BIND_RE.test(stripOptionalHostPort(bindHost))) {
1539
- return true;
1540
- }
1541
- // Allow the exact configured bind hostname.
1542
- if (bindHost && hostname === stripOptionalHostPort(bindHost)) {
1543
- return true;
1544
- }
1545
- for (const allowedHost of resolveAllowedHosts(process.env)) {
1546
- if (stripOptionalHostPort(allowedHost).toLowerCase() === hostname) {
1547
- return true;
1548
- }
1549
- }
1550
- return LOCAL_HOST_RE.test(hostname);
1551
- }
1552
- export function resolveCorsOrigin(origin) {
1553
- if (!origin)
1554
- return null;
1555
- const trimmed = origin.trim();
1556
- if (!trimmed)
1557
- return null;
1558
- // Cloud-provisioned containers default to allowing all origins so the
1559
- // browser web UI can reach the agent API without extra config.
1560
- if (process.env.ELIZA_CLOUD_PROVISIONED === "1") {
1561
- return trimmed;
1562
- }
1563
- // When bound to a wildcard address, allow any origin. Non-loopback binds still
1564
- // require an explicit token, so this only relaxes the browser origin check.
1565
- const bindHost = resolveApiBindHost(process.env).toLowerCase();
1566
- if (WILDCARD_BIND_RE.test(stripOptionalHostPort(bindHost)))
1567
- return trimmed;
1568
- // Explicit allowlist via env (comma-separated)
1569
- const allow = resolveAllowedOrigins(process.env);
1570
- if (allow.includes(trimmed)) {
1571
- return trimmed;
1572
- }
1573
- if (LOCAL_ORIGIN_RE.test(trimmed))
1574
- return trimmed;
1575
- if (APP_ORIGIN_RE.test(trimmed))
1576
- return trimmed;
1577
- if (trimmed === "null" || trimmed === "file://") {
1578
- if (isNullOriginAllowed(process.env)) {
1579
- return "null";
1580
- }
1581
- }
1582
- return null;
1583
- }
1584
- function isBrowserCompanionExtensionOrigin(origin) {
1585
- if (!origin) {
1586
- return false;
1587
- }
1588
- const trimmed = origin.trim();
1589
- return (/^chrome-extension:\/\/[a-z]{32}$/i.test(trimmed) ||
1590
- /^moz-extension:\/\/[0-9a-f-]+$/i.test(trimmed) ||
1591
- /^safari-web-extension:\/\/[A-Za-z0-9.-]+$/i.test(trimmed));
1592
- }
1593
- function applyCors(req, res, pathname) {
1594
- const origin = typeof req.headers.origin === "string" ? req.headers.origin : undefined;
1595
- const allowBrowserCompanionOrigin = pathname.startsWith("/api/lifeops/browser/companions/") &&
1596
- isBrowserCompanionExtensionOrigin(origin);
1597
- const allowed = allowBrowserCompanionOrigin
1598
- ? (origin?.trim() ?? null)
1599
- : resolveCorsOrigin(origin);
1600
- if (origin && !allowed)
1601
- return false;
1602
- if (allowed) {
1603
- res.setHeader("Access-Control-Allow-Origin", allowed);
1604
- res.setHeader("Vary", "Origin");
1605
- res.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
1606
- res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Eliza-Token, X-Api-Key, X-Eliza-Export-Token, X-Eliza-Client-Id, X-Eliza-Terminal-Token, X-Eliza-UI-Language, X-Eliza-Browser-Companion-Id");
1607
- }
1608
- // Security headers
1609
- res.setHeader("X-Content-Type-Options", "nosniff");
1610
- res.setHeader("X-Frame-Options", "DENY");
1611
- res.setHeader("X-XSS-Protection", "1; mode=block");
1612
- res.setHeader("Referrer-Policy", "strict-origin-when-cross-origin");
1613
- return true;
1614
- }
1615
- const PAIRING_TTL_MS = 10 * 60 * 1000;
1616
- const PAIRING_WINDOW_MS = 10 * 60 * 1000;
1617
- const PAIRING_MAX_ATTEMPTS = 5;
1618
- const PAIRING_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
1619
- let pairingCode = null;
680
+ // Auth, CORS, pairing, terminal, WebSocket auth helpers extracted to server-helpers-auth.ts
681
+ import { applyCors as _applyCors, clearPairing as _clearPairing, ensureApiTokenForBindHost as _ensureApiTokenForBindHost, ensurePairingCode as _ensurePairingCode, extractAuthToken as _extractAuthToken, getConfiguredApiToken as _getConfiguredApiToken, getPairingExpiresAt as _getPairingExpiresAt, isAllowedHost as _isAllowedHost, isAuthorized as _isAuthorized, isSharedTerminalClientId as _isSharedTerminalClientId, isWebSocketAuthorized as _isWebSocketAuthorized, normalizePairingCode as _normalizePairingCode, normalizeWsClientId as _normalizeWsClientId, pairingEnabled as _pairingEnabled, rateLimitPairing as _rateLimitPairing, rejectWebSocketUpgrade as _rejectWebSocketUpgrade, resolveCorsOrigin as _resolveCorsOrigin, resolveTerminalRunClientId as _resolveTerminalRunClientId, resolveTerminalRunRejection as _resolveTerminalRunRejection, resolveWebSocketUpgradeRejection as _resolveWebSocketUpgradeRejection, } from "./server-helpers-auth.js";
682
+ export { ensureApiTokenForBindHost, extractAuthToken, isAllowedHost, isAuthorized, normalizeWsClientId, resolveCorsOrigin, resolveTerminalRunClientId, resolveTerminalRunRejection, resolveWebSocketUpgradeRejection, } from "./server-helpers-auth.js";
683
+ const isAllowedHost = _isAllowedHost;
684
+ const resolveCorsOrigin = _resolveCorsOrigin;
685
+ const applyCors = _applyCors;
686
+ const extractAuthToken = _extractAuthToken;
687
+ const isAuthorized = _isAuthorized;
688
+ const ensureApiTokenForBindHost = _ensureApiTokenForBindHost;
689
+ const normalizeWsClientId = _normalizeWsClientId;
690
+ const resolveTerminalRunClientId = _resolveTerminalRunClientId;
691
+ const isSharedTerminalClientId = _isSharedTerminalClientId;
692
+ const resolveTerminalRunRejection = _resolveTerminalRunRejection;
693
+ const resolveWebSocketUpgradeRejection = _resolveWebSocketUpgradeRejection;
694
+ const rejectWebSocketUpgrade = _rejectWebSocketUpgrade;
695
+ const isWebSocketAuthorized = _isWebSocketAuthorized;
696
+ const getConfiguredApiToken = _getConfiguredApiToken;
697
+ const pairingEnabled = _pairingEnabled;
698
+ const ensurePairingCode = _ensurePairingCode;
699
+ const normalizePairingCode = _normalizePairingCode;
700
+ const rateLimitPairing = _rateLimitPairing;
701
+ const getPairingExpiresAt = _getPairingExpiresAt;
702
+ const clearPairing = _clearPairing;
1620
703
  /** Guard against concurrent provider switch requests (P0 §3). */
1621
704
  let providerSwitchInProgress = false;
1622
- let pairingExpiresAt = 0;
1623
- const pairingAttempts = new Map();
1624
- function pairingEnabled() {
1625
- return (Boolean(getConfiguredApiToken()) &&
1626
- process.env.ELIZA_PAIRING_DISABLED !== "1");
1627
- }
1628
- function normalizePairingCode(code) {
1629
- return code.replace(/[^a-zA-Z0-9]/g, "").toUpperCase();
1630
- }
1631
- function generatePairingCode() {
1632
- const bytes = crypto.randomBytes(8);
1633
- let raw = "";
1634
- for (let i = 0; i < bytes.length; i++) {
1635
- raw += PAIRING_ALPHABET[bytes[i] % PAIRING_ALPHABET.length];
1636
- }
1637
- return `${raw.slice(0, 4)}-${raw.slice(4, 8)}`;
1638
- }
1639
- function ensurePairingCode() {
1640
- if (!pairingEnabled())
1641
- return null;
1642
- const now = Date.now();
1643
- if (!pairingCode || now > pairingExpiresAt) {
1644
- pairingCode = generatePairingCode();
1645
- pairingExpiresAt = now + PAIRING_TTL_MS;
1646
- logger.warn(`[eliza-api] Pairing code: ${pairingCode} (valid for 10 minutes)`);
1647
- }
1648
- return pairingCode;
1649
- }
1650
- function rateLimitPairing(ip) {
1651
- const key = ip ?? "unknown";
1652
- const now = Date.now();
1653
- // Lazy sweep: evict expired entries when map grows beyond 100
1654
- sweepExpiredEntries(pairingAttempts, now, 100);
1655
- const current = pairingAttempts.get(key);
1656
- if (!current || now > current.resetAt) {
1657
- pairingAttempts.set(key, { count: 1, resetAt: now + PAIRING_WINDOW_MS });
1658
- return true;
1659
- }
1660
- if (current.count >= PAIRING_MAX_ATTEMPTS)
1661
- return false;
1662
- current.count += 1;
1663
- return true;
1664
- }
1665
- export function extractAuthToken(req) {
1666
- const auth = typeof req.headers.authorization === "string"
1667
- ? req.headers.authorization.trim()
1668
- : "";
1669
- if (auth) {
1670
- const match = /^Bearer\s+(.+)$/i.exec(auth);
1671
- if (match?.[1])
1672
- return match[1].trim();
1673
- }
1674
- const header = (typeof req.headers["x-eliza-token"] === "string" &&
1675
- req.headers["x-eliza-token"]) ||
1676
- (typeof req.headers["x-eliza-token"] === "string" &&
1677
- req.headers["x-eliza-token"]) ||
1678
- (typeof req.headers["x-api-key"] === "string" && req.headers["x-api-key"]);
1679
- if (typeof header === "string" && header.trim())
1680
- return header.trim();
1681
- return null;
1682
- }
1683
- const SAFE_WS_CLIENT_ID_RE = /^[A-Za-z0-9._-]{1,128}$/;
1684
- export function normalizeWsClientId(value) {
1685
- if (typeof value !== "string")
1686
- return null;
1687
- const trimmed = value.trim();
1688
- if (!trimmed)
1689
- return null;
1690
- if (!SAFE_WS_CLIENT_ID_RE.test(trimmed))
1691
- return null;
1692
- return trimmed;
1693
- }
1694
- function firstHeaderValue(value) {
1695
- if (typeof value === "string")
1696
- return value;
1697
- if (Array.isArray(value) && typeof value[0] === "string")
1698
- return value[0];
1699
- return null;
1700
- }
1701
- export function resolveTerminalRunClientId(req, body) {
1702
- const headerClientId = normalizeWsClientId(firstHeaderValue(req.headers["x-eliza-client-id"]));
1703
- if (headerClientId)
1704
- return headerClientId;
1705
- return normalizeWsClientId(body?.clientId);
1706
- }
1707
- const SHARED_TERMINAL_CLIENT_IDS = new Set([
1708
- "runtime-terminal-action",
1709
- "runtime-shell-action",
1710
- ]);
1711
- function isSharedTerminalClientId(clientId) {
1712
- return SHARED_TERMINAL_CLIENT_IDS.has(clientId);
1713
- }
1714
- function tokenMatches(expected, provided) {
1715
- const a = Buffer.from(expected, "utf8");
1716
- const b = Buffer.from(provided, "utf8");
1717
- if (a.length !== b.length)
1718
- return false;
1719
- return crypto.timingSafeEqual(a, b);
1720
- }
1721
- function getConfiguredApiToken() {
1722
- return resolveApiToken(process.env) ?? undefined;
1723
- }
1724
- function isLoopbackBindHost(host) {
1725
- let normalized = host.trim().toLowerCase();
1726
- if (!normalized)
1727
- return true;
1728
- // Allow users to provide full URLs by mistake (e.g. http://localhost:2138)
1729
- if (normalized.startsWith("http://") || normalized.startsWith("https://")) {
1730
- try {
1731
- const parsed = new URL(normalized);
1732
- normalized = parsed.hostname.toLowerCase();
1733
- }
1734
- catch {
1735
- // Fall through and parse as raw host value.
1736
- }
1737
- }
1738
- // [::1]:2138 -> ::1
1739
- const bracketedIpv6 = /^\[([^\]]+)\](?::\d+)?$/.exec(normalized);
1740
- if (bracketedIpv6?.[1]) {
1741
- normalized = bracketedIpv6[1];
1742
- }
1743
- else {
1744
- // localhost:2138 -> localhost, 127.0.0.1:2138 -> 127.0.0.1
1745
- const singleColonHostPort = /^([^:]+):(\d+)$/.exec(normalized);
1746
- if (singleColonHostPort?.[1]) {
1747
- normalized = singleColonHostPort[1];
1748
- }
1749
- }
1750
- normalized = normalized.replace(/^\[|\]$/g, "");
1751
- if (!normalized)
1752
- return true;
1753
- if (normalized === "localhost" ||
1754
- normalized === "::1" ||
1755
- normalized === "0:0:0:0:0:0:0:1" ||
1756
- normalized === "::ffff:127.0.0.1") {
1757
- return true;
1758
- }
1759
- if (normalized.startsWith("127."))
1760
- return true;
1761
- return false;
1762
- }
1763
- export function ensureApiTokenForBindHost(host) {
1764
- const { disableAutoApiToken } = resolveApiSecurityConfig(process.env);
1765
- const token = getConfiguredApiToken();
1766
- if (token)
1767
- return;
1768
- const cloudProvisioned = isCloudProvisionedContainer();
1769
- // Cloud-provisioned containers must never run without an inbound API token
1770
- // (isAuthorized rejects all requests when no token + cloud flag is set).
1771
- // Override the disable flag for cloud containers so they always get a
1772
- // fallback token rather than dead-locking into 401 on every request.
1773
- if (disableAutoApiToken && !cloudProvisioned) {
1774
- return;
1775
- }
1776
- if (!cloudProvisioned && isLoopbackBindHost(host))
1777
- return;
1778
- const generated = crypto.randomBytes(32).toString("hex");
1779
- setApiToken(process.env, generated);
1780
- if (cloudProvisioned) {
1781
- logger.warn("[eliza-api] Steward-managed cloud container started without ELIZA_API_TOKEN/ELIZA_API_TOKEN; generated a temporary inbound API token for this process.");
1782
- }
1783
- else {
1784
- logger.warn(`[eliza-api] ELIZA_API_BIND/ELIZA_API_BIND=${host} is non-loopback and ELIZA_API_TOKEN/ELIZA_API_TOKEN is unset.`);
1785
- }
1786
- const tokenFingerprint = `${generated.slice(0, 4)}...${generated.slice(-4)}`;
1787
- logger.warn(`[eliza-api] Generated temporary API token (${tokenFingerprint}) for this process. Set ELIZA_API_TOKEN or ELIZA_API_TOKEN explicitly to override.`);
1788
- }
1789
- export function isAuthorized(req) {
1790
- const expected = getConfiguredApiToken();
1791
- if (!expected)
1792
- return !isCloudProvisionedContainer();
1793
- const provided = extractAuthToken(req);
1794
- if (!provided)
1795
- return false;
1796
- return tokenMatches(expected, provided);
1797
- }
1798
- export function resolvePluginConfigMutationRejections(pluginParams, config) {
1799
- const allowedParamKeys = new Set(pluginParams.map((p) => p.key.toUpperCase().trim()));
1800
- const rejections = [];
1801
- for (const key of Object.keys(config)) {
1802
- const normalized = key.toUpperCase().trim();
1803
- if (!allowedParamKeys.has(normalized)) {
1804
- rejections.push({
1805
- field: key,
1806
- message: `${key} is not a declared config key for this plugin`,
1807
- });
1808
- continue;
1809
- }
1810
- if (BLOCKED_ENV_KEYS.has(normalized)) {
1811
- rejections.push({
1812
- field: key,
1813
- message: `${key} is blocked for security reasons`,
1814
- });
1815
- }
1816
- }
1817
- return rejections;
1818
- }
1819
- export function resolveWalletExportRejection(req, body) {
1820
- if (!body.confirm) {
1821
- return {
1822
- status: 403,
1823
- reason: 'Export requires explicit confirmation. Send { "confirm": true } in the request body.',
1824
- };
1825
- }
1826
- const expected = process.env.ELIZA_WALLET_EXPORT_TOKEN?.trim() ||
1827
- process.env.ELIZA_WALLET_EXPORT_TOKEN?.trim();
1828
- if (!expected) {
1829
- return {
1830
- status: 403,
1831
- reason: "Wallet export is disabled. Set ELIZA_WALLET_EXPORT_TOKEN (or ELIZA_WALLET_EXPORT_TOKEN) to enable secure exports.",
1832
- };
1833
- }
1834
- const headerToken = typeof req.headers["x-eliza-export-token"] === "string"
1835
- ? req.headers["x-eliza-export-token"].trim()
1836
- : "";
1837
- const bodyToken = typeof body.exportToken === "string" ? body.exportToken.trim() : "";
1838
- const provided = headerToken || bodyToken;
1839
- if (!provided) {
1840
- return {
1841
- status: 401,
1842
- reason: "Missing export token. Provide X-Eliza-Export-Token header or exportToken in request body.",
1843
- };
1844
- }
1845
- if (!tokenMatches(expected, provided)) {
1846
- return { status: 401, reason: "Invalid export token." };
1847
- }
1848
- return null;
1849
- }
1850
- export function resolveTerminalRunRejection(req, body) {
1851
- const expected = process.env.ELIZA_TERMINAL_RUN_TOKEN?.trim();
1852
- const apiTokenEnabled = Boolean(getConfiguredApiToken());
1853
- // Compatibility mode: local loopback sessions without API token keep
1854
- // existing behavior unless an explicit terminal token is configured.
1855
- if (!expected && !apiTokenEnabled) {
1856
- return null;
1857
- }
1858
- if (!expected) {
1859
- return {
1860
- status: 403,
1861
- reason: "Terminal run is disabled for token-authenticated API sessions. Set ELIZA_TERMINAL_RUN_TOKEN to enable command execution.",
1862
- };
1863
- }
1864
- const headerToken = typeof req.headers["x-eliza-terminal-token"] === "string"
1865
- ? req.headers["x-eliza-terminal-token"].trim()
1866
- : "";
1867
- const bodyToken = typeof body.terminalToken === "string" ? body.terminalToken.trim() : "";
1868
- const provided = headerToken || bodyToken;
1869
- if (!provided) {
1870
- return {
1871
- status: 401,
1872
- reason: "Missing terminal token. Provide X-Eliza-Terminal-Token header or terminalToken in request body.",
1873
- };
1874
- }
1875
- if (!tokenMatches(expected, provided)) {
1876
- return {
1877
- status: 401,
1878
- reason: "Invalid terminal token.",
1879
- };
1880
- }
1881
- return null;
1882
- }
1883
- function extractWsQueryToken(url) {
1884
- const allowQueryToken = process.env.ELIZA_ALLOW_WS_QUERY_TOKEN === "1";
1885
- if (!allowQueryToken)
1886
- return null;
1887
- const token = url.searchParams.get("token") ??
1888
- url.searchParams.get("apiKey") ??
1889
- url.searchParams.get("api_key");
1890
- return token?.trim() || null;
1891
- }
1892
- function hasWsQueryToken(url) {
1893
- return (url.searchParams.has("token") ||
1894
- url.searchParams.has("apiKey") ||
1895
- url.searchParams.has("api_key"));
1896
- }
1897
- function extractWebSocketHandshakeToken(request, url) {
1898
- const headerToken = extractAuthToken(request);
1899
- if (headerToken)
1900
- return headerToken;
1901
- return extractWsQueryToken(url);
1902
- }
1903
- function isWebSocketAuthorized(request, url) {
1904
- const expected = getConfiguredApiToken();
1905
- if (!expected)
1906
- return !isCloudProvisionedContainer();
1907
- const handshakeToken = extractWebSocketHandshakeToken(request, url);
1908
- if (!handshakeToken)
1909
- return false;
1910
- return tokenMatches(expected, handshakeToken);
1911
- }
1912
- export function resolveWebSocketUpgradeRejection(req, wsUrl) {
1913
- if (wsUrl.pathname !== "/ws") {
1914
- return { status: 404, reason: "Not found" };
1915
- }
1916
- const origin = typeof req.headers.origin === "string" ? req.headers.origin : undefined;
1917
- const allowedOrigin = resolveCorsOrigin(origin);
1918
- if (origin && !allowedOrigin) {
1919
- return { status: 403, reason: "Origin not allowed" };
1920
- }
1921
- const expected = getConfiguredApiToken();
1922
- if (!expected) {
1923
- return isCloudProvisionedContainer()
1924
- ? { status: 401, reason: "Unauthorized" }
1925
- : null;
1926
- }
1927
- if (process.env.ELIZA_ALLOW_WS_QUERY_TOKEN !== "1" &&
1928
- hasWsQueryToken(wsUrl)) {
1929
- return { status: 401, reason: "Unauthorized" };
1930
- }
1931
- const handshakeToken = extractWebSocketHandshakeToken(req, wsUrl);
1932
- if (handshakeToken && !tokenMatches(expected, handshakeToken)) {
1933
- return { status: 401, reason: "Unauthorized" };
1934
- }
1935
- // Cloud containers must authenticate at the handshake level because there is
1936
- // no trusted upstream proxy handling auth for the WebSocket path.
1937
- if (!handshakeToken && isCloudProvisionedContainer()) {
1938
- return { status: 401, reason: "Unauthorized" };
1939
- }
1940
- return null;
1941
- }
1942
- const RESET_STATE_ALLOWED_SEGMENTS = new Set([
1943
- ".eliza",
1944
- "eliza",
1945
- ".eliza",
1946
- "eliza",
1947
- ]);
1948
- function hasAllowedResetSegment(resolvedState) {
1949
- return resolvedState
1950
- .split(path.sep)
1951
- .some((segment) => RESET_STATE_ALLOWED_SEGMENTS.has(segment.trim().toLowerCase()));
1952
- }
1953
- export function isSafeResetStateDir(resolvedState, homeDir) {
1954
- const normalizedState = path.resolve(resolvedState);
1955
- const normalizedHome = path.resolve(homeDir);
1956
- const parsedRoot = path.parse(normalizedState).root;
1957
- if (normalizedState === parsedRoot)
1958
- return false;
1959
- if (normalizedState === normalizedHome)
1960
- return false;
1961
- const relativeToHome = path.relative(normalizedHome, normalizedState);
1962
- const isUnderHome = relativeToHome.length > 0 &&
1963
- !relativeToHome.startsWith("..") &&
1964
- !path.isAbsolute(relativeToHome);
1965
- if (!isUnderHome)
1966
- return false;
1967
- return hasAllowedResetSegment(normalizedState);
1968
- }
1969
- // persistConversationRoomTitle imported in the consolidated import at the top
1970
- function rejectWebSocketUpgrade(socket, statusCode, message) {
1971
- const statusText = statusCode === 401
1972
- ? "Unauthorized"
1973
- : statusCode === 403
1974
- ? "Forbidden"
1975
- : statusCode === 404
1976
- ? "Not Found"
1977
- : "Bad Request";
1978
- const body = `${message}\n`;
1979
- socket.write(`HTTP/1.1 ${statusCode} ${statusText}\r\n` +
1980
- "Connection: close\r\n" +
1981
- "Content-Type: text/plain; charset=utf-8\r\n" +
1982
- `Content-Length: ${Buffer.byteLength(body)}\r\n` +
1983
- "\r\n" +
1984
- body, () => socket.end());
1985
- }
705
+ // PluginConfigMutationRejection, resolvePluginConfigMutationRejections,
706
+ // WalletExportRejection, resolveWalletExportRejection
707
+ // extracted to server-helpers-plugin.ts and server-helpers-wallet.ts respectively.
708
+ // Re-exported above.
709
+ // Terminal/WS/state-dir helpers extracted to server-helpers-auth.ts; re-exported above.
1986
710
  // decodePathComponent imported in the consolidated import at the top
1987
711
  // Workbench task/todo helpers — extracted to workbench-helpers.ts
1988
712
  import { asObject, normalizeTags, parseNullableNumber, readTaskCompleted, readTaskMetadata, toWorkbenchTask, toWorkbenchTodo, WORKBENCH_TASK_TAG, WORKBENCH_TODO_TAG, } from "./workbench-helpers.js";
1989
713
  const _WORKBENCH_TASK_TAG = WORKBENCH_TASK_TAG;
1990
714
  const _WORKBENCH_TODO_TAG = WORKBENCH_TODO_TAG;
1991
715
  // (workbench helpers moved to workbench-helpers.ts)
1992
- // ── Autonomy User message routing ──────────────────────────────────
1993
- /**
1994
- * Route non-conversation text output to the user's active conversation.
1995
- * Stores the message as a Memory in the conversation room and broadcasts
1996
- * a `proactive-message` WS event to the frontend.
1997
- */
716
+ // ── Autonomy / swarm / coding-agent helpers — extracted to server-helpers-swarm.ts ──
717
+ import { routeAutonomyTextToUser as _routeAutonomyTextToUser } from "./server-helpers-swarm.js";
718
+ export { routeAutonomyTextToUser } from "./server-helpers-swarm.js";
719
+ const routeAutonomyTextToUser = _routeAutonomyTextToUser;
720
+ // The full autonomy/swarm/coordinator/PTY bridge implementations are now in
721
+ // server-helpers-swarm.ts. Only a compat stub remains for type checking.
1998
722
  const CHAT_SUPPRESSED_AUTONOMY_SOURCES = new Set([
1999
723
  "lifeops-reminder",
2000
724
  "lifeops-workflow",
@@ -2002,7 +726,7 @@ const CHAT_SUPPRESSED_AUTONOMY_SOURCES = new Set([
2002
726
  "proactive-gn",
2003
727
  "proactive-nudge",
2004
728
  ]);
2005
- export async function routeAutonomyTextToUser(state, responseText, source = "autonomy") {
729
+ async function _routeAutonomyTextToUserCompat(state, responseText, source = "autonomy") {
2006
730
  const runtime = state.runtime;
2007
731
  if (!runtime)
2008
732
  return;
@@ -2137,19 +861,28 @@ function wireCodingAgentWsBridge(st) {
2137
861
  * persisted message in the conversation.
2138
862
  */
2139
863
  function wireCodingAgentSwarmSynthesis(st) {
2140
- // Same rationale as wireCodingAgentChatBridge: synthesis is generated
2141
- // from task metadata (originalTask = user's text), not from the
2142
- // subagent's actual output. The task-progress-streamer + jsonl watcher
2143
- // deliver the real answer. Install a no-op callback so the upstream
2144
- // wiring check considers this bridge wired.
864
+ // The task-progress-streamer was removed from this tree but the callback
865
+ // was left as a no-op, so subagent completions never reached the user.
866
+ // Invoke handleSwarmSynthesis directly so the synthesis LLM routes the
867
+ // final answer back to the conversation. The task jsonl is already the
868
+ // source of truth for per-task completionSummary.
2145
869
  if (!st.runtime)
2146
870
  return false;
2147
871
  const coordinator = getCoordinatorFromRuntime(st.runtime);
2148
872
  if (!coordinator?.setSwarmCompleteCallback)
2149
873
  return false;
2150
- coordinator.setSwarmCompleteCallback(async () => {
2151
- // Deliberately no-op — synthesis happens via the streamer instead.
874
+ coordinator.setSwarmCompleteCallback(async (payload) => {
875
+ await handleSwarmSynthesis(st, payload);
2152
876
  });
877
+ // Same wiring path — install the task heartbeat so sessions running past
878
+ // 45s emit periodic "still working" pings that report the subagent's
879
+ // current tool activity. Synthesis delivers the final answer; heartbeat
880
+ // just tells the user the task is alive and moving.
881
+ const ptyService = st.runtime.getService("PTY_SERVICE");
882
+ if (ptyService) {
883
+ installTaskHeartbeat(st.runtime, ptyService);
884
+ logger.info("[task-heartbeat] installed");
885
+ }
2153
886
  return true;
2154
887
  }
2155
888
  /**
@@ -2167,23 +900,38 @@ export async function handleSwarmSynthesis(st, payload, routeMessage = (text, so
2167
900
  return;
2168
901
  }
2169
902
  logger.info(`[swarm-synthesis] Generating synthesis for ${payload.total} tasks (${payload.completed} completed, ${payload.stopped} stopped, ${payload.errored} errored)`);
2170
- const resultText = await buildSynthesisResultText(payload);
2171
- logger.info("[swarm-synthesis] Synthesis generated, routing to user");
2172
- await routeMessage(resultText, "swarm_synthesis");
2173
- await routeSynthesisToConnector(runtime, resultText);
903
+ const resultText = await buildSynthesisResultText(payload, runtime);
904
+ logger.info(`[swarm-synthesis] Synthesis generated (${resultText.length} chars), routing to user — preview: ${resultText.slice(0, 200).replace(/\n/g, " | ")}`);
905
+ // Route back to the originating chat channel via the roomId captured on
906
+ // the incoming user message (propagated through the task payload).
907
+ const roomId = payload.tasks.find((t) => t.roomId)?.roomId ?? null;
908
+ // Discord's per-message limit is 2000 chars. Deliver long answers as
909
+ // sequential chunks so the subagent's full output reaches the user.
910
+ for (const chunk of chunkForDiscord(resultText, 1900)) {
911
+ await routeMessage(chunk, "swarm_synthesis");
912
+ await routeSynthesisToConnector(runtime, chunk, roomId);
913
+ }
914
+ }
915
+ async function buildSynthesisResultText(payload, runtime) {
916
+ const parts = await Promise.all(payload.tasks.map((task) => buildTaskLine(task, runtime)));
917
+ if (parts.length === 1)
918
+ return parts[0];
919
+ return `done — ${parts.length} tasks:\n${parts.map((p) => `• ${p}`).join("\n")}`;
2174
920
  }
2175
921
  /**
2176
- * Build the user-facing result message from swarm task data.
2177
- * For port-bound tasks, verifies the server is actually listening.
2178
- * No LLM call required task data already has what we need.
922
+ * Deliver the subagent's actual final answer the last end_turn assistant
923
+ * text from its session jsonl. Trust the agent to already have produced
924
+ * a coherent response; synthesis does not rewrite or trim it. Falls back
925
+ * to completionSummary, then a port-status check, then the original
926
+ * prompt text when no jsonl is available.
2179
927
  */
2180
- async function buildSynthesisResultText(payload) {
2181
- const parts = await Promise.all(payload.tasks.map(buildTaskResultLine));
2182
- return parts.length === 1
2183
- ? `done ${parts[0]}`
2184
- : `done — ${payload.total} tasks:\n${parts.map((p) => `• ${p}`).join("\n")}`;
2185
- }
2186
- async function buildTaskResultLine(task) {
928
+ async function buildTaskLine(task, runtime) {
929
+ const workdir = task.workdir ?? resolveSessionWorkdir(runtime, task.sessionId);
930
+ if (workdir) {
931
+ const assistantText = await readLastAssistantTextFromJsonl(workdir);
932
+ if (assistantText)
933
+ return assistantText;
934
+ }
2187
935
  if (task.completionSummary)
2188
936
  return task.completionSummary;
2189
937
  const portMatch = task.originalTask.match(/port\s+(\d+)/i);
@@ -2196,6 +944,10 @@ async function buildTaskResultLine(task) {
2196
944
  }
2197
945
  return `built the files but server isn't running on port ${port} yet`;
2198
946
  }
947
+ function resolveSessionWorkdir(runtime, sessionId) {
948
+ const ptyService = runtime.getService("PTY_SERVICE");
949
+ return ptyService?.getSession?.(sessionId)?.workdir ?? null;
950
+ }
2199
951
  async function isPortServing(port) {
2200
952
  try {
2201
953
  const res = await fetch(`http://localhost:${port}/`, {
@@ -2212,15 +964,17 @@ async function isPortServing(port) {
2212
964
  * via the runtime's registered send handler. Uses the source room ID stored
2213
965
  * on the coordinator when the task was created.
2214
966
  */
2215
- async function routeSynthesisToConnector(runtime, resultText) {
2216
- const coordinator = getCoordinatorFromRuntime(runtime);
2217
- const sourceRoomId = coordinator?.sourceRoomId;
2218
- if (!sourceRoomId)
967
+ async function routeSynthesisToConnector(runtime, resultText, roomId) {
968
+ if (!roomId) {
969
+ logger.debug("[swarm-synthesis] No roomId available — cannot route to connector");
2219
970
  return;
971
+ }
2220
972
  try {
2221
- const room = await runtime.getRoom(sourceRoomId);
2222
- if (!room?.source)
973
+ const room = await runtime.getRoom(roomId);
974
+ if (!room?.source) {
975
+ logger.debug(`[swarm-synthesis] Room ${roomId} has no source connector — cannot route`);
2223
976
  return;
977
+ }
2224
978
  await runtime.sendMessageToTarget({
2225
979
  source: room.source,
2226
980
  roomId: room.id,
@@ -2230,9 +984,11 @@ async function routeSynthesisToConnector(runtime, resultText) {
2230
984
  logger.info(`[swarm-synthesis] Routed result to ${room.source} room ${room.id}`);
2231
985
  }
2232
986
  catch (err) {
2233
- logger.debug(`[swarm-synthesis] Connector routing failed: ${err}`);
987
+ logger.warn(`[swarm-synthesis] Connector routing failed: ${err}`);
2234
988
  }
2235
989
  }
990
+ import { chunkForDiscord, readLastAssistantTextFromJsonl, } from "../runtime/subagent-output.js";
991
+ import { installTaskHeartbeat } from "../runtime/task-heartbeat.js";
2236
992
  // ── Parse Action Block from Eliza's Response ─────────────────────────
2237
993
  import { parseActionBlock, stripActionBlockFromDisplay, } from "./parse-action-block.js";
2238
994
  // ── Coordinator Event Routing ───────────────────────────────────────────
@@ -2586,7 +1342,7 @@ async function handleCodingAgentsFallback(runtime, pathname, method, req, res) {
2586
1342
  break;
2587
1343
  }
2588
1344
  }
2589
- const { normalizePreflightAuth } = await import("./coding-agents-preflight-normalize");
1345
+ const { normalizePreflightAuth } = await import("@elizaos/app-task-coordinator/api/coding-agents-preflight-normalize");
2590
1346
  const normalized = rows.flatMap((item) => {
2591
1347
  if (!item || typeof item !== "object")
2592
1348
  return [];
@@ -2881,7 +1637,7 @@ async function handleCodingAgentsFallback(runtime, pathname, method, req, res) {
2881
1637
  else {
2882
1638
  // Whitelist + URL-scheme-validate before forwarding to the
2883
1639
  // browser. See `coding-agents-auth-sanitize.ts` for rationale.
2884
- const { sanitizeAuthResult } = await import("./coding-agents-auth-sanitize");
1640
+ const { sanitizeAuthResult } = await import("@elizaos/app-task-coordinator/api/coding-agents-auth-sanitize");
2885
1641
  json(res, sanitizeAuthResult(triggered));
2886
1642
  }
2887
1643
  }
@@ -3131,11 +1887,8 @@ async function handleRequest(req, res, state, ctx) {
3131
1887
  ensurePairingCode,
3132
1888
  normalizePairingCode,
3133
1889
  rateLimitPairing,
3134
- getPairingExpiresAt: () => pairingExpiresAt,
3135
- clearPairing: () => {
3136
- pairingCode = null;
3137
- pairingExpiresAt = 0;
3138
- },
1890
+ getPairingExpiresAt,
1891
+ clearPairing,
3139
1892
  })) {
3140
1893
  return;
3141
1894
  }
@@ -3219,17 +1972,17 @@ async function handleRequest(req, res, state, ctx) {
3219
1972
  readJsonBody,
3220
1973
  json,
3221
1974
  error,
3222
- executeTriggerTask: executeTriggerTask,
1975
+ executeTriggerTask,
3223
1976
  getTriggerHealthSnapshot,
3224
- getTriggerLimit: getTriggerLimit,
3225
- listTriggerTasks: listTriggerTasks,
1977
+ getTriggerLimit,
1978
+ listTriggerTasks,
3226
1979
  readTriggerConfig,
3227
1980
  readTriggerRuns,
3228
- taskToTriggerSummary: taskToTriggerSummary,
1981
+ taskToTriggerSummary,
3229
1982
  triggersFeatureEnabled,
3230
- buildTriggerConfig: buildTriggerConfig,
3231
- buildTriggerMetadata: buildTriggerMetadata,
3232
- normalizeTriggerDraft: normalizeTriggerDraft,
1983
+ buildTriggerConfig,
1984
+ buildTriggerMetadata,
1985
+ normalizeTriggerDraft,
3233
1986
  DISABLED_TRIGGER_INTERVAL_MS,
3234
1987
  TRIGGER_TASK_NAME,
3235
1988
  TRIGGER_TASK_TAGS: [...TRIGGER_TASK_TAGS],
@@ -3446,7 +2199,23 @@ async function handleRequest(req, res, state, ctx) {
3446
2199
  }
3447
2200
  // ═══════════════════════════════════════════════════════════════════════
3448
2201
  // Skills routes (extracted to skills-routes.ts)
2202
+ // Curated-skills routes live at /api/skills/curated/* and must be dispatched
2203
+ // before the generic skills routes (which reject "/" in skill IDs).
3449
2204
  // ═══════════════════════════════════════════════════════════════════════
2205
+ if (pathname.startsWith("/api/skills/curated")) {
2206
+ if (await handleCuratedSkillsRoutes({
2207
+ req,
2208
+ res,
2209
+ method,
2210
+ pathname,
2211
+ url,
2212
+ json,
2213
+ error,
2214
+ readJsonBody,
2215
+ })) {
2216
+ return;
2217
+ }
2218
+ }
3450
2219
  if (pathname.startsWith("/api/skills")) {
3451
2220
  if (await handleSkillsRoutes({
3452
2221
  req,
@@ -3479,7 +2248,22 @@ async function handleRequest(req, res, state, ctx) {
3479
2248
  auditEventTypes: AUDIT_EVENT_TYPES,
3480
2249
  auditSeverities: AUDIT_SEVERITIES,
3481
2250
  getAuditFeedSize,
3482
- queryAuditFeed: (query) => queryAuditFeed(query),
2251
+ queryAuditFeed: (query) => queryAuditFeed({
2252
+ type: AUDIT_EVENT_TYPES.includes(query.type ?? "")
2253
+ ? query.type
2254
+ : undefined,
2255
+ severity: AUDIT_SEVERITIES.includes(query.severity ?? "")
2256
+ ? query.severity
2257
+ : undefined,
2258
+ sinceMs: query.sinceMs,
2259
+ limit: query.limit,
2260
+ }).map((entry) => ({
2261
+ timestamp: entry.timestamp,
2262
+ type: entry.type,
2263
+ summary: entry.summary,
2264
+ severity: entry.severity,
2265
+ metadata: entry.metadata,
2266
+ })),
3483
2267
  subscribeAuditFeed,
3484
2268
  })) {
3485
2269
  return;
@@ -3667,9 +2451,31 @@ async function handleRequest(req, res, state, ctx) {
3667
2451
  }
3668
2452
  // Telegram setup routes: now handled by @elizaos/plugin-telegram via
3669
2453
  // runtime plugin routes (rawPath: true). See plugin-telegram/src/setup-routes.ts.
3670
- // Telegram account routes (/api/telegram-account/*): now handled by
3671
- // @elizaos/plugin-telegram via runtime plugin routes (rawPath: true).
3672
- // See plugin-telegram/src/account-setup-routes.ts.
2454
+ // ── Telegram account routes (/api/telegram-account/*) ────────────────
2455
+ if (pathname.startsWith("/api/telegram-account")) {
2456
+ const routeState = {
2457
+ config: state.config,
2458
+ saveConfig: () => saveElizaConfig(state.config),
2459
+ runtime: state.runtime
2460
+ ? {
2461
+ getService: (type) => state.runtime.getService(type),
2462
+ getSetting: (key) => state.runtime.getSetting(key),
2463
+ }
2464
+ : undefined,
2465
+ telegramAccountAuthSession: state.telegramAccountAuthSession,
2466
+ };
2467
+ const handled = await handleTelegramAccountRoute(req, res, pathname, method, routeState, { json, error, readJsonBody }, {
2468
+ createAuthSession: (options) => new TelegramAccountAuthSession(options),
2469
+ authStateExists: telegramAccountAuthStateExists,
2470
+ sessionExists: telegramAccountSessionExists,
2471
+ clearAuthState: clearTelegramAccountAuthState,
2472
+ clearSession: clearTelegramAccountSession,
2473
+ });
2474
+ state.telegramAccountAuthSession =
2475
+ routeState.telegramAccountAuthSession ?? null;
2476
+ if (handled)
2477
+ return;
2478
+ }
3673
2479
  // ── Discord Local routes (/api/discord-local/*) — extracted to @elizaos/plugin-discord (setup-routes.ts) ──
3674
2480
  // ── Signal routes (/api/signal/*) — extracted to @elizaos/plugin-signal (setup-routes.ts) ──
3675
2481
  // ── Restart ──────────────────────────────────────────────────────────
@@ -4005,7 +2811,29 @@ async function handleRequest(req, res, state, ctx) {
4005
2811
  method,
4006
2812
  pathname,
4007
2813
  url,
4008
- appManager: state.appManager,
2814
+ appManager: {
2815
+ listAvailable: (pluginManager) => state.appManager.listAvailable(pluginManager),
2816
+ search: (pluginManager, query, limit) => state.appManager.search(pluginManager, query, limit),
2817
+ listInstalled: (pluginManager) => state.appManager.listInstalled(pluginManager),
2818
+ listRuns: (runtime) => state.appManager.listRuns(runtime && typeof runtime === "object"
2819
+ ? runtime
2820
+ : null),
2821
+ getRun: (runId, runtime) => state.appManager.getRun(runId, runtime && typeof runtime === "object"
2822
+ ? runtime
2823
+ : null),
2824
+ attachRun: (runId, runtime) => state.appManager.attachRun(runId, runtime && typeof runtime === "object"
2825
+ ? runtime
2826
+ : null),
2827
+ detachRun: (runId) => state.appManager.detachRun(runId),
2828
+ launch: (pluginManager, name, onProgress, runtime) => state.appManager.launch(pluginManager, name, onProgress, runtime && typeof runtime === "object"
2829
+ ? runtime
2830
+ : null),
2831
+ stop: (pluginManager, name, runId, runtime) => state.appManager.stop(pluginManager, name, runId, runtime && typeof runtime === "object"
2832
+ ? runtime
2833
+ : null),
2834
+ recordHeartbeat: (runId) => state.appManager.recordHeartbeat(runId),
2835
+ getInfo: (pluginManager, name) => state.appManager.getInfo(pluginManager, name),
2836
+ },
4009
2837
  getPluginManager: () => getPluginManagerForState(state),
4010
2838
  parseBoundedLimit,
4011
2839
  readJsonBody,
@@ -4309,6 +3137,13 @@ export async function startApiServer(opts) {
4309
3137
  if (state.runtime) {
4310
3138
  // AppManager doesn't need a runtime reference — it just installs plugins
4311
3139
  }
3140
+ // Start the periodic stale-run sweeper that stops app runs whose UI
3141
+ // heartbeat has gone silent (e.g. the user closed the tab without
3142
+ // pressing Stop). Without this, plugins that own a setInterval — like
3143
+ // the Defense-of-the-Agents game loop — would tick forever after the
3144
+ // browser disappeared. The sweeper invokes the same `stopRun` route
3145
+ // hook the Stop button uses so plugins have one shutdown path.
3146
+ state.appManager.startStaleRunSweeper(() => state.runtime);
4312
3147
  const addLog = (level, message, source = "system", tags = []) => {
4313
3148
  let resolvedSource = source;
4314
3149
  if (source === "auto" || source === "system") {
@@ -4362,7 +3197,8 @@ export async function startApiServer(opts) {
4362
3197
  * Returns true if patching was performed, false if already patched.
4363
3198
  */
4364
3199
  const patchLogger = (target, defaultSource, defaultTags) => {
4365
- if (target[PATCHED_MARKER]) {
3200
+ const patchedTarget = target;
3201
+ if (patchedTarget[PATCHED_MARKER]) {
4366
3202
  return false;
4367
3203
  }
4368
3204
  for (const lvl of LEVELS) {
@@ -4400,7 +3236,7 @@ export async function startApiServer(opts) {
4400
3236
  };
4401
3237
  target[lvl] = patched;
4402
3238
  }
4403
- target[PATCHED_MARKER] = true;
3239
+ patchedTarget[PATCHED_MARKER] = true;
4404
3240
  return true;
4405
3241
  };
4406
3242
  // 1) Patch the global @elizaos/core logger — this captures ALL log calls
@@ -5062,8 +3898,7 @@ export async function startApiServer(opts) {
5062
3898
  }
5063
3899
  state.conversations.set(convId, {
5064
3900
  id: convId,
5065
- title: room.name ||
5066
- "Chat",
3901
+ title: room.name || "Chat",
5067
3902
  roomId: room.id,
5068
3903
  createdAt: updatedAt,
5069
3904
  updatedAt,
@@ -5095,7 +3930,9 @@ export async function startApiServer(opts) {
5095
3930
  const overlayDbCharacter = async (rt, st) => {
5096
3931
  try {
5097
3932
  const dbAgent = await rt.getAgent(rt.agentId);
5098
- const agentRecord = dbAgent;
3933
+ const agentRecord = dbAgent && typeof dbAgent === "object" && !Array.isArray(dbAgent)
3934
+ ? Object.fromEntries(Object.entries(dbAgent))
3935
+ : null;
5099
3936
  const saved = agentRecord?.character;
5100
3937
  if (!saved || typeof saved !== "object")
5101
3938
  return;
@@ -5237,20 +4074,9 @@ export async function startApiServer(opts) {
5237
4074
  resolve({
5238
4075
  port: actualPort,
5239
4076
  close: async () => await new Promise((r) => {
5240
- const closeAllConnections = server.closeAllConnections;
5241
- const closeIdleConnections = server.closeIdleConnections;
5242
- const resolved = { done: false };
5243
- const finalize = () => {
5244
- if (!resolved.done) {
5245
- resolved.done = true;
5246
- r();
5247
- }
5248
- };
5249
- const closeTimeout = setTimeout(() => {
5250
- clearTimeout(closeTimeout);
5251
- finalize();
5252
- }, 5_000);
5253
4077
  void (async () => {
4078
+ const closeAllConnections = server.closeAllConnections;
4079
+ const closeIdleConnections = server.closeIdleConnections;
5254
4080
  clearInterval(statusInterval);
5255
4081
  if (state.connectorHealthMonitor) {
5256
4082
  state.connectorHealthMonitor.stop();
@@ -5270,13 +4096,49 @@ export async function startApiServer(opts) {
5270
4096
  }
5271
4097
  }
5272
4098
  wsClients.clear();
5273
- // WhatsApp pairing session cleanup now handled by
5274
- // @elizaos/plugin-whatsapp (stopAllPairingSessions).
5275
- // Signal pairing session cleanup now handled by
5276
- // @elizaos/plugin-signal (setup-routes module state).
5277
- // Telegram account auth session cleanup now handled by
5278
- // @elizaos/plugin-telegram (stopTelegramAccountAuthSession).
4099
+ // Clean up WhatsApp pairing sessions
4100
+ if (state.whatsappPairingSessions) {
4101
+ for (const s of state.whatsappPairingSessions.values()) {
4102
+ try {
4103
+ s.stop();
4104
+ }
4105
+ catch {
4106
+ /* non-fatal */
4107
+ }
4108
+ }
4109
+ state.whatsappPairingSessions.clear();
4110
+ }
4111
+ // Clean up Signal pairing sessions
4112
+ if (state.signalPairingSessions) {
4113
+ for (const s of state.signalPairingSessions.values()) {
4114
+ try {
4115
+ s.stop();
4116
+ }
4117
+ catch {
4118
+ /* non-fatal */
4119
+ }
4120
+ }
4121
+ state.signalPairingSessions.clear();
4122
+ }
4123
+ if (state.telegramAccountAuthSession) {
4124
+ try {
4125
+ await state.telegramAccountAuthSession.stop();
4126
+ }
4127
+ catch {
4128
+ /* non-fatal */
4129
+ }
4130
+ state.telegramAccountAuthSession = null;
4131
+ }
5279
4132
  wss.close();
4133
+ const closeTimeout = setTimeout(() => r(), 5_000);
4134
+ const resolved = { done: false };
4135
+ const finalize = () => {
4136
+ if (!resolved.done) {
4137
+ resolved.done = true;
4138
+ clearTimeout(closeTimeout);
4139
+ r();
4140
+ }
4141
+ };
5280
4142
  if (typeof closeAllConnections === "function") {
5281
4143
  try {
5282
4144
  closeAllConnections();
@@ -5294,7 +4156,7 @@ export async function startApiServer(opts) {
5294
4156
  }
5295
4157
  }
5296
4158
  server.close(finalize);
5297
- })().catch(() => finalize());
4159
+ })();
5298
4160
  }),
5299
4161
  updateRuntime,
5300
4162
  updateStartup,