deck-plugin-sdk 0.16.0 → 0.18.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deck-plugin-sdk",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "Build a plugin for Deck, outside the Deck repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/shim/bridge.js CHANGED
@@ -50,12 +50,18 @@ export const fsWrite = (...a) => b().fsWrite(...a);
50
50
  export const fsWriteBytes = (...a) => b().fsWriteBytes(...a);
51
51
  export const getAutostart = (...a) => b().getAutostart(...a);
52
52
  export const getVaultRoot = (...a) => b().getVaultRoot(...a);
53
+ export const ghPrLineComment = (...a) => b().ghPrLineComment(...a);
54
+ export const ghPrThreads = (...a) => b().ghPrThreads(...a);
55
+ export const ghRun = (...a) => b().ghRun(...a);
56
+ export const ghThreadReply = (...a) => b().ghThreadReply(...a);
57
+ export const ghThreadResolve = (...a) => b().ghThreadResolve(...a);
53
58
  export const gitAbortOp = (...a) => b().gitAbortOp(...a);
54
59
  export const gitAiCommitMsg = (...a) => b().gitAiCommitMsg(...a);
55
60
  export const gitBlameLine = (...a) => b().gitBlameLine(...a);
56
61
  export const gitBranchAt = (...a) => b().gitBranchAt(...a);
57
62
  export const gitBranchDelete = (...a) => b().gitBranchDelete(...a);
58
63
  export const gitBranchDeleteRemote = (...a) => b().gitBranchDeleteRemote(...a);
64
+ export const gitBranchRename = (...a) => b().gitBranchRename(...a);
59
65
  export const gitBranches = (...a) => b().gitBranches(...a);
60
66
  export const gitCheckout = (...a) => b().gitCheckout(...a);
61
67
  export const gitCheckoutDetach = (...a) => b().gitCheckoutDetach(...a);
@@ -65,22 +71,32 @@ export const gitCherryPick = (...a) => b().gitCherryPick(...a);
65
71
  export const gitCommit = (...a) => b().gitCommit(...a);
66
72
  export const gitCommitAmend = (...a) => b().gitCommitAmend(...a);
67
73
  export const gitCommitFiles = (...a) => b().gitCommitFiles(...a);
74
+ export const gitContinueOp = (...a) => b().gitContinueOp(...a);
68
75
  export const gitDiscard = (...a) => b().gitDiscard(...a);
69
76
  export const gitFetch = (...a) => b().gitFetch(...a);
77
+ export const gitFetchPr = (...a) => b().gitFetchPr(...a);
70
78
  export const gitFileBytes = (...a) => b().gitFileBytes(...a);
71
79
  export const gitFileDiff = (...a) => b().gitFileDiff(...a);
80
+ export const gitHead = (...a) => b().gitHead(...a);
72
81
  export const gitHeadFile = (...a) => b().gitHeadFile(...a);
73
82
  export const gitIndexFile = (...a) => b().gitIndexFile(...a);
74
83
  export const gitInfo = (...a) => b().gitInfo(...a);
75
84
  export const gitLogGraph = (...a) => b().gitLogGraph(...a);
76
85
  export const gitMerge = (...a) => b().gitMerge(...a);
86
+ export const gitMergeAs = (...a) => b().gitMergeAs(...a);
87
+ export const gitMergeBase = (...a) => b().gitMergeBase(...a);
77
88
  export const gitPendingOp = (...a) => b().gitPendingOp(...a);
78
89
  export const gitPull = (...a) => b().gitPull(...a);
79
90
  export const gitPullRebase = (...a) => b().gitPullRebase(...a);
80
91
  export const gitPush = (...a) => b().gitPush(...a);
81
92
  export const gitPushBranch = (...a) => b().gitPushBranch(...a);
93
+ export const gitRangeFiles = (...a) => b().gitRangeFiles(...a);
94
+ export const gitRangeSubjects = (...a) => b().gitRangeSubjects(...a);
95
+ export const gitRebase = (...a) => b().gitRebase(...a);
82
96
  export const gitRefs = (...a) => b().gitRefs(...a);
97
+ export const gitRemoteUrl = (...a) => b().gitRemoteUrl(...a);
83
98
  export const gitRemotes = (...a) => b().gitRemotes(...a);
99
+ export const gitRepos = (...a) => b().gitRepos(...a);
84
100
  export const gitResetTo = (...a) => b().gitResetTo(...a);
85
101
  export const gitRevert = (...a) => b().gitRevert(...a);
86
102
  export const gitShowFile = (...a) => b().gitShowFile(...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);
@@ -4,5 +4,5 @@
4
4
  "description": "One line on what this is for, shown under its name in Settings.",
5
5
  "icon": "Sparkles",
6
6
  "version": "0.1.0",
7
- "minDeck": "0.16.0"
7
+ "minDeck": "0.17.0"
8
8
  }
@@ -523,6 +523,8 @@ export declare const removeClaudeMcp: () => Promise<void>;
523
523
  export declare const removeClaudeHooks: () => Promise<void>;
524
524
  export declare const notifyOs: (title: string, body: string) => Promise<void>;
525
525
  export declare const gitStatus: (dir: string) => Promise<GitStatusRow[]>;
526
+ /** The repos a folder holds: the one it is inside first, then any below it. Each a repo's top level. */
527
+ export declare const gitRepos: (dir: string) => Promise<string[]>;
526
528
  export interface BlameLine {
527
529
  hash: string;
528
530
  author: string;
@@ -605,9 +607,37 @@ export declare const gitUndoCommit: (dir: string) => Promise<string>;
605
607
  export declare const gitBranchAt: (dir: string, name: string, rev: string) => Promise<string>;
606
608
  export declare const gitRevert: (dir: string, rev: string) => Promise<string>;
607
609
  export declare const gitCherryPick: (dir: string, rev: string) => Promise<string>;
608
- export declare const gitResetTo: (dir: string, rev: string, mode: "soft" | "mixed" | "hard") => Promise<string>;
610
+ export declare const gitResetTo: (dir: string, rev: string, mode: "soft" | "mixed" | "hard" | "keep") => Promise<string>;
609
611
  export declare const gitTag: (dir: string, name: string, rev: string, message?: string) => Promise<string>;
610
612
  export declare const gitMerge: (dir: string, rev: string, noFf?: boolean) => Promise<string>;
613
+ /** Rebase the current branch onto `onto`; a conflict leaves it pending (gitPendingOp → "rebase"). */
614
+ export declare const gitRebase: (dir: string, onto: string) => Promise<string>;
615
+ /** HEAD's commit and branch ("" when detached) — what an undo returns to. */
616
+ export declare const gitHead: (dir: string) => Promise<{
617
+ hash: string;
618
+ branch: string;
619
+ }>;
620
+ /** Merge `rev` into the current branch: a merge commit always, fast-forward when possible, or squashed into one commit. */
621
+ export declare const gitMergeAs: (dir: string, rev: string, style: "no-ff" | "ff" | "squash") => Promise<string>;
622
+ /** Finish a merge, rebase, revert or cherry-pick (what gitPendingOp reported) once its conflicts are staged. */
623
+ export declare const gitContinueOp: (dir: string, op: string) => Promise<string>;
624
+ /** Subjects of the commits on `head` that `base` lacks, oldest first. */
625
+ export declare const gitRangeSubjects: (dir: string, base: string, head: string) => Promise<string[]>;
626
+ export declare const gitRemoteUrl: (dir: string, name: string) => Promise<string>;
627
+ /** The GitHub CLI, `gh pr …` or `gh repo view …` only. Rejects with "gh-missing" when gh is not installed. */
628
+ export declare const ghRun: (dir: string, args: string[]) => Promise<string>;
629
+ /** Pull request N's review threads, as GitHub's GraphQL JSON (parsed by prs.ts parseThreads). */
630
+ export declare const ghPrThreads: (dir: string, number: number) => Promise<string>;
631
+ /** Comment on one line of a PR's diff: side "RIGHT" is the new version, "LEFT" the old. */
632
+ export declare const ghPrLineComment: (dir: string, number: number, commit: string, path: string, line: number, side: "LEFT" | "RIGHT", body: string) => Promise<string>;
633
+ export declare const ghThreadReply: (dir: string, thread: string, body: string) => Promise<string>;
634
+ export declare const ghThreadResolve: (dir: string, thread: string, resolve: boolean) => Promise<string>;
635
+ /** The files that differ between two revisions. */
636
+ export declare const gitRangeFiles: (dir: string, from: string, to: string) => Promise<CommitFile[]>;
637
+ 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>;
640
+ export declare const gitBranchRename: (dir: string, from: string, to: string) => Promise<string>;
611
641
  export declare const gitPendingOp: (dir: string) => Promise<string>;
612
642
  export declare const gitAbortOp: (dir: string, op: string) => Promise<string>;
613
643
  export declare const gitBranchDelete: (dir: string, name: string, force?: boolean) => 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;
@@ -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 {
@@ -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, () => void>): () => void;
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 decides about preventDefault — this cannot, because some bindings want the default
34
- * suppressed (the palette) and some do not (a chord whose action declines to act, like Ctrl+7
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 45s, which is the right cadence for noticing an agent
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.