@elizaos/app-core 2.0.0-alpha.85 → 2.0.0-beta.1

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 (1885) hide show
  1. package/account-pool.d.ts +6 -0
  2. package/account-pool.d.ts.map +1 -0
  3. package/account-pool.js +5 -0
  4. package/api/__tests__/sandbox-test-helpers.d.ts +10 -0
  5. package/api/__tests__/sandbox-test-helpers.d.ts.map +1 -0
  6. package/api/__tests__/sandbox-test-helpers.js +15 -0
  7. package/api/auth/audit.d.ts +52 -0
  8. package/api/auth/audit.d.ts.map +1 -0
  9. package/api/auth/audit.js +126 -0
  10. package/api/auth/auth-context.d.ts +40 -0
  11. package/api/auth/auth-context.d.ts.map +1 -0
  12. package/api/auth/auth-context.js +68 -0
  13. package/api/auth/bootstrap-token.d.ts +50 -0
  14. package/api/auth/bootstrap-token.d.ts.map +1 -0
  15. package/api/auth/bootstrap-token.js +157 -0
  16. package/api/auth/index.d.ts +14 -0
  17. package/api/auth/index.d.ts.map +1 -0
  18. package/api/auth/index.js +13 -0
  19. package/api/auth/passwords.d.ts +65 -0
  20. package/api/auth/passwords.d.ts.map +1 -0
  21. package/api/auth/passwords.js +87 -0
  22. package/api/auth/sensitive-rate-limit.d.ts +56 -0
  23. package/api/auth/sensitive-rate-limit.d.ts.map +1 -0
  24. package/api/auth/sensitive-rate-limit.js +95 -0
  25. package/api/auth/sessions.d.ts +152 -0
  26. package/api/auth/sessions.d.ts.map +1 -0
  27. package/api/auth/sessions.js +298 -0
  28. package/api/auth/tokens.d.ts +3 -0
  29. package/api/auth/tokens.d.ts.map +1 -0
  30. package/api/auth/tokens.js +13 -0
  31. package/api/auth-bootstrap-routes.d.ts +32 -0
  32. package/api/auth-bootstrap-routes.d.ts.map +1 -0
  33. package/api/auth-bootstrap-routes.js +179 -0
  34. package/api/auth-pairing-compat-routes.d.ts +17 -0
  35. package/api/auth-pairing-compat-routes.d.ts.map +1 -0
  36. package/api/auth-pairing-compat-routes.js +301 -0
  37. package/api/auth-session-routes.d.ts +31 -0
  38. package/api/auth-session-routes.d.ts.map +1 -0
  39. package/api/auth-session-routes.js +560 -0
  40. package/api/auth.d.ts +153 -0
  41. package/api/auth.d.ts.map +1 -0
  42. package/api/auth.js +290 -0
  43. package/api/automation-node-contributors.d.ts +14 -0
  44. package/api/automation-node-contributors.d.ts.map +1 -0
  45. package/api/automation-node-contributors.js +14 -0
  46. package/api/automations-compat-routes.d.ts +18 -0
  47. package/api/automations-compat-routes.d.ts.map +1 -0
  48. package/api/automations-compat-routes.js +274 -0
  49. package/api/catalog-routes.d.ts +4 -0
  50. package/api/catalog-routes.d.ts.map +1 -0
  51. package/api/catalog-routes.js +61 -0
  52. package/api/compat-route-shared.d.ts +29 -0
  53. package/api/compat-route-shared.d.ts.map +1 -0
  54. package/api/compat-route-shared.js +298 -0
  55. package/api/credential-resolver.d.ts +31 -0
  56. package/api/credential-resolver.d.ts.map +1 -0
  57. package/api/credential-resolver.js +199 -0
  58. package/api/database-rows-compat-routes.d.ts +4 -0
  59. package/api/database-rows-compat-routes.d.ts.map +1 -0
  60. package/api/database-rows-compat-routes.js +100 -0
  61. package/api/dev-compat-routes.d.ts +11 -0
  62. package/api/dev-compat-routes.d.ts.map +1 -0
  63. package/api/dev-compat-routes.js +144 -0
  64. package/api/dev-console-log.d.ts +21 -0
  65. package/api/dev-console-log.d.ts.map +1 -0
  66. package/api/dev-console-log.js +65 -0
  67. package/api/dev-stack.d.ts +49 -0
  68. package/api/dev-stack.d.ts.map +1 -0
  69. package/api/dev-stack.js +60 -0
  70. package/api/local-inference-compat-routes.d.ts +16 -0
  71. package/api/local-inference-compat-routes.d.ts.map +1 -0
  72. package/api/local-inference-compat-routes.js +617 -0
  73. package/api/onboarding-compat-routes.d.ts +4 -0
  74. package/api/onboarding-compat-routes.d.ts.map +1 -0
  75. package/api/onboarding-compat-routes.js +207 -0
  76. package/api/plugins-compat-routes.d.ts +103 -0
  77. package/api/plugins-compat-routes.d.ts.map +1 -0
  78. package/api/plugins-compat-routes.js +1181 -0
  79. package/api/response.d.ts +4 -0
  80. package/api/response.d.ts.map +1 -0
  81. package/api/response.js +28 -0
  82. package/api/runtime-mode-routes.d.ts +13 -0
  83. package/api/runtime-mode-routes.d.ts.map +1 -0
  84. package/api/runtime-mode-routes.js +32 -0
  85. package/api/secrets-inventory-routes.d.ts +39 -0
  86. package/api/secrets-inventory-routes.d.ts.map +1 -0
  87. package/api/secrets-inventory-routes.js +487 -0
  88. package/api/secrets-manager-routes.d.ts +9 -0
  89. package/api/secrets-manager-routes.d.ts.map +1 -0
  90. package/api/secrets-manager-routes.js +476 -0
  91. package/api/sensitive-request-routes.d.ts +20 -0
  92. package/api/sensitive-request-routes.d.ts.map +1 -0
  93. package/api/sensitive-request-routes.js +489 -0
  94. package/api/sensitive-request-store.d.ts +39 -0
  95. package/api/sensitive-request-store.d.ts.map +1 -0
  96. package/api/sensitive-request-store.js +204 -0
  97. package/api/server-config-filter.d.ts +14 -0
  98. package/api/server-config-filter.d.ts.map +1 -0
  99. package/api/server-config-filter.js +77 -0
  100. package/api/server-cors.d.ts +30 -0
  101. package/api/server-cors.d.ts.map +1 -0
  102. package/api/server-cors.js +128 -0
  103. package/api/server-html.d.ts +4 -0
  104. package/api/server-html.d.ts.map +1 -0
  105. package/api/server-html.js +5 -0
  106. package/api/server-onboarding-compat.d.ts +31 -0
  107. package/api/server-onboarding-compat.d.ts.map +1 -0
  108. package/api/server-onboarding-compat.js +283 -0
  109. package/api/server-security.d.ts +11 -0
  110. package/api/server-security.d.ts.map +1 -0
  111. package/api/server-security.js +29 -0
  112. package/api/server-startup.d.ts +5 -0
  113. package/api/server-startup.d.ts.map +1 -0
  114. package/api/server-startup.js +74 -0
  115. package/api/server-wallet-trade.d.ts +10 -0
  116. package/api/server-wallet-trade.d.ts.map +1 -0
  117. package/api/server-wallet-trade.js +240 -0
  118. package/api/server.d.ts +32 -0
  119. package/api/server.d.ts.map +1 -0
  120. package/api/server.js +768 -0
  121. package/api/workbench-compat-routes.d.ts +11 -0
  122. package/api/workbench-compat-routes.d.ts.map +1 -0
  123. package/api/workbench-compat-routes.js +325 -0
  124. package/benchmark/cua-routes.d.ts +10 -0
  125. package/benchmark/cua-routes.d.ts.map +1 -0
  126. package/benchmark/cua-routes.js +179 -0
  127. package/benchmark/lifeops-bench-handler.d.ts +94 -0
  128. package/benchmark/lifeops-bench-handler.d.ts.map +1 -0
  129. package/benchmark/lifeops-bench-handler.js +280 -0
  130. package/benchmark/lifeops-fake-backend.d.ts +227 -0
  131. package/benchmark/lifeops-fake-backend.d.ts.map +1 -0
  132. package/benchmark/lifeops-fake-backend.js +499 -0
  133. package/benchmark/mock-plugin-base.d.ts +9 -0
  134. package/benchmark/mock-plugin-base.d.ts.map +1 -0
  135. package/benchmark/mock-plugin-base.js +325 -0
  136. package/benchmark/mock-plugin.d.ts +3 -0
  137. package/benchmark/mock-plugin.d.ts.map +1 -0
  138. package/benchmark/mock-plugin.js +504 -0
  139. package/benchmark/params.d.ts +2 -0
  140. package/benchmark/params.d.ts.map +1 -0
  141. package/benchmark/params.js +18 -0
  142. package/benchmark/plugin.d.ts +42 -0
  143. package/benchmark/plugin.d.ts.map +1 -0
  144. package/benchmark/plugin.js +422 -0
  145. package/benchmark/replay-capture.d.ts +73 -0
  146. package/benchmark/replay-capture.d.ts.map +1 -0
  147. package/benchmark/replay-capture.js +223 -0
  148. package/benchmark/server-utils.d.ts +100 -0
  149. package/benchmark/server-utils.d.ts.map +1 -0
  150. package/benchmark/server-utils.js +289 -0
  151. package/benchmark/server.d.ts +2 -0
  152. package/benchmark/server.d.ts.map +1 -0
  153. package/benchmark/server.js +1176 -0
  154. package/browser.d.ts +13 -0
  155. package/browser.d.ts.map +1 -0
  156. package/browser.js +15 -0
  157. package/cli/argv.d.ts +17 -0
  158. package/cli/argv.d.ts.map +1 -0
  159. package/cli/argv.js +140 -0
  160. package/cli/banner.d.ts +11 -0
  161. package/cli/banner.d.ts.map +1 -0
  162. package/cli/banner.js +36 -0
  163. package/cli/cli-name.d.ts +5 -0
  164. package/cli/cli-name.d.ts.map +1 -0
  165. package/cli/cli-name.js +21 -0
  166. package/cli/cli-utils.d.ts +5 -0
  167. package/cli/cli-utils.d.ts.map +1 -0
  168. package/cli/cli-utils.js +13 -0
  169. package/cli/command-format.d.ts +2 -0
  170. package/cli/command-format.d.ts.map +1 -0
  171. package/cli/command-format.js +20 -0
  172. package/cli/doctor/checks.d.ts +96 -0
  173. package/cli/doctor/checks.d.ts.map +1 -0
  174. package/cli/doctor/checks.js +483 -0
  175. package/cli/git-commit.d.ts +5 -0
  176. package/cli/git-commit.d.ts.map +1 -0
  177. package/cli/git-commit.js +106 -0
  178. package/cli/parse-duration.d.ts +5 -0
  179. package/cli/parse-duration.d.ts.map +1 -0
  180. package/cli/parse-duration.js +27 -0
  181. package/cli/plugins-cli.d.ts +26 -0
  182. package/cli/plugins-cli.d.ts.map +1 -0
  183. package/cli/plugins-cli.js +892 -0
  184. package/cli/profile-utils.d.ts +3 -0
  185. package/cli/profile-utils.d.ts.map +1 -0
  186. package/cli/profile-utils.js +21 -0
  187. package/cli/profile.d.ts +15 -0
  188. package/cli/profile.d.ts.map +1 -0
  189. package/cli/profile.js +93 -0
  190. package/cli/program/build-program.d.ts +3 -0
  191. package/cli/program/build-program.d.ts.map +1 -0
  192. package/cli/program/build-program.js +12 -0
  193. package/cli/program/command-registry.d.ts +3 -0
  194. package/cli/program/command-registry.d.ts.map +1 -0
  195. package/cli/program/command-registry.js +24 -0
  196. package/cli/program/help.d.ts +3 -0
  197. package/cli/program/help.d.ts.map +1 -0
  198. package/cli/program/help.js +57 -0
  199. package/cli/program/preaction.d.ts +3 -0
  200. package/cli/program/preaction.d.ts.map +1 -0
  201. package/cli/program/preaction.js +40 -0
  202. package/cli/program/register.auth.d.ts +51 -0
  203. package/cli/program/register.auth.d.ts.map +1 -0
  204. package/cli/program/register.auth.js +203 -0
  205. package/cli/program/register.benchmark.d.ts +3 -0
  206. package/cli/program/register.benchmark.d.ts.map +1 -0
  207. package/cli/program/register.benchmark.js +12 -0
  208. package/cli/program/register.config.d.ts +3 -0
  209. package/cli/program/register.config.d.ts.map +1 -0
  210. package/cli/program/register.config.js +150 -0
  211. package/cli/program/register.configure.d.ts +3 -0
  212. package/cli/program/register.configure.d.ts.map +1 -0
  213. package/cli/program/register.configure.js +18 -0
  214. package/cli/program/register.dashboard.d.ts +3 -0
  215. package/cli/program/register.dashboard.d.ts.map +1 -0
  216. package/cli/program/register.dashboard.js +124 -0
  217. package/cli/program/register.db.d.ts +3 -0
  218. package/cli/program/register.db.d.ts.map +1 -0
  219. package/cli/program/register.db.js +45 -0
  220. package/cli/program/register.doctor.d.ts +3 -0
  221. package/cli/program/register.doctor.d.ts.map +1 -0
  222. package/cli/program/register.doctor.js +170 -0
  223. package/cli/program/register.models.d.ts +3 -0
  224. package/cli/program/register.models.d.ts.map +1 -0
  225. package/cli/program/register.models.js +32 -0
  226. package/cli/program/register.setup.d.ts +16 -0
  227. package/cli/program/register.setup.d.ts.map +1 -0
  228. package/cli/program/register.setup.js +333 -0
  229. package/cli/program/register.start.d.ts +3 -0
  230. package/cli/program/register.start.d.ts.map +1 -0
  231. package/cli/program/register.start.js +95 -0
  232. package/cli/program/register.subclis.d.ts +4 -0
  233. package/cli/program/register.subclis.d.ts.map +1 -0
  234. package/cli/program/register.subclis.js +87 -0
  235. package/cli/program/register.update.d.ts +12 -0
  236. package/cli/program/register.update.d.ts.map +1 -0
  237. package/cli/program/register.update.js +173 -0
  238. package/cli/program.d.ts +2 -0
  239. package/cli/program.d.ts.map +1 -0
  240. package/cli/program.js +1 -0
  241. package/cli/run-main.d.ts +2 -0
  242. package/cli/run-main.d.ts.map +1 -0
  243. package/cli/run-main.js +71 -0
  244. package/cli/version.d.ts +2 -0
  245. package/cli/version.d.ts.map +1 -0
  246. package/cli/version.js +2 -0
  247. package/connectors/capacitor-jsc.d.ts +66 -0
  248. package/connectors/capacitor-jsc.d.ts.map +1 -0
  249. package/connectors/capacitor-jsc.js +39 -0
  250. package/connectors/capacitor-quickjs.d.ts +64 -0
  251. package/connectors/capacitor-quickjs.d.ts.map +1 -0
  252. package/connectors/capacitor-quickjs.js +50 -0
  253. package/connectors/capacitor-sqlite.d.ts +41 -0
  254. package/connectors/capacitor-sqlite.d.ts.map +1 -0
  255. package/connectors/capacitor-sqlite.js +87 -0
  256. package/diagnostics/integration-observability.d.ts +40 -0
  257. package/diagnostics/integration-observability.d.ts.map +1 -0
  258. package/diagnostics/integration-observability.js +68 -0
  259. package/entry.d.ts +10 -0
  260. package/entry.d.ts.map +1 -0
  261. package/entry.js +66 -0
  262. package/index.d.ts +34 -4
  263. package/index.d.ts.map +1 -1
  264. package/index.js +42 -6
  265. package/package.json +81 -151
  266. package/packaging/PUBLISHING_GUIDE.md +707 -0
  267. package/packaging/debian/changelog +9 -0
  268. package/packaging/debian/control +26 -0
  269. package/packaging/debian/copyright +27 -0
  270. package/packaging/debian/elizaos-app.service +15 -0
  271. package/packaging/debian/install +4 -0
  272. package/packaging/debian/postinst +28 -0
  273. package/packaging/debian/prerm +14 -0
  274. package/packaging/debian/rules +44 -0
  275. package/packaging/debian/source/format +1 -0
  276. package/packaging/flatpak/README.md +150 -0
  277. package/packaging/flatpak/ai.elizaos.App.desktop +11 -0
  278. package/packaging/flatpak/ai.elizaos.App.metainfo.xml +81 -0
  279. package/packaging/flatpak/ai.elizaos.App.store.yml +142 -0
  280. package/packaging/flatpak/ai.elizaos.App.yml +142 -0
  281. package/packaging/flatpak/elizaos-app-wrapper.sh +5 -0
  282. package/packaging/flatpak/elizaos-app-wrapper.store.sh +16 -0
  283. package/packaging/flatpak/icons/128x128/ai.elizaos.App.png +0 -0
  284. package/packaging/flatpak/icons/256x256/ai.elizaos.App.png +0 -0
  285. package/packaging/flatpak/icons/512x512/ai.elizaos.App.png +0 -0
  286. package/packaging/homebrew/README.md +80 -0
  287. package/packaging/homebrew/elizaos-app.cask.rb +60 -0
  288. package/packaging/homebrew/elizaos-app.rb +49 -0
  289. package/packaging/inno/ElizaOSApp.iss +53 -0
  290. package/packaging/inno/build-inno.ps1 +231 -0
  291. package/packaging/msix/AppxManifest.store.xml +79 -0
  292. package/packaging/msix/AppxManifest.xml +53 -0
  293. package/packaging/msix/README.md +201 -0
  294. package/packaging/msix/assets/LargeTile.png +0 -0
  295. package/packaging/msix/assets/Square150x150Logo.png +0 -0
  296. package/packaging/msix/assets/Square44x44Logo.png +0 -0
  297. package/packaging/msix/assets/StoreLogo.png +0 -0
  298. package/packaging/msix/assets/Wide310x150Logo.png +0 -0
  299. package/packaging/msix/build-msix.ps1 +206 -0
  300. package/packaging/msix/generate-placeholder-assets.ps1 +49 -0
  301. package/packaging/msix/store/description.md +31 -0
  302. package/packaging/msix/store/listing.json +27 -0
  303. package/packaging/pypi/README.md +14 -0
  304. package/packaging/pypi/elizaos_app/__init__.py +7 -0
  305. package/packaging/pypi/elizaos_app/__main__.py +6 -0
  306. package/packaging/pypi/elizaos_app/cli.py +21 -0
  307. package/packaging/pypi/elizaos_app/loader.py +127 -0
  308. package/packaging/pypi/elizaos_app/py.typed +1 -0
  309. package/packaging/pypi/pyproject.toml +38 -0
  310. package/packaging/snap/snapcraft.yaml +560 -0
  311. package/packaging/test-packaging.sh +309 -0
  312. package/patches/@noble%2Fcurves@2.0.1.patch +33 -0
  313. package/patches/@pixiv%2Fthree-vrm@3.5.2.patch +26 -0
  314. package/patches/coding-agent-adapters@0.16.3.patch +44 -0
  315. package/patches/electrobun@1.16.0.patch +13 -0
  316. package/patches/llama-cpp-capacitor@0.1.5.patch +2387 -0
  317. package/patches/proper-lockfile@4.1.2.patch +14 -0
  318. package/patches/pty-manager@1.11.0.patch +194 -0
  319. package/permissions/types.d.ts +8 -0
  320. package/permissions/types.d.ts.map +1 -0
  321. package/permissions/types.js +7 -0
  322. package/platform/agent-browser-stub.d.ts +27 -0
  323. package/platform/agent-browser-stub.d.ts.map +1 -0
  324. package/platform/agent-browser-stub.js +16 -0
  325. package/platform/empty-node-module.d.ts +31 -0
  326. package/platform/empty-node-module.d.ts.map +1 -0
  327. package/platform/empty-node-module.js +22 -0
  328. package/platforms/android/Gemfile +6 -0
  329. package/platforms/android/README.md +79 -0
  330. package/platforms/android/app/build.gradle +124 -0
  331. package/platforms/android/app/capacitor.build.gradle +32 -0
  332. package/platforms/android/app/proguard-rules.pro +46 -0
  333. package/platforms/android/app/src/androidTest/java/ai/elizaos/app/ElizaOsInstrumentedTest.java +162 -0
  334. package/platforms/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
  335. package/platforms/android/app/src/main/AndroidManifest.xml +83 -0
  336. package/platforms/android/app/src/main/java/ai/elizaos/app/AgentPlugin.java +232 -0
  337. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAgentService.java +1514 -0
  338. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaAssistActivity.java +21 -0
  339. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBootReceiver.java +61 -0
  340. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaBrowserActivity.java +39 -0
  341. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaCalendarActivity.java +75 -0
  342. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaCameraActivity.java +54 -0
  343. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaClockActivity.java +70 -0
  344. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaContactsActivity.java +56 -0
  345. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaDialActivity.java +83 -0
  346. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaInCallService.java +168 -0
  347. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaMmsReceiver.java +70 -0
  348. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaNativeBridge.java +38 -0
  349. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaRespondViaMessageService.java +119 -0
  350. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsComposeActivity.java +50 -0
  351. package/platforms/android/app/src/main/java/ai/elizaos/app/ElizaSmsReceiver.java +84 -0
  352. package/platforms/android/app/src/main/java/ai/elizaos/app/GatewayConnectionService.java +211 -0
  353. package/platforms/android/app/src/main/java/ai/elizaos/app/MainActivity.java +202 -0
  354. package/platforms/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
  355. package/platforms/android/app/src/main/res/drawable/splash.png +0 -0
  356. package/platforms/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
  357. package/platforms/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
  358. package/platforms/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
  359. package/platforms/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
  360. package/platforms/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
  361. package/platforms/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
  362. package/platforms/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
  363. package/platforms/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
  364. package/platforms/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
  365. package/platforms/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
  366. package/platforms/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  367. package/platforms/android/app/src/main/res/layout/activity_main.xml +12 -0
  368. package/platforms/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  369. package/platforms/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  370. package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  371. package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  372. package/platforms/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  373. package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  374. package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  375. package/platforms/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  376. package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  377. package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  378. package/platforms/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  379. package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  380. package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  381. package/platforms/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  382. package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  383. package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  384. package/platforms/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  385. package/platforms/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
  386. package/platforms/android/app/src/main/res/values/strings.xml +7 -0
  387. package/platforms/android/app/src/main/res/values/styles.xml +22 -0
  388. package/platforms/android/app/src/main/res/xml/file_paths.xml +5 -0
  389. package/platforms/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
  390. package/platforms/android/build.gradle +63 -0
  391. package/platforms/android/capacitor-cordova-android-plugins/build.gradle +53 -0
  392. package/platforms/android/capacitor-cordova-android-plugins/cordova.variables.gradle +3 -0
  393. package/platforms/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml +3 -0
  394. package/platforms/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep +1 -0
  395. package/platforms/android/capacitor-cordova-android-plugins/src/main/res/.gitkeep +1 -0
  396. package/platforms/android/capacitor.settings.gradle +45 -0
  397. package/platforms/android/fastlane/Appfile +2 -0
  398. package/platforms/android/fastlane/Fastfile +59 -0
  399. package/platforms/android/fastlane/metadata/android/en-US/full_description.txt +24 -0
  400. package/platforms/android/fastlane/metadata/android/en-US/short_description.txt +1 -0
  401. package/platforms/android/fastlane/metadata/android/en-US/title.txt +1 -0
  402. package/platforms/android/fastlane/metadata/android/en-US/video.txt +0 -0
  403. package/platforms/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  404. package/platforms/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  405. package/platforms/android/gradle.properties +27 -0
  406. package/platforms/android/gradlew +251 -0
  407. package/platforms/android/gradlew.bat +94 -0
  408. package/platforms/android/settings.gradle +13 -0
  409. package/platforms/android/variables.gradle +17 -0
  410. package/platforms/electrobun/.generated/brand-config.json +8 -0
  411. package/platforms/electrobun/README.md +44 -0
  412. package/platforms/electrobun/assets/appIcon.ico +0 -0
  413. package/platforms/electrobun/assets/appIcon.iconset/icon_128x128.png +0 -0
  414. package/platforms/electrobun/assets/appIcon.iconset/icon_128x128@2x.png +0 -0
  415. package/platforms/electrobun/assets/appIcon.iconset/icon_16x16.png +0 -0
  416. package/platforms/electrobun/assets/appIcon.iconset/icon_16x16@2x.png +0 -0
  417. package/platforms/electrobun/assets/appIcon.iconset/icon_256x256.png +0 -0
  418. package/platforms/electrobun/assets/appIcon.iconset/icon_256x256@2x.png +0 -0
  419. package/platforms/electrobun/assets/appIcon.iconset/icon_32x32.png +0 -0
  420. package/platforms/electrobun/assets/appIcon.iconset/icon_32x32@2x.png +0 -0
  421. package/platforms/electrobun/assets/appIcon.iconset/icon_512x512.png +0 -0
  422. package/platforms/electrobun/assets/appIcon.iconset/icon_512x512@2x.png +0 -0
  423. package/platforms/electrobun/assets/appIcon.png +0 -0
  424. package/platforms/electrobun/assets/brand-config.json +8 -0
  425. package/platforms/electrobun/biome.json +11 -0
  426. package/platforms/electrobun/electrobun.config.ts +435 -0
  427. package/platforms/electrobun/entitlements/README.md +54 -0
  428. package/platforms/electrobun/entitlements/mas-child.entitlements +10 -0
  429. package/platforms/electrobun/entitlements/mas.entitlements +41 -0
  430. package/platforms/electrobun/native/macos/window-effects.mm +927 -0
  431. package/platforms/electrobun/package.json +33 -0
  432. package/platforms/electrobun/scripts/bin/zip +2 -0
  433. package/platforms/electrobun/scripts/build-macos-effects.sh +31 -0
  434. package/platforms/electrobun/scripts/build-whisper-universal.sh +137 -0
  435. package/platforms/electrobun/scripts/build-whisper.sh +95 -0
  436. package/platforms/electrobun/scripts/ensure-whisper-model.sh +93 -0
  437. package/platforms/electrobun/scripts/hdiutil-wrapper.sh +33 -0
  438. package/platforms/electrobun/scripts/lib/app-dir.mjs +74 -0
  439. package/platforms/electrobun/scripts/lib/repo-root.mjs +77 -0
  440. package/platforms/electrobun/scripts/local-adhoc-sign-macos.ts +214 -0
  441. package/platforms/electrobun/scripts/macos-direct-launcher.c +84 -0
  442. package/platforms/electrobun/scripts/postwrap-diagnostics.ts +423 -0
  443. package/platforms/electrobun/scripts/postwrap-sign-runtime-macos.ts +352 -0
  444. package/platforms/electrobun/scripts/sign-windows.ps1 +121 -0
  445. package/platforms/electrobun/scripts/smoke-test-windows.ps1 +907 -0
  446. package/platforms/electrobun/scripts/smoke-test.sh +1186 -0
  447. package/platforms/electrobun/scripts/stage-macos-release-artifacts.sh +491 -0
  448. package/platforms/electrobun/scripts/sync-web-assets.mjs +48 -0
  449. package/platforms/electrobun/scripts/verify-rpc-handlers.ts +162 -0
  450. package/platforms/electrobun/scripts/verify-windows-installer-proof.ps1 +203 -0
  451. package/platforms/electrobun/scripts/xcrun-wrapper.sh +80 -0
  452. package/platforms/electrobun/scripts/zip-wrapper.sh +6 -0
  453. package/platforms/electrobun/src/__stubs__/bun-ffi.ts +35 -0
  454. package/platforms/electrobun/src/__stubs__/electrobun-bun.ts +20 -0
  455. package/platforms/electrobun/src/agent-ready-state.ts +35 -0
  456. package/platforms/electrobun/src/agent-reset-from-main.ts +87 -0
  457. package/platforms/electrobun/src/api-base.ts +169 -0
  458. package/platforms/electrobun/src/application-menu-action-registry.ts +21 -0
  459. package/platforms/electrobun/src/application-menu.ts +418 -0
  460. package/platforms/electrobun/src/background-notice.ts +65 -0
  461. package/platforms/electrobun/src/brand-config.ts +184 -0
  462. package/platforms/electrobun/src/bridge/browser-tabs-renderer-registry.ts +60 -0
  463. package/platforms/electrobun/src/bridge/electrobun-direct-rpc.ts +430 -0
  464. package/platforms/electrobun/src/bridge/electrobun-preload.ts +1 -0
  465. package/platforms/electrobun/src/bridge/electrobun-stub.ts +21 -0
  466. package/platforms/electrobun/src/browser-workspace-bridge-server.ts +284 -0
  467. package/platforms/electrobun/src/cloud-auth-window.ts +216 -0
  468. package/platforms/electrobun/src/cloud-disconnect-from-main.ts +118 -0
  469. package/platforms/electrobun/src/constants.ts +2 -0
  470. package/platforms/electrobun/src/desktop-http-request.test.ts +85 -0
  471. package/platforms/electrobun/src/desktop-http-request.ts +103 -0
  472. package/platforms/electrobun/src/desktop-test-bridge-server.ts +248 -0
  473. package/platforms/electrobun/src/devtools-layout.ts +63 -0
  474. package/platforms/electrobun/src/diagnostic-format.ts +65 -0
  475. package/platforms/electrobun/src/fatal-shutdown.test.ts +30 -0
  476. package/platforms/electrobun/src/fatal-shutdown.ts +10 -0
  477. package/platforms/electrobun/src/floating-chat-window.ts +239 -0
  478. package/platforms/electrobun/src/index.ts +2510 -0
  479. package/platforms/electrobun/src/libMacWindowEffects.dylib +0 -0
  480. package/platforms/electrobun/src/lifecycle/api-base-owner.ts +119 -0
  481. package/platforms/electrobun/src/lifecycle/desktop-session-prime.ts +77 -0
  482. package/platforms/electrobun/src/logger.ts +23 -0
  483. package/platforms/electrobun/src/main-window-runtime.ts +117 -0
  484. package/platforms/electrobun/src/main-window-session.ts +88 -0
  485. package/platforms/electrobun/src/menu-reset-from-main.ts +211 -0
  486. package/platforms/electrobun/src/native/agent.ts +1892 -0
  487. package/platforms/electrobun/src/native/auth-bridge.ts +525 -0
  488. package/platforms/electrobun/src/native/browser-workspace.ts +574 -0
  489. package/platforms/electrobun/src/native/camera.ts +68 -0
  490. package/platforms/electrobun/src/native/canvas.ts +504 -0
  491. package/platforms/electrobun/src/native/credentials.ts +765 -0
  492. package/platforms/electrobun/src/native/desktop.ts +2284 -0
  493. package/platforms/electrobun/src/native/editor-bridge.ts +292 -0
  494. package/platforms/electrobun/src/native/file-watcher.ts +220 -0
  495. package/platforms/electrobun/src/native/gateway.ts +218 -0
  496. package/platforms/electrobun/src/native/gpu-window.ts +301 -0
  497. package/platforms/electrobun/src/native/index.ts +105 -0
  498. package/platforms/electrobun/src/native/location.ts +110 -0
  499. package/platforms/electrobun/src/native/loopback-port.ts +81 -0
  500. package/platforms/electrobun/src/native/mac-window-effects.ts +118 -0
  501. package/platforms/electrobun/src/native/music-player.ts +61 -0
  502. package/platforms/electrobun/src/native/permissions-darwin.ts +342 -0
  503. package/platforms/electrobun/src/native/permissions-linux.ts +34 -0
  504. package/platforms/electrobun/src/native/permissions-shared.ts +170 -0
  505. package/platforms/electrobun/src/native/permissions-win32.ts +56 -0
  506. package/platforms/electrobun/src/native/permissions.ts +237 -0
  507. package/platforms/electrobun/src/native/power-state.ts +195 -0
  508. package/platforms/electrobun/src/native/screencapture.ts +654 -0
  509. package/platforms/electrobun/src/native/steward.ts +343 -0
  510. package/platforms/electrobun/src/native/swabble.ts +349 -0
  511. package/platforms/electrobun/src/native/talkmode.ts +441 -0
  512. package/platforms/electrobun/src/native/webgpu-browser-support.ts +220 -0
  513. package/platforms/electrobun/src/native/whisper.ts +280 -0
  514. package/platforms/electrobun/src/preload-validation.ts +65 -0
  515. package/platforms/electrobun/src/preload.js +1 -0
  516. package/platforms/electrobun/src/print-electrobun-dev-settings-banner.ts +140 -0
  517. package/platforms/electrobun/src/renderer-static.ts +77 -0
  518. package/platforms/electrobun/src/rpc-handlers.ts +1072 -0
  519. package/platforms/electrobun/src/rpc-schema.ts +1835 -0
  520. package/platforms/electrobun/src/runtime-layout.ts +150 -0
  521. package/platforms/electrobun/src/runtime-permissions.ts +125 -0
  522. package/platforms/electrobun/src/screenshot-dev-server.ts +125 -0
  523. package/platforms/electrobun/src/startup-trace.ts +351 -0
  524. package/platforms/electrobun/src/surface-windows.ts +475 -0
  525. package/platforms/electrobun/src/types/web-speech.d.ts +52 -0
  526. package/platforms/electrobun/src/types.ts +18 -0
  527. package/platforms/electrobun/src/windows-cef-profile.ts +124 -0
  528. package/platforms/electrobun/tsconfig.json +75 -0
  529. package/platforms/electrobun/vitest.electrobun.config.ts +54 -0
  530. package/platforms/ios/App/App/App.entitlements +18 -0
  531. package/platforms/ios/App/App/AppDelegate.swift +93 -0
  532. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ios-marketing-1024.png +0 -0
  533. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20x20@1x.png +0 -0
  534. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20x20@2x.png +0 -0
  535. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29x29@1x.png +0 -0
  536. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29x29@2x.png +0 -0
  537. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40x40@1x.png +0 -0
  538. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40x40@2x.png +0 -0
  539. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76x76@1x.png +0 -0
  540. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76x76@2x.png +0 -0
  541. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-83_5x83_5@2x.png +0 -0
  542. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-20x20@2x.png +0 -0
  543. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-20x20@3x.png +0 -0
  544. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-29x29@2x.png +0 -0
  545. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-29x29@3x.png +0 -0
  546. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-40x40@2x.png +0 -0
  547. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-40x40@3x.png +0 -0
  548. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-60x60@2x.png +0 -0
  549. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-60x60@3x.png +0 -0
  550. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +116 -0
  551. package/platforms/ios/App/App/Assets.xcassets/Contents.json +6 -0
  552. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  553. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  554. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  555. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  556. package/platforms/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  557. package/platforms/ios/App/App/Base.lproj/Main.storyboard +19 -0
  558. package/platforms/ios/App/App/ElizaIntentPlugin.swift +185 -0
  559. package/platforms/ios/App/App/Info.plist +123 -0
  560. package/platforms/ios/App/App/PrivacyInfo.xcprivacy +55 -0
  561. package/platforms/ios/App/App/SceneDelegate.swift +77 -0
  562. package/platforms/ios/App/App/WebsiteBlockerContentExtension/ActionRequestHandler.swift +142 -0
  563. package/platforms/ios/App/App/WebsiteBlockerContentExtension/Info.plist +29 -0
  564. package/platforms/ios/App/App/WebsiteBlockerContentExtension/PrivacyInfo.xcprivacy +23 -0
  565. package/platforms/ios/App/App/WebsiteBlockerContentExtension/WebsiteBlockerContentExtension.entitlements +10 -0
  566. package/platforms/ios/App/App.xcodeproj/project.pbxproj +596 -0
  567. package/platforms/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
  568. package/platforms/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  569. package/platforms/ios/App/ExportOptions.plist +18 -0
  570. package/platforms/ios/App/Podfile +51 -0
  571. package/platforms/ios/App/Podfile.lock +131 -0
  572. package/platforms/ios/Gemfile +6 -0
  573. package/platforms/ios/fastlane/Appfile +4 -0
  574. package/platforms/ios/fastlane/Fastfile +94 -0
  575. package/platforms/ios/fastlane/Matchfile +12 -0
  576. package/platforms/ios/fastlane/metadata/en-US/description.txt +22 -0
  577. package/platforms/ios/fastlane/metadata/en-US/keywords.txt +1 -0
  578. package/platforms/ios/fastlane/metadata/en-US/marketing_url.txt +1 -0
  579. package/platforms/ios/fastlane/metadata/en-US/name.txt +1 -0
  580. package/platforms/ios/fastlane/metadata/en-US/privacy_url.txt +1 -0
  581. package/platforms/ios/fastlane/metadata/en-US/promotional_text.txt +1 -0
  582. package/platforms/ios/fastlane/metadata/en-US/subtitle.txt +1 -0
  583. package/platforms/ios/fastlane/metadata/en-US/support_url.txt +1 -0
  584. package/register-runtime-hooks.d.ts +2 -0
  585. package/register-runtime-hooks.d.ts.map +1 -0
  586. package/register-runtime-hooks.js +13 -0
  587. package/registry/generate-apps.d.ts +2 -0
  588. package/registry/generate-apps.d.ts.map +1 -0
  589. package/registry/generate-apps.js +338 -0
  590. package/registry/generate.d.ts +2 -0
  591. package/registry/generate.d.ts.map +1 -0
  592. package/registry/generate.js +506 -0
  593. package/registry/index.d.ts +6 -0
  594. package/registry/index.d.ts.map +1 -0
  595. package/registry/index.js +68 -0
  596. package/registry/loader.d.ts +27 -0
  597. package/registry/loader.d.ts.map +1 -0
  598. package/registry/loader.js +111 -0
  599. package/registry/schema.d.ts +989 -0
  600. package/registry/schema.d.ts.map +1 -0
  601. package/registry/schema.js +264 -0
  602. package/runtime/api-dev-settings-banner.d.ts +7 -0
  603. package/runtime/api-dev-settings-banner.d.ts.map +1 -0
  604. package/runtime/api-dev-settings-banner.js +104 -0
  605. package/runtime/app-route-plugin-registry.d.ts +3 -0
  606. package/runtime/app-route-plugin-registry.d.ts.map +1 -0
  607. package/runtime/app-route-plugin-registry.js +1 -0
  608. package/runtime/build-character-from-config.d.ts +3 -0
  609. package/runtime/build-character-from-config.d.ts.map +1 -0
  610. package/runtime/build-character-from-config.js +59 -0
  611. package/runtime/build-variant.d.ts +8 -0
  612. package/runtime/build-variant.d.ts.map +1 -0
  613. package/runtime/build-variant.js +7 -0
  614. package/runtime/channel-plugin-map.d.ts +6 -0
  615. package/runtime/channel-plugin-map.d.ts.map +1 -0
  616. package/runtime/channel-plugin-map.js +38 -0
  617. package/runtime/dev-server.d.ts +2 -0
  618. package/runtime/dev-server.d.ts.map +1 -0
  619. package/runtime/dev-server.js +383 -0
  620. package/runtime/dev-settings-figlet-heading.d.ts +22 -0
  621. package/runtime/dev-settings-figlet-heading.d.ts.map +1 -0
  622. package/runtime/dev-settings-figlet-heading.js +55 -0
  623. package/runtime/eliza.d.ts +21 -0
  624. package/runtime/eliza.d.ts.map +1 -0
  625. package/runtime/eliza.js +863 -0
  626. package/runtime/embedding-manager-support.d.ts +77 -0
  627. package/runtime/embedding-manager-support.d.ts.map +1 -0
  628. package/runtime/embedding-manager-support.js +309 -0
  629. package/runtime/embedding-presets.d.ts +5 -0
  630. package/runtime/embedding-presets.d.ts.map +1 -0
  631. package/runtime/embedding-presets.js +47 -0
  632. package/runtime/embedding-warmup-policy.d.ts +13 -0
  633. package/runtime/embedding-warmup-policy.d.ts.map +1 -0
  634. package/runtime/embedding-warmup-policy.js +33 -0
  635. package/runtime/ensure-local-inference-handler.d.ts +24 -0
  636. package/runtime/ensure-local-inference-handler.d.ts.map +1 -0
  637. package/runtime/ensure-local-inference-handler.js +380 -0
  638. package/runtime/ensure-text-to-speech-handler.d.ts +18 -0
  639. package/runtime/ensure-text-to-speech-handler.d.ts.map +1 -0
  640. package/runtime/ensure-text-to-speech-handler.js +50 -0
  641. package/runtime/error-handlers.d.ts +12 -0
  642. package/runtime/error-handlers.d.ts.map +1 -0
  643. package/runtime/error-handlers.js +49 -0
  644. package/runtime/mobile-local-inference-gate.d.ts +21 -0
  645. package/runtime/mobile-local-inference-gate.d.ts.map +1 -0
  646. package/runtime/mobile-local-inference-gate.js +24 -0
  647. package/runtime/mobile-safe-runtime.d.ts +123 -0
  648. package/runtime/mobile-safe-runtime.d.ts.map +1 -0
  649. package/runtime/mobile-safe-runtime.js +290 -0
  650. package/runtime/mode/remote-forwarder.d.ts +35 -0
  651. package/runtime/mode/remote-forwarder.d.ts.map +1 -0
  652. package/runtime/mode/remote-forwarder.js +119 -0
  653. package/runtime/mode/route-mode-guard.d.ts +21 -0
  654. package/runtime/mode/route-mode-guard.d.ts.map +1 -0
  655. package/runtime/mode/route-mode-guard.js +30 -0
  656. package/runtime/mode/route-mode-matrix.d.ts +64 -0
  657. package/runtime/mode/route-mode-matrix.d.ts.map +1 -0
  658. package/runtime/mode/route-mode-matrix.js +125 -0
  659. package/runtime/mode/runtime-mode.d.ts +54 -0
  660. package/runtime/mode/runtime-mode.d.ts.map +1 -0
  661. package/runtime/mode/runtime-mode.js +99 -0
  662. package/runtime/runtime-bootstrap-policy.d.ts +17 -0
  663. package/runtime/runtime-bootstrap-policy.d.ts.map +1 -0
  664. package/runtime/runtime-bootstrap-policy.js +37 -0
  665. package/runtime/sandbox-policy.d.ts +8 -0
  666. package/runtime/sandbox-policy.d.ts.map +1 -0
  667. package/runtime/sandbox-policy.js +7 -0
  668. package/runtime/startup-overlay.d.ts +14 -0
  669. package/runtime/startup-overlay.d.ts.map +1 -0
  670. package/runtime/startup-overlay.js +55 -0
  671. package/runtime/telegram-standalone-handler.d.ts +34 -0
  672. package/runtime/telegram-standalone-handler.d.ts.map +1 -0
  673. package/runtime/telegram-standalone-handler.js +195 -0
  674. package/runtime/telegram-standalone-policy.d.ts +2 -0
  675. package/runtime/telegram-standalone-policy.d.ts.map +1 -0
  676. package/runtime/telegram-standalone-policy.js +14 -0
  677. package/scripts/README.md +27 -0
  678. package/scripts/align-electrobun-version.mjs +37 -0
  679. package/scripts/aosp/README.md +66 -0
  680. package/scripts/aosp/avd-test.mjs +403 -0
  681. package/scripts/aosp/boot-validate.mjs +536 -0
  682. package/scripts/aosp/build-aosp.mjs +448 -0
  683. package/scripts/aosp/build-bootanimation.mjs +178 -0
  684. package/scripts/aosp/capture-screens.mjs +325 -0
  685. package/scripts/aosp/compile-libllama.mjs +1333 -0
  686. package/scripts/aosp/compile-shim.mjs +328 -0
  687. package/scripts/aosp/e2e-validate.mjs +225 -0
  688. package/scripts/aosp/lib/load-variant-config.mjs +182 -0
  689. package/scripts/aosp/lint-init-rc.mjs +258 -0
  690. package/scripts/aosp/llama-cpp-patches/README.md +49 -0
  691. package/scripts/aosp/llama-cpp-patches/apply-patches.mjs +198 -0
  692. package/scripts/aosp/llama-cpp-patches/polarquant/0001-Q4_POLAR-register-GGML_TYPE_Q4_POLAR-45-and-block_q4.patch +108 -0
  693. package/scripts/aosp/llama-cpp-patches/polarquant/0002-Q4_POLAR-vendor-PolarQuant-ref-kernels-into-ggml-bas.patch +460 -0
  694. package/scripts/aosp/llama-cpp-patches/polarquant/0003-tests-cover-Q4_POLAR-fix-latent-buffer-overflow.patch +102 -0
  695. package/scripts/aosp/llama-cpp-patches/polarquant/0004-Q4_POLAR-gate-QJL-residual-on-runtime-flag-default-o.patch +97 -0
  696. package/scripts/aosp/llama-cpp-patches/qjl/0001-ggml-add-GGML_TYPE_QJL1_256-GGML_OP_ATTN_SCORE_QJL-e.patch +120 -0
  697. package/scripts/aosp/llama-cpp-patches/qjl/0002-ggml-register-QJL1_256-type-traits-ATTN_SCORE_QJL-op.patch +1392 -0
  698. package/scripts/aosp/llama-cpp-patches/qjl/0003-ggml-set-QJL1_256-blck_size-to-head_dim-128-not-sket.patch +56 -0
  699. package/scripts/aosp/llama-cpp-patches/qjl/0004-tests-add-test-qjl-cache-verifying-type-traits-score.patch +335 -0
  700. package/scripts/aosp/llama-cpp-patches/qjl/0005-ggml-flip-block_qjl1_256-to-signs-then-norm.patch +69 -0
  701. package/scripts/aosp/llama-shim/eliza_llama_shim.c +276 -0
  702. package/scripts/aosp/seccomp-shim/loader-wrap.c +141 -0
  703. package/scripts/aosp/seccomp-shim/sigsys-handler.c +338 -0
  704. package/scripts/aosp/sim.mjs +277 -0
  705. package/scripts/aosp/smoke-cuttlefish.mjs +673 -0
  706. package/scripts/aosp/stage-default-models.mjs +340 -0
  707. package/scripts/aosp/stage-models-dfm.mjs +384 -0
  708. package/scripts/aosp/sync-to-aosp.mjs +134 -0
  709. package/scripts/aosp/validate.mjs +1273 -0
  710. package/scripts/aosp/variant-config-schema.ts +10 -0
  711. package/scripts/audit-live-test-surface.mjs +590 -0
  712. package/scripts/audit-server-test-surface.mjs +163 -0
  713. package/scripts/benchmark-preflight.mjs +170 -0
  714. package/scripts/bin/.gitkeep +0 -0
  715. package/scripts/build-bundled-agent-skills-artifact.mjs +58 -0
  716. package/scripts/build-bundled-orchestrator-artifact.mjs +66 -0
  717. package/scripts/build-capacitor-app.mjs +122 -0
  718. package/scripts/build-electrobun-preload.mjs +117 -0
  719. package/scripts/build-flatpak.mjs +125 -0
  720. package/scripts/build-image.sh +461 -0
  721. package/scripts/build-llama-cpp-dflash.mjs +1831 -0
  722. package/scripts/build-native-plugins.mjs +153 -0
  723. package/scripts/build-patched-electrobun-cli.mjs +424 -0
  724. package/scripts/build-win.mjs +82 -0
  725. package/scripts/bump-elizaos.sh +438 -0
  726. package/scripts/check-i18n.mjs +328 -0
  727. package/scripts/check-secret-hygiene.mjs +344 -0
  728. package/scripts/check-upstream-drift.mjs +102 -0
  729. package/scripts/clean-repo.mjs +187 -0
  730. package/scripts/codesign-mas.mjs +297 -0
  731. package/scripts/container-entrypoint.mjs +101 -0
  732. package/scripts/coordinator-cross-platform-review.mjs +192 -0
  733. package/scripts/copy-package-assets.mjs +31 -0
  734. package/scripts/copy-runtime-node-modules.ts +1782 -0
  735. package/scripts/coverage-policy.d.mts +16 -0
  736. package/scripts/coverage-policy.mjs +38 -0
  737. package/scripts/css-coverage.mjs +241 -0
  738. package/scripts/deploy-image.sh +318 -0
  739. package/scripts/desktop-build.mjs +867 -0
  740. package/scripts/desktop-stack-status.mjs +80 -0
  741. package/scripts/dev-platform.mjs +975 -0
  742. package/scripts/dev-ui.mjs +1178 -0
  743. package/scripts/dev-win.mjs +25 -0
  744. package/scripts/disable-local-eliza-workspace.mjs +420 -0
  745. package/scripts/docker-ci-smoke.sh +500 -0
  746. package/scripts/docker-entrypoint.sh +11 -0
  747. package/scripts/docker-runtime-review.mjs +230 -0
  748. package/scripts/docs-list.js +206 -0
  749. package/scripts/ensure-avatars.mjs +335 -0
  750. package/scripts/ensure-bundled-workspaces.mjs +143 -0
  751. package/scripts/ensure-capacitor-platform.mjs +58 -0
  752. package/scripts/ensure-electrobun-core.mjs +318 -0
  753. package/scripts/ensure-generated-core-proto-js.mjs +125 -0
  754. package/scripts/ensure-shared-i18n-data.mjs +67 -0
  755. package/scripts/ensure-skills.mjs +177 -0
  756. package/scripts/ensure-type-package-aliases.mjs +246 -0
  757. package/scripts/ensure-vision-deps.mjs +196 -0
  758. package/scripts/entry.ts +11 -0
  759. package/scripts/find-collisions.mjs +765 -0
  760. package/scripts/find-duplicate-components.mjs +203 -0
  761. package/scripts/fix-workspace-deps.mjs +328 -0
  762. package/scripts/generate-onboarding-voicelines.mjs +194 -0
  763. package/scripts/generate-plugin-index.js +1055 -0
  764. package/scripts/generate-static-asset-manifest.mjs +15 -0
  765. package/scripts/generated/static-asset-manifest.json +4 -0
  766. package/scripts/i18n-dynamic-keys.json +128 -0
  767. package/scripts/init-submodules.mjs +425 -0
  768. package/scripts/ios-xcframework/README.md +233 -0
  769. package/scripts/ios-xcframework/build-xcframework.mjs +487 -0
  770. package/scripts/kernel-patches/metal-kernels.mjs +636 -0
  771. package/scripts/kernel-patches/vulkan-dispatch-patches/01-vulkan-shaders-gen.patch +41 -0
  772. package/scripts/kernel-patches/vulkan-dispatch-patches/02-ggml-vulkan-pipelines.patch +86 -0
  773. package/scripts/kernel-patches/vulkan-kernels.mjs +281 -0
  774. package/scripts/lib/allocate-loopback-port.mjs +58 -0
  775. package/scripts/lib/api-supervisor.mjs +115 -0
  776. package/scripts/lib/app-dir.mjs +74 -0
  777. package/scripts/lib/asset-cdn.mjs +118 -0
  778. package/scripts/lib/bun-version-guard.mjs +44 -0
  779. package/scripts/lib/capacitor-platform-templates.mjs +306 -0
  780. package/scripts/lib/capacitor-plugin-build-needed.mjs +79 -0
  781. package/scripts/lib/capacitor-plugin-names.mjs +35 -0
  782. package/scripts/lib/desktop-preflight.mjs +122 -0
  783. package/scripts/lib/desktop-stack-status.mjs +151 -0
  784. package/scripts/lib/dev-ui-onchain.mjs +22 -0
  785. package/scripts/lib/dev-ui-vision.mjs +15 -0
  786. package/scripts/lib/kill-process-tree.mjs +87 -0
  787. package/scripts/lib/kill-ui-listen-port.mjs +74 -0
  788. package/scripts/lib/node-path-env.mjs +11 -0
  789. package/scripts/lib/orchestrator-desktop-dev-banner.mjs +285 -0
  790. package/scripts/lib/patch-bun-exports.mjs +1446 -0
  791. package/scripts/lib/read-app-identity.mjs +50 -0
  792. package/scripts/lib/release-check-pack-dry-run.ts +34 -0
  793. package/scripts/lib/repo-root.mjs +77 -0
  794. package/scripts/lib/stage-android-agent.mjs +704 -0
  795. package/scripts/lib/static-asset-manifest.mjs +151 -0
  796. package/scripts/lib/sync-eliza-env-aliases.mjs +37 -0
  797. package/scripts/lib/vite-renderer-dist-stale.mjs +141 -0
  798. package/scripts/lib/workspace-discovery.mjs +108 -0
  799. package/scripts/lifeops-prompt-benchmark.ts +206 -0
  800. package/scripts/link-browser-server.mjs +157 -0
  801. package/scripts/link-docker-local-app-packages.mjs +345 -0
  802. package/scripts/link-external-plugins.mjs +195 -0
  803. package/scripts/mobile-auth-simulator-smoke.mjs +373 -0
  804. package/scripts/normalize-parallax-capture.ts +97 -0
  805. package/scripts/omnivoice-fuse/Makefile +44 -0
  806. package/scripts/omnivoice-fuse/README.md +266 -0
  807. package/scripts/omnivoice-fuse/cmake-graft.mjs +180 -0
  808. package/scripts/omnivoice-fuse/ffi-stub.c +222 -0
  809. package/scripts/omnivoice-fuse/ffi.h +158 -0
  810. package/scripts/omnivoice-fuse/libelizainference_stub.dylib +0 -0
  811. package/scripts/omnivoice-fuse/prepare.mjs +263 -0
  812. package/scripts/omnivoice-fuse/verify-symbols.mjs +138 -0
  813. package/scripts/pack-upstreams.mjs +392 -0
  814. package/scripts/patch-deps.mjs +597 -0
  815. package/scripts/patch-workspace-plugins.mjs +148 -0
  816. package/scripts/playwright-ui-live-stack.ts +667 -0
  817. package/scripts/playwright-ui-smoke-api-stub.mjs +1838 -0
  818. package/scripts/plugin-index-local-additions.json +12 -0
  819. package/scripts/plugin-metadata-overrides.json +165 -0
  820. package/scripts/pre-review-local.mjs +599 -0
  821. package/scripts/prepare-ios-cocoapods.sh +30 -0
  822. package/scripts/prepare-package-dist.mjs +358 -0
  823. package/scripts/process-vrms.mjs +203 -0
  824. package/scripts/prune-cdn-local-assets.mjs +44 -0
  825. package/scripts/publish-local-plugins-next.mjs +122 -0
  826. package/scripts/release-check.ts +1402 -0
  827. package/scripts/relink-workspace-packages-to-dist.mjs +115 -0
  828. package/scripts/replace-workspace-versions.mjs +128 -0
  829. package/scripts/report-coverage-surfaces.mjs +121 -0
  830. package/scripts/restore-workspace-refs.mjs +128 -0
  831. package/scripts/rt.mjs +29 -0
  832. package/scripts/rt.sh +4 -0
  833. package/scripts/run-biome-check.mjs +191 -0
  834. package/scripts/run-coding-agent-e2e.mjs +46 -0
  835. package/scripts/run-desktop-playwright.mjs +35 -0
  836. package/scripts/run-local-plugin-live-smoke.mjs +185 -0
  837. package/scripts/run-mobile-build.mjs +3308 -0
  838. package/scripts/run-node-runtime.mjs +75 -0
  839. package/scripts/run-node-tsx.mjs +62 -0
  840. package/scripts/run-node.mjs +294 -0
  841. package/scripts/run-playwright.mjs +66 -0
  842. package/scripts/run-production-build.mjs +138 -0
  843. package/scripts/run-release-contract-suite.mjs +57 -0
  844. package/scripts/run-repo-setup.mjs +230 -0
  845. package/scripts/run-screenshotter.mjs +140 -0
  846. package/scripts/run-ui-smoke-playwright-suite.mjs +96 -0
  847. package/scripts/run-windows-smoke-launcher.ps1 +35 -0
  848. package/scripts/run-with-env.mjs +60 -0
  849. package/scripts/runtime-package-manifest.ts +107 -0
  850. package/scripts/sandbox-setup.sh +7 -0
  851. package/scripts/sanitize-npm-package-metadata.mjs +165 -0
  852. package/scripts/set-package-version.mjs +13 -0
  853. package/scripts/setup-upstreams.mjs +838 -0
  854. package/scripts/smoke-api-status.mjs +113 -0
  855. package/scripts/smoke-lifeops.mjs +305 -0
  856. package/scripts/startup-integration-script-drift.test.ts +94 -0
  857. package/scripts/sync-desktop-renderer.mjs +308 -0
  858. package/scripts/sync-dod-gap-issues-lib.mjs +214 -0
  859. package/scripts/sync-dod-gap-issues.mjs +218 -0
  860. package/scripts/type-audit.mjs +606 -0
  861. package/scripts/validate-cdn-assets.mjs +307 -0
  862. package/scripts/validate-regression-matrix.mjs +360 -0
  863. package/scripts/workspace-plugin-patches/plugin-anthropic-elizaos-core-api-compat.patch +34 -0
  864. package/scripts/workspace-prepare.mjs +192 -0
  865. package/scripts/worktree-env.sh +41 -0
  866. package/scripts/write-build-info.ts +69 -0
  867. package/scripts/write-homepage-release-data.mjs +393 -0
  868. package/security/agent-vault-id.d.ts +16 -0
  869. package/security/agent-vault-id.d.ts.map +1 -0
  870. package/security/agent-vault-id.js +32 -0
  871. package/security/cloud-secret-store.d.ts +34 -0
  872. package/security/cloud-secret-store.d.ts.map +1 -0
  873. package/security/cloud-secret-store.js +65 -0
  874. package/security/export-guard.d.ts +34 -0
  875. package/security/export-guard.d.ts.map +1 -0
  876. package/security/export-guard.js +127 -0
  877. package/security/hydrate-wallet-keys-from-platform-store.d.ts +13 -0
  878. package/security/hydrate-wallet-keys-from-platform-store.d.ts.map +1 -0
  879. package/security/hydrate-wallet-keys-from-platform-store.js +116 -0
  880. package/security/platform-secure-store-node.d.ts +13 -0
  881. package/security/platform-secure-store-node.d.ts.map +1 -0
  882. package/security/platform-secure-store-node.js +311 -0
  883. package/security/platform-secure-store.d.ts +47 -0
  884. package/security/platform-secure-store.d.ts.map +1 -0
  885. package/security/platform-secure-store.js +10 -0
  886. package/security/wallet-os-store-actions.d.ts +45 -0
  887. package/security/wallet-os-store-actions.d.ts.map +1 -0
  888. package/security/wallet-os-store-actions.js +125 -0
  889. package/services/account-pool.d.ts +134 -0
  890. package/services/account-pool.d.ts.map +1 -0
  891. package/services/account-pool.js +693 -0
  892. package/services/account-usage.d.ts +75 -0
  893. package/services/account-usage.d.ts.map +1 -0
  894. package/services/account-usage.js +179 -0
  895. package/services/auth-store.d.ts +179 -0
  896. package/services/auth-store.d.ts.map +1 -0
  897. package/services/auth-store.js +404 -0
  898. package/services/cloud-jwks-store.d.ts +62 -0
  899. package/services/cloud-jwks-store.d.ts.map +1 -0
  900. package/services/cloud-jwks-store.js +118 -0
  901. package/services/connector-target-catalog.d.ts +78 -0
  902. package/services/connector-target-catalog.d.ts.map +1 -0
  903. package/services/connector-target-catalog.js +64 -0
  904. package/services/discord-target-source.d.ts +53 -0
  905. package/services/discord-target-source.d.ts.map +1 -0
  906. package/services/discord-target-source.js +116 -0
  907. package/services/github-credentials.d.ts +95 -0
  908. package/services/github-credentials.d.ts.map +1 -0
  909. package/services/github-credentials.js +144 -0
  910. package/services/local-inference/__stress__/cache-stress-helpers.d.ts +76 -0
  911. package/services/local-inference/__stress__/cache-stress-helpers.d.ts.map +1 -0
  912. package/services/local-inference/__stress__/cache-stress-helpers.js +238 -0
  913. package/services/local-inference/active-model.d.ts +180 -0
  914. package/services/local-inference/active-model.d.ts.map +1 -0
  915. package/services/local-inference/active-model.js +362 -0
  916. package/services/local-inference/assignments.d.ts +58 -0
  917. package/services/local-inference/assignments.d.ts.map +1 -0
  918. package/services/local-inference/assignments.js +179 -0
  919. package/services/local-inference/backend.d.ts +200 -0
  920. package/services/local-inference/backend.d.ts.map +1 -0
  921. package/services/local-inference/backend.js +242 -0
  922. package/services/local-inference/bundled-models.d.ts +34 -0
  923. package/services/local-inference/bundled-models.d.ts.map +1 -0
  924. package/services/local-inference/bundled-models.js +104 -0
  925. package/services/local-inference/cache-bridge.d.ts +184 -0
  926. package/services/local-inference/cache-bridge.d.ts.map +1 -0
  927. package/services/local-inference/cache-bridge.js +333 -0
  928. package/services/local-inference/catalog.d.ts +56 -0
  929. package/services/local-inference/catalog.d.ts.map +1 -0
  930. package/services/local-inference/catalog.js +143 -0
  931. package/services/local-inference/conversation-registry.d.ts +122 -0
  932. package/services/local-inference/conversation-registry.d.ts.map +1 -0
  933. package/services/local-inference/conversation-registry.js +182 -0
  934. package/services/local-inference/device-bridge.d.ts +139 -0
  935. package/services/local-inference/device-bridge.d.ts.map +1 -0
  936. package/services/local-inference/device-bridge.js +774 -0
  937. package/services/local-inference/dflash-doctor.d.ts +27 -0
  938. package/services/local-inference/dflash-doctor.d.ts.map +1 -0
  939. package/services/local-inference/dflash-doctor.js +149 -0
  940. package/services/local-inference/dflash-server.d.ts +248 -0
  941. package/services/local-inference/dflash-server.d.ts.map +1 -0
  942. package/services/local-inference/dflash-server.js +1076 -0
  943. package/services/local-inference/downloader.d.ts +46 -0
  944. package/services/local-inference/downloader.d.ts.map +1 -0
  945. package/services/local-inference/downloader.js +389 -0
  946. package/services/local-inference/engine.d.ts +282 -0
  947. package/services/local-inference/engine.d.ts.map +1 -0
  948. package/services/local-inference/engine.js +743 -0
  949. package/services/local-inference/external-scanner.d.ts +17 -0
  950. package/services/local-inference/external-scanner.d.ts.map +1 -0
  951. package/services/local-inference/external-scanner.js +261 -0
  952. package/services/local-inference/handler-registry.d.ts +72 -0
  953. package/services/local-inference/handler-registry.d.ts.map +1 -0
  954. package/services/local-inference/handler-registry.js +159 -0
  955. package/services/local-inference/hardware.d.ts +26 -0
  956. package/services/local-inference/hardware.d.ts.map +1 -0
  957. package/services/local-inference/hardware.js +139 -0
  958. package/services/local-inference/hf-search.d.ts +19 -0
  959. package/services/local-inference/hf-search.d.ts.map +1 -0
  960. package/services/local-inference/hf-search.js +169 -0
  961. package/services/local-inference/index.d.ts +10 -0
  962. package/services/local-inference/index.d.ts.map +1 -0
  963. package/services/local-inference/index.js +7 -0
  964. package/services/local-inference/llama-server-metrics.d.ts +108 -0
  965. package/services/local-inference/llama-server-metrics.d.ts.map +1 -0
  966. package/services/local-inference/llama-server-metrics.js +175 -0
  967. package/services/local-inference/manifest/index.d.ts +4 -0
  968. package/services/local-inference/manifest/index.d.ts.map +1 -0
  969. package/services/local-inference/manifest/index.js +5 -0
  970. package/services/local-inference/manifest/schema.d.ts +419 -0
  971. package/services/local-inference/manifest/schema.d.ts.map +1 -0
  972. package/services/local-inference/manifest/schema.js +227 -0
  973. package/services/local-inference/manifest/types.d.ts +23 -0
  974. package/services/local-inference/manifest/types.d.ts.map +1 -0
  975. package/services/local-inference/manifest/types.js +5 -0
  976. package/services/local-inference/manifest/validator.d.ts +43 -0
  977. package/services/local-inference/manifest/validator.d.ts.map +1 -0
  978. package/services/local-inference/manifest/validator.js +132 -0
  979. package/services/local-inference/paths.d.ts +8 -0
  980. package/services/local-inference/paths.d.ts.map +1 -0
  981. package/services/local-inference/paths.js +7 -0
  982. package/services/local-inference/providers.d.ts +61 -0
  983. package/services/local-inference/providers.d.ts.map +1 -0
  984. package/services/local-inference/providers.js +334 -0
  985. package/services/local-inference/ram-budget.d.ts +57 -0
  986. package/services/local-inference/ram-budget.d.ts.map +1 -0
  987. package/services/local-inference/ram-budget.js +107 -0
  988. package/services/local-inference/readiness.d.ts +9 -0
  989. package/services/local-inference/readiness.d.ts.map +1 -0
  990. package/services/local-inference/readiness.js +153 -0
  991. package/services/local-inference/recommendation.d.ts +62 -0
  992. package/services/local-inference/recommendation.d.ts.map +1 -0
  993. package/services/local-inference/recommendation.js +309 -0
  994. package/services/local-inference/registry.d.ts +35 -0
  995. package/services/local-inference/registry.d.ts.map +1 -0
  996. package/services/local-inference/registry.js +108 -0
  997. package/services/local-inference/router-handler.d.ts +51 -0
  998. package/services/local-inference/router-handler.d.ts.map +1 -0
  999. package/services/local-inference/router-handler.js +165 -0
  1000. package/services/local-inference/routing-policy.d.ts +55 -0
  1001. package/services/local-inference/routing-policy.d.ts.map +1 -0
  1002. package/services/local-inference/routing-policy.js +195 -0
  1003. package/services/local-inference/routing-preferences.d.ts +8 -0
  1004. package/services/local-inference/routing-preferences.d.ts.map +1 -0
  1005. package/services/local-inference/routing-preferences.js +7 -0
  1006. package/services/local-inference/service.d.ts +88 -0
  1007. package/services/local-inference/service.d.ts.map +1 -0
  1008. package/services/local-inference/service.js +210 -0
  1009. package/services/local-inference/session-pool.d.ts +72 -0
  1010. package/services/local-inference/session-pool.d.ts.map +1 -0
  1011. package/services/local-inference/session-pool.js +125 -0
  1012. package/services/local-inference/types.d.ts +303 -0
  1013. package/services/local-inference/types.d.ts.map +1 -0
  1014. package/services/local-inference/types.js +23 -0
  1015. package/services/local-inference/verify.d.ts +8 -0
  1016. package/services/local-inference/verify.d.ts.map +1 -0
  1017. package/services/local-inference/verify.js +7 -0
  1018. package/services/local-inference/voice/barge-in.d.ts +15 -0
  1019. package/services/local-inference/voice/barge-in.d.ts.map +1 -0
  1020. package/services/local-inference/voice/barge-in.js +20 -0
  1021. package/services/local-inference/voice/engine-bridge.d.ts +256 -0
  1022. package/services/local-inference/voice/engine-bridge.d.ts.map +1 -0
  1023. package/services/local-inference/voice/engine-bridge.js +398 -0
  1024. package/services/local-inference/voice/ffi-bindings.d.ts +114 -0
  1025. package/services/local-inference/voice/ffi-bindings.d.ts.map +1 -0
  1026. package/services/local-inference/voice/ffi-bindings.js +281 -0
  1027. package/services/local-inference/voice/index.d.ts +51 -0
  1028. package/services/local-inference/voice/index.d.ts.map +1 -0
  1029. package/services/local-inference/voice/index.js +50 -0
  1030. package/services/local-inference/voice/lifecycle.d.ts +135 -0
  1031. package/services/local-inference/voice/lifecycle.d.ts.map +1 -0
  1032. package/services/local-inference/voice/lifecycle.js +189 -0
  1033. package/services/local-inference/voice/phoneme-tokenizer.d.ts +58 -0
  1034. package/services/local-inference/voice/phoneme-tokenizer.d.ts.map +1 -0
  1035. package/services/local-inference/voice/phoneme-tokenizer.js +53 -0
  1036. package/services/local-inference/voice/phrase-cache.d.ts +24 -0
  1037. package/services/local-inference/voice/phrase-cache.d.ts.map +1 -0
  1038. package/services/local-inference/voice/phrase-cache.js +32 -0
  1039. package/services/local-inference/voice/phrase-chunker.d.ts +20 -0
  1040. package/services/local-inference/voice/phrase-chunker.d.ts.map +1 -0
  1041. package/services/local-inference/voice/phrase-chunker.js +85 -0
  1042. package/services/local-inference/voice/ring-buffer.d.ts +40 -0
  1043. package/services/local-inference/voice/ring-buffer.d.ts.map +1 -0
  1044. package/services/local-inference/voice/ring-buffer.js +85 -0
  1045. package/services/local-inference/voice/rollback-queue.d.ts +24 -0
  1046. package/services/local-inference/voice/rollback-queue.d.ts.map +1 -0
  1047. package/services/local-inference/voice/rollback-queue.js +49 -0
  1048. package/services/local-inference/voice/scheduler.d.ts +47 -0
  1049. package/services/local-inference/voice/scheduler.d.ts.map +1 -0
  1050. package/services/local-inference/voice/scheduler.js +123 -0
  1051. package/services/local-inference/voice/shared-resources.d.ts +119 -0
  1052. package/services/local-inference/voice/shared-resources.d.ts.map +1 -0
  1053. package/services/local-inference/voice/shared-resources.js +83 -0
  1054. package/services/local-inference/voice/speaker-preset-cache.d.ts +28 -0
  1055. package/services/local-inference/voice/speaker-preset-cache.d.ts.map +1 -0
  1056. package/services/local-inference/voice/speaker-preset-cache.js +44 -0
  1057. package/services/local-inference/voice/types.d.ts +80 -0
  1058. package/services/local-inference/voice/types.d.ts.map +1 -0
  1059. package/services/local-inference/voice/voice-preset-format.d.ts +56 -0
  1060. package/services/local-inference/voice/voice-preset-format.d.ts.map +1 -0
  1061. package/services/local-inference/voice/voice-preset-format.js +184 -0
  1062. package/services/persistence.d.ts +48 -0
  1063. package/services/persistence.d.ts.map +1 -0
  1064. package/services/persistence.js +128 -0
  1065. package/services/plugin-installer.d.ts +22 -0
  1066. package/services/plugin-installer.d.ts.map +1 -0
  1067. package/services/plugin-installer.js +41 -0
  1068. package/services/secrets-manager-installer.d.ts +140 -0
  1069. package/services/secrets-manager-installer.d.ts.map +1 -0
  1070. package/services/secrets-manager-installer.js +374 -0
  1071. package/services/steward-credentials.d.ts +37 -0
  1072. package/services/steward-credentials.d.ts.map +1 -0
  1073. package/services/steward-credentials.js +93 -0
  1074. package/services/steward-sidecar/health-check.d.ts +9 -0
  1075. package/services/steward-sidecar/health-check.d.ts.map +1 -0
  1076. package/services/steward-sidecar/health-check.js +34 -0
  1077. package/services/steward-sidecar/helpers.d.ts +21 -0
  1078. package/services/steward-sidecar/helpers.d.ts.map +1 -0
  1079. package/services/steward-sidecar/helpers.js +71 -0
  1080. package/services/steward-sidecar/process-management.d.ts +9 -0
  1081. package/services/steward-sidecar/process-management.d.ts.map +1 -0
  1082. package/services/steward-sidecar/process-management.js +53 -0
  1083. package/services/steward-sidecar/types.d.ts +60 -0
  1084. package/services/steward-sidecar/types.d.ts.map +1 -0
  1085. package/services/steward-sidecar/types.js +17 -0
  1086. package/services/steward-sidecar/wallet-setup.d.ts +9 -0
  1087. package/services/steward-sidecar/wallet-setup.d.ts.map +1 -0
  1088. package/services/steward-sidecar/wallet-setup.js +114 -0
  1089. package/services/steward-sidecar.d.ts +70 -0
  1090. package/services/steward-sidecar.d.ts.map +1 -0
  1091. package/services/steward-sidecar.js +385 -0
  1092. package/services/tool-call-cache/index.d.ts +13 -0
  1093. package/services/tool-call-cache/index.d.ts.map +1 -0
  1094. package/services/tool-call-cache/index.js +11 -0
  1095. package/services/trigger-event-bridge.d.ts +52 -0
  1096. package/services/trigger-event-bridge.d.ts.map +1 -0
  1097. package/services/trigger-event-bridge.js +217 -0
  1098. package/services/update-notifier.d.ts +6 -0
  1099. package/services/update-notifier.d.ts.map +1 -0
  1100. package/services/update-notifier.js +33 -0
  1101. package/services/vault-bootstrap.d.ts +31 -0
  1102. package/services/vault-bootstrap.d.ts.map +1 -0
  1103. package/services/vault-bootstrap.js +209 -0
  1104. package/services/vault-mirror.d.ts +44 -0
  1105. package/services/vault-mirror.d.ts.map +1 -0
  1106. package/services/vault-mirror.js +80 -0
  1107. package/styles/electrobun-mac-window-drag.css +66 -0
  1108. package/test/helpers/__tests__/live-agent-test.smoke.test.ts +105 -0
  1109. package/test/helpers/action-assertions.ts +364 -0
  1110. package/test/helpers/action-spy.ts +354 -0
  1111. package/test/helpers/browser-launch.ts +103 -0
  1112. package/test/helpers/browser-mocks.ts +275 -0
  1113. package/test/helpers/conditional-tests.ts +42 -0
  1114. package/test/helpers/conversation-harness.ts +334 -0
  1115. package/test/helpers/http.ts +150 -0
  1116. package/test/helpers/i18n.ts +5 -0
  1117. package/test/helpers/isolated-config.ts +34 -0
  1118. package/test/helpers/live-agent-test.ts +660 -0
  1119. package/test/helpers/live-child-env.ts +72 -0
  1120. package/test/helpers/live-provider.test.ts +124 -0
  1121. package/test/helpers/live-provider.ts +362 -0
  1122. package/test/helpers/live-runtime-server.ts +88 -0
  1123. package/test/helpers/loopback.ts +33 -0
  1124. package/test/helpers/pglite-runtime.ts +173 -0
  1125. package/test/helpers/react-test.ts +40 -0
  1126. package/test/helpers/real-connector.ts +250 -0
  1127. package/test/helpers/real-runtime.ts +542 -0
  1128. package/test/helpers/skip-without.ts +53 -0
  1129. package/test/helpers/stochastic-test.ts +186 -0
  1130. package/test/helpers/test-utils.ts +94 -0
  1131. package/test/helpers/trajectory-assertions.ts +168 -0
  1132. package/test/helpers/trajectory-harness.test.ts +101 -0
  1133. package/test/helpers/trajectory-harness.ts +988 -0
  1134. package/test/scripts/managed-test-command.mjs +632 -0
  1135. package/test/scripts/task-agent-live-smoke.ts +1335 -0
  1136. package/test/scripts/test-parallel.mjs +237 -0
  1137. package/test/scripts/test-root-unit.mjs +169 -0
  1138. package/test/scripts/test-runner.mjs +78 -0
  1139. package/test/scripts/validate-all-features.sh +541 -0
  1140. package/test-support/test-helpers.d.ts +111 -0
  1141. package/test-support/test-helpers.d.ts.map +1 -0
  1142. package/test-support/test-helpers.js +410 -0
  1143. package/ui-compat.d.ts +3 -0
  1144. package/ui-compat.d.ts.map +1 -0
  1145. package/ui-compat.js +3 -0
  1146. package/utils/eliza-root.d.ts +9 -0
  1147. package/utils/eliza-root.d.ts.map +1 -0
  1148. package/utils/eliza-root.js +101 -0
  1149. package/utils/globals.d.ts +7 -0
  1150. package/utils/globals.d.ts.map +1 -0
  1151. package/utils/globals.js +47 -0
  1152. package/App.d.ts +0 -5
  1153. package/App.d.ts.map +0 -1
  1154. package/App.js +0 -220
  1155. package/LICENSE +0 -21
  1156. package/actions/character.d.ts +0 -39
  1157. package/actions/character.d.ts.map +0 -1
  1158. package/actions/character.js +0 -247
  1159. package/actions/chat-helpers.d.ts +0 -47
  1160. package/actions/chat-helpers.d.ts.map +0 -1
  1161. package/actions/chat-helpers.js +0 -79
  1162. package/actions/cloud.d.ts +0 -17
  1163. package/actions/cloud.d.ts.map +0 -1
  1164. package/actions/cloud.js +0 -43
  1165. package/actions/index.d.ts +0 -12
  1166. package/actions/index.d.ts.map +0 -1
  1167. package/actions/index.js +0 -11
  1168. package/actions/lifecycle.d.ts +0 -43
  1169. package/actions/lifecycle.d.ts.map +0 -1
  1170. package/actions/lifecycle.js +0 -118
  1171. package/actions/onboarding.d.ts +0 -13
  1172. package/actions/onboarding.d.ts.map +0 -1
  1173. package/actions/onboarding.js +0 -26
  1174. package/actions/triggers.d.ts +0 -23
  1175. package/actions/triggers.d.ts.map +0 -1
  1176. package/actions/triggers.js +0 -148
  1177. package/api/client.d.ts +0 -2742
  1178. package/api/client.d.ts.map +0 -1
  1179. package/api/client.js +0 -2520
  1180. package/api/index.d.ts +0 -2
  1181. package/api/index.d.ts.map +0 -1
  1182. package/api/index.js +0 -1
  1183. package/autonomy/index.d.ts +0 -48
  1184. package/autonomy/index.d.ts.map +0 -1
  1185. package/autonomy/index.js +0 -330
  1186. package/bridge/capacitor-bridge.d.ts +0 -153
  1187. package/bridge/capacitor-bridge.d.ts.map +0 -1
  1188. package/bridge/capacitor-bridge.js +0 -193
  1189. package/bridge/electrobun-rpc.d.ts +0 -28
  1190. package/bridge/electrobun-rpc.d.ts.map +0 -1
  1191. package/bridge/electrobun-rpc.js +0 -35
  1192. package/bridge/electrobun-runtime.d.ts +0 -3
  1193. package/bridge/electrobun-runtime.d.ts.map +0 -1
  1194. package/bridge/electrobun-runtime.js +0 -17
  1195. package/bridge/index.d.ts +0 -6
  1196. package/bridge/index.d.ts.map +0 -1
  1197. package/bridge/index.js +0 -5
  1198. package/bridge/native-plugins.d.ts +0 -82
  1199. package/bridge/native-plugins.d.ts.map +0 -1
  1200. package/bridge/native-plugins.js +0 -39
  1201. package/bridge/plugin-bridge.d.ts +0 -116
  1202. package/bridge/plugin-bridge.d.ts.map +0 -1
  1203. package/bridge/plugin-bridge.js +0 -203
  1204. package/bridge/storage-bridge.d.ts +0 -39
  1205. package/bridge/storage-bridge.d.ts.map +0 -1
  1206. package/bridge/storage-bridge.js +0 -135
  1207. package/chat/index.d.ts +0 -57
  1208. package/chat/index.d.ts.map +0 -1
  1209. package/chat/index.js +0 -160
  1210. package/coding/index.d.ts +0 -25
  1211. package/coding/index.d.ts.map +0 -1
  1212. package/coding/index.js +0 -25
  1213. package/components/AdvancedPageView.d.ts +0 -17
  1214. package/components/AdvancedPageView.d.ts.map +0 -1
  1215. package/components/AdvancedPageView.js +0 -146
  1216. package/components/AgentActivityBox.d.ts +0 -7
  1217. package/components/AgentActivityBox.d.ts.map +0 -1
  1218. package/components/AgentActivityBox.js +0 -25
  1219. package/components/ApiKeyConfig.d.ts +0 -26
  1220. package/components/ApiKeyConfig.d.ts.map +0 -1
  1221. package/components/ApiKeyConfig.js +0 -119
  1222. package/components/AppsPageView.d.ts +0 -7
  1223. package/components/AppsPageView.d.ts.map +0 -1
  1224. package/components/AppsPageView.js +0 -31
  1225. package/components/AppsView.d.ts +0 -8
  1226. package/components/AppsView.d.ts.map +0 -1
  1227. package/components/AppsView.js +0 -149
  1228. package/components/AvatarLoader.d.ts +0 -13
  1229. package/components/AvatarLoader.d.ts.map +0 -1
  1230. package/components/AvatarLoader.js +0 -53
  1231. package/components/AvatarSelector.d.ts +0 -23
  1232. package/components/AvatarSelector.d.ts.map +0 -1
  1233. package/components/AvatarSelector.js +0 -105
  1234. package/components/BscTradePanel.d.ts +0 -22
  1235. package/components/BscTradePanel.d.ts.map +0 -1
  1236. package/components/BscTradePanel.js +0 -221
  1237. package/components/BugReportModal.d.ts +0 -2
  1238. package/components/BugReportModal.d.ts.map +0 -1
  1239. package/components/BugReportModal.js +0 -219
  1240. package/components/CharacterRoster.d.ts +0 -31
  1241. package/components/CharacterRoster.d.ts.map +0 -1
  1242. package/components/CharacterRoster.js +0 -41
  1243. package/components/CharacterView.d.ts +0 -8
  1244. package/components/CharacterView.d.ts.map +0 -1
  1245. package/components/CharacterView.js +0 -685
  1246. package/components/ChatAvatar.d.ts +0 -8
  1247. package/components/ChatAvatar.d.ts.map +0 -1
  1248. package/components/ChatAvatar.js +0 -89
  1249. package/components/ChatComposer.d.ts +0 -37
  1250. package/components/ChatComposer.d.ts.map +0 -1
  1251. package/components/ChatComposer.js +0 -136
  1252. package/components/ChatMessage.d.ts +0 -24
  1253. package/components/ChatMessage.d.ts.map +0 -1
  1254. package/components/ChatMessage.js +0 -187
  1255. package/components/ChatModalView.d.ts +0 -10
  1256. package/components/ChatModalView.d.ts.map +0 -1
  1257. package/components/ChatModalView.js +0 -57
  1258. package/components/ChatView.d.ts +0 -14
  1259. package/components/ChatView.d.ts.map +0 -1
  1260. package/components/ChatView.js +0 -526
  1261. package/components/CloudOnboarding.d.ts +0 -7
  1262. package/components/CloudOnboarding.d.ts.map +0 -1
  1263. package/components/CloudOnboarding.js +0 -22
  1264. package/components/CloudSourceControls.d.ts +0 -13
  1265. package/components/CloudSourceControls.d.ts.map +0 -1
  1266. package/components/CloudSourceControls.js +0 -16
  1267. package/components/CodingAgentSettingsSection.d.ts +0 -8
  1268. package/components/CodingAgentSettingsSection.d.ts.map +0 -1
  1269. package/components/CodingAgentSettingsSection.js +0 -292
  1270. package/components/CommandPalette.d.ts +0 -2
  1271. package/components/CommandPalette.d.ts.map +0 -1
  1272. package/components/CommandPalette.js +0 -181
  1273. package/components/CompanionSceneHost.d.ts +0 -14
  1274. package/components/CompanionSceneHost.d.ts.map +0 -1
  1275. package/components/CompanionSceneHost.js +0 -362
  1276. package/components/CompanionShell.d.ts +0 -17
  1277. package/components/CompanionShell.d.ts.map +0 -1
  1278. package/components/CompanionShell.js +0 -15
  1279. package/components/CompanionView.d.ts +0 -2
  1280. package/components/CompanionView.d.ts.map +0 -1
  1281. package/components/CompanionView.js +0 -22
  1282. package/components/ConfigPageView.d.ts +0 -11
  1283. package/components/ConfigPageView.d.ts.map +0 -1
  1284. package/components/ConfigPageView.js +0 -311
  1285. package/components/ConfigSaveFooter.d.ts +0 -8
  1286. package/components/ConfigSaveFooter.d.ts.map +0 -1
  1287. package/components/ConfigSaveFooter.js +0 -10
  1288. package/components/ConfirmModal.d.ts +0 -61
  1289. package/components/ConfirmModal.d.ts.map +0 -1
  1290. package/components/ConfirmModal.js +0 -164
  1291. package/components/ConnectionFailedBanner.d.ts +0 -6
  1292. package/components/ConnectionFailedBanner.d.ts.map +0 -1
  1293. package/components/ConnectionFailedBanner.js +0 -22
  1294. package/components/ConnectorsPageView.d.ts +0 -7
  1295. package/components/ConnectorsPageView.d.ts.map +0 -1
  1296. package/components/ConnectorsPageView.js +0 -8
  1297. package/components/ConversationsSidebar.d.ts +0 -9
  1298. package/components/ConversationsSidebar.d.ts.map +0 -1
  1299. package/components/ConversationsSidebar.js +0 -116
  1300. package/components/CustomActionEditor.d.ts +0 -10
  1301. package/components/CustomActionEditor.d.ts.map +0 -1
  1302. package/components/CustomActionEditor.js +0 -596
  1303. package/components/CustomActionsPanel.d.ts +0 -9
  1304. package/components/CustomActionsPanel.d.ts.map +0 -1
  1305. package/components/CustomActionsPanel.js +0 -107
  1306. package/components/CustomActionsView.d.ts +0 -2
  1307. package/components/CustomActionsView.d.ts.map +0 -1
  1308. package/components/CustomActionsView.js +0 -134
  1309. package/components/DatabasePageView.d.ts +0 -5
  1310. package/components/DatabasePageView.d.ts.map +0 -1
  1311. package/components/DatabasePageView.js +0 -28
  1312. package/components/DatabaseView.d.ts +0 -9
  1313. package/components/DatabaseView.d.ts.map +0 -1
  1314. package/components/DatabaseView.js +0 -311
  1315. package/components/ElizaCloudDashboard.d.ts +0 -2
  1316. package/components/ElizaCloudDashboard.d.ts.map +0 -1
  1317. package/components/ElizaCloudDashboard.js +0 -657
  1318. package/components/EmotePicker.d.ts +0 -2
  1319. package/components/EmotePicker.d.ts.map +0 -1
  1320. package/components/EmotePicker.js +0 -343
  1321. package/components/ErrorBoundary.d.ts +0 -22
  1322. package/components/ErrorBoundary.d.ts.map +0 -1
  1323. package/components/ErrorBoundary.js +0 -31
  1324. package/components/FineTuningView.d.ts +0 -2
  1325. package/components/FineTuningView.d.ts.map +0 -1
  1326. package/components/FineTuningView.js +0 -433
  1327. package/components/FlaminaGuide.d.ts +0 -10
  1328. package/components/FlaminaGuide.d.ts.map +0 -1
  1329. package/components/FlaminaGuide.js +0 -64
  1330. package/components/GameView.d.ts +0 -11
  1331. package/components/GameView.d.ts.map +0 -1
  1332. package/components/GameView.js +0 -294
  1333. package/components/GameViewOverlay.d.ts +0 -8
  1334. package/components/GameViewOverlay.d.ts.map +0 -1
  1335. package/components/GameViewOverlay.js +0 -70
  1336. package/components/GlobalEmoteOverlay.d.ts +0 -2
  1337. package/components/GlobalEmoteOverlay.d.ts.map +0 -1
  1338. package/components/GlobalEmoteOverlay.js +0 -112
  1339. package/components/Header.d.ts +0 -9
  1340. package/components/Header.d.ts.map +0 -1
  1341. package/components/Header.js +0 -123
  1342. package/components/HeartbeatsView.d.ts +0 -2
  1343. package/components/HeartbeatsView.d.ts.map +0 -1
  1344. package/components/HeartbeatsView.js +0 -378
  1345. package/components/InventoryView.d.ts +0 -10
  1346. package/components/InventoryView.d.ts.map +0 -1
  1347. package/components/InventoryView.js +0 -176
  1348. package/components/KnowledgeView.d.ts +0 -20
  1349. package/components/KnowledgeView.d.ts.map +0 -1
  1350. package/components/KnowledgeView.js +0 -483
  1351. package/components/LanguageDropdown.d.ts +0 -30
  1352. package/components/LanguageDropdown.d.ts.map +0 -1
  1353. package/components/LanguageDropdown.js +0 -99
  1354. package/components/LifoMonitorPanel.d.ts +0 -21
  1355. package/components/LifoMonitorPanel.d.ts.map +0 -1
  1356. package/components/LifoMonitorPanel.js +0 -24
  1357. package/components/LifoSandboxView.d.ts +0 -5
  1358. package/components/LifoSandboxView.d.ts.map +0 -1
  1359. package/components/LifoSandboxView.js +0 -333
  1360. package/components/LoadingScreen.d.ts +0 -13
  1361. package/components/LoadingScreen.d.ts.map +0 -1
  1362. package/components/LoadingScreen.js +0 -70
  1363. package/components/LogsPageView.d.ts +0 -2
  1364. package/components/LogsPageView.d.ts.map +0 -1
  1365. package/components/LogsPageView.js +0 -7
  1366. package/components/LogsView.d.ts +0 -5
  1367. package/components/LogsView.d.ts.map +0 -1
  1368. package/components/LogsView.js +0 -71
  1369. package/components/MediaGalleryView.d.ts +0 -9
  1370. package/components/MediaGalleryView.d.ts.map +0 -1
  1371. package/components/MediaGalleryView.js +0 -236
  1372. package/components/MediaSettingsSection.d.ts +0 -11
  1373. package/components/MediaSettingsSection.d.ts.map +0 -1
  1374. package/components/MediaSettingsSection.js +0 -329
  1375. package/components/MessageContent.d.ts +0 -51
  1376. package/components/MessageContent.d.ts.map +0 -1
  1377. package/components/MessageContent.js +0 -553
  1378. package/components/OnboardingWizard.d.ts +0 -2
  1379. package/components/OnboardingWizard.d.ts.map +0 -1
  1380. package/components/OnboardingWizard.js +0 -86
  1381. package/components/PairingView.d.ts +0 -5
  1382. package/components/PairingView.d.ts.map +0 -1
  1383. package/components/PairingView.js +0 -29
  1384. package/components/PermissionsSection.d.ts +0 -20
  1385. package/components/PermissionsSection.d.ts.map +0 -1
  1386. package/components/PermissionsSection.js +0 -573
  1387. package/components/PluginsPageView.d.ts +0 -5
  1388. package/components/PluginsPageView.d.ts.map +0 -1
  1389. package/components/PluginsPageView.js +0 -8
  1390. package/components/PluginsView.d.ts +0 -21
  1391. package/components/PluginsView.d.ts.map +0 -1
  1392. package/components/PluginsView.js +0 -1534
  1393. package/components/ProviderSwitcher.d.ts +0 -42
  1394. package/components/ProviderSwitcher.d.ts.map +0 -1
  1395. package/components/ProviderSwitcher.js +0 -493
  1396. package/components/RestartBanner.d.ts +0 -2
  1397. package/components/RestartBanner.d.ts.map +0 -1
  1398. package/components/RestartBanner.js +0 -36
  1399. package/components/RuntimeView.d.ts +0 -10
  1400. package/components/RuntimeView.d.ts.map +0 -1
  1401. package/components/RuntimeView.js +0 -165
  1402. package/components/SaveCommandModal.d.ts +0 -12
  1403. package/components/SaveCommandModal.d.ts.map +0 -1
  1404. package/components/SaveCommandModal.js +0 -84
  1405. package/components/SecretsView.d.ts +0 -9
  1406. package/components/SecretsView.d.ts.map +0 -1
  1407. package/components/SecretsView.js +0 -249
  1408. package/components/SettingsView.d.ts +0 -9
  1409. package/components/SettingsView.d.ts.map +0 -1
  1410. package/components/SettingsView.js +0 -230
  1411. package/components/ShellOverlays.d.ts +0 -8
  1412. package/components/ShellOverlays.d.ts.map +0 -1
  1413. package/components/ShellOverlays.js +0 -10
  1414. package/components/ShortcutsOverlay.d.ts +0 -2
  1415. package/components/ShortcutsOverlay.d.ts.map +0 -1
  1416. package/components/ShortcutsOverlay.js +0 -79
  1417. package/components/SkillsView.d.ts +0 -11
  1418. package/components/SkillsView.d.ts.map +0 -1
  1419. package/components/SkillsView.js +0 -358
  1420. package/components/StartupFailureView.d.ts +0 -8
  1421. package/components/StartupFailureView.d.ts.map +0 -1
  1422. package/components/StartupFailureView.js +0 -16
  1423. package/components/StreamView.d.ts +0 -16
  1424. package/components/StreamView.d.ts.map +0 -1
  1425. package/components/StreamView.js +0 -300
  1426. package/components/StripeEmbeddedCheckout.d.ts +0 -24
  1427. package/components/StripeEmbeddedCheckout.d.ts.map +0 -1
  1428. package/components/StripeEmbeddedCheckout.js +0 -101
  1429. package/components/SubscriptionStatus.d.ts +0 -23
  1430. package/components/SubscriptionStatus.d.ts.map +0 -1
  1431. package/components/SubscriptionStatus.js +0 -301
  1432. package/components/SystemWarningBanner.d.ts +0 -6
  1433. package/components/SystemWarningBanner.d.ts.map +0 -1
  1434. package/components/SystemWarningBanner.js +0 -46
  1435. package/components/ThemeToggle.d.ts +0 -21
  1436. package/components/ThemeToggle.d.ts.map +0 -1
  1437. package/components/ThemeToggle.js +0 -24
  1438. package/components/TrajectoriesView.d.ts +0 -12
  1439. package/components/TrajectoriesView.d.ts.map +0 -1
  1440. package/components/TrajectoriesView.js +0 -183
  1441. package/components/TrajectoryDetailView.d.ts +0 -13
  1442. package/components/TrajectoryDetailView.d.ts.map +0 -1
  1443. package/components/TrajectoryDetailView.js +0 -112
  1444. package/components/TriggersView.d.ts +0 -2
  1445. package/components/TriggersView.d.ts.map +0 -1
  1446. package/components/TriggersView.js +0 -1
  1447. package/components/VectorBrowserView.d.ts +0 -10
  1448. package/components/VectorBrowserView.d.ts.map +0 -1
  1449. package/components/VectorBrowserView.js +0 -1000
  1450. package/components/VoiceConfigView.d.ts +0 -11
  1451. package/components/VoiceConfigView.d.ts.map +0 -1
  1452. package/components/VoiceConfigView.js +0 -331
  1453. package/components/VrmStage.d.ts +0 -28
  1454. package/components/VrmStage.d.ts.map +0 -1
  1455. package/components/VrmStage.js +0 -178
  1456. package/components/WhatsAppQrOverlay.d.ts +0 -8
  1457. package/components/WhatsAppQrOverlay.d.ts.map +0 -1
  1458. package/components/WhatsAppQrOverlay.js +0 -63
  1459. package/components/apps/AppDetailPane.d.ts +0 -15
  1460. package/components/apps/AppDetailPane.d.ts.map +0 -1
  1461. package/components/apps/AppDetailPane.js +0 -13
  1462. package/components/apps/AppsCatalogGrid.d.ts +0 -20
  1463. package/components/apps/AppsCatalogGrid.d.ts.map +0 -1
  1464. package/components/apps/AppsCatalogGrid.js +0 -18
  1465. package/components/apps/extensions/registry.d.ts +0 -4
  1466. package/components/apps/extensions/registry.d.ts.map +0 -1
  1467. package/components/apps/extensions/registry.js +0 -7
  1468. package/components/apps/extensions/types.d.ts +0 -7
  1469. package/components/apps/extensions/types.d.ts.map +0 -1
  1470. package/components/apps/helpers.d.ts +0 -7
  1471. package/components/apps/helpers.d.ts.map +0 -1
  1472. package/components/apps/helpers.js +0 -44
  1473. package/components/avatar/VrmAnimationLoader.d.ts +0 -30
  1474. package/components/avatar/VrmAnimationLoader.d.ts.map +0 -1
  1475. package/components/avatar/VrmAnimationLoader.js +0 -99
  1476. package/components/avatar/VrmBlinkController.d.ts +0 -37
  1477. package/components/avatar/VrmBlinkController.d.ts.map +0 -1
  1478. package/components/avatar/VrmBlinkController.js +0 -98
  1479. package/components/avatar/VrmCameraManager.d.ts +0 -57
  1480. package/components/avatar/VrmCameraManager.d.ts.map +0 -1
  1481. package/components/avatar/VrmCameraManager.js +0 -277
  1482. package/components/avatar/VrmEngine.d.ts +0 -246
  1483. package/components/avatar/VrmEngine.d.ts.map +0 -1
  1484. package/components/avatar/VrmEngine.js +0 -2087
  1485. package/components/avatar/VrmFootShadow.d.ts +0 -18
  1486. package/components/avatar/VrmFootShadow.d.ts.map +0 -1
  1487. package/components/avatar/VrmFootShadow.js +0 -83
  1488. package/components/avatar/VrmViewer.d.ts +0 -60
  1489. package/components/avatar/VrmViewer.d.ts.map +0 -1
  1490. package/components/avatar/VrmViewer.js +0 -396
  1491. package/components/avatar/mixamoVRMRigMap.d.ts +0 -3
  1492. package/components/avatar/mixamoVRMRigMap.d.ts.map +0 -1
  1493. package/components/avatar/mixamoVRMRigMap.js +0 -56
  1494. package/components/avatar/retargetMixamoFbxToVrm.d.ts +0 -9
  1495. package/components/avatar/retargetMixamoFbxToVrm.d.ts.map +0 -1
  1496. package/components/avatar/retargetMixamoFbxToVrm.js +0 -88
  1497. package/components/avatar/retargetMixamoGltfToVrm.d.ts +0 -11
  1498. package/components/avatar/retargetMixamoGltfToVrm.d.ts.map +0 -1
  1499. package/components/avatar/retargetMixamoGltfToVrm.js +0 -80
  1500. package/components/chainConfig.d.ts +0 -89
  1501. package/components/chainConfig.d.ts.map +0 -1
  1502. package/components/chainConfig.js +0 -287
  1503. package/components/companion/CompanionHeader.d.ts +0 -15
  1504. package/components/companion/CompanionHeader.d.ts.map +0 -1
  1505. package/components/companion/CompanionHeader.js +0 -7
  1506. package/components/companion/CompanionSceneHost.d.ts +0 -2
  1507. package/components/companion/CompanionSceneHost.d.ts.map +0 -1
  1508. package/components/companion/CompanionSceneHost.js +0 -1
  1509. package/components/companion/VrmStage.d.ts +0 -3
  1510. package/components/companion/VrmStage.d.ts.map +0 -1
  1511. package/components/companion/VrmStage.js +0 -1
  1512. package/components/companion/index.d.ts +0 -18
  1513. package/components/companion/index.d.ts.map +0 -1
  1514. package/components/companion/index.js +0 -17
  1515. package/components/companion/walletUtils.d.ts +0 -95
  1516. package/components/companion/walletUtils.d.ts.map +0 -1
  1517. package/components/companion/walletUtils.js +0 -167
  1518. package/components/companion-shell-styles.d.ts +0 -38
  1519. package/components/companion-shell-styles.d.ts.map +0 -1
  1520. package/components/companion-shell-styles.js +0 -248
  1521. package/components/confirm-delete-control.d.ts +0 -16
  1522. package/components/confirm-delete-control.d.ts.map +0 -1
  1523. package/components/confirm-delete-control.js +0 -12
  1524. package/components/conversations/ConversationListItem.d.ts +0 -31
  1525. package/components/conversations/ConversationListItem.d.ts.map +0 -1
  1526. package/components/conversations/ConversationListItem.js +0 -52
  1527. package/components/conversations/conversation-utils.d.ts +0 -9
  1528. package/components/conversations/conversation-utils.d.ts.map +0 -1
  1529. package/components/conversations/conversation-utils.js +0 -138
  1530. package/components/format.d.ts +0 -54
  1531. package/components/format.d.ts.map +0 -1
  1532. package/components/format.js +0 -82
  1533. package/components/index.d.ts +0 -96
  1534. package/components/index.d.ts.map +0 -1
  1535. package/components/index.js +0 -95
  1536. package/components/inventory/CopyableAddress.d.ts +0 -8
  1537. package/components/inventory/CopyableAddress.d.ts.map +0 -1
  1538. package/components/inventory/CopyableAddress.js +0 -18
  1539. package/components/inventory/InventoryToolbar.d.ts +0 -25
  1540. package/components/inventory/InventoryToolbar.d.ts.map +0 -1
  1541. package/components/inventory/InventoryToolbar.js +0 -28
  1542. package/components/inventory/NftGrid.d.ts +0 -13
  1543. package/components/inventory/NftGrid.d.ts.map +0 -1
  1544. package/components/inventory/NftGrid.js +0 -29
  1545. package/components/inventory/TokenLogo.d.ts +0 -12
  1546. package/components/inventory/TokenLogo.d.ts.map +0 -1
  1547. package/components/inventory/TokenLogo.js +0 -33
  1548. package/components/inventory/TokensTable.d.ts +0 -24
  1549. package/components/inventory/TokensTable.d.ts.map +0 -1
  1550. package/components/inventory/TokensTable.js +0 -26
  1551. package/components/inventory/constants.d.ts +0 -52
  1552. package/components/inventory/constants.d.ts.map +0 -1
  1553. package/components/inventory/constants.js +0 -121
  1554. package/components/inventory/index.d.ts +0 -9
  1555. package/components/inventory/index.d.ts.map +0 -1
  1556. package/components/inventory/index.js +0 -8
  1557. package/components/inventory/media-url.d.ts +0 -6
  1558. package/components/inventory/media-url.d.ts.map +0 -1
  1559. package/components/inventory/media-url.js +0 -28
  1560. package/components/inventory/useInventoryData.d.ts +0 -53
  1561. package/components/inventory/useInventoryData.d.ts.map +0 -1
  1562. package/components/inventory/useInventoryData.js +0 -332
  1563. package/components/knowledge-upload-image.d.ts +0 -27
  1564. package/components/knowledge-upload-image.d.ts.map +0 -1
  1565. package/components/knowledge-upload-image.js +0 -146
  1566. package/components/labels.d.ts +0 -6
  1567. package/components/labels.d.ts.map +0 -1
  1568. package/components/labels.js +0 -40
  1569. package/components/onboarding/ActivateStep.d.ts +0 -2
  1570. package/components/onboarding/ActivateStep.d.ts.map +0 -1
  1571. package/components/onboarding/ActivateStep.js +0 -10
  1572. package/components/onboarding/CloudLoginStep.d.ts +0 -2
  1573. package/components/onboarding/CloudLoginStep.d.ts.map +0 -1
  1574. package/components/onboarding/CloudLoginStep.js +0 -20
  1575. package/components/onboarding/ConnectionStep.d.ts +0 -2
  1576. package/components/onboarding/ConnectionStep.d.ts.map +0 -1
  1577. package/components/onboarding/ConnectionStep.js +0 -609
  1578. package/components/onboarding/IdentityStep.d.ts +0 -2
  1579. package/components/onboarding/IdentityStep.d.ts.map +0 -1
  1580. package/components/onboarding/IdentityStep.js +0 -102
  1581. package/components/onboarding/OnboardingPanel.d.ts +0 -9
  1582. package/components/onboarding/OnboardingPanel.d.ts.map +0 -1
  1583. package/components/onboarding/OnboardingPanel.js +0 -24
  1584. package/components/onboarding/OnboardingStepNav.d.ts +0 -2
  1585. package/components/onboarding/OnboardingStepNav.d.ts.map +0 -1
  1586. package/components/onboarding/OnboardingStepNav.js +0 -24
  1587. package/components/onboarding/PermissionsStep.d.ts +0 -2
  1588. package/components/onboarding/PermissionsStep.d.ts.map +0 -1
  1589. package/components/onboarding/PermissionsStep.js +0 -7
  1590. package/components/onboarding/RpcStep.d.ts +0 -2
  1591. package/components/onboarding/RpcStep.d.ts.map +0 -1
  1592. package/components/onboarding/RpcStep.js +0 -125
  1593. package/components/onboarding/SaveKeysStep.d.ts +0 -2
  1594. package/components/onboarding/SaveKeysStep.d.ts.map +0 -1
  1595. package/components/onboarding/SaveKeysStep.js +0 -44
  1596. package/components/onboarding/WelcomeStep.d.ts +0 -2
  1597. package/components/onboarding/WelcomeStep.d.ts.map +0 -1
  1598. package/components/onboarding/WelcomeStep.js +0 -30
  1599. package/components/permissions/PermissionIcon.d.ts +0 -4
  1600. package/components/permissions/PermissionIcon.d.ts.map +0 -1
  1601. package/components/permissions/PermissionIcon.js +0 -12
  1602. package/components/permissions/StreamingPermissions.d.ts +0 -20
  1603. package/components/permissions/StreamingPermissions.d.ts.map +0 -1
  1604. package/components/permissions/StreamingPermissions.js +0 -178
  1605. package/components/plugins/showcase-data.d.ts +0 -7
  1606. package/components/plugins/showcase-data.d.ts.map +0 -1
  1607. package/components/plugins/showcase-data.js +0 -464
  1608. package/components/shared/ShellHeaderControls.d.ts +0 -27
  1609. package/components/shared/ShellHeaderControls.d.ts.map +0 -1
  1610. package/components/shared/ShellHeaderControls.js +0 -55
  1611. package/components/shared-companion-scene-context.d.ts +0 -3
  1612. package/components/shared-companion-scene-context.d.ts.map +0 -1
  1613. package/components/shared-companion-scene-context.js +0 -13
  1614. package/components/skeletons.d.ts +0 -17
  1615. package/components/skeletons.d.ts.map +0 -1
  1616. package/components/skeletons.js +0 -22
  1617. package/components/stream/ActivityFeed.d.ts +0 -5
  1618. package/components/stream/ActivityFeed.d.ts.map +0 -1
  1619. package/components/stream/ActivityFeed.js +0 -57
  1620. package/components/stream/AvatarPip.d.ts +0 -5
  1621. package/components/stream/AvatarPip.d.ts.map +0 -1
  1622. package/components/stream/AvatarPip.js +0 -6
  1623. package/components/stream/ChatContent.d.ts +0 -6
  1624. package/components/stream/ChatContent.d.ts.map +0 -1
  1625. package/components/stream/ChatContent.js +0 -69
  1626. package/components/stream/ChatTicker.d.ts +0 -5
  1627. package/components/stream/ChatTicker.d.ts.map +0 -1
  1628. package/components/stream/ChatTicker.js +0 -34
  1629. package/components/stream/IdleContent.d.ts +0 -5
  1630. package/components/stream/IdleContent.d.ts.map +0 -1
  1631. package/components/stream/IdleContent.js +0 -17
  1632. package/components/stream/StatusBar.d.ts +0 -36
  1633. package/components/stream/StatusBar.d.ts.map +0 -1
  1634. package/components/stream/StatusBar.js +0 -140
  1635. package/components/stream/StreamSettings.d.ts +0 -33
  1636. package/components/stream/StreamSettings.d.ts.map +0 -1
  1637. package/components/stream/StreamSettings.js +0 -99
  1638. package/components/stream/StreamTerminal.d.ts +0 -2
  1639. package/components/stream/StreamTerminal.d.ts.map +0 -1
  1640. package/components/stream/StreamTerminal.js +0 -52
  1641. package/components/stream/StreamVoiceConfig.d.ts +0 -10
  1642. package/components/stream/StreamVoiceConfig.d.ts.map +0 -1
  1643. package/components/stream/StreamVoiceConfig.js +0 -88
  1644. package/components/stream/helpers.d.ts +0 -32
  1645. package/components/stream/helpers.d.ts.map +0 -1
  1646. package/components/stream/helpers.js +0 -110
  1647. package/components/stream/overlays/OverlayLayer.d.ts +0 -20
  1648. package/components/stream/overlays/OverlayLayer.d.ts.map +0 -1
  1649. package/components/stream/overlays/OverlayLayer.js +0 -24
  1650. package/components/stream/overlays/built-in/ActionTickerWidget.d.ts +0 -8
  1651. package/components/stream/overlays/built-in/ActionTickerWidget.d.ts.map +0 -1
  1652. package/components/stream/overlays/built-in/ActionTickerWidget.js +0 -44
  1653. package/components/stream/overlays/built-in/AlertPopupWidget.d.ts +0 -7
  1654. package/components/stream/overlays/built-in/AlertPopupWidget.d.ts.map +0 -1
  1655. package/components/stream/overlays/built-in/AlertPopupWidget.js +0 -62
  1656. package/components/stream/overlays/built-in/BrandingWidget.d.ts +0 -7
  1657. package/components/stream/overlays/built-in/BrandingWidget.d.ts.map +0 -1
  1658. package/components/stream/overlays/built-in/BrandingWidget.js +0 -36
  1659. package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts +0 -26
  1660. package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +0 -1
  1661. package/components/stream/overlays/built-in/CustomHtmlWidget.js +0 -78
  1662. package/components/stream/overlays/built-in/PeonGlassWidget.d.ts +0 -11
  1663. package/components/stream/overlays/built-in/PeonGlassWidget.d.ts.map +0 -1
  1664. package/components/stream/overlays/built-in/PeonGlassWidget.js +0 -188
  1665. package/components/stream/overlays/built-in/PeonHudWidget.d.ts +0 -10
  1666. package/components/stream/overlays/built-in/PeonHudWidget.d.ts.map +0 -1
  1667. package/components/stream/overlays/built-in/PeonHudWidget.js +0 -168
  1668. package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts +0 -11
  1669. package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +0 -1
  1670. package/components/stream/overlays/built-in/PeonSakuraWidget.js +0 -213
  1671. package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +0 -8
  1672. package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +0 -1
  1673. package/components/stream/overlays/built-in/ThoughtBubbleWidget.js +0 -59
  1674. package/components/stream/overlays/built-in/ViewerCountWidget.d.ts +0 -7
  1675. package/components/stream/overlays/built-in/ViewerCountWidget.d.ts.map +0 -1
  1676. package/components/stream/overlays/built-in/ViewerCountWidget.js +0 -34
  1677. package/components/stream/overlays/built-in/index.d.ts +0 -13
  1678. package/components/stream/overlays/built-in/index.d.ts.map +0 -1
  1679. package/components/stream/overlays/built-in/index.js +0 -12
  1680. package/components/stream/overlays/registry.d.ts +0 -11
  1681. package/components/stream/overlays/registry.d.ts.map +0 -1
  1682. package/components/stream/overlays/registry.js +0 -16
  1683. package/components/stream/overlays/types.d.ts +0 -67
  1684. package/components/stream/overlays/types.d.ts.map +0 -1
  1685. package/components/stream/overlays/types.js +0 -7
  1686. package/components/stream/overlays/useOverlayLayout.d.ts +0 -27
  1687. package/components/stream/overlays/useOverlayLayout.d.ts.map +0 -1
  1688. package/components/stream/overlays/useOverlayLayout.js +0 -162
  1689. package/components/trajectory-format.d.ts +0 -6
  1690. package/components/trajectory-format.d.ts.map +0 -1
  1691. package/components/trajectory-format.js +0 -43
  1692. package/components/ui-badges.d.ts +0 -23
  1693. package/components/ui-badges.d.ts.map +0 -1
  1694. package/components/ui-badges.js +0 -38
  1695. package/components/ui-switch.d.ts +0 -14
  1696. package/components/ui-switch.d.ts.map +0 -1
  1697. package/components/ui-switch.js +0 -15
  1698. package/components/vector-browser-three.d.ts +0 -4
  1699. package/components/vector-browser-three.d.ts.map +0 -1
  1700. package/components/vector-browser-three.js +0 -21
  1701. package/config/branding.d.ts +0 -49
  1702. package/config/branding.d.ts.map +0 -1
  1703. package/config/branding.js +0 -16
  1704. package/config/config-catalog.d.ts +0 -376
  1705. package/config/config-catalog.d.ts.map +0 -1
  1706. package/config/config-catalog.js +0 -724
  1707. package/config/config-field.d.ts +0 -68
  1708. package/config/config-field.d.ts.map +0 -1
  1709. package/config/config-field.js +0 -840
  1710. package/config/config-renderer.d.ts +0 -176
  1711. package/config/config-renderer.d.ts.map +0 -1
  1712. package/config/config-renderer.js +0 -405
  1713. package/config/index.d.ts +0 -6
  1714. package/config/index.d.ts.map +0 -1
  1715. package/config/index.js +0 -5
  1716. package/config/ui-renderer.d.ts +0 -26
  1717. package/config/ui-renderer.d.ts.map +0 -1
  1718. package/config/ui-renderer.js +0 -815
  1719. package/config/ui-spec.d.ts +0 -164
  1720. package/config/ui-spec.d.ts.map +0 -1
  1721. package/config/ui-spec.js +0 -13
  1722. package/events/index.d.ts +0 -48
  1723. package/events/index.d.ts.map +0 -1
  1724. package/events/index.js +0 -45
  1725. package/hooks/index.d.ts +0 -15
  1726. package/hooks/index.d.ts.map +0 -1
  1727. package/hooks/index.js +0 -14
  1728. package/hooks/useBugReport.d.ts +0 -14
  1729. package/hooks/useBugReport.d.ts.map +0 -1
  1730. package/hooks/useBugReport.js +0 -18
  1731. package/hooks/useCanvasWindow.d.ts +0 -38
  1732. package/hooks/useCanvasWindow.d.ts.map +0 -1
  1733. package/hooks/useCanvasWindow.js +0 -273
  1734. package/hooks/useChatAvatarVoice.d.ts +0 -10
  1735. package/hooks/useChatAvatarVoice.d.ts.map +0 -1
  1736. package/hooks/useChatAvatarVoice.js +0 -71
  1737. package/hooks/useClickOutside.d.ts +0 -6
  1738. package/hooks/useClickOutside.d.ts.map +0 -1
  1739. package/hooks/useClickOutside.js +0 -25
  1740. package/hooks/useContextMenu.d.ts +0 -17
  1741. package/hooks/useContextMenu.d.ts.map +0 -1
  1742. package/hooks/useContextMenu.js +0 -100
  1743. package/hooks/useKeyboardShortcuts.d.ts +0 -17
  1744. package/hooks/useKeyboardShortcuts.d.ts.map +0 -1
  1745. package/hooks/useKeyboardShortcuts.js +0 -67
  1746. package/hooks/useLifoSync.d.ts +0 -18
  1747. package/hooks/useLifoSync.d.ts.map +0 -1
  1748. package/hooks/useLifoSync.js +0 -113
  1749. package/hooks/useMemoryMonitor.d.ts +0 -87
  1750. package/hooks/useMemoryMonitor.d.ts.map +0 -1
  1751. package/hooks/useMemoryMonitor.js +0 -209
  1752. package/hooks/useRenderGuard.d.ts +0 -17
  1753. package/hooks/useRenderGuard.d.ts.map +0 -1
  1754. package/hooks/useRenderGuard.js +0 -36
  1755. package/hooks/useRetakeCapture.d.ts +0 -12
  1756. package/hooks/useRetakeCapture.d.ts.map +0 -1
  1757. package/hooks/useRetakeCapture.js +0 -60
  1758. package/hooks/useStreamPopoutNavigation.d.ts +0 -3
  1759. package/hooks/useStreamPopoutNavigation.d.ts.map +0 -1
  1760. package/hooks/useStreamPopoutNavigation.js +0 -17
  1761. package/hooks/useTimeout.d.ts +0 -11
  1762. package/hooks/useTimeout.d.ts.map +0 -1
  1763. package/hooks/useTimeout.js +0 -32
  1764. package/hooks/useVoiceChat.d.ts +0 -94
  1765. package/hooks/useVoiceChat.d.ts.map +0 -1
  1766. package/hooks/useVoiceChat.js +0 -1077
  1767. package/hooks/useWhatsAppPairing.d.ts +0 -11
  1768. package/hooks/useWhatsAppPairing.d.ts.map +0 -1
  1769. package/hooks/useWhatsAppPairing.js +0 -95
  1770. package/i18n/index.d.ts +0 -7
  1771. package/i18n/index.d.ts.map +0 -1
  1772. package/i18n/index.js +0 -53
  1773. package/i18n/locales/en.json +0 -1268
  1774. package/i18n/locales/es.json +0 -1236
  1775. package/i18n/locales/ko.json +0 -1236
  1776. package/i18n/locales/pt.json +0 -1236
  1777. package/i18n/locales/zh-CN.json +0 -1236
  1778. package/i18n/messages.d.ts +0 -6
  1779. package/i18n/messages.d.ts.map +0 -1
  1780. package/i18n/messages.js +0 -14
  1781. package/navigation/index.d.ts +0 -27
  1782. package/navigation/index.d.ts.map +0 -1
  1783. package/navigation/index.js +0 -232
  1784. package/onboarding-config.d.ts +0 -25
  1785. package/onboarding-config.d.ts.map +0 -1
  1786. package/onboarding-config.js +0 -76
  1787. package/platform/browser-launch.d.ts +0 -2
  1788. package/platform/browser-launch.d.ts.map +0 -1
  1789. package/platform/browser-launch.js +0 -109
  1790. package/platform/index.d.ts +0 -14
  1791. package/platform/index.d.ts.map +0 -1
  1792. package/platform/index.js +0 -24
  1793. package/platform/init.d.ts +0 -40
  1794. package/platform/init.d.ts.map +0 -1
  1795. package/platform/init.js +0 -160
  1796. package/platform/lifo.d.ts +0 -51
  1797. package/platform/lifo.d.ts.map +0 -1
  1798. package/platform/lifo.js +0 -138
  1799. package/providers/index.d.ts +0 -19
  1800. package/providers/index.d.ts.map +0 -1
  1801. package/providers/index.js +0 -80
  1802. package/shell-params.d.ts +0 -12
  1803. package/shell-params.d.ts.map +0 -1
  1804. package/shell-params.js +0 -19
  1805. package/state/AppContext.d.ts +0 -12
  1806. package/state/AppContext.d.ts.map +0 -1
  1807. package/state/AppContext.js +0 -5102
  1808. package/state/index.d.ts +0 -7
  1809. package/state/index.d.ts.map +0 -1
  1810. package/state/index.js +0 -6
  1811. package/state/internal.d.ts +0 -7
  1812. package/state/internal.d.ts.map +0 -1
  1813. package/state/internal.js +0 -6
  1814. package/state/onboarding-resume.d.ts +0 -11
  1815. package/state/onboarding-resume.d.ts.map +0 -1
  1816. package/state/onboarding-resume.js +0 -187
  1817. package/state/parsers.d.ts +0 -26
  1818. package/state/parsers.d.ts.map +0 -1
  1819. package/state/parsers.js +0 -255
  1820. package/state/persistence.d.ts +0 -59
  1821. package/state/persistence.d.ts.map +0 -1
  1822. package/state/persistence.js +0 -328
  1823. package/state/shell-routing.d.ts +0 -12
  1824. package/state/shell-routing.d.ts.map +0 -1
  1825. package/state/shell-routing.js +0 -26
  1826. package/state/types.d.ts +0 -426
  1827. package/state/types.d.ts.map +0 -1
  1828. package/state/types.js +0 -89
  1829. package/state/ui-preferences.d.ts +0 -3
  1830. package/state/ui-preferences.d.ts.map +0 -1
  1831. package/state/ui-preferences.js +0 -1
  1832. package/state/useApp.d.ts +0 -4
  1833. package/state/useApp.d.ts.map +0 -1
  1834. package/state/useApp.js +0 -22
  1835. package/state/vrm.d.ts +0 -30
  1836. package/state/vrm.d.ts.map +0 -1
  1837. package/state/vrm.js +0 -82
  1838. package/styles/anime.css +0 -6364
  1839. package/styles/base.css +0 -255
  1840. package/styles/onboarding-game.css +0 -1095
  1841. package/styles/styles.css +0 -2087
  1842. package/styles/xterm.css +0 -241
  1843. package/types/index.d.ts +0 -657
  1844. package/types/index.d.ts.map +0 -1
  1845. package/types/index.js +0 -1
  1846. package/utils/asset-url.d.ts +0 -26
  1847. package/utils/asset-url.d.ts.map +0 -1
  1848. package/utils/asset-url.js +0 -99
  1849. package/utils/assistant-text.d.ts +0 -2
  1850. package/utils/assistant-text.d.ts.map +0 -1
  1851. package/utils/assistant-text.js +0 -161
  1852. package/utils/clipboard.d.ts +0 -2
  1853. package/utils/clipboard.d.ts.map +0 -1
  1854. package/utils/clipboard.js +0 -38
  1855. package/utils/desktop-dialogs.d.ts +0 -19
  1856. package/utils/desktop-dialogs.d.ts.map +0 -1
  1857. package/utils/desktop-dialogs.js +0 -50
  1858. package/utils/eliza-globals.d.ts +0 -11
  1859. package/utils/eliza-globals.d.ts.map +0 -1
  1860. package/utils/eliza-globals.js +0 -33
  1861. package/utils/index.d.ts +0 -8
  1862. package/utils/index.d.ts.map +0 -1
  1863. package/utils/index.js +0 -7
  1864. package/utils/number-parsing.d.ts +0 -44
  1865. package/utils/number-parsing.d.ts.map +0 -1
  1866. package/utils/number-parsing.js +0 -56
  1867. package/utils/openExternalUrl.d.ts +0 -2
  1868. package/utils/openExternalUrl.d.ts.map +0 -1
  1869. package/utils/openExternalUrl.js +0 -17
  1870. package/utils/spoken-text.d.ts +0 -2
  1871. package/utils/spoken-text.d.ts.map +0 -1
  1872. package/utils/spoken-text.js +0 -56
  1873. package/utils/streaming-text.d.ts +0 -3
  1874. package/utils/streaming-text.d.ts.map +0 -1
  1875. package/utils/streaming-text.js +0 -87
  1876. package/voice/index.d.ts +0 -2
  1877. package/voice/index.d.ts.map +0 -1
  1878. package/voice/index.js +0 -1
  1879. package/voice/types.d.ts +0 -25
  1880. package/voice/types.d.ts.map +0 -1
  1881. package/voice/types.js +0 -166
  1882. package/wallet-rpc.d.ts +0 -8
  1883. package/wallet-rpc.d.ts.map +0 -1
  1884. package/wallet-rpc.js +0 -131
  1885. /package/{components/apps/extensions → services/local-inference/voice}/types.js +0 -0
@@ -0,0 +1,1892 @@
1
+ /**
2
+ * Agent Native Module for Electrobun
3
+ *
4
+ * Embeds the elizaOS agent runtime as an isolated child process
5
+ * using Bun.spawn() and exposes it to the webview via RPC messages.
6
+ *
7
+ * Instead of dynamically importing the runtime into the main process
8
+ * (which requires fighting ASAR, CJS/ESM mismatch, and NODE_PATH hacks),
9
+ * we spawn a separate Bun process that runs the canonical CLI/server entry
10
+ * (`entry.js start`). This gives us:
11
+ * - Clean process isolation (native module crashes don't kill the UI)
12
+ * - No ESM/CJS import gymnastics
13
+ * - Simple lifecycle management via SIGTERM/SIGKILL
14
+ * - stdout/stderr streaming for diagnostics
15
+ *
16
+ * The renderer never needs to know whether the API server is embedded or
17
+ * remote -- it simply connects to `http://localhost:{port}`.
18
+ *
19
+ * **Port policy (WHY):** we resolve a **free** loopback desktop API port from
20
+ * `ELIZA_API_PORT`, `ELIZA_API_PORT`, or `ELIZA_PORT` (see
21
+ * `findFirstAvailableLoopbackPort`) instead of SIGKILL-ing listeners by
22
+ * default, so two desktop apps can run side by side. Optional
23
+ * `ELIZA_AGENT_RECLAIM_STALE_PORT=1` (legacy: `ELIZA_AGENT_RECLAIM_STALE_PORT`)
24
+ * restores lsof-based reclaim for single-instance dev.
25
+ */
26
+
27
+ import crypto from "node:crypto";
28
+ import fs from "node:fs";
29
+ import os from "node:os";
30
+ import path from "node:path";
31
+ import { Utils } from "electrobun/bun";
32
+ import {
33
+ resolveApiToken,
34
+ resolveDesktopApiPort,
35
+ resolveDisableAutoApiToken,
36
+ setApiToken,
37
+ } from "@elizaos/shared";
38
+ import { resolveDesktopRuntimeMode } from "../api-base";
39
+ import { getBrandConfig } from "../brand-config";
40
+ import { DEFAULT_API_PORT } from "../constants";
41
+ import { logger } from "../logger";
42
+ import { recordStartupPhase, resolveStartupBundlePath } from "../startup-trace";
43
+ import type { SendToWebview } from "../types.js";
44
+ import { findFirstAvailableLoopbackPort } from "./loopback-port";
45
+
46
+ // ---------------------------------------------------------------------------
47
+ // Types
48
+ // ---------------------------------------------------------------------------
49
+
50
+ interface AgentStatus {
51
+ state: "not_started" | "starting" | "running" | "stopped" | "error";
52
+ agentName: string | null;
53
+ port: number | null;
54
+ startedAt: number | null;
55
+ error: string | null;
56
+ }
57
+
58
+ export interface StartupDiagnosticsSnapshot {
59
+ state: AgentStatus["state"];
60
+ phase: string;
61
+ updatedAt: string;
62
+ lastError: string | null;
63
+ agentName: string | null;
64
+ port: number | null;
65
+ startedAt: number | null;
66
+ platform: string;
67
+ arch: string;
68
+ configDir: string;
69
+ logPath: string;
70
+ statusPath: string;
71
+ }
72
+
73
+ export interface BugReportBundleResult {
74
+ directory: string;
75
+ reportMarkdownPath: string;
76
+ reportJsonPath: string;
77
+ startupLogPath: string | null;
78
+ startupStatusPath: string | null;
79
+ }
80
+
81
+ import type {
82
+ ExistingElizaInstallInfo,
83
+ ExistingElizaInstallSource,
84
+ StateDirMigrationResult,
85
+ } from "../rpc-schema";
86
+
87
+ export type {
88
+ ExistingElizaInstallInfo,
89
+ ExistingElizaInstallSource,
90
+ StateDirMigrationResult,
91
+ };
92
+
93
+ // Subprocess type from Bun.spawn
94
+ type BunSubprocess = ReturnType<typeof Bun.spawn>;
95
+
96
+ // ---------------------------------------------------------------------------
97
+ // Constants
98
+ // ---------------------------------------------------------------------------
99
+
100
+ const HEALTH_POLL_INTERVAL_MS = process.platform === "win32" ? 2_000 : 500;
101
+ const SIGTERM_GRACE_MS = 5_000;
102
+ const AGENT_NAME_FETCH_TIMEOUT_MS = 5_000;
103
+ const WINDOWS_ABS_PATH_RE = /^[A-Za-z]:[\\/]/;
104
+ const ELIZA_CONFIG_FILENAME = "eliza.json";
105
+
106
+ export function getHealthPollTimeoutMs(
107
+ env: NodeJS.ProcessEnv = process.env,
108
+ platform: string = process.platform,
109
+ ): number {
110
+ const raw = env.ELIZA_AGENT_HEALTH_TIMEOUT_MS?.trim();
111
+ if (raw) {
112
+ const parsed = Number.parseInt(raw, 10);
113
+ if (Number.isFinite(parsed) && parsed > 0) {
114
+ return parsed;
115
+ }
116
+ }
117
+
118
+ // Windows packaged first-run startup can include PGLite initialization plus
119
+ // a GGUF embedding model download before /api/health comes online.
120
+ return platform === "win32" ? 240_000 : 120_000;
121
+ }
122
+
123
+ function isPosixAbsolutePath(value: string): boolean {
124
+ return value.startsWith("/") && !WINDOWS_ABS_PATH_RE.test(value);
125
+ }
126
+
127
+ function resolvePortablePath(value: string): string {
128
+ if (isPosixAbsolutePath(value) || WINDOWS_ABS_PATH_RE.test(value)) {
129
+ return value;
130
+ }
131
+ return path.resolve(value);
132
+ }
133
+
134
+ function dirnamePortable(value: string): string {
135
+ return isPosixAbsolutePath(value)
136
+ ? path.posix.dirname(value)
137
+ : path.dirname(value);
138
+ }
139
+
140
+ function joinPortable(base: string, ...parts: string[]): string {
141
+ return isPosixAbsolutePath(base)
142
+ ? path.posix.join(base, ...parts)
143
+ : path.join(base, ...parts);
144
+ }
145
+
146
+ function resolveRelativePortable(base: string, relativePath: string): string {
147
+ return isPosixAbsolutePath(base)
148
+ ? path.posix.resolve(base, relativePath)
149
+ : path.resolve(base, relativePath);
150
+ }
151
+
152
+ function getDefaultModuleDir(): string {
153
+ return import.meta.dir ?? path.join(process.cwd(), "src");
154
+ }
155
+
156
+ function normalizeEnvPath(value: string | undefined): string | null {
157
+ const trimmed = value?.trim();
158
+ return trimmed ? resolvePortablePath(trimmed) : null;
159
+ }
160
+
161
+ function isStoreBuildVariant(env: NodeJS.ProcessEnv = process.env): boolean {
162
+ const raw = env.MILADY_BUILD_VARIANT?.trim() || env.ELIZA_BUILD_VARIANT?.trim();
163
+ return raw?.toLowerCase() === "store";
164
+ }
165
+
166
+ function resolveStateNamespace(env: NodeJS.ProcessEnv = process.env): string {
167
+ return env.ELIZA_NAMESPACE?.trim() || getBrandConfig().namespace || "eliza";
168
+ }
169
+
170
+ function resolveExplicitStateDir(env: NodeJS.ProcessEnv): string | null {
171
+ return (
172
+ normalizeEnvPath(env.MILADY_STATE_DIR) ??
173
+ normalizeEnvPath(env.ELIZA_STATE_DIR)
174
+ );
175
+ }
176
+
177
+ function resolveStoreUserDataStateDir(): string {
178
+ const userData = Utils.paths.userData || resolveConfigDir();
179
+ return path.join(userData, "state");
180
+ }
181
+
182
+ export function resolveDesktopChildStateDir(opts?: {
183
+ env?: NodeJS.ProcessEnv;
184
+ homedir?: string;
185
+ }): string {
186
+ const env = opts?.env ?? process.env;
187
+ const explicit = resolveExplicitStateDir(env);
188
+ if (explicit) return explicit;
189
+ if (isStoreBuildVariant(env)) return resolveStoreUserDataStateDir();
190
+ return joinPortable(
191
+ opts?.homedir ?? os.homedir(),
192
+ `.${resolveStateNamespace(env)}`,
193
+ );
194
+ }
195
+
196
+ function applyDesktopChildStateEnv(childEnv: Record<string, string>): void {
197
+ if (!isStoreBuildVariant(childEnv as NodeJS.ProcessEnv)) return;
198
+ const stateDir = resolveDesktopChildStateDir({
199
+ env: childEnv as NodeJS.ProcessEnv,
200
+ });
201
+ fs.mkdirSync(stateDir, { recursive: true });
202
+ childEnv.MILADY_STATE_DIR = stateDir;
203
+ childEnv.ELIZA_STATE_DIR = stateDir;
204
+ }
205
+
206
+ function listStateEntries(stateDir: string): string[] {
207
+ try {
208
+ return fs
209
+ .readdirSync(stateDir)
210
+ .filter(
211
+ (entry) => entry !== "." && entry !== ".." && entry !== ".DS_Store",
212
+ );
213
+ } catch {
214
+ return [];
215
+ }
216
+ }
217
+
218
+ function buildExistingElizaInstallCandidates(opts?: {
219
+ env?: NodeJS.ProcessEnv;
220
+ homedir?: string;
221
+ }): Array<{
222
+ source: ExistingElizaInstallSource;
223
+ stateDir: string;
224
+ configPath: string;
225
+ }> {
226
+ const env = opts?.env ?? process.env;
227
+ const homedir = opts?.homedir ?? os.homedir();
228
+ const configPathFromEnv =
229
+ normalizeEnvPath(env.MILADY_CONFIG_PATH) ??
230
+ normalizeEnvPath(env.ELIZA_CONFIG_PATH);
231
+ const stateDirFromEnv = resolveExplicitStateDir(env);
232
+ const defaultStateDir = joinPortable(homedir, `.${resolveStateNamespace(env)}`);
233
+
234
+ const candidates = [
235
+ configPathFromEnv
236
+ ? {
237
+ source: "config-path-env" as const,
238
+ stateDir: dirnamePortable(configPathFromEnv),
239
+ configPath: configPathFromEnv,
240
+ }
241
+ : null,
242
+ stateDirFromEnv
243
+ ? {
244
+ source: "state-dir-env" as const,
245
+ stateDir: stateDirFromEnv,
246
+ configPath: joinPortable(stateDirFromEnv, ELIZA_CONFIG_FILENAME),
247
+ }
248
+ : null,
249
+ {
250
+ source: "default-state-dir" as const,
251
+ stateDir: defaultStateDir,
252
+ configPath: joinPortable(defaultStateDir, ELIZA_CONFIG_FILENAME),
253
+ },
254
+ ].filter((candidate): candidate is NonNullable<typeof candidate> =>
255
+ Boolean(candidate),
256
+ );
257
+
258
+ return candidates.filter(
259
+ (candidate, index, all) =>
260
+ all.findIndex(
261
+ (other) =>
262
+ other.stateDir === candidate.stateDir &&
263
+ other.configPath === candidate.configPath,
264
+ ) === index,
265
+ );
266
+ }
267
+
268
+ export function inspectExistingElizaInstall(opts?: {
269
+ env?: NodeJS.ProcessEnv;
270
+ homedir?: string;
271
+ }): ExistingElizaInstallInfo {
272
+ const candidates = buildExistingElizaInstallCandidates(opts);
273
+
274
+ for (const candidate of candidates) {
275
+ const configExists = fs.existsSync(candidate.configPath);
276
+ const stateDirExists = fs.existsSync(candidate.stateDir);
277
+ const hasStateEntries =
278
+ stateDirExists && listStateEntries(candidate.stateDir).length > 0;
279
+
280
+ if (configExists || hasStateEntries) {
281
+ return {
282
+ detected: true,
283
+ stateDir: candidate.stateDir,
284
+ configPath: candidate.configPath,
285
+ configExists,
286
+ stateDirExists,
287
+ hasStateEntries,
288
+ source: candidate.source,
289
+ };
290
+ }
291
+ }
292
+
293
+ const fallback = candidates[0] ?? {
294
+ source: "default-state-dir" as const,
295
+ stateDir: joinPortable(
296
+ opts?.homedir ?? os.homedir(),
297
+ `.${resolveStateNamespace(opts?.env ?? process.env)}`,
298
+ ),
299
+ configPath: joinPortable(
300
+ joinPortable(
301
+ opts?.homedir ?? os.homedir(),
302
+ `.${resolveStateNamespace(opts?.env ?? process.env)}`,
303
+ ),
304
+ ELIZA_CONFIG_FILENAME,
305
+ ),
306
+ };
307
+
308
+ return {
309
+ detected: false,
310
+ stateDir: fallback.stateDir,
311
+ configPath: fallback.configPath,
312
+ configExists: false,
313
+ stateDirExists: fs.existsSync(fallback.stateDir),
314
+ hasStateEntries: false,
315
+ source: fallback.source,
316
+ };
317
+ }
318
+
319
+ // ---------------------------------------------------------------------------
320
+ // Diagnostic logging
321
+ // ---------------------------------------------------------------------------
322
+
323
+ /**
324
+ * Resolve the platform-appropriate config directory for the desktop app.
325
+ * Windows: %APPDATA%\{configDirName} (e.g. C:\Users\X\AppData\Roaming\elizaOS)
326
+ * macOS/Linux: ~/.config/{configDirName}
327
+ *
328
+ * Exported for testability — accepts explicit overrides so tests don't need
329
+ * to mock process globals.
330
+ */
331
+ export function resolveConfigDir(opts?: {
332
+ platform?: string;
333
+ appdata?: string;
334
+ homedir?: string;
335
+ }): string {
336
+ const platform = opts?.platform ?? process.platform;
337
+ const homedir = opts?.homedir ?? os.homedir();
338
+ const dirName = getBrandConfig().configDirName;
339
+ if (platform === "win32") {
340
+ const roaming =
341
+ opts?.appdata ??
342
+ process.env.APPDATA ??
343
+ joinPortable(homedir, "AppData", "Roaming");
344
+ return joinPortable(roaming, dirName);
345
+ }
346
+ return joinPortable(homedir, ".config", dirName);
347
+ }
348
+
349
+ export function ensureDesktopApiToken(
350
+ env: NodeJS.ProcessEnv = process.env,
351
+ ): string {
352
+ const existingToken = resolveApiToken(env);
353
+ if (existingToken) {
354
+ setApiToken(env, existingToken);
355
+ return existingToken;
356
+ }
357
+
358
+ if (resolveDisableAutoApiToken(env)) {
359
+ return "";
360
+ }
361
+
362
+ const generated = crypto.randomBytes(16).toString("hex");
363
+ setApiToken(env, generated);
364
+ return generated;
365
+ }
366
+
367
+ export function configureDesktopLocalApiAuth(
368
+ env: NodeJS.ProcessEnv = process.env,
369
+ ): string {
370
+ const token = ensureDesktopApiToken(env);
371
+ env.ELIZA_PAIRING_DISABLED = "1";
372
+ return token;
373
+ }
374
+
375
+ function getDesktopApiToken(
376
+ env: NodeJS.ProcessEnv = process.env,
377
+ ): string | null {
378
+ return resolveApiToken(env);
379
+ }
380
+
381
+ function getDesktopApiHeaders(
382
+ env: NodeJS.ProcessEnv = process.env,
383
+ ): Record<string, string> | undefined {
384
+ const token = getDesktopApiToken(env);
385
+ if (!token) return undefined;
386
+ return {
387
+ Authorization: `Bearer ${token}`,
388
+ "X-Api-Key": token,
389
+ "X-Api-Token": token,
390
+ };
391
+ }
392
+
393
+ let diagnosticLogPath: string | null = null;
394
+ let startupStatusPath: string | null = null;
395
+
396
+ export function getDiagnosticLogPath(): string {
397
+ if (diagnosticLogPath !== null) return diagnosticLogPath;
398
+ try {
399
+ const configDir = resolveConfigDir();
400
+ if (!fs.existsSync(configDir)) {
401
+ fs.mkdirSync(configDir, { recursive: true });
402
+ }
403
+ diagnosticLogPath = path.join(
404
+ configDir,
405
+ getBrandConfig().startupLogFileName,
406
+ );
407
+ } catch {
408
+ // Fallback to temp dir
409
+ diagnosticLogPath = path.join(
410
+ os.tmpdir(),
411
+ getBrandConfig().startupLogFileName,
412
+ );
413
+ }
414
+ return diagnosticLogPath;
415
+ }
416
+
417
+ export function getStartupStatusPath(): string {
418
+ if (startupStatusPath !== null) return startupStatusPath;
419
+ try {
420
+ const configDir = resolveConfigDir();
421
+ if (!fs.existsSync(configDir)) {
422
+ fs.mkdirSync(configDir, { recursive: true });
423
+ }
424
+ startupStatusPath = path.join(configDir, "startup-status.json");
425
+ } catch {
426
+ startupStatusPath = path.join(os.tmpdir(), "startup-status.json");
427
+ }
428
+ return startupStatusPath;
429
+ }
430
+
431
+ export function diagnosticLog(message: string): void {
432
+ const timestamp = new Date().toISOString();
433
+ const line = `[${timestamp}] ${message}\n`;
434
+ console.log(message);
435
+ try {
436
+ const logPath = getDiagnosticLogPath();
437
+ fs.appendFileSync(logPath, line);
438
+ } catch {
439
+ // Ignore write errors
440
+ }
441
+ }
442
+
443
+ /** One-line, truncated error string safe for UI (status.error). */
444
+ function shortError(err: unknown, maxLen = 280): string {
445
+ const raw =
446
+ err instanceof Error
447
+ ? err.message || (err.stack ?? String(err))
448
+ : String(err);
449
+ const oneLine = raw.replace(/\s+/g, " ").trim();
450
+ if (oneLine.length <= maxLen) return oneLine;
451
+ return `${oneLine.slice(0, maxLen)}... (see logs for full details)`;
452
+ }
453
+
454
+ export function redactSensitiveDiagnostics(input: string): string {
455
+ return input
456
+ .replace(
457
+ /(authorization\s*[:=]\s*bearer\s+)([a-z0-9._-]+)/gi,
458
+ "$1[REDACTED]",
459
+ )
460
+ .replace(
461
+ /((?:x-api-key|x-api-token|api[_-]?key|bearer[_-]?token|access[_-]?token|secret|password)\s*[:=]\s*)([^\s]+)/gi,
462
+ "$1[REDACTED]",
463
+ );
464
+ }
465
+
466
+ function readFileTail(filePath: string, maxChars = 16_000): string {
467
+ try {
468
+ const content = fs.readFileSync(filePath, "utf8");
469
+ return redactSensitiveDiagnostics(content.slice(-maxChars));
470
+ } catch {
471
+ return "";
472
+ }
473
+ }
474
+
475
+ function writeStartupDiagnosticsSnapshot(
476
+ snapshot: StartupDiagnosticsSnapshot,
477
+ ): void {
478
+ try {
479
+ fs.writeFileSync(
480
+ getStartupStatusPath(),
481
+ `${JSON.stringify(snapshot, null, 2)}\n`,
482
+ "utf8",
483
+ );
484
+ } catch {
485
+ // Ignore write errors
486
+ }
487
+ }
488
+
489
+ export function getStartupDiagnosticsSnapshot(): StartupDiagnosticsSnapshot {
490
+ let parsed: Partial<StartupDiagnosticsSnapshot> | null = null;
491
+ try {
492
+ parsed = JSON.parse(
493
+ fs.readFileSync(getStartupStatusPath(), "utf8"),
494
+ ) as Partial<StartupDiagnosticsSnapshot> | null;
495
+ } catch {
496
+ parsed = null;
497
+ }
498
+
499
+ return {
500
+ state: parsed?.state ?? "not_started",
501
+ phase: parsed?.phase ?? "unknown",
502
+ updatedAt: parsed?.updatedAt ?? new Date().toISOString(),
503
+ lastError: parsed?.lastError ?? null,
504
+ agentName: parsed?.agentName ?? null,
505
+ port: parsed?.port ?? null,
506
+ startedAt: parsed?.startedAt ?? null,
507
+ platform: parsed?.platform ?? process.platform,
508
+ arch: parsed?.arch ?? process.arch,
509
+ configDir: parsed?.configDir ?? resolveConfigDir(),
510
+ logPath: parsed?.logPath ?? getDiagnosticLogPath(),
511
+ statusPath: parsed?.statusPath ?? getStartupStatusPath(),
512
+ };
513
+ }
514
+
515
+ export function getStartupDiagnosticLogTail(maxChars = 16_000): string {
516
+ return readFileTail(getDiagnosticLogPath(), maxChars);
517
+ }
518
+
519
+ function sanitizeBugReportPrefix(prefix: string | undefined): string {
520
+ const trimmed = prefix?.trim();
521
+ if (!trimmed) return "bug-report";
522
+
523
+ const sanitized = trimmed
524
+ .replace(/[\\/]+/g, "-")
525
+ .replace(/\.\.+/g, "-")
526
+ .replace(/[^a-zA-Z0-9._-]+/g, "-")
527
+ .replace(/-+/g, "-")
528
+ .replace(/^[._-]+|[._-]+$/g, "")
529
+ .slice(0, 64);
530
+
531
+ return sanitized || "bug-report";
532
+ }
533
+ export function createBugReportBundle(options: {
534
+ reportMarkdown: string;
535
+ reportJson: Record<string, unknown>;
536
+ prefix?: string;
537
+ }): BugReportBundleResult {
538
+ const configDir = resolveConfigDir();
539
+ const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
540
+ const prefix = sanitizeBugReportPrefix(options.prefix);
541
+ const directory = path.join(
542
+ configDir,
543
+ "bug-reports",
544
+ `${prefix}-${timestamp}`,
545
+ );
546
+ const reportMarkdownPath = path.join(directory, "report.md");
547
+ const reportJsonPath = path.join(directory, "report.json");
548
+ const logPath = getDiagnosticLogPath();
549
+ const statusPath = getStartupStatusPath();
550
+ const startupLogTarget = path.join(
551
+ directory,
552
+ getBrandConfig().startupLogFileName,
553
+ );
554
+ const startupStatusTarget = path.join(directory, "startup-status.json");
555
+ const startupDiagnostics = getStartupDiagnosticsSnapshot();
556
+ const includeLogTail =
557
+ typeof options.reportJson.attachLogs === "boolean"
558
+ ? options.reportJson.attachLogs
559
+ : true;
560
+ const startupLogTail = includeLogTail ? getStartupDiagnosticLogTail() : "";
561
+ const normalizedReportJson = {
562
+ ...options.reportJson,
563
+ startupDiagnostics,
564
+ startupLogTail,
565
+ };
566
+
567
+ fs.mkdirSync(directory, { recursive: true });
568
+ fs.writeFileSync(reportMarkdownPath, options.reportMarkdown, "utf8");
569
+ fs.writeFileSync(
570
+ reportJsonPath,
571
+ `${JSON.stringify(normalizedReportJson, null, 2)}\n`,
572
+ "utf8",
573
+ );
574
+
575
+ let copiedLogPath: string | null = null;
576
+ let copiedStatusPath: string | null = null;
577
+
578
+ if (fs.existsSync(logPath)) {
579
+ fs.copyFileSync(logPath, startupLogTarget);
580
+ copiedLogPath = startupLogTarget;
581
+ }
582
+ if (fs.existsSync(statusPath)) {
583
+ fs.copyFileSync(statusPath, startupStatusTarget);
584
+ copiedStatusPath = startupStatusTarget;
585
+ }
586
+
587
+ return {
588
+ directory,
589
+ reportMarkdownPath,
590
+ reportJsonPath,
591
+ startupLogPath: copiedLogPath,
592
+ startupStatusPath: copiedStatusPath,
593
+ };
594
+ }
595
+
596
+ // ---------------------------------------------------------------------------
597
+ // Path resolution
598
+ // ---------------------------------------------------------------------------
599
+
600
+ /**
601
+ * Resolve the runtime dist directory.
602
+ *
603
+ * Priority:
604
+ * 1. ELIZA_DIST_PATH / ELIZA_DIST_PATH env var (explicit override)
605
+ * 2. Walk up from import.meta.dir to find the runtime dist dir as a sibling
606
+ */
607
+ export function getRuntimeDistFallbackCandidates(
608
+ moduleDir: string = getDefaultModuleDir(),
609
+ execPath: string = process.execPath,
610
+ ): string[] {
611
+ const execDir = execPath ? dirnamePortable(execPath) : moduleDir;
612
+ const distDir = getBrandConfig().runtimeDistDirName;
613
+
614
+ return [
615
+ // macOS: inside .app bundle (Contents/Resources/app/<dist>)
616
+ resolveRelativePortable(execDir, `../Resources/app/${distDir}`),
617
+ // Windows NSIS/portable: resources/app/<dist> next to exe
618
+ resolveRelativePortable(execDir, `resources/app/${distDir}`),
619
+ resolveRelativePortable(execDir, `../resources/app/${distDir}`),
620
+ resolveRelativePortable(moduleDir, `app/${distDir}`),
621
+ resolveRelativePortable(moduleDir, `../${distDir}`),
622
+ resolveRelativePortable(moduleDir, `../app/${distDir}`),
623
+ resolveRelativePortable(moduleDir, `../../../${distDir}`),
624
+ // Legacy eliza-dist fallback for existing packaged builds
625
+ resolveRelativePortable(execDir, "../Resources/app/eliza-dist"),
626
+ resolveRelativePortable(execDir, "resources/app/eliza-dist"),
627
+ resolveRelativePortable(moduleDir, "../eliza-dist"),
628
+ resolveRelativePortable(moduleDir, "../../../eliza-dist"),
629
+ ].filter((candidate, index, all) => all.indexOf(candidate) === index);
630
+ }
631
+
632
+ export function isPackagedDesktopRuntime(
633
+ moduleDir: string = getDefaultModuleDir(),
634
+ execPath: string = process.execPath,
635
+ ): boolean {
636
+ const normalizedModuleDir = moduleDir.replaceAll("\\", "/");
637
+ const normalizedExecPath = execPath.replaceAll("\\", "/").toLowerCase();
638
+ const looksLikePackagedExec =
639
+ normalizedExecPath.includes(".app/contents/") ||
640
+ normalizedExecPath.includes("/self-extraction/") ||
641
+ normalizedExecPath.endsWith("/launcher") ||
642
+ normalizedExecPath.endsWith("/launcher.exe");
643
+ if (process.env.ELIZA_DIST_PATH?.trim() && !looksLikePackagedExec) {
644
+ return false;
645
+ }
646
+ if (!normalizedModuleDir.includes("/src/")) {
647
+ return true;
648
+ }
649
+
650
+ return looksLikePackagedExec;
651
+ }
652
+
653
+ export function resolveBunExecutablePath(opts?: {
654
+ execPath?: string;
655
+ moduleDir?: string;
656
+ platform?: string;
657
+ }): string {
658
+ const execPath = opts?.execPath ?? process.execPath;
659
+ const moduleDir = opts?.moduleDir ?? getDefaultModuleDir();
660
+ const platform = opts?.platform ?? process.platform;
661
+ const packagedRuntime = isPackagedDesktopRuntime(moduleDir, execPath);
662
+ const looksLikeMacBundleExec = execPath.includes(".app/Contents/MacOS/");
663
+ const executableName =
664
+ platform === "win32" && !looksLikeMacBundleExec ? "bun.exe" : "bun";
665
+ const execDir = execPath ? dirnamePortable(execPath) : "";
666
+ const packagedCandidates = [
667
+ execPath,
668
+ execDir ? joinPortable(execDir, executableName) : "",
669
+ execDir
670
+ ? resolveRelativePortable(
671
+ execDir,
672
+ `../Resources/app/bun/${executableName}`,
673
+ )
674
+ : "",
675
+ execDir
676
+ ? resolveRelativePortable(
677
+ execDir,
678
+ `../Resources/app/bun/bin/${executableName}`,
679
+ )
680
+ : "",
681
+ moduleDir ? joinPortable(moduleDir, executableName) : "",
682
+ moduleDir ? joinPortable(moduleDir, "bin", executableName) : "",
683
+ moduleDir
684
+ ? resolveRelativePortable(moduleDir, `../bun/${executableName}`)
685
+ : "",
686
+ moduleDir
687
+ ? resolveRelativePortable(moduleDir, `../bun/bin/${executableName}`)
688
+ : "",
689
+ ].filter(Boolean);
690
+
691
+ for (const candidate of packagedCandidates) {
692
+ if (!fs.existsSync(candidate)) continue;
693
+ if (
694
+ path.basename(candidate).toLowerCase() === executableName.toLowerCase()
695
+ ) {
696
+ return candidate;
697
+ }
698
+ }
699
+
700
+ if (packagedRuntime) {
701
+ return (
702
+ packagedCandidates.find(
703
+ (candidate) =>
704
+ path.basename(candidate).toLowerCase() ===
705
+ executableName.toLowerCase(),
706
+ ) ?? executableName
707
+ );
708
+ }
709
+
710
+ const _candidates = [
711
+ execPath,
712
+ execDir ? joinPortable(execDir, executableName) : "",
713
+ ].filter(Boolean);
714
+
715
+ const bunGlobal = Bun as { which?: (binary: string) => string | null };
716
+ const whichCandidate =
717
+ typeof bunGlobal.which === "function" ? bunGlobal.which("bun") : null;
718
+ if (whichCandidate) return whichCandidate;
719
+
720
+ // Windows: bun is not always on PATH; check well-known install locations.
721
+ if (process.platform === "win32") {
722
+ const localAppData =
723
+ process.env.LOCALAPPDATA ??
724
+ joinPortable(os.homedir(), "AppData", "Local");
725
+ const programFiles = process.env.ProgramFiles ?? "C:\\Program Files";
726
+ const winCandidates = [
727
+ joinPortable(localAppData, "bun", "bun.exe"),
728
+ joinPortable(programFiles, "bun", "bun.exe"),
729
+ joinPortable(os.homedir(), ".bun", "bin", "bun.exe"),
730
+ ];
731
+ for (const candidate of winCandidates) {
732
+ if (fs.existsSync(candidate)) return candidate;
733
+ }
734
+ }
735
+
736
+ return "bun";
737
+ }
738
+
739
+ export function resolveRuntimeDistPath(opts?: {
740
+ env?: NodeJS.ProcessEnv;
741
+ moduleDir?: string;
742
+ execPath?: string;
743
+ }): string {
744
+ const env = opts?.env ?? process.env;
745
+ const moduleDir = opts?.moduleDir ?? getDefaultModuleDir();
746
+ const execPath = opts?.execPath ?? process.execPath;
747
+ const packagedRuntime = isPackagedDesktopRuntime(moduleDir, execPath);
748
+ const distDir = getBrandConfig().runtimeDistDirName;
749
+ const fallbackCandidates = getRuntimeDistFallbackCandidates(
750
+ moduleDir,
751
+ execPath,
752
+ );
753
+
754
+ if (packagedRuntime) {
755
+ for (const candidate of fallbackCandidates) {
756
+ if (fs.existsSync(candidate)) {
757
+ return candidate;
758
+ }
759
+ }
760
+ const fallback = fallbackCandidates[0];
761
+ diagnosticLog(
762
+ `[Agent] Could not find packaged runtime dist; using fallback: ${fallback}`,
763
+ );
764
+ return fallback;
765
+ }
766
+
767
+ // 1. Env override
768
+ const envPath = env.ELIZA_DIST_PATH;
769
+ if (envPath) {
770
+ const resolved = resolvePortablePath(envPath);
771
+ if (fs.existsSync(resolved)) {
772
+ return resolved;
773
+ }
774
+ diagnosticLog(
775
+ `[Agent] ELIZA_DIST_PATH set but does not exist: ${resolved}`,
776
+ );
777
+ }
778
+
779
+ // 2. Walk up from import.meta.dir looking for runtime dist or dev dist
780
+ let dir = moduleDir;
781
+ const maxDepth = 15;
782
+ for (let i = 0; i < maxDepth; i++) {
783
+ // Packaged: runtime dist sibling
784
+ const runtimeDist = joinPortable(dir, distDir);
785
+ if (fs.existsSync(runtimeDist)) {
786
+ return runtimeDist;
787
+ }
788
+ // Legacy eliza-dist sibling (existing packaged builds)
789
+ const legacyDist = joinPortable(dir, "eliza-dist");
790
+ if (fs.existsSync(legacyDist)) {
791
+ return legacyDist;
792
+ }
793
+ // Dev monorepo: dist/ sibling containing the canonical CLI entrypoint
794
+ const devDist = joinPortable(dir, "dist");
795
+ if (fs.existsSync(joinPortable(devDist, "entry.js"))) {
796
+ return devDist;
797
+ }
798
+ const parent = dirnamePortable(dir);
799
+ if (parent === dir) break; // reached filesystem root
800
+ dir = parent;
801
+ }
802
+
803
+ // 3. Packaged/dev fallbacks derived from the launcher path and module dir.
804
+ for (const candidate of fallbackCandidates) {
805
+ if (fs.existsSync(candidate)) {
806
+ diagnosticLog(
807
+ `[Agent] Could not find runtime dist by walking up; using fallback: ${candidate}`,
808
+ );
809
+ return candidate;
810
+ }
811
+ }
812
+
813
+ const fallback = fallbackCandidates[0];
814
+ diagnosticLog(
815
+ `[Agent] Could not find runtime dist by walking up; using fallback: ${fallback}`,
816
+ );
817
+ return fallback;
818
+ }
819
+
820
+ export function buildChildNodePaths(
821
+ runtimeDistPath: string,
822
+ opts?: { packagedRuntime?: boolean },
823
+ ): string[] {
824
+ const nodePaths = new Set<string>();
825
+ const distModules = joinPortable(runtimeDistPath, "node_modules");
826
+ if (fs.existsSync(distModules)) {
827
+ nodePaths.add(distModules);
828
+ }
829
+
830
+ if (opts?.packagedRuntime) {
831
+ return [...nodePaths];
832
+ }
833
+
834
+ let searchDir = runtimeDistPath;
835
+ while (searchDir !== dirnamePortable(searchDir)) {
836
+ const candidate = joinPortable(searchDir, "node_modules");
837
+ if (fs.existsSync(candidate) && candidate !== distModules) {
838
+ nodePaths.add(candidate);
839
+ break;
840
+ }
841
+ searchDir = dirnamePortable(searchDir);
842
+ }
843
+
844
+ return [...nodePaths];
845
+ }
846
+
847
+ function resolveRuntimeEntryPath(runtimeDistPath: string): string | null {
848
+ const candidates = [joinPortable(runtimeDistPath, "entry.js")];
849
+
850
+ for (const candidate of candidates) {
851
+ if (fs.existsSync(candidate)) {
852
+ return candidate;
853
+ }
854
+ }
855
+
856
+ return null;
857
+ }
858
+
859
+ // ---------------------------------------------------------------------------
860
+ // Health check polling
861
+ // ---------------------------------------------------------------------------
862
+
863
+ async function waitForHealthy(
864
+ getPort: () => number,
865
+ timeoutMs: number = getHealthPollTimeoutMs(),
866
+ childProcess?: BunSubprocess | null,
867
+ ): Promise<boolean> {
868
+ const deadline = Date.now() + timeoutMs;
869
+ const headers = getDesktopApiHeaders();
870
+
871
+ while (Date.now() < deadline) {
872
+ // Bail early if the child process has already exited
873
+ if (childProcess && childProcess.exitCode !== null) {
874
+ return false;
875
+ }
876
+
877
+ const port = getPort();
878
+ const url = `http://127.0.0.1:${port}/api/health`;
879
+ try {
880
+ const response = await fetch(url, {
881
+ headers,
882
+ signal: AbortSignal.timeout(2_000),
883
+ });
884
+ if (response.ok) {
885
+ const health = (await response.json().catch(() => null)) as {
886
+ ready?: boolean;
887
+ agentState?: string;
888
+ startup?: { phase?: string };
889
+ } | null;
890
+ if (!health) {
891
+ return true;
892
+ }
893
+ if (typeof health.ready === "boolean") {
894
+ if (health.ready) {
895
+ return true;
896
+ }
897
+ } else if (
898
+ health.agentState !== "starting" &&
899
+ health.agentState !== "restarting"
900
+ ) {
901
+ return true;
902
+ }
903
+ }
904
+ } catch {
905
+ // Server not ready yet
906
+ }
907
+ await Bun.sleep(HEALTH_POLL_INTERVAL_MS);
908
+ }
909
+ return false;
910
+ }
911
+
912
+ // ---------------------------------------------------------------------------
913
+ // Stdout watcher for "listening on port" detection
914
+ // ---------------------------------------------------------------------------
915
+
916
+ async function watchStdoutForReady(
917
+ stream: ReadableStream<Uint8Array>,
918
+ onLine: (line: string) => void,
919
+ signal: AbortSignal,
920
+ ): Promise<void> {
921
+ const decoder = new TextDecoder();
922
+ let buffer = "";
923
+
924
+ try {
925
+ const reader = stream.getReader();
926
+ while (!signal.aborted) {
927
+ const { done, value } = await reader.read();
928
+ if (done) break;
929
+
930
+ buffer += decoder.decode(value, { stream: true });
931
+ const lines = buffer.split("\n");
932
+ buffer = lines.pop() ?? "";
933
+
934
+ for (const line of lines) {
935
+ if (line.trim()) {
936
+ onLine(line);
937
+ }
938
+ }
939
+ }
940
+ // Flush remaining buffer
941
+ if (buffer.trim()) {
942
+ onLine(buffer);
943
+ }
944
+ reader.releaseLock();
945
+ } catch (err) {
946
+ if (!signal.aborted) {
947
+ diagnosticLog(
948
+ `[Agent] stdout watcher error: ${err instanceof Error ? err.message : String(err)}`,
949
+ );
950
+ }
951
+ }
952
+ }
953
+
954
+ async function drainStderrToLog(
955
+ stream: ReadableStream<Uint8Array>,
956
+ signal: AbortSignal,
957
+ onLine?: (line: string) => void,
958
+ ): Promise<void> {
959
+ const decoder = new TextDecoder();
960
+ let buffer = "";
961
+
962
+ try {
963
+ const reader = stream.getReader();
964
+ while (!signal.aborted) {
965
+ const { done, value } = await reader.read();
966
+ if (done) break;
967
+
968
+ buffer += decoder.decode(value, { stream: true });
969
+ const lines = buffer.split("\n");
970
+ buffer = lines.pop() ?? "";
971
+
972
+ for (const line of lines) {
973
+ if (line.trim()) {
974
+ diagnosticLog(`[Agent][stderr] ${line}`);
975
+ onLine?.(line);
976
+ }
977
+ }
978
+ }
979
+ if (buffer.trim()) {
980
+ diagnosticLog(`[Agent][stderr] ${buffer}`);
981
+ onLine?.(buffer);
982
+ }
983
+ reader.releaseLock();
984
+ } catch (err) {
985
+ if (!signal.aborted) {
986
+ diagnosticLog(
987
+ `[Agent] stderr drain error: ${err instanceof Error ? err.message : String(err)}`,
988
+ );
989
+ }
990
+ }
991
+ }
992
+
993
+ const PGLITE_LOCK_RE =
994
+ /pglite data dir is already in use|database is locked|lock file already exists/i;
995
+ const PGLITE_RECOVERY_RE =
996
+ /failed query:\s*(?:create schema if not exists|create table if not exists life_)|aborted\(\)\. build with -sassertions|database disk image is malformed|file is not a database|malformed database schema|checksum mismatch|checkpoint failed|wal file/i;
997
+
998
+ function shouldAutoRecoverPgliteFailure(line: string): boolean {
999
+ if (PGLITE_LOCK_RE.test(line)) {
1000
+ return false;
1001
+ }
1002
+
1003
+ return (
1004
+ PGLITE_RECOVERY_RE.test(line) ||
1005
+ (/corrupt/i.test(line) && /pglite|sqlite/i.test(line))
1006
+ );
1007
+ }
1008
+
1009
+ /**
1010
+ * Opt-in: kill processes listening on `port` (lsof + SIGKILL). Default off so a
1011
+ * second desktop instance can coexist on the same machine when ports differ.
1012
+ * Set ELIZA_AGENT_RECLAIM_STALE_PORT=1 (legacy: ELIZA_AGENT_RECLAIM_STALE_PORT)
1013
+ * to restore the old “take over default port” behavior.
1014
+ */
1015
+ async function maybeReclaimPortWithSigkill(port: number): Promise<void> {
1016
+ const raw = process.env.ELIZA_AGENT_RECLAIM_STALE_PORT?.trim().toLowerCase();
1017
+ if (raw !== "1" && raw !== "true" && raw !== "yes") {
1018
+ return;
1019
+ }
1020
+ try {
1021
+ const lsofResult = Bun.spawnSync(["lsof", "-ti", `tcp:${port}`]);
1022
+ const pids = new TextDecoder()
1023
+ .decode(lsofResult.stdout)
1024
+ .trim()
1025
+ .split("\n")
1026
+ .filter(Boolean);
1027
+ for (const pid of pids) {
1028
+ const numPid = parseInt(pid, 10);
1029
+ if (!Number.isNaN(numPid) && numPid !== process.pid) {
1030
+ diagnosticLog(
1031
+ `[Agent] Reclaim: killing process ${numPid} on port ${port} (ELIZA_AGENT_RECLAIM_STALE_PORT)`,
1032
+ );
1033
+ try {
1034
+ process.kill(numPid, "SIGKILL");
1035
+ } catch {
1036
+ // Process may have already exited
1037
+ }
1038
+ }
1039
+ }
1040
+ if (pids.length > 0) {
1041
+ await new Promise((r) => setTimeout(r, 500));
1042
+ }
1043
+ } catch {
1044
+ // lsof missing — ignore
1045
+ }
1046
+ }
1047
+
1048
+ function resolvePgliteDataDir(): string {
1049
+ return joinPortable(
1050
+ os.homedir(),
1051
+ `.${getBrandConfig().namespace}`,
1052
+ "workspace",
1053
+ ".eliza",
1054
+ ".elizadb",
1055
+ );
1056
+ }
1057
+
1058
+ /**
1059
+ * Removes only the PGLite database folder (agent memory / conversations).
1060
+ * GGUF embedding weights live under `MODELS_DIR` / `~/.eliza/models` by default — never deleted here.
1061
+ */
1062
+ function deletePgliteDataDir(): void {
1063
+ const dir = resolvePgliteDataDir();
1064
+ if (path.basename(dir) !== ".elizadb") {
1065
+ diagnosticLog(
1066
+ `[Agent] deletePgliteDataDir: refused — basename must be .elizadb, got: ${dir}`,
1067
+ );
1068
+ return;
1069
+ }
1070
+ try {
1071
+ if (fs.existsSync(dir)) {
1072
+ fs.rmSync(dir, { recursive: true, force: true });
1073
+ diagnosticLog(
1074
+ `[Agent] Deleted PGLite data dir (GGUF model cache elsewhere): ${dir}`,
1075
+ );
1076
+ }
1077
+ } catch (err) {
1078
+ diagnosticLog(
1079
+ `[Agent] Failed to delete PGLite data dir: ${err instanceof Error ? err.message : String(err)}`,
1080
+ );
1081
+ }
1082
+ }
1083
+
1084
+ // ---------------------------------------------------------------------------
1085
+ // AgentManager -- singleton
1086
+ // ---------------------------------------------------------------------------
1087
+
1088
+ export class AgentManager {
1089
+ private sendToWebview: SendToWebview | null = null;
1090
+ private readonly statusListeners = new Set<
1091
+ (status: Readonly<AgentStatus>) => void
1092
+ >();
1093
+ private status: AgentStatus = {
1094
+ state: "not_started",
1095
+ agentName: null,
1096
+ port: null,
1097
+ startedAt: null,
1098
+ error: null,
1099
+ };
1100
+ private childProcess: BunSubprocess | null = null;
1101
+ private stdioAbortController: AbortController | null = null;
1102
+ private hasPgliteError = false;
1103
+ private pgliteRecoveryDone = false;
1104
+ private startupPhase = "not_started";
1105
+
1106
+ constructor() {
1107
+ this.persistStartupDiagnostics();
1108
+ }
1109
+
1110
+ setSendToWebview(fn: SendToWebview): void {
1111
+ this.sendToWebview = fn;
1112
+ }
1113
+
1114
+ onStatusChange(
1115
+ listener: (status: Readonly<AgentStatus>) => void,
1116
+ ): () => void {
1117
+ this.statusListeners.add(listener);
1118
+ return () => {
1119
+ this.statusListeners.delete(listener);
1120
+ };
1121
+ }
1122
+
1123
+ /** Start the agent runtime as a child process. Idempotent. */
1124
+ async start(): Promise<AgentStatus> {
1125
+ recordStartupPhase("agent_start_entered", {
1126
+ pid: process.pid,
1127
+ exec_path: process.execPath,
1128
+ bundle_path: resolveStartupBundlePath(process.execPath),
1129
+ });
1130
+ this.setStartupPhase("start_requested");
1131
+ recordStartupPhase("agent_start_entered", {
1132
+ pid: process.pid,
1133
+ exec_path: process.execPath,
1134
+ bundle_path: resolveStartupBundlePath(process.execPath),
1135
+ });
1136
+ diagnosticLog(
1137
+ `[Agent] start() called, current state: ${this.status.state}`,
1138
+ );
1139
+ diagnosticLog(`[Agent] Diagnostic log file: ${getDiagnosticLogPath()}`);
1140
+
1141
+ if (this.status.state === "running" || this.status.state === "starting") {
1142
+ return this.status;
1143
+ }
1144
+
1145
+ const runtimeMode = resolveDesktopRuntimeMode(
1146
+ process.env as Record<string, string | undefined>,
1147
+ );
1148
+ if (runtimeMode.mode !== "local") {
1149
+ const reason =
1150
+ runtimeMode.mode === "external"
1151
+ ? `Embedded desktop runtime is disabled because ${runtimeMode.externalApi.source} points at ${runtimeMode.externalApi.base}.`
1152
+ : "Embedded desktop runtime is disabled by ELIZA_DESKTOP_SKIP_EMBEDDED_AGENT=1.";
1153
+ diagnosticLog(`[Agent] ${reason}`);
1154
+ this.setStartupPhase("startup_disabled", reason);
1155
+ throw new Error(reason);
1156
+ }
1157
+
1158
+ let packagedRuntime: boolean;
1159
+ let apiPort: number;
1160
+ let preferredPort: number;
1161
+ try {
1162
+ configureDesktopLocalApiAuth();
1163
+ packagedRuntime = isPackagedDesktopRuntime();
1164
+
1165
+ // Reset per-startup flags
1166
+ this.pgliteRecoveryDone = false;
1167
+
1168
+ // Clean up any stale process before starting
1169
+ if (this.childProcess) {
1170
+ await this.killChildProcess();
1171
+ }
1172
+
1173
+ preferredPort = resolveDesktopApiPort(process.env) || DEFAULT_API_PORT;
1174
+ diagnosticLog(
1175
+ `[Agent] Preferred port: ${preferredPort} (packaged: ${packagedRuntime})`,
1176
+ );
1177
+ if (!packagedRuntime) {
1178
+ await maybeReclaimPortWithSigkill(preferredPort);
1179
+ }
1180
+ apiPort = await findFirstAvailableLoopbackPort(preferredPort);
1181
+ } catch (err) {
1182
+ const msg =
1183
+ err instanceof Error ? err.message : "Failed during pre-startup";
1184
+ diagnosticLog(`[Agent] ${msg}`);
1185
+ this.status = {
1186
+ state: "error",
1187
+ agentName: null,
1188
+ port: null,
1189
+ startedAt: null,
1190
+ error: msg,
1191
+ };
1192
+ recordStartupPhase("fatal", {
1193
+ port: null,
1194
+ error: msg,
1195
+ });
1196
+ this.setStartupPhase("port_allocation_failed", msg);
1197
+ this.emitStatus();
1198
+ return this.status;
1199
+ }
1200
+ if (apiPort !== preferredPort) {
1201
+ diagnosticLog(
1202
+ `[Agent] Port ${preferredPort} busy — using ${apiPort} for embedded API (set ELIZA_AGENT_RECLAIM_STALE_PORT=1 to try reclaiming the preferred port first)`,
1203
+ );
1204
+ }
1205
+ recordStartupPhase("port_selected", {
1206
+ port: apiPort,
1207
+ });
1208
+
1209
+ this.status = {
1210
+ state: "starting",
1211
+ agentName: null,
1212
+ port: null,
1213
+ startedAt: null,
1214
+ error: null,
1215
+ };
1216
+ this.setStartupPhase("starting_runtime");
1217
+ this.emitStatus();
1218
+
1219
+ try {
1220
+ // Resolve the bundled runtime dist path.
1221
+ this.setStartupPhase("resolving_runtime");
1222
+ const runtimeDistPath = resolveRuntimeDistPath();
1223
+ diagnosticLog(`[Agent] Resolved runtime dist: ${runtimeDistPath}`);
1224
+
1225
+ // Packaged builds can expose the runnable entry either at the dist root
1226
+ // or under runtime/. Prefer the root file but accept both layouts.
1227
+ const runtimeEntryPath = resolveRuntimeEntryPath(runtimeDistPath);
1228
+ if (!runtimeEntryPath) {
1229
+ const distExists = fs.existsSync(runtimeDistPath);
1230
+ let contents = "<directory missing>";
1231
+ if (distExists) {
1232
+ try {
1233
+ contents = fs.readdirSync(runtimeDistPath).join(", ");
1234
+ } catch {
1235
+ contents = "<unreadable>";
1236
+ }
1237
+ }
1238
+ const errMsg = `No runnable runtime entry found in ${runtimeDistPath} (checked entry.js; dist exists: ${distExists}, contents: ${contents})`;
1239
+ diagnosticLog(`[Agent] ${errMsg}`);
1240
+ this.status = {
1241
+ state: "error",
1242
+ agentName: null,
1243
+ port: null,
1244
+ startedAt: null,
1245
+ error: errMsg,
1246
+ };
1247
+ recordStartupPhase("fatal", {
1248
+ port: apiPort,
1249
+ error: errMsg,
1250
+ });
1251
+ this.setStartupPhase("runtime_entry_missing", errMsg);
1252
+ recordStartupPhase("fatal", {
1253
+ port: apiPort,
1254
+ error: errMsg,
1255
+ });
1256
+ this.emitStatus();
1257
+ return this.status;
1258
+ }
1259
+
1260
+ diagnosticLog(`[Agent] runtime entry: exists (${runtimeEntryPath})`);
1261
+ recordStartupPhase("runtime_path_resolved", {
1262
+ port: apiPort,
1263
+ });
1264
+
1265
+ diagnosticLog(`[Agent] Starting child process on port ${apiPort}...`);
1266
+ this.setStartupPhase("spawning_runtime");
1267
+
1268
+ // Build NODE_PATH so the child can find node_modules
1269
+ const nodePaths = buildChildNodePaths(runtimeDistPath, {
1270
+ packagedRuntime,
1271
+ });
1272
+ if (packagedRuntime && nodePaths.length === 0) {
1273
+ const errMsg =
1274
+ `Packaged runtime is missing bundle-local node_modules under ${runtimeDistPath}; ` +
1275
+ "refusing to inherit the parent NODE_PATH";
1276
+ diagnosticLog(`[Agent] ${errMsg}`);
1277
+ this.status = {
1278
+ state: "error",
1279
+ agentName: null,
1280
+ port: apiPort,
1281
+ startedAt: null,
1282
+ error: errMsg,
1283
+ };
1284
+ recordStartupPhase("fatal", {
1285
+ port: apiPort,
1286
+ error: errMsg,
1287
+ });
1288
+ this.emitStatus();
1289
+ return this.status;
1290
+ }
1291
+
1292
+ const childEnv: Record<string, string> = {
1293
+ ...(process.env as Record<string, string>),
1294
+ ELIZA_API_PORT: String(apiPort),
1295
+ ELIZA_PORT: String(apiPort),
1296
+ };
1297
+ childEnv.ELIZA_NAMESPACE =
1298
+ childEnv.ELIZA_NAMESPACE?.trim() || getBrandConfig().namespace;
1299
+ childEnv.ELIZA_NAMESPACE =
1300
+ childEnv.ELIZA_NAMESPACE?.trim() || childEnv.ELIZA_NAMESPACE;
1301
+ applyDesktopChildStateEnv(childEnv);
1302
+ delete childEnv.ELIZA_PORT;
1303
+ delete childEnv.NODE_PATH;
1304
+
1305
+ // node-llama-cpp crashes Bun on Windows during packaged startup.
1306
+ // Disable local embeddings until upstream fix lands.
1307
+ if (process.platform === "win32") {
1308
+ childEnv.ELIZA_DISABLE_LOCAL_EMBEDDINGS = "1";
1309
+ }
1310
+
1311
+ // Propagate PGlite data dir from parent env so CI/smoke test overrides
1312
+ // (e.g. a short Windows path avoiding MAX_PATH issues) reach the runtime.
1313
+ if (process.env.PGLITE_DATA_DIR) {
1314
+ childEnv.PGLITE_DATA_DIR = process.env.PGLITE_DATA_DIR;
1315
+ }
1316
+
1317
+ if (nodePaths.length > 0) {
1318
+ childEnv.NODE_PATH = nodePaths.join(path.delimiter);
1319
+ diagnosticLog(`[Agent] Child NODE_PATH: ${childEnv.NODE_PATH}`);
1320
+ }
1321
+
1322
+ const bunExecutable = resolveBunExecutablePath();
1323
+ diagnosticLog(`[Agent] Using Bun executable: ${bunExecutable}`);
1324
+ diagnosticLog(
1325
+ `[Agent] Bun exists on disk: ${fs.existsSync(bunExecutable)}`,
1326
+ );
1327
+
1328
+ // Ensure bun's directory is on PATH so child_process.exec calls
1329
+ // (e.g. plugin-manager running `bun add ...`) can find it.
1330
+ const bunDir = path.dirname(bunExecutable);
1331
+ const existingPath = childEnv.PATH ?? "";
1332
+ if (!existingPath.split(path.delimiter).includes(bunDir)) {
1333
+ childEnv.PATH = bunDir + path.delimiter + existingPath;
1334
+ diagnosticLog(`[Agent] Prepended bun dir to child PATH: ${bunDir}`);
1335
+ }
1336
+
1337
+ // Spawn the child process
1338
+ const spawnTime = Date.now();
1339
+ const proc = Bun.spawn(
1340
+ [bunExecutable, "run", runtimeEntryPath, "start"],
1341
+ {
1342
+ cwd: runtimeDistPath,
1343
+ env: childEnv,
1344
+ stdout: "pipe",
1345
+ stderr: "pipe",
1346
+ },
1347
+ );
1348
+
1349
+ this.childProcess = proc;
1350
+ diagnosticLog(
1351
+ `[Agent] Child spawned pid=${proc.pid} elapsed=${Date.now() - spawnTime}ms`,
1352
+ );
1353
+ recordStartupPhase("child_spawned", {
1354
+ port: apiPort,
1355
+ child_pid: proc.pid,
1356
+ });
1357
+
1358
+ // Set up abort controller for stdio watchers
1359
+ this.stdioAbortController = new AbortController();
1360
+ const { signal } = this.stdioAbortController;
1361
+
1362
+ // Surface the port immediately while waiting for ready
1363
+ this.status = {
1364
+ ...this.status,
1365
+ port: apiPort,
1366
+ };
1367
+ this.emitStatus();
1368
+
1369
+ // Track whether we detected the "listening" message from stdout
1370
+ let detectedListening = false;
1371
+
1372
+ // Watch stdout for "listening on port" or similar ready messages
1373
+ if (proc.stdout) {
1374
+ watchStdoutForReady(
1375
+ proc.stdout,
1376
+ (line: string) => {
1377
+ diagnosticLog(`[Agent][stdout] ${line}`);
1378
+ const lower = line.toLowerCase();
1379
+ // Parse dynamic port from "[eliza-api] Listening on http://host:PORT"
1380
+ const portMatch = line.match(
1381
+ /Listening on https?:\/\/[^:]+:(\d+)/i,
1382
+ );
1383
+ if (portMatch) {
1384
+ const parsedPort = parseInt(portMatch[1], 10);
1385
+ if (!Number.isNaN(parsedPort) && parsedPort > 0) {
1386
+ if (parsedPort !== apiPort) {
1387
+ diagnosticLog(
1388
+ `[Agent] Server bound to dynamic port ${parsedPort} (requested ${apiPort})`,
1389
+ );
1390
+ apiPort = parsedPort;
1391
+ }
1392
+ detectedListening = true;
1393
+ }
1394
+ } else if (
1395
+ lower.includes("listening on port") ||
1396
+ lower.includes("server started") ||
1397
+ lower.includes("ready on")
1398
+ ) {
1399
+ detectedListening = true;
1400
+ }
1401
+ // Update status port so callers see the actual bound port
1402
+ this.status = { ...this.status, port: apiPort };
1403
+ this.emitStatus();
1404
+ },
1405
+ signal,
1406
+ ).catch(() => {
1407
+ // Stream ended or aborted -- expected on shutdown
1408
+ });
1409
+ }
1410
+
1411
+ // Drain stderr to diagnostic log; detect PGLite migration failures
1412
+ this.hasPgliteError = false;
1413
+ if (proc.stderr) {
1414
+ drainStderrToLog(proc.stderr, signal, (line) => {
1415
+ if (shouldAutoRecoverPgliteFailure(line)) {
1416
+ this.hasPgliteError = true;
1417
+ }
1418
+ }).catch(() => {
1419
+ // Stream ended or aborted -- expected on shutdown
1420
+ });
1421
+ }
1422
+
1423
+ // Monitor child process exit
1424
+ this.monitorChildExit(proc);
1425
+
1426
+ // Wait for the health endpoint to respond
1427
+ // Use a getter so the health check follows dynamic port reassignment from stdout
1428
+ diagnosticLog(
1429
+ `[Agent] Waiting for health endpoint at http://127.0.0.1:${apiPort}/api/health ...`,
1430
+ );
1431
+ this.setStartupPhase("waiting_for_health");
1432
+ const healthPollTimeoutMs = getHealthPollTimeoutMs();
1433
+ const healthy = await waitForHealthy(
1434
+ () => apiPort,
1435
+ healthPollTimeoutMs,
1436
+ proc,
1437
+ );
1438
+
1439
+ if (!healthy) {
1440
+ // Check if process already exited
1441
+ if (proc.exitCode !== null) {
1442
+ const errMsg = `Child process exited with code ${proc.exitCode} before becoming healthy`;
1443
+ diagnosticLog(`[Agent] ${errMsg}`);
1444
+ this.childProcess = null;
1445
+ this.status = {
1446
+ state: "error",
1447
+ agentName: null,
1448
+ port: apiPort,
1449
+ startedAt: null,
1450
+ error: errMsg,
1451
+ };
1452
+ recordStartupPhase("fatal", {
1453
+ port: apiPort,
1454
+ child_pid: proc.pid,
1455
+ error: errMsg,
1456
+ exit_code: proc.exitCode,
1457
+ });
1458
+ this.setStartupPhase("startup_failed", errMsg);
1459
+ recordStartupPhase("fatal", {
1460
+ port: apiPort,
1461
+ child_pid: proc.pid,
1462
+ error: errMsg,
1463
+ exit_code: proc.exitCode,
1464
+ });
1465
+ this.emitStatus();
1466
+ return this.status;
1467
+ }
1468
+
1469
+ const errMsg = detectedListening
1470
+ ? "Server reported listening but health check timed out"
1471
+ : `Health check timed out after ${healthPollTimeoutMs}ms`;
1472
+ diagnosticLog(`[Agent] ${errMsg}`);
1473
+ this.status = {
1474
+ state: "error",
1475
+ agentName: null,
1476
+ port: apiPort,
1477
+ startedAt: null,
1478
+ error: errMsg,
1479
+ };
1480
+ recordStartupPhase("fatal", {
1481
+ port: apiPort,
1482
+ child_pid: proc.pid,
1483
+ error: errMsg,
1484
+ });
1485
+ this.setStartupPhase("startup_failed", errMsg);
1486
+ recordStartupPhase("fatal", {
1487
+ port: apiPort,
1488
+ child_pid: proc.pid,
1489
+ error: errMsg,
1490
+ });
1491
+ this.emitStatus();
1492
+ return this.status;
1493
+ }
1494
+ recordStartupPhase("health_ready", {
1495
+ port: apiPort,
1496
+ child_pid: proc.pid,
1497
+ });
1498
+
1499
+ this.setStartupPhase("fetching_agent_metadata");
1500
+ const startedAt = Date.now();
1501
+ const startupMs = startedAt - spawnTime;
1502
+
1503
+ this.status = {
1504
+ state: "running",
1505
+ agentName: getBrandConfig().appName,
1506
+ port: apiPort,
1507
+ startedAt,
1508
+ error: null,
1509
+ };
1510
+ this.setStartupPhase("ready", null);
1511
+ this.emitStatus();
1512
+ diagnosticLog(
1513
+ `[Agent] Runtime ready -- port: ${apiPort}, pid: ${proc.pid}, startup_ms: ${startupMs}`,
1514
+ );
1515
+ recordStartupPhase("runtime_ready", {
1516
+ port: apiPort,
1517
+ child_pid: proc.pid,
1518
+ });
1519
+ void this.refreshAgentMetadata(proc, apiPort, startupMs);
1520
+ return this.status;
1521
+ } catch (err) {
1522
+ const errMsg =
1523
+ err instanceof Error ? err.stack || err.message : String(err);
1524
+ diagnosticLog(`[Agent] Failed to start: ${errMsg}`);
1525
+ recordStartupPhase("fatal", {
1526
+ port: this.status.port,
1527
+ error: errMsg,
1528
+ });
1529
+
1530
+ // Clean up child if it was spawned
1531
+ if (this.childProcess) {
1532
+ await this.killChildProcess();
1533
+ }
1534
+
1535
+ this.status = {
1536
+ state: "error",
1537
+ agentName: null,
1538
+ port: this.status.port, // preserve port if set
1539
+ startedAt: null,
1540
+ error: shortError(err),
1541
+ };
1542
+ this.setStartupPhase("startup_failed", shortError(err));
1543
+ this.emitStatus();
1544
+ return this.status;
1545
+ }
1546
+ }
1547
+
1548
+ /** Stop the agent runtime. */
1549
+ async stop(): Promise<void> {
1550
+ if (this.status.state !== "running" && this.status.state !== "starting") {
1551
+ return;
1552
+ }
1553
+
1554
+ diagnosticLog("[Agent] Stopping...");
1555
+ this.setStartupPhase("stopping");
1556
+
1557
+ // Abort stdio watchers
1558
+ if (this.stdioAbortController) {
1559
+ this.stdioAbortController.abort();
1560
+ this.stdioAbortController = null;
1561
+ }
1562
+
1563
+ await this.killChildProcess();
1564
+
1565
+ this.status = {
1566
+ state: "stopped",
1567
+ agentName: this.status.agentName,
1568
+ port: null,
1569
+ startedAt: null,
1570
+ error: null,
1571
+ };
1572
+ this.setStartupPhase("stopped", null);
1573
+ this.emitStatus();
1574
+ diagnosticLog("[Agent] Runtime stopped");
1575
+ }
1576
+
1577
+ /**
1578
+ * Restart the agent runtime -- stops the current instance and starts a
1579
+ * fresh one, picking up config/plugin changes.
1580
+ */
1581
+ async restart(): Promise<AgentStatus> {
1582
+ diagnosticLog("[Agent] Restart requested -- stopping current runtime...");
1583
+ this.setStartupPhase("restart_requested");
1584
+ await this.stop();
1585
+ diagnosticLog("[Agent] Restarting...");
1586
+ return this.start();
1587
+ }
1588
+
1589
+ /**
1590
+ * Used after `POST /api/agent/reset`: stop the child, delete local PGLite
1591
+ * (conversations / agent memory under `~/.${getBrandConfig().namespace}/workspace/.eliza/.elizadb`),
1592
+ * then start fresh. Does not remove downloaded **GGUF** models (`MODELS_DIR`,
1593
+ * default ~/.eliza/models), env-backed wallet keys, or eliza.json (the API
1594
+ * reset already rewrote config on disk).
1595
+ *
1596
+ * When `ELIZA_DESKTOP_API_BASE` points at an external dev API (e.g. :31337),
1597
+ * the embedded child is never used — this is a no-op so the renderer can
1598
+ * bounce the real API via `POST /api/agent/restart` instead.
1599
+ */
1600
+ async restartClearingLocalDb(): Promise<AgentStatus> {
1601
+ const runtimeMode = resolveDesktopRuntimeMode(
1602
+ process.env as Record<string, string | undefined>,
1603
+ );
1604
+ if (runtimeMode.mode !== "local") {
1605
+ diagnosticLog(
1606
+ `[Agent] restartClearingLocalDb skipped — mode=${runtimeMode.mode} externalBase=${runtimeMode.externalApi.base ?? "n/a"} source=${runtimeMode.externalApi.source ?? "n/a"} (renderer uses POST /api/agent/restart)`,
1607
+ );
1608
+ return this.getStatus();
1609
+ }
1610
+
1611
+ diagnosticLog(
1612
+ `[Agent] restartClearingLocalDb: local mode — stop → rm PGLite (${resolvePgliteDataDir()}) → start`,
1613
+ );
1614
+ await this.stop();
1615
+ this.hasPgliteError = false;
1616
+ this.pgliteRecoveryDone = false;
1617
+ deletePgliteDataDir();
1618
+ const next = await this.start();
1619
+ diagnosticLog(
1620
+ `[Agent] restartClearingLocalDb: start() finished state=${next.state} port=${next.port ?? "null"}`,
1621
+ );
1622
+ return next;
1623
+ }
1624
+
1625
+ getStatus(): AgentStatus {
1626
+ return { ...this.status };
1627
+ }
1628
+
1629
+ inspectExistingInstall(): ExistingElizaInstallInfo {
1630
+ return inspectExistingElizaInstall();
1631
+ }
1632
+
1633
+ getPort(): number | null {
1634
+ return this.status.port;
1635
+ }
1636
+
1637
+ /** Clean up on app quit. */
1638
+ async dispose(): Promise<void> {
1639
+ if (this.stdioAbortController) {
1640
+ this.stdioAbortController.abort();
1641
+ this.stdioAbortController = null;
1642
+ }
1643
+ try {
1644
+ await this.killChildProcess();
1645
+ } catch (err) {
1646
+ logger.warn(
1647
+ `[Agent] dispose error: ${err instanceof Error ? err.message : String(err)}`,
1648
+ );
1649
+ }
1650
+ }
1651
+
1652
+ // -----------------------------------------------------------------------
1653
+ // Private helpers
1654
+ // -----------------------------------------------------------------------
1655
+
1656
+ private emitStatus(): void {
1657
+ this.persistStartupDiagnostics();
1658
+ if (this.sendToWebview) {
1659
+ this.sendToWebview("agentStatusUpdate", this.status);
1660
+ }
1661
+ const statusSnapshot = { ...this.status };
1662
+ for (const listener of this.statusListeners) {
1663
+ try {
1664
+ listener(statusSnapshot);
1665
+ } catch (err) {
1666
+ logger.warn(
1667
+ `[Agent] status listener failed: ${err instanceof Error ? err.message : String(err)}`,
1668
+ );
1669
+ }
1670
+ }
1671
+ }
1672
+
1673
+ private async refreshAgentMetadata(
1674
+ proc: BunSubprocess,
1675
+ port: number,
1676
+ startupMs: number,
1677
+ ): Promise<void> {
1678
+ const agentName = await this.fetchAgentName(port);
1679
+ if (
1680
+ this.childProcess !== proc ||
1681
+ this.status.state !== "running" ||
1682
+ this.status.port !== port
1683
+ ) {
1684
+ return;
1685
+ }
1686
+
1687
+ if (this.status.agentName !== agentName) {
1688
+ this.status = {
1689
+ ...this.status,
1690
+ agentName,
1691
+ };
1692
+ this.emitStatus();
1693
+ }
1694
+
1695
+ diagnosticLog(
1696
+ `[Agent] Runtime started -- agent: ${agentName}, port: ${port}, pid: ${proc.pid}, startup_ms: ${startupMs}`,
1697
+ );
1698
+ recordStartupPhase("metadata_ready", {
1699
+ port,
1700
+ child_pid: proc.pid,
1701
+ });
1702
+ }
1703
+ private setStartupPhase(phase: string, lastError?: string | null): void {
1704
+ this.startupPhase = phase;
1705
+ this.persistStartupDiagnostics(lastError);
1706
+ }
1707
+
1708
+ private persistStartupDiagnostics(lastError?: string | null): void {
1709
+ writeStartupDiagnosticsSnapshot({
1710
+ state: this.status.state,
1711
+ phase: this.startupPhase,
1712
+ updatedAt: new Date().toISOString(),
1713
+ lastError: lastError ?? this.status.error,
1714
+ agentName: this.status.agentName,
1715
+ port: this.status.port,
1716
+ startedAt: this.status.startedAt,
1717
+ platform: process.platform,
1718
+ arch: process.arch,
1719
+ configDir: resolveConfigDir(),
1720
+ logPath: getDiagnosticLogPath(),
1721
+ statusPath: getStartupStatusPath(),
1722
+ });
1723
+ }
1724
+
1725
+ /**
1726
+ * Monitor the child process for unexpected exits and update status.
1727
+ */
1728
+ private monitorChildExit(proc: BunSubprocess): void {
1729
+ // Bun.spawn provides an `exited` promise that resolves when the process exits
1730
+ proc.exited
1731
+ .then((exitCode: number) => {
1732
+ // Only update status if this is still our active child process
1733
+ if (this.childProcess !== proc) return;
1734
+
1735
+ const wasRunning = this.status.state === "running";
1736
+ const wasStarting = this.status.state === "starting";
1737
+
1738
+ if (wasRunning || wasStarting) {
1739
+ diagnosticLog(
1740
+ `[Agent] Child process exited unexpectedly with code ${exitCode} (pid: ${proc.pid})`,
1741
+ );
1742
+ recordStartupPhase("fatal", {
1743
+ port: this.status.port,
1744
+ child_pid: proc.pid,
1745
+ error: `Process exited unexpectedly with code ${exitCode}`,
1746
+ exit_code: exitCode,
1747
+ });
1748
+ this.childProcess = null;
1749
+
1750
+ // Auto-recover from PGLite migration failures by deleting the DB
1751
+ // and spawning a fresh process (new process = fresh WASM state).
1752
+ if (this.hasPgliteError && !this.pgliteRecoveryDone) {
1753
+ this.pgliteRecoveryDone = true;
1754
+ diagnosticLog(
1755
+ "[Agent] PGLite migration error detected — deleting DB and retrying with fresh process",
1756
+ );
1757
+ deletePgliteDataDir();
1758
+ this.status = {
1759
+ state: "not_started",
1760
+ agentName: null,
1761
+ port: null,
1762
+ startedAt: null,
1763
+ error: null,
1764
+ };
1765
+ this.setStartupPhase("recovering_pglite");
1766
+ // Delay slightly so OS releases file handles before respawn
1767
+ setTimeout(() => void this.start(), 500);
1768
+ return;
1769
+ }
1770
+
1771
+ this.status = {
1772
+ state: "error",
1773
+ agentName: this.status.agentName,
1774
+ port: this.status.port,
1775
+ startedAt: null,
1776
+ error: `Process exited unexpectedly with code ${exitCode}`,
1777
+ };
1778
+ this.setStartupPhase(
1779
+ "process_exited_unexpectedly",
1780
+ `Process exited unexpectedly with code ${exitCode}`,
1781
+ );
1782
+ this.emitStatus();
1783
+ } else {
1784
+ // Expected exit (we called stop)
1785
+ this.childProcess = null;
1786
+ }
1787
+ })
1788
+ .catch((err: unknown) => {
1789
+ if (this.childProcess !== proc) return;
1790
+ diagnosticLog(
1791
+ `[Agent] Child process exited with error: ${err instanceof Error ? err.message : String(err)}`,
1792
+ );
1793
+ recordStartupPhase("fatal", {
1794
+ port: this.status.port,
1795
+ child_pid: proc.pid,
1796
+ error: err instanceof Error ? err.message : String(err),
1797
+ });
1798
+ this.childProcess = null;
1799
+ if (
1800
+ this.status.state === "running" ||
1801
+ this.status.state === "starting"
1802
+ ) {
1803
+ this.status = {
1804
+ state: "error",
1805
+ agentName: this.status.agentName,
1806
+ port: this.status.port,
1807
+ startedAt: null,
1808
+ error: shortError(err),
1809
+ };
1810
+ this.setStartupPhase("process_exit_error", shortError(err));
1811
+ this.emitStatus();
1812
+ }
1813
+ });
1814
+ }
1815
+
1816
+ /**
1817
+ * Kill the child process gracefully with SIGTERM, escalating to SIGKILL
1818
+ * after a timeout.
1819
+ */
1820
+ private async killChildProcess(): Promise<void> {
1821
+ const proc = this.childProcess;
1822
+ if (!proc) return;
1823
+
1824
+ this.childProcess = null;
1825
+
1826
+ // Already exited
1827
+ if (proc.exitCode !== null) return;
1828
+
1829
+ diagnosticLog(`[Agent] Sending SIGTERM to pid ${proc.pid}`);
1830
+ proc.kill("SIGTERM");
1831
+
1832
+ // Wait for graceful shutdown or timeout
1833
+ const exited = await Promise.race([
1834
+ proc.exited.then(() => true as const),
1835
+ Bun.sleep(SIGTERM_GRACE_MS).then(() => false as const),
1836
+ ]);
1837
+
1838
+ if (!exited) {
1839
+ diagnosticLog(
1840
+ `[Agent] Process did not exit within ${SIGTERM_GRACE_MS}ms, sending SIGKILL`,
1841
+ );
1842
+ try {
1843
+ proc.kill("SIGKILL");
1844
+ } catch {
1845
+ // Process may have already exited between check and kill
1846
+ }
1847
+ // Wait briefly for SIGKILL to take effect
1848
+ await Promise.race([proc.exited.catch(() => {}), Bun.sleep(1_000)]);
1849
+ }
1850
+
1851
+ diagnosticLog("[Agent] Child process terminated");
1852
+ }
1853
+
1854
+ /**
1855
+ * Attempt to fetch the agent name from the running API server.
1856
+ * Falls back to the configured desktop app name if the endpoint is unavailable.
1857
+ */
1858
+ private async fetchAgentName(port: number): Promise<string> {
1859
+ try {
1860
+ const headers = getDesktopApiHeaders();
1861
+ const response = await fetch(`http://127.0.0.1:${port}/api/agents`, {
1862
+ headers,
1863
+ signal: AbortSignal.timeout(AGENT_NAME_FETCH_TIMEOUT_MS),
1864
+ });
1865
+ if (response.ok) {
1866
+ const data = (await response.json()) as
1867
+ | { agents?: Array<{ name?: string }> }
1868
+ | Array<{ name?: string }>;
1869
+ const agents = Array.isArray(data) ? data : data.agents;
1870
+ if (agents && agents.length > 0 && agents[0].name) {
1871
+ return agents[0].name;
1872
+ }
1873
+ }
1874
+ } catch {
1875
+ diagnosticLog("[Agent] Could not fetch agent name, using default");
1876
+ }
1877
+ return getBrandConfig().appName;
1878
+ }
1879
+ }
1880
+
1881
+ // ---------------------------------------------------------------------------
1882
+ // Singleton
1883
+ // ---------------------------------------------------------------------------
1884
+
1885
+ let agentManager: AgentManager | null = null;
1886
+
1887
+ export function getAgentManager(): AgentManager {
1888
+ if (!agentManager) {
1889
+ agentManager = new AgentManager();
1890
+ }
1891
+ return agentManager;
1892
+ }