nex-framework-cli 1.0.14 → 1.0.17
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/nex-cli.js
CHANGED
|
@@ -28,7 +28,7 @@ program.configureHelp({
|
|
|
28
28
|
program
|
|
29
29
|
.name('nex')
|
|
30
30
|
.description('NEX Framework - Framework completo de agentes AI')
|
|
31
|
-
.version('1.0.
|
|
31
|
+
.version('1.0.16', '-v, --version', 'Mostra a versão')
|
|
32
32
|
.addHelpText('before', chalk.bold.cyan(`
|
|
33
33
|
╔════════════════════════════════════════════════════════════════╗
|
|
34
34
|
║ NEX Framework - CLI v1.0.9 ║
|
package/package.json
CHANGED
|
@@ -26,8 +26,18 @@ export default class NEXMarketplace {
|
|
|
26
26
|
} else {
|
|
27
27
|
// Tentar encontrar o registry dentro do pacote npm instalado
|
|
28
28
|
try {
|
|
29
|
-
|
|
30
|
-
const
|
|
29
|
+
// Obter o caminho do arquivo atual
|
|
30
|
+
const currentFileUrl = new URL(import.meta.url)
|
|
31
|
+
// No Windows, file:/// pode ter 3 barras, precisamos normalizar
|
|
32
|
+
let currentFilePath = currentFileUrl.pathname
|
|
33
|
+
// Remover barra inicial no Windows (file:///C:/...)
|
|
34
|
+
if (process.platform === 'win32' && currentFilePath.startsWith('/')) {
|
|
35
|
+
currentFilePath = currentFilePath.substring(1)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Resolver caminho relativo: de src/services/nex-marketplace/NEXMarketplace.js para raiz do pacote
|
|
39
|
+
const currentDir = path.dirname(currentFilePath)
|
|
40
|
+
const packageRoot = path.resolve(currentDir, '..', '..', '..')
|
|
31
41
|
const npmRegistryPath = path.join(packageRoot, 'registry')
|
|
32
42
|
|
|
33
43
|
// Verificar se existe (quando instalado via npm)
|
|
@@ -37,7 +47,7 @@ export default class NEXMarketplace {
|
|
|
37
47
|
// Fallback para registry no projeto
|
|
38
48
|
this.registryPath = path.join(this.projectRoot, 'registry')
|
|
39
49
|
}
|
|
40
|
-
} catch {
|
|
50
|
+
} catch (error) {
|
|
41
51
|
// Fallback para registry no projeto
|
|
42
52
|
this.registryPath = path.join(this.projectRoot, 'registry')
|
|
43
53
|
}
|
|
@@ -441,7 +451,7 @@ export default class NEXMarketplace {
|
|
|
441
451
|
return results
|
|
442
452
|
}
|
|
443
453
|
|
|
444
|
-
const categories = ['planning', 'execution', 'community']
|
|
454
|
+
const categories = ['planning', 'execution', 'community', 'bmad']
|
|
445
455
|
|
|
446
456
|
for (const category of categories) {
|
|
447
457
|
const categoryPath = path.join(this.registryPath, category)
|
|
@@ -626,7 +636,7 @@ export default class NEXMarketplace {
|
|
|
626
636
|
* Load manifest from local registry
|
|
627
637
|
*/
|
|
628
638
|
async loadLocalManifest(agentId) {
|
|
629
|
-
const categories = ['planning', 'execution', 'community']
|
|
639
|
+
const categories = ['planning', 'execution', 'community', 'bmad']
|
|
630
640
|
|
|
631
641
|
for (const category of categories) {
|
|
632
642
|
const manifestPath = path.join(this.registryPath, category, agentId, 'manifest.yaml')
|
|
@@ -854,11 +864,15 @@ export default class NEXMarketplace {
|
|
|
854
864
|
* Get agent source path
|
|
855
865
|
*/
|
|
856
866
|
async getAgentSourcePath(agentId, version) {
|
|
857
|
-
const categories = ['planning', 'execution', 'community']
|
|
867
|
+
const categories = ['planning', 'execution', 'community', 'bmad']
|
|
868
|
+
|
|
869
|
+
// Debug: log registry path being searched
|
|
870
|
+
const searchedPaths = []
|
|
858
871
|
|
|
859
872
|
for (const category of categories) {
|
|
860
873
|
// Try versioned path first
|
|
861
874
|
let sourcePath = path.join(this.registryPath, category, agentId, 'versions', version)
|
|
875
|
+
searchedPaths.push(sourcePath)
|
|
862
876
|
|
|
863
877
|
if (await fs.pathExists(sourcePath)) {
|
|
864
878
|
return sourcePath
|
|
@@ -866,13 +880,20 @@ export default class NEXMarketplace {
|
|
|
866
880
|
|
|
867
881
|
// Fallback to non-versioned
|
|
868
882
|
sourcePath = path.join(this.registryPath, category, agentId)
|
|
883
|
+
searchedPaths.push(sourcePath)
|
|
869
884
|
|
|
870
885
|
if (await fs.pathExists(sourcePath)) {
|
|
871
886
|
return sourcePath
|
|
872
887
|
}
|
|
873
888
|
}
|
|
874
889
|
|
|
875
|
-
|
|
890
|
+
// Better error message with debugging info
|
|
891
|
+
const errorMsg = `Agent source not found: ${agentId}@${version}\n` +
|
|
892
|
+
`Registry path: ${this.registryPath}\n` +
|
|
893
|
+
`Searched paths:\n${searchedPaths.map(p => ` - ${p}`).join('\n')}\n` +
|
|
894
|
+
`\n💡 Tip: Make sure the agent exists in the registry. Try: nex agent search ${agentId}`
|
|
895
|
+
|
|
896
|
+
throw new Error(errorMsg)
|
|
876
897
|
}
|
|
877
898
|
|
|
878
899
|
/**
|