@owox/backend 0.37.0 → 0.39.0
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/src/common/helpers/read-bounded-body.helper.d.ts +1 -0
- package/dist/src/common/helpers/read-bounded-body.helper.js +28 -0
- package/dist/src/common/scheduler/system-tasks/system-trigger-type.d.ts +3 -1
- package/dist/src/common/scheduler/system-tasks/system-trigger-type.js +2 -0
- package/dist/src/common/search/search.facade.d.ts +1 -0
- package/dist/src/config/data-source-options.config.d.ts +4 -3
- package/dist/src/config/data-source-options.config.js +10 -3
- package/dist/src/config/plugin-collections-body-parser.config.js +3 -0
- package/dist/src/data-marts/credentials/credential.types.d.ts +26 -2
- package/dist/src/data-marts/credentials/credential.types.js +18 -6
- package/dist/src/data-marts/credentials/dto/credential-api.dto.d.ts +5 -1
- package/dist/src/data-marts/credentials/dto/credential-api.dto.js +21 -0
- package/dist/src/data-marts/credentials/dto/credential.dto.d.ts +2 -1
- package/dist/src/data-marts/credentials/entities/credential.entity.d.ts +2 -1
- package/dist/src/data-marts/credentials/entities/credential.entity.js +5 -0
- package/dist/src/data-marts/credentials/facades/credential-consumer-binding.facade.impl.js +6 -1
- package/dist/src/data-marts/credentials/mappers/credential.mapper.js +2 -0
- package/dist/src/data-marts/credentials/services/builtin-credential-definitions.js +8 -0
- package/dist/src/data-marts/credentials/services/credential-external-definition-registry.service.d.ts +4 -0
- package/dist/src/data-marts/credentials/services/credential-external-definition-registry.service.js +36 -17
- package/dist/src/data-marts/credentials/services/credential-fetch.service.d.ts +8 -0
- package/dist/src/data-marts/credentials/services/credential-fetch.service.js +115 -46
- package/dist/src/data-marts/credentials/services/credential-validation-probe.service.d.ts +3 -1
- package/dist/src/data-marts/credentials/services/credential-validation-probe.service.js +10 -2
- package/dist/src/data-marts/credentials/services/credential.service.d.ts +4 -0
- package/dist/src/data-marts/credentials/services/credential.service.js +36 -0
- package/dist/src/data-marts/credentials/services/google-service-account-key.d.ts +6 -0
- package/dist/src/data-marts/credentials/services/google-service-account-key.js +46 -0
- package/dist/src/data-marts/credentials/services/google-service-account-token.service.d.ts +25 -0
- package/dist/src/data-marts/credentials/services/google-service-account-token.service.js +177 -0
- package/dist/src/data-marts/credentials/use-cases/create-credential.service.d.ts +1 -0
- package/dist/src/data-marts/credentials/use-cases/create-credential.service.js +10 -2
- package/dist/src/data-marts/credentials/use-cases/update-credential.service.d.ts +1 -0
- package/dist/src/data-marts/credentials/use-cases/update-credential.service.js +28 -4
- package/dist/src/data-marts/credentials/use-cases/validate-credential.service.js +2 -5
- package/dist/src/data-marts/data-destination-types/ee/email/services/email-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-destination-types/ee/google-chat/services/google-chat-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-report-writer.d.ts +1 -0
- package/dist/src/data-marts/data-destination-types/google-sheets/services/google-sheets-report-writer.js +13 -1
- package/dist/src/data-marts/data-destination-types/interfaces/data-destination-credentials-validator.interface.d.ts +2 -0
- package/dist/src/data-marts/data-destination-types/interfaces/data-destination-credentials-validator.interface.js +7 -0
- package/dist/src/data-marts/data-destination-types/looker-studio-connector/services/looker-studio-connector-credentials-validator.js +1 -3
- package/dist/src/data-marts/data-marts.module.js +8 -0
- package/dist/src/data-marts/data-storage-types/athena/adapters/athena-api.adapter.js +2 -1
- package/dist/src/data-marts/data-storage-types/athena/adapters/s3-api.adapter.js +5 -3
- package/dist/src/data-marts/data-storage-types/athena/services/athena-access.validator.js +2 -4
- package/dist/src/data-marts/data-storage-types/athena/utils/athena-output-location.util.d.ts +5 -0
- package/dist/src/data-marts/data-storage-types/athena/utils/athena-output-location.util.js +13 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-access.validator.js +2 -4
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-resource-location.util.d.ts +3 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-resource-location.util.js +18 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-sharded-tables.util.d.ts +1 -0
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-sharded-tables.util.js +4 -1
- package/dist/src/data-marts/data-storage-types/bigquery/services/bigquery-storage-resource-browser.service.js +12 -5
- package/dist/src/data-marts/data-storage-types/databricks/services/databricks-access.validator.js +2 -4
- package/dist/src/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.d.ts +3 -0
- package/dist/src/data-marts/data-storage-types/interfaces/data-storage-access-validator.interface.js +7 -0
- package/dist/src/data-marts/data-storage-types/interfaces/storage-resource-browser.interface.d.ts +2 -0
- package/dist/src/data-marts/data-storage-types/redshift/services/redshift-access.validator.js +2 -6
- package/dist/src/data-marts/data-storage-types/snowflake/adapters/snowflake-api.adapter.js +1 -0
- package/dist/src/data-marts/data-storage-types/snowflake/services/snowflake-access.validator.js +2 -4
- package/dist/src/data-marts/dto/domain/list-data-marts.command.d.ts +2 -1
- package/dist/src/data-marts/dto/domain/list-data-marts.command.js +3 -1
- package/dist/src/data-marts/dto/presentation/run-data-mart-request-api.dto.js +4 -2
- package/dist/src/data-marts/dto/presentation/sql-dry-run-request-api.dto.js +3 -0
- package/dist/src/data-marts/dto/presentation/storage-resources/list-storage-resources-response.dto.d.ts +2 -0
- package/dist/src/data-marts/dto/presentation/storage-resources/list-storage-resources-response.dto.js +17 -0
- package/dist/src/data-marts/errors/google-sheets-api-call.error.d.ts +6 -0
- package/dist/src/data-marts/errors/google-sheets-api-call.error.js +34 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.d.ts +13 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.impl.d.ts +9 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.impl.js +35 -0
- package/dist/src/data-marts/facades/mcp-contexts.facade.js +5 -0
- package/dist/src/data-marts/facades/mcp-data-marts.facade.d.ts +9 -0
- package/dist/src/data-marts/facades/mcp-data-marts.facade.impl.js +4 -1
- package/dist/src/data-marts/mappers/context.mapper.d.ts +4 -0
- package/dist/src/data-marts/mappers/context.mapper.js +12 -0
- package/dist/src/data-marts/search/engine/advanced-search.service.js +1 -0
- package/dist/src/data-marts/search/engine/in-memory-paginated.search.js +17 -1
- package/dist/src/data-marts/search/engine/vector-search.port.d.ts +1 -0
- package/dist/src/data-marts/services/connector/backfill-segment.d.ts +22 -0
- package/dist/src/data-marts/services/connector/backfill-segment.js +91 -0
- package/dist/src/data-marts/services/connector/connector-execution.service.d.ts +1 -0
- package/dist/src/data-marts/services/connector/connector-execution.service.js +3 -0
- package/dist/src/data-marts/services/connector/connector-executor.service.d.ts +4 -1
- package/dist/src/data-marts/services/connector/connector-executor.service.js +107 -23
- package/dist/src/data-marts/services/connector/connector-run.service.d.ts +3 -0
- package/dist/src/data-marts/services/connector/connector-run.service.js +98 -4
- package/dist/src/data-marts/services/context/context.service.d.ts +2 -0
- package/dist/src/data-marts/services/context/context.service.js +21 -0
- package/dist/src/data-marts/services/data-mart-run.service.d.ts +1 -0
- package/dist/src/data-marts/services/data-mart-run.service.js +9 -0
- package/dist/src/data-marts/services/data-mart.service.d.ts +1 -0
- package/dist/src/data-marts/services/data-mart.service.js +3 -0
- package/dist/src/data-marts/system-triggers/processors/repair-backfill-chains-processor.d.ts +14 -0
- package/dist/src/data-marts/system-triggers/processors/repair-backfill-chains-processor.js +45 -0
- package/dist/src/data-marts/use-cases/cancel-data-mart-run.service.d.ts +4 -0
- package/dist/src/data-marts/use-cases/cancel-data-mart-run.service.js +46 -1
- package/dist/src/data-marts/use-cases/list-data-marts.service.js +1 -0
- package/dist/src/data-marts/use-cases/stream-http-data.service.d.ts +0 -1
- package/dist/src/data-marts/use-cases/stream-http-data.service.js +2 -6
- package/dist/src/data-marts/use-cases/update-data-storage.service.js +7 -7
- package/dist/src/data-marts/utils/field-errors.utils.d.ts +9 -0
- package/dist/src/data-marts/utils/field-errors.utils.js +51 -0
- package/dist/src/data-marts/utils/manual-backfill-range.d.ts +52 -0
- package/dist/src/data-marts/utils/manual-backfill-range.js +110 -8
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.d.ts +1 -1
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.js +4 -0
- package/dist/src/ee/mcp/sdk/mcp-output-schema.d.ts +3 -0
- package/dist/src/ee/mcp/sdk/mcp-output-schema.js +53 -0
- package/dist/src/ee/mcp/sdk/mcp-schema-refresh.d.ts +8 -0
- package/dist/src/ee/mcp/sdk/mcp-schema-refresh.js +44 -0
- package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.d.ts +8 -1
- package/dist/src/ee/mcp/sdk/mcp-sdk-server.factory.js +35 -4
- package/dist/src/ee/mcp/tools/context-input.d.ts +6 -0
- package/dist/src/ee/mcp/tools/context-input.js +13 -0
- package/dist/src/ee/mcp/tools/data-mart-catalog.tool.d.ts +10 -2
- package/dist/src/ee/mcp/tools/data-mart-catalog.tool.js +17 -5
- package/dist/src/ee/mcp/tools/data-mart-details.tool.d.ts +5 -1
- package/dist/src/ee/mcp/tools/data-mart-details.tool.js +4 -1
- package/dist/src/ee/mcp/tools/list-contexts.tool.d.ts +131 -0
- package/dist/src/ee/mcp/tools/list-contexts.tool.js +50 -0
- package/dist/src/ee/mcp/tools/mcp-tool.providers.js +2 -0
- package/dist/src/ee/mcp/tools/search-data-marts.tool.d.ts +10 -2
- package/dist/src/ee/mcp/tools/search-data-marts.tool.js +17 -3
- package/dist/src/ee/mcp/transport/mcp-http-entry.service.js +1 -1
- package/dist/src/idp/decorators/auth-context.decorator.js +1 -0
- package/dist/src/idp/guards/idp.guard.d.ts +3 -0
- package/dist/src/idp/guards/idp.guard.js +38 -8
- package/dist/src/idp/oauth/controllers/oauth-authorization.controller.js +8 -6
- package/dist/src/idp/oauth/mcp-client-integration.d.ts +1 -0
- package/dist/src/idp/oauth/mcp-client-integration.js +15 -0
- package/dist/src/idp/ports/plugin-runtime-authorizer.port.d.ts +6 -0
- package/dist/src/idp/types/auth.types.d.ts +1 -0
- package/dist/src/migrations/1790830000000-widen-sql-dry-run-trigger-sql-column.d.ts +6 -0
- package/dist/src/migrations/1790830000000-widen-sql-dry-run-trigger-sql-column.js +21 -0
- package/dist/src/migrations/1790900000000-add-plugin-version-backend.d.ts +6 -0
- package/dist/src/migrations/1790900000000-add-plugin-version-backend.js +21 -0
- package/dist/src/migrations/1790900000001-create-plugin-action-execution.d.ts +6 -0
- package/dist/src/migrations/1790900000001-create-plugin-action-execution.js +77 -0
- package/dist/src/migrations/1791000000000-add-credential-public-metadata.d.ts +6 -0
- package/dist/src/migrations/1791000000000-add-credential-public-metadata.js +23 -0
- package/dist/src/plugin-host/collections/dto/domain/plugin-collection.types.d.ts +1 -0
- package/dist/src/plugin-host/collections/errors/plugin-collection.errors.d.ts +6 -0
- package/dist/src/plugin-host/collections/errors/plugin-collection.errors.js +19 -1
- package/dist/src/plugin-host/collections/services/plugin-collection-declaration.service.js +3 -3
- package/dist/src/plugin-host/collections/use-cases/put-plugin-collection-document.service.js +7 -0
- package/dist/src/plugin-host/constants/plugin-action-limits.d.ts +34 -0
- package/dist/src/plugin-host/constants/plugin-action-limits.js +51 -0
- package/dist/src/plugin-host/controllers/plugin-action-runtime.controller.d.ts +20 -0
- package/dist/src/plugin-host/controllers/plugin-action-runtime.controller.js +123 -0
- package/dist/src/plugin-host/controllers/plugin-credential-runtime.controller.js +11 -19
- package/dist/src/plugin-host/controllers/plugin-gallery.controller.d.ts +5 -1
- package/dist/src/plugin-host/controllers/plugin-gallery.controller.js +25 -1
- package/dist/src/plugin-host/controllers/plugin-history.controller.d.ts +10 -0
- package/dist/src/plugin-host/controllers/plugin-history.controller.js +57 -0
- package/dist/src/plugin-host/controllers/plugin-release-check.controller.d.ts +10 -0
- package/dist/src/plugin-host/controllers/plugin-release-check.controller.js +58 -0
- package/dist/src/plugin-host/dto/domain/check-plugin-release.command.d.ts +22 -0
- package/dist/src/plugin-host/dto/domain/check-plugin-release.command.js +17 -0
- package/dist/src/plugin-host/dto/domain/find-plugin-by-repository.command.d.ts +6 -0
- package/dist/src/plugin-host/dto/domain/find-plugin-by-repository.command.js +13 -0
- package/dist/src/plugin-host/dto/domain/list-plugin-history.command.d.ts +10 -0
- package/dist/src/plugin-host/dto/domain/list-plugin-history.command.js +18 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.command.d.ts +23 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.command.js +44 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.dto.d.ts +36 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.dto.js +3 -0
- package/dist/src/plugin-host/dto/domain/plugin-history.dto.d.ts +29 -0
- package/dist/src/plugin-host/dto/domain/plugin-history.dto.js +3 -0
- package/dist/src/plugin-host/dto/domain/plugin-view.dto.d.ts +1 -0
- package/dist/src/plugin-host/dto/presentation/plugin-action-api.dto.d.ts +44 -0
- package/dist/src/plugin-host/dto/presentation/plugin-action-api.dto.js +208 -0
- package/dist/src/plugin-host/dto/presentation/plugin-gallery-api.dto.d.ts +2 -0
- package/dist/src/plugin-host/dto/presentation/plugin-gallery-api.dto.js +7 -0
- package/dist/src/plugin-host/dto/presentation/plugin-history-api.dto.d.ts +29 -0
- package/dist/src/plugin-host/dto/presentation/plugin-history-api.dto.js +148 -0
- package/dist/src/plugin-host/dto/presentation/plugin-lookup-api.dto.d.ts +3 -0
- package/dist/src/plugin-host/dto/presentation/plugin-lookup-api.dto.js +22 -0
- package/dist/src/plugin-host/dto/presentation/publication-api.dto.d.ts +17 -0
- package/dist/src/plugin-host/dto/presentation/publication-api.dto.js +95 -1
- package/dist/src/plugin-host/entities/plugin-action-execution.entity.d.ts +24 -0
- package/dist/src/plugin-host/entities/plugin-action-execution.entity.js +136 -0
- package/dist/src/plugin-host/entities/plugin-version.entity.d.ts +2 -1
- package/dist/src/plugin-host/entities/plugin-version.entity.js +5 -0
- package/dist/src/plugin-host/enums/plugin-action-execution-status.enum.d.ts +9 -0
- package/dist/src/plugin-host/enums/plugin-action-execution-status.enum.js +22 -0
- package/dist/src/plugin-host/enums/release-rejection-code.enum.d.ts +3 -0
- package/dist/src/plugin-host/enums/release-rejection-code.enum.js +6 -0
- package/dist/src/plugin-host/errors/plugin-action.errors.d.ts +45 -0
- package/dist/src/plugin-host/errors/plugin-action.errors.js +70 -0
- package/dist/src/plugin-host/errors/plugin-host.errors.d.ts +6 -0
- package/dist/src/plugin-host/errors/plugin-host.errors.js +10 -1
- package/dist/src/plugin-host/filters/plugin-host-exception.filter.js +2 -2
- package/dist/src/plugin-host/mappers/plugin-action-execution.mapper.d.ts +3 -0
- package/dist/src/plugin-host/mappers/plugin-action-execution.mapper.js +22 -0
- package/dist/src/plugin-host/mappers/plugin-presentation.mapper.d.ts +22 -1
- package/dist/src/plugin-host/mappers/plugin-presentation.mapper.js +87 -1
- package/dist/src/plugin-host/plugin-host.module.js +34 -0
- package/dist/src/plugin-host/services/action-input-validator.service.d.ts +23 -0
- package/dist/src/plugin-host/services/action-input-validator.service.js +277 -0
- package/dist/src/plugin-host/services/external-credential-definition-sync.service.d.ts +3 -0
- package/dist/src/plugin-host/services/external-credential-definition-sync.service.js +47 -15
- package/dist/src/plugin-host/services/plugin-action-dispatcher.service.d.ts +13 -0
- package/dist/src/plugin-host/services/plugin-action-dispatcher.service.js +140 -0
- package/dist/src/plugin-host/services/plugin-action-execution.service.d.ts +69 -0
- package/dist/src/plugin-host/services/plugin-action-execution.service.js +239 -0
- package/dist/src/plugin-host/services/plugin-action-starter.service.d.ts +22 -0
- package/dist/src/plugin-host/services/plugin-action-starter.service.js +81 -0
- package/dist/src/plugin-host/services/plugin-audit.service.d.ts +13 -0
- package/dist/src/plugin-host/services/plugin-audit.service.js +78 -0
- package/dist/src/plugin-host/services/plugin-publication.service.d.ts +4 -0
- package/dist/src/plugin-host/services/plugin-publication.service.js +51 -23
- package/dist/src/plugin-host/services/plugin-runtime-authorizer.service.d.ts +5 -2
- package/dist/src/plugin-host/services/plugin-runtime-authorizer.service.js +31 -3
- package/dist/src/plugin-host/services/plugin-version.service.d.ts +2 -1
- package/dist/src/plugin-host/services/release-candidate-rules.service.d.ts +51 -0
- package/dist/src/plugin-host/services/release-candidate-rules.service.js +198 -0
- package/dist/src/plugin-host/services/remote-url-validator.service.d.ts +7 -0
- package/dist/src/plugin-host/services/remote-url-validator.service.js +4 -0
- package/dist/src/plugin-host/system-triggers/plugin-action-execution-sweep.processor.d.ts +14 -0
- package/dist/src/plugin-host/system-triggers/plugin-action-execution-sweep.processor.js +50 -0
- package/dist/src/plugin-host/use-cases/cancel-plugin-action-execution.service.d.ts +8 -0
- package/dist/src/plugin-host/use-cases/cancel-plugin-action-execution.service.js +39 -0
- package/dist/src/plugin-host/use-cases/check-plugin-release.service.d.ts +22 -0
- package/dist/src/plugin-host/use-cases/check-plugin-release.service.js +152 -0
- package/dist/src/plugin-host/use-cases/find-plugin-by-repository.service.d.ts +9 -0
- package/dist/src/plugin-host/use-cases/find-plugin-by-repository.service.js +35 -0
- package/dist/src/plugin-host/use-cases/get-current-plugin-action-execution.service.d.ts +14 -0
- package/dist/src/plugin-host/use-cases/get-current-plugin-action-execution.service.js +85 -0
- package/dist/src/plugin-host/use-cases/get-plugin-action-execution.service.d.ts +9 -0
- package/dist/src/plugin-host/use-cases/get-plugin-action-execution.service.js +67 -0
- package/dist/src/plugin-host/use-cases/get-plugin-installation-entry.service.js +2 -7
- package/dist/src/plugin-host/use-cases/install-plugin.service.js +4 -0
- package/dist/src/plugin-host/use-cases/list-installations.service.d.ts +3 -1
- package/dist/src/plugin-host/use-cases/list-installations.service.js +14 -3
- package/dist/src/plugin-host/use-cases/list-plugin-history.service.d.ts +25 -0
- package/dist/src/plugin-host/use-cases/list-plugin-history.service.js +147 -0
- package/dist/src/plugin-host/use-cases/plugin-publisher-access.d.ts +5 -0
- package/dist/src/plugin-host/use-cases/plugin-publisher-access.js +28 -0
- package/dist/src/plugin-host/use-cases/start-plugin-action-execution.service.d.ts +12 -0
- package/dist/src/plugin-host/use-cases/start-plugin-action-execution.service.js +64 -0
- package/dist/src/plugin-host/use-cases/sync-plugin-releases.service.d.ts +3 -5
- package/dist/src/plugin-host/use-cases/sync-plugin-releases.service.js +15 -59
- package/dist/src/plugin-host/use-cases/uninstall-plugin.service.js +3 -1
- package/dist/src/plugin-host/use-cases/update-plugin.service.d.ts +0 -1
- package/dist/src/plugin-host/use-cases/update-plugin.service.js +3 -25
- package/dist/src/plugin-host/utils/action-input-schema.util.d.ts +14 -0
- package/dist/src/plugin-host/utils/action-input-schema.util.js +133 -0
- package/dist/src/plugin-host/utils/credential-handles.util.d.ts +3 -0
- package/dist/src/plugin-host/utils/credential-handles.util.js +13 -0
- package/dist/src/plugin-host/utils/execution-token.util.d.ts +5 -0
- package/dist/src/plugin-host/utils/execution-token.util.js +13 -0
- package/dist/src/plugin-host/utils/github-repo-locator.util.js +1 -1
- package/dist/src/plugin-host/utils/json-shape.util.d.ts +1 -0
- package/dist/src/plugin-host/utils/json-shape.util.js +21 -0
- package/dist/src/plugin-host/utils/plugin-action-outcome.util.d.ts +10 -0
- package/dist/src/plugin-host/utils/plugin-action-outcome.util.js +67 -0
- package/dist/src/plugin-host/utils/plugin-manifest.util.d.ts +121 -0
- package/dist/src/plugin-host/utils/plugin-manifest.util.js +111 -1
- package/dist/src/plugin-host/utils/request-abort-signal.util.d.ts +5 -0
- package/dist/src/plugin-host/utils/request-abort-signal.util.js +19 -0
- package/package.json +10 -8
|
@@ -8,23 +8,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var McpSdkServerFactory_1;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.McpSdkServerFactory = void 0;
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
14
15
|
const server_1 = require("@modelcontextprotocol/server");
|
|
16
|
+
const internal_helpers_1 = require("@owox/internal-helpers");
|
|
15
17
|
const mcp_config_1 = require("../config/mcp.config");
|
|
16
18
|
const mcp_call_instrumentation_1 = require("../observability/mcp-call-instrumentation");
|
|
17
19
|
const mcp_tool_registry_1 = require("../tools/mcp-tool.registry");
|
|
18
|
-
|
|
20
|
+
const mcp_output_schema_1 = require("./mcp-output-schema");
|
|
21
|
+
const mcp_schema_refresh_1 = require("./mcp-schema-refresh");
|
|
22
|
+
let McpSdkServerFactory = McpSdkServerFactory_1 = class McpSdkServerFactory {
|
|
19
23
|
config;
|
|
20
24
|
toolRegistry;
|
|
21
25
|
instrumentation;
|
|
26
|
+
logger = new common_1.Logger(McpSdkServerFactory_1.name);
|
|
27
|
+
schemaRefresh = new mcp_schema_refresh_1.McpSchemaRefresh();
|
|
28
|
+
outputSchemas = new WeakMap();
|
|
22
29
|
constructor(config, toolRegistry, instrumentation) {
|
|
23
30
|
this.config = config;
|
|
24
31
|
this.toolRegistry = toolRegistry;
|
|
25
32
|
this.instrumentation = instrumentation;
|
|
26
33
|
}
|
|
27
|
-
create(mcpContext, instructions) {
|
|
34
|
+
create(mcpContext, instructions, refreshOptions) {
|
|
28
35
|
const serverInfo = {
|
|
29
36
|
name: this.config.serverName,
|
|
30
37
|
version: this.config.serverVersion,
|
|
@@ -36,17 +43,41 @@ let McpSdkServerFactory = class McpSdkServerFactory {
|
|
|
36
43
|
for (const tool of this.toolRegistry.getTools()) {
|
|
37
44
|
const wrapped = this.instrumentation.wrap(tool.name, async (input, ctx) => {
|
|
38
45
|
this.assertScopes(mcpContext, tool.requiredScopes);
|
|
46
|
+
const notify = refreshOptions?.era === 'modern'
|
|
47
|
+
? refreshOptions.notifyToolsChanged
|
|
48
|
+
: ctx?.mcpReq?.notify
|
|
49
|
+
? () => ctx.mcpReq.notify({ method: 'notifications/tools/list_changed' })
|
|
50
|
+
: undefined;
|
|
51
|
+
if (notify) {
|
|
52
|
+
try {
|
|
53
|
+
await this.schemaRefresh.notifyIfDue(mcpContext, notify, refreshOptions?.era === 'modern');
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
this.logger.warn('MCP schema refresh notification failed', {
|
|
57
|
+
toolName: tool.name,
|
|
58
|
+
message: (0, internal_helpers_1.castError)(error).message,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
39
62
|
return tool.handler(input, mcpContext, ctx?.mcpReq?.signal);
|
|
40
63
|
});
|
|
41
64
|
sdkToolRegistrar.registerTool(tool.name, {
|
|
42
65
|
description: tool.description,
|
|
43
66
|
inputSchema: tool.zodSchema,
|
|
44
|
-
...(tool.outputSchema ? { outputSchema: tool.outputSchema } : {}),
|
|
67
|
+
...(tool.outputSchema ? { outputSchema: this.outputSchema(tool.outputSchema) } : {}),
|
|
45
68
|
...(tool.annotations ? { annotations: tool.annotations } : {}),
|
|
46
69
|
}, wrapped);
|
|
47
70
|
}
|
|
48
71
|
return server;
|
|
49
72
|
}
|
|
73
|
+
outputSchema(shape) {
|
|
74
|
+
const cached = this.outputSchemas.get(shape);
|
|
75
|
+
if (cached)
|
|
76
|
+
return cached;
|
|
77
|
+
const schema = (0, mcp_output_schema_1.makeMcpOutputSchema)(shape);
|
|
78
|
+
this.outputSchemas.set(shape, schema);
|
|
79
|
+
return schema;
|
|
80
|
+
}
|
|
50
81
|
assertScopes(context, requiredScopes) {
|
|
51
82
|
for (const scope of requiredScopes) {
|
|
52
83
|
if (!context.scopes.includes(scope)) {
|
|
@@ -56,7 +87,7 @@ let McpSdkServerFactory = class McpSdkServerFactory {
|
|
|
56
87
|
}
|
|
57
88
|
};
|
|
58
89
|
exports.McpSdkServerFactory = McpSdkServerFactory;
|
|
59
|
-
exports.McpSdkServerFactory = McpSdkServerFactory = __decorate([
|
|
90
|
+
exports.McpSdkServerFactory = McpSdkServerFactory = McpSdkServerFactory_1 = __decorate([
|
|
60
91
|
(0, common_1.Injectable)(),
|
|
61
92
|
__metadata("design:paramtypes", [mcp_config_1.McpConfigService,
|
|
62
93
|
mcp_tool_registry_1.McpToolRegistry,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod-v4';
|
|
2
|
+
export declare const contextIdsSchema: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
3
|
+
export declare const makeContextSummariesSchema: () => z.ZodArray<z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeContextSummariesSchema = exports.contextIdsSchema = void 0;
|
|
4
|
+
const zod_v4_1 = require("zod-v4");
|
|
5
|
+
exports.contextIdsSchema = zod_v4_1.z
|
|
6
|
+
.array(zod_v4_1.z.string().trim().min(1))
|
|
7
|
+
.max(100)
|
|
8
|
+
.optional()
|
|
9
|
+
.transform(ids => (ids?.length ? [...new Set(ids)] : undefined))
|
|
10
|
+
.describe('Optional context IDs from list_contexts in the connected project. Match any selected context. Omit or pass [] for no filter; existing resource access controls always apply.');
|
|
11
|
+
const makeContextSummariesSchema = () => zod_v4_1.z.array(zod_v4_1.z.object({ id: zod_v4_1.z.string(), name: zod_v4_1.z.string() }));
|
|
12
|
+
exports.makeContextSummariesSchema = makeContextSummariesSchema;
|
|
13
|
+
//# sourceMappingURL=context-input.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type McpContextsFacade } from '../../../data-marts/facades/mcp-contexts.facade';
|
|
1
2
|
import { z } from 'zod-v4';
|
|
2
3
|
import type { McpScope } from '@owox/idp-protocol';
|
|
3
4
|
import { PublicOriginService } from '../../../common/config/public-origin.service';
|
|
@@ -6,6 +7,7 @@ import { type McpDataMartsFacade } from '../../../data-marts/facades/mcp-data-ma
|
|
|
6
7
|
import type { McpAuthContext } from '../auth/mcp-auth-context';
|
|
7
8
|
import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
|
|
8
9
|
declare const inputSchema: z.ZodObject<{
|
|
10
|
+
context_ids: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
9
11
|
status: z.ZodOptional<z.ZodEnum<{
|
|
10
12
|
draft: "draft";
|
|
11
13
|
published: "published";
|
|
@@ -16,9 +18,11 @@ export declare class ListDataMartsTool implements McpToolDefinition<ListDataMart
|
|
|
16
18
|
private readonly dataMarts;
|
|
17
19
|
private readonly publicOriginService;
|
|
18
20
|
private readonly projectContext;
|
|
21
|
+
private readonly contexts;
|
|
19
22
|
readonly name = "list_data_marts";
|
|
20
|
-
readonly description = "List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog.";
|
|
23
|
+
readonly description = "List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog. Use get_project_context \u2192 list_contexts to discover business goals, then pass context_ids to restrict discovery to any selected context; omission preserves project-wide discovery within your existing access. Responses include all attached context IDs and names.";
|
|
21
24
|
readonly zodSchema: {
|
|
25
|
+
context_ids: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
22
26
|
status: z.ZodOptional<z.ZodEnum<{
|
|
23
27
|
draft: "draft";
|
|
24
28
|
published: "published";
|
|
@@ -33,6 +37,10 @@ export declare class ListDataMartsTool implements McpToolDefinition<ListDataMart
|
|
|
33
37
|
id: z.ZodString;
|
|
34
38
|
title: z.ZodString;
|
|
35
39
|
description: z.ZodString;
|
|
40
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
}, z.core.$strip>>;
|
|
36
44
|
url: z.ZodString;
|
|
37
45
|
status: z.ZodString;
|
|
38
46
|
updated_at: z.ZodString;
|
|
@@ -62,7 +70,7 @@ export declare class ListDataMartsTool implements McpToolDefinition<ListDataMart
|
|
|
62
70
|
openWorldHint: boolean;
|
|
63
71
|
};
|
|
64
72
|
readonly requiredScopes: McpScope[];
|
|
65
|
-
constructor(dataMarts: McpDataMartsFacade, publicOriginService: PublicOriginService, projectContext: McpProjectContextFacade);
|
|
73
|
+
constructor(dataMarts: McpDataMartsFacade, publicOriginService: PublicOriginService, projectContext: McpProjectContextFacade, contexts: McpContextsFacade);
|
|
66
74
|
parseInput(input: unknown): ListDataMartsInput;
|
|
67
75
|
handler(input: ListDataMartsInput, context: McpAuthContext): Promise<McpToolResult>;
|
|
68
76
|
private gettingStartedFor;
|
|
@@ -13,6 +13,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ListDataMartsTool = void 0;
|
|
16
|
+
const context_input_1 = require("./context-input");
|
|
17
|
+
const mcp_contexts_facade_1 = require("../../../data-marts/facades/mcp-contexts.facade");
|
|
16
18
|
const common_1 = require("@nestjs/common");
|
|
17
19
|
const zod_v4_1 = require("zod-v4");
|
|
18
20
|
const public_origin_service_1 = require("../../../common/config/public-origin.service");
|
|
@@ -25,6 +27,7 @@ const mcp_project_summary_util_1 = require("./mcp-project-summary.util");
|
|
|
25
27
|
const mcp_public_url_util_1 = require("./mcp-public-url.util");
|
|
26
28
|
const inputSchema = zod_v4_1.z
|
|
27
29
|
.object({
|
|
30
|
+
context_ids: context_input_1.contextIdsSchema,
|
|
28
31
|
status: zod_v4_1.z
|
|
29
32
|
.enum(['published', 'draft'])
|
|
30
33
|
.optional()
|
|
@@ -35,8 +38,9 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
35
38
|
dataMarts;
|
|
36
39
|
publicOriginService;
|
|
37
40
|
projectContext;
|
|
41
|
+
contexts;
|
|
38
42
|
name = 'list_data_marts';
|
|
39
|
-
description = 'List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog.';
|
|
43
|
+
description = 'List data marts available to the current OWOX project member. Defaults to published data marts; use status=draft only to browse draft metadata, because other MCP data-mart tools accept published data marts only. Use only when the user explicitly asks to list or browse data marts; for a concrete analytical question use get_relevant_data_marts_by_prompt instead, and for open-ended orientation use summarize_data_catalog. Use get_project_context → list_contexts to discover business goals, then pass context_ids to restrict discovery to any selected context; omission preserves project-wide discovery within your existing access. Responses include all attached context IDs and names.';
|
|
40
44
|
zodSchema = inputSchema.shape;
|
|
41
45
|
outputSchema = {
|
|
42
46
|
project: zod_v4_1.z.object({ id: zod_v4_1.z.string(), title: zod_v4_1.z.string() }).optional(),
|
|
@@ -44,6 +48,7 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
44
48
|
id: zod_v4_1.z.string(),
|
|
45
49
|
title: zod_v4_1.z.string(),
|
|
46
50
|
description: zod_v4_1.z.string(),
|
|
51
|
+
contexts: (0, context_input_1.makeContextSummariesSchema)(),
|
|
47
52
|
url: zod_v4_1.z.string(),
|
|
48
53
|
status: zod_v4_1.z.string(),
|
|
49
54
|
updated_at: zod_v4_1.z.string(),
|
|
@@ -59,16 +64,19 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
59
64
|
openWorldHint: false,
|
|
60
65
|
};
|
|
61
66
|
requiredScopes = ['mcp:read'];
|
|
62
|
-
constructor(dataMarts, publicOriginService, projectContext) {
|
|
67
|
+
constructor(dataMarts, publicOriginService, projectContext, contexts) {
|
|
63
68
|
this.dataMarts = dataMarts;
|
|
64
69
|
this.publicOriginService = publicOriginService;
|
|
65
70
|
this.projectContext = projectContext;
|
|
71
|
+
this.contexts = contexts;
|
|
66
72
|
}
|
|
67
73
|
parseInput(input) {
|
|
68
74
|
return inputSchema.parse(input);
|
|
69
75
|
}
|
|
70
76
|
async handler(input, context) {
|
|
71
77
|
const parsed = this.parseInput(input);
|
|
78
|
+
if (parsed.context_ids)
|
|
79
|
+
await this.contexts.validateContextIds(context.projectId, parsed.context_ids);
|
|
72
80
|
const status = parsed.status ?? 'published';
|
|
73
81
|
const [result, projectContext] = await Promise.all([
|
|
74
82
|
this.dataMarts.listDataMarts({
|
|
@@ -76,6 +84,7 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
76
84
|
userId: context.userId,
|
|
77
85
|
roles: context.roles,
|
|
78
86
|
status,
|
|
87
|
+
...(parsed.context_ids ? { contextIds: parsed.context_ids } : {}),
|
|
79
88
|
}),
|
|
80
89
|
(0, mcp_project_summary_util_1.tryGetMcpProjectSummary)(this.projectContext, context),
|
|
81
90
|
]);
|
|
@@ -83,6 +92,7 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
83
92
|
const gettingStarted = await this.gettingStartedFor(result.dataMarts.length, status, {
|
|
84
93
|
publicOrigin,
|
|
85
94
|
context,
|
|
95
|
+
filtered: !!parsed.context_ids,
|
|
86
96
|
});
|
|
87
97
|
const structuredContent = {
|
|
88
98
|
...(projectContext ? { project: projectContext } : {}),
|
|
@@ -92,17 +102,18 @@ let ListDataMartsTool = class ListDataMartsTool {
|
|
|
92
102
|
description: dataMart.description ?? '',
|
|
93
103
|
url: (0, mcp_public_url_util_1.joinPublicOrigin)(publicOrigin, (0, data_mart_ui_path_1.buildDataMartUiPath)(context.projectId, dataMart.id)),
|
|
94
104
|
status: dataMart.status,
|
|
105
|
+
contexts: dataMart.contexts ?? [],
|
|
95
106
|
updated_at: dataMart.updatedAt,
|
|
96
107
|
})),
|
|
97
108
|
...(gettingStarted ? { getting_started: gettingStarted } : {}),
|
|
98
109
|
};
|
|
99
110
|
return (0, mcp_tool_definition_1.jsonToolResult)(structuredContent);
|
|
100
111
|
}
|
|
101
|
-
async gettingStartedFor(listedCount, status, { publicOrigin, context }) {
|
|
112
|
+
async gettingStartedFor(listedCount, status, { publicOrigin, context, filtered, }) {
|
|
102
113
|
if (listedCount > 0)
|
|
103
114
|
return undefined;
|
|
104
115
|
const deps = { dataMarts: this.dataMarts, publicOrigin };
|
|
105
|
-
return status === 'published'
|
|
116
|
+
return status === 'published' && !filtered
|
|
106
117
|
? (0, mcp_getting_started_util_1.buildGettingStarted)(deps, context)
|
|
107
118
|
: (0, mcp_getting_started_util_1.resolveGettingStarted)(deps, context);
|
|
108
119
|
}
|
|
@@ -112,6 +123,7 @@ exports.ListDataMartsTool = ListDataMartsTool = __decorate([
|
|
|
112
123
|
(0, common_1.Injectable)(),
|
|
113
124
|
__param(0, (0, common_1.Inject)(mcp_data_marts_facade_1.MCP_DATA_MARTS_FACADE)),
|
|
114
125
|
__param(2, (0, common_1.Inject)(mcp_project_context_facade_1.MCP_PROJECT_CONTEXT_FACADE)),
|
|
115
|
-
|
|
126
|
+
__param(3, (0, common_1.Inject)(mcp_contexts_facade_1.MCP_CONTEXTS_FACADE)),
|
|
127
|
+
__metadata("design:paramtypes", [Object, public_origin_service_1.PublicOriginService, Object, Object])
|
|
116
128
|
], ListDataMartsTool);
|
|
117
129
|
//# sourceMappingURL=data-mart-catalog.tool.js.map
|
|
@@ -16,7 +16,7 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
|
|
|
16
16
|
private readonly dataMarts;
|
|
17
17
|
private readonly publicOriginService;
|
|
18
18
|
readonly name = "get_data_mart_details_by_id";
|
|
19
|
-
readonly description = "Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type \"category\", and every field carries the effective \"allowedAggregations\" query_data_mart may apply to it; \"operators_by_category\" maps each category to the filter/slice operators its fields accept \u2014 build queries from these instead of guessing. An empty allowedAggregations on a field whose \"calculated\" level is \"metric\" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the \"usage\" note carried on that field \u2014 it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. This tool is optional in
|
|
19
|
+
readonly description = "Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, attached context IDs and names, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type \"category\", and every field carries the effective \"allowedAggregations\" query_data_mart may apply to it; \"operators_by_category\" maps each category to the filter/slice operators its fields accept \u2014 build queries from these instead of guessing. An empty allowedAggregations on a field whose \"calculated\" level is \"metric\" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the \"usage\" note carried on that field \u2014 it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. Follow get_project_context \u2192 list_contexts \u2192 context-filtered Data Mart discovery. This tool is optional in that flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.";
|
|
20
20
|
readonly zodSchema: {
|
|
21
21
|
data_mart_id: z.ZodString;
|
|
22
22
|
detail_level: z.ZodOptional<z.ZodEnum<{
|
|
@@ -25,6 +25,10 @@ export declare class GetDataMartDetailsTool implements McpToolDefinition<GetData
|
|
|
25
25
|
}>>;
|
|
26
26
|
};
|
|
27
27
|
readonly outputSchema: {
|
|
28
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
28
32
|
id: z.ZodString;
|
|
29
33
|
name: z.ZodString;
|
|
30
34
|
url: z.ZodString;
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.GetDataMartDetailsTool = void 0;
|
|
16
|
+
const context_input_1 = require("./context-input");
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const zod_v4_1 = require("zod-v4");
|
|
18
19
|
const mcp_data_marts_facade_1 = require("../../../data-marts/facades/mcp-data-marts.facade");
|
|
@@ -129,9 +130,10 @@ let GetDataMartDetailsTool = class GetDataMartDetailsTool {
|
|
|
129
130
|
dataMarts;
|
|
130
131
|
publicOriginService;
|
|
131
132
|
name = 'get_data_mart_details_by_id';
|
|
132
|
-
description = 'Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type "category", and every field carries the effective "allowedAggregations" query_data_mart may apply to it; "operators_by_category" maps each category to the filter/slice operators its fields accept — build queries from these instead of guessing. An empty allowedAggregations on a field whose "calculated" level is "metric" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the "usage" note carried on that field — it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. This tool is optional in
|
|
133
|
+
description = 'Get available details for a specific published OWOX Data Mart by data_mart_id, including its URL, attached context IDs and names, native output fields, and (only on explicit request) joined_fields contributed by blended/joined data marts. Use detail_level=native by default: it avoids exposing irrelevant joined fields and keeps the response fast. Request detail_level=with_joined_fields only when the question truly needs a joined Data Mart. Use displayName for user-facing wording and copy name verbatim into query_data_mart. Each controllable field carries its type "category", and every field carries the effective "allowedAggregations" query_data_mart may apply to it; "operators_by_category" maps each category to the filter/slice operators its fields accept — build queries from these instead of guessing. An empty allowedAggregations on a field whose "calculated" level is "metric" means the value is ALREADY computed, not that the field is unusable: select it by name in query_data_mart instead of recomputing it from other fields, and read the "usage" note carried on that field — it may also warn that a join distorts the number. Array fields are the exception: when mode is REPEATED or type or sliceType is ARRAY, the field omits category and has empty allowedAggregations. It may appear in fields, but never in filters, slices, sort, aggregations, or date_buckets. Follow get_project_context → list_contexts → context-filtered Data Mart discovery. This tool is optional in that flow: get_relevant_data_marts_by_prompt finds relevant Data Marts, and this tool adds field-level metadata for a selected Data Mart. It does not return data owners, data freshness, sample values, or actual data rows.';
|
|
133
134
|
zodSchema = inputSchema.shape;
|
|
134
135
|
outputSchema = {
|
|
136
|
+
contexts: (0, context_input_1.makeContextSummariesSchema)(),
|
|
135
137
|
id: zod_v4_1.z.string().describe('Data mart identifier.'),
|
|
136
138
|
name: zod_v4_1.z.string().describe('Data mart display name.'),
|
|
137
139
|
url: zod_v4_1.z.string().describe('Open this Data Mart in OWOX.'),
|
|
@@ -190,6 +192,7 @@ let GetDataMartDetailsTool = class GetDataMartDetailsTool {
|
|
|
190
192
|
operatorsByCategory[category] = (0, field_type_matrix_1.mcpOperatorsForCategory)(category);
|
|
191
193
|
}
|
|
192
194
|
const structuredContent = {
|
|
195
|
+
contexts: result.contexts ?? [],
|
|
193
196
|
id: result.id,
|
|
194
197
|
name: result.name,
|
|
195
198
|
url: (0, mcp_public_url_util_1.joinPublicOrigin)(this.publicOriginService.getPublicOrigin(), (0, data_mart_ui_path_1.buildDataMartUiPath)(context.projectId, result.id)),
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from 'zod-v4';
|
|
2
|
+
import type { McpScope } from '@owox/idp-protocol';
|
|
3
|
+
import { type McpContextsFacade } from '../../../data-marts/facades/mcp-contexts.facade';
|
|
4
|
+
import type { McpAuthContext } from '../auth/mcp-auth-context';
|
|
5
|
+
import { type McpToolDefinition } from './mcp-tool.definition';
|
|
6
|
+
export declare class ListContextsTool implements McpToolDefinition<Record<string, never>> {
|
|
7
|
+
private readonly contexts;
|
|
8
|
+
readonly name = "list_contexts";
|
|
9
|
+
readonly description = "List business contexts in the connected OWOX project, including IDs, names and complete descriptions (null when missing). Discovery flow: get_project_context \u2192 list_contexts \u2192 list_data_marts or get_relevant_data_marts_by_prompt with context_ids \u2192 get_data_mart_details_by_id. Read descriptions for business goals and Markdown links to specific Data Marts. Listing a context or following a reference never grants access to its resources; all Data Mart tools enforce existing access controls.";
|
|
10
|
+
readonly zodSchema: {};
|
|
11
|
+
readonly outputSchema: {
|
|
12
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
description: z.ZodNullable<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
};
|
|
18
|
+
readonly annotations: {
|
|
19
|
+
title: string;
|
|
20
|
+
readOnlyHint: boolean;
|
|
21
|
+
destructiveHint: boolean;
|
|
22
|
+
openWorldHint: boolean;
|
|
23
|
+
};
|
|
24
|
+
readonly requiredScopes: McpScope[];
|
|
25
|
+
private readonly inputSchema;
|
|
26
|
+
constructor(contexts: McpContextsFacade);
|
|
27
|
+
handler(input: Record<string, never>, context: McpAuthContext): Promise<{
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
content: ({
|
|
30
|
+
type: "text";
|
|
31
|
+
text: string;
|
|
32
|
+
annotations?: {
|
|
33
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
34
|
+
priority?: number | undefined;
|
|
35
|
+
lastModified?: string | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
_meta?: {
|
|
38
|
+
[x: string]: unknown;
|
|
39
|
+
} | undefined;
|
|
40
|
+
} | {
|
|
41
|
+
type: "image";
|
|
42
|
+
data: string;
|
|
43
|
+
mimeType: string;
|
|
44
|
+
annotations?: {
|
|
45
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
46
|
+
priority?: number | undefined;
|
|
47
|
+
lastModified?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
_meta?: {
|
|
50
|
+
[x: string]: unknown;
|
|
51
|
+
} | undefined;
|
|
52
|
+
} | {
|
|
53
|
+
type: "audio";
|
|
54
|
+
data: string;
|
|
55
|
+
mimeType: string;
|
|
56
|
+
annotations?: {
|
|
57
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
58
|
+
priority?: number | undefined;
|
|
59
|
+
lastModified?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
_meta?: {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
} | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
uri: string;
|
|
66
|
+
name: string;
|
|
67
|
+
type: "resource_link";
|
|
68
|
+
description?: string | undefined;
|
|
69
|
+
mimeType?: string | undefined;
|
|
70
|
+
size?: number | undefined;
|
|
71
|
+
annotations?: {
|
|
72
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
73
|
+
priority?: number | undefined;
|
|
74
|
+
lastModified?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
_meta?: {
|
|
77
|
+
[x: string]: unknown;
|
|
78
|
+
} | undefined;
|
|
79
|
+
icons?: {
|
|
80
|
+
src: string;
|
|
81
|
+
mimeType?: string | undefined;
|
|
82
|
+
sizes?: string[] | undefined;
|
|
83
|
+
theme?: "light" | "dark" | undefined;
|
|
84
|
+
}[] | undefined;
|
|
85
|
+
title?: string | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
type: "resource";
|
|
88
|
+
resource: {
|
|
89
|
+
uri: string;
|
|
90
|
+
text: string;
|
|
91
|
+
mimeType?: string | undefined;
|
|
92
|
+
_meta?: {
|
|
93
|
+
[x: string]: unknown;
|
|
94
|
+
} | undefined;
|
|
95
|
+
} | {
|
|
96
|
+
uri: string;
|
|
97
|
+
blob: string;
|
|
98
|
+
mimeType?: string | undefined;
|
|
99
|
+
_meta?: {
|
|
100
|
+
[x: string]: unknown;
|
|
101
|
+
} | undefined;
|
|
102
|
+
};
|
|
103
|
+
annotations?: {
|
|
104
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
105
|
+
priority?: number | undefined;
|
|
106
|
+
lastModified?: string | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
_meta?: {
|
|
109
|
+
[x: string]: unknown;
|
|
110
|
+
} | undefined;
|
|
111
|
+
})[];
|
|
112
|
+
_meta?: {
|
|
113
|
+
[x: string]: unknown;
|
|
114
|
+
"io.modelcontextprotocol/serverInfo"?: {
|
|
115
|
+
version: string;
|
|
116
|
+
name: string;
|
|
117
|
+
websiteUrl?: string | undefined;
|
|
118
|
+
description?: string | undefined;
|
|
119
|
+
icons?: {
|
|
120
|
+
src: string;
|
|
121
|
+
mimeType?: string | undefined;
|
|
122
|
+
sizes?: string[] | undefined;
|
|
123
|
+
theme?: "light" | "dark" | undefined;
|
|
124
|
+
}[] | undefined;
|
|
125
|
+
title?: string | undefined;
|
|
126
|
+
} | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
structuredContent?: unknown;
|
|
129
|
+
isError?: boolean | undefined;
|
|
130
|
+
}>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ListContextsTool = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const zod_v4_1 = require("zod-v4");
|
|
18
|
+
const mcp_contexts_facade_1 = require("../../../data-marts/facades/mcp-contexts.facade");
|
|
19
|
+
const mcp_tool_definition_1 = require("./mcp-tool.definition");
|
|
20
|
+
let ListContextsTool = class ListContextsTool {
|
|
21
|
+
contexts;
|
|
22
|
+
name = 'list_contexts';
|
|
23
|
+
description = 'List business contexts in the connected OWOX project, including IDs, names and complete descriptions (null when missing). Discovery flow: get_project_context → list_contexts → list_data_marts or get_relevant_data_marts_by_prompt with context_ids → get_data_mart_details_by_id. Read descriptions for business goals and Markdown links to specific Data Marts. Listing a context or following a reference never grants access to its resources; all Data Mart tools enforce existing access controls.';
|
|
24
|
+
zodSchema = {};
|
|
25
|
+
outputSchema = {
|
|
26
|
+
contexts: zod_v4_1.z.array(zod_v4_1.z.object({ id: zod_v4_1.z.string(), name: zod_v4_1.z.string(), description: zod_v4_1.z.string().nullable() })),
|
|
27
|
+
};
|
|
28
|
+
annotations = {
|
|
29
|
+
title: 'List Project Contexts',
|
|
30
|
+
readOnlyHint: true,
|
|
31
|
+
destructiveHint: false,
|
|
32
|
+
openWorldHint: false,
|
|
33
|
+
};
|
|
34
|
+
requiredScopes = ['mcp:read'];
|
|
35
|
+
inputSchema = zod_v4_1.z.object({}).strict();
|
|
36
|
+
constructor(contexts) {
|
|
37
|
+
this.contexts = contexts;
|
|
38
|
+
}
|
|
39
|
+
async handler(input, context) {
|
|
40
|
+
this.inputSchema.parse(input);
|
|
41
|
+
return (0, mcp_tool_definition_1.jsonToolResult)({ contexts: await this.contexts.listContexts(context.projectId) });
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.ListContextsTool = ListContextsTool;
|
|
45
|
+
exports.ListContextsTool = ListContextsTool = __decorate([
|
|
46
|
+
(0, common_1.Injectable)(),
|
|
47
|
+
__param(0, (0, common_1.Inject)(mcp_contexts_facade_1.MCP_CONTEXTS_FACADE)),
|
|
48
|
+
__metadata("design:paramtypes", [Object])
|
|
49
|
+
], ListContextsTool);
|
|
50
|
+
//# sourceMappingURL=list-contexts.tool.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MCP_TOOL_DEFINITIONS_PROVIDER = exports.MCP_TOOL_PROVIDER_CLASSES = void 0;
|
|
4
|
+
const list_contexts_tool_1 = require("./list-contexts.tool");
|
|
4
5
|
const create_report_run_schedule_tool_1 = require("./create-report-run-schedule.tool");
|
|
5
6
|
const add_report_tool_1 = require("./add-report.tool");
|
|
6
7
|
const data_mart_catalog_tool_1 = require("./data-mart-catalog.tool");
|
|
@@ -23,6 +24,7 @@ const update_report_run_schedule_tool_1 = require("./update-report-run-schedule.
|
|
|
23
24
|
const update_report_tool_1 = require("./update-report.tool");
|
|
24
25
|
const add_destination_tool_1 = require("./add-destination.tool");
|
|
25
26
|
exports.MCP_TOOL_PROVIDER_CLASSES = [
|
|
27
|
+
list_contexts_tool_1.ListContextsTool,
|
|
26
28
|
summarize_data_catalog_tool_1.SummarizeDataCatalogTool,
|
|
27
29
|
data_mart_catalog_tool_1.ListDataMartsTool,
|
|
28
30
|
search_data_marts_tool_1.SearchDataMartsTool,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type McpContextsFacade } from '../../../data-marts/facades/mcp-contexts.facade';
|
|
1
2
|
import { z } from 'zod-v4';
|
|
2
3
|
import type { McpScope } from '@owox/idp-protocol';
|
|
3
4
|
import { type SearchFacade } from '../../../common/search/search.facade';
|
|
@@ -7,6 +8,7 @@ import { type McpProjectContextFacade } from '../../../idp/facades/mcp-project-c
|
|
|
7
8
|
import type { McpAuthContext } from '../auth/mcp-auth-context';
|
|
8
9
|
import { type McpToolDefinition, type McpToolResult } from './mcp-tool.definition';
|
|
9
10
|
declare const inputSchema: z.ZodObject<{
|
|
11
|
+
context_ids: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
10
12
|
prompt: z.ZodString;
|
|
11
13
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
12
14
|
}, z.core.$strict>;
|
|
@@ -16,9 +18,11 @@ export declare class SearchDataMartsTool implements McpToolDefinition<SearchData
|
|
|
16
18
|
private readonly publicOriginService;
|
|
17
19
|
private readonly projectContext;
|
|
18
20
|
private readonly dataMarts;
|
|
21
|
+
private readonly contexts;
|
|
19
22
|
readonly name = "get_relevant_data_marts_by_prompt";
|
|
20
|
-
readonly description = "Find relevant non-draft data marts in the current OWOX project from a natural-language prompt, limited to data marts visible to the current MCP user. This is the default discovery step for a concrete analytical question when the data mart has not already been confirmed. Use it when the user asks to find, discover, or search published data marts by title, description, business meaning, schema fields, or metrics. This tool returns only data marts, not data storages or destinations, and it intentionally excludes draft data marts.";
|
|
23
|
+
readonly description = "Find relevant non-draft data marts in the current OWOX project from a natural-language prompt, limited to data marts visible to the current MCP user. This is the default discovery step for a concrete analytical question when the data mart has not already been confirmed. Use it when the user asks to find, discover, or search published data marts by title, description, business meaning, schema fields, or metrics. This tool returns only data marts, not data storages or destinations, and it intentionally excludes draft data marts. Use get_project_context \u2192 list_contexts to discover business goals, then pass context_ids to restrict discovery to any selected context; omission preserves project-wide discovery within your existing access. Responses include all attached context IDs and names.";
|
|
21
24
|
readonly zodSchema: {
|
|
25
|
+
context_ids: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodTransform<string[] | undefined, string[] | undefined>>;
|
|
22
26
|
prompt: z.ZodString;
|
|
23
27
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
24
28
|
};
|
|
@@ -31,6 +35,10 @@ export declare class SearchDataMartsTool implements McpToolDefinition<SearchData
|
|
|
31
35
|
id: z.ZodString;
|
|
32
36
|
title: z.ZodString;
|
|
33
37
|
description: z.ZodString;
|
|
38
|
+
contexts: z.ZodArray<z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
}, z.core.$strip>>;
|
|
34
42
|
url: z.ZodString;
|
|
35
43
|
relevance_score: z.ZodNumber;
|
|
36
44
|
}, z.core.$strip>>;
|
|
@@ -59,7 +67,7 @@ export declare class SearchDataMartsTool implements McpToolDefinition<SearchData
|
|
|
59
67
|
openWorldHint: boolean;
|
|
60
68
|
};
|
|
61
69
|
readonly requiredScopes: McpScope[];
|
|
62
|
-
constructor(searchFacade: SearchFacade, publicOriginService: PublicOriginService, projectContext: McpProjectContextFacade, dataMarts: McpDataMartsFacade);
|
|
70
|
+
constructor(searchFacade: SearchFacade, publicOriginService: PublicOriginService, projectContext: McpProjectContextFacade, dataMarts: McpDataMartsFacade, contexts: McpContextsFacade);
|
|
63
71
|
parseInput(input: unknown): SearchDataMartsInput;
|
|
64
72
|
handler(input: SearchDataMartsInput, context: McpAuthContext): Promise<McpToolResult>;
|
|
65
73
|
}
|