deck-plugin-sdk 1.4.0 → 1.6.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.
Files changed (40) hide show
  1. package/README.md +96 -77
  2. package/bin/deck-plugin.mjs +149 -116
  3. package/build-plugin.mjs +48 -26
  4. package/package.json +6 -1
  5. package/packages.mjs +107 -0
  6. package/shim/bridge.js +73 -90
  7. package/shim/event.js +6 -1
  8. package/shim/scope.js +6 -0
  9. package/shim/terminals.js +1 -0
  10. package/shim/ui.d.ts +1 -0
  11. package/shim/ui.js +7 -1
  12. package/template/AGENTS.md +77 -0
  13. package/template/CLAUDE.md +1 -0
  14. package/template/README.md +20 -17
  15. package/template/gitignore +4 -4
  16. package/template/plugin.json +9 -9
  17. package/template/src/assets.d.ts +16 -0
  18. package/template/src/plugin.tsx +65 -65
  19. package/types/components/ActivityBar.d.ts +3 -1
  20. package/types/components/ContextMenu.d.ts +3 -0
  21. package/types/components/TabStrip.d.ts +6 -1
  22. package/types/components/ui.d.ts +48 -1
  23. package/types/components/useResize.d.ts +8 -1
  24. package/types/core/bookmarks.d.ts +79 -0
  25. package/types/core/bridge.d.ts +294 -156
  26. package/types/core/browser.d.ts +189 -0
  27. package/types/core/browserurl.d.ts +64 -0
  28. package/types/core/editorsession.d.ts +55 -0
  29. package/types/core/editorsettings.d.ts +9 -0
  30. package/types/core/fileview.d.ts +35 -0
  31. package/types/core/notifications.d.ts +84 -0
  32. package/types/core/notifyapi.d.ts +39 -0
  33. package/types/core/terminals.d.ts +7 -0
  34. package/types/modules/editor/DiffPeek.d.ts +19 -0
  35. package/types/modules/editor/MonacoHosts.d.ts +19 -6
  36. package/types/modules/editor/detectlang.d.ts +3 -0
  37. package/types/modules/editor/editorstatus.d.ts +2 -0
  38. package/types/modules/editor/hunks.d.ts +54 -0
  39. package/types/modules/editor/models.d.ts +11 -0
  40. package/types/modules/editor/tree.d.ts +0 -6
@@ -1,19 +1,213 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { type DebugTarget } from "./debugtargets";
3
3
  import type { Accent, Background, Density, Palette, TermCustom, TermTheme } from "./theme";
4
+ import type { SearchEngine } from "./browserurl";
4
5
  /** Open a URL in the default browser. */
5
6
  export declare const openExternal: (url: string) => Promise<void>;
7
+ /** A box in physical pixels, relative to the window: where a browser pane's webview goes. */
8
+ export interface PhysRect {
9
+ x: number;
10
+ y: number;
11
+ w: number;
12
+ h: number;
13
+ }
14
+ /** Open `url` in the browser pane's own webview (created the first time) at `r`. A private one
15
+ * keeps no cookies, history or cache. */
16
+ export declare const browserOpen: (pane: string, url: string, isPrivate: boolean, r: PhysRect) => Promise<void>;
17
+ /** Move the pane's webview, or hide it. */
18
+ export declare const browserBounds: (pane: string, r: PhysRect, visible: boolean) => Promise<void>;
19
+ export declare const browserNav: (pane: string, action: "back" | "forward" | "reload" | "go" | "focus", url?: string) => Promise<void>;
20
+ /** The chords Rust takes from a focused page: `deck` moves the keyboard back to Deck, `page` does not. */
21
+ export declare const browserSetKeys: (deck: string[], page: string[]) => Promise<void>;
22
+ export declare const browserClose: (pane: string) => Promise<void>;
23
+ /** A JPEG of what the pane's webview shows. */
24
+ /** The ad blocker on or off, and the sites it is off for. */
25
+ export declare const adblockConfig: (enabled: boolean, off: string[], youtube: boolean) => Promise<void>;
26
+ /** Whether the ad blocker is ready, how many rules it holds, and when its lists were downloaded. */
27
+ export declare const adblockInfo: () => Promise<{
28
+ ready: boolean;
29
+ rules: number;
30
+ updated: number;
31
+ }>;
32
+ /** Rebuild the ad blocker from its lists and the user's own rules, after those changed. */
33
+ export declare const adblockRebuild: () => Promise<void>;
34
+ /** Download the ad blocker's lists again now. */
35
+ export declare const adblockUpdate: () => Promise<void>;
36
+ /** The browser's privacy settings, for every browser pane. */
37
+ export declare const browserPrivacy: (tracking: string, autofill: boolean) => Promise<void>;
38
+ /** Clear the browser's stored data of these kinds (cookies, cache, passwords, autofill) since `since`
39
+ * (seconds since 1970; 0 for all of it). */
40
+ export declare const browserClear: (kinds: string[], since: number) => Promise<void>;
41
+ /** The user's answer to an agent asking to be signed in on a page: the login to fill, or none. */
42
+ export declare const browserAgentFillAnswer: (id: number, login: string | null) => Promise<void>;
43
+ /** A saved login, without its secrets. */
44
+ export interface VaultMeta {
45
+ id: string;
46
+ site: string;
47
+ username: string;
48
+ note: string;
49
+ totp: boolean;
50
+ created: number;
51
+ updated: number;
52
+ used: number;
53
+ }
54
+ /** A login to save: a password or 2FA key left out keeps the saved one; an empty 2FA key removes it. */
55
+ export interface VaultEntryIn {
56
+ id?: string;
57
+ site: string;
58
+ username: string;
59
+ password?: string;
60
+ note?: string;
61
+ totp?: string;
62
+ }
63
+ export declare const vaultStatus: () => Promise<{
64
+ exists: boolean;
65
+ unlocked: boolean;
66
+ }>;
67
+ /** The minutes before the vault locks itself, and whether to offer saving a sign-in. */
68
+ export declare const vaultConfig: (autolockMinutes: number, offer: boolean) => Promise<void>;
69
+ export declare const vaultCreate: (password: string) => Promise<void>;
70
+ export declare const vaultUnlock: (password: string) => Promise<void>;
71
+ export declare const vaultLock: () => Promise<void>;
72
+ export declare const vaultChangePassword: (old: string, next: string) => Promise<void>;
73
+ export declare const vaultList: () => Promise<VaultMeta[]>;
74
+ /** Add or update a login; its id. */
75
+ export declare const vaultSave: (entry: VaultEntryIn) => Promise<string>;
76
+ export declare const vaultDelete: (id: string) => Promise<void>;
77
+ /** One login's password, to show or copy. */
78
+ export declare const vaultSecret: (id: string) => Promise<string>;
79
+ /** One login's 2FA code now, and the seconds it has left. */
80
+ export declare const vaultTotp: (id: string) => Promise<{
81
+ code: string;
82
+ remaining: number;
83
+ }>;
84
+ export declare const vaultGenerate: (length: number, symbols: boolean) => Promise<string>;
85
+ /** The sites never offered saving for. */
86
+ export declare const vaultNeverList: () => Promise<string[]>;
87
+ export declare const vaultNeverRemove: (site: string) => Promise<void>;
88
+ /** The logins saved for the page a pane shows. */
89
+ export declare const vaultMatches: (pane: string) => Promise<VaultMeta[]>;
90
+ /** Fill a login into the pane's page ("ok", or "user" when the page asks for the username first). */
91
+ export declare const vaultFill: (pane: string, id: string) => Promise<string>;
92
+ /** Fill a new generated password into a sign-up page's password fields. */
93
+ export declare const vaultFillNew: (pane: string, length: number, symbols: boolean) => Promise<void>;
94
+ export declare const vaultOfferAnswer: (pane: string, answer: "save" | "never" | "dismiss") => Promise<void>;
95
+ /** Logins from a password export (Chrome, Edge, Brave, Firefox, Bitwarden). */
96
+ export declare const vaultImport: (path: string) => Promise<{
97
+ added: number;
98
+ updated: number;
99
+ skipped: number;
100
+ }>;
101
+ /** Every login to a plain-text CSV file, after the master password again; how many. */
102
+ export declare const vaultExport: (path: string, password: string) => Promise<number>;
103
+ /** A page in the history: its title, how often and when it was last visited (ms). */
104
+ export interface HistoryPage {
105
+ url: string;
106
+ title: string;
107
+ count: number;
108
+ last: number;
109
+ }
110
+ /** One visit to a page. */
111
+ export interface HistoryVisit {
112
+ url: string;
113
+ title: string;
114
+ at: number;
115
+ }
116
+ /** A visit to a web page; `counted` false is only its title arriving. Whether anything changed. */
117
+ export declare const browserHistoryVisit: (url: string, title: string, counted: boolean) => Promise<boolean>;
118
+ export declare const browserHistoryRecent: (limit: number) => Promise<HistoryPage[]>;
119
+ /** Visits newest first, before `before` (ms), whose page matches every word of `q`. */
120
+ export declare const browserHistoryList: (q: string, before: number | null, limit: number) => Promise<HistoryVisit[]>;
121
+ /** The pages the address bar offers for `q`, best first. */
122
+ export declare const browserHistorySuggest: (q: string, limit: number) => Promise<HistoryPage[]>;
123
+ /** How many pages the history holds. */
124
+ export declare const browserHistoryCount: () => Promise<number>;
125
+ export declare const browserHistoryForgetUrl: (url: string) => Promise<void>;
126
+ /** Forget the visits from `from` to `to` (ms); all of them when neither is given. */
127
+ export declare const browserHistoryForgetRange: (from?: number, to?: number) => Promise<void>;
128
+ /** An installed extension. `id` is WebView2's, which chrome-extension:// addresses use. */
129
+ export interface BrowserExtension {
130
+ id: string;
131
+ name: string;
132
+ version: string;
133
+ enabled: boolean;
134
+ storeId?: string;
135
+ popup?: string;
136
+ options?: string;
137
+ icon?: string;
138
+ path: string;
139
+ inPlace: boolean;
140
+ }
141
+ export declare const extensionsList: () => Promise<BrowserExtension[]>;
142
+ /** Install from the Chrome Web Store, by its link or the extension's id; its name. */
143
+ export declare const extensionInstallStore: (link: string) => Promise<string>;
144
+ /** Install an unpacked extension from a folder: copied in, or loaded where it is (`inPlace`, developer mode); its name. */
145
+ export declare const extensionInstallFolder: (path: string, inPlace?: boolean) => Promise<string>;
146
+ /** Load an extension again from its files (an unpacked one's edits); its name. */
147
+ export declare const extensionReload: (id: string) => Promise<string>;
148
+ export declare const extensionSetEnabled: (id: string, enabled: boolean) => Promise<void>;
149
+ export declare const extensionRemove: (id: string) => Promise<void>;
150
+ /** Show an extension's popup page for `pane`, its right edge at `right` and top at `top` (physical pixels). */
151
+ export declare const extensionPopup: (pane: string, id: string, page: string, right: number, top: number) => Promise<void>;
152
+ export declare const extensionPopupClose: (pane: string) => Promise<void>;
153
+ /** The sites agents may use in the browser without asking. */
154
+ export declare const browserAgentConfig: (sites: string[]) => Promise<void>;
155
+ /** The user's answer to an agent's question about a site. */
156
+ export declare const browserAgentAnswer: (id: number, site: string, allow: boolean, forGood: boolean) => Promise<void>;
157
+ /** A DevTools protocol call on a browser pane's page, and its answer. */
158
+ export declare const browserCdp: (pane: string, method: string, params?: unknown) => Promise<unknown>;
159
+ /** Open a browser pane's developer tools. */
160
+ export declare const browserDevtools: (pane: string) => Promise<void>;
161
+ /** What the site in a browser pane keeps and has been allowed: its cookie count and permissions. */
162
+ export declare const browserSite: (pane: string) => Promise<{
163
+ origin: string;
164
+ cookies: number;
165
+ permissions: {
166
+ origin: string;
167
+ kind: number;
168
+ state: number;
169
+ }[];
170
+ }>;
171
+ /** Delete the site's cookies, storage and cache. */
172
+ export declare const browserSiteClear: (pane: string) => Promise<void>;
173
+ /** Every site given or refused a permission. */
174
+ export declare const browserPermissions: () => Promise<{
175
+ origin: string;
176
+ kind: number;
177
+ state: number;
178
+ }[]>;
179
+ /** Set a site's permission: 0 ask again, 1 allow, 2 block. */
180
+ export declare const browserPermissionSet: (origin: string, kind: number, state: number) => Promise<void>;
181
+ /** Mute or unmute a browser pane's page. */
182
+ export declare const browserMute: (pane: string, muted: boolean) => Promise<void>;
183
+ /** Set a browser pane's page zoom (1 = 100%). */
184
+ export declare const browserZoom: (pane: string, factor: number) => Promise<void>;
185
+ /** Pause, resume or cancel one of the browser's downloads. */
186
+ export declare const browserDownload: (id: number, action: "pause" | "resume" | "cancel") => Promise<void>;
187
+ /** Find in the pane's page: start a search, step through its matches, or stop (clearing them). */
188
+ export declare const browserFind: (pane: string, action: "start" | "next" | "prev" | "stop", term?: string, matchCase?: boolean) => Promise<void>;
189
+ export declare const browserCapture: (pane: string) => Promise<ArrayBuffer>;
6
190
  export interface AppProc {
7
191
  name: string;
8
192
  title: string;
9
193
  path: string;
10
194
  }
195
+ /** A config's JSON text, "" when it does not exist yet. The name is its path in Deck's config folder
196
+ * without `.json`, folders and all: `settings/settings`, `state/term-procs`. A plugin names its
197
+ * own configs plainly (`boards`), and they are kept in `data/<plugin id>/`; one of Deck's own it
198
+ * names in full. `config-changed` names configs the same way, a plugin's own as it names them. */
11
199
  export declare const configRead: (name: string) => Promise<string>;
12
200
  /** Raw bytes rather than a JSON argument: a 13.8MB pinboard parsed as JSON on Deck's UI thread
13
201
  * held every other command up for 200ms per save (see config_write in config.rs). */
202
+ /** The name is percent-encoded: it travels in a header, which is ASCII, and a name can be any text
203
+ * (a note's title). */
14
204
  export declare const configWrite: (name: string, json: string) => Promise<void>;
15
- export declare const getVaultRoot: () => Promise<string>;
16
- export declare const setVaultRoot: (path: string) => Promise<void>;
205
+ /** Remove a config or plain file, in order with the writes before it. */
206
+ export declare const configDelete: (name: string) => Promise<void>;
207
+ /** A plugin's own folder in Deck's config folder, `<config dir>\data\<id>`, for listing or
208
+ * renaming the files it keeps there with the fs* calls. A plugin calls it with no argument: its
209
+ * shim knows which plugin it is. */
210
+ export declare const dataDir: (plugin?: string) => Promise<string>;
17
211
  /** The optional readouts in the footer status strip. */
18
212
  /**
19
213
  * A footer readout's id.
@@ -46,6 +240,19 @@ export interface Settings {
46
240
  serversList: boolean;
47
241
  /** The mouse wheel over a tab bar switches tabs rather than scrolling the bar. */
48
242
  tabWheelSwitch: boolean;
243
+ /** When the tabs do not fit, every one but the open tab shrinks to its icon. */
244
+ tabSqueeze?: boolean;
245
+ /** Each project's own colour on the sidebar's collapsed rail. Off, they are all one grey. */
246
+ projectColours?: boolean;
247
+ /** Pane controls float over the pane's top-right corner on hover, instead of a header row. */
248
+ floatingPaneControls: boolean;
249
+ /** Per notification kind, whether it shows as a card, in the bell, with a sound, and as a Windows
250
+ * notification while Deck is not focused. A missing entry takes the default (notifications.ts). */
251
+ notifPrefs?: Partial<Record<"input" | "done" | "attention" | "activity" | "update" | "error" | "plugin", Partial<Record<"card" | "bell" | "sound" | "os", boolean>>>>;
252
+ /** No cards and no sound; everything still lands in the bell. */
253
+ doNotDisturb?: boolean;
254
+ /** Which corner on the right the notification cards stack in. */
255
+ notifPosition?: "bottom" | "top";
49
256
  /** Install plugin and language updates at startup instead of only announcing them. */
50
257
  pluginAutoUpdate: boolean;
51
258
  soundOnFire: boolean;
@@ -106,7 +313,53 @@ export interface Settings {
106
313
  * else the Windows account's (see `userName` in settingsstore.ts).
107
314
  */
108
315
  userName: string;
109
- }
316
+ /** What a new browser pane opens: Deck's start page, the search engine's own page, or a URL
317
+ * (a site, or a local .html file the user wrote). */
318
+ browserHome: "deck" | "search" | "url";
319
+ browserHomeUrl: string;
320
+ /** Where a search typed into the address bar or the start page goes. */
321
+ browserSearch: SearchEngine;
322
+ /** Which parts of Deck's start page show. */
323
+ browserHomeSections: {
324
+ clock: boolean;
325
+ search: boolean;
326
+ servers: boolean;
327
+ pins: boolean;
328
+ recent: boolean;
329
+ };
330
+ /** Behind the start page: a photo that changes each time it opens, one from a folder of the
331
+ * user's own, or none (Deck's background). */
332
+ browserBackground: "photos" | "folder" | "none";
333
+ browserBackgroundFolder: string;
334
+ /** Where the bookmarks bar shows under a browser's toolbar: on every page, on the start page
335
+ * only, or not at all (and only once something is on it). true and false are what it was saved
336
+ * as before it had three; read it through bookmarksBarMode. */
337
+ browserBookmarksBar: "always" | "home" | "never" | boolean;
338
+ /** WebView2's tracking prevention for the browser: how many trackers it blocks. */
339
+ browserTracking: "none" | "basic" | "balanced" | "strict";
340
+ /** Whether the vault offers to save a sign-in, and the minutes it stays open unused. */
341
+ browserVaultOffer: boolean;
342
+ browserVaultLock: number;
343
+ /** Extensions pinned to the browser's toolbar, by WebView2's id, in order. */
344
+ browserPinnedExtensions: string[];
345
+ /** The Extensions page's developer mode: load unpacked folders in place, reload them, ids and folders shown. */
346
+ browserExtensionsDev: boolean;
347
+ /** Whether the browser fills in forms (addresses, names). */
348
+ browserAutofill: boolean;
349
+ /** The ad blocker (EasyList and EasyPrivacy), and the sites it is switched off for, by host. */
350
+ browserAdblock: boolean;
351
+ browserAdblockOff: string[];
352
+ /** Skip YouTube's video ads: click Skip when it shows, run an unskippable one to its end. */
353
+ browserYoutubeSkip: boolean;
354
+ /** Where Ctrl+click on a web address in a terminal opens it: a browser tab of Deck's, or the system's. */
355
+ browserTerminalLinks: "deck" | "system";
356
+ /** The start page offers to make Deck the default browser while it is not. Off: "Don't ask again". */
357
+ browserDefaultAsk?: boolean;
358
+ /** Sites (by host) an agent may use in the browser without asking; localhost and files always. */
359
+ browserAgentSites: string[];
360
+ }
361
+ /** The bookmarks bar setting, older true/false values included. */
362
+ export declare const bookmarksBarMode: (s: Settings) => "always" | "home" | "never";
110
363
  export declare const DEFAULT_SETTINGS: Settings;
111
364
  export declare const setAutostart: (on: boolean) => Promise<void>;
112
365
  export declare const getAutostart: () => Promise<boolean>;
@@ -158,9 +411,6 @@ export interface MemUsage {
158
411
  export declare const memUsage: (detail?: boolean) => Promise<MemUsage>;
159
412
  export declare const listApps: () => Promise<AppProc[]>;
160
413
  export declare const listInstalled: () => Promise<AppProc[]>;
161
- export declare const closeApp: (target: string) => Promise<string>;
162
- export declare const openApp: (path: string) => Promise<void>;
163
- export declare const powerAction: (action: string) => Promise<void>;
164
414
  export declare const runScriptNow: (command: string, args: string[], id?: string, name?: string) => Promise<void>;
165
415
  export declare const pickScript: () => Promise<string>;
166
416
  export interface ExecOut {
@@ -174,12 +424,6 @@ export interface ExecOut {
174
424
  * something. A bare name goes through cmd.exe, so PATH and .bat shims (`flutter`, `npm`) work.
175
425
  */
176
426
  export declare const exec: (command: string, args?: string[], cwd?: string) => Promise<ExecOut>;
177
- export declare const notesScope: (cwd: string) => Promise<string>;
178
- export declare const notesList: (scope: string) => Promise<string[]>;
179
- export declare const notesRead: (scope: string, name: string) => Promise<string>;
180
- export declare const notesWrite: (scope: string, name: string, text: string) => Promise<void>;
181
- export declare const notesDelete: (scope: string, name: string) => Promise<void>;
182
- export declare const notesRename: (scope: string, from: string, to: string) => Promise<void>;
183
427
  /** One header, one value. A list rather than a map: order matters, and repeats are legal. */
184
428
  export type HttpHeader = [string, string];
185
429
  export interface HttpSendRequest {
@@ -219,19 +463,6 @@ export declare const httpCancel: (id: string) => Promise<void>;
219
463
  * reply under `job`. The Requests plugin listens for the event and does the send.
220
464
  */
221
465
  export declare const httpSendReply: (job: string, body: string) => Promise<void>;
222
- export interface DownloadItem {
223
- id: string;
224
- url: string;
225
- title: string;
226
- quality: string;
227
- format?: string;
228
- filePath?: string;
229
- sizeBytes?: number;
230
- status: "done" | "failed";
231
- at: number;
232
- }
233
- export declare const readDownloads: () => Promise<string>;
234
- export declare const writeDownloads: (json: string) => Promise<void>;
235
466
  export declare const pickFolder: () => Promise<string>;
236
467
  /** Native "save as" dialog. Returns "" when cancelled. */
237
468
  export declare const pickSavePath: (defaultName: string, ext: string) => Promise<string>;
@@ -246,10 +477,23 @@ export declare const pickImage: () => Promise<string>;
246
477
  export declare const setWallpaper: (src: string) => Promise<string>;
247
478
  export declare const clearWallpaper: () => Promise<void>;
248
479
  export declare const revealInFolder: (path: string) => Promise<void>;
249
- export declare const defaultDownloadDir: () => Promise<string>;
480
+ /** Deck's newest log file (`<config dir>\logs\deck-YYYY-MM-DD.log`), or the folder when empty. */
481
+ export declare const logLatest: () => Promise<string>;
250
482
  export declare const openFile: (path: string) => Promise<void>;
251
483
  /** Files Deck was launched with — a double-click through Explorer's "Open with". */
252
484
  export declare const launchFiles: () => Promise<string[]>;
485
+ /** Web addresses Deck was launched with: a link opened in another app, Deck being the default browser. */
486
+ export declare const launchUrls: () => Promise<string[]>;
487
+ export interface DefaultBrowserStatus {
488
+ registered: boolean;
489
+ isDefault: boolean;
490
+ name: string;
491
+ }
492
+ /** Whether Deck is offered as a browser in Windows, and whether links open with it. */
493
+ export declare const browserDefaultStatus: () => Promise<DefaultBrowserStatus>;
494
+ /** Register Deck as a browser for this user and open Windows' Default apps page at it: Windows
495
+ * keeps the choice itself to the user. */
496
+ export declare const browserDefaultRegister: () => Promise<DefaultBrowserStatus>;
253
497
  export declare const mediaSetNowPlaying: (title: string, artist: string, artPath: string) => Promise<void>;
254
498
  export declare const mediaSetPlayback: (playing: boolean) => Promise<void>;
255
499
  export interface TrackMeta {
@@ -261,38 +505,7 @@ export interface TrackMeta {
261
505
  art_path: string;
262
506
  }
263
507
  export declare const readTrackMeta: (paths: string[]) => Promise<TrackMeta[]>;
264
- export interface MusicFolder {
265
- id: string;
266
- name: string;
267
- path: string;
268
- }
269
- export interface MusicPlaylist {
270
- id: string;
271
- name: string;
272
- tracks: string[];
273
- }
274
- export interface MusicLibrary {
275
- folders: MusicFolder[];
276
- favorites: string[];
277
- playlists: MusicPlaylist[];
278
- }
279
- export declare const EMPTY_LIBRARY: MusicLibrary;
280
- export declare const readLibrary: () => Promise<MusicLibrary>;
281
- export declare const writeLibrary: (lib: MusicLibrary) => Promise<void>;
282
508
  export { convertFileSrc } from "@tauri-apps/api/core";
283
- export interface SongSuggestion {
284
- id: string;
285
- title: string;
286
- artist: string;
287
- why: string;
288
- }
289
- export interface MusicSuggestions {
290
- generated_at: number;
291
- songs: SongSuggestion[];
292
- }
293
- export declare const readMusicSuggestions: () => Promise<MusicSuggestions | null>;
294
- export declare const readMusicTaste: () => Promise<string>;
295
- export declare const writeMusicTaste: (text: string) => Promise<void>;
296
509
  /** Start a sign-in. Returns the consent URL to open in the browser. */
297
510
  export declare const googleSignIn: () => Promise<string>;
298
511
  /** A valid access token, refreshed if needed. Rejects when not connected. */
@@ -373,8 +586,6 @@ export interface HistoryEntry {
373
586
  timeOfDay?: string;
374
587
  delayMin?: number;
375
588
  }
376
- export declare const historyDelete: (index: number) => Promise<void>;
377
- export declare const historyClear: (module: string) => Promise<void>;
378
589
  export interface StartupProgram {
379
590
  Name: string;
380
591
  Path: string;
@@ -384,11 +595,8 @@ export interface StartupProgram {
384
595
  End: string;
385
596
  Enabled: boolean;
386
597
  }
387
- export declare const startupRead: () => Promise<string>;
388
- export declare const startupWrite: (json: string) => Promise<void>;
389
598
  export declare const pickExe: () => Promise<string>;
390
599
  export declare const readTermLayout: <T>() => Promise<T | null>;
391
- export declare const writeTermLayout: (layout: unknown) => Promise<void>;
392
600
  /** `mtimeMs` is epoch ms, 0 if unreadable — lets a caller tell a settled file from one still being written. */
393
601
  export interface FsEntry {
394
602
  name: string;
@@ -426,7 +634,8 @@ export declare const remoteHome: (host: string, sudo: boolean) => Promise<string
426
634
  /** Host names from ~/.ssh/config, without patterns. */
427
635
  export declare const sshHosts: () => Promise<string[]>;
428
636
  export declare const fsWrite: (path: string, content: string) => Promise<void>;
429
- /** Raw bytes — saving a response that is an image or a PDF, which a string would corrupt. */
637
+ /** Raw bytes — a PDF, an image, a response — which a string would corrupt. Sent as the raw body,
638
+ * the path percent-encoded in a header; a remote path writes over SSH. */
430
639
  export declare const fsWriteBytes: (path: string, bytes: Uint8Array) => Promise<void>;
431
640
  /** Write bytes without ever clobbering: dedupes the name on collision, returns the path used. */
432
641
  export declare const fsSaveUnique: (saveTo: string, defaultName: string, bytes: Uint8Array) => Promise<string>;
@@ -443,12 +652,10 @@ export declare const fsCreateFile: (dir: string, name: string) => Promise<string
443
652
  export declare const fsOpen: (path: string) => Promise<void>;
444
653
  /** The user's Downloads folder (home if there isn't one). */
445
654
  export declare const dirsDownload: () => Promise<string>;
446
- export declare const vaultResolve: (path: string) => Promise<string>;
447
- export declare const vaultRelativize: (path: string) => Promise<string>;
448
- export declare const vaultDataRead: (name: string) => Promise<string>;
449
- export declare const vaultDataWrite: (name: string, text: string) => Promise<void>;
450
655
  /** Relaunch Deck — the same binary, so a dev instance stays dev. Used by the plugin toggle. */
451
656
  export declare const restartApp: () => Promise<void>;
657
+ /** Start a test Deck (`deck.exe --test`) beside this one, or bring the running one forward. */
658
+ export declare const openTestDeck: () => Promise<void>;
452
659
  /** Fetch the VPS's Script Runner run log over SSH into the local run-log-vps config (vpsjobs.rs). */
453
660
  export declare const vpsRunsPull: () => Promise<void>;
454
661
  /** What Rust saw of this launch, as Unix ms: process creation and the setup() span. Null until
@@ -459,6 +666,8 @@ export interface StartupMarks {
459
666
  setupEnd: number;
460
667
  }
461
668
  export declare const startupMarks: () => Promise<StartupMarks | null>;
669
+ /** The page has drawn: Rust shows the window, hidden until then so it never shows see-through. */
670
+ export declare const deckReady: () => Promise<void>;
462
671
  /** What a backup file holds: the Deck that wrote it, when, and how many of each thing. */
463
672
  export interface BackupSummary {
464
673
  deck: string;
@@ -473,8 +682,6 @@ export declare const backupExport: (path: string) => Promise<BackupSummary>;
473
682
  export declare const backupInspect: (path: string) => Promise<BackupSummary>;
474
683
  /** Writes the backup over this machine's copies. Deck should restart afterwards. */
475
684
  export declare const backupRestore: (path: string) => Promise<BackupSummary>;
476
- /** Copy a plugin folder into the plugins directory. Returns its id. Validates before writing. */
477
- export declare const installPlugin: (src: string) => Promise<string>;
478
685
  /** One file of a plugin, as the registry describes it. */
479
686
  export interface RemoteFile {
480
687
  url: string;
@@ -532,33 +739,19 @@ export declare const fsDelete: (path: string) => Promise<void>;
532
739
  export declare const fsTrash: (path: string) => Promise<void>;
533
740
  export declare const fsCopy: (src: string, dstDir: string) => Promise<string>;
534
741
  export declare const fsReveal: (path: string) => Promise<void>;
535
- export declare const installClaudeHooks: () => Promise<void>;
536
742
  /**
537
- * Deck's MCP server, which lets an agent drive Deck's terminals and HTTP client.
538
- *
539
- * The server ships with Deck as a single bundled file, so there is nothing to clone or install.
540
- * Registering it adds one entry to ~/.claude.json — a file that belongs to Claude Code, so Deck
541
- * backs it up first, merges rather than replaces, and refuses outright if it cannot parse it.
542
- *
543
- * `claudeMcpStatus` is "missing", "current", or "stale" — stale meaning an entry exists but
544
- * points somewhere else, which is what a reinstall to a different folder leaves behind.
545
- */
546
- export declare const claudeMcpStatus: () => Promise<string>;
547
- export declare const claudeMcpEntry: () => Promise<string>;
548
- export declare const installClaudeMcp: () => Promise<string>;
549
- export declare const removeClaudeMcp: () => Promise<void>;
550
- /**
551
- * The same for any AI coding agent Deck knows: "claude", "codex", "gemini" or "cursor". Each keeps
552
- * its MCP servers somewhere else (see agentmcp.rs); the status is the same four answers, with
553
- * "no-node" when nothing could run the server whatever the config says.
743
+ * Deck's MCP server, which lets an agent drive Deck's terminals and HTTP client, registered with
744
+ * an AI coding agent: "claude", "codex", "gemini" or "cursor". The server ships with Deck as a
745
+ * single bundled file. Each agent keeps its MCP servers somewhere else (see agentmcp.rs), a file
746
+ * that belongs to that agent, so Deck backs it up first, merges rather than replaces, and refuses
747
+ * outright if it cannot parse it. The status is "missing", "current", "stale" (an entry pointing
748
+ * somewhere else, as a reinstall to another folder leaves) or "no-node" (nothing could run it).
554
749
  */
555
750
  export declare const agentMcpStatus: (agent: string) => Promise<string>;
556
751
  export declare const installAgentMcp: (agent: string) => Promise<string>;
557
- export declare const removeAgentMcp: (agent: string) => Promise<void>;
558
752
  /** Deck's hooks for an agent that has them ("claude", "codex"): what the Agents panel and the
559
753
  * agent notifications hear from. Merged into the agent's own settings, backed up first. */
560
754
  export declare const installAgentHooks: (agent: string) => Promise<void>;
561
- export declare const removeAgentHooks: (agent: string) => Promise<void>;
562
755
  /**
563
756
  * Deck's skills (how to use its MCP tools) for an agent that reads skills: "claude" or "codex".
564
757
  * Each comes back with what happened to it: "installed", "updated", "current", "kept-yours" (a
@@ -571,8 +764,10 @@ export declare const installAgentSkills: (agent: string) => Promise<{
571
764
  }[]>;
572
765
  /** Which agent command-line tools are on PATH: any of claude, codex, gemini, cursor-agent, cursor. */
573
766
  export declare const agentClis: () => Promise<string[]>;
574
- export declare const removeClaudeHooks: () => Promise<void>;
575
767
  export declare const notifyOs: (title: string, body: string) => Promise<void>;
768
+ /** Run `git -C <dir> <args>`: its stdout, or what git said as the error. Never prompts for
769
+ * credentials. What the Git plugin builds its operations on. */
770
+ export declare const gitRun: (dir: string, args: string[]) => Promise<string>;
576
771
  export declare const gitStatus: (dir: string) => Promise<GitStatusRow[]>;
577
772
  /** The repos a folder holds: the one it is inside first, then any below it. Each a repo's top level. */
578
773
  export declare const gitRepos: (dir: string) => Promise<string[]>;
@@ -584,7 +779,6 @@ export interface BlameLine {
584
779
  uncommitted: boolean;
585
780
  }
586
781
  export declare const gitBlameLine: (dir: string, rel: string, line: number, contents: string) => Promise<BlameLine | null>;
587
- export declare const gitHeadFile: (dir: string, rel: string) => Promise<string>;
588
782
  /** A blob's raw bytes. `rev` is "HEAD", or "" for the index. Empty = absent from that revision.
589
783
  * For content the text commands would corrupt: an image, a font. */
590
784
  export declare const gitFileBytes: (dir: string, rev: string, rel: string) => Promise<Uint8Array<ArrayBuffer>>;
@@ -600,10 +794,6 @@ export declare const gitPoll: (dir: string) => Promise<{
600
794
  rows: GitStatusRow[];
601
795
  info: GitInfo;
602
796
  }>;
603
- export declare const gitCommit: (dir: string, message: string) => Promise<string>;
604
- export declare const gitPush: (dir: string) => Promise<string>;
605
- export declare const gitPull: (dir: string) => Promise<string>;
606
- export declare const gitIndexFile: (dir: string, rel: string) => Promise<string>;
607
797
  export declare const gitFileDiff: (dir: string, rel: string) => Promise<string>;
608
798
  export interface ImportedPack {
609
799
  id: string;
@@ -613,9 +803,6 @@ export interface ImportedPack {
613
803
  export declare const importIconPack: (srcDir: string) => Promise<ImportedPack>;
614
804
  export declare const deleteIconPack: (id: string) => Promise<void>;
615
805
  export declare const readIconPackTheme: (path: string) => Promise<string>;
616
- export declare const gitStage: (dir: string, paths: string[]) => Promise<void>;
617
- export declare const gitStageContent: (dir: string, rel: string, content: string) => Promise<void>;
618
- export declare const gitUnstage: (dir: string, paths: string[]) => Promise<void>;
619
806
  export declare const gitDiscard: (dir: string, paths: string[]) => Promise<void>;
620
807
  export interface GraphCommit {
621
808
  hash: string;
@@ -637,14 +824,6 @@ export interface CommitFile {
637
824
  old?: string;
638
825
  }
639
826
  export declare const gitCommitFiles: (dir: string, hash: string) => Promise<CommitFile[]>;
640
- export declare const gitShowFile: (dir: string, rev: string, rel: string) => Promise<string>;
641
- export declare const gitPullRebase: (dir: string) => Promise<string>;
642
- export declare const gitFetch: (dir: string) => Promise<string>;
643
- export interface GitBranch {
644
- name: string;
645
- current: boolean;
646
- }
647
- export declare const gitBranches: (dir: string) => Promise<GitBranch[]>;
648
827
  export interface GitRef {
649
828
  kind: "local" | "remote" | "tag";
650
829
  name: string;
@@ -660,28 +839,6 @@ export declare const gitCheckoutNew: (dir: string, name: string) => Promise<stri
660
839
  export declare const gitCheckoutTrack: (dir: string, remote: string) => Promise<string>;
661
840
  export declare const gitCheckoutDetach: (dir: string, rev: string) => Promise<string>;
662
841
  export declare const gitAiCommitMsg: (dir: string, command: string, args: string, model: string) => Promise<string>;
663
- export declare const gitCommitAmend: (dir: string, message: string) => Promise<string>;
664
- export declare const gitUndoCommit: (dir: string) => Promise<string>;
665
- export declare const gitBranchAt: (dir: string, name: string, rev: string) => Promise<string>;
666
- export declare const gitRevert: (dir: string, rev: string) => Promise<string>;
667
- export declare const gitCherryPick: (dir: string, rev: string) => Promise<string>;
668
- export declare const gitResetTo: (dir: string, rev: string, mode: "soft" | "mixed" | "hard" | "keep") => Promise<string>;
669
- export declare const gitTag: (dir: string, name: string, rev: string, message?: string) => Promise<string>;
670
- export declare const gitMerge: (dir: string, rev: string, noFf?: boolean) => Promise<string>;
671
- /** Rebase the current branch onto `onto`; a conflict leaves it pending (gitPendingOp → "rebase"). */
672
- export declare const gitRebase: (dir: string, onto: string) => Promise<string>;
673
- /** HEAD's commit and branch ("" when detached) — what an undo returns to. */
674
- export declare const gitHead: (dir: string) => Promise<{
675
- hash: string;
676
- branch: string;
677
- }>;
678
- /** Merge `rev` into the current branch: a merge commit always, fast-forward when possible, or squashed into one commit. */
679
- export declare const gitMergeAs: (dir: string, rev: string, style: "no-ff" | "ff" | "squash") => Promise<string>;
680
- /** Finish a merge, rebase, revert or cherry-pick (what gitPendingOp reported) once its conflicts are staged. */
681
- export declare const gitContinueOp: (dir: string, op: string) => Promise<string>;
682
- /** Subjects of the commits on `head` that `base` lacks, oldest first. */
683
- export declare const gitRangeSubjects: (dir: string, base: string, head: string) => Promise<string[]>;
684
- export declare const gitRemoteUrl: (dir: string, name: string) => Promise<string>;
685
842
  /** The GitHub CLI, `gh pr …` or `gh repo view …` only. Rejects with "gh-missing" when gh is not installed. */
686
843
  export declare const ghRun: (dir: string, args: string[]) => Promise<string>;
687
844
  /** Pull request N's review threads, as GitHub's GraphQL JSON (parsed by prs.ts parseThreads). */
@@ -699,30 +856,6 @@ export declare const glabRun: (dir: string, args: string[]) => Promise<string>;
699
856
  export declare const glabApi: (dir: string, method: "GET" | "POST" | "PUT", path: string, fields?: [string, string][], json?: Record<string, object>) => Promise<string>;
700
857
  /** The files that differ between two revisions. */
701
858
  export declare const gitRangeFiles: (dir: string, from: string, to: string) => Promise<CommitFile[]>;
702
- export declare const gitMergeBase: (dir: string, a: string, b: string) => Promise<string>;
703
- /** Fetch pull request N's head from `remote`, so its commits can be diffed here. `gitlab`: a merge request's. */
704
- export declare const gitFetchPr: (dir: string, remote: string, number: number, base: string, gitlab?: boolean) => Promise<string>;
705
- export declare const gitBranchRename: (dir: string, from: string, to: string) => Promise<string>;
706
- export declare const gitPendingOp: (dir: string) => Promise<string>;
707
- export declare const gitAbortOp: (dir: string, op: string) => Promise<string>;
708
- export declare const gitBranchDelete: (dir: string, name: string, force?: boolean) => Promise<string>;
709
- export declare const gitBranchDeleteRemote: (dir: string, remote: string, name: string) => Promise<string>;
710
- export declare const gitTagDelete: (dir: string, name: string) => Promise<string>;
711
- export declare const gitTagPush: (dir: string, remote: string, name: string) => Promise<string>;
712
- export declare const gitTagDeleteRemote: (dir: string, remote: string, name: string) => Promise<string>;
713
- export declare const gitPushBranch: (dir: string, remote: string, name: string) => Promise<string>;
714
- export declare const gitRemotes: (dir: string) => Promise<string[]>;
715
- export interface GitStash {
716
- index: number;
717
- message: string;
718
- }
719
- export declare const gitStash: (dir: string, kind?: "" | "untracked" | "staged", message?: string) => Promise<string>;
720
- export declare const gitStashShow: (dir: string, index: number) => Promise<string>;
721
- export declare const gitStashList: (dir: string) => Promise<GitStash[]>;
722
- export declare const gitStashApply: (dir: string, index?: number) => Promise<string>;
723
- export declare const gitStashPop: (dir: string, index?: number) => Promise<string>;
724
- export declare const gitStashDrop: (dir: string, index?: number) => Promise<string>;
725
- export declare const gitStashClear: (dir: string) => Promise<string>;
726
859
  export interface SearchHit {
727
860
  path: string;
728
861
  rel: string;
@@ -788,6 +921,8 @@ export interface DbTable {
788
921
  name: string;
789
922
  kind: "table" | "view";
790
923
  columns: DbColumn[];
924
+ /** The statement that created it, where the engine keeps one (SQLite). */
925
+ sql?: string;
791
926
  }
792
927
  export interface DbForeignKey {
793
928
  table: string;
@@ -799,16 +934,19 @@ export interface DbSchema {
799
934
  tables: DbTable[];
800
935
  foreignKeys: DbForeignKey[];
801
936
  }
802
- /** Open a postgres:// or mysql:// connection. The handle outlives the calling component. */
937
+ /** Open a connection; the url's scheme picks the engine. The handle outlives the calling component. */
803
938
  export declare const dbConnect: (url: string) => Promise<number>;
804
939
  export declare const dbDisconnect: (handle: number) => Promise<void>;
805
- /** Run ONE statement. `readOnly` wraps it in a read-only transaction the server enforces. */
806
- export declare const dbQuery: (handle: number, sql: string, readOnly: boolean) => Promise<DbQueryResult>;
940
+ /**
941
+ * Run a statement and return up to 1000 rows, after skipping the first `skip` (how a grid pages).
942
+ * `readOnly` refuses writes, by the database itself (a read-only session on Postgres and MySQL,
943
+ * query_only on SQLite).
944
+ */
945
+ export declare const dbQuery: (handle: number, sql: string, readOnly: boolean, skip?: number) => Promise<DbQueryResult>;
807
946
  export declare const dbSchema: (handle: number) => Promise<DbSchema>;
808
947
  /** Open a tunnel. `remote` is host:port as seen FROM `host`. Returns [id, local port]. */
809
948
  export declare const sshTunnelOpen: (host: string, remote: string) => Promise<[number, number]>;
810
949
  export declare const sshTunnelClose: (id: number) => Promise<void>;
811
- export declare const sshTunnelList: () => Promise<[number, number][]>;
812
950
  /**
813
951
  * Offer programs to the editor's debugger: a plugin that runs something debuggable (the Flutter
814
952
  * plugin's runs) publishes them here, and the Run and Debug panel lists them to attach to. Pass