feat(cli): attach terminal clients to the selected Desktop [skip ci]

NAN-104 requires terminal chat and browser attachment without granting a client ownership of Desktop's gateway. Resolve bounded short-lived credentials over authenticated current-user IPC, pin both Desktop and gateway identities, and reject replacement instances or incompatible clients before any mutation.

Reuse the existing TUI artifact resolver behind a narrow Desktop-only entrypoint, keep credentials out of argv/environment/files, and preserve Python-mode reconnect and gateway leases. Add protocol, real-gateway, and anonymous IPC regression coverage; matching native-host and Windows acceptance remain release gates.
This commit is contained in:
Xubin Ren committed 2026-09-08 10:04:15 +08:00
1 parent b373a95f5c
commit 48e7c4f697
20 files changed
+797 -52

No files matched your search

+2
View File
@@ -4,6 +4,7 @@ from __future__ import annotations
import secrets
import time
import uuid
from dataclasses import dataclass, field
from typing import Any, Literal
@@ -19,6 +20,7 @@ class GatewayTokenStore:
"""Own short-lived WebSocket and WebUI API tokens for one gateway process."""
max_tokens: int = 10_000
instance_id: str = field(default_factory=lambda: str(uuid.uuid4()), init=False)
issued_tokens: dict[str, float] = field(default_factory=dict)
issued_token_audiences: dict[str, IssuedTokenAudience] = field(default_factory=dict)
api_tokens: dict[str, float] = field(default_factory=dict)