@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
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { AlertTriangle, FileX, Loader2 } from 'lucide-preact';
|
|
21
|
-
import {
|
|
21
|
+
import { MarkdownReview } from '@/client/components/common/markdown-review';
|
|
22
22
|
|
|
23
23
|
interface PreviewScrollerProps {
|
|
24
24
|
fileName: string;
|
|
@@ -36,6 +36,15 @@ interface PreviewScrollerProps {
|
|
|
36
36
|
unsupported: string | null | undefined;
|
|
37
37
|
/** The read's failure message, when the bytes could not be fetched. */
|
|
38
38
|
loadError: string | null | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Review mode, owned by the phone's own header.
|
|
41
|
+
*
|
|
42
|
+
* The same surface as the desktop preview, deliberately: the phone had no way
|
|
43
|
+
* to review a document before, and a second implementation would let the two
|
|
44
|
+
* disagree about what a mark means.
|
|
45
|
+
*/
|
|
46
|
+
reviewActive: boolean;
|
|
47
|
+
onExitReview: () => void;
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
export function PreviewScroller({
|
|
@@ -50,6 +59,8 @@ export function PreviewScroller({
|
|
|
50
59
|
isLoading,
|
|
51
60
|
unsupported,
|
|
52
61
|
loadError,
|
|
62
|
+
reviewActive,
|
|
63
|
+
onExitReview,
|
|
53
64
|
}: PreviewScrollerProps) {
|
|
54
65
|
return (
|
|
55
66
|
<div
|
|
@@ -85,7 +96,12 @@ export function PreviewScroller({
|
|
|
85
96
|
timeline's system), see the desktop editor for why there is no
|
|
86
97
|
`prose` wrapper. */
|
|
87
98
|
<div className="p-4 bg-paper text-ink min-h-full font-sans" style={{ fontSize: `${fontSize}px` }}>
|
|
88
|
-
<
|
|
99
|
+
<MarkdownReview
|
|
100
|
+
content={content}
|
|
101
|
+
file={{ name: fileName, path, root, repo }}
|
|
102
|
+
active={reviewActive}
|
|
103
|
+
onExit={onExitReview}
|
|
104
|
+
/>
|
|
89
105
|
</div>
|
|
90
106
|
)}
|
|
91
107
|
</div>
|
|
@@ -46,7 +46,7 @@ export function MobileSessionHeader({ onClose, viewLabel = 'Sessions' }: { onClo
|
|
|
46
46
|
>
|
|
47
47
|
<div className="flex items-center space-x-2.5 titlebar-no-drag min-w-0">
|
|
48
48
|
<span className="font-bold text-sm tracking-tight flex items-center flex-shrink-0">
|
|
49
|
-
<BrandWordmark className="text-[16px]" />
|
|
49
|
+
<BrandWordmark className="text-[16px]" glow />
|
|
50
50
|
</span>
|
|
51
51
|
<span className="text-ink/25 text-xs select-none flex-shrink-0">/</span>
|
|
52
52
|
<span className="text-[11px] font-semibold text-ink/60 uppercase tracking-wider font-mono truncate">{viewLabel}</span>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ChevronDown, ChevronRight, GitBranch, MessageSquare, Plus } from 'lucide-preact';
|
|
2
|
+
import { FolderItemMenu } from '@/client/components/mobile/mobile-session-sidebar/ItemMenu';
|
|
3
3
|
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
4
4
|
import { MobileSessionRow } from '@/client/components/mobile/mobile-session-sidebar/SessionRow';
|
|
5
5
|
import { SubagentList } from '@/client/components/common/subagent-list';
|
|
6
|
-
import { WorkspaceOptionsMenu } from '@/client/components/common/workspace-options-menu';
|
|
7
6
|
import { useWorktreeDialog } from '@/client/components/mobile/mobile-session-sidebar/WorktreeDialog';
|
|
8
7
|
import { useShowMore } from '@/client/hooks/ui/show-more';
|
|
9
8
|
import { useExpandedSessions } from '@/client/hooks/workspace/expanded-sessions';
|
|
@@ -12,7 +11,6 @@ import { useSessionDelete } from '@/client/hooks/workspace/session-delete';
|
|
|
12
11
|
import { SessionDeleteModal } from '@/client/components/common/session-delete-modal';
|
|
13
12
|
import { getProjectIcon } from '@/shared/lib/workspace/project-icon';
|
|
14
13
|
import { relativeTimeAgo } from '@/shared/lib/workspace/relative-time';
|
|
15
|
-
import { useOnClickOutside } from '@/client/hooks/ui/on-click-outside';
|
|
16
14
|
import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
|
|
17
15
|
import type { WorkspaceFolderData } from '@/shared/types';
|
|
18
16
|
import type { BatchBinding } from '@/client/components/common/batch-selection/types';
|
|
@@ -69,8 +67,6 @@ export function MobileSessionCategory({
|
|
|
69
67
|
const [searchParams] = useSearchParams();
|
|
70
68
|
const urlSubagentId = searchParams.get('subagent');
|
|
71
69
|
const urlSessionId = searchParams.get('sessionId');
|
|
72
|
-
const [showMenu, setShowMenu] = useState(false);
|
|
73
|
-
const menuRef = useRef<HTMLDivElement>(null);
|
|
74
70
|
const {
|
|
75
71
|
confirmDelete,
|
|
76
72
|
requestDelete,
|
|
@@ -84,29 +80,12 @@ export function MobileSessionCategory({
|
|
|
84
80
|
} = useWorkspaceFolderActions(folder, refresh, onToast);
|
|
85
81
|
const sessionDelete = useSessionDelete();
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
handlePin();
|
|
94
|
-
setShowMenu(false);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const onDelete = () => {
|
|
98
|
-
handleDelete();
|
|
99
|
-
setShowMenu(false);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Same rule as the desktop header: reveal is an action, so the menu closes
|
|
103
|
-
// on it — otherwise the toast would render behind the menu that triggered it.
|
|
104
|
-
const onOpenFolder = handleOpenFolder
|
|
105
|
-
? () => {
|
|
106
|
-
handleOpenFolder();
|
|
107
|
-
setShowMenu(false);
|
|
108
|
-
}
|
|
109
|
-
: undefined;
|
|
83
|
+
// The `⋯` menu closes itself around each action (`ItemMenu`), so these stay
|
|
84
|
+
// plain: the reveal path is the one that used to leave the menu over its own
|
|
85
|
+
// toast.
|
|
86
|
+
const onPin = handlePin;
|
|
87
|
+
const onDelete = handleDelete;
|
|
88
|
+
const onOpenFolder = handleOpenFolder ?? undefined;
|
|
110
89
|
|
|
111
90
|
// Archived rows are filtered first; the badge reports the visible set so the
|
|
112
91
|
// count always matches what the list can actually show.
|
|
@@ -213,44 +192,20 @@ export function MobileSessionCategory({
|
|
|
213
192
|
<Plus size={15} />
|
|
214
193
|
</button>
|
|
215
194
|
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
<div className="absolute right-0 top-full mt-1 w-48 bg-paper border border-ink/15 rounded-lg shadow-lg z-50 py-1 text-xs">
|
|
231
|
-
<WorkspaceOptionsMenu
|
|
232
|
-
variant="mobile"
|
|
233
|
-
isPinned={folder.isPinned}
|
|
234
|
-
onOpenFolder={onOpenFolder}
|
|
235
|
-
onNewWorktree={
|
|
236
|
-
onNewWorktreeSession && folder.project_path
|
|
237
|
-
? () => { setShowMenu(false); worktreeDialog.open(); }
|
|
238
|
-
: undefined
|
|
239
|
-
}
|
|
240
|
-
onSelectSessions={
|
|
241
|
-
onStartSessionSelection
|
|
242
|
-
? () => { setShowMenu(false); onStartSessionSelection(folder.id); }
|
|
243
|
-
: undefined
|
|
244
|
-
}
|
|
245
|
-
confirmDelete={confirmDelete}
|
|
246
|
-
onPin={onPin}
|
|
247
|
-
onDelete={onDelete}
|
|
248
|
-
onRequestDelete={requestDelete}
|
|
249
|
-
onCancelDelete={cancelDelete}
|
|
250
|
-
/>
|
|
251
|
-
</div>
|
|
252
|
-
)}
|
|
253
|
-
</div>
|
|
195
|
+
<FolderItemMenu
|
|
196
|
+
folder={folder}
|
|
197
|
+
canWorktree={Boolean(onNewWorktreeSession && folder.project_path)}
|
|
198
|
+
onOpenFolder={onOpenFolder}
|
|
199
|
+
onNewWorktree={onNewWorktreeSession ? () => worktreeDialog.open() : undefined}
|
|
200
|
+
onSelectSessions={
|
|
201
|
+
onStartSessionSelection ? () => onStartSessionSelection(folder.id) : undefined
|
|
202
|
+
}
|
|
203
|
+
confirmDelete={confirmDelete}
|
|
204
|
+
onPin={onPin}
|
|
205
|
+
onDelete={onDelete}
|
|
206
|
+
onRequestDelete={requestDelete}
|
|
207
|
+
onCancelDelete={cancelDelete}
|
|
208
|
+
/>
|
|
254
209
|
|
|
255
210
|
{/* The disclosure glyph's BOX ends on the list's content edge — the
|
|
256
211
|
same x the toolbar row's last control ends on above it — and its
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The phone drawer's folder `⋯`: the trigger and its menu, in one module.
|
|
8
|
+
*
|
|
9
|
+
* Split out of the drawer row because the panel is PORTALLED (see
|
|
10
|
+
* `common/anchored-menu/`): the drawer list is a scroller, and the panel it used
|
|
11
|
+
* to hang inside was clipped at the scroller's edge and lost to the sticky
|
|
12
|
+
* workspace headers once the list scrolled — measured with `elementFromPoint`.
|
|
13
|
+
* Keeping the trigger and the panel together means the anchor is captured where
|
|
14
|
+
* the click happens and the drawer row holds no menu state of its own.
|
|
15
|
+
*
|
|
16
|
+
* Every action closes the menu before it runs: Pin and Delete paint a toast, and
|
|
17
|
+
* a menu left standing over it hides the answer to the click.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { useRef, useState } from 'preact/hooks';
|
|
21
|
+
import { MoreHorizontal } from 'lucide-preact';
|
|
22
|
+
import { AnchoredMenu } from '@/client/components/common/anchored-menu';
|
|
23
|
+
import { anchorRectOf, type AnchorRect } from '@/shared/lib/ui/menu-anchor';
|
|
24
|
+
import { WorkspaceOptionsMenu } from '@/client/components/common/workspace-options-menu';
|
|
25
|
+
import type { WorkspaceFolderData } from '@/shared/types';
|
|
26
|
+
|
|
27
|
+
export interface FolderItemMenuProps {
|
|
28
|
+
folder: WorkspaceFolderData;
|
|
29
|
+
/** True when this folder is bound to a repository the menu may branch from. */
|
|
30
|
+
canWorktree: boolean;
|
|
31
|
+
onOpenFolder?: () => void;
|
|
32
|
+
onNewWorktree?: () => void;
|
|
33
|
+
onSelectSessions?: () => void;
|
|
34
|
+
confirmDelete: boolean;
|
|
35
|
+
onPin: () => void;
|
|
36
|
+
onDelete: () => void;
|
|
37
|
+
onRequestDelete: () => void;
|
|
38
|
+
onCancelDelete: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The row's trailing control box, matched to its `+` beside it. */
|
|
42
|
+
const TRIGGER_CLASS =
|
|
43
|
+
'p-1.5 rounded-lg hover:bg-ink/10 active:bg-ink/15 text-ink/60 hover:text-ink';
|
|
44
|
+
|
|
45
|
+
export function FolderItemMenu({
|
|
46
|
+
folder,
|
|
47
|
+
canWorktree,
|
|
48
|
+
onOpenFolder,
|
|
49
|
+
onNewWorktree,
|
|
50
|
+
onSelectSessions,
|
|
51
|
+
confirmDelete,
|
|
52
|
+
onPin,
|
|
53
|
+
onDelete,
|
|
54
|
+
onRequestDelete,
|
|
55
|
+
onCancelDelete,
|
|
56
|
+
}: FolderItemMenuProps) {
|
|
57
|
+
const [open, setOpen] = useState(false);
|
|
58
|
+
const triggerRef = useRef<HTMLButtonElement>(null);
|
|
59
|
+
const [anchor, setAnchor] = useState<AnchorRect | null>(null);
|
|
60
|
+
|
|
61
|
+
const run = (action: () => void) => () => {
|
|
62
|
+
setOpen(false);
|
|
63
|
+
action();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div className="relative flex items-center" onClick={(event) => event.stopPropagation()}>
|
|
68
|
+
<button
|
|
69
|
+
ref={triggerRef}
|
|
70
|
+
type="button"
|
|
71
|
+
onClick={(event) => {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
if (triggerRef.current) setAnchor(anchorRectOf(triggerRef.current));
|
|
74
|
+
setOpen((was) => !was);
|
|
75
|
+
}}
|
|
76
|
+
className={TRIGGER_CLASS}
|
|
77
|
+
title="Workspace options"
|
|
78
|
+
aria-label={`Options for ${folder.name}`}
|
|
79
|
+
aria-haspopup="menu"
|
|
80
|
+
aria-expanded={open}
|
|
81
|
+
>
|
|
82
|
+
<MoreHorizontal size={15} />
|
|
83
|
+
</button>
|
|
84
|
+
|
|
85
|
+
<AnchoredMenu
|
|
86
|
+
anchor={open ? anchor : null}
|
|
87
|
+
align="end"
|
|
88
|
+
ariaLabel={`Options for ${folder.name}`}
|
|
89
|
+
className="w-48 rounded-lg border border-ink/15 bg-paper py-1 text-xs shadow-lg"
|
|
90
|
+
onClose={() => {
|
|
91
|
+
setOpen(false);
|
|
92
|
+
onCancelDelete();
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<WorkspaceOptionsMenu
|
|
96
|
+
variant="mobile"
|
|
97
|
+
isPinned={folder.isPinned}
|
|
98
|
+
onOpenFolder={onOpenFolder ? run(onOpenFolder) : undefined}
|
|
99
|
+
onNewWorktree={canWorktree && onNewWorktree ? run(onNewWorktree) : undefined}
|
|
100
|
+
onSelectSessions={onSelectSessions ? run(onSelectSessions) : undefined}
|
|
101
|
+
confirmDelete={confirmDelete}
|
|
102
|
+
onPin={run(onPin)}
|
|
103
|
+
onDelete={run(onDelete)}
|
|
104
|
+
onRequestDelete={onRequestDelete}
|
|
105
|
+
onCancelDelete={onCancelDelete}
|
|
106
|
+
/>
|
|
107
|
+
</AnchoredMenu>
|
|
108
|
+
</div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -229,7 +229,7 @@ export function MobileSessionToolbar({
|
|
|
229
229
|
</button>
|
|
230
230
|
|
|
231
231
|
{optionsOpen && (
|
|
232
|
-
<div className="absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs">
|
|
232
|
+
<div className="glass-popover absolute right-0 top-full mt-2 w-52 bg-paper border border-ink/15 rounded-xl shadow-xl z-50 p-2 text-xs">
|
|
233
233
|
<SortMenu variant="mobile" sortOption={sortOption} onSortChange={onSortChange} />
|
|
234
234
|
</div>
|
|
235
235
|
)}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
import { useCallback, useEffect, useLayoutEffect, useRef } from 'preact/hooks';
|
|
33
33
|
import type { ResolvedPanel } from '@/client/components/workspace/plugin-panel/catalog';
|
|
34
|
-
import {
|
|
34
|
+
import { PanelMark } from '@/client/components/common/panel-mark';
|
|
35
35
|
import { PANEL_MARK_SIZE } from '@/shared/lib/workspace/right-panels';
|
|
36
36
|
import { scrollLeftForReveal } from '@/shared/lib/ui/scroll-reveal';
|
|
37
37
|
|
|
@@ -140,7 +140,15 @@ export function PanelChips({ panels, activeId, onSelect, hasGitChanges = false }
|
|
|
140
140
|
}`}
|
|
141
141
|
title={panel.title}
|
|
142
142
|
>
|
|
143
|
-
|
|
143
|
+
<PanelMark
|
|
144
|
+
panelId={panel.id}
|
|
145
|
+
builtin={panel.builtin}
|
|
146
|
+
icon={panel.builtin ? panel.icon : undefined}
|
|
147
|
+
name={panel.builtin ? panel.label : panel.name}
|
|
148
|
+
{...(panel.iconUrl ? { iconUrl: panel.iconUrl } : {})}
|
|
149
|
+
{...(panel.color ? { color: panel.color } : {})}
|
|
150
|
+
size={PANEL_MARK_SIZE}
|
|
151
|
+
/>
|
|
144
152
|
{active && (
|
|
145
153
|
<span className={panel.id === 'git' ? 'tracking-wide' : undefined}>{panel.label}</span>
|
|
146
154
|
)}
|
|
@@ -189,11 +189,11 @@ export function SettingsModal({
|
|
|
189
189
|
|
|
190
190
|
return (
|
|
191
191
|
<div
|
|
192
|
-
className="fixed inset-0
|
|
192
|
+
className="fixed inset-0 modal-scrim backdrop-blur-[2px] z-50 flex items-center justify-center p-0 md:p-6 animate-in fade-in duration-150"
|
|
193
193
|
onClick={onClose}
|
|
194
194
|
>
|
|
195
195
|
<div
|
|
196
|
-
className="relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-5xl lg:max-w-6xl xl:max-w-[1280px] md:h-[min(90vh,900px)] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink"
|
|
196
|
+
className="glass-overlay relative bg-paper border border-ink/15 md:rounded-2xl shadow-2xl w-full h-full md:max-w-5xl lg:max-w-6xl xl:max-w-[1280px] md:h-[min(90vh,900px)] md:max-h-[92vh] flex flex-col md:flex-row overflow-hidden text-ink"
|
|
197
197
|
onClick={(e) => e.stopPropagation()}
|
|
198
198
|
>
|
|
199
199
|
{/* DESKTOP VIEW: 2-Column Split */}
|
|
@@ -212,13 +212,13 @@ export function SettingsModal({
|
|
|
212
212
|
</div>
|
|
213
213
|
|
|
214
214
|
{/* DESKTOP & MOBILE DETAIL VIEW */}
|
|
215
|
-
<div className={`flex-1 flex-col h-full
|
|
215
|
+
<div className={`flex-1 flex-col h-full overflow-hidden ${isMobileDrilled ? 'flex' : 'hidden md:flex'}`}>
|
|
216
216
|
{/* Header Bar. The height and padding carry the safe-area insets on a
|
|
217
217
|
phone: the modal is full-screen below `md`, so without them the
|
|
218
218
|
back button and the title sit under the status bar / notch, the
|
|
219
219
|
same way the mobile chrome (header, editor, diff) already avoids. */}
|
|
220
220
|
<div
|
|
221
|
-
className="px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0
|
|
221
|
+
className="px-6 border-b border-ink/10 flex items-center justify-between flex-shrink-0"
|
|
222
222
|
style={{
|
|
223
223
|
height: 'calc(4rem + env(safe-area-inset-top, 0px))',
|
|
224
224
|
paddingTop: 'env(safe-area-inset-top, 0px)',
|
|
@@ -125,7 +125,7 @@ export const ProjectSelectorDropdown: FunctionComponent<ProjectSelectorDropdownP
|
|
|
125
125
|
{isOpen && (
|
|
126
126
|
<>
|
|
127
127
|
<div className="fixed inset-0 z-20" onClick={() => setIsOpen(false)} />
|
|
128
|
-
<div className="absolute left-2.5 right-2.5 top-12 z-30 bg-paper border border-ink/15 rounded-lg shadow-lg py-1 animate-in fade-in zoom-in-95 duration-100">
|
|
128
|
+
<div className="glass-popover absolute left-2.5 right-2.5 top-12 z-30 bg-paper border border-ink/15 rounded-lg shadow-lg py-1 animate-in fade-in zoom-in-95 duration-100">
|
|
129
129
|
{optionButtons}
|
|
130
130
|
</div>
|
|
131
131
|
</>
|
|
@@ -149,7 +149,7 @@ export const ProjectSelectorDropdown: FunctionComponent<ProjectSelectorDropdownP
|
|
|
149
149
|
</button>
|
|
150
150
|
|
|
151
151
|
{isOpen && (
|
|
152
|
-
<div className="absolute top-12 left-3 right-3 bg-paper border border-ink/20 rounded-lg shadow-lg z-30 py-1 divide-y divide-ink/5 animate-in fade-in zoom-in-95 duration-100">
|
|
152
|
+
<div className="glass-popover absolute top-12 left-3 right-3 bg-paper border border-ink/20 rounded-lg shadow-lg z-30 py-1 divide-y divide-ink/5 animate-in fade-in zoom-in-95 duration-100">
|
|
153
153
|
{optionButtons}
|
|
154
154
|
</div>
|
|
155
155
|
)}
|
|
@@ -26,6 +26,9 @@ interface SettingsSidebarListProps {
|
|
|
26
26
|
onChangeProject: (project: string) => void;
|
|
27
27
|
/** Real workspace folders; defaults to the shared placeholder list. */
|
|
28
28
|
projectOptions?: ProjectOption[];
|
|
29
|
+
/** Why the list could not be read. An empty list is not the same fact. */
|
|
30
|
+
loadError?: string;
|
|
31
|
+
onRetry?: () => void;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
/**
|
|
@@ -46,6 +49,8 @@ export const SettingsSidebarList: FunctionComponent<SettingsSidebarListProps> =
|
|
|
46
49
|
selectedProject,
|
|
47
50
|
onChangeProject,
|
|
48
51
|
projectOptions,
|
|
52
|
+
loadError,
|
|
53
|
+
onRetry,
|
|
49
54
|
}) => {
|
|
50
55
|
const builtInItems = items.filter((item) => item.isBuiltIn);
|
|
51
56
|
const customItems = items.filter((item) => !item.isBuiltIn);
|
|
@@ -102,6 +107,21 @@ export const SettingsSidebarList: FunctionComponent<SettingsSidebarListProps> =
|
|
|
102
107
|
</div>
|
|
103
108
|
|
|
104
109
|
<div className="flex-1 scrollbar-overlay-container p-1.5 space-y-3 text-xs">
|
|
110
|
+
{loadError && (
|
|
111
|
+
<div className="mx-1 rounded-lg border border-error/30 bg-error/5 px-2.5 py-2 text-[11px] leading-snug text-error">
|
|
112
|
+
<div className="font-semibold">Could not read the list</div>
|
|
113
|
+
<div className="mt-0.5 break-words text-error/80">{loadError}</div>
|
|
114
|
+
{onRetry && (
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
onClick={onRetry}
|
|
118
|
+
className="mt-1.5 rounded border border-error/40 px-2 py-0.5 font-medium hover:bg-error/10 cursor-pointer"
|
|
119
|
+
>
|
|
120
|
+
Retry
|
|
121
|
+
</button>
|
|
122
|
+
)}
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
105
125
|
<div>
|
|
106
126
|
<div className="px-2.5 pt-1.5 pb-1 text-[10px] font-bold text-ink/50 uppercase tracking-wider">
|
|
107
127
|
{builtInLabel}
|
|
@@ -88,6 +88,36 @@ describe('applySettingsSideEffects', () => {
|
|
|
88
88
|
expect(events).toEqual([]);
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
+
test('the surface material is written to the document, and only when it moves', () => {
|
|
92
|
+
installDom();
|
|
93
|
+
const root = globalThis.document.documentElement;
|
|
94
|
+
|
|
95
|
+
applySettingsSideEffects(state(), state({ surfaceStyle: 'glass' }));
|
|
96
|
+
expect(root.getAttribute('data-surface')).toBe('glass');
|
|
97
|
+
|
|
98
|
+
// Same value again: the attribute must survive an unrelated re-render
|
|
99
|
+
// untouched (the writer removes the default, so a stray call would clear it).
|
|
100
|
+
applySettingsSideEffects(state({ surfaceStyle: 'glass' }), state({ surfaceStyle: 'glass', goalDefaultBudget: 1 }));
|
|
101
|
+
expect(root.getAttribute('data-surface')).toBe('glass');
|
|
102
|
+
|
|
103
|
+
applySettingsSideEffects(state({ surfaceStyle: 'glass' }), state({ surfaceStyle: 'classic' }));
|
|
104
|
+
expect(root.hasAttribute('data-surface')).toBe(false);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('the brand-mark style is written to the document, and only when it moves', () => {
|
|
108
|
+
installDom();
|
|
109
|
+
const root = globalThis.document.documentElement;
|
|
110
|
+
|
|
111
|
+
applySettingsSideEffects(state(), state({ iconStyle: 'color' }));
|
|
112
|
+
expect(root.getAttribute('data-icon-style')).toBe('color');
|
|
113
|
+
|
|
114
|
+
applySettingsSideEffects(state({ iconStyle: 'color' }), state({ iconStyle: 'color', goalDefaultBudget: 1 }));
|
|
115
|
+
expect(root.getAttribute('data-icon-style')).toBe('color');
|
|
116
|
+
|
|
117
|
+
applySettingsSideEffects(state({ iconStyle: 'color' }), state({ iconStyle: 'monochrome' }));
|
|
118
|
+
expect(root.hasAttribute('data-icon-style')).toBe(false);
|
|
119
|
+
});
|
|
120
|
+
|
|
91
121
|
test('the editor font still announces when it moves', () => {
|
|
92
122
|
const win = installDom();
|
|
93
123
|
const seen: unknown[] = [];
|
|
@@ -33,6 +33,8 @@ import { applyChatWidthMode } from '@/client/hooks/chat/timeline/width-mode';
|
|
|
33
33
|
import { applyToolRenderMode } from '@/client/hooks/chat/timeline/tool-render-mode';
|
|
34
34
|
import { applySidebarStyle } from '@/client/hooks/workspace/sidebar-style';
|
|
35
35
|
import { applyComposerStyle } from '@/client/hooks/chat/composer/style';
|
|
36
|
+
import { applySurfaceStyle } from '@/client/hooks/ui/surface-style';
|
|
37
|
+
import { applyIconStyle } from '@/client/hooks/ui/icon-style';
|
|
36
38
|
import { EDITOR_FONT_CHANGED_EVENT } from '@/client/hooks/editor/font';
|
|
37
39
|
import { EDITOR_THEME_CHANGED_EVENT } from '@/client/hooks/editor/theme';
|
|
38
40
|
|
|
@@ -87,4 +89,16 @@ export function applySettingsSideEffects(previous: SettingsState, next: Settings
|
|
|
87
89
|
if (next.composerStyle !== previous.composerStyle) {
|
|
88
90
|
applyComposerStyle(next.composerStyle);
|
|
89
91
|
}
|
|
92
|
+
|
|
93
|
+
// The surface material and the brand-mark paint are CSS-only: one attribute
|
|
94
|
+
// each on `<html>`, which every rule already keys on. Written here so the
|
|
95
|
+
// panels behind the modal repaint on the click, and so the next render cannot
|
|
96
|
+
// show a style the document does not carry.
|
|
97
|
+
if (next.surfaceStyle !== previous.surfaceStyle) {
|
|
98
|
+
applySurfaceStyle(next.surfaceStyle);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (next.iconStyle !== previous.iconStyle) {
|
|
102
|
+
applyIconStyle(next.iconStyle);
|
|
103
|
+
}
|
|
90
104
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useState } from 'preact/hooks';
|
|
2
2
|
import type { FunctionComponent } from 'preact/compat';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SettingsState } from '@/shared/types';
|
|
4
4
|
import { AgentSidebarList } from '@/client/components/settings/categories/agent-settings/SidebarList';
|
|
5
5
|
import { AgentDetailPane } from '@/client/components/settings/categories/agent-settings/DetailPane';
|
|
6
6
|
import { LoadingState } from '@/client/components/settings/LoadingState';
|
|
7
|
-
import {
|
|
7
|
+
import { useAgents } from '@/client/hooks/settings/agents';
|
|
8
8
|
import { useSettingsMasterDetail } from '@/client/hooks/settings/master-detail';
|
|
9
9
|
import { SettingsMasterDetail } from '@/client/components/settings/master-detail';
|
|
10
10
|
import { GLOBAL_SCOPE_ID, useWorkspaceRoots } from '@/client/hooks/settings/workspace-roots';
|
|
11
|
+
import { emptyAgentTemplate } from '@/client/components/settings/categories/agent-settings/levels';
|
|
11
12
|
|
|
12
13
|
interface AgentSettingsProps {
|
|
13
14
|
settings: SettingsState;
|
|
@@ -17,55 +18,22 @@ interface AgentSettingsProps {
|
|
|
17
18
|
/**
|
|
18
19
|
* The Agents panel, scoped to one project at a time.
|
|
19
20
|
*
|
|
20
|
-
* The
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* skills and commands panels use, so the three panels agree about what a
|
|
25
|
-
* project scope is.
|
|
21
|
+
* The list IS omp's agent definitions — `~/.omp/agent/agents/*.md` plus the
|
|
22
|
+
* selected workspace's `.omp/agents/*.md` — read and written as files, because
|
|
23
|
+
* that is where omp loads agents from. It used to read a Kabmo-local mirror and
|
|
24
|
+
* POST edits into it, so a saved agent never reached the agent omp ran.
|
|
26
25
|
*/
|
|
27
26
|
export const AgentSettings: FunctionComponent<AgentSettingsProps> = () => {
|
|
28
27
|
const masterDetail = useSettingsMasterDetail();
|
|
29
28
|
const roots = useWorkspaceRoots();
|
|
30
29
|
const [selectedRootId, setSelectedRootId] = useState<string>(GLOBAL_SCOPE_ID);
|
|
30
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
31
31
|
const query = roots.queryFor(selectedRootId);
|
|
32
32
|
|
|
33
|
-
const {
|
|
34
|
-
useCrudList<AgentItem>({
|
|
35
|
-
endpoint: '/api/settings/agents',
|
|
36
|
-
query,
|
|
37
|
-
listKey: 'agents',
|
|
38
|
-
bodyKey: 'agent',
|
|
39
|
-
messages: {
|
|
40
|
-
load: 'Failed to load agents from API:',
|
|
41
|
-
save: 'Failed to save agent via API:',
|
|
42
|
-
delete: 'Failed to delete agent via API:',
|
|
43
|
-
},
|
|
44
|
-
cacheKey: 'agent',
|
|
45
|
-
buildNew: (updated) => ({ ...updated, id: `agent-${Date.now()}`, isBuiltIn: false }),
|
|
46
|
-
buildUpdate: (updated) => updated,
|
|
47
|
-
isDeleteError: (data) => Boolean((data as { error?: string } | null)?.error),
|
|
48
|
-
});
|
|
33
|
+
const { agents, selectedId, selected: selectedAgent, isLoading, loadError, reload, select, save, remove } = useAgents(query);
|
|
49
34
|
|
|
50
|
-
const emptyAgentTemplate: AgentItem = {
|
|
51
|
-
id: `new-${Date.now()}`,
|
|
52
|
-
name: 'new-agent',
|
|
53
|
-
description: '',
|
|
54
|
-
scope: 'user',
|
|
55
|
-
mode: 'subagent',
|
|
56
|
-
overrideModel: 'Not selected',
|
|
57
|
-
thinkingVariant: 'default',
|
|
58
|
-
temperature: null,
|
|
59
|
-
topP: null,
|
|
60
|
-
systemPrompt: 'You are a specialized assistant...',
|
|
61
|
-
isBuiltIn: false,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// A different scope is a different list: `useCrudList` re-reads when the query
|
|
65
|
-
// changes and resolves its selection against the new list, so no extra reset
|
|
66
|
-
// is needed here.
|
|
67
35
|
if (isLoading) {
|
|
68
|
-
return <LoadingState>
|
|
36
|
+
return <LoadingState>Reading omp’s agent definitions…</LoadingState>;
|
|
69
37
|
}
|
|
70
38
|
|
|
71
39
|
return (
|
|
@@ -77,35 +45,40 @@ export const AgentSettings: FunctionComponent<AgentSettingsProps> = () => {
|
|
|
77
45
|
list={
|
|
78
46
|
<AgentSidebarList
|
|
79
47
|
agents={agents}
|
|
80
|
-
selectedAgentId={
|
|
48
|
+
selectedAgentId={isCreating ? null : selectedId}
|
|
81
49
|
onSelectAgent={(id) => {
|
|
50
|
+
setIsCreating(false);
|
|
82
51
|
select(id);
|
|
83
52
|
masterDetail.openDetail();
|
|
84
53
|
}}
|
|
85
54
|
onAddNewAgent={() => {
|
|
86
|
-
|
|
55
|
+
setIsCreating(true);
|
|
87
56
|
masterDetail.openDetail();
|
|
88
57
|
}}
|
|
89
58
|
selectedProject={selectedRootId}
|
|
90
59
|
onChangeProject={setSelectedRootId}
|
|
91
60
|
projectOptions={roots.options}
|
|
61
|
+
{...(loadError ? { loadError, onRetry: reload } : {})}
|
|
92
62
|
/>
|
|
93
63
|
}
|
|
94
64
|
detail={
|
|
95
65
|
<div className="flex-1 h-full overflow-hidden flex flex-col">
|
|
96
|
-
{
|
|
66
|
+
{isCreating ? (
|
|
97
67
|
<AgentDetailPane
|
|
98
|
-
agent={emptyAgentTemplate}
|
|
68
|
+
agent={emptyAgentTemplate()}
|
|
99
69
|
isNew={true}
|
|
100
|
-
onSave={save}
|
|
70
|
+
onSave={(draft) => save(draft)}
|
|
101
71
|
/>
|
|
102
72
|
) : selectedAgent ? (
|
|
103
73
|
<AgentDetailPane
|
|
104
74
|
key={selectedAgent.id}
|
|
105
75
|
agent={selectedAgent}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
76
|
+
onSave={(draft) => save(draft, selectedAgent.fileName)}
|
|
77
|
+
onDelete={async (agent) => {
|
|
78
|
+
const outcome = await remove(agent);
|
|
79
|
+
if (outcome.ok) masterDetail.back();
|
|
80
|
+
return outcome;
|
|
81
|
+
}}
|
|
109
82
|
/>
|
|
110
83
|
) : (
|
|
111
84
|
<div className="flex-1 flex items-center justify-center px-6 text-center text-xs text-ink/40">
|
|
@@ -3,6 +3,8 @@ import type { SettingsState } from '@/shared/types';
|
|
|
3
3
|
import { resolveThemeId } from '@/shared/lib/theme/catalog';
|
|
4
4
|
import { ThemeGrid } from '@/client/components/settings/categories/appearance-settings/ThemeGrid';
|
|
5
5
|
import { SidebarStyleSection } from '@/client/components/settings/categories/appearance-settings/SidebarStyleSection';
|
|
6
|
+
import { SurfaceStyleSection } from '@/client/components/settings/categories/appearance-settings/SurfaceStyleSection';
|
|
7
|
+
import { IconStyleSection } from '@/client/components/settings/categories/appearance-settings/IconStyleSection';
|
|
6
8
|
import { EditorFontSection } from '@/client/components/settings/categories/appearance-settings/EditorFontSection';
|
|
7
9
|
import { EditorThemeSection } from '@/client/components/settings/categories/appearance-settings/EditorThemeSection';
|
|
8
10
|
import { EditorIndentSection } from '@/client/components/settings/categories/appearance-settings/EditorIndentSection';
|
|
@@ -36,6 +38,10 @@ export function AppearanceSettings({ settings, onUpdate }: AppearanceSettingsPro
|
|
|
36
38
|
</div>
|
|
37
39
|
|
|
38
40
|
<SidebarStyleSection settings={settings} onUpdate={onUpdate} />
|
|
41
|
+
|
|
42
|
+
<SurfaceStyleSection settings={settings} onUpdate={onUpdate} />
|
|
43
|
+
|
|
44
|
+
<IconStyleSection settings={settings} onUpdate={onUpdate} />
|
|
39
45
|
</section>
|
|
40
46
|
|
|
41
47
|
<EditorFontSection settings={settings} onUpdate={onUpdate} />
|