@kabmo-labs/kabmo 0.11.1 → 0.12.0

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 (324) hide show
  1. package/README.md +67 -421
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +426 -413
  4. package/dist/client/static/js/{index-amss8pge.js → index-0smc9gm2.js} +1123 -747
  5. package/dist/client/static/js/index-shexbk5f.css +1 -0
  6. package/marketplace/marketplace.json +13 -3
  7. package/marketplace/plugins/command-runner/package.json +4 -2
  8. package/marketplace/plugins/git-forge/README.md +219 -0
  9. package/marketplace/plugins/git-forge/icon.svg +20 -0
  10. package/marketplace/plugins/git-forge/package.json +56 -0
  11. package/marketplace/plugins/git-forge/src/app.tsx +82 -0
  12. package/marketplace/plugins/git-forge/src/command.test.ts +181 -0
  13. package/marketplace/plugins/git-forge/src/command.ts +119 -0
  14. package/marketplace/plugins/git-forge/src/header.tsx +87 -0
  15. package/marketplace/plugins/git-forge/src/panel/Badge.tsx +76 -0
  16. package/marketplace/plugins/git-forge/src/panel/Change.tsx +150 -0
  17. package/marketplace/plugins/git-forge/src/panel/CiBadge.tsx +51 -0
  18. package/marketplace/plugins/git-forge/src/panel/Credential.tsx +107 -0
  19. package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +70 -0
  20. package/marketplace/plugins/git-forge/src/panel/Header.tsx +255 -0
  21. package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +198 -0
  22. package/marketplace/plugins/git-forge/src/panel/List.tsx +89 -0
  23. package/marketplace/plugins/git-forge/src/panel/Row.tsx +68 -0
  24. package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +94 -0
  25. package/marketplace/plugins/git-forge/src/panel/Write.tsx +236 -0
  26. package/marketplace/plugins/git-forge/src/panel/format.ts +78 -0
  27. package/marketplace/plugins/git-forge/src/panel/index.test.tsx +344 -0
  28. package/marketplace/plugins/git-forge/src/panel/index.tsx +193 -0
  29. package/marketplace/plugins/git-forge/src/panel/use-forge.ts +250 -0
  30. package/marketplace/plugins/git-forge/src/panel/write.test.tsx +269 -0
  31. package/marketplace/plugins/git-forge/src/protocol.ts +308 -0
  32. package/marketplace/plugins/git-forge/src/server/adapters.test.ts +274 -0
  33. package/marketplace/plugins/git-forge/src/server/bitbucket.ts +307 -0
  34. package/marketplace/plugins/git-forge/src/server/capabilities.test.ts +116 -0
  35. package/marketplace/plugins/git-forge/src/server/capabilities.ts +105 -0
  36. package/marketplace/plugins/git-forge/src/server/ci.test.ts +88 -0
  37. package/marketplace/plugins/git-forge/src/server/ci.ts +118 -0
  38. package/marketplace/plugins/git-forge/src/server/context.ts +76 -0
  39. package/marketplace/plugins/git-forge/src/server/diff.test.ts +127 -0
  40. package/marketplace/plugins/git-forge/src/server/diff.ts +120 -0
  41. package/marketplace/plugins/git-forge/src/server/filters.test.ts +138 -0
  42. package/marketplace/plugins/git-forge/src/server/filters.ts +138 -0
  43. package/marketplace/plugins/git-forge/src/server/forges.test.ts +235 -0
  44. package/marketplace/plugins/git-forge/src/server/gitea.ts +296 -0
  45. package/marketplace/plugins/git-forge/src/server/github-extras.ts +92 -0
  46. package/marketplace/plugins/git-forge/src/server/github.ts +320 -0
  47. package/marketplace/plugins/git-forge/src/server/gitlab-detail.ts +207 -0
  48. package/marketplace/plugins/git-forge/src/server/gitlab.test.ts +195 -0
  49. package/marketplace/plugins/git-forge/src/server/gitlab.ts +176 -0
  50. package/marketplace/plugins/git-forge/src/server/http.test.ts +270 -0
  51. package/marketplace/plugins/git-forge/src/server/http.ts +329 -0
  52. package/marketplace/plugins/git-forge/src/server/map.ts +120 -0
  53. package/marketplace/plugins/git-forge/src/server/registry.ts +47 -0
  54. package/marketplace/plugins/git-forge/src/server/remote.test.ts +146 -0
  55. package/marketplace/plugins/git-forge/src/server/remote.ts +188 -0
  56. package/marketplace/plugins/git-forge/src/server/scope-probe.test.ts +98 -0
  57. package/marketplace/plugins/git-forge/src/server/scope-probe.ts +128 -0
  58. package/marketplace/plugins/git-forge/src/server/scope.ts +66 -0
  59. package/marketplace/plugins/git-forge/src/server/test-context.ts +67 -0
  60. package/marketplace/plugins/git-forge/src/server/test-host.ts +51 -0
  61. package/marketplace/plugins/git-forge/src/server/token.test.ts +107 -0
  62. package/marketplace/plugins/git-forge/src/server/token.ts +139 -0
  63. package/marketplace/plugins/git-forge/src/server/write-http.test.ts +127 -0
  64. package/marketplace/plugins/git-forge/src/server/write-http.ts +110 -0
  65. package/marketplace/plugins/git-forge/src/server/writes.test.ts +218 -0
  66. package/marketplace/plugins/git-forge/src/server/writes.ts +313 -0
  67. package/marketplace/plugins/git-forge/src/server.ts +284 -0
  68. package/marketplace/plugins/git-forge/tsconfig.json +16 -0
  69. package/marketplace/plugins/session-info/package.json +4 -2
  70. package/marketplace/plugins/stats/package.json +4 -2
  71. package/package.json +6 -1
  72. package/src/client/components/common/code-surface/blame-hover.ts +188 -0
  73. package/src/client/components/common/code-surface/blame-panel.test.ts +304 -0
  74. package/src/client/components/common/code-surface/blame-panel.ts +306 -0
  75. package/src/client/components/common/code-surface/blame.test.ts +303 -0
  76. package/src/client/components/common/code-surface/blame.ts +227 -0
  77. package/src/client/components/common/code-surface/conflict-markers.test.ts +135 -0
  78. package/src/client/components/common/code-surface/conflict-markers.ts +144 -0
  79. package/src/client/components/common/code-surface/documents.ts +48 -1
  80. package/src/client/components/common/code-surface/extensions.test.ts +4 -0
  81. package/src/client/components/common/code-surface/extensions.ts +44 -0
  82. package/src/client/components/common/code-surface/fold-stack.test.ts +4 -0
  83. package/src/client/components/common/code-surface/indent.test.ts +5 -0
  84. package/src/client/components/common/code-surface/index.tsx +16 -2
  85. package/src/client/components/common/code-surface/lint-parsers.test.ts +109 -0
  86. package/src/client/components/common/code-surface/lint-parsers.ts +134 -0
  87. package/src/client/components/common/code-surface/lint.test.ts +101 -0
  88. package/src/client/components/common/code-surface/lint.ts +85 -0
  89. package/src/client/components/common/code-surface/props.ts +17 -0
  90. package/src/client/components/common/code-surface/surface-failures.test.ts +132 -0
  91. package/src/client/components/common/code-surface/theme.ts +71 -0
  92. package/src/client/components/common/header-controls/index.test.tsx +1 -1
  93. package/src/client/components/common/header-controls/plugin-entry.test.tsx +1 -1
  94. package/src/client/components/common/header-controls/shell-chrome.test.tsx +1 -1
  95. package/src/client/components/common/provider-icon/Plate.tsx +88 -0
  96. package/src/client/components/common/provider-icon/index.tsx +55 -11
  97. package/src/client/components/layout/session-sidebar/SessionsView.tsx +5 -2
  98. package/src/client/components/mobile/SessionSidebar.tsx +2 -10
  99. package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +6 -0
  100. package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +8 -0
  101. package/src/client/components/settings/categories/AppearanceSettings.tsx +3 -0
  102. package/src/client/components/settings/categories/ProviderSettings.tsx +43 -41
  103. package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +97 -0
  104. package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +106 -54
  105. package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +14 -1
  106. package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +39 -150
  107. package/src/client/components/settings/categories/panel-plugins/Meta.test.tsx +143 -0
  108. package/src/client/components/settings/categories/panel-plugins/Meta.tsx +157 -0
  109. package/src/client/components/settings/categories/panel-plugins/Placement.test.tsx +149 -0
  110. package/src/client/components/settings/categories/panel-plugins/Placement.tsx +99 -0
  111. package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +270 -0
  112. package/src/client/components/settings/categories/panel-plugins/Section.tsx +11 -3
  113. package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +25 -0
  114. package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +135 -80
  115. package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +51 -21
  116. package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +175 -0
  117. package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +275 -0
  118. package/src/client/components/settings/categories/provider-settings/Header.tsx +40 -9
  119. package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +142 -160
  120. package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
  121. package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +84 -46
  122. package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +217 -102
  123. package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +5 -2
  124. package/src/client/components/settings/categories/provider-settings/SidebarList.plugin.test.ts +3 -3
  125. package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +158 -102
  126. package/src/client/components/settings/categories/provider-settings/auth-section.test.tsx +135 -0
  127. package/src/client/components/settings/categories/provider-settings/groups.test.ts +98 -0
  128. package/src/client/components/settings/categories/provider-settings/groups.ts +108 -0
  129. package/src/client/components/settings/categories/provider-settings/layout.test.tsx +325 -0
  130. package/src/client/components/settings/categories/provider-settings/model-dialogs.test.tsx +135 -0
  131. package/src/client/components/settings/categories/provider-settings/preset-picker.test.tsx +73 -0
  132. package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +22 -2
  133. package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +2 -0
  134. package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +16 -6
  135. package/src/client/components/settings/categories/usage-settings/providers.ts +3 -0
  136. package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +19 -0
  137. package/src/client/components/settings/categories/usage-settings/usage-icons.test.tsx +143 -0
  138. package/src/client/components/workspace/chat-timeline/MinimapShortcuts.test.ts +2 -1
  139. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +23 -19
  140. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +23 -19
  141. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +20 -18
  142. package/src/client/components/workspace/chat-timeline/chat-input/compact.test.tsx +19 -6
  143. package/src/client/components/workspace/chat-timeline/index.tsx +7 -16
  144. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.missing.test.ts +100 -0
  145. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +3 -47
  146. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +8 -1
  147. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/wait-test-util.ts +62 -0
  148. package/src/client/components/workspace/diff-panel/HunkStepper.tsx +62 -0
  149. package/src/client/components/workspace/diff-panel/MergeDiffView.tsx +29 -0
  150. package/src/client/components/workspace/diff-panel/Toolbar.tsx +32 -1
  151. package/src/client/components/workspace/diff-panel/changes.ts +69 -0
  152. package/src/client/components/workspace/diff-panel/chunks.ts +85 -0
  153. package/src/client/components/workspace/diff-panel/index.tsx +21 -1
  154. package/src/client/components/workspace/diff-panel/merge.test.ts +145 -0
  155. package/src/client/components/workspace/diff-panel/merge.ts +63 -68
  156. package/src/client/components/workspace/editor/EditorDropOverlay.tsx +6 -1
  157. package/src/client/components/workspace/editor/FileDocument.tsx +51 -1
  158. package/src/client/components/workspace/editor/FilePane.tsx +25 -1
  159. package/src/client/components/workspace/editor/StatusBar.tsx +19 -0
  160. package/src/client/components/workspace/editor/Toolbar.tsx +29 -5
  161. package/src/client/components/workspace/editor/toolbar-clusters.test.ts +86 -0
  162. package/src/client/components/workspace/editor/toolbar-clusters.tsx +48 -16
  163. package/src/client/components/workspace/editor/viewers/bytes.ts +16 -0
  164. package/src/client/components/workspace/git-panel/index.test.ts +46 -1
  165. package/src/client/components/workspace/git-panel/index.tsx +11 -38
  166. package/src/client/components/workspace/model-dropdown/Item.plugin.test.ts +66 -0
  167. package/src/client/components/workspace/model-dropdown/Item.tsx +71 -62
  168. package/src/client/components/workspace/model-dropdown/Section.tsx +31 -14
  169. package/src/client/components/workspace/model-dropdown/collapsed.ts +72 -0
  170. package/src/client/components/workspace/model-dropdown/index.tsx +42 -19
  171. package/src/client/components/workspace/model-dropdown/refresh.test.tsx +260 -0
  172. package/src/client/components/workspace/model-dropdown/trigger.test.ts +34 -0
  173. package/src/client/components/workspace/model-dropdown/use-catalog.ts +13 -2
  174. package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +19 -3
  175. package/src/client/hooks/chat/omp/folder-auto-expand.ts +113 -0
  176. package/src/client/hooks/chat/omp/index.ts +20 -0
  177. package/src/client/hooks/chat/omp/pending-rows.ts +21 -0
  178. package/src/client/hooks/chat/omp/pending-sessions.test.ts +16 -1
  179. package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +102 -0
  180. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +21 -1
  181. package/src/client/hooks/chat/omp/stream.ts +8 -1
  182. package/src/client/hooks/chat/timeline/index.ts +1 -1
  183. package/src/client/hooks/chat/timeline/new-chat-open.ts +60 -0
  184. package/src/client/hooks/editor/blame-settings.ts +67 -0
  185. package/src/client/hooks/editor/blame.test.ts +272 -0
  186. package/src/client/hooks/editor/blame.ts +232 -0
  187. package/src/client/hooks/editor/file-editor-types.ts +23 -0
  188. package/src/client/hooks/editor/save-file.test.ts +20 -0
  189. package/src/client/hooks/editor/use-editor-drop.test-util.ts +198 -0
  190. package/src/client/hooks/editor/use-editor-drop.test.ts +70 -175
  191. package/src/client/hooks/editor/use-editor-drop.ts +19 -36
  192. package/src/client/hooks/editor/use-file-editor.ts +7 -1
  193. package/src/client/hooks/settings/providers/actions.ts +90 -194
  194. package/src/client/hooks/settings/providers/api.ts +7 -1
  195. package/src/client/hooks/settings/providers/index.ts +171 -59
  196. package/src/client/hooks/settings/providers/login.test.ts +79 -0
  197. package/src/client/hooks/settings/providers/login.ts +276 -0
  198. package/src/client/hooks/settings/providers/messages.ts +28 -0
  199. package/src/client/hooks/settings/providers/model-actions.ts +178 -0
  200. package/src/client/hooks/ui/editor-error-toast.ts +47 -0
  201. package/src/client/hooks/ui/open-file.ts +7 -0
  202. package/src/client/hooks/ui/toasts.ts +7 -0
  203. package/src/client/hooks/workspace/file-tabs.ts +4 -1
  204. package/src/client/hooks/workspace/folder-expansion.test.ts +62 -0
  205. package/src/client/hooks/workspace/folder-expansion.ts +33 -0
  206. package/src/client/hooks/workspace/git-action-outcome.ts +86 -0
  207. package/src/client/hooks/workspace/git-actions.ts +29 -2
  208. package/src/client/hooks/workspace/plugin-contributions.test.ts +117 -0
  209. package/src/client/hooks/workspace/plugin-contributions.ts +146 -0
  210. package/src/client/lib/editor-errors.test.ts +85 -0
  211. package/src/client/lib/editor-errors.ts +71 -0
  212. package/src/client/lib/fs/resolve-open.test.ts +125 -0
  213. package/src/client/lib/fs/resolve-open.ts +90 -0
  214. package/src/client/lib/git/action-message.test.ts +82 -0
  215. package/src/client/lib/git/action-message.ts +160 -0
  216. package/src/client/lib/launch/device-files.test.ts +160 -0
  217. package/src/client/lib/launch/device-files.ts +197 -0
  218. package/src/client/lib/native/open-paths.test.ts +140 -0
  219. package/src/client/lib/native/open-paths.ts +157 -0
  220. package/src/client/lib/plugins/bootstrap.test.ts +1 -1
  221. package/src/client/main.tsx +20 -0
  222. package/src/server/db.server.test.ts +39 -0
  223. package/src/server/db.server.ts +21 -2
  224. package/src/server/lib/db/schema.ts +2 -0
  225. package/src/server/lib/fs/external-roots.test.ts +100 -0
  226. package/src/server/lib/fs/external-roots.ts +101 -0
  227. package/src/server/lib/fs/git-actions-branch.ts +15 -2
  228. package/src/server/lib/fs/git-actions-shared.ts +24 -0
  229. package/src/server/lib/fs/git-actions-sync.test.ts +18 -7
  230. package/src/server/lib/fs/git-actions-worktree.ts +5 -1
  231. package/src/server/lib/fs/git-blame.test.ts +206 -0
  232. package/src/server/lib/fs/git-blame.ts +189 -0
  233. package/src/server/lib/fs/root.ts +14 -0
  234. package/src/server/lib/http/same-origin.ts +28 -7
  235. package/src/server/lib/models/catalog.server.ts +230 -0
  236. package/src/server/lib/models/catalog.test.ts +83 -0
  237. package/src/server/lib/models/credential-origin.server.ts +108 -0
  238. package/src/server/lib/models/credential-origin.test.ts +132 -0
  239. package/src/server/lib/models/provider-icon-fetch.ts +115 -0
  240. package/src/server/lib/models/provider-icon-parse.test.ts +134 -0
  241. package/src/server/lib/models/provider-icon-parse.ts +139 -0
  242. package/src/server/lib/models/provider-icon-store.server.ts +118 -0
  243. package/src/server/lib/models/provider-icon-store.test.ts +107 -0
  244. package/src/server/lib/models/provider-icon.server.ts +209 -0
  245. package/src/server/lib/models/provider-items.server.ts +211 -37
  246. package/src/server/lib/models/provider-items.test.ts +201 -0
  247. package/src/server/lib/models/provider-registry.server.test.ts +27 -9
  248. package/src/server/lib/models/provider-registry.server.ts +160 -67
  249. package/src/server/lib/models/registry.server.test.ts +3 -3
  250. package/src/server/lib/models/registry.server.ts +8 -0
  251. package/src/server/lib/omp/config/definitions.test.ts +5 -4
  252. package/src/server/lib/omp/config/models-config.ts +42 -0
  253. package/src/server/lib/omp/config/provider-entry.test.ts +205 -0
  254. package/src/server/lib/omp/config/provider-entry.ts +197 -0
  255. package/src/server/lib/omp/config/provider-seeds.ts +10 -0
  256. package/src/server/lib/omp/core/models-json.ts +69 -0
  257. package/src/server/lib/omp/session/messages.ts +17 -3
  258. package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +13 -3
  259. package/src/server/lib/panels/bundled-catalog.server.ts +7 -0
  260. package/src/server/lib/panels/catalog-offers.server.ts +68 -0
  261. package/src/server/lib/panels/git-update.server.test.ts +14 -0
  262. package/src/server/lib/panels/git-update.server.ts +63 -1
  263. package/src/server/lib/panels/manifest.test.ts +65 -0
  264. package/src/server/lib/panels/manifest.ts +55 -1
  265. package/src/server/lib/panels/offers.server.test.ts +191 -0
  266. package/src/server/lib/panels/offers.server.ts +108 -0
  267. package/src/server/lib/panels/registry.server.test.ts +35 -1
  268. package/src/server/lib/panels/registry.server.ts +51 -142
  269. package/src/server/lib/panels/scan.server.ts +162 -0
  270. package/src/server/lib/route-adapter.ts +13 -2
  271. package/src/server/lib/tray/tray.test.ts +2 -1
  272. package/src/server/lib/usage/providers.server.ts +4 -1
  273. package/src/server/routes/chat/session.ts +7 -1
  274. package/src/server/routes/fs/git-blame-loader.test.ts +146 -0
  275. package/src/server/routes/fs/git.ts +17 -0
  276. package/src/server/routes/fs/grant.test.ts +135 -0
  277. package/src/server/routes/fs/grant.ts +79 -0
  278. package/src/server/routes/fs/index.ts +2 -0
  279. package/src/server/routes/fs/scope.ts +34 -17
  280. package/src/server/routes/omp/login.ts +41 -14
  281. package/src/server/routes/omp/routes.test.ts +23 -10
  282. package/src/server/routes/settings/index.ts +8 -0
  283. package/src/server/routes/settings/provider-entry.ts +108 -0
  284. package/src/server/routes/settings/provider-icon.ts +99 -0
  285. package/src/server/routes/settings/provider-model.ts +4 -1
  286. package/src/server/routes/settings/provider-refresh.ts +87 -0
  287. package/src/server/routes/settings/providers.ts +31 -2
  288. package/src/shared/lib/chat/omp/fold.test.ts +34 -0
  289. package/src/shared/lib/chat/omp/tool-frames.test.ts +20 -0
  290. package/src/shared/lib/chat/omp/tool-frames.ts +5 -1
  291. package/src/shared/lib/chat/omp/tool-results.ts +29 -3
  292. package/src/shared/lib/chat/tool/wait-facts.ts +4 -0
  293. package/src/shared/lib/fs/git-blame.test.ts +266 -0
  294. package/src/shared/lib/fs/git-blame.ts +246 -0
  295. package/src/shared/lib/git/url.ts +18 -0
  296. package/src/shared/lib/markdown/sanitize.test.ts +57 -0
  297. package/src/shared/lib/markdown/sanitize.ts +30 -7
  298. package/src/shared/lib/models/provider/connection.ts +135 -0
  299. package/src/shared/lib/models/provider/dialect.test.ts +4 -2
  300. package/src/shared/lib/models/provider/dialect.ts +76 -6
  301. package/src/shared/lib/models/provider/models.ts +2 -0
  302. package/src/shared/lib/models/provider/origin.ts +94 -0
  303. package/src/shared/lib/models/provider/provider-ui.test.ts +7 -0
  304. package/src/shared/lib/models/server-cache.ts +8 -3
  305. package/src/shared/lib/omp/session/messages-map-pending.test.ts +110 -0
  306. package/src/shared/lib/omp/session/messages-map.ts +34 -2
  307. package/src/shared/lib/omp/session/prewarm-misc.test.ts +7 -90
  308. package/src/shared/lib/omp/session/prewarm.test.ts +133 -0
  309. package/src/shared/lib/omp/session/prewarm.ts +23 -1
  310. package/src/shared/lib/omp/session/wait.test.ts +28 -0
  311. package/src/shared/lib/omp/session/wait.ts +38 -3
  312. package/src/shared/lib/panels/slot-labels.test.ts +61 -0
  313. package/src/shared/lib/panels/slot-labels.ts +133 -0
  314. package/src/shared/lib/workspace/panel-ids.ts +11 -0
  315. package/src/shared/types/fs.ts +6 -0
  316. package/src/shared/types/index.ts +1 -0
  317. package/src/shared/types/models.ts +12 -0
  318. package/src/shared/types/panels-registry.ts +277 -0
  319. package/src/shared/types/panels.ts +46 -213
  320. package/src/shared/types/settings/provider.ts +58 -0
  321. package/src/shared/types/settings/usage.ts +10 -0
  322. package/src/test-support/pristine-globals.ts +7 -0
  323. package/dist/client/static/js/index-bq6qeayr.css +0 -1
  324. package/src/client/components/settings/categories/provider-settings/ReconnectModal.tsx +0 -184
@@ -0,0 +1,277 @@
1
+ /**
2
+ * The panel-plugin registry's own types: what the server reports about an
3
+ * install, its freshness and the catalogs it came from.
4
+ *
5
+ * Split from `panels.ts` (the manifest, the plugin's own contract) because the
6
+ * two are read by different halves of the app: a plugin AUTHOR writes a manifest
7
+ * and never sees a `PanelPluginStatus`, while the pane reads the status and never
8
+ * parses a manifest. Keeping them in one file put a 430-line module in front of
9
+ * both.
10
+ */
11
+
12
+ import type { PanelPluginAuthor, PanelPluginOrigin, PanelSlotName } from '@/shared/types/panels';
13
+
14
+ /** A marketplace as the client sees it: no filesystem paths. */
15
+ export interface PanelMarketplaceItem {
16
+ id: string;
17
+ name: string;
18
+ description?: string;
19
+ /** Panels this marketplace contributed. */
20
+ panelCount: number;
21
+ /** Catalog entries that could not be resolved, with their reason. */
22
+ errors: PanelPluginError[];
23
+ }
24
+
25
+ /**
26
+ * One installed plugin, as the client sees it.
27
+ *
28
+ * Deliberately carries no filesystem path: the plugin's directory is a
29
+ * server-side detail the bundle route resolves from the registry itself, and
30
+ * sending it to the browser would publish the user's home directory layout for
31
+ * no consumer.
32
+ */
33
+ export interface PanelRegistryEntry {
34
+ pluginId: string;
35
+ name: string;
36
+ version: string;
37
+ /** Absolute URL of the plugin's ESM bundle, content-addressed per build. */
38
+ appUrl: string;
39
+ /**
40
+ * Absolute URL of the plugin's stylesheet, content-addressed per build.
41
+ *
42
+ * Present only when the plugin declares `css` AND the file exists, so a plugin
43
+ * with no stylesheet costs nothing. The client loads it while the plugin has a
44
+ * live content-script generation and unloads it when the last one goes.
45
+ */
46
+ cssUrl?: string;
47
+ /** Absolute URL of the plugin's icon, when it declares one. */
48
+ iconUrl?: string;
49
+ /** Absolute URL of the plugin's README, when it ships one. */
50
+ readmeUrl?: string;
51
+ }
52
+
53
+ /**
54
+ * Why a plugin directory was skipped, so the UI can report it instead of hiding it.
55
+ *
56
+ * `marketplace` is filled in by the scan so the pane can group a rejection under
57
+ * the marketplace it came from. Deriving that in the UI would mean matching on
58
+ * the path, which breaks the moment two marketplaces share a directory name.
59
+ *
60
+ * `source` is filled in for ONE rejection — a catalog entry naming a directory
61
+ * that is not there. That row is the only one a user can act on from the pane
62
+ * (forget the entry), and the entry is addressed by its source path, so the
63
+ * server has to say which one it read rather than letting the client rebuild the
64
+ * path from `dir`: the catalog's `source` is free-form relative text, and a path
65
+ * reconstructed from the resolved directory would be a second, lossy encoding of
66
+ * the same fact.
67
+ */
68
+ export interface PanelPluginError {
69
+ dir: string;
70
+ reason: string;
71
+ marketplace?: string;
72
+ /** The catalog entry's `source`, on a dangling-entry rejection. */
73
+ source?: string;
74
+ }
75
+
76
+ /**
77
+ * The last known freshness of a git-installed plugin.
78
+ *
79
+ * A plugin installed from a git URL is a CLONE, so its `.git` directory is the
80
+ * only record of where it came from — the marketplace catalog names a relative
81
+ * path, not a URL. That is why the origin is derived from the clone itself (see
82
+ * `git-origin.server.ts`) rather than stored beside the catalog entry: a value
83
+ * the user could edit into disagreement with the directory would be a second
84
+ * answer to the same question.
85
+ *
86
+ * `current` and `latest` are commit SHAs, not versions: a plugin repository
87
+ * publishes no release, so the only honest comparison is the commit the working
88
+ * copy sits on against the commit the remote's HEAD names.
89
+ */
90
+ export interface PanelGitStatus {
91
+ /** The commit the installed clone is at, or null when it could not be read. */
92
+ current: string | null;
93
+ /** The commit the remote's HEAD names, or null when the probe failed. */
94
+ latest: string | null;
95
+ /**
96
+ * The version the remote's manifest declares, when the probe could read it.
97
+ *
98
+ * A commit SHA answers "is this clone behind" but not "which version is
99
+ * newer", and the pane shows a version on every card — so the probe fetches
100
+ * the remote's manifest once when the SHAs differ. Absent means the remote's
101
+ * version is unknown (a probe that only compared refs), never "same".
102
+ */
103
+ latestVersion?: string;
104
+ /** True when the two differ — the clone is behind the remote. */
105
+ updateAvailable: boolean;
106
+ /** When the probe last ran, or null when it never has. */
107
+ checkedAt: number | null;
108
+ /** Why the probe failed. Absent when it succeeded. */
109
+ error?: string;
110
+ }
111
+
112
+ /**
113
+ * One installed plugin's build state.
114
+ *
115
+ * A plugin is a Bun package, so its UI is served from a BUILD output (`dist/`)
116
+ * rather than from its sources. A plugin whose build has not run — freshly
117
+ * cloned, or a build that failed — therefore has a valid manifest and no
118
+ * importable bundle, and that is a different condition from a rejected manifest:
119
+ * the pane offers a Rebuild for it instead of reporting it as broken.
120
+ */
121
+ export interface PanelPluginStatus {
122
+ pluginId: string;
123
+ name: string;
124
+ /**
125
+ * The version the INSTALLED manifest declares.
126
+ *
127
+ * Read here rather than at render time because the freshness question needs
128
+ * both sides in one place: the store's copy and the installed copy are
129
+ * different directories, and a row that showed only one of them could not say
130
+ * whether the install is behind.
131
+ */
132
+ version: string;
133
+ /** True when the bundle its manifest names exists on disk. */
134
+ built: boolean;
135
+ /** Why the last build did not produce the bundle, when it did not. */
136
+ reason?: string;
137
+ /** Whether the plugin is a Bun package (has a package.json). */
138
+ isPackage: boolean;
139
+ /**
140
+ * Whether the plugin's contributions are live.
141
+ *
142
+ * Installing and enabling are two separate steps on purpose: a bundled plugin
143
+ * arrives in the catalog UNINSTALLED (VS Code's model — the marketplace is a
144
+ * store, not a preinstalled set), and an installed plugin can be switched off
145
+ * without deleting its directory. A disabled plugin contributes nothing —
146
+ * no activity-bar button, no header button, no editor tab — and its bundle is
147
+ * no longer served.
148
+ */
149
+ enabled: boolean;
150
+ /** Whether the plugin came from the bundled marketplace rather than a git URL. */
151
+ bundled: boolean;
152
+ /**
153
+ * Where this install came from, as one value.
154
+ *
155
+ * `bundled` means Kabmo's own store supplied it and the boot-time sync keeps
156
+ * it current; `git` means a clone the user owns and updates by hand (or by
157
+ * auto-update); `local` is a directory dropped into the marketplace, which
158
+ * nothing updates. It is DERIVED (origin URL, store membership) rather than
159
+ * stored, for the same reason `gitOrigin` is read off the clone.
160
+ */
161
+ origin: PanelPluginOrigin;
162
+ /** The manifest's description, so a card can explain itself. */
163
+ description?: string;
164
+ author?: PanelPluginAuthor;
165
+ homepage?: string;
166
+ /** The slots the manifest DECLARES; live registrations are authoritative. */
167
+ slots?: PanelSlotName[];
168
+ capabilities?: string[];
169
+ /** How many settings the manifest declares, so the card can say what is configurable. */
170
+ settingsCount?: number;
171
+ /**
172
+ * The version the SOURCE offers, when it is known and newer.
173
+ *
174
+ * For a bundled install it is the store's copy; for a git clone it is read
175
+ * from the remote's manifest by the freshness probe. Absent means "unknown",
176
+ * never "current" — a clone whose remote was never asked has no latest.
177
+ */
178
+ latestVersion?: string;
179
+ /**
180
+ * The clone's `origin` URL, or null when the plugin is not a git clone.
181
+ *
182
+ * Read off the plugin's own `.git` rather than recorded at install time: the
183
+ * directory IS the install, so a URL that could be edited apart from it would
184
+ * be a second answer to the same question. A non-null value is what makes the
185
+ * pane offer Update and what the auto-update pass selects on.
186
+ */
187
+ gitOrigin: string | null;
188
+ }
189
+
190
+ /**
191
+ * One plugin the bundled marketplace offers, whether or not it is installed.
192
+ *
193
+ * The catalog is what the Panel Plugins pane lists as AVAILABLE: the bundled
194
+ * marketplace is a store the user installs from, so a plugin sitting in
195
+ * `<package>/marketplace/plugins/` is an offer, not an install. A catalog entry
196
+ * cannot describe what a plugin CONTRIBUTES — that is known only after its
197
+ * bundle loads — so the row carries the identity alone.
198
+ */
199
+ export interface PanelCatalogEntry {
200
+ pluginId: string;
201
+ name: string;
202
+ version: string;
203
+ description?: string;
204
+ /** Absolute URL of the plugin's icon, when the store's copy declares one. */
205
+ iconUrl?: string;
206
+ /** Absolute URL of the plugin's README, when the store's copy ships one. */
207
+ readmeUrl?: string;
208
+ /** True once the plugin is installed — the row then offers Enable/Remove. */
209
+ installed: boolean;
210
+ /**
211
+ * Where installing this offer would bring the code FROM.
212
+ *
213
+ * `bundled` is the copy inside the package; `git` is a URL listed in
214
+ * `marketplace.json`, which `install` clones. The card says which, because
215
+ * the two behave differently afterwards: one is kept current by Kabmo's own
216
+ * sync, the other is a clone the user owns.
217
+ */
218
+ origin: 'bundled' | 'git';
219
+ /** The git URL to clone, for a `git` offer. */
220
+ url?: string;
221
+ author?: PanelPluginAuthor;
222
+ homepage?: string;
223
+ /** The slots the offer's manifest declares, for a card that cannot ask. */
224
+ slots?: PanelSlotName[];
225
+ }
226
+
227
+ export interface PanelRegistryPayload {
228
+ /** Installed, enabled plugins — the bundles the host should import. */
229
+ panels: PanelRegistryEntry[];
230
+ marketplaces: PanelMarketplaceItem[];
231
+ errors: PanelPluginError[];
232
+ /** Every installed plugin, with its build and enablement state. */
233
+ plugins: PanelPluginStatus[];
234
+ /** The bundled marketplace's offers, installed or not. */
235
+ catalog: PanelCatalogEntry[];
236
+ /**
237
+ * Every panel id whose contributions are switched OFF.
238
+ *
239
+ * ONE set for both kinds of panel, because enablement is one question: a
240
+ * plugin is named by `plugin:<pluginId>`, and a BUILT-IN view by its bare id
241
+ * (`git`, `files`, …). The server only ever stores these ids — it has no
242
+ * built-in panel list, and does not need one, because the client is what
243
+ * resolves a bare id to a component. Carrying the set here rather than in the
244
+ * Kabmo settings blob is what keeps ONE store: the activity-bar menu and
245
+ * the Panel Plugins switches write the same ids through the same endpoint,
246
+ * so the two surfaces cannot disagree about whether a panel is on.
247
+ */
248
+ disabledPanels: string[];
249
+ /**
250
+ * The last known freshness of each git-installed plugin, by plugin id.
251
+ *
252
+ * A separate map rather than a field on the status row because it is a
253
+ * DIFFERENT read: the status comes from the marketplace scan (local, always
254
+ * current), while this is the result of the last network probe. A plugin that
255
+ * was never probed is simply absent, which the pane renders as "not checked".
256
+ */
257
+ gitStatus: Record<string, PanelGitStatus>;
258
+ /** Whether git-installed plugins are updated automatically. */
259
+ autoUpdate: boolean;
260
+ /**
261
+ * The bundled plugins a local edit has stopped from syncing, by plugin id.
262
+ *
263
+ * A refusal, not a fault: the user changed files in a plugin Kabmo
264
+ * installed, so Kabmo leaves them alone. It travels on the payload
265
+ * because the alternative is a plugin that silently stays on an old version
266
+ * with nothing on screen to say why.
267
+ */
268
+ syncBlocked: Record<string, PanelSyncBlocked>;
269
+ }
270
+
271
+ /** A bundled plugin whose sync a local edit refused. */
272
+ export interface PanelSyncBlocked {
273
+ /** When the sync was refused. */
274
+ at: number;
275
+ /** The tracked files that differ from what the install wrote, sorted. */
276
+ changed: string[];
277
+ }
@@ -18,6 +18,27 @@ import type { PluginSettingDefinition } from '@kabmo-labs/kabmo-sdk';
18
18
  /** Where a contributed panel renders. One panel per position, per plugin. */
19
19
  export type PanelPosition = 'right' | 'editor' | 'header';
20
20
 
21
+ /**
22
+ * The four POSITIONAL slots a plugin may fill, by their registration names.
23
+ *
24
+ * A manifest may DECLARE these (`slots`) so a store card can say what a plugin
25
+ * offers before its bundle has ever run. A declaration is advisory: the live
26
+ * registration is authoritative, and the card marks a declared-only row.
27
+ */
28
+ export const PANEL_SLOT_NAMES = ['rightPanel', 'panel', 'headerPanel', 'settingsSection'] as const;
29
+
30
+ export type PanelSlotName = (typeof PANEL_SLOT_NAMES)[number];
31
+
32
+ /** Who wrote a plugin. `name` is required; the rest is optional. */
33
+ export interface PanelPluginAuthor {
34
+ name: string;
35
+ email?: string;
36
+ url?: string;
37
+ }
38
+
39
+ /** Where an installed plugin came from. */
40
+ export type PanelPluginOrigin = 'bundled' | 'git' | 'local';
41
+
21
42
  /**
22
43
  * A plugin's own manifest (`kabmo` in `package.json`, or a standalone
23
44
  * `kabmo.json`).
@@ -85,6 +106,22 @@ export interface PanelPluginManifest {
85
106
  readme?: string;
86
107
  /** Optional branding block; `icon` above is authoritative when both exist. */
87
108
  branding?: { icon?: string };
109
+ /**
110
+ * Who wrote the plugin, so a card can credit them without opening the README.
111
+ *
112
+ * Declared here rather than read from `package.json.author` alone, because a
113
+ * plugin may ship a standalone `kabmo.json` and never have a package at all.
114
+ */
115
+ author?: PanelPluginAuthor;
116
+ /**
117
+ * The slots the plugin CONTRIBUTES, declared up front.
118
+ *
119
+ * Advisory: a plugin's live registrations are what it actually fills, and a
120
+ * declaration can be stale. It exists so a plugin that is not installed yet —
121
+ * a store card — can still say what it will add, which no registration can
122
+ * answer before the bundle runs.
123
+ */
124
+ slots?: PanelSlotName[];
88
125
  }
89
126
 
90
127
  /**
@@ -93,6 +130,11 @@ export interface PanelPluginManifest {
93
130
  * `source` is a path RELATIVE to the marketplace root — the same convention
94
131
  * omp's own `marketplace.json` uses, so a catalog written for omp reads the
95
132
  * same way here. It is resolved under the root and may not escape it.
133
+ *
134
+ * A source may also be a REMOTE git URL (`https://…`, `ssh://…`, `git@…`).
135
+ * That entry is an OFFER rather than a directory: the pane lists it as
136
+ * installable and `install` clones it, which is what lets one `marketplace.json`
137
+ * curate a set of plugins that do not live inside the marketplace at all.
96
138
  */
97
139
  export interface PanelMarketplacePluginEntry {
98
140
  name: string;
@@ -100,6 +142,10 @@ export interface PanelMarketplacePluginEntry {
100
142
  description?: string;
101
143
  version?: string;
102
144
  category?: string;
145
+ author?: PanelPluginAuthor;
146
+ homepage?: string;
147
+ /** True when `source` is a remote git URL rather than a directory here. */
148
+ remote?: boolean;
103
149
  }
104
150
 
105
151
  /**
@@ -119,216 +165,3 @@ export interface PanelMarketplaceManifest {
119
165
  plugins?: PanelMarketplacePluginEntry[];
120
166
  }
121
167
 
122
- /** A marketplace as the client sees it: no filesystem paths. */
123
- export interface PanelMarketplaceItem {
124
- id: string;
125
- name: string;
126
- description?: string;
127
- /** Panels this marketplace contributed. */
128
- panelCount: number;
129
- /** Catalog entries that could not be resolved, with their reason. */
130
- errors: PanelPluginError[];
131
- }
132
-
133
- /**
134
- * One installed plugin, as the client sees it.
135
- *
136
- * Deliberately carries no filesystem path: the plugin's directory is a
137
- * server-side detail the bundle route resolves from the registry itself, and
138
- * sending it to the browser would publish the user's home directory layout for
139
- * no consumer.
140
- */
141
- export interface PanelRegistryEntry {
142
- pluginId: string;
143
- name: string;
144
- version: string;
145
- /** Absolute URL of the plugin's ESM bundle, content-addressed per build. */
146
- appUrl: string;
147
- /**
148
- * Absolute URL of the plugin's stylesheet, content-addressed per build.
149
- *
150
- * Present only when the plugin declares `css` AND the file exists, so a plugin
151
- * with no stylesheet costs nothing. The client loads it while the plugin has a
152
- * live content-script generation and unloads it when the last one goes.
153
- */
154
- cssUrl?: string;
155
- /** Absolute URL of the plugin's icon, when it declares one. */
156
- iconUrl?: string;
157
- /** Absolute URL of the plugin's README, when it ships one. */
158
- readmeUrl?: string;
159
- }
160
-
161
- /**
162
- * Why a plugin directory was skipped, so the UI can report it instead of hiding it.
163
- *
164
- * `marketplace` is filled in by the scan so the pane can group a rejection under
165
- * the marketplace it came from. Deriving that in the UI would mean matching on
166
- * the path, which breaks the moment two marketplaces share a directory name.
167
- *
168
- * `source` is filled in for ONE rejection — a catalog entry naming a directory
169
- * that is not there. That row is the only one a user can act on from the pane
170
- * (forget the entry), and the entry is addressed by its source path, so the
171
- * server has to say which one it read rather than letting the client rebuild the
172
- * path from `dir`: the catalog's `source` is free-form relative text, and a path
173
- * reconstructed from the resolved directory would be a second, lossy encoding of
174
- * the same fact.
175
- */
176
- export interface PanelPluginError {
177
- dir: string;
178
- reason: string;
179
- marketplace?: string;
180
- /** The catalog entry's `source`, on a dangling-entry rejection. */
181
- source?: string;
182
- }
183
-
184
- /**
185
- * The last known freshness of a git-installed plugin.
186
- *
187
- * A plugin installed from a git URL is a CLONE, so its `.git` directory is the
188
- * only record of where it came from — the marketplace catalog names a relative
189
- * path, not a URL. That is why the origin is derived from the clone itself (see
190
- * `git-origin.server.ts`) rather than stored beside the catalog entry: a value
191
- * the user could edit into disagreement with the directory would be a second
192
- * answer to the same question.
193
- *
194
- * `current` and `latest` are commit SHAs, not versions: a plugin repository
195
- * publishes no release, so the only honest comparison is the commit the working
196
- * copy sits on against the commit the remote's HEAD names.
197
- */
198
- export interface PanelGitStatus {
199
- /** The commit the installed clone is at, or null when it could not be read. */
200
- current: string | null;
201
- /** The commit the remote's HEAD names, or null when the probe failed. */
202
- latest: string | null;
203
- /** True when the two differ — the clone is behind the remote. */
204
- updateAvailable: boolean;
205
- /** When the probe last ran, or null when it never has. */
206
- checkedAt: number | null;
207
- /** Why the probe failed. Absent when it succeeded. */
208
- error?: string;
209
- }
210
-
211
- /**
212
- * One installed plugin's build state.
213
- *
214
- * A plugin is a Bun package, so its UI is served from a BUILD output (`dist/`)
215
- * rather than from its sources. A plugin whose build has not run — freshly
216
- * cloned, or a build that failed — therefore has a valid manifest and no
217
- * importable bundle, and that is a different condition from a rejected manifest:
218
- * the pane offers a Rebuild for it instead of reporting it as broken.
219
- */
220
- export interface PanelPluginStatus {
221
- pluginId: string;
222
- name: string;
223
- /**
224
- * The version the INSTALLED manifest declares.
225
- *
226
- * Read here rather than at render time because the freshness question needs
227
- * both sides in one place: the store's copy and the installed copy are
228
- * different directories, and a row that showed only one of them could not say
229
- * whether the install is behind.
230
- */
231
- version: string;
232
- /** True when the bundle its manifest names exists on disk. */
233
- built: boolean;
234
- /** Why the last build did not produce the bundle, when it did not. */
235
- reason?: string;
236
- /** Whether the plugin is a Bun package (has a package.json). */
237
- isPackage: boolean;
238
- /**
239
- * Whether the plugin's contributions are live.
240
- *
241
- * Installing and enabling are two separate steps on purpose: a bundled plugin
242
- * arrives in the catalog UNINSTALLED (VS Code's model — the marketplace is a
243
- * store, not a preinstalled set), and an installed plugin can be switched off
244
- * without deleting its directory. A disabled plugin contributes nothing —
245
- * no activity-bar button, no header button, no editor tab — and its bundle is
246
- * no longer served.
247
- */
248
- enabled: boolean;
249
- /** Whether the plugin came from the bundled marketplace rather than a git URL. */
250
- bundled: boolean;
251
- /**
252
- * The clone's `origin` URL, or null when the plugin is not a git clone.
253
- *
254
- * Read off the plugin's own `.git` rather than recorded at install time: the
255
- * directory IS the install, so a URL that could be edited apart from it would
256
- * be a second answer to the same question. A non-null value is what makes the
257
- * pane offer Update and what the auto-update pass selects on.
258
- */
259
- gitOrigin: string | null;
260
- }
261
-
262
- /**
263
- * One plugin the bundled marketplace offers, whether or not it is installed.
264
- *
265
- * The catalog is what the Panel Plugins pane lists as AVAILABLE: the bundled
266
- * marketplace is a store the user installs from, so a plugin sitting in
267
- * `<package>/marketplace/plugins/` is an offer, not an install. A catalog entry
268
- * cannot describe what a plugin CONTRIBUTES — that is known only after its
269
- * bundle loads — so the row carries the identity alone.
270
- */
271
- export interface PanelCatalogEntry {
272
- pluginId: string;
273
- name: string;
274
- version: string;
275
- description?: string;
276
- /** Absolute URL of the plugin's icon, when the store's copy declares one. */
277
- iconUrl?: string;
278
- /** Absolute URL of the plugin's README, when the store's copy ships one. */
279
- readmeUrl?: string;
280
- /** True once the plugin is installed — the row then offers Enable/Remove. */
281
- installed: boolean;
282
- }
283
-
284
- export interface PanelRegistryPayload {
285
- /** Installed, enabled plugins — the bundles the host should import. */
286
- panels: PanelRegistryEntry[];
287
- marketplaces: PanelMarketplaceItem[];
288
- errors: PanelPluginError[];
289
- /** Every installed plugin, with its build and enablement state. */
290
- plugins: PanelPluginStatus[];
291
- /** The bundled marketplace's offers, installed or not. */
292
- catalog: PanelCatalogEntry[];
293
- /**
294
- * Every panel id whose contributions are switched OFF.
295
- *
296
- * ONE set for both kinds of panel, because enablement is one question: a
297
- * plugin is named by `plugin:<pluginId>`, and a BUILT-IN view by its bare id
298
- * (`git`, `files`, …). The server only ever stores these ids — it has no
299
- * built-in panel list, and does not need one, because the client is what
300
- * resolves a bare id to a component. Carrying the set here rather than in the
301
- * Kabmo settings blob is what keeps ONE store: the activity-bar menu and
302
- * the Panel Plugins switches write the same ids through the same endpoint,
303
- * so the two surfaces cannot disagree about whether a panel is on.
304
- */
305
- disabledPanels: string[];
306
- /**
307
- * The last known freshness of each git-installed plugin, by plugin id.
308
- *
309
- * A separate map rather than a field on the status row because it is a
310
- * DIFFERENT read: the status comes from the marketplace scan (local, always
311
- * current), while this is the result of the last network probe. A plugin that
312
- * was never probed is simply absent, which the pane renders as "not checked".
313
- */
314
- gitStatus: Record<string, PanelGitStatus>;
315
- /** Whether git-installed plugins are updated automatically. */
316
- autoUpdate: boolean;
317
- /**
318
- * The bundled plugins a local edit has stopped from syncing, by plugin id.
319
- *
320
- * A refusal, not a fault: the user changed files in a plugin Kabmo
321
- * installed, so Kabmo leaves them alone. It travels on the payload
322
- * because the alternative is a plugin that silently stays on an old version
323
- * with nothing on screen to say why.
324
- */
325
- syncBlocked: Record<string, PanelSyncBlocked>;
326
- }
327
-
328
- /** A bundled plugin whose sync a local edit refused. */
329
- export interface PanelSyncBlocked {
330
- /** When the sync was refused. */
331
- at: number;
332
- /** The tracked files that differ from what the install wrote, sorted. */
333
- changed: string[];
334
- }
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Where omp resolves a provider's credential from. The four values are omp's
3
+ * own distinctions (its `/login` selector prints the same set as
4
+ * `--api-key` / `config` / `login` / `api key` / `env`), folded to the ones
5
+ * that change what the settings UI may offer: a provider authenticated by the
6
+ * environment has nothing on disk to remove, so `sign out` cannot work on it.
7
+ */
8
+ export type ProviderCredentialOrigin = 'models.yml' | 'api-key' | 'login' | 'environment';
9
+
1
10
  export interface ProviderModel {
2
11
  id: string;
3
12
  name: string;
@@ -6,6 +15,17 @@ export interface ProviderModel {
6
15
  hasVision: boolean;
7
16
  hasReasoning?: boolean;
8
17
  isVisible: boolean;
18
+ /**
19
+ * omp's `ModelKind` for this model (`chat`, `embedding`, `image`, `search`,
20
+ * `judge`, …). Absent means chat — omp's own default.
21
+ */
22
+ kind?: string;
23
+ /** The reasoning ladder the model declares, lowest first, when it thinks. */
24
+ thinkingEfforts?: string[];
25
+ /** `thinking.mode` from models.yml (`effort`, `budget`, `google-level`, …). */
26
+ thinkingMode?: string;
27
+ /** omp's pricing verdict for the row (`exact`, `estimated`, `unknown`). */
28
+ pricingStatus?: string;
9
29
  /** USD per 1M tokens (unit of measure not obvious from the name alone). */
10
30
  priceInput?: number;
11
31
  priceOutput?: number;
@@ -38,6 +58,8 @@ export type OmpProviderApi =
38
58
  | 'google-gemini-cli'
39
59
  | 'google-vertex'
40
60
  | 'openrouter-decisions'
61
+ | 'openai-decisions'
62
+ | 'workers-ai-systemone'
41
63
  | 'typesafe';
42
64
 
43
65
  /** omp's `ProviderAuthSchema`. `none` is what makes a local server keyless. */
@@ -89,6 +111,42 @@ export interface ProviderItem {
89
111
  * still accepted from a row written before the rename.
90
112
  */
91
113
  credentialSource?: 'omp-auth' | 'models.yml' | 'kabmo' | 'chamber';
114
+ /**
115
+ * WHERE omp resolves this provider's credential from, as the settings UI
116
+ * names it. omp's own `/login` selector prints the same distinctions, and
117
+ * folding them into one "connected" badge hid the case that matters most:
118
+ * a provider authenticated by an environment variable has no stored
119
+ * credential to remove, and `sign out` on it can only fail.
120
+ *
121
+ * - `models.yml` — an `apiKey` (or `!command`) in the provider entry
122
+ * - `api-key` — an api-key credential in omp's `agent.db`
123
+ * - `login` — an OAuth credential in omp's `agent.db`
124
+ * - `environment` — an env var omp reads; nothing on disk
125
+ */
126
+ credentialOrigin?: ProviderCredentialOrigin;
127
+ /** The provider is an OAuth provider omp can sign in to (`/login`). */
128
+ oauth?: boolean;
129
+ /** The provider is DISCOVERABLE — its own discovery/refresh is implemented. */
130
+ available?: boolean;
131
+ /** This provider has a row in Kabmo's SQLite overlay (visibility + sampling). */
132
+ inOverlay?: boolean;
133
+ /** Provider-level `headers` from models.yml, when the entry declares any. */
134
+ headers?: Record<string, string>;
135
+ /** `authHeader` from models.yml — send the credential as a raw auth header. */
136
+ authHeader?: boolean;
137
+ /** `transport` from models.yml (`pi-native` routes through the auth gateway). */
138
+ transport?: 'pi-native';
139
+ /**
140
+ * The provider's own web icon, served from `/api/provider-icon` — the favicon
141
+ * of the site its `baseUrl` points at.
142
+ *
143
+ * Present only once one has been FETCHED and stored. A `models.yml` provider
144
+ * has no brand mark in Kabmo's table (nobody can ship a logo for a gateway a
145
+ * user registered yesterday), so without this every such row fell back to its
146
+ * initials. The URL carries the fetch time, so a changed icon is a changed
147
+ * URL and no cache can pin the old picture.
148
+ */
149
+ iconUrl?: string;
92
150
  /**
93
151
  * The provider HAS an entry in omp's own `models.yml`.
94
152
  *
@@ -137,6 +137,16 @@ export interface UsageProviderSummary {
137
137
  /** Stable id (provider slug, lowercased) used for selection + persistence. */
138
138
  id: string;
139
139
  name: string;
140
+ /**
141
+ * The provider's own web icon, when one has been fetched and stored.
142
+ *
143
+ * Both usage surfaces draw a provider mark, and they drew the built-in glyph
144
+ * table — which cannot know a `models.yml` gateway, so those rows showed
145
+ * initials while the provider list showed the site's logo for the same
146
+ * provider. Carried on the summary because the usage payload does not include
147
+ * the provider registry.
148
+ */
149
+ iconUrl?: string;
140
150
  /** Where the credential was found ("models.yml", "agent.db", "app DB"). */
141
151
  credentialSources: string[];
142
152
  /**
@@ -30,6 +30,13 @@ export const pristineWebSocket = globalThis.WebSocket;
30
30
  export const DOM_TEST_GLOBALS = [
31
31
  'window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement',
32
32
  'Event', 'CustomEvent', 'WebSocket', 'EventSource',
33
+ // The frame callbacks a component reads off `globalThis`, not off `window`.
34
+ // `Toast` schedules its fade-in through a bare `requestAnimationFrame`, which
35
+ // is the browser's own global — Bun defines neither, so a suite that mounts a
36
+ // toast died with `ReferenceError: requestAnimationFrame is not defined`
37
+ // while every other component rendered. Listed here they are installed from
38
+ // the window under test and put back with the rest.
39
+ 'requestAnimationFrame', 'cancelAnimationFrame',
33
40
  // The three DOM data classes, because a suite that swaps `window` usually needs them and
34
41
  // a LOCAL save-and-restore loop is how they leaked: `editor/save-as.test.ts` installed
35
42
  // happy-dom's `File`/`Blob` and never put them back, so a later file's `carriesBytes` read