feat: Remote Connection Manager — trait-based adapters + auth + UI - #84
Merged
Merged
Conversation
Add the foundation for the generic connection layer: - connections table in init_schema (id, name, product_type, url, auth, status, is_primary) - store.rs: list, get, insert, update, delete, set_primary, get_primary, seed_default - connections/mod.rs: ProductType enum, Capabilities, ConnectionRow/Info/Config, HealthInfo - connections/traits.rs: ProductAdapter + MemoryBackend trait definitions - connections/adapters/uteke.rs: placeholder stub - Auto-seed default local uteke connection on first boot No behavior change — existing features work identically. Closes #77
- UtekeClient: add auth_token field, with_auth() constructor, authed() helper that injects bearer auth on every HTTP request - All 18 UtekeClient methods now route through authed() — zero call-site changes - UtekeAdapter: wraps UtekeClient, implements MemoryBackend trait with type conversions (UtekeMemory→Memory, RecallResult→Memory, etc.) - async-trait dependency added for MemoryBackend trait - reqwest default-tls already supports HTTPS - Existing 24 commands.rs call sites compile unchanged No behavior change — auth only activates when token is configured. Closes #78
Phase 2: Config resolution with full priority chain - resolve_uteke_server(conn): DB primary → UTEKE_SERVER_URL env → TOML → default - Reads UTEKE_AUTH_TOKEN env for auth - is_remote_url() helper to detect non-localhost URLs Phase 3: Skip local auto-start when server is remote - setup() uses resolve_uteke_server() instead of detect + ensure - If URL is remote → no install/spawn of local uteke-serve - If URL is local → existing behavior (auto-start + seed default connection) - Auth token passed to UtekeClient::with_auth() Closes #79 Closes #80
Add 6 generic Tauri commands for connection management: - list_connections: list all connections (token redacted) - add_connection: create new connection with type/url/auth - update_connection: edit existing connection fields - delete_connection: remove connection - test_connection: health check → returns latency + status, updates DB - set_primary_connection: switch active backend All commands registered in invoke_handler. Closes #81
Frontend for managing remote connections: - ipc.ts: connection.* wrappers (list/add/update/delete/test/setPrimary) + ConnectionInfo + HealthInfo types - ConnectionManager.svelte: connection cards with icon, name, URL, status badge, add/edit form, test button w/ latency, set primary, delete w/ confirm, auth badge - SettingsView.svelte: new 'Connections' section with lazy-loaded ConnectionManager Closes #82
- Remove async-trait dep, use RPITIT for trait methods - Remove redundant closures (|e| E(e) → E) in connection commands - Collapse nested if-let in resolve_uteke_server - Fix ref-immediately-deref in setup seed - Add #[allow(clippy::too_many_arguments)] on store::insert - Clone owned ConnectionConfig for health_check RPITIT call - Clone moved values in type conversions
ajianaz
added a commit
that referenced
this pull request
Jul 1, 2026
…ngsModal (#86) PR #84 added ConnectionManager into SettingsView.svelte, but SettingsView is orphan dead code (never imported). App renders SettingsModal, whose tabs were corin/general/data/agents only — so the Connections UI never appeared. - Add 'connections' tab to SettingsModal - Render ConnectionManager via async import under that tab - Delete orphan SettingsView.svelte (no references anywhere)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generic Connection Manager layer for CorIn — enables connecting to a remote uteke-serve (VPS) with HTTPS + auth, built once and extensible per-product via trait-based adapters.
Architecture: Trait-based Adapters (Opsi 2)
What's new
Backend (Phases 0–3):
connectionstable with full CRUD persistenceProductTypeenum +ProductAdapter/MemoryBackendtraitsUtekeAdapterwrapsUtekeClient, converts types, implements traitsUtekeClientauth:with_auth()constructor +authed()helper on every requestUTEKE_SERVER_URLenv → TOML → defaultis_remote_url()— skips local auto-start when URL is remoteFrontend (Phases 4–5):
list_connections,add_connection,update_connection,delete_connection,test_connection,set_primary_connectionipc.ts:connection.*wrappers +ConnectionInfo+HealthInfotypesConnectionManager.svelte: connection cards (icon, URL, status badge), add form, test button w/ latency, set primary, delete confirmAdding a new product (future)
Files changed
connections/mod.rsconnections/traits.rsconnections/store.rsconnections/adapters/uteke.rsuteke_client.rsconfig.rslib.rscommands.rsipc.tsConnectionManager.svelteSettingsView.svelteCloses #77 Closes #78 Closes #79 Closes #80 Closes #81 Closes #82
Related #37 (parent issue)