@dotrino/terminal-agent 0.40.0 → 0.41.0
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/README.md +1 -0
- package/bin/terminal.js +20 -6
- package/consoles.js +14 -1
- package/index.js +1 -0
- package/package.json +1 -1
- package/skills/dotrino-terminal-note/SKILL.md +18 -9
package/README.md
CHANGED
|
@@ -109,6 +109,7 @@ dotrino-terminal note "texto" # la reemplaza («-» la lee de la entrada
|
|
|
109
109
|
dotrino-terminal note --add "línea" # le añade una línea
|
|
110
110
|
dotrino-terminal note --clear # la borra
|
|
111
111
|
dotrino-terminal note --task "tarea" # la TAREA en curso, que va aparte de la nota
|
|
112
|
+
dotrino-terminal note --title "título" # el TÍTULO de la consola, en vez del de la shell (solo o con --task)
|
|
112
113
|
```
|
|
113
114
|
|
|
114
115
|
Son dos campos: la **nota** es de la persona (la edita desde la tarjeta) y la **tarea** es del
|
package/bin/terminal.js
CHANGED
|
@@ -71,6 +71,8 @@ if (args.includes('-h') || args.includes('--help')) {
|
|
|
71
71
|
dotrino-terminal note --clear la borra
|
|
72
72
|
dotrino-terminal note --task <texto> pone la TAREA en curso, que va aparte de la nota: es
|
|
73
73
|
lo que usa un programa; --task '' la quita
|
|
74
|
+
dotrino-terminal note --title <texto> pone el TÍTULO de la consola en vez del de la shell
|
|
75
|
+
(solo o junto a --task); --title '' devuelve el de la shell
|
|
74
76
|
(--id <id> para otra consola; --json para leerla una máquina)
|
|
75
77
|
dotrino-terminal profiles [--json] los perfiles de esta máquina
|
|
76
78
|
dotrino-terminal link [--name <n>] enlaza un perfil con tu bóveda
|
|
@@ -107,6 +109,8 @@ Cerrar la ventana no cierra la consola: sigue abierta y se retoma después.`, `u
|
|
|
107
109
|
dotrino-terminal note --clear clear it
|
|
108
110
|
dotrino-terminal note --task <text> set the TASK in progress, kept apart from the note: what
|
|
109
111
|
a program uses; --task '' removes it
|
|
112
|
+
dotrino-terminal note --title <text> set the console's TITLE instead of the shell's (alone
|
|
113
|
+
or with --task); --title '' gives the shell's back
|
|
110
114
|
(--id <id> for another console; --json for a machine to read)
|
|
111
115
|
dotrino-terminal profiles [--json] this machine's profiles
|
|
112
116
|
dotrino-terminal link [--name <n>] link a profile with your vault
|
|
@@ -596,7 +600,7 @@ async function note () {
|
|
|
596
600
|
if (!id) die(t('no sé de qué consola: esta shell no corre dentro de Dotrino Terminal. Usa --id <id> (mira «dotrino-terminal ls»).', 'no console to act on: this shell is not running inside Dotrino Terminal. Use --id <id> (see "dotrino-terminal ls").'))
|
|
597
601
|
// Dentro de una consola, el perfil es el de esa consola, no el `default`.
|
|
598
602
|
const dir = opt('--dir') || (opt('--name') ? dataDir(opt('--name')) : process.env.DOTRINO_TERMINAL_PROFILE_DIR || dataDir())
|
|
599
|
-
const valued = new Set(['--id', '--dir', '--name', '--add', '--task'])
|
|
603
|
+
const valued = new Set(['--id', '--dir', '--name', '--add', '--task', '--title'])
|
|
600
604
|
const words = []
|
|
601
605
|
for (let i = 1; i < args.length; i++) {
|
|
602
606
|
if (valued.has(args[i])) { i++; continue }
|
|
@@ -606,6 +610,7 @@ async function note () {
|
|
|
606
610
|
const given = words.length ? (words.length === 1 && words[0] === '-' ? stdin() : words.join(' ')) : null
|
|
607
611
|
const add = opt('--add') === '-' ? stdin() : opt('--add')
|
|
608
612
|
const task = opt('--task') === '-' ? stdin() : opt('--task')
|
|
613
|
+
const title = opt('--title')
|
|
609
614
|
let conn
|
|
610
615
|
try { conn = await connectLocal(dir) } catch (e) {
|
|
611
616
|
if (e.code !== 'ENOAGENT') throw e
|
|
@@ -622,10 +627,16 @@ async function note () {
|
|
|
622
627
|
if (task !== undefined) {
|
|
623
628
|
// LA TAREA ES DEL PROGRAMA, LA NOTA ES DE LA PERSONA: dos campos. Esta orden solo escribe el
|
|
624
629
|
// primero, así un agente de IA no puede pisar una nota personal ni por descuido.
|
|
625
|
-
c = await ask({ type: 'note', id, task: task.split('\n').map((l) => l.trim()).filter(Boolean).join('\n') })
|
|
630
|
+
c = await ask({ type: 'note', id, task: task.split('\n').map((l) => l.trim()).filter(Boolean).join('\n'), ...(title === undefined ? {} : { title }) })
|
|
626
631
|
// Un agente anterior a la 0.37 contesta, pero no guarda tareas: se dice, no se da por hecha.
|
|
627
632
|
if (c.task === undefined) die(t('el agente que corre es anterior a la 0.37.0 y no guarda tareas. Reinícialo con la versión nueva (cierra sus consolas).', 'the running agent predates 0.37.0 and keeps no tasks. Restart it with the new version (closes its consoles).'))
|
|
628
|
-
|
|
633
|
+
// Y uno anterior a la 0.41 no guarda el título: lo mismo.
|
|
634
|
+
if (title !== undefined && c.subject === undefined) die(t('el agente que corre es anterior a la 0.41.0 y no guarda el título. Reinícialo con la versión nueva (cierra sus consolas).', 'the running agent predates 0.41.0 and keeps no title. Restart it with the new version (closes its consoles).'))
|
|
635
|
+
} else if (title !== undefined) {
|
|
636
|
+
c = await ask({ type: 'note', id, title })
|
|
637
|
+
if (c.subject === undefined) die(t('el agente que corre es anterior a la 0.41.0 y no guarda el título. Reinícialo con la versión nueva (cierra sus consolas).', 'the running agent predates 0.41.0 and keeps no title. Restart it with the new version (closes its consoles).'))
|
|
638
|
+
}
|
|
639
|
+
else if (args.includes('--clear')) c = await ask({ type: 'note', id, text: '' })
|
|
629
640
|
else if (add !== undefined) {
|
|
630
641
|
const before = (await ask({ type: 'note', id })).note || ''
|
|
631
642
|
c = await ask({ type: 'note', id, text: before ? `${before}\n${add}` : add })
|
|
@@ -654,17 +665,20 @@ function interactive (conn, first, dir) {
|
|
|
654
665
|
const out = process.stdout
|
|
655
666
|
let consoleId = null
|
|
656
667
|
let shellTitle = ''
|
|
668
|
+
let subject = ''
|
|
657
669
|
let remote = new Set()
|
|
658
670
|
let ending = false
|
|
659
671
|
|
|
660
672
|
const showTitle = () => {
|
|
661
|
-
const base = shellTitle || 'Dotrino Terminal'
|
|
673
|
+
const base = subject || shellTitle || 'Dotrino Terminal'
|
|
662
674
|
const mark = remote.size ? ` ● ${t('abierta desde otro aparato', 'open on another device')}${remote.size > 1 ? ` ×${remote.size}` : ''}` : ''
|
|
663
675
|
out.write(`\x1b]2;${base}${mark}\x07`)
|
|
664
676
|
}
|
|
665
677
|
const onInfo = (info) => {
|
|
666
678
|
if (!info) return
|
|
667
|
-
|
|
679
|
+
// El título que puso el programa (`note --title`) manda sobre el de la shell.
|
|
680
|
+
subject = info.subject || ''
|
|
681
|
+
shellTitle = info.shellTitle ?? info.title ?? ''
|
|
668
682
|
// En otra máquina (`--machine`) esta ventana es, para aquella, «otro aparato»: no se cuenta
|
|
669
683
|
// a sí misma (se reconoce por su etiqueta; sin etiqueta, es una de las que salen).
|
|
670
684
|
let far = info.watchers.filter((w) => w.origin === 'remote')
|
|
@@ -729,7 +743,7 @@ function interactive (conn, first, dir) {
|
|
|
729
743
|
const other = rest.find((c) => !c.watchers.length) || rest.find((c) => !c.watchers.some((w) => w.origin === 'local')) || rest[0]
|
|
730
744
|
if (other) return switchTo({ type: 'attach', id: other.id })
|
|
731
745
|
empty = true
|
|
732
|
-
shellTitle = ''; remote = new Set(); showTitle()
|
|
746
|
+
shellTitle = ''; subject = ''; remote = new Set(); showTitle()
|
|
733
747
|
out.write(`\x1bc\x1b[2m${t('No hay consolas abiertas. Ctrl+] y luego n abre una.', 'No open consoles. Ctrl+] then n opens one.')}\x1b[0m\r\n`)
|
|
734
748
|
})
|
|
735
749
|
return
|
package/consoles.js
CHANGED
|
@@ -87,6 +87,10 @@ class Console {
|
|
|
87
87
|
// (`dotrino-terminal note --task`). Son dos campos para que un agente de IA no pueda pisar lo
|
|
88
88
|
// que escribió la persona, ni la persona tenga que editar lo del agente: solo lo quita.
|
|
89
89
|
this.task = ''
|
|
90
|
+
// EL TÍTULO QUE PONE EL PROGRAMA (`dotrino-terminal note --title`). El de la shell (OSC 0/2) lo
|
|
91
|
+
// fija un agente de IA al empezar su sesión y no lo cambia aunque la tarea sea ya otra: este
|
|
92
|
+
// lo sustituye en todas las pantallas mientras exista. Se va con la tarea.
|
|
93
|
+
this.subject = ''
|
|
90
94
|
this.cols = cols
|
|
91
95
|
this.rows = rows
|
|
92
96
|
this.createdAt = Date.now()
|
|
@@ -161,6 +165,15 @@ class Console {
|
|
|
161
165
|
const task = String(text ?? '').slice(0, NOTE_MAX)
|
|
162
166
|
if (task === this.task) return
|
|
163
167
|
this.task = task
|
|
168
|
+
if (!task) this.subject = ''
|
|
169
|
+
this._meta()
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Cambia el título que pone el programa. Vacío, vuelve a mandar el de la shell. */
|
|
173
|
+
setSubject (text) {
|
|
174
|
+
const subject = String(text ?? '').replace(/\s+/g, ' ').trim().slice(0, 200)
|
|
175
|
+
if (subject === this.subject) return
|
|
176
|
+
this.subject = subject
|
|
164
177
|
this._meta()
|
|
165
178
|
}
|
|
166
179
|
|
|
@@ -275,7 +288,7 @@ class Console {
|
|
|
275
288
|
const watchers = [...this.viewers].filter((v) => v.origin).map((v) => ({ origin: v.origin, device: v.device || null, tag: v.tag || null }))
|
|
276
289
|
const d = this.holder
|
|
277
290
|
const sizeBy = d ? { origin: d.origin || null, device: d.device || null, tag: d.tag || null } : null
|
|
278
|
-
return { id: this.id, n: this.n, activity: this.busy ? 'busy' : 'idle', doneAt: this.doneAt, sizeBy, origin: this.origin, title: this.title, note: this.note, task: this.task, host: HOST, cwd: cwdOf(this.pty?.pid), cols: this.cols, rows: this.rows, createdAt: this.createdAt, lastActive: this.lastActive, viewers: this.viewers.size, watchers }
|
|
291
|
+
return { id: this.id, n: this.n, activity: this.busy ? 'busy' : 'idle', doneAt: this.doneAt, sizeBy, origin: this.origin, title: this.subject || this.title, shellTitle: this.title, subject: this.subject, note: this.note, task: this.task, host: HOST, cwd: cwdOf(this.pty?.pid), cols: this.cols, rows: this.rows, createdAt: this.createdAt, lastActive: this.lastActive, viewers: this.viewers.size, watchers }
|
|
279
292
|
}
|
|
280
293
|
}
|
|
281
294
|
|
package/index.js
CHANGED
|
@@ -214,6 +214,7 @@ export function serveSession (session, hub, { origin = 'remote', gate = null } =
|
|
|
214
214
|
if (!c) return fail('no-console', 'that console no longer exists')
|
|
215
215
|
if (typeof msg.text === 'string') c.setNote(msg.text)
|
|
216
216
|
if (typeof msg.task === 'string') c.setTask(msg.task)
|
|
217
|
+
if (typeof msg.title === 'string') c.setSubject(msg.title)
|
|
217
218
|
session.send({ type: 'noted', console: c.info() })
|
|
218
219
|
return
|
|
219
220
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/terminal-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Dotrino Terminal: las ventanas de esta máquina (dotrino-terminal) y su agente, que deja abrir esas mismas consolas desde los otros aparatos de tu cuenta, cifrado punto a punto.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dotrino-terminal-note
|
|
3
|
-
description: Mantiene al día la tarea en curso en la tarjeta «de qué va» de la consola de Dotrino Terminal en la que corres (la ve el dueño flotando sobre la consola, en todas sus pantallas). Úsalo AL EMPEZAR cada tarea, cuando la tarea cambia de rumbo, y al terminar o quedar esperando al usuario, siempre que exista la variable de entorno DOTRINO_TERMINAL_CONSOLE. También cuando el usuario diga «nota de la consola», «el flotante», «la tarjeta» o «de qué va este chat». Orden: `dotrino-terminal note --task
|
|
3
|
+
description: Mantiene al día la tarea en curso en la tarjeta «de qué va» de la consola de Dotrino Terminal en la que corres (la ve el dueño flotando sobre la consola, en todas sus pantallas). Úsalo AL EMPEZAR cada tarea, cuando la tarea cambia de rumbo, y al terminar o quedar esperando al usuario, siempre que exista la variable de entorno DOTRINO_TERMINAL_CONSOLE. También cuando el usuario diga «nota de la consola», «el flotante», «la tarjeta» o «de qué va este chat». Orden: `dotrino-terminal note --task … --title …` (la tarea y el título de la consola). Las notas personales del dueño NO se tocan.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# La tarea en curso de la consola (Dotrino Terminal)
|
|
@@ -12,12 +12,14 @@ abiertas, sepa **de qué va la tarea en curso de cada una** sin entrar a leerla.
|
|
|
12
12
|
La tarjeta tiene dos partes, y son dos campos distintos:
|
|
13
13
|
|
|
14
14
|
- **La tarea**: es TUYA. La pones con `--task`. El dueño la ve y puede quitarla, no la edita.
|
|
15
|
+
- **El título**: también es TUYO, con `--title`. Es el nombre de la consola en la tarjeta, en la
|
|
16
|
+
lista y en la barra de la ventana.
|
|
15
17
|
- **Las notas**: son **personales del dueño**. Las escribe él desde la tarjeta. No son tuyas.
|
|
16
18
|
|
|
17
19
|
## Regla dura: las notas personales no se tocan
|
|
18
20
|
|
|
19
|
-
**Usa SOLO `dotrino-terminal note --task
|
|
20
|
-
del dueño.
|
|
21
|
+
**Usa SOLO `dotrino-terminal note --task … --title …`.** Esa orden escribe la tarea y el título, y
|
|
22
|
+
no puede tocar las notas del dueño.
|
|
21
23
|
|
|
22
24
|
**Prohibido**, salvo que el usuario te lo pida con esas palabras en ese momento:
|
|
23
25
|
|
|
@@ -52,15 +54,15 @@ anunciarlo ni comentarlo en la respuesta.
|
|
|
52
54
|
## Cómo
|
|
53
55
|
|
|
54
56
|
```bash
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
# la tarea por la entrada estándar; el título, en la misma orden y SIEMPRE después de --task
|
|
58
|
+
dotrino-terminal note --task - --title 'Login de facturero' <<'EOF_TASK'
|
|
57
59
|
Hecho: el formulario
|
|
58
60
|
Ahora: la validación
|
|
59
61
|
Falta: probar con firma real
|
|
60
62
|
Modelo: Opus 5.5
|
|
61
63
|
EOF_TASK
|
|
62
64
|
|
|
63
|
-
dotrino-terminal note --task '' # quita tu tarea (lo del dueño se queda)
|
|
65
|
+
dotrino-terminal note --task '' # quita tu tarea y tu título (lo del dueño se queda)
|
|
64
66
|
dotrino-terminal note # solo LEER: tu tarea (con «▸ ») y debajo sus notas
|
|
65
67
|
```
|
|
66
68
|
|
|
@@ -68,9 +70,13 @@ No hace falta decir qué consola: es la tuya.
|
|
|
68
70
|
|
|
69
71
|
## Qué escribir
|
|
70
72
|
|
|
71
|
-
- **
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
- **El título (`--title`) = de qué va la tarea, en pocas palabras** (hasta ~40 caracteres): «Login
|
|
74
|
+
de facturero», «Tarjeta de notas en Terminal». No «Trabajando en lo que pidió el usuario». Sin
|
|
75
|
+
él la consola se llama como tu sesión, que se nombró con el primer mensaje y ya no tiene que ver
|
|
76
|
+
con lo que haces: **el dueño lee ese nombre para saber qué consola es cuál**.
|
|
77
|
+
Mándalo en cada actualización. Mientras la tarea sea la misma, **el mismo título** (no lo
|
|
78
|
+
reescribas con otras palabras: lo reconoce por él). Cuando llega otro encargo, cámbialo.
|
|
79
|
+
- La tarea (`--task`) es el estado, en tres o cuatro líneas: `Hecho:` (lo ya cerrado), `Ahora:` (lo que haces en
|
|
74
80
|
este momento), `Falta:` y, si aplica, `Espera:` (a qué). Reescríbela entera cada vez: es el
|
|
75
81
|
estado actual, no un historial.
|
|
76
82
|
- **La última línea dice qué modelo eres**: `Modelo: Opus 5.5` (el nombre con el que te presentas,
|
|
@@ -83,6 +89,9 @@ No hace falta decir qué consola: es la tuya.
|
|
|
83
89
|
## Si falla
|
|
84
90
|
|
|
85
91
|
- «no sé de qué consola» / `no console to act on`: no corres dentro de Dotrino Terminal. Sigue sin nota.
|
|
92
|
+
- «el agente que corre es anterior a la 0.41.0 y no guarda el título»: la tarea sí quedó puesta.
|
|
93
|
+
Díselo al usuario una vez y sigue mandando solo `--task`, con la tarea en una frase como primera
|
|
94
|
+
línea.
|
|
86
95
|
- «el agente que corre es anterior a la 0.37.0 y no guarda tareas», o «el agente no contestó»:
|
|
87
96
|
el agente de esta máquina es viejo. **No uses las otras formas como sustituto**: díselo al
|
|
88
97
|
usuario una vez (`npm i -g @dotrino/terminal-agent@latest` y reiniciarlo él) y sigue sin tarea.
|