deck-plugin-sdk 0.15.1

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.
Files changed (45) hide show
  1. package/README.md +77 -0
  2. package/bin/deck-plugin.mjs +117 -0
  3. package/build-plugin.mjs +143 -0
  4. package/package.json +42 -0
  5. package/shim/bridge.d.ts +5 -0
  6. package/shim/bridge.js +196 -0
  7. package/shim/event.d.ts +5 -0
  8. package/shim/event.js +5 -0
  9. package/shim/jsx-runtime.js +20 -0
  10. package/shim/mcp.d.ts +68 -0
  11. package/shim/monaco.d.ts +5 -0
  12. package/shim/monaco.js +15 -0
  13. package/shim/react.js +50 -0
  14. package/shim/settings.d.ts +5 -0
  15. package/shim/settings.js +13 -0
  16. package/shim/terminals.d.ts +4 -0
  17. package/shim/terminals.js +70 -0
  18. package/shim/ui.d.ts +14 -0
  19. package/shim/ui.js +37 -0
  20. package/template/README.md +17 -0
  21. package/template/gitignore +4 -0
  22. package/template/package.json +10 -0
  23. package/template/plugin.json +8 -0
  24. package/template/src/plugin.tsx +65 -0
  25. package/template/tsconfig.json +13 -0
  26. package/types/components/ConfirmDialog.d.ts +22 -0
  27. package/types/components/ContextMenu.d.ts +41 -0
  28. package/types/components/MarkdownToolbar.d.ts +48 -0
  29. package/types/components/NamePrompt.d.ts +16 -0
  30. package/types/components/TabStrip.d.ts +26 -0
  31. package/types/components/Toast.d.ts +48 -0
  32. package/types/components/TreeRow.d.ts +41 -0
  33. package/types/components/dragrow.d.ts +34 -0
  34. package/types/components/menuplace.d.ts +30 -0
  35. package/types/components/ui.d.ts +102 -0
  36. package/types/components/useResize.d.ts +24 -0
  37. package/types/core/bridge.d.ts +670 -0
  38. package/types/core/editorsettings.d.ts +60 -0
  39. package/types/core/langmap.d.ts +15 -0
  40. package/types/core/monaco.d.ts +36 -0
  41. package/types/core/settingsstore.d.ts +19 -0
  42. package/types/core/shellpath.d.ts +45 -0
  43. package/types/core/terminals.d.ts +322 -0
  44. package/types/core/theme.d.ts +68 -0
  45. package/types/modules/editor/MarkdownLive.d.ts +61 -0
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # deck-plugin-sdk
2
+
3
+ Build a plugin for [Deck](https://deck.hasan-zarif.com), outside Deck's own repository.
4
+
5
+ ```sh
6
+ npm create deck-plugin my-thing
7
+ cd my-thing
8
+ npm run dev # build, and rebuild as you edit
9
+ npm run install-local # copy it into Deck, which loads it without a restart
10
+ ```
11
+
12
+ ## What a plugin is
13
+
14
+ A folder with a `plugin.json` and a built `plugin.js`, read from
15
+ `%APPDATA%\Deck\plugins\<id>\` when Deck starts. It becomes a tab, or a readout in the footer,
16
+ or a panel, or commands in the palette — `plugins/API.md` in the Deck repository lists every
17
+ slot a plugin can fill. One is enough.
18
+
19
+ Your sources import `react`, `lucide-react` and the shim modules as ordinary code does. At run
20
+ time those resolve to **Deck's** copies, handed over on `window.__deck`. For React that is not
21
+ an optimisation but a requirement: two Reacts in one tree break hooks.
22
+
23
+ ## Commands
24
+
25
+ | | |
26
+ |---|---|
27
+ | `deck-plugin build` | bundle `src/` into `plugin.js` |
28
+ | `deck-plugin dev` | the same, rebuilt whenever a source changes |
29
+ | `deck-plugin check` | validate `plugin.json` without building |
30
+ | `deck-plugin install` | build, then copy into Deck's plugins folder |
31
+
32
+ `install` prefers `%APPDATA%\Deck-Dev` when it exists, since anyone writing a plugin is probably
33
+ running a debug build beside the installed one.
34
+
35
+ ## What you can import
36
+
37
+ ```ts
38
+ import { configRead, configWrite } from "../shim/bridge.js"; // Deck's Tauri commands
39
+ import { listen } from "../shim/event.js"; // Deck's event bus
40
+ import { getSettings } from "../shim/settings.js"; // Deck's settings store
41
+ import { Field, GhostButton } from "../shim/ui.js"; // Deck's form controls
42
+ import { getLayout } from "../shim/terminals.js"; // the terminal layout
43
+ import { monaco } from "../shim/monaco.js"; // the editor
44
+ ```
45
+
46
+ `shim/` and `types/` are written by the build. They are not yours to edit and belong in
47
+ `.gitignore` — the template already ignores them.
48
+
49
+ The types are generated from Deck's own source, so what your editor tells you is what Deck
50
+ actually exposes rather than a hand-written approximation that has drifted.
51
+
52
+ ## What a plugin cannot do
53
+
54
+ Add native capability. Every Tauri command is compiled into Deck, so a plugin calls what already
55
+ exists. Anything needing new Rust belongs in Deck itself.
56
+
57
+ ## What a plugin CAN do, which is worth saying plainly
58
+
59
+ **Everything Deck can.** A plugin runs inside Deck with the whole bridge: every Tauri command,
60
+ the config directory, the filesystem, the terminal, a Google access token if one is connected.
61
+ There is no sandbox and no permission prompt.
62
+
63
+ That is a deliberate position rather than an oversight — a plugin is code you chose to run, like
64
+ a VS Code extension or a shell script. It is also why the plugin registry is curated rather than
65
+ open: an entry exists there because it was reviewed, and installing a plugin from anywhere else
66
+ is the same decision as running any other program.
67
+
68
+ ## Versions
69
+
70
+ The SDK's major and minor track Deck's, so an SDK 0.15 builds plugins for Deck 0.15. Declare the
71
+ oldest Deck you work with as `minDeck` in `plugin.json`; Deck refuses to load a plugin that
72
+ needs a newer one, with a sentence rather than an error from inside your module.
73
+
74
+ ## Publishing
75
+
76
+ A plugin is published by being listed in Deck's registry, which points at a release in your own
77
+ repository. Until that is open to submissions, ask.
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ // The Deck plugin CLI.
3
+ //
4
+ // deck-plugin build bundle src/ into plugin.js
5
+ // deck-plugin dev rebuild whenever a source changes
6
+ // deck-plugin check validate plugin.json without building
7
+ // deck-plugin install copy the built plugin into Deck's plugins folder
8
+ //
9
+ // Run from a plugin's own directory.
10
+ import { watch } from "node:fs";
11
+ import { cpSync, existsSync, mkdirSync, readFileSync } from "node:fs";
12
+ import { join } from "node:path";
13
+ import { buildPlugin } from "../build-plugin.mjs";
14
+
15
+ const [cmd = "build"] = process.argv.slice(2);
16
+ const dir = process.cwd();
17
+
18
+ const die = (msg) => { console.error(msg); process.exit(1); };
19
+
20
+ /**
21
+ * What Deck will refuse at install time, refused here instead.
22
+ *
23
+ * Every rule is one Deck's loader or install_from_registry applies — the id charset especially,
24
+ * because the id becomes a config key and a path component. Finding out here costs a second;
25
+ * finding out from a failed install costs a round trip.
26
+ */
27
+ function check() {
28
+ const p = join(dir, "plugin.json");
29
+ if (!existsSync(p)) die("no plugin.json here — is this a plugin directory?");
30
+
31
+ let manifest;
32
+ try { manifest = JSON.parse(readFileSync(p, "utf8")); }
33
+ catch (e) { die(`plugin.json is not valid JSON: ${e.message}`); }
34
+
35
+ const id = (manifest.id ?? "").trim();
36
+ if (!id) die("plugin.json has no id");
37
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9-]*$/.test(id)) {
38
+ die(`id "${id}" must be letters, digits and dashes, starting with a letter or digit`);
39
+ }
40
+ if (!existsSync(join(dir, "src", "plugin.tsx"))) {
41
+ die("no src/plugin.tsx — that is the entry point");
42
+ }
43
+
44
+ // Not fatal, but worth saying: the registry's plugin page renders a README, and a published
45
+ // plugin without one gets an empty page.
46
+ const warn = [];
47
+ if (!manifest.version) warn.push("no version — Settings shows one, and the registry orders by it");
48
+ if (!manifest.description) warn.push("no description — the row says only a name");
49
+ if (!existsSync(join(dir, "README.md"))) warn.push("no README.md — publishing needs one");
50
+
51
+ console.log(`${manifest.name ?? id} ${manifest.version ?? ""}`.trim());
52
+ for (const w of warn) console.log(` note: ${w}`);
53
+ return manifest;
54
+ }
55
+
56
+ /** Where Deck reads plugins from on this machine. */
57
+ function pluginsDir() {
58
+ const appData = process.env.APPDATA;
59
+ if (!appData) die("APPDATA is not set — this command is for Windows, where Deck runs");
60
+ // Deck-Dev is the debug build's directory; prefer it when it exists, since someone building a
61
+ // plugin is almost certainly running a dev build beside it.
62
+ const dev = join(appData, "Deck-Dev", "plugins");
63
+ return existsSync(dev) ? dev : join(appData, "Deck", "plugins");
64
+ }
65
+
66
+ switch (cmd) {
67
+ case "check": {
68
+ check();
69
+ break;
70
+ }
71
+
72
+ case "build": {
73
+ const manifest = check();
74
+ await buildPlugin(dir);
75
+ console.log(`built ${manifest.id} -> plugin.js`);
76
+ break;
77
+ }
78
+
79
+ case "install": {
80
+ const manifest = check();
81
+ await buildPlugin(dir);
82
+ const dest = join(pluginsDir(), manifest.id);
83
+ mkdirSync(dest, { recursive: true });
84
+ for (const f of ["plugin.json", "plugin.js", "mcp.js"]) {
85
+ if (existsSync(join(dir, f))) cpSync(join(dir, f), join(dest, f));
86
+ }
87
+ console.log(`installed ${manifest.id} -> ${dest}`);
88
+ console.log("Deck watches that folder, so it is loaded already — no restart.");
89
+ break;
90
+ }
91
+
92
+ case "dev": {
93
+ check();
94
+ let building = false;
95
+ let again = false;
96
+ const once = async () => {
97
+ if (building) { again = true; return; }
98
+ building = true;
99
+ try { await buildPlugin(dir); console.log(`rebuilt at ${new Date().toLocaleTimeString()}`); }
100
+ catch (e) { console.error(e.message); }
101
+ building = false;
102
+ if (again) { again = false; void once(); }
103
+ };
104
+ await once();
105
+ // Debounced: an editor writing a file emits several events, and each would start a build.
106
+ let timer;
107
+ watch(join(dir, "src"), { recursive: true }, () => {
108
+ clearTimeout(timer);
109
+ timer = setTimeout(() => void once(), 120);
110
+ });
111
+ console.log("watching src/ — ctrl+c to stop");
112
+ break;
113
+ }
114
+
115
+ default:
116
+ die(`unknown command "${cmd}" — try build, dev, check or install`);
117
+ }
@@ -0,0 +1,143 @@
1
+ // Build a Deck plugin: TSX sources -> one plugin.js Deck can import.
2
+ //
3
+ // The same build Deck's own plugins get, with one difference: the shim is shipped with this
4
+ // package rather than generated, because generating it needs Deck's TypeScript sources and the
5
+ // point of this package is that you do not have them.
6
+ //
7
+ // Why a plugin wants a build step at all: JSX, and ordinary imports across as many files as you
8
+ // like. It is not rebuilding Deck — it is what a VS Code extension does.
9
+ //
10
+ // The shim is the whole trick. Deck hands React, its bridge, `listen`, its icons and its
11
+ // animation library over on `window.__deck`, and esbuild resolves those module names to files
12
+ // that read from there. So your sources import "react" as normal code does, and at run time get
13
+ // DECK'S React — which is not an optimisation but a requirement, since two Reacts in one tree
14
+ // break hooks.
15
+ import { build } from "esbuild";
16
+ import { cpSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
17
+ import { createRequire } from "node:module";
18
+ import { dirname, join } from "node:path";
19
+ import { fileURLToPath } from "node:url";
20
+
21
+ const sdk = dirname(fileURLToPath(import.meta.url));
22
+ const require = createRequire(import.meta.url);
23
+
24
+ /** The module names a plugin may import, and the shipped file each resolves to. */
25
+ function shimMap(shimDir) {
26
+ return {
27
+ react: join(shimDir, "react.js"),
28
+ "deckreact/jsx-runtime": join(shimDir, "jsx-runtime.js"),
29
+ "@tauri-apps/api/event": join(shimDir, "event.js"),
30
+ "lucide-react": join(shimDir, "icons.js"),
31
+ "framer-motion": join(shimDir, "motion.js"),
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Build the plugin in `dir`.
37
+ *
38
+ * The shim is copied in rather than imported from node_modules, because a plugin's sources refer
39
+ * to it by relative path (`../shim/bridge.js`) and that has to resolve on disk. Copied on every
40
+ * build so updating the SDK updates the shim, which is the behaviour someone upgrading expects.
41
+ */
42
+ export async function buildPlugin(dir, { entry = "plugin.tsx" } = {}) {
43
+ const manifestPath = join(dir, "plugin.json");
44
+ if (!existsSync(manifestPath)) {
45
+ throw new Error(`no plugin.json in ${dir}`);
46
+ }
47
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
48
+
49
+ const shimDir = join(dir, "shim");
50
+ rmSync(shimDir, { recursive: true, force: true });
51
+ cpSync(join(sdk, "shim"), shimDir, { recursive: true });
52
+ // The declarations the shim's .d.ts files point at, as ../types/. Copied beside it for the
53
+ // same reason: a relative reference has to find something.
54
+ const typesDir = join(dir, "types");
55
+ rmSync(typesDir, { recursive: true, force: true });
56
+ cpSync(join(sdk, "types"), typesDir, { recursive: true });
57
+
58
+ // ---- icons and animation, generated per plugin ----
59
+ //
60
+ // These two cannot be shipped pre-generated like the rest of the shim. They name only the
61
+ // exports THIS plugin imports, on purpose: re-exporting the whole package goes through a
62
+ // module esbuild cannot see into, which defeats tree-shaking — doing that with lucide took a
63
+ // bundle from 403kb to 640kb, larger than just bundling it.
64
+ //
65
+ // Nothing about this needs Deck's source, only the plugin's own and the real package, so it
66
+ // runs here the same way it runs inside the Deck repository.
67
+ const sources = readdirSync(join(dir, "src"), { recursive: true })
68
+ .filter((f) => typeof f === "string" && /\.tsx?$/.test(f))
69
+ .map((f) => readFileSync(join(dir, "src", f), "utf8"));
70
+
71
+ for (const [pkg, file, global] of [
72
+ ["lucide-react", "icons.js", "icons"],
73
+ ["framer-motion", "motion.js", "motion"],
74
+ ]) {
75
+ const re = new RegExp(String.raw`import\s*\{([^}]*)\}\s*from\s*"${pkg}"`, "g");
76
+ const names = [...new Set(sources.flatMap((src) => [...src.matchAll(re)]
77
+ .flatMap((m) => m[1].split(",").map((n) => n.trim().split(/\s+as\s+/)[0]).filter(Boolean))))].sort();
78
+
79
+ // Checked against the real package, so a typo fails here rather than as a blank icon at run
80
+ // time. Only loaded when something is actually imported from it, since framer-motion is an
81
+ // optional peer dependency.
82
+ if (names.length) {
83
+ let real;
84
+ try { real = require(pkg); }
85
+ catch { throw new Error(`this plugin imports from "${pkg}" — run: npm i ${pkg}`); }
86
+ for (const n of names) if (!(n in real)) throw new Error(`${pkg} has no export "${n}"`);
87
+ }
88
+
89
+ writeFileSync(join(shimDir, file), `// GENERATED by the Deck plugin build — do not edit.
90
+ //
91
+ // Deck's ${pkg}, so this plugin does not bundle its own copy. Only the names this plugin
92
+ // imports: naming every export would defeat tree-shaking and make the bundle larger.
93
+ const __src = window.__deck.${global};
94
+ ${names.map((n) => `export const ${n} = __src.${n};`).join("\n")}
95
+ `);
96
+ }
97
+
98
+ const shims = shimMap(shimDir);
99
+
100
+ await build({
101
+ entryPoints: [join(dir, "src", entry)],
102
+ outfile: join(dir, "plugin.js"),
103
+ bundle: true,
104
+ format: "esm",
105
+ target: "es2022",
106
+ // Nobody reads a plugin bundle; it is loaded by one import() at startup.
107
+ minify: true,
108
+ jsx: "automatic",
109
+ // React comes from Deck, so the automatic runtime must import from the shim rather than a
110
+ // "react/jsx-runtime" that does not exist here.
111
+ jsxImportSource: "deckreact",
112
+ // A .wasm import becomes a Uint8Array inlined in the bundle rather than a sidecar file. A
113
+ // plugin is installed as plugin.json + plugin.js, so a file beside them would never arrive.
114
+ loader: { ".wasm": "binary" },
115
+ // A resolve plugin rather than esbuild's `alias`, which maps package to package while these
116
+ // point at single files.
117
+ plugins: [{
118
+ name: "deck-runtime",
119
+ setup(b) {
120
+ const filter = new RegExp(`^(${Object.keys(shims)
121
+ .map((k) => k.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|")})$`);
122
+ b.onResolve({ filter }, (a) => ({ path: shims[a.path] }));
123
+ },
124
+ }],
125
+ logLevel: "info",
126
+ });
127
+
128
+ // Optional: only a plugin that brings agent-facing tools has one. Built for node, because the
129
+ // MCP server runs outside the webview.
130
+ if (existsSync(join(dir, "src", "mcp.ts"))) {
131
+ await build({
132
+ entryPoints: [join(dir, "src", "mcp.ts")],
133
+ outfile: join(dir, "mcp.js"),
134
+ platform: "node",
135
+ format: "esm",
136
+ target: "node18",
137
+ bundle: true,
138
+ logLevel: "info",
139
+ });
140
+ }
141
+
142
+ return manifest;
143
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "deck-plugin-sdk",
3
+ "version": "0.15.1",
4
+ "description": "Build a plugin for Deck, outside the Deck repository.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "deck-plugin": "bin/deck-plugin.mjs"
9
+ },
10
+ "exports": {
11
+ "./build": "./build-plugin.mjs",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "shim",
17
+ "types",
18
+ "template",
19
+ "build-plugin.mjs",
20
+ "README.md"
21
+ ],
22
+ "dependencies": {
23
+ "esbuild": "^0.25.0"
24
+ },
25
+ "peerDependencies": {
26
+ "@types/react": "^19.0.0",
27
+ "framer-motion": "^13.0.0",
28
+ "lucide-react": "^1.0.0",
29
+ "monaco-editor": "^0.56.0",
30
+ "react": "^19.0.0",
31
+ "typescript": "^5.0.0"
32
+ },
33
+ "peerDependenciesMeta": {
34
+ "framer-motion": { "optional": true },
35
+ "monaco-editor": { "optional": true },
36
+ "typescript": { "optional": true }
37
+ },
38
+ "engines": {
39
+ "node": ">=20"
40
+ },
41
+ "keywords": ["deck", "plugin", "sdk"]
42
+ }
@@ -0,0 +1,5 @@
1
+ // GENERATED by sdk/gen-shim.mjs — do not edit.
2
+ //
3
+ // Deck's own bridge types, so a plugin is typechecked against what Deck actually exposes rather
4
+ // than against `any`.
5
+ export * from "../types/core/bridge";
package/shim/bridge.js ADDED
@@ -0,0 +1,196 @@
1
+ // GENERATED by sdk/gen-shim.mjs — do not edit.
2
+ //
3
+ // Deck's bridge. Everything resolves at USE time, never at import time: a plugin module is
4
+ // evaluated during loadPlugins, and a reference copied out then would capture a half-built
5
+ // object. Functions forward their arguments; plain values are proxied.
6
+ const b = () => {
7
+ const x = window.__deck?.bridge;
8
+ if (!x) throw new Error("window.__deck.bridge is missing — this plugin only runs inside Deck");
9
+ return x;
10
+ };
11
+
12
+ export const askAssistant = (...a) => b().askAssistant(...a);
13
+ export const calendarCached = (...a) => b().calendarCached(...a);
14
+ export const calendarRefresh = (...a) => b().calendarRefresh(...a);
15
+ export const claudePlanLimits = (...a) => b().claudePlanLimits(...a);
16
+ export const claudeUsage = (...a) => b().claudeUsage(...a);
17
+ export const clearWallpaper = (...a) => b().clearWallpaper(...a);
18
+ export const closeApp = (...a) => b().closeApp(...a);
19
+ export const configRead = (...a) => b().configRead(...a);
20
+ export const configWrite = (...a) => b().configWrite(...a);
21
+ export const convertFileSrc = (...a) => b().convertFileSrc(...a);
22
+ export const dbConnect = (...a) => b().dbConnect(...a);
23
+ export const dbDisconnect = (...a) => b().dbDisconnect(...a);
24
+ export const dbQuery = (...a) => b().dbQuery(...a);
25
+ export const dbSchema = (...a) => b().dbSchema(...a);
26
+ export const defaultDownloadDir = (...a) => b().defaultDownloadDir(...a);
27
+ export const deleteIconPack = (...a) => b().deleteIconPack(...a);
28
+ export const dirsDownload = (...a) => b().dirsDownload(...a);
29
+ export const exec = (...a) => b().exec(...a);
30
+ export const footerOrder = (...a) => b().footerOrder(...a);
31
+ export const fsCopy = (...a) => b().fsCopy(...a);
32
+ export const fsCreateDir = (...a) => b().fsCreateDir(...a);
33
+ export const fsCreateFile = (...a) => b().fsCreateFile(...a);
34
+ export const fsDelete = (...a) => b().fsDelete(...a);
35
+ export const fsHomeDir = (...a) => b().fsHomeDir(...a);
36
+ export const fsList = (...a) => b().fsList(...a);
37
+ export const fsMove = (...a) => b().fsMove(...a);
38
+ export const fsOpen = (...a) => b().fsOpen(...a);
39
+ export const fsRead = (...a) => b().fsRead(...a);
40
+ export const fsReadBytes = (...a) => b().fsReadBytes(...a);
41
+ export const fsRename = (...a) => b().fsRename(...a);
42
+ export const fsReplace = (...a) => b().fsReplace(...a);
43
+ export const fsReveal = (...a) => b().fsReveal(...a);
44
+ export const fsSaveUnique = (...a) => b().fsSaveUnique(...a);
45
+ export const fsSearch = (...a) => b().fsSearch(...a);
46
+ export const fsSize = (...a) => b().fsSize(...a);
47
+ export const fsWrite = (...a) => b().fsWrite(...a);
48
+ export const fsWriteBytes = (...a) => b().fsWriteBytes(...a);
49
+ export const getAutostart = (...a) => b().getAutostart(...a);
50
+ export const getVaultRoot = (...a) => b().getVaultRoot(...a);
51
+ export const gitAbortOp = (...a) => b().gitAbortOp(...a);
52
+ export const gitAiCommitMsg = (...a) => b().gitAiCommitMsg(...a);
53
+ export const gitBlameLine = (...a) => b().gitBlameLine(...a);
54
+ export const gitBranchAt = (...a) => b().gitBranchAt(...a);
55
+ export const gitBranchDelete = (...a) => b().gitBranchDelete(...a);
56
+ export const gitBranchDeleteRemote = (...a) => b().gitBranchDeleteRemote(...a);
57
+ export const gitBranches = (...a) => b().gitBranches(...a);
58
+ export const gitCheckout = (...a) => b().gitCheckout(...a);
59
+ export const gitCheckoutDetach = (...a) => b().gitCheckoutDetach(...a);
60
+ export const gitCheckoutNew = (...a) => b().gitCheckoutNew(...a);
61
+ export const gitCheckoutTrack = (...a) => b().gitCheckoutTrack(...a);
62
+ export const gitCherryPick = (...a) => b().gitCherryPick(...a);
63
+ export const gitCommit = (...a) => b().gitCommit(...a);
64
+ export const gitCommitAmend = (...a) => b().gitCommitAmend(...a);
65
+ export const gitCommitFiles = (...a) => b().gitCommitFiles(...a);
66
+ export const gitDiscard = (...a) => b().gitDiscard(...a);
67
+ export const gitFetch = (...a) => b().gitFetch(...a);
68
+ export const gitFileBytes = (...a) => b().gitFileBytes(...a);
69
+ export const gitFileDiff = (...a) => b().gitFileDiff(...a);
70
+ export const gitHeadFile = (...a) => b().gitHeadFile(...a);
71
+ export const gitIndexFile = (...a) => b().gitIndexFile(...a);
72
+ export const gitInfo = (...a) => b().gitInfo(...a);
73
+ export const gitLogGraph = (...a) => b().gitLogGraph(...a);
74
+ export const gitMerge = (...a) => b().gitMerge(...a);
75
+ export const gitPendingOp = (...a) => b().gitPendingOp(...a);
76
+ export const gitPull = (...a) => b().gitPull(...a);
77
+ export const gitPullRebase = (...a) => b().gitPullRebase(...a);
78
+ export const gitPush = (...a) => b().gitPush(...a);
79
+ export const gitPushBranch = (...a) => b().gitPushBranch(...a);
80
+ export const gitRefs = (...a) => b().gitRefs(...a);
81
+ export const gitRemotes = (...a) => b().gitRemotes(...a);
82
+ export const gitResetTo = (...a) => b().gitResetTo(...a);
83
+ export const gitRevert = (...a) => b().gitRevert(...a);
84
+ export const gitShowFile = (...a) => b().gitShowFile(...a);
85
+ export const gitStage = (...a) => b().gitStage(...a);
86
+ export const gitStageContent = (...a) => b().gitStageContent(...a);
87
+ export const gitStash = (...a) => b().gitStash(...a);
88
+ export const gitStashApply = (...a) => b().gitStashApply(...a);
89
+ export const gitStashClear = (...a) => b().gitStashClear(...a);
90
+ export const gitStashDrop = (...a) => b().gitStashDrop(...a);
91
+ export const gitStashList = (...a) => b().gitStashList(...a);
92
+ export const gitStashPop = (...a) => b().gitStashPop(...a);
93
+ export const gitStashShow = (...a) => b().gitStashShow(...a);
94
+ export const gitStatus = (...a) => b().gitStatus(...a);
95
+ export const gitTag = (...a) => b().gitTag(...a);
96
+ export const gitTagDelete = (...a) => b().gitTagDelete(...a);
97
+ export const gitTagDeleteRemote = (...a) => b().gitTagDeleteRemote(...a);
98
+ export const gitTagPush = (...a) => b().gitTagPush(...a);
99
+ export const gitUndoCommit = (...a) => b().gitUndoCommit(...a);
100
+ export const gitUnstage = (...a) => b().gitUnstage(...a);
101
+ export const googleAccount = (...a) => b().googleAccount(...a);
102
+ export const googleSignIn = (...a) => b().googleSignIn(...a);
103
+ export const googleSignOut = (...a) => b().googleSignOut(...a);
104
+ export const googleToken = (...a) => b().googleToken(...a);
105
+ export const historyClear = (...a) => b().historyClear(...a);
106
+ export const historyDelete = (...a) => b().historyDelete(...a);
107
+ export const httpSend = (...a) => b().httpSend(...a);
108
+ export const importIconPack = (...a) => b().importIconPack(...a);
109
+ export const installClaudeHooks = (...a) => b().installClaudeHooks(...a);
110
+ export const installFromRegistry = (...a) => b().installFromRegistry(...a);
111
+ export const installPlugin = (...a) => b().installPlugin(...a);
112
+ export const isFullscreen = (...a) => b().isFullscreen(...a);
113
+ export const jiraCached = (...a) => b().jiraCached(...a);
114
+ export const jiraRefresh = (...a) => b().jiraRefresh(...a);
115
+ export const languagesDir = (...a) => b().languagesDir(...a);
116
+ export const launchFiles = (...a) => b().launchFiles(...a);
117
+ export const listApps = (...a) => b().listApps(...a);
118
+ export const listInstalled = (...a) => b().listInstalled(...a);
119
+ export const mailCached = (...a) => b().mailCached(...a);
120
+ export const mailRefresh = (...a) => b().mailRefresh(...a);
121
+ export const mediaSetNowPlaying = (...a) => b().mediaSetNowPlaying(...a);
122
+ export const mediaSetPlayback = (...a) => b().mediaSetPlayback(...a);
123
+ export const memUsage = (...a) => b().memUsage(...a);
124
+ export const notesDelete = (...a) => b().notesDelete(...a);
125
+ export const notesList = (...a) => b().notesList(...a);
126
+ export const notesRead = (...a) => b().notesRead(...a);
127
+ export const notesRename = (...a) => b().notesRename(...a);
128
+ export const notesScope = (...a) => b().notesScope(...a);
129
+ export const notesWrite = (...a) => b().notesWrite(...a);
130
+ export const notifyOs = (...a) => b().notifyOs(...a);
131
+ export const openApp = (...a) => b().openApp(...a);
132
+ export const openExternal = (...a) => b().openExternal(...a);
133
+ export const openFile = (...a) => b().openFile(...a);
134
+ export const pickAnyFile = (...a) => b().pickAnyFile(...a);
135
+ export const pickExe = (...a) => b().pickExe(...a);
136
+ export const pickFile = (...a) => b().pickFile(...a);
137
+ export const pickFolder = (...a) => b().pickFolder(...a);
138
+ export const pickImage = (...a) => b().pickImage(...a);
139
+ export const pickSavePath = (...a) => b().pickSavePath(...a);
140
+ export const pickScript = (...a) => b().pickScript(...a);
141
+ export const pluginsDir = (...a) => b().pluginsDir(...a);
142
+ export const powerAction = (...a) => b().powerAction(...a);
143
+ export const procKill = (...a) => b().procKill(...a);
144
+ export const procStream = (...a) => b().procStream(...a);
145
+ export const procWrite = (...a) => b().procWrite(...a);
146
+ export const readDownloads = (...a) => b().readDownloads(...a);
147
+ export const readIconPackTheme = (...a) => b().readIconPackTheme(...a);
148
+ export const readLibrary = (...a) => b().readLibrary(...a);
149
+ export const readMusicSuggestions = (...a) => b().readMusicSuggestions(...a);
150
+ export const readMusicTaste = (...a) => b().readMusicTaste(...a);
151
+ export const readTermLayout = (...a) => b().readTermLayout(...a);
152
+ export const readTrackMeta = (...a) => b().readTrackMeta(...a);
153
+ export const removeClaudeHooks = (...a) => b().removeClaudeHooks(...a);
154
+ export const restartApp = (...a) => b().restartApp(...a);
155
+ export const revealInFolder = (...a) => b().revealInFolder(...a);
156
+ export const runScriptNow = (...a) => b().runScriptNow(...a);
157
+ export const sessionList = (...a) => b().sessionList(...a);
158
+ export const setAutostart = (...a) => b().setAutostart(...a);
159
+ export const setVaultRoot = (...a) => b().setVaultRoot(...a);
160
+ export const setWallpaper = (...a) => b().setWallpaper(...a);
161
+ export const setupChecks = (...a) => b().setupChecks(...a);
162
+ export const slackCached = (...a) => b().slackCached(...a);
163
+ export const slackRefresh = (...a) => b().slackRefresh(...a);
164
+ export const speakWithVoice = (...a) => b().speakWithVoice(...a);
165
+ export const sshTunnelClose = (...a) => b().sshTunnelClose(...a);
166
+ export const sshTunnelList = (...a) => b().sshTunnelList(...a);
167
+ export const sshTunnelOpen = (...a) => b().sshTunnelOpen(...a);
168
+ export const startupRead = (...a) => b().startupRead(...a);
169
+ export const startupWrite = (...a) => b().startupWrite(...a);
170
+ export const stopSpeaking = (...a) => b().stopSpeaking(...a);
171
+ export const toggleFullscreen = (...a) => b().toggleFullscreen(...a);
172
+ export const vaultDataRead = (...a) => b().vaultDataRead(...a);
173
+ export const vaultDataWrite = (...a) => b().vaultDataWrite(...a);
174
+ export const vaultRelativize = (...a) => b().vaultRelativize(...a);
175
+ export const vaultResolve = (...a) => b().vaultResolve(...a);
176
+ export const watchFiles = (...a) => b().watchFiles(...a);
177
+ export const writeDownloads = (...a) => b().writeDownloads(...a);
178
+ export const writeLibrary = (...a) => b().writeLibrary(...a);
179
+ export const writeMusicTaste = (...a) => b().writeMusicTaste(...a);
180
+ export const writeTermLayout = (...a) => b().writeTermLayout(...a);
181
+
182
+ export const DEFAULT_SETTINGS = new Proxy({}, {
183
+ get: (_t, k) => b().DEFAULT_SETTINGS[k],
184
+ ownKeys: () => Reflect.ownKeys(b().DEFAULT_SETTINGS),
185
+ getOwnPropertyDescriptor: (_t, k) => ({ ...Object.getOwnPropertyDescriptor(b().DEFAULT_SETTINGS, k), configurable: true }),
186
+ });
187
+ export const EMPTY_LIBRARY = new Proxy({}, {
188
+ get: (_t, k) => b().EMPTY_LIBRARY[k],
189
+ ownKeys: () => Reflect.ownKeys(b().EMPTY_LIBRARY),
190
+ getOwnPropertyDescriptor: (_t, k) => ({ ...Object.getOwnPropertyDescriptor(b().EMPTY_LIBRARY, k), configurable: true }),
191
+ });
192
+ export const FOOTER_ITEMS = new Proxy({}, {
193
+ get: (_t, k) => b().FOOTER_ITEMS[k],
194
+ ownKeys: () => Reflect.ownKeys(b().FOOTER_ITEMS),
195
+ getOwnPropertyDescriptor: (_t, k) => ({ ...Object.getOwnPropertyDescriptor(b().FOOTER_ITEMS, k), configurable: true }),
196
+ });
@@ -0,0 +1,5 @@
1
+ // GENERATED by sdk/gen-shim.mjs — do not edit.
2
+ //
3
+ // Tauri's real event types, so `listen` and the unsubscribe it returns are typed.
4
+ export { listen } from "@tauri-apps/api/event";
5
+ export type { Event, EventCallback, UnlistenFn } from "@tauri-apps/api/event";
package/shim/event.js ADDED
@@ -0,0 +1,5 @@
1
+ // GENERATED by sdk/gen-shim.mjs — do not edit.
2
+ //
3
+ // @tauri-apps/api/event. Only listen: a plugin subscribing to Deck's events is expected, one
4
+ // emitting into them is not.
5
+ export const listen = (event, handler) => window.__deck.listen(event, handler);
@@ -0,0 +1,20 @@
1
+ // GENERATED by sdk/gen-shim.mjs — do not edit.
2
+ //
3
+ // The automatic JSX runtime, backed by Deck's React. With jsx: "automatic", esbuild emits an
4
+ // import of "<source>/jsx-runtime" per element, so that module has to exist and has to be
5
+ // Deck's React. createElement covers jsx/jsxs/jsxDEV: the difference is a key argument and a
6
+ // dev warning, neither of which changes what renders.
7
+ const React = window.__deck.React;
8
+ const make = (type, props, key) => {
9
+ const { children, ...rest } = props ?? {};
10
+ if (key !== undefined) rest.key = key;
11
+ return Array.isArray(children)
12
+ ? React.createElement(type, rest, ...children)
13
+ : children === undefined
14
+ ? React.createElement(type, rest)
15
+ : React.createElement(type, rest, children);
16
+ };
17
+ export const jsx = make;
18
+ export const jsxs = make;
19
+ export const jsxDEV = make;
20
+ export const Fragment = React.Fragment;