waveterm/cmd
Copilot b2f3129aa0
Add wsh debugterm (#2947)
`wsh debugterm` currently decodes terminal bytes sourced from backend
block files. This extends it with a stdin-driven path so FE-emitted
payloads like `["...", "..."]` can be decoded directly without requiring
block lookup/RPC in that mode.

- **CLI surface**
  - Added new mode: `--mode stdin`
  - Updated mode help text to: `hex`, `decode`, `stdin`
  - Centralized mode validation via `getDebugTermMode()`

- **Execution path split**
  - Added mode-aware pre-run (`debugTermPreRun`):
    - `stdin` mode: skips RPC setup
    - `hex`/`decode`: keeps existing RPC setup behavior
  - `stdin` mode now:
    - reads all stdin
    - parses JSON as `[]string`
    - concatenates entries and runs existing decode formatter

- **Parsing support**
  - Added `parseDebugTermStdinData([]byte) ([]byte, error)`
  - Error messaging explicitly requires a JSON array of strings

- **Tests**
  - Added focused coverage for:
    - valid stdin JSON array parsing + decoded output
    - invalid stdin JSON input

```go
stdinData, _ := io.ReadAll(WrappedStdin)
termData, err := parseDebugTermStdinData(stdinData) // expects []string JSON
if err != nil { return err }
WriteStdout("%s", formatDebugTermDecode(termData))
```

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/wavetermdev/waveterm/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
2026-02-27 10:24:26 -08:00
..
generatego Do not allow large/recursive file transfers (for now), remove s3 and wavefile fs implementations (#2808) 2026-01-28 14:28:31 -08:00
generateschema improve the schema for widgets.json (#2913) 2026-02-20 16:59:38 -08:00
generatets Generate WaveEvent as a typed discriminated union with explicit null payloads for no-data events (#2899) 2026-02-20 17:04:03 -08:00
packfiles Add license identifiers to missing files (#1806) 2025-01-22 20:06:36 -08:00
server job events, terminal command types, connect error codes (#2855) 2026-02-10 20:23:06 -08:00
test rip out osc 23198 and osc 9283 handlers (#2736) 2026-01-02 11:51:37 -08:00
test-conn Working on Test Harness for Remote Connections (#2829) 2026-02-09 21:50:34 -08:00
test-streammanager stress test for the new RPC streaming primitives (+ bug fixes) (#2828) 2026-02-05 14:48:12 -08:00
testai feat: add NanoGPT as AI provider (#2746) 2026-02-19 12:13:35 -08:00
testopenai New AIPanel (#2370) 2025-10-07 13:32:10 -07:00
testsummarize Add Google AI file summarization package (#2455) 2025-10-17 17:24:06 -07:00
wsh Add wsh debugterm (#2947) 2026-02-27 10:24:26 -08:00