deck-plugin-sdk 0.21.0 → 1.1.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.
@@ -42,6 +42,8 @@ export interface Settings {
42
42
  closeToTray: boolean;
43
43
  startMinimized: boolean;
44
44
  reduceMotion: boolean;
45
+ /** The Servers list (hosts from ~/.ssh/config) under the workspace list. */
46
+ serversList: boolean;
45
47
  soundOnFire: boolean;
46
48
  playerPlacement: "fixed" | "floating";
47
49
  accent: AccentColor;
@@ -57,12 +59,6 @@ export interface Settings {
57
59
  wallpaperDim: number;
58
60
  wallpaperBlur: number;
59
61
  wallpaperPanel: number;
60
- /** Atlassian site host, for building a browse link when a cached ticket has no URL. */
61
- jiraSite: string;
62
- assistantVoice: string;
63
- /** Silence spoken replies without losing the chosen voice. Toggled from the Ask console. */
64
- assistantMuted: boolean;
65
- userName: string;
66
62
  footerItems: Record<FooterItem, boolean>;
67
63
  footerOrder: FooterItem[];
68
64
  footerVisible: boolean;
@@ -82,18 +78,15 @@ export interface Settings {
82
78
  httpMcpRevealSecrets: boolean;
83
79
  }
84
80
  export declare const DEFAULT_SETTINGS: Settings;
85
- /** Stop anything being spoken right now. */
86
- export declare function stopSpeaking(): void;
87
- export declare function speakWithVoice(text: string, opts?: {
88
- rate?: number;
89
- onend?: () => void;
90
- onerror?: () => void;
91
- }): SpeechSynthesisUtterance | null;
92
81
  export declare const setAutostart: (on: boolean) => Promise<void>;
93
82
  export declare const getAutostart: () => Promise<boolean>;
94
83
  export declare const toggleFullscreen: () => Promise<boolean>;
95
84
  export declare const isFullscreen: () => Promise<boolean>;
96
- /** Watch these exact paths for external changes; emits "fs-changed" with the path. [] stops. */
85
+ /** Check a sudo password on the server and hold it until Deck exits (never written anywhere). */
86
+ export declare const remoteSudoPassword: (host: string, password: string) => Promise<void>;
87
+ /** Ask for the sudo password of `host` (SudoPasswordPrompt, mounted in App). True once it has
88
+ * been accepted, false if the prompt was cancelled. */
89
+ export declare function askSudoPassword(host: string): Promise<boolean>;
97
90
  export declare const watchFiles: (paths: string[]) => Promise<void>;
98
91
  /** RAM in bytes: Deck and its WebView2 children, plus every claude.exe. */
99
92
  export interface MemServer {
@@ -157,12 +150,6 @@ export declare const notesRead: (scope: string, name: string) => Promise<string>
157
150
  export declare const notesWrite: (scope: string, name: string, text: string) => Promise<void>;
158
151
  export declare const notesDelete: (scope: string, name: string) => Promise<void>;
159
152
  export declare const notesRename: (scope: string, from: string, to: string) => Promise<void>;
160
- export interface SetupCheck {
161
- id: string;
162
- ok: boolean;
163
- detail: string;
164
- }
165
- export declare const setupChecks: () => Promise<SetupCheck[]>;
166
153
  /** One header, one value. A list rather than a map: order matters, and repeats are legal. */
167
154
  export type HttpHeader = [string, string];
168
155
  export interface HttpSendRequest {
@@ -190,6 +177,18 @@ export interface HttpSendResult {
190
177
  * that does need to cancel should use core/httpclient.ts, which owns that id.
191
178
  */
192
179
  export declare const httpSend: (req: HttpSendRequest) => Promise<HttpSendResult>;
180
+ /**
181
+ * The same send under an id the caller chose, so it can be cancelled with `httpCancel` while in
182
+ * flight. `req` is the full shape http.rs takes; the Requests plugin builds it.
183
+ */
184
+ export declare const httpSendAs: <T = HttpSendResult>(id: string, req: object) => Promise<T>;
185
+ /** Abort the send started under `id`. A no-op when it has already finished. */
186
+ export declare const httpCancel: (id: string) => Promise<void>;
187
+ /**
188
+ * Answer an `http-send` event: a send the MCP asked for through sessions.rs, which waits on this
189
+ * reply under `job`. The Requests plugin listens for the event and does the send.
190
+ */
191
+ export declare const httpSendReply: (job: string, body: string) => Promise<void>;
193
192
  export interface DownloadItem {
194
193
  id: string;
195
194
  url: string;
@@ -264,40 +263,6 @@ export interface MusicSuggestions {
264
263
  export declare const readMusicSuggestions: () => Promise<MusicSuggestions | null>;
265
264
  export declare const readMusicTaste: () => Promise<string>;
266
265
  export declare const writeMusicTaste: (text: string) => Promise<void>;
267
- export interface JiraItem {
268
- key: string;
269
- status: string;
270
- title: string;
271
- url?: string;
272
- /** One sentence on what the ticket asks for — what the rail shows and a drag carries. */
273
- summary?: string;
274
- /** The full description as markdown, for the detail drawer. */
275
- description?: string;
276
- assignee?: string;
277
- priority?: string;
278
- }
279
- export interface TicketCache {
280
- tickets: JiraItem[];
281
- fetched: number;
282
- }
283
- export declare const jiraCached: () => Promise<TicketCache | null>;
284
- export declare const jiraRefresh: () => Promise<TicketCache | null>;
285
- export interface CalItem {
286
- /** Start as 24-hour HH:MM, or "" for an all-day event. */
287
- time: string;
288
- end?: string;
289
- title: string;
290
- /** Video-call join URL, when the event has one. */
291
- link?: string;
292
- location?: string;
293
- attendees?: number;
294
- }
295
- export interface CalendarCache {
296
- events: CalItem[];
297
- fetched: number;
298
- }
299
- export declare const calendarCached: () => Promise<CalendarCache | null>;
300
- export declare const calendarRefresh: () => Promise<CalendarCache | null>;
301
266
  /** Start a sign-in. Returns the consent URL to open in the browser. */
302
267
  export declare const googleSignIn: () => Promise<string>;
303
268
  /** A valid access token, refreshed if needed. Rejects when not connected. */
@@ -310,28 +275,6 @@ export interface GoogleAccount {
310
275
  }
311
276
  export declare const googleAccount: () => Promise<GoogleAccount | null>;
312
277
  export declare const googleSignOut: () => Promise<void>;
313
- export interface FeedItem {
314
- from: string;
315
- /** Slack: the channel, or "DM". Mail has none. */
316
- where?: string;
317
- /** Slack's message body. */
318
- text?: string;
319
- /** Mail's subject and one-line gloss. */
320
- subject?: string;
321
- snippet?: string;
322
- url?: string;
323
- when?: string;
324
- /** Slack only: "dm" or "mention". */
325
- kind?: string;
326
- }
327
- export interface FeedCache {
328
- items: FeedItem[];
329
- fetched: number;
330
- }
331
- export declare const slackCached: () => Promise<FeedCache | null>;
332
- export declare const slackRefresh: () => Promise<FeedCache | null>;
333
- export declare const mailCached: () => Promise<FeedCache | null>;
334
- export declare const mailRefresh: () => Promise<FeedCache | null>;
335
278
  export interface UsageBucket {
336
279
  tokens: number;
337
280
  cost: number;
@@ -374,7 +317,6 @@ export interface AgentSession {
374
317
  title: string;
375
318
  }
376
319
  export declare const sessionList: () => Promise<AgentSession[]>;
377
- export declare const askAssistant: (message: string, sessionId: string, resume: boolean, userName: string, jiraSite: string) => Promise<string>;
378
320
  export interface ScriptJob {
379
321
  id: string;
380
322
  name: string;
@@ -441,6 +383,18 @@ export declare const fsRead: (path: string) => Promise<string>;
441
383
  /** Raw bytes, for a file that is not text — fsRead decodes as UTF-8 and would corrupt it. */
442
384
  export declare const fsReadBytes: (path: string) => Promise<Uint8Array<ArrayBuffer>>;
443
385
  export declare const fsSize: (path: string) => Promise<number>;
386
+ /** What is at a remote path. A missing one is `exists: false`, not an error. */
387
+ export interface RemoteStat {
388
+ exists: boolean;
389
+ dir: boolean;
390
+ size: number;
391
+ mtimeMs: number;
392
+ }
393
+ export declare const remoteStat: (path: string) => Promise<RemoteStat>;
394
+ /** The server's home folder as host:/home/user (host+sudo: when it runs as root). */
395
+ export declare const remoteHome: (host: string, sudo: boolean) => Promise<string>;
396
+ /** Host names from ~/.ssh/config, without patterns. */
397
+ export declare const sshHosts: () => Promise<string[]>;
444
398
  export declare const fsWrite: (path: string, content: string) => Promise<void>;
445
399
  /** Raw bytes — saving a response that is an image or a PDF, which a string would corrupt. */
446
400
  export declare const fsWriteBytes: (path: string, bytes: Uint8Array) => Promise<void>;
@@ -465,6 +419,30 @@ export declare const vaultDataRead: (name: string) => Promise<string>;
465
419
  export declare const vaultDataWrite: (name: string, text: string) => Promise<void>;
466
420
  /** Relaunch Deck — the same binary, so a dev instance stays dev. Used by the plugin toggle. */
467
421
  export declare const restartApp: () => Promise<void>;
422
+ /** Fetch the VPS's Script Runner run log over SSH into the local run-log-vps config (vpsjobs.rs). */
423
+ export declare const vpsRunsPull: () => Promise<void>;
424
+ /** What Rust saw of this launch, as Unix ms: process creation and the setup() span. Null until
425
+ * setup() has finished, which is before any page script runs. */
426
+ export interface StartupMarks {
427
+ process: number;
428
+ setupStart: number;
429
+ setupEnd: number;
430
+ }
431
+ export declare const startupMarks: () => Promise<StartupMarks | null>;
432
+ /** What a backup file holds: the Deck that wrote it, when, and how many of each thing. */
433
+ export interface BackupSummary {
434
+ deck: string;
435
+ created: string;
436
+ configs: number;
437
+ plugins: number;
438
+ languages: number;
439
+ notes: number;
440
+ }
441
+ /** Every config, plugin and language to one file, credentials left out (backup.rs). */
442
+ export declare const backupExport: (path: string) => Promise<BackupSummary>;
443
+ export declare const backupInspect: (path: string) => Promise<BackupSummary>;
444
+ /** Writes the backup over this machine's copies. Deck should restart afterwards. */
445
+ export declare const backupRestore: (path: string) => Promise<BackupSummary>;
468
446
  /** Copy a plugin folder into the plugins directory. Returns its id. Validates before writing. */
469
447
  export declare const installPlugin: (src: string) => Promise<string>;
470
448
  /** One file of a plugin, as the registry describes it. */
@@ -0,0 +1,181 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /** How to launch an adapter: a language's `debug.adapter` block, resolved by lsp.rs's rules. */
3
+ export interface AdapterSpec {
4
+ strategy: string;
5
+ command?: string;
6
+ module?: string;
7
+ args?: string[];
8
+ }
9
+ export interface Transport {
10
+ start(adapter: AdapterSpec, cwd: string): Promise<string>;
11
+ /** Another connection to a server adapter: the child session a `startDebugging` asks for. */
12
+ connect(parent: string): Promise<string>;
13
+ send(session: string, body: string): void;
14
+ stop(session: string): void;
15
+ /** Called once, before the first start: every message and every exit, for every session. */
16
+ listen(onMessage: (session: string, body: string) => void, onExit: (session: string) => void): Promise<void>;
17
+ }
18
+ export declare const tauriTransport: Transport;
19
+ export interface Frame {
20
+ id: number;
21
+ name: string;
22
+ path?: string;
23
+ line: number;
24
+ column: number;
25
+ }
26
+ export interface Variable {
27
+ name: string;
28
+ value: string;
29
+ type?: string;
30
+ ref: number;
31
+ }
32
+ export interface OutputLine {
33
+ id: number;
34
+ category: string;
35
+ text: string;
36
+ }
37
+ /** A line breakpoint as the editor holds it. `verified` and `line` are the adapter's answer. */
38
+ export interface Breakpoint {
39
+ line: number;
40
+ condition?: string;
41
+ verified?: boolean;
42
+ message?: string;
43
+ /** false: switched off, kept in the list and the gutter but not sent to the adapter. */
44
+ enabled?: boolean;
45
+ }
46
+ export type Status = "starting" | "running" | "paused" | "ended";
47
+ export interface DebugState {
48
+ /** The session, or null when nothing is being debugged. Ended sessions stay until the next start. */
49
+ session: null | {
50
+ /** The connection requests go to: the adapter's, or the newest child session's. */
51
+ id: string;
52
+ /**
53
+ * Every connection of this session, the adapter's first. js-debug answers a launch by asking
54
+ * for a child session (`startDebugging`) on a second connection, and the program's stops,
55
+ * stack and variables are all on that one; the first is what ends the whole tree.
56
+ */
57
+ conns: string[];
58
+ name: string;
59
+ status: Status;
60
+ /** The thread that stopped, for every request that needs one (Dart isolates are threads). */
61
+ threadId?: number;
62
+ /** Why it paused: "breakpoint", "step", "exception", "pause", "entry". */
63
+ reason?: string;
64
+ /** The stopped thread's stack, top first. Empty while running. */
65
+ frames: Frame[];
66
+ /** The frame being looked at (index into `frames`): the top one on each stop, or a picked one. */
67
+ frame: number;
68
+ /** Counts stops, so a view of variables can tell this pause from the last one at the same line. */
69
+ stops: number;
70
+ /** The exception filters the adapter offers ("All", "Unhandled" for Dart), from `initialize`. */
71
+ filters: {
72
+ filter: string;
73
+ label: string;
74
+ default?: boolean;
75
+ }[];
76
+ /** The adapter's language ("dart", "python"): exception choices are kept per language. */
77
+ type: string;
78
+ /** A launched program ends with the session; an attached one is only detached. */
79
+ request: "launch" | "attach";
80
+ /** A stop on an exception: what was thrown, as the adapter describes it. */
81
+ description?: string;
82
+ error?: string;
83
+ /** The language, when the start said (for its debugger's Install button). */
84
+ languageId?: string;
85
+ /** The adapter never started or never answered: it is, most likely, not installed. */
86
+ notInstalled?: boolean;
87
+ };
88
+ output: OutputLine[];
89
+ /** The exception filters switched on, or null for the adapter's defaults. Kept across sessions. */
90
+ /**
91
+ * The exception filters switched on, per adapter type, or absent for that adapter's defaults.
92
+ * Per type because each adapter names its own ("Unhandled" for Dart, "uncaught" for Python).
93
+ */
94
+ exceptionFilters: Record<string, string[]>;
95
+ /** Breakpoints by file path, as the editor set them. */
96
+ breakpoints: Record<string, Breakpoint[]>;
97
+ }
98
+ /**
99
+ * The key a file's breakpoints are kept under: backslashes, as Windows tools and the adapter write
100
+ * paths. Two spellings of one file (slash direction, drive-letter case) must not hold two lists.
101
+ */
102
+ export declare const bpKey: (path: string) => string;
103
+ /** Whether two paths name the same file (Windows: case-insensitive). */
104
+ export declare const samePath: (a: string, b: string) => boolean;
105
+ /** What a start needs: the adapter, where to run it, and the launch or attach arguments. */
106
+ export interface StartOptions {
107
+ name: string;
108
+ adapter: AdapterSpec;
109
+ cwd: string;
110
+ request: "launch" | "attach";
111
+ /** Passed to the adapter as the request's arguments (a launch.json configuration, more or less). */
112
+ args: Record<string, unknown>;
113
+ adapterId?: string;
114
+ /** What to install when the adapter will not start (language.json `debug.install`), in words. */
115
+ install?: string;
116
+ /** The language being debugged, so the panel can offer its debugger's Install button. */
117
+ languageId?: string;
118
+ }
119
+ type Msg = {
120
+ seq: number;
121
+ type: string;
122
+ request_seq?: number;
123
+ success?: boolean;
124
+ message?: string;
125
+ command?: string;
126
+ event?: string;
127
+ body?: Record<string, unknown>;
128
+ };
129
+ export declare function createDebugger(transport: Transport): {
130
+ subscribe: (fn: () => void) => () => void;
131
+ getState: () => DebugState;
132
+ start: (o: StartOptions) => Promise<void>;
133
+ stop: (terminate?: boolean) => Promise<void>;
134
+ continue: () => Promise<Msg>;
135
+ next: () => Promise<Msg>;
136
+ stepIn: () => Promise<Msg>;
137
+ stepOut: () => Promise<Msg>;
138
+ pause: () => Promise<Msg>;
139
+ /** The scopes of a frame (Locals, Globals…), each with the reference its variables are read by. */
140
+ scopes(frameId: number): Promise<{
141
+ name: string;
142
+ ref: number;
143
+ }[]>;
144
+ variables: (ref: number) => Promise<Variable[]>;
145
+ /** Evaluate in a frame: `watch` for the watch list, `repl` for the console, `hover` for the editor. */
146
+ evaluate(expression: string, frameId?: number, context?: "watch" | "repl" | "hover"): Promise<{
147
+ value: string;
148
+ ref: number;
149
+ error?: undefined;
150
+ } | {
151
+ error: string;
152
+ value?: undefined;
153
+ ref?: undefined;
154
+ }>;
155
+ /** Replace a file's breakpoints, and tell the adapter if a session is running. */
156
+ setBreakpoints: (path: string, list: Breakpoint[]) => void;
157
+ /** Add a breakpoint on a line, or remove the one there. */
158
+ toggleBreakpoint(path: string, line: number): void;
159
+ /** Set or clear a line's condition, adding the breakpoint if there is none. */
160
+ setCondition(path: string, line: number, condition: string): void;
161
+ /** Switch a breakpoint on or off without removing it. */
162
+ setEnabled(path: string, line: number, on: boolean): void;
163
+ /**
164
+ * The breakpoints' lines after an edit moved them. `lines` is in the order of the file's
165
+ * breakpoints; two that edits brought onto one line become one.
166
+ */
167
+ moveBreakpoints(path: string, lines: (number | undefined)[]): void;
168
+ breakpointsFor: (path: string) => Breakpoint[];
169
+ /** Look at another frame of the stopped thread's stack (the call stack's click). */
170
+ selectFrame(i: number): void;
171
+ clearOutput: () => void;
172
+ activeFilters: () => string[];
173
+ /** Choose which exceptions pause the program; remembered, and sent to a running adapter. */
174
+ setExceptionFilters(filters: string[]): void;
175
+ /** The debug console's input: echo it, evaluate it in the frame being looked at, print the answer. */
176
+ repl(expression: string): Promise<void>;
177
+ };
178
+ export type Debugger = ReturnType<typeof createDebugger>;
179
+ /** Deck's debugger. */
180
+ export declare const debug: Debugger;
181
+ export {};
@@ -0,0 +1,13 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /**
3
+ * Text from a file's bytes, by its byte-order mark: UTF-16 when it has one (what `>` writes in
4
+ * Windows PowerShell 5.1), else UTF-8, else the Windows code page.
5
+ *
6
+ * `utf8` is false when the bytes are not UTF-8, so writing the text back (which Deck always does
7
+ * as UTF-8) would change the file's encoding. A UTF-8 BOM is kept in the text, as `fs_read` and
8
+ * the git text commands keep it, so the same file reads the same either way.
9
+ */
10
+ export declare function decodeText(b: Uint8Array): {
11
+ text: string;
12
+ utf8: boolean;
13
+ };
@@ -0,0 +1,28 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import { type LucideIcon } from "lucide-react";
3
+ import { type ImportedPack } from "./bridge";
4
+ export type IconRef = {
5
+ kind: "lucide";
6
+ icon: LucideIcon;
7
+ } | {
8
+ kind: "url";
9
+ name: string;
10
+ } | {
11
+ kind: "src";
12
+ src: string;
13
+ };
14
+ export interface IconTheme {
15
+ id: string;
16
+ label: string;
17
+ file(name: string): IconRef;
18
+ folder(name: string, open: boolean): IconRef;
19
+ }
20
+ export declare const ICON_THEMES: Record<string, IconTheme>;
21
+ export declare function listPacks(): Promise<ImportedPack[]>;
22
+ export declare function loadImportedThemes(): Promise<void>;
23
+ export declare function addPack(pack: ImportedPack): Promise<void>;
24
+ export declare function removePack(id: string): Promise<void>;
25
+ export declare function allThemes(): IconTheme[];
26
+ export declare function themeById(id: string): IconTheme;
27
+ export declare function resolveIconUrl(svgName: string): Promise<string | null>;
28
+ export declare function useIconThemesVersion(): number;
@@ -0,0 +1,37 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /** Which hints the editor shows: Settings → Editor → Display. */
3
+ export type InlayShow = "all" | "types" | "parameters" | "off";
4
+ export interface HintPart<U> {
5
+ label: string;
6
+ tooltip?: string | {
7
+ value: string;
8
+ };
9
+ location?: {
10
+ uri: U;
11
+ range: {
12
+ startLineNumber: number;
13
+ startColumn: number;
14
+ endLineNumber: number;
15
+ endColumn: number;
16
+ };
17
+ };
18
+ }
19
+ export interface Hint<U> {
20
+ label: string | HintPart<U>[];
21
+ position: {
22
+ lineNumber: number;
23
+ column: number;
24
+ };
25
+ kind?: number;
26
+ paddingLeft?: boolean;
27
+ paddingRight?: boolean;
28
+ tooltip?: string | {
29
+ value: string;
30
+ };
31
+ }
32
+ /**
33
+ * Monaco's hints for a `textDocument/inlayHint` reply, keeping only the kinds `show` asks for.
34
+ * LSP positions are 0-based and Monaco's 1-based. A hint with no kind (a server may send one) is
35
+ * kept by "all" and dropped by a filter, since it cannot be said to be either.
36
+ */
37
+ export declare function toInlayHints<U>(reply: any, show: InlayShow, toUri: (uri: string) => U): Hint<U>[];
@@ -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" | "http" | "terminal" | "graph" | "graph-visible" | `plugin:${string}`;
13
+ export type Scope = "app" | "workspaces" | "editor" | "terminal" | `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 {
@@ -38,9 +38,23 @@ export type KeyAction = (() => void) | {
38
38
  export declare function onKey(id: string, run: () => void, when?: () => boolean): () => void;
39
39
  /** Register several at once — what a module with a dozen chords wants. */
40
40
  export declare function onKeys(map: Record<string, KeyAction>): () => void;
41
- /** Claim a scope. Returns a disposer. */
42
- export declare function pushScope(scope: Scope): () => void;
41
+ /**
42
+ * Claim a scope. `holds` says whether the claim counts right now (default: always). Returns a
43
+ * disposer.
44
+ */
45
+ export declare function pushScope(scope: Scope, holds?: () => boolean): () => void;
43
46
  export declare function activeScopes(): ReadonlySet<Scope>;
47
+ /**
48
+ * Whether the tool being rendered has the keyboard. A pane provides one that answers "is focus in
49
+ * me" (see ContentPane in Terminals.tsx); outside any pane a tool owns the window and always has it.
50
+ *
51
+ * Without this, a tool's shortcuts were live wherever focus was the moment it mounted, and a
52
+ * terminal swallows every chord something else has claimed, so an HTTP pane on screen took
53
+ * Ctrl+Enter away from the shell beside it.
54
+ */
55
+ export declare const ScopeGate: import("react").Context<() => boolean>;
56
+ /** Claim `scope` for as long as the component is mounted, while its pane (if any) has focus. */
57
+ export declare function useScope(scope: Scope): void;
44
58
  /**
45
59
  * Run whatever this event is bound to, and say whether anything did.
46
60
  *