@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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Content-developer — dashboard design
|
|
2
|
+
|
|
3
|
+
URI: `lightdash://playbooks/content-developer/dashboard-design`
|
|
4
|
+
|
|
5
|
+
Composition and quality for usable boards. **Apply writes** (preview → confirm → nested `dashboard:{}` / chart slug) via `lightdash://playbooks/content-developer/dashboards`. Viz shapes via `lightdash://playbooks/content-developer/chart-types`.
|
|
6
|
+
|
|
7
|
+
Official product order: [Creating dashboards](https://docs.lightdash.com/get-started/exploring-data/dashboards) — shell → charts → markdown (optional) → save → filters (optional) → tabs (only if needed).
|
|
8
|
+
|
|
9
|
+
The **Phase Design** gate below is agent planning (chat). After the user approves, mutate in that official product order via MCP tools.
|
|
10
|
+
|
|
11
|
+
## Phase Design (before any write)
|
|
12
|
+
|
|
13
|
+
If the user goal lacks audience, decisions, or insight questions, ask **2–4 clarifying questions** first — then discover and emit the Spec.
|
|
14
|
+
|
|
15
|
+
Read-only discovery is allowed (`get_project`, `list_spaces`, `get_space`, `search_content`, `get_dashboard`, `get_chart` / `get_chart_as_code` for seed picking).
|
|
16
|
+
Do **not** call `preview_*`, `confirm_preview`, or any create/update/duplicate/tile/move tool until the user approves or amends this Design Spec.
|
|
17
|
+
|
|
18
|
+
Emit one Design Spec:
|
|
19
|
+
|
|
20
|
+
1. **Objective** (required before Space / Tiles) — settle what to understand:
|
|
21
|
+
- **Audience** (who)
|
|
22
|
+
- **Decisions** the board supports (why)
|
|
23
|
+
- **Insight questions** — 3–7 numbered (`Q1`…`Qn`) (what to understand)
|
|
24
|
+
- **Primary metrics / dimensions** (how; real fieldIds only after seed discovery, else `TBD pending seed`)
|
|
25
|
+
- **Non-goals** (what this board is _not_)
|
|
26
|
+
2. **Space** — existing `spaceUuid` / `spaceSlug` (never create a space)
|
|
27
|
+
3. **Tiles** — ordered list: reuse chart UUID **or** new chart (name, viz type from chart-types map, seed chart, **`tableName` (explore)**, proposed slug). **Each tile cites an insight id** (e.g. `Q2`). Do **not** propose “all chart types” unless the user explicitly asked.
|
|
28
|
+
4. **Layout sketch** — 36-col grid rows (KPI → trends → breakdowns → table); markdown yes/no
|
|
29
|
+
5. **Filters** — 0–3 shared dimensions; prefer empty `values: []`; `required: true` only if user asked. For each filter: list which tiles it **applies** to vs **excludes**. Prefer **one explore** for the whole filtered board. If a tile’s `tableName` ≠ filter `target.tableName` (and no known equivalent field), mark **exclude**.
|
|
30
|
+
6. **Tabs** — default none (only themes / audiences / 30+ tiles per Lightdash docs)
|
|
31
|
+
7. **Budget** — chart count vs core cap (default ≤8 unless user expands)
|
|
32
|
+
|
|
33
|
+
Then stop and ask: proceed / amend?
|
|
34
|
+
|
|
35
|
+
Approval phrases: proceed, approved, go ahead, looks good, or an explicit amended plan.
|
|
36
|
+
|
|
37
|
+
**Explicit multi-viz / all-types asks:** When the user already named the full viz checklist + analysis goal + `projectUuid`, a one-line Objective restatement + tile→insight map **is** the Spec. Treat that ask as approval after you restate once (do not re-ask clarifying questions that restate their checklist). Still skip **map** when no lat/lon and say so.
|
|
38
|
+
|
|
39
|
+
### Improve / professionalize Spec delta
|
|
40
|
+
|
|
41
|
+
Use this instead of inventing a full new-board Spec when the user asks to **professionalize**, **clean up**, or **redesign** an existing dashboard — or when the board looks like a viz showcase (`[loop*]`, “all chart types”, many redundant status/revenue charts).
|
|
42
|
+
|
|
43
|
+
1. Clarify Objective if still vague (2–4 questions).
|
|
44
|
+
2. Emit a **Spec delta**, then stop for proceed / amend:
|
|
45
|
+
- **Objective** (+ 3–7 insight ids `Q1`…`Qn`)
|
|
46
|
+
- **Keep / drop / rename** table — each **keep** cites an insight id; **drop** lists charts leaving the board; **rename** strips demo prefixes
|
|
47
|
+
- **Layout sketch** (36-col; KPI → trends → breakdowns → table)
|
|
48
|
+
- **Filters** — usually keep existing empty-value filters; do not invent `required: true`. Re-check explore↔filter: exclude (or remount) tiles whose `tableName` cannot use each filter’s `target`
|
|
49
|
+
3. **Cull rule:** one primary viz per insight. Drop duplicates (e.g. area if line answers the same Q; pie/funnel/treemap if bar already covers status mix) unless the user explicitly asked for multi-viz.
|
|
50
|
+
4. Markdown overview should **restate the approved Objective** ([docs](https://docs.lightdash.com/get-started/exploring-data/dashboards#add-markdown-or-other-content)).
|
|
51
|
+
5. After apply: list chart UUIDs still dashboard-owned (`dashboardSlug`) but **not** tiled. Soft-delete those leftovers via **content-governance** — not this persona ([dashboard-owned charts stay off search/spaces](https://docs.lightdash.com/get-started/exploring-data/dashboards#create-a-new-chart)).
|
|
52
|
+
|
|
53
|
+
## Layout
|
|
54
|
+
|
|
55
|
+
- One board, one **Objective**. Prefer **KPI / overview** → **trends** → **breakdowns** → **table**.
|
|
56
|
+
- Grid width max **36**. Half-width ≈ `w: 18`. Full-width table/markdown ≈ `w: 36`.
|
|
57
|
+
- `get_dashboard` tile summaries often **omit `x/y/w/h`** — always compose the full layout intentionally; do not assume round-trip of positions.
|
|
58
|
+
- Prefer dashboard-owned charts (`dashboardSlug`) for one-off tiles ([docs](https://docs.lightdash.com/get-started/exploring-data/dashboards#create-a-new-chart)).
|
|
59
|
+
- Reuse existing charts as tiles when they already fit.
|
|
60
|
+
- Suggested skeleton after markdown (`y:0`, `h:3`, `w:36`): KPIs at `y:3`, then rows of two half-width charts (`h:8–9`), table last full-width.
|
|
61
|
+
|
|
62
|
+
## Markdown (optional)
|
|
63
|
+
|
|
64
|
+
Use for purpose, definitions, or caveats — not decorative HTML. Prefer an overview tile that **restates the approved Objective** (audience, decisions, insight questions) so viewers understand the board ([docs](https://docs.lightdash.com/get-started/exploring-data/dashboards#add-markdown-or-other-content)).
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
type: markdown
|
|
68
|
+
x: 0
|
|
69
|
+
y: 0
|
|
70
|
+
w: 36
|
|
71
|
+
h: 3
|
|
72
|
+
properties:
|
|
73
|
+
title: Overview
|
|
74
|
+
content: |
|
|
75
|
+
Short markdown restating the Objective. Prefer plain text over HTML/CSS.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Skip fancy HTML/iframe unless the user asks. Loom / heading tiles: only if requested.
|
|
79
|
+
|
|
80
|
+
## Filters (optional)
|
|
81
|
+
|
|
82
|
+
0–3 shared **dimensions**. Prefer **one explore** for all tiles that share dashboard filters. Filters guide: [Using filters](https://docs.lightdash.com/guides/limiting-data-using-filters). Official as-code targeting: [dashboard-reference `tileTargets`](https://github.com/lightdash/lightdash/blob/main/skills/developing-in-lightdash/resources/dashboard-reference.md).
|
|
83
|
+
|
|
84
|
+
- Prefer **empty-value** saved filters so viewers choose ([saved filters](https://docs.lightdash.com/guides/limiting-data-using-filters#adding-saved-filters-to-your-dashboard)).
|
|
85
|
+
- Prefer **clone** `filters` from `get_dashboard` on a working board over inventing rules.
|
|
86
|
+
- Do **not** set `required: true` unless the user asks (locks load until a value is set; cannot combine with a default).
|
|
87
|
+
- Auto-apply needs matching `fieldId` + `tableName` on the tile’s explore. Omitting `tileTargets` is fine when **every** tile shares that table.
|
|
88
|
+
- Multi-explore: **exclude** foreign tiles (do not leave ambiguous). Advanced: remap equivalent fields via `tileTargets` — only when the user needs the filter on both explores.
|
|
89
|
+
- Shape: `filters: { dimensions: [], metrics: [], tableCalculations: [] }` (OpenAPI `DashboardFilters`).
|
|
90
|
+
|
|
91
|
+
**Same-explore boards** — empty-value example (omit `tileTargets`):
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
filters:
|
|
95
|
+
dimensions:
|
|
96
|
+
- id: filter-orders-status
|
|
97
|
+
label: Order status
|
|
98
|
+
operator: equals
|
|
99
|
+
values: []
|
|
100
|
+
disabled: false
|
|
101
|
+
required: false
|
|
102
|
+
target:
|
|
103
|
+
fieldId: orders_status
|
|
104
|
+
tableName: orders
|
|
105
|
+
- id: filter-orders-month
|
|
106
|
+
label: Order month
|
|
107
|
+
operator: equals
|
|
108
|
+
values: []
|
|
109
|
+
disabled: false
|
|
110
|
+
required: false
|
|
111
|
+
target:
|
|
112
|
+
fieldId: orders_order_date_month
|
|
113
|
+
tableName: orders
|
|
114
|
+
metrics: []
|
|
115
|
+
tableCalculations: []
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Exclude a foreign explore tile** (MCP / native API — keys are **tile UUIDs**; as-code YAML uses tile slugs instead):
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
# After tiles exist: get_dashboard → copy each tile's uuid for exclusions
|
|
122
|
+
filters:
|
|
123
|
+
dimensions:
|
|
124
|
+
- id: filter-orders-status
|
|
125
|
+
label: Order status
|
|
126
|
+
operator: equals
|
|
127
|
+
values: []
|
|
128
|
+
disabled: false
|
|
129
|
+
required: false
|
|
130
|
+
target:
|
|
131
|
+
fieldId: orders_status
|
|
132
|
+
tableName: orders
|
|
133
|
+
tileTargets:
|
|
134
|
+
'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee': false # customers-explore LTV tile uuid
|
|
135
|
+
metrics: []
|
|
136
|
+
tableCalculations: []
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Apply order:** compose tiles first → if excluding, `get_dashboard` for tile UUIDs → then `preview_dashboard_changes` → `confirm_preview` → `update_dashboard({ dashboard: { filters, tiles?, name?, … } })` (second update is fine when UUIDs were not known on first tile write).
|
|
140
|
+
|
|
141
|
+
## Tabs
|
|
142
|
+
|
|
143
|
+
Default: **no tabs**. Use only for themes / audiences / 30+ tiles ([docs tip](https://docs.lightdash.com/get-started/exploring-data/dashboards#add-tabs)).
|
|
144
|
+
|
|
145
|
+
## Done criteria
|
|
146
|
+
|
|
147
|
+
- Objective was settled (and Design Spec approved) before writes.
|
|
148
|
+
- Every tile maps to an insight question from the Spec.
|
|
149
|
+
- Charts are tiled (ownership alone is not enough).
|
|
150
|
+
- Filters honor explore↔filter plan (single-explore auto-apply, or `tileTargets` exclude/remap for foreign tiles).
|
|
151
|
+
- After a cull / professionalize: report untiled dashboard-owned leftovers; hand soft-delete to content-governance.
|
|
152
|
+
- Markdown / filters only if intentional — summarize them in the report.
|
|
153
|
+
- This persona cannot `run_chart`; note UI render was not verified here.
|
|
@@ -1,55 +1,103 @@
|
|
|
1
|
-
# Content-developer — dashboards (and charts
|
|
1
|
+
# Content-developer — dashboards (and dashboard-owned charts)
|
|
2
2
|
|
|
3
3
|
URI: `lightdash://playbooks/content-developer/dashboards`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Order matters:** clarify **Objective** if needed, emit a **Design Spec** and get user approval first, then create the **dashboard shell**, then create charts with `dashboardSlug` set to that dashboard, then attach tiles (+ filters with explore↔filter / `tileTargets` via dashboard-design). Official Lightdash as-code: `dashboardSlug` scopes a chart to a dashboard (it will not appear as an independent space chart). Promote via **content-governance**.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
get_project → list_spaces → discover seeds (read-only)
|
|
9
|
+
→ clarify Objective if goal is vague
|
|
10
|
+
→ Design Spec (Objective + tiles with tableName citing insights + filter apply/exclude) → user approve ← STOP: no writes yet
|
|
11
|
+
→ create_dashboard (empty / markdown shell) ← record dashboard slug
|
|
12
|
+
→ reuse tiles OR get_chart_as_code → create_chart (dashboardSlug set)
|
|
13
|
+
→ update_dashboard (full tile array)
|
|
14
|
+
→ optional: get_dashboard for tile UUIDs → update_dashboard (filters + tileTargets excludes)
|
|
15
|
+
```
|
|
6
16
|
|
|
7
17
|
## Discover
|
|
8
18
|
|
|
9
|
-
|
|
19
|
+
1. `list_spaces` → existing `spaceUuid` (dashboards) / `spaceSlug` (chart as-code).
|
|
20
|
+
2. `search_content` with **short** tokens (`orders`, space slug). Multi-word brand phrases often return empty — use `get_space`. Short tokens can also return noisy org-wide hits — prefer `get_space` inventory for seeds.
|
|
21
|
+
3. Prefer **reuse** of existing charts as tiles when they already fit.
|
|
22
|
+
4. For new charts: find a **working seed** on the same `tableName`; never invent fieldIds.
|
|
23
|
+
5. Dashboard-owned charts (`dashboardSlug` set) **do not** appear as independent space charts in `get_space` / typical search — keep the UUIDs you create, or re-open the dashboard.
|
|
24
|
+
|
|
25
|
+
## Create dashboard shell (step 1 — after Design Spec approval)
|
|
26
|
+
|
|
27
|
+
Only after Phase Design approval (see `lightdash://playbooks/content-developer/dashboard-design`). Then:
|
|
28
|
+
|
|
29
|
+
1. Resolve target **existing** `spaceUuid`.
|
|
30
|
+
2. `preview_dashboard_changes` without `dashboardUuidOrSlug`, `changes: { name, description?, spaceUuid, tabs: [], tiles: [] }` → `resourceKey` is literal **`new`**.
|
|
31
|
+
3. `confirm_preview` (`resourceKind: 'dashboard'`, `resourceKey: 'new'`, **`projectUuid`**).
|
|
32
|
+
4. `create_dashboard` with **`dashboard: { … }`** — same fields as `changes` (nested object; not flat tool args). Empty or markdown-only `tiles`. **Pass `projectUuid`.**
|
|
33
|
+
5. Record returned **`slug`** and **`uuid`** — required as `dashboardSlug` for new charts.
|
|
34
|
+
|
|
35
|
+
## New chart for that dashboard (step 2)
|
|
36
|
+
|
|
37
|
+
Semantic as-code only. Prefer clone, not invent.
|
|
38
|
+
|
|
39
|
+
### Seed SOP
|
|
40
|
+
|
|
41
|
+
1. Prefer **reuse** of an existing chart as a tile when it already fits.
|
|
42
|
+
2. Else `search_content` / `get_space` → pick a **rendering** seed on the same `tableName` (same explore).
|
|
43
|
+
3. `get_chart_as_code` (or `duplicate_chart`) → **keep `chartConfig` structure** (layout + series encode); edit only `name`, `slug`, and `metricQuery` fields that exist on the explore; set `dashboardSlug` = dashboard slug from step 1.
|
|
44
|
+
4. Viz type / encode details: `lightdash://playbooks/content-developer/chart-types`.
|
|
45
|
+
|
|
46
|
+
Then:
|
|
47
|
+
|
|
48
|
+
1. Set `spaceSlug`, `skipSpaceCreate: true`, `version`, `tableName`, `dashboardSlug`.
|
|
49
|
+
2. Every dimension in `metricQuery.dimensions` must appear in viz config (cartesian layout / pie groups / sankey source-target / …) — unused dimensions change SQL GROUP BY and can yield “Results may be incorrect”.
|
|
50
|
+
3. `preview_chart_changes` with top-level **`slug`** + `changes` body → `confirm_preview` (`resourceKey` = that slug, **`projectUuid`**) → `create_chart` / `update_chart` (`slug` + `chart: { … }` matching `changes`, **`projectUuid`**).
|
|
51
|
+
4. Capture `charts[0].data.uuid` immediately for tiling.
|
|
52
|
+
|
|
53
|
+
If fieldIds are unknown → stop; use semantic-layer. Do **not** hand-author minimal cartesian configs (series without `encode.xRef`/`yRef`).
|
|
10
54
|
|
|
11
|
-
|
|
55
|
+
`dashboardSlug` alone does **not** place the chart on the board — step 3 (tiles) is mandatory.
|
|
12
56
|
|
|
13
|
-
|
|
57
|
+
### Multi-viz / “all chart types” boards
|
|
14
58
|
|
|
15
|
-
|
|
16
|
-
- Create: pass `slug` only when the slug is free (`CHART_SLUG_EXISTS` otherwise — then pass `chartUuidOrSlug` and use update).
|
|
17
|
-
- Update: pass `chartUuidOrSlug`; confirm with the preview's UUID `resourceKey` (slug is an alias).
|
|
18
|
-
2. Immediately attach the chart as a tile: `preview_dashboard_changes` with the resulting tiles → `confirm_preview` → `add_dashboard_tile` / `update_dashboard`.
|
|
19
|
-
3. Do not stop after chart UUID alone — the workflow is incomplete until the chart is on a dashboard.
|
|
59
|
+
Only when the user **explicitly** asks for every chart type (or a large multi-viz board)—not the default:
|
|
20
60
|
|
|
21
|
-
|
|
61
|
+
1. Raise the new-chart budget (default ≤8 is too low).
|
|
62
|
+
2. Cover: bar, horizontal bar, line, area, mixed, scatter, pie, funnel, treemap, sankey, table, big_number, gauge; **skip map** if no lat/lon and say so.
|
|
63
|
+
3. One-line Objective is enough when the user already listed the viz checklist + analysis goal; still map each tile to an insight id (or label demo tiles clearly). Treat that explicit ask as Design Spec approval after you restate the checklist once.
|
|
64
|
+
4. **Batch SOP:** create shell → create all charts (`dashboardSlug` set; **≤2** concurrent preview→confirm→apply chains) → capture each `charts[0].data.uuid` → **one** `update_dashboard` with full tiles + optional empty-value filters. Do not interleave tiling with chart creates.
|
|
65
|
+
5. Cap concurrent writes at **≤2** on hosted tunnels — parallel bursts often return HTTP 502.
|
|
22
66
|
|
|
23
|
-
|
|
67
|
+
### Duplicate chart
|
|
24
68
|
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3. `duplicate_chart`
|
|
28
|
-
4.
|
|
69
|
+
1. Preview with `chartUuidOrSlug` = source and `changes` = `{ sourceChartUuidOrSlug, newSlug, newName? }`.
|
|
70
|
+
2. Confirm `resourceKind: 'chart'`, `resourceKey` = **source** UUID (**always pass `projectUuid`**).
|
|
71
|
+
3. `duplicate_chart`, then `update_chart` if needed to set `dashboardSlug` and any metricQuery edits (clone body via `get_chart_as_code` first).
|
|
72
|
+
4. Tile the result onto the dashboard.
|
|
29
73
|
|
|
30
|
-
##
|
|
74
|
+
## Attach tiles (step 3)
|
|
31
75
|
|
|
32
|
-
1.
|
|
33
|
-
2.
|
|
34
|
-
3. `preview_dashboard_changes` (resourceKey
|
|
35
|
-
4. For each tile: preview the full tile array → `confirm_preview` → `add_dashboard_tile` (or compose via `update_dashboard`).
|
|
76
|
+
1. Compose the **full** tile array (markdown + `saved_chart` with `x/y/w/h`; grid width max **36**).
|
|
77
|
+
2. Require `properties.savedChartUuid` from the chart create/duplicate result (OpenAPI `CreateDashboardChartTile`). Optional `chartSlug` is metadata only — do not tile with slug alone.
|
|
78
|
+
3. `preview_dashboard_changes` → `confirm_preview` (`resourceKey` = dashboard **UUID**, plus **`projectUuid`**) → `update_dashboard` with nested `dashboard: { name?, tiles, tabs, filters? }` matching preview `changes`.
|
|
36
79
|
|
|
37
|
-
|
|
80
|
+
Avoid N single-tile round-trips when you already know the layout. If preview `diff.removed` includes **`tiles`/`tabs`/`filters`**, re-preview with those arrays included — do not treat that as harmless noise (see core).
|
|
38
81
|
|
|
39
|
-
|
|
40
|
-
2. `confirm_preview` with `resourceKind: 'dashboard'` and `resourceKey` = source UUID.
|
|
41
|
-
3. `duplicate_dashboard` with the same source UUID / proposed fields (apply re-reads source baseline; duplicate stays in the source space).
|
|
42
|
-
4. To relocate: `preview_content_move` → `confirm_preview` → `move_content` into an existing space.
|
|
82
|
+
Layout, optional markdown, optional filters → `lightdash://playbooks/content-developer/dashboard-design`.
|
|
43
83
|
|
|
44
|
-
## Improve / refactor dashboard
|
|
84
|
+
## Improve / refactor / duplicate dashboard
|
|
45
85
|
|
|
46
|
-
1. `get_dashboard` (
|
|
47
|
-
2.
|
|
48
|
-
3.
|
|
49
|
-
4.
|
|
86
|
+
1. `get_dashboard` for structure (layout may be incomplete — rebuild intentionally).
|
|
87
|
+
2. For **material** layout / tile / filter changes (including professionalize / clean up / redesign): emit a Design Spec **delta** per `lightdash://playbooks/content-developer/dashboard-design` (**Improve / professionalize Spec delta** — keep / drop / rename + cull) and await user approval before any `preview_*` / write. Trivial one-shot renames the user already specified may skip the stop.
|
|
88
|
+
3. **Naming when professionalizing:** update tile `properties.title` **and** chart `name` via `update_chart` (strip demo prefixes like `[loop3]`); keep slug unless the user asks to rename.
|
|
89
|
+
4. `compare_dashboard_versions` when reconciling drift.
|
|
90
|
+
5. New charts mid-improve still follow shell-exists → `dashboardSlug` → tiles.
|
|
91
|
+
6. Duplicate dashboard: preview `{ newName? }` → confirm source UUID → `duplicate_dashboard`; relocate with content-move if needed.
|
|
50
92
|
|
|
51
93
|
## Done criteria
|
|
52
94
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
95
|
+
- Objective clarified when needed; Design Spec approved (or amended) before writes for new boards / material redesigns.
|
|
96
|
+
- Dashboard shell existed **before** new charts were created.
|
|
97
|
+
- Every new chart has `dashboardSlug` set to that dashboard (not space-only orphans).
|
|
98
|
+
- Every new/updated chart is referenced by a dashboard tile that maps to an insight question.
|
|
99
|
+
- Filter↔explore plan from Spec honored (single-explore auto-apply, or foreign tiles excluded / remapped via `tileTargets`).
|
|
100
|
+
- After cull / professionalize: report untiled dashboard-owned chart UUIDs; soft-delete via **content-governance** (not this persona).
|
|
101
|
+
- Report dashboard UUID/slug, tiles, and chart UUIDs/slugs; note execution was unavailable on this persona.
|
|
102
|
+
- Do not promote from here — content-governance when ready.
|
|
103
|
+
- Layout / optional markdown / optional filters quality → `lightdash://playbooks/content-developer/dashboard-design`.
|
|
@@ -4,10 +4,12 @@ URI: `lightdash://playbooks/content-developer`
|
|
|
4
4
|
|
|
5
5
|
Workflow-scoped playbooks (always load **core** plus one topic with a prompt):
|
|
6
6
|
|
|
7
|
-
| Topic
|
|
8
|
-
|
|
|
9
|
-
| Core (gates & bans)
|
|
10
|
-
| Dashboards &
|
|
11
|
-
|
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
| Topic | URI |
|
|
8
|
+
| ------------------------------------------------------------ | ---------------------------------------------------------- |
|
|
9
|
+
| Core (gates & bans) | `lightdash://playbooks/content-developer/core` |
|
|
10
|
+
| Dashboards & dashboard-owned charts | `lightdash://playbooks/content-developer/dashboards` |
|
|
11
|
+
| Dashboard design (Design Spec + layout / markdown / filters) | `lightdash://playbooks/content-developer/dashboard-design` |
|
|
12
|
+
| Chart types (cartesian + pie/funnel/…) | `lightdash://playbooks/content-developer/chart-types` |
|
|
13
|
+
| Content move | `lightdash://playbooks/content-developer/content-move` |
|
|
14
|
+
|
|
15
|
+
**Authoring order:** clarify Objective → Design Spec → approve → dashboard shell → charts with `dashboardSlug` → tiles (+ optional filters; prefer one explore or `tileTargets` exclude by tile UUID). Always pass **`projectUuid`** on `confirm_preview` and apply when there is no HTTP pin. Clone via `get_chart_as_code`; never invent fieldIds or skinny `chartConfig` (cartesian series need `encode.xRef`/`yRef`). Multi-viz / all chart types only when the user explicitly asks (batch: shell → charts ≤2 parallel → one tile update). Cap concurrent writes at ≤2 on hosted tunnels. Spaces are Terraform / out-of-band (`list_spaces` / `get_space` only).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Content-developer multi-playbook resources (core + topics + index).
|
|
3
3
|
*/
|
|
4
4
|
import type { McpServer } from '@modelcontextprotocol/server';
|
|
5
|
-
export type ContentDeveloperPlaybookTopic = 'content-move' | 'dashboards';
|
|
5
|
+
export type ContentDeveloperPlaybookTopic = 'chart-types' | 'content-move' | 'dashboard-design' | 'dashboards';
|
|
6
6
|
export declare const CONTENT_DEVELOPER_HARD_BANS: string;
|
|
7
7
|
export declare const getAllPlaybookMarkdown: () => string;
|
|
8
8
|
export declare const CONTENT_DEVELOPER_CORE_PLAYBOOK: import("../../../lib/playbook-resources.js").EmbeddedPlaybook;
|
|
@@ -9,24 +9,43 @@ const playbook_resources_js_1 = require("../../../lib/playbook-resources.js");
|
|
|
9
9
|
const playbooks = (0, playbook_resources_js_1.definePersonaPlaybooks)({
|
|
10
10
|
personaId: 'content-developer',
|
|
11
11
|
moduleDir: __dirname,
|
|
12
|
-
hardBans: `Do not execute arbitrary metric queries, raw SQL, or
|
|
12
|
+
hardBans: `Do not execute arbitrary metric queries, raw SQL, warehouse runs, or saved-chart execution.
|
|
13
13
|
Do not author or upsert SQL charts.
|
|
14
|
-
Do not hard-delete, rollback, or promote content.
|
|
15
|
-
Do not perform organization administration.
|
|
16
|
-
Do not create or update spaces — spaces are
|
|
17
|
-
Do not
|
|
18
|
-
Do not
|
|
19
|
-
Do not
|
|
20
|
-
Do not
|
|
14
|
+
Do not hard-delete, rollback, or promote content (use content-governance for promote).
|
|
15
|
+
Do not perform organization administration or list org-wide projects.
|
|
16
|
+
Do not create or update spaces — spaces are Terraform / out-of-band; use existing spaces only.
|
|
17
|
+
Do not create space-only charts for dashboard work — set dashboardSlug to the dashboard shell already created.
|
|
18
|
+
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.
|
|
19
|
+
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).
|
|
20
|
+
Do not call confirm_preview without projectUuid when there is no HTTP X-Lightdash-Project pin (PROJECT_SCOPE_REQUIRED).
|
|
21
|
+
Do not attach dashboard filters whose target.tableName is absent from a tile explore without excluding that tile (or remapping) via tileTargets.
|
|
22
|
+
Do not treat chart create as done without a dashboard shell and tiles.
|
|
23
|
+
Do not invent fieldIds — clone via get_chart_as_code / get_chart or use semantic-layer.
|
|
24
|
+
Do not invent skinny chartConfig — clone a working as-code body and keep series/layout/encode.
|
|
25
|
+
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).
|
|
26
|
+
Do not treat validate_chart / validate_dashboard as a preview unlock — they are saved-UUID health checks only (validate_chart needs chartUuid).
|
|
27
|
+
Do not reuse a draft previewToken after confirm; re-run preview if the resource drifts (PREVIEW_STALE).
|
|
21
28
|
Do not reveal secrets, warehouse credentials, or hidden SQL.`,
|
|
22
|
-
coreDescription: 'Hard bans, tools, project scope, and
|
|
29
|
+
coreDescription: 'Hard bans, tools, project scope, preview gate, and apply pitfalls',
|
|
23
30
|
topics: [
|
|
24
31
|
{
|
|
25
32
|
id: 'dashboards',
|
|
26
33
|
title: 'Content-developer dashboards playbook',
|
|
27
|
-
description: 'Dashboard
|
|
34
|
+
description: 'Dashboard shell first, then dashboardSlug-scoped charts as tiles',
|
|
28
35
|
file: 'dashboards.md',
|
|
29
36
|
},
|
|
37
|
+
{
|
|
38
|
+
id: 'dashboard-design',
|
|
39
|
+
title: 'Content-developer dashboard-design playbook',
|
|
40
|
+
description: 'Objective-first Design Spec, explore↔filter / tileTargets, layout, markdown, filters, tabs',
|
|
41
|
+
file: 'dashboard-design.md',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'chart-types',
|
|
45
|
+
title: 'Content-developer chart-types playbook',
|
|
46
|
+
description: 'Insight-first viz pick; cartesian encode checklist; UI intent → as-code map',
|
|
47
|
+
file: 'chart-types.md',
|
|
48
|
+
},
|
|
30
49
|
{
|
|
31
50
|
id: 'content-move',
|
|
32
51
|
title: 'Content-developer content-move playbook',
|
|
@@ -25,7 +25,7 @@ One mutating tool call → one resource → one elicitation → one API call. No
|
|
|
25
25
|
|
|
26
26
|
## Phase 0 — Resolve project
|
|
27
27
|
|
|
28
|
-
1. Require a resolved project: HTTP `X-Lightdash-Project` pin or explicit `projectUuid` on the tool
|
|
28
|
+
1. Require a resolved project: HTTP `X-Lightdash-Project` pin or explicit `projectUuid` on the tool.
|
|
29
29
|
2. Stop when project scope is unresolved (`PROJECT_SCOPE_REQUIRED`).
|
|
30
30
|
3. Never enumerate organization projects from this persona (no `list_projects`).
|
|
31
31
|
|
|
@@ -25,7 +25,7 @@ Soft-delete a single dashboard after human form elicitation, or promote a dashbo
|
|
|
25
25
|
- `decision`: `confirm_promote` or `do_not_promote`
|
|
26
26
|
- `confirmationText`: exact dashboard name from the elicitation message
|
|
27
27
|
6. On accept, server re-fetches dashboard + promoteDiff. Drift → `RESOURCE_CHANGED` — re-invoke for a fresh elicitation.
|
|
28
|
-
7. On success, report the promotion receipt. Do not claim chart-only or SQL-chart promote (not available on MCP). Upstream project is configured in Data Ops, not chosen via tool args.
|
|
28
|
+
7. On success, report the promotion receipt. Do not claim chart-only or SQL-chart promote (not available on MCP). Upstream project is configured in Data Ops, not chosen via tool args. If `LIGHTDASH_TOOLS_ALLOWED_PROJECT_UUIDS` is set, the upstream target must be on that list (including for `get_dashboard_promote_diff`); otherwise expect `PROJECT_NOT_AVAILABLE`.
|
|
29
29
|
|
|
30
30
|
## Soft-delete confirmation form fields
|
|
31
31
|
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
import type { PersonaDefinition } from '../../types.js';
|
|
5
5
|
export declare const CONTENT_READER_PERSONA_PATH: "/content-reader/v1/mcp";
|
|
6
6
|
/** Explicit allowlist — must stay a deliberate subset of the shared registry. */
|
|
7
|
-
export declare const CONTENT_READER_TOOL_IDS: readonly ["get_project", "search_content", "list_spaces", "get_space", "get_dashboard", "get_chart", "list_project_parameters", "get_project_parameters", "explain_content", "run_chart", "run_dashboard_tile", "get_query_result", "cancel_query"];
|
|
7
|
+
export declare const CONTENT_READER_TOOL_IDS: readonly ["get_project", "search_content", "list_spaces", "get_space", "get_dashboard", "get_chart", "list_project_parameters", "get_project_parameters", "explain_content", "run_chart", "export_chart_image", "run_dashboard_tile", "get_query_result", "cancel_query"];
|
|
8
8
|
export declare const contentReaderPersona: PersonaDefinition;
|