feat: videoAnalysis resource and CLI command - #55
Merged
Conversation
Propagates POST /v1/video-analysis to the core client and the CLI. video-analysis is the first Sonilo product whose result is not media: it generates nothing and there is no file to download. The result is a work order — a time-aligned `segments` plan plus one `prompt` per requested variation, each ready to hand straight to videoToMusic, videoToSfx, videoToSound or their video-to-video counterparts. That shapes the surface in two places: - The resource method is `analyze()`, not `generate()`, and VideoAnalysisResult carries no download helper. Every other resource returns something you save; this one never does, so persisting the brief is the caller's business. - The CLI prints the brief to stdout as JSON so it can be piped into the next command, and writes a file only when --output asks for one. Every other command's default is a media file on disk. `segments` and `variations` are both optional on the result type because a processing or failed poll carries neither — callers guard with `?? []` rather than asserting them. The 1-5 variantsNum bound and the 2000-char prompt bound are deliberately not re-checked client-side — the backend owns them, and a hardcoded copy would make this SDK reject values a later API widens.
Lightsage docs evalsWaiting for the staging docs URL before running evals. Lightsage will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes. Commit: |
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.
Propagates
POST /v1/video-analysisto the core client and the CLI.What's new
client.videoAnalysis.submit()/.analyze(), taking exactly one ofvideo/videoUrlplus optionalpromptandvariantsNum.VideoAnalysisParams,VideoAnalysisResult,AnalysisSegment,AnalysisVariation.sonilo video-analysis --video clip.mp4 --prompt ... --variants 2.Why the surface differs from every other endpoint
video-analysis is the first Sonilo product whose result is not media: it generates nothing and there is no file to download. The result is a work order — a time-aligned
segmentsplan plus onepromptper requested variation, each ready to hand straight tovideoToMusic,videoToSfx,videoToSoundor their video-to-video counterparts.So:
analyze(), notgenerate(), andVideoAnalysisResultcarries no download helper;--outputasks for one.Notes
segmentsandvariationsare both optional on the result type: aprocessingorfailedpoll carries neither, so callers guard with?? [].variantsNumbound and the 2000-charpromptbound are not re-checked client-side; the backend owns them.changeset statusbumps onlysoniloandsonilo-cliat minor —sonilo-video-kitis untouched.Testing
npm test -w sonilo(195),npm test -w sonilo-cli(162),npm run lint— all green. 10 new tests cover the request builder, file upload, polling, arg parsing, and both CLI output paths.Note on ordering
This branch is based on
origin/mainand does not include #54's changeset. If #54 merges first, both changesets land in the same Version Packages PR, which is what you want — otherwise the whoami fix ships unversioned again.