deck-plugin-sdk 1.11.1 → 1.12.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.
- package/package.json +1 -1
- package/permissions.json +1 -1
- package/shim/p2p.d.ts +1 -1
- package/shim/settings.d.ts +1 -1
- package/shim/terminals.d.ts +1 -1
- package/shim/ui.d.ts +10 -10
- package/template/plugin.json +1 -1
- package/types/components/FileIcon.d.ts +1 -1
- package/types/components/TabStrip.d.ts +5 -2
- package/types/core/{settingsstore.d.ts → app/settingsstore.d.ts} +1 -1
- package/types/core/bridge.d.ts +6 -6
- package/types/core/{bookmarks.d.ts → browser/bookmarks.d.ts} +4 -2
- package/types/core/{browser.d.ts → browser/browser.d.ts} +1 -1
- package/types/core/{editorsettings.d.ts → editor/editorsettings.d.ts} +1 -1
- package/types/core/{icontheme.d.ts → editor/icontheme.d.ts} +1 -1
- package/types/core/workspaces/layout.d.ts +168 -0
- package/types/core/workspaces/terminals.d.ts +252 -0
- package/types/core/workspaces/zones.d.ts +215 -0
- package/types/modules/editor/MonacoHosts.d.ts +3 -3
- package/types/modules/editor/{DiffPeek.d.ts → git/DiffPeek.d.ts} +1 -1
- package/types/modules/editor/models.d.ts +1 -1
- package/types/modules/editor/{tree.d.ts → tree/tree.d.ts} +1 -1
- package/types/core/terminals.d.ts +0 -573
- /package/types/core/{p2p.d.ts → app/p2p.d.ts} +0 -0
- /package/types/core/{theme.d.ts → app/theme.d.ts} +0 -0
- /package/types/core/{timeFormat.d.ts → app/timeFormat.d.ts} +0 -0
- /package/types/core/{browserurl.d.ts → browser/browserurl.d.ts} +0 -0
- /package/types/core/{dap.d.ts → editor/dap.d.ts} +0 -0
- /package/types/core/{debugtargets.d.ts → editor/debugtargets.d.ts} +0 -0
- /package/types/core/{decode.d.ts → editor/decode.d.ts} +0 -0
- /package/types/core/{editorsession.d.ts → editor/editorsession.d.ts} +0 -0
- /package/types/core/{inlay.d.ts → editor/inlay.d.ts} +0 -0
- /package/types/core/{langmap.d.ts → editor/langmap.d.ts} +0 -0
- /package/types/core/{lsp.d.ts → editor/lsp.d.ts} +0 -0
- /package/types/core/{monaco.d.ts → editor/monaco.d.ts} +0 -0
- /package/types/core/{patterntokens.d.ts → editor/patterntokens.d.ts} +0 -0
- /package/types/core/{snippets.d.ts → editor/snippets.d.ts} +0 -0
- /package/types/core/{treehide.d.ts → editor/treehide.d.ts} +0 -0
- /package/types/core/{keys.d.ts → keys/keys.d.ts} +0 -0
- /package/types/core/{keystore.d.ts → keys/keystore.d.ts} +0 -0
- /package/types/core/{notifications.d.ts → notifications/notifications.d.ts} +0 -0
- /package/types/core/{notifyapi.d.ts → notifications/notifyapi.d.ts} +0 -0
- /package/types/core/{fileview.d.ts → plugins/fileview.d.ts} +0 -0
- /package/types/core/{portal.d.ts → workspaces/portal.d.ts} +0 -0
- /package/types/core/{remotepath.d.ts → workspaces/remotepath.d.ts} +0 -0
- /package/types/core/{shellpath.d.ts → workspaces/shellpath.d.ts} +0 -0
- /package/types/core/{windows.d.ts → workspaces/windows.d.ts} +0 -0
- /package/types/modules/editor/{diffline.d.ts → git/diffline.d.ts} +0 -0
- /package/types/modules/editor/{hunks.d.ts → git/hunks.d.ts} +0 -0
- /package/types/modules/editor/{MarkdownLive.d.ts → viewers/MarkdownLive.d.ts} +0 -0
- /package/types/modules/editor/{viewers.d.ts → viewers/viewers.d.ts} +0 -0
package/package.json
CHANGED
package/permissions.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generated": "by sdk/gen-permissions.mjs from src/core/permissions.ts; do not edit",
|
|
2
|
+
"generated": "by sdk/gen-permissions.mjs from src/core/plugins/permissions.ts; do not edit",
|
|
3
3
|
"permissions": {
|
|
4
4
|
"files": "Read and change files anywhere on this PC",
|
|
5
5
|
"processes": "Run programs and commands",
|
package/shim/p2p.d.ts
CHANGED
package/shim/settings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-shim.mjs — do not edit.
|
|
2
2
|
//
|
|
3
3
|
// Deck's real settings types, so a plugin is checked against the actual shape.
|
|
4
|
-
export { useSettings, getSettings, saveSettings, userName } from "../types/core/settingsstore";
|
|
4
|
+
export { useSettings, getSettings, saveSettings, userName } from "../types/core/app/settingsstore";
|
|
5
5
|
export type { Settings } from "../types/core/bridge";
|
package/shim/terminals.d.ts
CHANGED
package/shim/ui.d.ts
CHANGED
|
@@ -6,21 +6,21 @@ export * from "../types/components/ConfirmDialog";
|
|
|
6
6
|
export * from "../types/components/NamePrompt";
|
|
7
7
|
export * from "../types/components/ContextMenu";
|
|
8
8
|
export * from "../types/components/Toast";
|
|
9
|
-
export * from "../types/core/notifyapi";
|
|
9
|
+
export * from "../types/core/notifications/notifyapi";
|
|
10
10
|
export * from "../types/components/useResize";
|
|
11
|
-
export * from "../types/modules/editor/MarkdownLive";
|
|
11
|
+
export * from "../types/modules/editor/viewers/MarkdownLive";
|
|
12
12
|
export * from "../types/components/TreeRow";
|
|
13
13
|
export * from "../types/components/dragrow";
|
|
14
14
|
export * from "../types/components/TabStrip";
|
|
15
15
|
export * from "../types/components/MarkdownToolbar";
|
|
16
16
|
export * from "../types/components/ActivityBar";
|
|
17
|
-
export * from "../types/core/editorsettings";
|
|
18
|
-
export * from "../types/core/keystore";
|
|
19
|
-
export * from "../types/modules/editor/viewers";
|
|
17
|
+
export * from "../types/core/editor/editorsettings";
|
|
18
|
+
export * from "../types/core/keys/keystore";
|
|
19
|
+
export * from "../types/modules/editor/viewers/viewers";
|
|
20
20
|
export * from "../types/components/FileIcon";
|
|
21
|
-
export * from "../types/core/icontheme";
|
|
22
|
-
export * from "../types/modules/editor/tree";
|
|
23
|
-
export * from "../types/core/decode";
|
|
24
|
-
export * from "../types/core/keys";
|
|
21
|
+
export * from "../types/core/editor/icontheme";
|
|
22
|
+
export * from "../types/modules/editor/tree/tree";
|
|
23
|
+
export * from "../types/core/editor/decode";
|
|
24
|
+
export * from "../types/core/keys/keys";
|
|
25
25
|
export * from "../types/modules/editor/MonacoHosts";
|
|
26
|
-
export * from "../types/core/fileview";
|
|
26
|
+
export * from "../types/core/plugins/fileview";
|
package/template/plugin.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
-
import { type IconRef } from "../core/icontheme";
|
|
2
|
+
import { type IconRef } from "../core/editor/icontheme";
|
|
3
3
|
export declare function FileIcon({ icon, size, tint }: {
|
|
4
4
|
icon: IconRef;
|
|
5
5
|
size?: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
-
import type
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type MenuEntry } from "./ContextMenu";
|
|
3
4
|
export interface TabItem {
|
|
4
5
|
id: string;
|
|
5
6
|
title: ReactNode;
|
|
@@ -12,7 +13,7 @@ export interface TabItem {
|
|
|
12
13
|
/** Tooltip for the close button; defaults to "Close". */
|
|
13
14
|
closeTitle?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, leading, trailing, pill: pillProp, chip, onAdd, addTitle, }: {
|
|
16
|
+
export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, menu, leading, trailing, pill: pillProp, chip, onAdd, addTitle, }: {
|
|
16
17
|
tabs: readonly TabItem[];
|
|
17
18
|
activeId: string | null;
|
|
18
19
|
onSelect: (id: string) => void;
|
|
@@ -20,6 +21,8 @@ export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder,
|
|
|
20
21
|
/** Moves `from` to `to`'s position. Omit to make the strip non-reorderable. */
|
|
21
22
|
onReorder?: (from: string, to: string) => void;
|
|
22
23
|
onDoubleClick?: (id: string) => void;
|
|
24
|
+
/** A tab's right-click menu. Asked for when it opens, so it reflects the tabs as they are then. */
|
|
25
|
+
menu?: (id: string) => MenuEntry[];
|
|
23
26
|
/** Controls before the first tab. */
|
|
24
27
|
leading?: ReactNode;
|
|
25
28
|
/** Right-aligned controls after the tabs — view toggles, save state. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
-
import { type Settings } from "
|
|
2
|
+
import { type Settings } from "../bridge";
|
|
3
3
|
/** Called by Settings after every write, so readers update without a reload. */
|
|
4
4
|
export declare function publishSettings(s: Settings): void;
|
|
5
5
|
/**
|
package/types/core/bridge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
-
import { type DebugTarget } from "./debugtargets";
|
|
3
|
-
import type { Accent, Background, Density, Palette, TermCustom, TermTheme } from "./theme";
|
|
4
|
-
import type { SearchEngine } from "./browserurl";
|
|
2
|
+
import { type DebugTarget } from "./editor/debugtargets";
|
|
3
|
+
import type { Accent, Background, Density, Palette, TermCustom, TermTheme } from "./app/theme";
|
|
4
|
+
import type { SearchEngine } from "./browser/browserurl";
|
|
5
5
|
/** Open a URL in the default browser. */
|
|
6
6
|
export declare const openExternal: (url: string) => Promise<void>;
|
|
7
7
|
/** A box in physical pixels, relative to the window: where a browser pane's webview goes. */
|
|
@@ -375,7 +375,7 @@ export interface Settings {
|
|
|
375
375
|
drawerHidden: string[];
|
|
376
376
|
/** Drawer tabs left-to-right. Ids missing from it keep their discovery order, after the rest. */
|
|
377
377
|
drawerOrder: string[];
|
|
378
|
-
/** Which side of the footer each drawer tab and readout sits on, in order (core/footerlayout.ts).
|
|
378
|
+
/** Which side of the footer each drawer tab and readout sits on, in order (core/app/footerlayout.ts).
|
|
379
379
|
* Absent until something is moved: drawer tabs left, readouts right, in the orders above. */
|
|
380
380
|
footerLayout?: {
|
|
381
381
|
left: string[];
|
|
@@ -1184,7 +1184,7 @@ export declare const sshTunnelClose: (id: number) => Promise<void>;
|
|
|
1184
1184
|
* Offer programs to the editor's debugger: a plugin that runs something debuggable (the Flutter
|
|
1185
1185
|
* plugin's runs) publishes them here, and the Run and Debug panel lists them to attach to. Pass
|
|
1186
1186
|
* the plugin's whole current list each time, under its own `source`; an empty list removes it.
|
|
1187
|
-
* See core/debugtargets.ts.
|
|
1187
|
+
* See core/editor/debugtargets.ts.
|
|
1188
1188
|
*/
|
|
1189
1189
|
export declare const setDebugTargets: (source: string, targets: DebugTarget[]) => void;
|
|
1190
|
-
export type { DebugTarget } from "./debugtargets";
|
|
1190
|
+
export type { DebugTarget } from "./editor/debugtargets";
|
|
@@ -4,6 +4,8 @@ export interface BookmarkNode {
|
|
|
4
4
|
title: string;
|
|
5
5
|
/** A page has a URL; a folder has children instead. */
|
|
6
6
|
url?: string;
|
|
7
|
+
/** A word that opens it from the tool picker, as a link's does (links.ts). */
|
|
8
|
+
keyword?: string;
|
|
7
9
|
children?: BookmarkNode[];
|
|
8
10
|
}
|
|
9
11
|
export interface Bookmarks {
|
|
@@ -30,8 +32,8 @@ export declare function folders(b: Bookmarks): {
|
|
|
30
32
|
export declare const add: (b: Bookmarks, folder: string, node: BookmarkNode) => Bookmarks;
|
|
31
33
|
/** Remove the node with `id`, wherever it is (a folder goes with what is in it). */
|
|
32
34
|
export declare function remove(b: Bookmarks, id: string): Bookmarks;
|
|
33
|
-
/** Change a node's title or
|
|
34
|
-
export declare function update(b: Bookmarks, id: string, patch: Partial<Pick<BookmarkNode, "title" | "url">>): Bookmarks;
|
|
35
|
+
/** Change a node's title, URL or keyword. */
|
|
36
|
+
export declare function update(b: Bookmarks, id: string, patch: Partial<Pick<BookmarkNode, "title" | "url" | "keyword">>): Bookmarks;
|
|
35
37
|
/** The node with `id`, and the id of the folder it is in. */
|
|
36
38
|
export declare function locate(b: Bookmarks, id: string): {
|
|
37
39
|
node: BookmarkNode;
|
|
@@ -138,7 +138,7 @@ export declare const takeWaitingUrl: () => {
|
|
|
138
138
|
export declare const newBrowserTab: (url?: string, isPrivate?: boolean) => boolean | void;
|
|
139
139
|
/**
|
|
140
140
|
* A browser tab on `url` in a floating window, so the main window's view stays (Terminals'
|
|
141
|
-
* deck-open-float, core/floatwin.ts openInFloat): `name` the window that collects them ("links"
|
|
141
|
+
* deck-open-float, core/workspaces/floatwin.ts openInFloat): `name` the window that collects them ("links"
|
|
142
142
|
* from other programs, "agent" for an agent's pages), `beside` the window a pane is in.
|
|
143
143
|
*/
|
|
144
144
|
export declare function browserInFloat(url: string, where: {
|
|
@@ -115,6 +115,6 @@ export declare function modelOptionsFor(s: EditorSettings, languageId: string |
|
|
|
115
115
|
tabSize: number;
|
|
116
116
|
insertSpaces: boolean;
|
|
117
117
|
};
|
|
118
|
-
/** Whether the file tree shows an entry, under these settings (core/treehide.ts). */
|
|
118
|
+
/** Whether the file tree shows an entry, under these settings (core/editor/treehide.ts). */
|
|
119
119
|
export declare const treeShows: (s: EditorSettings, name: string) => boolean;
|
|
120
120
|
export declare function monacoOptionsFrom(s: EditorSettings): MonacoNS.editor.IEditorOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
2
|
import { type LucideIcon } from "lucide-react";
|
|
3
|
-
import { type ImportedPack } from "
|
|
3
|
+
import { type ImportedPack } from "../bridge";
|
|
4
4
|
export type IconRef = {
|
|
5
5
|
kind: "lucide";
|
|
6
6
|
icon: LucideIcon;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
import { TabGroup } from "./zones";
|
|
3
|
+
export type SplitDir = "h" | "v";
|
|
4
|
+
export type LayoutNode = {
|
|
5
|
+
kind: "leaf";
|
|
6
|
+
id: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
view?: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: "split";
|
|
11
|
+
dir: SplitDir;
|
|
12
|
+
a: LayoutNode;
|
|
13
|
+
b: LayoutNode;
|
|
14
|
+
ratio: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A tab, and — with `x`/`y` — a zone on the canvas.
|
|
18
|
+
*
|
|
19
|
+
* The coordinates are OPTIONAL and nothing writes them on load: a tab saved before zones
|
|
20
|
+
* existed has none, and `zoneAt` places it by its index instead. That keeps every layout ever
|
|
21
|
+
* written valid and means the tab strip and the canvas are two views of one list, not two
|
|
22
|
+
* models to keep in sync.
|
|
23
|
+
*/
|
|
24
|
+
export interface LayoutTab {
|
|
25
|
+
id: string;
|
|
26
|
+
title: string;
|
|
27
|
+
root: LayoutNode;
|
|
28
|
+
x?: number;
|
|
29
|
+
y?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Behind another tab in the same zone. Tabs sharing a cell are one zone, and the one without
|
|
32
|
+
* this flag is the one it shows — so a zone reopens on the tab you left it on. Absent on every
|
|
33
|
+
* tab that has a cell to itself, which is every tab written before zones held several.
|
|
34
|
+
*/
|
|
35
|
+
hidden?: boolean;
|
|
36
|
+
/** The tab group it is in (LayoutWorkspace.groups); a group's tabs sit together in one zone. */
|
|
37
|
+
group?: string;
|
|
38
|
+
/** A colour of its own, an index into GROUP_COLORS: a faint tint behind the tab. */
|
|
39
|
+
color?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Torn off into a window of its own (core/workspaces/floatwin.ts): the window's id. Such a tab is in no
|
|
42
|
+
* zone, though it keeps its x/y to go back to. A restart reopens the window (Layout.floats has
|
|
43
|
+
* where it was).
|
|
44
|
+
*/
|
|
45
|
+
window?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Opened straight into a floating window by Deck (openInFloat: a link, a page an agent opened, a
|
|
48
|
+
* file Ctrl+clicked in a terminal), so closing that window closes it rather than docking it into
|
|
49
|
+
* the main window. Dropped the moment the tab is moved by hand: then it is one of yours.
|
|
50
|
+
*/
|
|
51
|
+
transient?: true;
|
|
52
|
+
}
|
|
53
|
+
export interface LayoutWorkspace {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
cwd: string;
|
|
57
|
+
tabs: LayoutTab[];
|
|
58
|
+
activeTab: string;
|
|
59
|
+
/** Tab groups: a name and colour over tabs that sit together in a zone's row, folded or not. */
|
|
60
|
+
groups?: TabGroup[];
|
|
61
|
+
/** Its colour on the sidebar's collapsed rail, by index (Terminals' TONES); none picks one from the name. */
|
|
62
|
+
color?: number;
|
|
63
|
+
}
|
|
64
|
+
/** Where a floating window was, in physical screen pixels (its size and place before any maximise), to reopen it there. */
|
|
65
|
+
export interface FloatBounds {
|
|
66
|
+
id: string;
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
w: number;
|
|
70
|
+
h: number;
|
|
71
|
+
max?: boolean;
|
|
72
|
+
/** A window things are sent to by name (core/workspaces/floatwin.ts openInFloat): "links", "agent". */
|
|
73
|
+
name?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface Layout {
|
|
76
|
+
workspaces: LayoutWorkspace[];
|
|
77
|
+
activeWs: string;
|
|
78
|
+
floats?: FloatBounds[];
|
|
79
|
+
}
|
|
80
|
+
export declare let currentLayout: Layout | null;
|
|
81
|
+
export declare const layoutSubs: Set<() => void>;
|
|
82
|
+
export declare let notifyQueued: boolean;
|
|
83
|
+
export declare function publishLayout(l: Layout): void;
|
|
84
|
+
export declare function getLayout(): Layout | null;
|
|
85
|
+
export declare const uuid: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
86
|
+
export declare function defaultLayout(): Layout;
|
|
87
|
+
export declare function allLeafIds(l: Layout): string[];
|
|
88
|
+
/** Views that were Deck's own and are now a plugin's, old id to new. */
|
|
89
|
+
export declare const MOVED_VIEWS: Record<string, string>;
|
|
90
|
+
export declare let loadPromise: Promise<void> | null;
|
|
91
|
+
export declare let liveAtLoad: Set<string> | null;
|
|
92
|
+
export declare function loadLayoutOnce(): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* What every layout write leaves true of a workspace: its active tab is one the main window draws
|
|
95
|
+
* (a tab in a floating window is not; going to one leaves the main window on a neighbour), its zone
|
|
96
|
+
* shows it (showActiveTab), a folded group holding it opens (openActiveGroup), and a tab group
|
|
97
|
+
* whose last tab went goes with it (pruneGroups).
|
|
98
|
+
*/
|
|
99
|
+
export declare function tidy(w: LayoutWorkspace): LayoutWorkspace;
|
|
100
|
+
export declare let saveTimer: ReturnType<typeof setTimeout> | undefined;
|
|
101
|
+
export declare function mutateLayout(fn: (l: Layout) => Layout): void;
|
|
102
|
+
export declare function useLayout(): Layout | null;
|
|
103
|
+
export declare function activeWorkspaceCwd(): string;
|
|
104
|
+
/** Switch the active workspace (+ optionally its active tab) — used by agent-notification clicks. */
|
|
105
|
+
export declare function switchWorkspace(wsId: string, tabId?: string): void;
|
|
106
|
+
/** The workspace whose cwd matches (case/slash-insensitive), for routing an agent hook to a tab. */
|
|
107
|
+
export declare function workspaceByCwd(cwd: string): LayoutWorkspace | undefined;
|
|
108
|
+
/** The folder a pane's shell was spawned in — its workspace's cwd. */
|
|
109
|
+
export declare function paneCwd(paneId: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* A pane's display name: its own label, else the title of the tab holding it.
|
|
112
|
+
*
|
|
113
|
+
* Here rather than in the footer that first needed it, because Settings lists the same pinned
|
|
114
|
+
* panes and a second copy of this walk would be a second answer to one question.
|
|
115
|
+
*/
|
|
116
|
+
export declare function paneLabel(paneId: string): string;
|
|
117
|
+
/** Which workspace + tab holds a pane, for jumping to an agent from outside Terminals. */
|
|
118
|
+
export declare function paneLocation(paneId: string): {
|
|
119
|
+
wsId: string;
|
|
120
|
+
wsName: string;
|
|
121
|
+
tabId: string;
|
|
122
|
+
} | undefined;
|
|
123
|
+
export declare const termSpawn: (id: string, cwd: string, cols: number, rows: number) => Promise<void>;
|
|
124
|
+
export declare const termWrite: (id: string, data: string) => Promise<void>;
|
|
125
|
+
export declare const termResize: (id: string, cols: number, rows: number) => Promise<void>;
|
|
126
|
+
export declare const termKill: (id: string) => Promise<void>;
|
|
127
|
+
export declare const termList: () => Promise<string[]>;
|
|
128
|
+
/** Delete scrollback logs for panes not in `keep`. Returns how many were removed. */
|
|
129
|
+
export declare const termSweepScrollback: (keep: string[]) => Promise<number>;
|
|
130
|
+
export declare const termScrollback: (id: string) => Promise<string>;
|
|
131
|
+
export declare const newLeaf: () => LayoutNode;
|
|
132
|
+
export declare function leafIds(n: LayoutNode): string[];
|
|
133
|
+
export declare function splitLeaf(n: LayoutNode, id: string, dir: SplitDir, ratio?: number, view?: string): LayoutNode;
|
|
134
|
+
export declare function setLeafLabel(n: LayoutNode, id: string, label: string): LayoutNode;
|
|
135
|
+
/**
|
|
136
|
+
* Turn a pane into a view, or back into a terminal when `view` is empty.
|
|
137
|
+
*
|
|
138
|
+
* The pane keeps its id, so the layout, the splits around it and its place in the tab are
|
|
139
|
+
* untouched — only what it renders changes. Its label goes with the old contents: a terminal
|
|
140
|
+
* named "server" that becomes a notes pane is not the server any more.
|
|
141
|
+
*/
|
|
142
|
+
export declare function setLeafView(n: LayoutNode, id: string, view: string): LayoutNode;
|
|
143
|
+
export declare function closeLeaf(n: LayoutNode, id: string): LayoutNode | null;
|
|
144
|
+
export declare const baseName: (p: string) => string;
|
|
145
|
+
export type DropSide = "left" | "right" | "top" | "bottom";
|
|
146
|
+
/** The leaf node itself (not just its id) — a move carries the pane's label with it. */
|
|
147
|
+
export declare function findLeaf(n: LayoutNode, id: string): LayoutNode | null;
|
|
148
|
+
/** Replace a leaf with a split holding it and `leaf`, ordered by which side `leaf` lands on. */
|
|
149
|
+
export declare function insertBeside(n: LayoutNode, targetId: string, leaf: LayoutNode, side: DropSide): LayoutNode;
|
|
150
|
+
/**
|
|
151
|
+
* Move a pane next to another within one tab. The leaf keeps its id, so the xterm instance (and
|
|
152
|
+
* therefore the running shell and its scrollback) survives — attach() re-parents it on remount.
|
|
153
|
+
* closeLeaf already collapses the split the pane leaves behind.
|
|
154
|
+
*/
|
|
155
|
+
export declare function moveLeaf(root: LayoutNode, srcId: string, targetId: string, side: DropSide): LayoutNode;
|
|
156
|
+
export declare function newTab(title: string): LayoutTab;
|
|
157
|
+
export declare function newWorkspace(name: string, cwd: string): LayoutWorkspace;
|
|
158
|
+
/**
|
|
159
|
+
* Open a new tab in a workspace and return the id of the pane it contains.
|
|
160
|
+
*
|
|
161
|
+
* applyDtCommand's "new-tab" does the same thing but returns nothing, which is fine for an agent
|
|
162
|
+
* driving Deck over HTTP (it can look the pane up afterwards) and useless in-process, where the
|
|
163
|
+
* caller wants to type into the pane it just made. Pair it with queueInput: the pane has no PTY
|
|
164
|
+
* until it is attached to a sized element, so anything written before then is dropped.
|
|
165
|
+
*/
|
|
166
|
+
export declare function openTabInWorkspace(wsId: string, title: string, opts?: {
|
|
167
|
+
besideActive?: boolean;
|
|
168
|
+
}): string | null;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
import { Terminal } from "@xterm/xterm";
|
|
3
|
+
import { FitAddon } from "@xterm/addon-fit";
|
|
4
|
+
import { LayoutWorkspace } from "./layout";
|
|
5
|
+
export { publishLayout, getLayout, loadLayoutOnce, mutateLayout, useLayout, activeWorkspaceCwd, switchWorkspace, workspaceByCwd, paneCwd, paneLabel, paneLocation, termSpawn, termWrite, termResize, termKill, termList, termSweepScrollback, termScrollback, leafIds, splitLeaf, setLeafLabel, setLeafView, closeLeaf, findLeaf, insertBeside, moveLeaf, openTabInWorkspace } from "./layout";
|
|
6
|
+
export type { SplitDir, LayoutNode, LayoutTab, LayoutWorkspace, FloatBounds, Layout, DropSide } from "./layout";
|
|
7
|
+
export { ZONE_BOARD, zoneAt, zones, zoneOf, zoneToward, moveZone, reorderTab, GROUP_COLORS, addToGroup, leaveGroup, moveGroup, toggleGroupFold, ungroup, setGroup, openActiveGroup, pruneGroups, moveTabToZone, addTabToZone, reopenTab, showActiveTab, nextActiveAfterClose, setTabWindow, mergeWindow, dockWindow, nextZoneSpot, zoneBoardFull } from "./zones";
|
|
8
|
+
export type { Zone, TabGroup } from "./zones";
|
|
9
|
+
/** The cap, so Settings can state the real number rather than repeating a literal. */
|
|
10
|
+
export declare const webglLimit: () => number;
|
|
11
|
+
export interface TermOutput {
|
|
12
|
+
id: string;
|
|
13
|
+
data: string;
|
|
14
|
+
}
|
|
15
|
+
export interface TermExit {
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Go to a pane: switch to its workspace and tab, then focus it. The pane only mounts once
|
|
20
|
+
* Terminals has rendered the newly-selected tab, so the focus is retried across a few frames.
|
|
21
|
+
*/
|
|
22
|
+
export declare function revealPane(paneId: string): boolean;
|
|
23
|
+
/** Give a pane real keyboard focus. No-op if it isn't mounted yet — the caller retries. */
|
|
24
|
+
export declare function focusPane(paneId: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* `agent`: asked for over the control API (an agent), not from Deck's own palette. Then a new
|
|
27
|
+
* terminal tab or project is added without switching to it (Settings → Where things open,
|
|
28
|
+
* agentTerminals), its shell started at once (spawnUnseen): a pane starts its shell when it is
|
|
29
|
+
* first drawn, and the agent's next command goes to that shell.
|
|
30
|
+
*/
|
|
31
|
+
export declare function applyDtCommand(op: string, args: Record<string, unknown>, agent?: boolean): string | void;
|
|
32
|
+
/** Close the pane `pane`: its whole tab when it is the tab's only pane, as an agent's page is. */
|
|
33
|
+
export declare function closePaneTab(pane: string): void;
|
|
34
|
+
interface Instance {
|
|
35
|
+
term: Terminal;
|
|
36
|
+
fit: FitAddon;
|
|
37
|
+
opened: boolean;
|
|
38
|
+
spawned: boolean;
|
|
39
|
+
exited: boolean;
|
|
40
|
+
lastCols: number;
|
|
41
|
+
lastRows: number;
|
|
42
|
+
}
|
|
43
|
+
/** Re-apply the terminal look to every live pane. Called when the settings change, so an open
|
|
44
|
+
* terminal restyles in place instead of only new ones picking it up. A font change alters the
|
|
45
|
+
* cell size, so each pane is refit and its PTY told the new grid — otherwise the shell keeps
|
|
46
|
+
* drawing to the old column count. */
|
|
47
|
+
export declare function applyTerminalLook(): void;
|
|
48
|
+
export declare function useAgentPanesVersion(): number;
|
|
49
|
+
/**
|
|
50
|
+
* How many of a workspace's panes have a shell right now.
|
|
51
|
+
*
|
|
52
|
+
* A pane spawns lazily and is killed by a suspend, so the layout says nothing about whether
|
|
53
|
+
* anything is running in it. This is what distinguishes a workspace worth suspending from one
|
|
54
|
+
* already asleep.
|
|
55
|
+
*/
|
|
56
|
+
export declare function workspaceShellCount(ws: LayoutWorkspace): number;
|
|
57
|
+
/** A workspace is "active" if any of its panes has a LIVE claude agent (not just a shell). */
|
|
58
|
+
export declare function isWorkspaceActive(ws: LayoutWorkspace): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Mark a pane as running an agent right now, without waiting for the sweep.
|
|
61
|
+
*
|
|
62
|
+
* agentPanes is refreshed from Rust every 10s, which is the right cadence for noticing an agent
|
|
63
|
+
* that EXITED but far too slow for one we just started ourselves — the menu would keep offering
|
|
64
|
+
* to start a second one for most of a minute. The next sweep confirms it, or clears it if the
|
|
65
|
+
* command never took.
|
|
66
|
+
*/
|
|
67
|
+
export declare function markAgentStarted(paneId: string): void;
|
|
68
|
+
/** Does this pane have a LIVE claude agent? Used to decide whether closing needs confirming. */
|
|
69
|
+
export declare function paneHasAgent(paneId: string): boolean;
|
|
70
|
+
/** Move a workspace to a new index (drag-reorder). Order is what Ctrl+1..9 indexes into. */
|
|
71
|
+
export declare function moveWorkspace(id: string, toIndex: number): void;
|
|
72
|
+
/**
|
|
73
|
+
* Ctrl+click a file path in terminal output to open it in this workspace's editor.
|
|
74
|
+
*
|
|
75
|
+
* Registered per attach because resolving a relative path needs the pane's cwd, which is what
|
|
76
|
+
* attach is given. The instance outlives its DOM, so the previous provider is disposed first
|
|
77
|
+
* rather than stacking a second one on every re-attach. The matching itself lives in shellpath
|
|
78
|
+
* (no xterm import), where it is exercised by shellpath.check.mjs.
|
|
79
|
+
*
|
|
80
|
+
* Only a path that actually exists is offered as a link. Matching the shape of a path is not the
|
|
81
|
+
* same as having one: output wraps mid-path at the edge of a narrow pane, a relative path resolves
|
|
82
|
+
* against the cwd the pane spawned with rather than the one it is in now, and ordinary prose
|
|
83
|
+
* contains slashes ("feature/foo", "and/or"). All three produce a link that opens nothing, so the
|
|
84
|
+
* check is on existence rather than on any single one of those causes.
|
|
85
|
+
*
|
|
86
|
+
* provideLinks is callback-shaped so a provider may answer asynchronously. xterm asks only about
|
|
87
|
+
* the row under the cursor and caches the answer until the buffer changes, so this is a few small
|
|
88
|
+
* IPC calls on hover, not one per line of output.
|
|
89
|
+
*
|
|
90
|
+
* ponytail: fsSize, because it already exists and needs no Rust change. A directory reports 0 on
|
|
91
|
+
* Windows, so this rejects those too — which is right, the editor cannot open one. The cost is
|
|
92
|
+
* that a genuinely empty file is not clickable; a dedicated fs_is_file is not worth that case.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* The last lines a pane has on screen, as plain text.
|
|
96
|
+
*
|
|
97
|
+
* For drawing a pane somewhere it cannot actually be mounted — the zone overview. An xterm has
|
|
98
|
+
* ONE element and `attach` moves it into whichever host mounted last, so a second live copy is
|
|
99
|
+
* not possible: rendering real panes in the overview would pull every terminal out of the zone
|
|
100
|
+
* being looked at. Reading the buffer sidesteps that entirely.
|
|
101
|
+
*
|
|
102
|
+
* Empty for a pane that has not spawned yet, which is the honest answer — there is nothing in it.
|
|
103
|
+
*/
|
|
104
|
+
export declare function paneLines(id: string, max?: number): string[];
|
|
105
|
+
/**
|
|
106
|
+
* Open a file in Deck the way its file tree does: in the plugin that opens its type (a .pdf in the
|
|
107
|
+
* PDF plugin), otherwise in this workspace's Editor, at `line` when given.
|
|
108
|
+
*/
|
|
109
|
+
export declare function openFile(path: string, line?: number): void;
|
|
110
|
+
/** Open a file in this workspace's Editor, whatever opens its type elsewhere (Open with › Editor). */
|
|
111
|
+
export declare function openInEditor(path: string, line?: number): void;
|
|
112
|
+
export declare function getInstance(id: string): Instance;
|
|
113
|
+
/**
|
|
114
|
+
* Wrap pasted text in bracketed-paste markers, so the receiving app can tell one paste from
|
|
115
|
+
* typing — and, more importantly, from a paste that arrives in pieces.
|
|
116
|
+
*
|
|
117
|
+
* ConPTY takes about 1KB per input write. A 4KB paste is handed to write_all whole, and
|
|
118
|
+
* Windows still delivers it to the shell in 1KB fragments with gaps between them. An app that
|
|
119
|
+
* decides "paste or typing?" on timing then sees four separate pastes: pasting a long command
|
|
120
|
+
* into Claude Code split it into five messages, each cut mid-line at a 1024-byte boundary.
|
|
121
|
+
* Nothing was lost — only the boundaries were wrong.
|
|
122
|
+
*
|
|
123
|
+
* The markers put the boundaries in the CONTENT, where fragmentation cannot move them: the
|
|
124
|
+
* reader reassembles on ESC[200~ / ESC[201~ rather than on when the bytes happened to land.
|
|
125
|
+
*
|
|
126
|
+
* Chunking the write instead would not fix this. The fragmentation is ConPTY's, below us, and
|
|
127
|
+
* smaller writes would only add more seams.
|
|
128
|
+
*/
|
|
129
|
+
export declare function bracketPaste(text: string, bracketed: boolean): string;
|
|
130
|
+
/** Whether a terminal has text selected, for its right-click menu's Copy. */
|
|
131
|
+
export declare const hasSelection: (id: string) => boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Copy a terminal's selection, then clear it: with the selection kept, the next Ctrl+C copied
|
|
134
|
+
* again instead of interrupting the program, until something was clicked.
|
|
135
|
+
*/
|
|
136
|
+
export declare function copyFrom(id: string): void;
|
|
137
|
+
/**
|
|
138
|
+
* A paste's line breaks as the Enter key sends them. Text copied on Windows carries CRLF, and
|
|
139
|
+
* written raw each line arrived as Enter plus a stray line feed. xterm's own paste does this
|
|
140
|
+
* conversion; Deck writes pastes itself, so it does it here.
|
|
141
|
+
*/
|
|
142
|
+
export declare const pasteText: (text: string) => string;
|
|
143
|
+
/**
|
|
144
|
+
* A pasted line break that will run a command: one ending a line, outside a bracketed paste.
|
|
145
|
+
* The shell (PowerShell, cmd) takes each as Enter, so pasting two lines ran the first at once.
|
|
146
|
+
*/
|
|
147
|
+
export declare const runsLines: (text: string, bracketed: boolean) => boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Paste text into a terminal: line breaks as Enter, bracketed when the app asked for it, and
|
|
150
|
+
* when it would run lines in a shell that cannot tell a paste from typing, asked first, the way
|
|
151
|
+
* Windows Terminal asks. Focus goes back to the terminal afterwards, as a menu click takes it.
|
|
152
|
+
*/
|
|
153
|
+
export declare function pasteTextInto(id: string, text: string): Promise<void>;
|
|
154
|
+
/** Paste the clipboard into a terminal, from its right-click menu (no key event to read). */
|
|
155
|
+
export declare function pasteInto(id: string): Promise<void>;
|
|
156
|
+
export declare function attach(id: string, el: HTMLElement, cwd: string): () => void;
|
|
157
|
+
export declare function queueInput(paneId: string, text: string): void;
|
|
158
|
+
/**
|
|
159
|
+
* Type into a pane whether or not its shell exists yet.
|
|
160
|
+
*
|
|
161
|
+
* queueInput alone is only right for a pane being CREATED — the queue is drained by the spawn, so
|
|
162
|
+
* on a pane that is already running the text would sit there forever. Anything typing into a pane
|
|
163
|
+
* the user picked (the agent launcher) has to handle both.
|
|
164
|
+
*/
|
|
165
|
+
export declare function sendInput(paneId: string, text: string): void;
|
|
166
|
+
/** The command that resumes an agent's session, or undefined for a kind Deck cannot resume. */
|
|
167
|
+
export declare const resumeCommand: (kind: string, session: string) => string;
|
|
168
|
+
/**
|
|
169
|
+
* The agent session each of these panes holds, read fresh from the sweep's file (the map cached at
|
|
170
|
+
* startup misses an agent started since): for a closed tab to resume it when reopened. Read before
|
|
171
|
+
* the next sweep, which drops a pane gone from the layout.
|
|
172
|
+
*/
|
|
173
|
+
export declare function agentSessions(ids: string[]): Promise<Record<string, {
|
|
174
|
+
kind: string;
|
|
175
|
+
session: string;
|
|
176
|
+
}>>;
|
|
177
|
+
/**
|
|
178
|
+
* What is running in these panes besides their shells, for a close to ask about: the programs the
|
|
179
|
+
* sweep saw in each (state/term-procs), or "an agent" for one it has not listed yet. Only panes
|
|
180
|
+
* with a shell count; a view pane loses nothing by closing.
|
|
181
|
+
*
|
|
182
|
+
* ponytail: term-procs is up to 10s old (the sweep's interval), so a program started just before
|
|
183
|
+
* the close is missed. A term_busy command taking its own snapshot (pane_pids + sweep_procs) would
|
|
184
|
+
* not be.
|
|
185
|
+
*/
|
|
186
|
+
export declare function runningIn(ids: string[]): Promise<string[]>;
|
|
187
|
+
/**
|
|
188
|
+
* Size a pane's PTY, and every view of it, to the SMALLER of those views.
|
|
189
|
+
*
|
|
190
|
+
* The single sizing authority. A PTY has one column count, so a pinned pane's two views cannot
|
|
191
|
+
* each own their own size — and when they tried, each view's resize re-fired the other's
|
|
192
|
+
* ResizeObserver, which resized back. Two term_resize calls per cycle, each a full ConPTY screen
|
|
193
|
+
* repaint written into both xterms: that ping-pong was the lag.
|
|
194
|
+
*
|
|
195
|
+
* proposeDimensions(), never fit(): fit() RESIZES as a side effect, which changes the host's
|
|
196
|
+
* layout and re-fires the observer that called us. Measuring first and resizing once — only when
|
|
197
|
+
* the size actually differs — means the observer's next pass finds nothing to do and it settles.
|
|
198
|
+
*/
|
|
199
|
+
/**
|
|
200
|
+
* The terminals drawn in `doc` take its window's scale again: its window moved onto a monitor of
|
|
201
|
+
* other scaling (a floating window reopened where it was, or dragged there). The same hand-over
|
|
202
|
+
* as a move between windows (see attach).
|
|
203
|
+
*/
|
|
204
|
+
export declare function rebindTerminals(doc: Document): void;
|
|
205
|
+
export declare function refit(id: string): void;
|
|
206
|
+
/**
|
|
207
|
+
* Clear the screen, the way the shell expects.
|
|
208
|
+
*
|
|
209
|
+
* NOT xterm's term.clear(): that drops the scrollback behind xterm's back while ConPTY still
|
|
210
|
+
* thinks the cursor sits where it was, so PowerShell redraws its prompt at a stale row and
|
|
211
|
+
* typing appears mid-screen with no prompt. Sending Ctrl+L (\x0c) instead lets the program
|
|
212
|
+
* owning the pane do the clearing — PSReadLine clears and reprints its prompt, and a TUI
|
|
213
|
+
* (Claude, vim) treats it as a repaint. Terminal and shell stay in agreement either way.
|
|
214
|
+
*/
|
|
215
|
+
export declare function clearPane(id: string): void;
|
|
216
|
+
/**
|
|
217
|
+
* Stop the claude or codex in a pane: asked with Ctrl+C, so it tidies up and prints how to resume,
|
|
218
|
+
* and killed only if it stays (agent_stop in mem.rs), in which case its leftover modes are cleared.
|
|
219
|
+
*/
|
|
220
|
+
export declare function stopPaneAgent(id: string): Promise<void>;
|
|
221
|
+
/**
|
|
222
|
+
* Turn off what a killed program left on in the pane's xterm: mouse reporting, focus events,
|
|
223
|
+
* bracketed paste, a hidden cursor. A program that exits turns these off itself; one killed
|
|
224
|
+
* never does, so every mouse move after it is typed into the shell. Only xterm is told (not the
|
|
225
|
+
* PTY), and unlike `term.reset()` the screen and scrollback stay.
|
|
226
|
+
*/
|
|
227
|
+
export declare function resetPaneModes(id: string): void;
|
|
228
|
+
/**
|
|
229
|
+
* Kill the pane's shell and start a fresh one in the same xterm, keeping the pane id (so the
|
|
230
|
+
* layout, name and split position survive). Claude is NOT re-resumed: `agentResumed` already
|
|
231
|
+
* holds this id from the first spawn, and a restart is a request for a clean shell.
|
|
232
|
+
*/
|
|
233
|
+
export declare function restartPane(id: string, cwd: string): Promise<void>;
|
|
234
|
+
/**
|
|
235
|
+
* Kill every shell in a workspace, keeping its layout.
|
|
236
|
+
*
|
|
237
|
+
* The same thing a Deck restart does to a workspace you have not opened, done on demand: the
|
|
238
|
+
* panes, splits and zones stay exactly as they are, and each one spawns again — resuming its
|
|
239
|
+
* Claude session — the next time it is attached. What it buys is memory: an xterm buffer, a
|
|
240
|
+
* WebGL context, a ConPTY and a shell per pane, for a project you are not using right now.
|
|
241
|
+
*
|
|
242
|
+
* What does NOT come back is anything the shell was running that Deck did not start: a dev
|
|
243
|
+
* server or a `flutter run` is killed, and nothing recorded the command to type again. Only a
|
|
244
|
+
* Claude session is resumable, because its uuid is the one thing that gets written down.
|
|
245
|
+
*
|
|
246
|
+
* Returns how many shells were actually killed.
|
|
247
|
+
*/
|
|
248
|
+
export declare function suspendWorkspace(wsId: string): Promise<number>;
|
|
249
|
+
export declare function destroy(id: string): void;
|
|
250
|
+
export declare function usePinnedPanes(): string[];
|
|
251
|
+
export declare const isPinned: (id: string) => boolean;
|
|
252
|
+
export declare function togglePin(id: string): void;
|