@acryldev/workspace 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +61 -2
- package/cordis.patch.yml +3 -0
- package/lib/agents/argument-text.d.ts +9 -0
- package/lib/agents/catalog.d.ts +32 -0
- package/lib/agents/contract.d.ts +50 -0
- package/lib/agents/definition.d.ts +38 -0
- package/lib/agents/file-store.d.ts +7 -0
- package/lib/agents/known-agents.d.ts +52 -0
- package/lib/agents/launch.d.ts +26 -0
- package/lib/agents/preferences.d.ts +40 -0
- package/lib/agents/route.d.ts +10 -0
- package/lib/agents/settings.d.ts +28 -0
- package/lib/agents/status/agent-status.d.ts +38 -0
- package/lib/agents/status/claude-hooks.d.ts +18 -0
- package/lib/agents/status/route.d.ts +10 -0
- package/lib/capabilities/contract.d.ts +17 -0
- package/lib/capabilities/route.d.ts +8 -0
- package/lib/client.js +91109 -0
- package/lib/client.js.map +1 -0
- package/lib/files/contract.d.ts +74 -0
- package/lib/files/route.d.ts +9 -0
- package/lib/files/service.d.ts +48 -0
- package/lib/folder-picker/contract.d.ts +9 -0
- package/lib/folder-picker/picker.d.ts +23 -0
- package/lib/folder-picker/route.d.ts +5 -0
- package/lib/git/changes.d.ts +29 -0
- package/lib/git/checks.d.ts +8 -0
- package/lib/git/commits.d.ts +14 -0
- package/lib/git/contract.d.ts +136 -0
- package/lib/git/errors.d.ts +9 -0
- package/lib/git/guards.d.ts +9 -0
- package/lib/git/ignored.d.ts +9 -0
- package/lib/git/parsing.d.ts +13 -0
- package/lib/git/route.d.ts +9 -0
- package/lib/git/runner.d.ts +29 -0
- package/lib/git/search.d.ts +14 -0
- package/lib/git/service.d.ts +52 -0
- package/lib/git/worktrees.d.ts +26 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.js +3799 -0
- package/lib/index.js.map +1 -0
- package/lib/private-route.d.ts +15 -0
- package/lib/projects/contract.d.ts +82 -0
- package/lib/projects/registry.d.ts +73 -0
- package/lib/projects/route.d.ts +16 -0
- package/lib/projects/tools.d.ts +24 -0
- package/lib/pty/contract.d.ts +52 -0
- package/lib/pty/node-pty-spawn.d.ts +3 -0
- package/lib/pty/route.d.ts +9 -0
- package/lib/pty/screen-model.d.ts +25 -0
- package/lib/pty/scrollback.d.ts +26 -0
- package/lib/pty/service.d.ts +156 -0
- package/lib/pty/stream.d.ts +19 -0
- package/lib/shared-context/chat.d.ts +34 -0
- package/lib/shared-context/launch.d.ts +24 -0
- package/lib/shared-context/render.d.ts +29 -0
- package/lib/shared-context/route.d.ts +13 -0
- package/lib/shared-context/service.d.ts +65 -0
- package/lib/shared-context/tool.d.ts +20 -0
- package/lib/types/agents/argument-text.d.ts +9 -0
- package/lib/types/agents/contract.d.ts +50 -0
- package/lib/types/agents/definition.d.ts +38 -0
- package/lib/types/agents/known-agents.d.ts +52 -0
- package/lib/types/agents/launch.d.ts +26 -0
- package/lib/types/agents/preferences.d.ts +40 -0
- package/lib/types/agents/status/agent-status.d.ts +38 -0
- package/lib/types/capabilities/contract.d.ts +17 -0
- package/lib/types/client/agents/AddAgentForm.d.ts +10 -0
- package/lib/types/client/agents/AgentRow.d.ts +11 -0
- package/lib/types/client/agents/AgentsSection.d.ts +14 -0
- package/lib/types/client/agents/acryl-logo-data.d.ts +3 -0
- package/lib/types/client/agents/agent-draft.d.ts +24 -0
- package/lib/types/client/agents/agents-api.d.ts +18 -0
- package/lib/types/client/agents/agents-section-model.d.ts +45 -0
- package/lib/types/client/agents/agents-settings-plugin.d.ts +8 -0
- package/lib/types/client/agents/agents-state.d.ts +26 -0
- package/lib/types/client/agents/controls.d.ts +40 -0
- package/lib/types/client/board/NoteColumn.d.ts +17 -0
- package/lib/types/client/board/SessionBoardPane.d.ts +16 -0
- package/lib/types/client/board/board-model.d.ts +36 -0
- package/lib/types/client/browser/BrowserPane.d.ts +28 -0
- package/lib/types/client/canvas/SplitDivider.d.ts +9 -0
- package/lib/types/client/canvas/WorkspaceCanvas.d.ts +78 -0
- package/lib/types/client/canvas/groups.d.ts +47 -0
- package/lib/types/client/canvas/persist.d.ts +17 -0
- package/lib/types/client/canvas/persistence.d.ts +78 -0
- package/lib/types/client/canvas/shell-requests.d.ts +16 -0
- package/lib/types/client/canvas/split-ratio.d.ts +12 -0
- package/lib/types/client/canvas/state.d.ts +181 -0
- package/lib/types/client/canvas/tab-title.d.ts +7 -0
- package/lib/types/client/capabilities/capabilities-api.d.ts +8 -0
- package/lib/types/client/changes/ChangesBody.d.ts +14 -0
- package/lib/types/client/changes/changes-tab.d.ts +20 -0
- package/lib/types/client/chat/chat-selection.d.ts +70 -0
- package/lib/types/client/chat/composer-focus.d.ts +16 -0
- package/lib/types/client/checks/ChecksBody.d.ts +9 -0
- package/lib/types/client/checks/checks-tab.d.ts +12 -0
- package/lib/types/client/chrome/StatusLine.d.ts +11 -0
- package/lib/types/client/chrome/panel-icons.d.ts +16 -0
- package/lib/types/client/chrome/status-line.d.ts +19 -0
- package/lib/types/client/chrome/worktree-agents.d.ts +13 -0
- package/lib/types/client/comments/CommentsBody.d.ts +24 -0
- package/lib/types/client/comments/comment-store.d.ts +38 -0
- package/lib/types/client/comments/comments-tab.d.ts +14 -0
- package/lib/types/client/comments/editor-comments.d.ts +6 -0
- package/lib/types/client/comments/terminal-targets.d.ts +35 -0
- package/lib/types/client/comments/use-comments.d.ts +27 -0
- package/lib/types/client/connection/session-banner.d.ts +51 -0
- package/lib/types/client/diff/GitDiffPane.d.ts +27 -0
- package/lib/types/client/diff/TextDiffPane.d.ts +6 -0
- package/lib/types/client/diff/comment-message.d.ts +29 -0
- package/lib/types/client/diff/diff-layout.d.ts +4 -0
- package/lib/types/client/diff/line-diff.d.ts +14 -0
- package/lib/types/client/diff/unified-diff.d.ts +31 -0
- package/lib/types/client/dock/DockButtons.d.ts +19 -0
- package/lib/types/client/dock/DockColumns.d.ts +21 -0
- package/lib/types/client/dock/DockDivider.d.ts +13 -0
- package/lib/types/client/dock/TerminalDockPanel.d.ts +13 -0
- package/lib/types/client/dock/dock-controller.d.ts +55 -0
- package/lib/types/client/dock/dock-hooks.d.ts +6 -0
- package/lib/types/client/dock/dock-host.d.ts +14 -0
- package/lib/types/client/dock/dock-icons.d.ts +10 -0
- package/lib/types/client/dock/dock-model.d.ts +35 -0
- package/lib/types/client/dock/dock-tabs.d.ts +72 -0
- package/lib/types/client/dock/terminal-stack.d.ts +19 -0
- package/lib/types/client/docs/DocFilePane.d.ts +12 -0
- package/lib/types/client/docs/DocPane.d.ts +6 -0
- package/lib/types/client/docs/DocView.d.ts +5 -0
- package/lib/types/client/docs/doc-format.d.ts +46 -0
- package/lib/types/client/dom/find-by-name.d.ts +18 -0
- package/lib/types/client/files/CodeEditor.d.ts +19 -0
- package/lib/types/client/files/FileBreadcrumbs.d.ts +15 -0
- package/lib/types/client/files/FileEditorPane.d.ts +12 -0
- package/lib/types/client/files/FileTree.d.ts +25 -0
- package/lib/types/client/files/FilesBody.d.ts +14 -0
- package/lib/types/client/files/ScratchFilePane.d.ts +6 -0
- package/lib/types/client/files/breadcrumbs.d.ts +18 -0
- package/lib/types/client/files/file-edit.d.ts +20 -0
- package/lib/types/client/files/file-icons.d.ts +17 -0
- package/lib/types/client/files/files-api.d.ts +26 -0
- package/lib/types/client/files/files-tab.d.ts +25 -0
- package/lib/types/client/files/line-comment.d.ts +26 -0
- package/lib/types/client/files/line-comments.d.ts +48 -0
- package/lib/types/client/files/tree-model.d.ts +60 -0
- package/lib/types/client/git/git-api.d.ts +35 -0
- package/lib/types/client/index.d.ts +28 -0
- package/lib/types/client/models/ModelConnect.d.ts +13 -0
- package/lib/types/client/models/model-connect.d.ts +145 -0
- package/lib/types/client/notifications/Toasts.d.ts +6 -0
- package/lib/types/client/notifications/system-notice.d.ts +19 -0
- package/lib/types/client/notifications/toast-state.d.ts +29 -0
- package/lib/types/client/palette/CommandPalette.d.ts +9 -0
- package/lib/types/client/palette/PalettePanel.d.ts +10 -0
- package/lib/types/client/palette/file-search.d.ts +9 -0
- package/lib/types/client/palette/fuzzy.d.ts +15 -0
- package/lib/types/client/palette/palette-commands.d.ts +64 -0
- package/lib/types/client/palette/palette-config.d.ts +21 -0
- package/lib/types/client/palette/palette-items.d.ts +40 -0
- package/lib/types/client/palette/palette-settings-plugin.d.ts +8 -0
- package/lib/types/client/palette/palette-shortcut.d.ts +10 -0
- package/lib/types/client/palette/palette-state.d.ts +68 -0
- package/lib/types/client/palette/use-workspace-palette.d.ts +39 -0
- package/lib/types/client/projects/NewWorkspaceDialog.d.ts +21 -0
- package/lib/types/client/projects/ProjectsSidebar.d.ts +39 -0
- package/lib/types/client/projects/RepoSection.d.ts +29 -0
- package/lib/types/client/projects/WorkspaceStrip.d.ts +14 -0
- package/lib/types/client/projects/projects-control.d.ts +119 -0
- package/lib/types/client/projects/registry-api.d.ts +22 -0
- package/lib/types/client/projects/registry-state.d.ts +67 -0
- package/lib/types/client/projects/shown-workspace.d.ts +19 -0
- package/lib/types/client/projects/sidebar-model.d.ts +113 -0
- package/lib/types/client/projects/upstream-panels.d.ts +54 -0
- package/lib/types/client/projects/web-folder-picker.d.ts +13 -0
- package/lib/types/client/review/ReviewBody.d.ts +9 -0
- package/lib/types/client/review/review-store.d.ts +46 -0
- package/lib/types/client/review/review-tab.d.ts +15 -0
- package/lib/types/client/sessions/agent-bridge.d.ts +20 -0
- package/lib/types/client/sessions/main-session.d.ts +24 -0
- package/lib/types/client/sessions/running-agents.d.ts +9 -0
- package/lib/types/client/sessions/session-client.d.ts +22 -0
- package/lib/types/client/sessions/session-navigation.d.ts +63 -0
- package/lib/types/client/sessions/session-pick.d.ts +15 -0
- package/lib/types/client/settings/locales.d.ts +5 -0
- package/lib/types/client/settings/open-settings.d.ts +37 -0
- package/lib/types/client/settings/section-plugin.d.ts +39 -0
- package/lib/types/client/settings/styles.d.ts +3 -0
- package/lib/types/client/shared-context/BriefTab.d.ts +21 -0
- package/lib/types/client/shared-context/brief-api.d.ts +9 -0
- package/lib/types/client/status/agent-status-api.d.ts +10 -0
- package/lib/types/client/status/agent-status-state.d.ts +27 -0
- package/lib/types/client/status/attention-model.d.ts +20 -0
- package/lib/types/client/styles.d.ts +2 -0
- package/lib/types/client/tabs/AgentIcon.d.ts +12 -0
- package/lib/types/client/tabs/NewTabMenu.d.ts +42 -0
- package/lib/types/client/tabs/TabActivity.d.ts +7 -0
- package/lib/types/client/tabs/TabStrip.d.ts +53 -0
- package/lib/types/client/tabs/TabsPanel.d.ts +14 -0
- package/lib/types/client/tabs/agent-marks.d.ts +9 -0
- package/lib/types/client/tabs/agent-visibility.d.ts +11 -0
- package/lib/types/client/tabs/last-tab.d.ts +15 -0
- package/lib/types/client/tabs/registry/CustomTabPane.d.ts +13 -0
- package/lib/types/client/tabs/registry/provide.d.ts +11 -0
- package/lib/types/client/tabs/registry/tab-registry.d.ts +52 -0
- package/lib/types/client/tabs/tab-close.d.ts +4 -0
- package/lib/types/client/tabs/tab-scroll.d.ts +19 -0
- package/lib/types/client/tabs/tab-types-state.d.ts +24 -0
- package/lib/types/client/tabs/tabs-settings-plugin.d.ts +9 -0
- package/lib/types/client/terminal/PtyPane.d.ts +8 -0
- package/lib/types/client/terminal/TerminalSearchBar.d.ts +7 -0
- package/lib/types/client/terminal/agent-commands.d.ts +15 -0
- package/lib/types/client/terminal/gpu-renderer.d.ts +10 -0
- package/lib/types/client/terminal/pty-api.d.ts +21 -0
- package/lib/types/client/terminal/pty-stream.d.ts +46 -0
- package/lib/types/client/terminal/terminal-links.d.ts +9 -0
- package/lib/types/client/terminal/terminal-search.d.ts +18 -0
- package/lib/types/client/terminal/terminal-session.d.ts +105 -0
- package/lib/types/client/terminal/terminal-size.d.ts +7 -0
- package/lib/types/client/ui.d.ts +18 -0
- package/lib/types/client/worktrees/shell-polling.d.ts +10 -0
- package/lib/types/client/worktrees/shell-state.d.ts +200 -0
- package/lib/types/files/contract.d.ts +74 -0
- package/lib/types/folder-picker/contract.d.ts +9 -0
- package/lib/types/git/contract.d.ts +136 -0
- package/lib/types/projects/contract.d.ts +82 -0
- package/lib/types/pty/contract.d.ts +52 -0
- package/lib/ui.js +12735 -0
- package/lib/ui.js.map +1 -0
- package/package.json +147 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal dock as one object the frame, the canvas and the palette share: the layout preferences, the
|
|
3
|
+
* per-worktree terminal tabs, and everything that keeps their terminals honest (starting one, closing one,
|
|
4
|
+
* keeping every stream alive while its panel is hidden, dropping a tab whose terminal the Host lost, naming a tab
|
|
5
|
+
* from its shell). Created once at the composition root so the canvas's own terminals and the dock's share one
|
|
6
|
+
* registry.
|
|
7
|
+
*/
|
|
8
|
+
import type { TerminalRegistry } from '../terminal/terminal-session.ts';
|
|
9
|
+
import type { TerminalSize, WorkspacePtyApi } from '../terminal/pty-api.ts';
|
|
10
|
+
import { type DockMode, type DockPrefs, type SideView } from './dock-model.ts';
|
|
11
|
+
import { DockGroups } from './dock-tabs.ts';
|
|
12
|
+
export declare const DOCK_STORAGE_KEY = "acryl-workspace:dock";
|
|
13
|
+
type StorageLike = Pick<Storage, 'getItem' | 'setItem'>;
|
|
14
|
+
export interface DockControllerDeps {
|
|
15
|
+
readonly api: WorkspacePtyApi;
|
|
16
|
+
readonly terminals: TerminalRegistry;
|
|
17
|
+
/** Undefined when browser storage is blocked; the dock then simply is not remembered. */
|
|
18
|
+
readonly storage: StorageLike | undefined;
|
|
19
|
+
readonly setTimer?: (callback: () => void, ms: number) => unknown;
|
|
20
|
+
readonly clearTimer?: (handle: unknown) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare class DockController {
|
|
23
|
+
private readonly deps;
|
|
24
|
+
readonly groups: DockGroups;
|
|
25
|
+
private prefs;
|
|
26
|
+
private readonly listeners;
|
|
27
|
+
private saveTimer;
|
|
28
|
+
private readonly setTimer;
|
|
29
|
+
private readonly clearTimer;
|
|
30
|
+
constructor(deps: DockControllerDeps);
|
|
31
|
+
getPrefs: () => DockPrefs;
|
|
32
|
+
subscribe: (listener: () => void) => (() => void);
|
|
33
|
+
setMode(mode: DockMode): void;
|
|
34
|
+
cycleMode(): void;
|
|
35
|
+
setSideView(sideView: SideView): void;
|
|
36
|
+
setStackedRatio(ratio: number): void;
|
|
37
|
+
setBottomHeight(height: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* Start a shell in the group's worktree as a new tab. The tab appears at once and gets its terminal when the
|
|
40
|
+
* Host answers; a refusal is shown on the tab instead of being thrown.
|
|
41
|
+
*/
|
|
42
|
+
openTab(groupKey: string, cwd: string | undefined, size?: TerminalSize): Promise<void>;
|
|
43
|
+
/** Close a tab and end its terminal; a failing close is ignored (the Host may already have dropped it). */
|
|
44
|
+
closeTab(groupKey: string, tabId: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Keep the dock's terminals alive and saved for as long as the caller wants (one owning effect).
|
|
47
|
+
* @returns disposer; it writes what is pending before it returns.
|
|
48
|
+
*/
|
|
49
|
+
connect(): () => void;
|
|
50
|
+
private update;
|
|
51
|
+
private scheduleSave;
|
|
52
|
+
/** Write the layout and the tabs now. A blocked or full storage is ignored: this is a convenience. */
|
|
53
|
+
flush(): void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Adapts this package's own terminal dock to `acryl-app-shell`'s generic column-wrapper hooks - the shell
|
|
2
|
+
* has no concept of a dock, only that a caller may want to wrap a column (see `AdvancedShellHooks`). */
|
|
3
|
+
import type { AdvancedShellHooks } from '@acryldev/app-shell/client';
|
|
4
|
+
import type { DockHost } from './dock-host.ts';
|
|
5
|
+
/** @param dock - undefined when this surface has no terminal panel (TUI, or Desktop before the first PTY). */
|
|
6
|
+
export declare function dockShellHooks(dock: DockHost | undefined): AdvancedShellHooks;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** What the frame needs to host the dock: the shared controller, the shared terminals, and which worktree is selected. */
|
|
2
|
+
import type { TerminalRegistry } from '../terminal/terminal-session.ts';
|
|
3
|
+
import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
|
|
4
|
+
import type { DockController } from './dock-controller.ts';
|
|
5
|
+
export interface DockHost {
|
|
6
|
+
readonly controller: DockController;
|
|
7
|
+
readonly terminals: TerminalRegistry;
|
|
8
|
+
readonly shell: WorkspaceShellState;
|
|
9
|
+
}
|
|
10
|
+
/** The worktree the dock follows: its tab group key and the directory a new terminal starts in. */
|
|
11
|
+
export declare function useDockTarget(host: DockHost): {
|
|
12
|
+
readonly groupKey: string;
|
|
13
|
+
readonly cwd: string | undefined;
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Small line icons for the dock's buttons. They inherit the text colour. */
|
|
2
|
+
import type { DockMode } from './dock-model.ts';
|
|
3
|
+
export declare function TerminalIcon(): import("react").JSX.Element;
|
|
4
|
+
export declare function BranchIcon(): import("react").JSX.Element;
|
|
5
|
+
/** The icon of a layout: a frame with the terminal panel drawn where that mode puts it. */
|
|
6
|
+
export declare function ModeIcon({ mode }: {
|
|
7
|
+
readonly mode: DockMode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
/** The right panel: a frame with its right column filled, unlike the mode button's line-only layouts. */
|
|
10
|
+
export declare function RightPanelIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal dock's layout preferences: where the terminal panel sits and how big it is. The panel is always
|
|
3
|
+
* visible (owner decision 2026-09-28: PTYs stay reachable, only their layout changes) - pure rules (parsing what
|
|
4
|
+
* was saved, clamping sizes, the cycle of modes) with no page and no storage in them.
|
|
5
|
+
*
|
|
6
|
+
* Three modes, as in the Super Engineering screens the owner pointed to (spec 040 T126):
|
|
7
|
+
* - `stacked`: the right pane keeps its full height; the terminal panel sits under Files, Changes, Review, Checks.
|
|
8
|
+
* - `bottom`: the right pane keeps the full height; the terminal panel sits under the main chat or canvas.
|
|
9
|
+
* - `side`: the right pane shows either the terminals or Files and Changes at full height, with a switcher.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DOCK_MODES: readonly ["stacked", "bottom", "side"];
|
|
12
|
+
export type DockMode = (typeof DOCK_MODES)[number];
|
|
13
|
+
/** What the right pane shows in `side` mode. */
|
|
14
|
+
export type SideView = 'files' | 'terminals';
|
|
15
|
+
export interface DockPrefs {
|
|
16
|
+
readonly mode: DockMode;
|
|
17
|
+
readonly sideView: SideView;
|
|
18
|
+
/** `stacked`: the share of the right pane the terminal panel takes. */
|
|
19
|
+
readonly stackedRatio: number;
|
|
20
|
+
/** `bottom`: the terminal panel's height in px. */
|
|
21
|
+
readonly bottomHeight: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const STACKED_MIN = 0.15;
|
|
24
|
+
export declare const STACKED_MAX = 0.85;
|
|
25
|
+
export declare const BOTTOM_MIN = 120;
|
|
26
|
+
export declare const BOTTOM_MAX = 900;
|
|
27
|
+
export declare const DEFAULT_DOCK_PREFS: DockPrefs;
|
|
28
|
+
export declare const clampStackedRatio: (ratio: number) => number;
|
|
29
|
+
export declare const clampBottomHeight: (height: number) => number;
|
|
30
|
+
/** @param value - parsed JSON of unknown shape; anything unreadable gives the defaults field by field. */
|
|
31
|
+
export declare function parseDockPrefs(value: unknown): DockPrefs;
|
|
32
|
+
/** The mode the layout button switches to next: stacked, then bottom, then side, then back. */
|
|
33
|
+
export declare function nextMode(mode: DockMode): DockMode;
|
|
34
|
+
/** The button's tooltip names where it would move the terminals, like the reference screens do. */
|
|
35
|
+
export declare function switchLabel(mode: DockMode): string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminal dock's tabs for one worktree: a small list of shell terminals, one active, each bound to a Host
|
|
3
|
+
* terminal. Observable and immutable-snapshot like the canvas state, and saved by the terminal's id so a reload
|
|
4
|
+
* reattaches to the exact screen.
|
|
5
|
+
*/
|
|
6
|
+
export interface DockTab {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
/** The Host terminal this tab shows; absent while it is starting. */
|
|
10
|
+
readonly terminalId?: string;
|
|
11
|
+
/** Why it could not start. */
|
|
12
|
+
readonly error?: string;
|
|
13
|
+
/** The last title taken from the shell's own title, so a title the user typed is never overwritten. */
|
|
14
|
+
readonly autoTitle?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface DockTabsSnapshot {
|
|
17
|
+
readonly tabs: readonly DockTab[];
|
|
18
|
+
readonly activeId: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare const MAX_DOCK_TABS = 12;
|
|
21
|
+
export declare class DockTabsState {
|
|
22
|
+
private readonly createId;
|
|
23
|
+
private snapshot;
|
|
24
|
+
private readonly listeners;
|
|
25
|
+
constructor(createId?: () => string);
|
|
26
|
+
getSnapshot: () => DockTabsSnapshot;
|
|
27
|
+
subscribe: (listener: () => void) => (() => void);
|
|
28
|
+
/** @returns the new tab, or undefined at the limit. Titles count up: Terminal, Terminal 2, Terminal 3. */
|
|
29
|
+
add(): DockTab | undefined;
|
|
30
|
+
select(id: string): void;
|
|
31
|
+
update(id: string, patch: Partial<Omit<DockTab, 'id'>>): void;
|
|
32
|
+
/** @returns the removed tab so the caller can end its terminal. The neighbour to the left becomes active. */
|
|
33
|
+
close(id: string): DockTab | undefined;
|
|
34
|
+
rename(id: string, raw: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* A shell set its terminal's title. Deliberately a no-op (see the matching WorkspaceState.applyTerminalTitle):
|
|
37
|
+
* shells commonly set this to `user@host: cwd`, too long for a narrow tab strip, so a dock tab keeps its short
|
|
38
|
+
* default name ("Terminal", "Terminal 2", ...) instead of following it.
|
|
39
|
+
* @returns true when the title changed.
|
|
40
|
+
*/
|
|
41
|
+
applyTerminalTitle(_terminalId: string, _raw: string): boolean;
|
|
42
|
+
/** Re-create tabs saved by a previous run. */
|
|
43
|
+
restore(saved: readonly {
|
|
44
|
+
readonly title: string;
|
|
45
|
+
readonly terminalId: string;
|
|
46
|
+
}[], activeIndex: number): void;
|
|
47
|
+
private nextTitle;
|
|
48
|
+
private replace;
|
|
49
|
+
}
|
|
50
|
+
/** One dock tab list per worktree, created on first use and restored from what was saved. */
|
|
51
|
+
export declare class DockGroups {
|
|
52
|
+
private readonly saved;
|
|
53
|
+
private readonly createId?;
|
|
54
|
+
private readonly states;
|
|
55
|
+
private readonly listeners;
|
|
56
|
+
constructor(saved?: Readonly<Record<string, SavedDockGroup>>, createId?: (() => string) | undefined);
|
|
57
|
+
stateFor(key: string): DockTabsState;
|
|
58
|
+
keys(): readonly string[];
|
|
59
|
+
onChange(listener: () => void): () => void;
|
|
60
|
+
private notify;
|
|
61
|
+
}
|
|
62
|
+
export interface SavedDockGroup {
|
|
63
|
+
readonly tabs: readonly {
|
|
64
|
+
readonly title: string;
|
|
65
|
+
readonly terminalId: string;
|
|
66
|
+
}[];
|
|
67
|
+
readonly active: number;
|
|
68
|
+
}
|
|
69
|
+
/** @returns the tabs of every group that has a started terminal, as JSON-ready data. */
|
|
70
|
+
export declare function serializeDockGroups(groups: DockGroups): Record<string, SavedDockGroup>;
|
|
71
|
+
/** @param value - parsed JSON of unknown shape. Bad entries are dropped, never repaired. */
|
|
72
|
+
export declare function parseSavedDockGroups(value: unknown): Record<string, SavedDockGroup>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The terminals the whole workspace shares: the Host connection, the live terminal registry, and the dock that
|
|
3
|
+
* uses them. Created once at the composition root and owned by one effect, so the canvas's terminal tabs and the
|
|
4
|
+
* dock's terminals share streams and end together when the plugin does.
|
|
5
|
+
*/
|
|
6
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
7
|
+
import { WorkspacePtyClient } from '../sessions/session-client.ts';
|
|
8
|
+
import { TerminalRegistry } from '../terminal/terminal-session.ts';
|
|
9
|
+
import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
|
|
10
|
+
import { DockController } from './dock-controller.ts';
|
|
11
|
+
import type { DockHost } from './dock-host.ts';
|
|
12
|
+
export interface TerminalStack {
|
|
13
|
+
readonly ptyClient: WorkspacePtyClient;
|
|
14
|
+
readonly terminals: TerminalRegistry;
|
|
15
|
+
readonly dock: DockController;
|
|
16
|
+
readonly host: DockHost;
|
|
17
|
+
}
|
|
18
|
+
/** @param storage - where the dock's layout and tabs are remembered (undefined when blocked). */
|
|
19
|
+
export declare function createTerminalStack(ctx: ClientContext, storage: Pick<Storage, 'getItem' | 'setItem'> | undefined, shell: WorkspaceShellState): TerminalStack;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The Doc tab for one real markdown file: read-only, rendered, and kept current while an agent edits it. */
|
|
2
|
+
import type { WorkspaceTile } from '../canvas/state.ts';
|
|
3
|
+
import type { WorkspaceFilesApi } from '../files/files-api.ts';
|
|
4
|
+
import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
|
|
5
|
+
export interface DocFilePaneProps {
|
|
6
|
+
readonly tile: WorkspaceTile;
|
|
7
|
+
readonly shell: WorkspaceShellState;
|
|
8
|
+
readonly filesApi: WorkspaceFilesApi;
|
|
9
|
+
/** How often the file is checked for changes. */
|
|
10
|
+
readonly pollMs?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function DocFilePane({ tile, shell, filesApi, pollMs }: DocFilePaneProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The scratch doc tab: markdown source beside its rendered preview. */
|
|
2
|
+
import type { WorkspaceState, WorkspaceTile } from '../canvas/state.ts';
|
|
3
|
+
export declare function DocPane({ tile, workspace, }: {
|
|
4
|
+
tile: WorkspaceTile;
|
|
5
|
+
workspace: WorkspaceState;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Renders parsed markdown blocks as real elements. Shared by the scratch Doc tile and the file-backed one. */
|
|
2
|
+
import { type DocBlock } from './doc-format.ts';
|
|
3
|
+
export declare function DocView({ blocks }: {
|
|
4
|
+
readonly blocks: readonly DocBlock[];
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dependency-free, safe markdown for the Doc tile: headings, paragraphs, bullet and numbered lists, block
|
|
3
|
+
* quotes, fenced code, tables, rules, and inline bold, italic, code and links. Blocks and inline segments are
|
|
4
|
+
* data the component renders as real elements (never `dangerouslySetInnerHTML`), and a link only becomes a
|
|
5
|
+
* link for `http(s)` and `mailto`, so nothing here is an XSS surface. Not a full CommonMark engine; a real
|
|
6
|
+
* library is a legitimate later upgrade with no change to the tile's contract.
|
|
7
|
+
*/
|
|
8
|
+
export type DocBlock = {
|
|
9
|
+
readonly kind: 'heading';
|
|
10
|
+
readonly level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
11
|
+
readonly text: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: 'bullet';
|
|
14
|
+
readonly items: readonly string[];
|
|
15
|
+
} | {
|
|
16
|
+
readonly kind: 'ordered';
|
|
17
|
+
readonly items: readonly string[];
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: 'quote';
|
|
20
|
+
readonly text: string;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: 'code';
|
|
23
|
+
readonly language: string;
|
|
24
|
+
readonly text: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'table';
|
|
27
|
+
readonly header: readonly string[];
|
|
28
|
+
readonly rows: readonly (readonly string[])[];
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: 'rule';
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'paragraph';
|
|
33
|
+
readonly text: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function parseDoc(text: string): readonly DocBlock[];
|
|
36
|
+
/** Inline markup as plain data. `code` and `href` appear only when set, so plain text stays `{ text, bold, italic }`. */
|
|
37
|
+
export interface InlineSegment {
|
|
38
|
+
readonly text: string;
|
|
39
|
+
readonly bold: boolean;
|
|
40
|
+
readonly italic: boolean;
|
|
41
|
+
readonly code?: true;
|
|
42
|
+
readonly href?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A link target that is safe to put in an anchor: http, https or mailto. Anything else is shown as text. */
|
|
45
|
+
export declare function safeHref(target: string): string | undefined;
|
|
46
|
+
export declare function parseInline(text: string): readonly InlineSegment[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding a button in the page by its accessible name, what the Settings trigger lookup needs (spec 041
|
|
3
|
+
* T040: replace ad hoc DOM-click helpers with one shared, tested rule instead of each reading `aria-label`
|
|
4
|
+
* by hand). Deliberately small: `aria-label`, else the button's own trimmed text — the two cases every
|
|
5
|
+
* control ACRYL's own code has ever needed to find this way. A caller that needs the fuller ARIA
|
|
6
|
+
* accessible-name algorithm (labelled inputs, `aria-labelledby`, roles other than button) has that in
|
|
7
|
+
* `acryl-agent-control`'s driver; this stays a workspace-local primitive so the two packages do not depend
|
|
8
|
+
* on each other for one function.
|
|
9
|
+
*/
|
|
10
|
+
/** @returns the trimmed `aria-label`, or the element's own trimmed text when it has none. */
|
|
11
|
+
export declare function accessibleButtonName(button: HTMLButtonElement): string;
|
|
12
|
+
/**
|
|
13
|
+
* @param root - where to search (a scoping element, or the whole document).
|
|
14
|
+
* @param names - accessible names to accept, tried in order; the first match in document order for each wins.
|
|
15
|
+
* @param filter - an extra check a candidate must pass (skip a button that merely shares a name), e.g. by class.
|
|
16
|
+
* @returns the first matching button, or null.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findButtonByName(root: ParentNode, names: readonly string[], filter?: (button: HTMLButtonElement) => boolean): HTMLButtonElement | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A CodeMirror 6 editor: line numbers, folding, search (Mod-f), history, bracket matching and syntax
|
|
3
|
+
* highlighting for the language of the file name, loaded on demand from `@codemirror/language-data`
|
|
4
|
+
* (all the major languages). The document is owned by the editor; the parent gets each change through
|
|
5
|
+
* `onChange` and remounts the component (new `key`) to load a different text.
|
|
6
|
+
*/
|
|
7
|
+
import { type EditorComments } from './line-comments.ts';
|
|
8
|
+
export interface CodeEditorProps {
|
|
9
|
+
/** The initial text. */
|
|
10
|
+
readonly value: string;
|
|
11
|
+
/** The file name, used to pick the syntax highlighting. */
|
|
12
|
+
readonly filename: string;
|
|
13
|
+
readonly onChange: (text: string) => void;
|
|
14
|
+
readonly onSave: () => void;
|
|
15
|
+
readonly readOnly?: boolean;
|
|
16
|
+
/** Turns on line comments (the "+" beside a line), kept in this list. */
|
|
17
|
+
readonly comments?: EditorComments;
|
|
18
|
+
}
|
|
19
|
+
export declare function CodeEditor({ value, filename, onChange, onSave, readOnly, comments }: CodeEditorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The open file's path above the editor, every part clickable: a folder lists what it holds, the file lists the folder it is in. In the
|
|
3
|
+
* list a folder opens in place (".." goes up), so the whole project can be walked without leaving the editor; a file opens in its tab.
|
|
4
|
+
*/
|
|
5
|
+
import type { WorkspaceFilesApi } from './files-api.ts';
|
|
6
|
+
export interface FileBreadcrumbsProps {
|
|
7
|
+
readonly worktree: string;
|
|
8
|
+
readonly file: string;
|
|
9
|
+
readonly filesApi: Pick<WorkspaceFilesApi, 'tree'>;
|
|
10
|
+
/** Open a file of the same worktree, by its path relative to it. */
|
|
11
|
+
readonly onOpenFile: (file: string) => void;
|
|
12
|
+
/** Appended to the file's part, for example an unsaved marker. */
|
|
13
|
+
readonly suffix?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function FileBreadcrumbs({ worktree, file, filesApi, onOpenFile, suffix }: FileBreadcrumbsProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The editor tab for one real file of a worktree: load, edit, save, with drafts kept when you switch tabs. */
|
|
2
|
+
import type { WorkspaceState, WorkspaceTile } from '../canvas/state.ts';
|
|
3
|
+
import { type WorkspaceFilesApi } from './files-api.ts';
|
|
4
|
+
import type { CommentStore } from '../comments/comment-store.ts';
|
|
5
|
+
export interface FileEditorPaneProps {
|
|
6
|
+
readonly tile: WorkspaceTile;
|
|
7
|
+
readonly workspace: WorkspaceState;
|
|
8
|
+
readonly filesApi: WorkspaceFilesApi;
|
|
9
|
+
/** Where line comments are kept (the workspace's comments); without it the editor offers no comments. */
|
|
10
|
+
readonly comments?: CommentStore;
|
|
11
|
+
}
|
|
12
|
+
export declare function FileEditorPane({ tile, workspace, filesApi, comments }: FileEditorPaneProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Files tab's tree: only the rows in view are drawn, so an opened `node_modules` scrolls as smoothly as a small folder. Folders open
|
|
3
|
+
* with a click, the arrow keys or Enter; a file opens as a tab. A row's actions (open beside, preview, copy its path, new file here,
|
|
4
|
+
* rename, delete) are in its menu: right-click, the "..." button on the row under the pointer, or Shift+F10 / the context-menu key.
|
|
5
|
+
*/
|
|
6
|
+
import { type TreeRow } from './tree-model.ts';
|
|
7
|
+
/** Each row's height in px; the drawing window is computed from it, so it matches `.dshWorkspaceFileRow`'s height. */
|
|
8
|
+
export declare const FILE_ROW_HEIGHT = 24;
|
|
9
|
+
export interface FileTreeActions {
|
|
10
|
+
toggle(path: string): void;
|
|
11
|
+
open(path: string, options?: {
|
|
12
|
+
readonly beside?: boolean;
|
|
13
|
+
}): void;
|
|
14
|
+
preview(path: string): void;
|
|
15
|
+
createIn(dir: string, entry: 'file' | 'dir'): void;
|
|
16
|
+
rename(row: TreeRow): void;
|
|
17
|
+
remove(row: TreeRow): void;
|
|
18
|
+
}
|
|
19
|
+
export interface FileTreeProps {
|
|
20
|
+
readonly rows: readonly TreeRow[];
|
|
21
|
+
/** Absolute worktree path, for "Copy path". */
|
|
22
|
+
readonly worktree: string;
|
|
23
|
+
readonly actions: FileTreeActions;
|
|
24
|
+
}
|
|
25
|
+
export declare function FileTree({ rows, worktree, actions }: FileTreeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Right pane tab: the selected worktree's files as a lazy tree (`FileTree`), with one search field over the whole repository (file names,
|
|
3
|
+
* or text in files). Clicking a file opens it in the editor as a tab.
|
|
4
|
+
*/
|
|
5
|
+
import type { PropsRuntime } from '@acryldev/ui/frame';
|
|
6
|
+
import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
|
|
7
|
+
import type { WorkspaceGitApi } from '../git/git-api.ts';
|
|
8
|
+
import type { WorkspaceFilesApi } from './files-api.ts';
|
|
9
|
+
export type FilesBodyProps = PropsRuntime<'sidebar.right.pane.tab'> & {
|
|
10
|
+
readonly shell: WorkspaceShellState;
|
|
11
|
+
readonly filesApi: WorkspaceFilesApi;
|
|
12
|
+
readonly gitApi: WorkspaceGitApi;
|
|
13
|
+
};
|
|
14
|
+
export declare function FilesBody({ shell, filesApi, gitApi }: FilesBodyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The untitled scratch file tab: a path box and a text area, kept in the tab's own state. */
|
|
2
|
+
import type { WorkspaceState, WorkspaceTile } from '../canvas/state.ts';
|
|
3
|
+
export declare function ScratchFilePane({ tile, workspace, }: {
|
|
4
|
+
tile: WorkspaceTile;
|
|
5
|
+
workspace: WorkspaceState;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The parts of an open file's path in the editor's breadcrumbs, each naming the folder its list shows. */
|
|
2
|
+
export interface Crumb {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
/** The folder this part lists, relative to the worktree (`''` for its root). */
|
|
5
|
+
readonly dir: string;
|
|
6
|
+
/** The file itself (the last part), which lists the folder it is in. */
|
|
7
|
+
readonly file: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** @param worktree - absolute worktree path. @param file - the file, relative to it, `/`-separated. */
|
|
10
|
+
export declare function crumbsFor(worktree: string, file: string): Crumb[];
|
|
11
|
+
/** The folder above `dir`; the root has none. */
|
|
12
|
+
export declare function parentDir(dir: string): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* How many leading parts fold into "..." so the rest fits: none when everything fits, never the file itself.
|
|
15
|
+
* @param widths - each part's width, a part after the first including its separator.
|
|
16
|
+
* @param ellipsis - the width of the "..." part.
|
|
17
|
+
*/
|
|
18
|
+
export declare function foldCount(widths: readonly number[], ellipsis: number, available: number): number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The one inline edit open in the Code tab, and the change it asks the Host for. */
|
|
2
|
+
import type { FileEntryChange } from '../../files/contract.ts';
|
|
3
|
+
/** The name being typed for a new or renamed entry, or a delete waiting for confirmation. */
|
|
4
|
+
export type PendingEdit = {
|
|
5
|
+
readonly type: 'create';
|
|
6
|
+
readonly entry: 'file' | 'dir';
|
|
7
|
+
readonly value: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly type: 'rename';
|
|
10
|
+
readonly file: string;
|
|
11
|
+
readonly value: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly type: 'delete';
|
|
14
|
+
readonly file: string;
|
|
15
|
+
readonly isDir: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** @returns the change to request, or null while a name is still empty (nothing to ask yet). */
|
|
18
|
+
export declare function changeFor(edit: PendingEdit): FileEntryChange | null;
|
|
19
|
+
/** @returns the file to open once a change succeeded: only a newly created file is opened. */
|
|
20
|
+
export declare function fileToOpenAfter(change: FileEntryChange, resultFile: string | null): string | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Line icons for the Files tab: the tree's chevrons, folders and files (tinted by type), and its header actions. They inherit the text colour. */
|
|
2
|
+
export declare function ChevronIcon({ open }: {
|
|
3
|
+
readonly open: boolean;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function FolderIcon({ open }: {
|
|
6
|
+
readonly open: boolean;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
/** @returns the tint for a file name, or undefined for the text colour. */
|
|
9
|
+
export declare function fileTint(name: string): string | undefined;
|
|
10
|
+
export declare function FileIcon({ name }: {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export declare function NewFileIcon(): import("react").JSX.Element;
|
|
14
|
+
export declare function NewFolderIcon(): import("react").JSX.Element;
|
|
15
|
+
export declare function CollapseAllIcon(): import("react").JSX.Element;
|
|
16
|
+
export declare function ReloadIcon(): import("react").JSX.Element;
|
|
17
|
+
export declare function MoreIcon(): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Same-origin browser client for the worktree file routes. */
|
|
2
|
+
import { type FileContentView, type FileEntryChange, type FileEntryChangedView, type FileSavedView, type FilesTreeView } from '../../files/contract.ts';
|
|
3
|
+
/** A save that lost against a change made on disk since the file was read. */
|
|
4
|
+
export declare class FileConflictError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export interface WorkspaceFilesApi {
|
|
8
|
+
/** @param dir - directory relative to the worktree, `''` for its root. */
|
|
9
|
+
tree(worktree: string, dir: string): Promise<FilesTreeView>;
|
|
10
|
+
read(worktree: string, file: string): Promise<FileContentView>;
|
|
11
|
+
/**
|
|
12
|
+
* @param expectedMtimeMs - the `mtimeMs` of the read this text is based on.
|
|
13
|
+
* @throws FileConflictError when the file changed on disk since that read.
|
|
14
|
+
* @throws an Error whose message is fit to show the user for any other refusal.
|
|
15
|
+
*/
|
|
16
|
+
write(worktree: string, file: string, content: string, expectedMtimeMs: number): Promise<FileSavedView>;
|
|
17
|
+
/**
|
|
18
|
+
* Create a file or empty folder, rename or move an entry, or delete a file or empty folder.
|
|
19
|
+
* Never overwrites. @throws an Error whose message is fit to show the user.
|
|
20
|
+
*/
|
|
21
|
+
change(worktree: string, change: FileEntryChange): Promise<FileEntryChangedView>;
|
|
22
|
+
}
|
|
23
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
24
|
+
/** @param fetchImpl - injectable for tests; defaults to the page's fetch. */
|
|
25
|
+
export declare function createWorkspaceFilesApi(fetchImpl?: FetchLike): WorkspaceFilesApi;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The right sidebar's Files tab: ACRYL's tree, a dependency-gated child plugin like the Changes, Review and Checks tabs. */
|
|
2
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { WorkspaceShellState } from '../worktrees/shell-state.ts';
|
|
4
|
+
import type { WorkspaceGitApi } from '../git/git-api.ts';
|
|
5
|
+
import type { WorkspaceFilesApi } from './files-api.ts';
|
|
6
|
+
/**
|
|
7
|
+
* DSH's own Files tab kind (`ui-sidebar-files`). In the advanced shell ACRYL's tree takes it over at the `extension` band, which the tab
|
|
8
|
+
* registry lets shadow a `builtin` of the same kind until it unregisters: one Files tab, whose files open in ACRYL's editor (breadcrumbs,
|
|
9
|
+
* line comments) rather than DSH's read-only preview, and DSH's start-page entry and `workspace.files` command lead to it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DSH_FILES_KIND = "files";
|
|
12
|
+
/** The kind ACRYL's tree had before the takeover; still registered (with no start-page entry) so a tab the user kept open still shows. */
|
|
13
|
+
export declare const FILES_KIND = "worktree-files";
|
|
14
|
+
export declare const FILES_ID = "@acryldev/workspace/files";
|
|
15
|
+
export declare const FILES_TAKEOVER_ID = "@acryldev/workspace/files-takeover";
|
|
16
|
+
/**
|
|
17
|
+
* PENDING (not failed) while the upstream right sidebar is absent; every registration unwinds together.
|
|
18
|
+
* @param takeOver - the advanced shell: ACRYL's tree replaces DSH's Files tab. Compatibility mode runs DSH's own client unchanged, so
|
|
19
|
+
* there the tree stays a separate "Code" tab.
|
|
20
|
+
*/
|
|
21
|
+
export declare function filesTabPlugin(shell: WorkspaceShellState, filesApi: WorkspaceFilesApi, gitApi: WorkspaceGitApi, takeOver?: boolean): {
|
|
22
|
+
name: string;
|
|
23
|
+
inject: string[];
|
|
24
|
+
apply(ctx: ClientContext): void;
|
|
25
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A comment on lines of a file, as an agent reads it: which file (relative and absolute, so the agent finds it from any folder), which
|
|
3
|
+
* lines with their text, then the comment. The same text is copied to the clipboard and typed into a terminal, as a paste that is not
|
|
4
|
+
* submitted, so several comments can be collected and sent with one Enter.
|
|
5
|
+
*/
|
|
6
|
+
export interface LineComment {
|
|
7
|
+
/** Absolute worktree path. */
|
|
8
|
+
readonly worktree: string;
|
|
9
|
+
/** The file, relative to the worktree, `/`-separated. */
|
|
10
|
+
readonly file: string;
|
|
11
|
+
/** First and last commented line, 1-based. */
|
|
12
|
+
readonly fromLine: number;
|
|
13
|
+
readonly toLine: number;
|
|
14
|
+
/** The commented lines' text, `fromLine` first. */
|
|
15
|
+
readonly lines: readonly string[];
|
|
16
|
+
readonly text: string;
|
|
17
|
+
}
|
|
18
|
+
/** How many commented lines are quoted; a longer range is cut with a note (the agent can open the file). */
|
|
19
|
+
export declare const QUOTED_LINES = 12;
|
|
20
|
+
/**
|
|
21
|
+
* @param multiline - the terminal takes a multi-line paste (bracketed paste is on). Without it the comment is one line, because each line
|
|
22
|
+
* break would press Enter and a shell would run the lines.
|
|
23
|
+
*/
|
|
24
|
+
export declare function commentForTerminal(comment: LineComment, multiline: boolean): string;
|
|
25
|
+
/** Several comments as one text: a blank line between them, or one after another on one line for a terminal that would run each line. */
|
|
26
|
+
export declare function commentsForTerminal(comments: readonly LineComment[], multiline: boolean): string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line comments in the code editor: a "+" beside the line under the pointer opens a comment form under that line (or under the selected
|
|
3
|
+
* lines, when the selection covers it). Comment keeps it: it goes to the caller's list (`EditorComments`) and shows as a note under its
|
|
4
|
+
* lines, and nothing is sent anywhere. The note copies itself, or every comment, to the clipboard, or closes; each of these ends the
|
|
5
|
+
* comment. The notes are the list's, so a comment used from the Comments page closes here too. Positions follow edits to the document,
|
|
6
|
+
* and the list is told where its comments moved.
|
|
7
|
+
*/
|
|
8
|
+
import { type Extension } from '@codemirror/state';
|
|
9
|
+
import { EditorView } from '@codemirror/view';
|
|
10
|
+
export interface CommentRequest {
|
|
11
|
+
readonly fromLine: number;
|
|
12
|
+
readonly toLine: number;
|
|
13
|
+
readonly lines: readonly string[];
|
|
14
|
+
readonly text: string;
|
|
15
|
+
}
|
|
16
|
+
/** One kept comment of this file, as the list has it. */
|
|
17
|
+
export interface CommentNote {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly fromLine: number;
|
|
20
|
+
readonly toLine: number;
|
|
21
|
+
readonly text: string;
|
|
22
|
+
}
|
|
23
|
+
export type CopyResult = {
|
|
24
|
+
readonly ok: true;
|
|
25
|
+
} | {
|
|
26
|
+
readonly ok: false;
|
|
27
|
+
readonly message: string;
|
|
28
|
+
};
|
|
29
|
+
/** The list the editor's comments live in (the workspace's comments, narrowed to this file). */
|
|
30
|
+
export interface EditorComments {
|
|
31
|
+
/** This file's comments. */
|
|
32
|
+
readonly notes: () => readonly CommentNote[];
|
|
33
|
+
/** @returns disposer. */
|
|
34
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
35
|
+
readonly add: (request: CommentRequest) => void;
|
|
36
|
+
/** The commented lines moved while the file was edited. */
|
|
37
|
+
readonly move: (id: string, fromLine: number, toLine: number) => void;
|
|
38
|
+
/** Close it without using it. */
|
|
39
|
+
readonly close: (id: string) => void;
|
|
40
|
+
/** Copy this comment to the clipboard, which ends it. */
|
|
41
|
+
readonly copy: (id: string) => Promise<CopyResult>;
|
|
42
|
+
/** Copy every comment of the worktree to the clipboard, which ends them all. */
|
|
43
|
+
readonly copyAll: () => Promise<CopyResult>;
|
|
44
|
+
}
|
|
45
|
+
/** The editor extension; `list` keeps the comments. */
|
|
46
|
+
export declare function lineComments(list: EditorComments): Extension;
|
|
47
|
+
/** Test seam: open the comment form on a line, as the "+" does. @param line - 1-based. */
|
|
48
|
+
export declare function commentOnLine(view: EditorView, line: number): void;
|