@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.
Files changed (120) hide show
  1. package/dist/agentops/extract-yaml-project.d.ts +7 -0
  2. package/dist/agentops/extract-yaml-project.js +42 -0
  3. package/dist/agentops/formatters.d.ts +5 -0
  4. package/dist/agentops/formatters.js +47 -0
  5. package/dist/agentops/snapshots.d.ts +32 -0
  6. package/dist/agentops/snapshots.js +34 -0
  7. package/dist/agentops/types.d.ts +224 -0
  8. package/dist/agentops/types.js +430 -0
  9. package/dist/argument-validation.d.ts +25 -0
  10. package/dist/argument-validation.js +217 -0
  11. package/dist/argument-validation.test.d.ts +1 -0
  12. package/dist/argument-validation.test.js +205 -0
  13. package/dist/audit.d.ts +9 -2
  14. package/dist/audit.js +17 -2
  15. package/dist/audit.test.d.ts +1 -0
  16. package/dist/audit.test.js +73 -0
  17. package/dist/env.d.ts +8 -0
  18. package/dist/env.js +9 -1
  19. package/dist/index.d.ts +7 -3
  20. package/dist/index.js +14 -2
  21. package/dist/input-validation.d.ts +35 -0
  22. package/dist/input-validation.js +87 -0
  23. package/dist/input-validation.test.js +93 -0
  24. package/dist/operations/agent-safe.d.ts +5 -0
  25. package/dist/operations/agent-safe.js +9 -0
  26. package/dist/operations/ai-agents.d.ts +6 -0
  27. package/dist/operations/ai-agents.js +427 -0
  28. package/dist/operations/cli-content.d.ts +5 -0
  29. package/dist/operations/cli-content.js +71 -0
  30. package/dist/operations/client-coverage.d.ts +113 -0
  31. package/dist/operations/client-coverage.js +130 -0
  32. package/dist/operations/client-coverage.test.d.ts +1 -0
  33. package/dist/operations/client-coverage.test.js +22 -0
  34. package/dist/operations/content-developer.d.ts +2 -0
  35. package/dist/operations/content-developer.js +457 -0
  36. package/dist/operations/content-governance.d.ts +7 -0
  37. package/dist/operations/content-governance.js +98 -0
  38. package/dist/operations/content-reader.d.ts +2 -0
  39. package/dist/operations/content-reader.js +183 -0
  40. package/dist/operations/index.d.ts +12 -0
  41. package/dist/operations/index.js +34 -0
  42. package/dist/operations/organization-audit.d.ts +2 -0
  43. package/dist/operations/organization-audit.js +273 -0
  44. package/dist/operations/parity.test.d.ts +1 -0
  45. package/dist/operations/parity.test.js +29 -0
  46. package/dist/operations/registry.d.ts +18 -0
  47. package/dist/operations/registry.js +110 -0
  48. package/dist/operations/registry.test.d.ts +1 -0
  49. package/dist/operations/registry.test.js +223 -0
  50. package/dist/operations/semantic-layer.d.ts +6 -0
  51. package/dist/operations/semantic-layer.js +154 -0
  52. package/dist/operations/types.d.ts +86 -0
  53. package/dist/operations/types.js +104 -0
  54. package/dist/operations/types.test.d.ts +1 -0
  55. package/dist/operations/types.test.js +92 -0
  56. package/dist/operations/users.d.ts +6 -0
  57. package/dist/operations/users.js +58 -0
  58. package/dist/safety.d.ts +32 -2
  59. package/dist/safety.js +62 -5
  60. package/dist/safety.test.js +217 -4
  61. package/dist/types/generated/openapi-types.d.ts +32623 -11194
  62. package/dist/types/index.d.ts +12 -0
  63. package/dist/types/index.js +29 -0
  64. package/dist/types/lightdash-api.d.ts +1 -1
  65. package/dist/types/v1/ai-agents.d.ts +112 -3
  66. package/dist/types/v1/charts.d.ts +5 -3
  67. package/dist/types/v1/dashboards.d.ts +13 -0
  68. package/dist/types/v1/index.d.ts +45 -8
  69. package/dist/types/v1/index.js +1 -1
  70. package/dist/types/v1/lightdash-api.d.ts +107 -16
  71. package/dist/types/v1/users.d.ts +4 -0
  72. package/dist/types/v2/content.d.ts +2 -0
  73. package/dist/types/v2/content.js +8 -0
  74. package/dist/types/v2/index.d.ts +11 -9
  75. package/dist/types/v2/index.js +1 -1
  76. package/package.json +17 -3
  77. package/src/agentops/extract-yaml-project.ts +42 -0
  78. package/src/agentops/formatters.ts +52 -0
  79. package/src/agentops/snapshots.ts +56 -0
  80. package/src/agentops/types.ts +599 -0
  81. package/src/argument-validation.test.ts +301 -0
  82. package/src/argument-validation.ts +258 -0
  83. package/src/audit.test.ts +87 -0
  84. package/src/audit.ts +32 -3
  85. package/src/env.ts +9 -0
  86. package/src/index.test.ts +1 -0
  87. package/src/index.ts +17 -6
  88. package/src/input-validation.test.ts +157 -1
  89. package/src/input-validation.ts +95 -0
  90. package/src/operations/agent-safe.ts +8 -0
  91. package/src/operations/ai-agents.ts +467 -0
  92. package/src/operations/cli-content.ts +79 -0
  93. package/src/operations/client-coverage.test.ts +23 -0
  94. package/src/operations/client-coverage.ts +147 -0
  95. package/src/operations/content-developer.ts +485 -0
  96. package/src/operations/content-governance.ts +110 -0
  97. package/src/operations/content-reader.ts +197 -0
  98. package/src/operations/index.ts +42 -0
  99. package/src/operations/organization-audit.ts +293 -0
  100. package/src/operations/parity.test.ts +33 -0
  101. package/src/operations/registry.test.ts +250 -0
  102. package/src/operations/registry.ts +128 -0
  103. package/src/operations/semantic-layer.ts +166 -0
  104. package/src/operations/types.test.ts +110 -0
  105. package/src/operations/types.ts +231 -0
  106. package/src/operations/users.ts +65 -0
  107. package/src/safety.test.ts +276 -4
  108. package/src/safety.ts +83 -4
  109. package/src/types/generated/openapi-types.ts +33701 -11813
  110. package/src/types/index.ts +13 -0
  111. package/src/types/lightdash-api.ts +39 -0
  112. package/src/types/v1/ai-agents.ts +133 -3
  113. package/src/types/v1/charts.ts +5 -3
  114. package/src/types/v1/dashboards.ts +19 -0
  115. package/src/types/v1/index.ts +51 -8
  116. package/src/types/v1/lightdash-api.ts +129 -20
  117. package/src/types/v1/users.ts +4 -0
  118. package/src/types/v2/content.ts +8 -0
  119. package/src/types/v2/index.ts +11 -9
  120. package/tsconfig.json +1 -0
@@ -0,0 +1,183 @@
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_run_dashboard_tile = (0, types_1.defineOperation)({
132
+ id: 'content-reader.dashboards.run-tile',
133
+ summary: 'Execute a dashboard tile with bounded results',
134
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/dashboard-chart' },
135
+ authorization: { safetyImpact: 'read' },
136
+ sensitivity: 'none',
137
+ mcp: {
138
+ toolName: 'run_dashboard_tile',
139
+ annotations: safety_1.READ_ONLY_TRANSIENT,
140
+ taskSupport: { exposed: true, taskEligible: false },
141
+ },
142
+ profiles: [PROFILE_CONTENT_READER],
143
+ });
144
+ const op_get_query_result = (0, types_1.defineOperation)({
145
+ id: 'content-reader.query.result.get',
146
+ summary: 'Get or poll a session-owned query result',
147
+ http: { method: 'GET', path: '/api/v2/projects/{projectUuid}/query/{queryUuid}' },
148
+ authorization: { safetyImpact: 'read' },
149
+ sensitivity: 'none',
150
+ mcp: {
151
+ toolName: 'get_query_result',
152
+ annotations: safety_1.READ_ONLY_DEFAULT,
153
+ taskSupport: { exposed: true, taskEligible: false },
154
+ },
155
+ profiles: [PROFILE_CONTENT_READER],
156
+ });
157
+ const op_cancel_query = (0, types_1.defineOperation)({
158
+ id: 'content-reader.query.cancel',
159
+ summary: 'Cancel a running session-owned query',
160
+ http: { method: 'POST', path: '/api/v2/projects/{projectUuid}/query/{queryUuid}/cancel' },
161
+ authorization: { safetyImpact: 'read' },
162
+ sensitivity: 'none',
163
+ mcp: {
164
+ toolName: 'cancel_query',
165
+ annotations: safety_1.READ_ONLY_TRANSIENT,
166
+ taskSupport: { exposed: true, taskEligible: false },
167
+ },
168
+ profiles: [PROFILE_CONTENT_READER],
169
+ });
170
+ exports.CONTENT_READER_OPERATIONS = [
171
+ op_search_content,
172
+ op_list_spaces,
173
+ op_get_space,
174
+ op_get_dashboard,
175
+ op_get_chart,
176
+ op_list_project_parameters,
177
+ op_get_project_parameters,
178
+ op_explain_content,
179
+ op_run_chart,
180
+ op_run_dashboard_tile,
181
+ op_get_query_result,
182
+ op_cancel_query,
183
+ ];
@@ -0,0 +1,12 @@
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
+ 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';
10
+ export { USER_OPERATIONS } from './users';
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';
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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
+ var types_1 = require("./types");
5
+ Object.defineProperty(exports, "defineOperation", { enumerable: true, get: function () { return types_1.defineOperation; } });
6
+ var agent_safe_1 = require("./agent-safe");
7
+ Object.defineProperty(exports, "IRRECOVERABLE_TOOL_DENYLIST", { enumerable: true, get: function () { return agent_safe_1.IRRECOVERABLE_TOOL_DENYLIST; } });
8
+ var ai_agents_1 = require("./ai-agents");
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; } });
22
+ var users_1 = require("./users");
23
+ Object.defineProperty(exports, "USER_OPERATIONS", { enumerable: true, get: function () { return users_1.USER_OPERATIONS; } });
24
+ var registry_1 = require("./registry");
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; } });
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; } });
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
+ ];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const registry_1 = require("./registry");
5
+ (0, vitest_1.describe)('agent-safe surface parity', () => {
6
+ (0, vitest_1.it)('requires MCP tool name or CLI path for agent operations', () => {
7
+ const agentOps = (0, registry_1.listOperations)().filter((operation) => operation.agentExposure === 'agent');
8
+ (0, vitest_1.expect)(agentOps.length).toBeGreaterThan(0);
9
+ for (const operation of agentOps) {
10
+ const hasMcp = operation.mcp !== undefined && operation.mcp.toolName.trim().length > 0;
11
+ const hasCli = operation.cli !== undefined && operation.cli.commandPath.trim().length > 0;
12
+ (0, vitest_1.expect)(hasMcp || hasCli).toBe(true);
13
+ }
14
+ });
15
+ (0, vitest_1.it)('keeps client-only banned MCP tool names off the agent surface', () => {
16
+ const banned = (0, registry_1.listBannedMcpToolNames)();
17
+ (0, vitest_1.expect)(banned).toContain('delete_member');
18
+ for (const operation of (0, registry_1.listOperations)()) {
19
+ if (operation.agentExposure !== 'client-only') {
20
+ continue;
21
+ }
22
+ (0, vitest_1.expect)(operation.mcp).toBeUndefined();
23
+ (0, vitest_1.expect)(operation.cli).toBeUndefined();
24
+ if (operation.bannedMcpToolName) {
25
+ (0, vitest_1.expect)(banned).toContain(operation.bannedMcpToolName);
26
+ }
27
+ }
28
+ });
29
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Central operation catalog — aggregates domain modules and exposes lookup helpers.
3
+ */
4
+ import type { CapabilityProfile, OperationDescriptor } from './types';
5
+ /** Returns a registered operation by id, or undefined when not found. */
6
+ export declare function getOperation(id: string): OperationDescriptor | undefined;
7
+ /** Returns the agent operation registered for an MCP tool name (sans prefix), if any. */
8
+ export declare function getOperationByMcpToolName(toolName: string): OperationDescriptor | undefined;
9
+ /** Returns every registered operation descriptor. */
10
+ export declare function listOperations(): readonly OperationDescriptor[];
11
+ /** Returns agent-surface operations that include the given capability profile. */
12
+ export declare function getOperationsByProfile(profile: CapabilityProfile): readonly OperationDescriptor[];
13
+ /** MCP tool names (sans prefix) with `mcp.taskSupport.exposed === true`. */
14
+ export declare function listExposedMcpToolNames(): readonly string[];
15
+ /** MCP tool names that must never be registered (client-only denylist). */
16
+ export declare function listBannedMcpToolNames(): readonly string[];
17
+ /** Exposed MCP tool names for a capability profile (persona allowlist source). */
18
+ export declare function listMcpToolNamesByProfile(profile: CapabilityProfile): readonly string[];
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ /**
3
+ * Central operation catalog — aggregates domain modules and exposes lookup helpers.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getOperation = getOperation;
7
+ exports.getOperationByMcpToolName = getOperationByMcpToolName;
8
+ exports.listOperations = listOperations;
9
+ exports.getOperationsByProfile = getOperationsByProfile;
10
+ exports.listExposedMcpToolNames = listExposedMcpToolNames;
11
+ exports.listBannedMcpToolNames = listBannedMcpToolNames;
12
+ exports.listMcpToolNamesByProfile = listMcpToolNamesByProfile;
13
+ const ai_agents_1 = require("./ai-agents");
14
+ const cli_content_1 = require("./cli-content");
15
+ const content_developer_1 = require("./content-developer");
16
+ const content_governance_1 = require("./content-governance");
17
+ const content_reader_1 = require("./content-reader");
18
+ const organization_audit_1 = require("./organization-audit");
19
+ const semantic_layer_1 = require("./semantic-layer");
20
+ const users_1 = require("./users");
21
+ const AGENT_EXPOSURE_CLIENT_ONLY = 'client-only';
22
+ const ALL_OPERATIONS = [
23
+ ...ai_agents_1.AI_AGENT_OPERATIONS,
24
+ ...users_1.USER_OPERATIONS,
25
+ ...semantic_layer_1.SEMANTIC_LAYER_OPERATIONS,
26
+ ...organization_audit_1.ORGANIZATION_AUDIT_OPERATIONS,
27
+ ...content_reader_1.CONTENT_READER_OPERATIONS,
28
+ ...content_developer_1.CONTENT_DEVELOPER_OPERATIONS,
29
+ ...content_governance_1.CONTENT_GOVERNANCE_OPERATIONS,
30
+ ...cli_content_1.CLI_CONTENT_OPERATIONS,
31
+ ];
32
+ const operationsById = new Map(ALL_OPERATIONS.map((operation) => [operation.id, operation]));
33
+ if (operationsById.size !== ALL_OPERATIONS.length) {
34
+ const seen = new Set();
35
+ const duplicates = [];
36
+ for (const operation of ALL_OPERATIONS) {
37
+ if (seen.has(operation.id)) {
38
+ duplicates.push(operation.id);
39
+ }
40
+ seen.add(operation.id);
41
+ }
42
+ throw new Error(`Duplicate operation ids in registry: ${duplicates.join(', ')}`);
43
+ }
44
+ const operationsByMcpToolName = new Map();
45
+ for (const operation of ALL_OPERATIONS) {
46
+ if (operation.agentExposure === AGENT_EXPOSURE_CLIENT_ONLY || operation.mcp === undefined) {
47
+ continue;
48
+ }
49
+ // Index only exposed tools so lookups match registerToolsByIds / schema honesty.
50
+ if (!operation.mcp.taskSupport.exposed) {
51
+ continue;
52
+ }
53
+ const toolName = operation.mcp.toolName;
54
+ if (operationsByMcpToolName.has(toolName)) {
55
+ throw new Error(`Duplicate MCP toolName in operation catalog: ${toolName}`);
56
+ }
57
+ operationsByMcpToolName.set(toolName, operation);
58
+ }
59
+ const EXPOSED_MCP_TOOL_NAMES = ALL_OPERATIONS.filter((operation) => operation.agentExposure === 'agent' &&
60
+ operation.mcp !== undefined &&
61
+ operation.mcp.taskSupport.exposed).map((operation) => {
62
+ const mcp = operation.mcp;
63
+ if (mcp === undefined) {
64
+ throw new Error(`Invariant: exposed filter retained operation without mcp (${operation.id})`);
65
+ }
66
+ return mcp.toolName;
67
+ });
68
+ const BANNED_MCP_TOOL_NAMES = ALL_OPERATIONS.filter((operation) => operation.agentExposure === AGENT_EXPOSURE_CLIENT_ONLY &&
69
+ typeof operation.bannedMcpToolName === 'string' &&
70
+ operation.bannedMcpToolName.trim().length > 0).map((operation) => {
71
+ const banned = operation.bannedMcpToolName;
72
+ if (banned === undefined) {
73
+ throw new Error(`Invariant: banned filter retained operation without name (${operation.id})`);
74
+ }
75
+ return banned;
76
+ });
77
+ /** Returns a registered operation by id, or undefined when not found. */
78
+ function getOperation(id) {
79
+ return operationsById.get(id);
80
+ }
81
+ /** Returns the agent operation registered for an MCP tool name (sans prefix), if any. */
82
+ function getOperationByMcpToolName(toolName) {
83
+ return operationsByMcpToolName.get(toolName);
84
+ }
85
+ /** Returns every registered operation descriptor. */
86
+ function listOperations() {
87
+ return ALL_OPERATIONS;
88
+ }
89
+ /** Returns agent-surface operations that include the given capability profile. */
90
+ function getOperationsByProfile(profile) {
91
+ return ALL_OPERATIONS.filter((operation) => operation.agentExposure !== 'client-only' && operation.profiles.includes(profile));
92
+ }
93
+ /** MCP tool names (sans prefix) with `mcp.taskSupport.exposed === true`. */
94
+ function listExposedMcpToolNames() {
95
+ return EXPOSED_MCP_TOOL_NAMES;
96
+ }
97
+ /** MCP tool names that must never be registered (client-only denylist). */
98
+ function listBannedMcpToolNames() {
99
+ return BANNED_MCP_TOOL_NAMES;
100
+ }
101
+ /** Exposed MCP tool names for a capability profile (persona allowlist source). */
102
+ function listMcpToolNamesByProfile(profile) {
103
+ return getOperationsByProfile(profile).flatMap((operation) => {
104
+ const mcp = operation.mcp;
105
+ if (mcp === undefined || mcp.taskSupport.exposed !== true) {
106
+ return [];
107
+ }
108
+ return [mcp.toolName];
109
+ });
110
+ }