wegho-agentes 7.0.2 → 7.0.3
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/.agents/init.mjs +27 -0
- package/.agents/install.ts +12 -0
- package/package.json +1 -1
package/.agents/init.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
import { spawn } from 'child_process';
|
|
6
|
+
import { createRequire } from 'module';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
const entryPath = join(__dirname, 'init.ts');
|
|
13
|
+
|
|
14
|
+
let tsxCliPath;
|
|
15
|
+
try {
|
|
16
|
+
tsxCliPath = require.resolve('tsx/cli');
|
|
17
|
+
} catch {
|
|
18
|
+
console.error('Erro: dependencia "tsx" nao encontrada. Rode "npm install".');
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const child = spawn(process.execPath, [tsxCliPath, entryPath], {
|
|
23
|
+
stdio: 'inherit',
|
|
24
|
+
shell: false
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
child.on('exit', (code) => process.exit(code || 0));
|
package/.agents/install.ts
CHANGED
|
@@ -60,6 +60,18 @@ async function install() {
|
|
|
60
60
|
modified = true;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
if (!packageJson.scripts['agents:init']) {
|
|
64
|
+
packageJson.scripts['agents:init'] = 'node node_modules/wegho-agentes/.agents/init.mjs';
|
|
65
|
+
console.log(' ✅ Script adicionado: npm run agents:init');
|
|
66
|
+
modified = true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (!packageJson.scripts['init']) {
|
|
70
|
+
packageJson.scripts['init'] = 'npm run agents:init';
|
|
71
|
+
console.log(' ✅ Script adicionado: npm run init');
|
|
72
|
+
modified = true;
|
|
73
|
+
}
|
|
74
|
+
|
|
63
75
|
if (!packageJson.scripts['task']) {
|
|
64
76
|
packageJson.scripts['task'] = 'npm run agent --';
|
|
65
77
|
console.log(' ✅ Script adicionado: npm run task');
|
package/package.json
CHANGED