@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,98 @@
1
+ "use strict";
2
+ /**
3
+ * Content-governance operations (ADR-0015 / ADR-0017).
4
+ * Soft-delete charts/dashboards and dashboard promote via elicitation-required MCP tools.
5
+ * Permanent purge stays client-only. Chart/SQL-chart promote stay off MCP in v1.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CONTENT_GOVERNANCE_OPERATIONS = void 0;
9
+ const safety_1 = require("../safety");
10
+ const types_1 = require("./types");
11
+ const IMPACT_READ = 'read';
12
+ const IMPACT_WRITE_DESTRUCTIVE = 'write-destructive';
13
+ const PROFILE_CONTENT_GOVERNANCE = 'content-governance';
14
+ const API_V1 = '/api/v1';
15
+ const API_V2 = '/api/v2';
16
+ const op_delete_chart = (0, types_1.defineOperation)({
17
+ id: 'content-governance.charts.delete',
18
+ summary: 'Soft-delete a saved chart (MCP requires form elicitation; restorable until permanently purged)',
19
+ http: {
20
+ method: 'DELETE',
21
+ path: `${API_V2}/projects/{projectUuid}/saved/{chartUuidOrSlug}`,
22
+ },
23
+ authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
24
+ sensitivity: 'none',
25
+ mcp: {
26
+ toolName: 'delete_chart',
27
+ // Catalog keeps WRITE_DESTRUCTIVE defaults (idempotentHint: false). Soft-delete
28
+ // retries are marked idempotent at MCP registration time (registerDestructiveDeleteTool).
29
+ annotations: safety_1.WRITE_DESTRUCTIVE,
30
+ taskSupport: { exposed: true, taskEligible: false },
31
+ },
32
+ profiles: [PROFILE_CONTENT_GOVERNANCE],
33
+ });
34
+ const op_delete_dashboard = (0, types_1.defineOperation)({
35
+ id: 'content-governance.dashboards.delete',
36
+ summary: 'Soft-delete a dashboard (MCP requires form elicitation; restorable until permanently purged)',
37
+ http: {
38
+ method: 'DELETE',
39
+ path: `${API_V2}/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}`,
40
+ },
41
+ authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
42
+ sensitivity: 'none',
43
+ mcp: {
44
+ toolName: 'delete_dashboard',
45
+ annotations: safety_1.WRITE_DESTRUCTIVE,
46
+ taskSupport: { exposed: true, taskEligible: false },
47
+ },
48
+ profiles: [PROFILE_CONTENT_GOVERNANCE],
49
+ });
50
+ const op_get_dashboard_promote_diff = (0, types_1.defineOperation)({
51
+ id: 'content-governance.dashboards.promote-diff',
52
+ summary: 'Get promotion diff for a dashboard against its configured upstream project (read-only)',
53
+ http: {
54
+ method: 'GET',
55
+ path: `${API_V1}/dashboards/{dashboardUuidOrSlug}/promoteDiff`,
56
+ },
57
+ authorization: { safetyImpact: IMPACT_READ },
58
+ sensitivity: 'none',
59
+ mcp: {
60
+ toolName: 'get_dashboard_promote_diff',
61
+ annotations: safety_1.READ_ONLY_DEFAULT,
62
+ taskSupport: { exposed: true, taskEligible: false },
63
+ },
64
+ profiles: [PROFILE_CONTENT_GOVERNANCE],
65
+ });
66
+ const op_promote_dashboard = (0, types_1.defineOperation)({
67
+ id: 'content-governance.dashboards.promote',
68
+ summary: 'Promote a dashboard to its configured upstream project (MCP requires form elicitation)',
69
+ http: {
70
+ method: 'POST',
71
+ path: `${API_V1}/dashboards/{dashboardUuidOrSlug}/promote`,
72
+ },
73
+ authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
74
+ sensitivity: 'none',
75
+ mcp: {
76
+ toolName: 'promote_dashboard',
77
+ annotations: safety_1.WRITE_DESTRUCTIVE,
78
+ taskSupport: { exposed: true, taskEligible: false },
79
+ },
80
+ profiles: [PROFILE_CONTENT_GOVERNANCE],
81
+ });
82
+ const op_permanent_purge = (0, types_1.defineOperation)({
83
+ id: 'content-governance.content.permanent-delete',
84
+ summary: 'Permanently delete soft-deleted content (client-only; irrecoverable — not exposed on MCP)',
85
+ http: { method: 'DELETE', path: `${API_V2}/content/{projectUuid}/permanent` },
86
+ authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
87
+ sensitivity: 'none',
88
+ agentExposure: 'client-only',
89
+ bannedMcpToolName: 'permanent_delete_content',
90
+ profiles: [PROFILE_CONTENT_GOVERNANCE],
91
+ });
92
+ exports.CONTENT_GOVERNANCE_OPERATIONS = [
93
+ op_delete_chart,
94
+ op_delete_dashboard,
95
+ op_get_dashboard_promote_diff,
96
+ op_promote_dashboard,
97
+ op_permanent_purge,
98
+ ];
@@ -0,0 +1,2 @@
1
+ import type { OperationDescriptor } from './types';
2
+ export declare const CONTENT_READER_OPERATIONS: readonly OperationDescriptor[];
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTENT_READER_OPERATIONS = void 0;
4
+ /**
5
+ * Content-reader operations in the shared operation catalog (ADR-0013).
6
+ */
7
+ const safety_1 = require("../safety");
8
+ const types_1 = require("./types");
9
+ const PROFILE_CONTENT_READER = 'content-reader';
10
+ const PROFILE_CONTENT_DEVELOPER = 'content-developer';
11
+ const op_search_content = (0, types_1.defineOperation)({
12
+ id: 'content-reader.content.search',
13
+ summary: 'Search charts dashboards and spaces in a project',
14
+ http: { method: 'GET', path: '/api/v2/content' },
15
+ authorization: { safetyImpact: 'read' },
16
+ sensitivity: 'none',
17
+ mcp: {
18
+ toolName: 'search_content',
19
+ annotations: safety_1.READ_ONLY_DEFAULT,
20
+ taskSupport: { exposed: true, taskEligible: false },
21
+ },
22
+ cli: { commandPath: 'content search' },
23
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
24
+ });
25
+ const op_list_spaces = (0, types_1.defineOperation)({
26
+ id: 'content-reader.spaces.list',
27
+ summary: 'List project spaces',
28
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/spaces' },
29
+ authorization: { safetyImpact: 'read' },
30
+ sensitivity: 'none',
31
+ mcp: {
32
+ toolName: 'list_spaces',
33
+ annotations: safety_1.READ_ONLY_DEFAULT,
34
+ taskSupport: { exposed: true, taskEligible: false },
35
+ },
36
+ cli: { commandPath: 'projects spaces list' },
37
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
38
+ });
39
+ const op_get_space = (0, types_1.defineOperation)({
40
+ id: 'content-reader.spaces.get',
41
+ summary: 'Get a space with breadcrumbs and content summaries',
42
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/spaces/{spaceUuid}' },
43
+ authorization: { safetyImpact: 'read' },
44
+ sensitivity: 'none',
45
+ mcp: {
46
+ toolName: 'get_space',
47
+ annotations: safety_1.READ_ONLY_DEFAULT,
48
+ taskSupport: { exposed: true, taskEligible: false },
49
+ },
50
+ cli: { commandPath: 'projects spaces get' },
51
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
52
+ });
53
+ const op_get_dashboard = (0, types_1.defineOperation)({
54
+ id: 'content-reader.dashboards.get',
55
+ summary: 'Get dashboard structure before tile execution',
56
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}' },
57
+ authorization: { safetyImpact: 'read' },
58
+ sensitivity: 'none',
59
+ mcp: {
60
+ toolName: 'get_dashboard',
61
+ annotations: safety_1.READ_ONLY_DEFAULT,
62
+ taskSupport: { exposed: true, taskEligible: false },
63
+ },
64
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
65
+ });
66
+ const op_get_chart = (0, types_1.defineOperation)({
67
+ id: 'content-reader.charts.get',
68
+ summary: 'Get a saved chart definition',
69
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/saved/{chartUuidOrSlug}' },
70
+ authorization: { safetyImpact: 'read' },
71
+ sensitivity: 'none',
72
+ mcp: {
73
+ toolName: 'get_chart',
74
+ annotations: safety_1.READ_ONLY_DEFAULT,
75
+ taskSupport: { exposed: true, taskEligible: false },
76
+ },
77
+ profiles: [PROFILE_CONTENT_READER, PROFILE_CONTENT_DEVELOPER],
78
+ });
79
+ const op_list_project_parameters = (0, types_1.defineOperation)({
80
+ id: 'content-reader.parameters.list',
81
+ summary: 'List project parameter definitions',
82
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/parameters/list' },
83
+ authorization: { safetyImpact: 'read' },
84
+ sensitivity: 'none',
85
+ mcp: {
86
+ toolName: 'list_project_parameters',
87
+ annotations: safety_1.READ_ONLY_DEFAULT,
88
+ taskSupport: { exposed: true, taskEligible: false },
89
+ },
90
+ profiles: [PROFILE_CONTENT_READER],
91
+ });
92
+ const op_get_project_parameters = (0, types_1.defineOperation)({
93
+ id: 'content-reader.parameters.get',
94
+ summary: 'Get project parameters by name',
95
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/parameters' },
96
+ authorization: { safetyImpact: 'read' },
97
+ sensitivity: 'none',
98
+ mcp: {
99
+ toolName: 'get_project_parameters',
100
+ annotations: safety_1.READ_ONLY_DEFAULT,
101
+ taskSupport: { exposed: true, taskEligible: false },
102
+ },
103
+ profiles: [PROFILE_CONTENT_READER],
104
+ });
105
+ const op_explain_content = (0, types_1.defineOperation)({
106
+ id: 'content-reader.content.explain',
107
+ summary: 'Explain saved content from metadata',
108
+ http: { method: 'GET', path: '/api/v2/content' },
109
+ authorization: { safetyImpact: 'read' },
110
+ sensitivity: 'none',
111
+ mcp: {
112
+ toolName: 'explain_content',
113
+ annotations: safety_1.READ_ONLY_DEFAULT,
114
+ taskSupport: { exposed: true, taskEligible: false },
115
+ },
116
+ profiles: [PROFILE_CONTENT_READER],
117
+ });
118
+ const op_run_chart = (0, types_1.defineOperation)({
119
+ id: 'content-reader.charts.run',
120
+ summary: 'Execute a saved semantic chart with bounded results',
121
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/chart' },
122
+ authorization: { safetyImpact: 'read' },
123
+ sensitivity: 'none',
124
+ mcp: {
125
+ toolName: 'run_chart',
126
+ annotations: safety_1.READ_ONLY_TRANSIENT,
127
+ taskSupport: { exposed: true, taskEligible: false },
128
+ },
129
+ profiles: [PROFILE_CONTENT_READER],
130
+ });
131
+ const op_export_chart_image = (0, types_1.defineOperation)({
132
+ id: 'content-reader.charts.export-image',
133
+ summary: 'Export a saved chart as a PNG image snapshot',
134
+ http: { method: 'POST', path: '/api/v1/saved/{chartUuid}/export' },
135
+ authorization: { safetyImpact: 'read' },
136
+ sensitivity: 'none',
137
+ mcp: {
138
+ toolName: 'export_chart_image',
139
+ annotations: safety_1.READ_ONLY_TRANSIENT,
140
+ taskSupport: { exposed: true, taskEligible: false },
141
+ },
142
+ profiles: [PROFILE_CONTENT_READER],
143
+ });
144
+ const op_run_dashboard_tile = (0, types_1.defineOperation)({
145
+ id: 'content-reader.dashboards.run-tile',
146
+ summary: 'Execute a dashboard tile with bounded results',
147
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/dashboard-chart' },
148
+ authorization: { safetyImpact: 'read' },
149
+ sensitivity: 'none',
150
+ mcp: {
151
+ toolName: 'run_dashboard_tile',
152
+ annotations: safety_1.READ_ONLY_TRANSIENT,
153
+ taskSupport: { exposed: true, taskEligible: false },
154
+ },
155
+ profiles: [PROFILE_CONTENT_READER],
156
+ });
157
+ const op_get_query_result = (0, types_1.defineOperation)({
158
+ id: 'content-reader.query.result.get',
159
+ summary: 'Get or poll a query result by queryUuid',
160
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/query/{queryUuid}' },
161
+ authorization: { safetyImpact: 'read' },
162
+ sensitivity: 'none',
163
+ mcp: {
164
+ toolName: 'get_query_result',
165
+ annotations: safety_1.READ_ONLY_DEFAULT,
166
+ taskSupport: { exposed: true, taskEligible: false },
167
+ },
168
+ profiles: [PROFILE_CONTENT_READER],
169
+ });
170
+ const op_cancel_query = (0, types_1.defineOperation)({
171
+ id: 'content-reader.query.cancel',
172
+ summary: 'Cancel a running query by queryUuid',
173
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/{queryUuid}/cancel' },
174
+ authorization: { safetyImpact: 'read' },
175
+ sensitivity: 'none',
176
+ mcp: {
177
+ toolName: 'cancel_query',
178
+ annotations: safety_1.READ_ONLY_TRANSIENT,
179
+ taskSupport: { exposed: true, taskEligible: false },
180
+ },
181
+ profiles: [PROFILE_CONTENT_READER],
182
+ });
183
+ exports.CONTENT_READER_OPERATIONS = [
184
+ op_search_content,
185
+ op_list_spaces,
186
+ op_get_space,
187
+ op_get_dashboard,
188
+ op_get_chart,
189
+ op_list_project_parameters,
190
+ op_get_project_parameters,
191
+ op_explain_content,
192
+ op_run_chart,
193
+ op_export_chart_image,
194
+ op_run_dashboard_tile,
195
+ op_get_query_result,
196
+ op_cancel_query,
197
+ ];
@@ -1,5 +1,12 @@
1
- export { defineOperation, type AgentExposure, type CapabilityProfile, type HttpMethod, type McpTaskSupport, type OperationAuthorization, type OperationCli, type OperationDescriptor, type OperationHttp, type OperationMcp, } from './types';
2
- export { IRRECOVERABLE_TOOL_DENYLIST, listBannedMcpToolNames } from './agent-safe';
1
+ export { defineOperation, type AgentExposure, type CapabilityProfile, type HttpMethod, type McpTaskSupport, type OperationAuthorization, type OperationCli, type OperationDefinitionInput, type OperationDescriptor, type OperationHttp, type OperationMcp, type SensitivityClass, } from './types';
2
+ export { IRRECOVERABLE_TOOL_DENYLIST } from './agent-safe';
3
3
  export { AI_AGENT_OPERATIONS } from './ai-agents';
4
+ export { CLI_CONTENT_OPERATIONS } from './cli-content';
5
+ export { CONTENT_DEVELOPER_OPERATIONS } from './content-developer';
6
+ export { CONTENT_GOVERNANCE_OPERATIONS } from './content-governance';
7
+ export { CONTENT_READER_OPERATIONS } from './content-reader';
8
+ export { ORGANIZATION_AUDIT_OPERATIONS } from './organization-audit';
9
+ export { SEMANTIC_LAYER_OPERATIONS } from './semantic-layer';
4
10
  export { USER_OPERATIONS } from './users';
5
- export { getOperation, getOperationsByProfile, listOperations } from './registry';
11
+ export { getOperation, getOperationByMcpToolName, getOperationsByProfile, listBannedMcpToolNames, listExposedMcpToolNames, listMcpToolNamesByProfile, listOperations, } from './registry';
12
+ export { OPERATION_CLIENT_METHOD_MAP, getClientMethodForOperation, type CataloguedOperationId, type ClientMethodRef, } from './client-coverage';
@@ -1,16 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listOperations = exports.getOperationsByProfile = exports.getOperation = exports.USER_OPERATIONS = exports.AI_AGENT_OPERATIONS = exports.listBannedMcpToolNames = exports.IRRECOVERABLE_TOOL_DENYLIST = exports.defineOperation = void 0;
3
+ exports.getClientMethodForOperation = exports.OPERATION_CLIENT_METHOD_MAP = exports.listOperations = exports.listMcpToolNamesByProfile = exports.listExposedMcpToolNames = exports.listBannedMcpToolNames = exports.getOperationsByProfile = exports.getOperationByMcpToolName = exports.getOperation = exports.USER_OPERATIONS = exports.SEMANTIC_LAYER_OPERATIONS = exports.ORGANIZATION_AUDIT_OPERATIONS = exports.CONTENT_READER_OPERATIONS = exports.CONTENT_GOVERNANCE_OPERATIONS = exports.CONTENT_DEVELOPER_OPERATIONS = exports.CLI_CONTENT_OPERATIONS = exports.AI_AGENT_OPERATIONS = exports.IRRECOVERABLE_TOOL_DENYLIST = exports.defineOperation = void 0;
4
4
  var types_1 = require("./types");
5
5
  Object.defineProperty(exports, "defineOperation", { enumerable: true, get: function () { return types_1.defineOperation; } });
6
6
  var agent_safe_1 = require("./agent-safe");
7
7
  Object.defineProperty(exports, "IRRECOVERABLE_TOOL_DENYLIST", { enumerable: true, get: function () { return agent_safe_1.IRRECOVERABLE_TOOL_DENYLIST; } });
8
- Object.defineProperty(exports, "listBannedMcpToolNames", { enumerable: true, get: function () { return agent_safe_1.listBannedMcpToolNames; } });
9
8
  var ai_agents_1 = require("./ai-agents");
10
9
  Object.defineProperty(exports, "AI_AGENT_OPERATIONS", { enumerable: true, get: function () { return ai_agents_1.AI_AGENT_OPERATIONS; } });
10
+ var cli_content_1 = require("./cli-content");
11
+ Object.defineProperty(exports, "CLI_CONTENT_OPERATIONS", { enumerable: true, get: function () { return cli_content_1.CLI_CONTENT_OPERATIONS; } });
12
+ var content_developer_1 = require("./content-developer");
13
+ Object.defineProperty(exports, "CONTENT_DEVELOPER_OPERATIONS", { enumerable: true, get: function () { return content_developer_1.CONTENT_DEVELOPER_OPERATIONS; } });
14
+ var content_governance_1 = require("./content-governance");
15
+ Object.defineProperty(exports, "CONTENT_GOVERNANCE_OPERATIONS", { enumerable: true, get: function () { return content_governance_1.CONTENT_GOVERNANCE_OPERATIONS; } });
16
+ var content_reader_1 = require("./content-reader");
17
+ Object.defineProperty(exports, "CONTENT_READER_OPERATIONS", { enumerable: true, get: function () { return content_reader_1.CONTENT_READER_OPERATIONS; } });
18
+ var organization_audit_1 = require("./organization-audit");
19
+ Object.defineProperty(exports, "ORGANIZATION_AUDIT_OPERATIONS", { enumerable: true, get: function () { return organization_audit_1.ORGANIZATION_AUDIT_OPERATIONS; } });
20
+ var semantic_layer_1 = require("./semantic-layer");
21
+ Object.defineProperty(exports, "SEMANTIC_LAYER_OPERATIONS", { enumerable: true, get: function () { return semantic_layer_1.SEMANTIC_LAYER_OPERATIONS; } });
11
22
  var users_1 = require("./users");
12
23
  Object.defineProperty(exports, "USER_OPERATIONS", { enumerable: true, get: function () { return users_1.USER_OPERATIONS; } });
13
24
  var registry_1 = require("./registry");
14
25
  Object.defineProperty(exports, "getOperation", { enumerable: true, get: function () { return registry_1.getOperation; } });
26
+ Object.defineProperty(exports, "getOperationByMcpToolName", { enumerable: true, get: function () { return registry_1.getOperationByMcpToolName; } });
15
27
  Object.defineProperty(exports, "getOperationsByProfile", { enumerable: true, get: function () { return registry_1.getOperationsByProfile; } });
28
+ Object.defineProperty(exports, "listBannedMcpToolNames", { enumerable: true, get: function () { return registry_1.listBannedMcpToolNames; } });
29
+ Object.defineProperty(exports, "listExposedMcpToolNames", { enumerable: true, get: function () { return registry_1.listExposedMcpToolNames; } });
30
+ Object.defineProperty(exports, "listMcpToolNamesByProfile", { enumerable: true, get: function () { return registry_1.listMcpToolNamesByProfile; } });
16
31
  Object.defineProperty(exports, "listOperations", { enumerable: true, get: function () { return registry_1.listOperations; } });
32
+ var client_coverage_1 = require("./client-coverage");
33
+ Object.defineProperty(exports, "OPERATION_CLIENT_METHOD_MAP", { enumerable: true, get: function () { return client_coverage_1.OPERATION_CLIENT_METHOD_MAP; } });
34
+ Object.defineProperty(exports, "getClientMethodForOperation", { enumerable: true, get: function () { return client_coverage_1.getClientMethodForOperation; } });
@@ -0,0 +1,2 @@
1
+ import type { OperationDescriptor } from './types';
2
+ export declare const ORGANIZATION_AUDIT_OPERATIONS: readonly OperationDescriptor[];
@@ -0,0 +1,273 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ORGANIZATION_AUDIT_OPERATIONS = void 0;
4
+ /**
5
+ * Organization-audit operations in the shared operation catalog (ADR-0013).
6
+ */
7
+ const safety_1 = require("../safety");
8
+ const types_1 = require("./types");
9
+ const PROFILE_ORG_AUDIT = 'org-audit-readonly';
10
+ const op_get_org_profile = (0, types_1.defineOperation)({
11
+ id: 'org-audit.org.profile.get',
12
+ summary: 'Get organization profile for the authenticated user',
13
+ http: { method: 'GET', path: '/api/v1/org' },
14
+ authorization: { safetyImpact: 'read' },
15
+ sensitivity: 'none',
16
+ mcp: {
17
+ toolName: 'get_org_profile',
18
+ annotations: safety_1.READ_ONLY_DEFAULT,
19
+ taskSupport: { exposed: true, taskEligible: false },
20
+ },
21
+ cli: { commandPath: 'organization get' },
22
+ profiles: [PROFILE_ORG_AUDIT],
23
+ });
24
+ const op_list_org_members = (0, types_1.defineOperation)({
25
+ id: 'org-audit.members.list',
26
+ summary: 'List organization members',
27
+ http: { method: 'GET', path: '/api/v1/org/users' },
28
+ authorization: { safetyImpact: 'read' },
29
+ sensitivity: 'pii.email',
30
+ mcp: {
31
+ toolName: 'list_org_members',
32
+ annotations: safety_1.READ_ONLY_DEFAULT,
33
+ taskSupport: { exposed: true, taskEligible: false },
34
+ },
35
+ cli: { commandPath: 'users list' },
36
+ profiles: [PROFILE_ORG_AUDIT],
37
+ });
38
+ const op_get_org_member = (0, types_1.defineOperation)({
39
+ id: 'org-audit.members.get',
40
+ summary: 'Get an organization member by UUID',
41
+ http: { method: 'GET', path: '/api/v1/org/users/{userUuid}' },
42
+ authorization: { safetyImpact: 'read' },
43
+ sensitivity: 'pii.email',
44
+ mcp: {
45
+ toolName: 'get_org_member',
46
+ annotations: safety_1.READ_ONLY_DEFAULT,
47
+ taskSupport: { exposed: true, taskEligible: false },
48
+ },
49
+ cli: { commandPath: 'users get' },
50
+ profiles: [PROFILE_ORG_AUDIT],
51
+ });
52
+ const op_list_org_groups = (0, types_1.defineOperation)({
53
+ id: 'org-audit.groups.list',
54
+ summary: 'List organization groups',
55
+ http: { method: 'GET', path: '/api/v1/org/groups' },
56
+ authorization: { safetyImpact: 'read' },
57
+ sensitivity: 'pii.email',
58
+ mcp: {
59
+ toolName: 'list_org_groups',
60
+ annotations: safety_1.READ_ONLY_DEFAULT,
61
+ taskSupport: { exposed: true, taskEligible: false },
62
+ },
63
+ cli: { commandPath: 'groups list' },
64
+ profiles: [PROFILE_ORG_AUDIT],
65
+ });
66
+ const op_list_org_projects = (0, types_1.defineOperation)({
67
+ id: 'org-audit.projects.list',
68
+ summary: 'List organization projects without connection secrets',
69
+ http: { method: 'GET', path: '/api/v1/org/projects' },
70
+ authorization: { safetyImpact: 'read' },
71
+ sensitivity: 'secret.connection',
72
+ mcp: {
73
+ toolName: 'list_org_projects',
74
+ annotations: safety_1.READ_ONLY_DEFAULT,
75
+ taskSupport: { exposed: true, taskEligible: false },
76
+ },
77
+ cli: { commandPath: 'projects list' },
78
+ profiles: [PROFILE_ORG_AUDIT],
79
+ });
80
+ const op_list_org_role_assignments = (0, types_1.defineOperation)({
81
+ id: 'org-audit.roles.assignments.list',
82
+ summary: 'List organization role assignments',
83
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles/assignments' },
84
+ authorization: { safetyImpact: 'read' },
85
+ sensitivity: 'none',
86
+ mcp: {
87
+ toolName: 'list_org_role_assignments',
88
+ annotations: safety_1.READ_ONLY_DEFAULT,
89
+ taskSupport: { exposed: true, taskEligible: false },
90
+ },
91
+ profiles: [PROFILE_ORG_AUDIT],
92
+ });
93
+ const op_list_custom_roles = (0, types_1.defineOperation)({
94
+ id: 'org-audit.roles.list',
95
+ summary: 'List organization custom and system roles',
96
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles' },
97
+ authorization: { safetyImpact: 'read' },
98
+ sensitivity: 'none',
99
+ mcp: {
100
+ toolName: 'list_custom_roles',
101
+ annotations: safety_1.READ_ONLY_DEFAULT,
102
+ taskSupport: { exposed: true, taskEligible: false },
103
+ },
104
+ profiles: [PROFILE_ORG_AUDIT],
105
+ });
106
+ const op_get_custom_role = (0, types_1.defineOperation)({
107
+ id: 'org-audit.roles.get',
108
+ summary: 'Get a role including scopes',
109
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles/{roleUuid}' },
110
+ authorization: { safetyImpact: 'read' },
111
+ sensitivity: 'none',
112
+ mcp: {
113
+ toolName: 'get_custom_role',
114
+ annotations: safety_1.READ_ONLY_DEFAULT,
115
+ taskSupport: { exposed: true, taskEligible: false },
116
+ },
117
+ profiles: [PROFILE_ORG_AUDIT],
118
+ });
119
+ const op_list_project_roles = (0, types_1.defineOperation)({
120
+ id: 'org-audit.project.roles.list',
121
+ summary: 'List project role assignments',
122
+ http: { method: 'GET', path: '/api/v2/projects/{projectId}/roles/assignments' },
123
+ authorization: { safetyImpact: 'read' },
124
+ sensitivity: 'none',
125
+ mcp: {
126
+ toolName: 'list_project_roles',
127
+ annotations: safety_1.READ_ONLY_DEFAULT,
128
+ taskSupport: { exposed: true, taskEligible: false },
129
+ },
130
+ cli: { commandPath: 'projects roles list' },
131
+ profiles: [PROFILE_ORG_AUDIT],
132
+ });
133
+ const op_list_project_direct_access = (0, types_1.defineOperation)({
134
+ id: 'org-audit.project.access.list',
135
+ summary: 'List direct project user access grants',
136
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/access' },
137
+ authorization: { safetyImpact: 'read' },
138
+ sensitivity: 'pii.email',
139
+ mcp: {
140
+ toolName: 'list_project_direct_access',
141
+ annotations: safety_1.READ_ONLY_DEFAULT,
142
+ taskSupport: { exposed: true, taskEligible: false },
143
+ },
144
+ cli: { commandPath: 'projects access list' },
145
+ profiles: [PROFILE_ORG_AUDIT],
146
+ });
147
+ const op_list_space_access = (0, types_1.defineOperation)({
148
+ id: 'org-audit.space.access.list',
149
+ summary: 'Compose space ACL from space list/get',
150
+ http: { method: 'GET', path: '/api/v1/projects/{projectUuid}/spaces' },
151
+ authorization: { safetyImpact: 'read' },
152
+ sensitivity: 'none',
153
+ mcp: {
154
+ toolName: 'list_space_access',
155
+ annotations: safety_1.READ_ONLY_DEFAULT,
156
+ taskSupport: { exposed: true, taskEligible: false },
157
+ },
158
+ profiles: [PROFILE_ORG_AUDIT],
159
+ });
160
+ const op_resolve_effective_access = (0, types_1.defineOperation)({
161
+ id: 'org-audit.access.resolve',
162
+ summary: 'Best-effort effective access composition',
163
+ http: { method: 'GET', path: '/api/v2/orgs/{orgUuid}/roles/assignments' },
164
+ authorization: { safetyImpact: 'read' },
165
+ sensitivity: 'none',
166
+ mcp: {
167
+ toolName: 'resolve_effective_access',
168
+ annotations: safety_1.READ_ONLY_DEFAULT,
169
+ taskSupport: { exposed: true, taskEligible: false },
170
+ },
171
+ profiles: [PROFILE_ORG_AUDIT],
172
+ });
173
+ const op_list_content = (0, types_1.defineOperation)({
174
+ id: 'org-audit.content.list',
175
+ summary: 'List charts dashboards and spaces',
176
+ http: { method: 'GET', path: '/api/v2/content' },
177
+ authorization: { safetyImpact: 'read' },
178
+ sensitivity: 'none',
179
+ mcp: {
180
+ toolName: 'list_content',
181
+ annotations: safety_1.READ_ONLY_DEFAULT,
182
+ taskSupport: { exposed: true, taskEligible: false },
183
+ },
184
+ cli: { commandPath: 'content search' },
185
+ profiles: [PROFILE_ORG_AUDIT],
186
+ });
187
+ const op_get_dashboard_meta = (0, types_1.defineOperation)({
188
+ id: 'org-audit.dashboards.meta.get',
189
+ summary: 'Get dashboard metadata without executing queries',
190
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/dashboards/{dashboardUuidOrSlug}' },
191
+ authorization: { safetyImpact: 'read' },
192
+ sensitivity: 'none',
193
+ mcp: {
194
+ toolName: 'get_dashboard_meta',
195
+ annotations: safety_1.READ_ONLY_DEFAULT,
196
+ taskSupport: { exposed: true, taskEligible: false },
197
+ },
198
+ profiles: [PROFILE_ORG_AUDIT],
199
+ });
200
+ const op_list_validation_results = (0, types_1.defineOperation)({
201
+ id: 'org-audit.validation.list',
202
+ summary: 'List project validation failures',
203
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/validate' },
204
+ authorization: { safetyImpact: 'read' },
205
+ sensitivity: 'none',
206
+ mcp: {
207
+ toolName: 'list_validation_results',
208
+ annotations: safety_1.READ_ONLY_DEFAULT,
209
+ taskSupport: { exposed: true, taskEligible: false },
210
+ },
211
+ profiles: [PROFILE_ORG_AUDIT],
212
+ });
213
+ const op_get_project_user_activity = (0, types_1.defineOperation)({
214
+ id: 'org-audit.analytics.user-activity.get',
215
+ summary: 'Get project user activity analytics',
216
+ http: { method: 'GET', path: '/api/v1/analytics/user-activity/{projectUuid}' },
217
+ authorization: { safetyImpact: 'read' },
218
+ sensitivity: 'none',
219
+ mcp: {
220
+ toolName: 'get_project_user_activity',
221
+ annotations: safety_1.READ_ONLY_DEFAULT,
222
+ taskSupport: { exposed: true, taskEligible: false },
223
+ },
224
+ profiles: [PROFILE_ORG_AUDIT],
225
+ });
226
+ const op_list_project_schedulers = (0, types_1.defineOperation)({
227
+ id: 'org-audit.schedulers.list',
228
+ summary: 'List project schedulers with destinations redacted by default',
229
+ http: { method: 'GET', path: '/api/v1/schedulers/{projectUuid}/list' },
230
+ authorization: { safetyImpact: 'read' },
231
+ sensitivity: 'secret.destination',
232
+ mcp: {
233
+ toolName: 'list_project_schedulers',
234
+ annotations: safety_1.READ_ONLY_DEFAULT,
235
+ taskSupport: { exposed: true, taskEligible: false },
236
+ },
237
+ cli: { commandPath: 'schedulers list' },
238
+ profiles: [PROFILE_ORG_AUDIT],
239
+ });
240
+ const op_get_scheduler = (0, types_1.defineOperation)({
241
+ id: 'org-audit.schedulers.get',
242
+ summary: 'Get a scheduler by UUID with destinations redacted by default',
243
+ http: { method: 'GET', path: '/api/v1/schedulers/{schedulerUuid}' },
244
+ authorization: { safetyImpact: 'read' },
245
+ sensitivity: 'secret.destination',
246
+ mcp: {
247
+ toolName: 'get_scheduler',
248
+ annotations: safety_1.READ_ONLY_DEFAULT,
249
+ taskSupport: { exposed: true, taskEligible: false },
250
+ },
251
+ cli: { commandPath: 'schedulers get' },
252
+ profiles: [PROFILE_ORG_AUDIT],
253
+ });
254
+ exports.ORGANIZATION_AUDIT_OPERATIONS = [
255
+ op_get_org_profile,
256
+ op_list_org_members,
257
+ op_get_org_member,
258
+ op_list_org_groups,
259
+ op_list_org_projects,
260
+ op_list_org_role_assignments,
261
+ op_list_custom_roles,
262
+ op_get_custom_role,
263
+ op_list_project_roles,
264
+ op_list_project_direct_access,
265
+ op_list_space_access,
266
+ op_resolve_effective_access,
267
+ op_list_content,
268
+ op_get_dashboard_meta,
269
+ op_list_validation_results,
270
+ op_get_project_user_activity,
271
+ op_list_project_schedulers,
272
+ op_get_scheduler,
273
+ ];