@lightdash-tools/common 0.7.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/argument-validation.js +20 -2
- package/dist/argument-validation.test.js +22 -0
- package/dist/audit.d.ts +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +6 -8
- package/dist/operations/agent-safe.d.ts +1 -3
- package/dist/operations/agent-safe.js +2 -9
- package/dist/operations/ai-agents.js +45 -29
- 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 +10 -3
- package/dist/operations/index.js +20 -2
- package/dist/operations/organization-audit.d.ts +2 -0
- package/dist/operations/organization-audit.js +273 -0
- package/dist/operations/parity.test.js +12 -11
- package/dist/operations/registry.d.ts +9 -1
- package/dist/operations/registry.js +77 -2
- package/dist/operations/registry.test.js +38 -11
- package/dist/operations/semantic-layer.d.ts +6 -0
- package/dist/operations/semantic-layer.js +154 -0
- package/dist/operations/types.d.ts +29 -12
- package/dist/operations/types.js +63 -29
- package/dist/operations/types.test.js +33 -45
- package/dist/operations/users.d.ts +2 -2
- package/dist/operations/users.js +8 -10
- package/dist/safety.d.ts +5 -0
- package/dist/safety.js +11 -1
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +29 -0
- package/package.json +2 -1
- package/src/argument-validation.test.ts +31 -0
- package/src/argument-validation.ts +20 -2
- package/src/audit.ts +12 -1
- package/src/index.ts +5 -9
- package/src/operations/agent-safe.ts +2 -12
- package/src/operations/ai-agents.ts +46 -30
- 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 +25 -2
- package/src/operations/organization-audit.ts +293 -0
- package/src/operations/parity.test.ts +12 -14
- package/src/operations/registry.test.ts +40 -9
- package/src/operations/registry.ts +86 -2
- package/src/operations/semantic-layer.ts +166 -0
- package/src/operations/types.test.ts +38 -76
- package/src/operations/types.ts +110 -47
- package/src/operations/users.ts +9 -11
- package/src/safety.ts +11 -0
- package/src/types/index.ts +13 -0
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
READ_ONLY_DEFAULT,
|
|
7
7
|
WRITE_DESTRUCTIVE,
|
|
8
|
+
WRITE_IDEMPOTENT,
|
|
8
9
|
WRITE_NONDESTRUCTIVE,
|
|
9
10
|
WRITE_OPEN_WORLD,
|
|
10
11
|
} from '../safety';
|
|
@@ -32,10 +33,11 @@ const adminListAgents = defineOperation({
|
|
|
32
33
|
summary: 'List all AI agents across the organization (admin)',
|
|
33
34
|
http: { method: 'GET', path: `${API_V1}/aiAgents/admin/agents` },
|
|
34
35
|
authorization: { safetyImpact: IMPACT_READ },
|
|
36
|
+
sensitivity: 'none',
|
|
35
37
|
mcp: {
|
|
36
38
|
toolName: 'list_admin_agents',
|
|
37
39
|
annotations: READ_ONLY_DEFAULT,
|
|
38
|
-
taskSupport: { exposed:
|
|
40
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
39
41
|
},
|
|
40
42
|
cli: { commandPath: 'ai-agents list' },
|
|
41
43
|
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
@@ -46,10 +48,11 @@ const adminListThreads = defineOperation({
|
|
|
46
48
|
summary: 'List AI agent threads across the organization with optional filters (admin)',
|
|
47
49
|
http: { method: 'GET', path: `${API_V1}/aiAgents/admin/threads` },
|
|
48
50
|
authorization: { safetyImpact: IMPACT_READ },
|
|
51
|
+
sensitivity: 'none',
|
|
49
52
|
mcp: {
|
|
50
53
|
toolName: 'list_admin_agent_threads',
|
|
51
54
|
annotations: READ_ONLY_DEFAULT,
|
|
52
|
-
taskSupport: { exposed:
|
|
55
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
53
56
|
},
|
|
54
57
|
cli: { commandPath: 'ai-agents threads' },
|
|
55
58
|
profiles: [PROFILE_DISCOVERY],
|
|
@@ -60,31 +63,26 @@ const adminSettingsGet = defineOperation({
|
|
|
60
63
|
summary: 'Get AI organization settings (admin)',
|
|
61
64
|
http: { method: 'GET', path: `${API_V1}/aiAgents/admin/settings` },
|
|
62
65
|
authorization: { safetyImpact: IMPACT_READ },
|
|
66
|
+
sensitivity: 'none',
|
|
63
67
|
mcp: {
|
|
64
68
|
toolName: 'get_ai_organization_settings',
|
|
65
69
|
annotations: READ_ONLY_DEFAULT,
|
|
66
|
-
taskSupport: { exposed:
|
|
70
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
67
71
|
},
|
|
68
72
|
cli: { commandPath: 'ai-agents settings get' },
|
|
69
73
|
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
70
74
|
});
|
|
71
75
|
|
|
72
|
-
const WRITE_SETTINGS_UPDATE = {
|
|
73
|
-
readOnlyHint: false,
|
|
74
|
-
openWorldHint: false,
|
|
75
|
-
destructiveHint: false,
|
|
76
|
-
idempotentHint: true,
|
|
77
|
-
} as const;
|
|
78
|
-
|
|
79
76
|
const adminSettingsUpdate = defineOperation({
|
|
80
77
|
id: 'ai-agents.admin.settings.update',
|
|
81
78
|
summary: 'Update AI organization settings (admin)',
|
|
82
79
|
http: { method: 'PATCH', path: `${API_V1}/aiAgents/admin/settings` },
|
|
83
80
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
81
|
+
sensitivity: 'none',
|
|
84
82
|
mcp: {
|
|
85
83
|
toolName: 'update_ai_organization_settings',
|
|
86
|
-
annotations:
|
|
87
|
-
taskSupport: { exposed:
|
|
84
|
+
annotations: WRITE_IDEMPOTENT,
|
|
85
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
88
86
|
},
|
|
89
87
|
cli: { commandPath: 'ai-agents settings update' },
|
|
90
88
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -95,10 +93,11 @@ const projectAgentsList = defineOperation({
|
|
|
95
93
|
summary: 'List all AI agents in a project',
|
|
96
94
|
http: { method: 'GET', path: PROJECT_AGENTS_PATH },
|
|
97
95
|
authorization: { safetyImpact: IMPACT_READ },
|
|
96
|
+
sensitivity: 'none',
|
|
98
97
|
mcp: {
|
|
99
98
|
toolName: 'list_project_agents',
|
|
100
99
|
annotations: READ_ONLY_DEFAULT,
|
|
101
|
-
taskSupport: { exposed:
|
|
100
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
102
101
|
},
|
|
103
102
|
cli: { commandPath: 'agents list' },
|
|
104
103
|
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
@@ -109,10 +108,11 @@ const projectAgentsGet = defineOperation({
|
|
|
109
108
|
summary: 'Get a single AI agent in a project',
|
|
110
109
|
http: { method: 'GET', path: PROJECT_AGENT_PATH },
|
|
111
110
|
authorization: { safetyImpact: IMPACT_READ },
|
|
111
|
+
sensitivity: 'none',
|
|
112
112
|
mcp: {
|
|
113
113
|
toolName: 'get_project_agent',
|
|
114
114
|
annotations: READ_ONLY_DEFAULT,
|
|
115
|
-
taskSupport: { exposed:
|
|
115
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
116
116
|
},
|
|
117
117
|
cli: { commandPath: 'agents get' },
|
|
118
118
|
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
@@ -123,10 +123,11 @@ const projectAgentsCreate = defineOperation({
|
|
|
123
123
|
summary: 'Create a new AI agent in a project',
|
|
124
124
|
http: { method: 'POST', path: PROJECT_AGENTS_PATH },
|
|
125
125
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
126
|
+
sensitivity: 'none',
|
|
126
127
|
mcp: {
|
|
127
128
|
toolName: 'create_project_agent',
|
|
128
129
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
129
|
-
taskSupport: { exposed:
|
|
130
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
130
131
|
},
|
|
131
132
|
cli: { commandPath: 'agents create' },
|
|
132
133
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -137,10 +138,11 @@ const projectAgentsUpdate = defineOperation({
|
|
|
137
138
|
summary: 'Update an existing AI agent in a project',
|
|
138
139
|
http: { method: 'PATCH', path: PROJECT_AGENT_PATH },
|
|
139
140
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
141
|
+
sensitivity: 'none',
|
|
140
142
|
mcp: {
|
|
141
143
|
toolName: 'update_project_agent',
|
|
142
144
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
143
|
-
taskSupport: { exposed:
|
|
145
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
144
146
|
},
|
|
145
147
|
cli: { commandPath: 'agents update' },
|
|
146
148
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -151,10 +153,11 @@ const projectAgentsDelete = defineOperation({
|
|
|
151
153
|
summary: 'Delete an AI agent from a project',
|
|
152
154
|
http: { method: 'DELETE', path: PROJECT_AGENT_PATH },
|
|
153
155
|
authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
|
|
156
|
+
sensitivity: 'none',
|
|
154
157
|
mcp: {
|
|
155
158
|
toolName: 'delete_project_agent',
|
|
156
159
|
annotations: WRITE_DESTRUCTIVE,
|
|
157
|
-
taskSupport: { exposed:
|
|
160
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
158
161
|
},
|
|
159
162
|
cli: { commandPath: 'agents delete' },
|
|
160
163
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -170,10 +173,11 @@ const threadsList = defineOperation({
|
|
|
170
173
|
path: PROJECT_AGENT_THREADS_PATH,
|
|
171
174
|
},
|
|
172
175
|
authorization: { safetyImpact: IMPACT_READ },
|
|
176
|
+
sensitivity: 'none',
|
|
173
177
|
mcp: {
|
|
174
178
|
toolName: 'list_agent_threads',
|
|
175
179
|
annotations: READ_ONLY_DEFAULT,
|
|
176
|
-
taskSupport: { exposed:
|
|
180
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
177
181
|
},
|
|
178
182
|
cli: { commandPath: 'agents threads list' },
|
|
179
183
|
profiles: [PROFILE_CONVERSATIONS, PROFILE_DISCOVERY],
|
|
@@ -189,10 +193,11 @@ const threadsGet = defineOperation({
|
|
|
189
193
|
path: PROJECT_AGENT_THREAD_PATH,
|
|
190
194
|
},
|
|
191
195
|
authorization: { safetyImpact: IMPACT_READ },
|
|
196
|
+
sensitivity: 'none',
|
|
192
197
|
mcp: {
|
|
193
198
|
toolName: 'get_agent_thread',
|
|
194
199
|
annotations: READ_ONLY_DEFAULT,
|
|
195
|
-
taskSupport: { exposed:
|
|
200
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
196
201
|
},
|
|
197
202
|
cli: { commandPath: 'agents threads get' },
|
|
198
203
|
profiles: [PROFILE_CONVERSATIONS, PROFILE_DISCOVERY],
|
|
@@ -227,10 +232,11 @@ const threadsStart = defineOperation({
|
|
|
227
232
|
},
|
|
228
233
|
],
|
|
229
234
|
authorization: { safetyImpact: IMPACT_EXTERNAL },
|
|
235
|
+
sensitivity: 'none',
|
|
230
236
|
mcp: {
|
|
231
237
|
toolName: 'generate_agent_message',
|
|
232
238
|
annotations: WRITE_OPEN_WORLD,
|
|
233
|
-
taskSupport: { exposed:
|
|
239
|
+
taskSupport: { exposed: false, taskEligible: true },
|
|
234
240
|
},
|
|
235
241
|
cli: { commandPath: 'agents threads start' },
|
|
236
242
|
profiles: [PROFILE_CONVERSATIONS],
|
|
@@ -256,10 +262,11 @@ const threadsContinue = defineOperation({
|
|
|
256
262
|
},
|
|
257
263
|
],
|
|
258
264
|
authorization: { safetyImpact: IMPACT_EXTERNAL },
|
|
265
|
+
sensitivity: 'none',
|
|
259
266
|
mcp: {
|
|
260
267
|
toolName: 'continue_agent_thread',
|
|
261
268
|
annotations: WRITE_OPEN_WORLD,
|
|
262
|
-
taskSupport: { exposed:
|
|
269
|
+
taskSupport: { exposed: false, taskEligible: true },
|
|
263
270
|
},
|
|
264
271
|
cli: { commandPath: 'agents threads continue' },
|
|
265
272
|
profiles: [PROFILE_CONVERSATIONS],
|
|
@@ -275,10 +282,11 @@ const evaluationsList = defineOperation({
|
|
|
275
282
|
path: PROJECT_AGENT_EVALUATIONS_PATH,
|
|
276
283
|
},
|
|
277
284
|
authorization: { safetyImpact: IMPACT_READ },
|
|
285
|
+
sensitivity: 'none',
|
|
278
286
|
mcp: {
|
|
279
287
|
toolName: 'list_agent_evaluations',
|
|
280
288
|
annotations: READ_ONLY_DEFAULT,
|
|
281
|
-
taskSupport: { exposed:
|
|
289
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
282
290
|
},
|
|
283
291
|
cli: { commandPath: 'agents evals list' },
|
|
284
292
|
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
@@ -294,10 +302,11 @@ const evaluationsGet = defineOperation({
|
|
|
294
302
|
path: PROJECT_AGENT_EVALUATION_PATH,
|
|
295
303
|
},
|
|
296
304
|
authorization: { safetyImpact: IMPACT_READ },
|
|
305
|
+
sensitivity: 'none',
|
|
297
306
|
mcp: {
|
|
298
307
|
toolName: 'get_agent_evaluation',
|
|
299
308
|
annotations: READ_ONLY_DEFAULT,
|
|
300
|
-
taskSupport: { exposed:
|
|
309
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
301
310
|
},
|
|
302
311
|
cli: { commandPath: 'agents evals get' },
|
|
303
312
|
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
@@ -311,10 +320,11 @@ const evaluationsCreate = defineOperation({
|
|
|
311
320
|
path: PROJECT_AGENT_EVALUATIONS_PATH,
|
|
312
321
|
},
|
|
313
322
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
323
|
+
sensitivity: 'none',
|
|
314
324
|
mcp: {
|
|
315
325
|
toolName: 'create_agent_evaluation',
|
|
316
326
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
317
|
-
taskSupport: { exposed:
|
|
327
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
318
328
|
},
|
|
319
329
|
cli: { commandPath: 'agents evals create' },
|
|
320
330
|
profiles: [PROFILE_EVALUATIONS],
|
|
@@ -328,10 +338,11 @@ const evaluationsUpdate = defineOperation({
|
|
|
328
338
|
path: PROJECT_AGENT_EVALUATION_PATH,
|
|
329
339
|
},
|
|
330
340
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
341
|
+
sensitivity: 'none',
|
|
331
342
|
mcp: {
|
|
332
343
|
toolName: 'update_agent_evaluation',
|
|
333
344
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
334
|
-
taskSupport: { exposed:
|
|
345
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
335
346
|
},
|
|
336
347
|
cli: { commandPath: 'agents evals update' },
|
|
337
348
|
profiles: [PROFILE_EVALUATIONS],
|
|
@@ -345,10 +356,11 @@ const evaluationsAppend = defineOperation({
|
|
|
345
356
|
path: `${PROJECT_AGENT_EVALUATION_PATH}/append`,
|
|
346
357
|
},
|
|
347
358
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
359
|
+
sensitivity: 'none',
|
|
348
360
|
mcp: {
|
|
349
361
|
toolName: 'append_agent_evaluation_prompts',
|
|
350
362
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
351
|
-
taskSupport: { exposed:
|
|
363
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
352
364
|
},
|
|
353
365
|
cli: { commandPath: 'agents evals append' },
|
|
354
366
|
profiles: [PROFILE_EVALUATIONS],
|
|
@@ -362,10 +374,11 @@ const evaluationsDelete = defineOperation({
|
|
|
362
374
|
path: PROJECT_AGENT_EVALUATION_PATH,
|
|
363
375
|
},
|
|
364
376
|
authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
|
|
377
|
+
sensitivity: 'none',
|
|
365
378
|
mcp: {
|
|
366
379
|
toolName: 'delete_agent_evaluation',
|
|
367
380
|
annotations: WRITE_DESTRUCTIVE,
|
|
368
|
-
taskSupport: { exposed:
|
|
381
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
369
382
|
},
|
|
370
383
|
cli: { commandPath: 'agents evals delete' },
|
|
371
384
|
profiles: [PROFILE_EVALUATIONS],
|
|
@@ -379,10 +392,11 @@ const evaluationsRun = defineOperation({
|
|
|
379
392
|
path: `${PROJECT_AGENT_EVALUATION_PATH}/run`,
|
|
380
393
|
},
|
|
381
394
|
authorization: { safetyImpact: IMPACT_EXTERNAL },
|
|
395
|
+
sensitivity: 'none',
|
|
382
396
|
mcp: {
|
|
383
397
|
toolName: 'run_agent_evaluation',
|
|
384
398
|
annotations: WRITE_OPEN_WORLD,
|
|
385
|
-
taskSupport: { exposed:
|
|
399
|
+
taskSupport: { exposed: false, taskEligible: true },
|
|
386
400
|
},
|
|
387
401
|
cli: { commandPath: 'agents evals run' },
|
|
388
402
|
profiles: [PROFILE_EVALUATIONS],
|
|
@@ -398,10 +412,11 @@ const evaluationsRunsList = defineOperation({
|
|
|
398
412
|
path: PROJECT_AGENT_EVALUATION_RUNS_PATH,
|
|
399
413
|
},
|
|
400
414
|
authorization: { safetyImpact: IMPACT_READ },
|
|
415
|
+
sensitivity: 'none',
|
|
401
416
|
mcp: {
|
|
402
417
|
toolName: 'list_agent_evaluation_runs',
|
|
403
418
|
annotations: READ_ONLY_DEFAULT,
|
|
404
|
-
taskSupport: { exposed:
|
|
419
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
405
420
|
},
|
|
406
421
|
cli: { commandPath: 'agents evals runs' },
|
|
407
422
|
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
@@ -415,10 +430,11 @@ const evaluationsRunResultsGet = defineOperation({
|
|
|
415
430
|
path: `${PROJECT_AGENT_EVALUATION_RUNS_PATH}/{runUuid}`,
|
|
416
431
|
},
|
|
417
432
|
authorization: { safetyImpact: IMPACT_READ },
|
|
433
|
+
sensitivity: 'none',
|
|
418
434
|
mcp: {
|
|
419
435
|
toolName: 'get_agent_evaluation_run_results',
|
|
420
436
|
annotations: READ_ONLY_DEFAULT,
|
|
421
|
-
taskSupport: { exposed:
|
|
437
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
422
438
|
},
|
|
423
439
|
cli: { commandPath: 'agents evals run-results' },
|
|
424
440
|
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI content/validation operations (ADR-0013). Catalog metadata only — not MCP tools.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { defineOperation } from './types';
|
|
6
|
+
|
|
7
|
+
import type { CapabilityProfile, OperationDescriptor } from './types';
|
|
8
|
+
|
|
9
|
+
const PROFILE_DISCOVERY: CapabilityProfile = 'discovery-readonly';
|
|
10
|
+
const PROFILE_CORE: CapabilityProfile = 'core-lifecycle';
|
|
11
|
+
|
|
12
|
+
const chartsList = defineOperation({
|
|
13
|
+
id: 'cli.charts.list',
|
|
14
|
+
summary: 'List charts in a project (Commander alias of charts-as-code list)',
|
|
15
|
+
http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/code/charts' },
|
|
16
|
+
authorization: { safetyImpact: 'read' },
|
|
17
|
+
sensitivity: 'none',
|
|
18
|
+
cli: { commandPath: 'projects charts list' },
|
|
19
|
+
profiles: [PROFILE_DISCOVERY],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const chartsCodeList = defineOperation({
|
|
23
|
+
id: 'cli.charts.code.list',
|
|
24
|
+
summary: 'Get charts in code representation',
|
|
25
|
+
http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/code/charts' },
|
|
26
|
+
authorization: { safetyImpact: 'read' },
|
|
27
|
+
sensitivity: 'none',
|
|
28
|
+
cli: { commandPath: 'projects charts code list' },
|
|
29
|
+
profiles: [PROFILE_DISCOVERY],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const chartsCodeUpsert = defineOperation({
|
|
33
|
+
id: 'cli.charts.code.upsert',
|
|
34
|
+
summary: 'Create or update chart by slug',
|
|
35
|
+
http: { method: 'POST', path: '/api/v1/projects/{projectUuid}/code/charts/{slug}' },
|
|
36
|
+
authorization: { safetyImpact: 'write-nondestructive' },
|
|
37
|
+
sensitivity: 'none',
|
|
38
|
+
cli: { commandPath: 'projects charts code upsert' },
|
|
39
|
+
profiles: [PROFILE_CORE],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const dashboardsList = defineOperation({
|
|
43
|
+
id: 'cli.dashboards.list',
|
|
44
|
+
summary: 'List dashboards in a project',
|
|
45
|
+
http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/dashboards' },
|
|
46
|
+
authorization: { safetyImpact: 'read' },
|
|
47
|
+
sensitivity: 'none',
|
|
48
|
+
cli: { commandPath: 'projects dashboards list' },
|
|
49
|
+
profiles: [PROFILE_DISCOVERY],
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const validateRun = defineOperation({
|
|
53
|
+
id: 'cli.projects.validate.run',
|
|
54
|
+
summary: 'Start project validation job',
|
|
55
|
+
http: { method: 'POST', path: '/api/v1/projects/{projectUuid}/validate' },
|
|
56
|
+
authorization: { safetyImpact: 'write-nondestructive' },
|
|
57
|
+
sensitivity: 'none',
|
|
58
|
+
cli: { commandPath: 'projects validate run' },
|
|
59
|
+
profiles: [PROFILE_CORE],
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const validateResults = defineOperation({
|
|
63
|
+
id: 'cli.projects.validate.results',
|
|
64
|
+
summary: 'List project validation results (v2, paginated)',
|
|
65
|
+
http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/validate' },
|
|
66
|
+
authorization: { safetyImpact: 'read' },
|
|
67
|
+
sensitivity: 'none',
|
|
68
|
+
cli: { commandPath: 'projects validate results' },
|
|
69
|
+
profiles: [PROFILE_DISCOVERY],
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const CLI_CONTENT_OPERATIONS: readonly OperationDescriptor[] = [
|
|
73
|
+
chartsList,
|
|
74
|
+
chartsCodeList,
|
|
75
|
+
chartsCodeUpsert,
|
|
76
|
+
dashboardsList,
|
|
77
|
+
validateRun,
|
|
78
|
+
validateResults,
|
|
79
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { OPERATION_CLIENT_METHOD_MAP, getClientMethodForOperation } from './client-coverage';
|
|
4
|
+
import { listOperations } from './registry';
|
|
5
|
+
|
|
6
|
+
describe('operation client coverage', () => {
|
|
7
|
+
it('maps every catalogued operation to a client method or composed ref', () => {
|
|
8
|
+
const missing: string[] = [];
|
|
9
|
+
for (const operation of listOperations()) {
|
|
10
|
+
const method = getClientMethodForOperation(operation.id);
|
|
11
|
+
if (method === undefined || method.trim().length === 0) {
|
|
12
|
+
missing.push(operation.id);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
expect(missing).toEqual([]);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('does not leave stale coverage entries for removed operations', () => {
|
|
19
|
+
const catalogIds = new Set(listOperations().map((operation) => operation.id));
|
|
20
|
+
const stale = Object.keys(OPERATION_CLIENT_METHOD_MAP).filter((id) => !catalogIds.has(id));
|
|
21
|
+
expect(stale).toEqual([]);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -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
|
+
}
|