RFC: headless Web/Server mode (--features server) + Connectors (Google Drive, local folder) - #729
Draft
johnsonafool wants to merge 5 commits into
Draft
RFC: headless Web/Server mode (--features server) + Connectors (Google Drive, local folder)#729johnsonafool wants to merge 5 commits into
johnsonafool wants to merge 5 commits into
Conversation
Web / Server Mode - headless `llm-wiki-server` binary (axum :8080) serving the built React frontend; frontend host calls go through src/lib/backend/ (Tauri IPC on desktop, /web/* JSON-RPC + SSE in the browser) - AppCtx replaces tauri::AppHandle so command functions are shared by both builds; web/rpc.rs maps the commands to JSON-RPC - shared-password cookie sessions, /web/file, /web/upload, /web/proxy, Dockerfile + docker-compose; plans/web-server-mode.md Connectors - Connector trait + registry, SyncEngine writing into raw/sources/@<name>/, per-instance state, OAuth PKCE, minute scheduler - local-folder and google-drive kinds; Settings → Connectors UI generated from descriptors; plans/connectors.md Cargo features: `desktop` (default) and `server`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…hat preset for API chat Web mode - The RPC bridge now applies the same project-folder / data-dir allow-list that `/web/file` already enforced to every raw filesystem command (read_file, write_file*, list_directory, copy_*, delete_file, file history, extraction, archive export ...). Before this, any authenticated web user could read or write arbitrary paths on the server through `/web/rpc/read_file` and friends. - Targets that do not exist yet are checked via their nearest existing ancestor; `..` in the unresolved tail is rejected. - Folders opened / created / imported through the bridge in this server session are accepted immediately: the persisted registry is written by the frontend only after `open_project` returns, so the first reads of a freshly opened project (and purely API-driven clients) used to be denied. Local API / MCP chat - `load_agent_runtime_config` now resolves the Chat task preset (`taskModelRouting.chatPresetId` + `providerConfigs`) the way the frontend's `resolveTaskLlmConfig` does, falling back to `llmConfig`. With Ingest on Claude Code CLI and Chat on Azure, API chats previously ignored the routing, hit the unsupported CLI provider and degraded to the retrieval-only answer. Tests: unit tests for the path guard and the preset resolver; server-mode smoke test (login, rpc, file, proxy, SSE, connectors, search, logout) 17/17. Seven pre-existing `commands::fs` / `commands::file_history` unit tests fail on Windows (upstream CI never runs `cargo test` on Windows; e.g. `/tmp/...` is asserted to be absolute) — untouched by this change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What this adds
1. Headless Web / Server mode (
--features server)llm-wiki-serveris a Tauri-free binary (axum) that serves the built React frontend over HTTP and answers everything the frontend used to get from Tauri IPC, so a small team can self-host one instance and use LLM Wiki from a browser.AppCtxreplacestauri::AppHandlein commands; command bodies are untouched, only the attribute (#[cfg_attr(feature = "desktop", tauri::command)]) and the runtime shim (crate::rt::*) change.src/lib/backend/(Tauri on desktop,/web/*in the browser); feature code no longer imports@tauri-apps/*directly. Plugin replacements (store, dialog, http, opener) are listed inplans/web-server-mode.md.HttpOnly; SameSite=Laxsession cookie (orAuthorization: Bearer). No password + loopback bind = open access (same trust model as the desktop); non-loopback bind without a password generates one and prints it./web/file).Dockerfile+docker-compose.yml; flags/env documented inplans/web-server-mode.md.2. Connectors (
Settings → Connectors)Pull documents from external systems into
raw/sources/@<name>/on a schedule; the existing source-folder watcher then ingests them, so nothing downstream knows a connector exists.Connectortrait (test / list_all(cursor) / fetch), a descriptor registry that drives a generic settings form, a sharedSyncEngine(version diff, sanitised paths, atomic writes, deletions, per-instance state), OAuth PKCE helper, minute scheduler.local-folder(reference implementation) andgoogle-drive(bring-your-own OAuth client, delta sync viachanges.list, Docs/Sheets/Slides exported as Office files).plans/connectors.md.3. Included fix (also submitted separately)
API / MCP chat now honours
taskModelRouting.chatPresetId— see the standalone PR "fix(api): honor the Chat task preset for local API / MCP chat".Verified
npm run build(typecheck + vite)vitestcargo checkdesktop and server featurescargo test --features server --libcommands::fs/commands::file_history(e.g./tmp/...asserted absolute) — untouched by this changeNot verified by me: macOS / Linux builds (CI should tell), long soak of ingest through
/web/proxy.Known gaps
/web/proxylets an authenticated user reach any URL from the server (documented; the desktop already allows pointing the app at any endpoint). TLS should sit in front for anything beyond a LAN.plans/web-server-mode.md.Proposed split, if you'd like to take this
AppCtx+rthost abstraction (mechanical, no behaviour change) — makes the rest possible and small to review.serverfeature.Happy to rebase, rename, or drop parts. Thanks for building LLM Wiki — we're using it as the engine for a team knowledge base and wanted to give this back.