n8n-nodes-github-copilot 4.4.5 → 4.4.7

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.
@@ -113,7 +113,47 @@ class GitHubCopilotOpenAI {
113
113
  role: msg.role,
114
114
  content: msg.content,
115
115
  };
116
- if (msg.type && (msg.type === 'text' || msg.type === 'image_url')) {
116
+ const msgType = msg.type || 'text';
117
+ if (msgType === 'file_binary') {
118
+ const binaryKeyData = items[i].binary;
119
+ const keyToUse = msg.binaryPropertyName || 'data';
120
+ if (binaryKeyData && binaryKeyData[keyToUse]) {
121
+ try {
122
+ const binaryData = binaryKeyData[keyToUse];
123
+ const mimeType = binaryData.mimeType || 'application/octet-stream';
124
+ const buffer = await this.helpers.getBinaryDataBuffer(i, keyToUse);
125
+ const base64 = buffer.toString('base64');
126
+ const dataUrl = `data:${mimeType};base64,${base64}`;
127
+ const contentArray = [];
128
+ if (message.content && message.content.trim() !== '') {
129
+ contentArray.push({
130
+ type: 'text',
131
+ text: message.content,
132
+ });
133
+ }
134
+ contentArray.push({
135
+ type: 'image_url',
136
+ image_url: {
137
+ url: dataUrl,
138
+ },
139
+ });
140
+ message.content = contentArray;
141
+ console.log(`📎 Attached binary file '${keyToUse}' (${mimeType}) as image_url`);
142
+ }
143
+ catch (err) {
144
+ console.error(`❌ Failed to read binary data for '${keyToUse}':`, err);
145
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to read binary file '${keyToUse}'. Ensure the binary data exists.`, { itemIndex: i });
146
+ }
147
+ }
148
+ else {
149
+ const available = binaryKeyData ? Object.keys(binaryKeyData).join(', ') : 'none';
150
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Binary property '${keyToUse}' not found. Available binary properties: ${available}`, { itemIndex: i });
151
+ }
152
+ }
153
+ else if (msgType === 'file') {
154
+ message.type = 'file';
155
+ }
156
+ else if (msg.type && (msg.type === 'text' || msg.type === 'image_url')) {
117
157
  message.type = msg.type;
118
158
  }
119
159
  messages.push(message);
@@ -116,13 +116,31 @@ exports.nodeProperties = [
116
116
  description: 'Regular text message',
117
117
  },
118
118
  {
119
- name: 'File',
119
+ name: 'File (URL / Base64)',
120
120
  value: 'file',
121
- description: 'File attachment (use content as data URL or base64)',
121
+ description: 'File attachment using URL or Base64 string',
122
+ },
123
+ {
124
+ name: 'File (Binary)',
125
+ value: 'file_binary',
126
+ description: 'File attachment from binary input',
122
127
  },
123
128
  ],
124
129
  default: 'text',
125
- description: 'The type of message content (optional)',
130
+ description: 'The type of message content',
131
+ },
132
+ {
133
+ displayName: 'Input Binary Field',
134
+ name: 'binaryPropertyName',
135
+ type: 'string',
136
+ default: 'data',
137
+ required: true,
138
+ displayOptions: {
139
+ show: {
140
+ type: ['file_binary'],
141
+ },
142
+ },
143
+ description: 'The name of the binary property that contains the file to upload',
126
144
  },
127
145
  ],
128
146
  },
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.5",
3
+ "version": "4.4.7",
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.5",
3
+ "version": "4.4.7",
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",