@lightdash-tools/mcp 0.13.2 → 0.16.1
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 +54 -18
- package/dist/auth/oauth-broker/lightdash-token.d.ts +6 -5
- package/dist/auth/oauth-broker/lightdash-token.js +6 -10
- package/dist/auth/oauth-broker/mcp-access-token.d.ts +31 -0
- package/dist/auth/oauth-broker/mcp-access-token.js +109 -0
- package/dist/auth/oauth-broker/mcp-access-token.test.d.ts +1 -0
- package/dist/auth/oauth-broker/mcp-access-token.test.js +61 -0
- package/dist/auth/oauth-broker/pending-store.d.ts +9 -3
- package/dist/auth/oauth-broker/pending-store.js +5 -3
- package/dist/auth/oauth-broker/pending-store.test.js +28 -44
- package/dist/auth/oauth-broker/routes.d.ts +2 -1
- package/dist/auth/oauth-broker/routes.js +97 -45
- package/dist/auth/oauth-broker/routes.test.js +81 -13
- package/dist/auth/request-state-key.d.ts +1 -1
- package/dist/auth/request-state-key.js +1 -1
- package/dist/auth/resource-server/lightdash-oauth-middleware.d.ts +2 -0
- package/dist/auth/resource-server/lightdash-oauth-middleware.js +58 -37
- package/dist/auth/resource-server/lightdash-oauth-middleware.test.js +59 -57
- package/dist/auth/resource-server/oauth-protected-resource.d.ts +2 -2
- package/dist/auth/resource-server/oauth-protected-resource.js +10 -9
- package/dist/bin.js +34 -8
- package/dist/config/enabled-profiles.d.ts +23 -0
- package/dist/config/enabled-profiles.js +57 -0
- package/dist/config/enabled-profiles.test.d.ts +1 -0
- package/dist/config/enabled-profiles.test.js +62 -0
- package/dist/config/env.d.ts +7 -0
- package/dist/config/env.js +8 -1
- package/dist/config/load-mcp-config.d.ts +15 -1
- package/dist/config/load-mcp-config.js +21 -9
- package/dist/config/load-mcp-config.test.js +61 -0
- package/dist/config/prompt-context-policy.d.ts +18 -0
- package/dist/config/prompt-context-policy.js +40 -0
- package/dist/config/prompt-context-policy.test.d.ts +4 -0
- package/dist/config/prompt-context-policy.test.js +35 -0
- package/dist/config/test-mcp-http-config.js +4 -1
- package/dist/governance/mcp-post-factory-context.d.ts +2 -0
- package/dist/http.d.ts +7 -1
- package/dist/http.integration.test.js +102 -44
- package/dist/http.js +10 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.integration.test.js +3 -12
- package/dist/index.js +6 -3
- package/dist/policy/content-developer.d.ts +5 -0
- package/dist/policy/content-developer.js +25 -1
- package/dist/policy/content-developer.test.js +29 -0
- package/dist/profiles/ai-agent-ops/v1/invariants.d.ts +27 -0
- package/dist/profiles/ai-agent-ops/v1/invariants.js +39 -0
- package/dist/profiles/ai-agent-ops/v1/prompts.d.ts +3 -2
- package/dist/profiles/ai-agent-ops/v1/prompts.js +67 -41
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks.d.ts +2 -1
- package/dist/profiles/ai-agent-ops/v1/resources/playbooks.js +10 -3
- package/dist/profiles/content-developer/v1/invariants.d.ts +69 -0
- package/dist/profiles/content-developer/v1/invariants.js +95 -0
- package/dist/profiles/content-developer/v1/prompt-specs.d.ts +32 -0
- package/dist/profiles/content-developer/v1/prompt-specs.js +56 -0
- package/dist/profiles/content-developer/v1/prompts.d.ts +4 -3
- package/dist/profiles/content-developer/v1/prompts.js +65 -71
- package/dist/profiles/content-developer/v1/prompts.test.js +61 -7
- package/dist/profiles/content-developer/v1/resources/playbooks/chart-types.md +2 -1
- package/dist/profiles/content-developer/v1/resources/playbooks/core.md +3 -1
- package/dist/profiles/content-developer/v1/resources/playbooks/dashboard-design.md +11 -1
- package/dist/profiles/content-developer/v1/resources/playbooks/dashboards.md +1 -1
- package/dist/profiles/content-developer/v1/resources/playbooks/index.md +11 -8
- package/dist/profiles/content-developer/v1/resources/playbooks/recovery/dashboard-diff.md +15 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/recovery/preview-required.md +14 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/recovery/preview-stale.md +21 -0
- package/dist/profiles/content-developer/v1/resources/playbooks/table-calculations.md +15 -3
- package/dist/profiles/content-developer/v1/resources/playbooks.d.ts +3 -2
- package/dist/profiles/content-developer/v1/resources/playbooks.js +35 -21
- package/dist/profiles/content-governance/v1/invariants.d.ts +27 -0
- package/dist/profiles/content-governance/v1/invariants.js +39 -0
- package/dist/profiles/content-governance/v1/prompts.d.ts +4 -2
- package/dist/profiles/content-governance/v1/prompts.js +31 -19
- package/dist/profiles/content-governance/v1/resources/playbooks.d.ts +2 -1
- package/dist/profiles/content-governance/v1/resources/playbooks.js +8 -9
- package/dist/profiles/content-reader/v1/index.js +1 -0
- package/dist/profiles/content-reader/v1/invariants.d.ts +33 -0
- package/dist/profiles/content-reader/v1/invariants.js +47 -0
- package/dist/profiles/content-reader/v1/prompt-specs.d.ts +18 -0
- package/dist/profiles/content-reader/v1/prompt-specs.js +33 -0
- package/dist/profiles/content-reader/v1/prompts.d.ts +3 -2
- package/dist/profiles/content-reader/v1/prompts.js +69 -75
- package/dist/profiles/content-reader/v1/resources/playbooks/compare.md +1 -1
- package/dist/profiles/content-reader/v1/resources/playbooks/core.md +1 -0
- package/dist/profiles/content-reader/v1/resources/playbooks/discover.md +12 -3
- package/dist/profiles/content-reader/v1/resources/playbooks/explain-run.md +2 -1
- package/dist/profiles/content-reader/v1/resources/playbooks.d.ts +2 -1
- package/dist/profiles/content-reader/v1/resources/playbooks.js +10 -11
- package/dist/profiles/data-analyst/v1/invariants.d.ts +21 -0
- package/dist/profiles/data-analyst/v1/invariants.js +31 -0
- package/dist/profiles/data-analyst/v1/prompts.d.ts +3 -2
- package/dist/profiles/data-analyst/v1/prompts.js +17 -9
- package/dist/profiles/data-analyst/v1/resources/playbooks.d.ts +2 -1
- package/dist/profiles/data-analyst/v1/resources/playbooks.js +6 -7
- package/dist/profiles/index.d.ts +2 -1
- package/dist/profiles/index.js +2 -1
- package/dist/profiles/index.test.js +2 -1
- package/dist/profiles/lib/playbook-resources.d.ts +16 -34
- package/dist/profiles/lib/playbook-resources.js +55 -76
- package/dist/profiles/lib/prompt-context.d.ts +71 -0
- package/dist/profiles/lib/prompt-context.js +205 -0
- package/dist/profiles/lib/prompt-context.test.d.ts +4 -0
- package/dist/profiles/lib/prompt-context.test.js +154 -0
- package/dist/profiles/lib/prompt-invariants.d.ts +20 -0
- package/dist/profiles/lib/prompt-invariants.js +54 -0
- package/dist/profiles/organization-audit/v1/invariants.d.ts +24 -0
- package/dist/profiles/organization-audit/v1/invariants.js +35 -0
- package/dist/profiles/organization-audit/v1/prompts.d.ts +3 -2
- package/dist/profiles/organization-audit/v1/prompts.js +44 -28
- package/dist/profiles/organization-audit/v1/resources/playbooks.d.ts +2 -1
- package/dist/profiles/organization-audit/v1/resources/playbooks.js +10 -3
- package/dist/profiles/semantic-layer/v1/invariants.d.ts +27 -0
- package/dist/profiles/semantic-layer/v1/invariants.js +39 -0
- package/dist/profiles/semantic-layer/v1/prompts.d.ts +3 -2
- package/dist/profiles/semantic-layer/v1/prompts.js +37 -26
- package/dist/profiles/semantic-layer/v1/resources/playbooks.d.ts +2 -4
- package/dist/profiles/semantic-layer/v1/resources/playbooks.js +8 -7
- package/dist/profiles/test-support/prompt-context-budget.test.d.ts +5 -0
- package/dist/profiles/test-support/prompt-context-budget.test.js +72 -0
- package/dist/profiles/types.d.ts +6 -1
- package/dist/server/capabilities.d.ts +3 -0
- package/dist/server/capabilities.js +4 -2
- package/dist/stdio.process.test.js +2 -1
- package/dist/tools/lib/schema-fields.d.ts +4 -0
- package/dist/tools/lib/schema-fields.js +8 -1
- package/dist/tools/project/developer-content-preview.js +1 -1
- package/dist/tools/project/developer-content.js +2 -2
- package/dist/tools/project/reader-content.d.ts +2 -0
- package/dist/tools/project/reader-content.js +28 -1
- package/dist/tools/query/reader-tool-helpers.d.ts +2 -2
- package/dist/tools/query/reader-tool-helpers.js +2 -2
- package/dist/tools/query/reader-tool-helpers.test.js +1 -0
- package/dist/tools/shared.d.ts +6 -1
- package/dist/tools/shared.js +12 -2
- package/dist/transports/streamable-http.js +16 -6
- package/dist/transports/streamable-http.test.js +16 -0
- package/package.json +3 -3
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Prompt context composer unit tests.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
const prompt_context_js_1 = require("./prompt-context.js");
|
|
8
|
+
const INVARIANTS = [
|
|
9
|
+
{ id: 'no-mutation', short: 'Do not mutate resources.' },
|
|
10
|
+
{ id: 'project-scope', short: 'Stay inside the resolved project.' },
|
|
11
|
+
];
|
|
12
|
+
const core = {
|
|
13
|
+
uri: 'lightdash://playbooks/test/core',
|
|
14
|
+
getMarkdown: () => `# Core\n${'long core body '.repeat(80)}`,
|
|
15
|
+
};
|
|
16
|
+
const topics = {
|
|
17
|
+
discover: {
|
|
18
|
+
uri: 'lightdash://playbooks/test/discover',
|
|
19
|
+
getMarkdown: () => `# Discover\n${'discover body '.repeat(40)}`,
|
|
20
|
+
},
|
|
21
|
+
recovery: {
|
|
22
|
+
uri: 'lightdash://playbooks/test/recovery/preview-stale',
|
|
23
|
+
getMarkdown: () => '# Recovery\nre-preview',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const topicMeta = {
|
|
27
|
+
discover: { description: 'Discovery guidance', useWhen: 'Weak search results' },
|
|
28
|
+
recovery: { description: 'Preview stale recovery', useWhen: 'PREVIEW_STALE' },
|
|
29
|
+
};
|
|
30
|
+
(0, vitest_1.describe)('createPromptContextComposer', () => {
|
|
31
|
+
(0, vitest_1.it)('compact returns text only with invariants and manifest', () => {
|
|
32
|
+
const compose = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
33
|
+
policy: 'compact',
|
|
34
|
+
invariants: INVARIANTS,
|
|
35
|
+
core,
|
|
36
|
+
topics,
|
|
37
|
+
topicMeta,
|
|
38
|
+
});
|
|
39
|
+
const { messages } = compose({
|
|
40
|
+
task: 'Find content for revenue',
|
|
41
|
+
invariantIds: ['no-mutation', 'project-scope'],
|
|
42
|
+
requiredTopics: ['discover'],
|
|
43
|
+
recoveryTopics: [{ topic: 'recovery', when: 'After PREVIEW_STALE' }],
|
|
44
|
+
});
|
|
45
|
+
(0, vitest_1.expect)(messages).toHaveLength(1);
|
|
46
|
+
(0, vitest_1.expect)(messages[0].content.type).toBe('text');
|
|
47
|
+
if (messages[0].content.type !== 'text')
|
|
48
|
+
return;
|
|
49
|
+
const text = messages[0].content.text;
|
|
50
|
+
(0, vitest_1.expect)(text).toContain('Find content for revenue');
|
|
51
|
+
(0, vitest_1.expect)(text).toContain('Critical invariants:');
|
|
52
|
+
(0, vitest_1.expect)(text).toContain('Do not mutate resources.');
|
|
53
|
+
(0, vitest_1.expect)(text).toContain('lightdash://playbooks/test/core');
|
|
54
|
+
(0, vitest_1.expect)(text).toContain('lightdash://playbooks/test/discover');
|
|
55
|
+
(0, vitest_1.expect)(text).not.toContain('long core body');
|
|
56
|
+
});
|
|
57
|
+
(0, vitest_1.it)('compact recovery topic without when falls back to topicMeta', () => {
|
|
58
|
+
const compose = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
59
|
+
policy: 'compact',
|
|
60
|
+
invariants: INVARIANTS,
|
|
61
|
+
core,
|
|
62
|
+
topics,
|
|
63
|
+
topicMeta,
|
|
64
|
+
});
|
|
65
|
+
const { messages } = compose({
|
|
66
|
+
task: 'Recover preview',
|
|
67
|
+
invariantIds: ['no-mutation'],
|
|
68
|
+
recoveryTopics: [{ topic: 'recovery' }],
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.expect)(messages).toHaveLength(1);
|
|
71
|
+
if (messages[0].content.type !== 'text')
|
|
72
|
+
return;
|
|
73
|
+
(0, vitest_1.expect)(messages[0].content.text).toContain('lightdash://playbooks/test/recovery/preview-stale — PREVIEW_STALE');
|
|
74
|
+
});
|
|
75
|
+
(0, vitest_1.it)('compatible embeds required topics only', () => {
|
|
76
|
+
const compose = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
77
|
+
policy: 'compatible',
|
|
78
|
+
invariants: INVARIANTS,
|
|
79
|
+
core,
|
|
80
|
+
topics,
|
|
81
|
+
topicMeta,
|
|
82
|
+
});
|
|
83
|
+
const { messages } = compose({
|
|
84
|
+
task: 'Find content',
|
|
85
|
+
invariantIds: ['no-mutation'],
|
|
86
|
+
requiredTopics: ['discover'],
|
|
87
|
+
conditionalTopics: [{ topic: 'recovery', when: 'rare' }],
|
|
88
|
+
});
|
|
89
|
+
(0, vitest_1.expect)(messages).toHaveLength(2);
|
|
90
|
+
(0, vitest_1.expect)(messages[1].content.type).toBe('resource');
|
|
91
|
+
if (messages[1].content.type !== 'resource')
|
|
92
|
+
return;
|
|
93
|
+
(0, vitest_1.expect)(messages[1].content.resource.uri).toBe('lightdash://playbooks/test/discover');
|
|
94
|
+
(0, vitest_1.expect)(messages[1].content.resource.text).toContain('discover body');
|
|
95
|
+
});
|
|
96
|
+
(0, vitest_1.it)('embedded embeds core and required topics', () => {
|
|
97
|
+
const compose = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
98
|
+
policy: 'embedded',
|
|
99
|
+
invariants: INVARIANTS,
|
|
100
|
+
core,
|
|
101
|
+
topics,
|
|
102
|
+
topicMeta,
|
|
103
|
+
});
|
|
104
|
+
const { messages } = compose({
|
|
105
|
+
task: 'Find content',
|
|
106
|
+
invariantIds: ['project-scope'],
|
|
107
|
+
requiredTopics: ['discover'],
|
|
108
|
+
});
|
|
109
|
+
(0, vitest_1.expect)(messages).toHaveLength(3);
|
|
110
|
+
(0, vitest_1.expect)(messages.map((m) => (m.content.type === 'resource' ? m.content.resource.uri : 'text'))).toEqual(['text', 'lightdash://playbooks/test/core', 'lightdash://playbooks/test/discover']);
|
|
111
|
+
});
|
|
112
|
+
(0, vitest_1.it)('throws on unknown invariant or topic', () => {
|
|
113
|
+
const compose = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
114
|
+
policy: 'compact',
|
|
115
|
+
invariants: INVARIANTS,
|
|
116
|
+
core,
|
|
117
|
+
topics,
|
|
118
|
+
topicMeta,
|
|
119
|
+
});
|
|
120
|
+
(0, vitest_1.expect)(() => compose({ task: 'x', invariantIds: ['missing'], requiredTopics: [] })).toThrow(/Unknown prompt invariant/);
|
|
121
|
+
(0, vitest_1.expect)(() => compose({
|
|
122
|
+
task: 'x',
|
|
123
|
+
invariantIds: ['no-mutation'],
|
|
124
|
+
// @ts-expect-error intentional bad topic
|
|
125
|
+
requiredTopics: ['nope'],
|
|
126
|
+
})).toThrow(/Unknown playbook topic/);
|
|
127
|
+
});
|
|
128
|
+
(0, vitest_1.it)('measures compact smaller than embedded', () => {
|
|
129
|
+
const compact = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
130
|
+
policy: 'compact',
|
|
131
|
+
invariants: INVARIANTS,
|
|
132
|
+
core,
|
|
133
|
+
topics,
|
|
134
|
+
topicMeta,
|
|
135
|
+
});
|
|
136
|
+
const embedded = (0, prompt_context_js_1.createPromptContextComposer)({
|
|
137
|
+
policy: 'embedded',
|
|
138
|
+
invariants: INVARIANTS,
|
|
139
|
+
core,
|
|
140
|
+
topics,
|
|
141
|
+
topicMeta,
|
|
142
|
+
});
|
|
143
|
+
const spec = {
|
|
144
|
+
task: 'Find content',
|
|
145
|
+
invariantIds: ['no-mutation', 'project-scope'],
|
|
146
|
+
requiredTopics: ['discover'],
|
|
147
|
+
};
|
|
148
|
+
const c = (0, prompt_context_js_1.measurePromptMessages)(compact(spec).messages);
|
|
149
|
+
const e = (0, prompt_context_js_1.measurePromptMessages)(embedded(spec).messages);
|
|
150
|
+
(0, vitest_1.expect)(c.embeddedResourceCount).toBe(0);
|
|
151
|
+
(0, vitest_1.expect)(e.embeddedResourceCount).toBe(2);
|
|
152
|
+
(0, vitest_1.expect)(c.totalChars).toBeLessThan(e.totalChars);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured prompt invariants (SSOT for eager safety capsules and HARD_BANS projections).
|
|
3
|
+
*/
|
|
4
|
+
export type PromptInvariant = {
|
|
5
|
+
id: string;
|
|
6
|
+
/** One-line rule shown in the invariant capsule / HARD_BANS projection. */
|
|
7
|
+
short: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const INVARIANT_CAPSULE_HEADER: "Critical invariants:";
|
|
10
|
+
/** Assert unique invariant ids (throws on duplicates). */
|
|
11
|
+
export declare function assertUniqueInvariantIds(invariants: readonly PromptInvariant[]): void;
|
|
12
|
+
/** Typed id list for a catalog (avoids per-profile `as unknown as` casts). */
|
|
13
|
+
export declare function allInvariantIds<T extends PromptInvariant>(catalog: readonly T[]): ReadonlyArray<T['id']>;
|
|
14
|
+
export declare function resolveInvariants(byId: ReadonlyMap<string, PromptInvariant>, ids: readonly string[]): PromptInvariant[];
|
|
15
|
+
/** Build a lookup map once (call after assertUniqueInvariantIds). */
|
|
16
|
+
export declare function invariantIndex(catalog: readonly PromptInvariant[]): ReadonlyMap<string, PromptInvariant>;
|
|
17
|
+
/** Compact eager capsule for prompts/get text. */
|
|
18
|
+
export declare function formatInvariantCapsule(invariants: readonly PromptInvariant[]): string;
|
|
19
|
+
/** Legacy multi-line HARD_BANS string (one ban per line, no header). */
|
|
20
|
+
export declare function formatHardBansProjection(invariants: readonly PromptInvariant[]): string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Structured prompt invariants (SSOT for eager safety capsules and HARD_BANS projections).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.INVARIANT_CAPSULE_HEADER = void 0;
|
|
7
|
+
exports.assertUniqueInvariantIds = assertUniqueInvariantIds;
|
|
8
|
+
exports.allInvariantIds = allInvariantIds;
|
|
9
|
+
exports.resolveInvariants = resolveInvariants;
|
|
10
|
+
exports.invariantIndex = invariantIndex;
|
|
11
|
+
exports.formatInvariantCapsule = formatInvariantCapsule;
|
|
12
|
+
exports.formatHardBansProjection = formatHardBansProjection;
|
|
13
|
+
exports.INVARIANT_CAPSULE_HEADER = 'Critical invariants:';
|
|
14
|
+
/** Assert unique invariant ids (throws on duplicates). */
|
|
15
|
+
function assertUniqueInvariantIds(invariants) {
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
for (const inv of invariants) {
|
|
18
|
+
if (seen.has(inv.id)) {
|
|
19
|
+
throw new Error(`Duplicate prompt invariant id '${inv.id}'`);
|
|
20
|
+
}
|
|
21
|
+
seen.add(inv.id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Typed id list for a catalog (avoids per-profile `as unknown as` casts). */
|
|
25
|
+
function allInvariantIds(catalog) {
|
|
26
|
+
return catalog.map((inv) => inv.id);
|
|
27
|
+
}
|
|
28
|
+
function resolveInvariants(byId, ids) {
|
|
29
|
+
const resolved = [];
|
|
30
|
+
for (const id of ids) {
|
|
31
|
+
const inv = byId.get(id);
|
|
32
|
+
if (!inv) {
|
|
33
|
+
throw new Error(`Unknown prompt invariant id '${id}'`);
|
|
34
|
+
}
|
|
35
|
+
resolved.push(inv);
|
|
36
|
+
}
|
|
37
|
+
return resolved;
|
|
38
|
+
}
|
|
39
|
+
/** Build a lookup map once (call after assertUniqueInvariantIds). */
|
|
40
|
+
function invariantIndex(catalog) {
|
|
41
|
+
return new Map(catalog.map((inv) => [inv.id, inv]));
|
|
42
|
+
}
|
|
43
|
+
/** Compact eager capsule for prompts/get text. */
|
|
44
|
+
function formatInvariantCapsule(invariants) {
|
|
45
|
+
if (invariants.length === 0) {
|
|
46
|
+
return '';
|
|
47
|
+
}
|
|
48
|
+
const lines = invariants.map((inv) => `- ${inv.short}`);
|
|
49
|
+
return [exports.INVARIANT_CAPSULE_HEADER, ...lines].join('\n');
|
|
50
|
+
}
|
|
51
|
+
/** Legacy multi-line HARD_BANS string (one ban per line, no header). */
|
|
52
|
+
function formatHardBansProjection(invariants) {
|
|
53
|
+
return invariants.map((inv) => inv.short).join('\n');
|
|
54
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization-audit structured prompt invariants (SSOT for capsules + HARD_BANS projection).
|
|
3
|
+
*/
|
|
4
|
+
export declare const ORGANIZATION_AUDIT_INVARIANTS: readonly [{
|
|
5
|
+
readonly id: "no-mutation";
|
|
6
|
+
readonly short: "Do not mutate users/groups/roles/content/schedulers.";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "no-warehouse-query";
|
|
9
|
+
readonly short: "Do not execute warehouse or chart queries.";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "no-csv-download";
|
|
12
|
+
readonly short: "Do not download user-activity CSV.";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "no-secrets";
|
|
15
|
+
readonly short: "Do not reveal secrets.";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "no-unbounded-crawl";
|
|
18
|
+
readonly short: "Do not crawl unbounded org inventories. Prefer core budgets (page/project caps).";
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "no-compliance-claim";
|
|
21
|
+
readonly short: "Do not claim compliance certification. Those capabilities are not available on this server.";
|
|
22
|
+
}];
|
|
23
|
+
export declare const ORGANIZATION_AUDIT_HARD_BANS: string;
|
|
24
|
+
export declare const ORGANIZATION_AUDIT_DEFAULT_INVARIANT_IDS: readonly ("no-secrets" | "no-mutation" | "no-warehouse-query" | "no-csv-download" | "no-unbounded-crawl" | "no-compliance-claim")[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Organization-audit structured prompt invariants (SSOT for capsules + HARD_BANS projection).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ORGANIZATION_AUDIT_DEFAULT_INVARIANT_IDS = exports.ORGANIZATION_AUDIT_HARD_BANS = exports.ORGANIZATION_AUDIT_INVARIANTS = void 0;
|
|
7
|
+
const prompt_invariants_js_1 = require("../../lib/prompt-invariants.js");
|
|
8
|
+
exports.ORGANIZATION_AUDIT_INVARIANTS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'no-mutation',
|
|
11
|
+
short: 'Do not mutate users/groups/roles/content/schedulers.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'no-warehouse-query',
|
|
15
|
+
short: 'Do not execute warehouse or chart queries.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'no-csv-download',
|
|
19
|
+
short: 'Do not download user-activity CSV.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'no-secrets',
|
|
23
|
+
short: 'Do not reveal secrets.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'no-unbounded-crawl',
|
|
27
|
+
short: 'Do not crawl unbounded org inventories. Prefer core budgets (page/project caps).',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'no-compliance-claim',
|
|
31
|
+
short: 'Do not claim compliance certification. Those capabilities are not available on this server.',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
exports.ORGANIZATION_AUDIT_HARD_BANS = (0, prompt_invariants_js_1.formatHardBansProjection)(exports.ORGANIZATION_AUDIT_INVARIANTS);
|
|
35
|
+
exports.ORGANIZATION_AUDIT_DEFAULT_INVARIANT_IDS = (0, prompt_invariants_js_1.allInvariantIds)(exports.ORGANIZATION_AUDIT_INVARIANTS);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP prompts for organization-audit workflows.
|
|
2
|
+
* MCP prompts for organization-audit workflows (progressive-disclosure context).
|
|
3
3
|
*/
|
|
4
|
+
import type { RegisterPromptsOptions } from '../../types.js';
|
|
4
5
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
5
|
-
export declare function registerOrganizationAuditPrompts(server: McpServer): void;
|
|
6
|
+
export declare function registerOrganizationAuditPrompts(server: McpServer, options?: RegisterPromptsOptions): void;
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* MCP prompts for organization-audit workflows.
|
|
3
|
+
* MCP prompts for organization-audit workflows (progressive-disclosure context).
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.registerOrganizationAuditPrompts = registerOrganizationAuditPrompts;
|
|
7
7
|
/* eslint-disable @typescript-eslint/no-deprecated -- matches semantic-layer prompt registration pattern */
|
|
8
8
|
const zod_1 = require("zod");
|
|
9
|
-
const
|
|
9
|
+
const schema_fields_js_1 = require("../../../tools/lib/schema-fields.js");
|
|
10
|
+
const prompt_context_js_1 = require("../../lib/prompt-context.js");
|
|
11
|
+
const invariants_js_1 = require("./invariants.js");
|
|
10
12
|
const playbooks_js_1 = require("./resources/playbooks.js");
|
|
11
|
-
const
|
|
13
|
+
const TOPIC_ACCESS = 'access';
|
|
14
|
+
const TOPIC_CONTENT = 'content';
|
|
15
|
+
const TOPIC_DELIVERIES = 'deliveries';
|
|
16
|
+
const bindPromptContext = (0, prompt_context_js_1.bindProfilePromptContext)({
|
|
17
|
+
invariants: invariants_js_1.ORGANIZATION_AUDIT_INVARIANTS,
|
|
12
18
|
core: playbooks_js_1.ORGANIZATION_AUDIT_CORE_PLAYBOOK,
|
|
13
19
|
topics: playbooks_js_1.ORGANIZATION_AUDIT_TOPIC_PLAYBOOKS,
|
|
20
|
+
topicMeta: playbooks_js_1.ORGANIZATION_AUDIT_TOPIC_META,
|
|
14
21
|
});
|
|
15
|
-
function registerOrganizationAuditPrompts(server) {
|
|
22
|
+
function registerOrganizationAuditPrompts(server, options) {
|
|
23
|
+
const promptContext = bindPromptContext(options === null || options === void 0 ? void 0 : options.promptContextPolicy);
|
|
24
|
+
const invariantIds = invariants_js_1.ORGANIZATION_AUDIT_DEFAULT_INVARIANT_IDS;
|
|
16
25
|
server.registerPrompt('audit_organization', {
|
|
17
26
|
title: 'Audit organization',
|
|
18
27
|
description: 'Bounded, evidence-backed read-only org audit via primitive lightdash_* tools (no audit_* mega-tools)',
|
|
@@ -26,9 +35,8 @@ function registerOrganizationAuditPrompts(server) {
|
|
|
26
35
|
.optional()
|
|
27
36
|
.describe('Comma-separated internal email domains; convert to a string[] for tool args'),
|
|
28
37
|
},
|
|
29
|
-
}, ({ projectUuids, allowedEmailDomains }) =>
|
|
30
|
-
|
|
31
|
-
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
38
|
+
}, ({ projectUuids, allowedEmailDomains }) => promptContext({
|
|
39
|
+
task: `Perform a bounded, evidence-backed, read-only audit of the current Lightdash organization.
|
|
32
40
|
|
|
33
41
|
Scope inputs:
|
|
34
42
|
- Optional project filter: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(none — sample ≤3 DEFAULT non-preview projects; honor X-Lightdash-Project pin if set)'}.
|
|
@@ -41,7 +49,10 @@ Procedure (primitives only — there are no lightdash_audit_* tools):
|
|
|
41
49
|
3. Content (content playbook): per project list_content + list_validation_results + get_project_user_activity (summarize; do not dump weekly series).
|
|
42
50
|
4. Deliveries (deliveries playbook): list_project_schedulers; get_scheduler only as needed.
|
|
43
51
|
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
|
|
52
|
+
6. Never claim formal compliance certification or exhaustive inventory when pagination/budgets stopped early.`,
|
|
53
|
+
invariantIds,
|
|
54
|
+
requiredTopics: [],
|
|
55
|
+
}));
|
|
45
56
|
server.registerPrompt('review_access_governance', {
|
|
46
57
|
title: 'Review access governance',
|
|
47
58
|
description: 'Build a bounded effective-access picture from identity + project/space primitives',
|
|
@@ -55,16 +66,18 @@ Procedure (primitives only — there are no lightdash_audit_* tools):
|
|
|
55
66
|
.optional()
|
|
56
67
|
.describe('Comma-separated domains → string[] for tools'),
|
|
57
68
|
},
|
|
58
|
-
}, ({ projectUuids, allowedEmailDomains }) =>
|
|
59
|
-
|
|
60
|
-
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
69
|
+
}, ({ projectUuids, allowedEmailDomains }) => promptContext({
|
|
70
|
+
task: `Review Lightdash identity and access governance with core budgets.
|
|
61
71
|
|
|
62
72
|
Projects: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(sample ≤3)'}.
|
|
63
73
|
Domains: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none)'}.
|
|
64
74
|
|
|
65
75
|
Mandatory tool order per project: lightdash_list_project_roles → lightdash_list_project_direct_access → lightdash_list_space_access → lightdash_resolve_effective_access.
|
|
66
76
|
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.`,
|
|
77
|
+
Empty direct_access ≠ no access. Truncation / INCOMPLETE_EFFECTIVE_ACCESS warnings must appear in the report.`,
|
|
78
|
+
invariantIds,
|
|
79
|
+
requiredTopics: [TOPIC_ACCESS],
|
|
80
|
+
}));
|
|
68
81
|
server.registerPrompt('review_content_governance', {
|
|
69
82
|
title: 'Review content governance',
|
|
70
83
|
description: 'Inventory content health via list_content, validation, and user-activity evidence',
|
|
@@ -74,14 +87,16 @@ Empty direct_access ≠ no access. Truncation / INCOMPLETE_EFFECTIVE_ACCESS warn
|
|
|
74
87
|
.optional()
|
|
75
88
|
.describe('Comma-separated project UUIDs (required for useful inventory; else sample ≤3)'),
|
|
76
89
|
},
|
|
77
|
-
}, ({ projectUuids }) =>
|
|
78
|
-
|
|
79
|
-
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
90
|
+
}, ({ projectUuids }) => promptContext({
|
|
91
|
+
task: `Inventory charts, dashboards, and spaces; evaluate validation, ownership, and usage.
|
|
80
92
|
|
|
81
93
|
Projects: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(sample ≤3; always pass projectUuids into list_content)'}.
|
|
82
94
|
|
|
83
95
|
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.`,
|
|
96
|
+
Join in the conversation — no server-side audit crawler. Do not recommend deletion for low/zero views.`,
|
|
97
|
+
invariantIds,
|
|
98
|
+
requiredTopics: [TOPIC_CONTENT],
|
|
99
|
+
}));
|
|
85
100
|
server.registerPrompt('review_scheduled_deliveries', {
|
|
86
101
|
title: 'Review scheduled deliveries',
|
|
87
102
|
description: 'Inspect schedulers without executing or mutating them',
|
|
@@ -92,33 +107,34 @@ Join in the conversation — no server-side audit crawler. Do not recommend dele
|
|
|
92
107
|
.describe('Comma-separated project UUIDs (default: ≤3 sampled)'),
|
|
93
108
|
allowedEmailDomains: zod_1.z.string().optional().describe('Comma-separated domains → string[]'),
|
|
94
109
|
},
|
|
95
|
-
}, ({ projectUuids, allowedEmailDomains }) =>
|
|
96
|
-
|
|
97
|
-
${playbooks_js_1.ORGANIZATION_AUDIT_HARD_BANS}
|
|
110
|
+
}, ({ projectUuids, allowedEmailDomains }) => promptContext({
|
|
111
|
+
task: `Inspect scheduled deliveries without creating, editing, executing, enabling, disabling, or deleting schedules.
|
|
98
112
|
|
|
99
113
|
Projects: ${projectUuids !== null && projectUuids !== void 0 ? projectUuids : '(sample ≤3)'}.
|
|
100
114
|
Allowed email domains: ${allowedEmailDomains !== null && allowedEmailDomains !== void 0 ? allowedEmailDomains : '(none)'}.
|
|
101
115
|
|
|
102
116
|
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.`,
|
|
117
|
+
Report enabled and disabled schedules. External destinations (if revealed) are review signals, not automatic violations.`,
|
|
118
|
+
invariantIds,
|
|
119
|
+
requiredTopics: [TOPIC_DELIVERIES],
|
|
120
|
+
}));
|
|
104
121
|
server.registerPrompt('investigate_audit_finding', {
|
|
105
122
|
title: 'Investigate audit finding',
|
|
106
123
|
description: 'Validate or refute one previously reported finding with minimum extra metadata',
|
|
107
124
|
argsSchema: {
|
|
108
125
|
findingSummary: zod_1.z.string().describe('The finding claim to investigate'),
|
|
109
|
-
projectUuid:
|
|
110
|
-
.string()
|
|
111
|
-
.optional()
|
|
112
|
-
.describe('Project UUID when the finding is project-scoped'),
|
|
126
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
113
127
|
},
|
|
114
|
-
}, ({ findingSummary, projectUuid }) =>
|
|
128
|
+
}, ({ findingSummary, projectUuid }) => promptContext({
|
|
129
|
+
task: `Investigate this organization-audit finding with minimum additional metadata:
|
|
115
130
|
|
|
116
131
|
${findingSummary}
|
|
117
132
|
|
|
118
133
|
Project context: ${projectUuid !== null && projectUuid !== void 0 ? projectUuid : '(org-level or unspecified — ask only if needed)'}.
|
|
119
134
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
135
|
+
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.`,
|
|
136
|
+
invariantIds,
|
|
137
|
+
requiredTopics: [],
|
|
138
|
+
}));
|
|
123
139
|
}
|
|
124
140
|
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
5
5
|
export type OrganizationAuditPlaybookTopic = 'access' | 'content' | 'deliveries';
|
|
6
|
-
export
|
|
6
|
+
export { ORGANIZATION_AUDIT_HARD_BANS } from '../invariants.js';
|
|
7
7
|
export declare const getAllPlaybookMarkdown: () => string;
|
|
8
8
|
export declare const ORGANIZATION_AUDIT_CORE_PLAYBOOK: import("../../../lib/playbook-resources.js").EmbeddedPlaybook;
|
|
9
9
|
export declare const ORGANIZATION_AUDIT_TOPIC_PLAYBOOKS: Readonly<Record<OrganizationAuditPlaybookTopic, import("../../../lib/playbook-resources.js").EmbeddedPlaybook>>;
|
|
10
|
+
export declare const ORGANIZATION_AUDIT_TOPIC_META: Readonly<Record<OrganizationAuditPlaybookTopic, import("../../../lib/playbook-resources.js").PromptTopicMeta>>;
|
|
10
11
|
export declare function registerOrganizationAuditPlaybook(server: McpServer): void;
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
* Organization-audit multi-playbook resources (core + topics + index).
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ORGANIZATION_AUDIT_TOPIC_PLAYBOOKS = exports.ORGANIZATION_AUDIT_CORE_PLAYBOOK = exports.getAllPlaybookMarkdown = exports.ORGANIZATION_AUDIT_HARD_BANS = void 0;
|
|
6
|
+
exports.ORGANIZATION_AUDIT_TOPIC_META = exports.ORGANIZATION_AUDIT_TOPIC_PLAYBOOKS = exports.ORGANIZATION_AUDIT_CORE_PLAYBOOK = exports.getAllPlaybookMarkdown = exports.ORGANIZATION_AUDIT_HARD_BANS = void 0;
|
|
7
7
|
exports.registerOrganizationAuditPlaybook = registerOrganizationAuditPlaybook;
|
|
8
8
|
const playbook_resources_js_1 = require("../../../lib/playbook-resources.js");
|
|
9
9
|
const playbooks = (0, playbook_resources_js_1.defineProfilePlaybooks)({
|
|
10
10
|
profileId: '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, crawl unbounded org inventories, or claim compliance certification. Prefer core budgets (page/project caps). Those capabilities are not available on this server.',
|
|
13
12
|
coreDescription: 'Hard bans, tool catalog, scope, and report rules',
|
|
14
13
|
topics: [
|
|
15
14
|
{
|
|
@@ -17,25 +16,33 @@ const playbooks = (0, playbook_resources_js_1.defineProfilePlaybooks)({
|
|
|
17
16
|
title: 'Organization-audit access playbook',
|
|
18
17
|
description: 'Identity and project/access governance phases',
|
|
19
18
|
file: 'access.md',
|
|
19
|
+
useWhen: 'Reviewing identity, roles, or effective access',
|
|
20
|
+
priority: 0.8,
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
23
|
id: 'content',
|
|
23
24
|
title: 'Organization-audit content playbook',
|
|
24
25
|
description: 'Content inventory, validation, and usage health',
|
|
25
26
|
file: 'content.md',
|
|
27
|
+
useWhen: 'Inventorying content health, validation, or usage',
|
|
28
|
+
priority: 0.75,
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
31
|
id: 'deliveries',
|
|
29
32
|
title: 'Organization-audit deliveries playbook',
|
|
30
33
|
description: 'Scheduled delivery review without mutation',
|
|
31
34
|
file: 'deliveries.md',
|
|
35
|
+
useWhen: 'Inspecting scheduled deliveries without mutation',
|
|
36
|
+
priority: 0.7,
|
|
32
37
|
},
|
|
33
38
|
],
|
|
34
39
|
});
|
|
35
|
-
|
|
40
|
+
var invariants_js_1 = require("../invariants.js");
|
|
41
|
+
Object.defineProperty(exports, "ORGANIZATION_AUDIT_HARD_BANS", { enumerable: true, get: function () { return invariants_js_1.ORGANIZATION_AUDIT_HARD_BANS; } });
|
|
36
42
|
exports.getAllPlaybookMarkdown = playbooks.getAllPlaybookMarkdown;
|
|
37
43
|
exports.ORGANIZATION_AUDIT_CORE_PLAYBOOK = playbooks.CORE_PLAYBOOK;
|
|
38
44
|
exports.ORGANIZATION_AUDIT_TOPIC_PLAYBOOKS = playbooks.TOPIC_PLAYBOOKS;
|
|
45
|
+
exports.ORGANIZATION_AUDIT_TOPIC_META = playbooks.TOPIC_META;
|
|
39
46
|
function registerOrganizationAuditPlaybook(server) {
|
|
40
47
|
playbooks.registerPlaybooks(server);
|
|
41
48
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic-layer structured prompt invariants (SSOT for capsules + HARD_BANS projection).
|
|
3
|
+
*/
|
|
4
|
+
export declare const SEMANTIC_LAYER_INVARIANTS: readonly [{
|
|
5
|
+
readonly id: "no-query-execution";
|
|
6
|
+
readonly short: "Do not run metric/SQL/chart queries or use SQL runner.";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "no-validation-jobs";
|
|
9
|
+
readonly short: "Do not trigger validation jobs.";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "no-mutation";
|
|
12
|
+
readonly short: "Do not mutate content.";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "project-scope";
|
|
15
|
+
readonly short: "Do not switch away from the given projectUuid.";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "no-invent-field-ids";
|
|
18
|
+
readonly short: "Do not invent fieldIds.";
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "no-dump-payloads";
|
|
21
|
+
readonly short: "Do not dump full explore/metric/lineage payloads.";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "no-ai-identity";
|
|
24
|
+
readonly short: "Do not call AI/identity tools. Those are not available on this server.";
|
|
25
|
+
}];
|
|
26
|
+
export declare const SEMANTIC_LAYER_HARD_BANS: string;
|
|
27
|
+
export declare const SEMANTIC_LAYER_DEFAULT_INVARIANT_IDS: readonly ("project-scope" | "no-invent-field-ids" | "no-mutation" | "no-query-execution" | "no-validation-jobs" | "no-dump-payloads" | "no-ai-identity")[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Semantic-layer structured prompt invariants (SSOT for capsules + HARD_BANS projection).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SEMANTIC_LAYER_DEFAULT_INVARIANT_IDS = exports.SEMANTIC_LAYER_HARD_BANS = exports.SEMANTIC_LAYER_INVARIANTS = void 0;
|
|
7
|
+
const prompt_invariants_js_1 = require("../../lib/prompt-invariants.js");
|
|
8
|
+
exports.SEMANTIC_LAYER_INVARIANTS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'no-query-execution',
|
|
11
|
+
short: 'Do not run metric/SQL/chart queries or use SQL runner.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'no-validation-jobs',
|
|
15
|
+
short: 'Do not trigger validation jobs.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'no-mutation',
|
|
19
|
+
short: 'Do not mutate content.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'project-scope',
|
|
23
|
+
short: 'Do not switch away from the given projectUuid.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'no-invent-field-ids',
|
|
27
|
+
short: 'Do not invent fieldIds.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'no-dump-payloads',
|
|
31
|
+
short: 'Do not dump full explore/metric/lineage payloads.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'no-ai-identity',
|
|
35
|
+
short: 'Do not call AI/identity tools. Those are not available on this server.',
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
exports.SEMANTIC_LAYER_HARD_BANS = (0, prompt_invariants_js_1.formatHardBansProjection)(exports.SEMANTIC_LAYER_INVARIANTS);
|
|
39
|
+
exports.SEMANTIC_LAYER_DEFAULT_INVARIANT_IDS = (0, prompt_invariants_js_1.allInvariantIds)(exports.SEMANTIC_LAYER_INVARIANTS);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP prompts for semantic-layer discovery and compile workflows.
|
|
2
|
+
* MCP prompts for semantic-layer discovery and compile workflows (progressive-disclosure context).
|
|
3
3
|
*/
|
|
4
|
+
import type { RegisterPromptsOptions } from '../../types.js';
|
|
4
5
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
5
|
-
export declare function registerSemanticLayerPrompts(server: McpServer): void;
|
|
6
|
+
export declare function registerSemanticLayerPrompts(server: McpServer, options?: RegisterPromptsOptions): void;
|