deck-plugin-sdk 0.18.0 → 0.21.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/package.json +1 -1
- package/shim/bridge.js +11 -0
- package/types/components/ConfirmDialog.d.ts +1 -1
- package/types/core/bridge.d.ts +76 -3
- package/types/core/debugtargets.d.ts +38 -0
- package/types/core/editorsettings.d.ts +4 -0
- package/types/core/monaco.d.ts +2 -0
- package/types/core/terminals.d.ts +3 -1
package/package.json
CHANGED
package/shim/bridge.js
CHANGED
|
@@ -34,6 +34,9 @@ export const fsCopy = (...a) => b().fsCopy(...a);
|
|
|
34
34
|
export const fsCreateDir = (...a) => b().fsCreateDir(...a);
|
|
35
35
|
export const fsCreateFile = (...a) => b().fsCreateFile(...a);
|
|
36
36
|
export const fsDelete = (...a) => b().fsDelete(...a);
|
|
37
|
+
export const fsFiles = (...a) => b().fsFiles(...a);
|
|
38
|
+
export const fsFind = (...a) => b().fsFind(...a);
|
|
39
|
+
export const fsHash = (...a) => b().fsHash(...a);
|
|
37
40
|
export const fsHomeDir = (...a) => b().fsHomeDir(...a);
|
|
38
41
|
export const fsList = (...a) => b().fsList(...a);
|
|
39
42
|
export const fsMove = (...a) => b().fsMove(...a);
|
|
@@ -46,6 +49,8 @@ export const fsReveal = (...a) => b().fsReveal(...a);
|
|
|
46
49
|
export const fsSaveUnique = (...a) => b().fsSaveUnique(...a);
|
|
47
50
|
export const fsSearch = (...a) => b().fsSearch(...a);
|
|
48
51
|
export const fsSize = (...a) => b().fsSize(...a);
|
|
52
|
+
export const fsThumbnail = (...a) => b().fsThumbnail(...a);
|
|
53
|
+
export const fsTrash = (...a) => b().fsTrash(...a);
|
|
49
54
|
export const fsWrite = (...a) => b().fsWrite(...a);
|
|
50
55
|
export const fsWriteBytes = (...a) => b().fsWriteBytes(...a);
|
|
51
56
|
export const getAutostart = (...a) => b().getAutostart(...a);
|
|
@@ -86,6 +91,7 @@ export const gitMerge = (...a) => b().gitMerge(...a);
|
|
|
86
91
|
export const gitMergeAs = (...a) => b().gitMergeAs(...a);
|
|
87
92
|
export const gitMergeBase = (...a) => b().gitMergeBase(...a);
|
|
88
93
|
export const gitPendingOp = (...a) => b().gitPendingOp(...a);
|
|
94
|
+
export const gitPoll = (...a) => b().gitPoll(...a);
|
|
89
95
|
export const gitPull = (...a) => b().gitPull(...a);
|
|
90
96
|
export const gitPullRebase = (...a) => b().gitPullRebase(...a);
|
|
91
97
|
export const gitPush = (...a) => b().gitPush(...a);
|
|
@@ -116,6 +122,8 @@ export const gitTagDeleteRemote = (...a) => b().gitTagDeleteRemote(...a);
|
|
|
116
122
|
export const gitTagPush = (...a) => b().gitTagPush(...a);
|
|
117
123
|
export const gitUndoCommit = (...a) => b().gitUndoCommit(...a);
|
|
118
124
|
export const gitUnstage = (...a) => b().gitUnstage(...a);
|
|
125
|
+
export const glabApi = (...a) => b().glabApi(...a);
|
|
126
|
+
export const glabRun = (...a) => b().glabRun(...a);
|
|
119
127
|
export const googleAccount = (...a) => b().googleAccount(...a);
|
|
120
128
|
export const googleSignIn = (...a) => b().googleSignIn(...a);
|
|
121
129
|
export const googleSignOut = (...a) => b().googleSignOut(...a);
|
|
@@ -137,6 +145,7 @@ export const listApps = (...a) => b().listApps(...a);
|
|
|
137
145
|
export const listInstalled = (...a) => b().listInstalled(...a);
|
|
138
146
|
export const mailCached = (...a) => b().mailCached(...a);
|
|
139
147
|
export const mailRefresh = (...a) => b().mailRefresh(...a);
|
|
148
|
+
export const mediaMeta = (...a) => b().mediaMeta(...a);
|
|
140
149
|
export const mediaSetNowPlaying = (...a) => b().mediaSetNowPlaying(...a);
|
|
141
150
|
export const mediaSetPlayback = (...a) => b().mediaSetPlayback(...a);
|
|
142
151
|
export const memUsage = (...a) => b().memUsage(...a);
|
|
@@ -171,11 +180,13 @@ export const readTermLayout = (...a) => b().readTermLayout(...a);
|
|
|
171
180
|
export const readTrackMeta = (...a) => b().readTrackMeta(...a);
|
|
172
181
|
export const removeClaudeHooks = (...a) => b().removeClaudeHooks(...a);
|
|
173
182
|
export const removeClaudeMcp = (...a) => b().removeClaudeMcp(...a);
|
|
183
|
+
export const removeLanguage = (...a) => b().removeLanguage(...a);
|
|
174
184
|
export const restartApp = (...a) => b().restartApp(...a);
|
|
175
185
|
export const revealInFolder = (...a) => b().revealInFolder(...a);
|
|
176
186
|
export const runScriptNow = (...a) => b().runScriptNow(...a);
|
|
177
187
|
export const sessionList = (...a) => b().sessionList(...a);
|
|
178
188
|
export const setAutostart = (...a) => b().setAutostart(...a);
|
|
189
|
+
export const setDebugTargets = (...a) => b().setDebugTargets(...a);
|
|
179
190
|
export const setVaultRoot = (...a) => b().setVaultRoot(...a);
|
|
180
191
|
export const setWallpaper = (...a) => b().setWallpaper(...a);
|
|
181
192
|
export const setupChecks = (...a) => b().setupChecks(...a);
|
package/types/core/bridge.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
import { type DebugTarget } from "./debugtargets";
|
|
2
3
|
import type { AccentColor, BgPreset, Density, TermTheme } from "./theme";
|
|
3
4
|
/** Open a URL in the default browser. */
|
|
4
5
|
export declare const openExternal: (url: string) => Promise<void>;
|
|
@@ -8,6 +9,8 @@ export interface AppProc {
|
|
|
8
9
|
path: string;
|
|
9
10
|
}
|
|
10
11
|
export declare const configRead: (name: string) => Promise<string>;
|
|
12
|
+
/** Raw bytes rather than a JSON argument: a 13.8MB pinboard parsed as JSON on Deck's UI thread
|
|
13
|
+
* held every other command up for 200ms per save (see config_write in config.rs). */
|
|
11
14
|
export declare const configWrite: (name: string, json: string) => Promise<void>;
|
|
12
15
|
export declare const getVaultRoot: () => Promise<string>;
|
|
13
16
|
export declare const setVaultRoot: (path: string) => Promise<void>;
|
|
@@ -99,6 +102,16 @@ export interface MemServer {
|
|
|
99
102
|
mem: number;
|
|
100
103
|
pid: number;
|
|
101
104
|
}
|
|
105
|
+
/** One process behind the figures, largest first. Only filled when memUsage(true) asks. */
|
|
106
|
+
export interface MemProc {
|
|
107
|
+
pid: number;
|
|
108
|
+
name: string;
|
|
109
|
+
cmd: string;
|
|
110
|
+
mem: number;
|
|
111
|
+
group: "deck" | "server" | "agent" | "pane-agent" | "pane";
|
|
112
|
+
/** The language server's session id, or the terminal pane's id. */
|
|
113
|
+
owner: string;
|
|
114
|
+
}
|
|
102
115
|
export interface MemUsage {
|
|
103
116
|
deck: number;
|
|
104
117
|
agents: number;
|
|
@@ -116,8 +129,10 @@ export interface MemUsage {
|
|
|
116
129
|
/** claude running inside a pane. Also not part of `deck`. */
|
|
117
130
|
pane_agents: number;
|
|
118
131
|
pane_agent_count: number;
|
|
132
|
+
procs: MemProc[];
|
|
119
133
|
}
|
|
120
|
-
|
|
134
|
+
/** `detail` also lists every process with its command line: for the open popover, not the poll. */
|
|
135
|
+
export declare const memUsage: (detail?: boolean) => Promise<MemUsage>;
|
|
121
136
|
export declare const listApps: () => Promise<AppProc[]>;
|
|
122
137
|
export declare const listInstalled: () => Promise<AppProc[]>;
|
|
123
138
|
export declare const closeApp: (target: string) => Promise<string>;
|
|
@@ -420,6 +435,8 @@ export declare const fsList: (dir: string) => Promise<FsEntry[]>;
|
|
|
420
435
|
export declare const pluginsDir: () => Promise<string>;
|
|
421
436
|
/** `%APPDATA%\Deck\languages` (Deck-Dev in a debug build), created on first call. */
|
|
422
437
|
export declare const languagesDir: () => Promise<string>;
|
|
438
|
+
/** Delete a language definition's folder (by its folder name). The server and debugger it names stay installed. */
|
|
439
|
+
export declare const removeLanguage: (folder: string) => Promise<void>;
|
|
423
440
|
export declare const fsRead: (path: string) => Promise<string>;
|
|
424
441
|
/** Raw bytes, for a file that is not text — fsRead decodes as UTF-8 and would corrupt it. */
|
|
425
442
|
export declare const fsReadBytes: (path: string) => Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -503,6 +520,8 @@ export declare const procKill: (id: string) => Promise<void>;
|
|
|
503
520
|
export declare const fsCreateDir: (dir: string, name: string) => Promise<string>;
|
|
504
521
|
export declare const fsRename: (path: string, newName: string) => Promise<string>;
|
|
505
522
|
export declare const fsDelete: (path: string) => Promise<void>;
|
|
523
|
+
/** Move to the Recycle Bin, so it can be restored (fsDelete removes for good). */
|
|
524
|
+
export declare const fsTrash: (path: string) => Promise<void>;
|
|
506
525
|
export declare const fsCopy: (src: string, dstDir: string) => Promise<string>;
|
|
507
526
|
export declare const fsReveal: (path: string) => Promise<void>;
|
|
508
527
|
export declare const installClaudeHooks: () => Promise<void>;
|
|
@@ -544,6 +563,11 @@ export interface GitInfo {
|
|
|
544
563
|
behind: number;
|
|
545
564
|
}
|
|
546
565
|
export declare const gitInfo: (dir: string) => Promise<GitInfo>;
|
|
566
|
+
/** gitStatus and gitInfo in one `git status -b`: what the editor's poll asks for every 3s. */
|
|
567
|
+
export declare const gitPoll: (dir: string) => Promise<{
|
|
568
|
+
rows: GitStatusRow[];
|
|
569
|
+
info: GitInfo;
|
|
570
|
+
}>;
|
|
547
571
|
export declare const gitCommit: (dir: string, message: string) => Promise<string>;
|
|
548
572
|
export declare const gitPush: (dir: string) => Promise<string>;
|
|
549
573
|
export declare const gitPull: (dir: string) => Promise<string>;
|
|
@@ -572,11 +596,13 @@ export interface GraphCommit {
|
|
|
572
596
|
refs: string[];
|
|
573
597
|
}
|
|
574
598
|
export declare const gitLogGraph: (dir: string, skip: number, rel?: string, refs?: string[]) => Promise<GraphCommit[]>;
|
|
599
|
+
/** `old`: a rename's or copy's path before the commit, which its parent side is read from. */
|
|
575
600
|
export interface CommitFile {
|
|
576
601
|
rel: string;
|
|
577
602
|
letter: string;
|
|
578
603
|
adds: number;
|
|
579
604
|
dels: number;
|
|
605
|
+
old?: string;
|
|
580
606
|
}
|
|
581
607
|
export declare const gitCommitFiles: (dir: string, hash: string) => Promise<CommitFile[]>;
|
|
582
608
|
export declare const gitShowFile: (dir: string, rev: string, rel: string) => Promise<string>;
|
|
@@ -632,11 +658,18 @@ export declare const ghPrThreads: (dir: string, number: number) => Promise<strin
|
|
|
632
658
|
export declare const ghPrLineComment: (dir: string, number: number, commit: string, path: string, line: number, side: "LEFT" | "RIGHT", body: string) => Promise<string>;
|
|
633
659
|
export declare const ghThreadReply: (dir: string, thread: string, body: string) => Promise<string>;
|
|
634
660
|
export declare const ghThreadResolve: (dir: string, thread: string, resolve: boolean) => Promise<string>;
|
|
661
|
+
/** The GitLab CLI, `glab mr …` only. Rejects with "glab-missing" when glab is not installed. */
|
|
662
|
+
export declare const glabRun: (dir: string, args: string[]) => Promise<string>;
|
|
663
|
+
/**
|
|
664
|
+
* One GitLab REST request about this repo's merge requests (`projects/:id/merge_requests…` or
|
|
665
|
+
* `user`). `fields` go as strings; `json` values must be objects or arrays.
|
|
666
|
+
*/
|
|
667
|
+
export declare const glabApi: (dir: string, method: "GET" | "POST" | "PUT", path: string, fields?: [string, string][], json?: Record<string, object>) => Promise<string>;
|
|
635
668
|
/** The files that differ between two revisions. */
|
|
636
669
|
export declare const gitRangeFiles: (dir: string, from: string, to: string) => Promise<CommitFile[]>;
|
|
637
670
|
export declare const gitMergeBase: (dir: string, a: string, b: string) => Promise<string>;
|
|
638
|
-
/** Fetch pull request N's head from `remote`, so its commits can be diffed here. */
|
|
639
|
-
export declare const gitFetchPr: (dir: string, remote: string, number: number, base: string) => Promise<string>;
|
|
671
|
+
/** Fetch pull request N's head from `remote`, so its commits can be diffed here. `gitlab`: a merge request's. */
|
|
672
|
+
export declare const gitFetchPr: (dir: string, remote: string, number: number, base: string, gitlab?: boolean) => Promise<string>;
|
|
640
673
|
export declare const gitBranchRename: (dir: string, from: string, to: string) => Promise<string>;
|
|
641
674
|
export declare const gitPendingOp: (dir: string) => Promise<string>;
|
|
642
675
|
export declare const gitAbortOp: (dir: string, op: string) => Promise<string>;
|
|
@@ -671,6 +704,38 @@ export interface SearchOpts {
|
|
|
671
704
|
includes: string;
|
|
672
705
|
excludes: string;
|
|
673
706
|
}
|
|
707
|
+
/** Every file under `dir` (absolute paths), .gitignore respected — the editor's Ctrl+P. */
|
|
708
|
+
export declare const fsFiles: (dir: string) => Promise<string[]>;
|
|
709
|
+
/** One file `fsFind` found. `mtime` is milliseconds since the epoch. */
|
|
710
|
+
export interface FoundFile {
|
|
711
|
+
path: string;
|
|
712
|
+
size: number;
|
|
713
|
+
mtime: number;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Every file with one of `exts` (no dot) under `roots`, or under every fixed drive when roots is
|
|
717
|
+
* null, skipping folders named in `excludeDirs` at any depth and files under `minSize` bytes.
|
|
718
|
+
* A walk of whole drives takes on the order of a minute.
|
|
719
|
+
*/
|
|
720
|
+
export declare const fsFind: (roots: string[] | null, exts: string[], excludeDirs: string[], minSize: number) => Promise<FoundFile[]>;
|
|
721
|
+
/** Windows' own thumbnail of a file (what Explorer shows), as PNG bytes fitting `size` x `size`.
|
|
722
|
+
* Rejects when Windows has none for it. */
|
|
723
|
+
/** What Windows knows about a photo or video (its Properties' Details tab). Absent fields are null. */
|
|
724
|
+
export interface MediaMeta {
|
|
725
|
+
/** Date taken or recorded, ms since the epoch. */
|
|
726
|
+
taken: number | null;
|
|
727
|
+
width: number | null;
|
|
728
|
+
height: number | null;
|
|
729
|
+
camera: string | null;
|
|
730
|
+
lat: number | null;
|
|
731
|
+
lon: number | null;
|
|
732
|
+
duration_ms: number | null;
|
|
733
|
+
}
|
|
734
|
+
/** The properties of each path, in order; one that cannot be read comes back all null. */
|
|
735
|
+
export declare const mediaMeta: (paths: string[]) => Promise<MediaMeta[]>;
|
|
736
|
+
/** SHA-256 of each file's contents, in order; null for one that cannot be read. */
|
|
737
|
+
export declare const fsHash: (paths: string[]) => Promise<(string | null)[]>;
|
|
738
|
+
export declare const fsThumbnail: (path: string, size: number) => Promise<Uint8Array<ArrayBuffer>>;
|
|
674
739
|
export declare const fsSearch: (dir: string, query: string, o: SearchOpts) => Promise<SearchHit[]>;
|
|
675
740
|
export declare const fsReplace: (dir: string, query: string, replacement: string, o: SearchOpts, files?: string[], line?: number) => Promise<number>;
|
|
676
741
|
export interface DbQueryResult {
|
|
@@ -712,3 +777,11 @@ export declare const dbSchema: (handle: number) => Promise<DbSchema>;
|
|
|
712
777
|
export declare const sshTunnelOpen: (host: string, remote: string) => Promise<[number, number]>;
|
|
713
778
|
export declare const sshTunnelClose: (id: number) => Promise<void>;
|
|
714
779
|
export declare const sshTunnelList: () => Promise<[number, number][]>;
|
|
780
|
+
/**
|
|
781
|
+
* Offer programs to the editor's debugger: a plugin that runs something debuggable (the Flutter
|
|
782
|
+
* plugin's runs) publishes them here, and the Run and Debug panel lists them to attach to. Pass
|
|
783
|
+
* the plugin's whole current list each time, under its own `source`; an empty list removes it.
|
|
784
|
+
* See core/debugtargets.ts.
|
|
785
|
+
*/
|
|
786
|
+
export declare const setDebugTargets: (source: string, targets: DebugTarget[]) => void;
|
|
787
|
+
export type { DebugTarget } from "./debugtargets";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
export interface DebugTarget {
|
|
3
|
+
/** Unique within its source. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** What the panel shows: "Attach to netapp (Windows)". */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The language whose debug adapter runs it (its language.json `debug` block). */
|
|
8
|
+
languageId: string;
|
|
9
|
+
request: "attach" | "launch";
|
|
10
|
+
/** The adapter's attach or launch arguments, e.g. `{ vmServiceUri }`. */
|
|
11
|
+
args: Record<string, unknown>;
|
|
12
|
+
/** Where the program's source is: the adapter's working directory. */
|
|
13
|
+
cwd: string;
|
|
14
|
+
/**
|
|
15
|
+
* The adapter to use when the language's definition names none (a language.json without a
|
|
16
|
+
* `debug` block). The publisher knows what it runs; Deck does not hardcode any language.
|
|
17
|
+
*/
|
|
18
|
+
adapter?: {
|
|
19
|
+
strategy: string;
|
|
20
|
+
command?: string;
|
|
21
|
+
module?: string;
|
|
22
|
+
args?: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A language's launch template with the editor's variables filled in, the names VS Code uses in
|
|
27
|
+
* launch.json: `${file}`, `${fileDirname}`, `${fileBasename}`, `${workspaceFolder}`. Every string
|
|
28
|
+
* in the template, at any depth; anything else is kept as it is. An unknown variable is left in
|
|
29
|
+
* place, so a typo shows in what the adapter is sent rather than silently becoming empty.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fillLaunch(template: unknown, vars: {
|
|
32
|
+
file: string;
|
|
33
|
+
workspaceFolder: string;
|
|
34
|
+
}): unknown;
|
|
35
|
+
/** Replace one source's targets (an empty list removes them). */
|
|
36
|
+
export declare function setTargets(source: string, targets: DebugTarget[]): void;
|
|
37
|
+
export declare const getTargets: () => DebugTarget[];
|
|
38
|
+
export declare const subscribeTargets: (fn: () => void) => () => void;
|
|
@@ -17,6 +17,8 @@ export interface EditorSettings {
|
|
|
17
17
|
indentGuides: boolean;
|
|
18
18
|
bracketPairColorization: boolean;
|
|
19
19
|
stickyScroll: boolean;
|
|
20
|
+
/** Greyed-out types and parameter names the language server suggests, drawn inline. */
|
|
21
|
+
inlayHints: "all" | "types" | "parameters" | "off";
|
|
20
22
|
/**
|
|
21
23
|
* Markdown: float the formatting bar over the selection instead of pinning it above the note.
|
|
22
24
|
*
|
|
@@ -61,5 +63,7 @@ export declare const GRAPH_FONT_SIZES: number[];
|
|
|
61
63
|
export declare const DEFAULT_EDITOR_SETTINGS: EditorSettings;
|
|
62
64
|
export declare function updateEditorSettings(patch: Partial<EditorSettings>): void;
|
|
63
65
|
export declare function getEditorSettings(): EditorSettings;
|
|
66
|
+
/** For a store outside React that reacts to a setting (lsp.ts re-asks for inlay hints). */
|
|
67
|
+
export declare function subscribeEditorSettings(cb: () => void): () => void;
|
|
64
68
|
export declare function useEditorSettings(): EditorSettings;
|
|
65
69
|
export declare function monacoOptionsFrom(s: EditorSettings): MonacoNS.editor.IEditorOptions;
|
package/types/core/monaco.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare function addSemanticColors(rules: TokenColor[]): void;
|
|
|
26
26
|
* built-in one rather than silently losing to it.
|
|
27
27
|
*/
|
|
28
28
|
export declare function registerExtension(ext: string, languageId: string): void;
|
|
29
|
+
/** Give up every extension a language claimed: its definition was removed. */
|
|
30
|
+
export declare function forgetExtensions(languageId: string): void;
|
|
29
31
|
/**
|
|
30
32
|
* Map a filename to a Monaco language id.
|
|
31
33
|
*
|
|
@@ -225,7 +225,9 @@ export declare function moveLeaf(root: LayoutNode, srcId: string, targetId: stri
|
|
|
225
225
|
* caller wants to type into the pane it just made. Pair it with queueInput: the pane has no PTY
|
|
226
226
|
* until it is attached to a sized element, so anything written before then is dropped.
|
|
227
227
|
*/
|
|
228
|
-
export declare function openTabInWorkspace(wsId: string, title: string
|
|
228
|
+
export declare function openTabInWorkspace(wsId: string, title: string, opts?: {
|
|
229
|
+
besideActive?: boolean;
|
|
230
|
+
}): string | null;
|
|
229
231
|
export declare function applyDtCommand(op: string, args: Record<string, unknown>): string | void;
|
|
230
232
|
interface Instance {
|
|
231
233
|
term: Terminal;
|