@lightdash-tools/mcp 0.8.0 → 0.9.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 +108 -237
- package/dist/audit/server-persona.d.ts +10 -0
- package/dist/audit/server-persona.js +19 -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 +0 -2
- package/dist/auth/resource-server/lightdash-oauth-middleware.js +0 -19
- package/dist/auth/resource-server/www-authenticate.test.js +0 -2
- package/dist/bin.js +9 -2
- package/dist/config/env.d.ts +5 -15
- package/dist/config/env.js +6 -16
- package/dist/config/load-mcp-config.d.ts +0 -4
- package/dist/config/load-mcp-config.js +8 -9
- package/dist/config/normalize-url.test.js +14 -11
- 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/client-capabilities-cache.d.ts +44 -0
- package/dist/governance/client-capabilities-cache.js +142 -0
- package/dist/governance/client-capabilities-cache.test.js +148 -0
- package/dist/governance/mcp-client-session.d.ts +3 -2
- package/dist/governance/mcp-client-session.js +3 -2
- 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 +117 -262
- package/dist/http.test.js +0 -12
- package/dist/index.integration.test.js +0 -4
- package/dist/index.js +3 -1
- package/dist/personas/ai-agent-ops/v1/index.d.ts +8 -0
- package/dist/personas/ai-agent-ops/v1/index.js +41 -0
- package/dist/personas/ai-agent-ops/v1/prompts.d.ts +5 -0
- package/dist/personas/ai-agent-ops/v1/prompts.js +141 -0
- package/dist/personas/ai-agent-ops/v1/prompts.test.d.ts +4 -0
- package/dist/personas/ai-agent-ops/v1/prompts.test.js +26 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks/core.md +39 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks/evaluation.md +25 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks/index.md +14 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks/loop-engineering.md +28 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks/release-gate.md +22 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks.d.ts +10 -0
- package/dist/personas/ai-agent-ops/v1/resources/playbooks.js +41 -0
- package/dist/personas/content-developer/v1/index.d.ts +1 -1
- package/dist/personas/content-developer/v1/index.js +1 -0
- package/dist/personas/content-developer/v1/prompts.d.ts +3 -0
- package/dist/personas/content-developer/v1/prompts.js +80 -61
- package/dist/personas/content-developer/v1/prompts.test.js +159 -3
- package/dist/personas/content-developer/v1/resources/playbooks/chart-types.md +123 -0
- package/dist/personas/content-developer/v1/resources/playbooks/content-move.md +13 -6
- package/dist/personas/content-developer/v1/resources/playbooks/core.md +91 -49
- package/dist/personas/content-developer/v1/resources/playbooks/dashboard-design.md +153 -0
- package/dist/personas/content-developer/v1/resources/playbooks/dashboards.md +82 -34
- package/dist/personas/content-developer/v1/resources/playbooks/index.md +9 -7
- package/dist/personas/content-developer/v1/resources/playbooks.d.ts +1 -1
- package/dist/personas/content-developer/v1/resources/playbooks.js +29 -10
- package/dist/personas/content-governance/v1/resources/playbooks/core.md +1 -1
- package/dist/personas/content-governance/v1/resources/playbooks/dashboards.md +1 -1
- package/dist/personas/content-reader/v1/index.d.ts +1 -1
- package/dist/personas/content-reader/v1/index.js +1 -0
- package/dist/personas/content-reader/v1/prompts.js +64 -30
- package/dist/personas/content-reader/v1/resources/playbooks/compare.md +24 -9
- package/dist/personas/content-reader/v1/resources/playbooks/core.md +56 -29
- package/dist/personas/content-reader/v1/resources/playbooks/discover.md +27 -5
- package/dist/personas/content-reader/v1/resources/playbooks/explain-run.md +38 -8
- package/dist/personas/content-reader/v1/resources/playbooks/index.md +8 -8
- package/dist/personas/content-reader/v1/resources/playbooks.js +2 -2
- package/dist/personas/index.d.ts +1 -0
- package/dist/personas/index.js +27 -22
- package/dist/personas/index.test.js +68 -53
- package/dist/personas/lib/playbook-resources.d.ts +4 -3
- package/dist/personas/lib/playbook-resources.js +14 -10
- package/dist/personas/organization-audit/v1/prompts.js +68 -36
- package/dist/personas/organization-audit/v1/resources/playbooks/access.md +12 -4
- package/dist/personas/organization-audit/v1/resources/playbooks/content.md +13 -3
- package/dist/personas/organization-audit/v1/resources/playbooks/core.md +49 -16
- package/dist/personas/organization-audit/v1/resources/playbooks/deliveries.md +8 -3
- package/dist/personas/organization-audit/v1/resources/playbooks/index.md +8 -8
- package/dist/personas/organization-audit/v1/resources/playbooks.js +1 -1
- package/dist/personas/persona.parity.test.js +14 -10
- package/dist/personas/semantic-layer/v1/prompts.js +50 -39
- package/dist/personas/semantic-layer/v1/resources/playbooks/compose-compile.md +36 -31
- package/dist/personas/semantic-layer/v1/resources/playbooks/core.md +53 -21
- package/dist/personas/semantic-layer/v1/resources/playbooks/explore.md +42 -39
- package/dist/personas/semantic-layer/v1/resources/playbooks/index.md +6 -6
- package/dist/personas/semantic-layer/v1/resources/playbooks.js +2 -2
- package/dist/personas/types.d.ts +1 -1
- 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 +5 -1
- package/dist/policy/content-reader.js +18 -3
- package/dist/policy/content-reader.test.js +2 -1
- 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/server/capabilities.js +2 -0
- package/dist/server/capabilities.test.js +2 -0
- package/dist/server/server.js +12 -8
- 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 +4 -2
- 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.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 +64 -0
- package/dist/tools/ai-agents/helpers.js +323 -0
- package/dist/tools/ai-agents/threads.d.ts +7 -0
- package/dist/tools/ai-agents/threads.js +40 -0
- 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 +2 -1
- package/dist/tools/project/developer-content-preview.js +40 -35
- package/dist/tools/project/developer-content-shared.d.ts +8 -2
- package/dist/tools/project/developer-content-shared.js +7 -3
- 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.js +5 -3
- package/dist/tools/project/projects.js +6 -4
- package/dist/tools/project/projects.test.js +44 -5
- 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/query/bounded-saved-query.js +1 -1
- package/dist/tools/query/lifecycle.d.ts +1 -1
- package/dist/tools/query/lifecycle.js +17 -25
- package/dist/tools/query/query-ledger.d.ts +15 -8
- 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.js +4 -6
- package/dist/tools/query/reader-tool-helpers.test.js +8 -4
- package/dist/tools/registry.d.ts +63 -0
- package/dist/tools/registry.js +26 -0
- package/dist/tools/shared.d.ts +27 -8
- package/dist/tools/shared.js +61 -28
- package/dist/tools/shared.test.js +100 -4
- package/dist/transports/streamable-http.js +48 -206
- package/dist/transports/streamable-http.test.js +10 -3
- 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/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.d.ts +0 -1
- 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.d.ts +0 -1
- package/dist/transports/session-store.test.js +0 -111
- /package/dist/{destructive/confirmation-claim.test.d.ts → governance/client-capabilities-cache.test.d.ts} +0 -0
- /package/dist/{store/config.test.d.ts → server/upstream-errors.test.d.ts} +0 -0
- /package/dist/{store/redis-oauth-broker-store.test.d.ts → tools/ai-agents/agents.test.d.ts} +0 -0
|
@@ -3,84 +3,98 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
4
|
const registry_js_1 = require("../tools/registry.js");
|
|
5
5
|
const shared_js_1 = require("../tools/shared.js");
|
|
6
|
-
const index_js_1 = require("./
|
|
7
|
-
const index_js_2 = require("./content-
|
|
8
|
-
const index_js_3 = require("./content-
|
|
9
|
-
const index_js_4 = require("./
|
|
10
|
-
const index_js_5 = require("./index.js");
|
|
6
|
+
const index_js_1 = require("./ai-agent-ops/v1/index.js");
|
|
7
|
+
const index_js_2 = require("./content-developer/v1/index.js");
|
|
8
|
+
const index_js_3 = require("./content-governance/v1/index.js");
|
|
9
|
+
const index_js_4 = require("./content-reader/v1/index.js");
|
|
10
|
+
const index_js_5 = require("./organization-audit/v1/index.js");
|
|
11
|
+
const index_js_6 = require("./index.js");
|
|
11
12
|
(0, vitest_1.describe)('personas', () => {
|
|
12
|
-
(0, vitest_1.it)('ships
|
|
13
|
-
var _a, _b, _c, _d, _e;
|
|
14
|
-
(0, vitest_1.expect)(Object.keys(
|
|
13
|
+
(0, vitest_1.it)('ships six personas with fixed paths', () => {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
(0, vitest_1.expect)(Object.keys(index_js_6.PERSONAS).sort()).toEqual([
|
|
16
|
+
'ai-agent-ops',
|
|
15
17
|
'content-developer',
|
|
16
18
|
'content-governance',
|
|
17
19
|
'content-reader',
|
|
18
20
|
'organization-audit',
|
|
19
21
|
'semantic-layer',
|
|
20
22
|
]);
|
|
21
|
-
(0, vitest_1.expect)(
|
|
22
|
-
(0, vitest_1.expect)((0,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
(0, vitest_1.expect)(index_js_6.DEFAULT_PERSONA_ID).toBe('semantic-layer');
|
|
24
|
+
(0, vitest_1.expect)((0, index_js_6.listPersonaPaths)().sort()).toEqual([
|
|
25
|
+
index_js_6.AI_AGENT_OPS_PERSONA_PATH,
|
|
26
|
+
index_js_6.CONTENT_DEVELOPER_PERSONA_PATH,
|
|
27
|
+
index_js_6.CONTENT_GOVERNANCE_PERSONA_PATH,
|
|
28
|
+
index_js_6.CONTENT_READER_PERSONA_PATH,
|
|
29
|
+
index_js_6.ORGANIZATION_AUDIT_PERSONA_PATH,
|
|
30
|
+
index_js_6.SEMANTIC_LAYER_PERSONA_PATH,
|
|
28
31
|
].sort());
|
|
29
|
-
(0, vitest_1.expect)((_a = (0,
|
|
30
|
-
(0, vitest_1.expect)((_b = (0,
|
|
31
|
-
(0, vitest_1.expect)((_c = (0,
|
|
32
|
-
(0, vitest_1.expect)((_d = (0,
|
|
33
|
-
(0, vitest_1.expect)((_e = (0,
|
|
34
|
-
(0, vitest_1.expect)((0,
|
|
32
|
+
(0, vitest_1.expect)((_a = (0, index_js_6.getPersonaByPath)(index_js_6.SEMANTIC_LAYER_PERSONA_PATH)) === null || _a === void 0 ? void 0 : _a.id).toBe('semantic-layer');
|
|
33
|
+
(0, vitest_1.expect)((_b = (0, index_js_6.getPersonaByPath)(index_js_6.ORGANIZATION_AUDIT_PERSONA_PATH)) === null || _b === void 0 ? void 0 : _b.id).toBe('organization-audit');
|
|
34
|
+
(0, vitest_1.expect)((_c = (0, index_js_6.getPersonaByPath)(index_js_6.CONTENT_READER_PERSONA_PATH)) === null || _c === void 0 ? void 0 : _c.id).toBe('content-reader');
|
|
35
|
+
(0, vitest_1.expect)((_d = (0, index_js_6.getPersonaByPath)(index_js_6.CONTENT_DEVELOPER_PERSONA_PATH)) === null || _d === void 0 ? void 0 : _d.id).toBe('content-developer');
|
|
36
|
+
(0, vitest_1.expect)((_e = (0, index_js_6.getPersonaByPath)(index_js_6.CONTENT_GOVERNANCE_PERSONA_PATH)) === null || _e === void 0 ? void 0 : _e.id).toBe('content-governance');
|
|
37
|
+
(0, vitest_1.expect)((_f = (0, index_js_6.getPersonaByPath)(index_js_6.AI_AGENT_OPS_PERSONA_PATH)) === null || _f === void 0 ? void 0 : _f.id).toBe('ai-agent-ops');
|
|
38
|
+
(0, vitest_1.expect)((0, index_js_6.getPersonaByPath)('/mcp')).toBeUndefined();
|
|
35
39
|
});
|
|
36
40
|
(0, vitest_1.it)('normalizes trailing slashes when resolving path', () => {
|
|
37
|
-
var _a, _b, _c, _d, _e;
|
|
38
|
-
(0, vitest_1.expect)((_a = (0,
|
|
39
|
-
(0, vitest_1.expect)((_b = (0,
|
|
40
|
-
(0, vitest_1.expect)((_c = (0,
|
|
41
|
-
(0, vitest_1.expect)((_d = (0,
|
|
42
|
-
(0, vitest_1.expect)((_e = (0,
|
|
41
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42
|
+
(0, vitest_1.expect)((_a = (0, index_js_6.getPersonaByPath)(`${index_js_6.SEMANTIC_LAYER_PERSONA_PATH}/`)) === null || _a === void 0 ? void 0 : _a.id).toBe('semantic-layer');
|
|
43
|
+
(0, vitest_1.expect)((_b = (0, index_js_6.getPersonaByPath)(`${index_js_6.ORGANIZATION_AUDIT_PERSONA_PATH}/`)) === null || _b === void 0 ? void 0 : _b.id).toBe('organization-audit');
|
|
44
|
+
(0, vitest_1.expect)((_c = (0, index_js_6.getPersonaByPath)(`${index_js_6.CONTENT_READER_PERSONA_PATH}/`)) === null || _c === void 0 ? void 0 : _c.id).toBe('content-reader');
|
|
45
|
+
(0, vitest_1.expect)((_d = (0, index_js_6.getPersonaByPath)(`${index_js_6.CONTENT_DEVELOPER_PERSONA_PATH}/`)) === null || _d === void 0 ? void 0 : _d.id).toBe('content-developer');
|
|
46
|
+
(0, vitest_1.expect)((_e = (0, index_js_6.getPersonaByPath)(`${index_js_6.CONTENT_GOVERNANCE_PERSONA_PATH}/`)) === null || _e === void 0 ? void 0 : _e.id).toBe('content-governance');
|
|
47
|
+
(0, vitest_1.expect)((_f = (0, index_js_6.getPersonaByPath)(`${index_js_6.AI_AGENT_OPS_PERSONA_PATH}/`)) === null || _f === void 0 ? void 0 : _f.id).toBe('ai-agent-ops');
|
|
43
48
|
});
|
|
44
49
|
(0, vitest_1.it)('semantic-layer allowlists exactly nine tools', () => {
|
|
45
|
-
const persona = (0,
|
|
50
|
+
const persona = (0, index_js_6.getPersona)('semantic-layer');
|
|
46
51
|
(0, vitest_1.expect)(persona.toolIds).toHaveLength(9);
|
|
47
|
-
(0, vitest_1.expect)((0,
|
|
52
|
+
(0, vitest_1.expect)((0, index_js_6.getDefaultPersona)().toolIds).toEqual(persona.toolIds);
|
|
48
53
|
});
|
|
49
54
|
(0, vitest_1.it)('organization-audit allowlists 18 tools and short server name', () => {
|
|
50
|
-
const persona = (0,
|
|
55
|
+
const persona = (0, index_js_6.getPersona)('organization-audit');
|
|
51
56
|
(0, vitest_1.expect)(persona.toolIds).toHaveLength(18);
|
|
52
|
-
(0, vitest_1.expect)(persona.toolIds).toEqual([...
|
|
53
|
-
(0, vitest_1.expect)((0,
|
|
57
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_5.ORGANIZATION_AUDIT_TOOL_IDS]);
|
|
58
|
+
(0, vitest_1.expect)((0, index_js_6.getPersonaServerName)(persona)).toBe('lightdash-mcp-org-audit');
|
|
54
59
|
});
|
|
55
|
-
(0, vitest_1.it)('content-reader allowlists
|
|
56
|
-
const persona = (0,
|
|
57
|
-
(0, vitest_1.expect)(persona.toolIds).toHaveLength(
|
|
58
|
-
(0, vitest_1.expect)(persona.toolIds).toEqual([...
|
|
59
|
-
(0, vitest_1.expect)(
|
|
60
|
+
(0, vitest_1.it)('content-reader allowlists 14 tools and server name', () => {
|
|
61
|
+
const persona = (0, index_js_6.getPersona)('content-reader');
|
|
62
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(14);
|
|
63
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_4.CONTENT_READER_TOOL_IDS]);
|
|
64
|
+
(0, vitest_1.expect)(persona.toolIds).toContain('export_chart_image');
|
|
65
|
+
(0, vitest_1.expect)((0, index_js_6.getPersonaServerName)(persona)).toBe('lightdash-mcp-content');
|
|
60
66
|
});
|
|
61
|
-
(0, vitest_1.it)('content-developer allowlists
|
|
62
|
-
const persona = (0,
|
|
63
|
-
(0, vitest_1.expect)(persona.toolIds).
|
|
64
|
-
(0, vitest_1.expect)(persona.toolIds).
|
|
67
|
+
(0, vitest_1.it)('content-developer allowlists tools and short server name', () => {
|
|
68
|
+
const persona = (0, index_js_6.getPersona)('content-developer');
|
|
69
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_2.CONTENT_DEVELOPER_TOOL_IDS]);
|
|
70
|
+
(0, vitest_1.expect)(persona.toolIds).toContain('get_chart_as_code');
|
|
65
71
|
(0, vitest_1.expect)(persona.toolIds).not.toContain('create_space');
|
|
66
72
|
(0, vitest_1.expect)(persona.toolIds).not.toContain('update_space');
|
|
67
|
-
(0, vitest_1.expect)((0,
|
|
73
|
+
(0, vitest_1.expect)((0, index_js_6.getPersonaServerName)(persona)).toBe('lightdash-mcp-cdev');
|
|
68
74
|
});
|
|
69
75
|
(0, vitest_1.it)('content-governance allowlists soft-delete + promote tools and short server name', () => {
|
|
70
|
-
const persona = (0,
|
|
76
|
+
const persona = (0, index_js_6.getPersona)('content-governance');
|
|
71
77
|
(0, vitest_1.expect)(persona.toolIds).toHaveLength(4);
|
|
72
|
-
(0, vitest_1.expect)(persona.toolIds).toEqual([...
|
|
78
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_3.CONTENT_GOVERNANCE_TOOL_IDS]);
|
|
73
79
|
(0, vitest_1.expect)(persona.toolIds).toEqual([
|
|
74
80
|
'delete_chart',
|
|
75
81
|
'delete_dashboard',
|
|
76
82
|
'get_dashboard_promote_diff',
|
|
77
83
|
'promote_dashboard',
|
|
78
84
|
]);
|
|
79
|
-
(0, vitest_1.expect)((0,
|
|
85
|
+
(0, vitest_1.expect)((0, index_js_6.getPersonaServerName)(persona)).toBe('lightdash-mcp-gov');
|
|
86
|
+
});
|
|
87
|
+
(0, vitest_1.it)('ai-agent-ops allowlists 17 thin API tools and short server name', () => {
|
|
88
|
+
const persona = (0, index_js_6.getPersona)('ai-agent-ops');
|
|
89
|
+
(0, vitest_1.expect)(persona.toolIds).toHaveLength(17);
|
|
90
|
+
(0, vitest_1.expect)(persona.toolIds).toEqual([...index_js_1.AI_AGENT_OPS_TOOL_IDS]);
|
|
91
|
+
(0, vitest_1.expect)(persona.toolIds).not.toContain('create_project_agent');
|
|
92
|
+
(0, vitest_1.expect)(persona.toolIds).not.toContain('generate_agent_message');
|
|
93
|
+
(0, vitest_1.expect)((0, index_js_6.getPersonaServerName)(persona)).toBe('lightdash-mcp-aops');
|
|
80
94
|
});
|
|
81
95
|
(0, vitest_1.it)('keeps combined server+tool wire names under 60 characters', () => {
|
|
82
|
-
for (const persona of Object.values(
|
|
83
|
-
const serverName = (0,
|
|
96
|
+
for (const persona of Object.values(index_js_6.PERSONAS)) {
|
|
97
|
+
const serverName = (0, index_js_6.getPersonaServerName)(persona);
|
|
84
98
|
for (const id of persona.toolIds) {
|
|
85
99
|
const combined = serverName.length + (shared_js_1.TOOL_PREFIX + id).length;
|
|
86
100
|
(0, vitest_1.expect)(combined, `${serverName}+${shared_js_1.TOOL_PREFIX}${id}`).toBeLessThanOrEqual(60);
|
|
@@ -88,12 +102,13 @@ const index_js_5 = require("./index.js");
|
|
|
88
102
|
}
|
|
89
103
|
});
|
|
90
104
|
(0, vitest_1.it)('parsePersonaId validates known ids only', () => {
|
|
91
|
-
(0, vitest_1.expect)((0,
|
|
92
|
-
(0, vitest_1.expect)((0,
|
|
93
|
-
(0, vitest_1.expect)((0,
|
|
94
|
-
(0, vitest_1.expect)((0,
|
|
95
|
-
(0, vitest_1.expect)((0,
|
|
96
|
-
(0, vitest_1.expect)((0,
|
|
105
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('semantic-layer')).toBe('semantic-layer');
|
|
106
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('organization-audit')).toBe('organization-audit');
|
|
107
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('content-reader')).toBe('content-reader');
|
|
108
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('content-developer')).toBe('content-developer');
|
|
109
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('content-governance')).toBe('content-governance');
|
|
110
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('ai-agent-ops')).toBe('ai-agent-ops');
|
|
111
|
+
(0, vitest_1.expect)((0, index_js_6.parsePersonaId)('nope')).toBeUndefined();
|
|
97
112
|
});
|
|
98
113
|
(0, vitest_1.it)('registerToolsByIds registers only allowlisted ids', () => {
|
|
99
114
|
const registered = [];
|
|
@@ -34,13 +34,14 @@ type PromptUserMessage = {
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
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
|
|
37
|
+
* Build prompt message helpers that embed core, and optionally one or more topic
|
|
38
|
+
* playbooks, after the user text message. When `topicId` is omitted, only core is
|
|
39
|
+
* embedded.
|
|
39
40
|
*/
|
|
40
41
|
export declare function createPromptPlaybookEmbedder<TopicId extends string>(options: {
|
|
41
42
|
core: EmbeddedPlaybook;
|
|
42
43
|
topics: Readonly<Record<TopicId, EmbeddedPlaybook>>;
|
|
43
|
-
}): (text: string, topicId?: TopicId) => {
|
|
44
|
+
}): (text: string, topicId?: TopicId | readonly TopicId[]) => {
|
|
44
45
|
messages: PromptUserMessage[];
|
|
45
46
|
};
|
|
46
47
|
export type PersonaPlaybookTopicDef<TopicId extends string = string> = {
|
|
@@ -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,15 +76,18 @@ 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 persona 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
|
}
|
|
@@ -15,78 +15,110 @@ const userMessages = (0, playbook_resources_js_1.createPromptPlaybookEmbedder)({
|
|
|
15
15
|
function registerOrganizationAuditPrompts(server) {
|
|
16
16
|
server.registerPrompt('audit_organization', {
|
|
17
17
|
title: 'Audit organization',
|
|
18
|
-
description: '
|
|
18
|
+
description: 'Bounded, evidence-backed read-only org audit via primitive lightdash_* tools (no audit_* mega-tools)',
|
|
19
19
|
argsSchema: {
|
|
20
|
-
projectUuids: zod_1.z
|
|
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)'),
|
|
21
24
|
allowedEmailDomains: zod_1.z
|
|
22
25
|
.string()
|
|
23
26
|
.optional()
|
|
24
|
-
.describe('Comma-separated
|
|
27
|
+
.describe('Comma-separated internal email domains; convert to a string[] for tool args'),
|
|
25
28
|
},
|
|
26
|
-
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Perform
|
|
29
|
+
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Perform a bounded, evidence-backed, read-only audit of the current Lightdash organization.
|
|
27
30
|
|
|
28
31
|
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
29
32
|
|
|
30
|
-
Scope:
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
- Allowed email domains for delivery review: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none — treat unknown domains carefully)'}.
|
|
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.
|
|
35
37
|
|
|
36
38
|
Procedure (primitives only — there are no lightdash_audit_* tools):
|
|
37
|
-
1.
|
|
38
|
-
2.
|
|
39
|
-
3.
|
|
40
|
-
4.
|
|
41
|
-
5.
|
|
42
|
-
6.
|
|
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.`));
|
|
43
45
|
server.registerPrompt('review_access_governance', {
|
|
44
46
|
title: 'Review access governance',
|
|
45
|
-
description: 'Build
|
|
46
|
-
argsSchema: {
|
|
47
|
-
|
|
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.
|
|
48
59
|
|
|
49
60
|
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
50
61
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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'));
|
|
54
68
|
server.registerPrompt('review_content_governance', {
|
|
55
69
|
title: 'Review content governance',
|
|
56
|
-
description: 'Inventory content health
|
|
57
|
-
argsSchema: {
|
|
58
|
-
|
|
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.
|
|
59
78
|
|
|
60
79
|
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
61
80
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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'));
|
|
65
85
|
server.registerPrompt('review_scheduled_deliveries', {
|
|
66
86
|
title: 'Review scheduled deliveries',
|
|
67
|
-
description: 'Inspect schedulers without executing them',
|
|
87
|
+
description: 'Inspect schedulers without executing or mutating them',
|
|
68
88
|
argsSchema: {
|
|
69
|
-
|
|
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[]'),
|
|
70
94
|
},
|
|
71
|
-
}, ({ allowedEmailDomains }) => userMessages(`Inspect scheduled deliveries without creating, editing, executing, enabling, disabling, or deleting schedules.
|
|
95
|
+
}, ({ projectUuids, allowedEmailDomains }) => userMessages(`Inspect scheduled deliveries without creating, editing, executing, enabling, disabling, or deleting schedules.
|
|
72
96
|
|
|
73
97
|
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
74
98
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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'));
|
|
78
104
|
server.registerPrompt('investigate_audit_finding', {
|
|
79
105
|
title: 'Investigate audit finding',
|
|
80
|
-
description: 'Validate or refute one previously reported finding',
|
|
106
|
+
description: 'Validate or refute one previously reported finding with minimum extra metadata',
|
|
81
107
|
argsSchema: {
|
|
82
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'),
|
|
83
113
|
},
|
|
84
|
-
}, ({ findingSummary }) => userMessages(`Investigate this organization-audit finding with minimum additional metadata:
|
|
114
|
+
}, ({ findingSummary, projectUuid }) => userMessages(`Investigate this organization-audit finding with minimum additional metadata:
|
|
85
115
|
|
|
86
116
|
${findingSummary}
|
|
87
117
|
|
|
118
|
+
Project context: ${projectUuid !== null && projectUuid !== void 0 ? projectUuid : '(org-level or unspecified — ask only if needed)'}.
|
|
119
|
+
|
|
88
120
|
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
89
121
|
|
|
90
|
-
Use only primitive list/get tools. Report supporting evidence, contradictory evidence, remaining uncertainty, and whether severity/confidence changed.`));
|
|
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.`));
|
|
91
123
|
}
|
|
92
124
|
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
@@ -4,10 +4,18 @@ URI: `lightdash://playbooks/organization-audit/access`
|
|
|
4
4
|
|
|
5
5
|
## Phase 1 — Identity
|
|
6
6
|
|
|
7
|
-
|
|
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.
|
|
8
11
|
|
|
9
|
-
## Phase 2 — Projects and access
|
|
12
|
+
## Phase 2 — Projects and access (per sampled project)
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
Run in this order — **group project roles matter more than empty direct grants**:
|
|
12
15
|
|
|
13
|
-
|
|
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.
|
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
URI: `lightdash://playbooks/organization-audit/content`
|
|
4
4
|
|
|
5
|
-
## Phase 3 — Content and health
|
|
5
|
+
## Phase 3 — Content and health (per sampled project)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Always pass **`projectUuids: [that project]`** (do not run org-wide content without an explicit ask).
|
|
8
8
|
|
|
9
|
-
|
|
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.**
|
|
@@ -2,35 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
URI: `lightdash://playbooks/organization-audit/core`
|
|
4
4
|
|
|
5
|
-
Read-only evidence collection for Lightdash organization administrators. Findings are review signals synthesized by the host from primitive tool results — not compliance certifications. There are no composed `audit_*` MCP tools; chain bounded `lightdash_*` reads instead.
|
|
6
|
-
|
|
7
5
|
## Hard bans
|
|
8
6
|
|
|
9
7
|
- Do not mutate users, groups, roles, spaces, content, or schedulers.
|
|
10
8
|
- Do not execute warehouse, SQL, chart, or underlying-data queries.
|
|
11
9
|
- Do not download user-activity CSV (`POST .../download`).
|
|
12
|
-
- Do not treat direct
|
|
13
|
-
- Do not recommend deletion solely because content has low
|
|
14
|
-
- Do not claim SOC 2 / GDPR / ISO / HIPAA certification from these tools.
|
|
15
|
-
- Do not crawl the whole org in one
|
|
16
|
-
- Do not request warehouse/dbt
|
|
10
|
+
- Do not treat `list_project_direct_access` as complete effective access (it is **direct grants only**; empty is common when access is via org role or groups).
|
|
11
|
+
- Do not recommend deletion solely because content has low or zero views.
|
|
12
|
+
- Do not claim SOC 2 / GDPR / ISO / HIPAA (or any) certification from these tools.
|
|
13
|
+
- Do not crawl the whole org in one pass — honor budgets below.
|
|
14
|
+
- Do not request warehouse/dbt secrets via MCP — credentials are never returned (ADR-0011).
|
|
15
|
+
|
|
16
|
+
## Default budgets (override only if the user expands scope)
|
|
17
|
+
|
|
18
|
+
| Resource | Default |
|
|
19
|
+
| -------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
20
|
+
| Member list pages | `pageSize=50`, stop after **3 pages** or when `pagination.complete` |
|
|
21
|
+
| Groups pages | `pageSize=50`, stop after **2 pages** |
|
|
22
|
+
| Projects in depth | **3** non-preview projects (or only those in `projectUuids` / HTTP pin) |
|
|
23
|
+
| Content pages per project | `pageSize=50`, **2** pages max per contentTypes pass |
|
|
24
|
+
| `resolve_effective_access` | `maxPrincipals=50`; prefer with a `projectUuid` (and `spaceUuid` when investigating one space) |
|
|
25
|
+
| Schedulers pages | `pageSize=50`, **2** pages |
|
|
26
|
+
|
|
27
|
+
Always record when you stopped early (`pagination.complete=false`, budget hit, or user-capped project list).
|
|
28
|
+
|
|
29
|
+
## Coverage semantics (do not confuse)
|
|
30
|
+
|
|
31
|
+
- **`pagination.complete`**: this list response finished paging (or you stopped).
|
|
32
|
+
- **`coverage.complete`**: often **false** even when a single call succeeded — it means the _audit envelope_ is not a full org certification. **Do not** treat `coverage.complete=false` alone as “tool failed”.
|
|
33
|
+
- Prefer citing `pagination`, `warnings[]` codes (`REDACTED`, `INCOMPLETE_EFFECTIVE_ACCESS`, `TRUNCATED`, `V1_FALLBACK`), and `accessSemantics`.
|
|
17
34
|
|
|
18
35
|
## Tool catalog (`lightdash_*`)
|
|
19
36
|
|
|
20
|
-
|
|
37
|
+
**Org inventory:** `get_org_profile`, `list_org_members`, `get_org_member`, `list_org_groups`, `list_org_projects`
|
|
21
38
|
|
|
22
|
-
Access
|
|
39
|
+
**Access:** `list_org_role_assignments`, `list_custom_roles`, `get_custom_role`, `list_project_roles`, `list_project_direct_access`, `list_space_access`, `resolve_effective_access`
|
|
23
40
|
|
|
24
|
-
Content / health
|
|
41
|
+
**Content / health:** `list_content`, `get_dashboard_meta`, `list_validation_results`, `get_project_user_activity`
|
|
25
42
|
|
|
26
|
-
Delivery
|
|
43
|
+
**Delivery:** `list_project_schedulers`, `get_scheduler`
|
|
27
44
|
|
|
28
45
|
## Phase 0 — Scope
|
|
29
46
|
|
|
30
|
-
1. Call `lightdash_get_org_profile`.
|
|
31
|
-
2.
|
|
32
|
-
3.
|
|
47
|
+
1. Call `lightdash_get_org_profile`. Record `organizationUuid`, caller role, `auditVisibility`, and `capabilities`.
|
|
48
|
+
2. If `auditVisibility` is not `organization_admin`, downgrade org-wide claims and note inaccessible scopes.
|
|
49
|
+
3. Call `lightdash_list_org_projects` (`includePreviewProjects=false` unless asked).
|
|
50
|
+
4. **Project selection:**
|
|
51
|
+
- Prefer the HTTP pin (`X-Lightdash-Project`) or user-supplied `projectUuids`.
|
|
52
|
+
- Otherwise pick up to **3** `type=DEFAULT` projects.
|
|
53
|
+
- Flag (or skip unless asked) names that look soft-deleted / temporary (e.g. contain `Deleted`, `Preview`, or have `upstreamProjectUuid` set for throwaway clones).
|
|
54
|
+
5. Convert prompt `allowedEmailDomains` comma-strings into **string arrays** for tools that accept `allowedEmailDomains`.
|
|
55
|
+
|
|
56
|
+
## Phase 5 — Report template
|
|
57
|
+
|
|
58
|
+
For each finding use:
|
|
33
59
|
|
|
34
|
-
|
|
60
|
+
```text
|
|
61
|
+
### [severity: high|medium|low|info] Title
|
|
62
|
+
- Fact: …
|
|
63
|
+
- Evidence: tool=lightdash_… ; resource UUIDs=… ; warning codes=…
|
|
64
|
+
- Inference (optional): …
|
|
65
|
+
- Gaps: pagination/budget/redaction/incomplete effective access
|
|
66
|
+
- Suggested review action: … (never auto-delete / never mutate)
|
|
67
|
+
```
|
|
35
68
|
|
|
36
|
-
|
|
69
|
+
End with: projects sampled, pages fetched, redaction state, and explicit non-certification statement.
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
URI: `lightdash://playbooks/organization-audit/deliveries`
|
|
4
4
|
|
|
5
|
-
## Phase 4 — Deliveries
|
|
5
|
+
## Phase 4 — Deliveries (per sampled project)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. **`lightdash_list_project_schedulers`** with required `projectUuid`. Destinations stay redacted unless the user asks for `revealDestinations=true`.
|
|
8
|
+
2. Pass `allowedEmailDomains` (array) when classifying external email destinations after reveal.
|
|
9
|
+
3. Note `enabled`, `format` (e.g. `gsheets`, email), `cron`, linked `savedChartUuid` / `dashboardUuid`, and creator UUIDs.
|
|
10
|
+
4. **`enabled: false`** is still inventory — report as disabled schedule, not as “safe / ignore”.
|
|
11
|
+
5. Use **`lightdash_get_scheduler`** (`projectUuid` + `schedulerUuid`) for one schedule when list rows are insufficient.
|
|
12
|
+
6. Cross-link chart/dashboard UUIDs to `list_content` names when helpful.
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
Never create, edit, run, enable, disable, or delete schedules. External destinations (when revealed) are **review signals**, not automatic policy violations.
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
URI: `lightdash://playbooks/organization-audit`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Read-only evidence collection for Lightdash organization administrators. The host synthesizes findings from primitive `lightdash_*` tools — there are **no** composed `audit_*` tools and **no** compliance certification.
|
|
6
6
|
|
|
7
|
-
| Topic
|
|
8
|
-
|
|
|
9
|
-
| Core (
|
|
10
|
-
| Access governance
|
|
11
|
-
| Content and health
|
|
12
|
-
| Scheduled deliveries
|
|
7
|
+
| Topic | URI | When to load |
|
|
8
|
+
| ---------------------------- | ----------------------------------------------------- | ------------------------------------------------- |
|
|
9
|
+
| Core (budgets, bans, report) | `lightdash://playbooks/organization-audit/core` | Always (embedded in every prompt) |
|
|
10
|
+
| Access governance | `lightdash://playbooks/organization-audit/access` | `review_access_governance` / access chapters |
|
|
11
|
+
| Content and health | `lightdash://playbooks/organization-audit/content` | `review_content_governance` / content chapters |
|
|
12
|
+
| Scheduled deliveries | `lightdash://playbooks/organization-audit/deliveries` | `review_scheduled_deliveries` / delivery chapters |
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
**Live-org reality check:** organizations often have hundreds of members and many projects. Default to **bounded samples** (see core budgets). Never crawl every member page or every project unless the user explicitly expands scope.
|
|
@@ -9,7 +9,7 @@ const playbook_resources_js_1 = require("../../../lib/playbook-resources.js");
|
|
|
9
9
|
const playbooks = (0, playbook_resources_js_1.definePersonaPlaybooks)({
|
|
10
10
|
personaId: 'organization-audit',
|
|
11
11
|
moduleDir: __dirname,
|
|
12
|
-
hardBans: 'Do not mutate users/groups/roles/content/schedulers, execute warehouse or chart queries, download user-activity CSV, reveal secrets, or claim compliance certification. Those capabilities are not available on this server.',
|
|
12
|
+
hardBans: 'Do not mutate users/groups/roles/content/schedulers, execute warehouse or chart queries, download user-activity CSV, reveal secrets, crawl unbounded org inventories, or claim compliance certification. Prefer core budgets (page/project caps). Those capabilities are not available on this server.',
|
|
13
13
|
coreDescription: 'Hard bans, tool catalog, scope, and report rules',
|
|
14
14
|
topics: [
|
|
15
15
|
{
|