Commit Graph

344 Commits

Author SHA1 Message Date
sjg ef6d45b878 [feat](trx-backend): add RegistrationContext for explicit initialization
Create explicit RegistrationContext type for backend factory registration
instead of relying solely on global mutable state.

New RegistrationContext:
- register_backend(name, factory) - register a backend
- is_backend_registered(name) - check if registered
- registered_backends() -> Vec<String> - list all backends
- build_rig(name, access) -> DynResult - instantiate a rig

Maintains global API for plugin compatibility, delegates to context.
Paves way for threading context through bootstrap in Phase 3B.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:47:19 +01:00
sjg 8425d0bab6 [chore](root): update Cargo.lock with trx-app dependency
Lock file updated after adding trx-app crate to workspace.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:41:25 +01:00
sjg 1a2ae96b6a [refactor](trx-client): use trx-app for shared infrastructure
Replace client's local implementations with unified trx-app utilities.

Changes:
- Use trx_app::normalize_name() instead of local fn
- Depend on trx-app crate

This eliminates the client's copy of the normalize_name logic and ensures
both server and client use the same implementation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:39:22 +01:00
sjg 5d83fba8f5 [refactor](trx-server): use trx-app for shared infrastructure
Replace server's local implementations with unified trx-app utilities.

Changes:
- Use trx_app::normalize_name() instead of local fn
- Depend on trx-app crate

This eliminates the server's copy of the normalize_name logic and ensures
both server and client use the same implementation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:39:20 +01:00
sjg 30bf0f56ac [feat](trx-app): create shared app infrastructure crate
Create new trx-app crate to consolidate 334 lines of duplicate
infrastructure code from server and client binaries.

Modules:
- plugins: load_plugins() - unified plugin discovery and loading
- util: normalize_name() - centralized name normalization
- config: ConfigFile trait - generic config loading with default paths
- logging: init_logging() - unified logging initialization

Benefits:
- Eliminates duplicate plugins.rs (232 lines, 100% identical)
- Single normalize_name() function (previously 4+ instances)
- ConfigFile trait enables consistent config handling
- log_level config field now usable (feature previously broken)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:39:17 +01:00
sjg 079313313d [refactor](trx-client): use RigState constructors
Replace duplicated RigState initialization with new constructor methods.

Changes:
- Use RigState::new_uninitialized() in main.rs
- Use RigState::from_snapshot() in remote_client.rs
- Remove standalone state_from_snapshot() function

These constructors eliminate 155 lines of duplicated struct literals
and provide clear semantics for different initialization contexts.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:37:15 +01:00
sjg ab53d3ae3b [refactor](trx-server): use RigState constructors and fix config bug
Replace duplicated RigState initialization with new constructor methods.
This fixes a critical bug where rig_task was hardcoding 144.3 MHz/USB
instead of respecting config.initial_freq_hz and config.initial_mode.

Changes:
- Use RigState::new_with_metadata() in main.rs
- Use RigState::new_with_metadata() in rig_task.rs (FIX: now respects config)
- Remove 45-line build_initial_state() helper function

The rig_task bug fix ensures the configured initial frequency and mode
are applied when the rig task starts, instead of always using defaults.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:37:12 +01:00
sjg 81195f2159 [feat](trx-core): add RigState constructors and Default impls
Add new constructors and Default trait implementations to consolidate
RigState initialization patterns. This eliminates 195 lines of duplicated
struct literals across server and client.

New methods:
- RigState::new_uninitialized() - for client-side initialization
- RigState::new_with_metadata() - for server-side with config values
- RigState::from_snapshot() - convert RigSnapshot to full state
- Default for RigStatus - 2m calling frequency (144.3 MHz) in USB mode
- Default for RigControl - disabled with no active repeater settings

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:37:08 +01:00
sjg da31275a30 [chore](root): add trx-protocol to workspace
Update workspace Cargo.toml to include new trx-protocol crate
and update Cargo.lock with new dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:27:50 +01:00
sjg 046449974e [refactor](trx-frontend-http-json): consolidate protocol logic with trx-protocol
Use centralized trx-protocol crate for:
- parse_mode and envelope parsing
- command mapping (ClientCommand -> RigCommand)
- token validation via RegistryTokenValidator wrapper

RegistryTokenValidator maintains compatibility with global auth
registry pattern while leveraging shared protocol logic from
trx-protocol. Removes duplicate auth and codec functions.

No behavior changes, all tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:27:47 +01:00
sjg e5004e9a67 [refactor](trx-client): consolidate protocol logic with trx-protocol
Use centralized trx-protocol::rig_command_to_client for command
conversion, eliminating 62 lines of duplicate code in mode handling
and command mapping logic.

Updates remote_client to delegate to trx-protocol for bidirectional
command conversion. No behavior changes, all tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:27:45 +01:00
sjg 8718a5d8d1 [refactor](trx-server): consolidate protocol logic with trx-protocol
Use centralized trx-protocol crate for:
- parse_mode and mode string parsing
- parse_envelope with fallback behavior
- command mapping (ClientCommand -> RigCommand)
- token validation with SimpleTokenValidator

Removes 116 lines of duplicate code. Wraps validator in Arc for
safe sharing across async tasks. No behavior changes, all tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:27:42 +01:00
sjg 6f9658375f [feat](trx-protocol): create protocol unification crate
Add new crate to centralize protocol conversion logic:
- codec module: mode parsing/formatting, envelope parsing
- auth module: token validation, bearer prefix handling
- mapping module: ClientCommand <-> RigCommand conversion

Includes 76 comprehensive tests covering all command variants,
error cases, and round-trip conversions. Removes duplication
across listener, remote_client, and HTTP-JSON frontend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:27:38 +01:00
sjg 8b28f3615f [chore](trx-ft8): suppress unused code warnings in external C library
Add compiler flags to suppress C warnings from vendored ft8_lib:
- -Wno-unused-const-variable for db_power_sum array
- -Wno-unused-function for ft8_decode_multi_symbols

These are harmless warnings from external code we don't control.
Suppressing at build system level keeps external code unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:14:06 +01:00
sjg cf67574571 [docs](trx-rs): remove appkit frontend references
Remove AppKit frontend mentions from documentation:
- Update AGENTS.md project structure
- Remove AppKit from capabilities table in OVERVIEW.md
- Remove AppKit from frontends table in OVERVIEW.md
- Remove AppKit from Frontends section in README.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:06:03 +01:00
sjg 55fde37924 [chore](trx-client): remove appkit frontend support
Remove macOS AppKit frontend (trx-frontend-appkit) and related code:
- Delete appkit crate directory
- Remove appkit dependency and feature from Cargo.toml
- Remove appkit imports, main thread handling, and config from main.rs
- Remove AppKit config struct from config.rs
- Remove appkit section from example config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 20:06:01 +01:00
sjg a53bd7a08f [docs](trx-rs): align AGENTS with contributing
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 19:57:05 +01:00
sjg a7ae47ff00 [chore](root): add git attrs and ignore
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-12 19:53:59 +01:00
sjg 2dfe4a30dc [feat](trx-backend): add ft450d cat backend
Co-authored-by: OpenAI <assistant@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 23:53:16 +01:00
sjg 176b3e306c [fix](trx-frontend-http): filter ft8 and refresh rf values
Co-authored-by: OpenAI <assistant@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 23:38:50 +01:00
sjg 3a739069c0 [fix](trx-frontend-http): avoid decode history deadlock
Co-authored-by: OpenAI <assistant@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 23:31:17 +01:00
sjg c24d5d0152 [fix](trx-frontend-http): persist decode history and fix ft8 locators
Co-authored-by: OpenAI <assistant@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 23:22:35 +01:00
sjg 211c3baf16 [fix](trx-frontend-http): send decode history on connect
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 23:17:44 +01:00
sjg 1bfc23fec7 [fix](trx-frontend-http): tokenize ft8 grids reliably
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 22:15:24 +01:00
sjg a8f7e9c8de Revert "[fix](trx-frontend-http): normalize ft8 locator spacing"
This reverts commit 5aa9502e37.
2026-02-09 22:15:00 +01:00
sjg 5aa9502e37 [fix](trx-frontend-http): normalize ft8 locator spacing
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 22:14:22 +01:00
sjg dc376c9afb [fix](trx-frontend-http): detect ft8 grids by scan
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 22:11:37 +01:00
sjg 0073f11c15 [fix](trx-frontend-http): robust ft8 grid highlighting
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 22:09:49 +01:00
sjg 2b6df0e738 [fix](trx-frontend-http): highlight ft8 grid tokens
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 22:06:39 +01:00
sjg 44a4c0df24 [fix](trx-frontend-http): parse ft8 locators reliably
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 22:04:12 +01:00
sjg bfc5e531cc [feat](trx-frontend-http): add ft8 locators and map filters
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:50:23 +01:00
sjg dbb58fa2b7 [feat](trx-frontend-http): add ft8 headers and rf freq
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:44:50 +01:00
sjg 0e856073be [docs](trx-frontend-http): add ft8 to overview
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:43:37 +01:00
sjg 9f2306aa71 [fix](trx-ft8): correct result buffer size
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:41:53 +01:00
sjg 995ddd7306 [fix](trx-ft8): align decode result layout
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:41:08 +01:00
sjg 4d32f017a8 [chore](trx-server): log ft8 toggle and offsets
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:38:18 +01:00
sjg 55693bb6e8 [fix](trx-server): align ft8 decode to time slots
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:35:51 +01:00
sjg a4a3f1464e [fix](trx-ft8): enable stpcpy on linux
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:31:39 +01:00
sjg 5f3ea48ef7 [chore](trx-rs): address clippy warnings
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:26:53 +01:00
sjg cf11c16096 [fix](trx-ft8): make decoder Send
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:25:19 +01:00
sjg c4ca178097 [fix](trx-ft8): make raw decode result copyable
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:23:52 +01:00
sjg 56041874da [fix](trx-ft8): update callsign hash constants
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:22:25 +01:00
sjg 1199ab85e9 [feat](trx-rs): add ft8 decoder
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 21:19:56 +01:00
sjg 7bd1a70607 [fix](trx-frontend-http): align cw controls
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 20:53:07 +01:00
sjg a22a648b5d [fix](trx-frontend-http-json): map cw control commands
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 20:51:55 +01:00
sjg 715e6eb9aa [fix](trx-core): handle cw control commands
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 20:51:14 +01:00
sjg 0daf9e27ae [feat](trx-rs): add cw auto/manual controls
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 20:50:31 +01:00
sjg dfc0f220e8 [feat](trx-frontend-http): show cw auto mode
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 19:58:10 +01:00
sjg f610bf7db3 [fix](trx-frontend-http): update decode status on mode change
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 19:54:32 +01:00
sjg b9c58844f0 [fix](trx-server): gate cw decode strictly by mode
Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
2026-02-09 19:50:08 +01:00