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