@jdg-keyforge/protocol 0.8.0 → 0.9.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.
package/dist/common.d.ts CHANGED
@@ -57,7 +57,7 @@ export interface InputEvent {
57
57
  */
58
58
  export interface Action {
59
59
  /**
60
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
60
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
61
61
  */
62
62
  type: string;
63
63
  /**
@@ -243,3 +243,136 @@ export interface AutoSwitchRule {
243
243
  */
244
244
  profile_id: string;
245
245
  }
246
+ /**
247
+ * Describes one action parameter so a client can render an input for it.
248
+ *
249
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
250
+ * via the `definition` "ParamSpec".
251
+ */
252
+ export interface ParamSpec {
253
+ /**
254
+ * Param key written into Action.params. Unique within the action.
255
+ */
256
+ name: string;
257
+ /**
258
+ * Human-friendly field label.
259
+ */
260
+ label: string;
261
+ /**
262
+ * Param value type. Only 'string' in v1.
263
+ */
264
+ type: "string";
265
+ required: boolean;
266
+ /**
267
+ * Optional placeholder/example shown in the input.
268
+ */
269
+ placeholder?: string;
270
+ }
271
+ /**
272
+ * 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.
273
+ *
274
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
275
+ * via the `definition` "PluginManifest".
276
+ */
277
+ export interface PluginManifest {
278
+ /**
279
+ * Manifest format version. Currently 1; bumped if the manifest shape changes.
280
+ */
281
+ manifest_version: 1;
282
+ /**
283
+ * 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.
284
+ */
285
+ id: string;
286
+ /**
287
+ * Human-friendly plugin name for the UI.
288
+ */
289
+ name: string;
290
+ /**
291
+ * Plugin version (SemVer 2.0).
292
+ */
293
+ version: string;
294
+ /**
295
+ * Major version of the protocol the plugin speaks. Lets the daemon reject an incompatible plugin before spawning it. Currently '1'.
296
+ */
297
+ protocol_version: "1";
298
+ /**
299
+ * Plugin author, shown in the UI.
300
+ */
301
+ author?: string;
302
+ /**
303
+ * Short description of what the plugin does.
304
+ */
305
+ description?: string;
306
+ /**
307
+ * URL of the plugin homepage or source repository.
308
+ */
309
+ homepage?: string;
310
+ /**
311
+ * Category the UI groups the plugin's actions under (e.g. 'Audio', 'Streaming').
312
+ */
313
+ category?: string;
314
+ /**
315
+ * Path to the plugin icon, relative to the plugin root. No leading '/', no '\' and no ':'.
316
+ */
317
+ icon?: string;
318
+ /**
319
+ * Command the daemon runs to start the plugin, per OS (keys match Go's GOOS). The plugin supports exactly the OSes listed here.
320
+ */
321
+ entrypoint: {
322
+ darwin?: PluginCommand;
323
+ linux?: PluginCommand;
324
+ windows?: PluginCommand;
325
+ };
326
+ /**
327
+ * Actions the plugin exposes. Each becomes bindable as 'plugin.<id>.<action id>'.
328
+ *
329
+ * @minItems 1
330
+ */
331
+ actions: [PluginAction, ...PluginAction[]];
332
+ }
333
+ /**
334
+ * Executable plus arguments used to start a plugin process.
335
+ *
336
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
337
+ * via the `definition` "PluginCommand".
338
+ */
339
+ export interface PluginCommand {
340
+ /**
341
+ * 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.
342
+ */
343
+ path: string;
344
+ /**
345
+ * Arguments passed to the executable.
346
+ */
347
+ args?: string[];
348
+ }
349
+ /**
350
+ * An action a plugin exposes, declared in its manifest.
351
+ *
352
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
353
+ * via the `definition` "PluginAction".
354
+ */
355
+ export interface PluginAction {
356
+ /**
357
+ * Action identifier, unique within the plugin. snake_case, no dots.
358
+ */
359
+ id: string;
360
+ /**
361
+ * Human-friendly action name for the UI.
362
+ */
363
+ name: string;
364
+ /**
365
+ * Optional longer description of what the action does.
366
+ */
367
+ description?: string;
368
+ /**
369
+ * Input kinds the action can be bound to. Omitted means any kind.
370
+ *
371
+ * @minItems 1
372
+ */
373
+ inputs?: [InputKind, ...InputKind[]];
374
+ /**
375
+ * Params this action accepts, in display order.
376
+ */
377
+ params: ParamSpec[];
378
+ }
@@ -56,7 +56,7 @@ export interface Binding {
56
56
  */
57
57
  export interface Action {
58
58
  /**
59
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
59
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
60
60
  */
61
61
  type: string;
62
62
  /**
@@ -60,7 +60,7 @@ export interface Binding {
60
60
  */
61
61
  export interface Action {
62
62
  /**
63
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
63
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
64
64
  */
65
65
  type: string;
66
66
  /**
@@ -56,7 +56,7 @@ export interface Binding {
56
56
  */
57
57
  export interface Action {
58
58
  /**
59
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
59
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
60
60
  */
61
61
  type: string;
62
62
  /**
@@ -44,13 +44,10 @@ export interface ActionDescriptor {
44
44
  }
45
45
  /**
46
46
  * Describes one action parameter so a client can render an input for it.
47
- *
48
- * This interface was referenced by `MethodListActions`'s JSON-Schema
49
- * via the `definition` "ParamSpec".
50
47
  */
51
48
  export interface ParamSpec {
52
49
  /**
53
- * Param key written into Action.params.
50
+ * Param key written into Action.params. Unique within the action.
54
51
  */
55
52
  name: string;
56
53
  /**
@@ -40,7 +40,7 @@ export interface Binding {
40
40
  */
41
41
  export interface Action {
42
42
  /**
43
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
43
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
44
44
  */
45
45
  type: string;
46
46
  /**
@@ -61,7 +61,7 @@ export interface Binding {
61
61
  */
62
62
  export interface Action {
63
63
  /**
64
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
64
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
65
65
  */
66
66
  type: string;
67
67
  /**
@@ -37,7 +37,7 @@ export interface Binding {
37
37
  */
38
38
  export interface Action {
39
39
  /**
40
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
40
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
41
41
  */
42
42
  type: string;
43
43
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jdg-keyforge/protocol",
3
- "version": "0.8.0",
3
+ "version": "0.9.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
@@ -60,7 +60,7 @@ export interface InputEvent {
60
60
  */
61
61
  export interface Action {
62
62
  /**
63
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
63
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
64
64
  */
65
65
  type: string;
66
66
  /**
@@ -246,3 +246,136 @@ export interface AutoSwitchRule {
246
246
  */
247
247
  profile_id: string;
248
248
  }
249
+ /**
250
+ * Describes one action parameter so a client can render an input for it.
251
+ *
252
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
253
+ * via the `definition` "ParamSpec".
254
+ */
255
+ export interface ParamSpec {
256
+ /**
257
+ * Param key written into Action.params. Unique within the action.
258
+ */
259
+ name: string;
260
+ /**
261
+ * Human-friendly field label.
262
+ */
263
+ label: string;
264
+ /**
265
+ * Param value type. Only 'string' in v1.
266
+ */
267
+ type: "string";
268
+ required: boolean;
269
+ /**
270
+ * Optional placeholder/example shown in the input.
271
+ */
272
+ placeholder?: string;
273
+ }
274
+ /**
275
+ * 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.
276
+ *
277
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
278
+ * via the `definition` "PluginManifest".
279
+ */
280
+ export interface PluginManifest {
281
+ /**
282
+ * Manifest format version. Currently 1; bumped if the manifest shape changes.
283
+ */
284
+ manifest_version: 1;
285
+ /**
286
+ * 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.
287
+ */
288
+ id: string;
289
+ /**
290
+ * Human-friendly plugin name for the UI.
291
+ */
292
+ name: string;
293
+ /**
294
+ * Plugin version (SemVer 2.0).
295
+ */
296
+ version: string;
297
+ /**
298
+ * Major version of the protocol the plugin speaks. Lets the daemon reject an incompatible plugin before spawning it. Currently '1'.
299
+ */
300
+ protocol_version: "1";
301
+ /**
302
+ * Plugin author, shown in the UI.
303
+ */
304
+ author?: string;
305
+ /**
306
+ * Short description of what the plugin does.
307
+ */
308
+ description?: string;
309
+ /**
310
+ * URL of the plugin homepage or source repository.
311
+ */
312
+ homepage?: string;
313
+ /**
314
+ * Category the UI groups the plugin's actions under (e.g. 'Audio', 'Streaming').
315
+ */
316
+ category?: string;
317
+ /**
318
+ * Path to the plugin icon, relative to the plugin root. No leading '/', no '\' and no ':'.
319
+ */
320
+ icon?: string;
321
+ /**
322
+ * Command the daemon runs to start the plugin, per OS (keys match Go's GOOS). The plugin supports exactly the OSes listed here.
323
+ */
324
+ entrypoint: {
325
+ darwin?: PluginCommand;
326
+ linux?: PluginCommand;
327
+ windows?: PluginCommand;
328
+ };
329
+ /**
330
+ * Actions the plugin exposes. Each becomes bindable as 'plugin.<id>.<action id>'.
331
+ *
332
+ * @minItems 1
333
+ */
334
+ actions: [PluginAction, ...PluginAction[]];
335
+ }
336
+ /**
337
+ * Executable plus arguments used to start a plugin process.
338
+ *
339
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
340
+ * via the `definition` "PluginCommand".
341
+ */
342
+ export interface PluginCommand {
343
+ /**
344
+ * 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.
345
+ */
346
+ path: string;
347
+ /**
348
+ * Arguments passed to the executable.
349
+ */
350
+ args?: string[];
351
+ }
352
+ /**
353
+ * An action a plugin exposes, declared in its manifest.
354
+ *
355
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
356
+ * via the `definition` "PluginAction".
357
+ */
358
+ export interface PluginAction {
359
+ /**
360
+ * Action identifier, unique within the plugin. snake_case, no dots.
361
+ */
362
+ id: string;
363
+ /**
364
+ * Human-friendly action name for the UI.
365
+ */
366
+ name: string;
367
+ /**
368
+ * Optional longer description of what the action does.
369
+ */
370
+ description?: string;
371
+ /**
372
+ * Input kinds the action can be bound to. Omitted means any kind.
373
+ *
374
+ * @minItems 1
375
+ */
376
+ inputs?: [InputKind, ...InputKind[]];
377
+ /**
378
+ * Params this action accepts, in display order.
379
+ */
380
+ params: ParamSpec[];
381
+ }
@@ -59,7 +59,7 @@ export interface Binding {
59
59
  */
60
60
  export interface Action {
61
61
  /**
62
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
62
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
63
63
  */
64
64
  type: string;
65
65
  /**
@@ -63,7 +63,7 @@ export interface Binding {
63
63
  */
64
64
  export interface Action {
65
65
  /**
66
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
66
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
67
67
  */
68
68
  type: string;
69
69
  /**
@@ -59,7 +59,7 @@ export interface Binding {
59
59
  */
60
60
  export interface Action {
61
61
  /**
62
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
62
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
63
63
  */
64
64
  type: string;
65
65
  /**
@@ -46,13 +46,10 @@ export interface ActionDescriptor {
46
46
  }
47
47
  /**
48
48
  * Describes one action parameter so a client can render an input for it.
49
- *
50
- * This interface was referenced by `MethodListActions`'s JSON-Schema
51
- * via the `definition` "ParamSpec".
52
49
  */
53
50
  export interface ParamSpec {
54
51
  /**
55
- * Param key written into Action.params.
52
+ * Param key written into Action.params. Unique within the action.
56
53
  */
57
54
  name: string;
58
55
  /**
@@ -43,7 +43,7 @@ export interface Binding {
43
43
  */
44
44
  export interface Action {
45
45
  /**
46
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
46
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
47
47
  */
48
48
  type: string;
49
49
  /**
@@ -64,7 +64,7 @@ export interface Binding {
64
64
  */
65
65
  export interface Action {
66
66
  /**
67
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
67
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
68
68
  */
69
69
  type: string;
70
70
  /**
@@ -40,7 +40,7 @@ export interface Binding {
40
40
  */
41
41
  export interface Action {
42
42
  /**
43
- * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
43
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'. Plugin ids are reverse-DNS (they contain dots) and action ids never do, so the action id is everything after the last dot.
44
44
  */
45
45
  type: string;
46
46
  /**