Clear all pending images for a scope. Called after a message is sent.
The URI identifying the scope
Generate a unique short ID for a pending image based on a base name. For dropped files, use the basename (e.g., "photo.png"). For pasted images, use "pasted_image". If duplicates exist, a numeric suffix is added (e.g., "photo_2.png", "pasted_image_2").
The base name to use for the short ID
The scope URI to check for duplicates
A unique short ID within the given scope
Get pending image data by scope and short ID.
The URI identifying the scope
The short ID of the image
The image data if found, undefined otherwise
Get all pending images for a scope.
The URI identifying the scope
A map of short IDs to image data
Get pending image data by short ID only (global fallback). Use this when scope is not available (e.g., during variable resolution in parser).
The short ID of the image
The image data if found, undefined otherwise
Get the model ID for an editor URI.
The editor URI
The model ID if registered, undefined otherwise
Construct a scope URI from a chat model ID.
The chat model ID
The scope URI that would be used for this model
Check if a short ID looks like a pending image reference.
The argument string to check
True if it matches the short ID pattern
Register a pending image for a given scope (typically editor URI).
The URI identifying the scope (e.g., editor URI)
The short ID to use for this image (e.g., "img_1")
The parsed image variable data
The full JSON argument string
A disposable that unregisters this specific image
Register a mapping from editor URI to chat model ID. This allows the hover provider to look up the model ID from the editor URI.
The editor URI
The chat model ID
A disposable that unregisters the mapping
Service for registering and resolving pending image attachments.
When images are pasted or dropped into the chat input, they are registered here with a short ID. The short ID can be used in the text input (e.g., #imageContext:img_1) while the actual base64 data is stored in this registry.
This allows: