deck-plugin-sdk 1.17.1 → 1.17.3
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/terminals.js +2 -0
- package/template/plugin.json +1 -1
- package/types/core/app/teamkeys.d.ts +31 -0
- package/types/core/app/teams.d.ts +1 -5
- package/types/core/app/theme.d.ts +11 -4
- package/types/core/workspaces/folders.d.ts +48 -0
- package/types/core/workspaces/layout.d.ts +15 -2
- package/types/core/workspaces/terminals.d.ts +1 -1
package/package.json
CHANGED
package/shim/terminals.js
CHANGED
|
@@ -14,6 +14,7 @@ const t = () => {
|
|
|
14
14
|
export const GROUP_COLORS = (...a) => t().GROUP_COLORS(...a);
|
|
15
15
|
export const ZONE_BOARD = (...a) => t().ZONE_BOARD(...a);
|
|
16
16
|
export const activeWorkspaceCwd = (...a) => t().activeWorkspaceCwd(...a);
|
|
17
|
+
export const activeWorkspaceFolders = (...a) => t().activeWorkspaceFolders(...a);
|
|
17
18
|
export const addTabToZone = (...a) => t().addTabToZone(...a);
|
|
18
19
|
export const addToGroup = (...a) => t().addToGroup(...a);
|
|
19
20
|
export const agentSessions = (...a) => t().agentSessions(...a);
|
|
@@ -95,6 +96,7 @@ export const useAgentPanesVersion = (...a) => t().useAgentPanesVersion(...a);
|
|
|
95
96
|
export const useLayout = (...a) => t().useLayout(...a);
|
|
96
97
|
export const webglLimit = (...a) => t().webglLimit(...a);
|
|
97
98
|
export const workspaceByCwd = (...a) => t().workspaceByCwd(...a);
|
|
99
|
+
export const workspaceHolding = (...a) => t().workspaceHolding(...a);
|
|
98
100
|
export const workspaceShellCount = (...a) => t().workspaceShellCount(...a);
|
|
99
101
|
export const zoneAt = (...a) => t().zoneAt(...a);
|
|
100
102
|
export const zoneBoardFull = (...a) => t().zoneBoardFull(...a);
|
package/template/plugin.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
import type { MemberList } from "./teams";
|
|
3
|
+
/** A team's size, and how long a name may be: past these a list is not even looked at. */
|
|
4
|
+
export declare const MAX_MEMBERS = 200;
|
|
5
|
+
export declare const MAX_NAME = 60;
|
|
6
|
+
export declare const cleanName: (v: unknown) => string;
|
|
7
|
+
export declare const subtle: () => SubtleCrypto;
|
|
8
|
+
export declare const enc: TextEncoder, dec: TextDecoder;
|
|
9
|
+
export declare const b64: (b: ArrayBuffer | Uint8Array) => string;
|
|
10
|
+
export declare const unb64: (s: string) => Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare const hex: (b: ArrayBuffer | Uint8Array) => string;
|
|
12
|
+
export declare const random: (n: number) => Uint8Array<ArrayBuffer>;
|
|
13
|
+
export declare const ECDSA: {
|
|
14
|
+
readonly name: "ECDSA";
|
|
15
|
+
readonly namedCurve: "P-256";
|
|
16
|
+
};
|
|
17
|
+
export declare const SIG: {
|
|
18
|
+
readonly name: "ECDSA";
|
|
19
|
+
readonly hash: "SHA-256";
|
|
20
|
+
};
|
|
21
|
+
export declare const ECDH: {
|
|
22
|
+
readonly name: "ECDH";
|
|
23
|
+
readonly namedCurve: "P-256";
|
|
24
|
+
};
|
|
25
|
+
/** A member's id: the first half of the hash of their public key. */
|
|
26
|
+
export declare function idOf(pub: string): Promise<string>;
|
|
27
|
+
export declare function verify(pub: string, text: string, sig: string): Promise<boolean>;
|
|
28
|
+
/** What the owner signs: every field but the signature, in one fixed order. */
|
|
29
|
+
export declare const canon: (l: MemberList) => string;
|
|
30
|
+
/** Whether a list is the owner's own: signed by them, for this team, with ids that match the keys. */
|
|
31
|
+
export declare function validList(l: MemberList, ownerPub?: string): Promise<boolean>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
2
|
import { share, type Json, type RoomLike, type P2pShare } from "./p2pshare";
|
|
3
|
+
export { idOf, validList } from "./teamkeys";
|
|
3
4
|
export type Member = {
|
|
4
5
|
id: string;
|
|
5
6
|
pub: string;
|
|
@@ -64,10 +65,6 @@ export interface TeamDeps {
|
|
|
64
65
|
export declare function _setTeamDeps(d: Partial<TeamDeps>): void;
|
|
65
66
|
/** A short code for an identity, to read out and compare: whoever invites shows theirs, whoever joins sees it. */
|
|
66
67
|
export declare const fingerprint: (id: string) => string;
|
|
67
|
-
/** A member's id: the first half of the hash of their public key. */
|
|
68
|
-
export declare function idOf(pub: string): Promise<string>;
|
|
69
|
-
/** Whether a list is the owner's own: signed by them, for this team, with ids that match the keys. */
|
|
70
|
-
export declare function validList(l: MemberList, ownerPub?: string): Promise<boolean>;
|
|
71
68
|
/** A plugin's line to a team: its messages, only to and from checked members. */
|
|
72
69
|
export declare function teamChannel<T extends Json>(teamId: string, app: string, on: ChannelHandlers<T>): TeamChannel<T>;
|
|
73
70
|
export declare function teamsView(): TeamView[];
|
|
@@ -119,4 +116,3 @@ export declare function joinTeam(code: string): Promise<{
|
|
|
119
116
|
share: P2pShare<InviteMsg>;
|
|
120
117
|
done: Promise<TeamOffer>;
|
|
121
118
|
}>;
|
|
122
|
-
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export type AccentColor = "violet" | "blue" | "cyan" | "green" | "amber" | "red";
|
|
3
3
|
/** A preset's name, or a custom colour as "#rrggbb". */
|
|
4
4
|
export type Accent = AccentColor | `#${string}`;
|
|
5
|
-
export type BgPreset = "black" | "slate" | "warm" | "midnight" | "charcoal" | "nord" | "plum" | "dracula" | "forest";
|
|
5
|
+
export type BgPreset = "black" | "slate" | "warm" | "midnight" | "charcoal" | "nord" | "plum" | "dracula" | "forest" | "light" | "sand" | "solarizedLight" | "snow";
|
|
6
6
|
/** A preset, or "custom": the user's own colours, from `customTheme`. */
|
|
7
7
|
export type Background = BgPreset | "custom";
|
|
8
8
|
/**
|
|
@@ -30,8 +30,9 @@ export declare const ACCENTS: Record<AccentColor, {
|
|
|
30
30
|
base: string;
|
|
31
31
|
strong: string;
|
|
32
32
|
}>;
|
|
33
|
-
/** The five-step neutral ramp,
|
|
34
|
-
*
|
|
33
|
+
/** The five-step neutral ramp: the window, the side panels, the content, the controls on it, a
|
|
34
|
+
* hover. Borders and hovers are a wash of the text colour (applyTheme), so they work on every one.
|
|
35
|
+
* A light preset sets its own dark text; the dark ones share PRESET_TEXT. */
|
|
35
36
|
export declare const BG_PRESETS: Record<BgPreset, {
|
|
36
37
|
label: string;
|
|
37
38
|
app: string;
|
|
@@ -40,6 +41,8 @@ export declare const BG_PRESETS: Record<BgPreset, {
|
|
|
40
41
|
elev: string;
|
|
41
42
|
hover: string;
|
|
42
43
|
muted: string;
|
|
44
|
+
text?: string;
|
|
45
|
+
textSecondary?: string;
|
|
43
46
|
}>;
|
|
44
47
|
/** Density scales the type ramp and the shared radii — the two things that set how much fits
|
|
45
48
|
* on screen without touching any component's own padding. */
|
|
@@ -80,12 +83,15 @@ export declare const DEFAULT_APPEARANCE: {
|
|
|
80
83
|
bgPreset: Background;
|
|
81
84
|
density: Density;
|
|
82
85
|
};
|
|
83
|
-
export type TermTheme = "match" | "deck" | "dark" | "dimmed" | "solarized" | "custom";
|
|
86
|
+
export type TermTheme = "match" | "deck" | "dark" | "dimmed" | "solarized" | "light" | "custom";
|
|
84
87
|
/** The eight ANSI colours programs print with. Bright variants follow them in a custom theme. */
|
|
85
88
|
export declare const ANSI_KEYS: readonly ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"];
|
|
86
89
|
export type Ansi = Record<(typeof ANSI_KEYS)[number], string>;
|
|
87
90
|
/** xterm's own defaults, which every theme but a custom one leaves in place. */
|
|
88
91
|
export declare const XTERM_ANSI: Ansi;
|
|
92
|
+
/** ANSI colours that read on a light background (VS Code's light terminal): xterm's yellow and
|
|
93
|
+
* white are near-invisible there. */
|
|
94
|
+
export declare const LIGHT_ANSI: Ansi;
|
|
89
95
|
/** A custom terminal theme: every colour, each "#rrggbb". */
|
|
90
96
|
export interface TermCustom {
|
|
91
97
|
background: string;
|
|
@@ -102,6 +108,7 @@ export declare const TERM_THEMES: Record<Exclude<TermTheme, "match" | "custom">,
|
|
|
102
108
|
foreground: string;
|
|
103
109
|
cursor: string;
|
|
104
110
|
selectionBackground: string;
|
|
111
|
+
ansi?: Ansi;
|
|
105
112
|
}>;
|
|
106
113
|
/** The label a theme shows in the picker, including the derived "match" entry. */
|
|
107
114
|
export declare const TERM_THEME_LABELS: Record<TermTheme, string>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
/** The fields this needs, so it reads a LayoutWorkspace without importing layout.ts. */
|
|
3
|
+
interface HasFolders {
|
|
4
|
+
cwd: string;
|
|
5
|
+
folders?: string[];
|
|
6
|
+
}
|
|
7
|
+
/** Every folder of a workspace, the main one first, each once. The main one may be "" (home). */
|
|
8
|
+
export declare function foldersOf(ws: HasFolders): string[];
|
|
9
|
+
/** Whether two spellings name the same folder (case, slashes, a trailing slash aside). */
|
|
10
|
+
export declare const sameFolder: (a: string, b: string) => boolean;
|
|
11
|
+
/** Whether a workspace has more than its main folder. */
|
|
12
|
+
export declare const isMultiRoot: (ws: HasFolders) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The folder of `folders` that holds `path`: the deepest, so a folder inside another wins for its
|
|
15
|
+
* own files. Undefined when none does. Case and slashes do not matter; "" (home) holds nothing here.
|
|
16
|
+
*/
|
|
17
|
+
export declare function folderOf(folders: readonly string[], path: string): string | undefined;
|
|
18
|
+
/** A path relative to the folder holding it, with that folder's name first when there are several. */
|
|
19
|
+
export declare function relIn(folders: readonly string[], path: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* A folder's name as the tree and menus show it: its last segment, with its parent's when another
|
|
22
|
+
* folder of the workspace has the same last segment (two "app" folders read "shop/app", "blog/app").
|
|
23
|
+
*/
|
|
24
|
+
export declare function folderLabel(folders: readonly string[], folder: string): string;
|
|
25
|
+
/** Why a folder cannot be added, or null when it can: already in, or inside (or holding) one that is. A
|
|
26
|
+
* folder on a server (remotepath.ts) may join, and a server's workspace may take local folders. */
|
|
27
|
+
export declare function cannotAdd(ws: HasFolders, dir: string): string | null;
|
|
28
|
+
/** The workspace with `dir` added beside its folders (unchanged when it cannot be). */
|
|
29
|
+
export declare function withFolder<W extends HasFolders>(ws: W, dir: string): W;
|
|
30
|
+
/** The workspace without `dir`. The main folder stays: the session and the name hang on it. */
|
|
31
|
+
export declare function withoutFolder<W extends HasFolders>(ws: W, dir: string): W;
|
|
32
|
+
interface Mergeable extends HasFolders {
|
|
33
|
+
id: string;
|
|
34
|
+
tabs: {
|
|
35
|
+
root: unknown;
|
|
36
|
+
x?: number;
|
|
37
|
+
y?: number;
|
|
38
|
+
}[];
|
|
39
|
+
groups?: unknown[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* `from` folded into `into`: its folders join (its main one first), its tabs and groups move over,
|
|
43
|
+
* and every pane keeps running where it did: a pane that followed `from`'s main folder now names it
|
|
44
|
+
* as its own. Tabs lose their board place so they are laid out after `into`'s. `into` keeps its
|
|
45
|
+
* name, main folder and session.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mergedInto<W extends Mergeable>(into: W, from: W): W;
|
|
48
|
+
export {};
|
|
@@ -7,6 +7,7 @@ export type LayoutNode = {
|
|
|
7
7
|
id: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
view?: string;
|
|
10
|
+
cwd?: string;
|
|
10
11
|
} | {
|
|
11
12
|
kind: "split";
|
|
12
13
|
dir: SplitDir;
|
|
@@ -63,6 +64,8 @@ export interface LayoutWorkspace {
|
|
|
63
64
|
cwd: string;
|
|
64
65
|
tabs: LayoutTab[];
|
|
65
66
|
activeTab: string;
|
|
67
|
+
/** More folders beside `cwd`, its main one (core/workspaces/folders.ts). Absent: just the one. */
|
|
68
|
+
folders?: string[];
|
|
66
69
|
/** Tab groups: a name and colour over tabs that sit together in a zone's row, folded or not. */
|
|
67
70
|
groups?: TabGroup[];
|
|
68
71
|
/** Its colour on the sidebar's collapsed rail, by index (Terminals' TONES); none picks one from the name. */
|
|
@@ -116,8 +119,18 @@ export declare function activeWorkspaceCwd(): string;
|
|
|
116
119
|
export declare function switchWorkspace(wsId: string, tabId?: string): void;
|
|
117
120
|
/** The workspace whose cwd matches (case/slash-insensitive), for routing an agent hook to a tab. */
|
|
118
121
|
export declare function workspaceByCwd(cwd: string): LayoutWorkspace | undefined;
|
|
119
|
-
/** The folder a pane's shell was spawned in
|
|
122
|
+
/** The folder a pane's shell was spawned in: its own (one of the workspace's folders), else the workspace's. */
|
|
120
123
|
export declare function paneCwd(paneId: string): string;
|
|
124
|
+
/** The active workspace's folders, its main one first (folders.ts). */
|
|
125
|
+
export declare const activeWorkspaceFolders: () => string[];
|
|
126
|
+
/** The folder of the active workspace holding `path` (the deepest), else its main one: a language
|
|
127
|
+
* server's boundary and git's folder for that file. */
|
|
128
|
+
export declare const workspaceFolderFor: (path: string) => string;
|
|
129
|
+
/** Where to run git for a file, and its path from there: the workspace folder holding it, or (a file
|
|
130
|
+
* outside every folder) the main folder and the path the editor already has. */
|
|
131
|
+
export declare function gitSpotFor(path: string, fallbackRel: string): [string, string];
|
|
132
|
+
/** The workspace one of whose folders is `dir`, the main folder first: workspaceByCwd for every folder. */
|
|
133
|
+
export declare function workspaceHolding(dir: string): LayoutWorkspace | undefined;
|
|
121
134
|
/**
|
|
122
135
|
* A pane's display name: its own label, else the title of the tab holding it.
|
|
123
136
|
*
|
|
@@ -141,7 +154,7 @@ export declare const termSweepScrollback: (keep: string[]) => Promise<number>;
|
|
|
141
154
|
export declare const termScrollback: (id: string) => Promise<string>;
|
|
142
155
|
export declare const newLeaf: () => LayoutNode;
|
|
143
156
|
export declare function leafIds(n: LayoutNode): string[];
|
|
144
|
-
export declare function splitLeaf(n: LayoutNode, id: string, dir: SplitDir, ratio?: number, view?: string): LayoutNode;
|
|
157
|
+
export declare function splitLeaf(n: LayoutNode, id: string, dir: SplitDir, ratio?: number, view?: string, cwd?: string): LayoutNode;
|
|
145
158
|
export declare function setLeafLabel(n: LayoutNode, id: string, label: string): LayoutNode;
|
|
146
159
|
/**
|
|
147
160
|
* Turn a pane into a view, or back into a terminal when `view` is empty.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Terminal } from "@xterm/xterm";
|
|
3
3
|
import { FitAddon } from "@xterm/addon-fit";
|
|
4
4
|
import { LayoutWorkspace } from "./layout";
|
|
5
|
-
export { publishLayout, getLayout, loadLayoutOnce, mutateLayout, useLayout, activeWorkspaceCwd, switchWorkspace, workspaceByCwd, paneCwd, paneLabel, paneLocation, termSpawn, termWrite, termResize, termKill, termList, termSweepScrollback, termScrollback, leafIds, splitLeaf, setLeafLabel, setLeafView, closeLeaf, findLeaf, insertBeside, moveLeaf, openTabInWorkspace } from "./layout";
|
|
5
|
+
export { publishLayout, getLayout, loadLayoutOnce, mutateLayout, useLayout, activeWorkspaceCwd, activeWorkspaceFolders, switchWorkspace, workspaceByCwd, workspaceHolding, paneCwd, paneLabel, paneLocation, termSpawn, termWrite, termResize, termKill, termList, termSweepScrollback, termScrollback, leafIds, splitLeaf, setLeafLabel, setLeafView, closeLeaf, findLeaf, insertBeside, moveLeaf, openTabInWorkspace } from "./layout";
|
|
6
6
|
export type { SplitDir, LayoutNode, LayoutTab, LayoutWorkspace, FloatBounds, Layout, DropSide } from "./layout";
|
|
7
7
|
export { ZONE_BOARD, zoneAt, zones, zoneOf, zoneToward, moveZone, reorderTab, GROUP_COLORS, addToGroup, leaveGroup, moveGroup, toggleGroupFold, ungroup, setGroup, openActiveGroup, pruneGroups, moveTabToZone, addTabToZone, reopenTab, showActiveTab, nextActiveAfterClose, setTabWindow, mergeWindow, dockWindow, nextZoneSpot, zoneBoardFull } from "./zones";
|
|
8
8
|
export type { Zone, TabGroup } from "./zones";
|