deck-plugin-sdk 0.17.0 → 0.19.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 +3 -0
- package/shim/terminals.js +2 -0
- package/types/core/bridge.d.ts +16 -2
- package/types/core/editorsettings.d.ts +5 -0
- package/types/core/keys.d.ts +1 -1
- package/types/core/keystore.d.ts +18 -5
- package/types/core/terminals.d.ts +17 -1
package/package.json
CHANGED
package/shim/bridge.js
CHANGED
|
@@ -86,6 +86,7 @@ export const gitMerge = (...a) => b().gitMerge(...a);
|
|
|
86
86
|
export const gitMergeAs = (...a) => b().gitMergeAs(...a);
|
|
87
87
|
export const gitMergeBase = (...a) => b().gitMergeBase(...a);
|
|
88
88
|
export const gitPendingOp = (...a) => b().gitPendingOp(...a);
|
|
89
|
+
export const gitPoll = (...a) => b().gitPoll(...a);
|
|
89
90
|
export const gitPull = (...a) => b().gitPull(...a);
|
|
90
91
|
export const gitPullRebase = (...a) => b().gitPullRebase(...a);
|
|
91
92
|
export const gitPush = (...a) => b().gitPush(...a);
|
|
@@ -116,6 +117,8 @@ export const gitTagDeleteRemote = (...a) => b().gitTagDeleteRemote(...a);
|
|
|
116
117
|
export const gitTagPush = (...a) => b().gitTagPush(...a);
|
|
117
118
|
export const gitUndoCommit = (...a) => b().gitUndoCommit(...a);
|
|
118
119
|
export const gitUnstage = (...a) => b().gitUnstage(...a);
|
|
120
|
+
export const glabApi = (...a) => b().glabApi(...a);
|
|
121
|
+
export const glabRun = (...a) => b().glabRun(...a);
|
|
119
122
|
export const googleAccount = (...a) => b().googleAccount(...a);
|
|
120
123
|
export const googleSignIn = (...a) => b().googleSignIn(...a);
|
|
121
124
|
export const googleSignOut = (...a) => b().googleSignOut(...a);
|
package/shim/terminals.js
CHANGED
|
@@ -31,6 +31,7 @@ export const leafIds = (...a) => t().leafIds(...a);
|
|
|
31
31
|
export const loadLayoutOnce = (...a) => t().loadLayoutOnce(...a);
|
|
32
32
|
export const markAgentStarted = (...a) => t().markAgentStarted(...a);
|
|
33
33
|
export const moveLeaf = (...a) => t().moveLeaf(...a);
|
|
34
|
+
export const moveTabToZone = (...a) => t().moveTabToZone(...a);
|
|
34
35
|
export const moveWorkspace = (...a) => t().moveWorkspace(...a);
|
|
35
36
|
export const moveZone = (...a) => t().moveZone(...a);
|
|
36
37
|
export const mutateLayout = (...a) => t().mutateLayout(...a);
|
|
@@ -46,6 +47,7 @@ export const pasteInto = (...a) => t().pasteInto(...a);
|
|
|
46
47
|
export const publishLayout = (...a) => t().publishLayout(...a);
|
|
47
48
|
export const queueInput = (...a) => t().queueInput(...a);
|
|
48
49
|
export const refit = (...a) => t().refit(...a);
|
|
50
|
+
export const reorderTab = (...a) => t().reorderTab(...a);
|
|
49
51
|
export const restartPane = (...a) => t().restartPane(...a);
|
|
50
52
|
export const sendInput = (...a) => t().sendInput(...a);
|
|
51
53
|
export const setLeafLabel = (...a) => t().setLeafLabel(...a);
|
package/types/core/bridge.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface AppProc {
|
|
|
8
8
|
path: string;
|
|
9
9
|
}
|
|
10
10
|
export declare const configRead: (name: string) => Promise<string>;
|
|
11
|
+
/** Raw bytes rather than a JSON argument: a 13.8MB pinboard parsed as JSON on Deck's UI thread
|
|
12
|
+
* held every other command up for 200ms per save (see config_write in config.rs). */
|
|
11
13
|
export declare const configWrite: (name: string, json: string) => Promise<void>;
|
|
12
14
|
export declare const getVaultRoot: () => Promise<string>;
|
|
13
15
|
export declare const setVaultRoot: (path: string) => Promise<void>;
|
|
@@ -544,6 +546,11 @@ export interface GitInfo {
|
|
|
544
546
|
behind: number;
|
|
545
547
|
}
|
|
546
548
|
export declare const gitInfo: (dir: string) => Promise<GitInfo>;
|
|
549
|
+
/** gitStatus and gitInfo in one `git status -b`: what the editor's poll asks for every 3s. */
|
|
550
|
+
export declare const gitPoll: (dir: string) => Promise<{
|
|
551
|
+
rows: GitStatusRow[];
|
|
552
|
+
info: GitInfo;
|
|
553
|
+
}>;
|
|
547
554
|
export declare const gitCommit: (dir: string, message: string) => Promise<string>;
|
|
548
555
|
export declare const gitPush: (dir: string) => Promise<string>;
|
|
549
556
|
export declare const gitPull: (dir: string) => Promise<string>;
|
|
@@ -632,11 +639,18 @@ export declare const ghPrThreads: (dir: string, number: number) => Promise<strin
|
|
|
632
639
|
export declare const ghPrLineComment: (dir: string, number: number, commit: string, path: string, line: number, side: "LEFT" | "RIGHT", body: string) => Promise<string>;
|
|
633
640
|
export declare const ghThreadReply: (dir: string, thread: string, body: string) => Promise<string>;
|
|
634
641
|
export declare const ghThreadResolve: (dir: string, thread: string, resolve: boolean) => Promise<string>;
|
|
642
|
+
/** The GitLab CLI, `glab mr …` only. Rejects with "glab-missing" when glab is not installed. */
|
|
643
|
+
export declare const glabRun: (dir: string, args: string[]) => Promise<string>;
|
|
644
|
+
/**
|
|
645
|
+
* One GitLab REST request about this repo's merge requests (`projects/:id/merge_requests…` or
|
|
646
|
+
* `user`). `fields` go as strings; `json` values must be objects or arrays.
|
|
647
|
+
*/
|
|
648
|
+
export declare const glabApi: (dir: string, method: "GET" | "POST" | "PUT", path: string, fields?: [string, string][], json?: Record<string, object>) => Promise<string>;
|
|
635
649
|
/** The files that differ between two revisions. */
|
|
636
650
|
export declare const gitRangeFiles: (dir: string, from: string, to: string) => Promise<CommitFile[]>;
|
|
637
651
|
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>;
|
|
652
|
+
/** Fetch pull request N's head from `remote`, so its commits can be diffed here. `gitlab`: a merge request's. */
|
|
653
|
+
export declare const gitFetchPr: (dir: string, remote: string, number: number, base: string, gitlab?: boolean) => Promise<string>;
|
|
640
654
|
export declare const gitBranchRename: (dir: string, from: string, to: string) => Promise<string>;
|
|
641
655
|
export declare const gitPendingOp: (dir: string) => Promise<string>;
|
|
642
656
|
export declare const gitAbortOp: (dir: string, op: string) => Promise<string>;
|
|
@@ -52,7 +52,12 @@ export interface EditorSettings {
|
|
|
52
52
|
theme: "deck-dark" | "vs-dark" | "hc-black";
|
|
53
53
|
iconTheme: string;
|
|
54
54
|
diffSideBySide: boolean;
|
|
55
|
+
/** The git graph's commit list, in px. Its own setting rather than `fontSize`: that is a
|
|
56
|
+
* monospace code font, and the size someone wants for code is not the one for a commit list. */
|
|
57
|
+
graphFontSize: number;
|
|
55
58
|
}
|
|
59
|
+
/** The sizes the git graph offers — the Settings list and the Ctrl+wheel steps are the same. */
|
|
60
|
+
export declare const GRAPH_FONT_SIZES: number[];
|
|
56
61
|
export declare const DEFAULT_EDITOR_SETTINGS: EditorSettings;
|
|
57
62
|
export declare function updateEditorSettings(patch: Partial<EditorSettings>): void;
|
|
58
63
|
export declare function getEditorSettings(): EditorSettings;
|
package/types/core/keys.d.ts
CHANGED
|
@@ -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" | `plugin:${string}`;
|
|
13
|
+
export type Scope = "app" | "workspaces" | "editor" | "http" | "terminal" | "graph" | "graph-visible" | `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 {
|
package/types/core/keystore.d.ts
CHANGED
|
@@ -20,19 +20,32 @@ 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
|
+
/**
|
|
24
|
+
* An action, or an action with a `when` guard.
|
|
25
|
+
*
|
|
26
|
+
* `when` is how an action says "not here, not now" BEFORE the key is taken. The tree's Ctrl+C is
|
|
27
|
+
* the case it exists for: it only means something with focus in the file tree, and everywhere
|
|
28
|
+
* else Ctrl+C has to stay the text box's, Monaco's or the shell's. An action that simply did
|
|
29
|
+
* nothing was not enough — the key had already been claimed, so the browser's copy was cancelled
|
|
30
|
+
* and a focused terminal had swallowed it, and copy and paste broke across the whole window
|
|
31
|
+
* whenever the Editor was open.
|
|
32
|
+
*/
|
|
33
|
+
export type KeyAction = (() => void) | {
|
|
34
|
+
run: () => void;
|
|
35
|
+
when: () => boolean;
|
|
36
|
+
};
|
|
23
37
|
/** Register one action. Returns a disposer; call it on unmount. */
|
|
24
|
-
export declare function onKey(id: string, run: () => void): () => void;
|
|
38
|
+
export declare function onKey(id: string, run: () => void, when?: () => boolean): () => void;
|
|
25
39
|
/** Register several at once — what a module with a dozen chords wants. */
|
|
26
|
-
export declare function onKeys(map: Record<string,
|
|
40
|
+
export declare function onKeys(map: Record<string, KeyAction>): () => void;
|
|
27
41
|
/** Claim a scope. Returns a disposer. */
|
|
28
42
|
export declare function pushScope(scope: Scope): () => void;
|
|
29
43
|
export declare function activeScopes(): ReadonlySet<Scope>;
|
|
30
44
|
/**
|
|
31
45
|
* Run whatever this event is bound to, and say whether anything did.
|
|
32
46
|
*
|
|
33
|
-
* The caller
|
|
34
|
-
*
|
|
35
|
-
* with only three projects open).
|
|
47
|
+
* The caller preventDefaults only when this says something ran, so a chord nobody is listening
|
|
48
|
+
* for, or whose action's `when` declines, keeps its ordinary meaning.
|
|
36
49
|
*/
|
|
37
50
|
export declare function dispatch(e: KeyboardEvent): boolean;
|
|
38
51
|
/**
|
|
@@ -112,6 +112,22 @@ export declare function moveZone(tabs: readonly LayoutTab[], id: string, to: {
|
|
|
112
112
|
x: number;
|
|
113
113
|
y: number;
|
|
114
114
|
}): LayoutTab[];
|
|
115
|
+
/**
|
|
116
|
+
* Move a tab to just before or after another — the order a zone's strip shows its tabs in, which
|
|
117
|
+
* is their order in the list.
|
|
118
|
+
*
|
|
119
|
+
* Every tab's cell is pinned first (placeAll): a tab with no stored position takes its cell from
|
|
120
|
+
* its index, so reordering the list could otherwise move a zone you never touched.
|
|
121
|
+
*/
|
|
122
|
+
export declare function reorderTab(tabs: readonly LayoutTab[], srcId: string, overId: string, after: boolean): LayoutTab[];
|
|
123
|
+
/**
|
|
124
|
+
* Move one tab to another zone's cell — joining the zone there as the tab it shows, or making a
|
|
125
|
+
* new zone in an empty cell. The zone it left keeps its other tabs.
|
|
126
|
+
*/
|
|
127
|
+
export declare function moveTabToZone(tabs: readonly LayoutTab[], tabId: string, to: {
|
|
128
|
+
x: number;
|
|
129
|
+
y: number;
|
|
130
|
+
}): LayoutTab[];
|
|
115
131
|
/**
|
|
116
132
|
* Add a tab to the zone holding `besideId`, as the tab it shows.
|
|
117
133
|
*
|
|
@@ -239,7 +255,7 @@ export declare function isWorkspaceActive(ws: LayoutWorkspace): boolean;
|
|
|
239
255
|
/**
|
|
240
256
|
* Mark a pane as running an agent right now, without waiting for the sweep.
|
|
241
257
|
*
|
|
242
|
-
* agentPanes is refreshed from Rust every
|
|
258
|
+
* agentPanes is refreshed from Rust every 10s, which is the right cadence for noticing an agent
|
|
243
259
|
* that EXITED but far too slow for one we just started ourselves — the menu would keep offering
|
|
244
260
|
* to start a second one for most of a minute. The next sweep confirms it, or clears it if the
|
|
245
261
|
* command never took.
|