@ixo/oracle-runtime 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (583) hide show
  1. package/dist/bootstrap/ambient-factory.d.ts +32 -0
  2. package/dist/bootstrap/ambient-factory.d.ts.map +1 -0
  3. package/dist/bootstrap/ambient-factory.js +128 -0
  4. package/dist/bootstrap/create-oracle-app.d.ts +112 -0
  5. package/dist/bootstrap/create-oracle-app.d.ts.map +1 -0
  6. package/dist/bootstrap/create-oracle-app.js +530 -0
  7. package/dist/bootstrap/graceful-shutdown.d.ts +20 -0
  8. package/dist/bootstrap/graceful-shutdown.d.ts.map +1 -0
  9. package/dist/bootstrap/graceful-shutdown.js +61 -0
  10. package/dist/bootstrap/index.d.ts +13 -0
  11. package/dist/bootstrap/index.d.ts.map +1 -0
  12. package/dist/bootstrap/index.js +6 -0
  13. package/dist/bootstrap/inspect.d.ts +74 -0
  14. package/dist/bootstrap/inspect.d.ts.map +1 -0
  15. package/dist/bootstrap/inspect.js +111 -0
  16. package/dist/bootstrap/plugin-loader.d.ts +50 -0
  17. package/dist/bootstrap/plugin-loader.d.ts.map +1 -0
  18. package/dist/bootstrap/plugin-loader.js +119 -0
  19. package/dist/bootstrap/runtime-app-module.d.ts +38 -0
  20. package/dist/bootstrap/runtime-app-module.d.ts.map +1 -0
  21. package/dist/bootstrap/runtime-app-module.js +114 -0
  22. package/dist/bootstrap/schema-composer.d.ts +46 -0
  23. package/dist/bootstrap/schema-composer.d.ts.map +1 -0
  24. package/dist/bootstrap/schema-composer.js +65 -0
  25. package/dist/config/base-env-config.d.ts +31 -0
  26. package/dist/config/base-env-config.d.ts.map +1 -0
  27. package/dist/config/base-env-config.js +70 -0
  28. package/dist/config/base-env-schema.d.ts +77 -0
  29. package/dist/config/base-env-schema.d.ts.map +1 -0
  30. package/dist/config/base-env-schema.js +102 -0
  31. package/dist/events/scoped-emitter.d.ts +33 -0
  32. package/dist/events/scoped-emitter.d.ts.map +1 -0
  33. package/dist/events/scoped-emitter.js +32 -0
  34. package/dist/graph/index.d.ts +8 -0
  35. package/dist/graph/index.d.ts.map +1 -0
  36. package/dist/graph/index.js +6 -0
  37. package/dist/graph/main-agent-types.d.ts +88 -0
  38. package/dist/graph/main-agent-types.d.ts.map +1 -0
  39. package/dist/graph/main-agent-types.js +20 -0
  40. package/dist/graph/main-agent.d.ts +16 -0
  41. package/dist/graph/main-agent.d.ts.map +1 -0
  42. package/dist/graph/main-agent.js +251 -0
  43. package/dist/graph/middlewares/capability-gate-middleware.d.ts +35 -0
  44. package/dist/graph/middlewares/capability-gate-middleware.d.ts.map +1 -0
  45. package/dist/graph/middlewares/capability-gate-middleware.js +54 -0
  46. package/dist/graph/middlewares/index.d.ts +7 -0
  47. package/dist/graph/middlewares/index.d.ts.map +1 -0
  48. package/dist/graph/middlewares/index.js +6 -0
  49. package/dist/graph/middlewares/page-context-middleware.d.ts +23 -0
  50. package/dist/graph/middlewares/page-context-middleware.d.ts.map +1 -0
  51. package/dist/graph/middlewares/page-context-middleware.js +68 -0
  52. package/dist/graph/middlewares/safety-guardrail-middleware.d.ts +26 -0
  53. package/dist/graph/middlewares/safety-guardrail-middleware.d.ts.map +1 -0
  54. package/dist/graph/middlewares/safety-guardrail-middleware.js +88 -0
  55. package/dist/graph/middlewares/summarization-middleware.d.ts +17 -0
  56. package/dist/graph/middlewares/summarization-middleware.d.ts.map +1 -0
  57. package/dist/graph/middlewares/summarization-middleware.js +62 -0
  58. package/dist/graph/middlewares/tool-repetition-guard-middleware.d.ts +24 -0
  59. package/dist/graph/middlewares/tool-repetition-guard-middleware.d.ts.map +1 -0
  60. package/dist/graph/middlewares/tool-repetition-guard-middleware.js +112 -0
  61. package/dist/graph/middlewares/tool-validation-middleware.d.ts +24 -0
  62. package/dist/graph/middlewares/tool-validation-middleware.d.ts.map +1 -0
  63. package/dist/graph/middlewares/tool-validation-middleware.js +61 -0
  64. package/dist/graph/prompt-composer.d.ts +69 -0
  65. package/dist/graph/prompt-composer.d.ts.map +1 -0
  66. package/dist/graph/prompt-composer.js +315 -0
  67. package/dist/graph/state.d.ts +65 -0
  68. package/dist/graph/state.d.ts.map +1 -0
  69. package/dist/graph/state.js +60 -0
  70. package/dist/graph/sub-agent-fallback.d.ts +56 -0
  71. package/dist/graph/sub-agent-fallback.d.ts.map +1 -0
  72. package/dist/graph/sub-agent-fallback.js +79 -0
  73. package/dist/graph/subagent-as-tool.d.ts +77 -0
  74. package/dist/graph/subagent-as-tool.d.ts.map +1 -0
  75. package/dist/graph/subagent-as-tool.js +197 -0
  76. package/dist/graph/wrap-plugin-tool.d.ts +28 -0
  77. package/dist/graph/wrap-plugin-tool.d.ts.map +1 -0
  78. package/dist/graph/wrap-plugin-tool.js +30 -0
  79. package/dist/index.d.ts +33 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +28 -0
  82. package/dist/llm/index.d.ts +2 -0
  83. package/dist/llm/index.d.ts.map +1 -0
  84. package/dist/llm/index.js +1 -0
  85. package/dist/llm/llm-provider.d.ts +41 -0
  86. package/dist/llm/llm-provider.d.ts.map +1 -0
  87. package/dist/llm/llm-provider.js +130 -0
  88. package/dist/manifest/index.d.ts +6 -0
  89. package/dist/manifest/index.d.ts.map +1 -0
  90. package/dist/manifest/index.js +3 -0
  91. package/dist/manifest/schema.d.ts +31 -0
  92. package/dist/manifest/schema.d.ts.map +1 -0
  93. package/dist/manifest/schema.js +44 -0
  94. package/dist/manifest/tier1-renderer.d.ts +31 -0
  95. package/dist/manifest/tier1-renderer.d.ts.map +1 -0
  96. package/dist/manifest/tier1-renderer.js +68 -0
  97. package/dist/manifest/validator.d.ts +34 -0
  98. package/dist/manifest/validator.d.ts.map +1 -0
  99. package/dist/manifest/validator.js +111 -0
  100. package/dist/matrix/checkpointer/matrix-upload-utils.d.ts +66 -0
  101. package/dist/matrix/checkpointer/matrix-upload-utils.d.ts.map +1 -0
  102. package/dist/matrix/checkpointer/matrix-upload-utils.js +228 -0
  103. package/dist/matrix/checkpointer/type.d.ts +4 -0
  104. package/dist/matrix/checkpointer/type.d.ts.map +1 -0
  105. package/dist/matrix/checkpointer/type.js +1 -0
  106. package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.module.d.ts +3 -0
  107. package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.module.d.ts.map +1 -0
  108. package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.module.js +22 -0
  109. package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.service.d.ts +93 -0
  110. package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.service.d.ts.map +1 -0
  111. package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.service.js +856 -0
  112. package/dist/matrix/room-membership.d.ts +11 -0
  113. package/dist/matrix/room-membership.d.ts.map +1 -0
  114. package/dist/matrix/room-membership.js +33 -0
  115. package/dist/meta-tools/index.d.ts +28 -0
  116. package/dist/meta-tools/index.d.ts.map +1 -0
  117. package/dist/meta-tools/index.js +24 -0
  118. package/dist/meta-tools/list-capabilities.d.ts +12 -0
  119. package/dist/meta-tools/list-capabilities.d.ts.map +1 -0
  120. package/dist/meta-tools/list-capabilities.js +55 -0
  121. package/dist/meta-tools/load-capability.d.ts +24 -0
  122. package/dist/meta-tools/load-capability.d.ts.map +1 -0
  123. package/dist/meta-tools/load-capability.js +82 -0
  124. package/dist/modules/auth/auth-header.middleware.d.ts +37 -0
  125. package/dist/modules/auth/auth-header.middleware.d.ts.map +1 -0
  126. package/dist/modules/auth/auth-header.middleware.js +115 -0
  127. package/dist/modules/auth/auth.module.d.ts +9 -0
  128. package/dist/modules/auth/auth.module.d.ts.map +1 -0
  129. package/dist/modules/auth/auth.module.js +27 -0
  130. package/dist/modules/auth/index.d.ts +3 -0
  131. package/dist/modules/auth/index.d.ts.map +1 -0
  132. package/dist/modules/auth/index.js +2 -0
  133. package/dist/modules/auth/validate-ucan-delegation.d.ts +31 -0
  134. package/dist/modules/auth/validate-ucan-delegation.d.ts.map +1 -0
  135. package/dist/modules/auth/validate-ucan-delegation.js +36 -0
  136. package/dist/modules/blob-store/blob-store.module.d.ts +10 -0
  137. package/dist/modules/blob-store/blob-store.module.d.ts.map +1 -0
  138. package/dist/modules/blob-store/blob-store.module.js +25 -0
  139. package/dist/modules/blob-store/blob-store.service.d.ts +66 -0
  140. package/dist/modules/blob-store/blob-store.service.d.ts.map +1 -0
  141. package/dist/modules/blob-store/blob-store.service.js +108 -0
  142. package/dist/modules/blob-store/index.d.ts +3 -0
  143. package/dist/modules/blob-store/index.d.ts.map +1 -0
  144. package/dist/modules/blob-store/index.js +2 -0
  145. package/dist/modules/health/health.controller.d.ts +18 -0
  146. package/dist/modules/health/health.controller.d.ts.map +1 -0
  147. package/dist/modules/health/health.controller.js +48 -0
  148. package/dist/modules/health/health.module.d.ts +8 -0
  149. package/dist/modules/health/health.module.d.ts.map +1 -0
  150. package/dist/modules/health/health.module.js +21 -0
  151. package/dist/modules/index.d.ts +8 -0
  152. package/dist/modules/index.d.ts.map +1 -0
  153. package/dist/modules/index.js +6 -0
  154. package/dist/modules/messages/__test-fixtures__/deps.d.ts +41 -0
  155. package/dist/modules/messages/__test-fixtures__/deps.d.ts.map +1 -0
  156. package/dist/modules/messages/__test-fixtures__/deps.js +73 -0
  157. package/dist/modules/messages/__test-fixtures__/fake-agent.d.ts +27 -0
  158. package/dist/modules/messages/__test-fixtures__/fake-agent.d.ts.map +1 -0
  159. package/dist/modules/messages/__test-fixtures__/fake-agent.js +41 -0
  160. package/dist/modules/messages/__test-fixtures__/fake-response.d.ts +29 -0
  161. package/dist/modules/messages/__test-fixtures__/fake-response.d.ts.map +1 -0
  162. package/dist/modules/messages/__test-fixtures__/fake-response.js +55 -0
  163. package/dist/modules/messages/agent-builder.d.ts +64 -0
  164. package/dist/modules/messages/agent-builder.d.ts.map +1 -0
  165. package/dist/modules/messages/agent-builder.js +219 -0
  166. package/dist/modules/messages/batch-invoker.d.ts +36 -0
  167. package/dist/modules/messages/batch-invoker.d.ts.map +1 -0
  168. package/dist/modules/messages/batch-invoker.js +58 -0
  169. package/dist/modules/messages/dto/list-messages.dto.d.ts +4 -0
  170. package/dist/modules/messages/dto/list-messages.dto.d.ts.map +1 -0
  171. package/dist/modules/messages/dto/list-messages.dto.js +17 -0
  172. package/dist/modules/messages/dto/send-message.dto.d.ts +73 -0
  173. package/dist/modules/messages/dto/send-message.dto.d.ts.map +1 -0
  174. package/dist/modules/messages/dto/send-message.dto.js +318 -0
  175. package/dist/modules/messages/file-processing-credit-sink.port.d.ts +20 -0
  176. package/dist/modules/messages/file-processing-credit-sink.port.d.ts.map +1 -0
  177. package/dist/modules/messages/file-processing-credit-sink.port.js +1 -0
  178. package/dist/modules/messages/file-processing.service.d.ts +195 -0
  179. package/dist/modules/messages/file-processing.service.d.ts.map +1 -0
  180. package/dist/modules/messages/file-processing.service.js +1278 -0
  181. package/dist/modules/messages/homeserver-cache.d.ts +11 -0
  182. package/dist/modules/messages/homeserver-cache.d.ts.map +1 -0
  183. package/dist/modules/messages/homeserver-cache.js +31 -0
  184. package/dist/modules/messages/matrix-listener-bridge.d.ts +63 -0
  185. package/dist/modules/messages/matrix-listener-bridge.d.ts.map +1 -0
  186. package/dist/modules/messages/matrix-listener-bridge.js +280 -0
  187. package/dist/modules/messages/messages.controller.d.ts +13 -0
  188. package/dist/modules/messages/messages.controller.d.ts.map +1 -0
  189. package/dist/modules/messages/messages.controller.js +95 -0
  190. package/dist/modules/messages/messages.module.d.ts +3 -0
  191. package/dist/modules/messages/messages.module.d.ts.map +1 -0
  192. package/dist/modules/messages/messages.module.js +75 -0
  193. package/dist/modules/messages/messages.service.d.ts +112 -0
  194. package/dist/modules/messages/messages.service.d.ts.map +1 -0
  195. package/dist/modules/messages/messages.service.js +279 -0
  196. package/dist/modules/messages/oracle-runtime-bundle.d.ts +38 -0
  197. package/dist/modules/messages/oracle-runtime-bundle.d.ts.map +1 -0
  198. package/dist/modules/messages/oracle-runtime-bundle.js +40 -0
  199. package/dist/modules/messages/post-message-syncer.d.ts +30 -0
  200. package/dist/modules/messages/post-message-syncer.d.ts.map +1 -0
  201. package/dist/modules/messages/post-message-syncer.js +73 -0
  202. package/dist/modules/messages/request-preparer.d.ts +53 -0
  203. package/dist/modules/messages/request-preparer.d.ts.map +1 -0
  204. package/dist/modules/messages/request-preparer.js +139 -0
  205. package/dist/modules/messages/sse-stream-runner.d.ts +73 -0
  206. package/dist/modules/messages/sse-stream-runner.d.ts.map +1 -0
  207. package/dist/modules/messages/sse-stream-runner.js +352 -0
  208. package/dist/modules/messages/sse.utils.d.ts +29 -0
  209. package/dist/modules/messages/sse.utils.d.ts.map +1 -0
  210. package/dist/modules/messages/sse.utils.js +77 -0
  211. package/dist/modules/messages/user-context-fetcher.d.ts +41 -0
  212. package/dist/modules/messages/user-context-fetcher.d.ts.map +1 -0
  213. package/dist/modules/messages/user-context-fetcher.js +117 -0
  214. package/dist/modules/secrets/index.d.ts +2 -0
  215. package/dist/modules/secrets/index.d.ts.map +1 -0
  216. package/dist/modules/secrets/index.js +1 -0
  217. package/dist/modules/secrets/secrets.service.d.ts +29 -0
  218. package/dist/modules/secrets/secrets.service.d.ts.map +1 -0
  219. package/dist/modules/secrets/secrets.service.js +107 -0
  220. package/dist/modules/sessions/dto/create-session.dto.d.ts +6 -0
  221. package/dist/modules/sessions/dto/create-session.dto.d.ts.map +1 -0
  222. package/dist/modules/sessions/dto/create-session.dto.js +5 -0
  223. package/dist/modules/sessions/dto/delete-session.dto.d.ts +6 -0
  224. package/dist/modules/sessions/dto/delete-session.dto.d.ts.map +1 -0
  225. package/dist/modules/sessions/dto/delete-session.dto.js +5 -0
  226. package/dist/modules/sessions/dto/list-sessions.dto.d.ts +7 -0
  227. package/dist/modules/sessions/dto/list-sessions.dto.d.ts.map +1 -0
  228. package/dist/modules/sessions/dto/list-sessions.dto.js +6 -0
  229. package/dist/modules/sessions/session-history-processor.service.d.ts +48 -0
  230. package/dist/modules/sessions/session-history-processor.service.d.ts.map +1 -0
  231. package/dist/modules/sessions/session-history-processor.service.js +254 -0
  232. package/dist/modules/sessions/sessions.controller.d.ts +13 -0
  233. package/dist/modules/sessions/sessions.controller.d.ts.map +1 -0
  234. package/dist/modules/sessions/sessions.controller.js +113 -0
  235. package/dist/modules/sessions/sessions.module.d.ts +3 -0
  236. package/dist/modules/sessions/sessions.module.d.ts.map +1 -0
  237. package/dist/modules/sessions/sessions.module.js +49 -0
  238. package/dist/modules/sessions/sessions.service.d.ts +23 -0
  239. package/dist/modules/sessions/sessions.service.d.ts.map +1 -0
  240. package/dist/modules/sessions/sessions.service.js +168 -0
  241. package/dist/modules/subscription/subscription.middleware.d.ts +37 -0
  242. package/dist/modules/subscription/subscription.middleware.d.ts.map +1 -0
  243. package/dist/modules/subscription/subscription.middleware.js +141 -0
  244. package/dist/modules/subscription/subscription.module.d.ts +12 -0
  245. package/dist/modules/subscription/subscription.module.d.ts.map +1 -0
  246. package/dist/modules/subscription/subscription.module.js +26 -0
  247. package/dist/modules/throttler/throttler.module.d.ts +11 -0
  248. package/dist/modules/throttler/throttler.module.d.ts.map +1 -0
  249. package/dist/modules/throttler/throttler.module.js +32 -0
  250. package/dist/modules/ucan/index.d.ts +7 -0
  251. package/dist/modules/ucan/index.d.ts.map +1 -0
  252. package/dist/modules/ucan/index.js +6 -0
  253. package/dist/modules/ucan/ucan.config.d.ts +87 -0
  254. package/dist/modules/ucan/ucan.config.d.ts.map +1 -0
  255. package/dist/modules/ucan/ucan.config.js +114 -0
  256. package/dist/modules/ucan/ucan.module.d.ts +29 -0
  257. package/dist/modules/ucan/ucan.module.d.ts.map +1 -0
  258. package/dist/modules/ucan/ucan.module.js +46 -0
  259. package/dist/modules/ucan/ucan.service.d.ts +129 -0
  260. package/dist/modules/ucan/ucan.service.d.ts.map +1 -0
  261. package/dist/modules/ucan/ucan.service.js +582 -0
  262. package/dist/modules/ws/emitter.d.ts +12 -0
  263. package/dist/modules/ws/emitter.d.ts.map +1 -0
  264. package/dist/modules/ws/emitter.js +12 -0
  265. package/dist/modules/ws/ws.gateway.d.ts +34 -0
  266. package/dist/modules/ws/ws.gateway.d.ts.map +1 -0
  267. package/dist/modules/ws/ws.gateway.js +241 -0
  268. package/dist/modules/ws/ws.module.d.ts +3 -0
  269. package/dist/modules/ws/ws.module.d.ts.map +1 -0
  270. package/dist/modules/ws/ws.module.js +21 -0
  271. package/dist/modules/ws/ws.service.d.ts +25 -0
  272. package/dist/modules/ws/ws.service.d.ts.map +1 -0
  273. package/dist/modules/ws/ws.service.js +113 -0
  274. package/dist/plugin-api/define-plugin.d.ts +19 -0
  275. package/dist/plugin-api/define-plugin.d.ts.map +1 -0
  276. package/dist/plugin-api/define-plugin.js +25 -0
  277. package/dist/plugin-api/oracle-plugin.d.ts +92 -0
  278. package/dist/plugin-api/oracle-plugin.d.ts.map +1 -0
  279. package/dist/plugin-api/oracle-plugin.js +15 -0
  280. package/dist/plugin-api/tool-helper.d.ts +33 -0
  281. package/dist/plugin-api/tool-helper.d.ts.map +1 -0
  282. package/dist/plugin-api/tool-helper.js +40 -0
  283. package/dist/plugin-api/types.d.ts +378 -0
  284. package/dist/plugin-api/types.d.ts.map +1 -0
  285. package/dist/plugin-api/types.js +1 -0
  286. package/dist/plugins/agui/agui-agent.d.ts +10 -0
  287. package/dist/plugins/agui/agui-agent.d.ts.map +1 -0
  288. package/dist/plugins/agui/agui-agent.js +110 -0
  289. package/dist/plugins/agui/agui.plugin.d.ts +16 -0
  290. package/dist/plugins/agui/agui.plugin.d.ts.map +1 -0
  291. package/dist/plugins/agui/agui.plugin.js +117 -0
  292. package/dist/plugins/agui/index.d.ts +3 -0
  293. package/dist/plugins/agui/index.d.ts.map +1 -0
  294. package/dist/plugins/agui/index.js +2 -0
  295. package/dist/plugins/composio/composio-tools.d.ts +59 -0
  296. package/dist/plugins/composio/composio-tools.d.ts.map +1 -0
  297. package/dist/plugins/composio/composio-tools.js +88 -0
  298. package/dist/plugins/composio/composio-ucan.d.ts +14 -0
  299. package/dist/plugins/composio/composio-ucan.d.ts.map +1 -0
  300. package/dist/plugins/composio/composio-ucan.js +32 -0
  301. package/dist/plugins/composio/composio.plugin.d.ts +45 -0
  302. package/dist/plugins/composio/composio.plugin.d.ts.map +1 -0
  303. package/dist/plugins/composio/composio.plugin.js +116 -0
  304. package/dist/plugins/composio/index.d.ts +4 -0
  305. package/dist/plugins/composio/index.d.ts.map +1 -0
  306. package/dist/plugins/composio/index.js +3 -0
  307. package/dist/plugins/credits/claim-processing.module.d.ts +28 -0
  308. package/dist/plugins/credits/claim-processing.module.d.ts.map +1 -0
  309. package/dist/plugins/credits/claim-processing.module.js +37 -0
  310. package/dist/plugins/credits/claim-processing.service.d.ts +92 -0
  311. package/dist/plugins/credits/claim-processing.service.d.ts.map +1 -0
  312. package/dist/plugins/credits/claim-processing.service.js +406 -0
  313. package/dist/plugins/credits/credits-middleware.d.ts +23 -0
  314. package/dist/plugins/credits/credits-middleware.d.ts.map +1 -0
  315. package/dist/plugins/credits/credits-middleware.js +154 -0
  316. package/dist/plugins/credits/credits.plugin.d.ts +55 -0
  317. package/dist/plugins/credits/credits.plugin.d.ts.map +1 -0
  318. package/dist/plugins/credits/credits.plugin.js +95 -0
  319. package/dist/plugins/credits/file-processing-sink.module.d.ts +18 -0
  320. package/dist/plugins/credits/file-processing-sink.module.d.ts.map +1 -0
  321. package/dist/plugins/credits/file-processing-sink.module.js +56 -0
  322. package/dist/plugins/credits/index.d.ts +8 -0
  323. package/dist/plugins/credits/index.d.ts.map +1 -0
  324. package/dist/plugins/credits/index.js +7 -0
  325. package/dist/plugins/credits/subscription-sink.module.d.ts +23 -0
  326. package/dist/plugins/credits/subscription-sink.module.d.ts.map +1 -0
  327. package/dist/plugins/credits/subscription-sink.module.js +54 -0
  328. package/dist/plugins/credits/token-limiter.d.ts +139 -0
  329. package/dist/plugins/credits/token-limiter.d.ts.map +1 -0
  330. package/dist/plugins/credits/token-limiter.js +302 -0
  331. package/dist/plugins/domain-indexer/domain-indexer-agent.d.ts +7 -0
  332. package/dist/plugins/domain-indexer/domain-indexer-agent.d.ts.map +1 -0
  333. package/dist/plugins/domain-indexer/domain-indexer-agent.js +48 -0
  334. package/dist/plugins/domain-indexer/domain-indexer-tools.d.ts +8 -0
  335. package/dist/plugins/domain-indexer/domain-indexer-tools.d.ts.map +1 -0
  336. package/dist/plugins/domain-indexer/domain-indexer-tools.js +194 -0
  337. package/dist/plugins/domain-indexer/domain-indexer.plugin.d.ts +20 -0
  338. package/dist/plugins/domain-indexer/domain-indexer.plugin.d.ts.map +1 -0
  339. package/dist/plugins/domain-indexer/domain-indexer.plugin.js +78 -0
  340. package/dist/plugins/domain-indexer/index.d.ts +2 -0
  341. package/dist/plugins/domain-indexer/index.d.ts.map +1 -0
  342. package/dist/plugins/domain-indexer/index.js +1 -0
  343. package/dist/plugins/editor/apply-sandbox-output.d.ts +33 -0
  344. package/dist/plugins/editor/apply-sandbox-output.d.ts.map +1 -0
  345. package/dist/plugins/editor/apply-sandbox-output.js +302 -0
  346. package/dist/plugins/editor/block-actions.d.ts +84 -0
  347. package/dist/plugins/editor/block-actions.d.ts.map +1 -0
  348. package/dist/plugins/editor/block-actions.js +471 -0
  349. package/dist/plugins/editor/blocknote-helper.d.ts +147 -0
  350. package/dist/plugins/editor/blocknote-helper.d.ts.map +1 -0
  351. package/dist/plugins/editor/blocknote-helper.js +542 -0
  352. package/dist/plugins/editor/blocknote-tools.d.ts +364 -0
  353. package/dist/plugins/editor/blocknote-tools.d.ts.map +1 -0
  354. package/dist/plugins/editor/blocknote-tools.js +2123 -0
  355. package/dist/plugins/editor/editor-agent.d.ts +47 -0
  356. package/dist/plugins/editor/editor-agent.d.ts.map +1 -0
  357. package/dist/plugins/editor/editor-agent.js +158 -0
  358. package/dist/plugins/editor/editor-mx.d.ts +56 -0
  359. package/dist/plugins/editor/editor-mx.d.ts.map +1 -0
  360. package/dist/plugins/editor/editor-mx.js +100 -0
  361. package/dist/plugins/editor/editor.plugin.d.ts +32 -0
  362. package/dist/plugins/editor/editor.plugin.d.ts.map +1 -0
  363. package/dist/plugins/editor/editor.plugin.js +189 -0
  364. package/dist/plugins/editor/index.d.ts +6 -0
  365. package/dist/plugins/editor/index.d.ts.map +1 -0
  366. package/dist/plugins/editor/index.js +5 -0
  367. package/dist/plugins/editor/mint-invocation-tool.d.ts +72 -0
  368. package/dist/plugins/editor/mint-invocation-tool.d.ts.map +1 -0
  369. package/dist/plugins/editor/mint-invocation-tool.js +173 -0
  370. package/dist/plugins/editor/page-functions.d.ts +100 -0
  371. package/dist/plugins/editor/page-functions.d.ts.map +1 -0
  372. package/dist/plugins/editor/page-functions.js +317 -0
  373. package/dist/plugins/editor/page-tools.d.ts +75 -0
  374. package/dist/plugins/editor/page-tools.d.ts.map +1 -0
  375. package/dist/plugins/editor/page-tools.js +238 -0
  376. package/dist/plugins/editor/prompts.d.ts +22 -0
  377. package/dist/plugins/editor/prompts.d.ts.map +1 -0
  378. package/dist/plugins/editor/prompts.js +451 -0
  379. package/dist/plugins/editor/provider.d.ts +101 -0
  380. package/dist/plugins/editor/provider.d.ts.map +1 -0
  381. package/dist/plugins/editor/provider.js +249 -0
  382. package/dist/plugins/editor/standalone-editor-tool.d.ts +17 -0
  383. package/dist/plugins/editor/standalone-editor-tool.d.ts.map +1 -0
  384. package/dist/plugins/editor/standalone-editor-tool.js +136 -0
  385. package/dist/plugins/editor/survey-helpers.d.ts +112 -0
  386. package/dist/plugins/editor/survey-helpers.d.ts.map +1 -0
  387. package/dist/plugins/editor/survey-helpers.js +358 -0
  388. package/dist/plugins/firecrawl/firecrawl-agent.d.ts +7 -0
  389. package/dist/plugins/firecrawl/firecrawl-agent.d.ts.map +1 -0
  390. package/dist/plugins/firecrawl/firecrawl-agent.js +84 -0
  391. package/dist/plugins/firecrawl/firecrawl-tools.d.ts +37 -0
  392. package/dist/plugins/firecrawl/firecrawl-tools.d.ts.map +1 -0
  393. package/dist/plugins/firecrawl/firecrawl-tools.js +129 -0
  394. package/dist/plugins/firecrawl/firecrawl.plugin.d.ts +32 -0
  395. package/dist/plugins/firecrawl/firecrawl.plugin.d.ts.map +1 -0
  396. package/dist/plugins/firecrawl/firecrawl.plugin.js +69 -0
  397. package/dist/plugins/firecrawl/index.d.ts +3 -0
  398. package/dist/plugins/firecrawl/index.d.ts.map +1 -0
  399. package/dist/plugins/firecrawl/index.js +2 -0
  400. package/dist/plugins/index.d.ts +47 -0
  401. package/dist/plugins/index.d.ts.map +1 -0
  402. package/dist/plugins/index.js +69 -0
  403. package/dist/plugins/matrix-group-chats/channel-memory.module.d.ts +7 -0
  404. package/dist/plugins/matrix-group-chats/channel-memory.module.d.ts.map +1 -0
  405. package/dist/plugins/matrix-group-chats/channel-memory.module.js +22 -0
  406. package/dist/plugins/matrix-group-chats/channel-memory.repo.d.ts +62 -0
  407. package/dist/plugins/matrix-group-chats/channel-memory.repo.d.ts.map +1 -0
  408. package/dist/plugins/matrix-group-chats/channel-memory.repo.js +311 -0
  409. package/dist/plugins/matrix-group-chats/channel-memory.service.d.ts +89 -0
  410. package/dist/plugins/matrix-group-chats/channel-memory.service.d.ts.map +1 -0
  411. package/dist/plugins/matrix-group-chats/channel-memory.service.js +565 -0
  412. package/dist/plugins/matrix-group-chats/channel-memory.summarizer.d.ts +18 -0
  413. package/dist/plugins/matrix-group-chats/channel-memory.summarizer.d.ts.map +1 -0
  414. package/dist/plugins/matrix-group-chats/channel-memory.summarizer.js +128 -0
  415. package/dist/plugins/matrix-group-chats/channel-memory.types.d.ts +50 -0
  416. package/dist/plugins/matrix-group-chats/channel-memory.types.d.ts.map +1 -0
  417. package/dist/plugins/matrix-group-chats/channel-memory.types.js +2 -0
  418. package/dist/plugins/matrix-group-chats/guard.d.ts +83 -0
  419. package/dist/plugins/matrix-group-chats/guard.d.ts.map +1 -0
  420. package/dist/plugins/matrix-group-chats/guard.js +138 -0
  421. package/dist/plugins/matrix-group-chats/index.d.ts +59 -0
  422. package/dist/plugins/matrix-group-chats/index.d.ts.map +1 -0
  423. package/dist/plugins/matrix-group-chats/index.js +140 -0
  424. package/dist/plugins/matrix-group-chats/middleware.d.ts +31 -0
  425. package/dist/plugins/matrix-group-chats/middleware.d.ts.map +1 -0
  426. package/dist/plugins/matrix-group-chats/middleware.js +186 -0
  427. package/dist/plugins/matrix-group-chats/power-levels.d.ts +15 -0
  428. package/dist/plugins/matrix-group-chats/power-levels.d.ts.map +1 -0
  429. package/dist/plugins/matrix-group-chats/power-levels.js +36 -0
  430. package/dist/plugins/matrix-group-chats/room-info.d.ts +23 -0
  431. package/dist/plugins/matrix-group-chats/room-info.d.ts.map +1 -0
  432. package/dist/plugins/matrix-group-chats/room-info.js +34 -0
  433. package/dist/plugins/matrix-group-chats/tools.d.ts +8 -0
  434. package/dist/plugins/matrix-group-chats/tools.d.ts.map +1 -0
  435. package/dist/plugins/matrix-group-chats/tools.js +154 -0
  436. package/dist/plugins/memory/index.d.ts +5 -0
  437. package/dist/plugins/memory/index.d.ts.map +1 -0
  438. package/dist/plugins/memory/index.js +3 -0
  439. package/dist/plugins/memory/memory-tools.d.ts +52 -0
  440. package/dist/plugins/memory/memory-tools.d.ts.map +1 -0
  441. package/dist/plugins/memory/memory-tools.js +88 -0
  442. package/dist/plugins/memory/memory-ucan.d.ts +17 -0
  443. package/dist/plugins/memory/memory-ucan.d.ts.map +1 -0
  444. package/dist/plugins/memory/memory-ucan.js +43 -0
  445. package/dist/plugins/memory/memory.plugin.d.ts +51 -0
  446. package/dist/plugins/memory/memory.plugin.d.ts.map +1 -0
  447. package/dist/plugins/memory/memory.plugin.js +76 -0
  448. package/dist/plugins/memory/types.d.ts +75 -0
  449. package/dist/plugins/memory/types.d.ts.map +1 -0
  450. package/dist/plugins/memory/types.js +2 -0
  451. package/dist/plugins/portal/index.d.ts +3 -0
  452. package/dist/plugins/portal/index.d.ts.map +1 -0
  453. package/dist/plugins/portal/index.js +2 -0
  454. package/dist/plugins/portal/portal-agent.d.ts +9 -0
  455. package/dist/plugins/portal/portal-agent.d.ts.map +1 -0
  456. package/dist/plugins/portal/portal-agent.js +70 -0
  457. package/dist/plugins/portal/portal.plugin.d.ts +16 -0
  458. package/dist/plugins/portal/portal.plugin.d.ts.map +1 -0
  459. package/dist/plugins/portal/portal.plugin.js +115 -0
  460. package/dist/plugins/sandbox/index.d.ts +3 -0
  461. package/dist/plugins/sandbox/index.d.ts.map +1 -0
  462. package/dist/plugins/sandbox/index.js +2 -0
  463. package/dist/plugins/sandbox/sandbox-mcp.d.ts +46 -0
  464. package/dist/plugins/sandbox/sandbox-mcp.d.ts.map +1 -0
  465. package/dist/plugins/sandbox/sandbox-mcp.js +80 -0
  466. package/dist/plugins/sandbox/sandbox-write-blob.d.ts +22 -0
  467. package/dist/plugins/sandbox/sandbox-write-blob.d.ts.map +1 -0
  468. package/dist/plugins/sandbox/sandbox-write-blob.js +80 -0
  469. package/dist/plugins/sandbox/sandbox.plugin.d.ts +80 -0
  470. package/dist/plugins/sandbox/sandbox.plugin.d.ts.map +1 -0
  471. package/dist/plugins/sandbox/sandbox.plugin.js +204 -0
  472. package/dist/plugins/skills/index.d.ts +3 -0
  473. package/dist/plugins/skills/index.d.ts.map +1 -0
  474. package/dist/plugins/skills/index.js +2 -0
  475. package/dist/plugins/skills/skills-tools.d.ts +20 -0
  476. package/dist/plugins/skills/skills-tools.d.ts.map +1 -0
  477. package/dist/plugins/skills/skills-tools.js +204 -0
  478. package/dist/plugins/skills/skills-ucan.d.ts +24 -0
  479. package/dist/plugins/skills/skills-ucan.d.ts.map +1 -0
  480. package/dist/plugins/skills/skills-ucan.js +28 -0
  481. package/dist/plugins/skills/skills.plugin.d.ts +37 -0
  482. package/dist/plugins/skills/skills.plugin.d.ts.map +1 -0
  483. package/dist/plugins/skills/skills.plugin.js +82 -0
  484. package/dist/plugins/slack/index.d.ts +4 -0
  485. package/dist/plugins/slack/index.d.ts.map +1 -0
  486. package/dist/plugins/slack/index.js +3 -0
  487. package/dist/plugins/slack/slack.module.d.ts +9 -0
  488. package/dist/plugins/slack/slack.module.d.ts.map +1 -0
  489. package/dist/plugins/slack/slack.module.js +27 -0
  490. package/dist/plugins/slack/slack.plugin.d.ts +30 -0
  491. package/dist/plugins/slack/slack.plugin.d.ts.map +1 -0
  492. package/dist/plugins/slack/slack.plugin.js +40 -0
  493. package/dist/plugins/slack/slack.service.d.ts +32 -0
  494. package/dist/plugins/slack/slack.service.d.ts.map +1 -0
  495. package/dist/plugins/slack/slack.service.js +157 -0
  496. package/dist/plugins/user-preferences/index.d.ts +4 -0
  497. package/dist/plugins/user-preferences/index.d.ts.map +1 -0
  498. package/dist/plugins/user-preferences/index.js +3 -0
  499. package/dist/plugins/user-preferences/service/user-preferences.service.d.ts +61 -0
  500. package/dist/plugins/user-preferences/service/user-preferences.service.d.ts.map +1 -0
  501. package/dist/plugins/user-preferences/service/user-preferences.service.js +105 -0
  502. package/dist/plugins/user-preferences/user-preferences-http.module.d.ts +10 -0
  503. package/dist/plugins/user-preferences/user-preferences-http.module.d.ts.map +1 -0
  504. package/dist/plugins/user-preferences/user-preferences-http.module.js +23 -0
  505. package/dist/plugins/user-preferences/user-preferences-tool.d.ts +22 -0
  506. package/dist/plugins/user-preferences/user-preferences-tool.d.ts.map +1 -0
  507. package/dist/plugins/user-preferences/user-preferences-tool.js +103 -0
  508. package/dist/plugins/user-preferences/user-preferences.controller.d.ts +18 -0
  509. package/dist/plugins/user-preferences/user-preferences.controller.d.ts.map +1 -0
  510. package/dist/plugins/user-preferences/user-preferences.controller.js +72 -0
  511. package/dist/plugins/user-preferences/user-preferences.plugin.d.ts +27 -0
  512. package/dist/plugins/user-preferences/user-preferences.plugin.d.ts.map +1 -0
  513. package/dist/plugins/user-preferences/user-preferences.plugin.js +66 -0
  514. package/dist/registries/config-schema-registry.d.ts +24 -0
  515. package/dist/registries/config-schema-registry.d.ts.map +1 -0
  516. package/dist/registries/config-schema-registry.js +27 -0
  517. package/dist/registries/index.d.ts +13 -0
  518. package/dist/registries/index.d.ts.map +1 -0
  519. package/dist/registries/index.js +6 -0
  520. package/dist/registries/manifest-registry.d.ts +49 -0
  521. package/dist/registries/manifest-registry.d.ts.map +1 -0
  522. package/dist/registries/manifest-registry.js +53 -0
  523. package/dist/registries/middleware-registry.d.ts +41 -0
  524. package/dist/registries/middleware-registry.d.ts.map +1 -0
  525. package/dist/registries/middleware-registry.js +52 -0
  526. package/dist/registries/shared-state-registry.d.ts +41 -0
  527. package/dist/registries/shared-state-registry.d.ts.map +1 -0
  528. package/dist/registries/shared-state-registry.js +65 -0
  529. package/dist/registries/subagent-registry.d.ts +55 -0
  530. package/dist/registries/subagent-registry.d.ts.map +1 -0
  531. package/dist/registries/subagent-registry.js +106 -0
  532. package/dist/registries/test-fixtures.d.ts +47 -0
  533. package/dist/registries/test-fixtures.d.ts.map +1 -0
  534. package/dist/registries/test-fixtures.js +168 -0
  535. package/dist/registries/tool-registry.d.ts +74 -0
  536. package/dist/registries/tool-registry.d.ts.map +1 -0
  537. package/dist/registries/tool-registry.js +130 -0
  538. package/dist/runtime-context/ambient.d.ts +118 -0
  539. package/dist/runtime-context/ambient.d.ts.map +1 -0
  540. package/dist/runtime-context/ambient.js +1 -0
  541. package/dist/runtime-context/build-plugin.d.ts +20 -0
  542. package/dist/runtime-context/build-plugin.d.ts.map +1 -0
  543. package/dist/runtime-context/build-plugin.js +16 -0
  544. package/dist/runtime-context/build-runtime.d.ts +60 -0
  545. package/dist/runtime-context/build-runtime.d.ts.map +1 -0
  546. package/dist/runtime-context/build-runtime.js +81 -0
  547. package/dist/testing/create-test-runtime.d.ts +95 -0
  548. package/dist/testing/create-test-runtime.d.ts.map +1 -0
  549. package/dist/testing/create-test-runtime.js +302 -0
  550. package/dist/testing/index.d.ts +5 -0
  551. package/dist/testing/index.d.ts.map +1 -0
  552. package/dist/testing/index.js +5 -0
  553. package/dist/testing/integration/chat-client.d.ts +143 -0
  554. package/dist/testing/integration/chat-client.d.ts.map +1 -0
  555. package/dist/testing/integration/chat-client.js +238 -0
  556. package/dist/testing/integration/harness.d.ts +189 -0
  557. package/dist/testing/integration/harness.d.ts.map +1 -0
  558. package/dist/testing/integration/harness.js +461 -0
  559. package/dist/testing/integration/index.d.ts +14 -0
  560. package/dist/testing/integration/index.d.ts.map +1 -0
  561. package/dist/testing/integration/index.js +18 -0
  562. package/dist/testing/integration/setup.d.ts +2 -0
  563. package/dist/testing/integration/setup.d.ts.map +1 -0
  564. package/dist/testing/integration/setup.js +41 -0
  565. package/dist/testing/integration/sse-parser.d.ts +99 -0
  566. package/dist/testing/integration/sse-parser.d.ts.map +1 -0
  567. package/dist/testing/integration/sse-parser.js +125 -0
  568. package/dist/testing/integration/ucan.d.ts +74 -0
  569. package/dist/testing/integration/ucan.d.ts.map +1 -0
  570. package/dist/testing/integration/ucan.js +95 -0
  571. package/dist/testing/integration/wait-for-matrix-loaded.d.ts +19 -0
  572. package/dist/testing/integration/wait-for-matrix-loaded.d.ts.map +1 -0
  573. package/dist/testing/integration/wait-for-matrix-loaded.js +31 -0
  574. package/dist/testing/mocks.d.ts +64 -0
  575. package/dist/testing/mocks.d.ts.map +1 -0
  576. package/dist/testing/mocks.js +141 -0
  577. package/dist/testing/nest-doubles.d.ts +10 -0
  578. package/dist/testing/nest-doubles.d.ts.map +1 -0
  579. package/dist/testing/nest-doubles.js +19 -0
  580. package/dist/utils/emoji.d.ts +3 -0
  581. package/dist/utils/emoji.d.ts.map +1 -0
  582. package/dist/utils/emoji.js +36 -0
  583. package/package.json +102 -0
@@ -0,0 +1,378 @@
1
+ import type { RequestMethod } from '@nestjs/common';
2
+ import type { z } from 'zod';
3
+ import type { BaseMessage } from '@langchain/core/messages';
4
+ import type { BaseChatModel } from '@langchain/core/language_models/chat_models';
5
+ /**
6
+ * Route shape returned by `OraclePlugin.getAuthExcludedRoutes()`. Mirrors the
7
+ * NestJS `RouteInfo` accepted by `MiddlewareConsumer.exclude(...)` so the
8
+ * runtime can pass these straight through.
9
+ */
10
+ export interface AuthExcludedRoute {
11
+ /** Path under the plugin's controller, e.g. `weather/now`. Leading slash optional. */
12
+ path: string;
13
+ /** HTTP method. Defaults to `RequestMethod.ALL` when omitted. */
14
+ method?: RequestMethod;
15
+ }
16
+ /** Merged Zod-validated env vars (core schema + every loaded plugin's `configSchema`). */
17
+ export type MergedConfig = Record<string, unknown>;
18
+ /** Plugin-scoped logger. */
19
+ export interface Logger {
20
+ log(message: unknown, ...optional: unknown[]): void;
21
+ error(message: unknown, ...optional: unknown[]): void;
22
+ warn(message: unknown, ...optional: unknown[]): void;
23
+ debug?(message: unknown, ...optional: unknown[]): void;
24
+ verbose?(message: unknown, ...optional: unknown[]): void;
25
+ /**
26
+ * Returns a new logger that auto-prefixes records with the given context.
27
+ * Optional — when absent, the same logger is returned unchanged.
28
+ */
29
+ child?(bindings: Record<string, unknown>): Logger;
30
+ }
31
+ /** LLM role tag used by `ctx.llm.get(role)`. Aligned with current `ModelRole`. */
32
+ export type ModelRole = 'main' | 'subagent' | 'utility' | (string & {});
33
+ /** Optional fields forwarded to ChatOpenAI when materialising an LLM. */
34
+ export type ChatOpenAIFields = Record<string, unknown>;
35
+ /** UCAN delegation envelope. */
36
+ export interface UcanDelegation {
37
+ readonly raw: string;
38
+ readonly issuer?: string;
39
+ readonly audience?: string;
40
+ readonly capabilities?: ReadonlyArray<{
41
+ resource: string;
42
+ action: string;
43
+ }>;
44
+ }
45
+ /** Per-room secret index. */
46
+ export type SecretIndex = Record<string, {
47
+ readonly key: string;
48
+ readonly version?: number;
49
+ }>;
50
+ /** Snapshot of a Matrix room's state events. */
51
+ export interface RoomStateSnapshot {
52
+ readonly roomId: string;
53
+ readonly state: ReadonlyArray<unknown>;
54
+ }
55
+ /** A single Matrix room event. */
56
+ export interface MatrixEvent {
57
+ readonly eventId: string;
58
+ readonly type: string;
59
+ readonly content: unknown;
60
+ readonly senderId?: string;
61
+ readonly originServerTs?: number;
62
+ }
63
+ /** Memory-enriched user context (mirrors `state.userContext`). */
64
+ export type UserContextData = Record<string, unknown>;
65
+ /** Read-only view over the LangGraph annotation state. */
66
+ export interface ReadonlyState {
67
+ readonly messages: readonly BaseMessage[];
68
+ readonly userContext?: UserContextData;
69
+ readonly loadedPlugins?: ReadonlySet<string>;
70
+ readonly [key: string]: unknown;
71
+ }
72
+ /**
73
+ * Read accessors registered by other plugins via `getSharedState()`.
74
+ * Forks can extend this via declaration merging (e.g. `userProfile`).
75
+ */
76
+ export interface SharedAccessors {
77
+ readonly [key: string]: unknown;
78
+ }
79
+ export type ToolCallEventPayload = Record<string, unknown>;
80
+ export type ActionCallEventPayload = Record<string, unknown>;
81
+ export type RenderComponentEventPayload = Record<string, unknown>;
82
+ export type ReasoningEventPayload = Record<string, unknown>;
83
+ export type BrowserToolCallEventPayload = Record<string, unknown>;
84
+ export type RouterEventPayload = Record<string, unknown>;
85
+ export type MessageCacheInvalidationPayload = Record<string, unknown>;
86
+ import type { AgentMiddleware } from 'langchain';
87
+ export type { AgentMiddleware };
88
+ /**
89
+ * The agent's structured interface to a plugin. Drives Tier-1 prompt
90
+ * composition and powers `list_capabilities` discovery.
91
+ */
92
+ export interface PluginManifest {
93
+ /** Human-readable name. */
94
+ title: string;
95
+ /** One-line description shown in the Tier-1 prompt for `always` plugins. */
96
+ summary: string;
97
+ /** Triggers — when the agent should consider this plugin. */
98
+ whenToUse: string[];
99
+ /** Anti-patterns — when the agent should NOT use this plugin. */
100
+ whenNotToUse?: string[];
101
+ /** Few-shot examples teaching the agent how to invoke the plugin. */
102
+ examples?: ManifestExample[];
103
+ /** Categorization for grouping and filtering. */
104
+ tags?: string[];
105
+ category?: 'data' | 'communication' | 'automation' | 'memory' | 'integration' | 'ui' | 'auth' | 'observability' | 'core';
106
+ /**
107
+ * Discovery and loading mode:
108
+ * - `always` — tools bound to agent at boot; listed in Tier-1 prompt.
109
+ * - `on-demand` — tools NOT bound; manifest discoverable via
110
+ * `list_capabilities`; agent calls `load_capability(name)`
111
+ * to load.
112
+ * - `silent` — invisible to agent; runs as middleware-only.
113
+ *
114
+ * Default: `on-demand`.
115
+ */
116
+ visibility?: 'always' | 'on-demand' | 'silent';
117
+ /** Stability hint surfaced to the agent (`experimental` → warning footnote). */
118
+ stability?: 'stable' | 'beta' | 'experimental';
119
+ }
120
+ export interface ManifestExample {
121
+ /** Representative user message. */
122
+ user: string;
123
+ /** Optional reasoning. */
124
+ thought?: string;
125
+ /** Tool the agent should call. */
126
+ tool: string;
127
+ /** Tool args. */
128
+ args?: Record<string, unknown>;
129
+ }
130
+ /**
131
+ * Author-provided prompt customization. Every field is optional — when absent
132
+ * the runtime falls back to its built-in defaults. Authored once, baked into
133
+ * the system prompt at build time.
134
+ */
135
+ export interface OraclePromptConfig {
136
+ /**
137
+ * Full replacement of the identity preamble. When set, used verbatim as the
138
+ * opening paragraph. When unset, the composer generates one from
139
+ * `name`/`org`/`description`.
140
+ */
141
+ opening?: string;
142
+ /**
143
+ * Appended to the runtime's operating-principles section. Use for tone,
144
+ * voice, formality, or oracle-specific behavioral hints.
145
+ */
146
+ communicationStyle?: string;
147
+ /**
148
+ * Author-written elevator pitch for what this oracle does. Rendered above
149
+ * the plugin-derived capability list — additive, not a replacement.
150
+ */
151
+ capabilities?: string;
152
+ }
153
+ /**
154
+ * Developer-facing oracle config. Passed inline to `createOracleApp`. The
155
+ * runtime fills in `entityDid` from the `ORACLE_ENTITY_DID` env var and
156
+ * combines this with bundled defaults to build the internal `OracleIdentity`.
157
+ */
158
+ export interface OracleConfig {
159
+ /** Oracle display name. Required. */
160
+ name: string;
161
+ /** Sponsoring organization. Optional — composer falls back gracefully. */
162
+ org?: string;
163
+ /** One-line description of what this oracle is for. */
164
+ description?: string;
165
+ /** Optional prompt customization (opening, communicationStyle, capabilities). */
166
+ prompt?: OraclePromptConfig;
167
+ }
168
+ /**
169
+ * Identity of the oracle running this plugin. Built by the runtime from
170
+ * `OracleConfig` + `ORACLE_ENTITY_DID` env var. Plugins read it via
171
+ * `PluginContext.identity` / `RuntimeContext` and should treat it as
172
+ * read-only.
173
+ */
174
+ export interface OracleIdentity {
175
+ name: string;
176
+ org: string;
177
+ description: string;
178
+ entityDid: string;
179
+ /** Author-provided prompt customization. Undefined when not configured. */
180
+ prompt?: OraclePromptConfig;
181
+ }
182
+ /**
183
+ * Passed to plugin methods called at request build time
184
+ * (`getTools`, `getSubAgents`, `getMiddlewares`). Lives once per request build.
185
+ *
186
+ * Holds no user, no session, no live socket, no request data.
187
+ */
188
+ export interface PluginContext<TConfig = MergedConfig> {
189
+ /** Merged Zod-validated env vars (core + all loaded plugins' configSchemas). */
190
+ config: TConfig;
191
+ /** Identity of this oracle. */
192
+ identity: OracleIdentity;
193
+ /** Set of plugin names currently loaded — drives soft-dep branching. */
194
+ availablePlugins: ReadonlySet<string>;
195
+ /** Plugin-scoped logger (auto-prefixed with the plugin's name). */
196
+ logger: Logger;
197
+ }
198
+ /**
199
+ * Passed to tool handlers, sub-agent handlers, and to plugin middlewares' hook
200
+ * functions. Built fresh per graph invocation.
201
+ */
202
+ export interface RuntimeContext<TConfig = MergedConfig> {
203
+ /** Authenticated user identity (validated by core auth middleware). */
204
+ user: {
205
+ did: string;
206
+ /** e.g. `@did-ixo-ixo1abc:ixo.world`. */
207
+ matrixUserId: string;
208
+ ucanDelegation: UcanDelegation;
209
+ timezone?: string;
210
+ currentTime?: string;
211
+ };
212
+ /** Session info from `SessionsService`. */
213
+ session: {
214
+ /** = `thread_id`; thread root `eventId`. */
215
+ id: string;
216
+ client: 'portal' | 'matrix' | 'slack';
217
+ wsId?: string;
218
+ requestId: string;
219
+ roomId?: string;
220
+ };
221
+ /** Read-only view over the graph state's history. */
222
+ history: {
223
+ messages: readonly BaseMessage[];
224
+ recent: (n: number) => BaseMessage[];
225
+ /** Memory enrichment from existing `state.userContext`. */
226
+ userContext: UserContextData;
227
+ /** Typed view over `Annotation.Root`. */
228
+ state: ReadonlyState;
229
+ };
230
+ /** Same merged Zod-validated env. */
231
+ config: TConfig;
232
+ /** Set of plugin names currently loaded (boot-fixed). */
233
+ availablePlugins: ReadonlySet<string>;
234
+ /** Plugins the agent has loaded for THIS thread via `load_capability`. */
235
+ loadedPlugins: ReadonlySet<string>;
236
+ /** Per-room secrets (JWE-encrypted, 24h cache; today's `SecretsService`). */
237
+ secrets: {
238
+ getIndex: () => Promise<SecretIndex>;
239
+ getValues: (keys: string[]) => Promise<Record<string, string>>;
240
+ };
241
+ /**
242
+ * Short-TTL keyed value store for content the LLM should never relay
243
+ * verbatim (UCAN invocation CARs, JWTs, signed envelopes, etc.). A
244
+ * producing tool stores the value and returns a short hex blobId; a
245
+ * consuming tool looks the value up server-side and forwards it on. Blobs
246
+ * are namespaced by issuing user DID — cross-user reads always miss.
247
+ */
248
+ blobStore: {
249
+ /** Store a value and return a fresh `blob_<16 hex>` id. TTL clamped to
250
+ * the service's `MAX_TTL_SECONDS` (24h); defaults to `DEFAULT_TTL_SECONDS`
251
+ * (1h) when omitted. Pass `userDid` from a trusted source — never from
252
+ * LLM-supplied arguments. */
253
+ put: (params: {
254
+ userDid: string;
255
+ name: string;
256
+ value: string;
257
+ ttlSeconds?: number;
258
+ }) => Promise<string>;
259
+ /** Retrieve a blob by id, scoped to the requesting user. Returns `null`
260
+ * if the blob doesn't exist, has expired, or belongs to a different user. */
261
+ get: (params: {
262
+ userDid: string;
263
+ blobId: string;
264
+ }) => Promise<{
265
+ name: string;
266
+ value: string;
267
+ } | null>;
268
+ /** Lightweight format check (`blob_<16 hex>`). Use in tool input handlers
269
+ * to reject malformed IDs before paying for a cache lookup. */
270
+ isValidBlobId: (value: unknown) => value is string;
271
+ };
272
+ /** Matrix client, scoped operations only. */
273
+ matrix: {
274
+ postToRoom: (roomId: string, content: unknown) => Promise<string>;
275
+ getRoomState: (roomId: string) => Promise<RoomStateSnapshot>;
276
+ getEventById: (roomId: string, eventId: string) => Promise<MatrixEvent>;
277
+ };
278
+ /** UCAN authorization helpers. */
279
+ ucan: {
280
+ requireCapability: (resource: string, action: string) => void;
281
+ hasCapability: (resource: string, action: string) => boolean;
282
+ mintInvocation: (target: {
283
+ did: string;
284
+ capability: string;
285
+ }, opts?: {
286
+ skipCache?: boolean;
287
+ }) => Promise<string>;
288
+ /**
289
+ * Resolve a downstream service URL to its did:web identifier. Returns
290
+ * `null` when the document is missing or has no `id` — used by plugins
291
+ * minting service-targeted UCAN invocations.
292
+ */
293
+ resolveServiceDid: (serviceUrl: string) => Promise<string | null>;
294
+ /**
295
+ * `true` once the oracle has loaded its Ed25519 signing mnemonic. Plugins
296
+ * gate registration of mint-capable tools on this — without a key, minting
297
+ * is a no-op and the tool should surface an error rather than pretend.
298
+ */
299
+ hasSigningKey: () => boolean;
300
+ /**
301
+ * Mint a UCAN invocation from a directly-supplied delegation CAR (rather
302
+ * than a per-user cached one). Used by the editor's `mint_invocation`
303
+ * tool: it reads the CAR from a flow's Y.Doc by CID and re-mints a fresh
304
+ * single-use invocation targeted at a specific service route.
305
+ */
306
+ createInvocationFromDelegation: (delegationCar: string, serviceUrl: string, capability: {
307
+ can: string;
308
+ with: string;
309
+ }, options?: {
310
+ maxTtlSeconds?: number;
311
+ }) => Promise<{
312
+ invocation: string;
313
+ } | {
314
+ error: string;
315
+ }>;
316
+ };
317
+ /** LLM provider. */
318
+ llm: {
319
+ get: (role: ModelRole, params?: ChatOpenAIFields) => BaseChatModel;
320
+ };
321
+ /** Typed event emitter (today's `@ixo/oracles-events` 7 event types). */
322
+ emit: {
323
+ toolCall: (payload: ToolCallEventPayload) => void;
324
+ actionCall: (payload: ActionCallEventPayload) => void;
325
+ renderComponent: (payload: RenderComponentEventPayload) => void;
326
+ reasoning: (payload: ReasoningEventPayload) => void;
327
+ browserToolCall: (payload: BrowserToolCallEventPayload) => void;
328
+ router: (payload: RouterEventPayload) => void;
329
+ messageCacheInvalidation: (payload: MessageCacheInvalidationPayload) => void;
330
+ };
331
+ /** Plugin-scoped logger. */
332
+ logger: Logger;
333
+ /** Propagates from the HTTP request / graph invocation. */
334
+ abortSignal: AbortSignal;
335
+ /** Read accessors for state owned by other plugins. */
336
+ shared: SharedAccessors;
337
+ /**
338
+ * Identifier of the inbound tool call that triggered this handler, when
339
+ * available. Undefined for direct/test invocations. Used by tools that
340
+ * return a LangGraph `Command` and need to append a matching `ToolMessage`
341
+ * to the state update.
342
+ */
343
+ toolCallId?: string;
344
+ }
345
+ export interface PluginTool {
346
+ name: string;
347
+ description: string;
348
+ schema: z.ZodType;
349
+ handler: (args: unknown, ctx: RuntimeContext) => Promise<unknown>;
350
+ /** Override visibility — by default inherits from the plugin's `manifest.visibility`. */
351
+ visibility?: 'always' | 'on-demand' | 'silent';
352
+ }
353
+ export interface PluginSubAgent {
354
+ /** Tool name the agent will see (e.g. `call_memory_agent`). */
355
+ name: string;
356
+ description: string;
357
+ systemPrompt: string | ((ctx: PluginContext) => string);
358
+ tools: PluginTool[] | ((ctx: PluginContext) => PluginTool[]);
359
+ /** LLM role; default `subagent`. */
360
+ model?: ModelRole;
361
+ /** Sub-agent-scoped middleware (e.g. summarization for long conversations). */
362
+ middlewares?: AgentMiddleware[];
363
+ /**
364
+ * Forward this sub-agent's internal tool calls + results into the parent
365
+ * graph's message history so the UI renders them in the main chat.
366
+ *
367
+ * - `true` → forward ALL of this sub-agent's own tools
368
+ * - `false` / omitted → forward nothing
369
+ * - `string[]` → forward only the listed tool names
370
+ *
371
+ * Runtime-injected passthrough tools (e.g. memory CRUD) are never
372
+ * forwarded — they're already on the main agent.
373
+ */
374
+ forwardTools?: boolean | string[];
375
+ /** Called after sub-agent completes; can emit follow-up events. */
376
+ onComplete?: (result: string, ctx: RuntimeContext) => Promise<void>;
377
+ }
378
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin-api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;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AC;IAEf,2DAA2D;IAC3D,WAAW,EAAE,WAAW,CAAC;IAEzB,uDAAuD;IACvD,MAAM,EAAE,eAAe,CAAC;IAExB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAClE,yFAAyF;IACzF,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;CAChD;AAED,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;IACxD,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,aAAa,KAAK,UAAU,EAAE,CAAC,CAAC;IAC7D,oCAAoC;IACpC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAClC,mEAAmE;IACnE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { PluginSubAgent, PluginTool } from '../../plugin-api/types.js';
2
+ /**
3
+ * Build the AG-UI sub-agent. Tools are derived per-request from
4
+ * `state.agActions` (one PluginTool per declared action). Reasoning disabled
5
+ * on purpose: this is a structured tool-calling task, not a reasoning task —
6
+ * reasoning mode causes the model to narrate its plan in free text instead of
7
+ * emitting the tool call.
8
+ */
9
+ export declare function createAguiSubAgent(tools: PluginTool[]): PluginSubAgent;
10
+ //# sourceMappingURL=agui-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agui-agent.d.ts","sourceRoot":"","sources":["../../../src/plugins/agui/agui-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AA+F5E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,cAAc,CActE"}
@@ -0,0 +1,110 @@
1
+ const formatToolDocs = (tools) => {
2
+ if (!tools.length) {
3
+ return '- No AG-UI tools configured.';
4
+ }
5
+ return tools
6
+ .map((t) => {
7
+ const description = t.description?.trim() ?? 'No description provided.';
8
+ return `- \`${t.name}\`: ${description}`;
9
+ })
10
+ .join('\n');
11
+ };
12
+ const buildAguiPrompt = (toolsDoc) => `
13
+ You are the AG-UI Agent — a specialized sub-agent that generates interactive UI
14
+ components in the user's browser by calling AG-UI (Agent Generated UI) tools.
15
+
16
+ ## 🚨 THE ONLY RULE THAT MATTERS
17
+
18
+ **If the task gives you enough parameters to call a tool, you MUST call the tool. You are FORBIDDEN from responding with text alone when a tool call is possible.**
19
+
20
+ Your response counts as a failure if you say things like "I've created the table" or "The visualization is ready" without actually invoking an AG-UI tool in this turn. The user sees nothing if you don't call the tool — your natural-language summary is meaningless on its own.
21
+
22
+ ## What are AG-UI Tools?
23
+ AG-UI tools dynamically generate interactive components (tables, charts, forms,
24
+ etc.) that render directly in the client's browser. They execute instantly
25
+ without backend processing.
26
+
27
+ ## Available AG-UI Tools
28
+ ${toolsDoc}
29
+
30
+ ## Worked Example — fruits table
31
+
32
+ \`\`\`
33
+ Task: "Create a data table with these 5 fruits: [{name: 'Apple', color: 'Red', price: 1.5}, ...]"
34
+
35
+ Your action: call create_data_table with
36
+ {
37
+ id: "fruits_table",
38
+ title: "Fruits",
39
+ data: [{name: "Apple", color: "Red", price: 1.5}, ...],
40
+ columns: [
41
+ {key: "name", label: "Fruit"},
42
+ {key: "color", label: "Color"},
43
+ {key: "price", label: "Avg Price"}
44
+ ]
45
+ }
46
+
47
+ Your message: "Here's the fruits table."
48
+ \`\`\`
49
+
50
+ ## Message Output Rules (after the tool call)
51
+
52
+ Your message to the main agent should ONLY be a short natural-language
53
+ confirmation — NEVER the data, JSON, or a text rendition of the UI.
54
+
55
+ **✅ DO:**
56
+ - Call the AG-UI tool FIRST.
57
+ - Then add one short sentence like "Here's the fruits table" or "Rendered the revenue chart."
58
+
59
+ **❌ DON'T:**
60
+ - Output data as markdown tables in your message.
61
+ - Display JSON or raw rows in your message.
62
+ - Recreate the table/chart/list as text — the canvas already shows it.
63
+ - Reply "I've created …" without actually having called the tool.
64
+
65
+ ## Schema Compliance
66
+ - STRICTLY follow each tool's schema.
67
+ - All required fields must be present and correctly typed.
68
+ - Extract parameters verbatim from the task — do not substitute, guess, or reformat values.
69
+ - Validation errors cause the tool to fail silently — double-check before calling.
70
+
71
+ ## Task Discipline
72
+ - You are a one-shot sub-agent invoked by the main agent. Your single task
73
+ message is ALL the context you have. Do not assume prior conversation state.
74
+ - If the task is unclear or missing critical details, STOP immediately and
75
+ return a clear message explaining what's missing. Do NOT guess.
76
+ - Never loop or retry the same failing approach. If the first attempt fails,
77
+ stop and return a clear error — the main agent will re-invoke you if needed.
78
+
79
+ ## Workflow
80
+ 1. Parse the task. Identify which tool to use and which parameters to pass.
81
+ 2. Extract parameters verbatim from the task.
82
+ 3. **CALL THE TOOL.** This is not optional.
83
+ 4. Add one short confirmation sentence.
84
+ `.trim();
85
+ const buildAguiDescription = (tools) => {
86
+ const names = tools.map((t) => t.name).join(', ') || 'no configured tools';
87
+ return `Specialized AG-UI Agent that generates interactive UI components (tables, charts, forms) in the user's browser. Available tools: (${names}).`;
88
+ };
89
+ /**
90
+ * Build the AG-UI sub-agent. Tools are derived per-request from
91
+ * `state.agActions` (one PluginTool per declared action). Reasoning disabled
92
+ * on purpose: this is a structured tool-calling task, not a reasoning task —
93
+ * reasoning mode causes the model to narrate its plan in free text instead of
94
+ * emitting the tool call.
95
+ */
96
+ export function createAguiSubAgent(tools) {
97
+ const toolsDoc = formatToolDocs(tools);
98
+ return {
99
+ name: 'AG-UI Agent',
100
+ description: buildAguiDescription(tools),
101
+ systemPrompt: buildAguiPrompt(toolsDoc),
102
+ tools,
103
+ model: 'subagent',
104
+ middlewares: [],
105
+ // AG-UI action invocations must surface in the main chat so the UI can
106
+ // render the corresponding component events. Forward every action this
107
+ // sub-agent exposes — the tool list IS the action list.
108
+ forwardTools: true,
109
+ };
110
+ }
@@ -0,0 +1,16 @@
1
+ import { OraclePlugin } from '../../plugin-api/oracle-plugin.js';
2
+ import type { PluginManifest, PluginSubAgent, RuntimeContext } from '../../plugin-api/types.js';
3
+ /**
4
+ * AG-UI plugin (Portal copilot). The sub-agent is built per-request from
5
+ * `state.agActions` — the client declares its renderable actions on each
6
+ * `sendMessage`, the runtime wraps each into a PluginTool, and the agent
7
+ * decides whether to delegate. When no actions are declared the plugin
8
+ * contributes nothing.
9
+ */
10
+ export declare class AGUIPlugin extends OraclePlugin {
11
+ readonly name = "agui";
12
+ readonly version = "1.0.0";
13
+ readonly manifest: PluginManifest;
14
+ getRequestSubAgents(rtCtx: RuntimeContext): Promise<PluginSubAgent[]>;
15
+ }
16
+ //# sourceMappingURL=agui.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agui.plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/agui/agui.plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEd,cAAc,EACf,MAAM,2BAA2B,CAAC;AAiHnC;;;;;;GAMG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,QAAQ,CAAC,IAAI,UAAU;IAEvB,QAAQ,CAAC,OAAO,WAAW;IAE3B,QAAQ,CAAC,QAAQ,iBAAY;IAEd,mBAAmB,CAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,cAAc,EAAE,CAAC;CAO7B"}
@@ -0,0 +1,117 @@
1
+ import { callAgAction, logActionToMatrix } from '@ixo/common';
2
+ import { randomUUID } from 'node:crypto';
3
+ import { z } from 'zod';
4
+ import { OraclePlugin } from '../../plugin-api/oracle-plugin.js';
5
+ import { tool } from '../../plugin-api/tool-helper.js';
6
+ import { createAguiSubAgent } from './agui-agent.js';
7
+ const manifest = {
8
+ title: 'AG-UI',
9
+ summary: "Renders interactive UI components (tables, charts, forms) in the user's browser via AG-UI actions.",
10
+ whenToUse: [
11
+ 'User asks for an interactive table, chart, or form to be rendered.',
12
+ 'A response is best shown as a structured UI component rather than plain text.',
13
+ ],
14
+ whenNotToUse: [
15
+ 'No AG-UI actions are declared on this request (sub-agent is not built).',
16
+ "A plain text answer is sufficient — don't render UI just because you can.",
17
+ ],
18
+ examples: [
19
+ {
20
+ user: 'Show me the results as a table.',
21
+ thought: 'Structured display — delegate to call_ag-ui_agent with the rows.',
22
+ tool: 'call_ag-ui_agent',
23
+ },
24
+ ],
25
+ tags: ['agui', 'ui', 'portal', 'copilot'],
26
+ category: 'ui',
27
+ visibility: 'on-demand',
28
+ stability: 'stable',
29
+ };
30
+ /** Default per-action timeout — matches today's `parserActionTool`. */
31
+ const ACTION_TIMEOUT_MS = 15_000;
32
+ const AG_ACTION_SHAPE = z.object({
33
+ name: z.string(),
34
+ description: z.string(),
35
+ schema: z.record(z.string(), z.unknown()),
36
+ hasRender: z.boolean().optional(),
37
+ });
38
+ const ARGS_RECORD_SHAPE = z.record(z.string(), z.unknown());
39
+ function parseAgActions(value) {
40
+ if (!Array.isArray(value))
41
+ return [];
42
+ const out = [];
43
+ for (const entry of value) {
44
+ const parsed = AG_ACTION_SHAPE.safeParse(entry);
45
+ if (parsed.success)
46
+ out.push(parsed.data);
47
+ }
48
+ return out;
49
+ }
50
+ function parseArgs(input) {
51
+ const parsed = ARGS_RECORD_SHAPE.safeParse(input ?? {});
52
+ return parsed.success ? parsed.data : {};
53
+ }
54
+ /**
55
+ * Build a single PluginTool that, when invoked, dispatches the AG-UI action to
56
+ * the user's frontend via the existing `callAgAction` helper and waits for the
57
+ * result. Mirrors today's `parserActionTool` behaviour (matrix logging on
58
+ * success, unique tool-call id per invocation) but sources `sessionId`,
59
+ * `requestId`, and `roomId` from `RuntimeContext` instead of LangChain'
60
+ * configurable bag.
61
+ */
62
+ function buildActionTool(action) {
63
+ return tool(async (input, ctx) => {
64
+ const sessionId = ctx.session.id;
65
+ if (!sessionId) {
66
+ throw new Error('sessionId is required for AG-UI actions');
67
+ }
68
+ const args = parseArgs(input);
69
+ const requestId = ctx.session.requestId;
70
+ const toolCallId = `ag_${requestId || 'noreq'}_${randomUUID().slice(0, 8)}`;
71
+ const result = await callAgAction({
72
+ sessionId,
73
+ toolCallId,
74
+ toolName: action.name,
75
+ args,
76
+ timeout: ACTION_TIMEOUT_MS,
77
+ });
78
+ if (ctx.session.roomId) {
79
+ void logActionToMatrix({
80
+ name: action.name,
81
+ args,
82
+ result,
83
+ success: true,
84
+ }, {
85
+ roomId: ctx.session.roomId,
86
+ threadId: sessionId,
87
+ });
88
+ }
89
+ return JSON.stringify(result);
90
+ }, {
91
+ name: action.name,
92
+ description: action.description,
93
+ schema: z.fromJSONSchema(action.schema),
94
+ });
95
+ }
96
+ function readAgActions(rtCtx) {
97
+ return parseAgActions(rtCtx.history.state.agActions);
98
+ }
99
+ /**
100
+ * AG-UI plugin (Portal copilot). The sub-agent is built per-request from
101
+ * `state.agActions` — the client declares its renderable actions on each
102
+ * `sendMessage`, the runtime wraps each into a PluginTool, and the agent
103
+ * decides whether to delegate. When no actions are declared the plugin
104
+ * contributes nothing.
105
+ */
106
+ export class AGUIPlugin extends OraclePlugin {
107
+ name = 'agui';
108
+ version = '1.0.0';
109
+ manifest = manifest;
110
+ async getRequestSubAgents(rtCtx) {
111
+ const actions = readAgActions(rtCtx);
112
+ if (actions.length === 0)
113
+ return [];
114
+ const tools = actions.map(buildActionTool);
115
+ return [createAguiSubAgent(tools)];
116
+ }
117
+ }
@@ -0,0 +1,3 @@
1
+ export { AGUIPlugin } from './agui.plugin.js';
2
+ export { createAguiSubAgent } from './agui-agent.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/agui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { AGUIPlugin } from './agui.plugin.js';
2
+ export { createAguiSubAgent } from './agui-agent.js';