14 Commits

Author SHA1 Message Date
Bjarne Øverli 304699fb55 Fix data race in exec tests, dead code, silent IPC write failures
- luaplugin: waitExec now holds the plugin mutex while reading LState,
  matching the locking exec goroutines do when calling into Lua. The
  race detector caught this in TestExecCancel.
- ipc: log conn.Write failures in writeResponse instead of silently
  dropping them.
- ui/model: collapse empty if/else branches in track-title rendering;
  drop dead 'Add now-playing' assignment that was always overwritten.
2026-05-05 18:25:24 +02:00
Bjarne Øverli c5a9da9b6e feat(plugins): add exec, keymap, and CLI command APIs
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
- cliamp.exec.run(): allowlisted subprocess spawn for plugins,
  gated by permissions = {"exec"}
- p:bind([desc,] fn): plugin-registered TUI keybindings, gated by
  permissions = {"keymap"}; entries with a description appear in
  the Ctrl+K overlay. Core-reserved keys rejected at bind time.
- p:command(name, fn): shell-invokable plugin commands, dispatched
  over IPC via `cliamp plugins call <plugin> <command> [args...]`
  and listed via `cliamp plugins commands`.
- cliamp.fs: added mkdir/listdir; ~/Music/cliamp/ writable.
2026-04-23 22:11:51 +02:00
Bjarne Øverli 2f7044d071 Add cliamp.message plugin API for status bar messages
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
Plugins can now call cliamp.message(text, duration_secs?) to display
transient messages in the UI status bar. Closes #175.

Delivery flows through prog.Send to the Bubbletea model thread, so
plugin timers and event handlers never touch UI state directly.
2026-04-17 19:06:13 +02:00
Gjermund Garaba 5bd8c05f97 fix: races (#181)
* fix: races

* coderabbit pr fixes
2026-04-13 18:01:55 +02:00
Gjermund Garaba 1b53660a63 refactor: go 1.26 modernize (#178)
* refactor: go 1.26 modernize

* coderabbit pr fixes
2026-04-13 18:00:58 +02:00
Bjarne Øverli d89186f371 Fix lint issues 2026-04-02 20:25:56 +02:00
Bjarne Øverli fa8c6831cf Add plugin tests
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
2026-03-30 11:18:46 +02:00
Bjarne Øverli 59cd1aaf95 Add an API to set custom EQs with label 2026-03-30 10:21:35 +02:00
Bjarne Øverli fde4b8b8a5 Add set eq
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
2026-03-29 23:41:00 +02:00
Bjarne Øverli aadf6141e1 Fix the perms control
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
2026-03-29 22:57:36 +02:00
Bjarne Øverli fc72481658 Simplify
Release / build (amd64, darwin, macos-latest) (push) Has been cancelled
Release / build (amd64, linux, ubuntu-latest) (push) Has been cancelled
Release / build (amd64, windows, windows-latest) (push) Has been cancelled
Release / build (arm64, darwin, macos-latest) (push) Has been cancelled
Release / build (arm64, linux, ubuntu-latest) (push) Has been cancelled
Release / release (push) Has been cancelled
Release / update-homebrew (push) Has been cancelled
2026-03-29 20:11:21 +02:00
Bjarne Øverli 524689c24b Allow plugins to control the player 2026-03-29 20:08:26 +02:00
Bjarne Øverli cd172ab5cc Dynamic height 2026-03-29 20:03:02 +02:00
Bjarne Øverli 296722a201 Add initial plugins system based on GopherLua
Custom plugins can be added to the ~/.config/cliamp/plugins. Examples and docs added.
2026-03-29 19:39:40 +02:00