@kabmo-labs/kabmo 0.27.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.
- package/bunfig.toml +6 -0
- package/dist/client/index.html +2 -2
- package/dist/client/index.js +530 -493
- package/dist/client/static/js/{index-e3qh2yps.js → index-43z47ngg.js} +1178 -1034
- package/dist/client/static/js/index-naa91727.css +1 -0
- package/dist/client/static/{manifest-q6h8k9e0.webmanifest → manifest-vdvdqpre.webmanifest} +1 -0
- package/marketplace/plugins/command-runner/package.json +3 -17
- package/marketplace/plugins/command-runner/settings-schema.json +14 -0
- package/marketplace/plugins/git-forge/README.md +17 -7
- package/marketplace/plugins/git-forge/package.json +4 -30
- package/marketplace/plugins/git-forge/panel.css +16 -0
- package/marketplace/plugins/git-forge/settings-schema.json +27 -0
- package/marketplace/plugins/git-forge/src/panel/Badge.tsx +35 -22
- package/marketplace/plugins/git-forge/src/panel/Change.tsx +20 -24
- package/marketplace/plugins/git-forge/src/panel/CiBadge.tsx +16 -7
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +31 -26
- package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +18 -2
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +160 -96
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +60 -44
- package/marketplace/plugins/git-forge/src/panel/List.tsx +150 -22
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +11 -5
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +17 -15
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +84 -61
- package/marketplace/plugins/git-forge/src/panel/format.test.ts +99 -0
- package/marketplace/plugins/git-forge/src/panel/format.ts +59 -16
- package/marketplace/plugins/git-forge/src/panel/index.test.tsx +109 -5
- package/marketplace/plugins/git-forge/src/panel/index.tsx +37 -4
- package/marketplace/plugins/git-forge/src/panel/use-forge.ts +17 -0
- package/marketplace/plugins/git-forge/src/panel/write.test.tsx +31 -0
- package/marketplace/plugins/session-info/package.json +2 -10
- package/marketplace/plugins/session-info/settings-schema.json +8 -0
- package/marketplace/plugins/stats/README.md +17 -5
- package/marketplace/plugins/stats/package.json +3 -23
- package/marketplace/plugins/stats/settings-schema.json +20 -0
- package/marketplace/plugins/stats/src/app.tsx +1 -1
- package/marketplace/plugins/stats/src/groups.test.ts +46 -1
- package/marketplace/plugins/stats/src/groups.ts +22 -11
- package/marketplace/plugins/stats/src/harness-leases.test.ts +84 -0
- package/marketplace/plugins/stats/src/harness-leases.ts +132 -0
- package/marketplace/plugins/stats/src/labels.test.ts +54 -1
- package/marketplace/plugins/stats/src/labels.ts +33 -7
- package/marketplace/plugins/stats/src/sampler.test.ts +61 -0
- package/marketplace/plugins/stats/src/sampler.ts +39 -5
- package/marketplace/plugins/stats/src/snapshot.ts +6 -0
- package/package.json +4 -3
- package/public/manifest.webmanifest +1 -0
- package/src/client/components/common/ComposerTextarea.test.tsx +109 -0
- package/src/client/components/common/ComposerTextarea.tsx +6 -0
- package/src/client/components/common/ReloadPageButton.test.tsx +14 -0
- package/src/client/components/common/ReloadPageButton.tsx +11 -2
- package/src/client/components/common/diagram-viewer/read-block.test.ts +71 -0
- package/src/client/components/common/diagram-viewer/read-block.ts +40 -16
- package/src/client/components/common/file-icon/index.tsx +7 -1
- package/src/client/components/common/harness-glyph/brands.ts +7 -1
- package/src/client/components/common/harness-glyph/index.tsx +18 -1
- package/src/client/components/common/image-viewer/index.tsx +37 -165
- package/src/client/components/common/picker-search/index.tsx +70 -0
- package/src/client/components/common/search-select/index.tsx +2 -7
- package/src/client/components/common/session-actions-menu/index.test.tsx +106 -0
- package/src/client/components/common/session-actions-menu/index.tsx +43 -1
- package/src/client/components/common/session-row/TrailingSlot.tsx +9 -4
- package/src/client/components/common/session-row/index.tsx +4 -0
- package/src/client/components/common/session-row/session-row.test.tsx +6 -0
- package/src/client/components/common/zoom-pan-stage/index.tsx +258 -0
- package/src/client/components/common/zoom-pan-stage/zoom-pan-stage.test.tsx +87 -0
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +2 -1
- package/src/client/components/layout/session-sidebar/ClassicView.tsx +1 -1
- package/src/client/components/layout/session-sidebar/SessionItem.tsx +9 -1
- package/src/client/components/layout/session-sidebar/SessionListNotice.tsx +7 -3
- package/src/client/components/layout/session-sidebar/about-modal/HarnessRow.tsx +4 -1
- package/src/client/components/layout/session-sidebar/about-modal/HarnessTable.tsx +12 -1
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.test.tsx +82 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogLine.tsx +23 -3
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +1 -0
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +2 -1
- package/src/client/components/layout/session-sidebar/modern/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +202 -0
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +80 -19
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +29 -7
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +3 -0
- package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +8 -0
- package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +181 -0
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +41 -86
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +2 -1
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.test.ts +6 -0
- package/src/client/components/mobile/mobile-session-sidebar/SessionRow.tsx +9 -1
- package/src/client/components/settings/Modal.tsx +6 -2
- package/src/client/components/settings/Sidebar.tsx +32 -7
- package/src/client/components/settings/categories/HarnessSettings.tsx +15 -9
- package/src/client/components/settings/categories/NotificationSettings.test.tsx +40 -15
- package/src/client/components/settings/categories/NotificationSettings.tsx +142 -64
- package/src/client/components/settings/categories/PanelPluginSettings.tsx +3 -3
- package/src/client/components/settings/categories/PluginSettings.tsx +1 -1
- package/src/client/components/settings/categories/harness-settings/ConfigForm.tsx +3 -6
- package/src/client/components/settings/categories/harness-settings/CustomHarnessForm.tsx +186 -0
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.test.tsx +36 -0
- package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +11 -0
- package/src/client/components/settings/categories/panel-plugins/PluginCard.test.tsx +1 -0
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +15 -1
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +1 -3
- package/src/client/components/settings/categories/panel-plugins/SettingsModal.test.tsx +165 -0
- package/src/client/components/settings/categories/panel-plugins/SettingsModal.tsx +260 -0
- package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +18 -4
- package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +64 -61
- package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +15 -4
- package/src/client/components/settings/groups.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.fork.test.ts +24 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +8 -4
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +34 -0
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +3 -2
- package/src/client/components/workspace/chat-timeline/IrcNotice.test.tsx +55 -0
- package/src/client/components/workspace/chat-timeline/IrcNotice.tsx +71 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.fork.test.ts +80 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +13 -4
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/RunFooter.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +8 -0
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +4 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +19 -0
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +32 -3
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.search.test.tsx +72 -0
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +53 -33
- package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/chat-input/props.ts +5 -5
- package/src/client/components/workspace/chat-timeline/index.tsx +11 -5
- package/src/client/components/workspace/chat-timeline/target-picker/DraftTargetRow.tsx +1 -9
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +129 -0
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +30 -12
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +47 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +55 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +3 -2
- package/src/client/components/workspace/editor/FilePane.tsx +41 -4
- package/src/client/components/workspace/editor/Notices.tsx +2 -2
- package/src/client/components/workspace/editor/Pane.tsx +2 -2
- package/src/client/components/workspace/editor/Toolbar.tsx +20 -10
- package/src/client/components/workspace/editor/index.tsx +6 -10
- package/src/client/components/workspace/editor/toolbar-clusters.test.ts +5 -3
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +26 -14
- package/src/client/components/workspace/editor/viewers/CsvGrid.tsx +52 -5
- package/src/client/components/workspace/editor/viewers/DataGrid.tsx +227 -41
- package/src/client/components/workspace/editor/viewers/DrawioView.tsx +93 -0
- package/src/client/components/workspace/editor/viewers/GridRow.tsx +91 -0
- package/src/client/components/workspace/editor/viewers/GridToolbar.tsx +53 -0
- package/src/client/components/workspace/editor/viewers/SheetView.tsx +152 -57
- package/src/client/components/workspace/editor/viewers/dispatch.tsx +42 -9
- package/src/client/components/workspace/editor/viewers/drawio-pages.test.ts +80 -0
- package/src/client/components/workspace/editor/viewers/drawio-pages.ts +63 -0
- package/src/client/components/workspace/editor/viewers/grid.test.ts +296 -0
- package/src/client/components/workspace/editor/viewers/use-cell-edit.ts +64 -0
- package/src/client/components/workspace/editor/viewers/use-grid-interaction.ts +216 -0
- package/src/client/components/workspace/editor/viewers/viewers.test.ts +47 -2
- package/src/client/components/workspace/editor/viewers/workbook.ts +149 -0
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +262 -0
- package/src/client/components/workspace/file-explorer/ContextMenu.tsx +30 -6
- package/src/client/components/workspace/file-explorer/Modals.tsx +8 -3
- package/src/client/components/workspace/file-explorer/RootOverlays.tsx +60 -0
- package/src/client/components/workspace/file-explorer/RowLabel.tsx +6 -2
- package/src/client/components/workspace/file-explorer/TreeItem.tsx +39 -49
- package/src/client/components/workspace/file-explorer/TreeItemModals.tsx +80 -0
- package/src/client/components/workspace/file-explorer/index.tsx +53 -29
- package/src/client/components/workspace/file-explorer/selection.test.tsx +109 -0
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +9 -1
- package/src/client/components/workspace/terminal-panel/focus.test.ts +70 -0
- package/src/client/components/workspace/terminal-panel/focus.ts +46 -0
- package/src/client/components/workspace/terminal-panel/index.tsx +14 -1
- package/src/client/components/workspace/terminal-panel/mount.ts +17 -9
- package/src/client/components/workspace/terminal-panel/scroll-hold.test.ts +158 -0
- package/src/client/components/workspace/terminal-panel/scroll-hold.ts +136 -0
- package/src/client/data/settings/omp-schema.json +169 -22
- package/src/client/glass.css +39 -14
- package/src/client/glass.test.ts +37 -0
- package/src/client/hooks/chat/composer/history.test.ts +267 -0
- package/src/client/hooks/chat/composer/history.ts +146 -0
- package/src/client/hooks/chat/composer/use-draft.ts +45 -1
- package/src/client/hooks/chat/omp/pending-sessions.waiting.test.ts +11 -10
- package/src/client/hooks/chat/omp/pending-waiting.ts +15 -7
- package/src/client/hooks/chat/omp/prompt-send.test.ts +11 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +3 -0
- package/src/client/hooks/chat/timeline/actions.ts +4 -4
- package/src/client/hooks/chat/timeline/ask-frames.test.ts +54 -0
- package/src/client/hooks/chat/timeline/ask-frames.ts +29 -1
- package/src/client/hooks/chat/timeline/composer-modes.ts +13 -2
- package/src/client/hooks/chat/timeline/fork-open.ts +52 -0
- package/src/client/hooks/chat/timeline/index.ts +5 -2
- package/src/client/hooks/chat/timeline/mode-availability.ts +7 -0
- package/src/client/hooks/chat/timeline/modes-contract.ts +6 -0
- package/src/client/hooks/chat/timeline/modes-hydrate.ts +93 -0
- package/src/client/hooks/chat/timeline/modes.ts +32 -52
- package/src/client/hooks/chat/timeline/new-chat-open.ts +7 -6
- package/src/client/hooks/chat/timeline/new-chat.ts +10 -1
- package/src/client/hooks/chat/timeline/pending-dispatch.ts +4 -0
- package/src/client/hooks/chat/timeline/pending-session-mode.test.ts +136 -0
- package/src/client/hooks/chat/timeline/pending-session-mode.ts +69 -0
- package/src/client/hooks/chat/timeline/pending-warmup.test.ts +147 -0
- package/src/client/hooks/chat/timeline/pending-warmup.ts +62 -0
- package/src/client/hooks/chat/timeline/run-identity.test.ts +12 -0
- package/src/client/hooks/chat/timeline/run-identity.ts +4 -1
- package/src/client/hooks/chat/timeline/send-props.ts +2 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +1 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +1 -0
- package/src/client/hooks/chat/timeline/send.test.ts +1 -0
- package/src/client/hooks/chat/timeline/session-harness.ts +4 -0
- package/src/client/hooks/chat/timeline/timeline-rail.test.ts +34 -2
- package/src/client/hooks/chat/timeline/use-fork-session.ts +9 -22
- package/src/client/hooks/chat/timeline/user-turns.ts +31 -2
- package/src/client/hooks/chat/waiting/cancel.ts +13 -6
- package/src/client/hooks/chat/waiting/choice.ts +13 -16
- package/src/client/hooks/chat/waiting/composer-wait.ts +70 -0
- package/src/client/hooks/chat/waiting/dispatch.ts +48 -28
- package/src/client/hooks/chat/waiting/held.ts +37 -13
- package/src/client/hooks/chat/waiting/hold.test.ts +22 -0
- package/src/client/hooks/chat/waiting/hold.ts +20 -11
- package/src/client/hooks/chat/waiting/restore.test.ts +69 -0
- package/src/client/hooks/chat/waiting/restore.ts +34 -0
- package/src/client/hooks/chat/waiting/store.ts +9 -3
- package/src/client/hooks/editor/file-editor-types.ts +36 -12
- package/src/client/hooks/editor/save-bytes.ts +79 -0
- package/src/client/hooks/editor/save-file.test.ts +1 -1
- package/src/client/hooks/editor/save-file.ts +35 -8
- package/src/client/hooks/editor/target-key.ts +17 -0
- package/src/client/hooks/editor/use-disk-digest.test.ts +82 -0
- package/src/client/hooks/editor/use-disk-digest.ts +164 -0
- package/src/client/hooks/editor/use-disk-sync.ts +212 -0
- package/src/client/hooks/editor/use-file-cache.ts +113 -0
- package/src/client/hooks/editor/use-file-editor.test.ts +120 -0
- package/src/client/hooks/editor/use-file-editor.ts +143 -57
- package/src/client/hooks/editor/use-file-read.ts +45 -12
- package/src/client/hooks/editor/use-file-writes.ts +4 -4
- package/src/client/hooks/editor/use-grid-selection.ts +160 -0
- package/src/client/hooks/models/harness-catalog.ts +15 -0
- package/src/client/hooks/models/use-harness-update.test.ts +35 -2
- package/src/client/hooks/models/use-harness-update.ts +49 -10
- package/src/client/hooks/ui/notifications.ts +17 -8
- package/src/client/hooks/workspace/diff-file.test.ts +72 -0
- package/src/client/hooks/workspace/diff-file.ts +12 -6
- package/src/client/hooks/workspace/file-archive.ts +220 -0
- package/src/client/hooks/workspace/file-clipboard.test.ts +4 -4
- package/src/client/hooks/workspace/file-clipboard.ts +37 -26
- package/src/client/hooks/workspace/file-selection.test.ts +67 -0
- package/src/client/hooks/workspace/file-selection.ts +156 -0
- package/src/client/hooks/workspace/file-tree-actions-clipboard.test.ts +5 -5
- package/src/client/hooks/workspace/file-tree-actions.ts +36 -8
- package/src/client/hooks/workspace/panel-registry.ts +1 -1
- package/src/client/hooks/workspace/scheduled-tasks.ts +26 -11
- package/src/client/lib/editor/workbook-drafts.ts +42 -0
- package/src/client/lib/launch/file-handlers.ts +2 -2
- package/src/client/lib/notifications/os.test.ts +1 -30
- package/src/client/lib/notifications/os.ts +0 -15
- package/src/client/lib/notifications/platform.test.ts +68 -0
- package/src/client/lib/notifications/platform.ts +36 -0
- package/src/client/lib/scrollbar-activity.test.ts +21 -88
- package/src/client/lib/scrollbar-activity.ts +71 -73
- package/src/client/lib/scrollbar-events.ts +143 -0
- package/src/client/lib/scrollbar-input.test.ts +126 -0
- package/src/client/lib/scrollbar-probe.test-util.ts +107 -0
- package/src/client/tailwind.css +32 -1
- package/src/server/db.server.test.ts +50 -1
- package/src/server/db.server.ts +36 -3
- package/src/server/index.ts +7 -0
- package/src/server/lib/chat/prompt-history.server.test.ts +92 -0
- package/src/server/lib/chat/prompt-history.server.ts +65 -0
- package/src/server/lib/chat/schema.server.ts +35 -0
- package/src/server/lib/db/schema.ts +3 -0
- package/src/server/lib/fs/archive.test.ts +139 -0
- package/src/server/lib/fs/archive.ts +259 -0
- package/src/server/lib/fs/git-diff.test.ts +26 -1
- package/src/server/lib/fs/git-diff.ts +43 -15
- package/src/server/lib/harness/acp/client.ts +81 -87
- package/src/server/lib/harness/acp/prewarm.server.ts +237 -0
- package/src/server/lib/harness/acp/prewarm.test.ts +171 -0
- package/src/server/lib/harness/acp/prompt.test.ts +70 -1
- package/src/server/lib/harness/acp/prompt.ts +32 -1
- package/src/server/lib/harness/acp/protocol.ts +23 -0
- package/src/server/lib/harness/acp/session-handshake.test.ts +26 -0
- package/src/server/lib/harness/acp/session-handshake.ts +22 -20
- package/src/server/lib/harness/acp/session-options.ts +16 -0
- package/src/server/lib/harness/acp/session-process.ts +43 -0
- package/src/server/lib/harness/acp/session.ts +11 -12
- package/src/server/lib/harness/acp/stdio.ts +129 -0
- package/src/server/lib/harness/acp/verbs.test.ts +97 -0
- package/src/server/lib/harness/acp/verbs.ts +16 -6
- package/src/server/lib/harness/auto-probe.server.ts +4 -3
- package/src/server/lib/harness/capabilities.ts +8 -0
- package/src/server/lib/harness/config.server.ts +3 -2
- package/src/server/lib/harness/custom.server.ts +209 -0
- package/src/server/lib/harness/launch-table.ts +19 -0
- package/src/server/lib/harness/launch.ts +6 -1
- package/src/server/lib/harness/provider-entry.ts +1 -1
- package/src/server/lib/harness/provider-file.server.ts +1 -1
- package/src/server/lib/harness/provider-sources.server.ts +2 -1
- package/src/server/lib/harness/provider-write.server.ts +2 -1
- package/src/server/lib/harness/register.server.ts +8 -1
- package/src/server/lib/harness/schema.server.ts +21 -0
- package/src/server/lib/harness/session-lease.server.test.ts +99 -0
- package/src/server/lib/harness/session-lease.server.ts +193 -0
- package/src/server/lib/harness/session-store.server.test.ts +8 -8
- package/src/server/lib/harness/session-store.server.ts +25 -4
- package/src/server/lib/harness/session-title.server.ts +12 -2
- package/src/server/lib/harness/spawn.server.ts +123 -20
- package/src/server/lib/harness/update-job-store.ts +12 -0
- package/src/server/lib/harness/update-queue.server.ts +18 -13
- package/src/server/lib/lifecycle/after-listen.ts +12 -1
- package/src/server/lib/lifecycle/paths.ts +19 -1
- package/src/server/lib/mcp/registry.server.ts +155 -0
- package/src/server/lib/mcp/registry.test.ts +169 -0
- package/src/server/lib/mcp/store.server.ts +38 -0
- package/src/server/lib/omp/rpc/frame-fold-contract.ts +59 -0
- package/src/server/lib/omp/rpc/frame-fold-frames.test.ts +64 -1
- package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +2 -1
- package/src/server/lib/omp/rpc/frame-fold-signals.test.ts +5 -1
- package/src/server/lib/omp/rpc/frame-fold.test.ts +7 -2
- package/src/server/lib/omp/rpc/frame-fold.ts +6 -45
- package/src/server/lib/omp/rpc/lifecycle.test.ts +4 -0
- package/src/server/lib/omp/rpc/prewarm-pool.ts +19 -5
- package/src/server/lib/omp/rpc/run-model.test.ts +116 -0
- package/src/server/lib/omp/rpc/run-model.ts +4 -2
- package/src/server/lib/omp/session/auto-title.server.test.ts +4 -0
- package/src/server/lib/omp/session/delete.server.ts +1 -0
- package/src/server/lib/omp/session/goal-driver.test.ts +5 -1
- package/src/server/lib/omp/session/goal-settings.test.ts +5 -1
- package/src/server/lib/omp/session/sidebar-data.harness.test.ts +6 -3
- package/src/server/lib/omp/session/standby.server.ts +13 -2
- package/src/server/lib/panels/auto-update.server.test.ts +5 -2
- package/src/server/lib/panels/git-update.server.test.ts +5 -2
- package/src/server/lib/panels/install.server.test.ts +5 -2
- package/src/server/lib/panels/manifest.test.ts +47 -1
- package/src/server/lib/panels/manifest.ts +19 -0
- package/src/server/lib/panels/registry.server.ts +19 -2
- package/src/server/lib/panels/remove.server.test.ts +5 -2
- package/src/server/lib/panels/scan.server.ts +26 -2
- package/src/server/lib/panels/settings-schema.server.ts +72 -0
- package/src/server/lib/plugins/background.server.ts +21 -3
- package/src/server/lib/plugins/background.test.ts +13 -0
- package/src/server/lib/plugins/loader.server.ts +35 -51
- package/src/server/lib/plugins/mcp.server.ts +100 -0
- package/src/server/lib/plugins/mcp.test.ts +75 -0
- package/src/server/lib/plugins/schedule-runner.server.ts +153 -0
- package/src/server/lib/plugins/schedule-runner.test.ts +186 -0
- package/src/server/lib/plugins/schedule-store.server.ts +107 -0
- package/src/server/lib/plugins/schema.server.ts +8 -0
- package/src/server/lib/plugins/settings.server.ts +56 -19
- package/src/server/lib/plugins/shutdown.server.ts +58 -0
- package/src/server/lib/plugins/shutdown.test.ts +28 -3
- package/src/server/lib/realtime/topics/global.server.ts +5 -1
- package/src/server/lib/schedule/rows.server.ts +9 -0
- package/src/server/lib/schedule/runtime.server.test.ts +91 -0
- package/src/server/lib/schedule/runtime.server.ts +101 -23
- package/src/server/lib/schedule/schema.server.ts +15 -0
- package/src/server/lib/schedule/store.server.test.ts +34 -0
- package/src/server/lib/schedule/store.server.ts +33 -9
- package/src/server/lib/sessions/fork.server.test.ts +47 -0
- package/src/server/lib/sessions/fork.server.ts +17 -1
- package/src/server/lib/sessions/spawn.server.ts +2 -2
- package/src/server/lib/waiting/runtime.server.test.ts +48 -0
- package/src/server/lib/waiting/runtime.server.ts +22 -0
- package/src/server/lib/waiting/schema.server.ts +8 -0
- package/src/server/lib/waiting/store.server.test.ts +14 -0
- package/src/server/lib/waiting/store.server.ts +6 -2
- package/src/server/routes/agent/command-resume.test.ts +9 -4
- package/src/server/routes/agent/command.ts +11 -0
- package/src/server/routes/agent/new-mode.test.ts +40 -0
- package/src/server/routes/agent/new.ts +36 -10
- package/src/server/routes/agent/prewarm.ts +48 -7
- package/src/server/routes/chat/index.ts +5 -0
- package/src/server/routes/chat/prompt-history.test.ts +67 -0
- package/src/server/routes/chat/prompt-history.ts +31 -0
- package/src/server/routes/chat/stream.test.ts +21 -0
- package/src/server/routes/chat/stream.ts +5 -0
- package/src/server/routes/fs/action-archive.test.ts +128 -0
- package/src/server/routes/fs/action-bulk.ts +106 -0
- package/src/server/routes/fs/action-save-bytes.test.ts +59 -0
- package/src/server/routes/fs/action-transfer.test.ts +26 -0
- package/src/server/routes/fs/action.ts +100 -12
- package/src/server/routes/fs/archive.ts +20 -0
- package/src/server/routes/fs/digest.test.ts +100 -0
- package/src/server/routes/fs/digest.ts +106 -0
- package/src/server/routes/fs/grant.test.ts +5 -2
- package/src/server/routes/fs/index.ts +4 -0
- package/src/server/routes/fs/read.ts +6 -1
- package/src/server/routes/fs/scope.test.ts +6 -2
- package/src/server/routes/harness/custom.test.ts +131 -0
- package/src/server/routes/harness/import-action.ts +3 -3
- package/src/server/routes/harness/root.ts +47 -9
- package/src/server/routes/harness/summary.test.ts +50 -0
- package/src/server/routes/harness/update-status.ts +41 -2
- package/src/server/routes/harness/update.test.ts +56 -2
- package/src/server/routes/harness/update.ts +2 -2
- package/src/server/routes/panels/bindings.ts +2 -0
- package/src/server/routes/panels/settings.test.ts +165 -0
- package/src/server/routes/panels/settings.ts +106 -0
- package/src/server/routes/schedule/body.ts +14 -0
- package/src/server/routes/schedule/index.ts +28 -4
- package/src/server/routes/sessions/delete.test.ts +4 -0
- package/src/server/routes/settings/mcp.ts +9 -26
- package/src/server/routes/waiting/index.ts +21 -2
- package/src/server/routes/waiting/routes.test.ts +21 -0
- package/src/shared/lib/chat/ask-form/index.ts +39 -31
- package/src/shared/lib/chat/ask-form/labels.ts +46 -0
- package/src/shared/lib/chat/ask-form/tokens.ts +11 -2
- package/src/shared/lib/chat/ask-form.test.ts +57 -0
- package/src/shared/lib/chat/ask-questions.ts +31 -0
- package/src/shared/lib/chat/composer/delegation.ts +3 -3
- package/src/shared/lib/chat/composer/history.test.ts +67 -0
- package/src/shared/lib/chat/composer/history.ts +61 -0
- package/src/shared/lib/chat/irc-notice.ts +42 -0
- package/src/shared/lib/chat/timeline/fork-anchor.test.ts +99 -0
- package/src/shared/lib/chat/timeline/fork-anchor.ts +47 -0
- package/src/shared/lib/chat/todo/parser.ts +6 -4
- package/src/shared/lib/fs/archive.test.ts +101 -0
- package/src/shared/lib/fs/archive.ts +191 -0
- package/src/shared/lib/fs/clipboard.test.ts +32 -7
- package/src/shared/lib/fs/clipboard.ts +59 -14
- package/src/shared/lib/fs/content-hash.ts +29 -0
- package/src/shared/lib/fs/csv.test.ts +50 -0
- package/src/shared/lib/fs/csv.ts +40 -0
- package/src/shared/lib/fs/document-kind.test.ts +13 -6
- package/src/shared/lib/fs/document-kind.ts +18 -6
- package/src/shared/lib/fs/file-kind-classify.test.ts +4 -0
- package/src/shared/lib/fs/file-kind.test.ts +2 -7
- package/src/shared/lib/fs/file-kind.ts +4 -2
- package/src/shared/lib/fs/grid-edit.test.ts +24 -0
- package/src/shared/lib/fs/grid-edit.ts +29 -0
- package/src/shared/lib/fs/grid-selection.test.ts +137 -0
- package/src/shared/lib/fs/grid-selection.ts +138 -0
- package/src/shared/lib/harness/brand-color.ts +5 -0
- package/src/shared/lib/harness/catalog.test.ts +22 -0
- package/src/shared/lib/harness/catalog.ts +60 -7
- package/src/shared/lib/harness/config-fields.test.ts +25 -0
- package/src/shared/lib/harness/config-fields.ts +33 -3
- package/src/shared/lib/harness/dialects.ts +1 -1
- package/src/shared/lib/harness/fork.ts +60 -0
- package/src/shared/lib/harness/mcp-facts.test.ts +30 -0
- package/src/shared/lib/harness/mcp-facts.ts +69 -0
- package/src/shared/lib/harness/menu.test.ts +16 -1
- package/src/shared/lib/harness/menu.ts +2 -2
- package/src/shared/lib/harness/provider-contracts.ts +109 -0
- package/src/shared/lib/harness/provider-facts.test.ts +2 -1
- package/src/shared/lib/harness/provider-facts.ts +24 -115
- package/src/shared/lib/harness/provider-lookup.ts +37 -0
- package/src/shared/lib/harness/providers.ts +2 -1
- package/src/shared/lib/harness/rewind.ts +6 -6
- package/src/shared/lib/harness/session-modes.ts +31 -0
- package/src/shared/lib/harness/transcript.test.ts +29 -0
- package/src/shared/lib/harness/transcript.ts +19 -0
- package/src/shared/lib/harness/updates.ts +10 -0
- package/src/shared/lib/notifications/settings.test.ts +21 -0
- package/src/shared/lib/notifications/settings.ts +24 -0
- package/src/shared/lib/omp/session/mapper.test.ts +31 -0
- package/src/shared/lib/omp/session/mapper.ts +17 -0
- package/src/shared/lib/omp/session/messages-map-notice.test.ts +68 -0
- package/src/shared/lib/omp/session/messages-map.test.ts +1 -35
- package/src/shared/lib/omp/session/messages-map.ts +17 -0
- package/src/shared/lib/omp/session/prewarm.test.ts +28 -4
- package/src/shared/lib/omp/session/prewarm.ts +25 -6
- package/src/shared/lib/omp/session/stream-state.server.test.ts +25 -0
- package/src/shared/lib/omp/session/stream-state.server.ts +8 -4
- package/src/shared/lib/omp/session/wait.ts +10 -1
- package/src/shared/lib/panels/capabilities.test.ts +1 -1
- package/src/shared/lib/panels/capabilities.ts +3 -0
- package/src/shared/lib/plugins/settings.ts +22 -0
- package/src/shared/lib/schedule/parse.test.ts +48 -0
- package/src/shared/lib/schedule/parse.ts +69 -45
- package/src/shared/lib/schedule/timezone.ts +128 -0
- package/src/shared/lib/settings/defaults.ts +2 -0
- package/src/shared/lib/settings/sections.ts +8 -4
- package/src/shared/lib/ui/picker-filter.test.ts +23 -0
- package/src/shared/lib/ui/picker-filter.ts +20 -0
- package/src/shared/lib/workspace/refresh-cadence.test.ts +25 -1
- package/src/shared/lib/workspace/relative-time.ts +16 -0
- package/src/shared/types/chat.ts +4 -0
- package/src/shared/types/harness.ts +12 -1
- package/src/shared/types/omp/agent.ts +6 -0
- package/src/shared/types/omp/session.ts +18 -0
- package/src/shared/types/panels-registry.ts +3 -3
- package/src/shared/types/panels.ts +4 -2
- package/src/shared/types/schedule.ts +13 -0
- package/src/shared/types/settings/state.ts +18 -7
- package/src/shared/types/todo.ts +3 -1
- package/src/shared/types/waiting.ts +9 -0
- package/src/test-support/file-actions.test-util.ts +4 -0
- package/src/test-support/file-archive.test-util.ts +41 -0
- package/src/test-support/file-clipboard.test-util.ts +9 -6
- package/src/test-support/file-editor.test-util.ts +70 -5
- package/src/test-support/harness-table.test-util.ts +2 -0
- package/src/test-support/preload.ts +46 -0
- package/dist/client/static/js/index-32rpkj6b.css +0 -1
- package/src/client/hooks/editor/use-external-change-notice.ts +0 -71
- package/src/client/hooks/editor/use-external-change.test.ts +0 -88
- package/src/client/hooks/editor/use-external-change.ts +0 -146
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
|
+
import { matchesPickerQuery } from '@/shared/lib/ui/picker-filter';
|
|
8
|
+
|
|
9
|
+
describe('matchesPickerQuery', () => {
|
|
10
|
+
test('an empty query keeps every row', () => {
|
|
11
|
+
expect(matchesPickerQuery('anything', '')).toBe(true);
|
|
12
|
+
expect(matchesPickerQuery('anything', ' ')).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('ignores case and separators, so a hyphenated id is found by its words', () => {
|
|
16
|
+
expect(matchesPickerQuery('claude-sonnet-5', 'sonnet 5')).toBe(true);
|
|
17
|
+
expect(matchesPickerQuery('Build pipeline', 'BUILD')).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('does not match a term the row never contains', () => {
|
|
21
|
+
expect(matchesPickerQuery('Build pipeline', 'deploy')).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The match rule every searchable picker uses.
|
|
8
|
+
*
|
|
9
|
+
* Case- and separator-insensitive, so "claude sonnet" finds `claude-sonnet-5`
|
|
10
|
+
* and "build pipe" finds "Build pipeline". It lives in `shared/lib` because two
|
|
11
|
+
* surfaces ask the same question — `SearchSelect` in settings and the composer's
|
|
12
|
+
* target pickers — and a second copy of the fold rule drifts the moment one of
|
|
13
|
+
* them is tuned.
|
|
14
|
+
*/
|
|
15
|
+
export function matchesPickerQuery(haystack: string, query: string): boolean {
|
|
16
|
+
const needle = query.trim();
|
|
17
|
+
if (!needle) return true;
|
|
18
|
+
const fold = (text: string) => text.toLowerCase().replace(/[^a-z0-9]+/g, '');
|
|
19
|
+
return fold(haystack).includes(fold(needle));
|
|
20
|
+
}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
SIDEBAR_DATA_TTL_MS,
|
|
24
24
|
STREAM_HEARTBEAT_MS,
|
|
25
25
|
} from '@/shared/lib/workspace/refresh-cadence';
|
|
26
|
-
import { relativeTimeAgo } from '@/shared/lib/workspace/relative-time';
|
|
26
|
+
import { formatFullDate, relativeTimeAgo } from '@/shared/lib/workspace/relative-time';
|
|
27
27
|
|
|
28
28
|
describe('refresh cadences', () => {
|
|
29
29
|
test('the documented millisecond values', () => {
|
|
@@ -115,3 +115,27 @@ describe('relativeTimeAgo', () => {
|
|
|
115
115
|
expect(relativeTimeAgo(Date.now() - 5 * MINUTE)).toBe('5m');
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
|
+
|
|
119
|
+
describe('formatFullDate', () => {
|
|
120
|
+
test('missing or unparseable input yields null', () => {
|
|
121
|
+
expect(formatFullDate(null)).toBeNull();
|
|
122
|
+
expect(formatFullDate(undefined)).toBeNull();
|
|
123
|
+
expect(formatFullDate('')).toBeNull();
|
|
124
|
+
expect(formatFullDate('not a date')).toBeNull();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test('renders the full weekday, date and clock', () => {
|
|
128
|
+
// 2026-11-12T14:30:00Z — the exact local rendering depends on the test
|
|
129
|
+
// machine's zone, so assert the parts that do not.
|
|
130
|
+
const label = formatFullDate('2026-11-12T14:30:00.000Z');
|
|
131
|
+
expect(label).toContain('Nov');
|
|
132
|
+
expect(label).toContain('2026');
|
|
133
|
+
expect(label).toContain('12');
|
|
134
|
+
expect(label).toMatch(/\d{1,2}:\d{2}/);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('parses an ISO string the same as its epoch millis', () => {
|
|
138
|
+
const iso = '2026-01-15T11:30:00.000Z';
|
|
139
|
+
expect(formatFullDate(iso)).toBe(formatFullDate(Date.parse(iso)));
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -23,3 +23,19 @@ export function relativeTimeAgo(value: string | number | null | undefined, now:
|
|
|
23
23
|
const month = date.toLocaleString('en-US', { month: 'short' });
|
|
24
24
|
return sameYear ? `${day} ${month}` : `${day} ${month} ${date.getFullYear()}`;
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
/** Full timestamp for a row's hover tooltip: `Wed, 12 Nov 2026, 02:30 PM`.
|
|
28
|
+
* Returns null for a missing/unparseable timestamp, matching `relativeTimeAgo`. */
|
|
29
|
+
export function formatFullDate(value: string | number | null | undefined): string | null {
|
|
30
|
+
if (value === null || value === undefined || value === '') return null;
|
|
31
|
+
const ms = typeof value === 'number' ? value : Date.parse(value);
|
|
32
|
+
if (Number.isNaN(ms)) return null;
|
|
33
|
+
return new Date(ms).toLocaleString('en-US', {
|
|
34
|
+
weekday: 'short',
|
|
35
|
+
day: 'numeric',
|
|
36
|
+
month: 'short',
|
|
37
|
+
year: 'numeric',
|
|
38
|
+
hour: '2-digit',
|
|
39
|
+
minute: '2-digit',
|
|
40
|
+
});
|
|
41
|
+
}
|
package/src/shared/types/chat.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'preact/compat';
|
|
2
2
|
import type { ApprovalMode } from '@/shared/lib/omp/config/access-mode';
|
|
3
|
+
import type { IrcMessageData } from '@/shared/types/omp/session';
|
|
3
4
|
|
|
4
5
|
/** One image a tool result returned (a `read` of a picture, an `eval` that
|
|
5
6
|
* painted one). Exactly one payload field is set: omp externalizes anything
|
|
@@ -178,6 +179,9 @@ export interface ChatMessageData {
|
|
|
178
179
|
* renderer that draws a specific card for one kind reads it from here.
|
|
179
180
|
*/
|
|
180
181
|
noticeSource?: string;
|
|
182
|
+
/** Set on an `irc:incoming` turn — a peer agent's message, drawn as its own
|
|
183
|
+
* card instead of a raw `<irc>` system notice. */
|
|
184
|
+
irc?: IrcMessageData;
|
|
181
185
|
toolCalls?: ToolCallData[];
|
|
182
186
|
actions?: (AgentActionData | ToolCallData)[];
|
|
183
187
|
systemNote?: string;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import type { HarnessCapabilities } from '@/server/lib/harness/capabilities';
|
|
16
16
|
import type { HarnessConfig } from '@/shared/lib/harness/config';
|
|
17
17
|
import type { CanonicalProtocol } from '@/shared/lib/harness/dialects';
|
|
18
|
-
import type { EnvProviderContract } from '@/shared/lib/harness/provider-
|
|
18
|
+
import type { EnvProviderContract } from '@/shared/lib/harness/provider-contracts';
|
|
19
19
|
|
|
20
20
|
export type { HarnessConfig };
|
|
21
21
|
|
|
@@ -56,7 +56,15 @@ export interface HarnessSummary {
|
|
|
56
56
|
* to install, probe or configure, so the settings page leaves it out and the
|
|
57
57
|
* picker never draws it as blocked. */
|
|
58
58
|
builtIn?: true;
|
|
59
|
+
/** True for a harness the user added, so the card can offer Remove. */
|
|
60
|
+
custom?: true;
|
|
61
|
+
/** The letter the UI draws when there is no vendor mark. */
|
|
62
|
+
initial?: string;
|
|
59
63
|
install?: string;
|
|
64
|
+
/** The launch line this build ships for the agent, as typeable text. The
|
|
65
|
+
* config form's placeholder and hint must name THIS harness's line: the box
|
|
66
|
+
* used to advertise `agy acp` on the omp and Claude cards alike. */
|
|
67
|
+
command?: string;
|
|
60
68
|
note?: string;
|
|
61
69
|
/** False when the user switched this harness off: it then leaves the settings
|
|
62
70
|
* menu and the composer's picker, so a roster of twelve becomes the agents
|
|
@@ -70,6 +78,9 @@ export interface HarnessSummary {
|
|
|
70
78
|
models: HarnessSelectorValue[];
|
|
71
79
|
thinking: HarnessSelectorValue[];
|
|
72
80
|
modes: HarnessSelectorValue[];
|
|
81
|
+
/** The mode the agent reported as current when its probe session opened,
|
|
82
|
+
* when it published one. */
|
|
83
|
+
currentMode?: string;
|
|
73
84
|
probedAt: number;
|
|
74
85
|
/** True when the record is older than `PROBE_TTL_MS`. The answer is still
|
|
75
86
|
* shown — with its age — rather than being reported as "never probed". */
|
|
@@ -131,6 +131,12 @@ export interface SpawnOptions {
|
|
|
131
131
|
/** Plan/goal picks made on a pending view. A brand-new session has no
|
|
132
132
|
* transcript to restore them from, so they ride the spawn environment. */
|
|
133
133
|
modes?: { plan: boolean; goal: boolean } | null;
|
|
134
|
+
/**
|
|
135
|
+
* The ACP mode id the composer picked on a pending chat. ACP applies modes as
|
|
136
|
+
* a config write right after `session/new`, so this travels with the spawn
|
|
137
|
+
* rather than as an environment value.
|
|
138
|
+
*/
|
|
139
|
+
sessionMode?: string | null;
|
|
134
140
|
/**
|
|
135
141
|
* Which harness runs the chat. A SPAWN property — it decides the transport,
|
|
136
142
|
* the model list and every capability the panels can show — so it can only be
|
|
@@ -154,3 +154,21 @@ export interface OmpSidebarData {
|
|
|
154
154
|
/** ISO timestamp of the read (client can use it as a refresh cursor). */
|
|
155
155
|
generatedAt: string;
|
|
156
156
|
}
|
|
157
|
+
|
|
158
|
+
/** A peer (IRC) message omp injected into a session.
|
|
159
|
+
*
|
|
160
|
+
* Since omp 18.18.9 a message that ends a `wait` is delivered as its own
|
|
161
|
+
* `customType: "irc:incoming"` turn instead of riding in the wait result
|
|
162
|
+
* (`details.waited`). The turn's `details` is the only idle copy of the sender
|
|
163
|
+
* and the raw body — the rendered content is the model's `<irc>` prompt
|
|
164
|
+
* envelope — so both transcript mappers lift this shape out and the timeline
|
|
165
|
+
* draws a message card rather than a raw system notice. */
|
|
166
|
+
export interface IrcMessageData {
|
|
167
|
+
id?: string;
|
|
168
|
+
from: string;
|
|
169
|
+
/** The sender's own text, without omp's prompt envelope. */
|
|
170
|
+
message: string;
|
|
171
|
+
replyTo?: string;
|
|
172
|
+
progress?: boolean;
|
|
173
|
+
broadcast?: boolean;
|
|
174
|
+
}
|
|
@@ -170,7 +170,7 @@ export interface PanelPluginStatus {
|
|
|
170
170
|
/** The mark colour the manifest declares, when it declares one. */
|
|
171
171
|
color?: string;
|
|
172
172
|
capabilities?: string[];
|
|
173
|
-
/** How many settings the
|
|
173
|
+
/** How many settings the plugin's schema declares, so the card can say what is configurable. */
|
|
174
174
|
settingsCount?: number;
|
|
175
175
|
/**
|
|
176
176
|
* The version the SOURCE offers, when it is known and newer.
|
|
@@ -194,7 +194,7 @@ export interface PanelPluginStatus {
|
|
|
194
194
|
/**
|
|
195
195
|
* One plugin the bundled marketplace offers, whether or not it is installed.
|
|
196
196
|
*
|
|
197
|
-
* The catalog is what the
|
|
197
|
+
* The catalog is what the Plugins Kabmo pane lists as AVAILABLE: the bundled
|
|
198
198
|
* marketplace is a store the user installs from, so a plugin sitting in
|
|
199
199
|
* `<package>/marketplace/plugins/` is an offer, not an install. A catalog entry
|
|
200
200
|
* cannot describe what a plugin CONTRIBUTES — that is known only after its
|
|
@@ -248,7 +248,7 @@ export interface PanelRegistryPayload {
|
|
|
248
248
|
* built-in panel list, and does not need one, because the client is what
|
|
249
249
|
* resolves a bare id to a component. Carrying the set here rather than in the
|
|
250
250
|
* Kabmo settings blob is what keeps ONE store: the activity-bar menu and
|
|
251
|
-
* the
|
|
251
|
+
* the Plugins Kabmo switches write the same ids through the same endpoint,
|
|
252
252
|
* so the two surfaces cannot disagree about whether a panel is on.
|
|
253
253
|
*/
|
|
254
254
|
disabledPanels: string[];
|
|
@@ -75,8 +75,10 @@ export interface PanelPluginManifest {
|
|
|
75
75
|
*/
|
|
76
76
|
server?: string;
|
|
77
77
|
/**
|
|
78
|
-
* Declared settings
|
|
79
|
-
*
|
|
78
|
+
* **Legacy.** Declared settings used to live here; they now live in
|
|
79
|
+
* `settings-schema.json` at the plugin root, which the host reads without the
|
|
80
|
+
* plugin running. This key is still read when that file is absent, so a
|
|
81
|
+
* plugin written before the file existed keeps its form.
|
|
80
82
|
*/
|
|
81
83
|
settings?: Record<string, PluginSettingDefinition>;
|
|
82
84
|
/**
|
|
@@ -34,6 +34,19 @@ export interface ScheduledTask {
|
|
|
34
34
|
prompt: string;
|
|
35
35
|
kind: ScheduleKind;
|
|
36
36
|
spec: string;
|
|
37
|
+
/**
|
|
38
|
+
* Which harness runs the task (`omp-rpc`, `claude`, `codex`, …). A spawn-time
|
|
39
|
+
* property, not a label: it decides the transport, the model catalog and the
|
|
40
|
+
* launch command. `omp-rpc` is the built-in default.
|
|
41
|
+
*/
|
|
42
|
+
harness: string;
|
|
43
|
+
/**
|
|
44
|
+
* IANA zone the spec is read in. A cron expression is a wall-clock statement,
|
|
45
|
+
* so `0 9 * * 1-5` means 09:00 here, not 09:00 in the server's zone. Resolved
|
|
46
|
+
* at write time (the server's zone when the request names none) so a task
|
|
47
|
+
* keeps firing at the hour it was created for even if the server moves.
|
|
48
|
+
*/
|
|
49
|
+
timezone: string;
|
|
37
50
|
/** Workspace folder the run starts in; null uses the server's default cwd. */
|
|
38
51
|
folderId: number | null;
|
|
39
52
|
/** Resolved at creation from the folder, so a deleted folder cannot strand it. */
|
|
@@ -16,7 +16,7 @@ export type SettingsCategoryId =
|
|
|
16
16
|
| 'usage'
|
|
17
17
|
| 'token-usage'
|
|
18
18
|
/** Panel plugins — Kabmo's own extension surface (marketplaces of
|
|
19
|
-
* sandboxed panel views). Deliberately NOT under
|
|
19
|
+
* sandboxed panel views). Deliberately NOT under OMP → Plugins, which holds
|
|
20
20
|
* plugins: these are Kabmo surfaces omp has no concept of. */
|
|
21
21
|
| 'panel-plugins'
|
|
22
22
|
// WORKSPACE
|
|
@@ -28,6 +28,10 @@ export type SettingsCategoryId =
|
|
|
28
28
|
| 'behavior'
|
|
29
29
|
| 'commands'
|
|
30
30
|
| 'mcp'
|
|
31
|
+
// omp's extension surface: plugins, skills and the skills catalog.
|
|
32
|
+
| 'plugins'
|
|
33
|
+
| 'skills'
|
|
34
|
+
| 'skills-catalog'
|
|
31
35
|
// HARNESSES — the agents Kabmo can drive, one PAGE each. Their own group in
|
|
32
36
|
// the sidebar: a different transport and a different config file from omp.
|
|
33
37
|
// The single-harness pages carry a dynamic id (`harness:claude`, from
|
|
@@ -35,11 +39,7 @@ export type SettingsCategoryId =
|
|
|
35
39
|
// what decides which agents exist, and a build-time union entry per harness
|
|
36
40
|
// would have to be edited for every adapter added at runtime.
|
|
37
41
|
| 'harness-index'
|
|
38
|
-
| `harness:${string}
|
|
39
|
-
// LIBRARY
|
|
40
|
-
| 'plugins'
|
|
41
|
-
| 'skills'
|
|
42
|
-
| 'skills-catalog';
|
|
42
|
+
| `harness:${string}`;
|
|
43
43
|
|
|
44
44
|
export interface SettingsCategoryItem {
|
|
45
45
|
id: SettingsCategoryId;
|
|
@@ -81,10 +81,21 @@ export interface SettingsState {
|
|
|
81
81
|
autoSessionTitle: boolean;
|
|
82
82
|
soundAlerts: boolean;
|
|
83
83
|
chatCompletionSound: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Whether this client's DESKTOP delivery is on: a browser tab, a PWA, or
|
|
86
|
+
* the desktop shell. Defaults to true because the key postdates the feature —
|
|
87
|
+
* an install that already opted into an event must keep receiving it — and
|
|
88
|
+
* only the literal `false` silences it. Events are gated separately by
|
|
89
|
+
* `notifyOnFinish` / `notifyOnAsk` / `notifyOnError`.
|
|
90
|
+
*/
|
|
91
|
+
notifyDesktopEnabled: boolean;
|
|
92
|
+
/** Whether PHONE/TABLET delivery is on. Same default and precedence as `notifyDesktopEnabled`. */
|
|
93
|
+
notifyMobileEnabled: boolean;
|
|
84
94
|
/**
|
|
85
95
|
* System notification when a run finishes. Off by default: a fresh install
|
|
86
96
|
* never asks for notification permission until one of these is turned on.
|
|
87
|
-
*
|
|
97
|
+
* Delivered whether or not Kabmo is the focused window, on every platform
|
|
98
|
+
* whose master switch is on.
|
|
88
99
|
*/
|
|
89
100
|
notifyOnFinish: boolean;
|
|
90
101
|
/** System notification when an agent blocks on an ask/approval dialog. */
|
package/src/shared/types/todo.ts
CHANGED
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
* timeline never rendered before: `blocked` (waiting on something, with an
|
|
19
19
|
* optional note) and `abandoned` (deliberately dropped). Both are settled-but-
|
|
20
20
|
* not-done, which is why `isClosedTodo` — not `status === 'completed'` — is
|
|
21
|
-
* what any progress counter must use.
|
|
21
|
+
* what any progress counter must use. omp 18.19.0 removed `blocked` (and the
|
|
22
|
+
* `block` / `unblock` ops below); the type keeps them because snapshots saved
|
|
23
|
+
* before that pin still carry the status, and omp reads them back as `pending`.
|
|
22
24
|
*/
|
|
23
25
|
|
|
24
26
|
/** Lifecycle state of one todo item (omp's `TodoStatus`). */
|
|
@@ -33,6 +33,15 @@ export interface WaitingPrompt {
|
|
|
33
33
|
pendingId: string | null;
|
|
34
34
|
/** The session whose completion releases this prompt. */
|
|
35
35
|
dependsOn: string;
|
|
36
|
+
/**
|
|
37
|
+
* The chat this prompt is sent INTO, when it already exists.
|
|
38
|
+
*
|
|
39
|
+
* Null on the original path: the prompt belongs to a pending `new-…` chat and
|
|
40
|
+
* the dispatch spawns its session. A next prompt in a running chat names the
|
|
41
|
+
* session it belongs to, and the dispatch wakes that session instead of
|
|
42
|
+
* creating a second one.
|
|
43
|
+
*/
|
|
44
|
+
targetSessionId: string | null;
|
|
36
45
|
/** Title of `dependsOn` at creation time, for the waiting row's own label. */
|
|
37
46
|
dependsOnTitle: string | null;
|
|
38
47
|
/** Composer text as the user typed it. */
|
|
@@ -21,6 +21,7 @@ import type { h as PreactH, render as PreactRender } from 'preact';
|
|
|
21
21
|
import type { act as PreactAct } from 'preact/test-utils';
|
|
22
22
|
import type { FileActions, useFileActions as UseFileActionsHook } from '@/client/hooks/workspace/file-tree-actions';
|
|
23
23
|
import { createStubClipboard, type StubClipboard, type StubClipboardOptions } from '@/test-support/file-clipboard.test-util';
|
|
24
|
+
import { createStubArchive } from '@/test-support/file-archive.test-util';
|
|
24
25
|
|
|
25
26
|
/** What the stubbed endpoint was asked, and what it answers. */
|
|
26
27
|
export interface FileActionsServer {
|
|
@@ -140,6 +141,9 @@ export function createFileActionsHarness(): FileActionsHarness {
|
|
|
140
141
|
onOpenFile: (target) => opened.push({ path: target.path, name: target.name }),
|
|
141
142
|
onActionComplete: () => refreshes++,
|
|
142
143
|
clipboard,
|
|
144
|
+
selection: [],
|
|
145
|
+
selected: false,
|
|
146
|
+
archive: createStubArchive(),
|
|
143
147
|
isFolder: file.path === file.name,
|
|
144
148
|
});
|
|
145
149
|
return null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A stand-in for the Files panel's archive dialogs, for specs that exercise a
|
|
8
|
+
* ROW (`useFileActions`) rather than the panel.
|
|
9
|
+
*
|
|
10
|
+
* The real hook is owned by the panel; a row only needs the two openers and a
|
|
11
|
+
* busy flag, and the calls it made are what the menu assertions read.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { ClipboardTarget } from '@/client/hooks/workspace/file-clipboard';
|
|
15
|
+
import type { FileArchive } from '@/client/hooks/workspace/file-archive';
|
|
16
|
+
|
|
17
|
+
export interface StubArchive extends FileArchive {
|
|
18
|
+
/** Every dialog a row asked the panel to open, in order. */
|
|
19
|
+
calls: Array<{ action: 'compress' | 'extract'; targets: ClipboardTarget[] }>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function createStubArchive(): StubArchive {
|
|
23
|
+
const calls: StubArchive['calls'] = [];
|
|
24
|
+
return {
|
|
25
|
+
formats: [],
|
|
26
|
+
compress: null,
|
|
27
|
+
extract: null,
|
|
28
|
+
error: null,
|
|
29
|
+
busy: false,
|
|
30
|
+
calls,
|
|
31
|
+
openCompress: (targets) => calls.push({ action: 'compress', targets: [...targets] }),
|
|
32
|
+
openExtract: (target) => calls.push({ action: 'extract', targets: [target] }),
|
|
33
|
+
setFormat: () => {},
|
|
34
|
+
setName: () => {},
|
|
35
|
+
setCompressDestination: () => {},
|
|
36
|
+
setExtractDestination: () => {},
|
|
37
|
+
cancel: () => {},
|
|
38
|
+
submitCompress: () => {},
|
|
39
|
+
submitExtract: () => {},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -28,14 +28,17 @@ export interface StubClipboardOptions {
|
|
|
28
28
|
|
|
29
29
|
export interface StubClipboard extends FileClipboard {
|
|
30
30
|
/** Every call the row made, in order. */
|
|
31
|
-
calls: Array<{ action: string;
|
|
31
|
+
calls: Array<{ action: string; targets: ClipboardTarget[] }>;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export function createStubClipboard(options: StubClipboardOptions = {}): StubClipboard {
|
|
35
35
|
const calls: StubClipboard['calls'] = [];
|
|
36
36
|
const clip = options.clip ?? null;
|
|
37
|
-
const record = (action: string) => (
|
|
38
|
-
calls.push({ action,
|
|
37
|
+
const record = (action: string) => (targets: readonly ClipboardTarget[]) => {
|
|
38
|
+
calls.push({ action, targets: [...targets] });
|
|
39
|
+
};
|
|
40
|
+
const single = (action: string) => (target: ClipboardTarget) => {
|
|
41
|
+
calls.push({ action, targets: [target] });
|
|
39
42
|
};
|
|
40
43
|
return {
|
|
41
44
|
clip,
|
|
@@ -45,8 +48,8 @@ export function createStubClipboard(options: StubClipboardOptions = {}): StubCli
|
|
|
45
48
|
moveRefusalFor: () => options.moveRefusal ?? options.refusal ?? null,
|
|
46
49
|
copy: record('copy'),
|
|
47
50
|
cut: record('cut'),
|
|
48
|
-
duplicate:
|
|
49
|
-
paste:
|
|
50
|
-
move:
|
|
51
|
+
duplicate: single('duplicate'),
|
|
52
|
+
paste: single('paste'),
|
|
53
|
+
move: single('move'),
|
|
51
54
|
};
|
|
52
55
|
}
|
|
@@ -27,12 +27,35 @@ import type {
|
|
|
27
27
|
} from '@/client/hooks/editor/use-file-editor';
|
|
28
28
|
|
|
29
29
|
export const DISK = 'const a = 1;\nconst b = 2;\n';
|
|
30
|
+
/** The mtime every stubbed answer reports; tests that care about it override. */
|
|
31
|
+
const DISK_MTIME = 1_700_000_000_000;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A SYNCHRONOUS stand-in for the server's SHA-256.
|
|
35
|
+
*
|
|
36
|
+
* The route and the real save path hash with `contentHash` (WebCrypto). A stub
|
|
37
|
+
* that did the same would resolve on a thread-pool task, so a test's settle —
|
|
38
|
+
* which drains microtasks — could observe the buffer mid-read and fail on a
|
|
39
|
+
* loaded machine. The client never hashes anything itself: it compares the hash
|
|
40
|
+
* the server handed it. So a deterministic local fingerprint is enough here, and
|
|
41
|
+
* it is what the tests assert against.
|
|
42
|
+
*/
|
|
43
|
+
export function stubHash(text: string): string {
|
|
44
|
+
let hash = 0x811c9dc5;
|
|
45
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
46
|
+
hash ^= text.charCodeAt(index);
|
|
47
|
+
hash = Math.imul(hash, 0x01000193) >>> 0;
|
|
48
|
+
}
|
|
49
|
+
return hash.toString(16).padStart(8, '0');
|
|
50
|
+
}
|
|
30
51
|
/** Stable identity: the read effect re-runs when its target object changes. */
|
|
31
52
|
export const TARGET = { id: 1, name: 'a.js', path: 'a.js' };
|
|
32
53
|
|
|
33
54
|
export interface FsState {
|
|
34
55
|
reads: number;
|
|
35
56
|
writes: number;
|
|
57
|
+
/** Digest polls served — the auto-refresh watcher's own traffic. */
|
|
58
|
+
digests: number;
|
|
36
59
|
body: string;
|
|
37
60
|
/** The `eol` field of the last write — the ending the server is asked to use. */
|
|
38
61
|
sentEol: string | null;
|
|
@@ -43,28 +66,53 @@ export interface FsState {
|
|
|
43
66
|
readRefusal: { status: number; error: string; kind?: 'binary' | 'too-large' } | null;
|
|
44
67
|
}
|
|
45
68
|
|
|
46
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Serves `state.body` for reads, records writes, and answers the digest poll the
|
|
71
|
+
* auto-refresh watcher runs — without touching the network.
|
|
72
|
+
*
|
|
73
|
+
* The digest answers with the hash of the SAME string the read returned, so a
|
|
74
|
+
* mounted editor sees "the disk is what I hold" until a test changes `body`
|
|
75
|
+
* behind its back. A stub that answered a fixed hash would make every mount look
|
|
76
|
+
* like an external change.
|
|
77
|
+
*/
|
|
47
78
|
export function stubFetch(state: FsState) {
|
|
48
79
|
globalThis.fetch = (async (input: string | URL | Request, init?: RequestInit) => {
|
|
49
|
-
|
|
80
|
+
const url = String(input);
|
|
81
|
+
if (url.startsWith('/api/fs/read')) {
|
|
50
82
|
state.reads += 1;
|
|
51
83
|
if (state.readRefusal) {
|
|
52
84
|
const { status, error, kind } = state.readRefusal;
|
|
53
85
|
return { ok: false, status, json: async () => ({ error, kind }) };
|
|
54
86
|
}
|
|
55
|
-
return {
|
|
87
|
+
return {
|
|
88
|
+
ok: true,
|
|
89
|
+
status: 200,
|
|
90
|
+
json: async () => ({ content: state.body, mtimeMs: DISK_MTIME, hash: stubHash(state.body) }),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (url.startsWith('/api/fs/digest')) {
|
|
94
|
+
state.digests += 1;
|
|
95
|
+
return {
|
|
96
|
+
ok: true,
|
|
97
|
+
status: 200,
|
|
98
|
+
json: async () => ({ exists: true, mtimeMs: DISK_MTIME, hash: stubHash(state.body) }),
|
|
99
|
+
};
|
|
56
100
|
}
|
|
57
101
|
const form = init?.body as FormData;
|
|
58
102
|
state.writes += 1;
|
|
59
103
|
state.body = String(form.get('content'));
|
|
60
104
|
state.sentEol = form.get('eol') === null ? null : String(form.get('eol'));
|
|
61
|
-
return {
|
|
105
|
+
return {
|
|
106
|
+
ok: true,
|
|
107
|
+
status: 200,
|
|
108
|
+
json: async () => ({ success: true, mtimeMs: DISK_MTIME, hash: stubHash(state.body) }),
|
|
109
|
+
};
|
|
62
110
|
}) as unknown as typeof fetch;
|
|
63
111
|
}
|
|
64
112
|
|
|
65
113
|
/** A fresh per-test state. */
|
|
66
114
|
export function freshState(body: string = DISK): FsState {
|
|
67
|
-
return { reads: 0, writes: 0, sentEol: null, body, readRefusal: null };
|
|
115
|
+
return { reads: 0, writes: 0, digests: 0, sentEol: null, body, readRefusal: null };
|
|
68
116
|
}
|
|
69
117
|
|
|
70
118
|
/**
|
|
@@ -98,6 +146,15 @@ export interface EditorHarness {
|
|
|
98
146
|
mount(target?: typeof TARGET, options?: UseFileEditorOptions): Promise<void>;
|
|
99
147
|
/** Run a state update inside Preact's `act`, then settle. */
|
|
100
148
|
run(update: () => void): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Run an ASYNC update inside Preact's `act`.
|
|
151
|
+
*
|
|
152
|
+
* A verdict that arrives from a promise (the disk watcher's digest) must be
|
|
153
|
+
* delivered inside the act scope, or Preact defers the render's effects to a
|
|
154
|
+
* paint frame that never comes in a test — the state updates, the effect does
|
|
155
|
+
* not, and an assertion about a re-read reads the previous render.
|
|
156
|
+
*/
|
|
157
|
+
runAsync(update: () => Promise<void>): Promise<void>;
|
|
101
158
|
}
|
|
102
159
|
|
|
103
160
|
/**
|
|
@@ -171,6 +228,13 @@ export function createEditorHarness(): EditorHarness {
|
|
|
171
228
|
await settle();
|
|
172
229
|
}
|
|
173
230
|
|
|
231
|
+
async function runAsync(update: () => Promise<void>) {
|
|
232
|
+
await act(async () => {
|
|
233
|
+
await update();
|
|
234
|
+
});
|
|
235
|
+
await settle();
|
|
236
|
+
}
|
|
237
|
+
|
|
174
238
|
return {
|
|
175
239
|
get mounted() {
|
|
176
240
|
return mounted;
|
|
@@ -178,5 +242,6 @@ export function createEditorHarness(): EditorHarness {
|
|
|
178
242
|
settle,
|
|
179
243
|
mount,
|
|
180
244
|
run,
|
|
245
|
+
runAsync,
|
|
181
246
|
};
|
|
182
247
|
}
|
|
@@ -91,6 +91,7 @@ export function mountHarnessTable(
|
|
|
91
91
|
state?: {
|
|
92
92
|
jobs?: HarnessUpdateJob[];
|
|
93
93
|
onOpenLog?: (harness: string) => void;
|
|
94
|
+
onDismiss?: (harness: string) => Promise<string | null>;
|
|
94
95
|
},
|
|
95
96
|
): HTMLElement {
|
|
96
97
|
act(() =>
|
|
@@ -102,6 +103,7 @@ export function mountHarnessTable(
|
|
|
102
103
|
onUpdate: onUpdate ?? (async () => null),
|
|
103
104
|
jobs: state?.jobs ?? [],
|
|
104
105
|
onOpenLog: state?.onOpenLog,
|
|
106
|
+
onDismiss: state?.onDismiss,
|
|
105
107
|
}),
|
|
106
108
|
container,
|
|
107
109
|
),
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The run-wide fallback database, loaded by `bunfig.toml`'s `[test] preload`.
|
|
8
|
+
*
|
|
9
|
+
* Per-suite isolation (`isolateDb`/`releaseDb`) is the contract, and it is what
|
|
10
|
+
* keeps a suite's writes inside its own temp file. It cannot cover work that
|
|
11
|
+
* outlives its suite: production code fires writes and forgets them
|
|
12
|
+
* (`void noteChildOutcome(...)`, `void syncDiscoveryRootsWatch()`), and such a
|
|
13
|
+
* continuation can call `getDb()` AFTER `releaseDb` deleted `KABMO_DB_PATH`.
|
|
14
|
+
* The path is then the default one — the developer's real `~/.kabmo/db.sqlite`.
|
|
15
|
+
*
|
|
16
|
+
* `DB_PATH` is the LOWEST-precedence spelling (`KABMO_DB_PATH` ->
|
|
17
|
+
* `OMPCHAMBER_DB_PATH` -> `DB_PATH`), so a suite that isolates still wins, and
|
|
18
|
+
* `releaseDb` (which deletes only `KABMO_DB_PATH`) hands late work back to this
|
|
19
|
+
* temp file instead of the developer's home. Measured on a full `bun test` with
|
|
20
|
+
* a tracer around `createDb`: two opens of the real path remained after every
|
|
21
|
+
* suite was isolated, one from a debounced roots-watch reconcile and one from
|
|
22
|
+
* an ACP child-outcome write; both fall to this file and the tracer reports
|
|
23
|
+
* zero.
|
|
24
|
+
*
|
|
25
|
+
* `afterAll` here runs ONCE for the whole run (measured: a preload hook is not
|
|
26
|
+
* per file), which is where the directory is removed. The handle is closed
|
|
27
|
+
* first — a live SQLite handle makes the delete fail with `EBUSY` on Windows.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { afterAll } from 'bun:test';
|
|
31
|
+
import { mkdtempSync } from 'node:fs';
|
|
32
|
+
import { tmpdir } from 'node:os';
|
|
33
|
+
import { join } from 'node:path';
|
|
34
|
+
|
|
35
|
+
import { closeDb } from '@/server/db.server';
|
|
36
|
+
import { removeDir } from '@/test-support/remove-dir';
|
|
37
|
+
|
|
38
|
+
const dir = mkdtempSync(join(tmpdir(), 'kabmo-test-fallback-db-'));
|
|
39
|
+
// Assigned, not overwritten: an operator running `bun test` with `DB_PATH` set
|
|
40
|
+
// asked for that file, and no suite should silently redirect it.
|
|
41
|
+
Bun.env.DB_PATH ??= join(dir, 'db.sqlite');
|
|
42
|
+
|
|
43
|
+
afterAll(async () => {
|
|
44
|
+
await closeDb();
|
|
45
|
+
removeDir(dir);
|
|
46
|
+
});
|