@dotrino/terminal-agent 0.2.5 → 0.2.6
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/index.js +5 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -28,7 +28,8 @@ import { loadLink, dataDir } from './link.js'
|
|
|
28
28
|
const require = createRequire(import.meta.url)
|
|
29
29
|
|
|
30
30
|
const T = {
|
|
31
|
-
HS: 'terminal.hs', ACK: 'terminal.hs.ack', CMD: 'terminal.cmd', OUT: 'terminal.out', ERROR: 'terminal.error'
|
|
31
|
+
HS: 'terminal.hs', ACK: 'terminal.hs.ack', CMD: 'terminal.cmd', OUT: 'terminal.out', ERROR: 'terminal.error',
|
|
32
|
+
PING: 'terminal.ping', PONG: 'terminal.pong'
|
|
32
33
|
}
|
|
33
34
|
const VMSG = { DEVICES: 'vault.devices', DEVICES_RESULT: 'vault.devices.result' }
|
|
34
35
|
const SIGN_SCOPE = 'vault:sign'
|
|
@@ -170,6 +171,9 @@ export async function startAgent (opts = {}) {
|
|
|
170
171
|
if (!payload || typeof payload !== 'object') return
|
|
171
172
|
if (payload.type === T.HS) handleHandshake(from, payload).catch((e) => send(from, { type: T.ERROR, error: e.message }))
|
|
172
173
|
else if (payload.type === T.CMD) handleCmd(from, payload).catch((e) => send(from, { type: T.ERROR, error: e.message }))
|
|
174
|
+
// Sonda de presencia (liveness): el cliente hace ping y respondemos pong con el
|
|
175
|
+
// mismo nonce → así la app sabe que esta máquina está online (sin abrir sesión).
|
|
176
|
+
else if (payload.type === T.PING) send(from, { type: T.PONG, n: payload.n })
|
|
173
177
|
})
|
|
174
178
|
|
|
175
179
|
if (!opts.quiet) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/terminal-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Agente de Dotrino Terminal: abre una shell (PTY) en la máquina del vault solo para el dispositivo enlazado, vía @dotrino/tunnel y cifrado E2E.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|