@elizaos/agent 2.0.3-beta.2 → 2.0.3-beta.3

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 (381) hide show
  1. package/__tests__/view-user-journeys.d.ts.map +1 -1
  2. package/__tests__/view-user-journeys.js +52 -41
  3. package/actions/context-signal.d.ts +2 -2
  4. package/actions/files.d.ts +9 -0
  5. package/actions/files.d.ts.map +1 -0
  6. package/actions/files.js +183 -0
  7. package/actions/index.d.ts +17 -17
  8. package/api/accounts-routes.d.ts +1 -1
  9. package/api/accounts-routes.js +1 -1
  10. package/api/agent-admin-routes.d.ts +1 -1
  11. package/api/agent-admin-routes.js +2 -2
  12. package/api/agent-model.d.ts +1 -1
  13. package/api/agent-status-routes.d.ts +1 -3
  14. package/api/agent-status-routes.d.ts.map +1 -1
  15. package/api/agent-status-routes.js +0 -2
  16. package/api/approval-routes.d.ts +38 -0
  17. package/api/approval-routes.d.ts.map +1 -0
  18. package/api/approval-routes.js +223 -0
  19. package/api/background-routes.d.ts +13 -0
  20. package/api/background-routes.d.ts.map +1 -0
  21. package/api/background-routes.js +91 -0
  22. package/api/binance-skill-helpers.d.ts +2 -2
  23. package/api/binance-skill-helpers.js +2 -2
  24. package/api/builtin-views.d.ts.map +1 -1
  25. package/api/builtin-views.js +44 -4
  26. package/api/character-routes.d.ts +1 -1
  27. package/api/chat-augmentation.d.ts.map +1 -1
  28. package/api/chat-augmentation.js +17 -0
  29. package/api/chat-routes.d.ts +29 -2
  30. package/api/chat-routes.d.ts.map +1 -1
  31. package/api/chat-routes.js +76 -1
  32. package/api/commands-routes.d.ts +10 -8
  33. package/api/commands-routes.d.ts.map +1 -1
  34. package/api/commands-routes.js +17 -59
  35. package/api/config-routes.d.ts +1 -1
  36. package/api/config-routes.d.ts.map +1 -1
  37. package/api/config-routes.js +0 -2
  38. package/api/connector-routes.d.ts +1 -1
  39. package/api/conversation-metadata.d.ts +1 -1
  40. package/api/conversation-metadata.d.ts.map +1 -1
  41. package/api/conversation-metadata.js +0 -1
  42. package/api/conversation-routes.d.ts +4 -3
  43. package/api/conversation-routes.d.ts.map +1 -1
  44. package/api/conversation-routes.js +34 -1
  45. package/api/documents-service-loader.d.ts +0 -4
  46. package/api/documents-service-loader.d.ts.map +1 -1
  47. package/api/documents-service-loader.js +0 -2
  48. package/api/files-routes.d.ts +14 -0
  49. package/api/files-routes.d.ts.map +1 -0
  50. package/api/files-routes.js +47 -0
  51. package/api/first-run-routes.d.ts +1 -1
  52. package/api/health-routes.d.ts +2 -2
  53. package/api/index.d.ts +40 -39
  54. package/api/index.d.ts.map +1 -1
  55. package/api/index.js +1 -0
  56. package/api/interactions-routes.d.ts +33 -0
  57. package/api/interactions-routes.d.ts.map +1 -0
  58. package/api/interactions-routes.js +63 -0
  59. package/api/media-runtime.d.ts +2 -1
  60. package/api/media-runtime.d.ts.map +1 -1
  61. package/api/media-runtime.js +64 -7
  62. package/api/media-store.d.ts +36 -0
  63. package/api/media-store.d.ts.map +1 -1
  64. package/api/media-store.js +141 -2
  65. package/api/memory-bounds.d.ts +0 -1
  66. package/api/memory-bounds.d.ts.map +1 -1
  67. package/api/memory-bounds.js +0 -1
  68. package/api/misc-routes.d.ts +1 -1
  69. package/api/model-provider-helpers.d.ts +2 -2
  70. package/api/model-provider-helpers.js +2 -2
  71. package/api/permissions-routes-extra.d.ts +1 -1
  72. package/api/permissions-routes.d.ts +1 -1
  73. package/api/permissions-routes.d.ts.map +1 -1
  74. package/api/permissions-routes.js +8 -7
  75. package/api/plugin-discovery-helpers.d.ts +5 -6
  76. package/api/plugin-discovery-helpers.d.ts.map +1 -1
  77. package/api/plugin-discovery-helpers.js +3 -4
  78. package/api/plugin-runtime-apply.d.ts +2 -2
  79. package/api/plugin-runtime-apply.d.ts.map +1 -1
  80. package/api/plugin-runtime-apply.js +74 -0
  81. package/api/provider-switch-config.d.ts +1 -1
  82. package/api/provider-switch-routes.d.ts +2 -2
  83. package/api/registry-routes.d.ts +1 -1
  84. package/api/registry-service.d.ts +1 -1
  85. package/api/remote-capability-routes.d.ts +2 -2
  86. package/api/remote-capability-routes.d.ts.map +1 -1
  87. package/api/remote-capability-routes.js +19 -0
  88. package/api/server-autonomy-helpers.d.ts +2 -2
  89. package/api/server-helpers-auth.d.ts +10 -0
  90. package/api/server-helpers-auth.d.ts.map +1 -1
  91. package/api/server-helpers-auth.js +16 -210
  92. package/api/server-helpers-config.d.ts +1 -1
  93. package/api/server-helpers-mcp.d.ts +2 -2
  94. package/api/server-helpers-plugin.d.ts +1 -1
  95. package/api/server-helpers-swarm.d.ts +3 -3
  96. package/api/server-helpers-swarm.d.ts.map +1 -1
  97. package/api/server-helpers-swarm.js +15 -5
  98. package/api/server-helpers-wallet.d.ts +1 -1
  99. package/api/server-helpers.d.ts +4 -4
  100. package/api/server-lazy-routes.d.ts +40 -38
  101. package/api/server-lazy-routes.d.ts.map +1 -1
  102. package/api/server-lazy-routes.js +7 -0
  103. package/api/server-route-dispatch.d.ts +2 -2
  104. package/api/server-route-dispatch.d.ts.map +1 -1
  105. package/api/server-route-dispatch.js +7 -0
  106. package/api/server-types.d.ts +9 -7
  107. package/api/server-types.d.ts.map +1 -1
  108. package/api/server.d.ts +19 -19
  109. package/api/server.d.ts.map +1 -1
  110. package/api/server.js +111 -17
  111. package/api/static-file-server.d.ts +2 -2
  112. package/api/static-file-server.js +2 -2
  113. package/api/subscription-routes.d.ts +4 -4
  114. package/api/subscription-routes.js +3 -4
  115. package/api/suggestions-routes.d.ts +1 -1
  116. package/api/suggestions-routes.d.ts.map +1 -1
  117. package/api/suggestions-routes.js +2 -3
  118. package/api/terminal-execution-routing.d.ts +1 -1
  119. package/api/training-service-like.d.ts +1 -1
  120. package/api/trajectory-fallback-routes.d.ts.map +1 -1
  121. package/api/trajectory-fallback-routes.js +21 -1
  122. package/api/update-routes.d.ts +1 -1
  123. package/api/view-registry-types.d.ts +1 -1
  124. package/api/views-registry.d.ts +14 -4
  125. package/api/views-registry.d.ts.map +1 -1
  126. package/api/views-registry.js +50 -26
  127. package/api/views-routes.d.ts +1 -1
  128. package/api/views-routes.d.ts.map +1 -1
  129. package/api/views-routes.js +131 -14
  130. package/api/views-search-index.d.ts +1 -1
  131. package/api/wallet-capability.d.ts +3 -3
  132. package/api/wallet-rpc.d.ts +1 -1
  133. package/api/wallet.d.ts +3 -3
  134. package/api/wallet.d.ts.map +1 -1
  135. package/api/wallet.js +4 -3
  136. package/api/workbench-context.d.ts +1 -1
  137. package/api/workbench-helpers.d.ts +3 -3
  138. package/api/workbench-helpers.js +3 -3
  139. package/api/workbench-routes.d.ts +2 -2
  140. package/api/workbench-vfs-routes.d.ts +1 -1
  141. package/api/ws-event-replay.d.ts +1 -2
  142. package/api/ws-event-replay.d.ts.map +1 -1
  143. package/api/ws-event-replay.js +1 -2
  144. package/api/x-relay-routes.d.ts +2 -2
  145. package/api/x402-route-validation.d.ts +4 -0
  146. package/api/x402-route-validation.d.ts.map +1 -0
  147. package/api/x402-route-validation.js +6 -0
  148. package/assets/view-heroes/background.png +0 -0
  149. package/auth/account-storage.d.ts +1 -1
  150. package/auth/anthropic.d.ts +1 -1
  151. package/auth/credentials.d.ts +2 -2
  152. package/auth/index.d.ts +7 -7
  153. package/auth/oauth-flow.d.ts +2 -2
  154. package/auth/openai-codex.d.ts +1 -1
  155. package/awareness/index.d.ts +1 -1
  156. package/config/config.js +0 -1
  157. package/config/env-vars.d.ts +1 -1
  158. package/config/env-vars.d.ts.map +1 -1
  159. package/config/env-vars.js +0 -1
  160. package/config/index.d.ts +10 -10
  161. package/config/model-metadata.d.ts +1 -1
  162. package/config/owner-contacts.d.ts +1 -1
  163. package/config/schema.d.ts +1 -1
  164. package/hooks/discovery.d.ts +1 -1
  165. package/hooks/eligibility.d.ts +2 -2
  166. package/hooks/index.d.ts +2 -2
  167. package/hooks/loader.d.ts +2 -2
  168. package/hooks/registry.d.ts +1 -1
  169. package/index.d.ts +87 -85
  170. package/index.d.ts.map +1 -1
  171. package/index.js +11 -3
  172. package/package.json +54 -44
  173. package/providers/media-provider.d.ts +1 -1
  174. package/providers/page-scoped-context.d.ts.map +1 -1
  175. package/providers/page-scoped-context.js +1 -70
  176. package/providers/relevant-conversations.d.ts.map +1 -1
  177. package/providers/relevant-conversations.js +8 -9
  178. package/providers/workspace.d.ts +1 -1
  179. package/runtime/actions/web-fetch.d.ts.map +1 -1
  180. package/runtime/actions/web-fetch.js +23 -3
  181. package/runtime/actions/web-search.d.ts +32 -0
  182. package/runtime/actions/web-search.d.ts.map +1 -0
  183. package/runtime/actions/web-search.js +245 -0
  184. package/runtime/advanced-capabilities-config.d.ts +1 -1
  185. package/runtime/boot-telemetry.d.ts +1 -1
  186. package/runtime/conversation-compactor-runtime.d.ts +1 -1
  187. package/runtime/conversation-compactor-runtime.js +1 -1
  188. package/runtime/conversation-compactor.d.ts +1 -1
  189. package/runtime/core-plugins.d.ts.map +1 -1
  190. package/runtime/core-plugins.js +9 -0
  191. package/runtime/custom-actions.d.ts +18 -9
  192. package/runtime/custom-actions.d.ts.map +1 -1
  193. package/runtime/custom-actions.js +85 -23
  194. package/runtime/eliza-plugin.d.ts.map +1 -1
  195. package/runtime/eliza-plugin.js +15 -1
  196. package/runtime/eliza.d.ts +9 -7
  197. package/runtime/eliza.d.ts.map +1 -1
  198. package/runtime/eliza.js +86 -23
  199. package/runtime/first-time-setup.d.ts +1 -3
  200. package/runtime/first-time-setup.d.ts.map +1 -1
  201. package/runtime/first-time-setup.js +0 -2
  202. package/runtime/index.d.ts +18 -18
  203. package/runtime/load-plugin-from-vfs.d.ts +2 -2
  204. package/runtime/mobile-dns.d.ts.map +1 -1
  205. package/runtime/mobile-dns.js +2 -5
  206. package/runtime/operations/classifier.d.ts +1 -1
  207. package/runtime/operations/cold-strategy.d.ts +1 -1
  208. package/runtime/operations/health-checks.d.ts +1 -1
  209. package/runtime/operations/health.d.ts +1 -1
  210. package/runtime/operations/index.d.ts +10 -10
  211. package/runtime/operations/manager.d.ts +3 -3
  212. package/runtime/operations/reload-hot.d.ts +1 -1
  213. package/runtime/operations/repository.d.ts +1 -1
  214. package/runtime/operations/vault-bridge.d.ts +1 -1
  215. package/runtime/plugin-collector.d.ts +6 -1
  216. package/runtime/plugin-collector.d.ts.map +1 -1
  217. package/runtime/plugin-collector.js +11 -28
  218. package/runtime/plugin-lifecycle.d.ts.map +1 -1
  219. package/runtime/plugin-lifecycle.js +1 -0
  220. package/runtime/plugin-resolver.d.ts +2 -2
  221. package/runtime/plugin-resolver.d.ts.map +1 -1
  222. package/runtime/plugin-resolver.js +113 -65
  223. package/runtime/plugin-types.d.ts +1 -1
  224. package/runtime/prompt-optimization.d.ts +4 -4
  225. package/runtime/remote-coding-runner-gate.d.ts +7 -0
  226. package/runtime/remote-coding-runner-gate.d.ts.map +1 -0
  227. package/runtime/remote-coding-runner-gate.js +36 -0
  228. package/runtime/roles/src/index.d.ts +4 -4
  229. package/runtime/roles.d.ts +2 -2
  230. package/runtime/sandbox-character.d.ts +1 -1
  231. package/runtime/tool-call-cache/cache.d.ts +1 -1
  232. package/runtime/tool-call-cache/disk-store.d.ts +1 -1
  233. package/runtime/tool-call-cache/index.d.ts +6 -6
  234. package/runtime/tool-call-cache/key.d.ts +1 -1
  235. package/runtime/tool-call-cache/redact.d.ts +1 -1
  236. package/runtime/tool-call-cache/registry.d.ts +1 -1
  237. package/runtime/tool-call-cache-wrapper.d.ts +7 -9
  238. package/runtime/tool-call-cache-wrapper.d.ts.map +1 -1
  239. package/runtime/tool-call-cache-wrapper.js +6 -11
  240. package/runtime/trajectory-export.d.ts +3 -3
  241. package/runtime/trajectory-internals.d.ts +2 -1
  242. package/runtime/trajectory-internals.d.ts.map +1 -1
  243. package/runtime/trajectory-persistence.d.ts +5 -5
  244. package/runtime/trajectory-steps-reader.d.ts +1 -1
  245. package/runtime/trajectory-steps-writer.d.ts +1 -1
  246. package/runtime/trajectory-storage.d.ts +4 -4
  247. package/runtime/view-action-affinity.d.ts +18 -15
  248. package/runtime/view-action-affinity.d.ts.map +1 -1
  249. package/runtime/view-action-affinity.js +26 -29
  250. package/runtime/web-search-tools.d.ts +4 -1
  251. package/runtime/web-search-tools.d.ts.map +1 -1
  252. package/runtime/web-search-tools.js +37 -9
  253. package/security/index.d.ts +3 -3
  254. package/services/approval/index.d.ts +9 -0
  255. package/services/approval/index.d.ts.map +1 -0
  256. package/services/approval/index.js +8 -0
  257. package/services/approval/service.d.ts +35 -0
  258. package/services/approval/service.d.ts.map +1 -0
  259. package/services/approval/service.js +40 -0
  260. package/services/approval/sql.d.ts +18 -0
  261. package/services/approval/sql.d.ts.map +1 -0
  262. package/services/approval/sql.js +104 -0
  263. package/services/approval/store.d.ts +39 -0
  264. package/services/approval/store.d.ts.map +1 -0
  265. package/services/approval/store.js +534 -0
  266. package/services/approval/types.d.ts +207 -0
  267. package/services/approval/types.d.ts.map +1 -0
  268. package/services/approval/types.js +34 -0
  269. package/services/character-persistence.d.ts +2 -2
  270. package/services/client-chat-sender.d.ts +1 -1
  271. package/services/config-plugin-manager.d.ts +2 -2
  272. package/services/connector-setup-service.d.ts +1 -1
  273. package/services/cove-quote-x509.d.ts +1 -1
  274. package/services/cove-quote.d.ts +2 -2
  275. package/services/dstack-tee-provider.d.ts +1 -1
  276. package/services/file-storage.d.ts +20 -0
  277. package/services/file-storage.d.ts.map +1 -0
  278. package/services/file-storage.js +70 -0
  279. package/services/global-pause/index.d.ts +8 -0
  280. package/services/global-pause/index.d.ts.map +1 -0
  281. package/services/global-pause/index.js +7 -0
  282. package/services/global-pause/service.d.ts +29 -0
  283. package/services/global-pause/service.d.ts.map +1 -0
  284. package/services/global-pause/service.js +34 -0
  285. package/services/global-pause/store.d.ts +31 -0
  286. package/services/global-pause/store.d.ts.map +1 -0
  287. package/services/global-pause/store.js +83 -0
  288. package/services/handoff/index.d.ts +8 -0
  289. package/services/handoff/index.d.ts.map +1 -0
  290. package/services/handoff/index.js +7 -0
  291. package/services/handoff/service.d.ts +29 -0
  292. package/services/handoff/service.d.ts.map +1 -0
  293. package/services/handoff/service.js +34 -0
  294. package/services/handoff/store.d.ts +76 -0
  295. package/services/handoff/store.d.ts.map +1 -0
  296. package/services/handoff/store.js +148 -0
  297. package/services/index.d.ts +30 -31
  298. package/services/index.d.ts.map +1 -1
  299. package/services/index.js +0 -6
  300. package/services/js-runtime-bridge.d.ts.map +1 -1
  301. package/services/js-runtime-bridge.js +8 -2
  302. package/services/knowledge-graph/index.d.ts +4 -4
  303. package/services/knowledge-graph/service.d.ts +2 -2
  304. package/services/pending-prompts/index.d.ts +8 -0
  305. package/services/pending-prompts/index.d.ts.map +1 -0
  306. package/services/pending-prompts/index.js +7 -0
  307. package/services/pending-prompts/service.d.ts +34 -0
  308. package/services/pending-prompts/service.d.ts.map +1 -0
  309. package/services/pending-prompts/service.js +68 -0
  310. package/services/pending-prompts/store.d.ts +70 -0
  311. package/services/pending-prompts/store.d.ts.map +1 -0
  312. package/services/pending-prompts/store.js +191 -0
  313. package/services/plugin-compiler.d.ts +1 -1
  314. package/services/plugin-installer.d.ts.map +1 -1
  315. package/services/plugin-installer.js +21 -11
  316. package/services/plugin-manager-types.d.ts +1 -1
  317. package/services/proactive-interaction-decider.d.ts +62 -11
  318. package/services/proactive-interaction-decider.d.ts.map +1 -1
  319. package/services/proactive-interaction-decider.js +223 -35
  320. package/services/push/apns-provider.d.ts +1 -1
  321. package/services/push/fcm-provider.d.ts +1 -1
  322. package/services/push/notification-push-service.d.ts +2 -2
  323. package/services/registry-client-app-meta.d.ts +1 -1
  324. package/services/registry-client-endpoints.d.ts +2 -2
  325. package/services/registry-client-local.d.ts +1 -1
  326. package/services/registry-client-network.d.ts +1 -1
  327. package/services/registry-client-queries.d.ts +1 -1
  328. package/services/registry-client.d.ts +3 -3
  329. package/services/relationships-graph.d.ts +1 -1
  330. package/services/remote-capability-cloud-sandbox.d.ts +3 -3
  331. package/services/remote-capability-endpoint-conformance.d.ts +1 -1
  332. package/services/remote-capability-endpoint-provider.d.ts +4 -4
  333. package/services/remote-capability-url-endpoint-providers.d.ts +1 -1
  334. package/services/remote-plugin-adapter.d.ts.map +1 -1
  335. package/services/remote-plugin-adapter.js +3 -0
  336. package/services/remote-plugin-bridge.d.ts.map +1 -1
  337. package/services/remote-plugin-bridge.js +97 -26
  338. package/services/remote-signing-service.d.ts +4 -4
  339. package/services/research-task-executor.d.ts +1 -1
  340. package/services/sandbox-manager.d.ts +1 -1
  341. package/services/self-updater.d.ts +1 -1
  342. package/services/self-updater.d.ts.map +1 -1
  343. package/services/self-updater.js +23 -9
  344. package/services/shell-execution-router.d.ts +1 -1
  345. package/services/shell-execution-router.d.ts.map +1 -1
  346. package/services/shell-execution-router.js +19 -2
  347. package/services/tee-boot-gate-state.d.ts +1 -1
  348. package/services/tee-boot-gate.d.ts +4 -4
  349. package/services/tee-confidential-inference.d.ts +3 -3
  350. package/services/tee-key-release.d.ts +2 -2
  351. package/services/tee-model-key-boot.d.ts +4 -4
  352. package/services/tee-policy.d.ts +1 -1
  353. package/services/tee-production-profile.d.ts +1 -1
  354. package/services/tee-release-policy.d.ts +1 -1
  355. package/services/tee-revocation.d.ts +2 -2
  356. package/services/tee-runtime-config.d.ts +1 -1
  357. package/services/tee-sealed-volume.d.ts +3 -3
  358. package/services/tee-signer-backend.d.ts +3 -3
  359. package/services/update-checker.d.ts +1 -1
  360. package/services/vault-signer-backend.d.ts +1 -1
  361. package/services/vfs-git.d.ts +1 -1
  362. package/test-support/index.d.ts +3 -3
  363. package/triggers/runtime.d.ts +1 -1
  364. package/triggers/scheduling.d.ts +3 -22
  365. package/triggers/scheduling.d.ts.map +1 -1
  366. package/triggers/scheduling.js +2 -214
  367. package/tui/agent-terminal-tui.d.ts.map +1 -1
  368. package/tui/agent-terminal-tui.js +174 -72
  369. package/types/index.d.ts +3 -3
  370. package/api/nfa-routes.d.ts +0 -6
  371. package/api/nfa-routes.d.ts.map +0 -1
  372. package/api/nfa-routes.js +0 -125
  373. package/api/server-auth.d.ts +0 -46
  374. package/api/server-auth.d.ts.map +0 -1
  375. package/api/server-auth.js +0 -504
  376. package/runtime/restart.d.ts +0 -9
  377. package/runtime/restart.d.ts.map +0 -1
  378. package/runtime/restart.js +0 -8
  379. package/test-utils/sqlite-compat.d.ts +0 -23
  380. package/test-utils/sqlite-compat.d.ts.map +0 -1
  381. package/test-utils/sqlite-compat.js +0 -214
@@ -27,8 +27,49 @@ import { isInsufficientCreditsError, isInsufficientCreditsMessage, } from "./cre
27
27
  import { buildWalletActionNotExecutedReply, cloneWithoutBlockedObjectKeys, decodePathComponent, getErrorMessage, hasBlockedObjectKeyDeep, isWalletActionRequiredIntent, maybeAugmentChatMessageWithWalletContext, normalizeIncomingChatPrompt, resolveAppUserName, trimWalletProgressPrefix, validateChatImages, } from "./server-helpers.js";
28
28
  const DEFAULT_CONVERSATION_TITLE_TIMEOUT_MS = 5_000;
29
29
  let localInferenceChatApiPromise = null;
30
+ /**
31
+ * Resolve the plugin-local-inference chat API used to turn a local-inference
32
+ * failure into a user-facing status (download prompts, switch-model hints, …).
33
+ *
34
+ * An error-reporting path must NEVER throw. The mobile bundle can resolve the
35
+ * dynamic `import("@elizaos/plugin-local-inference")` to a namespace whose named
36
+ * export is `undefined` (tree-shake / circular-init artifact) — which previously
37
+ * made the catch blocks throw `getLocalInferenceChatStatus is not a function`
38
+ * and MASK the real error. So validate the import and fall back to a status
39
+ * derived from the raw error, guaranteeing the actual failure surfaces.
40
+ */
30
41
  function getLocalInferenceChatApi() {
31
- localInferenceChatApiPromise ??= import("@elizaos/plugin-local-inference");
42
+ localInferenceChatApiPromise ??=
43
+ (async () => {
44
+ const fallback = {
45
+ getLocalInferenceChatStatus: async (_intent, error) => ({
46
+ text: error instanceof Error
47
+ ? error.message
48
+ : typeof error === "string" && error
49
+ ? error
50
+ : "Local inference is unavailable.",
51
+ localInference: {},
52
+ }),
53
+ handleLocalInferenceChatCommand: async (_intent, prompt) => ({
54
+ text: prompt,
55
+ localInference: {},
56
+ }),
57
+ };
58
+ try {
59
+ const mod = (await import("@elizaos/plugin-local-inference"));
60
+ return {
61
+ getLocalInferenceChatStatus: typeof mod.getLocalInferenceChatStatus === "function"
62
+ ? mod.getLocalInferenceChatStatus
63
+ : fallback.getLocalInferenceChatStatus,
64
+ handleLocalInferenceChatCommand: typeof mod.handleLocalInferenceChatCommand === "function"
65
+ ? mod.handleLocalInferenceChatCommand
66
+ : fallback.handleLocalInferenceChatCommand,
67
+ };
68
+ }
69
+ catch {
70
+ return fallback;
71
+ }
72
+ })();
32
73
  return localInferenceChatApiPromise;
33
74
  }
34
75
  const CHAT_MAX_BODY_BYTES = 20 * 1024 * 1024; // 20 MB (image-capable)
@@ -1016,6 +1057,9 @@ export function writeSse(res, payload) {
1016
1057
  export function writeChatTokenSse(res, text, fullText) {
1017
1058
  writeSse(res, { type: "token", text, fullText });
1018
1059
  }
1060
+ export function writeChatStatusSse(res, status) {
1061
+ writeSse(res, { type: "status", ...status });
1062
+ }
1019
1063
  export function writeSseData(res, data, event) {
1020
1064
  if (res.writableEnded || res.destroyed)
1021
1065
  return;
@@ -1321,6 +1365,22 @@ export async function generateChatResponse(runtime, message, agentName, opts) {
1321
1365
  message.content.source.trim().length > 0
1322
1366
  ? message.content.source
1323
1367
  : "api";
1368
+ // De-duped status emitter for the rich indicator. Coalesces repeats of the
1369
+ // same phase (an action firing many callbacks should emit one
1370
+ // `running_action`, not one per chunk) by tracking the last signature.
1371
+ let lastStatusSignature = "";
1372
+ const emitStatus = (status) => {
1373
+ if (!opts?.onStatus)
1374
+ return;
1375
+ const signature = `${status.kind}:${status.actionName ?? ""}:${status.toolName ?? ""}`;
1376
+ if (signature === lastStatusSignature)
1377
+ return;
1378
+ lastStatusSignature = signature;
1379
+ opts.onStatus(status);
1380
+ };
1381
+ // `thinking` is the opening phase: the turn started, the model is being
1382
+ // prompted, but no visible text has streamed yet.
1383
+ emitStatus({ kind: "thinking" });
1324
1384
  const emitChunk = (chunk) => {
1325
1385
  if (!chunk)
1326
1386
  return;
@@ -1341,6 +1401,11 @@ export async function generateChatResponse(runtime, message, agentName, opts) {
1341
1401
  const claimStreamSource = (source) => {
1342
1402
  if (activeStreamSource === "unset") {
1343
1403
  activeStreamSource = source;
1404
+ // The first claim is the thinking→producing transition. Raw LLM tokens
1405
+ // are `streaming`; an action handler producing the reply is
1406
+ // `running_action` (its name is stamped by recordActionCallback).
1407
+ if (source === "onStreamChunk")
1408
+ emitStatus({ kind: "streaming" });
1344
1409
  return true;
1345
1410
  }
1346
1411
  return activeStreamSource === source;
@@ -1467,6 +1532,16 @@ export async function generateChatResponse(runtime, message, agentName, opts) {
1467
1532
  if (normalizedActionTag) {
1468
1533
  seenActionTags.add(normalizedActionTag);
1469
1534
  }
1535
+ // The reply is now coming from an action handler, not raw LLM streaming —
1536
+ // surface it as `running_action`, carrying the concrete action name (when
1537
+ // it is a real action rather than the generic VISIBLE_CALLBACK tag) so the
1538
+ // status reads e.g. "Running SEND_MESSAGE" instead of generic "Working".
1539
+ emitStatus({
1540
+ kind: "running_action",
1541
+ ...(normalizedActionTag && normalizedActionTag !== "VISIBLE_CALLBACK"
1542
+ ? { actionName: normalizedActionTag }
1543
+ : {}),
1544
+ });
1470
1545
  runtime.logger.info({
1471
1546
  src: "eliza-api",
1472
1547
  action: normalizedActionTag || actionTag,
@@ -3,16 +3,18 @@
3
3
  *
4
4
  * Serves the connector-neutral command catalog in wire-safe form so client
5
5
  * surfaces (the web chat composer, the TUI) discover and render one source of
6
- * truth. Optionally scoped to a surface with `?surface=gui|tui|discord|telegram`
7
- * (the surface is echoed in the response; the develop catalog is uniform across
8
- * connectors, so the parameter does not filter).
6
+ * truth. Scoped to a surface with `?surface=gui|tui|discord|telegram` — the
7
+ * surface actually filters the result (commands declare the `surfaces` they
8
+ * belong to) and is echoed in the response.
9
9
  *
10
- * The data source is `getConnectorCommands` from `@elizaos/plugin-commands`,
11
- * which re-projects the agent's enabled text-command registry plus the app's
12
- * navigation surface into a `ConnectorCommand` shape. Each `ConnectorCommand`
13
- * is mapped here onto the `SlashCommandCatalogItem` shape the clients consume.
10
+ * This route is a *runtime-scoped projection*: it calls
11
+ * `getCatalogCommands(surface, { agentId })` from `@elizaos/plugin-commands`,
12
+ * which runs every enabled `CommandDefinition` through `serializeCommand`. The
13
+ * route fabricates nothing `surfaces`, `requiresAuth`, `requiresElevated`,
14
+ * `category`, `dynamicChoices`, `icon`, and the full `textAliases` all come
15
+ * straight from the definitions (#8790).
14
16
  *
15
- * Response: `{ commands: SlashCommandCatalogItem[], surface, agentId, generatedAt }`.
17
+ * Response: `{ commands: SerializedCommand[], surface, activeViewId, agentId, generatedAt }`.
16
18
  */
17
19
  import type http from "node:http";
18
20
  import type { AgentRuntime } from "@elizaos/core";
@@ -1 +1 @@
1
- {"version":3,"file":"commands-routes.d.ts","sourceRoot":"","sources":["../../src/api/commands-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA4DlD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC;IAC1B,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C;AAuDD,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,oBAAoB,GACxB,OAAO,CAAC,OAAO,CAAC,CA+BlB"}
1
+ {"version":3,"file":"commands-routes.d.ts","sourceRoot":"","sources":["../../src/api/commands-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAalD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC;IAC1B,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzE,KAAK,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C;AAED,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,oBAAoB,GACxB,OAAO,CAAC,OAAO,CAAC,CAkClB"}
@@ -3,18 +3,20 @@
3
3
  *
4
4
  * Serves the connector-neutral command catalog in wire-safe form so client
5
5
  * surfaces (the web chat composer, the TUI) discover and render one source of
6
- * truth. Optionally scoped to a surface with `?surface=gui|tui|discord|telegram`
7
- * (the surface is echoed in the response; the develop catalog is uniform across
8
- * connectors, so the parameter does not filter).
6
+ * truth. Scoped to a surface with `?surface=gui|tui|discord|telegram` — the
7
+ * surface actually filters the result (commands declare the `surfaces` they
8
+ * belong to) and is echoed in the response.
9
9
  *
10
- * The data source is `getConnectorCommands` from `@elizaos/plugin-commands`,
11
- * which re-projects the agent's enabled text-command registry plus the app's
12
- * navigation surface into a `ConnectorCommand` shape. Each `ConnectorCommand`
13
- * is mapped here onto the `SlashCommandCatalogItem` shape the clients consume.
10
+ * This route is a *runtime-scoped projection*: it calls
11
+ * `getCatalogCommands(surface, { agentId })` from `@elizaos/plugin-commands`,
12
+ * which runs every enabled `CommandDefinition` through `serializeCommand`. The
13
+ * route fabricates nothing `surfaces`, `requiresAuth`, `requiresElevated`,
14
+ * `category`, `dynamicChoices`, `icon`, and the full `textAliases` all come
15
+ * straight from the definitions (#8790).
14
16
  *
15
- * Response: `{ commands: SlashCommandCatalogItem[], surface, agentId, generatedAt }`.
17
+ * Response: `{ commands: SerializedCommand[], surface, activeViewId, agentId, generatedAt }`.
16
18
  */
17
- import { getConnectorCommands, } from "@elizaos/plugin-commands";
19
+ import { getCatalogCommands } from "@elizaos/plugin-commands";
18
20
  import { getCurrentViewState } from "./views-routes.js";
19
21
  const VALID_SURFACES = new Set([
20
22
  "gui",
@@ -22,55 +24,6 @@ const VALID_SURFACES = new Set([
22
24
  "discord",
23
25
  "telegram",
24
26
  ]);
25
- /** Map a catalog option onto a client arg, tagging known dynamic sources. */
26
- function mapOption(option) {
27
- const dynamicChoices = option.name === "section" ? "settings-sections" : undefined;
28
- return {
29
- name: option.name,
30
- description: option.description,
31
- required: option.required,
32
- choices: option.choices,
33
- ...(dynamicChoices ? { dynamicChoices } : {}),
34
- };
35
- }
36
- /** Map the connector-neutral target onto the client target shape. */
37
- function mapTarget(target) {
38
- if (target.kind === "navigate") {
39
- // Pass the catalog's routing hints through verbatim: the GUI opens `tab`
40
- // (or `viewId`) directly; `path` is the connector deep link; `section`
41
- // focuses a settings sub-section.
42
- return {
43
- kind: "navigate",
44
- path: target.path,
45
- ...(target.tab ? { tab: target.tab } : {}),
46
- ...(target.viewId ? { viewId: target.viewId } : {}),
47
- ...(target.section ? { section: target.section } : {}),
48
- };
49
- }
50
- if (target.kind === "client") {
51
- return { kind: "client", clientAction: target.clientAction };
52
- }
53
- return { kind: "agent" };
54
- }
55
- /** Project a `ConnectorCommand` onto the wire-safe `SlashCommandCatalogItem`. */
56
- function toCatalogItem(command) {
57
- return {
58
- key: command.name,
59
- nativeName: command.name,
60
- description: command.description,
61
- textAliases: [`/${command.name}`],
62
- scope: "both",
63
- acceptsArgs: command.options.length > 0,
64
- args: command.options.map(mapOption),
65
- requiresAuth: false,
66
- requiresElevated: false,
67
- target: mapTarget(command.target),
68
- source: "builtin",
69
- ...(command.views && command.views.length > 0
70
- ? { views: command.views }
71
- : {}),
72
- };
73
- }
74
27
  export async function handleCommandsRoutes(ctx) {
75
28
  const { res, method, pathname, url, json, error, runtime } = ctx;
76
29
  if (pathname !== "/api/commands")
@@ -87,7 +40,12 @@ export async function handleCommandsRoutes(ctx) {
87
40
  // Prefer an explicit ?view= (the client knows what it is rendering), else fall
88
41
  // back to the agent's server-side current view.
89
42
  const activeViewId = url.searchParams.get("view") ?? getCurrentViewState()?.viewId ?? null;
90
- const commands = getConnectorCommands(surface ?? "gui", { activeViewId }).map(toCatalogItem);
43
+ // Absent `?surface=` defaults to the web composer's surface (its historical
44
+ // consumer); an explicit surface filters to exactly that surface's commands.
45
+ const commands = getCatalogCommands(surface ?? "gui", {
46
+ activeViewId,
47
+ agentId: runtime?.agentId ?? null,
48
+ });
91
49
  json(res, {
92
50
  commands,
93
51
  surface,
@@ -1,7 +1,7 @@
1
1
  import type http from "node:http";
2
2
  import { type AgentRuntime } from "@elizaos/core";
3
3
  import type { ReadJsonBodyOptions } from "@elizaos/shared";
4
- import type { ElizaConfig } from "../config/config.ts";
4
+ import type { ElizaConfig } from "../config/config.js";
5
5
  export interface ConfigRouteContext {
6
6
  req: http.IncomingMessage;
7
7
  res: http.ServerResponse;
@@ -1 +1 @@
1
- {"version":3,"file":"config-routes.d.ts","sourceRoot":"","sources":["../../src/api/config-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,eAAe,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C;CAChD;AAqLD;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,OAAO,CAAC,CA2WlB"}
@@ -272,7 +272,6 @@ export async function handleConfigRoutes(ctx) {
272
272
  delete envPatch.ELIZA_API_TOKEN;
273
273
  delete envPatch.ELIZA_WALLET_EXPORT_TOKEN;
274
274
  delete envPatch.ELIZA_TERMINAL_RUN_TOKEN;
275
- delete envPatch.HYPERSCAPE_AUTH_TOKEN;
276
275
  delete envPatch.EVM_PRIVATE_KEY;
277
276
  delete envPatch.SOLANA_PRIVATE_KEY;
278
277
  delete envPatch.GITHUB_TOKEN;
@@ -283,7 +282,6 @@ export async function handleConfigRoutes(ctx) {
283
282
  delete vars.ELIZA_API_TOKEN;
284
283
  delete vars.ELIZA_WALLET_EXPORT_TOKEN;
285
284
  delete vars.ELIZA_TERMINAL_RUN_TOKEN;
286
- delete vars.HYPERSCAPE_AUTH_TOKEN;
287
285
  delete vars.EVM_PRIVATE_KEY;
288
286
  delete vars.SOLANA_PRIVATE_KEY;
289
287
  delete vars.GITHUB_TOKEN;
@@ -1,6 +1,6 @@
1
1
  import type http from "node:http";
2
2
  import type { IAgentRuntime, ReadJsonBodyOptions } from "@elizaos/core";
3
- import type { ElizaConfig } from "../config/config.ts";
3
+ import type { ElizaConfig } from "../config/config.js";
4
4
  export interface ConnectorRouteContext {
5
5
  req: http.IncomingMessage;
6
6
  res: http.ServerResponse;
@@ -1,5 +1,5 @@
1
1
  import type { JsonValue, Room } from "@elizaos/core";
2
- import type { ConversationMeta, ConversationMetadata } from "./server-types.ts";
2
+ import type { ConversationMeta, ConversationMetadata } from "./server-types.js";
3
3
  type RoomMetadataRecord = Record<string, JsonValue>;
4
4
  export declare function sanitizeConversationMetadata(value: unknown): ConversationMetadata | undefined;
5
5
  export declare function buildConversationRoomMetadata(conversation: Pick<ConversationMeta, "id" | "metadata">, ownerId: string, existingMetadata?: unknown): RoomMetadataRecord;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-metadata.d.ts","sourceRoot":"","sources":["../../src/api/conversation-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EAErB,MAAM,mBAAmB,CAAC;AAE3B,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AA4BpD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,oBAAoB,GAAG,SAAS,CAqElC;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,UAAU,CAAC,EACvD,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,OAAO,GACzB,kBAAkB,CAkBpB;AAED,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,EAC/C,sBAAsB,CAAC,EAAE,MAAM,GAC9B,oBAAoB,GAAG,SAAS,CAkBlC;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAChD,OAAO,CAOT;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAChD,OAAO,CAGT"}
1
+ {"version":3,"file":"conversation-metadata.d.ts","sourceRoot":"","sources":["../../src/api/conversation-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EAErB,MAAM,mBAAmB,CAAC;AAE3B,KAAK,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AA2BpD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,oBAAoB,GAAG,SAAS,CAqElC;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,UAAU,CAAC,EACvD,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,OAAO,GACzB,kBAAkB,CAkBpB;AAED,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,EAC/C,sBAAsB,CAAC,EAAE,MAAM,GAC9B,oBAAoB,GAAG,SAAS,CAkBlC;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAChD,OAAO,CAOT;AAED,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAChD,OAAO,CAGT"}
@@ -10,7 +10,6 @@ const VALID_SCOPES = new Set([
10
10
  "page-connectors",
11
11
  "page-phone",
12
12
  "page-plugins",
13
- "page-lifeops",
14
13
  "page-settings",
15
14
  "page-wallet",
16
15
  "page-browser",
@@ -14,9 +14,9 @@
14
14
  */
15
15
  import type { RouteRequestContext } from "@elizaos/core";
16
16
  import { type AgentRuntime, type Content, type UUID } from "@elizaos/core";
17
- import type { ElizaConfig } from "../config/config.ts";
18
- import type { ChatGenerationResult, LogEntry } from "./chat-routes.ts";
19
- import type { ConversationMeta } from "./server-types.ts";
17
+ import type { ElizaConfig } from "../config/config.js";
18
+ import type { ChatGenerationResult, LogEntry } from "./chat-routes.js";
19
+ import type { ConversationMeta } from "./server-types.js";
20
20
  export interface ConversationRouteState {
21
21
  runtime: AgentRuntime | null;
22
22
  /** Current agent lifecycle state (mirrors ServerState.agentState). */
@@ -33,6 +33,7 @@ export interface ConversationRouteState {
33
33
  chatUserId: UUID | null;
34
34
  logBuffer: LogEntry[];
35
35
  conversations: Map<string, ConversationMeta>;
36
+ activeChatTurnCount: number;
36
37
  conversationRestorePromise: Promise<void> | null;
37
38
  deletedConversationIds: Set<string>;
38
39
  broadcastWs: ((data: object) => void) | null;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-routes.d.ts","sourceRoot":"","sources":["../../src/api/conversation-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,OAAO,EAIZ,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAoCvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAgI1D,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,iBAAiB,CAAC,EACd,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,GACrD,IAAI,CAAC;IACT,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,0BAA0B,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACjD,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI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GAC3C,2BAA2B,EAAE,GAAG,SAAS,CAwB3C;AA6KD,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,wBAAwB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAu3ClB"}
@@ -18,7 +18,7 @@ import path from "node:path";
18
18
  import { ChannelType, createMessageMemory, logger, stringToUuid, } from "@elizaos/core";
19
19
  import { PatchConversationRequestSchema, PostConversationCleanupEmptyRequestSchema, PostConversationRequestSchema, PostConversationTruncateRequestSchema, } from "@elizaos/shared";
20
20
  import { resolveStateDir } from "../config/paths.js";
21
- import { classifyChatFailure, generateChatResponse, generateConversationTitle, getChatFailureReply, hasRecentVisibleAssistantMemorySince, initSse, normalizeChatResponseText, persistAssistantConversationMemory, persistConversationMemory, readChatRequestPayload, resolveNoResponseFallback, writeChatTokenSse, writeSse, writeSseJson, } from "./chat-routes.js";
21
+ import { classifyChatFailure, generateChatResponse, generateConversationTitle, getChatFailureReply, hasRecentVisibleAssistantMemorySince, initSse, normalizeChatResponseText, persistAssistantConversationMemory, persistConversationMemory, readChatRequestPayload, resolveNoResponseFallback, writeChatStatusSse, writeChatTokenSse, writeSse, writeSseJson, } from "./chat-routes.js";
22
22
  import { resolveClientChatAdminEntityId } from "./client-chat-admin.js";
23
23
  import { buildConversationRoomMetadata, sanitizeConversationMetadata, } from "./conversation-metadata.js";
24
24
  import { evictOldestConversation } from "./memory-bounds.js";
@@ -112,6 +112,16 @@ async function resolveRuntimeForChatTurn(state) {
112
112
  }
113
113
  return state.awaitRuntimeReady(WARMING_TURN_HOLD_MS);
114
114
  }
115
+ function beginActiveChatTurn(state) {
116
+ state.activeChatTurnCount = Math.max(0, state.activeChatTurnCount) + 1;
117
+ let ended = false;
118
+ return () => {
119
+ if (ended)
120
+ return;
121
+ ended = true;
122
+ state.activeChatTurnCount = Math.max(0, state.activeChatTurnCount - 1);
123
+ };
124
+ }
115
125
  // ---------------------------------------------------------------------------
116
126
  // Closure-lifted helpers
117
127
  // ---------------------------------------------------------------------------
@@ -861,12 +871,16 @@ export async function handleConversationRoutes(ctx) {
861
871
  ? normalizeChatResponseText(rawText, state.logBuffer, runtime)
862
872
  : rawText;
863
873
  const attachments = serializeMessageAttachments(content);
874
+ const topics = Array.isArray(meta?.topics) && meta.topics.length > 0
875
+ ? meta.topics.filter((topic) => typeof topic === "string")
876
+ : undefined;
864
877
  return {
865
878
  id: m.id ?? "",
866
879
  role,
867
880
  text,
868
881
  timestamp: m.createdAt ?? 0,
869
882
  ...(attachments ? { attachments } : {}),
883
+ ...(topics && topics.length > 0 ? { topics } : {}),
870
884
  source: normalizedSource,
871
885
  actionName,
872
886
  actionCallbackHistory: actionCallbackHistory.length > 0
@@ -1236,6 +1250,7 @@ export async function handleConversationRoutes(ctx) {
1236
1250
  }
1237
1251
  const walletModeGuidance = resolveWalletModeGuidanceReply(state, prompt);
1238
1252
  if (walletModeGuidance) {
1253
+ const endActiveChatTurn = beginActiveChatTurn(state);
1239
1254
  initSse(res);
1240
1255
  try {
1241
1256
  if (!disconnectTracker.isAborted()) {
@@ -1260,10 +1275,12 @@ export async function handleConversationRoutes(ctx) {
1260
1275
  }
1261
1276
  finally {
1262
1277
  finishStreamResponse();
1278
+ endActiveChatTurn();
1263
1279
  }
1264
1280
  return true;
1265
1281
  }
1266
1282
  // ── Local runtime path (streaming) ───────────────────────
1283
+ const endActiveChatTurn = beginActiveChatTurn(state);
1267
1284
  initSse(res);
1268
1285
  writeConversationStreamHeartbeat(res, disconnectTracker);
1269
1286
  // SSE heartbeat to keep connection alive during long generation
@@ -1282,6 +1299,13 @@ export async function handleConversationRoutes(ctx) {
1282
1299
  const result = await generateChatResponse(runtime, userMessage, state.agentName, {
1283
1300
  isAborted: () => disconnectTracker.isAborted(),
1284
1301
  abortSignal: disconnectTracker.signal,
1302
+ onStatus: (status) => {
1303
+ if (disconnectTracker.isAborted() ||
1304
+ disconnectTracker.checkConnectionClosed()) {
1305
+ return;
1306
+ }
1307
+ writeChatStatusSse(res, status);
1308
+ },
1285
1309
  onChunk: (chunk) => {
1286
1310
  if (!chunk)
1287
1311
  return;
@@ -1439,6 +1463,7 @@ export async function handleConversationRoutes(ctx) {
1439
1463
  finally {
1440
1464
  clearInterval(heartbeatInterval);
1441
1465
  finishStreamResponse();
1466
+ endActiveChatTurn();
1442
1467
  // Persistence runs after the client has already received `done` + the
1443
1468
  // socket is closed. Failures must still be observable — never swallow.
1444
1469
  if (deferredPersistence !== null) {
@@ -1507,6 +1532,7 @@ export async function handleConversationRoutes(ctx) {
1507
1532
  }
1508
1533
  const walletModeGuidance = resolveWalletModeGuidanceReply(state, prompt);
1509
1534
  if (walletModeGuidance) {
1535
+ const endActiveChatTurn = beginActiveChatTurn(state);
1510
1536
  try {
1511
1537
  await persistAssistantConversationMemory(runtime, conv.roomId, walletModeGuidance, channelType, turnStartedAt);
1512
1538
  conv.updatedAt = new Date().toISOString();
@@ -1518,8 +1544,12 @@ export async function handleConversationRoutes(ctx) {
1518
1544
  catch (persistErr) {
1519
1545
  error(res, getErrorMessage(persistErr), 500);
1520
1546
  }
1547
+ finally {
1548
+ endActiveChatTurn();
1549
+ }
1521
1550
  return true;
1522
1551
  }
1552
+ const endActiveChatTurn = beginActiveChatTurn(state);
1523
1553
  try {
1524
1554
  const result = await generateChatResponse(runtime, userMessage, state.agentName, {
1525
1555
  resolveNoResponseText: () => resolveNoResponseFallback(state.logBuffer, runtime),
@@ -1574,6 +1604,9 @@ export async function handleConversationRoutes(ctx) {
1574
1604
  error(res, getErrorMessage(persistErr), 500);
1575
1605
  }
1576
1606
  }
1607
+ finally {
1608
+ endActiveChatTurn();
1609
+ }
1577
1610
  return true;
1578
1611
  }
1579
1612
  // ── POST /api/conversations/:id/greeting ───────────────────────────
@@ -62,15 +62,11 @@ export interface DocumentsServiceLike {
62
62
  deleteDocument?(documentId: UUID, message?: Memory): Promise<void>;
63
63
  deleteMemory(memoryId: UUID): Promise<void>;
64
64
  }
65
- /** Alias kept for backwards-compatible plugin imports. */
66
- export type DocumentServiceLike = DocumentsServiceLike;
67
65
  export type DocumentsLoadFailReason = "timeout" | "runtime_unavailable" | "not_registered";
68
66
  export interface DocumentsServiceResult {
69
67
  service: DocumentsServiceLike | null;
70
68
  reason?: DocumentsLoadFailReason;
71
69
  }
72
70
  export declare function getDocumentsServiceTimeoutMs(): number;
73
- /** Alias kept for backwards-compatible plugin imports. */
74
- export declare const getDocumentsTimeoutMs: typeof getDocumentsServiceTimeoutMs;
75
71
  export declare function getDocumentsService(runtime: AgentRuntime | null): Promise<DocumentsServiceResult>;
76
72
  //# sourceMappingURL=documents-service-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"documents-service-loader.d.ts","sourceRoot":"","sources":["../../src/api/documents-service-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAW,IAAI,EAAE,MAAM,eAAe,CAAC;AAKzE,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,eAAe,GACf,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,MAAM,mBAAmB,GAC3B,OAAO,GACP,OAAO,GACP,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,QAAQ,GACR,KAAK,GACL,MAAM,GACN,kBAAkB,GAClB,kBAAkB,GAClB,SAAS,GACT,cAAc,GACd,WAAW,CAAC;AAEhB,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,OAAO,EAAE;QACnB,OAAO,CAAC,EAAE,IAAI,CAAC;QACf,OAAO,EAAE,IAAI,CAAC;QACd,MAAM,EAAE,IAAI,CAAC;QACb,QAAQ,EAAE,IAAI,CAAC;QACf,gBAAgB,EAAE,IAAI,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,gBAAgB,EAAE,MAAM,CAAC;QACzB,OAAO,EAAE,MAAM,CAAC;QA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AAI,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC;QACV,UAAU,EAAE,IAAI,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,cAAc,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,YAAY,CAAC,QAAQ,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,uBAAuB,GAC/B,SAAS,GACT,qBAAqB,GACrB,gBAAgB,CAAC;AAErB,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAKD,wBAAgB,4BAA4B,IAAI,MAAM,CAMrD;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,YAAY,GAAG,IAAI,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAwBjC"}
@@ -9,8 +9,6 @@ export function getDocumentsServiceTimeoutMs() {
9
9
  return DEFAULT_TIMEOUT_MS;
10
10
  return Math.min(parsed, MAX_TIMEOUT_MS);
11
11
  }
12
- /** Alias kept for backwards-compatible plugin imports. */
13
- export const getDocumentsTimeoutMs = getDocumentsServiceTimeoutMs;
14
12
  export async function getDocumentsService(runtime) {
15
13
  if (!runtime) {
16
14
  return { service: null, reason: "runtime_unavailable" };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Authenticated Files API over the content-addressed media store: list and
3
+ * delete stored attachment bytes for the "Files" surface. Reads/writes go
4
+ * through the {@link IFileStorageService} (ServiceType.REMOTE_FILES), never the
5
+ * fs directly. Unlike the pre-auth media *serve* route (the sha256 is the
6
+ * capability), these privileged operations are auth-gated (PrivateRoute).
7
+ */
8
+ import { type Route } from "@elizaos/core";
9
+ /** GET /api/files — list every stored file (newest first). */
10
+ export declare const filesListRoute: Route;
11
+ /** DELETE /api/files/:filename — delete one stored file (reference-unaware). */
12
+ export declare const fileDeleteRoute: Route;
13
+ export declare const filesRoutes: Route[];
14
+ //# sourceMappingURL=files-routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files-routes.d.ts","sourceRoot":"","sources":["../../src/api/files-routes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,KAAK,EAEX,MAAM,eAAe,CAAC;AAQvB,8DAA8D;AAC9D,eAAO,MAAM,cAAc,EAAE,KAc5B,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,KAiB7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,EAAsC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Authenticated Files API over the content-addressed media store: list and
3
+ * delete stored attachment bytes for the "Files" surface. Reads/writes go
4
+ * through the {@link IFileStorageService} (ServiceType.REMOTE_FILES), never the
5
+ * fs directly. Unlike the pre-auth media *serve* route (the sha256 is the
6
+ * capability), these privileged operations are auth-gated (PrivateRoute).
7
+ */
8
+ import { ServiceType, } from "@elizaos/core";
9
+ function getFileStorage(runtime) {
10
+ return (runtime.getService(ServiceType.REMOTE_FILES) ?? null);
11
+ }
12
+ /** GET /api/files — list every stored file (newest first). */
13
+ export const filesListRoute = {
14
+ type: "GET",
15
+ path: "/api/files",
16
+ rawPath: true,
17
+ name: "files-list",
18
+ routeHandler: async (ctx) => {
19
+ const storage = getFileStorage(ctx.runtime);
20
+ if (!storage) {
21
+ return { status: 503, body: { error: "file storage unavailable" } };
22
+ }
23
+ const files = await storage.list();
24
+ files.sort((a, b) => b.createdAt - a.createdAt);
25
+ return { status: 200, body: { files } };
26
+ },
27
+ };
28
+ /** DELETE /api/files/:filename — delete one stored file (reference-unaware). */
29
+ export const fileDeleteRoute = {
30
+ type: "DELETE",
31
+ path: "/api/files/:filename",
32
+ rawPath: true,
33
+ name: "file-delete",
34
+ routeHandler: async (ctx) => {
35
+ const storage = getFileStorage(ctx.runtime);
36
+ if (!storage) {
37
+ return { status: 503, body: { error: "file storage unavailable" } };
38
+ }
39
+ const filename = ctx.params?.filename ?? "";
40
+ const deleted = await storage.delete(filename);
41
+ return {
42
+ status: deleted ? 200 : 404,
43
+ body: { deleted },
44
+ };
45
+ },
46
+ };
47
+ export const filesRoutes = [filesListRoute, fileDeleteRoute];
@@ -1,7 +1,7 @@
1
1
  import type http from "node:http";
2
2
  import { type UUID } from "@elizaos/core";
3
3
  import type { ReadJsonBodyOptions } from "@elizaos/shared";
4
- import type { ElizaConfig } from "../config/config.ts";
4
+ import type { ElizaConfig } from "../config/config.js";
5
5
  export interface FirstRunRouteContext {
6
6
  req: http.IncomingMessage;
7
7
  res: http.ServerResponse;
@@ -1,7 +1,7 @@
1
1
  import type http from "node:http";
2
2
  import type { AgentRuntime } from "@elizaos/core";
3
- import type { ElizaConfig } from "../config/config.ts";
4
- import type { ConnectorHealthMonitor } from "./connector-health.ts";
3
+ import type { ElizaConfig } from "../config/config.js";
4
+ import type { ConnectorHealthMonitor } from "./connector-health.js";
5
5
  interface PluginEntryLike {
6
6
  enabled: boolean;
7
7
  configured: boolean;