deck-plugin-sdk 1.11.1 → 1.12.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 (53) hide show
  1. package/package.json +1 -1
  2. package/permissions.json +1 -1
  3. package/shim/p2p.d.ts +1 -1
  4. package/shim/settings.d.ts +1 -1
  5. package/shim/terminals.d.ts +1 -1
  6. package/shim/ui.d.ts +10 -10
  7. package/template/plugin.json +1 -1
  8. package/types/components/FileIcon.d.ts +1 -1
  9. package/types/components/TabStrip.d.ts +5 -2
  10. package/types/core/{settingsstore.d.ts → app/settingsstore.d.ts} +1 -1
  11. package/types/core/bridge.d.ts +6 -6
  12. package/types/core/{bookmarks.d.ts → browser/bookmarks.d.ts} +4 -2
  13. package/types/core/{browser.d.ts → browser/browser.d.ts} +3 -1
  14. package/types/core/browser/sitenotify.d.ts +11 -0
  15. package/types/core/browser/webnotify.d.ts +2 -0
  16. package/types/core/{editorsettings.d.ts → editor/editorsettings.d.ts} +1 -1
  17. package/types/core/{icontheme.d.ts → editor/icontheme.d.ts} +1 -1
  18. package/types/core/{notifications.d.ts → notifications/notifications.d.ts} +24 -1
  19. package/types/core/{notifyapi.d.ts → notifications/notifyapi.d.ts} +10 -0
  20. package/types/core/workspaces/layout.d.ts +168 -0
  21. package/types/core/workspaces/terminals.d.ts +252 -0
  22. package/types/core/workspaces/zones.d.ts +215 -0
  23. package/types/modules/editor/MonacoHosts.d.ts +3 -3
  24. package/types/modules/editor/{DiffPeek.d.ts → git/DiffPeek.d.ts} +1 -1
  25. package/types/modules/editor/models.d.ts +1 -1
  26. package/types/modules/editor/{tree.d.ts → tree/tree.d.ts} +1 -1
  27. package/types/core/terminals.d.ts +0 -573
  28. /package/types/core/{p2p.d.ts → app/p2p.d.ts} +0 -0
  29. /package/types/core/{theme.d.ts → app/theme.d.ts} +0 -0
  30. /package/types/core/{timeFormat.d.ts → app/timeFormat.d.ts} +0 -0
  31. /package/types/core/{browserurl.d.ts → browser/browserurl.d.ts} +0 -0
  32. /package/types/core/{dap.d.ts → editor/dap.d.ts} +0 -0
  33. /package/types/core/{debugtargets.d.ts → editor/debugtargets.d.ts} +0 -0
  34. /package/types/core/{decode.d.ts → editor/decode.d.ts} +0 -0
  35. /package/types/core/{editorsession.d.ts → editor/editorsession.d.ts} +0 -0
  36. /package/types/core/{inlay.d.ts → editor/inlay.d.ts} +0 -0
  37. /package/types/core/{langmap.d.ts → editor/langmap.d.ts} +0 -0
  38. /package/types/core/{lsp.d.ts → editor/lsp.d.ts} +0 -0
  39. /package/types/core/{monaco.d.ts → editor/monaco.d.ts} +0 -0
  40. /package/types/core/{patterntokens.d.ts → editor/patterntokens.d.ts} +0 -0
  41. /package/types/core/{snippets.d.ts → editor/snippets.d.ts} +0 -0
  42. /package/types/core/{treehide.d.ts → editor/treehide.d.ts} +0 -0
  43. /package/types/core/{keys.d.ts → keys/keys.d.ts} +0 -0
  44. /package/types/core/{keystore.d.ts → keys/keystore.d.ts} +0 -0
  45. /package/types/core/{fileview.d.ts → plugins/fileview.d.ts} +0 -0
  46. /package/types/core/{portal.d.ts → workspaces/portal.d.ts} +0 -0
  47. /package/types/core/{remotepath.d.ts → workspaces/remotepath.d.ts} +0 -0
  48. /package/types/core/{shellpath.d.ts → workspaces/shellpath.d.ts} +0 -0
  49. /package/types/core/{windows.d.ts → workspaces/windows.d.ts} +0 -0
  50. /package/types/modules/editor/{diffline.d.ts → git/diffline.d.ts} +0 -0
  51. /package/types/modules/editor/{hunks.d.ts → git/hunks.d.ts} +0 -0
  52. /package/types/modules/editor/{MarkdownLive.d.ts → viewers/MarkdownLive.d.ts} +0 -0
  53. /package/types/modules/editor/{viewers.d.ts → viewers/viewers.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deck-plugin-sdk",
3
- "version": "1.11.1",
3
+ "version": "1.12.1",
4
4
  "description": "Build a plugin for Deck, outside the Deck repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
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
@@ -1,4 +1,4 @@
1
1
  // GENERATED by sdk/gen-shim.mjs — do not edit.
2
2
  //
3
3
  // Deck's real types, so a plugin is checked against the actual shape.
4
- export * from "../types/core/p2p";
4
+ export * from "../types/core/app/p2p";
@@ -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";
@@ -1,4 +1,4 @@
1
1
  // GENERATED by sdk/gen-shim.mjs — do not edit.
2
2
  //
3
3
  // Deck's real types, so a plugin is checked against the actual shape.
4
- export * from "../types/core/terminals";
4
+ export * from "../types/core/workspaces/terminals";
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";
@@ -5,6 +5,6 @@
5
5
  "icon": "Sparkles",
6
6
  "color": "#a78bfa",
7
7
  "version": "0.1.0",
8
- "minDeck": "1.11.1",
8
+ "minDeck": "1.12.1",
9
9
  "permissions": []
10
10
  }
@@ -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 { ReactNode } from "react";
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 "./bridge";
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
  /**
@@ -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 URL. */
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;
@@ -1,6 +1,7 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { type RecentPage } from "./browserurl";
3
3
  import { type Bookmarks } from "./bookmarks";
4
+ import "./webnotify";
4
5
  /**
5
6
  * `home`: the pane shows Deck's start page, and its webview (if it has one) is hidden. `back` and
6
7
  * `forward`: whether the page has history that way. `private`: nothing it visits is kept.
@@ -129,6 +130,7 @@ export declare function registerZoomTarget(pane: string, holds: () => boolean):
129
130
  export declare const activeBrowserPage: () => string | undefined;
130
131
  /** Zoom the pane's page a step in or out, or back to 100% (0). */
131
132
  export declare function stepZoom(pane: string, dir: -1 | 0 | 1): void;
133
+ export declare const hostOf: (url: string) => string;
132
134
  /** The URL a just-opened browser pane should show, if a page asked for it. */
133
135
  export declare const takeWaitingUrl: () => {
134
136
  url: string;
@@ -138,7 +140,7 @@ export declare const takeWaitingUrl: () => {
138
140
  export declare const newBrowserTab: (url?: string, isPrivate?: boolean) => boolean | void;
139
141
  /**
140
142
  * 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"
143
+ * deck-open-float, core/workspaces/floatwin.ts openInFloat): `name` the window that collects them ("links"
142
144
  * from other programs, "agent" for an agent's pages), `beside` the window a pane is in.
143
145
  */
144
146
  export declare function browserInFloat(url: string, where: {
@@ -0,0 +1,11 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export interface SiteNote {
3
+ title: string;
4
+ body: string;
5
+ /** Under the text: where it came from ("#hapster-tech · Slack"). */
6
+ source: string;
7
+ /** A person's message (the card shows them as one): a rule here found a sender. */
8
+ message: boolean;
9
+ }
10
+ /** How a page's notification (its host, title and text) is shown in Deck. */
11
+ export declare function siteNote(host: string, title: string, body: string): SiteNote;
@@ -0,0 +1,2 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export {};
@@ -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 "./bridge";
3
+ import { type ImportedPack } from "../bridge";
4
4
  export type IconRef = {
5
5
  kind: "lucide";
6
6
  icon: LucideIcon;
@@ -15,6 +15,8 @@ export interface NotifAction {
15
15
  nav?: string;
16
16
  act?: string;
17
17
  run?: () => void;
18
+ /** What a click on the card does (open the tab, the file): no button of its own. */
19
+ open?: boolean;
18
20
  }
19
21
  export interface Notif {
20
22
  id: string;
@@ -33,6 +35,14 @@ export interface Notif {
33
35
  /** Who posted it, shown beside the time: a plugin's name. */
34
36
  source?: string;
35
37
  actions?: NotifAction[];
38
+ /**
39
+ * A person's message (a chat, a mail): the card shows the sender, `title`, with their picture
40
+ * (`image`, else their initials) and the app's icon on it (`badge`), and the whole of `body`.
41
+ */
42
+ message?: {
43
+ image?: string;
44
+ badge?: string;
45
+ };
36
46
  /** Seen: the bell has been opened since it came. Read: the bell was closed after that. */
37
47
  seen?: boolean;
38
48
  read?: boolean;
@@ -79,8 +89,21 @@ export declare function clearNotifs(): void;
79
89
  /** The bell was opened: the badge clears, the rows stay lifted until it closes. */
80
90
  export declare function markSeen(): void;
81
91
  export declare function markRead(): void;
92
+ /**
93
+ * The tab of the plugin named `source`, where a click on its notification goes when the plugin
94
+ * gave it no open action. Set by the plugin loader (plugins.ts), so that this file and the plugin
95
+ * API in notifyapi.ts do not import the loader, which would put all of it in the SDK's types.
96
+ */
97
+ declare let tabOfPlugin: (source: string) => string | undefined;
98
+ export declare const setPluginTabs: (f: typeof tabOfPlugin) => void;
99
+ export declare const pluginTabOf: (source: string) => string | undefined;
82
100
  /** What a persisted action's `act` runs. Registered by the module that posts it, at import. */
83
101
  export declare function onNotifAction(name: string, run: () => unknown): void;
84
- /** A click on the card or the row itself: where it is about, then the card goes. */
102
+ /** Whether a click on the card or its row goes anywhere: it is drawn as clickable only then. */
103
+ export declare const opens: (n: Notif) => boolean;
104
+ /** The actions shown as buttons: all but the one the card's click runs. */
105
+ export declare const buttons: (n: Notif) => NotifAction[];
106
+ /** A click on the card or the row itself: its open action, or where it is about; then the card goes. */
85
107
  export declare function openNotif(n: Notif): void;
86
108
  export declare function runAction(n: Notif, a: NotifAction): void;
109
+ export {};
@@ -23,12 +23,22 @@ export interface PluginNotification {
23
23
  /**
24
24
  * Buttons on the card and on its bell row. `run` is the plugin's own function, so it lasts only
25
25
  * as long as this session: after a restart the row is still in the bell, without its buttons.
26
+ * `open`: what a click anywhere on the card does (open the mail, the build); it has no button.
27
+ * Without one, a click opens the plugin's own tab, when it has one.
26
28
  */
27
29
  actions?: {
28
30
  label: string;
29
31
  primary?: boolean;
32
+ open?: boolean;
30
33
  run: () => void;
31
34
  }[];
35
+ /**
36
+ * A person's message (new mail, a chat): the card shows `title` as the sender, with their picture
37
+ * (`image`, an https: or data: address; else their initials), and the whole of `body`.
38
+ */
39
+ message?: {
40
+ image?: string;
41
+ };
32
42
  }
33
43
  /**
34
44
  * Post a notification: a card in the corner and a row in the bell, as Settings › Notifications
@@ -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;