@tx5dr/contracts 1.3.0 → 1.5.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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/schema/__tests__/radio-power-support.test.d.ts +2 -0
- package/dist/schema/__tests__/radio-power-support.test.d.ts.map +1 -0
- package/dist/schema/__tests__/radio-power-support.test.js +19 -0
- package/dist/schema/__tests__/radio-power-support.test.js.map +1 -0
- package/dist/schema/__tests__/realtime-settings.schema.test.d.ts +2 -0
- package/dist/schema/__tests__/realtime-settings.schema.test.d.ts.map +1 -0
- package/dist/schema/__tests__/realtime-settings.schema.test.js +34 -0
- package/dist/schema/__tests__/realtime-settings.schema.test.js.map +1 -0
- package/dist/schema/cpu-profile.schema.d.ts +95 -0
- package/dist/schema/cpu-profile.schema.d.ts.map +1 -0
- package/dist/schema/cpu-profile.schema.js +35 -0
- package/dist/schema/cpu-profile.schema.js.map +1 -0
- package/dist/schema/desktop-https.schema.d.ts +9 -0
- package/dist/schema/desktop-https.schema.d.ts.map +1 -1
- package/dist/schema/desktop-https.schema.js +3 -0
- package/dist/schema/desktop-https.schema.js.map +1 -1
- package/dist/schema/openwebrx.schema.d.ts +1 -1
- package/dist/schema/openwebrx.schema.d.ts.map +1 -1
- package/dist/schema/openwebrx.schema.js +1 -1
- package/dist/schema/openwebrx.schema.js.map +1 -1
- package/dist/schema/operator.schema.d.ts +38 -71
- package/dist/schema/operator.schema.d.ts.map +1 -1
- package/dist/schema/operator.schema.js +0 -5
- package/dist/schema/operator.schema.js.map +1 -1
- package/dist/schema/plugin.schema.d.ts +670 -136
- package/dist/schema/plugin.schema.d.ts.map +1 -1
- package/dist/schema/plugin.schema.js +37 -2
- package/dist/schema/plugin.schema.js.map +1 -1
- package/dist/schema/process-monitor.schema.d.ts +100 -0
- package/dist/schema/process-monitor.schema.d.ts.map +1 -1
- package/dist/schema/process-monitor.schema.js +8 -0
- package/dist/schema/process-monitor.schema.js.map +1 -1
- package/dist/schema/radio-capability.schema.d.ts +42 -2
- package/dist/schema/radio-capability.schema.d.ts.map +1 -1
- package/dist/schema/radio-capability.schema.js +18 -1
- package/dist/schema/radio-capability.schema.js.map +1 -1
- package/dist/schema/radio-power-support.d.ts +8 -0
- package/dist/schema/radio-power-support.d.ts.map +1 -1
- package/dist/schema/radio-power-support.js +38 -26
- package/dist/schema/radio-power-support.js.map +1 -1
- package/dist/schema/radio-power.schema.d.ts +10 -6
- package/dist/schema/radio-power.schema.d.ts.map +1 -1
- package/dist/schema/radio-power.schema.js +8 -6
- package/dist/schema/radio-power.schema.js.map +1 -1
- package/dist/schema/realtime.schema.d.ts +507 -417
- package/dist/schema/realtime.schema.d.ts.map +1 -1
- package/dist/schema/realtime.schema.js +85 -51
- package/dist/schema/realtime.schema.js.map +1 -1
- package/dist/schema/server-message-keys.d.ts +2 -2
- package/dist/schema/server-message-keys.d.ts.map +1 -1
- package/dist/schema/server-message-keys.js +2 -2
- package/dist/schema/server-message-keys.js.map +1 -1
- package/dist/schema/slot-info.schema.d.ts +6 -0
- package/dist/schema/slot-info.schema.d.ts.map +1 -1
- package/dist/schema/slot-info.schema.js +3 -1
- package/dist/schema/slot-info.schema.js.map +1 -1
- package/dist/schema/voice-keyer.schema.d.ts +164 -0
- package/dist/schema/voice-keyer.schema.d.ts.map +1 -0
- package/dist/schema/voice-keyer.schema.js +43 -0
- package/dist/schema/voice-keyer.schema.js.map +1 -0
- package/dist/schema/websocket.schema.d.ts +1565 -823
- package/dist/schema/websocket.schema.d.ts.map +1 -1
- package/dist/schema/websocket.schema.js +19 -6
- package/dist/schema/websocket.schema.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/schema/__tests__/radio-power-support.test.ts +26 -0
- package/src/schema/__tests__/realtime-settings.schema.test.ts +40 -0
- package/src/schema/cpu-profile.schema.ts +47 -0
- package/src/schema/desktop-https.schema.ts +3 -1
- package/src/schema/openwebrx.schema.ts +1 -1
- package/src/schema/operator.schema.ts +0 -5
- package/src/schema/plugin.schema.ts +43 -2
- package/src/schema/process-monitor.schema.ts +10 -0
- package/src/schema/radio-capability.schema.ts +25 -1
- package/src/schema/radio-power-support.ts +49 -26
- package/src/schema/radio-power.schema.ts +8 -6
- package/src/schema/realtime.schema.ts +96 -65
- package/src/schema/server-message-keys.ts +2 -2
- package/src/schema/slot-info.schema.ts +3 -1
- package/src/schema/voice-keyer.schema.ts +55 -0
- package/src/schema/websocket.schema.ts +31 -6
|
@@ -26,6 +26,7 @@ import { RadioInfoSchema, HamlibConfigSchema, TunerStatusSchema, TunerCapabiliti
|
|
|
26
26
|
import { RadioProfileSchema, ProfileChangedEventSchema } from './radio-profile.schema.js';
|
|
27
27
|
import { UserRole } from './auth.schema.js';
|
|
28
28
|
import type { VoicePTTLock } from './voice.schema.js';
|
|
29
|
+
import type { VoiceKeyerStatus } from './voice-keyer.schema.js';
|
|
29
30
|
import { CapabilityListSchema, CapabilityStateSchema, WriteCapabilityPayloadSchema } from './radio-capability.schema.js';
|
|
30
31
|
import { RadioPowerStateEventSchema } from './radio-power.schema.js';
|
|
31
32
|
import { AudioSidecarStatusPayloadSchema } from './audio-sidecar.schema.js';
|
|
@@ -116,6 +117,9 @@ export enum WSMessageType {
|
|
|
116
117
|
// ===== 电台数值表 =====
|
|
117
118
|
METER_DATA = 'meterData',
|
|
118
119
|
|
|
120
|
+
// ===== 电台实际静噪状态 =====
|
|
121
|
+
SQUELCH_STATUS_CHANGED = 'squelchStatusChanged',
|
|
122
|
+
|
|
119
123
|
// ===== 极简文本消息 =====
|
|
120
124
|
TEXT_MESSAGE = 'textMessage',
|
|
121
125
|
|
|
@@ -164,6 +168,9 @@ export enum WSMessageType {
|
|
|
164
168
|
VOICE_PTT_LOCK_CHANGED = 'voicePttLockChanged',
|
|
165
169
|
VOICE_SET_RADIO_MODE = 'voiceSetRadioMode',
|
|
166
170
|
VOICE_RADIO_MODE_CHANGED = 'voiceRadioModeChanged',
|
|
171
|
+
VOICE_KEYER_PLAY = 'voiceKeyerPlay',
|
|
172
|
+
VOICE_KEYER_STOP = 'voiceKeyerStop',
|
|
173
|
+
VOICE_KEYER_STATUS_CHANGED = 'voiceKeyerStatusChanged',
|
|
167
174
|
|
|
168
175
|
// ===== 进程监控 =====
|
|
169
176
|
PROCESS_SNAPSHOT = 'processSnapshot',
|
|
@@ -180,6 +187,7 @@ export enum WSMessageType {
|
|
|
180
187
|
PLUGIN_USER_ACTION = 'pluginUserAction',
|
|
181
188
|
PLUGIN_PAGE_PUSH = 'pluginPagePush',
|
|
182
189
|
PLUGIN_PANEL_META = 'pluginPanelMeta',
|
|
190
|
+
PLUGIN_PANEL_CONTRIBUTIONS_CHANGED = 'pluginPanelContributionsChanged',
|
|
183
191
|
|
|
184
192
|
// ===== OpenWebRX SDR =====
|
|
185
193
|
OPENWEBRX_LISTEN_STATUS = 'openwebrxListenStatus',
|
|
@@ -209,7 +217,7 @@ export const SystemStatusSchema = z.object({
|
|
|
209
217
|
/** 当前电台调制模式(语音模式下使用,如 USB/LSB/FM/AM) */
|
|
210
218
|
currentRadioMode: z.string().optional(),
|
|
211
219
|
/** 引擎状态机当前状态 */
|
|
212
|
-
engineState: z.enum(['idle', '
|
|
220
|
+
engineState: z.enum(['idle', 'starting', 'running', 'stopping']).optional(),
|
|
213
221
|
/** 引擎状态机上下文的精简投影 */
|
|
214
222
|
engineContext: z.object({
|
|
215
223
|
error: z.string().optional(),
|
|
@@ -259,6 +267,14 @@ export const PTTStatusSchema = z.object({
|
|
|
259
267
|
operatorIds: z.array(z.string()),
|
|
260
268
|
});
|
|
261
269
|
|
|
270
|
+
export const SquelchStatusSchema = z.object({
|
|
271
|
+
supported: z.boolean(),
|
|
272
|
+
open: z.boolean().nullable(),
|
|
273
|
+
muted: z.boolean(),
|
|
274
|
+
source: z.enum(['hamlib-dcd', 'unsupported']),
|
|
275
|
+
updatedAt: z.number(),
|
|
276
|
+
});
|
|
277
|
+
|
|
262
278
|
export const OperatorRuntimeSlotSchema = z.enum(['TX1', 'TX2', 'TX3', 'TX4', 'TX5', 'TX6']);
|
|
263
279
|
export type OperatorRuntimeSlot = z.infer<typeof OperatorRuntimeSlotSchema>;
|
|
264
280
|
|
|
@@ -357,6 +373,7 @@ export type SubWindowInfo = z.infer<typeof SubWindowInfoSchema>;
|
|
|
357
373
|
export type DecodeErrorInfo = z.infer<typeof DecodeErrorInfoSchema>;
|
|
358
374
|
export type FrequencyState = z.infer<typeof FrequencyStateSchema>;
|
|
359
375
|
export type PTTStatus = z.infer<typeof PTTStatusSchema>;
|
|
376
|
+
export type SquelchStatus = z.infer<typeof SquelchStatusSchema>;
|
|
360
377
|
export type MeterData = z.infer<typeof MeterDataSchema>;
|
|
361
378
|
|
|
362
379
|
// ===== WebSocket消息Schema定义 =====
|
|
@@ -526,11 +543,6 @@ export const OperatorStatusSchema = z.object({
|
|
|
526
543
|
availableSlots: z.array(z.string()),
|
|
527
544
|
}),
|
|
528
545
|
runtime: StrategyRuntimeSnapshotSchema.optional(),
|
|
529
|
-
cycleInfo: z.object({
|
|
530
|
-
currentCycle: z.number(),
|
|
531
|
-
isTransmitCycle: z.boolean(),
|
|
532
|
-
cycleProgress: z.number().min(0).max(1), // 0-1 表示周期进度百分比
|
|
533
|
-
}).optional(),
|
|
534
546
|
// TX1-TX6 时隙内容
|
|
535
547
|
slots: z.object({
|
|
536
548
|
TX1: z.string().optional(),
|
|
@@ -1020,6 +1032,13 @@ export const WSMeterDataMessageSchema = WSBaseMessageSchema.extend({
|
|
|
1020
1032
|
|
|
1021
1033
|
export type WSMeterDataMessage = z.infer<typeof WSMeterDataMessageSchema>;
|
|
1022
1034
|
|
|
1035
|
+
export const WSSquelchStatusChangedMessageSchema = WSBaseMessageSchema.extend({
|
|
1036
|
+
type: z.literal(WSMessageType.SQUELCH_STATUS_CHANGED),
|
|
1037
|
+
data: SquelchStatusSchema,
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
export type WSSquelchStatusChangedMessage = z.infer<typeof WSSquelchStatusChangedMessageSchema>;
|
|
1041
|
+
|
|
1023
1042
|
/**
|
|
1024
1043
|
* 文本消息(Toast通知)
|
|
1025
1044
|
* 用于向客户端推送提示信息
|
|
@@ -1270,6 +1289,7 @@ export const WSMessageSchema = z.discriminatedUnion('type', [
|
|
|
1270
1289
|
|
|
1271
1290
|
// 电台数值表消息
|
|
1272
1291
|
WSMeterDataMessageSchema,
|
|
1292
|
+
WSSquelchStatusChangedMessageSchema,
|
|
1273
1293
|
|
|
1274
1294
|
// 文本消息(Toast通知)
|
|
1275
1295
|
WSTextMessageSchema,
|
|
@@ -1404,6 +1424,9 @@ export interface DigitalRadioEngineEvents {
|
|
|
1404
1424
|
// 电台数值表事件
|
|
1405
1425
|
meterData: (data: MeterData) => void;
|
|
1406
1426
|
|
|
1427
|
+
// 电台实际静噪状态事件
|
|
1428
|
+
squelchStatusChanged: (data: SquelchStatus) => void;
|
|
1429
|
+
|
|
1407
1430
|
// QSO 日志事件
|
|
1408
1431
|
qsoRecordAdded: (data: { operatorId: string; logBookId: string; qsoRecord: z.infer<typeof QSORecordSchema> }) => void;
|
|
1409
1432
|
qsoRecordUpdated: (data: { operatorId: string; logBookId: string; qsoRecord: z.infer<typeof QSORecordSchema> }) => void;
|
|
@@ -1439,6 +1462,7 @@ export interface DigitalRadioEngineEvents {
|
|
|
1439
1462
|
// 语音模式事件
|
|
1440
1463
|
voicePttLockChanged: (data: VoicePTTLock) => void;
|
|
1441
1464
|
voiceRadioModeChanged: (data: { radioMode: string }) => void;
|
|
1465
|
+
voiceKeyerStatusChanged: (data: VoiceKeyerStatus) => void;
|
|
1442
1466
|
|
|
1443
1467
|
// 进程监控事件
|
|
1444
1468
|
processSnapshot: (data: import('./process-monitor.schema.js').ProcessSnapshot) => void;
|
|
@@ -1467,6 +1491,7 @@ export interface DigitalRadioEngineEvents {
|
|
|
1467
1491
|
data?: unknown;
|
|
1468
1492
|
}) => void;
|
|
1469
1493
|
pluginPanelMeta: (data: import('./plugin.schema.js').PluginPanelMetaPayload) => void;
|
|
1494
|
+
pluginPanelContributionsChanged: (data: import('./plugin.schema.js').PluginUIPanelContributionGroup) => void;
|
|
1470
1495
|
|
|
1471
1496
|
// 内部子系统间通信事件(不通过 WebSocket 广播,用于 engine emitter 内部编排)
|
|
1472
1497
|
encodeStart: (slotInfo: z.infer<typeof SlotInfoSchema>) => void;
|