@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.
- package/CHANGELOG.md +39 -0
- package/README.md +7 -5
- package/dist/cli.js +6 -0
- package/dist/player/backend-install.js +23 -0
- package/dist/player/command.js +92 -4
- package/dist/player/player-controller.js +26 -4
- package/dist/providers/provider-manager.js +3 -0
- package/dist/providers/radio-browser.js +18 -2
- package/dist/storage/store.js +50 -2
- package/dist/ui/App.js +115 -13
- package/dist/ui/AppContent.js +5 -1
- package/dist/ui/app-state.js +10 -1
- package/dist/ui/ascii.js +84 -0
- package/dist/ui/audio-output.js +4 -1
- package/dist/ui/components/ScreenHeader.js +6 -2
- package/dist/ui/components/TopTabs.js +8 -3
- package/dist/ui/display-context.js +25 -0
- package/dist/ui/help-content.js +116 -0
- package/dist/ui/page-footer.js +4 -1
- package/dist/ui/screen-items.js +4 -0
- package/dist/ui/screens/ExploreScreen.js +7 -3
- package/dist/ui/screens/HelpScreen.js +12 -0
- package/dist/ui/screens/MapScreen.js +7 -2
- package/dist/ui/screens/NowPlayingScreen.js +27 -4
- package/dist/ui/screens/SearchScreen.js +4 -2
- package/dist/ui/screens/SettingsScreen.js +8 -0
- package/dist/ui/screens/StatsScreen.js +25 -11
- package/dist/ui/screens/screen-render.test.js +152 -0
- package/dist/ui/system-actions.js +58 -0
- package/dist/ui/use-app-input.js +48 -2
- package/dist/ui/use-command-executor.js +22 -0
- package/dist/version.js +20 -0
- package/package.json +2 -1
|
@@ -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,
|
package/dist/version.js
ADDED
|
@@ -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.
|
|
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",
|