Expand description
§kcode-k1-daemon-lib 0.14.3
run(PathBuf) -> ExitCode starts the complete private loopback K1 daemon beneath <k1_root>/state, writes readiness, serves port 4450, and shuts down gracefully.
The process composes KTO-backed state, Access, Audio, Chat, Launch Nodes, providers, authenticated HTTP, public Web serving, and process-owned RustCode/WebCode services. This release preserves Chat Service 0.11.0, HTTP Chat 0.7.3, and Daemon Provider Config 0.2.0, so Chat uses an empty provider instruction string, registers exactly call_ktool and message_user, and receives all startup guidance as ordinary main-chat prefix text assembled by the browser. One retained K1WebHttp supplies both HTTP and WebCode with the same projection. Code-service tool images and disposable caches are prepared automatically without configuration environment variables.
Before invite-stock reconciliation, listener binding, or readiness output, startup opens the canonical Loom bootstrap state, retains the Rust projection from Daemon Code Services, and runs topology-aware first-run Loom bootstrap with the existing Access facade. An incomplete bootstrap requires and validates <k1_root>/bootstrap/k1-rust-code.zip, resumes exact matching state, and must complete before the daemon can become ready.
The topology-aware bootstrap creates or exactly reconciles the first user’s public root, the public loom-devs and kennedy-devs groups and Profiles, and six authority-scoped public Kmap roots. It then imports the Rust closure under loom-devs, records canonical completion, and atomically materializes the five shared launch-node AccessIds at <k1_root>/state/daemon/launch-nodes.json. A completed startup skips the ZIP and credential prompt, verifies the canonical topology and completion record, and regenerates that derived JSON projection if absent, damaged, or stale.
Ordinary startup failures preserve their complete safe child errors. Vault and Gemini-key initialization deliberately remain redacted. Existing authentication, replay, CORS, shutdown, invite, Chat-prefix, message_user, and readiness behavior is otherwise unchanged.
The package performs no dependency selection, host deployment, local rebuild/restart, live code-tool call, browser integration, UI selection, proxy, or TLS work. Source publication does not prove blank-state bootstrap, local process adoption, browser login, cache-only Build, executable launch, UI fallback adoption, or deployment.