@kabmo-labs/kabmo 0.11.1 → 0.12.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 +67 -421
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +426 -413
- package/dist/client/static/js/{index-amss8pge.js → index-0smc9gm2.js} +1123 -747
- package/dist/client/static/js/index-shexbk5f.css +1 -0
- package/marketplace/marketplace.json +13 -3
- package/marketplace/plugins/command-runner/package.json +4 -2
- package/marketplace/plugins/git-forge/README.md +219 -0
- package/marketplace/plugins/git-forge/icon.svg +20 -0
- package/marketplace/plugins/git-forge/package.json +56 -0
- package/marketplace/plugins/git-forge/src/app.tsx +82 -0
- package/marketplace/plugins/git-forge/src/command.test.ts +181 -0
- package/marketplace/plugins/git-forge/src/command.ts +119 -0
- package/marketplace/plugins/git-forge/src/header.tsx +87 -0
- package/marketplace/plugins/git-forge/src/panel/Badge.tsx +76 -0
- package/marketplace/plugins/git-forge/src/panel/Change.tsx +150 -0
- package/marketplace/plugins/git-forge/src/panel/CiBadge.tsx +51 -0
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +107 -0
- package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +70 -0
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +255 -0
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +198 -0
- package/marketplace/plugins/git-forge/src/panel/List.tsx +89 -0
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +68 -0
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +94 -0
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +236 -0
- package/marketplace/plugins/git-forge/src/panel/format.ts +78 -0
- package/marketplace/plugins/git-forge/src/panel/index.test.tsx +344 -0
- package/marketplace/plugins/git-forge/src/panel/index.tsx +193 -0
- package/marketplace/plugins/git-forge/src/panel/use-forge.ts +250 -0
- package/marketplace/plugins/git-forge/src/panel/write.test.tsx +269 -0
- package/marketplace/plugins/git-forge/src/protocol.ts +308 -0
- package/marketplace/plugins/git-forge/src/server/adapters.test.ts +274 -0
- package/marketplace/plugins/git-forge/src/server/bitbucket.ts +307 -0
- package/marketplace/plugins/git-forge/src/server/capabilities.test.ts +116 -0
- package/marketplace/plugins/git-forge/src/server/capabilities.ts +105 -0
- package/marketplace/plugins/git-forge/src/server/ci.test.ts +88 -0
- package/marketplace/plugins/git-forge/src/server/ci.ts +118 -0
- package/marketplace/plugins/git-forge/src/server/context.ts +76 -0
- package/marketplace/plugins/git-forge/src/server/diff.test.ts +127 -0
- package/marketplace/plugins/git-forge/src/server/diff.ts +120 -0
- package/marketplace/plugins/git-forge/src/server/filters.test.ts +138 -0
- package/marketplace/plugins/git-forge/src/server/filters.ts +138 -0
- package/marketplace/plugins/git-forge/src/server/forges.test.ts +235 -0
- package/marketplace/plugins/git-forge/src/server/gitea.ts +296 -0
- package/marketplace/plugins/git-forge/src/server/github-extras.ts +92 -0
- package/marketplace/plugins/git-forge/src/server/github.ts +320 -0
- package/marketplace/plugins/git-forge/src/server/gitlab-detail.ts +207 -0
- package/marketplace/plugins/git-forge/src/server/gitlab.test.ts +195 -0
- package/marketplace/plugins/git-forge/src/server/gitlab.ts +176 -0
- package/marketplace/plugins/git-forge/src/server/http.test.ts +270 -0
- package/marketplace/plugins/git-forge/src/server/http.ts +329 -0
- package/marketplace/plugins/git-forge/src/server/map.ts +120 -0
- package/marketplace/plugins/git-forge/src/server/registry.ts +47 -0
- package/marketplace/plugins/git-forge/src/server/remote.test.ts +146 -0
- package/marketplace/plugins/git-forge/src/server/remote.ts +188 -0
- package/marketplace/plugins/git-forge/src/server/scope-probe.test.ts +98 -0
- package/marketplace/plugins/git-forge/src/server/scope-probe.ts +128 -0
- package/marketplace/plugins/git-forge/src/server/scope.ts +66 -0
- package/marketplace/plugins/git-forge/src/server/test-context.ts +67 -0
- package/marketplace/plugins/git-forge/src/server/test-host.ts +51 -0
- package/marketplace/plugins/git-forge/src/server/token.test.ts +107 -0
- package/marketplace/plugins/git-forge/src/server/token.ts +139 -0
- package/marketplace/plugins/git-forge/src/server/write-http.test.ts +127 -0
- package/marketplace/plugins/git-forge/src/server/write-http.ts +110 -0
- package/marketplace/plugins/git-forge/src/server/writes.test.ts +218 -0
- package/marketplace/plugins/git-forge/src/server/writes.ts +313 -0
- package/marketplace/plugins/git-forge/src/server.ts +284 -0
- package/marketplace/plugins/git-forge/tsconfig.json +16 -0
- package/marketplace/plugins/session-info/package.json +4 -2
- package/marketplace/plugins/stats/package.json +4 -2
- package/package.json +6 -1
- package/src/client/components/common/code-surface/blame-hover.ts +188 -0
- package/src/client/components/common/code-surface/blame-panel.test.ts +304 -0
- package/src/client/components/common/code-surface/blame-panel.ts +306 -0
- package/src/client/components/common/code-surface/blame.test.ts +303 -0
- package/src/client/components/common/code-surface/blame.ts +227 -0
- package/src/client/components/common/code-surface/conflict-markers.test.ts +135 -0
- package/src/client/components/common/code-surface/conflict-markers.ts +144 -0
- package/src/client/components/common/code-surface/documents.ts +48 -1
- package/src/client/components/common/code-surface/extensions.test.ts +4 -0
- package/src/client/components/common/code-surface/extensions.ts +44 -0
- package/src/client/components/common/code-surface/fold-stack.test.ts +4 -0
- package/src/client/components/common/code-surface/indent.test.ts +5 -0
- package/src/client/components/common/code-surface/index.tsx +16 -2
- package/src/client/components/common/code-surface/lint-parsers.test.ts +109 -0
- package/src/client/components/common/code-surface/lint-parsers.ts +134 -0
- package/src/client/components/common/code-surface/lint.test.ts +101 -0
- package/src/client/components/common/code-surface/lint.ts +85 -0
- package/src/client/components/common/code-surface/props.ts +17 -0
- package/src/client/components/common/code-surface/surface-failures.test.ts +132 -0
- package/src/client/components/common/code-surface/theme.ts +71 -0
- package/src/client/components/common/header-controls/index.test.tsx +1 -1
- package/src/client/components/common/header-controls/plugin-entry.test.tsx +1 -1
- package/src/client/components/common/header-controls/shell-chrome.test.tsx +1 -1
- package/src/client/components/common/provider-icon/Plate.tsx +88 -0
- package/src/client/components/common/provider-icon/index.tsx +55 -11
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +5 -2
- package/src/client/components/mobile/SessionSidebar.tsx +2 -10
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +6 -0
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +8 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +3 -0
- package/src/client/components/settings/categories/ProviderSettings.tsx +43 -41
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +97 -0
- package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +106 -54
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +14 -1
- package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +39 -150
- package/src/client/components/settings/categories/panel-plugins/Meta.test.tsx +143 -0
- package/src/client/components/settings/categories/panel-plugins/Meta.tsx +157 -0
- package/src/client/components/settings/categories/panel-plugins/Placement.test.tsx +149 -0
- package/src/client/components/settings/categories/panel-plugins/Placement.tsx +99 -0
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +270 -0
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +11 -3
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +25 -0
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +135 -80
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +51 -21
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +175 -0
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +275 -0
- package/src/client/components/settings/categories/provider-settings/Header.tsx +40 -9
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +142 -160
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +84 -46
- package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +217 -102
- package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +5 -2
- package/src/client/components/settings/categories/provider-settings/SidebarList.plugin.test.ts +3 -3
- package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +158 -102
- package/src/client/components/settings/categories/provider-settings/auth-section.test.tsx +135 -0
- package/src/client/components/settings/categories/provider-settings/groups.test.ts +98 -0
- package/src/client/components/settings/categories/provider-settings/groups.ts +108 -0
- package/src/client/components/settings/categories/provider-settings/layout.test.tsx +325 -0
- package/src/client/components/settings/categories/provider-settings/model-dialogs.test.tsx +135 -0
- package/src/client/components/settings/categories/provider-settings/preset-picker.test.tsx +73 -0
- package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +22 -2
- package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +2 -0
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +16 -6
- package/src/client/components/settings/categories/usage-settings/providers.ts +3 -0
- package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +19 -0
- package/src/client/components/settings/categories/usage-settings/usage-icons.test.tsx +143 -0
- package/src/client/components/workspace/chat-timeline/MinimapShortcuts.test.ts +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +23 -19
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +23 -19
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +20 -18
- package/src/client/components/workspace/chat-timeline/chat-input/compact.test.tsx +19 -6
- package/src/client/components/workspace/chat-timeline/index.tsx +7 -16
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.missing.test.ts +100 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +3 -47
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +8 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/wait-test-util.ts +62 -0
- package/src/client/components/workspace/diff-panel/HunkStepper.tsx +62 -0
- package/src/client/components/workspace/diff-panel/MergeDiffView.tsx +29 -0
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +32 -1
- package/src/client/components/workspace/diff-panel/changes.ts +69 -0
- package/src/client/components/workspace/diff-panel/chunks.ts +85 -0
- package/src/client/components/workspace/diff-panel/index.tsx +21 -1
- package/src/client/components/workspace/diff-panel/merge.test.ts +145 -0
- package/src/client/components/workspace/diff-panel/merge.ts +63 -68
- package/src/client/components/workspace/editor/EditorDropOverlay.tsx +6 -1
- package/src/client/components/workspace/editor/FileDocument.tsx +51 -1
- package/src/client/components/workspace/editor/FilePane.tsx +25 -1
- package/src/client/components/workspace/editor/StatusBar.tsx +19 -0
- package/src/client/components/workspace/editor/Toolbar.tsx +29 -5
- package/src/client/components/workspace/editor/toolbar-clusters.test.ts +86 -0
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +48 -16
- package/src/client/components/workspace/editor/viewers/bytes.ts +16 -0
- package/src/client/components/workspace/git-panel/index.test.ts +46 -1
- package/src/client/components/workspace/git-panel/index.tsx +11 -38
- package/src/client/components/workspace/model-dropdown/Item.plugin.test.ts +66 -0
- package/src/client/components/workspace/model-dropdown/Item.tsx +71 -62
- package/src/client/components/workspace/model-dropdown/Section.tsx +31 -14
- package/src/client/components/workspace/model-dropdown/collapsed.ts +72 -0
- package/src/client/components/workspace/model-dropdown/index.tsx +42 -19
- package/src/client/components/workspace/model-dropdown/refresh.test.tsx +260 -0
- package/src/client/components/workspace/model-dropdown/trigger.test.ts +34 -0
- package/src/client/components/workspace/model-dropdown/use-catalog.ts +13 -2
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +19 -3
- package/src/client/hooks/chat/omp/folder-auto-expand.ts +113 -0
- package/src/client/hooks/chat/omp/index.ts +20 -0
- package/src/client/hooks/chat/omp/pending-rows.ts +21 -0
- package/src/client/hooks/chat/omp/pending-sessions.test.ts +16 -1
- package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +102 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +21 -1
- package/src/client/hooks/chat/omp/stream.ts +8 -1
- package/src/client/hooks/chat/timeline/index.ts +1 -1
- package/src/client/hooks/chat/timeline/new-chat-open.ts +60 -0
- package/src/client/hooks/editor/blame-settings.ts +67 -0
- package/src/client/hooks/editor/blame.test.ts +272 -0
- package/src/client/hooks/editor/blame.ts +232 -0
- package/src/client/hooks/editor/file-editor-types.ts +23 -0
- package/src/client/hooks/editor/save-file.test.ts +20 -0
- package/src/client/hooks/editor/use-editor-drop.test-util.ts +198 -0
- package/src/client/hooks/editor/use-editor-drop.test.ts +70 -175
- package/src/client/hooks/editor/use-editor-drop.ts +19 -36
- package/src/client/hooks/editor/use-file-editor.ts +7 -1
- package/src/client/hooks/settings/providers/actions.ts +90 -194
- package/src/client/hooks/settings/providers/api.ts +7 -1
- package/src/client/hooks/settings/providers/index.ts +171 -59
- package/src/client/hooks/settings/providers/login.test.ts +79 -0
- package/src/client/hooks/settings/providers/login.ts +276 -0
- package/src/client/hooks/settings/providers/messages.ts +28 -0
- package/src/client/hooks/settings/providers/model-actions.ts +178 -0
- package/src/client/hooks/ui/editor-error-toast.ts +47 -0
- package/src/client/hooks/ui/open-file.ts +7 -0
- package/src/client/hooks/ui/toasts.ts +7 -0
- package/src/client/hooks/workspace/file-tabs.ts +4 -1
- package/src/client/hooks/workspace/folder-expansion.test.ts +62 -0
- package/src/client/hooks/workspace/folder-expansion.ts +33 -0
- package/src/client/hooks/workspace/git-action-outcome.ts +86 -0
- package/src/client/hooks/workspace/git-actions.ts +29 -2
- package/src/client/hooks/workspace/plugin-contributions.test.ts +117 -0
- package/src/client/hooks/workspace/plugin-contributions.ts +146 -0
- package/src/client/lib/editor-errors.test.ts +85 -0
- package/src/client/lib/editor-errors.ts +71 -0
- package/src/client/lib/fs/resolve-open.test.ts +125 -0
- package/src/client/lib/fs/resolve-open.ts +90 -0
- package/src/client/lib/git/action-message.test.ts +82 -0
- package/src/client/lib/git/action-message.ts +160 -0
- package/src/client/lib/launch/device-files.test.ts +160 -0
- package/src/client/lib/launch/device-files.ts +197 -0
- package/src/client/lib/native/open-paths.test.ts +140 -0
- package/src/client/lib/native/open-paths.ts +157 -0
- package/src/client/lib/plugins/bootstrap.test.ts +1 -1
- package/src/client/main.tsx +20 -0
- package/src/server/db.server.test.ts +39 -0
- package/src/server/db.server.ts +21 -2
- package/src/server/lib/db/schema.ts +2 -0
- package/src/server/lib/fs/external-roots.test.ts +100 -0
- package/src/server/lib/fs/external-roots.ts +101 -0
- package/src/server/lib/fs/git-actions-branch.ts +15 -2
- package/src/server/lib/fs/git-actions-shared.ts +24 -0
- package/src/server/lib/fs/git-actions-sync.test.ts +18 -7
- package/src/server/lib/fs/git-actions-worktree.ts +5 -1
- package/src/server/lib/fs/git-blame.test.ts +206 -0
- package/src/server/lib/fs/git-blame.ts +189 -0
- package/src/server/lib/fs/root.ts +14 -0
- package/src/server/lib/http/same-origin.ts +28 -7
- package/src/server/lib/models/catalog.server.ts +230 -0
- package/src/server/lib/models/catalog.test.ts +83 -0
- package/src/server/lib/models/credential-origin.server.ts +108 -0
- package/src/server/lib/models/credential-origin.test.ts +132 -0
- package/src/server/lib/models/provider-icon-fetch.ts +115 -0
- package/src/server/lib/models/provider-icon-parse.test.ts +134 -0
- package/src/server/lib/models/provider-icon-parse.ts +139 -0
- package/src/server/lib/models/provider-icon-store.server.ts +118 -0
- package/src/server/lib/models/provider-icon-store.test.ts +107 -0
- package/src/server/lib/models/provider-icon.server.ts +209 -0
- package/src/server/lib/models/provider-items.server.ts +211 -37
- package/src/server/lib/models/provider-items.test.ts +201 -0
- package/src/server/lib/models/provider-registry.server.test.ts +27 -9
- package/src/server/lib/models/provider-registry.server.ts +160 -67
- package/src/server/lib/models/registry.server.test.ts +3 -3
- package/src/server/lib/models/registry.server.ts +8 -0
- package/src/server/lib/omp/config/definitions.test.ts +5 -4
- package/src/server/lib/omp/config/models-config.ts +42 -0
- package/src/server/lib/omp/config/provider-entry.test.ts +205 -0
- package/src/server/lib/omp/config/provider-entry.ts +197 -0
- package/src/server/lib/omp/config/provider-seeds.ts +10 -0
- package/src/server/lib/omp/core/models-json.ts +69 -0
- package/src/server/lib/omp/session/messages.ts +17 -3
- package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +13 -3
- package/src/server/lib/panels/bundled-catalog.server.ts +7 -0
- package/src/server/lib/panels/catalog-offers.server.ts +68 -0
- package/src/server/lib/panels/git-update.server.test.ts +14 -0
- package/src/server/lib/panels/git-update.server.ts +63 -1
- package/src/server/lib/panels/manifest.test.ts +65 -0
- package/src/server/lib/panels/manifest.ts +55 -1
- package/src/server/lib/panels/offers.server.test.ts +191 -0
- package/src/server/lib/panels/offers.server.ts +108 -0
- package/src/server/lib/panels/registry.server.test.ts +35 -1
- package/src/server/lib/panels/registry.server.ts +51 -142
- package/src/server/lib/panels/scan.server.ts +162 -0
- package/src/server/lib/route-adapter.ts +13 -2
- package/src/server/lib/tray/tray.test.ts +2 -1
- package/src/server/lib/usage/providers.server.ts +4 -1
- package/src/server/routes/chat/session.ts +7 -1
- package/src/server/routes/fs/git-blame-loader.test.ts +146 -0
- package/src/server/routes/fs/git.ts +17 -0
- package/src/server/routes/fs/grant.test.ts +135 -0
- package/src/server/routes/fs/grant.ts +79 -0
- package/src/server/routes/fs/index.ts +2 -0
- package/src/server/routes/fs/scope.ts +34 -17
- package/src/server/routes/omp/login.ts +41 -14
- package/src/server/routes/omp/routes.test.ts +23 -10
- package/src/server/routes/settings/index.ts +8 -0
- package/src/server/routes/settings/provider-entry.ts +108 -0
- package/src/server/routes/settings/provider-icon.ts +99 -0
- package/src/server/routes/settings/provider-model.ts +4 -1
- package/src/server/routes/settings/provider-refresh.ts +87 -0
- package/src/server/routes/settings/providers.ts +31 -2
- package/src/shared/lib/chat/omp/fold.test.ts +34 -0
- package/src/shared/lib/chat/omp/tool-frames.test.ts +20 -0
- package/src/shared/lib/chat/omp/tool-frames.ts +5 -1
- package/src/shared/lib/chat/omp/tool-results.ts +29 -3
- package/src/shared/lib/chat/tool/wait-facts.ts +4 -0
- package/src/shared/lib/fs/git-blame.test.ts +266 -0
- package/src/shared/lib/fs/git-blame.ts +246 -0
- package/src/shared/lib/git/url.ts +18 -0
- package/src/shared/lib/markdown/sanitize.test.ts +57 -0
- package/src/shared/lib/markdown/sanitize.ts +30 -7
- package/src/shared/lib/models/provider/connection.ts +135 -0
- package/src/shared/lib/models/provider/dialect.test.ts +4 -2
- package/src/shared/lib/models/provider/dialect.ts +76 -6
- package/src/shared/lib/models/provider/models.ts +2 -0
- package/src/shared/lib/models/provider/origin.ts +94 -0
- package/src/shared/lib/models/provider/provider-ui.test.ts +7 -0
- package/src/shared/lib/models/server-cache.ts +8 -3
- package/src/shared/lib/omp/session/messages-map-pending.test.ts +110 -0
- package/src/shared/lib/omp/session/messages-map.ts +34 -2
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +7 -90
- package/src/shared/lib/omp/session/prewarm.test.ts +133 -0
- package/src/shared/lib/omp/session/prewarm.ts +23 -1
- package/src/shared/lib/omp/session/wait.test.ts +28 -0
- package/src/shared/lib/omp/session/wait.ts +38 -3
- package/src/shared/lib/panels/slot-labels.test.ts +61 -0
- package/src/shared/lib/panels/slot-labels.ts +133 -0
- package/src/shared/lib/workspace/panel-ids.ts +11 -0
- package/src/shared/types/fs.ts +6 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/models.ts +12 -0
- package/src/shared/types/panels-registry.ts +277 -0
- package/src/shared/types/panels.ts +46 -213
- package/src/shared/types/settings/provider.ts +58 -0
- package/src/shared/types/settings/usage.ts +10 -0
- package/src/test-support/pristine-globals.ts +7 -0
- package/dist/client/static/js/index-bq6qeayr.css +0 -1
- package/src/client/components/settings/categories/provider-settings/ReconnectModal.tsx +0 -184
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AlertCircle, CheckCircle2, Globe, Key, Loader2 } from 'lucide-preact';
|
|
1
|
+
import { AlertCircle, CheckCircle2, Copy, ExternalLink, Key, Loader2 } from 'lucide-preact';
|
|
3
2
|
import type { ProviderItem } from '@/shared/types';
|
|
4
|
-
import {
|
|
3
|
+
import { ProviderIconPlate } from '@/client/components/common/provider-icon/Plate';
|
|
5
4
|
import { Modal } from '@/client/components/common/Modal';
|
|
5
|
+
import { useProviderLogin, deviceCodeOf, canOpenLocally } from '@/client/hooks/settings/providers/login';
|
|
6
6
|
|
|
7
7
|
interface LoginModalProps {
|
|
8
8
|
isOpen: boolean;
|
|
@@ -11,128 +11,44 @@ interface LoginModalProps {
|
|
|
11
11
|
onAuthenticated: () => void;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
interface UiRequest {
|
|
15
|
-
id: string;
|
|
16
|
-
method?: string;
|
|
17
|
-
title?: string;
|
|
18
|
-
launchUrl?: string;
|
|
19
|
-
placeholder?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
14
|
/**
|
|
23
|
-
* OAuth
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
15
|
+
* Sign in to an OAuth provider through omp's own `/login` flow.
|
|
16
|
+
*
|
|
17
|
+
* Everything the flow needs is on screen, because each piece is the ONLY way
|
|
18
|
+
* some provider can be completed:
|
|
19
|
+
*
|
|
20
|
+
* - the authorization URL, shown and copyable (a device flow is finished on
|
|
21
|
+
* another machine, so a link that cannot be copied is a dead end);
|
|
22
|
+
* - omp's `instructions`, with a device code lifted out of the sentence;
|
|
23
|
+
* - an input field for the pasted code or redirect URL;
|
|
24
|
+
* - the progress lines omp sends while it waits.
|
|
25
|
+
*
|
|
26
|
+
* The dialog never cancels a flow it does not understand: `open_url` without a
|
|
27
|
+
* `launchUrl` is a NORMAL device flow, and treating it as an unknown method is
|
|
28
|
+
* what made every device-code login fail instantly.
|
|
27
29
|
*/
|
|
28
30
|
export function LoginModal({ isOpen, provider, onClose, onAuthenticated }: LoginModalProps) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const respondRef = useRef<((payload: Record<string, unknown>) => void) | null>(null);
|
|
36
|
-
// Read through a ref: the parent recreates this handler on every render, and
|
|
37
|
-
// a changing dependency would abort + restart the login stream mid-flow.
|
|
38
|
-
const onAuthenticatedRef = useRef(onAuthenticated);
|
|
39
|
-
onAuthenticatedRef.current = onAuthenticated;
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
if (!isOpen) return;
|
|
43
|
-
setStatus('connecting');
|
|
44
|
-
setOpenUrl(null);
|
|
45
|
-
setInputPrompt(null);
|
|
46
|
-
setNotifyText(null);
|
|
47
|
-
setErrorMessage(null);
|
|
48
|
-
setInputValue('');
|
|
49
|
-
|
|
50
|
-
const controller = new AbortController();
|
|
51
|
-
const respond = (payload: Record<string, unknown>) => {
|
|
52
|
-
fetch('/api/omp/login', {
|
|
53
|
-
method: 'POST',
|
|
54
|
-
headers: { 'Content-Type': 'application/json' },
|
|
55
|
-
body: JSON.stringify(payload),
|
|
56
|
-
signal: controller.signal,
|
|
57
|
-
}).catch(() => {});
|
|
58
|
-
};
|
|
59
|
-
respondRef.current = respond;
|
|
60
|
-
|
|
61
|
-
fetch('/api/omp/login', {
|
|
62
|
-
method: 'POST',
|
|
63
|
-
headers: { 'Content-Type': 'application/json' },
|
|
64
|
-
body: JSON.stringify({ providerId: provider.slug }),
|
|
65
|
-
signal: controller.signal,
|
|
66
|
-
})
|
|
67
|
-
.then(async (response) => {
|
|
68
|
-
if (!response.body) throw new Error('Streaming not supported');
|
|
69
|
-
const reader = response.body.getReader();
|
|
70
|
-
const decoder = new TextDecoder();
|
|
71
|
-
let buffer = '';
|
|
72
|
-
for (;;) {
|
|
73
|
-
const { done, value } = await reader.read();
|
|
74
|
-
if (done) break;
|
|
75
|
-
buffer += decoder.decode(value, { stream: true });
|
|
76
|
-
const parts = buffer.split('\n\n');
|
|
77
|
-
buffer = parts.pop() ?? '';
|
|
78
|
-
for (const part of parts) {
|
|
79
|
-
const line = part.split('\n').find((l) => l.startsWith('data: '));
|
|
80
|
-
if (!line) continue;
|
|
81
|
-
try {
|
|
82
|
-
const frame = JSON.parse(line.slice(6)) as UiRequest & { type: string; success?: boolean; error?: string };
|
|
83
|
-
if (frame.type === 'extension_ui_request') {
|
|
84
|
-
setStatus('waiting');
|
|
85
|
-
if (frame.method === 'open_url' && frame.launchUrl) {
|
|
86
|
-
setOpenUrl(frame.launchUrl);
|
|
87
|
-
window.open(frame.launchUrl, '_blank', 'noopener');
|
|
88
|
-
} else if (frame.method === 'input') {
|
|
89
|
-
setInputPrompt(frame);
|
|
90
|
-
} else if (frame.method === 'notify') {
|
|
91
|
-
setNotifyText(frame.title ?? '');
|
|
92
|
-
if (frame.title) respond({ id: frame.id, accepted: true });
|
|
93
|
-
} else {
|
|
94
|
-
respond({ id: frame.id, cancelled: true });
|
|
95
|
-
}
|
|
96
|
-
} else if (frame.type === 'login_result') {
|
|
97
|
-
setStatus(frame.success ? 'success' : 'failed');
|
|
98
|
-
if (!frame.success) setErrorMessage(frame.error ?? 'Login failed');
|
|
99
|
-
if (frame.success) onAuthenticatedRef.current();
|
|
100
|
-
controller.abort();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
} catch { /* malformed frame — skip */ }
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
.catch((err) => {
|
|
108
|
-
if (controller.signal.aborted) return;
|
|
109
|
-
setStatus('failed');
|
|
110
|
-
setErrorMessage(err instanceof Error ? err.message : String(err));
|
|
111
|
-
});
|
|
31
|
+
const { state, inputValue, setInputValue, submitInput } = useProviderLogin({
|
|
32
|
+
isOpen,
|
|
33
|
+
providerId: provider.slug,
|
|
34
|
+
onAuthenticated,
|
|
35
|
+
});
|
|
36
|
+
if (!isOpen) return null;
|
|
112
37
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
};
|
|
117
|
-
}, [isOpen, provider.slug]);
|
|
38
|
+
const deviceCode = deviceCodeOf(state.instructions);
|
|
39
|
+
const canOpen = canOpenLocally(state.launchUrl ?? state.authUrl);
|
|
40
|
+
const openTarget = state.launchUrl ?? state.authUrl;
|
|
118
41
|
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
respondRef.current?.(cancelled
|
|
122
|
-
? { id: inputPrompt.id, cancelled: true }
|
|
123
|
-
: { id: inputPrompt.id, value: inputValue });
|
|
124
|
-
setInputPrompt(null);
|
|
125
|
-
setStatus('connecting');
|
|
42
|
+
const copy = (value: string) => {
|
|
43
|
+
void navigator.clipboard?.writeText(value).catch(() => {});
|
|
126
44
|
};
|
|
127
45
|
|
|
128
|
-
if (!isOpen) return null;
|
|
129
|
-
|
|
130
46
|
return (
|
|
131
47
|
<Modal
|
|
132
48
|
onClose={onClose}
|
|
133
49
|
header={
|
|
134
50
|
<div className="flex items-center gap-2.5">
|
|
135
|
-
<
|
|
51
|
+
<ProviderIconPlate provider={provider} size={26} />
|
|
136
52
|
<div>
|
|
137
53
|
<h3 className="text-sm font-semibold text-ink">Sign in to {provider.name}</h3>
|
|
138
54
|
<p className="text-[11px] text-ink/50 font-mono">{provider.slug}</p>
|
|
@@ -140,82 +56,148 @@ export function LoginModal({ isOpen, provider, onClose, onAuthenticated }: Login
|
|
|
140
56
|
</div>
|
|
141
57
|
}
|
|
142
58
|
footer={
|
|
143
|
-
<div className="px-5 py-3 border-t border-ink/10 flex justify-
|
|
59
|
+
<div className="px-5 py-3 border-t border-ink/10 flex items-center justify-between gap-3">
|
|
60
|
+
<span className="text-[11px] text-ink/45">
|
|
61
|
+
{state.status === 'success'
|
|
62
|
+
? 'omp stored the credential — its models appear in the chat picker.'
|
|
63
|
+
: 'The browser step runs on omp’s side; this dialog follows it.'}
|
|
64
|
+
</span>
|
|
144
65
|
<button
|
|
145
66
|
type="button"
|
|
146
67
|
onClick={onClose}
|
|
147
68
|
className="px-3.5 py-1.5 rounded-md border border-ink/20 text-xs font-medium text-ink hover:bg-ink/5 transition-colors cursor-pointer"
|
|
148
69
|
>
|
|
149
|
-
{status === 'success' ? 'Done' : 'Close'}
|
|
70
|
+
{state.status === 'success' ? 'Done' : 'Close'}
|
|
150
71
|
</button>
|
|
151
72
|
</div>
|
|
152
73
|
}
|
|
153
74
|
>
|
|
154
75
|
<div className="p-5 space-y-4">
|
|
155
|
-
{status === 'connecting' && (
|
|
76
|
+
{state.status === 'connecting' && !state.prompt && (
|
|
156
77
|
<div className="flex items-center gap-2.5 text-xs text-ink/70">
|
|
157
78
|
<Loader2 size={14} className="animate-spin" />
|
|
158
|
-
Starting login flow
|
|
79
|
+
Starting the login flow…
|
|
159
80
|
</div>
|
|
160
81
|
)}
|
|
161
82
|
|
|
162
|
-
{
|
|
163
|
-
<div className="space-y-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
83
|
+
{state.authUrl && (
|
|
84
|
+
<div className="space-y-2">
|
|
85
|
+
<div className="text-xs font-semibold text-ink">Authorization URL</div>
|
|
86
|
+
<p className="text-[11px] text-ink/55 leading-relaxed">
|
|
87
|
+
{canOpen
|
|
88
|
+
? 'Finish the sign-in in the browser tab that opened. If it did not open, use the link below.'
|
|
89
|
+
: 'This URL belongs to the machine running omp. Open it there, or copy it into a browser on that machine.'}
|
|
90
|
+
</p>
|
|
91
|
+
<div className="flex items-start gap-2">
|
|
92
|
+
<code className="flex-1 min-w-0 text-[11px] font-mono break-all bg-ink/5 border border-ink/10 rounded-md px-2.5 py-2 text-ink/80 select-text">
|
|
93
|
+
{state.authUrl}
|
|
94
|
+
</code>
|
|
95
|
+
<div className="flex flex-col gap-1 shrink-0">
|
|
170
96
|
<button
|
|
171
97
|
type="button"
|
|
172
|
-
onClick={() =>
|
|
173
|
-
|
|
98
|
+
onClick={() => copy(state.authUrl as string)}
|
|
99
|
+
title="Copy the authorization URL"
|
|
100
|
+
aria-label="Copy the authorization URL"
|
|
101
|
+
className="p-1.5 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer"
|
|
174
102
|
>
|
|
175
|
-
{
|
|
103
|
+
<Copy size={13} />
|
|
176
104
|
</button>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
autoFocus
|
|
187
|
-
value={inputValue}
|
|
188
|
-
onChange={(e) => setInputValue(e.currentTarget.value)}
|
|
189
|
-
onKeyDown={(e) => e.key === 'Enter' && submitInput(false)}
|
|
190
|
-
placeholder={inputPrompt.placeholder ?? 'Paste your API key'}
|
|
191
|
-
className="w-full bg-paper border border-ink/20 rounded-md px-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"
|
|
192
|
-
/>
|
|
193
|
-
<div className="flex justify-end gap-2">
|
|
194
|
-
<button type="button" onClick={() => submitInput(true)} className="px-3 py-1.5 rounded-md border border-ink/20 text-xs text-ink hover:bg-ink/5 transition-colors cursor-pointer">
|
|
195
|
-
Cancel
|
|
196
|
-
</button>
|
|
197
|
-
<button type="button" onClick={() => submitInput(false)} className="px-3.5 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer">
|
|
198
|
-
Submit
|
|
105
|
+
{canOpen && openTarget && (
|
|
106
|
+
<button
|
|
107
|
+
type="button"
|
|
108
|
+
onClick={() => window.open(openTarget, '_blank', 'noopener')}
|
|
109
|
+
title="Open the authorization URL"
|
|
110
|
+
aria-label="Open the authorization URL"
|
|
111
|
+
className="p-1.5 rounded-md border border-ink/15 text-ink/70 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer"
|
|
112
|
+
>
|
|
113
|
+
<ExternalLink size={13} />
|
|
199
114
|
</button>
|
|
200
|
-
|
|
115
|
+
)}
|
|
201
116
|
</div>
|
|
202
|
-
|
|
203
|
-
{notifyText && <p className="text-xs text-ink/60">{notifyText}</p>}
|
|
204
|
-
{!openUrl && !inputPrompt && !notifyText && (
|
|
205
|
-
<p className="text-xs text-ink/50">Waiting for the provider flow...</p>
|
|
206
|
-
)}
|
|
117
|
+
</div>
|
|
207
118
|
</div>
|
|
208
119
|
)}
|
|
209
120
|
|
|
210
|
-
{
|
|
121
|
+
{deviceCode && (
|
|
122
|
+
<div className="rounded-lg border border-ink/15 bg-ink/5 px-3 py-2.5 space-y-1.5">
|
|
123
|
+
<div className="text-[11px] font-semibold text-ink">Device code</div>
|
|
124
|
+
<div className="flex items-center gap-2">
|
|
125
|
+
<code className="text-sm font-mono font-semibold tracking-[0.12em] text-ink select-text">
|
|
126
|
+
{deviceCode}
|
|
127
|
+
</code>
|
|
128
|
+
<button
|
|
129
|
+
type="button"
|
|
130
|
+
onClick={() => copy(deviceCode)}
|
|
131
|
+
title="Copy the device code"
|
|
132
|
+
aria-label="Copy the device code"
|
|
133
|
+
className="p-1 rounded text-ink/50 hover:text-ink hover:bg-ink/10 transition-colors cursor-pointer"
|
|
134
|
+
>
|
|
135
|
+
<Copy size={12} />
|
|
136
|
+
</button>
|
|
137
|
+
</div>
|
|
138
|
+
<p className="text-[10px] text-ink/50 leading-relaxed select-text">{state.instructions}</p>
|
|
139
|
+
</div>
|
|
140
|
+
)}
|
|
141
|
+
|
|
142
|
+
{!deviceCode && state.instructions && (
|
|
143
|
+
<p className="text-[11px] text-ink/60 leading-relaxed select-text">{state.instructions}</p>
|
|
144
|
+
)}
|
|
145
|
+
|
|
146
|
+
{state.prompt && (
|
|
147
|
+
<div className="space-y-2">
|
|
148
|
+
<div className="flex items-center gap-2 text-xs font-semibold text-ink">
|
|
149
|
+
<Key size={13} className="text-ink/50" />
|
|
150
|
+
{state.prompt.title ?? state.prompt.message ?? 'Authorization code'}
|
|
151
|
+
</div>
|
|
152
|
+
<input
|
|
153
|
+
type="text"
|
|
154
|
+
autoFocus
|
|
155
|
+
value={inputValue}
|
|
156
|
+
onChange={(e) => setInputValue(e.currentTarget.value)}
|
|
157
|
+
onKeyDown={(e) => e.key === 'Enter' && submitInput(false)}
|
|
158
|
+
placeholder={state.prompt.placeholder ?? 'Paste the code or the full redirect URL'}
|
|
159
|
+
className="w-full bg-paper border border-ink/20 rounded-md px-3 py-1.5 text-xs text-ink outline-none focus:border-ink/60 font-mono"
|
|
160
|
+
/>
|
|
161
|
+
<div className="flex justify-end gap-2">
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
onClick={() => submitInput(true)}
|
|
165
|
+
className="px-3 py-1.5 rounded-md border border-ink/20 text-xs text-ink hover:bg-ink/5 transition-colors cursor-pointer"
|
|
166
|
+
>
|
|
167
|
+
Cancel
|
|
168
|
+
</button>
|
|
169
|
+
<button
|
|
170
|
+
type="button"
|
|
171
|
+
onClick={() => submitInput(false)}
|
|
172
|
+
disabled={!inputValue.trim()}
|
|
173
|
+
className="px-3.5 py-1.5 rounded-md bg-ink text-canvas text-xs font-medium hover:opacity-90 transition-opacity cursor-pointer disabled:opacity-40"
|
|
174
|
+
>
|
|
175
|
+
Submit
|
|
176
|
+
</button>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
)}
|
|
180
|
+
|
|
181
|
+
{state.notices.length > 0 && (
|
|
182
|
+
<ul className="space-y-1">
|
|
183
|
+
{state.notices.map((notice, index) => (
|
|
184
|
+
<li key={`${index}-${notice}`} className="flex items-start gap-2 text-[11px] text-ink/60">
|
|
185
|
+
<Loader2 size={12} className="mt-0.5 shrink-0 animate-spin" />
|
|
186
|
+
<span className="select-text">{notice}</span>
|
|
187
|
+
</li>
|
|
188
|
+
))}
|
|
189
|
+
</ul>
|
|
190
|
+
)}
|
|
191
|
+
|
|
192
|
+
{state.status === 'success' && (
|
|
211
193
|
<div className="flex items-center gap-2 text-xs text-emerald-500 font-medium">
|
|
212
|
-
<CheckCircle2 size={14} /> Signed in.
|
|
194
|
+
<CheckCircle2 size={14} /> Signed in. omp stored the credential.
|
|
213
195
|
</div>
|
|
214
196
|
)}
|
|
215
|
-
{status === 'failed' && (
|
|
197
|
+
{state.status === 'failed' && (
|
|
216
198
|
<div className="flex items-start gap-2 text-xs text-error font-medium">
|
|
217
199
|
<AlertCircle size={14} className="mt-0.5 shrink-0" />
|
|
218
|
-
<span>{
|
|
200
|
+
<span className="select-text">{state.error ?? 'Login failed'}</span>
|
|
219
201
|
</div>
|
|
220
202
|
)}
|
|
221
203
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'preact/hooks';
|
|
2
2
|
import { AlertTriangle, Loader2, LogOut } from 'lucide-preact';
|
|
3
3
|
import type { ProviderItem } from '@/shared/types';
|
|
4
|
-
import {
|
|
4
|
+
import { ProviderIconPlate } from '@/client/components/common/provider-icon/Plate';
|
|
5
5
|
import { fetchLogoutAccounts, logoutProvider, type LogoutAccount } from '@/client/hooks/settings/providers/logout';
|
|
6
6
|
|
|
7
7
|
interface LogoutProviderModalProps {
|
|
@@ -101,7 +101,7 @@ export function LogoutProviderModal({ isOpen, provider, onClose, onSignedOut }:
|
|
|
101
101
|
|
|
102
102
|
<div className="px-5 py-4 space-y-3">
|
|
103
103
|
<div className="flex items-center gap-2.5 px-3 py-2.5 rounded-lg bg-ink/5 border border-ink/10">
|
|
104
|
-
<
|
|
104
|
+
<ProviderIconPlate provider={provider} size={26} />
|
|
105
105
|
<span className="text-xs font-medium text-ink truncate">{provider.name}</span>
|
|
106
106
|
</div>
|
|
107
107
|
|
package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Check, Cpu, Eye,
|
|
1
|
+
import { Check, Cpu, Eye, Minus, SlidersHorizontal, Terminal } from 'lucide-preact';
|
|
2
2
|
import type { ProviderModel } from '@/shared/types';
|
|
3
3
|
import { Modal } from '@/client/components/common/Modal';
|
|
4
|
+
import { MODEL_KIND_LABELS, modelKindOf } from '@/shared/lib/models/provider/dialect';
|
|
4
5
|
|
|
5
6
|
interface ModelCapabilitiesModalProps {
|
|
6
7
|
isOpen: boolean;
|
|
@@ -8,43 +9,69 @@ interface ModelCapabilitiesModalProps {
|
|
|
8
9
|
onClose: () => void;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* One declared fact. `value` is `undefined` when the row states something
|
|
14
|
+
* rather than answering yes/no (the model's kind), and `reported` marks a
|
|
15
|
+
* boolean omp does not report at all — which is NOT the same answer as "no".
|
|
16
|
+
*/
|
|
17
|
+
interface CapabilityFact {
|
|
18
|
+
title: string;
|
|
19
|
+
desc: string;
|
|
20
|
+
value: boolean | undefined;
|
|
21
|
+
reported?: boolean;
|
|
22
|
+
icon: typeof Check;
|
|
23
|
+
detail?: string;
|
|
24
|
+
/** `false` for a row that STATES a fact (the kind) rather than answering. */
|
|
25
|
+
badge?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* What omp reports about ONE model — nothing more.
|
|
30
|
+
*
|
|
31
|
+
* The previous version listed five capabilities and hardcoded two of them as
|
|
32
|
+
* "Supported" for every model on earth ("Structured Output", "Streaming"),
|
|
33
|
+
* which is a claim the panel cannot make and omp does not report. A row here is
|
|
34
|
+
* a field from the model's own record (`input`, `thinking`, `kind`), so the
|
|
35
|
+
* dialog can only ever say what the agent itself would say.
|
|
36
|
+
*
|
|
37
|
+
* An unreported field reads `—` rather than "Not supported": absence in the
|
|
38
|
+
* catalog is not a denial, and the two are different answers.
|
|
39
|
+
*/
|
|
40
|
+
export function ModelCapabilitiesModal({ isOpen, model, onClose }: ModelCapabilitiesModalProps) {
|
|
16
41
|
if (!isOpen || !model) return null;
|
|
17
42
|
|
|
18
|
-
const
|
|
43
|
+
const kind = modelKindOf(model.kind);
|
|
44
|
+
const efforts = model.thinkingEfforts ?? [];
|
|
45
|
+
const facts: CapabilityFact[] = [
|
|
19
46
|
{
|
|
20
|
-
title: 'Tool &
|
|
21
|
-
desc: '
|
|
22
|
-
|
|
47
|
+
title: 'Tool & function calling',
|
|
48
|
+
desc: 'The model can emit tool calls the agent executes (file edits, shell, search).',
|
|
49
|
+
value: model.hasTools,
|
|
23
50
|
icon: Terminal,
|
|
24
51
|
},
|
|
25
52
|
{
|
|
26
|
-
title: '
|
|
27
|
-
desc: '
|
|
28
|
-
|
|
53
|
+
title: 'Image input',
|
|
54
|
+
desc: 'Accepts screenshots, diagrams and image attachments on the wire.',
|
|
55
|
+
value: model.hasVision,
|
|
29
56
|
icon: Eye,
|
|
30
57
|
},
|
|
31
58
|
{
|
|
32
|
-
title: '
|
|
33
|
-
desc: '
|
|
34
|
-
|
|
59
|
+
title: 'Reasoning',
|
|
60
|
+
desc: 'Produces thinking blocks before its answer.',
|
|
61
|
+
value: model.hasReasoning,
|
|
62
|
+
reported: model.hasReasoning === undefined,
|
|
35
63
|
icon: Cpu,
|
|
64
|
+
...(efforts.length > 0
|
|
65
|
+
? { detail: `Levels: ${efforts.join(' · ')}${model.thinkingMode ? ` (${model.thinkingMode})` : ''}` }
|
|
66
|
+
: {}),
|
|
36
67
|
},
|
|
37
68
|
{
|
|
38
|
-
title: '
|
|
39
|
-
desc: '
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
title: 'Streaming Inference',
|
|
45
|
-
desc: 'Delivers real-time incremental token chunks to the chat timeline with zero latency.',
|
|
46
|
-
enabled: true,
|
|
47
|
-
icon: Sparkles,
|
|
69
|
+
title: 'Catalog kind',
|
|
70
|
+
desc: 'Which role omp resolves this model for.',
|
|
71
|
+
value: undefined,
|
|
72
|
+
badge: false,
|
|
73
|
+
icon: SlidersHorizontal,
|
|
74
|
+
detail: `${MODEL_KIND_LABELS[kind]} (${kind})`,
|
|
48
75
|
},
|
|
49
76
|
];
|
|
50
77
|
|
|
@@ -54,18 +81,18 @@ export function ModelCapabilitiesModal({
|
|
|
54
81
|
header={
|
|
55
82
|
<div className="flex items-center gap-2">
|
|
56
83
|
<SlidersHorizontal size={16} className="text-ink/70" />
|
|
57
|
-
<div>
|
|
58
|
-
<h3 className="text-sm font-semibold text-ink">
|
|
59
|
-
|
|
60
|
-
</h3>
|
|
61
|
-
<p className="text-[11px] text-ink/50 truncate max-w-[280px]">
|
|
62
|
-
{model.name}
|
|
63
|
-
</p>
|
|
84
|
+
<div className="min-w-0">
|
|
85
|
+
<h3 className="text-sm font-semibold text-ink">Model capabilities</h3>
|
|
86
|
+
<p className="text-[11px] text-ink/50 font-mono truncate max-w-[280px]">{model.id}</p>
|
|
64
87
|
</div>
|
|
65
88
|
</div>
|
|
66
89
|
}
|
|
67
90
|
footer={
|
|
68
|
-
<div className="px-5 py-3 border-t border-ink/10 flex justify-
|
|
91
|
+
<div className="px-5 py-3 border-t border-ink/10 flex items-center justify-between gap-3">
|
|
92
|
+
<span className="text-[11px] text-ink/45">
|
|
93
|
+
Read from omp’s own model record — “not reported” means the catalog says nothing,
|
|
94
|
+
which is not the same as “no”.
|
|
95
|
+
</span>
|
|
69
96
|
<button
|
|
70
97
|
type="button"
|
|
71
98
|
onClick={onClose}
|
|
@@ -77,33 +104,44 @@ export function ModelCapabilitiesModal({
|
|
|
77
104
|
}
|
|
78
105
|
>
|
|
79
106
|
<div className="p-5 space-y-3">
|
|
80
|
-
{
|
|
81
|
-
const Icon =
|
|
107
|
+
{facts.map((fact) => {
|
|
108
|
+
const Icon = fact.icon;
|
|
82
109
|
return (
|
|
83
110
|
<div
|
|
84
|
-
key={
|
|
111
|
+
key={fact.title}
|
|
85
112
|
className="flex items-start gap-3 p-2.5 rounded-lg bg-ink/5 border border-ink/10"
|
|
86
113
|
>
|
|
87
114
|
<div className="p-1.5 rounded bg-ink/10 text-ink mt-0.5">
|
|
88
115
|
<Icon size={14} />
|
|
89
116
|
</div>
|
|
90
117
|
<div className="flex-1 min-w-0">
|
|
91
|
-
<div className="flex items-center justify-between">
|
|
92
|
-
<span className="text-xs font-semibold text-ink">{
|
|
93
|
-
{
|
|
118
|
+
<div className="flex items-center justify-between gap-2">
|
|
119
|
+
<span className="text-xs font-semibold text-ink">{fact.title}</span>
|
|
120
|
+
{fact.value === undefined ? (
|
|
121
|
+
fact.badge === false ? null : fact.reported ? (
|
|
122
|
+
<span
|
|
123
|
+
className="text-[10px] text-ink/35 font-medium uppercase tracking-wider"
|
|
124
|
+
title="omp’s catalog reports nothing for this field"
|
|
125
|
+
>
|
|
126
|
+
not reported
|
|
127
|
+
</span>
|
|
128
|
+
) : null
|
|
129
|
+
) : fact.value ? (
|
|
94
130
|
<span className="inline-flex items-center gap-1 text-[10px] text-emerald-500 font-semibold uppercase tracking-wider">
|
|
95
131
|
<Check size={11} strokeWidth={2.5} />
|
|
96
|
-
|
|
132
|
+
Yes
|
|
97
133
|
</span>
|
|
98
134
|
) : (
|
|
99
|
-
<span className="text-[10px] text-ink/40 font-medium uppercase tracking-wider">
|
|
100
|
-
|
|
135
|
+
<span className="inline-flex items-center gap-1 text-[10px] text-ink/40 font-medium uppercase tracking-wider">
|
|
136
|
+
<Minus size={11} strokeWidth={2.5} />
|
|
137
|
+
No
|
|
101
138
|
</span>
|
|
102
139
|
)}
|
|
103
140
|
</div>
|
|
104
|
-
<p className="text-[11px] text-ink/60 mt-0.5 leading-relaxed">
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
<p className="text-[11px] text-ink/60 mt-0.5 leading-relaxed">{fact.desc}</p>
|
|
142
|
+
{fact.detail && (
|
|
143
|
+
<p className="text-[10px] font-mono text-ink/50 mt-1 select-text">{fact.detail}</p>
|
|
144
|
+
)}
|
|
107
145
|
</div>
|
|
108
146
|
</div>
|
|
109
147
|
);
|