n8n-nodes-github-copilot 4.4.1 → 4.4.2

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.
@@ -43,7 +43,7 @@ class GitHubCopilotOpenAI {
43
43
  };
44
44
  }
45
45
  async execute() {
46
- var _a, _b, _c, _d, _e, _f, _g, _h;
46
+ var _a, _b, _c, _d, _e, _f;
47
47
  const items = this.getInputData();
48
48
  const returnData = [];
49
49
  for (let i = 0; i < items.length; i++) {
@@ -274,15 +274,12 @@ class GitHubCopilotOpenAI {
274
274
  }
275
275
  if (hasVisionContent) {
276
276
  const credentials = await this.getCredentials('githubCopilotApi');
277
- const oauthToken = credentials.oauthToken;
278
- let supportsVision = DynamicModelsManager_1.DynamicModelsManager.modelSupportsVision(oauthToken, copilotModel);
277
+ const oauthToken = (credentials.oauthToken || credentials.token);
278
+ let supportsVision = oauthToken
279
+ ? DynamicModelsManager_1.DynamicModelsManager.modelSupportsVision(oauthToken, copilotModel)
280
+ : null;
279
281
  if (supportsVision === null) {
280
282
  const modelInfo = GitHubCopilotModels_1.GitHubCopilotModelsManager.getModelByValue(copilotModel);
281
- supportsVision = !!(((_f = modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities) === null || _f === void 0 ? void 0 : _f.vision) || ((_g = modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities) === null || _g === void 0 ? void 0 : _g.multimodal));
282
- console.log(`đŸ‘ī¸ Vision check for model ${copilotModel}: using static list, supportsVision=${supportsVision}`);
283
- }
284
- else {
285
- console.log(`đŸ‘ī¸ Vision check for model ${copilotModel}: using API cache, supportsVision=${supportsVision}`);
286
283
  }
287
284
  if (!supportsVision) {
288
285
  const enableVisionFallback = advancedOptions.enableVisionFallback || false;
@@ -348,7 +345,7 @@ class GitHubCopilotOpenAI {
348
345
  console.log(' Has Vision Content:', hasVisionContent);
349
346
  console.log(' Request body:', JSON.stringify(requestBody, null, 2));
350
347
  const response = await (0, utils_1.makeApiRequest)(this, GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ENDPOINTS.CHAT_COMPLETIONS, requestBody, hasVisionContent);
351
- const retriesUsed = ((_h = response._retryMetadata) === null || _h === void 0 ? void 0 : _h.retries) || 0;
348
+ const retriesUsed = ((_f = response._retryMetadata) === null || _f === void 0 ? void 0 : _f.retries) || 0;
352
349
  if (retriesUsed > 0) {
353
350
  console.log(`â„šī¸ Request completed with ${retriesUsed} retry(ies)`);
354
351
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.1",
3
+ "version": "4.4.2",
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",
@@ -4,6 +4,10 @@ exports.DynamicModelsManager = void 0;
4
4
  const GitHubCopilotEndpoints_1 = require("./GitHubCopilotEndpoints");
5
5
  class DynamicModelsManager {
6
6
  static hashToken(token) {
7
+ if (!token || typeof token !== 'string' || token.length === 0) {
8
+ console.warn('âš ī¸ Invalid token provided to hashToken, using fallback hash');
9
+ return 'models_default';
10
+ }
7
11
  let hash = 0;
8
12
  for (let i = 0; i < token.length; i++) {
9
13
  const char = token.charCodeAt(i);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.1",
3
+ "version": "4.4.2",
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",