Repository navigation
feat(binaries): install and upgrade prebuilt tools via install.sh - #1353
Conversation
EnsureBinary resolves ~/.infer/bin/tools/<name> and installs through the binaries release's install.sh when the binary is missing or its sha256 differs from checksums.txt, checked at most once per process; auto_download off still never downloads, binary_path overrides still win, and Windows without sh keeps the native Go fallback with the same sha256-mismatch rule. Add 'infer binaries install [name...] --version vX.Y.Z' (no names = all) and read-only 'infer binaries status [name...]' (missing/stale/current, exits non-zero unless all current) on the default approval-free bash allowlist. Legacy ~/.infer/bin tool copies are removed once the tools dir holds current ones; docs updated.
|
@infer Since these binaries are not only for audio I believe they should get their own domain, internal/binaries, use /domain-driven-design They do not belong to audio only and they do not belong to video only and maybe I will want to add more binaries in the future so I guess 3 binaries we can already have a dedicated domain. The reason is that ffmpeg can be used for audio and video (computer-use), so it's kind of shared. Be creative and find the right place to put the binaries and the download. |
|
Model: Todos
Pull Request✅ Infer Result: SuccessEverything is committed and pushed with a clean tree. Marking the final todos complete: Done. The prebuilt tools now live in their own bounded context, What changedThe prebuilt binaries (whisper-cli, ffmpeg, llama-tts) were parked under New -
Rewired consumers
Verification
No follow-up issues were filed: this is an internal-only refactor with no downstream impact beyond what the PR body already lists (desktop#352, opentask#207, gateway#745, docs#842), and the Model: Tokens: 6,549,427 in · 53,196 out · 6,602,623 total (53 requests) Tool calls: 72 total · 100% success rate TracesStatsTriggered by edenreich · Infer Action · OSS |
…text The prebuilt tools (whisper-cli, ffmpeg, llama-tts) are shared by speech, computer-use and the new binaries commands, so they no longer live under internal/audio: pure contracts in internal/binaries/domain (Name, State, Status, Store port) and the release client in internal/binaries/infrastructure (checksums.txt, install.sh, native fallback). audio and computer-use depend on the domain port and their tests use the generated counterfeiter fake; no behavior change.
|
🎉 This PR is included in version 0.211.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Resolves #1352
Summary
The CLI is now the single owner of the prebuilt tools (
whisper-cli,ffmpeg,llama-tts) on a local machine. They get their own bounded context,internal/binaries, following the repo's DDD structure, because ffmpeg is shared by speech and computer-use and more tools are expected: pure contracts ininternal/binaries/domainand the release client ininternal/binaries/infrastructure. The store resolves~/.infer/bin/tools/<name>and installs/upgrades through the binaries release'sinstall.sh(which keeps a sha256-matching binary and replaces anything else), instead of keeping any existing file forever. Two new commands,infer binaries installandinfer binaries status, expose that flow directly so Desktop and opentask can check and install through the CLI instead of downloading on their own.Changes
internal/binaries/domain/binaries.go(new): the domain's ubiquitous language -Namevalue object (WhisperCLI,FFmpeg,LlamaTTS),State(missing/stale/current),Status, and theStoreport (Ensure,Install,Status).internal/binaries/infrastructure/store.go(moved frominternal/audio/binary.go):Ensurecompares the local binary's sha256 against the latest release'schecksums.txt(checked at most once per process) and runsinstall.sh(fetched first, then run withINSTALL_DIR=~/.infer/bin/toolsandVERSIONpinned) when the binary is missing or stale; an unreachable release keeps the existing binary offline.InstallandStatusback the new commands.binariesdomain.Store; audio tests use the generated counterfeiter fake (tests/mocks/binaries), so the release machinery is exercised in one place,internal/binaries/infrastructure.cmd/binaries/binaries.go(new):infer binaries install [name...] --version vX.Y.Z(no names = all tools) and read-onlyinfer binaries status [name...](reportsmissing/stale/current, exits non-zero unless all current).config/config.go:infer binaries statusadded to the default approval-free Bash allowlist so agents can check without a prompt.~/.infer/bin/{whisper-cli,ffmpeg,llama-tts}copies are removed once the tools dir holds current ones, so there is no second copy;~/.infer/binkeeps onlyinferandinference-gateway.speech_to_text.auto_download: falsestill never downloads, andbinary_pathoverrides still win;auto_downloadfalse also never checks the release.docs/commands-reference.md,docs/speech-to-text.md,docs/text-to-speech.md,docs/tools-reference.mdand the built-inbugskill updated for the new dir and commands.internal/binaries/infrastructure/store_test.gocover: stale binary replaced, current one skipped, missing one installed, offline check keeps the existing binary, native-fallback replacement, once-per-process check, and status states.Downstream impact
infer binaries status/infer binaries installinstead of their own downloaders (~/.infer/bin/toolsis the shared dir).llama-ttsand looks in~/.infer/bin/tools.Changed files