diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts index f62a5a7e66c..8f9d3a5612e 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -3555,11 +3555,14 @@ export namespace ChatPromptReference { value = Location.to(revive(value)); } else if (isImageVariableEntry(variable)) { const ref = variable.references?.[0]?.reference; - value = new types.ChatReferenceBinaryData( + const binaryData = new types.ChatReferenceBinaryData( variable.mimeType ?? 'image/png', () => Promise.resolve(new Uint8Array(Object.values(variable.value as number[]))), ref && URI.isUri(ref) ? ref : undefined ); + binaryData.isPasted = variable.isPasted; + binaryData.isURL = variable.isURL; + value = binaryData; } else if (variable.kind === 'diagnostic') { const filterSeverity = variable.filterSeverity && DiagnosticSeverity.to(variable.filterSeverity); const filterUri = variable.filterUri && URI.revive(variable.filterUri).toString(); diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index e7ea45cb0bd..2649f68b4a1 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -3841,6 +3841,8 @@ export class ChatReferenceBinaryData implements vscode.ChatReferenceBinaryData { mimeType: string; data: () => Thenable; reference?: vscode.Uri; + isPasted?: boolean; + isURL?: boolean; constructor(mimeType: string, data: () => Thenable, reference?: vscode.Uri) { this.mimeType = mimeType; this.data = data; diff --git a/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts b/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts index 081c24ad8c3..df5095314e2 100644 --- a/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts +++ b/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts @@ -29,6 +29,17 @@ declare module 'vscode' { */ readonly reference?: Uri; + /** + * Whether this image was pasted from the clipboard. + */ + readonly isPasted?: boolean; + + /** + * Whether this image originated from a URL. `true` when it was attached from a URL, + * `false` when it came from a local file, and `undefined` when the origin is unknown. + */ + readonly isURL?: boolean; + /** * @param mimeType The MIME type of the binary data. * @param data The binary data of the reference.