@dotrino/remote-agent 0.6.1 → 0.6.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.
- package/package.json +2 -2
- package/src/agent.js +9 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/remote-agent",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Middleware compartido del ecosistema Dotrino para apps de agente remoto cifrado punto a punto (handshake E2E, emparejamiento SAS con vault, revocación, descubrimiento). Lo consumen dotrino-terminal (PTY) y dotrino-ia (chat con IA).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"p2p"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@dotrino/identity": ">=0.73.
|
|
48
|
+
"@dotrino/identity": ">=0.73.1",
|
|
49
49
|
"@dotrino/proxy-client": ">=0.10.1",
|
|
50
50
|
"@dotrino/vault": ">=0.30.0"
|
|
51
51
|
},
|
package/src/agent.js
CHANGED
|
@@ -178,9 +178,16 @@ export async function startRemoteAgent (opts = {}) {
|
|
|
178
178
|
* que una segunda bóveda pueda emitir; lo que se fija es el perfil.
|
|
179
179
|
*/
|
|
180
180
|
async function renewCertIfNeeded () {
|
|
181
|
-
//
|
|
181
|
+
// DOS MOTIVOS PARA PEDIR PAPEL NUEVO:
|
|
182
|
+
// · el nuestro es del MODELO VIEJO (lleva `exp` y no `seq`). Ese hay que cambiarlo sí
|
|
183
|
+
// o sí: se acepta por el repliegue de migración, pero muere en su fecha y con él la
|
|
184
|
+
// máquina. Sin esta rama la migración no terminaba nunca — el disparador comparaba
|
|
185
|
+
// `seq` y un papel viejo no tiene, así que nunca saltaba.
|
|
186
|
+
// · o el acta que hemos visto va por delante del papel: el dueño cambió permisos.
|
|
187
|
+
const legado = typeof link.cert?.seq !== 'number'
|
|
182
188
|
const visto = link.actaSeq
|
|
183
|
-
|
|
189
|
+
const atrasado = typeof visto === 'number' && typeof link.cert?.seq === 'number' && visto > link.cert.seq
|
|
190
|
+
if (!legado && !atrasado) return
|
|
184
191
|
try {
|
|
185
192
|
const res = await vaultRpc(VMSG.RENEW, VMSG.RENEWED, { op: 'renew', publickey: myPub, ts: Date.now() })
|
|
186
193
|
const cert = res?.cert
|