@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,74 @@
|
|
|
1
|
+
import type { OracleIdentity } from '../plugin-api/types.js';
|
|
2
|
+
import type { RegisteredConfigSchema, RegisteredManifest, RegisteredMiddleware, RegisteredSharedAccessor, RegisteredSubAgent, RegisteredTool } from '../registries/index.js';
|
|
3
|
+
import type { ResolvePluginsResult } from './plugin-loader.js';
|
|
4
|
+
/**
|
|
5
|
+
* Already-collected registry entries. The runtime calls each registry's
|
|
6
|
+
* `collect()` once at boot; `inspect()` consumes the cached lists rather
|
|
7
|
+
* than re-collecting (collection is async / context-bound).
|
|
8
|
+
*/
|
|
9
|
+
export interface CollectedRegistries {
|
|
10
|
+
tools: RegisteredTool[];
|
|
11
|
+
subAgents: RegisteredSubAgent[];
|
|
12
|
+
middlewares: RegisteredMiddleware[];
|
|
13
|
+
manifests: RegisteredManifest[];
|
|
14
|
+
configSchemas: RegisteredConfigSchema[];
|
|
15
|
+
sharedState: RegisteredSharedAccessor[];
|
|
16
|
+
}
|
|
17
|
+
export interface InspectInput {
|
|
18
|
+
resolved: ResolvePluginsResult;
|
|
19
|
+
collected: CollectedRegistries;
|
|
20
|
+
identity: OracleIdentity;
|
|
21
|
+
runtimeVersion: string;
|
|
22
|
+
/**
|
|
23
|
+
* Names of plugins shipped from the runtime package itself. Anything in
|
|
24
|
+
* `resolved.loaded` not present here is reported as `source: 'user'`.
|
|
25
|
+
* When omitted, every loaded plugin is treated as `'bundled'`.
|
|
26
|
+
*/
|
|
27
|
+
bundledPluginNames?: ReadonlySet<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Optional collision/warning lines to surface (e.g. config-schema
|
|
30
|
+
* later-wins warnings). Forwarded verbatim under `warnings`.
|
|
31
|
+
*/
|
|
32
|
+
warnings?: string[];
|
|
33
|
+
}
|
|
34
|
+
export interface InspectPluginEntry {
|
|
35
|
+
name: string;
|
|
36
|
+
version: string;
|
|
37
|
+
source: 'bundled' | 'user';
|
|
38
|
+
dependsOn: string[];
|
|
39
|
+
softDependsOn: string[];
|
|
40
|
+
softDepsResolved: string[];
|
|
41
|
+
softDepsMissing: string[];
|
|
42
|
+
tools: {
|
|
43
|
+
name: string;
|
|
44
|
+
visibility?: string;
|
|
45
|
+
}[];
|
|
46
|
+
subAgents: {
|
|
47
|
+
name: string;
|
|
48
|
+
}[];
|
|
49
|
+
stateFields: string[];
|
|
50
|
+
configFields: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface InspectOutput {
|
|
53
|
+
schema: 'qiforge.boot.v1';
|
|
54
|
+
runtime: {
|
|
55
|
+
version: string;
|
|
56
|
+
node: string;
|
|
57
|
+
};
|
|
58
|
+
identity: OracleIdentity;
|
|
59
|
+
plugins: InspectPluginEntry[];
|
|
60
|
+
topo: string[];
|
|
61
|
+
excluded: {
|
|
62
|
+
plugin: string;
|
|
63
|
+
reason: string;
|
|
64
|
+
}[];
|
|
65
|
+
collisions: string[];
|
|
66
|
+
warnings: string[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the diagnostic JSON dump for `qiforge inspect` and the
|
|
70
|
+
* `/health/plugins` endpoint. Tier-1 prompt + token estimate are deferred
|
|
71
|
+
* to a later phase and intentionally omitted.
|
|
72
|
+
*/
|
|
73
|
+
export declare function inspect(input: InspectInput): InspectOutput;
|
|
74
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/bootstrap/inspect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,WAAW,EAAE,wBAAwB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,SAAS,EAAE,mBAAmB,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,aAAa,CAiD1D"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the diagnostic JSON dump for `qiforge inspect` and the
|
|
3
|
+
* `/health/plugins` endpoint. Tier-1 prompt + token estimate are deferred
|
|
4
|
+
* to a later phase and intentionally omitted.
|
|
5
|
+
*/
|
|
6
|
+
export function inspect(input) {
|
|
7
|
+
const { resolved, collected, identity, runtimeVersion, bundledPluginNames, warnings = [], } = input;
|
|
8
|
+
const finalNames = new Set(resolved.loaded.map((p) => p.name));
|
|
9
|
+
const toolsByPlugin = groupBy(collected.tools, (e) => e.pluginName);
|
|
10
|
+
const subAgentsByPlugin = groupBy(collected.subAgents, (e) => e.pluginName);
|
|
11
|
+
const stateByPlugin = groupBy(collected.sharedState, (e) => e.pluginName);
|
|
12
|
+
const configByPlugin = groupBy(collected.configSchemas.flatMap((entry) => Object.keys(entry.schema.shape).map((key) => ({
|
|
13
|
+
pluginName: entry.pluginName,
|
|
14
|
+
key,
|
|
15
|
+
}))), (e) => e.pluginName);
|
|
16
|
+
const plugins = resolved.loaded.map((plugin) => buildPluginEntry({
|
|
17
|
+
plugin,
|
|
18
|
+
finalNames,
|
|
19
|
+
bundledPluginNames,
|
|
20
|
+
tools: toolsByPlugin.get(plugin.name) ?? [],
|
|
21
|
+
subAgents: subAgentsByPlugin.get(plugin.name) ?? [],
|
|
22
|
+
stateEntries: stateByPlugin.get(plugin.name) ?? [],
|
|
23
|
+
configEntries: configByPlugin.get(plugin.name) ?? [],
|
|
24
|
+
}));
|
|
25
|
+
const collisions = detectCollisions(plugins);
|
|
26
|
+
return {
|
|
27
|
+
schema: 'qiforge.boot.v1',
|
|
28
|
+
runtime: { version: runtimeVersion, node: process.version },
|
|
29
|
+
identity,
|
|
30
|
+
plugins,
|
|
31
|
+
topo: resolved.loaded.map((p) => p.name),
|
|
32
|
+
excluded: resolved.excluded,
|
|
33
|
+
collisions,
|
|
34
|
+
warnings,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function buildPluginEntry(args) {
|
|
38
|
+
const { plugin, finalNames, bundledPluginNames, tools, subAgents, stateEntries, configEntries, } = args;
|
|
39
|
+
const softDependsOn = plugin.softDependsOn ?? [];
|
|
40
|
+
const softDepsResolved = softDependsOn.filter((d) => finalNames.has(d));
|
|
41
|
+
const softDepsMissing = softDependsOn.filter((d) => !finalNames.has(d));
|
|
42
|
+
const source = bundledPluginNames === undefined || bundledPluginNames.has(plugin.name)
|
|
43
|
+
? 'bundled'
|
|
44
|
+
: 'user';
|
|
45
|
+
return {
|
|
46
|
+
name: plugin.name,
|
|
47
|
+
version: plugin.version,
|
|
48
|
+
source,
|
|
49
|
+
dependsOn: [...(plugin.dependsOn ?? [])],
|
|
50
|
+
softDependsOn: [...softDependsOn],
|
|
51
|
+
softDepsResolved,
|
|
52
|
+
softDepsMissing,
|
|
53
|
+
tools: tools.map((t) => ({
|
|
54
|
+
name: t.tool.name,
|
|
55
|
+
visibility: t.tool.visibility,
|
|
56
|
+
})),
|
|
57
|
+
subAgents: subAgents.map((s) => ({ name: s.subAgent.name })),
|
|
58
|
+
stateFields: stateEntries.map((e) => e.key),
|
|
59
|
+
configFields: configEntries.map((e) => e.key),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function detectCollisions(plugins) {
|
|
63
|
+
const collisions = [];
|
|
64
|
+
const toolOwners = new Map();
|
|
65
|
+
const subAgentOwners = new Map();
|
|
66
|
+
const stateOwners = new Map();
|
|
67
|
+
for (const p of plugins) {
|
|
68
|
+
for (const t of p.tools) {
|
|
69
|
+
const prev = toolOwners.get(t.name);
|
|
70
|
+
if (prev !== undefined && prev !== p.name) {
|
|
71
|
+
collisions.push(`tool '${t.name}' registered by both '${prev}' and '${p.name}'`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
toolOwners.set(t.name, p.name);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const s of p.subAgents) {
|
|
78
|
+
const prev = subAgentOwners.get(s.name);
|
|
79
|
+
if (prev !== undefined && prev !== p.name) {
|
|
80
|
+
collisions.push(`sub-agent '${s.name}' registered by both '${prev}' and '${p.name}'`);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
subAgentOwners.set(s.name, p.name);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const f of p.stateFields) {
|
|
87
|
+
const prev = stateOwners.get(f);
|
|
88
|
+
if (prev !== undefined && prev !== p.name) {
|
|
89
|
+
collisions.push(`shared-state key '${f}' registered by both '${prev}' and '${p.name}'`);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
stateOwners.set(f, p.name);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return collisions;
|
|
97
|
+
}
|
|
98
|
+
function groupBy(items, key) {
|
|
99
|
+
const out = new Map();
|
|
100
|
+
for (const item of items) {
|
|
101
|
+
const k = key(item);
|
|
102
|
+
const bucket = out.get(k);
|
|
103
|
+
if (bucket) {
|
|
104
|
+
bucket.push(item);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
out.set(k, [item]);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return out;
|
|
111
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { OraclePlugin } from '../plugin-api/oracle-plugin.js';
|
|
2
|
+
import type { Logger } from '../plugin-api/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Per-feature toggle:
|
|
5
|
+
* - `true` — explicit opt-in. If the plugin has an `autoDetect` and it
|
|
6
|
+
* fails, boot fails.
|
|
7
|
+
* - `false` — explicit opt-out.
|
|
8
|
+
* - `'auto'` — include only if the plugin's `autoDetect` returns true (or
|
|
9
|
+
* the plugin has no `autoDetect`, in which case it loads).
|
|
10
|
+
*/
|
|
11
|
+
export type FeatureToggle = boolean | 'auto';
|
|
12
|
+
export type ExclusionCause = 'feature_false' | 'auto_detect_missing' | 'cascaded';
|
|
13
|
+
export interface ExcludedPlugin {
|
|
14
|
+
plugin: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
cause: ExclusionCause;
|
|
17
|
+
}
|
|
18
|
+
export interface SoftDepGap {
|
|
19
|
+
plugin: string;
|
|
20
|
+
missing: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ResolvePluginsInput {
|
|
23
|
+
features?: Partial<Record<string, FeatureToggle>>;
|
|
24
|
+
bundled: OraclePlugin[];
|
|
25
|
+
userPlugins?: OraclePlugin[];
|
|
26
|
+
env?: NodeJS.ProcessEnv;
|
|
27
|
+
logger?: Logger;
|
|
28
|
+
}
|
|
29
|
+
export interface ResolvePluginsResult {
|
|
30
|
+
loaded: OraclePlugin[];
|
|
31
|
+
excluded: ExcludedPlugin[];
|
|
32
|
+
softDepGaps: SoftDepGap[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the final plugin list for boot.
|
|
36
|
+
*
|
|
37
|
+
* 1. Apply feature toggles + each plugin's `autoDetect` to the bundled list.
|
|
38
|
+
* 2. Combine with always-loaded user plugins.
|
|
39
|
+
* 3. Cascade hard-dep removals (transitive — fixed-point).
|
|
40
|
+
* 4. Topologically sort by `dependsOn`.
|
|
41
|
+
* 5. Log soft-dep gaps.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolvePlugins(input: ResolvePluginsInput): ResolvePluginsResult;
|
|
44
|
+
/**
|
|
45
|
+
* Topologically sort plugins by `dependsOn`. Throws on unmet hard deps
|
|
46
|
+
* (`boot.plugin.dep_missing`) or cycles (`boot.plugin.cycle`, with the
|
|
47
|
+
* cycle path included in the message).
|
|
48
|
+
*/
|
|
49
|
+
export declare function topoSort(plugins: OraclePlugin[]): OraclePlugin[];
|
|
50
|
+
//# sourceMappingURL=plugin-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-loader.d.ts","sourceRoot":"","sources":["../../src/bootstrap/plugin-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7C,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,qBAAqB,GACrB,UAAU,CAAC;AAEf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,cAAc,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IAClD,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAQD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,mBAAmB,GACzB,oBAAoB,CAqFtB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAsChE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
const NOOP_LOGGER = {
|
|
2
|
+
log: () => undefined,
|
|
3
|
+
warn: () => undefined,
|
|
4
|
+
error: () => undefined,
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the final plugin list for boot.
|
|
8
|
+
*
|
|
9
|
+
* 1. Apply feature toggles + each plugin's `autoDetect` to the bundled list.
|
|
10
|
+
* 2. Combine with always-loaded user plugins.
|
|
11
|
+
* 3. Cascade hard-dep removals (transitive — fixed-point).
|
|
12
|
+
* 4. Topologically sort by `dependsOn`.
|
|
13
|
+
* 5. Log soft-dep gaps.
|
|
14
|
+
*/
|
|
15
|
+
export function resolvePlugins(input) {
|
|
16
|
+
const env = input.env ?? process.env;
|
|
17
|
+
const logger = input.logger ?? NOOP_LOGGER;
|
|
18
|
+
const features = input.features ?? {};
|
|
19
|
+
const excluded = [];
|
|
20
|
+
const survivors = [];
|
|
21
|
+
for (const plugin of input.bundled) {
|
|
22
|
+
const toggle = features[plugin.name];
|
|
23
|
+
if (toggle === false) {
|
|
24
|
+
excluded.push({
|
|
25
|
+
plugin: plugin.name,
|
|
26
|
+
reason: 'feature flag set to false',
|
|
27
|
+
cause: 'feature_false',
|
|
28
|
+
});
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const detectOk = plugin.autoDetect ? plugin.autoDetect(env) : true;
|
|
32
|
+
const hint = plugin.autoDetectHint ?? 'auto-detect predicate';
|
|
33
|
+
if (toggle === true && !detectOk) {
|
|
34
|
+
throw new Error(`boot.plugin.env_missing: plugin '${plugin.name}' enabled via features but precondition failed (${hint}). ` +
|
|
35
|
+
`Set the required env or disable: features: { ${plugin.name}: false }`);
|
|
36
|
+
}
|
|
37
|
+
if (!detectOk) {
|
|
38
|
+
excluded.push({
|
|
39
|
+
plugin: plugin.name,
|
|
40
|
+
reason: `auto-detect precondition not met (${hint})`,
|
|
41
|
+
cause: 'auto_detect_missing',
|
|
42
|
+
});
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
survivors.push(plugin);
|
|
46
|
+
}
|
|
47
|
+
const allLoaded = [...survivors, ...(input.userPlugins ?? [])];
|
|
48
|
+
// Transitive cascade — fixed-point. A plugin cascades off if any of its
|
|
49
|
+
// hard deps is excluded for any reason (explicit false, auto-detect, or
|
|
50
|
+
// a previous cascade).
|
|
51
|
+
const kept = new Map(allLoaded.map((p) => [p.name, p]));
|
|
52
|
+
const excludedNames = new Set(excluded.map((e) => e.plugin));
|
|
53
|
+
let changed = true;
|
|
54
|
+
while (changed) {
|
|
55
|
+
changed = false;
|
|
56
|
+
for (const plugin of [...kept.values()]) {
|
|
57
|
+
for (const dep of plugin.dependsOn ?? []) {
|
|
58
|
+
if (kept.has(dep))
|
|
59
|
+
continue;
|
|
60
|
+
if (!excludedNames.has(dep))
|
|
61
|
+
continue;
|
|
62
|
+
const reason = `cascaded off via ${dep}`;
|
|
63
|
+
excluded.push({ plugin: plugin.name, reason, cause: 'cascaded' });
|
|
64
|
+
excludedNames.add(plugin.name);
|
|
65
|
+
kept.delete(plugin.name);
|
|
66
|
+
logger.warn(`[boot] plugin '${plugin.name}' ${reason} (event: boot.plugin.cascaded_off)`);
|
|
67
|
+
changed = true;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const ordered = topoSort([...kept.values()]);
|
|
73
|
+
const finalNames = new Set(ordered.map((p) => p.name));
|
|
74
|
+
const softDepGaps = [];
|
|
75
|
+
for (const plugin of ordered) {
|
|
76
|
+
for (const soft of plugin.softDependsOn ?? []) {
|
|
77
|
+
if (finalNames.has(soft))
|
|
78
|
+
continue;
|
|
79
|
+
softDepGaps.push({ plugin: plugin.name, missing: soft });
|
|
80
|
+
logger.log(`[boot] plugin '${plugin.name}' soft-depends on '${soft}', which is not loaded (event: boot.plugin.soft_dep_missing)`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { loaded: ordered, excluded, softDepGaps };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Topologically sort plugins by `dependsOn`. Throws on unmet hard deps
|
|
87
|
+
* (`boot.plugin.dep_missing`) or cycles (`boot.plugin.cycle`, with the
|
|
88
|
+
* cycle path included in the message).
|
|
89
|
+
*/
|
|
90
|
+
export function topoSort(plugins) {
|
|
91
|
+
const byName = new Map(plugins.map((p) => [p.name, p]));
|
|
92
|
+
const visited = new Set();
|
|
93
|
+
const visiting = new Set();
|
|
94
|
+
const ordered = [];
|
|
95
|
+
const visit = (name, requiredBy, path) => {
|
|
96
|
+
if (visited.has(name))
|
|
97
|
+
return;
|
|
98
|
+
if (visiting.has(name)) {
|
|
99
|
+
const cycle = [...path.slice(path.indexOf(name)), name].join(' -> ');
|
|
100
|
+
throw new Error(`boot.plugin.cycle: dependency cycle detected: ${cycle}. ` +
|
|
101
|
+
`Break the cycle by removing one of the dependsOn links.`);
|
|
102
|
+
}
|
|
103
|
+
const plugin = byName.get(name);
|
|
104
|
+
if (!plugin) {
|
|
105
|
+
throw new Error(`boot.plugin.dep_missing: plugin '${requiredBy}' requires '${name}', which is not loaded. ` +
|
|
106
|
+
`Add '${name}' to features, or remove '${requiredBy}'.`);
|
|
107
|
+
}
|
|
108
|
+
visiting.add(name);
|
|
109
|
+
for (const dep of plugin.dependsOn ?? []) {
|
|
110
|
+
visit(dep, name, [...path, name]);
|
|
111
|
+
}
|
|
112
|
+
visiting.delete(name);
|
|
113
|
+
visited.add(name);
|
|
114
|
+
ordered.push(plugin);
|
|
115
|
+
};
|
|
116
|
+
for (const p of plugins)
|
|
117
|
+
visit(p.name, null, []);
|
|
118
|
+
return ordered;
|
|
119
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type DynamicModule, type MiddlewareConsumer, type NestModule, type Type } from '@nestjs/common';
|
|
2
|
+
import type { AuthExcludedRoute } from '../plugin-api/types.js';
|
|
3
|
+
export interface RuntimeAppModuleOptions {
|
|
4
|
+
/** Pre-validated env values, fed straight into `ConfigModule`. */
|
|
5
|
+
validatedEnv: Record<string, unknown>;
|
|
6
|
+
/** Additional modules supplied by the fork at `createOracleApp`. */
|
|
7
|
+
userNestModules?: Array<Type | DynamicModule>;
|
|
8
|
+
/** Plugin-shipped NestJS modules collected from bundled plugins. */
|
|
9
|
+
pluginNestModules?: Array<Type | DynamicModule>;
|
|
10
|
+
/**
|
|
11
|
+
* Plugin-declared routes that must be excluded from `AuthHeaderMiddleware`.
|
|
12
|
+
* Aggregated from each loaded plugin's `getAuthExcludedRoutes()` and
|
|
13
|
+
* concatenated onto the runtime's own exclusion list (`/`, `/health`,
|
|
14
|
+
* `/docs`, `/docs/(.*)`).
|
|
15
|
+
*/
|
|
16
|
+
pluginAuthExclusions?: AuthExcludedRoute[];
|
|
17
|
+
/**
|
|
18
|
+
* Whether to wire `SubscriptionMiddleware` ahead of the routes. The credits
|
|
19
|
+
* plugin owns that decision — when credits is disabled, only auth runs.
|
|
20
|
+
*/
|
|
21
|
+
enableSubscriptionMiddleware: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The runtime's root NestJS module. Built dynamically per oracle so the
|
|
25
|
+
* fork-supplied `nestModules` and plugin-shipped modules can be folded
|
|
26
|
+
* into a single import list alongside the Tier-0 modules.
|
|
27
|
+
*
|
|
28
|
+
* `ConfigModule` is registered globally with the merged schema's parsed
|
|
29
|
+
* output — the schema itself ran in the boot composer so any failure
|
|
30
|
+
* already surfaced before this module loads.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RuntimeAppModule implements NestModule {
|
|
33
|
+
private static enableSubscription;
|
|
34
|
+
private static authExcludedRoutes;
|
|
35
|
+
static register(opts: RuntimeAppModuleOptions): DynamicModule;
|
|
36
|
+
configure(consumer: MiddlewareConsumer): void;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=runtime-app-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-app-module.d.ts","sourceRoot":"","sources":["../../src/bootstrap/runtime-app-module.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAEf,KAAK,IAAI,EACV,MAAM,gBAAgB,CAAC;AAKxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAahE,MAAM,WAAW,uBAAuB;IACtC,kEAAkE;IAClE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,oEAAoE;IACpE,eAAe,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC,CAAC;IAC9C,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC,CAAC;IAChD;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC3C;;;OAGG;IACH,4BAA4B,EAAE,OAAO,CAAC;CACvC;AAyBD;;;;;;;;GAQG;AACH,qBACa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAS;IAE1C,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAG0B;IAE3D,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,aAAa;IA4C7D,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;CAc9C"}
|
|
@@ -0,0 +1,114 @@
|
|
|
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 RuntimeAppModule_1;
|
|
8
|
+
import { CacheModule } from '@nestjs/cache-manager';
|
|
9
|
+
import { Module, RequestMethod, } from '@nestjs/common';
|
|
10
|
+
import { ConfigModule } from '@nestjs/config';
|
|
11
|
+
import { APP_GUARD } from '@nestjs/core';
|
|
12
|
+
import { ScheduleModule } from '@nestjs/schedule';
|
|
13
|
+
import { ThrottlerGuard } from '@nestjs/throttler';
|
|
14
|
+
import { AuthHeaderMiddleware } from '../modules/auth/auth-header.middleware.js';
|
|
15
|
+
import { AuthModule } from '../modules/auth/auth.module.js';
|
|
16
|
+
import { BlobStoreModule } from '../modules/blob-store/blob-store.module.js';
|
|
17
|
+
import { HealthModule } from '../modules/health/health.module.js';
|
|
18
|
+
import { MessagesModule } from '../modules/messages/messages.module.js';
|
|
19
|
+
import { SessionsModule } from '../modules/sessions/sessions.module.js';
|
|
20
|
+
import { SubscriptionMiddleware } from '../modules/subscription/subscription.middleware.js';
|
|
21
|
+
import { SubscriptionModule } from '../modules/subscription/subscription.module.js';
|
|
22
|
+
import { ThrottlerModule } from '../modules/throttler/throttler.module.js';
|
|
23
|
+
import { UcanModule } from '../modules/ucan/ucan.module.js';
|
|
24
|
+
import { WsModule } from '../modules/ws/ws.module.js';
|
|
25
|
+
const AUTH_EXCLUDED_ROUTES = [
|
|
26
|
+
{ path: '/', method: RequestMethod.ALL },
|
|
27
|
+
{ path: '/health', method: RequestMethod.ALL },
|
|
28
|
+
{ path: '/docs', method: RequestMethod.ALL },
|
|
29
|
+
{ path: '/docs/(.*)', method: RequestMethod.ALL },
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Normalize a plugin-declared route into the shape NestJS's
|
|
33
|
+
* `MiddlewareConsumer.exclude(...)` expects:
|
|
34
|
+
* - default `method` to `RequestMethod.ALL`
|
|
35
|
+
* - leave the leading-slash decision to the plugin author — Nest matches both
|
|
36
|
+
*/
|
|
37
|
+
function normalizeAuthExclusion(route) {
|
|
38
|
+
return {
|
|
39
|
+
path: route.path,
|
|
40
|
+
method: route.method ?? RequestMethod.ALL,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The runtime's root NestJS module. Built dynamically per oracle so the
|
|
45
|
+
* fork-supplied `nestModules` and plugin-shipped modules can be folded
|
|
46
|
+
* into a single import list alongside the Tier-0 modules.
|
|
47
|
+
*
|
|
48
|
+
* `ConfigModule` is registered globally with the merged schema's parsed
|
|
49
|
+
* output — the schema itself ran in the boot composer so any failure
|
|
50
|
+
* already surfaced before this module loads.
|
|
51
|
+
*/
|
|
52
|
+
let RuntimeAppModule = class RuntimeAppModule {
|
|
53
|
+
static { RuntimeAppModule_1 = this; }
|
|
54
|
+
static enableSubscription = false;
|
|
55
|
+
static authExcludedRoutes = [...AUTH_EXCLUDED_ROUTES.map(normalizeAuthExclusion)];
|
|
56
|
+
static register(opts) {
|
|
57
|
+
RuntimeAppModule_1.enableSubscription = opts.enableSubscriptionMiddleware;
|
|
58
|
+
const mergedExclusions = [
|
|
59
|
+
...AUTH_EXCLUDED_ROUTES,
|
|
60
|
+
...(opts.pluginAuthExclusions ?? []),
|
|
61
|
+
].map(normalizeAuthExclusion);
|
|
62
|
+
RuntimeAppModule_1.authExcludedRoutes = mergedExclusions;
|
|
63
|
+
const validatedEnv = opts.validatedEnv;
|
|
64
|
+
const imports = [
|
|
65
|
+
ConfigModule.forRoot({
|
|
66
|
+
isGlobal: true,
|
|
67
|
+
ignoreEnvFile: true,
|
|
68
|
+
load: [() => validatedEnv],
|
|
69
|
+
}),
|
|
70
|
+
CacheModule.register({ isGlobal: true }),
|
|
71
|
+
ScheduleModule.forRoot(),
|
|
72
|
+
ThrottlerModule,
|
|
73
|
+
UcanModule,
|
|
74
|
+
BlobStoreModule,
|
|
75
|
+
AuthModule,
|
|
76
|
+
SubscriptionModule,
|
|
77
|
+
SessionsModule,
|
|
78
|
+
MessagesModule,
|
|
79
|
+
WsModule,
|
|
80
|
+
HealthModule,
|
|
81
|
+
...(opts.pluginNestModules ?? []),
|
|
82
|
+
...(opts.userNestModules ?? []),
|
|
83
|
+
];
|
|
84
|
+
return {
|
|
85
|
+
module: RuntimeAppModule_1,
|
|
86
|
+
imports,
|
|
87
|
+
providers: [
|
|
88
|
+
{
|
|
89
|
+
provide: APP_GUARD,
|
|
90
|
+
useClass: ThrottlerGuard,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
configure(consumer) {
|
|
96
|
+
const excluded = RuntimeAppModule_1.authExcludedRoutes;
|
|
97
|
+
if (RuntimeAppModule_1.enableSubscription) {
|
|
98
|
+
consumer
|
|
99
|
+
.apply(AuthHeaderMiddleware, SubscriptionMiddleware)
|
|
100
|
+
.exclude(...excluded)
|
|
101
|
+
.forRoutes('*');
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
consumer
|
|
105
|
+
.apply(AuthHeaderMiddleware)
|
|
106
|
+
.exclude(...excluded)
|
|
107
|
+
.forRoutes('*');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
RuntimeAppModule = RuntimeAppModule_1 = __decorate([
|
|
112
|
+
Module({})
|
|
113
|
+
], RuntimeAppModule);
|
|
114
|
+
export { RuntimeAppModule };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { OraclePlugin } from '../plugin-api/oracle-plugin.js';
|
|
3
|
+
import type { Logger } from '../plugin-api/types.js';
|
|
4
|
+
export interface ComposeEnvSchemaResult {
|
|
5
|
+
schema: z.ZodObject<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Map of env field name -> the plugin that owns it. Used by
|
|
8
|
+
* {@link validateEnv} to attribute Zod issues to a plugin.
|
|
9
|
+
*/
|
|
10
|
+
pluginOwnership: Map<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidateEnvError {
|
|
13
|
+
/** Plugin owning the failing field, or `'core'` if from a base schema. */
|
|
14
|
+
plugin: string;
|
|
15
|
+
/** Dotted field path from Zod's issue (e.g. `MEMORY_MCP_URL`). */
|
|
16
|
+
field: string;
|
|
17
|
+
/** Human-readable message from Zod. */
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ValidateEnvResult {
|
|
21
|
+
valid: boolean;
|
|
22
|
+
/** Parsed config object — empty when `valid` is false. */
|
|
23
|
+
config: Record<string, unknown>;
|
|
24
|
+
errors: ValidateEnvError[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Fold every plugin's `configSchema` into a single Zod object via
|
|
28
|
+
* `.extend()`. The returned `pluginOwnership` map records which plugin
|
|
29
|
+
* contributed each top-level field so {@link validateEnv} can attribute
|
|
30
|
+
* Zod issues by plugin.
|
|
31
|
+
*
|
|
32
|
+
* Conflict policy: later wins. When two plugins declare the same field,
|
|
33
|
+
* the later definition replaces the earlier one and a warning is emitted
|
|
34
|
+
* via the supplied logger naming both plugins.
|
|
35
|
+
*/
|
|
36
|
+
export declare function composeEnvSchema(plugins: OraclePlugin[], baseSchema?: z.ZodObject<any>, logger?: Logger): ComposeEnvSchemaResult;
|
|
37
|
+
/**
|
|
38
|
+
* Validate `env` against the merged schema and produce structured errors
|
|
39
|
+
* naming the owning plugin per failing field.
|
|
40
|
+
*
|
|
41
|
+
* On success, `config` holds the parsed object (with any Zod
|
|
42
|
+
* coercions/defaults applied). On failure, `config` is empty and every
|
|
43
|
+
* Zod issue is mapped through `pluginOwnership` to find the owner.
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateEnv(schema: z.ZodObject<any>, env: NodeJS.ProcessEnv, pluginOwnership: Map<string, string>): ValidateEnvResult;
|
|
46
|
+
//# sourceMappingURL=schema-composer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-composer.d.ts","sourceRoot":"","sources":["../../src/bootstrap/schema-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,WAAW,sBAAsB;IAErC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IACzB;;;OAGG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAQD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,EAAE,EAEvB,UAAU,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAC7B,MAAM,GAAE,MAAoB,GAC3B,sBAAsB,CA2BxB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAEzB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EACxB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,iBAAiB,CAcnB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const NOOP_LOGGER = {
|
|
3
|
+
log: () => undefined,
|
|
4
|
+
warn: () => undefined,
|
|
5
|
+
error: () => undefined,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Fold every plugin's `configSchema` into a single Zod object via
|
|
9
|
+
* `.extend()`. The returned `pluginOwnership` map records which plugin
|
|
10
|
+
* contributed each top-level field so {@link validateEnv} can attribute
|
|
11
|
+
* Zod issues by plugin.
|
|
12
|
+
*
|
|
13
|
+
* Conflict policy: later wins. When two plugins declare the same field,
|
|
14
|
+
* the later definition replaces the earlier one and a warning is emitted
|
|
15
|
+
* via the supplied logger naming both plugins.
|
|
16
|
+
*/
|
|
17
|
+
export function composeEnvSchema(plugins,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
baseSchema, logger = NOOP_LOGGER) {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
let merged = baseSchema ?? z.object({});
|
|
22
|
+
const pluginOwnership = new Map();
|
|
23
|
+
if (baseSchema) {
|
|
24
|
+
for (const key of Object.keys(baseSchema.shape)) {
|
|
25
|
+
pluginOwnership.set(key, 'core');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const plugin of plugins) {
|
|
29
|
+
if (!plugin.configSchema)
|
|
30
|
+
continue;
|
|
31
|
+
const shape = plugin.configSchema.shape;
|
|
32
|
+
for (const key of Object.keys(shape)) {
|
|
33
|
+
const previous = pluginOwnership.get(key);
|
|
34
|
+
if (previous !== undefined && previous !== plugin.name) {
|
|
35
|
+
logger.warn(`[boot] env key '${key}' is defined by both '${previous}' and '${plugin.name}'; '${plugin.name}' wins.`);
|
|
36
|
+
}
|
|
37
|
+
pluginOwnership.set(key, plugin.name);
|
|
38
|
+
}
|
|
39
|
+
merged = merged.extend(shape);
|
|
40
|
+
}
|
|
41
|
+
return { schema: merged, pluginOwnership };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Validate `env` against the merged schema and produce structured errors
|
|
45
|
+
* naming the owning plugin per failing field.
|
|
46
|
+
*
|
|
47
|
+
* On success, `config` holds the parsed object (with any Zod
|
|
48
|
+
* coercions/defaults applied). On failure, `config` is empty and every
|
|
49
|
+
* Zod issue is mapped through `pluginOwnership` to find the owner.
|
|
50
|
+
*/
|
|
51
|
+
export function validateEnv(
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
schema, env, pluginOwnership) {
|
|
54
|
+
const result = schema.safeParse(env);
|
|
55
|
+
if (result.success) {
|
|
56
|
+
return { valid: true, config: result.data, errors: [] };
|
|
57
|
+
}
|
|
58
|
+
const errors = result.error.issues.map((issue) => {
|
|
59
|
+
const topField = issue.path.length > 0 ? String(issue.path[0]) : '<root>';
|
|
60
|
+
const fullField = issue.path.length > 0 ? issue.path.join('.') : '<root>';
|
|
61
|
+
const plugin = pluginOwnership.get(topField) ?? 'unknown';
|
|
62
|
+
return { plugin, field: fullField, message: issue.message };
|
|
63
|
+
});
|
|
64
|
+
return { valid: false, config: {}, errors };
|
|
65
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { type BaseEnv } from './base-env-schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* Runtime config view used by Tier-0 services that need an env var
|
|
5
|
+
* before NestJS DI is available (e.g. the Matrix checkpointer initialises
|
|
6
|
+
* its singleton during module factory construction).
|
|
7
|
+
*
|
|
8
|
+
* Mirrors the `get` / `getOrThrow` accessors a `ConfigService<BaseEnv>`
|
|
9
|
+
* would expose so callers don't care which path they took. The plugin
|
|
10
|
+
* config schemas merge on top via the boot composer and remain reachable
|
|
11
|
+
* via the same `ConfigService` once Nest is up — but for the checkpointer
|
|
12
|
+
* we only ever need Tier-0 keys plus the derived `ORACLE_DID`.
|
|
13
|
+
*/
|
|
14
|
+
export type BaseEnvWithDerived = BaseEnv & {
|
|
15
|
+
ORACLE_DID: string;
|
|
16
|
+
};
|
|
17
|
+
export interface BaseEnvAccessor {
|
|
18
|
+
get<K extends keyof BaseEnvWithDerived>(key: K, defaultValue?: BaseEnvWithDerived[K]): BaseEnvWithDerived[K] | undefined;
|
|
19
|
+
getOrThrow<K extends keyof BaseEnvWithDerived>(key: K): BaseEnvWithDerived[K];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns a `BaseEnvAccessor` backed by the supplied `ConfigService`
|
|
23
|
+
* (when called from inside a Nest DI scope) or by the lazily-built
|
|
24
|
+
* singleton seeded from `process.env`.
|
|
25
|
+
*
|
|
26
|
+
* Test helpers can call `resetBaseEnvConfigForTesting()` to clear the
|
|
27
|
+
* singleton between cases.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getBaseEnvConfig(configService?: ConfigService<BaseEnvWithDerived>): BaseEnvAccessor;
|
|
30
|
+
export declare function resetBaseEnvConfigForTesting(): void;
|
|
31
|
+
//# sourceMappingURL=base-env-config.d.ts.map
|