@ciphore/radiocli 0.1.5 → 0.1.7

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.
@@ -141,6 +141,28 @@ export function useCommandExecutor({ beginLearningTransportKey, countries, go, l
141
141
  await player.stop();
142
142
  return;
143
143
  }
144
+ if (name === 'doctor') {
145
+ const backends = player.refreshDetectedBackends();
146
+ setMessage(`Playback backends: ${backends.join(', ') || 'none — install mpv, then run radiocli doctor'}.`);
147
+ return;
148
+ }
149
+ if (name === 'help') {
150
+ go('help');
151
+ return;
152
+ }
153
+ if (name === 'resume' || name === 'ascii' || name === 'motion' || name === 'background') {
154
+ const key = name === 'resume'
155
+ ? 'resumeOnLaunch'
156
+ : name === 'ascii'
157
+ ? 'asciiMode'
158
+ : name === 'motion'
159
+ ? 'reduceMotion'
160
+ : 'transparentBackground';
161
+ const enabled = value === '' ? !settingsRef.current[key] : value === 'on' || value === 'true' || value === '1';
162
+ updateSettings({ [key]: enabled });
163
+ setMessage(`${name} ${enabled ? 'on' : 'off'}.`);
164
+ return;
165
+ }
144
166
  setMessage(`Unknown command: ${name}`);
145
167
  }, [
146
168
  beginLearningTransportKey,
@@ -0,0 +1,20 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { fileURLToPath } from 'node:url';
3
+ let cachedVersion = null;
4
+ export function appVersion() {
5
+ if (cachedVersion) {
6
+ return cachedVersion;
7
+ }
8
+ try {
9
+ const packageJsonPath = fileURLToPath(new URL('../package.json', import.meta.url));
10
+ const parsed = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
11
+ cachedVersion = parsed.version ?? '0.0.0';
12
+ }
13
+ catch {
14
+ cachedVersion = '0.0.0';
15
+ }
16
+ return cachedVersion;
17
+ }
18
+ export function userAgent(suffix = '') {
19
+ return `radiocli/${appVersion()}${suffix}`;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ciphore/radiocli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "A terminal-first world radio receiver built with Ink, mpv, and resilient public-radio providers.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -75,6 +75,7 @@
75
75
  "devDependencies": {
76
76
  "@types/node": "^25.9.1",
77
77
  "@types/react": "^19.2.15",
78
+ "ink-testing-library": "^4.0.0",
78
79
  "knip": "^6.14.2",
79
80
  "publint": "^0.3.21",
80
81
  "tsx": "^4.22.3",