@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Data-analyst multi-playbook resources (core + explore topic).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DATA_ANALYST_TOPIC_PLAYBOOKS = exports.DATA_ANALYST_CORE_PLAYBOOK = exports.getAllPlaybookMarkdown = exports.DATA_ANALYST_HARD_BANS = void 0;
|
|
7
|
+
exports.registerDataAnalystPlaybook = registerDataAnalystPlaybook;
|
|
8
|
+
const playbook_resources_js_1 = require("../../../lib/playbook-resources.js");
|
|
9
|
+
const playbooks = (0, playbook_resources_js_1.defineProfilePlaybooks)({
|
|
10
|
+
profileId: 'data-analyst',
|
|
11
|
+
moduleDir: __dirname,
|
|
12
|
+
hardBans: `Do not mutate Lightdash resources (create/update/delete/move charts or dashboards).
|
|
13
|
+
Do not run raw SQL, tableCalculations, underlying-data drills, or result downloads.
|
|
14
|
+
Do not execute saved charts (use content-reader) or invent fieldIds.
|
|
15
|
+
Do not present truncated results as complete.
|
|
16
|
+
Do not run queries outside the resolved project (pass projectUuid or HTTP pin).`,
|
|
17
|
+
coreDescription: 'Hard bans, budgets, tools, and project scope',
|
|
18
|
+
topics: [
|
|
19
|
+
{
|
|
20
|
+
id: 'explore',
|
|
21
|
+
title: 'Data-analyst explore playbook',
|
|
22
|
+
description: 'Compose and run unsaved metric queries (UI Explore loop)',
|
|
23
|
+
file: 'explore.md',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
});
|
|
27
|
+
exports.DATA_ANALYST_HARD_BANS = playbooks.HARD_BANS;
|
|
28
|
+
exports.getAllPlaybookMarkdown = playbooks.getAllPlaybookMarkdown;
|
|
29
|
+
exports.DATA_ANALYST_CORE_PLAYBOOK = playbooks.CORE_PLAYBOOK;
|
|
30
|
+
exports.DATA_ANALYST_TOPIC_PLAYBOOKS = playbooks.TOPIC_PLAYBOOKS;
|
|
31
|
+
function registerDataAnalystPlaybook(server) {
|
|
32
|
+
playbooks.registerPlaybooks(server);
|
|
33
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shipped MCP profiles (path → definition). No PROFILE/PATH env knobs (ADR-0006).
|
|
3
|
+
*/
|
|
4
|
+
import type { ProfileDefinition, ProfileId } from './types.js';
|
|
5
|
+
export type { ProfileDefinition, ProfileId } from './types.js';
|
|
6
|
+
export { AI_AGENT_OPS_PROFILE_PATH } from './ai-agent-ops/v1/index.js';
|
|
7
|
+
export { SEMANTIC_LAYER_PROFILE_PATH } from './semantic-layer/v1/index.js';
|
|
8
|
+
export { ORGANIZATION_AUDIT_PROFILE_PATH } from './organization-audit/v1/index.js';
|
|
9
|
+
export { CONTENT_READER_PROFILE_PATH } from './content-reader/v1/index.js';
|
|
10
|
+
export { CONTENT_DEVELOPER_PROFILE_PATH } from './content-developer/v1/index.js';
|
|
11
|
+
export { CONTENT_GOVERNANCE_PROFILE_PATH } from './content-governance/v1/index.js';
|
|
12
|
+
export { DATA_ANALYST_PROFILE_PATH } from './data-analyst/v1/index.js';
|
|
13
|
+
/** Default stdio profile (backward compatible). */
|
|
14
|
+
export declare const DEFAULT_PROFILE_ID: ProfileId;
|
|
15
|
+
export declare const PROFILES: Record<ProfileId, ProfileDefinition>;
|
|
16
|
+
export declare function getProfile(id: ProfileId): ProfileDefinition;
|
|
17
|
+
export declare function getDefaultProfile(): ProfileDefinition;
|
|
18
|
+
/** Resolve profile from an HTTP request path, or undefined if unknown. */
|
|
19
|
+
export declare function getProfileByPath(path: string): ProfileDefinition | undefined;
|
|
20
|
+
export declare function listProfilePaths(): string[];
|
|
21
|
+
/** Parse a CLI profile id; returns undefined when invalid. */
|
|
22
|
+
export declare function parseProfileId(value: string): ProfileId | undefined;
|
|
23
|
+
/** MCP server display name for a profile. */
|
|
24
|
+
export declare function getProfileServerName(profile: ProfileDefinition): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shipped MCP profiles (path → definition). No PROFILE/PATH env knobs (ADR-0006).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PROFILES = exports.DEFAULT_PROFILE_ID = exports.DATA_ANALYST_PROFILE_PATH = exports.CONTENT_GOVERNANCE_PROFILE_PATH = exports.CONTENT_DEVELOPER_PROFILE_PATH = exports.CONTENT_READER_PROFILE_PATH = exports.ORGANIZATION_AUDIT_PROFILE_PATH = exports.SEMANTIC_LAYER_PROFILE_PATH = exports.AI_AGENT_OPS_PROFILE_PATH = void 0;
|
|
7
|
+
exports.getProfile = getProfile;
|
|
8
|
+
exports.getDefaultProfile = getDefaultProfile;
|
|
9
|
+
exports.getProfileByPath = getProfileByPath;
|
|
10
|
+
exports.listProfilePaths = listProfilePaths;
|
|
11
|
+
exports.parseProfileId = parseProfileId;
|
|
12
|
+
exports.getProfileServerName = getProfileServerName;
|
|
13
|
+
const common_1 = require("@lightdash-tools/common");
|
|
14
|
+
const normalize_url_js_1 = require("../config/normalize-url.js");
|
|
15
|
+
const index_js_1 = require("./ai-agent-ops/v1/index.js");
|
|
16
|
+
const index_js_2 = require("./content-developer/v1/index.js");
|
|
17
|
+
const index_js_3 = require("./content-governance/v1/index.js");
|
|
18
|
+
const index_js_4 = require("./content-reader/v1/index.js");
|
|
19
|
+
const index_js_5 = require("./data-analyst/v1/index.js");
|
|
20
|
+
const index_js_6 = require("./organization-audit/v1/index.js");
|
|
21
|
+
const index_js_7 = require("./semantic-layer/v1/index.js");
|
|
22
|
+
var index_js_8 = require("./ai-agent-ops/v1/index.js");
|
|
23
|
+
Object.defineProperty(exports, "AI_AGENT_OPS_PROFILE_PATH", { enumerable: true, get: function () { return index_js_8.AI_AGENT_OPS_PROFILE_PATH; } });
|
|
24
|
+
var index_js_9 = require("./semantic-layer/v1/index.js");
|
|
25
|
+
Object.defineProperty(exports, "SEMANTIC_LAYER_PROFILE_PATH", { enumerable: true, get: function () { return index_js_9.SEMANTIC_LAYER_PROFILE_PATH; } });
|
|
26
|
+
var index_js_10 = require("./organization-audit/v1/index.js");
|
|
27
|
+
Object.defineProperty(exports, "ORGANIZATION_AUDIT_PROFILE_PATH", { enumerable: true, get: function () { return index_js_10.ORGANIZATION_AUDIT_PROFILE_PATH; } });
|
|
28
|
+
var index_js_11 = require("./content-reader/v1/index.js");
|
|
29
|
+
Object.defineProperty(exports, "CONTENT_READER_PROFILE_PATH", { enumerable: true, get: function () { return index_js_11.CONTENT_READER_PROFILE_PATH; } });
|
|
30
|
+
var index_js_12 = require("./content-developer/v1/index.js");
|
|
31
|
+
Object.defineProperty(exports, "CONTENT_DEVELOPER_PROFILE_PATH", { enumerable: true, get: function () { return index_js_12.CONTENT_DEVELOPER_PROFILE_PATH; } });
|
|
32
|
+
var index_js_13 = require("./content-governance/v1/index.js");
|
|
33
|
+
Object.defineProperty(exports, "CONTENT_GOVERNANCE_PROFILE_PATH", { enumerable: true, get: function () { return index_js_13.CONTENT_GOVERNANCE_PROFILE_PATH; } });
|
|
34
|
+
var index_js_14 = require("./data-analyst/v1/index.js");
|
|
35
|
+
Object.defineProperty(exports, "DATA_ANALYST_PROFILE_PATH", { enumerable: true, get: function () { return index_js_14.DATA_ANALYST_PROFILE_PATH; } });
|
|
36
|
+
/** Default stdio profile (backward compatible). */
|
|
37
|
+
exports.DEFAULT_PROFILE_ID = 'semantic-layer';
|
|
38
|
+
exports.PROFILES = {
|
|
39
|
+
'semantic-layer': index_js_7.semanticLayerProfile,
|
|
40
|
+
'organization-audit': index_js_6.organizationAuditProfile,
|
|
41
|
+
'content-reader': index_js_4.contentReaderProfile,
|
|
42
|
+
'content-developer': index_js_2.contentDeveloperProfile,
|
|
43
|
+
'content-governance': index_js_3.contentGovernanceProfile,
|
|
44
|
+
'ai-agent-ops': index_js_1.aiAgentOpsProfile,
|
|
45
|
+
'data-analyst': index_js_5.dataAnalystProfile,
|
|
46
|
+
};
|
|
47
|
+
const PROFILES_BY_PATH = new Map(Object.values(exports.PROFILES).map((profile) => [profile.path, profile]));
|
|
48
|
+
function getProfile(id) {
|
|
49
|
+
// eslint-disable-next-line security/detect-object-injection -- ProfileId union
|
|
50
|
+
return exports.PROFILES[id];
|
|
51
|
+
}
|
|
52
|
+
function getDefaultProfile() {
|
|
53
|
+
return getProfile(exports.DEFAULT_PROFILE_ID);
|
|
54
|
+
}
|
|
55
|
+
/** Resolve profile from an HTTP request path, or undefined if unknown. */
|
|
56
|
+
function getProfileByPath(path) {
|
|
57
|
+
if (path.trim().length === 0) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return PROFILES_BY_PATH.get((0, normalize_url_js_1.normalizeMcpPath)(path));
|
|
61
|
+
}
|
|
62
|
+
function listProfilePaths() {
|
|
63
|
+
return [...PROFILES_BY_PATH.keys()];
|
|
64
|
+
}
|
|
65
|
+
/** Parse a CLI profile id; returns undefined when invalid. */
|
|
66
|
+
function parseProfileId(value) {
|
|
67
|
+
return common_1.PROFILE_IDS.includes(value) ? value : undefined;
|
|
68
|
+
}
|
|
69
|
+
/** MCP server display name for a profile. */
|
|
70
|
+
function getProfileServerName(profile) {
|
|
71
|
+
var _a;
|
|
72
|
+
return (_a = profile.serverName) !== null && _a !== void 0 ? _a : `lightdash-mcp-${profile.id}`;
|
|
73
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_1 = require("@lightdash-tools/common");
|
|
4
|
+
const vitest_1 = require("vitest");
|
|
5
|
+
const registry_js_1 = require("../tools/registry.js");
|
|
6
|
+
const shared_js_1 = require("../tools/shared.js");
|
|
7
|
+
const index_js_1 = require("./index.js");
|
|
8
|
+
(0, vitest_1.describe)('profiles', () => {
|
|
9
|
+
(0, vitest_1.it)('ships seven profiles with fixed paths', () => {
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
11
|
+
(0, vitest_1.expect)(Object.keys(index_js_1.PROFILES).sort()).toEqual([...common_1.PROFILE_IDS].sort());
|
|
12
|
+
(0, vitest_1.expect)(index_js_1.DEFAULT_PROFILE_ID).toBe('semantic-layer');
|
|
13
|
+
(0, vitest_1.expect)((0, index_js_1.listProfilePaths)().sort()).toEqual([
|
|
14
|
+
index_js_1.AI_AGENT_OPS_PROFILE_PATH,
|
|
15
|
+
index_js_1.CONTENT_DEVELOPER_PROFILE_PATH,
|
|
16
|
+
index_js_1.CONTENT_GOVERNANCE_PROFILE_PATH,
|
|
17
|
+
index_js_1.CONTENT_READER_PROFILE_PATH,
|
|
18
|
+
index_js_1.DATA_ANALYST_PROFILE_PATH,
|
|
19
|
+
index_js_1.ORGANIZATION_AUDIT_PROFILE_PATH,
|
|
20
|
+
index_js_1.SEMANTIC_LAYER_PROFILE_PATH,
|
|
21
|
+
].sort());
|
|
22
|
+
(0, vitest_1.expect)((_a = (0, index_js_1.getProfileByPath)(index_js_1.SEMANTIC_LAYER_PROFILE_PATH)) === null || _a === void 0 ? void 0 : _a.id).toBe('semantic-layer');
|
|
23
|
+
(0, vitest_1.expect)((_b = (0, index_js_1.getProfileByPath)(index_js_1.ORGANIZATION_AUDIT_PROFILE_PATH)) === null || _b === void 0 ? void 0 : _b.id).toBe('organization-audit');
|
|
24
|
+
(0, vitest_1.expect)((_c = (0, index_js_1.getProfileByPath)(index_js_1.CONTENT_READER_PROFILE_PATH)) === null || _c === void 0 ? void 0 : _c.id).toBe('content-reader');
|
|
25
|
+
(0, vitest_1.expect)((_d = (0, index_js_1.getProfileByPath)(index_js_1.CONTENT_DEVELOPER_PROFILE_PATH)) === null || _d === void 0 ? void 0 : _d.id).toBe('content-developer');
|
|
26
|
+
(0, vitest_1.expect)((_e = (0, index_js_1.getProfileByPath)(index_js_1.CONTENT_GOVERNANCE_PROFILE_PATH)) === null || _e === void 0 ? void 0 : _e.id).toBe('content-governance');
|
|
27
|
+
(0, vitest_1.expect)((_f = (0, index_js_1.getProfileByPath)(index_js_1.AI_AGENT_OPS_PROFILE_PATH)) === null || _f === void 0 ? void 0 : _f.id).toBe('ai-agent-ops');
|
|
28
|
+
(0, vitest_1.expect)((_g = (0, index_js_1.getProfileByPath)(index_js_1.DATA_ANALYST_PROFILE_PATH)) === null || _g === void 0 ? void 0 : _g.id).toBe('data-analyst');
|
|
29
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileByPath)('/mcp')).toBeUndefined();
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.it)('normalizes trailing slashes when resolving path', () => {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
33
|
+
(0, vitest_1.expect)((_a = (0, index_js_1.getProfileByPath)(`${index_js_1.SEMANTIC_LAYER_PROFILE_PATH}/`)) === null || _a === void 0 ? void 0 : _a.id).toBe('semantic-layer');
|
|
34
|
+
(0, vitest_1.expect)((_b = (0, index_js_1.getProfileByPath)(`${index_js_1.ORGANIZATION_AUDIT_PROFILE_PATH}/`)) === null || _b === void 0 ? void 0 : _b.id).toBe('organization-audit');
|
|
35
|
+
(0, vitest_1.expect)((_c = (0, index_js_1.getProfileByPath)(`${index_js_1.CONTENT_READER_PROFILE_PATH}/`)) === null || _c === void 0 ? void 0 : _c.id).toBe('content-reader');
|
|
36
|
+
(0, vitest_1.expect)((_d = (0, index_js_1.getProfileByPath)(`${index_js_1.CONTENT_DEVELOPER_PROFILE_PATH}/`)) === null || _d === void 0 ? void 0 : _d.id).toBe('content-developer');
|
|
37
|
+
(0, vitest_1.expect)((_e = (0, index_js_1.getProfileByPath)(`${index_js_1.CONTENT_GOVERNANCE_PROFILE_PATH}/`)) === null || _e === void 0 ? void 0 : _e.id).toBe('content-governance');
|
|
38
|
+
(0, vitest_1.expect)((_f = (0, index_js_1.getProfileByPath)(`${index_js_1.AI_AGENT_OPS_PROFILE_PATH}/`)) === null || _f === void 0 ? void 0 : _f.id).toBe('ai-agent-ops');
|
|
39
|
+
(0, vitest_1.expect)((_g = (0, index_js_1.getProfileByPath)(`${index_js_1.DATA_ANALYST_PROFILE_PATH}/`)) === null || _g === void 0 ? void 0 : _g.id).toBe('data-analyst');
|
|
40
|
+
});
|
|
41
|
+
(0, vitest_1.it)('semantic-layer catalog membership has exactly nine tools', () => {
|
|
42
|
+
const tools = (0, common_1.listMcpToolNamesByProfile)('semantic-layer');
|
|
43
|
+
(0, vitest_1.expect)(tools).toHaveLength(9);
|
|
44
|
+
(0, vitest_1.expect)((0, index_js_1.getDefaultProfile)().id).toBe('semantic-layer');
|
|
45
|
+
});
|
|
46
|
+
(0, vitest_1.it)('organization-audit membership and short server name', () => {
|
|
47
|
+
const profile = (0, index_js_1.getProfile)('organization-audit');
|
|
48
|
+
(0, vitest_1.expect)((0, common_1.listMcpToolNamesByProfile)(profile.id)).toHaveLength(18);
|
|
49
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileServerName)(profile)).toBe('lightdash-mcp-org-audit');
|
|
50
|
+
});
|
|
51
|
+
(0, vitest_1.it)('content-reader membership and server name', () => {
|
|
52
|
+
const profile = (0, index_js_1.getProfile)('content-reader');
|
|
53
|
+
(0, vitest_1.expect)((0, common_1.listMcpToolNamesByProfile)(profile.id)).toHaveLength(14);
|
|
54
|
+
(0, vitest_1.expect)((0, common_1.listMcpToolNamesByProfile)(profile.id)).toContain('export_chart_image');
|
|
55
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileServerName)(profile)).toBe('lightdash-mcp-content');
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.it)('content-developer membership and short server name', () => {
|
|
58
|
+
const profile = (0, index_js_1.getProfile)('content-developer');
|
|
59
|
+
const tools = (0, common_1.listMcpToolNamesByProfile)(profile.id);
|
|
60
|
+
(0, vitest_1.expect)(tools).toContain('get_chart_as_code');
|
|
61
|
+
(0, vitest_1.expect)(tools).not.toContain('create_space');
|
|
62
|
+
(0, vitest_1.expect)(tools).not.toContain('update_space');
|
|
63
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileServerName)(profile)).toBe('lightdash-mcp-cdev');
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.it)('content-governance membership and short server name', () => {
|
|
66
|
+
const profile = (0, index_js_1.getProfile)('content-governance');
|
|
67
|
+
(0, vitest_1.expect)([...(0, common_1.listMcpToolNamesByProfile)(profile.id)].sort()).toEqual([
|
|
68
|
+
'delete_chart',
|
|
69
|
+
'delete_dashboard',
|
|
70
|
+
'get_dashboard_promote_diff',
|
|
71
|
+
'promote_dashboard',
|
|
72
|
+
].sort());
|
|
73
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileServerName)(profile)).toBe('lightdash-mcp-gov');
|
|
74
|
+
});
|
|
75
|
+
(0, vitest_1.it)('ai-agent-ops membership and short server name', () => {
|
|
76
|
+
const profile = (0, index_js_1.getProfile)('ai-agent-ops');
|
|
77
|
+
const tools = (0, common_1.listMcpToolNamesByProfile)(profile.id);
|
|
78
|
+
(0, vitest_1.expect)(tools).toHaveLength(17);
|
|
79
|
+
(0, vitest_1.expect)(tools).not.toContain('create_project_agent');
|
|
80
|
+
(0, vitest_1.expect)(tools).not.toContain('generate_agent_message');
|
|
81
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileServerName)(profile)).toBe('lightdash-mcp-aops');
|
|
82
|
+
});
|
|
83
|
+
(0, vitest_1.it)('data-analyst membership and short server name', () => {
|
|
84
|
+
const profile = (0, index_js_1.getProfile)('data-analyst');
|
|
85
|
+
const tools = (0, common_1.listMcpToolNamesByProfile)(profile.id);
|
|
86
|
+
(0, vitest_1.expect)(tools).toHaveLength(9);
|
|
87
|
+
(0, vitest_1.expect)(tools).toContain('run_metric_query');
|
|
88
|
+
(0, vitest_1.expect)(tools).not.toContain('run_chart');
|
|
89
|
+
(0, vitest_1.expect)((0, index_js_1.getProfileServerName)(profile)).toBe('lightdash-mcp-analyst');
|
|
90
|
+
});
|
|
91
|
+
(0, vitest_1.it)('keeps combined server+tool wire names under 60 characters', () => {
|
|
92
|
+
for (const profile of Object.values(index_js_1.PROFILES)) {
|
|
93
|
+
const serverName = (0, index_js_1.getProfileServerName)(profile);
|
|
94
|
+
for (const id of (0, common_1.listMcpToolNamesByProfile)(profile.id)) {
|
|
95
|
+
const combined = serverName.length + (shared_js_1.TOOL_PREFIX + id).length;
|
|
96
|
+
(0, vitest_1.expect)(combined, `${serverName}+${shared_js_1.TOOL_PREFIX}${id}`).toBeLessThanOrEqual(60);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
(0, vitest_1.it)('parseProfileId validates known ids only', () => {
|
|
101
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('semantic-layer')).toBe('semantic-layer');
|
|
102
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('organization-audit')).toBe('organization-audit');
|
|
103
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('content-reader')).toBe('content-reader');
|
|
104
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('content-developer')).toBe('content-developer');
|
|
105
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('content-governance')).toBe('content-governance');
|
|
106
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('ai-agent-ops')).toBe('ai-agent-ops');
|
|
107
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('data-analyst')).toBe('data-analyst');
|
|
108
|
+
(0, vitest_1.expect)((0, index_js_1.parseProfileId)('nope')).toBeUndefined();
|
|
109
|
+
});
|
|
110
|
+
(0, vitest_1.it)('registerToolsByIds registers only allowlisted ids', () => {
|
|
111
|
+
const registered = [];
|
|
112
|
+
const mockServer = {
|
|
113
|
+
registerTool: vitest_1.vi.fn((name) => {
|
|
114
|
+
registered.push(name);
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
const mockCtx = { getContext: async () => ({ lightdashClient: {} }) };
|
|
118
|
+
(0, registry_js_1.registerToolsByIds)(mockServer, mockCtx, ['list_projects', 'compile_query']);
|
|
119
|
+
(0, vitest_1.expect)(registered).toEqual([`${shared_js_1.TOOL_PREFIX}list_projects`, `${shared_js_1.TOOL_PREFIX}compile_query`]);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Shared helpers for registering markdown playbook MCP resources and
|
|
3
3
|
* embedding core + topic playbooks into prompt messages.
|
|
4
4
|
*/
|
|
5
|
+
import type { ProfileId } from '../types.js';
|
|
5
6
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
6
7
|
export declare const PLAYBOOK_MIME: "text/markdown";
|
|
7
8
|
export type PlaybookResourceSpec = {
|
|
@@ -34,37 +35,38 @@ type PromptUserMessage = {
|
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
/**
|
|
37
|
-
* Build prompt message helpers that embed core, and optionally one topic
|
|
38
|
-
* after the user text message. When `topicId` is omitted, only core is
|
|
38
|
+
* Build prompt message helpers that embed core, and optionally one or more topic
|
|
39
|
+
* playbooks, after the user text message. When `topicId` is omitted, only core is
|
|
40
|
+
* embedded.
|
|
39
41
|
*/
|
|
40
42
|
export declare function createPromptPlaybookEmbedder<TopicId extends string>(options: {
|
|
41
43
|
core: EmbeddedPlaybook;
|
|
42
44
|
topics: Readonly<Record<TopicId, EmbeddedPlaybook>>;
|
|
43
|
-
}): (text: string, topicId?: TopicId) => {
|
|
45
|
+
}): (text: string, topicId?: TopicId | readonly TopicId[]) => {
|
|
44
46
|
messages: PromptUserMessage[];
|
|
45
47
|
};
|
|
46
|
-
export type
|
|
48
|
+
export type ProfilePlaybookTopicDef<TopicId extends string = string> = {
|
|
47
49
|
id: TopicId;
|
|
48
50
|
title: string;
|
|
49
51
|
description: string;
|
|
50
52
|
/** Filename under `playbooks/`, e.g. `dashboards.md`. */
|
|
51
53
|
file: string;
|
|
52
54
|
};
|
|
53
|
-
export type
|
|
54
|
-
|
|
55
|
+
export type DefineProfilePlaybooksOptions<TopicId extends string> = {
|
|
56
|
+
profileId: ProfileId;
|
|
55
57
|
moduleDir: string;
|
|
56
58
|
hardBans: string;
|
|
57
|
-
topics: readonly
|
|
59
|
+
topics: readonly ProfilePlaybookTopicDef<TopicId>[];
|
|
58
60
|
indexTitle?: string;
|
|
59
61
|
indexDescription?: string;
|
|
60
62
|
coreTitle?: string;
|
|
61
63
|
coreDescription?: string;
|
|
62
64
|
};
|
|
63
65
|
/**
|
|
64
|
-
* Factory for
|
|
65
|
-
* Callers re-export the returned fields under
|
|
66
|
+
* Factory for profile multi-playbook resources (index + core + topics).
|
|
67
|
+
* Callers re-export the returned fields under profile-specific names.
|
|
66
68
|
*/
|
|
67
|
-
export declare function
|
|
69
|
+
export declare function defineProfilePlaybooks<TopicId extends string>(options: DefineProfilePlaybooksOptions<TopicId>): {
|
|
68
70
|
URIs: {
|
|
69
71
|
index: string;
|
|
70
72
|
core: string;
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.PLAYBOOK_MIME = void 0;
|
|
8
8
|
exports.createPromptPlaybookEmbedder = createPromptPlaybookEmbedder;
|
|
9
|
-
exports.
|
|
9
|
+
exports.defineProfilePlaybooks = defineProfilePlaybooks;
|
|
10
10
|
const node_fs_1 = require("node:fs");
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
exports.PLAYBOOK_MIME = 'text/markdown';
|
|
13
13
|
const markdownCache = new Map();
|
|
14
14
|
/**
|
|
15
15
|
* Load a playbook markdown file from a directory adjacent to the compiled module.
|
|
16
|
-
* `moduleDir` should be `__dirname` of the
|
|
16
|
+
* `moduleDir` should be `__dirname` of the profile's `resources/` folder.
|
|
17
17
|
*/
|
|
18
18
|
function loadPlaybookMarkdown(moduleDir, relativePath) {
|
|
19
19
|
const key = `${moduleDir}::${relativePath}`;
|
|
@@ -21,7 +21,7 @@ function loadPlaybookMarkdown(moduleDir, relativePath) {
|
|
|
21
21
|
if (cached !== undefined) {
|
|
22
22
|
return cached;
|
|
23
23
|
}
|
|
24
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename -- moduleDir + relativePath from
|
|
24
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- moduleDir + relativePath from profile constants
|
|
25
25
|
const text = (0, node_fs_1.readFileSync)((0, node_path_1.join)(moduleDir, relativePath), 'utf8');
|
|
26
26
|
markdownCache.set(key, text);
|
|
27
27
|
return text;
|
|
@@ -56,8 +56,9 @@ function embedResource(playbook) {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Build prompt message helpers that embed core, and optionally one topic
|
|
60
|
-
* after the user text message. When `topicId` is omitted, only core is
|
|
59
|
+
* Build prompt message helpers that embed core, and optionally one or more topic
|
|
60
|
+
* playbooks, after the user text message. When `topicId` is omitted, only core is
|
|
61
|
+
* embedded.
|
|
61
62
|
*/
|
|
62
63
|
function createPromptPlaybookEmbedder(options) {
|
|
63
64
|
const { core, topics } = options;
|
|
@@ -75,35 +76,38 @@ function createPromptPlaybookEmbedder(options) {
|
|
|
75
76
|
if (topicId === undefined) {
|
|
76
77
|
return { messages };
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
const topicIds = typeof topicId === 'string' ? [topicId] : topicId;
|
|
80
|
+
for (const id of topicIds) {
|
|
81
|
+
// eslint-disable-next-line security/detect-object-injection -- topic ids from profile prompt constants
|
|
82
|
+
const topic = topics[id];
|
|
83
|
+
if (!topic) {
|
|
84
|
+
throw new Error(`Unknown playbook topic '${id}'`);
|
|
85
|
+
}
|
|
86
|
+
messages.push({
|
|
87
|
+
role: 'user',
|
|
88
|
+
content: embedResource(topic),
|
|
89
|
+
});
|
|
82
90
|
}
|
|
83
|
-
messages.push({
|
|
84
|
-
role: 'user',
|
|
85
|
-
content: embedResource(topic),
|
|
86
|
-
});
|
|
87
91
|
return { messages };
|
|
88
92
|
};
|
|
89
93
|
}
|
|
90
94
|
/** Title-case the first segment only: `content-developer` → `Content-developer`. */
|
|
91
|
-
function
|
|
92
|
-
const [first = '', ...rest] =
|
|
95
|
+
function titleCaseProfile(profileId) {
|
|
96
|
+
const [first = '', ...rest] = profileId.split('-');
|
|
93
97
|
if (first.length === 0) {
|
|
94
|
-
return
|
|
98
|
+
return profileId;
|
|
95
99
|
}
|
|
96
100
|
return [first[0].toUpperCase() + first.slice(1), ...rest].join('-');
|
|
97
101
|
}
|
|
98
102
|
/**
|
|
99
|
-
* Factory for
|
|
100
|
-
* Callers re-export the returned fields under
|
|
103
|
+
* Factory for profile multi-playbook resources (index + core + topics).
|
|
104
|
+
* Callers re-export the returned fields under profile-specific names.
|
|
101
105
|
*/
|
|
102
|
-
function
|
|
103
|
-
const {
|
|
104
|
-
const indexUri = `lightdash://playbooks/${
|
|
105
|
-
const coreUri = `lightdash://playbooks/${
|
|
106
|
-
const namePrefix =
|
|
106
|
+
function defineProfilePlaybooks(options) {
|
|
107
|
+
const { profileId, moduleDir, hardBans, topics, indexTitle = `${titleCaseProfile(profileId)} playbooks`, indexDescription = `Index of ${profileId} workflow playbooks (core + topics)`, coreTitle = `${titleCaseProfile(profileId)} core playbook`, coreDescription = 'Hard bans, tools, and operating rules', } = options;
|
|
108
|
+
const indexUri = `lightdash://playbooks/${profileId}`;
|
|
109
|
+
const coreUri = `lightdash://playbooks/${profileId}/core`;
|
|
110
|
+
const namePrefix = profileId.split('-').join('_');
|
|
107
111
|
const load = (relativePath) => loadPlaybookMarkdown(moduleDir, relativePath);
|
|
108
112
|
const getIndexPlaybookMarkdown = () => load('playbooks/index.md');
|
|
109
113
|
const getCorePlaybookMarkdown = () => load('playbooks/core.md');
|
|
@@ -111,7 +115,7 @@ function definePersonaPlaybooks(options) {
|
|
|
111
115
|
const topicPlaybooks = {};
|
|
112
116
|
const topicMarkdownGetters = [];
|
|
113
117
|
for (const topic of topics) {
|
|
114
|
-
const uri = `lightdash://playbooks/${
|
|
118
|
+
const uri = `lightdash://playbooks/${profileId}/${topic.id}`;
|
|
115
119
|
topicUris[topic.id] = uri;
|
|
116
120
|
const getMarkdown = () => load(`playbooks/${topic.file}`);
|
|
117
121
|
topicMarkdownGetters.push(getMarkdown);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization-audit profile: read-only org inventory, access, content health, schedulers.
|
|
3
|
+
*/
|
|
4
|
+
import type { ProfileDefinition } from '../../types.js';
|
|
5
|
+
export declare const ORGANIZATION_AUDIT_PROFILE_PATH: "/organization-audit/v1/mcp";
|
|
6
|
+
export declare const organizationAuditProfile: ProfileDefinition;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Organization-audit profile: read-only org inventory, access, content health, schedulers.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.organizationAuditProfile = exports.ORGANIZATION_AUDIT_PROFILE_PATH = void 0;
|
|
7
|
+
const prompts_js_1 = require("./prompts.js");
|
|
8
|
+
const playbooks_js_1 = require("./resources/playbooks.js");
|
|
9
|
+
exports.ORGANIZATION_AUDIT_PROFILE_PATH = '/organization-audit/v1/mcp';
|
|
10
|
+
exports.organizationAuditProfile = {
|
|
11
|
+
id: 'organization-audit',
|
|
12
|
+
path: exports.ORGANIZATION_AUDIT_PROFILE_PATH,
|
|
13
|
+
serverName: 'lightdash-mcp-org-audit',
|
|
14
|
+
registerPrompts: (server) => {
|
|
15
|
+
(0, prompts_js_1.registerOrganizationAuditPrompts)(server);
|
|
16
|
+
},
|
|
17
|
+
registerResources: (server) => {
|
|
18
|
+
(0, playbooks_js_1.registerOrganizationAuditPlaybook)(server);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
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: 'Bounded, evidence-backed read-only org audit via primitive lightdash_* tools (no audit_* mega-tools)',
|
|
19
|
+
argsSchema: {
|
|
20
|
+
projectUuids: zod_1.z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Comma-separated project UUIDs to deep-dive (default: up to 3 non-preview projects, or HTTP pin)'),
|
|
24
|
+
allowedEmailDomains: zod_1.z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Comma-separated internal email domains; convert to a string[] for tool args'),
|
|
28
|
+
},
|
|
29
|
+
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Perform a bounded, evidence-backed, read-only audit of the current Lightdash organization.
|
|
30
|
+
|
|
31
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
32
|
+
|
|
33
|
+
Scope inputs:
|
|
34
|
+
- Optional project filter: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(none — sample ≤3 DEFAULT non-preview projects; honor X-Lightdash-Project pin if set)'}.
|
|
35
|
+
- Allowed email domains: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none — convert to [] ; treat unknown domains carefully)'}.
|
|
36
|
+
- Split comma-separated args into arrays before calling tools.
|
|
37
|
+
|
|
38
|
+
Procedure (primitives only — there are no lightdash_audit_* tools):
|
|
39
|
+
1. Phase 0 (core): get_org_profile → list_org_projects → choose projects under budgets.
|
|
40
|
+
2. Access (access playbook): members/groups sample → per project: list_project_roles → list_project_direct_access → list_space_access → resolve_effective_access (bounded). Empty direct_access is normal with group/org grants.
|
|
41
|
+
3. Content (content playbook): per project list_content + list_validation_results + get_project_user_activity (summarize; do not dump weekly series).
|
|
42
|
+
4. Deliveries (deliveries playbook): list_project_schedulers; get_scheduler only as needed.
|
|
43
|
+
5. Phase 5 report: use the core finding template; cite tools + UUIDs; separate facts vs inferences; list budget/pagination/redaction gaps.
|
|
44
|
+
6. Never claim formal compliance certification or exhaustive inventory when pagination/budgets stopped early.`));
|
|
45
|
+
server.registerPrompt('review_access_governance', {
|
|
46
|
+
title: 'Review access governance',
|
|
47
|
+
description: 'Build a bounded effective-access picture from identity + project/space primitives',
|
|
48
|
+
argsSchema: {
|
|
49
|
+
projectUuids: zod_1.z
|
|
50
|
+
.string()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('Comma-separated project UUIDs (default: ≤3 sampled projects)'),
|
|
53
|
+
allowedEmailDomains: zod_1.z
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Comma-separated domains → string[] for tools'),
|
|
57
|
+
},
|
|
58
|
+
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Review Lightdash identity and access governance with core budgets.
|
|
59
|
+
|
|
60
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
61
|
+
|
|
62
|
+
Projects: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(sample ≤3)'}.
|
|
63
|
+
Domains: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none)'}.
|
|
64
|
+
|
|
65
|
+
Mandatory tool order per project: lightdash_list_project_roles → lightdash_list_project_direct_access → lightdash_list_space_access → lightdash_resolve_effective_access.
|
|
66
|
+
Also use lightdash_list_org_members, lightdash_list_org_groups, lightdash_list_org_role_assignments, lightdash_list_custom_roles as needed.
|
|
67
|
+
Empty direct_access ≠ no access. Truncation / INCOMPLETE_EFFECTIVE_ACCESS warnings must appear in the report.`, 'access'));
|
|
68
|
+
server.registerPrompt('review_content_governance', {
|
|
69
|
+
title: 'Review content governance',
|
|
70
|
+
description: 'Inventory content health via list_content, validation, and user-activity evidence',
|
|
71
|
+
argsSchema: {
|
|
72
|
+
projectUuids: zod_1.z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('Comma-separated project UUIDs (required for useful inventory; else sample ≤3)'),
|
|
76
|
+
},
|
|
77
|
+
}, ({ projectUuids }) => userMessages(`Inventory charts, dashboards, and spaces; evaluate validation, ownership, and usage.
|
|
78
|
+
|
|
79
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
80
|
+
|
|
81
|
+
Projects: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(sample ≤3; always pass projectUuids into list_content)'}.
|
|
82
|
+
|
|
83
|
+
Use lightdash_list_content (sortBy views or last_updated_at), lightdash_list_validation_results, and lightdash_get_project_user_activity (summarize role counts + top views only). Optional lightdash_get_dashboard_meta.
|
|
84
|
+
Join in the conversation — no server-side audit crawler. Do not recommend deletion for low/zero views.`, 'content'));
|
|
85
|
+
server.registerPrompt('review_scheduled_deliveries', {
|
|
86
|
+
title: 'Review scheduled deliveries',
|
|
87
|
+
description: 'Inspect schedulers without executing or mutating them',
|
|
88
|
+
argsSchema: {
|
|
89
|
+
projectUuids: zod_1.z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Comma-separated project UUIDs (default: ≤3 sampled)'),
|
|
93
|
+
allowedEmailDomains: zod_1.z.string().optional().describe('Comma-separated domains → string[]'),
|
|
94
|
+
},
|
|
95
|
+
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Inspect scheduled deliveries without creating, editing, executing, enabling, disabling, or deleting schedules.
|
|
96
|
+
|
|
97
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
98
|
+
|
|
99
|
+
Projects: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(sample ≤3)'}.
|
|
100
|
+
Allowed email domains: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none)'}.
|
|
101
|
+
|
|
102
|
+
Use lightdash_list_project_schedulers (destinations redacted by default) and lightdash_get_scheduler when needed.
|
|
103
|
+
Report enabled and disabled schedules. External destinations (if revealed) are review signals, not automatic violations.`, 'deliveries'));
|
|
104
|
+
server.registerPrompt('investigate_audit_finding', {
|
|
105
|
+
title: 'Investigate audit finding',
|
|
106
|
+
description: 'Validate or refute one previously reported finding with minimum extra metadata',
|
|
107
|
+
argsSchema: {
|
|
108
|
+
findingSummary: zod_1.z.string().describe('The finding claim to investigate'),
|
|
109
|
+
projectUuid: zod_1.z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('Project UUID when the finding is project-scoped'),
|
|
113
|
+
},
|
|
114
|
+
}, ({ findingSummary, projectUuid }) => userMessages(`Investigate this organization-audit finding with minimum additional metadata:
|
|
115
|
+
|
|
116
|
+
${findingSummary}
|
|
117
|
+
|
|
118
|
+
Project context: ${projectUuid !== null && projectUuid !== void 0 ? projectUuid : '(org-level or unspecified — ask only if needed)'}.
|
|
119
|
+
|
|
120
|
+
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
121
|
+
|
|
122
|
+
Use only primitive list/get tools under core budgets. Report supporting evidence, contradictory evidence, remaining uncertainty, and whether severity/confidence changed. Prefer targeted get_* / single-project lists over org-wide crawls.`));
|
|
123
|
+
}
|
|
124
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Organization-audit prompt/playbook invariants.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const common_1 = require("@lightdash-tools/common");
|
|
6
7
|
const vitest_1 = require("vitest");
|
|
7
8
|
const playbooks_js_1 = require("./resources/playbooks.js");
|
|
8
|
-
const index_js_1 = require("./index.js");
|
|
9
9
|
(0, vitest_1.describe)('organization-audit prompts/playbook', () => {
|
|
10
10
|
(0, vitest_1.it)('playbook references only registered tool short ids', () => {
|
|
11
11
|
const md = (0, playbooks_js_1.getAllPlaybookMarkdown)();
|
|
12
|
-
for (const id of
|
|
12
|
+
for (const id of (0, common_1.listMcpToolNamesByProfile)('organization-audit')) {
|
|
13
13
|
(0, vitest_1.expect)(md.includes(id) || md.includes(`lightdash_${id}`)).toBe(true);
|
|
14
14
|
}
|
|
15
15
|
(0, vitest_1.expect)(md).not.toMatch(/\bldt__/);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Organization-audit — access governance
|
|
2
|
+
|
|
3
|
+
URI: `lightdash://playbooks/organization-audit/access`
|
|
4
|
+
|
|
5
|
+
## Phase 1 — Identity
|
|
6
|
+
|
|
7
|
+
1. `lightdash_list_org_members` with budgets from core (`pageSize=50`, ≤3 pages). Note `pagination.totalResults` when present (large orgs are normal).
|
|
8
|
+
2. Emails are **redacted by default**. Pass `includeEmail=true` only when the user needs full addresses. Use `allowedEmailDomains` so `isExternalDomain` classification is meaningful while redacted.
|
|
9
|
+
3. Optionally `lightdash_list_org_groups` (≤2 pages). Prefer group **names/UUIDs** over expanding every member unless investigating one group.
|
|
10
|
+
4. `lightdash_list_org_role_assignments` and `lightdash_list_custom_roles` for org-level / role catalog context. Use `lightdash_get_custom_role` / `lightdash_get_org_member` for spot checks only.
|
|
11
|
+
|
|
12
|
+
## Phase 2 — Projects and access (per sampled project)
|
|
13
|
+
|
|
14
|
+
Run in this order — **group project roles matter more than empty direct grants**:
|
|
15
|
+
|
|
16
|
+
1. **`lightdash_list_project_roles`** (v2 assignments: users **and** groups). This is usually the primary project ACL signal.
|
|
17
|
+
2. **`lightdash_list_project_direct_access`** — returns **explicit user grants only** (`accessSemantics: direct_only`). **Empty data is expected** when everyone reaches the project via org admin or groups. Always surface the `INCOMPLETE_EFFECTIVE_ACCESS` warning; never conclude “nobody has access” from an empty list.
|
|
18
|
+
3. **`lightdash_list_space_access`** — composed space list/get; includes inheritance (`inheritedFrom`: organization / group / parent_space). Nested spaces can explode row counts; summarize by space UUID + notable direct grants.
|
|
19
|
+
4. **`lightdash_resolve_effective_access`** — best-effort composition. With only `projectUuid`, results may still be org-role heavy and hit `maxPrincipals` truncation (`TRUNCATED`). Prefer it to **cross-check** a principal or space (`spaceUuid`), not as a full dump of the org.
|
|
20
|
+
|
|
21
|
+
State assumptions: role precedence across conflicting paths is **not** invented by the server; honor `complete=false` on individual principal rows and envelope warnings.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Organization-audit — content and health
|
|
2
|
+
|
|
3
|
+
URI: `lightdash://playbooks/organization-audit/content`
|
|
4
|
+
|
|
5
|
+
## Phase 3 — Content and health (per sampled project)
|
|
6
|
+
|
|
7
|
+
Always pass **`projectUuids: [that project]`** (do not run org-wide content without an explicit ask).
|
|
8
|
+
|
|
9
|
+
1. **`lightdash_list_content`**
|
|
10
|
+
- Prefer two passes when useful: `contentTypes: ["dashboard"]` and `["chart"]` (spaces optional).
|
|
11
|
+
- Sort intentionally: `sortBy=views` + `sortDirection=desc` for popularity; `sortBy=last_updated_at` for staleness.
|
|
12
|
+
- Stay within core page budgets. Record `source` (`dbt_explore` vs `sql`) when relevant.
|
|
13
|
+
2. **`lightdash_list_validation_results`** — empty list means no current validation failures observed, not “perfect catalog forever”.
|
|
14
|
+
3. **`lightdash_get_project_user_activity`** — treat as **activity evidence**, not an unused-content API (`V1_FALLBACK` / `usageSemantics: activity_evidence`).
|
|
15
|
+
- **Summarize** for the report: `numberUsers` / role counts, `numberWeeklyQueryingUsers`, top `dashboardViews` / `chartViews`, `userMostViewedDashboards`.
|
|
16
|
+
- **Do not** paste entire `chartWeeklyQueryingUsers` / `chartWeeklyAverageQueries` series into the user reply.
|
|
17
|
+
4. **`lightdash_get_dashboard_meta`** only when you need dashboard structure without executing tiles.
|
|
18
|
+
|
|
19
|
+
Host-join validation + views + ownership into findings. **Zero or low views ⇒ review signal only — never a deletion recommendation.**
|