@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
@@ -0,0 +1,207 @@
1
+ /**
2
+ * Approval-queue transport types — the runtime contract for the
3
+ * `approval_requests` table (owned by `@elizaos/plugin-sql`, public schema).
4
+ *
5
+ * These are agent-private (no plugin dependency): the `book_travel` payload's
6
+ * travel sub-shapes are declared structurally here rather than importing the
7
+ * Duffel/travel types from `@elizaos/plugin-personal-assistant` — the runtime
8
+ * state machine + SQL + validation only need the structural shape. PA keeps its
9
+ * own precisely-typed `approval-queue.types.ts` for the travel/Duffel domain
10
+ * reads; the structural overlap means PA's precise payloads remain assignable
11
+ * to this contract when enqueuing through the runtime {@link ApprovalQueue}.
12
+ */
13
+ export type ApprovalRequestState = "pending" | "approved" | "executing" | "done" | "rejected" | "expired";
14
+ export type ApprovalAction = "send_message" | "send_email" | "schedule_event" | "modify_event" | "cancel_event" | "book_travel" | "make_call" | "sign_document" | "execute_workflow" | "spend_money";
15
+ export type ApprovalChannel = "telegram" | "discord" | "slack" | "imessage" | "sms" | "x_dm" | "email" | "google_calendar" | "browser" | "phone" | "internal";
16
+ /** Travel passenger record — structural shape; see module docstring. */
17
+ export interface ApprovalTravelPassenger {
18
+ readonly offerPassengerId?: string | null;
19
+ readonly givenName: string;
20
+ readonly familyName: string;
21
+ readonly bornOn: string;
22
+ readonly email?: string | null;
23
+ readonly phoneNumber?: string | null;
24
+ readonly title?: string | null;
25
+ readonly gender?: string | null;
26
+ }
27
+ /** Travel calendar-sync plan — structural shape; see module docstring. */
28
+ export interface ApprovalTravelCalendarSync {
29
+ readonly enabled: boolean;
30
+ readonly calendarId?: string | null;
31
+ readonly title?: string | null;
32
+ readonly description?: string | null;
33
+ readonly location?: string | null;
34
+ readonly timeZone?: string | null;
35
+ }
36
+ export type ApprovalPayload = {
37
+ action: "send_message";
38
+ recipient: string;
39
+ body: string;
40
+ replyToMessageId: string | null;
41
+ } | {
42
+ action: "send_email";
43
+ to: ReadonlyArray<string>;
44
+ cc: ReadonlyArray<string>;
45
+ bcc: ReadonlyArray<string>;
46
+ subject: string;
47
+ body: string;
48
+ threadId: string | null;
49
+ replyToMessageId?: string | null;
50
+ } | {
51
+ action: "schedule_event";
52
+ calendarId: string;
53
+ title: string;
54
+ startsAtMs: number;
55
+ endsAtMs: number;
56
+ attendees: ReadonlyArray<string>;
57
+ location: string | null;
58
+ description: string | null;
59
+ } | {
60
+ action: "modify_event";
61
+ calendarId: string;
62
+ eventId: string;
63
+ patch: {
64
+ title: string | null;
65
+ startsAtMs: number | null;
66
+ endsAtMs: number | null;
67
+ attendees: ReadonlyArray<string> | null;
68
+ location: string | null;
69
+ description: string | null;
70
+ };
71
+ } | {
72
+ action: "cancel_event";
73
+ calendarId: string;
74
+ eventId: string;
75
+ notifyAttendees: boolean;
76
+ } | {
77
+ action: "book_travel";
78
+ kind: "flight" | "hotel" | "ground";
79
+ provider: string;
80
+ itineraryRef: string;
81
+ totalCents: number;
82
+ currency: string;
83
+ offerId?: string | null;
84
+ offerRequestId?: string | null;
85
+ orderType?: "hold" | "instant" | null;
86
+ /** Opaque flight-search context (Duffel `SearchFlightsRequest` in PA). */
87
+ search?: Readonly<Record<string, unknown>> | null;
88
+ passengers?: ReadonlyArray<ApprovalTravelPassenger>;
89
+ calendarSync?: ApprovalTravelCalendarSync | null;
90
+ summary?: string | null;
91
+ /** Server-side cost breakdown surfaced to the user alongside any
92
+ * payment-required prompt. Mirrors `DuffelCallCost`; held as a
93
+ * loose record here so the approval-queue type doesn't have to
94
+ * depend on the travel-adapter package. */
95
+ cost?: {
96
+ readonly totalUsd: number;
97
+ readonly creatorMarkupUsd: number;
98
+ readonly platformFeeUsd: number;
99
+ readonly markupPercent: number | null;
100
+ } | null;
101
+ /** Set when an x402 PaymentRequiredError fired before the booking
102
+ * could be quoted. The user sees both the booking intent and the
103
+ * top-up prompt in a single approval entry. */
104
+ paymentRequired?: {
105
+ readonly amount: string;
106
+ readonly asset: string;
107
+ readonly network: string;
108
+ readonly payTo: string;
109
+ readonly scheme: string;
110
+ readonly expiresAt: string | null;
111
+ readonly description: string | null;
112
+ } | null;
113
+ } | {
114
+ action: "make_call";
115
+ to: string;
116
+ script: string;
117
+ maxDurationSeconds: number;
118
+ } | {
119
+ action: "sign_document";
120
+ documentId: string;
121
+ documentName: string;
122
+ signatureUrl: string;
123
+ deadline: string;
124
+ } | {
125
+ action: "execute_workflow";
126
+ workflowId: string;
127
+ input: Readonly<Record<string, string | number | boolean>>;
128
+ } | {
129
+ action: "spend_money";
130
+ vendor: string;
131
+ amountCents: number;
132
+ currency: string;
133
+ memo: string;
134
+ };
135
+ /** Persisted approval request. */
136
+ export interface ApprovalRequest {
137
+ readonly id: string;
138
+ readonly createdAt: Date;
139
+ readonly updatedAt: Date;
140
+ readonly state: ApprovalRequestState;
141
+ readonly requestedBy: string;
142
+ readonly subjectUserId: string;
143
+ readonly action: ApprovalAction;
144
+ readonly payload: ApprovalPayload;
145
+ readonly channel: ApprovalChannel;
146
+ readonly reason: string;
147
+ readonly expiresAt: Date;
148
+ readonly resolvedAt: Date | null;
149
+ readonly resolvedBy: string | null;
150
+ readonly resolutionReason: string | null;
151
+ }
152
+ /** Input to `enqueue` — server fills in id, timestamps, and initial state. */
153
+ export interface ApprovalEnqueueInput {
154
+ readonly requestedBy: string;
155
+ readonly subjectUserId: string;
156
+ readonly action: ApprovalAction;
157
+ readonly payload: ApprovalPayload;
158
+ readonly channel: ApprovalChannel;
159
+ readonly reason: string;
160
+ readonly expiresAt: Date;
161
+ }
162
+ /** Filter for `list`. All fields combine with AND. */
163
+ export interface ApprovalListFilter {
164
+ readonly subjectUserId: string | null;
165
+ readonly state: ApprovalRequestState | null;
166
+ readonly action: ApprovalAction | null;
167
+ readonly limit: number;
168
+ }
169
+ /** Resolution input for `approve` / `reject`. */
170
+ export interface ApprovalResolution {
171
+ readonly resolvedBy: string;
172
+ readonly resolutionReason: string;
173
+ }
174
+ /** Thrown when a state transition is invalid. */
175
+ export declare class ApprovalStateTransitionError extends Error {
176
+ readonly requestId: string;
177
+ readonly from: ApprovalRequestState;
178
+ readonly to: ApprovalRequestState;
179
+ constructor(requestId: string, from: ApprovalRequestState, to: ApprovalRequestState);
180
+ }
181
+ /** Thrown when an operation references an unknown request id. */
182
+ export declare class ApprovalNotFoundError extends Error {
183
+ readonly requestId: string;
184
+ constructor(requestId: string);
185
+ }
186
+ /**
187
+ * Queue interface. Implementations must:
188
+ * - Reject invalid state transitions by throwing `ApprovalStateTransitionError`.
189
+ * - Reject unknown ids by throwing `ApprovalNotFoundError`.
190
+ * - Use the structured logger only (no `console.*`).
191
+ * - Treat `purgeExpired` as idempotent.
192
+ */
193
+ export interface ApprovalQueue {
194
+ enqueue(input: ApprovalEnqueueInput): Promise<ApprovalRequest>;
195
+ list(filter: ApprovalListFilter): Promise<ReadonlyArray<ApprovalRequest>>;
196
+ byId(id: string): Promise<ApprovalRequest | null>;
197
+ approve(id: string, resolution: ApprovalResolution): Promise<ApprovalRequest>;
198
+ reject(id: string, resolution: ApprovalResolution): Promise<ApprovalRequest>;
199
+ markExecuting(id: string): Promise<ApprovalRequest>;
200
+ markDone(id: string): Promise<ApprovalRequest>;
201
+ markExpired(id: string): Promise<ApprovalRequest>;
202
+ purgeExpired(now: Date): Promise<ReadonlyArray<string>>;
203
+ }
204
+ export interface ApprovalQueueOptions {
205
+ readonly agentId: string;
206
+ }
207
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/approval/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,WAAW,GACX,MAAM,GACN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EAAE,oBAAoB;CAU3B;AAED,iEAAiE;AACjE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEtB,SAAS,EAAE,MAAM;CAK9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/D,IAAI,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC;IAC1E,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC9E,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7E,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAClD,YAAY,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Approval-queue transport types — the runtime contract for the
3
+ * `approval_requests` table (owned by `@elizaos/plugin-sql`, public schema).
4
+ *
5
+ * These are agent-private (no plugin dependency): the `book_travel` payload's
6
+ * travel sub-shapes are declared structurally here rather than importing the
7
+ * Duffel/travel types from `@elizaos/plugin-personal-assistant` — the runtime
8
+ * state machine + SQL + validation only need the structural shape. PA keeps its
9
+ * own precisely-typed `approval-queue.types.ts` for the travel/Duffel domain
10
+ * reads; the structural overlap means PA's precise payloads remain assignable
11
+ * to this contract when enqueuing through the runtime {@link ApprovalQueue}.
12
+ */
13
+ /** Thrown when a state transition is invalid. */
14
+ export class ApprovalStateTransitionError extends Error {
15
+ requestId;
16
+ from;
17
+ to;
18
+ constructor(requestId, from, to) {
19
+ super(`[ApprovalQueue] invalid transition for request ${requestId}: ${from} -> ${to}`);
20
+ this.name = "ApprovalStateTransitionError";
21
+ this.requestId = requestId;
22
+ this.from = from;
23
+ this.to = to;
24
+ }
25
+ }
26
+ /** Thrown when an operation references an unknown request id. */
27
+ export class ApprovalNotFoundError extends Error {
28
+ requestId;
29
+ constructor(requestId) {
30
+ super(`[ApprovalQueue] request not found: ${requestId}`);
31
+ this.name = "ApprovalNotFoundError";
32
+ this.requestId = requestId;
33
+ }
34
+ }
@@ -1,6 +1,6 @@
1
1
  import { type IAgentRuntime, Service } from "@elizaos/core";
2
- import { type ElizaConfig } from "../config/config.ts";
3
- import { type CharacterHistorySource, type RuntimeCharacterLike } from "./character-history.ts";
2
+ import { type ElizaConfig } from "../config/config.js";
3
+ import { type CharacterHistorySource, type RuntimeCharacterLike } from "./character-history.js";
4
4
  export declare const CHARACTER_PERSISTENCE_SERVICE = "eliza_character_persistence";
5
5
  type PersistCharacterParams = {
6
6
  character?: RuntimeCharacterLike;
@@ -8,7 +8,7 @@
8
8
  * app reconnects.
9
9
  */
10
10
  import { type IAgentRuntime } from "@elizaos/core";
11
- import type { ServerState } from "../api/server-types.ts";
11
+ import type { ServerState } from "../api/server-types.js";
12
12
  /**
13
13
  * Register the `client_chat` send handler on the given runtime.
14
14
  *
@@ -1,5 +1,5 @@
1
- import type { ElizaConfig } from "../config/types.eliza.ts";
2
- import type { PluginManagerLike } from "./plugin-manager-types.ts";
1
+ import type { ElizaConfig } from "../config/types.eliza.js";
2
+ import type { PluginManagerLike } from "./plugin-manager-types.js";
3
3
  type ConfigGetter = () => ElizaConfig;
4
4
  export declare function createConfigPluginManager(getConfig: ConfigGetter): PluginManagerLike;
5
5
  export {};
@@ -10,7 +10,7 @@
10
10
  * so connector plugins don't need to import agent internals.
11
11
  */
12
12
  import { type IAgentRuntime, Service } from "@elizaos/core";
13
- import { type OwnerContactUpdate } from "../api/owner-contact-helpers.ts";
13
+ import { type OwnerContactUpdate } from "../api/owner-contact-helpers.js";
14
14
  export type { OwnerContactUpdate };
15
15
  export interface ConnectorSetupServiceInstance extends Service {
16
16
  /** Load the current Eliza config from disk. */
@@ -20,7 +20,7 @@
20
20
  * SHA-384 (or other) digests and the optional SVN, then mapped into the
21
21
  * normalized `TeeEvidence` shape so the same policy evaluator consumes them.
22
22
  */
23
- import { type TeeEvidence } from "./tee-evidence.ts";
23
+ import { type TeeEvidence } from "./tee-evidence.js";
24
24
  /** TCG DICE `DiceTcbInfo` extension OID: tcg(2.23.133) platformClass(5) 4. */
25
25
  export declare const TCG_DICE_TCB_INFO_OID = "2.23.133.5.4";
26
26
  /** Ed25519 signature/key algorithm OID (RFC 8410). */
@@ -26,7 +26,7 @@
26
26
  * verifier here is the reference the silicon reproduces. The TBS canonical form
27
27
  * is the documented contract (see `canonicalTbsBytes`).
28
28
  */
29
- import { type TeeEvidence, type TeeMeasurementName } from "./tee-evidence.ts";
29
+ import { type TeeEvidence, type TeeMeasurementName } from "./tee-evidence.js";
30
30
  /** Measurement registers a CoVE quote carries (RTMR-equivalents). */
31
31
  export type CoveMeasurements = {
32
32
  /** RoT boot register: extend over rom || lifecycle || BL1 || BL2. */
@@ -185,5 +185,5 @@ export declare function coveQuoteToTeeEvidence(result: Extract<CoveVerifyResult,
185
185
  * This is an additional accepted evidence format; the canonical-JSON path above
186
186
  * is unchanged. See `cove-quote-x509.ts`.
187
187
  */
188
- export { type CoveX509Cert, type CoveX509VerifyFailure, type CoveX509VerifyOptions, type CoveX509VerifyResult, coveX509ToTeeEvidence, type DiceFwId, type DiceTcbInfo, decodeDiceTcbInfoFromCert, ED25519_OID, SHA384_OID, TCG_DICE_TCB_INFO_OID, verifyCoveX509Chain, } from "./cove-quote-x509.ts";
188
+ export { type CoveX509Cert, type CoveX509VerifyFailure, type CoveX509VerifyOptions, type CoveX509VerifyResult, coveX509ToTeeEvidence, type DiceFwId, type DiceTcbInfo, decodeDiceTcbInfoFromCert, ED25519_OID, SHA384_OID, TCG_DICE_TCB_INFO_OID, verifyCoveX509Chain, } from "./cove-quote-x509.js";
189
189
  //# sourceMappingURL=cove-quote.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type TeeEvidence } from "./tee-evidence.ts";
1
+ import { type TeeEvidence } from "./tee-evidence.js";
2
2
  export type DstackTeeProviderOptions = {
3
3
  endpointUrl?: string;
4
4
  evidencePath?: string;
@@ -0,0 +1,20 @@
1
+ import { Buffer } from "node:buffer";
2
+ import { type IAgentRuntime, IFileStorageService, type StoredFile, type StoredFileListItem } from "@elizaos/core";
3
+ /**
4
+ * Local-disk, content-addressed implementation of {@link IFileStorageService},
5
+ * wrapping the agent media store (`${STATE_DIR}/media/<sha256>.<ext>`). This is
6
+ * the default file-storage backend; a cloud-backed implementation can fill the
7
+ * same `ServiceType.REMOTE_FILES` slot later without callers changing.
8
+ */
9
+ export declare class LocalFileStorageService extends IFileStorageService {
10
+ readonly capabilityDescription = "Local content-addressed file storage (store, serve, list, delete) backed by the agent media store.";
11
+ static start(runtime: IAgentRuntime): Promise<LocalFileStorageService>;
12
+ stop(): Promise<void>;
13
+ store(bytes: Buffer | Uint8Array, mimeType: string): Promise<StoredFile>;
14
+ storeDataUrl(dataUrl: string): Promise<StoredFile | null>;
15
+ getUrl(fileName: string): string | null;
16
+ exists(fileName: string): Promise<boolean>;
17
+ list(): Promise<StoredFileListItem[]>;
18
+ delete(fileName: string): Promise<boolean>;
19
+ }
20
+ //# sourceMappingURL=file-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.d.ts","sourceRoot":"","sources":["../../src/services/file-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAUvB;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,mBAAmB;IAC9D,SAAkB,qBAAqB,wGACgE;WAE1F,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAItE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAErB,KAAK,CACT,KAAK,EAAE,MAAM,GAAG,UAAU,EAC1B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC;IAYhB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAkB/D,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAKjC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1C,IAAI,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAWrC,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGjD"}
@@ -0,0 +1,70 @@
1
+ import { Buffer } from "node:buffer";
2
+ import { IFileStorageService, } from "@elizaos/core";
3
+ import { deleteMediaFile, listMediaFiles, mediaFileNameFromUrl, persistMediaBytes, } from "../api/media-store.js";
4
+ const DATA_URL_RE = /^data:([^;,]*)(;base64)?,([\s\S]*)$/;
5
+ /**
6
+ * Local-disk, content-addressed implementation of {@link IFileStorageService},
7
+ * wrapping the agent media store (`${STATE_DIR}/media/<sha256>.<ext>`). This is
8
+ * the default file-storage backend; a cloud-backed implementation can fill the
9
+ * same `ServiceType.REMOTE_FILES` slot later without callers changing.
10
+ */
11
+ export class LocalFileStorageService extends IFileStorageService {
12
+ capabilityDescription = "Local content-addressed file storage (store, serve, list, delete) backed by the agent media store.";
13
+ static async start(runtime) {
14
+ return new LocalFileStorageService(runtime);
15
+ }
16
+ async stop() { }
17
+ async store(bytes, mimeType) {
18
+ const buffer = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes);
19
+ const persisted = persistMediaBytes(buffer, mimeType);
20
+ return {
21
+ url: persisted.url,
22
+ hash: persisted.hash,
23
+ fileName: persisted.fileName,
24
+ mimeType,
25
+ size: buffer.length,
26
+ };
27
+ }
28
+ async storeDataUrl(dataUrl) {
29
+ const match = DATA_URL_RE.exec(dataUrl.trim());
30
+ if (!match)
31
+ return null;
32
+ const mimeType = match[1] || "application/octet-stream";
33
+ const isBase64 = Boolean(match[2]);
34
+ const payload = match[3] ?? "";
35
+ let buffer;
36
+ try {
37
+ buffer = isBase64
38
+ ? Buffer.from(payload, "base64")
39
+ : Buffer.from(decodeURIComponent(payload), "utf8");
40
+ }
41
+ catch {
42
+ return null;
43
+ }
44
+ if (buffer.length === 0)
45
+ return null;
46
+ return this.store(buffer, mimeType);
47
+ }
48
+ getUrl(fileName) {
49
+ const url = `/api/media/${fileName}`;
50
+ return mediaFileNameFromUrl(url) ? url : null;
51
+ }
52
+ async exists(fileName) {
53
+ if (!this.getUrl(fileName))
54
+ return false;
55
+ return listMediaFiles().some((file) => file.fileName === fileName);
56
+ }
57
+ async list() {
58
+ return listMediaFiles().map((file) => ({
59
+ url: file.url,
60
+ hash: file.hash,
61
+ fileName: file.fileName,
62
+ mimeType: file.mimeType,
63
+ size: file.size,
64
+ createdAt: file.createdAt,
65
+ }));
66
+ }
67
+ async delete(fileName) {
68
+ return deleteMediaFile(fileName);
69
+ }
70
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runtime global-pause store: the vacation / pause-mode singleton consulted by
3
+ * the scheduled-task runner, surfaced through the registered
4
+ * {@link GlobalPauseService}. Cache-backed (no SQL), single canonical key.
5
+ */
6
+ export { GLOBAL_PAUSE_SERVICE, GlobalPauseService, resolveGlobalPauseService, } from "./service.js";
7
+ export { createGlobalPauseStore, GLOBAL_PAUSE_CACHE_KEY, type GlobalPauseStatus, type GlobalPauseStore, type GlobalPauseWindow, } from "./store.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/global-pause/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Runtime global-pause store: the vacation / pause-mode singleton consulted by
3
+ * the scheduled-task runner, surfaced through the registered
4
+ * {@link GlobalPauseService}. Cache-backed (no SQL), single canonical key.
5
+ */
6
+ export { GLOBAL_PAUSE_SERVICE, GlobalPauseService, resolveGlobalPauseService, } from "./service.js";
7
+ export { createGlobalPauseStore, GLOBAL_PAUSE_CACHE_KEY, } from "./store.js";
@@ -0,0 +1,29 @@
1
+ /**
2
+ * GlobalPauseService — the runtime-owned vacation / pause-mode singleton,
3
+ * exposed as a registered runtime service.
4
+ *
5
+ * Global pause is a runtime primitive: the scheduled-task runner consults the
6
+ * store pre-fire via `runtime.getService(...)` rather than constructing the
7
+ * cache-backed store itself. The service is a thin factory over the per-runtime
8
+ * {@link GlobalPauseStore}; the store is cache-backed (no SQL), single canonical
9
+ * key.
10
+ *
11
+ * Mirrors `KnowledgeGraphService` (lifecycle + getService accessor).
12
+ */
13
+ import { type IAgentRuntime, Service } from "@elizaos/core";
14
+ import { type GlobalPauseStore } from "./store.js";
15
+ export declare const GLOBAL_PAUSE_SERVICE = "eliza_global_pause";
16
+ export declare class GlobalPauseService extends Service {
17
+ static serviceType: string;
18
+ capabilityDescription: string;
19
+ static start(runtime: IAgentRuntime): Promise<GlobalPauseService>;
20
+ stop(): Promise<void>;
21
+ /** The cache-backed global-pause store for this runtime. */
22
+ getStore(): GlobalPauseStore;
23
+ }
24
+ /**
25
+ * Resolve the registered {@link GlobalPauseService}. Returns `null` when the
26
+ * runtime has not registered it (e.g. the "eliza" plugin is absent).
27
+ */
28
+ export declare function resolveGlobalPauseService(runtime: IAgentRuntime): GlobalPauseService | null;
29
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/global-pause/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE3E,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAEzD,qBAAa,kBAAmB,SAAQ,OAAO;IAC7C,OAAgB,WAAW,SAAwB;IAE1C,qBAAqB,SAC2E;WAE5F,KAAK,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIjE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3B,4DAA4D;IAC5D,QAAQ,IAAI,gBAAgB;CAG7B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,GACrB,kBAAkB,GAAG,IAAI,CAE3B"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * GlobalPauseService — the runtime-owned vacation / pause-mode singleton,
3
+ * exposed as a registered runtime service.
4
+ *
5
+ * Global pause is a runtime primitive: the scheduled-task runner consults the
6
+ * store pre-fire via `runtime.getService(...)` rather than constructing the
7
+ * cache-backed store itself. The service is a thin factory over the per-runtime
8
+ * {@link GlobalPauseStore}; the store is cache-backed (no SQL), single canonical
9
+ * key.
10
+ *
11
+ * Mirrors `KnowledgeGraphService` (lifecycle + getService accessor).
12
+ */
13
+ import { Service } from "@elizaos/core";
14
+ import { createGlobalPauseStore } from "./store.js";
15
+ export const GLOBAL_PAUSE_SERVICE = "eliza_global_pause";
16
+ export class GlobalPauseService extends Service {
17
+ static serviceType = GLOBAL_PAUSE_SERVICE;
18
+ capabilityDescription = "Runtime global-pause store: vacation / pause-mode singleton consulted by the scheduler, cache-backed";
19
+ static async start(runtime) {
20
+ return new GlobalPauseService(runtime);
21
+ }
22
+ async stop() { }
23
+ /** The cache-backed global-pause store for this runtime. */
24
+ getStore() {
25
+ return createGlobalPauseStore(this.runtime);
26
+ }
27
+ }
28
+ /**
29
+ * Resolve the registered {@link GlobalPauseService}. Returns `null` when the
30
+ * runtime has not registered it (e.g. the "eliza" plugin is absent).
31
+ */
32
+ export function resolveGlobalPauseService(runtime) {
33
+ return runtime.getService(GLOBAL_PAUSE_SERVICE);
34
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `GlobalPauseStore` — vacation / pause mode singleton.
3
+ *
4
+ * Only ONE pause window can be active at a time. The runner consults
5
+ * `current()` pre-fire; tasks with `respectsGlobalPause: true` skip with
6
+ * reason `global_pause`; tasks with `respectsGlobalPause: false` (emergencies)
7
+ * fire anyway. If `endIso` is set on the active window, the runner reschedules
8
+ * skipped tasks for `endIso` (the user's "resume my routine" moment).
9
+ *
10
+ * Backing storage: runtime cache. Single canonical key.
11
+ */
12
+ import type { IAgentRuntime } from "@elizaos/core";
13
+ export interface GlobalPauseWindow {
14
+ startIso: string;
15
+ endIso?: string;
16
+ reason?: string;
17
+ }
18
+ export interface GlobalPauseStatus {
19
+ active: boolean;
20
+ startIso?: string;
21
+ endIso?: string;
22
+ reason?: string;
23
+ }
24
+ export interface GlobalPauseStore {
25
+ set(window: GlobalPauseWindow): Promise<void>;
26
+ clear(): Promise<void>;
27
+ current(now?: Date): Promise<GlobalPauseStatus>;
28
+ }
29
+ export declare const GLOBAL_PAUSE_CACHE_KEY = "eliza:lifeops:global-pause:v1";
30
+ export declare function createGlobalPauseStore(runtime: IAgentRuntime): GlobalPauseStore;
31
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/services/global-pause/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAOnD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACjD;AAED,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AA+CtE,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,aAAa,GACrB,gBAAgB,CAsClB"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * `GlobalPauseStore` — vacation / pause mode singleton.
3
+ *
4
+ * Only ONE pause window can be active at a time. The runner consults
5
+ * `current()` pre-fire; tasks with `respectsGlobalPause: true` skip with
6
+ * reason `global_pause`; tasks with `respectsGlobalPause: false` (emergencies)
7
+ * fire anyway. If `endIso` is set on the active window, the runner reschedules
8
+ * skipped tasks for `endIso` (the user's "resume my routine" moment).
9
+ *
10
+ * Backing storage: runtime cache. Single canonical key.
11
+ */
12
+ export const GLOBAL_PAUSE_CACHE_KEY = "eliza:lifeops:global-pause:v1";
13
+ function isValidIso(value) {
14
+ if (typeof value !== "string" || value.length === 0) {
15
+ return false;
16
+ }
17
+ const ms = Date.parse(value);
18
+ return Number.isFinite(ms);
19
+ }
20
+ function normalizeWindow(window) {
21
+ if (!isValidIso(window.startIso)) {
22
+ throw new Error(`[global-pause] invalid startIso: ${String(window.startIso)}`);
23
+ }
24
+ if (window.endIso !== undefined && !isValidIso(window.endIso)) {
25
+ throw new Error(`[global-pause] invalid endIso: ${String(window.endIso)}`);
26
+ }
27
+ if (window.endIso !== undefined &&
28
+ Date.parse(window.endIso) <= Date.parse(window.startIso)) {
29
+ throw new Error("[global-pause] endIso must be strictly after startIso");
30
+ }
31
+ const normalized = { startIso: window.startIso };
32
+ if (window.endIso !== undefined) {
33
+ normalized.endIso = window.endIso;
34
+ }
35
+ if (typeof window.reason === "string" && window.reason.trim().length > 0) {
36
+ normalized.reason = window.reason.trim().slice(0, 200);
37
+ }
38
+ return normalized;
39
+ }
40
+ function isWindowActive(window, now) {
41
+ const startMs = Date.parse(window.startIso);
42
+ if (!Number.isFinite(startMs) || now.getTime() < startMs) {
43
+ return false;
44
+ }
45
+ if (window.endIso === undefined) {
46
+ return true;
47
+ }
48
+ const endMs = Date.parse(window.endIso);
49
+ return Number.isFinite(endMs) && now.getTime() < endMs;
50
+ }
51
+ export function createGlobalPauseStore(runtime) {
52
+ const cache = runtime;
53
+ return {
54
+ async set(window) {
55
+ const normalized = normalizeWindow(window);
56
+ await cache.setCache(GLOBAL_PAUSE_CACHE_KEY, normalized);
57
+ },
58
+ async clear() {
59
+ await cache.deleteCache(GLOBAL_PAUSE_CACHE_KEY);
60
+ },
61
+ async current(now = new Date()) {
62
+ const stored = await cache.getCache(GLOBAL_PAUSE_CACHE_KEY);
63
+ if (!stored || typeof stored !== "object") {
64
+ return { active: false };
65
+ }
66
+ if (!isValidIso(stored.startIso)) {
67
+ return { active: false };
68
+ }
69
+ const active = isWindowActive(stored, now);
70
+ const status = {
71
+ active,
72
+ startIso: stored.startIso,
73
+ };
74
+ if (stored.endIso !== undefined) {
75
+ status.endIso = stored.endIso;
76
+ }
77
+ if (stored.reason !== undefined) {
78
+ status.reason = stored.reason;
79
+ }
80
+ return status;
81
+ },
82
+ };
83
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runtime handoff store: per-room handoff state gating agent contributions,
3
+ * surfaced through the registered {@link HandoffService}. Cache-backed (no SQL),
4
+ * keyed per room.
5
+ */
6
+ export { HANDOFF_SERVICE, HandoffService, resolveHandoffService, } from "./service.js";
7
+ export { createHandoffStore, describeResumeCondition, evaluateResume, type HandoffEnterOpts, type HandoffStatus, type HandoffStore, type ResumeCondition, type ResumeEvaluation, type ResumeEvaluationInput, } from "./store.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/handoff/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,YAAY,CAAC"}