dsh-coding-sidebar 1.0.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.
Files changed (277) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +524 -0
  3. package/cordis.patch.yml +49 -0
  4. package/lib/client-editor.js +48229 -0
  5. package/lib/client-mermaid.js +200745 -0
  6. package/lib/client-registry.js +21867 -0
  7. package/lib/client-terminal.js +9361 -0
  8. package/lib/client.js +21867 -0
  9. package/lib/index.js +4556 -0
  10. package/lib/invariant.js +22 -0
  11. package/lib/types/agent-opens.d.ts +65 -0
  12. package/lib/types/agent-pty.d.ts +226 -0
  13. package/lib/types/browser-probe.d.ts +15 -0
  14. package/lib/types/bundle-route.d.ts +12 -0
  15. package/lib/types/client/BrowserView.d.ts +39 -0
  16. package/lib/types/client/DiffTab.d.ts +6 -0
  17. package/lib/types/client/DiffView.d.ts +51 -0
  18. package/lib/types/client/EditorHost.d.ts +13 -0
  19. package/lib/types/client/FileTree.d.ts +38 -0
  20. package/lib/types/client/FreeWindow.d.ts +29 -0
  21. package/lib/types/client/GitView.d.ts +10 -0
  22. package/lib/types/client/MarkdownHtml.d.ts +32 -0
  23. package/lib/types/client/OrphanedTab.d.ts +11 -0
  24. package/lib/types/client/PdfView.d.ts +6 -0
  25. package/lib/types/client/RenderBoundary.d.ts +32 -0
  26. package/lib/types/client/SandboxStatusBar.d.ts +10 -0
  27. package/lib/types/client/SideCardSection.d.ts +74 -0
  28. package/lib/types/client/SideChatView.d.ts +16 -0
  29. package/lib/types/client/Sidebar.d.ts +6 -0
  30. package/lib/types/client/SubagentView.d.ts +16 -0
  31. package/lib/types/client/TabBar.d.ts +54 -0
  32. package/lib/types/client/TerminalView.d.ts +24 -0
  33. package/lib/types/client/TextEditor.d.ts +10 -0
  34. package/lib/types/client/TreePanel.d.ts +24 -0
  35. package/lib/types/client/UploadOverlay.d.ts +20 -0
  36. package/lib/types/client/add-plugin-modal.d.ts +15 -0
  37. package/lib/types/client/api.d.ts +275 -0
  38. package/lib/types/client/binary-download.d.ts +12 -0
  39. package/lib/types/client/breakpoints.d.ts +17 -0
  40. package/lib/types/client/browser.d.ts +60 -0
  41. package/lib/types/client/builtins/index.d.ts +18 -0
  42. package/lib/types/client/builtins/tabs.d.ts +11 -0
  43. package/lib/types/client/builtins/viewers.d.ts +3 -0
  44. package/lib/types/client/chunk-loader.d.ts +131 -0
  45. package/lib/types/client/chunks/editor.d.ts +9 -0
  46. package/lib/types/client/chunks/mermaid.d.ts +10 -0
  47. package/lib/types/client/chunks/terminal.d.ts +9 -0
  48. package/lib/types/client/cm-themes.d.ts +24 -0
  49. package/lib/types/client/conversation-draft.d.ts +14 -0
  50. package/lib/types/client/desktop-env.d.ts +35 -0
  51. package/lib/types/client/editor-load.d.ts +66 -0
  52. package/lib/types/client/frame-batcher.d.ts +24 -0
  53. package/lib/types/client/icons.d.ts +59 -0
  54. package/lib/types/client/image-types.d.ts +3 -0
  55. package/lib/types/client/ime-guard.d.ts +36 -0
  56. package/lib/types/client/index.d.ts +25 -0
  57. package/lib/types/client/intercept.d.ts +46 -0
  58. package/lib/types/client/lang.d.ts +14 -0
  59. package/lib/types/client/layout-push.d.ts +15 -0
  60. package/lib/types/client/lazy-chunk.d.ts +25 -0
  61. package/lib/types/client/link-intercept.d.ts +42 -0
  62. package/lib/types/client/locales-ar.d.ts +18 -0
  63. package/lib/types/client/locales-de.d.ts +4 -0
  64. package/lib/types/client/locales-fr.d.ts +10 -0
  65. package/lib/types/client/locales-hi.d.ts +17 -0
  66. package/lib/types/client/locales-id.d.ts +15 -0
  67. package/lib/types/client/locales-it.d.ts +8 -0
  68. package/lib/types/client/locales-ja.d.ts +17 -0
  69. package/lib/types/client/locales-ko.d.ts +9 -0
  70. package/lib/types/client/locales-nl.d.ts +16 -0
  71. package/lib/types/client/locales-pl.d.ts +19 -0
  72. package/lib/types/client/locales-pt.d.ts +1 -0
  73. package/lib/types/client/locales-ru.d.ts +13 -0
  74. package/lib/types/client/locales-sv.d.ts +1 -0
  75. package/lib/types/client/locales-th.d.ts +17 -0
  76. package/lib/types/client/locales-tr.d.ts +17 -0
  77. package/lib/types/client/locales-vi.d.ts +17 -0
  78. package/lib/types/client/locales-zh-HK.d.ts +32 -0
  79. package/lib/types/client/locales-zh-MO.d.ts +32 -0
  80. package/lib/types/client/locales-zh-TW.d.ts +32 -0
  81. package/lib/types/client/locales.d.ts +452 -0
  82. package/lib/types/client/markdown-html.d.ts +96 -0
  83. package/lib/types/client/markdown-images.d.ts +45 -0
  84. package/lib/types/client/markdown-labels.d.ts +38 -0
  85. package/lib/types/client/md-toc.d.ts +4 -0
  86. package/lib/types/client/mermaid-blocks.d.ts +47 -0
  87. package/lib/types/client/mermaid-sanitize.d.ts +2 -0
  88. package/lib/types/client/mermaid.d.ts +12 -0
  89. package/lib/types/client/open-when-sized.d.ts +20 -0
  90. package/lib/types/client/open-with-settings.d.ts +4 -0
  91. package/lib/types/client/open-with.d.ts +87 -0
  92. package/lib/types/client/openpath-intercept.d.ts +85 -0
  93. package/lib/types/client/paths.d.ts +43 -0
  94. package/lib/types/client/pdf-types.d.ts +2 -0
  95. package/lib/types/client/pinned.d.ts +86 -0
  96. package/lib/types/client/plugin-settings.d.ts +8 -0
  97. package/lib/types/client/plugins-shared.d.ts +27 -0
  98. package/lib/types/client/plugins-tabs.d.ts +3 -0
  99. package/lib/types/client/plugins-viewers.d.ts +3 -0
  100. package/lib/types/client/prefs.d.ts +41 -0
  101. package/lib/types/client/produced-files.d.ts +29 -0
  102. package/lib/types/client/selection-payload.d.ts +27 -0
  103. package/lib/types/client/service.d.ts +439 -0
  104. package/lib/types/client/settings-nav-icon.d.ts +19 -0
  105. package/lib/types/client/shell-presets.d.ts +48 -0
  106. package/lib/types/client/sidechat-transcript.d.ts +103 -0
  107. package/lib/types/client/split-pane.d.ts +36 -0
  108. package/lib/types/client/state.d.ts +432 -0
  109. package/lib/types/client/subagent-detect.d.ts +54 -0
  110. package/lib/types/client/subagent-jobs.d.ts +63 -0
  111. package/lib/types/client/tab-content-memo.d.ts +40 -0
  112. package/lib/types/client/terminal-font.d.ts +78 -0
  113. package/lib/types/client/terminal-links.d.ts +119 -0
  114. package/lib/types/client/theme.d.ts +45 -0
  115. package/lib/types/client/titlebar-strip.d.ts +23 -0
  116. package/lib/types/client/upload.d.ts +69 -0
  117. package/lib/types/client/wco.d.ts +47 -0
  118. package/lib/types/config.d.ts +64 -0
  119. package/lib/types/context-types.d.ts +605 -0
  120. package/lib/types/fs-operations.d.ts +28 -0
  121. package/lib/types/fs-search.d.ts +24 -0
  122. package/lib/types/fs-tree.d.ts +51 -0
  123. package/lib/types/git.d.ts +124 -0
  124. package/lib/types/html-route.d.ts +59 -0
  125. package/lib/types/index.d.ts +47 -0
  126. package/lib/types/invariant.d.ts +15 -0
  127. package/lib/types/jobs-routes.d.ts +45 -0
  128. package/lib/types/open-external.d.ts +24 -0
  129. package/lib/types/path-security.d.ts +20 -0
  130. package/lib/types/prefs-shared.d.ts +236 -0
  131. package/lib/types/pty-deps.d.ts +78 -0
  132. package/lib/types/pty-manager.d.ts +168 -0
  133. package/lib/types/sidechat-core.d.ts +172 -0
  134. package/lib/types/sidechat-routes.d.ts +30 -0
  135. package/lib/types/subagent-activity.d.ts +44 -0
  136. package/lib/types/subagent-live-route.d.ts +44 -0
  137. package/lib/types/tools.d.ts +34 -0
  138. package/lib/types/trust-fence.d.ts +24 -0
  139. package/lib/types/wire.d.ts +38 -0
  140. package/package.json +172 -0
  141. package/scripts/install.ps1 +306 -0
  142. package/scripts/install.sh +287 -0
  143. package/src/agent-opens.ts +265 -0
  144. package/src/agent-pty.ts +527 -0
  145. package/src/browser-probe.ts +26 -0
  146. package/src/bundle-route.ts +129 -0
  147. package/src/client/BrowserView.tsx +289 -0
  148. package/src/client/DiffTab.tsx +114 -0
  149. package/src/client/DiffView.tsx +305 -0
  150. package/src/client/EditorHost.tsx +558 -0
  151. package/src/client/FileTree.tsx +669 -0
  152. package/src/client/FreeWindow.tsx +337 -0
  153. package/src/client/GitView.tsx +717 -0
  154. package/src/client/MarkdownHtml.tsx +296 -0
  155. package/src/client/OrphanedTab.tsx +27 -0
  156. package/src/client/PdfView.tsx +110 -0
  157. package/src/client/RenderBoundary.tsx +49 -0
  158. package/src/client/SandboxStatusBar.tsx +60 -0
  159. package/src/client/SideCardSection.module.css +960 -0
  160. package/src/client/SideCardSection.tsx +1163 -0
  161. package/src/client/SideChatView.module.css +437 -0
  162. package/src/client/SideChatView.tsx +645 -0
  163. package/src/client/Sidebar.tsx +1370 -0
  164. package/src/client/SubagentView.module.css +547 -0
  165. package/src/client/SubagentView.tsx +883 -0
  166. package/src/client/TabBar.tsx +365 -0
  167. package/src/client/TerminalView.tsx +424 -0
  168. package/src/client/TextEditor.tsx +468 -0
  169. package/src/client/TreePanel.tsx +275 -0
  170. package/src/client/UploadOverlay.tsx +62 -0
  171. package/src/client/add-plugin-modal.tsx +199 -0
  172. package/src/client/api.ts +357 -0
  173. package/src/client/binary-download.tsx +23 -0
  174. package/src/client/breakpoints.ts +61 -0
  175. package/src/client/browser.ts +167 -0
  176. package/src/client/builtins/index.ts +37 -0
  177. package/src/client/builtins/tabs.tsx +340 -0
  178. package/src/client/builtins/viewers.tsx +125 -0
  179. package/src/client/chunk-loader.ts +358 -0
  180. package/src/client/chunks/editor.tsx +9 -0
  181. package/src/client/chunks/mermaid.tsx +10 -0
  182. package/src/client/chunks/terminal.tsx +9 -0
  183. package/src/client/cm-themes.ts +129 -0
  184. package/src/client/conversation-draft.ts +29 -0
  185. package/src/client/css-modules.d.ts +5 -0
  186. package/src/client/desktop-env.ts +72 -0
  187. package/src/client/editor-load.ts +92 -0
  188. package/src/client/frame-batcher.ts +56 -0
  189. package/src/client/icons.tsx +152 -0
  190. package/src/client/image-types.ts +8 -0
  191. package/src/client/ime-guard.ts +47 -0
  192. package/src/client/index.tsx +427 -0
  193. package/src/client/intercept.tsx +188 -0
  194. package/src/client/lang.ts +225 -0
  195. package/src/client/layout-push.ts +24 -0
  196. package/src/client/layout.css +90 -0
  197. package/src/client/lazy-chunk.tsx +89 -0
  198. package/src/client/link-intercept.ts +73 -0
  199. package/src/client/locales-ar.ts +368 -0
  200. package/src/client/locales-de.ts +353 -0
  201. package/src/client/locales-fr.ts +360 -0
  202. package/src/client/locales-hi.ts +367 -0
  203. package/src/client/locales-id.ts +365 -0
  204. package/src/client/locales-it.ts +358 -0
  205. package/src/client/locales-ja.ts +367 -0
  206. package/src/client/locales-ko.ts +359 -0
  207. package/src/client/locales-nl.ts +365 -0
  208. package/src/client/locales-pl.ts +369 -0
  209. package/src/client/locales-pt.ts +350 -0
  210. package/src/client/locales-ru.ts +365 -0
  211. package/src/client/locales-sv.ts +350 -0
  212. package/src/client/locales-th.ts +367 -0
  213. package/src/client/locales-tr.ts +367 -0
  214. package/src/client/locales-vi.ts +367 -0
  215. package/src/client/locales-zh-HK.ts +382 -0
  216. package/src/client/locales-zh-MO.ts +382 -0
  217. package/src/client/locales-zh-TW.ts +382 -0
  218. package/src/client/locales.ts +894 -0
  219. package/src/client/markdown-html.ts +331 -0
  220. package/src/client/markdown-images.ts +137 -0
  221. package/src/client/markdown-labels.tsx +52 -0
  222. package/src/client/md-toc.tsx +127 -0
  223. package/src/client/mermaid-blocks.ts +110 -0
  224. package/src/client/mermaid-sanitize.ts +93 -0
  225. package/src/client/mermaid.tsx +406 -0
  226. package/src/client/open-when-sized.ts +43 -0
  227. package/src/client/open-with-settings.tsx +135 -0
  228. package/src/client/open-with.ts +221 -0
  229. package/src/client/openpath-intercept.ts +143 -0
  230. package/src/client/paths.ts +63 -0
  231. package/src/client/pdf-types.ts +4 -0
  232. package/src/client/pinned.ts +183 -0
  233. package/src/client/plugin-settings.ts +43 -0
  234. package/src/client/plugins-shared.ts +29 -0
  235. package/src/client/plugins-tabs.ts +96 -0
  236. package/src/client/plugins-viewers.ts +30 -0
  237. package/src/client/prefs.ts +210 -0
  238. package/src/client/produced-files.ts +120 -0
  239. package/src/client/selection-payload.ts +86 -0
  240. package/src/client/service.ts +859 -0
  241. package/src/client/settings-nav-icon.ts +45 -0
  242. package/src/client/shell-presets.ts +83 -0
  243. package/src/client/sidebar.module.css +2788 -0
  244. package/src/client/sidechat-transcript.ts +321 -0
  245. package/src/client/split-pane.tsx +331 -0
  246. package/src/client/state.ts +1497 -0
  247. package/src/client/subagent-detect.ts +137 -0
  248. package/src/client/subagent-jobs.ts +161 -0
  249. package/src/client/tab-content-memo.ts +55 -0
  250. package/src/client/terminal-font.ts +224 -0
  251. package/src/client/terminal-links.ts +194 -0
  252. package/src/client/theme.ts +110 -0
  253. package/src/client/titlebar-strip.ts +37 -0
  254. package/src/client/upload.ts +187 -0
  255. package/src/client/wco.ts +120 -0
  256. package/src/config.ts +154 -0
  257. package/src/context-types.ts +611 -0
  258. package/src/fs-operations.ts +95 -0
  259. package/src/fs-search.ts +113 -0
  260. package/src/fs-tree.ts +158 -0
  261. package/src/git.ts +446 -0
  262. package/src/html-route.ts +106 -0
  263. package/src/index.ts +1291 -0
  264. package/src/invariant.ts +32 -0
  265. package/src/jobs-routes.ts +257 -0
  266. package/src/open-external.ts +90 -0
  267. package/src/path-security.ts +75 -0
  268. package/src/prefs-shared.ts +280 -0
  269. package/src/pty-deps.ts +240 -0
  270. package/src/pty-manager.ts +376 -0
  271. package/src/sidechat-core.ts +468 -0
  272. package/src/sidechat-routes.ts +344 -0
  273. package/src/subagent-activity.ts +91 -0
  274. package/src/subagent-live-route.ts +93 -0
  275. package/src/tools.ts +482 -0
  276. package/src/trust-fence.ts +84 -0
  277. package/src/wire.ts +100 -0
@@ -0,0 +1,51 @@
1
+ /** One explorer row. */
2
+ export interface SidebarFsEntry {
3
+ name: string;
4
+ path: string;
5
+ isDir: boolean;
6
+ hidden: boolean;
7
+ /** Whether the row is a symlink; `isDir` then describes the link's target. */
8
+ isSymlink: boolean;
9
+ /** For symlinks: the target is missing or unreadable (stat failed). */
10
+ broken: boolean;
11
+ }
12
+ /** One listed level. */
13
+ export interface SidebarFsListing {
14
+ path: string;
15
+ entries: SidebarFsEntry[];
16
+ truncated: boolean;
17
+ }
18
+ /** Directory-first, case-insensitive name ordering (VSCode explorer order). */
19
+ export declare function compareEntries(a: SidebarFsEntry, b: SidebarFsEntry): number;
20
+ /**
21
+ * List one directory level.
22
+ * @param path - absolute directory path.
23
+ * @param maxEntries - row bound of one level (extra rows flag `truncated`).
24
+ * @returns the sorted listing.
25
+ * @throws {SidebarError} fs-error when the level is unreadable or not a directory.
26
+ */
27
+ export declare function listDirectory(path: string, maxEntries?: number): Promise<SidebarFsListing>;
28
+ /** The root row label of a listing: the last path segment (or the full path at the filesystem root). */
29
+ export declare function rootLabel(path: string): string;
30
+ /** Parent of a path, or undefined at the filesystem root (the explorer's "up" target). */
31
+ export declare function parentOf(path: string): string | undefined;
32
+ /**
33
+ * Normalize a caller-supplied path to an absolute, resolved path or throw
34
+ * fs-error. `path.isAbsolute()` is the OS's own notion of absolute: POSIX
35
+ * roots (`/...`), Windows drive letters (`C:\...`) and — on win32 — UNC
36
+ * network shares (`\\server\share\...`); drive-relative forms (`C:foo`)
37
+ * stay rejected.
38
+ */
39
+ export declare function requireAbsolute(path: string): string;
40
+ /**
41
+ * Whether `target` lies under `base` (or equals it), tolerant of separator
42
+ * style and — on Windows, where the filesystem is case-insensitive — of
43
+ * letter case. The media route uses this instead of a raw `startsWith` so a
44
+ * case-mismatched or mixed-separator path can never be misclassified
45
+ * (e.g. `C:\Users\Me` vs `c:/users/me/file.png`).
46
+ * @param platform - filesystem semantics; injectable so both branches are
47
+ * unit-testable on any host.
48
+ */
49
+ export declare function isWithin(base: string, target: string, platform?: NodeJS.Platform): boolean;
50
+ /** Message text of an unknown thrown value. */
51
+ export declare function messageOf(error: unknown): string;
@@ -0,0 +1,124 @@
1
+ /** A parsed `git status --porcelain=v1 -z` entry. */
2
+ export interface GitStatusEntry {
3
+ path: string;
4
+ /** Two-letter index/worktree status (X Y), e.g. 'M ', ' M', 'A ', '??'. */
5
+ xy: string;
6
+ }
7
+ /** The source-control panel snapshot. */
8
+ export interface GitStatusResult {
9
+ isRepo: boolean;
10
+ branch?: string;
11
+ entries: GitStatusEntry[];
12
+ /** True when the working tree had more rows than `GIT_STATUS_LIMIT`; the
13
+ * panel shows a truncation notice instead of freezing on a huge untracked
14
+ * set (issue #369). */
15
+ truncated?: boolean;
16
+ /** Selected repository root, or the discovered roots when the cwd is a container. */
17
+ root?: string;
18
+ repositories?: string[];
19
+ }
20
+ /** One linked checkout returned by `git worktree list --porcelain`. */
21
+ export interface GitWorktree {
22
+ /** Absolute checkout root. */
23
+ path: string;
24
+ /** Branch name without `refs/heads/`, or `HEAD` when detached. */
25
+ branch: string;
26
+ /** Whether this checkout contains the session cwd. */
27
+ current: boolean;
28
+ /** Number of staged + unstaged status rows (a file changed on both sides counts once). */
29
+ changes: number;
30
+ }
31
+ /** One `git log` row. */
32
+ export interface GitLogEntry {
33
+ /** Short hash (7+ chars, display). */
34
+ hash: string;
35
+ /** Full 40-char hash (advanced operations: revert / cherry-pick). */
36
+ hashFull: string;
37
+ subject: string;
38
+ author: string;
39
+ /** ISO 8601 author date (`%ai`), e.g. `2024-01-01 10:00:00 +0800`. */
40
+ date: string;
41
+ /** Ref decorations (`%D` with --decorate=short), e.g. `HEAD -> main, origin/main`; '' when none. */
42
+ refs: string;
43
+ }
44
+ /** One git failure (stderr text as the message). */
45
+ export declare class GitCommandError extends Error {
46
+ readonly code: string;
47
+ readonly command: string;
48
+ constructor(message: string, code: string | undefined, command: string);
49
+ }
50
+ /** Parse porcelain v1 -z output into entries (rename/copy pairs collapse to one row). */
51
+ export declare function parsePorcelainZ(output: string): GitStatusEntry[];
52
+ /** One raw porcelain worktree record. Prunable checkouts are retained by
53
+ * Git's administrative metadata after their directory disappears and must not
54
+ * become selectable command targets. Locked checkouts remain usable. */
55
+ export interface GitWorktreeRecord {
56
+ path: string;
57
+ branch: string;
58
+ locked: boolean;
59
+ prunable: boolean;
60
+ }
61
+ /** Parse `git worktree list --porcelain` records. Production requests use
62
+ * `-z` so even newlines and non-ASCII bytes in checkout paths stay lossless;
63
+ * newline framing remains accepted for small fixtures and older Git output. */
64
+ export declare function parseWorktreeList(output: string): GitWorktreeRecord[];
65
+ /** Parse `git log --pretty=format:%h%x1f%s%x1f%an%x1f%ai%x1f%H%x1f%D` rows. */
66
+ export declare function parseLogLines(output: string): GitLogEntry[];
67
+ /** Whether the directory is inside a git work tree (exit-0 `git rev-parse`).
68
+ * Probe timeout is short: a cwd on a stalled mount must not hold the panel
69
+ * hostage for the full command budget (issue #369). */
70
+ export declare function isGitRepo(cwd: string): Promise<boolean>;
71
+ /** Discover the current repository or direct child repositories. Results are
72
+ * cached per cwd and concurrent callers share one in-flight scan, so opening
73
+ * the panel (three parallel git.* requests) costs a single discovery pass. */
74
+ export declare function repoRoots(cwd: string): Promise<string[]>;
75
+ /** Resolve the selected repository, defaulting to the first discovered root. */
76
+ export declare function repoRoot(cwd: string, selected?: string): Promise<string>;
77
+ /** The current branch name (`git rev-parse --abbrev-ref HEAD`; 'HEAD' when detached). */
78
+ export declare function currentBranch(cwd: string): Promise<string>;
79
+ /**
80
+ * Working-tree status (untracked included). `--untracked-files=all` lists
81
+ * the contents of new directories as individual entries, while preserving
82
+ * repository discovery and explicit repository selection for workspace roots.
83
+ */
84
+ export declare function status(cwd: string, selected?: string): Promise<GitStatusResult>;
85
+ /** All linked checkouts of the repository containing `cwd`, enriched with a
86
+ * live change count. The current checkout is first so a single-worktree repo
87
+ * preserves the old UI ordering. */
88
+ export declare function worktrees(cwd: string): Promise<GitWorktree[]>;
89
+ /** Resolve an optional client-selected linked checkout. A caller may never use
90
+ * this seam to point Git operations at an unrelated repository: the target
91
+ * must occur in the authoritative session repository's worktree list. */
92
+ export declare function resolveWorktree(cwd: string, requested?: string): Promise<string>;
93
+ /** Diff text of the worktree (unstaged) or the index (staged). */
94
+ export declare function diff(cwd: string, path: string | undefined, staged: boolean, selected?: string): Promise<string>;
95
+ /** Stage paths (all when path is undefined). */
96
+ export declare function stage(cwd: string, path: string | undefined, selected?: string): Promise<void>;
97
+ /** Unstage paths (all when path is undefined). */
98
+ export declare function unstage(cwd: string, path: string | undefined, selected?: string): Promise<void>;
99
+ /** Commit the staged changes with a message (global identity untouched). */
100
+ export declare function commit(cwd: string, message: string, selected?: string): Promise<void>;
101
+ /** Branch names (current first). */
102
+ export declare function branches(cwd: string, selected?: string): Promise<{
103
+ current: string;
104
+ names: string[];
105
+ }>;
106
+ /** Switch to an existing branch. */
107
+ export declare function checkout(cwd: string, branch: string, selected?: string): Promise<void>;
108
+ /** Recent commit history (newest first), lazily pageable via skip/count. */
109
+ export declare function log(cwd: string, count?: number, skip?: number, selected?: string): Promise<GitLogEntry[]>;
110
+ /**
111
+ * Content of a file at a revision (`git show <rev>:<path>`), or null when the
112
+ * revision has no such path (a new/untracked file has no HEAD side).
113
+ */
114
+ export declare function show(cwd: string, rev: string, path: string, selected?: string): Promise<string | null>;
115
+ /** Full patch text of one commit (`git show` with the commit header suppressed).
116
+ * Merge commits show their diff against the first parent (`-m --first-parent`
117
+ * is a no-op for regular commits), so a history click always has content. */
118
+ export declare function commitDiff(cwd: string, hash: string, selected?: string): Promise<string>;
119
+ /** Discard the worktree changes of one path (`git checkout -- <path>`; the index is untouched). */
120
+ export declare function discard(cwd: string, path: string, selected?: string): Promise<void>;
121
+ /** Revert one commit onto the current branch with an auto-generated message. */
122
+ export declare function revert(cwd: string, hash: string, selected?: string): Promise<void>;
123
+ /** Cherry-pick one commit onto the current branch. */
124
+ export declare function cherryPick(cwd: string, hash: string, selected?: string): Promise<void>;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Pure URL vocabulary of the /sidebar/html route (HTML previewer).
3
+ *
4
+ * Why path-encoded parameters instead of a query string: the previewed
5
+ * page resolves its relative assets (./style.css, img/x.png) against the
6
+ * document URL, and the WHATWG URL algorithm DROPS the query of a
7
+ * path-relative reference — `/sidebar/html?a=1&path=/a/b/` + `./style.css`
8
+ * would lose the session scope and the route would reject the asset.
9
+ * Encoding everything into the URL path keeps relative resolution inside
10
+ * the same route with every request self-contained:
11
+ *
12
+ * /sidebar/html/<sessionId>/<absolute-path segments, encodeURIComponent'd>
13
+ * /sidebar/html/S/Users/me/proj/index.html
14
+ * + ./style.css → /sidebar/html/S/Users/me/proj/style.css
15
+ * Windows: C:\Users\me\a.html → /sidebar/html/S/C%3A/Users/me/a.html
16
+ * UNC (\\server\share\... or //server/share/...):
17
+ * → /sidebar/html/S//server/share/proj/a.html ('//' right after the
18
+ * sessionId marks the UNC prefix; the WHATWG URL keeps '//' intact so
19
+ * relative assets still resolve inside the same route)
20
+ *
21
+ * The decoder rebuilds the marker as a forward-slash `//server/share/...`
22
+ * path. That form is intentionally platform-neutral: `node:path` resolves it
23
+ * to `\\server\share\...` on win32 and `/server/share/...` on POSIX, so the
24
+ * host's existing requireAbsolute + isWithin fence needs no platform signal
25
+ * (a leading `//` is a legal POSIX absolute path, so no data is lost on
26
+ * either platform).
27
+ *
28
+ * This module is intentionally dependency-free (no node imports, no wire
29
+ * helpers) so the client bundle can import `encodeHtmlUrl` without tripping
30
+ * the build-time purity gate; the host converts decode failures into
31
+ * SidebarError responses at the route boundary.
32
+ */
33
+ /** One decoded route reference. */
34
+ export interface HtmlRouteRef {
35
+ sessionId: string;
36
+ /** Absolute file path (leading slash; Windows drives keep their colon). */
37
+ path: string;
38
+ }
39
+ /** Decode outcome: the reference, or a client-error description. */
40
+ export type HtmlDecodeResult = {
41
+ ok: true;
42
+ ref: HtmlRouteRef;
43
+ } | {
44
+ ok: false;
45
+ status: 400 | 404;
46
+ message: string;
47
+ };
48
+ /** The route prefix both encoders/decoders agree on. */
49
+ export declare const HTML_ROUTE_PREFIX = "/sidebar/html/";
50
+ /** Build the route URL for one absolute file path (client + tests). */
51
+ export declare function encodeHtmlUrl(sessionId: string, path: string): string;
52
+ /**
53
+ * Decode a route pathname into the session + absolute file path. Rejects
54
+ * a wrong prefix (404), an empty path, malformed percent encoding, and a
55
+ * missing sessionId or file path (400). The caller still must bound the
56
+ * decoded path with the workspace real-path guard — a decoded `..`
57
+ * segment resolves outside the cwd and is refused there.
58
+ */
59
+ export declare function decodeHtmlUrl(pathname: string): HtmlDecodeResult;
@@ -0,0 +1,47 @@
1
+ import type { Context } from './context-types.ts';
2
+ import { Config, type ResolvedSidebarConfig, type SidebarConfig } from './config.ts';
3
+ export { Config };
4
+ export type { SidebarConfig, ResolvedSidebarConfig };
5
+ export type { Context } from './context-types.ts';
6
+ export type { BetterSidebarService, TabDescriptor, TabComponentProps, FileViewerDescriptor, FileViewerProps, FileFetchStrategy, } from './client/service.ts';
7
+ /** Plugin identity for cordis.yml rows. */
8
+ export declare const name = "dsh-coding-sidebar";
9
+ /** Services required before mounting: the webserver routes, the session store, the web runtime's trusted hosts, and the tool registry. */
10
+ export declare const inject: string[];
11
+ /** Content type served by /sidebar/file (binary-safe fallback for unknowns). */
12
+ export declare function mediaTypeForPath(path: string): string;
13
+ /**
14
+ * The live face of the side card settings namespace, bound to the settings
15
+ * service when it is mounted. The DSH settings RPC domain only serves
16
+ * allowlisted namespaces (api-proxy exposedNamespaces), so the client reads
17
+ * and writes THIS namespace through the plugin's own fenced /sidebar routes,
18
+ * which call the seam in-process — no configuration-client gate involved.
19
+ */
20
+ export interface SidebarSettingsFace {
21
+ /** The current resolved value + revision (undefined while the settings service is absent). */
22
+ get(): {
23
+ value?: unknown;
24
+ revision?: number;
25
+ };
26
+ /**
27
+ * Whether the dsh-web-ui family's aionui-panel has been selected as the
28
+ * right-panel provider (the `aionui-panel` settings namespace resolves
29
+ * `rightPanel: 'aionui-panel'`). While true the sidebar must not mount —
30
+ * the two right panels are mutually exclusive. False when the namespace is
31
+ * absent (no aionui installed) or the provider is anything else.
32
+ */
33
+ externalDisable(): boolean;
34
+ /** Merge a patch (revision-guarded) and return the fresh resolved view. */
35
+ update(patch: Record<string, unknown>, expectedRevision?: number): Promise<{
36
+ value?: unknown;
37
+ revision?: number;
38
+ }>;
39
+ }
40
+ /**
41
+ * Plugin body: mount the fenced routes and the pty lifecycle.
42
+ * @param ctx - host plugin context (webServer, sessions, webRuntime).
43
+ * @param config - deployment-provided limits; the Loader validates against
44
+ * {@link Config} and fills defaults, direct callers get them from
45
+ * {@link resolveSidebarConfig}.
46
+ */
47
+ export declare function apply(ctx: Context, config?: SidebarConfig): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Package-owned invariant companion for `dsh-coding-sidebar`.
3
+ * @module dsh-coding-sidebar/invariant
4
+ */
5
+ import type { Context } from './context-types.ts';
6
+ /** Cordis companion plugin name. */
7
+ export declare const name = "dsh-coding-sidebar-invariant";
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Register this package's invariant companion.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns the installed registration's disposer after setup succeeds.
14
+ */
15
+ export declare const apply: (ctx: Context) => Promise<() => void>;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Background-job routes of the /sidebar JSON API ('jobs.output' /
3
+ * 'jobs.kill'). The job LIST needs no route: it arrives through the
4
+ * harness's `session/jobs` push mirror (`jobsBySession` in the sessions
5
+ * list feed). The routes:
6
+ *
7
+ * - 'jobs.output' — REPLAYS the output the MODEL has read so far for one
8
+ * job. The source is the owner session's own event log: `tool/call` rows
9
+ * of `job_output` name the job via `arguments.job_id`, and the paired
10
+ * `tool/result` rows carry the finalized content the model received.
11
+ * Because the session store's in-memory log can lag the live append feed
12
+ * after a host restart (the store session stays frozen at its
13
+ * rehydration boundary), the plugin ALSO mirrors job_output events from
14
+ * the live `session/event` feed and merges both sources (deduped by seq).
15
+ * This touches NO DSH source: the model's `job_output` cursor is never
16
+ * consumed, and the pane stays empty until the agent reads the job.
17
+ * - 'jobs.kill' — the registry's stock `kill` (a pristine DSH API),
18
+ * fenced by the owning session via the live agent caller. Absent registry
19
+ * → 503, mirroring the settings routes' optional-service downgrade.
20
+ */
21
+ import type { Context } from './context-types.ts';
22
+ /** The two background-job routes of the sidebar API. */
23
+ export interface SidebarJobsRoutes {
24
+ /** The output the model has read so far for one job (event replay, capped). */
25
+ output(payload: unknown): {
26
+ text: string;
27
+ truncated: boolean;
28
+ read: boolean;
29
+ };
30
+ /** Request cancellation of one job (live jobs flip to stopping). */
31
+ kill(payload: unknown): {
32
+ ok: true;
33
+ outcome: 'requested' | 'already-finished';
34
+ };
35
+ }
36
+ /**
37
+ * Build the jobs routes bound to the plugin context. `output` merges the
38
+ * owner session's own event log with the live job_output mirror; `kill`
39
+ * reads the jobs/agents services lazily and degrades to a 503 when the
40
+ * deployment lacks the registry.
41
+ * @param ctx - host plugin context.
42
+ * @param outputLimit - response cap for one output replay in bytes; longer
43
+ * texts are sliced and flagged `truncated` (mirrors the fs.read cap).
44
+ */
45
+ export declare function buildJobsApi(ctx: Context, outputLimit: number): SidebarJobsRoutes;
@@ -0,0 +1,24 @@
1
+ /** The two external open actions the route accepts. */
2
+ export type OpenExternalAction = 'reveal' | 'url';
3
+ /** One platform opener invocation (argv array — never a shell string). */
4
+ export interface ExternalCommand {
5
+ command: string;
6
+ args: string[];
7
+ }
8
+ /** Reveal/select a path in the OS file manager. On Linux there is no common
9
+ * select protocol — the containing directory is opened instead (KISS). */
10
+ export declare function revealCommand(path: string, platform?: NodeJS.Platform): ExternalCommand;
11
+ /** Hand a custom-scheme URL to the OS protocol handler. */
12
+ export declare function urlCommand(url: string, platform?: NodeJS.Platform): ExternalCommand;
13
+ /** Validate a URL-scheme open target: a parseable custom-scheme URL (never
14
+ * http/https — those would only dump the URL into a browser tab). */
15
+ export declare function validateExternalUrl(raw: string): string;
16
+ /**
17
+ * Launch one external open action and return immediately (detached, no
18
+ * stdio). Spawn failures are reported through the child's 'error' event —
19
+ * by then the route already returned, so the event is swallowed (the OS
20
+ * dialog about a missing handler is the user-visible outcome either way).
21
+ */
22
+ export declare function launchExternal(action: OpenExternalAction, value: string): {
23
+ started: true;
24
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Resolve an existing workspace path through symlinks and enforce containment.
3
+ *
4
+ * @param cwd - Session workspace directory.
5
+ * @param target - Client-supplied absolute path.
6
+ * @returns The canonical absolute path used for the filesystem operation.
7
+ */
8
+ export declare function ensureWorkspacePath(cwd: string, target: string): Promise<string>;
9
+ /**
10
+ * Validate a write destination, including destinations that do not exist yet.
11
+ * Existing targets are resolved to catch symlinks; missing targets are checked
12
+ * against the nearest existing ancestor before the caller creates or renames.
13
+ * The returned path is rebuilt from that canonical ancestor, so an existing
14
+ * symlink is never left in the path passed to the write operation.
15
+ *
16
+ * @param cwd - Session workspace directory.
17
+ * @param target - Client-supplied absolute destination path.
18
+ * @returns A canonical path for an existing target or its nearest existing ancestor.
19
+ */
20
+ export declare function ensureWorkspaceWritePath(cwd: string, target: string): Promise<string>;
@@ -0,0 +1,236 @@
1
+ /**
2
+ * Shared "Side card" preference vocabulary (types + constants), consumed by
3
+ * BOTH halves: the host registers the schemastery schema over these values
4
+ * (config.ts) and the client reads/writes them through the settings RPC
5
+ * (client/prefs.ts, client/SideCardSection.tsx). Kept free of schemastery so
6
+ * the browser bundle never pulls the schema runtime in.
7
+ */
8
+ /** The user-settings namespace holding the side card preferences. */
9
+ export declare const SIDEBAR_PREFS_NS = "dsh-coding-sidebar";
10
+ /** User-facing side card preferences (new-conversation defaults). */
11
+ export interface SidebarPrefs {
12
+ /** Whether a brand-new conversation opens the side card by default. */
13
+ openByDefault: boolean;
14
+ /** Default panel width as a percent of the window width (20–60). */
15
+ defaultWidthPercent: number;
16
+ /**
17
+ * Whether the sidebar auto-activates (opens the panel) and expands the
18
+ * Subagent page when the current conversation spawns a new subagent.
19
+ */
20
+ autoOpenSubagent: boolean;
21
+ /**
22
+ * Whether the sidebar auto-activates (opens the panel) and expands the
23
+ * Jobs page when a NEW background job appears for the current
24
+ * conversation (any new job id, not just the first one).
25
+ */
26
+ autoOpenJobs: boolean;
27
+ /**
28
+ * Whether the model-facing agent terminal tools (terminal_create / list /
29
+ * send / read / wait_for / resize / signal / close) are injected into the
30
+ * model's toolset. Off by default: the feature stays dormant until the
31
+ * user explicitly enables it in the side card settings.
32
+ */
33
+ agentTerminalTools: boolean;
34
+ /**
35
+ * Whether the model-facing `sidebar_open` tool is injected into the
36
+ * model's toolset — one tool that lets the model actively open a local
37
+ * file, a local folder (as a tree rooted there), or an HTTP(S) page in
38
+ * the calling session's sidebar. Off by default: the feature stays
39
+ * dormant until the user explicitly enables it in the side card settings.
40
+ */
41
+ agentOpenTools: boolean;
42
+ /**
43
+ * Custom terminal font-family stack (a CSS font-family value, e.g.
44
+ * `'JetBrains Mono', monospace`). Empty string follows the app's theme
45
+ * monospace font (`--ds-font-family-code`). Applied live to every
46
+ * terminal tab; configured under the terminal card's secondary settings.
47
+ */
48
+ terminalFontFamily: string;
49
+ /**
50
+ * Custom terminal font size in px (9–32). Applied live to every terminal
51
+ * tab; configured under the terminal card's secondary settings.
52
+ */
53
+ terminalFontSize: number;
54
+ /**
55
+ * Whether chat-side file opens (tool-row path links, the produced-files
56
+ * row, prose file mentions — every path that funnels through the client
57
+ * runtime's `ctx.workspaces.openPath`) open in the sidebar editor instead
58
+ * of the Host OS's default application. On by default; the editor tab's
59
+ * own enable switch gates it too (both must be on for the takeover).
60
+ */
61
+ interceptOpenPath: boolean;
62
+ /**
63
+ * Whether the editor tab runs in merged mode: a path input replaces the
64
+ * plain header and a toggleable file-tree panel (with a global name
65
+ * search) docks at the tab's right edge. On by default; also makes brand
66
+ * new sessions seed an empty editor tab (tree panel open) instead of the
67
+ * explorer tab. The switch lives under the editor card's gear in the
68
+ * Side card settings; off restores the pre-merge editor exactly.
69
+ */
70
+ editorExplorer: boolean;
71
+ /**
72
+ * The shell the UI and agent terminals spawn (absolute path or bare
73
+ * executable name). Empty (default) keeps the legacy resolution order:
74
+ * `cordis.patch.yml` `config.shell`, then `$SHELL` / login shell /
75
+ * `powershell.exe` on Windows. Set it from the terminal card's gear in
76
+ * the Side card settings (or the yaml) to pin a specific shell — takes
77
+ * effect for terminals opened afterwards.
78
+ */
79
+ terminalShell: string;
80
+ /**
81
+ * Explicit arguments for `terminalShell`, space-separated (empty keeps
82
+ * the platform defaults; when set, they fully replace them — same
83
+ * contract as the yaml `shellArgs`).
84
+ */
85
+ terminalShellArgs: string;
86
+ /**
87
+ * Title-bar / shell compatibility scheme (the "位置兼容模式" setting):
88
+ * - `auto` (default): CONSERVATIVE — only the standard Window Controls
89
+ * Overlay API (present in frameless Chromium shells that draw the
90
+ * native caption buttons over web content) contributes real geometry;
91
+ * without it nothing is modified, so plain-browser (web) behavior is
92
+ * untouched.
93
+ * - `web`: EXPLICIT "DSH official web" — never adapt, not even WCO
94
+ * geometry (the user declares they run the plain web UI).
95
+ * - `preset`: apply the built-in shell preset named by
96
+ * `titleBarPresetId` (data-driven, opt-in — see shell-presets.ts).
97
+ * - `custom`: apply the free-form `customCss` (and the legacy
98
+ * `titleBarStripPx` strip).
99
+ */
100
+ titleBarScheme: TitleBarScheme;
101
+ /**
102
+ * The built-in shell preset id applied while `titleBarScheme` is
103
+ * `preset` ('' = no preset — nothing extra is applied).
104
+ */
105
+ titleBarPresetId: string;
106
+ /**
107
+ * Free-form CSS injected into the page (last in the cascade, so it can
108
+ * override the plugin's styles; use `!important` to override JS-written
109
+ * inline CSS variables). Applied while `titleBarScheme` is `custom`.
110
+ */
111
+ customCss: string;
112
+ /**
113
+ * LEGACY (kept for read-migration and downgrade mirroring only): position
114
+ * compatibility mode flag. The UI writes `titleBarScheme` instead; a
115
+ * stored `true` without a scheme migrates to the `custom` scheme (with
116
+ * `titleBarStripPx` preserved).
117
+ */
118
+ titleBarCompat: boolean;
119
+ /**
120
+ * LEGACY (kept for read-migration and downgrade mirroring only): the
121
+ * reserved top strip height in px used by the `custom` scheme (0–120,
122
+ * default 40). Drives the `--dsh-title-bar-strip` CSS variable: the
123
+ * toggle cluster drops `strip + 3px` and the right panel's content
124
+ * starts `strip` px below its top edge.
125
+ */
126
+ titleBarStripPx: number;
127
+ /**
128
+ * Whether the HTML previewer drops its sandboxed iframe. Sandbox ON (the
129
+ * default) renders previewed HTML in an opaque-origin iframe that cannot
130
+ * touch the GUI; turning it OFF runs the previewed page with the GUI's
131
+ * own origin — full read/write access to session files and internal
132
+ * APIs. Only for trusted local content; the setting copy warns.
133
+ */
134
+ htmlViewerNoSandbox: boolean;
135
+ /**
136
+ * Whether a newly opened HTML preview starts UNSANDBOXED (the per-surface
137
+ * temporary unlock pre-applied). Off by default: previews open sandboxed
138
+ * and the status row offers the one-tap unlock; when on, previews open
139
+ * in the red unsandboxed state and the status row offers a one-tap
140
+ * restore for the current file.
141
+ */
142
+ htmlViewerDefaultUnsafe: boolean;
143
+ /**
144
+ * Whether the browser tab drops its sandboxed iframe. Sandbox ON (the
145
+ * default) keeps browsed sites in an opaque origin with no GUI access;
146
+ * turning it OFF runs any visited site with the GUI's own origin — it
147
+ * can read session data and act as the logged-in GUI. Only for trusted
148
+ * sites; the setting copy warns.
149
+ */
150
+ browserNoSandbox: boolean;
151
+ /**
152
+ * MASTER switch: whether clicking an EXTERNAL link in the GUI (chat
153
+ * messages, tool rows, prose mentions) is taken over into the sidebar at
154
+ * all. On by default; the per-protocol granularity lives in
155
+ * `browserInterceptHttp` / `browserInterceptHttps` (the protocol flag
156
+ * must also be on), and the target tab's own enable switch gates it too.
157
+ * Ctrl/Cmd+click always bypasses the takeover. Kept as the master so old
158
+ * documents keep their meaning with no migration (an explicit `false`
159
+ * stays "never take over").
160
+ */
161
+ browserInterceptLinks: boolean;
162
+ /**
163
+ * Whether clicking an http EXTERNAL link in the GUI opens the sidebar
164
+ * (the built-in browser tab, or a plugin tab that declares `urlTarget`)
165
+ * instead of a new browser tab. On by default; gated on the
166
+ * `browserInterceptLinks` master and the target tab's own enable switch.
167
+ */
168
+ browserInterceptHttp: boolean;
169
+ /**
170
+ * Whether clicking an https EXTERNAL link in the GUI opens the sidebar
171
+ * instead of a new browser tab. OFF by default — most https sites (e.g.
172
+ * GitHub) refuse iframe embedding, so the system browser is the smoother
173
+ * default; gated on the `browserInterceptLinks` master and the target
174
+ * tab's own enable switch.
175
+ */
176
+ browserInterceptHttps: boolean;
177
+ /**
178
+ * Comma-separated allowlist of local (loopback) authorities the browser
179
+ * tab may navigate to — `localhost`, `127.0.0.1`, `127.0.0.1:5174`, or
180
+ * host:port pairs. Empty by default: loopback addresses stay blocked so a
181
+ * browsed page cannot probe local services. Each entry is either a bare
182
+ * hostname (all ports) or host:port; the GUI's own origin is always
183
+ * allowed regardless. The iframe sandbox still renders allowed local
184
+ * pages in an opaque origin, exactly like any other site.
185
+ */
186
+ browserAllowedLoopback: string;
187
+ /**
188
+ * Per-tab enable switches, keyed by tab descriptor id (`'explorer'`,
189
+ * `'my-plugin:db'`). An ABSENT key means enabled — only an explicit
190
+ * `false` disables a tab type (hidden from the + menu, `openTab` refuses,
191
+ * and derived flows like subagent auto-open / agent-terminal tabs stop).
192
+ * Already-open tabs of a disabled type keep rendering (closing one
193
+ * prevents reopening), matching the "existing conversations keep their
194
+ * own layouts" rule.
195
+ */
196
+ tabsEnabled: Record<string, boolean>;
197
+ /**
198
+ * Per-viewer enable switches, keyed by file viewer descriptor id
199
+ * (`'image'`, `'my-plugin:csv'`). An ABSENT key means enabled; a disabled
200
+ * viewer is skipped by `matchFileViewer` so files fall through to the
201
+ * next matching viewer (or the download button when none match).
202
+ */
203
+ viewersEnabled: Record<string, boolean>;
204
+ /**
205
+ * Plugin-owned settings blobs (v0.12.0+), keyed by descriptor id: each
206
+ * registered tab/viewer that declares `settings.pluginToggles` (or writes
207
+ * through `settings.render`'s `updatePluginSetting`) persists its values
208
+ * here — an open map, so third-party keys need no host PrefsSchema field.
209
+ * Values are JSON-serializable (the row controls produce strings /
210
+ * numbers / booleans; custom panels are responsible for their own).
211
+ */
212
+ pluginSettings: Record<string, Record<string, unknown>>;
213
+ }
214
+ /** Range contract of {@link SidebarPrefs.defaultWidthPercent}. */
215
+ export declare const WIDTH_PERCENT_MIN = 20;
216
+ export declare const WIDTH_PERCENT_MAX = 60;
217
+ export declare const WIDTH_PERCENT_DEFAULT = 35;
218
+ /** Range contract of {@link SidebarPrefs.terminalFontSize}. */
219
+ export declare const TERMINAL_FONT_SIZE_MIN = 9;
220
+ export declare const TERMINAL_FONT_SIZE_MAX = 32;
221
+ export declare const TERMINAL_FONT_SIZE_DEFAULT = 13;
222
+ /** Range contract of {@link SidebarPrefs.titleBarStripPx}. */
223
+ export declare const TITLE_BAR_STRIP_MIN = 0;
224
+ export declare const TITLE_BAR_STRIP_MAX = 120;
225
+ export declare const TITLE_BAR_STRIP_DEFAULT = 40;
226
+ /** The title-bar / shell compatibility schemes (see {@link SidebarPrefs.titleBarScheme}). */
227
+ export declare const TITLE_BAR_SCHEMES: readonly ["auto", "web", "preset", "custom"];
228
+ export type TitleBarScheme = typeof TITLE_BAR_SCHEMES[number];
229
+ /** Fallback prefs used whenever the settings document is unreachable or malformed. */
230
+ export declare const SIDEBAR_PREFS_DEFAULTS: SidebarPrefs;
231
+ /** Clamp one width percent into the contract range (shared by schema and client reads). */
232
+ export declare function clampWidthPercent(value: number): number;
233
+ /** Clamp one terminal font size into the contract range (shared by schema and client reads). */
234
+ export declare function clampTerminalFontSize(value: number): number;
235
+ /** Clamp one title-bar strip height into the contract range (shared by schema and client reads). */
236
+ export declare function clampTitleBarStrip(value: number): number;