Skip to main content

Crate kcode_k1_daemon_lib

Crate kcode_k1_daemon_lib 

Source
Expand description

§kcode-k1-daemon-lib

run(PathBuf) -> ExitCode is the sole public API. It builds the multithreaded Tokio runtime, prompts once for Vault unlock, starts the complete private loopback daemon beneath <k1_root>/state, writes readiness, serves port 4450, and returns success only after graceful shutdown. Startup or listener failure returns exit code 1 through the fixed safe error surface.

The process composes one instance of KTO-backed state, Access, Audio, Chat, Launch Nodes, providers, authenticated HTTP adapters, public Web serving, and code services. One retained K1WebHttp supplies both the public router and the exact shared projection used by WebCode. CodeServices opens process-owned RustCode and WebCode services, and Chat selects its full Social + SetLaunchNode + RustCode + WebCode + WebSearch constructor.

Durable state remains under <k1_root>/state; Web/Rust projections and per-user code caches are disposable derived state. Code-service paths, pinned images, revisions, Chromium identity, and resource/time limits are required deployment environment inputs and are never defaulted.

K1_PUBLIC_ORIGIN, authentication, replay protection, CORS, security, shutdown, invite reconciliation, and readiness behavior are unchanged. The package performs no local dependency selection, daemon rebuild/restart, host provisioning, live code-tool calls, browser integration, UI selection, proxy/TLS, or deployment.

Functions§

run