@lightdash-tools/mcp 0.8.0 → 0.11.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 +112 -236
- package/dist/audit/server-profile.d.ts +13 -0
- package/dist/audit/server-profile.js +28 -0
- package/dist/audit/server-profile.test.js +21 -0
- package/dist/auth/oauth-broker/pending-store.d.ts +6 -7
- package/dist/auth/oauth-broker/pending-store.js +3 -4
- package/dist/auth/oauth-broker/pending-store.test.d.ts +2 -3
- package/dist/auth/oauth-broker/pending-store.test.js +2 -39
- package/dist/auth/oauth-broker/routes.d.ts +1 -1
- package/dist/auth/oauth-broker/routes.js +3 -3
- package/dist/auth/oauth-broker/routes.test.js +1 -1
- package/dist/auth/request-state-key.d.ts +19 -0
- package/dist/auth/request-state-key.js +49 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.d.ts +1 -3
- package/dist/auth/resource-server/lightdash-oauth-middleware.js +1 -20
- package/dist/auth/resource-server/lightdash-oauth-middleware.test.js +14 -14
- package/dist/auth/resource-server/oauth-protected-resource.d.ts +6 -6
- package/dist/auth/resource-server/oauth-protected-resource.js +8 -8
- package/dist/auth/resource-server/token-scopes.d.ts +1 -1
- package/dist/auth/resource-server/token-scopes.js +1 -1
- package/dist/auth/resource-server/www-authenticate.test.js +11 -13
- package/dist/bin.js +54 -51
- package/dist/config/env.d.ts +8 -16
- package/dist/config/env.js +9 -17
- package/dist/config/load-mcp-config.d.ts +0 -4
- package/dist/config/load-mcp-config.js +9 -38
- package/dist/config/load-mcp-config.test.js +8 -2
- package/dist/config/normalize-url.d.ts +1 -1
- package/dist/config/normalize-url.js +1 -1
- package/dist/config/normalize-url.test.js +16 -13
- package/dist/config/obsolete-env.d.ts +5 -0
- package/dist/config/obsolete-env.js +48 -0
- package/dist/config/obsolete-env.test.js +22 -0
- package/dist/config/runtime.d.ts +3 -3
- package/dist/config/runtime.js +19 -23
- package/dist/config/runtime.test.js +23 -9
- package/dist/config/test-mcp-http-config.js +1 -1
- package/dist/destructive/content-promote.js +7 -1
- package/dist/destructive/promote-contract.test.js +106 -47
- package/dist/destructive/register-destructive-tool.js +6 -24
- package/dist/destructive/request-state.d.ts +2 -6
- package/dist/destructive/request-state.js +3 -38
- package/dist/destructive/types.d.ts +2 -1
- package/dist/governance/available-projects.d.ts +37 -0
- package/dist/governance/available-projects.js +132 -0
- package/dist/governance/available-projects.test.d.ts +4 -0
- package/dist/governance/available-projects.test.js +107 -0
- package/dist/governance/mcp-client-session.d.ts +3 -2
- package/dist/governance/mcp-client-session.js +3 -2
- package/dist/governance/mcp-post-factory-context.d.ts +15 -0
- package/dist/governance/mcp-post-factory-context.js +22 -0
- package/dist/governance/mcp-post-factory-context.test.js +34 -0
- package/dist/governance/project-scope.d.ts +8 -22
- package/dist/governance/project-scope.js +36 -44
- package/dist/governance/project-scope.test.d.ts +1 -1
- package/dist/governance/project-scope.test.js +21 -44
- package/dist/governance/promote-allowlist.d.ts +18 -0
- package/dist/governance/promote-allowlist.js +66 -0
- package/dist/governance/promote-allowlist.test.d.ts +4 -0
- package/dist/governance/promote-allowlist.test.js +87 -0
- package/dist/http.integration.test.js +116 -265
- package/dist/http.test.js +0 -12
- package/dist/index.d.ts +5 -1
- package/dist/index.integration.test.js +0 -4
- package/dist/index.js +31 -16
- package/dist/policy/content-developer.d.ts +3 -3
- package/dist/policy/content-developer.js +3 -3
- package/dist/policy/content-developer.test.js +10 -4
- package/dist/policy/content-reader.d.ts +15 -6
- package/dist/policy/content-reader.js +39 -10
- package/dist/policy/content-reader.test.js +5 -3
- package/dist/policy/envelope.d.ts +4 -2
- package/dist/policy/envelope.js +2 -2
- package/dist/policy/envelope.test.js +28 -0
- package/dist/policy/preview-ledger-fault.test.js +101 -426
- package/dist/policy/preview-ledger.d.ts +38 -74
- package/dist/policy/preview-ledger.js +108 -186
- package/dist/policy/preview-ledger.test.js +237 -111
- package/dist/policy/result-limits.d.ts +6 -1
- package/dist/policy/result-limits.js +28 -29
- package/dist/policy/result-limits.test.js +10 -1
- package/dist/profiles/ai-agent-ops/v1/index.d.ts +6 -0
- package/dist/profiles/ai-agent-ops/v1/index.js +20 -0
- package/dist/profiles/ai-agent-ops/v1/prompts.d.ts +5 -0
- package/dist/profiles/ai-agent-ops/v1/prompts.js +141 -0
- package/dist/profiles/ai-agent-ops/v1/prompts.test.d.ts +4 -0
- package/dist/profiles/ai-agent-ops/v1/prompts.test.js +26 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks/core.md +39 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks/evaluation.md +25 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks/index.md +14 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks/loop-engineering.md +28 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks/release-gate.md +22 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks.d.ts +10 -0
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks.js +41 -0
- package/dist/profiles/content-developer/v1/index.d.ts +8 -0
- package/dist/profiles/content-developer/v1/index.js +22 -0
- package/dist/{personas → profiles}/content-developer/v1/prompts.d.ts +3 -0
- package/dist/profiles/content-developer/v1/prompts.js +157 -0
- package/dist/profiles/content-developer/v1/prompts.test.js +286 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/chart-types.md +138 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/content-move.md +22 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/core.md +109 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/dashboard-design.md +153 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/dashboards.md +108 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/index.md +15 -0
- package/dist/{personas → profiles}/content-developer/v1/resources/playbooks.d.ts +1 -1
- package/dist/profiles/content-developer/v1/resources/playbooks.js +65 -0
- package/dist/profiles/content-governance/v1/index.d.ts +7 -0
- package/dist/profiles/content-governance/v1/index.js +21 -0
- package/dist/{personas → profiles}/content-governance/v1/prompts.test.js +2 -2
- package/dist/{personas → profiles}/content-governance/v1/resources/playbooks/core.md +3 -3
- package/dist/{personas → profiles}/content-governance/v1/resources/playbooks/dashboards.md +1 -1
- package/dist/{personas → profiles}/content-governance/v1/resources/playbooks.js +4 -4
- package/dist/profiles/content-reader/v1/index.d.ts +6 -0
- package/dist/profiles/content-reader/v1/index.js +20 -0
- package/dist/profiles/content-reader/v1/prompts.js +162 -0
- package/dist/{personas → profiles}/content-reader/v1/prompts.test.js +2 -2
- package/dist/profiles/content-reader/v1/resources/playbooks/compare.md +36 -0
- package/dist/profiles/content-reader/v1/resources/playbooks/core.md +67 -0
- package/dist/profiles/content-reader/v1/resources/playbooks/discover.md +35 -0
- package/dist/profiles/content-reader/v1/resources/playbooks/explain-run.md +49 -0
- package/dist/profiles/content-reader/v1/resources/playbooks/index.md +14 -0
- package/dist/{personas → profiles}/content-reader/v1/resources/playbooks.js +4 -4
- package/dist/profiles/data-analyst/v1/index.d.ts +6 -0
- package/dist/profiles/data-analyst/v1/index.js +20 -0
- package/dist/profiles/data-analyst/v1/prompts.d.ts +5 -0
- package/dist/profiles/data-analyst/v1/prompts.js +41 -0
- package/dist/profiles/data-analyst/v1/prompts.test.d.ts +4 -0
- package/dist/profiles/data-analyst/v1/prompts.test.js +26 -0
- package/dist/profiles/data-analyst/v1/resources/playbooks/core.md +41 -0
- package/dist/profiles/data-analyst/v1/resources/playbooks/explore.md +26 -0
- package/dist/profiles/data-analyst/v1/resources/playbooks/index.md +8 -0
- package/dist/profiles/data-analyst/v1/resources/playbooks.d.ts +10 -0
- package/dist/profiles/data-analyst/v1/resources/playbooks.js +33 -0
- package/dist/profiles/index.d.ts +24 -0
- package/dist/profiles/index.js +73 -0
- package/dist/profiles/index.test.js +121 -0
- package/dist/{personas → profiles}/lib/playbook-resources.d.ts +12 -10
- package/dist/{personas → profiles}/lib/playbook-resources.js +28 -24
- package/dist/profiles/organization-audit/v1/index.d.ts +6 -0
- package/dist/profiles/organization-audit/v1/index.js +20 -0
- package/dist/profiles/organization-audit/v1/prompts.js +124 -0
- package/dist/{personas → profiles}/organization-audit/v1/prompts.test.js +2 -2
- package/dist/profiles/organization-audit/v1/resources/playbooks/access.md +21 -0
- package/dist/profiles/organization-audit/v1/resources/playbooks/content.md +19 -0
- package/dist/profiles/organization-audit/v1/resources/playbooks/core.md +69 -0
- package/dist/profiles/organization-audit/v1/resources/playbooks/deliveries.md +14 -0
- package/dist/profiles/organization-audit/v1/resources/playbooks/index.md +14 -0
- package/dist/{personas → profiles}/organization-audit/v1/resources/playbooks.js +3 -3
- package/dist/profiles/profile.membership.test.js +36 -0
- package/dist/profiles/semantic-layer/v1/index.d.ts +6 -0
- package/dist/profiles/semantic-layer/v1/index.js +19 -0
- package/dist/profiles/semantic-layer/v1/prompts.js +96 -0
- package/dist/{personas → profiles}/semantic-layer/v1/prompts.test.js +2 -2
- package/dist/profiles/semantic-layer/v1/resources/playbooks/compose-compile.md +60 -0
- package/dist/profiles/semantic-layer/v1/resources/playbooks/core.md +71 -0
- package/dist/profiles/semantic-layer/v1/resources/playbooks/explore.md +79 -0
- package/dist/profiles/semantic-layer/v1/resources/playbooks/index.md +13 -0
- package/dist/{personas → profiles}/semantic-layer/v1/resources/playbooks.js +4 -4
- package/dist/{personas → profiles}/types.d.ts +6 -7
- package/dist/{personas → profiles}/types.js +1 -1
- package/dist/protocol-contract.test.js +48 -3
- package/dist/server/capabilities.d.ts +6 -6
- package/dist/server/capabilities.js +11 -8
- package/dist/server/capabilities.test.js +8 -7
- package/dist/server/server.js +17 -13
- package/dist/server/upstream-errors.d.ts +17 -0
- package/dist/server/upstream-errors.js +60 -0
- package/dist/server/upstream-errors.test.js +50 -0
- package/dist/stdio.process.test.js +65 -9
- package/dist/tools/ai-agents/agents.d.ts +7 -0
- package/dist/tools/ai-agents/agents.js +32 -0
- package/dist/tools/ai-agents/agents.test.d.ts +1 -0
- package/dist/tools/ai-agents/agents.test.js +176 -0
- package/dist/tools/ai-agents/discovery.d.ts +9 -0
- package/dist/tools/ai-agents/discovery.js +73 -0
- package/dist/tools/ai-agents/evaluations.d.ts +14 -0
- package/dist/tools/ai-agents/evaluations.js +177 -0
- package/dist/tools/ai-agents/helpers.d.ts +63 -0
- package/dist/tools/ai-agents/helpers.js +321 -0
- package/dist/tools/ai-agents/threads.d.ts +7 -0
- package/dist/tools/ai-agents/threads.js +40 -0
- package/dist/tools/composition/explain-content.js +3 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.test.js +16 -10
- package/dist/tools/lib/schema-fields.d.ts +2 -0
- package/dist/tools/lib/schema-fields.js +4 -1
- package/dist/tools/lib/stable-stringify.d.ts +1 -1
- package/dist/tools/lib/stable-stringify.js +1 -1
- package/dist/tools/organization/invariants.test.d.ts +1 -1
- package/dist/tools/organization/invariants.test.js +5 -5
- package/dist/tools/organization/inventory.js +2 -1
- package/dist/tools/project/content.js +5 -1
- package/dist/tools/project/developer-content-preview.d.ts +3 -2
- package/dist/tools/project/developer-content-preview.js +41 -36
- package/dist/tools/project/developer-content-shared.d.ts +9 -3
- package/dist/tools/project/developer-content-shared.js +8 -4
- package/dist/tools/project/developer-content.d.ts +7 -8
- package/dist/tools/project/developer-content.js +72 -67
- package/dist/tools/project/developer-get-chart-as-code.d.ts +9 -0
- package/dist/tools/project/developer-get-chart-as-code.js +39 -0
- package/dist/tools/project/developer-get-chart-as-code.test.d.ts +4 -0
- package/dist/tools/project/developer-get-chart-as-code.test.js +70 -0
- package/dist/tools/project/developer-helpers.d.ts +1 -1
- package/dist/tools/project/developer-helpers.js +1 -1
- package/dist/tools/project/get-dashboard-promote-diff.js +12 -2
- package/dist/tools/project/invariants.test.d.ts +1 -1
- package/dist/tools/project/invariants.test.js +12 -10
- package/dist/tools/project/parameters.js +8 -3
- package/dist/tools/project/projects.d.ts +1 -4
- package/dist/tools/project/projects.js +37 -15
- package/dist/tools/project/projects.test.js +70 -8
- package/dist/tools/project/reader-content.js +6 -3
- package/dist/tools/project/reader-execution.js +4 -2
- package/dist/tools/project/reader-export-chart-image.d.ts +6 -0
- package/dist/tools/project/reader-export-chart-image.js +78 -0
- package/dist/tools/project/reader-export-chart-image.test.d.ts +4 -0
- package/dist/tools/project/reader-export-chart-image.test.js +149 -0
- package/dist/tools/project/spaces.js +12 -4
- package/dist/tools/project/spaces.test.d.ts +1 -0
- package/dist/tools/project/spaces.test.js +47 -0
- package/dist/tools/query/bounded-saved-query.d.ts +4 -3
- package/dist/tools/query/bounded-saved-query.js +4 -6
- package/dist/tools/query/lifecycle.d.ts +1 -1
- package/dist/tools/query/lifecycle.js +25 -31
- package/dist/tools/query/query-ledger.d.ts +17 -9
- package/dist/tools/query/query-ledger.js +21 -15
- package/dist/tools/query/query-ledger.test.js +13 -11
- package/dist/tools/query/reader-tool-helpers.d.ts +4 -2
- package/dist/tools/query/reader-tool-helpers.js +11 -8
- package/dist/tools/query/reader-tool-helpers.test.js +8 -4
- package/dist/tools/query/run-metric-query.d.ts +6 -0
- package/dist/tools/query/run-metric-query.js +94 -0
- package/dist/tools/query/run-metric-query.test.d.ts +4 -0
- package/dist/tools/query/run-metric-query.test.js +116 -0
- package/dist/tools/registry.d.ts +71 -8
- package/dist/tools/registry.js +36 -6
- package/dist/tools/semantic/explores.js +43 -17
- package/dist/tools/semantic/metrics.js +22 -8
- package/dist/tools/semantic/query.js +25 -17
- package/dist/tools/shared.d.ts +28 -9
- package/dist/tools/shared.js +62 -29
- package/dist/tools/shared.test.js +100 -4
- package/dist/transports/streamable-http.js +75 -223
- package/dist/transports/streamable-http.test.js +19 -12
- package/package.json +5 -6
- package/dist/destructive/confirmation-claim.d.ts +0 -21
- package/dist/destructive/confirmation-claim.js +0 -87
- package/dist/destructive/confirmation-claim.test.js +0 -50
- package/dist/personas/content-developer/v1/index.d.ts +0 -10
- package/dist/personas/content-developer/v1/index.js +0 -51
- package/dist/personas/content-developer/v1/prompts.js +0 -138
- package/dist/personas/content-developer/v1/prompts.test.js +0 -75
- package/dist/personas/content-developer/v1/resources/playbooks/content-move.md +0 -15
- package/dist/personas/content-developer/v1/resources/playbooks/core.md +0 -63
- package/dist/personas/content-developer/v1/resources/playbooks/dashboards.md +0 -55
- package/dist/personas/content-developer/v1/resources/playbooks/index.md +0 -13
- package/dist/personas/content-developer/v1/resources/playbooks.js +0 -44
- package/dist/personas/content-governance/v1/index.d.ts +0 -9
- package/dist/personas/content-governance/v1/index.js +0 -29
- package/dist/personas/content-reader/v1/index.d.ts +0 -8
- package/dist/personas/content-reader/v1/index.js +0 -37
- package/dist/personas/content-reader/v1/prompts.js +0 -128
- package/dist/personas/content-reader/v1/resources/playbooks/compare.md +0 -21
- package/dist/personas/content-reader/v1/resources/playbooks/core.md +0 -40
- package/dist/personas/content-reader/v1/resources/playbooks/discover.md +0 -13
- package/dist/personas/content-reader/v1/resources/playbooks/explain-run.md +0 -19
- package/dist/personas/content-reader/v1/resources/playbooks/index.md +0 -14
- package/dist/personas/index.d.ts +0 -22
- package/dist/personas/index.js +0 -73
- package/dist/personas/index.test.js +0 -109
- package/dist/personas/organization-audit/v1/index.d.ts +0 -8
- package/dist/personas/organization-audit/v1/index.js +0 -42
- package/dist/personas/organization-audit/v1/prompts.js +0 -92
- package/dist/personas/organization-audit/v1/resources/playbooks/access.md +0 -13
- package/dist/personas/organization-audit/v1/resources/playbooks/content.md +0 -9
- package/dist/personas/organization-audit/v1/resources/playbooks/core.md +0 -36
- package/dist/personas/organization-audit/v1/resources/playbooks/deliveries.md +0 -9
- package/dist/personas/organization-audit/v1/resources/playbooks/index.md +0 -14
- package/dist/personas/persona.parity.test.js +0 -26
- package/dist/personas/semantic-layer/v1/index.d.ts +0 -8
- package/dist/personas/semantic-layer/v1/index.js +0 -32
- package/dist/personas/semantic-layer/v1/prompts.js +0 -85
- package/dist/personas/semantic-layer/v1/resources/playbooks/compose-compile.md +0 -55
- package/dist/personas/semantic-layer/v1/resources/playbooks/core.md +0 -39
- package/dist/personas/semantic-layer/v1/resources/playbooks/explore.md +0 -76
- package/dist/personas/semantic-layer/v1/resources/playbooks/index.md +0 -13
- package/dist/store/config.d.ts +0 -11
- package/dist/store/config.js +0 -50
- package/dist/store/config.test.js +0 -56
- package/dist/store/create-oauth-broker-store.d.ts +0 -6
- package/dist/store/create-oauth-broker-store.js +0 -16
- package/dist/store/create-preview-store.d.ts +0 -10
- package/dist/store/create-preview-store.js +0 -30
- package/dist/store/create-session-store.d.ts +0 -19
- package/dist/store/create-session-store.js +0 -24
- package/dist/store/in-memory-preview-store.d.ts +0 -17
- package/dist/store/in-memory-preview-store.js +0 -72
- package/dist/store/redis-client.d.ts +0 -11
- package/dist/store/redis-client.js +0 -48
- package/dist/store/redis-oauth-broker-store.d.ts +0 -42
- package/dist/store/redis-oauth-broker-store.js +0 -167
- package/dist/store/redis-oauth-broker-store.test.js +0 -80
- package/dist/store/redis-preview-store.d.ts +0 -23
- package/dist/store/redis-preview-store.js +0 -94
- package/dist/store/redis-preview-store.test.js +0 -39
- package/dist/store/redis-session-index.d.ts +0 -33
- package/dist/store/redis-session-index.js +0 -49
- package/dist/store/types.d.ts +0 -13
- package/dist/store/types.js +0 -8
- package/dist/transports/http-request-utils.d.ts +0 -2
- package/dist/transports/http-request-utils.js +0 -13
- package/dist/transports/session-store.d.ts +0 -72
- package/dist/transports/session-store.js +0 -143
- package/dist/transports/session-store.test.js +0 -111
- /package/dist/{destructive/confirmation-claim.test.d.ts → audit/server-profile.test.d.ts} +0 -0
- /package/dist/{personas/index.test.d.ts → config/obsolete-env.test.d.ts} +0 -0
- /package/dist/{personas/persona.parity.test.d.ts → governance/mcp-post-factory-context.test.d.ts} +0 -0
- /package/dist/{store/config.test.d.ts → policy/envelope.test.d.ts} +0 -0
- /package/dist/{personas → profiles}/content-developer/v1/prompts.test.d.ts +0 -0
- /package/dist/{personas → profiles}/content-governance/v1/prompts.d.ts +0 -0
- /package/dist/{personas → profiles}/content-governance/v1/prompts.js +0 -0
- /package/dist/{personas → profiles}/content-governance/v1/prompts.test.d.ts +0 -0
- /package/dist/{personas → profiles}/content-governance/v1/resources/playbooks/charts.md +0 -0
- /package/dist/{personas → profiles}/content-governance/v1/resources/playbooks/index.md +0 -0
- /package/dist/{personas → profiles}/content-governance/v1/resources/playbooks.d.ts +0 -0
- /package/dist/{personas → profiles}/content-reader/v1/prompts.d.ts +0 -0
- /package/dist/{personas → profiles}/content-reader/v1/prompts.test.d.ts +0 -0
- /package/dist/{personas → profiles}/content-reader/v1/resources/playbooks.d.ts +0 -0
- /package/dist/{store/redis-oauth-broker-store.test.d.ts → profiles/index.test.d.ts} +0 -0
- /package/dist/{personas → profiles}/organization-audit/v1/prompts.d.ts +0 -0
- /package/dist/{personas → profiles}/organization-audit/v1/prompts.test.d.ts +0 -0
- /package/dist/{personas → profiles}/organization-audit/v1/resources/playbooks.d.ts +0 -0
- /package/dist/{store/redis-preview-store.test.d.ts → profiles/profile.membership.test.d.ts} +0 -0
- /package/dist/{personas → profiles}/semantic-layer/v1/prompts.d.ts +0 -0
- /package/dist/{personas → profiles}/semantic-layer/v1/prompts.test.d.ts +0 -0
- /package/dist/{personas → profiles}/semantic-layer/v1/resources/playbooks.d.ts +0 -0
- /package/dist/{transports/session-store.test.d.ts → server/upstream-errors.test.d.ts} +0 -0
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MCP prompts for content-reader workflows.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.registerContentReaderPrompts = registerContentReaderPrompts;
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-deprecated -- matches organization-audit 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.CONTENT_READER_CORE_PLAYBOOK,
|
|
13
|
-
topics: playbooks_js_1.CONTENT_READER_TOPIC_PLAYBOOKS,
|
|
14
|
-
});
|
|
15
|
-
const TOPIC_EXPLAIN_RUN = 'explain-run';
|
|
16
|
-
function registerContentReaderPrompts(server) {
|
|
17
|
-
server.registerPrompt('find_content', {
|
|
18
|
-
title: 'Find content',
|
|
19
|
-
description: 'Find the most relevant saved Lightdash content in the current project',
|
|
20
|
-
argsSchema: {
|
|
21
|
-
question: zod_1.z.string(),
|
|
22
|
-
contentTypes: zod_1.z.string().optional(),
|
|
23
|
-
verifiedOnly: zod_1.z.boolean().optional(),
|
|
24
|
-
spaceUuid: zod_1.z.string().optional(),
|
|
25
|
-
},
|
|
26
|
-
}, ({ question, contentTypes, verifiedOnly, spaceUuid }) => userMessages(`Find the most relevant Lightdash content in the current project for:
|
|
27
|
-
|
|
28
|
-
${question}
|
|
29
|
-
|
|
30
|
-
${playbooks_js_1.CONTENT_READER_HARD_BANS}
|
|
31
|
-
|
|
32
|
-
Resolve the project first via lightdash_get_project. Search with lightdash_search_content and navigate spaces.
|
|
33
|
-
Prefer verified content when equally relevant. Content types hint: ${contentTypes !== null && contentTypes !== void 0 ? contentTypes : '(any)'}.
|
|
34
|
-
Verified only: ${verifiedOnly !== null && verifiedOnly !== void 0 ? verifiedOnly : false}. Space filter: ${spaceUuid !== null && spaceUuid !== void 0 ? spaceUuid : '(none)'}.
|
|
35
|
-
|
|
36
|
-
Do not execute content unless values or analysis are requested.
|
|
37
|
-
|
|
38
|
-
Return at most five candidates with name/type, UUID, space path, verification, relevance, and warnings.`, 'discover'));
|
|
39
|
-
server.registerPrompt('explain_chart', {
|
|
40
|
-
title: 'Explain chart',
|
|
41
|
-
description: 'Explain a saved chart from metadata (optional bounded execution)',
|
|
42
|
-
argsSchema: {
|
|
43
|
-
chartUuidOrSlug: zod_1.z.string(),
|
|
44
|
-
includeLatestValues: zod_1.z.boolean().optional(),
|
|
45
|
-
},
|
|
46
|
-
}, ({ chartUuidOrSlug, includeLatestValues }) => userMessages(`Explain the saved chart ${chartUuidOrSlug}.
|
|
47
|
-
|
|
48
|
-
${playbooks_js_1.CONTENT_READER_HARD_BANS}
|
|
49
|
-
|
|
50
|
-
Retrieve chart metadata with lightdash_get_chart / lightdash_explain_content.
|
|
51
|
-
Distinguish explicit metadata from inferred business meaning.
|
|
52
|
-
When includeLatestValues is ${includeLatestValues !== null && includeLatestValues !== void 0 ? includeLatestValues : false}, run lightdash_run_chart with cache and bounded limits.
|
|
53
|
-
Cite chart UUID and query UUID. Do not construct a new query or retrieve underlying data.`, TOPIC_EXPLAIN_RUN));
|
|
54
|
-
server.registerPrompt('summarize_dashboard', {
|
|
55
|
-
title: 'Summarize dashboard',
|
|
56
|
-
description: 'Summarize a dashboard with optional bounded tile execution',
|
|
57
|
-
argsSchema: {
|
|
58
|
-
dashboardUuidOrSlug: zod_1.z.string(),
|
|
59
|
-
executeTiles: zod_1.z.boolean().optional(),
|
|
60
|
-
maximumTiles: zod_1.z.number().optional(),
|
|
61
|
-
focus: zod_1.z.string().optional(),
|
|
62
|
-
},
|
|
63
|
-
}, ({ dashboardUuidOrSlug, executeTiles, maximumTiles, focus }) => userMessages(`Summarize dashboard ${dashboardUuidOrSlug}.
|
|
64
|
-
|
|
65
|
-
${playbooks_js_1.CONTENT_READER_HARD_BANS}
|
|
66
|
-
|
|
67
|
-
Describe purpose, tabs, filters, parameters, verification, and tile structure via lightdash_get_dashboard.
|
|
68
|
-
Select tiles relevant to: ${focus !== null && focus !== void 0 ? focus : '(general summary)'}.
|
|
69
|
-
When execution is requested (${executeTiles !== null && executeTiles !== void 0 ? executeTiles : false}), execute no more than ${maximumTiles !== null && maximumTiles !== void 0 ? maximumTiles : 5} tiles with lightdash_run_dashboard_tile,
|
|
70
|
-
preserve dashboard context, use cache, and use bounded limits.
|
|
71
|
-
Report values, trends, failures, content UUIDs, and query UUIDs. Do not claim unexecuted tiles support a conclusion.`, TOPIC_EXPLAIN_RUN));
|
|
72
|
-
server.registerPrompt('answer_from_content', {
|
|
73
|
-
title: 'Answer from content',
|
|
74
|
-
description: 'Answer a question using existing saved Lightdash content only',
|
|
75
|
-
argsSchema: {
|
|
76
|
-
question: zod_1.z.string(),
|
|
77
|
-
verifiedOnly: zod_1.z.boolean().optional(),
|
|
78
|
-
maximumExecutions: zod_1.z.number().optional(),
|
|
79
|
-
},
|
|
80
|
-
}, ({ question, verifiedOnly, maximumExecutions }) => userMessages(`Answer this question using existing Lightdash content:
|
|
81
|
-
|
|
82
|
-
${question}
|
|
83
|
-
|
|
84
|
-
${playbooks_js_1.CONTENT_READER_HARD_BANS}
|
|
85
|
-
|
|
86
|
-
Search for relevant content, inspect metadata, prefer verified=${verifiedOnly !== null && verifiedOnly !== void 0 ? verifiedOnly : false} when set,
|
|
87
|
-
and execute only the smallest number of saved charts or tiles required, up to ${maximumExecutions !== null && maximumExecutions !== void 0 ? maximumExecutions : 3}.
|
|
88
|
-
Use saved filters and parameters except for validated value overrides.
|
|
89
|
-
State the answer, content used, filter/parameter context, result timestamp, cache state, truncation, and limitations.`, TOPIC_EXPLAIN_RUN));
|
|
90
|
-
server.registerPrompt('compare_content', {
|
|
91
|
-
title: 'Compare content',
|
|
92
|
-
description: 'Compare saved content definitions and optionally values',
|
|
93
|
-
argsSchema: {
|
|
94
|
-
contentReferences: zod_1.z.string(),
|
|
95
|
-
comparisonQuestion: zod_1.z.string(),
|
|
96
|
-
},
|
|
97
|
-
}, ({ contentReferences, comparisonQuestion }) => userMessages(`Compare these Lightdash content items:
|
|
98
|
-
|
|
99
|
-
${contentReferences}
|
|
100
|
-
|
|
101
|
-
Question:
|
|
102
|
-
${comparisonQuestion}
|
|
103
|
-
|
|
104
|
-
${playbooks_js_1.CONTENT_READER_HARD_BANS}
|
|
105
|
-
|
|
106
|
-
Retrieve metadata first. Compare definitions, dimensions, filters, time grains, parameters, verification, and update state before values.
|
|
107
|
-
Execute only when structurally comparable or when differences are the subject of analysis.
|
|
108
|
-
Do not assume matching labels mean matching definitions.`, 'compare'));
|
|
109
|
-
server.registerPrompt('investigate_result_difference', {
|
|
110
|
-
title: 'Investigate result difference',
|
|
111
|
-
description: 'Investigate why two content resources differ',
|
|
112
|
-
argsSchema: {
|
|
113
|
-
firstContent: zod_1.z.string(),
|
|
114
|
-
secondContent: zod_1.z.string(),
|
|
115
|
-
observedDifference: zod_1.z.string(),
|
|
116
|
-
},
|
|
117
|
-
}, ({ firstContent, secondContent, observedDifference }) => userMessages(`Investigate why these Lightdash resources differ:
|
|
118
|
-
|
|
119
|
-
First: ${firstContent}
|
|
120
|
-
Second: ${secondContent}
|
|
121
|
-
Difference: ${observedDifference}
|
|
122
|
-
|
|
123
|
-
${playbooks_js_1.CONTENT_READER_HARD_BANS}
|
|
124
|
-
|
|
125
|
-
Check metrics, fields, filters, dashboard context, date ranges, time grains, parameters, sorts, limits, pivots, table calculations, verification, cache timestamps, and semantic-versus-SQL behavior.
|
|
126
|
-
Execute only when needed with equivalent valid context. Separate confirmed, plausible, ruled-out, and unresolved causes.`, 'compare'));
|
|
127
|
-
}
|
|
128
|
-
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Content-reader — compare / investigate
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/content-reader/compare`
|
|
4
|
-
|
|
5
|
-
Focus phases 3–6 on **diffs** between saved content definitions and (optionally) values.
|
|
6
|
-
|
|
7
|
-
## Phase 3 — Inspect both sides
|
|
8
|
-
|
|
9
|
-
Retrieve metadata first (`get_chart`, `get_dashboard`, `explain_content`, parameter tools). Compare definitions, dimensions, filters, time grains, parameters, verification, and update state before values.
|
|
10
|
-
|
|
11
|
-
## Phase 4 — Decide whether values help
|
|
12
|
-
|
|
13
|
-
Execute only when structurally comparable or when differences are the subject of analysis. Do not assume matching labels mean matching definitions.
|
|
14
|
-
|
|
15
|
-
## Phase 5 — Execute with equivalent context
|
|
16
|
-
|
|
17
|
-
When needed, run with equivalent valid filters/parameters/context (`run_chart` / `run_dashboard_tile`). Check metrics, fields, filters, dashboard context, date ranges, time grains, parameters, sorts, limits, pivots, table calculations, verification, cache timestamps, and semantic-versus-SQL behavior.
|
|
18
|
-
|
|
19
|
-
## Phase 6 — Report causes
|
|
20
|
-
|
|
21
|
-
Separate confirmed, plausible, ruled-out, and unresolved causes. Cite content UUIDs, query UUIDs, truncation, and caveats.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Content-reader core
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/content-reader/core`
|
|
4
|
-
|
|
5
|
-
## Hard bans
|
|
6
|
-
|
|
7
|
-
- Do not mutate Lightdash resources.
|
|
8
|
-
- Do not execute arbitrary metric queries, raw SQL, or underlying-data queries.
|
|
9
|
-
- Do not download or bulk-export results.
|
|
10
|
-
- Do not execute saved SQL charts (disabled by default).
|
|
11
|
-
- Do not override filter targets, operators, required-filter behavior, fields, metrics, dimensions, SQL, table calculations, or sorts.
|
|
12
|
-
- Do not execute content outside the resolved project.
|
|
13
|
-
- Do not present truncated results as complete.
|
|
14
|
-
- Do not claim metric equivalence from matching labels alone.
|
|
15
|
-
- Do not reveal secrets, warehouse credentials, hidden SQL, or inaccessible content.
|
|
16
|
-
|
|
17
|
-
## Tools
|
|
18
|
-
|
|
19
|
-
Use only these `lightdash_*` tools:
|
|
20
|
-
|
|
21
|
-
- `get_project`
|
|
22
|
-
- `search_content`
|
|
23
|
-
- `list_spaces`
|
|
24
|
-
- `get_space`
|
|
25
|
-
- `get_dashboard`
|
|
26
|
-
- `get_chart`
|
|
27
|
-
- `list_project_parameters`
|
|
28
|
-
- `get_project_parameters`
|
|
29
|
-
- `explain_content`
|
|
30
|
-
- `run_chart`
|
|
31
|
-
- `run_dashboard_tile`
|
|
32
|
-
- `get_query_result`
|
|
33
|
-
- `cancel_query`
|
|
34
|
-
|
|
35
|
-
## Phase 0 — Resolve project
|
|
36
|
-
|
|
37
|
-
1. Call `lightdash_get_project` (pin / `LIGHTDASH_TOOLS_PROJECT_UUID` / explicit UUID).
|
|
38
|
-
2. Record project UUID, pin, and `readerCapabilities`.
|
|
39
|
-
3. Stop when project scope is unresolved (`PROJECT_SCOPE_REQUIRED`).
|
|
40
|
-
4. Never enumerate organization projects.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Content-reader — discover
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/content-reader/discover`
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Classify intent
|
|
6
|
-
|
|
7
|
-
Classify as find / explain / retrieve value / summarize dashboard / compare / investigate.
|
|
8
|
-
|
|
9
|
-
## Phase 2 — Discover
|
|
10
|
-
|
|
11
|
-
Use `search_content`, `list_spaces`, `get_space`. Prefer verified content when equally relevant.
|
|
12
|
-
|
|
13
|
-
Return at most five candidates with name/type, UUID, space path, verification, relevance, and warnings. Do not execute content unless values or analysis are requested.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Content-reader — explain & run
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/content-reader/explain-run`
|
|
4
|
-
|
|
5
|
-
## Phase 3 — Inspect metadata
|
|
6
|
-
|
|
7
|
-
Use `get_dashboard`, `get_chart`, parameter tools, `explain_content`. Do not invent unsupported business semantics. Distinguish explicit metadata from inferred business meaning.
|
|
8
|
-
|
|
9
|
-
## Phase 4 — Decide on execution
|
|
10
|
-
|
|
11
|
-
Execute only for values, trends, rankings, summaries, comparisons, or discrepancy validation. Skip execution for discovery/description.
|
|
12
|
-
|
|
13
|
-
## Phase 5 — Execute bounded saved content
|
|
14
|
-
|
|
15
|
-
Use `run_chart` / `run_dashboard_tile` with cache-first defaults, limit 100, values-only overrides. SQL charts return `CONTENT_NOT_EXECUTABLE`. Record query UUID; cancel unnecessary queries via `cancel_query`.
|
|
16
|
-
|
|
17
|
-
## Phase 6 — Interpret and report
|
|
18
|
-
|
|
19
|
-
Report answer, evidence, content UUIDs, filters/parameters, cache/time context, truncation, and caveats. Cite chart/dashboard UUID and query UUID. Do not construct a new query or retrieve underlying data. Do not claim unexecuted tiles support a conclusion.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Content-reader playbooks
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/content-reader`
|
|
4
|
-
|
|
5
|
-
Workflow-scoped playbooks (always load **core** plus one topic with a prompt):
|
|
6
|
-
|
|
7
|
-
| Topic | URI |
|
|
8
|
-
| --------------------- | -------------------------------------------------- |
|
|
9
|
-
| Core (gates & bans) | `lightdash://playbooks/content-reader/core` |
|
|
10
|
-
| Discover | `lightdash://playbooks/content-reader/discover` |
|
|
11
|
-
| Explain & run | `lightdash://playbooks/content-reader/explain-run` |
|
|
12
|
-
| Compare / investigate | `lightdash://playbooks/content-reader/compare` |
|
|
13
|
-
|
|
14
|
-
Discover, explain, and execute saved Lightdash charts and dashboards safely within a resolved project.
|
package/dist/personas/index.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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;
|
package/dist/personas/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
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 */
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Organization-audit — access governance
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/organization-audit/access`
|
|
4
|
-
|
|
5
|
-
## Phase 1 — Identity
|
|
6
|
-
|
|
7
|
-
Call `list_org_members` (paginate while `pagination.complete` is false, or stop after a small page budget). Optionally `list_org_groups`, `list_org_role_assignments`, `list_custom_roles`, `get_org_member` for spot checks.
|
|
8
|
-
|
|
9
|
-
## Phase 2 — Projects and access
|
|
10
|
-
|
|
11
|
-
Call `list_org_projects`, then for a capped set of projects: `list_project_roles`, `list_project_direct_access`, `list_space_access`, and `resolve_effective_access`. Treat `list_project_direct_access` as direct grants only; emails are masked by default — pass `includeEmail=true` only when required. Pass `allowedEmailDomains` when classifying external direct-access principals. Honor incomplete flags and truncation warnings.
|
|
12
|
-
|
|
13
|
-
Do not treat `list_project_direct_access` as complete effective access. State assumptions and coverage gaps.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Organization-audit — content and health
|
|
2
|
-
|
|
3
|
-
URI: `lightdash://playbooks/organization-audit/content`
|
|
4
|
-
|
|
5
|
-
## Phase 3 — Content and health
|
|
6
|
-
|
|
7
|
-
Per project (capped): `list_content` (use `sortBy`/`sortDirection`/`page` intentionally), `list_validation_results`, `get_project_user_activity`. Use `get_dashboard_meta` only when needed. Host joins validation, views, and ownership into findings — do not invent a server-side crawler.
|
|
8
|
-
|
|
9
|
-
Do not recommend deletion solely because content is unused. Join results in the conversation — do not assume a server-side audit tool.
|