Files
trx-rs/.claude/settings.local.json
T
sjg 66163c7e7d [feat](trx-client): capability-gated UI controls and filter panel (UC-05..07)
Add /set_bandwidth and /set_fir_taps HTTP endpoints to api.rs.

Add applyCapabilities(caps) function to app.js that shows/hides:
- PTT button and TX meters: capabilities.tx
- TX limit row: capabilities.tx_limit
- VFO row: capabilities.vfo_switch
- Signal meter row: capabilities.signal_meter
- Filters panel: capabilities.filter_controls

Called from render() whenever capabilities are present; runs on both
initial /status response and every SSE event.

Add a Filters panel to index.html with bandwidth slider (1..500 kHz)
and FIR taps select (16/32/64/128/256); hidden by default, revealed by
applyCapabilities when filter_controls is set. Each control dispatches
to the corresponding HTTP endpoint on change.

Sync filter state from update.filter in render() to keep slider/select
in sync with server-side DSP state.

Fix missing struct fields in test helpers across remote_client.rs,
trx-frontend-http-json/server.rs, trx-frontend-rigctl/server.rs, and
trx-core controller tests (handlers.rs, machine.rs).

Update aidocs/UI-CAPS.md: all tasks UC-01..UC-09 marked [x].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-02-25 20:25:11 +01:00

19 lines
11 KiB
JSON

{
"permissions": {
"allow": [
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(cargo test:*)",
"Bash(cargo build:*)",
"Bash(git:*)",
"Bash(cat:*)",
"Bash(cargo check:*)",
"Bash(python3:*)",
"Bash(ls:*)",
"Bash(cat > /Users/sjg/git/trx-rs/CONFIGURATION.md << 'ENDOFFILE'\n# Configuration\n\nThis document lists all currently supported configuration options for `trx-server` and `trx-client`.\n\n## File Locations\n\n### `trx-server`\nConfiguration lookup order:\n1. `--config <FILE>`\n2. `./trx-server.toml`\n3. `~/.trx-server.toml`\n4. `~/.config/trx-rs/server.toml`\n5. `/etc/trx-rs/server.toml`\n\n### `trx-client`\nConfiguration lookup order:\n1. `--config <FILE>`\n2. `./trx-client.toml`\n3. `~/.config/trx-rs/client.toml`\n4. `/etc/trx-rs/client.toml`\n\nCLI options override file values.\n\n## Environment Variables\n\n- `TRX_PLUGIN_DIRS`: additional plugin directories \\(path-separated\\), used by both server and client.\n\n## `trx-server` Options\n\n### `[general]`\n- `callsign` \\(`string`, default: `\"N0CALL\"`\\)\n- `log_level` \\(`string`, optional\\): one of `trace|debug|info|warn|error`\n- `latitude` \\(`float`, optional\\): `-90..=90`\n- `longitude` \\(`float`, optional\\): `-180..=180`\n\nNotes:\n- `latitude` and `longitude` must be set together or both omitted.\n\n### `[rig]`\n- `model` \\(`string`, required effectively unless provided by CLI `--rig`\\)\n- `initial_freq_hz` \\(`u64`, default: `144300000`, must be `> 0`\\)\n- `initial_mode` \\(`string`, default: `\"USB\"`\\): one of `LSB|USB|CW|CWR|AM|WFM|FM|DIG|PKT`\n\n### `[rig.access]`\n- `type` \\(`string`, default behavior: `serial` if omitted\\): `serial|tcp|sdr`\n- Serial mode:\n - `port` \\(`string`\\)\n - `baud` \\(`u32`\\)\n- TCP mode:\n - `host` \\(`string`\\)\n - `tcp_port` \\(`u16`\\)\n- SDR mode:\n - `args` \\(`string`, required when `type = \"sdr\"`\\): SoapySDR device args string \\(e.g. `\"driver=rtlsdr\"` or `\"driver=airspy,serial=00000001\"`\\). Passed verbatim to `SoapySDR::Device::new\\(\\)`.\n\nNotes:\n- For `serial`, both `port` and `baud` are required.\n- For `tcp`, both `host` and `tcp_port` are required.\n- For `sdr`, `args` must be non-empty. The `port`, `baud`, `host`, and `tcp_port` fields are ignored.\n\n### `[behavior]`\n- `poll_interval_ms` \\(`u64`, default: `500`, must be `> 0`\\)\n- `poll_interval_tx_ms` \\(`u64`, default: `100`, must be `> 0`\\)\n- `max_retries` \\(`u32`, default: `3`, must be `> 0`\\)\n- `retry_base_delay_ms` \\(`u64`, default: `100`, must be `> 0`\\)\n\n### `[listen]`\n- `enabled` \\(`bool`, default: `true`\\)\n- `listen` \\(`ip`, default: `127.0.0.1`\\)\n- `port` \\(`u16`, default: `4530`, must be `> 0` when enabled\\)\n\n### `[listen.auth]`\n- `tokens` \\(`string[]`, default: `[]`\\)\n\nNotes:\n- Empty token strings are invalid.\n- Empty list means no auth required.\n\n### `[audio]`\n- `enabled` \\(`bool`, default: `true`\\)\n- `listen` \\(`ip`, default: `127.0.0.1`\\)\n- `port` \\(`u16`, default: `4531`, must be `> 0` when enabled\\)\n- `rx_enabled` \\(`bool`, default: `true`\\)\n- `tx_enabled` \\(`bool`, default: `true`\\)\n- `device` \\(`string`, optional\\)\n- `sample_rate` \\(`u32`, default: `48000`, valid: `8000..=192000`\\)\n- `channels` \\(`u8`, default: `1`, valid: `1|2`\\)\n- `frame_duration_ms` \\(`u16`, default: `20`, valid: `3|5|10|20|40|60`\\)\n- `bitrate_bps` \\(`u32`, default: `24000`, must be `> 0`\\)\n\nNotes:\n- When `[audio].enabled = true`, at least one of `rx_enabled` or `tx_enabled` must be true.\n\n### `[pskreporter]`\n- `enabled` \\(`bool`, default: `false`\\)\n- `host` \\(`string`, default: `\"report.pskreporter.info\"`, must not be empty when enabled\\)\n- `port` \\(`u16`, default: `4739`, must be `> 0` when enabled\\)\n- `receiver_locator` \\(`string`, optional\\)\n\nNotes:\n- If `receiver_locator` is omitted, server tries deriving it from `[general].latitude`/`longitude`.\n- PSK Reporter software ID is hardcoded to: `trx-server v<version> by SP2SJG`.\n\n### `[aprsfi]`\n- `enabled` \\(`bool`, default: `false`\\)\n- `host` \\(`string`, default: `\"rotate.aprs.net\"`, must not be empty when enabled\\)\n- `port` \\(`u16`, default: `14580`, must be `> 0` when enabled\\)\n- `passcode` \\(`i32`, default: `-1`\\)\n\nNotes:\n- When `passcode = -1` \\(the default\\), the passcode is auto-computed from `[general].callsign` using the standard APRS-IS hash algorithm.\n- `[general].callsign` must be non-empty when `[aprsfi].enabled = true`; otherwise the IGate is silently disabled at startup.\n- Only APRS packets with valid CRC are forwarded; packets from other decoders \\(FT8, WSPR, CW\\) are ignored.\n- The IGate reconnects automatically with exponential backoff \\(1 s → 2 s → … → 60 s\\) on TCP errors.\n- Requires `[audio].enabled = true` \\(APRS packets are decoded from audio\\).\n\n### `[sdr]`\n- `sample_rate` \\(`u32`, default: `1920000`, must be `> 0`\\): IQ capture rate in Hz. Must be supported by the device.\n- `bandwidth` \\(`u32`, default: `1500000`\\): Hardware IF filter bandwidth in Hz.\n- `center_offset_hz` \\(`i64`, default: `100000`\\): The SDR tunes this many Hz below the dial frequency to keep the signal off the DC spur. Negative values tune above.\n\n### `[sdr.gain]`\n- `mode` \\(`string`, default: `\"auto\"`\\): `\"auto\"` enables hardware AGC \\(falls back to `\"manual\"` with a warning if the device does not support it\\); `\"manual\"` uses the fixed `value`.\n- `value` \\(`f64`, default: `30.0`\\): Gain in dB. Used only when `mode = \"manual\"`.\n\n### `[[sdr.channels]]`\n\nDefines one virtual receiver channel within the wideband IQ stream. At least one channel is required when using the `soapysdr` backend. The **first** channel in the list is the *primary* channel: `set_freq` and `set_mode` from rig control apply to it, and `get_status` reads from it.\n\n- `id` \\(`string`, default: `\"\"`\\): Human-readable label used in logs.\n- `offset_hz` \\(`i64`, default: `0`\\): Frequency offset from the dial frequency in Hz. Primary channel should be `0`.\n- `mode` \\(`string`, default: `\"auto\"`\\): Demodulation mode. `\"auto\"` follows the RigCat `set_mode` command; or a fixed mode string: `LSB`, `USB`, `CW`, `CWR`, `AM`, `WFM`, `FM`, `DIG`, `PKT`.\n- `audio_bandwidth_hz` \\(`u32`, default: `3000`\\): One-sided bandwidth of the post-demodulation audio BPF in Hz.\n- `fir_taps` \\(`usize`, default: `64`\\): FIR filter tap count. Higher values give sharper roll-off at the cost of latency.\n- `cw_center_hz` \\(`u32`, default: `700`\\): CW tone centre frequency in the audio domain \\(Hz\\).\n- `wfm_bandwidth_hz` \\(`u32`, default: `75000`\\): Pre-demodulation filter bandwidth for WFM only \\(Hz\\).\n- `decoders` \\(`string[]`, default: `[]`\\): Decoder IDs that receive this channel's PCM audio. Valid values: `\"ft8\"`, `\"wspr\"`, `\"aprs\"`, `\"cw\"`. Each decoder ID may appear in at most one channel.\n- `stream_opus` \\(`bool`, default: `false`\\): Encode this channel's audio as Opus and stream to clients over the TCP audio port. At most one channel may set this to `true`.\n\nNotes:\n- Requires `libSoapySDR` installed \\(`brew install soapysdr` on macOS; `libsoapysdr-dev` on Debian/Ubuntu\\).\n- The SDR backend is RX-only. `[audio] tx_enabled` must be `false`.\n- Channel IF constraint: `|center_offset_hz + offset_hz| < sample_rate / 2` for every channel; violated channels cause a startup error.\n- `[audio] sample_rate` must match the output audio rate of the SDR pipeline \\(48000 Hz recommended\\).\n- Use `trx-server --print-config` to see all defaults. SDR fields appear only if the binary was built with `--features soapysdr`.\n\n### `[decode_logs]`\n- `enabled` \\(`bool`, default: `false`\\)\n- `dir` \\(`string`, default: `\"$XDG_DATA_HOME/trx-rs/decoders\"`; fallback: `\"logs/decoders\"`, must not be empty when enabled\\)\n- `aprs_file` \\(`string`, default: `\"TRXRS-APRS-%YYYY%-%MM%-%DD%.log\"`, must not be empty when enabled\\)\n- `cw_file` \\(`string`, default: `\"TRXRS-CW-%YYYY%-%MM%-%DD%.log\"`, must not be empty when enabled\\)\n- `ft8_file` \\(`string`, default: `\"TRXRS-FT8-%YYYY%-%MM%-%DD%.log\"`, must not be empty when enabled\\)\n- `wspr_file` \\(`string`, default: `\"TRXRS-WSPR-%YYYY%-%MM%-%DD%.log\"`, must not be empty when enabled\\)\n\nNotes:\n- Decoder logs are server-side and split by decoder name \\(APRS/CW/FT8/WSPR\\).\n- Files are appended in JSON Lines format \\(one JSON object per line\\).\n- Supported filename date tokens: `%YYYY%`, `%MM%`, `%DD%` \\(UTC date\\).\n\n## `trx-client` Options\n\n### `[general]`\n- `callsign` \\(`string`, default: `\"N0CALL\"`\\)\n- `log_level` \\(`string`, optional\\): one of `trace|debug|info|warn|error`\n\n### `[remote]`\n- `url` \\(`string`, optional in file but required at runtime unless provided by CLI `--url`\\)\n- `poll_interval_ms` \\(`u64`, default: `750`, must be `> 0`\\)\n\n### `[remote.auth]`\n- `token` \\(`string`, optional\\)\n\nNotes:\n- If provided, token must not be empty/whitespace.\n\n### `[frontends.http]`\n- `enabled` \\(`bool`, default: `true`\\)\n- `listen` \\(`ip`, default: `127.0.0.1`\\)\n- `port` \\(`u16`, default: `8080`, must be `> 0` when enabled\\)\n\n### `[frontends.rigctl]`\n- `enabled` \\(`bool`, default: `false`\\)\n- `listen` \\(`ip`, default: `127.0.0.1`\\)\n- `port` \\(`u16`, default: `4532`, must be `> 0` when enabled\\)\n\n### `[frontends.http_json]`\n- `enabled` \\(`bool`, default: `true`\\)\n- `listen` \\(`ip`, default: `127.0.0.1`\\)\n- `port` \\(`u16`, default: `0`\\)\n- `auth.tokens` \\(`string[]`, default: `[]`\\)\n\nNotes:\n- `port = 0` means ephemeral bind \\(allowed\\).\n- Empty token strings are invalid.\n\n### `[frontends.audio]`\n- `enabled` \\(`bool`, default: `true`\\)\n- `server_port` \\(`u16`, default: `4531`, must be `> 0` when enabled\\)\n- `bridge.enabled` \\(`bool`, default: `false`\\): enables local `cpal` audio bridge\n- `bridge.rx_output_device` \\(`string`, optional\\): exact local playback device name\n- `bridge.tx_input_device` \\(`string`, optional\\): exact local capture device name\n- `bridge.rx_gain` \\(`float`, default: `1.0`, must be finite and `>= 0`\\)\n- `bridge.tx_gain` \\(`float`, default: `1.0`, must be finite and `>= 0`\\)\n\nNotes:\n- The bridge is intended for local WSJT-X integration via virtual audio devices.\n- Linux: typically use ALSA loopback \\(`snd-aloop`\\).\n- macOS: install a virtual CoreAudio device \\(e.g. BlackHole\\), then set device names above.\n\n## CLI Override Summary\n\n### `trx-server`\n- `--config`, `--print-config`\n- `--rig`, `--access`, positional `RIG_ADDR`\n- `--callsign`\n- `--listen`, `--port` \\(JSON listener\\)\n- SDR backend: all SDR options are file-only \\(`[sdr]` and `[[sdr.channels]]`\\).\n\n### `trx-client`\n- `--config`, `--print-config`\n- `--url`, `--token`, `--poll-interval`\n- `--frontend` \\(comma-separated\\)\n- `--http-listen`, `--http-port`\n- `--rigctl-listen`, `--rigctl-port`\n- `--http-json-listen`, `--http-json-port`\n- `--callsign`\nENDOFFILE)",
"Bash(cd:*)",
"Bash(grep:*)"
]
}
}