diff --git a/AGENTS.md b/AGENTS.md index c5870bc..4b7cb4b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,6 +16,7 @@ mise run electron-deps # installs electron + electron-builder mise run electron-dev # runs electron in dev mode mise run docker-up # docker compose up --build mise run lint # go vet ./... +mise run check-all # verify gcc, brew, mise, go, node, docker, colima ``` ## Build & Run (manual) @@ -26,9 +27,10 @@ go build -buildvcs=false -o fetch . # → ./fetch # Build and run web server ./fetch serve # → starts on free port, opens browser +./fetch serve --host 0.0.0.0 -p 8080 # → Docker / network-accessible mode # Docker -docker compose up --build # serves on :8080 +docker compose up --build # serves on :8080, binds 0.0.0.0 # Electron dev (cd electron && npm install) @@ -44,11 +46,14 @@ GOOS=darwin GOARCH=amd64 go build -o fetch-darwin-amd64 . Single binary (`fetch`) with subcommands. No external Go dependencies — pure stdlib. ``` -main.go CLI entry, commands (search/list/download/extract/pipeline) +main.go CLI entry, commands (search/list/download/extract/pipeline/serve) serve.go HTTP server + REST API + embedded web UI (embed.FS) web/ui/ Static frontend (index.html, style.css, app.js) electron/ Electron wrapper shell scripts/ Bash helpers called via exec + ├── extract_wavs.sh batch WAV extraction via akaiutil + ├── check-toolchain.sh verify gcc, brew, mise, go, node + └── check-docker-toolchain.sh verify docker, compose, colima third_party/ Vendored akaiutil C binary (GPLv2) ``` @@ -61,6 +66,7 @@ third_party/ Vendored akaiutil C binary (GPLv2) - **Script discovery**: `serve.go:findScript()` — tries multiple candidate paths, fallback chain - **Zero-deps web UI**: vanilla JS, no bundler, no framework. API calls use `fetch()` + `EventSource` - **Embed directive**: `//go:embed web/ui/*` in `serve.go` — frontend baked into the binary +- **Bind address handling**: `serve.go:37` — `--host` flag defaults to `127.0.0.1` for local dev; set `--host 0.0.0.0` for Docker. When binding to `0.0.0.0`, prints both `localhost` and `` URLs for clarity. ### akaiutil integration @@ -72,6 +78,10 @@ third_party/ Vendored akaiutil C binary (GPLv2) All akaiutil calls use `-r` (read-only) flag. Write operations (S900 compress, partitioning, tagging) require removing `-r`. +### macOS compatibility + +- `third_party/akaiutil/commoninclude.h` has `bcopy`/`bzero` declarations guarded with `#ifdef _VISUALCPC` to avoid conflicts with macOS system headers that define these in ``. + ### Electron integration `electron/main.js` spawns the Go binary in `serve` mode: diff --git a/README.md b/README.md index ccc1c98..db314d3 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,16 @@ mise install # installs go 1.26, node 22 mise run build # → ./fetch ``` +### Toolchain check +```bash +mise run check-all # checks gcc, brew, mise, go, node, docker, colima +mise run check-toolchain # core tools only +mise run check-docker-toolchain # docker + compose + colima (macOS) +``` + ### Docker ```bash -docker compose up --build +mise run docker-up # Open http://localhost:8080 ``` @@ -27,9 +34,13 @@ docker compose up --build mise run build ./fetch search --filter vocal -# Web server +# Web server (local) mise run serve -# Open http://localhost:8080 +# Open http://localhost:PORT (auto-assigned) + +# Web server (Docker / network-accessible) +./fetch serve --host 0.0.0.0 -p 8080 +# Open http://:8080 # Electron (macOS) mise run electron-deps @@ -61,18 +72,22 @@ electron/ Electron wrapper (spawns fetch serve as sidecar) ├── preload.js context bridge └── package.json electron-builder config +scripts/ + ├── extract_wavs.sh batch WAV extraction via akaiutil + ├── check-toolchain.sh verify gcc, brew, mise, go, node + └── check-docker-toolchain.sh verify docker, compose, colima + third_party/akaiutil/ Vendored akaiutil 4.6.7 (C, GPLv2) -scripts/extract_wavs.sh Bash wrapper for batch WAV extraction ``` ## Tech Stack | Component | Tech | External Deps | |-------------|--------------------|---------------| -| CLI server | Go 1.26, stdlib | 0 | -| Web UI | HTML/CSS/JS (vanilla) | 0 | +| CLI server | Go 1.26, stdlib | 0 | +| Web UI | HTML/CSS/JS (vanilla) | 0 | | Electron | Electron 33, electron-builder | Node deps | -| Extraction | akaiutil (C), bash | vendored | +| Extraction | akaiutil (C), bash | vendored C source | Zero Go dependencies. The web UI uses no framework — vanilla JS, Web Audio API, Server-Sent Events. @@ -84,6 +99,7 @@ See [open issues](https://git.notsosm.art/david/akai-utils/issues). |---|---------|--------| | — | Search, download, extract, pipeline (CLI) | done | | — | HTTP server + web UI + Electron shell | done | +| — | Docker compose + mise toolchain + toolchain checks | done | | #1 | Disk Browser — browse AKAI filesystem in web UI | todo | | #2 | Disk Inspector — detailed disk metadata | todo | | #3 | WAV→Disk Packager — create AKAI ISOs from WAVs | todo |