@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
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useState } from 'preact/hooks';
|
|
2
2
|
import type { FunctionComponent } from 'preact/compat';
|
|
3
|
-
import { AlertCircle, Code, X } from 'lucide-preact';
|
|
4
|
-
import type { McpEnvVar, McpServerItem } from '@/shared/types';
|
|
3
|
+
import { AlertCircle, Code, Loader2, X } from 'lucide-preact';
|
|
4
|
+
import type { McpEnvVar, McpServerItem, WriteOutcome } from '@/shared/types';
|
|
5
5
|
|
|
6
6
|
interface McpImportModalProps {
|
|
7
7
|
isOpen: boolean;
|
|
8
8
|
onClose: () => void;
|
|
9
|
-
|
|
9
|
+
/** Resolves with the save's outcome; a refusal keeps this dialog open. */
|
|
10
|
+
onImport: (server: McpServerItem) => Promise<WriteOutcome>;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const SAMPLE_JSON = `{
|
|
@@ -28,10 +29,11 @@ export const McpImportModal: FunctionComponent<McpImportModalProps> = ({
|
|
|
28
29
|
}) => {
|
|
29
30
|
const [jsonText, setJsonText] = useState(SAMPLE_JSON);
|
|
30
31
|
const [error, setError] = useState<string | null>(null);
|
|
32
|
+
const [importing, setImporting] = useState(false);
|
|
31
33
|
|
|
32
34
|
if (!isOpen) return null;
|
|
33
35
|
|
|
34
|
-
const handleParseAndImport = () => {
|
|
36
|
+
const handleParseAndImport = async () => {
|
|
35
37
|
setError(null);
|
|
36
38
|
try {
|
|
37
39
|
const parsed = JSON.parse(jsonText);
|
|
@@ -44,20 +46,20 @@ export const McpImportModal: FunctionComponent<McpImportModalProps> = ({
|
|
|
44
46
|
}
|
|
45
47
|
const firstKey = serverKeys[0];
|
|
46
48
|
const serverConfig = parsed.mcpServers[firstKey];
|
|
47
|
-
importConfig(firstKey, serverConfig);
|
|
49
|
+
await importConfig(firstKey, serverConfig);
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
// Handle direct config: { name, command, args, env } or { command, args }
|
|
52
54
|
const name = parsed.name || 'imported-mcp-server';
|
|
53
|
-
importConfig(name, parsed);
|
|
55
|
+
await importConfig(name, parsed);
|
|
54
56
|
} catch (err: unknown) {
|
|
55
57
|
const message = err instanceof Error ? err.message : 'Invalid JSON format';
|
|
56
58
|
setError(message);
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
|
|
60
|
-
const importConfig = (serverName: string, cfg: Record<string, unknown>) => {
|
|
62
|
+
const importConfig = async (serverName: string, cfg: Record<string, unknown>) => {
|
|
61
63
|
const isUrl = typeof cfg.url === 'string' && cfg.url.length > 0;
|
|
62
64
|
const reachType = isUrl ? 'link' : 'command';
|
|
63
65
|
|
|
@@ -82,6 +84,7 @@ export const McpImportModal: FunctionComponent<McpImportModalProps> = ({
|
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
const resolvedUrl = typeof cfg.url === 'string' ? cfg.url : undefined;
|
|
85
88
|
const newServer: McpServerItem = {
|
|
86
89
|
id: `mcp-${Date.now()}`,
|
|
87
90
|
name: serverName,
|
|
@@ -89,18 +92,26 @@ export const McpImportModal: FunctionComponent<McpImportModalProps> = ({
|
|
|
89
92
|
enabled: true,
|
|
90
93
|
reachType,
|
|
91
94
|
commandArgs,
|
|
92
|
-
|
|
95
|
+
...(resolvedUrl ? { linkUrl: resolvedUrl } : {}),
|
|
93
96
|
envVars,
|
|
94
97
|
status: 'active',
|
|
95
98
|
};
|
|
96
99
|
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
// The dialog closes on the SAVE's answer, not on the click: a refused
|
|
101
|
+
// write has to be readable against the JSON that produced it.
|
|
102
|
+
setImporting(true);
|
|
103
|
+
try {
|
|
104
|
+
const outcome = await onImport(newServer);
|
|
105
|
+
if (outcome.ok) onClose();
|
|
106
|
+
else setError(outcome.error ?? 'The server refused the import.');
|
|
107
|
+
} finally {
|
|
108
|
+
setImporting(false);
|
|
109
|
+
}
|
|
99
110
|
};
|
|
100
111
|
|
|
101
112
|
return (
|
|
102
|
-
<div className="fixed inset-0
|
|
103
|
-
<div className="w-full max-w-lg rounded-lg border border-ink/20 bg-paper text-ink p-5 shadow-2xl space-y-4 max-h-full overflow-y-auto scrollbar-overlay-container">
|
|
113
|
+
<div className="fixed inset-0 modal-scrim backdrop-blur-[2px] z-50 flex items-center justify-center p-4 animate-in fade-in duration-150">
|
|
114
|
+
<div className="glass-overlay w-full max-w-lg rounded-lg border border-ink/20 bg-paper text-ink p-5 shadow-2xl space-y-4 max-h-full overflow-y-auto scrollbar-overlay-container">
|
|
104
115
|
<div className="flex items-center justify-between pb-3 border-b border-ink/10">
|
|
105
116
|
<div className="flex items-center gap-2">
|
|
106
117
|
<Code className="w-4 h-4 text-ink/70" />
|
|
@@ -149,10 +160,12 @@ export const McpImportModal: FunctionComponent<McpImportModalProps> = ({
|
|
|
149
160
|
</button>
|
|
150
161
|
<button
|
|
151
162
|
type="button"
|
|
152
|
-
onClick={handleParseAndImport}
|
|
153
|
-
|
|
163
|
+
onClick={() => void handleParseAndImport()}
|
|
164
|
+
disabled={importing}
|
|
165
|
+
className="flex items-center gap-1.5 px-4 py-2 rounded-lg bg-ink text-paper text-xs font-medium hover:bg-ink/90 transition-colors shadow-xs cursor-pointer disabled:opacity-50 disabled:cursor-progress"
|
|
154
166
|
>
|
|
155
|
-
|
|
167
|
+
{importing && <Loader2 className="w-3.5 h-3.5 animate-spin" />}
|
|
168
|
+
{importing ? 'Importing…' : 'Import Server'}
|
|
156
169
|
</button>
|
|
157
170
|
</div>
|
|
158
171
|
</div>
|
|
@@ -17,6 +17,9 @@ interface McpSidebarListProps {
|
|
|
17
17
|
onAddNewServer: () => void;
|
|
18
18
|
selectedProject: string;
|
|
19
19
|
onChangeProject: (projectPath: string) => void;
|
|
20
|
+
/** Why the list could not be read, and how to try again. */
|
|
21
|
+
loadError?: string;
|
|
22
|
+
onRetry?: () => void;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export const McpSidebarList: FunctionComponent<McpSidebarListProps> = ({
|
|
@@ -27,6 +30,8 @@ export const McpSidebarList: FunctionComponent<McpSidebarListProps> = ({
|
|
|
27
30
|
onAddNewServer,
|
|
28
31
|
selectedProject,
|
|
29
32
|
onChangeProject,
|
|
33
|
+
loadError,
|
|
34
|
+
onRetry,
|
|
30
35
|
}) => {
|
|
31
36
|
const activeProjectName = projects.find((proj) => proj.path === selectedProject)?.name ?? 'Global (all projects)';
|
|
32
37
|
|
|
@@ -59,6 +64,21 @@ export const McpSidebarList: FunctionComponent<McpSidebarListProps> = ({
|
|
|
59
64
|
</div>
|
|
60
65
|
|
|
61
66
|
<div className="flex-1 scrollbar-overlay-container p-1.5 space-y-3 text-xs">
|
|
67
|
+
{loadError && (
|
|
68
|
+
<div className="mx-1 rounded-lg border border-error/30 bg-error/5 px-2.5 py-2 text-[11px] leading-snug text-error">
|
|
69
|
+
<div className="font-semibold">Could not read the list</div>
|
|
70
|
+
<div className="mt-0.5 break-words text-error/80">{loadError}</div>
|
|
71
|
+
{onRetry && (
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
onClick={onRetry}
|
|
75
|
+
className="mt-1.5 rounded border border-error/40 px-2 py-0.5 font-medium hover:bg-error/10 cursor-pointer"
|
|
76
|
+
>
|
|
77
|
+
Retry
|
|
78
|
+
</button>
|
|
79
|
+
)}
|
|
80
|
+
</div>
|
|
81
|
+
)}
|
|
62
82
|
<div>
|
|
63
83
|
<div className="px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider flex items-center justify-between">
|
|
64
84
|
<span>User Servers</span>
|
|
@@ -9,10 +9,18 @@
|
|
|
9
9
|
* condition holds against the live config snapshot and when the global
|
|
10
10
|
* search matches. Entries without UI metadata (upstream or extras) never
|
|
11
11
|
* render — matching upstream's own panel surface plus Kabmo extras.
|
|
12
|
+
*
|
|
13
|
+
* Search is a WHOLE-SCHEMA view, so the tab strip is replaced by its own
|
|
14
|
+
* summary line while a query is active: leaving the pills up made a tab click
|
|
15
|
+
* look broken, because results stay global and the highlighted tab changed
|
|
16
|
+
* nothing. Each tab carries its visible row count so an empty tab is
|
|
17
|
+
* recognisable before it is opened, and `Reset` is offered only for a key that
|
|
18
|
+
* config.yml actually holds — resetting an unset key wrote nothing and looked
|
|
19
|
+
* like a failure.
|
|
12
20
|
*/
|
|
13
21
|
|
|
14
22
|
import { useMemo } from 'preact/hooks';
|
|
15
|
-
import { Check, RotateCcw } from 'lucide-preact';
|
|
23
|
+
import { Check, RotateCcw, Search, X } from 'lucide-preact';
|
|
16
24
|
import type { ConfigEntry } from '@/server/lib/omp/config/config-cli';
|
|
17
25
|
import type { SchemaTab } from '@/shared/lib/omp/config/schema-types';
|
|
18
26
|
import { ALL_SCHEMA_ENTRIES, entriesForTab, isConditionMet, matchesSearch } from '@/shared/lib/omp/config/schema';
|
|
@@ -29,9 +37,11 @@ interface ConfigTabsProps {
|
|
|
29
37
|
saveErrors: Map<string, string>;
|
|
30
38
|
onCommit: (key: string, value: unknown) => Promise<boolean>;
|
|
31
39
|
onReset: (key: string) => Promise<boolean>;
|
|
32
|
-
onDirty: (key: string, dirty: boolean
|
|
40
|
+
onDirty: (key: string, dirty: boolean) => void;
|
|
33
41
|
}
|
|
34
42
|
|
|
43
|
+
const SEARCH_LIMIT = 80;
|
|
44
|
+
|
|
35
45
|
export function ConfigTabs({
|
|
36
46
|
tabs,
|
|
37
47
|
entries,
|
|
@@ -46,23 +56,33 @@ export function ConfigTabs({
|
|
|
46
56
|
onDirty,
|
|
47
57
|
}: ConfigTabsProps) {
|
|
48
58
|
const activeTab = tabs.find((tab) => tab.id === activeTabId) ?? tabs[0];
|
|
59
|
+
const query = searchQuery.trim().toLowerCase();
|
|
60
|
+
|
|
61
|
+
/** Keys per tab under the live snapshot, so the pills can state a count. */
|
|
62
|
+
const countsByTab = useMemo(() => {
|
|
63
|
+
const counts = new Map<string, number>();
|
|
64
|
+
for (const entry of Object.values(ALL_SCHEMA_ENTRIES)) {
|
|
65
|
+
if (!entry.ui || !isConditionMet(entry.ui.condition, entries)) continue;
|
|
66
|
+
counts.set(entry.ui.tab, (counts.get(entry.ui.tab) ?? 0) + 1);
|
|
67
|
+
}
|
|
68
|
+
return counts;
|
|
69
|
+
}, [entries]);
|
|
49
70
|
|
|
50
71
|
const visibleEntries = useMemo(() => {
|
|
51
|
-
const query = searchQuery.trim().toLowerCase();
|
|
52
72
|
if (query) {
|
|
53
73
|
return Object.entries(ALL_SCHEMA_ENTRIES)
|
|
54
|
-
.filter(([key, entry]) => matchesSearch(key, entry, query))
|
|
74
|
+
.filter(([key, entry]) => entry.ui && matchesSearch(key, entry, query))
|
|
55
75
|
.map(([key]) => key)
|
|
56
|
-
.slice(0,
|
|
76
|
+
.slice(0, SEARCH_LIMIT);
|
|
57
77
|
}
|
|
58
78
|
return entriesForTab(activeTab.id)
|
|
59
|
-
.filter(([, entry]) => isConditionMet(entry.ui.condition, entries))
|
|
79
|
+
.filter(([, entry]) => entry.ui && isConditionMet(entry.ui.condition, entries))
|
|
60
80
|
.map(([key]) => key);
|
|
61
|
-
}, [entries, activeTab.id,
|
|
81
|
+
}, [entries, activeTab.id, query]);
|
|
62
82
|
|
|
63
83
|
/** Search results grouped by "Tab · Group", mirroring the tab/group layout. */
|
|
64
84
|
const searchGroups = useMemo(() => {
|
|
65
|
-
if (!
|
|
85
|
+
if (!query) return [];
|
|
66
86
|
const order: Array<{ id: string; label: string; keys: string[] }> = [];
|
|
67
87
|
const byId = new Map<string, { label: string; keys: string[] }>();
|
|
68
88
|
for (const key of visibleEntries) {
|
|
@@ -83,31 +103,69 @@ export function ConfigTabs({
|
|
|
83
103
|
bucket.keys.push(key);
|
|
84
104
|
}
|
|
85
105
|
return order;
|
|
86
|
-
}, [visibleEntries,
|
|
106
|
+
}, [visibleEntries, query, tabs]);
|
|
107
|
+
|
|
108
|
+
const totalMatches = useMemo(
|
|
109
|
+
() => (query
|
|
110
|
+
? Object.entries(ALL_SCHEMA_ENTRIES).filter(([key, entry]) => entry.ui && matchesSearch(key, entry, query)).length
|
|
111
|
+
: 0),
|
|
112
|
+
[query],
|
|
113
|
+
);
|
|
87
114
|
|
|
88
115
|
return (
|
|
89
116
|
<div className="w-full flex flex-col gap-3 text-xs">
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
117
|
+
{query ? (
|
|
118
|
+
<div className="flex items-center justify-between gap-3 rounded-md border border-ink/15 bg-ink/[0.03] px-2.5 py-1.5">
|
|
119
|
+
<span className="flex min-w-0 items-center gap-1.5 text-[11px] text-ink/60">
|
|
120
|
+
<Search size={11} className="shrink-0 text-ink/40" />
|
|
121
|
+
<span className="truncate">
|
|
122
|
+
Searching every tab — <span className="font-medium text-ink">{totalMatches}</span>
|
|
123
|
+
{totalMatches > SEARCH_LIMIT && <span> (showing the first {SEARCH_LIMIT})</span>}
|
|
124
|
+
{' '}matching key{totalMatches === 1 ? '' : 's'}
|
|
125
|
+
</span>
|
|
126
|
+
</span>
|
|
127
|
+
<span className="shrink-0 rounded bg-ink/10 px-1.5 py-px font-mono text-[10px] text-ink/60">{searchQuery.trim()}</span>
|
|
128
|
+
</div>
|
|
129
|
+
) : (
|
|
130
|
+
<div
|
|
131
|
+
role="tablist"
|
|
132
|
+
aria-label="OMP config tabs"
|
|
133
|
+
className="flex items-center gap-1 overflow-x-auto pb-1 scrollbar-overlay-container"
|
|
134
|
+
>
|
|
135
|
+
{tabs.map((tab) => {
|
|
136
|
+
const isActive = tab.id === activeTab.id;
|
|
137
|
+
const count = countsByTab.get(tab.id) ?? 0;
|
|
138
|
+
return (
|
|
139
|
+
<button
|
|
140
|
+
key={tab.id}
|
|
141
|
+
type="button"
|
|
142
|
+
role="tab"
|
|
143
|
+
aria-selected={isActive}
|
|
144
|
+
onClick={() => onSelectTab(tab.id)}
|
|
145
|
+
title={count === 0 ? `${tab.label} — no setting is available in this tab right now` : `${count} setting${count === 1 ? '' : 's'}`}
|
|
146
|
+
className={`shrink-0 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors cursor-pointer ${
|
|
147
|
+
isActive
|
|
148
|
+
? 'bg-ink/10 text-ink'
|
|
149
|
+
: 'text-ink/55 hover:bg-ink/5 hover:text-ink'
|
|
150
|
+
}`}
|
|
151
|
+
>
|
|
152
|
+
{tab.label}
|
|
153
|
+
<span className={`ml-1.5 font-mono text-[9px] ${isActive ? 'text-ink/50' : 'text-ink/30'}`}>{count}</span>
|
|
154
|
+
</button>
|
|
155
|
+
);
|
|
156
|
+
})}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
{query && (
|
|
161
|
+
<div className="flex items-center gap-2 text-[10px] text-ink/40">
|
|
162
|
+
<X size={10} />
|
|
163
|
+
Clear the search to browse by tab again.
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
107
166
|
|
|
108
|
-
{/* Tab body: groups with heading rows */}
|
|
109
167
|
<div className="w-full rounded-lg border border-ink/10 divide-y divide-ink/5">
|
|
110
|
-
{
|
|
168
|
+
{query ? (
|
|
111
169
|
searchGroups.map((group) => (
|
|
112
170
|
<GroupedRows
|
|
113
171
|
key={group.id}
|
|
@@ -144,7 +202,7 @@ export function ConfigTabs({
|
|
|
144
202
|
)}
|
|
145
203
|
{visibleEntries.length === 0 && (
|
|
146
204
|
<div className="px-3 py-6 text-center text-ink/40">
|
|
147
|
-
{
|
|
205
|
+
{query ? 'No setting matches that search.' : 'No setting is available in this tab right now.'}
|
|
148
206
|
</div>
|
|
149
207
|
)}
|
|
150
208
|
</div>
|
|
@@ -161,7 +219,7 @@ interface GroupedRowsProps {
|
|
|
161
219
|
saveErrors: Map<string, string>;
|
|
162
220
|
onCommit: (key: string, value: unknown) => Promise<boolean>;
|
|
163
221
|
onReset: (key: string) => Promise<boolean>;
|
|
164
|
-
onDirty: (key: string, dirty: boolean
|
|
222
|
+
onDirty: (key: string, dirty: boolean) => void;
|
|
165
223
|
}
|
|
166
224
|
|
|
167
225
|
function GroupedRows({
|
|
@@ -184,13 +242,16 @@ function GroupedRows({
|
|
|
184
242
|
const schemaEntry = ALL_SCHEMA_ENTRIES[key];
|
|
185
243
|
if (!schemaEntry?.ui) return null;
|
|
186
244
|
const liveValue = entries[key]?.value;
|
|
245
|
+
// `omp config list` carries every registered key; an unset one has no
|
|
246
|
+
// `value`. Reset is only meaningful when config.yml holds a value.
|
|
247
|
+
const isStored = entries[key]?.value !== undefined;
|
|
187
248
|
const isDirty = dirtyKeys.has(key);
|
|
188
249
|
const saving = savingKeys.has(key);
|
|
189
250
|
const errorMessage = saveErrors.get(key);
|
|
190
251
|
return (
|
|
191
|
-
<div key={key} className="flex items-
|
|
252
|
+
<div key={key} className="flex items-start justify-between gap-3 px-3 py-2 hover:bg-ink/[0.02]">
|
|
192
253
|
<div className="min-w-0 flex-1">
|
|
193
|
-
<div className="flex items-center gap-1.5">
|
|
254
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
194
255
|
<span className="font-medium text-ink">{schemaEntry.ui.label}</span>
|
|
195
256
|
<span className="font-mono text-[9px] text-ink/30" title="config key">{key}</span>
|
|
196
257
|
{isDirty && !saving && (
|
|
@@ -221,7 +282,7 @@ function GroupedRows({
|
|
|
221
282
|
<div className="text-[10px] text-error/80 leading-snug">{schemaEntry.ui.warning}</div>
|
|
222
283
|
)}
|
|
223
284
|
</div>
|
|
224
|
-
<div className="flex items-center gap-1.5
|
|
285
|
+
<div className="flex shrink-0 items-center gap-1.5 pt-0.5">
|
|
225
286
|
<RowEditor
|
|
226
287
|
entryKey={key}
|
|
227
288
|
entry={schemaEntry}
|
|
@@ -235,10 +296,10 @@ function GroupedRows({
|
|
|
235
296
|
<button
|
|
236
297
|
type="button"
|
|
237
298
|
aria-label={`Reset ${schemaEntry.ui.label}`}
|
|
238
|
-
title=
|
|
299
|
+
title={isStored ? 'Reset to the schema default' : 'This key is not set — omp already uses the schema default'}
|
|
239
300
|
onClick={() => onReset(key)}
|
|
240
|
-
disabled={saving}
|
|
241
|
-
className=
|
|
301
|
+
disabled={saving || !isStored}
|
|
302
|
+
className="rounded p-1 text-ink/30 hover:text-ink transition-colors cursor-pointer hover:bg-ink/5 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent"
|
|
242
303
|
>
|
|
243
304
|
<RotateCcw size={11} />
|
|
244
305
|
</button>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The OMP Engine panel's header: live state at a glance, plus the two controls
|
|
8
|
+
* that belong to the snapshot (search and refresh).
|
|
9
|
+
*
|
|
10
|
+
* The snapshot used to be four static tiles that only changed on a full panel
|
|
11
|
+
* reload, so a running engine reported whatever it held when the modal opened.
|
|
12
|
+
* Refresh now owns its own busy state, the tiles carry the provider beside the
|
|
13
|
+
* model and a context meter with its token counts, and the moment of the
|
|
14
|
+
* reading is printed — a live-state panel that cannot say when it was read is
|
|
15
|
+
* indistinguishable from a stale one.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { ComponentChildren } from 'preact';
|
|
19
|
+
import { Loader2, RefreshCw, Search, X } from 'lucide-preact';
|
|
20
|
+
import { CONTEXT_BAND_TONES, clampContextPercent, contextUsageBand } from '@/shared/lib/chat/context/usage';
|
|
21
|
+
import { formatCompactTokens } from '@/shared/lib/format/number';
|
|
22
|
+
import type { EngineState } from '@/client/components/settings/categories/omp-settings/types';
|
|
23
|
+
|
|
24
|
+
interface EngineHeaderProps {
|
|
25
|
+
running: boolean;
|
|
26
|
+
state: EngineState | null;
|
|
27
|
+
refreshing: boolean;
|
|
28
|
+
updatedAt: number | null;
|
|
29
|
+
searchQuery: string;
|
|
30
|
+
onSearchChange: (value: string) => void;
|
|
31
|
+
onRefresh: () => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** `12:34:56`, the local read time of the snapshot. */
|
|
35
|
+
function readTime(at: number): string {
|
|
36
|
+
return new Date(at).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function EngineHeader({
|
|
40
|
+
running,
|
|
41
|
+
state,
|
|
42
|
+
refreshing,
|
|
43
|
+
updatedAt,
|
|
44
|
+
searchQuery,
|
|
45
|
+
onSearchChange,
|
|
46
|
+
onRefresh,
|
|
47
|
+
}: EngineHeaderProps) {
|
|
48
|
+
const percent = state?.contextUsage?.percent;
|
|
49
|
+
const hasPercent = typeof percent === 'number' && Number.isFinite(percent);
|
|
50
|
+
const clamped = hasPercent ? clampContextPercent(percent) : 0;
|
|
51
|
+
const tone = CONTEXT_BAND_TONES[contextUsageBand(clamped)];
|
|
52
|
+
const tokens = formatCompactTokens(state?.contextUsage?.tokens);
|
|
53
|
+
const window = formatCompactTokens(state?.contextUsage?.contextWindow);
|
|
54
|
+
const modelId = state?.model?.id;
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div className="flex flex-col gap-3 pb-3 border-b border-ink/10">
|
|
58
|
+
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
|
59
|
+
<div>
|
|
60
|
+
<h2 className="text-sm font-semibold text-ink">OMP Engine</h2>
|
|
61
|
+
<p className="text-ink/50 mt-0.5">
|
|
62
|
+
Live agent state and the full native config schema from oh-my-pi.
|
|
63
|
+
{updatedAt !== null && <span className="text-ink/40"> Read at {readTime(updatedAt)}.</span>}
|
|
64
|
+
</p>
|
|
65
|
+
</div>
|
|
66
|
+
<div className="flex items-center gap-2">
|
|
67
|
+
<div className="relative">
|
|
68
|
+
<Search size={12} className="absolute left-2 top-1/2 -translate-y-1/2 text-ink/40 pointer-events-none" />
|
|
69
|
+
<input
|
|
70
|
+
aria-label="Search settings"
|
|
71
|
+
type="search"
|
|
72
|
+
value={searchQuery}
|
|
73
|
+
onChange={(e) => onSearchChange(e.currentTarget.value)}
|
|
74
|
+
placeholder="Search every setting…"
|
|
75
|
+
className="w-52 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40 focus:outline-none focus:border-ink/40"
|
|
76
|
+
/>
|
|
77
|
+
{searchQuery && (
|
|
78
|
+
<button
|
|
79
|
+
type="button"
|
|
80
|
+
aria-label="Clear search"
|
|
81
|
+
onClick={() => onSearchChange('')}
|
|
82
|
+
className="absolute right-1.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer"
|
|
83
|
+
>
|
|
84
|
+
<X size={11} />
|
|
85
|
+
</button>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
<button
|
|
89
|
+
type="button"
|
|
90
|
+
onClick={onRefresh}
|
|
91
|
+
disabled={refreshing}
|
|
92
|
+
aria-busy={refreshing}
|
|
93
|
+
className="flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-all cursor-pointer disabled:opacity-50"
|
|
94
|
+
>
|
|
95
|
+
{refreshing
|
|
96
|
+
? <Loader2 size={12} className="animate-spin" />
|
|
97
|
+
: <RefreshCw size={12} />}
|
|
98
|
+
{refreshing ? 'Refreshing…' : 'Refresh'}
|
|
99
|
+
</button>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<div className="grid grid-cols-2 sm:grid-cols-4 gap-2">
|
|
104
|
+
<Stat label="Engine">
|
|
105
|
+
<span className="flex items-center gap-1.5">
|
|
106
|
+
<span
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
className={`h-1.5 w-1.5 rounded-full ${running ? 'bg-success' : 'bg-ink/25'}`}
|
|
109
|
+
/>
|
|
110
|
+
{running ? 'Running' : 'Idle'}
|
|
111
|
+
</span>
|
|
112
|
+
</Stat>
|
|
113
|
+
<Stat label="Model">
|
|
114
|
+
<span className="block truncate" title={modelId ? `${state?.model?.provider ?? ''} / ${modelId}` : undefined}>
|
|
115
|
+
{modelId ?? '—'}
|
|
116
|
+
</span>
|
|
117
|
+
{state?.model?.provider && (
|
|
118
|
+
<span className="block truncate text-[10px] font-normal text-ink/40">{state.model.provider}</span>
|
|
119
|
+
)}
|
|
120
|
+
</Stat>
|
|
121
|
+
<Stat label="Thinking">
|
|
122
|
+
<span className="capitalize">{state?.thinkingLevel ?? '—'}</span>
|
|
123
|
+
</Stat>
|
|
124
|
+
<Stat label="Context">
|
|
125
|
+
<span className={hasPercent ? tone.text : undefined}>
|
|
126
|
+
{hasPercent ? `${percent.toFixed(1)}%` : '—'}
|
|
127
|
+
</span>
|
|
128
|
+
{hasPercent && (
|
|
129
|
+
<span className="mt-1 block h-1 w-full overflow-hidden rounded-full bg-ink/10" aria-hidden="true">
|
|
130
|
+
<span className={`block h-full rounded-full ${tone.fill}`} style={{ width: `${clamped}%` }} />
|
|
131
|
+
</span>
|
|
132
|
+
)}
|
|
133
|
+
{tokens && (
|
|
134
|
+
<span className="mt-0.5 block text-[10px] font-normal text-ink/40">
|
|
135
|
+
{tokens}{window ? ` / ${window}` : ''} tokens
|
|
136
|
+
</span>
|
|
137
|
+
)}
|
|
138
|
+
</Stat>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function Stat({ label, children }: { label: string; children: ComponentChildren }) {
|
|
145
|
+
return (
|
|
146
|
+
<div className="rounded-lg border border-ink/10 bg-ink/[0.03] px-3 py-2">
|
|
147
|
+
<div className="text-[10px] uppercase tracking-wide text-ink/40">{label}</div>
|
|
148
|
+
<div className="font-semibold text-ink mt-0.5">{children}</div>
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
@@ -6,56 +6,92 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Extension list — TS/JS modules loaded from .omp/extensions. Toggling
|
|
8
8
|
* disabled writes to config.yml through /api/omp/extensions.
|
|
9
|
+
*
|
|
10
|
+
* The control is a SWITCH, not a `<select>`: the row's value is a boolean, and
|
|
11
|
+
* a select that reports "enabled"/"disabled" while its `onChange` ignores the
|
|
12
|
+
* chosen value reads as a two-state control that cannot be trusted. The switch
|
|
13
|
+
* disables only its own row while the write is in flight, so one slow toggle
|
|
14
|
+
* does not freeze the list, and the empty case is stated rather than returning
|
|
15
|
+
* `null` (a panel that vanishes is indistinguishable from a broken one).
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
|
-
import { Check } from 'lucide-preact';
|
|
12
|
-
|
|
13
|
-
interface ExtensionItem {
|
|
14
|
-
id: string;
|
|
15
|
-
name: string;
|
|
16
|
-
sourceRoot: string;
|
|
17
|
-
filePath: string;
|
|
18
|
-
disabled: boolean;
|
|
19
|
-
}
|
|
18
|
+
import { Check, Loader2, Puzzle } from 'lucide-preact';
|
|
19
|
+
import type { ExtensionItem } from '@/client/components/settings/categories/omp-settings/types';
|
|
20
20
|
|
|
21
21
|
interface ExtensionsPanelProps {
|
|
22
22
|
extensions: ExtensionItem[];
|
|
23
23
|
savedExtension: string | null;
|
|
24
|
+
/** Ids whose toggle is in flight. */
|
|
25
|
+
pendingIds: Set<string>;
|
|
24
26
|
onToggle: (extension: ExtensionItem) => void;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
export function ExtensionsPanel({ extensions, savedExtension, onToggle }: ExtensionsPanelProps) {
|
|
28
|
-
if (extensions.length === 0) return null;
|
|
29
|
+
export function ExtensionsPanel({ extensions, savedExtension, pendingIds, onToggle }: ExtensionsPanelProps) {
|
|
29
30
|
return (
|
|
30
31
|
<div className="pt-2">
|
|
31
32
|
<div className="flex items-center justify-between pb-2">
|
|
32
33
|
<div>
|
|
33
34
|
<h3 className="text-sm font-semibold text-ink">Extensions</h3>
|
|
34
|
-
<p className="text-ink/50 mt-0.5">
|
|
35
|
+
<p className="text-ink/50 mt-0.5">
|
|
36
|
+
TS/JS modules loaded from <span className="font-mono">.omp/extensions</span>. Disabling one writes to
|
|
37
|
+
config.yml and applies to the next session.
|
|
38
|
+
</p>
|
|
35
39
|
</div>
|
|
36
40
|
{savedExtension && (
|
|
37
|
-
<span className="inline-flex items-center gap-1 text-[10px] text-ink/60"
|
|
41
|
+
<span className="inline-flex shrink-0 items-center gap-1 text-[10px] text-ink/60">
|
|
42
|
+
<Check size={11} /> saved
|
|
43
|
+
</span>
|
|
38
44
|
)}
|
|
39
45
|
</div>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
{extensions.length === 0 ? (
|
|
47
|
+
<div className="flex items-center gap-2 rounded-lg border border-dashed border-ink/15 px-3 py-3 text-[11px] text-ink/50">
|
|
48
|
+
<Puzzle size={13} className="text-ink/35" />
|
|
49
|
+
<span>
|
|
50
|
+
No extension modules found. Add a <span className="font-mono">.ts</span> or{' '}
|
|
51
|
+
<span className="font-mono">.js</span> file under{' '}
|
|
52
|
+
<span className="font-mono">~/.omp/extensions</span> (or a workspace’s{' '}
|
|
53
|
+
<span className="font-mono">.omp/extensions</span>) and refresh.
|
|
54
|
+
</span>
|
|
55
|
+
</div>
|
|
56
|
+
) : (
|
|
57
|
+
<div className="rounded-lg border border-ink/10 divide-y divide-ink/5">
|
|
58
|
+
{extensions.map((extension) => {
|
|
59
|
+
const enabled = !extension.disabled;
|
|
60
|
+
const pending = pendingIds.has(extension.id);
|
|
61
|
+
return (
|
|
62
|
+
<div key={extension.id} className="flex items-center justify-between gap-3 px-3 py-2.5">
|
|
63
|
+
<div className="min-w-0">
|
|
64
|
+
<div className="font-medium text-ink">{extension.name}</div>
|
|
65
|
+
<div className="text-[10px] text-ink/40 truncate font-mono" title={`${extension.sourceRoot}/${extension.filePath}`}>
|
|
66
|
+
{extension.sourceRoot} · {extension.filePath}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
70
|
+
<span className="text-[10px] text-ink/40">{pending ? 'saving…' : enabled ? 'enabled' : 'disabled'}</span>
|
|
71
|
+
{pending && <Loader2 size={11} className="animate-spin text-ink/40" />}
|
|
72
|
+
<button
|
|
73
|
+
type="button"
|
|
74
|
+
role="switch"
|
|
75
|
+
aria-checked={enabled}
|
|
76
|
+
aria-label={`${extension.name} enabled`}
|
|
77
|
+
disabled={pending}
|
|
78
|
+
onClick={() => onToggle(extension)}
|
|
79
|
+
className={`relative h-5 w-9 rounded-full transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-progress ${
|
|
80
|
+
enabled ? 'bg-ink' : 'bg-ink/15'
|
|
81
|
+
}`}
|
|
82
|
+
>
|
|
83
|
+
<span
|
|
84
|
+
className={`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${
|
|
85
|
+
enabled ? 'left-[18px]' : 'left-0.5'
|
|
86
|
+
}`}
|
|
87
|
+
/>
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
})}
|
|
93
|
+
</div>
|
|
94
|
+
)}
|
|
59
95
|
</div>
|
|
60
96
|
);
|
|
61
97
|
}
|