@agentuity/cli 0.0.55 → 0.0.57
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/cli.d.ts.map +1 -1
- package/dist/cli.js +41 -2
- package/dist/cli.js.map +1 -1
- package/dist/cmd/ai/schema/generate.d.ts +3 -0
- package/dist/cmd/ai/schema/generate.d.ts.map +1 -0
- package/dist/cmd/ai/schema/generate.js +50 -0
- package/dist/cmd/ai/schema/generate.js.map +1 -0
- package/dist/cmd/ai/schema/index.d.ts.map +1 -1
- package/dist/cmd/ai/schema/index.js +2 -1
- package/dist/cmd/ai/schema/index.js.map +1 -1
- package/dist/cmd/build/ast.d.ts +4 -10
- package/dist/cmd/build/ast.d.ts.map +1 -1
- package/dist/cmd/build/ast.js +110 -91
- package/dist/cmd/build/ast.js.map +1 -1
- package/dist/cmd/build/ast.test.js +135 -370
- package/dist/cmd/build/ast.test.js.map +1 -1
- package/dist/cmd/build/bundler.d.ts +25 -2
- package/dist/cmd/build/bundler.d.ts.map +1 -1
- package/dist/cmd/build/bundler.js +138 -43
- package/dist/cmd/build/bundler.js.map +1 -1
- package/dist/cmd/build/plugin.d.ts.map +1 -1
- package/dist/cmd/build/plugin.js +16 -8
- package/dist/cmd/build/plugin.js.map +1 -1
- package/dist/cmd/build/workbench-templates.d.ts +4 -0
- package/dist/cmd/build/workbench-templates.d.ts.map +1 -0
- package/dist/cmd/build/workbench-templates.js +49 -0
- package/dist/cmd/build/workbench-templates.js.map +1 -0
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.js +11 -3
- package/dist/cmd/cloud/deploy.js.map +1 -1
- package/dist/cmd/cloud/deployment/show.d.ts.map +1 -1
- package/dist/cmd/cloud/deployment/show.js +73 -20
- package/dist/cmd/cloud/deployment/show.js.map +1 -1
- package/dist/cmd/cloud/session/get.d.ts.map +1 -1
- package/dist/cmd/cloud/session/get.js +77 -17
- package/dist/cmd/cloud/session/get.js.map +1 -1
- package/dist/cmd/index.d.ts.map +1 -1
- package/dist/cmd/index.js +2 -0
- package/dist/cmd/index.js.map +1 -1
- package/dist/cmd/project/template-flow.d.ts.map +1 -1
- package/dist/cmd/project/template-flow.js +1 -0
- package/dist/cmd/project/template-flow.js.map +1 -1
- package/dist/config.d.ts +27 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +31 -3
- package/dist/config.js.map +1 -1
- package/dist/schema-generator.d.ts +1 -1
- package/dist/schema-generator.d.ts.map +1 -1
- package/dist/schema-parser.d.ts +2 -1
- package/dist/schema-parser.d.ts.map +1 -1
- package/dist/schema-parser.js +18 -2
- package/dist/schema-parser.js.map +1 -1
- package/dist/steps.d.ts +2 -1
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +26 -3
- package/dist/steps.js.map +1 -1
- package/dist/types.d.ts +39 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -75
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
- package/src/cli.ts +49 -2
- package/src/cmd/ai/schema/generate.ts +64 -0
- package/src/cmd/ai/schema/index.ts +2 -1
- package/src/cmd/build/ast.test.ts +157 -549
- package/src/cmd/build/ast.ts +130 -116
- package/src/cmd/build/bundler.ts +157 -42
- package/src/cmd/build/plugin.ts +18 -9
- package/src/cmd/build/workbench-templates.ts +52 -0
- package/src/cmd/cloud/deploy.ts +11 -3
- package/src/cmd/cloud/deployment/show.ts +60 -17
- package/src/cmd/cloud/session/get.ts +91 -19
- package/src/cmd/index.ts +2 -0
- package/src/cmd/project/template-flow.ts +1 -0
- package/src/config.ts +44 -5
- package/src/schema-generator.ts +1 -1
- package/src/schema-parser.ts +19 -4
- package/src/steps.ts +27 -4
- package/src/types.ts +5 -84
package/src/steps.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { ColorScheme } from './terminal';
|
|
9
9
|
import type { LogLevel } from './types';
|
|
10
|
+
import { ValidationError } from '@agentuity/server';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Get the appropriate exit function (Bun.exit or process.exit)
|
|
@@ -108,14 +109,18 @@ function getColor(colorKey: keyof typeof COLORS): string {
|
|
|
108
109
|
export type StepOutcome =
|
|
109
110
|
| { status: 'success' }
|
|
110
111
|
| { status: 'skipped'; reason?: string }
|
|
111
|
-
| { status: 'error'; message: string };
|
|
112
|
+
| { status: 'error'; message: string; cause?: Error };
|
|
112
113
|
|
|
113
114
|
/**
|
|
114
115
|
* Helper functions for creating step outcomes
|
|
115
116
|
*/
|
|
116
117
|
export const stepSuccess = (): StepOutcome => ({ status: 'success' });
|
|
117
118
|
export const stepSkipped = (reason?: string): StepOutcome => ({ status: 'skipped', reason });
|
|
118
|
-
export const stepError = (message: string): StepOutcome => ({
|
|
119
|
+
export const stepError = (message: string, cause?: Error): StepOutcome => ({
|
|
120
|
+
status: 'error',
|
|
121
|
+
message,
|
|
122
|
+
cause,
|
|
123
|
+
});
|
|
119
124
|
|
|
120
125
|
/**
|
|
121
126
|
* Progress callback function
|
|
@@ -260,6 +265,7 @@ async function runStepsTUI(state: StepState[]): Promise<void> {
|
|
|
260
265
|
step.outcome = {
|
|
261
266
|
status: 'error',
|
|
262
267
|
message: err instanceof Error ? err.message : String(err),
|
|
268
|
+
cause: err instanceof Error ? err : undefined,
|
|
263
269
|
};
|
|
264
270
|
}
|
|
265
271
|
|
|
@@ -276,7 +282,15 @@ async function runStepsTUI(state: StepState[]): Promise<void> {
|
|
|
276
282
|
// If error, show error message and exit
|
|
277
283
|
if (step.outcome?.status === 'error') {
|
|
278
284
|
const errorColor = getColor('red');
|
|
279
|
-
console.error(`\n${errorColor}Error: ${step.outcome.message}${COLORS.reset}
|
|
285
|
+
console.error(`\n${errorColor}Error: ${step.outcome.message}${COLORS.reset}`);
|
|
286
|
+
if (step.outcome.cause instanceof ValidationError) {
|
|
287
|
+
console.error(`${errorColor}Validation details:${COLORS.reset}`);
|
|
288
|
+
for (const issue of step.outcome.cause.issues) {
|
|
289
|
+
const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
|
|
290
|
+
console.error(` ${path}: ${issue.message}`);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
console.error('');
|
|
280
294
|
process.stdout.write('\x1B[?25h'); // Show cursor
|
|
281
295
|
process.exit(1);
|
|
282
296
|
}
|
|
@@ -312,6 +326,7 @@ async function runStepsPlain(state: StepState[]): Promise<void> {
|
|
|
312
326
|
step.outcome = {
|
|
313
327
|
status: 'error',
|
|
314
328
|
message: err instanceof Error ? err.message : String(err),
|
|
329
|
+
cause: err instanceof Error ? err : undefined,
|
|
315
330
|
};
|
|
316
331
|
}
|
|
317
332
|
|
|
@@ -326,7 +341,15 @@ async function runStepsPlain(state: StepState[]): Promise<void> {
|
|
|
326
341
|
} else if (step.outcome?.status === 'error') {
|
|
327
342
|
console.log(`${redColor}${ICONS.error}${COLORS.reset} ${step.label}`);
|
|
328
343
|
const errorColor = getColor('red');
|
|
329
|
-
console.error(`\n${errorColor}Error: ${step.outcome.message}${COLORS.reset}
|
|
344
|
+
console.error(`\n${errorColor}Error: ${step.outcome.message}${COLORS.reset}`);
|
|
345
|
+
if (step.outcome.cause instanceof ValidationError) {
|
|
346
|
+
console.error(`${errorColor}Validation details:${COLORS.reset}`);
|
|
347
|
+
for (const issue of step.outcome.cause.issues) {
|
|
348
|
+
const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
|
|
349
|
+
console.error(` ${path}: ${issue.message}`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
console.error('');
|
|
330
353
|
process.exit(1);
|
|
331
354
|
}
|
|
332
355
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Logger } from '@agentuity/core';
|
|
2
|
-
import { Deployment } from '@agentuity/server';
|
|
2
|
+
import { Deployment, BuildMetadataSchema as ServerBuildMetadataSchema } from '@agentuity/server';
|
|
3
3
|
import type * as z from 'zod';
|
|
4
4
|
import { z as zod } from 'zod';
|
|
5
5
|
import type { APIClient } from './api';
|
|
6
6
|
|
|
7
|
+
export { Deployment };
|
|
8
|
+
|
|
7
9
|
export type { Logger };
|
|
8
10
|
|
|
9
11
|
export const ConfigSchema = zod.object({
|
|
@@ -426,91 +428,10 @@ export type SubcommandDefinition =
|
|
|
426
428
|
export const ProjectSchema = zod.object({
|
|
427
429
|
projectId: zod.string().describe('the project id'),
|
|
428
430
|
orgId: zod.string().describe('the organization id'),
|
|
431
|
+
region: zod.string().describe('the region identifier that the project is deployed into'),
|
|
429
432
|
deployment: Deployment.optional().describe('the deployment configuration'),
|
|
430
433
|
});
|
|
431
434
|
|
|
432
|
-
const
|
|
433
|
-
filename: zod.string().describe('the relative path for the file'),
|
|
434
|
-
version: zod.string().describe('the SHA256 content of the file'),
|
|
435
|
-
identifier: zod.string().describe('the folder for the file'),
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
const EvalSchema = zod.object({
|
|
439
|
-
...FileFields,
|
|
440
|
-
id: zod.string().describe('the unique calculated id for the eval'),
|
|
441
|
-
evalId: zod.string().describe('the unique id for eval for the project across deployments'),
|
|
442
|
-
name: zod.string().describe('the name of the eval'),
|
|
443
|
-
description: zod.string().optional().describe('the eval description'),
|
|
444
|
-
agentIdentifier: zod.string().describe('the identifier of the agent'),
|
|
445
|
-
projectId: zod.string().describe('the project id'),
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
const BaseAgentFields = {
|
|
449
|
-
...FileFields,
|
|
450
|
-
id: zod.string().describe('the unique calculated id for the agent'),
|
|
451
|
-
agentId: zod.string().describe('the unique id for agent for the project across deployments'),
|
|
452
|
-
projectId: zod.string().describe('the project id'),
|
|
453
|
-
name: zod.string().describe('the name of the agent'),
|
|
454
|
-
description: zod.string().optional().describe('the agent description'),
|
|
455
|
-
evals: zod.array(EvalSchema).optional().describe('the evals for the agent'),
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
const AgentSchema = zod.object({
|
|
459
|
-
...BaseAgentFields,
|
|
460
|
-
subagents: zod.array(zod.object(BaseAgentFields)).optional().describe('subagents of this agent'),
|
|
461
|
-
});
|
|
462
|
-
|
|
463
|
-
export const BuildMetadataSchema = zod.object({
|
|
464
|
-
routes: zod.array(
|
|
465
|
-
zod.object({
|
|
466
|
-
id: zod.string().describe('the unique calculated id for the route'),
|
|
467
|
-
filename: zod.string().describe('the relative path for the file'),
|
|
468
|
-
path: zod.string().describe('the route path'),
|
|
469
|
-
method: zod.enum(['get', 'post', 'put', 'delete', 'patch']).describe('the HTTP method'),
|
|
470
|
-
version: zod.string().describe('the SHA256 content of the file'),
|
|
471
|
-
type: zod.enum(['api', 'sms', 'email', 'cron', 'websocket', 'sse', 'stream']),
|
|
472
|
-
config: zod
|
|
473
|
-
.record(zod.string(), zod.unknown())
|
|
474
|
-
.optional()
|
|
475
|
-
.describe('type specific configuration'),
|
|
476
|
-
})
|
|
477
|
-
),
|
|
478
|
-
agents: zod.array(AgentSchema),
|
|
479
|
-
assets: zod.array(
|
|
480
|
-
zod.object({
|
|
481
|
-
filename: zod.string().describe('the relative path for the file'),
|
|
482
|
-
kind: zod.string().describe('the type of asset'),
|
|
483
|
-
contentType: zod.string().describe('the content-type for the file'),
|
|
484
|
-
size: zod.number().describe('the size in bytes for the file'),
|
|
485
|
-
})
|
|
486
|
-
),
|
|
487
|
-
project: zod.object({
|
|
488
|
-
id: zod.string().describe('the project id'),
|
|
489
|
-
name: zod.string().describe('the name of the project (from package.json)'),
|
|
490
|
-
version: zod.string().optional().describe('the version of the project (from package.json)'),
|
|
491
|
-
}),
|
|
492
|
-
deployment: zod.object({
|
|
493
|
-
id: zod.string().describe('the deployment id'),
|
|
494
|
-
date: zod.string().describe('the date the deployment was created in UTC format'),
|
|
495
|
-
git: zod
|
|
496
|
-
.object({
|
|
497
|
-
repo: zod.string().optional().describe('the repository name'),
|
|
498
|
-
commit: zod.string().optional().describe('the git commit sha'),
|
|
499
|
-
message: zod.string().optional().describe('the git commit message'),
|
|
500
|
-
branch: zod.string().optional().describe('the git branch'),
|
|
501
|
-
tags: zod.array(zod.string()).optional().describe('the tags for the current branch'),
|
|
502
|
-
pr: zod.string().optional().describe('the pull request number'),
|
|
503
|
-
})
|
|
504
|
-
.optional()
|
|
505
|
-
.describe('git commit information'),
|
|
506
|
-
build: zod.object({
|
|
507
|
-
bun: zod.string().describe('the version of bun that was used to build the deployment'),
|
|
508
|
-
agentuity: zod.string().describe('the version of the agentuity runtime'),
|
|
509
|
-
arch: zod.string().describe('the machine architecture'),
|
|
510
|
-
platform: zod.string().describe('the machine os platform'),
|
|
511
|
-
}),
|
|
512
|
-
}),
|
|
513
|
-
});
|
|
514
|
-
|
|
435
|
+
export const BuildMetadataSchema = ServerBuildMetadataSchema;
|
|
515
436
|
export type BuildMetadata = zod.infer<typeof BuildMetadataSchema>;
|
|
516
437
|
export type Project = zod.infer<typeof ProjectSchema>;
|