A · Interactive Architecture Topology Full System
Click presets on the left or nodes below to inspect components across CLI runtime, macOS Keychain, and Google OAuth endpoints.
B · Account Slot Inventory 3 Profiles Loaded
Interactive preview of registered profile slots. Run agyswap viz --open locally on macOS to view your real accounts.
| Slot | Account / Alias | Status | Token Expiry | Auth Method |
|---|
C · Profile Switching Sequence ~0.1s Fast Path
Detailed execution flow triggered during an account switch operation.
Concurrency Lock & Target Resolution
Acquires fcntl.flock on .agyswap.lock and resolves target slot by number, email, or alias.
Expired Token Guard
Compares token.expiry with system UTC clock. If expired without --force, switch is safely blocked with a renewal guide.
Native C API Keychain Injection
Directly modifies macOS Keychain using SecKeychainItemModifyAttributesAndData via ctypes without touching process argv.
Atomic Config Update & Session Notice
Atomically saves config.json and scans for running agy processes via lsof to emit session restart guidance.
D · Command Reference
-r: resume last session (agy -c). -n: launch fresh session. -y: pass --dangerously-skip-permissions to agy for fully automated no-prompt workflows.--all rotates every slot simultaneously — no browser interaction required.E · Security Architecture & Threat Model
| Security Layer | Implementation Mechanism | Threat Mitigated |
|---|---|---|
| Keychain Binding | macOS Security.framework Native C API via ctypes | Process argument sniffing (ps aux / CWE-214) |
| Storage Isolation | Files 0600, Dirs 0700 (opener=secure_opener) | Cross-user access & Umask race conditions |
| Concurrency Lock | fcntl.flock on .agyswap.lock | Lost updates during concurrent terminal runs |
| Template Escaping | safe_json_for_script Unicode character sanitization | Stored XSS inside HTML <script> blocks |