somora 2026.930.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +364 -0
  3. package/bin/node-version.d.mts +3 -0
  4. package/bin/node-version.mjs +45 -0
  5. package/bin/somora.mjs +77 -0
  6. package/config.example.yaml +896 -0
  7. package/docs/agents.md +677 -0
  8. package/docs/api.md +3194 -0
  9. package/docs/browser.md +317 -0
  10. package/docs/builder.md +331 -0
  11. package/docs/cache-strategy.md +373 -0
  12. package/docs/compaction.md +253 -0
  13. package/docs/display.md +154 -0
  14. package/docs/dream-phases.md +891 -0
  15. package/docs/files.md +387 -0
  16. package/docs/imagegen.md +366 -0
  17. package/docs/images/somora-hero.png +0 -0
  18. package/docs/images/somora-mobile-2026-05-23.png +0 -0
  19. package/docs/images/somora-tui-2026-05-23.png +0 -0
  20. package/docs/images/somora-web-2026-05-23.png +0 -0
  21. package/docs/index.md +178 -0
  22. package/docs/lsp.md +93 -0
  23. package/docs/mcp.md +332 -0
  24. package/docs/memory.md +407 -0
  25. package/docs/mobile.md +310 -0
  26. package/docs/models.md +379 -0
  27. package/docs/projects.md +425 -0
  28. package/docs/realtime-voice.md +293 -0
  29. package/docs/resources.md +230 -0
  30. package/docs/sampling.md +128 -0
  31. package/docs/security.md +189 -0
  32. package/docs/sentinel.md +295 -0
  33. package/docs/setup.md +1217 -0
  34. package/docs/skills.md +501 -0
  35. package/docs/team.md +189 -0
  36. package/docs/thinking.md +463 -0
  37. package/docs/tmux.md +399 -0
  38. package/docs/tools.md +117 -0
  39. package/docs/videogen.md +191 -0
  40. package/docs/voice.md +288 -0
  41. package/docs/web.md +893 -0
  42. package/docs/wiki.md +583 -0
  43. package/npm-shrinkwrap.json +5670 -0
  44. package/package.json +116 -0
  45. package/src/attachments/store.ts +196 -0
  46. package/src/browser/change-stream.ts +31 -0
  47. package/src/browser/display.ts +108 -0
  48. package/src/browser/policy.ts +121 -0
  49. package/src/browser/screencast.ts +374 -0
  50. package/src/browser/service.ts +1337 -0
  51. package/src/browser/session.ts +15 -0
  52. package/src/browser/snapshot.ts +40 -0
  53. package/src/cli/auth.ts +117 -0
  54. package/src/cli/codex.ts +41 -0
  55. package/src/cli/lsp.ts +71 -0
  56. package/src/cli/resolvers/clawhub.ts +400 -0
  57. package/src/cli/setup.ts +835 -0
  58. package/src/cli/skill.ts +619 -0
  59. package/src/cli/somora.ts +548 -0
  60. package/src/cli/systemd-unit.ts +72 -0
  61. package/src/cli/team.ts +148 -0
  62. package/src/cli/tui/activity-stream.ts +121 -0
  63. package/src/cli/tui/api.ts +479 -0
  64. package/src/cli/tui/app.tsx +1169 -0
  65. package/src/cli/tui/autocomplete.tsx +55 -0
  66. package/src/cli/tui/commands.ts +913 -0
  67. package/src/cli/tui/dream-glyphs.ts +22 -0
  68. package/src/cli/tui/footer.tsx +15 -0
  69. package/src/cli/tui/format.ts +28 -0
  70. package/src/cli/tui/header.tsx +279 -0
  71. package/src/cli/tui/index.tsx +120 -0
  72. package/src/cli/tui/markdown.tsx +63 -0
  73. package/src/cli/tui/sampling.ts +162 -0
  74. package/src/cli/tui/separator.tsx +13 -0
  75. package/src/cli/tui/state.ts +42 -0
  76. package/src/cli/tui/stream.ts +330 -0
  77. package/src/cli/tui/thinking-text.ts +54 -0
  78. package/src/cli/tui/turn-views.tsx +499 -0
  79. package/src/cli/tui/types.ts +410 -0
  80. package/src/cli/tui/work-queue.ts +161 -0
  81. package/src/cli/update-args.ts +55 -0
  82. package/src/cli/wiki.ts +406 -0
  83. package/src/compaction/index.ts +28 -0
  84. package/src/compaction/midturn.ts +210 -0
  85. package/src/compaction/policy.ts +154 -0
  86. package/src/compaction/summarize.ts +691 -0
  87. package/src/compaction/template.ts +90 -0
  88. package/src/compaction/types.ts +148 -0
  89. package/src/config/loader.ts +276 -0
  90. package/src/config/reload.ts +43 -0
  91. package/src/config/types.ts +2292 -0
  92. package/src/dream/deep-actions.ts +324 -0
  93. package/src/dream/deep-dispatcher.ts +237 -0
  94. package/src/dream/deep-llm.ts +388 -0
  95. package/src/dream/deep-prompts.ts +106 -0
  96. package/src/dream/deep-runner.ts +757 -0
  97. package/src/dream/deep-skip-cache.ts +199 -0
  98. package/src/dream/deep-worker.ts +229 -0
  99. package/src/dream/json-salvage.ts +34 -0
  100. package/src/dream/judge.ts +188 -0
  101. package/src/dream/loop-state.ts +286 -0
  102. package/src/dream/lucid-actions.ts +303 -0
  103. package/src/dream/lucid-batches.ts +94 -0
  104. package/src/dream/lucid-prompt.ts +82 -0
  105. package/src/dream/lucid-runner.ts +744 -0
  106. package/src/dream/lucid-storage.ts +277 -0
  107. package/src/dream/lucid-structure.ts +102 -0
  108. package/src/dream/lucid-types.ts +137 -0
  109. package/src/dream/lucid-worker.ts +224 -0
  110. package/src/dream/rem-dedup.ts +502 -0
  111. package/src/dream/rem-extract.ts +782 -0
  112. package/src/dream/rem-reset-run.ts +67 -0
  113. package/src/dream/rem-runner.ts +696 -0
  114. package/src/dream/rem-worker.ts +527 -0
  115. package/src/dream/review-window.ts +71 -0
  116. package/src/dream/scheduler-state.ts +129 -0
  117. package/src/dream/storage.ts +497 -0
  118. package/src/dream/types.ts +133 -0
  119. package/src/dream/wiki-context.ts +133 -0
  120. package/src/engine/a2a.ts +33 -0
  121. package/src/engine/availability.ts +63 -0
  122. package/src/engine/claude-cli.ts +969 -0
  123. package/src/engine/codex-app-server-client.ts +294 -0
  124. package/src/engine/codex-bin.ts +49 -0
  125. package/src/engine/codex-cli.ts +1014 -0
  126. package/src/engine/codex-dynamic-tools.ts +239 -0
  127. package/src/engine/codex-home.ts +63 -0
  128. package/src/engine/codex-thread-config.ts +74 -0
  129. package/src/engine/context-budget.ts +257 -0
  130. package/src/engine/engine-meta-labels.ts +211 -0
  131. package/src/engine/grok-cli.ts +941 -0
  132. package/src/engine/inline-think.ts +59 -0
  133. package/src/engine/model-availability.ts +105 -0
  134. package/src/engine/openai-compatible.ts +2464 -0
  135. package/src/engine/reasoning-retry.ts +83 -0
  136. package/src/engine/registry.ts +13 -0
  137. package/src/engine/replay.ts +195 -0
  138. package/src/engine/sampling.ts +90 -0
  139. package/src/engine/thinking-params.ts +264 -0
  140. package/src/engine/types.ts +269 -0
  141. package/src/engine/user-tag.ts +24 -0
  142. package/src/imagegen/aspect.ts +128 -0
  143. package/src/imagegen/generate.ts +642 -0
  144. package/src/imagegen/references.ts +75 -0
  145. package/src/imagegen/types.ts +154 -0
  146. package/src/lsp/client.ts +183 -0
  147. package/src/lsp/fake-server.helper.mjs +42 -0
  148. package/src/lsp/format.ts +29 -0
  149. package/src/lsp/index.ts +21 -0
  150. package/src/lsp/manager.ts +238 -0
  151. package/src/lsp/registry.ts +151 -0
  152. package/src/mcp/config.ts +117 -0
  153. package/src/mcp/hub/audit.ts +55 -0
  154. package/src/mcp/hub/bridge.ts +115 -0
  155. package/src/mcp/hub/catalog.ts +69 -0
  156. package/src/mcp/hub/credentials.ts +406 -0
  157. package/src/mcp/hub/env-expand.ts +14 -0
  158. package/src/mcp/hub/manager.ts +770 -0
  159. package/src/mcp/hub/normalize.ts +213 -0
  160. package/src/mcp/server.ts +368 -0
  161. package/src/mcp/tool-schema.ts +20 -0
  162. package/src/media/capabilities.ts +392 -0
  163. package/src/media/records.ts +175 -0
  164. package/src/media/store.ts +217 -0
  165. package/src/media/types.ts +69 -0
  166. package/src/memory/chunking.ts +168 -0
  167. package/src/memory/embeddings.ts +262 -0
  168. package/src/memory/index.ts +15 -0
  169. package/src/memory/inject.ts +197 -0
  170. package/src/memory/manager.ts +996 -0
  171. package/src/memory/registry.ts +176 -0
  172. package/src/memory/rescan.ts +101 -0
  173. package/src/memory/retrieval.ts +586 -0
  174. package/src/memory/shared-index.ts +372 -0
  175. package/src/memory/slug.ts +39 -0
  176. package/src/memory/storage.ts +385 -0
  177. package/src/memory/watcher.ts +134 -0
  178. package/src/multimodal/blocks.ts +101 -0
  179. package/src/multimodal/dimensions.ts +214 -0
  180. package/src/multimodal/load.ts +86 -0
  181. package/src/multimodal/mime.ts +135 -0
  182. package/src/multimodal/pdf-render.ts +80 -0
  183. package/src/multimodal/user-content.ts +266 -0
  184. package/src/persona/files.ts +144 -0
  185. package/src/persona/loader.ts +598 -0
  186. package/src/persona/skill-gating-store.ts +59 -0
  187. package/src/persona/tool-gating-store.ts +113 -0
  188. package/src/projects/focus.ts +186 -0
  189. package/src/projects/prompt-block.ts +106 -0
  190. package/src/projects/scheme.ts +107 -0
  191. package/src/projects/store.ts +144 -0
  192. package/src/projects/types.ts +73 -0
  193. package/src/sentinel/dispatcher.ts +97 -0
  194. package/src/sentinel/schedule.ts +271 -0
  195. package/src/sentinel/scheduler.ts +840 -0
  196. package/src/sentinel/store.ts +259 -0
  197. package/src/sentinel/types.ts +221 -0
  198. package/src/server/activity-stream.ts +160 -0
  199. package/src/server/ask-calls.ts +137 -0
  200. package/src/server/ask-wait-graph.ts +171 -0
  201. package/src/server/async-tasks.ts +199 -0
  202. package/src/server/builder-busy.ts +86 -0
  203. package/src/server/builder-prompt.ts +204 -0
  204. package/src/server/builder-questions.ts +117 -0
  205. package/src/server/builder-session.ts +249 -0
  206. package/src/server/chat-aborts.ts +83 -0
  207. package/src/server/claude-config-dir.ts +71 -0
  208. package/src/server/claude-credential-sync.ts +454 -0
  209. package/src/server/env-file.ts +100 -0
  210. package/src/server/env.ts +115 -0
  211. package/src/server/heal-session.ts +151 -0
  212. package/src/server/history-page.ts +46 -0
  213. package/src/server/index.ts +7244 -0
  214. package/src/server/lockfile.ts +89 -0
  215. package/src/server/logger.ts +67 -0
  216. package/src/server/logs.ts +187 -0
  217. package/src/server/loopback-fetch.ts +130 -0
  218. package/src/server/openai-client.ts +89 -0
  219. package/src/server/prompt-assembly.ts +334 -0
  220. package/src/server/restart-reconcile.ts +139 -0
  221. package/src/server/run-turn-fallback.ts +275 -0
  222. package/src/server/run-turn-types.ts +91 -0
  223. package/src/server/run-turn.ts +1474 -0
  224. package/src/server/sanitize-assistant-text.ts +112 -0
  225. package/src/server/session-export.ts +220 -0
  226. package/src/server/session-queue.ts +376 -0
  227. package/src/server/session-workdir.ts +49 -0
  228. package/src/server/sse-h2-safe.ts +61 -0
  229. package/src/server/sse-liveness.ts +162 -0
  230. package/src/server/sse-serializer.ts +161 -0
  231. package/src/server/start-turn.ts +249 -0
  232. package/src/server/steer-inbox.ts +107 -0
  233. package/src/server/tls-keeper.ts +153 -0
  234. package/src/server/tool-format.ts +167 -0
  235. package/src/server/turn-framing.ts +52 -0
  236. package/src/server/turn-origin-kind.ts +74 -0
  237. package/src/server/turn-origin.ts +40 -0
  238. package/src/server/work-ledger.ts +975 -0
  239. package/src/server/workspace.ts +114 -0
  240. package/src/setup/config-edit.ts +201 -0
  241. package/src/setup/presets.ts +71 -0
  242. package/src/setup/prompt.ts +163 -0
  243. package/src/setup/tailscale.ts +44 -0
  244. package/src/skills/bin-checks.ts +227 -0
  245. package/src/skills/bootstrap.ts +347 -0
  246. package/src/skills/env-scope.ts +175 -0
  247. package/src/skills/gating.ts +71 -0
  248. package/src/skills/lint.ts +202 -0
  249. package/src/skills/load.ts +368 -0
  250. package/src/skills/path-helpers.ts +102 -0
  251. package/src/skills/registry.ts +178 -0
  252. package/src/ssh/exec.ts +142 -0
  253. package/src/ssh/index.ts +12 -0
  254. package/src/ssh/known-hosts.ts +109 -0
  255. package/src/ssh/pool.ts +307 -0
  256. package/src/storage/sessions.ts +602 -0
  257. package/src/team/render.ts +149 -0
  258. package/src/team/resolve.ts +122 -0
  259. package/src/team/store.ts +124 -0
  260. package/src/team/types.ts +111 -0
  261. package/src/team/write.ts +95 -0
  262. package/src/testing/isolated-home.mts +46 -0
  263. package/src/tmux/attention-watcher.ts +272 -0
  264. package/src/tmux/attention.ts +336 -0
  265. package/src/tmux/list.ts +91 -0
  266. package/src/tmux/origin-store.ts +102 -0
  267. package/src/tmux/tui-markers.ts +267 -0
  268. package/src/tools/agents/ask-cancel.ts +94 -0
  269. package/src/tools/agents/ask-result.ts +235 -0
  270. package/src/tools/agents/ask.ts +704 -0
  271. package/src/tools/agents/builder-dispatch.ts +217 -0
  272. package/src/tools/agents/images.ts +104 -0
  273. package/src/tools/agents/index.ts +42 -0
  274. package/src/tools/agents/long-task-timeouts.ts +39 -0
  275. package/src/tools/agents/session-list.ts +136 -0
  276. package/src/tools/agents/session-model.ts +106 -0
  277. package/src/tools/agents/spawn.ts +845 -0
  278. package/src/tools/agents/status.ts +589 -0
  279. package/src/tools/browser/index.ts +6 -0
  280. package/src/tools/browser/ops.ts +145 -0
  281. package/src/tools/browser/tools.ts +184 -0
  282. package/src/tools/builder/short-descriptions.ts +80 -0
  283. package/src/tools/builder/tools.ts +222 -0
  284. package/src/tools/docs/index.ts +1 -0
  285. package/src/tools/docs/tools.ts +228 -0
  286. package/src/tools/dream/index.ts +11 -0
  287. package/src/tools/dream/tools.ts +1002 -0
  288. package/src/tools/exec/allowlist.ts +233 -0
  289. package/src/tools/exec/background-detach.helper.mts +27 -0
  290. package/src/tools/exec/blacklist.ts +336 -0
  291. package/src/tools/exec/concurrency.ts +150 -0
  292. package/src/tools/exec/fit-output.ts +82 -0
  293. package/src/tools/exec/index.ts +7 -0
  294. package/src/tools/exec/internal-env.ts +89 -0
  295. package/src/tools/exec/job-store.ts +403 -0
  296. package/src/tools/exec/local.ts +649 -0
  297. package/src/tools/exec/remote.ts +399 -0
  298. package/src/tools/exec/tools.ts +934 -0
  299. package/src/tools/file/analyze.ts +378 -0
  300. package/src/tools/file/index.ts +2 -0
  301. package/src/tools/file/local.ts +707 -0
  302. package/src/tools/file/lsp-hook.ts +72 -0
  303. package/src/tools/file/persona-guard.ts +61 -0
  304. package/src/tools/file/policy.ts +292 -0
  305. package/src/tools/file/read-format.ts +129 -0
  306. package/src/tools/file/remote.ts +680 -0
  307. package/src/tools/file/replace.ts +507 -0
  308. package/src/tools/file/search-window.ts +224 -0
  309. package/src/tools/file/tools.ts +658 -0
  310. package/src/tools/file/write-scope.ts +182 -0
  311. package/src/tools/gating.ts +106 -0
  312. package/src/tools/image/budget.ts +82 -0
  313. package/src/tools/image/index.ts +7 -0
  314. package/src/tools/image/tools.ts +601 -0
  315. package/src/tools/index.ts +99 -0
  316. package/src/tools/memory/index.ts +12 -0
  317. package/src/tools/memory/tools.ts +399 -0
  318. package/src/tools/projects/index.ts +1 -0
  319. package/src/tools/projects/tools.ts +643 -0
  320. package/src/tools/registry.ts +427 -0
  321. package/src/tools/resources/index.ts +8 -0
  322. package/src/tools/resources/tools.ts +176 -0
  323. package/src/tools/resources/visibility.ts +60 -0
  324. package/src/tools/sentinel/index.ts +1 -0
  325. package/src/tools/sentinel/tools.ts +592 -0
  326. package/src/tools/skill/index.ts +4 -0
  327. package/src/tools/skill/tools.ts +285 -0
  328. package/src/tools/time/index.ts +5 -0
  329. package/src/tools/time/tools.ts +123 -0
  330. package/src/tools/tmux/index.ts +1 -0
  331. package/src/tools/tmux/local.ts +277 -0
  332. package/src/tools/tmux/remote.ts +168 -0
  333. package/src/tools/tmux/tools.ts +1064 -0
  334. package/src/tools/tool-output.ts +97 -0
  335. package/src/tools/types.ts +227 -0
  336. package/src/tools/video/index.ts +1 -0
  337. package/src/tools/video/tools.ts +425 -0
  338. package/src/tools/web/fetch.ts +337 -0
  339. package/src/tools/web/index.ts +4 -0
  340. package/src/tools/web/tools.ts +186 -0
  341. package/src/tools/wiki/index.ts +1 -0
  342. package/src/tools/wiki/tools.ts +445 -0
  343. package/src/tts/cache-gc.ts +128 -0
  344. package/src/tts/prepare-for-tts.ts +114 -0
  345. package/src/tts/service.ts +332 -0
  346. package/src/types/events.ts +695 -0
  347. package/src/types/turn-origin.ts +53 -0
  348. package/src/version.ts +21 -0
  349. package/src/videogen/dialects.ts +222 -0
  350. package/src/videogen/generate.ts +484 -0
  351. package/src/videogen/jobs.ts +178 -0
  352. package/src/videogen/runner.ts +125 -0
  353. package/src/videogen/wake.ts +119 -0
  354. package/src/voice/realtime/call.ts +948 -0
  355. package/src/voice/realtime/consult.ts +293 -0
  356. package/src/voice/realtime/fake-provider.ts +134 -0
  357. package/src/voice/realtime/manager.ts +384 -0
  358. package/src/voice/realtime/openai-provider.ts +471 -0
  359. package/src/voice/realtime/persona.ts +227 -0
  360. package/src/voice/realtime/session-match.ts +116 -0
  361. package/src/voice/realtime/types.ts +182 -0
  362. package/src/wiki/conflict.ts +113 -0
  363. package/src/wiki/explorer.ts +578 -0
  364. package/src/wiki/index-builder.ts +172 -0
  365. package/src/wiki/language.ts +134 -0
  366. package/src/wiki/log-builder.ts +150 -0
  367. package/src/wiki/map.ts +258 -0
  368. package/src/wiki/migration/analyze.ts +304 -0
  369. package/src/wiki/migration/execute.ts +689 -0
  370. package/src/wiki/migration/refine.ts +402 -0
  371. package/src/wiki/migration/store.ts +100 -0
  372. package/src/wiki/move-page.ts +57 -0
  373. package/src/wiki/structure-file.ts +192 -0
  374. package/src/wiki/taxonomy.ts +140 -0
  375. package/src/wiki/templates.ts +163 -0
  376. package/src/wiki/types.ts +133 -0
  377. package/templates/skills/README.md +24 -0
  378. package/templates/skills/_templates/api-wrapper/SKILL.md +26 -0
  379. package/templates/skills/_templates/cli-wrapper/BOOTSTRAP.md +32 -0
  380. package/templates/skills/_templates/cli-wrapper/SKILL.md +24 -0
  381. package/templates/skills/_templates/default/SKILL.md +25 -0
  382. package/templates/skills/builder-handover/SKILL.md +96 -0
  383. package/templates/skills/builder-handover/assets/ORDER.md +12 -0
  384. package/templates/skills/skill-author/SKILL.md +110 -0
  385. package/tsconfig.json +22 -0
  386. package/web/dist/assets/index-BaVv6pB2.js +631 -0
  387. package/web/dist/assets/index-BaVv6pB2.js.map +1 -0
  388. package/web/dist/assets/index-V3FV3Z25.css +32 -0
  389. package/web/dist/favicon.svg +8 -0
  390. package/web/dist/index.html +20 -0
  391. package/web/package.json +36 -0
  392. package/web/tsconfig.json +25 -0
  393. package/web-mobile/dist/apple-touch-icon.png +0 -0
  394. package/web-mobile/dist/assets/index-BqKt7IMx.css +1 -0
  395. package/web-mobile/dist/assets/index-X_vRr6cd.js +88 -0
  396. package/web-mobile/dist/assets/index-X_vRr6cd.js.map +1 -0
  397. package/web-mobile/dist/favicon.svg +8 -0
  398. package/web-mobile/dist/icon-192.png +0 -0
  399. package/web-mobile/dist/icon-512.png +0 -0
  400. package/web-mobile/dist/index.html +27 -0
  401. package/web-mobile/dist/manifest.webmanifest +32 -0
  402. package/web-mobile/dist/service-worker.js +90 -0
  403. package/web-mobile/package.json +28 -0
  404. package/web-mobile/tsconfig.json +25 -0
package/docs/web.md ADDED
@@ -0,0 +1,893 @@
1
+ # Web client
2
+
3
+ A browser-based desktop for somora — multi-window chat with every
4
+ agent on your LAN. Same backend as the TUI, just a different head.
5
+
6
+ ## Mental model
7
+
8
+ ```
9
+ ┌─────────────────────────────── browser ─────────────────────────┐
10
+ │ ┌─ agent dock ─┐ ┌── chat: scribe ───┐ ┌── chat: coach ────┐ │
11
+ │ │ scribe ● │ │ history + stream │ │ history + stream │ │
12
+ │ │ coach ● │ │ tool blocks │ │ tool blocks │ │
13
+ │ │ archi. ◯ │ │ [paperclip] ▢▷▶ │ │ [paperclip] ▢▷▶ │ │
14
+ │ └──────────────┘ └───────────────────┘ └───────────────────┘ │
15
+ │ │
16
+ │ taskbar: [scribe] [coach] ▢ auto-arrange 💾 save layout │
17
+ └─────────────────────────────────────────────────────────────────┘
18
+ │ HTTP + SSE
19
+ ▼
20
+ somora server :18737
21
+ ```
22
+
23
+ Each chat window is a `ChatProvider`-managed React subtree subscribing
24
+ to one SSE stream keyed by `agent::session`. Multiple windows for the
25
+ same agent share state — open an agent's `main` session twice and both
26
+ windows render the same live transcript.
27
+
28
+ ## Access
29
+
30
+ The somora server mounts the production bundle at `/web/*`. **HTTPS is
31
+ a hard requirement once you open more than one chat window** — see
32
+ "Why HTTPS is required" below. The blessed path is Tailscale, which
33
+ hands out free Let's Encrypt certs for your tailnet's hostnames.
34
+
35
+ ```
36
+ https://<your-host>.<your-tailnet>.ts.net:18737/web/
37
+ ```
38
+
39
+ For full Tailscale + cert setup steps see [setup.md](setup.md#https-tailscale--required-for-the-web-client-at-scale).
40
+ Short version:
41
+
42
+ ```bash
43
+ # in the Tailscale admin: enable MagicDNS + HTTPS Certificates (one-time)
44
+ mkdir -p ~/.somora/certs && cd ~/.somora/certs
45
+ tailscale cert <your-host>.<your-tailnet>.ts.net # use your own FQDN
46
+ ```
47
+
48
+ Add to `~/.somora/config.yaml`:
49
+
50
+ ```yaml
51
+ server:
52
+ port: 18737
53
+ tls:
54
+ cert: ~/.somora/certs/<your-host>.<your-tailnet>.ts.net.crt
55
+ key: ~/.somora/certs/<your-host>.<your-tailnet>.ts.net.key
56
+ publicHost: <your-host>.<your-tailnet>.ts.net
57
+ ```
58
+
59
+ Then `systemctl --user restart somora` (or however you launch it).
60
+
61
+ By default the server binds `127.0.0.1`. To reach it across the
62
+ tailnet/LAN, set `SOMORA_HOST=0.0.0.0`:
63
+
64
+ ```bash
65
+ # ~/.config/systemd/user/somora.env
66
+ SOMORA_HOST=0.0.0.0
67
+ ```
68
+
69
+ **There is no auth** — same trust model as the API server. Tailnet-only
70
+ by design (everyone with a Tailscale node on your tailnet can reach it,
71
+ no public exposure).
72
+
73
+ For development:
74
+
75
+ ```bash
76
+ cd web
77
+ npm install
78
+ npm run dev
79
+ # vite reads ~/.somora/certs automatically and serves
80
+ # https://<host>.<tailnet>.ts.net:5173/web/ (HTTP/2)
81
+ # proxies /agents /attachments /browser /chat /dream /files /health
82
+ # /models /terminal /tmux /tools /tui-config /version to the https
83
+ # somora server
84
+ ```
85
+
86
+ If `~/.somora/certs/<host>.{crt,key}` aren't present (`SOMORA_TLS_HOST`
87
+ overrides the host name), Vite falls back to plain HTTP/1.1 — works for
88
+ one-window debugging, hits the 6-connection wall fast otherwise.
89
+
90
+ ## Why HTTPS is required
91
+
92
+ Browsers cap **HTTP/1.1** at 6 concurrent connections per origin. Each
93
+ chat window holds one persistent SSE stream — so 6 windows max before
94
+ new tabs silently fail to send and agents look unresponsive. Tmux
95
+ session attaches and any xterm.js/WebSocket panels eat connections
96
+ from the same pool.
97
+
98
+ HTTP/2-over-TLS multiplexes every stream over **one** TCP connection.
99
+ The 6-limit becomes effectively unlimited, end of problem.
100
+
101
+ Plus the secure-context features the client relies on — `getUserMedia`
102
+ (mic), `getDisplayMedia` (screenshare), Clipboard async, Service Workers
103
+ (offline + push notifications), Web Push: all require HTTPS. You can
104
+ serve a chat app over plain HTTP, but you can't have voice or push
105
+ without it.
106
+
107
+ ## Window manager
108
+
109
+ - **Desktop icons**: one tile per agent from `/agents` plus the app
110
+ tiles, laid out on a grid that spans the whole desktop. Fresh
111
+ install = the classic left column; from there **drag any icon to
112
+ any cell** (dropping on an occupied cell swaps the two), or move the
113
+ focused icon with `Alt+Arrow`. The arrangement is stored per browser
114
+ in `localStorage` (`somora-desktop-icons`); a narrower window
115
+ relocates icons that no longer fit, widening restores them. Icons sit
116
+ *below* windows like on a real desktop. Click an agent tile to open
117
+ its chat window; clicking again focuses the existing window.
118
+ **Right-click** an agent tile for its menu: *Open main*, the three
119
+ most recently active other sessions (click one to open it in its
120
+ own window), *New session…* (type a name — letters, digits, `-`,
121
+ `_`; the field tells you what's wrong while you type — Enter creates
122
+ it and opens a new window, Esc cancels), *All sessions…* (the
123
+ Sessions tool) and *Configure…* (the Agent window, see "Features"
124
+ below). Agent-wide actions live here; per-chat settings stay in the
125
+ chat's `•••` menu.
126
+ Each agent tile carries up to three live signals:
127
+ - **Status dot** (bottom-right of the icon): green = idle,
128
+ amber = streaming, violet = holds the dream review loop, grey =
129
+ offline.
130
+ - **Pulse glow** around the icon when a dream phase is running for
131
+ this agent: green = REM (per-agent session→memory extraction),
132
+ indigo = Deep (server-wide consolidation, every participating
133
+ agent pulses), violet = Lucid (review-loop holder). Polled every
134
+ 30 s from `GET /dream-states`. See
135
+ [dream-phases.md](dream-phases.md) for what each phase does.
136
+ - **REM badge** (top-right of the icon) when the agent has REM
137
+ extractions waiting for review: a small green counter (`1`, `2`,
138
+ `9+`). The badge clears as you work through findings via
139
+ `dream_apply` / `dream_dismiss`.
140
+ - **App tiles**: non-agent surfaces — `tmux`
141
+ (attach to an existing tmux session), `terminal` (fresh shell in
142
+ the somora workspace), `sessions` (cross-agent session browser
143
+ — see next section), `sentinel` (the proactive triggers: list,
144
+ detail with history, test / pause / resume / delete — see
145
+ [sentinel.md](sentinel.md)), `abilities` (per-agent visibility matrix
146
+ for tools and skills plus external MCP server health — see
147
+ [mcp.md](mcp.md) and [skills.md](skills.md)), `team` (the org
148
+ chart editor for `team.yaml` — see [team.md](team.md)), and `log`
149
+ (the server's own log, see below). Opt-in tiles appear with their
150
+ feature: `voice` (a call with an agent, see [voice.md](voice.md)),
151
+ `browser` (see below), `media` (the image-generation form and
152
+ gallery, see [imagegen.md](imagegen.md)) and `wiki`. The `wiki`
153
+ tile carries a violet **Lucid badge** when completed lucid runs are
154
+ waiting for review — lucid is platform-wide wiki cleanup, so its
155
+ review backlog lives here rather than on any single agent. The
156
+ badge counts pending findings; the tooltip names the oldest waiting
157
+ run. Review with any agent via `dream_review`.
158
+ - **Window**: drag the title bar to move, drag the bottom-right
159
+ corner to resize. Close button removes the window without
160
+ unsubscribing other clients.
161
+ - **Windows never leave the desktop.** Dragging and resizing stop at
162
+ the edges (a window may hang off the right edge while you drag it,
163
+ but its title bar and body never go under the taskbar). When the
164
+ *browser* gets smaller — you move it from an external display to
165
+ the laptop screen, or a saved layout comes back on a smaller
166
+ screen — every window that no longer fits is pushed back inside
167
+ and, only if it is bigger than the desktop itself, shrunk to fit.
168
+ Nothing is rearranged and nothing grows back when the browser gets
169
+ bigger again: use **Save/Restore layout** in the taskbar for that.
170
+
171
+
172
+ One chat window per conversation: opening a session that is already
173
+ on the desktop — from the dock, the sessions tool, a link in another
174
+ chat, or `/session` typed into a window — brings that window forward
175
+ instead of adding a second one. The rule sees through the two spellings
176
+ of a session (its slug and its dated id), so `/session main` and the
177
+ sessions list never end up on separate windows of the same stream.
178
+
179
+ ## Taskbar gear: reload config, restart
180
+
181
+ The gear left of **Arrange** opens a small server menu:
182
+
183
+ - **Reload config** re-reads `~/.somora/config.yaml`, validates it and
184
+ swaps it in without a restart. A typo leaves the running config
185
+ untouched; the toast shows the schema error with field and message.
186
+ On success the toast lists the changed sections and, when one of
187
+ them only applies at boot (server, memory, mcp, voice, wiki
188
+ schedulers, …), says so. The menu marks *changed on disk* when the
189
+ file is newer than what the server loaded.
190
+ - **Restart somora** asks systemd to restart the user unit. Every open
191
+ stream drops for a few seconds; the page polls `/health` and reloads
192
+ itself once the new process answers. Greyed out when somora is not
193
+ running as `somora.service`.
194
+
195
+ `agent.yaml` needs neither: it is read on every turn. The TUI has the
196
+ same two actions as `/reload` and `/restart YES`.
197
+ - **Taskbar (bottom)**: lists open windows and always stays on top —
198
+ no window can cover it, so **Arrange** (tile all windows across the
199
+ desktop) is always reachable. Save/restore persists positions in
200
+ `localStorage`.
201
+ - **Arrange** tiles every non-minimized window over the full desktop.
202
+ Counts that don't fill a grid get a full-height *master* on the left
203
+ with the rest stacked beside it (3 → one left, two right; likewise 5
204
+ and 7) instead of a grid with a hole in it; 1, 2, 4, 6 … tile as an
205
+ even grid. Windows keep their left-to-right,
206
+ top-to-bottom order, so the leftmost window becomes the master and
207
+ arranging twice changes nothing. Icons are not worked around — they
208
+ sit below windows, so Arrange uses the width right up to the left
209
+ edge and a covered icon is back when you close or minimize the
210
+ window. Chat windows whose agent no longer exists (a renamed or
211
+ deleted agent in a restored layout) are dropped once the server has
212
+ answered, rather than sitting there invisible and taking up a tile.
213
+
214
+ Layout state is per-browser-profile. There's no server-side window
215
+ manager — each device remembers its own arrangement.
216
+
217
+ ## Sessions tool
218
+
219
+ A cross-agent session browser launched from the `sessions` tile in
220
+ the app dock. The single window where you keep order across the
221
+ hundreds of sessions somora accumulates over weeks.
222
+
223
+ ```
224
+ ┌───────────────────────────── Sessions ──────────────────────────────┐
225
+ │ 172 total · 1 live · 28 archived · 94 dreamed · 50 partial [⟳] │
226
+ │ [Active] [Archived] [All] │
227
+ │ search: ____ agent: nova luna engine: codex-cli REM: partial │
228
+ │ ─────────────────────────────────────────────────────────────────── │
229
+ │ ☐ Agent Slug Engine Status Last act. Msgs Size │
230
+ │ ☐ nova main ★ codex-cli ●★ 5 min ago 46 280k │
231
+ │ ☐ luna debug-auth-x claude-cli 3h ago 12 22k │
232
+ │ ☑ nova sub-self-477… openai-c. yesterday 2 35k │
233
+ │ ... │
234
+ │ [2 selected] [Archive selected] [Clear] │
235
+ └─────────────────────────────────────────────────────────────────────┘
236
+ ```
237
+
238
+ **What it shows per row:**
239
+
240
+ | Column | Meaning |
241
+ |---|---|
242
+ | Agent | Persona name, coloured with the agent's `color` from `AGENTS.md` frontmatter |
243
+ | Slug | Session slug — `★` marks the magic `main` session |
244
+ | Engine | `claude-cli` / `codex-cli` / `openai-compatible` (last engine that touched it) |
245
+ | Status | `●` (green) = at least one SSE subscriber is live on this session right now · `📦` = archived · `★` = main |
246
+ | Last activity | Human-readable relative time (`5 min ago`, `yesterday`, `3w ago`) |
247
+ | Msgs | `user_message` + `assistant_message` count |
248
+ | Size | Bytes on disk for the JSONL |
249
+ | REM | `🧠 ✓` (green) = REM dreamed up to the latest event · `🧠 ⚠N` (orange) = REM ran once but `N` new events have arrived since · `🧠 ○` (grey) = never dreamed |
250
+
251
+ **About the REM column.** REM is the per-agent background phase that turns
252
+ finished session content into memory candidates (see
253
+ [dream-phases.md](dream-phases.md)). The column tells you, per session, how
254
+ much of its history REM has already processed:
255
+
256
+ - **`🧠 ✓` (dreamed).** REM has worked through every event in this session.
257
+ Nothing waiting.
258
+ - **`🧠 ⚠N` (partial).** REM ran at some point — but you've chatted further
259
+ since. The number is how many user/assistant events have piled up beyond
260
+ REM's last read-through marker. They'll be picked up on the next idle-
261
+ triggered REM run for this agent.
262
+ - **`🧠 ○` (never).** No REM run has touched this session yet. Common for
263
+ brand-new sessions, sub-agent spawns that finished quickly, or sessions
264
+ on agents where REM is disabled in `agent.yaml`.
265
+
266
+ The lag count is informational — you don't have to do anything about it. If
267
+ you want to nudge a session, end it (`/reset`) and REM will fire on the
268
+ archived copy at the next idle window.
269
+
270
+ **Tabs:**
271
+
272
+ - **Active** — non-archived sessions (default). Same set the `/session` slash-popup sees.
273
+ - **Archived** — sessions explicitly archived OR legacy `/reset` outputs (ids ending in `-archive`).
274
+ - **All** — both.
275
+
276
+ **Filters + sort:** agent (multi-select chip group), engine, REM-state (`dreamed` / `partial` / `never`), plus a free-text search across slug / agent / id. Column headers sort by last-activity / messages / size / agent (click to toggle direction).
277
+
278
+ **Click a row** (outside the checkbox / action buttons) → opens a chat window for that (agent, session). Same `wm.openChat()` path the agent dock uses.
279
+
280
+ **Archive / Unarchive:** the right-edge action button on each row archives (or unarchives in the Archived tab). Bulk-select with the checkboxes and the bulk-action bar archives multiple at once. The magic `main` session can't be archived directly — use `/reset` to spawn an archived copy.
281
+
282
+ **Export:** two download icons sit next to the archive button on every row — a file-text icon downloads a **Markdown transcript** (readable, with `##` user/assistant headers, fenced code blocks for tool calls, and engine plan items as task lists), a file-json icon downloads the raw **JSONL** (byte-identical to the on-disk source, full fidelity). Markdown is great for sharing or saving into Obsidian; JSONL is the canonical backup you'd drop on another somora host. Both work for archived sessions too. Backend route: `GET /agents/:agent/sessions/:session/export?format=…` (see [api.md](api.md)).
283
+
284
+ **Reload:** manual reload icon top-right, plus a 60-second auto-refresh toggle (default on). Stats are cached in each session's `<id>.meta.json` and invalidated by JSONL mtime, so reloads stay cheap.
285
+
286
+ **Archive semantics:** archive is **meta-flag based**, no file movement. `meta.archived = true` (with `archivedAt` + optional `archiveReason`) is the source of truth. The `<id>.jsonl` and `<id>.meta.json` files stay where they are. Default-filtering at `listSessions()` keeps archives out of the slash-popup, chat-window session picker, and the Active tab — they only surface in the Sessions tool. No hard-delete option, on purpose: archive is fully reversible, and you can always clean up `~/.somora/agents/<agent>/sessions/` by hand if you really want bytes gone.
287
+
288
+ **Why this exists:** sessions accumulate fast (REM idle-trigger, sub-agent spawns, `/reset` archives, debugging sessions). Without a place to see everything at once, slash-popups grow until they're useless and you can't tell which old sessions are still worth keeping. The Sessions tool is the housekeeping surface — search, filter, archive, see at a glance which sessions have unconsolidated memory waiting for REM.
289
+
290
+ ## Chat window anatomy
291
+
292
+ ```
293
+ ┌──────────────────────────────────────────────────────┐
294
+ │ 🧠 scribe · assistant ● streaming │ ← header
295
+ │ main · opus · think:medium · 🔧 on · ▣21% Σ↑12k ↓4k · ●│ ← live meta
296
+ ├──────────────────────────────────────────────────────┤
297
+ │ [user] summarize today's notes │
298
+ │ │
299
+ │ [tool] memory_search "today notes" │ ← above
300
+ │ [tool] → notes/2026-05-10 · 0.71 │
301
+ │ [scribe] You spent the morning on the cache fix... │ ← below
302
+ │ ▮ │
303
+ ├──────────────────────────────────────────────────────┤
304
+ │ 📎 Type a message… ▷ │ ← input
305
+ └──────────────────────────────────────────────────────┘
306
+ ```
307
+
308
+ - **Header**: agent name, role badge from `AGENTS.md`, streaming pill.
309
+ - **Meta line (10px mono)**: session id, model, thinking level, tools
310
+ toggle, context fill, token counts, connection dot. The two readings
311
+ mean different things. `▣` is how full the window was on the turn's
312
+ last request, amber past 75 % and red past 90 %. `Σ↑` and `↓` are what
313
+ the turn spent; the Σ says it is a sum over every request the turn
314
+ made. A turn with 21 tool rounds sends its context 21 times, so the
315
+ sum runs far past the window and says nothing about how full it is —
316
+ a real one read `▣ 62% Σ↑ 6.0M` against a 524k window. The TUI header
317
+ shows the same pair. On a CLI engine the window is the one the engine
318
+ reports for itself where it reports one (codex sends
319
+ `modelContextWindow` per thread), because the configured
320
+ `contextWindow` is somora's guess at a cap that engine enforces on its
321
+ own. If the last request was still bigger than the window somora knows,
322
+ the badge reads `▣ >100%` with the raw number rather than a percentage
323
+ that keeps climbing — a plain "300 %" said nothing a reader could act
324
+ on, and the tooltip names the cause (configured window too small). When the last turn was
325
+ answered by the persona's `fallback:` model, a warn-coloured
326
+ `⇄ <backup-model>` marker sits next to the model (tooltip: why the
327
+ primary failed).
328
+ - **Chat text zoom** (⊖ / ⊕ in the header, left of the project chip):
329
+ 75–200 % in discrete steps, **per agent** — one conversation can be
330
+ enlarged without touching other agents, the window chrome or the
331
+ desktop. The percentage readout appears only off-default and doubles
332
+ as the reset. Persisted per browser (`somora-chat-zoom`).
333
+ - **Fallback marker on bubbles**: an assistant turn produced by a
334
+ fallback model carries a `⇄ fallback · <model>` chip. Hover shows why
335
+ the primary failed — and with a fallback chain (`fallback: [a, b]` in
336
+ agent.yaml, see [agents.md](agents.md)) every model that failed before
337
+ this one, in order. It survives reloads — the server persists a
338
+ `model_fallback` event in the session history. A short notice
339
+ appears once at the start of a fallback streak and once more when
340
+ the primary model answers again; turns in between get the chip only.
341
+ When every model in the chain fails before producing anything, the
342
+ turn's error row names all of them with their reasons (`All 3 models
343
+ failed. …`) instead of only the last one's raw error. The TUI prints
344
+ the same as a warn line in the scrollback, the mobile client shows
345
+ the chip on the bubble.
346
+ - **Server log** (the **log** tile): the end of somora's own log in a
347
+ window, so a look at what the server did no longer needs an ssh
348
+ session. Pick the day, a minimum level (debug, info, warn, error) and
349
+ a text filter; new lines follow every two seconds while the window is
350
+ open, and following pauses when you scroll up to read. Only the tail
351
+ of one day's file is ever read.
352
+ - **Browser window** (when `browser.enabled`): the **browser** tile
353
+ lists browser sessions, one row per agent window — agents sharing a
354
+ profile run in one Chromium but get a window each, with their own
355
+ tabs, control state and handoff. A row opens the live view with tab
356
+ bar, URL bar and take-over buttons. Stopped browsers are not listed,
357
+ except one still holding an unanswered handoff. A pending handoff adds
358
+ an **Open browser** notice in its source chat and a taskbar marker. These and the list
359
+ update from one change stream. Broken viewer connections reconnect;
360
+ stopped browsers can be explicitly reopened without replaying old
361
+ actions. Closing the viewer keeps human control in place. See
362
+ [browser.md](browser.md#in-the-web-client).
363
+ - **Peer origin caption**: a message another agent sent via `agent_ask`
364
+ renders with that agent's icon and colour; when it was sent from one
365
+ of the sender's non-main sessions, `<agent> · <session>` sits left of
366
+ the timestamp. Main-session traffic shows no caption. The TUI shows
367
+ the same as `↬ <agent>/<session>`.
368
+ - **Body**: pinned-to-bottom auto-scroll. Manually scroll up to read
369
+ history; new messages won't yank you down. Scroll back to the
370
+ bottom to re-pin.
371
+ - **Tool-rendering toggle** (wrench in the meta line): show or hide
372
+ tool-call / tool-result blocks AND `engine_meta` rows (codex's
373
+ internal plan/todo state — see [setup.md](setup.md#engine-meta--codex-todo_list)).
374
+ Persists per `agent::session` in `localStorage` — a reload restores
375
+ your choice. Tools render **above** the agent's answer for a given
376
+ turn (TUI-style ordering) — the assistant bubble is a single message
377
+ that re-anchors to the bottom of the transcript whenever a tool event
378
+ lands, so cumulative text never duplicates around tool boundaries.
379
+ Engine-meta blocks render dimmer than tool calls and prefix with
380
+ `◌ codex · plan` so it's visually clear they came from the engine,
381
+ not from somora's tool layer.
382
+ - **Input**: auto-grow textarea up to 120px, then internal scroll.
383
+ Enter sends, Shift+Enter newline. The textarea stays editable
384
+ while a turn is streaming — pressing Send during a running turn
385
+ enqueues the message rather than blocking it (see "Queueing &
386
+ Stop" below).
387
+ - **Steer / queue toggle** (next to Send, while a turn runs): a small
388
+ labelled pill reading **queue** (hourglass, off) or **steer** (bolt,
389
+ on). With steer on, what you type goes *into* the running turn instead
390
+ of behind it — the model reads it at its next step and changes course; the
391
+ bubble shows `steering…` until the engine has taken it and `steered`
392
+ after. With queue the message waits as before. The agent's
393
+ `steering:` in agent.yaml sets which way the toggle starts; a steer the
394
+ turn ends before reading becomes an ordinary queued turn. Works on
395
+ every engine; a Claude turn keeps its channel to somora open until
396
+ every steered message has been answered, so tools keep working in the
397
+ steered part of the turn; see [api.md → Steering](api.md#steering) and
398
+ [agents.md](agents.md).
399
+ - **Stop buttons** (two, same abort): while a turn is in flight a
400
+ red Stop appears **in the composer next to Send** and on the
401
+ **streaming assistant bubble** (in the slot where copy/pin sit on
402
+ finished bubbles). Send stays live the whole time, so queued sends
403
+ keep working from the button — Stop is additive, it never replaces
404
+ Send. One click aborts the current turn server-side via
405
+ `POST /chat/abort`; if there was nothing to stop (turn just
406
+ finished) or the abort fails, a notice says so instead of silently
407
+ doing nothing.
408
+ - **Mic button** (next to send, when STT is configured): click-to-toggle
409
+ voice input. Click once to start recording — the icon switches to a
410
+ red stop-square and `MediaRecorder` captures from the default mic.
411
+ Click again to stop; the audio blob is POSTed to `/stt/transcribe`,
412
+ somora forwards it to the configured upstream (e.g. oMLX Whisper),
413
+ and the returned transcript is appended to the textarea — your
414
+ existing draft is preserved, voice gets added with a separating
415
+ space. Hidden when the browser lacks `MediaRecorder` /
416
+ `getUserMedia` (capability gate identical to the screenshot
417
+ button), or when somora's `/stt/config` reports STT disabled.
418
+ Configuration in [setup.md §7](setup.md#7-voice--stt--tts-optional).
419
+ - **Voice replies** (when TTS is configured): the chat header shows a
420
+ `🔊`/`🔇` toggle. When on, mic-submitted turns trigger automatic
421
+ TTS playback of the assistant reply (text replies are unaffected).
422
+ Toggle is sticky per `<agent>:<session>`. A Play-button appears on
423
+ bubbles that have generated audio so you can replay any time. Full
424
+ details in [voice.md](voice.md).
425
+
426
+ Markdown is rendered via `react-markdown` + `remark-gfm` +
427
+ `rehype-highlight`. Code blocks scroll horizontally inside the
428
+ 75%-width bubble; tables overflow-scroll independently.
429
+
430
+ ### Session actions menu (`•••`)
431
+
432
+ The three-dots button in the chat header opens a popover anchored to
433
+ that button — same screen position every time, escapes the chat
434
+ window via a portal so it can't be clipped. Three sections:
435
+
436
+ - **MODEL** — current model + engine + context window. "Switch
437
+ model…" expands an inline picker with a free-text filter; clicking
438
+ a model commits a per-session override (`PUT /agents/<a>/sessions/
439
+ <s>/model`). Same flow as the `/model` slash command.
440
+ - **THINKING** — current effective level and its source (session
441
+ override / persona default / engine default). A segmented control
442
+ (off / low / medium / high) sets a session override; "Reset to
443
+ default" removes the override and falls back to persona / engine
444
+ default.
445
+ - **DANGER ZONE — Reset session** — archives the current chat (the
446
+ jsonl is kept as `<id>-archive`) and starts a fresh session. If the
447
+ agent has REM enabled in `agent.yaml`, REM fires asynchronously
448
+ over the archived range to extract memory candidates. Two-click
449
+ confirm so it can't trigger by accident.
450
+
451
+ Close the menu by clicking the `•••` button again, clicking anywhere
452
+ outside the popover, or pressing `Escape`.
453
+
454
+ ### Bubble actions: copy and pin
455
+
456
+ Hover any finished assistant bubble and two small icons appear in the
457
+ top-right corner. They show up only once the message has finished
458
+ streaming — partial content can't be copied or pinned. The buttons
459
+ sit inside the bubble so they travel with their message as you scroll
460
+ and don't clutter the chat header.
461
+
462
+ - **Copy** writes the bubble's raw markdown to the clipboard. The
463
+ icon swaps to a check glyph for ~1.5 s as a confirmation cue, then
464
+ reverts. Pasting elsewhere preserves headings, lists, code blocks,
465
+ tables — anything markdown carries.
466
+ - **Pin** opens a free-floating pin-note window with a snapshot of
467
+ that message (see below). The pin icon turns yellow + filled and
468
+ stays visible even without hover, so pinned messages stand out
469
+ while you scroll the history.
470
+
471
+ Clicking an active pin again closes its pin-note window. Closing the
472
+ pin-note window via its `×` does the same thing — the two affordances
473
+ stay in sync.
474
+
475
+ ### Pin-note windows
476
+
477
+ A pin-note is a small free-floating window that captures one
478
+ assistant message for working memory. Use it when an answer is
479
+ important to refer back to while the conversation continues — a
480
+ recipe, a config snippet, a decision summary.
481
+
482
+ Layout:
483
+
484
+ ```
485
+ ┌──────────────────────────────────────┐
486
+ │ 📌 nova note × ─ ⤢ │ ← yellow titlebar tint
487
+ ├──────────────────────────────────────┤
488
+ │ 🤖 nova · main 14:08 │ ← agent + source + when said
489
+ ├──────────────────────────────────────┤
490
+ │ │
491
+ │ rendered markdown body, scrollable, │ ← same renderer as the chat
492
+ │ selectable… │
493
+ │ │
494
+ ├──────────────────────────────────────┤
495
+ │ 📌 pinned 3 min ago │ ← when the pin itself was made
496
+ └──────────────────────────────────────┘
497
+ ```
498
+
499
+ Behaviour:
500
+
501
+ - **Free-floating.** Drag the titlebar to move, drag the bottom-right
502
+ corner to resize, same as any other window. Pin-notes have their
503
+ own z-stack so you can leave one over a chat while continuing the
504
+ conversation.
505
+ - **Yellow titlebar tint** distinguishes them at a glance from chat,
506
+ tmux, and sessions windows.
507
+ - **Snapshot semantics.** The content is frozen at pin time. If the
508
+ agent continues streaming additions to the same turn, the pin
509
+ doesn't update — re-pin to capture the new state.
510
+ - **Multiple in parallel.** Pin as many messages as you like; each
511
+ gets its own window. Re-pinning the same message focuses the
512
+ existing note instead of duplicating.
513
+ - **Survives reloads.** Pin-notes live in the window-manager's
514
+ `localStorage` layout, so a browser refresh restores them.
515
+ - **Survives the source.** Even if the original session is archived
516
+ or the chat window is closed, the pin-note keeps its content. The
517
+ header still shows the source agent and session label so you can
518
+ retrace where the message came from.
519
+
520
+ Closing a pin-note (`×` button on the window, or click the active
521
+ pin button on the source bubble) just removes the note window — the
522
+ original message stays in chat history.
523
+
524
+ ## Queueing & Stop
525
+
526
+ You don't have to wait for a turn to finish before typing the next
527
+ one. Submits during a running turn flow into the per-session queue
528
+ on the server (see [api.md](api.md#queuing)) and execute in order
529
+ once the lock frees. The alternative is the steer toggle in the
530
+ composer: a message steered into the running turn is read by the
531
+ model mid-work instead of after it (see "Chat window anatomy").
532
+
533
+ The optimistic user-bubble shows up immediately with a small
534
+ hourglass marker next to its timestamp:
535
+
536
+ ```
537
+ ┌──────────────────────────────────────┐
538
+ │ next thing I want to ask │
539
+ │ ⌛ queued · 14:08 │
540
+ └──────────────────────────────────────┘
541
+ ```
542
+
543
+ When other waiters sit in front, the marker reads
544
+ `⌛ queued · N ahead`. The marker disappears as soon as the server
545
+ starts the turn — at that point the bubble looks like any other
546
+ finished user message, and the assistant's reply streams in below it.
547
+
548
+ While the marker is showing, the message is still yours: the small
549
+ **↩ edit** next to it takes the message back out of the queue and
550
+ into the composer (`DELETE /chat/queue/:id`), attachments
551
+ included, so you can add the thing you forgot and send again. The
552
+ re-sent message joins the end of the queue. If the turn started in
553
+ the meantime the bubble just loses its marker and a notice says so —
554
+ Stop is the handle from then on.
555
+
556
+ ### The queue badge
557
+
558
+ The window header says what the session is doing as a whole:
559
+ `waiting 3 · running · 1 arriving`, and `2 sub-agents` / `1 ask` when
560
+ the session has work out elsewhere. It counts every kind of turn, not only yours — a
561
+ question from another agent, a sub-agent brief, a sentinel fire, a
562
+ question from a call. Click it for the list:
563
+
564
+ - **Running** — the turn holding the lock: where it came from, its
565
+ first line, since when, and Stop.
566
+ - **Waiting** — the queue in order, each entry with its origin, a
567
+ preview and how long it has waited, and **×** to remove it, whoever
568
+ queued it. Your own message comes back into the composer as with
569
+ ↩ edit; another agent's question is reported to that agent as failed
570
+ with the reason, a sub-agent brief as cancelled, a sentinel fire as
571
+ skipped.
572
+ - **Arriving** — answers on their way back into this session: a late
573
+ reply to an `agent_ask`, a finished background sub-agent, a rendered
574
+ video.
575
+ - **From here** — the sub-agents and `agent_ask` calls this session
576
+ started that are still queued or running; a row opens the target
577
+ session. **×** on one that has not started yet removes it from the
578
+ target's queue; **■** on a running one stops it — a sub-agent
579
+ together with everything it started, a question as the turn it runs
580
+ on the target. This session hears about it the way it would have
581
+ heard the result.
582
+
583
+ Badge and list both read `GET /agents/:agent/sessions/:session/work`
584
+ ([api.md](api.md#get-agentsagentsessionssessionwork)): refetched on
585
+ every queue event, and every 3 s while the list is open so the wait
586
+ times keep counting.
587
+
588
+ Aborting (Stop button on the streaming bubble) cancels the
589
+ **currently-running** turn only. Queued waiters keep their slots and
590
+ run in order. It does not matter what started that turn: a message
591
+ from another agent, a sub-agent brief, a sentinel fire, a tmux or
592
+ browser wake, a voice consult or a wake-up stops the same way as your
593
+ own message, and whoever asked for it is told it was stopped by the
594
+ user.
595
+
596
+ ## Failed turns
597
+
598
+ A turn that ends in an error (engine 5xx, watchdog, abort) renders as
599
+ a red **Turn failed** block inside the turn, right where it happened.
600
+ Media the turn produced before failing (a generated picture, say)
601
+ hangs under that block — not under the previous answer. The block
602
+ comes from the `turn_error` SSE event live and from the session
603
+ file's `error` rows on reload.
604
+
605
+ ## Activity feed (multi-agent dots + unread)
606
+
607
+ The agent dock and the Sessions tool both show two passive indicators
608
+ that come from a single app-wide SSE on `/activity/stream`:
609
+
610
+ - **Streaming dot** — fills on every agent whose any session is mid-
611
+ turn, not just agents whose chat window you currently have open.
612
+ When a sentinel job wakes a different agent in the background or a
613
+ peer-agent message kicks off an A2A reply, that agent's dock tile
614
+ goes busy even if its window is closed.
615
+ - **Unread dot** — appears (different colour from streaming) when a
616
+ session has activity since you last viewed it. Counts: A2A
617
+ inbounds, sentinel-triggered messages, and assistant final replies.
618
+ Self-typed messages and tool/memory side-effects do not count.
619
+
620
+ A session is "viewed" when its chat window is open and focused. The
621
+ client POSTs `/sessions/:agent/:session/seen` on focus and the server
622
+ broadcasts the cleared state — open the chat on the TUI or mobile and
623
+ the badge here disappears too. Per-session badges also show in the
624
+ Sessions tool's session list.
625
+
626
+ State persists across server restarts: `unreadAt` and `seenAt` live in
627
+ each session's meta. Endpoint docs: see [api.md](api.md#get-activitystream).
628
+
629
+ ## Cross-client echo
630
+
631
+ When you type a message in a Web window, the somora server echoes a
632
+ `user_message` SSE event to **every** subscriber of that
633
+ `agent::session`. The TUI tail will show what you typed in the web,
634
+ and a second web tab on the same chat will show it too. Self-echoes
635
+ are deduped against the optimistic local-user message via a pending
636
+ list, so you never see the same text twice.
637
+
638
+ ## SSE event vocabulary
639
+
640
+ The web client listens for these named events on `/chat/stream`:
641
+
642
+ | Event | Payload | Meaning |
643
+ |---|---|---|
644
+ | `status` | `{msg}` | Connection state — initial `connected`, periodic keepalive |
645
+ | `user_message` | `{text, ts, turnId?, origin?, from_agent?, from_session?, from_system?, agent_ask_call_id?}` | A user-typed message landed in the session (any client). `turnId` pairs the event with an optimistic bubble made by `POST /chat/send`. `from_system` marks a system-trigger inbound: `sentinel`, `tmux` (attention watcher), `subagent` (finished task), `job` (video job), `browser` (hand-back), `voice` (question from a realtime call), `a2a` (late answer to an `agent_ask`). Each is drawn as a centered divider, not a bubble — in the web client, on mobile and in the TUI alike. `origin` carries the same information as one structured value (shape in [api.md](api.md#get-chatstream)); turns recorded before it existed have only the `from_*` fields. |
646
+ | `turn_queued` | `{turnId, ahead, workId?, kind?}` | Fired when a send hit a busy lock. `ahead` ≥ 1 includes the currently-running turn. `workId` is the entry's id in the session's work queue (equals `turnId` for a typed turn) and `kind` its origin. Drives the `⌛ queued` marker. Re-emitted for the waiters that move up after a dequeue. |
647
+ | `turn_dequeued` | `{turnId, workId}` | A waiting entry was taken back (↩ edit or × in the queue list, from any client). The bubble for a typed message is dropped; the queue list refreshes. |
648
+ | `turn_started` | `{turnId}` | The engine's own turn id — stamped on the assistant bubble so `assistant_media` / `turn_error` pair to this turn. |
649
+ | `turn_error` | `{turnId?, message, engine}` | The turn failed. Rendered as the **Turn failed** block inside the turn. |
650
+ | `agent` | `{phase: 'start'\|'end', usage?, provider?, model?, fallback?, ...}` | Turn boundary. On `end`, `provider`/`model` are the model that ACTUALLY answered; `fallback` `{requested, actual, reason, hops?}` is set when that was a fallback model (same shape as `model_fallback`). |
651
+ | `model_fallback` | `{requested, actual, reason, hops?}` | The primary model failed before producing anything; a fallback model is answering this turn. `requested` is always the primary, `actual` the model now answering; `hops` lists every model that failed so far (chain). One event per hop, precedes the first `chat` delta of the model that answers. |
652
+ | `chat` | `{state: 'delta'\|'final', text}` | Cumulative assistant text (each delta carries the full running text, not just the new chunk) |
653
+ | `thinking` | `{state: 'delta'\|'final', text, truncated?}` | The model's reasoning text, cumulative like `chat`; `truncated` when the server cut it at its cap. Renders as the 🧠 thinking block above the reply (the "Show thinking in replies" switch in the `•••` menu, same as `/verbose thinking`). See [thinking.md](thinking.md). |
654
+ | `tool` | `{phase: 'call'\|'result'\|'error', tool, summary?, details?, error?}` | Tool invocation lifecycle |
655
+ | `engine_meta` | `{engine, itemType, label, summary?, payload}` | Engine-internal side-channel (e.g. codex `todo_list`). Renders under the tools toggle. |
656
+ | `memory` | `{count, topScore, refs, fullText?}` | Memory auto-inject for this turn |
657
+ | `project` | `{from, to, via}` | Project focus change — fired by `/projekt` slash + HTTP routes. MCP-routed agent tool calls don't emit this; clients re-GET `/…/project` on `agent:end` instead. Only fires when the projects feature is enabled. |
658
+ | `assistant_audio` | `{turnId, url, mime, durationMs?, cacheKey}` | Server-generated TTS artifact for the matching turn. Pairs by `turnId`; drives the Play-button on the bubble. |
659
+ | `assistant_media` | `{turnId, media: [{type, id, prompt, mime, filename, url}]}` | Media produced while the turn ran. Pairs by `turnId` and renders under the bubble. Published by the server after the turn finalizes — the agent doesn't have to attach anything. Each entry's `type` decides the renderer; an unknown type is skipped rather than guessed at. See [imagegen.md](imagegen.md). |
660
+
661
+ The server pubsub key is `${agent}::${session}` — multiple agents can
662
+ share a session id like `main` without leaking events across windows.
663
+
664
+ ## FileView
665
+
666
+ Agents reference files by absolute path in chat (`[report.md](/home/…)`),
667
+ and the web client's Markdown renderer turns those into links that open
668
+ a FileView window. Nothing is refused for being the wrong type:
669
+ what the viewer cannot render, it describes.
670
+
671
+ | The file is | You get |
672
+ |---|---|
673
+ | Markdown | full render, same plugins as chat |
674
+ | Text / code | monospace, syntax highlighting for the known extensions |
675
+ | Image | inline, click for full size |
676
+ | Video | `<video controls>`, seeking served by Range requests |
677
+ | Audio | `<audio controls>` |
678
+ | PDF | the browser's own viewer |
679
+ | anything else | name, type, size — and a download |
680
+
681
+ **A download button is present for every file type**, including the ones
682
+ that render inline.
683
+
684
+ The classification comes from the file's magic bytes, not its
685
+ extension: a `.dat` holding PNG bytes is shown as the image it is, and a
686
+ `.png` that is really a JPEG is served with the type it really has.
687
+ `.svg` is the deliberate exception — it is markup that can carry script,
688
+ so it is shown as its own source rather than rendered.
689
+
690
+ Bytes come from `GET /files/raw`, which streams and honours `Range`;
691
+ without that, scrubbing a video would re-fetch the whole file. Inline
692
+ display is limited to image/video/audio/PDF, because anything else shown
693
+ inline would run on somora's own origin.
694
+
695
+ The boundary is the read policy, not the workspace: a file under
696
+ `/tmp/` is viewable, a file under a blocked root is not — the same
697
+ answer `file_read` gives an agent. See [api.md](api.md#get-filesview).
698
+
699
+ ## Features
700
+
701
+ - **Chat windows** — one per `(agent, session)`, live SSE streaming,
702
+ full history hydration on open, per-window tool/memory toggles,
703
+ cross-client echo (multiple windows on the same session stay in
704
+ sync), window manager with persistence (positions/sizes survive
705
+ reload).
706
+ - **Windows never leave the desktop** — shrinking the browser pushes
707
+ every window back inside and shrinks only what no longer fits; the
708
+ taskbar (with Arrange, Save/Restore layout) always stays on top. See
709
+ the window-manager section above.
710
+ - **Agent context menu** — right-click an agent tile: open main, jump
711
+ to one of its recent sessions, start a named new session in its own
712
+ window, open the Sessions tool, or **Configure…** (the Agent window
713
+ below).
714
+ - **Agent window** — what a persona is made of and what it costs. A
715
+ budget strip on top: the three persona files together, the team
716
+ block, the full assembled prompt and the tool schemas, each in
717
+ characters and estimated tokens against `promptBudgets` in
718
+ config.yaml (soft caps: over budget turns the counter yellow, nothing
719
+ is truncated). Tabs for `AGENTS.md`, `SOUL.md` and `USER.md` as plain
720
+ editors with a per-file counter and Save/Discard, `agent.yaml`
721
+ read-only (model, fallback, REM — edit the file or use the session
722
+ controls), and **Full prompt**: the system prompt exactly as the next
723
+ turn on a chosen session would send it, split into its parts with
724
+ sizes, plus the tool-schema total and a note on what is *not* in that
725
+ text (memory recall, history, the engine's own instructions). Agents
726
+ that can be called by voice get one more tab, **Voice prompt**: the
727
+ whole instruction the talking model is given, whether it came from a
728
+ hand-written `VOICE.md` or was derived from the persona, with voice,
729
+ language and consult policy beside it. Saving
730
+ is guarded: the agents edit these files themselves, so a save is
731
+ refused when the file changed on disk since you loaded it, and you
732
+ are asked to reload; the previous version is kept as a backup.
733
+ `AGENTS.md` must keep a loadable frontmatter whose `name` matches the
734
+ agent directory.
735
+ - **Queued messages are editable** — a message waiting behind a running
736
+ turn shows ⌛ and an *edit* link that takes it back into the composer;
737
+ a turn that fails renders as a *Turn failed* block inside the turn,
738
+ with any media it produced under it.
739
+ - **Abilities window** — per-agent matrix for tools *and* skills, plus
740
+ external MCP server health. See [mcp.md](mcp.md#the-abilities-window)
741
+ and [skills.md](skills.md#per-agent-visibility). The matrix follows the
742
+ agent's kind: a chat agent sees the whole programme minus the three
743
+ builder-only tools, a builder sees its coding set on top and every
744
+ other tool under *more*, off unless switched on. A toggle takes effect
745
+ on the agent's next turn on every engine; on codex-cli the Codex
746
+ thread is restarted with the session history carried over (a
747
+ `tools changed` marker appears in the chat), because Codex keeps a
748
+ thread's tool set for its lifetime.
749
+ - **Builder windows** — an agent of kind `builder`
750
+ ([builder.md](builder.md)) has a grey outline and a *builder* label on
751
+ its tile, and its chat window opens wider than a chat window (960 × 620,
752
+ so the panel is not folded from the start) and carries the **task panel**
753
+ docked on the right: mode (attended / unattended) and phase (plan / build) switches,
754
+ the **Go** button that approves the plan and starts the build, the
755
+ plan file's path, the task list the builder keeps with `todo_write`,
756
+ and any question it asks with `ask_user`, answered right there. The
757
+ panel folds to a strip when the window is narrower than about 640 px
758
+ and unfolds again with the window. The agent window shows only
759
+ `AGENTS.md` for a builder (no `SOUL.md` / `USER.md`: the harness rules
760
+ replace the persona), and the Full prompt tab shows the harness prompt
761
+ with its parts.
762
+ - **Team window** — the org chart editor for `~/.somora/team.yaml`
763
+ ([team.md](team.md)): drag an agent card onto its new superior (or
764
+ onto you), edit title, "involve for" / "not for" chips, notes and the
765
+ active switch per agent, your own name/title/about and the global
766
+ rules; the preview pane shows the exact `# Your team` block any agent
767
+ would get — rendered from the unsaved draft, so you see the effect
768
+ before saving. Save validates on the server, writes atomically and
769
+ keeps the last five versions as backups; agents pick the change up on
770
+ their next turn. With no file yet the window offers to create one from
771
+ the agents on disk.
772
+ - **Drag & drop / paste / paperclip attachments.**
773
+ Per-turn user-attachments end-to-end through all three engines:
774
+ claude-cli inlines as native ImageBlock / DocumentBlock;
775
+ codex-cli sends images as native turn inputs and rasterises PDFs to
776
+ per-page PNGs; openai-compatible builds an array-content user
777
+ message (`image_url` for images, `file` or rasterised pages for
778
+ PDFs depending on `pdfMode`). Bytes live content-addressed at
779
+ `~/.somora/attachments/<sha256>.<ext>`; JSONL refs only, never
780
+ inline. See `docs/files.md` (and config block below) for the
781
+ Server side; the client surface is paperclip + Cmd/Ctrl+V paste
782
+ + drag&drop overlay + a per-bubble thumbnail row. Capability
783
+ gate refuses uploads for models without `image`/`pdf` capability
784
+ with a clear nudge to `/model`. Switching an existing session to a
785
+ text-only model afterwards keeps working: the history is packed for
786
+ the model that will read it, so past attachments it cannot process
787
+ are replayed as a text marker naming the file instead of being
788
+ re-sent and rejected. See `files.md`.
789
+ - **Older-messages lazy-load**. Initial history load is paginated
790
+ to the last 100 events; scrolling near the top auto-fetches the
791
+ next 100, anchoring the visible position so you stay where you
792
+ were reading. There's also an explicit "↑ load older" button
793
+ for clarity. A window left open on a busy session does not grow
794
+ without bound either: past 400 rows it keeps the newest 300 once
795
+ the running turn has ended, and the older rows come back through
796
+ the same "load older" path. Each window redraws only for events
797
+ of its own session, so several streaming windows side by side stay
798
+ responsive.
799
+
800
+ - **Memory-inject banner** — per-turn `🧠 memory · N hits · refs…` line
801
+ in the chat flow, mirrors the TUI's `◇ memory · …` row. Brain icon in
802
+ the meta-line toggles visibility; chevron expands the full injected
803
+ text. Persists per `agent::session` like the tools toggle.
804
+ - **Slash-command popup** — type `/` in the input to bring up a
805
+ command picker:
806
+ - `/model <ref>` — switch model for this session (autocompletes from
807
+ `/models`).
808
+ - `/session <slug>` — switch the window to another session of this
809
+ agent (in-place, the SSE re-subscribes).
810
+ - `/new <slug>` — create a new session and switch this window to it.
811
+ - `/thinking <off|low|medium|high|default>` — set / clear the
812
+ thinking-effort override.
813
+ - `/sampling [key=value …|default]` and `/temp <n>|default` — sampling
814
+ parameters for this session (openai-compatible engine), see
815
+ [sampling.md](sampling.md).
816
+ - `/verbose thinking on|off` — show or hide the 🧠 thinking block
817
+ above replies in this session (display only; same switch as the
818
+ checkbox in the ••• session menu).
819
+ - `/projekt <slug>` (alias `/project`) — pin a project to this
820
+ session. Autocompletes from `/projects` with entity + path-count
821
+ detail per row. `/projekt unlink` is always the first row so
822
+ clearing the pin doesn't require waiting for the list to load.
823
+ Only present when the projects feature is enabled in `config.yaml`.
824
+ - `/reset YES` — archive this session and start fresh (same as the
825
+ Danger-zone action in the `•••` menu); `YES` is the confirmation.
826
+
827
+ Arrow-keys navigate, Enter or Tab accepts, Escape dismisses. Note:
828
+ `/agent` is intentionally *not* a slash-command — the agent dock on
829
+ the left is the agent switcher, switching agent inside an existing
830
+ window would mean discarding the window's identity. `/skill` is also
831
+ out, because skills are activated by the agent itself via the `skill`
832
+ tool, not by user-facing CLI shortcuts.
833
+ - **Tmux session windows** — attach to a running tmux session in its
834
+ own window via xterm.js + a WebSocket bridge. Sessions you started
835
+ in the terminal show up in the AppDock; output streams live and
836
+ keystrokes go straight through.
837
+ - **Sessions tool** — cross-agent session browser in the AppDock with
838
+ filter (agent, engine, REM state), sort, search, click-to-chat,
839
+ bulk archive/unarchive, and 60s auto-refresh. Archive is a meta-flag
840
+ (no file movement, no hard delete) so archived sessions stay
841
+ inspectable and can be restored. When the projects feature is on,
842
+ the table also has a Project column with color-coded chips per row.
843
+ - **Wiki explorer** (opt-in, read-only) — a dock tile that opens the
844
+ shared wiki in three columns: folder tree, rendered page, link graph
845
+ plus backlinks. Obsidian `[[wikilinks]]` are clickable and navigate
846
+ in place; targets that match no page render as broken rather than
847
+ silently disappearing, so gaps in the wiki stay visible. The graph
848
+ toggles between the current page's neighbourhood and the whole wiki,
849
+ and clicking a node opens that page. The tile only appears when
850
+ `wiki.enabled` and `obsidian.vault` are both set — the same gate the
851
+ server applies to the routes. Nothing here writes: the wiki is owned
852
+ by Deep/Lucid, and a viewer that could also edit would race them.
853
+ See [wiki.md](wiki.md#web-explorer).
854
+ - **Project chip + switcher** (opt-in) — when `projects.enabled` is
855
+ on, the chat-window header gains a chip next to the ••• action
856
+ button. Color-pill with project name when pinned; ghost folder
857
+ button when unpinned. Click opens a switcher popover with all
858
+ configured projects grouped by entity + a search field. Cross-
859
+ client live update via SSE: pin via `/projekt` in the TUI, the
860
+ open web window updates within 100 ms. See
861
+ [projects.md](projects.md) for the feature model.
862
+
863
+ ## Files of interest
864
+
865
+ ```
866
+ web/
867
+ ├── src/
868
+ │ ├── components/
869
+ │ │ ├── ChatProvider.tsx ← global per-session state + SSE multiplexer
870
+ │ │ ├── Desktop.tsx ← window manager host
871
+ │ │ ├── Window.tsx ← drag/resize chrome
872
+ │ │ ├── ChatWindow.tsx ← header + body + input
873
+ │ │ ├── MessageItem.tsx ← per-message renderer (user/agent/tool)
874
+ │ │ ├── DesktopIcons.tsx ← icon grid: drag/swap/keyboard placement
875
+ │ │ ├── AgentTile.tsx ← one agent tile (status dot, pulse, badge)
876
+ │ │ ├── AppTile.tsx ← one app tile
877
+ │ │ ├── WikiWindow.tsx ← wiki explorer: tree + reader + links
878
+ │ │ ├── WikiGraph.tsx ← d3-force layout, plain-SVG rendering
879
+ │ │ └── Taskbar.tsx ← bottom bar + layout actions
880
+ │ ├── hooks/
881
+ │ │ ├── useAgents.ts ← /agents poll
882
+ │ │ ├── useSessionInfo.ts ← /tui-config + per-session model/thinking
883
+ │ │ ├── useLoopState.ts ← /dream/review-state poll
884
+ │ │ └── useWindowManager.ts ← layout state + localStorage persistence
885
+ │ ├── lib/
886
+ │ │ ├── api.ts ← typed wrappers around /agents, /chat/*, etc.
887
+ │ │ └── colors.ts ← per-agent gradient + role-tint resolver
888
+ │ └── styles/
889
+ │ ├── desktop.css ← desktop chrome (windows, taskbar, tiles)
890
+ │ ├── globals.css ← Tailwind + targeted overrides
891
+ │ └── tokens.css ← CSS variables (theme)
892
+ └── vite.config.ts ← base: '/web/', proxy in dev mode
893
+ ```