tibiaway-ai 1.0.4 → 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/commands/sync.md +31 -0
- package/package.json +1 -1
- package/src/commands/setup-opencode.js +35 -1
- package/src/standalone.js +1 -2
package/commands/sync.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sync character profile from tibiadata.com — refresh the agent's context with updated level, vocation, and guild data
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Refresh the character profile. Follow these steps:
|
|
6
|
+
|
|
7
|
+
1. **Try to read `~/.tibiaway/config.json`** using available file tools.
|
|
8
|
+
|
|
9
|
+
2. **If the file exists:**
|
|
10
|
+
- Extract `character.name`, `character.vocation`, `character.level`, `character.world`, `character.guild`, `last_sync`
|
|
11
|
+
- Update your context with the new data for the rest of this conversation
|
|
12
|
+
- Respond confirming the updated profile, for example:
|
|
13
|
+
> "✓ Perfil actualizado: **[nombre]** | Level **[X]** | [vocación] | [world]
|
|
14
|
+
> Última sincronización: [fecha]"
|
|
15
|
+
|
|
16
|
+
3. **If the file does not exist or is unreadable:**
|
|
17
|
+
- Tell the user to run this in their terminal:
|
|
18
|
+
```
|
|
19
|
+
tibiaway sync
|
|
20
|
+
```
|
|
21
|
+
- Or if they don't have the CLI installed:
|
|
22
|
+
```
|
|
23
|
+
npx tibiaway-ai setup
|
|
24
|
+
```
|
|
25
|
+
- Then ask them to paste their updated character data directly and update the context manually.
|
|
26
|
+
|
|
27
|
+
4. **If the user pastes data manually** (name, level, vocation, world):
|
|
28
|
+
- Accept any format ("soy ed 250 antica", "Nombre: X, Level: Y", etc.)
|
|
29
|
+
- Update context and confirm.
|
|
30
|
+
|
|
31
|
+
Respond in Spanish.
|
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) {
|