@tx5dr/contracts 1.5.0 → 1.7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"slot-info.schema.js","sourceRoot":"","sources":["../../src/schema/slot-info.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAEhF;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,cAAc;IACd,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,kBAAkB;IAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,eAAe;IACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,eAAe;IACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9B,YAAY;IACZ,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,kBAAkB;IAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,oBAAoB;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,sBAAsB;IACtB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,+BAA+B;IAC/B,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,uBAAuB;IACvB,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC3C,kBAAkB;IAClB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,yB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AAC,QAAQ,EAAE;KACrD,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACd,iBAAiB;IACjB,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;KAC7B,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAChB,CAAC,CAAC"}
@@ -8208,7 +8208,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8208
8208
  slot?: "operator" | "automation" | "main-right" | "voice-left-top" | "voice-right-top" | undefined;
8209
8209
  width?: "full" | "half" | undefined;
8210
8210
  }>, "many">>;
8211
- permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network"]>, "many">>;
8211
+ permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network", "radio:read", "radio:control", "radio:power", "settings:ft8", "settings:decode-windows", "settings:realtime", "settings:frequency-presets", "settings:station", "settings:psk-reporter", "settings:ntp"]>, "many">>;
8212
8212
  capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<["auto_call_candidate", "auto_call_execution"]>, "many">>;
8213
8213
  ui: z.ZodOptional<z.ZodObject<{
8214
8214
  dir: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -8317,7 +8317,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8317
8317
  icon?: string | undefined;
8318
8318
  }[];
8319
8319
  } | undefined;
8320
- permissions?: "network"[] | undefined;
8320
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
8321
8321
  settings?: Record<string, {
8322
8322
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
8323
8323
  label: string;
@@ -8389,7 +8389,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8389
8389
  }[] | undefined;
8390
8390
  } | undefined;
8391
8391
  instanceScope?: "operator" | "global" | undefined;
8392
- permissions?: "network"[] | undefined;
8392
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
8393
8393
  settings?: Record<string, {
8394
8394
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
8395
8395
  label: string;
@@ -8590,7 +8590,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8590
8590
  icon?: string | undefined;
8591
8591
  }[];
8592
8592
  } | undefined;
8593
- permissions?: "network"[] | undefined;
8593
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
8594
8594
  settings?: Record<string, {
8595
8595
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
8596
8596
  label: string;
@@ -8697,7 +8697,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8697
8697
  }[] | undefined;
8698
8698
  } | undefined;
8699
8699
  instanceScope?: "operator" | "global" | undefined;
8700
- permissions?: "network"[] | undefined;
8700
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
8701
8701
  settings?: Record<string, {
8702
8702
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
8703
8703
  label: string;
@@ -8812,7 +8812,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8812
8812
  icon?: string | undefined;
8813
8813
  }[];
8814
8814
  } | undefined;
8815
- permissions?: "network"[] | undefined;
8815
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
8816
8816
  settings?: Record<string, {
8817
8817
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
8818
8818
  label: string;
@@ -8924,7 +8924,7 @@ export declare const WSPluginListMessageSchema: z.ZodObject<{
8924
8924
  }[] | undefined;
8925
8925
  } | undefined;
8926
8926
  instanceScope?: "operator" | "global" | undefined;
8927
- permissions?: "network"[] | undefined;
8927
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
8928
8928
  settings?: Record<string, {
8929
8929
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
8930
8930
  label: string;
@@ -9146,7 +9146,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9146
9146
  slot?: "operator" | "automation" | "main-right" | "voice-left-top" | "voice-right-top" | undefined;
9147
9147
  width?: "full" | "half" | undefined;
9148
9148
  }>, "many">>;
9149
- permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network"]>, "many">>;
9149
+ permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network", "radio:read", "radio:control", "radio:power", "settings:ft8", "settings:decode-windows", "settings:realtime", "settings:frequency-presets", "settings:station", "settings:psk-reporter", "settings:ntp"]>, "many">>;
9150
9150
  capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<["auto_call_candidate", "auto_call_execution"]>, "many">>;
9151
9151
  ui: z.ZodOptional<z.ZodObject<{
9152
9152
  dir: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -9255,7 +9255,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9255
9255
  icon?: string | undefined;
9256
9256
  }[];
9257
9257
  } | undefined;
9258
- permissions?: "network"[] | undefined;
9258
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
9259
9259
  settings?: Record<string, {
9260
9260
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
9261
9261
  label: string;
@@ -9327,7 +9327,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9327
9327
  }[] | undefined;
9328
9328
  } | undefined;
9329
9329
  instanceScope?: "operator" | "global" | undefined;
9330
- permissions?: "network"[] | undefined;
9330
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
9331
9331
  settings?: Record<string, {
9332
9332
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
9333
9333
  label: string;
@@ -9406,7 +9406,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9406
9406
  icon?: string | undefined;
9407
9407
  }[];
9408
9408
  } | undefined;
9409
- permissions?: "network"[] | undefined;
9409
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
9410
9410
  settings?: Record<string, {
9411
9411
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
9412
9412
  label: string;
@@ -9481,7 +9481,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9481
9481
  }[] | undefined;
9482
9482
  } | undefined;
9483
9483
  instanceScope?: "operator" | "global" | undefined;
9484
- permissions?: "network"[] | undefined;
9484
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
9485
9485
  settings?: Record<string, {
9486
9486
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
9487
9487
  label: string;
@@ -9564,7 +9564,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9564
9564
  icon?: string | undefined;
9565
9565
  }[];
9566
9566
  } | undefined;
9567
- permissions?: "network"[] | undefined;
9567
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
9568
9568
  settings?: Record<string, {
9569
9569
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
9570
9570
  label: string;
@@ -9644,7 +9644,7 @@ export declare const WSPluginStatusChangedMessageSchema: z.ZodObject<{
9644
9644
  }[] | undefined;
9645
9645
  } | undefined;
9646
9646
  instanceScope?: "operator" | "global" | undefined;
9647
- permissions?: "network"[] | undefined;
9647
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
9648
9648
  settings?: Record<string, {
9649
9649
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
9650
9650
  label: string;
@@ -16082,7 +16082,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16082
16082
  slot?: "operator" | "automation" | "main-right" | "voice-left-top" | "voice-right-top" | undefined;
16083
16083
  width?: "full" | "half" | undefined;
16084
16084
  }>, "many">>;
16085
- permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network"]>, "many">>;
16085
+ permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network", "radio:read", "radio:control", "radio:power", "settings:ft8", "settings:decode-windows", "settings:realtime", "settings:frequency-presets", "settings:station", "settings:psk-reporter", "settings:ntp"]>, "many">>;
16086
16086
  capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<["auto_call_candidate", "auto_call_execution"]>, "many">>;
16087
16087
  ui: z.ZodOptional<z.ZodObject<{
16088
16088
  dir: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -16191,7 +16191,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16191
16191
  icon?: string | undefined;
16192
16192
  }[];
16193
16193
  } | undefined;
16194
- permissions?: "network"[] | undefined;
16194
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
16195
16195
  settings?: Record<string, {
16196
16196
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
16197
16197
  label: string;
@@ -16263,7 +16263,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16263
16263
  }[] | undefined;
16264
16264
  } | undefined;
16265
16265
  instanceScope?: "operator" | "global" | undefined;
16266
- permissions?: "network"[] | undefined;
16266
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
16267
16267
  settings?: Record<string, {
16268
16268
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
16269
16269
  label: string;
@@ -16464,7 +16464,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16464
16464
  icon?: string | undefined;
16465
16465
  }[];
16466
16466
  } | undefined;
16467
- permissions?: "network"[] | undefined;
16467
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
16468
16468
  settings?: Record<string, {
16469
16469
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
16470
16470
  label: string;
@@ -16571,7 +16571,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16571
16571
  }[] | undefined;
16572
16572
  } | undefined;
16573
16573
  instanceScope?: "operator" | "global" | undefined;
16574
- permissions?: "network"[] | undefined;
16574
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
16575
16575
  settings?: Record<string, {
16576
16576
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
16577
16577
  label: string;
@@ -16686,7 +16686,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16686
16686
  icon?: string | undefined;
16687
16687
  }[];
16688
16688
  } | undefined;
16689
- permissions?: "network"[] | undefined;
16689
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
16690
16690
  settings?: Record<string, {
16691
16691
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
16692
16692
  label: string;
@@ -16798,7 +16798,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
16798
16798
  }[] | undefined;
16799
16799
  } | undefined;
16800
16800
  instanceScope?: "operator" | "global" | undefined;
16801
- permissions?: "network"[] | undefined;
16801
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
16802
16802
  settings?: Record<string, {
16803
16803
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
16804
16804
  label: string;
@@ -17018,7 +17018,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17018
17018
  slot?: "operator" | "automation" | "main-right" | "voice-left-top" | "voice-right-top" | undefined;
17019
17019
  width?: "full" | "half" | undefined;
17020
17020
  }>, "many">>;
17021
- permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network"]>, "many">>;
17021
+ permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<["network", "radio:read", "radio:control", "radio:power", "settings:ft8", "settings:decode-windows", "settings:realtime", "settings:frequency-presets", "settings:station", "settings:psk-reporter", "settings:ntp"]>, "many">>;
17022
17022
  capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<["auto_call_candidate", "auto_call_execution"]>, "many">>;
17023
17023
  ui: z.ZodOptional<z.ZodObject<{
17024
17024
  dir: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -17127,7 +17127,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17127
17127
  icon?: string | undefined;
17128
17128
  }[];
17129
17129
  } | undefined;
17130
- permissions?: "network"[] | undefined;
17130
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
17131
17131
  settings?: Record<string, {
17132
17132
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
17133
17133
  label: string;
@@ -17199,7 +17199,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17199
17199
  }[] | undefined;
17200
17200
  } | undefined;
17201
17201
  instanceScope?: "operator" | "global" | undefined;
17202
- permissions?: "network"[] | undefined;
17202
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
17203
17203
  settings?: Record<string, {
17204
17204
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
17205
17205
  label: string;
@@ -17278,7 +17278,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17278
17278
  icon?: string | undefined;
17279
17279
  }[];
17280
17280
  } | undefined;
17281
- permissions?: "network"[] | undefined;
17281
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
17282
17282
  settings?: Record<string, {
17283
17283
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
17284
17284
  label: string;
@@ -17353,7 +17353,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17353
17353
  }[] | undefined;
17354
17354
  } | undefined;
17355
17355
  instanceScope?: "operator" | "global" | undefined;
17356
- permissions?: "network"[] | undefined;
17356
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
17357
17357
  settings?: Record<string, {
17358
17358
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
17359
17359
  label: string;
@@ -17436,7 +17436,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17436
17436
  icon?: string | undefined;
17437
17437
  }[];
17438
17438
  } | undefined;
17439
- permissions?: "network"[] | undefined;
17439
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
17440
17440
  settings?: Record<string, {
17441
17441
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
17442
17442
  label: string;
@@ -17516,7 +17516,7 @@ export declare const WSMessageSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
17516
17516
  }[] | undefined;
17517
17517
  } | undefined;
17518
17518
  instanceScope?: "operator" | "global" | undefined;
17519
- permissions?: "network"[] | undefined;
17519
+ permissions?: ("network" | "radio:read" | "radio:control" | "radio:power" | "settings:ft8" | "settings:decode-windows" | "settings:realtime" | "settings:frequency-presets" | "settings:station" | "settings:psk-reporter" | "settings:ntp")[] | undefined;
17520
17520
  settings?: Record<string, {
17521
17521
  type: "string" | "number" | "boolean" | "string[]" | "object[]" | "info";
17522
17522
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tx5dr/contracts",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,6 +3,7 @@ import {
3
3
  PluginMarketCatalogResponseSchema,
4
4
  PluginMarketCatalogSchema,
5
5
  PluginMarketChannelSchema,
6
+ PluginPermissionSchema,
6
7
  PluginSourceSchema,
7
8
  } from '../../index.js';
8
9
 
@@ -58,6 +59,11 @@ describe('plugin market schema', () => {
58
59
  expect(() => PluginMarketChannelSchema.parse('beta')).toThrow();
59
60
  });
60
61
 
62
+ it('accepts host settings permissions', () => {
63
+ expect(PluginPermissionSchema.parse('settings:ft8')).toBe('settings:ft8');
64
+ expect(PluginPermissionSchema.parse('settings:ntp')).toBe('settings:ntp');
65
+ });
66
+
61
67
  it('accepts the route response envelope', () => {
62
68
  const response = PluginMarketCatalogResponseSchema.parse({
63
69
  sourceUrl: 'https://tx5dr.oss-cn-hangzhou.aliyuncs.com/tx-5dr/plugins/market/stable/index.json',
@@ -1,8 +1,11 @@
1
1
  import { describe, expect, it } from 'vitest';
2
2
  import {
3
3
  RealtimeSessionRequestSchema,
4
+ ResolvedRealtimeAudioCodecPolicySchema,
4
5
  RealtimeTransportKindSchema,
5
6
  RealtimeSettingsSchema,
7
+ resolveVoiceTxBufferPolicy,
8
+ VoiceTxBufferPreferenceSchema,
6
9
  } from '../realtime.schema.js';
7
10
 
8
11
  describe('Realtime transport schemas', () => {
@@ -19,6 +22,105 @@ describe('Realtime transport schemas', () => {
19
22
  });
20
23
  });
21
24
 
25
+ describe('Realtime audio codec schemas', () => {
26
+ it('accepts codec preferences and client capabilities', () => {
27
+ const parsed = RealtimeSessionRequestSchema.parse({
28
+ scope: 'radio',
29
+ direction: 'recv',
30
+ audioCodecPreference: 'opus',
31
+ audioCodecCapabilities: {
32
+ opus: {
33
+ decode: true,
34
+ sampleRates: [48000, 24000, 16000, 12000],
35
+ encodeSampleRates: [16000],
36
+ decodeSampleRates: [48000, 24000, 16000, 12000],
37
+ },
38
+ pcmS16le: true,
39
+ },
40
+ });
41
+
42
+ expect(parsed.audioCodecPreference).toBe('opus');
43
+ expect(parsed.audioCodecCapabilities?.opus?.decode).toBe(true);
44
+ expect(parsed.audioCodecCapabilities?.opus?.encodeSampleRates).toEqual([16000]);
45
+ });
46
+
47
+ it('defaults old clients to automatic codec negotiation', () => {
48
+ const parsed = RealtimeSessionRequestSchema.parse({
49
+ scope: 'radio',
50
+ direction: 'recv',
51
+ });
52
+
53
+ expect(parsed.audioCodecPreference).toBe('auto');
54
+ });
55
+
56
+ it('describes resolved Opus and PCM fallback policies', () => {
57
+ expect(ResolvedRealtimeAudioCodecPolicySchema.parse({
58
+ preference: 'auto',
59
+ resolvedCodec: 'opus',
60
+ fallbackReason: null,
61
+ codecSampleRate: null,
62
+ bitrateBps: 32000,
63
+ frameDurationMs: 20,
64
+ }).resolvedCodec).toBe('opus');
65
+
66
+ expect(ResolvedRealtimeAudioCodecPolicySchema.parse({
67
+ preference: 'opus',
68
+ resolvedCodec: 'pcm-s16le',
69
+ fallbackReason: 'server-opus-unavailable',
70
+ codecSampleRate: null,
71
+ bitrateBps: null,
72
+ frameDurationMs: null,
73
+ }).fallbackReason).toBe('server-opus-unavailable');
74
+ });
75
+ });
76
+
77
+ describe('VoiceTxBufferPreferenceSchema', () => {
78
+ it('accepts auto and custom TX buffer profiles', () => {
79
+ expect(VoiceTxBufferPreferenceSchema.parse({ profile: 'auto' }).profile).toBe('auto');
80
+ expect(VoiceTxBufferPreferenceSchema.parse({
81
+ profile: 'custom',
82
+ customTargetBufferMs: '240',
83
+ }).customTargetBufferMs).toBe(240);
84
+ });
85
+
86
+ it('migrates legacy TX buffer presets to auto', () => {
87
+ expect(VoiceTxBufferPreferenceSchema.parse({ profile: 'low-latency' }).profile).toBe('auto');
88
+ expect(VoiceTxBufferPreferenceSchema.parse({ profile: 'balanced' }).profile).toBe('auto');
89
+ expect(VoiceTxBufferPreferenceSchema.parse({ profile: 'stable' }).profile).toBe('auto');
90
+ });
91
+
92
+ it('rejects invalid custom TX buffer targets', () => {
93
+ expect(() => VoiceTxBufferPreferenceSchema.parse({ profile: 'custom' })).toThrow();
94
+ expect(() => VoiceTxBufferPreferenceSchema.parse({ profile: 'custom', customTargetBufferMs: 39 })).toThrow();
95
+ expect(() => VoiceTxBufferPreferenceSchema.parse({ profile: 'custom', customTargetBufferMs: 501 })).toThrow();
96
+ });
97
+
98
+ it('defaults send sessions to auto when no preference is provided', () => {
99
+ const parsed = RealtimeSessionRequestSchema.parse({
100
+ scope: 'radio',
101
+ direction: 'send',
102
+ });
103
+ expect(parsed.voiceTxBufferPreference).toBeUndefined();
104
+ expect(resolveVoiceTxBufferPolicy(parsed.voiceTxBufferPreference).targetMs).toBe(80);
105
+ });
106
+
107
+ it('resolves automatic and custom TX buffer policies', () => {
108
+ expect(resolveVoiceTxBufferPolicy({ profile: 'auto' })).toMatchObject({
109
+ profile: 'auto',
110
+ targetMs: 80,
111
+ minMs: 60,
112
+ maxMs: 400,
113
+ });
114
+ expect(resolveVoiceTxBufferPolicy({
115
+ profile: 'custom',
116
+ customTargetBufferMs: 250,
117
+ })).toMatchObject({
118
+ profile: 'custom',
119
+ targetMs: 250,
120
+ });
121
+ });
122
+ });
123
+
22
124
  describe('RealtimeSettingsSchema rtc-data-audio public endpoint', () => {
23
125
  it('accepts empty, DNS, IPv4, IPv6 hosts, and valid UDP ports', () => {
24
126
  expect(RealtimeSettingsSchema.parse({ rtcDataAudioPublicHost: '' }).rtcDataAudioPublicHost).toBeNull();
@@ -36,7 +36,19 @@ export type PluginInstanceScope = z.infer<typeof PluginInstanceScopeSchema>;
36
36
  * Permissions let the host gate sensitive capabilities behind manifest-level
37
37
  * intent. Plugins should request the smallest possible set.
38
38
  */
39
- export const PluginPermissionSchema = z.enum(['network']);
39
+ export const PluginPermissionSchema = z.enum([
40
+ 'network',
41
+ 'radio:read',
42
+ 'radio:control',
43
+ 'radio:power',
44
+ 'settings:ft8',
45
+ 'settings:decode-windows',
46
+ 'settings:realtime',
47
+ 'settings:frequency-presets',
48
+ 'settings:station',
49
+ 'settings:psk-reporter',
50
+ 'settings:ntp',
51
+ ]);
40
52
 
41
53
  /**
42
54
  * Explicit permission declarations requested by a plugin.
@@ -9,6 +9,152 @@ export type RealtimeTransportKind = z.infer<typeof RealtimeTransportKindSchema>;
9
9
  export const RealtimeSessionDirectionSchema = z.enum(['recv', 'send']);
10
10
  export type RealtimeSessionDirection = z.infer<typeof RealtimeSessionDirectionSchema>;
11
11
 
12
+ export const RealtimeAudioCodecSchema = z.enum(['opus', 'pcm-s16le']);
13
+ export type RealtimeAudioCodec = z.infer<typeof RealtimeAudioCodecSchema>;
14
+
15
+ export const RealtimeAudioCodecPreferenceSchema = z.enum(['auto', 'opus', 'pcm']);
16
+ export type RealtimeAudioCodecPreference = z.infer<typeof RealtimeAudioCodecPreferenceSchema>;
17
+
18
+ export const DEFAULT_REALTIME_AUDIO_CODEC_PREFERENCE: RealtimeAudioCodecPreference = 'auto';
19
+
20
+ export const RealtimeAudioCodecCapabilitiesSchema = z.object({
21
+ opus: z.object({
22
+ encode: z.boolean().optional(),
23
+ decode: z.boolean().optional(),
24
+ sampleRates: z.array(z.number().int().positive()).optional(),
25
+ encodeSampleRates: z.array(z.number().int().positive()).optional(),
26
+ decodeSampleRates: z.array(z.number().int().positive()).optional(),
27
+ }).optional(),
28
+ pcmS16le: z.boolean().optional(),
29
+ }).optional();
30
+ export type RealtimeAudioCodecCapabilities = z.infer<typeof RealtimeAudioCodecCapabilitiesSchema>;
31
+
32
+ export const ResolvedRealtimeAudioCodecPolicySchema = z.object({
33
+ preference: RealtimeAudioCodecPreferenceSchema,
34
+ resolvedCodec: RealtimeAudioCodecSchema,
35
+ fallbackReason: z.enum([
36
+ 'not-needed',
37
+ 'client-forced-pcm',
38
+ 'client-opus-unavailable',
39
+ 'server-opus-unavailable',
40
+ 'scope-not-supported',
41
+ ]).nullable(),
42
+ codecSampleRate: z.number().int().positive().nullable(),
43
+ bitrateBps: z.number().int().positive().nullable(),
44
+ frameDurationMs: z.number().int().positive().nullable(),
45
+ });
46
+ export type ResolvedRealtimeAudioCodecPolicy = z.infer<typeof ResolvedRealtimeAudioCodecPolicySchema>;
47
+
48
+ export const VoiceTxBufferProfileSchema = z.enum(['auto', 'custom']);
49
+ export type VoiceTxBufferProfile = z.infer<typeof VoiceTxBufferProfileSchema>;
50
+
51
+ export const VoiceTxCustomTargetBufferMsSchema = z.preprocess((value) => {
52
+ if (value === '' || value === undefined || value === null) {
53
+ return undefined;
54
+ }
55
+ if (typeof value === 'string') {
56
+ const parsed = Number.parseInt(value, 10);
57
+ return Number.isFinite(parsed) ? parsed : value;
58
+ }
59
+ return value;
60
+ }, z.number().int().min(40).max(500).optional());
61
+
62
+ export const VoiceTxBufferPreferenceSchema = z.preprocess((value) => {
63
+ if (!value || typeof value !== 'object') {
64
+ return value;
65
+ }
66
+ const preference = value as { profile?: unknown };
67
+ if (
68
+ preference.profile === 'low-latency'
69
+ || preference.profile === 'balanced'
70
+ || preference.profile === 'stable'
71
+ ) {
72
+ return { ...preference, profile: 'auto' };
73
+ }
74
+ return value;
75
+ }, z.object({
76
+ profile: VoiceTxBufferProfileSchema.default('auto'),
77
+ customTargetBufferMs: VoiceTxCustomTargetBufferMsSchema,
78
+ })).superRefine((value, ctx) => {
79
+ if (value.profile === 'custom' && typeof value.customTargetBufferMs !== 'number') {
80
+ ctx.addIssue({
81
+ code: z.ZodIssueCode.custom,
82
+ path: ['customTargetBufferMs'],
83
+ message: 'Custom TX buffer target is required for custom profile',
84
+ });
85
+ }
86
+ });
87
+ export type VoiceTxBufferPreference = z.infer<typeof VoiceTxBufferPreferenceSchema>;
88
+
89
+ export const ResolvedVoiceTxBufferPolicySchema = z.object({
90
+ profile: VoiceTxBufferProfileSchema,
91
+ targetMs: z.number().int().min(1),
92
+ minMs: z.number().int().min(1),
93
+ maxMs: z.number().int().min(1),
94
+ headroomMs: z.number().int().min(1),
95
+ staleFrameMs: z.number().int().min(1),
96
+ uplinkMaxBufferedAudioMs: z.number().int().min(1),
97
+ uplinkDegradedBufferedAudioMs: z.number().int().min(1),
98
+ });
99
+ export type ResolvedVoiceTxBufferPolicy = z.infer<typeof ResolvedVoiceTxBufferPolicySchema>;
100
+
101
+ export const DEFAULT_VOICE_TX_BUFFER_PROFILE: VoiceTxBufferProfile = 'auto';
102
+
103
+ const VOICE_TX_BUFFER_PRESETS: Record<Exclude<VoiceTxBufferProfile, 'custom'>, ResolvedVoiceTxBufferPolicy> = {
104
+ auto: {
105
+ profile: 'auto',
106
+ targetMs: 80,
107
+ minMs: 60,
108
+ maxMs: 400,
109
+ headroomMs: 40,
110
+ staleFrameMs: 650,
111
+ uplinkMaxBufferedAudioMs: 180,
112
+ uplinkDegradedBufferedAudioMs: 360,
113
+ },
114
+ };
115
+
116
+ function clampVoiceTxBufferValue(value: number, min: number, max: number): number {
117
+ return Math.max(min, Math.min(max, Math.round(value)));
118
+ }
119
+
120
+ export function resolveVoiceTxBufferPolicy(
121
+ preference?: VoiceTxBufferPreference | null,
122
+ ): ResolvedVoiceTxBufferPolicy {
123
+ const parsedPreference = preference
124
+ ? VoiceTxBufferPreferenceSchema.safeParse(preference)
125
+ : null;
126
+ const normalizedPreference = parsedPreference?.success
127
+ ? parsedPreference.data
128
+ : { profile: DEFAULT_VOICE_TX_BUFFER_PROFILE as VoiceTxBufferProfile };
129
+
130
+ if (normalizedPreference.profile !== 'custom') {
131
+ return { ...VOICE_TX_BUFFER_PRESETS[normalizedPreference.profile] };
132
+ }
133
+
134
+ const targetMs = clampVoiceTxBufferValue(normalizedPreference.customTargetBufferMs ?? 90, 40, 500);
135
+ const minMs = clampVoiceTxBufferValue(targetMs * 0.65, 30, targetMs);
136
+ const maxMs = clampVoiceTxBufferValue(targetMs * 2.5, targetMs + 40, 900);
137
+ const headroomMs = clampVoiceTxBufferValue(targetMs * 0.45, 20, 180);
138
+ const staleFrameMs = clampVoiceTxBufferValue(targetMs * 5, maxMs + 80, 1800);
139
+ const uplinkMaxBufferedAudioMs = clampVoiceTxBufferValue(targetMs * 2, 80, 1000);
140
+ const uplinkDegradedBufferedAudioMs = clampVoiceTxBufferValue(
141
+ targetMs * 4,
142
+ uplinkMaxBufferedAudioMs + 60,
143
+ 2000,
144
+ );
145
+
146
+ return {
147
+ profile: 'custom',
148
+ targetMs,
149
+ minMs,
150
+ maxMs,
151
+ headroomMs,
152
+ staleFrameMs,
153
+ uplinkMaxBufferedAudioMs,
154
+ uplinkDegradedBufferedAudioMs,
155
+ };
156
+ }
157
+
12
158
  export const RealtimeConnectivityErrorCodeSchema = z.enum([
13
159
  'TOKEN_REQUEST_FAILED',
14
160
  'SIGNALING_UNREACHABLE',
@@ -51,6 +197,9 @@ export const RealtimeSessionRequestSchema = z.object({
51
197
  direction: RealtimeSessionDirectionSchema,
52
198
  previewSessionId: z.string().optional(),
53
199
  transportOverride: RealtimeTransportKindSchema.optional(),
200
+ voiceTxBufferPreference: VoiceTxBufferPreferenceSchema.optional(),
201
+ audioCodecPreference: RealtimeAudioCodecPreferenceSchema.default(DEFAULT_REALTIME_AUDIO_CODEC_PREFERENCE),
202
+ audioCodecCapabilities: RealtimeAudioCodecCapabilitiesSchema,
54
203
  });
55
204
 
56
205
  export type RealtimeSessionRequest = z.infer<typeof RealtimeSessionRequestSchema>;
@@ -152,6 +301,8 @@ export const RealtimeSessionResponseSchema = z.object({
152
301
  forcedCompatibilityMode: z.boolean(),
153
302
  offers: z.array(RealtimeTransportOfferSchema).min(1),
154
303
  connectivityHints: RealtimeConnectivityHintsSchema,
304
+ voiceTxBufferPolicy: ResolvedVoiceTxBufferPolicySchema.optional(),
305
+ audioCodecPolicy: ResolvedRealtimeAudioCodecPolicySchema,
155
306
  });
156
307
 
157
308
  export type RealtimeSessionResponse = z.infer<typeof RealtimeSessionResponseSchema>;
@@ -23,4 +23,7 @@ export enum ServerMessageKey {
23
23
 
24
24
  /** 实时语音链路无音频数据 */
25
25
  REALTIME_NO_AUDIO = 'realtimeNoAudio',
26
+
27
+ /** 连续相同发射达到安全上限,操作员已停止 */
28
+ SAME_TRANSMISSION_LIMIT = 'sameTransmissionLimit',
26
29
  }
@@ -89,6 +89,8 @@ export type FrameMessage = z.infer<typeof FrameMessageSchema>;
89
89
  export const DecodeRequestSchema = z.object({
90
90
  /** 关联的时隙ID */
91
91
  slotId: z.string(),
92
+ /** 解码模式 */
93
+ mode: z.enum(['FT8', 'FT4']).default('FT8'),
92
94
  /** 子窗口索引 */
93
95
  windowIdx: z.number().int().nonnegative(),
94
96
  /** PCM 音频数据 */