nex-framework-cli 1.0.16 → 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
|
}
|
|
@@ -856,9 +866,13 @@ export default class NEXMarketplace {
|
|
|
856
866
|
async getAgentSourcePath(agentId, version) {
|
|
857
867
|
const categories = ['planning', 'execution', 'community', 'bmad']
|
|
858
868
|
|
|
869
|
+
// Debug: log registry path being searched
|
|
870
|
+
const searchedPaths = []
|
|
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
|
/**
|