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

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 (1882) 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 +1030 -0
  431. package/platforms/electrobun/package.json +42 -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 +51 -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 +1963 -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 +2317 -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 +178 -0
  501. package/platforms/electrobun/src/native/music-player.ts +61 -0
  502. package/platforms/electrobun/src/native/permissions-shared.ts +171 -0
  503. package/platforms/electrobun/src/native/permissions.ts +242 -0
  504. package/platforms/electrobun/src/native/power-state.ts +195 -0
  505. package/platforms/electrobun/src/native/screencapture.ts +654 -0
  506. package/platforms/electrobun/src/native/steward.ts +343 -0
  507. package/platforms/electrobun/src/native/swabble.ts +349 -0
  508. package/platforms/electrobun/src/native/talkmode.ts +441 -0
  509. package/platforms/electrobun/src/native/webgpu-browser-support.ts +220 -0
  510. package/platforms/electrobun/src/native/whisper.ts +280 -0
  511. package/platforms/electrobun/src/preload-validation.ts +65 -0
  512. package/platforms/electrobun/src/preload.js +1 -0
  513. package/platforms/electrobun/src/print-electrobun-dev-settings-banner.ts +140 -0
  514. package/platforms/electrobun/src/renderer-static.ts +77 -0
  515. package/platforms/electrobun/src/rpc-handlers.ts +1079 -0
  516. package/platforms/electrobun/src/rpc-schema.ts +1870 -0
  517. package/platforms/electrobun/src/runtime-layout.ts +150 -0
  518. package/platforms/electrobun/src/runtime-permissions.ts +131 -0
  519. package/platforms/electrobun/src/screenshot-dev-server.ts +125 -0
  520. package/platforms/electrobun/src/startup-trace.ts +351 -0
  521. package/platforms/electrobun/src/surface-windows.ts +475 -0
  522. package/platforms/electrobun/src/types/web-speech.d.ts +52 -0
  523. package/platforms/electrobun/src/types.ts +18 -0
  524. package/platforms/electrobun/src/windows-cef-profile.ts +124 -0
  525. package/platforms/electrobun/tsconfig.json +75 -0
  526. package/platforms/electrobun/vitest.electrobun.config.ts +54 -0
  527. package/platforms/ios/App/App/App.entitlements +18 -0
  528. package/platforms/ios/App/App/AppDelegate.swift +93 -0
  529. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ios-marketing-1024.png +0 -0
  530. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20x20@1x.png +0 -0
  531. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-20x20@2x.png +0 -0
  532. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29x29@1x.png +0 -0
  533. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-29x29@2x.png +0 -0
  534. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40x40@1x.png +0 -0
  535. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-40x40@2x.png +0 -0
  536. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76x76@1x.png +0 -0
  537. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-76x76@2x.png +0 -0
  538. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-ipad-83_5x83_5@2x.png +0 -0
  539. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-20x20@2x.png +0 -0
  540. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-20x20@3x.png +0 -0
  541. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-29x29@2x.png +0 -0
  542. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-29x29@3x.png +0 -0
  543. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-40x40@2x.png +0 -0
  544. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-40x40@3x.png +0 -0
  545. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-60x60@2x.png +0 -0
  546. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-iphone-60x60@3x.png +0 -0
  547. package/platforms/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +116 -0
  548. package/platforms/ios/App/App/Assets.xcassets/Contents.json +6 -0
  549. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  550. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  551. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  552. package/platforms/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  553. package/platforms/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  554. package/platforms/ios/App/App/Base.lproj/Main.storyboard +19 -0
  555. package/platforms/ios/App/App/ElizaIntentPlugin.swift +185 -0
  556. package/platforms/ios/App/App/Info.plist +123 -0
  557. package/platforms/ios/App/App/PrivacyInfo.xcprivacy +55 -0
  558. package/platforms/ios/App/App/SceneDelegate.swift +77 -0
  559. package/platforms/ios/App/App/WebsiteBlockerContentExtension/ActionRequestHandler.swift +142 -0
  560. package/platforms/ios/App/App/WebsiteBlockerContentExtension/Info.plist +29 -0
  561. package/platforms/ios/App/App/WebsiteBlockerContentExtension/PrivacyInfo.xcprivacy +23 -0
  562. package/platforms/ios/App/App/WebsiteBlockerContentExtension/WebsiteBlockerContentExtension.entitlements +10 -0
  563. package/platforms/ios/App/App.xcodeproj/project.pbxproj +596 -0
  564. package/platforms/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
  565. package/platforms/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  566. package/platforms/ios/App/ExportOptions.plist +18 -0
  567. package/platforms/ios/App/Podfile +51 -0
  568. package/platforms/ios/App/Podfile.lock +131 -0
  569. package/platforms/ios/Gemfile +6 -0
  570. package/platforms/ios/fastlane/Appfile +4 -0
  571. package/platforms/ios/fastlane/Fastfile +94 -0
  572. package/platforms/ios/fastlane/Matchfile +12 -0
  573. package/platforms/ios/fastlane/metadata/en-US/description.txt +22 -0
  574. package/platforms/ios/fastlane/metadata/en-US/keywords.txt +1 -0
  575. package/platforms/ios/fastlane/metadata/en-US/marketing_url.txt +1 -0
  576. package/platforms/ios/fastlane/metadata/en-US/name.txt +1 -0
  577. package/platforms/ios/fastlane/metadata/en-US/privacy_url.txt +1 -0
  578. package/platforms/ios/fastlane/metadata/en-US/promotional_text.txt +1 -0
  579. package/platforms/ios/fastlane/metadata/en-US/subtitle.txt +1 -0
  580. package/platforms/ios/fastlane/metadata/en-US/support_url.txt +1 -0
  581. package/register-runtime-hooks.d.ts +2 -0
  582. package/register-runtime-hooks.d.ts.map +1 -0
  583. package/register-runtime-hooks.js +13 -0
  584. package/registry/generate-apps.d.ts +2 -0
  585. package/registry/generate-apps.d.ts.map +1 -0
  586. package/registry/generate-apps.js +338 -0
  587. package/registry/generate.d.ts +2 -0
  588. package/registry/generate.d.ts.map +1 -0
  589. package/registry/generate.js +506 -0
  590. package/registry/index.d.ts +6 -0
  591. package/registry/index.d.ts.map +1 -0
  592. package/registry/index.js +68 -0
  593. package/registry/loader.d.ts +27 -0
  594. package/registry/loader.d.ts.map +1 -0
  595. package/registry/loader.js +111 -0
  596. package/registry/schema.d.ts +989 -0
  597. package/registry/schema.d.ts.map +1 -0
  598. package/registry/schema.js +264 -0
  599. package/runtime/api-dev-settings-banner.d.ts +7 -0
  600. package/runtime/api-dev-settings-banner.d.ts.map +1 -0
  601. package/runtime/api-dev-settings-banner.js +104 -0
  602. package/runtime/app-route-plugin-registry.d.ts +3 -0
  603. package/runtime/app-route-plugin-registry.d.ts.map +1 -0
  604. package/runtime/app-route-plugin-registry.js +1 -0
  605. package/runtime/build-character-from-config.d.ts +3 -0
  606. package/runtime/build-character-from-config.d.ts.map +1 -0
  607. package/runtime/build-character-from-config.js +59 -0
  608. package/runtime/build-variant.d.ts +8 -0
  609. package/runtime/build-variant.d.ts.map +1 -0
  610. package/runtime/build-variant.js +7 -0
  611. package/runtime/channel-plugin-map.d.ts +6 -0
  612. package/runtime/channel-plugin-map.d.ts.map +1 -0
  613. package/runtime/channel-plugin-map.js +38 -0
  614. package/runtime/dev-server.d.ts +2 -0
  615. package/runtime/dev-server.d.ts.map +1 -0
  616. package/runtime/dev-server.js +383 -0
  617. package/runtime/dev-settings-figlet-heading.d.ts +22 -0
  618. package/runtime/dev-settings-figlet-heading.d.ts.map +1 -0
  619. package/runtime/dev-settings-figlet-heading.js +55 -0
  620. package/runtime/eliza.d.ts +21 -0
  621. package/runtime/eliza.d.ts.map +1 -0
  622. package/runtime/eliza.js +863 -0
  623. package/runtime/embedding-manager-support.d.ts +77 -0
  624. package/runtime/embedding-manager-support.d.ts.map +1 -0
  625. package/runtime/embedding-manager-support.js +309 -0
  626. package/runtime/embedding-presets.d.ts +5 -0
  627. package/runtime/embedding-presets.d.ts.map +1 -0
  628. package/runtime/embedding-presets.js +47 -0
  629. package/runtime/embedding-warmup-policy.d.ts +13 -0
  630. package/runtime/embedding-warmup-policy.d.ts.map +1 -0
  631. package/runtime/embedding-warmup-policy.js +33 -0
  632. package/runtime/ensure-local-inference-handler.d.ts +25 -0
  633. package/runtime/ensure-local-inference-handler.d.ts.map +1 -0
  634. package/runtime/ensure-local-inference-handler.js +389 -0
  635. package/runtime/ensure-text-to-speech-handler.d.ts +18 -0
  636. package/runtime/ensure-text-to-speech-handler.d.ts.map +1 -0
  637. package/runtime/ensure-text-to-speech-handler.js +50 -0
  638. package/runtime/error-handlers.d.ts +12 -0
  639. package/runtime/error-handlers.d.ts.map +1 -0
  640. package/runtime/error-handlers.js +49 -0
  641. package/runtime/mobile-local-inference-gate.d.ts +21 -0
  642. package/runtime/mobile-local-inference-gate.d.ts.map +1 -0
  643. package/runtime/mobile-local-inference-gate.js +24 -0
  644. package/runtime/mobile-safe-runtime.d.ts +123 -0
  645. package/runtime/mobile-safe-runtime.d.ts.map +1 -0
  646. package/runtime/mobile-safe-runtime.js +290 -0
  647. package/runtime/mode/remote-forwarder.d.ts +35 -0
  648. package/runtime/mode/remote-forwarder.d.ts.map +1 -0
  649. package/runtime/mode/remote-forwarder.js +119 -0
  650. package/runtime/mode/route-mode-guard.d.ts +21 -0
  651. package/runtime/mode/route-mode-guard.d.ts.map +1 -0
  652. package/runtime/mode/route-mode-guard.js +30 -0
  653. package/runtime/mode/route-mode-matrix.d.ts +64 -0
  654. package/runtime/mode/route-mode-matrix.d.ts.map +1 -0
  655. package/runtime/mode/route-mode-matrix.js +125 -0
  656. package/runtime/mode/runtime-mode.d.ts +72 -0
  657. package/runtime/mode/runtime-mode.d.ts.map +1 -0
  658. package/runtime/mode/runtime-mode.js +167 -0
  659. package/runtime/runtime-bootstrap-policy.d.ts +17 -0
  660. package/runtime/runtime-bootstrap-policy.d.ts.map +1 -0
  661. package/runtime/runtime-bootstrap-policy.js +37 -0
  662. package/runtime/sandbox-policy.d.ts +8 -0
  663. package/runtime/sandbox-policy.d.ts.map +1 -0
  664. package/runtime/sandbox-policy.js +7 -0
  665. package/runtime/startup-overlay.d.ts +14 -0
  666. package/runtime/startup-overlay.d.ts.map +1 -0
  667. package/runtime/startup-overlay.js +55 -0
  668. package/runtime/telegram-standalone-handler.d.ts +34 -0
  669. package/runtime/telegram-standalone-handler.d.ts.map +1 -0
  670. package/runtime/telegram-standalone-handler.js +195 -0
  671. package/runtime/telegram-standalone-policy.d.ts +2 -0
  672. package/runtime/telegram-standalone-policy.d.ts.map +1 -0
  673. package/runtime/telegram-standalone-policy.js +14 -0
  674. package/scripts/README.md +27 -0
  675. package/scripts/align-electrobun-version.mjs +37 -0
  676. package/scripts/aosp/README.md +66 -0
  677. package/scripts/aosp/avd-test.mjs +403 -0
  678. package/scripts/aosp/boot-validate.mjs +536 -0
  679. package/scripts/aosp/build-aosp.mjs +448 -0
  680. package/scripts/aosp/build-bootanimation.mjs +178 -0
  681. package/scripts/aosp/capture-screens.mjs +325 -0
  682. package/scripts/aosp/compile-libllama.mjs +1333 -0
  683. package/scripts/aosp/compile-shim.mjs +328 -0
  684. package/scripts/aosp/e2e-validate.mjs +225 -0
  685. package/scripts/aosp/lib/load-variant-config.mjs +182 -0
  686. package/scripts/aosp/lint-init-rc.mjs +258 -0
  687. package/scripts/aosp/llama-cpp-patches/README.md +49 -0
  688. package/scripts/aosp/llama-cpp-patches/apply-patches.mjs +198 -0
  689. package/scripts/aosp/llama-cpp-patches/polarquant/0001-Q4_POLAR-register-GGML_TYPE_Q4_POLAR-45-and-block_q4.patch +108 -0
  690. package/scripts/aosp/llama-cpp-patches/polarquant/0002-Q4_POLAR-vendor-PolarQuant-ref-kernels-into-ggml-bas.patch +460 -0
  691. package/scripts/aosp/llama-cpp-patches/polarquant/0003-tests-cover-Q4_POLAR-fix-latent-buffer-overflow.patch +102 -0
  692. package/scripts/aosp/llama-cpp-patches/polarquant/0004-Q4_POLAR-gate-QJL-residual-on-runtime-flag-default-o.patch +97 -0
  693. package/scripts/aosp/llama-cpp-patches/qjl/0001-ggml-add-GGML_TYPE_QJL1_256-GGML_OP_ATTN_SCORE_QJL-e.patch +120 -0
  694. package/scripts/aosp/llama-cpp-patches/qjl/0002-ggml-register-QJL1_256-type-traits-ATTN_SCORE_QJL-op.patch +1392 -0
  695. package/scripts/aosp/llama-cpp-patches/qjl/0003-ggml-set-QJL1_256-blck_size-to-head_dim-128-not-sket.patch +56 -0
  696. package/scripts/aosp/llama-cpp-patches/qjl/0004-tests-add-test-qjl-cache-verifying-type-traits-score.patch +335 -0
  697. package/scripts/aosp/llama-cpp-patches/qjl/0005-ggml-flip-block_qjl1_256-to-signs-then-norm.patch +69 -0
  698. package/scripts/aosp/llama-shim/eliza_llama_shim.c +276 -0
  699. package/scripts/aosp/seccomp-shim/loader-wrap.c +141 -0
  700. package/scripts/aosp/seccomp-shim/sigsys-handler.c +338 -0
  701. package/scripts/aosp/sim.mjs +277 -0
  702. package/scripts/aosp/smoke-cuttlefish.mjs +673 -0
  703. package/scripts/aosp/stage-default-models.mjs +340 -0
  704. package/scripts/aosp/stage-models-dfm.mjs +384 -0
  705. package/scripts/aosp/sync-to-aosp.mjs +134 -0
  706. package/scripts/aosp/validate.mjs +1273 -0
  707. package/scripts/aosp/variant-config-schema.ts +10 -0
  708. package/scripts/audit-live-test-surface.mjs +590 -0
  709. package/scripts/audit-server-test-surface.mjs +163 -0
  710. package/scripts/benchmark-preflight.mjs +170 -0
  711. package/scripts/bin/.gitkeep +0 -0
  712. package/scripts/build-bundled-agent-skills-artifact.mjs +58 -0
  713. package/scripts/build-bundled-orchestrator-artifact.mjs +66 -0
  714. package/scripts/build-capacitor-app.mjs +122 -0
  715. package/scripts/build-electrobun-preload.mjs +117 -0
  716. package/scripts/build-flatpak.mjs +125 -0
  717. package/scripts/build-image.sh +461 -0
  718. package/scripts/build-llama-cpp-dflash.mjs +1866 -0
  719. package/scripts/build-native-plugins.mjs +153 -0
  720. package/scripts/build-patched-electrobun-cli.mjs +424 -0
  721. package/scripts/build-win.mjs +82 -0
  722. package/scripts/bump-elizaos.sh +438 -0
  723. package/scripts/check-i18n.mjs +328 -0
  724. package/scripts/check-secret-hygiene.mjs +344 -0
  725. package/scripts/check-upstream-drift.mjs +102 -0
  726. package/scripts/clean-repo.mjs +187 -0
  727. package/scripts/codesign-mas.mjs +297 -0
  728. package/scripts/container-entrypoint.mjs +101 -0
  729. package/scripts/coordinator-cross-platform-review.mjs +192 -0
  730. package/scripts/copy-package-assets.mjs +31 -0
  731. package/scripts/copy-runtime-node-modules.ts +1782 -0
  732. package/scripts/coverage-policy.d.mts +16 -0
  733. package/scripts/coverage-policy.mjs +38 -0
  734. package/scripts/css-coverage.mjs +241 -0
  735. package/scripts/deploy-image.sh +318 -0
  736. package/scripts/desktop-build.mjs +867 -0
  737. package/scripts/desktop-stack-status.mjs +80 -0
  738. package/scripts/dev-platform.mjs +975 -0
  739. package/scripts/dev-ui.mjs +1178 -0
  740. package/scripts/dev-win.mjs +25 -0
  741. package/scripts/disable-local-eliza-workspace.mjs +420 -0
  742. package/scripts/docker-ci-smoke.sh +500 -0
  743. package/scripts/docker-entrypoint.sh +11 -0
  744. package/scripts/docker-runtime-review.mjs +230 -0
  745. package/scripts/docs-list.js +206 -0
  746. package/scripts/ensure-avatars.mjs +335 -0
  747. package/scripts/ensure-bundled-workspaces.mjs +143 -0
  748. package/scripts/ensure-capacitor-platform.mjs +58 -0
  749. package/scripts/ensure-electrobun-core.mjs +318 -0
  750. package/scripts/ensure-generated-core-proto-js.mjs +125 -0
  751. package/scripts/ensure-shared-i18n-data.mjs +67 -0
  752. package/scripts/ensure-skills.mjs +177 -0
  753. package/scripts/ensure-type-package-aliases.mjs +246 -0
  754. package/scripts/ensure-vision-deps.mjs +196 -0
  755. package/scripts/entry.ts +11 -0
  756. package/scripts/find-collisions.mjs +765 -0
  757. package/scripts/find-duplicate-components.mjs +203 -0
  758. package/scripts/fix-workspace-deps.mjs +328 -0
  759. package/scripts/generate-onboarding-voicelines.mjs +194 -0
  760. package/scripts/generate-plugin-index.js +1055 -0
  761. package/scripts/generate-static-asset-manifest.mjs +15 -0
  762. package/scripts/generated/static-asset-manifest.json +4 -0
  763. package/scripts/i18n-dynamic-keys.json +128 -0
  764. package/scripts/init-submodules.mjs +425 -0
  765. package/scripts/ios-xcframework/README.md +233 -0
  766. package/scripts/ios-xcframework/build-xcframework.mjs +487 -0
  767. package/scripts/kernel-patches/metal-kernels.mjs +656 -0
  768. package/scripts/kernel-patches/vulkan-dispatch-patches/01-vulkan-shaders-gen.patch +41 -0
  769. package/scripts/kernel-patches/vulkan-dispatch-patches/02-ggml-vulkan-pipelines.patch +86 -0
  770. package/scripts/kernel-patches/vulkan-kernels.mjs +281 -0
  771. package/scripts/lib/allocate-loopback-port.mjs +58 -0
  772. package/scripts/lib/api-supervisor.mjs +115 -0
  773. package/scripts/lib/app-dir.mjs +74 -0
  774. package/scripts/lib/asset-cdn.mjs +118 -0
  775. package/scripts/lib/bun-version-guard.mjs +44 -0
  776. package/scripts/lib/capacitor-platform-templates.mjs +306 -0
  777. package/scripts/lib/capacitor-plugin-build-needed.mjs +79 -0
  778. package/scripts/lib/capacitor-plugin-names.mjs +35 -0
  779. package/scripts/lib/desktop-preflight.mjs +122 -0
  780. package/scripts/lib/desktop-stack-status.mjs +151 -0
  781. package/scripts/lib/dev-ui-onchain.mjs +22 -0
  782. package/scripts/lib/dev-ui-vision.mjs +15 -0
  783. package/scripts/lib/kill-process-tree.mjs +87 -0
  784. package/scripts/lib/kill-ui-listen-port.mjs +74 -0
  785. package/scripts/lib/node-path-env.mjs +11 -0
  786. package/scripts/lib/orchestrator-desktop-dev-banner.mjs +285 -0
  787. package/scripts/lib/patch-bun-exports.mjs +1446 -0
  788. package/scripts/lib/read-app-identity.mjs +54 -0
  789. package/scripts/lib/release-check-pack-dry-run.ts +34 -0
  790. package/scripts/lib/repo-root.mjs +77 -0
  791. package/scripts/lib/stage-android-agent.mjs +704 -0
  792. package/scripts/lib/static-asset-manifest.mjs +151 -0
  793. package/scripts/lib/sync-eliza-env-aliases.mjs +37 -0
  794. package/scripts/lib/vite-renderer-dist-stale.mjs +141 -0
  795. package/scripts/lib/workspace-discovery.mjs +108 -0
  796. package/scripts/lifeops-prompt-benchmark.ts +206 -0
  797. package/scripts/link-browser-server.mjs +157 -0
  798. package/scripts/link-docker-local-app-packages.mjs +345 -0
  799. package/scripts/link-external-plugins.mjs +195 -0
  800. package/scripts/mobile-auth-simulator-smoke.mjs +373 -0
  801. package/scripts/normalize-parallax-capture.ts +97 -0
  802. package/scripts/omnivoice-fuse/Makefile +44 -0
  803. package/scripts/omnivoice-fuse/README.md +266 -0
  804. package/scripts/omnivoice-fuse/cmake-graft.mjs +180 -0
  805. package/scripts/omnivoice-fuse/ffi-stub.c +222 -0
  806. package/scripts/omnivoice-fuse/ffi.h +158 -0
  807. package/scripts/omnivoice-fuse/libelizainference_stub.dylib +0 -0
  808. package/scripts/omnivoice-fuse/prepare.mjs +263 -0
  809. package/scripts/omnivoice-fuse/verify-symbols.mjs +138 -0
  810. package/scripts/pack-upstreams.mjs +392 -0
  811. package/scripts/patch-deps.mjs +597 -0
  812. package/scripts/patch-workspace-plugins.mjs +148 -0
  813. package/scripts/playwright-ui-live-stack.ts +667 -0
  814. package/scripts/playwright-ui-smoke-api-stub.mjs +1838 -0
  815. package/scripts/plugin-index-local-additions.json +12 -0
  816. package/scripts/plugin-metadata-overrides.json +165 -0
  817. package/scripts/pre-review-local.mjs +599 -0
  818. package/scripts/prepare-ios-cocoapods.sh +30 -0
  819. package/scripts/prepare-package-dist.mjs +358 -0
  820. package/scripts/process-vrms.mjs +203 -0
  821. package/scripts/prune-cdn-local-assets.mjs +44 -0
  822. package/scripts/publish-local-plugins-next.mjs +122 -0
  823. package/scripts/release-check.ts +1402 -0
  824. package/scripts/relink-workspace-packages-to-dist.mjs +115 -0
  825. package/scripts/replace-workspace-versions.mjs +128 -0
  826. package/scripts/report-coverage-surfaces.mjs +121 -0
  827. package/scripts/restore-workspace-refs.mjs +128 -0
  828. package/scripts/rt.mjs +29 -0
  829. package/scripts/rt.sh +4 -0
  830. package/scripts/run-biome-check.mjs +191 -0
  831. package/scripts/run-coding-agent-e2e.mjs +46 -0
  832. package/scripts/run-desktop-playwright.mjs +35 -0
  833. package/scripts/run-local-plugin-live-smoke.mjs +185 -0
  834. package/scripts/run-mobile-build.mjs +3308 -0
  835. package/scripts/run-node-runtime.mjs +75 -0
  836. package/scripts/run-node-tsx.mjs +62 -0
  837. package/scripts/run-node.mjs +294 -0
  838. package/scripts/run-playwright.mjs +66 -0
  839. package/scripts/run-production-build.mjs +138 -0
  840. package/scripts/run-release-contract-suite.mjs +57 -0
  841. package/scripts/run-repo-setup.mjs +230 -0
  842. package/scripts/run-screenshotter.mjs +140 -0
  843. package/scripts/run-ui-smoke-playwright-suite.mjs +96 -0
  844. package/scripts/run-windows-smoke-launcher.ps1 +35 -0
  845. package/scripts/run-with-env.mjs +60 -0
  846. package/scripts/runtime-package-manifest.ts +107 -0
  847. package/scripts/sandbox-setup.sh +7 -0
  848. package/scripts/sanitize-npm-package-metadata.mjs +165 -0
  849. package/scripts/set-package-version.mjs +13 -0
  850. package/scripts/setup-upstreams.mjs +838 -0
  851. package/scripts/smoke-api-status.mjs +113 -0
  852. package/scripts/smoke-lifeops.mjs +305 -0
  853. package/scripts/startup-integration-script-drift.test.ts +94 -0
  854. package/scripts/sync-desktop-renderer.mjs +308 -0
  855. package/scripts/sync-dod-gap-issues-lib.mjs +214 -0
  856. package/scripts/sync-dod-gap-issues.mjs +218 -0
  857. package/scripts/type-audit.mjs +606 -0
  858. package/scripts/validate-cdn-assets.mjs +307 -0
  859. package/scripts/validate-regression-matrix.mjs +360 -0
  860. package/scripts/workspace-plugin-patches/plugin-anthropic-elizaos-core-api-compat.patch +34 -0
  861. package/scripts/workspace-prepare.mjs +192 -0
  862. package/scripts/worktree-env.sh +41 -0
  863. package/scripts/write-build-info.ts +69 -0
  864. package/scripts/write-homepage-release-data.mjs +393 -0
  865. package/security/agent-vault-id.d.ts +16 -0
  866. package/security/agent-vault-id.d.ts.map +1 -0
  867. package/security/agent-vault-id.js +32 -0
  868. package/security/cloud-secret-store.d.ts +34 -0
  869. package/security/cloud-secret-store.d.ts.map +1 -0
  870. package/security/cloud-secret-store.js +65 -0
  871. package/security/export-guard.d.ts +34 -0
  872. package/security/export-guard.d.ts.map +1 -0
  873. package/security/export-guard.js +127 -0
  874. package/security/hydrate-wallet-keys-from-platform-store.d.ts +13 -0
  875. package/security/hydrate-wallet-keys-from-platform-store.d.ts.map +1 -0
  876. package/security/hydrate-wallet-keys-from-platform-store.js +116 -0
  877. package/security/platform-secure-store-node.d.ts +13 -0
  878. package/security/platform-secure-store-node.d.ts.map +1 -0
  879. package/security/platform-secure-store-node.js +311 -0
  880. package/security/platform-secure-store.d.ts +47 -0
  881. package/security/platform-secure-store.d.ts.map +1 -0
  882. package/security/platform-secure-store.js +10 -0
  883. package/security/wallet-os-store-actions.d.ts +45 -0
  884. package/security/wallet-os-store-actions.d.ts.map +1 -0
  885. package/security/wallet-os-store-actions.js +125 -0
  886. package/services/account-pool.d.ts +134 -0
  887. package/services/account-pool.d.ts.map +1 -0
  888. package/services/account-pool.js +693 -0
  889. package/services/account-usage.d.ts +75 -0
  890. package/services/account-usage.d.ts.map +1 -0
  891. package/services/account-usage.js +179 -0
  892. package/services/auth-store.d.ts +179 -0
  893. package/services/auth-store.d.ts.map +1 -0
  894. package/services/auth-store.js +404 -0
  895. package/services/cloud-jwks-store.d.ts +62 -0
  896. package/services/cloud-jwks-store.d.ts.map +1 -0
  897. package/services/cloud-jwks-store.js +118 -0
  898. package/services/connector-target-catalog.d.ts +78 -0
  899. package/services/connector-target-catalog.d.ts.map +1 -0
  900. package/services/connector-target-catalog.js +64 -0
  901. package/services/discord-target-source.d.ts +53 -0
  902. package/services/discord-target-source.d.ts.map +1 -0
  903. package/services/discord-target-source.js +116 -0
  904. package/services/github-credentials.d.ts +95 -0
  905. package/services/github-credentials.d.ts.map +1 -0
  906. package/services/github-credentials.js +144 -0
  907. package/services/local-inference/__stress__/cache-stress-helpers.d.ts +76 -0
  908. package/services/local-inference/__stress__/cache-stress-helpers.d.ts.map +1 -0
  909. package/services/local-inference/__stress__/cache-stress-helpers.js +238 -0
  910. package/services/local-inference/active-model.d.ts +180 -0
  911. package/services/local-inference/active-model.d.ts.map +1 -0
  912. package/services/local-inference/active-model.js +362 -0
  913. package/services/local-inference/assignments.d.ts +58 -0
  914. package/services/local-inference/assignments.d.ts.map +1 -0
  915. package/services/local-inference/assignments.js +179 -0
  916. package/services/local-inference/backend.d.ts +200 -0
  917. package/services/local-inference/backend.d.ts.map +1 -0
  918. package/services/local-inference/backend.js +242 -0
  919. package/services/local-inference/bundled-models.d.ts +34 -0
  920. package/services/local-inference/bundled-models.d.ts.map +1 -0
  921. package/services/local-inference/bundled-models.js +104 -0
  922. package/services/local-inference/cache-bridge.d.ts +184 -0
  923. package/services/local-inference/cache-bridge.d.ts.map +1 -0
  924. package/services/local-inference/cache-bridge.js +333 -0
  925. package/services/local-inference/catalog.d.ts +57 -0
  926. package/services/local-inference/catalog.d.ts.map +1 -0
  927. package/services/local-inference/catalog.js +262 -0
  928. package/services/local-inference/conversation-registry.d.ts +122 -0
  929. package/services/local-inference/conversation-registry.d.ts.map +1 -0
  930. package/services/local-inference/conversation-registry.js +182 -0
  931. package/services/local-inference/device-bridge.d.ts +139 -0
  932. package/services/local-inference/device-bridge.d.ts.map +1 -0
  933. package/services/local-inference/device-bridge.js +774 -0
  934. package/services/local-inference/dflash-doctor.d.ts +27 -0
  935. package/services/local-inference/dflash-doctor.d.ts.map +1 -0
  936. package/services/local-inference/dflash-doctor.js +149 -0
  937. package/services/local-inference/dflash-server.d.ts +248 -0
  938. package/services/local-inference/dflash-server.d.ts.map +1 -0
  939. package/services/local-inference/dflash-server.js +1076 -0
  940. package/services/local-inference/downloader.d.ts +48 -0
  941. package/services/local-inference/downloader.d.ts.map +1 -0
  942. package/services/local-inference/downloader.js +688 -0
  943. package/services/local-inference/engine.d.ts +282 -0
  944. package/services/local-inference/engine.d.ts.map +1 -0
  945. package/services/local-inference/engine.js +743 -0
  946. package/services/local-inference/external-scanner.d.ts +17 -0
  947. package/services/local-inference/external-scanner.d.ts.map +1 -0
  948. package/services/local-inference/external-scanner.js +261 -0
  949. package/services/local-inference/handler-registry.d.ts +72 -0
  950. package/services/local-inference/handler-registry.d.ts.map +1 -0
  951. package/services/local-inference/handler-registry.js +159 -0
  952. package/services/local-inference/hardware.d.ts +26 -0
  953. package/services/local-inference/hardware.d.ts.map +1 -0
  954. package/services/local-inference/hardware.js +139 -0
  955. package/services/local-inference/hf-search.d.ts +19 -0
  956. package/services/local-inference/hf-search.d.ts.map +1 -0
  957. package/services/local-inference/hf-search.js +169 -0
  958. package/services/local-inference/index.d.ts +10 -0
  959. package/services/local-inference/index.d.ts.map +1 -0
  960. package/services/local-inference/index.js +7 -0
  961. package/services/local-inference/llama-server-metrics.d.ts +108 -0
  962. package/services/local-inference/llama-server-metrics.d.ts.map +1 -0
  963. package/services/local-inference/llama-server-metrics.js +175 -0
  964. package/services/local-inference/manifest/index.d.ts +4 -0
  965. package/services/local-inference/manifest/index.d.ts.map +1 -0
  966. package/services/local-inference/manifest/index.js +5 -0
  967. package/services/local-inference/manifest/schema.d.ts +419 -0
  968. package/services/local-inference/manifest/schema.d.ts.map +1 -0
  969. package/services/local-inference/manifest/schema.js +227 -0
  970. package/services/local-inference/manifest/types.d.ts +23 -0
  971. package/services/local-inference/manifest/types.d.ts.map +1 -0
  972. package/services/local-inference/manifest/types.js +5 -0
  973. package/services/local-inference/manifest/validator.d.ts +43 -0
  974. package/services/local-inference/manifest/validator.d.ts.map +1 -0
  975. package/services/local-inference/manifest/validator.js +180 -0
  976. package/services/local-inference/paths.d.ts +8 -0
  977. package/services/local-inference/paths.d.ts.map +1 -0
  978. package/services/local-inference/paths.js +7 -0
  979. package/services/local-inference/providers.d.ts +61 -0
  980. package/services/local-inference/providers.d.ts.map +1 -0
  981. package/services/local-inference/providers.js +334 -0
  982. package/services/local-inference/ram-budget.d.ts +57 -0
  983. package/services/local-inference/ram-budget.d.ts.map +1 -0
  984. package/services/local-inference/ram-budget.js +107 -0
  985. package/services/local-inference/readiness.d.ts +9 -0
  986. package/services/local-inference/readiness.d.ts.map +1 -0
  987. package/services/local-inference/readiness.js +153 -0
  988. package/services/local-inference/recommendation.d.ts +62 -0
  989. package/services/local-inference/recommendation.d.ts.map +1 -0
  990. package/services/local-inference/recommendation.js +309 -0
  991. package/services/local-inference/registry.d.ts +35 -0
  992. package/services/local-inference/registry.d.ts.map +1 -0
  993. package/services/local-inference/registry.js +117 -0
  994. package/services/local-inference/router-handler.d.ts +51 -0
  995. package/services/local-inference/router-handler.d.ts.map +1 -0
  996. package/services/local-inference/router-handler.js +165 -0
  997. package/services/local-inference/routing-policy.d.ts +55 -0
  998. package/services/local-inference/routing-policy.d.ts.map +1 -0
  999. package/services/local-inference/routing-policy.js +195 -0
  1000. package/services/local-inference/routing-preferences.d.ts +8 -0
  1001. package/services/local-inference/routing-preferences.d.ts.map +1 -0
  1002. package/services/local-inference/routing-preferences.js +7 -0
  1003. package/services/local-inference/service.d.ts +88 -0
  1004. package/services/local-inference/service.d.ts.map +1 -0
  1005. package/services/local-inference/service.js +210 -0
  1006. package/services/local-inference/session-pool.d.ts +72 -0
  1007. package/services/local-inference/session-pool.d.ts.map +1 -0
  1008. package/services/local-inference/session-pool.js +125 -0
  1009. package/services/local-inference/types.d.ts +309 -0
  1010. package/services/local-inference/types.d.ts.map +1 -0
  1011. package/services/local-inference/types.js +23 -0
  1012. package/services/local-inference/verify.d.ts +8 -0
  1013. package/services/local-inference/verify.d.ts.map +1 -0
  1014. package/services/local-inference/verify.js +7 -0
  1015. package/services/local-inference/voice/barge-in.d.ts +15 -0
  1016. package/services/local-inference/voice/barge-in.d.ts.map +1 -0
  1017. package/services/local-inference/voice/barge-in.js +20 -0
  1018. package/services/local-inference/voice/engine-bridge.d.ts +256 -0
  1019. package/services/local-inference/voice/engine-bridge.d.ts.map +1 -0
  1020. package/services/local-inference/voice/engine-bridge.js +398 -0
  1021. package/services/local-inference/voice/ffi-bindings.d.ts +114 -0
  1022. package/services/local-inference/voice/ffi-bindings.d.ts.map +1 -0
  1023. package/services/local-inference/voice/ffi-bindings.js +281 -0
  1024. package/services/local-inference/voice/index.d.ts +51 -0
  1025. package/services/local-inference/voice/index.d.ts.map +1 -0
  1026. package/services/local-inference/voice/index.js +50 -0
  1027. package/services/local-inference/voice/lifecycle.d.ts +135 -0
  1028. package/services/local-inference/voice/lifecycle.d.ts.map +1 -0
  1029. package/services/local-inference/voice/lifecycle.js +189 -0
  1030. package/services/local-inference/voice/phoneme-tokenizer.d.ts +58 -0
  1031. package/services/local-inference/voice/phoneme-tokenizer.d.ts.map +1 -0
  1032. package/services/local-inference/voice/phoneme-tokenizer.js +53 -0
  1033. package/services/local-inference/voice/phrase-cache.d.ts +24 -0
  1034. package/services/local-inference/voice/phrase-cache.d.ts.map +1 -0
  1035. package/services/local-inference/voice/phrase-cache.js +32 -0
  1036. package/services/local-inference/voice/phrase-chunker.d.ts +20 -0
  1037. package/services/local-inference/voice/phrase-chunker.d.ts.map +1 -0
  1038. package/services/local-inference/voice/phrase-chunker.js +85 -0
  1039. package/services/local-inference/voice/ring-buffer.d.ts +40 -0
  1040. package/services/local-inference/voice/ring-buffer.d.ts.map +1 -0
  1041. package/services/local-inference/voice/ring-buffer.js +85 -0
  1042. package/services/local-inference/voice/rollback-queue.d.ts +24 -0
  1043. package/services/local-inference/voice/rollback-queue.d.ts.map +1 -0
  1044. package/services/local-inference/voice/rollback-queue.js +49 -0
  1045. package/services/local-inference/voice/scheduler.d.ts +47 -0
  1046. package/services/local-inference/voice/scheduler.d.ts.map +1 -0
  1047. package/services/local-inference/voice/scheduler.js +123 -0
  1048. package/services/local-inference/voice/shared-resources.d.ts +119 -0
  1049. package/services/local-inference/voice/shared-resources.d.ts.map +1 -0
  1050. package/services/local-inference/voice/shared-resources.js +83 -0
  1051. package/services/local-inference/voice/speaker-preset-cache.d.ts +28 -0
  1052. package/services/local-inference/voice/speaker-preset-cache.d.ts.map +1 -0
  1053. package/services/local-inference/voice/speaker-preset-cache.js +44 -0
  1054. package/services/local-inference/voice/types.d.ts +80 -0
  1055. package/services/local-inference/voice/types.d.ts.map +1 -0
  1056. package/services/local-inference/voice/voice-preset-format.d.ts +56 -0
  1057. package/services/local-inference/voice/voice-preset-format.d.ts.map +1 -0
  1058. package/services/local-inference/voice/voice-preset-format.js +184 -0
  1059. package/services/persistence.d.ts +48 -0
  1060. package/services/persistence.d.ts.map +1 -0
  1061. package/services/persistence.js +128 -0
  1062. package/services/plugin-installer.d.ts +22 -0
  1063. package/services/plugin-installer.d.ts.map +1 -0
  1064. package/services/plugin-installer.js +41 -0
  1065. package/services/secrets-manager-installer.d.ts +140 -0
  1066. package/services/secrets-manager-installer.d.ts.map +1 -0
  1067. package/services/secrets-manager-installer.js +374 -0
  1068. package/services/steward-credentials.d.ts +37 -0
  1069. package/services/steward-credentials.d.ts.map +1 -0
  1070. package/services/steward-credentials.js +93 -0
  1071. package/services/steward-sidecar/health-check.d.ts +9 -0
  1072. package/services/steward-sidecar/health-check.d.ts.map +1 -0
  1073. package/services/steward-sidecar/health-check.js +34 -0
  1074. package/services/steward-sidecar/helpers.d.ts +21 -0
  1075. package/services/steward-sidecar/helpers.d.ts.map +1 -0
  1076. package/services/steward-sidecar/helpers.js +71 -0
  1077. package/services/steward-sidecar/process-management.d.ts +9 -0
  1078. package/services/steward-sidecar/process-management.d.ts.map +1 -0
  1079. package/services/steward-sidecar/process-management.js +53 -0
  1080. package/services/steward-sidecar/types.d.ts +60 -0
  1081. package/services/steward-sidecar/types.d.ts.map +1 -0
  1082. package/services/steward-sidecar/types.js +17 -0
  1083. package/services/steward-sidecar/wallet-setup.d.ts +9 -0
  1084. package/services/steward-sidecar/wallet-setup.d.ts.map +1 -0
  1085. package/services/steward-sidecar/wallet-setup.js +114 -0
  1086. package/services/steward-sidecar.d.ts +70 -0
  1087. package/services/steward-sidecar.d.ts.map +1 -0
  1088. package/services/steward-sidecar.js +385 -0
  1089. package/services/tool-call-cache/index.d.ts +13 -0
  1090. package/services/tool-call-cache/index.d.ts.map +1 -0
  1091. package/services/tool-call-cache/index.js +11 -0
  1092. package/services/trigger-event-bridge.d.ts +52 -0
  1093. package/services/trigger-event-bridge.d.ts.map +1 -0
  1094. package/services/trigger-event-bridge.js +217 -0
  1095. package/services/update-notifier.d.ts +6 -0
  1096. package/services/update-notifier.d.ts.map +1 -0
  1097. package/services/update-notifier.js +33 -0
  1098. package/services/vault-bootstrap.d.ts +31 -0
  1099. package/services/vault-bootstrap.d.ts.map +1 -0
  1100. package/services/vault-bootstrap.js +209 -0
  1101. package/services/vault-mirror.d.ts +44 -0
  1102. package/services/vault-mirror.d.ts.map +1 -0
  1103. package/services/vault-mirror.js +80 -0
  1104. package/styles/electrobun-mac-window-drag.css +66 -0
  1105. package/test/helpers/__tests__/live-agent-test.smoke.test.ts +105 -0
  1106. package/test/helpers/action-assertions.ts +364 -0
  1107. package/test/helpers/action-spy.ts +354 -0
  1108. package/test/helpers/browser-launch.ts +103 -0
  1109. package/test/helpers/browser-mocks.ts +275 -0
  1110. package/test/helpers/conditional-tests.ts +42 -0
  1111. package/test/helpers/conversation-harness.ts +334 -0
  1112. package/test/helpers/http.ts +150 -0
  1113. package/test/helpers/i18n.ts +5 -0
  1114. package/test/helpers/isolated-config.ts +34 -0
  1115. package/test/helpers/live-agent-test.ts +660 -0
  1116. package/test/helpers/live-child-env.ts +72 -0
  1117. package/test/helpers/live-provider.test.ts +124 -0
  1118. package/test/helpers/live-provider.ts +362 -0
  1119. package/test/helpers/live-runtime-server.ts +88 -0
  1120. package/test/helpers/loopback.ts +33 -0
  1121. package/test/helpers/pglite-runtime.ts +173 -0
  1122. package/test/helpers/react-test.ts +40 -0
  1123. package/test/helpers/real-connector.ts +250 -0
  1124. package/test/helpers/real-runtime.ts +543 -0
  1125. package/test/helpers/skip-without.ts +53 -0
  1126. package/test/helpers/stochastic-test.ts +186 -0
  1127. package/test/helpers/test-utils.ts +94 -0
  1128. package/test/helpers/trajectory-assertions.ts +168 -0
  1129. package/test/helpers/trajectory-harness.test.ts +101 -0
  1130. package/test/helpers/trajectory-harness.ts +988 -0
  1131. package/test/scripts/managed-test-command.mjs +632 -0
  1132. package/test/scripts/task-agent-live-smoke.ts +1335 -0
  1133. package/test/scripts/test-parallel.mjs +237 -0
  1134. package/test/scripts/test-root-unit.mjs +169 -0
  1135. package/test/scripts/test-runner.mjs +78 -0
  1136. package/test/scripts/validate-all-features.sh +541 -0
  1137. package/test-support/test-helpers.d.ts +111 -0
  1138. package/test-support/test-helpers.d.ts.map +1 -0
  1139. package/test-support/test-helpers.js +410 -0
  1140. package/ui-compat.d.ts +3 -0
  1141. package/ui-compat.d.ts.map +1 -0
  1142. package/ui-compat.js +3 -0
  1143. package/utils/eliza-root.d.ts +9 -0
  1144. package/utils/eliza-root.d.ts.map +1 -0
  1145. package/utils/eliza-root.js +101 -0
  1146. package/utils/globals.d.ts +7 -0
  1147. package/utils/globals.d.ts.map +1 -0
  1148. package/utils/globals.js +47 -0
  1149. package/App.d.ts +0 -5
  1150. package/App.d.ts.map +0 -1
  1151. package/App.js +0 -220
  1152. package/LICENSE +0 -21
  1153. package/actions/character.d.ts +0 -39
  1154. package/actions/character.d.ts.map +0 -1
  1155. package/actions/character.js +0 -247
  1156. package/actions/chat-helpers.d.ts +0 -47
  1157. package/actions/chat-helpers.d.ts.map +0 -1
  1158. package/actions/chat-helpers.js +0 -79
  1159. package/actions/cloud.d.ts +0 -17
  1160. package/actions/cloud.d.ts.map +0 -1
  1161. package/actions/cloud.js +0 -43
  1162. package/actions/index.d.ts +0 -12
  1163. package/actions/index.d.ts.map +0 -1
  1164. package/actions/index.js +0 -11
  1165. package/actions/lifecycle.d.ts +0 -43
  1166. package/actions/lifecycle.d.ts.map +0 -1
  1167. package/actions/lifecycle.js +0 -118
  1168. package/actions/onboarding.d.ts +0 -13
  1169. package/actions/onboarding.d.ts.map +0 -1
  1170. package/actions/onboarding.js +0 -26
  1171. package/actions/triggers.d.ts +0 -23
  1172. package/actions/triggers.d.ts.map +0 -1
  1173. package/actions/triggers.js +0 -148
  1174. package/api/client.d.ts +0 -2742
  1175. package/api/client.d.ts.map +0 -1
  1176. package/api/client.js +0 -2520
  1177. package/api/index.d.ts +0 -2
  1178. package/api/index.d.ts.map +0 -1
  1179. package/api/index.js +0 -1
  1180. package/autonomy/index.d.ts +0 -48
  1181. package/autonomy/index.d.ts.map +0 -1
  1182. package/autonomy/index.js +0 -330
  1183. package/bridge/capacitor-bridge.d.ts +0 -153
  1184. package/bridge/capacitor-bridge.d.ts.map +0 -1
  1185. package/bridge/capacitor-bridge.js +0 -193
  1186. package/bridge/electrobun-rpc.d.ts +0 -28
  1187. package/bridge/electrobun-rpc.d.ts.map +0 -1
  1188. package/bridge/electrobun-rpc.js +0 -35
  1189. package/bridge/electrobun-runtime.d.ts +0 -3
  1190. package/bridge/electrobun-runtime.d.ts.map +0 -1
  1191. package/bridge/electrobun-runtime.js +0 -17
  1192. package/bridge/index.d.ts +0 -6
  1193. package/bridge/index.d.ts.map +0 -1
  1194. package/bridge/index.js +0 -5
  1195. package/bridge/native-plugins.d.ts +0 -82
  1196. package/bridge/native-plugins.d.ts.map +0 -1
  1197. package/bridge/native-plugins.js +0 -39
  1198. package/bridge/plugin-bridge.d.ts +0 -116
  1199. package/bridge/plugin-bridge.d.ts.map +0 -1
  1200. package/bridge/plugin-bridge.js +0 -203
  1201. package/bridge/storage-bridge.d.ts +0 -39
  1202. package/bridge/storage-bridge.d.ts.map +0 -1
  1203. package/bridge/storage-bridge.js +0 -135
  1204. package/chat/index.d.ts +0 -57
  1205. package/chat/index.d.ts.map +0 -1
  1206. package/chat/index.js +0 -160
  1207. package/coding/index.d.ts +0 -25
  1208. package/coding/index.d.ts.map +0 -1
  1209. package/coding/index.js +0 -25
  1210. package/components/AdvancedPageView.d.ts +0 -17
  1211. package/components/AdvancedPageView.d.ts.map +0 -1
  1212. package/components/AdvancedPageView.js +0 -146
  1213. package/components/AgentActivityBox.d.ts +0 -7
  1214. package/components/AgentActivityBox.d.ts.map +0 -1
  1215. package/components/AgentActivityBox.js +0 -25
  1216. package/components/ApiKeyConfig.d.ts +0 -26
  1217. package/components/ApiKeyConfig.d.ts.map +0 -1
  1218. package/components/ApiKeyConfig.js +0 -119
  1219. package/components/AppsPageView.d.ts +0 -7
  1220. package/components/AppsPageView.d.ts.map +0 -1
  1221. package/components/AppsPageView.js +0 -31
  1222. package/components/AppsView.d.ts +0 -8
  1223. package/components/AppsView.d.ts.map +0 -1
  1224. package/components/AppsView.js +0 -149
  1225. package/components/AvatarLoader.d.ts +0 -13
  1226. package/components/AvatarLoader.d.ts.map +0 -1
  1227. package/components/AvatarLoader.js +0 -53
  1228. package/components/AvatarSelector.d.ts +0 -23
  1229. package/components/AvatarSelector.d.ts.map +0 -1
  1230. package/components/AvatarSelector.js +0 -105
  1231. package/components/BscTradePanel.d.ts +0 -22
  1232. package/components/BscTradePanel.d.ts.map +0 -1
  1233. package/components/BscTradePanel.js +0 -221
  1234. package/components/BugReportModal.d.ts +0 -2
  1235. package/components/BugReportModal.d.ts.map +0 -1
  1236. package/components/BugReportModal.js +0 -219
  1237. package/components/CharacterRoster.d.ts +0 -31
  1238. package/components/CharacterRoster.d.ts.map +0 -1
  1239. package/components/CharacterRoster.js +0 -41
  1240. package/components/CharacterView.d.ts +0 -8
  1241. package/components/CharacterView.d.ts.map +0 -1
  1242. package/components/CharacterView.js +0 -685
  1243. package/components/ChatAvatar.d.ts +0 -8
  1244. package/components/ChatAvatar.d.ts.map +0 -1
  1245. package/components/ChatAvatar.js +0 -89
  1246. package/components/ChatComposer.d.ts +0 -37
  1247. package/components/ChatComposer.d.ts.map +0 -1
  1248. package/components/ChatComposer.js +0 -136
  1249. package/components/ChatMessage.d.ts +0 -24
  1250. package/components/ChatMessage.d.ts.map +0 -1
  1251. package/components/ChatMessage.js +0 -187
  1252. package/components/ChatModalView.d.ts +0 -10
  1253. package/components/ChatModalView.d.ts.map +0 -1
  1254. package/components/ChatModalView.js +0 -57
  1255. package/components/ChatView.d.ts +0 -14
  1256. package/components/ChatView.d.ts.map +0 -1
  1257. package/components/ChatView.js +0 -526
  1258. package/components/CloudOnboarding.d.ts +0 -7
  1259. package/components/CloudOnboarding.d.ts.map +0 -1
  1260. package/components/CloudOnboarding.js +0 -22
  1261. package/components/CloudSourceControls.d.ts +0 -13
  1262. package/components/CloudSourceControls.d.ts.map +0 -1
  1263. package/components/CloudSourceControls.js +0 -16
  1264. package/components/CodingAgentSettingsSection.d.ts +0 -8
  1265. package/components/CodingAgentSettingsSection.d.ts.map +0 -1
  1266. package/components/CodingAgentSettingsSection.js +0 -292
  1267. package/components/CommandPalette.d.ts +0 -2
  1268. package/components/CommandPalette.d.ts.map +0 -1
  1269. package/components/CommandPalette.js +0 -181
  1270. package/components/CompanionSceneHost.d.ts +0 -14
  1271. package/components/CompanionSceneHost.d.ts.map +0 -1
  1272. package/components/CompanionSceneHost.js +0 -362
  1273. package/components/CompanionShell.d.ts +0 -17
  1274. package/components/CompanionShell.d.ts.map +0 -1
  1275. package/components/CompanionShell.js +0 -15
  1276. package/components/CompanionView.d.ts +0 -2
  1277. package/components/CompanionView.d.ts.map +0 -1
  1278. package/components/CompanionView.js +0 -22
  1279. package/components/ConfigPageView.d.ts +0 -11
  1280. package/components/ConfigPageView.d.ts.map +0 -1
  1281. package/components/ConfigPageView.js +0 -311
  1282. package/components/ConfigSaveFooter.d.ts +0 -8
  1283. package/components/ConfigSaveFooter.d.ts.map +0 -1
  1284. package/components/ConfigSaveFooter.js +0 -10
  1285. package/components/ConfirmModal.d.ts +0 -61
  1286. package/components/ConfirmModal.d.ts.map +0 -1
  1287. package/components/ConfirmModal.js +0 -164
  1288. package/components/ConnectionFailedBanner.d.ts +0 -6
  1289. package/components/ConnectionFailedBanner.d.ts.map +0 -1
  1290. package/components/ConnectionFailedBanner.js +0 -22
  1291. package/components/ConnectorsPageView.d.ts +0 -7
  1292. package/components/ConnectorsPageView.d.ts.map +0 -1
  1293. package/components/ConnectorsPageView.js +0 -8
  1294. package/components/ConversationsSidebar.d.ts +0 -9
  1295. package/components/ConversationsSidebar.d.ts.map +0 -1
  1296. package/components/ConversationsSidebar.js +0 -116
  1297. package/components/CustomActionEditor.d.ts +0 -10
  1298. package/components/CustomActionEditor.d.ts.map +0 -1
  1299. package/components/CustomActionEditor.js +0 -596
  1300. package/components/CustomActionsPanel.d.ts +0 -9
  1301. package/components/CustomActionsPanel.d.ts.map +0 -1
  1302. package/components/CustomActionsPanel.js +0 -107
  1303. package/components/CustomActionsView.d.ts +0 -2
  1304. package/components/CustomActionsView.d.ts.map +0 -1
  1305. package/components/CustomActionsView.js +0 -134
  1306. package/components/DatabasePageView.d.ts +0 -5
  1307. package/components/DatabasePageView.d.ts.map +0 -1
  1308. package/components/DatabasePageView.js +0 -28
  1309. package/components/DatabaseView.d.ts +0 -9
  1310. package/components/DatabaseView.d.ts.map +0 -1
  1311. package/components/DatabaseView.js +0 -311
  1312. package/components/ElizaCloudDashboard.d.ts +0 -2
  1313. package/components/ElizaCloudDashboard.d.ts.map +0 -1
  1314. package/components/ElizaCloudDashboard.js +0 -657
  1315. package/components/EmotePicker.d.ts +0 -2
  1316. package/components/EmotePicker.d.ts.map +0 -1
  1317. package/components/EmotePicker.js +0 -343
  1318. package/components/ErrorBoundary.d.ts +0 -22
  1319. package/components/ErrorBoundary.d.ts.map +0 -1
  1320. package/components/ErrorBoundary.js +0 -31
  1321. package/components/FineTuningView.d.ts +0 -2
  1322. package/components/FineTuningView.d.ts.map +0 -1
  1323. package/components/FineTuningView.js +0 -433
  1324. package/components/FlaminaGuide.d.ts +0 -10
  1325. package/components/FlaminaGuide.d.ts.map +0 -1
  1326. package/components/FlaminaGuide.js +0 -64
  1327. package/components/GameView.d.ts +0 -11
  1328. package/components/GameView.d.ts.map +0 -1
  1329. package/components/GameView.js +0 -294
  1330. package/components/GameViewOverlay.d.ts +0 -8
  1331. package/components/GameViewOverlay.d.ts.map +0 -1
  1332. package/components/GameViewOverlay.js +0 -70
  1333. package/components/GlobalEmoteOverlay.d.ts +0 -2
  1334. package/components/GlobalEmoteOverlay.d.ts.map +0 -1
  1335. package/components/GlobalEmoteOverlay.js +0 -112
  1336. package/components/Header.d.ts +0 -9
  1337. package/components/Header.d.ts.map +0 -1
  1338. package/components/Header.js +0 -123
  1339. package/components/HeartbeatsView.d.ts +0 -2
  1340. package/components/HeartbeatsView.d.ts.map +0 -1
  1341. package/components/HeartbeatsView.js +0 -378
  1342. package/components/InventoryView.d.ts +0 -10
  1343. package/components/InventoryView.d.ts.map +0 -1
  1344. package/components/InventoryView.js +0 -176
  1345. package/components/KnowledgeView.d.ts +0 -20
  1346. package/components/KnowledgeView.d.ts.map +0 -1
  1347. package/components/KnowledgeView.js +0 -483
  1348. package/components/LanguageDropdown.d.ts +0 -30
  1349. package/components/LanguageDropdown.d.ts.map +0 -1
  1350. package/components/LanguageDropdown.js +0 -99
  1351. package/components/LifoMonitorPanel.d.ts +0 -21
  1352. package/components/LifoMonitorPanel.d.ts.map +0 -1
  1353. package/components/LifoMonitorPanel.js +0 -24
  1354. package/components/LifoSandboxView.d.ts +0 -5
  1355. package/components/LifoSandboxView.d.ts.map +0 -1
  1356. package/components/LifoSandboxView.js +0 -333
  1357. package/components/LoadingScreen.d.ts +0 -13
  1358. package/components/LoadingScreen.d.ts.map +0 -1
  1359. package/components/LoadingScreen.js +0 -70
  1360. package/components/LogsPageView.d.ts +0 -2
  1361. package/components/LogsPageView.d.ts.map +0 -1
  1362. package/components/LogsPageView.js +0 -7
  1363. package/components/LogsView.d.ts +0 -5
  1364. package/components/LogsView.d.ts.map +0 -1
  1365. package/components/LogsView.js +0 -71
  1366. package/components/MediaGalleryView.d.ts +0 -9
  1367. package/components/MediaGalleryView.d.ts.map +0 -1
  1368. package/components/MediaGalleryView.js +0 -236
  1369. package/components/MediaSettingsSection.d.ts +0 -11
  1370. package/components/MediaSettingsSection.d.ts.map +0 -1
  1371. package/components/MediaSettingsSection.js +0 -329
  1372. package/components/MessageContent.d.ts +0 -51
  1373. package/components/MessageContent.d.ts.map +0 -1
  1374. package/components/MessageContent.js +0 -553
  1375. package/components/OnboardingWizard.d.ts +0 -2
  1376. package/components/OnboardingWizard.d.ts.map +0 -1
  1377. package/components/OnboardingWizard.js +0 -86
  1378. package/components/PairingView.d.ts +0 -5
  1379. package/components/PairingView.d.ts.map +0 -1
  1380. package/components/PairingView.js +0 -29
  1381. package/components/PermissionsSection.d.ts +0 -20
  1382. package/components/PermissionsSection.d.ts.map +0 -1
  1383. package/components/PermissionsSection.js +0 -573
  1384. package/components/PluginsPageView.d.ts +0 -5
  1385. package/components/PluginsPageView.d.ts.map +0 -1
  1386. package/components/PluginsPageView.js +0 -8
  1387. package/components/PluginsView.d.ts +0 -21
  1388. package/components/PluginsView.d.ts.map +0 -1
  1389. package/components/PluginsView.js +0 -1534
  1390. package/components/ProviderSwitcher.d.ts +0 -42
  1391. package/components/ProviderSwitcher.d.ts.map +0 -1
  1392. package/components/ProviderSwitcher.js +0 -493
  1393. package/components/RestartBanner.d.ts +0 -2
  1394. package/components/RestartBanner.d.ts.map +0 -1
  1395. package/components/RestartBanner.js +0 -36
  1396. package/components/RuntimeView.d.ts +0 -10
  1397. package/components/RuntimeView.d.ts.map +0 -1
  1398. package/components/RuntimeView.js +0 -165
  1399. package/components/SaveCommandModal.d.ts +0 -12
  1400. package/components/SaveCommandModal.d.ts.map +0 -1
  1401. package/components/SaveCommandModal.js +0 -84
  1402. package/components/SecretsView.d.ts +0 -9
  1403. package/components/SecretsView.d.ts.map +0 -1
  1404. package/components/SecretsView.js +0 -249
  1405. package/components/SettingsView.d.ts +0 -9
  1406. package/components/SettingsView.d.ts.map +0 -1
  1407. package/components/SettingsView.js +0 -230
  1408. package/components/ShellOverlays.d.ts +0 -8
  1409. package/components/ShellOverlays.d.ts.map +0 -1
  1410. package/components/ShellOverlays.js +0 -10
  1411. package/components/ShortcutsOverlay.d.ts +0 -2
  1412. package/components/ShortcutsOverlay.d.ts.map +0 -1
  1413. package/components/ShortcutsOverlay.js +0 -79
  1414. package/components/SkillsView.d.ts +0 -11
  1415. package/components/SkillsView.d.ts.map +0 -1
  1416. package/components/SkillsView.js +0 -358
  1417. package/components/StartupFailureView.d.ts +0 -8
  1418. package/components/StartupFailureView.d.ts.map +0 -1
  1419. package/components/StartupFailureView.js +0 -16
  1420. package/components/StreamView.d.ts +0 -16
  1421. package/components/StreamView.d.ts.map +0 -1
  1422. package/components/StreamView.js +0 -300
  1423. package/components/StripeEmbeddedCheckout.d.ts +0 -24
  1424. package/components/StripeEmbeddedCheckout.d.ts.map +0 -1
  1425. package/components/StripeEmbeddedCheckout.js +0 -101
  1426. package/components/SubscriptionStatus.d.ts +0 -23
  1427. package/components/SubscriptionStatus.d.ts.map +0 -1
  1428. package/components/SubscriptionStatus.js +0 -301
  1429. package/components/SystemWarningBanner.d.ts +0 -6
  1430. package/components/SystemWarningBanner.d.ts.map +0 -1
  1431. package/components/SystemWarningBanner.js +0 -46
  1432. package/components/ThemeToggle.d.ts +0 -21
  1433. package/components/ThemeToggle.d.ts.map +0 -1
  1434. package/components/ThemeToggle.js +0 -24
  1435. package/components/TrajectoriesView.d.ts +0 -12
  1436. package/components/TrajectoriesView.d.ts.map +0 -1
  1437. package/components/TrajectoriesView.js +0 -183
  1438. package/components/TrajectoryDetailView.d.ts +0 -13
  1439. package/components/TrajectoryDetailView.d.ts.map +0 -1
  1440. package/components/TrajectoryDetailView.js +0 -112
  1441. package/components/TriggersView.d.ts +0 -2
  1442. package/components/TriggersView.d.ts.map +0 -1
  1443. package/components/TriggersView.js +0 -1
  1444. package/components/VectorBrowserView.d.ts +0 -10
  1445. package/components/VectorBrowserView.d.ts.map +0 -1
  1446. package/components/VectorBrowserView.js +0 -1000
  1447. package/components/VoiceConfigView.d.ts +0 -11
  1448. package/components/VoiceConfigView.d.ts.map +0 -1
  1449. package/components/VoiceConfigView.js +0 -331
  1450. package/components/VrmStage.d.ts +0 -28
  1451. package/components/VrmStage.d.ts.map +0 -1
  1452. package/components/VrmStage.js +0 -178
  1453. package/components/WhatsAppQrOverlay.d.ts +0 -8
  1454. package/components/WhatsAppQrOverlay.d.ts.map +0 -1
  1455. package/components/WhatsAppQrOverlay.js +0 -63
  1456. package/components/apps/AppDetailPane.d.ts +0 -15
  1457. package/components/apps/AppDetailPane.d.ts.map +0 -1
  1458. package/components/apps/AppDetailPane.js +0 -13
  1459. package/components/apps/AppsCatalogGrid.d.ts +0 -20
  1460. package/components/apps/AppsCatalogGrid.d.ts.map +0 -1
  1461. package/components/apps/AppsCatalogGrid.js +0 -18
  1462. package/components/apps/extensions/registry.d.ts +0 -4
  1463. package/components/apps/extensions/registry.d.ts.map +0 -1
  1464. package/components/apps/extensions/registry.js +0 -7
  1465. package/components/apps/extensions/types.d.ts +0 -7
  1466. package/components/apps/extensions/types.d.ts.map +0 -1
  1467. package/components/apps/helpers.d.ts +0 -7
  1468. package/components/apps/helpers.d.ts.map +0 -1
  1469. package/components/apps/helpers.js +0 -44
  1470. package/components/avatar/VrmAnimationLoader.d.ts +0 -30
  1471. package/components/avatar/VrmAnimationLoader.d.ts.map +0 -1
  1472. package/components/avatar/VrmAnimationLoader.js +0 -99
  1473. package/components/avatar/VrmBlinkController.d.ts +0 -37
  1474. package/components/avatar/VrmBlinkController.d.ts.map +0 -1
  1475. package/components/avatar/VrmBlinkController.js +0 -98
  1476. package/components/avatar/VrmCameraManager.d.ts +0 -57
  1477. package/components/avatar/VrmCameraManager.d.ts.map +0 -1
  1478. package/components/avatar/VrmCameraManager.js +0 -277
  1479. package/components/avatar/VrmEngine.d.ts +0 -246
  1480. package/components/avatar/VrmEngine.d.ts.map +0 -1
  1481. package/components/avatar/VrmEngine.js +0 -2087
  1482. package/components/avatar/VrmFootShadow.d.ts +0 -18
  1483. package/components/avatar/VrmFootShadow.d.ts.map +0 -1
  1484. package/components/avatar/VrmFootShadow.js +0 -83
  1485. package/components/avatar/VrmViewer.d.ts +0 -60
  1486. package/components/avatar/VrmViewer.d.ts.map +0 -1
  1487. package/components/avatar/VrmViewer.js +0 -396
  1488. package/components/avatar/mixamoVRMRigMap.d.ts +0 -3
  1489. package/components/avatar/mixamoVRMRigMap.d.ts.map +0 -1
  1490. package/components/avatar/mixamoVRMRigMap.js +0 -56
  1491. package/components/avatar/retargetMixamoFbxToVrm.d.ts +0 -9
  1492. package/components/avatar/retargetMixamoFbxToVrm.d.ts.map +0 -1
  1493. package/components/avatar/retargetMixamoFbxToVrm.js +0 -88
  1494. package/components/avatar/retargetMixamoGltfToVrm.d.ts +0 -11
  1495. package/components/avatar/retargetMixamoGltfToVrm.d.ts.map +0 -1
  1496. package/components/avatar/retargetMixamoGltfToVrm.js +0 -80
  1497. package/components/chainConfig.d.ts +0 -89
  1498. package/components/chainConfig.d.ts.map +0 -1
  1499. package/components/chainConfig.js +0 -287
  1500. package/components/companion/CompanionHeader.d.ts +0 -15
  1501. package/components/companion/CompanionHeader.d.ts.map +0 -1
  1502. package/components/companion/CompanionHeader.js +0 -7
  1503. package/components/companion/CompanionSceneHost.d.ts +0 -2
  1504. package/components/companion/CompanionSceneHost.d.ts.map +0 -1
  1505. package/components/companion/CompanionSceneHost.js +0 -1
  1506. package/components/companion/VrmStage.d.ts +0 -3
  1507. package/components/companion/VrmStage.d.ts.map +0 -1
  1508. package/components/companion/VrmStage.js +0 -1
  1509. package/components/companion/index.d.ts +0 -18
  1510. package/components/companion/index.d.ts.map +0 -1
  1511. package/components/companion/index.js +0 -17
  1512. package/components/companion/walletUtils.d.ts +0 -95
  1513. package/components/companion/walletUtils.d.ts.map +0 -1
  1514. package/components/companion/walletUtils.js +0 -167
  1515. package/components/companion-shell-styles.d.ts +0 -38
  1516. package/components/companion-shell-styles.d.ts.map +0 -1
  1517. package/components/companion-shell-styles.js +0 -248
  1518. package/components/confirm-delete-control.d.ts +0 -16
  1519. package/components/confirm-delete-control.d.ts.map +0 -1
  1520. package/components/confirm-delete-control.js +0 -12
  1521. package/components/conversations/ConversationListItem.d.ts +0 -31
  1522. package/components/conversations/ConversationListItem.d.ts.map +0 -1
  1523. package/components/conversations/ConversationListItem.js +0 -52
  1524. package/components/conversations/conversation-utils.d.ts +0 -9
  1525. package/components/conversations/conversation-utils.d.ts.map +0 -1
  1526. package/components/conversations/conversation-utils.js +0 -138
  1527. package/components/format.d.ts +0 -54
  1528. package/components/format.d.ts.map +0 -1
  1529. package/components/format.js +0 -82
  1530. package/components/index.d.ts +0 -96
  1531. package/components/index.d.ts.map +0 -1
  1532. package/components/index.js +0 -95
  1533. package/components/inventory/CopyableAddress.d.ts +0 -8
  1534. package/components/inventory/CopyableAddress.d.ts.map +0 -1
  1535. package/components/inventory/CopyableAddress.js +0 -18
  1536. package/components/inventory/InventoryToolbar.d.ts +0 -25
  1537. package/components/inventory/InventoryToolbar.d.ts.map +0 -1
  1538. package/components/inventory/InventoryToolbar.js +0 -28
  1539. package/components/inventory/NftGrid.d.ts +0 -13
  1540. package/components/inventory/NftGrid.d.ts.map +0 -1
  1541. package/components/inventory/NftGrid.js +0 -29
  1542. package/components/inventory/TokenLogo.d.ts +0 -12
  1543. package/components/inventory/TokenLogo.d.ts.map +0 -1
  1544. package/components/inventory/TokenLogo.js +0 -33
  1545. package/components/inventory/TokensTable.d.ts +0 -24
  1546. package/components/inventory/TokensTable.d.ts.map +0 -1
  1547. package/components/inventory/TokensTable.js +0 -26
  1548. package/components/inventory/constants.d.ts +0 -52
  1549. package/components/inventory/constants.d.ts.map +0 -1
  1550. package/components/inventory/constants.js +0 -121
  1551. package/components/inventory/index.d.ts +0 -9
  1552. package/components/inventory/index.d.ts.map +0 -1
  1553. package/components/inventory/index.js +0 -8
  1554. package/components/inventory/media-url.d.ts +0 -6
  1555. package/components/inventory/media-url.d.ts.map +0 -1
  1556. package/components/inventory/media-url.js +0 -28
  1557. package/components/inventory/useInventoryData.d.ts +0 -53
  1558. package/components/inventory/useInventoryData.d.ts.map +0 -1
  1559. package/components/inventory/useInventoryData.js +0 -332
  1560. package/components/knowledge-upload-image.d.ts +0 -27
  1561. package/components/knowledge-upload-image.d.ts.map +0 -1
  1562. package/components/knowledge-upload-image.js +0 -146
  1563. package/components/labels.d.ts +0 -6
  1564. package/components/labels.d.ts.map +0 -1
  1565. package/components/labels.js +0 -40
  1566. package/components/onboarding/ActivateStep.d.ts +0 -2
  1567. package/components/onboarding/ActivateStep.d.ts.map +0 -1
  1568. package/components/onboarding/ActivateStep.js +0 -10
  1569. package/components/onboarding/CloudLoginStep.d.ts +0 -2
  1570. package/components/onboarding/CloudLoginStep.d.ts.map +0 -1
  1571. package/components/onboarding/CloudLoginStep.js +0 -20
  1572. package/components/onboarding/ConnectionStep.d.ts +0 -2
  1573. package/components/onboarding/ConnectionStep.d.ts.map +0 -1
  1574. package/components/onboarding/ConnectionStep.js +0 -609
  1575. package/components/onboarding/IdentityStep.d.ts +0 -2
  1576. package/components/onboarding/IdentityStep.d.ts.map +0 -1
  1577. package/components/onboarding/IdentityStep.js +0 -102
  1578. package/components/onboarding/OnboardingPanel.d.ts +0 -9
  1579. package/components/onboarding/OnboardingPanel.d.ts.map +0 -1
  1580. package/components/onboarding/OnboardingPanel.js +0 -24
  1581. package/components/onboarding/OnboardingStepNav.d.ts +0 -2
  1582. package/components/onboarding/OnboardingStepNav.d.ts.map +0 -1
  1583. package/components/onboarding/OnboardingStepNav.js +0 -24
  1584. package/components/onboarding/PermissionsStep.d.ts +0 -2
  1585. package/components/onboarding/PermissionsStep.d.ts.map +0 -1
  1586. package/components/onboarding/PermissionsStep.js +0 -7
  1587. package/components/onboarding/RpcStep.d.ts +0 -2
  1588. package/components/onboarding/RpcStep.d.ts.map +0 -1
  1589. package/components/onboarding/RpcStep.js +0 -125
  1590. package/components/onboarding/SaveKeysStep.d.ts +0 -2
  1591. package/components/onboarding/SaveKeysStep.d.ts.map +0 -1
  1592. package/components/onboarding/SaveKeysStep.js +0 -44
  1593. package/components/onboarding/WelcomeStep.d.ts +0 -2
  1594. package/components/onboarding/WelcomeStep.d.ts.map +0 -1
  1595. package/components/onboarding/WelcomeStep.js +0 -30
  1596. package/components/permissions/PermissionIcon.d.ts +0 -4
  1597. package/components/permissions/PermissionIcon.d.ts.map +0 -1
  1598. package/components/permissions/PermissionIcon.js +0 -12
  1599. package/components/permissions/StreamingPermissions.d.ts +0 -20
  1600. package/components/permissions/StreamingPermissions.d.ts.map +0 -1
  1601. package/components/permissions/StreamingPermissions.js +0 -178
  1602. package/components/plugins/showcase-data.d.ts +0 -7
  1603. package/components/plugins/showcase-data.d.ts.map +0 -1
  1604. package/components/plugins/showcase-data.js +0 -464
  1605. package/components/shared/ShellHeaderControls.d.ts +0 -27
  1606. package/components/shared/ShellHeaderControls.d.ts.map +0 -1
  1607. package/components/shared/ShellHeaderControls.js +0 -55
  1608. package/components/shared-companion-scene-context.d.ts +0 -3
  1609. package/components/shared-companion-scene-context.d.ts.map +0 -1
  1610. package/components/shared-companion-scene-context.js +0 -13
  1611. package/components/skeletons.d.ts +0 -17
  1612. package/components/skeletons.d.ts.map +0 -1
  1613. package/components/skeletons.js +0 -22
  1614. package/components/stream/ActivityFeed.d.ts +0 -5
  1615. package/components/stream/ActivityFeed.d.ts.map +0 -1
  1616. package/components/stream/ActivityFeed.js +0 -57
  1617. package/components/stream/AvatarPip.d.ts +0 -5
  1618. package/components/stream/AvatarPip.d.ts.map +0 -1
  1619. package/components/stream/AvatarPip.js +0 -6
  1620. package/components/stream/ChatContent.d.ts +0 -6
  1621. package/components/stream/ChatContent.d.ts.map +0 -1
  1622. package/components/stream/ChatContent.js +0 -69
  1623. package/components/stream/ChatTicker.d.ts +0 -5
  1624. package/components/stream/ChatTicker.d.ts.map +0 -1
  1625. package/components/stream/ChatTicker.js +0 -34
  1626. package/components/stream/IdleContent.d.ts +0 -5
  1627. package/components/stream/IdleContent.d.ts.map +0 -1
  1628. package/components/stream/IdleContent.js +0 -17
  1629. package/components/stream/StatusBar.d.ts +0 -36
  1630. package/components/stream/StatusBar.d.ts.map +0 -1
  1631. package/components/stream/StatusBar.js +0 -140
  1632. package/components/stream/StreamSettings.d.ts +0 -33
  1633. package/components/stream/StreamSettings.d.ts.map +0 -1
  1634. package/components/stream/StreamSettings.js +0 -99
  1635. package/components/stream/StreamTerminal.d.ts +0 -2
  1636. package/components/stream/StreamTerminal.d.ts.map +0 -1
  1637. package/components/stream/StreamTerminal.js +0 -52
  1638. package/components/stream/StreamVoiceConfig.d.ts +0 -10
  1639. package/components/stream/StreamVoiceConfig.d.ts.map +0 -1
  1640. package/components/stream/StreamVoiceConfig.js +0 -88
  1641. package/components/stream/helpers.d.ts +0 -32
  1642. package/components/stream/helpers.d.ts.map +0 -1
  1643. package/components/stream/helpers.js +0 -110
  1644. package/components/stream/overlays/OverlayLayer.d.ts +0 -20
  1645. package/components/stream/overlays/OverlayLayer.d.ts.map +0 -1
  1646. package/components/stream/overlays/OverlayLayer.js +0 -24
  1647. package/components/stream/overlays/built-in/ActionTickerWidget.d.ts +0 -8
  1648. package/components/stream/overlays/built-in/ActionTickerWidget.d.ts.map +0 -1
  1649. package/components/stream/overlays/built-in/ActionTickerWidget.js +0 -44
  1650. package/components/stream/overlays/built-in/AlertPopupWidget.d.ts +0 -7
  1651. package/components/stream/overlays/built-in/AlertPopupWidget.d.ts.map +0 -1
  1652. package/components/stream/overlays/built-in/AlertPopupWidget.js +0 -62
  1653. package/components/stream/overlays/built-in/BrandingWidget.d.ts +0 -7
  1654. package/components/stream/overlays/built-in/BrandingWidget.d.ts.map +0 -1
  1655. package/components/stream/overlays/built-in/BrandingWidget.js +0 -36
  1656. package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts +0 -26
  1657. package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +0 -1
  1658. package/components/stream/overlays/built-in/CustomHtmlWidget.js +0 -78
  1659. package/components/stream/overlays/built-in/PeonGlassWidget.d.ts +0 -11
  1660. package/components/stream/overlays/built-in/PeonGlassWidget.d.ts.map +0 -1
  1661. package/components/stream/overlays/built-in/PeonGlassWidget.js +0 -188
  1662. package/components/stream/overlays/built-in/PeonHudWidget.d.ts +0 -10
  1663. package/components/stream/overlays/built-in/PeonHudWidget.d.ts.map +0 -1
  1664. package/components/stream/overlays/built-in/PeonHudWidget.js +0 -168
  1665. package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts +0 -11
  1666. package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +0 -1
  1667. package/components/stream/overlays/built-in/PeonSakuraWidget.js +0 -213
  1668. package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +0 -8
  1669. package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +0 -1
  1670. package/components/stream/overlays/built-in/ThoughtBubbleWidget.js +0 -59
  1671. package/components/stream/overlays/built-in/ViewerCountWidget.d.ts +0 -7
  1672. package/components/stream/overlays/built-in/ViewerCountWidget.d.ts.map +0 -1
  1673. package/components/stream/overlays/built-in/ViewerCountWidget.js +0 -34
  1674. package/components/stream/overlays/built-in/index.d.ts +0 -13
  1675. package/components/stream/overlays/built-in/index.d.ts.map +0 -1
  1676. package/components/stream/overlays/built-in/index.js +0 -12
  1677. package/components/stream/overlays/registry.d.ts +0 -11
  1678. package/components/stream/overlays/registry.d.ts.map +0 -1
  1679. package/components/stream/overlays/registry.js +0 -16
  1680. package/components/stream/overlays/types.d.ts +0 -67
  1681. package/components/stream/overlays/types.d.ts.map +0 -1
  1682. package/components/stream/overlays/types.js +0 -7
  1683. package/components/stream/overlays/useOverlayLayout.d.ts +0 -27
  1684. package/components/stream/overlays/useOverlayLayout.d.ts.map +0 -1
  1685. package/components/stream/overlays/useOverlayLayout.js +0 -162
  1686. package/components/trajectory-format.d.ts +0 -6
  1687. package/components/trajectory-format.d.ts.map +0 -1
  1688. package/components/trajectory-format.js +0 -43
  1689. package/components/ui-badges.d.ts +0 -23
  1690. package/components/ui-badges.d.ts.map +0 -1
  1691. package/components/ui-badges.js +0 -38
  1692. package/components/ui-switch.d.ts +0 -14
  1693. package/components/ui-switch.d.ts.map +0 -1
  1694. package/components/ui-switch.js +0 -15
  1695. package/components/vector-browser-three.d.ts +0 -4
  1696. package/components/vector-browser-three.d.ts.map +0 -1
  1697. package/components/vector-browser-three.js +0 -21
  1698. package/config/branding.d.ts +0 -49
  1699. package/config/branding.d.ts.map +0 -1
  1700. package/config/branding.js +0 -16
  1701. package/config/config-catalog.d.ts +0 -376
  1702. package/config/config-catalog.d.ts.map +0 -1
  1703. package/config/config-catalog.js +0 -724
  1704. package/config/config-field.d.ts +0 -68
  1705. package/config/config-field.d.ts.map +0 -1
  1706. package/config/config-field.js +0 -840
  1707. package/config/config-renderer.d.ts +0 -176
  1708. package/config/config-renderer.d.ts.map +0 -1
  1709. package/config/config-renderer.js +0 -405
  1710. package/config/index.d.ts +0 -6
  1711. package/config/index.d.ts.map +0 -1
  1712. package/config/index.js +0 -5
  1713. package/config/ui-renderer.d.ts +0 -26
  1714. package/config/ui-renderer.d.ts.map +0 -1
  1715. package/config/ui-renderer.js +0 -815
  1716. package/config/ui-spec.d.ts +0 -164
  1717. package/config/ui-spec.d.ts.map +0 -1
  1718. package/config/ui-spec.js +0 -13
  1719. package/events/index.d.ts +0 -48
  1720. package/events/index.d.ts.map +0 -1
  1721. package/events/index.js +0 -45
  1722. package/hooks/index.d.ts +0 -15
  1723. package/hooks/index.d.ts.map +0 -1
  1724. package/hooks/index.js +0 -14
  1725. package/hooks/useBugReport.d.ts +0 -14
  1726. package/hooks/useBugReport.d.ts.map +0 -1
  1727. package/hooks/useBugReport.js +0 -18
  1728. package/hooks/useCanvasWindow.d.ts +0 -38
  1729. package/hooks/useCanvasWindow.d.ts.map +0 -1
  1730. package/hooks/useCanvasWindow.js +0 -273
  1731. package/hooks/useChatAvatarVoice.d.ts +0 -10
  1732. package/hooks/useChatAvatarVoice.d.ts.map +0 -1
  1733. package/hooks/useChatAvatarVoice.js +0 -71
  1734. package/hooks/useClickOutside.d.ts +0 -6
  1735. package/hooks/useClickOutside.d.ts.map +0 -1
  1736. package/hooks/useClickOutside.js +0 -25
  1737. package/hooks/useContextMenu.d.ts +0 -17
  1738. package/hooks/useContextMenu.d.ts.map +0 -1
  1739. package/hooks/useContextMenu.js +0 -100
  1740. package/hooks/useKeyboardShortcuts.d.ts +0 -17
  1741. package/hooks/useKeyboardShortcuts.d.ts.map +0 -1
  1742. package/hooks/useKeyboardShortcuts.js +0 -67
  1743. package/hooks/useLifoSync.d.ts +0 -18
  1744. package/hooks/useLifoSync.d.ts.map +0 -1
  1745. package/hooks/useLifoSync.js +0 -113
  1746. package/hooks/useMemoryMonitor.d.ts +0 -87
  1747. package/hooks/useMemoryMonitor.d.ts.map +0 -1
  1748. package/hooks/useMemoryMonitor.js +0 -209
  1749. package/hooks/useRenderGuard.d.ts +0 -17
  1750. package/hooks/useRenderGuard.d.ts.map +0 -1
  1751. package/hooks/useRenderGuard.js +0 -36
  1752. package/hooks/useRetakeCapture.d.ts +0 -12
  1753. package/hooks/useRetakeCapture.d.ts.map +0 -1
  1754. package/hooks/useRetakeCapture.js +0 -60
  1755. package/hooks/useStreamPopoutNavigation.d.ts +0 -3
  1756. package/hooks/useStreamPopoutNavigation.d.ts.map +0 -1
  1757. package/hooks/useStreamPopoutNavigation.js +0 -17
  1758. package/hooks/useTimeout.d.ts +0 -11
  1759. package/hooks/useTimeout.d.ts.map +0 -1
  1760. package/hooks/useTimeout.js +0 -32
  1761. package/hooks/useVoiceChat.d.ts +0 -94
  1762. package/hooks/useVoiceChat.d.ts.map +0 -1
  1763. package/hooks/useVoiceChat.js +0 -1077
  1764. package/hooks/useWhatsAppPairing.d.ts +0 -11
  1765. package/hooks/useWhatsAppPairing.d.ts.map +0 -1
  1766. package/hooks/useWhatsAppPairing.js +0 -95
  1767. package/i18n/index.d.ts +0 -7
  1768. package/i18n/index.d.ts.map +0 -1
  1769. package/i18n/index.js +0 -53
  1770. package/i18n/locales/en.json +0 -1268
  1771. package/i18n/locales/es.json +0 -1236
  1772. package/i18n/locales/ko.json +0 -1236
  1773. package/i18n/locales/pt.json +0 -1236
  1774. package/i18n/locales/zh-CN.json +0 -1236
  1775. package/i18n/messages.d.ts +0 -6
  1776. package/i18n/messages.d.ts.map +0 -1
  1777. package/i18n/messages.js +0 -14
  1778. package/navigation/index.d.ts +0 -27
  1779. package/navigation/index.d.ts.map +0 -1
  1780. package/navigation/index.js +0 -232
  1781. package/onboarding-config.d.ts +0 -25
  1782. package/onboarding-config.d.ts.map +0 -1
  1783. package/onboarding-config.js +0 -76
  1784. package/platform/browser-launch.d.ts +0 -2
  1785. package/platform/browser-launch.d.ts.map +0 -1
  1786. package/platform/browser-launch.js +0 -109
  1787. package/platform/index.d.ts +0 -14
  1788. package/platform/index.d.ts.map +0 -1
  1789. package/platform/index.js +0 -24
  1790. package/platform/init.d.ts +0 -40
  1791. package/platform/init.d.ts.map +0 -1
  1792. package/platform/init.js +0 -160
  1793. package/platform/lifo.d.ts +0 -51
  1794. package/platform/lifo.d.ts.map +0 -1
  1795. package/platform/lifo.js +0 -138
  1796. package/providers/index.d.ts +0 -19
  1797. package/providers/index.d.ts.map +0 -1
  1798. package/providers/index.js +0 -80
  1799. package/shell-params.d.ts +0 -12
  1800. package/shell-params.d.ts.map +0 -1
  1801. package/shell-params.js +0 -19
  1802. package/state/AppContext.d.ts +0 -12
  1803. package/state/AppContext.d.ts.map +0 -1
  1804. package/state/AppContext.js +0 -5102
  1805. package/state/index.d.ts +0 -7
  1806. package/state/index.d.ts.map +0 -1
  1807. package/state/index.js +0 -6
  1808. package/state/internal.d.ts +0 -7
  1809. package/state/internal.d.ts.map +0 -1
  1810. package/state/internal.js +0 -6
  1811. package/state/onboarding-resume.d.ts +0 -11
  1812. package/state/onboarding-resume.d.ts.map +0 -1
  1813. package/state/onboarding-resume.js +0 -187
  1814. package/state/parsers.d.ts +0 -26
  1815. package/state/parsers.d.ts.map +0 -1
  1816. package/state/parsers.js +0 -255
  1817. package/state/persistence.d.ts +0 -59
  1818. package/state/persistence.d.ts.map +0 -1
  1819. package/state/persistence.js +0 -328
  1820. package/state/shell-routing.d.ts +0 -12
  1821. package/state/shell-routing.d.ts.map +0 -1
  1822. package/state/shell-routing.js +0 -26
  1823. package/state/types.d.ts +0 -426
  1824. package/state/types.d.ts.map +0 -1
  1825. package/state/types.js +0 -89
  1826. package/state/ui-preferences.d.ts +0 -3
  1827. package/state/ui-preferences.d.ts.map +0 -1
  1828. package/state/ui-preferences.js +0 -1
  1829. package/state/useApp.d.ts +0 -4
  1830. package/state/useApp.d.ts.map +0 -1
  1831. package/state/useApp.js +0 -22
  1832. package/state/vrm.d.ts +0 -30
  1833. package/state/vrm.d.ts.map +0 -1
  1834. package/state/vrm.js +0 -82
  1835. package/styles/anime.css +0 -6364
  1836. package/styles/base.css +0 -255
  1837. package/styles/onboarding-game.css +0 -1095
  1838. package/styles/styles.css +0 -2087
  1839. package/styles/xterm.css +0 -241
  1840. package/types/index.d.ts +0 -657
  1841. package/types/index.d.ts.map +0 -1
  1842. package/types/index.js +0 -1
  1843. package/utils/asset-url.d.ts +0 -26
  1844. package/utils/asset-url.d.ts.map +0 -1
  1845. package/utils/asset-url.js +0 -99
  1846. package/utils/assistant-text.d.ts +0 -2
  1847. package/utils/assistant-text.d.ts.map +0 -1
  1848. package/utils/assistant-text.js +0 -161
  1849. package/utils/clipboard.d.ts +0 -2
  1850. package/utils/clipboard.d.ts.map +0 -1
  1851. package/utils/clipboard.js +0 -38
  1852. package/utils/desktop-dialogs.d.ts +0 -19
  1853. package/utils/desktop-dialogs.d.ts.map +0 -1
  1854. package/utils/desktop-dialogs.js +0 -50
  1855. package/utils/eliza-globals.d.ts +0 -11
  1856. package/utils/eliza-globals.d.ts.map +0 -1
  1857. package/utils/eliza-globals.js +0 -33
  1858. package/utils/index.d.ts +0 -8
  1859. package/utils/index.d.ts.map +0 -1
  1860. package/utils/index.js +0 -7
  1861. package/utils/number-parsing.d.ts +0 -44
  1862. package/utils/number-parsing.d.ts.map +0 -1
  1863. package/utils/number-parsing.js +0 -56
  1864. package/utils/openExternalUrl.d.ts +0 -2
  1865. package/utils/openExternalUrl.d.ts.map +0 -1
  1866. package/utils/openExternalUrl.js +0 -17
  1867. package/utils/spoken-text.d.ts +0 -2
  1868. package/utils/spoken-text.d.ts.map +0 -1
  1869. package/utils/spoken-text.js +0 -56
  1870. package/utils/streaming-text.d.ts +0 -3
  1871. package/utils/streaming-text.d.ts.map +0 -1
  1872. package/utils/streaming-text.js +0 -87
  1873. package/voice/index.d.ts +0 -2
  1874. package/voice/index.d.ts.map +0 -1
  1875. package/voice/index.js +0 -1
  1876. package/voice/types.d.ts +0 -25
  1877. package/voice/types.d.ts.map +0 -1
  1878. package/voice/types.js +0 -166
  1879. package/wallet-rpc.d.ts +0 -8
  1880. package/wallet-rpc.d.ts.map +0 -1
  1881. package/wallet-rpc.js +0 -131
  1882. /package/{components/apps/extensions → services/local-inference/voice}/types.js +0 -0
package/api/client.js DELETED
@@ -1,2520 +0,0 @@
1
- /**
2
- * API client for the Milady backend.
3
- *
4
- * Thin fetch wrapper + WebSocket for real-time chat/events.
5
- * Replaces the gateway WebSocket protocol entirely.
6
- */
7
- import { DEFAULT_WALLET_RPC_SELECTIONS, normalizeWalletRpcProviderId, normalizeWalletRpcSelections, WALLET_RPC_PROVIDER_OPTIONS, } from "@elizaos/autonomous/contracts/wallet";
8
- import { stripAssistantStageDirections } from "../utils/assistant-text";
9
- import { mergeStreamingText } from "../utils/streaming-text";
10
- export { DEFAULT_WALLET_RPC_SELECTIONS, normalizeWalletRpcProviderId, normalizeWalletRpcSelections, WALLET_RPC_PROVIDER_OPTIONS, };
11
- export class ApiError extends Error {
12
- kind;
13
- status;
14
- path;
15
- constructor(options) {
16
- super(options.message);
17
- this.name = "ApiError";
18
- this.kind = options.kind;
19
- this.path = options.path;
20
- this.status = options.status;
21
- if (options.cause !== undefined) {
22
- this.cause = options.cause;
23
- }
24
- }
25
- }
26
- export function isApiError(value) {
27
- return value instanceof ApiError;
28
- }
29
- // ---------------------------------------------------------------------------
30
- // Client
31
- // ---------------------------------------------------------------------------
32
- const GENERIC_NO_RESPONSE_TEXT = "Sorry, I couldn't generate a response right now. Please try again.";
33
- const AGENT_TRANSFER_MIN_PASSWORD_LENGTH = 4;
34
- const DEFAULT_FETCH_TIMEOUT_MS = 10_000;
35
- const SESSION_STORAGE_API_BASE_KEY = "milady_api_base";
36
- const SESSION_STORAGE_API_TOKEN_KEY = "milady_api_token";
37
- export class MiladyClient {
38
- _baseUrl;
39
- _explicitBase;
40
- _token;
41
- clientId;
42
- ws = null;
43
- wsHandlers = new Map();
44
- wsSendQueue = [];
45
- wsSendQueueLimit = 32;
46
- reconnectTimer = null;
47
- backoffMs = 500;
48
- wsHasConnectedOnce = false;
49
- // Connection state tracking for backend crash handling
50
- connectionState = "disconnected";
51
- reconnectAttempt = 0;
52
- disconnectedAt = null;
53
- connectionStateListeners = new Set();
54
- maxReconnectAttempts = 15;
55
- // UI language propagation — set by AppContext so the backend can
56
- // localise responses when needed.
57
- _uiLanguage = null;
58
- /** Store the current UI language so it can be sent as a header on every request. */
59
- setUiLanguage(lang) {
60
- this._uiLanguage = lang || null;
61
- }
62
- static resolveDesktopLocalFallbackBase() {
63
- if (typeof window === "undefined")
64
- return "";
65
- const proto = window.location.protocol;
66
- // In the desktop shell the main process injects the live API base
67
- // once the embedded agent has bound a port. Avoid eager localhost probes
68
- // to prevent noisy ERR_CONNECTION_REFUSED logs during startup.
69
- if (proto === "electrobun:")
70
- return "";
71
- if (proto === "file:") {
72
- return "http://localhost:2138";
73
- }
74
- return "";
75
- }
76
- static generateClientId() {
77
- const random = typeof globalThis.crypto?.randomUUID === "function"
78
- ? globalThis.crypto.randomUUID()
79
- : `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}`;
80
- return `ui-${random.replace(/[^a-zA-Z0-9._-]/g, "")}`;
81
- }
82
- constructor(baseUrl, token) {
83
- this.clientId = MiladyClient.generateClientId();
84
- const stored = typeof window !== "undefined"
85
- ? window.sessionStorage.getItem(SESSION_STORAGE_API_TOKEN_KEY)
86
- : null;
87
- const storedBase = typeof window !== "undefined"
88
- ? window.sessionStorage.getItem(SESSION_STORAGE_API_BASE_KEY)
89
- : null;
90
- this._explicitBase = baseUrl != null || Boolean(storedBase?.trim());
91
- this._token = token?.trim() || stored || null;
92
- // Priority: explicit arg > desktop-injected global > same origin (Vite proxy)
93
- const injectedBase = typeof window !== "undefined" ? window.__MILADY_API_BASE__ : undefined;
94
- this._baseUrl =
95
- baseUrl ??
96
- storedBase ??
97
- injectedBase ??
98
- MiladyClient.resolveDesktopLocalFallbackBase();
99
- }
100
- /**
101
- * Resolve the API base URL lazily.
102
- * In the desktop shell the main process injects window.__MILADY_API_BASE__ after the
103
- * page loads (once the agent runtime starts). Re-checking on every call
104
- * ensures we pick up the injected value even if it wasn't set at construction.
105
- */
106
- get baseUrl() {
107
- if (!this._explicitBase && typeof window !== "undefined") {
108
- const injected = window.__MILADY_API_BASE__;
109
- // In the desktop shell the API base can be injected after initial render. Always
110
- // prefer the injected value when present so the client can switch away
111
- // from the localhost fallback once the main process publishes the real
112
- // endpoint.
113
- if (injected && injected !== this._baseUrl) {
114
- this._baseUrl = injected;
115
- }
116
- else if (!this._baseUrl) {
117
- this._baseUrl = MiladyClient.resolveDesktopLocalFallbackBase();
118
- }
119
- }
120
- return this._baseUrl;
121
- }
122
- get apiToken() {
123
- if (this._token)
124
- return this._token;
125
- if (typeof window === "undefined")
126
- return null;
127
- const injected = window.__MILADY_API_TOKEN__;
128
- if (typeof injected === "string" && injected.trim())
129
- return injected.trim();
130
- return null;
131
- }
132
- hasToken() {
133
- return Boolean(this.apiToken);
134
- }
135
- setToken(token) {
136
- this._token = token?.trim() || null;
137
- if (typeof window !== "undefined") {
138
- if (this._token) {
139
- window.__MILADY_API_TOKEN__ = this._token;
140
- window.sessionStorage.setItem(SESSION_STORAGE_API_TOKEN_KEY, this._token);
141
- }
142
- else {
143
- delete window.__MILADY_API_TOKEN__;
144
- window.sessionStorage.removeItem(SESSION_STORAGE_API_TOKEN_KEY);
145
- }
146
- }
147
- }
148
- getBaseUrl() {
149
- return this.baseUrl;
150
- }
151
- setBaseUrl(baseUrl) {
152
- const normalized = baseUrl?.trim().replace(/\/+$/, "") || "";
153
- this._explicitBase = normalized.length > 0;
154
- this._baseUrl = normalized;
155
- this.disconnectWs();
156
- if (typeof window !== "undefined") {
157
- if (normalized) {
158
- window.__MILADY_API_BASE__ = normalized;
159
- window.sessionStorage.setItem(SESSION_STORAGE_API_BASE_KEY, normalized);
160
- }
161
- else {
162
- delete window.__MILADY_API_BASE__;
163
- window.sessionStorage.removeItem(SESSION_STORAGE_API_BASE_KEY);
164
- }
165
- }
166
- }
167
- /** True when we have a usable HTTP(S) API endpoint. */
168
- get apiAvailable() {
169
- if (this.baseUrl)
170
- return true;
171
- if (typeof window !== "undefined") {
172
- const proto = window.location.protocol;
173
- return proto === "http:" || proto === "https:";
174
- }
175
- return false;
176
- }
177
- // --- REST API ---
178
- async rawRequest(path, init, options) {
179
- if (!this.apiAvailable) {
180
- throw new ApiError({
181
- kind: "network",
182
- path,
183
- message: "API not available (no HTTP origin)",
184
- });
185
- }
186
- const makeRequest = async (token) => {
187
- let timeoutId;
188
- let abortListener;
189
- const requestInit = {
190
- ...init,
191
- headers: {
192
- "X-Milady-Client-Id": this.clientId,
193
- ...(token ? { Authorization: `Bearer ${token}` } : {}),
194
- ...(this._uiLanguage
195
- ? { "X-Milady-UI-Language": this._uiLanguage }
196
- : {}),
197
- ...init?.headers,
198
- },
199
- };
200
- const fetchPromise = fetch(`${this.baseUrl}${path}`, requestInit);
201
- const pending = [fetchPromise];
202
- pending.push(new Promise((_, reject) => {
203
- timeoutId = setTimeout(() => {
204
- reject(new ApiError({
205
- kind: "timeout",
206
- path,
207
- message: `Request timed out after ${DEFAULT_FETCH_TIMEOUT_MS}ms`,
208
- }));
209
- }, DEFAULT_FETCH_TIMEOUT_MS);
210
- }));
211
- if (init?.signal) {
212
- if (init.signal.aborted) {
213
- throw new ApiError({
214
- kind: "network",
215
- path,
216
- message: "Request aborted",
217
- });
218
- }
219
- pending.push(new Promise((_, reject) => {
220
- abortListener = () => {
221
- reject(new ApiError({
222
- kind: "network",
223
- path,
224
- message: "Request aborted",
225
- }));
226
- };
227
- init.signal?.addEventListener("abort", abortListener, {
228
- once: true,
229
- });
230
- }));
231
- }
232
- try {
233
- return await Promise.race(pending);
234
- }
235
- catch (err) {
236
- if (err instanceof ApiError) {
237
- throw err;
238
- }
239
- throw new ApiError({
240
- kind: "network",
241
- path,
242
- message: err instanceof Error && err.message
243
- ? err.message
244
- : "Network request failed",
245
- cause: err,
246
- });
247
- }
248
- finally {
249
- if (timeoutId !== undefined) {
250
- clearTimeout(timeoutId);
251
- }
252
- if (init?.signal && abortListener) {
253
- init.signal.removeEventListener("abort", abortListener);
254
- }
255
- }
256
- };
257
- const token = this.apiToken;
258
- let res = await makeRequest(token);
259
- if (res.status === 401 && !token) {
260
- const retryToken = this.apiToken;
261
- if (retryToken) {
262
- res = await makeRequest(retryToken);
263
- }
264
- }
265
- if (!res.ok && !options?.allowNonOk) {
266
- const body = (await res
267
- .json()
268
- .catch(() => ({ error: res.statusText })));
269
- throw new ApiError({
270
- kind: "http",
271
- path,
272
- status: res.status,
273
- message: body.error ?? `HTTP ${res.status}`,
274
- });
275
- }
276
- return res;
277
- }
278
- async fetch(path, init) {
279
- const res = await this.rawRequest(path, {
280
- ...init,
281
- headers: {
282
- "Content-Type": "application/json",
283
- ...init?.headers,
284
- },
285
- });
286
- return res.json();
287
- }
288
- async getStatus() {
289
- return this.fetch("/api/status");
290
- }
291
- async getAgentSelfStatus() {
292
- return this.fetch("/api/agent/self-status");
293
- }
294
- async getRuntimeSnapshot(opts) {
295
- const params = new URLSearchParams();
296
- if (typeof opts?.depth === "number")
297
- params.set("depth", String(opts.depth));
298
- if (typeof opts?.maxArrayLength === "number") {
299
- params.set("maxArrayLength", String(opts.maxArrayLength));
300
- }
301
- if (typeof opts?.maxObjectEntries === "number") {
302
- params.set("maxObjectEntries", String(opts.maxObjectEntries));
303
- }
304
- if (typeof opts?.maxStringLength === "number") {
305
- params.set("maxStringLength", String(opts.maxStringLength));
306
- }
307
- const qs = params.toString();
308
- return this.fetch(`/api/runtime${qs ? `?${qs}` : ""}`);
309
- }
310
- async setAutomationMode(mode) {
311
- return this.fetch("/api/permissions/automation-mode", {
312
- method: "PUT",
313
- body: JSON.stringify({ mode }),
314
- });
315
- }
316
- async setTradeMode(mode) {
317
- return this.fetch("/api/permissions/trade-mode", {
318
- method: "PUT",
319
- body: JSON.stringify({ mode }),
320
- });
321
- }
322
- async playEmote(emoteId) {
323
- return this.fetch("/api/emote", {
324
- method: "POST",
325
- body: JSON.stringify({ emoteId }),
326
- });
327
- }
328
- async runTerminalCommand(command) {
329
- return this.fetch("/api/terminal/run", {
330
- method: "POST",
331
- body: JSON.stringify({ command }),
332
- });
333
- }
334
- async getOnboardingStatus() {
335
- return this.fetch("/api/onboarding/status");
336
- }
337
- async getWalletKeys() {
338
- return this.fetch("/api/wallet/keys");
339
- }
340
- async getAuthStatus() {
341
- console.log("🚨🚨🚨 REAL CLIENT GET_AUTH_STATUS CALLED! 🚨🚨🚨");
342
- // Retry with exponential backoff — the server may not be ready during boot.
343
- const maxRetries = 3;
344
- const baseBackoffMs = 1000;
345
- let lastErr;
346
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
347
- try {
348
- return await this.fetch("/api/auth/status");
349
- }
350
- catch (err) {
351
- const status = err?.status;
352
- if (status === 401) {
353
- return { required: true, pairingEnabled: false, expiresAt: null };
354
- }
355
- if (status === 404) {
356
- return { required: false, pairingEnabled: false, expiresAt: null };
357
- }
358
- lastErr = err;
359
- const kind = err?.kind;
360
- if (kind === "timeout" && attempt < maxRetries) {
361
- await new Promise((r) => setTimeout(r, baseBackoffMs * 2 ** attempt));
362
- continue;
363
- }
364
- if (attempt >= maxRetries)
365
- break;
366
- }
367
- }
368
- throw lastErr;
369
- }
370
- async pair(code) {
371
- const res = await this.fetch("/api/auth/pair", {
372
- method: "POST",
373
- body: JSON.stringify({ code }),
374
- });
375
- return res;
376
- }
377
- async getOnboardingOptions() {
378
- return this.fetch("/api/onboarding/options");
379
- }
380
- async submitOnboarding(data) {
381
- await this.fetch("/api/onboarding", {
382
- method: "POST",
383
- body: JSON.stringify(data),
384
- });
385
- }
386
- async startAnthropicLogin() {
387
- return this.fetch("/api/subscription/anthropic/start", { method: "POST" });
388
- }
389
- async exchangeAnthropicCode(code) {
390
- return this.fetch("/api/subscription/anthropic/exchange", {
391
- method: "POST",
392
- headers: { "Content-Type": "application/json" },
393
- body: JSON.stringify({ code }),
394
- });
395
- }
396
- async submitAnthropicSetupToken(token) {
397
- return this.fetch("/api/subscription/anthropic/setup-token", {
398
- method: "POST",
399
- headers: { "Content-Type": "application/json" },
400
- body: JSON.stringify({ token }),
401
- });
402
- }
403
- async getSubscriptionStatus() {
404
- return this.fetch("/api/subscription/status");
405
- }
406
- async deleteSubscription(provider) {
407
- return this.fetch(`/api/subscription/${encodeURIComponent(provider)}`, {
408
- method: "DELETE",
409
- });
410
- }
411
- async switchProvider(provider, apiKey) {
412
- return this.fetch("/api/provider/switch", {
413
- method: "POST",
414
- headers: { "Content-Type": "application/json" },
415
- body: JSON.stringify({ provider, ...(apiKey ? { apiKey } : {}) }),
416
- });
417
- }
418
- async startOpenAILogin() {
419
- return this.fetch("/api/subscription/openai/start", { method: "POST" });
420
- }
421
- async exchangeOpenAICode(code) {
422
- return this.fetch("/api/subscription/openai/exchange", {
423
- method: "POST",
424
- headers: { "Content-Type": "application/json" },
425
- body: JSON.stringify({ code }),
426
- });
427
- }
428
- async getSandboxPlatform() {
429
- return this.fetch("/api/sandbox/platform");
430
- }
431
- async getSandboxBrowser() {
432
- return this.fetch("/api/sandbox/browser");
433
- }
434
- async getSandboxScreenshot(region) {
435
- if (!region) {
436
- return this.fetch("/api/sandbox/screen/screenshot", {
437
- method: "POST",
438
- });
439
- }
440
- return this.fetch("/api/sandbox/screen/screenshot", {
441
- method: "POST",
442
- headers: { "Content-Type": "application/json" },
443
- body: JSON.stringify(region),
444
- });
445
- }
446
- async getSandboxWindows() {
447
- return this.fetch("/api/sandbox/screen/windows");
448
- }
449
- async startDocker() {
450
- return this.fetch("/api/sandbox/docker/start", { method: "POST" });
451
- }
452
- async startAgent() {
453
- const res = await this.fetch("/api/agent/start", {
454
- method: "POST",
455
- });
456
- return res.status;
457
- }
458
- async stopAgent() {
459
- const res = await this.fetch("/api/agent/stop", {
460
- method: "POST",
461
- });
462
- return res.status;
463
- }
464
- async pauseAgent() {
465
- const res = await this.fetch("/api/agent/pause", {
466
- method: "POST",
467
- });
468
- return res.status;
469
- }
470
- async resumeAgent() {
471
- const res = await this.fetch("/api/agent/resume", {
472
- method: "POST",
473
- });
474
- return res.status;
475
- }
476
- async restartAgent() {
477
- const res = await this.fetch("/api/agent/restart", { method: "POST" });
478
- return res.status;
479
- }
480
- /**
481
- * Restart the agent if possible, or wait for an in-progress restart to finish.
482
- * Polls status until the agent state is "running".
483
- */
484
- async restartAndWait(maxWaitMs = 30000) {
485
- // Try triggering a restart; 409 means one is already in progress
486
- try {
487
- await this.restartAgent();
488
- }
489
- catch {
490
- // Already restarting — that's fine, we'll poll
491
- }
492
- // Poll until running
493
- const start = Date.now();
494
- const interval = 1000;
495
- while (Date.now() - start < maxWaitMs) {
496
- await new Promise((r) => setTimeout(r, interval));
497
- try {
498
- const status = await this.getStatus();
499
- if (status.state === "running")
500
- return status;
501
- }
502
- catch {
503
- // Server may be briefly unavailable during restart
504
- }
505
- }
506
- // Return whatever we get after timeout
507
- return this.getStatus();
508
- }
509
- async resetAgent() {
510
- await this.fetch("/api/agent/reset", { method: "POST" });
511
- }
512
- async getConfig() {
513
- return this.fetch("/api/config");
514
- }
515
- async getConfigSchema() {
516
- return this.fetch("/api/config/schema");
517
- }
518
- async updateConfig(patch) {
519
- return this.fetch("/api/config", {
520
- method: "PUT",
521
- headers: { "Content-Type": "application/json" },
522
- body: JSON.stringify(patch),
523
- });
524
- }
525
- // ── Custom VRM avatar ────────────────────────────────────────────────
526
- async uploadCustomVrm(file) {
527
- const buf = await file.arrayBuffer();
528
- await this.fetch("/api/avatar/vrm", {
529
- method: "POST",
530
- headers: { "Content-Type": "application/octet-stream" },
531
- body: buf,
532
- });
533
- }
534
- /** Uses raw fetch instead of this.fetch() because HEAD returns no JSON body. */
535
- async hasCustomVrm() {
536
- try {
537
- const res = await this.rawRequest("/api/avatar/vrm", { method: "HEAD" }, { allowNonOk: true });
538
- return res.ok;
539
- }
540
- catch {
541
- return false;
542
- }
543
- }
544
- // ── Custom background image ─────────────────────────────────────────
545
- async uploadCustomBackground(file) {
546
- const buf = await file.arrayBuffer();
547
- await this.fetch("/api/avatar/background", {
548
- method: "POST",
549
- headers: { "Content-Type": "application/octet-stream" },
550
- body: buf,
551
- });
552
- }
553
- /** Uses raw fetch instead of this.fetch() because HEAD returns no JSON body. */
554
- async hasCustomBackground() {
555
- try {
556
- const res = await this.rawRequest("/api/avatar/background", { method: "HEAD" }, { allowNonOk: true });
557
- return res.ok;
558
- }
559
- catch {
560
- return false;
561
- }
562
- }
563
- // ── Connectors ──────────────────────────────────────────────────────
564
- async getConnectors() {
565
- return this.fetch("/api/connectors");
566
- }
567
- async saveConnector(name, config) {
568
- return this.fetch("/api/connectors", {
569
- method: "POST",
570
- body: JSON.stringify({ name, config }),
571
- });
572
- }
573
- async deleteConnector(name) {
574
- return this.fetch(`/api/connectors/${encodeURIComponent(name)}`, {
575
- method: "DELETE",
576
- });
577
- }
578
- async getTriggers() {
579
- return this.fetch("/api/triggers");
580
- }
581
- async getTrigger(id) {
582
- return this.fetch(`/api/triggers/${encodeURIComponent(id)}`);
583
- }
584
- async createTrigger(request) {
585
- return this.fetch("/api/triggers", {
586
- method: "POST",
587
- body: JSON.stringify(request),
588
- });
589
- }
590
- async updateTrigger(id, request) {
591
- return this.fetch(`/api/triggers/${encodeURIComponent(id)}`, {
592
- method: "PUT",
593
- body: JSON.stringify(request),
594
- });
595
- }
596
- async deleteTrigger(id) {
597
- return this.fetch(`/api/triggers/${encodeURIComponent(id)}`, {
598
- method: "DELETE",
599
- });
600
- }
601
- async runTriggerNow(id) {
602
- return this.fetch(`/api/triggers/${encodeURIComponent(id)}/execute`, {
603
- method: "POST",
604
- });
605
- }
606
- async getTriggerRuns(id) {
607
- return this.fetch(`/api/triggers/${encodeURIComponent(id)}/runs`);
608
- }
609
- async getTriggerHealth() {
610
- return this.fetch("/api/triggers/health");
611
- }
612
- // Fine-tuning / training
613
- async getTrainingStatus() {
614
- return this.fetch("/api/training/status");
615
- }
616
- async listTrainingTrajectories(opts) {
617
- const params = new URLSearchParams();
618
- if (typeof opts?.limit === "number")
619
- params.set("limit", String(opts.limit));
620
- if (typeof opts?.offset === "number")
621
- params.set("offset", String(opts.offset));
622
- const qs = params.toString();
623
- return this.fetch(`/api/training/trajectories${qs ? `?${qs}` : ""}`);
624
- }
625
- async getTrainingTrajectory(trajectoryId) {
626
- return this.fetch(`/api/training/trajectories/${encodeURIComponent(trajectoryId)}`);
627
- }
628
- async listTrainingDatasets() {
629
- return this.fetch("/api/training/datasets");
630
- }
631
- async buildTrainingDataset(options) {
632
- return this.fetch("/api/training/datasets/build", {
633
- method: "POST",
634
- body: JSON.stringify(options ?? {}),
635
- });
636
- }
637
- async listTrainingJobs() {
638
- return this.fetch("/api/training/jobs");
639
- }
640
- async startTrainingJob(options) {
641
- return this.fetch("/api/training/jobs", {
642
- method: "POST",
643
- body: JSON.stringify(options ?? {}),
644
- });
645
- }
646
- async getTrainingJob(jobId) {
647
- return this.fetch(`/api/training/jobs/${encodeURIComponent(jobId)}`);
648
- }
649
- async cancelTrainingJob(jobId) {
650
- return this.fetch(`/api/training/jobs/${encodeURIComponent(jobId)}/cancel`, {
651
- method: "POST",
652
- });
653
- }
654
- async listTrainingModels() {
655
- return this.fetch("/api/training/models");
656
- }
657
- async importTrainingModelToOllama(modelId, options) {
658
- return this.fetch(`/api/training/models/${encodeURIComponent(modelId)}/import-ollama`, {
659
- method: "POST",
660
- body: JSON.stringify(options ?? {}),
661
- });
662
- }
663
- async activateTrainingModel(modelId, providerModel) {
664
- return this.fetch(`/api/training/models/${encodeURIComponent(modelId)}/activate`, {
665
- method: "POST",
666
- body: JSON.stringify({ providerModel }),
667
- });
668
- }
669
- async benchmarkTrainingModel(modelId) {
670
- return this.fetch(`/api/training/models/${encodeURIComponent(modelId)}/benchmark`, {
671
- method: "POST",
672
- });
673
- }
674
- async getPlugins() {
675
- return this.fetch("/api/plugins");
676
- }
677
- async fetchModels(provider, refresh = true) {
678
- const params = new URLSearchParams({ provider });
679
- if (refresh)
680
- params.set("refresh", "true");
681
- return this.fetch(`/api/models?${params.toString()}`);
682
- }
683
- async getCorePlugins() {
684
- return this.fetch("/api/plugins/core");
685
- }
686
- async toggleCorePlugin(npmName, enabled) {
687
- return this.fetch("/api/plugins/core/toggle", {
688
- method: "POST",
689
- body: JSON.stringify({ npmName, enabled }),
690
- });
691
- }
692
- async updatePlugin(id, config) {
693
- return this.fetch(`/api/plugins/${id}`, {
694
- method: "PUT",
695
- body: JSON.stringify(config),
696
- });
697
- }
698
- async getSecrets() {
699
- return this.fetch("/api/secrets");
700
- }
701
- async updateSecrets(secrets) {
702
- return this.fetch("/api/secrets", {
703
- method: "PUT",
704
- body: JSON.stringify({ secrets }),
705
- });
706
- }
707
- async testPluginConnection(id) {
708
- return this.fetch(`/api/plugins/${encodeURIComponent(id)}/test`, {
709
- method: "POST",
710
- });
711
- }
712
- async restart() {
713
- return this.fetch("/api/restart", { method: "POST" });
714
- }
715
- async getSkills() {
716
- return this.fetch("/api/skills");
717
- }
718
- async refreshSkills() {
719
- return this.fetch("/api/skills/refresh", { method: "POST" });
720
- }
721
- async getLogs(filter) {
722
- const params = new URLSearchParams();
723
- if (filter?.source)
724
- params.set("source", filter.source);
725
- if (filter?.level)
726
- params.set("level", filter.level);
727
- if (filter?.tag)
728
- params.set("tag", filter.tag);
729
- if (filter?.since)
730
- params.set("since", String(filter.since));
731
- const qs = params.toString();
732
- return this.fetch(`/api/logs${qs ? `?${qs}` : ""}`);
733
- }
734
- buildSecurityAuditParams(filter, includeStream = false) {
735
- const params = new URLSearchParams();
736
- if (filter?.type)
737
- params.set("type", filter.type);
738
- if (filter?.severity)
739
- params.set("severity", filter.severity);
740
- if (filter?.since !== undefined) {
741
- const sinceValue = filter.since instanceof Date
742
- ? filter.since.toISOString()
743
- : String(filter.since);
744
- params.set("since", sinceValue);
745
- }
746
- if (filter?.limit !== undefined)
747
- params.set("limit", String(filter.limit));
748
- if (includeStream)
749
- params.set("stream", "1");
750
- return params;
751
- }
752
- async getSecurityAudit(filter) {
753
- const qs = this.buildSecurityAuditParams(filter).toString();
754
- return this.fetch(`/api/security/audit${qs ? `?${qs}` : ""}`);
755
- }
756
- async streamSecurityAudit(onEvent, filter, signal) {
757
- if (!this.apiAvailable) {
758
- throw new Error("API not available (no HTTP origin)");
759
- }
760
- const token = this.apiToken;
761
- const qs = this.buildSecurityAuditParams(filter, true).toString();
762
- const res = await fetch(`${this.baseUrl}/api/security/audit${qs ? `?${qs}` : ""}`, {
763
- method: "GET",
764
- headers: {
765
- Accept: "text/event-stream",
766
- ...(token ? { Authorization: `Bearer ${token}` } : {}),
767
- },
768
- signal,
769
- });
770
- if (!res.ok) {
771
- const body = (await res
772
- .json()
773
- .catch(() => ({ error: res.statusText })));
774
- const err = new Error(body.error ?? `HTTP ${res.status}`);
775
- err.status = res.status;
776
- throw err;
777
- }
778
- if (!res.body) {
779
- throw new Error("Streaming not supported by this browser");
780
- }
781
- const parsePayload = (payload) => {
782
- if (!payload)
783
- return;
784
- try {
785
- const parsed = JSON.parse(payload);
786
- if (parsed.type === "snapshot" || parsed.type === "entry") {
787
- onEvent(parsed);
788
- }
789
- }
790
- catch {
791
- // Ignore malformed payloads to keep stream consumption resilient.
792
- }
793
- };
794
- const decoder = new TextDecoder();
795
- const reader = res.body.getReader();
796
- let buffer = "";
797
- const findSseEventBreak = (chunkBuffer) => {
798
- const lfBreak = chunkBuffer.indexOf("\n\n");
799
- const crlfBreak = chunkBuffer.indexOf("\r\n\r\n");
800
- if (lfBreak === -1 && crlfBreak === -1)
801
- return null;
802
- if (lfBreak === -1)
803
- return { index: crlfBreak, length: 4 };
804
- if (crlfBreak === -1)
805
- return { index: lfBreak, length: 2 };
806
- return lfBreak < crlfBreak
807
- ? { index: lfBreak, length: 2 }
808
- : { index: crlfBreak, length: 4 };
809
- };
810
- while (true) {
811
- const { done, value } = await reader.read();
812
- if (done)
813
- break;
814
- buffer += decoder.decode(value, { stream: true });
815
- let eventBreak = findSseEventBreak(buffer);
816
- while (eventBreak) {
817
- const rawEvent = buffer.slice(0, eventBreak.index);
818
- buffer = buffer.slice(eventBreak.index + eventBreak.length);
819
- for (const line of rawEvent.split(/\r?\n/)) {
820
- if (!line.startsWith("data:"))
821
- continue;
822
- parsePayload(line.slice(5).trim());
823
- }
824
- eventBreak = findSseEventBreak(buffer);
825
- }
826
- }
827
- if (buffer.trim()) {
828
- for (const line of buffer.split(/\r?\n/)) {
829
- if (!line.startsWith("data:"))
830
- continue;
831
- parsePayload(line.slice(5).trim());
832
- }
833
- }
834
- }
835
- async getAgentEvents(opts) {
836
- const params = new URLSearchParams();
837
- if (opts?.afterEventId)
838
- params.set("after", opts.afterEventId);
839
- if (typeof opts?.limit === "number")
840
- params.set("limit", String(opts.limit));
841
- if (opts?.runId)
842
- params.set("runId", opts.runId);
843
- if (typeof opts?.fromSeq === "number")
844
- params.set("fromSeq", String(Math.trunc(opts.fromSeq)));
845
- const qs = params.toString();
846
- return this.fetch(`/api/agent/events${qs ? `?${qs}` : ""}`);
847
- }
848
- async getExtensionStatus() {
849
- return this.fetch("/api/extension/status");
850
- }
851
- // Skill Catalog
852
- async getSkillCatalog(opts) {
853
- const params = new URLSearchParams();
854
- if (opts?.page)
855
- params.set("page", String(opts.page));
856
- if (opts?.perPage)
857
- params.set("perPage", String(opts.perPage));
858
- if (opts?.sort)
859
- params.set("sort", opts.sort);
860
- const qs = params.toString();
861
- return this.fetch(`/api/skills/catalog${qs ? `?${qs}` : ""}`);
862
- }
863
- async searchSkillCatalog(query, limit = 30) {
864
- return this.fetch(`/api/skills/catalog/search?q=${encodeURIComponent(query)}&limit=${limit}`);
865
- }
866
- async getSkillCatalogDetail(slug) {
867
- return this.fetch(`/api/skills/catalog/${encodeURIComponent(slug)}`);
868
- }
869
- async refreshSkillCatalog() {
870
- return this.fetch("/api/skills/catalog/refresh", { method: "POST" });
871
- }
872
- async installCatalogSkill(slug, version) {
873
- return this.fetch("/api/skills/catalog/install", {
874
- method: "POST",
875
- body: JSON.stringify({ slug, version }),
876
- });
877
- }
878
- async uninstallCatalogSkill(slug) {
879
- return this.fetch("/api/skills/catalog/uninstall", {
880
- method: "POST",
881
- body: JSON.stringify({ slug }),
882
- });
883
- }
884
- // Registry / Plugin Store
885
- async getRegistryPlugins() {
886
- return this.fetch("/api/registry/plugins");
887
- }
888
- async getRegistryPluginInfo(name) {
889
- return this.fetch(`/api/registry/plugins/${encodeURIComponent(name)}`);
890
- }
891
- async getInstalledPlugins() {
892
- return this.fetch("/api/plugins/installed");
893
- }
894
- async installRegistryPlugin(name, autoRestart = true) {
895
- return this.fetch("/api/plugins/install", {
896
- method: "POST",
897
- body: JSON.stringify({ name, autoRestart }),
898
- });
899
- }
900
- async uninstallRegistryPlugin(name, autoRestart = true) {
901
- return this.fetch("/api/plugins/uninstall", {
902
- method: "POST",
903
- body: JSON.stringify({ name, autoRestart }),
904
- });
905
- }
906
- // Agent Export / Import
907
- /**
908
- * Export the agent as a password-encrypted .eliza-agent file.
909
- * Returns the raw Response so the caller can stream the binary body.
910
- */
911
- async exportAgent(password, includeLogs = false) {
912
- if (password.length < AGENT_TRANSFER_MIN_PASSWORD_LENGTH) {
913
- throw new Error(`Password must be at least ${AGENT_TRANSFER_MIN_PASSWORD_LENGTH} characters.`);
914
- }
915
- return this.rawRequest("/api/agent/export", {
916
- method: "POST",
917
- headers: {
918
- "Content-Type": "application/json",
919
- },
920
- body: JSON.stringify({ password, includeLogs }),
921
- });
922
- }
923
- /** Get an estimate of the export size. */
924
- async getExportEstimate() {
925
- return this.fetch("/api/agent/export/estimate");
926
- }
927
- /**
928
- * Import an agent from a password-encrypted .eliza-agent file.
929
- * Encodes the password and file into a binary envelope.
930
- */
931
- async importAgent(password, fileBuffer) {
932
- if (password.length < AGENT_TRANSFER_MIN_PASSWORD_LENGTH) {
933
- throw new Error(`Password must be at least ${AGENT_TRANSFER_MIN_PASSWORD_LENGTH} characters.`);
934
- }
935
- const passwordBytes = new TextEncoder().encode(password);
936
- const envelope = new Uint8Array(4 + passwordBytes.length + fileBuffer.byteLength);
937
- const view = new DataView(envelope.buffer);
938
- view.setUint32(0, passwordBytes.length, false);
939
- envelope.set(passwordBytes, 4);
940
- envelope.set(new Uint8Array(fileBuffer), 4 + passwordBytes.length);
941
- const res = await this.rawRequest("/api/agent/import", {
942
- method: "POST",
943
- headers: {
944
- "Content-Type": "application/octet-stream",
945
- },
946
- body: envelope,
947
- });
948
- const data = (await res.json());
949
- if (!data.success) {
950
- throw new Error(data.error ?? `Import failed (${res.status})`);
951
- }
952
- return data;
953
- }
954
- // Character
955
- async getCharacter() {
956
- return this.fetch("/api/character");
957
- }
958
- async getRandomName() {
959
- return this.fetch("/api/character/random-name");
960
- }
961
- async generateCharacterField(field, context, mode) {
962
- return this.fetch("/api/character/generate", {
963
- method: "POST",
964
- body: JSON.stringify({ field, context, mode }),
965
- });
966
- }
967
- async updateCharacter(character) {
968
- return this.fetch("/api/character", {
969
- method: "PUT",
970
- body: JSON.stringify(character),
971
- });
972
- }
973
- // Wallet
974
- async getWalletAddresses() {
975
- return this.fetch("/api/wallet/addresses");
976
- }
977
- async getWalletBalances() {
978
- return this.fetch("/api/wallet/balances");
979
- }
980
- async getWalletNfts() {
981
- return this.fetch("/api/wallet/nfts");
982
- }
983
- async getWalletConfig() {
984
- return this.fetch("/api/wallet/config");
985
- }
986
- async updateWalletConfig(config) {
987
- return this.fetch("/api/wallet/config", {
988
- method: "PUT",
989
- body: JSON.stringify(config),
990
- });
991
- }
992
- async exportWalletKeys(exportToken) {
993
- return this.fetch("/api/wallet/export", {
994
- method: "POST",
995
- body: JSON.stringify({ confirm: true, exportToken }),
996
- });
997
- }
998
- // BSC Trading
999
- async getBscTradePreflight(tokenAddress) {
1000
- return this.fetch("/api/wallet/trade/preflight", {
1001
- method: "POST",
1002
- body: JSON.stringify(tokenAddress?.trim() ? { tokenAddress: tokenAddress.trim() } : {}),
1003
- });
1004
- }
1005
- async getBscTradeQuote(request) {
1006
- return this.fetch("/api/wallet/trade/quote", {
1007
- method: "POST",
1008
- body: JSON.stringify(request),
1009
- });
1010
- }
1011
- async executeBscTrade(request) {
1012
- return this.fetch("/api/wallet/trade/execute", {
1013
- method: "POST",
1014
- body: JSON.stringify(request),
1015
- });
1016
- }
1017
- async executeBscTransfer(request) {
1018
- return this.fetch("/api/wallet/transfer/execute", {
1019
- method: "POST",
1020
- body: JSON.stringify(request),
1021
- });
1022
- }
1023
- async getBscTradeTxStatus(hash) {
1024
- return this.fetch(`/api/wallet/trade/tx-status?hash=${encodeURIComponent(hash)}`);
1025
- }
1026
- async getWalletTradingProfile(window = "30d", source = "all") {
1027
- const params = new URLSearchParams({
1028
- window,
1029
- source,
1030
- });
1031
- return this.fetch(`/api/wallet/trading/profile?${params.toString()}`);
1032
- }
1033
- async applyProductionWalletDefaults() {
1034
- return this.fetch("/api/wallet/production-defaults", {
1035
- method: "POST",
1036
- body: JSON.stringify({ confirm: true }),
1037
- });
1038
- }
1039
- // Software Updates
1040
- async getUpdateStatus(force = false) {
1041
- return this.fetch(`/api/update/status${force ? "?force=true" : ""}`);
1042
- }
1043
- async setUpdateChannel(channel) {
1044
- return this.fetch("/api/update/channel", {
1045
- method: "PUT",
1046
- body: JSON.stringify({ channel }),
1047
- });
1048
- }
1049
- // Cloud
1050
- async getCloudStatus() {
1051
- return this.fetch("/api/cloud/status");
1052
- }
1053
- async getCloudCredits() {
1054
- return this.fetch("/api/cloud/credits");
1055
- }
1056
- async getCloudBillingSummary() {
1057
- return this.fetch("/api/cloud/billing/summary");
1058
- }
1059
- async getCloudBillingSettings() {
1060
- return this.fetch("/api/cloud/billing/settings");
1061
- }
1062
- async updateCloudBillingSettings(request) {
1063
- return this.fetch("/api/cloud/billing/settings", {
1064
- method: "PUT",
1065
- body: JSON.stringify(request),
1066
- });
1067
- }
1068
- async getCloudBillingPaymentMethods() {
1069
- return this.fetch("/api/cloud/billing/payment-methods");
1070
- }
1071
- async getCloudBillingHistory() {
1072
- return this.fetch("/api/cloud/billing/history");
1073
- }
1074
- async createCloudBillingCheckout(request) {
1075
- return this.fetch("/api/cloud/billing/checkout", {
1076
- method: "POST",
1077
- body: JSON.stringify(request),
1078
- });
1079
- }
1080
- async createCloudBillingCryptoQuote(request) {
1081
- return this.fetch("/api/cloud/billing/crypto/quote", {
1082
- method: "POST",
1083
- body: JSON.stringify(request),
1084
- });
1085
- }
1086
- async cloudLogin() {
1087
- return this.fetch("/api/cloud/login", { method: "POST" });
1088
- }
1089
- async cloudLoginPoll(sessionId) {
1090
- return this.fetch(`/api/cloud/login/status?sessionId=${encodeURIComponent(sessionId)}`);
1091
- }
1092
- async cloudDisconnect() {
1093
- return this.fetch("/api/cloud/disconnect", { method: "POST" });
1094
- }
1095
- // Cloud Compat (Eliza Cloud v2 thin-client endpoints)
1096
- /** List all cloud-hosted agents for the authenticated user. */
1097
- async getCloudCompatAgents() {
1098
- return this.fetch("/api/cloud/compat/agents");
1099
- }
1100
- /** Create a new cloud-hosted agent. */
1101
- async createCloudCompatAgent(opts) {
1102
- return this.fetch("/api/cloud/compat/agents", {
1103
- method: "POST",
1104
- body: JSON.stringify(opts),
1105
- });
1106
- }
1107
- /** Get a specific cloud-hosted agent by ID. */
1108
- async getCloudCompatAgent(agentId) {
1109
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}`);
1110
- }
1111
- /** Delete a cloud-hosted agent. */
1112
- async deleteCloudCompatAgent(agentId) {
1113
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}`, { method: "DELETE" });
1114
- }
1115
- /** Get status of a cloud-hosted agent. */
1116
- async getCloudCompatAgentStatus(agentId) {
1117
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/status`);
1118
- }
1119
- /** Get logs from a cloud-hosted agent. */
1120
- async getCloudCompatAgentLogs(agentId, tail = 100) {
1121
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/logs?tail=${tail}`);
1122
- }
1123
- /** Restart a cloud-hosted agent. */
1124
- async restartCloudCompatAgent(agentId) {
1125
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/restart`, { method: "POST" });
1126
- }
1127
- /** Suspend a cloud-hosted agent. */
1128
- async suspendCloudCompatAgent(agentId) {
1129
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/suspend`, { method: "POST" });
1130
- }
1131
- /** Resume a cloud-hosted agent. */
1132
- async resumeCloudCompatAgent(agentId) {
1133
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/resume`, { method: "POST" });
1134
- }
1135
- /** Launch a managed cloud agent into the Milady app. */
1136
- async launchCloudCompatAgent(agentId) {
1137
- return this.fetch(`/api/cloud/compat/agents/${encodeURIComponent(agentId)}/launch`, { method: "POST" });
1138
- }
1139
- /** Get cloud availability (capacity info). */
1140
- async getCloudCompatAvailability() {
1141
- return this.fetch("/api/cloud/compat/availability");
1142
- }
1143
- /** Poll a cloud job status by job ID. */
1144
- async getCloudCompatJobStatus(jobId) {
1145
- return this.fetch(`/api/cloud/compat/jobs/${encodeURIComponent(jobId)}`);
1146
- }
1147
- // Apps & Registry
1148
- async listApps() {
1149
- return this.fetch("/api/apps");
1150
- }
1151
- async searchApps(query) {
1152
- return this.fetch(`/api/apps/search?q=${encodeURIComponent(query)}`);
1153
- }
1154
- async listInstalledApps() {
1155
- return this.fetch("/api/apps/installed");
1156
- }
1157
- async stopApp(name) {
1158
- return this.fetch("/api/apps/stop", {
1159
- method: "POST",
1160
- body: JSON.stringify({ name }),
1161
- });
1162
- }
1163
- async getAppInfo(name) {
1164
- return this.fetch(`/api/apps/info/${encodeURIComponent(name)}`);
1165
- }
1166
- /** Launch an app: installs its plugin (if needed), returns viewer config for iframe. */
1167
- async launchApp(name) {
1168
- return this.fetch("/api/apps/launch", {
1169
- method: "POST",
1170
- body: JSON.stringify({ name }),
1171
- });
1172
- }
1173
- async listRegistryPlugins() {
1174
- return this.fetch("/api/apps/plugins");
1175
- }
1176
- async searchRegistryPlugins(query) {
1177
- return this.fetch(`/api/apps/plugins/search?q=${encodeURIComponent(query)}`);
1178
- }
1179
- async listHyperscapeEmbeddedAgents() {
1180
- return this.fetch("/api/apps/hyperscape/embedded-agents");
1181
- }
1182
- async createHyperscapeEmbeddedAgent(input) {
1183
- return this.fetch("/api/apps/hyperscape/embedded-agents", {
1184
- method: "POST",
1185
- body: JSON.stringify(input),
1186
- });
1187
- }
1188
- async controlHyperscapeEmbeddedAgent(characterId, action) {
1189
- return this.fetch(`/api/apps/hyperscape/embedded-agents/${encodeURIComponent(characterId)}/${action}`, { method: "POST" });
1190
- }
1191
- async sendHyperscapeEmbeddedAgentCommand(characterId, command, data) {
1192
- return this.fetch(`/api/apps/hyperscape/embedded-agents/${encodeURIComponent(characterId)}/command`, {
1193
- method: "POST",
1194
- body: JSON.stringify({ command, data }),
1195
- });
1196
- }
1197
- async sendHyperscapeAgentMessage(agentId, content) {
1198
- return this.fetch(`/api/apps/hyperscape/agents/${encodeURIComponent(agentId)}/message`, {
1199
- method: "POST",
1200
- body: JSON.stringify({ content }),
1201
- });
1202
- }
1203
- async getHyperscapeAgentGoal(agentId) {
1204
- return this.fetch(`/api/apps/hyperscape/agents/${encodeURIComponent(agentId)}/goal`);
1205
- }
1206
- async getHyperscapeAgentQuickActions(agentId) {
1207
- return this.fetch(`/api/apps/hyperscape/agents/${encodeURIComponent(agentId)}/quick-actions`);
1208
- }
1209
- // Skills Marketplace
1210
- async searchSkillsMarketplace(query, installed, limit) {
1211
- const params = new URLSearchParams({
1212
- q: query,
1213
- installed: String(installed),
1214
- limit: String(limit),
1215
- });
1216
- return this.fetch(`/api/skills/marketplace/search?${params}`);
1217
- }
1218
- async getSkillsMarketplaceConfig() {
1219
- return this.fetch("/api/skills/marketplace/config");
1220
- }
1221
- async updateSkillsMarketplaceConfig(apiKey) {
1222
- return this.fetch("/api/skills/marketplace/config", {
1223
- method: "PUT",
1224
- body: JSON.stringify({ apiKey }),
1225
- });
1226
- }
1227
- async installMarketplaceSkill(data) {
1228
- await this.fetch("/api/skills/marketplace/install", {
1229
- method: "POST",
1230
- body: JSON.stringify(data),
1231
- });
1232
- }
1233
- async uninstallMarketplaceSkill(skillId, autoRefresh) {
1234
- await this.fetch("/api/skills/marketplace/uninstall", {
1235
- method: "POST",
1236
- body: JSON.stringify({ id: skillId, autoRefresh }),
1237
- });
1238
- }
1239
- async updateSkill(skillId, enabled) {
1240
- return this.fetch(`/api/skills/${encodeURIComponent(skillId)}`, {
1241
- method: "PUT",
1242
- body: JSON.stringify({ enabled }),
1243
- });
1244
- }
1245
- // ── Skill CRUD & Security ────────────────────────────────────────────────
1246
- async createSkill(name, description) {
1247
- return this.fetch("/api/skills/create", {
1248
- method: "POST",
1249
- body: JSON.stringify({ name, description }),
1250
- });
1251
- }
1252
- async openSkill(id) {
1253
- return this.fetch(`/api/skills/${encodeURIComponent(id)}/open`, {
1254
- method: "POST",
1255
- });
1256
- }
1257
- async getSkillSource(id) {
1258
- return this.fetch(`/api/skills/${encodeURIComponent(id)}/source`);
1259
- }
1260
- async saveSkillSource(id, content) {
1261
- return this.fetch(`/api/skills/${encodeURIComponent(id)}/source`, {
1262
- method: "PUT",
1263
- body: JSON.stringify({ content }),
1264
- });
1265
- }
1266
- async deleteSkill(id) {
1267
- return this.fetch(`/api/skills/${encodeURIComponent(id)}`, {
1268
- method: "DELETE",
1269
- });
1270
- }
1271
- async getSkillScanReport(id) {
1272
- return this.fetch(`/api/skills/${encodeURIComponent(id)}/scan`);
1273
- }
1274
- async acknowledgeSkill(id, enable) {
1275
- return this.fetch(`/api/skills/${encodeURIComponent(id)}/acknowledge`, {
1276
- method: "POST",
1277
- body: JSON.stringify({ enable }),
1278
- });
1279
- }
1280
- // Workbench
1281
- async getWorkbenchOverview() {
1282
- return this.fetch("/api/workbench/overview");
1283
- }
1284
- async listWorkbenchTasks() {
1285
- return this.fetch("/api/workbench/tasks");
1286
- }
1287
- async getWorkbenchTask(taskId) {
1288
- return this.fetch(`/api/workbench/tasks/${encodeURIComponent(taskId)}`);
1289
- }
1290
- async createWorkbenchTask(data) {
1291
- return this.fetch("/api/workbench/tasks", {
1292
- method: "POST",
1293
- body: JSON.stringify(data),
1294
- });
1295
- }
1296
- async updateWorkbenchTask(taskId, data) {
1297
- return this.fetch(`/api/workbench/tasks/${encodeURIComponent(taskId)}`, {
1298
- method: "PUT",
1299
- body: JSON.stringify(data),
1300
- });
1301
- }
1302
- async deleteWorkbenchTask(taskId) {
1303
- return this.fetch(`/api/workbench/tasks/${encodeURIComponent(taskId)}`, {
1304
- method: "DELETE",
1305
- });
1306
- }
1307
- async listWorkbenchTodos() {
1308
- return this.fetch("/api/workbench/todos");
1309
- }
1310
- async getWorkbenchTodo(todoId) {
1311
- return this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}`);
1312
- }
1313
- async createWorkbenchTodo(data) {
1314
- return this.fetch("/api/workbench/todos", {
1315
- method: "POST",
1316
- body: JSON.stringify(data),
1317
- });
1318
- }
1319
- async updateWorkbenchTodo(todoId, data) {
1320
- return this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}`, {
1321
- method: "PUT",
1322
- body: JSON.stringify(data),
1323
- });
1324
- }
1325
- async setWorkbenchTodoCompleted(todoId, isCompleted) {
1326
- await this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}/complete`, {
1327
- method: "POST",
1328
- body: JSON.stringify({ isCompleted }),
1329
- });
1330
- }
1331
- async deleteWorkbenchTodo(todoId) {
1332
- return this.fetch(`/api/workbench/todos/${encodeURIComponent(todoId)}`, {
1333
- method: "DELETE",
1334
- });
1335
- }
1336
- // Registry
1337
- async refreshRegistry() {
1338
- await this.fetch("/api/apps/refresh", { method: "POST" });
1339
- }
1340
- // Knowledge
1341
- async getKnowledgeStats() {
1342
- return this.fetch("/api/knowledge/stats");
1343
- }
1344
- async listKnowledgeDocuments(options) {
1345
- const params = new URLSearchParams();
1346
- if (options?.limit)
1347
- params.set("limit", String(options.limit));
1348
- if (options?.offset)
1349
- params.set("offset", String(options.offset));
1350
- const query = params.toString();
1351
- return this.fetch(`/api/knowledge/documents${query ? `?${query}` : ""}`);
1352
- }
1353
- async getKnowledgeDocument(documentId) {
1354
- return this.fetch(`/api/knowledge/documents/${encodeURIComponent(documentId)}`);
1355
- }
1356
- async deleteKnowledgeDocument(documentId) {
1357
- return this.fetch(`/api/knowledge/documents/${encodeURIComponent(documentId)}`, {
1358
- method: "DELETE",
1359
- });
1360
- }
1361
- async uploadKnowledgeDocument(data) {
1362
- return this.fetch("/api/knowledge/documents", {
1363
- method: "POST",
1364
- body: JSON.stringify(data),
1365
- });
1366
- }
1367
- async uploadKnowledgeDocumentsBulk(data) {
1368
- return this.fetch("/api/knowledge/documents/bulk", {
1369
- method: "POST",
1370
- body: JSON.stringify(data),
1371
- });
1372
- }
1373
- async uploadKnowledgeFromUrl(url, metadata) {
1374
- return this.fetch("/api/knowledge/documents/url", {
1375
- method: "POST",
1376
- body: JSON.stringify({ url, metadata }),
1377
- });
1378
- }
1379
- async searchKnowledge(query, options) {
1380
- const params = new URLSearchParams({ q: query });
1381
- if (options?.threshold !== undefined)
1382
- params.set("threshold", String(options.threshold));
1383
- if (options?.limit !== undefined)
1384
- params.set("limit", String(options.limit));
1385
- return this.fetch(`/api/knowledge/search?${params}`);
1386
- }
1387
- async getKnowledgeFragments(documentId) {
1388
- return this.fetch(`/api/knowledge/fragments/${encodeURIComponent(documentId)}`);
1389
- }
1390
- // Memory commands
1391
- async rememberMemory(text) {
1392
- return this.fetch("/api/memory/remember", {
1393
- method: "POST",
1394
- body: JSON.stringify({ text }),
1395
- });
1396
- }
1397
- async searchMemory(query, options) {
1398
- const params = new URLSearchParams({ q: query });
1399
- if (options?.limit !== undefined)
1400
- params.set("limit", String(options.limit));
1401
- return this.fetch(`/api/memory/search?${params}`);
1402
- }
1403
- async quickContext(query, options) {
1404
- const params = new URLSearchParams({ q: query });
1405
- if (options?.limit !== undefined)
1406
- params.set("limit", String(options.limit));
1407
- return this.fetch(`/api/context/quick?${params}`);
1408
- }
1409
- // MCP
1410
- async getMcpConfig() {
1411
- return this.fetch("/api/mcp/config");
1412
- }
1413
- async getMcpStatus() {
1414
- return this.fetch("/api/mcp/status");
1415
- }
1416
- async searchMcpMarketplace(query, limit) {
1417
- const params = new URLSearchParams({ q: query, limit: String(limit) });
1418
- return this.fetch(`/api/mcp/marketplace/search?${params}`);
1419
- }
1420
- async getMcpServerDetails(name) {
1421
- return this.fetch(`/api/mcp/marketplace/${encodeURIComponent(name)}`);
1422
- }
1423
- async addMcpServer(name, config) {
1424
- await this.fetch("/api/mcp/servers", {
1425
- method: "POST",
1426
- body: JSON.stringify({ name, config }),
1427
- });
1428
- }
1429
- async removeMcpServer(name) {
1430
- await this.fetch(`/api/mcp/servers/${encodeURIComponent(name)}`, {
1431
- method: "DELETE",
1432
- });
1433
- }
1434
- // Share Ingest
1435
- async ingestShare(payload) {
1436
- return this.fetch("/api/ingest/share", {
1437
- method: "POST",
1438
- body: JSON.stringify(payload),
1439
- });
1440
- }
1441
- async consumeShareIngest() {
1442
- return this.fetch("/api/share/consume", { method: "POST" });
1443
- }
1444
- // WebSocket
1445
- connectWs() {
1446
- if (this.ws?.readyState === WebSocket.OPEN)
1447
- return;
1448
- let host;
1449
- if (this.baseUrl) {
1450
- host = new URL(this.baseUrl).host;
1451
- }
1452
- else {
1453
- // In non-HTTP environments (electrobun://, file://, etc.)
1454
- // window.location.host may be empty or a non-routable placeholder like "-".
1455
- const loc = window.location;
1456
- if (loc.protocol !== "http:" && loc.protocol !== "https:")
1457
- return;
1458
- host = loc.host;
1459
- }
1460
- if (!host)
1461
- return;
1462
- const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
1463
- let url = `${protocol}//${host}/ws`;
1464
- const params = new URLSearchParams({ clientId: this.clientId });
1465
- const token = this.apiToken;
1466
- if (token)
1467
- params.set("token", token);
1468
- url += `?${params.toString()}`;
1469
- this.ws = new WebSocket(url);
1470
- this.ws.onopen = () => {
1471
- this.backoffMs = 500;
1472
- // Reset connection state on successful connection
1473
- this.reconnectAttempt = 0;
1474
- this.disconnectedAt = null;
1475
- this.connectionState = "connected";
1476
- this.emitConnectionStateChange();
1477
- // Notify listeners when the WS reconnects (not on the first connect)
1478
- // so they can re-hydrate state that may have been lost during the gap.
1479
- if (this.wsHasConnectedOnce) {
1480
- const handlers = this.wsHandlers.get("ws-reconnected");
1481
- if (handlers) {
1482
- for (const handler of handlers) {
1483
- handler({ type: "ws-reconnected" });
1484
- }
1485
- }
1486
- }
1487
- this.wsHasConnectedOnce = true;
1488
- if (this.wsSendQueue.length > 0 &&
1489
- this.ws?.readyState === WebSocket.OPEN) {
1490
- const pending = this.wsSendQueue;
1491
- this.wsSendQueue = [];
1492
- for (let i = 0; i < pending.length; i++) {
1493
- if (this.ws?.readyState !== WebSocket.OPEN) {
1494
- this.wsSendQueue = pending.slice(i).concat(this.wsSendQueue);
1495
- break;
1496
- }
1497
- try {
1498
- this.ws.send(pending[i]);
1499
- }
1500
- catch {
1501
- this.wsSendQueue = pending.slice(i).concat(this.wsSendQueue);
1502
- break;
1503
- }
1504
- }
1505
- }
1506
- };
1507
- this.ws.onmessage = (event) => {
1508
- try {
1509
- const data = JSON.parse(event.data);
1510
- const type = data.type;
1511
- const handlers = this.wsHandlers.get(type);
1512
- if (handlers) {
1513
- for (const handler of handlers) {
1514
- handler(data);
1515
- }
1516
- }
1517
- // Also fire "all" handlers
1518
- const allHandlers = this.wsHandlers.get("*");
1519
- if (allHandlers) {
1520
- for (const handler of allHandlers) {
1521
- handler(data);
1522
- }
1523
- }
1524
- }
1525
- catch {
1526
- // ignore parse errors
1527
- }
1528
- };
1529
- this.ws.onclose = () => {
1530
- this.ws = null;
1531
- // Track disconnection time if not already set
1532
- if (this.disconnectedAt === null) {
1533
- this.disconnectedAt = Date.now();
1534
- }
1535
- this.reconnectAttempt++;
1536
- // Update state based on attempt count
1537
- if (this.reconnectAttempt >= this.maxReconnectAttempts) {
1538
- this.connectionState = "failed";
1539
- }
1540
- else {
1541
- this.connectionState = "reconnecting";
1542
- }
1543
- this.emitConnectionStateChange();
1544
- this.scheduleReconnect();
1545
- };
1546
- this.ws.onerror = () => {
1547
- // close handler will fire
1548
- };
1549
- }
1550
- scheduleReconnect() {
1551
- if (this.reconnectTimer)
1552
- return;
1553
- // Stop reconnecting if we've hit max attempts
1554
- if (this.reconnectAttempt >= this.maxReconnectAttempts) {
1555
- return;
1556
- }
1557
- this.reconnectTimer = setTimeout(() => {
1558
- this.reconnectTimer = null;
1559
- this.connectWs();
1560
- }, this.backoffMs);
1561
- this.backoffMs = Math.min(this.backoffMs * 1.5, 10000);
1562
- }
1563
- emitConnectionStateChange() {
1564
- const state = this.getConnectionState();
1565
- for (const listener of this.connectionStateListeners) {
1566
- try {
1567
- listener(state);
1568
- }
1569
- catch {
1570
- // ignore listener errors
1571
- }
1572
- }
1573
- }
1574
- /** Get the current WebSocket connection state. */
1575
- getConnectionState() {
1576
- return {
1577
- state: this.connectionState,
1578
- reconnectAttempt: this.reconnectAttempt,
1579
- maxReconnectAttempts: this.maxReconnectAttempts,
1580
- disconnectedAt: this.disconnectedAt,
1581
- };
1582
- }
1583
- /** Subscribe to connection state changes. Returns an unsubscribe function. */
1584
- onConnectionStateChange(listener) {
1585
- this.connectionStateListeners.add(listener);
1586
- return () => {
1587
- this.connectionStateListeners.delete(listener);
1588
- };
1589
- }
1590
- /** Reset connection state and restart reconnection attempts. */
1591
- resetConnection() {
1592
- this.reconnectAttempt = 0;
1593
- this.disconnectedAt = null;
1594
- this.connectionState = "disconnected";
1595
- if (this.reconnectTimer) {
1596
- clearTimeout(this.reconnectTimer);
1597
- this.reconnectTimer = null;
1598
- }
1599
- this.backoffMs = 500;
1600
- this.emitConnectionStateChange();
1601
- this.connectWs();
1602
- }
1603
- /** Send an arbitrary JSON message over the WebSocket connection. */
1604
- sendWsMessage(data) {
1605
- const payload = JSON.stringify(data);
1606
- if (this.ws?.readyState === WebSocket.OPEN) {
1607
- this.ws.send(payload);
1608
- return;
1609
- }
1610
- // Keep only the newest active-conversation update while disconnected.
1611
- if (data.type === "active-conversation") {
1612
- this.wsSendQueue = this.wsSendQueue.filter((queued) => {
1613
- try {
1614
- const parsed = JSON.parse(queued);
1615
- return parsed.type !== "active-conversation";
1616
- }
1617
- catch {
1618
- return true;
1619
- }
1620
- });
1621
- }
1622
- if (this.wsSendQueue.length >= this.wsSendQueueLimit) {
1623
- this.wsSendQueue.shift();
1624
- }
1625
- this.wsSendQueue.push(payload);
1626
- if (!this.ws || this.ws.readyState === WebSocket.CLOSED) {
1627
- this.connectWs();
1628
- }
1629
- }
1630
- onWsEvent(type, handler) {
1631
- if (!this.wsHandlers.has(type)) {
1632
- this.wsHandlers.set(type, new Set());
1633
- }
1634
- this.wsHandlers.get(type)?.add(handler);
1635
- return () => {
1636
- this.wsHandlers.get(type)?.delete(handler);
1637
- };
1638
- }
1639
- normalizeAssistantText(text) {
1640
- const stripped = stripAssistantStageDirections(text);
1641
- const trimmed = stripped.trim();
1642
- if (trimmed.length === 0) {
1643
- if (text.trim().length === 0 ||
1644
- /^\(?no response\)?$/i.test(text.trim())) {
1645
- return GENERIC_NO_RESPONSE_TEXT;
1646
- }
1647
- return "";
1648
- }
1649
- if (/^\(?no response\)?$/i.test(trimmed)) {
1650
- return GENERIC_NO_RESPONSE_TEXT;
1651
- }
1652
- return trimmed;
1653
- }
1654
- normalizeGreetingText(text) {
1655
- const stripped = stripAssistantStageDirections(text);
1656
- const trimmed = stripped.trim();
1657
- if (trimmed.length === 0 || /^\(?no response\)?$/i.test(trimmed)) {
1658
- return "";
1659
- }
1660
- return trimmed;
1661
- }
1662
- normalizeConversationMessage(message) {
1663
- if (message.role !== "assistant")
1664
- return message;
1665
- const text = this.normalizeAssistantText(message.text);
1666
- return text === message.text ? message : { ...message, text };
1667
- }
1668
- async streamChatEndpoint(path, text, onToken, channelType = "DM", signal, images, conversationMode) {
1669
- const res = await this.rawRequest(path, {
1670
- method: "POST",
1671
- headers: {
1672
- "Content-Type": "application/json",
1673
- Accept: "text/event-stream",
1674
- },
1675
- body: JSON.stringify({
1676
- text,
1677
- channelType,
1678
- ...(images?.length ? { images } : {}),
1679
- ...(conversationMode ? { conversationMode } : {}),
1680
- }),
1681
- signal,
1682
- });
1683
- if (!res.body) {
1684
- throw new Error("Streaming not supported by this browser");
1685
- }
1686
- const decoder = new TextDecoder();
1687
- const reader = res.body.getReader();
1688
- let buffer = "";
1689
- let fullText = "";
1690
- let doneText = null;
1691
- let doneAgentName = null;
1692
- let doneUsage;
1693
- let receivedDone = false;
1694
- const findSseEventBreak = (chunkBuffer) => {
1695
- const lfBreak = chunkBuffer.indexOf("\n\n");
1696
- const crlfBreak = chunkBuffer.indexOf("\r\n\r\n");
1697
- if (lfBreak === -1 && crlfBreak === -1)
1698
- return null;
1699
- if (lfBreak === -1)
1700
- return { index: crlfBreak, length: 4 };
1701
- if (crlfBreak === -1)
1702
- return { index: lfBreak, length: 2 };
1703
- return lfBreak < crlfBreak
1704
- ? { index: lfBreak, length: 2 }
1705
- : { index: crlfBreak, length: 4 };
1706
- };
1707
- const parseDataLine = (line) => {
1708
- const payload = line.startsWith("data:") ? line.slice(5).trim() : "";
1709
- if (!payload)
1710
- return;
1711
- let parsed;
1712
- try {
1713
- parsed = JSON.parse(payload);
1714
- }
1715
- catch {
1716
- return;
1717
- }
1718
- if (parsed.type === "token") {
1719
- const chunk = parsed.text ?? "";
1720
- const nextFullText = typeof parsed.fullText === "string"
1721
- ? parsed.fullText
1722
- : chunk
1723
- ? mergeStreamingText(fullText, chunk)
1724
- : fullText;
1725
- if (nextFullText === fullText)
1726
- return;
1727
- fullText = nextFullText;
1728
- onToken(chunk, fullText);
1729
- return;
1730
- }
1731
- if (parsed.type === "done") {
1732
- receivedDone = true;
1733
- if (typeof parsed.fullText === "string")
1734
- doneText = parsed.fullText;
1735
- if (typeof parsed.agentName === "string" && parsed.agentName.trim()) {
1736
- doneAgentName = parsed.agentName;
1737
- }
1738
- if (parsed.usage) {
1739
- doneUsage = {
1740
- promptTokens: parsed.usage.promptTokens ?? 0,
1741
- completionTokens: parsed.usage.completionTokens ?? 0,
1742
- totalTokens: parsed.usage.totalTokens ?? 0,
1743
- model: parsed.usage.model,
1744
- };
1745
- }
1746
- return;
1747
- }
1748
- if (parsed.type === "error") {
1749
- throw new Error(parsed.message ?? "generation failed");
1750
- }
1751
- // Backward compatibility with legacy stream payloads: { text: "..." }
1752
- if (parsed.text) {
1753
- fullText = mergeStreamingText(fullText, parsed.text);
1754
- onToken(parsed.text, fullText);
1755
- }
1756
- };
1757
- while (true) {
1758
- let done = false;
1759
- let value;
1760
- try {
1761
- ({ done, value } = await reader.read());
1762
- }
1763
- catch (streamErr) {
1764
- console.warn("[api-client] SSE stream interrupted:", streamErr);
1765
- break;
1766
- }
1767
- if (done || !value)
1768
- break;
1769
- buffer += decoder.decode(value, { stream: true });
1770
- let eventBreak = findSseEventBreak(buffer);
1771
- while (eventBreak) {
1772
- const rawEvent = buffer.slice(0, eventBreak.index);
1773
- buffer = buffer.slice(eventBreak.index + eventBreak.length);
1774
- for (const line of rawEvent.split(/\r?\n/)) {
1775
- if (!line.startsWith("data:"))
1776
- continue;
1777
- parseDataLine(line);
1778
- }
1779
- eventBreak = findSseEventBreak(buffer);
1780
- }
1781
- }
1782
- if (buffer.trim()) {
1783
- for (const line of buffer.split(/\r?\n/)) {
1784
- if (line.startsWith("data:"))
1785
- parseDataLine(line);
1786
- }
1787
- }
1788
- const resolvedText = this.normalizeAssistantText(doneText ?? fullText);
1789
- return {
1790
- text: resolvedText,
1791
- agentName: doneAgentName ?? "Milady",
1792
- completed: receivedDone,
1793
- ...(doneUsage ? { usage: doneUsage } : {}),
1794
- };
1795
- }
1796
- /**
1797
- * Send a chat message via the REST endpoint (reliable — does not depend on
1798
- * a WebSocket connection). Returns the agent's response text.
1799
- */
1800
- async sendChatRest(text, channelType = "DM", conversationMode) {
1801
- const response = await this.fetch("/api/chat", {
1802
- method: "POST",
1803
- body: JSON.stringify({
1804
- text,
1805
- channelType,
1806
- ...(conversationMode ? { conversationMode } : {}),
1807
- }),
1808
- });
1809
- return {
1810
- ...response,
1811
- text: this.normalizeAssistantText(response.text),
1812
- };
1813
- }
1814
- async sendChatStream(text, onToken, channelType = "DM", signal, conversationMode) {
1815
- return this.streamChatEndpoint("/api/chat/stream", text, onToken, channelType, signal, undefined, conversationMode);
1816
- }
1817
- // Conversations
1818
- async listConversations() {
1819
- return this.fetch("/api/conversations");
1820
- }
1821
- async createConversation(title, options) {
1822
- const response = await this.fetch("/api/conversations", {
1823
- method: "POST",
1824
- body: JSON.stringify({
1825
- title,
1826
- ...(options?.bootstrapGreeting === true
1827
- ? { bootstrapGreeting: true }
1828
- : {}),
1829
- ...(typeof options?.lang === "string" && options.lang.trim()
1830
- ? { lang: options.lang.trim() }
1831
- : {}),
1832
- }),
1833
- });
1834
- if (!response.greeting) {
1835
- return response;
1836
- }
1837
- return {
1838
- ...response,
1839
- greeting: {
1840
- ...response.greeting,
1841
- text: this.normalizeGreetingText(response.greeting.text),
1842
- },
1843
- };
1844
- }
1845
- async getConversationMessages(id) {
1846
- const response = await this.fetch(`/api/conversations/${encodeURIComponent(id)}/messages`);
1847
- return {
1848
- messages: response.messages.map((message) => this.normalizeConversationMessage(message)),
1849
- };
1850
- }
1851
- async truncateConversationMessages(id, messageId, options) {
1852
- return this.fetch(`/api/conversations/${encodeURIComponent(id)}/messages/truncate`, {
1853
- method: "POST",
1854
- body: JSON.stringify({
1855
- messageId,
1856
- inclusive: options?.inclusive === true,
1857
- }),
1858
- });
1859
- }
1860
- async sendConversationMessage(id, text, channelType = "DM", images, conversationMode) {
1861
- const response = await this.fetch(`/api/conversations/${encodeURIComponent(id)}/messages`, {
1862
- method: "POST",
1863
- body: JSON.stringify({
1864
- text,
1865
- channelType,
1866
- ...(images?.length ? { images } : {}),
1867
- ...(conversationMode ? { conversationMode } : {}),
1868
- }),
1869
- });
1870
- return {
1871
- ...response,
1872
- text: this.normalizeAssistantText(response.text),
1873
- };
1874
- }
1875
- async sendConversationMessageStream(id, text, onToken, channelType = "DM", signal, images, conversationMode) {
1876
- return this.streamChatEndpoint(`/api/conversations/${encodeURIComponent(id)}/messages/stream`, text, onToken, channelType, signal, images, conversationMode);
1877
- }
1878
- async requestGreeting(id, lang) {
1879
- const qs = lang ? `?lang=${encodeURIComponent(lang)}` : "";
1880
- const response = await this.fetch(`/api/conversations/${encodeURIComponent(id)}/greeting${qs}`, {
1881
- method: "POST",
1882
- });
1883
- return {
1884
- ...response,
1885
- text: this.normalizeGreetingText(response.text),
1886
- };
1887
- }
1888
- async renameConversation(id, title) {
1889
- return this.fetch(`/api/conversations/${encodeURIComponent(id)}`, {
1890
- method: "PATCH",
1891
- body: JSON.stringify({ title }),
1892
- });
1893
- }
1894
- async deleteConversation(id) {
1895
- return this.fetch(`/api/conversations/${encodeURIComponent(id)}`, {
1896
- method: "DELETE",
1897
- });
1898
- }
1899
- /** @deprecated Prefer {@link sendChatRest} — WebSocket chat may silently drop messages. */
1900
- sendChat(text) {
1901
- if (this.ws?.readyState === WebSocket.OPEN) {
1902
- this.ws.send(JSON.stringify({ type: "chat", text }));
1903
- }
1904
- }
1905
- // ── Database API ──────────────────────────────────────────────────────
1906
- async getDatabaseStatus() {
1907
- return this.fetch("/api/database/status");
1908
- }
1909
- async getDatabaseConfig() {
1910
- return this.fetch("/api/database/config");
1911
- }
1912
- async saveDatabaseConfig(config) {
1913
- return this.fetch("/api/database/config", {
1914
- method: "PUT",
1915
- body: JSON.stringify(config),
1916
- });
1917
- }
1918
- async testDatabaseConnection(creds) {
1919
- return this.fetch("/api/database/test", {
1920
- method: "POST",
1921
- body: JSON.stringify(creds),
1922
- });
1923
- }
1924
- async getDatabaseTables() {
1925
- return this.fetch("/api/database/tables");
1926
- }
1927
- async getDatabaseRows(table, opts) {
1928
- const params = new URLSearchParams();
1929
- if (opts?.offset != null)
1930
- params.set("offset", String(opts.offset));
1931
- if (opts?.limit != null)
1932
- params.set("limit", String(opts.limit));
1933
- if (opts?.sort)
1934
- params.set("sort", opts.sort);
1935
- if (opts?.order)
1936
- params.set("order", opts.order);
1937
- if (opts?.search)
1938
- params.set("search", opts.search);
1939
- const qs = params.toString();
1940
- return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows${qs ? `?${qs}` : ""}`);
1941
- }
1942
- async insertDatabaseRow(table, data) {
1943
- return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows`, {
1944
- method: "POST",
1945
- body: JSON.stringify({ data }),
1946
- });
1947
- }
1948
- async updateDatabaseRow(table, where, data) {
1949
- return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows`, {
1950
- method: "PUT",
1951
- body: JSON.stringify({ where, data }),
1952
- });
1953
- }
1954
- async deleteDatabaseRow(table, where) {
1955
- return this.fetch(`/api/database/tables/${encodeURIComponent(table)}/rows`, {
1956
- method: "DELETE",
1957
- body: JSON.stringify({ where }),
1958
- });
1959
- }
1960
- async executeDatabaseQuery(sql, readOnly = true) {
1961
- return this.fetch("/api/database/query", {
1962
- method: "POST",
1963
- body: JSON.stringify({ sql, readOnly }),
1964
- });
1965
- }
1966
- // ── Trajectories ─────────────────────────────────────────────────────
1967
- async getTrajectories(options) {
1968
- const params = new URLSearchParams();
1969
- if (options?.limit)
1970
- params.set("limit", String(options.limit));
1971
- if (options?.offset)
1972
- params.set("offset", String(options.offset));
1973
- if (options?.source)
1974
- params.set("source", options.source);
1975
- if (options?.status)
1976
- params.set("status", options.status);
1977
- if (options?.startDate)
1978
- params.set("startDate", options.startDate);
1979
- if (options?.endDate)
1980
- params.set("endDate", options.endDate);
1981
- if (options?.search)
1982
- params.set("search", options.search);
1983
- const query = params.toString();
1984
- return this.fetch(`/api/trajectories${query ? `?${query}` : ""}`);
1985
- }
1986
- async getTrajectoryDetail(trajectoryId) {
1987
- return this.fetch(`/api/trajectories/${encodeURIComponent(trajectoryId)}`);
1988
- }
1989
- async getTrajectoryStats() {
1990
- return this.fetch("/api/trajectories/stats");
1991
- }
1992
- async getTrajectoryConfig() {
1993
- return this.fetch("/api/trajectories/config");
1994
- }
1995
- async updateTrajectoryConfig(config) {
1996
- return this.fetch("/api/trajectories/config", {
1997
- method: "PUT",
1998
- body: JSON.stringify(config),
1999
- });
2000
- }
2001
- async exportTrajectories(options) {
2002
- const res = await this.rawRequest("/api/trajectories/export", {
2003
- method: "POST",
2004
- headers: {
2005
- "Content-Type": "application/json",
2006
- },
2007
- body: JSON.stringify(options),
2008
- });
2009
- return res.blob();
2010
- }
2011
- async deleteTrajectories(trajectoryIds) {
2012
- return this.fetch("/api/trajectories", {
2013
- method: "DELETE",
2014
- body: JSON.stringify({ trajectoryIds }),
2015
- });
2016
- }
2017
- async clearAllTrajectories() {
2018
- return this.fetch("/api/trajectories", {
2019
- method: "DELETE",
2020
- body: JSON.stringify({ clearAll: true }),
2021
- });
2022
- }
2023
- // ═══════════════════════════════════════════════════════════════════════
2024
- // System Permissions
2025
- // ═══════════════════════════════════════════════════════════════════════
2026
- /**
2027
- * Get all system permission states.
2028
- */
2029
- async getPermissions() {
2030
- return this.fetch("/api/permissions");
2031
- }
2032
- /**
2033
- * Get a single permission state.
2034
- */
2035
- async getPermission(id) {
2036
- return this.fetch(`/api/permissions/${id}`);
2037
- }
2038
- /**
2039
- * Request a specific permission (triggers OS prompt if applicable).
2040
- */
2041
- async requestPermission(id) {
2042
- return this.fetch(`/api/permissions/${id}/request`, { method: "POST" });
2043
- }
2044
- /**
2045
- * Open system settings for a specific permission.
2046
- */
2047
- async openPermissionSettings(id) {
2048
- await this.fetch(`/api/permissions/${id}/open-settings`, {
2049
- method: "POST",
2050
- });
2051
- }
2052
- /**
2053
- * Refresh all permission states from the OS.
2054
- */
2055
- async refreshPermissions() {
2056
- return this.fetch("/api/permissions/refresh", { method: "POST" });
2057
- }
2058
- /**
2059
- * Enable or disable shell access.
2060
- */
2061
- async setShellEnabled(enabled) {
2062
- return this.fetch("/api/permissions/shell", {
2063
- method: "PUT",
2064
- body: JSON.stringify({ enabled }),
2065
- });
2066
- }
2067
- /**
2068
- * Get shell enabled status.
2069
- */
2070
- async isShellEnabled() {
2071
- const result = await this.fetch("/api/permissions/shell");
2072
- return result.enabled;
2073
- }
2074
- /**
2075
- * Get agent automation permission mode.
2076
- */
2077
- async getAgentAutomationMode() {
2078
- return this.fetch("/api/permissions/automation-mode");
2079
- }
2080
- /**
2081
- * Set agent automation permission mode.
2082
- */
2083
- async setAgentAutomationMode(mode) {
2084
- return this.fetch("/api/permissions/automation-mode", {
2085
- method: "PUT",
2086
- body: JSON.stringify({ mode }),
2087
- });
2088
- }
2089
- /**
2090
- * Get wallet trade execution permission mode.
2091
- */
2092
- async getTradePermissionMode() {
2093
- return this.fetch("/api/permissions/trade-mode");
2094
- }
2095
- /**
2096
- * Set wallet trade execution permission mode.
2097
- */
2098
- async setTradePermissionMode(mode) {
2099
- return this.fetch("/api/permissions/trade-mode", {
2100
- method: "PUT",
2101
- body: JSON.stringify({ mode }),
2102
- });
2103
- }
2104
- disconnectWs() {
2105
- if (this.reconnectTimer) {
2106
- clearTimeout(this.reconnectTimer);
2107
- this.reconnectTimer = null;
2108
- }
2109
- this.ws?.close();
2110
- this.ws = null;
2111
- this.wsSendQueue = [];
2112
- // Reset connection state on intentional disconnect
2113
- this.reconnectAttempt = 0;
2114
- this.disconnectedAt = null;
2115
- this.connectionState = "disconnected";
2116
- this.emitConnectionStateChange();
2117
- }
2118
- // ═══════════════════════════════════════════════════════════════════════
2119
- // ERC-8004 Registry
2120
- // ═══════════════════════════════════════════════════════════════════════
2121
- async getRegistryStatus() {
2122
- return this.fetch("/api/registry/status");
2123
- }
2124
- async registerAgent(params) {
2125
- return this.fetch("/api/registry/register", {
2126
- method: "POST",
2127
- body: JSON.stringify(params ?? {}),
2128
- });
2129
- }
2130
- async updateRegistryTokenURI(tokenURI) {
2131
- return this.fetch("/api/registry/update-uri", {
2132
- method: "POST",
2133
- body: JSON.stringify({ tokenURI }),
2134
- });
2135
- }
2136
- async syncRegistryProfile(params) {
2137
- return this.fetch("/api/registry/sync", {
2138
- method: "POST",
2139
- body: JSON.stringify(params ?? {}),
2140
- });
2141
- }
2142
- async getRegistryConfig() {
2143
- return this.fetch("/api/registry/config");
2144
- }
2145
- // ═══════════════════════════════════════════════════════════════════════
2146
- // Drop / Mint
2147
- // ═══════════════════════════════════════════════════════════════════════
2148
- async getDropStatus() {
2149
- return this.fetch("/api/drop/status");
2150
- }
2151
- async mintAgent(params) {
2152
- return this.fetch("/api/drop/mint", {
2153
- method: "POST",
2154
- body: JSON.stringify(params ?? {}),
2155
- });
2156
- }
2157
- async mintAgentWhitelist(params) {
2158
- return this.fetch("/api/drop/mint-whitelist", {
2159
- method: "POST",
2160
- body: JSON.stringify(params),
2161
- });
2162
- }
2163
- // ═══════════════════════════════════════════════════════════════════════
2164
- // Whitelist
2165
- // ═══════════════════════════════════════════════════════════════════════
2166
- async getWhitelistStatus() {
2167
- return this.fetch("/api/whitelist/status");
2168
- }
2169
- async generateTwitterVerificationMessage() {
2170
- return this.fetch("/api/whitelist/twitter/message", { method: "POST" });
2171
- }
2172
- async verifyTwitter(tweetUrl) {
2173
- return this.fetch("/api/whitelist/twitter/verify", {
2174
- method: "POST",
2175
- body: JSON.stringify({ tweetUrl }),
2176
- });
2177
- }
2178
- // ── Custom Actions ─────────────────────────────────────────────────────
2179
- async listCustomActions() {
2180
- const data = await this.fetch("/api/custom-actions");
2181
- return data.actions;
2182
- }
2183
- async createCustomAction(action) {
2184
- const data = await this.fetch("/api/custom-actions", { method: "POST", body: JSON.stringify(action) });
2185
- return data.action;
2186
- }
2187
- async updateCustomAction(id, action) {
2188
- const data = await this.fetch(`/api/custom-actions/${encodeURIComponent(id)}`, { method: "PUT", body: JSON.stringify(action) });
2189
- return data.action;
2190
- }
2191
- async deleteCustomAction(id) {
2192
- await this.fetch(`/api/custom-actions/${encodeURIComponent(id)}`, {
2193
- method: "DELETE",
2194
- });
2195
- }
2196
- async testCustomAction(id, params) {
2197
- return this.fetch(`/api/custom-actions/${encodeURIComponent(id)}/test`, {
2198
- method: "POST",
2199
- body: JSON.stringify({ params }),
2200
- });
2201
- }
2202
- async generateCustomAction(prompt) {
2203
- return this.fetch("/api/custom-actions/generate", {
2204
- method: "POST",
2205
- body: JSON.stringify({ prompt }),
2206
- });
2207
- }
2208
- // ═══════════════════════════════════════════════════════════════════════
2209
- // WhatsApp Pairing
2210
- // ═══════════════════════════════════════════════════════════════════════
2211
- async getWhatsAppStatus(accountId = "default") {
2212
- return this.fetch(`/api/whatsapp/status?accountId=${encodeURIComponent(accountId)}`);
2213
- }
2214
- async startWhatsAppPairing(accountId = "default") {
2215
- return this.fetch("/api/whatsapp/pair", {
2216
- method: "POST",
2217
- body: JSON.stringify({ accountId }),
2218
- });
2219
- }
2220
- async stopWhatsAppPairing(accountId = "default") {
2221
- return this.fetch("/api/whatsapp/pair/stop", {
2222
- method: "POST",
2223
- body: JSON.stringify({ accountId }),
2224
- });
2225
- }
2226
- async disconnectWhatsApp(accountId = "default") {
2227
- return this.fetch("/api/whatsapp/disconnect", {
2228
- method: "POST",
2229
- body: JSON.stringify({ accountId }),
2230
- });
2231
- }
2232
- // --- Bug Report ---
2233
- async checkBugReportInfo() {
2234
- return this.fetch("/api/bug-report/info");
2235
- }
2236
- async submitBugReport(report) {
2237
- return this.fetch("/api/bug-report", {
2238
- method: "POST",
2239
- body: JSON.stringify(report),
2240
- });
2241
- }
2242
- // ── Coding Agents ───────────────────────────────────────────────────
2243
- async getCodingAgentStatus() {
2244
- try {
2245
- return await this.fetch("/api/coding-agents/coordinator/status");
2246
- }
2247
- catch {
2248
- return null;
2249
- }
2250
- }
2251
- async stopCodingAgent(sessionId) {
2252
- try {
2253
- await this.fetch(`/api/coding-agents/${encodeURIComponent(sessionId)}/stop`, { method: "POST" });
2254
- return true;
2255
- }
2256
- catch {
2257
- return false;
2258
- }
2259
- }
2260
- async listCodingAgentScratchWorkspaces() {
2261
- try {
2262
- return await this.fetch("/api/coding-agents/scratch");
2263
- }
2264
- catch {
2265
- return [];
2266
- }
2267
- }
2268
- async keepCodingAgentScratchWorkspace(sessionId) {
2269
- try {
2270
- await this.fetch(`/api/coding-agents/${encodeURIComponent(sessionId)}/scratch/keep`, { method: "POST" });
2271
- return true;
2272
- }
2273
- catch {
2274
- return false;
2275
- }
2276
- }
2277
- async deleteCodingAgentScratchWorkspace(sessionId) {
2278
- try {
2279
- // Keep POST for compatibility with plugin route handlers.
2280
- await this.fetch(`/api/coding-agents/${encodeURIComponent(sessionId)}/scratch/delete`, { method: "POST" });
2281
- return true;
2282
- }
2283
- catch {
2284
- return false;
2285
- }
2286
- }
2287
- async promoteCodingAgentScratchWorkspace(sessionId, name) {
2288
- try {
2289
- const response = await this.fetch(`/api/coding-agents/${encodeURIComponent(sessionId)}/scratch/promote`, {
2290
- method: "POST",
2291
- body: JSON.stringify(name ? { name } : {}),
2292
- });
2293
- return response.scratch ?? null;
2294
- }
2295
- catch {
2296
- return null;
2297
- }
2298
- }
2299
- // ── PTY Terminal (xterm.js bridge) ─────────────────────────────────────
2300
- /** Subscribe to live PTY output for a session over WebSocket. */
2301
- subscribePtyOutput(sessionId) {
2302
- this.sendWsMessage({ type: "pty-subscribe", sessionId });
2303
- }
2304
- /** Unsubscribe from live PTY output for a session. */
2305
- unsubscribePtyOutput(sessionId) {
2306
- this.sendWsMessage({ type: "pty-unsubscribe", sessionId });
2307
- }
2308
- /** Send raw keyboard input to a PTY session. */
2309
- sendPtyInput(sessionId, data) {
2310
- this.sendWsMessage({ type: "pty-input", sessionId, data });
2311
- }
2312
- /** Resize a PTY session's terminal dimensions. */
2313
- resizePty(sessionId, cols, rows) {
2314
- this.sendWsMessage({ type: "pty-resize", sessionId, cols, rows });
2315
- }
2316
- /** Fetch buffered terminal output (raw ANSI) for xterm.js hydration. */
2317
- async getPtyBufferedOutput(sessionId) {
2318
- try {
2319
- const res = await this.fetch(`/api/coding-agents/${encodeURIComponent(sessionId)}/buffered-output`);
2320
- return res.output ?? "";
2321
- }
2322
- catch {
2323
- return "";
2324
- }
2325
- }
2326
- // ── Stream controls ─────────────────────────────────────────────────────
2327
- async streamGoLive() {
2328
- return this.fetch("/api/stream/live", { method: "POST" });
2329
- }
2330
- async streamGoOffline() {
2331
- return this.fetch("/api/stream/offline", { method: "POST" });
2332
- }
2333
- async streamStatus() {
2334
- return this.fetch("/api/stream/status");
2335
- }
2336
- async getStreamingDestinations() {
2337
- return this.fetch("/api/streaming/destinations");
2338
- }
2339
- async setActiveDestination(destinationId) {
2340
- return this.fetch("/api/streaming/destination", {
2341
- method: "POST",
2342
- body: JSON.stringify({ destinationId }),
2343
- });
2344
- }
2345
- async setStreamVolume(volume) {
2346
- return this.fetch("/api/stream/volume", {
2347
- method: "POST",
2348
- body: JSON.stringify({ volume }),
2349
- });
2350
- }
2351
- async muteStream() {
2352
- return this.fetch("/api/stream/mute", { method: "POST" });
2353
- }
2354
- async unmuteStream() {
2355
- return this.fetch("/api/stream/unmute", { method: "POST" });
2356
- }
2357
- // ── Stream voice (TTS) ───────────────────────────────────────────────
2358
- async getStreamVoice() {
2359
- return this.fetch("/api/stream/voice");
2360
- }
2361
- async saveStreamVoice(settings) {
2362
- return this.fetch("/api/stream/voice", {
2363
- method: "POST",
2364
- body: JSON.stringify(settings),
2365
- });
2366
- }
2367
- async streamVoiceSpeak(text) {
2368
- return this.fetch("/api/stream/voice/speak", {
2369
- method: "POST",
2370
- body: JSON.stringify({ text }),
2371
- });
2372
- }
2373
- // ── Overlay layout ────────────────────────────────────────────────────
2374
- async getOverlayLayout(destinationId) {
2375
- const qs = destinationId
2376
- ? `?destination=${encodeURIComponent(destinationId)}`
2377
- : "";
2378
- return this.fetch(`/api/stream/overlay-layout${qs}`);
2379
- }
2380
- async saveOverlayLayout(layout, destinationId) {
2381
- const qs = destinationId
2382
- ? `?destination=${encodeURIComponent(destinationId)}`
2383
- : "";
2384
- return this.fetch(`/api/stream/overlay-layout${qs}`, {
2385
- method: "POST",
2386
- body: JSON.stringify({ layout }),
2387
- });
2388
- }
2389
- // ── Stream source picker ──────────────────────────────────────────────
2390
- async getStreamSource() {
2391
- return this.fetch("/api/stream/source");
2392
- }
2393
- async setStreamSource(sourceType, customUrl) {
2394
- return this.fetch("/api/stream/source", {
2395
- method: "POST",
2396
- body: JSON.stringify({ sourceType, customUrl }),
2397
- });
2398
- }
2399
- // ── Stream visual settings (theme, avatar for headless parity) ────────
2400
- async getStreamSettings() {
2401
- return this.fetch("/api/stream/settings");
2402
- }
2403
- async saveStreamSettings(settings) {
2404
- return this.fetch("/api/stream/settings", {
2405
- method: "POST",
2406
- body: JSON.stringify({ settings }),
2407
- });
2408
- }
2409
- // ── Direct Eliza Cloud Auth (no local backend required) ─────────────
2410
- /**
2411
- * Initiate a direct login to Eliza Cloud without going through a local agent.
2412
- * Used in sandbox mode when no local backend exists yet.
2413
- */
2414
- async cloudLoginDirect(cloudApiBase) {
2415
- const sessionId = globalThis.crypto.randomUUID();
2416
- try {
2417
- const res = await fetch(`${cloudApiBase}/api/auth/cli-session`, {
2418
- method: "POST",
2419
- headers: { "Content-Type": "application/json" },
2420
- body: JSON.stringify({ sessionId }),
2421
- });
2422
- if (!res.ok) {
2423
- return { ok: false, error: `Login failed (${res.status})` };
2424
- }
2425
- return {
2426
- ok: true,
2427
- sessionId,
2428
- browserUrl: `${cloudApiBase}/auth/cli-login?session=${encodeURIComponent(sessionId)}`,
2429
- };
2430
- }
2431
- catch (err) {
2432
- return { ok: false, error: `Failed to reach Eliza Cloud: ${err instanceof Error ? err.message : String(err)}` };
2433
- }
2434
- }
2435
- /**
2436
- * Poll a direct Eliza Cloud login session for authentication status.
2437
- */
2438
- async cloudLoginPollDirect(cloudApiBase, sessionId) {
2439
- try {
2440
- const res = await fetch(`${cloudApiBase}/api/auth/cli-session/${encodeURIComponent(sessionId)}`);
2441
- if (!res.ok) {
2442
- if (res.status === 404) {
2443
- return { status: "expired", error: "Auth session expired or not found" };
2444
- }
2445
- return { status: "error", error: `Poll failed (${res.status})` };
2446
- }
2447
- const data = await res.json();
2448
- // Map cli-session response shape to expected poll shape
2449
- if (data.status === "authenticated" && data.apiKey) {
2450
- return { status: "authenticated", token: data.apiKey, userId: data.userId };
2451
- }
2452
- return { status: data.status ?? "pending" };
2453
- }
2454
- catch {
2455
- return { status: "error", error: "Poll request failed" };
2456
- }
2457
- }
2458
- // ── Eliza Cloud Sandbox Provisioning ───────────────────────────────
2459
- /**
2460
- * Create a sandbox agent on Eliza Cloud and provision it.
2461
- * Returns the bridge URL when provisioning completes.
2462
- *
2463
- * Flow:
2464
- * 1. POST /api/v1/milady/agents — create agent record
2465
- * 2. POST /api/v1/milady/agents/{id}/provision — start async provisioning
2466
- * 3. Poll GET /api/v1/jobs/{jobId} until completed
2467
- * 4. Return bridgeUrl from job result
2468
- */
2469
- async provisionCloudSandbox(options) {
2470
- const { cloudApiBase, authToken, name, bio, onProgress } = options;
2471
- const headers = {
2472
- "Content-Type": "application/json",
2473
- Authorization: `Bearer ${authToken}`,
2474
- };
2475
- onProgress?.("creating", "Creating agent...");
2476
- // Step 1: Create agent
2477
- const createRes = await fetch(`${cloudApiBase}/api/v1/milady/agents`, {
2478
- method: "POST",
2479
- headers,
2480
- body: JSON.stringify({ name, bio }),
2481
- });
2482
- if (!createRes.ok) {
2483
- const err = await createRes.text().catch(() => "Unknown error");
2484
- throw new Error(`Failed to create cloud agent: ${err}`);
2485
- }
2486
- const createData = (await createRes.json());
2487
- const agentId = createData.id;
2488
- onProgress?.("provisioning", "Provisioning sandbox environment...");
2489
- // Step 2: Start provisioning
2490
- const provisionRes = await fetch(`${cloudApiBase}/api/v1/milady/agents/${agentId}/provision`, { method: "POST", headers });
2491
- if (!provisionRes.ok) {
2492
- const err = await provisionRes.text().catch(() => "Unknown error");
2493
- throw new Error(`Failed to start provisioning: ${err}`);
2494
- }
2495
- const provisionData = (await provisionRes.json());
2496
- const jobId = provisionData.jobId;
2497
- // Step 3: Poll job status
2498
- const deadline = Date.now() + 120_000; // 2 minute timeout
2499
- while (Date.now() < deadline) {
2500
- await new Promise((r) => setTimeout(r, 2000));
2501
- const jobRes = await fetch(`${cloudApiBase}/api/v1/jobs/${jobId}`, {
2502
- headers,
2503
- });
2504
- if (!jobRes.ok)
2505
- continue;
2506
- const jobData = (await jobRes.json());
2507
- if (jobData.status === "completed" && jobData.result?.bridgeUrl) {
2508
- onProgress?.("ready", "Sandbox ready!");
2509
- return { bridgeUrl: jobData.result.bridgeUrl, agentId };
2510
- }
2511
- if (jobData.status === "failed") {
2512
- throw new Error(`Provisioning failed: ${jobData.error ?? "Unknown error"}`);
2513
- }
2514
- onProgress?.("provisioning", `Status: ${jobData.status}...`);
2515
- }
2516
- throw new Error("Provisioning timed out after 2 minutes");
2517
- }
2518
- }
2519
- // Singleton
2520
- export const client = new MiladyClient();