@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.
- package/dist/bootstrap/ambient-factory.d.ts +32 -0
- package/dist/bootstrap/ambient-factory.d.ts.map +1 -0
- package/dist/bootstrap/ambient-factory.js +128 -0
- package/dist/bootstrap/create-oracle-app.d.ts +112 -0
- package/dist/bootstrap/create-oracle-app.d.ts.map +1 -0
- package/dist/bootstrap/create-oracle-app.js +530 -0
- package/dist/bootstrap/graceful-shutdown.d.ts +20 -0
- package/dist/bootstrap/graceful-shutdown.d.ts.map +1 -0
- package/dist/bootstrap/graceful-shutdown.js +61 -0
- package/dist/bootstrap/index.d.ts +13 -0
- package/dist/bootstrap/index.d.ts.map +1 -0
- package/dist/bootstrap/index.js +6 -0
- package/dist/bootstrap/inspect.d.ts +74 -0
- package/dist/bootstrap/inspect.d.ts.map +1 -0
- package/dist/bootstrap/inspect.js +111 -0
- package/dist/bootstrap/plugin-loader.d.ts +50 -0
- package/dist/bootstrap/plugin-loader.d.ts.map +1 -0
- package/dist/bootstrap/plugin-loader.js +119 -0
- package/dist/bootstrap/runtime-app-module.d.ts +38 -0
- package/dist/bootstrap/runtime-app-module.d.ts.map +1 -0
- package/dist/bootstrap/runtime-app-module.js +114 -0
- package/dist/bootstrap/schema-composer.d.ts +46 -0
- package/dist/bootstrap/schema-composer.d.ts.map +1 -0
- package/dist/bootstrap/schema-composer.js +65 -0
- package/dist/config/base-env-config.d.ts +31 -0
- package/dist/config/base-env-config.d.ts.map +1 -0
- package/dist/config/base-env-config.js +70 -0
- package/dist/config/base-env-schema.d.ts +77 -0
- package/dist/config/base-env-schema.d.ts.map +1 -0
- package/dist/config/base-env-schema.js +102 -0
- package/dist/events/scoped-emitter.d.ts +33 -0
- package/dist/events/scoped-emitter.d.ts.map +1 -0
- package/dist/events/scoped-emitter.js +32 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/main-agent-types.d.ts +88 -0
- package/dist/graph/main-agent-types.d.ts.map +1 -0
- package/dist/graph/main-agent-types.js +20 -0
- package/dist/graph/main-agent.d.ts +16 -0
- package/dist/graph/main-agent.d.ts.map +1 -0
- package/dist/graph/main-agent.js +251 -0
- package/dist/graph/middlewares/capability-gate-middleware.d.ts +35 -0
- package/dist/graph/middlewares/capability-gate-middleware.d.ts.map +1 -0
- package/dist/graph/middlewares/capability-gate-middleware.js +54 -0
- package/dist/graph/middlewares/index.d.ts +7 -0
- package/dist/graph/middlewares/index.d.ts.map +1 -0
- package/dist/graph/middlewares/index.js +6 -0
- package/dist/graph/middlewares/page-context-middleware.d.ts +23 -0
- package/dist/graph/middlewares/page-context-middleware.d.ts.map +1 -0
- package/dist/graph/middlewares/page-context-middleware.js +68 -0
- package/dist/graph/middlewares/safety-guardrail-middleware.d.ts +26 -0
- package/dist/graph/middlewares/safety-guardrail-middleware.d.ts.map +1 -0
- package/dist/graph/middlewares/safety-guardrail-middleware.js +88 -0
- package/dist/graph/middlewares/summarization-middleware.d.ts +17 -0
- package/dist/graph/middlewares/summarization-middleware.d.ts.map +1 -0
- package/dist/graph/middlewares/summarization-middleware.js +62 -0
- package/dist/graph/middlewares/tool-repetition-guard-middleware.d.ts +24 -0
- package/dist/graph/middlewares/tool-repetition-guard-middleware.d.ts.map +1 -0
- package/dist/graph/middlewares/tool-repetition-guard-middleware.js +112 -0
- package/dist/graph/middlewares/tool-validation-middleware.d.ts +24 -0
- package/dist/graph/middlewares/tool-validation-middleware.d.ts.map +1 -0
- package/dist/graph/middlewares/tool-validation-middleware.js +61 -0
- package/dist/graph/prompt-composer.d.ts +69 -0
- package/dist/graph/prompt-composer.d.ts.map +1 -0
- package/dist/graph/prompt-composer.js +315 -0
- package/dist/graph/state.d.ts +65 -0
- package/dist/graph/state.d.ts.map +1 -0
- package/dist/graph/state.js +60 -0
- package/dist/graph/sub-agent-fallback.d.ts +56 -0
- package/dist/graph/sub-agent-fallback.d.ts.map +1 -0
- package/dist/graph/sub-agent-fallback.js +79 -0
- package/dist/graph/subagent-as-tool.d.ts +77 -0
- package/dist/graph/subagent-as-tool.d.ts.map +1 -0
- package/dist/graph/subagent-as-tool.js +197 -0
- package/dist/graph/wrap-plugin-tool.d.ts +28 -0
- package/dist/graph/wrap-plugin-tool.d.ts.map +1 -0
- package/dist/graph/wrap-plugin-tool.js +30 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/llm/index.d.ts +2 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +1 -0
- package/dist/llm/llm-provider.d.ts +41 -0
- package/dist/llm/llm-provider.d.ts.map +1 -0
- package/dist/llm/llm-provider.js +130 -0
- package/dist/manifest/index.d.ts +6 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +3 -0
- package/dist/manifest/schema.d.ts +31 -0
- package/dist/manifest/schema.d.ts.map +1 -0
- package/dist/manifest/schema.js +44 -0
- package/dist/manifest/tier1-renderer.d.ts +31 -0
- package/dist/manifest/tier1-renderer.d.ts.map +1 -0
- package/dist/manifest/tier1-renderer.js +68 -0
- package/dist/manifest/validator.d.ts +34 -0
- package/dist/manifest/validator.d.ts.map +1 -0
- package/dist/manifest/validator.js +111 -0
- package/dist/matrix/checkpointer/matrix-upload-utils.d.ts +66 -0
- package/dist/matrix/checkpointer/matrix-upload-utils.d.ts.map +1 -0
- package/dist/matrix/checkpointer/matrix-upload-utils.js +228 -0
- package/dist/matrix/checkpointer/type.d.ts +4 -0
- package/dist/matrix/checkpointer/type.d.ts.map +1 -0
- package/dist/matrix/checkpointer/type.js +1 -0
- package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.module.d.ts +3 -0
- package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.module.d.ts.map +1 -0
- package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.module.js +22 -0
- package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.service.d.ts +93 -0
- package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.service.d.ts.map +1 -0
- package/dist/matrix/checkpointer/user-matrix-sqlite-sync-service.service.js +856 -0
- package/dist/matrix/room-membership.d.ts +11 -0
- package/dist/matrix/room-membership.d.ts.map +1 -0
- package/dist/matrix/room-membership.js +33 -0
- package/dist/meta-tools/index.d.ts +28 -0
- package/dist/meta-tools/index.d.ts.map +1 -0
- package/dist/meta-tools/index.js +24 -0
- package/dist/meta-tools/list-capabilities.d.ts +12 -0
- package/dist/meta-tools/list-capabilities.d.ts.map +1 -0
- package/dist/meta-tools/list-capabilities.js +55 -0
- package/dist/meta-tools/load-capability.d.ts +24 -0
- package/dist/meta-tools/load-capability.d.ts.map +1 -0
- package/dist/meta-tools/load-capability.js +82 -0
- package/dist/modules/auth/auth-header.middleware.d.ts +37 -0
- package/dist/modules/auth/auth-header.middleware.d.ts.map +1 -0
- package/dist/modules/auth/auth-header.middleware.js +115 -0
- package/dist/modules/auth/auth.module.d.ts +9 -0
- package/dist/modules/auth/auth.module.d.ts.map +1 -0
- package/dist/modules/auth/auth.module.js +27 -0
- package/dist/modules/auth/index.d.ts +3 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +2 -0
- package/dist/modules/auth/validate-ucan-delegation.d.ts +31 -0
- package/dist/modules/auth/validate-ucan-delegation.d.ts.map +1 -0
- package/dist/modules/auth/validate-ucan-delegation.js +36 -0
- package/dist/modules/blob-store/blob-store.module.d.ts +10 -0
- package/dist/modules/blob-store/blob-store.module.d.ts.map +1 -0
- package/dist/modules/blob-store/blob-store.module.js +25 -0
- package/dist/modules/blob-store/blob-store.service.d.ts +66 -0
- package/dist/modules/blob-store/blob-store.service.d.ts.map +1 -0
- package/dist/modules/blob-store/blob-store.service.js +108 -0
- package/dist/modules/blob-store/index.d.ts +3 -0
- package/dist/modules/blob-store/index.d.ts.map +1 -0
- package/dist/modules/blob-store/index.js +2 -0
- package/dist/modules/health/health.controller.d.ts +18 -0
- package/dist/modules/health/health.controller.d.ts.map +1 -0
- package/dist/modules/health/health.controller.js +48 -0
- package/dist/modules/health/health.module.d.ts +8 -0
- package/dist/modules/health/health.module.d.ts.map +1 -0
- package/dist/modules/health/health.module.js +21 -0
- package/dist/modules/index.d.ts +8 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +6 -0
- package/dist/modules/messages/__test-fixtures__/deps.d.ts +41 -0
- package/dist/modules/messages/__test-fixtures__/deps.d.ts.map +1 -0
- package/dist/modules/messages/__test-fixtures__/deps.js +73 -0
- package/dist/modules/messages/__test-fixtures__/fake-agent.d.ts +27 -0
- package/dist/modules/messages/__test-fixtures__/fake-agent.d.ts.map +1 -0
- package/dist/modules/messages/__test-fixtures__/fake-agent.js +41 -0
- package/dist/modules/messages/__test-fixtures__/fake-response.d.ts +29 -0
- package/dist/modules/messages/__test-fixtures__/fake-response.d.ts.map +1 -0
- package/dist/modules/messages/__test-fixtures__/fake-response.js +55 -0
- package/dist/modules/messages/agent-builder.d.ts +64 -0
- package/dist/modules/messages/agent-builder.d.ts.map +1 -0
- package/dist/modules/messages/agent-builder.js +219 -0
- package/dist/modules/messages/batch-invoker.d.ts +36 -0
- package/dist/modules/messages/batch-invoker.d.ts.map +1 -0
- package/dist/modules/messages/batch-invoker.js +58 -0
- package/dist/modules/messages/dto/list-messages.dto.d.ts +4 -0
- package/dist/modules/messages/dto/list-messages.dto.d.ts.map +1 -0
- package/dist/modules/messages/dto/list-messages.dto.js +17 -0
- package/dist/modules/messages/dto/send-message.dto.d.ts +73 -0
- package/dist/modules/messages/dto/send-message.dto.d.ts.map +1 -0
- package/dist/modules/messages/dto/send-message.dto.js +318 -0
- package/dist/modules/messages/file-processing-credit-sink.port.d.ts +20 -0
- package/dist/modules/messages/file-processing-credit-sink.port.d.ts.map +1 -0
- package/dist/modules/messages/file-processing-credit-sink.port.js +1 -0
- package/dist/modules/messages/file-processing.service.d.ts +195 -0
- package/dist/modules/messages/file-processing.service.d.ts.map +1 -0
- package/dist/modules/messages/file-processing.service.js +1278 -0
- package/dist/modules/messages/homeserver-cache.d.ts +11 -0
- package/dist/modules/messages/homeserver-cache.d.ts.map +1 -0
- package/dist/modules/messages/homeserver-cache.js +31 -0
- package/dist/modules/messages/matrix-listener-bridge.d.ts +63 -0
- package/dist/modules/messages/matrix-listener-bridge.d.ts.map +1 -0
- package/dist/modules/messages/matrix-listener-bridge.js +280 -0
- package/dist/modules/messages/messages.controller.d.ts +13 -0
- package/dist/modules/messages/messages.controller.d.ts.map +1 -0
- package/dist/modules/messages/messages.controller.js +95 -0
- package/dist/modules/messages/messages.module.d.ts +3 -0
- package/dist/modules/messages/messages.module.d.ts.map +1 -0
- package/dist/modules/messages/messages.module.js +75 -0
- package/dist/modules/messages/messages.service.d.ts +112 -0
- package/dist/modules/messages/messages.service.d.ts.map +1 -0
- package/dist/modules/messages/messages.service.js +279 -0
- package/dist/modules/messages/oracle-runtime-bundle.d.ts +38 -0
- package/dist/modules/messages/oracle-runtime-bundle.d.ts.map +1 -0
- package/dist/modules/messages/oracle-runtime-bundle.js +40 -0
- package/dist/modules/messages/post-message-syncer.d.ts +30 -0
- package/dist/modules/messages/post-message-syncer.d.ts.map +1 -0
- package/dist/modules/messages/post-message-syncer.js +73 -0
- package/dist/modules/messages/request-preparer.d.ts +53 -0
- package/dist/modules/messages/request-preparer.d.ts.map +1 -0
- package/dist/modules/messages/request-preparer.js +139 -0
- package/dist/modules/messages/sse-stream-runner.d.ts +73 -0
- package/dist/modules/messages/sse-stream-runner.d.ts.map +1 -0
- package/dist/modules/messages/sse-stream-runner.js +352 -0
- package/dist/modules/messages/sse.utils.d.ts +29 -0
- package/dist/modules/messages/sse.utils.d.ts.map +1 -0
- package/dist/modules/messages/sse.utils.js +77 -0
- package/dist/modules/messages/user-context-fetcher.d.ts +41 -0
- package/dist/modules/messages/user-context-fetcher.d.ts.map +1 -0
- package/dist/modules/messages/user-context-fetcher.js +117 -0
- package/dist/modules/secrets/index.d.ts +2 -0
- package/dist/modules/secrets/index.d.ts.map +1 -0
- package/dist/modules/secrets/index.js +1 -0
- package/dist/modules/secrets/secrets.service.d.ts +29 -0
- package/dist/modules/secrets/secrets.service.d.ts.map +1 -0
- package/dist/modules/secrets/secrets.service.js +107 -0
- package/dist/modules/sessions/dto/create-session.dto.d.ts +6 -0
- package/dist/modules/sessions/dto/create-session.dto.d.ts.map +1 -0
- package/dist/modules/sessions/dto/create-session.dto.js +5 -0
- package/dist/modules/sessions/dto/delete-session.dto.d.ts +6 -0
- package/dist/modules/sessions/dto/delete-session.dto.d.ts.map +1 -0
- package/dist/modules/sessions/dto/delete-session.dto.js +5 -0
- package/dist/modules/sessions/dto/list-sessions.dto.d.ts +7 -0
- package/dist/modules/sessions/dto/list-sessions.dto.d.ts.map +1 -0
- package/dist/modules/sessions/dto/list-sessions.dto.js +6 -0
- package/dist/modules/sessions/session-history-processor.service.d.ts +48 -0
- package/dist/modules/sessions/session-history-processor.service.d.ts.map +1 -0
- package/dist/modules/sessions/session-history-processor.service.js +254 -0
- package/dist/modules/sessions/sessions.controller.d.ts +13 -0
- package/dist/modules/sessions/sessions.controller.d.ts.map +1 -0
- package/dist/modules/sessions/sessions.controller.js +113 -0
- package/dist/modules/sessions/sessions.module.d.ts +3 -0
- package/dist/modules/sessions/sessions.module.d.ts.map +1 -0
- package/dist/modules/sessions/sessions.module.js +49 -0
- package/dist/modules/sessions/sessions.service.d.ts +23 -0
- package/dist/modules/sessions/sessions.service.d.ts.map +1 -0
- package/dist/modules/sessions/sessions.service.js +168 -0
- package/dist/modules/subscription/subscription.middleware.d.ts +37 -0
- package/dist/modules/subscription/subscription.middleware.d.ts.map +1 -0
- package/dist/modules/subscription/subscription.middleware.js +141 -0
- package/dist/modules/subscription/subscription.module.d.ts +12 -0
- package/dist/modules/subscription/subscription.module.d.ts.map +1 -0
- package/dist/modules/subscription/subscription.module.js +26 -0
- package/dist/modules/throttler/throttler.module.d.ts +11 -0
- package/dist/modules/throttler/throttler.module.d.ts.map +1 -0
- package/dist/modules/throttler/throttler.module.js +32 -0
- package/dist/modules/ucan/index.d.ts +7 -0
- package/dist/modules/ucan/index.d.ts.map +1 -0
- package/dist/modules/ucan/index.js +6 -0
- package/dist/modules/ucan/ucan.config.d.ts +87 -0
- package/dist/modules/ucan/ucan.config.d.ts.map +1 -0
- package/dist/modules/ucan/ucan.config.js +114 -0
- package/dist/modules/ucan/ucan.module.d.ts +29 -0
- package/dist/modules/ucan/ucan.module.d.ts.map +1 -0
- package/dist/modules/ucan/ucan.module.js +46 -0
- package/dist/modules/ucan/ucan.service.d.ts +129 -0
- package/dist/modules/ucan/ucan.service.d.ts.map +1 -0
- package/dist/modules/ucan/ucan.service.js +582 -0
- package/dist/modules/ws/emitter.d.ts +12 -0
- package/dist/modules/ws/emitter.d.ts.map +1 -0
- package/dist/modules/ws/emitter.js +12 -0
- package/dist/modules/ws/ws.gateway.d.ts +34 -0
- package/dist/modules/ws/ws.gateway.d.ts.map +1 -0
- package/dist/modules/ws/ws.gateway.js +241 -0
- package/dist/modules/ws/ws.module.d.ts +3 -0
- package/dist/modules/ws/ws.module.d.ts.map +1 -0
- package/dist/modules/ws/ws.module.js +21 -0
- package/dist/modules/ws/ws.service.d.ts +25 -0
- package/dist/modules/ws/ws.service.d.ts.map +1 -0
- package/dist/modules/ws/ws.service.js +113 -0
- package/dist/plugin-api/define-plugin.d.ts +19 -0
- package/dist/plugin-api/define-plugin.d.ts.map +1 -0
- package/dist/plugin-api/define-plugin.js +25 -0
- package/dist/plugin-api/oracle-plugin.d.ts +92 -0
- package/dist/plugin-api/oracle-plugin.d.ts.map +1 -0
- package/dist/plugin-api/oracle-plugin.js +15 -0
- package/dist/plugin-api/tool-helper.d.ts +33 -0
- package/dist/plugin-api/tool-helper.d.ts.map +1 -0
- package/dist/plugin-api/tool-helper.js +40 -0
- package/dist/plugin-api/types.d.ts +378 -0
- package/dist/plugin-api/types.d.ts.map +1 -0
- package/dist/plugin-api/types.js +1 -0
- package/dist/plugins/agui/agui-agent.d.ts +10 -0
- package/dist/plugins/agui/agui-agent.d.ts.map +1 -0
- package/dist/plugins/agui/agui-agent.js +110 -0
- package/dist/plugins/agui/agui.plugin.d.ts +16 -0
- package/dist/plugins/agui/agui.plugin.d.ts.map +1 -0
- package/dist/plugins/agui/agui.plugin.js +117 -0
- package/dist/plugins/agui/index.d.ts +3 -0
- package/dist/plugins/agui/index.d.ts.map +1 -0
- package/dist/plugins/agui/index.js +2 -0
- package/dist/plugins/composio/composio-tools.d.ts +59 -0
- package/dist/plugins/composio/composio-tools.d.ts.map +1 -0
- package/dist/plugins/composio/composio-tools.js +88 -0
- package/dist/plugins/composio/composio-ucan.d.ts +14 -0
- package/dist/plugins/composio/composio-ucan.d.ts.map +1 -0
- package/dist/plugins/composio/composio-ucan.js +32 -0
- package/dist/plugins/composio/composio.plugin.d.ts +45 -0
- package/dist/plugins/composio/composio.plugin.d.ts.map +1 -0
- package/dist/plugins/composio/composio.plugin.js +116 -0
- package/dist/plugins/composio/index.d.ts +4 -0
- package/dist/plugins/composio/index.d.ts.map +1 -0
- package/dist/plugins/composio/index.js +3 -0
- package/dist/plugins/credits/claim-processing.module.d.ts +28 -0
- package/dist/plugins/credits/claim-processing.module.d.ts.map +1 -0
- package/dist/plugins/credits/claim-processing.module.js +37 -0
- package/dist/plugins/credits/claim-processing.service.d.ts +92 -0
- package/dist/plugins/credits/claim-processing.service.d.ts.map +1 -0
- package/dist/plugins/credits/claim-processing.service.js +406 -0
- package/dist/plugins/credits/credits-middleware.d.ts +23 -0
- package/dist/plugins/credits/credits-middleware.d.ts.map +1 -0
- package/dist/plugins/credits/credits-middleware.js +154 -0
- package/dist/plugins/credits/credits.plugin.d.ts +55 -0
- package/dist/plugins/credits/credits.plugin.d.ts.map +1 -0
- package/dist/plugins/credits/credits.plugin.js +95 -0
- package/dist/plugins/credits/file-processing-sink.module.d.ts +18 -0
- package/dist/plugins/credits/file-processing-sink.module.d.ts.map +1 -0
- package/dist/plugins/credits/file-processing-sink.module.js +56 -0
- package/dist/plugins/credits/index.d.ts +8 -0
- package/dist/plugins/credits/index.d.ts.map +1 -0
- package/dist/plugins/credits/index.js +7 -0
- package/dist/plugins/credits/subscription-sink.module.d.ts +23 -0
- package/dist/plugins/credits/subscription-sink.module.d.ts.map +1 -0
- package/dist/plugins/credits/subscription-sink.module.js +54 -0
- package/dist/plugins/credits/token-limiter.d.ts +139 -0
- package/dist/plugins/credits/token-limiter.d.ts.map +1 -0
- package/dist/plugins/credits/token-limiter.js +302 -0
- package/dist/plugins/domain-indexer/domain-indexer-agent.d.ts +7 -0
- package/dist/plugins/domain-indexer/domain-indexer-agent.d.ts.map +1 -0
- package/dist/plugins/domain-indexer/domain-indexer-agent.js +48 -0
- package/dist/plugins/domain-indexer/domain-indexer-tools.d.ts +8 -0
- package/dist/plugins/domain-indexer/domain-indexer-tools.d.ts.map +1 -0
- package/dist/plugins/domain-indexer/domain-indexer-tools.js +194 -0
- package/dist/plugins/domain-indexer/domain-indexer.plugin.d.ts +20 -0
- package/dist/plugins/domain-indexer/domain-indexer.plugin.d.ts.map +1 -0
- package/dist/plugins/domain-indexer/domain-indexer.plugin.js +78 -0
- package/dist/plugins/domain-indexer/index.d.ts +2 -0
- package/dist/plugins/domain-indexer/index.d.ts.map +1 -0
- package/dist/plugins/domain-indexer/index.js +1 -0
- package/dist/plugins/editor/apply-sandbox-output.d.ts +33 -0
- package/dist/plugins/editor/apply-sandbox-output.d.ts.map +1 -0
- package/dist/plugins/editor/apply-sandbox-output.js +302 -0
- package/dist/plugins/editor/block-actions.d.ts +84 -0
- package/dist/plugins/editor/block-actions.d.ts.map +1 -0
- package/dist/plugins/editor/block-actions.js +471 -0
- package/dist/plugins/editor/blocknote-helper.d.ts +147 -0
- package/dist/plugins/editor/blocknote-helper.d.ts.map +1 -0
- package/dist/plugins/editor/blocknote-helper.js +542 -0
- package/dist/plugins/editor/blocknote-tools.d.ts +364 -0
- package/dist/plugins/editor/blocknote-tools.d.ts.map +1 -0
- package/dist/plugins/editor/blocknote-tools.js +2123 -0
- package/dist/plugins/editor/editor-agent.d.ts +47 -0
- package/dist/plugins/editor/editor-agent.d.ts.map +1 -0
- package/dist/plugins/editor/editor-agent.js +158 -0
- package/dist/plugins/editor/editor-mx.d.ts +56 -0
- package/dist/plugins/editor/editor-mx.d.ts.map +1 -0
- package/dist/plugins/editor/editor-mx.js +100 -0
- package/dist/plugins/editor/editor.plugin.d.ts +32 -0
- package/dist/plugins/editor/editor.plugin.d.ts.map +1 -0
- package/dist/plugins/editor/editor.plugin.js +189 -0
- package/dist/plugins/editor/index.d.ts +6 -0
- package/dist/plugins/editor/index.d.ts.map +1 -0
- package/dist/plugins/editor/index.js +5 -0
- package/dist/plugins/editor/mint-invocation-tool.d.ts +72 -0
- package/dist/plugins/editor/mint-invocation-tool.d.ts.map +1 -0
- package/dist/plugins/editor/mint-invocation-tool.js +173 -0
- package/dist/plugins/editor/page-functions.d.ts +100 -0
- package/dist/plugins/editor/page-functions.d.ts.map +1 -0
- package/dist/plugins/editor/page-functions.js +317 -0
- package/dist/plugins/editor/page-tools.d.ts +75 -0
- package/dist/plugins/editor/page-tools.d.ts.map +1 -0
- package/dist/plugins/editor/page-tools.js +238 -0
- package/dist/plugins/editor/prompts.d.ts +22 -0
- package/dist/plugins/editor/prompts.d.ts.map +1 -0
- package/dist/plugins/editor/prompts.js +451 -0
- package/dist/plugins/editor/provider.d.ts +101 -0
- package/dist/plugins/editor/provider.d.ts.map +1 -0
- package/dist/plugins/editor/provider.js +249 -0
- package/dist/plugins/editor/standalone-editor-tool.d.ts +17 -0
- package/dist/plugins/editor/standalone-editor-tool.d.ts.map +1 -0
- package/dist/plugins/editor/standalone-editor-tool.js +136 -0
- package/dist/plugins/editor/survey-helpers.d.ts +112 -0
- package/dist/plugins/editor/survey-helpers.d.ts.map +1 -0
- package/dist/plugins/editor/survey-helpers.js +358 -0
- package/dist/plugins/firecrawl/firecrawl-agent.d.ts +7 -0
- package/dist/plugins/firecrawl/firecrawl-agent.d.ts.map +1 -0
- package/dist/plugins/firecrawl/firecrawl-agent.js +84 -0
- package/dist/plugins/firecrawl/firecrawl-tools.d.ts +37 -0
- package/dist/plugins/firecrawl/firecrawl-tools.d.ts.map +1 -0
- package/dist/plugins/firecrawl/firecrawl-tools.js +129 -0
- package/dist/plugins/firecrawl/firecrawl.plugin.d.ts +32 -0
- package/dist/plugins/firecrawl/firecrawl.plugin.d.ts.map +1 -0
- package/dist/plugins/firecrawl/firecrawl.plugin.js +69 -0
- package/dist/plugins/firecrawl/index.d.ts +3 -0
- package/dist/plugins/firecrawl/index.d.ts.map +1 -0
- package/dist/plugins/firecrawl/index.js +2 -0
- package/dist/plugins/index.d.ts +47 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +69 -0
- package/dist/plugins/matrix-group-chats/channel-memory.module.d.ts +7 -0
- package/dist/plugins/matrix-group-chats/channel-memory.module.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/channel-memory.module.js +22 -0
- package/dist/plugins/matrix-group-chats/channel-memory.repo.d.ts +62 -0
- package/dist/plugins/matrix-group-chats/channel-memory.repo.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/channel-memory.repo.js +311 -0
- package/dist/plugins/matrix-group-chats/channel-memory.service.d.ts +89 -0
- package/dist/plugins/matrix-group-chats/channel-memory.service.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/channel-memory.service.js +565 -0
- package/dist/plugins/matrix-group-chats/channel-memory.summarizer.d.ts +18 -0
- package/dist/plugins/matrix-group-chats/channel-memory.summarizer.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/channel-memory.summarizer.js +128 -0
- package/dist/plugins/matrix-group-chats/channel-memory.types.d.ts +50 -0
- package/dist/plugins/matrix-group-chats/channel-memory.types.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/channel-memory.types.js +2 -0
- package/dist/plugins/matrix-group-chats/guard.d.ts +83 -0
- package/dist/plugins/matrix-group-chats/guard.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/guard.js +138 -0
- package/dist/plugins/matrix-group-chats/index.d.ts +59 -0
- package/dist/plugins/matrix-group-chats/index.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/index.js +140 -0
- package/dist/plugins/matrix-group-chats/middleware.d.ts +31 -0
- package/dist/plugins/matrix-group-chats/middleware.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/middleware.js +186 -0
- package/dist/plugins/matrix-group-chats/power-levels.d.ts +15 -0
- package/dist/plugins/matrix-group-chats/power-levels.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/power-levels.js +36 -0
- package/dist/plugins/matrix-group-chats/room-info.d.ts +23 -0
- package/dist/plugins/matrix-group-chats/room-info.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/room-info.js +34 -0
- package/dist/plugins/matrix-group-chats/tools.d.ts +8 -0
- package/dist/plugins/matrix-group-chats/tools.d.ts.map +1 -0
- package/dist/plugins/matrix-group-chats/tools.js +154 -0
- package/dist/plugins/memory/index.d.ts +5 -0
- package/dist/plugins/memory/index.d.ts.map +1 -0
- package/dist/plugins/memory/index.js +3 -0
- package/dist/plugins/memory/memory-tools.d.ts +52 -0
- package/dist/plugins/memory/memory-tools.d.ts.map +1 -0
- package/dist/plugins/memory/memory-tools.js +88 -0
- package/dist/plugins/memory/memory-ucan.d.ts +17 -0
- package/dist/plugins/memory/memory-ucan.d.ts.map +1 -0
- package/dist/plugins/memory/memory-ucan.js +43 -0
- package/dist/plugins/memory/memory.plugin.d.ts +51 -0
- package/dist/plugins/memory/memory.plugin.d.ts.map +1 -0
- package/dist/plugins/memory/memory.plugin.js +76 -0
- package/dist/plugins/memory/types.d.ts +75 -0
- package/dist/plugins/memory/types.d.ts.map +1 -0
- package/dist/plugins/memory/types.js +2 -0
- package/dist/plugins/portal/index.d.ts +3 -0
- package/dist/plugins/portal/index.d.ts.map +1 -0
- package/dist/plugins/portal/index.js +2 -0
- package/dist/plugins/portal/portal-agent.d.ts +9 -0
- package/dist/plugins/portal/portal-agent.d.ts.map +1 -0
- package/dist/plugins/portal/portal-agent.js +70 -0
- package/dist/plugins/portal/portal.plugin.d.ts +16 -0
- package/dist/plugins/portal/portal.plugin.d.ts.map +1 -0
- package/dist/plugins/portal/portal.plugin.js +115 -0
- package/dist/plugins/sandbox/index.d.ts +3 -0
- package/dist/plugins/sandbox/index.d.ts.map +1 -0
- package/dist/plugins/sandbox/index.js +2 -0
- package/dist/plugins/sandbox/sandbox-mcp.d.ts +46 -0
- package/dist/plugins/sandbox/sandbox-mcp.d.ts.map +1 -0
- package/dist/plugins/sandbox/sandbox-mcp.js +80 -0
- package/dist/plugins/sandbox/sandbox-write-blob.d.ts +22 -0
- package/dist/plugins/sandbox/sandbox-write-blob.d.ts.map +1 -0
- package/dist/plugins/sandbox/sandbox-write-blob.js +80 -0
- package/dist/plugins/sandbox/sandbox.plugin.d.ts +80 -0
- package/dist/plugins/sandbox/sandbox.plugin.d.ts.map +1 -0
- package/dist/plugins/sandbox/sandbox.plugin.js +204 -0
- package/dist/plugins/skills/index.d.ts +3 -0
- package/dist/plugins/skills/index.d.ts.map +1 -0
- package/dist/plugins/skills/index.js +2 -0
- package/dist/plugins/skills/skills-tools.d.ts +20 -0
- package/dist/plugins/skills/skills-tools.d.ts.map +1 -0
- package/dist/plugins/skills/skills-tools.js +204 -0
- package/dist/plugins/skills/skills-ucan.d.ts +24 -0
- package/dist/plugins/skills/skills-ucan.d.ts.map +1 -0
- package/dist/plugins/skills/skills-ucan.js +28 -0
- package/dist/plugins/skills/skills.plugin.d.ts +37 -0
- package/dist/plugins/skills/skills.plugin.d.ts.map +1 -0
- package/dist/plugins/skills/skills.plugin.js +82 -0
- package/dist/plugins/slack/index.d.ts +4 -0
- package/dist/plugins/slack/index.d.ts.map +1 -0
- package/dist/plugins/slack/index.js +3 -0
- package/dist/plugins/slack/slack.module.d.ts +9 -0
- package/dist/plugins/slack/slack.module.d.ts.map +1 -0
- package/dist/plugins/slack/slack.module.js +27 -0
- package/dist/plugins/slack/slack.plugin.d.ts +30 -0
- package/dist/plugins/slack/slack.plugin.d.ts.map +1 -0
- package/dist/plugins/slack/slack.plugin.js +40 -0
- package/dist/plugins/slack/slack.service.d.ts +32 -0
- package/dist/plugins/slack/slack.service.d.ts.map +1 -0
- package/dist/plugins/slack/slack.service.js +157 -0
- package/dist/plugins/user-preferences/index.d.ts +4 -0
- package/dist/plugins/user-preferences/index.d.ts.map +1 -0
- package/dist/plugins/user-preferences/index.js +3 -0
- package/dist/plugins/user-preferences/service/user-preferences.service.d.ts +61 -0
- package/dist/plugins/user-preferences/service/user-preferences.service.d.ts.map +1 -0
- package/dist/plugins/user-preferences/service/user-preferences.service.js +105 -0
- package/dist/plugins/user-preferences/user-preferences-http.module.d.ts +10 -0
- package/dist/plugins/user-preferences/user-preferences-http.module.d.ts.map +1 -0
- package/dist/plugins/user-preferences/user-preferences-http.module.js +23 -0
- package/dist/plugins/user-preferences/user-preferences-tool.d.ts +22 -0
- package/dist/plugins/user-preferences/user-preferences-tool.d.ts.map +1 -0
- package/dist/plugins/user-preferences/user-preferences-tool.js +103 -0
- package/dist/plugins/user-preferences/user-preferences.controller.d.ts +18 -0
- package/dist/plugins/user-preferences/user-preferences.controller.d.ts.map +1 -0
- package/dist/plugins/user-preferences/user-preferences.controller.js +72 -0
- package/dist/plugins/user-preferences/user-preferences.plugin.d.ts +27 -0
- package/dist/plugins/user-preferences/user-preferences.plugin.d.ts.map +1 -0
- package/dist/plugins/user-preferences/user-preferences.plugin.js +66 -0
- package/dist/registries/config-schema-registry.d.ts +24 -0
- package/dist/registries/config-schema-registry.d.ts.map +1 -0
- package/dist/registries/config-schema-registry.js +27 -0
- package/dist/registries/index.d.ts +13 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js +6 -0
- package/dist/registries/manifest-registry.d.ts +49 -0
- package/dist/registries/manifest-registry.d.ts.map +1 -0
- package/dist/registries/manifest-registry.js +53 -0
- package/dist/registries/middleware-registry.d.ts +41 -0
- package/dist/registries/middleware-registry.d.ts.map +1 -0
- package/dist/registries/middleware-registry.js +52 -0
- package/dist/registries/shared-state-registry.d.ts +41 -0
- package/dist/registries/shared-state-registry.d.ts.map +1 -0
- package/dist/registries/shared-state-registry.js +65 -0
- package/dist/registries/subagent-registry.d.ts +55 -0
- package/dist/registries/subagent-registry.d.ts.map +1 -0
- package/dist/registries/subagent-registry.js +106 -0
- package/dist/registries/test-fixtures.d.ts +47 -0
- package/dist/registries/test-fixtures.d.ts.map +1 -0
- package/dist/registries/test-fixtures.js +168 -0
- package/dist/registries/tool-registry.d.ts +74 -0
- package/dist/registries/tool-registry.d.ts.map +1 -0
- package/dist/registries/tool-registry.js +130 -0
- package/dist/runtime-context/ambient.d.ts +118 -0
- package/dist/runtime-context/ambient.d.ts.map +1 -0
- package/dist/runtime-context/ambient.js +1 -0
- package/dist/runtime-context/build-plugin.d.ts +20 -0
- package/dist/runtime-context/build-plugin.d.ts.map +1 -0
- package/dist/runtime-context/build-plugin.js +16 -0
- package/dist/runtime-context/build-runtime.d.ts +60 -0
- package/dist/runtime-context/build-runtime.d.ts.map +1 -0
- package/dist/runtime-context/build-runtime.js +81 -0
- package/dist/testing/create-test-runtime.d.ts +95 -0
- package/dist/testing/create-test-runtime.d.ts.map +1 -0
- package/dist/testing/create-test-runtime.js +302 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +5 -0
- package/dist/testing/integration/chat-client.d.ts +143 -0
- package/dist/testing/integration/chat-client.d.ts.map +1 -0
- package/dist/testing/integration/chat-client.js +238 -0
- package/dist/testing/integration/harness.d.ts +189 -0
- package/dist/testing/integration/harness.d.ts.map +1 -0
- package/dist/testing/integration/harness.js +461 -0
- package/dist/testing/integration/index.d.ts +14 -0
- package/dist/testing/integration/index.d.ts.map +1 -0
- package/dist/testing/integration/index.js +18 -0
- package/dist/testing/integration/setup.d.ts +2 -0
- package/dist/testing/integration/setup.d.ts.map +1 -0
- package/dist/testing/integration/setup.js +41 -0
- package/dist/testing/integration/sse-parser.d.ts +99 -0
- package/dist/testing/integration/sse-parser.d.ts.map +1 -0
- package/dist/testing/integration/sse-parser.js +125 -0
- package/dist/testing/integration/ucan.d.ts +74 -0
- package/dist/testing/integration/ucan.d.ts.map +1 -0
- package/dist/testing/integration/ucan.js +95 -0
- package/dist/testing/integration/wait-for-matrix-loaded.d.ts +19 -0
- package/dist/testing/integration/wait-for-matrix-loaded.d.ts.map +1 -0
- package/dist/testing/integration/wait-for-matrix-loaded.js +31 -0
- package/dist/testing/mocks.d.ts +64 -0
- package/dist/testing/mocks.d.ts.map +1 -0
- package/dist/testing/mocks.js +141 -0
- package/dist/testing/nest-doubles.d.ts +10 -0
- package/dist/testing/nest-doubles.d.ts.map +1 -0
- package/dist/testing/nest-doubles.js +19 -0
- package/dist/utils/emoji.d.ts +3 -0
- package/dist/utils/emoji.d.ts.map +1 -0
- package/dist/utils/emoji.js +36 -0
- package/package.json +102 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-DID Matrix home-server cache. `getMatrixHomeServerCroppedForDid` does a
|
|
3
|
+
* chain-side lookup; the result is stable per user for the lifetime of their
|
|
4
|
+
* Matrix account, so a 1h TTL is conservative. Saves 50-200ms per request
|
|
5
|
+
* after the first warm-up.
|
|
6
|
+
*/
|
|
7
|
+
export declare class HomeServerCache {
|
|
8
|
+
private readonly cache;
|
|
9
|
+
get(userDid: string): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=homeserver-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"homeserver-cache.d.ts","sourceRoot":"","sources":["../../../src/modules/messages/homeserver-cache.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,qBACa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IAEjD,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAS5C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { getMatrixHomeServerCroppedForDid } from '@ixo/oracles-chain-client';
|
|
8
|
+
import { Injectable } from '@nestjs/common';
|
|
9
|
+
const TTL_MS = 60 * 60 * 1000;
|
|
10
|
+
/**
|
|
11
|
+
* Per-DID Matrix home-server cache. `getMatrixHomeServerCroppedForDid` does a
|
|
12
|
+
* chain-side lookup; the result is stable per user for the lifetime of their
|
|
13
|
+
* Matrix account, so a 1h TTL is conservative. Saves 50-200ms per request
|
|
14
|
+
* after the first warm-up.
|
|
15
|
+
*/
|
|
16
|
+
let HomeServerCache = class HomeServerCache {
|
|
17
|
+
cache = new Map();
|
|
18
|
+
async get(userDid) {
|
|
19
|
+
const cached = this.cache.get(userDid);
|
|
20
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
21
|
+
return cached.homeServer;
|
|
22
|
+
}
|
|
23
|
+
const homeServer = await getMatrixHomeServerCroppedForDid(userDid);
|
|
24
|
+
this.cache.set(userDid, { homeServer, expiresAt: Date.now() + TTL_MS });
|
|
25
|
+
return homeServer;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
HomeServerCache = __decorate([
|
|
29
|
+
Injectable()
|
|
30
|
+
], HomeServerCache);
|
|
31
|
+
export { HomeServerCache };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SessionManagerService } from '@ixo/common';
|
|
2
|
+
import { type OnModuleDestroy, type OnModuleInit } from '@nestjs/common';
|
|
3
|
+
import { ConfigService } from '@nestjs/config';
|
|
4
|
+
export interface MatrixIncomingMessage {
|
|
5
|
+
did: string;
|
|
6
|
+
message: string;
|
|
7
|
+
threadId: string;
|
|
8
|
+
langchainThreadId?: string;
|
|
9
|
+
roomId: string;
|
|
10
|
+
homeServer?: string;
|
|
11
|
+
/** Sender's full Matrix user id (e.g. `@alice:matrix.example`). */
|
|
12
|
+
senderMatrixUserId?: string;
|
|
13
|
+
/** Matrix event id of the latest text event being delivered. */
|
|
14
|
+
eventId?: string;
|
|
15
|
+
/** Raw `m.mentions` payload from the event, if present. */
|
|
16
|
+
mentions?: {
|
|
17
|
+
user_ids?: string[];
|
|
18
|
+
};
|
|
19
|
+
/** Raw `m.relates_to` payload from the event, if present. */
|
|
20
|
+
relatesTo?: {
|
|
21
|
+
'm.in_reply_to'?: {
|
|
22
|
+
event_id: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
attachments?: Array<{
|
|
26
|
+
eventId: string;
|
|
27
|
+
filename: string;
|
|
28
|
+
mimetype: string;
|
|
29
|
+
size?: number;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Bridges Matrix room events into chat turns. Handles:
|
|
34
|
+
*
|
|
35
|
+
* - Ignoring own (oracle) messages and INTERNAL events
|
|
36
|
+
* - Thread-root resolution with caching (a Matrix reply chain → session)
|
|
37
|
+
* - Per-thread debounce so text + file pairs land as one turn
|
|
38
|
+
* - Session bootstrap when the sender doesn't have one yet
|
|
39
|
+
*
|
|
40
|
+
* The bridge owns the listener registration. The caller (MessagesService)
|
|
41
|
+
* supplies a callback that turns a debounced thread batch into a chat
|
|
42
|
+
* invocation — this keeps the bridge ignorant of the runtime/graph layer.
|
|
43
|
+
*/
|
|
44
|
+
export declare class MatrixListenerBridge implements OnModuleInit, OnModuleDestroy {
|
|
45
|
+
private readonly sessions;
|
|
46
|
+
private readonly config;
|
|
47
|
+
private readonly logger;
|
|
48
|
+
private cleanUpListener?;
|
|
49
|
+
private readonly threadRootCache;
|
|
50
|
+
private readonly buffer;
|
|
51
|
+
private readonly matrixManager;
|
|
52
|
+
private deliverHandler;
|
|
53
|
+
constructor(sessions: SessionManagerService, config: ConfigService);
|
|
54
|
+
/** Register the callback invoked once a debounced thread batch is ready. */
|
|
55
|
+
setDeliverHandler(handler: (msg: MatrixIncomingMessage) => Promise<unknown>): void;
|
|
56
|
+
onModuleInit(): void;
|
|
57
|
+
onModuleDestroy(): void;
|
|
58
|
+
private handleMessage;
|
|
59
|
+
private ensureSession;
|
|
60
|
+
private flush;
|
|
61
|
+
private getThreadRoot;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=matrix-listener-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrix-listener-bridge.d.ts","sourceRoot":"","sources":["../../../src/modules/messages/matrix-listener-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAoB,MAAM,aAAa,CAAC;AAMtE,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA0B/C,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACnC,6DAA6D;IAC7D,SAAS,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACvD,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AAED;;;;;;;;;;;GAWG;AACH,qBACa,oBAAqB,YAAW,YAAY,EAAE,eAAe;IAWtE,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAXzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,OAAO,CAAC,eAAe,CAAC,CAAa;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkC;IACzD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,cAAc,CAEN;gBAGG,QAAQ,EAAE,qBAAqB,EAC/B,MAAM,EAAE,aAAa;IAKxC,4EAA4E;IAC5E,iBAAiB,CACf,OAAO,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,OAAO,CAAC,OAAO,CAAC,GACxD,IAAI;IAIP,YAAY,IAAI,IAAI;IAgBpB,eAAe,IAAI,IAAI;YAMT,aAAa;YAkDb,aAAa;YAqCb,KAAK;YAuGL,aAAa;CAiD5B"}
|
|
@@ -0,0 +1,280 @@
|
|
|
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 MatrixListenerBridge_1;
|
|
11
|
+
import { SessionManagerService } from '@ixo/common';
|
|
12
|
+
import { Injectable, Logger, } from '@nestjs/common';
|
|
13
|
+
import { ConfigService } from '@nestjs/config';
|
|
14
|
+
const FILE_MSGTYPES = new Set(['m.file', 'm.image', 'm.video', 'm.audio']);
|
|
15
|
+
const DEBOUNCE_MS = 500;
|
|
16
|
+
/**
|
|
17
|
+
* Bridges Matrix room events into chat turns. Handles:
|
|
18
|
+
*
|
|
19
|
+
* - Ignoring own (oracle) messages and INTERNAL events
|
|
20
|
+
* - Thread-root resolution with caching (a Matrix reply chain → session)
|
|
21
|
+
* - Per-thread debounce so text + file pairs land as one turn
|
|
22
|
+
* - Session bootstrap when the sender doesn't have one yet
|
|
23
|
+
*
|
|
24
|
+
* The bridge owns the listener registration. The caller (MessagesService)
|
|
25
|
+
* supplies a callback that turns a debounced thread batch into a chat
|
|
26
|
+
* invocation — this keeps the bridge ignorant of the runtime/graph layer.
|
|
27
|
+
*/
|
|
28
|
+
let MatrixListenerBridge = MatrixListenerBridge_1 = class MatrixListenerBridge {
|
|
29
|
+
sessions;
|
|
30
|
+
config;
|
|
31
|
+
logger = new Logger(MatrixListenerBridge_1.name);
|
|
32
|
+
cleanUpListener;
|
|
33
|
+
threadRootCache = new Map();
|
|
34
|
+
buffer = new Map();
|
|
35
|
+
matrixManager;
|
|
36
|
+
deliverHandler = null;
|
|
37
|
+
constructor(sessions, config) {
|
|
38
|
+
this.sessions = sessions;
|
|
39
|
+
this.config = config;
|
|
40
|
+
this.matrixManager = this.sessions.matrixManger;
|
|
41
|
+
}
|
|
42
|
+
/** Register the callback invoked once a debounced thread batch is ready. */
|
|
43
|
+
setDeliverHandler(handler) {
|
|
44
|
+
this.deliverHandler = handler;
|
|
45
|
+
}
|
|
46
|
+
onModuleInit() {
|
|
47
|
+
this.matrixManager
|
|
48
|
+
.init()
|
|
49
|
+
.then(() => {
|
|
50
|
+
this.cleanUpListener = this.matrixManager.onMessage((roomId, event) => {
|
|
51
|
+
this.handleMessage(event, roomId).catch((err) => this.logger.error('Matrix listener failed', err));
|
|
52
|
+
});
|
|
53
|
+
this.logger.log('Matrix message listener registered');
|
|
54
|
+
})
|
|
55
|
+
.catch((err) => this.logger.error('Failed to set up Matrix listener', err));
|
|
56
|
+
}
|
|
57
|
+
onModuleDestroy() {
|
|
58
|
+
for (const [, entry] of this.buffer)
|
|
59
|
+
clearTimeout(entry.timer);
|
|
60
|
+
this.buffer.clear();
|
|
61
|
+
this.cleanUpListener?.();
|
|
62
|
+
}
|
|
63
|
+
async handleMessage(event, roomId) {
|
|
64
|
+
const did = normalizeDid(event.sender);
|
|
65
|
+
const oracleDid = this.config.getOrThrow('ORACLE_DID');
|
|
66
|
+
if (did === oracleDid)
|
|
67
|
+
return;
|
|
68
|
+
if ('INTERNAL' in event.content)
|
|
69
|
+
return;
|
|
70
|
+
const msgtype = event.content.msgtype;
|
|
71
|
+
const isText = msgtype === 'm.text' &&
|
|
72
|
+
'body' in event.content &&
|
|
73
|
+
typeof event.content.body === 'string';
|
|
74
|
+
const isFile = typeof msgtype === 'string' && FILE_MSGTYPES.has(msgtype);
|
|
75
|
+
if (!isText && !isFile)
|
|
76
|
+
return;
|
|
77
|
+
const threadId = await this.getThreadRoot(event, roomId);
|
|
78
|
+
if (!threadId) {
|
|
79
|
+
this.logger.warn(`No thread root for eventId=${event.eventId} roomId=${roomId}`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const threadEv = await this.matrixManager.getEventById(roomId, threadId);
|
|
83
|
+
const langchainThreadId = threadEv.content
|
|
84
|
+
?.sessionId;
|
|
85
|
+
const sessionId = threadId;
|
|
86
|
+
await this.ensureSession(did, sessionId, event, roomId);
|
|
87
|
+
const existing = this.buffer.get(threadId);
|
|
88
|
+
if (existing) {
|
|
89
|
+
clearTimeout(existing.timer);
|
|
90
|
+
existing.events.push({ event, roomId });
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.buffer.set(threadId, {
|
|
94
|
+
events: [{ event, roomId }],
|
|
95
|
+
timer: null,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const entry = this.buffer.get(threadId);
|
|
99
|
+
entry.timer = setTimeout(() => {
|
|
100
|
+
this.flush(threadId, langchainThreadId).catch((err) => this.logger.error(`Flush failed for thread ${threadId}`, err));
|
|
101
|
+
}, DEBOUNCE_MS);
|
|
102
|
+
}
|
|
103
|
+
async ensureSession(did, sessionId, event, roomId) {
|
|
104
|
+
let hasSession;
|
|
105
|
+
try {
|
|
106
|
+
hasSession = await this.sessions.getSession(sessionId, did, false);
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
this.logger.error(`Error checking session did=${did} sessionId=${sessionId}`, err);
|
|
110
|
+
}
|
|
111
|
+
if (hasSession)
|
|
112
|
+
return;
|
|
113
|
+
const userHomeServer = event.sender.split(':').slice(1).join(':');
|
|
114
|
+
try {
|
|
115
|
+
await this.sessions.createSession({
|
|
116
|
+
did,
|
|
117
|
+
oracleDid: this.config.getOrThrow('ORACLE_DID'),
|
|
118
|
+
oracleEntityDid: this.config.getOrThrow('ORACLE_ENTITY_DID'),
|
|
119
|
+
oracleName: this.config.getOrThrow('ORACLE_NAME'),
|
|
120
|
+
homeServer: userHomeServer,
|
|
121
|
+
roomId,
|
|
122
|
+
}, event.eventId);
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
this.logger.error(`createSession failed did=${did}`, err);
|
|
126
|
+
throw err;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async flush(threadId, langchainThreadId) {
|
|
130
|
+
const entry = this.buffer.get(threadId);
|
|
131
|
+
if (!entry)
|
|
132
|
+
return;
|
|
133
|
+
this.buffer.delete(threadId);
|
|
134
|
+
const first = entry.events[0];
|
|
135
|
+
if (!first)
|
|
136
|
+
return;
|
|
137
|
+
const did = normalizeDid(first.event.sender);
|
|
138
|
+
const homeServer = first.event.sender.split(':')[1];
|
|
139
|
+
let text;
|
|
140
|
+
let latestTextEvent;
|
|
141
|
+
const attachments = [];
|
|
142
|
+
for (const { event } of entry.events) {
|
|
143
|
+
const msgtype = event.content.msgtype;
|
|
144
|
+
if (msgtype === 'm.text' &&
|
|
145
|
+
'body' in event.content &&
|
|
146
|
+
typeof event.content.body === 'string') {
|
|
147
|
+
text = event.content.body;
|
|
148
|
+
latestTextEvent = event;
|
|
149
|
+
}
|
|
150
|
+
else if (typeof msgtype === 'string' && FILE_MSGTYPES.has(msgtype)) {
|
|
151
|
+
attachments.push(buildAttachment(event));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Speaker + threading metadata for the downstream HumanMessage. Use the
|
|
155
|
+
// latest text event when available (so mentions / replies refer to the
|
|
156
|
+
// user-visible message), otherwise fall back to the first event in the
|
|
157
|
+
// batch (file-only sends).
|
|
158
|
+
const sourceEvent = latestTextEvent ?? first.event;
|
|
159
|
+
this.logger.debug(`flush sourceEvent eventId=${sourceEvent.eventId} sender=${sourceEvent.sender}`);
|
|
160
|
+
const senderMatrixUserId = sourceEvent.sender;
|
|
161
|
+
const eventId = sourceEvent.eventId;
|
|
162
|
+
const sourceContent = sourceEvent.content;
|
|
163
|
+
const mentions = sourceContent['m.mentions'];
|
|
164
|
+
const relatesTo = sourceContent['m.relates_to'];
|
|
165
|
+
const message = text ??
|
|
166
|
+
(attachments.length === 1
|
|
167
|
+
? `User shared a file: ${attachments[0]?.filename ?? 'file'}`
|
|
168
|
+
: `User shared ${attachments.length} file(s): ${attachments.map((a) => a.filename).join(', ')}`);
|
|
169
|
+
if (!this.deliverHandler) {
|
|
170
|
+
this.logger.warn('MatrixListenerBridge.flush: deliverHandler not set; dropping message');
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const aiResponse = (await this.deliverHandler({
|
|
175
|
+
did,
|
|
176
|
+
message,
|
|
177
|
+
threadId,
|
|
178
|
+
langchainThreadId,
|
|
179
|
+
roomId: first.roomId,
|
|
180
|
+
homeServer,
|
|
181
|
+
senderMatrixUserId,
|
|
182
|
+
eventId,
|
|
183
|
+
...(mentions && { mentions }),
|
|
184
|
+
...(relatesTo && { relatesTo }),
|
|
185
|
+
...(attachments.length > 0 && { attachments }),
|
|
186
|
+
}));
|
|
187
|
+
if (!aiResponse) {
|
|
188
|
+
this.logger.warn(`No AI response returned for threadId=${threadId}`);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
// The BatchInvoker returns whatever lives at the tail of graph state.
|
|
192
|
+
// When a `beforeAgent` middleware short-circuits with `jumpTo: 'end'`
|
|
193
|
+
// (e.g. the group-chat gate ignoring an un-mentioned room message),
|
|
194
|
+
// no AI message is produced and the tail is the user's own
|
|
195
|
+
// HumanMessage. Posting that back would echo the user to themselves
|
|
196
|
+
// with the speaker-prefix applied.
|
|
197
|
+
if (aiResponse.message.type !== 'ai') {
|
|
198
|
+
this.logger.log(`Skipping Matrix reply for threadId=${threadId} — agent did not produce an AI message (tail type=${aiResponse.message.type})`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
await this.matrixManager.sendMessage({
|
|
202
|
+
message: aiResponse.message.content,
|
|
203
|
+
roomId: first.roomId,
|
|
204
|
+
threadId,
|
|
205
|
+
isOracleAdmin: true,
|
|
206
|
+
disablePrefix: true,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
this.logger.error('Failed to handle Matrix message', error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
async getThreadRoot(event, roomId) {
|
|
214
|
+
const eventId = event.eventId;
|
|
215
|
+
if (!eventId)
|
|
216
|
+
return undefined;
|
|
217
|
+
const inReplyTo = event.content['m.relates_to']?.['m.in_reply_to']?.event_id;
|
|
218
|
+
if (!inReplyTo) {
|
|
219
|
+
this.threadRootCache.set(eventId, eventId);
|
|
220
|
+
return eventId;
|
|
221
|
+
}
|
|
222
|
+
if (this.threadRootCache.has(inReplyTo)) {
|
|
223
|
+
const root = this.threadRootCache.get(inReplyTo);
|
|
224
|
+
if (!root)
|
|
225
|
+
return undefined;
|
|
226
|
+
this.threadRootCache.set(eventId, root);
|
|
227
|
+
return root;
|
|
228
|
+
}
|
|
229
|
+
const pathToCache = [eventId];
|
|
230
|
+
let cursor = inReplyTo;
|
|
231
|
+
const visited = new Set();
|
|
232
|
+
while (cursor && !visited.has(cursor)) {
|
|
233
|
+
visited.add(cursor);
|
|
234
|
+
pathToCache.push(cursor);
|
|
235
|
+
if (this.threadRootCache.has(cursor)) {
|
|
236
|
+
const root = this.threadRootCache.get(cursor);
|
|
237
|
+
if (!root)
|
|
238
|
+
return undefined;
|
|
239
|
+
pathToCache.forEach((id) => this.threadRootCache.set(id, root));
|
|
240
|
+
return root;
|
|
241
|
+
}
|
|
242
|
+
const parent = await this.matrixManager.getEventById(roomId, cursor);
|
|
243
|
+
const parentReply = parent.content['m.relates_to']?.['m.in_reply_to']?.event_id;
|
|
244
|
+
if (!parentReply) {
|
|
245
|
+
pathToCache.forEach((id) => this.threadRootCache.set(id, cursor));
|
|
246
|
+
return cursor;
|
|
247
|
+
}
|
|
248
|
+
cursor = parentReply;
|
|
249
|
+
}
|
|
250
|
+
const fallback = cursor || eventId;
|
|
251
|
+
pathToCache.forEach((id) => this.threadRootCache.set(id, fallback));
|
|
252
|
+
return fallback;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
MatrixListenerBridge = MatrixListenerBridge_1 = __decorate([
|
|
256
|
+
Injectable(),
|
|
257
|
+
__metadata("design:paramtypes", [SessionManagerService,
|
|
258
|
+
ConfigService])
|
|
259
|
+
], MatrixListenerBridge);
|
|
260
|
+
export { MatrixListenerBridge };
|
|
261
|
+
function normalizeDid(input) {
|
|
262
|
+
const username = input.split(':')[0] ?? '';
|
|
263
|
+
const parts = username.split('-');
|
|
264
|
+
if (parts.length < 3 || parts[0] !== '@did') {
|
|
265
|
+
throw new Error(`Invalid DID format: ${input}`);
|
|
266
|
+
}
|
|
267
|
+
const namespace = parts[1];
|
|
268
|
+
const identifier = parts.slice(2).join('-');
|
|
269
|
+
return `did:${namespace}:${identifier}`;
|
|
270
|
+
}
|
|
271
|
+
function buildAttachment(event) {
|
|
272
|
+
const content = event.content;
|
|
273
|
+
const info = content.info;
|
|
274
|
+
return {
|
|
275
|
+
eventId: event.eventId,
|
|
276
|
+
filename: content.filename ?? content.body ?? 'file',
|
|
277
|
+
mimetype: info?.mimetype ?? 'application/octet-stream',
|
|
278
|
+
size: info?.size,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Request, Response } from 'express';
|
|
2
|
+
import { AbortRequestDto, SendMessageDto } from './dto/send-message.dto.js';
|
|
3
|
+
import { MessagesService } from './messages.service.js';
|
|
4
|
+
export declare class MessagesController {
|
|
5
|
+
private readonly messagesService;
|
|
6
|
+
constructor(messagesService: MessagesService);
|
|
7
|
+
abortRequest(abortRequestDto: AbortRequestDto): Promise<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
listMessages(req: Request, sessionId: string): Promise<import("@ixo/common").ListOracleMessagesResponse>;
|
|
11
|
+
sendMessage(req: Request, sendMessageDto: SendMessageDto, sessionId: string, res: Response): Promise<Response<any, Record<string, any>> | undefined>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=messages.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.controller.d.ts","sourceRoot":"","sources":["../../../src/modules/messages/messages.controller.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,qBAEa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAMvD,YAAY,CAAS,eAAe,EAAE,eAAe;;;IAarD,YAAY,CACT,GAAG,EAAE,OAAO,EACC,SAAS,EAAE,MAAM;IAYjC,WAAW,CACR,GAAG,EAAE,OAAO,EACX,cAAc,EAAE,cAAc,EAClB,SAAS,EAAE,MAAM,EAC9B,GAAG,EAAE,QAAQ;CAwBvB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Req, Res, } from '@nestjs/common';
|
|
14
|
+
import { ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
15
|
+
import { AbortRequestDto, SendMessageDto } from './dto/send-message.dto.js';
|
|
16
|
+
import { MessagesService } from './messages.service.js';
|
|
17
|
+
let MessagesController = class MessagesController {
|
|
18
|
+
messagesService;
|
|
19
|
+
constructor(messagesService) {
|
|
20
|
+
this.messagesService = messagesService;
|
|
21
|
+
}
|
|
22
|
+
async abortRequest(abortRequestDto) {
|
|
23
|
+
const success = this.messagesService.abortRequest(abortRequestDto.sessionId);
|
|
24
|
+
return { success };
|
|
25
|
+
}
|
|
26
|
+
async listMessages(req, sessionId) {
|
|
27
|
+
const { did } = req.authData;
|
|
28
|
+
return this.messagesService.listMessages({ sessionId, did });
|
|
29
|
+
}
|
|
30
|
+
async sendMessage(req, sendMessageDto, sessionId, res) {
|
|
31
|
+
const { did, ucanDelegation } = req.authData;
|
|
32
|
+
const payload = {
|
|
33
|
+
...sendMessageDto,
|
|
34
|
+
did,
|
|
35
|
+
sessionId,
|
|
36
|
+
ucanDelegation,
|
|
37
|
+
};
|
|
38
|
+
if (sendMessageDto.stream) {
|
|
39
|
+
// SSE headers are set inside `SseStreamRunner` *after* prepareForQuery
|
|
40
|
+
// resolves the requestId — that lets us include `X-Request-Id` in the
|
|
41
|
+
// response and the matching `Access-Control-Expose-Headers` so the FE
|
|
42
|
+
// can read it. The earlier "flush before pre-flight" optimization
|
|
43
|
+
// dropped those headers and broke FE clients that expect them.
|
|
44
|
+
await this.messagesService.sendMessage({ ...payload, res, req });
|
|
45
|
+
// The service ends the response in its `finally` — nothing to return.
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const result = await this.messagesService.sendMessage({ ...payload, req });
|
|
49
|
+
return res.status(HttpStatus.OK).json(result);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
__decorate([
|
|
53
|
+
Post('abort'),
|
|
54
|
+
HttpCode(HttpStatus.OK),
|
|
55
|
+
ApiOperation({ summary: 'Abort an ongoing stream request' }),
|
|
56
|
+
ApiResponse({ status: 200, description: 'Request aborted successfully.' }),
|
|
57
|
+
__param(0, Body()),
|
|
58
|
+
__metadata("design:type", Function),
|
|
59
|
+
__metadata("design:paramtypes", [AbortRequestDto]),
|
|
60
|
+
__metadata("design:returntype", Promise)
|
|
61
|
+
], MessagesController.prototype, "abortRequest", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
Get(':sessionId'),
|
|
64
|
+
ApiOperation({ summary: 'List messages in a session' }),
|
|
65
|
+
ApiParam({ name: 'sessionId', required: true }),
|
|
66
|
+
ApiResponse({ status: 200, description: 'Messages retrieved successfully.' }),
|
|
67
|
+
ApiResponse({ status: 400, description: 'Bad Request.' }),
|
|
68
|
+
ApiResponse({ status: 404, description: 'Room not found.' }),
|
|
69
|
+
__param(0, Req()),
|
|
70
|
+
__param(1, Param('sessionId')),
|
|
71
|
+
__metadata("design:type", Function),
|
|
72
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
73
|
+
__metadata("design:returntype", Promise)
|
|
74
|
+
], MessagesController.prototype, "listMessages", null);
|
|
75
|
+
__decorate([
|
|
76
|
+
Post(':sessionId'),
|
|
77
|
+
HttpCode(HttpStatus.OK),
|
|
78
|
+
ApiOperation({ summary: 'Send a message to the oracle' }),
|
|
79
|
+
ApiParam({ name: 'sessionId', required: true }),
|
|
80
|
+
ApiResponse({ status: 200, description: 'Message sent successfully.' }),
|
|
81
|
+
ApiResponse({ status: 400, description: 'Bad Request.' }),
|
|
82
|
+
__param(0, Req()),
|
|
83
|
+
__param(1, Body()),
|
|
84
|
+
__param(2, Param('sessionId')),
|
|
85
|
+
__param(3, Res()),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", [Object, SendMessageDto, String, Object]),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], MessagesController.prototype, "sendMessage", null);
|
|
90
|
+
MessagesController = __decorate([
|
|
91
|
+
ApiTags('messages'),
|
|
92
|
+
Controller('messages'),
|
|
93
|
+
__metadata("design:paramtypes", [MessagesService])
|
|
94
|
+
], MessagesController);
|
|
95
|
+
export { MessagesController };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.module.d.ts","sourceRoot":"","sources":["../../../src/modules/messages/messages.module.ts"],"names":[],"mappings":"AAoBA,qBAgDa,cAAc;CAAG"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { MemoryEngineService, SessionManagerService } from '@ixo/common';
|
|
8
|
+
import { MatrixManager } from '@ixo/matrix';
|
|
9
|
+
import { Module } from '@nestjs/common';
|
|
10
|
+
import { ConfigService } from '@nestjs/config';
|
|
11
|
+
import { CheckpointStorageSyncModule } from '../../matrix/checkpointer/user-matrix-sqlite-sync-service.module.js';
|
|
12
|
+
import { UserMatrixSqliteSyncService } from '../../matrix/checkpointer/user-matrix-sqlite-sync-service.service.js';
|
|
13
|
+
import { UcanModule } from '../ucan/ucan.module.js';
|
|
14
|
+
import { AgentBuilder } from './agent-builder.js';
|
|
15
|
+
import { BatchInvoker } from './batch-invoker.js';
|
|
16
|
+
import { FileProcessingService } from './file-processing.service.js';
|
|
17
|
+
import { HomeServerCache } from './homeserver-cache.js';
|
|
18
|
+
import { MatrixListenerBridge } from './matrix-listener-bridge.js';
|
|
19
|
+
import { MessagesController } from './messages.controller.js';
|
|
20
|
+
import { MessagesService } from './messages.service.js';
|
|
21
|
+
import { OracleRuntimeBundleHolder } from './oracle-runtime-bundle.js';
|
|
22
|
+
import { PostMessageSyncer } from './post-message-syncer.js';
|
|
23
|
+
import { RequestPreparer } from './request-preparer.js';
|
|
24
|
+
import { SseStreamRunner } from './sse-stream-runner.js';
|
|
25
|
+
import { UserContextFetcher } from './user-context-fetcher.js';
|
|
26
|
+
let MessagesModule = class MessagesModule {
|
|
27
|
+
};
|
|
28
|
+
MessagesModule = __decorate([
|
|
29
|
+
Module({
|
|
30
|
+
imports: [CheckpointStorageSyncModule, UcanModule],
|
|
31
|
+
controllers: [MessagesController],
|
|
32
|
+
providers: [
|
|
33
|
+
MessagesService,
|
|
34
|
+
FileProcessingService,
|
|
35
|
+
OracleRuntimeBundleHolder,
|
|
36
|
+
HomeServerCache,
|
|
37
|
+
RequestPreparer,
|
|
38
|
+
AgentBuilder,
|
|
39
|
+
SseStreamRunner,
|
|
40
|
+
UserContextFetcher,
|
|
41
|
+
BatchInvoker,
|
|
42
|
+
PostMessageSyncer,
|
|
43
|
+
MatrixListenerBridge,
|
|
44
|
+
{
|
|
45
|
+
// `MemoryEngineService` is OPTIONAL. `UserContextFetcher` reads it
|
|
46
|
+
// each turn (cached for 3 min) to populate `state.userContext`
|
|
47
|
+
// before the agent is built. When `MEMORY_ENGINE_URL` isn't set,
|
|
48
|
+
// we provide `null` and the fetcher returns `undefined`. The memory
|
|
49
|
+
// plugin still gates its OWN tool surface via `autoDetect`/`configSchema`.
|
|
50
|
+
provide: MemoryEngineService,
|
|
51
|
+
useFactory: (configService) => {
|
|
52
|
+
const memoryEngineUrl = configService.get('MEMORY_ENGINE_URL');
|
|
53
|
+
return memoryEngineUrl
|
|
54
|
+
? new MemoryEngineService(memoryEngineUrl)
|
|
55
|
+
: null;
|
|
56
|
+
},
|
|
57
|
+
inject: [ConfigService],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
provide: SessionManagerService,
|
|
61
|
+
useFactory: (syncService) => {
|
|
62
|
+
return new SessionManagerService(syncService, MatrixManager.getInstance());
|
|
63
|
+
},
|
|
64
|
+
inject: [UserMatrixSqliteSyncService],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
exports: [
|
|
68
|
+
MessagesService,
|
|
69
|
+
MemoryEngineService,
|
|
70
|
+
SessionManagerService,
|
|
71
|
+
OracleRuntimeBundleHolder,
|
|
72
|
+
],
|
|
73
|
+
})
|
|
74
|
+
], MessagesModule);
|
|
75
|
+
export { MessagesModule };
|