@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,241 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ var WsGateway_1;
14
+ import { GraphEventEmitter, rootEventEmitter } from '@ixo/oracles-events';
15
+ import { Logger, Optional } from '@nestjs/common';
16
+ import { ConfigService } from '@nestjs/config';
17
+ import { ApiOperation, ApiResponse } from '@nestjs/swagger';
18
+ import { ConnectedSocket, MessageBody, SubscribeMessage, WebSocketGateway, WebSocketServer, } from '@nestjs/websockets';
19
+ import { Server, Socket } from 'socket.io';
20
+ import { validateUcanDelegation } from '../auth/validate-ucan-delegation.js';
21
+ import { UcanService } from '../ucan/ucan.service.js';
22
+ import { WsService } from './ws.service.js';
23
+ let WsGateway = WsGateway_1 = class WsGateway {
24
+ wsService;
25
+ configService;
26
+ ucanService;
27
+ server;
28
+ logger = new Logger(WsGateway_1.name);
29
+ constructor(wsService, configService, ucanService) {
30
+ this.wsService = wsService;
31
+ this.configService = configService;
32
+ this.ucanService = ucanService;
33
+ }
34
+ afterInit() {
35
+ this.logger.log('WebSocket gateway initialized');
36
+ GraphEventEmitter.registerEventHandlers(this.server);
37
+ }
38
+ async handleConnection(client) {
39
+ const sessionId = client.handshake.query.sessionId;
40
+ if (!sessionId || typeof sessionId !== 'string') {
41
+ this.logger.error(`WebSocket connection attempt without sessionId from ${client.id}`);
42
+ client.disconnect();
43
+ return;
44
+ }
45
+ // Authenticate the handshake the same way HTTP requests are authenticated:
46
+ // a valid UCAN delegation is required, and the user identity is the
47
+ // *validated invoker* — never the `userDid` the client put in the query.
48
+ // Trusting the query (the previous behaviour) let any client impersonate
49
+ // another user and poison the per-DID delegation cache.
50
+ const ucanDelegation = client.handshake.auth?.ucanDelegation;
51
+ if (!ucanDelegation) {
52
+ this.logger.warn(`WebSocket connection rejected for session ${sessionId}: missing UCAN delegation (client: ${client.id})`);
53
+ client.disconnect();
54
+ return;
55
+ }
56
+ const oracleDid = this.configService.get('ORACLE_DID');
57
+ if (!oracleDid) {
58
+ this.logger.error('WebSocket auth unavailable: ORACLE_DID not configured — rejecting connection');
59
+ client.disconnect();
60
+ return;
61
+ }
62
+ const blocksyncUri = this.configService.getOrThrow('BLOCKSYNC_GRAPHQL_URL');
63
+ const outcome = await validateUcanDelegation(ucanDelegation, {
64
+ oracleDid,
65
+ blocksyncUri,
66
+ });
67
+ if (!outcome.ok) {
68
+ this.logger.warn(`WebSocket connection rejected for session ${sessionId}: ${outcome.error} (client: ${client.id})`);
69
+ client.disconnect();
70
+ return;
71
+ }
72
+ const userDid = outcome.result.userDid;
73
+ // Stash the validated identity on the socket so disconnect-time history
74
+ // processing reads the authenticated DID rather than the untrusted query.
75
+ client.data.userDid = userDid;
76
+ this.logger.log(`WebSocket connection established for session: ${sessionId}, did: ${userDid}, client: ${client.id}`);
77
+ // Cache the (now-validated) delegation for downstream invocations, keyed
78
+ // by the validated invoker DID and bounded by the delegation's lifetime.
79
+ if (this.ucanService) {
80
+ await this.ucanService.cacheDelegation(userDid, ucanDelegation, outcome.result.delegation.expiration);
81
+ }
82
+ // Join the sessionId room (channel) — this is the key integration!
83
+ await client.join(sessionId);
84
+ this.wsService.addClientConnection(sessionId, client);
85
+ client.emit('connected', {
86
+ message: 'Connected successfully',
87
+ sessionId,
88
+ timestamp: new Date().toISOString(),
89
+ });
90
+ }
91
+ handleDisconnect(client) {
92
+ const sessionId = client.handshake.query.sessionId;
93
+ if (sessionId) {
94
+ this.logger.log(`WebSocket connection closed for session: ${sessionId}, client: ${client.id}`);
95
+ void this.wsService.removeClientConnection(sessionId, client);
96
+ }
97
+ else {
98
+ this.logger.warn(`WebSocket disconnected without sessionId: ${client.id}`);
99
+ }
100
+ }
101
+ handlePing(client) {
102
+ client.emit('pong', {
103
+ timestamp: new Date().toISOString(),
104
+ sessionId: client.handshake.query.sessionId,
105
+ });
106
+ }
107
+ handleStatus(client) {
108
+ client.emit('status', {
109
+ connected: true,
110
+ sessionId: client.handshake.query.sessionId,
111
+ activeSessions: this.wsService.getActiveSessionsCount(),
112
+ totalConnections: this.wsService.getTotalConnectionsCount(),
113
+ timestamp: new Date().toISOString(),
114
+ });
115
+ }
116
+ /**
117
+ * Forward a tool/action result back to LangGraph via the root event emitter.
118
+ */
119
+ handleFrontendToolResult(client, data, eventType) {
120
+ const sessionId = client.handshake.query.sessionId;
121
+ const toolId = data.toolCallId;
122
+ this.logger.log(`${eventType} received for session: ${sessionId}, toolId: ${toolId}`);
123
+ rootEventEmitter.emit(eventType, {
124
+ sessionId,
125
+ ...data,
126
+ timestamp: new Date().toISOString(),
127
+ });
128
+ }
129
+ handleToolResult(client, data) {
130
+ this.handleFrontendToolResult(client, data, 'browser_tool_result');
131
+ }
132
+ handleActionCallResult(client, data) {
133
+ this.handleFrontendToolResult(client, data, 'action_call_result');
134
+ }
135
+ handleListEvents(client) {
136
+ client.emit('available-events', {
137
+ clientEvents: [
138
+ 'ping',
139
+ 'status',
140
+ 'subscribe',
141
+ 'list-events',
142
+ 'tool_result',
143
+ 'action_call_result',
144
+ ],
145
+ serverEvents: [
146
+ 'connected',
147
+ 'pong',
148
+ 'status',
149
+ 'subscribed',
150
+ 'available-events',
151
+ // LangGraph events
152
+ 'render_component',
153
+ 'tool_call',
154
+ 'action_call',
155
+ 'browser_tool_call',
156
+ 'router_update',
157
+ 'message_cache_invalidation',
158
+ ],
159
+ sessionId: client.handshake.query.sessionId,
160
+ timestamp: new Date().toISOString(),
161
+ });
162
+ }
163
+ };
164
+ __decorate([
165
+ WebSocketServer(),
166
+ __metadata("design:type", Server)
167
+ ], WsGateway.prototype, "server", void 0);
168
+ __decorate([
169
+ SubscribeMessage('ping'),
170
+ __param(0, ConnectedSocket()),
171
+ __metadata("design:type", Function),
172
+ __metadata("design:paramtypes", [Socket]),
173
+ __metadata("design:returntype", void 0)
174
+ ], WsGateway.prototype, "handlePing", null);
175
+ __decorate([
176
+ SubscribeMessage('status'),
177
+ __param(0, ConnectedSocket()),
178
+ __metadata("design:type", Function),
179
+ __metadata("design:paramtypes", [Socket]),
180
+ __metadata("design:returntype", void 0)
181
+ ], WsGateway.prototype, "handleStatus", null);
182
+ __decorate([
183
+ SubscribeMessage('tool_result'),
184
+ ApiOperation({
185
+ summary: 'Handle Tool Result',
186
+ description: 'Receive tool execution result from client and forward to LangGraph',
187
+ }),
188
+ ApiResponse({
189
+ status: 200,
190
+ description: 'Tool result received successfully',
191
+ }),
192
+ __param(0, ConnectedSocket()),
193
+ __param(1, MessageBody()),
194
+ __metadata("design:type", Function),
195
+ __metadata("design:paramtypes", [Socket, Object]),
196
+ __metadata("design:returntype", void 0)
197
+ ], WsGateway.prototype, "handleToolResult", null);
198
+ __decorate([
199
+ SubscribeMessage('action_call_result'),
200
+ ApiOperation({
201
+ summary: 'Handle AG-UI Action Result',
202
+ description: 'Receive AG-UI action execution result from client and forward to LangGraph',
203
+ }),
204
+ ApiResponse({
205
+ status: 200,
206
+ description: 'Action result received successfully',
207
+ }),
208
+ __param(0, ConnectedSocket()),
209
+ __param(1, MessageBody()),
210
+ __metadata("design:type", Function),
211
+ __metadata("design:paramtypes", [Socket, Object]),
212
+ __metadata("design:returntype", void 0)
213
+ ], WsGateway.prototype, "handleActionCallResult", null);
214
+ __decorate([
215
+ SubscribeMessage('list-events'),
216
+ ApiOperation({
217
+ summary: 'List Available Events',
218
+ description: 'Get a list of all available WebSocket events',
219
+ }),
220
+ ApiResponse({
221
+ status: 200,
222
+ description: 'List of available events',
223
+ }),
224
+ __param(0, ConnectedSocket()),
225
+ __metadata("design:type", Function),
226
+ __metadata("design:paramtypes", [Socket]),
227
+ __metadata("design:returntype", void 0)
228
+ ], WsGateway.prototype, "handleListEvents", null);
229
+ WsGateway = WsGateway_1 = __decorate([
230
+ WebSocketGateway({
231
+ cors: {
232
+ origin: '*',
233
+ },
234
+ namespace: '/',
235
+ }),
236
+ __param(2, Optional()),
237
+ __metadata("design:paramtypes", [WsService,
238
+ ConfigService,
239
+ UcanService])
240
+ ], WsGateway);
241
+ export { WsGateway };
@@ -0,0 +1,3 @@
1
+ export declare class WsModule {
2
+ }
3
+ //# sourceMappingURL=ws.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws.module.d.ts","sourceRoot":"","sources":["../../../src/modules/ws/ws.module.ts"],"names":[],"mappings":"AAKA,qBAMa,QAAQ;CAAG"}
@@ -0,0 +1,21 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Global, Module } from '@nestjs/common';
8
+ import { SessionsModule } from '../sessions/sessions.module.js';
9
+ import { WsGateway } from './ws.gateway.js';
10
+ import { WsService } from './ws.service.js';
11
+ let WsModule = class WsModule {
12
+ };
13
+ WsModule = __decorate([
14
+ Global(),
15
+ Module({
16
+ imports: [SessionsModule],
17
+ providers: [WsService, WsGateway],
18
+ exports: [WsService],
19
+ })
20
+ ], WsModule);
21
+ export { WsModule };
@@ -0,0 +1,25 @@
1
+ import { type AllEvents } from '@ixo/oracles-events';
2
+ import { type OnModuleDestroy, type OnModuleInit } from '@nestjs/common';
3
+ import { ConfigService } from '@nestjs/config';
4
+ import { type Socket } from 'socket.io';
5
+ import { SessionHistoryProcessor } from '../sessions/session-history-processor.service.js';
6
+ export declare class WsService implements OnModuleInit, OnModuleDestroy {
7
+ private readonly sessionHistoryProcessor;
8
+ private readonly configService;
9
+ private readonly logger;
10
+ private readonly sessionConnections;
11
+ constructor(sessionHistoryProcessor: SessionHistoryProcessor, configService: ConfigService);
12
+ /** Add a WebSocket connection for a specific session. */
13
+ addClientConnection(sessionId: string, socket: Socket): void;
14
+ /** Publish an event to all connections in a specific session. */
15
+ publishToSession(sessionId: string, event: AllEvents): void;
16
+ /** Remove a client connection on disconnect. */
17
+ removeClientConnection(sessionId: string, socket: Socket): Promise<void>;
18
+ /** Active sessions count for monitoring. */
19
+ getActiveSessionsCount(): number;
20
+ /** Total connections count for monitoring. */
21
+ getTotalConnectionsCount(): number;
22
+ onModuleInit(): void;
23
+ onModuleDestroy(): void;
24
+ }
25
+ //# sourceMappingURL=ws.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws.service.d.ts","sourceRoot":"","sources":["../../../src/modules/ws/ws.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAG3F,qBACa,SAAU,YAAW,YAAY,EAAE,eAAe;IAK3D,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa;IALhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAkC;gBAGlD,uBAAuB,EAAE,uBAAuB,EAChD,aAAa,EAAE,aAAa;IAG/C,yDAAyD;IACzD,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAa5D,iEAAiE;IACjE,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAoB3D,gDAAgD;IAC1C,sBAAsB,CAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAyChB,4CAA4C;IAC5C,sBAAsB,IAAI,MAAM;IAIhC,8CAA8C;IAC9C,wBAAwB,IAAI,MAAM;IAQlC,YAAY,IAAI,IAAI;IAOpB,eAAe,IAAI,IAAI;CASxB"}
@@ -0,0 +1,113 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var WsService_1;
11
+ import { Injectable, Logger, } from '@nestjs/common';
12
+ import { ConfigService } from '@nestjs/config';
13
+ import { SessionHistoryProcessor } from '../sessions/session-history-processor.service.js';
14
+ import { WS_SERVICE_EVENT_NAME, wsEmitter } from './emitter.js';
15
+ let WsService = WsService_1 = class WsService {
16
+ sessionHistoryProcessor;
17
+ configService;
18
+ logger = new Logger(WsService_1.name);
19
+ sessionConnections = new Map();
20
+ constructor(sessionHistoryProcessor, configService) {
21
+ this.sessionHistoryProcessor = sessionHistoryProcessor;
22
+ this.configService = configService;
23
+ }
24
+ /** Add a WebSocket connection for a specific session. */
25
+ addClientConnection(sessionId, socket) {
26
+ if (!this.sessionConnections.has(sessionId)) {
27
+ this.logger.log(`Creating new session for: ${sessionId}`);
28
+ this.sessionConnections.set(sessionId, new Set());
29
+ }
30
+ const connections = this.sessionConnections.get(sessionId);
31
+ connections?.add(socket);
32
+ this.logger.log(`Added connection to session: ${sessionId}, total connections: ${connections?.size}`);
33
+ }
34
+ /** Publish an event to all connections in a specific session. */
35
+ publishToSession(sessionId, event) {
36
+ const connections = this.sessionConnections.get(sessionId);
37
+ if (connections && connections.size > 0) {
38
+ this.logger.log(`Publishing event to session: ${sessionId}, connections: ${connections.size}`);
39
+ connections.forEach((socket) => {
40
+ if (socket.connected) {
41
+ socket.emit('event', event);
42
+ }
43
+ else {
44
+ connections.delete(socket);
45
+ }
46
+ });
47
+ }
48
+ else {
49
+ this.logger.warn(`Attempted to publish to non-existent session: ${sessionId}`);
50
+ }
51
+ }
52
+ /** Remove a client connection on disconnect. */
53
+ async removeClientConnection(sessionId, socket) {
54
+ const connections = this.sessionConnections.get(sessionId);
55
+ if (connections) {
56
+ connections.delete(socket);
57
+ this.logger.log(`Removed connection from session: ${sessionId}, remaining: ${connections.size}`);
58
+ if (connections.size === 0) {
59
+ this.sessionConnections.delete(sessionId);
60
+ this.logger.log(`Cleaned up empty session: ${sessionId}`);
61
+ const oracleEntityDid = this.configService.getOrThrow('ORACLE_ENTITY_DID');
62
+ // Use the DID validated at handshake time (stashed on `socket.data`),
63
+ // never the untrusted `handshake.query.userDid`.
64
+ const did = socket.data?.userDid;
65
+ if (!did) {
66
+ this.logger.warn(`User DID not found for session ${sessionId}, skipping processing on disconnect`);
67
+ return;
68
+ }
69
+ // Process session history when last client disconnects
70
+ this.sessionHistoryProcessor
71
+ .processSessionHistory({
72
+ sessionId,
73
+ did,
74
+ oracleEntityDid,
75
+ })
76
+ .catch((err) => this.logger.error(`Failed to process session ${sessionId} on disconnect:`, err));
77
+ }
78
+ }
79
+ }
80
+ /** Active sessions count for monitoring. */
81
+ getActiveSessionsCount() {
82
+ return this.sessionConnections.size;
83
+ }
84
+ /** Total connections count for monitoring. */
85
+ getTotalConnectionsCount() {
86
+ let total = 0;
87
+ this.sessionConnections.forEach((connections) => {
88
+ total += connections.size;
89
+ });
90
+ return total;
91
+ }
92
+ onModuleInit() {
93
+ this.logger.log('WebSocket service initialized');
94
+ wsEmitter.on(WS_SERVICE_EVENT_NAME, (event) => {
95
+ this.publishToSession(event.payload.sessionId, event);
96
+ });
97
+ }
98
+ onModuleDestroy() {
99
+ this.logger.log('Cleaning up all WebSocket connections');
100
+ this.sessionConnections.forEach((connections) => {
101
+ connections.forEach((socket) => {
102
+ socket.disconnect();
103
+ });
104
+ });
105
+ this.sessionConnections.clear();
106
+ }
107
+ };
108
+ WsService = WsService_1 = __decorate([
109
+ Injectable(),
110
+ __metadata("design:paramtypes", [SessionHistoryProcessor,
111
+ ConfigService])
112
+ ], WsService);
113
+ export { WsService };
@@ -0,0 +1,19 @@
1
+ import type { OraclePlugin } from './oracle-plugin.js';
2
+ /**
3
+ * Input shape accepted by `defineOraclePlugin`. The three identity fields
4
+ * (`name`, `version`, `manifest`) are required; every other plugin method
5
+ * is optional.
6
+ */
7
+ export type DefineOraclePluginInput = Partial<OraclePlugin> & Pick<OraclePlugin, 'name' | 'version' | 'manifest'>;
8
+ /**
9
+ * Identity-style helper for authoring a plugin as a plain object.
10
+ *
11
+ * Returns the same object the caller passed in, narrowed to `OraclePlugin`
12
+ * so type errors surface at the authoring site. The runtime treats the
13
+ * resulting POJO interchangeably with a class instance extending
14
+ * `OraclePlugin`.
15
+ *
16
+ * @throws TypeError when `name`, `version`, or `manifest` is missing.
17
+ */
18
+ export declare function defineOraclePlugin(spec: DefineOraclePluginInput): OraclePlugin;
19
+ //# sourceMappingURL=define-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin-api/define-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,YAAY,CAAC,GACzD,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAEtD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,uBAAuB,GAC5B,YAAY,CAsBd"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Identity-style helper for authoring a plugin as a plain object.
3
+ *
4
+ * Returns the same object the caller passed in, narrowed to `OraclePlugin`
5
+ * so type errors surface at the authoring site. The runtime treats the
6
+ * resulting POJO interchangeably with a class instance extending
7
+ * `OraclePlugin`.
8
+ *
9
+ * @throws TypeError when `name`, `version`, or `manifest` is missing.
10
+ */
11
+ export function defineOraclePlugin(spec) {
12
+ if (!spec || typeof spec !== 'object') {
13
+ throw new TypeError('defineOraclePlugin(spec): `spec` must be a plugin definition object.');
14
+ }
15
+ if (!spec.name || typeof spec.name !== 'string') {
16
+ throw new TypeError('defineOraclePlugin(spec): `name` is required and must be a non-empty string.');
17
+ }
18
+ if (!spec.version || typeof spec.version !== 'string') {
19
+ throw new TypeError('defineOraclePlugin(spec): `version` is required and must be a non-empty string.');
20
+ }
21
+ if (!spec.manifest || typeof spec.manifest !== 'object') {
22
+ throw new TypeError('defineOraclePlugin(spec): `manifest` is required and must be an object.');
23
+ }
24
+ return spec;
25
+ }
@@ -0,0 +1,92 @@
1
+ import type { DynamicModule, Type } from '@nestjs/common';
2
+ import type { z } from 'zod';
3
+ import type { AgentMiddleware, AuthExcludedRoute, PluginContext, PluginManifest, PluginSubAgent, PluginTool, RuntimeContext } from './types.js';
4
+ export declare abstract class OraclePlugin {
5
+ /** Unique plugin identifier (kebab-case by convention). */
6
+ abstract readonly name: string;
7
+ /** Plugin version. */
8
+ abstract readonly version: string;
9
+ /** The agent's structured interface to this plugin. */
10
+ abstract readonly manifest: PluginManifest;
11
+ /** Hard dependencies — boot fails if any is missing. */
12
+ readonly dependsOn?: string[];
13
+ /** Soft dependencies — plugin loads either way; branches on availability. */
14
+ readonly softDependsOn?: string[];
15
+ /** Plugin-owned env vars. Merged into the runtime's Zod schema at boot. */
16
+ readonly configSchema?: z.ZodObject<any>;
17
+ /**
18
+ * Predicate the loader runs against `process.env` when the plugin is
19
+ * left at `'auto'` (or has no explicit toggle). Returning `false` skips
20
+ * the plugin. Plugins without an `autoDetect` are on-by-default.
21
+ */
22
+ autoDetect?(env: NodeJS.ProcessEnv): boolean;
23
+ /**
24
+ * Human-readable description of what `autoDetect` checks (e.g. the env
25
+ * var name). Surfaced in boot-error messages so operators see exactly
26
+ * why the plugin was skipped.
27
+ */
28
+ readonly autoDetectHint?: string;
29
+ /** Tools the main agent can call. Called once per request build. */
30
+ getTools?(ctx: PluginContext): PluginTool[] | Promise<PluginTool[]>;
31
+ /** Sub-agents the runtime auto-wraps as tools. */
32
+ getSubAgents?(ctx: PluginContext): PluginSubAgent[];
33
+ /**
34
+ * Request-time tool contributions. Called once per `createMainAgent`
35
+ * invocation with the full per-request `RuntimeContext`, so the plugin
36
+ * can decide which tools to expose based on live state (e.g. AG-UI
37
+ * actions in `state.agActions`).
38
+ *
39
+ * Results are merged with `getTools(ctx)` — both can fire on the same
40
+ * build. Plugins should pick whichever hook fits: boot-time when only
41
+ * config/identity matters; request-time when state/user/session matters.
42
+ */
43
+ getRequestTools?(rtCtx: RuntimeContext): PluginTool[] | Promise<PluginTool[]>;
44
+ /**
45
+ * Request-time sub-agent contributions. Same merge semantics as
46
+ * `getRequestTools` — boot-time `getSubAgents` and request-time
47
+ * `getRequestSubAgents` outputs are both collected.
48
+ */
49
+ getRequestSubAgents?(rtCtx: RuntimeContext): PluginSubAgent[] | Promise<PluginSubAgent[]>;
50
+ /**
51
+ * LangChain middlewares inserted after the four always-on middlewares
52
+ * (tool-validation, retry, page-context, safety-guardrail).
53
+ */
54
+ getMiddlewares?(ctx: PluginContext): AgentMiddleware[];
55
+ /**
56
+ * Read-only accessors this plugin exposes to other plugins via `ctx.shared`.
57
+ * Pattern: this plugin computes/owns some derived value from state; others
58
+ * read it.
59
+ */
60
+ getSharedState?(): Record<string, (state: any, runCtx: RuntimeContext) => unknown>;
61
+ /**
62
+ * NestJS modules the plugin contributes. Spread into `RuntimeAppModule.imports`,
63
+ * so the module gets full DI access to Tier-0 services (Sessions, Messages,
64
+ * Cache, etc.) and can declare its own Controllers, providers, and
65
+ * `OnModuleInit` / `OnModuleDestroy` lifecycle hooks.
66
+ *
67
+ * Returns either plain module classes or `DynamicModule` configs (from
68
+ * `Module.register(...)` / `forRoot(...)` style helpers).
69
+ *
70
+ * Use this for plugins that need a long-lived NestJS service (Slack socket,
71
+ * BullMQ workers) or HTTP Controllers (Calls REST API).
72
+ *
73
+ * `ctx` carries the validated merged config + identity + logger so
74
+ * module-construction code can read env without going through `process.env`.
75
+ * The optional arg keeps existing plugins source-compatible —
76
+ * implementations that ignore it work unchanged.
77
+ */
78
+ getNestModules?(ctx?: PluginContext): Array<Type | DynamicModule>;
79
+ /**
80
+ * Routes owned by this plugin's `getNestModules()` controllers that MUST NOT
81
+ * pass through `AuthHeaderMiddleware`. Use for webhooks, OAuth callbacks,
82
+ * public probes — anything that doesn't authenticate via UCAN. Returning an
83
+ * empty array (or omitting the method) keeps every plugin route auth-locked.
84
+ *
85
+ * The returned `path` is matched against the request URL the same way
86
+ * `MiddlewareConsumer.exclude(...)` matches — leading slash is optional and
87
+ * the value should be the full path the controller mounts at (e.g.
88
+ * `weather/now`, not just `now`).
89
+ */
90
+ getAuthExcludedRoutes?(): AuthExcludedRoute[];
91
+ }
92
+ //# sourceMappingURL=oracle-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oracle-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin-api/oracle-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,cAAc,EACd,UAAU,EACV,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,8BAAsB,YAAY;IAChC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B,sBAAsB;IACtB,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAElC,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAE3C,wDAAwD;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC,2EAA2E;IAE3E,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAEzC;;;;OAIG;IACH,UAAU,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO;IAE5C;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAEjC,oEAAoE;IACpE,QAAQ,CAAC,CAAC,GAAG,EAAE,aAAa,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAEnE,kDAAkD;IAClD,YAAY,CAAC,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,EAAE;IAEnD;;;;;;;;;OASG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAE7E;;;;OAIG;IACH,mBAAmB,CAAC,CAClB,KAAK,EAAE,cAAc,GACpB,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAE/C;;;OAGG;IACH,cAAc,CAAC,CAAC,GAAG,EAAE,aAAa,GAAG,eAAe,EAAE;IAEtD;;;;OAIG;IACH,cAAc,CAAC,IAAI,MAAM,CACvB,MAAM,EAEN,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,cAAc,KAAK,OAAO,CAChD;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;IAEjE;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,IAAI,iBAAiB,EAAE;CAC9C"}
@@ -0,0 +1,15 @@
1
+ export class OraclePlugin {
2
+ /** Hard dependencies — boot fails if any is missing. */
3
+ dependsOn;
4
+ /** Soft dependencies — plugin loads either way; branches on availability. */
5
+ softDependsOn;
6
+ /** Plugin-owned env vars. Merged into the runtime's Zod schema at boot. */
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ configSchema;
9
+ /**
10
+ * Human-readable description of what `autoDetect` checks (e.g. the env
11
+ * var name). Surfaced in boot-error messages so operators see exactly
12
+ * why the plugin was skipped.
13
+ */
14
+ autoDetectHint;
15
+ }
@@ -0,0 +1,33 @@
1
+ import type { z } from 'zod';
2
+ import type { PluginTool, RuntimeContext } from './types.js';
3
+ /**
4
+ * Authoring options for `tool()`. Mirrors the public surface of `PluginTool`
5
+ * minus the handler (which is the first positional argument).
6
+ */
7
+ export interface ToolHelperOptions {
8
+ /** Tool name shown to the agent. Must be unique within the plugin. */
9
+ name: string;
10
+ /** Tool description shown to the agent. */
11
+ description: string;
12
+ /** Zod schema validating the tool's input arguments. */
13
+ schema: z.ZodType;
14
+ /**
15
+ * Override visibility — by default the tool inherits the plugin's
16
+ * `manifest.visibility` setting.
17
+ */
18
+ visibility?: PluginTool['visibility'];
19
+ }
20
+ /**
21
+ * User-facing helper to author a plugin tool.
22
+ *
23
+ * The handler receives the validated arguments and a `RuntimeContext` built
24
+ * fresh per invocation. The runtime is responsible for bridging LangChain's
25
+ * `(args, runConfig)` calling convention into `(args, ctx)` when it wires
26
+ * the tool into the agent.
27
+ *
28
+ * @param handler - Async function invoked when the agent calls the tool.
29
+ * @param options - Tool descriptor (name, description, schema, optional visibility).
30
+ * @returns A `PluginTool` consumable by the runtime's tool registration step.
31
+ */
32
+ export declare function tool(handler: (args: unknown, ctx: RuntimeContext) => Promise<unknown>, options: ToolHelperOptions): PluginTool;
33
+ //# sourceMappingURL=tool-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-helper.d.ts","sourceRoot":"","sources":["../../src/plugin-api/tool-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,EACjE,OAAO,EAAE,iBAAiB,GACzB,UAAU,CAoCZ"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * User-facing helper to author a plugin tool.
3
+ *
4
+ * The handler receives the validated arguments and a `RuntimeContext` built
5
+ * fresh per invocation. The runtime is responsible for bridging LangChain's
6
+ * `(args, runConfig)` calling convention into `(args, ctx)` when it wires
7
+ * the tool into the agent.
8
+ *
9
+ * @param handler - Async function invoked when the agent calls the tool.
10
+ * @param options - Tool descriptor (name, description, schema, optional visibility).
11
+ * @returns A `PluginTool` consumable by the runtime's tool registration step.
12
+ */
13
+ export function tool(handler, options) {
14
+ if (typeof handler !== 'function') {
15
+ throw new TypeError('tool(handler, options): `handler` must be a function.');
16
+ }
17
+ if (!options || typeof options !== 'object') {
18
+ throw new TypeError('tool(handler, options): `options` is required.');
19
+ }
20
+ const { name, description, schema, visibility } = options;
21
+ if (!name || typeof name !== 'string') {
22
+ throw new TypeError('tool(handler, options): `options.name` must be a non-empty string.');
23
+ }
24
+ if (!description || typeof description !== 'string') {
25
+ throw new TypeError('tool(handler, options): `options.description` must be a non-empty string.');
26
+ }
27
+ if (!schema) {
28
+ throw new TypeError('tool(handler, options): `options.schema` (Zod schema) is required.');
29
+ }
30
+ const pluginTool = {
31
+ name,
32
+ description,
33
+ schema,
34
+ handler,
35
+ };
36
+ if (visibility !== undefined) {
37
+ pluginTool.visibility = visibility;
38
+ }
39
+ return pluginTool;
40
+ }