@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
|
@@ -7,25 +7,26 @@
|
|
|
7
7
|
* Schema-driven value editor for one native omp setting key.
|
|
8
8
|
*
|
|
9
9
|
* Renders the control matching the schema entry's type:
|
|
10
|
-
* - boolean → inline
|
|
11
|
-
* - enum → select
|
|
12
|
-
* - string → select for submenu options, password input for credentials
|
|
13
|
-
* otherwise a text field
|
|
14
|
-
* - number →
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* checkboxes for unordered lists); JSON array string accepted when no
|
|
18
|
-
* submenu choices exist
|
|
10
|
+
* - boolean → inline switch (commits on click)
|
|
11
|
+
* - enum → select over the schema's own values
|
|
12
|
+
* - string → select for submenu options, password input for credentials
|
|
13
|
+
* (with a reveal), otherwise a text field
|
|
14
|
+
* - number → text field with a numeric keypad hint
|
|
15
|
+
* - array → ordered chip editor when the schema ships options, JSON text
|
|
16
|
+
* otherwise
|
|
19
17
|
* - record → single-line JSON object editor
|
|
20
18
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* Text controls commit on blur, Enter or the row's own check button, and
|
|
20
|
+
* Escape abandons the draft. A draft that cannot be parsed for its type says
|
|
21
|
+
* WHY under the field instead of reverting silently — the old editor reverted
|
|
22
|
+
* on a bad number or JSON with no message, which reads as "saving is broken".
|
|
24
23
|
*/
|
|
25
24
|
|
|
26
|
-
import { useEffect,
|
|
27
|
-
import { X } from 'lucide-preact';
|
|
25
|
+
import { useEffect, useRef, useState } from 'preact/hooks';
|
|
26
|
+
import { Check, Eye, EyeOff, X } from 'lucide-preact';
|
|
28
27
|
import type { SchemaEntry } from '@/shared/lib/omp/config/schema-types';
|
|
28
|
+
import { parseDraft, valueToText } from '@/shared/lib/omp/config/row-value';
|
|
29
|
+
import { OrderedChips } from '@/client/components/settings/categories/omp-settings/OrderedChips';
|
|
29
30
|
|
|
30
31
|
interface RowEditorProps {
|
|
31
32
|
entryKey: string;
|
|
@@ -33,8 +34,8 @@ interface RowEditorProps {
|
|
|
33
34
|
value: unknown;
|
|
34
35
|
initialValue: unknown;
|
|
35
36
|
/** Report the local editing state so the parent can defer saving. */
|
|
36
|
-
onChangeDirty: (key: string, dirty: boolean
|
|
37
|
-
/** Commit the new value;
|
|
37
|
+
onChangeDirty: (key: string, dirty: boolean) => void;
|
|
38
|
+
/** Commit the new value; resolves with the server's answer. */
|
|
38
39
|
onCommit: (key: string, value: unknown) => Promise<boolean>;
|
|
39
40
|
/** True while a commit/reset for this key is in flight. */
|
|
40
41
|
saving: boolean;
|
|
@@ -42,41 +43,6 @@ interface RowEditorProps {
|
|
|
42
43
|
saveError: boolean;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
/** Deep equality for JSON-safe values (arrays, records, scalars). */
|
|
46
|
-
const valuesEqual = (a: unknown, b: unknown): boolean => JSON.stringify(a) === JSON.stringify(b);
|
|
47
|
-
|
|
48
|
-
/** Number-editor conversion: strip invalid input instead of shipping NaN. */
|
|
49
|
-
const toFiniteNumber = (raw: string): number | null => {
|
|
50
|
-
const trimmed = raw.trim();
|
|
51
|
-
if (trimmed === '' || trimmed === '-' || trimmed === '+') return null;
|
|
52
|
-
const parsed = Number(trimmed);
|
|
53
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
/** Parse a JSON array; null when invalid (keeps previous value). */
|
|
57
|
-
const parseJsonArray = (raw: string): unknown[] | null => {
|
|
58
|
-
const trimmed = raw.trim();
|
|
59
|
-
if (trimmed === '') return [];
|
|
60
|
-
try {
|
|
61
|
-
const parsed = JSON.parse(trimmed);
|
|
62
|
-
return Array.isArray(parsed) ? parsed : null;
|
|
63
|
-
} catch {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/** Parse a JSON record; null when invalid (keeps previous value). */
|
|
69
|
-
const parseJsonRecord = (raw: string): Record<string, unknown> | null => {
|
|
70
|
-
const trimmed = raw.trim();
|
|
71
|
-
if (trimmed === '') return {};
|
|
72
|
-
try {
|
|
73
|
-
const parsed = JSON.parse(trimmed);
|
|
74
|
-
return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : null;
|
|
75
|
-
} catch {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
46
|
export function RowEditor({
|
|
81
47
|
entryKey,
|
|
82
48
|
entry,
|
|
@@ -87,80 +53,64 @@ export function RowEditor({
|
|
|
87
53
|
saving,
|
|
88
54
|
saveError,
|
|
89
55
|
}: RowEditorProps) {
|
|
90
|
-
const [raw, setRaw] = useState
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
});
|
|
56
|
+
const [raw, setRaw] = useState(() => valueToText(value));
|
|
57
|
+
const [draftError, setDraftError] = useState<string | null>(null);
|
|
58
|
+
const [revealed, setRevealed] = useState(false);
|
|
94
59
|
// True when a blur should commit (control went dirty then lost focus).
|
|
95
60
|
const dirtyRef = useRef(false);
|
|
96
61
|
const initialRef = useRef<unknown>(initialValue);
|
|
97
|
-
const options =
|
|
62
|
+
const options = Array.isArray(entry.ui.options) ? entry.ui.options : null;
|
|
98
63
|
|
|
99
64
|
useEffect(() => {
|
|
100
|
-
|
|
101
|
-
|
|
65
|
+
setRaw(valueToText(value));
|
|
66
|
+
setDraftError(null);
|
|
102
67
|
dirtyRef.current = false;
|
|
103
68
|
}, [value]);
|
|
104
69
|
|
|
105
70
|
const revert = () => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
setRaw(text);
|
|
71
|
+
setRaw(valueToText(initialRef.current));
|
|
72
|
+
setDraftError(null);
|
|
109
73
|
dirtyRef.current = false;
|
|
110
|
-
onChangeDirty(entryKey, false
|
|
74
|
+
onChangeDirty(entryKey, false);
|
|
111
75
|
};
|
|
112
76
|
|
|
113
|
-
/** Commit a normalized value;
|
|
114
|
-
const commit = (next: unknown) => {
|
|
77
|
+
/** Commit a normalized value; a refusal puts the previous text back. */
|
|
78
|
+
const commit = async (next: unknown) => {
|
|
115
79
|
const priorRaw = raw;
|
|
116
|
-
setRaw(
|
|
80
|
+
setRaw(valueToText(next));
|
|
81
|
+
setDraftError(null);
|
|
117
82
|
dirtyRef.current = false;
|
|
118
|
-
onCommit(entryKey, next)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
})
|
|
126
|
-
.catch(() => {
|
|
127
|
-
setRaw(priorRaw);
|
|
128
|
-
onChangeDirty(entryKey, true, revert);
|
|
129
|
-
});
|
|
83
|
+
const ok = await onCommit(entryKey, next);
|
|
84
|
+
if (ok) onChangeDirty(entryKey, false);
|
|
85
|
+
else {
|
|
86
|
+
setRaw(priorRaw);
|
|
87
|
+
dirtyRef.current = true;
|
|
88
|
+
onChangeDirty(entryKey, true);
|
|
89
|
+
}
|
|
130
90
|
};
|
|
131
91
|
|
|
132
|
-
|
|
92
|
+
/** Commit the text draft, or name why it cannot be committed. */
|
|
93
|
+
const commitDraft = () => {
|
|
133
94
|
if (!dirtyRef.current) return;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
commit(parsed);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
if (entry.type === 'string') {
|
|
141
|
-
const next = raw.trim();
|
|
142
|
-
if (next === value) { revert(); return; }
|
|
143
|
-
commit(next);
|
|
95
|
+
const parsed = parseDraft(entry.type, raw);
|
|
96
|
+
if (!parsed.ok) {
|
|
97
|
+
setDraftError(parsed.error);
|
|
144
98
|
return;
|
|
145
99
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
commit(parsed);
|
|
100
|
+
if (JSON.stringify(parsed.value) === JSON.stringify(value)) {
|
|
101
|
+
setDraftError(null);
|
|
102
|
+
dirtyRef.current = false;
|
|
103
|
+
onChangeDirty(entryKey, false);
|
|
151
104
|
return;
|
|
152
105
|
}
|
|
153
|
-
|
|
154
|
-
const parsed = parseJsonRecord(raw);
|
|
155
|
-
if (parsed === null || valuesEqual(parsed, value)) { revert(); return; }
|
|
156
|
-
commit(parsed);
|
|
157
|
-
}
|
|
106
|
+
void commit(parsed.value);
|
|
158
107
|
};
|
|
159
108
|
|
|
160
109
|
const markDirty = () => {
|
|
161
110
|
const wasDirty = dirtyRef.current;
|
|
162
111
|
dirtyRef.current = true;
|
|
163
|
-
|
|
112
|
+
setDraftError(null);
|
|
113
|
+
if (!wasDirty) onChangeDirty(entryKey, true);
|
|
164
114
|
};
|
|
165
115
|
|
|
166
116
|
if (entry.type === 'boolean') {
|
|
@@ -171,105 +121,64 @@ export function RowEditor({
|
|
|
171
121
|
role="switch"
|
|
172
122
|
aria-checked={checked}
|
|
173
123
|
aria-label={entry.ui.label}
|
|
174
|
-
onClick={() =>
|
|
175
|
-
onChangeDirty(entryKey, false, () => {});
|
|
176
|
-
commit(!checked);
|
|
177
|
-
}}
|
|
124
|
+
onClick={() => void commit(!checked)}
|
|
178
125
|
disabled={saving}
|
|
179
|
-
className={`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer
|
|
126
|
+
className={`relative h-5 w-9 shrink-0 rounded-full transition-colors cursor-pointer disabled:cursor-progress ${
|
|
127
|
+
checked ? 'bg-ink' : 'bg-ink/15'
|
|
128
|
+
} ${saving ? 'opacity-50' : ''}`}
|
|
180
129
|
>
|
|
181
130
|
<span
|
|
182
|
-
className={`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${
|
|
131
|
+
className={`absolute top-0.5 h-4 w-4 rounded-full bg-paper shadow-sm transition-all ${
|
|
132
|
+
checked ? 'left-[18px]' : 'left-0.5'
|
|
133
|
+
}`}
|
|
183
134
|
/>
|
|
184
135
|
</button>
|
|
185
136
|
);
|
|
186
137
|
}
|
|
187
138
|
|
|
188
139
|
if (entry.type === 'array' && entry.ui.ordered && options) {
|
|
189
|
-
// Ordered chip list — value is an array of option values; reorder + toggle.
|
|
190
|
-
const current = Array.isArray(value) ? value.filter((v): v is string => typeof v === 'string') : [];
|
|
191
|
-
const toggle = (optionValue: string) => {
|
|
192
|
-
commit(current.includes(optionValue) ? current.filter((v) => v !== optionValue) : [...current, optionValue]);
|
|
193
|
-
};
|
|
194
|
-
const move = (index: number, delta: number) => {
|
|
195
|
-
const target = index + delta;
|
|
196
|
-
if (target < 0 || target >= current.length) return;
|
|
197
|
-
const next = [...current];
|
|
198
|
-
const [moved] = next.splice(index, 1);
|
|
199
|
-
next.splice(target, 0, moved);
|
|
200
|
-
commit(next);
|
|
201
|
-
};
|
|
202
140
|
return (
|
|
203
|
-
<
|
|
204
|
-
{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
<button type="button" aria-label={`${option?.label ?? chip} left`} onClick={() => move(index, -1)} className="text-ink/40 hover:text-ink cursor-pointer" disabled={saving}>←</button>
|
|
210
|
-
)}
|
|
211
|
-
{option?.label ?? chip}
|
|
212
|
-
{index < current.length - 1 && (
|
|
213
|
-
<button type="button" aria-label={`${option?.label ?? chip} right`} onClick={() => move(index, 1)} className="text-ink/40 hover:text-ink cursor-pointer" disabled={saving}>→</button>
|
|
214
|
-
)}
|
|
215
|
-
<button type="button" aria-label={`Remove ${option?.label ?? chip}`} onClick={() => toggle(chip)} className="text-ink/40 hover:text-error cursor-pointer" disabled={saving}>
|
|
216
|
-
<X size={10} />
|
|
217
|
-
</button>
|
|
218
|
-
</span>
|
|
219
|
-
);
|
|
220
|
-
})}
|
|
221
|
-
{current.length === 0 && <span className="text-[10px] text-ink/40">empty</span>}
|
|
222
|
-
<details className="relative">
|
|
223
|
-
<summary className="cursor-pointer rounded-md border border-ink/15 px-2 py-0.5 text-[10px] text-ink/70 hover:text-ink select-none">add…</summary>
|
|
224
|
-
<div className="absolute right-0 top-full z-10 mt-1 max-h-44 w-48 overflow-auto rounded-md border border-ink/15 bg-paper p-1 shadow-lg">
|
|
225
|
-
{options.filter((o) => !current.includes(o.value)).map((option) => (
|
|
226
|
-
<button
|
|
227
|
-
key={option.value}
|
|
228
|
-
type="button"
|
|
229
|
-
onClick={() => toggle(option.value)}
|
|
230
|
-
className="block w-full rounded px-2 py-1 text-left text-[11px] text-ink/80 hover:bg-ink/5"
|
|
231
|
-
>
|
|
232
|
-
{option.label || option.value}
|
|
233
|
-
</button>
|
|
234
|
-
))}
|
|
235
|
-
{options.every((o) => current.includes(o.value)) && (
|
|
236
|
-
<div className="px-2 py-1 text-[10px] text-ink/40">all selected</div>
|
|
237
|
-
)}
|
|
238
|
-
</div>
|
|
239
|
-
</details>
|
|
240
|
-
</div>
|
|
141
|
+
<OrderedChips
|
|
142
|
+
options={options}
|
|
143
|
+
value={value}
|
|
144
|
+
saving={saving}
|
|
145
|
+
onCommit={(next) => void commit(next)}
|
|
146
|
+
/>
|
|
241
147
|
);
|
|
242
148
|
}
|
|
243
149
|
|
|
244
|
-
const choices = options
|
|
150
|
+
const choices = options
|
|
151
|
+
?? (entry.type === 'enum' && entry.values
|
|
152
|
+
? entry.values.map((optionValue) => ({ value: optionValue, label: optionValue, description: '' }))
|
|
153
|
+
: null);
|
|
245
154
|
|
|
246
155
|
if (choices) {
|
|
247
156
|
const current = value === undefined || value === null ? '' : String(value);
|
|
248
157
|
return (
|
|
249
|
-
<div className="flex items-center gap-2
|
|
158
|
+
<div className="flex shrink-0 items-center gap-2">
|
|
250
159
|
<select
|
|
251
160
|
aria-label={entry.ui.label}
|
|
252
161
|
value={current}
|
|
253
|
-
onChange={(
|
|
254
|
-
const selected =
|
|
162
|
+
onChange={(event) => {
|
|
163
|
+
const selected = event.currentTarget.value;
|
|
164
|
+
if (selected === current) return;
|
|
255
165
|
if (entry.type === 'number') {
|
|
256
|
-
const parsed =
|
|
257
|
-
if (parsed
|
|
258
|
-
commit(parsed);
|
|
166
|
+
const parsed = Number(selected);
|
|
167
|
+
if (!Number.isFinite(parsed)) return;
|
|
168
|
+
void commit(parsed);
|
|
259
169
|
} else {
|
|
260
|
-
|
|
261
|
-
commit(selected);
|
|
170
|
+
void commit(selected);
|
|
262
171
|
}
|
|
263
172
|
}}
|
|
264
173
|
disabled={saving}
|
|
265
|
-
className={`
|
|
174
|
+
className={`max-w-56 rounded-md border border-ink/15 bg-paper px-2 py-1 text-ink cursor-pointer disabled:cursor-progress ${
|
|
175
|
+
saving ? 'opacity-50' : ''
|
|
176
|
+
}`}
|
|
266
177
|
>
|
|
267
|
-
{current === '' &&
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
<option key={option.value} value={option.value}>
|
|
272
|
-
{option.label || option.value}
|
|
178
|
+
{current === '' && <option value="" disabled>select…</option>}
|
|
179
|
+
{choices.map((choice) => (
|
|
180
|
+
<option key={choice.value} value={choice.value}>
|
|
181
|
+
{choice.label || choice.value}
|
|
273
182
|
</option>
|
|
274
183
|
))}
|
|
275
184
|
</select>
|
|
@@ -277,61 +186,91 @@ export function RowEditor({
|
|
|
277
186
|
);
|
|
278
187
|
}
|
|
279
188
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
/>
|
|
292
|
-
);
|
|
293
|
-
}
|
|
189
|
+
const isText = entry.type === 'string' || entry.type === 'number'
|
|
190
|
+
|| entry.type === 'array' || entry.type === 'record';
|
|
191
|
+
const placeholder = entry.type === 'array'
|
|
192
|
+
? '["anthropic","openai"]'
|
|
193
|
+
: entry.type === 'record'
|
|
194
|
+
? '{"bash":"prompt"}'
|
|
195
|
+
: entry.type === 'number'
|
|
196
|
+
? 'unset'
|
|
197
|
+
: entry.credential
|
|
198
|
+
? 'not set'
|
|
199
|
+
: 'unset';
|
|
294
200
|
|
|
295
|
-
if (entry.type === 'record') {
|
|
296
|
-
return (
|
|
297
|
-
<input
|
|
298
|
-
aria-label={entry.ui.label}
|
|
299
|
-
type="text"
|
|
300
|
-
value={raw}
|
|
301
|
-
onChange={(e) => { setRaw(e.currentTarget.value); markDirty(); }}
|
|
302
|
-
onBlur={commitBlur}
|
|
303
|
-
disabled={saving}
|
|
304
|
-
placeholder='{"bash":"prompt"}'
|
|
305
|
-
className={`w-48 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${saving ? 'opacity-50' : ''}`}
|
|
306
|
-
/>
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (entry.type === 'number') {
|
|
311
|
-
return (
|
|
312
|
-
<input
|
|
313
|
-
aria-label={entry.ui.label}
|
|
314
|
-
type="text"
|
|
315
|
-
inputMode="decimal"
|
|
316
|
-
value={raw}
|
|
317
|
-
onChange={(e) => { setRaw(e.currentTarget.value); markDirty(); }}
|
|
318
|
-
onBlur={commitBlur}
|
|
319
|
-
disabled={saving}
|
|
320
|
-
className={`w-28 bg-paper border border-ink/15 rounded-md px-2 py-1 text-ink text-right font-mono text-[11px] ${saving ? 'opacity-50' : ''}`}
|
|
321
|
-
/>
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// string without submenu options
|
|
326
201
|
return (
|
|
327
|
-
<
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
202
|
+
<div className="flex shrink-0 flex-col items-end gap-1">
|
|
203
|
+
<div className="flex items-center gap-1">
|
|
204
|
+
<input
|
|
205
|
+
aria-label={entry.ui.label}
|
|
206
|
+
aria-invalid={draftError ? true : undefined}
|
|
207
|
+
type={entry.credential && !revealed ? 'password' : 'text'}
|
|
208
|
+
inputMode={entry.type === 'number' ? 'decimal' : undefined}
|
|
209
|
+
value={raw}
|
|
210
|
+
onChange={(event) => {
|
|
211
|
+
setRaw(event.currentTarget.value);
|
|
212
|
+
markDirty();
|
|
213
|
+
}}
|
|
214
|
+
onBlur={() => {
|
|
215
|
+
if (isText) commitDraft();
|
|
216
|
+
}}
|
|
217
|
+
onKeyDown={(event) => {
|
|
218
|
+
if (event.key === 'Enter') {
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
commitDraft();
|
|
221
|
+
}
|
|
222
|
+
if (event.key === 'Escape') {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
revert();
|
|
225
|
+
}
|
|
226
|
+
}}
|
|
227
|
+
disabled={saving}
|
|
228
|
+
spellcheck={false}
|
|
229
|
+
placeholder={placeholder}
|
|
230
|
+
className={`bg-paper border rounded-md px-2 py-1 text-ink text-right text-[11px] ${
|
|
231
|
+
entry.type === 'string' && !entry.credential ? '' : 'font-mono'
|
|
232
|
+
} ${entry.type === 'number' ? 'w-28' : 'w-48'} ${
|
|
233
|
+
draftError || saveError ? 'border-error' : 'border-ink/15'
|
|
234
|
+
} ${saving ? 'opacity-50 cursor-progress' : ''} focus:outline-none focus:border-ink/50`}
|
|
235
|
+
/>
|
|
236
|
+
{entry.credential && (
|
|
237
|
+
<button
|
|
238
|
+
type="button"
|
|
239
|
+
aria-label={revealed ? `Hide ${entry.ui.label}` : `Show ${entry.ui.label}`}
|
|
240
|
+
title={revealed ? 'Hide the value' : 'Show the value'}
|
|
241
|
+
onClick={() => setRevealed((isRevealed) => !isRevealed)}
|
|
242
|
+
className="rounded p-1 text-ink/35 hover:text-ink hover:bg-ink/5 cursor-pointer"
|
|
243
|
+
>
|
|
244
|
+
{revealed ? <EyeOff size={11} /> : <Eye size={11} />}
|
|
245
|
+
</button>
|
|
246
|
+
)}
|
|
247
|
+
{isText && dirtyRef.current && (
|
|
248
|
+
<button
|
|
249
|
+
type="button"
|
|
250
|
+
aria-label={`Save ${entry.ui.label}`}
|
|
251
|
+
title="Save (Enter)"
|
|
252
|
+
onClick={commitDraft}
|
|
253
|
+
disabled={saving}
|
|
254
|
+
className="rounded p-1 text-ink/50 hover:text-ink hover:bg-ink/5 cursor-pointer disabled:opacity-40"
|
|
255
|
+
>
|
|
256
|
+
<Check size={11} />
|
|
257
|
+
</button>
|
|
258
|
+
)}
|
|
259
|
+
{isText && draftError && (
|
|
260
|
+
<button
|
|
261
|
+
type="button"
|
|
262
|
+
aria-label={`Discard the change to ${entry.ui.label}`}
|
|
263
|
+
title="Discard (Escape)"
|
|
264
|
+
onClick={revert}
|
|
265
|
+
className="rounded p-1 text-error/70 hover:text-error hover:bg-error/5 cursor-pointer"
|
|
266
|
+
>
|
|
267
|
+
<X size={11} />
|
|
268
|
+
</button>
|
|
269
|
+
)}
|
|
270
|
+
</div>
|
|
271
|
+
{draftError && (
|
|
272
|
+
<span className="max-w-56 text-right text-[10px] leading-snug text-error">{draftError}</span>
|
|
273
|
+
)}
|
|
274
|
+
</div>
|
|
336
275
|
);
|
|
337
276
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Live engine snapshot from `GET /api/omp/state`. */
|
|
7
|
+
export interface EngineState {
|
|
8
|
+
model?: { provider?: string; id?: string };
|
|
9
|
+
contextUsage?: { tokens?: number; contextWindow?: number; percent?: number } | null;
|
|
10
|
+
fastModeEnabled?: boolean;
|
|
11
|
+
thinkingLevel?: string;
|
|
12
|
+
tokensPerSecond?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** One module found under `.omp/extensions`. */
|
|
16
|
+
export interface ExtensionItem {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
sourceRoot: string;
|
|
20
|
+
filePath: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The outcome every settings write reports, so a refusal is never silent. */
|
|
25
|
+
export interface WriteOutcome {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
}
|
|
@@ -69,7 +69,7 @@ export function AvailableList({ entries, busy, onInstall, onInstallUrl }: Availa
|
|
|
69
69
|
className="flex flex-col gap-2 border border-ink/10 rounded-lg p-3 bg-paper hover:border-ink/20 transition-colors"
|
|
70
70
|
>
|
|
71
71
|
<div className="flex items-start gap-2.5">
|
|
72
|
-
<PluginMark name={entry.name} iconUrl={entry.iconUrl} />
|
|
72
|
+
<PluginMark name={entry.name} iconUrl={entry.iconUrl} color={entry.color} />
|
|
73
73
|
<div className="min-w-0 flex-1">
|
|
74
74
|
<div className="text-xs font-medium text-ink truncate" title={entry.name}>
|
|
75
75
|
{entry.name}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Loader2 } from 'lucide-preact';
|
|
2
2
|
import { BUILTIN_PANELS } from '@/client/components/workspace/panels/builtin';
|
|
3
|
+
import { PanelMark } from '@/client/components/common/panel-mark';
|
|
4
|
+
import { PANEL_MARK_SIZE } from '@/shared/lib/workspace/right-panels';
|
|
3
5
|
|
|
4
6
|
interface BuiltinListProps {
|
|
5
7
|
/** Every panel id switched off — a bare view id, or `plugin:<id>`. */
|
|
@@ -55,9 +57,25 @@ export function BuiltinList({ disabled, busy, onSetEnabled }: BuiltinListProps)
|
|
|
55
57
|
enabled ? 'bg-paper' : 'bg-ink/[0.02]'
|
|
56
58
|
}`}
|
|
57
59
|
>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
{/* The SAME mark the rail and the phone's chip strip draw, from
|
|
61
|
+
the same hue map: this row used to render the bare glyph and
|
|
62
|
+
therefore took the GLYPH's colour (`lucide-files` → 320°) while
|
|
63
|
+
the rail drew the PANEL's (`files` → 0°).
|
|
64
|
+
|
|
65
|
+
The off state is stated the way the rail states it — the ink
|
|
66
|
+
weight for the monochrome mode, `data-idle` for the colour
|
|
67
|
+
mode, which dims by LUMINANCE and keeps the chroma. `opacity`
|
|
68
|
+
here would have washed the hue out, the exact "kusem" the rail
|
|
69
|
+
stopped doing. */}
|
|
70
|
+
<PanelMark
|
|
71
|
+
className={`flex-shrink-0 ${enabled ? 'text-ink/70' : 'text-ink/30'}`}
|
|
72
|
+
panelId={panel.id}
|
|
73
|
+
builtin
|
|
74
|
+
icon={panel.icon}
|
|
75
|
+
name={panel.title}
|
|
76
|
+
size={PANEL_MARK_SIZE}
|
|
77
|
+
idle={!enabled}
|
|
78
|
+
/>
|
|
61
79
|
<span className="min-w-0 flex-1">
|
|
62
80
|
<span className={`block text-xs truncate ${enabled ? 'text-ink' : 'text-ink/45'}`} title={panel.title}>
|
|
63
81
|
{panel.title}
|
|
@@ -95,7 +95,7 @@ export function PluginCard({
|
|
|
95
95
|
>
|
|
96
96
|
<header className="flex items-start gap-2.5">
|
|
97
97
|
<div className={plugin.enabled ? '' : 'opacity-50'}>
|
|
98
|
-
<PluginMark name={plugin.name} iconUrl={iconUrl} />
|
|
98
|
+
<PluginMark name={plugin.name} iconUrl={iconUrl} color={plugin.color} />
|
|
99
99
|
</div>
|
|
100
100
|
<div className="min-w-0 flex-1">
|
|
101
101
|
<div className="flex items-center gap-1.5 min-w-0">
|
|
@@ -74,8 +74,11 @@ describe('PluginMark', () => {
|
|
|
74
74
|
expect(el.querySelector('img')).toBeNull();
|
|
75
75
|
expect(span?.style.width).toBe('16px');
|
|
76
76
|
expect(span?.style.height).toBe('16px');
|
|
77
|
-
//
|
|
78
|
-
|
|
77
|
+
// The paint is a VARIABLE, so the mode decides it: monochrome leaves
|
|
78
|
+
// `--plugin-color` undefined and the mark keeps the ink it always used.
|
|
79
|
+
expect(span?.style.backgroundColor).toBe('var(--plugin-color, currentColor)');
|
|
80
|
+
expect(span?.getAttribute('data-plugin-mark')).toBe('');
|
|
81
|
+
expect(span?.style.getPropertyValue('--icon-hue')).not.toBe('');
|
|
79
82
|
// The extension is read off the PATH; the registry's URL carries a `?v=` hash.
|
|
80
83
|
expect(span?.style.maskImage).toContain('/api/panels/icon/demo/icon.svg?v=abc');
|
|
81
84
|
expect(span?.style.maskSize).toBe('contain');
|
|
@@ -109,6 +112,52 @@ describe('PluginMark', () => {
|
|
|
109
112
|
expect(el.querySelector('span')).toBeNull();
|
|
110
113
|
});
|
|
111
114
|
|
|
115
|
+
test('a plugin mark carries its own hue, stable across renders', () => {
|
|
116
|
+
const first = paint(h(PluginMark, { name: 'Demo Plugin', iconUrl: '/api/panels/icon/demo/icon.svg' }))
|
|
117
|
+
.querySelector('span');
|
|
118
|
+
const hue = first?.style.getPropertyValue('--icon-hue');
|
|
119
|
+
render(null, container);
|
|
120
|
+
const second = paint(h(PluginMark, { name: 'Demo Plugin', iconUrl: '/api/panels/icon/demo/icon.svg' }))
|
|
121
|
+
.querySelector('span');
|
|
122
|
+
|
|
123
|
+
expect(hue).toMatch(/^\d+$/);
|
|
124
|
+
expect(second?.style.getPropertyValue('--icon-hue')).toBe(hue);
|
|
125
|
+
expect(paint(h(PluginMark, { name: 'Another Plugin' })).querySelector('span')?.style.getPropertyValue('--icon-hue')).not.toBe(hue);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('the initials fallback takes the same colour hook as a vector mark', () => {
|
|
129
|
+
const badge = paint(h(PluginMark, { name: 'Session Info' })).querySelector('span');
|
|
130
|
+
|
|
131
|
+
expect(badge?.getAttribute('data-plugin-mark')).toBe('');
|
|
132
|
+
// 45% of the palette ink is what `text-ink/45` meant, restated as a value so
|
|
133
|
+
// the colour mode can replace it without a second class.
|
|
134
|
+
expect(badge?.style.color).toBe('var(--plugin-color, color-mix(in srgb, var(--theme-ink) 45%, transparent))');
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('a declared colour rides as a clamped pair, so the mode still gates it', () => {
|
|
138
|
+
// The manifest's `color` is the plugin's own brand. It is set as custom
|
|
139
|
+
// properties rather than as a colour, because `monochrome` must still paint
|
|
140
|
+
// the palette ink — the stylesheet reads them only under
|
|
141
|
+
// `[data-icon-style="color"]`. Two values, because `#34d399` is 1.9:1 on
|
|
142
|
+
// white paper and 7:1 on dark: `legiblePair` derives the light one.
|
|
143
|
+
const el = paint(h(PluginMark, { name: 'Demo', iconUrl: '/api/panels/icon/demo/icon.svg', color: '#34d399' }));
|
|
144
|
+
const span = el.querySelector('span');
|
|
145
|
+
const light = span?.style.getPropertyValue('--plugin-declared-light') ?? '';
|
|
146
|
+
|
|
147
|
+
expect(light).toMatch(/^#[0-9a-f]{6}$/);
|
|
148
|
+
expect(light).not.toBe('#34d399');
|
|
149
|
+
expect(span?.style.getPropertyValue('--plugin-declared-dark')).toBe('#34d399');
|
|
150
|
+
expect(span?.style.backgroundColor).toBe('var(--plugin-color, currentColor)');
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
test('no declared colour leaves both variables unset, so the hue applies', () => {
|
|
154
|
+
const span = paint(h(PluginMark, { name: 'Demo' })).querySelector('span');
|
|
155
|
+
|
|
156
|
+
expect(span?.style.getPropertyValue('--plugin-declared-light')).toBe('');
|
|
157
|
+
expect(span?.style.getPropertyValue('--plugin-declared-dark')).toBe('');
|
|
158
|
+
expect(span?.style.getPropertyValue('--icon-hue')).not.toBe('');
|
|
159
|
+
});
|
|
160
|
+
|
|
112
161
|
test('falls back to the plugin initials when no icon is declared', () => {
|
|
113
162
|
const el = paint(h(PluginMark, { name: 'Session Info', size: 16 }));
|
|
114
163
|
|