@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.
Files changed (79) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +41 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cmd/ai/schema/generate.d.ts +3 -0
  5. package/dist/cmd/ai/schema/generate.d.ts.map +1 -0
  6. package/dist/cmd/ai/schema/generate.js +50 -0
  7. package/dist/cmd/ai/schema/generate.js.map +1 -0
  8. package/dist/cmd/ai/schema/index.d.ts.map +1 -1
  9. package/dist/cmd/ai/schema/index.js +2 -1
  10. package/dist/cmd/ai/schema/index.js.map +1 -1
  11. package/dist/cmd/build/ast.d.ts +4 -10
  12. package/dist/cmd/build/ast.d.ts.map +1 -1
  13. package/dist/cmd/build/ast.js +110 -91
  14. package/dist/cmd/build/ast.js.map +1 -1
  15. package/dist/cmd/build/ast.test.js +135 -370
  16. package/dist/cmd/build/ast.test.js.map +1 -1
  17. package/dist/cmd/build/bundler.d.ts +25 -2
  18. package/dist/cmd/build/bundler.d.ts.map +1 -1
  19. package/dist/cmd/build/bundler.js +138 -43
  20. package/dist/cmd/build/bundler.js.map +1 -1
  21. package/dist/cmd/build/plugin.d.ts.map +1 -1
  22. package/dist/cmd/build/plugin.js +16 -8
  23. package/dist/cmd/build/plugin.js.map +1 -1
  24. package/dist/cmd/build/workbench-templates.d.ts +4 -0
  25. package/dist/cmd/build/workbench-templates.d.ts.map +1 -0
  26. package/dist/cmd/build/workbench-templates.js +49 -0
  27. package/dist/cmd/build/workbench-templates.js.map +1 -0
  28. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  29. package/dist/cmd/cloud/deploy.js +11 -3
  30. package/dist/cmd/cloud/deploy.js.map +1 -1
  31. package/dist/cmd/cloud/deployment/show.d.ts.map +1 -1
  32. package/dist/cmd/cloud/deployment/show.js +73 -20
  33. package/dist/cmd/cloud/deployment/show.js.map +1 -1
  34. package/dist/cmd/cloud/session/get.d.ts.map +1 -1
  35. package/dist/cmd/cloud/session/get.js +77 -17
  36. package/dist/cmd/cloud/session/get.js.map +1 -1
  37. package/dist/cmd/index.d.ts.map +1 -1
  38. package/dist/cmd/index.js +2 -0
  39. package/dist/cmd/index.js.map +1 -1
  40. package/dist/cmd/project/template-flow.d.ts.map +1 -1
  41. package/dist/cmd/project/template-flow.js +1 -0
  42. package/dist/cmd/project/template-flow.js.map +1 -1
  43. package/dist/config.d.ts +27 -3
  44. package/dist/config.d.ts.map +1 -1
  45. package/dist/config.js +31 -3
  46. package/dist/config.js.map +1 -1
  47. package/dist/schema-generator.d.ts +1 -1
  48. package/dist/schema-generator.d.ts.map +1 -1
  49. package/dist/schema-parser.d.ts +2 -1
  50. package/dist/schema-parser.d.ts.map +1 -1
  51. package/dist/schema-parser.js +18 -2
  52. package/dist/schema-parser.js.map +1 -1
  53. package/dist/steps.d.ts +2 -1
  54. package/dist/steps.d.ts.map +1 -1
  55. package/dist/steps.js +26 -3
  56. package/dist/steps.js.map +1 -1
  57. package/dist/types.d.ts +39 -2
  58. package/dist/types.d.ts.map +1 -1
  59. package/dist/types.js +4 -75
  60. package/dist/types.js.map +1 -1
  61. package/package.json +3 -3
  62. package/src/cli.ts +49 -2
  63. package/src/cmd/ai/schema/generate.ts +64 -0
  64. package/src/cmd/ai/schema/index.ts +2 -1
  65. package/src/cmd/build/ast.test.ts +157 -549
  66. package/src/cmd/build/ast.ts +130 -116
  67. package/src/cmd/build/bundler.ts +157 -42
  68. package/src/cmd/build/plugin.ts +18 -9
  69. package/src/cmd/build/workbench-templates.ts +52 -0
  70. package/src/cmd/cloud/deploy.ts +11 -3
  71. package/src/cmd/cloud/deployment/show.ts +60 -17
  72. package/src/cmd/cloud/session/get.ts +91 -19
  73. package/src/cmd/index.ts +2 -0
  74. package/src/cmd/project/template-flow.ts +1 -0
  75. package/src/config.ts +44 -5
  76. package/src/schema-generator.ts +1 -1
  77. package/src/schema-parser.ts +19 -4
  78. package/src/steps.ts +27 -4
  79. 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 => ({ status: 'error', message });
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}\n`);
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}\n`);
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 FileFields = {
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>;