@lightdash-tools/common 0.7.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.
Files changed (71) hide show
  1. package/dist/argument-validation.js +20 -2
  2. package/dist/argument-validation.test.js +22 -0
  3. package/dist/audit.d.ts +29 -9
  4. package/dist/audit.js +53 -9
  5. package/dist/audit.test.js +51 -24
  6. package/dist/env.d.ts +1 -1
  7. package/dist/env.js +2 -2
  8. package/dist/index.d.ts +1 -3
  9. package/dist/index.js +6 -8
  10. package/dist/operations/agent-safe.d.ts +1 -3
  11. package/dist/operations/agent-safe.js +2 -9
  12. package/dist/operations/ai-agents.js +118 -30
  13. package/dist/operations/cli-content.d.ts +5 -0
  14. package/dist/operations/cli-content.js +71 -0
  15. package/dist/operations/client-coverage.d.ts +119 -0
  16. package/dist/operations/client-coverage.js +137 -0
  17. package/dist/operations/client-coverage.test.d.ts +1 -0
  18. package/dist/operations/client-coverage.test.js +22 -0
  19. package/dist/operations/content-developer.d.ts +2 -0
  20. package/dist/operations/content-developer.js +471 -0
  21. package/dist/operations/content-governance.d.ts +7 -0
  22. package/dist/operations/content-governance.js +98 -0
  23. package/dist/operations/content-reader.d.ts +2 -0
  24. package/dist/operations/content-reader.js +197 -0
  25. package/dist/operations/index.d.ts +10 -3
  26. package/dist/operations/index.js +20 -2
  27. package/dist/operations/organization-audit.d.ts +2 -0
  28. package/dist/operations/organization-audit.js +273 -0
  29. package/dist/operations/parity.test.js +12 -11
  30. package/dist/operations/registry.d.ts +9 -1
  31. package/dist/operations/registry.js +77 -2
  32. package/dist/operations/registry.test.js +39 -11
  33. package/dist/operations/semantic-layer.d.ts +6 -0
  34. package/dist/operations/semantic-layer.js +154 -0
  35. package/dist/operations/types.d.ts +29 -12
  36. package/dist/operations/types.js +64 -29
  37. package/dist/operations/types.test.js +33 -45
  38. package/dist/operations/users.d.ts +2 -2
  39. package/dist/operations/users.js +8 -10
  40. package/dist/safety.d.ts +8 -2
  41. package/dist/safety.js +22 -4
  42. package/dist/safety.test.js +29 -6
  43. package/dist/types/index.d.ts +12 -0
  44. package/dist/types/index.js +29 -0
  45. package/package.json +2 -1
  46. package/src/argument-validation.test.ts +31 -0
  47. package/src/argument-validation.ts +20 -2
  48. package/src/audit.test.ts +70 -30
  49. package/src/audit.ts +88 -12
  50. package/src/env.ts +1 -1
  51. package/src/index.ts +5 -9
  52. package/src/operations/agent-safe.ts +2 -12
  53. package/src/operations/ai-agents.ts +123 -31
  54. package/src/operations/cli-content.ts +79 -0
  55. package/src/operations/client-coverage.test.ts +23 -0
  56. package/src/operations/client-coverage.ts +153 -0
  57. package/src/operations/content-developer.ts +501 -0
  58. package/src/operations/content-governance.ts +110 -0
  59. package/src/operations/content-reader.ts +212 -0
  60. package/src/operations/index.ts +25 -2
  61. package/src/operations/organization-audit.ts +293 -0
  62. package/src/operations/parity.test.ts +12 -14
  63. package/src/operations/registry.test.ts +41 -9
  64. package/src/operations/registry.ts +86 -2
  65. package/src/operations/semantic-layer.ts +166 -0
  66. package/src/operations/types.test.ts +38 -76
  67. package/src/operations/types.ts +112 -47
  68. package/src/operations/users.ts +9 -11
  69. package/src/safety.test.ts +32 -6
  70. package/src/safety.ts +26 -4
  71. package/src/types/index.ts +13 -0
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ /**
3
+ * Catalog operation id → LightdashClient method path (ADR-0013 Phase 4).
4
+ * Composed MCP workflows use `composed:<primaryMethod>` when no single client method exists.
5
+ * Ledger-only MCP tools (no LightdashClient call) use `ledger:<token>`.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.OPERATION_CLIENT_METHOD_MAP = void 0;
9
+ exports.getClientMethodForOperation = getClientMethodForOperation;
10
+ const CLIENT_CHARTS_UPSERT_AS_CODE = 'v1.charts.upsertChartAsCode';
11
+ const CLIENT_CHARTS_GET_AS_CODE = 'v1.charts.getChartsAsCode';
12
+ const CLIENT_DASHBOARDS_V2_UPDATE = 'v2.dashboards.updateDashboard';
13
+ const CLIENT_CONTENT_SEARCH = 'v2.content.searchContent';
14
+ const LEDGER_PREVIEW = 'ledger:preview';
15
+ /**
16
+ * Hard coverage map: every catalog operation id must appear here.
17
+ * Values are `v1.*` / `v2.*` client method paths, `composed:…` for multi-call tools,
18
+ * or `ledger:…` for MCP-local ledger tools with no client method.
19
+ */
20
+ exports.OPERATION_CLIENT_METHOD_MAP = {
21
+ // ai-agents
22
+ 'ai-agents.admin.agents.list': 'v1.aiAgents.listAdminAgents',
23
+ 'ai-agents.admin.threads.list': 'v1.aiAgents.getAdminThreads',
24
+ 'ai-agents.admin.settings.get': 'v1.aiAgents.getAiOrganizationSettings',
25
+ 'ai-agents.admin.settings.update': 'v1.aiAgents.updateAiOrganizationSettings',
26
+ 'ai-agents.project.agents.list': 'v1.aiAgents.listAgents',
27
+ 'ai-agents.project.agents.get': 'v1.aiAgents.getAgent',
28
+ 'ai-agents.project.agents.create': 'v1.aiAgents.createAgent',
29
+ 'ai-agents.project.agents.update': 'v1.aiAgents.updateAgent',
30
+ 'ai-agents.project.agents.delete': 'v1.aiAgents.deleteAgent',
31
+ 'ai-agents.project.agents.evaluate-readiness': 'v1.aiAgents.evaluateAgentReadiness',
32
+ 'ai-agents.project.agents.suggestions': 'v1.aiAgents.getAgentSuggestions',
33
+ 'ai-agents.project.agents.models': 'v1.aiAgents.getAgentModelOptions',
34
+ 'ai-agents.project.explore-access-summary': 'v1.aiAgents.getExploreAccessSummary',
35
+ 'ai-agents.project.threads.list': 'v1.aiAgents.listAgentThreads',
36
+ 'ai-agents.project.threads.get': 'v1.aiAgents.getAgentThread',
37
+ 'ai-agents.project.threads.start': 'v1.aiAgents.startConversation',
38
+ 'ai-agents.project.threads.continue': 'v1.aiAgents.continueConversation',
39
+ 'ai-agents.project.evaluations.list': 'v1.aiAgents.listEvaluations',
40
+ 'ai-agents.project.evaluations.get': 'v1.aiAgents.getEvaluation',
41
+ 'ai-agents.project.evaluations.create': 'v1.aiAgents.createEvaluation',
42
+ 'ai-agents.project.evaluations.update': 'v1.aiAgents.updateEvaluation',
43
+ 'ai-agents.project.evaluations.append': 'v1.aiAgents.appendToEvaluation',
44
+ 'ai-agents.project.evaluations.delete': 'v1.aiAgents.deleteEvaluation',
45
+ 'ai-agents.project.evaluations.run': 'v1.aiAgents.runEvaluation',
46
+ 'ai-agents.project.evaluations.runs.list': 'v1.aiAgents.listEvaluationRuns',
47
+ 'ai-agents.project.evaluations.runs.get': 'v1.aiAgents.getEvaluationRunResults',
48
+ // users
49
+ 'users.members.list': 'v1.users.listMembers',
50
+ 'users.members.get': 'v1.users.getMemberByUuid',
51
+ 'users.members.delete': 'v1.users.deleteMember',
52
+ // semantic-layer
53
+ 'semantic.projects.list': 'v1.projects.listProjects',
54
+ 'semantic.projects.get': 'v1.projects.getProject',
55
+ 'semantic.explores.list': 'v1.explores.listExplores',
56
+ 'semantic.explores.get': 'v1.explores.getExplore',
57
+ 'semantic.explores.list_dimensions': 'v1.explores.listDimensions',
58
+ 'semantic.explores.get_field_lineage': 'v1.explores.getFieldLineage',
59
+ 'semantic.metrics.list': 'v1.metrics.listMetrics',
60
+ 'semantic.metrics.get': 'v1.metrics.getMetric',
61
+ 'semantic.query.compile': 'v1.query.compileQuery',
62
+ // organization-audit
63
+ 'org-audit.org.profile.get': 'v1.organizations.getCurrentOrganization',
64
+ 'org-audit.members.list': 'v1.users.listMembers',
65
+ 'org-audit.members.get': 'v1.users.getMemberByUuid',
66
+ 'org-audit.groups.list': 'v1.groups.listGroups',
67
+ 'org-audit.projects.list': 'v1.projects.listProjects',
68
+ 'org-audit.roles.assignments.list': 'v2.organizationRoles.listRoleAssignments',
69
+ 'org-audit.roles.list': 'v2.organizationRoles.getRoles',
70
+ 'org-audit.roles.get': 'v2.organizationRoles.getRole',
71
+ 'org-audit.project.roles.list': 'v2.projectRoleAssignments.listAssignments',
72
+ 'org-audit.project.access.list': 'v1.projectAccess.listProjectAccess',
73
+ 'org-audit.space.access.list': 'composed:v1.spaces.listSpacesInProject+v1.spaces.getSpace',
74
+ 'org-audit.access.resolve': 'composed:v2.organizationRoles.listRoleAssignments+v2.projectRoleAssignments.listAssignments',
75
+ 'org-audit.content.list': CLIENT_CONTENT_SEARCH,
76
+ 'org-audit.dashboards.meta.get': 'v2.dashboards.getDashboard',
77
+ 'org-audit.validation.list': 'v2.validation.listValidationResults',
78
+ 'org-audit.analytics.user-activity.get': 'v1.analytics.getUserActivity',
79
+ 'org-audit.schedulers.list': 'v1.schedulers.listSchedulers',
80
+ 'org-audit.schedulers.get': 'v1.schedulers.getScheduler',
81
+ // content-reader
82
+ 'content-reader.content.search': CLIENT_CONTENT_SEARCH,
83
+ 'content-reader.spaces.list': 'v1.spaces.listSpacesInProject',
84
+ 'content-reader.spaces.get': 'v1.spaces.getSpace',
85
+ 'content-reader.dashboards.get': 'v2.dashboards.getDashboard',
86
+ 'content-reader.charts.get': 'v2.charts.getSavedChart',
87
+ 'content-reader.parameters.list': 'v2.parameters.listParameters',
88
+ 'content-reader.parameters.get': 'v2.parameters.getParameters',
89
+ 'content-reader.content.explain': 'composed:v2.charts.getSavedChart+v2.dashboards.getDashboard',
90
+ 'content-reader.charts.run': 'v2.query.runChartQuery',
91
+ 'content-reader.charts.export-image': 'composed:v1.charts.exportChartImagePng',
92
+ 'content-reader.dashboards.run-tile': 'v2.query.runDashboardChartQuery',
93
+ 'content-reader.query.result.get': 'v2.query.getAsyncQueryResults',
94
+ 'content-reader.query.cancel': 'v2.query.cancelAsyncQuery',
95
+ // content-developer
96
+ 'content-developer.preview.chart': 'composed:v2.charts.getSavedChart',
97
+ 'content-developer.preview.dashboard': 'composed:v2.dashboards.getDashboard',
98
+ 'content-developer.preview.content-move': LEDGER_PREVIEW,
99
+ 'content-developer.charts.get-as-code': CLIENT_CHARTS_GET_AS_CODE,
100
+ 'content-developer.charts.validate': 'v1.validation.validateChart',
101
+ 'content-developer.dashboards.validate': 'v1.validation.validateDashboard',
102
+ 'content-developer.preview.confirm': LEDGER_PREVIEW,
103
+ 'content-developer.charts.compare-versions': 'composed:v2.charts.getSavedChart+v1.charts.getChartHistory+v1.charts.getChartVersion',
104
+ 'content-developer.dashboards.compare-versions': 'composed:v2.dashboards.getDashboard+v1.dashboards.getDashboardHistory+v1.dashboards.getDashboardVersion',
105
+ 'content-developer.charts.create': CLIENT_CHARTS_UPSERT_AS_CODE,
106
+ 'content-developer.charts.update': CLIENT_CHARTS_UPSERT_AS_CODE,
107
+ 'content-developer.charts.duplicate': `composed:${CLIENT_CHARTS_GET_AS_CODE}+${CLIENT_CHARTS_UPSERT_AS_CODE}`,
108
+ 'content-developer.dashboards.create': 'v1.dashboards.createDashboard',
109
+ 'content-developer.dashboards.update': CLIENT_DASHBOARDS_V2_UPDATE,
110
+ 'content-developer.dashboards.duplicate': 'v1.dashboards.createDashboard',
111
+ 'content-developer.dashboards.tiles.add': CLIENT_DASHBOARDS_V2_UPDATE,
112
+ 'content-developer.dashboards.tiles.move': CLIENT_DASHBOARDS_V2_UPDATE,
113
+ 'content-developer.dashboards.tiles.remove': CLIENT_DASHBOARDS_V2_UPDATE,
114
+ 'content-developer.dashboards.tiles.resize': CLIENT_DASHBOARDS_V2_UPDATE,
115
+ 'content-developer.spaces.create': 'v1.spaces.createSpace',
116
+ 'content-developer.spaces.update': 'v1.spaces.updateSpace',
117
+ 'content-developer.content.move': 'v2.content.bulkMoveContent',
118
+ // content-governance (ADR-0015 / ADR-0017)
119
+ 'content-governance.charts.delete': 'v2.charts.deleteSavedChart',
120
+ 'content-governance.dashboards.delete': 'v2.dashboards.deleteDashboard',
121
+ 'content-governance.dashboards.promote-diff': 'v1.dashboards.getDashboardPromoteDiff',
122
+ 'content-governance.dashboards.promote': 'v1.dashboards.promoteDashboard',
123
+ 'content-governance.content.permanent-delete': 'v2.content.permanentlyDeleteContent',
124
+ // cli content
125
+ 'cli.charts.list': CLIENT_CHARTS_GET_AS_CODE,
126
+ 'cli.charts.code.list': CLIENT_CHARTS_GET_AS_CODE,
127
+ 'cli.charts.code.upsert': CLIENT_CHARTS_UPSERT_AS_CODE,
128
+ 'cli.dashboards.list': 'v1.dashboards.listDashboards',
129
+ 'cli.projects.validate.run': 'v1.validation.validateProject',
130
+ 'cli.projects.validate.results': 'v2.validation.listValidationResults',
131
+ };
132
+ function getClientMethodForOperation(operationId) {
133
+ if (operationId in exports.OPERATION_CLIENT_METHOD_MAP) {
134
+ return exports.OPERATION_CLIENT_METHOD_MAP[operationId];
135
+ }
136
+ return undefined;
137
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const client_coverage_1 = require("./client-coverage");
5
+ const registry_1 = require("./registry");
6
+ (0, vitest_1.describe)('operation client coverage', () => {
7
+ (0, vitest_1.it)('maps every catalogued operation to a client method or composed ref', () => {
8
+ const missing = [];
9
+ for (const operation of (0, registry_1.listOperations)()) {
10
+ const method = (0, client_coverage_1.getClientMethodForOperation)(operation.id);
11
+ if (method === undefined || method.trim().length === 0) {
12
+ missing.push(operation.id);
13
+ }
14
+ }
15
+ (0, vitest_1.expect)(missing).toEqual([]);
16
+ });
17
+ (0, vitest_1.it)('does not leave stale coverage entries for removed operations', () => {
18
+ const catalogIds = new Set((0, registry_1.listOperations)().map((operation) => operation.id));
19
+ const stale = Object.keys(client_coverage_1.OPERATION_CLIENT_METHOD_MAP).filter((id) => !catalogIds.has(id));
20
+ (0, vitest_1.expect)(stale).toEqual([]);
21
+ });
22
+ });
@@ -0,0 +1,2 @@
1
+ import type { OperationDescriptor } from './types';
2
+ export declare const CONTENT_DEVELOPER_OPERATIONS: readonly OperationDescriptor[];
@@ -0,0 +1,471 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTENT_DEVELOPER_OPERATIONS = void 0;
4
+ /**
5
+ * Content-developer operations in the shared operation catalog (ADR-0014).
6
+ * Hybrid authoring surface: chart as-code upsert, dashboard REST create/update,
7
+ * MCP-composed tile layout, and bulk content move into existing spaces.
8
+ * Space create/update are client-only (spaces managed out-of-band, e.g. Terraform).
9
+ * Preview -> validate -> apply is enforced by the persona policy layer, not here.
10
+ */
11
+ const safety_1 = require("../safety");
12
+ const types_1 = require("./types");
13
+ const PROFILE_CONTENT_DEVELOPER = 'content-developer';
14
+ const API_V1 = '/api/v1';
15
+ const API_V2 = '/api/v2';
16
+ const WRITE_NONDESTRUCTIVE_IMPACT = 'write-nondestructive';
17
+ const PREVIEW_DIFF_SUMMARY = 'Compute an in-memory diff and issue an HMAC-signed previewToken (no upstream preview API)';
18
+ const TILE_READ_SUMMARY = 'Read the current tile array (no per-tile REST route exists)';
19
+ const op_preview_chart_changes = (0, types_1.defineOperation)({
20
+ id: 'content-developer.preview.chart',
21
+ summary: 'Preview unsaved chart edits by diffing against the current saved definition',
22
+ http: { method: 'GET', path: `${API_V2}/projects/{projectUuid}/saved/{chartUuidOrSlug}` },
23
+ authorization: { safetyImpact: 'read' },
24
+ sensitivity: 'none',
25
+ mcp: {
26
+ toolName: 'preview_chart_changes',
27
+ annotations: safety_1.READ_ONLY_DEFAULT,
28
+ taskSupport: { exposed: true, taskEligible: false },
29
+ },
30
+ workflow: [
31
+ {
32
+ method: 'GET',
33
+ path: `${API_V2}/projects/{projectUuid}/saved/{chartUuidOrSlug}`,
34
+ summary: 'Read the current saved chart definition',
35
+ },
36
+ {
37
+ method: 'GET',
38
+ path: `${API_V2}/projects/{projectUuid}/saved/{chartUuidOrSlug}`,
39
+ summary: PREVIEW_DIFF_SUMMARY,
40
+ },
41
+ ],
42
+ profiles: [PROFILE_CONTENT_DEVELOPER],
43
+ });
44
+ const op_preview_dashboard_changes = (0, types_1.defineOperation)({
45
+ id: 'content-developer.preview.dashboard',
46
+ summary: 'Preview unsaved dashboard edits by diffing against the current saved definition',
47
+ http: {
48
+ method: 'GET',
49
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
50
+ },
51
+ authorization: { safetyImpact: 'read' },
52
+ sensitivity: 'none',
53
+ mcp: {
54
+ toolName: 'preview_dashboard_changes',
55
+ annotations: safety_1.READ_ONLY_DEFAULT,
56
+ taskSupport: { exposed: true, taskEligible: false },
57
+ },
58
+ workflow: [
59
+ {
60
+ method: 'GET',
61
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
62
+ summary: 'Read the current saved dashboard definition',
63
+ },
64
+ {
65
+ method: 'GET',
66
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
67
+ summary: PREVIEW_DIFF_SUMMARY,
68
+ },
69
+ ],
70
+ profiles: [PROFILE_CONTENT_DEVELOPER],
71
+ });
72
+ const op_preview_content_move = (0, types_1.defineOperation)({
73
+ id: 'content-developer.preview.content-move',
74
+ summary: 'Preview a bulk content move into an existing space (issues an HMAC-signed previewToken)',
75
+ http: { method: 'GET', path: `${API_V2}/content` },
76
+ authorization: { safetyImpact: 'read' },
77
+ sensitivity: 'none',
78
+ mcp: {
79
+ toolName: 'preview_content_move',
80
+ annotations: safety_1.READ_ONLY_DEFAULT,
81
+ taskSupport: { exposed: true, taskEligible: false },
82
+ },
83
+ workflow: [
84
+ {
85
+ method: 'GET',
86
+ path: `${API_V2}/content`,
87
+ summary: PREVIEW_DIFF_SUMMARY,
88
+ },
89
+ ],
90
+ profiles: [PROFILE_CONTENT_DEVELOPER],
91
+ });
92
+ const op_get_chart_as_code = (0, types_1.defineOperation)({
93
+ id: 'content-developer.charts.get-as-code',
94
+ summary: 'Get a chart in as-code (upsert) shape for cloning chartConfig/metricQuery before dashboard-scoped create',
95
+ http: { method: 'GET', path: `${API_V1}/projects/{projectUuid}/code/charts` },
96
+ authorization: { safetyImpact: 'read' },
97
+ sensitivity: 'none',
98
+ mcp: {
99
+ toolName: 'get_chart_as_code',
100
+ annotations: safety_1.READ_ONLY_DEFAULT,
101
+ taskSupport: { exposed: true, taskEligible: false },
102
+ },
103
+ profiles: [PROFILE_CONTENT_DEVELOPER],
104
+ });
105
+ const op_validate_chart = (0, types_1.defineOperation)({
106
+ id: 'content-developer.charts.validate',
107
+ summary: "Validate a saved chart's fields against its underlying explore",
108
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/validate/chart/{chartUuid}` },
109
+ authorization: { safetyImpact: 'read' },
110
+ sensitivity: 'none',
111
+ mcp: {
112
+ toolName: 'validate_chart',
113
+ annotations: safety_1.READ_ONLY_DEFAULT,
114
+ taskSupport: { exposed: true, taskEligible: false },
115
+ },
116
+ profiles: [PROFILE_CONTENT_DEVELOPER],
117
+ });
118
+ const op_validate_dashboard = (0, types_1.defineOperation)({
119
+ id: 'content-developer.dashboards.validate',
120
+ summary: "Validate a saved dashboard's fields against its underlying explores",
121
+ http: {
122
+ method: 'POST',
123
+ path: `${API_V1}/projects/{projectUuid}/validate/dashboard/{dashboardUuid}`,
124
+ },
125
+ authorization: { safetyImpact: 'read' },
126
+ sensitivity: 'none',
127
+ mcp: {
128
+ toolName: 'validate_dashboard',
129
+ annotations: safety_1.READ_ONLY_DEFAULT,
130
+ taskSupport: { exposed: true, taskEligible: false },
131
+ },
132
+ profiles: [PROFILE_CONTENT_DEVELOPER],
133
+ });
134
+ const op_compare_chart_versions = (0, types_1.defineOperation)({
135
+ id: 'content-developer.charts.compare-versions',
136
+ summary: 'Compare two chart version-history entries within the resolved project scope',
137
+ http: { method: 'GET', path: `${API_V1}/saved/{chartUuid}/history` },
138
+ authorization: { safetyImpact: 'read' },
139
+ sensitivity: 'none',
140
+ mcp: {
141
+ toolName: 'compare_chart_versions',
142
+ annotations: safety_1.READ_ONLY_DEFAULT,
143
+ taskSupport: { exposed: true, taskEligible: false },
144
+ },
145
+ workflow: [
146
+ {
147
+ method: 'GET',
148
+ path: `${API_V2}/projects/{projectUuid}/saved/{chartUuid}`,
149
+ summary: 'Verify the chart belongs to the resolved project scope',
150
+ },
151
+ { method: 'GET', path: `${API_V1}/saved/{chartUuid}/history`, summary: 'List chart versions' },
152
+ {
153
+ method: 'GET',
154
+ path: `${API_V1}/saved/{chartUuid}/version/{versionUuid}`,
155
+ summary: 'Fetch each compared version',
156
+ },
157
+ ],
158
+ profiles: [PROFILE_CONTENT_DEVELOPER],
159
+ });
160
+ const op_compare_dashboard_versions = (0, types_1.defineOperation)({
161
+ id: 'content-developer.dashboards.compare-versions',
162
+ summary: 'Compare two dashboard version-history entries within the resolved project scope',
163
+ http: { method: 'GET', path: `${API_V1}/dashboards/{dashboardUuidOrSlug}/history` },
164
+ authorization: { safetyImpact: 'read' },
165
+ sensitivity: 'none',
166
+ mcp: {
167
+ toolName: 'compare_dashboard_versions',
168
+ annotations: safety_1.READ_ONLY_DEFAULT,
169
+ taskSupport: { exposed: true, taskEligible: false },
170
+ },
171
+ workflow: [
172
+ {
173
+ method: 'GET',
174
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
175
+ summary: 'Verify the dashboard belongs to the resolved project scope',
176
+ },
177
+ {
178
+ method: 'GET',
179
+ path: `${API_V1}/dashboards/{dashboardUuidOrSlug}/history`,
180
+ summary: 'List dashboard versions',
181
+ },
182
+ {
183
+ method: 'GET',
184
+ path: `${API_V1}/dashboards/{dashboardUuidOrSlug}/version/{versionUuid}`,
185
+ summary: 'Fetch each compared version',
186
+ },
187
+ ],
188
+ profiles: [PROFILE_CONTENT_DEVELOPER],
189
+ });
190
+ const op_confirm_preview = (0, types_1.defineOperation)({
191
+ id: 'content-developer.preview.confirm',
192
+ summary: 'Confirm a bound preview for create/duplicate/tile/content-move flows that have no upstream validate API',
193
+ http: { method: 'GET', path: `${API_V2}/content` },
194
+ authorization: { safetyImpact: 'read' },
195
+ sensitivity: 'none',
196
+ mcp: {
197
+ toolName: 'confirm_preview',
198
+ annotations: safety_1.READ_ONLY_DEFAULT,
199
+ taskSupport: { exposed: true, taskEligible: false },
200
+ },
201
+ profiles: [PROFILE_CONTENT_DEVELOPER],
202
+ });
203
+ const op_create_chart = (0, types_1.defineOperation)({
204
+ id: 'content-developer.charts.create',
205
+ summary: 'Create a chart from code representation (as-code upsert by slug)',
206
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/code/charts/{slug}` },
207
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
208
+ sensitivity: 'none',
209
+ mcp: {
210
+ toolName: 'create_chart',
211
+ annotations: safety_1.WRITE_IDEMPOTENT,
212
+ taskSupport: { exposed: true, taskEligible: false },
213
+ },
214
+ profiles: [PROFILE_CONTENT_DEVELOPER],
215
+ });
216
+ const op_update_chart = (0, types_1.defineOperation)({
217
+ id: 'content-developer.charts.update',
218
+ summary: 'Update a chart from code representation (as-code upsert by slug)',
219
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/code/charts/{slug}` },
220
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
221
+ sensitivity: 'none',
222
+ mcp: {
223
+ toolName: 'update_chart',
224
+ annotations: safety_1.WRITE_IDEMPOTENT,
225
+ taskSupport: { exposed: true, taskEligible: false },
226
+ },
227
+ profiles: [PROFILE_CONTENT_DEVELOPER],
228
+ });
229
+ const op_duplicate_chart = (0, types_1.defineOperation)({
230
+ id: 'content-developer.charts.duplicate',
231
+ summary: 'Duplicate a chart by reading its as-code representation and upserting a new slug',
232
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/code/charts/{slug}` },
233
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
234
+ sensitivity: 'none',
235
+ mcp: {
236
+ toolName: 'duplicate_chart',
237
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
238
+ taskSupport: { exposed: true, taskEligible: false },
239
+ },
240
+ workflow: [
241
+ {
242
+ method: 'GET',
243
+ path: `${API_V1}/projects/{projectUuid}/code/charts`,
244
+ summary: 'Read the source chart as-code representation',
245
+ },
246
+ {
247
+ method: 'POST',
248
+ path: `${API_V1}/projects/{projectUuid}/code/charts/{newSlug}`,
249
+ summary: 'Upsert the duplicate under a new slug',
250
+ },
251
+ ],
252
+ profiles: [PROFILE_CONTENT_DEVELOPER],
253
+ });
254
+ const op_create_dashboard = (0, types_1.defineOperation)({
255
+ id: 'content-developer.dashboards.create',
256
+ summary: 'Create a new dashboard in a project',
257
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/dashboards` },
258
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
259
+ sensitivity: 'none',
260
+ mcp: {
261
+ toolName: 'create_dashboard',
262
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
263
+ taskSupport: { exposed: true, taskEligible: false },
264
+ },
265
+ profiles: [PROFILE_CONTENT_DEVELOPER],
266
+ });
267
+ const op_update_dashboard = (0, types_1.defineOperation)({
268
+ id: 'content-developer.dashboards.update',
269
+ summary: 'Update a dashboard by UUID or slug',
270
+ http: {
271
+ method: 'PATCH',
272
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
273
+ },
274
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
275
+ sensitivity: 'none',
276
+ mcp: {
277
+ toolName: 'update_dashboard',
278
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
279
+ taskSupport: { exposed: true, taskEligible: false },
280
+ },
281
+ profiles: [PROFILE_CONTENT_DEVELOPER],
282
+ });
283
+ const op_duplicate_dashboard = (0, types_1.defineOperation)({
284
+ id: 'content-developer.dashboards.duplicate',
285
+ summary: 'Duplicate a dashboard via the duplicateFrom create parameter',
286
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/dashboards` },
287
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
288
+ sensitivity: 'none',
289
+ mcp: {
290
+ toolName: 'duplicate_dashboard',
291
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
292
+ taskSupport: { exposed: true, taskEligible: false },
293
+ },
294
+ workflow: [
295
+ {
296
+ method: 'POST',
297
+ path: `${API_V1}/projects/{projectUuid}/dashboards?duplicateFrom={dashboardUuid}`,
298
+ summary: 'Create a dashboard duplicated from an existing one',
299
+ },
300
+ ],
301
+ profiles: [PROFILE_CONTENT_DEVELOPER],
302
+ });
303
+ const op_add_dashboard_tile = (0, types_1.defineOperation)({
304
+ id: 'content-developer.dashboards.tiles.add',
305
+ summary: 'Add a tile to a dashboard by composing the full tile array and updating the dashboard',
306
+ http: {
307
+ method: 'PATCH',
308
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
309
+ },
310
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
311
+ sensitivity: 'none',
312
+ mcp: {
313
+ toolName: 'add_dashboard_tile',
314
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
315
+ taskSupport: { exposed: true, taskEligible: false },
316
+ },
317
+ workflow: [
318
+ {
319
+ method: 'GET',
320
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
321
+ summary: TILE_READ_SUMMARY,
322
+ },
323
+ {
324
+ method: 'PATCH',
325
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
326
+ summary: 'Write the full tile array back with the new tile appended',
327
+ },
328
+ ],
329
+ profiles: [PROFILE_CONTENT_DEVELOPER],
330
+ });
331
+ const op_move_dashboard_tile = (0, types_1.defineOperation)({
332
+ id: 'content-developer.dashboards.tiles.move',
333
+ summary: 'Move a dashboard tile by composing the full tile array and updating the dashboard',
334
+ http: {
335
+ method: 'PATCH',
336
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
337
+ },
338
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
339
+ sensitivity: 'none',
340
+ mcp: {
341
+ toolName: 'move_dashboard_tile',
342
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
343
+ taskSupport: { exposed: true, taskEligible: false },
344
+ },
345
+ workflow: [
346
+ {
347
+ method: 'GET',
348
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
349
+ summary: TILE_READ_SUMMARY,
350
+ },
351
+ {
352
+ method: 'PATCH',
353
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
354
+ summary: 'Write the full tile array back with updated tile position',
355
+ },
356
+ ],
357
+ profiles: [PROFILE_CONTENT_DEVELOPER],
358
+ });
359
+ const op_remove_dashboard_tile = (0, types_1.defineOperation)({
360
+ id: 'content-developer.dashboards.tiles.remove',
361
+ summary: 'Remove a dashboard tile by composing the full tile array and updating the dashboard',
362
+ http: {
363
+ method: 'PATCH',
364
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
365
+ },
366
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
367
+ sensitivity: 'none',
368
+ mcp: {
369
+ toolName: 'remove_dashboard_tile',
370
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
371
+ taskSupport: { exposed: true, taskEligible: false },
372
+ },
373
+ workflow: [
374
+ {
375
+ method: 'GET',
376
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
377
+ summary: TILE_READ_SUMMARY,
378
+ },
379
+ {
380
+ method: 'PATCH',
381
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
382
+ summary: 'Write the full tile array back with the tile removed',
383
+ },
384
+ ],
385
+ profiles: [PROFILE_CONTENT_DEVELOPER],
386
+ });
387
+ const op_resize_dashboard_tile = (0, types_1.defineOperation)({
388
+ id: 'content-developer.dashboards.tiles.resize',
389
+ summary: 'Resize a dashboard tile by composing the full tile array and updating the dashboard',
390
+ http: {
391
+ method: 'PATCH',
392
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
393
+ },
394
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
395
+ sensitivity: 'none',
396
+ mcp: {
397
+ toolName: 'resize_dashboard_tile',
398
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
399
+ taskSupport: { exposed: true, taskEligible: false },
400
+ },
401
+ workflow: [
402
+ {
403
+ method: 'GET',
404
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
405
+ summary: TILE_READ_SUMMARY,
406
+ },
407
+ {
408
+ method: 'PATCH',
409
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
410
+ summary: 'Write the full tile array back with the updated tile size',
411
+ },
412
+ ],
413
+ profiles: [PROFILE_CONTENT_DEVELOPER],
414
+ });
415
+ const op_create_space = (0, types_1.defineOperation)({
416
+ id: 'content-developer.spaces.create',
417
+ summary: 'Create a space in a project (client-only; spaces are managed out-of-band, e.g. Terraform)',
418
+ http: { method: 'POST', path: `${API_V1}/projects/{projectUuid}/spaces` },
419
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
420
+ sensitivity: 'none',
421
+ agentExposure: 'client-only',
422
+ bannedMcpToolName: 'create_space',
423
+ profiles: [PROFILE_CONTENT_DEVELOPER],
424
+ });
425
+ const op_update_space = (0, types_1.defineOperation)({
426
+ id: 'content-developer.spaces.update',
427
+ summary: 'Update a space in a project (client-only; spaces are managed out-of-band, e.g. Terraform)',
428
+ http: { method: 'PATCH', path: `${API_V1}/projects/{projectUuid}/spaces/{spaceUuid}` },
429
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
430
+ sensitivity: 'none',
431
+ agentExposure: 'client-only',
432
+ bannedMcpToolName: 'update_space',
433
+ profiles: [PROFILE_CONTENT_DEVELOPER],
434
+ });
435
+ const op_move_content = (0, types_1.defineOperation)({
436
+ id: 'content-developer.content.move',
437
+ summary: 'Move one or more charts or dashboards to another space in one call',
438
+ http: { method: 'POST', path: `${API_V2}/content/bulk-action/{projectUuid}/move` },
439
+ authorization: { safetyImpact: WRITE_NONDESTRUCTIVE_IMPACT },
440
+ sensitivity: 'none',
441
+ mcp: {
442
+ toolName: 'move_content',
443
+ annotations: safety_1.WRITE_NONDESTRUCTIVE,
444
+ taskSupport: { exposed: true, taskEligible: false },
445
+ },
446
+ profiles: [PROFILE_CONTENT_DEVELOPER],
447
+ });
448
+ exports.CONTENT_DEVELOPER_OPERATIONS = [
449
+ op_preview_chart_changes,
450
+ op_preview_dashboard_changes,
451
+ op_preview_content_move,
452
+ op_get_chart_as_code,
453
+ op_validate_chart,
454
+ op_validate_dashboard,
455
+ op_confirm_preview,
456
+ op_compare_chart_versions,
457
+ op_compare_dashboard_versions,
458
+ op_create_chart,
459
+ op_update_chart,
460
+ op_duplicate_chart,
461
+ op_create_dashboard,
462
+ op_update_dashboard,
463
+ op_duplicate_dashboard,
464
+ op_add_dashboard_tile,
465
+ op_move_dashboard_tile,
466
+ op_remove_dashboard_tile,
467
+ op_resize_dashboard_tile,
468
+ op_create_space,
469
+ op_update_space,
470
+ op_move_content,
471
+ ];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Content-governance operations (ADR-0015 / ADR-0017).
3
+ * Soft-delete charts/dashboards and dashboard promote via elicitation-required MCP tools.
4
+ * Permanent purge stays client-only. Chart/SQL-chart promote stay off MCP in v1.
5
+ */
6
+ import type { OperationDescriptor } from './types';
7
+ export declare const CONTENT_GOVERNANCE_OPERATIONS: readonly OperationDescriptor[];