auroq-os 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/bin/auroq-os.js +34 -0
  2. package/package.json +1 -1
package/bin/auroq-os.js CHANGED
@@ -59,6 +59,23 @@ async function init() {
59
59
 
60
60
  const targetDir = process.cwd();
61
61
  const sourceDir = path.resolve(__dirname, '..');
62
+ const homeDir = require('os').homedir();
63
+
64
+ // ─── PROTECAO: Nunca instalar na home do usuario
65
+ if (targetDir === homeDir || targetDir === path.resolve(homeDir)) {
66
+ error('');
67
+ error(`${GOLD}ATENCAO: Voce esta na pasta HOME do seu usuario (${targetDir}).${RESET}`);
68
+ error(`${GOLD}O Auroq OS nao pode ser instalado aqui — vai baguncar seu sistema.${RESET}`);
69
+ error('');
70
+ error('Crie uma pasta pro seu projeto e rode o comando de dentro dela:');
71
+ error('');
72
+ error(` ${CYAN}mkdir meu-negocio${RESET}`);
73
+ error(` ${CYAN}cd meu-negocio${RESET}`);
74
+ error(` ${CYAN}npx auroq-os init${RESET}`);
75
+ error('');
76
+ error('Troque "meu-negocio" pelo nome que quiser pro seu projeto.');
77
+ process.exit(1);
78
+ }
62
79
 
63
80
  log(`${DIM}Instalando em: ${targetDir}${RESET}\n`);
64
81
 
@@ -228,8 +245,25 @@ async function init() {
228
245
  'business/cockpit.md',
229
246
  ];
230
247
 
248
+ // Detectar se ja existe companion personalizado (ex: taquion-companion.md)
249
+ // Se existir, NAO copiar companion.md generico pra nao duplicar
250
+ const commandsDir = path.join(targetDir, '.claude', 'commands');
251
+ let hasCustomCompanion = false;
252
+ if (await fs.pathExists(commandsDir)) {
253
+ const cmdFiles = await fs.readdir(commandsDir);
254
+ hasCustomCompanion = cmdFiles.some(f => f.endsWith('-companion.md') && f !== 'companion.md');
255
+ if (hasCustomCompanion) {
256
+ const customName = cmdFiles.find(f => f.endsWith('-companion.md') && f !== 'companion.md');
257
+ log(`${DIM} Companion personalizado detectado: ${customName} — pulando companion.md generico${RESET}`);
258
+ }
259
+ }
260
+
231
261
  let copied = 0;
232
262
  for (const file of frameworkFiles) {
263
+ // Pular companion.md generico se ja tem personalizado
264
+ if (file === '.claude/commands/companion.md' && hasCustomCompanion) {
265
+ continue;
266
+ }
233
267
  const src = path.join(sourceDir, file);
234
268
  const dst = path.join(targetDir, file);
235
269
  if (await fs.pathExists(src)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auroq-os",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Auroq OS — Sistema Operacional de IA para Experts",
5
5
  "bin": {
6
6
  "auroq-os": "bin/auroq-os.js"