n8n-nodes-github-copilot 3.31.27 โ†’ 3.31.28

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.
@@ -162,32 +162,30 @@ class GitHubCopilotOpenAI {
162
162
  requestBody.seed = seed;
163
163
  }
164
164
  const response = await (0, utils_1.makeApiRequest)(this, GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.CHAT_COMPLETIONS, requestBody, false);
165
- const parseJsonContent = (content) => {
166
- if (!content)
165
+ const cleanJsonFromMarkdown = (content) => {
166
+ if (!content || typeof content !== 'string') {
167
167
  return content;
168
+ }
168
169
  try {
169
170
  const trimmed = content.trim();
170
- console.log('๐Ÿ” parseJsonContent - Original length:', content.length);
171
- console.log('๐Ÿ” parseJsonContent - First 50 chars:', trimmed.substring(0, 50));
171
+ console.log('๐Ÿงน cleanJsonFromMarkdown - Input length:', trimmed.length);
172
172
  const jsonBlockRegex = /^```(?:json)?\s*\n([\s\S]*?)\n```\s*$/;
173
173
  const match = trimmed.match(jsonBlockRegex);
174
- let jsonString = trimmed;
175
174
  if (match && match[1]) {
176
- jsonString = match[1].trim();
177
- console.log('โœ… parseJsonContent - Extracted from markdown block');
175
+ const extracted = match[1].trim();
176
+ console.log('โœ… cleanJsonFromMarkdown - Extracted from markdown block');
177
+ return extracted;
178
178
  }
179
- const parsed = JSON.parse(jsonString);
180
- console.log('โœ… parseJsonContent - Successfully parsed to object:', typeof parsed);
181
- return parsed;
179
+ console.log('โ„น๏ธ cleanJsonFromMarkdown - No markdown block found, returning as is');
180
+ return trimmed;
182
181
  }
183
182
  catch (error) {
184
- console.error('โŒ parseJsonContent - Parse error:', error);
185
- console.log('โš ๏ธ parseJsonContent - Returning original string');
183
+ console.error('โŒ cleanJsonFromMarkdown - Error:', error);
186
184
  return content;
187
185
  }
188
186
  };
189
187
  console.log('๐Ÿ”จ Building OpenAI response...');
190
- console.log('๐Ÿ” response_format check:', (response_format === null || response_format === void 0 ? void 0 : response_format.type) === 'json_object' ? 'WILL PARSE JSON' : 'WILL KEEP AS STRING');
188
+ console.log('๐Ÿ” response_format check:', (response_format === null || response_format === void 0 ? void 0 : response_format.type) === 'json_object' ? 'WILL CLEAN MARKDOWN' : 'WILL KEEP AS IS');
191
189
  const openAIResponse = {
192
190
  id: response.id || `chatcmpl-${Date.now()}`,
193
191
  object: response.object || "chat.completion",
@@ -203,12 +201,12 @@ class GitHubCopilotOpenAI {
203
201
  let processedContent = choice.message.content;
204
202
  if (choice.message.content !== null && choice.message.content !== undefined) {
205
203
  if ((response_format === null || response_format === void 0 ? void 0 : response_format.type) === 'json_object') {
206
- console.log(' ๐Ÿ”„ Applying parseJsonContent...');
207
- processedContent = parseJsonContent(choice.message.content);
204
+ console.log(' ๐Ÿงน Applying cleanJsonFromMarkdown (keeping as string)...');
205
+ processedContent = cleanJsonFromMarkdown(choice.message.content);
208
206
  console.log(' โœ… Processed content type:', typeof processedContent);
209
207
  }
210
208
  else {
211
- console.log(' โ„น๏ธ Keeping content as string');
209
+ console.log(' โ„น๏ธ Keeping content as is');
212
210
  }
213
211
  }
214
212
  return {
@@ -218,8 +216,11 @@ class GitHubCopilotOpenAI {
218
216
  ...(choice.message.content !== null && choice.message.content !== undefined && {
219
217
  content: processedContent
220
218
  }),
219
+ refusal: choice.message.refusal || null,
220
+ annotations: choice.message.annotations || [],
221
221
  ...(choice.message.tool_calls && { tool_calls: choice.message.tool_calls }),
222
222
  },
223
+ logprobs: choice.logprobs || null,
223
224
  finish_reason: choice.finish_reason,
224
225
  };
225
226
  }),
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.31.27",
3
+ "version": "3.31.28",
4
4
  "description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - 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": "3.31.27",
3
+ "version": "3.31.28",
4
4
  "description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - 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",