deck-plugin-sdk 1.1.0 → 1.4.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 +7 -0
- package/shim/p2p.d.ts +4 -0
- package/shim/p2p.js +15 -0
- package/shim/settings.d.ts +1 -1
- package/shim/settings.js +3 -0
- package/shim/terminals.d.ts +1 -1
- package/shim/terminals.js +5 -0
- package/shim/ui.js +2 -0
- package/template/plugin.json +9 -8
- package/types/components/ContextMenu.d.ts +3 -1
- package/types/components/menuplace.d.ts +7 -1
- package/types/components/ui.d.ts +1 -1
- package/types/core/bridge.d.ts +57 -3
- package/types/core/editorsettings.d.ts +42 -0
- package/types/core/lsp.d.ts +5 -0
- package/types/core/monaco.d.ts +1 -0
- package/types/core/p2p.d.ts +117 -0
- package/types/core/settingsstore.d.ts +10 -0
- package/types/core/terminals.d.ts +25 -1
- package/types/core/theme.d.ts +63 -7
- package/types/core/treehide.d.ts +5 -0
package/package.json
CHANGED
package/shim/bridge.js
CHANGED
|
@@ -9,6 +9,8 @@ const b = () => {
|
|
|
9
9
|
return x;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
export const agentClis = (...a) => b().agentClis(...a);
|
|
13
|
+
export const agentMcpStatus = (...a) => b().agentMcpStatus(...a);
|
|
12
14
|
export const askSudoPassword = (...a) => b().askSudoPassword(...a);
|
|
13
15
|
export const backupExport = (...a) => b().backupExport(...a);
|
|
14
16
|
export const backupInspect = (...a) => b().backupInspect(...a);
|
|
@@ -136,6 +138,9 @@ export const httpSend = (...a) => b().httpSend(...a);
|
|
|
136
138
|
export const httpSendAs = (...a) => b().httpSendAs(...a);
|
|
137
139
|
export const httpSendReply = (...a) => b().httpSendReply(...a);
|
|
138
140
|
export const importIconPack = (...a) => b().importIconPack(...a);
|
|
141
|
+
export const installAgentHooks = (...a) => b().installAgentHooks(...a);
|
|
142
|
+
export const installAgentMcp = (...a) => b().installAgentMcp(...a);
|
|
143
|
+
export const installAgentSkills = (...a) => b().installAgentSkills(...a);
|
|
139
144
|
export const installClaudeHooks = (...a) => b().installClaudeHooks(...a);
|
|
140
145
|
export const installClaudeMcp = (...a) => b().installClaudeMcp(...a);
|
|
141
146
|
export const installFromRegistry = (...a) => b().installFromRegistry(...a);
|
|
@@ -181,6 +186,8 @@ export const readTrackMeta = (...a) => b().readTrackMeta(...a);
|
|
|
181
186
|
export const remoteHome = (...a) => b().remoteHome(...a);
|
|
182
187
|
export const remoteStat = (...a) => b().remoteStat(...a);
|
|
183
188
|
export const remoteSudoPassword = (...a) => b().remoteSudoPassword(...a);
|
|
189
|
+
export const removeAgentHooks = (...a) => b().removeAgentHooks(...a);
|
|
190
|
+
export const removeAgentMcp = (...a) => b().removeAgentMcp(...a);
|
|
184
191
|
export const removeClaudeHooks = (...a) => b().removeClaudeHooks(...a);
|
|
185
192
|
export const removeClaudeMcp = (...a) => b().removeClaudeMcp(...a);
|
|
186
193
|
export const removeLanguage = (...a) => b().removeLanguage(...a);
|
package/shim/p2p.d.ts
ADDED
package/shim/p2p.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-shim.mjs — do not edit.
|
|
2
|
+
//
|
|
3
|
+
// Deck's live connections to other Decks. Resolved at USE time like the bridge: a plugin module is evaluated
|
|
4
|
+
// during loadPlugins, and a reference copied out at import time would capture a half-built
|
|
5
|
+
// object. One transport for every plugin, so a fix to it reaches all of them.
|
|
6
|
+
const t = () => {
|
|
7
|
+
const x = window.__deck?.p2p;
|
|
8
|
+
if (!x) throw new Error("window.__deck.p2p is missing — this plugin only runs inside Deck");
|
|
9
|
+
return x;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const cleanCode = (...a) => t().cleanCode(...a);
|
|
13
|
+
export const newCode = (...a) => t().newCode(...a);
|
|
14
|
+
export const selfId = (...a) => t().selfId(...a);
|
|
15
|
+
export const share = (...a) => t().share(...a);
|
package/shim/settings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-shim.mjs — do not edit.
|
|
2
2
|
//
|
|
3
3
|
// Deck's real settings types, so a plugin is checked against the actual shape.
|
|
4
|
-
export { useSettings, getSettings, saveSettings } from "../types/core/settingsstore";
|
|
4
|
+
export { useSettings, getSettings, saveSettings, userName } from "../types/core/settingsstore";
|
|
5
5
|
export type { Settings } from "../types/core/bridge";
|
package/shim/settings.js
CHANGED
|
@@ -11,3 +11,6 @@ const s = () => {
|
|
|
11
11
|
export const useSettings = (...a) => s().use(...a);
|
|
12
12
|
export const getSettings = (...a) => s().get(...a);
|
|
13
13
|
export const saveSettings = (...a) => s().save(...a);
|
|
14
|
+
// What to call the user (needs a Deck newer than 1.1): the name set in Settings, else their Google or Windows
|
|
15
|
+
// account's. For a plugin that shows the user to someone else.
|
|
16
|
+
export const userName = (...a) => s().userName(...a);
|
package/shim/terminals.d.ts
CHANGED
package/shim/terminals.js
CHANGED
|
@@ -19,11 +19,13 @@ export const attach = (...a) => t().attach(...a);
|
|
|
19
19
|
export const bracketPaste = (...a) => t().bracketPaste(...a);
|
|
20
20
|
export const clearPane = (...a) => t().clearPane(...a);
|
|
21
21
|
export const closeLeaf = (...a) => t().closeLeaf(...a);
|
|
22
|
+
export const copyFrom = (...a) => t().copyFrom(...a);
|
|
22
23
|
export const destroy = (...a) => t().destroy(...a);
|
|
23
24
|
export const findLeaf = (...a) => t().findLeaf(...a);
|
|
24
25
|
export const focusPane = (...a) => t().focusPane(...a);
|
|
25
26
|
export const getInstance = (...a) => t().getInstance(...a);
|
|
26
27
|
export const getLayout = (...a) => t().getLayout(...a);
|
|
28
|
+
export const hasSelection = (...a) => t().hasSelection(...a);
|
|
27
29
|
export const insertBeside = (...a) => t().insertBeside(...a);
|
|
28
30
|
export const isPinned = (...a) => t().isPinned(...a);
|
|
29
31
|
export const isWorkspaceActive = (...a) => t().isWorkspaceActive(...a);
|
|
@@ -44,11 +46,14 @@ export const paneLabel = (...a) => t().paneLabel(...a);
|
|
|
44
46
|
export const paneLines = (...a) => t().paneLines(...a);
|
|
45
47
|
export const paneLocation = (...a) => t().paneLocation(...a);
|
|
46
48
|
export const pasteInto = (...a) => t().pasteInto(...a);
|
|
49
|
+
export const pasteText = (...a) => t().pasteText(...a);
|
|
50
|
+
export const pasteTextInto = (...a) => t().pasteTextInto(...a);
|
|
47
51
|
export const publishLayout = (...a) => t().publishLayout(...a);
|
|
48
52
|
export const queueInput = (...a) => t().queueInput(...a);
|
|
49
53
|
export const refit = (...a) => t().refit(...a);
|
|
50
54
|
export const reorderTab = (...a) => t().reorderTab(...a);
|
|
51
55
|
export const restartPane = (...a) => t().restartPane(...a);
|
|
56
|
+
export const runsLines = (...a) => t().runsLines(...a);
|
|
52
57
|
export const sendInput = (...a) => t().sendInput(...a);
|
|
53
58
|
export const setLeafLabel = (...a) => t().setLeafLabel(...a);
|
|
54
59
|
export const setLeafView = (...a) => t().setLeafView(...a);
|
package/shim/ui.js
CHANGED
|
@@ -51,11 +51,13 @@ export const collectFiles = (...a) => u().collectFiles(...a);
|
|
|
51
51
|
export const conflict = (...a) => u().conflict(...a);
|
|
52
52
|
export const decodeText = (...a) => u().decodeText(...a);
|
|
53
53
|
export const dispatch = (...a) => u().dispatch(...a);
|
|
54
|
+
export const forLanguage = (...a) => u().forLanguage(...a);
|
|
54
55
|
export const formatChord = (...a) => u().formatChord(...a);
|
|
55
56
|
export const getEditorSettings = (...a) => u().getEditorSettings(...a);
|
|
56
57
|
export const getOverrides = (...a) => u().getOverrides(...a);
|
|
57
58
|
export const match = (...a) => u().match(...a);
|
|
58
59
|
export const mediaKind = (...a) => u().mediaKind(...a);
|
|
60
|
+
export const modelOptionsFor = (...a) => u().modelOptionsFor(...a);
|
|
59
61
|
export const monacoOptionsFrom = (...a) => u().monacoOptionsFrom(...a);
|
|
60
62
|
export const normalizeChord = (...a) => u().normalizeChord(...a);
|
|
61
63
|
export const onKey = (...a) => u().onKey(...a);
|
package/template/plugin.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "__ID__",
|
|
3
|
-
"name": "__NAME__",
|
|
4
|
-
"description": "One line on what this is for, shown under its name in Settings.",
|
|
5
|
-
"icon": "Sparkles",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
1
|
+
{
|
|
2
|
+
"id": "__ID__",
|
|
3
|
+
"name": "__NAME__",
|
|
4
|
+
"description": "One line on what this is for, shown under its name in Settings.",
|
|
5
|
+
"icon": "Sparkles",
|
|
6
|
+
"color": "#a78bfa",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"minDeck": "0.17.0"
|
|
9
|
+
}
|
|
@@ -28,7 +28,7 @@ export interface MenuItem {
|
|
|
28
28
|
checked?: boolean;
|
|
29
29
|
}
|
|
30
30
|
export type MenuEntry = MenuItem | "sep";
|
|
31
|
-
export declare function ContextMenu({ x, y, items, alignRight, onClose, onReorder, flipAt }: {
|
|
31
|
+
export declare function ContextMenu({ x, y, items, alignRight, onClose, onReorder, flipAt, up }: {
|
|
32
32
|
x: number;
|
|
33
33
|
y: number;
|
|
34
34
|
items: MenuEntry[];
|
|
@@ -36,6 +36,8 @@ export declare function ContextMenu({ x, y, items, alignRight, onClose, onReorde
|
|
|
36
36
|
onClose: () => void;
|
|
37
37
|
/** A submenu flips around its parent row's LEFT edge, not the point it opened at. */
|
|
38
38
|
flipAt?: number;
|
|
39
|
+
/** Open upward from (x, y) when it fits: a menu from a bottom bar, above the bar's buttons. */
|
|
40
|
+
up?: boolean;
|
|
39
41
|
/** Called with (draggedId, newIndexAmongDraggableRows) after a drag-sort. */
|
|
40
42
|
onReorder?: (id: string, toIndex: number) => void;
|
|
41
43
|
}): import("react").ReactPortal;
|
|
@@ -27,4 +27,10 @@ export declare function place(x: number, y: number, width: number, height: numbe
|
|
|
27
27
|
*
|
|
28
28
|
* Left out by a menu raised at a cursor, which has no width and so flips around itself.
|
|
29
29
|
*/
|
|
30
|
-
flipAt?: number
|
|
30
|
+
flipAt?: number,
|
|
31
|
+
/**
|
|
32
|
+
* Open upward from (x, y) whenever it fits there. For a menu raised from a button in a bottom
|
|
33
|
+
* bar: opening downward fits too (the window's edge is further down), and then covers the very
|
|
34
|
+
* buttons the menu is about.
|
|
35
|
+
*/
|
|
36
|
+
up?: boolean): Placement;
|
package/types/components/ui.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare function TimeInput({ value, onChange, className, }: {
|
|
|
23
23
|
onChange: (v: string) => void;
|
|
24
24
|
className?: string;
|
|
25
25
|
}): import("react").JSX.Element;
|
|
26
|
-
export declare function Select(props: React.SelectHTMLAttributes<HTMLSelectElement>): import("react").JSX.Element;
|
|
26
|
+
export declare function Select({ className, ...props }: React.SelectHTMLAttributes<HTMLSelectElement>): import("react").JSX.Element;
|
|
27
27
|
export declare function PrimaryButton({ children, ...p }: React.ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
|
|
28
28
|
export declare function GhostButton({ children, ...p }: React.ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
|
|
29
29
|
/**
|
package/types/core/bridge.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
2
|
import { type DebugTarget } from "./debugtargets";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Accent, Background, Density, Palette, TermCustom, TermTheme } from "./theme";
|
|
4
4
|
/** Open a URL in the default browser. */
|
|
5
5
|
export declare const openExternal: (url: string) => Promise<void>;
|
|
6
6
|
export interface AppProc {
|
|
@@ -44,12 +44,30 @@ export interface Settings {
|
|
|
44
44
|
reduceMotion: boolean;
|
|
45
45
|
/** The Servers list (hosts from ~/.ssh/config) under the workspace list. */
|
|
46
46
|
serversList: boolean;
|
|
47
|
+
/** The mouse wheel over a tab bar switches tabs rather than scrolling the bar. */
|
|
48
|
+
tabWheelSwitch: boolean;
|
|
49
|
+
/** Install plugin and language updates at startup instead of only announcing them. */
|
|
50
|
+
pluginAutoUpdate: boolean;
|
|
47
51
|
soundOnFire: boolean;
|
|
48
52
|
playerPlacement: "fixed" | "floating";
|
|
49
|
-
accent:
|
|
50
|
-
bgPreset:
|
|
53
|
+
accent: Accent;
|
|
54
|
+
bgPreset: Background;
|
|
55
|
+
/** The colours of the "custom" background, each "#rrggbb". Kept when a preset is picked, so
|
|
56
|
+
* going back to Custom finds them again. */
|
|
57
|
+
customTheme?: Partial<Palette>;
|
|
58
|
+
/** Custom palettes the user saved by name, shown as cards beside the presets. */
|
|
59
|
+
savedThemes?: {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
palette: Partial<Palette>;
|
|
63
|
+
}[];
|
|
64
|
+
/** The saved theme the custom colours came from, which edits are written back to. */
|
|
65
|
+
savedThemeId?: string;
|
|
51
66
|
density: Density;
|
|
67
|
+
uiZoom: number;
|
|
52
68
|
termTheme: TermTheme;
|
|
69
|
+
/** The "custom" terminal theme's colours. Kept when another theme is picked. */
|
|
70
|
+
termCustom?: Partial<TermCustom>;
|
|
53
71
|
termFont: string;
|
|
54
72
|
termFontSize: number;
|
|
55
73
|
termScrollback: number;
|
|
@@ -75,7 +93,19 @@ export interface Settings {
|
|
|
75
93
|
drawerHidden: string[];
|
|
76
94
|
/** Drawer tabs left-to-right. Ids missing from it keep their discovery order, after the rest. */
|
|
77
95
|
drawerOrder: string[];
|
|
96
|
+
/** Which side of the footer each drawer tab and readout sits on, in order (core/footerlayout.ts).
|
|
97
|
+
* Absent until something is moved: drawer tabs left, readouts right, in the orders above. */
|
|
98
|
+
footerLayout?: {
|
|
99
|
+
left: string[];
|
|
100
|
+
right: string[];
|
|
101
|
+
};
|
|
78
102
|
httpMcpRevealSecrets: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* What to call the user: shown to the others when sharing (a Canvas board's cursor and the
|
|
105
|
+
* host's "wants to join"). "" means work it out: the Google account's name when signed in,
|
|
106
|
+
* else the Windows account's (see `userName` in settingsstore.ts).
|
|
107
|
+
*/
|
|
108
|
+
userName: string;
|
|
79
109
|
}
|
|
80
110
|
export declare const DEFAULT_SETTINGS: Settings;
|
|
81
111
|
export declare const setAutostart: (on: boolean) => Promise<void>;
|
|
@@ -517,6 +547,30 @@ export declare const claudeMcpStatus: () => Promise<string>;
|
|
|
517
547
|
export declare const claudeMcpEntry: () => Promise<string>;
|
|
518
548
|
export declare const installClaudeMcp: () => Promise<string>;
|
|
519
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.
|
|
554
|
+
*/
|
|
555
|
+
export declare const agentMcpStatus: (agent: string) => Promise<string>;
|
|
556
|
+
export declare const installAgentMcp: (agent: string) => Promise<string>;
|
|
557
|
+
export declare const removeAgentMcp: (agent: string) => Promise<void>;
|
|
558
|
+
/** Deck's hooks for an agent that has them ("claude", "codex"): what the Agents panel and the
|
|
559
|
+
* agent notifications hear from. Merged into the agent's own settings, backed up first. */
|
|
560
|
+
export declare const installAgentHooks: (agent: string) => Promise<void>;
|
|
561
|
+
export declare const removeAgentHooks: (agent: string) => Promise<void>;
|
|
562
|
+
/**
|
|
563
|
+
* Deck's skills (how to use its MCP tools) for an agent that reads skills: "claude" or "codex".
|
|
564
|
+
* Each comes back with what happened to it: "installed", "updated", "current", "kept-yours" (a
|
|
565
|
+
* skill of that name that is not Deck's) or "kept-edited" (Deck's, changed since). Deck only
|
|
566
|
+
* replaces a skill folder it wrote and nobody has edited.
|
|
567
|
+
*/
|
|
568
|
+
export declare const installAgentSkills: (agent: string) => Promise<{
|
|
569
|
+
skill: string;
|
|
570
|
+
outcome: string;
|
|
571
|
+
}[]>;
|
|
572
|
+
/** Which agent command-line tools are on PATH: any of claude, codex, gemini, cursor-agent, cursor. */
|
|
573
|
+
export declare const agentClis: () => Promise<string[]>;
|
|
520
574
|
export declare const removeClaudeHooks: () => Promise<void>;
|
|
521
575
|
export declare const notifyOs: (title: string, body: string) => Promise<void>;
|
|
522
576
|
export declare const gitStatus: (dir: string) => Promise<GitStatusRow[]>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
2
|
import type * as MonacoNS from "monaco-editor";
|
|
3
|
+
/** What a language may set differently from the editor-wide value. Absent means "as everywhere". */
|
|
4
|
+
export interface LanguageOverride {
|
|
5
|
+
tabSize?: number;
|
|
6
|
+
insertSpaces?: boolean;
|
|
7
|
+
formatOnSave?: boolean;
|
|
8
|
+
}
|
|
3
9
|
export interface EditorSettings {
|
|
4
10
|
fontSize: number;
|
|
5
11
|
fontFamily: string;
|
|
@@ -38,9 +44,32 @@ export interface EditorSettings {
|
|
|
38
44
|
mouseWheelZoom: boolean;
|
|
39
45
|
autoClosingBrackets: boolean;
|
|
40
46
|
autoClosingQuotes: boolean;
|
|
47
|
+
/** When a file writes itself to disk. Off (the default) means only Ctrl+S saves. */
|
|
48
|
+
autoSave: "off" | "afterDelay" | "onFocusChange";
|
|
41
49
|
autoSaveDelay: number;
|
|
42
50
|
trimTrailingWhitespace: boolean;
|
|
43
51
|
formatOnSave: boolean;
|
|
52
|
+
formatOnPaste: boolean;
|
|
53
|
+
/** Completion: popping up while typing, on a trigger character like ".", and what Enter does. */
|
|
54
|
+
quickSuggestions: boolean;
|
|
55
|
+
suggestOnTriggerCharacters: boolean;
|
|
56
|
+
acceptSuggestionOnEnter: "on" | "smart" | "off";
|
|
57
|
+
snippetSuggestions: "top" | "bottom" | "inline" | "none";
|
|
58
|
+
/** Renaming an HTML/JSX tag renames its closing tag as you type. */
|
|
59
|
+
linkedEditing: boolean;
|
|
60
|
+
/** Lines kept visible above and below the cursor when it moves near an edge. */
|
|
61
|
+
cursorSurroundingLines: number;
|
|
62
|
+
multiCursorModifier: "alt" | "ctrlCmd";
|
|
63
|
+
/** Copy or cut with nothing selected takes the whole line. */
|
|
64
|
+
emptySelectionClipboard: boolean;
|
|
65
|
+
/** The file tree: names or globs to hide (comma-separated), dotfiles, following the open file. */
|
|
66
|
+
treeHide: string;
|
|
67
|
+
treeShowDotfiles: boolean;
|
|
68
|
+
treeFollowActive: boolean;
|
|
69
|
+
/** The folders above what is in view stay pinned at the top of the tree while it scrolls. */
|
|
70
|
+
treeStickyScroll: boolean;
|
|
71
|
+
/** Per-language overrides, keyed by Monaco language id ("python", "typescript"). */
|
|
72
|
+
languageOverrides: Record<string, LanguageOverride>;
|
|
44
73
|
formatLineLength: number;
|
|
45
74
|
inlineErrors: boolean;
|
|
46
75
|
inlineBlame: boolean;
|
|
@@ -66,4 +95,17 @@ export declare function getEditorSettings(): EditorSettings;
|
|
|
66
95
|
/** For a store outside React that reacts to a setting (lsp.ts re-asks for inlay hints). */
|
|
67
96
|
export declare function subscribeEditorSettings(cb: () => void): () => void;
|
|
68
97
|
export declare function useEditorSettings(): EditorSettings;
|
|
98
|
+
/** A language's own value for each overridable setting, else the editor-wide one. */
|
|
99
|
+
export declare function forLanguage(s: EditorSettings, languageId: string | undefined): {
|
|
100
|
+
tabSize: number;
|
|
101
|
+
insertSpaces: boolean;
|
|
102
|
+
formatOnSave: boolean;
|
|
103
|
+
};
|
|
104
|
+
/** The model options for a file of `languageId`. */
|
|
105
|
+
export declare function modelOptionsFor(s: EditorSettings, languageId: string | undefined): {
|
|
106
|
+
tabSize: number;
|
|
107
|
+
insertSpaces: boolean;
|
|
108
|
+
};
|
|
109
|
+
/** Whether the file tree shows an entry, under these settings (core/treehide.ts). */
|
|
110
|
+
export declare const treeShows: (s: EditorSettings, name: string) => boolean;
|
|
69
111
|
export declare function monacoOptionsFrom(s: EditorSettings): MonacoNS.editor.IEditorOptions;
|
package/types/core/lsp.d.ts
CHANGED
|
@@ -76,12 +76,17 @@ export interface LoadedLanguage {
|
|
|
76
76
|
folder: string;
|
|
77
77
|
/** language.json's version, or "" when it has none (a pack from before versions). */
|
|
78
78
|
version: string;
|
|
79
|
+
/** Its lucide icon name and colour from language.json; "" when it names none. */
|
|
80
|
+
icon: string;
|
|
81
|
+
color: string;
|
|
79
82
|
snippets?: number;
|
|
80
83
|
}
|
|
81
84
|
export interface LanguageError {
|
|
82
85
|
folder: string;
|
|
83
86
|
message: string;
|
|
84
87
|
}
|
|
88
|
+
export declare function subscribeLanguages(fn: () => void): () => void;
|
|
89
|
+
export declare function languagesVersion(): number;
|
|
85
90
|
/** Every language definition that loaded. */
|
|
86
91
|
export declare function loadedLanguages(): readonly LoadedLanguage[];
|
|
87
92
|
/**
|
package/types/core/monaco.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare function setEditorSurface(next: {
|
|
|
16
16
|
card: string;
|
|
17
17
|
elev: string;
|
|
18
18
|
muted: string;
|
|
19
|
+
text?: string;
|
|
19
20
|
}): void;
|
|
20
21
|
/** Merge language-specific semantic-token colors into deck-dark (idempotent per token). */
|
|
21
22
|
export declare function addSemanticColors(rules: TokenColor[]): void;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
/** What can travel: anything JSON can carry. */
|
|
3
|
+
export type Json = string | number | boolean | null | Json[] | {
|
|
4
|
+
[k: string]: Json;
|
|
5
|
+
};
|
|
6
|
+
/** Whether someone may change what is shared, or only watch. */
|
|
7
|
+
export type Mode = "edit" | "view";
|
|
8
|
+
/** Who may change things: a default for everyone, and a choice per person that wins over it. */
|
|
9
|
+
export interface Roles {
|
|
10
|
+
def: Mode;
|
|
11
|
+
per: Record<string, Mode>;
|
|
12
|
+
}
|
|
13
|
+
/** Why a share ended for a joiner: the host stopped, vanished, removed this Deck, turned it away,
|
|
14
|
+
* or speaks another version. */
|
|
15
|
+
export type Gone = "ended" | "lost" | "removed" | "denied" | "version";
|
|
16
|
+
export interface Person {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string; /** Round trip in ms, once measured. */
|
|
19
|
+
ms?: number;
|
|
20
|
+
}
|
|
21
|
+
/** What a share's bar and dialogs show. Replaced, never mutated, so React sees a change. */
|
|
22
|
+
export interface ShareView {
|
|
23
|
+
/** Who is in and connected: on the host, everyone let in; on a joiner, the host and the others. */
|
|
24
|
+
peers: Person[];
|
|
25
|
+
/** On the host: who is asking to be let in. */
|
|
26
|
+
knocking: Person[];
|
|
27
|
+
/** On a joiner: the host is there but has not let this Deck in yet. */
|
|
28
|
+
waiting: boolean;
|
|
29
|
+
/** On a joiner: no host heard from for a while (wrong code, or a network that blocks it). */
|
|
30
|
+
stuck: boolean;
|
|
31
|
+
gone: Gone | null;
|
|
32
|
+
hostName: string;
|
|
33
|
+
/** A passing line: someone on another version, or whatever the plugin `say`s. */
|
|
34
|
+
note: string;
|
|
35
|
+
roles: Roles;
|
|
36
|
+
/** Whether this Deck may change things. */
|
|
37
|
+
canEdit: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface ShareOptions {
|
|
40
|
+
/** What the share is for, e.g. "canvas-share". Decks only meet others using the same one. */
|
|
41
|
+
app: string;
|
|
42
|
+
/** The share code, which names the room (see newCode). */
|
|
43
|
+
code: string;
|
|
44
|
+
/** Optional extra secret, needed with the code to connect at all. Sharing works without one. */
|
|
45
|
+
password?: string;
|
|
46
|
+
/** The plugin's message channel, at most 12 bytes (Trystero's cap). Defaults to "msg". */
|
|
47
|
+
channel?: string;
|
|
48
|
+
/** Whether this Deck is the one sharing. */
|
|
49
|
+
host: boolean;
|
|
50
|
+
/** Shown to the others: in the host's knock, on cursors, in the list of who is here. */
|
|
51
|
+
name: string;
|
|
52
|
+
/** The plugin's own protocol version. Decks on different versions do not share. */
|
|
53
|
+
version: number;
|
|
54
|
+
/** The host's default for who may change things. Joiners may until the host says otherwise. */
|
|
55
|
+
mode?: Mode;
|
|
56
|
+
}
|
|
57
|
+
export interface ShareHandlers<T> {
|
|
58
|
+
/** A plugin message, only ever from someone let in (and the host). Check `mayEdit(peer)` before
|
|
59
|
+
* applying a change: a view-only person's edits are to be dropped by every Deck. */
|
|
60
|
+
message: (msg: T, peer: string) => void;
|
|
61
|
+
/** On the host: someone was just let in. Send them what they need to start, e.g. the board. */
|
|
62
|
+
welcome?: (peer: string) => void;
|
|
63
|
+
/** Someone left or was removed: forget what was kept for them (a cursor). */
|
|
64
|
+
left?: (peer: string) => void;
|
|
65
|
+
}
|
|
66
|
+
export interface P2pShare<T> {
|
|
67
|
+
readonly host: boolean;
|
|
68
|
+
/** Send a plugin message to everyone let in, or to one of them. Sends nothing before this Deck is
|
|
69
|
+
* let in. Settles once handed to the connection, so awaiting it paces the sender. */
|
|
70
|
+
send(msg: T, to?: string): Promise<void>;
|
|
71
|
+
/** Whether a peer may change things: the host always, anyone else by the roles. */
|
|
72
|
+
mayEdit(peer: string): boolean;
|
|
73
|
+
/** The host: let someone in, or turn them away. */
|
|
74
|
+
allow(peer: string): void;
|
|
75
|
+
deny(peer: string): void;
|
|
76
|
+
/** The host: remove someone who was let in. They cannot come back with the same Deck. */
|
|
77
|
+
kick(peer: string): void;
|
|
78
|
+
/** The host: everyone's default, and one person's own choice (`null` follows the default). */
|
|
79
|
+
setDefault(mode: Mode): void;
|
|
80
|
+
setPerson(peer: string, mode: Mode | null): void;
|
|
81
|
+
/** Show a passing line in the view for a few seconds. */
|
|
82
|
+
say(note: string): void;
|
|
83
|
+
/** Leave. With `announce` (the host ending on purpose) everyone is told first, so they end at
|
|
84
|
+
* once rather than when the connection times out. Safe to call twice. */
|
|
85
|
+
close(announce?: boolean): Promise<void>;
|
|
86
|
+
/** For useSyncExternalStore. */
|
|
87
|
+
subscribe(fn: () => void): () => void;
|
|
88
|
+
getView(): ShareView;
|
|
89
|
+
}
|
|
90
|
+
/** The part of a Trystero room a share uses: a seam, so the check can run a share without a network. */
|
|
91
|
+
export interface RoomLike {
|
|
92
|
+
/** This Deck's id in the room; Trystero's own is `selfId()`. */
|
|
93
|
+
selfId?: string;
|
|
94
|
+
makeAction(name: string, config: {
|
|
95
|
+
onMessage: (data: any, ctx: {
|
|
96
|
+
peerId: string;
|
|
97
|
+
}) => void;
|
|
98
|
+
}): {
|
|
99
|
+
send(data: any, options?: {
|
|
100
|
+
target?: string | string[];
|
|
101
|
+
}): Promise<void>;
|
|
102
|
+
};
|
|
103
|
+
ping(peer: string): Promise<number>;
|
|
104
|
+
leave(): Promise<void>;
|
|
105
|
+
getPeers(): Record<string, unknown>;
|
|
106
|
+
onPeerJoin: ((peer: string) => void) | null;
|
|
107
|
+
onPeerLeave: ((peer: string) => void) | null;
|
|
108
|
+
}
|
|
109
|
+
/** This Deck's id in every share: the one the others know it by. The same for the whole session,
|
|
110
|
+
* so someone let in who rejoins after a dropped connection is let straight back in. */
|
|
111
|
+
export declare function selfId(): string;
|
|
112
|
+
/** Start sharing (`host`), or ask to join someone's share. */
|
|
113
|
+
export declare function share<T extends Json>(opts: ShareOptions, on: ShareHandlers<T>, room?: RoomLike): P2pShare<T>;
|
|
114
|
+
/** A share code: 16 random characters in four groups, easy to read out or paste. */
|
|
115
|
+
export declare function newCode(random?: (n: number) => Uint8Array): string;
|
|
116
|
+
/** A pasted code, tidied: spaces dropped, case folded. Empty when it is not a code. */
|
|
117
|
+
export declare function cleanCode(text: string): string;
|
|
@@ -11,6 +11,16 @@ export declare function publishSettings(s: Settings): void;
|
|
|
11
11
|
* for the shared half.
|
|
12
12
|
*/
|
|
13
13
|
export declare function saveSettings(next: Settings): void;
|
|
14
|
+
/** The zoom steps Ctrl+= and Ctrl+- move through, in percent, as a browser's do. */
|
|
15
|
+
export declare const ZOOM_STEPS: number[];
|
|
16
|
+
/**
|
|
17
|
+
* Zoom the whole window: the webview's own zoom, the same as a browser's Ctrl+=, rather than CSS
|
|
18
|
+
* `zoom`, which leaves xterm and Monaco measuring the mouse in unzoomed pixels.
|
|
19
|
+
*/
|
|
20
|
+
export declare function applyZoom(pct: number | undefined): void;
|
|
21
|
+
/** One step in or out from the current zoom, or back to 100% with dir 0. Saved like any setting. */
|
|
22
|
+
export declare function stepZoom(dir: -1 | 0 | 1): void;
|
|
14
23
|
/** Current settings for non-React callers (the palette's providers). */
|
|
15
24
|
export declare const getSettings: () => Settings;
|
|
25
|
+
export declare function userName(): Promise<string>;
|
|
16
26
|
export declare function useSettings(): Settings;
|
|
@@ -318,7 +318,31 @@ export declare function getInstance(id: string): Instance;
|
|
|
318
318
|
* smaller writes would only add more seams.
|
|
319
319
|
*/
|
|
320
320
|
export declare function bracketPaste(text: string, bracketed: boolean): string;
|
|
321
|
-
/**
|
|
321
|
+
/** Whether a terminal has text selected, for its right-click menu's Copy. */
|
|
322
|
+
export declare const hasSelection: (id: string) => boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Copy a terminal's selection, then clear it: with the selection kept, the next Ctrl+C copied
|
|
325
|
+
* again instead of interrupting the program, until something was clicked.
|
|
326
|
+
*/
|
|
327
|
+
export declare function copyFrom(id: string): void;
|
|
328
|
+
/**
|
|
329
|
+
* A paste's line breaks as the Enter key sends them. Text copied on Windows carries CRLF, and
|
|
330
|
+
* written raw each line arrived as Enter plus a stray line feed. xterm's own paste does this
|
|
331
|
+
* conversion; Deck writes pastes itself, so it does it here.
|
|
332
|
+
*/
|
|
333
|
+
export declare const pasteText: (text: string) => string;
|
|
334
|
+
/**
|
|
335
|
+
* A pasted line break that will run a command: one ending a line, outside a bracketed paste.
|
|
336
|
+
* The shell (PowerShell, cmd) takes each as Enter, so pasting two lines ran the first at once.
|
|
337
|
+
*/
|
|
338
|
+
export declare const runsLines: (text: string, bracketed: boolean) => boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Paste text into a terminal: line breaks as Enter, bracketed when the app asked for it, and
|
|
341
|
+
* when it would run lines in a shell that cannot tell a paste from typing, asked first, the way
|
|
342
|
+
* Windows Terminal asks. Focus goes back to the terminal afterwards, as a menu click takes it.
|
|
343
|
+
*/
|
|
344
|
+
export declare function pasteTextInto(id: string, text: string): Promise<void>;
|
|
345
|
+
/** Paste the clipboard into a terminal, from its right-click menu (no key event to read). */
|
|
322
346
|
export declare function pasteInto(id: string): Promise<void>;
|
|
323
347
|
export declare function attach(id: string, el: HTMLElement, cwd: string): () => void;
|
|
324
348
|
export declare function queueInput(paneId: string, text: string): void;
|
package/types/core/theme.d.ts
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
2
|
export type AccentColor = "violet" | "blue" | "cyan" | "green" | "amber" | "red";
|
|
3
|
+
/** A preset's name, or a custom colour as "#rrggbb". */
|
|
4
|
+
export type Accent = AccentColor | `#${string}`;
|
|
3
5
|
export type BgPreset = "black" | "slate" | "warm" | "midnight" | "charcoal" | "nord" | "plum" | "dracula" | "forest";
|
|
6
|
+
/** A preset, or "custom": the user's own colours, from `customTheme`. */
|
|
7
|
+
export type Background = BgPreset | "custom";
|
|
8
|
+
/**
|
|
9
|
+
* Every colour a theme sets, so a custom one can set them all: the five surfaces darkest first,
|
|
10
|
+
* and the three text colours. Each is "#rrggbb", which is what a colour picker reads and writes.
|
|
11
|
+
*/
|
|
12
|
+
export interface Palette {
|
|
13
|
+
app: string;
|
|
14
|
+
panel: string;
|
|
15
|
+
card: string;
|
|
16
|
+
elev: string;
|
|
17
|
+
hover: string;
|
|
18
|
+
text: string;
|
|
19
|
+
textSecondary: string;
|
|
20
|
+
muted: string;
|
|
21
|
+
/** What is drawn on the accent: a primary button's label, a switch's knob. */
|
|
22
|
+
onAccent: string;
|
|
23
|
+
}
|
|
24
|
+
/** "#rrggbb" as "r g b", the form the rgb(var(--x) / alpha) tokens take. */
|
|
25
|
+
export declare const channels: (hex: string) => string;
|
|
4
26
|
export type Density = "compact" | "cozy";
|
|
5
27
|
/** Accent base/strong pairs. Values match the primitives already in tokens.css. */
|
|
6
28
|
export declare const ACCENTS: Record<AccentColor, {
|
|
@@ -27,23 +49,54 @@ export declare const DENSITIES: Record<Density, {
|
|
|
27
49
|
scale: number;
|
|
28
50
|
radius: number;
|
|
29
51
|
}>;
|
|
52
|
+
/** The colours a background setting resolves to. A custom one missing a colour (or with none
|
|
53
|
+
* saved) takes it from the near-black preset, so a half-filled palette still draws. */
|
|
54
|
+
export declare function paletteOf(bgPreset?: string, custom?: Partial<Palette>): Palette;
|
|
55
|
+
/** Whether a "#rrggbb" background is light: relative luminance over the midpoint. */
|
|
56
|
+
export declare function isLightColor(hex: string): boolean;
|
|
57
|
+
/** Whether an accent is a custom colour rather than a preset's name. */
|
|
58
|
+
export declare const isCustomAccent: (accent?: string) => accent is `#${string}`;
|
|
59
|
+
/**
|
|
60
|
+
* An accent's base and strong colours. A custom one has no hand-picked strong shade, so it is the
|
|
61
|
+
* base mixed toward black, which is what the presets' pairs are. Anything unknown (a preset that
|
|
62
|
+
* was removed) falls back to violet.
|
|
63
|
+
*/
|
|
64
|
+
export declare function accentOf(accent?: string): {
|
|
65
|
+
base: string;
|
|
66
|
+
strong: string;
|
|
67
|
+
};
|
|
30
68
|
/** Apply the three appearance settings to the document. Safe to call repeatedly. */
|
|
31
69
|
export declare function applyTheme(opts: {
|
|
32
|
-
accent?:
|
|
33
|
-
bgPreset?:
|
|
70
|
+
accent?: Accent;
|
|
71
|
+
bgPreset?: Background;
|
|
72
|
+
customTheme?: Partial<Palette>;
|
|
34
73
|
density?: Density;
|
|
35
74
|
termTheme?: TermTheme;
|
|
75
|
+
termCustom?: Partial<TermCustom>;
|
|
36
76
|
}): void;
|
|
37
77
|
/** The values the app starts with, before settings.json has been read. Matches tokens.css. */
|
|
38
78
|
export declare const DEFAULT_APPEARANCE: {
|
|
39
|
-
accent:
|
|
40
|
-
bgPreset:
|
|
79
|
+
accent: Accent;
|
|
80
|
+
bgPreset: Background;
|
|
41
81
|
density: Density;
|
|
42
82
|
};
|
|
43
|
-
export type TermTheme = "match" | "deck" | "dark" | "dimmed" | "solarized";
|
|
83
|
+
export type TermTheme = "match" | "deck" | "dark" | "dimmed" | "solarized" | "custom";
|
|
84
|
+
/** The eight ANSI colours programs print with. Bright variants follow them in a custom theme. */
|
|
85
|
+
export declare const ANSI_KEYS: readonly ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"];
|
|
86
|
+
export type Ansi = Record<(typeof ANSI_KEYS)[number], string>;
|
|
87
|
+
/** xterm's own defaults, which every theme but a custom one leaves in place. */
|
|
88
|
+
export declare const XTERM_ANSI: Ansi;
|
|
89
|
+
/** A custom terminal theme: every colour, each "#rrggbb". */
|
|
90
|
+
export interface TermCustom {
|
|
91
|
+
background: string;
|
|
92
|
+
foreground: string;
|
|
93
|
+
cursor: string;
|
|
94
|
+
selection: string;
|
|
95
|
+
ansi: Ansi;
|
|
96
|
+
}
|
|
44
97
|
/** Fixed palettes. "match" isn't here — it's derived from the app's accent + background at
|
|
45
98
|
* resolve time (see termThemeColors), so it changes with those settings. */
|
|
46
|
-
export declare const TERM_THEMES: Record<Exclude<TermTheme, "match">, {
|
|
99
|
+
export declare const TERM_THEMES: Record<Exclude<TermTheme, "match" | "custom">, {
|
|
47
100
|
label: string;
|
|
48
101
|
background: string;
|
|
49
102
|
foreground: string;
|
|
@@ -55,13 +108,16 @@ export declare const TERM_THEME_LABELS: Record<TermTheme, string>;
|
|
|
55
108
|
/** Resolve a terminal theme to concrete colours. "match" follows the app's own appearance: the
|
|
56
109
|
* card surface as the background (so a terminal reads as part of the panel it sits in) and the
|
|
57
110
|
* accent as the cursor, so picking a new accent recolours the terminal too. */
|
|
58
|
-
export declare function termThemeColors(theme: TermTheme, accent?:
|
|
111
|
+
export declare function termThemeColors(theme: TermTheme, accent?: Accent, bgPreset?: Background, custom?: Partial<Palette>, term?: Partial<TermCustom>): {
|
|
59
112
|
label: string;
|
|
60
113
|
background: string;
|
|
61
114
|
foreground: string;
|
|
62
115
|
cursor: string;
|
|
63
116
|
selectionBackground: string;
|
|
117
|
+
ansi?: Ansi;
|
|
64
118
|
};
|
|
119
|
+
/** A custom terminal theme with every colour filled: what is missing comes from the Deck theme. */
|
|
120
|
+
export declare function customTerm(t?: Partial<TermCustom>): TermCustom;
|
|
65
121
|
export declare const TERM_FONTS: {
|
|
66
122
|
value: string;
|
|
67
123
|
label: string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
/** "dist, *.log" as one case-insensitive whole-name pattern each: * is any run, ? one character. */
|
|
3
|
+
export declare function hidePatterns(text: string): RegExp[];
|
|
4
|
+
/** Whether the tree shows an entry named `name`. */
|
|
5
|
+
export declare function treeVisible(name: string, hide: string, dotfiles: boolean): boolean;
|