@kabmo-labs/kabmo 0.17.0 → 0.19.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/README.md +10 -7
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +523 -441
- package/dist/client/static/js/{index-rerjq5th.js → index-fcee4c13.js} +828 -818
- package/dist/client/static/js/index-sxdw908m.css +1 -0
- package/marketplace/plugins/command-runner/package.json +3 -2
- package/marketplace/plugins/git-forge/package.json +3 -2
- package/marketplace/plugins/session-info/package.json +3 -2
- package/marketplace/plugins/stats/package.json +3 -2
- package/package.json +3 -1
- package/src/client/components/auth/login-screen/index.tsx +2 -1
- package/src/client/components/common/ComposerPicker.tsx +1 -1
- package/src/client/components/common/FolderPicker.tsx +2 -2
- package/src/client/components/common/MarkdownRenderer.tsx +136 -89
- package/src/client/components/common/Modal.tsx +2 -2
- package/src/client/components/common/PWAInstallButton.tsx +2 -2
- package/src/client/components/common/ViewportSelector.tsx +1 -1
- package/src/client/components/common/anchored-menu/index.test.tsx +141 -0
- package/src/client/components/common/anchored-menu/index.tsx +147 -0
- package/src/client/components/common/batch-selection/SelectionCheckbox.tsx +2 -1
- package/src/client/components/common/brand-wordmark/index.test.tsx +13 -2
- package/src/client/components/common/brand-wordmark/index.tsx +13 -2
- package/src/client/components/common/checkbox/style.test.ts +139 -0
- package/src/client/components/common/checkbox/style.ts +51 -0
- package/src/client/components/common/context-usage-button/index.tsx +2 -2
- package/src/client/components/common/file-icon/index.tsx +23 -9
- package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +144 -0
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +108 -0
- package/src/client/components/common/markdown-review/index.tsx +129 -0
- package/src/client/components/common/panel-mark/index.tsx +97 -0
- package/src/client/components/common/provider-icon/glyphs.test.ts +1 -1
- package/src/client/components/common/provider-icon/index.test.ts +14 -0
- package/src/client/components/common/provider-icon/index.tsx +4 -0
- package/src/client/components/common/provider-icon/resolve.test.ts +8 -7
- package/src/client/components/common/provider-icon/resolve.ts +16 -3
- package/src/client/components/common/server-control/Panel.tsx +33 -23
- package/src/client/components/common/server-control/index.test.tsx +11 -5
- package/src/client/components/common/server-control/index.tsx +10 -8
- package/src/client/components/common/session-actions-menu/index.tsx +1 -1
- package/src/client/components/common/toolbar-row/index.tsx +1 -1
- package/src/client/components/layout/ActivityBar.tsx +22 -3
- package/src/client/components/layout/LeftDock.tsx +9 -2
- package/src/client/components/layout/PanelVisibilityMenu.tsx +1 -1
- package/src/client/components/layout/WindowAura.tsx +27 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +1 -1
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +2 -2
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +11 -2
- package/src/client/components/layout/desktop-layout/index.tsx +3 -1
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +44 -23
- package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +36 -17
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -7
- package/src/client/components/layout/session-sidebar/Header.tsx +1 -1
- package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
- package/src/client/components/layout/session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/NotesDialog.tsx +94 -0
- package/src/client/components/layout/session-sidebar/about-modal/VersionLine.test.tsx +68 -0
- package/src/client/components/layout/session-sidebar/about-modal/VersionLine.tsx +36 -0
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +57 -34
- package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +40 -14
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +7 -6
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +1 -1
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +2 -2
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +2 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +2 -2
- package/src/client/components/layout/update-popup/ReleaseNotes.tsx +8 -3
- package/src/client/components/layout/update-popup/index.tsx +5 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +13 -15
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +23 -1
- package/src/client/components/mobile/mobile-right-sidebar/MissingFileBanner.tsx +30 -0
- package/src/client/components/mobile/mobile-right-sidebar/PreviewScroller.tsx +18 -2
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +22 -67
- package/src/client/components/mobile/mobile-session-sidebar/ItemMenu.tsx +110 -0
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/mobile/panel-chips.tsx +10 -2
- package/src/client/components/settings/Modal.tsx +4 -4
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +2 -2
- package/src/client/components/settings/SettingsSidebarList.tsx +20 -0
- package/src/client/components/settings/apply-side-effects.test.ts +30 -0
- package/src/client/components/settings/apply-side-effects.ts +14 -0
- package/src/client/components/settings/categories/AgentSettings.tsx +23 -50
- package/src/client/components/settings/categories/AppearanceSettings.tsx +6 -0
- package/src/client/components/settings/categories/CommandSettings.tsx +2 -2
- package/src/client/components/settings/categories/McpSettings.tsx +4 -21
- package/src/client/components/settings/categories/OmpSettings.tsx +147 -194
- package/src/client/components/settings/categories/SkillSettings.tsx +2 -2
- package/src/client/components/settings/categories/TokenUsageSettings.tsx +211 -229
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +229 -237
- package/src/client/components/settings/categories/agent-settings/ModelPicker.tsx +71 -0
- package/src/client/components/settings/categories/agent-settings/SidebarList.tsx +9 -2
- package/src/client/components/settings/categories/agent-settings/levels.ts +38 -0
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +144 -0
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.test.tsx +120 -0
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +180 -0
- package/src/client/components/settings/categories/behavior-settings/Editor.tsx +27 -7
- package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +23 -5
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +75 -33
- package/src/client/components/settings/categories/command-settings/SidebarList.tsx +7 -0
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +93 -77
- package/src/client/components/settings/categories/mcp-settings/EnvVarsSection.tsx +83 -0
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +28 -15
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +20 -0
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +97 -36
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +151 -0
- package/src/client/components/settings/categories/omp-settings/ExtensionsPanel.tsx +68 -32
- package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +119 -0
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +14 -7
- package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +15 -6
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +165 -226
- package/src/client/components/settings/categories/omp-settings/types.ts +28 -0
- package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/BuiltinList.tsx +21 -3
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +51 -2
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +43 -10
- package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -1
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +2 -1
- package/src/client/components/settings/categories/project-settings/ModelDropdown.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -1
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +3 -2
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +3 -2
- package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +37 -8
- package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +34 -14
- package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +21 -0
- package/src/client/components/settings/categories/skill-settings/pane.test.tsx +15 -6
- package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +242 -102
- package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +130 -56
- package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +135 -0
- package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +55 -33
- package/src/client/components/settings/categories/token-usage-settings/Provenance.tsx +59 -0
- package/src/client/components/settings/categories/token-usage-settings/panel.test.tsx +239 -0
- package/src/client/components/workspace/browser-panel/Screencast.test.ts +1 -0
- package/src/client/components/workspace/browser-panel/Screencast.tsx +17 -22
- package/src/client/components/workspace/browser-panel/TabStrip.test.tsx +158 -0
- package/src/client/components/workspace/browser-panel/TabStrip.tsx +90 -0
- package/src/client/components/workspace/browser-panel/index.tsx +50 -4
- package/src/client/components/workspace/browser-toolbar/index.tsx +41 -1
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +13 -2
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +4 -3
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +2 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.test.ts +88 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +24 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +34 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +237 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +191 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +1 -1
- package/src/client/components/workspace/context-panel/CostBreakdownPopover.tsx +1 -1
- package/src/client/components/workspace/diff-panel/MergeDiffView.tsx +21 -7
- package/src/client/components/workspace/diff-panel/changes.test.ts +51 -0
- package/src/client/components/workspace/diff-panel/changes.ts +28 -12
- package/src/client/components/workspace/diff-panel/index.tsx +2 -2
- package/src/client/components/workspace/diff-panel/merge.test.ts +28 -0
- package/src/client/components/workspace/diff-panel/merge.ts +21 -1
- package/src/client/components/workspace/editor/Body.tsx +7 -0
- package/src/client/components/workspace/editor/FileDocument.tsx +15 -21
- package/src/client/components/workspace/editor/FilePane.tsx +12 -0
- package/src/client/components/workspace/editor/PluginRail.tsx +1 -1
- package/src/client/components/workspace/editor/PreviewPane.tsx +70 -0
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
- package/src/client/components/workspace/editor/TabContextMenu.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.tsx +1 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +17 -1
- package/src/client/components/workspace/editor/index.tsx +25 -22
- package/src/client/components/workspace/editor/toolbar-clusters.test.ts +14 -0
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +12 -86
- package/src/client/components/workspace/editor/toolbar-toggle.tsx +53 -0
- package/src/client/components/workspace/editor/toolbar-write-clusters.tsx +112 -0
- package/src/client/components/workspace/file-explorer/ContextMenu.tsx +1 -1
- package/src/client/components/workspace/file-explorer/Modals.tsx +10 -10
- package/src/client/components/workspace/file-explorer/RootMenu.tsx +1 -1
- package/src/client/components/workspace/git-panel/BranchToolbar.test.tsx +130 -0
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +21 -11
- package/src/client/components/workspace/git-panel/CommitBox.tsx +2 -1
- package/src/client/components/workspace/git-panel/Modals.tsx +2 -2
- package/src/client/components/workspace/git-panel/StashSection.tsx +2 -1
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -1
- package/src/client/components/workspace/git-panel/branch-modal/RenameDialog.tsx +2 -1
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -2
- package/src/client/components/workspace/git-panel/commit-modal.test.ts +5 -3
- package/src/client/components/workspace/git-panel/index.tsx +7 -0
- package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +7 -0
- package/src/client/components/workspace/plugin-panel/resolve.tsx +4 -0
- package/src/client/components/workspace/search-panel/Body.tsx +1 -1
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +1 -1
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +5 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.test.tsx +201 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.tsx +112 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.test.tsx +225 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.tsx +217 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateTarget.tsx +99 -0
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +30 -1
- package/src/client/components/workspace/user-browser-panel/index.tsx +81 -2
- package/src/client/data/agent-data/builtin.ts +0 -10
- package/src/client/data/agent-data/orchestrator.ts +0 -45
- package/src/client/data/agent-data/specialist.ts +0 -100
- package/src/client/data/mock/token-usage.ts +170 -120
- package/src/client/data/settings/omp-schema.json +33 -1
- package/src/client/glass.css +785 -0
- package/src/client/glass.test.ts +346 -0
- package/src/client/hooks/browser/use-annotate.test.ts +143 -0
- package/src/client/hooks/browser/use-annotate.ts +98 -0
- package/src/client/hooks/browser/use-close-tab.test.ts +148 -0
- package/src/client/hooks/browser/use-close-tab.ts +67 -0
- package/src/client/hooks/browser/use-screencast.ts +13 -1
- package/src/client/hooks/chat/composer/browser-context.test.ts +117 -0
- package/src/client/hooks/chat/composer/browser-context.ts +40 -16
- package/src/client/hooks/chat/composer/items.test.ts +1 -1
- package/src/client/hooks/chat/composer/review-context.ts +38 -0
- package/src/client/hooks/chat/composer/use-draft.test.ts +132 -0
- package/src/client/hooks/chat/composer/use-draft.ts +31 -2
- package/src/client/hooks/chat/timeline/row-window.test.ts +15 -2
- package/src/client/hooks/editor/use-document-annotations.ts +124 -0
- package/src/client/hooks/editor/use-editor-panel-ui.ts +52 -0
- package/src/client/hooks/editor/use-file-review-mode.ts +35 -0
- package/src/client/hooks/editor/use-preview-review.ts +148 -0
- package/src/client/hooks/settings/agents.ts +149 -0
- package/src/client/hooks/settings/crud-list.test.ts +28 -6
- package/src/client/hooks/settings/crud-list.ts +96 -57
- package/src/client/hooks/settings/omp-config.ts +164 -0
- package/src/client/hooks/settings/useTokenUsage.ts +125 -0
- package/src/client/hooks/settings/write-feedback.test.ts +104 -0
- package/src/client/hooks/settings/write-feedback.ts +63 -0
- package/src/client/hooks/ui/glass-support.ts +57 -0
- package/src/client/hooks/ui/icon-style.ts +59 -0
- package/src/client/hooks/ui/markdown-hydration.ts +125 -0
- package/src/client/hooks/ui/stuck-header.test.ts +188 -0
- package/src/client/hooks/ui/stuck-header.ts +91 -0
- package/src/client/hooks/ui/style-attributes.test.ts +120 -0
- package/src/client/hooks/ui/surface-style.ts +56 -0
- package/src/client/hooks/ui/updates/index.test.ts +100 -1
- package/src/client/hooks/ui/updates/index.ts +50 -0
- package/src/client/hooks/ui/updates/notes.test.ts +138 -0
- package/src/client/hooks/ui/updates/notes.ts +57 -0
- package/src/client/hooks/workspace/panel-hues.ts +23 -0
- package/src/client/lib/browser/element-at.test.ts +229 -0
- package/src/client/lib/browser/element-at.ts +139 -0
- package/src/client/lib/review/client.ts +73 -0
- package/src/client/lib/router/search-params.ts +42 -20
- package/src/client/main.tsx +10 -0
- package/src/client/tailwind.css +329 -11
- package/src/server/lib/assets/shell-attributes.server.ts +80 -0
- package/src/server/lib/assets/shell-attributes.test.ts +86 -0
- package/src/server/lib/btw/lifecycle.server.ts +2 -2
- package/src/server/lib/db/schema.ts +7 -0
- package/src/server/lib/db/seed-terminal.test.ts +4 -0
- package/src/server/lib/omp/config/agent-definitions.test.ts +273 -0
- package/src/server/lib/omp/config/agents.ts +231 -61
- package/src/server/lib/omp/config/definitions.test.ts +9 -105
- package/src/server/lib/omp/config/extensions.ts +16 -7
- package/src/server/lib/omp/config/omp-config-files.test.ts +27 -0
- package/src/server/lib/omp/rpc/constants.test.ts +11 -0
- package/src/server/lib/omp/rpc/constants.ts +15 -0
- package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +1 -0
- package/src/server/lib/omp/rpc/frame-fold-signals.test.ts +2 -30
- package/src/server/lib/omp/rpc/frame-fold.test.ts +55 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
- package/src/server/lib/omp/rpc/manager.ts +2 -2
- package/src/server/lib/omp/rpc/process-helpers.ts +11 -0
- package/src/server/lib/omp/rpc/process.test.ts +106 -0
- package/src/server/lib/omp/rpc/process.ts +39 -18
- package/src/server/lib/omp/rpc/run-settle.server.ts +12 -0
- package/src/server/lib/omp/rpc/run-settle.test.ts +22 -0
- package/src/server/lib/omp/rpc/session-command-guards.ts +5 -0
- package/src/server/lib/omp/rpc/session-commands.test.ts +9 -1
- package/src/server/lib/omp/rpc/session-commands.ts +17 -3
- package/src/server/lib/omp/rpc/terminal-settle.ts +29 -7
- package/src/server/lib/omp/rpc/utility-agent-dir.test.ts +134 -0
- package/src/server/lib/omp/rpc/utility-agent-dir.ts +138 -0
- package/src/server/lib/omp/rpc/utility.ts +12 -0
- package/src/server/lib/panels/bundled-catalog.server.ts +1 -0
- package/src/server/lib/panels/manifest.test.ts +20 -0
- package/src/server/lib/panels/manifest.ts +12 -0
- package/src/server/lib/panels/scan.server.ts +4 -0
- package/src/server/lib/queue/delivery-dispatch.server.test.ts +48 -0
- package/src/server/lib/queue/delivery-harness.ts +8 -4
- package/src/server/lib/queue/delivery.server.test.ts +29 -0
- package/src/server/lib/queue/delivery.server.ts +39 -0
- package/src/server/lib/queue/store.server.test.ts +22 -2
- package/src/server/lib/queue/store.server.ts +33 -11
- package/src/server/lib/review/schema.server.ts +45 -0
- package/src/server/lib/review/store.server.ts +138 -0
- package/src/server/lib/terminal/attach-replay.test.ts +132 -0
- package/src/server/lib/terminal/output.test.ts +166 -0
- package/src/server/lib/terminal/output.ts +104 -0
- package/src/server/lib/terminal/runtime.server.ts +5 -0
- package/src/server/lib/terminal/send-result.test.ts +33 -0
- package/src/server/lib/terminal/send-result.ts +32 -0
- package/src/server/lib/terminal/session.server.ts +45 -11
- package/src/server/lib/terminal/store-liveness.test.ts +4 -0
- package/src/server/lib/updates/active-notes.test.ts +149 -0
- package/src/server/lib/updates/active-notes.ts +75 -0
- package/src/server/lib/updates/changelog-file.ts +42 -11
- package/src/server/lib/updates/changelog.test.ts +15 -1
- package/src/server/lib/updates/omp.ts +42 -15
- package/src/server/lib/updates/release-url.ts +27 -1
- package/src/server/lib/usage/index-parse.test.ts +200 -0
- package/src/server/lib/usage/index-parse.ts +178 -0
- package/src/server/lib/usage/index-query.server.ts +248 -0
- package/src/server/lib/usage/index-scan.server.ts +343 -0
- package/src/server/lib/usage/index-schema.server.ts +82 -0
- package/src/server/lib/usage/index.test.ts +234 -0
- package/src/server/lib/usage/providers.server.ts +4 -53
- package/src/server/plugins/ssr.ts +22 -5
- package/src/server/routes/browser/index.ts +3 -0
- package/src/server/routes/browser/stream.ts +31 -2
- package/src/server/routes/browser/tabs.test.ts +94 -0
- package/src/server/routes/browser/tabs.ts +85 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/review/bindings.ts +11 -0
- package/src/server/routes/review/index.ts +127 -0
- package/src/server/routes/review/routes.test.ts +191 -0
- package/src/server/routes/settings/agents.test.ts +180 -0
- package/src/server/routes/settings/agents.ts +95 -102
- package/src/server/routes/settings/mcp.test.ts +135 -0
- package/src/server/routes/settings/mcp.ts +14 -6
- package/src/server/routes/settings/settings-store-routes.test.ts +6 -113
- package/src/server/routes/telemetry/tokens.test.ts +145 -0
- package/src/server/routes/telemetry/tokens.ts +70 -149
- package/src/server/routes/terminal/ws.ts +6 -5
- package/src/server/routes/updates/index.ts +2 -0
- package/src/server/routes/updates/notes.ts +34 -0
- package/src/server/routes/updates/routes.test.ts +49 -0
- package/src/shared/lib/browser/annotate.test.ts +283 -0
- package/src/shared/lib/browser/annotate.ts +231 -0
- package/src/shared/lib/browser/browser-viewer.test.ts +26 -4
- package/src/shared/lib/browser/frame-gate.test.ts +91 -0
- package/src/shared/lib/browser/frame-gate.ts +69 -0
- package/src/shared/lib/browser/frame-params.test.ts +43 -0
- package/src/shared/lib/browser/frame-params.ts +60 -0
- package/src/shared/lib/browser/frame-pipeline.test.ts +132 -0
- package/src/shared/lib/browser/frame-pipeline.ts +80 -0
- package/src/shared/lib/browser/page-context.ts +60 -4
- package/src/shared/lib/browser/snapshot.test.ts +115 -0
- package/src/shared/lib/browser/snapshot.ts +112 -0
- package/src/shared/lib/browser/tab-close.test.ts +74 -0
- package/src/shared/lib/browser/tab-close.ts +77 -0
- package/src/shared/lib/browser/viewer.ts +45 -26
- package/src/shared/lib/chat/timeline/block-chrome.ts +19 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +17 -4
- package/src/shared/lib/chat/tool/artifact.ts +55 -20
- package/src/shared/lib/chat/tool/bash-facts.ts +96 -0
- package/src/shared/lib/chat/tool/minimized.test.ts +98 -0
- package/src/shared/lib/chat/tool/minimized.ts +64 -0
- package/src/shared/lib/chat/tool/summary.test.ts +28 -8
- package/src/shared/lib/chat/tool/summary.ts +3 -32
- package/src/shared/lib/icons/file-brand-color.ts +38 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +234 -0
- package/src/shared/lib/icons/icon-paint-css.ts +284 -0
- package/src/shared/lib/icons/icon-paint-panel.ts +100 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +230 -0
- package/src/shared/lib/icons/tint.test.ts +273 -0
- package/src/shared/lib/icons/tint.ts +219 -0
- package/src/shared/lib/markdown/blocks/anchor.ts +63 -0
- package/src/shared/lib/markdown/blocks/blocks.test.ts +141 -0
- package/src/shared/lib/markdown/blocks/renderer.ts +120 -0
- package/src/shared/lib/markdown/blocks/scan.ts +100 -0
- package/src/shared/lib/markdown/blocks/types.ts +62 -0
- package/src/shared/lib/markdown/marked.ts +58 -147
- package/src/shared/lib/markdown/math-extensions.ts +168 -0
- package/src/shared/lib/markdown/review/prompt.ts +77 -0
- package/src/shared/lib/markdown/review/reconcile.ts +55 -0
- package/src/shared/lib/markdown/review/review.test.ts +96 -0
- package/src/shared/lib/markdown/xml-sections.test.ts +140 -0
- package/src/shared/lib/markdown/xml-sections.ts +139 -0
- package/src/shared/lib/models/provider/brand-color.test.ts +116 -0
- package/src/shared/lib/models/provider/brand-color.ts +103 -0
- package/src/shared/lib/models/provider/label.ts +57 -0
- package/src/shared/lib/omp/config/agent-file.test.ts +54 -0
- package/src/shared/lib/omp/config/agent-file.ts +43 -0
- package/src/shared/lib/omp/config/row-value.test.ts +95 -0
- package/src/shared/lib/omp/config/row-value.ts +97 -0
- package/src/shared/lib/omp/config/schema.test.ts +31 -0
- package/src/shared/lib/omp/config/schema.ts +6 -0
- package/src/shared/lib/omp/rpc/frame.test.ts +113 -47
- package/src/shared/lib/omp/rpc/frame.ts +107 -43
- package/src/shared/lib/settings/defaults.ts +4 -0
- package/src/shared/lib/theme/catalog.test.ts +5 -4
- package/src/shared/lib/theme/catalog.ts +18 -3
- package/src/shared/lib/theme/glass-support.test.ts +38 -0
- package/src/shared/lib/theme/glass-support.ts +73 -0
- package/src/shared/lib/theme/icon-style.test.ts +74 -0
- package/src/shared/lib/theme/icon-style.ts +90 -0
- package/src/shared/lib/theme/legibility.ts +91 -0
- package/src/shared/lib/theme/palettes/dark-extended.ts +152 -0
- package/src/shared/lib/theme/palettes/light-extended.ts +157 -0
- package/src/shared/lib/theme/surface-style.test.ts +68 -0
- package/src/shared/lib/theme/surface-style.ts +91 -0
- package/src/shared/lib/theme/theme.test.ts +11 -7
- package/src/shared/lib/ui/menu-anchor.test.ts +69 -0
- package/src/shared/lib/ui/menu-anchor.ts +89 -0
- package/src/shared/lib/usage/breakdown.test.ts +197 -0
- package/src/shared/lib/usage/breakdown.ts +241 -0
- package/src/shared/lib/usage/range.test.ts +204 -0
- package/src/shared/lib/usage/range.ts +240 -0
- package/src/shared/lib/usage/view.test.ts +85 -0
- package/src/shared/lib/usage/view.ts +74 -0
- package/src/shared/lib/workspace/panel-hues.test.ts +68 -0
- package/src/shared/lib/workspace/panel-hues.ts +57 -0
- package/src/shared/types/browser.ts +78 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/panels-registry.ts +6 -0
- package/src/shared/types/panels.ts +14 -0
- package/src/shared/types/settings/agent.ts +28 -6
- package/src/shared/types/settings/state.ts +30 -3
- package/src/shared/types/settings/write.ts +6 -0
- package/src/shared/types/tokenUsage.ts +128 -21
- package/src/shared/types/updates.ts +20 -0
- package/src/test-support/fake-omp-frames.ts +163 -0
- package/dist/client/static/js/index-3ve31rzx.css +0 -1
- package/src/server/lib/omp/session/usage/aggregate-shaping.test.ts +0 -149
- package/src/server/lib/omp/session/usage/aggregate.test.ts +0 -243
- package/src/server/lib/omp/session/usage/aggregate.ts +0 -330
- package/src/server/lib/omp/session/usage/shaping.ts +0 -130
- /package/src/{client/components/common/file-icon/brand-paths.ts → shared/lib/icons/file-brand-paths.ts} +0 -0
|
@@ -26,11 +26,13 @@
|
|
|
26
26
|
* `rgb(138,138,138)` in both the inactive and the active state, against a
|
|
27
27
|
* built-in's `text-ink/40` → `text-ink`.
|
|
28
28
|
*
|
|
29
|
-
* A mask has no document to inherit into, so the host supplies the paint
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* A mask has no document to inherit into, so the host supplies the paint and the
|
|
30
|
+
* file supplies only its alpha channel. That paint is `var(--plugin-color,
|
|
31
|
+
* currentColor)`: monochrome resolves to the ink the mask always used, and
|
|
32
|
+
* `[data-icon-style="color"]` defines `--plugin-color` from a hue derived from
|
|
33
|
+
* the plugin's own name — so a marketplace mark gets its own colour without the
|
|
34
|
+
* host guessing one at build time, and without the component reading the mode
|
|
35
|
+
* from JavaScript.
|
|
34
36
|
*
|
|
35
37
|
* A RASTER mark keeps the `<img>`. Masking a PNG or a JPEG would throw away its
|
|
36
38
|
* colour — a brand logo the plugin chose to ship — and a JPEG has no alpha to
|
|
@@ -38,17 +40,41 @@
|
|
|
38
40
|
*/
|
|
39
41
|
|
|
40
42
|
import { providerInitials } from '@/shared/lib/models/provider/glyph';
|
|
43
|
+
import { hashHue } from '@/shared/lib/icons/tint';
|
|
44
|
+
import { legiblePair } from '@/shared/lib/theme/legibility';
|
|
41
45
|
|
|
42
46
|
interface PluginMarkProps {
|
|
43
47
|
name: string;
|
|
44
48
|
/** The registry's content-addressed icon URL, when the plugin declares one. */
|
|
45
49
|
iconUrl?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The mark colour the plugin's manifest declares (`color`), when it does.
|
|
52
|
+
*
|
|
53
|
+
* Set as a custom property pair (`--plugin-declared-light`/`-dark`), not as a
|
|
54
|
+
* colour, so the STYLE still decides whether it is used: `monochrome` leaves
|
|
55
|
+
* the mark in the palette ink, and the declared brand colour only appears under
|
|
56
|
+
* `[data-icon-style="color"]`. Two values because a brand hex is legible on one
|
|
57
|
+
* variant and not the other; `legiblePair` derives both.
|
|
58
|
+
*/
|
|
59
|
+
color?: string;
|
|
46
60
|
size?: number;
|
|
47
61
|
/** Filled background behind the fallback, for a card that wants a tile. */
|
|
48
62
|
tile?: boolean;
|
|
49
63
|
}
|
|
50
64
|
|
|
51
|
-
export function PluginMark({ name, iconUrl, size = 16, tile = false }: PluginMarkProps) {
|
|
65
|
+
export function PluginMark({ name, iconUrl, color, size = 16, tile = false }: PluginMarkProps) {
|
|
66
|
+
// The mark's own colour, on the same wheel as every functional glyph. Set as a
|
|
67
|
+
// custom property rather than a colour so the STYLE decides whether it is used:
|
|
68
|
+
// monochrome leaves `--plugin-color` undefined and the mark keeps the ink.
|
|
69
|
+
// A declared brand colour is clamped the way every other brand mark is
|
|
70
|
+
// (`legiblePair`): a bright hex like `#34d399` is 1.9:1 on white paper, so the
|
|
71
|
+
// light and dark values are derived instead of trusted.
|
|
72
|
+
const declared = color ? legiblePair(color) : null;
|
|
73
|
+
const hue = {
|
|
74
|
+
'--icon-hue': String(hashHue(name)),
|
|
75
|
+
...(declared ? { '--plugin-declared-light': declared.light } : {}),
|
|
76
|
+
...(declared?.dark ? { '--plugin-declared-dark': declared.dark } : {}),
|
|
77
|
+
} as Record<string, string>;
|
|
52
78
|
if (iconUrl) {
|
|
53
79
|
// The QUERY is stripped before the extension is read: the registry's URL is
|
|
54
80
|
// `/api/panels/icon/<plugin>/<path>?v=<hash>`, so the extension is on the
|
|
@@ -59,13 +85,15 @@ export function PluginMark({ name, iconUrl, size = 16, tile = false }: PluginMar
|
|
|
59
85
|
return (
|
|
60
86
|
<span
|
|
61
87
|
aria-hidden="true"
|
|
88
|
+
data-plugin-mark=""
|
|
62
89
|
className="inline-block flex-shrink-0"
|
|
63
90
|
style={{
|
|
91
|
+
...hue,
|
|
64
92
|
width: size,
|
|
65
93
|
height: size,
|
|
66
|
-
// The ink the mask is cut out of
|
|
67
|
-
//
|
|
68
|
-
backgroundColor: 'currentColor',
|
|
94
|
+
// The ink the mask is cut out of — or the plugin's own colour, which
|
|
95
|
+
// `[data-icon-style="color"]` supplies through `--plugin-color`.
|
|
96
|
+
backgroundColor: 'var(--plugin-color, currentColor)',
|
|
69
97
|
maskImage: `url("${iconUrl}")`,
|
|
70
98
|
maskSize: 'contain',
|
|
71
99
|
maskRepeat: 'no-repeat',
|
|
@@ -98,10 +126,15 @@ export function PluginMark({ name, iconUrl, size = 16, tile = false }: PluginMar
|
|
|
98
126
|
return (
|
|
99
127
|
<span
|
|
100
128
|
aria-hidden="true"
|
|
101
|
-
|
|
129
|
+
data-plugin-mark=""
|
|
130
|
+
className={`inline-flex flex-shrink-0 items-center justify-center font-semibold lowercase leading-none ${
|
|
102
131
|
tile ? 'rounded bg-ink/5' : ''
|
|
103
132
|
}`}
|
|
104
133
|
style={{
|
|
134
|
+
...hue,
|
|
135
|
+
// 45% of the palette ink is what `text-ink/45` meant; stated as a value
|
|
136
|
+
// so the colour mode can replace it without a second class.
|
|
137
|
+
color: 'var(--plugin-color, color-mix(in srgb, var(--theme-ink) 45%, transparent))',
|
|
105
138
|
height: size,
|
|
106
139
|
minWidth: size,
|
|
107
140
|
paddingInline: Math.max(1, Math.round(size * 0.12)),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { useEffect, useState } from 'preact/hooks';
|
|
2
3
|
import { ExternalLink, RotateCcw, Trash2 } from 'lucide-preact';
|
|
3
4
|
import type { PluginFeatureSpec, PluginItem } from '@/shared/types';
|
|
@@ -268,7 +269,7 @@ function FeaturesSection({
|
|
|
268
269
|
: prev.filter((name) => name !== feature.name),
|
|
269
270
|
)
|
|
270
271
|
}
|
|
271
|
-
className=
|
|
272
|
+
className={`${CHECKBOX_CLASS} mt-0.5 accent-ink cursor-pointer disabled:opacity-60`}
|
|
272
273
|
/>
|
|
273
274
|
<span className="min-w-0">
|
|
274
275
|
<span className="text-xs font-medium text-ink font-mono">{feature.name}</span>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { useEffect, useState } from 'preact/hooks';
|
|
2
3
|
import { Check, ChevronDown, ChevronRight, KeyRound } from 'lucide-preact';
|
|
3
4
|
import type { PluginItem, PluginSettingSpec } from '@/shared/types';
|
|
@@ -172,7 +173,7 @@ function SettingInput({
|
|
|
172
173
|
checked={value === 'true'}
|
|
173
174
|
disabled={disabled}
|
|
174
175
|
onChange={(event) => onChange(event.currentTarget.checked ? 'true' : 'false')}
|
|
175
|
-
className=
|
|
176
|
+
className={`${CHECKBOX_CLASS} accent-ink cursor-pointer`}
|
|
176
177
|
/>
|
|
177
178
|
<span className="text-[11px] text-ink/70">{value === 'true' ? 'true' : 'false'}</span>
|
|
178
179
|
</label>
|
|
@@ -95,7 +95,7 @@ export function ProjectModelDropdown({
|
|
|
95
95
|
</button>
|
|
96
96
|
|
|
97
97
|
{isOpen && (
|
|
98
|
-
<div className="absolute right-0 mt-1 w-[288px] bg-paper border border-ink/15 rounded-lg shadow-xl z-50 overflow-hidden">
|
|
98
|
+
<div className="glass-popover absolute right-0 mt-1 w-[288px] bg-paper border border-ink/15 rounded-lg shadow-xl z-50 overflow-hidden">
|
|
99
99
|
<div className="flex items-center gap-1.5 px-2.5 py-2 border-b border-ink/10">
|
|
100
100
|
<Search size={12} className="text-ink/40 shrink-0" />
|
|
101
101
|
<input
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* the next create uses — including one started by a scheduled task.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
21
22
|
import { useState } from 'preact/hooks';
|
|
22
23
|
import { readKabmoSetting, writeSetting } from '@/shared/lib/settings/client';
|
|
23
24
|
import { useWorktrees } from '@/client/hooks/workspace/worktree/index';
|
|
@@ -131,7 +132,7 @@ export function WorktreeSettings({ root, folderId, onReport }: WorktreeSettingsP
|
|
|
131
132
|
setCarry(next);
|
|
132
133
|
writeSetting(WORKTREE_CARRY_SETTING, next);
|
|
133
134
|
}}
|
|
134
|
-
className=
|
|
135
|
+
className={`${CHECKBOX_CLASS} mt-0.5`}
|
|
135
136
|
/>
|
|
136
137
|
<span className="flex flex-col gap-0.5">
|
|
137
138
|
<span className="text-xs font-semibold text-ink">Copy ignored files into new worktrees</span>
|
|
@@ -56,14 +56,14 @@ export function DeleteProviderModal({
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<div
|
|
59
|
-
className="fixed inset-0 z-[70] flex items-center justify-center
|
|
59
|
+
className="fixed inset-0 z-[70] flex items-center justify-center modal-scrim backdrop-blur-[2px] p-4"
|
|
60
60
|
onClick={isDeleting ? undefined : onClose}
|
|
61
61
|
role="dialog"
|
|
62
62
|
aria-modal="true"
|
|
63
63
|
aria-label="Confirm provider deletion"
|
|
64
64
|
>
|
|
65
65
|
<div
|
|
66
|
-
className="bg-paper border border-ink/20 rounded-xl shadow-2xl w-[min(94vw,460px)] max-h-full overflow-y-auto scrollbar-overlay-container text-ink"
|
|
66
|
+
className="glass-overlay bg-paper border border-ink/20 rounded-xl shadow-2xl w-[min(94vw,460px)] max-h-full overflow-y-auto scrollbar-overlay-container text-ink"
|
|
67
67
|
onClick={(e) => e.stopPropagation()}
|
|
68
68
|
>
|
|
69
69
|
<div className="flex items-center gap-3 px-5 py-4 border-b border-ink/10">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { Plus, X } from 'lucide-preact';
|
|
2
3
|
import { PROVIDER_DISCOVERY_TYPES } from '@/shared/lib/models/provider/dialect';
|
|
3
4
|
import type { ProviderDiscoveryType } from '@/shared/types/settings/provider';
|
|
@@ -95,7 +96,7 @@ export function EntryAdvanced({
|
|
|
95
96
|
type="checkbox"
|
|
96
97
|
checked={discovery.injectV1 === true}
|
|
97
98
|
onChange={(e) => patch({ injectV1: e.currentTarget.checked })}
|
|
98
|
-
className=
|
|
99
|
+
className={`${CHECKBOX_CLASS} mt-0.5`}
|
|
99
100
|
/>
|
|
100
101
|
<span>
|
|
101
102
|
Skip the forced <span className="font-mono">/v1</span> prefix — for a gateway rooted at a
|
|
@@ -109,7 +110,7 @@ export function EntryAdvanced({
|
|
|
109
110
|
type="checkbox"
|
|
110
111
|
checked={discovery.advertisedReasoning === true}
|
|
111
112
|
onChange={(e) => patch({ advertisedReasoning: e.currentTarget.checked })}
|
|
112
|
-
className=
|
|
113
|
+
className={`${CHECKBOX_CLASS} mt-0.5`}
|
|
113
114
|
/>
|
|
114
115
|
<span>Trust the reasoning ladder the endpoint advertises in its model rows.</span>
|
|
115
116
|
</label>
|
|
@@ -79,14 +79,14 @@ export function LogoutProviderModal({ isOpen, provider, onClose, onSignedOut }:
|
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
81
|
<div
|
|
82
|
-
className="fixed inset-0 z-[70] flex items-center justify-center
|
|
82
|
+
className="fixed inset-0 z-[70] flex items-center justify-center modal-scrim backdrop-blur-[2px] p-4"
|
|
83
83
|
onClick={busyId !== null ? undefined : onClose}
|
|
84
84
|
role="dialog"
|
|
85
85
|
aria-modal="true"
|
|
86
86
|
aria-label="Confirm sign out"
|
|
87
87
|
>
|
|
88
88
|
<div
|
|
89
|
-
className="bg-paper border border-ink/20 rounded-xl shadow-2xl w-[min(94vw,480px)] max-h-full overflow-y-auto scrollbar-overlay-container text-ink"
|
|
89
|
+
className="glass-overlay bg-paper border border-ink/20 rounded-xl shadow-2xl w-[min(94vw,480px)] max-h-full overflow-y-auto scrollbar-overlay-container text-ink"
|
|
90
90
|
onClick={(e) => e.stopPropagation()}
|
|
91
91
|
>
|
|
92
92
|
<div className="flex items-center gap-3 px-5 py-4 border-b border-ink/10">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import { useEffect, useState } from 'preact/hooks';
|
|
2
3
|
import type { ComponentChildren } from 'preact';
|
|
3
4
|
import { AlertCircle, Check, GitBranch, Loader2, Search } from 'lucide-preact';
|
|
@@ -123,7 +124,7 @@ export function GitImportPanel({ controller, onInstalled }: GitImportPanelProps)
|
|
|
123
124
|
checked={isSelected}
|
|
124
125
|
disabled={Boolean(blocked)}
|
|
125
126
|
onChange={() => controller.toggle(skill.path)}
|
|
126
|
-
className=
|
|
127
|
+
className={`${CHECKBOX_CLASS} mt-0.5 accent-ink cursor-pointer disabled:cursor-not-allowed`}
|
|
127
128
|
/>
|
|
128
129
|
<div className="min-w-0 flex-1">
|
|
129
130
|
<div className="flex items-center gap-2 min-w-0">
|
|
@@ -190,7 +191,7 @@ export function GitImportPanel({ controller, onInstalled }: GitImportPanelProps)
|
|
|
190
191
|
type="checkbox"
|
|
191
192
|
checked={overwrite}
|
|
192
193
|
onChange={(event) => controller.setOverwrite(event.currentTarget.checked)}
|
|
193
|
-
className=
|
|
194
|
+
className={`${CHECKBOX_CLASS} mt-0.5 accent-ink cursor-pointer`}
|
|
194
195
|
/>
|
|
195
196
|
<span className="text-[11px] text-ink/70 leading-relaxed">
|
|
196
197
|
Replace skills that already have the same name
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { CHECKBOX_CLASS } from '@/client/components/common/checkbox/style';
|
|
1
2
|
import type { ComponentChildren } from 'preact';
|
|
2
|
-
import { Check, Eye, EyeOff, Lock, RefreshCw, Save, Sparkles, Trash2 } from 'lucide-preact';
|
|
3
|
+
import { AlertCircle, Check, Eye, EyeOff, Loader2, Lock, RefreshCw, Save, Sparkles, Trash2 } from 'lucide-preact';
|
|
3
4
|
import type { SkillItem } from '@/shared/types';
|
|
4
5
|
import { scopeLabel, sourceBadge } from '@/client/components/settings/categories/skill-settings/row-meta';
|
|
5
6
|
|
|
@@ -21,6 +22,13 @@ interface SkillDetailHeaderProps {
|
|
|
21
22
|
onConfirmDelete: () => void;
|
|
22
23
|
onCancelDelete: () => void;
|
|
23
24
|
onSave: () => void;
|
|
25
|
+
/** A write is in flight: the buttons report that instead of accepting another. */
|
|
26
|
+
saving?: boolean;
|
|
27
|
+
/** The last write landed (flashes briefly). */
|
|
28
|
+
saved?: boolean;
|
|
29
|
+
/** The last write's refusal, in the server's own words. */
|
|
30
|
+
writeError?: string | null;
|
|
31
|
+
onDismissWriteError?: () => void;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
function Badge({ children, title }: { children: ComponentChildren; title?: string }) {
|
|
@@ -60,6 +68,10 @@ export function SkillDetailHeader({
|
|
|
60
68
|
onConfirmDelete,
|
|
61
69
|
onCancelDelete,
|
|
62
70
|
onSave,
|
|
71
|
+
saving = false,
|
|
72
|
+
saved = false,
|
|
73
|
+
writeError = null,
|
|
74
|
+
onDismissWriteError,
|
|
63
75
|
}: SkillDetailHeaderProps) {
|
|
64
76
|
const title = isCreatingNew ? 'New skill' : (skill?.name ?? name);
|
|
65
77
|
|
|
@@ -136,7 +148,7 @@ export function SkillDetailHeader({
|
|
|
136
148
|
checked={hidden}
|
|
137
149
|
disabled={readOnly}
|
|
138
150
|
onChange={(event) => onHiddenChange(event.currentTarget.checked)}
|
|
139
|
-
className=
|
|
151
|
+
className={`${CHECKBOX_CLASS} mt-0.5 accent-ink cursor-pointer disabled:cursor-not-allowed`}
|
|
140
152
|
/>
|
|
141
153
|
<span className="text-[11px] text-ink/75 leading-relaxed">
|
|
142
154
|
<span className="inline-flex items-center gap-1">
|
|
@@ -151,6 +163,18 @@ export function SkillDetailHeader({
|
|
|
151
163
|
|
|
152
164
|
{validationError ? <p className="text-[11px] text-error leading-relaxed">{validationError}</p> : null}
|
|
153
165
|
|
|
166
|
+
{writeError ? (
|
|
167
|
+
<div className="flex items-start gap-1.5 rounded-lg border border-error/30 bg-error/5 px-2.5 py-2 text-[11px] text-error">
|
|
168
|
+
<AlertCircle size={12} className="mt-px flex-shrink-0" />
|
|
169
|
+
<span className="flex-1 break-words">{writeError}</span>
|
|
170
|
+
{onDismissWriteError ? (
|
|
171
|
+
<button type="button" onClick={onDismissWriteError} className="cursor-pointer text-error/60 hover:text-error" aria-label="Dismiss error">
|
|
172
|
+
×
|
|
173
|
+
</button>
|
|
174
|
+
) : null}
|
|
175
|
+
</div>
|
|
176
|
+
) : null}
|
|
177
|
+
|
|
154
178
|
<div className="flex items-center justify-between gap-2">
|
|
155
179
|
{!isCreatingNew && skill && !readOnly ? (
|
|
156
180
|
confirmingDelete ? (
|
|
@@ -188,19 +212,24 @@ export function SkillDetailHeader({
|
|
|
188
212
|
<button
|
|
189
213
|
type="button"
|
|
190
214
|
onClick={onSave}
|
|
191
|
-
disabled={Boolean(validationError) || (!dirty && !isCreatingNew)}
|
|
192
|
-
className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-ink text-paper text-[11px] font-medium hover:bg-ink/90 disabled:opacity-40 transition-colors cursor-pointer"
|
|
215
|
+
disabled={saving || Boolean(validationError) || (!dirty && !isCreatingNew)}
|
|
216
|
+
className="flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-ink text-paper text-[11px] font-medium hover:bg-ink/90 disabled:opacity-40 transition-colors cursor-pointer disabled:cursor-not-allowed"
|
|
193
217
|
>
|
|
194
|
-
<Save size={12} />
|
|
195
|
-
<span>{isCreatingNew ? 'Create skill' : 'Save changes'}</span>
|
|
218
|
+
{saving ? <Loader2 size={12} className="animate-spin" /> : <Save size={12} />}
|
|
219
|
+
<span>{saving ? 'Saving…' : isCreatingNew ? 'Create skill' : 'Save changes'}</span>
|
|
196
220
|
</button>
|
|
197
221
|
) : null}
|
|
198
222
|
</div>
|
|
199
223
|
|
|
200
|
-
{
|
|
224
|
+
{saved ? (
|
|
225
|
+
<p className="flex items-center gap-1 text-[10px] text-ink/60">
|
|
226
|
+
<Check size={10} />
|
|
227
|
+
Saved
|
|
228
|
+
</p>
|
|
229
|
+
) : !readOnly && !dirty && !isCreatingNew ? (
|
|
201
230
|
<p className="flex items-center gap-1 text-[10px] text-ink/40">
|
|
202
231
|
<Check size={10} />
|
|
203
|
-
|
|
232
|
+
Nothing to write
|
|
204
233
|
</p>
|
|
205
234
|
) : null}
|
|
206
235
|
</div>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from 'preact/hooks';
|
|
2
2
|
import { Info } from 'lucide-preact';
|
|
3
|
-
import type { SkillItem } from '@/shared/types';
|
|
3
|
+
import type { SkillItem, WriteOutcome } from '@/shared/types';
|
|
4
|
+
import { useWriteFeedback } from '@/client/hooks/settings/write-feedback';
|
|
4
5
|
import { SkillDetailHeader } from '@/client/components/settings/categories/skill-settings/DetailHeader';
|
|
5
6
|
import { InstructionsEditor } from '@/client/components/settings/categories/skill-settings/InstructionsEditor';
|
|
6
7
|
|
|
7
8
|
interface SkillDetailPaneProps {
|
|
8
9
|
skill: SkillItem | null;
|
|
9
10
|
isCreatingNew: boolean;
|
|
10
|
-
onSave: (skillData: Partial<SkillItem>) =>
|
|
11
|
-
onDelete?: (id: string) =>
|
|
11
|
+
onSave: (skillData: Partial<SkillItem>) => Promise<WriteOutcome>;
|
|
12
|
+
onDelete?: (id: string) => Promise<WriteOutcome>;
|
|
12
13
|
onOpenCatalog?: () => void;
|
|
13
14
|
onReload?: () => void;
|
|
14
15
|
isReloading?: boolean;
|
|
@@ -51,6 +52,7 @@ export function SkillDetailPane({
|
|
|
51
52
|
const [showLineNumbers, setShowLineNumbers] = useState(true);
|
|
52
53
|
const [confirmingDelete, setConfirmingDelete] = useState(false);
|
|
53
54
|
const [savedAt, setSavedAt] = useState(0);
|
|
55
|
+
const feedback = useWriteFeedback();
|
|
54
56
|
|
|
55
57
|
const readOnly = !isCreatingNew && skill != null && skill.managed !== true;
|
|
56
58
|
const locationLabel = location === 'project' ? 'Project / .omp/skills' : 'User / omp agent';
|
|
@@ -95,17 +97,31 @@ export function SkillDetailPane({
|
|
|
95
97
|
return null;
|
|
96
98
|
}, [name, description, readOnly]);
|
|
97
99
|
|
|
100
|
+
// The timestamp is set from the WRITE'S answer, not the click: a refused save
|
|
101
|
+
// (a duplicate name, a read-only file) used to print "Last saved <time>".
|
|
98
102
|
const handleSave = () => {
|
|
99
|
-
if (readOnly || validationError) return;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
if (readOnly || validationError || feedback.saving) return;
|
|
104
|
+
void feedback.run(async () => {
|
|
105
|
+
const outcome = await onSave({
|
|
106
|
+
name: name.trim(),
|
|
107
|
+
description: description.trim(),
|
|
108
|
+
location,
|
|
109
|
+
locationLabel,
|
|
110
|
+
instructions: draftBody(instructions),
|
|
111
|
+
hidden,
|
|
112
|
+
});
|
|
113
|
+
if (outcome.ok) setSavedAt(Date.now());
|
|
114
|
+
return outcome;
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const handleDelete = () => {
|
|
119
|
+
if (!skill || !onDelete) return;
|
|
120
|
+
void feedback.run(async () => {
|
|
121
|
+
const outcome = await onDelete(skill.id);
|
|
122
|
+
if (!outcome.ok) setConfirmingDelete(false);
|
|
123
|
+
return outcome;
|
|
107
124
|
});
|
|
108
|
-
setSavedAt(Date.now());
|
|
109
125
|
};
|
|
110
126
|
|
|
111
127
|
return (
|
|
@@ -128,9 +144,13 @@ export function SkillDetailPane({
|
|
|
128
144
|
onCancelDelete={() => setConfirmingDelete(false)}
|
|
129
145
|
onConfirmDelete={() => {
|
|
130
146
|
setConfirmingDelete(false);
|
|
131
|
-
|
|
147
|
+
handleDelete();
|
|
132
148
|
}}
|
|
133
149
|
onSave={handleSave}
|
|
150
|
+
saving={feedback.saving}
|
|
151
|
+
saved={feedback.saved}
|
|
152
|
+
writeError={feedback.error}
|
|
153
|
+
onDismissWriteError={feedback.dismissError}
|
|
134
154
|
/>
|
|
135
155
|
|
|
136
156
|
{!readOnly ? (
|
|
@@ -204,7 +224,7 @@ export function SkillDetailPane({
|
|
|
204
224
|
onToggleLineNumbers={() => setShowLineNumbers(!showLineNumbers)}
|
|
205
225
|
/>
|
|
206
226
|
|
|
207
|
-
{savedAt > 0 && !dirty ? (
|
|
227
|
+
{savedAt > 0 && !dirty && !feedback.error ? (
|
|
208
228
|
<p className="text-[10px] text-ink/40">
|
|
209
229
|
Last saved {new Date(savedAt).toLocaleTimeString()} — omp sessions were told to reload their skills.
|
|
210
230
|
</p>
|
|
@@ -23,6 +23,9 @@ interface SkillSidebarListProps {
|
|
|
23
23
|
onSelectProject: (project: string) => void;
|
|
24
24
|
/** Real workspace folders; defaults to the shared placeholder list. */
|
|
25
25
|
projectOptions?: ProjectOption[];
|
|
26
|
+
/** Why the list could not be read, and how to try again. */
|
|
27
|
+
loadError?: string;
|
|
28
|
+
onRetry?: () => void;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
/**
|
|
@@ -43,6 +46,8 @@ export function SkillSidebarList({
|
|
|
43
46
|
selectedProject,
|
|
44
47
|
onSelectProject,
|
|
45
48
|
projectOptions,
|
|
49
|
+
loadError,
|
|
50
|
+
onRetry,
|
|
46
51
|
}: SkillSidebarListProps) {
|
|
47
52
|
const [collapsedGroups, setCollapsedGroups] = useState<Record<string, boolean>>({});
|
|
48
53
|
const [query, setQuery] = useState('');
|
|
@@ -134,6 +139,22 @@ export function SkillSidebarList({
|
|
|
134
139
|
</div>
|
|
135
140
|
|
|
136
141
|
<div className="flex-1 scrollbar-overlay-container p-1.5 space-y-2">
|
|
142
|
+
{loadError ? (
|
|
143
|
+
<div className="mx-1 rounded-lg border border-error/30 bg-error/5 px-2.5 py-2 text-[11px] leading-snug text-error">
|
|
144
|
+
<div className="font-semibold">Could not read the skills</div>
|
|
145
|
+
<div className="mt-0.5 break-words text-error/80">{loadError}</div>
|
|
146
|
+
{onRetry ? (
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
onClick={onRetry}
|
|
150
|
+
className="mt-1.5 rounded border border-error/40 px-2 py-0.5 font-medium hover:bg-error/10 cursor-pointer"
|
|
151
|
+
>
|
|
152
|
+
Retry
|
|
153
|
+
</button>
|
|
154
|
+
) : null}
|
|
155
|
+
</div>
|
|
156
|
+
) : null}
|
|
157
|
+
|
|
137
158
|
{isCreatingNew ? (
|
|
138
159
|
<div className="px-2.5 py-1.5 rounded-lg bg-ink/10 text-ink font-medium text-xs">new-skill</div>
|
|
139
160
|
) : null}
|
|
@@ -22,7 +22,7 @@ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test
|
|
|
22
22
|
import { Window } from 'happy-dom';
|
|
23
23
|
import { h, render } from 'preact';
|
|
24
24
|
import { act } from 'preact/test-utils';
|
|
25
|
-
import type { SkillItem } from '@/shared/types';
|
|
25
|
+
import type { SkillItem, WriteOutcome } from '@/shared/types';
|
|
26
26
|
import {
|
|
27
27
|
SKILL_FILTERS,
|
|
28
28
|
filterCounts,
|
|
@@ -54,6 +54,15 @@ function mount(node: h.JSX.Element): HTMLElement {
|
|
|
54
54
|
return container;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/** A save the server accepts; the pane's badge is driven by this answer. */
|
|
58
|
+
const okSave = async (): Promise<WriteOutcome> => ({ ok: true });
|
|
59
|
+
|
|
60
|
+
/** Collect the drafts a pane sends, while answering like a healthy server. */
|
|
61
|
+
const okSaveTracking = (saved: Partial<SkillItem>[]) => async (draft: Partial<SkillItem>): Promise<WriteOutcome> => {
|
|
62
|
+
saved.push(draft);
|
|
63
|
+
return { ok: true };
|
|
64
|
+
};
|
|
65
|
+
|
|
57
66
|
function skill(overrides: Partial<SkillItem> = {}): SkillItem {
|
|
58
67
|
return {
|
|
59
68
|
id: 'omp-user-alpha',
|
|
@@ -117,12 +126,12 @@ describe('filterSkills and filterCounts', () => {
|
|
|
117
126
|
describe('SkillDetailPane', () => {
|
|
118
127
|
test('an unchanged draft cannot be saved', () => {
|
|
119
128
|
const el = mount(
|
|
120
|
-
h(SkillDetailPane, { skill: skill(), isCreatingNew: false, onSave:
|
|
129
|
+
h(SkillDetailPane, { skill: skill(), isCreatingNew: false, onSave: okSave }),
|
|
121
130
|
);
|
|
122
131
|
const save = [...el.querySelectorAll('button')].find((button) => button.textContent?.includes('Save changes'));
|
|
123
132
|
expect(save).toBeDefined();
|
|
124
133
|
expect((save as HTMLButtonElement).disabled).toBe(true);
|
|
125
|
-
expect(el.textContent).toContain('
|
|
134
|
+
expect(el.textContent).toContain('Nothing to write');
|
|
126
135
|
});
|
|
127
136
|
|
|
128
137
|
test('a draft missing its description reports that omp would not load it', () => {
|
|
@@ -130,7 +139,7 @@ describe('SkillDetailPane', () => {
|
|
|
130
139
|
h(SkillDetailPane, {
|
|
131
140
|
skill: skill({ description: '' }),
|
|
132
141
|
isCreatingNew: false,
|
|
133
|
-
onSave:
|
|
142
|
+
onSave: okSave,
|
|
134
143
|
}),
|
|
135
144
|
);
|
|
136
145
|
expect(el.textContent).toContain('omp does not load a SKILL.md without one');
|
|
@@ -140,7 +149,7 @@ describe('SkillDetailPane', () => {
|
|
|
140
149
|
|
|
141
150
|
test('a read-only skill offers no editor or save at all', () => {
|
|
142
151
|
const el = mount(
|
|
143
|
-
h(SkillDetailPane, { skill: skill({ managed: false, source: 'agents:user' }), isCreatingNew: false, onSave:
|
|
152
|
+
h(SkillDetailPane, { skill: skill({ managed: false, source: 'agents:user' }), isCreatingNew: false, onSave: okSave }),
|
|
144
153
|
);
|
|
145
154
|
expect(el.textContent).toContain('read-only');
|
|
146
155
|
expect(el.textContent).not.toContain('Save changes');
|
|
@@ -153,7 +162,7 @@ describe('SkillDetailPane', () => {
|
|
|
153
162
|
h(SkillDetailPane, {
|
|
154
163
|
skill: skill({ instructions: '---\ndescription: First skill\n---\n\ndo the thing\n' }),
|
|
155
164
|
isCreatingNew: false,
|
|
156
|
-
onSave: (
|
|
165
|
+
onSave: okSaveTracking(saved),
|
|
157
166
|
}),
|
|
158
167
|
);
|
|
159
168
|
// The pane has two textareas: the description and the SKILL.md body.
|