dsh-vscode-workbench 0.1.14 → 0.2.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 (55) hide show
  1. package/README.en.md +4 -0
  2. package/README.md +8 -2
  3. package/lib/client.js +5014 -674
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +832 -80
  6. package/lib/index.js.map +1 -1
  7. package/lib/types/client/ActivityBar.d.ts +24 -0
  8. package/lib/types/client/DshConversationPanel.d.ts +1 -1
  9. package/lib/types/client/FileIcon.d.ts +8 -0
  10. package/lib/types/client/Icon.d.ts +1 -3
  11. package/lib/types/client/MonacoEditor.d.ts +36 -0
  12. package/lib/types/client/Workbench.d.ts +19 -7
  13. package/lib/types/client/WorkspaceSwitcher.d.ts +13 -0
  14. package/lib/types/client/api.d.ts +2 -0
  15. package/lib/types/client/documentPreview.d.ts +10 -2
  16. package/lib/types/client/dshComposer.d.ts +21 -0
  17. package/lib/types/client/dshNavigation.d.ts +46 -0
  18. package/lib/types/client/fileIconMap.d.ts +2 -0
  19. package/lib/types/client/gitError.d.ts +2 -0
  20. package/lib/types/client/lsp.d.ts +27 -0
  21. package/lib/types/client/searchHighlight.d.ts +5 -0
  22. package/lib/types/client/typescriptProject.d.ts +20 -0
  23. package/lib/types/context.d.ts +15 -0
  24. package/lib/types/host.d.ts +37 -0
  25. package/lib/types/lsp.d.ts +54 -0
  26. package/lib/types/office.d.ts +17 -0
  27. package/lib/types/types.d.ts +5 -0
  28. package/lib/types/watch-ignore.d.ts +4 -0
  29. package/package.json +5 -2
  30. package/src/client/ActivityBar.tsx +152 -0
  31. package/src/client/DshConversationPanel.tsx +15 -12
  32. package/src/client/FileIcon.tsx +6 -0
  33. package/src/client/Icon.tsx +1 -14
  34. package/src/client/MonacoEditor.tsx +187 -19
  35. package/src/client/TerminalPanel.tsx +6 -3
  36. package/src/client/Workbench.tsx +324 -81
  37. package/src/client/WorkspaceSwitcher.tsx +53 -0
  38. package/src/client/api.ts +27 -1
  39. package/src/client/documentPreview.tsx +92 -5
  40. package/src/client/dshComposer.ts +73 -0
  41. package/src/client/dshNavigation.ts +81 -0
  42. package/src/client/fileIconMap.ts +7 -0
  43. package/src/client/gitError.ts +5 -0
  44. package/src/client/index.tsx +28 -14
  45. package/src/client/lsp.ts +300 -0
  46. package/src/client/searchHighlight.ts +6 -0
  47. package/src/client/styles.ts +28 -31
  48. package/src/client/typescriptProject.ts +81 -0
  49. package/src/context.ts +8 -0
  50. package/src/host.ts +100 -15
  51. package/src/index.ts +121 -17
  52. package/src/lsp.ts +170 -0
  53. package/src/office.ts +95 -0
  54. package/src/types.ts +2 -0
  55. package/src/watch-ignore.ts +22 -1
@@ -1,3 +1,4 @@
1
+ import type { EditorSelection } from './dshComposer.ts';
1
2
  type Monaco = typeof import('monaco-editor');
2
3
  declare global {
3
4
  interface Window {
@@ -10,17 +11,44 @@ declare global {
10
11
  }
11
12
  /** Monaco chrome used by both editors so only the narrow native scrollbar remains. */
12
13
  export declare const WORKBENCH_EDITOR_CHROME: {
14
+ readonly definitionLinkOpensInPeek: false;
15
+ readonly gotoLocation: {
16
+ readonly multipleDefinitions: "gotoAndPeek";
17
+ readonly multipleReferences: "peek";
18
+ readonly multipleImplementations: "peek";
19
+ readonly multipleTypeDefinitions: "gotoAndPeek";
20
+ readonly multipleDeclarations: "peek";
21
+ readonly alternativeDefinitionCommand: "editor.action.goToReferences";
22
+ };
23
+ readonly parameterHints: {
24
+ readonly enabled: true;
25
+ readonly cycle: true;
26
+ };
27
+ readonly quickSuggestions: {
28
+ readonly other: true;
29
+ readonly comments: false;
30
+ readonly strings: false;
31
+ };
32
+ readonly suggestOnTriggerCharacters: true;
13
33
  readonly minimap: {
14
34
  readonly enabled: false;
15
35
  };
16
36
  readonly renderOverviewRuler: false;
17
37
  readonly overviewRulerLanes: 0;
18
38
  readonly hideCursorInOverviewRuler: true;
39
+ readonly renderLineHighlightOnlyWhenFocus: true;
19
40
  readonly scrollbar: {
20
41
  readonly verticalScrollbarSize: 10;
21
42
  readonly horizontalScrollbarSize: 10;
22
43
  };
23
44
  };
45
+ /** Monaco theme aligned with the workbench dark palette. */
46
+ export declare const DARK_THEME = "dvw-dark";
47
+ /**
48
+ * Bootstrap source for Monaco's AMD web workers. Workers resolve module paths against their own
49
+ * blob URL, so they need an absolute `baseUrl`; without it the TypeScript language worker fails to load.
50
+ */
51
+ export declare function monacoWorkerBootstrap(base: string): string;
24
52
  export declare function loadMonaco(): Promise<Monaco>;
25
53
  export declare function MonacoDiffEditor(props: {
26
54
  uri: string;
@@ -28,14 +56,22 @@ export declare function MonacoDiffEditor(props: {
28
56
  modified: string;
29
57
  mode: 'inline' | 'split';
30
58
  theme: 'dark' | 'light';
59
+ fontSize?: number;
31
60
  }): import("react").JSX.Element;
61
+ /** Start downloading Monaco in the background so the first opened file does not wait for it. */
62
+ export declare function preloadMonaco(): void;
63
+ /** Dispose the models of closed tabs so Monaco stops tracking their text. */
64
+ export declare function retainEditorModels(uris: string[]): void;
32
65
  export declare function MonacoEditor(props: {
33
66
  uri: string;
34
67
  value: string;
35
68
  theme: 'dark' | 'light';
36
69
  line?: number;
37
70
  column?: number;
71
+ fontSize?: number;
72
+ highlight?: string;
38
73
  onChange(value: string): void;
39
74
  onSave(): void;
75
+ onAddToDsh?(selection?: EditorSelection): void;
40
76
  }): import("react").JSX.Element;
41
77
  export {};
@@ -1,5 +1,6 @@
1
1
  import type { FileDocument, GitCommit, GitDiff } from '../types.ts';
2
2
  import type { VscodeWorkbench } from './service.ts';
3
+ import type { DshNavigation } from './dshNavigation.ts';
3
4
  import { type DocumentPreviewKind } from './documentPreview.tsx';
4
5
  interface Tab extends FileDocument {
5
6
  instance?: symbol;
@@ -8,6 +9,7 @@ interface Tab extends FileDocument {
8
9
  loaded?: boolean;
9
10
  line?: number;
10
11
  column?: number;
12
+ highlight?: string;
11
13
  external?: boolean;
12
14
  preview?: boolean;
13
15
  title?: string;
@@ -21,8 +23,6 @@ interface Tab extends FileDocument {
21
23
  type ResizeDirection = 1 | -1;
22
24
  /** Calculate a panel width from a horizontal pointer movement. */
23
25
  export declare function resizedPanelWidth(startWidth: number, startX: number, nextX: number, direction: ResizeDirection, min: number, max: number): number;
24
- /** Retry a workspace lookup that raced the Host publishing its session after startup. */
25
- export declare function workspaceRetryDelay(error: unknown, attempt: number): number | undefined;
26
26
  /** Restore tab headers without reading their file contents. */
27
27
  export declare function restoreTabPaths(paths: string[]): Tab[];
28
28
  /** Return whether file changes require reloading one visible directory. */
@@ -37,10 +37,22 @@ export declare function tabScrollLeft(scrollLeft: number, viewport: {
37
37
  left: number;
38
38
  right: number;
39
39
  }): number;
40
+ /** Workspace-relative directory that would contain `path`. */
41
+ export declare function parentPath(path: string): string;
42
+ /** Destination path when moving an entry into `directory`. */
43
+ export declare function movedPath(path: string, directory: string): string;
44
+ /** Reject moves into the same folder, into the entry itself, or into its descendants. */
45
+ export declare function canMoveTo(path: string, directory: string): boolean;
46
+ /** Chromium `DownloadURL` payload that lets a file be dropped onto the desktop or another app. */
47
+ export declare function downloadUrlData(sessionId: string, path: string, origin: string): string;
40
48
  /** Return the workspace-relative directory used by the file picker. */
41
49
  export declare function uploadDestination(selectedDirectory?: string): string;
42
50
  /** Join an inline-created entry name to the currently selected Explorer directory. */
43
51
  export declare function createdEntryPath(directory: string, name: string): string;
52
+ /** Git prints many PDFs and archives as a text patch, so classify binary diffs by extension instead. */
53
+ export declare function isBinaryDiffPath(path: string): boolean;
54
+ /** Files the workbench can show as a document or image preview, which Git changes should open directly. */
55
+ export declare function isPreviewDocumentPath(path: string): boolean;
44
56
  /** Replace the final path component while preserving its workspace-relative directory. */
45
57
  export declare function renamedPath(path: string, name: string): string;
46
58
  export interface GraphTrack {
@@ -55,14 +67,14 @@ export interface GraphRow {
55
67
  parentLanes: number[];
56
68
  }
57
69
  export declare function graphRows(commits: GitCommit[]): GraphRow[];
58
- /** Draw a fixed-radius, orthogonal transition between two graph lanes. */
70
+ /** Move a passing lane to its new column with two 5px arcs around the row midline. */
59
71
  export declare function graphTrackPath(from: number, to: number, startY: number, endY: number, bendY: number): string;
60
- export declare function Launcher({ service }: {
61
- service: VscodeWorkbench;
62
- }): import("react").JSX.Element;
63
- export declare function Workbench({ service, sessionId, cwd }: {
72
+ /** Leave the node horizontally and turn down into a parent lane with a lane-width arc. */
73
+ export declare function graphParentPath(from: number, to: number, midY: number, endY: number): string;
74
+ export declare function Workbench({ service, sessionId, cwd, navigation }: {
64
75
  service: VscodeWorkbench;
65
76
  sessionId?: string;
66
77
  cwd?: string;
78
+ navigation?: DshNavigation;
67
79
  }): import("react").JSX.Element | null;
68
80
  export {};
@@ -0,0 +1,13 @@
1
+ import type { WorkspaceChoice } from './dshNavigation.ts';
2
+ /** Centered switcher: existing workspaces, their sessions, and a new-workspace action. */
3
+ export declare function WorkspaceSwitcher({ choices, activeSessionId, unavailable, busy, error, onCreate, onSwitch, onOpenWorkspace, onClose }: {
4
+ choices: WorkspaceChoice[];
5
+ activeSessionId?: string;
6
+ unavailable: boolean;
7
+ busy: boolean;
8
+ error?: string;
9
+ onCreate(): void;
10
+ onSwitch(sessionId: string): void;
11
+ onOpenWorkspace(workspaceId: string): void;
12
+ onClose(): void;
13
+ }): import("react").JSX.Element;
@@ -2,4 +2,6 @@ export declare class ApiError extends Error {
2
2
  code: string;
3
3
  constructor(code: string, message: string);
4
4
  }
5
+ /** Back off while DSH publishes the current session after startup; every view shares this retry. */
6
+ export declare function sessionRetryDelay(error: unknown, attempt: number): number | undefined;
5
7
  export declare function api<T>(method: string, body: Record<string, unknown>, signal?: AbortSignal): Promise<T>;
@@ -1,11 +1,19 @@
1
- export type DocumentPreviewKind = 'pdf' | 'docx' | 'download';
1
+ type XlsxModule = typeof import('xlsx');
2
+ /** Load SheetJS from the host-hosted browser build; bundling it drags Node builtins into the client. */
3
+ export declare function loadXlsx(): Promise<XlsxModule>;
4
+ export type DocumentPreviewKind = 'pdf' | 'office' | 'sheet' | 'download';
2
5
  /** Bound PDF zoom to values that remain usable in the workbench viewport. */
3
6
  export declare function clampPdfScale(scale: number): number;
4
7
  /** Return the in-workbench preview supported for a document path. */
5
8
  export declare function documentPreviewKind(path: string): DocumentPreviewKind | undefined;
6
- /** Render an in-workbench preview for PDF and Word documents. */
9
+ /** Convert one worksheet matrix into display rows, keeping large books responsive. */
10
+ export declare function sheetTable(rows: readonly unknown[][], limits?: {
11
+ rows: number;
12
+ columns: number;
13
+ }): string[][];
7
14
  export declare function DocumentPreview({ kind, src, path }: {
8
15
  kind: DocumentPreviewKind;
9
16
  src: string;
10
17
  path: string;
11
18
  }): import("react").JSX.Element;
19
+ export {};
@@ -0,0 +1,21 @@
1
+ /** Selected editor text, with 1-based inclusive line numbers. */
2
+ export interface EditorSelection {
3
+ text: string;
4
+ startLine: number;
5
+ endLine: number;
6
+ }
7
+ /** Explorer and editor shortcut that adds the current file or selection to the DSH chat. */
8
+ export declare const ADD_TO_DSH_SHORTCUT = "Ctrl+Alt+K";
9
+ /** True for the add-to-DSH chord; Monaco binds it separately, so this covers the Explorer. */
10
+ export declare function isAddToDshShortcut(event: Pick<KeyboardEvent, 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'code' | 'isComposing'>): boolean;
11
+ /** Workspace-relative reference the agent can read: `path`, `dir/`, or `path:start-end` plus a fenced copy of the selection. */
12
+ export declare function dshReference(path: string, options?: {
13
+ directory?: boolean;
14
+ selection?: EditorSelection;
15
+ }): string;
16
+ /** Separator that keeps an inserted reference from gluing onto the existing draft. */
17
+ export declare function referenceSeparator(draft: string, reference: string): string;
18
+ /** The DSH composer input, preferring the copy shown in the workbench's right column. */
19
+ export declare function findDshComposer(documentRoot?: Document): HTMLElement | null;
20
+ /** Append `reference` to the DSH draft through native editing so DSH's input machine and undo stack see it. */
21
+ export declare function insertIntoDshComposer(reference: string, documentRoot?: Document): Promise<boolean>;
@@ -0,0 +1,46 @@
1
+ /** Access to DSH's client-side workspace and session stores for the in-workbench switcher. */
2
+ export interface WorkspaceChoice {
3
+ id: string;
4
+ title: string;
5
+ path: string;
6
+ sessions: SessionChoice[];
7
+ }
8
+ export interface SessionChoice {
9
+ id: string;
10
+ title: string;
11
+ blank: boolean;
12
+ active: boolean;
13
+ }
14
+ interface SessionSummary {
15
+ title?: string;
16
+ blank?: boolean;
17
+ projectionValues?: {
18
+ title?: string;
19
+ };
20
+ }
21
+ interface WorkspacesSnapshot {
22
+ items?: readonly {
23
+ workspaceId: string;
24
+ title: string;
25
+ path: string;
26
+ sessionIds: readonly string[];
27
+ }[];
28
+ phase?: string;
29
+ }
30
+ interface SessionsSnapshot {
31
+ ids: readonly string[];
32
+ byId: Record<string, SessionSummary>;
33
+ phase?: string;
34
+ }
35
+ /** The slice of DSH's client context the switcher needs, read through `ctx.get` like ui-conversation does. */
36
+ export interface DshNavigation {
37
+ available: boolean;
38
+ choices(activeSessionId?: string): WorkspaceChoice[];
39
+ openSession(id: string): boolean;
40
+ openWorkspace(id: string): boolean;
41
+ }
42
+ /** Build display rows from the two snapshot stores, keeping DSH's own workspace and session order. */
43
+ export declare function buildWorkspaceChoices(workspaces: WorkspacesSnapshot | undefined, sessions: SessionsSnapshot | undefined, activeSessionId?: string): WorkspaceChoice[];
44
+ /** Resolve the DSH client services; `get` returns undefined outside the web/desktop client. */
45
+ export declare function createDshNavigation(get: ((name: string) => unknown) | undefined): DshNavigation;
46
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Resolve the vscode-icons asset name for a tree entry or tab. */
2
+ export declare function fileIconName(name: string, directory: boolean, expanded: boolean): string;
@@ -0,0 +1,2 @@
1
+ /** Normalize a Git/API error into the sentence shown in the branch-switch dialog. */
2
+ export declare function branchErrorMessage(error: unknown): string;
@@ -0,0 +1,27 @@
1
+ type Monaco = typeof import('monaco-editor');
2
+ /** One language server as reported by the host catalog. */
3
+ export interface LspServerStatus {
4
+ id: string;
5
+ name: string;
6
+ languages: string[];
7
+ installable: boolean;
8
+ installed: boolean;
9
+ hint?: string;
10
+ }
11
+ /** Normalize definition/reference payloads (Location, LocationLink or arrays) into Monaco locations. */
12
+ export declare function lspLocations(monaco: Monaco, result: unknown): import('monaco-editor').languages.Location[];
13
+ export declare class LspManager {
14
+ private readonly monaco;
15
+ private readonly sessionId;
16
+ private readonly workspaceRoot;
17
+ private connections;
18
+ private failures;
19
+ constructor(monaco: Monaco, sessionId: string, workspaceRoot: string);
20
+ /** Start servers that are installed and not already running; stop any that were uninstalled. */
21
+ sync(servers: LspServerStatus[]): Promise<string[]>;
22
+ stop(id: string): void;
23
+ dispose(): void;
24
+ }
25
+ /** Language server that handles a workspace path, derived from its extension or well-known filename. */
26
+ export declare function languageServerIdForPath(path: string): string | undefined;
27
+ export {};
@@ -0,0 +1,5 @@
1
+ /** Selection range for a search hit on one line, falling back to the reported column. */
2
+ export declare function searchHighlightRange(lineText: string, needle: string, column: number): {
3
+ startColumn: number;
4
+ endColumn: number;
5
+ };
@@ -0,0 +1,20 @@
1
+ type Monaco = typeof import('monaco-editor');
2
+ /** Settings key for the TS/JS language support; nothing is indexed until the user installs it in settings. */
3
+ export declare const TS_INTELLISENSE_KEY = "dvw:lsp:typescript";
4
+ export declare function tsIntellisenseEnabled(): boolean;
5
+ /** Model URI for a workspace file; must match MonacoEditor's `file:///<cwd>/<path>` tab URIs. */
6
+ export declare function projectModelPath(cwd: string, path: string): string;
7
+ /** Workspace-relative path for a project model URI, or undefined when it lives outside `cwd`. */
8
+ export declare function workspacePathFromModel(cwd: string, uri: string): string | undefined;
9
+ /** Configure Monaco's TypeScript worker and load the workspace's TS/JS files so definitions, references, Peek and signature help resolve across files. */
10
+ export declare function indexTypeScriptProject(monaco: Monaco, sessionId: string, cwd: string): Promise<{
11
+ files: number;
12
+ truncated: boolean;
13
+ }>;
14
+ /** Drop the index models that no editor or tab is using. */
15
+ export declare function disposeTypeScriptProject(monaco: Monaco): void;
16
+ /** True for models the project index created, which tab cleanup must keep. */
17
+ export declare function isIndexedModel(uri: string): boolean;
18
+ /** Refresh index models for files changed on disk, unless an editor is showing them. */
19
+ export declare function refreshIndexedFiles(monaco: Monaco, sessionId: string, cwd: string, paths: string[]): Promise<void>;
20
+ export {};
@@ -19,6 +19,21 @@ export interface WorkbenchSessions {
19
19
  export interface WorkbenchConnection {
20
20
  requestRejection(req: IncomingMessage): 401 | 403 | undefined;
21
21
  }
22
+ /** Minimal shape of DSH's host directory chooser; only the native capability is usable here. */
23
+ export interface DirectoryPickerLike {
24
+ capability(): {
25
+ kind: string;
26
+ pick?(signal: AbortSignal): Promise<string | null>;
27
+ };
28
+ }
29
+ /** Minimal shape of DSH's durable workspace registry. */
30
+ export interface WorkspaceRegistryLike {
31
+ create(path: string, title?: string): Promise<{
32
+ id: string;
33
+ path: string;
34
+ title: string;
35
+ }>;
36
+ }
22
37
  export type HostContext = CordisContext & {
23
38
  webServer: WorkbenchWebServer;
24
39
  sessions: WorkbenchSessions;
@@ -6,6 +6,27 @@ export declare function workspacePath(cwd: string, raw: string, create?: boolean
6
6
  root: string;
7
7
  absolute: string;
8
8
  }>;
9
+ /** Add a folder picked in the OS chooser to DSH's workspace list, reusing an existing registration. */
10
+ export declare function openWorkspaceFromPicker(picker: import('./context.ts').DirectoryPickerLike | undefined, registry: import('./context.ts').WorkspaceRegistryLike | undefined, signal: AbortSignal): Promise<{
11
+ opened: boolean;
12
+ workspace?: {
13
+ id: string;
14
+ path: string;
15
+ title: string;
16
+ };
17
+ }>;
18
+ /** TS/JS sources the editor's language service indexes, bounded so huge repos stay responsive. */
19
+ export declare function projectSources(cwd: string, limits?: {
20
+ files?: number;
21
+ bytes?: number;
22
+ fileBytes?: number;
23
+ }): Promise<{
24
+ files: {
25
+ path: string;
26
+ content: string;
27
+ }[];
28
+ truncated: boolean;
29
+ }>;
9
30
  export declare function listFiles(cwd: string, path: string): Promise<FileEntry[]>;
10
31
  export declare function readDocument(cwd: string, path: string): Promise<FileDocument>;
11
32
  export declare function saveDocument(cwd: string, path: string, content: string, expected: string): Promise<FileDocument>;
@@ -24,6 +45,12 @@ export declare function workspacePreviewFile(cwd: string, path: string): Promise
24
45
  path: string;
25
46
  type: string;
26
47
  }>;
48
+ /** Resolve a regular workspace file for drag-out downloads. */
49
+ export declare function workspaceDownloadFile(cwd: string, path: string): Promise<{
50
+ path: string;
51
+ name: string;
52
+ size: number;
53
+ }>;
27
54
  /** Resolve the PDF.js worker shipped with this plugin's runtime dependency. */
28
55
  export declare function pdfWorkerAsset(): {
29
56
  path: string;
@@ -46,8 +73,18 @@ export declare function codiconAsset(): {
46
73
  path: string;
47
74
  type: string;
48
75
  };
76
+ /** Browser build of SheetJS served as an asset so the client bundle stays free of Node builtins. */
77
+ export declare function xlsxAsset(): {
78
+ path: string;
79
+ type: string;
80
+ };
49
81
  export declare function monacoAsset(raw: string): {
50
82
  path: string;
51
83
  type: string;
52
84
  };
85
+ /** Resolve a vscode-icons SVG shipped by @vscode-icons/vscode-icons-api. */
86
+ export declare function fileIconAsset(raw: string): {
87
+ path: string;
88
+ type: string;
89
+ };
53
90
  export {};
@@ -0,0 +1,54 @@
1
+ /** Host-side registry and process bridge for language servers exposed to the workbench editor. */
2
+ import { type ChildProcess } from 'node:child_process';
3
+ export type LspInstall = {
4
+ kind: 'npm';
5
+ package: string;
6
+ bin: string;
7
+ } | {
8
+ kind: 'system';
9
+ command: string;
10
+ hint: string;
11
+ };
12
+ export interface LspDefinition {
13
+ id: string;
14
+ name: string;
15
+ /** Monaco language ids this server answers for. */
16
+ languages: string[];
17
+ install: LspInstall;
18
+ args: string[];
19
+ }
20
+ /** The strongest maintained server for each language, installable where the ecosystem allows it. */
21
+ export declare const LSP_SERVERS: readonly LspDefinition[];
22
+ export interface LspStatus {
23
+ id: string;
24
+ name: string;
25
+ languages: string[];
26
+ installable: boolean;
27
+ installed: boolean;
28
+ hint?: string;
29
+ }
30
+ /** Private install root so language servers never touch the user's global npm state. */
31
+ export declare function lspRoot(): string;
32
+ export declare function lspStatuses(): Promise<LspStatus[]>;
33
+ /** Install an npm-distributed server into the plugin's private directory. */
34
+ export declare function installLsp(id: string): Promise<void>;
35
+ export declare function uninstallLsp(id: string): Promise<void>;
36
+ /** Resolve the spawn command for a running server, or explain what the user must install. */
37
+ export declare function resolveLsp(id: string): Promise<{
38
+ command: string;
39
+ shell: boolean;
40
+ args: string[];
41
+ }>;
42
+ /** Serialize a JSON-RPC message using the Language Server Protocol base framing. */
43
+ export declare function frameLsp(message: unknown): string;
44
+ /** Incremental decoder for LSP frames arriving in arbitrary chunks. */
45
+ export declare function lspFrameParser(onMessage: (message: unknown) => void): (chunk: Buffer) => void;
46
+ /** Wire a spawned language server's stdio to JSON-RPC frames in both directions. */
47
+ export declare function pipeLanguageServer(child: ChildProcess, handlers: {
48
+ onMessage(message: unknown): void;
49
+ onStderr?(text: string): void;
50
+ onExit?(code: number | null): void;
51
+ }): {
52
+ write(text: string): void;
53
+ kill(): void;
54
+ };
@@ -0,0 +1,17 @@
1
+ /** True for extensions the Office preview routes through a PDF conversion. */
2
+ export declare function isOfficeDocumentPath(path: string): boolean;
3
+ /** Whether a path is a document that can only be shown through the converter. */
4
+ export declare function needsOfficeConversion(path: string): boolean;
5
+ /** Install guidance mirrors DSH: the preview never downloads an engine itself. */
6
+ export declare const OFFICE_HINT = "\u672A\u68C0\u6D4B\u5230 LibreOffice\u3002\u5B89\u88C5 LibreOffice \u540E\u53EF\u50CF DSH \u5B98\u65B9\u9884\u89C8\u4E00\u6837\u628A Word / PowerPoint \u8F6C\u6210 PDF \u67E5\u770B\u3002";
7
+ /** Locate LibreOffice without repeatedly probing the system for every open tab. */
8
+ export declare function findOfficeConverter(): Promise<string | undefined>;
9
+ /** Availability payload for the settings and preview UI. */
10
+ export declare function officeStatus(): Promise<{
11
+ available: boolean;
12
+ hint?: string;
13
+ }>;
14
+ /** Convert one workspace document to a cached PDF and return its absolute path. */
15
+ export declare function officePdf(cwd: string, path: string): Promise<{
16
+ path: string;
17
+ }>;
@@ -41,6 +41,11 @@ export interface GitChange {
41
41
  staged: boolean;
42
42
  untracked: boolean;
43
43
  }
44
+ /** One local branch and the linked worktree that has it checked out. */
45
+ export interface GitBranch {
46
+ name: string;
47
+ worktree?: string;
48
+ }
44
49
  /** Local repository state. */
45
50
  export interface GitStatus {
46
51
  repository: string;
@@ -4,5 +4,9 @@ export declare const DEFAULT_WATCH_IGNORES: readonly [".git", ".hg", ".svn", "no
4
4
  export declare function parseWatchIgnores(value: string | null | undefined): string[];
5
5
  /** Return true when a workspace-relative path contains one of the excluded segment sequences. */
6
6
  export declare function isIgnoredPath(relativePath: string, patterns: readonly string[]): boolean;
7
+ /** Literal directory/path rules from a .gitignore; glob and negation rules are left to git itself. */
8
+ export declare function parseGitIgnore(text: string): string[];
9
+ /** Ignore patterns derived from the workspace's root .gitignore, without asking the user to type exclusions. */
10
+ export declare function workspaceWatchIgnores(workspace: string): Promise<string[]>;
7
11
  /** Build a chokidar `ignored` predicate for one workspace and the user's extra exclusions. */
8
12
  export declare function watchIgnore(workspace: string, extra: readonly string[]): (path: string) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-vscode-workbench",
3
- "version": "0.1.14",
3
+ "version": "0.2.0",
4
4
  "description": "Explorer, Monaco editor, search and local Git overlay for DSH",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -56,6 +56,7 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
+ "@vscode-icons/vscode-icons-api": "^1.0.4",
59
60
  "@vscode/codicons": "^0.0.36",
60
61
  "@vscode/ripgrep": "^1.15.14",
61
62
  "@xterm/addon-fit": "^0.11.0",
@@ -67,7 +68,9 @@
67
68
  "monaco-editor": "^0.52.2",
68
69
  "node-pty": "^1.1.0",
69
70
  "pdfjs-dist": "4.10.38",
70
- "ws": "^8.18.0"
71
+ "vscode-icons-js": "^11.6.1",
72
+ "ws": "^8.18.0",
73
+ "xlsx": "0.18.5"
71
74
  },
72
75
  "peerDependencies": {
73
76
  "@deepseek-ai/cordis": "^4.0.5",