@elizaos/agent 2.0.0-alpha.526 → 2.0.0-alpha.535

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 (478) hide show
  1. package/apps/app-contacts/src/plugin.d.ts +11 -0
  2. package/apps/app-contacts/src/plugin.d.ts.map +1 -0
  3. package/apps/app-contacts/src/plugin.js +57 -0
  4. package/apps/app-elizamaker/src/index.d.ts +2 -0
  5. package/apps/app-elizamaker/src/index.d.ts.map +1 -1
  6. package/apps/app-elizamaker/src/index.js +2 -0
  7. package/apps/app-elizamaker/src/init-registry-services.d.ts +18 -0
  8. package/apps/app-elizamaker/src/init-registry-services.d.ts.map +1 -0
  9. package/apps/app-elizamaker/src/init-registry-services.js +63 -0
  10. package/apps/app-elizamaker/src/plugin.d.ts.map +1 -1
  11. package/apps/app-elizamaker/src/plugin.js +7 -0
  12. package/apps/app-elizamaker/src/registry-service-registry.d.ts +4 -0
  13. package/apps/app-elizamaker/src/registry-service-registry.d.ts.map +1 -0
  14. package/apps/app-elizamaker/src/registry-service-registry.js +7 -0
  15. package/apps/app-lifeops/src/automation-node-contributor.d.ts +2 -0
  16. package/apps/app-lifeops/src/automation-node-contributor.d.ts.map +1 -0
  17. package/apps/app-lifeops/src/automation-node-contributor.js +93 -0
  18. package/apps/app-lifeops/src/lifeops/continuity-probe.d.ts +1 -1
  19. package/apps/app-lifeops/src/lifeops/continuity-probe.js +1 -1
  20. package/apps/app-lifeops/src/lifeops/discord-browser-scraper.js +1 -1
  21. package/apps/app-lifeops/src/lifeops/discord-desktop-cdp.js +2 -2
  22. package/apps/app-lifeops/src/lifeops/fda-probe.js +1 -1
  23. package/apps/app-lifeops/src/lifeops/feature-flags.types.d.ts +1 -1
  24. package/apps/app-lifeops/src/lifeops/feature-flags.types.js +1 -1
  25. package/apps/app-lifeops/src/lifeops/google-fetch.d.ts.map +1 -1
  26. package/apps/app-lifeops/src/lifeops/google-fetch.js +3 -3
  27. package/apps/app-lifeops/src/lifeops/google-managed-client.js +14 -14
  28. package/apps/app-lifeops/src/lifeops/health-bridge.js +1 -1
  29. package/apps/app-lifeops/src/lifeops/health-connectors.js +2 -2
  30. package/apps/app-lifeops/src/lifeops/health-oauth.js +1 -1
  31. package/apps/app-lifeops/src/lifeops/paypal-managed-client.d.ts +1 -1
  32. package/apps/app-lifeops/src/lifeops/paypal-managed-client.js +5 -5
  33. package/apps/app-lifeops/src/lifeops/plaid-managed-client.d.ts +3 -3
  34. package/apps/app-lifeops/src/lifeops/plaid-managed-client.js +6 -6
  35. package/apps/app-lifeops/src/lifeops/schedule-state.d.ts.map +1 -1
  36. package/apps/app-lifeops/src/lifeops/schedule-state.js +2 -6
  37. package/apps/app-lifeops/src/lifeops/schedule-sync-client.js +1 -1
  38. package/apps/app-lifeops/src/lifeops/service-mixin-discord.js +1 -1
  39. package/apps/app-lifeops/src/lifeops/service-mixin-payments.js +2 -2
  40. package/apps/app-lifeops/src/lifeops/service-mixin-travel.d.ts +1 -1
  41. package/apps/app-lifeops/src/lifeops/source-reliability.d.ts +1 -1
  42. package/apps/app-lifeops/src/lifeops/source-reliability.d.ts.map +1 -1
  43. package/apps/app-lifeops/src/lifeops/source-reliability.js +1 -1
  44. package/apps/app-lifeops/src/lifeops/subscriptions-playbooks.js +1 -1
  45. package/apps/app-lifeops/src/lifeops/travel-adapters/duffel.js +3 -3
  46. package/apps/app-lifeops/src/lifeops/twilio.d.ts.map +1 -1
  47. package/apps/app-lifeops/src/lifeops/twilio.js +1 -3
  48. package/apps/app-lifeops/src/lifeops/whatsapp-client.d.ts.map +1 -1
  49. package/apps/app-lifeops/src/lifeops/whatsapp-client.js +1 -3
  50. package/apps/app-lifeops/src/lifeops/x-poster.d.ts.map +1 -1
  51. package/apps/app-lifeops/src/lifeops/x-poster.js +1 -3
  52. package/apps/app-lifeops/src/lifeops/x-reader.d.ts.map +1 -1
  53. package/apps/app-lifeops/src/lifeops/x-reader.js +1 -3
  54. package/apps/app-lifeops/src/public.d.ts.map +1 -1
  55. package/apps/app-lifeops/src/public.js +2 -0
  56. package/apps/app-phone/src/actions/place-call.d.ts +14 -0
  57. package/apps/app-phone/src/actions/place-call.d.ts.map +1 -0
  58. package/apps/app-phone/src/actions/place-call.js +63 -0
  59. package/apps/app-phone/src/actions/read-call-log.d.ts +11 -0
  60. package/apps/app-phone/src/actions/read-call-log.d.ts.map +1 -0
  61. package/apps/app-phone/src/actions/read-call-log.js +53 -0
  62. package/apps/app-phone/src/plugin.d.ts +10 -0
  63. package/apps/app-phone/src/plugin.d.ts.map +1 -0
  64. package/apps/app-phone/src/plugin.js +18 -0
  65. package/apps/app-steward/src/api/wallet-routes.d.ts.map +1 -1
  66. package/apps/app-steward/src/api/wallet-routes.js +0 -1
  67. package/apps/app-steward/src/api/wallet.d.ts.map +1 -1
  68. package/apps/app-steward/src/api/wallet.js +0 -2
  69. package/apps/app-training/src/backends/atropos.d.ts +1 -1
  70. package/apps/app-training/src/backends/atropos.js +1 -1
  71. package/apps/app-training/src/backends/native.d.ts +1 -1
  72. package/apps/app-training/src/backends/native.js +1 -1
  73. package/apps/app-training/src/services/training-service-registry.d.ts +4 -0
  74. package/apps/app-training/src/services/training-service-registry.d.ts.map +1 -0
  75. package/apps/app-training/src/services/training-service-registry.js +7 -0
  76. package/apps/app-training/src/services/training-trigger.d.ts +1 -1
  77. package/apps/app-training/src/services/training-trigger.js +2 -2
  78. package/apps/app-wifi/src/actions/scan-wifi.d.ts +13 -0
  79. package/apps/app-wifi/src/actions/scan-wifi.d.ts.map +1 -0
  80. package/apps/app-wifi/src/actions/scan-wifi.js +68 -0
  81. package/apps/app-wifi/src/plugin.d.ts +9 -0
  82. package/apps/app-wifi/src/plugin.d.ts.map +1 -0
  83. package/apps/app-wifi/src/plugin.js +16 -0
  84. package/package.json +16 -4
  85. package/packages/agent/src/actions/browser-autofill-login.d.ts +36 -0
  86. package/packages/agent/src/actions/browser-autofill-login.d.ts.map +1 -0
  87. package/packages/agent/src/actions/browser-autofill-login.js +347 -0
  88. package/packages/agent/src/actions/runtime.js +1 -1
  89. package/packages/agent/src/actions/update-owner-name.js +1 -1
  90. package/packages/agent/src/api/agent-status-routes.d.ts +3 -23
  91. package/packages/agent/src/api/agent-status-routes.d.ts.map +1 -1
  92. package/packages/agent/src/api/agent-status-routes.js +7 -40
  93. package/packages/agent/src/api/chat-routes.d.ts.map +1 -1
  94. package/packages/agent/src/api/chat-routes.js +1 -2
  95. package/packages/agent/src/api/cloud-provisioning.d.ts.map +1 -1
  96. package/packages/agent/src/api/cloud-provisioning.js +1 -2
  97. package/packages/agent/src/api/cloud-routes.d.ts.map +1 -1
  98. package/packages/agent/src/api/cloud-routes.js +8 -9
  99. package/packages/agent/src/api/config-env.js +4 -4
  100. package/packages/agent/src/api/config-routes.js +1 -1
  101. package/packages/agent/src/api/coordinator-wiring.d.ts +46 -0
  102. package/packages/agent/src/api/coordinator-wiring.d.ts.map +1 -0
  103. package/packages/agent/src/api/coordinator-wiring.js +108 -0
  104. package/packages/agent/src/api/curated-skills-routes.d.ts +1 -1
  105. package/packages/agent/src/api/curated-skills-routes.js +1 -1
  106. package/packages/agent/src/api/experience-routes.d.ts.map +1 -1
  107. package/packages/agent/src/api/experience-routes.js +40 -2
  108. package/packages/agent/src/api/misc-routes.d.ts.map +1 -1
  109. package/packages/agent/src/api/misc-routes.js +3 -37
  110. package/packages/agent/src/api/nfa-routes.d.ts.map +1 -1
  111. package/packages/agent/src/api/nfa-routes.js +1 -9
  112. package/packages/agent/src/api/provider-switch-routes.d.ts +8 -7
  113. package/packages/agent/src/api/provider-switch-routes.d.ts.map +1 -1
  114. package/packages/agent/src/api/provider-switch-routes.js +41 -26
  115. package/packages/agent/src/api/server-auth.d.ts.map +1 -1
  116. package/packages/agent/src/api/server-auth.js +1 -2
  117. package/packages/agent/src/api/server-helpers-auth.js +3 -3
  118. package/packages/agent/src/api/server-helpers-swarm.js +2 -2
  119. package/packages/agent/src/api/server-helpers-wallet.d.ts.map +1 -1
  120. package/packages/agent/src/api/server-helpers-wallet.js +1 -2
  121. package/packages/agent/src/api/server-types.d.ts +0 -6
  122. package/packages/agent/src/api/server-types.d.ts.map +1 -1
  123. package/packages/agent/src/api/server.d.ts.map +1 -1
  124. package/packages/agent/src/api/server.js +87 -138
  125. package/packages/agent/src/api/static-file-server.d.ts +2 -2
  126. package/packages/agent/src/api/static-file-server.d.ts.map +1 -1
  127. package/packages/agent/src/api/static-file-server.js +4 -2
  128. package/packages/agent/src/api/stream-routes.d.ts.map +1 -1
  129. package/packages/agent/src/api/stream-routes.js +6 -8
  130. package/packages/agent/src/api/subscription-routes.js +1 -1
  131. package/packages/agent/src/api/terminal-run-limits.d.ts.map +1 -1
  132. package/packages/agent/src/api/terminal-run-limits.js +2 -4
  133. package/packages/agent/src/api/wallet-routes.d.ts.map +1 -1
  134. package/packages/agent/src/api/wallet-routes.js +4 -5
  135. package/packages/agent/src/api/wallet-trading-profile.d.ts.map +1 -1
  136. package/packages/agent/src/api/wallet-trading-profile.js +2 -23
  137. package/packages/agent/src/api/wallet.d.ts +2 -2
  138. package/packages/agent/src/api/wallet.d.ts.map +1 -1
  139. package/packages/agent/src/api/wallet.js +2 -4
  140. package/packages/agent/src/auth/account-storage.d.ts.map +1 -1
  141. package/packages/agent/src/auth/account-storage.js +4 -15
  142. package/packages/agent/src/auth/claude-code-stealth-preload.d.ts +2 -0
  143. package/packages/agent/src/auth/claude-code-stealth-preload.d.ts.map +1 -0
  144. package/packages/agent/src/auth/claude-code-stealth-preload.js +2 -0
  145. package/packages/agent/src/auth/credentials.js +2 -2
  146. package/packages/agent/src/auth/oauth-flow.d.ts +1 -1
  147. package/packages/agent/src/bin.js +28 -6
  148. package/packages/agent/src/cli/index.js +3 -3
  149. package/packages/agent/src/cloud/bridge-client.js +1 -1
  150. package/packages/agent/src/cloud/cloud-wallet.d.ts +4 -4
  151. package/packages/agent/src/cloud/cloud-wallet.d.ts.map +1 -1
  152. package/packages/agent/src/cloud/cloud-wallet.js +9 -9
  153. package/packages/agent/src/config/config.d.ts.map +1 -1
  154. package/packages/agent/src/config/config.js +2 -3
  155. package/packages/agent/src/config/env-vars.js +1 -1
  156. package/packages/agent/src/config/feature-flags.d.ts +1 -1
  157. package/packages/agent/src/config/feature-flags.js +1 -1
  158. package/packages/agent/src/config/paths.d.ts +1 -1
  159. package/packages/agent/src/config/paths.d.ts.map +1 -1
  160. package/packages/agent/src/config/paths.js +3 -9
  161. package/packages/agent/src/config/types.eliza.d.ts +2 -2
  162. package/packages/agent/src/providers/workspace.d.ts.map +1 -1
  163. package/packages/agent/src/providers/workspace.js +2 -5
  164. package/packages/agent/src/runtime/agent-wallets.d.ts +103 -0
  165. package/packages/agent/src/runtime/agent-wallets.d.ts.map +1 -0
  166. package/packages/agent/src/runtime/agent-wallets.js +247 -0
  167. package/packages/agent/src/runtime/android-app-plugins.d.ts +24 -0
  168. package/packages/agent/src/runtime/android-app-plugins.d.ts.map +1 -0
  169. package/packages/agent/src/runtime/android-app-plugins.js +39 -0
  170. package/packages/agent/src/runtime/aosp-llama-adapter.d.ts +40 -22
  171. package/packages/agent/src/runtime/aosp-llama-adapter.d.ts.map +1 -1
  172. package/packages/agent/src/runtime/aosp-llama-adapter.js +214 -118
  173. package/packages/agent/src/runtime/aosp-local-inference-bootstrap.d.ts +4 -4
  174. package/packages/agent/src/runtime/aosp-local-inference-bootstrap.d.ts.map +1 -1
  175. package/packages/agent/src/runtime/aosp-local-inference-bootstrap.js +39 -18
  176. package/packages/agent/src/runtime/core-plugins.d.ts +16 -1
  177. package/packages/agent/src/runtime/core-plugins.d.ts.map +1 -1
  178. package/packages/agent/src/runtime/core-plugins.js +21 -2
  179. package/packages/agent/src/runtime/eliza-plugin.d.ts.map +1 -1
  180. package/packages/agent/src/runtime/eliza-plugin.js +2 -0
  181. package/packages/agent/src/runtime/eliza.d.ts.map +1 -1
  182. package/packages/agent/src/runtime/eliza.js +72 -12
  183. package/packages/agent/src/runtime/first-time-setup.d.ts.map +1 -1
  184. package/packages/agent/src/runtime/first-time-setup.js +1 -7
  185. package/packages/agent/src/runtime/operations/cold-strategy.d.ts +4 -4
  186. package/packages/agent/src/runtime/operations/cold-strategy.d.ts.map +1 -1
  187. package/packages/agent/src/runtime/operations/cold-strategy.js +13 -46
  188. package/packages/agent/src/runtime/operations/health-checks.d.ts +1 -0
  189. package/packages/agent/src/runtime/operations/health-checks.d.ts.map +1 -1
  190. package/packages/agent/src/runtime/operations/health-checks.js +1 -1
  191. package/packages/agent/src/runtime/operations/health.d.ts.map +1 -1
  192. package/packages/agent/src/runtime/operations/health.js +1 -13
  193. package/packages/agent/src/runtime/operations/index.d.ts +1 -0
  194. package/packages/agent/src/runtime/operations/index.d.ts.map +1 -1
  195. package/packages/agent/src/runtime/operations/index.js +1 -0
  196. package/packages/agent/src/runtime/operations/manager.d.ts +2 -0
  197. package/packages/agent/src/runtime/operations/manager.d.ts.map +1 -1
  198. package/packages/agent/src/runtime/operations/manager.js +27 -7
  199. package/packages/agent/src/runtime/operations/reload-hot.d.ts +4 -1
  200. package/packages/agent/src/runtime/operations/reload-hot.d.ts.map +1 -1
  201. package/packages/agent/src/runtime/operations/reload-hot.js +46 -41
  202. package/packages/agent/src/runtime/operations/repository.d.ts +30 -8
  203. package/packages/agent/src/runtime/operations/repository.d.ts.map +1 -1
  204. package/packages/agent/src/runtime/operations/repository.js +140 -54
  205. package/packages/agent/src/runtime/operations/types.d.ts +26 -24
  206. package/packages/agent/src/runtime/operations/types.d.ts.map +1 -1
  207. package/packages/agent/src/runtime/operations/types.js +8 -20
  208. package/packages/agent/src/runtime/operations/vault-bridge.d.ts +81 -0
  209. package/packages/agent/src/runtime/operations/vault-bridge.d.ts.map +1 -0
  210. package/packages/agent/src/runtime/operations/vault-bridge.js +133 -0
  211. package/packages/agent/src/runtime/plugin-collector.d.ts.map +1 -1
  212. package/packages/agent/src/runtime/plugin-collector.js +22 -6
  213. package/packages/agent/src/runtime/plugin-lifecycle.d.ts.map +1 -1
  214. package/packages/agent/src/runtime/plugin-lifecycle.js +1 -1
  215. package/packages/agent/src/runtime/plugin-resolver.d.ts.map +1 -1
  216. package/packages/agent/src/runtime/plugin-resolver.js +4 -3
  217. package/packages/agent/src/runtime/plugin-types.d.ts.map +1 -1
  218. package/packages/agent/src/runtime/plugin-types.js +1 -3
  219. package/packages/agent/src/runtime/subagent-output.d.ts +2 -2
  220. package/packages/agent/src/runtime/subagent-output.js +2 -2
  221. package/packages/agent/src/runtime/trajectory-internals.d.ts +20 -0
  222. package/packages/agent/src/runtime/trajectory-internals.d.ts.map +1 -1
  223. package/packages/agent/src/runtime/trajectory-internals.js +0 -9
  224. package/packages/agent/src/runtime/vault-profile-resolver.d.ts +37 -0
  225. package/packages/agent/src/runtime/vault-profile-resolver.d.ts.map +1 -0
  226. package/packages/agent/src/runtime/vault-profile-resolver.js +79 -0
  227. package/packages/agent/src/services/app-package-modules.d.ts.map +1 -1
  228. package/packages/agent/src/services/app-package-modules.js +1 -8
  229. package/packages/agent/src/services/app-run-store.d.ts.map +1 -1
  230. package/packages/agent/src/services/app-run-store.js +2 -23
  231. package/packages/agent/src/services/evm-signing-capability.d.ts +1 -1
  232. package/packages/agent/src/services/evm-signing-capability.js +1 -1
  233. package/packages/agent/src/services/registry-client-local.d.ts.map +1 -1
  234. package/packages/agent/src/services/registry-client-local.js +1 -9
  235. package/packages/agent/src/services/signal-pairing.js +5 -5
  236. package/packages/agent/src/services/skill-marketplace.d.ts.map +1 -1
  237. package/packages/agent/src/services/skill-marketplace.js +1 -1
  238. package/packages/agent/src/services/telegram-account-auth.d.ts.map +1 -1
  239. package/packages/agent/src/services/telegram-account-auth.js +1 -3
  240. package/packages/agent/src/test-utils/sqlite-compat.js +1 -1
  241. package/packages/agent/src/utils/atomic-json.d.ts +37 -0
  242. package/packages/agent/src/utils/atomic-json.d.ts.map +1 -0
  243. package/packages/agent/src/utils/atomic-json.js +98 -0
  244. package/packages/agent/src/utils/index.d.ts +1 -0
  245. package/packages/agent/src/utils/index.d.ts.map +1 -1
  246. package/packages/agent/src/utils/index.js +1 -0
  247. package/packages/app-core/src/api/automation-node-contributors.d.ts +14 -0
  248. package/packages/app-core/src/api/automation-node-contributors.d.ts.map +1 -0
  249. package/packages/app-core/src/api/automation-node-contributors.js +14 -0
  250. package/packages/app-core/src/api/client-agent.d.ts +628 -0
  251. package/packages/app-core/src/api/client-agent.d.ts.map +1 -0
  252. package/packages/app-core/src/api/client-agent.js +1442 -0
  253. package/packages/app-core/src/api/client-automations.d.ts +8 -0
  254. package/packages/app-core/src/api/client-automations.d.ts.map +1 -0
  255. package/packages/app-core/src/api/client-automations.js +7 -0
  256. package/packages/app-core/src/api/client-base.d.ts +82 -0
  257. package/packages/app-core/src/api/client-base.d.ts.map +1 -0
  258. package/packages/app-core/src/api/client-base.js +738 -0
  259. package/packages/app-core/src/api/client-browser-workspace.d.ts +25 -0
  260. package/packages/app-core/src/api/client-browser-workspace.d.ts.map +1 -0
  261. package/packages/app-core/src/api/client-browser-workspace.js +98 -0
  262. package/packages/app-core/src/api/client-chat.d.ts +355 -0
  263. package/packages/app-core/src/api/client-chat.d.ts.map +1 -0
  264. package/packages/app-core/src/api/client-chat.js +582 -0
  265. package/packages/app-core/src/api/client-cloud.d.ts +286 -0
  266. package/packages/app-core/src/api/client-cloud.d.ts.map +1 -0
  267. package/packages/app-core/src/api/client-cloud.js +410 -0
  268. package/packages/app-core/src/api/client-computeruse.d.ts +32 -0
  269. package/packages/app-core/src/api/client-computeruse.d.ts.map +1 -0
  270. package/packages/app-core/src/api/client-computeruse.js +16 -0
  271. package/packages/app-core/src/api/client-imessage.d.ts +68 -0
  272. package/packages/app-core/src/api/client-imessage.d.ts.map +1 -0
  273. package/packages/app-core/src/api/client-imessage.js +74 -0
  274. package/packages/app-core/src/api/client-local-inference.d.ts +62 -0
  275. package/packages/app-core/src/api/client-local-inference.d.ts.map +1 -0
  276. package/packages/app-core/src/api/client-local-inference.js +87 -0
  277. package/packages/app-core/src/api/client-n8n.d.ts +27 -0
  278. package/packages/app-core/src/api/client-n8n.d.ts.map +1 -0
  279. package/packages/app-core/src/api/client-n8n.js +61 -0
  280. package/packages/app-core/src/api/client-skills.d.ts +475 -0
  281. package/packages/app-core/src/api/client-skills.d.ts.map +1 -0
  282. package/packages/app-core/src/api/client-skills.js +608 -0
  283. package/packages/app-core/src/api/client-types-babylon.d.ts +254 -0
  284. package/packages/app-core/src/api/client-types-babylon.d.ts.map +1 -0
  285. package/packages/app-core/src/api/client-types-babylon.js +2 -0
  286. package/packages/app-core/src/api/client-types-character.d.ts +39 -0
  287. package/packages/app-core/src/api/client-types-character.d.ts.map +1 -0
  288. package/packages/app-core/src/api/client-types-character.js +1 -0
  289. package/packages/app-core/src/api/client-types-chat.d.ts +428 -0
  290. package/packages/app-core/src/api/client-types-chat.d.ts.map +1 -0
  291. package/packages/app-core/src/api/client-types-chat.js +9 -0
  292. package/packages/app-core/src/api/client-types-config.d.ts +587 -0
  293. package/packages/app-core/src/api/client-types-config.d.ts.map +1 -0
  294. package/packages/app-core/src/api/client-types-config.js +5 -0
  295. package/packages/app-core/src/api/client-types-experience.d.ts +97 -0
  296. package/packages/app-core/src/api/client-types-experience.d.ts.map +1 -0
  297. package/packages/app-core/src/api/client-types-experience.js +1 -0
  298. package/packages/app-core/src/api/client-types-relationships.d.ts +181 -0
  299. package/packages/app-core/src/api/client-types-relationships.d.ts.map +1 -0
  300. package/packages/app-core/src/api/client-types-relationships.js +1 -0
  301. package/packages/app-core/src/api/client-types-steward.d.ts +85 -0
  302. package/packages/app-core/src/api/client-types-steward.d.ts.map +1 -0
  303. package/packages/app-core/src/api/client-types-steward.js +9 -0
  304. package/packages/app-core/src/api/client-types.d.ts +9 -0
  305. package/packages/app-core/src/api/client-types.d.ts.map +1 -0
  306. package/packages/app-core/src/api/client-types.js +12 -0
  307. package/packages/app-core/src/api/client-vault.d.ts +53 -0
  308. package/packages/app-core/src/api/client-vault.d.ts.map +1 -0
  309. package/packages/app-core/src/api/client-vault.js +48 -0
  310. package/packages/app-core/src/api/client-wallet.d.ts +130 -0
  311. package/packages/app-core/src/api/client-wallet.d.ts.map +1 -0
  312. package/packages/app-core/src/api/client-wallet.js +228 -0
  313. package/packages/app-core/src/api/client.d.ts +37 -0
  314. package/packages/app-core/src/api/client.d.ts.map +1 -0
  315. package/packages/app-core/src/api/client.js +37 -0
  316. package/packages/app-core/src/api/index.d.ts +2 -0
  317. package/packages/app-core/src/api/index.d.ts.map +1 -0
  318. package/packages/app-core/src/api/index.js +1 -0
  319. package/packages/app-core/src/bridge/electrobun-rpc.d.ts +57 -0
  320. package/packages/app-core/src/bridge/electrobun-rpc.d.ts.map +1 -0
  321. package/packages/app-core/src/bridge/electrobun-rpc.js +87 -0
  322. package/packages/app-core/src/bridge/electrobun-runtime.d.ts +3 -0
  323. package/packages/app-core/src/bridge/electrobun-runtime.d.ts.map +1 -0
  324. package/packages/app-core/src/bridge/electrobun-runtime.js +34 -0
  325. package/packages/app-core/src/bridge/native-plugins.d.ts +504 -0
  326. package/packages/app-core/src/bridge/native-plugins.d.ts.map +1 -0
  327. package/packages/app-core/src/bridge/native-plugins.js +67 -0
  328. package/packages/app-core/src/chat/coding-agent-session-state.d.ts +16 -0
  329. package/packages/app-core/src/chat/coding-agent-session-state.d.ts.map +1 -0
  330. package/packages/app-core/src/chat/coding-agent-session-state.js +27 -0
  331. package/packages/app-core/src/components/pages/browser-workspace-wallet.d.ts +80 -0
  332. package/packages/app-core/src/components/pages/browser-workspace-wallet.d.ts.map +1 -0
  333. package/packages/app-core/src/components/pages/browser-workspace-wallet.js +135 -0
  334. package/packages/app-core/src/navigation/index.js +1 -1
  335. package/packages/app-core/src/registry/index.d.ts +7 -0
  336. package/packages/app-core/src/registry/index.d.ts.map +1 -0
  337. package/packages/app-core/src/registry/index.js +43 -0
  338. package/packages/app-core/src/registry/legacy-adapter.d.ts +32 -0
  339. package/packages/app-core/src/registry/legacy-adapter.d.ts.map +1 -0
  340. package/packages/app-core/src/registry/legacy-adapter.js +101 -0
  341. package/packages/app-core/src/registry/loader.d.ts +27 -0
  342. package/packages/app-core/src/registry/loader.d.ts.map +1 -0
  343. package/packages/app-core/src/registry/loader.js +111 -0
  344. package/packages/app-core/src/registry/schema.d.ts +986 -0
  345. package/packages/app-core/src/registry/schema.d.ts.map +1 -0
  346. package/packages/app-core/src/registry/schema.js +250 -0
  347. package/packages/app-core/src/services/account-pool.d.ts +98 -0
  348. package/packages/app-core/src/services/account-pool.d.ts.map +1 -0
  349. package/packages/app-core/src/services/account-pool.js +506 -0
  350. package/packages/app-core/src/services/account-usage.d.ts +75 -0
  351. package/packages/app-core/src/services/account-usage.d.ts.map +1 -0
  352. package/packages/app-core/src/services/account-usage.js +179 -0
  353. package/packages/app-core/src/services/local-inference/active-model.d.ts +59 -0
  354. package/packages/app-core/src/services/local-inference/active-model.d.ts.map +1 -0
  355. package/packages/app-core/src/services/local-inference/active-model.js +120 -0
  356. package/packages/app-core/src/services/local-inference/device-bridge.d.ts +131 -0
  357. package/packages/app-core/src/services/local-inference/device-bridge.d.ts.map +1 -0
  358. package/packages/app-core/src/services/local-inference/device-bridge.js +748 -0
  359. package/packages/app-core/src/services/local-inference/engine.d.ts +52 -0
  360. package/packages/app-core/src/services/local-inference/engine.d.ts.map +1 -0
  361. package/packages/app-core/src/services/local-inference/engine.js +138 -0
  362. package/packages/app-core/src/services/local-inference/external-scanner.d.ts +17 -0
  363. package/packages/app-core/src/services/local-inference/external-scanner.d.ts.map +1 -0
  364. package/packages/app-core/src/services/local-inference/external-scanner.js +261 -0
  365. package/packages/app-core/src/services/local-inference/handler-registry.d.ts +72 -0
  366. package/packages/app-core/src/services/local-inference/handler-registry.d.ts.map +1 -0
  367. package/packages/app-core/src/services/local-inference/handler-registry.js +160 -0
  368. package/packages/app-core/src/services/local-inference/paths.d.ts +24 -0
  369. package/packages/app-core/src/services/local-inference/paths.d.ts.map +1 -0
  370. package/packages/app-core/src/services/local-inference/paths.js +41 -0
  371. package/packages/app-core/src/services/local-inference/providers.d.ts +61 -0
  372. package/packages/app-core/src/services/local-inference/providers.d.ts.map +1 -0
  373. package/packages/app-core/src/services/local-inference/providers.js +277 -0
  374. package/packages/app-core/src/services/local-inference/registry.d.ts +35 -0
  375. package/packages/app-core/src/services/local-inference/registry.d.ts.map +1 -0
  376. package/packages/app-core/src/services/local-inference/registry.js +108 -0
  377. package/packages/app-core/src/services/local-inference/routing-preferences.d.ts +31 -0
  378. package/packages/app-core/src/services/local-inference/routing-preferences.d.ts.map +1 -0
  379. package/packages/app-core/src/services/local-inference/routing-preferences.js +72 -0
  380. package/packages/app-core/src/services/local-inference/types.d.ts +121 -0
  381. package/packages/app-core/src/services/local-inference/types.d.ts.map +1 -0
  382. package/packages/app-core/src/services/local-inference/types.js +14 -0
  383. package/packages/app-core/src/services/local-inference/verify.d.ts +39 -0
  384. package/packages/app-core/src/services/local-inference/verify.d.ts.map +1 -0
  385. package/packages/app-core/src/services/local-inference/verify.js +104 -0
  386. package/packages/app-core/src/services/vault-bootstrap.d.ts +31 -0
  387. package/packages/app-core/src/services/vault-bootstrap.d.ts.map +1 -0
  388. package/packages/app-core/src/services/vault-bootstrap.js +245 -0
  389. package/packages/app-core/src/services/vault-mirror.d.ts +44 -0
  390. package/packages/app-core/src/services/vault-mirror.d.ts.map +1 -0
  391. package/packages/app-core/src/services/vault-mirror.js +80 -0
  392. package/packages/app-core/src/types/index.d.ts +658 -0
  393. package/packages/app-core/src/types/index.d.ts.map +1 -0
  394. package/packages/app-core/src/types/index.js +4 -0
  395. package/packages/app-core/src/utils/assistant-text.d.ts +2 -0
  396. package/packages/app-core/src/utils/assistant-text.d.ts.map +1 -0
  397. package/packages/app-core/src/utils/assistant-text.js +167 -0
  398. package/packages/app-core/src/utils/eliza-globals.d.ts +13 -0
  399. package/packages/app-core/src/utils/eliza-globals.d.ts.map +1 -0
  400. package/packages/app-core/src/utils/eliza-globals.js +48 -0
  401. package/packages/app-core/src/utils/streaming-text.d.ts +9 -0
  402. package/packages/app-core/src/utils/streaming-text.d.ts.map +1 -0
  403. package/packages/app-core/src/utils/streaming-text.js +112 -0
  404. package/packages/native-plugins/contacts/src/definitions.d.ts +38 -0
  405. package/packages/native-plugins/contacts/src/definitions.d.ts.map +1 -0
  406. package/packages/native-plugins/contacts/src/definitions.js +1 -0
  407. package/packages/native-plugins/contacts/src/index.d.ts +4 -0
  408. package/packages/native-plugins/contacts/src/index.d.ts.map +1 -0
  409. package/packages/native-plugins/contacts/src/index.js +6 -0
  410. package/packages/native-plugins/contacts/src/web.d.ts +14 -0
  411. package/packages/native-plugins/contacts/src/web.d.ts.map +1 -0
  412. package/packages/native-plugins/contacts/src/web.js +12 -0
  413. package/packages/native-plugins/phone/src/definitions.d.ts +48 -0
  414. package/packages/native-plugins/phone/src/definitions.d.ts.map +1 -0
  415. package/packages/native-plugins/phone/src/definitions.js +1 -0
  416. package/packages/native-plugins/phone/src/index.d.ts +4 -0
  417. package/packages/native-plugins/phone/src/index.d.ts.map +1 -0
  418. package/packages/native-plugins/phone/src/index.js +6 -0
  419. package/packages/native-plugins/phone/src/web.d.ts +14 -0
  420. package/packages/native-plugins/phone/src/web.d.ts.map +1 -0
  421. package/packages/native-plugins/phone/src/web.js +23 -0
  422. package/packages/native-plugins/wifi/src/definitions.d.ts +84 -0
  423. package/packages/native-plugins/wifi/src/definitions.d.ts.map +1 -0
  424. package/packages/native-plugins/wifi/src/definitions.js +9 -0
  425. package/packages/native-plugins/wifi/src/index.d.ts +4 -0
  426. package/packages/native-plugins/wifi/src/index.d.ts.map +1 -0
  427. package/packages/native-plugins/wifi/src/index.js +6 -0
  428. package/packages/native-plugins/wifi/src/web.d.ts +17 -0
  429. package/packages/native-plugins/wifi/src/web.d.ts.map +1 -0
  430. package/packages/native-plugins/wifi/src/web.js +38 -0
  431. package/packages/shared/src/config/types.eliza.d.ts +2 -2
  432. package/packages/shared/src/connector-cred-types.d.ts +1 -1
  433. package/packages/shared/src/connector-cred-types.js +1 -1
  434. package/packages/shared/src/contracts/lifeops.d.ts +1 -1
  435. package/packages/shared/src/contracts/lifeops.d.ts.map +1 -1
  436. package/packages/shared/src/contracts/service-routing.d.ts +1 -1
  437. package/packages/shared/src/format-error.d.ts +14 -0
  438. package/packages/shared/src/format-error.d.ts.map +1 -0
  439. package/packages/shared/src/format-error.js +17 -0
  440. package/packages/shared/src/index.d.ts +1 -0
  441. package/packages/shared/src/index.d.ts.map +1 -1
  442. package/packages/shared/src/index.js +1 -0
  443. package/packages/shared/src/runtime-env.js +3 -3
  444. package/packages/skills/src/resolver.js +3 -3
  445. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillExtraction.d.ts +1 -1
  446. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillExtraction.js +1 -1
  447. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillRefinement.d.ts +1 -1
  448. package/packages/typescript/src/features/advanced-capabilities/evaluators/skillRefinement.js +1 -1
  449. package/packages/typescript/src/features/basic-capabilities/providers/uiContext.js +1 -1
  450. package/packages/typescript/src/features/plugin-manager/actions/plugin.d.ts.map +1 -1
  451. package/packages/typescript/src/features/plugin-manager/actions/plugin.js +1 -2
  452. package/packages/typescript/src/features/plugin-manager/services/coreManagerService.d.ts +1 -1
  453. package/packages/typescript/src/features/plugin-manager/services/coreManagerService.d.ts.map +1 -1
  454. package/packages/typescript/src/features/plugin-manager/services/coreManagerService.js +3 -3
  455. package/packages/typescript/src/features/plugin-manager/services/pluginManagerService.js +1 -1
  456. package/packages/typescript/src/features/plugin-manager/types.d.ts +1 -1
  457. package/packages/typescript/src/features/plugin-manager/types.d.ts.map +1 -1
  458. package/packages/typescript/src/index.node.js +1 -1
  459. package/packages/typescript/src/lifeops-passive-connectors.js +1 -1
  460. package/packages/typescript/src/runtime-composition.d.ts +2 -2
  461. package/packages/typescript/src/runtime-composition.d.ts.map +1 -1
  462. package/packages/typescript/src/runtime-composition.js +1 -1
  463. package/packages/typescript/src/runtime.d.ts +14 -0
  464. package/packages/typescript/src/runtime.d.ts.map +1 -1
  465. package/packages/typescript/src/runtime.js +42 -0
  466. package/packages/typescript/src/services/message.d.ts +8 -0
  467. package/packages/typescript/src/services/message.d.ts.map +1 -1
  468. package/packages/typescript/src/services/message.js +51 -0
  469. package/packages/typescript/src/services/optimized-prompt.d.ts +1 -1
  470. package/packages/typescript/src/services/optimized-prompt.js +1 -1
  471. package/packages/typescript/src/services/task.d.ts +1 -0
  472. package/packages/typescript/src/services/task.d.ts.map +1 -1
  473. package/packages/typescript/src/services/task.js +26 -3
  474. package/packages/typescript/src/utils/state-dir.d.ts +7 -8
  475. package/packages/typescript/src/utils/state-dir.d.ts.map +1 -1
  476. package/packages/typescript/src/utils/state-dir.js +8 -11
  477. package/plugins/plugin-browser-bridge/src/plugin.d.ts +1 -1
  478. package/plugins/plugin-browser-bridge/src/plugin.js +1 -1
@@ -0,0 +1,108 @@
1
+ /**
2
+ * On-disk registry of installed models.
3
+ *
4
+ * Two sources feed the registry:
5
+ * 1. Eliza-owned downloads (source: "eliza-download") — written on
6
+ * successful completion by the downloader.
7
+ * 2. External scans (source: "external-scan") — merged in at read time
8
+ * from `scanExternalModels()`. These are never persisted to the
9
+ * registry file; a rescan runs whenever we read.
10
+ *
11
+ * The JSON file only holds Eliza-owned entries. That way, if a user
12
+ * cleans up LM Studio models we don't show stale ghosts.
13
+ */
14
+ import fs from "node:fs/promises";
15
+ import path from "node:path";
16
+ import { scanExternalModels } from "./external-scanner";
17
+ import { isWithinElizaRoot, localInferenceRoot, registryPath } from "./paths";
18
+ async function ensureRootDir() {
19
+ await fs.mkdir(localInferenceRoot(), { recursive: true });
20
+ }
21
+ async function readElizaOwned() {
22
+ try {
23
+ const raw = await fs.readFile(registryPath(), "utf8");
24
+ const parsed = JSON.parse(raw);
25
+ if (!parsed || parsed.version !== 1 || !Array.isArray(parsed.models)) {
26
+ return [];
27
+ }
28
+ return parsed.models.filter((m) => m && typeof m === "object" && m.source === "eliza-download");
29
+ }
30
+ catch {
31
+ return [];
32
+ }
33
+ }
34
+ async function writeElizaOwned(models) {
35
+ await ensureRootDir();
36
+ const tmp = `${registryPath()}.tmp`;
37
+ const payload = { version: 1, models };
38
+ await fs.writeFile(tmp, JSON.stringify(payload, null, 2), "utf8");
39
+ await fs.rename(tmp, registryPath());
40
+ }
41
+ /**
42
+ * Return all models currently usable: persisted Eliza downloads plus a
43
+ * fresh external-tool scan. External duplicates of Eliza-owned files are
44
+ * filtered out by path.
45
+ */
46
+ export async function listInstalledModels() {
47
+ const [owned, external] = await Promise.all([
48
+ readElizaOwned(),
49
+ scanExternalModels(),
50
+ ]);
51
+ // Filter out Eliza-owned files that also survived a reboot of the local
52
+ // file and got re-detected by the scanner.
53
+ const ownedPaths = new Set(owned.map((m) => path.resolve(m.path)));
54
+ const dedupedExternal = external.filter((m) => !ownedPaths.has(path.resolve(m.path)));
55
+ return [...owned, ...dedupedExternal];
56
+ }
57
+ /** Add or update a Eliza-owned entry. External entries are rejected. */
58
+ export async function upsertElizaModel(model) {
59
+ if (model.source !== "eliza-download") {
60
+ throw new Error("[local-inference] registry only accepts Eliza-owned models");
61
+ }
62
+ if (!isWithinElizaRoot(model.path)) {
63
+ throw new Error("[local-inference] Eliza-owned models must live under the local-inference root");
64
+ }
65
+ const owned = await readElizaOwned();
66
+ const withoutCurrent = owned.filter((m) => m.id !== model.id);
67
+ withoutCurrent.push(model);
68
+ await writeElizaOwned(withoutCurrent);
69
+ }
70
+ /** Mark an existing Eliza-owned model as most-recently-used. */
71
+ export async function touchElizaModel(id) {
72
+ const owned = await readElizaOwned();
73
+ const target = owned.find((m) => m.id === id);
74
+ if (!target)
75
+ return;
76
+ target.lastUsedAt = new Date().toISOString();
77
+ await writeElizaOwned(owned);
78
+ }
79
+ /**
80
+ * Delete a Eliza-owned model from the registry and from disk.
81
+ *
82
+ * Refuses if the model was discovered from another tool — Eliza must not
83
+ * touch files it doesn't own. Callers surface that refusal as a 4xx.
84
+ */
85
+ export async function removeElizaModel(id) {
86
+ const owned = await readElizaOwned();
87
+ const target = owned.find((m) => m.id === id);
88
+ if (!target) {
89
+ // Check whether it's a known external entry so we can return a
90
+ // helpful error message instead of 404.
91
+ const external = await scanExternalModels();
92
+ if (external.some((m) => m.id === id)) {
93
+ return { removed: false, reason: "external" };
94
+ }
95
+ return { removed: false, reason: "not-found" };
96
+ }
97
+ if (!isWithinElizaRoot(target.path)) {
98
+ return { removed: false, reason: "external" };
99
+ }
100
+ try {
101
+ await fs.rm(target.path, { force: true });
102
+ }
103
+ catch {
104
+ // If the file was already gone we still want to clear the registry entry.
105
+ }
106
+ await writeElizaOwned(owned.filter((m) => m.id !== id));
107
+ return { removed: true };
108
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Per-model-type user override: "for TEXT_LARGE, prefer this provider".
3
+ *
4
+ * Persisted to `$STATE_DIR/local-inference/routing.json` and read by the
5
+ * router-handler (see `router-handler.ts`) to pick a provider at dispatch
6
+ * time. When a slot has no override, the runtime's native priority order
7
+ * wins — i.e. this is layered over the existing registration priority
8
+ * rather than replacing it.
9
+ */
10
+ import type { AgentModelSlot } from "./types";
11
+ export type RoutingPolicy = "manual" | "cheapest" | "fastest" | "prefer-local" | "round-robin";
12
+ export declare const DEFAULT_ROUTING_POLICY: RoutingPolicy;
13
+ export interface RoutingPreferences {
14
+ /**
15
+ * Explicit provider override per agent slot. Empty record = no overrides,
16
+ * runtime picks the highest-priority registered handler.
17
+ */
18
+ preferredProvider: Partial<Record<AgentModelSlot, string>>;
19
+ /**
20
+ * Per-slot policy. "manual" honours `preferredProvider` verbatim;
21
+ * everything else lets the router-handler compute a winner from the
22
+ * policy rule set. Absent = "prefer-local" so local models and
23
+ * subscriptions are tried before direct paid APIs and managed cloud.
24
+ */
25
+ policy: Partial<Record<AgentModelSlot, RoutingPolicy>>;
26
+ }
27
+ export declare function readRoutingPreferences(): Promise<RoutingPreferences>;
28
+ export declare function writeRoutingPreferences(prefs: RoutingPreferences): Promise<void>;
29
+ export declare function setPreferredProvider(slot: AgentModelSlot, provider: string | null): Promise<RoutingPreferences>;
30
+ export declare function setPolicy(slot: AgentModelSlot, policy: RoutingPolicy | null): Promise<RoutingPreferences>;
31
+ //# sourceMappingURL=routing-preferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routing-preferences.d.ts","sourceRoot":"","sources":["../../../../../../../app-core/src/services/local-inference/routing-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,UAAU,GACV,SAAS,GACT,cAAc,GACd,aAAa,CAAC;AAElB,eAAO,MAAM,sBAAsB,EAAE,aAA8B,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;CACxD;AAiBD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAY1E;AAED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAa7B;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,aAAa,GAAG,IAAI,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAa7B"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Per-model-type user override: "for TEXT_LARGE, prefer this provider".
3
+ *
4
+ * Persisted to `$STATE_DIR/local-inference/routing.json` and read by the
5
+ * router-handler (see `router-handler.ts`) to pick a provider at dispatch
6
+ * time. When a slot has no override, the runtime's native priority order
7
+ * wins — i.e. this is layered over the existing registration priority
8
+ * rather than replacing it.
9
+ */
10
+ import fs from "node:fs/promises";
11
+ import path from "node:path";
12
+ import { localInferenceRoot } from "./paths";
13
+ export const DEFAULT_ROUTING_POLICY = "prefer-local";
14
+ const EMPTY = { preferredProvider: {}, policy: {} };
15
+ function routingPath() {
16
+ return path.join(localInferenceRoot(), "routing.json");
17
+ }
18
+ async function ensureRoot() {
19
+ await fs.mkdir(localInferenceRoot(), { recursive: true });
20
+ }
21
+ export async function readRoutingPreferences() {
22
+ try {
23
+ const raw = await fs.readFile(routingPath(), "utf8");
24
+ const parsed = JSON.parse(raw);
25
+ if (!parsed || parsed.version !== 1 || !parsed.preferences)
26
+ return EMPTY;
27
+ return {
28
+ preferredProvider: parsed.preferences.preferredProvider ?? {},
29
+ policy: parsed.preferences.policy ?? {},
30
+ };
31
+ }
32
+ catch {
33
+ return EMPTY;
34
+ }
35
+ }
36
+ export async function writeRoutingPreferences(prefs) {
37
+ await ensureRoot();
38
+ const payload = { version: 1, preferences: prefs };
39
+ const tmp = `${routingPath()}.tmp`;
40
+ await fs.writeFile(tmp, JSON.stringify(payload, null, 2), "utf8");
41
+ await fs.rename(tmp, routingPath());
42
+ }
43
+ export async function setPreferredProvider(slot, provider) {
44
+ const current = await readRoutingPreferences();
45
+ const next = {
46
+ preferredProvider: { ...current.preferredProvider },
47
+ policy: { ...current.policy },
48
+ };
49
+ if (provider) {
50
+ next.preferredProvider[slot] = provider;
51
+ }
52
+ else {
53
+ delete next.preferredProvider[slot];
54
+ }
55
+ await writeRoutingPreferences(next);
56
+ return next;
57
+ }
58
+ export async function setPolicy(slot, policy) {
59
+ const current = await readRoutingPreferences();
60
+ const next = {
61
+ preferredProvider: { ...current.preferredProvider },
62
+ policy: { ...current.policy },
63
+ };
64
+ if (policy) {
65
+ next.policy[slot] = policy;
66
+ }
67
+ else {
68
+ delete next.policy[slot];
69
+ }
70
+ await writeRoutingPreferences(next);
71
+ return next;
72
+ }
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Local inference model-management types.
3
+ *
4
+ * Shared across the service layer, API routes, and renderer.
5
+ * The catalog is Eliza-curated; installed models are tracked locally in a
6
+ * JSON registry under the state dir.
7
+ */
8
+ export type ModelBucket = "small" | "mid" | "large" | "xl";
9
+ export type ModelCategory = "chat" | "code" | "tools" | "tiny" | "reasoning";
10
+ export interface CatalogModel {
11
+ /** Stable Eliza id — used as the primary key. */
12
+ id: string;
13
+ displayName: string;
14
+ /** HuggingFace repo slug, e.g. "bartowski/Llama-3.2-3B-Instruct-GGUF". */
15
+ hfRepo: string;
16
+ /** Exact GGUF filename in the repo. */
17
+ ggufFile: string;
18
+ params: "360M" | "1B" | "1.7B" | "3B" | "7B" | "8B" | "9B" | "14B" | "16B" | "22B" | "24B" | "27B" | "32B" | "70B";
19
+ quant: string;
20
+ sizeGb: number;
21
+ /** Minimum system RAM (GB) we recommend before offering this model. */
22
+ minRamGb: number;
23
+ category: ModelCategory;
24
+ bucket: ModelBucket;
25
+ blurb: string;
26
+ }
27
+ export type HardwareFitLevel = "fits" | "tight" | "wontfit";
28
+ export interface HardwareProbe {
29
+ totalRamGb: number;
30
+ freeRamGb: number;
31
+ /** Null when no supported GPU is available (CPU-only). */
32
+ gpu: {
33
+ backend: "cuda" | "metal" | "vulkan";
34
+ totalVramGb: number;
35
+ freeVramGb: number;
36
+ } | null;
37
+ cpuCores: number;
38
+ platform: NodeJS.Platform;
39
+ arch: NodeJS.Architecture;
40
+ /** True on Apple Silicon (shared memory — large models are viable on 16GB+). */
41
+ appleSilicon: boolean;
42
+ /** Recommended default bucket based on available memory. */
43
+ recommendedBucket: ModelBucket;
44
+ /** Source of the probe; "node-llama-cpp" when GPU values come from the binding. */
45
+ source: "node-llama-cpp" | "os-fallback";
46
+ }
47
+ export interface InstalledModel {
48
+ /** Matches CatalogModel.id when installed from the curated catalog. */
49
+ id: string;
50
+ displayName: string;
51
+ /** Absolute path to the GGUF file on disk. */
52
+ path: string;
53
+ sizeBytes: number;
54
+ /** HF repo this came from, when known. */
55
+ hfRepo?: string;
56
+ /** ISO timestamp of install completion. */
57
+ installedAt: string;
58
+ /** ISO timestamp of last activation (null if never loaded). */
59
+ lastUsedAt: string | null;
60
+ /** Where we got this model from. Determines whether Eliza owns the file. */
61
+ source: "eliza-download" | "external-scan";
62
+ /**
63
+ * When source === "external-scan", which tool the file belonged to.
64
+ * Prevents Eliza from deleting files other apps own.
65
+ */
66
+ externalOrigin?: "lm-studio" | "jan" | "ollama" | "huggingface" | "text-gen-webui";
67
+ /** SHA256 of the GGUF file recorded at install time. Optional for legacy entries. */
68
+ sha256?: string;
69
+ /** ISO timestamp of the last successful re-verification. Absent = never verified since install. */
70
+ lastVerifiedAt?: string;
71
+ }
72
+ export type DownloadState = "queued" | "downloading" | "completed" | "failed" | "cancelled";
73
+ export interface DownloadJob {
74
+ jobId: string;
75
+ modelId: string;
76
+ state: DownloadState;
77
+ /** Bytes transferred so far. */
78
+ received: number;
79
+ /** Total bytes expected (from Content-Length or HEAD). */
80
+ total: number;
81
+ /** Moving-average bytes/sec over the last few seconds. */
82
+ bytesPerSec: number;
83
+ /** Milliseconds remaining based on current rate. Null when unknown. */
84
+ etaMs: number | null;
85
+ startedAt: string;
86
+ updatedAt: string;
87
+ /** Set when state === "failed". */
88
+ error?: string;
89
+ }
90
+ export interface ActiveModelState {
91
+ modelId: string | null;
92
+ loadedAt: string | null;
93
+ /**
94
+ * Human-readable load status. "idle" means nothing loaded.
95
+ * "loading" is set while we're swapping models.
96
+ */
97
+ status: "idle" | "loading" | "ready" | "error";
98
+ error?: string;
99
+ }
100
+ export interface DownloadEvent {
101
+ type: "progress" | "completed" | "failed" | "cancelled";
102
+ job: DownloadJob;
103
+ }
104
+ /**
105
+ * Agent model-type slots Eliza lets the user wire to local models. These
106
+ * match the `ModelType` enum in `@elizaos/core` — kept as string literals
107
+ * here so the types file stays framework-free.
108
+ */
109
+ export type AgentModelSlot = "TEXT_SMALL" | "TEXT_LARGE" | "TEXT_EMBEDDING" | "OBJECT_SMALL" | "OBJECT_LARGE";
110
+ export declare const AGENT_MODEL_SLOTS: AgentModelSlot[];
111
+ /** User-configured mapping of agent model slots → installed model ids. */
112
+ export type ModelAssignments = Partial<Record<AgentModelSlot, string>>;
113
+ export interface ModelHubSnapshot {
114
+ catalog: CatalogModel[];
115
+ installed: InstalledModel[];
116
+ active: ActiveModelState;
117
+ downloads: DownloadJob[];
118
+ hardware: HardwareProbe;
119
+ assignments: ModelAssignments;
120
+ }
121
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../app-core/src/services/local-inference/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Local inference model-management types.
3
+ *
4
+ * Shared across the service layer, API routes, and renderer.
5
+ * The catalog is Eliza-curated; installed models are tracked locally in a
6
+ * JSON registry under the state dir.
7
+ */
8
+ export const AGENT_MODEL_SLOTS = [
9
+ "TEXT_SMALL",
10
+ "TEXT_LARGE",
11
+ "TEXT_EMBEDDING",
12
+ "OBJECT_SMALL",
13
+ "OBJECT_LARGE",
14
+ ];
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Model-file integrity verification.
3
+ *
4
+ * GGUF files are large (0.8 – 20 GB). Corrupted files surface as cryptic
5
+ * llama.cpp errors much later, so we verify at install time and expose a
6
+ * manual verify button for users who want to re-check after a system
7
+ * event (crash, disk fill, external tool edited the file, etc).
8
+ *
9
+ * We don't require SHA256 from HuggingFace — HF doesn't publish per-file
10
+ * hashes in the standard API, and hand-curating them in the catalog would
11
+ * drift. Instead, after a successful download we compute the SHA256
12
+ * ourselves and stash it on the InstalledModel. Re-verify compares the
13
+ * file's current hash against the stashed one. A mismatch means the file
14
+ * changed on disk since we installed it — user can redownload.
15
+ *
16
+ * For GGUF specifically we also do a cheap structural header check
17
+ * (the file starts with the magic bytes "GGUF") so obvious truncations
18
+ * flag instantly without having to hash a 10GB file.
19
+ */
20
+ import type { InstalledModel } from "./types";
21
+ export type VerifyState = "unknown" | "ok" | "mismatch" | "missing" | "truncated";
22
+ export interface VerifyResult {
23
+ state: VerifyState;
24
+ /** SHA256 hex of the file as it exists now. Absent when file missing. */
25
+ currentSha256: string | null;
26
+ /** Hash from the registry, when available. */
27
+ expectedSha256: string | null;
28
+ /** Size read from the filesystem. */
29
+ currentBytes: number | null;
30
+ }
31
+ export declare function hashFile(path: string): Promise<string>;
32
+ /**
33
+ * Run the full verification pipeline on a model. Returns the state and
34
+ * the freshly computed hash so the caller can persist it to the registry.
35
+ */
36
+ export declare function verifyInstalledModel(model: InstalledModel): Promise<VerifyResult>;
37
+ /** Helper for tests — no runtime use. */
38
+ export declare function __registryPathForTests(): string;
39
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../../../../app-core/src/services/local-inference/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,IAAI,GACJ,UAAU,GACV,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,CAAC;IACnB,yEAAyE;IACzE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,8CAA8C;IAC9C,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qCAAqC;IACrC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AA4BD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU5D;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,YAAY,CAAC,CAmCvB;AAED,yCAAyC;AACzC,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Model-file integrity verification.
3
+ *
4
+ * GGUF files are large (0.8 – 20 GB). Corrupted files surface as cryptic
5
+ * llama.cpp errors much later, so we verify at install time and expose a
6
+ * manual verify button for users who want to re-check after a system
7
+ * event (crash, disk fill, external tool edited the file, etc).
8
+ *
9
+ * We don't require SHA256 from HuggingFace — HF doesn't publish per-file
10
+ * hashes in the standard API, and hand-curating them in the catalog would
11
+ * drift. Instead, after a successful download we compute the SHA256
12
+ * ourselves and stash it on the InstalledModel. Re-verify compares the
13
+ * file's current hash against the stashed one. A mismatch means the file
14
+ * changed on disk since we installed it — user can redownload.
15
+ *
16
+ * For GGUF specifically we also do a cheap structural header check
17
+ * (the file starts with the magic bytes "GGUF") so obvious truncations
18
+ * flag instantly without having to hash a 10GB file.
19
+ */
20
+ import { createHash } from "node:crypto";
21
+ import fs from "node:fs";
22
+ import fsp from "node:fs/promises";
23
+ import { registryPath } from "./paths";
24
+ const GGUF_MAGIC = Buffer.from("GGUF", "ascii");
25
+ async function fileExists(path) {
26
+ try {
27
+ const stat = await fsp.stat(path);
28
+ return stat.isFile();
29
+ }
30
+ catch {
31
+ return false;
32
+ }
33
+ }
34
+ async function isGgufHeader(path) {
35
+ try {
36
+ const fd = await fsp.open(path, "r");
37
+ try {
38
+ const buf = Buffer.alloc(4);
39
+ await fd.read(buf, 0, 4, 0);
40
+ return buf.equals(GGUF_MAGIC);
41
+ }
42
+ finally {
43
+ await fd.close();
44
+ }
45
+ }
46
+ catch {
47
+ return false;
48
+ }
49
+ }
50
+ export async function hashFile(path) {
51
+ return new Promise((resolve, reject) => {
52
+ const hasher = createHash("sha256");
53
+ const stream = fs.createReadStream(path, { highWaterMark: 1 << 20 });
54
+ stream.on("data", (chunk) => {
55
+ hasher.update(chunk);
56
+ });
57
+ stream.on("end", () => resolve(hasher.digest("hex")));
58
+ stream.on("error", reject);
59
+ });
60
+ }
61
+ /**
62
+ * Run the full verification pipeline on a model. Returns the state and
63
+ * the freshly computed hash so the caller can persist it to the registry.
64
+ */
65
+ export async function verifyInstalledModel(model) {
66
+ if (!(await fileExists(model.path))) {
67
+ return {
68
+ state: "missing",
69
+ currentSha256: null,
70
+ expectedSha256: model.sha256 ?? null,
71
+ currentBytes: null,
72
+ };
73
+ }
74
+ const stat = await fsp.stat(model.path);
75
+ if (!(await isGgufHeader(model.path))) {
76
+ return {
77
+ state: "truncated",
78
+ currentSha256: null,
79
+ expectedSha256: model.sha256 ?? null,
80
+ currentBytes: stat.size,
81
+ };
82
+ }
83
+ const currentSha256 = await hashFile(model.path);
84
+ if (!model.sha256) {
85
+ // First-time verification — no baseline to compare against. Caller
86
+ // decides whether to treat this as "ok" and persist the hash.
87
+ return {
88
+ state: "unknown",
89
+ currentSha256,
90
+ expectedSha256: null,
91
+ currentBytes: stat.size,
92
+ };
93
+ }
94
+ return {
95
+ state: currentSha256 === model.sha256 ? "ok" : "mismatch",
96
+ currentSha256,
97
+ expectedSha256: model.sha256,
98
+ currentBytes: stat.size,
99
+ };
100
+ }
101
+ /** Helper for tests — no runtime use. */
102
+ export function __registryPathForTests() {
103
+ return registryPath();
104
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Boot-time secret hydration: walk known plaintext sources, push sensitive
3
+ * values to the shared vault, and rewrite the on-disk plaintext to
4
+ * `vault://<KEY>` sentinels.
5
+ *
6
+ * Sources (in order):
7
+ * 1. eliza.json `env[KEY]` and `env.vars[KEY]`
8
+ * 2. `<stateDir>/config.env`
9
+ * 3. eliza.json `plugins.entries[<id>].config[KEY]`
10
+ * 4. `process.env[KEY]` for keys flagged sensitive in any registered plugin
11
+ * (does not mutate process.env — only mirrors to the vault).
12
+ *
13
+ * Idempotent: a hydration marker at `<stateDir>/.vault-hydrated.json`
14
+ * keeps re-runs cheap once a clean migration has completed. Per-key
15
+ * failures are isolated; if every write fails the function throws.
16
+ */
17
+ import type { Vault } from "@elizaos/vault";
18
+ export interface VaultBootstrapResult {
19
+ migrated: number;
20
+ alreadyHydrated: number;
21
+ failed: string[];
22
+ }
23
+ interface VaultBootstrapOptions {
24
+ configPath?: string;
25
+ stateDir?: string;
26
+ /** Test seam — defaults to `sharedVault()`. */
27
+ vault?: Vault;
28
+ }
29
+ export declare function runVaultBootstrap(opts?: VaultBootstrapOptions): Promise<VaultBootstrapResult>;
30
+ export {};
31
+ //# sourceMappingURL=vault-bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-bootstrap.d.ts","sourceRoot":"","sources":["../../../../../../app-core/src/services/vault-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgBH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAe5C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,UAAU,qBAAqB;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AA+MD,wBAAsB,iBAAiB,CACrC,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAgE/B"}