Skip to content

Adds OSC support cause why not - #2

Open
DingosGotMyBaby wants to merge 4 commits into
PoglyApp:mainfrom
DingosGotMyBaby:dingo/osc-support
Open

DingosGotMyBaby wants to merge 4 commits into
PoglyApp:mainfrom
DingosGotMyBaby:dingo/osc-support

Conversation

@DingosGotMyBaby

Copy link
Copy Markdown

Branch based of of my previous PR

I used gemini to make this like the lazy cunt I am.

Adds a lightweight, stdio-based MCP server subcommand to the pogly-cli.
This enables AI assistants (like Claude Desktop or Antigravity) to view,
build, and manage overlay layouts and elements directly.

Key changes:
- Created a custom JSON-RPC 2.0 stdio message handler in commands/mcp.rs with zero external async dependencies (tokio, rmcp, etc.).
- Registered the new `mcp` subcommand in cli.rs and commands/mod.rs.
- Exposed 23 MCP tools mapping to elements, elementdata, layouts, folders, and status commands (each accepting an optional 'overlay' nickname flag).
- Handled automatic overlay resolution and API client forwarding.
- Added Claude Desktop and source-based configuration instructions to the README.
why? why not.
the rest is large loser model generated of course
- Integrate the `rosc` crate for OSC message and bundle decoding
- Define `pogly osc` subcommand with configurable `--host` and `--port` (defaulting to 127.0.0.1:9000)
- Implement a UDP listener server that routes OSC address patterns to Pogly HTTP API endpoints:
  - Active layout selection (/pogly/layouts/set-active)
  - Element deletion (/pogly/elements/delete)
  - Element property updates (/pogly/elements/update/...)
  - Generic element update routing (/pogly/elements/update) for any key-value property
- Support robust type coercion (coercing float, int, string, and bool inputs into correct API types)
- Add comprehensive unit tests verifying coercion rules and dynamic JSON builders
- Provide `send-osc.py` example and document OSC commands in READMEs
Pogly runs at 30hz on the server side with clients interpolating to their native refresh rate.
So therefore we only need to send an event when required by the server, not every time an OSC event arrives
Since APPDATA and LOCALAPPDATA don't exist on Linux and Mac, I have implemented a native way to handle it.
This will allow people to run this on servers and stuff without the api keys being put into the system tmp folder
@DingosGotMyBaby
DingosGotMyBaby marked this pull request as ready for review August 21, 2026 08:00
@Lethalchip

Copy link
Copy Markdown
Member

Thanks, the bucket-and-merge-per-tick approach is the right shape. Changes needed before merge:

  1. Please drop the "Adds multi-platform support" commit (d42b54d). Linux support is being handled in feat: make pogly cli compatible with linux distros #4 with CI and release jobs; this copy conflicts with it, and the .or_else(|| asset_url(release, "pogly.exe")) fallback would install a Windows binary on Linux if the Linux asset were ever missing.
  2. Remove the cross-tick last_sent_elements cache and the deadband in should_update_field. Two bugs: (a) changes of 1 unit are dropped and never re-sent, so transparency 1 -> 0 or 99 -> 100 never reaches the overlay and a fader can't land on its end value; (b) the cache never sees changes made in the editor, so after someone drags an element elsewhere, OSC sending the cached value is filtered as "no change". The per-tick merge in BucketedState already deduplicates bursts; sending every merged tick is correct.
  3. CI is red: cargo fmt --check (23 hunks) and clippy with -D warnings (2x or_insert_with(Map::new) -> or_default(), 7x assert_eq!(x, true/false) -> assert!). The tests that assert the deadband behaviour need updating with item 2.
  4. coerce_to_u32 accepts negative ints/floats and wraps (-1 as u32); please return an error instead.
  5. README: note that --host 0.0.0.0 exposes unauthenticated control of the overlay to the network; keep the 127.0.0.1 default.

Since this is stacked on #1, it'll need a rebase once #1 lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants