Skip to content

feat: image URL, generationId and uploadId image sources (v1.3.0) - #10

Merged
vishal-genwave merged 3 commits into
mainfrom
feat/remote-image-support
Aug 11, 2026
Merged

vishal-genwave merged 3 commits into
mainfrom
feat/remote-image-support

Conversation

@vishal-genwave

Copy link
Copy Markdown
Collaborator

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

  • imageUrl on EditParams, AiVectorizeParams and RemoveBackgroundParams.
  • generationId on edit and remove-background, to reuse an image already in the account.
  • uploadId on all three, accepting an id from the temporary upload endpoint.
  • A refine counts the four sources and requires exactly one. Existing callers passing image or file validate 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.appendImageSource 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.

Fixed

  • EditClient, AIVectorizeClient and GenerateClient sent a hardcoded x-api-key header on their stream paths, which returned a guaranteed 401 for OAuth callers. They now use buildAuthHeaders().
  • A URL no longer reaches addFileToForm, which resolves every string against the local filesystem and threw File not found: https://....

Notes

  • Scope is limited to the clients the MCP server uses; the other convert clients are untouched.
  • svgmaker v2.6.0 must be deployed before this version is published, since upload.prepare() and the uploadId source depend on the new API routes.

Breaking Changes

None. UploadClient.createTicket was added and then replaced by prepare() inside this same branch, so no released version ever exposed it.

… 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)
@vishal-genwave
vishal-genwave merged commit 9e5d4cf into main Aug 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant