@kabmo-labs/kabmo 0.28.0 → 0.29.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 (225) hide show
  1. package/bunfig.toml +6 -0
  2. package/dist/client/index.html +2 -2
  3. package/dist/client/index.js +481 -472
  4. package/dist/client/static/js/{index-xzvyrxya.js → index-43z47ngg.js} +1193 -1049
  5. package/dist/client/static/js/index-naa91727.css +1 -0
  6. package/dist/client/static/{manifest-q6h8k9e0.webmanifest → manifest-vdvdqpre.webmanifest} +1 -0
  7. package/package.json +3 -2
  8. package/public/manifest.webmanifest +1 -0
  9. package/src/client/components/common/ComposerTextarea.test.tsx +109 -0
  10. package/src/client/components/common/ComposerTextarea.tsx +6 -0
  11. package/src/client/components/common/ReloadPageButton.test.tsx +14 -0
  12. package/src/client/components/common/ReloadPageButton.tsx +11 -2
  13. package/src/client/components/common/diagram-viewer/read-block.test.ts +71 -0
  14. package/src/client/components/common/diagram-viewer/read-block.ts +40 -16
  15. package/src/client/components/common/file-icon/index.tsx +7 -1
  16. package/src/client/components/common/harness-glyph/brands.ts +7 -1
  17. package/src/client/components/common/image-viewer/index.tsx +37 -165
  18. package/src/client/components/common/picker-search/index.tsx +70 -0
  19. package/src/client/components/common/search-select/index.tsx +2 -7
  20. package/src/client/components/common/zoom-pan-stage/index.tsx +258 -0
  21. package/src/client/components/common/zoom-pan-stage/zoom-pan-stage.test.tsx +87 -0
  22. package/src/client/components/layout/session-sidebar/ClassicView.tsx +1 -1
  23. package/src/client/components/layout/session-sidebar/SessionListNotice.tsx +7 -3
  24. package/src/client/components/layout/session-sidebar/about-modal/HarnessRow.tsx +4 -1
  25. package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +12 -1
  26. package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.test.tsx +82 -0
  27. package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.tsx +23 -3
  28. package/src/client/components/layout/session-sidebar/about-modal/index.tsx +1 -0
  29. package/src/client/components/layout/session-sidebar/modern/index.tsx +1 -1
  30. package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +6 -4
  31. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +8 -0
  32. package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +25 -0
  33. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +1 -1
  34. package/src/client/components/settings/Sidebar.tsx +6 -8
  35. package/src/client/components/settings/categories/HarnessSettings.tsx +4 -2
  36. package/src/client/components/settings/categories/PanelPluginSettings.tsx +2 -2
  37. package/src/client/components/settings/categories/PluginSettings.tsx +1 -1
  38. package/src/client/components/settings/categories/harness-settings/ConfigForm.tsx +3 -6
  39. package/src/client/components/settings/categories/panel-plugins/GitFreshness.test.tsx +36 -0
  40. package/src/client/components/settings/categories/panel-plugins/Section.tsx +1 -3
  41. package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +18 -4
  42. package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +64 -61
  43. package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +15 -4
  44. package/src/client/components/settings/groups.test.tsx +2 -2
  45. package/src/client/components/workspace/chat-timeline/IrcNotice.test.tsx +55 -0
  46. package/src/client/components/workspace/chat-timeline/IrcNotice.tsx +71 -0
  47. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +4 -1
  48. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +19 -0
  49. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +8 -3
  50. package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.search.test.tsx +72 -0
  51. package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +42 -15
  52. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +28 -0
  53. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +28 -10
  54. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +47 -1
  55. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +55 -5
  56. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +3 -2
  57. package/src/client/components/workspace/editor/FilePane.tsx +32 -0
  58. package/src/client/components/workspace/editor/Toolbar.tsx +4 -0
  59. package/src/client/components/workspace/editor/toolbar-clusters.test.ts +1 -0
  60. package/src/client/components/workspace/editor/toolbar-clusters.tsx +5 -2
  61. package/src/client/components/workspace/editor/viewers/CsvGrid.tsx +52 -5
  62. package/src/client/components/workspace/editor/viewers/DataGrid.tsx +227 -41
  63. package/src/client/components/workspace/editor/viewers/DrawioView.tsx +93 -0
  64. package/src/client/components/workspace/editor/viewers/GridRow.tsx +91 -0
  65. package/src/client/components/workspace/editor/viewers/GridToolbar.tsx +53 -0
  66. package/src/client/components/workspace/editor/viewers/SheetView.tsx +152 -57
  67. package/src/client/components/workspace/editor/viewers/dispatch.tsx +42 -9
  68. package/src/client/components/workspace/editor/viewers/drawio-pages.test.ts +80 -0
  69. package/src/client/components/workspace/editor/viewers/drawio-pages.ts +63 -0
  70. package/src/client/components/workspace/editor/viewers/grid.test.ts +296 -0
  71. package/src/client/components/workspace/editor/viewers/use-cell-edit.ts +64 -0
  72. package/src/client/components/workspace/editor/viewers/use-grid-interaction.ts +216 -0
  73. package/src/client/components/workspace/editor/viewers/viewers.test.ts +47 -2
  74. package/src/client/components/workspace/editor/viewers/workbook.ts +149 -0
  75. package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +262 -0
  76. package/src/client/components/workspace/file-explorer/ContextMenu.tsx +30 -6
  77. package/src/client/components/workspace/file-explorer/Modals.tsx +8 -3
  78. package/src/client/components/workspace/file-explorer/RootOverlays.tsx +60 -0
  79. package/src/client/components/workspace/file-explorer/RowLabel.tsx +6 -2
  80. package/src/client/components/workspace/file-explorer/TreeItem.tsx +39 -49
  81. package/src/client/components/workspace/file-explorer/TreeItemModals.tsx +80 -0
  82. package/src/client/components/workspace/file-explorer/index.tsx +53 -29
  83. package/src/client/components/workspace/file-explorer/selection.test.tsx +109 -0
  84. package/src/client/data/settings/omp-schema.json +169 -22
  85. package/src/client/glass.css +39 -14
  86. package/src/client/glass.test.ts +37 -0
  87. package/src/client/hooks/chat/composer/history.test.ts +267 -0
  88. package/src/client/hooks/chat/composer/history.ts +146 -0
  89. package/src/client/hooks/chat/timeline/ask-frames.test.ts +54 -0
  90. package/src/client/hooks/chat/timeline/ask-frames.ts +29 -1
  91. package/src/client/hooks/chat/timeline/timeline-rail.test.ts +34 -2
  92. package/src/client/hooks/chat/timeline/user-turns.ts +31 -2
  93. package/src/client/hooks/editor/file-editor-types.ts +15 -0
  94. package/src/client/hooks/editor/save-bytes.ts +79 -0
  95. package/src/client/hooks/editor/use-file-editor.test.ts +30 -0
  96. package/src/client/hooks/editor/use-file-editor.ts +53 -5
  97. package/src/client/hooks/editor/use-file-read.ts +21 -2
  98. package/src/client/hooks/editor/use-grid-selection.ts +160 -0
  99. package/src/client/hooks/models/use-harness-update.test.ts +35 -2
  100. package/src/client/hooks/models/use-harness-update.ts +49 -10
  101. package/src/client/hooks/workspace/diff-file.test.ts +72 -0
  102. package/src/client/hooks/workspace/diff-file.ts +12 -6
  103. package/src/client/hooks/workspace/file-archive.ts +220 -0
  104. package/src/client/hooks/workspace/file-clipboard.test.ts +4 -4
  105. package/src/client/hooks/workspace/file-clipboard.ts +37 -26
  106. package/src/client/hooks/workspace/file-selection.test.ts +67 -0
  107. package/src/client/hooks/workspace/file-selection.ts +156 -0
  108. package/src/client/hooks/workspace/file-tree-actions-clipboard.test.ts +5 -5
  109. package/src/client/hooks/workspace/file-tree-actions.ts +36 -8
  110. package/src/client/lib/editor/workbook-drafts.ts +42 -0
  111. package/src/client/lib/launch/file-handlers.ts +2 -2
  112. package/src/client/lib/scrollbar-activity.test.ts +21 -88
  113. package/src/client/lib/scrollbar-activity.ts +71 -73
  114. package/src/client/lib/scrollbar-events.ts +143 -0
  115. package/src/client/lib/scrollbar-input.test.ts +126 -0
  116. package/src/client/lib/scrollbar-probe.test-util.ts +107 -0
  117. package/src/client/tailwind.css +32 -1
  118. package/src/server/db.server.test.ts +50 -1
  119. package/src/server/db.server.ts +36 -3
  120. package/src/server/lib/chat/prompt-history.server.test.ts +92 -0
  121. package/src/server/lib/chat/prompt-history.server.ts +65 -0
  122. package/src/server/lib/chat/schema.server.ts +35 -0
  123. package/src/server/lib/db/schema.ts +3 -0
  124. package/src/server/lib/fs/archive.test.ts +139 -0
  125. package/src/server/lib/fs/archive.ts +259 -0
  126. package/src/server/lib/fs/git-diff.test.ts +26 -1
  127. package/src/server/lib/fs/git-diff.ts +43 -15
  128. package/src/server/lib/harness/launch-table.ts +19 -0
  129. package/src/server/lib/harness/provider-entry.ts +1 -1
  130. package/src/server/lib/harness/provider-file.server.ts +1 -1
  131. package/src/server/lib/harness/provider-sources.server.ts +2 -1
  132. package/src/server/lib/harness/provider-write.server.ts +2 -1
  133. package/src/server/lib/harness/update-job-store.ts +12 -0
  134. package/src/server/lib/harness/update-queue.server.ts +15 -10
  135. package/src/server/lib/omp/rpc/frame-fold-signals.test.ts +5 -1
  136. package/src/server/lib/omp/rpc/frame-fold.test.ts +5 -1
  137. package/src/server/lib/omp/rpc/lifecycle.test.ts +4 -0
  138. package/src/server/lib/omp/session/auto-title.server.test.ts +4 -0
  139. package/src/server/lib/omp/session/delete.server.ts +1 -0
  140. package/src/server/lib/omp/session/goal-driver.test.ts +5 -1
  141. package/src/server/lib/omp/session/goal-settings.test.ts +5 -1
  142. package/src/server/lib/panels/auto-update.server.test.ts +5 -2
  143. package/src/server/lib/panels/git-update.server.test.ts +5 -2
  144. package/src/server/lib/panels/install.server.test.ts +5 -2
  145. package/src/server/lib/panels/remove.server.test.ts +5 -2
  146. package/src/server/routes/agent/command.ts +11 -0
  147. package/src/server/routes/agent/new.ts +5 -0
  148. package/src/server/routes/chat/index.ts +5 -0
  149. package/src/server/routes/chat/prompt-history.test.ts +67 -0
  150. package/src/server/routes/chat/prompt-history.ts +31 -0
  151. package/src/server/routes/chat/stream.test.ts +21 -0
  152. package/src/server/routes/chat/stream.ts +5 -0
  153. package/src/server/routes/fs/action-archive.test.ts +128 -0
  154. package/src/server/routes/fs/action-bulk.ts +106 -0
  155. package/src/server/routes/fs/action-save-bytes.test.ts +59 -0
  156. package/src/server/routes/fs/action-transfer.test.ts +26 -0
  157. package/src/server/routes/fs/action.ts +91 -11
  158. package/src/server/routes/fs/archive.ts +20 -0
  159. package/src/server/routes/fs/grant.test.ts +5 -2
  160. package/src/server/routes/fs/index.ts +2 -0
  161. package/src/server/routes/fs/scope.test.ts +6 -2
  162. package/src/server/routes/harness/import-action.ts +1 -1
  163. package/src/server/routes/harness/root.ts +6 -1
  164. package/src/server/routes/harness/summary.test.ts +50 -0
  165. package/src/server/routes/harness/update-status.ts +41 -2
  166. package/src/server/routes/harness/update.test.ts +56 -2
  167. package/src/server/routes/sessions/delete.test.ts +4 -0
  168. package/src/shared/lib/chat/ask-form/index.ts +39 -31
  169. package/src/shared/lib/chat/ask-form/labels.ts +46 -0
  170. package/src/shared/lib/chat/ask-form/tokens.ts +11 -2
  171. package/src/shared/lib/chat/ask-form.test.ts +57 -0
  172. package/src/shared/lib/chat/ask-questions.ts +31 -0
  173. package/src/shared/lib/chat/composer/history.test.ts +67 -0
  174. package/src/shared/lib/chat/composer/history.ts +61 -0
  175. package/src/shared/lib/chat/irc-notice.ts +42 -0
  176. package/src/shared/lib/chat/timeline/fork-anchor.test.ts +2 -0
  177. package/src/shared/lib/chat/todo/parser.ts +6 -4
  178. package/src/shared/lib/fs/archive.test.ts +101 -0
  179. package/src/shared/lib/fs/archive.ts +191 -0
  180. package/src/shared/lib/fs/clipboard.test.ts +32 -7
  181. package/src/shared/lib/fs/clipboard.ts +59 -14
  182. package/src/shared/lib/fs/csv.test.ts +50 -0
  183. package/src/shared/lib/fs/csv.ts +40 -0
  184. package/src/shared/lib/fs/document-kind.test.ts +13 -6
  185. package/src/shared/lib/fs/document-kind.ts +18 -6
  186. package/src/shared/lib/fs/file-kind-classify.test.ts +4 -0
  187. package/src/shared/lib/fs/file-kind.test.ts +2 -7
  188. package/src/shared/lib/fs/file-kind.ts +4 -2
  189. package/src/shared/lib/fs/grid-edit.test.ts +24 -0
  190. package/src/shared/lib/fs/grid-edit.ts +29 -0
  191. package/src/shared/lib/fs/grid-selection.test.ts +137 -0
  192. package/src/shared/lib/fs/grid-selection.ts +138 -0
  193. package/src/shared/lib/harness/brand-color.ts +5 -0
  194. package/src/shared/lib/harness/catalog.test.ts +22 -0
  195. package/src/shared/lib/harness/catalog.ts +12 -1
  196. package/src/shared/lib/harness/config-fields.test.ts +25 -0
  197. package/src/shared/lib/harness/config-fields.ts +33 -3
  198. package/src/shared/lib/harness/dialects.ts +1 -1
  199. package/src/shared/lib/harness/mcp-facts.ts +4 -0
  200. package/src/shared/lib/harness/provider-contracts.ts +109 -0
  201. package/src/shared/lib/harness/provider-facts.test.ts +2 -1
  202. package/src/shared/lib/harness/provider-facts.ts +24 -115
  203. package/src/shared/lib/harness/provider-lookup.ts +37 -0
  204. package/src/shared/lib/harness/providers.ts +2 -1
  205. package/src/shared/lib/harness/updates.ts +10 -0
  206. package/src/shared/lib/omp/session/mapper.test.ts +31 -0
  207. package/src/shared/lib/omp/session/mapper.ts +17 -0
  208. package/src/shared/lib/omp/session/messages-map-notice.test.ts +68 -0
  209. package/src/shared/lib/omp/session/messages-map.test.ts +1 -35
  210. package/src/shared/lib/omp/session/messages-map.ts +17 -0
  211. package/src/shared/lib/omp/session/wait.ts +10 -1
  212. package/src/shared/lib/settings/sections.ts +8 -4
  213. package/src/shared/lib/ui/picker-filter.test.ts +23 -0
  214. package/src/shared/lib/ui/picker-filter.ts +20 -0
  215. package/src/shared/types/chat.ts +4 -0
  216. package/src/shared/types/harness.ts +5 -1
  217. package/src/shared/types/omp/session.ts +18 -0
  218. package/src/shared/types/settings/state.ts +6 -6
  219. package/src/shared/types/todo.ts +3 -1
  220. package/src/test-support/file-actions.test-util.ts +4 -0
  221. package/src/test-support/file-archive.test-util.ts +41 -0
  222. package/src/test-support/file-clipboard.test-util.ts +9 -6
  223. package/src/test-support/harness-table.test-util.ts +2 -0
  224. package/src/test-support/preload.ts +46 -0
  225. package/dist/client/static/js/index-81f7berm.css +0 -1
@@ -25,6 +25,7 @@
25
25
  */
26
26
 
27
27
  import type { RefObject } from 'preact';
28
+ import { useCallback } from 'preact/hooks';
28
29
  import { CodeSurface, type CodeSurfaceHandle } from '@/client/components/common/code-surface';
29
30
  import { ImageViewer } from '@/client/components/common/image-viewer';
30
31
  import { PreviewScroller } from '@/client/components/mobile/mobile-right-sidebar/PreviewScroller';
@@ -36,6 +37,7 @@ import type { EditorTypingOptions } from '@/client/components/common/code-surfac
36
37
  import type { EditorThemeState } from '@/client/hooks/editor/theme';
37
38
  import { EDITOR_LINE_HEIGHT } from '@/shared/lib/code/editor/typography';
38
39
  import type { ViewerKind } from '@/shared/lib/fs/document-kind';
40
+ import { saveFileBytes } from '@/client/hooks/editor/save-bytes';
39
41
 
40
42
  interface MobileEditorSurfaceProps {
41
43
  file: MobileEditorFile;
@@ -90,6 +92,26 @@ export function MobileEditorSurface({
90
92
  indentUnitText,
91
93
  typing,
92
94
  }: MobileEditorSurfaceProps) {
95
+ // The workbook grid's write path, the same one the desktop pane builds: a
96
+ // device-backed tab has nowhere to write, so it is not offered.
97
+ const saveBytes = useCallback(
98
+ async (bytes: Uint8Array) => {
99
+ const outcome = await saveFileBytes(file, bytes, {
100
+ interactive: true,
101
+ baseMtimeMs: editor.baseMtimeMs,
102
+ });
103
+ if (outcome.status === 'written') return { ok: true };
104
+ if (outcome.status === 'conflict') {
105
+ return { ok: false, error: 'This file changed on disk since it was opened.' };
106
+ }
107
+ if (outcome.status === 'needs-permission') {
108
+ return { ok: false, error: 'Tap Save again to grant write access.' };
109
+ }
110
+ return { ok: false, error: outcome.error };
111
+ },
112
+ [file, editor.baseMtimeMs],
113
+ );
114
+
93
115
  if (editor.isImage && editor.imageUrl) {
94
116
  return <ImageViewer src={editor.imageUrl} name={file.name} className="flex-1 min-h-0" />;
95
117
  }
@@ -102,6 +124,9 @@ export function MobileEditorSurface({
102
124
  source={editor.byteSource}
103
125
  content={editor.content}
104
126
  revision={editor.revision}
127
+ onContentChange={editor.onChange}
128
+ onSaveBytes={editor.deviceBacked ? undefined : saveBytes}
129
+ onDirtyChange={editor.setBinaryDirty}
105
130
  />
106
131
  );
107
132
  }
@@ -122,7 +122,7 @@ export function ClassicDrawer({
122
122
  />
123
123
 
124
124
  {failed ? (
125
- <SessionListNotice touch onRetry={onRefresh} />
125
+ <SessionListNotice touch onRetry={onRefresh} refreshing={refreshing} />
126
126
  ) : initializing ? (
127
127
  <MobileSessionListSkeleton />
128
128
  ) : (
@@ -36,6 +36,9 @@ export const SETTINGS_CATEGORIES: CategoryDef[] = [
36
36
  { id: 'behavior', label: 'Behavior', icon: Sliders, section: 'OMP', description: 'Native AGENTS.md and RULES.md: global instructions, permission gates, and safety filters.' },
37
37
  { id: 'commands', label: 'Commands', icon: Terminal, section: 'OMP', description: 'Slash command macros and terminal shortcuts.' },
38
38
  { id: 'mcp', label: 'MCP', icon: Boxes, section: 'OMP', description: 'Model Context Protocol servers and dynamic tools.' },
39
+ { id: 'plugins', label: 'Plugins', icon: Plug, section: 'OMP', description: 'Installed omp plugins, marketplaces, features, and plugin settings.' },
40
+ { id: 'skills', label: 'Skills', icon: Library, section: 'OMP', description: 'Manage downloaded skills and scripts.' },
41
+ { id: 'skills-catalog', label: 'Skills Catalog', icon: BookOpen, section: 'OMP', description: 'Browse and install new skills.' },
39
42
  // HARNESSES
40
43
  // HARNESSES — one page per agent, derived from the catalog. `harnessMenuEntries`
41
44
  // returns the overview first, then each non-built-in harness in catalog order.
@@ -49,10 +52,6 @@ export const SETTINGS_CATEGORIES: CategoryDef[] = [
49
52
  ...(entry.harness ? { harness: entry.harness } : {}),
50
53
  description: entry.description,
51
54
  })),
52
- // LIBRARY
53
- { id: 'plugins', label: 'Plugins', icon: Plug, section: 'LIBRARY', description: 'Installed omp plugins, marketplaces, features, and plugin settings.' },
54
- { id: 'skills', label: 'Skills', icon: Library, section: 'LIBRARY', description: 'Manage downloaded skills and scripts.' },
55
- { id: 'skills-catalog', label: 'Skills Catalog', icon: BookOpen, section: 'LIBRARY', description: 'Browse and install new skills.' },
56
55
  ];
57
56
 
58
57
  /**
@@ -60,8 +59,8 @@ export const SETTINGS_CATEGORIES: CategoryDef[] = [
60
59
  *
61
60
  * `SETTINGS_CATEGORIES` is the build's own list; a user-added harness is not in
62
61
  * it, so the HARNESSES section is rebuilt from the ids the catalog answered.
63
- * The rest of the list keeps its order, which is why the harness block is
64
- * spliced back in front of LIBRARY rather than appended.
62
+ * The rest of the list keeps its order; the harness block is appended because
63
+ * HARNESSES is the last group.
65
64
  */
66
65
  export function settingsCategoriesFor(harnessIds?: readonly string[]): CategoryDef[] {
67
66
  // Before the catalog answers, the build's own list is the honest one: an
@@ -75,8 +74,7 @@ export function settingsCategoriesFor(harnessIds?: readonly string[]): CategoryD
75
74
  description: entry.description,
76
75
  }));
77
76
  const rest = SETTINGS_CATEGORIES.filter((category) => category.section !== 'HARNESSES');
78
- const library = rest.findIndex((category) => category.section === 'LIBRARY');
79
- return [...rest.slice(0, library), ...harnessEntries, ...rest.slice(library)];
77
+ return [...rest, ...harnessEntries];
80
78
  }
81
79
 
82
80
  interface SettingsSidebarProps {
@@ -130,9 +130,11 @@ export function HarnessSettings({ only }: HarnessSettingsProps = {}) {
130
130
  <button
131
131
  type="button"
132
132
  onClick={reload}
133
- className="inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-ink/20 px-2.5 py-1.5 text-[11px] text-ink/70 transition-colors hover:border-ink/40 hover:text-ink"
133
+ disabled={isLoading}
134
+ aria-busy={isLoading}
135
+ className="inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-ink/20 px-2.5 py-1.5 text-[11px] text-ink/70 transition-colors hover:border-ink/40 hover:text-ink disabled:opacity-50"
134
136
  >
135
- <RefreshCw size={12} /> Reload catalog
137
+ <RefreshCw size={12} className={isLoading ? 'animate-spin' : undefined} /> Reload catalog
136
138
  </button>
137
139
  </header>
138
140
 
@@ -3,8 +3,8 @@ import { PanelPluginsSection } from '@/client/components/settings/categories/pan
3
3
  /**
4
4
  * The Plugins Kabmo settings category.
5
5
  *
6
- * Its own category rather than a segment of LIBRARY → Plugins, because the two
7
- * are different nouns that only share the word "plugin": LIBRARY holds **omp's**
6
+ * Its own category rather than a segment of OMP → Plugins, because the two are
7
+ * different nouns that only share the word "plugin": OMP holds **omp's**
8
8
  * plugins (installed through `omp plugin`, with features, settings and
9
9
  * enablement), while this holds **Kabmo's** panel plugins — marketplaces
10
10
  * of sandboxed views, which omp has no concept of. Filing them together meant a
@@ -81,7 +81,7 @@ export function PluginSettings() {
81
81
  onInstall={(spec) => {
82
82
  void data.run(`Installing ${spec}`, { type: 'install', spec, ...scopeArgs(workspace) });
83
83
  }}
84
- onRefresh={() => void data.refresh()}
84
+ onRefresh={() => data.refresh()}
85
85
  />
86
86
  }
87
87
  detail={
@@ -66,7 +66,7 @@ export function HarnessConfigForm({ summary, config, onSave }: HarnessConfigForm
66
66
  const models = summary.probe?.models ?? [];
67
67
  const plan = configFieldPlan(summary.id as never, summary.probe ?? undefined, {
68
68
  ...(draft.provider ? { provider: draft.provider } : {}),
69
- ...(summary.install ? { launchCommand: summary.install } : {}),
69
+ ...(summary.command ? { launchCommand: summary.command } : {}),
70
70
  });
71
71
  const providers = providerChoices(models);
72
72
  // The model list narrows to the chosen provider, which is what makes the two
@@ -121,14 +121,11 @@ export function HarnessConfigForm({ summary, config, onSave }: HarnessConfigForm
121
121
  )}
122
122
 
123
123
  <div className="grid gap-3 sm:grid-cols-2">
124
- <Field
125
- label="Launch command"
126
- hint={`Empty uses the built-in line (${summary.install ?? 'this build’s table'}). Quoted paths survive: /Users/me/bin/agy acp`}
127
- >
124
+ <Field label="Launch command" hint={plan.launchHint}>
128
125
  <input
129
126
  type="text"
130
127
  value={draft.command}
131
- placeholder="agy acp"
128
+ placeholder={plan.launchPlaceholder}
132
129
  onInput={(event) => set({ command: event.currentTarget.value })}
133
130
  className={INPUT_CLASS}
134
131
  />
@@ -218,6 +218,42 @@ describe('PluginToolbar', () => {
218
218
  });
219
219
  });
220
220
 
221
+ describe('PluginToolbar registry refresh', () => {
222
+ test('the Refresh glyph spins until the registry read lands', async () => {
223
+ let release: () => void = () => {};
224
+ const pending = new Promise<void>((resolve) => { release = resolve; });
225
+ const el = mount(
226
+ h(PluginToolbar, {
227
+ autoUpdate: false,
228
+ busy: null,
229
+ gitCount: 0,
230
+ updateCount: 0,
231
+ onSetAutoUpdate: async () => true,
232
+ onCheckUpdates: async () => true,
233
+ onUpdateAll: async () => true,
234
+ onRefresh: () => pending,
235
+ }),
236
+ );
237
+ const button = Array.from(el.querySelectorAll('button')).find(
238
+ (candidate) => candidate.textContent?.trim() === 'Refresh',
239
+ )!;
240
+ const iconClass = () => button.querySelector('svg')?.getAttribute('class') ?? '';
241
+ expect(iconClass()).not.toContain('animate-spin');
242
+
243
+ act(() => { button.click(); });
244
+ // The one action here with no `busy` label still says it is working.
245
+ expect(iconClass()).toContain('animate-spin');
246
+ expect(button.hasAttribute('disabled')).toBe(true);
247
+
248
+ await act(async () => {
249
+ release();
250
+ await pending;
251
+ });
252
+ expect(iconClass()).not.toContain('animate-spin');
253
+ expect(button.hasAttribute('disabled')).toBe(false);
254
+ });
255
+ });
256
+
221
257
  describe('SyncBlockedNotice', () => {
222
258
  test('renders nothing when no plugin is blocked', () => {
223
259
  const el = mount(h(SyncBlockedNotice, { blocked: {}, busy: null, onForceSync: async () => true }));
@@ -90,8 +90,6 @@ export function PanelPluginsSection() {
90
90
  const actions = usePanelPluginActions();
91
91
  const dock = useLeftDock();
92
92
 
93
- const refresh = () => void refreshPanelRegistry();
94
-
95
93
  const available = catalog.filter((entry) => !entry.installed);
96
94
  const failureMap = new Map(failures.map((failure) => [failure.pluginId, failure.reason]));
97
95
  // An installed plugin's icon and README, for the card. Both come from the
@@ -123,7 +121,7 @@ export function PanelPluginsSection() {
123
121
  onSetAutoUpdate={actions.setAutoUpdate}
124
122
  onCheckUpdates={actions.checkUpdates}
125
123
  onUpdateAll={actions.updateAll}
126
- onRefresh={refresh}
124
+ onRefresh={refreshPanelRegistry}
127
125
  />
128
126
 
129
127
  {actions.error ? (
@@ -16,6 +16,7 @@
16
16
  * a write. It is the latter, and the sentence says so.
17
17
  */
18
18
 
19
+ import { useState } from 'preact/hooks';
19
20
  import { ArrowDownToLine, CheckSquare, Loader2, RefreshCw, Square } from 'lucide-preact';
20
21
 
21
22
  interface PluginToolbarProps {
@@ -28,7 +29,8 @@ interface PluginToolbarProps {
28
29
  onSetAutoUpdate: (enabled: boolean) => Promise<boolean>;
29
30
  onCheckUpdates: () => Promise<boolean>;
30
31
  onUpdateAll: () => Promise<boolean>;
31
- onRefresh: () => void;
32
+ /** Re-read the registry; the promise is what spins the button. */
33
+ onRefresh: () => void | Promise<void>;
32
34
  }
33
35
 
34
36
  export function PluginToolbar({
@@ -43,6 +45,17 @@ export function PluginToolbar({
43
45
  }: PluginToolbarProps) {
44
46
  const checking = busy === 'check_updates';
45
47
  const updatingAll = busy === 'update_all';
48
+ // The registry re-read is the one action here that has no entry in `busy`
49
+ // (it is not a mutation), so its own in-flight flag lives here.
50
+ const [refreshing, setRefreshing] = useState(false);
51
+ const reloadRegistry = async () => {
52
+ setRefreshing(true);
53
+ try {
54
+ await onRefresh();
55
+ } finally {
56
+ setRefreshing(false);
57
+ }
58
+ };
46
59
  return (
47
60
  <div className="flex flex-wrap items-center gap-2">
48
61
  <button
@@ -98,12 +111,13 @@ export function PluginToolbar({
98
111
 
99
112
  <button
100
113
  type="button"
101
- onClick={onRefresh}
102
- disabled={busy !== null}
114
+ onClick={() => void reloadRegistry()}
115
+ disabled={busy !== null || refreshing}
116
+ aria-busy={refreshing}
103
117
  className="flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded border border-ink/15 hover:bg-ink/5 disabled:opacity-50"
104
118
  title="Re-read the marketplace from disk"
105
119
  >
106
- <RefreshCw size={13} />
120
+ <RefreshCw size={13} className={refreshing ? 'animate-spin' : undefined} />
107
121
  Refresh
108
122
  </button>
109
123
 
@@ -116,75 +116,78 @@ export function PluginMarketplacePane({
116
116
  </p>
117
117
  ) : (
118
118
  <div className="rounded-lg border border-ink/10 divide-y divide-ink/5">
119
- {marketplaces.map((marketplace) => (
120
- <div key={marketplace.name} className="flex items-center gap-3 px-3 py-2.5">
121
- <div className="min-w-0 flex-1">
122
- <div className="flex items-center gap-1.5">
123
- <span className="text-xs font-medium text-ink truncate">{marketplace.name}</span>
124
- <span className="text-[10px] font-mono uppercase text-ink/45">{marketplace.sourceType}</span>
119
+ {marketplaces.map((marketplace) => {
120
+ const updating = busy === `Updating ${marketplace.name}`;
121
+ return (
122
+ <div key={marketplace.name} className="flex items-center gap-3 px-3 py-2.5">
123
+ <div className="min-w-0 flex-1">
124
+ <div className="flex items-center gap-1.5">
125
+ <span className="text-xs font-medium text-ink truncate">{marketplace.name}</span>
126
+ <span className="text-[10px] font-mono uppercase text-ink/45">{marketplace.sourceType}</span>
127
+ </div>
128
+ <p className="text-[11px] font-mono text-ink/50 truncate">{marketplace.sourceUri}</p>
129
+ <p className="text-[10px] text-ink/45">
130
+ {marketplace.error ? (
131
+ <span className="text-error">{marketplace.error}</span>
132
+ ) : (
133
+ `${marketplace.pluginCount ?? 0} plugins · updated ${formatDate(marketplace.updatedAt)}`
134
+ )}
135
+ </p>
125
136
  </div>
126
- <p className="text-[11px] font-mono text-ink/50 truncate">{marketplace.sourceUri}</p>
127
- <p className="text-[10px] text-ink/45">
128
- {marketplace.error ? (
129
- <span className="text-error">{marketplace.error}</span>
137
+ <div className="flex items-center gap-1.5 flex-shrink-0">
138
+ <button
139
+ type="button"
140
+ disabled={isBusy}
141
+ onClick={() =>
142
+ void run(`Updating ${marketplace.name}`, {
143
+ type: 'update_marketplace',
144
+ name: marketplace.name,
145
+ })
146
+ }
147
+ title="Re-fetch this catalog"
148
+ className="p-1.5 rounded-lg border border-ink/20 text-ink/60 hover:text-ink hover:border-ink/40 transition-colors cursor-pointer disabled:opacity-40"
149
+ >
150
+ <RefreshCw size={13} className={updating ? 'animate-spin' : undefined} aria-hidden="true" />
151
+ </button>
152
+ {confirmingRemove === marketplace.name ? (
153
+ <>
154
+ <button
155
+ type="button"
156
+ disabled={isBusy}
157
+ onClick={() => {
158
+ void run(`Removing ${marketplace.name}`, {
159
+ type: 'remove_marketplace',
160
+ name: marketplace.name,
161
+ });
162
+ setConfirmingRemove(null);
163
+ }}
164
+ className="px-2 py-1 rounded-lg border border-error text-error text-[11px] font-medium hover:bg-error/5 transition-colors cursor-pointer disabled:opacity-40"
165
+ >
166
+ Confirm
167
+ </button>
168
+ <button
169
+ type="button"
170
+ onClick={() => setConfirmingRemove(null)}
171
+ className="px-1.5 py-1 rounded-lg text-[11px] text-ink/60 hover:text-ink cursor-pointer"
172
+ >
173
+ Cancel
174
+ </button>
175
+ </>
130
176
  ) : (
131
- `${marketplace.pluginCount ?? 0} plugins · updated ${formatDate(marketplace.updatedAt)}`
132
- )}
133
- </p>
134
- </div>
135
- <div className="flex items-center gap-1.5 flex-shrink-0">
136
- <button
137
- type="button"
138
- disabled={isBusy}
139
- onClick={() =>
140
- void run(`Updating ${marketplace.name}`, {
141
- type: 'update_marketplace',
142
- name: marketplace.name,
143
- })
144
- }
145
- title="Re-fetch this catalog"
146
- className="p-1.5 rounded-lg border border-ink/20 text-ink/60 hover:text-ink hover:border-ink/40 transition-colors cursor-pointer disabled:opacity-40"
147
- >
148
- <RefreshCw size={13} />
149
- </button>
150
- {confirmingRemove === marketplace.name ? (
151
- <>
152
177
  <button
153
178
  type="button"
154
179
  disabled={isBusy}
155
- onClick={() => {
156
- void run(`Removing ${marketplace.name}`, {
157
- type: 'remove_marketplace',
158
- name: marketplace.name,
159
- });
160
- setConfirmingRemove(null);
161
- }}
162
- className="px-2 py-1 rounded-lg border border-error text-error text-[11px] font-medium hover:bg-error/5 transition-colors cursor-pointer disabled:opacity-40"
180
+ onClick={() => setConfirmingRemove(marketplace.name)}
181
+ title="Remove this marketplace (installed plugins stay)"
182
+ className="p-1.5 rounded-lg border border-ink/20 text-ink/60 hover:border-error hover:text-error transition-colors cursor-pointer disabled:opacity-40"
163
183
  >
164
- Confirm
184
+ <Trash2 size={13} />
165
185
  </button>
166
- <button
167
- type="button"
168
- onClick={() => setConfirmingRemove(null)}
169
- className="px-1.5 py-1 rounded-lg text-[11px] text-ink/60 hover:text-ink cursor-pointer"
170
- >
171
- Cancel
172
- </button>
173
- </>
174
- ) : (
175
- <button
176
- type="button"
177
- disabled={isBusy}
178
- onClick={() => setConfirmingRemove(marketplace.name)}
179
- title="Remove this marketplace (installed plugins stay)"
180
- className="p-1.5 rounded-lg border border-ink/20 text-ink/60 hover:border-error hover:text-error transition-colors cursor-pointer disabled:opacity-40"
181
- >
182
- <Trash2 size={13} />
183
- </button>
184
- )}
186
+ )}
187
+ </div>
185
188
  </div>
186
- </div>
187
- ))}
189
+ );
190
+ })}
188
191
  </div>
189
192
  )}
190
193
  </section>
@@ -22,7 +22,8 @@ interface PluginSidebarListProps {
22
22
  error: string | null;
23
23
  onClearError: () => void;
24
24
  onInstall: (spec: string) => void;
25
- onRefresh: () => void;
25
+ /** Re-read omp's registries; the promise is what spins the glyph. */
26
+ onRefresh: () => void | Promise<void>;
26
27
  }
27
28
 
28
29
  /**
@@ -53,6 +54,7 @@ export function PluginSidebarList({
53
54
  onRefresh,
54
55
  }: PluginSidebarListProps) {
55
56
  const [spec, setSpec] = useState('');
57
+ const [refreshing, setRefreshing] = useState(false);
56
58
  const installedCount = plugins.filter((plugin) => plugin.enabled).length;
57
59
 
58
60
  return (
@@ -97,11 +99,20 @@ export function PluginSidebarList({
97
99
  </span>
98
100
  <button
99
101
  type="button"
100
- onClick={onRefresh}
102
+ disabled={refreshing}
103
+ aria-busy={refreshing}
104
+ onClick={async () => {
105
+ setRefreshing(true);
106
+ try {
107
+ await onRefresh();
108
+ } finally {
109
+ setRefreshing(false);
110
+ }
111
+ }}
101
112
  title="Re-read omp's plugin registries"
102
- className="p-1 rounded-md text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer"
113
+ className="p-1 rounded-md text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer disabled:opacity-50"
103
114
  >
104
- <RefreshCw size={14} className={busy ? 'animate-spin' : undefined} />
115
+ <RefreshCw size={14} className={busy || refreshing ? 'animate-spin' : undefined} />
105
116
  </button>
106
117
  </div>
107
118
 
@@ -57,9 +57,9 @@ describe('settings groups', () => {
57
57
  test('Harnesses is its own group, not a member of OMP', () => {
58
58
  const harnesses = SETTINGS_CATEGORIES.find((category) => category.id === 'harness-index');
59
59
  expect(harnesses?.section).toBe('HARNESSES');
60
- // And the group sits after OMP, before LIBRARY: the order the sidebar reads.
60
+ // And the group is the last one the sidebar draws.
61
61
  expect(SETTINGS_SECTIONS.indexOf('HARNESSES')).toBeGreaterThan(SETTINGS_SECTIONS.indexOf('OMP'));
62
- expect(SETTINGS_SECTIONS.indexOf('HARNESSES')).toBeLessThan(SETTINGS_SECTIONS.indexOf('LIBRARY'));
62
+ expect(SETTINGS_SECTIONS.at(-1)).toBe('HARNESSES');
63
63
  });
64
64
 
65
65
  test('the drawer renders one heading per non-empty group, in order', () => {
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The card a peer agent's message renders as.
8
+ *
9
+ * omp 18.18.9 stopped returning received messages inside a `wait` result and
10
+ * injects each one as an `irc:incoming` turn; the turn's content is the model's
11
+ * `<irc>` prompt envelope. This card must show the sender and the body from
12
+ * `details`, never that envelope — a regression here puts prompt scaffolding and
13
+ * the reply instructions into the transcript.
14
+ *
15
+ * Mounted with `h()` against happy-dom, following `block-chrome.test.tsx`.
16
+ */
17
+
18
+ import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
19
+ import { Window } from 'happy-dom';
20
+ import { h, render } from 'preact';
21
+ import { act } from 'preact/test-utils';
22
+ import { IrcNotice } from '@/client/components/workspace/chat-timeline/IrcNotice';
23
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
24
+
25
+ beforeAll(() => installDomGlobals(new Window({ url: 'http://localhost' })));
26
+ afterAll(() => restoreDomGlobals());
27
+
28
+ async function paint(irc: Parameters<typeof IrcNotice>[0]['irc']): Promise<HTMLElement> {
29
+ const container = document.createElement('div');
30
+ document.body.appendChild(container);
31
+ await act(async () => {
32
+ render(h(IrcNotice, { irc }), container);
33
+ });
34
+ return container;
35
+ }
36
+
37
+ describe('IrcNotice', () => {
38
+ test('names the sender and shows the raw body', async () => {
39
+ const el = await paint({ from: 'Sleeper', message: 'sleeper reporting in' });
40
+ const text = el.textContent ?? '';
41
+ expect(text).toContain('Message from Sleeper');
42
+ expect(text).toContain('sleeper reporting in');
43
+ expect(text).not.toContain('<irc>');
44
+ expect(text).not.toContain('reply via');
45
+ el.remove();
46
+ });
47
+
48
+ test('names a reply target and a progress message', async () => {
49
+ const el = await paint({ from: 'Scout', message: 'map is ready', replyTo: 'main', progress: true });
50
+ const text = el.textContent ?? '';
51
+ expect(text).toContain('reply to main');
52
+ expect(text).toContain('progress');
53
+ el.remove();
54
+ });
55
+ });
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * A peer (IRC) message that ended or interrupted a turn.
8
+ *
9
+ * omp 18.18.9 injects such a message as its own `irc:incoming` turn instead of
10
+ * returning it inside the `wait` result, so this card replaces the message
11
+ * block the wait panel used to draw. `SystemNotice` would print the model's
12
+ * `<irc>` prompt envelope verbatim (tag, reply instructions and all); the
13
+ * mapper lifts the sender and body out of `details` first, and this card draws
14
+ * them the way omp's own TUI does.
15
+ */
16
+
17
+ import { MessageSquare } from 'lucide-preact';
18
+ import type { IrcMessageData } from '@/shared/types/omp/session';
19
+ import { transcriptGutter } from '@/shared/lib/chat/timeline/gutter';
20
+ import { blockChrome } from '@/shared/lib/chat/timeline/block-chrome';
21
+ import { useToolRenderMode } from '@/client/hooks/chat/timeline/tool-render-mode';
22
+
23
+ interface IrcNoticeProps {
24
+ irc: IrcMessageData;
25
+ /** Phone layout: the card's frame is the timeline gutter itself. */
26
+ isMobile?: boolean;
27
+ }
28
+
29
+ export function IrcNotice({ irc, isMobile = false }: IrcNoticeProps) {
30
+ const mode = useToolRenderMode();
31
+ const chrome = blockChrome(mode);
32
+ return (
33
+ <div className={`${transcriptGutter(isMobile)} text-[12px] text-ink select-text ${chrome.root}`}>
34
+ {/* The rail is drawn once per TURN by `TurnRail`; this block only places
35
+ its node. */}
36
+ {mode === 'trace' && <span aria-hidden="true" className={chrome.node} />}
37
+ <div className={chrome.frame || undefined}>
38
+ <div className={chrome.header}>
39
+ <span className={`${chrome.icon} bg-info/10 text-info`}>
40
+ <MessageSquare size={13} />
41
+ </span>
42
+ <span className="flex min-w-0 flex-1 flex-wrap items-center gap-2">
43
+ <span className={chrome.title}>Message from {irc.from}</span>
44
+ {irc.replyTo && (
45
+ <span className="rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[10px] text-ink/60">
46
+ reply to {irc.replyTo}
47
+ </span>
48
+ )}
49
+ {irc.progress && (
50
+ <span className="rounded bg-info/10 px-1.5 py-0.2 font-mono text-[10px] text-info">
51
+ progress
52
+ </span>
53
+ )}
54
+ {irc.broadcast && (
55
+ <span className="rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[10px] text-ink/60">
56
+ broadcast
57
+ </span>
58
+ )}
59
+ </span>
60
+ </div>
61
+ <div className={chrome.body}>
62
+ {/* Plain pre-wrap: a peer message is prose and often pasted command
63
+ lines, and the old wait block rendered it without markdown. */}
64
+ <div className="whitespace-pre-wrap break-words text-[12px] leading-relaxed text-ink/85">
65
+ {irc.message}
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ );
71
+ }
@@ -8,6 +8,7 @@ import { toAttachmentList } from '@/shared/lib/chat/attachments';
8
8
  import { ThinkingSection } from '@/client/components/workspace/chat-timeline/ThinkingSection';
9
9
  import { ToolCallingSection } from '@/client/components/workspace/chat-timeline/ToolCallingSection';
10
10
  import { SystemNotice } from '@/client/components/workspace/chat-timeline/SystemNotice';
11
+ import { IrcNotice } from '@/client/components/workspace/chat-timeline/IrcNotice';
11
12
  import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
12
13
  import { AttachmentChips } from '@/client/components/workspace/chat-timeline/AttachmentChips';
13
14
  import { CopyButton } from '@/client/components/common/CopyButton';
@@ -229,7 +230,9 @@ export const ChatMessageItem = memo(function ChatMessageItem({
229
230
  <div className="w-full space-y-2.5 font-sans leading-relaxed">
230
231
 
231
232
  {/* System Notice Alert (a notice carrying the answer renders as content below) */}
232
- {isNotice && <SystemNotice notice={msg.notice} source={msg.noticeSource} isMobile={isMobile} />}
233
+ {isNotice && (msg.irc
234
+ ? <IrcNotice irc={msg.irc} isMobile={isMobile} />
235
+ : <SystemNotice notice={msg.notice} source={msg.noticeSource} isMobile={isMobile} />)}
233
236
 
234
237
  {/* Thinking / Reasoning Accordion */}
235
238
  {thinkingData && (