Repository navigation
feat: support multiple Storage buckets with runtime switching - #14
Merged
Merged
Conversation
Add an active-bucket concept alongside the per-call bucket override: - storage_list_buckets: list the project's Cloud Storage buckets - storage_current_bucket: show the bucket operations default to - storage_switch_bucket: set the default bucket for subsequent calls (empty resets to the project default) Bucket resolution order is: explicit per-call bucket -> active bucket -> project default (<project-id>.firebasestorage.app). The active bucket is scoped per project and resets on switchProject.
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
Adds first-class support for working with multiple Cloud Storage buckets, including a runtime switch for the default bucket — mirroring the existing project-switch tools.
New tools
storage_list_bucketsstorage_current_bucketstorage_switch_bucketBucket resolution
Every existing file tool already accepts an optional
bucketargument. Resolution order is now:bucketargumentstorage_switch_bucket<project-id>.firebasestorage.app)The active bucket is scoped per project and resets automatically when you switch projects (
switchProject), so you never accidentally keep targeting another project's bucket.Details
resolveBucketName()centralizes the resolution;getBucket()instorage.tsnow uses it.listStorageBuckets()calls the GCS JSON API with the active credentials (local gcloud/ADC session or service account) — no new dependency.switchfired in parallel with other calls in the same turn has undefined ordering. Serial usage (the normal case) is deterministic.Testing
Verified live against a local gcloud session (serial client harness):
storage_list_bucketsreturns the project's buckets with anactiveflag.storage_switch_bucket→storage_current_bucketreflects the new bucket;storage_list_filesthen operates against it.storage_list_filestargets the default again.