@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,212 @@
1
+ /**
2
+ * Content-reader operations in the shared operation catalog (ADR-0013).
3
+ */
4
+ import { READ_ONLY_DEFAULT, READ_ONLY_TRANSIENT } from '../safety';
5
+
6
+ import { defineOperation } from './types';
7
+
8
+ import type { CapabilityProfile, OperationDescriptor } from './types';
9
+
10
+ const PROFILE_CONTENT_READER: CapabilityProfile = 'content-reader';
11
+ const PROFILE_CONTENT_DEVELOPER: CapabilityProfile = 'content-developer';
12
+
13
+ const op_search_content = defineOperation({
14
+ id: 'content-reader.content.search',
15
+ summary: 'Search charts dashboards and spaces in a project',
16
+ http: { method: 'GET', path: '/api/v2/content' },
17
+ authorization: { safetyImpact: 'read' },
18
+ sensitivity: 'none',
19
+ mcp: {
20
+ toolName: 'search_content',
21
+ annotations: READ_ONLY_DEFAULT,
22
+ taskSupport: { exposed: true, taskEligible: false },
23
+ },
24
+ cli: { commandPath: 'content search' },
25
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
26
+ });
27
+
28
+ const op_list_spaces = defineOperation({
29
+ id: 'content-reader.spaces.list',
30
+ summary: 'List project spaces',
31
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/spaces' },
32
+ authorization: { safetyImpact: 'read' },
33
+ sensitivity: 'none',
34
+ mcp: {
35
+ toolName: 'list_spaces',
36
+ annotations: READ_ONLY_DEFAULT,
37
+ taskSupport: { exposed: true, taskEligible: false },
38
+ },
39
+ cli: { commandPath: 'projects spaces list' },
40
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
41
+ });
42
+
43
+ const op_get_space = defineOperation({
44
+ id: 'content-reader.spaces.get',
45
+ summary: 'Get a space with breadcrumbs and content summaries',
46
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/spaces/{spaceUuid}' },
47
+ authorization: { safetyImpact: 'read' },
48
+ sensitivity: 'none',
49
+ mcp: {
50
+ toolName: 'get_space',
51
+ annotations: READ_ONLY_DEFAULT,
52
+ taskSupport: { exposed: true, taskEligible: false },
53
+ },
54
+ cli: { commandPath: 'projects spaces get' },
55
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
56
+ });
57
+
58
+ const op_get_dashboard = defineOperation({
59
+ id: 'content-reader.dashboards.get',
60
+ summary: 'Get dashboard structure before tile execution',
61
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}' },
62
+ authorization: { safetyImpact: 'read' },
63
+ sensitivity: 'none',
64
+ mcp: {
65
+ toolName: 'get_dashboard',
66
+ annotations: READ_ONLY_DEFAULT,
67
+ taskSupport: { exposed: true, taskEligible: false },
68
+ },
69
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
70
+ });
71
+
72
+ const op_get_chart = defineOperation({
73
+ id: 'content-reader.charts.get',
74
+ summary: 'Get a saved chart definition',
75
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/saved/{chartUuidOrSlug}' },
76
+ authorization: { safetyImpact: 'read' },
77
+ sensitivity: 'none',
78
+ mcp: {
79
+ toolName: 'get_chart',
80
+ annotations: READ_ONLY_DEFAULT,
81
+ taskSupport: { exposed: true, taskEligible: false },
82
+ },
83
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
84
+ });
85
+
86
+ const op_list_project_parameters = defineOperation({
87
+ id: 'content-reader.parameters.list',
88
+ summary: 'List project parameter definitions',
89
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/parameters/list' },
90
+ authorization: { safetyImpact: 'read' },
91
+ sensitivity: 'none',
92
+ mcp: {
93
+ toolName: 'list_project_parameters',
94
+ annotations: READ_ONLY_DEFAULT,
95
+ taskSupport: { exposed: true, taskEligible: false },
96
+ },
97
+ profiles: [PROFILE_CONTENT_READER],
98
+ });
99
+
100
+ const op_get_project_parameters = defineOperation({
101
+ id: 'content-reader.parameters.get',
102
+ summary: 'Get project parameters by name',
103
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/parameters' },
104
+ authorization: { safetyImpact: 'read' },
105
+ sensitivity: 'none',
106
+ mcp: {
107
+ toolName: 'get_project_parameters',
108
+ annotations: READ_ONLY_DEFAULT,
109
+ taskSupport: { exposed: true, taskEligible: false },
110
+ },
111
+ profiles: [PROFILE_CONTENT_READER],
112
+ });
113
+
114
+ const op_explain_content = defineOperation({
115
+ id: 'content-reader.content.explain',
116
+ summary: 'Explain saved content from metadata',
117
+ http: { method: 'GET', path: '/api/v2/content' },
118
+ authorization: { safetyImpact: 'read' },
119
+ sensitivity: 'none',
120
+ mcp: {
121
+ toolName: 'explain_content',
122
+ annotations: READ_ONLY_DEFAULT,
123
+ taskSupport: { exposed: true, taskEligible: false },
124
+ },
125
+ profiles: [PROFILE_CONTENT_READER],
126
+ });
127
+
128
+ const op_run_chart = defineOperation({
129
+ id: 'content-reader.charts.run',
130
+ summary: 'Execute a saved semantic chart with bounded results',
131
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/chart' },
132
+ authorization: { safetyImpact: 'read' },
133
+ sensitivity: 'none',
134
+ mcp: {
135
+ toolName: 'run_chart',
136
+ annotations: READ_ONLY_TRANSIENT,
137
+ taskSupport: { exposed: true, taskEligible: false },
138
+ },
139
+ profiles: [PROFILE_CONTENT_READER],
140
+ });
141
+
142
+ const op_export_chart_image = defineOperation({
143
+ id: 'content-reader.charts.export-image',
144
+ summary: 'Export a saved chart as a PNG image snapshot',
145
+ http: { method: 'POST', path: '/api/v1/saved/{chartUuid}/export' },
146
+ authorization: { safetyImpact: 'read' },
147
+ sensitivity: 'none',
148
+ mcp: {
149
+ toolName: 'export_chart_image',
150
+ annotations: READ_ONLY_TRANSIENT,
151
+ taskSupport: { exposed: true, taskEligible: false },
152
+ },
153
+ profiles: [PROFILE_CONTENT_READER],
154
+ });
155
+
156
+ const op_run_dashboard_tile = defineOperation({
157
+ id: 'content-reader.dashboards.run-tile',
158
+ summary: 'Execute a dashboard tile with bounded results',
159
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/dashboard-chart' },
160
+ authorization: { safetyImpact: 'read' },
161
+ sensitivity: 'none',
162
+ mcp: {
163
+ toolName: 'run_dashboard_tile',
164
+ annotations: READ_ONLY_TRANSIENT,
165
+ taskSupport: { exposed: true, taskEligible: false },
166
+ },
167
+ profiles: [PROFILE_CONTENT_READER],
168
+ });
169
+
170
+ const op_get_query_result = defineOperation({
171
+ id: 'content-reader.query.result.get',
172
+ summary: 'Get or poll a query result by queryUuid',
173
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/query/{queryUuid}' },
174
+ authorization: { safetyImpact: 'read' },
175
+ sensitivity: 'none',
176
+ mcp: {
177
+ toolName: 'get_query_result',
178
+ annotations: READ_ONLY_DEFAULT,
179
+ taskSupport: { exposed: true, taskEligible: false },
180
+ },
181
+ profiles: [PROFILE_CONTENT_READER],
182
+ });
183
+
184
+ const op_cancel_query = defineOperation({
185
+ id: 'content-reader.query.cancel',
186
+ summary: 'Cancel a running query by queryUuid',
187
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/{queryUuid}/cancel' },
188
+ authorization: { safetyImpact: 'read' },
189
+ sensitivity: 'none',
190
+ mcp: {
191
+ toolName: 'cancel_query',
192
+ annotations: READ_ONLY_TRANSIENT,
193
+ taskSupport: { exposed: true, taskEligible: false },
194
+ },
195
+ profiles: [PROFILE_CONTENT_READER],
196
+ });
197
+
198
+ export const CONTENT_READER_OPERATIONS: readonly OperationDescriptor[] = [
199
+ op_search_content,
200
+ op_list_spaces,
201
+ op_get_space,
202
+ op_get_dashboard,
203
+ op_get_chart,
204
+ op_list_project_parameters,
205
+ op_get_project_parameters,
206
+ op_explain_content,
207
+ op_run_chart,
208
+ op_export_chart_image,
209
+ op_run_dashboard_tile,
210
+ op_get_query_result,
211
+ op_cancel_query,
212
+ ];
@@ -6,14 +6,37 @@ export {
6
6
  type McpTaskSupport,
7
7
  type OperationAuthorization,
8
8
  type OperationCli,
9
+ type OperationDefinitionInput,
9
10
  type OperationDescriptor,
10
11
  type OperationHttp,
11
12
  type OperationMcp,
13
+ type SensitivityClass,
12
14
  } from './types';
13
15
 
14
- export { IRRECOVERABLE_TOOL_DENYLIST, listBannedMcpToolNames } from './agent-safe';
16
+ export { IRRECOVERABLE_TOOL_DENYLIST } from './agent-safe';
15
17
 
16
18
  export { AI_AGENT_OPERATIONS } from './ai-agents';
19
+ export { CLI_CONTENT_OPERATIONS } from './cli-content';
20
+ export { CONTENT_DEVELOPER_OPERATIONS } from './content-developer';
21
+ export { CONTENT_GOVERNANCE_OPERATIONS } from './content-governance';
22
+ export { CONTENT_READER_OPERATIONS } from './content-reader';
23
+ export { ORGANIZATION_AUDIT_OPERATIONS } from './organization-audit';
24
+ export { SEMANTIC_LAYER_OPERATIONS } from './semantic-layer';
17
25
  export { USER_OPERATIONS } from './users';
18
26
 
19
- export { getOperation, getOperationsByProfile, listOperations } from './registry';
27
+ export {
28
+ getOperation,
29
+ getOperationByMcpToolName,
30
+ getOperationsByProfile,
31
+ listBannedMcpToolNames,
32
+ listExposedMcpToolNames,
33
+ listMcpToolNamesByProfile,
34
+ listOperations,
35
+ } from './registry';
36
+
37
+ export {
38
+ OPERATION_CLIENT_METHOD_MAP,
39
+ getClientMethodForOperation,
40
+ type CataloguedOperationId,
41
+ type ClientMethodRef,
42
+ } from './client-coverage';
@@ -0,0 +1,293 @@
1
+ /**
2
+ * Organization-audit operations in the shared operation catalog (ADR-0013).
3
+ */
4
+ import { READ_ONLY_DEFAULT } from '../safety';
5
+
6
+ import { defineOperation } from './types';
7
+
8
+ import type { CapabilityProfile, OperationDescriptor } from './types';
9
+
10
+ const PROFILE_ORG_AUDIT: CapabilityProfile = 'org-audit-readonly';
11
+
12
+ const op_get_org_profile = defineOperation({
13
+ id: 'org-audit.org.profile.get',
14
+ summary: 'Get organization profile for the authenticated user',
15
+ http: { method: 'GET', path: '/api/v1/org' },
16
+ authorization: { safetyImpact: 'read' },
17
+ sensitivity: 'none',
18
+ mcp: {
19
+ toolName: 'get_org_profile',
20
+ annotations: READ_ONLY_DEFAULT,
21
+ taskSupport: { exposed: true, taskEligible: false },
22
+ },
23
+ cli: { commandPath: 'organization get' },
24
+ profiles: [PROFILE_ORG_AUDIT],
25
+ });
26
+
27
+ const op_list_org_members = defineOperation({
28
+ id: 'org-audit.members.list',
29
+ summary: 'List organization members',
30
+ http: { method: 'GET', path: '/api/v1/org/users' },
31
+ authorization: { safetyImpact: 'read' },
32
+ sensitivity: 'pii.email',
33
+ mcp: {
34
+ toolName: 'list_org_members',
35
+ annotations: READ_ONLY_DEFAULT,
36
+ taskSupport: { exposed: true, taskEligible: false },
37
+ },
38
+ cli: { commandPath: 'users list' },
39
+ profiles: [PROFILE_ORG_AUDIT],
40
+ });
41
+
42
+ const op_get_org_member = defineOperation({
43
+ id: 'org-audit.members.get',
44
+ summary: 'Get an organization member by UUID',
45
+ http: { method: 'GET', path: '/api/v1/org/users/{userUuid}' },
46
+ authorization: { safetyImpact: 'read' },
47
+ sensitivity: 'pii.email',
48
+ mcp: {
49
+ toolName: 'get_org_member',
50
+ annotations: READ_ONLY_DEFAULT,
51
+ taskSupport: { exposed: true, taskEligible: false },
52
+ },
53
+ cli: { commandPath: 'users get' },
54
+ profiles: [PROFILE_ORG_AUDIT],
55
+ });
56
+
57
+ const op_list_org_groups = defineOperation({
58
+ id: 'org-audit.groups.list',
59
+ summary: 'List organization groups',
60
+ http: { method: 'GET', path: '/api/v1/org/groups' },
61
+ authorization: { safetyImpact: 'read' },
62
+ sensitivity: 'pii.email',
63
+ mcp: {
64
+ toolName: 'list_org_groups',
65
+ annotations: READ_ONLY_DEFAULT,
66
+ taskSupport: { exposed: true, taskEligible: false },
67
+ },
68
+ cli: { commandPath: 'groups list' },
69
+ profiles: [PROFILE_ORG_AUDIT],
70
+ });
71
+
72
+ const op_list_org_projects = defineOperation({
73
+ id: 'org-audit.projects.list',
74
+ summary: 'List organization projects without connection secrets',
75
+ http: { method: 'GET', path: '/api/v1/org/projects' },
76
+ authorization: { safetyImpact: 'read' },
77
+ sensitivity: 'secret.connection',
78
+ mcp: {
79
+ toolName: 'list_org_projects',
80
+ annotations: READ_ONLY_DEFAULT,
81
+ taskSupport: { exposed: true, taskEligible: false },
82
+ },
83
+ cli: { commandPath: 'projects list' },
84
+ profiles: [PROFILE_ORG_AUDIT],
85
+ });
86
+
87
+ const op_list_org_role_assignments = defineOperation({
88
+ id: 'org-audit.roles.assignments.list',
89
+ summary: 'List organization role assignments',
90
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles/assignments' },
91
+ authorization: { safetyImpact: 'read' },
92
+ sensitivity: 'none',
93
+ mcp: {
94
+ toolName: 'list_org_role_assignments',
95
+ annotations: READ_ONLY_DEFAULT,
96
+ taskSupport: { exposed: true, taskEligible: false },
97
+ },
98
+ profiles: [PROFILE_ORG_AUDIT],
99
+ });
100
+
101
+ const op_list_custom_roles = defineOperation({
102
+ id: 'org-audit.roles.list',
103
+ summary: 'List organization custom and system roles',
104
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles' },
105
+ authorization: { safetyImpact: 'read' },
106
+ sensitivity: 'none',
107
+ mcp: {
108
+ toolName: 'list_custom_roles',
109
+ annotations: READ_ONLY_DEFAULT,
110
+ taskSupport: { exposed: true, taskEligible: false },
111
+ },
112
+ profiles: [PROFILE_ORG_AUDIT],
113
+ });
114
+
115
+ const op_get_custom_role = defineOperation({
116
+ id: 'org-audit.roles.get',
117
+ summary: 'Get a role including scopes',
118
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles/{roleUuid}' },
119
+ authorization: { safetyImpact: 'read' },
120
+ sensitivity: 'none',
121
+ mcp: {
122
+ toolName: 'get_custom_role',
123
+ annotations: READ_ONLY_DEFAULT,
124
+ taskSupport: { exposed: true, taskEligible: false },
125
+ },
126
+ profiles: [PROFILE_ORG_AUDIT],
127
+ });
128
+
129
+ const op_list_project_roles = defineOperation({
130
+ id: 'org-audit.project.roles.list',
131
+ summary: 'List project role assignments',
132
+ http: { method: 'GET', path: '/api/v2/projects/{projectId}/roles/assignments' },
133
+ authorization: { safetyImpact: 'read' },
134
+ sensitivity: 'none',
135
+ mcp: {
136
+ toolName: 'list_project_roles',
137
+ annotations: READ_ONLY_DEFAULT,
138
+ taskSupport: { exposed: true, taskEligible: false },
139
+ },
140
+ cli: { commandPath: 'projects roles list' },
141
+ profiles: [PROFILE_ORG_AUDIT],
142
+ });
143
+
144
+ const op_list_project_direct_access = defineOperation({
145
+ id: 'org-audit.project.access.list',
146
+ summary: 'List direct project user access grants',
147
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/access' },
148
+ authorization: { safetyImpact: 'read' },
149
+ sensitivity: 'pii.email',
150
+ mcp: {
151
+ toolName: 'list_project_direct_access',
152
+ annotations: READ_ONLY_DEFAULT,
153
+ taskSupport: { exposed: true, taskEligible: false },
154
+ },
155
+ cli: { commandPath: 'projects access list' },
156
+ profiles: [PROFILE_ORG_AUDIT],
157
+ });
158
+
159
+ const op_list_space_access = defineOperation({
160
+ id: 'org-audit.space.access.list',
161
+ summary: 'Compose space ACL from space list/get',
162
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/spaces' },
163
+ authorization: { safetyImpact: 'read' },
164
+ sensitivity: 'none',
165
+ mcp: {
166
+ toolName: 'list_space_access',
167
+ annotations: READ_ONLY_DEFAULT,
168
+ taskSupport: { exposed: true, taskEligible: false },
169
+ },
170
+ profiles: [PROFILE_ORG_AUDIT],
171
+ });
172
+
173
+ const op_resolve_effective_access = defineOperation({
174
+ id: 'org-audit.access.resolve',
175
+ summary: 'Best-effort effective access composition',
176
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles/assignments' },
177
+ authorization: { safetyImpact: 'read' },
178
+ sensitivity: 'none',
179
+ mcp: {
180
+ toolName: 'resolve_effective_access',
181
+ annotations: READ_ONLY_DEFAULT,
182
+ taskSupport: { exposed: true, taskEligible: false },
183
+ },
184
+ profiles: [PROFILE_ORG_AUDIT],
185
+ });
186
+
187
+ const op_list_content = defineOperation({
188
+ id: 'org-audit.content.list',
189
+ summary: 'List charts dashboards and spaces',
190
+ http: { method: 'GET', path: '/api/v2/content' },
191
+ authorization: { safetyImpact: 'read' },
192
+ sensitivity: 'none',
193
+ mcp: {
194
+ toolName: 'list_content',
195
+ annotations: READ_ONLY_DEFAULT,
196
+ taskSupport: { exposed: true, taskEligible: false },
197
+ },
198
+ cli: { commandPath: 'content search' },
199
+ profiles: [PROFILE_ORG_AUDIT],
200
+ });
201
+
202
+ const op_get_dashboard_meta = defineOperation({
203
+ id: 'org-audit.dashboards.meta.get',
204
+ summary: 'Get dashboard metadata without executing queries',
205
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}' },
206
+ authorization: { safetyImpact: 'read' },
207
+ sensitivity: 'none',
208
+ mcp: {
209
+ toolName: 'get_dashboard_meta',
210
+ annotations: READ_ONLY_DEFAULT,
211
+ taskSupport: { exposed: true, taskEligible: false },
212
+ },
213
+ profiles: [PROFILE_ORG_AUDIT],
214
+ });
215
+
216
+ const op_list_validation_results = defineOperation({
217
+ id: 'org-audit.validation.list',
218
+ summary: 'List project validation failures',
219
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/validate' },
220
+ authorization: { safetyImpact: 'read' },
221
+ sensitivity: 'none',
222
+ mcp: {
223
+ toolName: 'list_validation_results',
224
+ annotations: READ_ONLY_DEFAULT,
225
+ taskSupport: { exposed: true, taskEligible: false },
226
+ },
227
+ profiles: [PROFILE_ORG_AUDIT],
228
+ });
229
+
230
+ const op_get_project_user_activity = defineOperation({
231
+ id: 'org-audit.analytics.user-activity.get',
232
+ summary: 'Get project user activity analytics',
233
+ http: { method: 'GET', path: '/api/v1/analytics/user-activity/{projectUuid}' },
234
+ authorization: { safetyImpact: 'read' },
235
+ sensitivity: 'none',
236
+ mcp: {
237
+ toolName: 'get_project_user_activity',
238
+ annotations: READ_ONLY_DEFAULT,
239
+ taskSupport: { exposed: true, taskEligible: false },
240
+ },
241
+ profiles: [PROFILE_ORG_AUDIT],
242
+ });
243
+
244
+ const op_list_project_schedulers = defineOperation({
245
+ id: 'org-audit.schedulers.list',
246
+ summary: 'List project schedulers with destinations redacted by default',
247
+ http: { method: 'GET', path: '/api/v1/schedulers/{projectUuid}/list' },
248
+ authorization: { safetyImpact: 'read' },
249
+ sensitivity: 'secret.destination',
250
+ mcp: {
251
+ toolName: 'list_project_schedulers',
252
+ annotations: READ_ONLY_DEFAULT,
253
+ taskSupport: { exposed: true, taskEligible: false },
254
+ },
255
+ cli: { commandPath: 'schedulers list' },
256
+ profiles: [PROFILE_ORG_AUDIT],
257
+ });
258
+
259
+ const op_get_scheduler = defineOperation({
260
+ id: 'org-audit.schedulers.get',
261
+ summary: 'Get a scheduler by UUID with destinations redacted by default',
262
+ http: { method: 'GET', path: '/api/v1/schedulers/{schedulerUuid}' },
263
+ authorization: { safetyImpact: 'read' },
264
+ sensitivity: 'secret.destination',
265
+ mcp: {
266
+ toolName: 'get_scheduler',
267
+ annotations: READ_ONLY_DEFAULT,
268
+ taskSupport: { exposed: true, taskEligible: false },
269
+ },
270
+ cli: { commandPath: 'schedulers get' },
271
+ profiles: [PROFILE_ORG_AUDIT],
272
+ });
273
+
274
+ export const ORGANIZATION_AUDIT_OPERATIONS: readonly OperationDescriptor[] = [
275
+ op_get_org_profile,
276
+ op_list_org_members,
277
+ op_get_org_member,
278
+ op_list_org_groups,
279
+ op_list_org_projects,
280
+ op_list_org_role_assignments,
281
+ op_list_custom_roles,
282
+ op_get_custom_role,
283
+ op_list_project_roles,
284
+ op_list_project_direct_access,
285
+ op_list_space_access,
286
+ op_resolve_effective_access,
287
+ op_list_content,
288
+ op_get_dashboard_meta,
289
+ op_list_validation_results,
290
+ op_get_project_user_activity,
291
+ op_list_project_schedulers,
292
+ op_get_scheduler,
293
+ ];
@@ -1,20 +1,17 @@
1
1
  import { describe, expect, it } from 'vitest';
2
2
 
3
- import { listBannedMcpToolNames } from './agent-safe';
4
- import { listOperations } from './registry';
3
+ import { listBannedMcpToolNames, listOperations } from './registry';
5
4
 
6
5
  describe('agent-safe surface parity', () => {
7
- it('requires MCP tool name and CLI path for exposed agent operations', () => {
8
- const exposedAgentOps = listOperations().filter(
9
- (operation) =>
10
- operation.agentExposure === 'agent' && operation.mcp.taskSupport.exposed === true,
11
- );
6
+ it('requires MCP tool name or CLI path for agent operations', () => {
7
+ const agentOps = listOperations().filter((operation) => operation.agentExposure === 'agent');
12
8
 
13
- expect(exposedAgentOps.length).toBeGreaterThan(0);
9
+ expect(agentOps.length).toBeGreaterThan(0);
14
10
 
15
- for (const operation of exposedAgentOps) {
16
- expect(operation.mcp.toolName.trim().length).toBeGreaterThan(0);
17
- expect(operation.cli.commandPath.trim().length).toBeGreaterThan(0);
11
+ for (const operation of agentOps) {
12
+ const hasMcp = operation.mcp !== undefined && operation.mcp.toolName.trim().length > 0;
13
+ const hasCli = operation.cli !== undefined && operation.cli.commandPath.trim().length > 0;
14
+ expect(hasMcp || hasCli).toBe(true);
18
15
  }
19
16
  });
20
17
 
@@ -26,9 +23,10 @@ describe('agent-safe surface parity', () => {
26
23
  if (operation.agentExposure !== 'client-only') {
27
24
  continue;
28
25
  }
29
- expect(operation.mcp.taskSupport.exposed).toBe(false);
30
- if (operation.mcp.toolName.trim().length > 0) {
31
- expect(banned).toContain(operation.mcp.toolName);
26
+ expect(operation.mcp).toBeUndefined();
27
+ expect(operation.cli).toBeUndefined();
28
+ if (operation.bannedMcpToolName) {
29
+ expect(banned).toContain(operation.bannedMcpToolName);
32
30
  }
33
31
  }
34
32
  });