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
@@ -1,573 +0,0 @@
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
- /** The cap, so Settings can state the real number rather than repeating a literal. */
5
- export declare const webglLimit: () => number;
6
- export interface TermOutput {
7
- id: string;
8
- data: string;
9
- }
10
- export interface TermExit {
11
- id: string;
12
- }
13
- export type SplitDir = "h" | "v";
14
- export type LayoutNode = {
15
- kind: "leaf";
16
- id: string;
17
- label?: string;
18
- view?: string;
19
- } | {
20
- kind: "split";
21
- dir: SplitDir;
22
- a: LayoutNode;
23
- b: LayoutNode;
24
- ratio: number;
25
- };
26
- /**
27
- * A tab, and — with `x`/`y` — a zone on the canvas.
28
- *
29
- * The coordinates are OPTIONAL and nothing writes them on load: a tab saved before zones
30
- * existed has none, and `zoneAt` places it by its index instead. That keeps every layout ever
31
- * written valid and means the tab strip and the canvas are two views of one list, not two
32
- * models to keep in sync.
33
- */
34
- export interface LayoutTab {
35
- id: string;
36
- title: string;
37
- root: LayoutNode;
38
- x?: number;
39
- y?: number;
40
- /**
41
- * Behind another tab in the same zone. Tabs sharing a cell are one zone, and the one without
42
- * this flag is the one it shows — so a zone reopens on the tab you left it on. Absent on every
43
- * tab that has a cell to itself, which is every tab written before zones held several.
44
- */
45
- hidden?: boolean;
46
- /** The tab group it is in (LayoutWorkspace.groups); a group's tabs sit together in one zone. */
47
- group?: string;
48
- /** A colour of its own, an index into GROUP_COLORS: a faint tint behind the tab. */
49
- color?: number;
50
- /**
51
- * Torn off into a window of its own (core/floatwin.ts): the window's id. Such a tab is in no
52
- * zone, though it keeps its x/y to go back to. A restart reopens the window (Layout.floats has
53
- * where it was).
54
- */
55
- window?: string;
56
- /**
57
- * Opened straight into a floating window by Deck (openInFloat: a link, a page an agent opened, a
58
- * file Ctrl+clicked in a terminal), so closing that window closes it rather than docking it into
59
- * the main window. Dropped the moment the tab is moved by hand: then it is one of yours.
60
- */
61
- transient?: true;
62
- }
63
- export interface LayoutWorkspace {
64
- id: string;
65
- name: string;
66
- cwd: string;
67
- tabs: LayoutTab[];
68
- activeTab: string;
69
- /** Tab groups: a name and colour over tabs that sit together in a zone's row, folded or not. */
70
- groups?: TabGroup[];
71
- /** Its colour on the sidebar's collapsed rail, by index (Terminals' TONES); none picks one from the name. */
72
- color?: number;
73
- }
74
- /** Where a floating window was, in physical screen pixels (its size and place before any maximise), to reopen it there. */
75
- export interface FloatBounds {
76
- id: string;
77
- x: number;
78
- y: number;
79
- w: number;
80
- h: number;
81
- max?: boolean;
82
- /** A window things are sent to by name (core/floatwin.ts openInFloat): "links", "agent". */
83
- name?: string;
84
- }
85
- export interface Layout {
86
- workspaces: LayoutWorkspace[];
87
- activeWs: string;
88
- floats?: FloatBounds[];
89
- }
90
- export declare function publishLayout(l: Layout): void;
91
- export declare function getLayout(): Layout | null;
92
- export declare function loadLayoutOnce(): Promise<void>;
93
- export declare function mutateLayout(fn: (l: Layout) => Layout): void;
94
- export declare function useLayout(): Layout | null;
95
- export declare function activeWorkspaceCwd(): string;
96
- /** Switch the active workspace (+ optionally its active tab) — used by agent-notification clicks. */
97
- export declare function switchWorkspace(wsId: string, tabId?: string): void;
98
- /** The workspace whose cwd matches (case/slash-insensitive), for routing an agent hook to a tab. */
99
- /**
100
- * How many columns the zone board has. Here rather than only in the UI because the fallback
101
- * placement below has to agree with what the overview can draw.
102
- */
103
- export declare const ZONE_BOARD = 3;
104
- /** Where a tab sits on the canvas — which is to say, which zone it belongs to. */
105
- export declare function zoneAt(tabs: readonly LayoutTab[], id: string, cols?: number): {
106
- x: number;
107
- y: number;
108
- };
109
- /** One zone: a cell, the tabs in it in list order, and the one it shows. */
110
- export interface Zone {
111
- x: number;
112
- y: number;
113
- tabs: LayoutTab[];
114
- front: LayoutTab;
115
- }
116
- /**
117
- * The tabs grouped into zones, one per occupied cell, in the order each cell first appears.
118
- *
119
- * The front tab is the one not marked `hidden` — the last one shown there, which is what makes a
120
- * zone open on the tab you left it on. A cell whose tabs are ALL hidden (its front was closed
121
- * from outside, by an agent) shows its first, rather than nothing.
122
- */
123
- export declare function zones(tabs: readonly LayoutTab[], cols?: number): Zone[];
124
- /** The zone holding a tab. */
125
- export declare function zoneOf(tabs: readonly LayoutTab[], id: string): Zone | undefined;
126
- /**
127
- * The zone to move to from `id` going `dir`, as the tab it would show, or null when there is
128
- * none that way.
129
- *
130
- * Nearest in a straight line: same row for left/right, same column for up/down, smallest step.
131
- * No wrapping — running out of canvas should feel like an edge, not teleport you across it.
132
- */
133
- export declare function zoneToward(tabs: readonly LayoutTab[], id: string, dir: "left" | "right" | "up" | "down"): LayoutTab | null;
134
- /**
135
- * Put a zone at a spot on the canvas, swapping with whatever is already there.
136
- *
137
- * Every tab in the zone moves, since the zone IS the tabs sharing a cell — moving only the one
138
- * named would split it in two.
139
- *
140
- * Swap rather than push-and-shuffle: a zone you did not touch should not move because another
141
- * one arrived next to it, and with sparse coordinates there is no row to shuffle along anyway.
142
- */
143
- export declare function moveZone(tabs: readonly LayoutTab[], id: string, to: {
144
- x: number;
145
- y: number;
146
- }): LayoutTab[];
147
- /**
148
- * Move a tab to just before or after another — the order a zone's strip shows its tabs in, which
149
- * is their order in the list.
150
- *
151
- * Every tab's cell is pinned first (placeAll): a tab with no stored position takes its cell from
152
- * its index, so reordering the list could otherwise move a zone you never touched.
153
- */
154
- export declare function reorderTab(tabs: readonly LayoutTab[], srcId: string, overId: string, after: boolean,
155
- /** A drag in the strip says which group the tab ends up in: the one of the tab it is held over
156
- * (null: none, held over a tab outside any group or over a group's chip). Left out, the tabs
157
- * either side decide (settleGroup). */
158
- group?: string | null): LayoutTab[];
159
- /** A tab group: its tabs carry its id. Its colour is an index into GROUP_COLORS. */
160
- export interface TabGroup {
161
- id: string;
162
- name: string;
163
- color: number;
164
- folded?: boolean;
165
- }
166
- /** Chrome's group colours, tuned for Deck's dark surfaces. */
167
- export declare const GROUP_COLORS: string[];
168
- /**
169
- * Put a tab in a group: `groupId`, or a new one in the next colour not yet used (its id is
170
- * returned, so its editor can open). The tab moves next to the group's other tabs.
171
- */
172
- export declare function addToGroup(w: LayoutWorkspace, tabId: string, groupId?: string): {
173
- w: LayoutWorkspace;
174
- groupId: string;
175
- };
176
- /** Take a tab out of its group, to just after the group's tabs. */
177
- export declare function leaveGroup(w: LayoutWorkspace, tabId: string): LayoutWorkspace;
178
- /**
179
- * Move a whole group, its tabs in their order, to just before or after `overId`. Over another
180
- * group's tab it goes before or after that group as a whole, never into the middle of it.
181
- */
182
- export declare function moveGroup(tabs: readonly LayoutTab[], groupId: string, overId: string, after: boolean): LayoutTab[];
183
- /**
184
- * Fold a group, or open it. A group holding the tab its zone shows is not folded over it: the
185
- * zone moves to the nearest tab outside the group that is not itself folded away (after the group
186
- * first, then before it). With none, `makeTab` gives a new tab for the zone to open on; without
187
- * it, the group stays open.
188
- */
189
- export declare function toggleGroupFold(w: LayoutWorkspace, groupId: string, makeTab?: () => LayoutTab): LayoutWorkspace;
190
- /** The group goes; its tabs stay where they are. */
191
- export declare function ungroup(w: LayoutWorkspace, groupId: string): LayoutWorkspace;
192
- /** Change a group's name, colour or fold. */
193
- export declare function setGroup(w: LayoutWorkspace, groupId: string, patch: Partial<Omit<TabGroup, "id">>): LayoutWorkspace;
194
- /**
195
- * The open tab is never folded away: however it came to be open (the tab beside a closed one, the
196
- * switcher, a shortcut, an agent's notification), a folded group holding it opens.
197
- */
198
- export declare function openActiveGroup(w: LayoutWorkspace): LayoutWorkspace;
199
- /** A group with no tabs left goes (its last tab closed, moved to another zone, taken out). */
200
- export declare function pruneGroups(w: LayoutWorkspace): LayoutWorkspace;
201
- /**
202
- * Move one tab to another zone's cell — joining the zone there as the tab it shows, or making a
203
- * new zone in an empty cell. The zone it left keeps its other tabs.
204
- */
205
- export declare function moveTabToZone(tabs: readonly LayoutTab[], tabId: string, to: {
206
- x: number;
207
- y: number;
208
- }): LayoutTab[];
209
- /**
210
- * Add a tab to the zone holding `besideId`, as the tab it shows.
211
- *
212
- * The others there are marked hidden here rather than left to the active-tab normaliser, so the
213
- * result is right even for a zone that is not the active one.
214
- */
215
- export declare function addTabToZone(tabs: readonly LayoutTab[], besideId: string, tab: LayoutTab): LayoutTab[];
216
- /**
217
- * A closed tab put back in workspace `w` (core/closedtabs.ts): in front in the zone you are in,
218
- * with new ids for the tab and its panes, since the old panes' shells and state are gone. Out of
219
- * any group and any window it was in. Returns the workspace and each old pane's new id.
220
- */
221
- export declare function reopenTab(w: LayoutWorkspace, tab: LayoutTab, fresh?: () => string): {
222
- w: LayoutWorkspace;
223
- ids: Record<string, string>;
224
- };
225
- /**
226
- * Make a workspace's active tab the one its zone shows.
227
- *
228
- * Run on every layout write (mutateLayout), so whatever made a tab active — a click in the
229
- * strip, the compass, an agent notification jumping to a pane in a tab behind another — the
230
- * zone ends up showing it, and remembers it next time. One place rather than every caller that
231
- * sets activeTab, of which there are many and will be more.
232
- */
233
- export declare function showActiveTab(w: LayoutWorkspace): LayoutWorkspace;
234
- /**
235
- * Which tab becomes active when `closing` goes: the one beside it in the same zone (the next, or
236
- * the one before when it was last), as a browser does, so closing a tab neither throws you out of
237
- * the zone nor back to its first tab; otherwise the first zone left.
238
- */
239
- export declare function nextActiveAfterClose(tabs: readonly LayoutTab[], closing: string): string | undefined;
240
- /**
241
- * Tear a tab off into window `win`, or (`win` undefined) dock it back. A workspace always keeps
242
- * one docked tab: floating its last one leaves a fresh terminal behind, as the main window has
243
- * to show something. Tearing off the active tab makes its neighbour active.
244
- */
245
- export declare function setTabWindow(w: LayoutWorkspace, tabId: string, win: string | undefined, keepGroup?: boolean): LayoutWorkspace;
246
- /**
247
- * Merge floating window `from`'s tabs into another window: floating window `into`, or (`into`
248
- * null) the main window, into the active zone of the project it shows. They go in behind the tab
249
- * that window shows, which stays shown: a tab dropped somewhere does not take you away from the one
250
- * you were on. The tabs move between projects when the window they land in shows another one's,
251
- * since a window holds one project's tabs.
252
- */
253
- export declare function mergeWindow(l: Layout, from: string, into: string | null): Layout;
254
- /**
255
- * Close floating window `id` into the main window: its tabs go back to their zones, each behind the
256
- * tab its zone shows, so closing a window does not take you away from the tab you are on. With
257
- * `discard` (its X, Alt+F4), the tabs Deck opened into it (`transient`) close instead; the caller
258
- * destroys their panes.
259
- */
260
- export declare function dockWindow(l: Layout, id: string, discard?: boolean): Layout;
261
- /** The first free spot on the top row, for a zone created without a position of its own. */
262
- export declare function nextZoneSpot(tabs: readonly LayoutTab[], cols?: number, rows?: number): {
263
- x: number;
264
- y: number;
265
- };
266
- /**
267
- * Is there nowhere left to put a zone?
268
- *
269
- * Counts zones, not tabs: a zone can hold several tabs and still take one cell.
270
- *
271
- * The board is a fixed 3x3 — deliberately, so the overview and the Ctrl+Alt compass are always
272
- * the same nine cells. A tenth zone has no spot: it drew off the edge of the overview and the
273
- * compass could not reach it, so it existed but could not be seen or switched to.
274
- *
275
- * Checked by every caller that creates one, rather than inside nextZoneSpot, because refusing
276
- * and reporting why is the caller's job — the keyboard shortcut says so in a toast, and the
277
- * layout op tells the agent that asked.
278
- */
279
- export declare function zoneBoardFull(tabs: readonly LayoutTab[], cols?: number, rows?: number): boolean;
280
- export declare function workspaceByCwd(cwd: string): LayoutWorkspace | undefined;
281
- /** The folder a pane's shell was spawned in — its workspace's cwd. */
282
- export declare function paneCwd(paneId: string): string;
283
- /**
284
- * A pane's display name: its own label, else the title of the tab holding it.
285
- *
286
- * Here rather than in the footer that first needed it, because Settings lists the same pinned
287
- * panes and a second copy of this walk would be a second answer to one question.
288
- */
289
- export declare function paneLabel(paneId: string): string;
290
- /** Which workspace + tab holds a pane, for jumping to an agent from outside Terminals. */
291
- export declare function paneLocation(paneId: string): {
292
- wsId: string;
293
- wsName: string;
294
- tabId: string;
295
- } | undefined;
296
- /**
297
- * Go to a pane: switch to its workspace and tab, then focus it. The pane only mounts once
298
- * Terminals has rendered the newly-selected tab, so the focus is retried across a few frames.
299
- */
300
- export declare function revealPane(paneId: string): boolean;
301
- /** Give a pane real keyboard focus. No-op if it isn't mounted yet — the caller retries. */
302
- export declare function focusPane(paneId: string): boolean;
303
- export declare const termSpawn: (id: string, cwd: string, cols: number, rows: number) => Promise<void>;
304
- export declare const termWrite: (id: string, data: string) => Promise<void>;
305
- export declare const termResize: (id: string, cols: number, rows: number) => Promise<void>;
306
- export declare const termKill: (id: string) => Promise<void>;
307
- export declare const termList: () => Promise<string[]>;
308
- /** Delete scrollback logs for panes not in `keep`. Returns how many were removed. */
309
- export declare const termSweepScrollback: (keep: string[]) => Promise<number>;
310
- export declare const termScrollback: (id: string) => Promise<string>;
311
- export declare function leafIds(n: LayoutNode): string[];
312
- export declare function splitLeaf(n: LayoutNode, id: string, dir: SplitDir, ratio?: number, view?: string): LayoutNode;
313
- export declare function setLeafLabel(n: LayoutNode, id: string, label: string): LayoutNode;
314
- /**
315
- * Turn a pane into a view, or back into a terminal when `view` is empty.
316
- *
317
- * The pane keeps its id, so the layout, the splits around it and its place in the tab are
318
- * untouched — only what it renders changes. Its label goes with the old contents: a terminal
319
- * named "server" that becomes a notes pane is not the server any more.
320
- */
321
- export declare function setLeafView(n: LayoutNode, id: string, view: string): LayoutNode;
322
- export declare function closeLeaf(n: LayoutNode, id: string): LayoutNode | null;
323
- export type DropSide = "left" | "right" | "top" | "bottom";
324
- /** The leaf node itself (not just its id) — a move carries the pane's label with it. */
325
- export declare function findLeaf(n: LayoutNode, id: string): LayoutNode | null;
326
- /** Replace a leaf with a split holding it and `leaf`, ordered by which side `leaf` lands on. */
327
- export declare function insertBeside(n: LayoutNode, targetId: string, leaf: LayoutNode, side: DropSide): LayoutNode;
328
- /**
329
- * Move a pane next to another within one tab. The leaf keeps its id, so the xterm instance (and
330
- * therefore the running shell and its scrollback) survives — attach() re-parents it on remount.
331
- * closeLeaf already collapses the split the pane leaves behind.
332
- */
333
- export declare function moveLeaf(root: LayoutNode, srcId: string, targetId: string, side: DropSide): LayoutNode;
334
- /**
335
- * Open a new tab in a workspace and return the id of the pane it contains.
336
- *
337
- * applyDtCommand's "new-tab" does the same thing but returns nothing, which is fine for an agent
338
- * driving Deck over HTTP (it can look the pane up afterwards) and useless in-process, where the
339
- * caller wants to type into the pane it just made. Pair it with queueInput: the pane has no PTY
340
- * until it is attached to a sized element, so anything written before then is dropped.
341
- */
342
- export declare function openTabInWorkspace(wsId: string, title: string, opts?: {
343
- besideActive?: boolean;
344
- }): string | null;
345
- /**
346
- * `agent`: asked for over the control API (an agent), not from Deck's own palette. Then a new
347
- * terminal tab or project is added without switching to it (Settings → Where things open,
348
- * agentTerminals), its shell started at once (spawnUnseen): a pane starts its shell when it is
349
- * first drawn, and the agent's next command goes to that shell.
350
- */
351
- export declare function applyDtCommand(op: string, args: Record<string, unknown>, agent?: boolean): string | void;
352
- /** Close the pane `pane`: its whole tab when it is the tab's only pane, as an agent's page is. */
353
- export declare function closePaneTab(pane: string): void;
354
- interface Instance {
355
- term: Terminal;
356
- fit: FitAddon;
357
- opened: boolean;
358
- spawned: boolean;
359
- exited: boolean;
360
- lastCols: number;
361
- lastRows: number;
362
- }
363
- /** Re-apply the terminal look to every live pane. Called when the settings change, so an open
364
- * terminal restyles in place instead of only new ones picking it up. A font change alters the
365
- * cell size, so each pane is refit and its PTY told the new grid — otherwise the shell keeps
366
- * drawing to the old column count. */
367
- export declare function applyTerminalLook(): void;
368
- export declare function useAgentPanesVersion(): number;
369
- /**
370
- * How many of a workspace's panes have a shell right now.
371
- *
372
- * A pane spawns lazily and is killed by a suspend, so the layout says nothing about whether
373
- * anything is running in it. This is what distinguishes a workspace worth suspending from one
374
- * already asleep.
375
- */
376
- export declare function workspaceShellCount(ws: LayoutWorkspace): number;
377
- /** A workspace is "active" if any of its panes has a LIVE claude agent (not just a shell). */
378
- export declare function isWorkspaceActive(ws: LayoutWorkspace): boolean;
379
- /**
380
- * Mark a pane as running an agent right now, without waiting for the sweep.
381
- *
382
- * agentPanes is refreshed from Rust every 10s, which is the right cadence for noticing an agent
383
- * that EXITED but far too slow for one we just started ourselves — the menu would keep offering
384
- * to start a second one for most of a minute. The next sweep confirms it, or clears it if the
385
- * command never took.
386
- */
387
- export declare function markAgentStarted(paneId: string): void;
388
- /** Does this pane have a LIVE claude agent? Used to decide whether closing needs confirming. */
389
- export declare function paneHasAgent(paneId: string): boolean;
390
- /** Move a workspace to a new index (drag-reorder). Order is what Ctrl+1..9 indexes into. */
391
- export declare function moveWorkspace(id: string, toIndex: number): void;
392
- /**
393
- * Ctrl+click a file path in terminal output to open it in this workspace's editor.
394
- *
395
- * Registered per attach because resolving a relative path needs the pane's cwd, which is what
396
- * attach is given. The instance outlives its DOM, so the previous provider is disposed first
397
- * rather than stacking a second one on every re-attach. The matching itself lives in shellpath
398
- * (no xterm import), where it is exercised by shellpath.check.mjs.
399
- *
400
- * Only a path that actually exists is offered as a link. Matching the shape of a path is not the
401
- * same as having one: output wraps mid-path at the edge of a narrow pane, a relative path resolves
402
- * against the cwd the pane spawned with rather than the one it is in now, and ordinary prose
403
- * contains slashes ("feature/foo", "and/or"). All three produce a link that opens nothing, so the
404
- * check is on existence rather than on any single one of those causes.
405
- *
406
- * provideLinks is callback-shaped so a provider may answer asynchronously. xterm asks only about
407
- * the row under the cursor and caches the answer until the buffer changes, so this is a few small
408
- * IPC calls on hover, not one per line of output.
409
- *
410
- * ponytail: fsSize, because it already exists and needs no Rust change. A directory reports 0 on
411
- * Windows, so this rejects those too — which is right, the editor cannot open one. The cost is
412
- * that a genuinely empty file is not clickable; a dedicated fs_is_file is not worth that case.
413
- */
414
- /**
415
- * The last lines a pane has on screen, as plain text.
416
- *
417
- * For drawing a pane somewhere it cannot actually be mounted — the zone overview. An xterm has
418
- * ONE element and `attach` moves it into whichever host mounted last, so a second live copy is
419
- * not possible: rendering real panes in the overview would pull every terminal out of the zone
420
- * being looked at. Reading the buffer sidesteps that entirely.
421
- *
422
- * Empty for a pane that has not spawned yet, which is the honest answer — there is nothing in it.
423
- */
424
- export declare function paneLines(id: string, max?: number): string[];
425
- /**
426
- * Open a file in Deck the way its file tree does: in the plugin that opens its type (a .pdf in the
427
- * PDF plugin), otherwise in this workspace's Editor, at `line` when given.
428
- */
429
- export declare function openFile(path: string, line?: number): void;
430
- /** Open a file in this workspace's Editor, whatever opens its type elsewhere (Open with › Editor). */
431
- export declare function openInEditor(path: string, line?: number): void;
432
- export declare function getInstance(id: string): Instance;
433
- /**
434
- * Wrap pasted text in bracketed-paste markers, so the receiving app can tell one paste from
435
- * typing — and, more importantly, from a paste that arrives in pieces.
436
- *
437
- * ConPTY takes about 1KB per input write. A 4KB paste is handed to write_all whole, and
438
- * Windows still delivers it to the shell in 1KB fragments with gaps between them. An app that
439
- * decides "paste or typing?" on timing then sees four separate pastes: pasting a long command
440
- * into Claude Code split it into five messages, each cut mid-line at a 1024-byte boundary.
441
- * Nothing was lost — only the boundaries were wrong.
442
- *
443
- * The markers put the boundaries in the CONTENT, where fragmentation cannot move them: the
444
- * reader reassembles on ESC[200~ / ESC[201~ rather than on when the bytes happened to land.
445
- *
446
- * Chunking the write instead would not fix this. The fragmentation is ConPTY's, below us, and
447
- * smaller writes would only add more seams.
448
- */
449
- export declare function bracketPaste(text: string, bracketed: boolean): string;
450
- /** Whether a terminal has text selected, for its right-click menu's Copy. */
451
- export declare const hasSelection: (id: string) => boolean;
452
- /**
453
- * Copy a terminal's selection, then clear it: with the selection kept, the next Ctrl+C copied
454
- * again instead of interrupting the program, until something was clicked.
455
- */
456
- export declare function copyFrom(id: string): void;
457
- /**
458
- * A paste's line breaks as the Enter key sends them. Text copied on Windows carries CRLF, and
459
- * written raw each line arrived as Enter plus a stray line feed. xterm's own paste does this
460
- * conversion; Deck writes pastes itself, so it does it here.
461
- */
462
- export declare const pasteText: (text: string) => string;
463
- /**
464
- * A pasted line break that will run a command: one ending a line, outside a bracketed paste.
465
- * The shell (PowerShell, cmd) takes each as Enter, so pasting two lines ran the first at once.
466
- */
467
- export declare const runsLines: (text: string, bracketed: boolean) => boolean;
468
- /**
469
- * Paste text into a terminal: line breaks as Enter, bracketed when the app asked for it, and
470
- * when it would run lines in a shell that cannot tell a paste from typing, asked first, the way
471
- * Windows Terminal asks. Focus goes back to the terminal afterwards, as a menu click takes it.
472
- */
473
- export declare function pasteTextInto(id: string, text: string): Promise<void>;
474
- /** Paste the clipboard into a terminal, from its right-click menu (no key event to read). */
475
- export declare function pasteInto(id: string): Promise<void>;
476
- export declare function attach(id: string, el: HTMLElement, cwd: string): () => void;
477
- export declare function queueInput(paneId: string, text: string): void;
478
- /**
479
- * Type into a pane whether or not its shell exists yet.
480
- *
481
- * queueInput alone is only right for a pane being CREATED — the queue is drained by the spawn, so
482
- * on a pane that is already running the text would sit there forever. Anything typing into a pane
483
- * the user picked (the agent launcher) has to handle both.
484
- */
485
- export declare function sendInput(paneId: string, text: string): void;
486
- /** The command that resumes an agent's session, or undefined for a kind Deck cannot resume. */
487
- export declare const resumeCommand: (kind: string, session: string) => string;
488
- /**
489
- * The agent session each of these panes holds, read fresh from the sweep's file (the map cached at
490
- * startup misses an agent started since): for a closed tab to resume it when reopened. Read before
491
- * the next sweep, which drops a pane gone from the layout.
492
- */
493
- export declare function agentSessions(ids: string[]): Promise<Record<string, {
494
- kind: string;
495
- session: string;
496
- }>>;
497
- /**
498
- * What is running in these panes besides their shells, for a close to ask about: the programs the
499
- * sweep saw in each (state/term-procs), or "an agent" for one it has not listed yet. Only panes
500
- * with a shell count; a view pane loses nothing by closing.
501
- *
502
- * ponytail: term-procs is up to 10s old (the sweep's interval), so a program started just before
503
- * the close is missed. A term_busy command taking its own snapshot (pane_pids + sweep_procs) would
504
- * not be.
505
- */
506
- export declare function runningIn(ids: string[]): Promise<string[]>;
507
- /**
508
- * Size a pane's PTY, and every view of it, to the SMALLER of those views.
509
- *
510
- * The single sizing authority. A PTY has one column count, so a pinned pane's two views cannot
511
- * each own their own size — and when they tried, each view's resize re-fired the other's
512
- * ResizeObserver, which resized back. Two term_resize calls per cycle, each a full ConPTY screen
513
- * repaint written into both xterms: that ping-pong was the lag.
514
- *
515
- * proposeDimensions(), never fit(): fit() RESIZES as a side effect, which changes the host's
516
- * layout and re-fires the observer that called us. Measuring first and resizing once — only when
517
- * the size actually differs — means the observer's next pass finds nothing to do and it settles.
518
- */
519
- /**
520
- * The terminals drawn in `doc` take its window's scale again: its window moved onto a monitor of
521
- * other scaling (a floating window reopened where it was, or dragged there). The same hand-over
522
- * as a move between windows (see attach).
523
- */
524
- export declare function rebindTerminals(doc: Document): void;
525
- export declare function refit(id: string): void;
526
- /**
527
- * Clear the screen, the way the shell expects.
528
- *
529
- * NOT xterm's term.clear(): that drops the scrollback behind xterm's back while ConPTY still
530
- * thinks the cursor sits where it was, so PowerShell redraws its prompt at a stale row and
531
- * typing appears mid-screen with no prompt. Sending Ctrl+L (\x0c) instead lets the program
532
- * owning the pane do the clearing — PSReadLine clears and reprints its prompt, and a TUI
533
- * (Claude, vim) treats it as a repaint. Terminal and shell stay in agreement either way.
534
- */
535
- export declare function clearPane(id: string): void;
536
- /**
537
- * Stop the claude or codex in a pane: asked with Ctrl+C, so it tidies up and prints how to resume,
538
- * and killed only if it stays (agent_stop in mem.rs), in which case its leftover modes are cleared.
539
- */
540
- export declare function stopPaneAgent(id: string): Promise<void>;
541
- /**
542
- * Turn off what a killed program left on in the pane's xterm: mouse reporting, focus events,
543
- * bracketed paste, a hidden cursor. A program that exits turns these off itself; one killed
544
- * never does, so every mouse move after it is typed into the shell. Only xterm is told (not the
545
- * PTY), and unlike `term.reset()` the screen and scrollback stay.
546
- */
547
- export declare function resetPaneModes(id: string): void;
548
- /**
549
- * Kill the pane's shell and start a fresh one in the same xterm, keeping the pane id (so the
550
- * layout, name and split position survive). Claude is NOT re-resumed: `agentResumed` already
551
- * holds this id from the first spawn, and a restart is a request for a clean shell.
552
- */
553
- export declare function restartPane(id: string, cwd: string): Promise<void>;
554
- /**
555
- * Kill every shell in a workspace, keeping its layout.
556
- *
557
- * The same thing a Deck restart does to a workspace you have not opened, done on demand: the
558
- * panes, splits and zones stay exactly as they are, and each one spawns again — resuming its
559
- * Claude session — the next time it is attached. What it buys is memory: an xterm buffer, a
560
- * WebGL context, a ConPTY and a shell per pane, for a project you are not using right now.
561
- *
562
- * What does NOT come back is anything the shell was running that Deck did not start: a dev
563
- * server or a `flutter run` is killed, and nothing recorded the command to type again. Only a
564
- * Claude session is resumable, because its uuid is the one thing that gets written down.
565
- *
566
- * Returns how many shells were actually killed.
567
- */
568
- export declare function suspendWorkspace(wsId: string): Promise<number>;
569
- export declare function destroy(id: string): void;
570
- export declare function usePinnedPanes(): string[];
571
- export declare const isPinned: (id: string) => boolean;
572
- export declare function togglePin(id: string): void;
573
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes