@agentuity/cli 0.0.48 → 0.0.50

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 (282) hide show
  1. package/bin/cli.ts +26 -5
  2. package/dist/banner.d.ts +1 -1
  3. package/dist/banner.d.ts.map +1 -1
  4. package/dist/cli-logger.d.ts +27 -0
  5. package/dist/cli-logger.d.ts.map +1 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cmd/agents/index.d.ts +2 -0
  8. package/dist/cmd/agents/index.d.ts.map +1 -0
  9. package/dist/cmd/auth/index.d.ts.map +1 -1
  10. package/dist/cmd/auth/login.d.ts.map +1 -1
  11. package/dist/cmd/auth/logout.d.ts.map +1 -1
  12. package/dist/cmd/auth/signup.d.ts.map +1 -1
  13. package/dist/cmd/auth/ssh/add.d.ts.map +1 -1
  14. package/dist/cmd/auth/ssh/delete.d.ts.map +1 -1
  15. package/dist/cmd/auth/ssh/index.d.ts +1 -2
  16. package/dist/cmd/auth/ssh/index.d.ts.map +1 -1
  17. package/dist/cmd/auth/ssh/list.d.ts.map +1 -1
  18. package/dist/cmd/auth/whoami.d.ts.map +1 -1
  19. package/dist/cmd/bundle/ast.d.ts +3 -1
  20. package/dist/cmd/bundle/ast.d.ts.map +1 -1
  21. package/dist/cmd/bundle/index.d.ts.map +1 -1
  22. package/dist/cmd/bundle/plugin.d.ts.map +1 -1
  23. package/dist/cmd/capabilities/index.d.ts +4 -0
  24. package/dist/cmd/capabilities/index.d.ts.map +1 -0
  25. package/dist/cmd/capabilities/show.d.ts +20 -0
  26. package/dist/cmd/capabilities/show.d.ts.map +1 -0
  27. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  28. package/dist/cmd/cloud/deployment/index.d.ts.map +1 -1
  29. package/dist/cmd/cloud/deployment/list.d.ts.map +1 -1
  30. package/dist/cmd/cloud/deployment/remove.d.ts.map +1 -1
  31. package/dist/cmd/cloud/deployment/rollback.d.ts.map +1 -1
  32. package/dist/cmd/cloud/deployment/show.d.ts.map +1 -1
  33. package/dist/cmd/cloud/deployment/undeploy.d.ts.map +1 -1
  34. package/dist/cmd/cloud/deployment/utils.d.ts +4 -2
  35. package/dist/cmd/cloud/deployment/utils.d.ts.map +1 -1
  36. package/dist/cmd/cloud/domain.d.ts.map +1 -1
  37. package/dist/cmd/cloud/index.d.ts.map +1 -1
  38. package/dist/cmd/cloud/resource/add.d.ts.map +1 -1
  39. package/dist/cmd/cloud/resource/delete.d.ts.map +1 -1
  40. package/dist/cmd/cloud/resource/index.d.ts +1 -2
  41. package/dist/cmd/cloud/resource/index.d.ts.map +1 -1
  42. package/dist/cmd/cloud/resource/list.d.ts.map +1 -1
  43. package/dist/cmd/cloud/scp/download.d.ts.map +1 -1
  44. package/dist/cmd/cloud/scp/index.d.ts +1 -2
  45. package/dist/cmd/cloud/scp/index.d.ts.map +1 -1
  46. package/dist/cmd/cloud/scp/upload.d.ts.map +1 -1
  47. package/dist/cmd/cloud/session/get.d.ts +2 -0
  48. package/dist/cmd/cloud/session/get.d.ts.map +1 -0
  49. package/dist/cmd/cloud/session/index.d.ts +2 -0
  50. package/dist/cmd/cloud/session/index.d.ts.map +1 -0
  51. package/dist/cmd/cloud/session/list.d.ts +2 -0
  52. package/dist/cmd/cloud/session/list.d.ts.map +1 -0
  53. package/dist/cmd/cloud/session/logs.d.ts +2 -0
  54. package/dist/cmd/cloud/session/logs.d.ts.map +1 -0
  55. package/dist/cmd/cloud/ssh.d.ts.map +1 -1
  56. package/dist/cmd/dev/agents.d.ts +2 -0
  57. package/dist/cmd/dev/agents.d.ts.map +1 -0
  58. package/dist/cmd/dev/index.d.ts.map +1 -1
  59. package/dist/cmd/dev/sync.d.ts +12 -0
  60. package/dist/cmd/dev/sync.d.ts.map +1 -0
  61. package/dist/cmd/env/delete.d.ts.map +1 -1
  62. package/dist/cmd/env/get.d.ts.map +1 -1
  63. package/dist/cmd/env/import.d.ts.map +1 -1
  64. package/dist/cmd/env/index.d.ts.map +1 -1
  65. package/dist/cmd/env/list.d.ts.map +1 -1
  66. package/dist/cmd/env/pull.d.ts.map +1 -1
  67. package/dist/cmd/env/push.d.ts.map +1 -1
  68. package/dist/cmd/env/set.d.ts.map +1 -1
  69. package/dist/cmd/index.d.ts.map +1 -1
  70. package/dist/cmd/kv/create-namespace.d.ts +3 -0
  71. package/dist/cmd/kv/create-namespace.d.ts.map +1 -0
  72. package/dist/cmd/kv/delete-namespace.d.ts +3 -0
  73. package/dist/cmd/kv/delete-namespace.d.ts.map +1 -0
  74. package/dist/cmd/kv/delete.d.ts +3 -0
  75. package/dist/cmd/kv/delete.d.ts.map +1 -0
  76. package/dist/cmd/kv/get.d.ts +3 -0
  77. package/dist/cmd/kv/get.d.ts.map +1 -0
  78. package/dist/cmd/kv/index.d.ts +2 -0
  79. package/dist/cmd/kv/index.d.ts.map +1 -0
  80. package/dist/cmd/kv/keys.d.ts +3 -0
  81. package/dist/cmd/kv/keys.d.ts.map +1 -0
  82. package/dist/cmd/kv/list-namespaces.d.ts +3 -0
  83. package/dist/cmd/kv/list-namespaces.d.ts.map +1 -0
  84. package/dist/cmd/kv/repl.d.ts +3 -0
  85. package/dist/cmd/kv/repl.d.ts.map +1 -0
  86. package/dist/cmd/kv/search.d.ts +3 -0
  87. package/dist/cmd/kv/search.d.ts.map +1 -0
  88. package/dist/cmd/kv/set.d.ts +3 -0
  89. package/dist/cmd/kv/set.d.ts.map +1 -0
  90. package/dist/cmd/kv/stats.d.ts +3 -0
  91. package/dist/cmd/kv/stats.d.ts.map +1 -0
  92. package/dist/cmd/kv/util.d.ts +8 -0
  93. package/dist/cmd/kv/util.d.ts.map +1 -0
  94. package/dist/cmd/objectstore/delete-bucket.d.ts +3 -0
  95. package/dist/cmd/objectstore/delete-bucket.d.ts.map +1 -0
  96. package/dist/cmd/objectstore/delete.d.ts +3 -0
  97. package/dist/cmd/objectstore/delete.d.ts.map +1 -0
  98. package/dist/cmd/objectstore/get.d.ts +3 -0
  99. package/dist/cmd/objectstore/get.d.ts.map +1 -0
  100. package/dist/cmd/objectstore/index.d.ts +2 -0
  101. package/dist/cmd/objectstore/index.d.ts.map +1 -0
  102. package/dist/cmd/objectstore/list-buckets.d.ts +3 -0
  103. package/dist/cmd/objectstore/list-buckets.d.ts.map +1 -0
  104. package/dist/cmd/objectstore/list-keys.d.ts +3 -0
  105. package/dist/cmd/objectstore/list-keys.d.ts.map +1 -0
  106. package/dist/cmd/objectstore/put.d.ts +3 -0
  107. package/dist/cmd/objectstore/put.d.ts.map +1 -0
  108. package/dist/cmd/objectstore/repl.d.ts +3 -0
  109. package/dist/cmd/objectstore/repl.d.ts.map +1 -0
  110. package/dist/cmd/objectstore/url.d.ts +3 -0
  111. package/dist/cmd/objectstore/url.d.ts.map +1 -0
  112. package/dist/cmd/objectstore/util.d.ts +8 -0
  113. package/dist/cmd/objectstore/util.d.ts.map +1 -0
  114. package/dist/cmd/profile/create.d.ts.map +1 -1
  115. package/dist/cmd/profile/delete.d.ts.map +1 -1
  116. package/dist/cmd/profile/index.d.ts.map +1 -1
  117. package/dist/cmd/profile/list.d.ts +1 -2
  118. package/dist/cmd/profile/list.d.ts.map +1 -1
  119. package/dist/cmd/profile/show.d.ts.map +1 -1
  120. package/dist/cmd/profile/use.d.ts.map +1 -1
  121. package/dist/cmd/project/create.d.ts.map +1 -1
  122. package/dist/cmd/project/delete.d.ts.map +1 -1
  123. package/dist/cmd/project/index.d.ts.map +1 -1
  124. package/dist/cmd/project/list.d.ts.map +1 -1
  125. package/dist/cmd/project/show.d.ts.map +1 -1
  126. package/dist/cmd/project/template-flow.d.ts +1 -1
  127. package/dist/cmd/project/template-flow.d.ts.map +1 -1
  128. package/dist/cmd/prompt/index.d.ts +4 -0
  129. package/dist/cmd/prompt/index.d.ts.map +1 -0
  130. package/dist/cmd/prompt/llm.d.ts +3 -0
  131. package/dist/cmd/prompt/llm.d.ts.map +1 -0
  132. package/dist/cmd/repl/index.d.ts +3 -0
  133. package/dist/cmd/repl/index.d.ts.map +1 -0
  134. package/dist/cmd/schema/index.d.ts +4 -0
  135. package/dist/cmd/schema/index.d.ts.map +1 -0
  136. package/dist/cmd/schema/show.d.ts +3 -0
  137. package/dist/cmd/schema/show.d.ts.map +1 -0
  138. package/dist/cmd/secret/delete.d.ts.map +1 -1
  139. package/dist/cmd/secret/get.d.ts.map +1 -1
  140. package/dist/cmd/secret/import.d.ts.map +1 -1
  141. package/dist/cmd/secret/index.d.ts.map +1 -1
  142. package/dist/cmd/secret/list.d.ts.map +1 -1
  143. package/dist/cmd/secret/pull.d.ts.map +1 -1
  144. package/dist/cmd/secret/push.d.ts.map +1 -1
  145. package/dist/cmd/secret/set.d.ts.map +1 -1
  146. package/dist/cmd/version/index.d.ts.map +1 -1
  147. package/dist/config.d.ts +1 -1
  148. package/dist/config.d.ts.map +1 -1
  149. package/dist/errors.d.ts +83 -0
  150. package/dist/errors.d.ts.map +1 -0
  151. package/dist/explain.d.ts +47 -0
  152. package/dist/explain.d.ts.map +1 -0
  153. package/dist/index.d.ts +6 -0
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/json.d.ts +3 -0
  156. package/dist/json.d.ts.map +1 -0
  157. package/dist/output.d.ts +136 -0
  158. package/dist/output.d.ts.map +1 -0
  159. package/dist/repl.d.ts +120 -0
  160. package/dist/repl.d.ts.map +1 -0
  161. package/dist/schema-generator.d.ts +67 -0
  162. package/dist/schema-generator.d.ts.map +1 -0
  163. package/dist/tui.d.ts +35 -1
  164. package/dist/tui.d.ts.map +1 -1
  165. package/dist/types.d.ts +77 -6
  166. package/dist/types.d.ts.map +1 -1
  167. package/dist/utils/format.d.ts +9 -0
  168. package/dist/utils/format.d.ts.map +1 -0
  169. package/package.json +12 -4
  170. package/src/banner.ts +7 -7
  171. package/src/cli-logger.ts +80 -0
  172. package/src/cli.ts +192 -58
  173. package/src/cmd/agents/index.ts +147 -0
  174. package/src/cmd/auth/index.ts +1 -0
  175. package/src/cmd/auth/login.ts +7 -2
  176. package/src/cmd/auth/logout.ts +4 -0
  177. package/src/cmd/auth/signup.ts +7 -2
  178. package/src/cmd/auth/ssh/add.ts +20 -3
  179. package/src/cmd/auth/ssh/delete.ts +57 -4
  180. package/src/cmd/auth/ssh/index.ts +4 -3
  181. package/src/cmd/auth/ssh/list.ts +38 -27
  182. package/src/cmd/auth/whoami.ts +32 -21
  183. package/src/cmd/bundle/ast.test.ts +2 -2
  184. package/src/cmd/bundle/ast.ts +112 -22
  185. package/src/cmd/bundle/index.ts +20 -0
  186. package/src/cmd/bundle/plugin.ts +60 -14
  187. package/src/cmd/capabilities/index.ts +12 -0
  188. package/src/cmd/capabilities/show.ts +256 -0
  189. package/src/cmd/cloud/deploy.ts +54 -0
  190. package/src/cmd/cloud/deployment/index.ts +1 -0
  191. package/src/cmd/cloud/deployment/list.ts +66 -25
  192. package/src/cmd/cloud/deployment/remove.ts +26 -2
  193. package/src/cmd/cloud/deployment/rollback.ts +35 -4
  194. package/src/cmd/cloud/deployment/show.ts +37 -2
  195. package/src/cmd/cloud/deployment/undeploy.ts +12 -1
  196. package/src/cmd/cloud/deployment/utils.ts +5 -2
  197. package/src/cmd/cloud/domain.ts +3 -2
  198. package/src/cmd/cloud/index.ts +10 -1
  199. package/src/cmd/cloud/resource/add.ts +19 -0
  200. package/src/cmd/cloud/resource/delete.ts +24 -3
  201. package/src/cmd/cloud/resource/index.ts +4 -3
  202. package/src/cmd/cloud/resource/list.ts +36 -10
  203. package/src/cmd/cloud/scp/download.ts +27 -1
  204. package/src/cmd/cloud/scp/index.ts +4 -3
  205. package/src/cmd/cloud/scp/upload.ts +27 -1
  206. package/src/cmd/cloud/session/get.ts +164 -0
  207. package/src/cmd/cloud/session/index.ts +11 -0
  208. package/src/cmd/cloud/session/list.ts +145 -0
  209. package/src/cmd/cloud/session/logs.ts +68 -0
  210. package/src/cmd/cloud/ssh.ts +12 -0
  211. package/src/cmd/dev/agents.ts +122 -0
  212. package/src/cmd/dev/index.ts +106 -8
  213. package/src/cmd/dev/sync.ts +414 -0
  214. package/src/cmd/dev/templates.ts +1 -1
  215. package/src/cmd/env/delete.ts +17 -0
  216. package/src/cmd/env/get.ts +17 -1
  217. package/src/cmd/env/import.ts +47 -3
  218. package/src/cmd/env/index.ts +1 -0
  219. package/src/cmd/env/list.ts +13 -1
  220. package/src/cmd/env/pull.ts +20 -0
  221. package/src/cmd/env/push.ts +33 -1
  222. package/src/cmd/env/set.ts +25 -1
  223. package/src/cmd/index.ts +9 -2
  224. package/src/cmd/kv/create-namespace.ts +45 -0
  225. package/src/cmd/kv/delete-namespace.ts +73 -0
  226. package/src/cmd/kv/delete.ts +51 -0
  227. package/src/cmd/kv/get.ts +65 -0
  228. package/src/cmd/kv/index.ts +31 -0
  229. package/src/cmd/kv/keys.ts +57 -0
  230. package/src/cmd/kv/list-namespaces.ts +43 -0
  231. package/src/cmd/kv/repl.ts +284 -0
  232. package/src/cmd/kv/search.ts +80 -0
  233. package/src/cmd/kv/set.ts +63 -0
  234. package/src/cmd/kv/stats.ts +96 -0
  235. package/src/cmd/kv/util.ts +32 -0
  236. package/src/cmd/objectstore/delete-bucket.ts +72 -0
  237. package/src/cmd/objectstore/delete.ts +59 -0
  238. package/src/cmd/objectstore/get.ts +64 -0
  239. package/src/cmd/objectstore/index.ts +27 -0
  240. package/src/cmd/objectstore/list-buckets.ts +45 -0
  241. package/src/cmd/objectstore/list-keys.ts +60 -0
  242. package/src/cmd/objectstore/put.ts +62 -0
  243. package/src/cmd/objectstore/repl.ts +235 -0
  244. package/src/cmd/objectstore/url.ts +59 -0
  245. package/src/cmd/objectstore/util.ts +28 -0
  246. package/src/cmd/profile/create.ts +28 -2
  247. package/src/cmd/profile/delete.ts +17 -2
  248. package/src/cmd/profile/index.ts +1 -0
  249. package/src/cmd/profile/list.ts +7 -3
  250. package/src/cmd/profile/show.ts +20 -5
  251. package/src/cmd/profile/use.ts +8 -0
  252. package/src/cmd/project/create.ts +31 -0
  253. package/src/cmd/project/delete.ts +24 -2
  254. package/src/cmd/project/index.ts +1 -0
  255. package/src/cmd/project/list.ts +24 -10
  256. package/src/cmd/project/show.ts +28 -9
  257. package/src/cmd/project/template-flow.ts +10 -6
  258. package/src/cmd/prompt/index.ts +12 -0
  259. package/src/cmd/prompt/llm.ts +368 -0
  260. package/src/cmd/repl/index.ts +477 -0
  261. package/src/cmd/schema/index.ts +12 -0
  262. package/src/cmd/schema/show.ts +27 -0
  263. package/src/cmd/secret/delete.ts +17 -0
  264. package/src/cmd/secret/get.ts +20 -1
  265. package/src/cmd/secret/import.ts +45 -2
  266. package/src/cmd/secret/index.ts +1 -0
  267. package/src/cmd/secret/list.ts +10 -1
  268. package/src/cmd/secret/pull.ts +20 -0
  269. package/src/cmd/secret/push.ts +33 -1
  270. package/src/cmd/secret/set.ts +20 -0
  271. package/src/cmd/version/index.ts +15 -2
  272. package/src/config.ts +17 -4
  273. package/src/errors.ts +222 -0
  274. package/src/explain.ts +126 -0
  275. package/src/index.ts +51 -0
  276. package/src/json.ts +28 -0
  277. package/src/output.ts +307 -0
  278. package/src/repl.ts +1507 -0
  279. package/src/schema-generator.ts +389 -0
  280. package/src/tui.ts +178 -13
  281. package/src/types.ts +75 -22
  282. package/src/utils/format.ts +17 -0
@@ -2,16 +2,29 @@ import { createCommand } from '../../types';
2
2
  import { z } from 'zod';
3
3
  import { bundle } from './bundler';
4
4
  import * as tui from '../../tui';
5
+ import { getCommand } from '../../command-prefix';
6
+
7
+ const BundleResponseSchema = z.object({
8
+ success: z.boolean().describe('Whether the bundle succeeded'),
9
+ bundlePath: z.string().describe('Path to the bundle directory'),
10
+ projectName: z.string().describe('Project name'),
11
+ dev: z.boolean().describe('Whether dev mode was enabled'),
12
+ size: z.number().optional().describe('Bundle size in bytes'),
13
+ });
5
14
 
6
15
  export const command = createCommand({
7
16
  name: 'bundle',
8
17
  description: 'Bundle Agentuity application for deployment',
18
+ tags: ['read-only', 'slow', 'requires-project'],
9
19
  aliases: ['build'],
10
20
  optional: { project: true },
21
+ idempotent: false,
22
+ examples: [getCommand('bundle'), getCommand('bundle --dev'), getCommand('build')],
11
23
  schema: {
12
24
  options: z.object({
13
25
  dev: z.boolean().optional().describe('Enable development mode'),
14
26
  }),
27
+ response: BundleResponseSchema,
15
28
  },
16
29
 
17
30
  async handler(ctx) {
@@ -27,6 +40,13 @@ export const command = createCommand({
27
40
  });
28
41
 
29
42
  tui.success('Bundle complete');
43
+
44
+ return {
45
+ success: true,
46
+ bundlePath: `${projectDir}/.agentuity`,
47
+ projectName: project?.projectId || 'unknown',
48
+ dev: opts.dev || false,
49
+ };
30
50
  } catch (error) {
31
51
  if (error instanceof Error) {
32
52
  tui.fatal(`Bundle failed: ${error.message}`);
@@ -266,7 +266,7 @@ const AgentuityBundler: BunPlugin = {
266
266
  string,
267
267
  Map<string, string>
268
268
  >();
269
- const transpiler = new Bun.Transpiler({ loader: 'ts' });
269
+ const transpiler = new Bun.Transpiler({ loader: 'ts', target: 'bun' });
270
270
  let routeDefinitions: BuildMetadata['routes'] = [];
271
271
 
272
272
  build.onResolve({ filter: /\/route\.ts$/, namespace: 'file' }, async (args) => {
@@ -312,6 +312,16 @@ const AgentuityBundler: BunPlugin = {
312
312
  md.set('parent', parentName);
313
313
  }
314
314
 
315
+ const newAgentName = md.get('name');
316
+ for (const [, kv] of agentMetadata) {
317
+ const found = kv.get('name');
318
+ if (newAgentName === found) {
319
+ throw new Error(
320
+ `The agent in ${kv.get('filename')} and the agent in ${md.get('filename')} have the same name (${found}). Agent Names must be unique within a project.`
321
+ );
322
+ }
323
+ }
324
+
315
325
  agentMetadata.set(md.get('identifier')!, md);
316
326
  }
317
327
  return {
@@ -413,6 +423,7 @@ const AgentuityBundler: BunPlugin = {
413
423
  filename: md.get('filename')!,
414
424
  identifier: md.get('identifier')!,
415
425
  description: md.get('description') ?? '',
426
+ agentId: md.get('agentId')!,
416
427
  };
417
428
  if (isSubagent && parentName) {
418
429
  agentDetail.parent = parentName;
@@ -473,20 +484,31 @@ const AgentuityBundler: BunPlugin = {
473
484
  generateAgentRegistry(srcDir, agentInfo);
474
485
  }
475
486
 
487
+ // create the workbench routes
488
+ inserts.push(`await (async() => {
489
+ const { createWorkbenchMetadataRoute, getRouter } = await import('@agentuity/runtime');
490
+ const router = getRouter()!;
491
+ router.get('/_agentuity/workbench/metadata.json', createWorkbenchMetadataRoute());
492
+ })();`);
493
+
476
494
  const file = Bun.file(args.path);
477
495
  let contents = await file.text();
478
496
  let inserted = false;
479
- const index = contents.indexOf(' createApp(');
480
- if (index > 0) {
481
- const endSemi = contents.indexOf(');', index);
482
- if (endSemi > 0) {
483
- contents =
484
- contents.slice(0, endSemi + 2) +
485
- '\n\n' +
486
- inserts.join('\n') +
487
- contents.slice(endSemi + 2);
488
- inserted = true;
489
- }
497
+ let index = contents.indexOf(' createApp(');
498
+ if (index < 0) {
499
+ index = contents.indexOf(' createApp (');
500
+ }
501
+ if (index < 0) {
502
+ throw new Error(`couldn't find the required createApp function in ${args.path}`);
503
+ }
504
+ const endSemi = contents.indexOf(');', index);
505
+ if (endSemi > 0) {
506
+ contents =
507
+ contents.slice(0, endSemi + 2) +
508
+ '\n\n' +
509
+ inserts.join('\n') +
510
+ contents.slice(endSemi + 2);
511
+ inserted = true;
490
512
  }
491
513
  if (!inserted) {
492
514
  contents += `\n${inserts.join('\n')}`;
@@ -552,9 +574,11 @@ const AgentuityBundler: BunPlugin = {
552
574
  filename: v.get('filename')!,
553
575
  id: v.get('id')!,
554
576
  identifier: v.get('identifier')!,
577
+ agentId: v.get('agentId')!,
555
578
  version: v.get('version')!,
556
579
  name: v.get('name')!,
557
580
  description: v.get('description') ?? '<no description provided>',
581
+ projectId,
558
582
  };
559
583
 
560
584
  const evalsStr = v.get('evals');
@@ -563,7 +587,17 @@ const AgentuityBundler: BunPlugin = {
563
587
  `[plugin] Found evals string for agent ${agentData.name}, parsing...`
564
588
  );
565
589
  try {
566
- agentData.evals = JSON.parse(evalsStr);
590
+ const parsedEvals = JSON.parse(evalsStr) as Array<
591
+ Omit<
592
+ NonNullable<BuildMetadata['agents'][number]['evals']>[number],
593
+ 'agentIdentifier' | 'projectId'
594
+ >
595
+ >;
596
+ agentData.evals = parsedEvals.map((evalItem) => ({
597
+ ...evalItem,
598
+ agentIdentifier: agentData.agentId,
599
+ projectId,
600
+ }));
567
601
  logger.trace(
568
602
  `[plugin] Successfully parsed ${agentData.evals?.length ?? 0} eval(s) for agent ${agentData.name}`
569
603
  );
@@ -587,9 +621,11 @@ const AgentuityBundler: BunPlugin = {
587
621
  filename: sub.get('filename')!,
588
622
  id: sub.get('id')!,
589
623
  identifier: sub.get('identifier')!,
624
+ agentId: sub.get('agentId')!,
590
625
  version: sub.get('version')!,
591
626
  name: sub.get('name')!,
592
627
  description: sub.get('description') ?? '<no description provided>',
628
+ projectId,
593
629
  };
594
630
 
595
631
  // Add evals for subagents if any
@@ -599,7 +635,17 @@ const AgentuityBundler: BunPlugin = {
599
635
  `[plugin] Found evals string for subagent ${subagentData.name}, parsing...`
600
636
  );
601
637
  try {
602
- subagentData.evals = JSON.parse(subEvalsStr);
638
+ const parsedSubEvals = JSON.parse(subEvalsStr) as Array<
639
+ Omit<
640
+ NonNullable<BuildMetadata['agents'][number]['evals']>[number],
641
+ 'agentIdentifier' | 'projectId'
642
+ >
643
+ >;
644
+ subagentData.evals = parsedSubEvals.map((evalItem) => ({
645
+ ...evalItem,
646
+ agentIdentifier: subagentData.agentId,
647
+ projectId,
648
+ }));
603
649
  logger.trace(
604
650
  `[plugin] Successfully parsed ${subagentData.evals?.length ?? 0} eval(s) for subagent ${subagentData.name}`
605
651
  );
@@ -0,0 +1,12 @@
1
+ import type { CommandDefinition } from '../../types';
2
+ import { createCommand } from '../../types';
3
+ import { showSubcommand } from './show';
4
+
5
+ export const capabilitiesCommand: CommandDefinition = createCommand({
6
+ name: 'capabilities',
7
+ description: 'Show CLI capabilities and available tasks',
8
+ tags: ['read-only', 'fast'],
9
+ subcommands: [showSubcommand],
10
+ });
11
+
12
+ export default capabilitiesCommand;
@@ -0,0 +1,256 @@
1
+ import { createSubcommand } from '../../types';
2
+ import type { CommandContext } from '../../types';
3
+ import * as tui from '../../tui';
4
+ import { getCommand } from '../../command-prefix';
5
+ import { z } from 'zod';
6
+
7
+ export interface Capability {
8
+ id: string;
9
+ name: string;
10
+ description: string;
11
+ commands: string[];
12
+ requiresAuth?: boolean;
13
+ requiresProject?: boolean;
14
+ }
15
+
16
+ export interface CapabilitiesResponse {
17
+ version: string;
18
+ capabilities: Capability[];
19
+ workflows: Array<{
20
+ name: string;
21
+ description: string;
22
+ steps: string[];
23
+ }>;
24
+ }
25
+
26
+ const CapabilitiesShowResponseSchema = z.object({
27
+ version: z.string().describe('CLI capabilities version'),
28
+ capabilities: z
29
+ .array(
30
+ z.object({
31
+ id: z.string().describe('Capability ID'),
32
+ name: z.string().describe('Capability name'),
33
+ description: z.string().describe('Description'),
34
+ commands: z.array(z.string()).describe('Available commands'),
35
+ requiresAuth: z.boolean().optional().describe('Requires authentication'),
36
+ requiresProject: z.boolean().optional().describe('Requires project'),
37
+ })
38
+ )
39
+ .describe('Available capabilities'),
40
+ workflows: z
41
+ .array(
42
+ z.object({
43
+ name: z.string().describe('Workflow name'),
44
+ description: z.string().describe('Workflow description'),
45
+ steps: z.array(z.string()).describe('Workflow steps'),
46
+ })
47
+ )
48
+ .describe('Common workflows'),
49
+ });
50
+
51
+ export const showSubcommand = createSubcommand({
52
+ name: 'show',
53
+ description: 'Display CLI capabilities',
54
+ tags: ['read-only', 'fast'],
55
+ examples: [getCommand('capabilities show'), getCommand('--json capabilities show')],
56
+ schema: {
57
+ response: CapabilitiesShowResponseSchema,
58
+ },
59
+ idempotent: true,
60
+ async handler(ctx: CommandContext) {
61
+ const { options } = ctx;
62
+
63
+ const capabilities: CapabilitiesResponse = {
64
+ version: '1.0.0',
65
+ capabilities: [
66
+ {
67
+ id: 'auth',
68
+ name: 'Authentication',
69
+ description: 'Login, logout, and manage API keys',
70
+ commands: ['auth login', 'auth logout', 'auth whoami', 'auth signup'],
71
+ requiresAuth: false,
72
+ },
73
+ {
74
+ id: 'ssh',
75
+ name: 'SSH Key Management',
76
+ description: 'Manage SSH keys for secure access',
77
+ commands: ['auth ssh list', 'auth ssh add', 'auth ssh delete'],
78
+ requiresAuth: true,
79
+ },
80
+ {
81
+ id: 'project',
82
+ name: 'Project Management',
83
+ description: 'Create, list, and manage projects',
84
+ commands: [
85
+ 'project init',
86
+ 'project list',
87
+ 'project show',
88
+ 'project download',
89
+ 'project update',
90
+ 'project delete',
91
+ ],
92
+ requiresAuth: true,
93
+ },
94
+ {
95
+ id: 'deployment',
96
+ name: 'Deployment',
97
+ description: 'Deploy and manage applications',
98
+ commands: [
99
+ 'bundle',
100
+ 'cloud deploy',
101
+ 'cloud deployment list',
102
+ 'cloud deployment show',
103
+ 'cloud deployment logs',
104
+ 'cloud deployment rollback',
105
+ ],
106
+ requiresAuth: true,
107
+ requiresProject: true,
108
+ },
109
+ {
110
+ id: 'secrets',
111
+ name: 'Secrets Management',
112
+ description: 'Store and retrieve secrets securely',
113
+ commands: ['secret list', 'secret set', 'secret get', 'secret delete'],
114
+ requiresAuth: true,
115
+ requiresProject: true,
116
+ },
117
+ {
118
+ id: 'env',
119
+ name: 'Environment Variables',
120
+ description: 'Manage environment variables',
121
+ commands: ['env list', 'env set', 'env get', 'env delete'],
122
+ requiresAuth: true,
123
+ requiresProject: true,
124
+ },
125
+ {
126
+ id: 'kv',
127
+ name: 'Key-Value Storage',
128
+ description: 'Store and retrieve key-value data',
129
+ commands: ['kv list', 'kv get', 'kv set', 'kv delete', 'kv stats'],
130
+ requiresAuth: true,
131
+ requiresProject: true,
132
+ },
133
+ {
134
+ id: 'objectstore',
135
+ name: 'Object Storage',
136
+ description: 'Manage object storage buckets and files',
137
+ commands: [
138
+ 'objectstore list',
139
+ 'objectstore upload',
140
+ 'objectstore download',
141
+ 'objectstore delete',
142
+ ],
143
+ requiresAuth: true,
144
+ requiresProject: true,
145
+ },
146
+ {
147
+ id: 'resources',
148
+ name: 'Cloud Resources',
149
+ description: 'View and manage cloud resources',
150
+ commands: ['cloud resource list'],
151
+ requiresAuth: true,
152
+ },
153
+ {
154
+ id: 'config',
155
+ name: 'Configuration',
156
+ description: 'Manage CLI profiles and configuration',
157
+ commands: [
158
+ 'profile list',
159
+ 'profile create',
160
+ 'profile delete',
161
+ 'profile show',
162
+ 'profile switch',
163
+ ],
164
+ },
165
+ {
166
+ id: 'dev',
167
+ name: 'Development',
168
+ description: 'Local development server and REPL',
169
+ commands: ['dev', 'repl'],
170
+ requiresProject: true,
171
+ },
172
+ {
173
+ id: 'introspection',
174
+ name: 'CLI Introspection',
175
+ description: 'Discover CLI structure and capabilities',
176
+ commands: ['schema show', 'capabilities show', 'version'],
177
+ },
178
+ ],
179
+ workflows: [
180
+ {
181
+ name: 'Initial Setup',
182
+ description: 'Get started with Agentuity',
183
+ steps: [
184
+ 'auth signup',
185
+ 'auth login',
186
+ 'project init',
187
+ 'secret set API_KEY <value>',
188
+ 'dev',
189
+ ],
190
+ },
191
+ {
192
+ name: 'Deploy Application',
193
+ description: 'Deploy your application to the cloud',
194
+ steps: ['bundle', 'cloud deploy', 'cloud deployment logs', 'cloud deployment show'],
195
+ },
196
+ {
197
+ name: 'Manage Secrets',
198
+ description: 'Configure application secrets',
199
+ steps: ['secret list', 'secret set <key> <value>', 'secret get <key>'],
200
+ },
201
+ {
202
+ name: 'SSH Key Setup',
203
+ description: 'Add SSH keys for secure access',
204
+ steps: ['auth ssh list', 'auth ssh add --file ~/.ssh/id_rsa.pub'],
205
+ },
206
+ ],
207
+ };
208
+
209
+ if (options.json) {
210
+ console.log(JSON.stringify(capabilities, null, 2));
211
+ } else {
212
+ // Human-readable output
213
+ console.log(tui.bold('Agentuity CLI Capabilities'));
214
+ tui.newline();
215
+
216
+ console.log(tui.bold('Available Tasks:'));
217
+ tui.newline();
218
+
219
+ for (const cap of capabilities.capabilities) {
220
+ console.log(` ${tui.bold(cap.name)}`);
221
+ console.log(` ${cap.description}`);
222
+
223
+ const requirements: string[] = [];
224
+ if (cap.requiresAuth) requirements.push('requires authentication');
225
+ if (cap.requiresProject) requirements.push('requires project');
226
+ if (requirements.length > 0) {
227
+ console.log(` ${tui.muted(`(${requirements.join(', ')})`)}`);
228
+ }
229
+
230
+ console.log(
231
+ ` ${tui.muted(`Commands: ${cap.commands.slice(0, 3).join(', ')}${cap.commands.length > 3 ? '...' : ''}`)}`
232
+ );
233
+ tui.newline();
234
+ }
235
+
236
+ console.log(tui.bold('Common Workflows:'));
237
+ tui.newline();
238
+
239
+ for (const workflow of capabilities.workflows) {
240
+ console.log(` ${tui.bold(workflow.name)}`);
241
+ console.log(` ${workflow.description}`);
242
+ console.log(` ${tui.muted('Steps:')}`);
243
+ for (let i = 0; i < workflow.steps.length; i++) {
244
+ console.log(` ${i + 1}. ${workflow.steps[i]}`);
245
+ }
246
+ tui.newline();
247
+ }
248
+
249
+ console.log(tui.muted('Tip: Use --json for machine-readable output'));
250
+ }
251
+
252
+ return capabilities;
253
+ },
254
+ });
255
+
256
+ export default showSubcommand;
@@ -27,12 +27,45 @@ import {
27
27
  import { zipDir } from '../../utils/zip';
28
28
  import { encryptFIPSKEMDEMStream } from '../../crypto/box';
29
29
  import { checkCustomDomainForDNS } from './domain';
30
+ import { getCommand } from '../../command-prefix';
31
+ import { z } from 'zod';
32
+
33
+ const DeployResponseSchema = z.object({
34
+ success: z.boolean().describe('Whether deployment succeeded'),
35
+ deploymentId: z.string().describe('Deployment ID'),
36
+ projectId: z.string().describe('Project ID'),
37
+ urls: z
38
+ .object({
39
+ deployment: z.string().describe('Deployment-specific URL'),
40
+ latest: z.string().describe('Latest/active deployment URL'),
41
+ custom: z.array(z.string()).optional().describe('Custom domain URLs'),
42
+ })
43
+ .optional()
44
+ .describe('Deployment URLs'),
45
+ });
30
46
 
31
47
  export const deploySubcommand = createSubcommand({
32
48
  name: 'deploy',
33
49
  description: 'Deploy project to the Agentuity Cloud',
50
+ tags: [
51
+ 'mutating',
52
+ 'creates-resource',
53
+ 'slow',
54
+ 'api-intensive',
55
+ 'requires-auth',
56
+ 'requires-project',
57
+ ],
58
+ examples: [
59
+ `${getCommand('cloud deploy')} # Deploy current project`,
60
+ `${getCommand('cloud deploy')} --log-level=debug # Deploy with verbose output`,
61
+ ],
34
62
  toplevel: true,
63
+ idempotent: false,
35
64
  requires: { auth: true, project: true, apiClient: true },
65
+ prerequisites: ['auth login'],
66
+ schema: {
67
+ response: DeployResponseSchema,
68
+ },
36
69
 
37
70
  async handler(ctx) {
38
71
  const { project, apiClient, projectDir, config, options } = ctx;
@@ -335,6 +368,27 @@ export const deploySubcommand = createSubcommand({
335
368
  );
336
369
  }
337
370
  }
371
+
372
+ // Return deployment result (if available)
373
+ if (deployment && complete?.publicUrls) {
374
+ return {
375
+ success: true,
376
+ deploymentId: deployment.id,
377
+ projectId: project.projectId,
378
+ urls: {
379
+ deployment: complete.publicUrls.deployment,
380
+ latest: complete.publicUrls.latest,
381
+ custom: complete.publicUrls.custom,
382
+ },
383
+ };
384
+ }
385
+
386
+ // Fallback response
387
+ return {
388
+ success: false,
389
+ deploymentId: '',
390
+ projectId: project.projectId,
391
+ };
338
392
  } catch (ex) {
339
393
  tui.fatal(`unexpected error trying to deploy project. ${ex}`);
340
394
  }
@@ -8,6 +8,7 @@ import { undeploySubcommand } from './undeploy';
8
8
  export const deploymentCommand = createCommand({
9
9
  name: 'deployment',
10
10
  description: 'Manage deployments',
11
+ tags: ['read-only', 'fast', 'requires-auth'],
11
12
  aliases: ['deployments', 'dep'],
12
13
  subcommands: [
13
14
  listSubcommand,
@@ -3,19 +3,53 @@ import { createSubcommand } from '../../../types';
3
3
  import * as tui from '../../../tui';
4
4
  import { projectDeploymentList } from '@agentuity/server';
5
5
  import { resolveProjectId } from './utils';
6
- import { Table } from 'console-table-printer';
6
+ import { getCommand } from '../../../command-prefix';
7
+ import { ErrorCode } from '../../../errors';
8
+
9
+ const DeploymentListResponseSchema = z.array(
10
+ z.object({
11
+ id: z.string().describe('Deployment ID'),
12
+ state: z.string().optional().describe('Current state of the deployment'),
13
+ active: z.boolean().describe('Whether this is the active deployment'),
14
+ createdAt: z.string().describe('Creation timestamp'),
15
+ message: z.string().optional().describe('Deployment message or description'),
16
+ tags: z.array(z.string()).describe('Deployment tags'),
17
+ })
18
+ );
7
19
 
8
20
  export const listSubcommand = createSubcommand({
9
21
  name: 'list',
10
22
  description: 'List deployments',
23
+ tags: ['read-only', 'slow', 'requires-auth'],
24
+ examples: [
25
+ `${getCommand('cloud deployment list')} # List 10 most recent deployments`,
26
+ `${getCommand('cloud deployment list')} --count=25 # List 25 most recent deployments`,
27
+ `${getCommand('cloud deployment list')} --project-id=proj_abc123xyz`,
28
+ ],
11
29
  aliases: ['ls'],
12
30
  requires: { auth: true, apiClient: true },
13
31
  optional: { project: true },
32
+ idempotent: true,
33
+ pagination: {
34
+ supported: true,
35
+ defaultLimit: 10,
36
+ maxLimit: 100,
37
+ parameters: {
38
+ limit: 'count',
39
+ },
40
+ },
14
41
  schema: {
15
42
  options: z.object({
16
43
  'project-id': z.string().optional().describe('Project ID'),
17
- count: z.coerce.number().default(10).describe('Number of deployments to list'),
44
+ count: z.coerce
45
+ .number()
46
+ .int()
47
+ .min(1)
48
+ .max(100)
49
+ .default(10)
50
+ .describe('Number of deployments to list (1–100)'),
18
51
  }),
52
+ response: DeploymentListResponseSchema,
19
53
  },
20
54
  async handler(ctx) {
21
55
  const projectId = resolveProjectId(ctx, { projectId: ctx.opts['project-id'] });
@@ -26,33 +60,40 @@ export const listSubcommand = createSubcommand({
26
60
 
27
61
  if (deployments.length === 0) {
28
62
  tui.info('No deployments found.');
29
- return;
63
+ return [];
30
64
  }
31
65
 
32
- const table = new Table({
33
- columns: [
34
- { name: 'ID', alignment: 'left' },
35
- { name: 'State', alignment: 'left' },
36
- { name: 'Active', alignment: 'center' },
37
- { name: 'Created', alignment: 'left' },
38
- { name: 'Message', alignment: 'left' },
39
- { name: 'Tags', alignment: 'left' },
40
- ],
41
- });
66
+ const tableData = deployments.map((d) => ({
67
+ ID: d.id,
68
+ State: d.state || 'unknown',
69
+ Active: d.active ? 'Yes' : '',
70
+ Created: new Date(d.createdAt).toLocaleString(),
71
+ Message: d.message || '',
72
+ Tags: d.tags.join(', '),
73
+ }));
42
74
 
43
- for (const d of deployments) {
44
- table.addRow({
45
- ID: d.id,
46
- State: d.state || 'unknown',
47
- Active: d.active ? 'Yes' : '',
48
- Created: new Date(d.createdAt).toLocaleString(),
49
- Message: d.message || '',
50
- Tags: d.tags.join(', '),
51
- });
52
- }
53
- table.printTable();
75
+ tui.table(tableData, [
76
+ { name: 'ID', alignment: 'left' },
77
+ { name: 'State', alignment: 'left' },
78
+ { name: 'Active', alignment: 'center' },
79
+ { name: 'Created', alignment: 'left' },
80
+ { name: 'Message', alignment: 'left' },
81
+ { name: 'Tags', alignment: 'left' },
82
+ ]);
83
+
84
+ return deployments.map((d) => ({
85
+ id: d.id,
86
+ state: d.state,
87
+ active: d.active,
88
+ createdAt: d.createdAt,
89
+ message: d.message,
90
+ tags: d.tags,
91
+ }));
54
92
  } catch (ex) {
55
- tui.fatal(`Failed to list deployments: ${ex instanceof Error ? ex.message : String(ex)}`);
93
+ tui.fatal(
94
+ `Failed to list deployments: ${ex instanceof Error ? ex.message : String(ex)}`,
95
+ ErrorCode.API_ERROR
96
+ );
56
97
  }
57
98
  },
58
99
  });