@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,166 @@
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
+ * Installs the '.keyforgeplugin' package at 'path' on the daemon host's filesystem: validates it, extracts it into '<config dir>/plugins/<id>/' and starts the plugin. A package with no entrypoint for the daemon host's OS is rejected with an error and nothing is installed. The response is sent right after spawning, so the returned status is normally 'starting'; clients refresh with list_plugins. If a plugin with the same id is already installed, it is replaced (upgrade): the old process is stopped and its folder swapped atomically. Bindings are never modified, so existing bindings to the plugin's actions keep working after an upgrade.
19
+ */
20
+ export interface MethodInstallPlugin {
21
+ params: {
22
+ /**
23
+ * Filesystem path on the daemon host of the '.keyforgeplugin' package.
24
+ */
25
+ path: string;
26
+ };
27
+ result: {
28
+ plugin: InstalledPlugin;
29
+ /**
30
+ * Version that was replaced, present only when the install was an upgrade.
31
+ */
32
+ previous_version?: string;
33
+ };
34
+ }
35
+ /**
36
+ * A plugin installed in the daemon, with the state of its process.
37
+ */
38
+ export interface InstalledPlugin {
39
+ manifest: PluginManifest;
40
+ /**
41
+ * 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').
42
+ */
43
+ status: "starting" | "running" | "stopped" | "error";
44
+ /**
45
+ * Human-readable reason why the plugin failed. The daemon sets it only when status is 'error' (not enforced by the schema).
46
+ */
47
+ error?: string;
48
+ }
49
+ /**
50
+ * 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.
51
+ */
52
+ export interface PluginManifest {
53
+ /**
54
+ * Manifest format version. Currently 1; bumped if the manifest shape changes.
55
+ */
56
+ manifest_version: 1;
57
+ id: PluginID;
58
+ /**
59
+ * Human-friendly plugin name for the UI.
60
+ */
61
+ name: string;
62
+ /**
63
+ * Plugin version (SemVer 2.0).
64
+ */
65
+ version: string;
66
+ /**
67
+ * Major version of the protocol the plugin speaks. Lets the daemon reject an incompatible plugin before spawning it. Currently '1'.
68
+ */
69
+ protocol_version: "1";
70
+ /**
71
+ * Plugin author, shown in the UI.
72
+ */
73
+ author?: string;
74
+ /**
75
+ * Short description of what the plugin does.
76
+ */
77
+ description?: string;
78
+ /**
79
+ * URL of the plugin homepage or source repository.
80
+ */
81
+ homepage?: string;
82
+ /**
83
+ * Category the UI groups the plugin's actions under (e.g. 'Audio', 'Streaming').
84
+ */
85
+ category?: string;
86
+ /**
87
+ * Path to the plugin icon, relative to the plugin root. No leading '/', no '\' and no ':'.
88
+ */
89
+ icon?: string;
90
+ /**
91
+ * Command the daemon runs to start the plugin, per OS (keys match Go's GOOS). The plugin supports exactly the OSes listed here.
92
+ */
93
+ entrypoint: {
94
+ darwin?: PluginCommand;
95
+ linux?: PluginCommand;
96
+ windows?: PluginCommand;
97
+ };
98
+ /**
99
+ * Actions the plugin exposes. Each becomes bindable as 'plugin.<id>.<action id>'.
100
+ *
101
+ * @minItems 1
102
+ */
103
+ actions: [PluginAction, ...PluginAction[]];
104
+ }
105
+ /**
106
+ * Executable plus arguments used to start a plugin process.
107
+ */
108
+ export interface PluginCommand {
109
+ /**
110
+ * 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.
111
+ */
112
+ path: string;
113
+ /**
114
+ * Arguments passed to the executable.
115
+ */
116
+ args?: string[];
117
+ }
118
+ /**
119
+ * An action a plugin exposes, declared in its manifest.
120
+ */
121
+ export interface PluginAction {
122
+ /**
123
+ * Action identifier, unique within the plugin. snake_case, no dots.
124
+ */
125
+ id: string;
126
+ /**
127
+ * Human-friendly action name for the UI.
128
+ */
129
+ name: string;
130
+ /**
131
+ * Optional longer description of what the action does.
132
+ */
133
+ description?: string;
134
+ /**
135
+ * Input kinds the action can be bound to. Omitted means any kind.
136
+ *
137
+ * @minItems 1
138
+ */
139
+ inputs?: [InputKind, ...InputKind[]];
140
+ /**
141
+ * Params this action accepts, in display order.
142
+ */
143
+ params: ParamSpec[];
144
+ }
145
+ /**
146
+ * Describes one action parameter so a client can render an input for it.
147
+ */
148
+ export interface ParamSpec {
149
+ /**
150
+ * Param key written into Action.params. Unique within the action.
151
+ */
152
+ name: string;
153
+ /**
154
+ * Human-friendly field label.
155
+ */
156
+ label: string;
157
+ /**
158
+ * Param value type. Only 'string' in v1.
159
+ */
160
+ type: "string";
161
+ required: boolean;
162
+ /**
163
+ * Optional placeholder/example shown in the input.
164
+ */
165
+ placeholder?: string;
166
+ }
@@ -13,6 +13,10 @@ export type DeviceID = string;
13
13
  * Kind of physical input.
14
14
  */
15
15
  export type InputKind = "key" | "encoder";
16
+ /**
17
+ * Color the active profile paints on this input. Only set on RGB inputs that have a color in the active profile; absent means the LED is off.
18
+ */
19
+ export type Color = string;
16
20
 
17
21
  /**
18
22
  * Returns the HID devices currently known to the daemon. No filters in v1; clients filter client-side if needed.
@@ -76,4 +80,9 @@ export interface Input {
76
80
  * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
77
81
  */
78
82
  label?: string;
83
+ /**
84
+ * Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
85
+ */
86
+ rgb?: boolean;
87
+ color?: Color;
79
88
  }
@@ -0,0 +1,163 @@
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
+ * Returns every installed plugin with the state of its process. No params in v1.
19
+ */
20
+ export interface MethodListPlugins {
21
+ /**
22
+ * No parameters in v1.
23
+ */
24
+ params: {};
25
+ result: {
26
+ /**
27
+ * Installed plugins.
28
+ */
29
+ plugins: InstalledPlugin[];
30
+ };
31
+ }
32
+ /**
33
+ * A plugin installed in the daemon, with the state of its process.
34
+ */
35
+ export interface InstalledPlugin {
36
+ manifest: PluginManifest;
37
+ /**
38
+ * 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').
39
+ */
40
+ status: "starting" | "running" | "stopped" | "error";
41
+ /**
42
+ * Human-readable reason why the plugin failed. The daemon sets it only when status is 'error' (not enforced by the schema).
43
+ */
44
+ error?: string;
45
+ }
46
+ /**
47
+ * 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.
48
+ */
49
+ export interface PluginManifest {
50
+ /**
51
+ * Manifest format version. Currently 1; bumped if the manifest shape changes.
52
+ */
53
+ manifest_version: 1;
54
+ id: PluginID;
55
+ /**
56
+ * Human-friendly plugin name for the UI.
57
+ */
58
+ name: string;
59
+ /**
60
+ * Plugin version (SemVer 2.0).
61
+ */
62
+ version: string;
63
+ /**
64
+ * Major version of the protocol the plugin speaks. Lets the daemon reject an incompatible plugin before spawning it. Currently '1'.
65
+ */
66
+ protocol_version: "1";
67
+ /**
68
+ * Plugin author, shown in the UI.
69
+ */
70
+ author?: string;
71
+ /**
72
+ * Short description of what the plugin does.
73
+ */
74
+ description?: string;
75
+ /**
76
+ * URL of the plugin homepage or source repository.
77
+ */
78
+ homepage?: string;
79
+ /**
80
+ * Category the UI groups the plugin's actions under (e.g. 'Audio', 'Streaming').
81
+ */
82
+ category?: string;
83
+ /**
84
+ * Path to the plugin icon, relative to the plugin root. No leading '/', no '\' and no ':'.
85
+ */
86
+ icon?: string;
87
+ /**
88
+ * Command the daemon runs to start the plugin, per OS (keys match Go's GOOS). The plugin supports exactly the OSes listed here.
89
+ */
90
+ entrypoint: {
91
+ darwin?: PluginCommand;
92
+ linux?: PluginCommand;
93
+ windows?: PluginCommand;
94
+ };
95
+ /**
96
+ * Actions the plugin exposes. Each becomes bindable as 'plugin.<id>.<action id>'.
97
+ *
98
+ * @minItems 1
99
+ */
100
+ actions: [PluginAction, ...PluginAction[]];
101
+ }
102
+ /**
103
+ * Executable plus arguments used to start a plugin process.
104
+ */
105
+ export interface PluginCommand {
106
+ /**
107
+ * 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.
108
+ */
109
+ path: string;
110
+ /**
111
+ * Arguments passed to the executable.
112
+ */
113
+ args?: string[];
114
+ }
115
+ /**
116
+ * An action a plugin exposes, declared in its manifest.
117
+ */
118
+ export interface PluginAction {
119
+ /**
120
+ * Action identifier, unique within the plugin. snake_case, no dots.
121
+ */
122
+ id: string;
123
+ /**
124
+ * Human-friendly action name for the UI.
125
+ */
126
+ name: string;
127
+ /**
128
+ * Optional longer description of what the action does.
129
+ */
130
+ description?: string;
131
+ /**
132
+ * Input kinds the action can be bound to. Omitted means any kind.
133
+ *
134
+ * @minItems 1
135
+ */
136
+ inputs?: [InputKind, ...InputKind[]];
137
+ /**
138
+ * Params this action accepts, in display order.
139
+ */
140
+ params: ParamSpec[];
141
+ }
142
+ /**
143
+ * Describes one action parameter so a client can render an input for it.
144
+ */
145
+ export interface ParamSpec {
146
+ /**
147
+ * Param key written into Action.params. Unique within the action.
148
+ */
149
+ name: string;
150
+ /**
151
+ * Human-friendly field label.
152
+ */
153
+ label: string;
154
+ /**
155
+ * Param value type. Only 'string' in v1.
156
+ */
157
+ type: "string";
158
+ required: boolean;
159
+ /**
160
+ * Optional placeholder/example shown in the input.
161
+ */
162
+ placeholder?: string;
163
+ }
@@ -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
  * 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.
@@ -49,6 +53,10 @@ export interface Profile {
49
53
  * Bindings that belong to this profile.
50
54
  */
51
55
  bindings: Binding[];
56
+ /**
57
+ * 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.
58
+ */
59
+ colors?: InputColor[];
52
60
  }
53
61
  /**
54
62
  * Maps an input on a specific device to an action.
@@ -74,3 +82,14 @@ export interface Action {
74
82
  [k: string]: unknown;
75
83
  };
76
84
  }
85
+ /**
86
+ * LED color assigned to one input of a device.
87
+ */
88
+ export interface InputColor {
89
+ device_id: DeviceID;
90
+ /**
91
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
92
+ */
93
+ input_id: string;
94
+ color: Color;
95
+ }
@@ -0,0 +1,33 @@
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
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
10
+ */
11
+ export type DeviceID = string;
12
+ /**
13
+ * 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).
14
+ */
15
+ export type Color = string;
16
+
17
+ /**
18
+ * 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).
19
+ */
20
+ export interface MethodSetInputColor {
21
+ params: {
22
+ device_id: DeviceID;
23
+ /**
24
+ * Logical identifier of the input within the device. Matches Device.inputs[].id.
25
+ */
26
+ input_id: string;
27
+ color: Color;
28
+ };
29
+ /**
30
+ * Empty acknowledgement object.
31
+ */
32
+ result: {};
33
+ }
@@ -0,0 +1,24 @@
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
+ * Id of the plugin to uninstall.
10
+ */
11
+ export type PluginID = string;
12
+
13
+ /**
14
+ * 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.
15
+ */
16
+ export interface MethodUninstallPlugin {
17
+ params: {
18
+ id: PluginID;
19
+ };
20
+ /**
21
+ * Empty acknowledgement object. Reserved for future fields without breaking the schema.
22
+ */
23
+ result: {};
24
+ }