@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
|
+
* True when `matrixUserId` is a joined member of `roomId`. Fails closed:
|
|
3
|
+
* returns `false` on a missing id or any lookup error, so a Matrix outage
|
|
4
|
+
* denies access rather than silently granting it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isUserInRoom(roomId: string, matrixUserId: string | undefined, opts?: {
|
|
7
|
+
ttlMs?: number;
|
|
8
|
+
}): Promise<boolean>;
|
|
9
|
+
/** Drop a room's cached membership (e.g. after a known membership change). */
|
|
10
|
+
export declare function invalidateRoomMembership(roomId: string): void;
|
|
11
|
+
//# sourceMappingURL=room-membership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room-membership.d.ts","sourceRoot":"","sources":["../../src/matrix/room-membership.ts"],"names":[],"mappings":"AAsCA;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5B,OAAO,CAAC,OAAO,CAAC,CAQlB;AAED,8EAA8E;AAC9E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE7D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MatrixManager } from '@ixo/matrix';
|
|
2
|
+
const DEFAULT_TTL_MS = 60_000;
|
|
3
|
+
const cache = new Map();
|
|
4
|
+
async function getRoomMembers(roomId, ttlMs) {
|
|
5
|
+
const cached = cache.get(roomId);
|
|
6
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
7
|
+
return cached.members;
|
|
8
|
+
}
|
|
9
|
+
const info = await MatrixManager.getInstance().getRoomInfo(roomId);
|
|
10
|
+
const members = new Set(info.joinedMemberIds);
|
|
11
|
+
cache.set(roomId, { members, expiresAt: Date.now() + ttlMs });
|
|
12
|
+
return members;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* True when `matrixUserId` is a joined member of `roomId`. Fails closed:
|
|
16
|
+
* returns `false` on a missing id or any lookup error, so a Matrix outage
|
|
17
|
+
* denies access rather than silently granting it.
|
|
18
|
+
*/
|
|
19
|
+
export async function isUserInRoom(roomId, matrixUserId, opts = {}) {
|
|
20
|
+
if (!roomId || !matrixUserId)
|
|
21
|
+
return false;
|
|
22
|
+
try {
|
|
23
|
+
const members = await getRoomMembers(roomId, opts.ttlMs ?? DEFAULT_TTL_MS);
|
|
24
|
+
return members.has(matrixUserId);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Drop a room's cached membership (e.g. after a known membership change). */
|
|
31
|
+
export function invalidateRoomMembership(roomId) {
|
|
32
|
+
cache.delete(roomId);
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PluginTool } from '../plugin-api/types.js';
|
|
2
|
+
import type { ManifestRegistry } from '../registries/manifest-registry.js';
|
|
3
|
+
import type { ToolRegistry } from '../registries/tool-registry.js';
|
|
4
|
+
/**
|
|
5
|
+
* Inputs for `buildMetaTools`. The runtime passes its already-collected
|
|
6
|
+
* registries; the meta-tools read manifests and tool descriptors from them.
|
|
7
|
+
*/
|
|
8
|
+
export interface BuildMetaToolsOptions {
|
|
9
|
+
manifestRegistry: ManifestRegistry;
|
|
10
|
+
toolRegistry: ToolRegistry;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Build the two meta-tools the agent always has, regardless of which
|
|
14
|
+
* plugins are loaded:
|
|
15
|
+
*
|
|
16
|
+
* - `load_capability` — mark a plugin as loaded for this thread; returns
|
|
17
|
+
* the plugin's full manifest + tool list, so the
|
|
18
|
+
* agent gets discovery + load in one call.
|
|
19
|
+
* - `list_capabilities` — list every visible plugin with status flags.
|
|
20
|
+
*
|
|
21
|
+
* These tools are internal: registered by the runtime in `createMainAgent`,
|
|
22
|
+
* never exported on the public package surface, and not authorable by
|
|
23
|
+
* plugins.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildMetaTools(opts: BuildMetaToolsOptions): PluginTool[];
|
|
26
|
+
export { buildLoadCapabilityTool } from './load-capability.js';
|
|
27
|
+
export { buildListCapabilitiesTool } from './list-capabilities.js';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/meta-tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAInE;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,UAAU,EAAE,CAMxE;AAED,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { buildLoadCapabilityTool } from './load-capability.js';
|
|
2
|
+
import { buildListCapabilitiesTool } from './list-capabilities.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build the two meta-tools the agent always has, regardless of which
|
|
5
|
+
* plugins are loaded:
|
|
6
|
+
*
|
|
7
|
+
* - `load_capability` — mark a plugin as loaded for this thread; returns
|
|
8
|
+
* the plugin's full manifest + tool list, so the
|
|
9
|
+
* agent gets discovery + load in one call.
|
|
10
|
+
* - `list_capabilities` — list every visible plugin with status flags.
|
|
11
|
+
*
|
|
12
|
+
* These tools are internal: registered by the runtime in `createMainAgent`,
|
|
13
|
+
* never exported on the public package surface, and not authorable by
|
|
14
|
+
* plugins.
|
|
15
|
+
*/
|
|
16
|
+
export function buildMetaTools(opts) {
|
|
17
|
+
const { manifestRegistry, toolRegistry } = opts;
|
|
18
|
+
return [
|
|
19
|
+
buildLoadCapabilityTool(manifestRegistry, toolRegistry),
|
|
20
|
+
buildListCapabilitiesTool(manifestRegistry),
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
export { buildLoadCapabilityTool } from './load-capability.js';
|
|
24
|
+
export { buildListCapabilitiesTool } from './list-capabilities.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginTool } from '../plugin-api/types.js';
|
|
2
|
+
import type { ManifestRegistry } from '../registries/manifest-registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build the `list_capabilities` meta-tool.
|
|
5
|
+
*
|
|
6
|
+
* Returns one entry per loaded plugin, with a `loaded` flag that combines
|
|
7
|
+
* the boot-time always-on plugins (`visibility === 'always'`) with the set
|
|
8
|
+
* of plugins the agent has explicitly loaded for this thread (the
|
|
9
|
+
* `loadedPlugins` state field).
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildListCapabilitiesTool(manifestRegistry: ManifestRegistry): PluginTool;
|
|
12
|
+
//# sourceMappingURL=list-capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-capabilities.d.ts","sourceRoot":"","sources":["../../src/meta-tools/list-capabilities.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAuB3E;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,gBAAgB,EAAE,gBAAgB,GACjC,UAAU,CA2CZ"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { tool } from '../plugin-api/tool-helper.js';
|
|
3
|
+
/**
|
|
4
|
+
* Schema accepted by `list_capabilities`.
|
|
5
|
+
*
|
|
6
|
+
* `includeOnDemand` defaults `true` because the agent normally wants to see
|
|
7
|
+
* everything it could load. `includeSilent` defaults `false` because silent
|
|
8
|
+
* plugins are not loadable and are kept out of the agent's view.
|
|
9
|
+
*/
|
|
10
|
+
const listCapabilitiesSchema = z.object({
|
|
11
|
+
includeOnDemand: z.boolean().default(true),
|
|
12
|
+
includeSilent: z.boolean().default(false),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Build the `list_capabilities` meta-tool.
|
|
16
|
+
*
|
|
17
|
+
* Returns one entry per loaded plugin, with a `loaded` flag that combines
|
|
18
|
+
* the boot-time always-on plugins (`visibility === 'always'`) with the set
|
|
19
|
+
* of plugins the agent has explicitly loaded for this thread (the
|
|
20
|
+
* `loadedPlugins` state field).
|
|
21
|
+
*/
|
|
22
|
+
export function buildListCapabilitiesTool(manifestRegistry) {
|
|
23
|
+
return tool(async (args, ctx) => {
|
|
24
|
+
const { includeOnDemand, includeSilent } = listCapabilitiesSchema.parse(args);
|
|
25
|
+
const loadedSet = ctx.loadedPlugins ?? new Set();
|
|
26
|
+
const out = [];
|
|
27
|
+
for (const { pluginName, manifest } of manifestRegistry.collect()) {
|
|
28
|
+
const visibility = manifest.visibility ?? 'on-demand';
|
|
29
|
+
if (visibility === 'silent' && !includeSilent)
|
|
30
|
+
continue;
|
|
31
|
+
if (visibility === 'on-demand' && !includeOnDemand)
|
|
32
|
+
continue;
|
|
33
|
+
out.push({
|
|
34
|
+
name: pluginName,
|
|
35
|
+
summary: manifest.summary,
|
|
36
|
+
visibility,
|
|
37
|
+
loaded: visibility === 'always' || loadedSet.has(pluginName),
|
|
38
|
+
category: manifest.category,
|
|
39
|
+
tags: manifest.tags ?? [],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (ctx.logger && typeof ctx.logger.debug === 'function') {
|
|
43
|
+
ctx.logger.debug(`[listCapabilities] includeOnDemand: ${includeOnDemand} | includeSilent: ${includeSilent} | loadedSet: ${Array.from(loadedSet).join(', ')} | results: ${out.length}`);
|
|
44
|
+
}
|
|
45
|
+
// Return a JSON string — LangChain's `tool()` mis-handles a raw array
|
|
46
|
+
// return (the `[content, artifact]` heuristic can drop the content),
|
|
47
|
+
// so the agent ends up with an empty ToolMessage. Explicit JSON keeps
|
|
48
|
+
// the contract unambiguous; tests parse the result.
|
|
49
|
+
return JSON.stringify(out);
|
|
50
|
+
}, {
|
|
51
|
+
name: 'list_capabilities',
|
|
52
|
+
description: 'List all available capabilities and their summaries.',
|
|
53
|
+
schema: listCapabilitiesSchema,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PluginTool } from '../plugin-api/types.js';
|
|
2
|
+
import type { ManifestRegistry } from '../registries/manifest-registry.js';
|
|
3
|
+
import type { ToolRegistry } from '../registries/tool-registry.js';
|
|
4
|
+
/**
|
|
5
|
+
* Build the `load_capability` meta-tool.
|
|
6
|
+
*
|
|
7
|
+
* Marks a plugin as loaded for the current thread AND returns its full
|
|
8
|
+
* manifest (whenToUse, examples, …) plus a per-tool description + arg-shape
|
|
9
|
+
* summary. This is the single discovery+load entry point — the agent does
|
|
10
|
+
* not need a separate `list_capability_details` call.
|
|
11
|
+
*
|
|
12
|
+
* Behavior:
|
|
13
|
+
* - Unknown plugin → throws, instructing the agent to call
|
|
14
|
+
* `list_capabilities` first.
|
|
15
|
+
* - `silent` plugin → throws (silent plugins are not agent-loadable).
|
|
16
|
+
* - Plugin already loaded, or visibility is `always` → returns
|
|
17
|
+
* `LoadCapabilityResult` directly (no state change).
|
|
18
|
+
* - Otherwise → returns a LangGraph `Command` whose update both appends the
|
|
19
|
+
* plugin to `loadedPlugins` AND emits a matching `ToolMessage` carrying
|
|
20
|
+
* the JSON-encoded `LoadCapabilityResult` so the agent sees the manifest
|
|
21
|
+
* in conversation history on the same turn.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildLoadCapabilityTool(manifestRegistry: ManifestRegistry, toolRegistry: ToolRegistry): PluginTool;
|
|
24
|
+
//# sourceMappingURL=load-capability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-capability.d.ts","sourceRoot":"","sources":["../../src/meta-tools/load-capability.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AA0BnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,GACzB,UAAU,CAmEZ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Command } from '@langchain/langgraph';
|
|
3
|
+
import { ToolMessage } from '@langchain/core/messages';
|
|
4
|
+
import { tool } from '../plugin-api/tool-helper.js';
|
|
5
|
+
/**
|
|
6
|
+
* Schema accepted by `load_capability`. The agent supplies the plugin name
|
|
7
|
+
* returned by `list_capabilities`.
|
|
8
|
+
*/
|
|
9
|
+
const loadCapabilitySchema = z.object({
|
|
10
|
+
name: z.string(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Build the `load_capability` meta-tool.
|
|
14
|
+
*
|
|
15
|
+
* Marks a plugin as loaded for the current thread AND returns its full
|
|
16
|
+
* manifest (whenToUse, examples, …) plus a per-tool description + arg-shape
|
|
17
|
+
* summary. This is the single discovery+load entry point — the agent does
|
|
18
|
+
* not need a separate `list_capability_details` call.
|
|
19
|
+
*
|
|
20
|
+
* Behavior:
|
|
21
|
+
* - Unknown plugin → throws, instructing the agent to call
|
|
22
|
+
* `list_capabilities` first.
|
|
23
|
+
* - `silent` plugin → throws (silent plugins are not agent-loadable).
|
|
24
|
+
* - Plugin already loaded, or visibility is `always` → returns
|
|
25
|
+
* `LoadCapabilityResult` directly (no state change).
|
|
26
|
+
* - Otherwise → returns a LangGraph `Command` whose update both appends the
|
|
27
|
+
* plugin to `loadedPlugins` AND emits a matching `ToolMessage` carrying
|
|
28
|
+
* the JSON-encoded `LoadCapabilityResult` so the agent sees the manifest
|
|
29
|
+
* in conversation history on the same turn.
|
|
30
|
+
*/
|
|
31
|
+
export function buildLoadCapabilityTool(manifestRegistry, toolRegistry) {
|
|
32
|
+
return tool(async (args, ctx) => {
|
|
33
|
+
const { name } = loadCapabilitySchema.parse(args);
|
|
34
|
+
const entry = manifestRegistry
|
|
35
|
+
.collect()
|
|
36
|
+
.find((m) => m.pluginName === name);
|
|
37
|
+
if (!entry) {
|
|
38
|
+
throw new Error(`Capability "${name}" does not exist. Call list_capabilities first to discover available plugins.`);
|
|
39
|
+
}
|
|
40
|
+
if (entry.manifest.visibility === 'silent') {
|
|
41
|
+
throw new Error(`Capability "${name}" is internal and cannot be loaded by the agent. Call list_capabilities first to discover loadable plugins.`);
|
|
42
|
+
}
|
|
43
|
+
const tools = toolRegistry
|
|
44
|
+
.toolsForPlugin(name)
|
|
45
|
+
.map((t) => ({
|
|
46
|
+
name: t.name,
|
|
47
|
+
description: t.description,
|
|
48
|
+
}));
|
|
49
|
+
const alreadyLoaded = ctx.loadedPlugins?.has(name) === true;
|
|
50
|
+
const alwaysVisible = entry.manifest.visibility === 'always';
|
|
51
|
+
const alreadyAvailable = alreadyLoaded || alwaysVisible;
|
|
52
|
+
const detail = {
|
|
53
|
+
...entry.manifest,
|
|
54
|
+
alreadyAvailable,
|
|
55
|
+
tools,
|
|
56
|
+
};
|
|
57
|
+
if (alreadyAvailable) {
|
|
58
|
+
return detail;
|
|
59
|
+
}
|
|
60
|
+
// New load — update state AND emit a ToolMessage so the agent sees the
|
|
61
|
+
// manifest on the same turn. Without a matching tool_call_id LangChain
|
|
62
|
+
// can't satisfy the model's tool-result expectation, so when we don't
|
|
63
|
+
// have one (direct/test invocation) we skip the message and rely on the
|
|
64
|
+
// caller to read state.
|
|
65
|
+
const update = {
|
|
66
|
+
loadedPlugins: [name],
|
|
67
|
+
};
|
|
68
|
+
if (ctx.toolCallId) {
|
|
69
|
+
update.messages = [
|
|
70
|
+
new ToolMessage({
|
|
71
|
+
content: JSON.stringify(detail),
|
|
72
|
+
tool_call_id: ctx.toolCallId,
|
|
73
|
+
}),
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
return new Command({ update });
|
|
77
|
+
}, {
|
|
78
|
+
name: 'load_capability',
|
|
79
|
+
description: "Load a capability for the rest of this conversation. The response is the plugin's full manifest plus a tool list — after this call, the capability's tools are usable on the next model step.",
|
|
80
|
+
schema: loadCapabilitySchema,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Cache } from '@nestjs/cache-manager';
|
|
2
|
+
import { type NestMiddleware } from '@nestjs/common';
|
|
3
|
+
import { ConfigService } from '@nestjs/config';
|
|
4
|
+
import { type NextFunction, type Request, type Response } from 'express';
|
|
5
|
+
import { UcanService } from '../ucan/ucan.service.js';
|
|
6
|
+
declare global {
|
|
7
|
+
namespace Express {
|
|
8
|
+
interface Request {
|
|
9
|
+
authData: {
|
|
10
|
+
did: string;
|
|
11
|
+
ucanDelegation: {
|
|
12
|
+
/**
|
|
13
|
+
* Raw base64-encoded delegation header as sent by the client.
|
|
14
|
+
* Plugin code reads this from `runCtx.user.ucanDelegation.raw`
|
|
15
|
+
* to mint downstream service invocations.
|
|
16
|
+
*/
|
|
17
|
+
raw: string;
|
|
18
|
+
issuer: string;
|
|
19
|
+
audience: string;
|
|
20
|
+
capabilities: unknown[];
|
|
21
|
+
expiration?: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export declare class AuthHeaderMiddleware implements NestMiddleware {
|
|
28
|
+
private cacheManager;
|
|
29
|
+
private readonly configService;
|
|
30
|
+
private readonly ucanService;
|
|
31
|
+
private readonly logger;
|
|
32
|
+
constructor(cacheManager: Cache, configService: ConfigService, ucanService: UcanService);
|
|
33
|
+
private hashToken;
|
|
34
|
+
private validateUcanDelegation;
|
|
35
|
+
use(req: Request, _res: Response, next: NextFunction): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=auth-header.middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-header.middleware.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth-header.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAiB,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,OAAO,CAAC;QAChB,UAAU,OAAO;YACf,QAAQ,EAAE;gBACR,GAAG,EAAE,MAAM,CAAC;gBACZ,cAAc,EAAE;oBACd;;;;uBAIG;oBACH,GAAG,EAAE,MAAM,CAAC;oBACZ,MAAM,EAAE,MAAM,CAAC;oBACf,QAAQ,EAAE,MAAM,CAAC;oBACjB,YAAY,EAAE,OAAO,EAAE,CAAC;oBACxB,UAAU,CAAC,EAAE,MAAM,CAAC;iBACrB,CAAC;aACH,CAAC;SACH;KACF;CACF;AAcD,qBACa,oBAAqB,YAAW,cAAc;IAIhC,OAAO,CAAC,YAAY;IAC3C,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;gBAG/B,YAAY,EAAE,KAAK,EACjC,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW;IAG3C,OAAO,CAAC,SAAS;YAIH,sBAAsB;IAuC9B,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAuF3E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
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 AuthHeaderMiddleware_1;
|
|
14
|
+
import { Cache, CACHE_MANAGER } from '@nestjs/cache-manager';
|
|
15
|
+
import { HttpException, HttpStatus, Inject, Injectable, Logger, } from '@nestjs/common';
|
|
16
|
+
import { ConfigService } from '@nestjs/config';
|
|
17
|
+
import { minutes } from '@nestjs/throttler';
|
|
18
|
+
import * as crypto from 'node:crypto';
|
|
19
|
+
import { UcanService } from '../ucan/ucan.service.js';
|
|
20
|
+
import { validateUcanDelegation } from './validate-ucan-delegation.js';
|
|
21
|
+
const THREE_MINUTES = minutes(3);
|
|
22
|
+
let AuthHeaderMiddleware = AuthHeaderMiddleware_1 = class AuthHeaderMiddleware {
|
|
23
|
+
cacheManager;
|
|
24
|
+
configService;
|
|
25
|
+
ucanService;
|
|
26
|
+
logger = new Logger(AuthHeaderMiddleware_1.name);
|
|
27
|
+
constructor(cacheManager, configService, ucanService) {
|
|
28
|
+
this.cacheManager = cacheManager;
|
|
29
|
+
this.configService = configService;
|
|
30
|
+
this.ucanService = ucanService;
|
|
31
|
+
}
|
|
32
|
+
hashToken(token) {
|
|
33
|
+
return crypto.createHash('sha256').update(token, 'utf8').digest('hex');
|
|
34
|
+
}
|
|
35
|
+
async validateUcanDelegation(ucanHeader) {
|
|
36
|
+
const oracleDid = this.configService.get('ORACLE_DID');
|
|
37
|
+
if (!oracleDid) {
|
|
38
|
+
this.logger.warn('[UCAN] ORACLE_DID not configured, skipping delegation validation');
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const blocksyncUri = this.configService.getOrThrow('BLOCKSYNC_GRAPHQL_URL');
|
|
42
|
+
const outcome = await validateUcanDelegation(ucanHeader, {
|
|
43
|
+
oracleDid,
|
|
44
|
+
blocksyncUri,
|
|
45
|
+
});
|
|
46
|
+
if (!outcome.ok) {
|
|
47
|
+
this.logger.warn(`[UCAN] Delegation validation failed: ${outcome.error}`);
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
const { delegation } = outcome.result;
|
|
51
|
+
this.logger.log(`[UCAN] Delegation validated: iss=${outcome.result.userDid} aud=${oracleDid} exp=${delegation.expiration ? new Date(delegation.expiration * 1000).toISOString() : 'none'}`);
|
|
52
|
+
return outcome.result;
|
|
53
|
+
}
|
|
54
|
+
async use(req, _res, next) {
|
|
55
|
+
this.logger.debug(`AuthHeaderMiddleware processing request for: ${req.originalUrl}`);
|
|
56
|
+
try {
|
|
57
|
+
const ucanHeader = req.headers['x-ucan-delegation'];
|
|
58
|
+
if (!ucanHeader) {
|
|
59
|
+
throw new HttpException('Missing x-ucan-delegation header', HttpStatus.UNAUTHORIZED);
|
|
60
|
+
}
|
|
61
|
+
const ucanHash = this.hashToken(ucanHeader);
|
|
62
|
+
const cachedUcan = await this.cacheManager.get(`ucan_auth_${ucanHash}`);
|
|
63
|
+
if (cachedUcan) {
|
|
64
|
+
req.authData = {
|
|
65
|
+
did: cachedUcan.userDid,
|
|
66
|
+
ucanDelegation: { ...cachedUcan.delegation, raw: ucanHeader },
|
|
67
|
+
};
|
|
68
|
+
// Re-cache raw delegation for downstream invocations
|
|
69
|
+
await this.ucanService.cacheDelegation(cachedUcan.userDid, ucanHeader, cachedUcan.delegation.expiration);
|
|
70
|
+
this.logger.debug(`[UCAN] Auth from cache for DID: ${cachedUcan.userDid}`);
|
|
71
|
+
next();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const ucanResult = await this.validateUcanDelegation(ucanHeader);
|
|
75
|
+
if (!ucanResult) {
|
|
76
|
+
throw new HttpException('Invalid UCAN delegation', HttpStatus.UNAUTHORIZED);
|
|
77
|
+
}
|
|
78
|
+
req.authData = {
|
|
79
|
+
did: ucanResult.userDid,
|
|
80
|
+
ucanDelegation: { ...ucanResult.delegation, raw: ucanHeader },
|
|
81
|
+
};
|
|
82
|
+
// Cache auth result
|
|
83
|
+
const ttl = ucanResult.delegation.expiration
|
|
84
|
+
? Math.max(0, ucanResult.delegation.expiration * 1000 - Date.now())
|
|
85
|
+
: THREE_MINUTES;
|
|
86
|
+
await this.cacheManager.set(`ucan_auth_${ucanHash}`, {
|
|
87
|
+
userDid: ucanResult.userDid,
|
|
88
|
+
delegation: ucanResult.delegation,
|
|
89
|
+
}, ttl);
|
|
90
|
+
// Cache raw delegation for downstream service invocations
|
|
91
|
+
await this.ucanService.cacheDelegation(ucanResult.userDid, ucanHeader, ucanResult.delegation.expiration);
|
|
92
|
+
this.logger.debug(`[UCAN] Auth completed for DID: ${ucanResult.userDid}`);
|
|
93
|
+
next();
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
if (error instanceof HttpException) {
|
|
97
|
+
next(error);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
101
|
+
const errorStack = error instanceof Error ? error.stack : undefined;
|
|
102
|
+
this.logger.error(`Auth header validation failed: ${message}`, errorStack);
|
|
103
|
+
next(new HttpException(message, HttpStatus.UNAUTHORIZED));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
AuthHeaderMiddleware = AuthHeaderMiddleware_1 = __decorate([
|
|
109
|
+
Injectable(),
|
|
110
|
+
__param(0, Inject(CACHE_MANAGER)),
|
|
111
|
+
__metadata("design:paramtypes", [Cache,
|
|
112
|
+
ConfigService,
|
|
113
|
+
UcanService])
|
|
114
|
+
], AuthHeaderMiddleware);
|
|
115
|
+
export { AuthHeaderMiddleware };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Auth module wrapping the UCAN-based auth-header middleware.
|
|
3
|
+
*
|
|
4
|
+
* Provides AuthHeaderMiddleware as a NestJS provider so that
|
|
5
|
+
* RuntimeAppModule can wire it via `MiddlewareConsumer.apply()`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AuthModule {
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=auth.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,qBAKa,UAAU;CAAG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Auth module wrapping the UCAN-based auth-header middleware.
|
|
3
|
+
*
|
|
4
|
+
* Provides AuthHeaderMiddleware as a NestJS provider so that
|
|
5
|
+
* RuntimeAppModule can wire it via `MiddlewareConsumer.apply()`.
|
|
6
|
+
*/
|
|
7
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
8
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
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;
|
|
11
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12
|
+
};
|
|
13
|
+
import { Module } from '@nestjs/common';
|
|
14
|
+
import { CacheModule } from '@nestjs/cache-manager';
|
|
15
|
+
import { ConfigModule } from '@nestjs/config';
|
|
16
|
+
import { UcanModule } from '../ucan/ucan.module.js';
|
|
17
|
+
import { AuthHeaderMiddleware } from './auth-header.middleware.js';
|
|
18
|
+
let AuthModule = class AuthModule {
|
|
19
|
+
};
|
|
20
|
+
AuthModule = __decorate([
|
|
21
|
+
Module({
|
|
22
|
+
imports: [ConfigModule, CacheModule.register(), UcanModule],
|
|
23
|
+
providers: [AuthHeaderMiddleware],
|
|
24
|
+
exports: [AuthHeaderMiddleware],
|
|
25
|
+
})
|
|
26
|
+
], AuthModule);
|
|
27
|
+
export { AuthModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** The validated identity + delegation metadata extracted from a UCAN header. */
|
|
2
|
+
export interface ValidatedUcanDelegation {
|
|
3
|
+
userDid: string;
|
|
4
|
+
delegation: {
|
|
5
|
+
issuer: string;
|
|
6
|
+
audience: string;
|
|
7
|
+
capabilities: unknown[];
|
|
8
|
+
expiration?: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ValidateUcanDelegationOptions {
|
|
12
|
+
/** The oracle's DID — used as the expected delegation audience (serverDid). */
|
|
13
|
+
oracleDid: string;
|
|
14
|
+
/** Blocksync GraphQL endpoint used to resolve `did:ixo` verification keys. */
|
|
15
|
+
blocksyncUri: string;
|
|
16
|
+
}
|
|
17
|
+
export type ValidateUcanDelegationOutcome = {
|
|
18
|
+
ok: true;
|
|
19
|
+
result: ValidatedUcanDelegation;
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
22
|
+
error: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Validate a raw UCAN delegation header against this oracle. Shared by the
|
|
26
|
+
* HTTP `AuthHeaderMiddleware` and the WebSocket gateway so both transports
|
|
27
|
+
* authenticate identically — the returned `userDid` is the validated invoker,
|
|
28
|
+
* never a value the client claimed for itself.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateUcanDelegation(ucanHeader: string, opts: ValidateUcanDelegationOptions): Promise<ValidateUcanDelegationOutcome>;
|
|
31
|
+
//# sourceMappingURL=validate-ucan-delegation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-ucan-delegation.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/validate-ucan-delegation.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,OAAO,EAAE,CAAC;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED,MAAM,WAAW,6BAA6B;IAC5C,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,6BAA6B,GACrC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAA;CAAE,GAC7C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjC;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,6BAA6B,CAAC,CAgCxC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createIxoDIDResolver, createUCANValidator } from '@ixo/ucan';
|
|
2
|
+
/**
|
|
3
|
+
* Validate a raw UCAN delegation header against this oracle. Shared by the
|
|
4
|
+
* HTTP `AuthHeaderMiddleware` and the WebSocket gateway so both transports
|
|
5
|
+
* authenticate identically — the returned `userDid` is the validated invoker,
|
|
6
|
+
* never a value the client claimed for itself.
|
|
7
|
+
*/
|
|
8
|
+
export async function validateUcanDelegation(ucanHeader, opts) {
|
|
9
|
+
const validator = await createUCANValidator({
|
|
10
|
+
serverDid: opts.oracleDid,
|
|
11
|
+
rootIssuers: [],
|
|
12
|
+
didResolver: createIxoDIDResolver({ indexerUrl: opts.blocksyncUri }),
|
|
13
|
+
});
|
|
14
|
+
const result = await validator.validateDelegation(ucanHeader);
|
|
15
|
+
if (!result.ok) {
|
|
16
|
+
return {
|
|
17
|
+
ok: false,
|
|
18
|
+
error: `[${result.error?.code}] ${result.error?.message}`,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (!result.invoker) {
|
|
22
|
+
return { ok: false, error: 'Delegation validated without an invoker DID' };
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
ok: true,
|
|
26
|
+
result: {
|
|
27
|
+
userDid: result.invoker,
|
|
28
|
+
delegation: {
|
|
29
|
+
issuer: result.invoker,
|
|
30
|
+
audience: opts.oracleDid,
|
|
31
|
+
capabilities: result.capability ? [result.capability] : [],
|
|
32
|
+
expiration: result.expiration,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global module exposing BlobStoreService.
|
|
3
|
+
*
|
|
4
|
+
* The service uses the runtime-wide CacheModule (already registered globally
|
|
5
|
+
* in RuntimeAppModule), so this module just declares the service as a global
|
|
6
|
+
* provider — no extra imports needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BlobStoreModule {
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=blob-store.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blob-store.module.d.ts","sourceRoot":"","sources":["../../../src/modules/blob-store/blob-store.module.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,qBAKa,eAAe;CAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { BlobStoreService } from './blob-store.service.js';
|
|
9
|
+
/**
|
|
10
|
+
* Global module exposing BlobStoreService.
|
|
11
|
+
*
|
|
12
|
+
* The service uses the runtime-wide CacheModule (already registered globally
|
|
13
|
+
* in RuntimeAppModule), so this module just declares the service as a global
|
|
14
|
+
* provider — no extra imports needed.
|
|
15
|
+
*/
|
|
16
|
+
let BlobStoreModule = class BlobStoreModule {
|
|
17
|
+
};
|
|
18
|
+
BlobStoreModule = __decorate([
|
|
19
|
+
Global(),
|
|
20
|
+
Module({
|
|
21
|
+
providers: [BlobStoreService],
|
|
22
|
+
exports: [BlobStoreService],
|
|
23
|
+
})
|
|
24
|
+
], BlobStoreModule);
|
|
25
|
+
export { BlobStoreModule };
|