@lightdash-tools/mcp 0.6.0 → 0.8.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/README.md +205 -58
- package/dist/audit/audit.d.ts +5 -0
- package/dist/{audit.js → audit/audit.js} +1 -2
- package/dist/audit/tool-audit-context.d.ts +6 -0
- package/dist/audit/tool-audit-context.js +12 -0
- package/dist/audit/tool-audit-context.test.d.ts +1 -0
- package/dist/audit/tool-audit-context.test.js +19 -0
- package/dist/auth/auth-mode.d.ts +4 -0
- package/dist/auth/auth-mode.js +6 -0
- package/dist/auth/bearer.d.ts +3 -0
- package/dist/auth/bearer.js +13 -0
- package/dist/auth/lightdash-oauth-upstream-contract.d.ts +22 -0
- package/dist/auth/lightdash-oauth-upstream-contract.js +36 -0
- package/dist/auth/lightdash-oauth-upstream-contract.test.d.ts +1 -0
- package/dist/auth/lightdash-oauth-upstream-contract.test.js +56 -0
- package/dist/auth/oauth-broker/as-metadata.d.ts +14 -0
- package/dist/auth/oauth-broker/as-metadata.js +20 -0
- package/dist/auth/oauth-broker/lightdash-token.d.ts +20 -0
- package/dist/auth/oauth-broker/lightdash-token.js +76 -0
- package/dist/auth/oauth-broker/pending-store.d.ts +127 -0
- package/dist/auth/oauth-broker/pending-store.js +151 -0
- package/dist/auth/oauth-broker/pending-store.test.d.ts +6 -0
- package/dist/auth/oauth-broker/pending-store.test.js +146 -0
- package/dist/auth/oauth-broker/pkce.d.ts +2 -0
- package/dist/auth/oauth-broker/pkce.js +17 -0
- package/dist/auth/oauth-broker/routes.d.ts +13 -0
- package/dist/auth/oauth-broker/routes.js +452 -0
- package/dist/auth/oauth-broker/routes.test.d.ts +1 -0
- package/dist/auth/oauth-broker/routes.test.js +242 -0
- package/dist/auth/providers/bearer-context-provider.d.ts +24 -0
- package/dist/auth/providers/bearer-context-provider.js +52 -0
- package/dist/auth/providers/env-context-provider.d.ts +13 -0
- package/dist/auth/providers/env-context-provider.js +19 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.d.ts +23 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.js +115 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.test.d.ts +1 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.test.js +202 -0
- package/dist/auth/resource-server/lightdash-token-validation.d.ts +14 -0
- package/dist/auth/resource-server/lightdash-token-validation.js +82 -0
- package/dist/auth/resource-server/lightdash-token-validation.test.d.ts +1 -0
- package/dist/auth/resource-server/lightdash-token-validation.test.js +177 -0
- package/dist/auth/resource-server/oauth-protected-resource.d.ts +25 -0
- package/dist/auth/resource-server/oauth-protected-resource.js +67 -0
- package/dist/auth/resource-server/shared-key-middleware.d.ts +13 -0
- package/dist/auth/resource-server/shared-key-middleware.js +24 -0
- package/dist/auth/resource-server/token-scopes.d.ts +15 -0
- package/dist/auth/resource-server/token-scopes.js +76 -0
- package/dist/auth/resource-server/token-scopes.test.d.ts +1 -0
- package/dist/auth/resource-server/token-scopes.test.js +51 -0
- package/dist/auth/resource-server/token-validation-cache.d.ts +15 -0
- package/dist/auth/resource-server/token-validation-cache.js +44 -0
- package/dist/auth/resource-server/token-validation-cache.test.d.ts +1 -0
- package/dist/auth/resource-server/token-validation-cache.test.js +41 -0
- package/dist/auth/resource-server/token-validation-error.d.ts +6 -0
- package/dist/auth/resource-server/token-validation-error.js +13 -0
- package/dist/auth/resource-server/www-authenticate.d.ts +8 -0
- package/dist/auth/resource-server/www-authenticate.js +24 -0
- package/dist/auth/resource-server/www-authenticate.test.d.ts +1 -0
- package/dist/auth/resource-server/www-authenticate.test.js +70 -0
- package/dist/auth/token-hash.d.ts +2 -0
- package/dist/auth/token-hash.js +8 -0
- package/dist/bin.d.ts +0 -4
- package/dist/bin.js +62 -33
- package/dist/config/env.d.ts +57 -0
- package/dist/config/env.js +60 -0
- package/dist/config/load-mcp-config.d.ts +30 -0
- package/dist/config/load-mcp-config.js +286 -0
- package/dist/config/load-mcp-config.test.d.ts +1 -0
- package/dist/config/load-mcp-config.test.js +202 -0
- package/dist/config/normalize-url.d.ts +13 -0
- package/dist/config/normalize-url.js +52 -0
- package/dist/config/normalize-url.test.d.ts +1 -0
- package/dist/config/normalize-url.test.js +47 -0
- package/dist/config/public-url.d.ts +3 -0
- package/dist/config/public-url.js +10 -0
- package/dist/config/runtime.d.ts +15 -0
- package/dist/config/runtime.js +48 -0
- package/dist/config/runtime.test.d.ts +1 -0
- package/dist/config/runtime.test.js +69 -0
- package/dist/config/test-mcp-http-config.d.ts +3 -0
- package/dist/config/test-mcp-http-config.js +7 -0
- package/dist/destructive/capability.d.ts +13 -0
- package/dist/destructive/capability.js +37 -0
- package/dist/destructive/capability.test.d.ts +1 -0
- package/dist/destructive/capability.test.js +46 -0
- package/dist/destructive/confirmation-claim.d.ts +21 -0
- package/dist/destructive/confirmation-claim.js +87 -0
- package/dist/destructive/confirmation-claim.test.d.ts +1 -0
- package/dist/destructive/confirmation-claim.test.js +50 -0
- package/dist/destructive/confirmation.d.ts +58 -0
- package/dist/destructive/confirmation.js +99 -0
- package/dist/destructive/confirmation.test.d.ts +1 -0
- package/dist/destructive/confirmation.test.js +75 -0
- package/dist/destructive/content-promote.d.ts +8 -0
- package/dist/destructive/content-promote.js +144 -0
- package/dist/destructive/content-soft-delete.d.ts +7 -0
- package/dist/destructive/content-soft-delete.js +106 -0
- package/dist/destructive/destructive-contract.test.d.ts +1 -0
- package/dist/destructive/destructive-contract.test.js +269 -0
- package/dist/destructive/precondition.d.ts +14 -0
- package/dist/destructive/precondition.js +31 -0
- package/dist/destructive/precondition.test.d.ts +1 -0
- package/dist/destructive/precondition.test.js +72 -0
- package/dist/destructive/promote-contract.test.d.ts +1 -0
- package/dist/destructive/promote-contract.test.js +339 -0
- package/dist/destructive/register-destructive-tool.d.ts +54 -0
- package/dist/destructive/register-destructive-tool.js +301 -0
- package/dist/destructive/request-state.d.ts +16 -0
- package/dist/destructive/request-state.js +76 -0
- package/dist/destructive/types.d.ts +64 -0
- package/dist/destructive/types.js +10 -0
- package/dist/governance/mcp-client-session.d.ts +9 -0
- package/dist/governance/mcp-client-session.js +30 -0
- package/dist/governance/mcp-client-session.test.d.ts +1 -0
- package/dist/governance/mcp-client-session.test.js +31 -0
- package/dist/governance/project-pin.d.ts +14 -0
- package/dist/governance/project-pin.js +44 -0
- package/dist/governance/project-pin.test.d.ts +1 -0
- package/dist/governance/project-pin.test.js +35 -0
- package/dist/governance/project-scope.d.ts +38 -0
- package/dist/governance/project-scope.js +79 -0
- package/dist/governance/project-scope.test.d.ts +4 -0
- package/dist/governance/project-scope.test.js +103 -0
- package/dist/http.d.ts +1 -2
- package/dist/http.integration.test.d.ts +1 -0
- package/dist/http.integration.test.js +722 -0
- package/dist/http.js +3 -170
- package/dist/http.test.d.ts +4 -0
- package/dist/http.test.js +131 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.integration.test.js +73 -30
- package/dist/index.js +28 -27
- package/dist/index.test.js +3 -3
- package/dist/logging/structured.d.ts +27 -0
- package/dist/logging/structured.js +32 -0
- package/dist/logging/structured.test.d.ts +1 -0
- package/dist/logging/structured.test.js +33 -0
- package/dist/personas/content-developer/v1/index.d.ts +10 -0
- package/dist/personas/content-developer/v1/index.js +51 -0
- package/dist/personas/content-developer/v1/prompts.d.ts +5 -0
- package/dist/personas/content-developer/v1/prompts.js +138 -0
- package/dist/personas/content-developer/v1/prompts.test.d.ts +4 -0
- package/dist/personas/content-developer/v1/prompts.test.js +75 -0
- package/dist/personas/content-developer/v1/resources/playbooks/content-move.md +15 -0
- package/dist/personas/content-developer/v1/resources/playbooks/core.md +63 -0
- package/dist/personas/content-developer/v1/resources/playbooks/dashboards.md +55 -0
- package/dist/personas/content-developer/v1/resources/playbooks/index.md +13 -0
- package/dist/personas/content-developer/v1/resources/playbooks.d.ts +10 -0
- package/dist/personas/content-developer/v1/resources/playbooks.js +44 -0
- package/dist/personas/content-governance/v1/index.d.ts +9 -0
- package/dist/personas/content-governance/v1/index.js +29 -0
- package/dist/personas/content-governance/v1/prompts.d.ts +5 -0
- package/dist/personas/content-governance/v1/prompts.js +87 -0
- package/dist/personas/content-governance/v1/prompts.test.d.ts +4 -0
- package/dist/personas/content-governance/v1/prompts.test.js +75 -0
- package/dist/personas/content-governance/v1/resources/playbooks/charts.md +29 -0
- package/dist/personas/content-governance/v1/resources/playbooks/core.md +52 -0
- package/dist/personas/content-governance/v1/resources/playbooks/dashboards.md +48 -0
- package/dist/personas/content-governance/v1/resources/playbooks/index.md +13 -0
- package/dist/personas/content-governance/v1/resources/playbooks.d.ts +10 -0
- package/dist/personas/content-governance/v1/resources/playbooks.js +41 -0
- package/dist/personas/content-reader/v1/index.d.ts +8 -0
- package/dist/personas/content-reader/v1/index.js +37 -0
- package/dist/personas/content-reader/v1/prompts.d.ts +5 -0
- package/dist/personas/content-reader/v1/prompts.js +128 -0
- package/dist/personas/content-reader/v1/prompts.test.d.ts +4 -0
- package/dist/personas/content-reader/v1/prompts.test.js +25 -0
- package/dist/personas/content-reader/v1/resources/playbooks/compare.md +21 -0
- package/dist/personas/content-reader/v1/resources/playbooks/core.md +40 -0
- package/dist/personas/content-reader/v1/resources/playbooks/discover.md +13 -0
- package/dist/personas/content-reader/v1/resources/playbooks/explain-run.md +19 -0
- package/dist/personas/content-reader/v1/resources/playbooks/index.md +14 -0
- package/dist/personas/content-reader/v1/resources/playbooks.d.ts +10 -0
- package/dist/personas/content-reader/v1/resources/playbooks.js +49 -0
- package/dist/personas/index.d.ts +22 -0
- package/dist/personas/index.js +73 -0
- package/dist/personas/index.test.d.ts +1 -0
- package/dist/personas/index.test.js +109 -0
- package/dist/personas/lib/playbook-resources.d.ts +79 -0
- package/dist/personas/lib/playbook-resources.js +165 -0
- package/dist/personas/organization-audit/v1/index.d.ts +8 -0
- package/dist/personas/organization-audit/v1/index.js +42 -0
- package/dist/personas/organization-audit/v1/prompts.d.ts +5 -0
- package/dist/personas/organization-audit/v1/prompts.js +92 -0
- package/dist/personas/organization-audit/v1/prompts.test.d.ts +4 -0
- package/dist/personas/organization-audit/v1/prompts.test.js +25 -0
- package/dist/personas/organization-audit/v1/resources/playbooks/access.md +13 -0
- package/dist/personas/organization-audit/v1/resources/playbooks/content.md +9 -0
- package/dist/personas/organization-audit/v1/resources/playbooks/core.md +36 -0
- package/dist/personas/organization-audit/v1/resources/playbooks/deliveries.md +9 -0
- package/dist/personas/organization-audit/v1/resources/playbooks/index.md +14 -0
- package/dist/personas/organization-audit/v1/resources/playbooks.d.ts +10 -0
- package/dist/personas/organization-audit/v1/resources/playbooks.js +41 -0
- package/dist/personas/persona.parity.test.d.ts +1 -0
- package/dist/personas/persona.parity.test.js +26 -0
- package/dist/personas/semantic-layer/v1/index.d.ts +8 -0
- package/dist/personas/semantic-layer/v1/index.js +32 -0
- package/dist/personas/semantic-layer/v1/prompts.d.ts +5 -0
- package/dist/personas/semantic-layer/v1/prompts.js +85 -0
- package/dist/personas/semantic-layer/v1/prompts.test.d.ts +4 -0
- package/dist/personas/semantic-layer/v1/prompts.test.js +19 -0
- package/dist/personas/semantic-layer/v1/resources/playbooks/compose-compile.md +55 -0
- package/dist/personas/semantic-layer/v1/resources/playbooks/core.md +39 -0
- package/dist/personas/semantic-layer/v1/resources/playbooks/explore.md +76 -0
- package/dist/personas/semantic-layer/v1/resources/playbooks/index.md +13 -0
- package/dist/personas/semantic-layer/v1/resources/playbooks.d.ts +13 -0
- package/dist/personas/semantic-layer/v1/resources/playbooks.js +39 -0
- package/dist/personas/types.d.ts +19 -0
- package/dist/personas/types.js +5 -0
- package/dist/policy/content-developer.d.ts +35 -0
- package/dist/policy/content-developer.js +91 -0
- package/dist/policy/content-developer.test.d.ts +4 -0
- package/dist/policy/content-developer.test.js +48 -0
- package/dist/policy/content-reader.d.ts +24 -0
- package/dist/policy/content-reader.js +52 -0
- package/dist/policy/content-reader.test.d.ts +4 -0
- package/dist/policy/content-reader.test.js +22 -0
- package/dist/policy/envelope.d.ts +31 -0
- package/dist/policy/envelope.js +24 -0
- package/dist/policy/preview-ledger-fault.test.d.ts +1 -0
- package/dist/policy/preview-ledger-fault.test.js +527 -0
- package/dist/policy/preview-ledger.d.ts +118 -0
- package/dist/policy/preview-ledger.js +243 -0
- package/dist/policy/preview-ledger.test.d.ts +1 -0
- package/dist/policy/preview-ledger.test.js +267 -0
- package/dist/policy/result-limits.d.ts +27 -0
- package/dist/policy/result-limits.js +107 -0
- package/dist/policy/result-limits.test.d.ts +4 -0
- package/dist/policy/result-limits.test.js +28 -0
- package/dist/protocol-contract.test.d.ts +1 -0
- package/dist/protocol-contract.test.js +42 -0
- package/dist/server/capabilities.d.ts +15 -0
- package/dist/server/capabilities.js +19 -0
- package/dist/server/capabilities.test.d.ts +1 -0
- package/dist/server/capabilities.test.js +41 -0
- package/dist/server/errors.test.d.ts +1 -0
- package/dist/server/errors.test.js +53 -0
- package/dist/server/request-context.d.ts +13 -0
- package/dist/server/request-context.js +2 -0
- package/dist/server/server.d.ts +4 -0
- package/dist/server/server.js +28 -0
- package/dist/server/server.test.d.ts +1 -0
- package/dist/server/server.test.js +15 -0
- package/dist/server/version.d.ts +1 -0
- package/dist/server/version.js +7 -0
- package/dist/server/version.test.d.ts +1 -0
- package/dist/server/version.test.js +9 -0
- package/dist/stdio.process.test.d.ts +1 -0
- package/dist/stdio.process.test.js +274 -0
- package/dist/store/config.d.ts +11 -0
- package/dist/store/config.js +50 -0
- package/dist/store/config.test.d.ts +1 -0
- package/dist/store/config.test.js +56 -0
- package/dist/store/create-oauth-broker-store.d.ts +6 -0
- package/dist/store/create-oauth-broker-store.js +16 -0
- package/dist/store/create-preview-store.d.ts +10 -0
- package/dist/store/create-preview-store.js +30 -0
- package/dist/store/create-session-store.d.ts +19 -0
- package/dist/store/create-session-store.js +24 -0
- package/dist/store/in-memory-preview-store.d.ts +17 -0
- package/dist/store/in-memory-preview-store.js +72 -0
- package/dist/store/redis-client.d.ts +11 -0
- package/dist/store/redis-client.js +48 -0
- package/dist/store/redis-oauth-broker-store.d.ts +42 -0
- package/dist/store/redis-oauth-broker-store.js +167 -0
- package/dist/store/redis-oauth-broker-store.test.d.ts +1 -0
- package/dist/store/redis-oauth-broker-store.test.js +80 -0
- package/dist/store/redis-preview-store.d.ts +23 -0
- package/dist/store/redis-preview-store.js +94 -0
- package/dist/store/redis-preview-store.test.d.ts +1 -0
- package/dist/store/redis-preview-store.test.js +39 -0
- package/dist/store/redis-session-index.d.ts +33 -0
- package/dist/store/redis-session-index.js +49 -0
- package/dist/store/types.d.ts +13 -0
- package/dist/store/types.js +8 -0
- package/dist/tools/composition/explain-content.d.ts +6 -0
- package/dist/tools/composition/explain-content.js +108 -0
- package/dist/tools/index.d.ts +2 -4
- package/dist/tools/index.js +4 -30
- package/dist/tools/index.test.d.ts +1 -0
- package/dist/tools/index.test.js +72 -0
- package/dist/tools/lib/api-errors.d.ts +11 -0
- package/dist/tools/lib/api-errors.js +27 -0
- package/dist/tools/lib/api-shape.d.ts +16 -0
- package/dist/tools/lib/api-shape.js +47 -0
- package/dist/tools/lib/assert-safe.d.ts +13 -0
- package/dist/tools/lib/assert-safe.js +21 -0
- package/dist/tools/lib/assert-safe.test.d.ts +4 -0
- package/dist/tools/lib/assert-safe.test.js +32 -0
- package/dist/tools/lib/concurrency.d.ts +4 -0
- package/dist/tools/lib/concurrency.js +24 -0
- package/dist/tools/lib/contracts.d.ts +34 -0
- package/dist/tools/lib/contracts.js +30 -0
- package/dist/tools/lib/redaction.d.ts +107 -0
- package/dist/tools/lib/redaction.js +299 -0
- package/dist/tools/lib/redaction.test.d.ts +4 -0
- package/dist/tools/lib/redaction.test.js +216 -0
- package/dist/tools/lib/register-org-audit.d.ts +9 -0
- package/dist/tools/lib/register-org-audit.js +20 -0
- package/dist/tools/lib/schema-fields.d.ts +9 -0
- package/dist/tools/lib/schema-fields.js +19 -0
- package/dist/tools/lib/stable-stringify.d.ts +9 -0
- package/dist/tools/lib/stable-stringify.js +35 -0
- package/dist/tools/organization/binding.d.ts +14 -0
- package/dist/tools/organization/binding.js +31 -0
- package/dist/tools/organization/invariants.test.d.ts +4 -0
- package/dist/tools/organization/invariants.test.js +28 -0
- package/dist/tools/organization/inventory.d.ts +10 -0
- package/dist/tools/organization/inventory.js +189 -0
- package/dist/tools/organization/roles.d.ts +10 -0
- package/dist/tools/organization/roles.js +213 -0
- package/dist/tools/project/content.d.ts +9 -0
- package/dist/tools/project/content.js +192 -0
- package/dist/tools/project/delete-chart.d.ts +4 -0
- package/dist/tools/project/delete-chart.js +8 -0
- package/dist/tools/project/delete-dashboard.d.ts +4 -0
- package/dist/tools/project/delete-dashboard.js +8 -0
- package/dist/tools/project/developer-content-preview.d.ts +12 -0
- package/dist/tools/project/developer-content-preview.js +286 -0
- package/dist/tools/project/developer-content-shared.d.ts +18 -0
- package/dist/tools/project/developer-content-shared.js +46 -0
- package/dist/tools/project/developer-content-shared.test.d.ts +1 -0
- package/dist/tools/project/developer-content-shared.test.js +25 -0
- package/dist/tools/project/developer-content.d.ts +39 -0
- package/dist/tools/project/developer-content.js +584 -0
- package/dist/tools/project/developer-helpers.d.ts +180 -0
- package/dist/tools/project/developer-helpers.js +484 -0
- package/dist/tools/project/developer-helpers.test.d.ts +1 -0
- package/dist/tools/project/developer-helpers.test.js +509 -0
- package/dist/tools/project/get-dashboard-promote-diff.d.ts +6 -0
- package/dist/tools/project/get-dashboard-promote-diff.js +42 -0
- package/dist/tools/project/invariants.test.d.ts +4 -0
- package/dist/tools/project/invariants.test.js +42 -0
- package/dist/tools/project/parameters.d.ts +7 -0
- package/dist/tools/project/parameters.js +74 -0
- package/dist/tools/project/projects.d.ts +10 -0
- package/dist/tools/project/projects.js +102 -0
- package/dist/tools/project/projects.test.d.ts +1 -0
- package/dist/tools/project/projects.test.js +154 -0
- package/dist/tools/project/promote-dashboard.d.ts +4 -0
- package/dist/tools/project/promote-dashboard.js +8 -0
- package/dist/tools/project/reader-content.d.ts +9 -0
- package/dist/tools/project/reader-content.js +208 -0
- package/dist/tools/project/reader-execution.d.ts +7 -0
- package/dist/tools/project/reader-execution.js +214 -0
- package/dist/tools/project/schedulers.d.ts +7 -0
- package/dist/tools/project/schedulers.js +115 -0
- package/dist/tools/project/schemas/chart-upsert.d.ts +33 -0
- package/dist/tools/project/schemas/chart-upsert.js +66 -0
- package/dist/tools/project/schemas/dashboard-tile.d.ts +29 -0
- package/dist/tools/project/schemas/dashboard-tile.js +57 -0
- package/dist/tools/project/schemas/dashboard.d.ts +70 -0
- package/dist/tools/project/schemas/dashboard.js +101 -0
- package/dist/tools/project/schemas/duplicate.d.ts +30 -0
- package/dist/tools/project/schemas/duplicate.js +86 -0
- package/dist/tools/project/schemas/index.d.ts +7 -0
- package/dist/tools/project/schemas/index.js +26 -0
- package/dist/tools/project/schemas/parse-helpers.d.ts +14 -0
- package/dist/tools/project/schemas/parse-helpers.js +34 -0
- package/dist/tools/project/schemas/payload-schemas.test.d.ts +1 -0
- package/dist/tools/project/schemas/payload-schemas.test.js +204 -0
- package/dist/tools/project/spaces.d.ts +7 -0
- package/dist/tools/project/spaces.js +101 -0
- package/dist/tools/query/bounded-saved-query.d.ts +37 -0
- package/dist/tools/query/bounded-saved-query.js +80 -0
- package/dist/tools/query/bounded-saved-query.test.d.ts +4 -0
- package/dist/tools/query/bounded-saved-query.test.js +82 -0
- package/dist/tools/query/chart-source.d.ts +10 -0
- package/dist/tools/query/chart-source.js +36 -0
- package/dist/tools/query/chart-source.test.d.ts +1 -0
- package/dist/tools/query/chart-source.test.js +62 -0
- package/dist/tools/query/filter-overrides.d.ts +34 -0
- package/dist/tools/query/filter-overrides.js +75 -0
- package/dist/tools/query/filter-overrides.test.d.ts +1 -0
- package/dist/tools/query/filter-overrides.test.js +21 -0
- package/dist/tools/query/lifecycle.d.ts +7 -0
- package/dist/tools/query/lifecycle.js +112 -0
- package/dist/tools/query/query-ledger.d.ts +34 -0
- package/dist/tools/query/query-ledger.js +86 -0
- package/dist/tools/query/query-ledger.test.d.ts +1 -0
- package/dist/tools/query/query-ledger.test.js +73 -0
- package/dist/tools/query/reader-tool-helpers.d.ts +12 -0
- package/dist/tools/query/reader-tool-helpers.js +59 -0
- package/dist/tools/query/reader-tool-helpers.test.d.ts +1 -0
- package/dist/tools/query/reader-tool-helpers.test.js +49 -0
- package/dist/tools/query/result-normalizer.d.ts +27 -0
- package/dist/tools/query/result-normalizer.js +133 -0
- package/dist/tools/query/result-normalizer.test.d.ts +1 -0
- package/dist/tools/query/result-normalizer.test.js +41 -0
- package/dist/tools/query/wait-for-async.d.ts +10 -0
- package/dist/tools/query/wait-for-async.js +46 -0
- package/dist/tools/query/wait-for-async.test.d.ts +1 -0
- package/dist/tools/query/wait-for-async.test.js +45 -0
- package/dist/tools/registry.d.ts +225 -0
- package/dist/tools/registry.js +115 -0
- package/dist/tools/semantic/explore-helpers.d.ts +56 -0
- package/dist/tools/semantic/explore-helpers.js +115 -0
- package/dist/tools/semantic/explore-helpers.test.d.ts +1 -0
- package/dist/tools/semantic/explore-helpers.test.js +170 -0
- package/dist/tools/semantic/explores.d.ts +9 -0
- package/dist/tools/semantic/explores.js +80 -0
- package/dist/tools/semantic/metrics.d.ts +7 -0
- package/dist/tools/semantic/metrics.js +53 -0
- package/dist/tools/semantic/query.d.ts +6 -0
- package/dist/tools/semantic/query.js +42 -0
- package/dist/tools/semantic/schema-fields.d.ts +3 -0
- package/dist/tools/semantic/schema-fields.js +7 -0
- package/dist/tools/shared.d.ts +51 -15
- package/dist/tools/shared.js +171 -163
- package/dist/tools/shared.test.js +137 -184
- package/dist/tools/space/access.d.ts +66 -0
- package/dist/tools/space/access.js +322 -0
- package/dist/tools/space/access.test.d.ts +4 -0
- package/dist/tools/space/access.test.js +90 -0
- package/dist/transports/http-body.d.ts +5 -0
- package/dist/transports/http-body.js +50 -0
- package/dist/transports/http-request-utils.d.ts +2 -0
- package/dist/transports/http-request-utils.js +13 -0
- package/dist/transports/http-response.d.ts +6 -0
- package/dist/transports/http-response.js +56 -0
- package/dist/transports/session-store.d.ts +72 -0
- package/dist/transports/session-store.js +143 -0
- package/dist/transports/session-store.test.d.ts +1 -0
- package/dist/transports/session-store.test.js +111 -0
- package/dist/transports/streamable-http.d.ts +9 -0
- package/dist/transports/streamable-http.js +461 -0
- package/dist/transports/streamable-http.test.d.ts +1 -0
- package/dist/transports/streamable-http.test.js +100 -0
- package/package.json +26 -10
- package/dist/audit.d.ts +0 -6
- package/dist/config.d.ts +0 -47
- package/dist/config.js +0 -82
- package/dist/tools/ai-agents.d.ts +0 -6
- package/dist/tools/ai-agents.js +0 -388
- package/dist/tools/charts.d.ts +0 -6
- package/dist/tools/charts.js +0 -55
- package/dist/tools/content.d.ts +0 -6
- package/dist/tools/content.js +0 -37
- package/dist/tools/dashboards.d.ts +0 -6
- package/dist/tools/dashboards.js +0 -28
- package/dist/tools/explores.d.ts +0 -6
- package/dist/tools/explores.js +0 -65
- package/dist/tools/groups.d.ts +0 -6
- package/dist/tools/groups.js +0 -121
- package/dist/tools/metrics.d.ts +0 -6
- package/dist/tools/metrics.js +0 -45
- package/dist/tools/projects.d.ts +0 -6
- package/dist/tools/projects.js +0 -58
- package/dist/tools/query.d.ts +0 -6
- package/dist/tools/query.js +0 -34
- package/dist/tools/schedulers.d.ts +0 -6
- package/dist/tools/schedulers.js +0 -45
- package/dist/tools/spaces.d.ts +0 -6
- package/dist/tools/spaces.js +0 -128
- package/dist/tools/tags.d.ts +0 -6
- package/dist/tools/tags.js +0 -28
- package/dist/tools/users.d.ts +0 -6
- package/dist/tools/users.js +0 -50
- package/src/audit.ts +0 -6
- package/src/bin.ts +0 -58
- package/src/config.ts +0 -83
- package/src/errors.ts +0 -27
- package/src/http.ts +0 -187
- package/src/index.integration.test.ts +0 -57
- package/src/index.test.ts +0 -8
- package/src/index.ts +0 -31
- package/src/tools/ai-agents.ts +0 -759
- package/src/tools/charts.ts +0 -85
- package/src/tools/content.ts +0 -44
- package/src/tools/dashboards.ts +0 -25
- package/src/tools/explores.ts +0 -98
- package/src/tools/groups.ts +0 -180
- package/src/tools/index.ts +0 -35
- package/src/tools/metrics.ts +0 -42
- package/src/tools/projects.ts +0 -74
- package/src/tools/query.ts +0 -47
- package/src/tools/schedulers.ts +0 -42
- package/src/tools/shared.test.ts +0 -365
- package/src/tools/shared.ts +0 -274
- package/src/tools/spaces.ts +0 -217
- package/src/tools/tags.ts +0 -25
- package/src/tools/users.ts +0 -64
- package/tsconfig.json +0 -13
- /package/dist/{errors.d.ts → server/errors.d.ts} +0 -0
- /package/dist/{errors.js → server/errors.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Content-reader multi-playbook resources (core + topics + index).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CONTENT_READER_TOPIC_PLAYBOOKS = exports.CONTENT_READER_CORE_PLAYBOOK = exports.getAllPlaybookMarkdown = exports.CONTENT_READER_HARD_BANS = void 0;
|
|
7
|
+
exports.registerContentReaderPlaybook = registerContentReaderPlaybook;
|
|
8
|
+
const playbook_resources_js_1 = require("../../../lib/playbook-resources.js");
|
|
9
|
+
const playbooks = (0, playbook_resources_js_1.definePersonaPlaybooks)({
|
|
10
|
+
personaId: 'content-reader',
|
|
11
|
+
moduleDir: __dirname,
|
|
12
|
+
hardBans: `Do not mutate Lightdash resources.
|
|
13
|
+
Do not execute arbitrary metric queries, raw SQL, or underlying-data queries.
|
|
14
|
+
Do not download or bulk-export results.
|
|
15
|
+
Do not execute saved SQL charts (disabled by default on content-reader).
|
|
16
|
+
Do not override filter targets, operators, required-filter behavior, fields, metrics, dimensions, SQL, table calculations, or sorts.
|
|
17
|
+
Do not execute content outside the resolved project.
|
|
18
|
+
Do not present truncated results as complete.
|
|
19
|
+
Do not claim metric equivalence from matching labels alone.
|
|
20
|
+
Do not reveal secrets, warehouse credentials, hidden SQL, or inaccessible content.`,
|
|
21
|
+
coreDescription: 'Hard bans, tools, and project scope',
|
|
22
|
+
topics: [
|
|
23
|
+
{
|
|
24
|
+
id: 'discover',
|
|
25
|
+
title: 'Content-reader discover playbook',
|
|
26
|
+
description: 'Intent classification and content discovery',
|
|
27
|
+
file: 'discover.md',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'explain-run',
|
|
31
|
+
title: 'Content-reader explain/run playbook',
|
|
32
|
+
description: 'Inspect metadata and execute bounded saved content',
|
|
33
|
+
file: 'explain-run.md',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'compare',
|
|
37
|
+
title: 'Content-reader compare playbook',
|
|
38
|
+
description: 'Compare and investigate differences between saved content',
|
|
39
|
+
file: 'compare.md',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
});
|
|
43
|
+
exports.CONTENT_READER_HARD_BANS = playbooks.HARD_BANS;
|
|
44
|
+
exports.getAllPlaybookMarkdown = playbooks.getAllPlaybookMarkdown;
|
|
45
|
+
exports.CONTENT_READER_CORE_PLAYBOOK = playbooks.CORE_PLAYBOOK;
|
|
46
|
+
exports.CONTENT_READER_TOPIC_PLAYBOOKS = playbooks.TOPIC_PLAYBOOKS;
|
|
47
|
+
function registerContentReaderPlaybook(server) {
|
|
48
|
+
playbooks.registerPlaybooks(server);
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shipped MCP personas (path → definition). No PERSONA/PATH env knobs.
|
|
3
|
+
*/
|
|
4
|
+
import type { PersonaDefinition, PersonaId } from './types.js';
|
|
5
|
+
export type { PersonaDefinition, PersonaId } from './types.js';
|
|
6
|
+
export { SEMANTIC_LAYER_PERSONA_PATH } from './semantic-layer/v1/index.js';
|
|
7
|
+
export { ORGANIZATION_AUDIT_PERSONA_PATH } from './organization-audit/v1/index.js';
|
|
8
|
+
export { CONTENT_READER_PERSONA_PATH } from './content-reader/v1/index.js';
|
|
9
|
+
export { CONTENT_DEVELOPER_PERSONA_PATH } from './content-developer/v1/index.js';
|
|
10
|
+
export { CONTENT_GOVERNANCE_PERSONA_PATH } from './content-governance/v1/index.js';
|
|
11
|
+
/** Default stdio persona (backward compatible). */
|
|
12
|
+
export declare const DEFAULT_PERSONA_ID: PersonaId;
|
|
13
|
+
export declare const PERSONAS: Record<PersonaId, PersonaDefinition>;
|
|
14
|
+
export declare function getPersona(id: PersonaId): PersonaDefinition;
|
|
15
|
+
export declare function getDefaultPersona(): PersonaDefinition;
|
|
16
|
+
/** Resolve persona from an HTTP request path, or undefined if unknown. */
|
|
17
|
+
export declare function getPersonaByPath(path: string): PersonaDefinition | undefined;
|
|
18
|
+
export declare function listPersonaPaths(): string[];
|
|
19
|
+
/** Parse a CLI persona id; returns undefined when invalid. */
|
|
20
|
+
export declare function parsePersonaId(value: string): PersonaId | undefined;
|
|
21
|
+
/** MCP server display name for a persona. */
|
|
22
|
+
export declare function getPersonaServerName(persona: PersonaDefinition): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shipped MCP personas (path → definition). No PERSONA/PATH env knobs.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PERSONAS = exports.DEFAULT_PERSONA_ID = exports.CONTENT_GOVERNANCE_PERSONA_PATH = exports.CONTENT_DEVELOPER_PERSONA_PATH = exports.CONTENT_READER_PERSONA_PATH = exports.ORGANIZATION_AUDIT_PERSONA_PATH = exports.SEMANTIC_LAYER_PERSONA_PATH = void 0;
|
|
7
|
+
exports.getPersona = getPersona;
|
|
8
|
+
exports.getDefaultPersona = getDefaultPersona;
|
|
9
|
+
exports.getPersonaByPath = getPersonaByPath;
|
|
10
|
+
exports.listPersonaPaths = listPersonaPaths;
|
|
11
|
+
exports.parsePersonaId = parsePersonaId;
|
|
12
|
+
exports.getPersonaServerName = getPersonaServerName;
|
|
13
|
+
const normalize_url_js_1 = require("../config/normalize-url.js");
|
|
14
|
+
const index_js_1 = require("./content-developer/v1/index.js");
|
|
15
|
+
const index_js_2 = require("./content-governance/v1/index.js");
|
|
16
|
+
const index_js_3 = require("./content-reader/v1/index.js");
|
|
17
|
+
const index_js_4 = require("./organization-audit/v1/index.js");
|
|
18
|
+
const index_js_5 = require("./semantic-layer/v1/index.js");
|
|
19
|
+
var index_js_6 = require("./semantic-layer/v1/index.js");
|
|
20
|
+
Object.defineProperty(exports, "SEMANTIC_LAYER_PERSONA_PATH", { enumerable: true, get: function () { return index_js_6.SEMANTIC_LAYER_PERSONA_PATH; } });
|
|
21
|
+
var index_js_7 = require("./organization-audit/v1/index.js");
|
|
22
|
+
Object.defineProperty(exports, "ORGANIZATION_AUDIT_PERSONA_PATH", { enumerable: true, get: function () { return index_js_7.ORGANIZATION_AUDIT_PERSONA_PATH; } });
|
|
23
|
+
var index_js_8 = require("./content-reader/v1/index.js");
|
|
24
|
+
Object.defineProperty(exports, "CONTENT_READER_PERSONA_PATH", { enumerable: true, get: function () { return index_js_8.CONTENT_READER_PERSONA_PATH; } });
|
|
25
|
+
var index_js_9 = require("./content-developer/v1/index.js");
|
|
26
|
+
Object.defineProperty(exports, "CONTENT_DEVELOPER_PERSONA_PATH", { enumerable: true, get: function () { return index_js_9.CONTENT_DEVELOPER_PERSONA_PATH; } });
|
|
27
|
+
var index_js_10 = require("./content-governance/v1/index.js");
|
|
28
|
+
Object.defineProperty(exports, "CONTENT_GOVERNANCE_PERSONA_PATH", { enumerable: true, get: function () { return index_js_10.CONTENT_GOVERNANCE_PERSONA_PATH; } });
|
|
29
|
+
/** Default stdio persona (backward compatible). */
|
|
30
|
+
exports.DEFAULT_PERSONA_ID = 'semantic-layer';
|
|
31
|
+
exports.PERSONAS = {
|
|
32
|
+
'semantic-layer': index_js_5.semanticLayerPersona,
|
|
33
|
+
'organization-audit': index_js_4.organizationAuditPersona,
|
|
34
|
+
'content-reader': index_js_3.contentReaderPersona,
|
|
35
|
+
'content-developer': index_js_1.contentDeveloperPersona,
|
|
36
|
+
'content-governance': index_js_2.contentGovernancePersona,
|
|
37
|
+
};
|
|
38
|
+
const PERSONAS_BY_PATH = new Map(Object.values(exports.PERSONAS).map((persona) => [persona.path, persona]));
|
|
39
|
+
function getPersona(id) {
|
|
40
|
+
// eslint-disable-next-line security/detect-object-injection -- PersonaId union
|
|
41
|
+
return exports.PERSONAS[id];
|
|
42
|
+
}
|
|
43
|
+
function getDefaultPersona() {
|
|
44
|
+
return getPersona(exports.DEFAULT_PERSONA_ID);
|
|
45
|
+
}
|
|
46
|
+
/** Resolve persona from an HTTP request path, or undefined if unknown. */
|
|
47
|
+
function getPersonaByPath(path) {
|
|
48
|
+
try {
|
|
49
|
+
return PERSONAS_BY_PATH.get((0, normalize_url_js_1.normalizeMcpPath)(path));
|
|
50
|
+
}
|
|
51
|
+
catch (_a) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function listPersonaPaths() {
|
|
56
|
+
return [...PERSONAS_BY_PATH.keys()];
|
|
57
|
+
}
|
|
58
|
+
/** Parse a CLI persona id; returns undefined when invalid. */
|
|
59
|
+
function parsePersonaId(value) {
|
|
60
|
+
if (value === 'semantic-layer' ||
|
|
61
|
+
value === 'organization-audit' ||
|
|
62
|
+
value === 'content-reader' ||
|
|
63
|
+
value === 'content-developer' ||
|
|
64
|
+
value === 'content-governance') {
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
/** MCP server display name for a persona. */
|
|
70
|
+
function getPersonaServerName(persona) {
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = persona.serverName) !== null && _a !== void 0 ? _a : `lightdash-mcp-${persona.id}`;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const registry_js_1 = require("../tools/registry.js");
|
|
5
|
+
const shared_js_1 = require("../tools/shared.js");
|
|
6
|
+
const index_js_1 = require("./content-developer/v1/index.js");
|
|
7
|
+
const index_js_2 = require("./content-governance/v1/index.js");
|
|
8
|
+
const index_js_3 = require("./content-reader/v1/index.js");
|
|
9
|
+
const index_js_4 = require("./organization-audit/v1/index.js");
|
|
10
|
+
const index_js_5 = require("./index.js");
|
|
11
|
+
(0, vitest_1.describe)('personas', () => {
|
|
12
|
+
(0, vitest_1.it)('ships five personas with fixed paths', () => {
|
|
13
|
+
var _a, _b, _c, _d, _e;
|
|
14
|
+
(0, vitest_1.expect)(Object.keys(index_js_5.PERSONAS).sort()).toEqual([
|
|
15
|
+
'content-developer',
|
|
16
|
+
'content-governance',
|
|
17
|
+
'content-reader',
|
|
18
|
+
'organization-audit',
|
|
19
|
+
'semantic-layer',
|
|
20
|
+
]);
|
|
21
|
+
(0, vitest_1.expect)(index_js_5.DEFAULT_PERSONA_ID).toBe('semantic-layer');
|
|
22
|
+
(0, vitest_1.expect)((0, index_js_5.listPersonaPaths)().sort()).toEqual([
|
|
23
|
+
index_js_5.CONTENT_DEVELOPER_PERSONA_PATH,
|
|
24
|
+
index_js_5.CONTENT_GOVERNANCE_PERSONA_PATH,
|
|
25
|
+
index_js_5.CONTENT_READER_PERSONA_PATH,
|
|
26
|
+
index_js_5.ORGANIZATION_AUDIT_PERSONA_PATH,
|
|
27
|
+
index_js_5.SEMANTIC_LAYER_PERSONA_PATH,
|
|
28
|
+
].sort());
|
|
29
|
+
(0, vitest_1.expect)((_a = (0, index_js_5.getPersonaByPath)(index_js_5.SEMANTIC_LAYER_PERSONA_PATH)) === null || _a === void 0 ? void 0 : _a.id).toBe('semantic-layer');
|
|
30
|
+
(0, vitest_1.expect)((_b = (0, index_js_5.getPersonaByPath)(index_js_5.ORGANIZATION_AUDIT_PERSONA_PATH)) === null || _b === void 0 ? void 0 : _b.id).toBe('organization-audit');
|
|
31
|
+
(0, vitest_1.expect)((_c = (0, index_js_5.getPersonaByPath)(index_js_5.CONTENT_READER_PERSONA_PATH)) === null || _c === void 0 ? void 0 : _c.id).toBe('content-reader');
|
|
32
|
+
(0, vitest_1.expect)((_d = (0, index_js_5.getPersonaByPath)(index_js_5.CONTENT_DEVELOPER_PERSONA_PATH)) === null || _d === void 0 ? void 0 : _d.id).toBe('content-developer');
|
|
33
|
+
(0, vitest_1.expect)((_e = (0, index_js_5.getPersonaByPath)(index_js_5.CONTENT_GOVERNANCE_PERSONA_PATH)) === null || _e === void 0 ? void 0 : _e.id).toBe('content-governance');
|
|
34
|
+
(0, vitest_1.expect)((0, index_js_5.getPersonaByPath)('/mcp')).toBeUndefined();
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.it)('normalizes trailing slashes when resolving path', () => {
|
|
37
|
+
var _a, _b, _c, _d, _e;
|
|
38
|
+
(0, vitest_1.expect)((_a = (0, index_js_5.getPersonaByPath)(`${index_js_5.SEMANTIC_LAYER_PERSONA_PATH}/`)) === null || _a === void 0 ? void 0 : _a.id).toBe('semantic-layer');
|
|
39
|
+
(0, vitest_1.expect)((_b = (0, index_js_5.getPersonaByPath)(`${index_js_5.ORGANIZATION_AUDIT_PERSONA_PATH}/`)) === null || _b === void 0 ? void 0 : _b.id).toBe('organization-audit');
|
|
40
|
+
(0, vitest_1.expect)((_c = (0, index_js_5.getPersonaByPath)(`${index_js_5.CONTENT_READER_PERSONA_PATH}/`)) === null || _c === void 0 ? void 0 : _c.id).toBe('content-reader');
|
|
41
|
+
(0, vitest_1.expect)((_d = (0, index_js_5.getPersonaByPath)(`${index_js_5.CONTENT_DEVELOPER_PERSONA_PATH}/`)) === null || _d === void 0 ? void 0 : _d.id).toBe('content-developer');
|
|
42
|
+
(0, vitest_1.expect)((_e = (0, index_js_5.getPersonaByPath)(`${index_js_5.CONTENT_GOVERNANCE_PERSONA_PATH}/`)) === null || _e === void 0 ? void 0 : _e.id).toBe('content-governance');
|
|
43
|
+
});
|
|
44
|
+
(0, vitest_1.it)('semantic-layer allowlists exactly nine tools', () => {
|
|
45
|
+
const persona = (0, index_js_5.getPersona)('semantic-layer');
|
|
46
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(9);
|
|
47
|
+
(0, vitest_1.expect)((0, index_js_5.getDefaultPersona)().toolIds).toEqual(persona.toolIds);
|
|
48
|
+
});
|
|
49
|
+
(0, vitest_1.it)('organization-audit allowlists 18 tools and short server name', () => {
|
|
50
|
+
const persona = (0, index_js_5.getPersona)('organization-audit');
|
|
51
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(18);
|
|
52
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_4.ORGANIZATION_AUDIT_TOOL_IDS]);
|
|
53
|
+
(0, vitest_1.expect)((0, index_js_5.getPersonaServerName)(persona)).toBe('lightdash-mcp-org-audit');
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.it)('content-reader allowlists 13 tools and server name', () => {
|
|
56
|
+
const persona = (0, index_js_5.getPersona)('content-reader');
|
|
57
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(13);
|
|
58
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_3.CONTENT_READER_TOOL_IDS]);
|
|
59
|
+
(0, vitest_1.expect)((0, index_js_5.getPersonaServerName)(persona)).toBe('lightdash-mcp-content');
|
|
60
|
+
});
|
|
61
|
+
(0, vitest_1.it)('content-developer allowlists 25 tools and short server name', () => {
|
|
62
|
+
const persona = (0, index_js_5.getPersona)('content-developer');
|
|
63
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(25);
|
|
64
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_1.CONTENT_DEVELOPER_TOOL_IDS]);
|
|
65
|
+
(0, vitest_1.expect)(persona.toolIds).not.toContain('create_space');
|
|
66
|
+
(0, vitest_1.expect)(persona.toolIds).not.toContain('update_space');
|
|
67
|
+
(0, vitest_1.expect)((0, index_js_5.getPersonaServerName)(persona)).toBe('lightdash-mcp-cdev');
|
|
68
|
+
});
|
|
69
|
+
(0, vitest_1.it)('content-governance allowlists soft-delete + promote tools and short server name', () => {
|
|
70
|
+
const persona = (0, index_js_5.getPersona)('content-governance');
|
|
71
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(4);
|
|
72
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_2.CONTENT_GOVERNANCE_TOOL_IDS]);
|
|
73
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([
|
|
74
|
+
'delete_chart',
|
|
75
|
+
'delete_dashboard',
|
|
76
|
+
'get_dashboard_promote_diff',
|
|
77
|
+
'promote_dashboard',
|
|
78
|
+
]);
|
|
79
|
+
(0, vitest_1.expect)((0, index_js_5.getPersonaServerName)(persona)).toBe('lightdash-mcp-gov');
|
|
80
|
+
});
|
|
81
|
+
(0, vitest_1.it)('keeps combined server+tool wire names under 60 characters', () => {
|
|
82
|
+
for (const persona of Object.values(index_js_5.PERSONAS)) {
|
|
83
|
+
const serverName = (0, index_js_5.getPersonaServerName)(persona);
|
|
84
|
+
for (const id of persona.toolIds) {
|
|
85
|
+
const combined = serverName.length + (shared_js_1.TOOL_PREFIX + id).length;
|
|
86
|
+
(0, vitest_1.expect)(combined, `${serverName}+${shared_js_1.TOOL_PREFIX}${id}`).toBeLessThanOrEqual(60);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
(0, vitest_1.it)('parsePersonaId validates known ids only', () => {
|
|
91
|
+
(0, vitest_1.expect)((0, index_js_5.parsePersonaId)('semantic-layer')).toBe('semantic-layer');
|
|
92
|
+
(0, vitest_1.expect)((0, index_js_5.parsePersonaId)('organization-audit')).toBe('organization-audit');
|
|
93
|
+
(0, vitest_1.expect)((0, index_js_5.parsePersonaId)('content-reader')).toBe('content-reader');
|
|
94
|
+
(0, vitest_1.expect)((0, index_js_5.parsePersonaId)('content-developer')).toBe('content-developer');
|
|
95
|
+
(0, vitest_1.expect)((0, index_js_5.parsePersonaId)('content-governance')).toBe('content-governance');
|
|
96
|
+
(0, vitest_1.expect)((0, index_js_5.parsePersonaId)('nope')).toBeUndefined();
|
|
97
|
+
});
|
|
98
|
+
(0, vitest_1.it)('registerToolsByIds registers only allowlisted ids', () => {
|
|
99
|
+
const registered = [];
|
|
100
|
+
const mockServer = {
|
|
101
|
+
registerTool: vitest_1.vi.fn((name) => {
|
|
102
|
+
registered.push(name);
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
const mockCtx = { getContext: async () => ({ lightdashClient: {} }) };
|
|
106
|
+
(0, registry_js_1.registerToolsByIds)(mockServer, mockCtx, ['list_projects', 'compile_query']);
|
|
107
|
+
(0, vitest_1.expect)(registered).toEqual([`${shared_js_1.TOOL_PREFIX}list_projects`, `${shared_js_1.TOOL_PREFIX}compile_query`]);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for registering markdown playbook MCP resources and
|
|
3
|
+
* embedding core + topic playbooks into prompt messages.
|
|
4
|
+
*/
|
|
5
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
6
|
+
export declare const PLAYBOOK_MIME: "text/markdown";
|
|
7
|
+
export type PlaybookResourceSpec = {
|
|
8
|
+
/** MCP resource name (stable id for resources/list). */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Canonical URI, e.g. lightdash://playbooks/content-developer/core */
|
|
11
|
+
uri: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
getMarkdown: () => string;
|
|
15
|
+
};
|
|
16
|
+
export type EmbeddedPlaybook = {
|
|
17
|
+
uri: string;
|
|
18
|
+
mimeType?: string;
|
|
19
|
+
getMarkdown: () => string;
|
|
20
|
+
};
|
|
21
|
+
declare function embedResource(playbook: EmbeddedPlaybook): {
|
|
22
|
+
type: "resource";
|
|
23
|
+
resource: {
|
|
24
|
+
uri: string;
|
|
25
|
+
mimeType: string;
|
|
26
|
+
text: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type PromptUserMessage = {
|
|
30
|
+
role: 'user';
|
|
31
|
+
content: ReturnType<typeof embedResource> | {
|
|
32
|
+
type: 'text';
|
|
33
|
+
text: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Build prompt message helpers that embed core, and optionally one topic playbook,
|
|
38
|
+
* after the user text message. When `topicId` is omitted, only core is embedded.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createPromptPlaybookEmbedder<TopicId extends string>(options: {
|
|
41
|
+
core: EmbeddedPlaybook;
|
|
42
|
+
topics: Readonly<Record<TopicId, EmbeddedPlaybook>>;
|
|
43
|
+
}): (text: string, topicId?: TopicId) => {
|
|
44
|
+
messages: PromptUserMessage[];
|
|
45
|
+
};
|
|
46
|
+
export type PersonaPlaybookTopicDef<TopicId extends string = string> = {
|
|
47
|
+
id: TopicId;
|
|
48
|
+
title: string;
|
|
49
|
+
description: string;
|
|
50
|
+
/** Filename under `playbooks/`, e.g. `dashboards.md`. */
|
|
51
|
+
file: string;
|
|
52
|
+
};
|
|
53
|
+
export type DefinePersonaPlaybooksOptions<TopicId extends string> = {
|
|
54
|
+
personaId: string;
|
|
55
|
+
moduleDir: string;
|
|
56
|
+
hardBans: string;
|
|
57
|
+
topics: readonly PersonaPlaybookTopicDef<TopicId>[];
|
|
58
|
+
indexTitle?: string;
|
|
59
|
+
indexDescription?: string;
|
|
60
|
+
coreTitle?: string;
|
|
61
|
+
coreDescription?: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Factory for persona multi-playbook resources (index + core + topics).
|
|
65
|
+
* Callers re-export the returned fields under persona-specific names.
|
|
66
|
+
*/
|
|
67
|
+
export declare function definePersonaPlaybooks<TopicId extends string>(options: DefinePersonaPlaybooksOptions<TopicId>): {
|
|
68
|
+
URIs: {
|
|
69
|
+
index: string;
|
|
70
|
+
core: string;
|
|
71
|
+
topics: Readonly<Record<TopicId, string>>;
|
|
72
|
+
};
|
|
73
|
+
HARD_BANS: string;
|
|
74
|
+
getAllPlaybookMarkdown: () => string;
|
|
75
|
+
CORE_PLAYBOOK: EmbeddedPlaybook;
|
|
76
|
+
TOPIC_PLAYBOOKS: Readonly<Record<TopicId, EmbeddedPlaybook>>;
|
|
77
|
+
registerPlaybooks: (server: McpServer) => void;
|
|
78
|
+
};
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared helpers for registering markdown playbook MCP resources and
|
|
4
|
+
* embedding core + topic playbooks into prompt messages.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PLAYBOOK_MIME = void 0;
|
|
8
|
+
exports.createPromptPlaybookEmbedder = createPromptPlaybookEmbedder;
|
|
9
|
+
exports.definePersonaPlaybooks = definePersonaPlaybooks;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
|
+
exports.PLAYBOOK_MIME = 'text/markdown';
|
|
13
|
+
const markdownCache = new Map();
|
|
14
|
+
/**
|
|
15
|
+
* Load a playbook markdown file from a directory adjacent to the compiled module.
|
|
16
|
+
* `moduleDir` should be `__dirname` of the persona's `resources/` folder.
|
|
17
|
+
*/
|
|
18
|
+
function loadPlaybookMarkdown(moduleDir, relativePath) {
|
|
19
|
+
const key = `${moduleDir}::${relativePath}`;
|
|
20
|
+
const cached = markdownCache.get(key);
|
|
21
|
+
if (cached !== undefined) {
|
|
22
|
+
return cached;
|
|
23
|
+
}
|
|
24
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- moduleDir + relativePath from persona constants
|
|
25
|
+
const text = (0, node_fs_1.readFileSync)((0, node_path_1.join)(moduleDir, relativePath), 'utf8');
|
|
26
|
+
markdownCache.set(key, text);
|
|
27
|
+
return text;
|
|
28
|
+
}
|
|
29
|
+
function registerMarkdownPlaybooks(server, specs) {
|
|
30
|
+
for (const spec of specs) {
|
|
31
|
+
const markdown = spec.getMarkdown();
|
|
32
|
+
server.registerResource(spec.name, spec.uri, {
|
|
33
|
+
title: spec.title,
|
|
34
|
+
description: spec.description,
|
|
35
|
+
mimeType: exports.PLAYBOOK_MIME,
|
|
36
|
+
}, async (uri) => ({
|
|
37
|
+
contents: [
|
|
38
|
+
{
|
|
39
|
+
uri: typeof uri === 'string' ? uri : uri.href,
|
|
40
|
+
mimeType: exports.PLAYBOOK_MIME,
|
|
41
|
+
text: markdown,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function embedResource(playbook) {
|
|
48
|
+
var _a;
|
|
49
|
+
return {
|
|
50
|
+
type: 'resource',
|
|
51
|
+
resource: {
|
|
52
|
+
uri: playbook.uri,
|
|
53
|
+
mimeType: (_a = playbook.mimeType) !== null && _a !== void 0 ? _a : exports.PLAYBOOK_MIME,
|
|
54
|
+
text: playbook.getMarkdown(),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Build prompt message helpers that embed core, and optionally one topic playbook,
|
|
60
|
+
* after the user text message. When `topicId` is omitted, only core is embedded.
|
|
61
|
+
*/
|
|
62
|
+
function createPromptPlaybookEmbedder(options) {
|
|
63
|
+
const { core, topics } = options;
|
|
64
|
+
return (text, topicId) => {
|
|
65
|
+
const messages = [
|
|
66
|
+
{
|
|
67
|
+
role: 'user',
|
|
68
|
+
content: { type: 'text', text },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
role: 'user',
|
|
72
|
+
content: embedResource(core),
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
if (topicId === undefined) {
|
|
76
|
+
return { messages };
|
|
77
|
+
}
|
|
78
|
+
// eslint-disable-next-line security/detect-object-injection -- topicId from persona PROMPT_TOPICS constants
|
|
79
|
+
const topic = topics[topicId];
|
|
80
|
+
if (!topic) {
|
|
81
|
+
throw new Error(`Unknown playbook topic '${topicId}'`);
|
|
82
|
+
}
|
|
83
|
+
messages.push({
|
|
84
|
+
role: 'user',
|
|
85
|
+
content: embedResource(topic),
|
|
86
|
+
});
|
|
87
|
+
return { messages };
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Title-case the first segment only: `content-developer` → `Content-developer`. */
|
|
91
|
+
function titleCasePersona(personaId) {
|
|
92
|
+
const [first = '', ...rest] = personaId.split('-');
|
|
93
|
+
if (first.length === 0) {
|
|
94
|
+
return personaId;
|
|
95
|
+
}
|
|
96
|
+
return [first[0].toUpperCase() + first.slice(1), ...rest].join('-');
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Factory for persona multi-playbook resources (index + core + topics).
|
|
100
|
+
* Callers re-export the returned fields under persona-specific names.
|
|
101
|
+
*/
|
|
102
|
+
function definePersonaPlaybooks(options) {
|
|
103
|
+
const { personaId, moduleDir, hardBans, topics, indexTitle = `${titleCasePersona(personaId)} playbooks`, indexDescription = `Index of ${personaId} workflow playbooks (core + topics)`, coreTitle = `${titleCasePersona(personaId)} core playbook`, coreDescription = 'Hard bans, tools, and operating rules', } = options;
|
|
104
|
+
const indexUri = `lightdash://playbooks/${personaId}`;
|
|
105
|
+
const coreUri = `lightdash://playbooks/${personaId}/core`;
|
|
106
|
+
const namePrefix = personaId.split('-').join('_');
|
|
107
|
+
const load = (relativePath) => loadPlaybookMarkdown(moduleDir, relativePath);
|
|
108
|
+
const getIndexPlaybookMarkdown = () => load('playbooks/index.md');
|
|
109
|
+
const getCorePlaybookMarkdown = () => load('playbooks/core.md');
|
|
110
|
+
const topicUris = {};
|
|
111
|
+
const topicPlaybooks = {};
|
|
112
|
+
const topicMarkdownGetters = [];
|
|
113
|
+
for (const topic of topics) {
|
|
114
|
+
const uri = `lightdash://playbooks/${personaId}/${topic.id}`;
|
|
115
|
+
topicUris[topic.id] = uri;
|
|
116
|
+
const getMarkdown = () => load(`playbooks/${topic.file}`);
|
|
117
|
+
topicMarkdownGetters.push(getMarkdown);
|
|
118
|
+
topicPlaybooks[topic.id] = {
|
|
119
|
+
uri,
|
|
120
|
+
getMarkdown,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const CORE_PLAYBOOK = {
|
|
124
|
+
uri: coreUri,
|
|
125
|
+
getMarkdown: getCorePlaybookMarkdown,
|
|
126
|
+
};
|
|
127
|
+
const getAllPlaybookMarkdown = () => [
|
|
128
|
+
getIndexPlaybookMarkdown(),
|
|
129
|
+
getCorePlaybookMarkdown(),
|
|
130
|
+
...topicMarkdownGetters.map((g) => g()),
|
|
131
|
+
].join('\n');
|
|
132
|
+
const registerPlaybooks = (server) => {
|
|
133
|
+
registerMarkdownPlaybooks(server, [
|
|
134
|
+
{
|
|
135
|
+
name: `${namePrefix}_playbook_index`,
|
|
136
|
+
uri: indexUri,
|
|
137
|
+
title: indexTitle,
|
|
138
|
+
description: indexDescription,
|
|
139
|
+
getMarkdown: getIndexPlaybookMarkdown,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: `${namePrefix}_playbook_core`,
|
|
143
|
+
uri: coreUri,
|
|
144
|
+
title: coreTitle,
|
|
145
|
+
description: coreDescription,
|
|
146
|
+
getMarkdown: getCorePlaybookMarkdown,
|
|
147
|
+
},
|
|
148
|
+
...topics.map((topic) => ({
|
|
149
|
+
name: `${namePrefix}_playbook_${String(topic.id).split('-').join('_')}`,
|
|
150
|
+
uri: topicUris[topic.id],
|
|
151
|
+
title: topic.title,
|
|
152
|
+
description: topic.description,
|
|
153
|
+
getMarkdown: topicPlaybooks[topic.id].getMarkdown,
|
|
154
|
+
})),
|
|
155
|
+
]);
|
|
156
|
+
};
|
|
157
|
+
return {
|
|
158
|
+
URIs: { index: indexUri, core: coreUri, topics: topicUris },
|
|
159
|
+
HARD_BANS: hardBans,
|
|
160
|
+
getAllPlaybookMarkdown,
|
|
161
|
+
CORE_PLAYBOOK,
|
|
162
|
+
TOPIC_PLAYBOOKS: topicPlaybooks,
|
|
163
|
+
registerPlaybooks,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization-audit persona: read-only org inventory, access, content health, schedulers.
|
|
3
|
+
*/
|
|
4
|
+
import type { PersonaDefinition } from '../../types.js';
|
|
5
|
+
export declare const ORGANIZATION_AUDIT_PERSONA_PATH: "/organization-audit/v1/mcp";
|
|
6
|
+
/** Explicit allowlist — must stay a deliberate subset of the shared registry. */
|
|
7
|
+
export declare const ORGANIZATION_AUDIT_TOOL_IDS: readonly ["get_org_profile", "list_org_members", "get_org_member", "list_org_groups", "list_org_projects", "list_org_role_assignments", "list_custom_roles", "get_custom_role", "list_project_roles", "list_project_direct_access", "list_space_access", "resolve_effective_access", "list_content", "get_dashboard_meta", "list_validation_results", "get_project_user_activity", "list_project_schedulers", "get_scheduler"];
|
|
8
|
+
export declare const organizationAuditPersona: PersonaDefinition;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Organization-audit persona: read-only org inventory, access, content health, schedulers.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.organizationAuditPersona = exports.ORGANIZATION_AUDIT_TOOL_IDS = exports.ORGANIZATION_AUDIT_PERSONA_PATH = void 0;
|
|
7
|
+
const prompts_js_1 = require("./prompts.js");
|
|
8
|
+
const playbooks_js_1 = require("./resources/playbooks.js");
|
|
9
|
+
exports.ORGANIZATION_AUDIT_PERSONA_PATH = '/organization-audit/v1/mcp';
|
|
10
|
+
/** Explicit allowlist — must stay a deliberate subset of the shared registry. */
|
|
11
|
+
exports.ORGANIZATION_AUDIT_TOOL_IDS = [
|
|
12
|
+
'get_org_profile',
|
|
13
|
+
'list_org_members',
|
|
14
|
+
'get_org_member',
|
|
15
|
+
'list_org_groups',
|
|
16
|
+
'list_org_projects',
|
|
17
|
+
'list_org_role_assignments',
|
|
18
|
+
'list_custom_roles',
|
|
19
|
+
'get_custom_role',
|
|
20
|
+
'list_project_roles',
|
|
21
|
+
'list_project_direct_access',
|
|
22
|
+
'list_space_access',
|
|
23
|
+
'resolve_effective_access',
|
|
24
|
+
'list_content',
|
|
25
|
+
'get_dashboard_meta',
|
|
26
|
+
'list_validation_results',
|
|
27
|
+
'get_project_user_activity',
|
|
28
|
+
'list_project_schedulers',
|
|
29
|
+
'get_scheduler',
|
|
30
|
+
];
|
|
31
|
+
exports.organizationAuditPersona = {
|
|
32
|
+
id: 'organization-audit',
|
|
33
|
+
path: exports.ORGANIZATION_AUDIT_PERSONA_PATH,
|
|
34
|
+
serverName: 'lightdash-mcp-org-audit',
|
|
35
|
+
toolIds: exports.ORGANIZATION_AUDIT_TOOL_IDS,
|
|
36
|
+
registerPrompts: (server) => {
|
|
37
|
+
(0, prompts_js_1.registerOrganizationAuditPrompts)(server);
|
|
38
|
+
},
|
|
39
|
+
registerResources: (server) => {
|
|
40
|
+
(0, playbooks_js_1.registerOrganizationAuditPlaybook)(server);
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP prompts for organization-audit workflows.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerOrganizationAuditPrompts = registerOrganizationAuditPrompts;
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-deprecated -- matches semantic-layer prompt registration pattern */
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const playbook_resources_js_1 = require("../../lib/playbook-resources.js");
|
|
10
|
+
const playbooks_js_1 = require("./resources/playbooks.js");
|
|
11
|
+
const userMessages = (0, playbook_resources_js_1.createPromptPlaybookEmbedder)({
|
|
12
|
+
core: playbooks_js_1.ORGANIZATION_AUDIT_CORE_PLAYBOOK,
|
|
13
|
+
topics: playbooks_js_1.ORGANIZATION_AUDIT_TOPIC_PLAYBOOKS,
|
|
14
|
+
});
|
|
15
|
+
function registerOrganizationAuditPrompts(server) {
|
|
16
|
+
server.registerPrompt('audit_organization', {
|
|
17
|
+
title: 'Audit organization',
|
|
18
|
+
description: 'Evidence-backed read-only organization audit via primitive tools',
|
|
19
|
+
argsSchema: {
|
|
20
|
+
projectUuids: zod_1.z.string().optional().describe('Comma-separated project UUIDs'),
|
|
21
|
+
allowedEmailDomains: zod_1.z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Comma-separated allowed email domains'),
|
|
25
|
+
},
|
|
26
|
+
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Perform an evidence-backed, read-only audit of the current Lightdash organization.
|
|
27
|
+
|
|
28
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
29
|
+
|
|
30
|
+
Scope:
|
|
31
|
+
- Use only the organization and projects visible to the authenticated caller.
|
|
32
|
+
- Respect any project pin (X-Lightdash-Project).
|
|
33
|
+
- Optional project filter: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(all accessible non-preview projects up to a small cap)'}.
|
|
34
|
+
- Allowed email domains for delivery review: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none — treat unknown domains carefully)'}.
|
|
35
|
+
|
|
36
|
+
Procedure (primitives only — there are no lightdash_audit_* tools):
|
|
37
|
+
1. Resolve organization identity via lightdash_get_org_profile.
|
|
38
|
+
2. Follow the playbook phases: identity → projects/access → content → deliveries → report.
|
|
39
|
+
3. Paginate list tools only while pagination.complete is false, and stop after an agreed page/project budget.
|
|
40
|
+
4. Synthesize findings yourself from returned evidence; distinguish facts, inferred risks, assumptions, inaccessible areas, and truncation.
|
|
41
|
+
5. Cite every finding with lightdash_* tool names and resource UUIDs.
|
|
42
|
+
6. Do not claim formal compliance certification.`));
|
|
43
|
+
server.registerPrompt('review_access_governance', {
|
|
44
|
+
title: 'Review access governance',
|
|
45
|
+
description: 'Build an effective-access model from identity and access primitives',
|
|
46
|
+
argsSchema: {},
|
|
47
|
+
}, () => userMessages(`Review Lightdash identity and access governance.
|
|
48
|
+
|
|
49
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
50
|
+
|
|
51
|
+
Use lightdash_list_org_members, lightdash_list_org_role_assignments, lightdash_list_project_roles, lightdash_list_project_direct_access, lightdash_list_space_access, and lightdash_resolve_effective_access.
|
|
52
|
+
Do not treat lightdash_list_project_direct_access as complete effective access.
|
|
53
|
+
State assumptions and coverage gaps.`, 'access'));
|
|
54
|
+
server.registerPrompt('review_content_governance', {
|
|
55
|
+
title: 'Review content governance',
|
|
56
|
+
description: 'Inventory content health and ownership risks via list tools',
|
|
57
|
+
argsSchema: {},
|
|
58
|
+
}, () => userMessages(`Inventory charts, dashboards, and spaces; evaluate validation, ownership, and usage.
|
|
59
|
+
|
|
60
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
61
|
+
|
|
62
|
+
Use lightdash_list_content, lightdash_list_validation_results, and lightdash_get_project_user_activity (plus lightdash_get_dashboard_meta when needed).
|
|
63
|
+
Join results in the conversation — do not assume a server-side audit tool.
|
|
64
|
+
Do not recommend deletion solely because content is unused.`, 'content'));
|
|
65
|
+
server.registerPrompt('review_scheduled_deliveries', {
|
|
66
|
+
title: 'Review scheduled deliveries',
|
|
67
|
+
description: 'Inspect schedulers without executing them',
|
|
68
|
+
argsSchema: {
|
|
69
|
+
allowedEmailDomains: zod_1.z.string().optional(),
|
|
70
|
+
},
|
|
71
|
+
}, ({ allowedEmailDomains }) => userMessages(`Inspect scheduled deliveries without creating, editing, executing, enabling, disabling, or deleting schedules.
|
|
72
|
+
|
|
73
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
74
|
+
|
|
75
|
+
Allowed email domains: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none provided)'}.
|
|
76
|
+
Use lightdash_list_project_schedulers and lightdash_get_scheduler.
|
|
77
|
+
Redact destinations by default. External destinations are review signals, not automatic violations.`, 'deliveries'));
|
|
78
|
+
server.registerPrompt('investigate_audit_finding', {
|
|
79
|
+
title: 'Investigate audit finding',
|
|
80
|
+
description: 'Validate or refute one previously reported finding',
|
|
81
|
+
argsSchema: {
|
|
82
|
+
findingSummary: zod_1.z.string().describe('The finding claim to investigate'),
|
|
83
|
+
},
|
|
84
|
+
}, ({ findingSummary }) => userMessages(`Investigate this organization-audit finding with minimum additional metadata:
|
|
85
|
+
|
|
86
|
+
${findingSummary}
|
|
87
|
+
|
|
88
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
89
|
+
|
|
90
|
+
Use only primitive list/get tools. Report supporting evidence, contradictory evidence, remaining uncertainty, and whether severity/confidence changed.`));
|
|
91
|
+
}
|
|
92
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|