n8n-nodes-github-copilot 3.37.7 → 3.38.1

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.
@@ -1,5 +1,10 @@
1
- import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, ILoadOptionsFunctions, INodePropertyOptions } from "n8n-workflow";
2
2
  export declare class GitHubCopilotOpenAI implements INodeType {
3
3
  description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getAvailableModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
4
9
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
10
  }
@@ -5,6 +5,7 @@ const n8n_workflow_1 = require("n8n-workflow");
5
5
  const nodeProperties_1 = require("./nodeProperties");
6
6
  const utils_1 = require("../GitHubCopilotChatAPI/utils");
7
7
  const GitHubCopilotEndpoints_1 = require("../../shared/utils/GitHubCopilotEndpoints");
8
+ const DynamicModelLoader_1 = require("../../shared/models/DynamicModelLoader");
8
9
  class GitHubCopilotOpenAI {
9
10
  constructor() {
10
11
  this.description = {
@@ -28,6 +29,13 @@ class GitHubCopilotOpenAI {
28
29
  ],
29
30
  properties: nodeProperties_1.nodeProperties,
30
31
  };
32
+ this.methods = {
33
+ loadOptions: {
34
+ async getAvailableModels() {
35
+ return await DynamicModelLoader_1.loadAvailableModels.call(this);
36
+ },
37
+ },
38
+ };
31
39
  }
32
40
  async execute() {
33
41
  var _a;
@@ -37,7 +45,29 @@ class GitHubCopilotOpenAI {
37
45
  try {
38
46
  const operation = this.getNodeParameter("operation", i);
39
47
  if (operation === "chat") {
40
- const model = this.getNodeParameter("model", i, "gpt-4o");
48
+ const modelSource = this.getNodeParameter("modelSource", i, "fromList");
49
+ let model;
50
+ if (modelSource === "custom") {
51
+ model = this.getNodeParameter("customModel", i);
52
+ if (!model || model.trim() === "") {
53
+ throw new Error("Custom model name is required when using 'Custom (Manual Entry)' mode");
54
+ }
55
+ console.log(`🔧 Using custom model: ${model}`);
56
+ }
57
+ else {
58
+ const selectedModel = this.getNodeParameter("model", i);
59
+ if (selectedModel === "__manual__") {
60
+ model = this.getNodeParameter("customModel", i);
61
+ if (!model || model.trim() === "") {
62
+ throw new Error("Custom model name is required when selecting '✏️ Enter Custom Model Name'");
63
+ }
64
+ console.log(`✏️ Using manually entered model: ${model}`);
65
+ }
66
+ else {
67
+ model = selectedModel;
68
+ console.log(`📋 Using model from list: ${model}`);
69
+ }
70
+ }
41
71
  const messagesInputMode = this.getNodeParameter("messagesInputMode", i, "manual");
42
72
  const temperature = this.getNodeParameter("temperature", i, 1);
43
73
  const tools = this.getNodeParameter("tools", i, "");
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.nodeProperties = void 0;
4
+ const GitHubCopilotModels_1 = require("../../shared/models/GitHubCopilotModels");
4
5
  exports.nodeProperties = [
5
6
  {
6
7
  displayName: "Operation",
@@ -16,13 +17,68 @@ exports.nodeProperties = [
16
17
  ],
17
18
  default: "chat",
18
19
  },
20
+ {
21
+ displayName: "Model Source",
22
+ name: "modelSource",
23
+ type: "options",
24
+ options: [
25
+ {
26
+ name: "From List (Auto-Discovered)",
27
+ value: "fromList",
28
+ description: "Select from available models based on your subscription",
29
+ },
30
+ {
31
+ name: "Custom (Manual Entry)",
32
+ value: "custom",
33
+ description: "Enter model name manually (use at your own risk)",
34
+ },
35
+ ],
36
+ default: "fromList",
37
+ description: "Choose how to specify the model",
38
+ },
19
39
  {
20
40
  displayName: "Model",
21
41
  name: "model",
42
+ type: "options",
43
+ typeOptions: {
44
+ loadOptionsMethod: "getAvailableModels",
45
+ },
46
+ default: GitHubCopilotModels_1.DEFAULT_MODELS.GENERAL,
47
+ description: "Select the GitHub Copilot model to use (loaded dynamically based on your subscription)",
48
+ displayOptions: {
49
+ show: {
50
+ modelSource: ["fromList"],
51
+ },
52
+ },
53
+ },
54
+ {
55
+ displayName: "Custom Model Name",
56
+ name: "customModel",
22
57
  type: "string",
23
- default: "gpt-4o",
24
- placeholder: "gpt-4o",
25
- description: "The model to use for the completion. Supports all OpenAI model names that map to GitHub Copilot models.",
58
+ default: "",
59
+ placeholder: "gpt-4o, claude-3.5-sonnet, grok-code-fast-1, etc.",
60
+ description: "Enter the model name manually. Use at your own risk if the model is not available in your subscription.",
61
+ hint: "Examples: gpt-4o, gpt-4o-mini, claude-3.5-sonnet, gemini-2.0-flash-exp, grok-code-fast-1",
62
+ displayOptions: {
63
+ show: {
64
+ modelSource: ["custom"],
65
+ },
66
+ },
67
+ },
68
+ {
69
+ displayName: "Custom Model Name",
70
+ name: "customModel",
71
+ type: "string",
72
+ default: "",
73
+ placeholder: "gpt-4o, claude-3.5-sonnet, grok-code-fast-1, etc.",
74
+ description: "Enter the model name manually. This is useful for new/beta models not yet in the list.",
75
+ hint: "Examples: gpt-4o, gpt-4o-mini, claude-3.5-sonnet, gemini-2.0-flash-exp, grok-code-fast-1",
76
+ displayOptions: {
77
+ show: {
78
+ modelSource: ["fromList"],
79
+ model: ["__manual__"],
80
+ },
81
+ },
26
82
  },
27
83
  {
28
84
  displayName: "Messages Input Mode",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.37.7",
3
+ "version": "3.38.1",
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",
@@ -77,6 +77,11 @@ class DynamicModelsManager {
77
77
  });
78
78
  }
79
79
  static modelsToN8nOptions(models) {
80
+ const nameCount = new Map();
81
+ models.forEach((model) => {
82
+ const displayName = model.display_name || model.name || model.id;
83
+ nameCount.set(displayName, (nameCount.get(displayName) || 0) + 1);
84
+ });
80
85
  return models.map((model) => {
81
86
  const badges = [];
82
87
  if (model.capabilities) {
@@ -96,10 +101,14 @@ class DynamicModelsManager {
96
101
  }
97
102
  const displayName = model.display_name || model.name || model.id;
98
103
  const badgesText = badges.length > 0 ? ` [${badges.join(" • ")}]` : "";
104
+ const hasDuplicates = (nameCount.get(displayName) || 0) > 1;
99
105
  let description = "";
100
106
  if (model.capabilities) {
101
107
  const limits = model.capabilities.limits || {};
102
108
  const parts = [];
109
+ if (hasDuplicates) {
110
+ parts.push(`ID: ${model.id}`);
111
+ }
103
112
  if (limits.max_context_window_tokens) {
104
113
  parts.push(`Context: ${(limits.max_context_window_tokens / 1000).toFixed(0)}k`);
105
114
  }
@@ -111,6 +120,9 @@ class DynamicModelsManager {
111
120
  }
112
121
  description = parts.join(" • ");
113
122
  }
123
+ else if (hasDuplicates) {
124
+ description = `ID: ${model.id}`;
125
+ }
114
126
  return {
115
127
  name: `${displayName}${badgesText}`,
116
128
  value: model.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "3.37.7",
3
+ "version": "3.38.1",
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",