@chatcode/cco-better-sidebar 0.18.0-alpha.4 → 0.18.0-rc.3
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 +5 -4
- package/README_EN.md +5 -4
- package/cordis.patch.yml +6 -5
- package/lib/client-editor.js +11116 -700
- package/lib/client-mermaid.js +10689 -276
- package/lib/client-registry.js +2256 -1650
- package/lib/client-terminal.js +262 -262
- package/lib/client.js +2255 -1649
- package/lib/index.js +63 -42
- package/lib/types/client/builtins/tabs.d.ts +9 -0
- package/lib/types/client/icons.d.ts +26 -8
- package/lib/types/client/service.d.ts +1 -1
- package/lib/types/config.d.ts +4 -3
- package/lib/types/context-types.d.ts +12 -14
- package/lib/types/prefs-shared.d.ts +1 -1
- package/lib/types/pty-deps.d.ts +1 -1
- package/lib/types/ui-tweaks/index.d.ts +2 -3
- package/package.json +2 -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/SideCardSection.tsx +2 -8
- 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/builtins/tabs.tsx +9 -2
- package/src/client/builtins/viewers.tsx +2 -1
- package/src/client/icons.tsx +57 -4
- package/src/client/intercept.tsx +1 -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/service.ts +1 -1
- package/src/client/ui-tweaks/branding.tsx +2 -2
- package/src/config.ts +22 -2
- package/src/context-types.ts +5 -15
- package/src/index.ts +22 -20
- package/src/prefs-shared.ts +1 -1
- package/src/pty-deps.ts +2 -2
- package/src/ui-tweaks/config.ts +1 -1
- package/src/ui-tweaks/index.ts +7 -13
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/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/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,
|
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
|
|
@@ -29,7 +29,7 @@ export const PROJECT_LOGO_URL = '/_dsh/ui-tweaks/assets/logo.svg'
|
|
|
29
29
|
const PROJECT_NAME = 'ChatCode CLI'
|
|
30
30
|
const HERO_TITLE = '与世界,深一度对话'
|
|
31
31
|
const LEGACY_HOST_BRAND_TEXT = /DSH\s*(?:Local\s*Build|本地构建)|DeepSeek\s*Harness|ChatCode\s*CLI/giu
|
|
32
|
-
const
|
|
32
|
+
const LEGACY_HOST_BRAND_LABEL_TEXT = /^(?:DSH\s*(?:Local\s*Build|本地构建)|ChatCode\s*CLI)$/iu
|
|
33
33
|
const HOST_BUILD_VERSION_TEXT = /^v?\d+\.\d+\.\d+(?:[-+][0-9a-z.-]+)*$/iu
|
|
34
34
|
const HERO_HEADLINE = /探索未至之境/u
|
|
35
35
|
const HERO_PREVIEW_TEXT = /^(?:预览版|Preview)$/iu
|
|
@@ -194,7 +194,7 @@ function syncBranding(): void {
|
|
|
194
194
|
// The sidebar label identifies the precise icon to its left. Process it
|
|
195
195
|
// before the generic text pass so the sibling relationship is still intact.
|
|
196
196
|
document.querySelectorAll<HTMLElement>('body *').forEach((element) => {
|
|
197
|
-
if (element.childElementCount !== 0 || !
|
|
197
|
+
if (element.childElementCount !== 0 || !LEGACY_HOST_BRAND_LABEL_TEXT.test(element.textContent?.trim() ?? '')) return
|
|
198
198
|
if (element.textContent !== PROJECT_NAME) element.textContent = PROJECT_NAME
|
|
199
199
|
element.classList.add('dut-brand-title')
|
|
200
200
|
replaceLogoBesideBrandLabel(element)
|
package/src/config.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import z from 'schemastery'
|
|
9
|
+
import { Config as UITweaksSchema, type UITweaksConfig } from './ui-tweaks/config.ts'
|
|
9
10
|
import {
|
|
10
11
|
SIDEBAR_PREFS_DEFAULTS,
|
|
11
12
|
SIDEBAR_PREFS_NS,
|
|
@@ -37,7 +38,7 @@ export {
|
|
|
37
38
|
} from './prefs-shared.ts'
|
|
38
39
|
|
|
39
40
|
/** Tunable sidebar host limits (every field optional; defaults fill in). */
|
|
40
|
-
export interface SidebarConfig {
|
|
41
|
+
export interface SidebarConfig extends Partial<SidebarPrefs>, UITweaksConfig {
|
|
41
42
|
/** Read cap of one text file (bytes); larger files return truncated. */
|
|
42
43
|
readLimit?: number
|
|
43
44
|
/** Media route cap (bytes); larger binaries are refused. */
|
|
@@ -88,7 +89,7 @@ export interface CodingPlanConfig {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
/** Schemastery schema for the plugin configuration. */
|
|
91
|
-
|
|
92
|
+
const HostConfig = z.object({
|
|
92
93
|
readLimit: z.number().step(1).min(1).default(512 * 1024),
|
|
93
94
|
mediaLimit: z.number().step(1).min(1).default(20 * 1024 * 1024),
|
|
94
95
|
uploadLimit: z.number().step(1).min(1).default(128 * 1024 * 1024),
|
|
@@ -205,3 +206,22 @@ export const PrefsSchema: z<SidebarPrefs> = z.object({
|
|
|
205
206
|
// keys as unknown schema fields.
|
|
206
207
|
pluginSettings: z.dict(z.dict(z.any())).default({}),
|
|
207
208
|
})
|
|
209
|
+
|
|
210
|
+
function live<T>(schema: z<T>): z<T> {
|
|
211
|
+
Reflect.set(schema.meta, 'volatile', true)
|
|
212
|
+
return schema
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function liveFields(schema: z): Record<string, z> {
|
|
216
|
+
if (schema.type !== 'object' || schema.dict === undefined) {
|
|
217
|
+
throw new TypeError('Live settings schema must be an object')
|
|
218
|
+
}
|
|
219
|
+
return Object.fromEntries(Object.entries(schema.dict).map(([key, field]) => [key, live(field)]))
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** One entry schema: deployment fields stay fixed while sidebar and UI preferences are live-editable. */
|
|
223
|
+
export const Config = z.object({
|
|
224
|
+
...HostConfig.dict,
|
|
225
|
+
...liveFields(PrefsSchema),
|
|
226
|
+
...liveFields(UITweaksSchema),
|
|
227
|
+
}) as z<SidebarConfig>
|
package/src/context-types.ts
CHANGED
|
@@ -446,22 +446,10 @@ export interface SidebarInvariantsService {
|
|
|
446
446
|
): () => void
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
/** The settings service face (mirror of @deepseek-ai/dsh-settings'
|
|
449
|
+
/** The settings service face (mirror of @deepseek-ai/dsh-settings' SettingsForms). */
|
|
450
450
|
export interface SidebarSettingsService {
|
|
451
|
-
/**
|
|
452
|
-
|
|
453
|
-
* then the composition base, then the user document).
|
|
454
|
-
*/
|
|
455
|
-
register<T>(
|
|
456
|
-
ns: string,
|
|
457
|
-
schema: unknown,
|
|
458
|
-
options?: { base?: Partial<T>; applies?: 'live' | 'restart' },
|
|
459
|
-
): {
|
|
460
|
-
get(): T
|
|
461
|
-
watch(callback: (next: T, prev: T) => void | Promise<void>): () => void
|
|
462
|
-
update(patch: object): Promise<void>
|
|
463
|
-
replace(section: object): Promise<void>
|
|
464
|
-
}
|
|
451
|
+
/** Whether the active profile accepts form edits. */
|
|
452
|
+
readonly writable: boolean
|
|
465
453
|
/** Redacted descriptors of every registered namespace (secrets stripped). */
|
|
466
454
|
describe(options?: { redactSecrets?: boolean }): Array<{
|
|
467
455
|
ns: string
|
|
@@ -473,6 +461,8 @@ export interface SidebarSettingsService {
|
|
|
473
461
|
}>
|
|
474
462
|
/** Service-level merge write with the revision guard (a stale writer is refused). */
|
|
475
463
|
update(ns: string, patch: object, expectedRevision?: number): Promise<void>
|
|
464
|
+
/** Apply path edits without restating fields hidden from the caller. */
|
|
465
|
+
mutate(ns: string, ops: readonly ({ op: 'set'; path: readonly string[]; value: unknown } | { op: 'unset'; path: readonly string[] })[], expectedRevision?: number): Promise<void>
|
|
476
466
|
}
|
|
477
467
|
|
|
478
468
|
/**
|
package/src/index.ts
CHANGED
|
@@ -21,7 +21,6 @@ import { WebSocket, WebSocketServer } from 'ws'
|
|
|
21
21
|
import type { Context, SidebarHttpRequest } from './context-types.ts'
|
|
22
22
|
import {
|
|
23
23
|
Config,
|
|
24
|
-
PrefsSchema,
|
|
25
24
|
resolveSidebarConfig,
|
|
26
25
|
SIDEBAR_PREFS_DEFAULTS,
|
|
27
26
|
SIDEBAR_PREFS_NS,
|
|
@@ -829,9 +828,8 @@ function buildApi(
|
|
|
829
828
|
* {@link resolveSidebarConfig}.
|
|
830
829
|
*/
|
|
831
830
|
export function apply(ctx: Context, config?: SidebarConfig): void {
|
|
832
|
-
// dsh-ui-tweaks is embedded as an intact feature module. Its
|
|
833
|
-
//
|
|
834
|
-
// settings.yaml values and browser behavior carry over without migration.
|
|
831
|
+
// dsh-ui-tweaks is embedded as an intact feature module. Its routes stay
|
|
832
|
+
// unchanged while its live fields share this entry's generated settings form.
|
|
835
833
|
// Cordis honours the root `inject` list in production. Keeping this guard
|
|
836
834
|
// lets lightweight embedders that call apply() directly retain the sidebar
|
|
837
835
|
// subset when they intentionally omit the settings service.
|
|
@@ -886,8 +884,8 @@ export function apply(ctx: Context, config?: SidebarConfig): void {
|
|
|
886
884
|
void codingPlanCatalogue.refresh().catch(() => { /* catalogue returns a safe unavailable snapshot */ })
|
|
887
885
|
|
|
888
886
|
// ── User-facing "Side card" preferences ──────────────────────────────────
|
|
889
|
-
//
|
|
890
|
-
//
|
|
887
|
+
// The Settings page (client half) renders and persists the
|
|
888
|
+
// new-conversation defaults from this entry's volatile Config fields. The
|
|
891
889
|
// DSH settings RPC domain (api-proxy) only serves allowlisted namespaces to
|
|
892
890
|
// configuration clients, so the client reaches this namespace through the
|
|
893
891
|
// plugin's own fenced routes below ('settings.get'/'settings.update'),
|
|
@@ -921,17 +919,7 @@ export function apply(ctx: Context, config?: SidebarConfig): void {
|
|
|
921
919
|
}
|
|
922
920
|
}
|
|
923
921
|
ctx.inject(['settings'], (sctx) => {
|
|
924
|
-
// DSH 0.1.2-alpha.2 validates namespaces at compile time
|
|
925
|
-
// (SettingsNamespaceInput); the 'dsh-better-sidebar' literal passes, so the
|
|
926
|
-
// runtime helper this used to call (settingsNamespace) is gone upstream.
|
|
927
922
|
const ns = SIDEBAR_PREFS_NS
|
|
928
|
-
// The structural settings mirror types `schema` as unknown, so the
|
|
929
|
-
// generic is not inferred here; the real service resolves it from the
|
|
930
|
-
// schemastery schema (PrefsSchema) — narrow the owner scope explicitly.
|
|
931
|
-
const scope = sctx.settings.register(ns, PrefsSchema) as {
|
|
932
|
-
get(): SidebarPrefs
|
|
933
|
-
watch(callback: (next: SidebarPrefs, prev: SidebarPrefs) => void): () => void
|
|
934
|
-
}
|
|
935
923
|
const viewOf = (): { value?: unknown; revision?: number } => {
|
|
936
924
|
const descriptor = sctx.settings.describe({ redactSecrets: true }).find(candidate => candidate.ns === ns)
|
|
937
925
|
return descriptor === undefined
|
|
@@ -957,6 +945,15 @@ export function apply(ctx: Context, config?: SidebarConfig): void {
|
|
|
957
945
|
return viewOf()
|
|
958
946
|
},
|
|
959
947
|
}
|
|
948
|
+
const scope = {
|
|
949
|
+
get: (): SidebarPrefs => {
|
|
950
|
+
const value = viewOf().value
|
|
951
|
+
return {
|
|
952
|
+
...SIDEBAR_PREFS_DEFAULTS,
|
|
953
|
+
...(typeof value === 'object' && value !== null ? value : {}),
|
|
954
|
+
} as SidebarPrefs
|
|
955
|
+
},
|
|
956
|
+
}
|
|
960
957
|
// Register (or unregister) the terminal tools from the current setting,
|
|
961
958
|
// and keep them in sync with every settings commit.
|
|
962
959
|
syncToolsGate(scope)
|
|
@@ -988,10 +985,15 @@ export function apply(ctx: Context, config?: SidebarConfig): void {
|
|
|
988
985
|
}
|
|
989
986
|
}
|
|
990
987
|
syncOpenToolsGate()
|
|
991
|
-
//
|
|
992
|
-
//
|
|
993
|
-
|
|
994
|
-
|
|
988
|
+
// Volatile Config writes preserve the plugin fiber. Re-read the projected
|
|
989
|
+
// form after each Loader update so both gates track the committed values.
|
|
990
|
+
const updates = sctx as unknown as {
|
|
991
|
+
on(event: 'loader/volatile-update', listener: () => void): () => void
|
|
992
|
+
}
|
|
993
|
+
updates.on('loader/volatile-update', () => {
|
|
994
|
+
syncToolsGate(scope)
|
|
995
|
+
syncOpenToolsGate()
|
|
996
|
+
})
|
|
995
997
|
})
|
|
996
998
|
|
|
997
999
|
// ── JSON API ────────────────────────────────────────────────────────────
|
package/src/prefs-shared.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/** The user-settings namespace holding the side card preferences. */
|
|
10
|
-
export const SIDEBAR_PREFS_NS = '
|
|
10
|
+
export const SIDEBAR_PREFS_NS = 'better-sidebar'
|
|
11
11
|
|
|
12
12
|
/** User-facing side card preferences (new-conversation defaults). */
|
|
13
13
|
export interface SidebarPrefs {
|
package/src/pty-deps.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* agent terminal tools are simply not registered.
|
|
18
18
|
*
|
|
19
19
|
* Version contract: the plugin must stay in sync with DSH core —
|
|
20
|
-
* `@deepseek-ai/dsh-subprocess-local` declares `"node-pty": "
|
|
20
|
+
* `@deepseek-ai/dsh-subprocess-local` declares `"node-pty": "1.2.0-beta.15"` in
|
|
21
21
|
* its `dependencies`. Both sides then resolve the SAME pnpm store entry
|
|
22
22
|
* (same range, same integrity → one native binding, no drift). Do NOT
|
|
23
23
|
* switch to a fork (e.g. @lydell/node-pty) or a different range without
|
|
@@ -39,7 +39,7 @@ export type NodePtyModule = typeof nodePtyNs
|
|
|
39
39
|
* range DSH core declares (`@deepseek-ai/dsh-subprocess-local`): the same
|
|
40
40
|
* range keeps pnpm resolving both to one physical package.
|
|
41
41
|
*/
|
|
42
|
-
export const DSH_NODE_PTY_RANGE = '
|
|
42
|
+
export const DSH_NODE_PTY_RANGE = '1.2.0-beta.15'
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The WebSocket close-code-1011 reason the host sends when node-pty is
|
package/src/ui-tweaks/config.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { SettingsNamespace } from '@deepseek-ai/dsh-settings'
|
|
|
14
14
|
// `settingsNamespace()` was removed in DSH 0.1.2-alpha.2. Keep the opaque
|
|
15
15
|
// namespace type for source compatibility with older DSH declarations, while
|
|
16
16
|
// emitting the plain validated literal required by the current runtime.
|
|
17
|
-
export const UI_TWEAKS_SETTINGS_NAMESPACE = '
|
|
17
|
+
export const UI_TWEAKS_SETTINGS_NAMESPACE = 'better-sidebar' as SettingsNamespace
|
|
18
18
|
|
|
19
19
|
/** Raw user-facing configuration (partial inputs receive schema defaults). */
|
|
20
20
|
export interface UITweaksConfig {
|
package/src/ui-tweaks/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dsh-ui-tweaks — server half.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* conversation UI
|
|
6
|
-
* document directly (settings.yaml `ui-tweaks:` section). All rendering work
|
|
4
|
+
* Uses the owning sidebar entry's live settings so users can tune the
|
|
5
|
+
* conversation UI from the Settings panel. All rendering work
|
|
7
6
|
* happens in the browser bundle (`src/client`), which reads and writes this
|
|
8
7
|
* namespace through the same-origin route mounted here — the Web settings RPC
|
|
9
8
|
* only exposes a fixed allowlist of namespaces since rc.6, so a custom route is
|
|
@@ -12,11 +11,7 @@
|
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
import type { Context } from '@deepseek-ai/cordis'
|
|
15
|
-
import {
|
|
16
|
-
UI_TWEAKS_SETTINGS_NAMESPACE,
|
|
17
|
-
Config,
|
|
18
|
-
type UITweaksConfig,
|
|
19
|
-
} from './config.ts'
|
|
14
|
+
import { UI_TWEAKS_SETTINGS_NAMESPACE, type UITweaksConfig } from './config.ts'
|
|
20
15
|
import { installTurnOutcomeProjection } from './turn-outcome.ts'
|
|
21
16
|
import { UITweaksWebBackend, installUITweaksWeb } from './web.ts'
|
|
22
17
|
import { GitBackend } from './git.ts'
|
|
@@ -30,10 +25,6 @@ export const name = 'dsh-ui-tweaks'
|
|
|
30
25
|
export const inject = ['settings']
|
|
31
26
|
|
|
32
27
|
export function apply(ctx: Context): void {
|
|
33
|
-
ctx.settings.register(UI_TWEAKS_SETTINGS_NAMESPACE, Config, {
|
|
34
|
-
applies: 'live',
|
|
35
|
-
})
|
|
36
|
-
|
|
37
28
|
// The task notifier classifies turn endings (completed / aborted / failed)
|
|
38
29
|
// through this session projection (same registration pattern as above).
|
|
39
30
|
installTurnOutcomeProjection(ctx)
|
|
@@ -44,7 +35,10 @@ export function apply(ctx: Context): void {
|
|
|
44
35
|
|
|
45
36
|
// The GitBar runs git in the session's working directory through these
|
|
46
37
|
// same-origin routes (sessions/llm are optional services, duck-typed).
|
|
47
|
-
const readConfig = (): UITweaksConfig =>
|
|
38
|
+
const readConfig = (): UITweaksConfig => {
|
|
39
|
+
const descriptor = ctx.settings.describe().find(candidate => candidate.ns === UI_TWEAKS_SETTINGS_NAMESPACE)
|
|
40
|
+
return descriptor?.value as UITweaksConfig | undefined ?? {}
|
|
41
|
+
}
|
|
48
42
|
installGitWeb(ctx, new GitBackend(ctx, readConfig))
|
|
49
43
|
|
|
50
44
|
// The Archive panel lists archived sessions and restores ("deletes") them
|