@chatcode/cco-better-sidebar 0.18.0-alpha.4 → 0.18.0-rc.12
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 +30 -9
- package/README_EN.md +30 -9
- package/cordis.patch.yml +6 -5
- package/lib/client-editor.js +10954 -395
- package/lib/client-mermaid.js +10835 -300
- package/lib/client-registry.js +4035 -2215
- package/lib/client-terminal.js +435 -292
- package/lib/client.js +4035 -2215
- package/lib/index.js +282 -47
- package/lib/types/client/LogoutConfirmDialog.d.ts +5 -0
- package/lib/types/client/PluginMarketSettingsSection.d.ts +7 -0
- package/lib/types/client/PluginMarketView.d.ts +7 -0
- package/lib/types/client/PluginProjectPicker.d.ts +13 -0
- package/lib/types/client/api.d.ts +21 -0
- package/lib/types/client/builtins/tabs.d.ts +13 -1
- package/lib/types/client/icons.d.ts +26 -8
- package/lib/types/client/locales-ja.d.ts +25 -0
- package/lib/types/client/locales.d.ts +39 -0
- package/lib/types/client/plugin-market-catalog.d.ts +25 -0
- package/lib/types/client/service.d.ts +1 -1
- package/lib/types/client/ui-tweaks/archive.d.ts +9 -28
- package/lib/types/client/ui-tweaks/branding.d.ts +1 -1
- package/lib/types/client/ui-tweaks/dom-text.d.ts +2 -0
- package/lib/types/client/ui-tweaks/index.d.ts +9 -1
- package/lib/types/client/ui-tweaks/sidebar-header.d.ts +6 -0
- package/lib/types/client/ui-tweaks/typography.d.ts +9 -0
- package/lib/types/config.d.ts +4 -3
- package/lib/types/context-types.d.ts +12 -14
- package/lib/types/login-page-script.d.ts +2 -0
- package/lib/types/login-route.d.ts +2 -0
- package/lib/types/plugin-market-api.d.ts +5 -0
- package/lib/types/plugin-market-shared.d.ts +59 -0
- package/lib/types/prefs-shared.d.ts +1 -1
- package/lib/types/pty-deps.d.ts +1 -1
- package/lib/types/ui-tweaks/config.d.ts +6 -7
- package/lib/types/ui-tweaks/index.d.ts +2 -3
- package/package.json +2 -2
- package/src/client/AccountMenu.tsx +12 -2
- package/src/client/BrowserView.tsx +1 -1
- package/src/client/DiffTab.tsx +1 -1
- package/src/client/EditorHost.tsx +1 -1
- package/src/client/FileTree.tsx +10 -5
- package/src/client/FreeWindow.tsx +2 -1
- package/src/client/GitView.tsx +7 -3
- package/src/client/LogoutConfirmDialog.tsx +39 -0
- package/src/client/PluginMarketSettingsSection.tsx +55 -0
- package/src/client/PluginMarketView.module.css +50 -0
- package/src/client/PluginMarketView.tsx +243 -0
- package/src/client/PluginProjectPicker.tsx +73 -0
- package/src/client/SideCardSection.tsx +2 -23
- package/src/client/Sidebar.tsx +2 -2
- package/src/client/TabBar.tsx +2 -4
- package/src/client/TextEditor.tsx +2 -1
- package/src/client/TreePanel.tsx +1 -2
- package/src/client/UsageHeatmapSection.tsx +1 -1
- package/src/client/api.ts +12 -0
- package/src/client/builtins/tabs.tsx +25 -5
- package/src/client/builtins/viewers.tsx +2 -1
- package/src/client/icons.tsx +57 -4
- package/src/client/index.tsx +10 -1
- package/src/client/intercept.tsx +1 -1
- package/src/client/locales-ja.ts +65 -0
- package/src/client/locales.ts +118 -1
- package/src/client/md-toc.tsx +1 -1
- package/src/client/mermaid.tsx +2 -1
- package/src/client/open-with-settings.tsx +1 -1
- package/src/client/plugin-market-catalog.ts +90 -0
- package/src/client/service.ts +1 -1
- package/src/client/sidebar.module.css +81 -19
- package/src/client/ui-tweaks/archive.tsx +118 -140
- package/src/client/ui-tweaks/branding.tsx +117 -49
- package/src/client/ui-tweaks/cachehit.tsx +24 -14
- package/src/client/ui-tweaks/dom-text.ts +12 -0
- package/src/client/ui-tweaks/index.tsx +75 -103
- package/src/client/ui-tweaks/sidebar-header.ts +73 -0
- package/src/client/ui-tweaks/typography.ts +38 -0
- package/src/config.ts +22 -2
- package/src/context-types.ts +5 -15
- package/src/index.ts +28 -21
- package/src/login-page-script.ts +107 -0
- package/src/login-route.ts +7 -4
- package/src/plugin-market-api.ts +88 -0
- package/src/plugin-market-shared.ts +30 -0
- package/src/prefs-shared.ts +1 -1
- package/src/pty-deps.ts +2 -2
- package/src/ui-tweaks/config.ts +12 -12
- package/src/ui-tweaks/index.ts +7 -13
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
* (editor / git / terminal / browser / diff) through
|
|
2
|
+
* The 6 built-in tab descriptors: the plugin registers its own pages
|
|
3
|
+
* (editor / git / terminal / browser / diff / plugin-market) through
|
|
4
4
|
* the same {@link BetterSidebarService} external plugins use — eating its
|
|
5
5
|
* own dogfood. The terminal descriptor owns its quota (`TERMINAL_LIMIT`)
|
|
6
6
|
* and mints `terminal:<uuid>` ids through `createTab`; the browser mints
|
|
7
7
|
* `browser:<n>` the same way (no quota). The editor IS the files window
|
|
8
8
|
* (the old standalone explorer merged into it).
|
|
9
9
|
*/
|
|
10
|
-
import { IconBranchOutline16, IconCodeOutline16, IconFolderOpen16, IconPanelLeftOutline16 } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
11
10
|
import type { Context } from '../../context-types.ts'
|
|
12
11
|
import { allLeaves, isAgentTabId, type SidebarState } from '../state.ts'
|
|
13
12
|
import { t } from '../locales.ts'
|
|
@@ -18,7 +17,17 @@ import { lazyChunkComponent } from '../lazy-chunk.tsx'
|
|
|
18
17
|
import { GitView } from '../GitView.tsx'
|
|
19
18
|
import { DiffTab } from '../DiffTab.tsx'
|
|
20
19
|
import { BrowserView } from '../BrowserView.tsx'
|
|
21
|
-
import {
|
|
20
|
+
import { PluginMarketView } from '../PluginMarketView.tsx'
|
|
21
|
+
import { createPluginMarketCatalog, type PluginMarketCatalog } from '../plugin-market-catalog.ts'
|
|
22
|
+
import {
|
|
23
|
+
IconBranchOutline16,
|
|
24
|
+
IconCodeOutline16,
|
|
25
|
+
IconDiffOutline16,
|
|
26
|
+
IconFolderOpen16,
|
|
27
|
+
IconGlobeOutline16,
|
|
28
|
+
IconPanelLeftOutline16,
|
|
29
|
+
IconTerminalOutline16,
|
|
30
|
+
} from '../icons.tsx'
|
|
22
31
|
import { TERMINAL_FONT_SIZE_MAX, TERMINAL_FONT_SIZE_MIN } from '../../prefs-shared.ts'
|
|
23
32
|
import type { ComponentType } from 'react'
|
|
24
33
|
import type { SessionScope } from '../api.ts'
|
|
@@ -56,6 +65,8 @@ export const TERMINAL_LIMIT = 3
|
|
|
56
65
|
export interface BuiltinTabOptions {
|
|
57
66
|
/** Returns the display title for newly opened terminal tabs. */
|
|
58
67
|
terminalTitle?: () => string
|
|
68
|
+
/** Shared app-lifetime catalog; production supplies the activation's store. */
|
|
69
|
+
pluginMarketCatalog?: PluginMarketCatalog
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
/** A client-side uuid for terminal tab identity (not shown in the UI). */
|
|
@@ -73,8 +84,9 @@ function uiTerminalCount(state: SidebarState): number {
|
|
|
73
84
|
.filter(tab => tab.type === 'terminal' && !isAgentTabId(tab.id)).length
|
|
74
85
|
}
|
|
75
86
|
|
|
76
|
-
/** The
|
|
87
|
+
/** The 6 built-in tab descriptors. */
|
|
77
88
|
export function builtinTabs(ctx: Context, options: BuiltinTabOptions = {}): readonly TabDescriptor[] {
|
|
89
|
+
const pluginMarketCatalog = options.pluginMarketCatalog ?? createPluginMarketCatalog()
|
|
78
90
|
return [
|
|
79
91
|
{
|
|
80
92
|
id: 'editor',
|
|
@@ -259,6 +271,14 @@ export function builtinTabs(ctx: Context, options: BuiltinTabOptions = {}): read
|
|
|
259
271
|
}),
|
|
260
272
|
component: (props) => <BrowserView {...props} />,
|
|
261
273
|
},
|
|
274
|
+
{
|
|
275
|
+
id: 'plugin-market',
|
|
276
|
+
title: () => t('pluginMarketTitle'),
|
|
277
|
+
icon: (size: number) => <IconGlobeOutline16 size={size} />,
|
|
278
|
+
order: 60,
|
|
279
|
+
single: true,
|
|
280
|
+
component: ({ scope, visible }) => <PluginMarketView scope={scope} visible={visible} catalog={pluginMarketCatalog} />,
|
|
281
|
+
},
|
|
262
282
|
{
|
|
263
283
|
id: 'diff',
|
|
264
284
|
title: () => t('git'),
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
* and `icon` — so the Side card settings page can render the enable/disable
|
|
23
23
|
* inventory without hardcoding (eating our own dogfood).
|
|
24
24
|
*/
|
|
25
|
-
import { IconCodeOutline16, IconDownloadOutline16 } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
26
25
|
import { lazyChunkComponent } from '../lazy-chunk.tsx'
|
|
27
26
|
import { PdfView } from '../PdfView.tsx'
|
|
28
27
|
import { BinaryDownload } from '../binary-download.tsx'
|
|
29
28
|
import {
|
|
29
|
+
IconCodeOutline16,
|
|
30
|
+
IconDownloadOutline16,
|
|
30
31
|
IconImageOutline16,
|
|
31
32
|
IconMarkdownOutline16,
|
|
32
33
|
IconPdfOutline16,
|
package/src/client/icons.tsx
CHANGED
|
@@ -1,11 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Icons the sidebar
|
|
3
|
-
*
|
|
4
|
-
* the
|
|
2
|
+
* Icons owned by the sidebar. DSH 0.1.7 stopped exporting the old Icon*
|
|
3
|
+
* components from dsh-client-ui-primitives, so keeping every glyph local
|
|
4
|
+
* makes the browser bundle work against both the 0.1.2 and 0.1.7 hosts.
|
|
5
|
+
* Per-tab icons live on the tab descriptors
|
|
5
6
|
* (`descriptor.icon`), not in a type-keyed switch — the icon mapping was
|
|
6
7
|
* registry-ized with the tab types.
|
|
7
8
|
*/
|
|
8
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
FiAlertTriangle,
|
|
11
|
+
FiCheck,
|
|
12
|
+
FiChevronDown,
|
|
13
|
+
FiChevronLeft,
|
|
14
|
+
FiChevronRight,
|
|
15
|
+
FiCode,
|
|
16
|
+
FiCopy,
|
|
17
|
+
FiDownload,
|
|
18
|
+
FiFolder,
|
|
19
|
+
FiGitBranch,
|
|
20
|
+
FiLink,
|
|
21
|
+
FiList,
|
|
22
|
+
FiLoader,
|
|
23
|
+
FiPlus,
|
|
24
|
+
FiRefreshCw,
|
|
25
|
+
FiSettings,
|
|
26
|
+
FiSidebar,
|
|
27
|
+
FiTrash2,
|
|
28
|
+
FiX,
|
|
29
|
+
} from 'react-icons/fi'
|
|
30
|
+
import type { IconType } from 'react-icons'
|
|
31
|
+
|
|
32
|
+
export interface IconProps {
|
|
33
|
+
size?: number
|
|
34
|
+
className?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const wrapIcon = (Icon: IconType, defaultSize: number) =>
|
|
38
|
+
({ size = defaultSize, className }: IconProps) => <Icon size={size} className={className} />
|
|
39
|
+
|
|
40
|
+
export const IconListPenOutline16 = wrapIcon(FiList, 16)
|
|
41
|
+
export const IconRefreshOutline16 = wrapIcon(FiRefreshCw, 16)
|
|
42
|
+
export const IconRefreshOutline14 = wrapIcon(FiRefreshCw, 14)
|
|
43
|
+
export const IconChevronRightOutline14 = wrapIcon(FiChevronRight, 14)
|
|
44
|
+
export const IconChevronLeftOutline14 = wrapIcon(FiChevronLeft, 14)
|
|
45
|
+
export const IconChevronDownOutline14 = wrapIcon(FiChevronDown, 14)
|
|
46
|
+
export const IconCodeOutline16 = wrapIcon(FiCode, 16)
|
|
47
|
+
export const IconCopyOutline16 = wrapIcon(FiCopy, 16)
|
|
48
|
+
export const IconDownloadOutline16 = wrapIcon(FiDownload, 16)
|
|
49
|
+
export const IconLinkOutline16 = wrapIcon(FiLink, 16)
|
|
50
|
+
export const IconLinkOutline14 = wrapIcon(FiLink, 14)
|
|
51
|
+
export const IconBranchOutline16 = wrapIcon(FiGitBranch, 16)
|
|
52
|
+
export const IconTrashOutline16 = wrapIcon(FiTrash2, 16)
|
|
53
|
+
export const IconWarningOutline16 = wrapIcon(FiAlertTriangle, 16)
|
|
54
|
+
export const IconCloseFill14 = wrapIcon(FiX, 14)
|
|
55
|
+
export const IconCloseOutline16 = wrapIcon(FiX, 16)
|
|
56
|
+
export const IconLoadingOutline16 = wrapIcon(FiLoader, 16)
|
|
57
|
+
export const IconPlusOutline16 = wrapIcon(FiPlus, 16)
|
|
58
|
+
export const IconSettingsOutline16 = wrapIcon(FiSettings, 16)
|
|
59
|
+
export const IconFolderOpen16 = wrapIcon(FiFolder, 16)
|
|
60
|
+
export const IconPanelLeftOutline16 = wrapIcon(FiSidebar, 16)
|
|
61
|
+
export const IconCheckOutline16 = wrapIcon(FiCheck, 16)
|
|
9
62
|
|
|
10
63
|
/** User-manual glyph: an open book in the sidebar's 1.5px outline style. */
|
|
11
64
|
export const IconBookOutline16 = ({ size = 16, className }: IconProps) => (
|
package/src/client/index.tsx
CHANGED
|
@@ -39,6 +39,8 @@ import { SideCardSection } from './SideCardSection.tsx'
|
|
|
39
39
|
import { UsageHeatmapSection } from './UsageHeatmapSection.tsx'
|
|
40
40
|
import { AiRatioSection } from './AiRatioSection.tsx'
|
|
41
41
|
import { UpdateSettingsSection } from './UpdateSettingsSection.tsx'
|
|
42
|
+
import { registerPluginMarketSettings } from './PluginMarketSettingsSection.tsx'
|
|
43
|
+
import { createPluginMarketCatalog } from './plugin-market-catalog.ts'
|
|
42
44
|
import { api } from './api.ts'
|
|
43
45
|
import { LOCALE_NS, attachLocale, attachBetterLocale, t, zh, en,
|
|
44
46
|
ja, de, fr, pt, ko, ar, hi, id, tr, vi, th, ru, it, nl, sv, pl,
|
|
@@ -142,6 +144,11 @@ export function apply(ctx: Context): void {
|
|
|
142
144
|
// registrations (the official createXXXStore() factory rule — no
|
|
143
145
|
// module-level singleton).
|
|
144
146
|
const sidebarStore = createSidebarStore()
|
|
147
|
+
const pluginMarketCatalog = createPluginMarketCatalog()
|
|
148
|
+
ctx.effect(() => {
|
|
149
|
+
pluginMarketCatalog.start()
|
|
150
|
+
return () => pluginMarketCatalog.dispose()
|
|
151
|
+
}, 'dsh-better-sidebar: plugin catalogs')
|
|
145
152
|
// Extend (rather than replace) DSH's single-owner Workspace browser with a
|
|
146
153
|
// durable Pinned sessions peer group and an extra native row-menu action.
|
|
147
154
|
// The native browser keeps ownership of search, workspace management and
|
|
@@ -180,7 +187,7 @@ export function apply(ctx: Context): void {
|
|
|
180
187
|
// service (eating our own dogfood). The disposer unregisters them on
|
|
181
188
|
// fiber disposal (HMR-safe).
|
|
182
189
|
ctx.effect(
|
|
183
|
-
() => registerBuiltins(ctx, service, { terminalTitle: () => terminalTitle }),
|
|
190
|
+
() => registerBuiltins(ctx, service, { terminalTitle: () => terminalTitle, pluginMarketCatalog }),
|
|
184
191
|
'dsh-better-sidebar: register built-in tabs and viewers',
|
|
185
192
|
)
|
|
186
193
|
// A failure anywhere in the client lifecycle must never take the app down
|
|
@@ -481,6 +488,8 @@ export function apply(ctx: Context): void {
|
|
|
481
488
|
'dsh-better-sidebar: skill market navigation icon fallback',
|
|
482
489
|
)
|
|
483
490
|
|
|
491
|
+
registerPluginMarketSettings(ctx, pluginMarketCatalog)
|
|
492
|
+
|
|
484
493
|
// The "Side card" settings section: appears in the DSH Settings shell
|
|
485
494
|
// once the shell's declaration is on the ledger (slots.inject waits for
|
|
486
495
|
// it); the section reads/writes the prefs through the plugin's own
|
package/src/client/intercept.tsx
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* compatible across that transition. The chips open the file in the sidebar
|
|
6
6
|
* instead of the host OS.
|
|
7
7
|
*/
|
|
8
|
-
import { IconCodeOutline16 } from '
|
|
8
|
+
import { IconCodeOutline16 } from './icons.tsx'
|
|
9
9
|
import type { Context } from '../context-types.ts'
|
|
10
10
|
import { firstLeaf, revealPaths, togglePanel, type SidebarStore } from './state.ts'
|
|
11
11
|
import { t } from './locales.ts'
|
package/src/client/locales-ja.ts
CHANGED
|
@@ -14,10 +14,75 @@
|
|
|
14
14
|
* - English brand names (VS Code, Cursor, Zed, SSH) stay as-is.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
/** Japanese archive-management copy registered under the ui-tweaks namespace. */
|
|
18
|
+
export const uiTweaksArchiveJa = {
|
|
19
|
+
archiveNav: 'アーカイブ',
|
|
20
|
+
archiveTitle: 'アーカイブ済みセッション',
|
|
21
|
+
archiveEmpty: 'アーカイブ済みセッションはありません。',
|
|
22
|
+
archiveRestore: '復元',
|
|
23
|
+
archiveRestoring: '処理中…',
|
|
24
|
+
archiveConfirmTitle: 'セッションを完全に削除しますか?',
|
|
25
|
+
archiveConfirmDescription: '所有するサブエージェントを含む {count} 件のセッション記録を完全に削除します。この操作は取り消せません。独立した分岐、ワークスペースのファイル、Git データは保持されます。',
|
|
26
|
+
archiveCancel: 'キャンセル',
|
|
27
|
+
archiveDelete: '削除',
|
|
28
|
+
archiveDeleteAll: 'すべて削除',
|
|
29
|
+
archiveSelectAll: 'すべて選択',
|
|
30
|
+
archiveSelectedCount: '{count} 件のセッションを選択中',
|
|
31
|
+
archiveClearSelection: '選択を解除',
|
|
32
|
+
archiveDeleteSelected: '選択したセッションを削除({count})',
|
|
33
|
+
archiveDeleteFailed: '「{title}」:{error}',
|
|
34
|
+
archiveRestoreAll: 'すべて復元',
|
|
35
|
+
archiveCount: '件のセッション',
|
|
36
|
+
archiveUnavailable: 'アーカイブを利用できません。',
|
|
37
|
+
archiveLiveError: 'このセッションは実行中です。完全に削除する前に閉じてください。',
|
|
38
|
+
archiveDisabledHint: 'アーカイブ管理は無効です。「UI 調整」で有効にすると、ここでアーカイブ済みセッションを復元または完全に削除できます。',
|
|
39
|
+
archiveEnable: 'アーカイブ管理を有効にする',
|
|
40
|
+
archiveRestored: '復元しました。',
|
|
41
|
+
} as const
|
|
42
|
+
|
|
17
43
|
/** The ja dictionary (key-set-equal to zh, enforced by the type annotation in locales.ts). */
|
|
18
44
|
export const ja: Record<string, string> = {
|
|
45
|
+
pluginMarketTitle: 'プラグインマーケット',
|
|
46
|
+
pluginMarketProjectDirectory: 'プロジェクトディレクトリ:{path}',
|
|
47
|
+
pluginMarketInstalledTab: 'インストール済み',
|
|
48
|
+
pluginMarketRefresh: '更新',
|
|
49
|
+
pluginMarketLoading: 'プラグインを読み込み中…',
|
|
50
|
+
pluginMarketRefreshing: '一覧を更新中…',
|
|
51
|
+
pluginMarketEmpty: 'プラグインはありません。',
|
|
52
|
+
pluginMarketBack: '戻る',
|
|
53
|
+
pluginMarketInstall: 'インストール',
|
|
54
|
+
pluginMarketUninstall: 'アンインストール',
|
|
55
|
+
pluginMarketProject: 'プロジェクト',
|
|
56
|
+
pluginMarketUser: 'ユーザー',
|
|
57
|
+
pluginMarketInstalled: 'プラグインをインストールしました。',
|
|
58
|
+
pluginMarketUninstalled: 'プラグインをアンインストールしました。',
|
|
59
|
+
pluginMarketSubtitle: 'マーケットを参照し、プロジェクトディレクトリを選ぶかユーザー環境にインストールします。',
|
|
60
|
+
pluginMarketChooseProject: 'プロジェクトディレクトリを選択',
|
|
61
|
+
pluginMarketProjectHint: 'プロジェクトにインストールする場合は対象フォルダーを選択してください。',
|
|
62
|
+
pluginMarketChoosingDirectory: 'ディレクトリを選択中…',
|
|
63
|
+
pluginMarketAwaitingConfirmation: '確認待ち…',
|
|
64
|
+
pluginMarketConfirmProjectInstall: 'プロジェクトへのインストールを確認',
|
|
65
|
+
pluginMarketConfirmProjectDescription: '{name} を以下のプロジェクトディレクトリにインストールします。変更する場合はキャンセルし、ページ上部でディレクトリを選択してください。',
|
|
66
|
+
pluginMarketConfirmInstall: 'インストールを確認',
|
|
67
|
+
pluginMarketInstalledAt: 'プラグインのインストール先:{path}',
|
|
68
|
+
pluginMarketInstallPath: '{scope}のインストール先:{path}',
|
|
69
|
+
pluginMarketDirectoryPath: 'ディレクトリパス',
|
|
70
|
+
pluginMarketOpenDirectory: 'ディレクトリを開く',
|
|
71
|
+
pluginMarketSelectDirectory: 'このディレクトリを選択',
|
|
72
|
+
pluginMarketHomeDirectory: 'ホーム',
|
|
73
|
+
pluginMarketDirectoryTruncated: '一部のフォルダーのみ表示しています。完全なパスを入力してプロジェクトを開けます。',
|
|
74
|
+
pluginMarketSearch: 'マーケットやプラグインを検索',
|
|
75
|
+
pluginMarketDefault: 'デフォルト',
|
|
76
|
+
pluginMarketBrowse: 'プラグインを見る',
|
|
77
|
+
pluginMarketNoDescription: '説明なし',
|
|
78
|
+
pluginMarketInstalling: 'インストール中…',
|
|
79
|
+
pluginMarketUninstalling: 'アンインストール中…',
|
|
80
|
+
pluginMarketInstallProgress: '{name} をインストールしています。しばらくお待ちください…',
|
|
81
|
+
pluginMarketUninstallProgress: '{name} をアンインストールしています。しばらくお待ちください…',
|
|
19
82
|
accountMenuSettings: '設定',
|
|
20
83
|
accountMenuLogout: 'ログアウト',
|
|
84
|
+
accountMenuLogoutConfirmTitle: 'ログアウトしますか?',
|
|
85
|
+
accountMenuLogoutConfirmDescription: 'ChatCode CLI からログアウトしますか?続行するには再度ログインする必要があります。',
|
|
21
86
|
accountMenuLabel: 'アカウントメニュー',
|
|
22
87
|
updateMenu: '更新を確認 / 今すぐ更新',
|
|
23
88
|
updateNav: '更新',
|
package/src/client/locales.ts
CHANGED
|
@@ -23,8 +23,47 @@
|
|
|
23
23
|
|
|
24
24
|
/** The zh dictionary (also registered into the ChatCode CLI locale registry under {@link LOCALE_NS}). */
|
|
25
25
|
export const zh = {
|
|
26
|
+
pluginMarketTitle: '插件市场',
|
|
27
|
+
pluginMarketProjectDirectory: '项目目录:{path}',
|
|
28
|
+
pluginMarketInstalledTab: '已安装',
|
|
29
|
+
pluginMarketRefresh: '刷新',
|
|
30
|
+
pluginMarketLoading: '正在加载插件…',
|
|
31
|
+
pluginMarketRefreshing: '正在刷新列表…',
|
|
32
|
+
pluginMarketEmpty: '暂无插件。',
|
|
33
|
+
pluginMarketBack: '返回',
|
|
34
|
+
pluginMarketInstall: '安装',
|
|
35
|
+
pluginMarketUninstall: '卸载',
|
|
36
|
+
pluginMarketProject: '项目级',
|
|
37
|
+
pluginMarketUser: '用户级',
|
|
38
|
+
pluginMarketInstalled: '插件安装成功。',
|
|
39
|
+
pluginMarketUninstalled: '插件卸载成功。',
|
|
40
|
+
pluginMarketSubtitle: '浏览插件市场,选择项目目录安装,或安装到用户环境。',
|
|
41
|
+
pluginMarketChooseProject: '选择项目目录',
|
|
42
|
+
pluginMarketProjectHint: '安装到项目时,请先选择目标项目文件夹。',
|
|
43
|
+
pluginMarketChoosingDirectory: '正在选择目录…',
|
|
44
|
+
pluginMarketAwaitingConfirmation: '等待确认…',
|
|
45
|
+
pluginMarketConfirmProjectInstall: '确认项目级安装',
|
|
46
|
+
pluginMarketConfirmProjectDescription: '将把 {name} 安装到以下项目目录。如需更改,请取消后在顶部选择项目目录。',
|
|
47
|
+
pluginMarketConfirmInstall: '确认安装',
|
|
48
|
+
pluginMarketInstalledAt: '插件已安装到:{path}',
|
|
49
|
+
pluginMarketInstallPath: '{scope}安装目录:{path}',
|
|
50
|
+
pluginMarketDirectoryPath: '目录路径',
|
|
51
|
+
pluginMarketOpenDirectory: '打开目录',
|
|
52
|
+
pluginMarketSelectDirectory: '选择此目录',
|
|
53
|
+
pluginMarketHomeDirectory: '主目录',
|
|
54
|
+
pluginMarketDirectoryTruncated: '目录过多,仅显示部分结果;可输入完整路径打开项目。',
|
|
55
|
+
pluginMarketSearch: '搜索市场或插件',
|
|
56
|
+
pluginMarketDefault: '默认',
|
|
57
|
+
pluginMarketBrowse: '查看插件',
|
|
58
|
+
pluginMarketNoDescription: '暂无描述',
|
|
59
|
+
pluginMarketInstalling: '安装中…',
|
|
60
|
+
pluginMarketUninstalling: '卸载中…',
|
|
61
|
+
pluginMarketInstallProgress: '正在安装 {name},请稍候…',
|
|
62
|
+
pluginMarketUninstallProgress: '正在卸载 {name},请稍候…',
|
|
26
63
|
accountMenuSettings: '设置',
|
|
27
64
|
accountMenuLogout: '退出登录',
|
|
65
|
+
accountMenuLogoutConfirmTitle: '退出登录?',
|
|
66
|
+
accountMenuLogoutConfirmDescription: '确定要退出 ChatCode CLI 吗?退出后需要重新登录才能继续使用。',
|
|
28
67
|
accountMenuLabel: '账户菜单',
|
|
29
68
|
updateMenu: '检查更新 / 一键更新',
|
|
30
69
|
updateNav: '更新',
|
|
@@ -494,8 +533,47 @@ export const zh = {
|
|
|
494
533
|
|
|
495
534
|
/** The en dictionary (key-set-equal to zh, enforced by the type annotation). */
|
|
496
535
|
export const en: Record<keyof typeof zh, string> = {
|
|
536
|
+
pluginMarketTitle: 'Plugin marketplace',
|
|
537
|
+
pluginMarketProjectDirectory: 'Project directory: {path}',
|
|
538
|
+
pluginMarketInstalledTab: 'Installed',
|
|
539
|
+
pluginMarketRefresh: 'Refresh',
|
|
540
|
+
pluginMarketLoading: 'Loading plugins…',
|
|
541
|
+
pluginMarketRefreshing: 'Refreshing list…',
|
|
542
|
+
pluginMarketEmpty: 'No plugins.',
|
|
543
|
+
pluginMarketBack: 'Back',
|
|
544
|
+
pluginMarketInstall: 'Install',
|
|
545
|
+
pluginMarketUninstall: 'Uninstall',
|
|
546
|
+
pluginMarketProject: 'Project',
|
|
547
|
+
pluginMarketUser: 'User',
|
|
548
|
+
pluginMarketInstalled: 'Plugin installed.',
|
|
549
|
+
pluginMarketUninstalled: 'Plugin uninstalled.',
|
|
550
|
+
pluginMarketSubtitle: 'Browse marketplaces, choose a project directory, or install for your user.',
|
|
551
|
+
pluginMarketChooseProject: 'Choose project directory',
|
|
552
|
+
pluginMarketProjectHint: 'Choose a target project folder when installing for a project.',
|
|
553
|
+
pluginMarketChoosingDirectory: 'Choosing directory…',
|
|
554
|
+
pluginMarketAwaitingConfirmation: 'Awaiting confirmation…',
|
|
555
|
+
pluginMarketConfirmProjectInstall: 'Confirm project installation',
|
|
556
|
+
pluginMarketConfirmProjectDescription: '{name} will be installed in the project directory below. To change it, cancel and choose a project directory at the top of the page.',
|
|
557
|
+
pluginMarketConfirmInstall: 'Confirm installation',
|
|
558
|
+
pluginMarketInstalledAt: 'Plugin installed at: {path}',
|
|
559
|
+
pluginMarketInstallPath: '{scope} installation directory: {path}',
|
|
560
|
+
pluginMarketDirectoryPath: 'Directory path',
|
|
561
|
+
pluginMarketOpenDirectory: 'Open directory',
|
|
562
|
+
pluginMarketSelectDirectory: 'Select this directory',
|
|
563
|
+
pluginMarketHomeDirectory: 'Home',
|
|
564
|
+
pluginMarketDirectoryTruncated: 'Only some folders are shown. Enter the full path to open your project.',
|
|
565
|
+
pluginMarketSearch: 'Search marketplaces or plugins',
|
|
566
|
+
pluginMarketDefault: 'Default',
|
|
567
|
+
pluginMarketBrowse: 'Browse plugins',
|
|
568
|
+
pluginMarketNoDescription: 'No description',
|
|
569
|
+
pluginMarketInstalling: 'Installing…',
|
|
570
|
+
pluginMarketUninstalling: 'Uninstalling…',
|
|
571
|
+
pluginMarketInstallProgress: 'Installing {name}, please wait…',
|
|
572
|
+
pluginMarketUninstallProgress: 'Uninstalling {name}, please wait…',
|
|
497
573
|
accountMenuSettings: 'Settings',
|
|
498
574
|
accountMenuLogout: 'Log out',
|
|
575
|
+
accountMenuLogoutConfirmTitle: 'Log out?',
|
|
576
|
+
accountMenuLogoutConfirmDescription: 'Are you sure you want to log out of ChatCode CLI? You will need to sign in again to continue.',
|
|
499
577
|
accountMenuLabel: 'Account menu',
|
|
500
578
|
updateMenu: 'Check for updates / Update now',
|
|
501
579
|
updateNav: 'Update',
|
|
@@ -992,9 +1070,48 @@ import { zhHK as zhHKDict } from './locales-zh-HK.ts'
|
|
|
992
1070
|
import { zhTW as zhTWDict } from './locales-zh-TW.ts'
|
|
993
1071
|
import { zhMO as zhMODict } from './locales-zh-MO.ts'
|
|
994
1072
|
|
|
995
|
-
// English fallback for the new account/model surfaces until third-language translations are supplied.
|
|
1073
|
+
// English fallback for the new account/model/marketplace surfaces until third-language translations are supplied.
|
|
996
1074
|
// Keep this list explicit so the dictionary parity check still catches other missing keys.
|
|
997
1075
|
const accountAndModelFallback = {
|
|
1076
|
+
pluginMarketTitle: en.pluginMarketTitle,
|
|
1077
|
+
pluginMarketProjectDirectory: en.pluginMarketProjectDirectory,
|
|
1078
|
+
pluginMarketInstalledTab: en.pluginMarketInstalledTab,
|
|
1079
|
+
pluginMarketRefresh: en.pluginMarketRefresh,
|
|
1080
|
+
pluginMarketLoading: en.pluginMarketLoading,
|
|
1081
|
+
pluginMarketRefreshing: en.pluginMarketRefreshing,
|
|
1082
|
+
pluginMarketEmpty: en.pluginMarketEmpty,
|
|
1083
|
+
pluginMarketBack: en.pluginMarketBack,
|
|
1084
|
+
pluginMarketInstall: en.pluginMarketInstall,
|
|
1085
|
+
pluginMarketUninstall: en.pluginMarketUninstall,
|
|
1086
|
+
pluginMarketProject: en.pluginMarketProject,
|
|
1087
|
+
pluginMarketUser: en.pluginMarketUser,
|
|
1088
|
+
pluginMarketInstalled: en.pluginMarketInstalled,
|
|
1089
|
+
pluginMarketUninstalled: en.pluginMarketUninstalled,
|
|
1090
|
+
pluginMarketSubtitle: en.pluginMarketSubtitle,
|
|
1091
|
+
pluginMarketChooseProject: en.pluginMarketChooseProject,
|
|
1092
|
+
pluginMarketProjectHint: en.pluginMarketProjectHint,
|
|
1093
|
+
pluginMarketChoosingDirectory: en.pluginMarketChoosingDirectory,
|
|
1094
|
+
pluginMarketAwaitingConfirmation: en.pluginMarketAwaitingConfirmation,
|
|
1095
|
+
pluginMarketConfirmProjectInstall: en.pluginMarketConfirmProjectInstall,
|
|
1096
|
+
pluginMarketConfirmProjectDescription: en.pluginMarketConfirmProjectDescription,
|
|
1097
|
+
pluginMarketConfirmInstall: en.pluginMarketConfirmInstall,
|
|
1098
|
+
pluginMarketInstalledAt: en.pluginMarketInstalledAt,
|
|
1099
|
+
pluginMarketInstallPath: en.pluginMarketInstallPath,
|
|
1100
|
+
pluginMarketDirectoryPath: en.pluginMarketDirectoryPath,
|
|
1101
|
+
pluginMarketOpenDirectory: en.pluginMarketOpenDirectory,
|
|
1102
|
+
pluginMarketSelectDirectory: en.pluginMarketSelectDirectory,
|
|
1103
|
+
pluginMarketHomeDirectory: en.pluginMarketHomeDirectory,
|
|
1104
|
+
pluginMarketDirectoryTruncated: en.pluginMarketDirectoryTruncated,
|
|
1105
|
+
pluginMarketSearch: en.pluginMarketSearch,
|
|
1106
|
+
pluginMarketDefault: en.pluginMarketDefault,
|
|
1107
|
+
pluginMarketBrowse: en.pluginMarketBrowse,
|
|
1108
|
+
pluginMarketNoDescription: en.pluginMarketNoDescription,
|
|
1109
|
+
pluginMarketInstalling: en.pluginMarketInstalling,
|
|
1110
|
+
pluginMarketUninstalling: en.pluginMarketUninstalling,
|
|
1111
|
+
pluginMarketInstallProgress: en.pluginMarketInstallProgress,
|
|
1112
|
+
pluginMarketUninstallProgress: en.pluginMarketUninstallProgress,
|
|
1113
|
+
accountMenuLogoutConfirmTitle: en.accountMenuLogoutConfirmTitle,
|
|
1114
|
+
accountMenuLogoutConfirmDescription: en.accountMenuLogoutConfirmDescription,
|
|
998
1115
|
chatcodeGateChecking: en.chatcodeGateChecking,
|
|
999
1116
|
chatcodeGateUnverified: en.chatcodeGateUnverified,
|
|
1000
1117
|
chatcodeGatePending: en.chatcodeGatePending,
|
package/src/client/md-toc.tsx
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { useLayoutEffect, useRef, useState } from 'react'
|
|
20
20
|
import type { ReactNode } from 'react'
|
|
21
|
-
import { IconListPenOutline16 } from '
|
|
21
|
+
import { IconListPenOutline16 } from './icons.tsx'
|
|
22
22
|
import { t } from './locales.ts'
|
|
23
23
|
import css from './sidebar.module.css'
|
|
24
24
|
|
package/src/client/mermaid.tsx
CHANGED
|
@@ -28,7 +28,8 @@ import { useCallback, useEffect, useLayoutEffect, useRef, useState, type MouseEv
|
|
|
28
28
|
import { createPortal } from 'react-dom'
|
|
29
29
|
import { createRoot, type Root } from 'react-dom/client'
|
|
30
30
|
import mermaid from 'mermaid'
|
|
31
|
-
import {
|
|
31
|
+
import { MarkdownText, writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
32
|
+
import { IconCopyOutline16 } from './icons.tsx'
|
|
32
33
|
import { isDarkScheme, subscribeColorScheme } from './theme.ts'
|
|
33
34
|
import { markdownTextProps } from './markdown-labels.tsx'
|
|
34
35
|
import { t } from './locales.ts'
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* this component owns only its own section.
|
|
11
11
|
*/
|
|
12
12
|
import { useState } from 'react'
|
|
13
|
-
import { IconCloseOutline16 } from '
|
|
13
|
+
import { IconCloseOutline16 } from './icons.tsx'
|
|
14
14
|
import {
|
|
15
15
|
isValidCustomEditor,
|
|
16
16
|
newCustomEditorId,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** App-lifetime remote catalogs, shared by Settings and the sidebar tab. */
|
|
2
|
+
import { api } from './api.ts'
|
|
3
|
+
import type { MarketplaceCatalog, MarketplacePlugin } from '../plugin-market-shared.ts'
|
|
4
|
+
|
|
5
|
+
interface Entry<T> {
|
|
6
|
+
readonly status: 'loading' | 'ready' | 'error'
|
|
7
|
+
readonly data?: T
|
|
8
|
+
readonly error?: string
|
|
9
|
+
readonly warning?: string
|
|
10
|
+
}
|
|
11
|
+
interface Snapshot {
|
|
12
|
+
readonly markets?: Entry<MarketplaceCatalog>
|
|
13
|
+
readonly plugins: Readonly<Record<string, Entry<MarketplacePlugin[]>>>
|
|
14
|
+
readonly refresh?: { readonly status: 'loading' | 'ready' | 'error'; readonly error?: string }
|
|
15
|
+
}
|
|
16
|
+
export interface PluginMarketCatalog {
|
|
17
|
+
subscribe(listener: () => void): () => void
|
|
18
|
+
getSnapshot(): Snapshot
|
|
19
|
+
start(): void
|
|
20
|
+
ensure(marketplaceId: string): void
|
|
21
|
+
refresh(marketplaceId?: string): void
|
|
22
|
+
dispose(): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function createPluginMarketCatalog(): PluginMarketCatalog {
|
|
26
|
+
let snapshot: Snapshot = { plugins: {} }
|
|
27
|
+
let disposed = false
|
|
28
|
+
const listeners = new Set<() => void>()
|
|
29
|
+
const controllers = new Set<AbortController>()
|
|
30
|
+
const requests = new Map<string, Promise<string | undefined>>()
|
|
31
|
+
const publish = (next: Snapshot): void => {
|
|
32
|
+
if (disposed) return
|
|
33
|
+
snapshot = next
|
|
34
|
+
listeners.forEach(listener => listener())
|
|
35
|
+
}
|
|
36
|
+
const load = <T>(
|
|
37
|
+
key: string,
|
|
38
|
+
current: () => Entry<T> | undefined,
|
|
39
|
+
update: (entry: Entry<T>) => void,
|
|
40
|
+
request: (signal: AbortSignal) => Promise<{ data: T; warning?: string }>,
|
|
41
|
+
): Promise<string | undefined> => {
|
|
42
|
+
if (disposed) return Promise.resolve(undefined)
|
|
43
|
+
const pending = requests.get(key)
|
|
44
|
+
if (pending) return pending
|
|
45
|
+
const entry: Entry<T> = { status: 'loading', data: current()?.data }
|
|
46
|
+
const controller = new AbortController()
|
|
47
|
+
controllers.add(controller)
|
|
48
|
+
update(entry)
|
|
49
|
+
const result = request(controller.signal).then(
|
|
50
|
+
({ data, warning }) => { if (current() === entry) update({ status: 'ready', data, ...(warning ? { warning } : {}) }); return undefined },
|
|
51
|
+
cause => {
|
|
52
|
+
const error = cause instanceof Error ? cause.message : String(cause)
|
|
53
|
+
if (current() === entry) update({ status: 'error', data: entry.data, error })
|
|
54
|
+
return error
|
|
55
|
+
},
|
|
56
|
+
).finally(() => { controllers.delete(controller); requests.delete(key) })
|
|
57
|
+
requests.set(key, result)
|
|
58
|
+
return result
|
|
59
|
+
}
|
|
60
|
+
const markets = (force = false): Promise<string | undefined> => {
|
|
61
|
+
if (!force && snapshot.markets) return Promise.resolve(undefined)
|
|
62
|
+
return load('markets', () => snapshot.markets, entry => publish({ ...snapshot, markets: entry }), async signal => ({ data: await api.pluginMarketplaces(signal) }))
|
|
63
|
+
}
|
|
64
|
+
const plugins = (id: string, force = false): Promise<string | undefined> => {
|
|
65
|
+
if (!force && snapshot.plugins[id]) return Promise.resolve(undefined)
|
|
66
|
+
return load(`plugins:${id}`, () => snapshot.plugins[id], entry => publish({ ...snapshot, plugins: { ...snapshot.plugins, [id]: entry } }), async signal => {
|
|
67
|
+
const result = await api.pluginCatalog(id, signal)
|
|
68
|
+
return Array.isArray(result) ? { data: result } : { data: result.plugins, warning: result.warning }
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
subscribe: listener => { listeners.add(listener); return () => { listeners.delete(listener) } },
|
|
73
|
+
getSnapshot: () => snapshot,
|
|
74
|
+
start: () => { void markets() },
|
|
75
|
+
ensure: id => { void plugins(id) },
|
|
76
|
+
refresh: id => {
|
|
77
|
+
if (disposed || snapshot.refresh?.status === 'loading') return
|
|
78
|
+
// Refresh every previously visited catalog before unlocking navigation.
|
|
79
|
+
// Keep cached cards for layout continuity; views disable their controls.
|
|
80
|
+
const ids = new Set(Object.keys(snapshot.plugins))
|
|
81
|
+
if (id) ids.add(id)
|
|
82
|
+
publish({ ...snapshot, refresh: { status: 'loading' } })
|
|
83
|
+
void Promise.all([markets(true), ...[...ids].map(key => plugins(key, true))]).then(results => {
|
|
84
|
+
const errors = [...new Set(results.filter((value): value is string => value !== undefined))]
|
|
85
|
+
publish({ ...snapshot, refresh: errors.length ? { status: 'error', error: errors.join('\n') } : { status: 'ready' } })
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
dispose: () => { disposed = true; controllers.forEach(controller => controller.abort()); controllers.clear(); requests.clear(); listeners.clear() },
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/client/service.ts
CHANGED
|
@@ -472,7 +472,7 @@ export function matchUrlTarget(tabs: readonly TabDescriptor[], url: URL): TabDes
|
|
|
472
472
|
* The plugin version this service instance reports. Keep in lockstep with
|
|
473
473
|
* `package.json`'s version — `tests/service.spec.ts` asserts the pair.
|
|
474
474
|
*/
|
|
475
|
-
export const SIDEBAR_SERVICE_VERSION = '0.18.0-alpha.
|
|
475
|
+
export const SIDEBAR_SERVICE_VERSION = '0.18.0-alpha.4'
|
|
476
476
|
|
|
477
477
|
/**
|
|
478
478
|
* Monotonic capability list consumers use to gate new API usage (features
|