deck-plugin-sdk 1.6.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/shim/terminals.js CHANGED
@@ -1,83 +1,97 @@
1
- // GENERATED by sdk/gen-shim.mjs — do not edit.
2
- //
3
- // Deck's terminal panes. Resolved at USE time like the bridge: a plugin module is evaluated
4
- // during loadPlugins, and a reference copied out at import time would capture a half-built
5
- // object. The layout store is shared, not copied — a second one would not know about the panes
6
- // Deck already has open.
7
- const t = () => {
8
- const x = window.__deck?.terminals;
9
- if (!x) throw new Error("window.__deck.terminals is missing — this plugin only runs inside Deck");
10
- return x;
11
- };
12
-
13
- export const ZONE_BOARD = (...a) => t().ZONE_BOARD(...a);
14
- export const activeWorkspaceCwd = (...a) => t().activeWorkspaceCwd(...a);
15
- export const addTabToZone = (...a) => t().addTabToZone(...a);
16
- export const applyDtCommand = (...a) => t().applyDtCommand(...a);
17
- export const applyTerminalLook = (...a) => t().applyTerminalLook(...a);
18
- export const attach = (...a) => t().attach(...a);
19
- export const bracketPaste = (...a) => t().bracketPaste(...a);
20
- export const clearPane = (...a) => t().clearPane(...a);
21
- export const closeLeaf = (...a) => t().closeLeaf(...a);
22
- export const copyFrom = (...a) => t().copyFrom(...a);
23
- export const destroy = (...a) => t().destroy(...a);
24
- export const findLeaf = (...a) => t().findLeaf(...a);
25
- export const focusPane = (...a) => t().focusPane(...a);
26
- export const getInstance = (...a) => t().getInstance(...a);
27
- export const getLayout = (...a) => t().getLayout(...a);
28
- export const hasSelection = (...a) => t().hasSelection(...a);
29
- export const insertBeside = (...a) => t().insertBeside(...a);
30
- export const isPinned = (...a) => t().isPinned(...a);
31
- export const isWorkspaceActive = (...a) => t().isWorkspaceActive(...a);
32
- export const leafIds = (...a) => t().leafIds(...a);
33
- export const loadLayoutOnce = (...a) => t().loadLayoutOnce(...a);
34
- export const markAgentStarted = (...a) => t().markAgentStarted(...a);
35
- export const moveLeaf = (...a) => t().moveLeaf(...a);
36
- export const moveTabToZone = (...a) => t().moveTabToZone(...a);
37
- export const moveWorkspace = (...a) => t().moveWorkspace(...a);
38
- export const moveZone = (...a) => t().moveZone(...a);
39
- export const mutateLayout = (...a) => t().mutateLayout(...a);
40
- export const nextActiveAfterClose = (...a) => t().nextActiveAfterClose(...a);
41
- export const nextZoneSpot = (...a) => t().nextZoneSpot(...a);
42
- export const openFile = (...a) => t().openFile(...a);
43
- export const openTabInWorkspace = (...a) => t().openTabInWorkspace(...a);
44
- export const paneCwd = (...a) => t().paneCwd(...a);
45
- export const paneHasAgent = (...a) => t().paneHasAgent(...a);
46
- export const paneLabel = (...a) => t().paneLabel(...a);
47
- export const paneLines = (...a) => t().paneLines(...a);
48
- export const paneLocation = (...a) => t().paneLocation(...a);
49
- export const pasteInto = (...a) => t().pasteInto(...a);
50
- export const pasteText = (...a) => t().pasteText(...a);
51
- export const pasteTextInto = (...a) => t().pasteTextInto(...a);
52
- export const publishLayout = (...a) => t().publishLayout(...a);
53
- export const queueInput = (...a) => t().queueInput(...a);
54
- export const refit = (...a) => t().refit(...a);
55
- export const reorderTab = (...a) => t().reorderTab(...a);
56
- export const restartPane = (...a) => t().restartPane(...a);
57
- export const runsLines = (...a) => t().runsLines(...a);
58
- export const sendInput = (...a) => t().sendInput(...a);
59
- export const setLeafLabel = (...a) => t().setLeafLabel(...a);
60
- export const setLeafView = (...a) => t().setLeafView(...a);
61
- export const showActiveTab = (...a) => t().showActiveTab(...a);
62
- export const splitLeaf = (...a) => t().splitLeaf(...a);
63
- export const suspendWorkspace = (...a) => t().suspendWorkspace(...a);
64
- export const switchWorkspace = (...a) => t().switchWorkspace(...a);
65
- export const termKill = (...a) => t().termKill(...a);
66
- export const termList = (...a) => t().termList(...a);
67
- export const termResize = (...a) => t().termResize(...a);
68
- export const termScrollback = (...a) => t().termScrollback(...a);
69
- export const termSpawn = (...a) => t().termSpawn(...a);
70
- export const termSweepScrollback = (...a) => t().termSweepScrollback(...a);
71
- export const termWrite = (...a) => t().termWrite(...a);
72
- export const togglePin = (...a) => t().togglePin(...a);
73
- export const useAgentPanesVersion = (...a) => t().useAgentPanesVersion(...a);
74
- export const useLayout = (...a) => t().useLayout(...a);
75
- export const usePinnedPanes = (...a) => t().usePinnedPanes(...a);
76
- export const webglLimit = (...a) => t().webglLimit(...a);
77
- export const workspaceByCwd = (...a) => t().workspaceByCwd(...a);
78
- export const workspaceShellCount = (...a) => t().workspaceShellCount(...a);
79
- export const zoneAt = (...a) => t().zoneAt(...a);
80
- export const zoneBoardFull = (...a) => t().zoneBoardFull(...a);
81
- export const zoneOf = (...a) => t().zoneOf(...a);
82
- export const zoneToward = (...a) => t().zoneToward(...a);
83
- export const zones = (...a) => t().zones(...a);
1
+ // GENERATED by sdk/gen-shim.mjs — do not edit.
2
+ //
3
+ // Deck's terminal panes. Resolved at USE time like the bridge: a plugin module is evaluated
4
+ // during loadPlugins, and a reference copied out at import time would capture a half-built
5
+ // object. The layout store is shared, not copied — a second one would not know about the panes
6
+ // Deck already has open.
7
+ import { pluginId } from "./scope.js";
8
+ const t = () => {
9
+ const x = window.__deck?.forPlugin?.(pluginId)?.terminals ?? window.__deck?.terminals;
10
+ if (!x) throw new Error("window.__deck.terminals is missing — this plugin only runs inside Deck");
11
+ return x;
12
+ };
13
+
14
+ export const GROUP_COLORS = (...a) => t().GROUP_COLORS(...a);
15
+ export const ZONE_BOARD = (...a) => t().ZONE_BOARD(...a);
16
+ export const activeWorkspaceCwd = (...a) => t().activeWorkspaceCwd(...a);
17
+ export const addTabToZone = (...a) => t().addTabToZone(...a);
18
+ export const addToGroup = (...a) => t().addToGroup(...a);
19
+ export const applyDtCommand = (...a) => t().applyDtCommand(...a);
20
+ export const applyTerminalLook = (...a) => t().applyTerminalLook(...a);
21
+ export const attach = (...a) => t().attach(...a);
22
+ export const bracketPaste = (...a) => t().bracketPaste(...a);
23
+ export const clearPane = (...a) => t().clearPane(...a);
24
+ export const closeLeaf = (...a) => t().closeLeaf(...a);
25
+ export const copyFrom = (...a) => t().copyFrom(...a);
26
+ export const destroy = (...a) => t().destroy(...a);
27
+ export const findLeaf = (...a) => t().findLeaf(...a);
28
+ export const focusPane = (...a) => t().focusPane(...a);
29
+ export const getInstance = (...a) => t().getInstance(...a);
30
+ export const getLayout = (...a) => t().getLayout(...a);
31
+ export const hasSelection = (...a) => t().hasSelection(...a);
32
+ export const insertBeside = (...a) => t().insertBeside(...a);
33
+ export const isPinned = (...a) => t().isPinned(...a);
34
+ export const isWorkspaceActive = (...a) => t().isWorkspaceActive(...a);
35
+ export const leafIds = (...a) => t().leafIds(...a);
36
+ export const leaveGroup = (...a) => t().leaveGroup(...a);
37
+ export const loadLayoutOnce = (...a) => t().loadLayoutOnce(...a);
38
+ export const markAgentStarted = (...a) => t().markAgentStarted(...a);
39
+ export const moveGroup = (...a) => t().moveGroup(...a);
40
+ export const moveLeaf = (...a) => t().moveLeaf(...a);
41
+ export const moveTabToZone = (...a) => t().moveTabToZone(...a);
42
+ export const moveWorkspace = (...a) => t().moveWorkspace(...a);
43
+ export const moveZone = (...a) => t().moveZone(...a);
44
+ export const mutateLayout = (...a) => t().mutateLayout(...a);
45
+ export const nextActiveAfterClose = (...a) => t().nextActiveAfterClose(...a);
46
+ export const nextZoneSpot = (...a) => t().nextZoneSpot(...a);
47
+ export const openActiveGroup = (...a) => t().openActiveGroup(...a);
48
+ export const openFile = (...a) => t().openFile(...a);
49
+ export const openInEditor = (...a) => t().openInEditor(...a);
50
+ export const openTabInWorkspace = (...a) => t().openTabInWorkspace(...a);
51
+ export const paneCwd = (...a) => t().paneCwd(...a);
52
+ export const paneHasAgent = (...a) => t().paneHasAgent(...a);
53
+ export const paneLabel = (...a) => t().paneLabel(...a);
54
+ export const paneLines = (...a) => t().paneLines(...a);
55
+ export const paneLocation = (...a) => t().paneLocation(...a);
56
+ export const pasteInto = (...a) => t().pasteInto(...a);
57
+ export const pasteText = (...a) => t().pasteText(...a);
58
+ export const pasteTextInto = (...a) => t().pasteTextInto(...a);
59
+ export const pruneGroups = (...a) => t().pruneGroups(...a);
60
+ export const publishLayout = (...a) => t().publishLayout(...a);
61
+ export const queueInput = (...a) => t().queueInput(...a);
62
+ export const refit = (...a) => t().refit(...a);
63
+ export const reorderTab = (...a) => t().reorderTab(...a);
64
+ export const resetPaneModes = (...a) => t().resetPaneModes(...a);
65
+ export const restartPane = (...a) => t().restartPane(...a);
66
+ export const revealPane = (...a) => t().revealPane(...a);
67
+ export const runsLines = (...a) => t().runsLines(...a);
68
+ export const sendInput = (...a) => t().sendInput(...a);
69
+ export const setGroup = (...a) => t().setGroup(...a);
70
+ export const setLeafLabel = (...a) => t().setLeafLabel(...a);
71
+ export const setLeafView = (...a) => t().setLeafView(...a);
72
+ export const showActiveTab = (...a) => t().showActiveTab(...a);
73
+ export const splitLeaf = (...a) => t().splitLeaf(...a);
74
+ export const stopPaneAgent = (...a) => t().stopPaneAgent(...a);
75
+ export const suspendWorkspace = (...a) => t().suspendWorkspace(...a);
76
+ export const switchWorkspace = (...a) => t().switchWorkspace(...a);
77
+ export const termKill = (...a) => t().termKill(...a);
78
+ export const termList = (...a) => t().termList(...a);
79
+ export const termResize = (...a) => t().termResize(...a);
80
+ export const termScrollback = (...a) => t().termScrollback(...a);
81
+ export const termSpawn = (...a) => t().termSpawn(...a);
82
+ export const termSweepScrollback = (...a) => t().termSweepScrollback(...a);
83
+ export const termWrite = (...a) => t().termWrite(...a);
84
+ export const toggleGroupFold = (...a) => t().toggleGroupFold(...a);
85
+ export const togglePin = (...a) => t().togglePin(...a);
86
+ export const ungroup = (...a) => t().ungroup(...a);
87
+ export const useAgentPanesVersion = (...a) => t().useAgentPanesVersion(...a);
88
+ export const useLayout = (...a) => t().useLayout(...a);
89
+ export const usePinnedPanes = (...a) => t().usePinnedPanes(...a);
90
+ export const webglLimit = (...a) => t().webglLimit(...a);
91
+ export const workspaceByCwd = (...a) => t().workspaceByCwd(...a);
92
+ export const workspaceShellCount = (...a) => t().workspaceShellCount(...a);
93
+ export const zoneAt = (...a) => t().zoneAt(...a);
94
+ export const zoneBoardFull = (...a) => t().zoneBoardFull(...a);
95
+ export const zoneOf = (...a) => t().zoneOf(...a);
96
+ export const zoneToward = (...a) => t().zoneToward(...a);
97
+ export const zones = (...a) => t().zones(...a);
package/shim/ui.d.ts CHANGED
@@ -23,3 +23,4 @@ export * from "../types/modules/editor/tree";
23
23
  export * from "../types/core/decode";
24
24
  export * from "../types/core/keys";
25
25
  export * from "../types/modules/editor/MonacoHosts";
26
+ export * from "../types/core/fileview";
package/shim/ui.js CHANGED
@@ -46,7 +46,9 @@ export const activeScopes = (...a) => u().activeScopes(...a);
46
46
  export const allBindings = (...a) => u().allBindings(...a);
47
47
  export const allThemes = (...a) => u().allThemes(...a);
48
48
  export const applyLineChanges = (...a) => u().applyLineChanges(...a);
49
+ export const bindMonacoKey = (...a) => u().bindMonacoKey(...a);
49
50
  export const buildChangeTree = (...a) => u().buildChangeTree(...a);
51
+ export const byScope = (...a) => u().byScope(...a);
50
52
  export const chordFor = (...a) => u().chordFor(...a);
51
53
  export const chordIndex = (...a) => u().chordIndex(...a);
52
54
  export const claimedOutsideTerminal = (...a) => u().claimedOutsideTerminal(...a);
@@ -60,6 +62,7 @@ export const forLanguage = (...a) => u().forLanguage(...a);
60
62
  export const formatChord = (...a) => u().formatChord(...a);
61
63
  export const getEditorSettings = (...a) => u().getEditorSettings(...a);
62
64
  export const getOverrides = (...a) => u().getOverrides(...a);
65
+ export const keyOf = (...a) => u().keyOf(...a);
63
66
  export const match = (...a) => u().match(...a);
64
67
  export const mediaKind = (...a) => u().mediaKind(...a);
65
68
  export const modelOptionsFor = (...a) => u().modelOptionsFor(...a);
@@ -68,14 +71,21 @@ export const normalizeChord = (...a) => u().normalizeChord(...a);
68
71
  export const notify = (...a) => u().notify(...a);
69
72
  export const onKey = (...a) => u().onKey(...a);
70
73
  export const onKeys = (...a) => u().onKeys(...a);
74
+ export const openByType = (...a) => u().openByType(...a);
75
+ export const openIn = (...a) => u().openIn(...a);
76
+ export const openerFor = (...a) => u().openerFor(...a);
77
+ export const openersFor = (...a) => u().openersFor(...a);
71
78
  export const parseChord = (...a) => u().parseChord(...a);
79
+ export const pluginForFile = (...a) => u().pluginForFile(...a);
72
80
  export const pushScope = (...a) => u().pushScope(...a);
73
81
  export const repoLabel = (...a) => u().repoLabel(...a);
82
+ export const repoOf = (...a) => u().repoOf(...a);
74
83
  export const resolve = (...a) => u().resolve(...a);
75
84
  export const rowAt = (...a) => u().rowAt(...a);
76
85
  export const sameRows = (...a) => u().sameRows(...a);
77
86
  export const scopeActive = (...a) => u().scopeActive(...a);
78
87
  export const setPluginBindings = (...a) => u().setPluginBindings(...a);
88
+ export const splitView = (...a) => u().splitView(...a);
79
89
  export const statusColor = (...a) => u().statusColor(...a);
80
90
  export const subscribeEditorSettings = (...a) => u().subscribeEditorSettings(...a);
81
91
  export const themeById = (...a) => u().themeById(...a);
@@ -90,3 +100,5 @@ export const useNarrow = (...a) => u().useNarrow(...a);
90
100
  export const useResize = (...a) => u().useResize(...a);
91
101
  export const useRowDrag = (...a) => u().useRowDrag(...a);
92
102
  export const useScope = (...a) => u().useScope(...a);
103
+ export const viewKey = (...a) => u().viewKey(...a);
104
+ export const withKey = (...a) => u().withKey(...a);
@@ -11,6 +11,7 @@ npm run dev # build on every save and install into the test Deck, whi
11
11
  npm run build # build once into plugin.js
12
12
  npm run install-local # build and install into the user's real Deck
13
13
  npx deck-plugin check # validate plugin.json
14
+ npx deck-plugin publish --dry-run # everything the registry checks, nothing published
14
15
  ```
15
16
 
16
17
  The test Deck is a second Deck with its own data, started with
@@ -22,7 +23,10 @@ the plugin's `console.warn` and `console.error` lines land there.
22
23
  ## Files
23
24
 
24
25
  - `plugin.json`: `id` (letters, digits, dashes; it is a folder name and a config key), `name`,
25
- `description`, `icon` (a lucide icon name), `color`, `version`, `minDeck`.
26
+ `description`, `icon` (a lucide icon name), `color`, `version`, `minDeck`, and `permissions`:
27
+ what it uses of Deck (`files`, `processes`, `git`, `network`, `terminals`, `browser`,
28
+ `secrets`, `system`, `deck`; the table is `node_modules/deck-plugin-sdk/permissions.json`). A
29
+ bridge call outside them throws, naming the one to add: add it rather than working around it.
26
30
  - `src/plugin.tsx`: the entry. Its exports are what Deck uses (below).
27
31
  - `src/mcp.ts`, if present: tools for Deck's MCP server, built to `mcp.js`.
28
32
  - `plugin.js` (and `mcp.js`): the build's output, gitignored. Never edit them.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) __YEAR__ __AUTHOR__
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,9 +1,10 @@
1
- {
2
- "id": "__ID__",
3
- "name": "__NAME__",
4
- "description": "One line on what this is for, shown under its name in Settings.",
5
- "icon": "Sparkles",
6
- "color": "#a78bfa",
7
- "version": "0.1.0",
8
- "minDeck": "1.6.1"
9
- }
1
+ {
2
+ "id": "__ID__",
3
+ "name": "__NAME__",
4
+ "description": "One line on what this is for, shown under its name in Settings.",
5
+ "icon": "Sparkles",
6
+ "color": "#a78bfa",
7
+ "version": "0.1.0",
8
+ "minDeck": "1.8.0",
9
+ "permissions": []
10
+ }
@@ -24,6 +24,8 @@ export interface TextSurface {
24
24
  to: number;
25
25
  }): void;
26
26
  focus(): void;
27
+ /** Whether the keyboard is in this text, for the markdown keys (Ctrl+B, Ctrl+I). */
28
+ hasFocus(): boolean;
27
29
  }
28
30
  /** A TextSurface over a CodeMirror EditorView. */
29
31
  export declare function cmSurface(view: EditorView): TextSurface;
@@ -20,6 +20,26 @@ export declare const browserNav: (pane: string, action: "back" | "forward" | "re
20
20
  /** The chords Rust takes from a focused page: `deck` moves the keyboard back to Deck, `page` does not. */
21
21
  export declare const browserSetKeys: (deck: string[], page: string[]) => Promise<void>;
22
22
  export declare const browserClose: (pane: string) => Promise<void>;
23
+ /** Answer a site's sign-in (user and password, or neither to cancel) or its certificate error (proceed). */
24
+ export declare const browserSiteAnswer: (pane: string, id: number, a: {
25
+ user?: string;
26
+ password?: string;
27
+ proceed?: boolean;
28
+ }) => Promise<void>;
29
+ /** The page's print dialog, or its Save as dialog. */
30
+ export declare const browserPrint: (pane: string, action: "print" | "save") => Promise<void>;
31
+ /** Answer a site's request to send notifications (the pane's bar). */
32
+ export declare const browserPermissionAnswer: (pane: string, id: number, allow: boolean) => Promise<void>;
33
+ /** Open the app link (mailto:, zoommtg:) the pane asked for. */
34
+ export declare const browserOpenAppLink: (pane: string, uri: string) => Promise<void>;
35
+ /** A page's notification was clicked in Deck: the page hears of it. */
36
+ export declare const browserNotificationClicked: (pane: string, id: number) => Promise<void>;
37
+ /** Reload a page whose process hangs: that process is ended first. */
38
+ export declare const browserReloadHung: (pane: string) => Promise<void>;
39
+ /** The window fullscreen for a page that went fullscreen, or back as it was. */
40
+ export declare const browserWindowFullscreen: (on: boolean) => Promise<void>;
41
+ /** Put a hidden pane's page to sleep, or wake it. */
42
+ export declare const browserSleep: (pane: string, on: boolean) => Promise<void>;
23
43
  /** A JPEG of what the pane's webview shows. */
24
44
  /** The ad blocker on or off, and the sites it is off for. */
25
45
  export declare const adblockConfig: (enabled: boolean, off: string[], youtube: boolean) => Promise<void>;
@@ -34,7 +54,8 @@ export declare const adblockRebuild: () => Promise<void>;
34
54
  /** Download the ad blocker's lists again now. */
35
55
  export declare const adblockUpdate: () => Promise<void>;
36
56
  /** The browser's privacy settings, for every browser pane. */
37
- export declare const browserPrivacy: (tracking: string, autofill: boolean) => Promise<void>;
57
+ /** `scheme`: the light or dark mode pages are asked for (prefers-color-scheme); "auto" is Windows'. */
58
+ export declare const browserPrivacy: (tracking: string, autofill: boolean, scheme: "light" | "dark" | "auto") => Promise<void>;
38
59
  /** Clear the browser's stored data of these kinds (cookies, cache, passwords, autofill) since `since`
39
60
  * (seconds since 1970; 0 for all of it). */
40
61
  export declare const browserClear: (kinds: string[], since: number) => Promise<void>;
@@ -244,6 +265,10 @@ export interface Settings {
244
265
  tabSqueeze?: boolean;
245
266
  /** Each project's own colour on the sidebar's collapsed rail. Off, they are all one grey. */
246
267
  projectColours?: boolean;
268
+ /** Agents listed under their workspace in the sidebar: under every one (default), only the open one, or none. */
269
+ sidebarAgents?: "all" | "open" | "off";
270
+ /** The workspace sidebar is a button in the title bar that opens it over the panes, rather than a column. */
271
+ sidebarMenu?: boolean;
247
272
  /** Pane controls float over the pane's top-right corner on hover, instead of a header row. */
248
273
  floatingPaneControls: boolean;
249
274
  /** Per notification kind, whether it shows as a card, in the bell, with a sound, and as a Windows
@@ -353,6 +378,13 @@ export interface Settings {
353
378
  browserYoutubeSkip: boolean;
354
379
  /** Where Ctrl+click on a web address in a terminal opens it: a browser tab of Deck's, or the system's. */
355
380
  browserTerminalLinks: "deck" | "system";
381
+ /** Sleeping tabs: a browser tab out of sight this many minutes stops running until it is shown. */
382
+ browserSleep: boolean;
383
+ browserSleepAfter: number;
384
+ /** Whether pages are asked for light or dark to match Deck's theme ("deck") or Windows'. */
385
+ browserPageTheme?: "deck" | "windows";
386
+ /** App links opened without asking, as "<site origin> <scheme>" ("https://zoom.us zoommtg"). */
387
+ browserAppLinks: string[];
356
388
  /** The start page offers to make Deck the default browser while it is not. Off: "Don't ask again". */
357
389
  browserDefaultAsk?: boolean;
358
390
  /** Sites (by host) an agent may use in the browser without asking; localhost and files always. */
@@ -389,9 +421,11 @@ export interface MemProc {
389
421
  name: string;
390
422
  cmd: string;
391
423
  mem: number;
392
- group: "deck" | "server" | "agent" | "pane-agent" | "pane";
424
+ group: "deck" | "server" | "browser" | "agent" | "pane-agent" | "pane";
393
425
  /** The language server's session id, or the terminal pane's id. */
394
426
  owner: string;
427
+ /** An agent, or a process in a terminal pane that is not its shell: memKill may stop it. */
428
+ killable: boolean;
395
429
  }
396
430
  export interface MemUsage {
397
431
  deck: number;
@@ -400,8 +434,15 @@ export interface MemUsage {
400
434
  /** Percent of all cores. -1 on the first reading, before there is anything to difference. */
401
435
  cpu: number;
402
436
  cpu_agents: number;
403
- /** Deck minus its language servers. Part of `deck`. */
437
+ /** Deck minus its language servers and the browser. Part of `deck`. */
404
438
  core: number;
439
+ /** The browser's pages (its own WebView2 profile). Also part of `deck`. */
440
+ browser: number;
441
+ /** Browser panes with a live webview, each with its renderers' memory, largest first. */
442
+ browser_tabs: {
443
+ pane: string;
444
+ mem: number;
445
+ }[];
405
446
  /** Running language servers, largest first. Also part of `deck`. */
406
447
  servers: MemServer[];
407
448
  /** Terminal panes. NOT part of `deck` — informational only. */
@@ -414,6 +455,10 @@ export interface MemUsage {
414
455
  }
415
456
  /** `detail` also lists every process with its command line: for the open popover, not the poll. */
416
457
  export declare const memUsage: (detail?: boolean) => Promise<MemUsage>;
458
+ /** Stop a process the memory popover lists, and what it started. Refused unless `killable`. An agent in a pane is asked to quit first: true when it did, false when it was killed. */
459
+ export declare const memKill: (pid: number) => Promise<boolean>;
460
+ /** Stop the claude or codex running in a terminal pane, as memKill does. */
461
+ export declare const agentStop: (pane: string) => Promise<boolean>;
417
462
  export declare const listApps: () => Promise<AppProc[]>;
418
463
  export declare const listInstalled: () => Promise<AppProc[]>;
419
464
  export declare const runScriptNow: (command: string, args: string[], id?: string, name?: string) => Promise<void>;
@@ -603,11 +648,15 @@ export interface StartupProgram {
603
648
  export declare const pickExe: () => Promise<string>;
604
649
  export declare const readTermLayout: <T>() => Promise<T | null>;
605
650
  /** `mtimeMs` is epoch ms, 0 if unreadable — lets a caller tell a settled file from one still being written. */
651
+ /** One entry of a folder. `size` is bytes (0 for a folder); `hidden` is Windows' hidden attribute,
652
+ * or a dot name on a server. */
606
653
  export interface FsEntry {
607
654
  name: string;
608
655
  path: string;
609
656
  dir: boolean;
610
657
  mtimeMs: number;
658
+ size: number;
659
+ hidden: boolean;
611
660
  }
612
661
  export interface GitStatusRow {
613
662
  path: string;
@@ -615,7 +664,19 @@ export interface GitStatusRow {
615
664
  letter: string;
616
665
  staged: boolean;
617
666
  }
618
- export declare const fsList: (dir: string) => Promise<FsEntry[]>;
667
+ /** One folder level, folders first. `all` includes the build folders (node_modules, target, .git…)
668
+ * that a code folder's tree leaves out. */
669
+ export declare const fsList: (dir: string, all?: boolean) => Promise<FsEntry[]>;
670
+ /** A drive of this PC (`C:\`): its label, kind, and size and free space in bytes (0 for a network drive or a disc). */
671
+ export interface Drive {
672
+ path: string;
673
+ label: string;
674
+ kind: "fixed" | "removable" | "network" | "cd";
675
+ total: number;
676
+ free: number;
677
+ }
678
+ /** The drives Windows has. A one-off read, never for a poll. */
679
+ export declare const fsDrives: () => Promise<Drive[]>;
619
680
  /** `%APPDATA%\Deck\plugins` (Deck-Dev in a debug build), created on first call. */
620
681
  export declare const pluginsDir: () => Promise<string>;
621
682
  /** `%APPDATA%\Deck\languages` (Deck-Dev in a debug build), created on first call. */
@@ -691,6 +752,7 @@ export declare const backupRestore: (path: string) => Promise<BackupSummary>;
691
752
  export interface RemoteFile {
692
753
  url: string;
693
754
  sha256: string;
755
+ bytes?: number;
694
756
  }
695
757
  /**
696
758
  * Install a plugin or a language definition from the registry.
@@ -36,6 +36,24 @@ export interface BrowserState {
36
36
  rotated: boolean;
37
37
  /** Devices shown side by side (DeviceBar), the first in the pane's own webview; [] for one. */
38
38
  devices: string[];
39
+ /** The page is not running: asleep after being out of sight, or put away from the memory
40
+ * readout. It wakes, or opens again, when the tab is shown. */
41
+ asleep: boolean;
42
+ /** The page's process crashed ("exited") or hangs ("unresponsive"); "" while it runs. */
43
+ crashed: "" | "exited" | "unresponsive";
44
+ /** An app link the page asked to open (mailto:, zoommtg:), and the site that asked, while the
45
+ * pane's bar waits for an answer; "" otherwise. */
46
+ appLink: string;
47
+ appOrigin: string;
48
+ /** A site's request to send notifications, waiting for the pane's bar (0 for none), and the site. */
49
+ permAsk: number;
50
+ permOrigin: string;
51
+ /** A site's sign-in or certificate error waiting for the address bar (0 for none): which, the
52
+ * address, and the realm or WebView2's error status. */
53
+ siteAsk: number;
54
+ siteKind: "" | "auth" | "cert";
55
+ siteUri: string;
56
+ siteDetail: string;
39
57
  }
40
58
  export declare const subscribeBrowser: (f: () => void) => () => void;
41
59
  export declare const browserState: (pane: string) => BrowserState | undefined;
@@ -73,6 +91,19 @@ export declare const totalBlocked: () => number;
73
91
  export declare const myFilters: () => Promise<string>;
74
92
  /** Save them, and put them to work. */
75
93
  export declare function saveMyFilters(text: string): Promise<void>;
94
+ /** The address bar's answer to a site's sign-in or certificate error. */
95
+ export declare function answerSite(pane: string, a: {
96
+ user?: string;
97
+ password?: string;
98
+ proceed?: boolean;
99
+ }): void;
100
+ /** The pane's bar: let the site send notifications, or not. */
101
+ export declare function answerPermission(pane: string, allow: boolean): void;
102
+ /** The pane's bar: open the app link it asked for, and with `always` for that site from now on. */
103
+ export declare function openAppLink(pane: string, always: boolean): Promise<void>;
104
+ export declare const dismissAppLink: (pane: string) => void;
105
+ /** "Wait" on a page that hangs: the bar goes, and comes back if WebView2 reports it again. */
106
+ export declare const dismissCrash: (pane: string) => void;
76
107
  /** Lay the pane's page out as a device (DeviceBar's ids), or as itself (""). */
77
108
  export declare const setDevice: (pane: string, device: string) => void;
78
109
  export declare const setRotated: (pane: string, rotated: boolean) => void;
@@ -186,4 +217,6 @@ export declare function noteTermOutput(pane: string, chunk: string): void;
186
217
  export declare function forgetTermPane(pane: string): void;
187
218
  /** Where a pane's page is on screen, in Deck's CSS pixels, while it shows one. */
188
219
  export declare const pageBox: (pane: string) => DOMRect | null;
220
+ /** Close the pane's webview to give back its memory, keeping the tab and its address. */
221
+ export declare function discardBrowserPane(pane: string): Promise<void>;
189
222
  export declare function trackBrowser(pane: string, el: HTMLElement, url: string): () => void;
@@ -24,6 +24,7 @@ export declare const normaliseExts: (exts: unknown) => string[];
24
24
  */
25
25
  export declare const fileOpeners: {
26
26
  id: string;
27
+ name: string;
27
28
  exts: string[];
28
29
  }[];
29
30
  /** The id of the plugin that opens `path` (by its extension), or undefined: the Editor's. */
@@ -52,3 +53,16 @@ export declare const fileUrl: (path: string) => string;
52
53
  * Editor, which the caller opens it in. Every way Deck opens a file asks this first.
53
54
  */
54
55
  export declare function openByType(path: string, hint?: Opener): boolean;
56
+ /**
57
+ * Everywhere `path` can open in Deck, for an Open with menu: the Editor, the browser (its types,
58
+ * on this PC), and each plugin that opens its type, named for the menu.
59
+ */
60
+ export declare function openersFor(path: string): {
61
+ to: Opener;
62
+ label: string;
63
+ }[];
64
+ /**
65
+ * Open `path` in `to` whatever the Files tab says, for an Open with menu. False for the Editor,
66
+ * which the caller opens it in (terminals' openInEditor).
67
+ */
68
+ export declare function openIn(path: string, to: Opener): boolean;
@@ -10,7 +10,7 @@
10
10
  * It is also what lets two bindings share a chord honestly — the editor's save and a terminal
11
11
  * action can both be Ctrl+S if the two surfaces never have the keyboard at the same time.
12
12
  */
13
- export type Scope = "app" | "workspaces" | "editor" | "terminal" | `plugin:${string}`;
13
+ export type Scope = "app" | "workspaces" | "editor" | "terminal" | "browser" | "markdown" | `plugin:${string}`;
14
14
  /** Which thing owns the chord. Absent means a plain window listener. */
15
15
  export type Surface = "monaco" | "xterm" | "codemirror";
16
16
  export interface KeyBinding {
@@ -65,6 +65,14 @@ export declare function conflict(bindings: readonly KeyBinding[], overrides: Ove
65
65
  export declare function scopeActive(scope: Scope, active: ReadonlySet<Scope>): boolean;
66
66
  /** The binding to run for an event, or null. Scope-aware, so the caller need not filter. */
67
67
  export declare function match(bindings: readonly KeyBinding[], overrides: Overrides, e: Parameters<typeof parseChord>[0], active: ReadonlySet<Scope>): KeyBinding | null;
68
+ /**
69
+ * The bindings in the order a key looks for its owner: every other scope before "app".
70
+ *
71
+ * "app" is always live, so if it came first in table order a pane's own binding for the same chord
72
+ * could never run: the PDF viewer's Ctrl+= zoomed the window, and F11 went to full screen when
73
+ * the debugger was paused on Step Into. The narrower scope is on screen to be asked first.
74
+ */
75
+ export declare function byScope(bindings: readonly KeyBinding[]): KeyBinding[];
68
76
  /**
69
77
  * A chord as Monaco's keycode bitmask, or null when Monaco has no code for it.
70
78
  *
@@ -20,6 +20,36 @@ export declare function resetOverrides(): Promise<void>;
20
20
  export declare function useKeybindings(): number;
21
21
  /** The chord in force for a binding, for a label or a tooltip. */
22
22
  export declare function chordFor(id: string): string;
23
+ /** The same, as a person reads it ("Ctrl+B"), for a tooltip or a menu hint; "" when unbound. */
24
+ export declare function keyOf(id: string): string;
25
+ /** A tooltip with the key in force after it: "Go back (Alt+←)", or the label alone when unbound. */
26
+ export declare function withKey(label: string, id: string): string;
27
+ /**
28
+ * Bind a registry binding inside one Monaco editor, and follow it when it is rebound in Settings.
29
+ *
30
+ * Monaco takes its keys before Deck's listener sees them, so a chord it hosts (Save) has to be
31
+ * handed to it. A one-off `addCommand` read the chord once, at mount: a rebind only reached the
32
+ * editors opened after it. An action can be disposed, so this swaps it whenever the chord changes.
33
+ * `monaco` is passed in so this file does not pull in monaco-editor. Returns the cleanup.
34
+ */
35
+ export declare function bindMonacoKey(ed: {
36
+ addAction(a: {
37
+ id: string;
38
+ label: string;
39
+ keybindings: number[];
40
+ run: () => void | Promise<void>;
41
+ }): {
42
+ dispose(): void;
43
+ };
44
+ }, monaco: {
45
+ KeyMod: {
46
+ CtrlCmd: number;
47
+ Alt: number;
48
+ Shift: number;
49
+ WinCtrl: number;
50
+ };
51
+ KeyCode: object;
52
+ }, id: string, run: () => void | Promise<void>): () => void;
23
53
  /**
24
54
  * An action, or an action with a `when` guard.
25
55
  *