@kabmo-labs/kabmo 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -7
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +523 -441
- package/dist/client/static/js/{index-rerjq5th.js → index-fcee4c13.js} +828 -818
- package/dist/client/static/js/index-sxdw908m.css +1 -0
- package/marketplace/plugins/command-runner/package.json +3 -2
- package/marketplace/plugins/git-forge/package.json +3 -2
- package/marketplace/plugins/session-info/package.json +3 -2
- package/marketplace/plugins/stats/package.json +3 -2
- package/package.json +3 -1
- package/src/client/components/auth/login-screen/index.tsx +2 -1
- package/src/client/components/common/ComposerPicker.tsx +1 -1
- package/src/client/components/common/FolderPicker.tsx +2 -2
- package/src/client/components/common/MarkdownRenderer.tsx +136 -89
- package/src/client/components/common/Modal.tsx +2 -2
- package/src/client/components/common/PWAInstallButton.tsx +2 -2
- package/src/client/components/common/ViewportSelector.tsx +1 -1
- package/src/client/components/common/anchored-menu/index.test.tsx +141 -0
- package/src/client/components/common/anchored-menu/index.tsx +147 -0
- package/src/client/components/common/batch-selection/SelectionCheckbox.tsx +2 -1
- package/src/client/components/common/brand-wordmark/index.test.tsx +13 -2
- package/src/client/components/common/brand-wordmark/index.tsx +13 -2
- package/src/client/components/common/checkbox/style.test.ts +139 -0
- package/src/client/components/common/checkbox/style.ts +51 -0
- package/src/client/components/common/context-usage-button/index.tsx +2 -2
- package/src/client/components/common/file-icon/index.tsx +23 -9
- package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +144 -0
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +108 -0
- package/src/client/components/common/markdown-review/index.tsx +129 -0
- package/src/client/components/common/panel-mark/index.tsx +97 -0
- package/src/client/components/common/provider-icon/glyphs.test.ts +1 -1
- package/src/client/components/common/provider-icon/index.test.ts +14 -0
- package/src/client/components/common/provider-icon/index.tsx +4 -0
- package/src/client/components/common/provider-icon/resolve.test.ts +8 -7
- package/src/client/components/common/provider-icon/resolve.ts +16 -3
- package/src/client/components/common/server-control/Panel.tsx +33 -23
- package/src/client/components/common/server-control/index.test.tsx +11 -5
- package/src/client/components/common/server-control/index.tsx +10 -8
- package/src/client/components/common/session-actions-menu/index.tsx +1 -1
- package/src/client/components/common/toolbar-row/index.tsx +1 -1
- package/src/client/components/layout/ActivityBar.tsx +22 -3
- package/src/client/components/layout/LeftDock.tsx +9 -2
- package/src/client/components/layout/PanelVisibilityMenu.tsx +1 -1
- package/src/client/components/layout/WindowAura.tsx +27 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +1 -1
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +2 -2
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +11 -2
- package/src/client/components/layout/desktop-layout/index.tsx +3 -1
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +44 -23
- package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +36 -17
- package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -7
- package/src/client/components/layout/session-sidebar/Header.tsx +1 -1
- package/src/client/components/layout/session-sidebar/OverflowMenu.tsx +1 -1
- package/src/client/components/layout/session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/NotesDialog.tsx +94 -0
- package/src/client/components/layout/session-sidebar/about-modal/VersionLine.test.tsx +68 -0
- package/src/client/components/layout/session-sidebar/about-modal/VersionLine.tsx +36 -0
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +57 -34
- package/src/client/components/layout/session-sidebar/modern/ActionRow.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +40 -14
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +7 -6
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +1 -1
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +2 -2
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +2 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +2 -2
- package/src/client/components/layout/update-popup/ReleaseNotes.tsx +8 -3
- package/src/client/components/layout/update-popup/index.tsx +5 -1
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +13 -15
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +23 -1
- package/src/client/components/mobile/mobile-right-sidebar/MissingFileBanner.tsx +30 -0
- package/src/client/components/mobile/mobile-right-sidebar/PreviewScroller.tsx +18 -2
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +22 -67
- package/src/client/components/mobile/mobile-session-sidebar/ItemMenu.tsx +110 -0
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/mobile/panel-chips.tsx +10 -2
- package/src/client/components/settings/Modal.tsx +4 -4
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +2 -2
- package/src/client/components/settings/SettingsSidebarList.tsx +20 -0
- package/src/client/components/settings/apply-side-effects.test.ts +30 -0
- package/src/client/components/settings/apply-side-effects.ts +14 -0
- package/src/client/components/settings/categories/AgentSettings.tsx +23 -50
- package/src/client/components/settings/categories/AppearanceSettings.tsx +6 -0
- package/src/client/components/settings/categories/CommandSettings.tsx +2 -2
- package/src/client/components/settings/categories/McpSettings.tsx +4 -21
- package/src/client/components/settings/categories/OmpSettings.tsx +147 -194
- package/src/client/components/settings/categories/SkillSettings.tsx +2 -2
- package/src/client/components/settings/categories/TokenUsageSettings.tsx +211 -229
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +229 -237
- package/src/client/components/settings/categories/agent-settings/ModelPicker.tsx +71 -0
- package/src/client/components/settings/categories/agent-settings/SidebarList.tsx +9 -2
- package/src/client/components/settings/categories/agent-settings/levels.ts +38 -0
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +144 -0
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.test.tsx +120 -0
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +180 -0
- package/src/client/components/settings/categories/behavior-settings/Editor.tsx +27 -7
- package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +23 -5
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +75 -33
- package/src/client/components/settings/categories/command-settings/SidebarList.tsx +7 -0
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +93 -77
- package/src/client/components/settings/categories/mcp-settings/EnvVarsSection.tsx +83 -0
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +28 -15
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +20 -0
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +97 -36
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +151 -0
- package/src/client/components/settings/categories/omp-settings/ExtensionsPanel.tsx +68 -32
- package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +119 -0
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +14 -7
- package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +15 -6
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +165 -226
- package/src/client/components/settings/categories/omp-settings/types.ts +28 -0
- package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/BuiltinList.tsx +21 -3
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginMark.test.ts +51 -2
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +43 -10
- package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -1
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +2 -1
- package/src/client/components/settings/categories/project-settings/ModelDropdown.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -1
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +3 -2
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +3 -2
- package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +37 -8
- package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +34 -14
- package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +21 -0
- package/src/client/components/settings/categories/skill-settings/pane.test.tsx +15 -6
- package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +242 -102
- package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +130 -56
- package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +135 -0
- package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +55 -33
- package/src/client/components/settings/categories/token-usage-settings/Provenance.tsx +59 -0
- package/src/client/components/settings/categories/token-usage-settings/panel.test.tsx +239 -0
- package/src/client/components/workspace/browser-panel/Screencast.test.ts +1 -0
- package/src/client/components/workspace/browser-panel/Screencast.tsx +17 -22
- package/src/client/components/workspace/browser-panel/TabStrip.test.tsx +158 -0
- package/src/client/components/workspace/browser-panel/TabStrip.tsx +90 -0
- package/src/client/components/workspace/browser-panel/index.tsx +50 -4
- package/src/client/components/workspace/browser-toolbar/index.tsx +41 -1
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/AiMessageFooter.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +2 -0
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +13 -2
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +4 -3
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +2 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.test.ts +88 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +24 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +34 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +5 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +237 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +191 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +1 -1
- package/src/client/components/workspace/context-panel/CostBreakdownPopover.tsx +1 -1
- package/src/client/components/workspace/diff-panel/MergeDiffView.tsx +21 -7
- package/src/client/components/workspace/diff-panel/changes.test.ts +51 -0
- package/src/client/components/workspace/diff-panel/changes.ts +28 -12
- package/src/client/components/workspace/diff-panel/index.tsx +2 -2
- package/src/client/components/workspace/diff-panel/merge.test.ts +28 -0
- package/src/client/components/workspace/diff-panel/merge.ts +21 -1
- package/src/client/components/workspace/editor/Body.tsx +7 -0
- package/src/client/components/workspace/editor/FileDocument.tsx +15 -21
- package/src/client/components/workspace/editor/FilePane.tsx +12 -0
- package/src/client/components/workspace/editor/PluginRail.tsx +1 -1
- package/src/client/components/workspace/editor/PreviewPane.tsx +70 -0
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
- package/src/client/components/workspace/editor/TabContextMenu.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.tsx +1 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +17 -1
- package/src/client/components/workspace/editor/index.tsx +25 -22
- package/src/client/components/workspace/editor/toolbar-clusters.test.ts +14 -0
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +12 -86
- package/src/client/components/workspace/editor/toolbar-toggle.tsx +53 -0
- package/src/client/components/workspace/editor/toolbar-write-clusters.tsx +112 -0
- package/src/client/components/workspace/file-explorer/ContextMenu.tsx +1 -1
- package/src/client/components/workspace/file-explorer/Modals.tsx +10 -10
- package/src/client/components/workspace/file-explorer/RootMenu.tsx +1 -1
- package/src/client/components/workspace/git-panel/BranchToolbar.test.tsx +130 -0
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +21 -11
- package/src/client/components/workspace/git-panel/CommitBox.tsx +2 -1
- package/src/client/components/workspace/git-panel/Modals.tsx +2 -2
- package/src/client/components/workspace/git-panel/StashSection.tsx +2 -1
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -1
- package/src/client/components/workspace/git-panel/branch-modal/RenameDialog.tsx +2 -1
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -2
- package/src/client/components/workspace/git-panel/commit-modal.test.ts +5 -3
- package/src/client/components/workspace/git-panel/index.tsx +7 -0
- package/src/client/components/workspace/model-dropdown/Panel.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/SpecsTooltip.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +7 -0
- package/src/client/components/workspace/plugin-panel/resolve.tsx +4 -0
- package/src/client/components/workspace/search-panel/Body.tsx +1 -1
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +1 -1
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +5 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.test.tsx +201 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.tsx +112 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.test.tsx +225 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.tsx +217 -0
- package/src/client/components/workspace/user-browser-panel/AnnotateTarget.tsx +99 -0
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +30 -1
- package/src/client/components/workspace/user-browser-panel/index.tsx +81 -2
- package/src/client/data/agent-data/builtin.ts +0 -10
- package/src/client/data/agent-data/orchestrator.ts +0 -45
- package/src/client/data/agent-data/specialist.ts +0 -100
- package/src/client/data/mock/token-usage.ts +170 -120
- package/src/client/data/settings/omp-schema.json +33 -1
- package/src/client/glass.css +785 -0
- package/src/client/glass.test.ts +346 -0
- package/src/client/hooks/browser/use-annotate.test.ts +143 -0
- package/src/client/hooks/browser/use-annotate.ts +98 -0
- package/src/client/hooks/browser/use-close-tab.test.ts +148 -0
- package/src/client/hooks/browser/use-close-tab.ts +67 -0
- package/src/client/hooks/browser/use-screencast.ts +13 -1
- package/src/client/hooks/chat/composer/browser-context.test.ts +117 -0
- package/src/client/hooks/chat/composer/browser-context.ts +40 -16
- package/src/client/hooks/chat/composer/items.test.ts +1 -1
- package/src/client/hooks/chat/composer/review-context.ts +38 -0
- package/src/client/hooks/chat/composer/use-draft.test.ts +132 -0
- package/src/client/hooks/chat/composer/use-draft.ts +31 -2
- package/src/client/hooks/chat/timeline/row-window.test.ts +15 -2
- package/src/client/hooks/editor/use-document-annotations.ts +124 -0
- package/src/client/hooks/editor/use-editor-panel-ui.ts +52 -0
- package/src/client/hooks/editor/use-file-review-mode.ts +35 -0
- package/src/client/hooks/editor/use-preview-review.ts +148 -0
- package/src/client/hooks/settings/agents.ts +149 -0
- package/src/client/hooks/settings/crud-list.test.ts +28 -6
- package/src/client/hooks/settings/crud-list.ts +96 -57
- package/src/client/hooks/settings/omp-config.ts +164 -0
- package/src/client/hooks/settings/useTokenUsage.ts +125 -0
- package/src/client/hooks/settings/write-feedback.test.ts +104 -0
- package/src/client/hooks/settings/write-feedback.ts +63 -0
- package/src/client/hooks/ui/glass-support.ts +57 -0
- package/src/client/hooks/ui/icon-style.ts +59 -0
- package/src/client/hooks/ui/markdown-hydration.ts +125 -0
- package/src/client/hooks/ui/stuck-header.test.ts +188 -0
- package/src/client/hooks/ui/stuck-header.ts +91 -0
- package/src/client/hooks/ui/style-attributes.test.ts +120 -0
- package/src/client/hooks/ui/surface-style.ts +56 -0
- package/src/client/hooks/ui/updates/index.test.ts +100 -1
- package/src/client/hooks/ui/updates/index.ts +50 -0
- package/src/client/hooks/ui/updates/notes.test.ts +138 -0
- package/src/client/hooks/ui/updates/notes.ts +57 -0
- package/src/client/hooks/workspace/panel-hues.ts +23 -0
- package/src/client/lib/browser/element-at.test.ts +229 -0
- package/src/client/lib/browser/element-at.ts +139 -0
- package/src/client/lib/review/client.ts +73 -0
- package/src/client/lib/router/search-params.ts +42 -20
- package/src/client/main.tsx +10 -0
- package/src/client/tailwind.css +329 -11
- package/src/server/lib/assets/shell-attributes.server.ts +80 -0
- package/src/server/lib/assets/shell-attributes.test.ts +86 -0
- package/src/server/lib/btw/lifecycle.server.ts +2 -2
- package/src/server/lib/db/schema.ts +7 -0
- package/src/server/lib/db/seed-terminal.test.ts +4 -0
- package/src/server/lib/omp/config/agent-definitions.test.ts +273 -0
- package/src/server/lib/omp/config/agents.ts +231 -61
- package/src/server/lib/omp/config/definitions.test.ts +9 -105
- package/src/server/lib/omp/config/extensions.ts +16 -7
- package/src/server/lib/omp/config/omp-config-files.test.ts +27 -0
- package/src/server/lib/omp/rpc/constants.test.ts +11 -0
- package/src/server/lib/omp/rpc/constants.ts +15 -0
- package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +1 -0
- package/src/server/lib/omp/rpc/frame-fold-signals.test.ts +2 -30
- package/src/server/lib/omp/rpc/frame-fold.test.ts +55 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
- package/src/server/lib/omp/rpc/manager.ts +2 -2
- package/src/server/lib/omp/rpc/process-helpers.ts +11 -0
- package/src/server/lib/omp/rpc/process.test.ts +106 -0
- package/src/server/lib/omp/rpc/process.ts +39 -18
- package/src/server/lib/omp/rpc/run-settle.server.ts +12 -0
- package/src/server/lib/omp/rpc/run-settle.test.ts +22 -0
- package/src/server/lib/omp/rpc/session-command-guards.ts +5 -0
- package/src/server/lib/omp/rpc/session-commands.test.ts +9 -1
- package/src/server/lib/omp/rpc/session-commands.ts +17 -3
- package/src/server/lib/omp/rpc/terminal-settle.ts +29 -7
- package/src/server/lib/omp/rpc/utility-agent-dir.test.ts +134 -0
- package/src/server/lib/omp/rpc/utility-agent-dir.ts +138 -0
- package/src/server/lib/omp/rpc/utility.ts +12 -0
- package/src/server/lib/panels/bundled-catalog.server.ts +1 -0
- package/src/server/lib/panels/manifest.test.ts +20 -0
- package/src/server/lib/panels/manifest.ts +12 -0
- package/src/server/lib/panels/scan.server.ts +4 -0
- package/src/server/lib/queue/delivery-dispatch.server.test.ts +48 -0
- package/src/server/lib/queue/delivery-harness.ts +8 -4
- package/src/server/lib/queue/delivery.server.test.ts +29 -0
- package/src/server/lib/queue/delivery.server.ts +39 -0
- package/src/server/lib/queue/store.server.test.ts +22 -2
- package/src/server/lib/queue/store.server.ts +33 -11
- package/src/server/lib/review/schema.server.ts +45 -0
- package/src/server/lib/review/store.server.ts +138 -0
- package/src/server/lib/terminal/attach-replay.test.ts +132 -0
- package/src/server/lib/terminal/output.test.ts +166 -0
- package/src/server/lib/terminal/output.ts +104 -0
- package/src/server/lib/terminal/runtime.server.ts +5 -0
- package/src/server/lib/terminal/send-result.test.ts +33 -0
- package/src/server/lib/terminal/send-result.ts +32 -0
- package/src/server/lib/terminal/session.server.ts +45 -11
- package/src/server/lib/terminal/store-liveness.test.ts +4 -0
- package/src/server/lib/updates/active-notes.test.ts +149 -0
- package/src/server/lib/updates/active-notes.ts +75 -0
- package/src/server/lib/updates/changelog-file.ts +42 -11
- package/src/server/lib/updates/changelog.test.ts +15 -1
- package/src/server/lib/updates/omp.ts +42 -15
- package/src/server/lib/updates/release-url.ts +27 -1
- package/src/server/lib/usage/index-parse.test.ts +200 -0
- package/src/server/lib/usage/index-parse.ts +178 -0
- package/src/server/lib/usage/index-query.server.ts +248 -0
- package/src/server/lib/usage/index-scan.server.ts +343 -0
- package/src/server/lib/usage/index-schema.server.ts +82 -0
- package/src/server/lib/usage/index.test.ts +234 -0
- package/src/server/lib/usage/providers.server.ts +4 -53
- package/src/server/plugins/ssr.ts +22 -5
- package/src/server/routes/browser/index.ts +3 -0
- package/src/server/routes/browser/stream.ts +31 -2
- package/src/server/routes/browser/tabs.test.ts +94 -0
- package/src/server/routes/browser/tabs.ts +85 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/review/bindings.ts +11 -0
- package/src/server/routes/review/index.ts +127 -0
- package/src/server/routes/review/routes.test.ts +191 -0
- package/src/server/routes/settings/agents.test.ts +180 -0
- package/src/server/routes/settings/agents.ts +95 -102
- package/src/server/routes/settings/mcp.test.ts +135 -0
- package/src/server/routes/settings/mcp.ts +14 -6
- package/src/server/routes/settings/settings-store-routes.test.ts +6 -113
- package/src/server/routes/telemetry/tokens.test.ts +145 -0
- package/src/server/routes/telemetry/tokens.ts +70 -149
- package/src/server/routes/terminal/ws.ts +6 -5
- package/src/server/routes/updates/index.ts +2 -0
- package/src/server/routes/updates/notes.ts +34 -0
- package/src/server/routes/updates/routes.test.ts +49 -0
- package/src/shared/lib/browser/annotate.test.ts +283 -0
- package/src/shared/lib/browser/annotate.ts +231 -0
- package/src/shared/lib/browser/browser-viewer.test.ts +26 -4
- package/src/shared/lib/browser/frame-gate.test.ts +91 -0
- package/src/shared/lib/browser/frame-gate.ts +69 -0
- package/src/shared/lib/browser/frame-params.test.ts +43 -0
- package/src/shared/lib/browser/frame-params.ts +60 -0
- package/src/shared/lib/browser/frame-pipeline.test.ts +132 -0
- package/src/shared/lib/browser/frame-pipeline.ts +80 -0
- package/src/shared/lib/browser/page-context.ts +60 -4
- package/src/shared/lib/browser/snapshot.test.ts +115 -0
- package/src/shared/lib/browser/snapshot.ts +112 -0
- package/src/shared/lib/browser/tab-close.test.ts +74 -0
- package/src/shared/lib/browser/tab-close.ts +77 -0
- package/src/shared/lib/browser/viewer.ts +45 -26
- package/src/shared/lib/chat/timeline/block-chrome.ts +19 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +17 -4
- package/src/shared/lib/chat/tool/artifact.ts +55 -20
- package/src/shared/lib/chat/tool/bash-facts.ts +96 -0
- package/src/shared/lib/chat/tool/minimized.test.ts +98 -0
- package/src/shared/lib/chat/tool/minimized.ts +64 -0
- package/src/shared/lib/chat/tool/summary.test.ts +28 -8
- package/src/shared/lib/chat/tool/summary.ts +3 -32
- package/src/shared/lib/icons/file-brand-color.ts +38 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +234 -0
- package/src/shared/lib/icons/icon-paint-css.ts +284 -0
- package/src/shared/lib/icons/icon-paint-panel.ts +100 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +230 -0
- package/src/shared/lib/icons/tint.test.ts +273 -0
- package/src/shared/lib/icons/tint.ts +219 -0
- package/src/shared/lib/markdown/blocks/anchor.ts +63 -0
- package/src/shared/lib/markdown/blocks/blocks.test.ts +141 -0
- package/src/shared/lib/markdown/blocks/renderer.ts +120 -0
- package/src/shared/lib/markdown/blocks/scan.ts +100 -0
- package/src/shared/lib/markdown/blocks/types.ts +62 -0
- package/src/shared/lib/markdown/marked.ts +58 -147
- package/src/shared/lib/markdown/math-extensions.ts +168 -0
- package/src/shared/lib/markdown/review/prompt.ts +77 -0
- package/src/shared/lib/markdown/review/reconcile.ts +55 -0
- package/src/shared/lib/markdown/review/review.test.ts +96 -0
- package/src/shared/lib/markdown/xml-sections.test.ts +140 -0
- package/src/shared/lib/markdown/xml-sections.ts +139 -0
- package/src/shared/lib/models/provider/brand-color.test.ts +116 -0
- package/src/shared/lib/models/provider/brand-color.ts +103 -0
- package/src/shared/lib/models/provider/label.ts +57 -0
- package/src/shared/lib/omp/config/agent-file.test.ts +54 -0
- package/src/shared/lib/omp/config/agent-file.ts +43 -0
- package/src/shared/lib/omp/config/row-value.test.ts +95 -0
- package/src/shared/lib/omp/config/row-value.ts +97 -0
- package/src/shared/lib/omp/config/schema.test.ts +31 -0
- package/src/shared/lib/omp/config/schema.ts +6 -0
- package/src/shared/lib/omp/rpc/frame.test.ts +113 -47
- package/src/shared/lib/omp/rpc/frame.ts +107 -43
- package/src/shared/lib/settings/defaults.ts +4 -0
- package/src/shared/lib/theme/catalog.test.ts +5 -4
- package/src/shared/lib/theme/catalog.ts +18 -3
- package/src/shared/lib/theme/glass-support.test.ts +38 -0
- package/src/shared/lib/theme/glass-support.ts +73 -0
- package/src/shared/lib/theme/icon-style.test.ts +74 -0
- package/src/shared/lib/theme/icon-style.ts +90 -0
- package/src/shared/lib/theme/legibility.ts +91 -0
- package/src/shared/lib/theme/palettes/dark-extended.ts +152 -0
- package/src/shared/lib/theme/palettes/light-extended.ts +157 -0
- package/src/shared/lib/theme/surface-style.test.ts +68 -0
- package/src/shared/lib/theme/surface-style.ts +91 -0
- package/src/shared/lib/theme/theme.test.ts +11 -7
- package/src/shared/lib/ui/menu-anchor.test.ts +69 -0
- package/src/shared/lib/ui/menu-anchor.ts +89 -0
- package/src/shared/lib/usage/breakdown.test.ts +197 -0
- package/src/shared/lib/usage/breakdown.ts +241 -0
- package/src/shared/lib/usage/range.test.ts +204 -0
- package/src/shared/lib/usage/range.ts +240 -0
- package/src/shared/lib/usage/view.test.ts +85 -0
- package/src/shared/lib/usage/view.ts +74 -0
- package/src/shared/lib/workspace/panel-hues.test.ts +68 -0
- package/src/shared/lib/workspace/panel-hues.ts +57 -0
- package/src/shared/types/browser.ts +78 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/panels-registry.ts +6 -0
- package/src/shared/types/panels.ts +14 -0
- package/src/shared/types/settings/agent.ts +28 -6
- package/src/shared/types/settings/state.ts +30 -3
- package/src/shared/types/settings/write.ts +6 -0
- package/src/shared/types/tokenUsage.ts +128 -21
- package/src/shared/types/updates.ts +20 -0
- package/src/test-support/fake-omp-frames.ts +163 -0
- package/dist/client/static/js/index-3ve31rzx.css +0 -1
- package/src/server/lib/omp/session/usage/aggregate-shaping.test.ts +0 -149
- package/src/server/lib/omp/session/usage/aggregate.test.ts +0 -243
- package/src/server/lib/omp/session/usage/aggregate.ts +0 -330
- package/src/server/lib/omp/session/usage/shaping.ts +0 -130
- /package/src/{client/components/common/file-icon/brand-paths.ts → shared/lib/icons/file-brand-paths.ts} +0 -0
|
@@ -1,166 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { isMockMode } from '@/server/mock.server';
|
|
6
|
-
import { loadModelsDevCatalog } from '@/shared/lib/models/catalog';
|
|
7
|
-
import { aggregateUsageWindows, PRESET_RANGES, type UsageWindow } from '@/server/lib/omp/session/usage/aggregate';
|
|
8
|
-
import { buildChartSeries, toBreakdownRows, toMetricSet } from '@/server/lib/omp/session/usage/shaping';
|
|
9
|
-
import type { BreakdownRow, BreakdownTab, CadenceType, ChartSeriesPoint, TimeRangeType, TokenUsageMetricSet } from '@/shared/types';
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
6
|
+
/**
|
|
7
|
+
* `GET|POST /api/telemetry/tokens` — token and cost usage for the settings
|
|
8
|
+
* panel.
|
|
9
|
+
*
|
|
10
|
+
* The response is ONE payload carrying every view the panel can draw for the
|
|
11
|
+
* requested period (totals, the provider → model tree, daily rows with their
|
|
12
|
+
* per-provider split, project rows). Cadence and breakdown tabs are therefore
|
|
13
|
+
* client-side re-buckets, not requests — the previous shape answered a fresh
|
|
14
|
+
* full scan for each one.
|
|
15
|
+
*
|
|
16
|
+
* What is deliberately absent:
|
|
17
|
+
* - `rangeData` / `breakdownData`: three copies of data the panel never read.
|
|
18
|
+
* It kept only `metrics`, `breakdownRows` and `chartSeries`.
|
|
19
|
+
* - `pricing`: the models.dev catalog was fetched (5.96 MB, measured 5.63 s,
|
|
20
|
+
* 8 s timeout) on every request and no client code ever read the result.
|
|
21
|
+
*
|
|
22
|
+
* `?refresh=1` re-checks the sessions tree before answering; without it the
|
|
23
|
+
* index is at most 20 seconds stale, which is what makes a period change cost
|
|
24
|
+
* milliseconds.
|
|
25
|
+
*/
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
import { json, type ActionFunctionArgs, type LoaderFunctionArgs } from '@/server/lib/remix-compat';
|
|
28
|
+
import { methodNotAllowed } from '@/server/lib/route-adapter';
|
|
29
|
+
import { isMockMode } from '@/server/mock.server';
|
|
30
|
+
import { buildTokenUsagePayload } from '@/server/lib/usage/index-query.server';
|
|
31
|
+
import { mockTokenUsagePayload } from '@/client/data/mock/token-usage';
|
|
32
|
+
import type { TimeRangeType } from '@/shared/types';
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const from = url.searchParams.get('customFrom') || '';
|
|
32
|
-
const to = url.searchParams.get('customTo') || '';
|
|
33
|
-
if (ISO_DATE.test(from) && ISO_DATE.test(to) && from <= to) {
|
|
34
|
-
return { kind: 'custom', from, to };
|
|
35
|
-
}
|
|
36
|
-
return { kind: 'preset', range: '30d' };
|
|
37
|
-
}
|
|
38
|
-
if (timeRange === 'all') return { kind: 'all' };
|
|
39
|
-
if (PRESET_RANGES.includes(timeRange as Exclude<TimeRangeType, 'custom'>)) {
|
|
40
|
-
return { kind: 'preset', range: timeRange as Exclude<TimeRangeType, 'custom'> };
|
|
41
|
-
}
|
|
42
|
-
return { kind: 'preset', range: '30d' };
|
|
43
|
-
}
|
|
34
|
+
const RANGES: readonly TimeRangeType[] = ['today', '7d', '30d', '90d', 'all', 'custom'];
|
|
35
|
+
/** Never cached: the index can change under a client that is polling. */
|
|
36
|
+
const HEADERS = { 'cache-control': 'no-store' };
|
|
44
37
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
for (const provider of Object.values(catalog)) {
|
|
54
|
-
const models = provider?.models;
|
|
55
|
-
if (!models || typeof models !== 'object') continue;
|
|
56
|
-
const match = Object.entries(models).find(([key, model]) => {
|
|
57
|
-
const candidates = [key.toLowerCase(), (model?.name ?? '').toLowerCase()];
|
|
58
|
-
return candidates.some((candidate) => candidate === bare || candidate === name.toLowerCase());
|
|
59
|
-
});
|
|
60
|
-
if (match) {
|
|
61
|
-
rates[name] = { input: match[1]?.cost?.input, output: match[1]?.cost?.output };
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return rates;
|
|
67
|
-
} catch {
|
|
68
|
-
return {};
|
|
69
|
-
}
|
|
38
|
+
function readQuery(url: URL): { range: TimeRangeType; customFrom: string | null; customTo: string | null } {
|
|
39
|
+
const requested = url.searchParams.get('range') ?? url.searchParams.get('timeRange') ?? '30d';
|
|
40
|
+
const range = (RANGES as readonly string[]).includes(requested) ? (requested as TimeRangeType) : '30d';
|
|
41
|
+
return {
|
|
42
|
+
range,
|
|
43
|
+
customFrom: url.searchParams.get('customFrom'),
|
|
44
|
+
customTo: url.searchParams.get('customTo'),
|
|
45
|
+
};
|
|
70
46
|
}
|
|
71
47
|
|
|
72
|
-
export async function loader({ request }: LoaderFunctionArgs) {
|
|
48
|
+
export async function loader({ request, params }: LoaderFunctionArgs) {
|
|
49
|
+
if (request.method !== 'GET') return methodNotAllowed({ request, params });
|
|
73
50
|
const url = new URL(request.url);
|
|
74
|
-
const
|
|
75
|
-
const breakdownTab = (url.searchParams.get('breakdownTab') as BreakdownTab) || 'model';
|
|
76
|
-
const cadenceParam = url.searchParams.get('cadence');
|
|
77
|
-
const cadence = CADENCES.includes(cadenceParam as CadenceType) ? (cadenceParam as CadenceType) : 'daily';
|
|
78
|
-
const window = parseWindow(url);
|
|
79
|
-
const mock = isMockMode();
|
|
80
|
-
|
|
81
|
-
if (mock) {
|
|
82
|
-
const activeMetrics = window.kind === 'custom'
|
|
83
|
-
? MOCK_CUSTOM_RANGE_DATA
|
|
84
|
-
: (MOCK_RANGE_DATA[timeRange as Exclude<TimeRangeType, 'custom'>] || MOCK_RANGE_DATA['30d']);
|
|
85
|
-
const activeBreakdownRows = BREAKDOWN_DATA[breakdownTab] || BREAKDOWN_DATA.model;
|
|
86
|
-
const chartSeries = MOCK_CHART_SERIES[cadence] || MOCK_CHART_SERIES.daily;
|
|
51
|
+
const query = readQuery(url);
|
|
87
52
|
|
|
88
|
-
|
|
89
|
-
timeRanges: TIME_RANGES,
|
|
90
|
-
rangeData: MOCK_RANGE_DATA,
|
|
91
|
-
breakdownData: BREAKDOWN_DATA,
|
|
92
|
-
activeMetrics,
|
|
93
|
-
activeBreakdownRows,
|
|
94
|
-
chartSeries,
|
|
95
|
-
metrics: activeMetrics,
|
|
96
|
-
breakdownRows: activeBreakdownRows,
|
|
97
|
-
timeRange,
|
|
98
|
-
breakdownTab,
|
|
99
|
-
cadence,
|
|
100
|
-
isMock: true,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
53
|
+
if (isMockMode()) return json(mockTokenUsagePayload(query.range), { headers: HEADERS });
|
|
103
54
|
|
|
104
|
-
// Real Mode: aggregate actual token/cost usage from omp session files.
|
|
105
55
|
try {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const realBreakdown: Record<BreakdownTab, BreakdownRow[]> = {
|
|
116
|
-
model: toBreakdownRows(activeAggregate, 'model'),
|
|
117
|
-
day: toBreakdownRows(activeAggregate, 'day', cadence),
|
|
118
|
-
project: toBreakdownRows(activeAggregate, 'project'),
|
|
119
|
-
};
|
|
120
|
-
const activeMetrics = toMetricSet(activeAggregate, cadence);
|
|
121
|
-
const activeBreakdownRows = realBreakdown[breakdownTab] || [];
|
|
122
|
-
const perModelRates = await loadModelRates(
|
|
123
|
-
realBreakdown.model.map((row) => row.name),
|
|
56
|
+
const payload = await buildTokenUsagePayload(query);
|
|
57
|
+
return json(payload, { headers: HEADERS });
|
|
58
|
+
} catch (error) {
|
|
59
|
+
// A failure is REPORTED, never rendered as "$0.00 usage": an empty panel
|
|
60
|
+
// claiming zero spend is indistinguishable from a month without work.
|
|
61
|
+
return json(
|
|
62
|
+
{ error: error instanceof Error ? error.message : 'Failed to read token usage' },
|
|
63
|
+
{ status: 500, headers: HEADERS },
|
|
124
64
|
);
|
|
125
|
-
|
|
126
|
-
return json({
|
|
127
|
-
timeRanges: TIME_RANGES,
|
|
128
|
-
rangeData: realRangeData,
|
|
129
|
-
breakdownData: realBreakdown,
|
|
130
|
-
activeMetrics,
|
|
131
|
-
activeBreakdownRows,
|
|
132
|
-
chartSeries: buildChartSeries(activeAggregate, cadence),
|
|
133
|
-
metrics: activeMetrics,
|
|
134
|
-
breakdownRows: activeBreakdownRows,
|
|
135
|
-
pricing: perModelRates,
|
|
136
|
-
timeRange,
|
|
137
|
-
breakdownTab,
|
|
138
|
-
cadence,
|
|
139
|
-
isMock: false,
|
|
140
|
-
});
|
|
141
|
-
} catch (error: any) {
|
|
142
|
-
const zeroBreakdown: Record<BreakdownTab, BreakdownRow[]> = { model: [], day: [], project: [] };
|
|
143
|
-
return json({
|
|
144
|
-
timeRanges: TIME_RANGES,
|
|
145
|
-
rangeData: { today: REAL_ZERO_METRIC, '7d': REAL_ZERO_METRIC, '30d': REAL_ZERO_METRIC, '90d': REAL_ZERO_METRIC, all: REAL_ZERO_METRIC },
|
|
146
|
-
breakdownData: zeroBreakdown,
|
|
147
|
-
activeMetrics: REAL_ZERO_METRIC,
|
|
148
|
-
activeBreakdownRows: [],
|
|
149
|
-
chartSeries: [] as ChartSeriesPoint[],
|
|
150
|
-
metrics: REAL_ZERO_METRIC,
|
|
151
|
-
breakdownRows: [],
|
|
152
|
-
timeRange,
|
|
153
|
-
breakdownTab,
|
|
154
|
-
cadence,
|
|
155
|
-
isMock: false,
|
|
156
|
-
error: error.message,
|
|
157
|
-
});
|
|
158
65
|
}
|
|
159
66
|
}
|
|
160
67
|
|
|
68
|
+
/**
|
|
69
|
+
* POST — force a re-check of the sessions tree.
|
|
70
|
+
*
|
|
71
|
+
* The panel's Refresh button. It answers with the same payload shape so the
|
|
72
|
+
* client can replace its state in one step.
|
|
73
|
+
*/
|
|
161
74
|
export async function action({ request, params }: ActionFunctionArgs) {
|
|
162
|
-
if (request.method
|
|
163
|
-
|
|
75
|
+
if (request.method !== 'POST') return methodNotAllowed({ request, params });
|
|
76
|
+
const url = new URL(request.url);
|
|
77
|
+
const query = readQuery(url);
|
|
78
|
+
if (isMockMode()) return json(mockTokenUsagePayload(query.range), { headers: HEADERS });
|
|
79
|
+
try {
|
|
80
|
+
return json(await buildTokenUsagePayload({ ...query, wait: true, force: true }), { headers: HEADERS });
|
|
81
|
+
} catch (error) {
|
|
82
|
+
return json(
|
|
83
|
+
{ error: error instanceof Error ? error.message : 'Failed to read token usage' },
|
|
84
|
+
{ status: 500, headers: HEADERS },
|
|
85
|
+
);
|
|
164
86
|
}
|
|
165
|
-
return methodNotAllowed({ request, params });
|
|
166
87
|
}
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
writeTerminalInput,
|
|
32
32
|
} from '@/server/lib/terminal/runtime.server';
|
|
33
33
|
import { TerminalRuntimeError, type TerminalViewer } from '@/server/lib/terminal/session.server';
|
|
34
|
+
import { frameAccepted } from '@/server/lib/terminal/send-result';
|
|
34
35
|
import {
|
|
35
36
|
decodeClientFrame,
|
|
36
37
|
encodeServerFrame,
|
|
@@ -67,11 +68,11 @@ export const terminalWsRoutes = new Elysia({ prefix: '/api/terminal' }).ws('/:te
|
|
|
67
68
|
viewer: {
|
|
68
69
|
send(frame) {
|
|
69
70
|
try {
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
return ws.send(frame)
|
|
71
|
+
// Only `0` is a drop; `-1` means "queued, draining". See
|
|
72
|
+
// `send-result.ts` for the measured contract — reading `-1` as
|
|
73
|
+
// failure closed healthy viewers at the first burst, and reading
|
|
74
|
+
// `0` as success left xterm attached to a stream with a hole.
|
|
75
|
+
return frameAccepted(ws.send(frame));
|
|
75
76
|
} catch {
|
|
76
77
|
// Socket closed mid-send; the close handler detaches.
|
|
77
78
|
return false;
|
|
@@ -5,6 +5,7 @@ import * as updatesChangelog from '@/server/routes/updates/changelog';
|
|
|
5
5
|
import * as updatesCheck from '@/server/routes/updates/check';
|
|
6
6
|
import * as updatesDesktop from '@/server/routes/updates/desktop';
|
|
7
7
|
import * as updatesIos from '@/server/routes/updates/ios';
|
|
8
|
+
import * as updatesNotes from '@/server/routes/updates/notes';
|
|
8
9
|
|
|
9
10
|
export const updatesBindings: HandlerBinding[] = [
|
|
10
11
|
...bindingsFor(updatesAndroid, '/api/updates/android'),
|
|
@@ -13,4 +14,5 @@ export const updatesBindings: HandlerBinding[] = [
|
|
|
13
14
|
...bindingsFor(updatesCheck, '/api/updates/check'),
|
|
14
15
|
...bindingsFor(updatesDesktop, '/api/updates/desktop'),
|
|
15
16
|
...bindingsFor(updatesIos, '/api/updates/ios'),
|
|
17
|
+
...bindingsFor(updatesNotes, '/api/updates/notes'),
|
|
16
18
|
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { json, NO_STORE_HEADERS, type LoaderFunctionArgs } from '@/server/lib/remix-compat';
|
|
2
|
+
import { buildActiveReleaseNotes } from '@/server/lib/updates/active-notes';
|
|
3
|
+
import type { UpdateTarget } from '@/shared/types/updates';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GET /api/updates/notes?target=kabmo|omp — the changelog section for the
|
|
7
|
+
* version this machine is RUNNING.
|
|
8
|
+
*
|
|
9
|
+
* `target` is the only input, and it selects a source, never a version: both
|
|
10
|
+
* versions are read server-side from the install itself, so this endpoint
|
|
11
|
+
* cannot be asked about a release the copy does not have. A payload always
|
|
12
|
+
* carries renderable fields — a failure is an `error`, not a 500 — because the
|
|
13
|
+
* dialog opens from a button inside About.
|
|
14
|
+
*/
|
|
15
|
+
function readTarget(value: string | null): UpdateTarget | null {
|
|
16
|
+
return value === 'kabmo' || value === 'omp' ? value : null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function loader({ request }: LoaderFunctionArgs) {
|
|
20
|
+
const target = readTarget(new URL(request.url).searchParams.get('target'));
|
|
21
|
+
if (!target) {
|
|
22
|
+
return json({ error: 'Unknown update target' }, { status: 400, headers: NO_STORE_HEADERS });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
return json(await buildActiveReleaseNotes(target), { headers: NO_STORE_HEADERS });
|
|
27
|
+
} catch (error) {
|
|
28
|
+
const message = error instanceof Error ? error.message : 'Failed to read release notes';
|
|
29
|
+
return json(
|
|
30
|
+
{ target, version: null, note: null, changelogUrl: '', error: message },
|
|
31
|
+
{ headers: NO_STORE_HEADERS },
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -26,6 +26,7 @@ import { action as applyUpdateRoute } from '@/server/routes/updates/apply';
|
|
|
26
26
|
import { invalidateOmpCliCache } from '@/server/lib/omp/core/cli';
|
|
27
27
|
import { loader as checkRoute } from '@/server/routes/updates/check';
|
|
28
28
|
import { loader as changelogRoute } from '@/server/routes/updates/changelog';
|
|
29
|
+
import { loader as notesRoute } from '@/server/routes/updates/notes';
|
|
29
30
|
import { readInstalledVersion } from '@/server/lib/updates/install';
|
|
30
31
|
import { runningUpdate, withUpdateSlot } from '@/server/lib/updates/single-flight';
|
|
31
32
|
|
|
@@ -267,3 +268,51 @@ describe('GET /api/updates/changelog', () => {
|
|
|
267
268
|
expect(result.error).toBeNull();
|
|
268
269
|
});
|
|
269
270
|
});
|
|
271
|
+
|
|
272
|
+
describe('GET /api/updates/notes', () => {
|
|
273
|
+
test('serves the section for the version this install is running', async () => {
|
|
274
|
+
const installed = await readInstalledVersion();
|
|
275
|
+
expect(installed).not.toBeNull();
|
|
276
|
+
globalThis.fetch = (async () =>
|
|
277
|
+
new Response(
|
|
278
|
+
`# Changelog\n\n## [${installed}] — 2026-01-01\n\n* running notes\n`,
|
|
279
|
+
{ status: 200, headers: { 'content-type': 'text/markdown' } },
|
|
280
|
+
)) as unknown as typeof fetch;
|
|
281
|
+
|
|
282
|
+
const res = (await notesRoute({
|
|
283
|
+
request: new Request('http://localhost/api/updates/notes?target=kabmo'),
|
|
284
|
+
params: {},
|
|
285
|
+
})) as unknown as Response;
|
|
286
|
+
|
|
287
|
+
expect(res.status).toBe(200);
|
|
288
|
+
expect(res.headers.get('cache-control')).toBe('no-store');
|
|
289
|
+
const result = await payload(res);
|
|
290
|
+
expect(result).toMatchObject({ target: 'kabmo', version: installed, error: null });
|
|
291
|
+
expect(asRecord(result.note).body).toBe('* running notes');
|
|
292
|
+
expect(result.changelogUrl).toBe('https://github.com/kabmo-labs/kabmo/blob/HEAD/CHANGELOG.md');
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
test('an unknown or missing target is a 400, never a guessed source', async () => {
|
|
296
|
+
for (const query of ['', '?target=nope']) {
|
|
297
|
+
const res = (await notesRoute({
|
|
298
|
+
request: new Request(`http://localhost/api/updates/notes${query}`),
|
|
299
|
+
params: {},
|
|
300
|
+
})) as unknown as Response;
|
|
301
|
+
expect(res.status).toBe(400);
|
|
302
|
+
expect((await payload(res)).error).toBe('Unknown update target');
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
test('an install that cannot be read is an error field, not a 500', async () => {
|
|
307
|
+
const res = (await notesRoute({
|
|
308
|
+
request: new Request('http://localhost/api/updates/notes?target=omp'),
|
|
309
|
+
params: {},
|
|
310
|
+
})) as unknown as Response;
|
|
311
|
+
|
|
312
|
+
expect(res.status).toBe(200);
|
|
313
|
+
const result = await payload(res);
|
|
314
|
+
expect(result).toMatchObject({ target: 'omp', version: null, note: null });
|
|
315
|
+
// `KABMO_OMP_BIN` points at a path that cannot exist in `beforeEach`.
|
|
316
|
+
expect(result.error).toBe('omp binary not found');
|
|
317
|
+
});
|
|
318
|
+
});
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Annotation geometry and prompt text.
|
|
8
|
+
*
|
|
9
|
+
* The failure these cases exist for is a prompt that sends a mark the agent
|
|
10
|
+
* cannot resolve. A percentage alone does not survive: 12% of a 1024px panel
|
|
11
|
+
* and 12% of a 375px panel are different places, and a mark dragged
|
|
12
|
+
* bottom-right-to-top-left has to describe the same box as one dragged the
|
|
13
|
+
* other way. Measured geometry, not rounded pixels, is what the agent re-opens
|
|
14
|
+
* the page with.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { describe, expect, test } from 'bun:test';
|
|
18
|
+
|
|
19
|
+
import { clamp01, describeAnnotations, describeShape, isUsableShape, normalizePoint, readAnnotatePanel, readAnnotationShapes, shapeRegion } from '@/shared/lib/browser/annotate';
|
|
20
|
+
import { appendPageContext, formatPageContextBlock } from '@/shared/lib/browser/page-context';
|
|
21
|
+
import type { AnnotateShape } from '@/shared/types';
|
|
22
|
+
|
|
23
|
+
const PANEL = { width: 1024, height: 768 };
|
|
24
|
+
|
|
25
|
+
function shape(overrides: Partial<AnnotateShape> = {}): AnnotateShape {
|
|
26
|
+
return {
|
|
27
|
+
id: 'a1',
|
|
28
|
+
tool: 'box',
|
|
29
|
+
start: { x: 0.1, y: 0.2 },
|
|
30
|
+
end: { x: 0.3, y: 0.35 },
|
|
31
|
+
label: '',
|
|
32
|
+
note: '',
|
|
33
|
+
...overrides,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
describe('normalizePoint', () => {
|
|
38
|
+
test('expresses a pointer position as a fraction of the measured box', () => {
|
|
39
|
+
expect(normalizePoint(PANEL, { x: 256, y: 384 })).toEqual({ x: 0.25, y: 0.5 });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('clamps a drag that leaves the panel instead of storing an out-of-range point', () => {
|
|
43
|
+
expect(normalizePoint(PANEL, { x: -40, y: 900 })).toEqual({ x: 0, y: 1 });
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('an unmeasured panel answers a zero point rather than NaN', () => {
|
|
47
|
+
expect(normalizePoint({ width: 0, height: 0 }, { x: 10, y: 10 })).toEqual({ x: 0, y: 0 });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe('clamp01', () => {
|
|
52
|
+
test('keeps a fraction, clamps the ends and refuses a non-number', () => {
|
|
53
|
+
expect([clamp01(0.42), clamp01(-1), clamp01(2), clamp01(Number.NaN)]).toEqual([0.42, 0, 1, 0]);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('shapeRegion', () => {
|
|
58
|
+
test('a box dragged bottom-right to top-left has the same region as one dragged forward', () => {
|
|
59
|
+
const forward = shapeRegion({ start: { x: 0.1, y: 0.2 }, end: { x: 0.3, y: 0.35 } });
|
|
60
|
+
const backward = shapeRegion({ start: { x: 0.3, y: 0.35 }, end: { x: 0.1, y: 0.2 } });
|
|
61
|
+
expect(backward).toEqual(forward);
|
|
62
|
+
expect(forward.x).toBeCloseTo(0.1, 6);
|
|
63
|
+
expect(forward.width).toBeCloseTo(0.2, 6);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
describe('isUsableShape', () => {
|
|
68
|
+
test('a click with no drag is not a mark', () => {
|
|
69
|
+
expect(isUsableShape({ start: { x: 0.5, y: 0.5 }, end: { x: 0.5, y: 0.5 }, note: '' })).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test('a note makes even a bare click worth sending', () => {
|
|
73
|
+
expect(isUsableShape({ start: { x: 0.5, y: 0.5 }, end: { x: 0.5, y: 0.5 }, note: 'tombol mati' })).toBe(true);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('a dragged region counts without a note', () => {
|
|
77
|
+
expect(isUsableShape(shape())).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('describeShape', () => {
|
|
82
|
+
test('a box states the region in percent AND the pixel size the panel size makes resolvable', () => {
|
|
83
|
+
expect(describeShape(shape({ note: 'total harga terpotong' }), 1, PANEL))
|
|
84
|
+
.toBe('1. kotak kiri 10.0%, atas 20.0%, lebar 20.0%, tinggi 15.0% (205×115 px) — total harga terpotong');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('a pin states one point, an arrow states where it points', () => {
|
|
88
|
+
expect(describeShape(shape({ tool: 'pin', note: 'badge salah' }), 2, PANEL))
|
|
89
|
+
.toBe('2. titik di (10.0%, 20.0%) (102×154 px) — badge salah');
|
|
90
|
+
expect(describeShape(shape({ tool: 'arrow', end: { x: 0.72, y: 0.185 } }), 3, PANEL))
|
|
91
|
+
.toBe('3. panah (10.0%, 20.0%) → (72.0%, 18.5%)');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('a mark with no note ends at the geometry, with no dangling separator', () => {
|
|
95
|
+
expect(describeShape(shape(), 1, PANEL).endsWith('px)')).toBe(true);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
describe('describeAnnotations', () => {
|
|
100
|
+
test('numbers from 1 in draw order and drops the unusable marks', () => {
|
|
101
|
+
const lines = describeAnnotations([
|
|
102
|
+
shape({ id: 'a', note: 'satu' }),
|
|
103
|
+
shape({ id: 'b', start: { x: 0.5, y: 0.5 }, end: { x: 0.5, y: 0.5 } }),
|
|
104
|
+
shape({ id: 'c', tool: 'pin', start: { x: 0.9, y: 0.1 }, end: { x: 0.9, y: 0.1 }, note: 'tiga' }),
|
|
105
|
+
], PANEL);
|
|
106
|
+
expect(lines).toHaveLength(2);
|
|
107
|
+
expect(lines[0]?.startsWith('1. kotak')).toBe(true);
|
|
108
|
+
expect(lines[1]?.startsWith('2. titik')).toBe(true);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('readAnnotationShapes', () => {
|
|
113
|
+
test('keeps a well-formed mark', () => {
|
|
114
|
+
expect(readAnnotationShapes([shape()])).toEqual([shape()]);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test('drops a mark whose points are not numbers, instead of rendering NaN%', () => {
|
|
118
|
+
expect(readAnnotationShapes([{ id: 'x', tool: 'box', start: { x: 'a', y: 0 }, end: { x: 1, y: 1 } }])).toBeNull();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('drops an unknown tool', () => {
|
|
122
|
+
expect(readAnnotationShapes([{ id: 'x', tool: 'lasso', start: { x: 0, y: 0 }, end: { x: 1, y: 1 } }])).toBeNull();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('clamps points that arrive outside the panel', () => {
|
|
126
|
+
const parsed = readAnnotationShapes([{ id: 'x', tool: 'pin', start: { x: -5, y: 9 }, end: { x: -5, y: 9 } }]);
|
|
127
|
+
expect(parsed?.[0]?.start).toEqual({ x: 0, y: 1 });
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test('a non-array is not a mark list', () => {
|
|
131
|
+
expect(readAnnotationShapes('nope')).toBeNull();
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
describe('readAnnotatePanel', () => {
|
|
136
|
+
test('reads a measured box', () => {
|
|
137
|
+
expect(readAnnotatePanel({ width: 1024, height: 768, viewportMode: 'laptop', zoom: 150 }))
|
|
138
|
+
.toEqual({ width: 1024, height: 768, viewportMode: 'laptop', zoom: 150 });
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test('an unmeasured box is refused, because percentages against it mean nothing', () => {
|
|
142
|
+
expect(readAnnotatePanel({ width: 0, height: 400 })).toBeNull();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('missing optional fields fall back to a responsive, unzoomed panel', () => {
|
|
146
|
+
expect(readAnnotatePanel({ width: 10, height: 20 })).toEqual({ width: 10, height: 20, viewportMode: 'responsive', zoom: 100 });
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
describe('formatPageContextBlock', () => {
|
|
151
|
+
test('a page with no marks keeps the shape the panel has always produced', () => {
|
|
152
|
+
expect(formatPageContextBlock({ url: 'https://a.test/x', title: 'A' })).toBe([
|
|
153
|
+
'[Konteks halaman browser]',
|
|
154
|
+
'URL: https://a.test/x',
|
|
155
|
+
'Judul: A',
|
|
156
|
+
'(Lanjutkan dari halaman ini.)',
|
|
157
|
+
].join('\n'));
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
test('marks add a numbered list, the panel shape, and the user-only warning', () => {
|
|
161
|
+
const block = formatPageContextBlock({
|
|
162
|
+
url: 'http://localhost:5173/checkout',
|
|
163
|
+
panel: { width: 1024, height: 768, viewportMode: 'laptop', zoom: 100 },
|
|
164
|
+
annotations: [shape({ note: 'tombol Bayar nonaktif' })],
|
|
165
|
+
});
|
|
166
|
+
expect(block).toContain('Panel: laptop 1024×768 px @100%');
|
|
167
|
+
expect(block).toContain('Anotasi (1):\n1. kotak');
|
|
168
|
+
expect(block).toContain('hanya terlihat oleh user');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('a panel size with only unusable marks sends no annotation section at all', () => {
|
|
172
|
+
const block = formatPageContextBlock({
|
|
173
|
+
url: 'https://a.test',
|
|
174
|
+
panel: { width: 100, height: 100, viewportMode: 'responsive', zoom: 100 },
|
|
175
|
+
annotations: [shape({ start: { x: 0.4, y: 0.4 }, end: { x: 0.4, y: 0.4 } })],
|
|
176
|
+
});
|
|
177
|
+
expect(block).not.toContain('Anotasi');
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe('appendPageContext', () => {
|
|
182
|
+
test('a blank draft receives the block alone', () => {
|
|
183
|
+
expect(appendPageContext('', { url: 'https://a.test' }).startsWith('[Konteks halaman browser]')).toBe(true);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
test('existing text is separated by exactly one blank line', () => {
|
|
187
|
+
expect(appendPageContext('halo', { url: 'https://a.test' })).toBe(
|
|
188
|
+
'halo\n\n[Konteks halaman browser]\nURL: https://a.test\n(Lanjutkan dari halaman ini.)',
|
|
189
|
+
);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
test('a draft already ending in a blank line does not gain a third', () => {
|
|
193
|
+
expect(appendPageContext('halo\n\n', { url: 'https://a.test' })).toContain('halo\n\n[Konteks');
|
|
194
|
+
expect(appendPageContext('halo\n\n', { url: 'https://a.test' })).not.toContain('halo\n\n\n');
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
describe('label on a mark', () => {
|
|
199
|
+
test('a named region leads the line, so the agent knows WHAT before WHERE', () => {
|
|
200
|
+
expect(describeShape(shape({ label: 'Ringkasan pesanan', note: 'total terpotong' }), 1, PANEL))
|
|
201
|
+
.toBe('1. bagian "Ringkasan pesanan" — kotak kiri 10.0%, atas 20.0%, lebar 20.0%, tinggi 15.0% (205×115 px) — total terpotong');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test('an unnamed mark keeps exactly the line it produced before labels existed', () => {
|
|
205
|
+
expect(describeShape(shape(), 1, PANEL))
|
|
206
|
+
.toBe('1. kotak kiri 10.0%, atas 20.0%, lebar 20.0%, tinggi 15.0% (205×115 px)');
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
test('a label alone makes a zero-size mark worth sending', () => {
|
|
210
|
+
expect(isUsableShape({ start: { x: 0.5, y: 0.5 }, end: { x: 0.5, y: 0.5 }, note: '', label: 'modal' })).toBe(true);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
test('a whitespace-only label is not a name', () => {
|
|
214
|
+
expect(isUsableShape({ start: { x: 0.5, y: 0.5 }, end: { x: 0.5, y: 0.5 }, note: '', label: ' ' })).toBe(false);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
describe('element on a mark', () => {
|
|
219
|
+
const select = {
|
|
220
|
+
path: 'section[aria-label="Ringkasan"] > form > select#prov',
|
|
221
|
+
tag: 'select',
|
|
222
|
+
state: 'nilai "Jawa Barat", 5 opsi',
|
|
223
|
+
text: 'Provinsi',
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
test('a readable element adds its path, state and text after the geometry', () => {
|
|
227
|
+
const line = describeShape(shape({ element: select }), 1, PANEL);
|
|
228
|
+
expect(line).toContain('[elemen: section[aria-label="Ringkasan"] > form > select#prov');
|
|
229
|
+
expect(line).toContain('nilai "Jawa Barat", 5 opsi');
|
|
230
|
+
expect(line).toContain('teks "Provinsi"');
|
|
231
|
+
// The note still ends the line, after the element facts.
|
|
232
|
+
expect(line.endsWith('px) [elemen:')).toBe(false);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test('an unreadable mark says nothing about elements rather than printing an empty one', () => {
|
|
236
|
+
expect(describeShape(shape(), 1, PANEL)).not.toContain('elemen');
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
test('role is stated when the element declares one', () => {
|
|
240
|
+
const line = describeShape(shape({ element: { path: 'div > div', tag: 'div', role: 'dialog' } }), 2, PANEL);
|
|
241
|
+
expect(line).toContain('role dialog');
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
describe('readAnnotationShapes with the new fields', () => {
|
|
246
|
+
test('carries label and element through', () => {
|
|
247
|
+
const parsed = readAnnotationShapes([{
|
|
248
|
+
id: 'a', tool: 'pin', start: { x: 0.2, y: 0.3 }, end: { x: 0.2, y: 0.3 },
|
|
249
|
+
label: 'form', note: 'kosong',
|
|
250
|
+
element: { path: 'body > form', tag: 'form', state: 'nonaktif' },
|
|
251
|
+
}]);
|
|
252
|
+
expect(parsed?.[0]?.label).toBe('form');
|
|
253
|
+
expect(parsed?.[0]?.element).toEqual({ path: 'body > form', tag: 'form', state: 'nonaktif' });
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
test('a malformed element is dropped, and the mark survives with its label', () => {
|
|
257
|
+
const parsed = readAnnotationShapes([{
|
|
258
|
+
id: 'a', tool: 'pin', start: { x: 0.2, y: 0.3 }, end: { x: 0.2, y: 0.3 },
|
|
259
|
+
label: 'form', note: '',
|
|
260
|
+
element: { path: '', tag: 'form' },
|
|
261
|
+
}]);
|
|
262
|
+
expect(parsed?.[0]?.element).toBeUndefined();
|
|
263
|
+
expect(parsed?.[0]?.label).toBe('form');
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
describe('viewport resolution hint', () => {
|
|
268
|
+
const base = {
|
|
269
|
+
url: 'https://a.test',
|
|
270
|
+
panel: { width: 276, height: 620, viewportMode: 'laptop', zoom: 110 },
|
|
271
|
+
annotations: [shape({ note: 'mati' })],
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
test('the block states the viewport the coordinates are fractions of', () => {
|
|
275
|
+
const block = formatPageContextBlock(base);
|
|
276
|
+
expect(block).toContain('Koordinat relatif ke viewport 276×620 px');
|
|
277
|
+
expect(block).toContain('cari elemennya di titik itu');
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
test('the hint belongs to an annotated page, not to a plain one', () => {
|
|
281
|
+
expect(formatPageContextBlock({ url: 'https://a.test' })).not.toContain('Koordinat relatif');
|
|
282
|
+
});
|
|
283
|
+
});
|