@lightdash-tools/mcp 0.14.0 → 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 +30 -11
- 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/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.js +2 -2
- package/dist/bin.js +33 -7
- package/dist/config/env.d.ts +5 -0
- package/dist/config/env.js +6 -1
- package/dist/config/load-mcp-config.d.ts +12 -1
- package/dist/config/load-mcp-config.js +17 -8
- package/dist/config/load-mcp-config.test.js +20 -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 +1 -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 +57 -22
- package/dist/http.js +10 -1
- package/dist/index.d.ts +6 -1
- 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/core.md +1 -0
- 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.d.ts +3 -2
- package/dist/profiles/content-developer/v1/resources/playbooks.js +35 -22
- 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/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 -76
- 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/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/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/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 +10 -3
- package/package.json +3 -3
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
5
5
|
export type AiAgentOpsPlaybookTopic = 'evaluation' | 'loop-engineering' | 'release-gate';
|
|
6
|
-
export
|
|
6
|
+
export { AI_AGENT_OPS_HARD_BANS } from '../invariants.js';
|
|
7
7
|
export declare const getAllPlaybookMarkdown: () => string;
|
|
8
8
|
export declare const AI_AGENT_OPS_CORE_PLAYBOOK: import("../../../lib/playbook-resources.js").EmbeddedPlaybook;
|
|
9
9
|
export declare const AI_AGENT_OPS_TOPIC_PLAYBOOKS: Readonly<Record<AiAgentOpsPlaybookTopic, import("../../../lib/playbook-resources.js").EmbeddedPlaybook>>;
|
|
10
|
+
export declare const AI_AGENT_OPS_TOPIC_META: Readonly<Record<AiAgentOpsPlaybookTopic, import("../../../lib/playbook-resources.js").PromptTopicMeta>>;
|
|
10
11
|
export declare function registerAiAgentOpsPlaybook(server: McpServer): void;
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
* AI agent-ops multi-playbook resources (core + topics + index).
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AI_AGENT_OPS_TOPIC_PLAYBOOKS = exports.AI_AGENT_OPS_CORE_PLAYBOOK = exports.getAllPlaybookMarkdown = exports.AI_AGENT_OPS_HARD_BANS = void 0;
|
|
6
|
+
exports.AI_AGENT_OPS_TOPIC_META = exports.AI_AGENT_OPS_TOPIC_PLAYBOOKS = exports.AI_AGENT_OPS_CORE_PLAYBOOK = exports.getAllPlaybookMarkdown = exports.AI_AGENT_OPS_HARD_BANS = void 0;
|
|
7
7
|
exports.registerAiAgentOpsPlaybook = registerAiAgentOpsPlaybook;
|
|
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: 'ai-agent-ops',
|
|
11
11
|
moduleDir: __dirname,
|
|
12
|
-
hardBans: 'Do not create/update/delete agents on this server, start or continue threads, mutate users/roles/semantic models/charts, run local offline scorers, write Git eval artifact stores via MCP, invent recommend_* or analyze_* mega-tools, or claim a CLI promotion gate passed from MCP run results alone. Those capabilities are not available as MCP mega-tools here — use CLI agentops / other profiles / the host.',
|
|
13
12
|
coreDescription: 'Hard bans, tool catalog, truth labels, and distributed loop rules',
|
|
14
13
|
topics: [
|
|
15
14
|
{
|
|
@@ -17,25 +16,33 @@ const playbooks = (0, playbook_resources_js_1.defineProfilePlaybooks)({
|
|
|
17
16
|
title: 'AI agent-ops evaluation playbook',
|
|
18
17
|
description: 'Product evaluation suites and readiness API usage',
|
|
19
18
|
file: 'evaluation.md',
|
|
19
|
+
useWhen: 'Designing, running, or comparing product evaluation suites',
|
|
20
|
+
priority: 0.8,
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
23
|
id: 'loop-engineering',
|
|
23
24
|
title: 'AI agent-ops loop-engineering playbook',
|
|
24
25
|
description: 'Host-driven improve loop across MCP, CLI, and other profiles',
|
|
25
26
|
file: 'loop-engineering.md',
|
|
27
|
+
useWhen: 'Investigating failures or running a bounded improve loop',
|
|
28
|
+
priority: 0.75,
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
31
|
id: 'release-gate',
|
|
29
32
|
title: 'AI agent-ops release-gate playbook',
|
|
30
33
|
description: 'Promotion decisions via CLI agentops evaluate-gate',
|
|
31
34
|
file: 'release-gate.md',
|
|
35
|
+
useWhen: 'Preparing a release recommendation or promotion gate',
|
|
36
|
+
priority: 0.7,
|
|
32
37
|
},
|
|
33
38
|
],
|
|
34
39
|
});
|
|
35
|
-
|
|
40
|
+
var invariants_js_1 = require("../invariants.js");
|
|
41
|
+
Object.defineProperty(exports, "AI_AGENT_OPS_HARD_BANS", { enumerable: true, get: function () { return invariants_js_1.AI_AGENT_OPS_HARD_BANS; } });
|
|
36
42
|
exports.getAllPlaybookMarkdown = playbooks.getAllPlaybookMarkdown;
|
|
37
43
|
exports.AI_AGENT_OPS_CORE_PLAYBOOK = playbooks.CORE_PLAYBOOK;
|
|
38
44
|
exports.AI_AGENT_OPS_TOPIC_PLAYBOOKS = playbooks.TOPIC_PLAYBOOKS;
|
|
45
|
+
exports.AI_AGENT_OPS_TOPIC_META = playbooks.TOPIC_META;
|
|
39
46
|
function registerAiAgentOpsPlaybook(server) {
|
|
40
47
|
playbooks.registerPlaybooks(server);
|
|
41
48
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-developer structured prompt invariants (SSOT for capsules + HARD_BANS projection).
|
|
3
|
+
*/
|
|
4
|
+
export declare const CONTENT_DEVELOPER_INVARIANTS: readonly [{
|
|
5
|
+
readonly id: "no-arbitrary-sql";
|
|
6
|
+
readonly short: "Do not execute arbitrary metric queries, raw SQL, warehouse runs, or saved-chart execution.";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "no-sql-charts";
|
|
9
|
+
readonly short: "Do not author or upsert SQL charts.";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "no-hard-delete-promote";
|
|
12
|
+
readonly short: "Do not hard-delete, rollback, or promote content (use content-governance for promote).";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "no-org-admin";
|
|
15
|
+
readonly short: "Do not perform organization administration or list org-wide projects.";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "no-space-crud";
|
|
18
|
+
readonly short: "Do not create or update spaces — spaces are Terraform / out-of-band; use existing spaces only.";
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "no-space-only-charts";
|
|
21
|
+
readonly short: "Do not create space-only charts for dashboard work — set dashboardSlug to the dashboard shell already created.";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "design-approval";
|
|
24
|
+
readonly short: "Do not call preview_* or write tools for a new dashboard or a material dashboard redesign until a Design Spec (with settled Objective) was presented and the user approved or amended it in-thread.";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "objective-first";
|
|
27
|
+
readonly short: "Do not start writes from a viz-type or all-chart-types checklist alone — settle Objective and insight questions first (an explicit user all-types ask may be the Objective after a one-line restatement).";
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "project-scope";
|
|
30
|
+
readonly short: "Do not call confirm_preview without projectUuid when there is no HTTP X-Lightdash-Project pin (PROJECT_SCOPE_REQUIRED).";
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "tile-targets-filters";
|
|
33
|
+
readonly short: "Do not attach dashboard filters whose target.tableName is absent from a tile explore without excluding that tile (or remapping) via tileTargets.";
|
|
34
|
+
}, {
|
|
35
|
+
readonly id: "dashboard-shell-first";
|
|
36
|
+
readonly short: "Do not treat chart create as done without a dashboard shell and tiles.";
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "no-invent-field-ids";
|
|
39
|
+
readonly short: "Do not invent fieldIds — clone via get_chart_as_code / get_chart or use semantic-layer.";
|
|
40
|
+
}, {
|
|
41
|
+
readonly id: "no-skinny-chart-config";
|
|
42
|
+
readonly short: "Do not invent skinny chartConfig — clone a working as-code body and keep series/layout/encode.";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "no-verify-unless-asked";
|
|
45
|
+
readonly short: "Do not set chart verified or dashboard preserveVerification unless the user explicitly asks (verify permission required).";
|
|
46
|
+
}, {
|
|
47
|
+
readonly id: "preview-confirm-apply";
|
|
48
|
+
readonly short: "Do not apply a write tool without a confirmed, unexpired HMAC previewToken from the matching preview_* tool (confirm_preview unlocks every write; use the new validated token).";
|
|
49
|
+
}, {
|
|
50
|
+
readonly id: "immutable-preview-payload";
|
|
51
|
+
readonly short: "Do not mutate the proposed payload after preview_* (description/name/SQL/metrics/tiles) — apply must reuse the identical proposed body or PREVIEW_STALE (content hash mismatch); any edit requires a new preview_*.";
|
|
52
|
+
}, {
|
|
53
|
+
readonly id: "preview-kind-key-match";
|
|
54
|
+
readonly short: "Do not unlock with a different resource's preview — resourceKind / resourceKey must match the preview exactly.";
|
|
55
|
+
}, {
|
|
56
|
+
readonly id: "validate-not-unlock";
|
|
57
|
+
readonly short: "Do not treat validate_chart / validate_dashboard as a preview unlock — they are saved-UUID health checks only (validate_chart needs chartUuid).";
|
|
58
|
+
}, {
|
|
59
|
+
readonly id: "no-reuse-draft-token";
|
|
60
|
+
readonly short: "Do not reuse a draft previewToken after confirm; re-run preview if the resource drifts (PREVIEW_STALE).";
|
|
61
|
+
}, {
|
|
62
|
+
readonly id: "no-sdd-mcp-click-loops";
|
|
63
|
+
readonly short: "Do not use subagent-driven-development or multi-task writing-plans solely to click MCP preview/confirm/apply for lab boards (e.g. experiments) — after Design Spec approval, run Batch SOP inline in the same session.";
|
|
64
|
+
}, {
|
|
65
|
+
readonly id: "no-secrets";
|
|
66
|
+
readonly short: "Do not reveal secrets, warehouse credentials, or saved SQL chart bodies.";
|
|
67
|
+
}];
|
|
68
|
+
export declare const CONTENT_DEVELOPER_HARD_BANS: string;
|
|
69
|
+
export declare const CONTENT_DEVELOPER_DEFAULT_INVARIANT_IDS: readonly ("no-arbitrary-sql" | "no-sql-charts" | "no-hard-delete-promote" | "no-org-admin" | "no-space-crud" | "no-space-only-charts" | "design-approval" | "objective-first" | "project-scope" | "tile-targets-filters" | "dashboard-shell-first" | "no-invent-field-ids" | "no-skinny-chart-config" | "no-verify-unless-asked" | "preview-confirm-apply" | "immutable-preview-payload" | "preview-kind-key-match" | "validate-not-unlock" | "no-reuse-draft-token" | "no-sdd-mcp-click-loops" | "no-secrets")[];
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Content-developer structured prompt invariants (SSOT for capsules + HARD_BANS projection).
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CONTENT_DEVELOPER_DEFAULT_INVARIANT_IDS = exports.CONTENT_DEVELOPER_HARD_BANS = exports.CONTENT_DEVELOPER_INVARIANTS = void 0;
|
|
7
|
+
const prompt_invariants_js_1 = require("../../lib/prompt-invariants.js");
|
|
8
|
+
exports.CONTENT_DEVELOPER_INVARIANTS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'no-arbitrary-sql',
|
|
11
|
+
short: 'Do not execute arbitrary metric queries, raw SQL, warehouse runs, or saved-chart execution.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'no-sql-charts',
|
|
15
|
+
short: 'Do not author or upsert SQL charts.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'no-hard-delete-promote',
|
|
19
|
+
short: 'Do not hard-delete, rollback, or promote content (use content-governance for promote).',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'no-org-admin',
|
|
23
|
+
short: 'Do not perform organization administration or list org-wide projects.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: 'no-space-crud',
|
|
27
|
+
short: 'Do not create or update spaces — spaces are Terraform / out-of-band; use existing spaces only.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'no-space-only-charts',
|
|
31
|
+
short: 'Do not create space-only charts for dashboard work — set dashboardSlug to the dashboard shell already created.',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'design-approval',
|
|
35
|
+
short: 'Do not call preview_* or write tools for a new dashboard or a material dashboard redesign until a Design Spec (with settled Objective) was presented and the user approved or amended it in-thread.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'objective-first',
|
|
39
|
+
short: 'Do not start writes from a viz-type or all-chart-types checklist alone — settle Objective and insight questions first (an explicit user all-types ask may be the Objective after a one-line restatement).',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'project-scope',
|
|
43
|
+
short: 'Do not call confirm_preview without projectUuid when there is no HTTP X-Lightdash-Project pin (PROJECT_SCOPE_REQUIRED).',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'tile-targets-filters',
|
|
47
|
+
short: 'Do not attach dashboard filters whose target.tableName is absent from a tile explore without excluding that tile (or remapping) via tileTargets.',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'dashboard-shell-first',
|
|
51
|
+
short: 'Do not treat chart create as done without a dashboard shell and tiles.',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'no-invent-field-ids',
|
|
55
|
+
short: 'Do not invent fieldIds — clone via get_chart_as_code / get_chart or use semantic-layer.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'no-skinny-chart-config',
|
|
59
|
+
short: 'Do not invent skinny chartConfig — clone a working as-code body and keep series/layout/encode.',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'no-verify-unless-asked',
|
|
63
|
+
short: 'Do not set chart verified or dashboard preserveVerification unless the user explicitly asks (verify permission required).',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'preview-confirm-apply',
|
|
67
|
+
short: 'Do not apply a write tool without a confirmed, unexpired HMAC previewToken from the matching preview_* tool (confirm_preview unlocks every write; use the new validated token).',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'immutable-preview-payload',
|
|
71
|
+
short: 'Do not mutate the proposed payload after preview_* (description/name/SQL/metrics/tiles) — apply must reuse the identical proposed body or PREVIEW_STALE (content hash mismatch); any edit requires a new preview_*.',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'preview-kind-key-match',
|
|
75
|
+
short: "Do not unlock with a different resource's preview — resourceKind / resourceKey must match the preview exactly.",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'validate-not-unlock',
|
|
79
|
+
short: 'Do not treat validate_chart / validate_dashboard as a preview unlock — they are saved-UUID health checks only (validate_chart needs chartUuid).',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'no-reuse-draft-token',
|
|
83
|
+
short: 'Do not reuse a draft previewToken after confirm; re-run preview if the resource drifts (PREVIEW_STALE).',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'no-sdd-mcp-click-loops',
|
|
87
|
+
short: 'Do not use subagent-driven-development or multi-task writing-plans solely to click MCP preview/confirm/apply for lab boards (e.g. experiments) — after Design Spec approval, run Batch SOP inline in the same session.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'no-secrets',
|
|
91
|
+
short: 'Do not reveal secrets, warehouse credentials, or saved SQL chart bodies.',
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
exports.CONTENT_DEVELOPER_HARD_BANS = (0, prompt_invariants_js_1.formatHardBansProjection)(exports.CONTENT_DEVELOPER_INVARIANTS);
|
|
95
|
+
exports.CONTENT_DEVELOPER_DEFAULT_INVARIANT_IDS = (0, prompt_invariants_js_1.allInvariantIds)(exports.CONTENT_DEVELOPER_INVARIANTS);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure PromptContextSpec builders for content-developer prompts.
|
|
3
|
+
* Shared by registerContentDeveloperPrompts and budget gates.
|
|
4
|
+
*/
|
|
5
|
+
import type { ContentDeveloperPlaybookTopic } from './resources/playbooks.js';
|
|
6
|
+
import type { PromptContextSpec } from '../../lib/prompt-context.js';
|
|
7
|
+
/** Topics for create/improve dashboard prompts (shell + design + viz). */
|
|
8
|
+
export declare const DASHBOARD_CHART_TOPIC_IDS: readonly ["dashboards", "dashboard-design", "chart-types"];
|
|
9
|
+
/** Topics for refactor (shell + design). */
|
|
10
|
+
export declare const DASHBOARD_TOPIC_IDS: readonly ["dashboards", "dashboard-design"];
|
|
11
|
+
/** Topics for publish (shell + viz). */
|
|
12
|
+
export declare const DASHBOARD_PUBLISH_TOPIC_IDS: readonly ["dashboards", "chart-types"];
|
|
13
|
+
/** Manifest `when` comes from TOPIC_META.useWhen (optional `when` on entries). */
|
|
14
|
+
export declare const WRITE_RECOVERY_TOPICS: readonly [{
|
|
15
|
+
readonly topic: "recovery/preview-stale";
|
|
16
|
+
}, {
|
|
17
|
+
readonly topic: "recovery/preview-required";
|
|
18
|
+
}, {
|
|
19
|
+
readonly topic: "recovery/dashboard-diff";
|
|
20
|
+
}];
|
|
21
|
+
/** Thin stop gate — Phase Design / Objective detail lives in dashboard-design playbook. */
|
|
22
|
+
export declare const DESIGN_SPEC_STOP = "Emit a Design Spec (dashboard-design Phase Design: Objective + tiles with tableName citing insights + filter apply/exclude plan), then **stop until the user proceeds / approves / amends** before any preview_* or write. If the user already gave an explicit all-chart-types (or multi-viz) checklist + goal + projectUuid, a one-line Objective restatement is enough \u2014 treat that as approval after restating once. Always pass projectUuid on confirm_preview and apply when there is no HTTP pin.";
|
|
23
|
+
export type CreateDashboardPromptArgs = {
|
|
24
|
+
goal: string;
|
|
25
|
+
projectUuid?: string;
|
|
26
|
+
spaceUuid?: string;
|
|
27
|
+
chartReferences?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Production PromptContextSpec for `create_dashboard` (task + topics + recovery).
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildCreateDashboardPromptSpec(args: CreateDashboardPromptArgs): PromptContextSpec<ContentDeveloperPlaybookTopic>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pure PromptContextSpec builders for content-developer prompts.
|
|
4
|
+
* Shared by registerContentDeveloperPrompts and budget gates.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DESIGN_SPEC_STOP = exports.WRITE_RECOVERY_TOPICS = exports.DASHBOARD_PUBLISH_TOPIC_IDS = exports.DASHBOARD_TOPIC_IDS = exports.DASHBOARD_CHART_TOPIC_IDS = void 0;
|
|
8
|
+
exports.buildCreateDashboardPromptSpec = buildCreateDashboardPromptSpec;
|
|
9
|
+
const schema_fields_js_1 = require("../../../tools/lib/schema-fields.js");
|
|
10
|
+
const invariants_js_1 = require("./invariants.js");
|
|
11
|
+
const TOPIC_DASHBOARDS = 'dashboards';
|
|
12
|
+
const TOPIC_DASHBOARD_DESIGN = 'dashboard-design';
|
|
13
|
+
const TOPIC_CHART_TYPES = 'chart-types';
|
|
14
|
+
/** Topics for create/improve dashboard prompts (shell + design + viz). */
|
|
15
|
+
exports.DASHBOARD_CHART_TOPIC_IDS = [
|
|
16
|
+
TOPIC_DASHBOARDS,
|
|
17
|
+
TOPIC_DASHBOARD_DESIGN,
|
|
18
|
+
TOPIC_CHART_TYPES,
|
|
19
|
+
];
|
|
20
|
+
/** Topics for refactor (shell + design). */
|
|
21
|
+
exports.DASHBOARD_TOPIC_IDS = [TOPIC_DASHBOARDS, TOPIC_DASHBOARD_DESIGN];
|
|
22
|
+
/** Topics for publish (shell + viz). */
|
|
23
|
+
exports.DASHBOARD_PUBLISH_TOPIC_IDS = [TOPIC_DASHBOARDS, TOPIC_CHART_TYPES];
|
|
24
|
+
/** Manifest `when` comes from TOPIC_META.useWhen (optional `when` on entries). */
|
|
25
|
+
exports.WRITE_RECOVERY_TOPICS = [
|
|
26
|
+
{ topic: 'recovery/preview-stale' },
|
|
27
|
+
{ topic: 'recovery/preview-required' },
|
|
28
|
+
{ topic: 'recovery/dashboard-diff' },
|
|
29
|
+
];
|
|
30
|
+
/** Thin stop gate — Phase Design / Objective detail lives in dashboard-design playbook. */
|
|
31
|
+
exports.DESIGN_SPEC_STOP = 'Emit a Design Spec (dashboard-design Phase Design: Objective + tiles with tableName citing insights + filter apply/exclude plan), then **stop until the user proceeds / approves / amends** before any preview_* or write. If the user already gave an explicit all-chart-types (or multi-viz) checklist + goal + projectUuid, a one-line Objective restatement is enough — treat that as approval after restating once. Always pass projectUuid on confirm_preview and apply when there is no HTTP pin.';
|
|
32
|
+
/**
|
|
33
|
+
* Production PromptContextSpec for `create_dashboard` (task + topics + recovery).
|
|
34
|
+
*/
|
|
35
|
+
function buildCreateDashboardPromptSpec(args) {
|
|
36
|
+
const { goal, projectUuid, spaceUuid, chartReferences } = args;
|
|
37
|
+
return {
|
|
38
|
+
task: `Create a new dashboard for this goal:
|
|
39
|
+
|
|
40
|
+
${goal}
|
|
41
|
+
|
|
42
|
+
${(0, schema_fields_js_1.formatPromptProjectUuidLine)(projectUuid)}
|
|
43
|
+
|
|
44
|
+
Target existing space: ${spaceUuid !== null && spaceUuid !== void 0 ? spaceUuid : '(resolve with lightdash_list_spaces / lightdash_get_space — never create a space)'}.
|
|
45
|
+
Chart hints: ${chartReferences !== null && chartReferences !== void 0 ? chartReferences : '(none provided — discover seeds via get_space / short search_content, then get_chart_as_code)'}.
|
|
46
|
+
|
|
47
|
+
1. If the goal is vague on audience / decisions / what to understand: ask **2–4 clarifying questions** before a Spec (do not invent a viz-type checklist).
|
|
48
|
+
2. Read-only discovery only (project/space/seeds).
|
|
49
|
+
3. ${exports.DESIGN_SPEC_STOP} Multi-viz / all chart types only if the user explicitly asked (see dashboards + chart-types playbooks). For explicit all-types work, keep primary insights decision-oriented and place redundant required forms in a labeled validation appendix; never weaken semantic field requirements.
|
|
50
|
+
4. After approval: follow playbooks (preview→confirm→apply; reuse the **exact** preview payload on apply — do not tidy description/name between confirm and create).
|
|
51
|
+
5. Report dashboard UUID/slug, tiles, filters, chart UUIDs — reject space-only orphans or untiled dashboard-owned charts.`,
|
|
52
|
+
invariantIds: invariants_js_1.CONTENT_DEVELOPER_DEFAULT_INVARIANT_IDS,
|
|
53
|
+
requiredTopics: exports.DASHBOARD_CHART_TOPIC_IDS,
|
|
54
|
+
recoveryTopics: exports.WRITE_RECOVERY_TOPICS,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP prompts for content-developer workflows.
|
|
2
|
+
* MCP prompts for content-developer workflows (progressive-disclosure context).
|
|
3
3
|
*
|
|
4
|
-
* Procedure detail lives in playbooks (
|
|
4
|
+
* Procedure detail lives in playbooks (manifest / selective embed via policy).
|
|
5
5
|
* Prompt bodies stay goal/input-specific — do not restate entire SOPs here.
|
|
6
6
|
*/
|
|
7
|
+
import type { RegisterPromptsOptions } from '../../types.js';
|
|
7
8
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
8
|
-
export declare function registerContentDeveloperPrompts(server: McpServer): void;
|
|
9
|
+
export declare function registerContentDeveloperPrompts(server: McpServer, options?: RegisterPromptsOptions): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* MCP prompts for content-developer workflows.
|
|
3
|
+
* MCP prompts for content-developer workflows (progressive-disclosure context).
|
|
4
4
|
*
|
|
5
|
-
* Procedure detail lives in playbooks (
|
|
5
|
+
* Procedure detail lives in playbooks (manifest / selective embed via policy).
|
|
6
6
|
* Prompt bodies stay goal/input-specific — do not restate entire SOPs here.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -10,149 +10,143 @@ exports.registerContentDeveloperPrompts = registerContentDeveloperPrompts;
|
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-deprecated -- matches content-reader prompt registration pattern */
|
|
11
11
|
const zod_1 = require("zod");
|
|
12
12
|
const schema_fields_js_1 = require("../../../tools/lib/schema-fields.js");
|
|
13
|
-
const
|
|
13
|
+
const prompt_context_js_1 = require("../../lib/prompt-context.js");
|
|
14
|
+
const invariants_js_1 = require("./invariants.js");
|
|
15
|
+
const prompt_specs_js_1 = require("./prompt-specs.js");
|
|
14
16
|
const playbooks_js_1 = require("./resources/playbooks.js");
|
|
15
|
-
const
|
|
17
|
+
const TOPIC_CHART_TYPES = 'chart-types';
|
|
18
|
+
const TOPIC_TABLE_CALCULATIONS = 'table-calculations';
|
|
19
|
+
const TOPIC_CONTENT_MOVE = 'content-move';
|
|
20
|
+
const bindPromptContext = (0, prompt_context_js_1.bindProfilePromptContext)({
|
|
21
|
+
invariants: invariants_js_1.CONTENT_DEVELOPER_INVARIANTS,
|
|
16
22
|
core: playbooks_js_1.CONTENT_DEVELOPER_CORE_PLAYBOOK,
|
|
17
23
|
topics: playbooks_js_1.CONTENT_DEVELOPER_TOPIC_PLAYBOOKS,
|
|
24
|
+
topicMeta: playbooks_js_1.CONTENT_DEVELOPER_TOPIC_META,
|
|
18
25
|
});
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const TOPIC_DASHBOARD_DESIGN = 'dashboard-design';
|
|
23
|
-
const TOPIC_CHART_TYPES = 'chart-types';
|
|
24
|
-
const TOPIC_TABLE_CALCULATIONS = 'table-calculations';
|
|
25
|
-
const DASHBOARD_CHART_TOPIC_IDS = [
|
|
26
|
-
TOPIC_DASHBOARDS,
|
|
27
|
-
TOPIC_DASHBOARD_DESIGN,
|
|
28
|
-
TOPIC_CHART_TYPES,
|
|
29
|
-
];
|
|
30
|
-
const DASHBOARD_TOPIC_IDS = [TOPIC_DASHBOARDS, TOPIC_DASHBOARD_DESIGN];
|
|
31
|
-
const DASHBOARD_PUBLISH_TOPIC_IDS = [TOPIC_DASHBOARDS, TOPIC_CHART_TYPES];
|
|
32
|
-
/** Thin stop gate — Phase Design / Objective detail lives in dashboard-design playbook. */
|
|
33
|
-
const DESIGN_SPEC_STOP = 'Emit a Design Spec (dashboard-design Phase Design: Objective + tiles with tableName citing insights + filter apply/exclude plan), then **stop until the user proceeds / approves / amends** before any preview_* or write. If the user already gave an explicit all-chart-types (or multi-viz) checklist + goal + projectUuid, a one-line Objective restatement is enough — treat that as approval after restating once. Always pass projectUuid on confirm_preview and apply when there is no HTTP pin.';
|
|
34
|
-
function registerContentDeveloperPrompts(server) {
|
|
26
|
+
function registerContentDeveloperPrompts(server, options) {
|
|
27
|
+
const promptContext = bindPromptContext(options === null || options === void 0 ? void 0 : options.promptContextPolicy);
|
|
28
|
+
const invariantIds = invariants_js_1.CONTENT_DEVELOPER_DEFAULT_INVARIANT_IDS;
|
|
35
29
|
server.registerPrompt('create_dashboard', {
|
|
36
30
|
title: 'Create dashboard',
|
|
37
31
|
description: 'Clarify Objective → Design Spec (await approval) → shell → dashboardSlug charts → tiles / filters',
|
|
38
32
|
argsSchema: {
|
|
39
33
|
goal: zod_1.z.string(),
|
|
40
|
-
projectUuid:
|
|
34
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
41
35
|
spaceUuid: zod_1.z.string().optional(),
|
|
42
36
|
chartReferences: zod_1.z.string().optional(),
|
|
43
37
|
},
|
|
44
|
-
}, ({ goal, projectUuid, spaceUuid, chartReferences }) =>
|
|
45
|
-
|
|
46
|
-
${goal}
|
|
47
|
-
|
|
48
|
-
Project UUID: ${projectUuid !== null && projectUuid !== void 0 ? projectUuid : PROJECT_UUID_HINT}.
|
|
49
|
-
|
|
50
|
-
${playbooks_js_1.CONTENT_DEVELOPER_HARD_BANS}
|
|
51
|
-
|
|
52
|
-
Target existing space: ${spaceUuid !== null && spaceUuid !== void 0 ? spaceUuid : '(resolve with lightdash_list_spaces / lightdash_get_space — never create a space)'}.
|
|
53
|
-
Chart hints: ${chartReferences !== null && chartReferences !== void 0 ? chartReferences : '(none provided — discover seeds via get_space / short search_content, then get_chart_as_code)'}.
|
|
54
|
-
|
|
55
|
-
1. If the goal is vague on audience / decisions / what to understand: ask **2–4 clarifying questions** before a Spec (do not invent a viz-type checklist).
|
|
56
|
-
2. Read-only discovery only (project/space/seeds).
|
|
57
|
-
3. ${DESIGN_SPEC_STOP} Multi-viz / all chart types only if the user explicitly asked (see dashboards + chart-types playbooks). For explicit all-types work, keep primary insights decision-oriented and place redundant required forms in a labeled validation appendix; never weaken semantic field requirements.
|
|
58
|
-
4. After approval: follow embedded playbooks (preview→confirm→apply; reuse the **exact** preview payload on apply — do not tidy description/name between confirm and create).
|
|
59
|
-
5. Report dashboard UUID/slug, tiles, filters, chart UUIDs — reject space-only orphans or untiled dashboard-owned charts.`, DASHBOARD_CHART_TOPIC_IDS));
|
|
38
|
+
}, ({ goal, projectUuid, spaceUuid, chartReferences }) => promptContext((0, prompt_specs_js_1.buildCreateDashboardPromptSpec)({ goal, projectUuid, spaceUuid, chartReferences })));
|
|
60
39
|
server.registerPrompt('improve_dashboard', {
|
|
61
40
|
title: 'Improve dashboard',
|
|
62
41
|
description: 'Clarify Objective if needed → Design Spec delta (await approval) → layout / filters / tiles',
|
|
63
42
|
argsSchema: {
|
|
64
43
|
dashboardUuidOrSlug: zod_1.z.string(),
|
|
65
44
|
improvementGoal: zod_1.z.string(),
|
|
66
|
-
projectUuid:
|
|
45
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
67
46
|
},
|
|
68
|
-
}, ({ dashboardUuidOrSlug, improvementGoal, projectUuid }) =>
|
|
47
|
+
}, ({ dashboardUuidOrSlug, improvementGoal, projectUuid }) => promptContext({
|
|
48
|
+
task: `Improve dashboard ${dashboardUuidOrSlug} for this goal:
|
|
69
49
|
|
|
70
50
|
${improvementGoal}
|
|
71
51
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
${playbooks_js_1.CONTENT_DEVELOPER_HARD_BANS}
|
|
52
|
+
${(0, schema_fields_js_1.formatPromptProjectUuidLine)(projectUuid)}
|
|
75
53
|
|
|
76
54
|
1. Inspect with lightdash_get_dashboard first (tile x/y/w/h may be missing — rebuild layout intentionally).
|
|
77
55
|
2. If the improvement goal is vague on decisions / insights: ask **2–4 clarifying questions** before a Spec delta.
|
|
78
|
-
3. For material layout/tile/filter changes (including professionalize): ${DESIGN_SPEC_STOP} Use the **Improve / professionalize Spec delta** (keep / drop / rename + cull) in dashboard-design. Trivial one-shot renames the user already specified may skip the stop. Multi-viz / all chart types only if the user explicitly asked.
|
|
79
|
-
4. After approval: follow
|
|
80
|
-
Report what changed (tiles, filters, chart UUIDs), any untiled dashboard-owned leftovers (content-governance for soft-delete), and validation warnings.`,
|
|
56
|
+
3. For material layout/tile/filter changes (including professionalize): ${prompt_specs_js_1.DESIGN_SPEC_STOP} Use the **Improve / professionalize Spec delta** (keep / drop / rename + cull) in dashboard-design. Trivial one-shot renames the user already specified may skip the stop. Multi-viz / all chart types only if the user explicitly asked.
|
|
57
|
+
4. After approval: follow playbooks (reuse the **exact** preview payload on apply). New charts: get_chart_as_code + dashboardSlug, then tile. Rename tile titles and chart names when stripping demo prefixes.
|
|
58
|
+
Report what changed (tiles, filters, chart UUIDs), any untiled dashboard-owned leftovers (content-governance for soft-delete), and validation warnings.`,
|
|
59
|
+
invariantIds,
|
|
60
|
+
requiredTopics: prompt_specs_js_1.DASHBOARD_CHART_TOPIC_IDS,
|
|
61
|
+
recoveryTopics: prompt_specs_js_1.WRITE_RECOVERY_TOPICS,
|
|
62
|
+
}));
|
|
81
63
|
server.registerPrompt('refactor_dashboard', {
|
|
82
64
|
title: 'Refactor dashboard',
|
|
83
65
|
description: 'Compare versions; Design Spec delta for material changes (await approval), then reconcile',
|
|
84
66
|
argsSchema: {
|
|
85
67
|
dashboardUuidOrSlug: zod_1.z.string(),
|
|
86
68
|
concern: zod_1.z.string().optional(),
|
|
87
|
-
projectUuid:
|
|
69
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
88
70
|
},
|
|
89
|
-
}, ({ dashboardUuidOrSlug, concern, projectUuid }) =>
|
|
90
|
-
|
|
91
|
-
Project UUID: ${projectUuid !== null && projectUuid !== void 0 ? projectUuid : PROJECT_UUID_HINT}.
|
|
71
|
+
}, ({ dashboardUuidOrSlug, concern, projectUuid }) => promptContext({
|
|
72
|
+
task: `Refactor dashboard ${dashboardUuidOrSlug}.
|
|
92
73
|
|
|
93
|
-
${
|
|
74
|
+
${(0, schema_fields_js_1.formatPromptProjectUuidLine)(projectUuid)}
|
|
94
75
|
|
|
95
76
|
Concern: ${concern !== null && concern !== void 0 ? concern : '(general cleanup)'}.
|
|
96
77
|
1. Use lightdash_compare_dashboard_versions before proposing changes.
|
|
97
|
-
2. For material layout/tile/filter changes: ${DESIGN_SPEC_STOP} Trivial one-shot renames may skip the stop.
|
|
98
|
-
3. After approval: follow
|
|
78
|
+
2. For material layout/tile/filter changes: ${prompt_specs_js_1.DESIGN_SPEC_STOP} Trivial one-shot renames may skip the stop.
|
|
79
|
+
3. After approval: follow dashboards + dashboard-design. Do not remove tiles unless the approved Spec or user request allows it.`,
|
|
80
|
+
invariantIds,
|
|
81
|
+
requiredTopics: prompt_specs_js_1.DASHBOARD_TOPIC_IDS,
|
|
82
|
+
recoveryTopics: prompt_specs_js_1.WRITE_RECOVERY_TOPICS,
|
|
83
|
+
}));
|
|
99
84
|
server.registerPrompt('author_chart', {
|
|
100
85
|
title: 'Author chart',
|
|
101
86
|
description: 'Clone a working seed chart (cartesian encode intact); optional dashboardSlug scoping',
|
|
102
87
|
argsSchema: {
|
|
103
88
|
goal: zod_1.z.string(),
|
|
104
|
-
projectUuid:
|
|
89
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
105
90
|
seedChartUuidOrSlug: zod_1.z.string().optional(),
|
|
106
91
|
dashboardSlug: zod_1.z.string().optional(),
|
|
107
92
|
},
|
|
108
|
-
}, ({ goal, projectUuid, seedChartUuidOrSlug, dashboardSlug }) =>
|
|
93
|
+
}, ({ goal, projectUuid, seedChartUuidOrSlug, dashboardSlug }) => promptContext({
|
|
94
|
+
task: `Author a semantic chart for this goal:
|
|
109
95
|
|
|
110
96
|
${goal}
|
|
111
97
|
|
|
112
|
-
|
|
98
|
+
${(0, schema_fields_js_1.formatPromptProjectUuidLine)(projectUuid)}
|
|
113
99
|
Seed chart: ${seedChartUuidOrSlug !== null && seedChartUuidOrSlug !== void 0 ? seedChartUuidOrSlug : '(find a rendering seed on the same tableName via search_content / get_space)'}.
|
|
114
100
|
Dashboard slug: ${dashboardSlug !== null && dashboardSlug !== void 0 ? dashboardSlug : '(omit only for intentional space-owned charts; for dashboard work set dashboardSlug to an existing dashboard shell)'}.
|
|
115
101
|
|
|
116
|
-
${playbooks_js_1.CONTENT_DEVELOPER_HARD_BANS}
|
|
117
|
-
|
|
118
102
|
Follow core + chart-types + table-calculations (clone via get_chart_as_code; preview with top-level slug; keep customDimensions when needed; tile if dashboardSlug set).
|
|
119
103
|
When dashboardSlug is set, the chart must serve a **board insight** from the approved Design Spec — do not invent a viz type for its own sake.
|
|
120
|
-
Report UUID/slug from charts[0].data; note this profile cannot run_chart / prove UI render.`,
|
|
104
|
+
Report UUID/slug from charts[0].data; note this profile cannot run_chart / prove UI render.`,
|
|
105
|
+
invariantIds,
|
|
106
|
+
requiredTopics: [TOPIC_CHART_TYPES, TOPIC_TABLE_CALCULATIONS],
|
|
107
|
+
recoveryTopics: prompt_specs_js_1.WRITE_RECOVERY_TOPICS,
|
|
108
|
+
}));
|
|
121
109
|
server.registerPrompt('move_content', {
|
|
122
110
|
title: 'Move content',
|
|
123
111
|
description: 'Move charts/dashboards into an existing space (no space create/update)',
|
|
124
112
|
argsSchema: {
|
|
125
113
|
goal: zod_1.z.string(),
|
|
126
|
-
projectUuid:
|
|
114
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
127
115
|
spaceReferences: zod_1.z.string().optional(),
|
|
128
116
|
},
|
|
129
|
-
}, ({ goal, projectUuid, spaceReferences }) =>
|
|
117
|
+
}, ({ goal, projectUuid, spaceReferences }) => promptContext({
|
|
118
|
+
task: `Move content between existing spaces for this goal:
|
|
130
119
|
|
|
131
120
|
${goal}
|
|
132
121
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
${playbooks_js_1.CONTENT_DEVELOPER_HARD_BANS}
|
|
122
|
+
${(0, schema_fields_js_1.formatPromptProjectUuidLine)(projectUuid)}
|
|
136
123
|
|
|
137
124
|
Space hints: ${spaceReferences !== null && spaceReferences !== void 0 ? spaceReferences : '(discover with lightdash_list_spaces)'}.
|
|
138
125
|
Follow core + content-move playbooks. Target spaces must already exist.
|
|
139
|
-
Report moved items and target space.`,
|
|
126
|
+
Report moved items and target space.`,
|
|
127
|
+
invariantIds,
|
|
128
|
+
requiredTopics: [TOPIC_CONTENT_MOVE],
|
|
129
|
+
recoveryTopics: prompt_specs_js_1.WRITE_RECOVERY_TOPICS,
|
|
130
|
+
}));
|
|
140
131
|
server.registerPrompt('publish_content', {
|
|
141
132
|
title: 'Publish content',
|
|
142
133
|
description: 'Validate dashboard-scoped authored content before treating it as done',
|
|
143
134
|
argsSchema: {
|
|
144
135
|
contentReferences: zod_1.z.string(),
|
|
145
|
-
projectUuid:
|
|
136
|
+
projectUuid: (0, schema_fields_js_1.optionalProjectUuidField)(),
|
|
146
137
|
},
|
|
147
|
-
}, ({ contentReferences, projectUuid }) =>
|
|
138
|
+
}, ({ contentReferences, projectUuid }) => promptContext({
|
|
139
|
+
task: `Finalize this authored Lightdash content before considering it done:
|
|
148
140
|
|
|
149
141
|
${contentReferences}
|
|
150
142
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
${playbooks_js_1.CONTENT_DEVELOPER_HARD_BANS}
|
|
143
|
+
${(0, schema_fields_js_1.formatPromptProjectUuidLine)(projectUuid)}
|
|
154
144
|
|
|
155
|
-
Done checklist: markdown/description states the **Objective**; tiles map to approved insight questions; every saved filter matches each tile explore or has explicit tileTargets exclude/remap; dashboardSlug on new charts + tiles present; cartesian encode intact; no invented fieldIds. Report untiled dashboard-owned leftovers (soft-delete via content-governance). Follow
|
|
156
|
-
Optionally validate_* (schema/health only). Promote is content-governance, not this profile.`,
|
|
145
|
+
Done checklist: markdown/description states the **Objective**; tiles map to approved insight questions; every saved filter matches each tile explore or has explicit tileTargets exclude/remap; dashboardSlug on new charts + tiles present; cartesian encode intact; no invented fieldIds. Report untiled dashboard-owned leftovers (soft-delete via content-governance). Follow playbooks for encode/map/filter detail. UI runtime not verified on this profile.
|
|
146
|
+
Optionally validate_* (schema/health only). Promote is content-governance, not this profile.`,
|
|
147
|
+
invariantIds,
|
|
148
|
+
requiredTopics: prompt_specs_js_1.DASHBOARD_PUBLISH_TOPIC_IDS,
|
|
149
|
+
recoveryTopics: prompt_specs_js_1.WRITE_RECOVERY_TOPICS,
|
|
150
|
+
}));
|
|
157
151
|
}
|
|
158
152
|
/* eslint-enable @typescript-eslint/no-deprecated */
|