Upgrade to @mux/ts v15.1.0 and add commands for the new API surface - #75
Merged
Conversation
Replace @mux/mux-node ^14.0.0 with the renamed @mux/ts package, rename the robotsPreview accessor to robots (the Robots API left preview in v15), and update the moved import paths and the renamed static rendition response type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Add edit-captions, find-best-thumbnails, find-scenes, generate-engagement-insights, generate-premium-captions, and translate-audio commands under mux robots, following the existing job command pattern (typed flags, --file escape hatch, --wait polling). Extend the shared job union, retrieval dispatch, and the get/list workflow lists to cover the new workflows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Add --thumbnail-time and --clear-thumbnail-time to mux assets update (set via the update endpoint, unset via the new thumbnail-time delete endpoint), a mux assets shots group (get, generate, delete) for the new shot detection endpoints, and mux assets tracks update for the new track PATCH endpoint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Add create, list, get, update, and delete commands to mux webhooks, backed by the System API webhooks CRUD endpoints introduced in @mux/ts v15.1.0. The existing listen, trigger, and events commands are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Add a mux engagement group with heatmap and hotspots commands for the new Mux Data engagement endpoints, addressable by --asset-id, --playback-id, or --video-id. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
…scope
Live QA against the API showed the engagement endpoints return
{ asset_id, heatmap } / { asset_id, hotspots } rather than the SDK's
declared { total_views, value } shape, which crashed the pretty
printers. Accept both shapes and print total views only when present.
Also note in the tracks update help and README that the track PATCH
endpoint applies to text tracks only; the API rejects audio and video
tracks.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
The engagement envelope fields already diverged from the SDK types against the live API; guard the per-hotspot fields the same way so an undocumented shape prints raw JSON instead of NaN timestamps. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the SDK from
@mux/mux-node^14.0.0 to the renamed@mux/tsv15.1.0 and adds CLI commands for the new API surface introduced in v15.0.0 and v15.1.0.SDK upgrade (v15 breaking changes)
@mux/ts(the@mux/mux-nodealias is expected to stop after v15)client.robotsPreview→client.robots(Robots left preview), import paths updatedAssetCreateStaticRenditionResponse→StaticRendition)dimensionsandexports.listVideoViews()), and the signed-token query param fix (the CLI builds its own URLs with lowercasetoken=)New commands
Robots — six new workflows, following the existing job command pattern (typed flags,
--fileescape hatch,--waitpolling):mux robots edit-captions(find/replace rules, profanity censoring)mux robots find-best-thumbnails(with output steering and--update-asset-thumbnail)mux robots find-scenesmux robots generate-engagement-insightsmux robots generate-premium-captionsmux robots translate-audiorobots get/listand the shared retrieval dispatch cover the new workflowsAssets
mux assets update --thumbnail-time <sec>/--clear-thumbnail-time(new default thumbnail time endpoints)mux assets shots get|generate|delete(new shot detection endpoints)mux assets tracks update(new track PATCH endpoint)Webhooks — configuration CRUD from the new System API endpoints (v15.1.0), alongside the existing
listen/trigger/events:mux webhooks create|list|get|update|deleteEngagement — new
mux engagementgroup for the Mux Data engagement endpoints:mux engagement heatmap|hotspotswith--asset-id/--playback-id/--video-idDeferred for a follow-up (as discussed): Robots directives commands, the System usage-exports listing, and output-steering flags on pre-existing robots jobs (
--filealready covers steering there).Test plan
bun test— 1,100 tests pass (new structural/validation tests for every new command)pnpm exec tsc --noEmitandpnpm run checkcleanpnpm run buildbundles successfully--jsonwithout--forceon deletes, missing engagement target selector)🤖 Generated with Claude Code
https://claude.ai/code/session_01C58A2m5UJhJf34CVqQfGmg
Note
Medium Risk
Wide SDK bump and many new API-backed commands affect Robots, assets, webhooks, and Data paths; mistakes could break existing workflows or misconfigure production webhooks, though patterns match existing CLI conventions.
Overview
Upgrades the Mux client from
@mux/mux-nodev14 to@mux/tsv15.1.0, including therobotsPreview→robotsrename and related type/import updates across the codebase.New and extended CLI surface:
edit-captions,find-best-thumbnails,find-scenes,generate-engagement-insights,generate-premium-captions,translate-audio) with the same--file/--wait/--jsonpatterns; job get/list routing covers all workflows.mux assets update;mux assets shotsget/generate/delete;mux assets tracks updatefor text tracks.create,list,get,update,deletefor environment webhook endpoints (alongside existing listen/trigger/events).mux engagement heatmapandhotspots(exactly one of--asset-id,--playback-id, or--video-id).README documents the new commands; structural/validation tests were added for the new command groups.
Reviewed by Cursor Bugbot for commit 2c4ab53. Bugbot is set up for automated code reviews on this repo. Configure here.