sdk/apps/examples/desktop-app/README.md
Tauri desktop shell + Bun sidecar backend + Next.js UI for running and inspecting Cline chat sessions.
From apps/examples/desktop-app/:
bun run dev:web - Next.js UI only (http://localhost:3125)bun run dev:sidecar - sidecar backend onlybun run dev - Tauri desktop devbun run build - build web assetsbun run build:sidecar - build the Bun sidecar bundlebun run build:sidecar:bin - compile the Bun sidecar into a local binarybun run build:binary - build desktop binarybun run typecheck - TypeScript checkStartup flow:
/transport) for commands, queries, and pushed events.lib/desktop-client.ts and no longer imports @tauri-apps/api/core directly in feature code.workspaceRoot from git root and uses that same path as default cwd for chat runtime and git operations unless explicitly overridden.Desktop transport envelope:
{ "type": "command", "id": string, "command": string, "args"?: object }{ "type": "response", "id": string, "ok": boolean, "result"?: unknown, "error"?: string }{ "type": "event", "event": { "name": string, "payload": unknown } }Routine view for hub-backed automations.Routine lists all RPC schedules and shows status (enabled, nextRunAt, active execution).cline schedule through Tauri commands and scripts/routine-schedules.ts.src-tauri/src/main.rs - Tauri shell lifecycle, backend launch, and native-only commandssidecar/index.ts - persistent Bun sidecar backendsidecar/chat-session.ts - in-process chat session runtimewebview/lib/desktop-client.ts - typed desktop websocket clientwebview/hooks/use-chat-session.ts - UI chat session state + backend subscriptionswebview/lib/chat-schema.ts - chat message schema used by the UIwebview/components/views/settings/routine-view.tsx - Routine schedules UI~/.cline/data/sessions/<sessionId>/ (or CLINE_SESSION_DATA_DIR).<sessionId>.messages.json.<sessionId>.messages.json is expected to contain ordered messages plus assistant modelInfo and metrics (including cache token fields when provided by the model runtime).<sessionId>.hooks.jsonl is observability/debug telemetry and should not be required for normal history replay/export flows.packages/core/docs/messages-contract-v1.md.chat_event messages are arriving.finishReason=error before any assistant content is produced, the UI now adds an explicit error chat message so failed turns are visible in the transcript.bun run build:sdk). The next cline rpc ensure call should attach to the current build's sidecar automatically.