n8n-nodes-github-copilot 3.31.22 → 3.31.24

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.
@@ -117,16 +117,29 @@ class GitHubCopilotOpenAI {
117
117
  requestBody.seed = seed;
118
118
  }
119
119
  const response = await (0, utils_1.makeApiRequest)(this, GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.CHAT_COMPLETIONS, requestBody, false);
120
- const cleanJsonContent = (content) => {
120
+ const parseJsonContent = (content) => {
121
121
  if (!content)
122
122
  return content;
123
- const trimmed = content.trim();
124
- const jsonBlockRegex = /^```(?:json)?\s*\n([\s\S]*?)\n```\s*$/;
125
- const match = trimmed.match(jsonBlockRegex);
126
- if (match && match[1]) {
127
- return match[1].trim();
123
+ try {
124
+ const trimmed = content.trim();
125
+ console.log('🔍 parseJsonContent - Original length:', content.length);
126
+ console.log('🔍 parseJsonContent - First 50 chars:', trimmed.substring(0, 50));
127
+ const jsonBlockRegex = /^```(?:json)?\s*\n([\s\S]*?)\n```\s*$/;
128
+ const match = trimmed.match(jsonBlockRegex);
129
+ let jsonString = trimmed;
130
+ if (match && match[1]) {
131
+ jsonString = match[1].trim();
132
+ console.log('✅ parseJsonContent - Extracted from markdown block');
133
+ }
134
+ const parsed = JSON.parse(jsonString);
135
+ console.log('✅ parseJsonContent - Successfully parsed to object:', typeof parsed);
136
+ return parsed;
137
+ }
138
+ catch (error) {
139
+ console.error('❌ parseJsonContent - Parse error:', error);
140
+ console.log('⚠️ parseJsonContent - Returning original string');
141
+ return content;
128
142
  }
129
- return trimmed;
130
143
  };
131
144
  const openAIResponse = {
132
145
  id: response.id || `chatcmpl-${Date.now()}`,
@@ -139,7 +152,7 @@ class GitHubCopilotOpenAI {
139
152
  role: choice.message.role,
140
153
  ...(choice.message.content !== null && choice.message.content !== undefined && {
141
154
  content: (response_format === null || response_format === void 0 ? void 0 : response_format.type) === 'json_object'
142
- ? cleanJsonContent(choice.message.content)
155
+ ? parseJsonContent(choice.message.content)
143
156
  : choice.message.content
144
157
  }),
145
158
  ...(choice.message.tool_calls && { tool_calls: choice.message.tool_calls }),
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.31.22",
3
+ "version": "3.31.24",
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.22",
3
+ "version": "3.31.24",
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",