fix: make the TypeScript app build and run again - #3
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
E2E test results — runtime verificationTested by building ( ✅ App shell, PTY terminal, XSS-safe chat, graceful AI error
✅ Theme toggle (dark ⇄ light)One click applies the light palette and flips the icon ☀→☾; a second click restores dark exactly. (Editor/terminal panes stay dark because those colours are hardcoded hexes in ✅ Settings persist on Save, discard on Cancel/backdrop/XTyped
|
Summary
The TS rewrite (
e39e712) left the repo unbuildable and unrunnable: there was no rootpackage.json/tsconfig,index.htmlloaded/src/ui/main.tsraw, and every workflow/Dockerfile still built the deleted Rust crates. On top of that, several code paths were broken. This makesnpm install && npm run build && npm startwork end to end.Wouldn't compile / wouldn't run
models.ts:as ModelsDev laCatalog— a syntax error in the middle of the file.instances.tsimportedCreateInstanceRequest/UpdateInstanceRequest, which don't exist insrc/core/types.ts(now added).package.json,tsconfig.json(strict,noUnusedLocals) andvite.config.ts(dev server on :8080 proxying/api+/wsto :3000).AI proxy sent malformed requests
generate()destructuredapiKey/baseUrl/maxTokens, butGenerateRequestdeclaresapi_key/base_url/max_tokens, so every one was alwaysundefined.createAnthropic()("anthropic/claude-x")instead of("claude-x").claude,ollama,openrouter) all threwUnknown provider; they now alias ontoanthropic/openai-compatiblewith default base URLs.Terminal was dead code
PtyService.createInstancenever registered the session it spawned, sohandleTerminalWscould never find one, and the server had no WebSocket endpoint at all. Now: creating aTerminalinstance spawns the PTY,/ws/pty/:idupgrades to it, output is kept in the 64 KB ring buffer the README already advertised (replayed on reconnect), and closing a socket detaches instead of killing the shell. The dashboard's previously inert#terminal-input/#terminal-outputare wired to it, with a visible fallback when no server is reachable.UI
localStorage(state.loadSettings()on boot).app-state-changed, which nothing listened for — the modal never appeared.innerHTML(XSS + broken on<); bubbles are now built withtextContent. Added error handling, send-button locking, Enter-to-send, autoscroll.JSON.parseoftck.instanceswas unguarded, so one corrupt entry broke startup.<select>hardcodedselectedon Claude regardless of state;--acc-solidwas used by ~8 rules but never defined; the theme button had no handler (now toggles a real light palette)..maininside.main.Infra/docs
ci.yml,pages.yml,Dockerfile,.dockerignoreall referencedcrates/tck-ui,cargo, andtrunk; they now install Node 22, typecheck, and build with Vite.codeql.ymlno longer analyzesrust.TCK_ADDR→PORT), module table, and PR checklist updated. The desktop-app/installer sections are Rust-era and are now explicitly marked as not buildable rather than silently wrong.Out of scope:
release.ymlstill builds Rust binaries (tag-triggered only), and the sidebar buttons / editor / scaffold panels remain static mockups.Checklist
npm run typecheckpassesnpm run buildpassesnpm run typecheckintck-aipasses (if that service changed)Notes
Verified locally against
npm start:/healthok, static UI served,POST /api/instances→ws://…/ws/pty/{id}runsecho hello-from-ptyand returns its output,DELETEon an unknown id is 404,/api/ai/generatereturns 400/500 with useful messages,/api/github/authreturns 503 when OAuth isn't configured.Link to Devin session: https://app.devin.ai/sessions/f368764410624fa9bb948f4ceba6c048
Requested by: @Raghuramcoding