@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,47 @@
|
|
|
1
|
+
import type { PluginSubAgent } from '../../plugin-api/types.js';
|
|
2
|
+
import { type BlocknoteToolsConfig } from './blocknote-tools.js';
|
|
3
|
+
import { type BlobStoreCapable, type UcanMintCapable } from './mint-invocation-tool.js';
|
|
4
|
+
import type { AppConfig, MatrixRoomConfig } from './provider.js';
|
|
5
|
+
type AppConfigOverrides = {
|
|
6
|
+
matrix?: Partial<AppConfig['matrix']>;
|
|
7
|
+
provider?: Partial<AppConfig['provider']>;
|
|
8
|
+
blocknote?: Partial<AppConfig['blocknote']>;
|
|
9
|
+
};
|
|
10
|
+
export type EditorAgentMode = 'edit' | 'readOnly';
|
|
11
|
+
export interface CreateEditorSubAgentParams {
|
|
12
|
+
/** Matrix room ID (or `{ type: 'alias', value: '#alias:domain' }`). */
|
|
13
|
+
room: string | MatrixRoomConfig;
|
|
14
|
+
/** Read-only restricts the toolset to non-destructive reads. */
|
|
15
|
+
mode?: EditorAgentMode;
|
|
16
|
+
/** Blocknote tools config built once at plugin boot from validated env. */
|
|
17
|
+
toolsConfig: BlocknoteToolsConfig;
|
|
18
|
+
/** Optional per-call overrides — primarily for tests. */
|
|
19
|
+
configOverrides?: AppConfigOverrides;
|
|
20
|
+
/** Tool name surfaced to the main agent (default `Editor Agent`). */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Tool description surfaced to the main agent. */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** Matrix user ID of the page owner — invited and given power level 50 on page creation. */
|
|
25
|
+
userMatrixId?: string;
|
|
26
|
+
/** Matrix space ID to nest new pages under. */
|
|
27
|
+
spaceId?: string;
|
|
28
|
+
/** When provided, registers `mint_invocation` on the editor agent so skills
|
|
29
|
+
* can sign UCAN invocations against external services without round-
|
|
30
|
+
* tripping the delegation CAR through the LLM. */
|
|
31
|
+
ucanService?: UcanMintCapable;
|
|
32
|
+
/** When provided alongside `ucanService`, the minted invocation is also
|
|
33
|
+
* stored in the blob store under a fresh blobId; the tool returns that
|
|
34
|
+
* blobId so the main agent can pass it to `sandbox_write_blob` instead of
|
|
35
|
+
* relaying the CAR through the LLM. */
|
|
36
|
+
blobStore?: BlobStoreCapable;
|
|
37
|
+
/** Owner of the blob — used as the cache namespace. */
|
|
38
|
+
userDid?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Build the editor `PluginSubAgent` for the given room. The Matrix admin
|
|
42
|
+
* client (`EditorMatrixClient`) is a process-wide singleton bootstrapped on
|
|
43
|
+
* first call with the credentials carried in `toolsConfig`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createEditorSubAgent(params: CreateEditorSubAgentParams): Promise<PluginSubAgent>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=editor-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-agent.d.ts","sourceRoot":"","sources":["../../../src/plugins/editor/editor-agent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AASjE,KAAK,kBAAkB,GAAG;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;CAC7C,CAAC;AA+DF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,UAAU,CAAC;AAElD,MAAM,WAAW,0BAA0B;IACzC,uEAAuE;IACvE,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAChC,gEAAgE;IAChE,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,2EAA2E;IAC3E,WAAW,EAAE,oBAAoB,CAAC;IAClC,yDAAyD;IACzD,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;sDAEkD;IAClD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;2CAGuC;IACvC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA6FD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,cAAc,CAAC,CAyFzB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { tool as pluginTool } from '../../plugin-api/tool-helper.js';
|
|
2
|
+
import { createBlocknoteTools, } from './blocknote-tools.js';
|
|
3
|
+
import { resolveEditorMatrixClient } from './editor-mx.js';
|
|
4
|
+
import { createMintInvocationEditorTool, } from './mint-invocation-tool.js';
|
|
5
|
+
import { createPageTools } from './page-tools.js';
|
|
6
|
+
import { editorAgentPrompt, editorAgentReadOnlyPrompt } from './prompts.js';
|
|
7
|
+
const normalizeRoom = (room) => {
|
|
8
|
+
if (typeof room === 'string') {
|
|
9
|
+
return { type: 'id', value: room };
|
|
10
|
+
}
|
|
11
|
+
return room;
|
|
12
|
+
};
|
|
13
|
+
const buildAppConfig = (base, room, overrides) => {
|
|
14
|
+
const merged = {
|
|
15
|
+
matrix: {
|
|
16
|
+
...base.matrix,
|
|
17
|
+
room,
|
|
18
|
+
},
|
|
19
|
+
provider: { ...base.provider },
|
|
20
|
+
blocknote: { ...base.blocknote },
|
|
21
|
+
};
|
|
22
|
+
if (!overrides) {
|
|
23
|
+
return merged;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
matrix: {
|
|
27
|
+
...merged.matrix,
|
|
28
|
+
...overrides.matrix,
|
|
29
|
+
room: overrides.matrix?.room ?? merged.matrix.room,
|
|
30
|
+
},
|
|
31
|
+
provider: { ...merged.provider, ...overrides.provider },
|
|
32
|
+
blocknote: { ...merged.blocknote, ...overrides.blocknote },
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const resolveStructuredTools = (mode, toolset) => {
|
|
36
|
+
if (mode === 'readOnly') {
|
|
37
|
+
return [
|
|
38
|
+
toolset.listBlocksTool,
|
|
39
|
+
toolset.readBlockByIdTool,
|
|
40
|
+
toolset.searchBlocksTool,
|
|
41
|
+
toolset.readFlowContextTool,
|
|
42
|
+
toolset.readFlowStatusTool,
|
|
43
|
+
toolset.readBlockHistoryTool,
|
|
44
|
+
toolset.readPermissionsTool,
|
|
45
|
+
toolset.readSurveyTool,
|
|
46
|
+
toolset.validateSurveyAnswersTool,
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
const writableToolset = toolset;
|
|
50
|
+
if (!writableToolset.editBlockTool || !writableToolset.createBlockTool) {
|
|
51
|
+
throw new Error('Writable editor mode requires edit and create tools.');
|
|
52
|
+
}
|
|
53
|
+
return [
|
|
54
|
+
writableToolset.listBlocksTool,
|
|
55
|
+
writableToolset.editBlockTool,
|
|
56
|
+
writableToolset.createBlockTool,
|
|
57
|
+
writableToolset.deleteBlockTool,
|
|
58
|
+
writableToolset.readBlockByIdTool,
|
|
59
|
+
writableToolset.searchBlocksTool,
|
|
60
|
+
writableToolset.readFlowContextTool,
|
|
61
|
+
writableToolset.readFlowStatusTool,
|
|
62
|
+
writableToolset.readBlockHistoryTool,
|
|
63
|
+
writableToolset.readPermissionsTool,
|
|
64
|
+
writableToolset.readSurveyTool,
|
|
65
|
+
writableToolset.fillSurveyAnswersTool,
|
|
66
|
+
writableToolset.validateSurveyAnswersTool,
|
|
67
|
+
writableToolset.executeActionTool,
|
|
68
|
+
writableToolset.findAndReplaceTool,
|
|
69
|
+
writableToolset.moveBlockTool,
|
|
70
|
+
writableToolset.bulkEditBlocksTool,
|
|
71
|
+
];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Adapt a LangChain `StructuredTool` into the runtime's `PluginTool` shape so
|
|
75
|
+
* it can flow through the plugin sub-agent assembly path. The handler simply
|
|
76
|
+
* delegates to the underlying tool's `invoke` — the inner tool keeps its
|
|
77
|
+
* strict argument validation; the wrapper exposes the same Zod schema verbatim.
|
|
78
|
+
*/
|
|
79
|
+
function wrapStructuredTool(t) {
|
|
80
|
+
// The inner tool already validates its own input shape; the wrapper just
|
|
81
|
+
// forwards the value through. LangChain's `StructuredTool.invoke` accepts
|
|
82
|
+
// the same `unknown` input at runtime — the wrapper's `args: unknown`
|
|
83
|
+
// contract matches the tool's runtime contract even though the static
|
|
84
|
+
// signature is narrower (`ToolInputSchemaBase`-derived).
|
|
85
|
+
return pluginTool(async (args) => {
|
|
86
|
+
return t.invoke(args);
|
|
87
|
+
}, {
|
|
88
|
+
name: t.name,
|
|
89
|
+
description: t.description ?? '',
|
|
90
|
+
schema: t.schema,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Build the editor `PluginSubAgent` for the given room. The Matrix admin
|
|
95
|
+
* client (`EditorMatrixClient`) is a process-wide singleton bootstrapped on
|
|
96
|
+
* first call with the credentials carried in `toolsConfig`.
|
|
97
|
+
*/
|
|
98
|
+
export async function createEditorSubAgent(params) {
|
|
99
|
+
const { room, mode = 'edit', toolsConfig, configOverrides, name = 'Editor Agent', description = 'AI Agent that reads and writes pages and blocks in the BlockNote editor.', userMatrixId, spaceId, ucanService, blobStore, userDid, } = params;
|
|
100
|
+
const roomConfig = normalizeRoom(room);
|
|
101
|
+
const matrixClient = await resolveEditorMatrixClient({
|
|
102
|
+
baseUrl: toolsConfig.matrix.baseUrl,
|
|
103
|
+
userId: toolsConfig.matrix.userId,
|
|
104
|
+
accessToken: toolsConfig.matrix.accessToken,
|
|
105
|
+
matrixClient: toolsConfig.matrixClient,
|
|
106
|
+
});
|
|
107
|
+
const appConfig = buildAppConfig(toolsConfig, roomConfig, configOverrides);
|
|
108
|
+
const blocknoteTools = (await createBlocknoteTools(matrixClient, appConfig, mode === 'readOnly'));
|
|
109
|
+
const structuredTools = resolveStructuredTools(mode, blocknoteTools);
|
|
110
|
+
const editorRoomId = roomConfig.type === 'id' ? roomConfig.value : undefined;
|
|
111
|
+
const pageTools = createPageTools({
|
|
112
|
+
matrixClient,
|
|
113
|
+
toolsConfig,
|
|
114
|
+
userMatrixId,
|
|
115
|
+
defaultSpaceId: spaceId,
|
|
116
|
+
defaultRoomId: editorRoomId,
|
|
117
|
+
});
|
|
118
|
+
structuredTools.push(pageTools.readPageTool);
|
|
119
|
+
if (mode === 'edit') {
|
|
120
|
+
structuredTools.push(pageTools.createPageTool);
|
|
121
|
+
structuredTools.push(pageTools.updatePageTool);
|
|
122
|
+
}
|
|
123
|
+
// mint_invocation lives on the editor (not the main agent) because the
|
|
124
|
+
// delegation CAR is read from the flow's Y.Doc by CID — only this closure
|
|
125
|
+
// has the matrixClient + roomId baked in. The main agent reaches it via
|
|
126
|
+
// call_editor_agent + the `forwardTools` list below.
|
|
127
|
+
if (ucanService && editorRoomId) {
|
|
128
|
+
structuredTools.push(createMintInvocationEditorTool({
|
|
129
|
+
matrixClient,
|
|
130
|
+
appConfig,
|
|
131
|
+
roomId: editorRoomId,
|
|
132
|
+
ucanService,
|
|
133
|
+
blobStore,
|
|
134
|
+
userDid,
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
const tools = structuredTools.map(wrapStructuredTool);
|
|
138
|
+
return {
|
|
139
|
+
name,
|
|
140
|
+
description,
|
|
141
|
+
systemPrompt: mode === 'readOnly' ? editorAgentReadOnlyPrompt : editorAgentPrompt,
|
|
142
|
+
tools,
|
|
143
|
+
model: 'subagent',
|
|
144
|
+
middlewares: [],
|
|
145
|
+
// Bubble the page + block mutation events into the main chat so the FE
|
|
146
|
+
// renders artifact previews and edit confirmations inline. Names absent
|
|
147
|
+
// in the read-only toolset are simply nothing-to-forward. `mint_invocation`
|
|
148
|
+
// is forwarded so the main agent sees the returned `blobId` and can pass
|
|
149
|
+
// it straight to `sandbox_write_blob`.
|
|
150
|
+
forwardTools: [
|
|
151
|
+
'create_page',
|
|
152
|
+
'update_page',
|
|
153
|
+
'edit_block',
|
|
154
|
+
'create_block',
|
|
155
|
+
'mint_invocation',
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type MatrixClient } from 'matrix-js-sdk';
|
|
2
|
+
/** Matrix admin credentials needed to bootstrap the editor client. */
|
|
3
|
+
export interface EditorMatrixClientConfig {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
accessToken: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Singleton wrapper around a `matrix-js-sdk` `MatrixClient`. Used by
|
|
10
|
+
* `@ixo/matrix-crdt` to read/write BlockNote Y.js documents.
|
|
11
|
+
*
|
|
12
|
+
* No `startClient()` / sync is performed — matrix-crdt's `MatrixReader`
|
|
13
|
+
* explicitly tells consumers NOT to use the Sync API and polls the
|
|
14
|
+
* `/events` endpoint itself. Initialization here is just `createClient`,
|
|
15
|
+
* which is synchronous-ish (a few ms).
|
|
16
|
+
*/
|
|
17
|
+
export declare class EditorMatrixClient {
|
|
18
|
+
private static instance;
|
|
19
|
+
private readonly cfg;
|
|
20
|
+
private matrixClient;
|
|
21
|
+
private isInitialized;
|
|
22
|
+
private initializationPromise;
|
|
23
|
+
private readonly logger;
|
|
24
|
+
private constructor();
|
|
25
|
+
/**
|
|
26
|
+
* Get the singleton instance. First caller supplies the Matrix admin
|
|
27
|
+
* config used for the lifetime of the process; subsequent callers
|
|
28
|
+
* receive the same instance and the config argument is ignored.
|
|
29
|
+
*/
|
|
30
|
+
static getInstance(cfg: EditorMatrixClientConfig): EditorMatrixClient;
|
|
31
|
+
/**
|
|
32
|
+
* Test-only — reset the singleton so tests can swap the underlying client.
|
|
33
|
+
*/
|
|
34
|
+
static resetForTesting(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Build the underlying `matrix-js-sdk` client. Idempotent — safe to call
|
|
37
|
+
* concurrently; only the first call does work.
|
|
38
|
+
*/
|
|
39
|
+
init(): Promise<void>;
|
|
40
|
+
private performInitialization;
|
|
41
|
+
getClient(): MatrixClient;
|
|
42
|
+
isReady(): boolean;
|
|
43
|
+
waitUntilReady(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolve the `MatrixClient` used by editor tools. Prefers the
|
|
47
|
+
* `matrixClient` from the plugin's runtime config (host-provided DI);
|
|
48
|
+
* otherwise lazily constructs the internal singleton.
|
|
49
|
+
*
|
|
50
|
+
* Centralised so every call site (editor-agent, apply-sandbox-output,
|
|
51
|
+
* standalone-editor-tool) goes through one resolution path.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveEditorMatrixClient(cfg: EditorMatrixClientConfig & {
|
|
54
|
+
matrixClient?: MatrixClient;
|
|
55
|
+
}): Promise<MatrixClient>;
|
|
56
|
+
//# sourceMappingURL=editor-mx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-mx.d.ts","sourceRoot":"","sources":["../../../src/plugins/editor/editor-mx.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAEhE,sEAAsE;AACtE,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmC;IAE1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA2B;IAC/C,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,qBAAqB,CAA8B;IAE3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAE3D,OAAO;IAIP;;;;OAIG;WACW,WAAW,CAAC,GAAG,EAAE,wBAAwB,GAAG,kBAAkB;IAO5E;;OAEG;WACW,eAAe,IAAI,IAAI;IAIrC;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAYpB,qBAAqB;IAmB5B,SAAS,IAAI,YAAY;IASzB,OAAO,IAAI,OAAO;IAIZ,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7C;AAED;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,wBAAwB,GAAG;IAAE,YAAY,CAAC,EAAE,YAAY,CAAA;CAAE,GAC9D,OAAO,CAAC,YAAY,CAAC,CAKvB"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { createClient } from 'matrix-js-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Singleton wrapper around a `matrix-js-sdk` `MatrixClient`. Used by
|
|
5
|
+
* `@ixo/matrix-crdt` to read/write BlockNote Y.js documents.
|
|
6
|
+
*
|
|
7
|
+
* No `startClient()` / sync is performed — matrix-crdt's `MatrixReader`
|
|
8
|
+
* explicitly tells consumers NOT to use the Sync API and polls the
|
|
9
|
+
* `/events` endpoint itself. Initialization here is just `createClient`,
|
|
10
|
+
* which is synchronous-ish (a few ms).
|
|
11
|
+
*/
|
|
12
|
+
export class EditorMatrixClient {
|
|
13
|
+
static instance = null;
|
|
14
|
+
cfg;
|
|
15
|
+
matrixClient = null;
|
|
16
|
+
isInitialized = false;
|
|
17
|
+
initializationPromise = null;
|
|
18
|
+
logger = new Logger('EditorMatrixClient');
|
|
19
|
+
constructor(cfg) {
|
|
20
|
+
this.cfg = cfg;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the singleton instance. First caller supplies the Matrix admin
|
|
24
|
+
* config used for the lifetime of the process; subsequent callers
|
|
25
|
+
* receive the same instance and the config argument is ignored.
|
|
26
|
+
*/
|
|
27
|
+
static getInstance(cfg) {
|
|
28
|
+
if (!EditorMatrixClient.instance) {
|
|
29
|
+
EditorMatrixClient.instance = new EditorMatrixClient(cfg);
|
|
30
|
+
}
|
|
31
|
+
return EditorMatrixClient.instance;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Test-only — reset the singleton so tests can swap the underlying client.
|
|
35
|
+
*/
|
|
36
|
+
static resetForTesting() {
|
|
37
|
+
EditorMatrixClient.instance = null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Build the underlying `matrix-js-sdk` client. Idempotent — safe to call
|
|
41
|
+
* concurrently; only the first call does work.
|
|
42
|
+
*/
|
|
43
|
+
async init() {
|
|
44
|
+
if (this.isInitialized && this.matrixClient)
|
|
45
|
+
return;
|
|
46
|
+
if (this.initializationPromise)
|
|
47
|
+
return this.initializationPromise;
|
|
48
|
+
this.initializationPromise = this.performInitialization();
|
|
49
|
+
try {
|
|
50
|
+
await this.initializationPromise;
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
this.initializationPromise = null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async performInitialization() {
|
|
57
|
+
const { baseUrl, userId, accessToken } = this.cfg;
|
|
58
|
+
if (!baseUrl || !userId || !accessToken) {
|
|
59
|
+
throw new Error('Missing Matrix configuration. Editor plugin requires MATRIX_BASE_URL, MATRIX_ORACLE_ADMIN_USER_ID, MATRIX_ORACLE_ADMIN_ACCESS_TOKEN.');
|
|
60
|
+
}
|
|
61
|
+
this.matrixClient = createClient({
|
|
62
|
+
baseUrl,
|
|
63
|
+
accessToken,
|
|
64
|
+
userId,
|
|
65
|
+
timelineSupport: true,
|
|
66
|
+
fetchFn: fetch,
|
|
67
|
+
});
|
|
68
|
+
this.isInitialized = true;
|
|
69
|
+
this.logger.log('EditorMatrixClient ready (no sync, polling-only mode)');
|
|
70
|
+
}
|
|
71
|
+
getClient() {
|
|
72
|
+
if (!this.isInitialized || !this.matrixClient) {
|
|
73
|
+
throw new Error('EditorMatrixClient not initialized. Call await init() first.');
|
|
74
|
+
}
|
|
75
|
+
return this.matrixClient;
|
|
76
|
+
}
|
|
77
|
+
isReady() {
|
|
78
|
+
return this.isInitialized && this.matrixClient !== null;
|
|
79
|
+
}
|
|
80
|
+
async waitUntilReady() {
|
|
81
|
+
if (this.isReady())
|
|
82
|
+
return;
|
|
83
|
+
await this.init();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Resolve the `MatrixClient` used by editor tools. Prefers the
|
|
88
|
+
* `matrixClient` from the plugin's runtime config (host-provided DI);
|
|
89
|
+
* otherwise lazily constructs the internal singleton.
|
|
90
|
+
*
|
|
91
|
+
* Centralised so every call site (editor-agent, apply-sandbox-output,
|
|
92
|
+
* standalone-editor-tool) goes through one resolution path.
|
|
93
|
+
*/
|
|
94
|
+
export async function resolveEditorMatrixClient(cfg) {
|
|
95
|
+
if (cfg.matrixClient)
|
|
96
|
+
return cfg.matrixClient;
|
|
97
|
+
const inst = EditorMatrixClient.getInstance(cfg);
|
|
98
|
+
await inst.init();
|
|
99
|
+
return inst.getClient();
|
|
100
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MatrixClient } from 'matrix-js-sdk';
|
|
2
|
+
import { OraclePlugin } from '../../plugin-api/oracle-plugin.js';
|
|
3
|
+
import type { PluginManifest, PluginSubAgent, PluginTool, RuntimeContext } from '../../plugin-api/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Constructor options for `EditorPlugin`. Pass `matrixClient` when the host
|
|
6
|
+
* app already owns a long-lived matrix-js-sdk client — every editor tool
|
|
7
|
+
* will reuse it instead of constructing the internal singleton.
|
|
8
|
+
*/
|
|
9
|
+
export interface EditorPluginOptions {
|
|
10
|
+
matrixClient?: MatrixClient;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Editor plugin. Behaviour by state:
|
|
14
|
+
*
|
|
15
|
+
* - `state.editorRoomId` set → editor sub-agent (`call_editor_agent`)
|
|
16
|
+
* bound to that room; plus `apply_sandbox_output_to_block` when the
|
|
17
|
+
* sandbox plugin is also loaded.
|
|
18
|
+
* - `state.spaceId` set without `editorRoomId` → standalone
|
|
19
|
+
* `call_editor_agent` tool that accepts a `room_id` argument per call.
|
|
20
|
+
* - neither set → no contributions; the agent has no editor surface.
|
|
21
|
+
*/
|
|
22
|
+
export declare class EditorPlugin extends OraclePlugin {
|
|
23
|
+
static readonly NAME = "editor";
|
|
24
|
+
readonly name = "editor";
|
|
25
|
+
readonly version = "1.0.0";
|
|
26
|
+
readonly manifest: PluginManifest;
|
|
27
|
+
private readonly matrixClient?;
|
|
28
|
+
constructor(options?: EditorPluginOptions);
|
|
29
|
+
getRequestSubAgents(rtCtx: RuntimeContext): Promise<PluginSubAgent[]>;
|
|
30
|
+
getRequestTools(rtCtx: RuntimeContext): Promise<PluginTool[]>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=editor.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/editor/editor.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACV,cAAc,EACf,MAAM,2BAA2B,CAAC;AAUnC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AA2FD;;;;;;;;;GASG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;IAEhC,QAAQ,CAAC,IAAI,YAAqB;IAElC,QAAQ,CAAC,OAAO,WAAW;IAE3B,QAAQ,CAAC,QAAQ,iBAAY;IAK7B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAe;gBAEjC,OAAO,GAAE,mBAAwB;IAK9B,mBAAmB,CAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,cAAc,EAAE,CAAC;IAwCb,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAyD7E"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { isUserInRoom } from '../../matrix/room-membership.js';
|
|
3
|
+
import { OraclePlugin } from '../../plugin-api/oracle-plugin.js';
|
|
4
|
+
import { SandboxPlugin } from '../sandbox/index.js';
|
|
5
|
+
import { createApplySandboxOutputTool } from './apply-sandbox-output.js';
|
|
6
|
+
import { buildBlocknoteToolsConfig, } from './blocknote-tools.js';
|
|
7
|
+
import { createEditorSubAgent } from './editor-agent.js';
|
|
8
|
+
import { createStandaloneEditorTool } from './standalone-editor-tool.js';
|
|
9
|
+
/**
|
|
10
|
+
* Internal parse schema for `parseToolsConfig`. These 3 env vars already
|
|
11
|
+
* live in the runtime's core base env schema — re-declaring them via
|
|
12
|
+
* `OraclePlugin.configSchema` would make schema-composer warn about
|
|
13
|
+
* duplicate ownership ("editor wins") on every boot. Keep this schema
|
|
14
|
+
* LOCAL: used to extract typed values from the already-validated
|
|
15
|
+
* `ctx.config`, but NOT exposed as the plugin's public configSchema.
|
|
16
|
+
*/
|
|
17
|
+
const matrixConfigSchema = z.object({
|
|
18
|
+
MATRIX_BASE_URL: z.string(),
|
|
19
|
+
MATRIX_ORACLE_ADMIN_USER_ID: z.string(),
|
|
20
|
+
MATRIX_ORACLE_ADMIN_ACCESS_TOKEN: z.string(),
|
|
21
|
+
});
|
|
22
|
+
const siblingEnvSchema = z.object({
|
|
23
|
+
SANDBOX_MCP_URL: z.url().optional(),
|
|
24
|
+
SKILLS_CAPSULES_BASE_URL: z.url().optional(),
|
|
25
|
+
ORACLE_SECRETS: z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
const manifest = {
|
|
28
|
+
title: 'Editor',
|
|
29
|
+
summary: "Reads and edits BlockNote pages — collaborative documents in the user's workspace.",
|
|
30
|
+
whenToUse: [
|
|
31
|
+
'User asks to read, summarize, or edit a page in their workspace.',
|
|
32
|
+
'User wants to update specific blocks (status, properties, content) on a page.',
|
|
33
|
+
'User wants to create a new page or update an existing one.',
|
|
34
|
+
'A skill produced output (URLs, credentials, status values) that should land on specific blocks.',
|
|
35
|
+
],
|
|
36
|
+
whenNotToUse: [
|
|
37
|
+
'IXO entity lookups (use Domain Indexer) — pages are documents, not entities.',
|
|
38
|
+
'Web search or scraping (use Firecrawl).',
|
|
39
|
+
'Long-term user memory (use Memory).',
|
|
40
|
+
],
|
|
41
|
+
examples: [
|
|
42
|
+
{
|
|
43
|
+
user: 'Summarize the current page.',
|
|
44
|
+
thought: 'Delegate to the Editor sub-agent with the active room. It will read the page and return a summary.',
|
|
45
|
+
tool: 'call_editor_agent',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
user: 'Set the status block to completed.',
|
|
49
|
+
thought: 'Page edit — delegate with explicit block target + new value. Never paraphrase block IDs or status names.',
|
|
50
|
+
tool: 'call_editor_agent',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
tags: ['editor', 'blocknote', 'pages', 'documents'],
|
|
54
|
+
category: 'data',
|
|
55
|
+
visibility: 'on-demand',
|
|
56
|
+
stability: 'stable',
|
|
57
|
+
};
|
|
58
|
+
function parseToolsConfig(cfg, matrixClient) {
|
|
59
|
+
const parsed = matrixConfigSchema.parse(cfg);
|
|
60
|
+
return {
|
|
61
|
+
...buildBlocknoteToolsConfig({
|
|
62
|
+
baseUrl: parsed.MATRIX_BASE_URL,
|
|
63
|
+
userId: parsed.MATRIX_ORACLE_ADMIN_USER_ID,
|
|
64
|
+
accessToken: parsed.MATRIX_ORACLE_ADMIN_ACCESS_TOKEN,
|
|
65
|
+
}),
|
|
66
|
+
matrixClient,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function readEditorRoomId(rtCtx) {
|
|
70
|
+
const value = rtCtx.history.state.editorRoomId;
|
|
71
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
72
|
+
}
|
|
73
|
+
function readSpaceId(rtCtx) {
|
|
74
|
+
const value = rtCtx.history.state.spaceId;
|
|
75
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
76
|
+
}
|
|
77
|
+
function buildUserMatrixId(rtCtx) {
|
|
78
|
+
// Mirrors today's apps/app pattern: derive `@did-ixo-...:homeserver` from
|
|
79
|
+
// the canonical user DID + base URL when no explicit Matrix ID is wired in.
|
|
80
|
+
const did = rtCtx.user.did;
|
|
81
|
+
if (!did)
|
|
82
|
+
return undefined;
|
|
83
|
+
const matrixId = rtCtx.user.matrixUserId;
|
|
84
|
+
return matrixId || undefined;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Editor plugin. Behaviour by state:
|
|
88
|
+
*
|
|
89
|
+
* - `state.editorRoomId` set → editor sub-agent (`call_editor_agent`)
|
|
90
|
+
* bound to that room; plus `apply_sandbox_output_to_block` when the
|
|
91
|
+
* sandbox plugin is also loaded.
|
|
92
|
+
* - `state.spaceId` set without `editorRoomId` → standalone
|
|
93
|
+
* `call_editor_agent` tool that accepts a `room_id` argument per call.
|
|
94
|
+
* - neither set → no contributions; the agent has no editor surface.
|
|
95
|
+
*/
|
|
96
|
+
export class EditorPlugin extends OraclePlugin {
|
|
97
|
+
static NAME = 'editor';
|
|
98
|
+
name = EditorPlugin.NAME;
|
|
99
|
+
version = '1.0.0';
|
|
100
|
+
manifest = manifest;
|
|
101
|
+
// Intentionally no `configSchema` — the matrix env vars editor needs are
|
|
102
|
+
// owned by the core base env schema. See `matrixConfigSchema` above.
|
|
103
|
+
matrixClient;
|
|
104
|
+
constructor(options = {}) {
|
|
105
|
+
super();
|
|
106
|
+
this.matrixClient = options.matrixClient;
|
|
107
|
+
}
|
|
108
|
+
async getRequestSubAgents(rtCtx) {
|
|
109
|
+
const editorRoomId = readEditorRoomId(rtCtx);
|
|
110
|
+
if (!editorRoomId)
|
|
111
|
+
return [];
|
|
112
|
+
// The editor operates on `editorRoomId` with the oracle's admin Matrix
|
|
113
|
+
// identity. `editorRoomId` came from the request, so verify the
|
|
114
|
+
// authenticated user is actually a member of that room before binding the
|
|
115
|
+
// sub-agent to it — otherwise a user could read/edit any room id they pass.
|
|
116
|
+
if (!(await isUserInRoom(editorRoomId, rtCtx.user.matrixUserId))) {
|
|
117
|
+
rtCtx.logger.warn(`[editor] user ${rtCtx.user.did} is not a member of room ${editorRoomId} — refusing to bind editor sub-agent`);
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
const toolsConfig = parseToolsConfig(rtCtx.config, this.matrixClient);
|
|
121
|
+
try {
|
|
122
|
+
const subAgent = await createEditorSubAgent({
|
|
123
|
+
room: editorRoomId,
|
|
124
|
+
mode: 'edit',
|
|
125
|
+
toolsConfig,
|
|
126
|
+
userMatrixId: buildUserMatrixId(rtCtx),
|
|
127
|
+
spaceId: readSpaceId(rtCtx),
|
|
128
|
+
// Gate mint_invocation on whether the oracle has a signing key. Without
|
|
129
|
+
// one, the tool can't mint anything — better to omit it than register
|
|
130
|
+
// a tool that returns "Oracle has no UCAN signing key configured" on
|
|
131
|
+
// every call.
|
|
132
|
+
ucanService: rtCtx.ucan.hasSigningKey() ? rtCtx.ucan : undefined,
|
|
133
|
+
blobStore: rtCtx.blobStore,
|
|
134
|
+
userDid: rtCtx.user.did,
|
|
135
|
+
});
|
|
136
|
+
return [subAgent];
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
140
|
+
rtCtx.logger.error(`[editor] failed to build sub-agent: ${detail}`);
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async getRequestTools(rtCtx) {
|
|
145
|
+
const tools = [];
|
|
146
|
+
const editorRoomId = readEditorRoomId(rtCtx);
|
|
147
|
+
const spaceId = readSpaceId(rtCtx);
|
|
148
|
+
if (!editorRoomId && !spaceId) {
|
|
149
|
+
return tools;
|
|
150
|
+
}
|
|
151
|
+
const toolsConfig = parseToolsConfig(rtCtx.config, this.matrixClient);
|
|
152
|
+
// Standalone editor tool — only when a space is in scope but no specific
|
|
153
|
+
// editor session is active. The agent supplies `room_id` per call.
|
|
154
|
+
if (!editorRoomId && spaceId) {
|
|
155
|
+
tools.push(createStandaloneEditorTool({
|
|
156
|
+
toolsConfig,
|
|
157
|
+
spaceId,
|
|
158
|
+
userMatrixId: buildUserMatrixId(rtCtx),
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
// apply_sandbox_output_to_block — only with both an editor session AND
|
|
162
|
+
// a loaded sandbox plugin (it brokers UCAN headers for the MCP call).
|
|
163
|
+
// Same room-ownership guard as the sub-agent path: the tool writes to
|
|
164
|
+
// `editorRoomId` with the admin identity, so the requesting user must be
|
|
165
|
+
// a member of it.
|
|
166
|
+
if (editorRoomId &&
|
|
167
|
+
rtCtx.availablePlugins.has(SandboxPlugin.NAME) &&
|
|
168
|
+
(await isUserInRoom(editorRoomId, rtCtx.user.matrixUserId))) {
|
|
169
|
+
const siblings = siblingEnvSchema.safeParse(rtCtx.config);
|
|
170
|
+
const sandboxMcpUrl = siblings.success
|
|
171
|
+
? siblings.data.SANDBOX_MCP_URL
|
|
172
|
+
: undefined;
|
|
173
|
+
if (sandboxMcpUrl) {
|
|
174
|
+
tools.push(createApplySandboxOutputTool({
|
|
175
|
+
sandboxMcpUrl,
|
|
176
|
+
skillsServiceUrl: siblings.success
|
|
177
|
+
? siblings.data.SKILLS_CAPSULES_BASE_URL
|
|
178
|
+
: undefined,
|
|
179
|
+
oracleSecretsRaw: siblings.success
|
|
180
|
+
? (siblings.data.ORACLE_SECRETS ?? '')
|
|
181
|
+
: '',
|
|
182
|
+
toolsConfig,
|
|
183
|
+
editorRoomId,
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return tools;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { EditorPlugin } from './editor.plugin.js';
|
|
2
|
+
export { createEditorSubAgent, type CreateEditorSubAgentParams, type EditorAgentMode, } from './editor-agent.js';
|
|
3
|
+
export { createStandaloneEditorTool } from './standalone-editor-tool.js';
|
|
4
|
+
export { createApplySandboxOutputTool } from './apply-sandbox-output.js';
|
|
5
|
+
export { buildBlocknoteToolsConfig, type BlocknoteToolsConfig, type BlocknoteToolsMatrixConfig, } from './blocknote-tools.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAChC,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EditorPlugin } from './editor.plugin.js';
|
|
2
|
+
export { createEditorSubAgent, } from './editor-agent.js';
|
|
3
|
+
export { createStandaloneEditorTool } from './standalone-editor-tool.js';
|
|
4
|
+
export { createApplySandboxOutputTool } from './apply-sandbox-output.js';
|
|
5
|
+
export { buildBlocknoteToolsConfig, } from './blocknote-tools.js';
|