tibiaway-ai 1.0.5 → 1.0.7
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/package.json +1 -1
- package/src/commands/setup-opencode.js +35 -1
- package/src/standalone.js +1 -2
package/package.json
CHANGED
|
@@ -5,6 +5,8 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
import inquirer from 'inquirer';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import { success, error, info, highlight, separator } from '../utils/banner.js';
|
|
8
|
+
import { setupCharacter } from '../utils/character.js';
|
|
9
|
+
import { getCharacter } from '../utils/config.js';
|
|
8
10
|
|
|
9
11
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
12
|
const PROJECT_ROOT = resolve(__dirname, '..', '..');
|
|
@@ -83,15 +85,47 @@ export async function handleSetupOpencode() {
|
|
|
83
85
|
console.log(` ${chalk.hex('#4ade80')('✓')} ${chalk.hex('#888')(f)}`);
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
// ── Vincular personaje (opcional, sin API key) ────────────────────────────
|
|
89
|
+
console.log('');
|
|
90
|
+
separator();
|
|
91
|
+
console.log('');
|
|
92
|
+
|
|
93
|
+
const existingCharacter = getCharacter();
|
|
94
|
+
if (existingCharacter) {
|
|
95
|
+
success(`Personaje ya vinculado: ${highlight(existingCharacter.name)} (${existingCharacter.vocation} lv ${existingCharacter.level})`);
|
|
96
|
+
info('El agente lo detectará automáticamente al abrir OpenCode.');
|
|
97
|
+
} else {
|
|
98
|
+
info('Vincula tu personaje para que el agente lo detecte automáticamente.');
|
|
99
|
+
info('Solo necesita tu nombre — consulta tibiadata.com, sin API key.');
|
|
100
|
+
console.log('');
|
|
101
|
+
|
|
102
|
+
const { linkCharacter } = await inquirer.prompt([
|
|
103
|
+
{
|
|
104
|
+
type: 'confirm',
|
|
105
|
+
name: 'linkCharacter',
|
|
106
|
+
message: highlight('¿Quieres vincular tu personaje de Tibia ahora?'),
|
|
107
|
+
default: true,
|
|
108
|
+
},
|
|
109
|
+
]);
|
|
110
|
+
|
|
111
|
+
if (linkCharacter) {
|
|
112
|
+
console.log('');
|
|
113
|
+
await setupCharacter();
|
|
114
|
+
} else {
|
|
115
|
+
info('Puedes vincularlo después con: npx tibiaway-ai setup');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
86
119
|
console.log('');
|
|
87
120
|
separator();
|
|
88
121
|
console.log('');
|
|
89
122
|
console.log(chalk.hex('#FF6B1A').bold('¡Listo! Así lo usas en OpenCode:\n'));
|
|
90
123
|
|
|
124
|
+
const hasCharacter = !!getCharacter();
|
|
91
125
|
const steps = [
|
|
92
126
|
['1.', 'Abre OpenCode en cualquier directorio'],
|
|
93
127
|
['2.', 'Selecciona el agente TibiaWayAI en la lista de agentes'],
|
|
94
|
-
['3.', 'Escribe tu personaje si te lo pide (nombre, vocación, level)'],
|
|
128
|
+
['3.', hasCharacter ? 'El agente detecta tu personaje automáticamente ✓' : 'Escribe tu personaje si te lo pide (nombre, vocación, level)'],
|
|
95
129
|
['4.', 'Usa los comandos:'],
|
|
96
130
|
];
|
|
97
131
|
for (const [n, s] of steps) {
|
package/src/standalone.js
CHANGED
|
@@ -65,8 +65,7 @@ function printHelp() {
|
|
|
65
65
|
['diary summary', 'Resumen de progreso con IA'],
|
|
66
66
|
['analyze <archivo>', 'Analiza screenshot o notas (.png, .jpg, .txt)'],
|
|
67
67
|
['sync', 'Actualiza tu perfil desde tibiadata.com'],
|
|
68
|
-
['setup', '
|
|
69
|
-
['setup-opencode', 'Instala el agente en OpenCode (sin npm install)'],
|
|
68
|
+
['setup', 'Reconfigurar proveedor de IA o personaje'],
|
|
70
69
|
];
|
|
71
70
|
|
|
72
71
|
for (const [cmd, desc] of cmds) {
|