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
@@ -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;
@@ -0,0 +1,215 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import { LayoutTab, LayoutWorkspace, Layout } from "./layout";
3
+ /**
4
+ * How many columns the zone board has. Here rather than only in the UI because the fallback
5
+ * placement below has to agree with what the overview can draw.
6
+ */
7
+ export declare const ZONE_BOARD = 3;
8
+ /**
9
+ * Every tab's cell on the canvas.
10
+ *
11
+ * Placed tabs claim their stored coordinates first; unplaced ones then fill the free cells in
12
+ * reading order. Two consequences, both load-bearing:
13
+ *
14
+ * - A layout written before zones existed has no coordinates at all, so tab i lands on cell i —
15
+ * the first row, left to right, then the next — without anything on disk being rewritten.
16
+ * - An unplaced tab never lands on a cell a placed tab already holds. Tabs that share a cell ARE
17
+ * one zone, so a tab created without a position (the pinboard, an agent over MCP) must not
18
+ * silently join whichever zone happens to sit at its list index. Before zones held several
19
+ * tabs that collision only drew two zones on top of each other; now it would merge them.
20
+ */
21
+ export declare function zoneCells(tabs: readonly LayoutTab[], cols: number): Map<string, {
22
+ x: number;
23
+ y: number;
24
+ }>;
25
+ /** Where a tab sits on the canvas — which is to say, which zone it belongs to. */
26
+ export declare function zoneAt(tabs: readonly LayoutTab[], id: string, cols?: number): {
27
+ x: number;
28
+ y: number;
29
+ };
30
+ /** One zone: a cell, the tabs in it in list order, and the one it shows. */
31
+ export interface Zone {
32
+ x: number;
33
+ y: number;
34
+ tabs: LayoutTab[];
35
+ front: LayoutTab;
36
+ }
37
+ /**
38
+ * The tabs grouped into zones, one per occupied cell, in the order each cell first appears.
39
+ *
40
+ * The front tab is the one not marked `hidden` — the last one shown there, which is what makes a
41
+ * zone open on the tab you left it on. A cell whose tabs are ALL hidden (its front was closed
42
+ * from outside, by an agent) shows its first, rather than nothing.
43
+ */
44
+ export declare function zones(tabs: readonly LayoutTab[], cols?: number): Zone[];
45
+ /** The zone holding a tab. */
46
+ export declare function zoneOf(tabs: readonly LayoutTab[], id: string): Zone | undefined;
47
+ /**
48
+ * The zone to move to from `id` going `dir`, as the tab it would show, or null when there is
49
+ * none that way.
50
+ *
51
+ * Nearest in a straight line: same row for left/right, same column for up/down, smallest step.
52
+ * No wrapping — running out of canvas should feel like an edge, not teleport you across it.
53
+ */
54
+ export declare function zoneToward(tabs: readonly LayoutTab[], id: string, dir: "left" | "right" | "up" | "down"): LayoutTab | null;
55
+ /**
56
+ * Every tab with explicit coordinates, at the cell it already appeared in.
57
+ *
58
+ * Needed before writing any coordinate: an unplaced tab's position depends on what else is
59
+ * placed, so placing one tab can move another that was relying on the fallback.
60
+ */
61
+ export declare function placeAll(tabs: readonly LayoutTab[]): LayoutTab[];
62
+ /**
63
+ * Put a zone at a spot on the canvas, swapping with whatever is already there.
64
+ *
65
+ * Every tab in the zone moves, since the zone IS the tabs sharing a cell — moving only the one
66
+ * named would split it in two.
67
+ *
68
+ * Swap rather than push-and-shuffle: a zone you did not touch should not move because another
69
+ * one arrived next to it, and with sparse coordinates there is no row to shuffle along anyway.
70
+ */
71
+ export declare function moveZone(tabs: readonly LayoutTab[], id: string, to: {
72
+ x: number;
73
+ y: number;
74
+ }): LayoutTab[];
75
+ /**
76
+ * Move a tab to just before or after another — the order a zone's strip shows its tabs in, which
77
+ * is their order in the list.
78
+ *
79
+ * Every tab's cell is pinned first (placeAll): a tab with no stored position takes its cell from
80
+ * its index, so reordering the list could otherwise move a zone you never touched.
81
+ */
82
+ export declare function reorderTab(tabs: readonly LayoutTab[], srcId: string, overId: string, after: boolean,
83
+ /** A drag in the strip says which group the tab ends up in: the one of the tab it is held over
84
+ * (null: none, held over a tab outside any group or over a group's chip). Left out, the tabs
85
+ * either side decide (settleGroup). */
86
+ group?: string | null): LayoutTab[];
87
+ /**
88
+ * A tab group's tabs sit together in their zone's row: a tab dropped between two of one group's
89
+ * tabs joins it, and one moved away from every other tab of its own group leaves it. Next to one
90
+ * of its group's tabs (at either end) it stays.
91
+ */
92
+ export declare function settleGroup(tabs: LayoutTab[], id: string): LayoutTab[];
93
+ /** A tab group: its tabs carry its id. Its colour is an index into GROUP_COLORS. */
94
+ export interface TabGroup {
95
+ id: string;
96
+ name: string;
97
+ color: number;
98
+ folded?: boolean;
99
+ }
100
+ /** Chrome's group colours, tuned for Deck's dark surfaces. */
101
+ export declare const GROUP_COLORS: string[];
102
+ /** Move a tab to just after the last other tab of `group` in its zone, if it has any there. */
103
+ export declare function besideGroup(tabs: readonly LayoutTab[], id: string, group: string): LayoutTab[];
104
+ /**
105
+ * Put a tab in a group: `groupId`, or a new one in the next colour not yet used (its id is
106
+ * returned, so its editor can open). The tab moves next to the group's other tabs.
107
+ */
108
+ export declare function addToGroup(w: LayoutWorkspace, tabId: string, groupId?: string): {
109
+ w: LayoutWorkspace;
110
+ groupId: string;
111
+ };
112
+ /** Take a tab out of its group, to just after the group's tabs. */
113
+ export declare function leaveGroup(w: LayoutWorkspace, tabId: string): LayoutWorkspace;
114
+ /**
115
+ * Move a whole group, its tabs in their order, to just before or after `overId`. Over another
116
+ * group's tab it goes before or after that group as a whole, never into the middle of it.
117
+ */
118
+ export declare function moveGroup(tabs: readonly LayoutTab[], groupId: string, overId: string, after: boolean): LayoutTab[];
119
+ /**
120
+ * Fold a group, or open it. A group holding the tab its zone shows is not folded over it: the
121
+ * zone moves to the nearest tab outside the group that is not itself folded away (after the group
122
+ * first, then before it). With none, `makeTab` gives a new tab for the zone to open on; without
123
+ * it, the group stays open.
124
+ */
125
+ export declare function toggleGroupFold(w: LayoutWorkspace, groupId: string, makeTab?: () => LayoutTab): LayoutWorkspace;
126
+ /** The group goes; its tabs stay where they are. */
127
+ export declare function ungroup(w: LayoutWorkspace, groupId: string): LayoutWorkspace;
128
+ /** Change a group's name, colour or fold. */
129
+ export declare function setGroup(w: LayoutWorkspace, groupId: string, patch: Partial<Omit<TabGroup, "id">>): LayoutWorkspace;
130
+ /**
131
+ * The open tab is never folded away: however it came to be open (the tab beside a closed one, the
132
+ * switcher, a shortcut, an agent's notification), a folded group holding it opens.
133
+ */
134
+ export declare function openActiveGroup(w: LayoutWorkspace): LayoutWorkspace;
135
+ /** A group with no tabs left goes (its last tab closed, moved to another zone, taken out). */
136
+ export declare function pruneGroups(w: LayoutWorkspace): LayoutWorkspace;
137
+ /**
138
+ * Move one tab to another zone's cell — joining the zone there as the tab it shows, or making a
139
+ * new zone in an empty cell. The zone it left keeps its other tabs.
140
+ */
141
+ export declare function moveTabToZone(tabs: readonly LayoutTab[], tabId: string, to: {
142
+ x: number;
143
+ y: number;
144
+ }): LayoutTab[];
145
+ /**
146
+ * Add a tab to the zone holding `besideId`, as the tab it shows.
147
+ *
148
+ * The others there are marked hidden here rather than left to the active-tab normaliser, so the
149
+ * result is right even for a zone that is not the active one.
150
+ */
151
+ export declare function addTabToZone(tabs: readonly LayoutTab[], besideId: string, tab: LayoutTab): LayoutTab[];
152
+ /**
153
+ * A closed tab put back in workspace `w` (core/workspaces/closedtabs.ts): in front in the zone you are in,
154
+ * with new ids for the tab and its panes, since the old panes' shells and state are gone. Out of
155
+ * any group and any window it was in. Returns the workspace and each old pane's new id.
156
+ */
157
+ export declare function reopenTab(w: LayoutWorkspace, tab: LayoutTab, fresh?: () => string): {
158
+ w: LayoutWorkspace;
159
+ ids: Record<string, string>;
160
+ };
161
+ /**
162
+ * Make a workspace's active tab the one its zone shows.
163
+ *
164
+ * Run on every layout write (mutateLayout), so whatever made a tab active — a click in the
165
+ * strip, the compass, an agent notification jumping to a pane in a tab behind another — the
166
+ * zone ends up showing it, and remembers it next time. One place rather than every caller that
167
+ * sets activeTab, of which there are many and will be more.
168
+ */
169
+ export declare function showActiveTab(w: LayoutWorkspace): LayoutWorkspace;
170
+ /**
171
+ * Which tab becomes active when `closing` goes: the one beside it in the same zone (the next, or
172
+ * the one before when it was last), as a browser does, so closing a tab neither throws you out of
173
+ * the zone nor back to its first tab; otherwise the first zone left.
174
+ */
175
+ export declare function nextActiveAfterClose(tabs: readonly LayoutTab[], closing: string): string | undefined;
176
+ /**
177
+ * Tear a tab off into window `win`, or (`win` undefined) dock it back. A workspace always keeps
178
+ * one docked tab: floating its last one leaves a fresh terminal behind, as the main window has
179
+ * to show something. Tearing off the active tab makes its neighbour active.
180
+ */
181
+ export declare function setTabWindow(w: LayoutWorkspace, tabId: string, win: string | undefined, keepGroup?: boolean): LayoutWorkspace;
182
+ /**
183
+ * Merge floating window `from`'s tabs into another window: floating window `into`, or (`into`
184
+ * null) the main window, into the active zone of the project it shows. They go in behind the tab
185
+ * that window shows, which stays shown: a tab dropped somewhere does not take you away from the one
186
+ * you were on. The tabs move between projects when the window they land in shows another one's,
187
+ * since a window holds one project's tabs.
188
+ */
189
+ export declare function mergeWindow(l: Layout, from: string, into: string | null): Layout;
190
+ /**
191
+ * Close floating window `id` into the main window: its tabs go back to their zones, each behind the
192
+ * tab its zone shows, so closing a window does not take you away from the tab you are on. With
193
+ * `discard` (its X, Alt+F4), the tabs Deck opened into it (`transient`) close instead; the caller
194
+ * destroys their panes.
195
+ */
196
+ export declare function dockWindow(l: Layout, id: string, discard?: boolean): Layout;
197
+ /** The first free spot on the top row, for a zone created without a position of its own. */
198
+ export declare function nextZoneSpot(tabs: readonly LayoutTab[], cols?: number, rows?: number): {
199
+ x: number;
200
+ y: number;
201
+ };
202
+ /**
203
+ * Is there nowhere left to put a zone?
204
+ *
205
+ * Counts zones, not tabs: a zone can hold several tabs and still take one cell.
206
+ *
207
+ * The board is a fixed 3x3 — deliberately, so the overview and the Ctrl+Alt compass are always
208
+ * the same nine cells. A tenth zone has no spot: it drew off the edge of the overview and the
209
+ * compass could not reach it, so it existed but could not be seen or switched to.
210
+ *
211
+ * Checked by every caller that creates one, rather than inside nextZoneSpot, because refusing
212
+ * and reporting why is the caller's job — the keyboard shortcut says so in a toast, and the
213
+ * layout op tells the agent that asked.
214
+ */
215
+ export declare function zoneBoardFull(tabs: readonly LayoutTab[], cols?: number, rows?: number): boolean;
@@ -1,7 +1,7 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
- import { monaco } from "../../core/monaco";
3
- import { type EditorSettings } from "../../core/editorsettings";
4
- import type { DirtyRange } from "./hunks";
2
+ import { monaco } from "../../core/editor/monaco";
3
+ import { type EditorSettings } from "../../core/editor/editorsettings";
4
+ import type { DirtyRange } from "./git/hunks";
5
5
  declare function MonacoEditorInner({ path, rel, value, onChange, onSave, gotoLine, gotoCol, gotoNonce, highlight, dirty, settings, onEditor, clean, onStageChange, onUnstageChange, onReadBase }: {
6
6
  path: string;
7
7
  rel?: string | null;
@@ -1,6 +1,6 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { type RefObject } from "react";
3
- import { monaco } from "../../core/monaco";
3
+ import { monaco } from "../../../core/editor/monaco";
4
4
  import { type DirtyRange } from "./hunks";
5
5
  /**
6
6
  * The peek, for the editor in `edRef` showing `path` with the gutter's `ranges`. Returns what to
@@ -1,5 +1,5 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
- import { monaco } from "../../core/monaco";
2
+ import { monaco } from "../../core/editor/monaco";
3
3
  export declare const viewStates: Map<string, monaco.editor.ICodeEditorViewState | null>;
4
4
  /**
5
5
  * An untitled buffer (Ctrl+N): `untitled:Untitled-N`. It has no file behind it, so its model gets
@@ -1,5 +1,5 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
- import type { GitStatusRow } from "../../core/bridge";
2
+ import type { GitStatusRow } from "../../../core/bridge";
3
3
  /** Last path segment, trailing separators ignored. */
4
4
  export declare const baseName: (p: string) => string;
5
5
  /** Windows paths use both separators; normalize to "/" for comparison and display. */