feat: connected storage in rb - #159
Merged
Merged
Conversation
Adds src/lib/deliver.ts: --deliver flag parsing, delivery status parsing off a job, per-delivery report lines, the delivery exit code, and a bounded wait for pending deliveries to settle. Not wired into any command yet, so nothing user-facing changes.
buildResult now parses the job's deliveries onto ProgressResult so a later command can wait on them and report them. Empty when the job named none. No command reads the field yet.
A rejected read no longer escapes waitForDeliveries and crashes the command, since the job it's polling already completed. It keeps the last known deliveries and tries again next interval, still bounded by the deadline. An aborted signal still rethrows so Ctrl+C works. Also documents the finishDeliveries test stub's `as never` and adds coverage for a renamed delivery through parseDeliveries and deliveryLine.
The API applies an org's default destination to every job and closes an unstored result (HLS, multi-file, data-only) as not_deliverable, so a run without --deliver could wait up to five minutes and exit 1 for a delivery nobody asked for. finishDeliveries now takes a requested flag and returns immediately when it is false, leaving the result exactly as the job read at completion reported it so --json is unaffected. All three commands pass requested: destinations.length > 0.
readDeliverFlags now parses --deliver=<uri> with the same validation and de-duplication as the two-argument form. ffmpeg's own arg extraction drops a --deliver=... token too, so it never reaches the ffmpeg command string.
By the time a command waits on deliveries the job has already completed, so there is nothing left to cancel. Clearing jobId right before that wait stops the SIGINT handler from posting a cancel for a job that already finished. Ctrl+C still exits 130.
A 403 INSUFFICIENT_SCOPE is an authorization problem like a bad token, so it now exits 2 instead of 1, via a small storageExitCode helper the same tests can cover directly. The connection-shape comments now name the local MCP server specifically, since the hosted one returns more fields. The storage-page URL comes from getDashboardBaseUrl() instead of a hardcoded string, and the missing-scope hint now names the September 13, 2026 cutoff by explaining which credentials predate it. rb ffprobe no longer destructures cred and baseUrl from openSession, since it never used either.
Merged
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.
rb ffmpeg,rb generateandrb editaccept--deliver storage://<id>[/path], repeatable, and--deliver=works too. With it, rb waits up to five minutes for the deliveries, prints where each one landed, addsdeliveriesto--json, and exits 1 when one did not land. A job that only picks up the account's default destination is not waited on and never changes the exit code, so existing scripts behave as before.New
rb storage listandrb storage ls <id>[/folder](--all,--json). The list prints the connection row (id, provider, bucket, region, access, pending, default destination), never endpoints or credentials. A key without storage access exits 2 with how to fix it.rb loginnow asks forstorage:read. Therendobar-cliOAuth client already carries that scope in production (read back from the database), and the production authorize endpoint accepts the new scope list. The commands that call the API share one session helper.Checks: typecheck and 267 tests green. A production run of this branch listed and browsed storage, delivered an output, refused an unknown destination (exit 1), ran without
--deliver(exit 0), and reported an HLS output with--deliveras not deliverable (exit 1).After release, accounts signed in before this change run
rb loginagain to userb storage.