@lightdash-tools/cli 0.2.5 → 0.3.1

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/README.md CHANGED
@@ -36,101 +36,121 @@ export LIGHTDASH_API_KEY=your-token-here
36
36
 
37
37
  ### Commands
38
38
 
39
- The CLI provides subcommands grouped by domain. All commands output JSON by default. If you are using `npx`, replace `lightdash-tools` with `npx @lightdash-tools/cli`.
39
+ The CLI provides subcommands grouped by domain. All commands output JSON by default. If you are using `npx`, replace `lightdash-ai` with `npx @lightdash-tools/cli`.
40
40
 
41
41
  #### Organization
42
42
 
43
43
  ```bash
44
- lightdash-tools organization get
45
- lightdash-tools organization-roles list
44
+ # Get current organization details
45
+ lightdash-ai organization get
46
+
47
+ # Manage organization roles (v2)
48
+ lightdash-ai organization roles list
49
+ lightdash-ai organization roles get <roleUuid>
50
+ lightdash-ai organization roles assign <userUuid> --role <roleUuid>
46
51
  ```
47
52
 
48
53
  #### Projects
49
54
 
50
55
  ```bash
51
- lightdash-tools projects list
52
- lightdash-tools projects get <projectUuid>
53
- lightdash-tools projects validate run <projectUuid>
54
- lightdash-tools projects validate results <projectUuid>
55
- ```
56
+ # List all projects
57
+ lightdash-ai projects list
56
58
 
57
- #### Explores (Project-level)
59
+ # Get specific project details
60
+ lightdash-ai projects get <projectUuid>
58
61
 
59
- ```bash
60
- lightdash-tools projects explores list <projectUuid>
61
- lightdash-tools projects explores get <projectUuid> <exploreId>
62
- lightdash-tools projects explores dimensions <projectUuid> <exploreId>
63
- lightdash-tools projects explores lineage <projectUuid> <exploreId> <fieldId>
62
+ # Project validation
63
+ lightdash-ai projects validate run <projectUuid>
64
+ lightdash-ai projects validate results <projectUuid>
65
+
66
+ # Manage project role assignments (v2)
67
+ lightdash-ai projects roles list <projectUuid>
68
+ lightdash-ai projects roles assign --project <projectUuid> --user <userUuid> --role <roleUuid>
69
+
70
+ # Manage project access (v1)
71
+ lightdash-ai projects access list <projectUuid>
64
72
  ```
65
73
 
66
- #### Charts (Project-level)
74
+ #### Content (Charts, Dashboards, Spaces)
67
75
 
68
76
  ```bash
69
- lightdash-tools projects charts list <projectUuid>
70
- lightdash-tools projects charts code list <projectUuid> --ids <slugs...>
71
- lightdash-tools projects charts code upsert <projectUuid> <slug> --file <chart.json>
77
+ # List charts in a project
78
+ lightdash-ai projects charts list <projectUuid>
79
+
80
+ # List dashboards in a project
81
+ lightdash-ai projects dashboards list <projectUuid>
82
+
83
+ # List spaces in a project
84
+ lightdash-ai projects spaces list <projectUuid>
85
+
86
+ # Search project content (v2)
87
+ lightdash-ai content search "query"
72
88
  ```
73
89
 
74
- #### Dashboards (Project-level)
90
+ #### Charts as Code
75
91
 
76
92
  ```bash
77
- lightdash-tools projects dashboards list <projectUuid>
93
+ # Get charts in code representation
94
+ lightdash-ai projects charts code list <projectUuid> --ids <slugs...>
95
+
96
+ # Upsert a chart from its code representation
97
+ lightdash-ai projects charts code upsert <projectUuid> <slug> --file <chart.json>
78
98
  ```
79
99
 
80
- #### Spaces (Project-level)
100
+ #### Explores (Project-level)
81
101
 
82
102
  ```bash
83
- lightdash-tools projects spaces list <projectUuid>
84
- lightdash-tools projects spaces get <projectUuid> <spaceUuid>
103
+ lightdash-ai projects explores list <projectUuid>
104
+ lightdash-ai projects explores get <projectUuid> <exploreId>
85
105
  ```
86
106
 
87
107
  #### Users & Groups
88
108
 
89
109
  ```bash
90
- lightdash-tools users list
91
- lightdash-tools users get <userUuid>
92
- lightdash-tools groups list
110
+ # Organization members
111
+ lightdash-ai users list
112
+ lightdash-ai users get <userUuid>
113
+
114
+ # Groups
115
+ lightdash-ai groups list
116
+ lightdash-ai groups get <groupUuid>
117
+ lightdash-ai groups create "Group Name"
93
118
  ```
94
119
 
95
120
  #### Metrics & Schedulers
96
121
 
97
122
  ```bash
98
- lightdash-tools metrics list <projectUuid>
99
- lightdash-tools metrics get <projectUuid> <tableName> <metricName>
100
- lightdash-tools schedulers list <projectUuid>
101
- lightdash-tools schedulers get <schedulerUuid>
123
+ # Metrics catalog
124
+ lightdash-ai metrics list <projectUuid>
125
+ lightdash-ai metrics get <projectUuid> <tableName> <metricName>
126
+
127
+ # Scheduled deliveries
128
+ lightdash-ai schedulers list <projectUuid>
129
+ lightdash-ai schedulers get <schedulerUuid>
102
130
  ```
103
131
 
104
132
  #### Tags
105
133
 
106
134
  ```bash
107
- lightdash-tools tags list <projectUuid>
108
- lightdash-tools tags get <projectUuid> <tagUuid>
135
+ lightdash-ai tags list <projectUuid>
136
+ lightdash-ai tags get <projectUuid> <tagUuid>
109
137
  ```
110
138
 
111
139
  #### Query
112
140
 
113
141
  ```bash
114
- lightdash-tools query compile <projectUuid> <exploreId> --file <query.json>
115
- ```
116
-
117
- #### Content (Experimental)
118
-
119
- ```bash
120
- lightdash-tools content search "query"
142
+ # Compile a metric query
143
+ lightdash-ai query compile <projectUuid> <exploreId> --file <query.json>
121
144
  ```
122
145
 
123
146
  #### AI Agents
124
147
 
125
148
  ```bash
126
- lightdash-tools ai-agents list
127
- ```
149
+ # List AI agents
150
+ lightdash-ai ai-agents list
128
151
 
129
- #### Access Control (Project-level)
130
-
131
- ```bash
132
- lightdash-tools projects project-access list <projectUuid>
133
- lightdash-tools projects project-role-assignments list <projectUuid>
152
+ # List agent threads (admin)
153
+ lightdash-ai ai-agents threads --page 1 --page-size 10
134
154
  ```
135
155
 
136
156
  ### Help
@@ -138,9 +158,10 @@ lightdash-tools projects project-role-assignments list <projectUuid>
138
158
  Get help for any command:
139
159
 
140
160
  ```bash
141
- lightdash-tools --help
142
- lightdash-tools projects --help
143
- lightdash-tools projects charts --help
161
+ lightdash-ai --help
162
+ lightdash-ai projects --help
163
+ lightdash-ai projects charts --help
164
+ lightdash-ai projects charts code --help
144
165
  ```
145
166
 
146
167
  ## Output Format
@@ -155,9 +176,9 @@ The CLI implements a hierarchical safety model to prevent accidental destructive
155
176
 
156
177
  You can control the safety mode via the `LIGHTDASH_TOOL_SAFETY_MODE` environment variable or the global `--safety-mode` flag.
157
178
 
158
- - `read-only`: Only allows non-modifying operations (e.g., list, get).
179
+ - `read-only` (default): Only allows non-modifying operations (e.g., list, get).
159
180
  - `write-idempotent`: Allows read operations and non-destructive writes (e.g., upsert, validate run).
160
- - `write-destructive` (default): Allows all operations, including deletions.
181
+ - `write-destructive`: Allows all operations, including deletions.
161
182
 
162
183
  ### Enforcement
163
184
 
@@ -167,10 +188,10 @@ Example:
167
188
 
168
189
  ```bash
169
190
  # This will work
170
- lightdash-tools --safety-mode read-only users list
191
+ lightdash-ai --safety-mode read-only users list
171
192
 
172
193
  # This will fail if delete was implemented
173
- lightdash-tools --safety-mode read-only users delete <uuid>
194
+ lightdash-ai --safety-mode read-only users delete <uuid>
174
195
  ```
175
196
 
176
197
  When a command is blocked, you will see an error like:
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Project-scoped AI agents command implementation.
3
+ *
4
+ * Covers: agent CRUD, thread management, and evaluation lifecycle.
5
+ * All commands require --project <projectUuid>.
6
+ */
7
+ import type { Command } from 'commander';
8
+ /**
9
+ * Registers the `agents` command group (project-scoped).
10
+ */
11
+ export declare function registerAgentsCommand(program: Command): void;
@@ -0,0 +1,377 @@
1
+ "use strict";
2
+ /**
3
+ * Project-scoped AI agents command implementation.
4
+ *
5
+ * Covers: agent CRUD, thread management, and evaluation lifecycle.
6
+ * All commands require --project <projectUuid>.
7
+ */
8
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
+ return new (P || (P = Promise))(function (resolve, reject) {
11
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
15
+ });
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.registerAgentsCommand = registerAgentsCommand;
19
+ const common_1 = require("@lightdash-tools/common");
20
+ const client_1 = require("../utils/client");
21
+ const safety_1 = require("../utils/safety");
22
+ /**
23
+ * Registers the `agents` command group (project-scoped).
24
+ */
25
+ function registerAgentsCommand(program) {
26
+ const agentsCmd = program
27
+ .command('agents')
28
+ .description('Manage AI agents within a project (project-scoped)');
29
+ // ─── Agent CRUD ──────────────────────────────────────────────────────────────
30
+ agentsCmd
31
+ .command('list')
32
+ .description('List all agents in a project')
33
+ .requiredOption('--project <uuid>', 'Project UUID')
34
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, function () {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const { project } = this.opts();
37
+ try {
38
+ const client = (0, client_1.getClient)();
39
+ const result = yield client.v1.aiAgents.listAgents(project);
40
+ console.log(JSON.stringify(result, null, 2));
41
+ }
42
+ catch (error) {
43
+ console.error('Error listing agents:', error instanceof Error ? error.message : String(error));
44
+ process.exit(1);
45
+ }
46
+ });
47
+ }));
48
+ agentsCmd
49
+ .command('get <agentUuid>')
50
+ .description('Get a single agent by UUID')
51
+ .requiredOption('--project <uuid>', 'Project UUID')
52
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
53
+ const { project } = cmd.opts();
54
+ try {
55
+ const client = (0, client_1.getClient)();
56
+ const result = yield client.v1.aiAgents.getAgent(project, agentUuid);
57
+ console.log(JSON.stringify(result, null, 2));
58
+ }
59
+ catch (error) {
60
+ console.error('Error fetching agent:', error instanceof Error ? error.message : String(error));
61
+ process.exit(1);
62
+ }
63
+ })));
64
+ agentsCmd
65
+ .command('create')
66
+ .description('Create a new agent in a project')
67
+ .requiredOption('--project <uuid>', 'Project UUID')
68
+ .requiredOption('--name <name>', 'Agent name')
69
+ .option('--description <text>', 'Agent description')
70
+ .option('--instruction <text>', 'System instruction for the agent')
71
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, function () {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const options = this.opts();
74
+ try {
75
+ const client = (0, client_1.getClient)();
76
+ const body = Object.assign(Object.assign({ name: options.name, projectUuid: options.project }, (options.description != null ? { description: options.description } : {})), (options.instruction != null ? { instruction: options.instruction } : {}));
77
+ const result = yield client.v1.aiAgents.createAgent(options.project, body);
78
+ console.log(JSON.stringify(result, null, 2));
79
+ }
80
+ catch (error) {
81
+ console.error('Error creating agent:', error instanceof Error ? error.message : String(error));
82
+ process.exit(1);
83
+ }
84
+ });
85
+ }));
86
+ agentsCmd
87
+ .command('update <agentUuid>')
88
+ .description('Update an existing agent')
89
+ .requiredOption('--project <uuid>', 'Project UUID')
90
+ .option('--name <name>', 'New agent name')
91
+ .option('--description <text>', 'New agent description')
92
+ .option('--instruction <text>', 'New system instruction')
93
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
94
+ const options = cmd.opts();
95
+ const body = {};
96
+ if (options.name != null)
97
+ body['name'] = options.name;
98
+ if (options.description != null)
99
+ body['description'] = options.description;
100
+ if (options.instruction != null)
101
+ body['instruction'] = options.instruction;
102
+ if (Object.keys(body).length === 0) {
103
+ console.error('Error: at least one of --name, --description, --instruction is required');
104
+ process.exit(1);
105
+ }
106
+ try {
107
+ const client = (0, client_1.getClient)();
108
+ const result = yield client.v1.aiAgents.updateAgent(options.project, agentUuid, body);
109
+ console.log(JSON.stringify(result, null, 2));
110
+ }
111
+ catch (error) {
112
+ console.error('Error updating agent:', error instanceof Error ? error.message : String(error));
113
+ process.exit(1);
114
+ }
115
+ })));
116
+ agentsCmd
117
+ .command('delete <agentUuid>')
118
+ .description('Delete an agent')
119
+ .requiredOption('--project <uuid>', 'Project UUID')
120
+ .action((0, safety_1.wrapAction)(common_1.WRITE_DESTRUCTIVE, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
121
+ const { project } = cmd.opts();
122
+ try {
123
+ const client = (0, client_1.getClient)();
124
+ yield client.v1.aiAgents.deleteAgent(project, agentUuid);
125
+ console.error(`Agent ${agentUuid} deleted successfully`);
126
+ }
127
+ catch (error) {
128
+ console.error('Error deleting agent:', error instanceof Error ? error.message : String(error));
129
+ process.exit(1);
130
+ }
131
+ })));
132
+ // ─── Thread management ───────────────────────────────────────────────────────
133
+ const threadsCmd = agentsCmd.command('threads').description('Manage agent conversation threads');
134
+ threadsCmd
135
+ .command('list <agentUuid>')
136
+ .description('List all threads for an agent')
137
+ .requiredOption('--project <uuid>', 'Project UUID')
138
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
139
+ const { project } = cmd.opts();
140
+ try {
141
+ const client = (0, client_1.getClient)();
142
+ const result = yield client.v1.aiAgents.listAgentThreads(project, agentUuid);
143
+ console.log(JSON.stringify(result, null, 2));
144
+ }
145
+ catch (error) {
146
+ console.error('Error listing threads:', error instanceof Error ? error.message : String(error));
147
+ process.exit(1);
148
+ }
149
+ })));
150
+ threadsCmd
151
+ .command('get <agentUuid> <threadUuid>')
152
+ .description('Get a thread with all its messages')
153
+ .requiredOption('--project <uuid>', 'Project UUID')
154
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, threadUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
155
+ const { project } = cmd.opts();
156
+ try {
157
+ const client = (0, client_1.getClient)();
158
+ const result = yield client.v1.aiAgents.getAgentThread(project, agentUuid, threadUuid);
159
+ console.log(JSON.stringify(result, null, 2));
160
+ }
161
+ catch (error) {
162
+ console.error('Error fetching thread:', error instanceof Error ? error.message : String(error));
163
+ process.exit(1);
164
+ }
165
+ })));
166
+ threadsCmd
167
+ .command('generate <agentUuid>')
168
+ .description('Start a new thread and generate the first agent response')
169
+ .requiredOption('--project <uuid>', 'Project UUID')
170
+ .requiredOption('--prompt <text>', 'User prompt')
171
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
172
+ const options = cmd.opts();
173
+ try {
174
+ const client = (0, client_1.getClient)();
175
+ // 1. Create thread
176
+ const thread = yield client.v1.aiAgents.createAgentThread(options.project, agentUuid);
177
+ // 2. Generate response
178
+ const result = yield client.v1.aiAgents.generateAgentThreadResponse(options.project, agentUuid, thread.uuid, { prompt: options.prompt });
179
+ console.log(JSON.stringify(Object.assign({ threadUuid: thread.uuid }, result), null, 2));
180
+ }
181
+ catch (error) {
182
+ console.error('Error generating agent response:', error instanceof Error ? error.message : String(error));
183
+ process.exit(1);
184
+ }
185
+ })));
186
+ threadsCmd
187
+ .command('continue <agentUuid> <threadUuid>')
188
+ .description('Continue an existing thread with a new prompt')
189
+ .requiredOption('--project <uuid>', 'Project UUID')
190
+ .requiredOption('--prompt <text>', 'User prompt')
191
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, threadUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
192
+ const options = cmd.opts();
193
+ try {
194
+ const client = (0, client_1.getClient)();
195
+ const result = yield client.v1.aiAgents.generateAgentThreadResponse(options.project, agentUuid, threadUuid, { prompt: options.prompt });
196
+ console.log(JSON.stringify(result, null, 2));
197
+ }
198
+ catch (error) {
199
+ console.error('Error continuing thread:', error instanceof Error ? error.message : String(error));
200
+ process.exit(1);
201
+ }
202
+ })));
203
+ // ─── Evaluations ─────────────────────────────────────────────────────────────
204
+ const evalsCmd = agentsCmd
205
+ .command('evals')
206
+ .description('Manage agent evaluations and run test suites');
207
+ evalsCmd
208
+ .command('list <agentUuid>')
209
+ .description('List all evaluations for an agent')
210
+ .requiredOption('--project <uuid>', 'Project UUID')
211
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
212
+ const { project } = cmd.opts();
213
+ try {
214
+ const client = (0, client_1.getClient)();
215
+ const result = yield client.v1.aiAgents.listEvaluations(project, agentUuid);
216
+ console.log(JSON.stringify(result, null, 2));
217
+ }
218
+ catch (error) {
219
+ console.error('Error listing evaluations:', error instanceof Error ? error.message : String(error));
220
+ process.exit(1);
221
+ }
222
+ })));
223
+ evalsCmd
224
+ .command('get <agentUuid> <evalUuid>')
225
+ .description('Get a full evaluation including its prompts')
226
+ .requiredOption('--project <uuid>', 'Project UUID')
227
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, evalUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
228
+ const { project } = cmd.opts();
229
+ try {
230
+ const client = (0, client_1.getClient)();
231
+ const result = yield client.v1.aiAgents.getEvaluation(project, agentUuid, evalUuid);
232
+ console.log(JSON.stringify(result, null, 2));
233
+ }
234
+ catch (error) {
235
+ console.error('Error fetching evaluation:', error instanceof Error ? error.message : String(error));
236
+ process.exit(1);
237
+ }
238
+ })));
239
+ evalsCmd
240
+ .command('create <agentUuid>')
241
+ .description('Create a new evaluation with a title and optional prompts (JSON file)')
242
+ .requiredOption('--project <uuid>', 'Project UUID')
243
+ .requiredOption('--title <title>', 'Evaluation title')
244
+ .option('--description <text>', 'Evaluation description')
245
+ .option('--prompts <json>', 'JSON array of prompt objects: [{"prompt":"...","expectedResponse":"..."}]')
246
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
247
+ const options = cmd.opts();
248
+ try {
249
+ const client = (0, client_1.getClient)();
250
+ const body = {
251
+ title: options.title,
252
+ prompts: options.prompts ? JSON.parse(options.prompts) : [],
253
+ };
254
+ if (options.description != null)
255
+ body.description = options.description;
256
+ const result = yield client.v1.aiAgents.createEvaluation(options.project, agentUuid, body);
257
+ console.log(JSON.stringify(result, null, 2));
258
+ }
259
+ catch (error) {
260
+ console.error('Error creating evaluation:', error instanceof Error ? error.message : String(error));
261
+ process.exit(1);
262
+ }
263
+ })));
264
+ evalsCmd
265
+ .command('update <agentUuid> <evalUuid>')
266
+ .description('Update an evaluation title, description, or prompts')
267
+ .requiredOption('--project <uuid>', 'Project UUID')
268
+ .option('--title <title>', 'New title')
269
+ .option('--description <text>', 'New description')
270
+ .option('--prompts <json>', 'Replacement JSON array of prompt objects')
271
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, evalUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
272
+ const options = cmd.opts();
273
+ const body = {};
274
+ if (options.title != null)
275
+ body['title'] = options.title;
276
+ if (options.description != null)
277
+ body['description'] = options.description;
278
+ if (options.prompts != null)
279
+ body['prompts'] = JSON.parse(options.prompts);
280
+ if (Object.keys(body).length === 0) {
281
+ console.error('Error: at least one of --title, --description, --prompts is required');
282
+ process.exit(1);
283
+ }
284
+ try {
285
+ const client = (0, client_1.getClient)();
286
+ const result = yield client.v1.aiAgents.updateEvaluation(options.project, agentUuid, evalUuid, body);
287
+ console.log(JSON.stringify(result, null, 2));
288
+ }
289
+ catch (error) {
290
+ console.error('Error updating evaluation:', error instanceof Error ? error.message : String(error));
291
+ process.exit(1);
292
+ }
293
+ })));
294
+ evalsCmd
295
+ .command('append <agentUuid> <evalUuid>')
296
+ .description('Append additional prompts to an existing evaluation')
297
+ .requiredOption('--project <uuid>', 'Project UUID')
298
+ .requiredOption('--prompts <json>', 'JSON array of prompt objects to append')
299
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, evalUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
300
+ const options = cmd.opts();
301
+ try {
302
+ const client = (0, client_1.getClient)();
303
+ yield client.v1.aiAgents.appendToEvaluation(options.project, agentUuid, evalUuid, {
304
+ prompts: JSON.parse(options.prompts),
305
+ });
306
+ console.error(`Prompts appended to evaluation ${evalUuid} successfully`);
307
+ }
308
+ catch (error) {
309
+ console.error('Error appending to evaluation:', error instanceof Error ? error.message : String(error));
310
+ process.exit(1);
311
+ }
312
+ })));
313
+ evalsCmd
314
+ .command('delete <agentUuid> <evalUuid>')
315
+ .description('Delete an evaluation')
316
+ .requiredOption('--project <uuid>', 'Project UUID')
317
+ .action((0, safety_1.wrapAction)(common_1.WRITE_DESTRUCTIVE, (agentUuid, evalUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
318
+ const { project } = cmd.opts();
319
+ try {
320
+ const client = (0, client_1.getClient)();
321
+ yield client.v1.aiAgents.deleteEvaluation(project, agentUuid, evalUuid);
322
+ console.error(`Evaluation ${evalUuid} deleted successfully`);
323
+ }
324
+ catch (error) {
325
+ console.error('Error deleting evaluation:', error instanceof Error ? error.message : String(error));
326
+ process.exit(1);
327
+ }
328
+ })));
329
+ evalsCmd
330
+ .command('run <agentUuid> <evalUuid>')
331
+ .description('Trigger a new evaluation run')
332
+ .requiredOption('--project <uuid>', 'Project UUID')
333
+ .action((0, safety_1.wrapAction)(common_1.WRITE_IDEMPOTENT, (agentUuid, evalUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
334
+ const { project } = cmd.opts();
335
+ try {
336
+ const client = (0, client_1.getClient)();
337
+ const result = yield client.v1.aiAgents.runEvaluation(project, agentUuid, evalUuid);
338
+ console.log(JSON.stringify(result, null, 2));
339
+ }
340
+ catch (error) {
341
+ console.error('Error running evaluation:', error instanceof Error ? error.message : String(error));
342
+ process.exit(1);
343
+ }
344
+ })));
345
+ evalsCmd
346
+ .command('runs <agentUuid> <evalUuid>')
347
+ .description('List all runs for an evaluation')
348
+ .requiredOption('--project <uuid>', 'Project UUID')
349
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, evalUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
350
+ const { project } = cmd.opts();
351
+ try {
352
+ const client = (0, client_1.getClient)();
353
+ const result = yield client.v1.aiAgents.listEvaluationRuns(project, agentUuid, evalUuid);
354
+ console.log(JSON.stringify(result, null, 2));
355
+ }
356
+ catch (error) {
357
+ console.error('Error listing evaluation runs:', error instanceof Error ? error.message : String(error));
358
+ process.exit(1);
359
+ }
360
+ })));
361
+ evalsCmd
362
+ .command('run-results <agentUuid> <evalUuid> <runUuid>')
363
+ .description('Get detailed results for a specific evaluation run')
364
+ .requiredOption('--project <uuid>', 'Project UUID')
365
+ .action((0, safety_1.wrapAction)(common_1.READ_ONLY_DEFAULT, (agentUuid, evalUuid, runUuid, cmd) => __awaiter(this, void 0, void 0, function* () {
366
+ const { project } = cmd.opts();
367
+ try {
368
+ const client = (0, client_1.getClient)();
369
+ const result = yield client.v1.aiAgents.getEvaluationRunResults(project, agentUuid, evalUuid, runUuid);
370
+ console.log(JSON.stringify(result, null, 2));
371
+ }
372
+ catch (error) {
373
+ console.error('Error fetching evaluation run results:', error instanceof Error ? error.message : String(error));
374
+ process.exit(1);
375
+ }
376
+ })));
377
+ }
@@ -1,8 +1,8 @@
1
1
  /**
2
- * AI agents (v1) command implementation.
2
+ * AI agents (v1) command implementation — admin endpoints.
3
3
  */
4
4
  import type { Command } from 'commander';
5
5
  /**
6
- * Registers the top-level ai-agents command and its subcommands.
6
+ * Registers the top-level ai-agents command and its subcommands (admin scope).
7
7
  */
8
8
  export declare function registerAiAgentsCommand(program: Command): void;