@dotdirfm/ui 0.1.1

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 (95) hide show
  1. package/dist/dotdir.css +2 -0
  2. package/dist/dotdir.js +130 -0
  3. package/dist/dotdir.mjs +9538 -0
  4. package/dist/lib/DotDir.d.ts +8 -0
  5. package/dist/lib/actionQueue.d.ts +7 -0
  6. package/dist/lib/app.d.ts +3 -0
  7. package/dist/lib/atoms.d.ts +84 -0
  8. package/dist/lib/components/ActionBar.d.ts +1 -0
  9. package/dist/lib/components/CommandLine.d.ts +1 -0
  10. package/dist/lib/components/CommandPalette.d.ts +10 -0
  11. package/dist/lib/components/ErrorBoundary.d.ts +18 -0
  12. package/dist/lib/components/ExtensionContainer.d.ts +48 -0
  13. package/dist/lib/components/ExtensionsPanel.d.ts +1 -0
  14. package/dist/lib/components/FileList/Breadcrumbs.d.ts +6 -0
  15. package/dist/lib/components/FileList/ColumnsScroller.d.ts +16 -0
  16. package/dist/lib/components/FileList/FileList.d.ts +15 -0
  17. package/dist/lib/components/FileList/PanelTabs.d.ts +24 -0
  18. package/dist/lib/components/FileList/ScrollableContainer.d.ts +13 -0
  19. package/dist/lib/components/FileList/index.d.ts +1 -0
  20. package/dist/lib/components/FileList/useElementSize.d.ts +7 -0
  21. package/dist/lib/components/PanelGroup.d.ts +23 -0
  22. package/dist/lib/components/Terminal.d.ts +2 -0
  23. package/dist/lib/dialogs/ConflictDialog.d.ts +11 -0
  24. package/dist/lib/dialogs/CopyConfigDialog.d.ts +8 -0
  25. package/dist/lib/dialogs/CopyProgressDialog.d.ts +9 -0
  26. package/dist/lib/dialogs/DeleteProgressDialog.d.ts +6 -0
  27. package/dist/lib/dialogs/HelpDialog.d.ts +6 -0
  28. package/dist/lib/dialogs/MakeFolderDialog.d.ts +13 -0
  29. package/dist/lib/dialogs/ModalDialog.d.ts +14 -0
  30. package/dist/lib/dialogs/MoveConfigDialog.d.ts +8 -0
  31. package/dist/lib/dialogs/OpenCreateFileDialog.d.ts +11 -0
  32. package/dist/lib/dialogs/RenameDialog.d.ts +6 -0
  33. package/dist/lib/dialogs/dialogContext.d.ts +115 -0
  34. package/dist/lib/dialogs/dialogHotkeys.d.ts +18 -0
  35. package/dist/lib/entities/panel/model/panelSide.d.ts +9 -0
  36. package/dist/lib/entities/panel/model/types.d.ts +1 -0
  37. package/dist/lib/entities/tab/model/tabsAtoms.d.ts +25 -0
  38. package/dist/lib/features/bridge/index.d.ts +209 -0
  39. package/dist/lib/features/bridge/useBridge.d.ts +9 -0
  40. package/dist/lib/features/commands/builtInCommandContributions.d.ts +2 -0
  41. package/dist/lib/features/commands/commands.d.ts +90 -0
  42. package/dist/lib/features/extensions/browserExtensionHost.d.ts +36 -0
  43. package/dist/lib/features/extensions/browserFsProvider.d.ts +5 -0
  44. package/dist/lib/features/extensions/extensionApi.d.ts +196 -0
  45. package/dist/lib/features/extensions/extensionHost.worker.d.ts +174 -0
  46. package/dist/lib/features/extensions/extensionHostClient.d.ts +29 -0
  47. package/dist/lib/features/extensions/extensionLoader.d.ts +8 -0
  48. package/dist/lib/features/extensions/extensions.d.ts +251 -0
  49. package/dist/lib/features/extensions/useExtensionHost.d.ts +6 -0
  50. package/dist/lib/features/file-icons/iconCache.d.ts +3 -0
  51. package/dist/lib/features/file-icons/iconResolver.d.ts +34 -0
  52. package/dist/lib/features/file-icons/vscodeIconTheme.d.ts +62 -0
  53. package/dist/lib/features/file-ops/model/fileOperationHandlers.d.ts +10 -0
  54. package/dist/lib/features/file-ops/model/useFileOperations.d.ts +15 -0
  55. package/dist/lib/features/marketplace/vscodeMarketplace.d.ts +33 -0
  56. package/dist/lib/features/navigation/lib/commandLineCd.d.ts +20 -0
  57. package/dist/lib/features/settings/types.d.ts +12 -0
  58. package/dist/lib/features/settings/useUserSettings.d.ts +6 -0
  59. package/dist/lib/features/settings/userSettings.d.ts +8 -0
  60. package/dist/lib/features/ui-state/types.d.ts +22 -0
  61. package/dist/lib/features/ui-state/uiState.d.ts +5 -0
  62. package/dist/lib/fileListHandlers.d.ts +31 -0
  63. package/dist/lib/focusContext.d.ts +21 -0
  64. package/dist/lib/fs.d.ts +36 -0
  65. package/dist/lib/fss.d.ts +9 -0
  66. package/dist/lib/hooks/useBuiltInCommands.d.ts +24 -0
  67. package/dist/lib/hooks/useDialogButtonNav.d.ts +10 -0
  68. package/dist/lib/hooks/useMediaQuery.d.ts +1 -0
  69. package/dist/lib/hooks/usePanel.d.ts +23 -0
  70. package/dist/lib/hooks/useTerminal.d.ts +12 -0
  71. package/dist/lib/jsoncFileWatcher.d.ts +15 -0
  72. package/dist/lib/languageRegistry.d.ts +43 -0
  73. package/dist/lib/panelGroupHandlers.d.ts +6 -0
  74. package/dist/lib/processes/workspace-session/model/useWorkspaceSessionProcess.d.ts +59 -0
  75. package/dist/lib/registerKeybindings.d.ts +11 -0
  76. package/dist/lib/styleHost.d.ts +2 -0
  77. package/dist/lib/terminal/TerminalSession.d.ts +59 -0
  78. package/dist/lib/terminal/TerminalView.d.ts +8 -0
  79. package/dist/lib/terminal/path.d.ts +7 -0
  80. package/dist/lib/terminal/shellProfiles.d.ts +15 -0
  81. package/dist/lib/terminal/terminalAtoms.d.ts +7 -0
  82. package/dist/lib/terminal/types.d.ts +53 -0
  83. package/dist/lib/terminal/useTerminalState.d.ts +20 -0
  84. package/dist/lib/types.d.ts +12 -0
  85. package/dist/lib/userKeybindings.d.ts +3 -0
  86. package/dist/lib/utils/containerPath.d.ts +45 -0
  87. package/dist/lib/utils/cssModules.d.ts +1 -0
  88. package/dist/lib/utils/inputNoAssist.d.ts +9 -0
  89. package/dist/lib/utils/langDetect.d.ts +1 -0
  90. package/dist/lib/utils/mediaFiles.d.ts +7 -0
  91. package/dist/lib/utils/path.d.ts +26 -0
  92. package/dist/lib/utils/vfs.d.ts +2 -0
  93. package/dist/lib/viewerEditorRegistry.d.ts +53 -0
  94. package/dist/lib/vscodeColorTheme.d.ts +27 -0
  95. package/package.json +66 -0
@@ -0,0 +1,22 @@
1
+ export type PersistedTab = {
2
+ type: "filelist";
3
+ path: string;
4
+ selectedName?: string;
5
+ topmostName?: string;
6
+ } | {
7
+ type: "preview";
8
+ path: string;
9
+ name: string;
10
+ size: number;
11
+ };
12
+ export interface PanelPersistedState {
13
+ currentPath: string;
14
+ tabs?: PersistedTab[];
15
+ activeTabIndex?: number;
16
+ }
17
+ /** UI state persisted across launches (tabs, active panel). Not watched — read once on startup. */
18
+ export interface DotDirUiState {
19
+ leftPanel?: PanelPersistedState;
20
+ rightPanel?: PanelPersistedState;
21
+ activePanel?: "left" | "right";
22
+ }
@@ -0,0 +1,5 @@
1
+ import { Bridge } from '../../../features/bridge';
2
+ import { DotDirUiState } from './types';
3
+ export declare function initUiState(bridge: Bridge): Promise<DotDirUiState>;
4
+ export declare function updateUiState(bridge: Bridge, partial: Partial<DotDirUiState>): void;
5
+ export declare function flushUiState(bridge: Bridge): void;
@@ -0,0 +1,31 @@
1
+ export interface ActiveFileListHandlers {
2
+ cursorUp(): void;
3
+ cursorDown(): void;
4
+ cursorLeft(): void;
5
+ cursorRight(): void;
6
+ cursorHome(): void;
7
+ cursorEnd(): void;
8
+ cursorPageUp(): void;
9
+ cursorPageDown(): void;
10
+ selectUp(): void;
11
+ selectDown(): void;
12
+ selectLeft(): void;
13
+ selectRight(): void;
14
+ selectHome(): void;
15
+ selectEnd(): void;
16
+ selectPageUp(): void;
17
+ selectPageDown(): void;
18
+ execute(): void;
19
+ open(): void;
20
+ viewFile(): void;
21
+ editFile(): void;
22
+ moveToTrash(): void;
23
+ permanentDelete(): void;
24
+ copy(): void;
25
+ move(): void;
26
+ rename(): void;
27
+ pasteFilename(): void;
28
+ pastePath(): void;
29
+ }
30
+ export declare function setActiveFileListHandlers(handlers: ActiveFileListHandlers | null): void;
31
+ export declare function getActiveFileListHandlers(): ActiveFileListHandlers | null;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Focus Context System
3
+ *
4
+ * Tracks which component currently has focus for keyboard handling.
5
+ * Components push/pop themselves onto the focus stack.
6
+ */
7
+ export type FocusLayer = "panel" | "commandPalette" | "modal" | "terminal" | "editor" | "viewer";
8
+ type FocusChangeCallback = (layer: FocusLayer) => void;
9
+ declare class FocusContextManager {
10
+ private stack;
11
+ private listeners;
12
+ get current(): FocusLayer;
13
+ push(layer: FocusLayer): void;
14
+ pop(layer: FocusLayer): void;
15
+ set(layer: FocusLayer): void;
16
+ is(layer: FocusLayer): boolean;
17
+ onChange(callback: FocusChangeCallback): () => void;
18
+ private notify;
19
+ }
20
+ export declare const focusContext: FocusContextManager;
21
+ export {};
@@ -0,0 +1,36 @@
1
+ import { Bridge, EntryKind, FsChangeType } from '../features/bridge';
2
+ export interface HandleMeta {
3
+ size: number;
4
+ mtimeMs: number;
5
+ mode: number;
6
+ nlink: number;
7
+ kind: EntryKind;
8
+ hidden: boolean;
9
+ linkTarget?: string;
10
+ }
11
+ export declare function readFile(bridge: Bridge, path: string): Promise<ArrayBuffer>;
12
+ export declare function readFileBuffer(bridge: Bridge, path: string): Promise<ArrayBuffer>;
13
+ export declare function readFileText(bridge: Bridge, path: string): Promise<string>;
14
+ export interface FileSystemChangeRecord {
15
+ root: {
16
+ path: string;
17
+ };
18
+ changedHandle: {
19
+ path: string;
20
+ name: string;
21
+ } | null;
22
+ relativePathComponents: string[];
23
+ type: FsChangeType;
24
+ }
25
+ type ObserverCallback = (records: FileSystemChangeRecord[], observer: FileSystemObserver) => void;
26
+ export declare class FileSystemObserver {
27
+ #private;
28
+ private bridge;
29
+ constructor(bridge: Bridge, callback: ObserverCallback);
30
+ observe(path: string): Promise<void>;
31
+ unobserve(path: string): void;
32
+ /** Update the set of watched paths, adding/removing only what changed. */
33
+ sync(paths: string[]): void;
34
+ disconnect(): void;
35
+ }
36
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Bridge } from '../features/bridge';
2
+ import { LoadedExtension } from '../features/extensions/extensions';
3
+ import { ResolvedEntryStyle } from '../types';
4
+ import { FsNode, LayeredResolver, ThemeKind } from 'fss-lang';
5
+ export declare function setExtensionLayers(extensions: LoadedExtension[], activeIconTheme?: string): void;
6
+ export declare function invalidateFssCache(dirPath: string): void;
7
+ export declare function createPanelResolver(theme?: ThemeKind): LayeredResolver;
8
+ export declare function syncLayers(bridge: Bridge, resolver: LayeredResolver, dirPath: string): Promise<void>;
9
+ export declare function resolveEntryStyle(resolver: LayeredResolver, node: FsNode): ResolvedEntryStyle;
@@ -0,0 +1,24 @@
1
+ import { DialogSpec } from '../../dialogs/dialogContext';
2
+ import { RefObject } from 'react';
3
+ interface PanelHandle {
4
+ currentPath: string;
5
+ navigateTo: (path: string, force?: boolean, cursorName?: string) => Promise<void>;
6
+ cancelNavigation: () => void;
7
+ }
8
+ export interface BuiltInCommandDeps {
9
+ leftRef: RefObject<PanelHandle>;
10
+ rightRef: RefObject<PanelHandle>;
11
+ onPreviewInOppositePanel: () => void;
12
+ onOpenCurrentFolderInOppositeCurrentTab: () => void;
13
+ onOpenCurrentFolderInOppositeNewTab: () => void;
14
+ onOpenSelectedFolderInOppositeCurrentTab: () => void;
15
+ onOpenSelectedFolderInOppositeNewTab: () => void;
16
+ onOpenCreateFileConfirm: (path: string, name: string, langId: string) => Promise<void>;
17
+ showDialog: (spec: DialogSpec) => void;
18
+ onViewFile: (filePath: string, fileName: string, fileSize: number) => void;
19
+ onEditFile: (filePath: string, fileName: string, fileSize: number, langId: string) => void;
20
+ onExecuteInTerminal: (cmd: string) => Promise<void>;
21
+ editorFileSizeLimit: number;
22
+ }
23
+ export declare function useBuiltInCommands(deps: BuiltInCommandDeps): void;
24
+ export {};
@@ -0,0 +1,10 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Arrow-key navigation between buttons inside a dialog.
4
+ * Left/Right arrows cycle focus; the default button is focused on mount.
5
+ */
6
+ export declare function useDialogButtonNav(containerRef: RefObject<HTMLElement | null>, opts?: {
7
+ defaultIndex?: number;
8
+ }): {
9
+ onKeyDown: (e: React.KeyboardEvent) => void;
10
+ };
@@ -0,0 +1 @@
1
+ export declare function useMediaQuery(query: string): boolean;
@@ -0,0 +1,23 @@
1
+ import { Bridge } from '../../features/bridge';
2
+ import { LayeredResolver, FsNode } from 'fss-lang';
3
+ export declare function findExistingParent(bridge: Bridge, startPath: string): Promise<string>;
4
+ export interface PanelState {
5
+ currentPath: string;
6
+ parentNode?: FsNode;
7
+ entries: FsNode[];
8
+ /** Name of the entry to focus when navigating to a directory (e.g. the archive file when leaving a ZIP). */
9
+ requestedCursor?: string;
10
+ }
11
+ export declare const emptyPanel: PanelState;
12
+ export declare function usePanel(showError: (message: string) => void): {
13
+ navigateTo: (path: string, force?: boolean, cursorName?: string) => Promise<void>;
14
+ navigating: boolean;
15
+ cancelNavigation: () => void;
16
+ refresh: () => void;
17
+ resolver: LayeredResolver;
18
+ currentPath: string;
19
+ parentNode?: FsNode;
20
+ entries: FsNode[];
21
+ /** Name of the entry to focus when navigating to a directory (e.g. the archive file when leaving a ZIP). */
22
+ requestedCursor?: string;
23
+ };
@@ -0,0 +1,12 @@
1
+ interface UseTerminalOptions {
2
+ activePanelCwd: string;
3
+ onNavigatePanel: (path: string) => void;
4
+ }
5
+ export interface UseTerminalResult {
6
+ activeCwd: string;
7
+ writeToTerminal: (data: string) => Promise<void>;
8
+ runCommand: (cmd: string, cwd: string) => Promise<void>;
9
+ rememberExpectedTerminalCwd: (path: string) => void;
10
+ }
11
+ export declare function useTerminal({ activePanelCwd, onNavigatePanel }: UseTerminalOptions): UseTerminalResult;
12
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Bridge } from '../features/bridge';
2
+ export interface JsoncFileWatcher<T> {
3
+ getValue(): T;
4
+ setValue(value: T): void;
5
+ onChange(callback: (value: T) => void): () => void;
6
+ dispose(): Promise<void>;
7
+ }
8
+ export interface JsoncFileWatcherOptions<T> {
9
+ name: string;
10
+ getPath: () => Promise<string>;
11
+ validate: (parsed: unknown) => T | null;
12
+ defaultValue: T;
13
+ onLoad?: (value: T) => void;
14
+ }
15
+ export declare function createJsoncFileWatcher<T>(bridge: Bridge, options: JsoncFileWatcherOptions<T>): Promise<JsoncFileWatcher<T>>;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Language Registry (host-only)
3
+ *
4
+ * Manages language and grammar metadata from extension contributions.
5
+ * Used for language detection (filename → langId) when opening files.
6
+ * Syntax highlighting and tokenization are handled inside editor extensions (e.g. Monaco).
7
+ */
8
+ export interface LanguageContribution {
9
+ id: string;
10
+ aliases?: string[];
11
+ extensions?: string[];
12
+ filenames?: string[];
13
+ }
14
+ export interface GrammarContribution {
15
+ language: string;
16
+ scopeName: string;
17
+ path: string;
18
+ embeddedLanguages?: Record<string, string>;
19
+ }
20
+ export interface GrammarData {
21
+ contribution: GrammarContribution;
22
+ content: object;
23
+ }
24
+ declare class LanguageRegistry {
25
+ private grammarContents;
26
+ private languageToScope;
27
+ private extToLang;
28
+ private filenameToLang;
29
+ /** No-op for compatibility; host does not run Monaco. */
30
+ initialize(): Promise<void>;
31
+ /** Register a language contributed by an extension. */
32
+ registerLanguage(lang: LanguageContribution): void;
33
+ /** Store grammar metadata (for hasGrammar); tokenization is done in editor extensions. */
34
+ registerGrammar(data: GrammarData): void;
35
+ /** No-op; tokenization is handled inside editor extensions. */
36
+ activateGrammars(): Promise<void>;
37
+ clear(): void;
38
+ hasGrammar(langId: string): boolean;
39
+ detectLanguage(filename: string): string;
40
+ getLanguageForFilename(filename: string): string;
41
+ }
42
+ export declare const languageRegistry: LanguageRegistry;
43
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ActivePanelGroupHandlers {
2
+ newTab(): void;
3
+ closeActiveTab(): Promise<void>;
4
+ }
5
+ export declare function setActivePanelGroupHandlers(handlers: ActivePanelGroupHandlers | null): void;
6
+ export declare function getActivePanelGroupHandlers(): ActivePanelGroupHandlers | null;
@@ -0,0 +1,59 @@
1
+ import { PanelTab } from '../../../../components/FileList/PanelTabs';
2
+ import { PanelSide } from '../../../../entities/panel/model/types';
3
+ import { PanelPersistedState } from '../../../../features/ui-state/types';
4
+ import { FsNode } from 'fss-lang';
5
+ import { Dispatch, RefObject, SetStateAction } from 'react';
6
+ type TabSelectionRef = RefObject<Record<string, {
7
+ selectedName?: string;
8
+ topmostName?: string;
9
+ }>>;
10
+ type NameRef = RefObject<string | undefined>;
11
+ type IdRef = RefObject<string>;
12
+ type TabsRef = RefObject<PanelTab[]>;
13
+ interface PanelModel {
14
+ currentPath: string;
15
+ entries: FsNode[];
16
+ }
17
+ interface RestoreParams {
18
+ ready: boolean;
19
+ setLeftTabs: Dispatch<SetStateAction<PanelTab[]>>;
20
+ setRightTabs: Dispatch<SetStateAction<PanelTab[]>>;
21
+ setLeftActiveTabId: Dispatch<SetStateAction<string>>;
22
+ setRightActiveTabId: Dispatch<SetStateAction<string>>;
23
+ leftTabSelectionRef: TabSelectionRef;
24
+ rightTabSelectionRef: TabSelectionRef;
25
+ prevLeftActiveTabIdRef: RefObject<string>;
26
+ prevRightActiveTabIdRef: RefObject<string>;
27
+ onAfterRestore: () => void;
28
+ }
29
+ export declare function useWorkspaceRestoreProcess({ ready, setLeftTabs, setRightTabs, setLeftActiveTabId, setRightActiveTabId, leftTabSelectionRef, rightTabSelectionRef, prevLeftActiveTabIdRef, prevRightActiveTabIdRef, onAfterRestore, }: RestoreParams): {
30
+ settingsLoaded: boolean;
31
+ initialLeftPanel: PanelPersistedState | undefined;
32
+ initialRightPanel: PanelPersistedState | undefined;
33
+ initialActivePanel: PanelSide | undefined;
34
+ setInitialLeftPanel: Dispatch<SetStateAction<PanelPersistedState | undefined>>;
35
+ setInitialRightPanel: Dispatch<SetStateAction<PanelPersistedState | undefined>>;
36
+ setInitialActivePanel: Dispatch<SetStateAction<PanelSide | undefined>>;
37
+ };
38
+ interface PersistParams {
39
+ activePanel: PanelSide;
40
+ settingsLoaded: boolean;
41
+ left: PanelModel;
42
+ right: PanelModel;
43
+ leftTabsRef: TabsRef;
44
+ rightTabsRef: TabsRef;
45
+ leftActiveTabIdRef: IdRef;
46
+ rightActiveTabIdRef: IdRef;
47
+ leftTabSelectionRef: TabSelectionRef;
48
+ rightTabSelectionRef: TabSelectionRef;
49
+ leftSelectedNameRef: NameRef;
50
+ rightSelectedNameRef: NameRef;
51
+ setLeftTabs: Dispatch<SetStateAction<PanelTab[]>>;
52
+ setRightTabs: Dispatch<SetStateAction<PanelTab[]>>;
53
+ setLeftActiveTabId: Dispatch<SetStateAction<string>>;
54
+ setRightActiveTabId: Dispatch<SetStateAction<string>>;
55
+ }
56
+ export declare function useWorkspacePersistenceProcess({ activePanel, settingsLoaded, left, right, leftTabsRef, rightTabsRef, leftActiveTabIdRef, rightActiveTabIdRef, leftTabSelectionRef, rightTabSelectionRef, leftSelectedNameRef, rightSelectedNameRef, setLeftTabs, setRightTabs, setLeftActiveTabId, setRightActiveTabId, }: PersistParams): {
57
+ handlePanelStateChange: (side: PanelSide, selectedName: string | undefined, topmostName: string | undefined) => void;
58
+ };
59
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Keybinding, KeybindingLayer } from '../features/commands/commands';
2
+ export type Disposable = () => void;
3
+ type CommandRegistryLike = {
4
+ registerKeybinding: (binding: Keybinding, layer?: KeybindingLayer) => Disposable;
5
+ };
6
+ export declare function registerAppBuiltInKeybindings(registry: CommandRegistryLike): Disposable[];
7
+ export declare function registerCommandLineKeybindings(registry: CommandRegistryLike): Disposable[];
8
+ export declare function registerFileListKeybindings(registry: CommandRegistryLike): Disposable[];
9
+ export declare function registerExtensionKeybinding(registry: CommandRegistryLike, binding: Keybinding): Disposable;
10
+ export declare function registerExtensionKeybindings(registry: CommandRegistryLike, bindings: Keybinding[]): Disposable[];
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function setStyleHostElement(element: HTMLElement | null): void;
2
+ export declare function getStyleHostElement(): HTMLElement;
@@ -0,0 +1,59 @@
1
+ import { Bridge, TerminalProfile } from '../../features/bridge';
2
+ import { TerminalCapabilities, TerminalSessionEvent } from './types';
3
+ type SessionListener = (event: TerminalSessionEvent) => void;
4
+ export declare class TerminalSession {
5
+ private bridge;
6
+ private static readonly replayLimit;
7
+ private readonly listeners;
8
+ private readonly decoder;
9
+ private readonly initialCwd;
10
+ private ptyId;
11
+ private currentCwd;
12
+ private status;
13
+ private capabilities;
14
+ private launchInfo;
15
+ private replayData;
16
+ private inputBuffer;
17
+ private activeCommand;
18
+ private suppressNextCommandFinish;
19
+ private cleanupData;
20
+ private cleanupExit;
21
+ private pendingCwdSync;
22
+ private readonly profile;
23
+ /** While true, xterm OSC hooks must not mutate session state (replay buffer re-written to the terminal). */
24
+ private oscHooksSuppressed;
25
+ constructor(bridge: Bridge, initialCwd: string, profile: TerminalProfile);
26
+ subscribe(listener: SessionListener): () => void;
27
+ getCapabilities(): TerminalCapabilities;
28
+ getReplayData(): string;
29
+ setOscHooksSuppressed(suppressed: boolean): void;
30
+ /** xterm OSC 7 — cwd from shell integration. */
31
+ notifyOsc7FromXterm(cwd: string): void;
32
+ /**
33
+ * .dir OSC 779 — shell integration emits this on preexec (S) and command finish (F).
34
+ * Payload `S` = command starting (preexec); `F` = command finished (postexec / precmd).
35
+ */
36
+ notifyDotDirPromptOsc(payload: string): void;
37
+ start(): Promise<void>;
38
+ write(data: string): Promise<void>;
39
+ /**
40
+ * Write to the PTY without tracking as user input (used for hidden `cd`).
41
+ * The next OSC 779 (prompt after this line) is ignored for command-finish.
42
+ */
43
+ writeHidden(data: string): Promise<void>;
44
+ resize(cols: number, rows: number): Promise<void>;
45
+ syncToCwd(nextCwd: string): Promise<void>;
46
+ refreshPrompt(): Promise<void>;
47
+ dispose(): Promise<void>;
48
+ private acceptLaunch;
49
+ private handleData;
50
+ private appendVisibleData;
51
+ private finishCommand;
52
+ private applyCwdUpdate;
53
+ private consumeUserInput;
54
+ private emit;
55
+ private emitCapabilities;
56
+ private setStatus;
57
+ private flushPendingCwdSync;
58
+ }
59
+ export {};
@@ -0,0 +1,8 @@
1
+ import { TerminalSession } from './TerminalSession';
2
+ interface TerminalViewProps {
3
+ session: TerminalSession;
4
+ expanded?: boolean;
5
+ focusRequestKey?: number;
6
+ }
7
+ export declare function TerminalView({ session, expanded, focusRequestKey }: TerminalViewProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { TerminalProfile } from '../../features/bridge';
2
+ export declare function normalizeTerminalPath(raw: string): string;
3
+ /**
4
+ * Hidden `cd` sent before running a command from the command line or panel sync.
5
+ * Template comes from shell-integration contributions (`{{cwd}}` = escaped path).
6
+ */
7
+ export declare function formatHiddenCd(absoluteCwd: string, profile: TerminalProfile): string;
@@ -0,0 +1,15 @@
1
+ import { Bridge, TerminalProfile } from '../../features/bridge';
2
+ import { LoadedExtension } from '../../features/extensions/extensions';
3
+ export interface ShellProfilesResult {
4
+ profiles: TerminalProfile[];
5
+ shellScripts: Record<string, {
6
+ script: string;
7
+ scriptArg: boolean;
8
+ }>;
9
+ }
10
+ /**
11
+ * Resolve available shell profiles from extension contributions.
12
+ *
13
+ * Each unique shell path becomes a profile (id = shell path).
14
+ */
15
+ export declare function resolveShellProfiles(bridge: Bridge, extensions: LoadedExtension[], env: Record<string, string>): Promise<ShellProfilesResult>;
@@ -0,0 +1,7 @@
1
+ import { ManagedTerminalSession } from './types';
2
+ export declare const terminalSessionsAtom: import('jotai').PrimitiveAtom<ManagedTerminalSession[]> & {
3
+ init: ManagedTerminalSession[];
4
+ };
5
+ export declare const terminalActiveSessionIdAtom: import('jotai').PrimitiveAtom<string | null> & {
6
+ init: string | null;
7
+ };
@@ -0,0 +1,53 @@
1
+ import { TerminalProfile } from '../../features/bridge';
2
+ import { TerminalSession } from './TerminalSession';
3
+ export type TerminalSessionStatus = "idle" | "starting" | "running" | "exited" | "error";
4
+ export interface ManagedTerminalSession {
5
+ id: string;
6
+ session: TerminalSession;
7
+ profile: TerminalProfile;
8
+ profileId: string;
9
+ profileLabel: string;
10
+ cwd: string;
11
+ cwdUserInitiated: boolean;
12
+ status: TerminalSessionStatus;
13
+ error?: string;
14
+ }
15
+ export interface PtyLaunchInfo {
16
+ ptyId: number;
17
+ cwd: string;
18
+ shell: string;
19
+ }
20
+ export interface TerminalCapabilities {
21
+ cwd: string;
22
+ profileId: string | null;
23
+ hasOsc7Cwd: boolean;
24
+ /** .dir OSC 779 (prompt / command finished) seen at least once. */
25
+ hasDotDirOsc: boolean;
26
+ promptReady: boolean;
27
+ commandRunning: boolean;
28
+ lastCommand: string | null;
29
+ }
30
+ export type TerminalSessionEvent = {
31
+ type: "data";
32
+ data: string;
33
+ } | {
34
+ type: "launch";
35
+ launch: PtyLaunchInfo;
36
+ } | {
37
+ type: "cwd";
38
+ cwd: string;
39
+ userInitiated: boolean;
40
+ } | {
41
+ type: "status";
42
+ status: TerminalSessionStatus;
43
+ error?: string;
44
+ } | {
45
+ type: "capabilities";
46
+ capabilities: TerminalCapabilities;
47
+ } | {
48
+ type: "command-start";
49
+ command: string;
50
+ } | {
51
+ type: "command-finish";
52
+ command: string | null;
53
+ };
@@ -0,0 +1,20 @@
1
+ import { TerminalProfile } from '../../features/bridge';
2
+ import { ManagedTerminalSession } from './types';
3
+ export type { ManagedTerminalSession };
4
+ export interface TerminalState {
5
+ sessions: ManagedTerminalSession[];
6
+ activeSessionId: string | null;
7
+ activeSession: ManagedTerminalSession | null;
8
+ setProfiles: (profiles: TerminalProfile[], cwd: string) => void;
9
+ setCurrentCwd: (cwd: string) => void;
10
+ createSession: (profileId?: string) => void;
11
+ activate: (sessionId: string) => void;
12
+ closeSession: (sessionId: string) => void;
13
+ switchActiveProfile: (profileId: string) => void;
14
+ restartAll: () => void;
15
+ refreshActivePrompt: () => void;
16
+ writeToActiveSession: (data: string) => Promise<void>;
17
+ executeCommandInCwd: (command: string, cwd: string) => Promise<void>;
18
+ dispose: () => void;
19
+ }
20
+ export declare function useTerminalState(): TerminalState;
@@ -0,0 +1,12 @@
1
+ export interface ResolvedEntryStyle {
2
+ color?: string;
3
+ opacity?: number;
4
+ fontWeight?: string | number;
5
+ fontStyle?: string;
6
+ fontStretch?: string;
7
+ fontVariant?: string;
8
+ textDecoration?: string;
9
+ icon: string | null;
10
+ sortPriority: number;
11
+ groupFirst: boolean;
12
+ }
@@ -0,0 +1,3 @@
1
+ import { Bridge } from '../features/bridge';
2
+ export declare function initUserKeybindings(bridge: Bridge): Promise<void>;
3
+ export declare function disposeUserKeybindings(): Promise<void>;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Container path utilities.
3
+ *
4
+ * A "container path" represents a location inside a file that can be browsed
5
+ * like a directory (e.g. a ZIP archive). The null byte '\0' is used as the
6
+ * separator between the real filesystem path and the inner path, because '\0'
7
+ * cannot appear in real file names on any supported platform.
8
+ *
9
+ * Examples:
10
+ * /home/user/archive.zip\0 → root of archive.zip
11
+ * /home/user/archive.zip\0/sub/dir → /sub/dir inside archive.zip
12
+ * C:/Users/user/arch.zip\0/inner → /inner inside arch.zip (Windows)
13
+ *
14
+ * The existing dirname/join/basename functions in path.ts work correctly with
15
+ * container paths because they only manipulate '/' separators — the '\0' passes
16
+ * through untouched. The only addition required is getBreadcrumbSegments, which
17
+ * splits on '\0' to produce the mixed real-path + inner-path breadcrumb.
18
+ */
19
+ export declare const CONTAINER_SEP = "\0";
20
+ /** Returns true if the path refers to a location inside a container file. */
21
+ export declare function isContainerPath(path: string): boolean;
22
+ /**
23
+ * Parse a container path into the real container-file path and the inner path.
24
+ * @returns containerFile — real FS path; innerPath — always starts with '/'.
25
+ */
26
+ export declare function parseContainerPath(path: string): {
27
+ containerFile: string;
28
+ innerPath: string;
29
+ };
30
+ /**
31
+ * Build a container path.
32
+ * @param containerFile — real FS path of the container file.
33
+ * @param innerPath — path within the container; '/' means the root.
34
+ */
35
+ export declare function buildContainerPath(containerFile: string, innerPath: string): string;
36
+ /**
37
+ * Return the real filesystem path of the outermost container file.
38
+ * For a plain path, returns the path unchanged.
39
+ */
40
+ export declare function containerFile(path: string): string;
41
+ /**
42
+ * Return the inner path from a container path.
43
+ * Returns '/' when at the container root, or the path unchanged for plain paths.
44
+ */
45
+ export declare function containerInner(path: string): string;
@@ -0,0 +1 @@
1
+ export declare function cx(styles: Record<string, string>, ...classNames: Array<string | false | null | undefined>): string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Spread onto text/search `<input>`s to disable browser autocompletion, spellcheck,
3
+ * and mobile autocorrect/capitalization for path-like fields.
4
+ */
5
+ export declare const INPUT_NO_ASSIST: {
6
+ readonly autoComplete: "off";
7
+ readonly spellCheck: false;
8
+ readonly autoCapitalize: "none";
9
+ };
@@ -0,0 +1 @@
1
+ export declare function detectLang(name: string): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Helpers for detecting image/video files (used for viewer gallery and focus).
3
+ * Viewer implementations live in extensions (e.g. dotdir-image-viewer).
4
+ */
5
+ export declare function isImageFile(name: string): boolean;
6
+ export declare function isVideoFile(name: string): boolean;
7
+ export declare function isMediaFile(name: string): boolean;
@@ -0,0 +1,26 @@
1
+ export declare function normalizePath(path: string): string;
2
+ export declare function isUncRoot(path: string): boolean;
3
+ export declare function isRootPath(path: string): boolean;
4
+ export declare function dirname(path: string): string;
5
+ export declare function join(...parts: string[]): string;
6
+ /**
7
+ * Resolves `.` and `..` segments (POSIX-style). Does not touch symlinks.
8
+ * Handles Unix absolute paths, Windows `C:/...`, and relative paths.
9
+ */
10
+ export declare function resolveDotSegments(path: string): string;
11
+ export declare function basename(path: string): string;
12
+ /**
13
+ * Returns whether a file should be treated as executable.
14
+ * Uses mode bits (Unix) and/or executable extension (Windows and fallback).
15
+ */
16
+ export declare function isFileExecutable(mode: number, fileName: string): boolean;
17
+ /**
18
+ * Returns breadcrumb segments for a path. On Windows, first segment is the drive (e.g. "C:").
19
+ * Each segment has a display label and the full path up to that segment (for navigation).
20
+ * Container paths (real-file\0inner-path) produce a mixed breadcrumb: the real ancestors
21
+ * first, then the container-root segment, then the inner-path segments.
22
+ */
23
+ export declare function getBreadcrumbSegments(path: string): {
24
+ label: string;
25
+ path: string;
26
+ }[];
@@ -0,0 +1,2 @@
1
+ /** Build a URL that serves an absolute VFS path. */
2
+ export declare function vfsUrl(absPath: string): string;