@soleri/cli 1.5.1 → 1.7.0
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/commands/create.js +12 -8
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/doctor.js +7 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/list.js +52 -17
- package/dist/commands/list.js.map +1 -1
- package/dist/main.js +4 -1
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/create.ts +14 -9
- package/src/commands/doctor.ts +9 -2
- package/src/commands/list.ts +60 -21
- package/src/main.ts +5 -1
package/dist/commands/create.js
CHANGED
|
@@ -10,6 +10,7 @@ export function registerCreate(program) {
|
|
|
10
10
|
.command('create')
|
|
11
11
|
.argument('[name]', 'Agent ID (kebab-case)')
|
|
12
12
|
.option('-c, --config <path>', 'Path to JSON config file (skip interactive prompts)')
|
|
13
|
+
.option('-y, --yes', 'Skip confirmation prompts (use with --config for fully non-interactive)')
|
|
13
14
|
.description('Create a new Soleri agent')
|
|
14
15
|
.action(async (name, opts) => {
|
|
15
16
|
try {
|
|
@@ -37,6 +38,7 @@ export function registerCreate(program) {
|
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
const nonInteractive = !!(opts?.yes || opts?.config);
|
|
40
42
|
// Hook packs — from config file or interactive prompt
|
|
41
43
|
let selectedPacks = [];
|
|
42
44
|
if (config.hookPacks && config.hookPacks.length > 0) {
|
|
@@ -51,7 +53,7 @@ export function registerCreate(program) {
|
|
|
51
53
|
selectedPacks = selectedPacks.filter((pk) => available.includes(pk));
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
else if (!
|
|
56
|
+
else if (!nonInteractive) {
|
|
55
57
|
const packs = listPacks();
|
|
56
58
|
const packChoices = packs.map((pk) => ({
|
|
57
59
|
value: pk.name,
|
|
@@ -75,16 +77,18 @@ export function registerCreate(program) {
|
|
|
75
77
|
if (selectedPacks.length > 0) {
|
|
76
78
|
p.log.info(`Hook packs: ${selectedPacks.join(', ')}`);
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
p.
|
|
81
|
-
|
|
80
|
+
if (!nonInteractive) {
|
|
81
|
+
const confirmed = await p.confirm({ message: 'Create agent?' });
|
|
82
|
+
if (p.isCancel(confirmed) || !confirmed) {
|
|
83
|
+
p.outro('Cancelled.');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
|
-
// Scaffold
|
|
87
|
+
// Scaffold + auto-build
|
|
84
88
|
const s = p.spinner();
|
|
85
|
-
s.start('Scaffolding agent...');
|
|
89
|
+
s.start('Scaffolding and building agent...');
|
|
86
90
|
const result = scaffold(config);
|
|
87
|
-
s.stop(result.success ? 'Agent created!' : 'Scaffolding failed');
|
|
91
|
+
s.stop(result.success ? 'Agent created and built!' : 'Scaffolding failed');
|
|
88
92
|
if (!result.success) {
|
|
89
93
|
p.log.error(result.summary);
|
|
90
94
|
process.exit(1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,QAAQ,CAAC,QAAQ,EAAE,uB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AAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7B,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE,CAAC;oBACrC,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;oBAC7E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACzB,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,QAAQ,gBAAgB,SAAS,CAAC,MAAM,SAAS,CAAC,CAAC;oBACjF,CAAC;yBAAM,CAAC;wBACN,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,QAAQ,+BAA+B,CAAC,CAAC;oBACpE,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACvC,CAAC;YAED,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -8,11 +8,14 @@ export function registerDoctor(program) {
|
|
|
8
8
|
log.heading('Soleri Doctor');
|
|
9
9
|
const results = runAllChecks();
|
|
10
10
|
let hasFailures = false;
|
|
11
|
+
let hasWarnings = false;
|
|
11
12
|
for (const r of results) {
|
|
12
13
|
if (r.status === 'pass')
|
|
13
14
|
log.pass(r.label, r.detail);
|
|
14
|
-
else if (r.status === 'warn')
|
|
15
|
+
else if (r.status === 'warn') {
|
|
15
16
|
log.warn(r.label, r.detail);
|
|
17
|
+
hasWarnings = true;
|
|
18
|
+
}
|
|
16
19
|
else {
|
|
17
20
|
log.fail(r.label, r.detail);
|
|
18
21
|
hasFailures = true;
|
|
@@ -23,6 +26,9 @@ export function registerDoctor(program) {
|
|
|
23
26
|
log.info('Some checks failed. Fix the issues above and run soleri doctor again.');
|
|
24
27
|
process.exit(1);
|
|
25
28
|
}
|
|
29
|
+
else if (hasWarnings) {
|
|
30
|
+
log.info('All checks passed with warnings. Run from an agent directory to check agent-specific health.');
|
|
31
|
+
}
|
|
26
32
|
else {
|
|
27
33
|
log.info('All checks passed!');
|
|
28
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAE1C,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,GAAG,EAAE;QACX,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAE7B,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAC/B,IAAI,WAAW,GAAG,KAAK,CAAC;QAExB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;iBAChD,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AACA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,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/commands/list.js
CHANGED
|
@@ -1,33 +1,68 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
2
4
|
import { listAgents } from '@soleri/forge/lib';
|
|
3
5
|
import * as log from '../utils/logger.js';
|
|
4
6
|
function pad(s, len) {
|
|
5
7
|
return s.length >= len ? s.slice(0, len) : s + ' '.repeat(len - s.length);
|
|
6
8
|
}
|
|
9
|
+
function printAgentTable(agents) {
|
|
10
|
+
console.log(` ${pad('ID', 16)}${pad('Domains', 26)}${pad('Built', 8)}${pad('Deps', 8)}Path`);
|
|
11
|
+
console.log(' ' + '-'.repeat(80));
|
|
12
|
+
for (const agent of agents) {
|
|
13
|
+
const built = agent.hasDistDir ? '✓' : '✗';
|
|
14
|
+
const deps = agent.hasNodeModules ? '✓' : '✗';
|
|
15
|
+
const domains = agent.domains.join(', ') || '(none)';
|
|
16
|
+
const truncDomains = domains.length > 25 ? domains.slice(0, 22) + '...' : domains;
|
|
17
|
+
console.log(` ${pad(agent.id, 16)}${pad(truncDomains, 26)}${pad(built, 8)}${pad(deps, 8)}${agent.path}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
7
20
|
export function registerList(program) {
|
|
8
21
|
program
|
|
9
22
|
.command('list')
|
|
10
|
-
.argument('[dir]', 'Directory to scan for agents'
|
|
11
|
-
.description('List all Soleri agents in a directory')
|
|
23
|
+
.argument('[dir]', 'Directory to scan for agents')
|
|
24
|
+
.description('List all Soleri agents in a directory (scans common locations if none given)')
|
|
12
25
|
.action((dir) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
if (dir) {
|
|
27
|
+
// Explicit directory — scan only that
|
|
28
|
+
const targetDir = resolve(dir);
|
|
29
|
+
const agents = listAgents(targetDir);
|
|
30
|
+
if (agents.length === 0) {
|
|
31
|
+
log.info(`No agents found in ${targetDir}`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
log.heading(`Agents in ${targetDir}`);
|
|
35
|
+
printAgentTable(agents);
|
|
36
|
+
console.log(`\n ${agents.length} agent(s) found`);
|
|
17
37
|
return;
|
|
18
38
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
// No directory given — scan common locations
|
|
40
|
+
const home = homedir();
|
|
41
|
+
const scanDirs = [
|
|
42
|
+
process.cwd(),
|
|
43
|
+
home,
|
|
44
|
+
resolve(home, 'agents'),
|
|
45
|
+
resolve(home, 'projects'),
|
|
46
|
+
].filter((d, i, arr) => existsSync(d) && arr.indexOf(d) === i);
|
|
47
|
+
const allAgents = [];
|
|
48
|
+
for (const d of scanDirs) {
|
|
49
|
+
allAgents.push(...listAgents(d));
|
|
50
|
+
}
|
|
51
|
+
// Deduplicate by path
|
|
52
|
+
const seen = new Set();
|
|
53
|
+
const unique = allAgents.filter((a) => {
|
|
54
|
+
if (seen.has(a.path))
|
|
55
|
+
return false;
|
|
56
|
+
seen.add(a.path);
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
if (unique.length === 0) {
|
|
60
|
+
log.info('No agents found. Create one with: soleri create');
|
|
61
|
+
return;
|
|
29
62
|
}
|
|
30
|
-
|
|
63
|
+
log.heading('Soleri Agents');
|
|
64
|
+
printAgentTable(unique);
|
|
65
|
+
console.log(`\n ${unique.length} agent(s) found`);
|
|
31
66
|
});
|
|
32
67
|
}
|
|
33
68
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
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|
|
3
4
|
import { registerCreate } from './commands/create.js';
|
|
4
5
|
import { registerList } from './commands/list.js';
|
|
@@ -10,11 +11,13 @@ import { registerHooks } from './commands/hooks.js';
|
|
|
10
11
|
import { registerGovernance } from './commands/governance.js';
|
|
11
12
|
import { registerTest } from './commands/test.js';
|
|
12
13
|
import { registerUpgrade } from './commands/upgrade.js';
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const { version } = require('../package.json');
|
|
13
16
|
const program = new Command();
|
|
14
17
|
program
|
|
15
18
|
.name('soleri')
|
|
16
19
|
.description('Developer CLI for creating and managing Soleri AI agents')
|
|
17
|
-
.version(
|
|
20
|
+
.version(version);
|
|
18
21
|
registerCreate(program);
|
|
19
22
|
registerList(program);
|
|
20
23
|
registerAddDomain(program);
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IA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IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,QAAQ,CAAC;KACd,WAAW,CAAC,0DAA0D,CAAC;KACvE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC3B,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAClC,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC5B,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,eAAe,CAAC,OAAO,CAAC,CAAC;AAEzB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/commands/create.ts
CHANGED
|
@@ -12,8 +12,9 @@ export function registerCreate(program: Command): void {
|
|
|
12
12
|
.command('create')
|
|
13
13
|
.argument('[name]', 'Agent ID (kebab-case)')
|
|
14
14
|
.option('-c, --config <path>', 'Path to JSON config file (skip interactive prompts)')
|
|
15
|
+
.option('-y, --yes', 'Skip confirmation prompts (use with --config for fully non-interactive)')
|
|
15
16
|
.description('Create a new Soleri agent')
|
|
16
|
-
.action(async (name?: string, opts?: { config?: string }) => {
|
|
17
|
+
.action(async (name?: string, opts?: { config?: string; yes?: boolean }) => {
|
|
17
18
|
try {
|
|
18
19
|
let config;
|
|
19
20
|
|
|
@@ -40,6 +41,8 @@ export function registerCreate(program: Command): void {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
const nonInteractive = !!(opts?.yes || opts?.config);
|
|
45
|
+
|
|
43
46
|
// Hook packs — from config file or interactive prompt
|
|
44
47
|
let selectedPacks: string[] = [];
|
|
45
48
|
if (config.hookPacks && config.hookPacks.length > 0) {
|
|
@@ -56,7 +59,7 @@ export function registerCreate(program: Command): void {
|
|
|
56
59
|
}
|
|
57
60
|
selectedPacks = selectedPacks.filter((pk) => available.includes(pk));
|
|
58
61
|
}
|
|
59
|
-
} else if (!
|
|
62
|
+
} else if (!nonInteractive) {
|
|
60
63
|
const packs = listPacks();
|
|
61
64
|
const packChoices = packs.map((pk) => ({
|
|
62
65
|
value: pk.name,
|
|
@@ -85,17 +88,19 @@ export function registerCreate(program: Command): void {
|
|
|
85
88
|
p.log.info(`Hook packs: ${selectedPacks.join(', ')}`);
|
|
86
89
|
}
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
p.
|
|
91
|
-
|
|
91
|
+
if (!nonInteractive) {
|
|
92
|
+
const confirmed = await p.confirm({ message: 'Create agent?' });
|
|
93
|
+
if (p.isCancel(confirmed) || !confirmed) {
|
|
94
|
+
p.outro('Cancelled.');
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
// Scaffold
|
|
99
|
+
// Scaffold + auto-build
|
|
95
100
|
const s = p.spinner();
|
|
96
|
-
s.start('Scaffolding agent...');
|
|
101
|
+
s.start('Scaffolding and building agent...');
|
|
97
102
|
const result = scaffold(config);
|
|
98
|
-
s.stop(result.success ? 'Agent created!' : 'Scaffolding failed');
|
|
103
|
+
s.stop(result.success ? 'Agent created and built!' : 'Scaffolding failed');
|
|
99
104
|
|
|
100
105
|
if (!result.success) {
|
|
101
106
|
p.log.error(result.summary);
|
package/src/commands/doctor.ts
CHANGED
|
@@ -11,11 +11,14 @@ export function registerDoctor(program: Command): void {
|
|
|
11
11
|
|
|
12
12
|
const results = runAllChecks();
|
|
13
13
|
let hasFailures = false;
|
|
14
|
+
let hasWarnings = false;
|
|
14
15
|
|
|
15
16
|
for (const r of results) {
|
|
16
17
|
if (r.status === 'pass') log.pass(r.label, r.detail);
|
|
17
|
-
else if (r.status === 'warn')
|
|
18
|
-
|
|
18
|
+
else if (r.status === 'warn') {
|
|
19
|
+
log.warn(r.label, r.detail);
|
|
20
|
+
hasWarnings = true;
|
|
21
|
+
} else {
|
|
19
22
|
log.fail(r.label, r.detail);
|
|
20
23
|
hasFailures = true;
|
|
21
24
|
}
|
|
@@ -26,6 +29,10 @@ export function registerDoctor(program: Command): void {
|
|
|
26
29
|
if (hasFailures) {
|
|
27
30
|
log.info('Some checks failed. Fix the issues above and run soleri doctor again.');
|
|
28
31
|
process.exit(1);
|
|
32
|
+
} else if (hasWarnings) {
|
|
33
|
+
log.info(
|
|
34
|
+
'All checks passed with warnings. Run from an agent directory to check agent-specific health.',
|
|
35
|
+
);
|
|
29
36
|
} else {
|
|
30
37
|
log.info('All checks passed!');
|
|
31
38
|
}
|
package/src/commands/list.ts
CHANGED
|
@@ -1,42 +1,81 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
2
4
|
import type { Command } from 'commander';
|
|
3
5
|
import { listAgents } from '@soleri/forge/lib';
|
|
6
|
+
import type { AgentInfo } from '@soleri/forge/lib';
|
|
4
7
|
import * as log from '../utils/logger.js';
|
|
5
8
|
|
|
6
9
|
function pad(s: string, len: number): string {
|
|
7
10
|
return s.length >= len ? s.slice(0, len) : s + ' '.repeat(len - s.length);
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
function printAgentTable(agents: AgentInfo[]): void {
|
|
14
|
+
console.log(` ${pad('ID', 16)}${pad('Domains', 26)}${pad('Built', 8)}${pad('Deps', 8)}Path`);
|
|
15
|
+
console.log(' ' + '-'.repeat(80));
|
|
16
|
+
|
|
17
|
+
for (const agent of agents) {
|
|
18
|
+
const built = agent.hasDistDir ? '✓' : '✗';
|
|
19
|
+
const deps = agent.hasNodeModules ? '✓' : '✗';
|
|
20
|
+
const domains = agent.domains.join(', ') || '(none)';
|
|
21
|
+
const truncDomains = domains.length > 25 ? domains.slice(0, 22) + '...' : domains;
|
|
22
|
+
console.log(
|
|
23
|
+
` ${pad(agent.id, 16)}${pad(truncDomains, 26)}${pad(built, 8)}${pad(deps, 8)}${agent.path}`,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
10
28
|
export function registerList(program: Command): void {
|
|
11
29
|
program
|
|
12
30
|
.command('list')
|
|
13
|
-
.argument('[dir]', 'Directory to scan for agents'
|
|
14
|
-
.description('List all Soleri agents in a directory')
|
|
15
|
-
.action((dir
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
.argument('[dir]', 'Directory to scan for agents')
|
|
32
|
+
.description('List all Soleri agents in a directory (scans common locations if none given)')
|
|
33
|
+
.action((dir?: string) => {
|
|
34
|
+
if (dir) {
|
|
35
|
+
// Explicit directory — scan only that
|
|
36
|
+
const targetDir = resolve(dir);
|
|
37
|
+
const agents = listAgents(targetDir);
|
|
38
|
+
|
|
39
|
+
if (agents.length === 0) {
|
|
40
|
+
log.info(`No agents found in ${targetDir}`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
log.heading(`Agents in ${targetDir}`);
|
|
45
|
+
printAgentTable(agents);
|
|
46
|
+
console.log(`\n ${agents.length} agent(s) found`);
|
|
21
47
|
return;
|
|
22
48
|
}
|
|
23
49
|
|
|
24
|
-
|
|
50
|
+
// No directory given — scan common locations
|
|
51
|
+
const home = homedir();
|
|
52
|
+
const scanDirs = [
|
|
53
|
+
process.cwd(),
|
|
54
|
+
home,
|
|
55
|
+
resolve(home, 'agents'),
|
|
56
|
+
resolve(home, 'projects'),
|
|
57
|
+
].filter((d, i, arr) => existsSync(d) && arr.indexOf(d) === i);
|
|
58
|
+
|
|
59
|
+
const allAgents: AgentInfo[] = [];
|
|
60
|
+
for (const d of scanDirs) {
|
|
61
|
+
allAgents.push(...listAgents(d));
|
|
62
|
+
}
|
|
25
63
|
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
64
|
+
// Deduplicate by path
|
|
65
|
+
const seen = new Set<string>();
|
|
66
|
+
const unique = allAgents.filter((a) => {
|
|
67
|
+
if (seen.has(a.path)) return false;
|
|
68
|
+
seen.add(a.path);
|
|
69
|
+
return true;
|
|
70
|
+
});
|
|
29
71
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const domains = agent.domains.join(', ') || '(none)';
|
|
34
|
-
const truncDomains = domains.length > 25 ? domains.slice(0, 22) + '...' : domains;
|
|
35
|
-
console.log(
|
|
36
|
-
` ${pad(agent.id, 16)}${pad(truncDomains, 26)}${pad(built, 8)}${pad(deps, 8)}${agent.path}`,
|
|
37
|
-
);
|
|
72
|
+
if (unique.length === 0) {
|
|
73
|
+
log.info('No agents found. Create one with: soleri create');
|
|
74
|
+
return;
|
|
38
75
|
}
|
|
39
76
|
|
|
40
|
-
|
|
77
|
+
log.heading('Soleri Agents');
|
|
78
|
+
printAgentTable(unique);
|
|
79
|
+
console.log(`\n ${unique.length} agent(s) found`);
|
|
41
80
|
});
|
|
42
81
|
}
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
import { Command } from 'commander';
|
|
4
5
|
import { registerCreate } from './commands/create.js';
|
|
5
6
|
import { registerList } from './commands/list.js';
|
|
@@ -12,12 +13,15 @@ import { registerGovernance } from './commands/governance.js';
|
|
|
12
13
|
import { registerTest } from './commands/test.js';
|
|
13
14
|
import { registerUpgrade } from './commands/upgrade.js';
|
|
14
15
|
|
|
16
|
+
const require = createRequire(import.meta.url);
|
|
17
|
+
const { version } = require('../package.json');
|
|
18
|
+
|
|
15
19
|
const program = new Command();
|
|
16
20
|
|
|
17
21
|
program
|
|
18
22
|
.name('soleri')
|
|
19
23
|
.description('Developer CLI for creating and managing Soleri AI agents')
|
|
20
|
-
.version(
|
|
24
|
+
.version(version);
|
|
21
25
|
|
|
22
26
|
registerCreate(program);
|
|
23
27
|
registerList(program);
|