n8n-nodes-github-copilot 4.4.9 → 4.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,8 +120,25 @@ class GitHubCopilotOpenAI {
120
120
  if (binaryKeyData && binaryKeyData[keyToUse]) {
121
121
  try {
122
122
  const binaryData = binaryKeyData[keyToUse];
123
- const mimeType = binaryData.mimeType || 'application/octet-stream';
123
+ let mimeType = binaryData.mimeType || 'application/octet-stream';
124
124
  const buffer = await this.helpers.getBinaryDataBuffer(i, keyToUse);
125
+ if (!mimeType.startsWith('image/')) {
126
+ const detected = (0, utils_1.getImageMimeType)(buffer);
127
+ if (detected !== 'application/octet-stream') {
128
+ mimeType = detected;
129
+ }
130
+ else {
131
+ if (mimeType === 'application/pdf') {
132
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `❌ Unsupported File Type: PDF files are not supported by the GitHub Copilot Vision API. Please convert the PDF to an image (JPEG, PNG, WEBP) or extract the text content before sending.`, { itemIndex: i });
133
+ }
134
+ mimeType = 'image/jpeg';
135
+ console.warn(`⚠️ Could not detect image type for '${keyToUse}', defaulting to image/jpeg`);
136
+ }
137
+ }
138
+ const allowedMimeTypes = ['image/png', 'image/jpeg', 'image/gif', 'image/webp'];
139
+ if (!allowedMimeTypes.includes(mimeType)) {
140
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `❌ Unsupported Image Format: '${mimeType}'. The API only supports: ${allowedMimeTypes.map(t => t.replace('image/', '')).join(', ')}.`, { itemIndex: i });
141
+ }
125
142
  const base64 = buffer.toString('base64');
126
143
  const dataUrl = `data:${mimeType};base64,${base64}`;
127
144
  const contentArray = [];
@@ -142,9 +159,12 @@ class GitHubCopilotOpenAI {
142
159
  type: 'image_url',
143
160
  image_url: {
144
161
  url: dataUrl,
162
+ detail: 'auto',
145
163
  },
146
164
  });
165
+ message.role = 'user';
147
166
  message.content = contentArray;
167
+ delete message.type;
148
168
  console.log(`📎 Attached binary file '${keyToUse}' (${mimeType}) as image_url`);
149
169
  }
150
170
  catch (err) {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.9",
3
+ "version": "4.4.11",
4
4
  "description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows with full tools and function calling support - access GPT-5, Claude, Gemini and more using your Copilot subscription",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.9",
3
+ "version": "4.4.11",
4
4
  "description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows with full tools and function calling support - access GPT-5, Claude, Gemini and more using your Copilot subscription",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",