@jdg-keyforge/protocol 0.11.0 → 0.12.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.
- package/dist/common.d.ts +39 -1
- package/dist/index.d.ts +1 -0
- package/dist/methods/create_profile.d.ts +19 -0
- package/dist/methods/delete_profile.d.ts +1 -1
- package/dist/methods/duplicate_profile.d.ts +19 -0
- package/dist/methods/get_auto_switch.d.ts +1 -1
- package/dist/methods/import_profile.d.ts +19 -0
- package/dist/methods/list_devices.d.ts +9 -0
- package/dist/methods/list_profiles.d.ts +19 -0
- package/dist/methods/set_auto_switch.d.ts +2 -2
- package/dist/methods/set_input_color.d.ts +30 -0
- package/dist/methods/set_input_color.js +7 -0
- package/package.json +1 -1
- package/src/common.ts +39 -1
- package/src/index.ts +1 -0
- package/src/methods/create_profile.ts +19 -0
- package/src/methods/delete_profile.ts +1 -1
- package/src/methods/duplicate_profile.ts +19 -0
- package/src/methods/get_auto_switch.ts +1 -1
- package/src/methods/import_profile.ts +19 -0
- package/src/methods/list_devices.ts +9 -0
- package/src/methods/list_profiles.ts +19 -0
- package/src/methods/set_auto_switch.ts +2 -2
- package/src/methods/set_input_color.ts +33 -0
package/dist/common.d.ts
CHANGED
|
@@ -24,6 +24,17 @@ export type InputKind = "key" | "encoder";
|
|
|
24
24
|
* via the `definition` "InputAction".
|
|
25
25
|
*/
|
|
26
26
|
export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
|
|
27
|
+
/**
|
|
28
|
+
* 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).
|
|
29
|
+
*
|
|
30
|
+
* This interface was referenced by `CommonTypes`'s JSON-Schema
|
|
31
|
+
* via the `definition` "Color".
|
|
32
|
+
*/
|
|
33
|
+
export type Color = string;
|
|
34
|
+
/**
|
|
35
|
+
* 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).
|
|
36
|
+
*/
|
|
37
|
+
export type Color1 = string;
|
|
27
38
|
/**
|
|
28
39
|
* 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.
|
|
29
40
|
*
|
|
@@ -163,6 +174,24 @@ export interface Profile {
|
|
|
163
174
|
* Bindings that belong to this profile.
|
|
164
175
|
*/
|
|
165
176
|
bindings: Binding[];
|
|
177
|
+
/**
|
|
178
|
+
* 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.
|
|
179
|
+
*/
|
|
180
|
+
colors?: InputColor[];
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* LED color assigned to one input of a device.
|
|
184
|
+
*
|
|
185
|
+
* This interface was referenced by `CommonTypes`'s JSON-Schema
|
|
186
|
+
* via the `definition` "InputColor".
|
|
187
|
+
*/
|
|
188
|
+
export interface InputColor {
|
|
189
|
+
device_id: DeviceID;
|
|
190
|
+
/**
|
|
191
|
+
* Logical identifier of the input within the device. Matches Device.inputs[].id.
|
|
192
|
+
*/
|
|
193
|
+
input_id: string;
|
|
194
|
+
color: Color;
|
|
166
195
|
}
|
|
167
196
|
/**
|
|
168
197
|
* 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.
|
|
@@ -187,6 +216,10 @@ export interface ExportedProfile {
|
|
|
187
216
|
* Bindings that belong to the exported profile.
|
|
188
217
|
*/
|
|
189
218
|
bindings: Binding[];
|
|
219
|
+
/**
|
|
220
|
+
* LED colors of the exported profile. Same semantics as Profile.colors.
|
|
221
|
+
*/
|
|
222
|
+
colors?: InputColor[];
|
|
190
223
|
}
|
|
191
224
|
/**
|
|
192
225
|
* A single physical input exposed by a device (a key or an encoder).
|
|
@@ -204,6 +237,11 @@ export interface Input {
|
|
|
204
237
|
* Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
|
|
205
238
|
*/
|
|
206
239
|
label?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
|
|
242
|
+
*/
|
|
243
|
+
rgb?: boolean;
|
|
244
|
+
color?: Color1;
|
|
207
245
|
}
|
|
208
246
|
/**
|
|
209
247
|
* A HID device known to the daemon. Returned by list_devices.
|
|
@@ -254,7 +292,7 @@ export interface AutoSwitchRule {
|
|
|
254
292
|
*/
|
|
255
293
|
app: string;
|
|
256
294
|
/**
|
|
257
|
-
* Identifier of the profile to activate when this app is frontmost.
|
|
295
|
+
* Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
|
|
258
296
|
*/
|
|
259
297
|
profile_id: string;
|
|
260
298
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { MethodRenameProfile } from './methods/rename_profile.js';
|
|
|
18
18
|
export type { MethodSetActiveProfile } from './methods/set_active_profile.js';
|
|
19
19
|
export type { MethodSetAutoSwitch } from './methods/set_auto_switch.js';
|
|
20
20
|
export type { MethodSetBinding } from './methods/set_binding.js';
|
|
21
|
+
export type { MethodSetInputColor } from './methods/set_input_color.js';
|
|
21
22
|
export type { MethodUninstallPlugin } from './methods/uninstall_plugin.js';
|
|
22
23
|
export type { EventActionInvoked } from './events/action_invoked.js';
|
|
23
24
|
export type { EventActiveProfileChanged } from './events/active_profile_changed.js';
|
|
@@ -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
|
* Creates a new profile. The server generates the id and returns the profile with an empty bindings array.
|
|
16
20
|
*/
|
|
@@ -41,6 +45,10 @@ export interface Profile {
|
|
|
41
45
|
* Bindings that belong to this profile.
|
|
42
46
|
*/
|
|
43
47
|
bindings: Binding[];
|
|
48
|
+
/**
|
|
49
|
+
* 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.
|
|
50
|
+
*/
|
|
51
|
+
colors?: InputColor[];
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
54
|
* Maps an input on a specific device to an action.
|
|
@@ -66,3 +74,14 @@ export interface Action {
|
|
|
66
74
|
[k: string]: unknown;
|
|
67
75
|
};
|
|
68
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* LED color assigned to one input of a device.
|
|
79
|
+
*/
|
|
80
|
+
export interface InputColor {
|
|
81
|
+
device_id: DeviceID;
|
|
82
|
+
/**
|
|
83
|
+
* Logical identifier of the input within the device. Matches Device.inputs[].id.
|
|
84
|
+
*/
|
|
85
|
+
input_id: string;
|
|
86
|
+
color: Color;
|
|
87
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and run json-schema-to-typescript to regenerate this file.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned.
|
|
7
|
+
* Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned. Auto-switch rules whose profile_id points to the deleted profile are deleted with it, so the stored rule set never references a missing profile.
|
|
8
8
|
*/
|
|
9
9
|
export interface MethodDeleteProfile {
|
|
10
10
|
params: {
|
|
@@ -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
|
* 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.
|
|
16
20
|
*/
|
|
@@ -45,6 +49,10 @@ export interface Profile {
|
|
|
45
49
|
* Bindings that belong to this profile.
|
|
46
50
|
*/
|
|
47
51
|
bindings: Binding[];
|
|
52
|
+
/**
|
|
53
|
+
* 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.
|
|
54
|
+
*/
|
|
55
|
+
colors?: InputColor[];
|
|
48
56
|
}
|
|
49
57
|
/**
|
|
50
58
|
* Maps an input on a specific device to an action.
|
|
@@ -70,3 +78,14 @@ export interface Action {
|
|
|
70
78
|
[k: string]: unknown;
|
|
71
79
|
};
|
|
72
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* LED color assigned to one input of a device.
|
|
83
|
+
*/
|
|
84
|
+
export interface InputColor {
|
|
85
|
+
device_id: DeviceID;
|
|
86
|
+
/**
|
|
87
|
+
* Logical identifier of the input within the device. Matches Device.inputs[].id.
|
|
88
|
+
*/
|
|
89
|
+
input_id: string;
|
|
90
|
+
color: Color;
|
|
91
|
+
}
|
|
@@ -31,7 +31,7 @@ export interface AutoSwitchRule {
|
|
|
31
31
|
*/
|
|
32
32
|
app: string;
|
|
33
33
|
/**
|
|
34
|
-
* Identifier of the profile to activate when this app is frontmost.
|
|
34
|
+
* Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
|
|
35
35
|
*/
|
|
36
36
|
profile_id: string;
|
|
37
37
|
}
|
|
@@ -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
|
* 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.
|
|
16
20
|
*/
|
|
@@ -41,6 +45,10 @@ export interface Profile {
|
|
|
41
45
|
* Bindings that belong to this profile.
|
|
42
46
|
*/
|
|
43
47
|
bindings: Binding[];
|
|
48
|
+
/**
|
|
49
|
+
* 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.
|
|
50
|
+
*/
|
|
51
|
+
colors?: InputColor[];
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
54
|
* Maps an input on a specific device to an action.
|
|
@@ -66,3 +74,14 @@ export interface Action {
|
|
|
66
74
|
[k: string]: unknown;
|
|
67
75
|
};
|
|
68
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* LED color assigned to one input of a device.
|
|
79
|
+
*/
|
|
80
|
+
export interface InputColor {
|
|
81
|
+
device_id: DeviceID;
|
|
82
|
+
/**
|
|
83
|
+
* Logical identifier of the input within the device. Matches Device.inputs[].id.
|
|
84
|
+
*/
|
|
85
|
+
input_id: string;
|
|
86
|
+
color: Color;
|
|
87
|
+
}
|
|
@@ -11,6 +11,10 @@ export type DeviceID = string;
|
|
|
11
11
|
* Kind of physical input.
|
|
12
12
|
*/
|
|
13
13
|
export type InputKind = "key" | "encoder";
|
|
14
|
+
/**
|
|
15
|
+
* 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.
|
|
16
|
+
*/
|
|
17
|
+
export type Color = string;
|
|
14
18
|
/**
|
|
15
19
|
* Returns the HID devices currently known to the daemon. No filters in v1; clients filter client-side if needed.
|
|
16
20
|
*/
|
|
@@ -73,4 +77,9 @@ export interface Input {
|
|
|
73
77
|
* Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
|
|
74
78
|
*/
|
|
75
79
|
label?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the input has an RGB LED the daemon can drive through set_input_color. Absent means false.
|
|
82
|
+
*/
|
|
83
|
+
rgb?: boolean;
|
|
84
|
+
color?: Color;
|
|
76
85
|
}
|
|
@@ -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
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and run json-schema-to-typescript to regenerate this file.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state.
|
|
7
|
+
* Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state. The daemon rejects the whole request with error code PROFILE_NOT_FOUND if any rule's profile_id does not exist; nothing is persisted in that case.
|
|
8
8
|
*/
|
|
9
9
|
export interface MethodSetAutoSwitch {
|
|
10
10
|
params: {
|
|
@@ -37,7 +37,7 @@ export interface AutoSwitchRule {
|
|
|
37
37
|
*/
|
|
38
38
|
app: string;
|
|
39
39
|
/**
|
|
40
|
-
* Identifier of the profile to activate when this app is frontmost.
|
|
40
|
+
* Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
|
|
41
41
|
*/
|
|
42
42
|
profile_id: string;
|
|
43
43
|
}
|
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jdg-keyforge/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
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.
|
|
@@ -257,7 +295,7 @@ export interface AutoSwitchRule {
|
|
|
257
295
|
*/
|
|
258
296
|
app: string;
|
|
259
297
|
/**
|
|
260
|
-
* Identifier of the profile to activate when this app is frontmost.
|
|
298
|
+
* Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
|
|
261
299
|
*/
|
|
262
300
|
profile_id: string;
|
|
263
301
|
}
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type { MethodRenameProfile } from './methods/rename_profile.js';
|
|
|
21
21
|
export type { MethodSetActiveProfile } from './methods/set_active_profile.js';
|
|
22
22
|
export type { MethodSetAutoSwitch } from './methods/set_auto_switch.js';
|
|
23
23
|
export type { MethodSetBinding } from './methods/set_binding.js';
|
|
24
|
+
export type { MethodSetInputColor } from './methods/set_input_color.js';
|
|
24
25
|
export type { MethodUninstallPlugin } from './methods/uninstall_plugin.js';
|
|
25
26
|
|
|
26
27
|
export type { EventActionInvoked } from './events/action_invoked.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
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned.
|
|
9
|
+
* Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned. Auto-switch rules whose profile_id points to the deleted profile are deleted with it, so the stored rule set never references a missing profile.
|
|
10
10
|
*/
|
|
11
11
|
export interface MethodDeleteProfile {
|
|
12
12
|
params: {
|
|
@@ -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
|
+
}
|
|
@@ -33,7 +33,7 @@ export interface AutoSwitchRule {
|
|
|
33
33
|
*/
|
|
34
34
|
app: string;
|
|
35
35
|
/**
|
|
36
|
-
* Identifier of the profile to activate when this app is frontmost.
|
|
36
|
+
* Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
|
|
37
37
|
*/
|
|
38
38
|
profile_id: string;
|
|
39
39
|
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
}
|
|
@@ -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
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state.
|
|
9
|
+
* Replaces the entire auto-switch configuration in one shot (bulk set, not per-rule CRUD): the master toggle and the full rule set. The result echoes the persisted state. The daemon rejects the whole request with error code PROFILE_NOT_FOUND if any rule's profile_id does not exist; nothing is persisted in that case.
|
|
10
10
|
*/
|
|
11
11
|
export interface MethodSetAutoSwitch {
|
|
12
12
|
params: {
|
|
@@ -39,7 +39,7 @@ export interface AutoSwitchRule {
|
|
|
39
39
|
*/
|
|
40
40
|
app: string;
|
|
41
41
|
/**
|
|
42
|
-
* Identifier of the profile to activate when this app is frontmost.
|
|
42
|
+
* Identifier of the profile to activate when this app is frontmost. Must reference an existing profile: set_auto_switch rejects unknown ids with PROFILE_NOT_FOUND, and delete_profile removes the rules pointing to the deleted profile.
|
|
43
43
|
*/
|
|
44
44
|
profile_id: string;
|
|
45
45
|
}
|
|
@@ -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
|
+
}
|