@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,62 @@
|
|
|
1
|
+
import { summarizationMiddleware } from 'langchain';
|
|
2
|
+
/**
|
|
3
|
+
* IXO-flavoured prompt instructing the summarizer to preserve identifiers
|
|
4
|
+
* verbatim (DIDs, room IDs, addresses, hashes, URLs, etc.). Replaces the
|
|
5
|
+
* default LangChain summary prompt without changing the wider trigger logic.
|
|
6
|
+
*/
|
|
7
|
+
const SUMMARY_PROMPT = `<role>
|
|
8
|
+
Context Extraction Assistant
|
|
9
|
+
</role>
|
|
10
|
+
|
|
11
|
+
<primary_objective>
|
|
12
|
+
Extract the most important context from the conversation history below. This extracted context will REPLACE the full conversation history, so capture everything the agent needs to continue working effectively.
|
|
13
|
+
</primary_objective>
|
|
14
|
+
|
|
15
|
+
<critical_identifiers>
|
|
16
|
+
You MUST preserve ALL of the following VERBATIM — copy them exactly as they appear:
|
|
17
|
+
- DIDs (decentralized identifiers, e.g. did:ixo:..., did:x:..., did:key:...)
|
|
18
|
+
- Matrix Room IDs (e.g. !abc123:matrix.ixo.world)
|
|
19
|
+
- Wallet/account addresses (e.g. ixo1..., cosmos1...)
|
|
20
|
+
- Session IDs, thread IDs, or checkpoint IDs
|
|
21
|
+
- Blockchain transaction hashes or entity IDs
|
|
22
|
+
- Any URLs, endpoints, or API paths referenced
|
|
23
|
+
- Block IDs (UUIDs) from document editing
|
|
24
|
+
Do NOT paraphrase, abbreviate, or omit any of these identifiers.
|
|
25
|
+
</critical_identifiers>
|
|
26
|
+
|
|
27
|
+
<what_to_extract>
|
|
28
|
+
1. **Active task**: What is the agent currently working on? What was the user's most recent request?
|
|
29
|
+
2. **Key decisions & outcomes**: What has been decided or completed so far?
|
|
30
|
+
3. **Pending actions**: What still needs to be done?
|
|
31
|
+
4. **Important data**: Any structured data, configurations, or parameters the agent was working with
|
|
32
|
+
5. **All identifiers**: Every DID, room ID, address, hash listed above — verbatim
|
|
33
|
+
6. **Tool results**: Key outputs from tool calls that inform next steps
|
|
34
|
+
7. **Errors or blockers**: Any issues encountered that are still relevant
|
|
35
|
+
</what_to_extract>
|
|
36
|
+
|
|
37
|
+
<format>
|
|
38
|
+
Structure the extracted context clearly with sections. Be concise but complete — the agent will lose all context not captured here.
|
|
39
|
+
Respond ONLY with the extracted context. No preamble, no explanation.
|
|
40
|
+
</format>
|
|
41
|
+
|
|
42
|
+
<messages>
|
|
43
|
+
Messages to summarize:
|
|
44
|
+
{messages}
|
|
45
|
+
</messages>`;
|
|
46
|
+
const SUMMARY_PREFIX = 'Here is a summary of the conversation to date:';
|
|
47
|
+
const DEFAULT_TRIGGER_MESSAGES = 20;
|
|
48
|
+
const DEFAULT_KEEP_MESSAGES = 10;
|
|
49
|
+
/**
|
|
50
|
+
* Wraps LangChain's built-in `summarizationMiddleware` with the IXO-specific
|
|
51
|
+
* summary prompt + prefix. Pass any compatible chat model — typically the
|
|
52
|
+
* cheap "routing" role.
|
|
53
|
+
*/
|
|
54
|
+
export const createSummarizationMiddleware = (options) => {
|
|
55
|
+
return summarizationMiddleware({
|
|
56
|
+
model: options.model,
|
|
57
|
+
summaryPrompt: SUMMARY_PROMPT,
|
|
58
|
+
summaryPrefix: SUMMARY_PREFIX,
|
|
59
|
+
trigger: { messages: options.triggerMessages ?? DEFAULT_TRIGGER_MESSAGES },
|
|
60
|
+
keep: { messages: options.keepMessages ?? DEFAULT_KEEP_MESSAGES },
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AgentMiddleware } from 'langchain';
|
|
2
|
+
import type { Logger } from '../../plugin-api/types.js';
|
|
3
|
+
export interface ToolRepetitionGuardMiddlewareOptions {
|
|
4
|
+
/**
|
|
5
|
+
* How many messages back to scan for a prior identical failed call.
|
|
6
|
+
* Default 20 — enough to catch in-turn loops without trawling whole histories.
|
|
7
|
+
*/
|
|
8
|
+
lookback?: number;
|
|
9
|
+
/** Optional logger; defaults to a no-op. */
|
|
10
|
+
logger?: Logger;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Detects when the agent issues the same `(toolName, args)` pair after that
|
|
14
|
+
* exact call already failed inside the recent window, and short-circuits
|
|
15
|
+
* before the tool is invoked again. The short-circuit message quotes the
|
|
16
|
+
* earlier error and tells the model to change tools/args instead.
|
|
17
|
+
*
|
|
18
|
+
* Why this exists: in-turn retry loops where the LLM ignores a tool's error
|
|
19
|
+
* envelope and re-issues the identical call. The existing
|
|
20
|
+
* `toolRetryMiddleware` retries inside one call; this guard prevents the
|
|
21
|
+
* model from making the *next* identical call.
|
|
22
|
+
*/
|
|
23
|
+
export declare const createToolRepetitionGuardMiddleware: (options?: ToolRepetitionGuardMiddlewareOptions) => AgentMiddleware;
|
|
24
|
+
//# sourceMappingURL=tool-repetition-guard-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-repetition-guard-middleware.d.ts","sourceRoot":"","sources":["../../../src/graph/middlewares/tool-repetition-guard-middleware.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAQxD,MAAM,WAAW,oCAAoC;IACnD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mCAAmC,GAC9C,UAAS,oCAAyC,KACjD,eAiDF,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { AIMessage, ToolMessage, } from '@langchain/core/messages';
|
|
2
|
+
import { createMiddleware } from 'langchain';
|
|
3
|
+
const NOOP_LOGGER = {
|
|
4
|
+
log: () => undefined,
|
|
5
|
+
warn: () => undefined,
|
|
6
|
+
error: () => undefined,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Detects when the agent issues the same `(toolName, args)` pair after that
|
|
10
|
+
* exact call already failed inside the recent window, and short-circuits
|
|
11
|
+
* before the tool is invoked again. The short-circuit message quotes the
|
|
12
|
+
* earlier error and tells the model to change tools/args instead.
|
|
13
|
+
*
|
|
14
|
+
* Why this exists: in-turn retry loops where the LLM ignores a tool's error
|
|
15
|
+
* envelope and re-issues the identical call. The existing
|
|
16
|
+
* `toolRetryMiddleware` retries inside one call; this guard prevents the
|
|
17
|
+
* model from making the *next* identical call.
|
|
18
|
+
*/
|
|
19
|
+
export const createToolRepetitionGuardMiddleware = (options = {}) => {
|
|
20
|
+
const logger = options.logger ?? NOOP_LOGGER;
|
|
21
|
+
const lookback = options.lookback ?? 20;
|
|
22
|
+
return createMiddleware({
|
|
23
|
+
name: 'ToolRepetitionGuardMiddleware',
|
|
24
|
+
wrapToolCall: async (toolCallRequest, handler) => {
|
|
25
|
+
const { toolCall, state } = toolCallRequest;
|
|
26
|
+
const toolName = toolCall.name ?? toolCallRequest.tool?.name;
|
|
27
|
+
if (!toolName)
|
|
28
|
+
return handler(toolCallRequest);
|
|
29
|
+
const argsKey = canonicalArgsKey(toolCall.args);
|
|
30
|
+
const messages = state.messages ?? [];
|
|
31
|
+
const start = Math.max(0, messages.length - lookback);
|
|
32
|
+
for (let i = messages.length - 1; i >= start; i--) {
|
|
33
|
+
const msg = messages[i];
|
|
34
|
+
if (!(msg instanceof ToolMessage))
|
|
35
|
+
continue;
|
|
36
|
+
if (msg.status !== 'error')
|
|
37
|
+
continue;
|
|
38
|
+
if (msg.name !== toolName)
|
|
39
|
+
continue;
|
|
40
|
+
const priorArgs = findToolCallArgsById(messages, msg.tool_call_id);
|
|
41
|
+
if (priorArgs === undefined)
|
|
42
|
+
continue;
|
|
43
|
+
if (canonicalArgsKey(priorArgs) !== argsKey)
|
|
44
|
+
continue;
|
|
45
|
+
const priorError = toolMessageText(msg);
|
|
46
|
+
logger.warn(`Repetition guard: short-circuiting duplicate failed call to ${toolName}`, { toolName, priorError });
|
|
47
|
+
return new ToolMessage({
|
|
48
|
+
content: [
|
|
49
|
+
`You already called \`${toolName}\` with these exact arguments earlier in this turn and it failed with:`,
|
|
50
|
+
'',
|
|
51
|
+
priorError,
|
|
52
|
+
'',
|
|
53
|
+
'Do NOT repeat the same call. Read the error message, then either:',
|
|
54
|
+
'- change the arguments to satisfy the constraint the error describes, OR',
|
|
55
|
+
'- pick a different tool that fits the constraint.',
|
|
56
|
+
].join('\n'),
|
|
57
|
+
tool_call_id: toolCall.id ?? '',
|
|
58
|
+
name: toolName,
|
|
59
|
+
status: 'error',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return handler(toolCallRequest);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
function canonicalArgsKey(args) {
|
|
67
|
+
if (args === null || args === undefined)
|
|
68
|
+
return 'null';
|
|
69
|
+
if (typeof args !== 'object')
|
|
70
|
+
return JSON.stringify(args);
|
|
71
|
+
if (Array.isArray(args)) {
|
|
72
|
+
return `[${args.map(canonicalArgsKey).join(',')}]`;
|
|
73
|
+
}
|
|
74
|
+
const obj = args;
|
|
75
|
+
const keys = Object.keys(obj).sort();
|
|
76
|
+
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalArgsKey(obj[k])}`).join(',')}}`;
|
|
77
|
+
}
|
|
78
|
+
function toolMessageText(msg) {
|
|
79
|
+
const content = msg.content;
|
|
80
|
+
if (typeof content === 'string')
|
|
81
|
+
return content;
|
|
82
|
+
if (Array.isArray(content)) {
|
|
83
|
+
return content
|
|
84
|
+
.map((block) => {
|
|
85
|
+
if (typeof block === 'string')
|
|
86
|
+
return block;
|
|
87
|
+
if (block && typeof block === 'object' && 'text' in block) {
|
|
88
|
+
const text = block.text;
|
|
89
|
+
return typeof text === 'string' ? text : '';
|
|
90
|
+
}
|
|
91
|
+
return '';
|
|
92
|
+
})
|
|
93
|
+
.join('\n');
|
|
94
|
+
}
|
|
95
|
+
return '';
|
|
96
|
+
}
|
|
97
|
+
function findToolCallArgsById(messages, callId) {
|
|
98
|
+
if (!callId)
|
|
99
|
+
return undefined;
|
|
100
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
101
|
+
const m = messages[i];
|
|
102
|
+
if (!AIMessage.isInstance(m))
|
|
103
|
+
continue;
|
|
104
|
+
const toolCalls = m.tool_calls;
|
|
105
|
+
if (!toolCalls)
|
|
106
|
+
continue;
|
|
107
|
+
const hit = toolCalls.find((tc) => tc.id === callId);
|
|
108
|
+
if (hit)
|
|
109
|
+
return hit.args;
|
|
110
|
+
}
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type AgentMiddleware } from 'langchain';
|
|
2
|
+
import type { Logger } from '../../plugin-api/types.js';
|
|
3
|
+
export interface ToolValidationMiddlewareOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Tool names whose dangling `ToolMessage` outputs should be stripped before
|
|
6
|
+
* the next model call. These are typically sub-agent tools whose responses
|
|
7
|
+
* are summarised by their parent agent rather than being interpreted by the
|
|
8
|
+
* model directly.
|
|
9
|
+
*/
|
|
10
|
+
skipToolNames?: string[];
|
|
11
|
+
/** Optional logger; defaults to a no-op. */
|
|
12
|
+
logger?: Logger;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Catches tool validation errors (Zod / schema mismatches) and turns them
|
|
16
|
+
* into a `ToolMessage` describing the failure, so the model can recover
|
|
17
|
+
* instead of the graph crashing.
|
|
18
|
+
*
|
|
19
|
+
* Also strips `ToolMessage`s for tools listed in `skipToolNames` from the
|
|
20
|
+
* state before the next model call — used today for sub-agent tools whose
|
|
21
|
+
* structured output is consumed by their callers, not the LLM.
|
|
22
|
+
*/
|
|
23
|
+
export declare const createToolValidationMiddleware: (options?: ToolValidationMiddlewareOptions) => AgentMiddleware;
|
|
24
|
+
//# sourceMappingURL=tool-validation-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-validation-middleware.d.ts","sourceRoot":"","sources":["../../../src/graph/middlewares/tool-validation-middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAiC,MAAM,WAAW,CAAC;AAChF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAQxD,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,GACzC,UAAS,+BAAoC,KAC5C,eAuDF,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createMiddleware, ToolMessage } from 'langchain';
|
|
2
|
+
const NOOP_LOGGER = {
|
|
3
|
+
log: () => undefined,
|
|
4
|
+
warn: () => undefined,
|
|
5
|
+
error: () => undefined,
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Catches tool validation errors (Zod / schema mismatches) and turns them
|
|
9
|
+
* into a `ToolMessage` describing the failure, so the model can recover
|
|
10
|
+
* instead of the graph crashing.
|
|
11
|
+
*
|
|
12
|
+
* Also strips `ToolMessage`s for tools listed in `skipToolNames` from the
|
|
13
|
+
* state before the next model call — used today for sub-agent tools whose
|
|
14
|
+
* structured output is consumed by their callers, not the LLM.
|
|
15
|
+
*/
|
|
16
|
+
export const createToolValidationMiddleware = (options = {}) => {
|
|
17
|
+
const logger = options.logger ?? NOOP_LOGGER;
|
|
18
|
+
const skipToolNames = new Set(options.skipToolNames ?? []);
|
|
19
|
+
return createMiddleware({
|
|
20
|
+
name: 'ToolValidationMiddleware',
|
|
21
|
+
wrapToolCall: async (toolCallRequest, handler) => {
|
|
22
|
+
const { toolCall } = toolCallRequest;
|
|
23
|
+
try {
|
|
24
|
+
return await handler(toolCallRequest);
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
const errorMessage = error instanceof Error ? error.message : '';
|
|
28
|
+
const isSchemaError = errorMessage.includes('did not match expected schema') ||
|
|
29
|
+
errorMessage.includes('Received tool input did not match') ||
|
|
30
|
+
errorMessage.includes('schema') ||
|
|
31
|
+
(error instanceof Error && error.name === 'ZodError');
|
|
32
|
+
if (!isSchemaError)
|
|
33
|
+
throw error;
|
|
34
|
+
const toolName = toolCall.name ?? toolCallRequest.tool?.name ?? '';
|
|
35
|
+
logger.warn(`Tool validation error for ${toolName}: ${errorMessage}`, {
|
|
36
|
+
toolName,
|
|
37
|
+
toolArgs: toolCall.args,
|
|
38
|
+
error: errorMessage,
|
|
39
|
+
});
|
|
40
|
+
return new ToolMessage({
|
|
41
|
+
content: `Error: The tool "${toolName}" was called with invalid parameters. ${errorMessage}. Please check the tool's required parameters and try again with the correct format.`,
|
|
42
|
+
tool_call_id: toolCall.id ?? '',
|
|
43
|
+
name: toolName,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
beforeModel(state) {
|
|
48
|
+
if (skipToolNames.size === 0)
|
|
49
|
+
return state;
|
|
50
|
+
const toolMessage = state.messages.find((message) => message.type === 'tool');
|
|
51
|
+
if (toolMessage?.name && skipToolNames.has(toolMessage.name)) {
|
|
52
|
+
logger.log(`Tool validation middleware: ${toolMessage.name} is a skip-listed tool, removing tool messages before next model call`);
|
|
53
|
+
return {
|
|
54
|
+
...state,
|
|
55
|
+
messages: state.messages.filter((message) => message.type !== 'tool'),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return state;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { OracleIdentity, UserContextData } from '../plugin-api/types.js';
|
|
2
|
+
import type { UserPreferences } from './state.js';
|
|
3
|
+
/**
|
|
4
|
+
* Composer inputs. Each field maps 1:1 to a slot in the base template.
|
|
5
|
+
* Plugins populate them via their middlewares (e.g. operationalMode comes
|
|
6
|
+
* from a plugin that reads task-execution context); the runtime just stitches.
|
|
7
|
+
*/
|
|
8
|
+
export interface ComposePromptInput {
|
|
9
|
+
identity: OracleIdentity;
|
|
10
|
+
/** Pre-rendered Tier-1 capability block. Empty string when no eager plugins. */
|
|
11
|
+
capabilityBlock: string;
|
|
12
|
+
/** Operational-mode block — typically a multi-line string. */
|
|
13
|
+
operationalMode: string;
|
|
14
|
+
/** Editor block — empty string when no editor session is active. */
|
|
15
|
+
editorSection: string;
|
|
16
|
+
/** Composio guidance block — empty when composio isn't loaded. */
|
|
17
|
+
composioContext: string;
|
|
18
|
+
/** Slack-specific formatting constraints. Empty string for non-slack clients. */
|
|
19
|
+
slackFormattingConstraints: string;
|
|
20
|
+
/** Per-key user-secret bullet list (e.g. `- _USER_SECRET_FOO`). Empty when none. */
|
|
21
|
+
userSecretsContext: string;
|
|
22
|
+
/** User preferences rendered as bullets. Empty when not set. */
|
|
23
|
+
userPreferencesContext: string;
|
|
24
|
+
/** Memory-engine context blocks. */
|
|
25
|
+
userContext: UserContextData | undefined;
|
|
26
|
+
/** Time context (timezone + current time). */
|
|
27
|
+
timeContext: string;
|
|
28
|
+
/** Currently-viewed entity DID, if any. */
|
|
29
|
+
currentEntityDid: string;
|
|
30
|
+
/** Optional override of the oracle name (e.g. user preference `agentName`). */
|
|
31
|
+
oracleNameOverride?: string;
|
|
32
|
+
/** Degraded-services notice appended after the main prompt body. */
|
|
33
|
+
degradedServicesBlock?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The Slack constraints text. Identical to apps/app — kept here so the
|
|
37
|
+
* runtime owns its own copy and the prompt composer is self-contained.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SLACK_FORMATTING_CONSTRAINTS_CONTENT = "## Slack Formatting\n\nSlack doesn't render markdown tables. When responding in a Slack session:\n- Use bullet lists with bold labels (\"\u2022 **Name:** value\") instead of tables\n- Use numbered lists for sequential data\n- When delegating to sub-agents, ask them for list-based formatting (no tables)\n\n";
|
|
40
|
+
/** Render user preferences as a bullet list for the prompt. */
|
|
41
|
+
export declare function formatUserPreferences(prefs?: UserPreferences): string;
|
|
42
|
+
/**
|
|
43
|
+
* Build the oracle identity preamble. When `identity.prompt.opening` is set
|
|
44
|
+
* it replaces the generated text verbatim; otherwise the composer assembles
|
|
45
|
+
* a sentence from `name`/`org`/`description`. Never claims the oracle is a
|
|
46
|
+
* "companion" or "skills-native" — those framings belong to specific plugins.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildOracleSection(input: {
|
|
49
|
+
oracleName: string;
|
|
50
|
+
orgName?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
customOpening?: string;
|
|
53
|
+
}): string;
|
|
54
|
+
/**
|
|
55
|
+
* Compose the runtime's system prompt. Slots split into:
|
|
56
|
+
* - **identity** — from `OracleConfig` (custom opening or generated).
|
|
57
|
+
* - **capabilities** — author note (config.prompt.capabilities) + Tier-1 block.
|
|
58
|
+
* - **operating principles** — fixed + optional `communicationStyle` from config.
|
|
59
|
+
* - **working with files** — runtime-universal (FileProcessingService).
|
|
60
|
+
* - **context** — only populated memory sub-sections render; empty ones skipped.
|
|
61
|
+
* - **operational mode / composio / editor / slack** — existing plugin hooks.
|
|
62
|
+
*/
|
|
63
|
+
export declare function composePrompt(input: ComposePromptInput): Promise<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Format a (timezone, currentTime) pair into a stable prompt block. Public so
|
|
66
|
+
* forks driving their own `composePrompt` calls can re-use it.
|
|
67
|
+
*/
|
|
68
|
+
export declare function formatTimeContext(timezone: string | undefined, currentTime: string | undefined): string;
|
|
69
|
+
//# sourceMappingURL=prompt-composer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-composer.d.ts","sourceRoot":"","sources":["../../src/graph/prompt-composer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAclD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,cAAc,CAAC;IACzB,gFAAgF;IAChF,eAAe,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,eAAe,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,0BAA0B,EAAE,MAAM,CAAC;IACnC,oFAAoF;IACpF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oCAAoC;IACpC,WAAW,EAAE,eAAe,GAAG,SAAS,CAAC;IACzC,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,gBAAgB,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,eAAO,MAAM,oCAAoC,wTAOhD,CAAC;AAwHF,+DAA+D;AAC/D,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,MAAM,CAWrE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAmBT;AAsHD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,MAAM,CAAC,CAiCjB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,CAMR"}
|