chatflux-gestao-agente 0.2.4 → 0.2.5
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 +2 -2
- package/lib/computador-portal.mjs +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ faz na tela, e tudo no histórico com o seu nome.
|
|
|
11
11
|
## Atualizar pelo portal
|
|
12
12
|
|
|
13
13
|
No aviso “Atualize o ChatFlux neste computador”, clique **Atualizar**. Com o
|
|
14
|
-
computador conectado e o programa 0.2.
|
|
14
|
+
computador conectado e o programa 0.2.5 ou mais recente, o portal acompanha a
|
|
15
15
|
configuração completa, sem terminal. Se precisar renovar o login, o navegador
|
|
16
16
|
abre. Ao aparecer **Pronto ✓**, reinicie o VS Code; o aviso some sozinho.
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ o dispensa nesta sessão.
|
|
|
24
24
|
## Instalar (equipe — um comando, sem clonar nada)
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
npx -y chatflux-gestao-agente@latest configurar
|
|
27
|
+
npx -y --prefer-online chatflux-gestao-agente@latest configurar
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
No Terminal do Mac ou PowerShell do Windows, esse comando instala a cópia
|
|
@@ -53,6 +53,8 @@ async function officialClient(url, options) {
|
|
|
53
53
|
return new ConvexClient(url, options);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
const MAX_TIMER_MS = 2_147_483_647;
|
|
57
|
+
|
|
56
58
|
export function createComputerPortal({ identity, readToken, clientFactory = officialClient, clock = {}, onReconnect = () => {} }) {
|
|
57
59
|
if (process.env.GESTAO_SERVICO) throw new Error('Modo serviço não pode operar um computador pessoal.');
|
|
58
60
|
scopeDirectory(identity);
|
|
@@ -109,7 +111,12 @@ export function createComputerPortal({ identity, readToken, clientFactory = offi
|
|
|
109
111
|
if (value.token === rejectedToken) throw error('RECONNECT_REQUIRED');
|
|
110
112
|
lastToken = value.token;
|
|
111
113
|
cancel(expiryTimer);
|
|
112
|
-
|
|
114
|
+
// setTimeout estoura acima de ~24,8 dias e dispara na hora (token de 1 ano): reagenda em passos.
|
|
115
|
+
const armExpiry = () => {
|
|
116
|
+
const delay = Math.max(0, value.expiresAt - now() - 60000);
|
|
117
|
+
expiryTimer = later(() => (delay > MAX_TIMER_MS ? armExpiry() : pause()), Math.min(delay, MAX_TIMER_MS));
|
|
118
|
+
};
|
|
119
|
+
armExpiry();
|
|
113
120
|
return value.token;
|
|
114
121
|
}
|
|
115
122
|
function scheduleAuth() {
|
package/package.json
CHANGED