@kabmo-labs/kabmo 0.0.0-stage → 0.0.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 (2087) hide show
  1. package/README.md +501 -2
  2. package/bunfig.toml +11 -0
  3. package/dist/client/index.html +85 -0
  4. package/dist/client/index.js +1644 -0
  5. package/dist/client/static/apple-touch-icon-bbhgf3mq.png +0 -0
  6. package/dist/client/static/icon-192x192-kz5bvz85.png +0 -0
  7. package/dist/client/static/icon-8h6v1jcy.svg +12 -0
  8. package/dist/client/static/js/index-4vyzz0z4.js +5233 -0
  9. package/dist/client/static/js/index-x9cehh1a.css +1 -0
  10. package/dist/client/static/manifest-42r8wcmg.webmanifest +91 -0
  11. package/extensions/kabmo-modes/commands.test.ts +209 -0
  12. package/extensions/kabmo-modes/commands.ts +247 -0
  13. package/extensions/kabmo-modes/goal.test.ts +239 -0
  14. package/extensions/kabmo-modes/goal.ts +335 -0
  15. package/extensions/kabmo-modes/index.ts +272 -0
  16. package/extensions/kabmo-modes/omp-modules.d.ts +27 -0
  17. package/extensions/kabmo-modes/parked.test.ts +112 -0
  18. package/extensions/kabmo-modes/parked.ts +161 -0
  19. package/extensions/kabmo-modes/plan.test.ts +283 -0
  20. package/extensions/kabmo-modes/plan.ts +292 -0
  21. package/extensions/kabmo-modes/prompts.test.ts +70 -0
  22. package/extensions/kabmo-modes/prompts.ts +167 -0
  23. package/extensions/kabmo-modes/protocol.test.ts +57 -0
  24. package/extensions/kabmo-modes/protocol.ts +97 -0
  25. package/extensions/kabmo-modes/registration.test.ts +26 -0
  26. package/extensions/kabmo-modes/session.ts +199 -0
  27. package/index.html +85 -0
  28. package/marketplace/marketplace.json +25 -0
  29. package/marketplace/plugins/command-runner/README.md +223 -0
  30. package/marketplace/plugins/command-runner/icon.svg +18 -0
  31. package/marketplace/plugins/command-runner/package.json +41 -0
  32. package/marketplace/plugins/command-runner/src/app.tsx +281 -0
  33. package/marketplace/plugins/command-runner/src/panel/Custom.test.tsx +324 -0
  34. package/marketplace/plugins/command-runner/src/panel/CustomForm.tsx +236 -0
  35. package/marketplace/plugins/command-runner/src/panel/Glyph.tsx +60 -0
  36. package/marketplace/plugins/command-runner/src/panel/Groups.test.tsx +316 -0
  37. package/marketplace/plugins/command-runner/src/panel/Groups.tsx +311 -0
  38. package/marketplace/plugins/command-runner/src/panel/Header.tsx +76 -0
  39. package/marketplace/plugins/command-runner/src/panel/Output.tsx +109 -0
  40. package/marketplace/plugins/command-runner/src/panel/Row.test.tsx +278 -0
  41. package/marketplace/plugins/command-runner/src/panel/Row.tsx +265 -0
  42. package/marketplace/plugins/command-runner/src/panel/format.ts +29 -0
  43. package/marketplace/plugins/command-runner/src/panel/index.tsx +165 -0
  44. package/marketplace/plugins/command-runner/src/panel/use-custom-dialog.ts +147 -0
  45. package/marketplace/plugins/command-runner/src/protocol.ts +242 -0
  46. package/marketplace/plugins/command-runner/src/server/custom.test.ts +223 -0
  47. package/marketplace/plugins/command-runner/src/server/custom.ts +260 -0
  48. package/marketplace/plugins/command-runner/src/server/detectors/detectors.test.ts +267 -0
  49. package/marketplace/plugins/command-runner/src/server/detectors/js.ts +38 -0
  50. package/marketplace/plugins/command-runner/src/server/detectors/jsonc.ts +78 -0
  51. package/marketplace/plugins/command-runner/src/server/detectors/make.ts +82 -0
  52. package/marketplace/plugins/command-runner/src/server/detectors/native.ts +153 -0
  53. package/marketplace/plugins/command-runner/src/server/detectors/python.ts +124 -0
  54. package/marketplace/plugins/command-runner/src/server/detectors/table.ts +62 -0
  55. package/marketplace/plugins/command-runner/src/server/detectors/types.ts +147 -0
  56. package/marketplace/plugins/command-runner/src/server/discovery.test.ts +344 -0
  57. package/marketplace/plugins/command-runner/src/server/kill.ts +23 -0
  58. package/marketplace/plugins/command-runner/src/server/package-manager.ts +80 -0
  59. package/marketplace/plugins/command-runner/src/server/resolve.test.ts +215 -0
  60. package/marketplace/plugins/command-runner/src/server/resolve.ts +165 -0
  61. package/marketplace/plugins/command-runner/src/server/ring.ts +74 -0
  62. package/marketplace/plugins/command-runner/src/server/run-store.ts +226 -0
  63. package/marketplace/plugins/command-runner/src/server/run-types.ts +57 -0
  64. package/marketplace/plugins/command-runner/src/server/runner.test.ts +335 -0
  65. package/marketplace/plugins/command-runner/src/server/runner.ts +179 -0
  66. package/marketplace/plugins/command-runner/src/server/scan.ts +300 -0
  67. package/marketplace/plugins/command-runner/src/server/sweeps.test.ts +137 -0
  68. package/marketplace/plugins/command-runner/src/server.ts +325 -0
  69. package/marketplace/plugins/command-runner/src/watch.test.ts +235 -0
  70. package/marketplace/plugins/command-runner/src/watch.ts +97 -0
  71. package/marketplace/plugins/command-runner/tsconfig.json +16 -0
  72. package/marketplace/plugins/session-info/README.md +23 -0
  73. package/marketplace/plugins/session-info/icon.svg +14 -0
  74. package/marketplace/plugins/session-info/package.json +41 -0
  75. package/marketplace/plugins/session-info/src/app.test.tsx +172 -0
  76. package/marketplace/plugins/session-info/src/app.tsx +174 -0
  77. package/marketplace/plugins/session-info/src/server.ts +118 -0
  78. package/marketplace/plugins/session-info/src/styles.css +48 -0
  79. package/marketplace/plugins/session-info/tsconfig.json +22 -0
  80. package/marketplace/plugins/stats/README.md +99 -0
  81. package/marketplace/plugins/stats/icon.svg +16 -0
  82. package/marketplace/plugins/stats/package.json +46 -0
  83. package/marketplace/plugins/stats/src/ProcessTable.tsx +237 -0
  84. package/marketplace/plugins/stats/src/RefreshButton.tsx +56 -0
  85. package/marketplace/plugins/stats/src/Sparkline.tsx +80 -0
  86. package/marketplace/plugins/stats/src/TotalsBar.test.tsx +139 -0
  87. package/marketplace/plugins/stats/src/TotalsBar.tsx +96 -0
  88. package/marketplace/plugins/stats/src/app.test.tsx +228 -0
  89. package/marketplace/plugins/stats/src/app.tsx +183 -0
  90. package/marketplace/plugins/stats/src/daemons.ts +157 -0
  91. package/marketplace/plugins/stats/src/format.test.ts +125 -0
  92. package/marketplace/plugins/stats/src/format.ts +53 -0
  93. package/marketplace/plugins/stats/src/groups.test.ts +153 -0
  94. package/marketplace/plugins/stats/src/groups.ts +204 -0
  95. package/marketplace/plugins/stats/src/labels.test.ts +188 -0
  96. package/marketplace/plugins/stats/src/labels.ts +219 -0
  97. package/marketplace/plugins/stats/src/proc/darwin.ts +268 -0
  98. package/marketplace/plugins/stats/src/proc/identity.ts +179 -0
  99. package/marketplace/plugins/stats/src/proc/index.ts +45 -0
  100. package/marketplace/plugins/stats/src/proc/linux.ts +186 -0
  101. package/marketplace/plugins/stats/src/proc/ps.ts +121 -0
  102. package/marketplace/plugins/stats/src/proc/types.ts +78 -0
  103. package/marketplace/plugins/stats/src/sampler.test.ts +200 -0
  104. package/marketplace/plugins/stats/src/sampler.ts +281 -0
  105. package/marketplace/plugins/stats/src/server.ts +252 -0
  106. package/marketplace/plugins/stats/src/sessions.test.ts +112 -0
  107. package/marketplace/plugins/stats/src/sessions.ts +189 -0
  108. package/marketplace/plugins/stats/src/snapshot.ts +121 -0
  109. package/marketplace/plugins/stats/tsconfig.json +16 -0
  110. package/package.json +103 -4
  111. package/public/apple-touch-icon.png +0 -0
  112. package/public/icon-192x192.png +0 -0
  113. package/public/icon-512x512.png +0 -0
  114. package/public/icon-maskable-512x512.png +0 -0
  115. package/public/icon.svg +12 -0
  116. package/public/manifest.webmanifest +91 -0
  117. package/public/sw.js +76 -0
  118. package/src/cli/kabmo.js +5 -0
  119. package/src/cli/lib/args.js +283 -0
  120. package/src/cli/lib/args.test.js +76 -0
  121. package/src/cli/lib/build.js +52 -0
  122. package/src/cli/lib/commands/logs.js +150 -0
  123. package/src/cli/lib/commands/plugin.js +285 -0
  124. package/src/cli/lib/commands/plugin.test.js +125 -0
  125. package/src/cli/lib/commands/restart.js +94 -0
  126. package/src/cli/lib/commands/serve.js +278 -0
  127. package/src/cli/lib/commands/serve.test.js +58 -0
  128. package/src/cli/lib/commands/status.js +130 -0
  129. package/src/cli/lib/commands/stop.js +95 -0
  130. package/src/cli/lib/commands/update.js +132 -0
  131. package/src/cli/lib/output.js +143 -0
  132. package/src/cli/lib/path-utils.js +99 -0
  133. package/src/cli/lib/path-utils.test.js +184 -0
  134. package/src/cli/lib/paths.js +40 -0
  135. package/src/cli/lib/process-lifecycle.js +148 -0
  136. package/src/cli/lib/process-lifecycle.test.js +156 -0
  137. package/src/cli/lib/restart-scope.js +93 -0
  138. package/src/cli/lib/restart-scope.test.js +119 -0
  139. package/src/cli/lib/runtime.js +279 -0
  140. package/src/cli/lib/serve-mode.js +20 -0
  141. package/src/cli/lib/serve-mode.test.js +29 -0
  142. package/src/cli/lib/stop-instance.js +120 -0
  143. package/src/cli/lib/stop-instance.test.js +206 -0
  144. package/src/cli/lib/stop-scope.js +23 -0
  145. package/src/cli/lib/stop-scope.test.js +41 -0
  146. package/src/cli/lib/ui-password.js +190 -0
  147. package/src/cli/main.js +81 -0
  148. package/src/client/App.tsx +140 -0
  149. package/src/client/bootstrap.d.ts +33 -0
  150. package/src/client/components/auth/login-screen/index.tsx +133 -0
  151. package/src/client/components/common/ComposerPicker.tsx +141 -0
  152. package/src/client/components/common/ComposerTextarea.tsx +178 -0
  153. package/src/client/components/common/CopyButton.tsx +97 -0
  154. package/src/client/components/common/FolderPicker.tsx +254 -0
  155. package/src/client/components/common/MarkdownRenderer.tsx +299 -0
  156. package/src/client/components/common/Modal.tsx +93 -0
  157. package/src/client/components/common/PWAInstallButton.tsx +113 -0
  158. package/src/client/components/common/ReloadPageButton.test.tsx +78 -0
  159. package/src/client/components/common/ReloadPageButton.tsx +30 -0
  160. package/src/client/components/common/SignOutButton.test.tsx +141 -0
  161. package/src/client/components/common/SignOutButton.tsx +94 -0
  162. package/src/client/components/common/StatCard.tsx +52 -0
  163. package/src/client/components/common/StreamStatusDot.tsx +27 -0
  164. package/src/client/components/common/SubagentStatusIcon.tsx +27 -0
  165. package/src/client/components/common/Toast.tsx +79 -0
  166. package/src/client/components/common/ToastStack.tsx +18 -0
  167. package/src/client/components/common/UpdateLog.tsx +55 -0
  168. package/src/client/components/common/ViewportSelector.tsx +206 -0
  169. package/src/client/components/common/brand-wordmark/index.test.tsx +93 -0
  170. package/src/client/components/common/brand-wordmark/index.tsx +35 -0
  171. package/src/client/components/common/code-editor/handler.test.ts +274 -0
  172. package/src/client/components/common/code-editor/handler.ts +175 -0
  173. package/src/client/components/common/code-editor/index.tsx +314 -0
  174. package/src/client/components/common/code-surface/index.tsx +348 -0
  175. package/src/client/components/common/code-surface/measure.ts +148 -0
  176. package/src/client/components/common/context-usage-button/Ring.tsx +73 -0
  177. package/src/client/components/common/context-usage-button/index.test.tsx +197 -0
  178. package/src/client/components/common/context-usage-button/index.tsx +159 -0
  179. package/src/client/components/common/diagram-viewer/index.tsx +258 -0
  180. package/src/client/components/common/diagram-viewer/read-block.ts +53 -0
  181. package/src/client/components/common/file-icon/brand-paths.ts +62 -0
  182. package/src/client/components/common/file-icon/index.tsx +166 -0
  183. package/src/client/components/common/header-controls/index.test.tsx +240 -0
  184. package/src/client/components/common/header-controls/index.tsx +118 -0
  185. package/src/client/components/common/header-panel-buttons/index.tsx +176 -0
  186. package/src/client/components/common/image-viewer/index.tsx +224 -0
  187. package/src/client/components/common/outline-kind-icon/index.tsx +86 -0
  188. package/src/client/components/common/provider-icon/glyphs.test.ts +94 -0
  189. package/src/client/components/common/provider-icon/glyphs.ts +118 -0
  190. package/src/client/components/common/provider-icon/index.plugin.test.ts +133 -0
  191. package/src/client/components/common/provider-icon/index.test.ts +107 -0
  192. package/src/client/components/common/provider-icon/index.tsx +104 -0
  193. package/src/client/components/common/provider-icon/resolve.test.ts +112 -0
  194. package/src/client/components/common/provider-icon/resolve.ts +94 -0
  195. package/src/client/components/common/session-actions-menu/index.tsx +220 -0
  196. package/src/client/components/common/session-delete-modal/index.tsx +128 -0
  197. package/src/client/components/common/session-state-provider/index.test.ts +142 -0
  198. package/src/client/components/common/session-state-provider/index.tsx +60 -0
  199. package/src/client/components/common/sort-menu/index.tsx +63 -0
  200. package/src/client/components/common/sort-menu/options.ts +24 -0
  201. package/src/client/components/common/subagent-list/index.tsx +165 -0
  202. package/src/client/components/common/todo-row/index.test.ts +91 -0
  203. package/src/client/components/common/todo-row/index.tsx +92 -0
  204. package/src/client/components/common/viewport.ts +23 -0
  205. package/src/client/components/common/workspace-options-menu/index.tsx +99 -0
  206. package/src/client/components/layout/PanelVisibilityMenu.tsx +114 -0
  207. package/src/client/components/layout/RightActivityBar.test.ts +272 -0
  208. package/src/client/components/layout/RightActivityBar.tsx +220 -0
  209. package/src/client/components/layout/desktop-layout/ResizeHandle.tsx +10 -0
  210. package/src/client/components/layout/desktop-layout/TopNavbar.tsx +167 -0
  211. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +326 -0
  212. package/src/client/components/layout/desktop-layout/index.tsx +307 -0
  213. package/src/client/components/layout/desktop-layout/resizer/index.tsx +312 -0
  214. package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +145 -0
  215. package/src/client/components/layout/desktop-layout/resizer/separator-drag.ts +140 -0
  216. package/src/client/components/layout/desktop-layout/resizer/utils.test.ts +33 -0
  217. package/src/client/components/layout/desktop-layout/resizer/utils.ts +34 -0
  218. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +316 -0
  219. package/src/client/components/layout/session-sidebar/Footer.tsx +54 -0
  220. package/src/client/components/layout/session-sidebar/Header.test.ts +88 -0
  221. package/src/client/components/layout/session-sidebar/Header.tsx +57 -0
  222. package/src/client/components/layout/session-sidebar/Modals.tsx +15 -0
  223. package/src/client/components/layout/session-sidebar/OverflowMenu.test.ts +115 -0
  224. package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +117 -0
  225. package/src/client/components/layout/session-sidebar/SessionItem.test.ts +106 -0
  226. package/src/client/components/layout/session-sidebar/SessionItem.tsx +213 -0
  227. package/src/client/components/layout/session-sidebar/SessionList.tsx +51 -0
  228. package/src/client/components/layout/session-sidebar/Skeleton.tsx +36 -0
  229. package/src/client/components/layout/session-sidebar/Toolbar.test.ts +132 -0
  230. package/src/client/components/layout/session-sidebar/Toolbar.tsx +273 -0
  231. package/src/client/components/layout/session-sidebar/about-modal/SocialLinks.tsx +59 -0
  232. package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +179 -0
  233. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +83 -0
  234. package/src/client/components/layout/session-sidebar/index.tsx +196 -0
  235. package/src/client/components/layout/session-sidebar/new-workspace-modal/CloneField.tsx +83 -0
  236. package/src/client/components/layout/session-sidebar/new-workspace-modal/DirectoryList.tsx +150 -0
  237. package/src/client/components/layout/session-sidebar/new-workspace-modal/LocationBar.tsx +101 -0
  238. package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +304 -0
  239. package/src/client/components/layout/session-sidebar/new-workspace-modal/use-browse.ts +81 -0
  240. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +216 -0
  241. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +217 -0
  242. package/src/client/components/layout/session-sidebar/scheduler-modal/folders.ts +52 -0
  243. package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +211 -0
  244. package/src/client/components/layout/update-popup/Actions.tsx +114 -0
  245. package/src/client/components/layout/update-popup/ReleaseNotes.tsx +77 -0
  246. package/src/client/components/layout/update-popup/index.tsx +131 -0
  247. package/src/client/components/mobile/LayoutWrapper.tsx +269 -0
  248. package/src/client/components/mobile/MainView.tsx +68 -0
  249. package/src/client/components/mobile/RightSidebar.tsx +154 -0
  250. package/src/client/components/mobile/SessionSidebar.tsx +223 -0
  251. package/src/client/components/mobile/mobile-main-view/Header.tsx +211 -0
  252. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +84 -0
  253. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +317 -0
  254. package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +156 -0
  255. package/src/client/components/mobile/mobile-right-sidebar/OutlineButton.tsx +100 -0
  256. package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +90 -0
  257. package/src/client/components/mobile/mobile-session-sidebar/Footer.tsx +69 -0
  258. package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +34 -0
  259. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +290 -0
  260. package/src/client/components/mobile/mobile-session-sidebar/List.tsx +55 -0
  261. package/src/client/components/mobile/mobile-session-sidebar/SessionRow.test.ts +122 -0
  262. package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +181 -0
  263. package/src/client/components/mobile/mobile-session-sidebar/Skeleton.tsx +36 -0
  264. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.test.ts +133 -0
  265. package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +223 -0
  266. package/src/client/components/mobile/open-file-payload.test.ts +71 -0
  267. package/src/client/components/mobile/open-file-payload.ts +60 -0
  268. package/src/client/components/settings/LazyModal.tsx +46 -0
  269. package/src/client/components/settings/LoadingState.tsx +22 -0
  270. package/src/client/components/settings/Modal.tsx +342 -0
  271. package/src/client/components/settings/ProjectSelectorDropdown.tsx +148 -0
  272. package/src/client/components/settings/SettingsSidebarList.tsx +126 -0
  273. package/src/client/components/settings/Sidebar.test.tsx +118 -0
  274. package/src/client/components/settings/Sidebar.tsx +172 -0
  275. package/src/client/components/settings/categories/AgentSettings.tsx +101 -0
  276. package/src/client/components/settings/categories/AppearanceSettings.tsx +30 -0
  277. package/src/client/components/settings/categories/BehaviorSettings.tsx +73 -0
  278. package/src/client/components/settings/categories/ChatSettings.tsx +30 -0
  279. package/src/client/components/settings/categories/CommandSettings.tsx +136 -0
  280. package/src/client/components/settings/categories/McpSettings.tsx +159 -0
  281. package/src/client/components/settings/categories/NotificationSettings.tsx +97 -0
  282. package/src/client/components/settings/categories/OmpSettings.tsx +321 -0
  283. package/src/client/components/settings/categories/OtherSettings.tsx +16 -0
  284. package/src/client/components/settings/categories/PanelPluginSettings.tsx +25 -0
  285. package/src/client/components/settings/categories/PluginSettings.tsx +162 -0
  286. package/src/client/components/settings/categories/ProjectSettings.tsx +195 -0
  287. package/src/client/components/settings/categories/ProviderSettings.tsx +225 -0
  288. package/src/client/components/settings/categories/SkillCatalogSettings.tsx +289 -0
  289. package/src/client/components/settings/categories/SkillSettings.tsx +130 -0
  290. package/src/client/components/settings/categories/TokenUsageSettings.tsx +264 -0
  291. package/src/client/components/settings/categories/UsageSettings.tsx +109 -0
  292. package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +333 -0
  293. package/src/client/components/settings/categories/agent-settings/SidebarList.tsx +42 -0
  294. package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +78 -0
  295. package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +61 -0
  296. package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +80 -0
  297. package/src/client/components/settings/categories/behavior-settings/Editor.tsx +244 -0
  298. package/src/client/components/settings/categories/chat-settings/FollowUpSection.tsx +120 -0
  299. package/src/client/components/settings/categories/chat-settings/GoalSection.tsx +195 -0
  300. package/src/client/components/settings/categories/chat-settings/KeybindingsSection.tsx +107 -0
  301. package/src/client/components/settings/categories/chat-settings/TitleSection.tsx +99 -0
  302. package/src/client/components/settings/categories/command-settings/DetailPane.tsx +298 -0
  303. package/src/client/components/settings/categories/command-settings/SidebarList.tsx +44 -0
  304. package/src/client/components/settings/categories/mcp-settings/ConnectionTest.tsx +89 -0
  305. package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +311 -0
  306. package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +161 -0
  307. package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +120 -0
  308. package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +254 -0
  309. package/src/client/components/settings/categories/omp-settings/ExtensionsPanel.tsx +61 -0
  310. package/src/client/components/settings/categories/omp-settings/RoleEditor.test.ts +94 -0
  311. package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +148 -0
  312. package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +337 -0
  313. package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +108 -0
  314. package/src/client/components/settings/categories/panel-plugins/BuiltinList.tsx +95 -0
  315. package/src/client/components/settings/categories/panel-plugins/GitFreshness.test.tsx +232 -0
  316. package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +81 -0
  317. package/src/client/components/settings/categories/panel-plugins/InstallForm.tsx +136 -0
  318. package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +221 -0
  319. package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +142 -0
  320. package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +114 -0
  321. package/src/client/components/settings/categories/panel-plugins/ReadmeModal.tsx +87 -0
  322. package/src/client/components/settings/categories/panel-plugins/Section.tsx +184 -0
  323. package/src/client/components/settings/categories/panel-plugins/SyncBlockedNotice.tsx +82 -0
  324. package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +85 -0
  325. package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +285 -0
  326. package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +303 -0
  327. package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +209 -0
  328. package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +250 -0
  329. package/src/client/components/settings/categories/plugin-settings/selection.ts +19 -0
  330. package/src/client/components/settings/categories/project-settings/AccentPalette.tsx +76 -0
  331. package/src/client/components/settings/categories/project-settings/DetailsForm.tsx +71 -0
  332. package/src/client/components/settings/categories/project-settings/DetailsHeader.tsx +38 -0
  333. package/src/client/components/settings/categories/project-settings/IconGrid.tsx +152 -0
  334. package/src/client/components/settings/categories/project-settings/ModelDropdown.tsx +95 -0
  335. package/src/client/components/settings/categories/project-settings/NameInput.tsx +26 -0
  336. package/src/client/components/settings/categories/project-settings/SidebarList.tsx +100 -0
  337. package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +322 -0
  338. package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +334 -0
  339. package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +195 -0
  340. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +133 -0
  341. package/src/client/components/settings/categories/provider-settings/DialectFields.tsx +136 -0
  342. package/src/client/components/settings/categories/provider-settings/EffortLadder.tsx +89 -0
  343. package/src/client/components/settings/categories/provider-settings/Header.tsx +22 -0
  344. package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +224 -0
  345. package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +184 -0
  346. package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +114 -0
  347. package/src/client/components/settings/categories/provider-settings/ModelConfigModal.tsx +155 -0
  348. package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +221 -0
  349. package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +82 -0
  350. package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +107 -0
  351. package/src/client/components/settings/categories/provider-settings/ReconnectModal.tsx +184 -0
  352. package/src/client/components/settings/categories/provider-settings/SidebarList.plugin.test.ts +93 -0
  353. package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +133 -0
  354. package/src/client/components/settings/categories/skill-catalog/AddSourceModal.tsx +133 -0
  355. package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +309 -0
  356. package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +170 -0
  357. package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +127 -0
  358. package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +74 -0
  359. package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +44 -0
  360. package/src/client/components/settings/categories/usage-settings/DeepSeekCard.tsx +66 -0
  361. package/src/client/components/settings/categories/usage-settings/KenariCard.tsx +68 -0
  362. package/src/client/components/settings/categories/usage-settings/LimitsSection.tsx +115 -0
  363. package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +45 -0
  364. package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +46 -0
  365. package/src/client/components/settings/categories/usage-settings/QuotaSection.tsx +93 -0
  366. package/src/client/components/settings/categories/usage-settings/SavedResetsSection.tsx +158 -0
  367. package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +89 -0
  368. package/src/client/components/settings/categories/usage-settings/UsageTable.tsx +66 -0
  369. package/src/client/components/settings/categories/usage-settings/format.ts +99 -0
  370. package/src/client/components/settings/categories/usage-settings/providers.ts +69 -0
  371. package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +330 -0
  372. package/src/client/components/settings/master-detail/index.tsx +68 -0
  373. package/src/client/components/workspace/browser-panel/ActivityToasts.tsx +46 -0
  374. package/src/client/components/workspace/browser-panel/AddressBar.tsx +75 -0
  375. package/src/client/components/workspace/browser-panel/Screencast.tsx +108 -0
  376. package/src/client/components/workspace/browser-panel/index.tsx +69 -0
  377. package/src/client/components/workspace/browser-toolbar/ZoomControls.tsx +48 -0
  378. package/src/client/components/workspace/browser-toolbar/index.tsx +150 -0
  379. package/src/client/components/workspace/btw-panel/AskCard.tsx +165 -0
  380. package/src/client/components/workspace/btw-panel/Messages.tsx +154 -0
  381. package/src/client/components/workspace/btw-panel/TopicMenu.tsx +106 -0
  382. package/src/client/components/workspace/btw-panel/index.tsx +163 -0
  383. package/src/client/components/workspace/chat-timeline/AiMessageFooter.plugin.test.ts +105 -0
  384. package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +277 -0
  385. package/src/client/components/workspace/chat-timeline/AttachmentChips.tsx +119 -0
  386. package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +108 -0
  387. package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +167 -0
  388. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +261 -0
  389. package/src/client/components/workspace/chat-timeline/GeneratingIndicator.test.ts +156 -0
  390. package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +156 -0
  391. package/src/client/components/workspace/chat-timeline/GoalNotice.tsx +63 -0
  392. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +289 -0
  393. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +76 -0
  394. package/src/client/components/workspace/chat-timeline/MessageList.tsx +117 -0
  395. package/src/client/components/workspace/chat-timeline/MinimapShortcuts.test.ts +119 -0
  396. package/src/client/components/workspace/chat-timeline/MinimapShortcuts.tsx +96 -0
  397. package/src/client/components/workspace/chat-timeline/MobileTurnJump.tsx +104 -0
  398. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +124 -0
  399. package/src/client/components/workspace/chat-timeline/PluginMessageActions.test.ts +102 -0
  400. package/src/client/components/workspace/chat-timeline/PluginMessageActions.tsx +51 -0
  401. package/src/client/components/workspace/chat-timeline/QueueList.test.ts +82 -0
  402. package/src/client/components/workspace/chat-timeline/QueueList.tsx +86 -0
  403. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +82 -0
  404. package/src/client/components/workspace/chat-timeline/SessionSkeleton.tsx +89 -0
  405. package/src/client/components/workspace/chat-timeline/SubagentControls.tsx +93 -0
  406. package/src/client/components/workspace/chat-timeline/SubagentView.tsx +181 -0
  407. package/src/client/components/workspace/chat-timeline/SystemNotice.test.ts +175 -0
  408. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +296 -0
  409. package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +176 -0
  410. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +130 -0
  411. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +135 -0
  412. package/src/client/components/workspace/chat-timeline/ToolCallCard.plugin.test.ts +111 -0
  413. package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +194 -0
  414. package/src/client/components/workspace/chat-timeline/ToolCallingSection.test.ts +161 -0
  415. package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +101 -0
  416. package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +90 -0
  417. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +53 -0
  418. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +121 -0
  419. package/src/client/components/workspace/chat-timeline/chat-input/DropOverlay.tsx +17 -0
  420. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +180 -0
  421. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +236 -0
  422. package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +320 -0
  423. package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +67 -0
  424. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +99 -0
  425. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +102 -0
  426. package/src/client/components/workspace/chat-timeline/chat-input/PluginComposerSlots.test.ts +110 -0
  427. package/src/client/components/workspace/chat-timeline/chat-input/PluginComposerSlots.tsx +61 -0
  428. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +49 -0
  429. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +155 -0
  430. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +216 -0
  431. package/src/client/components/workspace/chat-timeline/chat-input/VoiceNotice.tsx +39 -0
  432. package/src/client/components/workspace/chat-timeline/chat-input/access-levels.ts +14 -0
  433. package/src/client/components/workspace/chat-timeline/chat-input/expansion.test.ts +86 -0
  434. package/src/client/components/workspace/chat-timeline/chat-input/expansion.ts +143 -0
  435. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +283 -0
  436. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +49 -0
  437. package/src/client/components/workspace/chat-timeline/chat-input/props.ts +100 -0
  438. package/src/client/components/workspace/chat-timeline/chat-input/selection.ts +57 -0
  439. package/src/client/components/workspace/chat-timeline/index.tsx +335 -0
  440. package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +159 -0
  441. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl.tsx +151 -0
  442. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/GroupedAsk.tsx +232 -0
  443. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +85 -0
  444. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.test.ts +288 -0
  445. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/PluginPendingInteractions.tsx +186 -0
  446. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +162 -0
  447. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +100 -0
  448. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/drafts.ts +113 -0
  449. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.test.ts +139 -0
  450. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +193 -0
  451. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Footer.tsx +97 -0
  452. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Header.tsx +52 -0
  453. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Lazy.tsx +24 -0
  454. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/SelectBody.tsx +110 -0
  455. package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +338 -0
  456. package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +93 -0
  457. package/src/client/components/workspace/chat-timeline/tool-renderers/index.tsx +172 -0
  458. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +203 -0
  459. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +279 -0
  460. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Checkpoint.tsx +49 -0
  461. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ContextNotes.tsx +66 -0
  462. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +91 -0
  463. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.test.ts +177 -0
  464. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +286 -0
  465. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +184 -0
  466. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Github.tsx +91 -0
  467. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +254 -0
  468. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +122 -0
  469. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +276 -0
  470. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +93 -0
  471. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +143 -0
  472. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Memory.tsx +93 -0
  473. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.test.ts +241 -0
  474. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +309 -0
  475. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +229 -0
  476. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +342 -0
  477. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +96 -0
  478. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchFs.tsx +132 -0
  479. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchTool.tsx +318 -0
  480. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +102 -0
  481. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +240 -0
  482. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Think.tsx +52 -0
  483. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.test.ts +119 -0
  484. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +110 -0
  485. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +276 -0
  486. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +328 -0
  487. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +118 -0
  488. package/src/client/components/workspace/chat-timeline/tool-renderers/plugin-renderers.test.ts +73 -0
  489. package/src/client/components/workspace/chat-timeline/tool-renderers/plugin-renderers.ts +40 -0
  490. package/src/client/components/workspace/chat-timeline/tool-renderers/registry.test.ts +215 -0
  491. package/src/client/components/workspace/chat-timeline/tool-renderers/registry.ts +167 -0
  492. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactBody.test.ts +103 -0
  493. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactBody.tsx +132 -0
  494. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +174 -0
  495. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.test.ts +99 -0
  496. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +162 -0
  497. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +59 -0
  498. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ExcerptCode.tsx +107 -0
  499. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +57 -0
  500. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/JsonCodeBlock.tsx +79 -0
  501. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/OutputWindow.tsx +62 -0
  502. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolCardShell.test.ts +148 -0
  503. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolCardShell.tsx +210 -0
  504. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +117 -0
  505. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader.tsx +63 -0
  506. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.test.ts +190 -0
  507. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-header.ts +160 -0
  508. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/card-helpers.tsx +175 -0
  509. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/read-line-meta.test.ts +102 -0
  510. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/read-line-meta.ts +95 -0
  511. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-input.test.ts +55 -0
  512. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-input.ts +18 -0
  513. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/truncate.test.ts +53 -0
  514. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/truncate.ts +18 -0
  515. package/src/client/components/workspace/context-panel/CostBreakdownPopover.tsx +74 -0
  516. package/src/client/components/workspace/context-panel/LastMessageCard.tsx +34 -0
  517. package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +94 -0
  518. package/src/client/components/workspace/context-panel/RawMessagesList.tsx +288 -0
  519. package/src/client/components/workspace/context-panel/StatsGrid.tsx +64 -0
  520. package/src/client/components/workspace/context-panel/TokenDistributionBar.tsx +62 -0
  521. package/src/client/components/workspace/context-panel/WindowCard.tsx +35 -0
  522. package/src/client/components/workspace/context-panel/index.tsx +170 -0
  523. package/src/client/components/workspace/context-panel/pure-helpers.test.ts +264 -0
  524. package/src/client/components/workspace/context-panel/raw-messages.ts +54 -0
  525. package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +85 -0
  526. package/src/client/components/workspace/diff-panel/SplitView.tsx +209 -0
  527. package/src/client/components/workspace/diff-panel/Toolbar.tsx +281 -0
  528. package/src/client/components/workspace/diff-panel/UnifiedView.tsx +150 -0
  529. package/src/client/components/workspace/diff-panel/index.tsx +341 -0
  530. package/src/client/components/workspace/editor/Body.tsx +127 -0
  531. package/src/client/components/workspace/editor/CommandPalette.test.ts +242 -0
  532. package/src/client/components/workspace/editor/CommandPalette.tsx +138 -0
  533. package/src/client/components/workspace/editor/EditorDropOverlay.tsx +24 -0
  534. package/src/client/components/workspace/editor/FileDocument.tsx +150 -0
  535. package/src/client/components/workspace/editor/FilePane.tsx +228 -0
  536. package/src/client/components/workspace/editor/FindWidget.test.ts +262 -0
  537. package/src/client/components/workspace/editor/FindWidget.tsx +219 -0
  538. package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +80 -0
  539. package/src/client/components/workspace/editor/Tabs.test.ts +128 -0
  540. package/src/client/components/workspace/editor/Tabs.tsx +159 -0
  541. package/src/client/components/workspace/editor/Toolbar.tsx +239 -0
  542. package/src/client/components/workspace/editor/index.tsx +339 -0
  543. package/src/client/components/workspace/editor/plugin-file-view.test.ts +183 -0
  544. package/src/client/components/workspace/editor/plugin-file-view.tsx +159 -0
  545. package/src/client/components/workspace/editor/viewers/CsvGrid.tsx +33 -0
  546. package/src/client/components/workspace/editor/viewers/DataGrid.tsx +102 -0
  547. package/src/client/components/workspace/editor/viewers/DocxView.tsx +72 -0
  548. package/src/client/components/workspace/editor/viewers/ImageView.tsx +43 -0
  549. package/src/client/components/workspace/editor/viewers/PdfView.tsx +56 -0
  550. package/src/client/components/workspace/editor/viewers/SheetView.tsx +115 -0
  551. package/src/client/components/workspace/editor/viewers/SvgPreview.tsx +50 -0
  552. package/src/client/components/workspace/editor/viewers/ViewerError.tsx +32 -0
  553. package/src/client/components/workspace/editor/viewers/bytes.test.ts +239 -0
  554. package/src/client/components/workspace/editor/viewers/bytes.ts +114 -0
  555. package/src/client/components/workspace/editor/viewers/dispatch.tsx +130 -0
  556. package/src/client/components/workspace/editor/viewers/mammoth-browser.d.ts +36 -0
  557. package/src/client/components/workspace/editor/viewers/use-byte-document.test.ts +170 -0
  558. package/src/client/components/workspace/editor/viewers/use-byte-document.ts +73 -0
  559. package/src/client/components/workspace/editor/viewers/use-byte-url.test.ts +259 -0
  560. package/src/client/components/workspace/editor/viewers/use-byte-url.ts +118 -0
  561. package/src/client/components/workspace/editor/viewers/viewers.test.ts +233 -0
  562. package/src/client/components/workspace/file-explorer/ContextMenu.tsx +142 -0
  563. package/src/client/components/workspace/file-explorer/Modals.tsx +229 -0
  564. package/src/client/components/workspace/file-explorer/OutlineSection.test.tsx +218 -0
  565. package/src/client/components/workspace/file-explorer/OutlineSection.tsx +135 -0
  566. package/src/client/components/workspace/file-explorer/RootMenu.tsx +81 -0
  567. package/src/client/components/workspace/file-explorer/TreeItem.tsx +310 -0
  568. package/src/client/components/workspace/file-explorer/clipboard.test.ts +171 -0
  569. package/src/client/components/workspace/file-explorer/drag.test.ts +148 -0
  570. package/src/client/components/workspace/file-explorer/index.test.ts +130 -0
  571. package/src/client/components/workspace/file-explorer/index.tsx +336 -0
  572. package/src/client/components/workspace/file-explorer/root-menu.test.ts +79 -0
  573. package/src/client/components/workspace/git-panel/BranchToolbar.tsx +252 -0
  574. package/src/client/components/workspace/git-panel/ChangesList.tsx +217 -0
  575. package/src/client/components/workspace/git-panel/CommitBox.tsx +108 -0
  576. package/src/client/components/workspace/git-panel/ConflictItem.tsx +128 -0
  577. package/src/client/components/workspace/git-panel/FileItem.tsx +99 -0
  578. package/src/client/components/workspace/git-panel/Modals.tsx +97 -0
  579. package/src/client/components/workspace/git-panel/OperationBar.tsx +95 -0
  580. package/src/client/components/workspace/git-panel/PanelModals.tsx +110 -0
  581. package/src/client/components/workspace/git-panel/RepoHeader.tsx +68 -0
  582. package/src/client/components/workspace/git-panel/StashSection.test.tsx +243 -0
  583. package/src/client/components/workspace/git-panel/StashSection.tsx +246 -0
  584. package/src/client/components/workspace/git-panel/TreeItem.tsx +192 -0
  585. package/src/client/components/workspace/git-panel/TreeView.tsx +36 -0
  586. package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +164 -0
  587. package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +109 -0
  588. package/src/client/components/workspace/git-panel/branch-modal/RenameDialog.tsx +154 -0
  589. package/src/client/components/workspace/git-panel/branch-modal/index.tsx +229 -0
  590. package/src/client/components/workspace/git-panel/commit-modal/CommitActions.tsx +89 -0
  591. package/src/client/components/workspace/git-panel/commit-modal/CommitDiffViewer.tsx +285 -0
  592. package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +128 -0
  593. package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +231 -0
  594. package/src/client/components/workspace/git-panel/commit-modal/GraphCanvas.tsx +167 -0
  595. package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +144 -0
  596. package/src/client/components/workspace/git-panel/commit-modal/index.tsx +330 -0
  597. package/src/client/components/workspace/git-panel/confirm-request.test.ts +72 -0
  598. package/src/client/components/workspace/git-panel/confirm-request.ts +92 -0
  599. package/src/client/components/workspace/git-panel/index.test.ts +332 -0
  600. package/src/client/components/workspace/git-panel/index.tsx +342 -0
  601. package/src/client/components/workspace/model-dropdown/Footer.tsx +21 -0
  602. package/src/client/components/workspace/model-dropdown/Header.tsx +50 -0
  603. package/src/client/components/workspace/model-dropdown/Item.plugin.test.ts +90 -0
  604. package/src/client/components/workspace/model-dropdown/Item.tsx +127 -0
  605. package/src/client/components/workspace/model-dropdown/Panel.tsx +146 -0
  606. package/src/client/components/workspace/model-dropdown/Section.tsx +96 -0
  607. package/src/client/components/workspace/model-dropdown/Skeleton.tsx +39 -0
  608. package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +91 -0
  609. package/src/client/components/workspace/model-dropdown/groups.ts +95 -0
  610. package/src/client/components/workspace/model-dropdown/index.tsx +290 -0
  611. package/src/client/components/workspace/model-dropdown/use-catalog.ts +135 -0
  612. package/src/client/components/workspace/panels/builtin.test.ts +79 -0
  613. package/src/client/components/workspace/panels/builtin.tsx +193 -0
  614. package/src/client/components/workspace/plan-panel/Nav.tsx +93 -0
  615. package/src/client/components/workspace/plan-panel/PageView.tsx +91 -0
  616. package/src/client/components/workspace/plan-panel/index.tsx +188 -0
  617. package/src/client/components/workspace/plugin-panel/Error.tsx +37 -0
  618. package/src/client/components/workspace/plugin-panel/RowScope.test.tsx +197 -0
  619. package/src/client/components/workspace/plugin-panel/resolve.tsx +263 -0
  620. package/src/client/components/workspace/repo-picker/Modal.test.tsx +260 -0
  621. package/src/client/components/workspace/repo-picker/Modal.tsx +238 -0
  622. package/src/client/components/workspace/repo-picker/Row.tsx +223 -0
  623. package/src/client/components/workspace/repo-picker/index.test.tsx +137 -0
  624. package/src/client/components/workspace/repo-picker/index.tsx +92 -0
  625. package/src/client/components/workspace/search-panel/Body.tsx +274 -0
  626. package/src/client/components/workspace/search-panel/Results.tsx +188 -0
  627. package/src/client/components/workspace/search-panel/Row.tsx +86 -0
  628. package/src/client/components/workspace/search-panel/index.tsx +132 -0
  629. package/src/client/components/workspace/terminal-panel/Header.test.ts +99 -0
  630. package/src/client/components/workspace/terminal-panel/Header.tsx +90 -0
  631. package/src/client/components/workspace/terminal-panel/KeyBar.tsx +194 -0
  632. package/src/client/components/workspace/terminal-panel/QuickActions.tsx +39 -0
  633. package/src/client/components/workspace/terminal-panel/RealtimeXtermView.tsx +168 -0
  634. package/src/client/components/workspace/terminal-panel/index.tsx +231 -0
  635. package/src/client/components/workspace/terminal-panel/mount.ts +322 -0
  636. package/src/client/components/workspace/todo-panel/PhaseGroup.tsx +76 -0
  637. package/src/client/components/workspace/todo-panel/index.tsx +169 -0
  638. package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +213 -0
  639. package/src/client/components/workspace/usage-panel/index.tsx +124 -0
  640. package/src/client/components/workspace/usage-panel/report.test.ts +61 -0
  641. package/src/client/components/workspace/usage-panel/report.ts +36 -0
  642. package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +134 -0
  643. package/src/client/components/workspace/user-browser-panel/Frame.tsx +72 -0
  644. package/src/client/components/workspace/user-browser-panel/index.tsx +87 -0
  645. package/src/client/components/workspace/wiki-panel/Nav.tsx +140 -0
  646. package/src/client/components/workspace/wiki-panel/PageView.tsx +126 -0
  647. package/src/client/components/workspace/wiki-panel/index.tsx +245 -0
  648. package/src/client/data/agent-data/builtin.ts +31 -0
  649. package/src/client/data/agent-data/index.ts +10 -0
  650. package/src/client/data/agent-data/orchestrator.ts +113 -0
  651. package/src/client/data/agent-data/specialist.ts +245 -0
  652. package/src/client/data/context-data/index.test.ts +120 -0
  653. package/src/client/data/context-data/index.ts +312 -0
  654. package/src/client/data/context-data/presets.ts +128 -0
  655. package/src/client/data/mock/chat.ts +236 -0
  656. package/src/client/data/mock/git-commits.ts +309 -0
  657. package/src/client/data/mock/subagents.ts +212 -0
  658. package/src/client/data/mock/token-usage.ts +129 -0
  659. package/src/client/data/models/catalog.ts +301 -0
  660. package/src/client/data/samples/dialogue-session.ts +285 -0
  661. package/src/client/data/samples/sample-subagents/scout-raw.ts +341 -0
  662. package/src/client/data/samples/sample-subagents/sleeper-raw.ts +294 -0
  663. package/src/client/data/samples/sample-tools/built-in-part1.ts +303 -0
  664. package/src/client/data/samples/sample-tools/built-in-part2.ts +200 -0
  665. package/src/client/data/samples/sample-tools/other.ts +162 -0
  666. package/src/client/data/samples/subagent-session.ts +99 -0
  667. package/src/client/data/samples/tools-session.ts +85 -0
  668. package/src/client/data/samples/virtual-devices-internal-url.ts +141 -0
  669. package/src/client/data/samples/virtual-devices-session.ts +336 -0
  670. package/src/client/data/settings/behavior.ts +12 -0
  671. package/src/client/data/settings/command.ts +148 -0
  672. package/src/client/data/settings/mcp.ts +28 -0
  673. package/src/client/data/settings/omp-schema.json +8380 -0
  674. package/src/client/data/settings/plugin.ts +127 -0
  675. package/src/client/data/settings/project.ts +58 -0
  676. package/src/client/data/settings/provider.ts +317 -0
  677. package/src/client/data/settings/skill.ts +340 -0
  678. package/src/client/data/theme/terminal.ts +163 -0
  679. package/src/client/hooks/browser/use-screencast.ts +178 -0
  680. package/src/client/hooks/browser/use-user-browser.ts +105 -0
  681. package/src/client/hooks/chat/btw/index.ts +238 -0
  682. package/src/client/hooks/chat/btw/intercept.test.ts +99 -0
  683. package/src/client/hooks/chat/btw/intercept.ts +46 -0
  684. package/src/client/hooks/chat/btw/mode.ts +209 -0
  685. package/src/client/hooks/chat/composer/attachments.test.ts +211 -0
  686. package/src/client/hooks/chat/composer/attachments.ts +198 -0
  687. package/src/client/hooks/chat/composer/auto-grow.test.ts +142 -0
  688. package/src/client/hooks/chat/composer/auto-grow.ts +51 -0
  689. package/src/client/hooks/chat/composer/browser-context.ts +40 -0
  690. package/src/client/hooks/chat/composer/drop-entries.test.ts +234 -0
  691. package/src/client/hooks/chat/composer/drop-entries.ts +204 -0
  692. package/src/client/hooks/chat/composer/drop-payload.test.ts +97 -0
  693. package/src/client/hooks/chat/composer/drop-payload.ts +130 -0
  694. package/src/client/hooks/chat/composer/drop-references.ts +106 -0
  695. package/src/client/hooks/chat/composer/file-drop.test.ts +194 -0
  696. package/src/client/hooks/chat/composer/file-drop.ts +226 -0
  697. package/src/client/hooks/chat/composer/file-reads.test.ts +211 -0
  698. package/src/client/hooks/chat/composer/file-reads.ts +238 -0
  699. package/src/client/hooks/chat/composer/index.ts +213 -0
  700. package/src/client/hooks/chat/composer/items.test.ts +327 -0
  701. package/src/client/hooks/chat/composer/items.ts +100 -0
  702. package/src/client/hooks/chat/composer/model-selection.ts +197 -0
  703. package/src/client/hooks/chat/composer/pipeline.test.ts +260 -0
  704. package/src/client/hooks/chat/composer/pipeline.ts +183 -0
  705. package/src/client/hooks/chat/composer/publish-state.ts +80 -0
  706. package/src/client/hooks/chat/composer/speech-to-text.ts +214 -0
  707. package/src/client/hooks/chat/composer/use-draft.ts +33 -0
  708. package/src/client/hooks/chat/composer/voice-input.ts +71 -0
  709. package/src/client/hooks/chat/context/telemetry.ts +66 -0
  710. package/src/client/hooks/chat/omp/index-probe.test.ts +164 -0
  711. package/src/client/hooks/chat/omp/index.ts +276 -0
  712. package/src/client/hooks/chat/omp/owner-redirect.test.ts +74 -0
  713. package/src/client/hooks/chat/omp/owner-redirect.ts +44 -0
  714. package/src/client/hooks/chat/omp/pending-rows.ts +103 -0
  715. package/src/client/hooks/chat/omp/pending-sessions.test.ts +314 -0
  716. package/src/client/hooks/chat/omp/pending-sessions.ts +296 -0
  717. package/src/client/hooks/chat/omp/prompt-send.test.ts +280 -0
  718. package/src/client/hooks/chat/omp/prompt-send.ts +187 -0
  719. package/src/client/hooks/chat/omp/run-switch.test.ts +69 -0
  720. package/src/client/hooks/chat/omp/run-switch.ts +52 -0
  721. package/src/client/hooks/chat/omp/session-list.test.ts +283 -0
  722. package/src/client/hooks/chat/omp/session-list.tsx +289 -0
  723. package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +234 -0
  724. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +285 -0
  725. package/src/client/hooks/chat/omp/session-statuses.test.ts +277 -0
  726. package/src/client/hooks/chat/omp/session-statuses.ts +129 -0
  727. package/src/client/hooks/chat/omp/sidebar-overlay.ts +73 -0
  728. package/src/client/hooks/chat/omp/status.ts +12 -0
  729. package/src/client/hooks/chat/omp/stream-rpc.test.ts +188 -0
  730. package/src/client/hooks/chat/omp/stream.test.ts +223 -0
  731. package/src/client/hooks/chat/omp/stream.ts +149 -0
  732. package/src/client/hooks/chat/stream.ts +228 -0
  733. package/src/client/hooks/chat/subagent/index.ts +309 -0
  734. package/src/client/hooks/chat/timeline/access-mode.ts +41 -0
  735. package/src/client/hooks/chat/timeline/actions.test.ts +310 -0
  736. package/src/client/hooks/chat/timeline/actions.ts +335 -0
  737. package/src/client/hooks/chat/timeline/ask-frames-grouped.test.ts +76 -0
  738. package/src/client/hooks/chat/timeline/ask-frames.test.ts +151 -0
  739. package/src/client/hooks/chat/timeline/ask-frames.ts +172 -0
  740. package/src/client/hooks/chat/timeline/auto-scroll.ts +67 -0
  741. package/src/client/hooks/chat/timeline/composer-local-actions.test.ts +349 -0
  742. package/src/client/hooks/chat/timeline/composer-modes.ts +32 -0
  743. package/src/client/hooks/chat/timeline/deferred-model.test.ts +224 -0
  744. package/src/client/hooks/chat/timeline/deferred-model.ts +92 -0
  745. package/src/client/hooks/chat/timeline/extension-dialog.ts +59 -0
  746. package/src/client/hooks/chat/timeline/generating.test.ts +103 -0
  747. package/src/client/hooks/chat/timeline/generating.ts +106 -0
  748. package/src/client/hooks/chat/timeline/goal-command.ts +76 -0
  749. package/src/client/hooks/chat/timeline/index.ts +349 -0
  750. package/src/client/hooks/chat/timeline/mode-marker-spellings.test.ts +57 -0
  751. package/src/client/hooks/chat/timeline/mode-markers.ts +103 -0
  752. package/src/client/hooks/chat/timeline/modes.test.ts +311 -0
  753. package/src/client/hooks/chat/timeline/modes.ts +326 -0
  754. package/src/client/hooks/chat/timeline/new-chat.test.ts +196 -0
  755. package/src/client/hooks/chat/timeline/new-chat.ts +80 -0
  756. package/src/client/hooks/chat/timeline/plan-review.test.ts +47 -0
  757. package/src/client/hooks/chat/timeline/plan-review.ts +148 -0
  758. package/src/client/hooks/chat/timeline/plugin-commands.test.ts +116 -0
  759. package/src/client/hooks/chat/timeline/plugin-commands.ts +76 -0
  760. package/src/client/hooks/chat/timeline/prompt-text.test.ts +123 -0
  761. package/src/client/hooks/chat/timeline/prompt-text.ts +40 -0
  762. package/src/client/hooks/chat/timeline/queue-actions.ts +96 -0
  763. package/src/client/hooks/chat/timeline/queue-rewind.test.ts +271 -0
  764. package/src/client/hooks/chat/timeline/queue.ts +235 -0
  765. package/src/client/hooks/chat/timeline/rail-jump.test.ts +204 -0
  766. package/src/client/hooks/chat/timeline/rail-jump.ts +86 -0
  767. package/src/client/hooks/chat/timeline/rewind-actions.test.ts +233 -0
  768. package/src/client/hooks/chat/timeline/rewind-actions.ts +172 -0
  769. package/src/client/hooks/chat/timeline/rewind.ts +62 -0
  770. package/src/client/hooks/chat/timeline/scope.ts +55 -0
  771. package/src/client/hooks/chat/timeline/scroll.test.ts +320 -0
  772. package/src/client/hooks/chat/timeline/scroll.ts +226 -0
  773. package/src/client/hooks/chat/timeline/send-execute.test.ts +333 -0
  774. package/src/client/hooks/chat/timeline/send-helpers.ts +109 -0
  775. package/src/client/hooks/chat/timeline/send-steer.test.ts +231 -0
  776. package/src/client/hooks/chat/timeline/send.test.ts +231 -0
  777. package/src/client/hooks/chat/timeline/send.ts +310 -0
  778. package/src/client/hooks/chat/timeline/session-load.test.ts +323 -0
  779. package/src/client/hooks/chat/timeline/session-load.ts +317 -0
  780. package/src/client/hooks/chat/timeline/session-pagination.test.ts +167 -0
  781. package/src/client/hooks/chat/timeline/session-pagination.ts +317 -0
  782. package/src/client/hooks/chat/timeline/session-scope.test.ts +248 -0
  783. package/src/client/hooks/chat/timeline/session-title.ts +36 -0
  784. package/src/client/hooks/chat/timeline/subagent-view.ts +92 -0
  785. package/src/client/hooks/chat/timeline/timeline-mode-state.test.ts +306 -0
  786. package/src/client/hooks/chat/timeline/timeline-rail.test.ts +259 -0
  787. package/src/client/hooks/chat/timeline/tool-open.test.ts +141 -0
  788. package/src/client/hooks/chat/timeline/tool-open.ts +87 -0
  789. package/src/client/hooks/chat/timeline/tui-only-guard.ts +58 -0
  790. package/src/client/hooks/chat/timeline/undo-confirmation.ts +45 -0
  791. package/src/client/hooks/chat/timeline/user-turns.ts +182 -0
  792. package/src/client/hooks/editor/file-actions.ts +49 -0
  793. package/src/client/hooks/editor/find-harness.test-util.ts +170 -0
  794. package/src/client/hooks/editor/find-state.ts +68 -0
  795. package/src/client/hooks/editor/font.test.ts +344 -0
  796. package/src/client/hooks/editor/font.ts +53 -0
  797. package/src/client/hooks/editor/resolve-viewer.test.ts +142 -0
  798. package/src/client/hooks/editor/resolve-viewer.ts +80 -0
  799. package/src/client/hooks/editor/save-file.ts +88 -0
  800. package/src/client/hooks/editor/scroll-container.test.ts +102 -0
  801. package/src/client/hooks/editor/scroll-container.ts +26 -0
  802. package/src/client/hooks/editor/use-code-window.ts +100 -0
  803. package/src/client/hooks/editor/use-editor-document.ts +81 -0
  804. package/src/client/hooks/editor/use-editor-drop.test.ts +245 -0
  805. package/src/client/hooks/editor/use-editor-drop.ts +275 -0
  806. package/src/client/hooks/editor/use-editor-find-write.test.ts +170 -0
  807. package/src/client/hooks/editor/use-editor-find.test.ts +158 -0
  808. package/src/client/hooks/editor/use-editor-find.ts +307 -0
  809. package/src/client/hooks/editor/use-editor-history.test.ts +216 -0
  810. package/src/client/hooks/editor/use-editor-history.ts +134 -0
  811. package/src/client/hooks/editor/use-editor-outline-bridge.ts +73 -0
  812. package/src/client/hooks/editor/use-file-editor-writes.test.ts +118 -0
  813. package/src/client/hooks/editor/use-file-editor.test.ts +169 -0
  814. package/src/client/hooks/editor/use-file-editor.ts +331 -0
  815. package/src/client/hooks/editor/use-file-read.ts +197 -0
  816. package/src/client/hooks/editor/use-file-transfer.ts +113 -0
  817. package/src/client/hooks/editor/use-file-writes.ts +228 -0
  818. package/src/client/hooks/editor/use-line-jump.test.ts +204 -0
  819. package/src/client/hooks/editor/use-line-jump.ts +112 -0
  820. package/src/client/hooks/editor/use-line-reveal.ts +71 -0
  821. package/src/client/hooks/editor/use-occurrences.test.ts +236 -0
  822. package/src/client/hooks/editor/use-occurrences.ts +98 -0
  823. package/src/client/hooks/editor/use-outline-view.ts +47 -0
  824. package/src/client/hooks/editor/use-scroll-restore.test.ts +238 -0
  825. package/src/client/hooks/editor/use-scroll-restore.ts +209 -0
  826. package/src/client/hooks/editor/use-search-reveal.ts +74 -0
  827. package/src/client/hooks/models/use-model-names.ts +17 -0
  828. package/src/client/hooks/models/use-models-catalog.ts +45 -0
  829. package/src/client/hooks/models/use-provider-names.ts +18 -0
  830. package/src/client/hooks/settings/crud-list.test.ts +272 -0
  831. package/src/client/hooks/settings/crud-list.ts +187 -0
  832. package/src/client/hooks/settings/instruction-file.ts +91 -0
  833. package/src/client/hooks/settings/master-detail.ts +33 -0
  834. package/src/client/hooks/settings/plugins.ts +121 -0
  835. package/src/client/hooks/settings/providers/actions.ts +341 -0
  836. package/src/client/hooks/settings/providers/api.ts +69 -0
  837. package/src/client/hooks/settings/providers/index.ts +154 -0
  838. package/src/client/hooks/settings/providers/logout.ts +85 -0
  839. package/src/client/hooks/settings/providers/messages.ts +112 -0
  840. package/src/client/hooks/settings/reload-engine.ts +74 -0
  841. package/src/client/hooks/settings/restart-kabmo.test.ts +187 -0
  842. package/src/client/hooks/settings/restart-kabmo.ts +115 -0
  843. package/src/client/hooks/settings/settings-siblings.test.ts +168 -0
  844. package/src/client/hooks/settings/skill-catalog.ts +37 -0
  845. package/src/client/hooks/settings/use-kabmo-setting.ts +15 -0
  846. package/src/client/hooks/settings/useUsageReport.ts +45 -0
  847. package/src/client/hooks/settings/useUsageResets.ts +64 -0
  848. package/src/client/hooks/settings/workspace-roots.ts +99 -0
  849. package/src/client/hooks/ui/auth.test.ts +99 -0
  850. package/src/client/hooks/ui/auth.ts +274 -0
  851. package/src/client/hooks/ui/clipboard.ts +50 -0
  852. package/src/client/hooks/ui/copy-flag.ts +27 -0
  853. package/src/client/hooks/ui/inline-rename.ts +99 -0
  854. package/src/client/hooks/ui/input-required-alert.ts +43 -0
  855. package/src/client/hooks/ui/keyboard-inset.test.ts +46 -0
  856. package/src/client/hooks/ui/keyboard-inset.ts +120 -0
  857. package/src/client/hooks/ui/notification-sound.ts +173 -0
  858. package/src/client/hooks/ui/on-click-outside.ts +22 -0
  859. package/src/client/hooks/ui/open-file.ts +57 -0
  860. package/src/client/hooks/ui/output-reveal.ts +30 -0
  861. package/src/client/hooks/ui/realtime.test.ts +84 -0
  862. package/src/client/hooks/ui/realtime.ts +128 -0
  863. package/src/client/hooks/ui/show-more.ts +35 -0
  864. package/src/client/hooks/ui/syntax-ready.ts +30 -0
  865. package/src/client/hooks/ui/text-overflow.test.ts +152 -0
  866. package/src/client/hooks/ui/text-overflow.ts +78 -0
  867. package/src/client/hooks/ui/theme.ts +121 -0
  868. package/src/client/hooks/ui/toasts.ts +22 -0
  869. package/src/client/hooks/ui/touch-device.ts +46 -0
  870. package/src/client/hooks/ui/ui-alert.test.ts +235 -0
  871. package/src/client/hooks/ui/ui-environment.test.ts +172 -0
  872. package/src/client/hooks/ui/ui-feedback.test.ts +303 -0
  873. package/src/client/hooks/ui/ui-inline-rename.test.ts +305 -0
  874. package/src/client/hooks/ui/ui-listeners.test.ts +331 -0
  875. package/src/client/hooks/ui/ui-sounds.test.ts +254 -0
  876. package/src/client/hooks/ui/ui-syntax-ready.test.ts +73 -0
  877. package/src/client/hooks/ui/updates/changelog.ts +57 -0
  878. package/src/client/hooks/ui/updates/index.test.ts +218 -0
  879. package/src/client/hooks/ui/updates/index.ts +254 -0
  880. package/src/client/hooks/ui/updates/restart.test.ts +129 -0
  881. package/src/client/hooks/ui/updates/restart.ts +150 -0
  882. package/src/client/hooks/ui/window-chrome.ts +63 -0
  883. package/src/client/hooks/ui/window-event.ts +55 -0
  884. package/src/client/hooks/workspace/available-width.ts +33 -0
  885. package/src/client/hooks/workspace/commit-box.test.ts +203 -0
  886. package/src/client/hooks/workspace/commit-box.ts +129 -0
  887. package/src/client/hooks/workspace/commit-interactions.ts +153 -0
  888. package/src/client/hooks/workspace/commit-layer.test.ts +348 -0
  889. package/src/client/hooks/workspace/commit-pagination.ts +101 -0
  890. package/src/client/hooks/workspace/diff-file.ts +128 -0
  891. package/src/client/hooks/workspace/directives.ts +55 -0
  892. package/src/client/hooks/workspace/expanded-sessions.ts +62 -0
  893. package/src/client/hooks/workspace/file-clipboard.test.ts +247 -0
  894. package/src/client/hooks/workspace/file-clipboard.ts +192 -0
  895. package/src/client/hooks/workspace/file-create.ts +111 -0
  896. package/src/client/hooks/workspace/file-listing.ts +242 -0
  897. package/src/client/hooks/workspace/file-row-drag.ts +98 -0
  898. package/src/client/hooks/workspace/file-tabs.ts +233 -0
  899. package/src/client/hooks/workspace/file-tree-actions-clipboard.test.ts +106 -0
  900. package/src/client/hooks/workspace/file-tree-actions.test.ts +181 -0
  901. package/src/client/hooks/workspace/file-tree-actions.ts +246 -0
  902. package/src/client/hooks/workspace/git-actions.ts +56 -0
  903. package/src/client/hooks/workspace/git-panel-data.ts +162 -0
  904. package/src/client/hooks/workspace/git-status.test.ts +150 -0
  905. package/src/client/hooks/workspace/git-status.ts +48 -0
  906. package/src/client/hooks/workspace/git-tree.test.ts +73 -0
  907. package/src/client/hooks/workspace/git-tree.ts +146 -0
  908. package/src/client/hooks/workspace/list-slots.test.ts +86 -0
  909. package/src/client/hooks/workspace/list-slots.ts +59 -0
  910. package/src/client/hooks/workspace/missing-files.test.ts +179 -0
  911. package/src/client/hooks/workspace/missing-files.ts +132 -0
  912. package/src/client/hooks/workspace/new-workspace.ts +51 -0
  913. package/src/client/hooks/workspace/panel-order.ts +87 -0
  914. package/src/client/hooks/workspace/panel-registry.ts +329 -0
  915. package/src/client/hooks/workspace/panel-reorder.ts +119 -0
  916. package/src/client/hooks/workspace/panel-widths.test.ts +261 -0
  917. package/src/client/hooks/workspace/panel-widths.ts +51 -0
  918. package/src/client/hooks/workspace/renaming-sessions.ts +61 -0
  919. package/src/client/hooks/workspace/repo-details.ts +128 -0
  920. package/src/client/hooks/workspace/repo-scope/index.test.ts +213 -0
  921. package/src/client/hooks/workspace/repo-scope/index.ts +181 -0
  922. package/src/client/hooks/workspace/repo-scope/store.test.ts +158 -0
  923. package/src/client/hooks/workspace/repo-scope/store.ts +164 -0
  924. package/src/client/hooks/workspace/scheduled-tasks.ts +159 -0
  925. package/src/client/hooks/workspace/search-stream.test.ts +149 -0
  926. package/src/client/hooks/workspace/search-stream.ts +133 -0
  927. package/src/client/hooks/workspace/session-actions.test.ts +170 -0
  928. package/src/client/hooks/workspace/session-actions.ts +99 -0
  929. package/src/client/hooks/workspace/session-delete.ts +93 -0
  930. package/src/client/hooks/workspace/session-state/context.ts +15 -0
  931. package/src/client/hooks/workspace/session-state/index.ts +83 -0
  932. package/src/client/hooks/workspace/sidebar-width.ts +43 -0
  933. package/src/client/hooks/workspace/terminal/index.ts +186 -0
  934. package/src/client/hooks/workspace/terminal/socket.ts +227 -0
  935. package/src/client/hooks/workspace/wiki.ts +195 -0
  936. package/src/client/hooks/workspace/workspace-folder-actions.ts +125 -0
  937. package/src/client/lib/editor-document.ts +106 -0
  938. package/src/client/lib/launch/file-handlers.test.ts +255 -0
  939. package/src/client/lib/launch/file-handlers.ts +203 -0
  940. package/src/client/lib/launch/types.ts +67 -0
  941. package/src/client/lib/line-reveal.ts +61 -0
  942. package/src/client/lib/outline-stores.test.ts +94 -0
  943. package/src/client/lib/plugins/bootstrap.test.ts +258 -0
  944. package/src/client/lib/plugins/bootstrap.tsx +158 -0
  945. package/src/client/lib/plugins/composer-bridge.ts +107 -0
  946. package/src/client/lib/plugins/content-scripts-root.test.ts +158 -0
  947. package/src/client/lib/plugins/content-scripts.test.ts +331 -0
  948. package/src/client/lib/plugins/content-scripts.ts +252 -0
  949. package/src/client/lib/plugins/context.ts +68 -0
  950. package/src/client/lib/plugins/directives.test.tsx +239 -0
  951. package/src/client/lib/plugins/directives.tsx +139 -0
  952. package/src/client/lib/plugins/kit.test.ts +103 -0
  953. package/src/client/lib/plugins/kit.ts +160 -0
  954. package/src/client/lib/plugins/list-slots.test.ts +148 -0
  955. package/src/client/lib/plugins/list-slots.ts +166 -0
  956. package/src/client/lib/plugins/loader.ts +66 -0
  957. package/src/client/lib/plugins/repo-scope-service.test.ts +90 -0
  958. package/src/client/lib/plugins/repo-scope-service.ts +148 -0
  959. package/src/client/lib/plugins/runtime.ts +64 -0
  960. package/src/client/lib/plugins/sidebar-bridge.test.ts +200 -0
  961. package/src/client/lib/plugins/sidebar-bridge.ts +215 -0
  962. package/src/client/lib/plugins/slots.test.ts +177 -0
  963. package/src/client/lib/plugins/slots.ts +230 -0
  964. package/src/client/lib/plugins/stylesheets.test.ts +157 -0
  965. package/src/client/lib/plugins/stylesheets.ts +89 -0
  966. package/src/client/lib/plugins/topic.ts +55 -0
  967. package/src/client/lib/router/fetcher.ts +100 -0
  968. package/src/client/lib/router/search-params.ts +86 -0
  969. package/src/client/lib/scrollbar-activity.test.ts +165 -0
  970. package/src/client/lib/scrollbar-activity.ts +112 -0
  971. package/src/client/lib/search-reveal.ts +61 -0
  972. package/src/client/lib/signals.ts +72 -0
  973. package/src/client/lib/ui/with-chord.ts +21 -0
  974. package/src/client/main.tsx +78 -0
  975. package/src/client/stubs/elkjs.ts +42 -0
  976. package/src/client/tailwind.css +578 -0
  977. package/src/server/db.server.test.ts +153 -0
  978. package/src/server/db.server.ts +144 -0
  979. package/src/server/index.ts +329 -0
  980. package/src/server/lib/assets/conditional.server.test.ts +74 -0
  981. package/src/server/lib/assets/conditional.server.ts +54 -0
  982. package/src/server/lib/assets/dev-assets.server.test.ts +44 -0
  983. package/src/server/lib/assets/dev-assets.server.ts +128 -0
  984. package/src/server/lib/assets/font-css.server.test.ts +87 -0
  985. package/src/server/lib/assets/font-css.server.ts +113 -0
  986. package/src/server/lib/assets/font-faces.ts +69 -0
  987. package/src/server/lib/assets/fonts.server.ts +77 -0
  988. package/src/server/lib/auth/client-address.ts +55 -0
  989. package/src/server/lib/auth/config.ts +133 -0
  990. package/src/server/lib/auth/env-password.test.ts +112 -0
  991. package/src/server/lib/auth/env-password.ts +79 -0
  992. package/src/server/lib/auth/guard.test.ts +305 -0
  993. package/src/server/lib/auth/guard.ts +285 -0
  994. package/src/server/lib/auth/handover-guard.test.ts +100 -0
  995. package/src/server/lib/auth/rate-limit.test.ts +135 -0
  996. package/src/server/lib/auth/rate-limit.ts +143 -0
  997. package/src/server/lib/auth/token.test.ts +236 -0
  998. package/src/server/lib/auth/token.ts +220 -0
  999. package/src/server/lib/browser/runtime.test.ts +110 -0
  1000. package/src/server/lib/browser/runtime.ts +160 -0
  1001. package/src/server/lib/btw/child.server.test.ts +68 -0
  1002. package/src/server/lib/btw/child.server.ts +42 -0
  1003. package/src/server/lib/btw/frames.test.ts +59 -0
  1004. package/src/server/lib/btw/frames.ts +50 -0
  1005. package/src/server/lib/btw/lifecycle.server.test.ts +139 -0
  1006. package/src/server/lib/btw/lifecycle.server.ts +264 -0
  1007. package/src/server/lib/btw/prompt.ts +32 -0
  1008. package/src/server/lib/btw/purge.server.ts +56 -0
  1009. package/src/server/lib/btw/registry.server.test.ts +213 -0
  1010. package/src/server/lib/btw/registry.server.ts +142 -0
  1011. package/src/server/lib/btw/reply.ts +54 -0
  1012. package/src/server/lib/btw/runtime.server.test.ts +128 -0
  1013. package/src/server/lib/btw/runtime.server.ts +308 -0
  1014. package/src/server/lib/btw/schema.server.test.ts +84 -0
  1015. package/src/server/lib/btw/schema.server.ts +79 -0
  1016. package/src/server/lib/btw/service.server.test.ts +199 -0
  1017. package/src/server/lib/btw/service.server.ts +241 -0
  1018. package/src/server/lib/btw/session-copy.server.ts +213 -0
  1019. package/src/server/lib/btw/session-copy.test.ts +166 -0
  1020. package/src/server/lib/btw/store.server.test.ts +301 -0
  1021. package/src/server/lib/btw/store.server.ts +280 -0
  1022. package/src/server/lib/bundler/build-errors.server.ts +141 -0
  1023. package/src/server/lib/bundler/build-errors.test.ts +103 -0
  1024. package/src/server/lib/bundler/css.test.ts +237 -0
  1025. package/src/server/lib/bundler/css.ts +82 -0
  1026. package/src/server/lib/bundler/dependencies.test.ts +149 -0
  1027. package/src/server/lib/bundler/nested-at-rules.test.ts +100 -0
  1028. package/src/server/lib/bundler/nested-at-rules.ts +146 -0
  1029. package/src/server/lib/bundler/tsconfig-paths.test.ts +124 -0
  1030. package/src/server/lib/chat/session-store.server.ts +61 -0
  1031. package/src/server/lib/db/client.ts +76 -0
  1032. package/src/server/lib/db/compact-chat-overlay.test.ts +128 -0
  1033. package/src/server/lib/db/compact-chat-overlay.ts +90 -0
  1034. package/src/server/lib/db/schema.test.ts +219 -0
  1035. package/src/server/lib/db/schema.ts +122 -0
  1036. package/src/server/lib/db/seed-terminal.test.ts +227 -0
  1037. package/src/server/lib/db/seed.test.ts +226 -0
  1038. package/src/server/lib/db/seed.ts +160 -0
  1039. package/src/server/lib/db/settings-store.test.ts +65 -0
  1040. package/src/server/lib/db/settings-store.ts +173 -0
  1041. package/src/server/lib/db/workspace-sync.test.ts +274 -0
  1042. package/src/server/lib/db/workspace-sync.ts +144 -0
  1043. package/src/server/lib/dictation/language.server.test.ts +134 -0
  1044. package/src/server/lib/dictation/language.server.ts +82 -0
  1045. package/src/server/lib/dictation/omp-stt-worker.ts +243 -0
  1046. package/src/server/lib/fs/atomic-write.ts +65 -0
  1047. package/src/server/lib/fs/child-env.test.ts +66 -0
  1048. package/src/server/lib/fs/child-env.ts +50 -0
  1049. package/src/server/lib/fs/config-lock.ts +74 -0
  1050. package/src/server/lib/fs/fs-path.test.ts +293 -0
  1051. package/src/server/lib/fs/fs-write-git.test.ts +332 -0
  1052. package/src/server/lib/fs/git-actions-branch.ts +148 -0
  1053. package/src/server/lib/fs/git-actions-history.ts +74 -0
  1054. package/src/server/lib/fs/git-actions-shared.ts +86 -0
  1055. package/src/server/lib/fs/git-actions-worktree.ts +187 -0
  1056. package/src/server/lib/fs/git-actions.ts +39 -0
  1057. package/src/server/lib/fs/git-branch.ts +226 -0
  1058. package/src/server/lib/fs/git-diff.test.ts +304 -0
  1059. package/src/server/lib/fs/git-diff.ts +162 -0
  1060. package/src/server/lib/fs/git-ignore.ts +105 -0
  1061. package/src/server/lib/fs/git-index-lock.test.ts +232 -0
  1062. package/src/server/lib/fs/git-log-parse.test.ts +155 -0
  1063. package/src/server/lib/fs/git-log.test.ts +337 -0
  1064. package/src/server/lib/fs/git-log.ts +335 -0
  1065. package/src/server/lib/fs/git-merge-conflict.test.ts +123 -0
  1066. package/src/server/lib/fs/git-merge.ts +210 -0
  1067. package/src/server/lib/fs/git-porcelain-v2.ts +140 -0
  1068. package/src/server/lib/fs/git-publish.test.ts +147 -0
  1069. package/src/server/lib/fs/git-publish.ts +73 -0
  1070. package/src/server/lib/fs/git-repo-details.test.ts +227 -0
  1071. package/src/server/lib/fs/git-repo-details.ts +163 -0
  1072. package/src/server/lib/fs/git-repos.test.ts +101 -0
  1073. package/src/server/lib/fs/git-repos.ts +117 -0
  1074. package/src/server/lib/fs/git-revert.ts +93 -0
  1075. package/src/server/lib/fs/git-run.ts +219 -0
  1076. package/src/server/lib/fs/git-stash.ts +159 -0
  1077. package/src/server/lib/fs/git-state-verbs.test.ts +117 -0
  1078. package/src/server/lib/fs/git-state.test.ts +171 -0
  1079. package/src/server/lib/fs/git-state.ts +178 -0
  1080. package/src/server/lib/fs/git-status-read.test.ts +141 -0
  1081. package/src/server/lib/fs/git-status-read.ts +174 -0
  1082. package/src/server/lib/fs/git-sync.test.ts +200 -0
  1083. package/src/server/lib/fs/git-sync.ts +216 -0
  1084. package/src/server/lib/fs/listing.ts +64 -0
  1085. package/src/server/lib/fs/package-root.test.ts +99 -0
  1086. package/src/server/lib/fs/package-root.ts +87 -0
  1087. package/src/server/lib/fs/path-segment.test.ts +101 -0
  1088. package/src/server/lib/fs/path-segment.ts +45 -0
  1089. package/src/server/lib/fs/repo-scope.ts +14 -0
  1090. package/src/server/lib/fs/reveal.ts +101 -0
  1091. package/src/server/lib/fs/ripgrep.test.ts +208 -0
  1092. package/src/server/lib/fs/ripgrep.ts +139 -0
  1093. package/src/server/lib/fs/root.ts +156 -0
  1094. package/src/server/lib/fs/shell.ts +131 -0
  1095. package/src/server/lib/fs/transfer.test.ts +183 -0
  1096. package/src/server/lib/fs/transfer.ts +143 -0
  1097. package/src/server/lib/http/same-origin.ts +26 -0
  1098. package/src/server/lib/lifecycle/argv-flags.ts +47 -0
  1099. package/src/server/lib/lifecycle/bun.ts +20 -0
  1100. package/src/server/lib/lifecycle/fd-pressure.test.ts +110 -0
  1101. package/src/server/lib/lifecycle/fd-pressure.ts +240 -0
  1102. package/src/server/lib/lifecycle/flock.test.ts +166 -0
  1103. package/src/server/lib/lifecycle/flock.ts +199 -0
  1104. package/src/server/lib/lifecycle/identity.test.ts +23 -0
  1105. package/src/server/lib/lifecycle/identity.ts +86 -0
  1106. package/src/server/lib/lifecycle/instance.test.ts +306 -0
  1107. package/src/server/lib/lifecycle/instance.ts +131 -0
  1108. package/src/server/lib/lifecycle/kill-tree.test.ts +196 -0
  1109. package/src/server/lib/lifecycle/kill-tree.ts +114 -0
  1110. package/src/server/lib/lifecycle/launch-mode.test.ts +51 -0
  1111. package/src/server/lib/lifecycle/launch-mode.ts +66 -0
  1112. package/src/server/lib/lifecycle/listener.ts +58 -0
  1113. package/src/server/lib/lifecycle/occupant.ts +101 -0
  1114. package/src/server/lib/lifecycle/paths.test.ts +97 -0
  1115. package/src/server/lib/lifecycle/paths.ts +112 -0
  1116. package/src/server/lib/lifecycle/port-guard.test.ts +288 -0
  1117. package/src/server/lib/lifecycle/port-guard.ts +185 -0
  1118. package/src/server/lib/lifecycle/probe.test.ts +279 -0
  1119. package/src/server/lib/lifecycle/probe.ts +215 -0
  1120. package/src/server/lib/lifecycle/proc/darwin.ts +305 -0
  1121. package/src/server/lib/lifecycle/proc/index.ts +38 -0
  1122. package/src/server/lib/lifecycle/proc/linux.ts +110 -0
  1123. package/src/server/lib/lifecycle/proc/proc.test.ts +164 -0
  1124. package/src/server/lib/lifecycle/proc/ps.ts +99 -0
  1125. package/src/server/lib/lifecycle/proc/types.ts +58 -0
  1126. package/src/server/lib/lifecycle/proc/win32.ts +64 -0
  1127. package/src/server/lib/lifecycle/restart.test.ts +331 -0
  1128. package/src/server/lib/lifecycle/restart.ts +190 -0
  1129. package/src/server/lib/lifecycle/shell-route.ts +17 -0
  1130. package/src/server/lib/lifecycle/tls.test.ts +98 -0
  1131. package/src/server/lib/lifecycle/tls.ts +165 -0
  1132. package/src/server/lib/models/detected-registry.server.ts +41 -0
  1133. package/src/server/lib/models/preferences.server.ts +110 -0
  1134. package/src/server/lib/models/provider-items.server.ts +96 -0
  1135. package/src/server/lib/models/provider-listing.server.test.ts +283 -0
  1136. package/src/server/lib/models/provider-listing.server.ts +279 -0
  1137. package/src/server/lib/models/provider-registry.server.test.ts +173 -0
  1138. package/src/server/lib/models/provider-registry.server.ts +257 -0
  1139. package/src/server/lib/models/registry.server.test.ts +263 -0
  1140. package/src/server/lib/models/registry.server.ts +206 -0
  1141. package/src/server/lib/models/selected-context-limit.server.test.ts +162 -0
  1142. package/src/server/lib/models/selected-context-limit.server.ts +52 -0
  1143. package/src/server/lib/observer-ws.ts +150 -0
  1144. package/src/server/lib/omp/config/agents.ts +162 -0
  1145. package/src/server/lib/omp/config/behavior.ts +113 -0
  1146. package/src/server/lib/omp/config/commands.test.ts +167 -0
  1147. package/src/server/lib/omp/config/commands.ts +185 -0
  1148. package/src/server/lib/omp/config/config-cli.test.ts +153 -0
  1149. package/src/server/lib/omp/config/config-cli.ts +154 -0
  1150. package/src/server/lib/omp/config/definitions.test.ts +349 -0
  1151. package/src/server/lib/omp/config/disabled-providers.ts +117 -0
  1152. package/src/server/lib/omp/config/discovery-roots.test.ts +119 -0
  1153. package/src/server/lib/omp/config/discovery-roots.ts +194 -0
  1154. package/src/server/lib/omp/config/document.test.ts +349 -0
  1155. package/src/server/lib/omp/config/document.ts +128 -0
  1156. package/src/server/lib/omp/config/extensions.ts +91 -0
  1157. package/src/server/lib/omp/config/instructions.ts +81 -0
  1158. package/src/server/lib/omp/config/mcp-and-cli.test.ts +318 -0
  1159. package/src/server/lib/omp/config/mcp-test.ts +346 -0
  1160. package/src/server/lib/omp/config/mcp.ts +205 -0
  1161. package/src/server/lib/omp/config/model-overrides.ts +123 -0
  1162. package/src/server/lib/omp/config/models-config.ts +103 -0
  1163. package/src/server/lib/omp/config/models-validation.test.ts +137 -0
  1164. package/src/server/lib/omp/config/models-validation.ts +268 -0
  1165. package/src/server/lib/omp/config/omp-config-files.test.ts +300 -0
  1166. package/src/server/lib/omp/config/path-scoped.ts +74 -0
  1167. package/src/server/lib/omp/config/plugin-actions.ts +87 -0
  1168. package/src/server/lib/omp/config/plugin-cli.ts +69 -0
  1169. package/src/server/lib/omp/config/plugin-registry.test.ts +286 -0
  1170. package/src/server/lib/omp/config/plugin-registry.ts +250 -0
  1171. package/src/server/lib/omp/config/plugins.test.ts +289 -0
  1172. package/src/server/lib/omp/config/plugins.ts +249 -0
  1173. package/src/server/lib/omp/config/provider-seeds.test.ts +167 -0
  1174. package/src/server/lib/omp/config/provider-seeds.ts +220 -0
  1175. package/src/server/lib/omp/config/providers-write.test.ts +340 -0
  1176. package/src/server/lib/omp/config/providers.ts +343 -0
  1177. package/src/server/lib/omp/config/roles.ts +38 -0
  1178. package/src/server/lib/omp/config/roots-watch.server.test.ts +214 -0
  1179. package/src/server/lib/omp/config/roots-watch.server.ts +334 -0
  1180. package/src/server/lib/omp/config/scope.test.ts +53 -0
  1181. package/src/server/lib/omp/config/scope.ts +65 -0
  1182. package/src/server/lib/omp/config/skills-catalog.ts +127 -0
  1183. package/src/server/lib/omp/config/skills.test.ts +108 -0
  1184. package/src/server/lib/omp/config/skills.ts +333 -0
  1185. package/src/server/lib/omp/config/yaml.ts +48 -0
  1186. package/src/server/lib/omp/core/auth-credentials.ts +132 -0
  1187. package/src/server/lib/omp/core/cli.ts +70 -0
  1188. package/src/server/lib/omp/core/host-resolution.test.ts +348 -0
  1189. package/src/server/lib/omp/core/paths.test.ts +229 -0
  1190. package/src/server/lib/omp/core/paths.ts +214 -0
  1191. package/src/server/lib/omp/core/registry.test.ts +234 -0
  1192. package/src/server/lib/omp/core/registry.ts +140 -0
  1193. package/src/server/lib/omp/core/startup.ts +64 -0
  1194. package/src/server/lib/omp/core/worktree.ts +107 -0
  1195. package/src/server/lib/omp/extensions/locator.test.ts +67 -0
  1196. package/src/server/lib/omp/extensions/locator.ts +98 -0
  1197. package/src/server/lib/omp/mode/command-type.test.ts +41 -0
  1198. package/src/server/lib/omp/mode/live-selection.test.ts +133 -0
  1199. package/src/server/lib/omp/mode/live-selection.ts +90 -0
  1200. package/src/server/lib/omp/mode/request.test.ts +73 -0
  1201. package/src/server/lib/omp/mode/request.ts +94 -0
  1202. package/src/server/lib/omp/rpc/agent-start-watchdog.ts +88 -0
  1203. package/src/server/lib/omp/rpc/child-config.ts +48 -0
  1204. package/src/server/lib/omp/rpc/constants.test.ts +229 -0
  1205. package/src/server/lib/omp/rpc/constants.ts +299 -0
  1206. package/src/server/lib/omp/rpc/destroy-stream-row.test.ts +110 -0
  1207. package/src/server/lib/omp/rpc/errors.ts +42 -0
  1208. package/src/server/lib/omp/rpc/event-fanout.ts +43 -0
  1209. package/src/server/lib/omp/rpc/forked-resume.test.ts +119 -0
  1210. package/src/server/lib/omp/rpc/frame-fold.test.ts +300 -0
  1211. package/src/server/lib/omp/rpc/frame-fold.ts +321 -0
  1212. package/src/server/lib/omp/rpc/idle-reaper.ts +59 -0
  1213. package/src/server/lib/omp/rpc/lifecycle.test.ts +293 -0
  1214. package/src/server/lib/omp/rpc/lines.ts +48 -0
  1215. package/src/server/lib/omp/rpc/manager.ts +345 -0
  1216. package/src/server/lib/omp/rpc/mode-mirror.test.ts +156 -0
  1217. package/src/server/lib/omp/rpc/mode-mirror.ts +109 -0
  1218. package/src/server/lib/omp/rpc/peer-proxy.server.test.ts +107 -0
  1219. package/src/server/lib/omp/rpc/peer-proxy.server.ts +150 -0
  1220. package/src/server/lib/omp/rpc/pending-ui-dialogs.ts +59 -0
  1221. package/src/server/lib/omp/rpc/process-helpers.ts +70 -0
  1222. package/src/server/lib/omp/rpc/process.ts +328 -0
  1223. package/src/server/lib/omp/rpc/reload-plugins.ts +43 -0
  1224. package/src/server/lib/omp/rpc/rpc-primitives.test.ts +339 -0
  1225. package/src/server/lib/omp/rpc/rpc-timers.test.ts +302 -0
  1226. package/src/server/lib/omp/rpc/run-model.ts +59 -0
  1227. package/src/server/lib/omp/rpc/run-settle.server.ts +296 -0
  1228. package/src/server/lib/omp/rpc/run-settle.test.ts +288 -0
  1229. package/src/server/lib/omp/rpc/session-command-guards.ts +125 -0
  1230. package/src/server/lib/omp/rpc/session-commands-dialog.test.ts +139 -0
  1231. package/src/server/lib/omp/rpc/session-commands-harness.ts +86 -0
  1232. package/src/server/lib/omp/rpc/session-commands.test.ts +293 -0
  1233. package/src/server/lib/omp/rpc/session-commands.ts +293 -0
  1234. package/src/server/lib/omp/rpc/session-registration.ts +58 -0
  1235. package/src/server/lib/omp/rpc/session-registry.test.ts +234 -0
  1236. package/src/server/lib/omp/rpc/session-registry.ts +349 -0
  1237. package/src/server/lib/omp/rpc/spawn-provenance.ts +82 -0
  1238. package/src/server/lib/omp/rpc/stream-reader.test.ts +124 -0
  1239. package/src/server/lib/omp/rpc/subagent-liveness.test.ts +62 -0
  1240. package/src/server/lib/omp/rpc/subagent-liveness.ts +101 -0
  1241. package/src/server/lib/omp/rpc/terminal-settle.ts +97 -0
  1242. package/src/server/lib/omp/rpc/utility.test.ts +261 -0
  1243. package/src/server/lib/omp/rpc/utility.ts +300 -0
  1244. package/src/server/lib/omp/rpc/web-state.ts +88 -0
  1245. package/src/server/lib/omp/session/artifacts.server.test.ts +117 -0
  1246. package/src/server/lib/omp/session/artifacts.server.ts +106 -0
  1247. package/src/server/lib/omp/session/auto-title.server.test.ts +270 -0
  1248. package/src/server/lib/omp/session/auto-title.server.ts +250 -0
  1249. package/src/server/lib/omp/session/blobs.server.test.ts +129 -0
  1250. package/src/server/lib/omp/session/blobs.server.ts +108 -0
  1251. package/src/server/lib/omp/session/data-mock.ts +88 -0
  1252. package/src/server/lib/omp/session/delete.server.ts +139 -0
  1253. package/src/server/lib/omp/session/file-scan.ts +180 -0
  1254. package/src/server/lib/omp/session/files.test.ts +147 -0
  1255. package/src/server/lib/omp/session/files.ts +298 -0
  1256. package/src/server/lib/omp/session/goal-auditor.server.ts +187 -0
  1257. package/src/server/lib/omp/session/goal-auditor.test.ts +76 -0
  1258. package/src/server/lib/omp/session/goal-driver.server.ts +230 -0
  1259. package/src/server/lib/omp/session/goal-driver.test.ts +220 -0
  1260. package/src/server/lib/omp/session/goal-settings.server.ts +48 -0
  1261. package/src/server/lib/omp/session/goal-settings.test.ts +45 -0
  1262. package/src/server/lib/omp/session/lease-flock.server.ts +117 -0
  1263. package/src/server/lib/omp/session/lease-holder.server.ts +156 -0
  1264. package/src/server/lib/omp/session/local-runs.server.ts +38 -0
  1265. package/src/server/lib/omp/session/locator.ts +70 -0
  1266. package/src/server/lib/omp/session/merge-stored-anchor.test.ts +85 -0
  1267. package/src/server/lib/omp/session/merge-stored-notices.test.ts +81 -0
  1268. package/src/server/lib/omp/session/merge-stored-overlay-rows.test.ts +106 -0
  1269. package/src/server/lib/omp/session/merge-stored.test.ts +118 -0
  1270. package/src/server/lib/omp/session/merge-stored.ts +307 -0
  1271. package/src/server/lib/omp/session/messages.test.ts +182 -0
  1272. package/src/server/lib/omp/session/messages.ts +288 -0
  1273. package/src/server/lib/omp/session/modes.test.ts +146 -0
  1274. package/src/server/lib/omp/session/modes.ts +164 -0
  1275. package/src/server/lib/omp/session/ownership.server.test.ts +271 -0
  1276. package/src/server/lib/omp/session/ownership.server.ts +156 -0
  1277. package/src/server/lib/omp/session/plan-mode-env.test.ts +65 -0
  1278. package/src/server/lib/omp/session/plans.test.ts +64 -0
  1279. package/src/server/lib/omp/session/plans.ts +192 -0
  1280. package/src/server/lib/omp/session/reader.ts +162 -0
  1281. package/src/server/lib/omp/session/reload.server.test.ts +111 -0
  1282. package/src/server/lib/omp/session/reload.server.ts +114 -0
  1283. package/src/server/lib/omp/session/rename-with-ai.server.test.ts +137 -0
  1284. package/src/server/lib/omp/session/rename-with-ai.server.ts +197 -0
  1285. package/src/server/lib/omp/session/rewind-file.test.ts +212 -0
  1286. package/src/server/lib/omp/session/rewind-file.ts +248 -0
  1287. package/src/server/lib/omp/session/scan.ts +119 -0
  1288. package/src/server/lib/omp/session/session-discovery.test.ts +248 -0
  1289. package/src/server/lib/omp/session/session-reads.test.ts +297 -0
  1290. package/src/server/lib/omp/session/sessions-watch.server.ts +115 -0
  1291. package/src/server/lib/omp/session/sidebar-data.server.ts +270 -0
  1292. package/src/server/lib/omp/session/standby.server.test.ts +109 -0
  1293. package/src/server/lib/omp/session/standby.server.ts +122 -0
  1294. package/src/server/lib/omp/session/subagent-presence.ts +108 -0
  1295. package/src/server/lib/omp/session/telemetry/compute.ts +206 -0
  1296. package/src/server/lib/omp/session/telemetry/format.ts +110 -0
  1297. package/src/server/lib/omp/session/telemetry/index.ts +4 -0
  1298. package/src/server/lib/omp/session/telemetry/scan.ts +103 -0
  1299. package/src/server/lib/omp/session/telemetry-raw.ts +112 -0
  1300. package/src/server/lib/omp/session/telemetry.test.ts +154 -0
  1301. package/src/server/lib/omp/session/title-model-overlay.server.test.ts +152 -0
  1302. package/src/server/lib/omp/session/title-model-overlay.server.ts +161 -0
  1303. package/src/server/lib/omp/session/title-slot.ts +203 -0
  1304. package/src/server/lib/omp/session/todos.ts +100 -0
  1305. package/src/server/lib/omp/session/usage/aggregate-shaping.test.ts +149 -0
  1306. package/src/server/lib/omp/session/usage/aggregate.test.ts +243 -0
  1307. package/src/server/lib/omp/session/usage/aggregate.ts +330 -0
  1308. package/src/server/lib/omp/session/usage/shaping.ts +130 -0
  1309. package/src/server/lib/omp/subagent/history/fold.ts +196 -0
  1310. package/src/server/lib/omp/subagent/history/index.ts +110 -0
  1311. package/src/server/lib/omp/subagent/history/paths.ts +29 -0
  1312. package/src/server/lib/omp/subagent/history/transcript.test.ts +87 -0
  1313. package/src/server/lib/omp/subagent/history/transcript.ts +122 -0
  1314. package/src/server/lib/panels/assets.server.ts +70 -0
  1315. package/src/server/lib/panels/auto-update.server.test.ts +138 -0
  1316. package/src/server/lib/panels/auto-update.server.ts +148 -0
  1317. package/src/server/lib/panels/baseline.server.test.ts +104 -0
  1318. package/src/server/lib/panels/baseline.server.ts +122 -0
  1319. package/src/server/lib/panels/build-targets.server.ts +107 -0
  1320. package/src/server/lib/panels/build.server.test.ts +289 -0
  1321. package/src/server/lib/panels/build.server.ts +297 -0
  1322. package/src/server/lib/panels/bundled-catalog.server.ts +54 -0
  1323. package/src/server/lib/panels/catalog.server.test.ts +149 -0
  1324. package/src/server/lib/panels/catalog.server.ts +142 -0
  1325. package/src/server/lib/panels/compat.server.test.ts +122 -0
  1326. package/src/server/lib/panels/compat.server.ts +79 -0
  1327. package/src/server/lib/panels/files.server.test.ts +133 -0
  1328. package/src/server/lib/panels/files.server.ts +112 -0
  1329. package/src/server/lib/panels/git-clone.server.ts +140 -0
  1330. package/src/server/lib/panels/git-status.server.ts +46 -0
  1331. package/src/server/lib/panels/git-update.server.test.ts +218 -0
  1332. package/src/server/lib/panels/git-update.server.ts +187 -0
  1333. package/src/server/lib/panels/install.server.test.ts +284 -0
  1334. package/src/server/lib/panels/install.server.ts +240 -0
  1335. package/src/server/lib/panels/link.server.ts +106 -0
  1336. package/src/server/lib/panels/local-edits.server.test.ts +127 -0
  1337. package/src/server/lib/panels/local-edits.server.ts +126 -0
  1338. package/src/server/lib/panels/manifest.test.ts +199 -0
  1339. package/src/server/lib/panels/manifest.ts +248 -0
  1340. package/src/server/lib/panels/registry-bundled.server.test.ts +99 -0
  1341. package/src/server/lib/panels/registry.server.test.ts +315 -0
  1342. package/src/server/lib/panels/registry.server.ts +331 -0
  1343. package/src/server/lib/panels/remove.server.test.ts +112 -0
  1344. package/src/server/lib/panels/seed.server.ts +71 -0
  1345. package/src/server/lib/panels/shim.test.ts +160 -0
  1346. package/src/server/lib/panels/shim.ts +139 -0
  1347. package/src/server/lib/panels/state.server.test.ts +131 -0
  1348. package/src/server/lib/panels/state.server.ts +172 -0
  1349. package/src/server/lib/panels/sync.server.test.ts +308 -0
  1350. package/src/server/lib/panels/sync.server.ts +212 -0
  1351. package/src/server/lib/plugins/background.server.ts +99 -0
  1352. package/src/server/lib/plugins/background.test.ts +89 -0
  1353. package/src/server/lib/plugins/build-server.test.ts +85 -0
  1354. package/src/server/lib/plugins/e2e.test.ts +134 -0
  1355. package/src/server/lib/plugins/events.server.ts +88 -0
  1356. package/src/server/lib/plugins/http.server.ts +112 -0
  1357. package/src/server/lib/plugins/loader.server.ts +306 -0
  1358. package/src/server/lib/plugins/log.server.ts +40 -0
  1359. package/src/server/lib/plugins/platform.test.ts +293 -0
  1360. package/src/server/lib/plugins/realtime.server.ts +66 -0
  1361. package/src/server/lib/plugins/rpc.server.ts +180 -0
  1362. package/src/server/lib/plugins/schema.server.ts +75 -0
  1363. package/src/server/lib/plugins/settings.server.ts +172 -0
  1364. package/src/server/lib/plugins/shutdown.test.ts +105 -0
  1365. package/src/server/lib/plugins/storage.server.ts +118 -0
  1366. package/src/server/lib/queue/delivery-dispatch.server.test.ts +180 -0
  1367. package/src/server/lib/queue/delivery-harness.ts +115 -0
  1368. package/src/server/lib/queue/delivery.server.test.ts +206 -0
  1369. package/src/server/lib/queue/delivery.server.ts +258 -0
  1370. package/src/server/lib/queue/schema-migration.server.ts +50 -0
  1371. package/src/server/lib/queue/store.server.test.ts +272 -0
  1372. package/src/server/lib/queue/store.server.ts +219 -0
  1373. package/src/server/lib/realtime/hub.server.test.ts +285 -0
  1374. package/src/server/lib/realtime/hub.server.ts +318 -0
  1375. package/src/server/lib/realtime/hub.types.ts +122 -0
  1376. package/src/server/lib/realtime/signals.server.ts +101 -0
  1377. package/src/server/lib/realtime/topics/btw.server.ts +25 -0
  1378. package/src/server/lib/realtime/topics/catalog.server.ts +126 -0
  1379. package/src/server/lib/realtime/topics/global.server.test.ts +50 -0
  1380. package/src/server/lib/realtime/topics/global.server.ts +52 -0
  1381. package/src/server/lib/realtime/topics/peer-relay.server.test.ts +246 -0
  1382. package/src/server/lib/realtime/topics/peer-relay.server.ts +84 -0
  1383. package/src/server/lib/realtime/topics/plugin.server.ts +30 -0
  1384. package/src/server/lib/realtime/topics/session-data.server.ts +98 -0
  1385. package/src/server/lib/realtime/topics/session.server.ts +123 -0
  1386. package/src/server/lib/realtime/topics/workspace.server.ts +106 -0
  1387. package/src/server/lib/realtime/topics.server.test.ts +255 -0
  1388. package/src/server/lib/realtime/topics.server.ts +261 -0
  1389. package/src/server/lib/remix-compat.ts +29 -0
  1390. package/src/server/lib/route-adapter.test.ts +322 -0
  1391. package/src/server/lib/route-adapter.ts +144 -0
  1392. package/src/server/lib/schedule/rows.server.ts +111 -0
  1393. package/src/server/lib/schedule/runtime.server.test.ts +191 -0
  1394. package/src/server/lib/schedule/runtime.server.ts +252 -0
  1395. package/src/server/lib/schedule/schema.server.ts +60 -0
  1396. package/src/server/lib/schedule/store.server.test.ts +231 -0
  1397. package/src/server/lib/schedule/store.server.ts +254 -0
  1398. package/src/server/lib/sse.ts +248 -0
  1399. package/src/server/lib/terminal/foreground.test.ts +163 -0
  1400. package/src/server/lib/terminal/foreground.ts +122 -0
  1401. package/src/server/lib/terminal/history.test.ts +118 -0
  1402. package/src/server/lib/terminal/history.ts +206 -0
  1403. package/src/server/lib/terminal/liveness.server.ts +99 -0
  1404. package/src/server/lib/terminal/runtime.server.ts +294 -0
  1405. package/src/server/lib/terminal/session.server.ts +256 -0
  1406. package/src/server/lib/terminal/shell.test.ts +129 -0
  1407. package/src/server/lib/terminal/shell.ts +146 -0
  1408. package/src/server/lib/terminal/spawn.test.ts +50 -0
  1409. package/src/server/lib/terminal/spawn.ts +51 -0
  1410. package/src/server/lib/terminal/store-liveness.test.ts +324 -0
  1411. package/src/server/lib/terminal/store.ts +72 -0
  1412. package/src/server/lib/tray/autostart.ts +238 -0
  1413. package/src/server/lib/tray/config.ts +141 -0
  1414. package/src/server/lib/tray/credential.test.ts +74 -0
  1415. package/src/server/lib/tray/credential.ts +81 -0
  1416. package/src/server/lib/tray/entry.ts +89 -0
  1417. package/src/server/lib/tray/host/darwin.js +180 -0
  1418. package/src/server/lib/tray/host/linux.js +187 -0
  1419. package/src/server/lib/tray/host/win32.ps1 +109 -0
  1420. package/src/server/lib/tray/hosts.ts +115 -0
  1421. package/src/server/lib/tray/runtime.server.ts +132 -0
  1422. package/src/server/lib/tray/tray.test.ts +225 -0
  1423. package/src/server/lib/updates/apply.ts +85 -0
  1424. package/src/server/lib/updates/changelog-file.ts +122 -0
  1425. package/src/server/lib/updates/changelog.test.ts +213 -0
  1426. package/src/server/lib/updates/changelog.ts +163 -0
  1427. package/src/server/lib/updates/check.ts +71 -0
  1428. package/src/server/lib/updates/install-method.ts +86 -0
  1429. package/src/server/lib/updates/install.test.ts +135 -0
  1430. package/src/server/lib/updates/install.ts +350 -0
  1431. package/src/server/lib/updates/npm.test.ts +137 -0
  1432. package/src/server/lib/updates/npm.ts +113 -0
  1433. package/src/server/lib/updates/omp.test.ts +116 -0
  1434. package/src/server/lib/updates/omp.ts +139 -0
  1435. package/src/server/lib/updates/release-url.ts +25 -0
  1436. package/src/server/lib/updates/single-flight.test.ts +61 -0
  1437. package/src/server/lib/updates/single-flight.ts +68 -0
  1438. package/src/server/lib/usage/deepseek.ts +58 -0
  1439. package/src/server/lib/usage/kenari-accounts.test.ts +162 -0
  1440. package/src/server/lib/usage/kenari.test.ts +258 -0
  1441. package/src/server/lib/usage/kenari.ts +255 -0
  1442. package/src/server/lib/usage/omp-usage.server.test.ts +126 -0
  1443. package/src/server/lib/usage/omp-usage.server.ts +203 -0
  1444. package/src/server/lib/usage/provider-key.test.ts +325 -0
  1445. package/src/server/lib/usage/provider-key.ts +194 -0
  1446. package/src/server/lib/usage/providers.server.test.ts +47 -0
  1447. package/src/server/lib/usage/providers.server.ts +214 -0
  1448. package/src/server/lib/usage/report.server.ts +156 -0
  1449. package/src/server/lib/usage/reset.server.test.ts +175 -0
  1450. package/src/server/lib/usage/reset.server.ts +206 -0
  1451. package/src/server/lib/usage/vendor-balance.server.test.ts +104 -0
  1452. package/src/server/lib/usage/vendor-balance.server.ts +284 -0
  1453. package/src/server/lib/wiki/git.test.ts +240 -0
  1454. package/src/server/lib/wiki/git.ts +79 -0
  1455. package/src/server/lib/wiki/mirror-reads.test.ts +78 -0
  1456. package/src/server/lib/wiki/mirror.server.ts +251 -0
  1457. package/src/server/lib/wiki/payload.server.ts +141 -0
  1458. package/src/server/lib/wiki/provider.server.ts +84 -0
  1459. package/src/server/lib/wiki/remote.test.ts +84 -0
  1460. package/src/server/lib/wiki/remote.ts +104 -0
  1461. package/src/server/lib/workspace/register-folder.server.ts +78 -0
  1462. package/src/server/mock.server.ts +27 -0
  1463. package/src/server/plugins/compress.ts +79 -0
  1464. package/src/server/plugins/shell.server.test.ts +98 -0
  1465. package/src/server/plugins/shell.server.ts +168 -0
  1466. package/src/server/plugins/ssr.ts +199 -0
  1467. package/src/server/plugins/static.test.ts +60 -0
  1468. package/src/server/plugins/static.ts +164 -0
  1469. package/src/server/routes/agent/command.test.ts +87 -0
  1470. package/src/server/routes/agent/command.ts +247 -0
  1471. package/src/server/routes/agent/index.ts +10 -0
  1472. package/src/server/routes/agent/new.ts +114 -0
  1473. package/src/server/routes/agent/prewarm.ts +27 -0
  1474. package/src/server/routes/auth/index.ts +14 -0
  1475. package/src/server/routes/auth/login.ts +94 -0
  1476. package/src/server/routes/auth/logout.ts +36 -0
  1477. package/src/server/routes/auth/password.ts +102 -0
  1478. package/src/server/routes/auth/revoke.test.ts +115 -0
  1479. package/src/server/routes/auth/revoke.ts +73 -0
  1480. package/src/server/routes/auth/routes.test.ts +322 -0
  1481. package/src/server/routes/auth/state.ts +34 -0
  1482. package/src/server/routes/browser/index.ts +6 -0
  1483. package/src/server/routes/browser/stream.test.ts +107 -0
  1484. package/src/server/routes/browser/stream.ts +217 -0
  1485. package/src/server/routes/btw/index.ts +6 -0
  1486. package/src/server/routes/btw/topics.ts +117 -0
  1487. package/src/server/routes/chamber/index.ts +15 -0
  1488. package/src/server/routes/chat/index.ts +14 -0
  1489. package/src/server/routes/chat/rewind.ts +116 -0
  1490. package/src/server/routes/chat/root.ts +78 -0
  1491. package/src/server/routes/chat/session.ts +235 -0
  1492. package/src/server/routes/chat/stream.test.ts +102 -0
  1493. package/src/server/routes/chat/stream.ts +111 -0
  1494. package/src/server/routes/chat/turns.ts +87 -0
  1495. package/src/server/routes/console/index.ts +18 -0
  1496. package/src/server/routes/console/restart.test.ts +98 -0
  1497. package/src/server/routes/console/restart.ts +44 -0
  1498. package/src/server/routes/dictation/ws.ts +116 -0
  1499. package/src/server/routes/files/index.ts +10 -0
  1500. package/src/server/routes/files/root.ts +29 -0
  1501. package/src/server/routes/files/toggle.ts +20 -0
  1502. package/src/server/routes/folders/clone.test.ts +167 -0
  1503. package/src/server/routes/folders/clone.ts +132 -0
  1504. package/src/server/routes/folders/create.ts +84 -0
  1505. package/src/server/routes/folders/folder.ts +124 -0
  1506. package/src/server/routes/folders/index.ts +22 -0
  1507. package/src/server/routes/folders/mkdir.ts +97 -0
  1508. package/src/server/routes/folders/routes.test.ts +185 -0
  1509. package/src/server/routes/fs/action-create.test.ts +90 -0
  1510. package/src/server/routes/fs/action-transfer.test.ts +159 -0
  1511. package/src/server/routes/fs/action.test.ts +64 -0
  1512. package/src/server/routes/fs/action.ts +175 -0
  1513. package/src/server/routes/fs/exists.test.ts +76 -0
  1514. package/src/server/routes/fs/exists.ts +53 -0
  1515. package/src/server/routes/fs/git-action.test.ts +334 -0
  1516. package/src/server/routes/fs/git-branch.test.ts +287 -0
  1517. package/src/server/routes/fs/git-loader.test.ts +105 -0
  1518. package/src/server/routes/fs/git-merge.test.ts +325 -0
  1519. package/src/server/routes/fs/git-repo-details.test.ts +152 -0
  1520. package/src/server/routes/fs/git-stash.test.ts +202 -0
  1521. package/src/server/routes/fs/git.ts +188 -0
  1522. package/src/server/routes/fs/index.ts +26 -0
  1523. package/src/server/routes/fs/raw.test.ts +124 -0
  1524. package/src/server/routes/fs/raw.ts +115 -0
  1525. package/src/server/routes/fs/read.test.ts +146 -0
  1526. package/src/server/routes/fs/read.ts +324 -0
  1527. package/src/server/routes/fs/replace.ts +69 -0
  1528. package/src/server/routes/fs/scope.test.ts +171 -0
  1529. package/src/server/routes/fs/scope.ts +106 -0
  1530. package/src/server/routes/fs/search.test.ts +210 -0
  1531. package/src/server/routes/fs/search.ts +205 -0
  1532. package/src/server/routes/fs/validate.ts +62 -0
  1533. package/src/server/routes/health/index.ts +6 -0
  1534. package/src/server/routes/health/probe.ts +59 -0
  1535. package/src/server/routes/index.ts +60 -0
  1536. package/src/server/routes/models/index.ts +8 -0
  1537. package/src/server/routes/models/roles.ts +31 -0
  1538. package/src/server/routes/models/root.ts +205 -0
  1539. package/src/server/routes/omp/artifact.ts +42 -0
  1540. package/src/server/routes/omp/blob.ts +54 -0
  1541. package/src/server/routes/omp/extensions.ts +34 -0
  1542. package/src/server/routes/omp/index.ts +27 -0
  1543. package/src/server/routes/omp/login.ts +112 -0
  1544. package/src/server/routes/omp/reload-engine.ts +39 -0
  1545. package/src/server/routes/omp/routes.test.ts +133 -0
  1546. package/src/server/routes/omp/state.ts +22 -0
  1547. package/src/server/routes/panels/bindings.ts +23 -0
  1548. package/src/server/routes/panels/build.ts +72 -0
  1549. package/src/server/routes/panels/bundle.ts +71 -0
  1550. package/src/server/routes/panels/css.test.ts +141 -0
  1551. package/src/server/routes/panels/css.ts +89 -0
  1552. package/src/server/routes/panels/icon.ts +64 -0
  1553. package/src/server/routes/panels/install.ts +240 -0
  1554. package/src/server/routes/panels/panel-routes.test-util.ts +126 -0
  1555. package/src/server/routes/panels/readme.ts +69 -0
  1556. package/src/server/routes/panels/registry.ts +27 -0
  1557. package/src/server/routes/panels/routes.test.ts +290 -0
  1558. package/src/server/routes/panels/server-half.test.ts +95 -0
  1559. package/src/server/routes/plugins/bindings.ts +16 -0
  1560. package/src/server/routes/plugins/http.ts +56 -0
  1561. package/src/server/routes/plugins/routes.test.ts +254 -0
  1562. package/src/server/routes/plugins/rpc.ts +65 -0
  1563. package/src/server/routes/plugins/state.ts +36 -0
  1564. package/src/server/routes/realtime/ws.ts +114 -0
  1565. package/src/server/routes/schedule/bindings.ts +8 -0
  1566. package/src/server/routes/schedule/body.ts +110 -0
  1567. package/src/server/routes/schedule/index.ts +155 -0
  1568. package/src/server/routes/schedule/runs.ts +23 -0
  1569. package/src/server/routes/sessions/delete.test.ts +84 -0
  1570. package/src/server/routes/sessions/delete.ts +83 -0
  1571. package/src/server/routes/sessions/folder.ts +16 -0
  1572. package/src/server/routes/sessions/index.ts +47 -0
  1573. package/src/server/routes/sessions/list.ts +23 -0
  1574. package/src/server/routes/sessions/queue.ts +134 -0
  1575. package/src/server/routes/sessions/routes-queue.test.ts +237 -0
  1576. package/src/server/routes/sessions/routes-read.test.ts +165 -0
  1577. package/src/server/routes/sessions/routes.test.ts +316 -0
  1578. package/src/server/routes/sessions/session.ts +291 -0
  1579. package/src/server/routes/sessions/subagent-control.ts +75 -0
  1580. package/src/server/routes/sessions/subagents.ts +82 -0
  1581. package/src/server/routes/settings/agents.ts +128 -0
  1582. package/src/server/routes/settings/behavior.ts +125 -0
  1583. package/src/server/routes/settings/commands.ts +217 -0
  1584. package/src/server/routes/settings/index.ts +39 -0
  1585. package/src/server/routes/settings/mcp-test.ts +71 -0
  1586. package/src/server/routes/settings/mcp.ts +261 -0
  1587. package/src/server/routes/settings/model-override.ts +69 -0
  1588. package/src/server/routes/settings/omp-config.ts +50 -0
  1589. package/src/server/routes/settings/plugins.ts +218 -0
  1590. package/src/server/routes/settings/projects.ts +89 -0
  1591. package/src/server/routes/settings/provider-logout.test.ts +38 -0
  1592. package/src/server/routes/settings/provider-logout.ts +104 -0
  1593. package/src/server/routes/settings/provider-model.ts +107 -0
  1594. package/src/server/routes/settings/provider-models.ts +190 -0
  1595. package/src/server/routes/settings/providers.ts +182 -0
  1596. package/src/server/routes/settings/root.ts +45 -0
  1597. package/src/server/routes/settings/settings-config-routes.test.ts +271 -0
  1598. package/src/server/routes/settings/settings-store-routes.test.ts +334 -0
  1599. package/src/server/routes/settings/skills.ts +227 -0
  1600. package/src/server/routes/settings/usage-reset.ts +60 -0
  1601. package/src/server/routes/settings/usage.ts +36 -0
  1602. package/src/server/routes/telemetry/context.ts +59 -0
  1603. package/src/server/routes/telemetry/index.ts +10 -0
  1604. package/src/server/routes/telemetry/raw-messages.ts +80 -0
  1605. package/src/server/routes/telemetry/tokens.ts +166 -0
  1606. package/src/server/routes/terminal/index.ts +6 -0
  1607. package/src/server/routes/terminal/sessions.ts +24 -0
  1608. package/src/server/routes/terminal/ws.ts +155 -0
  1609. package/src/server/routes/updates/apply.ts +140 -0
  1610. package/src/server/routes/updates/changelog.ts +32 -0
  1611. package/src/server/routes/updates/check.ts +27 -0
  1612. package/src/server/routes/updates/index.ts +10 -0
  1613. package/src/server/routes/updates/routes.test.ts +269 -0
  1614. package/src/server/routes/well-known/devtools.ts +9 -0
  1615. package/src/server/routes/well-known/index.ts +6 -0
  1616. package/src/server/routes/wiki/asset.ts +69 -0
  1617. package/src/server/routes/wiki/index.ts +15 -0
  1618. package/src/server/routes/wiki/page.ts +88 -0
  1619. package/src/server/routes/wiki/repo.ts +30 -0
  1620. package/src/shared/lib/auth/handover.test.ts +153 -0
  1621. package/src/shared/lib/auth/handover.ts +102 -0
  1622. package/src/shared/lib/auth/password.ts +72 -0
  1623. package/src/shared/lib/browser/activity.ts +115 -0
  1624. package/src/shared/lib/browser/browser-cdp.test.ts +350 -0
  1625. package/src/shared/lib/browser/browser-helpers.test.ts +218 -0
  1626. package/src/shared/lib/browser/browser-viewer.test.ts +312 -0
  1627. package/src/shared/lib/browser/browser-watcher.test.ts +202 -0
  1628. package/src/shared/lib/browser/cdp.ts +201 -0
  1629. package/src/shared/lib/browser/connection.ts +81 -0
  1630. package/src/shared/lib/browser/observer.ts +129 -0
  1631. package/src/shared/lib/browser/page-context.ts +20 -0
  1632. package/src/shared/lib/browser/targets.test.ts +45 -0
  1633. package/src/shared/lib/browser/targets.ts +74 -0
  1634. package/src/shared/lib/browser/url.ts +21 -0
  1635. package/src/shared/lib/browser/util.ts +20 -0
  1636. package/src/shared/lib/browser/viewer.ts +303 -0
  1637. package/src/shared/lib/browser/watcher.ts +75 -0
  1638. package/src/shared/lib/chat/ask-questions.test.ts +169 -0
  1639. package/src/shared/lib/chat/ask-questions.ts +284 -0
  1640. package/src/shared/lib/chat/attachments.test.ts +240 -0
  1641. package/src/shared/lib/chat/attachments.ts +299 -0
  1642. package/src/shared/lib/chat/btw/client.ts +83 -0
  1643. package/src/shared/lib/chat/capitalize.ts +9 -0
  1644. package/src/shared/lib/chat/chat-display.test.ts +284 -0
  1645. package/src/shared/lib/chat/composer/client.test.ts +48 -0
  1646. package/src/shared/lib/chat/composer/client.ts +233 -0
  1647. package/src/shared/lib/chat/composer/commands.test.ts +307 -0
  1648. package/src/shared/lib/chat/composer/commands.ts +290 -0
  1649. package/src/shared/lib/chat/composer/composer.test.ts +195 -0
  1650. package/src/shared/lib/chat/composer/draft.ts +39 -0
  1651. package/src/shared/lib/chat/composer/filter.test.ts +178 -0
  1652. package/src/shared/lib/chat/composer/filter.ts +76 -0
  1653. package/src/shared/lib/chat/composer/keybindings.test.ts +74 -0
  1654. package/src/shared/lib/chat/composer/keybindings.ts +55 -0
  1655. package/src/shared/lib/chat/composer/owned-commands.test.ts +53 -0
  1656. package/src/shared/lib/chat/composer/scope.test.ts +93 -0
  1657. package/src/shared/lib/chat/composer/translate.test.ts +199 -0
  1658. package/src/shared/lib/chat/composer/translate.ts +149 -0
  1659. package/src/shared/lib/chat/composer/trigger.test.ts +276 -0
  1660. package/src/shared/lib/chat/composer/trigger.ts +207 -0
  1661. package/src/shared/lib/chat/composer/tui-only.test.ts +104 -0
  1662. package/src/shared/lib/chat/composer/tui-only.ts +144 -0
  1663. package/src/shared/lib/chat/context/usage.test.ts +73 -0
  1664. package/src/shared/lib/chat/context/usage.ts +77 -0
  1665. package/src/shared/lib/chat/detect-format.ts +38 -0
  1666. package/src/shared/lib/chat/duration.ts +82 -0
  1667. package/src/shared/lib/chat/excerpt.ts +115 -0
  1668. package/src/shared/lib/chat/new-chat-seed.test.ts +51 -0
  1669. package/src/shared/lib/chat/new-chat-seed.ts +36 -0
  1670. package/src/shared/lib/chat/notice-row.test.ts +116 -0
  1671. package/src/shared/lib/chat/notice-row.ts +79 -0
  1672. package/src/shared/lib/chat/notice-text.ts +35 -0
  1673. package/src/shared/lib/chat/omp/abort.ts +41 -0
  1674. package/src/shared/lib/chat/omp/agent-events.test.ts +307 -0
  1675. package/src/shared/lib/chat/omp/agent-events.ts +302 -0
  1676. package/src/shared/lib/chat/omp/available-commands-cache.test.ts +67 -0
  1677. package/src/shared/lib/chat/omp/command-output-ansi.test.ts +84 -0
  1678. package/src/shared/lib/chat/omp/fold-deps.ts +70 -0
  1679. package/src/shared/lib/chat/omp/fold.test.ts +245 -0
  1680. package/src/shared/lib/chat/omp/mode-marker.test.ts +116 -0
  1681. package/src/shared/lib/chat/omp/status.ts +42 -0
  1682. package/src/shared/lib/chat/omp/subagent-frames.ts +51 -0
  1683. package/src/shared/lib/chat/omp/terminal-messages.ts +47 -0
  1684. package/src/shared/lib/chat/omp/tool-details.test.ts +134 -0
  1685. package/src/shared/lib/chat/omp/tool-frames.test.ts +140 -0
  1686. package/src/shared/lib/chat/omp/tool-frames.ts +107 -0
  1687. package/src/shared/lib/chat/omp/tool-results.ts +180 -0
  1688. package/src/shared/lib/chat/omp/transport-frames.test.ts +70 -0
  1689. package/src/shared/lib/chat/omp/transport-frames.ts +95 -0
  1690. package/src/shared/lib/chat/read-sse.ts +99 -0
  1691. package/src/shared/lib/chat/stream-service.ts +197 -0
  1692. package/src/shared/lib/chat/task-result-parser.ts +166 -0
  1693. package/src/shared/lib/chat/text-file.ts +148 -0
  1694. package/src/shared/lib/chat/timeline/command-output.ts +78 -0
  1695. package/src/shared/lib/chat/timeline/omp-callbacks.test.ts +314 -0
  1696. package/src/shared/lib/chat/timeline/omp-callbacks.ts +314 -0
  1697. package/src/shared/lib/chat/timeline/provider-retry.test.ts +120 -0
  1698. package/src/shared/lib/chat/timeline/provider-retry.ts +103 -0
  1699. package/src/shared/lib/chat/timeline/run-footer.test.ts +158 -0
  1700. package/src/shared/lib/chat/timeline/run-footer.ts +146 -0
  1701. package/src/shared/lib/chat/timeline/run-signals.test.ts +87 -0
  1702. package/src/shared/lib/chat/timeline/run-signals.ts +73 -0
  1703. package/src/shared/lib/chat/timeline/steer-report.ts +35 -0
  1704. package/src/shared/lib/chat/timeline/stream-callbacks.ts +202 -0
  1705. package/src/shared/lib/chat/timeline/stream-coalescer.ts +66 -0
  1706. package/src/shared/lib/chat/timeline/stream-raf.test.ts +104 -0
  1707. package/src/shared/lib/chat/timeline/stream-raf.ts +59 -0
  1708. package/src/shared/lib/chat/timeline/stream.test.ts +282 -0
  1709. package/src/shared/lib/chat/timeline/tool-phrases.test.ts +185 -0
  1710. package/src/shared/lib/chat/timeline/tool-phrases.ts +235 -0
  1711. package/src/shared/lib/chat/timeline/tool-verbs.test.ts +229 -0
  1712. package/src/shared/lib/chat/timeline/tool-verbs.ts +180 -0
  1713. package/src/shared/lib/chat/timeline/turns.ts +37 -0
  1714. package/src/shared/lib/chat/title-case.ts +293 -0
  1715. package/src/shared/lib/chat/todo/nested-phase.ts +64 -0
  1716. package/src/shared/lib/chat/todo/parser.test.ts +165 -0
  1717. package/src/shared/lib/chat/todo/parser.ts +262 -0
  1718. package/src/shared/lib/chat/todo/progress.test.ts +265 -0
  1719. package/src/shared/lib/chat/todo/progress.ts +97 -0
  1720. package/src/shared/lib/chat/todo/snapshot.test.ts +156 -0
  1721. package/src/shared/lib/chat/todo/snapshot.ts +215 -0
  1722. package/src/shared/lib/chat/tool/artifact-view.test.ts +66 -0
  1723. package/src/shared/lib/chat/tool/artifact-view.ts +80 -0
  1724. package/src/shared/lib/chat/tool/artifact.test.ts +74 -0
  1725. package/src/shared/lib/chat/tool/artifact.ts +66 -0
  1726. package/src/shared/lib/chat/tool/labels.ts +55 -0
  1727. package/src/shared/lib/chat/tool/output-window.test.ts +69 -0
  1728. package/src/shared/lib/chat/tool/output-window.ts +73 -0
  1729. package/src/shared/lib/chat/tool/proc-facts.ts +93 -0
  1730. package/src/shared/lib/chat/tool/summary-proc.test.ts +118 -0
  1731. package/src/shared/lib/chat/tool/summary-wait.test.ts +92 -0
  1732. package/src/shared/lib/chat/tool/summary.test.ts +329 -0
  1733. package/src/shared/lib/chat/tool/summary.ts +349 -0
  1734. package/src/shared/lib/chat/tool/wait-facts.ts +50 -0
  1735. package/src/shared/lib/chat/tool-output.test.ts +206 -0
  1736. package/src/shared/lib/chat/tool-output.ts +68 -0
  1737. package/src/shared/lib/chat/tool-status.ts +20 -0
  1738. package/src/shared/lib/chat/xml-envelope.test.ts +208 -0
  1739. package/src/shared/lib/chat/xml-envelope.ts +151 -0
  1740. package/src/shared/lib/chat/xml-tag.test.ts +257 -0
  1741. package/src/shared/lib/chat/xml-tag.ts +221 -0
  1742. package/src/shared/lib/code/ansi.ts +24 -0
  1743. package/src/shared/lib/code/editor/commands.test.ts +155 -0
  1744. package/src/shared/lib/code/editor/commands.ts +260 -0
  1745. package/src/shared/lib/code/editor/edits.test.ts +100 -0
  1746. package/src/shared/lib/code/editor/edits.ts +122 -0
  1747. package/src/shared/lib/code/editor/find-status.test.ts +50 -0
  1748. package/src/shared/lib/code/editor/find-status.ts +36 -0
  1749. package/src/shared/lib/code/editor/find.test.ts +203 -0
  1750. package/src/shared/lib/code/editor/find.ts +236 -0
  1751. package/src/shared/lib/code/editor/history.test.ts +118 -0
  1752. package/src/shared/lib/code/editor/history.ts +101 -0
  1753. package/src/shared/lib/code/editor/keymap.test.ts +109 -0
  1754. package/src/shared/lib/code/editor/keymap.ts +151 -0
  1755. package/src/shared/lib/code/editor/layers.test.ts +77 -0
  1756. package/src/shared/lib/code/editor/layers.ts +67 -0
  1757. package/src/shared/lib/code/editor/line-edits.test.ts +131 -0
  1758. package/src/shared/lib/code/editor/line-edits.ts +159 -0
  1759. package/src/shared/lib/code/editor/lines.test.ts +81 -0
  1760. package/src/shared/lib/code/editor/lines.ts +83 -0
  1761. package/src/shared/lib/code/editor/marks.test.ts +86 -0
  1762. package/src/shared/lib/code/editor/marks.ts +106 -0
  1763. package/src/shared/lib/code/editor/occurrences.test.ts +117 -0
  1764. package/src/shared/lib/code/editor/occurrences.ts +111 -0
  1765. package/src/shared/lib/code/editor/palette.test.ts +91 -0
  1766. package/src/shared/lib/code/editor/palette.ts +92 -0
  1767. package/src/shared/lib/code/editor/reset-css.test.ts +35 -0
  1768. package/src/shared/lib/code/editor/reset-css.ts +32 -0
  1769. package/src/shared/lib/code/editor/text-commands.test.ts +178 -0
  1770. package/src/shared/lib/code/editor/text-commands.ts +154 -0
  1771. package/src/shared/lib/code/editor/typography.test.ts +93 -0
  1772. package/src/shared/lib/code/editor/typography.ts +86 -0
  1773. package/src/shared/lib/code/format.ts +17 -0
  1774. package/src/shared/lib/code/highlight-cache.test.ts +121 -0
  1775. package/src/shared/lib/code/highlight-cache.ts +99 -0
  1776. package/src/shared/lib/code/highlighter-lazy.ts +106 -0
  1777. package/src/shared/lib/code/highlighter.ts +132 -0
  1778. package/src/shared/lib/code/language.ts +165 -0
  1779. package/src/shared/lib/code/lazy-window.test.ts +161 -0
  1780. package/src/shared/lib/code/lazy-window.ts +156 -0
  1781. package/src/shared/lib/code/line-endings.test.ts +38 -0
  1782. package/src/shared/lib/code/line-endings.ts +56 -0
  1783. package/src/shared/lib/code/outline/document.ts +56 -0
  1784. package/src/shared/lib/code/outline/extract.test.ts +246 -0
  1785. package/src/shared/lib/code/outline/extract.ts +57 -0
  1786. package/src/shared/lib/code/outline/languages.test.ts +246 -0
  1787. package/src/shared/lib/code/outline/languages.ts +266 -0
  1788. package/src/shared/lib/code/outline/rules.ts +285 -0
  1789. package/src/shared/lib/code/outline/scan.ts +184 -0
  1790. package/src/shared/lib/code/outline/spec.ts +24 -0
  1791. package/src/shared/lib/code/outline/types.ts +87 -0
  1792. package/src/shared/lib/code/outline/walk.ts +231 -0
  1793. package/src/shared/lib/code/parser.ts +237 -0
  1794. package/src/shared/lib/code/shiki-langs.ts +93 -0
  1795. package/src/shared/lib/code/shiki-themes.ts +18 -0
  1796. package/src/shared/lib/code/syntax-highlight.test.ts +340 -0
  1797. package/src/shared/lib/code/syntax-highlight.ts +207 -0
  1798. package/src/shared/lib/code/windowed-highlight.ts +114 -0
  1799. package/src/shared/lib/db/transaction.server.ts +20 -0
  1800. package/src/shared/lib/dictation/audio.ts +75 -0
  1801. package/src/shared/lib/dictation/models.test.ts +95 -0
  1802. package/src/shared/lib/dictation/models.ts +139 -0
  1803. package/src/shared/lib/dictation/protocol.ts +110 -0
  1804. package/src/shared/lib/fonts/NOTICE.md +44 -0
  1805. package/src/shared/lib/fonts/nerd-symbols.css +55 -0
  1806. package/src/shared/lib/fonts/nerd-symbols.test.ts +176 -0
  1807. package/src/shared/lib/fonts/symbols-nerd-font-mono.woff2 +0 -0
  1808. package/src/shared/lib/format/number.test.ts +127 -0
  1809. package/src/shared/lib/format/number.ts +69 -0
  1810. package/src/shared/lib/format/time.test.ts +113 -0
  1811. package/src/shared/lib/format/time.ts +58 -0
  1812. package/src/shared/lib/fs/browse.ts +45 -0
  1813. package/src/shared/lib/fs/clipboard.test.ts +182 -0
  1814. package/src/shared/lib/fs/clipboard.ts +182 -0
  1815. package/src/shared/lib/fs/commit-count.test.ts +50 -0
  1816. package/src/shared/lib/fs/commit-count.ts +34 -0
  1817. package/src/shared/lib/fs/commit-page.ts +10 -0
  1818. package/src/shared/lib/fs/commit-row.ts +65 -0
  1819. package/src/shared/lib/fs/csv.ts +159 -0
  1820. package/src/shared/lib/fs/diff-parser.test.ts +116 -0
  1821. package/src/shared/lib/fs/diff-parser.ts +213 -0
  1822. package/src/shared/lib/fs/document-kind.test.ts +189 -0
  1823. package/src/shared/lib/fs/document-kind.ts +136 -0
  1824. package/src/shared/lib/fs/excerpt-diff.test.ts +130 -0
  1825. package/src/shared/lib/fs/excerpt-diff.ts +127 -0
  1826. package/src/shared/lib/fs/file-kind-classify.test.ts +143 -0
  1827. package/src/shared/lib/fs/file-kind.test.ts +256 -0
  1828. package/src/shared/lib/fs/file-kind.ts +283 -0
  1829. package/src/shared/lib/fs/file-tree.ts +31 -0
  1830. package/src/shared/lib/fs/fs-helpers.test.ts +318 -0
  1831. package/src/shared/lib/fs/git-graph.test.ts +211 -0
  1832. package/src/shared/lib/fs/git-graph.ts +184 -0
  1833. package/src/shared/lib/fs/git-status.test.ts +245 -0
  1834. package/src/shared/lib/fs/git-status.ts +196 -0
  1835. package/src/shared/lib/fs/git-unmerged.test.ts +123 -0
  1836. package/src/shared/lib/fs/git-unmerged.ts +100 -0
  1837. package/src/shared/lib/fs/paths.test.ts +90 -0
  1838. package/src/shared/lib/fs/paths.ts +109 -0
  1839. package/src/shared/lib/fs/repo-groups.ts +85 -0
  1840. package/src/shared/lib/fs/repo-label.test.ts +118 -0
  1841. package/src/shared/lib/fs/repo-label.ts +55 -0
  1842. package/src/shared/lib/fs/search-list.test.ts +139 -0
  1843. package/src/shared/lib/fs/search-list.ts +187 -0
  1844. package/src/shared/lib/fs/search-row.test.ts +66 -0
  1845. package/src/shared/lib/fs/search-row.ts +55 -0
  1846. package/src/shared/lib/git/url.test.ts +69 -0
  1847. package/src/shared/lib/git/url.ts +76 -0
  1848. package/src/shared/lib/markdown/autolink.test.ts +32 -0
  1849. package/src/shared/lib/markdown/autolink.ts +50 -0
  1850. package/src/shared/lib/markdown/directives.ts +96 -0
  1851. package/src/shared/lib/markdown/document-urls.test.ts +68 -0
  1852. package/src/shared/lib/markdown/document-urls.ts +118 -0
  1853. package/src/shared/lib/markdown/fira-code-fonts.css +51 -0
  1854. package/src/shared/lib/markdown/katex-fonts.css +20 -0
  1855. package/src/shared/lib/markdown/katex.ts +111 -0
  1856. package/src/shared/lib/markdown/marked.ts +336 -0
  1857. package/src/shared/lib/markdown/math.test.ts +178 -0
  1858. package/src/shared/lib/markdown/mermaid.ts +169 -0
  1859. package/src/shared/lib/markdown/sanitize.ts +191 -0
  1860. package/src/shared/lib/markdown/table.test.ts +136 -0
  1861. package/src/shared/lib/models/catalog.ts +255 -0
  1862. package/src/shared/lib/models/client.ts +62 -0
  1863. package/src/shared/lib/models/identity.ts +21 -0
  1864. package/src/shared/lib/models/models-shared.test.ts +338 -0
  1865. package/src/shared/lib/models/preferences.test.ts +131 -0
  1866. package/src/shared/lib/models/preferences.ts +88 -0
  1867. package/src/shared/lib/models/provider/cleanup.ts +20 -0
  1868. package/src/shared/lib/models/provider/connection.ts +78 -0
  1869. package/src/shared/lib/models/provider/dialect.test.ts +258 -0
  1870. package/src/shared/lib/models/provider/dialect.ts +208 -0
  1871. package/src/shared/lib/models/provider/glyph.test.ts +116 -0
  1872. package/src/shared/lib/models/provider/glyph.ts +213 -0
  1873. package/src/shared/lib/models/provider/label.ts +40 -0
  1874. package/src/shared/lib/models/provider/models.test.ts +306 -0
  1875. package/src/shared/lib/models/provider/models.ts +227 -0
  1876. package/src/shared/lib/models/provider/presets.test.ts +198 -0
  1877. package/src/shared/lib/models/provider/presets.ts +83 -0
  1878. package/src/shared/lib/models/provider/provider-ui.test.ts +316 -0
  1879. package/src/shared/lib/models/remote-list.ts +125 -0
  1880. package/src/shared/lib/models/server-cache.ts +37 -0
  1881. package/src/shared/lib/models/thinking-levels.test.ts +102 -0
  1882. package/src/shared/lib/models/thinking-levels.ts +68 -0
  1883. package/src/shared/lib/omp/config/access-mode.server.ts +27 -0
  1884. package/src/shared/lib/omp/config/access-mode.ts +31 -0
  1885. package/src/shared/lib/omp/config/schema-extras.ts +252 -0
  1886. package/src/shared/lib/omp/config/schema-types.ts +49 -0
  1887. package/src/shared/lib/omp/config/schema.test.ts +214 -0
  1888. package/src/shared/lib/omp/config/schema.ts +81 -0
  1889. package/src/shared/lib/omp/dialog-methods.ts +57 -0
  1890. package/src/shared/lib/omp/mode/budget.ts +21 -0
  1891. package/src/shared/lib/omp/mode/client-signal.ts +35 -0
  1892. package/src/shared/lib/omp/mode/constants.ts +91 -0
  1893. package/src/shared/lib/omp/mode/format.ts +36 -0
  1894. package/src/shared/lib/omp/mode/markers.test.ts +111 -0
  1895. package/src/shared/lib/omp/mode/markers.ts +105 -0
  1896. package/src/shared/lib/omp/mode/notice.test.ts +107 -0
  1897. package/src/shared/lib/omp/mode/notice.ts +135 -0
  1898. package/src/shared/lib/omp/mode/status.ts +39 -0
  1899. package/src/shared/lib/omp/mode/tables.test.ts +217 -0
  1900. package/src/shared/lib/omp/mode/types.ts +190 -0
  1901. package/src/shared/lib/omp/rpc/frame.test.ts +241 -0
  1902. package/src/shared/lib/omp/rpc/frame.ts +151 -0
  1903. package/src/shared/lib/omp/session/default-title.test.ts +79 -0
  1904. package/src/shared/lib/omp/session/default-title.ts +83 -0
  1905. package/src/shared/lib/omp/session/hashline-patch.test.ts +89 -0
  1906. package/src/shared/lib/omp/session/hashline-patch.ts +134 -0
  1907. package/src/shared/lib/omp/session/inlined-attachments.test.ts +82 -0
  1908. package/src/shared/lib/omp/session/jsonl.test.ts +178 -0
  1909. package/src/shared/lib/omp/session/jsonl.ts +182 -0
  1910. package/src/shared/lib/omp/session/mapper.test.ts +299 -0
  1911. package/src/shared/lib/omp/session/mapper.ts +175 -0
  1912. package/src/shared/lib/omp/session/messages-map.test.ts +340 -0
  1913. package/src/shared/lib/omp/session/messages-map.ts +259 -0
  1914. package/src/shared/lib/omp/session/messages-parse.ts +73 -0
  1915. package/src/shared/lib/omp/session/narration.test.ts +113 -0
  1916. package/src/shared/lib/omp/session/operator-title.test.ts +99 -0
  1917. package/src/shared/lib/omp/session/operator-title.ts +136 -0
  1918. package/src/shared/lib/omp/session/parse-message-blocks-attachments.test.ts +156 -0
  1919. package/src/shared/lib/omp/session/parse-message-blocks-toolcall.test.ts +106 -0
  1920. package/src/shared/lib/omp/session/parse-message-blocks.test.ts +322 -0
  1921. package/src/shared/lib/omp/session/parse-message-blocks.ts +328 -0
  1922. package/src/shared/lib/omp/session/prewarm-misc.test.ts +326 -0
  1923. package/src/shared/lib/omp/session/prewarm.ts +41 -0
  1924. package/src/shared/lib/omp/session/proc.test.ts +256 -0
  1925. package/src/shared/lib/omp/session/proc.ts +322 -0
  1926. package/src/shared/lib/omp/session/schema-migrations.ts +35 -0
  1927. package/src/shared/lib/omp/session/sidebar.test.ts +180 -0
  1928. package/src/shared/lib/omp/session/sidebar.ts +77 -0
  1929. package/src/shared/lib/omp/session/skill-bubble.test.ts +94 -0
  1930. package/src/shared/lib/omp/session/stream-heal.server.test.ts +123 -0
  1931. package/src/shared/lib/omp/session/stream-heal.server.ts +175 -0
  1932. package/src/shared/lib/omp/session/stream-state.server.test.ts +106 -0
  1933. package/src/shared/lib/omp/session/stream-state.server.ts +199 -0
  1934. package/src/shared/lib/omp/session/telemetry-blocks.ts +60 -0
  1935. package/src/shared/lib/omp/session/timestamps.ts +20 -0
  1936. package/src/shared/lib/omp/session/tool-duration.test.ts +61 -0
  1937. package/src/shared/lib/omp/session/tool-images.test.ts +95 -0
  1938. package/src/shared/lib/omp/session/tool-images.ts +98 -0
  1939. package/src/shared/lib/omp/session/turn-error.ts +40 -0
  1940. package/src/shared/lib/omp/session/wait.test.ts +167 -0
  1941. package/src/shared/lib/omp/session/wait.ts +267 -0
  1942. package/src/shared/lib/omp/subagent/control.ts +46 -0
  1943. package/src/shared/lib/omp/subagent/history/client.ts +76 -0
  1944. package/src/shared/lib/omp/subagent/history/settlement.test.ts +344 -0
  1945. package/src/shared/lib/omp/subagent/history/settlement.ts +113 -0
  1946. package/src/shared/lib/omp/subagent/history/status.ts +40 -0
  1947. package/src/shared/lib/omp/subagent/label.test.ts +94 -0
  1948. package/src/shared/lib/omp/subagent/label.ts +84 -0
  1949. package/src/shared/lib/omp/subagent/parse.test.ts +88 -0
  1950. package/src/shared/lib/omp/subagent/parse.ts +301 -0
  1951. package/src/shared/lib/omp/subagent/result-details.ts +53 -0
  1952. package/src/shared/lib/omp/subagent/transcript-client.test.ts +100 -0
  1953. package/src/shared/lib/omp/subagent/transcript-client.ts +194 -0
  1954. package/src/shared/lib/panels/capabilities.test.ts +78 -0
  1955. package/src/shared/lib/panels/capabilities.ts +40 -0
  1956. package/src/shared/lib/panels/css-scope.test.ts +98 -0
  1957. package/src/shared/lib/panels/css-scope.ts +171 -0
  1958. package/src/shared/lib/panels/resolve-asset.test.ts +74 -0
  1959. package/src/shared/lib/panels/resolve-asset.ts +45 -0
  1960. package/src/shared/lib/plugins/protocol.ts +70 -0
  1961. package/src/shared/lib/realtime/client.ts +328 -0
  1962. package/src/shared/lib/realtime/connection.test.ts +301 -0
  1963. package/src/shared/lib/realtime/connection.ts +314 -0
  1964. package/src/shared/lib/realtime/protocol.ts +297 -0
  1965. package/src/shared/lib/realtime/state.ts +174 -0
  1966. package/src/shared/lib/schedule/parse.test.ts +187 -0
  1967. package/src/shared/lib/schedule/parse.ts +303 -0
  1968. package/src/shared/lib/settings/client.test.ts +72 -0
  1969. package/src/shared/lib/settings/client.ts +129 -0
  1970. package/src/shared/lib/settings/diff.test.ts +31 -0
  1971. package/src/shared/lib/settings/diff.ts +37 -0
  1972. package/src/shared/lib/settings/keys.ts +51 -0
  1973. package/src/shared/lib/theme/catalog.test.ts +168 -0
  1974. package/src/shared/lib/theme/catalog.ts +98 -0
  1975. package/src/shared/lib/theme/chrome.test.ts +53 -0
  1976. package/src/shared/lib/theme/chrome.ts +41 -0
  1977. package/src/shared/lib/theme/color.test.ts +102 -0
  1978. package/src/shared/lib/theme/color.ts +88 -0
  1979. package/src/shared/lib/theme/css.ts +70 -0
  1980. package/src/shared/lib/theme/palettes/dark.ts +313 -0
  1981. package/src/shared/lib/theme/palettes/kabmo.ts +61 -0
  1982. package/src/shared/lib/theme/palettes/light.ts +313 -0
  1983. package/src/shared/lib/theme/theme.test.ts +199 -0
  1984. package/src/shared/lib/ui/key-binding.test.ts +134 -0
  1985. package/src/shared/lib/ui/key-binding.ts +143 -0
  1986. package/src/shared/lib/updates/popup-state.test.ts +98 -0
  1987. package/src/shared/lib/updates/popup-state.ts +67 -0
  1988. package/src/shared/lib/updates/popup.test.ts +30 -0
  1989. package/src/shared/lib/updates/progress.test.ts +54 -0
  1990. package/src/shared/lib/updates/progress.ts +50 -0
  1991. package/src/shared/lib/updates/semver.test.ts +147 -0
  1992. package/src/shared/lib/updates/semver.ts +109 -0
  1993. package/src/shared/lib/util/guards.test.ts +48 -0
  1994. package/src/shared/lib/util/guards.ts +14 -0
  1995. package/src/shared/lib/util/platform.test.ts +87 -0
  1996. package/src/shared/lib/util/platform.ts +30 -0
  1997. package/src/shared/lib/wiki/document-urls.test.ts +85 -0
  1998. package/src/shared/lib/wiki/document-urls.ts +109 -0
  1999. package/src/shared/lib/wiki/pages.test.ts +265 -0
  2000. package/src/shared/lib/wiki/pages.ts +242 -0
  2001. package/src/shared/lib/wiki/sidebar.test.ts +265 -0
  2002. package/src/shared/lib/wiki/sidebar.ts +170 -0
  2003. package/src/shared/lib/workspace/active-project.ts +42 -0
  2004. package/src/shared/lib/workspace/file-tab-id.ts +29 -0
  2005. package/src/shared/lib/workspace/keymap.test.ts +82 -0
  2006. package/src/shared/lib/workspace/keymap.ts +30 -0
  2007. package/src/shared/lib/workspace/panel-ids.test.ts +66 -0
  2008. package/src/shared/lib/workspace/panel-ids.ts +59 -0
  2009. package/src/shared/lib/workspace/panel-order.test.ts +133 -0
  2010. package/src/shared/lib/workspace/panel-order.ts +127 -0
  2011. package/src/shared/lib/workspace/panel-widths.test.ts +276 -0
  2012. package/src/shared/lib/workspace/panel-widths.ts +329 -0
  2013. package/src/shared/lib/workspace/project-icon.ts +29 -0
  2014. package/src/shared/lib/workspace/project-settings-migration.ts +62 -0
  2015. package/src/shared/lib/workspace/project-settings.test.ts +350 -0
  2016. package/src/shared/lib/workspace/project-settings.ts +139 -0
  2017. package/src/shared/lib/workspace/refresh-cadence.test.ts +117 -0
  2018. package/src/shared/lib/workspace/refresh-cadence.ts +58 -0
  2019. package/src/shared/lib/workspace/relative-time.ts +25 -0
  2020. package/src/shared/lib/workspace/right-panels.ts +110 -0
  2021. package/src/shared/lib/workspace/schema-migrations.ts +19 -0
  2022. package/src/shared/lib/workspace/scroll-positions.test.ts +82 -0
  2023. package/src/shared/lib/workspace/scroll-positions.ts +101 -0
  2024. package/src/shared/lib/workspace/session-state/listeners.ts +70 -0
  2025. package/src/shared/lib/workspace/session-state/store.test.ts +328 -0
  2026. package/src/shared/lib/workspace/session-state/store.ts +330 -0
  2027. package/src/shared/lib/workspace/session-visibility.test.ts +117 -0
  2028. package/src/shared/lib/workspace/session-visibility.ts +76 -0
  2029. package/src/shared/lib/workspace/sidebar-expanded.ts +23 -0
  2030. package/src/shared/lib/workspace/sidebar-sort.test.ts +210 -0
  2031. package/src/shared/lib/workspace/sidebar-sort.ts +140 -0
  2032. package/src/shared/lib/workspace/sidebar-toolbar.test.ts +77 -0
  2033. package/src/shared/lib/workspace/sidebar-toolbar.ts +100 -0
  2034. package/src/shared/lib/workspace/sidebar-width.test.ts +111 -0
  2035. package/src/shared/lib/workspace/sidebar-width.ts +106 -0
  2036. package/src/shared/lib/workspace/terminal/keys.test.ts +189 -0
  2037. package/src/shared/lib/workspace/terminal/keys.ts +225 -0
  2038. package/src/shared/lib/workspace/terminal/protocol.test.ts +242 -0
  2039. package/src/shared/lib/workspace/terminal/protocol.ts +222 -0
  2040. package/src/shared/lib/workspace/workspace-modules.test.ts +300 -0
  2041. package/src/shared/types/browser.ts +58 -0
  2042. package/src/shared/types/btw.ts +123 -0
  2043. package/src/shared/types/chat.ts +330 -0
  2044. package/src/shared/types/context.ts +87 -0
  2045. package/src/shared/types/fs.ts +77 -0
  2046. package/src/shared/types/git.ts +169 -0
  2047. package/src/shared/types/index.ts +31 -0
  2048. package/src/shared/types/models.ts +101 -0
  2049. package/src/shared/types/omp/agent.ts +223 -0
  2050. package/src/shared/types/omp/instructions.ts +38 -0
  2051. package/src/shared/types/omp/session.ts +156 -0
  2052. package/src/shared/types/omp/subagent.ts +186 -0
  2053. package/src/shared/types/panels.ts +334 -0
  2054. package/src/shared/types/plan.ts +42 -0
  2055. package/src/shared/types/realtime.ts +34 -0
  2056. package/src/shared/types/schedule.ts +67 -0
  2057. package/src/shared/types/settings/agent.ts +16 -0
  2058. package/src/shared/types/settings/command.ts +38 -0
  2059. package/src/shared/types/settings/mcp.ts +22 -0
  2060. package/src/shared/types/settings/plugin.ts +107 -0
  2061. package/src/shared/types/settings/project.ts +18 -0
  2062. package/src/shared/types/settings/provider.ts +135 -0
  2063. package/src/shared/types/settings/skill.ts +48 -0
  2064. package/src/shared/types/settings/state.ts +81 -0
  2065. package/src/shared/types/settings/usage.ts +237 -0
  2066. package/src/shared/types/terminal.ts +12 -0
  2067. package/src/shared/types/theme.ts +48 -0
  2068. package/src/shared/types/todo.ts +108 -0
  2069. package/src/shared/types/tokenUsage.ts +44 -0
  2070. package/src/shared/types/updates.ts +99 -0
  2071. package/src/shared/types/wiki.ts +132 -0
  2072. package/src/shared/types/workspace.ts +69 -0
  2073. package/src/test-support/executable-stub.ts +107 -0
  2074. package/src/test-support/fake-git.ts +121 -0
  2075. package/src/test-support/fake-omp-fork.ts +146 -0
  2076. package/src/test-support/file-actions.test-util.ts +206 -0
  2077. package/src/test-support/file-clipboard.test-util.ts +52 -0
  2078. package/src/test-support/file-editor.test-util.ts +182 -0
  2079. package/src/test-support/file-explorer.test-util.ts +317 -0
  2080. package/src/test-support/isolated-db.ts +51 -0
  2081. package/src/test-support/peer-harness.ts +205 -0
  2082. package/src/test-support/platform.test.ts +48 -0
  2083. package/src/test-support/platform.ts +51 -0
  2084. package/src/test-support/pristine-globals.ts +124 -0
  2085. package/src/test-support/realtime-server.ts +154 -0
  2086. package/src/test-support/remove-dir.ts +78 -0
  2087. package/tsconfig.json +67 -0
@@ -0,0 +1,162 @@
1
+ import path from 'path';
2
+ import type { FileDiffData } from '@/shared/types/git';
3
+ import { runGit } from '@/server/lib/fs/git-run';
4
+
5
+ /**
6
+ * Context lines requested when the reader wants the whole file rather than the
7
+ * hunks. `--unified` takes any count, so this is a cap on the FILE, not on the
8
+ * change: git emits every line it can reach around the edits.
9
+ */
10
+ const FULL_CONTEXT = 1000000;
11
+
12
+ /**
13
+ * Run one git probe and return its stdout ('' on failure).
14
+ *
15
+ * Every operand is its own argv element, never interpolated into a shell
16
+ * string. A repo-relative path is repository-controlled data: a file named
17
+ * ``a$(touch /tmp/PWNED).sh`` used to have that substitution EXECUTED by the
18
+ * `sh -c` the previous form went through — verified, the file appeared — and a
19
+ * filename holding a double quote broke the quoting outright. The `:0:` and
20
+ * `HEAD:` spellings are a single argv element for the same reason.
21
+ */
22
+ async function gitOut(args: string[], cwd: string, timeout: number, maxBuffer: number = 1024 * 1024 * 2): Promise<string> {
23
+ const result = await runGit(args, { cwd, timeout, maxBuffer });
24
+ return result.error === undefined && result.exitCode === 0 ? result.stdout : '';
25
+ }
26
+
27
+ /**
28
+ * Fetch git diff for a specific file in the working directory or index.
29
+ *
30
+ * `fullContext` asks git for the entire file rather than the surrounding hunks,
31
+ * which is what the panel's "Full Code" mode renders — the diff comes back in
32
+ * the same unified format, so no second rendering path exists.
33
+ */
34
+ export async function fetchWorkingFileDiff(
35
+ targetDir: string,
36
+ file: string,
37
+ staged: boolean = false,
38
+ requestedStatus?: string,
39
+ fullContext: boolean = false
40
+ ): Promise<FileDiffData> {
41
+ // Only a LEADING `./`, `../` or `/` is removed. The previous `[./\\]+` class
42
+ // also ate a leading dot that began a real name, so `.claude/tools/x.sh`
43
+ // became `claude/tools/x.sh` — a path that does not exist, which every probe
44
+ // below then answered "No differences found" for. Measured on the author's
45
+ // checkouts: 292 of 403 changed files, and they were exactly the dot-paths
46
+ // (`.github/`, `.idea/`, `.claude/`, `.history/`, `.env`, `.gitignore`,
47
+ // `.DS_Store`) — which is what "the diff does not show for some .sh/.xml" was.
48
+ //
49
+ // A backslash folds to a separator on WINDOWS ONLY. There it cannot be part
50
+ // of a name, and a client-supplied path may spell the separator either way;
51
+ // on POSIX it is an ordinary filename character (`a\b.sh` is a legal name),
52
+ // so folding it there pointed the probes at a file that does not exist.
53
+ const cleanFile = (process.platform === 'win32' ? file.replace(/\\/g, '/') : file)
54
+ .replace(/^(?:\.\.?\/|\/)+/, '');
55
+ const fullPath = path.join(targetDir, cleanFile);
56
+ let status = requestedStatus && requestedStatus.trim() ? requestedStatus.trim() : 'M';
57
+ let diff = '';
58
+ let oldContent = '';
59
+ let newContent = '';
60
+ let additions = 0;
61
+ let deletions = 0;
62
+
63
+ try {
64
+ // Check porcelain status of this file
65
+ const statusResult = await gitOut(['status', '--porcelain=v1', '--', cleanFile], targetDir, 10000);
66
+ const statusLine = statusResult.trim();
67
+ if (statusLine) {
68
+ status = statusLine.slice(0, 2).trim() || status;
69
+ }
70
+
71
+ // Try reading current new content from disk if it exists
72
+ try {
73
+ newContent = await Bun.file(fullPath).text();
74
+ } catch {
75
+ newContent = '';
76
+ }
77
+
78
+ // Read old content from index or HEAD
79
+ oldContent = await gitOut(['show', `HEAD:${cleanFile}`], targetDir, 5000)
80
+ || await gitOut(['show', `:0:${cleanFile}`], targetDir, 5000);
81
+
82
+ // `-U<n>` on every probe: the full-code mode asks for the whole file, and
83
+ // the diff-only mode keeps git's own default by passing no flag at all.
84
+ const ctx = fullContext ? [`-U${FULL_CONTEXT}`] : [];
85
+ // Full-context output is the file, not the change, so a fixed buffer would
86
+ // truncate a large file's diff — and a killed process is not a success, so
87
+ // `gitOut` reports it as no diff at all and the synthesized whole-file
88
+ // rewrite below takes over silently. Sized off the content already read, so
89
+ // it cannot exceed roughly twice the file.
90
+ const buf = fullContext
91
+ ? Math.max(1024 * 1024 * 16, (oldContent.length + newContent.length) * 2 + 1024 * 1024)
92
+ : 1024 * 1024 * 2;
93
+
94
+ if (staged) {
95
+ // 1. Try staged diff (index vs HEAD), 2. HEAD diff, 3. unstaged diff
96
+ diff = await gitOut(['diff', ...ctx, '--cached', '--', cleanFile], targetDir, 10000, buf)
97
+ || await gitOut(['diff', ...ctx, 'HEAD', '--', cleanFile], targetDir, 10000, buf)
98
+ || await gitOut(['diff', ...ctx, '--', cleanFile], targetDir, 10000, buf);
99
+ } else if (status === '??' || status === 'U' || status === '?') {
100
+ // Untracked file: `--no-index` exits 1 when it produced a diff, so read
101
+ // stdout directly instead of relying on the exit code.
102
+ const untracked = await runGit(['diff', ...ctx, '--no-index', '/dev/null', cleanFile], { cwd: targetDir, timeout: 10000, maxBuffer: buf });
103
+ diff = untracked.stdout.trim() ? untracked.stdout : '';
104
+ } else {
105
+ // 1. Working tree diff, 2. cached diff, 3. HEAD diff
106
+ diff = await gitOut(['diff', ...ctx, '--', cleanFile], targetDir, 10000, buf)
107
+ || await gitOut(['diff', ...ctx, '--cached', '--', cleanFile], targetDir, 10000, buf)
108
+ || await gitOut(['diff', ...ctx, 'HEAD', '--', cleanFile], targetDir, 10000, buf);
109
+ }
110
+
111
+ // 4. If git diff is still empty but new content exists:
112
+ if (!diff.trim()) {
113
+ if (oldContent && newContent && oldContent !== newContent) {
114
+ // Synthesize diff from old and new lines
115
+ const oldLines = oldContent.split(/\r?\n/);
116
+ const newLines = newContent.split(/\r?\n/);
117
+ const diffBody = [
118
+ ...oldLines.map((l) => `-${l}`),
119
+ ...newLines.map((l) => `+${l}`),
120
+ ].join('\n');
121
+ diff = `--- a/${cleanFile}\n+++ b/${cleanFile}\n@@ -1,${oldLines.length} +1,${newLines.length} @@\n${diffBody}`;
122
+ } else if (newContent) {
123
+ const lines = newContent.split(/\r?\n/);
124
+ const prefix = status === 'A' || status === '??' ? '+' : ' ';
125
+ const diffBody = lines.map((l) => `${prefix}${l}`).join('\n');
126
+ diff = `--- a/${cleanFile}\n+++ b/${cleanFile}\n@@ -1,${lines.length} +1,${lines.length} @@\n${diffBody}`;
127
+ }
128
+ }
129
+
130
+ // Count additions and deletions from diff
131
+ if (diff) {
132
+ const diffLines = diff.split('\n');
133
+ for (const line of diffLines) {
134
+ if (line.startsWith('+++') || line.startsWith('---') || line.startsWith('@@')) continue;
135
+ if (line.startsWith('+')) additions++;
136
+ else if (line.startsWith('-')) deletions++;
137
+ }
138
+ }
139
+
140
+ return {
141
+ file: cleanFile,
142
+ diff: diff || (newContent ? `--- a/${cleanFile}\n+++ b/${cleanFile}\n@@ -1,1 +1,1 @@\n ${newContent.slice(0, 100)}` : 'No differences found'),
143
+ oldContent,
144
+ newContent,
145
+ staged,
146
+ status,
147
+ additions,
148
+ deletions,
149
+ };
150
+ } catch (error: any) {
151
+ return {
152
+ file: cleanFile,
153
+ diff: `// Unable to compute diff for ${cleanFile}: ${error?.message || 'Unknown error'}`,
154
+ oldContent: '',
155
+ newContent,
156
+ staged,
157
+ status: 'M',
158
+ additions: 0,
159
+ deletions: 0,
160
+ };
161
+ }
162
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ /**
7
+ * Git-ignore resolution for the Files panel.
8
+ *
9
+ * `git check-ignore` is the only authority that evaluates every rule source in
10
+ * one pass — per-directory `.gitignore`, `.git/info/exclude`, and the global
11
+ * `core.excludesFile` (`~/.gitignore`) — so the panel dims exactly what git
12
+ * would refuse to track. Paths are fed NUL-separated over stdin (`--stdin -z`)
13
+ * so a directory listing of any size cannot overflow argv, and the verbatim
14
+ * NUL-separated reply maps straight back onto those same paths.
15
+ *
16
+ * Paths must be relative to `dir` and must exist on disk: git resolves
17
+ * directory-only patterns (`build/`) by stat-ing the path.
18
+ *
19
+ * Answers are memoized per path: the panel asks again every time a folder is
20
+ * re-listed or re-expanded, and each question costs a `git` subprocess
21
+ * (measured 5.6 ms). The TTL is short because a `.gitignore` the user just
22
+ * edited should take effect without a reload; a path whose answer is still
23
+ * cached is simply not asked about, so a re-listing of a known folder spawns
24
+ * nothing at all.
25
+ */
26
+
27
+ import { GIT_ENV } from '@/server/lib/fs/git-run';
28
+
29
+ const CACHE_TTL_MS = 5_000;
30
+ /** Bound on remembered paths; the oldest answer is evicted past this. */
31
+ const CACHE_MAX_ENTRIES = 20_000;
32
+
33
+ interface IgnoreAnswer {
34
+ ignored: boolean;
35
+ at: number;
36
+ }
37
+
38
+ const cache = new Map<string, IgnoreAnswer>();
39
+
40
+ function cacheKey(dir: string, rel: string): string {
41
+ return `${dir}\0${rel}`;
42
+ }
43
+
44
+ export async function collectIgnoredPaths(dir: string, relPaths: string[]): Promise<Set<string>> {
45
+ if (relPaths.length === 0) return new Set();
46
+
47
+ const now = Date.now();
48
+ const ignored = new Set<string>();
49
+ const unknown: string[] = [];
50
+ for (const rel of relPaths) {
51
+ const answer = cache.get(cacheKey(dir, rel));
52
+ if (answer && now - answer.at < CACHE_TTL_MS) {
53
+ if (answer.ignored) ignored.add(rel);
54
+ continue;
55
+ }
56
+ unknown.push(rel);
57
+ }
58
+ if (unknown.length === 0) return ignored;
59
+
60
+ try {
61
+ const proc = Bun.spawn({
62
+ cmd: ['git', 'check-ignore', '--stdin', '-z'],
63
+ cwd: dir,
64
+ stdin: 'pipe',
65
+ stdout: 'pipe',
66
+ stderr: 'ignore',
67
+ timeout: 10_000,
68
+ // The same three variables every other git spawn gets — `GIT_ENV` in
69
+ // `lib/fs/git-run.ts` names what each prevents. This call site spawns
70
+ // directly rather than through `runGit`/`runShell`, so it has to opt in.
71
+ env: { ...Bun.env, ...GIT_ENV },
72
+ });
73
+
74
+ // Drain stdout while the listing is written: a directory big enough to
75
+ // fill both pipe buffers would otherwise deadlock child against parent.
76
+ const stdout = new Response(proc.stdout).text();
77
+ proc.stdin.write(unknown.map(rel => `${rel}\0`).join(''));
78
+ // FileSink.end() types as `number | Promise<number>` — EPIPE (child gone)
79
+ // must not surface as an unhandled rejection.
80
+ void Promise.resolve(proc.stdin.end()).catch(() => {});
81
+
82
+ const [text, exitCode] = await Promise.all([stdout, proc.exited]);
83
+ // 0 = at least one path matched, 1 = none, 128 = no repository. Only 0 can
84
+ // carry a match list, but every path still gets a definite answer: an
85
+ // unlisted one is not ignored.
86
+ const matched = exitCode === 0 ? new Set(text.split('\0').filter(Boolean)) : new Set<string>();
87
+
88
+ // Only 0 and 1 mean git actually read the paths; 128 (no repository) is
89
+ // not an answer, so nothing is cached from it and the next listing retries.
90
+ const answered = exitCode === 0 || exitCode === 1;
91
+ const stamped = Date.now();
92
+ for (const rel of unknown) {
93
+ const isIgnored = matched.has(rel);
94
+ if (isIgnored) ignored.add(rel);
95
+ if (answered) {
96
+ if (cache.size >= CACHE_MAX_ENTRIES) cache.clear();
97
+ cache.set(cacheKey(dir, rel), { ignored: isIgnored, at: stamped });
98
+ }
99
+ }
100
+
101
+ return ignored;
102
+ } catch {
103
+ return ignored; // git missing / spawn failed — nothing is dimmed
104
+ }
105
+ }
@@ -0,0 +1,232 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ /**
7
+ * A git READ must not take `.git/index.lock`, because the panel reads and
8
+ * writes the same repository concurrently.
9
+ *
10
+ * `git status` looks read-only and is not. With a STALE index — a working file
11
+ * whose mtime is newer than the stat the index recorded, which is the normal
12
+ * state right after a checkout, a merge, or any tool that wrote files — git
13
+ * refreshes the index and WRITES IT BACK (`do_write_index` in `read-cache.c`,
14
+ * writing `<repo>/.git/index.lock`), which is why the panel's reads race its own
15
+ * merges. Measured on git 2.50: `GIT_TRACE2_EVENT=1 git status` on a stale index
16
+ * records `do_write_index … index.lock` twice, and the same command with
17
+ * `GIT_OPTIONAL_LOCKS=0` records it ZERO times. Under concurrency the loser of
18
+ * the race is the merge:
19
+ *
20
+ * git action merge_branch failed (HTTP 400): error: Unable to create
21
+ * '<repo>/.git/index.lock': File exists.
22
+ *
23
+ * That is a real failure on a user's machine, not a flaky test: it fired twice
24
+ * in the browser specs (2026-10-15 and 2026-10-16) and needs only the repository
25
+ * modal to be open while a merge is clicked.
26
+ *
27
+ * `GIT_OPTIONAL_LOCKS=0` is git's own answer for a read — the index refresh is
28
+ * an optimization (it lets the next read skip re-stat'ing), so declining it
29
+ * costs a stat and removes the write. This test drives the REAL `runGit` and the
30
+ * REAL status read against a real repository, because the whole bug lives in the
31
+ * spawn environment: a fake child would prove nothing about which variables git
32
+ * was given.
33
+ *
34
+ * The assertion is the index FILE's identity (mtime + size), not a race: git
35
+ * either replaced it or it did not. The race itself is deliberately NOT
36
+ * asserted — measured, spawning the reads and the merge together does not
37
+ * reproduce it reliably enough to be a test (0 of 6 runs failed with the fix
38
+ * reverted), and a test that passes with the bug present is worse than no test.
39
+ */
40
+
41
+ import { afterEach, describe, expect, test } from 'bun:test';
42
+ import fs from 'node:fs';
43
+ import os from 'node:os';
44
+ import path from 'node:path';
45
+ import { runGit } from '@/server/lib/fs/git-run';
46
+ import { readGitStatus } from '@/server/lib/fs/git-status-read';
47
+ import { testPosix } from '@/test-support/platform';
48
+
49
+ const repos: string[] = [];
50
+
51
+ afterEach(() => {
52
+ while (repos.length > 0) fs.rmSync(repos.pop() as string, { recursive: true, force: true });
53
+ });
54
+
55
+ function git(cwd: string, ...args: string[]): string {
56
+ const result = Bun.spawnSync({
57
+ cmd: ['git', ...args],
58
+ cwd,
59
+ env: { ...Bun.env, GIT_EDITOR: 'true' },
60
+ });
61
+ if (result.exitCode !== 0) throw new Error(`git ${args.join(' ')} failed: ${result.stderr.toString()}`);
62
+ return result.stdout.toString();
63
+ }
64
+
65
+ function makeRepo(): string {
66
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'kabmo-index-lock-'));
67
+ repos.push(dir);
68
+ git(dir, 'init', '-q', '-b', 'main');
69
+ git(dir, 'config', 'user.email', 'e2e@example.invalid');
70
+ git(dir, 'config', 'user.name', 'E2E');
71
+ return dir;
72
+ }
73
+
74
+ /** One commit of `files` tracked files, so a changed stat below makes the index stale. */
75
+ function seedTracked(cwd: string, files = 200): void {
76
+ for (let i = 0; i < files; i += 1) {
77
+ fs.writeFileSync(path.join(cwd, `f${i}.txt`), `line ${i}\n`);
78
+ }
79
+ git(cwd, 'add', '-A');
80
+ git(cwd, 'commit', '-q', '-m', 'base');
81
+ }
82
+
83
+ /**
84
+ * Make the index STAT-STALE without changing any file's content: every tracked
85
+ * file's mtime is moved well ahead of the stat the index recorded.
86
+ *
87
+ * **The content must stay identical, and that is the whole point.** `git status`
88
+ * only writes the index back when it can REFRESH an entry (`cache_changed`), and
89
+ * an entry whose CONTENT changed is dirty — git cannot refresh it, so the write
90
+ * then depends on `has_racy_timestamp` instead: the index's own mtime second
91
+ * against the entry's recorded one. That is a clock race against the fixture's
92
+ * setup, and it is what made this control flake (measured on macOS: every run
93
+ * whose `git add`/`git commit` stayed inside one second wrote the index, and the
94
+ * one run that crossed a second boundary did not — `git status` reported the
95
+ * same 200 modified files either way). Touching the mtime with the content
96
+ * intact makes the refresh SUCCEED, so `cache_changed` is set on every git build
97
+ * and every platform, independent of timestamps.
98
+ *
99
+ * The mtime is moved EXPLICITLY rather than left to "the rewrite happens after
100
+ * the commit". Those differ by filesystem timestamp granularity: on a runner
101
+ * whose clock or FS rounds to the second, a rewrite inside the same second as
102
+ * the index write leaves the entry "racily clean". A minute of headroom is
103
+ * unambiguous on every filesystem git supports, and each call takes a larger
104
+ * offset so a second pass is stale against the stat the first one wrote back.
105
+ */
106
+ function staleIndex(cwd: string, secondsAhead: number, files = 200): void {
107
+ for (let i = 0; i < files; i += 1) {
108
+ const file = path.join(cwd, `f${i}.txt`);
109
+ const future = new Date(Date.now() + secondsAhead * 1000);
110
+ fs.utimesSync(file, future, future);
111
+ }
112
+ }
113
+
114
+ /** The index's identity: git replaces it atomically, so either field moves. */
115
+ function indexStamp(cwd: string): string {
116
+ const stat = fs.statSync(path.join(cwd, '.git', 'index'));
117
+ return `${stat.mtimeMs}:${stat.size}`;
118
+ }
119
+
120
+ /**
121
+ * Whether a `git status` run rewrote the index — i.e. took the lock.
122
+ *
123
+ * Read from the index FILE rather than from git's `GIT_TRACE2_EVENT` stream.
124
+ * The trace was the original probe and it is version- and platform-sensitive:
125
+ * the region name (`do_write_index`) is an implementation detail, git-for-Windows
126
+ * does not emit it at all, and a `trace2` config in the environment can redirect
127
+ * the stream away from stderr. The file is the thing the assertion is actually
128
+ * about — `index.lock` is taken so the index can be replaced — and it is
129
+ * observable on every platform and version.
130
+ */
131
+ function indexWriteCount(cwd: string, env: Record<string, string>): number {
132
+ const before = indexStamp(cwd);
133
+ const result = Bun.spawnSync({
134
+ cmd: ['git', 'status', '--porcelain'],
135
+ cwd,
136
+ env: { ...Bun.env, ...env },
137
+ });
138
+ // A failed run proves nothing either way; the caller's assertion would read a
139
+ // crash as "no write", which is the vacuous pass this control exists to stop.
140
+ if (result.exitCode !== 0) throw new Error(`git status failed: ${result.stderr.toString()}`);
141
+ return indexStamp(cwd) === before ? 0 : 1;
142
+ }
143
+
144
+ describe('a git READ does not take the index lock', () => {
145
+ // The positive control watches the INDEX FILE, which is what the lock exists
146
+ // to replace. That keeps it meaningful on every git version and platform; the
147
+ // `testPosix` guard stays because the shim-based case below writes a `#!/bin/sh`
148
+ // stub, which Windows cannot execute.
149
+ testPosix('git status writes the index on a stale index — and stops when the lock is refused', () => {
150
+ // The mechanism itself, so the rest of the test cannot pass vacuously: if a
151
+ // future git stops refreshing the index here, this assertion fails and says
152
+ // so rather than silently proving nothing.
153
+ const repo = makeRepo();
154
+ seedTracked(repo);
155
+ staleIndex(repo, 60);
156
+ expect(indexWriteCount(repo, {})).toBeGreaterThan(0);
157
+
158
+ staleIndex(repo, 120);
159
+ expect(indexWriteCount(repo, { GIT_OPTIONAL_LOCKS: '0' })).toBe(0);
160
+ });
161
+
162
+ testPosix('Kabmo spawns git with the lock refused, on both the argv and the shell path', async () => {
163
+ // The status read goes through `runShell` (a `sh -c` string), the repo-modal
164
+ // read through `runGit` (argv) — the split is exactly how one of the two
165
+ // paths would have kept the bug. A shim on PATH records what each child was
166
+ // actually given.
167
+ //
168
+ // **The shim is only reached by a spawn that passes `env:`** — measured:
169
+ // `Bun.spawn` with no `env` option resolves the command against the
170
+ // environment captured at process start, so a shim added to `process.env`
171
+ // afterwards is invisible to it. That is not a limitation to work around, it
172
+ // IS the signal: a call site that drops its `env` is a call site the shim
173
+ // never sees, which is why each path is asserted BY ITS OWN ARGUMENTS rather
174
+ // than by a total count.
175
+ //
176
+ // The real git is resolved BEFORE the shim goes on PATH, and the shim execs
177
+ // that absolute path: a bare `git` inside the shim would find the shim again
178
+ // and recurse (measured: the fixture's own `git init` timed out).
179
+ const realGit = Bun.which('git');
180
+ expect(realGit).toBeTruthy();
181
+
182
+ // The repository is built FIRST, while the real git is still the one on
183
+ // PATH — the fixture's own `git init`/`commit` calls do not set the variable
184
+ // and would otherwise be recorded as misses.
185
+ const repo = makeRepo();
186
+ seedTracked(repo);
187
+
188
+ const shimDir = fs.mkdtempSync(path.join(os.tmpdir(), 'kabmo-git-shim-'));
189
+ repos.push(shimDir);
190
+ const record = path.join(shimDir, 'env.txt');
191
+ const shim = path.join(shimDir, 'git');
192
+ fs.writeFileSync(
193
+ shim,
194
+ `#!/bin/sh\nprintf 'locks=%s argv=%s\\n' "\${GIT_OPTIONAL_LOCKS-unset}" "$*" >> ${JSON.stringify(record)}\nexec ${JSON.stringify(realGit)} "$@"\n`,
195
+ { mode: 0o755 },
196
+ );
197
+
198
+ const previousPath = process.env.PATH;
199
+ process.env.PATH = `${shimDir}:${previousPath ?? ''}`;
200
+ try {
201
+ // The shell path: the status read the panel runs on every tool call.
202
+ await readGitStatus(repo);
203
+ // The argv path, with its own format so the two cannot be confused in the
204
+ // record.
205
+ await runGit(['status', '--porcelain=v2'], { cwd: repo });
206
+
207
+ const lines = fs.readFileSync(record, 'utf8').trim().split('\n');
208
+ const shell = lines.filter((line) => line.includes('--porcelain=v1'));
209
+ const argv = lines.filter((line) => line.includes('--porcelain=v2'));
210
+ // Both paths reached the shim at all — this is what fails when a call site
211
+ // stops passing its environment.
212
+ expect(shell.length).toBeGreaterThan(0);
213
+ expect(argv.length).toBeGreaterThan(0);
214
+ // And every spawn refused the lock.
215
+ expect(lines.every((line) => line.startsWith('locks=0 '))).toBe(true);
216
+ } finally {
217
+ process.env.PATH = previousPath;
218
+ }
219
+ });
220
+
221
+ test('a mutating command still writes the index with the variable set', async () => {
222
+ // The lock is a READ concern. A commit that skipped it would be broken, so
223
+ // this pins that the variable does not disarm a writer.
224
+ const repo = makeRepo();
225
+ fs.writeFileSync(path.join(repo, 'a.txt'), 'x\n');
226
+ const add = await runGit(['add', 'a.txt'], { cwd: repo });
227
+ expect(add.exitCode).toBe(0);
228
+ const commit = await runGit(['commit', '-q', '-m', 'add a'], { cwd: repo });
229
+ expect(commit.exitCode).toBe(0);
230
+ expect(git(repo, 'log', '--oneline', '-1')).toContain('add a');
231
+ });
232
+ });
@@ -0,0 +1,155 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ /**
7
+ * `git log --numstat` parsing, isolated from the repository fixtures.
8
+ *
9
+ * The body is fenced by `\x1f`/`\x1e` in the log format precisely because a
10
+ * body line can carry a TAB, which the numstat branch would otherwise read as
11
+ * a changed file — and because a one-line commit still emits the record
12
+ * separator, which must be honoured on the header line or the first file row
13
+ * becomes body text. Both shapes are pinned here; the repository-backed
14
+ * contract (`limit`/`skip`/`hasMore`/`total`) lives in `git-log.test.ts`.
15
+ */
16
+
17
+ import { describe, expect, test } from 'bun:test';
18
+ import { parseGitLogOutput } from '@/server/lib/fs/git-log';
19
+
20
+ describe('parseGitLogOutput', () => {
21
+ test('empty stdout is an empty history, never a mock page', () => {
22
+ expect(parseGitLogOutput('')).toEqual([]);
23
+ expect(parseGitLogOutput('\n')).toEqual([]);
24
+ });
25
+
26
+ test('parses the header fields, refs and parents', () => {
27
+ const stdout =
28
+ 'COMMIT_SPLIT|~|abc1234567890|~|abc1234|~|Ada|~|Jan 01, 2024, 10:00 AM|~|subject line|~|HEAD -> main, origin/main|~|p1 p2\n';
29
+ expect(parseGitLogOutput(stdout)).toEqual([
30
+ {
31
+ hash: 'abc1234567890',
32
+ shortHash: 'abc1234',
33
+ author: 'Ada',
34
+ date: 'Jan 01, 2024, 10:00 AM',
35
+ message: 'subject line',
36
+ refs: ['HEAD -> main', 'origin/main'],
37
+ parents: ['p1', 'p2'],
38
+ files: [],
39
+ },
40
+ ]);
41
+ });
42
+
43
+ test('the raw row supplies the status and the numstat row the counts', () => {
44
+ // `--raw` and `--numstat` print one block each, in the same order, so the
45
+ // two are zipped. The status comes from git — a file that only LOST lines
46
+ // is `M`, and the numstat counts alone cannot say so (`0\t3\tf.txt` is a
47
+ // deletion's shape too).
48
+ const stdout = [
49
+ 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|msg|~||~|',
50
+ ':000000 100644 0000000 1111111 A\tadded.txt',
51
+ ':100644 000000 2222222 0000000 D\tgone.txt',
52
+ ':100644 100644 3333333 4444444 R100\told.txt\tnew.txt',
53
+ ':100644 100644 5555555 6666666 M\tboth.txt',
54
+ ':100644 100644 7777777 8888888 M\tlogo.png',
55
+ ':000000 100644 0000000 9999999 A\t"tab\\there.txt"',
56
+ '1\t0\tadded.txt',
57
+ '0\t3\tgone.txt',
58
+ '0\t0\told.txt => new.txt',
59
+ '2\t1\tboth.txt',
60
+ '-\t-\tlogo.png',
61
+ '1\t0\t"tab\\there.txt"',
62
+ '',
63
+ ].join('\n');
64
+ const [commit] = parseGitLogOutput(stdout);
65
+ expect(commit.files).toEqual([
66
+ { file: 'added.txt', status: 'A', additions: 1, deletions: 0 },
67
+ { file: 'gone.txt', status: 'D', additions: 0, deletions: 3 },
68
+ { file: 'old.txt => new.txt', status: 'R', additions: 0, deletions: 0 },
69
+ { file: 'both.txt', status: 'M', additions: 2, deletions: 1 },
70
+ { file: 'logo.png', status: 'M', additions: 0, deletions: 0 },
71
+ { file: 'tab\there.txt', status: 'A', additions: 1, deletions: 0 },
72
+ ]);
73
+ });
74
+
75
+ test('a modified file that only lost lines is M, never D', () => {
76
+ // The reported bug: `0\t1\tf.txt` is a shrink, and inferring the status
77
+ // from the counts rendered it as a deletion.
78
+ const stdout = [
79
+ 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|msg|~||~|',
80
+ ':100644 100644 aaa bbb M\tf.txt',
81
+ '0\t1\tf.txt',
82
+ '',
83
+ ].join('\n');
84
+ const [commit] = parseGitLogOutput(stdout);
85
+ expect(commit.files).toEqual([{ file: 'f.txt', status: 'M', additions: 0, deletions: 1 }]);
86
+ });
87
+
88
+ test('a copy is a new file, not a rename', () => {
89
+ const stdout = [
90
+ 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|msg|~||~|',
91
+ ':100644 100644 aaa bbb C100\tsrc/a.ts\tsrc/b.ts',
92
+ '0\t0\tsrc/{a.ts => b.ts}',
93
+ '',
94
+ ].join('\n');
95
+ const [commit] = parseGitLogOutput(stdout);
96
+ expect(commit.files).toEqual([
97
+ { file: 'src/{a.ts => b.ts}', status: 'A', additions: 0, deletions: 0 },
98
+ ]);
99
+ });
100
+
101
+ test('a numstat row without a raw status falls back to M rather than a guess', () => {
102
+ const stdout = 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|msg|~||~|\n0\t3\tgone.txt\n';
103
+ const [commit] = parseGitLogOutput(stdout);
104
+ expect(commit.files).toEqual([{ file: 'gone.txt', status: 'M', additions: 0, deletions: 3 }]);
105
+ });
106
+
107
+ test('ignores file rows before the first header and short rows', () => {
108
+ const stdout =
109
+ '1\t0\tstray.txt\n' +
110
+ 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|msg|~||~|\n' +
111
+ 'garbage\n' +
112
+ ':000000 100644 0000000 1111111 A\tok.txt\n' +
113
+ '1\t0\tok.txt\n';
114
+ const commits = parseGitLogOutput(stdout);
115
+ expect(commits).toHaveLength(1);
116
+ expect(commits[0].files).toEqual([{ file: 'ok.txt', status: 'A', additions: 1, deletions: 0 }]);
117
+ });
118
+
119
+ test('falls back to a short hash and an unknown author when fields are blank', () => {
120
+ const stdout = 'COMMIT_SPLIT|~|0123456789abcdef|~||~||~||~|msg|~||~|\n';
121
+ const [commit] = parseGitLogOutput(stdout);
122
+ expect(commit.shortHash).toBe('01234567');
123
+ expect(commit.author).toBe('Unknown');
124
+ expect(commit.refs).toEqual([]);
125
+ expect(commit.parents).toEqual([]);
126
+ });
127
+
128
+ test('a commit body is captured across its lines, tabs and all', () => {
129
+ // The body is fenced by \x1f/\x1e precisely because a body line can carry a
130
+ // TAB, which the numstat branch would otherwise read as a changed file.
131
+ const stdout =
132
+ 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|subject|~||~|\x1fpara one\n\n\tindented line\n\x1e\n:000000 100644 0000000 1111111 A\treal.txt\n1\t0\treal.txt\n';
133
+ const [commit] = parseGitLogOutput(stdout);
134
+ expect(commit.body).toBe('para one\n\n\tindented line');
135
+ expect(commit.files).toEqual([{ file: 'real.txt', status: 'A', additions: 1, deletions: 0 }]);
136
+ });
137
+
138
+ test('a one-line commit has no body and still parses its file rows', () => {
139
+ // git emits the record separator even with an empty `%b`; if it were not
140
+ // honoured on the header line the first numstat row would become the body.
141
+ const stdout = 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|subject|~||~|\x1e\n2\t1\tboth.txt\n';
142
+ const [commit] = parseGitLogOutput(stdout);
143
+ expect(commit.body).toBeUndefined();
144
+ expect(commit.files).toEqual([{ file: 'both.txt', status: 'M', additions: 2, deletions: 1 }]);
145
+ });
146
+
147
+ test('a body is fenced per commit, so the next header is not body text', () => {
148
+ const stdout =
149
+ 'COMMIT_SPLIT|~|h1|~|s1|~|Ada|~|date|~|first|~||~|\x1fbody of first\n\x1e\n1\t0\ta.txt\n' +
150
+ 'COMMIT_SPLIT|~|h2|~|s2|~|Ada|~|date|~|second|~||~|\x1fbody of second\n\x1e\n1\t0\tb.txt\n';
151
+ const commits = parseGitLogOutput(stdout);
152
+ expect(commits.map((c) => c.body)).toEqual(['body of first', 'body of second']);
153
+ expect(commits.map((c) => c.files?.[0].file)).toEqual(['a.txt', 'b.txt']);
154
+ });
155
+ });