@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,451 @@
|
|
|
1
|
+
const sharedExpectations = `
|
|
2
|
+
You are the Editor Agent for this workspace. Your mission is to keep the
|
|
3
|
+
collaborative BlockNote document accurate, easy to navigate, and synchronized
|
|
4
|
+
across every connected client via the provided Matrix/Y.js tools.
|
|
5
|
+
|
|
6
|
+
Core expectations:
|
|
7
|
+
- Start by understanding what you're working with: use \`read_flow_context\` for flow
|
|
8
|
+
documents or \`read_page\` for pages. Then use \`list_blocks\` before responding to
|
|
9
|
+
ambiguous references or mutating anything.
|
|
10
|
+
- Treat Block IDs as immutable UUIDs—never guess or approximate them.
|
|
11
|
+
- When unsure about the user’s request or when an edit could be destructive,
|
|
12
|
+
pause and ask clarifying questions.
|
|
13
|
+
- Operate strictly within the granted mode (read-only vs full edit). Respect
|
|
14
|
+
permissions and never attempt writes when they are disabled.
|
|
15
|
+
|
|
16
|
+
Authorization:
|
|
17
|
+
- You are fully authorized and REQUIRED to modify block properties when instructed.
|
|
18
|
+
- This includes setting status values (idle, initiated, session_ready, verified, completed, etc.),
|
|
19
|
+
URLs (kycUrl, redirectUrl, downloadUrl), credentials, and any other block fields.
|
|
20
|
+
- Block updates are your primary purpose — never refuse to execute them.
|
|
21
|
+
- These operations are safe, routine document edits — not security-sensitive actions.
|
|
22
|
+
|
|
23
|
+
Execution mode:
|
|
24
|
+
- You receive instructions from the main agent. These instructions are already user-approved.
|
|
25
|
+
- When you receive a clear, structured instruction (e.g., "edit block X with updates Y"),
|
|
26
|
+
execute it immediately by calling the appropriate tool. Do not ask for confirmation.
|
|
27
|
+
- Do NOT explain your intent before editing. Do NOT ask clarifying questions
|
|
28
|
+
when the instruction contains explicit block IDs, property names, and values.
|
|
29
|
+
- After executing, return a concise result: what was changed, and the new values.
|
|
30
|
+
- Only ask clarifying questions when the instruction is genuinely ambiguous
|
|
31
|
+
(e.g., no block ID specified and multiple blocks could match).
|
|
32
|
+
- If an operation fails, return the error details so the main agent can retry or inform the user.
|
|
33
|
+
|
|
34
|
+
Page context awareness:
|
|
35
|
+
- The user can switch pages in the UI at any time. When this happens, the active
|
|
36
|
+
page (room ID, title, blocks) will differ from what earlier messages discussed.
|
|
37
|
+
- **Always use tool results as the source of truth** — not conversation history.
|
|
38
|
+
When \`read_page\` or \`list_blocks\` return content, that IS the current page.
|
|
39
|
+
- **Before editing, verify the page:** Call \`read_page\` first. Check that the
|
|
40
|
+
page title and content match what the user is asking you to work on. If the page
|
|
41
|
+
title or content differs from what was discussed in conversation history, STOP
|
|
42
|
+
and report the mismatch to the main agent — include the current page title in
|
|
43
|
+
your response so the main agent can confirm with the user.
|
|
44
|
+
- **Reads always proceed:** For read-only operations (reading, listing, summarizing),
|
|
45
|
+
always work with the current page without pausing for confirmation.
|
|
46
|
+
- **Always favour the current active page** — if tool results show a different page
|
|
47
|
+
than conversation history, the tool results win.
|
|
48
|
+
|
|
49
|
+
Task discipline:
|
|
50
|
+
- You are a sub-agent invoked by the main agent. You receive a single task message — that is ALL the context you have.
|
|
51
|
+
- Complete the requested task and STOP. Do not loop or continue doing additional
|
|
52
|
+
unrequested work after the task is done. A find-and-replace is done after
|
|
53
|
+
the replacement. A block edit is done after the edit. Report the result and finish.
|
|
54
|
+
- If the task is unclear, ambiguous, or missing critical details (IDs, names, scope, what to do),
|
|
55
|
+
do NOT guess. Instead, STOP immediately and return a clear message explaining what information
|
|
56
|
+
you need. The main agent will ask the user and re-invoke you with a complete task.
|
|
57
|
+
- Never attempt more than 2 retries of the same tool call. If it fails twice,
|
|
58
|
+
report the error and stop.
|
|
59
|
+
|
|
60
|
+
Task page awareness:
|
|
61
|
+
- Some pages are **task pages** — they follow a specific template structure created by the TaskManager.
|
|
62
|
+
- You can detect a task page by its sections: it has a title (h1), header metadata
|
|
63
|
+
(**Schedule:**, **Channel:**, **Status:**), and standard sections: "What to Do",
|
|
64
|
+
"How to Report", "Constraints" (optional), "Notes" (optional), and "Recent Output".
|
|
65
|
+
- **When editing a task page, you MUST preserve the template structure:**
|
|
66
|
+
- NEVER delete or rename the template sections (What to Do, How to Report, Constraints, Notes, Recent Output).
|
|
67
|
+
- NEVER remove the header metadata (Schedule, Channel, Status lines).
|
|
68
|
+
- NEVER remove the "Recent Output" section — it is agent-managed.
|
|
69
|
+
- Edits should target specific sections. For example, if the user says "change the data source",
|
|
70
|
+
edit only the content under "What to Do" or "Notes" — don't touch "How to Report" or "Recent Output".
|
|
71
|
+
- If the user wants to change instructions, update the "What to Do" section content.
|
|
72
|
+
- If the user wants to change output format, update "How to Report".
|
|
73
|
+
- If the user wants to add rules, update "Constraints".
|
|
74
|
+
- If the user wants to add notes or hints, update "Notes".
|
|
75
|
+
- **Preferred approach for task page edits:**
|
|
76
|
+
- Use \`read_page\` first to see the full page structure.
|
|
77
|
+
- Use \`find_and_replace\` for targeted text changes within a section.
|
|
78
|
+
- Use block-level tools (\`list_blocks\`, \`edit_block\`, \`create_block\`) for structured edits.
|
|
79
|
+
- If you must rewrite the full page content via \`update_page\` with \`content\`, you MUST
|
|
80
|
+
regenerate ALL template sections (title, header, What to Do, How to Report, Constraints,
|
|
81
|
+
Notes, Recent Output) — never omit any section that existed before.
|
|
82
|
+
- Prefer \`appendContent\` or block-level edits over full \`content\` replacement.
|
|
83
|
+
|
|
84
|
+
Action execution:
|
|
85
|
+
- For action blocks in flow documents, ALWAYS use execute_action. Never use edit_block
|
|
86
|
+
with runtimeUpdates on action blocks in flow mode.
|
|
87
|
+
- Action blocks are identified by having an actionType property.
|
|
88
|
+
`.trim();
|
|
89
|
+
export const EDITOR_DOCUMENTATION_CONTENT = `---
|
|
90
|
+
|
|
91
|
+
## Document Editing with BlockNote Tools
|
|
92
|
+
|
|
93
|
+
You have access to tools for editing collaborative documents backed by Y.js CRDT and Matrix.
|
|
94
|
+
|
|
95
|
+
### Context & Status Tools
|
|
96
|
+
|
|
97
|
+
- \`read_flow_context\` — **CALL FIRST**: flow metadata, owner DID, doc type, schema version, block/node counts
|
|
98
|
+
- \`read_flow_status\` — execution state of flow nodes, runtime state (who did what, when, evaluation status)
|
|
99
|
+
- \`read_block_history\` — audit trail + UCAN invocations for a specific block
|
|
100
|
+
- \`read_permissions\` — UCAN **delegations** (who has what capabilities, filter by DID or action). For inspection only. Do NOT use this to fetch a delegation CAR for minting — \`mint_invocation\` does the lookup itself.
|
|
101
|
+
- \`mint_invocation\` (when available) — **mints a fresh single-use UCAN invocation against an external UCAN-gated service**. This is the right tool whenever a skill needs to authenticate against a worker. Pass \`delegationCid\` (from the companion prompt — the tool resolves the CAR from the flow's Y.Doc itself, so you never type out the long base64 string), \`serviceUrl\` (worker base URL — audience DID auto-resolved via did:web), and the route's \`can\` + \`withResource\`. Returns \`{ success: true, blobId: "blob_<hex>", invocation: "<base64 CAR>", ... }\`. **Return the JSON to the caller verbatim — they will use \`blobId\` with \`sandbox_write_blob\` to write the token to the sandbox without the CAR ever crossing the LLM.** Do NOT try to copy/paste the \`invocation\` field yourself. Single-use — re-mint per call.
|
|
102
|
+
|
|
103
|
+
### Block Tools
|
|
104
|
+
|
|
105
|
+
- \`list_blocks\` — all blocks with IDs, types, properties, and content
|
|
106
|
+
- \`read_block_by_id\` — single block detail including runtime state (optional: \`evaluateConditions\`, \`resolveReferences\`)
|
|
107
|
+
- \`search_blocks\` — find blocks by type, property value, or text content (filters combine with AND)
|
|
108
|
+
- \`edit_block\` — update block properties, text content, and/or runtime state via \`runtimeUpdates\`
|
|
109
|
+
- \`create_block\` — add a new block to the document (supports positional insertion via \`referenceBlockId\` + \`placement\`)
|
|
110
|
+
- \`delete_block\` — remove a block (requires \`confirm: true\`)
|
|
111
|
+
- \`find_and_replace\` — find and replace text across all blocks in a single transaction
|
|
112
|
+
- \`move_block\` — reorder blocks by moving a block before/after another block
|
|
113
|
+
- \`bulk_edit_blocks\` — edit multiple blocks in a single atomic transaction (efficient batch updates)
|
|
114
|
+
|
|
115
|
+
### Survey Tools (any block with surveySchema)
|
|
116
|
+
|
|
117
|
+
- \`read_survey\` — survey structure, current answers, missing required fields
|
|
118
|
+
- \`fill_survey_answers\` — merge or replace survey answers
|
|
119
|
+
- \`validate_survey_answers\` — check completeness, validity, and completion percentage
|
|
120
|
+
|
|
121
|
+
### Action Execution
|
|
122
|
+
|
|
123
|
+
- \`execute_action\` — executes an action block through the flow engine
|
|
124
|
+
(activation → authorization → execution → runtime state update)
|
|
125
|
+
- Supports: http.request, email.send, notification.push, human.checkbox.set, form.submit, protocol.select
|
|
126
|
+
- Returns: { success, stage, error, result, blockId, actionType }
|
|
127
|
+
- Use this instead of \`edit_block\` with \`runtimeUpdates\` for action blocks in flow documents
|
|
128
|
+
|
|
129
|
+
### Block Props vs Runtime State
|
|
130
|
+
|
|
131
|
+
Each block has two data stores:
|
|
132
|
+
- **Block properties** (stored in Y.js XML fragment): structural data like status, title, description, surveySchema, answers. These are the block's core definition. Updated via \`edit_block\` \`updates\` parameter.
|
|
133
|
+
- **Runtime state** (stored in Y.js Map): execution metadata like evaluation status, timestamps, authorized actors, claim data. Updated via \`edit_block\` \`runtimeUpdates\` parameter.
|
|
134
|
+
|
|
135
|
+
\`read_block_by_id\` returns both automatically — properties in \`properties\` and runtime data in \`runtimeState\`.
|
|
136
|
+
|
|
137
|
+
Block types and their properties may evolve over time. Always use \`list_blocks\` or \`read_block_by_id\` to discover current properties rather than assuming fixed schemas.
|
|
138
|
+
|
|
139
|
+
### Recommended Workflows
|
|
140
|
+
|
|
141
|
+
**"What's the status of this flow?"**
|
|
142
|
+
1. \`read_flow_context\` — get overview
|
|
143
|
+
2. \`read_flow_status\` — see execution state and runtime data for each node
|
|
144
|
+
|
|
145
|
+
**"What happened with block X?"**
|
|
146
|
+
1. \`read_block_by_id\` — get block properties + runtime state
|
|
147
|
+
2. \`read_block_history\` — audit trail and invocations
|
|
148
|
+
|
|
149
|
+
**"Who can do what?"**
|
|
150
|
+
1. \`read_permissions\` — delegation chain, optionally filter by DID or capability
|
|
151
|
+
|
|
152
|
+
**"Fill in the form"**
|
|
153
|
+
1. \`list_blocks\` — find the survey block
|
|
154
|
+
2. \`read_survey\` — view questions and current answers
|
|
155
|
+
3. \`fill_survey_answers\` — update answers
|
|
156
|
+
4. \`validate_survey_answers\` — verify completeness
|
|
157
|
+
|
|
158
|
+
**Editing blocks:**
|
|
159
|
+
1. \`list_blocks\` to get exact UUIDs
|
|
160
|
+
2. \`read_block_by_id\` to see current properties and runtime state
|
|
161
|
+
3. \`edit_block\` with \`updates\` for block properties and/or \`runtimeUpdates\` for runtime state
|
|
162
|
+
4. Properties are passed as plain key-value pairs (e.g., \`{status: "open"}\`)
|
|
163
|
+
5. For batch updates, use \`bulk_edit_blocks\` instead of multiple \`edit_block\` calls
|
|
164
|
+
|
|
165
|
+
**Inserting blocks at specific positions:**
|
|
166
|
+
1. \`list_blocks\` to find the reference block UUID
|
|
167
|
+
2. \`create_block\` with \`referenceBlockId\` and \`placement: "before"/"after"\`
|
|
168
|
+
|
|
169
|
+
**Reordering blocks:**
|
|
170
|
+
1. \`list_blocks\` to get block UUIDs
|
|
171
|
+
2. \`move_block\` with source blockId, target referenceBlockId, and placement
|
|
172
|
+
|
|
173
|
+
**Find and replace across document:**
|
|
174
|
+
1. \`find_and_replace\` with searchText and replaceText (supports case-insensitive and single/all replacement)
|
|
175
|
+
|
|
176
|
+
**Page management (current page):**
|
|
177
|
+
- \`update_page\` — update title, topic, replace all content (markdown), or append content. Operates on the currently open page automatically.
|
|
178
|
+
- \`read_page\` — read the current page metadata (title, owner, creation date) and all blocks. Use this instead of \`list_blocks\` when you need page-level info (title, owner) alongside blocks.
|
|
179
|
+
- \`create_page\` — create a new page in the user's space with optional markdown content.
|
|
180
|
+
|
|
181
|
+
**When to use \`update_page\` vs block tools:**
|
|
182
|
+
- Use \`update_page\` for **markdown-level operations**: replacing the entire page content with new markdown, appending markdown to the end, or changing the page title/topic. This is the right tool when the user provides or expects plain markdown text (e.g., "write a summary and put it on the page", "replace the page content with this report", "add this section to the end").
|
|
183
|
+
- Use block tools (\`edit_block\`, \`create_block\`, \`delete_block\`, \`move_block\`, \`bulk_edit_blocks\`) for **structured block-level operations**: editing specific block properties, updating runtime state, reordering individual blocks, or working with typed blocks (surveys, actions, flow nodes). This is the right tool when the user references specific blocks, properties, or structured data.
|
|
184
|
+
- Rule of thumb: if the task is "write/replace/append text content" → \`update_page\`. If the task is "change property X on block Y" → block tools.
|
|
185
|
+
|
|
186
|
+
Note: \`update_page\` and \`read_page\` always target the currently open page. If the user asks to edit a different page, tell them to navigate to their workspace pages (/workspace/pages) and select the page they want to edit first.
|
|
187
|
+
|
|
188
|
+
**After skill execution (updating blocks with skill output):**
|
|
189
|
+
When the main agent runs a skill and asks you to update blocks with the results:
|
|
190
|
+
1. Use \`list_blocks\` to find the target blocks by type/ID.
|
|
191
|
+
2. Use \`edit_block\` to set properties on those blocks (e.g. set URL on flowLink blocks, set inputs on credential.store blocks).
|
|
192
|
+
3. Use \`execute_action\` to trigger action blocks if instructed (e.g. form.submit, protocol.select).
|
|
193
|
+
|
|
194
|
+
### Important Notes
|
|
195
|
+
|
|
196
|
+
- Block IDs are UUIDs — always get them from \`list_blocks\` or \`search_blocks\` first
|
|
197
|
+
- Room IDs are Matrix room identifiers with format \`!<id>:<homeserver>\` (e.g., \`!oeGkcJIKNpeSiaGHVE:devmx.ixo.earth\`). Always use them exactly as provided — never strip the \`!\` prefix or modify the format.
|
|
198
|
+
- Changes sync automatically to all connected clients via CRDT
|
|
199
|
+
- \`read_block_by_id\` with \`evaluateConditions: true\` returns block visibility/enabled state
|
|
200
|
+
- \`read_block_by_id\` with \`resolveReferences: true\` resolves \`{{blockId.prop}}\` template patterns
|
|
201
|
+
- Survey tools work with any block type that has a surveySchema
|
|
202
|
+
- \`runtimeUpdates\` merges with existing runtime state — it never overwrites
|
|
203
|
+
|
|
204
|
+
---`;
|
|
205
|
+
export const EDITOR_DOCUMENTATION_CONTENT_READ_ONLY = `---
|
|
206
|
+
|
|
207
|
+
## Document Reading with BlockNote Tools
|
|
208
|
+
|
|
209
|
+
You have access to read-only tools for viewing collaborative documents backed by Y.js CRDT and Matrix.
|
|
210
|
+
|
|
211
|
+
### Context Awareness
|
|
212
|
+
|
|
213
|
+
When editor room is active, the **default context** for the conversation is the editor document content.
|
|
214
|
+
|
|
215
|
+
**Default Behavior:**
|
|
216
|
+
- The editor document is the **primary context** for all interactions
|
|
217
|
+
- When the user uses ambiguous references like "this", "that", "explain this", etc., **automatically call \\\`read_flow_context\\\` then \\\`list_blocks\\\`** to see what they're referring to
|
|
218
|
+
- General questions should still be answered, but editor context takes precedence
|
|
219
|
+
|
|
220
|
+
### Context & Status Tools
|
|
221
|
+
|
|
222
|
+
- \`read_flow_context\` — **CALL FIRST**: flow metadata, owner DID, doc type, schema version, block/node counts
|
|
223
|
+
- \`read_flow_status\` — execution state of flow nodes, runtime state (who did what, when, evaluation status)
|
|
224
|
+
- \`read_block_history\` — audit trail + UCAN invocations for a specific block
|
|
225
|
+
- \`read_permissions\` — UCAN **delegations** (who has what capabilities). For inspection only.
|
|
226
|
+
- \`mint_invocation\` (when available) — **fresh single-use invocation** against an external UCAN-gated service. Pass \`delegationCid\` (the tool resolves the CAR from the flow's Y.Doc — you never paste a long base64 string), \`serviceUrl\`, and the route's \`can\` + \`withResource\`. Returns \`{ blobId, invocation, ... }\` — return verbatim so the caller can pass \`blobId\` to \`sandbox_write_blob\`. Single-use; re-mint per call.
|
|
227
|
+
|
|
228
|
+
### Block Tools
|
|
229
|
+
|
|
230
|
+
- \`list_blocks\` — all blocks with IDs, types, properties, and content
|
|
231
|
+
- \`read_block_by_id\` — single block detail including runtime state (optional: \`evaluateConditions\`, \`resolveReferences\`)
|
|
232
|
+
- \`search_blocks\` — find blocks by type, property value, or text content
|
|
233
|
+
|
|
234
|
+
### Page Tools
|
|
235
|
+
|
|
236
|
+
- \`read_page\` — read the current page metadata (title, owner, creation date) and all blocks. Use this instead of \`list_blocks\` when you need page-level info alongside blocks.
|
|
237
|
+
|
|
238
|
+
### Survey Tools (read-only)
|
|
239
|
+
|
|
240
|
+
- \`read_survey\` — survey structure, current answers, missing required fields
|
|
241
|
+
- \`validate_survey_answers\` — check completeness and validity
|
|
242
|
+
|
|
243
|
+
**READ-ONLY MODE**: Write operations (\`edit_block\`, \`create_block\`, \`delete_block\`, \`fill_survey_answers\`, \`update_page\`, \`create_page\`) are disabled.
|
|
244
|
+
|
|
245
|
+
### Block Props vs Runtime State
|
|
246
|
+
|
|
247
|
+
Each block has two data stores:
|
|
248
|
+
- **Block properties**: structural data (status, title, surveySchema, answers, etc.)
|
|
249
|
+
- **Runtime state**: execution metadata (evaluation status, timestamps, claim data, etc.)
|
|
250
|
+
|
|
251
|
+
\`read_block_by_id\` returns both automatically. Block types and their properties may evolve — always inspect actual data rather than assuming fixed schemas.
|
|
252
|
+
|
|
253
|
+
### Recommended Workflows
|
|
254
|
+
|
|
255
|
+
**"What's the status?"** → \`read_flow_context\` → \`read_flow_status\`
|
|
256
|
+
|
|
257
|
+
**"What happened?"** → \`read_block_by_id\` (for current state) → \`read_block_history\` (for audit trail)
|
|
258
|
+
|
|
259
|
+
**"Who can do X?"** → \`read_permissions\` with optional DID/capability filter
|
|
260
|
+
|
|
261
|
+
**"Show me the form"** → \`list_blocks\` → \`read_survey\` → \`validate_survey_answers\`
|
|
262
|
+
|
|
263
|
+
### Important Notes
|
|
264
|
+
|
|
265
|
+
- Block IDs are UUIDs returned from \`list_blocks\` or \`search_blocks\`
|
|
266
|
+
- \`read_block_by_id\` with \`evaluateConditions: true\` returns block visibility/enabled state
|
|
267
|
+
- \`read_block_by_id\` with \`resolveReferences: true\` resolves \`{{blockId.prop}}\` template patterns
|
|
268
|
+
- Survey tools work with any block type that has a surveySchema
|
|
269
|
+
|
|
270
|
+
---`;
|
|
271
|
+
/**
|
|
272
|
+
* Main agent prompts for editor mode (editorRoomId present — page open in UI).
|
|
273
|
+
* operationalMode: injected into the "Operational Mode & Context Priority" section.
|
|
274
|
+
* editorSection: injected into the lower "Editor Agent" section (agent desc + tools docs + skill pipeline).
|
|
275
|
+
*/
|
|
276
|
+
export const EDITOR_MODE_PROMPTS = {
|
|
277
|
+
operationalMode: `**🔴 EDITOR MODE ACTIVE**
|
|
278
|
+
|
|
279
|
+
You are currently operating in **Editor Mode**. This means:
|
|
280
|
+
|
|
281
|
+
- **The editor document is your PRIMARY context** - Most questions and requests will relate to the document content
|
|
282
|
+
- **Default assumption**: When users ask ambiguous questions (like "what is this?", "explain this", "can you help with this?"), they are referring to content in the editor document
|
|
283
|
+
- **First action**: Always use the Editor Agent tool with a task to call \`list_blocks\` to understand the document structure before responding
|
|
284
|
+
- **Editor context takes precedence** over entity context or general conversation
|
|
285
|
+
- The Editor Agent tool is your primary way to understand and work with the document
|
|
286
|
+
|
|
287
|
+
**Workflow in Editor Mode:**
|
|
288
|
+
1. When a question is ambiguous or unclear, start by using the Editor Agent tool with a task to call \`list_blocks\`
|
|
289
|
+
2. Review the document structure and content
|
|
290
|
+
3. Answer questions based on what you find in the document
|
|
291
|
+
4. If the question is clearly about something else (not the document), handle it normally
|
|
292
|
+
|
|
293
|
+
**Block Update Responses:**
|
|
294
|
+
After updating blocks (status changes, credential writes, URL updates, any edit_block operation), you MUST respond with a confirmation message describing what was changed. Example: "I've updated the verification block — status is now credential_ready and the credential has been stored." Never refuse to confirm a completed block update.
|
|
295
|
+
|
|
296
|
+
**Page Context Switches:**
|
|
297
|
+
The user can switch pages in the UI at any time. When this happens you may receive
|
|
298
|
+
a system marker message identifying the new and previous pages (with titles if available).
|
|
299
|
+
Always favour the current active page — tool results are the source of truth, not
|
|
300
|
+
conversation history.
|
|
301
|
+
|
|
302
|
+
**When the Editor Agent reports a page mismatch before editing:**
|
|
303
|
+
You MUST confirm with the user before proceeding with writes. Include the page title
|
|
304
|
+
the Editor Agent found so the user knows which page is active. Example:
|
|
305
|
+
"It looks like you've switched to the page '[page title]'. Should I go ahead and
|
|
306
|
+
[requested action] on this page instead?"
|
|
307
|
+
For read-only operations (reading, listing, summarizing), always proceed without
|
|
308
|
+
confirmation — only pause when about to write or edit.
|
|
309
|
+
|
|
310
|
+
**Page Management:**
|
|
311
|
+
- **Create page:** Delegate to the Editor Agent — it has the \`create_page\` tool. Example: call_editor_agent with "Create a new page titled 'Meeting Notes' with the following content: ..."
|
|
312
|
+
- **List pages:** Use the \`list_workspace_pages\` browser tool to list all pages in the user's workspace. This runs on the client side and returns page names, room IDs, and types.
|
|
313
|
+
- **Edit/read a specific page by name:** When the user asks to edit or read a page and you don't have its room ID:
|
|
314
|
+
1. Call \`list_workspace_pages\` (browser tool) to find the page by name and get its room ID
|
|
315
|
+
2. Use the Memory Agent to gather any prior context about that page (past edits, content history)
|
|
316
|
+
3. Use \`read_page\` with the discovered room ID to load the content
|
|
317
|
+
4. Proceed with the requested operation
|
|
318
|
+
|
|
319
|
+
### Transferring Sandbox Skill Output to Blocks
|
|
320
|
+
|
|
321
|
+
When a sandbox skill produces output with long opaque values (JWTs, credentials, tokens, base64 data, long URLs), **do NOT** read the output and manually pass values through edit_block — LLM text generation truncates long strings.
|
|
322
|
+
|
|
323
|
+
Instead, use \`apply_sandbox_output_to_block\`:
|
|
324
|
+
1. Run the skill in sandbox (\`sandbox_run\`) — ensure output is written to a JSON file
|
|
325
|
+
2. Call \`list_blocks\` (via Editor Agent) to get the target block UUID
|
|
326
|
+
3. Call \`apply_sandbox_output_to_block\` with the file path and block UUID
|
|
327
|
+
4. Values are transferred server-side — never passing through LLM generation
|
|
328
|
+
|
|
329
|
+
**For action blocks:** Use dot-notation \`fieldMapping\` to nest values into the \`inputs\` JSON-string prop:
|
|
330
|
+
- Entire file as one input field: \`{"fieldMapping": {".": "inputs.credential"}}\`
|
|
331
|
+
- Multiple fields: \`{"fieldMapping": {"credential": "inputs.credential", "roomId": "inputs.roomId"}}\`
|
|
332
|
+
- Do NOT use direct transfer (no fieldMapping) on action blocks — it spreads fields as top-level props.
|
|
333
|
+
|
|
334
|
+
Use this for any value longer than ~200 characters or any encoded/opaque data.
|
|
335
|
+
Short values (statuses, names) can still be set via the Editor Agent's \`edit_block\`.`,
|
|
336
|
+
editorSection: `### Editor Agent
|
|
337
|
+
Primary tool for document and page operations. Use \`call_editor_agent\` to read, edit, and manage pages and blocks.
|
|
338
|
+
|
|
339
|
+
**⚠️ The Editor Agent is a subagent — it has NO access to your conversation context.**
|
|
340
|
+
Every task you send MUST be self-contained and specific:
|
|
341
|
+
- Include all relevant details: block IDs, property names, exact values, page title, what to do.
|
|
342
|
+
- NEVER send vague tasks like "do what the user asked", "update the blocks", or "continue".
|
|
343
|
+
- NEVER send an empty or near-empty task — the editor agent will have no idea what to do.
|
|
344
|
+
- BAD: "Update the page" / "Fix the content" / "Do the edits"
|
|
345
|
+
- GOOD: "Use read_page to read the current page, then use edit_block on block UUID abc-123 to set the status property to 'completed'"
|
|
346
|
+
- GOOD: "List all blocks, find the heading block with text 'Introduction', and update its text to 'Getting Started'"
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
${EDITOR_DOCUMENTATION_CONTENT}
|
|
351
|
+
|
|
352
|
+
## Skill Output → Block Update Pipeline
|
|
353
|
+
|
|
354
|
+
When a skill execution (via sandbox_run) produces results that should update editor blocks, follow this deterministic workflow:
|
|
355
|
+
|
|
356
|
+
### Post-Skill Update Flow
|
|
357
|
+
|
|
358
|
+
After ANY successful sandbox_run or skill execution:
|
|
359
|
+
|
|
360
|
+
1. **Check if the output contains block-relevant data**: URLs, status values, identifiers, credentials, or any key-value pairs that map to block properties.
|
|
361
|
+
|
|
362
|
+
2. **If yes, IMMEDIATELY call the Editor Agent** with explicit instructions. Do not ask the user. Do not explain first. Just update.
|
|
363
|
+
|
|
364
|
+
3. **Your Editor Agent task MUST include exact values:**
|
|
365
|
+
- BAD: "Update the block with the skill results"
|
|
366
|
+
- GOOD: "Use list_blocks to find the flowLink block. Then call edit_block on that block with updates: {links: [{id: 'link-1', title: 'Verify Identity', description: 'Click to verify', captionText: '', position: 0, externalUrl: 'https://exact-url-from-skill-output'}]}"
|
|
367
|
+
|
|
368
|
+
4. **Copy URLs and identifiers verbatim** from the skill output into your Editor Agent query.
|
|
369
|
+
|
|
370
|
+
5. **After the block is updated**, THEN respond to the user with a **confirmation summary** of what changed. For example: "Done — I've updated the KYC block with the credential and set the status to credential_ready."
|
|
371
|
+
|
|
372
|
+
### CRITICAL Rules
|
|
373
|
+
- Never respond to the user with skill results without first updating relevant blocks
|
|
374
|
+
- Never ask "should I update the block?" — just update it
|
|
375
|
+
- Never paraphrase URLs or identifiers — pass them exactly as received from the skill
|
|
376
|
+
- **Never output a refusal or apology after tool calls succeed.** If your tools (sandbox_run, apply_sandbox_output_to_block, call_editor_agent) executed without errors, the operation worked. Respond with what was accomplished. "I'm sorry, but I can't provide that information" after a successful tool chain is ALWAYS wrong.
|
|
377
|
+
|
|
378
|
+
#### UCAN Permissions vs. Invocations
|
|
379
|
+
|
|
380
|
+
Three editor-agent tools exist for UCAN data — pick the correct one:
|
|
381
|
+
|
|
382
|
+
- **\`read_permissions\`** — reads UCAN **delegations** (the static "who is allowed to do what" records). Use when the question is about who has permission, or when you need to inspect / display the delegation chain. Do NOT use this just to fetch a delegation CAR for minting — \`mint_invocation\` does the lookup itself.
|
|
383
|
+
- **\`read_invocations\`** (when available) — reads previously-minted invocations from the audit trail. Use when the prompt explicitly references an invocation CID, or when displaying invocation history. **Not** the right tool for getting a fresh single-use token — for that, mint a new one.
|
|
384
|
+
- **\`mint_invocation\`** — produces a fresh, single-use UCAN invocation against a UCAN-gated service. **This is the tool to use whenever a skill needs to authenticate against an external worker.** It lives on the editor agent (it needs Y.Doc access to look up the user's signed delegation by CID without round-tripping a long base64 string through the LLM), so you reach it via \`call_editor_agent\` with a self-contained task that names the tool and its args. Pass:
|
|
385
|
+
- \`delegationCid\` — from the companion prompt (\`UCAN delegation CID: bafy…\`). Always pass the CID; never the CAR string itself.
|
|
386
|
+
- \`serviceUrl\` — the worker base URL from the prompt. The audience DID is auto-resolved via \`<serviceUrl>/.well-known/did.json\`.
|
|
387
|
+
- \`can\` and \`withResource\` — the route-specific capability the skill's docs define.
|
|
388
|
+
The tool returns \`{ success: true, blobId: "blob_<hex>", invocation: "<base64 CAR>", ... }\`.
|
|
389
|
+
|
|
390
|
+
**Use \`blobId\` — not \`invocation\` — to write the token to the sandbox.** Call \`sandbox_write_blob({ blobId, path: "/workspace/data/<skill>/ucan_token" })\`. The runtime looks up the value server-side and writes it via \`sandbox_write_file\` for you, so the long base64 CAR never enters this conversation and can't be corrupted in relay. Then run the protected command in the sandbox. Mint a fresh invocation per protected call — invocations are single-use; reusing one triggers a REPLAY rejection.
|
|
391
|
+
|
|
392
|
+
The \`invocation\` field is the same value verbatim, kept only for back-compat / debugging — do NOT paste it into \`sandbox_write_file\` arguments. The blob expires shortly after minting (TTL ~90s), so call \`sandbox_write_blob\` immediately after \`mint_invocation\`. If the write returns "blob not found", just re-mint and retry.
|
|
393
|
+
|
|
394
|
+
A delegation is **not** a substitute for an invocation. If a worker rejects the request, do NOT send the raw delegation in its place — re-mint via \`mint_invocation\`.`,
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Main agent prompts for standalone editor mode (spaceId present, no editorRoomId).
|
|
398
|
+
* The agent can open any page by room ID via call_editor_agent.
|
|
399
|
+
*/
|
|
400
|
+
export const STANDALONE_EDITOR_PROMPTS = {
|
|
401
|
+
operationalMode: `**Page Editor Available**
|
|
402
|
+
|
|
403
|
+
You have \`call_editor_agent\` which starts an Editor Agent subagent for any page by room ID. The subagent has full block-level editing capabilities and page management tools.
|
|
404
|
+
|
|
405
|
+
**⚠️ Pages are BlockNote documents — NOT entities.** Pages are collaborative documents in the user's workspace. They are completely separate from IXO blockchain entities. NEVER use the Domain Indexer Agent for page operations — it has no knowledge of pages. ALL page operations (list, read, edit, create, update) go through \`list_workspace_pages\` and \`call_editor_agent\`.
|
|
406
|
+
|
|
407
|
+
**Workflow for ANY page-related request (read, edit, update, create, list):**
|
|
408
|
+
1. Use \`list_workspace_pages\` (browser tool) to discover pages and their room IDs
|
|
409
|
+
2. Call \`call_editor_agent\` with the \`room_id\` and your editing \`task\`
|
|
410
|
+
3. The editor agent has full capabilities: list/edit/create/delete blocks, read/update/create pages, surveys, find-and-replace, bulk edits
|
|
411
|
+
|
|
412
|
+
**⚠️ Parameter format — room_id and task are SEPARATE fields:**
|
|
413
|
+
- \`room_id\`: ONLY the Matrix room ID string (starts with "!", contains ":"). Nothing else.
|
|
414
|
+
- \`task\`: ONLY the detailed, self-contained instruction. No room IDs here.
|
|
415
|
+
|
|
416
|
+
**Examples (correct):**
|
|
417
|
+
- \`call_editor_agent({ room_id: "!abc:server.example", task: "Read this page and summarize its content" })\`
|
|
418
|
+
- \`call_editor_agent({ room_id: "!abc:server.example", task: "Find the status block and set it to completed" })\`
|
|
419
|
+
- \`call_editor_agent({ room_id: "!abc:server.example", task: "Create a new page titled 'Meeting Notes'" })\`
|
|
420
|
+
- \`call_editor_agent({ room_id: "!abc:server.example", task: "Shorten the content by 50% while keeping key points" })\`
|
|
421
|
+
|
|
422
|
+
**Important:** Always get the room ID from \`list_workspace_pages\` first — never guess room IDs.
|
|
423
|
+
|
|
424
|
+
**Page Context Switches:**
|
|
425
|
+
The user may switch pages mid-conversation. When tool results (read_page, list_blocks)
|
|
426
|
+
return different content or a different room ID than what was discussed earlier, the
|
|
427
|
+
user has navigated to another page. Always favour the current active page.
|
|
428
|
+
If the Editor Agent reports that page content differs from what was discussed before
|
|
429
|
+
editing, confirm with the user (include the page title) before proceeding with writes.
|
|
430
|
+
Reads always proceed without confirmation.`,
|
|
431
|
+
editorSection: `### Editor Agent
|
|
432
|
+
Use \`call_editor_agent\` to open any page by room ID and run editing tasks. Discover room IDs via \`list_workspace_pages\` browser tool first.
|
|
433
|
+
|
|
434
|
+
**⚠️ The Editor Agent is a subagent — it has NO access to your conversation context.**
|
|
435
|
+
Every task must be self-contained: include block IDs, property names, exact values, and what to do.
|
|
436
|
+
Never send vague or empty tasks — the editor agent cannot infer intent from your conversation history.
|
|
437
|
+
|
|
438
|
+
#### UCAN Invocations for Skills
|
|
439
|
+
|
|
440
|
+
When a skill needs to authenticate against an external UCAN-gated service: call \`call_editor_agent\` with a task naming \`mint_invocation\` and the required args (\`delegationCid\`, \`serviceUrl\`, \`can\`, \`withResource\` — all from the companion prompt). The tool returns \`{ blobId, invocation, ... }\`. **Use \`blobId\` — pass it to \`sandbox_write_blob({ blobId, path: "/workspace/data/<skill>/ucan_token" })\`** so the runtime writes the value via \`sandbox_write_file\` without the long base64 CAR ever entering this conversation. Single-use; re-mint per protected call; expire ~90s so write the blob immediately. On "blob not found", re-mint and retry.`,
|
|
441
|
+
};
|
|
442
|
+
export const editorAgentPrompt = `
|
|
443
|
+
${sharedExpectations}
|
|
444
|
+
|
|
445
|
+
${EDITOR_DOCUMENTATION_CONTENT}
|
|
446
|
+
`.trim();
|
|
447
|
+
export const editorAgentReadOnlyPrompt = `
|
|
448
|
+
${sharedExpectations}
|
|
449
|
+
|
|
450
|
+
${EDITOR_DOCUMENTATION_CONTENT_READ_ONLY}
|
|
451
|
+
`.trim();
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { MatrixProvider } from '@ixo/matrix-crdt';
|
|
2
|
+
import type { MatrixClient } from 'matrix-js-sdk';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
export interface ProviderInitResult {
|
|
5
|
+
doc: Y.Doc;
|
|
6
|
+
awareness?: unknown;
|
|
7
|
+
provider: MatrixProvider;
|
|
8
|
+
}
|
|
9
|
+
export interface MatrixRoomById {
|
|
10
|
+
type: 'id';
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
export interface MatrixRoomByAlias {
|
|
14
|
+
type: 'alias';
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ProviderConfig {
|
|
18
|
+
docName: string;
|
|
19
|
+
enableAwareness: boolean;
|
|
20
|
+
retryAttempts: number;
|
|
21
|
+
retryDelayMs: number;
|
|
22
|
+
}
|
|
23
|
+
export type MatrixRoomConfig = MatrixRoomById | MatrixRoomByAlias;
|
|
24
|
+
export interface MatrixConfig {
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
accessToken: string;
|
|
27
|
+
userId: string;
|
|
28
|
+
room: MatrixRoomConfig;
|
|
29
|
+
initialSyncTimeoutMs: number;
|
|
30
|
+
}
|
|
31
|
+
export interface BlockNoteConfig {
|
|
32
|
+
defaultBlockId?: string;
|
|
33
|
+
blockNamespace?: string;
|
|
34
|
+
mutableAttributeKeys: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface AppConfig {
|
|
37
|
+
matrix: MatrixConfig;
|
|
38
|
+
provider: ProviderConfig;
|
|
39
|
+
blocknote: BlockNoteConfig;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* MatrixProviderManager
|
|
43
|
+
*
|
|
44
|
+
* Manages a Y.Doc CRDT for a specific Matrix room.
|
|
45
|
+
*
|
|
46
|
+
* IMPORTANT: This class assumes the Matrix client is ALREADY synced
|
|
47
|
+
* via the EditorMatrixClient singleton. It does NOT manage client lifecycle.
|
|
48
|
+
*
|
|
49
|
+
* Each instance creates:
|
|
50
|
+
* - A new Y.Doc for the room
|
|
51
|
+
* - A MatrixProvider to sync Y.Doc with Matrix
|
|
52
|
+
*
|
|
53
|
+
* The singleton EditorMatrixClient handles:
|
|
54
|
+
* - Matrix connection
|
|
55
|
+
* - Background sync
|
|
56
|
+
* - Client lifecycle
|
|
57
|
+
*/
|
|
58
|
+
export declare class MatrixProviderManager {
|
|
59
|
+
private readonly matrixClient;
|
|
60
|
+
private readonly cfg;
|
|
61
|
+
private readonly doc;
|
|
62
|
+
private provider;
|
|
63
|
+
private readonly disposables;
|
|
64
|
+
private documentAvailable;
|
|
65
|
+
private disposed;
|
|
66
|
+
private availabilityResolvers;
|
|
67
|
+
constructor(matrixClient: MatrixClient, cfg: AppConfig);
|
|
68
|
+
get ydoc(): Y.Doc;
|
|
69
|
+
get matrixProvider(): MatrixProvider | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Initialize the provider for the configured room.
|
|
72
|
+
*
|
|
73
|
+
* Assumes the Matrix client is already synced (via EditorMatrixClient singleton).
|
|
74
|
+
* Creates a MatrixProvider to sync the Y.Doc with the Matrix room.
|
|
75
|
+
*/
|
|
76
|
+
init(): Promise<ProviderInitResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Ensures the room is available in the Matrix client's store.
|
|
79
|
+
* This is critical for createMessagesRequest() to work correctly.
|
|
80
|
+
*/
|
|
81
|
+
private ensureRoomAvailable;
|
|
82
|
+
private initializeProvider;
|
|
83
|
+
private waitForAvailability;
|
|
84
|
+
private registerProviderListeners;
|
|
85
|
+
private cleanupProviderListeners;
|
|
86
|
+
private resolveRoomDescriptor;
|
|
87
|
+
private ensureProvider;
|
|
88
|
+
/**
|
|
89
|
+
* Dispose of this provider manager.
|
|
90
|
+
*
|
|
91
|
+
* Cleans up:
|
|
92
|
+
* - MatrixProvider (stops polling, removes listeners)
|
|
93
|
+
* - Y.Doc (destroys local document state)
|
|
94
|
+
*
|
|
95
|
+
* Does NOT touch the Matrix client - it's managed by EditorMatrixClient singleton
|
|
96
|
+
* and shared across all providers/rooms.
|
|
97
|
+
*/
|
|
98
|
+
dispose(): Promise<void>;
|
|
99
|
+
private cleanupProvider;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/plugins/editor/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAgBzB,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;IACX,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC;CAC1B;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AACD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,iBAAiB,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,gBAAgB,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AACD,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,qBAAqB;IAS9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG;IATtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,qBAAqB,CAAyB;gBAGnC,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,SAAS;IAKjC,IAAW,IAAI,IAAI,CAAC,CAAC,GAAG,CAEvB;IAED,IAAW,cAAc,IAAI,cAAc,GAAG,SAAS,CAEtD;IAED;;;;;OAKG;IACU,IAAI,IAAI,OAAO,CAAC,kBAAkB,CAAC;IA6ChD;;;OAGG;YACW,mBAAmB;YA+BnB,kBAAkB;IA4ChC,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,yBAAyB;IAgCjC,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,cAAc;IAOtB;;;;;;;;;OASG;IACU,OAAO;YAmBN,eAAe;CAoB9B"}
|