@tx5dr/plugin-api 1.7.12 → 2.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.
Files changed (181) hide show
  1. package/README.md +475 -17
  2. package/dist/__tests__/adif.test.js +107 -0
  3. package/dist/__tests__/adif.test.js.map +1 -1
  4. package/dist/__tests__/capability-context.test.d.ts +2 -0
  5. package/dist/__tests__/capability-context.test.d.ts.map +1 -0
  6. package/dist/__tests__/capability-context.test.js +99 -0
  7. package/dist/__tests__/capability-context.test.js.map +1 -0
  8. package/dist/__tests__/testing-utils.test.js +234 -15
  9. package/dist/__tests__/testing-utils.test.js.map +1 -1
  10. package/dist/capabilities.d.ts +38 -0
  11. package/dist/capabilities.d.ts.map +1 -0
  12. package/dist/capabilities.js +50 -0
  13. package/dist/capabilities.js.map +1 -0
  14. package/dist/compatibility.d.ts +15 -0
  15. package/dist/compatibility.d.ts.map +1 -0
  16. package/dist/compatibility.js +71 -0
  17. package/dist/compatibility.js.map +1 -0
  18. package/dist/contest-logbook-ui/assets/contest-log.css +1 -0
  19. package/dist/contest-logbook-ui/assets/contest-log.js +40 -0
  20. package/dist/contest-logbook-ui/contest-log.html +13 -0
  21. package/dist/context.d.ts +125 -54
  22. package/dist/context.d.ts.map +1 -1
  23. package/dist/definition.d.ts +98 -21
  24. package/dist/definition.d.ts.map +1 -1
  25. package/dist/definition.js +8 -1
  26. package/dist/definition.js.map +1 -1
  27. package/dist/ft8/StandardQSOPluginRuntime.d.ts +142 -0
  28. package/dist/ft8/StandardQSOPluginRuntime.d.ts.map +1 -0
  29. package/dist/ft8/StandardQSOPluginRuntime.js +1592 -0
  30. package/dist/ft8/StandardQSOPluginRuntime.js.map +1 -0
  31. package/dist/ft8/index.d.ts +22 -0
  32. package/dist/ft8/index.d.ts.map +1 -0
  33. package/dist/ft8/index.js +176 -0
  34. package/dist/ft8/index.js.map +1 -0
  35. package/dist/helpers.d.ts +417 -132
  36. package/dist/helpers.d.ts.map +1 -1
  37. package/dist/hooks.d.ts +56 -34
  38. package/dist/hooks.d.ts.map +1 -1
  39. package/dist/host-dependencies.d.ts +101 -0
  40. package/dist/host-dependencies.d.ts.map +1 -1
  41. package/dist/index.d.ts +20 -6
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +12 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/runtime.d.ts +539 -13
  46. package/dist/runtime.d.ts.map +1 -1
  47. package/dist/runtime.js +9 -1
  48. package/dist/runtime.js.map +1 -1
  49. package/dist/settings.d.ts +31 -0
  50. package/dist/settings.d.ts.map +1 -1
  51. package/dist/simulation.d.ts +60 -0
  52. package/dist/simulation.d.ts.map +1 -0
  53. package/dist/simulation.js +2 -0
  54. package/dist/simulation.js.map +1 -0
  55. package/dist/sync.d.ts +98 -6
  56. package/dist/sync.d.ts.map +1 -1
  57. package/dist/sync.js +6 -0
  58. package/dist/sync.js.map +1 -1
  59. package/dist/testing/index.d.ts +74 -12
  60. package/dist/testing/index.d.ts.map +1 -1
  61. package/dist/testing/index.js +372 -105
  62. package/dist/testing/index.js.map +1 -1
  63. package/dist/toolkit/contest/CabrilloBuilder.d.ts +7 -0
  64. package/dist/toolkit/contest/CabrilloBuilder.d.ts.map +1 -0
  65. package/dist/toolkit/contest/CabrilloBuilder.js +11 -0
  66. package/dist/toolkit/contest/CabrilloBuilder.js.map +1 -0
  67. package/dist/toolkit/contest/ContestCategorySchema.d.ts +11 -0
  68. package/dist/toolkit/contest/ContestCategorySchema.d.ts.map +1 -0
  69. package/dist/toolkit/contest/ContestCategorySchema.js +6 -0
  70. package/dist/toolkit/contest/ContestCategorySchema.js.map +1 -0
  71. package/dist/toolkit/contest/ContestLogbook.d.ts +223 -0
  72. package/dist/toolkit/contest/ContestLogbook.d.ts.map +1 -0
  73. package/dist/toolkit/contest/ContestLogbook.js +845 -0
  74. package/dist/toolkit/contest/ContestLogbook.js.map +1 -0
  75. package/dist/toolkit/contest/ContestQsoEnvelopeAdapter.d.ts +28 -0
  76. package/dist/toolkit/contest/ContestQsoEnvelopeAdapter.d.ts.map +1 -0
  77. package/dist/toolkit/contest/ContestQsoEnvelopeAdapter.js +79 -0
  78. package/dist/toolkit/contest/ContestQsoEnvelopeAdapter.js.map +1 -0
  79. package/dist/toolkit/contest/ContestQsoProjector.d.ts +12 -0
  80. package/dist/toolkit/contest/ContestQsoProjector.d.ts.map +1 -0
  81. package/dist/toolkit/contest/ContestQsoProjector.js +13 -0
  82. package/dist/toolkit/contest/ContestQsoProjector.js.map +1 -0
  83. package/dist/toolkit/contest/ContestSessionNotifier.d.ts +9 -0
  84. package/dist/toolkit/contest/ContestSessionNotifier.d.ts.map +1 -0
  85. package/dist/toolkit/contest/ContestSessionNotifier.js +13 -0
  86. package/dist/toolkit/contest/ContestSessionNotifier.js.map +1 -0
  87. package/dist/toolkit/contest/ContestSessionRepository.d.ts +21 -0
  88. package/dist/toolkit/contest/ContestSessionRepository.d.ts.map +1 -0
  89. package/dist/toolkit/contest/ContestSessionRepository.js +27 -0
  90. package/dist/toolkit/contest/ContestSessionRepository.js.map +1 -0
  91. package/dist/toolkit/contest/DefaultContestSession.d.ts +105 -0
  92. package/dist/toolkit/contest/DefaultContestSession.d.ts.map +1 -0
  93. package/dist/toolkit/contest/DefaultContestSession.js +387 -0
  94. package/dist/toolkit/contest/DefaultContestSession.js.map +1 -0
  95. package/dist/toolkit/contest/DefaultContestWorkbench.d.ts +100 -0
  96. package/dist/toolkit/contest/DefaultContestWorkbench.d.ts.map +1 -0
  97. package/dist/toolkit/contest/DefaultContestWorkbench.js +33 -0
  98. package/dist/toolkit/contest/DefaultContestWorkbench.js.map +1 -0
  99. package/dist/toolkit/contest/FT8ContestDefinition.d.ts +83 -0
  100. package/dist/toolkit/contest/FT8ContestDefinition.d.ts.map +1 -0
  101. package/dist/toolkit/contest/FT8ContestDefinition.js +167 -0
  102. package/dist/toolkit/contest/FT8ContestDefinition.js.map +1 -0
  103. package/dist/toolkit/contest/FT8ContestModules.d.ts +178 -0
  104. package/dist/toolkit/contest/FT8ContestModules.d.ts.map +1 -0
  105. package/dist/toolkit/contest/FT8ContestModules.js +247 -0
  106. package/dist/toolkit/contest/FT8ContestModules.js.map +1 -0
  107. package/dist/toolkit/contest/FT8ContestPlugin.d.ts +55 -0
  108. package/dist/toolkit/contest/FT8ContestPlugin.d.ts.map +1 -0
  109. package/dist/toolkit/contest/FT8ContestPlugin.js +322 -0
  110. package/dist/toolkit/contest/FT8ContestPlugin.js.map +1 -0
  111. package/dist/toolkit/contest/FT8ContestTestKit.d.ts +12 -0
  112. package/dist/toolkit/contest/FT8ContestTestKit.d.ts.map +1 -0
  113. package/dist/toolkit/contest/FT8ContestTestKit.js +60 -0
  114. package/dist/toolkit/contest/FT8ContestTestKit.js.map +1 -0
  115. package/dist/toolkit/contest/contest-toolkit.test.d.ts +2 -0
  116. package/dist/toolkit/contest/contest-toolkit.test.d.ts.map +1 -0
  117. package/dist/toolkit/contest/contest-toolkit.test.js +1196 -0
  118. package/dist/toolkit/contest/contest-toolkit.test.js.map +1 -0
  119. package/dist/toolkit/contest/index.d.ts +14 -0
  120. package/dist/toolkit/contest/index.d.ts.map +1 -0
  121. package/dist/toolkit/contest/index.js +14 -0
  122. package/dist/toolkit/contest/index.js.map +1 -0
  123. package/dist/toolkit/index.d.ts +3 -0
  124. package/dist/toolkit/index.d.ts.map +1 -0
  125. package/dist/toolkit/index.js +3 -0
  126. package/dist/toolkit/index.js.map +1 -0
  127. package/dist/toolkit/parallel-qso/AuthorizationLease.d.ts +15 -0
  128. package/dist/toolkit/parallel-qso/AuthorizationLease.d.ts.map +1 -0
  129. package/dist/toolkit/parallel-qso/AuthorizationLease.js +25 -0
  130. package/dist/toolkit/parallel-qso/AuthorizationLease.js.map +1 -0
  131. package/dist/toolkit/parallel-qso/BoundedCallSessionController.d.ts +40 -0
  132. package/dist/toolkit/parallel-qso/BoundedCallSessionController.d.ts.map +1 -0
  133. package/dist/toolkit/parallel-qso/BoundedCallSessionController.js +81 -0
  134. package/dist/toolkit/parallel-qso/BoundedCallSessionController.js.map +1 -0
  135. package/dist/toolkit/parallel-qso/BoundedCallSessionController.test.d.ts +2 -0
  136. package/dist/toolkit/parallel-qso/BoundedCallSessionController.test.d.ts.map +1 -0
  137. package/dist/toolkit/parallel-qso/BoundedCallSessionController.test.js +31 -0
  138. package/dist/toolkit/parallel-qso/BoundedCallSessionController.test.js.map +1 -0
  139. package/dist/toolkit/parallel-qso/CompletionTracker.d.ts +20 -0
  140. package/dist/toolkit/parallel-qso/CompletionTracker.d.ts.map +1 -0
  141. package/dist/toolkit/parallel-qso/CompletionTracker.js +20 -0
  142. package/dist/toolkit/parallel-qso/CompletionTracker.js.map +1 -0
  143. package/dist/toolkit/parallel-qso/LaneFrequencyController.d.ts +19 -0
  144. package/dist/toolkit/parallel-qso/LaneFrequencyController.d.ts.map +1 -0
  145. package/dist/toolkit/parallel-qso/LaneFrequencyController.js +23 -0
  146. package/dist/toolkit/parallel-qso/LaneFrequencyController.js.map +1 -0
  147. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.d.ts +134 -0
  148. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.d.ts.map +1 -0
  149. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.js +554 -0
  150. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.js.map +1 -0
  151. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.test.d.ts +2 -0
  152. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.test.d.ts.map +1 -0
  153. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.test.js +470 -0
  154. package/dist/toolkit/parallel-qso/ParallelQSOCoordinator.test.js.map +1 -0
  155. package/dist/toolkit/parallel-qso/PostCompletionRecoveryLease.d.ts +20 -0
  156. package/dist/toolkit/parallel-qso/PostCompletionRecoveryLease.d.ts.map +1 -0
  157. package/dist/toolkit/parallel-qso/PostCompletionRecoveryLease.js +29 -0
  158. package/dist/toolkit/parallel-qso/PostCompletionRecoveryLease.js.map +1 -0
  159. package/dist/toolkit/parallel-qso/ProtocolLane.d.ts +50 -0
  160. package/dist/toolkit/parallel-qso/ProtocolLane.d.ts.map +1 -0
  161. package/dist/toolkit/parallel-qso/ProtocolLane.js +2 -0
  162. package/dist/toolkit/parallel-qso/ProtocolLane.js.map +1 -0
  163. package/dist/toolkit/parallel-qso/controllers.test.d.ts +2 -0
  164. package/dist/toolkit/parallel-qso/controllers.test.d.ts.map +1 -0
  165. package/dist/toolkit/parallel-qso/controllers.test.js +36 -0
  166. package/dist/toolkit/parallel-qso/controllers.test.js.map +1 -0
  167. package/dist/toolkit/parallel-qso/index.d.ts +8 -0
  168. package/dist/toolkit/parallel-qso/index.d.ts.map +1 -0
  169. package/dist/toolkit/parallel-qso/index.js +8 -0
  170. package/dist/toolkit/parallel-qso/index.js.map +1 -0
  171. package/dist/utils/adif.d.ts +1 -1
  172. package/dist/utils/adif.d.ts.map +1 -1
  173. package/dist/utils/adif.js +96 -51
  174. package/dist/utils/adif.js.map +1 -1
  175. package/dist/utils/qso-text-fields.d.ts +7 -1
  176. package/dist/utils/qso-text-fields.d.ts.map +1 -1
  177. package/dist/utils/qso-text-fields.js +74 -6
  178. package/dist/utils/qso-text-fields.js.map +1 -1
  179. package/package.json +28 -6
  180. package/src/bridge.d.ts +3 -0
  181. package/tokens.css +51 -0
package/dist/context.d.ts CHANGED
@@ -1,7 +1,15 @@
1
- import type { KVStore, PluginLogger, PluginTimers, OperatorControl, RadioControl, LogbookAccess, BandAccess, UIBridge, PluginFileStore, PluginNetworkControl } from './helpers.js';
1
+ import type { KVStore, ReadonlyKVStore, PluginLogger, PluginTimers, OperatorSnapshot, OperatorCommandPort, RadioView, RadioCapabilitiesView, RadioCommandPort, RadioTunerCommandPort, RadioPowerView, RadioPowerCommandPort, LogbookReadAccess, LogbookAccess, PluginLogbookSessions, BandAccess, UIBridge, PluginFileStore, PluginNetworkControl, PluginEventBus } from './helpers.js';
2
+ import type { PluginPermission } from '@tx5dr/contracts';
2
3
  import type { LogbookSyncRegistrar } from './sync.js';
3
4
  import type { HostSettingsControl } from './settings.js';
4
5
  import type { HostDependencies } from './host-dependencies.js';
6
+ /** A cancellable task started by Host after the core server is ready. */
7
+ export type PluginAfterStartupTask = (signal: AbortSignal) => void | Promise<void>;
8
+ /** Host-owned lifecycle services that do not block the initial plugin load. */
9
+ export interface PluginLifecyclePort {
10
+ /** Schedule idempotent plugin work for the first post-startup turn. */
11
+ scheduleAfterStartup(id: string, task: PluginAfterStartupTask): () => void;
12
+ }
5
13
  /**
6
14
  * Runtime services exposed to a plugin instance.
7
15
  *
@@ -15,12 +23,15 @@ import type { HostDependencies } from './host-dependencies.js';
15
23
  * here, plugin code should treat it as unavailable rather than reaching into
16
24
  * TX-5DR internals.
17
25
  */
18
- export interface PluginContext {
26
+ export interface PluginContextBase {
27
+ /** Bundled Plugin API version. Use plugin declarations for compatibility checks. */
28
+ readonly pluginApiVersion: string;
19
29
  /**
20
30
  * Resolved plugin configuration values.
21
31
  *
22
- * The host validates and persists settings, then injects the final values into
23
- * this readonly map before invoking hooks or lifecycle methods. Use
32
+ * The host validates and persists settings, then supplies a detached snapshot
33
+ * before invoking hooks or lifecycle methods. Mutating nested values does not
34
+ * update persistence; call {@link PluginContextBase.updateConfig} instead. Use
24
35
  * {@link PluginHooks.onConfigChange} to react to updates.
25
36
  */
26
37
  readonly config: Readonly<Record<string, unknown>>;
@@ -50,6 +61,8 @@ export interface PluginContext {
50
61
  */
51
62
  readonly operator: KVStore;
52
63
  };
64
+ /** Read-only validation for exact FT8/FT4 message encoding. */
65
+ readonly digitalMessagePreflight: import('./helpers.js').DigitalMessagePreflight;
53
66
  /**
54
67
  * Structured logger scoped to the plugin.
55
68
  *
@@ -64,24 +77,12 @@ export interface PluginContext {
64
77
  * prefer this over raw `setInterval` calls inside plugin code.
65
78
  */
66
79
  readonly timers: PluginTimers;
80
+ /** Read-only snapshot and query surface for the current operator. */
81
+ readonly operator: OperatorSnapshot;
67
82
  /**
68
- * Control surface for the current operator.
69
- */
70
- readonly operator: OperatorControl;
71
- /**
72
- * Access to the physical radio state and tuning controls.
83
+ * Read-only projection of the physical radio state.
73
84
  */
74
- readonly radio: RadioControl;
75
- /**
76
- * Full logbook access — read-only queries, record writes and UI notifications.
77
- *
78
- * Provides the original read-only helpers (`hasWorked`, `hasWorkedDXCC`,
79
- * `hasWorkedGrid`) plus advanced query (`queryQSOs`, `countQSOs`), write
80
- * (`addQSO`, `updateQSO`) and notification (`notifyUpdated`) capabilities.
81
- * Sync providers and other data-oriented plugins use the write methods to
82
- * self-orchestrate their flow without host-side special handling.
83
- */
84
- readonly logbook: LogbookAccess;
85
+ readonly radio: RadioView;
85
86
  /**
86
87
  * Read-only access to current-band and slot decode data.
87
88
  */
@@ -100,41 +101,111 @@ export interface PluginContext {
100
101
  */
101
102
  readonly files: PluginFileStore;
102
103
  /**
103
- * Logbook sync registration entry point.
104
- *
105
- * Utility plugins that implement logbook synchronization call
106
- * `ctx.logbookSync.register(provider)` during `onLoad` to register their
107
- * sync provider. The host manages the provider lifecycle and UI integration.
104
+ * Schedules optional initialization after the core server is ready.
105
+ * Registration is synchronous; the task is cancelled automatically when the
106
+ * plugin instance is unloaded.
108
107
  */
108
+ readonly lifecycle: PluginLifecyclePort;
109
+ }
110
+ type CapabilityProperty<Permissions extends readonly PluginPermission[], Permission extends PluginPermission, Property extends object> = number extends Permissions['length'] ? object : Permission extends Permissions[number] ? Property : object;
111
+ type SettingsCapability<Permissions extends readonly PluginPermission[]> = number extends Permissions['length'] ? object : Extract<Permissions[number], `settings:${string}`> extends never ? object : {
112
+ readonly settings: CapabilityProperty<Permissions, 'settings:ft8', Pick<HostSettingsControl, 'ft8'>> & CapabilityProperty<Permissions, 'settings:decode-windows', Pick<HostSettingsControl, 'decodeWindows'>> & CapabilityProperty<Permissions, 'settings:realtime', Pick<HostSettingsControl, 'realtime'>> & CapabilityProperty<Permissions, 'settings:frequency-presets', Pick<HostSettingsControl, 'frequencyPresets'>> & CapabilityProperty<Permissions, 'settings:station', Pick<HostSettingsControl, 'station'>> & CapabilityProperty<Permissions, 'settings:psk-reporter', Pick<HostSettingsControl, 'pskReporter'>> & CapabilityProperty<Permissions, 'settings:ntp', Pick<HostSettingsControl, 'ntp'>>;
113
+ };
114
+ type MainLogbookCapability<Permissions extends readonly PluginPermission[]> = 'logbook:write' extends Permissions[number] ? LogbookAccess : 'logbook:read' extends Permissions[number] ? LogbookReadAccess : object;
115
+ type SessionLogbookCapability<Permissions extends readonly PluginPermission[]> = 'logbook:session' extends Permissions[number] ? {
116
+ readonly sessions: PluginLogbookSessions;
117
+ } : object;
118
+ type LogbookCapability<Permissions extends readonly PluginPermission[]> = number extends Permissions['length'] ? object : Extract<Permissions[number], 'logbook:read' | 'logbook:write' | 'logbook:session'> extends never ? object : {
119
+ readonly logbook: MainLogbookCapability<Permissions> & SessionLogbookCapability<Permissions>;
120
+ };
121
+ /**
122
+ * Plugin context whose privileged ports are derived from literal manifest
123
+ * permissions. Capabilities that were not declared do not exist in the type.
124
+ *
125
+ * Host handles are invocation-scoped. In particular, a `Response` returned by
126
+ * `ctx.fetch` and its Headers/body reader must be consumed before the current
127
+ * Host callback settles; retaining the native handle for later use results in
128
+ * `PLUGIN_INVOCATION_EXPIRED`.
129
+ */
130
+ export type PluginContextFor<Permissions extends readonly PluginPermission[]> = PluginContextBase & CapabilityProperty<Permissions, 'operator:transmit-control', {
131
+ readonly operatorCommands: OperatorCommandPort;
132
+ }> & CapabilityProperty<Permissions, 'radio:read', {
133
+ readonly radioCapabilities: RadioCapabilitiesView;
134
+ readonly radioPower: RadioPowerView;
135
+ }> & CapabilityProperty<Permissions, 'radio:control', {
136
+ readonly radioCommands: RadioCommandPort;
137
+ }> & CapabilityProperty<Permissions, 'radio:tuner-control', {
138
+ readonly radioTunerCommands: RadioTunerCommandPort;
139
+ }> & CapabilityProperty<Permissions, 'radio:power', {
140
+ readonly radioPowerCommands: RadioPowerCommandPort;
141
+ }> & LogbookCapability<Permissions> & CapabilityProperty<Permissions, 'logbook:sync', {
109
142
  readonly logbookSync: LogbookSyncRegistrar;
110
- /**
111
- * Permission-gated host settings control surface.
112
- *
113
- * Each namespace requires the matching `settings:*` manifest permission.
114
- */
115
- readonly settings: HostSettingsControl;
116
- /**
117
- * Permission-gated network capabilities.
118
- *
119
- * UDP sockets are host-managed and automatically closed when the plugin
120
- * instance unloads. This is intentionally protocol-agnostic; protocol codecs
121
- * such as WSJT-X UDP belong inside plugins.
122
- */
123
- readonly network?: PluginNetworkControl;
124
- /**
125
- * Host-owned runtime dependencies exposed to plugins.
126
- *
127
- * Native dependencies such as Hamlib are loaded by the host process. Each
128
- * dependency is optional and requires its own manifest permission; feature
129
- * detect before use.
130
- */
131
- readonly hostDependencies: HostDependencies;
132
- /**
133
- * Permission-gated HTTP client.
134
- *
135
- * This method is only available when the plugin declares the corresponding
136
- * network permission. Treat it as optional and feature-detect before calling.
137
- */
138
- readonly fetch?: (url: string, init?: RequestInit) => Promise<Response>;
143
+ }> & SettingsCapability<Permissions> & CapabilityProperty<Permissions, 'network', {
144
+ readonly network: PluginNetworkControl;
145
+ readonly fetch: (url: string, init?: RequestInit) => Promise<Response>;
146
+ }> & CapabilityProperty<Permissions, 'plugin:event-bus', {
147
+ readonly eventBus: PluginEventBus;
148
+ }> & CapabilityProperty<Permissions, 'host:hamlib', {
149
+ readonly hostDependencies: HostDependencies & Required<Pick<HostDependencies, 'hamlib'>>;
150
+ }>;
151
+ /** Safe default context for code that has not declared literal permissions. */
152
+ export type PluginContext = PluginContextFor<readonly []>;
153
+ /**
154
+ * Teardown-only context passed to `onUnload`.
155
+ *
156
+ * Cleanup may inspect the read-only operator state, flush plugin-owned state
157
+ * and release plugin-owned files. The Host also permits previously acquired
158
+ * native-resource and UI handles to finish cleanup, but does not reopen radio,
159
+ * network, event-bus, logbook or command capabilities while the instance is
160
+ * being revoked.
161
+ */
162
+ export type PluginCleanupContext = Pick<PluginContextBase, 'store' | 'log' | 'timers' | 'files' | 'operator' | 'lifecycle'>;
163
+ /** Host-side erased runtime shape. Public plugin definitions should use `definePlugin()`. */
164
+ export type RuntimePluginContext = PluginContextBase & Partial<{
165
+ operatorCommands: OperatorCommandPort;
166
+ radioCapabilities: RadioCapabilitiesView;
167
+ radioCommands: RadioCommandPort;
168
+ radioTunerCommands: RadioTunerCommandPort;
169
+ radioPower: RadioPowerView;
170
+ radioPowerCommands: RadioPowerCommandPort;
171
+ logbook: LogbookReadAccess | LogbookAccess | {
172
+ readonly sessions: PluginLogbookSessions;
173
+ };
174
+ logbookSync: LogbookSyncRegistrar;
175
+ settings: Partial<HostSettingsControl>;
176
+ network: PluginNetworkControl;
177
+ eventBus: PluginEventBus;
178
+ hostDependencies: HostDependencies;
179
+ fetch: (url: string, init?: RequestInit) => Promise<Response>;
180
+ }>;
181
+ /**
182
+ * Deliberately narrow context captured by a speculative strategy runtime.
183
+ * Decisions can inspect operator state and emit a result, but cannot retain a
184
+ * command, radio, logbook-write, network, timer or UI capability.
185
+ */
186
+ export interface StrategyPluginContext {
187
+ /** Bundled Plugin API version available before the strategy runtime is created. */
188
+ readonly pluginApiVersion: string;
189
+ /** Detached snapshot of the strategy plugin's resolved configuration. */
190
+ readonly config: Readonly<Record<string, unknown>>;
191
+ /** Logger scoped to this strategy instance. */
192
+ readonly log: PluginLogger;
193
+ /** Read-only operator snapshot; mutation ports are deliberately absent. */
194
+ readonly operator: OperatorSnapshot;
195
+ /** Read-only projection of the current radio band and operating mode. */
196
+ readonly radio: RadioView;
197
+ /** Live, read-only views of the storage scopes declared by this plugin. */
198
+ readonly store: {
199
+ readonly global: ReadonlyKVStore;
200
+ readonly operator: ReadonlyKVStore;
201
+ };
202
+ /** Read-only exact-message encoding validation. */
203
+ readonly digitalMessagePreflight: import('./helpers.js').DigitalMessagePreflight;
204
+ }
205
+ /** Minimal context used to evaluate a transmit-control eligibility predicate. */
206
+ export interface PluginEligibilityContext {
207
+ /** Current detached configuration snapshot used by the synchronous gate. */
208
+ readonly config: Readonly<Record<string, unknown>>;
139
209
  }
210
+ export {};
140
211
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,eAAe,EACf,oBAAoB,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnD;;;;;;;;OAQG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE;QACd;;WAEG;QACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAEzB;;WAEG;QACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;KAC5B,CAAC;IAEF;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAE3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAE7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,EAA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AAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD"}
@@ -1,7 +1,8 @@
1
1
  import type { PluginSettingDescriptor, PluginQuickAction, PluginQuickSetting, PluginPanelDescriptor, PluginPermission, PluginType, PluginInstanceScope, PluginUIPageDescriptor } from '@tx5dr/contracts';
2
- import type { PluginContext } from './context.js';
2
+ import type { PluginCleanupContext, PluginContextFor, PluginEligibilityContext, StrategyPluginContext } from './context.js';
3
3
  import type { PluginHooks } from './hooks.js';
4
4
  import type { StrategyRuntime } from './runtime.js';
5
+ import type { SimulationScenarioDescriptor } from './simulation.js';
5
6
  /**
6
7
  * Describes a TX-5DR plugin module.
7
8
  *
@@ -21,32 +22,43 @@ import type { StrategyRuntime } from './runtime.js';
21
22
  *
22
23
  * @example
23
24
  * ```js
24
- * /** @type {import('@tx5dr/plugin-api').PluginDefinition} *\/
25
- * export default {
25
+ * import { definePlugin } from '@tx5dr/plugin-api';
26
+ *
27
+ * export default definePlugin({
28
+ * apiVersion: 2,
26
29
  * name: 'my-plugin',
27
30
  * version: '1.0.0',
28
31
  * type: 'utility',
29
32
  * description: 'Annotates interesting decoded stations.',
33
+ * permissions: [],
30
34
  * hooks: {
31
35
  * onDecode(messages, ctx) {
32
36
  * ctx.log.info('decoded', { count: messages.length });
33
37
  * },
34
38
  * },
35
- * };
39
+ * });
36
40
  * ```
37
41
  *
38
42
  * @example
39
43
  * ```ts
40
- * import type { PluginDefinition } from '@tx5dr/plugin-api';
44
+ * import { definePlugin } from '@tx5dr/plugin-api';
41
45
  *
42
- * const plugin: PluginDefinition = {
46
+ * export default definePlugin({
47
+ * apiVersion: 2,
43
48
  * name: 'my-strategy',
44
49
  * version: '1.0.0',
45
50
  * type: 'strategy',
46
- * createStrategyRuntime(ctx) {
51
+ * createStrategyRuntime() {
47
52
  * return {
53
+ * checkpoint() {
54
+ * return {};
55
+ * },
56
+ * restore() {},
48
57
  * decide() {
49
- * return { stop: false };
58
+ * return {
59
+ * transmission: null,
60
+ * snapshot: this.getSnapshot(),
61
+ * };
50
62
  * },
51
63
  * getTransmitText() {
52
64
  * return null;
@@ -61,12 +73,18 @@ import type { StrategyRuntime } from './runtime.js';
61
73
  * reset() {},
62
74
  * };
63
75
  * },
64
- * };
65
- *
66
- * export default plugin;
76
+ * });
67
77
  * ```
68
78
  */
69
- export interface PluginDefinition {
79
+ export interface PluginDefinition<Permissions extends readonly PluginPermission[] = readonly []> {
80
+ /**
81
+ * Public API contract version. All new plugins should use `2`.
82
+ *
83
+ * API v2 is required for strategy plugins and for utility plugins that request
84
+ * any mutation capability: `operator:transmit-control`, `radio:control`,
85
+ * `radio:tuner-control`, `radio:power`, `logbook:write` or `logbook:sync`.
86
+ */
87
+ apiVersion?: 2;
70
88
  /**
71
89
  * Stable machine-readable plugin identifier.
72
90
  *
@@ -82,6 +100,13 @@ export interface PluginDefinition {
82
100
  * valid semver string makes diagnostics and upgrades much easier.
83
101
  */
84
102
  version: string;
103
+ /**
104
+ * Oldest bundled `@tx5dr/plugin-api` version that can safely load this plugin.
105
+ *
106
+ * This is independent from the TX-5DR product/nightly version. Marketplace
107
+ * artifacts must declare it and match their catalog entry.
108
+ */
109
+ minPluginApiVersion?: string;
85
110
  /**
86
111
  * Declares how the host should schedule and combine this plugin.
87
112
  *
@@ -91,11 +116,31 @@ export interface PluginDefinition {
91
116
  * do not own the core automation state machine.
92
117
  */
93
118
  type: PluginType;
119
+ /** Optional strategy capabilities advertised to Host UI and routing. */
120
+ strategyFeatures?: {
121
+ /** Declares the `QueuedStrategyRuntime` assisted-target queue contract. */
122
+ targetQueue?: 1;
123
+ /** Declares support for more than one active target lane. */
124
+ parallelTargetQueue?: 1;
125
+ /** Controls whether enqueueing may start a stopped operator. */
126
+ queueActivation?: 'immediate' | 'operator-toggle';
127
+ /** Blocks unscoped plugin commands; the strategy may consume its own audited operator authorization. */
128
+ manualInitiation?: 1;
129
+ /** Strategy-specific cap applied in addition to the operator cap. */
130
+ maxConcurrentStreams?: number;
131
+ /** Maximum signals that may be emitted in one physical frame. */
132
+ maxSimultaneousSignals?: number;
133
+ };
134
+ /** Development-only virtual-radio peer scenarios. The Host owns execution and RF safety. */
135
+ simulationScenarios?: SimulationScenarioDescriptor[];
94
136
  /**
95
137
  * Controls whether the host creates one instance per operator or a single
96
138
  * shared instance for the whole station.
97
139
  *
98
140
  * Defaults to `operator` when omitted.
141
+ * Global scope is utility-only. It cannot use operator-scoped settings or
142
+ * quick settings, and only global-compatible hooks/panels are accepted by the
143
+ * loader. Use it for station-wide sync, network services and radio policy.
99
144
  */
100
145
  instanceScope?: PluginInstanceScope;
101
146
  /**
@@ -111,7 +156,7 @@ export interface PluginDefinition {
111
156
  * Permissions allow the host to gate sensitive features such as network
112
157
  * access. Always declare the smallest set that the plugin truly needs.
113
158
  */
114
- permissions?: PluginPermission[];
159
+ permissions?: Permissions;
115
160
  /**
116
161
  * Declarative settings schema for generated configuration forms.
117
162
  *
@@ -149,12 +194,16 @@ export interface PluginDefinition {
149
194
  *
150
195
  * Each panel has a `slot` that controls where it renders: `'operator'` (the
151
196
  * default, shown in the operator card), `'automation'` (shown in the
152
- * top-right automation popover), `'main-right'` (the optional far-right main
197
+ * top-right automation popover), `'operator-action'` (an icon-and-text page
198
+ * action beside the operator logbook button), `'main-right'` (the optional far-right main
153
199
  * pane), `'voice-left-top'` (above the voice frequency card),
154
200
  * `'voice-right-top'` (the tabbed top area of the voice right panel),
155
201
  * `'cw-left-top'` (above the CW frequency card),
156
202
  * `'cw-right-top'` (the tabbed top area of the CW right panel), or
157
203
  * `'radio-control-toolbar'` (a global utility iframe button in RadioControl).
204
+ * An `operator-action` panel must use `component: 'iframe'` and
205
+ * `openMode: 'page'`; the Host binds it to that operator and opens the
206
+ * referenced custom UI as a standalone page.
158
207
  * Panels may also declare a preferred `width`, such as `'full'`, so hosts can
159
208
  * promote more important live panels.
160
209
  */
@@ -195,15 +244,15 @@ export interface PluginDefinition {
195
244
  * should be omitted for utility plugins. The returned runtime becomes the
196
245
  * operator's active automation controller.
197
246
  */
198
- createStrategyRuntime?(ctx: PluginContext): StrategyRuntime;
247
+ createStrategyRuntime?(ctx: StrategyPluginContext): StrategyRuntime;
199
248
  /**
200
249
  * Runs after the plugin instance has been loaded and the context is ready.
201
250
  *
202
- * Use this for startup work such as warming caches, scheduling timers or
203
- * sending initial panel data. Keep it fast; long-running work should be
204
- * deferred or done asynchronously.
251
+ * Use this for startup work such as warming caches, scheduling Host timers or
252
+ * sending initial panel data. Await required asynchronous work before returning;
253
+ * do not detach continuations that retain Host capabilities after the callback.
205
254
  */
206
- onLoad?(ctx: PluginContext): void | Promise<void>;
255
+ onLoad?(ctx: PluginContextFor<Permissions>): void | Promise<void>;
207
256
  /**
208
257
  * Runs before the plugin instance is unloaded.
209
258
  *
@@ -211,13 +260,41 @@ export interface PluginDefinition {
211
260
  * handled through the host abstractions. Any timers created via
212
261
  * {@link PluginContext.timers} are cleared automatically by the host.
213
262
  */
214
- onUnload?(ctx: PluginContext): void | Promise<void>;
263
+ onUnload?(ctx: PluginCleanupContext): void | Promise<void>;
215
264
  /**
216
265
  * Event and pipeline hooks implemented by the plugin.
217
266
  *
218
267
  * Hooks let utility plugins observe or transform the message flow, and let the
219
268
  * active strategy participate in decision making.
220
269
  */
221
- hooks?: PluginHooks;
270
+ hooks?: PluginHooks<Permissions>;
271
+ /**
272
+ * Safety gate for the operator command port.
273
+ *
274
+ * Plugins that declare `operator:transmit-control` must implement this or
275
+ * {@link isAutoCallEnabled}. The host evaluates it immediately before each
276
+ * command so disabled remote-control or integration features cannot retain
277
+ * command authority.
278
+ */
279
+ isTransmitControlEnabled?(ctx: PluginEligibilityContext): boolean;
280
+ /**
281
+ * Marks an operator-scoped plugin as an automatic calling controller and
282
+ * reports whether that behavior is currently enabled.
283
+ *
284
+ * The host uses this declaration for the auto-call indicator and pause UI.
285
+ * It also acts as the command-port safety gate when
286
+ * {@link isTransmitControlEnabled} is omitted. Integrations that can submit
287
+ * occasional external commands but are not auto-call controllers should
288
+ * implement only {@link isTransmitControlEnabled}.
289
+ */
290
+ isAutoCallEnabled?(ctx: PluginEligibilityContext): boolean;
222
291
  }
292
+ /** Type-erased plugin definition used by the host after module loading. */
293
+ export type AnyPluginDefinition = PluginDefinition<any>;
294
+ /**
295
+ * Defines a plugin while preserving literal permissions for capability-aware
296
+ * callback context inference. New plugins should use this helper instead of
297
+ * widening their definition to `PluginDefinition`.
298
+ */
299
+ export declare function definePlugin<const Permissions extends readonly PluginPermission[] = readonly []>(definition: PluginDefinition<Permissions>): PluginDefinition<Permissions>;
223
300
  //# sourceMappingURL=definition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;OAOG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IAEpC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEjC;;;;;;;O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IG;AACH,wBAAgB,YAAY,CAC1B,KAAK,CAAC,WAAW,SAAS,SAAS,gBAAgB,EAAE,GAAG,SAAS,EAAE,EACnE,UAAU,EAAE,gBAAgB,CAAC,WAAW,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAE1E"}
@@ -1,2 +1,9 @@
1
- export {};
1
+ /**
2
+ * Defines a plugin while preserving literal permissions for capability-aware
3
+ * callback context inference. New plugins should use this helper instead of
4
+ * widening their definition to `PluginDefinition`.
5
+ */
6
+ export function definePlugin(definition) {
7
+ return definition;
8
+ }
2
9
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"AA8UA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAE1B,UAAyC;IACzC,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,142 @@
1
+ import type { PluginLogger } from '../helpers.js';
2
+ import type { QSOContext, ParsedFT8Message, QSORecord, FrameMessage, SlotInfo, OperatorSlots, OperatorConfig } from '@tx5dr/contracts';
3
+ import type { StrategyRuntime, StrategyRuntimeCheckpoint, StrategyRuntimeContext, StrategyRuntimeSlot, StrategyRuntimeSnapshot, StrategyRuntimeSlotContentUpdate } from '../runtime.js';
4
+ import type { StrategyDecision, QSOFailureInfo } from '../hooks.js';
5
+ import type { StrategyDecisionMetaV2, StrategyDecisionResult } from '../runtime.js';
6
+ export declare const STANDARD_QSO_TX6_MESSAGE_OVERRIDE_SETTING = "tx6MessageOverride";
7
+ export type StandardQSOOperatorConfig = OperatorConfig & {
8
+ autoReplyToDirectCallWhenStopped?: boolean;
9
+ skipTx1?: boolean;
10
+ distinguishWorkedStationsByBand?: boolean;
11
+ tx6MessageOverride?: string;
12
+ };
13
+ export declare function normalizeStandardQSOTx6MessageOverride(content: unknown, defaultMessage: string): string;
14
+ export declare function buildStandardQSODefaultTx6Message(config: Pick<OperatorConfig, 'myCallsign' | 'myGrid'>): string;
15
+ type SlotsIndex = 'TX1' | 'TX2' | 'TX3' | 'TX4' | 'TX5' | 'TX6';
16
+ type Slots = {
17
+ [key in SlotsIndex]: string;
18
+ };
19
+ export interface StandardQSOPluginOperator {
20
+ readonly config: StandardQSOOperatorConfig;
21
+ hasWorkedCallsign(callsign: string, options?: {
22
+ anyBand?: boolean;
23
+ }): Promise<boolean>;
24
+ isTargetBeingWorkedByOthers(targetCallsign: string): boolean;
25
+ notifySlotsUpdated?(slots: OperatorSlots): void;
26
+ notifyStateChanged?(state: string): void;
27
+ }
28
+ export interface StandardQSOActivationRequest {
29
+ callsign: string;
30
+ lastMessage?: {
31
+ message: FrameMessage;
32
+ slotInfo: SlotInfo;
33
+ };
34
+ }
35
+ export interface StandardQSOActivationResult {
36
+ accepted: boolean;
37
+ lifecycleEpoch: number;
38
+ initialSlot?: StrategyRuntimeSlot;
39
+ }
40
+ interface Post73RetryContext {
41
+ targetCallsign: string;
42
+ targetGrid?: string;
43
+ reportSent?: number;
44
+ reportReceived?: number;
45
+ actualFrequency?: number;
46
+ completedQSO?: QSORecord;
47
+ expiresAt: number;
48
+ }
49
+ export declare class StandardQSOPluginRuntime implements StrategyRuntime {
50
+ readonly operator: StandardQSOPluginOperator;
51
+ private state;
52
+ private slots;
53
+ private _context;
54
+ private tx6MessageOverride;
55
+ private lastConfigTx6MessageOverride;
56
+ private timeoutCycles;
57
+ callAttempts: number;
58
+ qsoStartTime?: number;
59
+ tx5TransmissionQueued: boolean;
60
+ private completedQSORecord?;
61
+ private pendingQSOCompletion?;
62
+ private qsoLifecycleEpoch;
63
+ private speculativeDecisionDepth;
64
+ post73RetryContext?: Post73RetryContext;
65
+ private qsoContextHistory;
66
+ private readonly MAX_CONTEXT_CACHE;
67
+ foxHash?: string;
68
+ readonly logger: PluginLogger;
69
+ constructor(operator: StandardQSOPluginOperator, logger?: PluginLogger);
70
+ private syncOperatorConfig;
71
+ get context(): QSOContext;
72
+ buildNoReplyFailure(reason: string, unansweredTransmissions: number, targetCallsign?: string | undefined): QSOFailureInfo | undefined;
73
+ buildProtocolTimeoutFailure(stage: 'TX2' | 'TX3' | 'TX4'): QSOFailureInfo | undefined;
74
+ changeState(state: SlotsIndex): Promise<void>;
75
+ prepareCompletedQSOEffect(): void;
76
+ private beginQsoLifecycle;
77
+ hasUnsettledQSOCompletion(): boolean;
78
+ beginQsoWithTarget(callsign: string, reason: string): void;
79
+ settleQSOCompletion(settlement: import('@tx5dr/plugin-api').StrategyQSOCompletionSettlement): void;
80
+ handleReceivedAndDicideNext(messages: ParsedFT8Message[], options?: {
81
+ isReDecision?: boolean;
82
+ }): Promise<StrategyDecision>;
83
+ handleTransmitSlot(): string | null;
84
+ onTransmissionQueued(transmission: string): void;
85
+ getInitialOutboundCallState(): SlotsIndex;
86
+ activateTarget(request: StandardQSOActivationRequest): StandardQSOActivationResult;
87
+ requestCall(callsign: string, lastMessage: {
88
+ message: FrameMessage;
89
+ slotInfo: SlotInfo;
90
+ } | undefined): boolean;
91
+ private requestCallInternal;
92
+ checkpoint(): StrategyRuntimeCheckpoint;
93
+ restore(checkpoint: StrategyRuntimeCheckpoint): void;
94
+ decide(messages: ParsedFT8Message[], meta: StrategyDecisionMetaV2): Promise<StrategyDecisionResult>;
95
+ getTransmitText(): string | null;
96
+ getIdleCQText(): string | null;
97
+ getSnapshot(): StrategyRuntimeSnapshot;
98
+ patchContext(patch: Partial<StrategyRuntimeContext>): void;
99
+ private canAcceptTargetCallsign;
100
+ setState(state: SlotsIndex): void;
101
+ setSlotContent(update: StrategyRuntimeSlotContentUpdate): void;
102
+ reset(reason?: string): void;
103
+ /**
104
+ * 获取当前所有时隙的内容
105
+ */
106
+ getSlots(): Slots;
107
+ /**
108
+ * 获取当前状态
109
+ */
110
+ getCurrentState(): SlotsIndex;
111
+ private updateTargetSlotsForSpecialCallsign;
112
+ updateSlots(): void;
113
+ /**
114
+ * 保存当前QSO上下文到历史缓存
115
+ */
116
+ private saveCurrentContext;
117
+ /**
118
+ * 从历史缓存恢复QSO上下文
119
+ */
120
+ restoreContext(targetCallsign: string): boolean;
121
+ armPost73RetryContext(): void;
122
+ clearPost73RetryContext(reason: string): void;
123
+ getActivePost73RetryContext(): Post73RetryContext | undefined;
124
+ restorePost73RetryContext(context: Post73RetryContext): void;
125
+ /**
126
+ * 清空QSO上下文
127
+ * 在QSO结束时调用,确保干净的下一次通联
128
+ */
129
+ clearQSOContext(): void;
130
+ resetRuntime(reason?: string): void;
131
+ private changeStateSafely;
132
+ /**
133
+ * 通知slots更新
134
+ */
135
+ private notifySlotsUpdated;
136
+ /**
137
+ * 通知状态变化
138
+ */
139
+ private notifyStateChanged;
140
+ }
141
+ export {};
142
+ //# sourceMappingURL=StandardQSOPluginRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardQSOPluginRuntime.d.ts","sourceRoot":"","sources":["../../src/ft8/StandardQSOPluginRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB,EAKhB,SAAS,EAGT,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACR,eAAe,EACf,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,gCAAgC,EACnC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACR,gBAAgB,EAChB,cAAc,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIpF,eAAO,MAAM,yCAAyC,uBAAuB,CAAC;AAE9E,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG;IACrD,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,OAAO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