@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.
- package/dist/argument-validation.js +20 -2
- package/dist/argument-validation.test.js +22 -0
- package/dist/audit.d.ts +29 -9
- package/dist/audit.js +53 -9
- package/dist/audit.test.js +51 -24
- package/dist/env.d.ts +1 -1
- package/dist/env.js +2 -2
- package/dist/index.d.ts +1 -3
- package/dist/index.js +6 -8
- package/dist/operations/agent-safe.d.ts +1 -3
- package/dist/operations/agent-safe.js +2 -9
- package/dist/operations/ai-agents.js +118 -30
- package/dist/operations/cli-content.d.ts +5 -0
- package/dist/operations/cli-content.js +71 -0
- package/dist/operations/client-coverage.d.ts +119 -0
- package/dist/operations/client-coverage.js +137 -0
- package/dist/operations/client-coverage.test.d.ts +1 -0
- package/dist/operations/client-coverage.test.js +22 -0
- package/dist/operations/content-developer.d.ts +2 -0
- package/dist/operations/content-developer.js +471 -0
- package/dist/operations/content-governance.d.ts +7 -0
- package/dist/operations/content-governance.js +98 -0
- package/dist/operations/content-reader.d.ts +2 -0
- package/dist/operations/content-reader.js +197 -0
- package/dist/operations/index.d.ts +10 -3
- package/dist/operations/index.js +20 -2
- package/dist/operations/organization-audit.d.ts +2 -0
- package/dist/operations/organization-audit.js +273 -0
- package/dist/operations/parity.test.js +12 -11
- package/dist/operations/registry.d.ts +9 -1
- package/dist/operations/registry.js +77 -2
- package/dist/operations/registry.test.js +39 -11
- package/dist/operations/semantic-layer.d.ts +6 -0
- package/dist/operations/semantic-layer.js +154 -0
- package/dist/operations/types.d.ts +29 -12
- package/dist/operations/types.js +64 -29
- package/dist/operations/types.test.js +33 -45
- package/dist/operations/users.d.ts +2 -2
- package/dist/operations/users.js +8 -10
- package/dist/safety.d.ts +8 -2
- package/dist/safety.js +22 -4
- package/dist/safety.test.js +29 -6
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +29 -0
- package/package.json +2 -1
- package/src/argument-validation.test.ts +31 -0
- package/src/argument-validation.ts +20 -2
- package/src/audit.test.ts +70 -30
- package/src/audit.ts +88 -12
- package/src/env.ts +1 -1
- package/src/index.ts +5 -9
- package/src/operations/agent-safe.ts +2 -12
- package/src/operations/ai-agents.ts +123 -31
- package/src/operations/cli-content.ts +79 -0
- package/src/operations/client-coverage.test.ts +23 -0
- package/src/operations/client-coverage.ts +153 -0
- package/src/operations/content-developer.ts +501 -0
- package/src/operations/content-governance.ts +110 -0
- package/src/operations/content-reader.ts +212 -0
- package/src/operations/index.ts +25 -2
- package/src/operations/organization-audit.ts +293 -0
- package/src/operations/parity.test.ts +12 -14
- package/src/operations/registry.test.ts +41 -9
- package/src/operations/registry.ts +86 -2
- package/src/operations/semantic-layer.ts +166 -0
- package/src/operations/types.test.ts +38 -76
- package/src/operations/types.ts +112 -47
- package/src/operations/users.ts +9 -11
- package/src/safety.test.ts +32 -6
- package/src/safety.ts +26 -4
- package/src/types/index.ts +13 -0
package/src/audit.ts
CHANGED
|
@@ -1,35 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Structured audit logger for Lightdash tool invocations (MCP and CLI).
|
|
3
3
|
*
|
|
4
|
-
* Each operation is recorded as a single NDJSON line
|
|
5
|
-
*
|
|
6
|
-
* and optional OAuth attribution fields (tokenHash, subject) when available.
|
|
4
|
+
* Each operation is recorded as a single NDJSON line. On stderr the line is pure JSON
|
|
5
|
+
* (Cloud Logging–parseable); text prefixes prevent jsonPayload parsing on Cloud Run.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
* - If LIGHTDASH_TOOLS_AUDIT_LOG is set to a file path, entries are appended to that file.
|
|
10
|
-
* - Otherwise entries are written to stderr with an "[audit]" prefix.
|
|
7
|
+
* If LIGHTDASH_TOOLS_AUDIT_LOG is a file path, entries are appended there; otherwise stderr.
|
|
11
8
|
*/
|
|
12
9
|
|
|
13
10
|
import { randomUUID } from 'node:crypto';
|
|
14
11
|
import { createWriteStream, type WriteStream } from 'node:fs';
|
|
15
12
|
|
|
16
|
-
export type AuditStatus =
|
|
13
|
+
export type AuditStatus =
|
|
14
|
+
| 'blocked'
|
|
15
|
+
| 'confirmation_cancelled'
|
|
16
|
+
| 'confirmation_declined'
|
|
17
|
+
| 'confirmation_requested'
|
|
18
|
+
| 'deletion_failed'
|
|
19
|
+
| 'deletion_succeeded'
|
|
20
|
+
| 'error'
|
|
21
|
+
| 'promotion_failed'
|
|
22
|
+
| 'promotion_succeeded'
|
|
23
|
+
| 'resource_changed'
|
|
24
|
+
| 'success';
|
|
25
|
+
|
|
26
|
+
/** Cloud Logging LogSeverity-compatible strings for structured stderr JSON. */
|
|
27
|
+
export type AuditSeverity = 'ERROR' | 'INFO' | 'NOTICE' | 'WARNING';
|
|
17
28
|
|
|
18
29
|
export type AuditLogEntry = {
|
|
30
|
+
/** Stable filter key for Cloud Logging (`jsonPayload.channel="audit"`). */
|
|
31
|
+
channel: 'audit';
|
|
32
|
+
severity: AuditSeverity;
|
|
33
|
+
message: string;
|
|
19
34
|
timestamp: string;
|
|
35
|
+
/** Process-lifetime instance id (not the MCP client session). */
|
|
20
36
|
sessionId: string;
|
|
21
|
-
/** MCP tool name or CLI command name. */
|
|
22
37
|
tool: string;
|
|
23
|
-
/** Project UUIDs involved in the call, if any (covers both projectUuid and projectUuids[]). */
|
|
24
38
|
projectUuids?: string[];
|
|
25
39
|
/** SHA-256 hash of the OAuth bearer token (never the raw token). */
|
|
26
40
|
tokenHash?: string;
|
|
27
41
|
/** Lightdash user UUID when the call runs under OAuth bearer auth. */
|
|
28
42
|
subject?: string;
|
|
43
|
+
clientSessionId?: string;
|
|
44
|
+
personaId?: string;
|
|
29
45
|
status: AuditStatus;
|
|
30
46
|
durationMs: number;
|
|
31
47
|
};
|
|
32
48
|
|
|
49
|
+
export type BuildAuditLogEntryInput = {
|
|
50
|
+
tool: string;
|
|
51
|
+
status: AuditStatus;
|
|
52
|
+
/** Epoch ms when the operation started (`durationMs = now - startMs`). */
|
|
53
|
+
startMs: number;
|
|
54
|
+
projectUuids?: string[];
|
|
55
|
+
tokenHash?: string;
|
|
56
|
+
subject?: string;
|
|
57
|
+
clientSessionId?: string;
|
|
58
|
+
personaId?: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
33
61
|
/** Unique ID for the current process lifetime. Generated once at module load. */
|
|
34
62
|
const SESSION_ID = randomUUID();
|
|
35
63
|
|
|
@@ -39,19 +67,67 @@ export function getSessionId(): string {
|
|
|
39
67
|
return SESSION_ID;
|
|
40
68
|
}
|
|
41
69
|
|
|
70
|
+
/** Map audit status to Cloud Logging severity. */
|
|
71
|
+
export function auditSeverityForStatus(status: AuditStatus): AuditSeverity {
|
|
72
|
+
switch (status) {
|
|
73
|
+
case 'success':
|
|
74
|
+
return 'INFO';
|
|
75
|
+
case 'deletion_succeeded':
|
|
76
|
+
case 'promotion_succeeded':
|
|
77
|
+
return 'NOTICE';
|
|
78
|
+
case 'blocked':
|
|
79
|
+
case 'confirmation_cancelled':
|
|
80
|
+
case 'confirmation_declined':
|
|
81
|
+
case 'confirmation_requested':
|
|
82
|
+
case 'resource_changed':
|
|
83
|
+
return 'WARNING';
|
|
84
|
+
case 'deletion_failed':
|
|
85
|
+
case 'error':
|
|
86
|
+
case 'promotion_failed':
|
|
87
|
+
return 'ERROR';
|
|
88
|
+
default: {
|
|
89
|
+
const _exhaustive: never = status;
|
|
90
|
+
return _exhaustive;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Assemble a full audit entry (shared by CLI and MCP). */
|
|
96
|
+
export function buildAuditLogEntry(input: BuildAuditLogEntryInput): AuditLogEntry {
|
|
97
|
+
const projectUuids =
|
|
98
|
+
input.projectUuids && input.projectUuids.length > 0 ? input.projectUuids : undefined;
|
|
99
|
+
return {
|
|
100
|
+
channel: 'audit',
|
|
101
|
+
severity: auditSeverityForStatus(input.status),
|
|
102
|
+
message: `${input.tool} ${input.status}`,
|
|
103
|
+
timestamp: new Date().toISOString(),
|
|
104
|
+
sessionId: SESSION_ID,
|
|
105
|
+
tool: input.tool,
|
|
106
|
+
projectUuids,
|
|
107
|
+
tokenHash: input.tokenHash,
|
|
108
|
+
subject: input.subject,
|
|
109
|
+
clientSessionId: input.clientSessionId,
|
|
110
|
+
personaId: input.personaId,
|
|
111
|
+
status: input.status,
|
|
112
|
+
durationMs: Date.now() - input.startMs,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
42
116
|
/**
|
|
43
117
|
* Initialise the audit log. Call once at process startup.
|
|
44
118
|
* If filePath is provided, entries are appended to that file; otherwise stderr is used.
|
|
119
|
+
* Startup banners go to stdout so they do not mix with structured audit JSON on stderr.
|
|
45
120
|
*/
|
|
46
121
|
export function initAuditLog(filePath?: string): void {
|
|
47
122
|
if (filePath) {
|
|
48
123
|
_writeStream = createWriteStream(filePath, { flags: 'a' });
|
|
49
124
|
_writeStream.on('error', (err) => {
|
|
125
|
+
// Diagnostic only — not an audit row.
|
|
50
126
|
console.error('[audit] Failed to write to audit log file:', err);
|
|
51
127
|
});
|
|
52
|
-
console.
|
|
128
|
+
console.log(`[audit] Writing to file: ${filePath} (session: ${SESSION_ID})`);
|
|
53
129
|
} else {
|
|
54
|
-
console.
|
|
130
|
+
console.log(`[audit] Writing to stderr (session: ${SESSION_ID})`);
|
|
55
131
|
}
|
|
56
132
|
}
|
|
57
133
|
|
|
@@ -61,7 +137,7 @@ export function logAuditEntry(entry: AuditLogEntry): void {
|
|
|
61
137
|
if (_writeStream) {
|
|
62
138
|
_writeStream.write(line);
|
|
63
139
|
} else {
|
|
64
|
-
process.stderr.write(
|
|
140
|
+
process.stderr.write(line);
|
|
65
141
|
}
|
|
66
142
|
}
|
|
67
143
|
|
package/src/env.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
export const ENV_LIGHTDASH_TOOLS_DRY_RUN = 'LIGHTDASH_TOOLS_DRY_RUN';
|
|
8
8
|
export const ENV_LIGHTDASH_TOOLS_AUDIT_LOG = 'LIGHTDASH_TOOLS_AUDIT_LOG';
|
|
9
9
|
export const ENV_LIGHTDASH_TOOLS_SAFETY_MODE = 'LIGHTDASH_TOOLS_SAFETY_MODE';
|
|
10
|
-
export const
|
|
10
|
+
export const ENV_LIGHTDASH_TOOLS_ALLOWED_PROJECT_UUIDS = 'LIGHTDASH_TOOLS_ALLOWED_PROJECT_UUIDS';
|
|
11
11
|
|
|
12
12
|
/** MCP HTTP server env vars (`LIGHTDASH_TOOLS_MCP_*` / `LIGHTDASH_TOOLS_OAUTH_*` per ADR-0009). */
|
|
13
13
|
/** @deprecated Removed — auth is credential-inferred (ADR-0007). Kept for migration error messages. */
|
package/src/index.ts
CHANGED
|
@@ -11,13 +11,13 @@ export * from './safety';
|
|
|
11
11
|
// Export input validation
|
|
12
12
|
export * from './input-validation';
|
|
13
13
|
|
|
14
|
-
// Export argument / descriptor validation
|
|
14
|
+
// Export argument / descriptor validation
|
|
15
15
|
export * from './argument-validation';
|
|
16
16
|
|
|
17
|
-
// Export shared typed operation
|
|
17
|
+
// Export shared typed operation catalog (ADR-0013)
|
|
18
18
|
export * from './operations';
|
|
19
19
|
|
|
20
|
-
// Export AgentOps bundle and gate types
|
|
20
|
+
// Export AgentOps bundle and gate types
|
|
21
21
|
export * from './agentops/types';
|
|
22
22
|
export * from './agentops/snapshots';
|
|
23
23
|
export * from './agentops/formatters';
|
|
@@ -29,9 +29,5 @@ export {
|
|
|
29
29
|
// Export audit logger (shared by MCP and CLI)
|
|
30
30
|
export * from './audit';
|
|
31
31
|
|
|
32
|
-
//
|
|
33
|
-
export * from './types
|
|
34
|
-
export { CONTENT_SORT_BY_COLUMNS } from './types/v2/content';
|
|
35
|
-
|
|
36
|
-
// Export raw OpenAPI types for direct use (e.g., by client package)
|
|
37
|
-
export type { paths, components, operations } from './types/generated/openapi-types';
|
|
32
|
+
// Curated Lightdash API types + generated OpenAPI shapes (single public path)
|
|
33
|
+
export * from './types';
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Agent-safe surface policy helpers (ADR-0004).
|
|
2
|
+
* Agent-safe surface policy helpers (ADR-0004 / ADR-0013).
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
/** MCP tool names that must never be registered, derived from client-only registry entries. */
|
|
8
|
-
export function listBannedMcpToolNames(): readonly string[] {
|
|
9
|
-
return listOperations()
|
|
10
|
-
.filter(
|
|
11
|
-
(operation) =>
|
|
12
|
-
operation.agentExposure === 'client-only' && operation.mcp.toolName.trim().length > 0,
|
|
13
|
-
)
|
|
14
|
-
.map((operation) => operation.mcp.toolName);
|
|
15
|
-
}
|
|
5
|
+
import { listBannedMcpToolNames } from './registry';
|
|
16
6
|
|
|
17
7
|
/** Banned MCP tool names (without `lightdash_` prefix) for regression tests. */
|
|
18
8
|
export const IRRECOVERABLE_TOOL_DENYLIST = listBannedMcpToolNames();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
READ_ONLY_DEFAULT,
|
|
7
7
|
WRITE_DESTRUCTIVE,
|
|
8
|
+
WRITE_IDEMPOTENT,
|
|
8
9
|
WRITE_NONDESTRUCTIVE,
|
|
9
10
|
WRITE_OPEN_WORLD,
|
|
10
11
|
} from '../safety';
|
|
@@ -22,6 +23,7 @@ const PROFILE_CORE_LIFECYCLE: CapabilityProfile = 'core-lifecycle';
|
|
|
22
23
|
const PROFILE_DISCOVERY: CapabilityProfile = 'discovery-readonly';
|
|
23
24
|
const PROFILE_CONVERSATIONS: CapabilityProfile = 'conversations';
|
|
24
25
|
const PROFILE_EVALUATIONS: CapabilityProfile = 'evaluations';
|
|
26
|
+
const PROFILE_AI_AGENT_OPS: CapabilityProfile = 'ai-agent-ops';
|
|
25
27
|
|
|
26
28
|
const API_V1 = '/api/v1';
|
|
27
29
|
const PROJECT_AGENTS_PATH = `${API_V1}/projects/{projectUuid}/aiAgents`;
|
|
@@ -32,10 +34,11 @@ const adminListAgents = defineOperation({
|
|
|
32
34
|
summary: 'List all AI agents across the organization (admin)',
|
|
33
35
|
http: { method: 'GET', path: `${API_V1}/aiAgents/admin/agents` },
|
|
34
36
|
authorization: { safetyImpact: IMPACT_READ },
|
|
37
|
+
sensitivity: 'none',
|
|
35
38
|
mcp: {
|
|
36
39
|
toolName: 'list_admin_agents',
|
|
37
40
|
annotations: READ_ONLY_DEFAULT,
|
|
38
|
-
taskSupport: { exposed:
|
|
41
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
39
42
|
},
|
|
40
43
|
cli: { commandPath: 'ai-agents list' },
|
|
41
44
|
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
@@ -46,10 +49,11 @@ const adminListThreads = defineOperation({
|
|
|
46
49
|
summary: 'List AI agent threads across the organization with optional filters (admin)',
|
|
47
50
|
http: { method: 'GET', path: `${API_V1}/aiAgents/admin/threads` },
|
|
48
51
|
authorization: { safetyImpact: IMPACT_READ },
|
|
52
|
+
sensitivity: 'none',
|
|
49
53
|
mcp: {
|
|
50
54
|
toolName: 'list_admin_agent_threads',
|
|
51
55
|
annotations: READ_ONLY_DEFAULT,
|
|
52
|
-
taskSupport: { exposed:
|
|
56
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
53
57
|
},
|
|
54
58
|
cli: { commandPath: 'ai-agents threads' },
|
|
55
59
|
profiles: [PROFILE_DISCOVERY],
|
|
@@ -60,31 +64,26 @@ const adminSettingsGet = defineOperation({
|
|
|
60
64
|
summary: 'Get AI organization settings (admin)',
|
|
61
65
|
http: { method: 'GET', path: `${API_V1}/aiAgents/admin/settings` },
|
|
62
66
|
authorization: { safetyImpact: IMPACT_READ },
|
|
67
|
+
sensitivity: 'none',
|
|
63
68
|
mcp: {
|
|
64
69
|
toolName: 'get_ai_organization_settings',
|
|
65
70
|
annotations: READ_ONLY_DEFAULT,
|
|
66
|
-
taskSupport: { exposed:
|
|
71
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
67
72
|
},
|
|
68
73
|
cli: { commandPath: 'ai-agents settings get' },
|
|
69
74
|
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
70
75
|
});
|
|
71
76
|
|
|
72
|
-
const WRITE_SETTINGS_UPDATE = {
|
|
73
|
-
readOnlyHint: false,
|
|
74
|
-
openWorldHint: false,
|
|
75
|
-
destructiveHint: false,
|
|
76
|
-
idempotentHint: true,
|
|
77
|
-
} as const;
|
|
78
|
-
|
|
79
77
|
const adminSettingsUpdate = defineOperation({
|
|
80
78
|
id: 'ai-agents.admin.settings.update',
|
|
81
79
|
summary: 'Update AI organization settings (admin)',
|
|
82
80
|
http: { method: 'PATCH', path: `${API_V1}/aiAgents/admin/settings` },
|
|
83
81
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
82
|
+
sensitivity: 'none',
|
|
84
83
|
mcp: {
|
|
85
84
|
toolName: 'update_ai_organization_settings',
|
|
86
|
-
annotations:
|
|
87
|
-
taskSupport: { exposed:
|
|
85
|
+
annotations: WRITE_IDEMPOTENT,
|
|
86
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
88
87
|
},
|
|
89
88
|
cli: { commandPath: 'ai-agents settings update' },
|
|
90
89
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -95,13 +94,14 @@ const projectAgentsList = defineOperation({
|
|
|
95
94
|
summary: 'List all AI agents in a project',
|
|
96
95
|
http: { method: 'GET', path: PROJECT_AGENTS_PATH },
|
|
97
96
|
authorization: { safetyImpact: IMPACT_READ },
|
|
97
|
+
sensitivity: 'none',
|
|
98
98
|
mcp: {
|
|
99
99
|
toolName: 'list_project_agents',
|
|
100
100
|
annotations: READ_ONLY_DEFAULT,
|
|
101
101
|
taskSupport: { exposed: true, taskEligible: false },
|
|
102
102
|
},
|
|
103
103
|
cli: { commandPath: 'agents list' },
|
|
104
|
-
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
104
|
+
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
const projectAgentsGet = defineOperation({
|
|
@@ -109,13 +109,14 @@ const projectAgentsGet = defineOperation({
|
|
|
109
109
|
summary: 'Get a single AI agent in a project',
|
|
110
110
|
http: { method: 'GET', path: PROJECT_AGENT_PATH },
|
|
111
111
|
authorization: { safetyImpact: IMPACT_READ },
|
|
112
|
+
sensitivity: 'none',
|
|
112
113
|
mcp: {
|
|
113
114
|
toolName: 'get_project_agent',
|
|
114
115
|
annotations: READ_ONLY_DEFAULT,
|
|
115
116
|
taskSupport: { exposed: true, taskEligible: false },
|
|
116
117
|
},
|
|
117
118
|
cli: { commandPath: 'agents get' },
|
|
118
|
-
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY],
|
|
119
|
+
profiles: [PROFILE_CORE_LIFECYCLE, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
119
120
|
});
|
|
120
121
|
|
|
121
122
|
const projectAgentsCreate = defineOperation({
|
|
@@ -123,10 +124,11 @@ const projectAgentsCreate = defineOperation({
|
|
|
123
124
|
summary: 'Create a new AI agent in a project',
|
|
124
125
|
http: { method: 'POST', path: PROJECT_AGENTS_PATH },
|
|
125
126
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
127
|
+
sensitivity: 'none',
|
|
126
128
|
mcp: {
|
|
127
129
|
toolName: 'create_project_agent',
|
|
128
130
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
129
|
-
taskSupport: { exposed:
|
|
131
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
130
132
|
},
|
|
131
133
|
cli: { commandPath: 'agents create' },
|
|
132
134
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -137,10 +139,11 @@ const projectAgentsUpdate = defineOperation({
|
|
|
137
139
|
summary: 'Update an existing AI agent in a project',
|
|
138
140
|
http: { method: 'PATCH', path: PROJECT_AGENT_PATH },
|
|
139
141
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
142
|
+
sensitivity: 'none',
|
|
140
143
|
mcp: {
|
|
141
144
|
toolName: 'update_project_agent',
|
|
142
145
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
143
|
-
taskSupport: { exposed:
|
|
146
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
144
147
|
},
|
|
145
148
|
cli: { commandPath: 'agents update' },
|
|
146
149
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -151,10 +154,11 @@ const projectAgentsDelete = defineOperation({
|
|
|
151
154
|
summary: 'Delete an AI agent from a project',
|
|
152
155
|
http: { method: 'DELETE', path: PROJECT_AGENT_PATH },
|
|
153
156
|
authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
|
|
157
|
+
sensitivity: 'none',
|
|
154
158
|
mcp: {
|
|
155
159
|
toolName: 'delete_project_agent',
|
|
156
160
|
annotations: WRITE_DESTRUCTIVE,
|
|
157
|
-
taskSupport: { exposed:
|
|
161
|
+
taskSupport: { exposed: false, taskEligible: false },
|
|
158
162
|
},
|
|
159
163
|
cli: { commandPath: 'agents delete' },
|
|
160
164
|
profiles: [PROFILE_CORE_LIFECYCLE],
|
|
@@ -170,13 +174,14 @@ const threadsList = defineOperation({
|
|
|
170
174
|
path: PROJECT_AGENT_THREADS_PATH,
|
|
171
175
|
},
|
|
172
176
|
authorization: { safetyImpact: IMPACT_READ },
|
|
177
|
+
sensitivity: 'none',
|
|
173
178
|
mcp: {
|
|
174
179
|
toolName: 'list_agent_threads',
|
|
175
180
|
annotations: READ_ONLY_DEFAULT,
|
|
176
181
|
taskSupport: { exposed: true, taskEligible: false },
|
|
177
182
|
},
|
|
178
183
|
cli: { commandPath: 'agents threads list' },
|
|
179
|
-
profiles: [PROFILE_CONVERSATIONS, PROFILE_DISCOVERY],
|
|
184
|
+
profiles: [PROFILE_CONVERSATIONS, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
180
185
|
});
|
|
181
186
|
|
|
182
187
|
const PROJECT_AGENT_THREAD_PATH = `${PROJECT_AGENT_THREADS_PATH}/{threadUuid}`;
|
|
@@ -189,13 +194,14 @@ const threadsGet = defineOperation({
|
|
|
189
194
|
path: PROJECT_AGENT_THREAD_PATH,
|
|
190
195
|
},
|
|
191
196
|
authorization: { safetyImpact: IMPACT_READ },
|
|
197
|
+
sensitivity: 'none',
|
|
192
198
|
mcp: {
|
|
193
199
|
toolName: 'get_agent_thread',
|
|
194
200
|
annotations: READ_ONLY_DEFAULT,
|
|
195
201
|
taskSupport: { exposed: true, taskEligible: false },
|
|
196
202
|
},
|
|
197
203
|
cli: { commandPath: 'agents threads get' },
|
|
198
|
-
profiles: [PROFILE_CONVERSATIONS, PROFILE_DISCOVERY],
|
|
204
|
+
profiles: [PROFILE_CONVERSATIONS, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
199
205
|
});
|
|
200
206
|
|
|
201
207
|
const PROJECT_AGENT_THREAD_MESSAGES_PATH = `${PROJECT_AGENT_THREAD_PATH}/messages`;
|
|
@@ -227,10 +233,11 @@ const threadsStart = defineOperation({
|
|
|
227
233
|
},
|
|
228
234
|
],
|
|
229
235
|
authorization: { safetyImpact: IMPACT_EXTERNAL },
|
|
236
|
+
sensitivity: 'none',
|
|
230
237
|
mcp: {
|
|
231
238
|
toolName: 'generate_agent_message',
|
|
232
239
|
annotations: WRITE_OPEN_WORLD,
|
|
233
|
-
taskSupport: { exposed:
|
|
240
|
+
taskSupport: { exposed: false, taskEligible: true },
|
|
234
241
|
},
|
|
235
242
|
cli: { commandPath: 'agents threads start' },
|
|
236
243
|
profiles: [PROFILE_CONVERSATIONS],
|
|
@@ -256,10 +263,11 @@ const threadsContinue = defineOperation({
|
|
|
256
263
|
},
|
|
257
264
|
],
|
|
258
265
|
authorization: { safetyImpact: IMPACT_EXTERNAL },
|
|
266
|
+
sensitivity: 'none',
|
|
259
267
|
mcp: {
|
|
260
268
|
toolName: 'continue_agent_thread',
|
|
261
269
|
annotations: WRITE_OPEN_WORLD,
|
|
262
|
-
taskSupport: { exposed:
|
|
270
|
+
taskSupport: { exposed: false, taskEligible: true },
|
|
263
271
|
},
|
|
264
272
|
cli: { commandPath: 'agents threads continue' },
|
|
265
273
|
profiles: [PROFILE_CONVERSATIONS],
|
|
@@ -275,13 +283,14 @@ const evaluationsList = defineOperation({
|
|
|
275
283
|
path: PROJECT_AGENT_EVALUATIONS_PATH,
|
|
276
284
|
},
|
|
277
285
|
authorization: { safetyImpact: IMPACT_READ },
|
|
286
|
+
sensitivity: 'none',
|
|
278
287
|
mcp: {
|
|
279
288
|
toolName: 'list_agent_evaluations',
|
|
280
289
|
annotations: READ_ONLY_DEFAULT,
|
|
281
290
|
taskSupport: { exposed: true, taskEligible: false },
|
|
282
291
|
},
|
|
283
292
|
cli: { commandPath: 'agents evals list' },
|
|
284
|
-
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
293
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
285
294
|
});
|
|
286
295
|
|
|
287
296
|
const PROJECT_AGENT_EVALUATION_PATH = `${PROJECT_AGENT_EVALUATIONS_PATH}/{evalUuid}`;
|
|
@@ -294,13 +303,14 @@ const evaluationsGet = defineOperation({
|
|
|
294
303
|
path: PROJECT_AGENT_EVALUATION_PATH,
|
|
295
304
|
},
|
|
296
305
|
authorization: { safetyImpact: IMPACT_READ },
|
|
306
|
+
sensitivity: 'none',
|
|
297
307
|
mcp: {
|
|
298
308
|
toolName: 'get_agent_evaluation',
|
|
299
309
|
annotations: READ_ONLY_DEFAULT,
|
|
300
310
|
taskSupport: { exposed: true, taskEligible: false },
|
|
301
311
|
},
|
|
302
312
|
cli: { commandPath: 'agents evals get' },
|
|
303
|
-
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
313
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
304
314
|
});
|
|
305
315
|
|
|
306
316
|
const evaluationsCreate = defineOperation({
|
|
@@ -311,13 +321,14 @@ const evaluationsCreate = defineOperation({
|
|
|
311
321
|
path: PROJECT_AGENT_EVALUATIONS_PATH,
|
|
312
322
|
},
|
|
313
323
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
324
|
+
sensitivity: 'none',
|
|
314
325
|
mcp: {
|
|
315
326
|
toolName: 'create_agent_evaluation',
|
|
316
327
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
317
328
|
taskSupport: { exposed: true, taskEligible: false },
|
|
318
329
|
},
|
|
319
330
|
cli: { commandPath: 'agents evals create' },
|
|
320
|
-
profiles: [PROFILE_EVALUATIONS],
|
|
331
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_AI_AGENT_OPS],
|
|
321
332
|
});
|
|
322
333
|
|
|
323
334
|
const evaluationsUpdate = defineOperation({
|
|
@@ -328,13 +339,14 @@ const evaluationsUpdate = defineOperation({
|
|
|
328
339
|
path: PROJECT_AGENT_EVALUATION_PATH,
|
|
329
340
|
},
|
|
330
341
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
342
|
+
sensitivity: 'none',
|
|
331
343
|
mcp: {
|
|
332
344
|
toolName: 'update_agent_evaluation',
|
|
333
345
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
334
346
|
taskSupport: { exposed: true, taskEligible: false },
|
|
335
347
|
},
|
|
336
348
|
cli: { commandPath: 'agents evals update' },
|
|
337
|
-
profiles: [PROFILE_EVALUATIONS],
|
|
349
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_AI_AGENT_OPS],
|
|
338
350
|
});
|
|
339
351
|
|
|
340
352
|
const evaluationsAppend = defineOperation({
|
|
@@ -345,13 +357,14 @@ const evaluationsAppend = defineOperation({
|
|
|
345
357
|
path: `${PROJECT_AGENT_EVALUATION_PATH}/append`,
|
|
346
358
|
},
|
|
347
359
|
authorization: { safetyImpact: IMPACT_WRITE_NONDESTRUCTIVE },
|
|
360
|
+
sensitivity: 'none',
|
|
348
361
|
mcp: {
|
|
349
362
|
toolName: 'append_agent_evaluation_prompts',
|
|
350
363
|
annotations: WRITE_NONDESTRUCTIVE,
|
|
351
364
|
taskSupport: { exposed: true, taskEligible: false },
|
|
352
365
|
},
|
|
353
366
|
cli: { commandPath: 'agents evals append' },
|
|
354
|
-
profiles: [PROFILE_EVALUATIONS],
|
|
367
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_AI_AGENT_OPS],
|
|
355
368
|
});
|
|
356
369
|
|
|
357
370
|
const evaluationsDelete = defineOperation({
|
|
@@ -362,13 +375,14 @@ const evaluationsDelete = defineOperation({
|
|
|
362
375
|
path: PROJECT_AGENT_EVALUATION_PATH,
|
|
363
376
|
},
|
|
364
377
|
authorization: { safetyImpact: IMPACT_WRITE_DESTRUCTIVE },
|
|
378
|
+
sensitivity: 'none',
|
|
365
379
|
mcp: {
|
|
366
380
|
toolName: 'delete_agent_evaluation',
|
|
367
381
|
annotations: WRITE_DESTRUCTIVE,
|
|
368
382
|
taskSupport: { exposed: true, taskEligible: false },
|
|
369
383
|
},
|
|
370
384
|
cli: { commandPath: 'agents evals delete' },
|
|
371
|
-
profiles: [PROFILE_EVALUATIONS],
|
|
385
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_AI_AGENT_OPS],
|
|
372
386
|
});
|
|
373
387
|
|
|
374
388
|
const evaluationsRun = defineOperation({
|
|
@@ -379,13 +393,14 @@ const evaluationsRun = defineOperation({
|
|
|
379
393
|
path: `${PROJECT_AGENT_EVALUATION_PATH}/run`,
|
|
380
394
|
},
|
|
381
395
|
authorization: { safetyImpact: IMPACT_EXTERNAL },
|
|
396
|
+
sensitivity: 'none',
|
|
382
397
|
mcp: {
|
|
383
398
|
toolName: 'run_agent_evaluation',
|
|
384
399
|
annotations: WRITE_OPEN_WORLD,
|
|
385
400
|
taskSupport: { exposed: true, taskEligible: true },
|
|
386
401
|
},
|
|
387
402
|
cli: { commandPath: 'agents evals run' },
|
|
388
|
-
profiles: [PROFILE_EVALUATIONS],
|
|
403
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_AI_AGENT_OPS],
|
|
389
404
|
});
|
|
390
405
|
|
|
391
406
|
const PROJECT_AGENT_EVALUATION_RUNS_PATH = `${PROJECT_AGENT_EVALUATION_PATH}/runs`;
|
|
@@ -398,13 +413,14 @@ const evaluationsRunsList = defineOperation({
|
|
|
398
413
|
path: PROJECT_AGENT_EVALUATION_RUNS_PATH,
|
|
399
414
|
},
|
|
400
415
|
authorization: { safetyImpact: IMPACT_READ },
|
|
416
|
+
sensitivity: 'none',
|
|
401
417
|
mcp: {
|
|
402
418
|
toolName: 'list_agent_evaluation_runs',
|
|
403
419
|
annotations: READ_ONLY_DEFAULT,
|
|
404
420
|
taskSupport: { exposed: true, taskEligible: false },
|
|
405
421
|
},
|
|
406
422
|
cli: { commandPath: 'agents evals runs' },
|
|
407
|
-
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
423
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
408
424
|
});
|
|
409
425
|
|
|
410
426
|
const evaluationsRunResultsGet = defineOperation({
|
|
@@ -415,13 +431,85 @@ const evaluationsRunResultsGet = defineOperation({
|
|
|
415
431
|
path: `${PROJECT_AGENT_EVALUATION_RUNS_PATH}/{runUuid}`,
|
|
416
432
|
},
|
|
417
433
|
authorization: { safetyImpact: IMPACT_READ },
|
|
434
|
+
sensitivity: 'none',
|
|
418
435
|
mcp: {
|
|
419
|
-
toolName: '
|
|
436
|
+
toolName: 'get_agent_eval_run_results',
|
|
420
437
|
annotations: READ_ONLY_DEFAULT,
|
|
421
438
|
taskSupport: { exposed: true, taskEligible: false },
|
|
422
439
|
},
|
|
423
440
|
cli: { commandPath: 'agents evals run-results' },
|
|
424
|
-
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY],
|
|
441
|
+
profiles: [PROFILE_EVALUATIONS, PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
const evaluateAgentReadiness = defineOperation({
|
|
445
|
+
id: 'ai-agents.project.agents.evaluate-readiness',
|
|
446
|
+
summary: 'Evaluate release readiness score for an agent (not an evaluation-suite run)',
|
|
447
|
+
http: {
|
|
448
|
+
method: 'POST',
|
|
449
|
+
path: `${PROJECT_AGENT_PATH}/evaluateReadiness`,
|
|
450
|
+
},
|
|
451
|
+
authorization: { safetyImpact: IMPACT_READ },
|
|
452
|
+
sensitivity: 'none',
|
|
453
|
+
mcp: {
|
|
454
|
+
toolName: 'evaluate_agent_readiness',
|
|
455
|
+
annotations: READ_ONLY_DEFAULT,
|
|
456
|
+
taskSupport: { exposed: true, taskEligible: false },
|
|
457
|
+
},
|
|
458
|
+
cli: { commandPath: 'agents readiness evaluate' },
|
|
459
|
+
profiles: [PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
const getAgentSuggestions = defineOperation({
|
|
463
|
+
id: 'ai-agents.project.agents.suggestions',
|
|
464
|
+
summary: 'List suggestion chips for an agent',
|
|
465
|
+
http: {
|
|
466
|
+
method: 'GET',
|
|
467
|
+
path: `${PROJECT_AGENT_PATH}/suggestions`,
|
|
468
|
+
},
|
|
469
|
+
authorization: { safetyImpact: IMPACT_READ },
|
|
470
|
+
sensitivity: 'none',
|
|
471
|
+
mcp: {
|
|
472
|
+
toolName: 'get_agent_suggestions',
|
|
473
|
+
annotations: READ_ONLY_DEFAULT,
|
|
474
|
+
taskSupport: { exposed: true, taskEligible: false },
|
|
475
|
+
},
|
|
476
|
+
cli: { commandPath: 'agents suggestions' },
|
|
477
|
+
profiles: [PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
const getAgentModels = defineOperation({
|
|
481
|
+
id: 'ai-agents.project.agents.models',
|
|
482
|
+
summary: 'List available AI model options for an agent',
|
|
483
|
+
http: {
|
|
484
|
+
method: 'GET',
|
|
485
|
+
path: `${PROJECT_AGENT_PATH}/models`,
|
|
486
|
+
},
|
|
487
|
+
authorization: { safetyImpact: IMPACT_READ },
|
|
488
|
+
sensitivity: 'none',
|
|
489
|
+
mcp: {
|
|
490
|
+
toolName: 'get_agent_models',
|
|
491
|
+
annotations: READ_ONLY_DEFAULT,
|
|
492
|
+
taskSupport: { exposed: true, taskEligible: false },
|
|
493
|
+
},
|
|
494
|
+
cli: { commandPath: 'agents models' },
|
|
495
|
+
profiles: [PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
const getExploreAccessSummary = defineOperation({
|
|
499
|
+
id: 'ai-agents.project.explore-access-summary',
|
|
500
|
+
summary: 'Summarize explore access for tag-filtered explores',
|
|
501
|
+
http: {
|
|
502
|
+
method: 'POST',
|
|
503
|
+
path: `${PROJECT_AGENTS_PATH}/explore-access-summary`,
|
|
504
|
+
},
|
|
505
|
+
authorization: { safetyImpact: IMPACT_READ },
|
|
506
|
+
sensitivity: 'none',
|
|
507
|
+
mcp: {
|
|
508
|
+
toolName: 'get_explore_access_summary',
|
|
509
|
+
annotations: READ_ONLY_DEFAULT,
|
|
510
|
+
taskSupport: { exposed: true, taskEligible: false },
|
|
511
|
+
},
|
|
512
|
+
profiles: [PROFILE_DISCOVERY, PROFILE_AI_AGENT_OPS],
|
|
425
513
|
});
|
|
426
514
|
|
|
427
515
|
/** All registered P0 AI agent operations. */
|
|
@@ -435,6 +523,10 @@ export const AI_AGENT_OPERATIONS: readonly OperationDescriptor[] = [
|
|
|
435
523
|
projectAgentsCreate,
|
|
436
524
|
projectAgentsUpdate,
|
|
437
525
|
projectAgentsDelete,
|
|
526
|
+
evaluateAgentReadiness,
|
|
527
|
+
getAgentSuggestions,
|
|
528
|
+
getAgentModels,
|
|
529
|
+
getExploreAccessSummary,
|
|
438
530
|
threadsList,
|
|
439
531
|
threadsGet,
|
|
440
532
|
threadsStart,
|