@hazeljs/cli 2.0.2 → 2.0.4

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/cli-manifest.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Machine-readable manifest of all CLI commands and options for LLM agent tool-use",
5
5
  "cli": {
6
6
  "name": "hazel",
7
- "version": "2.0.2",
7
+ "version": "2.0.4",
8
8
  "description": "CLI for generating HazelJS components and applications"
9
9
  },
10
10
  "commands": [
@@ -51,6 +51,64 @@ const DEFAULT_PLATFORM_STORE = path.join('.hazel', 'platform', 'resources.json')
51
51
  * `hazel agent runs list|inspect|cancel|resume|approve` — durable store ops.
52
52
  */
53
53
  function registerAgentCommand(program) {
54
+ program
55
+ .command('agents')
56
+ .description('List deployed Agent OS agents (name, status, current task)')
57
+ .option('--store <path>', 'Platform resource store path', DEFAULT_PLATFORM_STORE)
58
+ .option('--dir <path>', 'Durable store directory', DEFAULT_DURABLE_DIR)
59
+ .option('--project <path>', 'Project root', '.')
60
+ .option('--json', 'Print JSON')
61
+ .action(async (opts) => {
62
+ try {
63
+ const { AgentOS } = await Promise.resolve().then(() => __importStar(require('@hazeljs/agent')));
64
+ const projectRoot = path.resolve(opts.project);
65
+ const osPlane = new AgentOS({
66
+ projectRoot,
67
+ storePath: path.resolve(opts.store),
68
+ durableDir: path.resolve(opts.dir),
69
+ });
70
+ try {
71
+ await osPlane.recover();
72
+ const agents = await osPlane.list();
73
+ if (opts.json) {
74
+ // eslint-disable-next-line no-console
75
+ console.log(JSON.stringify({ agents }, null, 2));
76
+ return;
77
+ }
78
+ const rows = agents.map((a) => ({
79
+ NAME: a.name,
80
+ STATUS: a.status,
81
+ CURRENT: a.occupancy.currentTask ??
82
+ (a.status === 'sleeping' ? (a.occupancy.nextWakeAt ?? '-') : '-'),
83
+ }));
84
+ if (!rows.length) {
85
+ // eslint-disable-next-line no-console
86
+ console.log('No agents deployed. Use Agent Office or `hazel agent apply`.');
87
+ return;
88
+ }
89
+ const widths = {
90
+ NAME: Math.max(4, ...rows.map((r) => r.NAME.length)),
91
+ STATUS: Math.max(6, ...rows.map((r) => r.STATUS.length)),
92
+ CURRENT: Math.max(7, ...rows.map((r) => r.CURRENT.length)),
93
+ };
94
+ const line = (r) => `${r.NAME.padEnd(widths.NAME)} ${r.STATUS.padEnd(widths.STATUS)} ${r.CURRENT}`;
95
+ // eslint-disable-next-line no-console
96
+ console.log(line({ NAME: 'NAME', STATUS: 'STATUS', CURRENT: 'CURRENT' }));
97
+ for (const r of rows) {
98
+ // eslint-disable-next-line no-console
99
+ console.log(line(r));
100
+ }
101
+ }
102
+ finally {
103
+ await osPlane.dispose();
104
+ }
105
+ }
106
+ catch (e) {
107
+ // eslint-disable-next-line no-console
108
+ console.error(e instanceof Error ? e.message : e);
109
+ process.exitCode = 1;
110
+ }
111
+ });
54
112
  const agent = program
55
113
  .command('agent')
56
114
  .description('Agent OS DNA / runtime / marketplace / platform helpers');
@@ -61,6 +61,7 @@ describe('registerAgentCommand (AOS-011 + templates)', () => {
61
61
  'delete',
62
62
  'events',
63
63
  ]));
64
+ expect(program.commands.map((c) => c.name())).toEqual(expect.arrayContaining(['agents', 'agent']));
64
65
  });
65
66
  });
66
67
  describe('agent templates scaffold', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hazeljs/cli",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Command-line interface for scaffolding and generating HazelJS applications and components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,11 +31,11 @@
31
31
  "mustache": "^4.2.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@hazeljs/eval": "^2.0.2",
35
- "@hazeljs/benchmark": "^2.0.2",
36
- "@hazeljs/agent": "^2.0.2",
37
- "@hazeljs/skillgate": "^2.0.2",
38
- "@hazeljs/agent-gatekeeper": "^2.0.2"
34
+ "@hazeljs/eval": "^2.0.4",
35
+ "@hazeljs/benchmark": "^2.0.4",
36
+ "@hazeljs/agent": "^2.0.4",
37
+ "@hazeljs/skillgate": "^2.0.4",
38
+ "@hazeljs/agent-gatekeeper": "^2.0.4"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@hazeljs/eval": {
@@ -55,14 +55,14 @@
55
55
  }
56
56
  },
57
57
  "devDependencies": {
58
- "@hazeljs/eval": "^2.0.2",
59
- "@hazeljs/benchmark": "^2.0.2",
60
- "@hazeljs/agent": "^2.0.2",
61
- "@hazeljs/skillgate": "^2.0.2",
62
- "@hazeljs/agent-gatekeeper": "^2.0.2",
58
+ "@hazeljs/eval": "^2.0.4",
59
+ "@hazeljs/benchmark": "^2.0.4",
60
+ "@hazeljs/agent": "^2.0.4",
61
+ "@hazeljs/skillgate": "^2.0.4",
62
+ "@hazeljs/agent-gatekeeper": "^2.0.4",
63
63
  "@types/inquirer": "^8.2.10",
64
64
  "@types/mustache": "^4.2.5",
65
- "typescript": "^5.9.3"
65
+ "typescript": "^6.0.3"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">=14.0.0"