Everything the plugin is, moved out of officerdev/platform on 2026-08-15 — 41 files, unchanged from the tree they left. manifest.ts identity, one permission, ffmpeg/ffprobe declared api/ the sidecar proxy; the prefix comes from mountPrefix() sidecar/ the whole /api/music contract — indexing, streaming, per-user state db/ music_favorites, _playlists, _playlist_items, _now_playing web/ panels, layout, and the player: engine, bar, lyrics, favourites cliamp/ the second playback path, parked — not working, kept deliberately widgets/ the dashboard widget, parked — plugins cannot contribute widgets assets/ icon.png, the dock tile scripts/ the reindex CLI PLUGIN.md is the design record: what moved, what stayed, what broke, and why. MUSIC_API.md is the contract the phone and tablet apps speak, and the reason the sidecar's HTTP shape is not free to change. ── It does not build here, and that is the point ── The platform resolves `hooks/useClient`, `officerdev`, `officerdb/db` and `@@/*` through the workspace links in its own node_modules. Measured from this directory, outside the platform checkout, every one of them fails to resolve — 7 imports in the backend, ~29 in the frontend. So this repository is the source of truth, not yet a buildable unit. Making it one means the host API becoming something a plugin can depend on rather than something it reaches into. That is the next problem, and having the code here is what makes it unavoidable rather than theoretical. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { useCallback } from 'react';
|
|
import { useSearchParams } from 'react-router';
|
|
import { Music } from 'lucide-react';
|
|
import { TerminalView } from 'officerdev';
|
|
import { AudioStreamPlayer } from './AudioStreamPlayer';
|
|
|
|
export const CliampPanelHeader = () => {
|
|
const [searchParams] = useSearchParams();
|
|
const playPath = searchParams.get('play') ?? '';
|
|
const fileName = playPath.split('/').pop() ?? 'cliamp';
|
|
|
|
return (
|
|
<>
|
|
<Music className="h-4 w-4 shrink-0 opacity-60" />
|
|
<span className="text-xs font-medium truncate flex-1">{fileName}</span>
|
|
<AudioStreamPlayer wsUrl="/api/cliamp/audio/ws" />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export const CliampPanelBody = () => {
|
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
const playPath = searchParams.get('play') ?? '';
|
|
|
|
const wsPath = `/api/cliamp/ws?files=${encodeURIComponent(playPath)}`;
|
|
|
|
const handleExit = useCallback(() => {
|
|
setSearchParams((prev) => {
|
|
const next = new URLSearchParams(prev);
|
|
next.delete('play');
|
|
return next;
|
|
});
|
|
}, [setSearchParams]);
|
|
|
|
return <TerminalView className="h-full w-full" wsPath={wsPath} onExit={handleExit} autoFocus />;
|
|
};
|