@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
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Dark palettes ported verbatim from OpenChamber
|
|
8
|
+
* (packages/ui/src/lib/theme/themes/*.json, MIT, upstream `main`), split out of
|
|
9
|
+
* `dark.ts` only because that file is at the 350-line ceiling.
|
|
10
|
+
*
|
|
11
|
+
* Only the values Kabmo consumes are carried: surface.background -> canvas,
|
|
12
|
+
* surface.elevated -> paper, surface.foreground -> ink, status.* -> signal
|
|
13
|
+
* colors, primary.base -> accent. Field order is the swatch order.
|
|
14
|
+
*
|
|
15
|
+
* The same two normalizations as `light-extended.ts` apply: `osaka-jade`'s ids
|
|
16
|
+
* are spelled `${family}-${variant}` here (upstream's dark file names itself
|
|
17
|
+
* without the variant), and `opencode`'s opaque `#rrggbbff` values drop the
|
|
18
|
+
* alpha byte.
|
|
19
|
+
*
|
|
20
|
+
* Generated data — re-port rather than hand-editing a color here.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type { ThemePalette } from '@/shared/types/theme';
|
|
24
|
+
|
|
25
|
+
export const DARK_EXTENDED_PALETTES = [
|
|
26
|
+
{
|
|
27
|
+
id: 'aurora-dark',
|
|
28
|
+
name: 'Aurora',
|
|
29
|
+
family: 'aurora',
|
|
30
|
+
variant: 'dark',
|
|
31
|
+
canvas: '#131515',
|
|
32
|
+
paper: '#181b1b',
|
|
33
|
+
ink: '#ced2d2',
|
|
34
|
+
error: '#df746d',
|
|
35
|
+
success: '#6bce71',
|
|
36
|
+
info: '#67abe5',
|
|
37
|
+
warning: '#e2a85c',
|
|
38
|
+
meta: '#239d6a',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'cursor-dark',
|
|
42
|
+
name: 'Cursor',
|
|
43
|
+
family: 'cursor',
|
|
44
|
+
variant: 'dark',
|
|
45
|
+
canvas: '#1a1a1a',
|
|
46
|
+
paper: '#232323',
|
|
47
|
+
ink: '#e1e1e2',
|
|
48
|
+
error: '#c6747b',
|
|
49
|
+
success: '#A3BE8C',
|
|
50
|
+
info: '#81A1C1',
|
|
51
|
+
warning: '#EBCB8B',
|
|
52
|
+
meta: '#4c9df3',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'everforest-dark',
|
|
56
|
+
name: 'Everforest',
|
|
57
|
+
family: 'everforest',
|
|
58
|
+
variant: 'dark',
|
|
59
|
+
canvas: '#1c252b',
|
|
60
|
+
paper: '#222c32',
|
|
61
|
+
ink: '#f0efed',
|
|
62
|
+
error: '#e67e80',
|
|
63
|
+
success: '#a7c080',
|
|
64
|
+
info: '#83afe0',
|
|
65
|
+
warning: '#e69875',
|
|
66
|
+
meta: '#a7c080',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: 'github-dark',
|
|
70
|
+
name: 'GitHub',
|
|
71
|
+
family: 'github',
|
|
72
|
+
variant: 'dark',
|
|
73
|
+
canvas: '#0a0e14',
|
|
74
|
+
paper: '#13171e',
|
|
75
|
+
ink: '#d7d8da',
|
|
76
|
+
error: '#f85149',
|
|
77
|
+
success: '#3fb950',
|
|
78
|
+
info: '#83afe0',
|
|
79
|
+
warning: '#e3b341',
|
|
80
|
+
meta: '#58a6ff',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'material-dark',
|
|
84
|
+
name: 'Material',
|
|
85
|
+
family: 'material',
|
|
86
|
+
variant: 'dark',
|
|
87
|
+
canvas: '#1a252a',
|
|
88
|
+
paper: '#212c31',
|
|
89
|
+
ink: '#edeff0',
|
|
90
|
+
error: '#f07178',
|
|
91
|
+
success: '#c3e88d',
|
|
92
|
+
info: '#83afe0',
|
|
93
|
+
warning: '#ffcb6b',
|
|
94
|
+
meta: '#82aaff',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'opencode-dark',
|
|
98
|
+
name: 'OpenCode',
|
|
99
|
+
family: 'opencode',
|
|
100
|
+
variant: 'dark',
|
|
101
|
+
canvas: '#161616',
|
|
102
|
+
paper: '#1f1f1f',
|
|
103
|
+
ink: '#dfdfdf',
|
|
104
|
+
error: '#f17471',
|
|
105
|
+
success: '#6bd586',
|
|
106
|
+
info: '#7698fd',
|
|
107
|
+
warning: '#f2cf76',
|
|
108
|
+
meta: '#637ef8',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'osaka-jade-dark',
|
|
112
|
+
name: 'Osaka Jade',
|
|
113
|
+
family: 'osaka-jade',
|
|
114
|
+
variant: 'dark',
|
|
115
|
+
canvas: '#0a1611',
|
|
116
|
+
paper: '#121f18',
|
|
117
|
+
ink: '#d9dbd6',
|
|
118
|
+
error: '#ff5345',
|
|
119
|
+
success: '#63b07a',
|
|
120
|
+
info: '#82aecb',
|
|
121
|
+
warning: '#e7c831',
|
|
122
|
+
meta: '#2dd5b7',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'rose-pine-dark',
|
|
126
|
+
name: 'Rose Pine',
|
|
127
|
+
family: 'rose-pine',
|
|
128
|
+
variant: 'dark',
|
|
129
|
+
canvas: '#12101d',
|
|
130
|
+
paper: '#1c1a28',
|
|
131
|
+
ink: '#dbdade',
|
|
132
|
+
error: '#eb6f92',
|
|
133
|
+
success: '#80b888',
|
|
134
|
+
info: '#9ccfd8',
|
|
135
|
+
warning: '#f6c177',
|
|
136
|
+
meta: '#9ccfd8',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: 'vercel-dark',
|
|
140
|
+
name: 'Vercel',
|
|
141
|
+
family: 'vercel',
|
|
142
|
+
variant: 'dark',
|
|
143
|
+
canvas: '#000000',
|
|
144
|
+
paper: '#070707',
|
|
145
|
+
ink: '#cfcfcf',
|
|
146
|
+
error: '#E5484D',
|
|
147
|
+
success: '#46A758',
|
|
148
|
+
info: '#52A8FF',
|
|
149
|
+
warning: '#FFB224',
|
|
150
|
+
meta: '#0674f3',
|
|
151
|
+
},
|
|
152
|
+
] as const satisfies readonly ThemePalette[];
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Light palettes ported verbatim from OpenChamber
|
|
8
|
+
* (packages/ui/src/lib/theme/themes/*.json, MIT, upstream `main`), split out of
|
|
9
|
+
* `light.ts` only because that file is at the 350-line ceiling.
|
|
10
|
+
*
|
|
11
|
+
* Only the values Kabmo consumes are carried: surface.background -> canvas,
|
|
12
|
+
* surface.elevated -> paper, surface.foreground -> ink, status.* -> signal
|
|
13
|
+
* colors, primary.base -> accent. Field order is the swatch order.
|
|
14
|
+
*
|
|
15
|
+
* These are the families upstream added AFTER the snapshot `light.ts` records,
|
|
16
|
+
* and they are the ones this catalog was missing. Two normalizations, stated
|
|
17
|
+
* because neither changes a color:
|
|
18
|
+
*
|
|
19
|
+
* - `osaka-jade-refined`'s upstream ids disagree across the pair (the dark file
|
|
20
|
+
* calls itself `osaka-jade-refined`); the catalog's own `${family}-${variant}`
|
|
21
|
+
* shape is used instead, and the shared name drops the per-variant suffix.
|
|
22
|
+
* - `opencode`'s JSON carries `#rrggbbff` — opaque, so the alpha byte is
|
|
23
|
+
* dropped. An 8-digit value that only ever says "1.0" is noise in a palette.
|
|
24
|
+
*
|
|
25
|
+
* Generated data — re-port rather than hand-editing a color here.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import type { ThemePalette } from '@/shared/types/theme';
|
|
29
|
+
|
|
30
|
+
export const LIGHT_EXTENDED_PALETTES = [
|
|
31
|
+
{
|
|
32
|
+
id: 'aurora-light',
|
|
33
|
+
name: 'Aurora',
|
|
34
|
+
family: 'aurora',
|
|
35
|
+
variant: 'light',
|
|
36
|
+
canvas: '#fdfcfa',
|
|
37
|
+
paper: '#f0f3f1',
|
|
38
|
+
ink: '#48423d',
|
|
39
|
+
error: '#b63b32',
|
|
40
|
+
success: '#507308',
|
|
41
|
+
info: '#1b69ad',
|
|
42
|
+
warning: '#975d04',
|
|
43
|
+
meta: '#063e2a',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'cursor-light',
|
|
47
|
+
name: 'Cursor',
|
|
48
|
+
family: 'cursor',
|
|
49
|
+
variant: 'light',
|
|
50
|
+
canvas: '#FCFCFC',
|
|
51
|
+
paper: '#f2f2f2',
|
|
52
|
+
ink: '#454a50',
|
|
53
|
+
error: '#A3424B',
|
|
54
|
+
success: '#467037',
|
|
55
|
+
info: '#315D9B',
|
|
56
|
+
warning: '#806015',
|
|
57
|
+
meta: '#2567A8',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'everforest-light',
|
|
61
|
+
name: 'Everforest',
|
|
62
|
+
family: 'everforest',
|
|
63
|
+
variant: 'light',
|
|
64
|
+
canvas: '#fdf8e8',
|
|
65
|
+
paper: '#f5f2e2',
|
|
66
|
+
ink: '#3b474e',
|
|
67
|
+
error: '#c4222a',
|
|
68
|
+
success: '#66731b',
|
|
69
|
+
info: '#366eaa',
|
|
70
|
+
warning: '#ad5410',
|
|
71
|
+
meta: '#65740b',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'github-light',
|
|
75
|
+
name: 'GitHub',
|
|
76
|
+
family: 'github',
|
|
77
|
+
variant: 'light',
|
|
78
|
+
canvas: '#ffffff',
|
|
79
|
+
paper: '#f5f5f4',
|
|
80
|
+
ink: '#464a4e',
|
|
81
|
+
error: '#8f0617',
|
|
82
|
+
success: '#105122',
|
|
83
|
+
info: '#09448f',
|
|
84
|
+
warning: '#664407',
|
|
85
|
+
meta: '#0f69d8',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'material-light',
|
|
89
|
+
name: 'Material',
|
|
90
|
+
family: 'material',
|
|
91
|
+
variant: 'light',
|
|
92
|
+
canvas: '#fafafa',
|
|
93
|
+
paper: '#f1f1f0',
|
|
94
|
+
ink: '#3e484c',
|
|
95
|
+
error: '#aa0d15',
|
|
96
|
+
success: '#537702',
|
|
97
|
+
info: '#12787f',
|
|
98
|
+
warning: '#8f6510',
|
|
99
|
+
meta: '#19787f',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: 'opencode-light',
|
|
103
|
+
name: 'OpenCode',
|
|
104
|
+
family: 'opencode',
|
|
105
|
+
variant: 'light',
|
|
106
|
+
canvas: '#ffffff',
|
|
107
|
+
paper: '#fafafa',
|
|
108
|
+
ink: '#4a4a4a',
|
|
109
|
+
error: '#b82d35',
|
|
110
|
+
success: '#18833f',
|
|
111
|
+
info: '#3250df',
|
|
112
|
+
warning: '#8c6e24',
|
|
113
|
+
meta: '#3b5cf6',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'osaka-jade-light',
|
|
117
|
+
name: 'Osaka Jade',
|
|
118
|
+
family: 'osaka-jade',
|
|
119
|
+
variant: 'light',
|
|
120
|
+
canvas: '#f1eee8',
|
|
121
|
+
paper: '#e7e4de',
|
|
122
|
+
ink: '#40463e',
|
|
123
|
+
error: '#8f110b',
|
|
124
|
+
success: '#02532a',
|
|
125
|
+
info: '#33679f',
|
|
126
|
+
warning: '#73650e',
|
|
127
|
+
meta: '#197160',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 'rose-pine-light',
|
|
131
|
+
name: 'Rose Pine',
|
|
132
|
+
family: 'rose-pine',
|
|
133
|
+
variant: 'light',
|
|
134
|
+
canvas: '#fbf5ef',
|
|
135
|
+
paper: '#f5ede7',
|
|
136
|
+
ink: '#464061',
|
|
137
|
+
error: '#942a50',
|
|
138
|
+
success: '#347846',
|
|
139
|
+
info: '#0c4b62',
|
|
140
|
+
warning: '#965f0b',
|
|
141
|
+
meta: '#177394',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: 'vercel-light',
|
|
145
|
+
name: 'Vercel',
|
|
146
|
+
family: 'vercel',
|
|
147
|
+
variant: 'light',
|
|
148
|
+
canvas: '#ffffff',
|
|
149
|
+
paper: '#f4f4f4',
|
|
150
|
+
ink: '#4a4a4a',
|
|
151
|
+
error: '#a10725',
|
|
152
|
+
success: '#14621b',
|
|
153
|
+
info: '#0a4ca2',
|
|
154
|
+
warning: '#a35d02',
|
|
155
|
+
meta: '#0769e1',
|
|
156
|
+
},
|
|
157
|
+
] as const satisfies readonly ThemePalette[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The surface style's contract.
|
|
8
|
+
*
|
|
9
|
+
* The rule that matters is the FALLBACK and the DEFAULT: a stored value this
|
|
10
|
+
* build cannot draw must resolve to the shipped default, and that default must
|
|
11
|
+
* be the opaque style — a document that resolved to `glass` by accident would
|
|
12
|
+
* restyle every window on upgrade.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { describe, expect, test } from 'bun:test';
|
|
16
|
+
import {
|
|
17
|
+
DEFAULT_SURFACE_STYLE,
|
|
18
|
+
SURFACE_ATTRIBUTE,
|
|
19
|
+
SURFACE_STYLES,
|
|
20
|
+
SURFACE_STYLE_COPY,
|
|
21
|
+
isSurfaceStyle,
|
|
22
|
+
resolveSurfaceStyle,
|
|
23
|
+
} from '@/shared/lib/theme/surface-style';
|
|
24
|
+
|
|
25
|
+
describe('isSurfaceStyle', () => {
|
|
26
|
+
test('accepts exactly the two styles', () => {
|
|
27
|
+
expect(SURFACE_STYLES.map(isSurfaceStyle)).toEqual([true, true]);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('refuses what another build or a corrupted blob could carry', () => {
|
|
31
|
+
for (const value of ['', 'Glass', 'frosted', 'blurred', 0, 1, true, null, undefined, {}, ['glass']]) {
|
|
32
|
+
expect(isSurfaceStyle(value)).toBe(false);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
describe('resolveSurfaceStyle', () => {
|
|
38
|
+
test('keeps a style this build draws', () => {
|
|
39
|
+
expect(resolveSurfaceStyle('classic')).toBe('classic');
|
|
40
|
+
expect(resolveSurfaceStyle('glass')).toBe('glass');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('an unknown value lands on the shipped default, not on undefined', () => {
|
|
44
|
+
expect(resolveSurfaceStyle('liquid')).toBe(DEFAULT_SURFACE_STYLE);
|
|
45
|
+
expect(resolveSurfaceStyle(undefined)).toBe(DEFAULT_SURFACE_STYLE);
|
|
46
|
+
expect(resolveSurfaceStyle(null)).toBe(DEFAULT_SURFACE_STYLE);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('the style table', () => {
|
|
51
|
+
test('the default is the opaque style, so an upgrade restyles nothing', () => {
|
|
52
|
+
expect(DEFAULT_SURFACE_STYLE).toBe('classic');
|
|
53
|
+
expect(SURFACE_STYLES).toContain(DEFAULT_SURFACE_STYLE);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('the attribute is a plain `data-` name', () => {
|
|
57
|
+
expect(SURFACE_ATTRIBUTE).toBe('data-surface');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('every style carries its own label, caption and description', () => {
|
|
61
|
+
const labels = SURFACE_STYLES.map((style) => SURFACE_STYLE_COPY[style].label);
|
|
62
|
+
expect(new Set(labels).size).toBe(SURFACE_STYLES.length);
|
|
63
|
+
for (const style of SURFACE_STYLES) {
|
|
64
|
+
expect(SURFACE_STYLE_COPY[style].description.length).toBeGreaterThan(0);
|
|
65
|
+
expect(SURFACE_STYLE_COPY[style].caption.length).toBeGreaterThan(0);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* How the app's surfaces are painted, as ONE of two styles.
|
|
8
|
+
*
|
|
9
|
+
* This is a PRESENTATION choice over the same shell: both styles render the
|
|
10
|
+
* same panels, rows, controls and dialogs. Nothing is hidden, moved or
|
|
11
|
+
* re-ordered — only the material the surfaces are cut from changes, which is
|
|
12
|
+
* why this module states names and copy while `src/client/tailwind.css` states
|
|
13
|
+
* every pixel.
|
|
14
|
+
*
|
|
15
|
+
* - `classic` — opaque paper over the palette's canvas. The look Kabmo has
|
|
16
|
+
* always shipped, and the DEFAULT: an upgrade must not restyle a window the
|
|
17
|
+
* user did not ask to change (the rule `DEFAULT_SIDEBAR_STYLE` follows).
|
|
18
|
+
* - `glass` — one frosted plane over a palette-coloured aura, with the
|
|
19
|
+
* panels above it as translucent tints. The plane owns the blur (a single
|
|
20
|
+
* `backdrop-filter` per window), so the panel count does not decide the
|
|
21
|
+
* frame budget.
|
|
22
|
+
*
|
|
23
|
+
* The style reaches the document as `data-surface` on `<html>`, never as a
|
|
24
|
+
* prop: the sidebar, the navbar, the composer and every modal are separate
|
|
25
|
+
* subtrees, and a prop would be one call site each — the exact shape that lets
|
|
26
|
+
* one surface stay classic while the rest turn to glass.
|
|
27
|
+
*
|
|
28
|
+
* A style added here without a CSS rule renders EXACTLY like `classic`, and the
|
|
29
|
+
* settings card is the only place that can notice. There is deliberately no
|
|
30
|
+
* error for that: an attribute with no matching rule is a valid document.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
export type SurfaceStyle = 'classic' | 'glass';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The style a document with no stored preference renders at — the one Kabmo
|
|
37
|
+
* shipped before the setting existed, so an upgrade changes nothing.
|
|
38
|
+
*/
|
|
39
|
+
export const DEFAULT_SURFACE_STYLE: SurfaceStyle = 'classic';
|
|
40
|
+
|
|
41
|
+
/** Document attribute carrying the style. Read by CSS only. */
|
|
42
|
+
export const SURFACE_ATTRIBUTE = 'data-surface';
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `app_settings` key holding the style, in the `kabmo_settings` blob.
|
|
46
|
+
*
|
|
47
|
+
* It lives HERE, beside the type and the copy, because two processes read it:
|
|
48
|
+
* the browser (`client/hooks/ui/surface-style.ts`) and the SSR shell that has to
|
|
49
|
+
* paint the first frame (`server/lib/assets/shell-attributes.server.ts`). A key
|
|
50
|
+
* spelled at both ends is a setting that saves and never loads.
|
|
51
|
+
*/
|
|
52
|
+
export const SURFACE_STYLE_SETTING_KEY = 'surfaceStyle';
|
|
53
|
+
|
|
54
|
+
/** Every style, in the order the settings control lists them. */
|
|
55
|
+
export const SURFACE_STYLES = ['classic', 'glass'] as const;
|
|
56
|
+
|
|
57
|
+
/** A stored value written by another build is not a style this one can draw. */
|
|
58
|
+
export function isSurfaceStyle(value: unknown): value is SurfaceStyle {
|
|
59
|
+
return value === 'classic' || value === 'glass';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The style to APPLY for a stored value. Anything this build cannot draw — a
|
|
64
|
+
* value from a newer build, a corrupted blob, `undefined` on a fresh install —
|
|
65
|
+
* resolves to the default rather than to a rule that does not exist.
|
|
66
|
+
*/
|
|
67
|
+
export function resolveSurfaceStyle(value: unknown): SurfaceStyle {
|
|
68
|
+
return isSurfaceStyle(value) ? value : DEFAULT_SURFACE_STYLE;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface SurfaceStyleCopy {
|
|
72
|
+
/** Card title. */
|
|
73
|
+
label: string;
|
|
74
|
+
/** One line under the title: the tradeoff, not the aesthetic. */
|
|
75
|
+
description: string;
|
|
76
|
+
/** The card's miniature caption, so the drawing is not the only cue. */
|
|
77
|
+
caption: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const SURFACE_STYLE_COPY: Record<SurfaceStyle, SurfaceStyleCopy> = {
|
|
81
|
+
classic: {
|
|
82
|
+
label: 'Classic',
|
|
83
|
+
description: 'Opaque panels on the palette canvas. The sharpest text, the cheapest frame, and what an upgrade keeps.',
|
|
84
|
+
caption: 'Opaque · no blur',
|
|
85
|
+
},
|
|
86
|
+
glass: {
|
|
87
|
+
label: 'Glass',
|
|
88
|
+
description: 'One frosted plane under a palette-tinted glow, with translucent panels above it. Softer edges, one blur pass per window.',
|
|
89
|
+
caption: 'Frosted · 1 blur pass',
|
|
90
|
+
},
|
|
91
|
+
};
|
|
@@ -30,7 +30,9 @@ import { mixHex, parseHexColor, relativeLuminance, rgbaToHex } from '@/shared/li
|
|
|
30
30
|
import { THEME_STYLE_ELEMENT_ID, themeStyleSheet } from '@/shared/lib/theme/css';
|
|
31
31
|
import { KABMO_PALETTES } from '@/shared/lib/theme/palettes/kabmo';
|
|
32
32
|
import { DARK_PALETTES } from '@/shared/lib/theme/palettes/dark';
|
|
33
|
+
import { DARK_EXTENDED_PALETTES } from '@/shared/lib/theme/palettes/dark-extended';
|
|
33
34
|
import { LIGHT_PALETTES } from '@/shared/lib/theme/palettes/light';
|
|
35
|
+
import { LIGHT_EXTENDED_PALETTES } from '@/shared/lib/theme/palettes/light-extended';
|
|
34
36
|
import { THEMES } from '@/shared/lib/theme/catalog';
|
|
35
37
|
|
|
36
38
|
const PALETTE_KEYS = [
|
|
@@ -160,7 +162,9 @@ describe('generated stylesheet', () => {
|
|
|
160
162
|
});
|
|
161
163
|
|
|
162
164
|
describe('palette sources', () => {
|
|
163
|
-
const
|
|
165
|
+
const LIGHT_ALL = [...LIGHT_PALETTES, ...LIGHT_EXTENDED_PALETTES];
|
|
166
|
+
const DARK_ALL = [...DARK_PALETTES, ...DARK_EXTENDED_PALETTES];
|
|
167
|
+
const all = [...KABMO_PALETTES, ...LIGHT_ALL, ...DARK_ALL];
|
|
164
168
|
|
|
165
169
|
test('every palette declares the same twelve keys', () => {
|
|
166
170
|
for (const palette of all) {
|
|
@@ -183,16 +187,16 @@ describe('palette sources', () => {
|
|
|
183
187
|
expect(seen.has(palette.id), `duplicate id ${palette.id}`).toBe(false);
|
|
184
188
|
seen.add(palette.id);
|
|
185
189
|
}
|
|
186
|
-
for (const palette of
|
|
187
|
-
for (const palette of
|
|
190
|
+
for (const palette of LIGHT_ALL) expect(palette.variant).toBe('light');
|
|
191
|
+
for (const palette of DARK_ALL) expect(palette.variant).toBe('dark');
|
|
188
192
|
expect(all.length).toBe(THEMES.length);
|
|
189
193
|
});
|
|
190
194
|
|
|
191
195
|
test('the ported families pair up: every light family has a dark twin', () => {
|
|
192
|
-
const light = new Set(
|
|
193
|
-
const dark = new Set(
|
|
194
|
-
expect(
|
|
195
|
-
expect(
|
|
196
|
+
const light = new Set(LIGHT_ALL.map((palette) => palette.family));
|
|
197
|
+
const dark = new Set(DARK_ALL.map((palette) => palette.family));
|
|
198
|
+
expect(light.size).toBe(LIGHT_ALL.length);
|
|
199
|
+
expect(dark.size).toBe(DARK_ALL.length);
|
|
196
200
|
expect([...light].filter((family) => !dark.has(family))).toEqual([]);
|
|
197
201
|
expect([...dark].filter((family) => !light.has(family))).toEqual([]);
|
|
198
202
|
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The menu placement arithmetic, without a layout engine.
|
|
8
|
+
*
|
|
9
|
+
* These are the three outcomes a user can SEE: the panel hangs below the
|
|
10
|
+
* trigger, flips above it near the bottom edge, and clamps inside the window's
|
|
11
|
+
* left/right edges. Each was a real defect before the portal existed — the
|
|
12
|
+
* sidebar's folder menu ran off the bottom of a 460px window, and the phone's
|
|
13
|
+
* server sheet was written `absolute` at 340px, which runs off the right edge of
|
|
14
|
+
* a 390px screen.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { describe, expect, test } from 'bun:test';
|
|
18
|
+
import { placeMenu, type AnchorRect } from '@/shared/lib/ui/menu-anchor';
|
|
19
|
+
|
|
20
|
+
const VIEWPORT = { width: 1200, height: 800 };
|
|
21
|
+
|
|
22
|
+
/** A trailing `⋯` at (x, y): 22px wide, 22px tall. */
|
|
23
|
+
function anchorAt(left: number, top: number): AnchorRect {
|
|
24
|
+
return { left, right: left + 22, top, bottom: top + 22 };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
describe('placeMenu', () => {
|
|
28
|
+
test('it hangs below the trigger, right edges aligned', () => {
|
|
29
|
+
const placement = placeMenu(anchorAt(200, 100), { width: 176, height: 94 }, VIEWPORT);
|
|
30
|
+
// 4px gap below the trigger, and the menu's right edge on the trigger's.
|
|
31
|
+
expect(placement.top).toBe(126);
|
|
32
|
+
expect(placement.left).toBe(222 - 176);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('it flips above when the space below cannot hold it', () => {
|
|
36
|
+
const placement = placeMenu(anchorAt(200, 740), { width: 176, height: 94 }, VIEWPORT);
|
|
37
|
+
// Above the trigger rather than past the bottom edge.
|
|
38
|
+
expect(placement.top).toBe(740 - 4 - 94);
|
|
39
|
+
expect(placement.top + 94).toBeLessThanOrEqual(VIEWPORT.height);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('a menu taller than the window pins to the margin and becomes scrollable', () => {
|
|
43
|
+
const placement = placeMenu(anchorAt(200, 300), { width: 176, height: 2000 }, VIEWPORT);
|
|
44
|
+
expect(placement.top).toBe(8);
|
|
45
|
+
expect(placement.maxHeight).toBe(VIEWPORT.height - 8 - 8);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('a trailing menu cannot run past the right edge', () => {
|
|
49
|
+
// This trigger's right edge is 32px off the window: aligned to it, the menu
|
|
50
|
+
// is still inside the margin, so the clamp is what a trigger ON the edge
|
|
51
|
+
// exercises.
|
|
52
|
+
const placement = placeMenu(anchorAt(1150, 100), { width: 176, height: 94 }, VIEWPORT);
|
|
53
|
+
expect(placement.left + 176).toBe(1172);
|
|
54
|
+
expect(placement.left + 176).toBeLessThanOrEqual(VIEWPORT.width - 8);
|
|
55
|
+
|
|
56
|
+
const onEdge = placeMenu(anchorAt(1190, 100), { width: 176, height: 94 }, VIEWPORT);
|
|
57
|
+
expect(onEdge.left).toBe(VIEWPORT.width - 176 - 8);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('a start-aligned menu cannot run past the left edge', () => {
|
|
61
|
+
const placement = placeMenu(anchorAt(-40, 100), { width: 176, height: 94 }, VIEWPORT, 'start');
|
|
62
|
+
expect(placement.left).toBe(8);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('start alignment puts the menu’s left edge on the trigger’s', () => {
|
|
66
|
+
const placement = placeMenu(anchorAt(500, 100), { width: 176, height: 94 }, VIEWPORT, 'start');
|
|
67
|
+
expect(placement.left).toBe(500);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a popover hangs, as arithmetic.
|
|
8
|
+
*
|
|
9
|
+
* A menu that is placed by CSS alone (`absolute right-0 top-full`) cannot see
|
|
10
|
+
* the edge of the window, so it runs off the bottom of a short window and off
|
|
11
|
+
* the right of a narrow one, and it is placed inside whatever stacking context
|
|
12
|
+
* its trigger happens to live in. Both failure modes were measured on this
|
|
13
|
+
* app's own folder menu and server panel (see `common/anchored-menu/`), which
|
|
14
|
+
* is why the geometry below is computed from the VIEWPORT and then applied to
|
|
15
|
+
* a portalled, `fixed` panel.
|
|
16
|
+
*
|
|
17
|
+
* Pure and viewport-injected (no `window` read) so a test can assert the flip
|
|
18
|
+
* and the clamp without a layout engine.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** The trigger's rectangle in viewport coordinates. */
|
|
22
|
+
export interface AnchorRect {
|
|
23
|
+
top: number;
|
|
24
|
+
right: number;
|
|
25
|
+
bottom: number;
|
|
26
|
+
left: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Which edge of the trigger the menu aligns to.
|
|
31
|
+
*
|
|
32
|
+
* `end` hangs the menu's right edge off the trigger's — what a trailing `⋯`
|
|
33
|
+
* expects. `start` puts the menu's left edge at the trigger's.
|
|
34
|
+
*/
|
|
35
|
+
export type MenuAlign = 'start' | 'end';
|
|
36
|
+
|
|
37
|
+
export interface MenuPlacement {
|
|
38
|
+
top: number;
|
|
39
|
+
left: number;
|
|
40
|
+
/** The panel must scroll rather than run past the bottom edge. */
|
|
41
|
+
maxHeight: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Room kept between a menu and the window's edges. */
|
|
45
|
+
const MARGIN = 8;
|
|
46
|
+
|
|
47
|
+
/** Room between the trigger and the menu that hangs off it. */
|
|
48
|
+
const GAP = 4;
|
|
49
|
+
|
|
50
|
+
function clamp(value: number, min: number, max: number): number {
|
|
51
|
+
return Math.max(min, Math.min(value, max));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Place a menu of `size` against `anchor`, inside `viewport`.
|
|
56
|
+
*
|
|
57
|
+
* Below the trigger first, because that is where a menu is expected; above it
|
|
58
|
+
* when the space below cannot hold it and the space above can. When neither
|
|
59
|
+
* fits, it pins to the top margin and `maxHeight` makes the panel scroll — a
|
|
60
|
+
* menu taller than the window is readable, one pushed past the bottom edge is
|
|
61
|
+
* not.
|
|
62
|
+
*/
|
|
63
|
+
export function placeMenu(
|
|
64
|
+
anchor: AnchorRect,
|
|
65
|
+
size: { width: number; height: number },
|
|
66
|
+
viewport: { width: number; height: number },
|
|
67
|
+
align: MenuAlign = 'end',
|
|
68
|
+
): MenuPlacement {
|
|
69
|
+
const below = anchor.bottom + GAP;
|
|
70
|
+
const above = anchor.top - GAP;
|
|
71
|
+
|
|
72
|
+
let top: number;
|
|
73
|
+
if (below + size.height + MARGIN <= viewport.height) top = below;
|
|
74
|
+
else if (above - size.height >= MARGIN) top = above - size.height;
|
|
75
|
+
else top = MARGIN;
|
|
76
|
+
|
|
77
|
+
const widest = Math.max(MARGIN, viewport.width - size.width - MARGIN);
|
|
78
|
+
const left = align === 'end'
|
|
79
|
+
? clamp(anchor.right - size.width, MARGIN, widest)
|
|
80
|
+
: clamp(anchor.left, MARGIN, widest);
|
|
81
|
+
|
|
82
|
+
return { top, left, maxHeight: Math.max(MARGIN, viewport.height - top - MARGIN) };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** The trigger's rect, as the anchor type above. */
|
|
86
|
+
export function anchorRectOf(element: Element): AnchorRect {
|
|
87
|
+
const rect = element.getBoundingClientRect();
|
|
88
|
+
return { top: rect.top, right: rect.right, bottom: rect.bottom, left: rect.left };
|
|
89
|
+
}
|