Repository navigation
feat: image URL, generationId and uploadId image sources (v1.3.0) - #10
Merged
Merged
Conversation
… client The MCP server runs in Cloud Run over HTTPS and cannot read the caller's disk, so it needs a way to pass an image that is not a local file. - add imageUrl to EditParams, AiVectorizeParams and RemoveBackgroundParams, and generationId to edit and remove-background. A refine enforces exactly one source, so existing callers passing image/file validate unchanged - skip addFileToForm when imageUrl is set, otherwise the URL string reaches fs.existsSync and throws "File not found: https://..." - add UploadClient.createTicket for the signed-upload flow. filename is required and the content type is inferred from it server-side; contentType remains an optional override - replace three hardcoded x-api-key headers with buildAuthHeaders() in the stream paths of EditClient, AIVectorizeClient and GenerateClient, which returned a guaranteed 401 for OAuth callers Scope limited to the clients the MCP uses; the other convert clients are untouched.
Follows the API move from a signed GCS upload ticket to a tokenized upload
endpoint that returns an id.
- add uploadId to EditParams, AiVectorizeParams and RemoveBackgroundParams. The
refine now counts four sources and still requires exactly one, so existing
callers passing image/file validate unchanged
- replace UploadClient.createTicket with prepare({ filename }), returning the
short-lived multipart upload URL and its expiry
- add BaseClient.appendImageSource, which replaces six copies of the same
image-source branch across the edit, vectorize and remove-background clients
(each had one on the normal path and one on the stream path)
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
The MCP server runs in Cloud Run over HTTPS and cannot read the caller's disk, so the SDK needs a way to pass an image that is not a local file. This release adds three non-file image sources and a client for the temporary upload endpoint added in svgmaker v2.6.0.
Changes since v1.2.0
New image sources
imageUrlonEditParams,AiVectorizeParamsandRemoveBackgroundParams.generationIdon edit and remove-background, to reuse an image already in the account.uploadIdon all three, accepting an id from the temporary upload endpoint.imageorfilevalidate unchanged.Upload client
client.upload.prepare({ filename })returns a short-lived multipart upload URL and its expiry. The content type is inferred from the filename server-side.Internal
BaseClient.appendImageSourcereplaces six copies of the same image-source branch across the edit, vectorize and remove-background clients — each had one on the normal path and one on the stream path.Fixed
EditClient,AIVectorizeClientandGenerateClientsent a hardcodedx-api-keyheader on their stream paths, which returned a guaranteed 401 for OAuth callers. They now usebuildAuthHeaders().addFileToForm, which resolves every string against the local filesystem and threwFile not found: https://....Notes
upload.prepare()and theuploadIdsource depend on the new API routes.Breaking Changes
None.
UploadClient.createTicketwas added and then replaced byprepare()inside this same branch, so no released version ever exposed it.