@jdg-keyforge/protocol 0.10.0 → 0.12.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.
@@ -0,0 +1,160 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Globally unique reverse-DNS plugin id; install folder name and <plugin_id> in Action.type.
8
+ */
9
+ export type PluginID = string;
10
+ /**
11
+ * Kind of physical input.
12
+ */
13
+ export type InputKind = "key" | "encoder";
14
+ /**
15
+ * Returns every installed plugin with the state of its process. No params in v1.
16
+ */
17
+ export interface MethodListPlugins {
18
+ /**
19
+ * No parameters in v1.
20
+ */
21
+ params: {};
22
+ result: {
23
+ /**
24
+ * Installed plugins.
25
+ */
26
+ plugins: InstalledPlugin[];
27
+ };
28
+ }
29
+ /**
30
+ * A plugin installed in the daemon, with the state of its process.
31
+ */
32
+ export interface InstalledPlugin {
33
+ manifest: PluginManifest;
34
+ /**
35
+ * State of the plugin process: 'starting' (spawned, hello not received yet), 'running' (connected), 'stopped' (not running, e.g. exited cleanly) or 'error' (failed to start or crashed; see 'error').
36
+ */
37
+ status: "starting" | "running" | "stopped" | "error";
38
+ /**
39
+ * Human-readable reason why the plugin failed. The daemon sets it only when status is 'error' (not enforced by the schema).
40
+ */
41
+ error?: string;
42
+ }
43
+ /**
44
+ * Contents of the manifest.json file at the root of a plugin. A plugin is distributed as a '.keyforgeplugin' file: a zip archive with manifest.json at its root (no wrapping folder) plus every file the manifest references. The daemon installs it by extracting the archive into '<config dir>/plugins/<id>/', taking the id from the manifest. All file paths in the manifest (icon, and entrypoint paths containing '/') are relative to the plugin root, use '/' as separator, and must stay inside the plugin root: the daemon rejects '..' segments and any path or archive entry that escapes the root.
45
+ */
46
+ export interface PluginManifest {
47
+ /**
48
+ * Manifest format version. Currently 1; bumped if the manifest shape changes.
49
+ */
50
+ manifest_version: 1;
51
+ id: PluginID;
52
+ /**
53
+ * Human-friendly plugin name for the UI.
54
+ */
55
+ name: string;
56
+ /**
57
+ * Plugin version (SemVer 2.0).
58
+ */
59
+ version: string;
60
+ /**
61
+ * Major version of the protocol the plugin speaks. Lets the daemon reject an incompatible plugin before spawning it. Currently '1'.
62
+ */
63
+ protocol_version: "1";
64
+ /**
65
+ * Plugin author, shown in the UI.
66
+ */
67
+ author?: string;
68
+ /**
69
+ * Short description of what the plugin does.
70
+ */
71
+ description?: string;
72
+ /**
73
+ * URL of the plugin homepage or source repository.
74
+ */
75
+ homepage?: string;
76
+ /**
77
+ * Category the UI groups the plugin's actions under (e.g. 'Audio', 'Streaming').
78
+ */
79
+ category?: string;
80
+ /**
81
+ * Path to the plugin icon, relative to the plugin root. No leading '/', no '\' and no ':'.
82
+ */
83
+ icon?: string;
84
+ /**
85
+ * Command the daemon runs to start the plugin, per OS (keys match Go's GOOS). The plugin supports exactly the OSes listed here.
86
+ */
87
+ entrypoint: {
88
+ darwin?: PluginCommand;
89
+ linux?: PluginCommand;
90
+ windows?: PluginCommand;
91
+ };
92
+ /**
93
+ * Actions the plugin exposes. Each becomes bindable as 'plugin.<id>.<action id>'.
94
+ *
95
+ * @minItems 1
96
+ */
97
+ actions: [PluginAction, ...PluginAction[]];
98
+ }
99
+ /**
100
+ * Executable plus arguments used to start a plugin process.
101
+ */
102
+ export interface PluginCommand {
103
+ /**
104
+ * Executable to run. A path containing '/' is resolved relative to the plugin root; a bare name (e.g. 'node') is looked up on the PATH. Always use '/' as separator, also on Windows; absolute paths, '\' and ':' are not allowed.
105
+ */
106
+ path: string;
107
+ /**
108
+ * Arguments passed to the executable.
109
+ */
110
+ args?: string[];
111
+ }
112
+ /**
113
+ * An action a plugin exposes, declared in its manifest.
114
+ */
115
+ export interface PluginAction {
116
+ /**
117
+ * Action identifier, unique within the plugin. snake_case, no dots.
118
+ */
119
+ id: string;
120
+ /**
121
+ * Human-friendly action name for the UI.
122
+ */
123
+ name: string;
124
+ /**
125
+ * Optional longer description of what the action does.
126
+ */
127
+ description?: string;
128
+ /**
129
+ * Input kinds the action can be bound to. Omitted means any kind.
130
+ *
131
+ * @minItems 1
132
+ */
133
+ inputs?: [InputKind, ...InputKind[]];
134
+ /**
135
+ * Params this action accepts, in display order.
136
+ */
137
+ params: ParamSpec[];
138
+ }
139
+ /**
140
+ * Describes one action parameter so a client can render an input for it.
141
+ */
142
+ export interface ParamSpec {
143
+ /**
144
+ * Param key written into Action.params. Unique within the action.
145
+ */
146
+ name: string;
147
+ /**
148
+ * Human-friendly field label.
149
+ */
150
+ label: string;
151
+ /**
152
+ * Param value type. Only 'string' in v1.
153
+ */
154
+ type: "string";
155
+ required: boolean;
156
+ /**
157
+ * Optional placeholder/example shown in the input.
158
+ */
159
+ placeholder?: string;
160
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -11,6 +11,10 @@ export type DeviceID = string;
11
11
  * What happened on the input.
12
12
  */
13
13
  export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
14
+ /**
15
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
16
+ */
17
+ export type Color = string;
14
18
  /**
15
19
  * Returns all profiles the daemon currently has, along with the id of the active one. The active profile id is tracked at the daemon level and only exposed here.
16
20
  */
@@ -46,6 +50,10 @@ export interface Profile {
46
50
  * Bindings that belong to this profile.
47
51
  */
48
52
  bindings: Binding[];
53
+ /**
54
+ * LED colors this profile paints on RGB-capable inputs, applied by the daemon whenever the profile becomes active. An RGB input with no entry here is turned off. At most one entry per (device_id, input_id); the daemon enforces uniqueness. Absent means no colors.
55
+ */
56
+ colors?: InputColor[];
49
57
  }
50
58
  /**
51
59
  * Maps an input on a specific device to an action.
@@ -71,3 +79,14 @@ export interface Action {
71
79
  [k: string]: unknown;
72
80
  };
73
81
  }
82
+ /**
83
+ * LED color assigned to one input of a device.
84
+ */
85
+ export interface InputColor {
86
+ device_id: DeviceID;
87
+ /**
88
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
89
+ */
90
+ input_id: string;
91
+ color: Color;
92
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
8
+ */
9
+ export type DeviceID = string;
10
+ /**
11
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
12
+ */
13
+ export type Color = string;
14
+ /**
15
+ * Sets the LED color of an RGB-capable input in the active profile and paints it on the device. The pair (device_id, input_id) is the unique key; calling this method again replaces the previous color, and '#000000' turns the LED off. Colors belong to the profile: switching profiles repaints every RGB input with the new profile's colors. The daemon rejects inputs that are unknown or have no RGB LED (Input.rgb is not true).
16
+ */
17
+ export interface MethodSetInputColor {
18
+ params: {
19
+ device_id: DeviceID;
20
+ /**
21
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
22
+ */
23
+ input_id: string;
24
+ color: Color;
25
+ };
26
+ /**
27
+ * Empty acknowledgement object.
28
+ */
29
+ result: {};
30
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Id of the plugin to uninstall.
8
+ */
9
+ export type PluginID = string;
10
+ /**
11
+ * Stops the plugin's process and deletes its folder. Bindings that use the plugin's actions are left untouched (orphaned): while the plugin is missing, firing them does nothing, and reinstalling the plugin makes them work again.
12
+ */
13
+ export interface MethodUninstallPlugin {
14
+ params: {
15
+ id: PluginID;
16
+ };
17
+ /**
18
+ * Empty acknowledgement object. Reserved for future fields without breaking the schema.
19
+ */
20
+ result: {};
21
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jdg-keyforge/protocol",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "TypeScript types for the KeyForge WebSocket protocol, generated from the canonical JSON Schema contracts.",
5
5
  "keywords": ["keyforge", "protocol", "types", "json-schema", "websocket"],
6
6
  "license": "Apache-2.0",
package/src/common.ts CHANGED
@@ -26,6 +26,17 @@ export type InputKind = "key" | "encoder";
26
26
  * via the `definition` "InputAction".
27
27
  */
28
28
  export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
29
+ /**
30
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
31
+ *
32
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
33
+ * via the `definition` "Color".
34
+ */
35
+ export type Color = string;
36
+ /**
37
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
38
+ */
39
+ export type Color1 = string;
29
40
  /**
30
41
  * Globally unique plugin identifier in reverse-DNS form (e.g. 'dev.jonidg.spotify'). Lowercase, at least two dot-separated segments, each starting with a letter. Used as the install folder name and as <plugin_id> in Action.type.
31
42
  *
@@ -166,6 +177,24 @@ export interface Profile {
166
177
  * Bindings that belong to this profile.
167
178
  */
168
179
  bindings: Binding[];
180
+ /**
181
+ * LED colors this profile paints on RGB-capable inputs, applied by the daemon whenever the profile becomes active. An RGB input with no entry here is turned off. At most one entry per (device_id, input_id); the daemon enforces uniqueness. Absent means no colors.
182
+ */
183
+ colors?: InputColor[];
184
+ }
185
+ /**
186
+ * LED color assigned to one input of a device.
187
+ *
188
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
189
+ * via the `definition` "InputColor".
190
+ */
191
+ export interface InputColor {
192
+ device_id: DeviceID;
193
+ /**
194
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
195
+ */
196
+ input_id: string;
197
+ color: Color;
169
198
  }
170
199
  /**
171
200
  * Portable, on-disk representation of a profile, written by export_profile and read by import_profile. Carries no server-local id: the id is meaningless outside the originating installation, so import always assigns a fresh one. The 'version' field lets readers detect and adapt to format changes.
@@ -190,6 +219,10 @@ export interface ExportedProfile {
190
219
  * Bindings that belong to the exported profile.
191
220
  */
192
221
  bindings: Binding[];
222
+ /**
223
+ * LED colors of the exported profile. Same semantics as Profile.colors.
224
+ */
225
+ colors?: InputColor[];
193
226
  }
194
227
  /**
195
228
  * A single physical input exposed by a device (a key or an encoder).
@@ -207,6 +240,11 @@ export interface Input {
207
240
  * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
208
241
  */
209
242
  label?: string;
243
+ /**
244
+ * Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
245
+ */
246
+ rgb?: boolean;
247
+ color?: Color1;
210
248
  }
211
249
  /**
212
250
  * A HID device known to the daemon. Returned by list_devices.
@@ -303,6 +341,23 @@ export interface PluginLaunchInfo {
303
341
  */
304
342
  protocol_version: "1";
305
343
  }
344
+ /**
345
+ * A plugin installed in the daemon, with the state of its process.
346
+ *
347
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
348
+ * via the `definition` "InstalledPlugin".
349
+ */
350
+ export interface InstalledPlugin {
351
+ manifest: PluginManifest;
352
+ /**
353
+ * State of the plugin process: 'starting' (spawned, hello not received yet), 'running' (connected), 'stopped' (not running, e.g. exited cleanly) or 'error' (failed to start or crashed; see 'error').
354
+ */
355
+ status: "starting" | "running" | "stopped" | "error";
356
+ /**
357
+ * Human-readable reason why the plugin failed. The daemon sets it only when status is 'error' (not enforced by the schema).
358
+ */
359
+ error?: string;
360
+ }
306
361
  /**
307
362
  * Contents of the manifest.json file at the root of a plugin. A plugin is distributed as a '.keyforgeplugin' file: a zip archive with manifest.json at its root (no wrapping folder) plus every file the manifest references. The daemon installs it by extracting the archive into '<config dir>/plugins/<id>/', taking the id from the manifest. All file paths in the manifest (icon, and entrypoint paths containing '/') are relative to the plugin root, use '/' as separator, and must stay inside the plugin root: the daemon rejects '..' segments and any path or archive entry that escapes the root.
308
363
  *
package/src/index.ts CHANGED
@@ -10,14 +10,19 @@ export type { MethodExportProfile } from './methods/export_profile.js';
10
10
  export type { MethodGetAutoSwitch } from './methods/get_auto_switch.js';
11
11
  export type { MethodHello } from './methods/hello.js';
12
12
  export type { MethodImportProfile } from './methods/import_profile.js';
13
+ export type { MethodInspectPlugin } from './methods/inspect_plugin.js';
14
+ export type { MethodInstallPlugin } from './methods/install_plugin.js';
13
15
  export type { MethodListActions } from './methods/list_actions.js';
14
16
  export type { MethodListBindings } from './methods/list_bindings.js';
15
17
  export type { MethodListDevices } from './methods/list_devices.js';
18
+ export type { MethodListPlugins } from './methods/list_plugins.js';
16
19
  export type { MethodListProfiles } from './methods/list_profiles.js';
17
20
  export type { MethodRenameProfile } from './methods/rename_profile.js';
18
21
  export type { MethodSetActiveProfile } from './methods/set_active_profile.js';
19
22
  export type { MethodSetAutoSwitch } from './methods/set_auto_switch.js';
20
23
  export type { MethodSetBinding } from './methods/set_binding.js';
24
+ export type { MethodSetInputColor } from './methods/set_input_color.js';
25
+ export type { MethodUninstallPlugin } from './methods/uninstall_plugin.js';
21
26
 
22
27
  export type { EventActionInvoked } from './events/action_invoked.js';
23
28
  export type { EventActiveProfileChanged } from './events/active_profile_changed.js';
@@ -13,6 +13,10 @@ export type DeviceID = string;
13
13
  * What happened on the input.
14
14
  */
15
15
  export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
16
+ /**
17
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
18
+ */
19
+ export type Color = string;
16
20
 
17
21
  /**
18
22
  * Creates a new profile. The server generates the id and returns the profile with an empty bindings array.
@@ -44,6 +48,10 @@ export interface Profile {
44
48
  * Bindings that belong to this profile.
45
49
  */
46
50
  bindings: Binding[];
51
+ /**
52
+ * LED colors this profile paints on RGB-capable inputs, applied by the daemon whenever the profile becomes active. An RGB input with no entry here is turned off. At most one entry per (device_id, input_id); the daemon enforces uniqueness. Absent means no colors.
53
+ */
54
+ colors?: InputColor[];
47
55
  }
48
56
  /**
49
57
  * Maps an input on a specific device to an action.
@@ -69,3 +77,14 @@ export interface Action {
69
77
  [k: string]: unknown;
70
78
  };
71
79
  }
80
+ /**
81
+ * LED color assigned to one input of a device.
82
+ */
83
+ export interface InputColor {
84
+ device_id: DeviceID;
85
+ /**
86
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
87
+ */
88
+ input_id: string;
89
+ color: Color;
90
+ }
@@ -13,6 +13,10 @@ export type DeviceID = string;
13
13
  * What happened on the input.
14
14
  */
15
15
  export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
16
+ /**
17
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
18
+ */
19
+ export type Color = string;
16
20
 
17
21
  /**
18
22
  * Creates a copy of an existing profile under a new name. The server generates a new id and copies the source profile's bindings. Does not change the active profile.
@@ -48,6 +52,10 @@ export interface Profile {
48
52
  * Bindings that belong to this profile.
49
53
  */
50
54
  bindings: Binding[];
55
+ /**
56
+ * LED colors this profile paints on RGB-capable inputs, applied by the daemon whenever the profile becomes active. An RGB input with no entry here is turned off. At most one entry per (device_id, input_id); the daemon enforces uniqueness. Absent means no colors.
57
+ */
58
+ colors?: InputColor[];
51
59
  }
52
60
  /**
53
61
  * Maps an input on a specific device to an action.
@@ -73,3 +81,14 @@ export interface Action {
73
81
  [k: string]: unknown;
74
82
  };
75
83
  }
84
+ /**
85
+ * LED color assigned to one input of a device.
86
+ */
87
+ export interface InputColor {
88
+ device_id: DeviceID;
89
+ /**
90
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
91
+ */
92
+ input_id: string;
93
+ color: Color;
94
+ }
@@ -13,6 +13,10 @@ export type DeviceID = string;
13
13
  * What happened on the input.
14
14
  */
15
15
  export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
16
+ /**
17
+ * RGB color as a '#RRGGBB' hex string. Accepted in any case; the daemon stores and returns it lowercase, so clients can compare colors as strings. '#000000' turns the LED off. Hardware-agnostic: the daemon translates it to whatever the device understands (e.g. switching the device to a per-key lighting mode first).
18
+ */
19
+ export type Color = string;
16
20
 
17
21
  /**
18
22
  * Reads an ExportedProfile document from 'path' on the daemon host's filesystem, validates it, and creates a new profile from it. The server generates a fresh id; any id in the file is ignored. Does not change the active profile. Returns the created profile.
@@ -44,6 +48,10 @@ export interface Profile {
44
48
  * Bindings that belong to this profile.
45
49
  */
46
50
  bindings: Binding[];
51
+ /**
52
+ * LED colors this profile paints on RGB-capable inputs, applied by the daemon whenever the profile becomes active. An RGB input with no entry here is turned off. At most one entry per (device_id, input_id); the daemon enforces uniqueness. Absent means no colors.
53
+ */
54
+ colors?: InputColor[];
47
55
  }
48
56
  /**
49
57
  * Maps an input on a specific device to an action.
@@ -69,3 +77,14 @@ export interface Action {
69
77
  [k: string]: unknown;
70
78
  };
71
79
  }
80
+ /**
81
+ * LED color assigned to one input of a device.
82
+ */
83
+ export interface InputColor {
84
+ device_id: DeviceID;
85
+ /**
86
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
87
+ */
88
+ input_id: string;
89
+ color: Color;
90
+ }
@@ -0,0 +1,152 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Globally unique reverse-DNS plugin id; install folder name and <plugin_id> in Action.type.
10
+ */
11
+ export type PluginID = string;
12
+ /**
13
+ * Kind of physical input.
14
+ */
15
+ export type InputKind = "key" | "encoder";
16
+
17
+ /**
18
+ * Opens the '.keyforgeplugin' package at 'path' on the daemon host's filesystem and validates it exactly as install_plugin would (including rejecting a package with no entrypoint for the daemon host's OS), without installing or changing anything. Lets a client show a confirmation (name, author, version, actions) before installing.
19
+ */
20
+ export interface MethodInspectPlugin {
21
+ params: {
22
+ /**
23
+ * Filesystem path on the daemon host of the '.keyforgeplugin' package.
24
+ */
25
+ path: string;
26
+ };
27
+ result: {
28
+ manifest: PluginManifest;
29
+ /**
30
+ * Version of the plugin with the same id that is currently installed, if any. Installing the package would replace it.
31
+ */
32
+ installed_version?: string;
33
+ };
34
+ }
35
+ /**
36
+ * Contents of the manifest.json file at the root of a plugin. A plugin is distributed as a '.keyforgeplugin' file: a zip archive with manifest.json at its root (no wrapping folder) plus every file the manifest references. The daemon installs it by extracting the archive into '<config dir>/plugins/<id>/', taking the id from the manifest. All file paths in the manifest (icon, and entrypoint paths containing '/') are relative to the plugin root, use '/' as separator, and must stay inside the plugin root: the daemon rejects '..' segments and any path or archive entry that escapes the root.
37
+ */
38
+ export interface PluginManifest {
39
+ /**
40
+ * Manifest format version. Currently 1; bumped if the manifest shape changes.
41
+ */
42
+ manifest_version: 1;
43
+ id: PluginID;
44
+ /**
45
+ * Human-friendly plugin name for the UI.
46
+ */
47
+ name: string;
48
+ /**
49
+ * Plugin version (SemVer 2.0).
50
+ */
51
+ version: string;
52
+ /**
53
+ * Major version of the protocol the plugin speaks. Lets the daemon reject an incompatible plugin before spawning it. Currently '1'.
54
+ */
55
+ protocol_version: "1";
56
+ /**
57
+ * Plugin author, shown in the UI.
58
+ */
59
+ author?: string;
60
+ /**
61
+ * Short description of what the plugin does.
62
+ */
63
+ description?: string;
64
+ /**
65
+ * URL of the plugin homepage or source repository.
66
+ */
67
+ homepage?: string;
68
+ /**
69
+ * Category the UI groups the plugin's actions under (e.g. 'Audio', 'Streaming').
70
+ */
71
+ category?: string;
72
+ /**
73
+ * Path to the plugin icon, relative to the plugin root. No leading '/', no '\' and no ':'.
74
+ */
75
+ icon?: string;
76
+ /**
77
+ * Command the daemon runs to start the plugin, per OS (keys match Go's GOOS). The plugin supports exactly the OSes listed here.
78
+ */
79
+ entrypoint: {
80
+ darwin?: PluginCommand;
81
+ linux?: PluginCommand;
82
+ windows?: PluginCommand;
83
+ };
84
+ /**
85
+ * Actions the plugin exposes. Each becomes bindable as 'plugin.<id>.<action id>'.
86
+ *
87
+ * @minItems 1
88
+ */
89
+ actions: [PluginAction, ...PluginAction[]];
90
+ }
91
+ /**
92
+ * Executable plus arguments used to start a plugin process.
93
+ */
94
+ export interface PluginCommand {
95
+ /**
96
+ * Executable to run. A path containing '/' is resolved relative to the plugin root; a bare name (e.g. 'node') is looked up on the PATH. Always use '/' as separator, also on Windows; absolute paths, '\' and ':' are not allowed.
97
+ */
98
+ path: string;
99
+ /**
100
+ * Arguments passed to the executable.
101
+ */
102
+ args?: string[];
103
+ }
104
+ /**
105
+ * An action a plugin exposes, declared in its manifest.
106
+ */
107
+ export interface PluginAction {
108
+ /**
109
+ * Action identifier, unique within the plugin. snake_case, no dots.
110
+ */
111
+ id: string;
112
+ /**
113
+ * Human-friendly action name for the UI.
114
+ */
115
+ name: string;
116
+ /**
117
+ * Optional longer description of what the action does.
118
+ */
119
+ description?: string;
120
+ /**
121
+ * Input kinds the action can be bound to. Omitted means any kind.
122
+ *
123
+ * @minItems 1
124
+ */
125
+ inputs?: [InputKind, ...InputKind[]];
126
+ /**
127
+ * Params this action accepts, in display order.
128
+ */
129
+ params: ParamSpec[];
130
+ }
131
+ /**
132
+ * Describes one action parameter so a client can render an input for it.
133
+ */
134
+ export interface ParamSpec {
135
+ /**
136
+ * Param key written into Action.params. Unique within the action.
137
+ */
138
+ name: string;
139
+ /**
140
+ * Human-friendly field label.
141
+ */
142
+ label: string;
143
+ /**
144
+ * Param value type. Only 'string' in v1.
145
+ */
146
+ type: "string";
147
+ required: boolean;
148
+ /**
149
+ * Optional placeholder/example shown in the input.
150
+ */
151
+ placeholder?: string;
152
+ }