n8n-nodes-github-copilot 4.4.17 → 4.5.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.
@@ -0,0 +1,352 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_COMPLETION_PROPERTIES = void 0;
4
+ const ModelProperties_1 = require("../../../shared/properties/ModelProperties");
5
+ exports.CHAT_COMPLETION_PROPERTIES = [
6
+ ...ModelProperties_1.CHAT_MODEL_PROPERTIES,
7
+ {
8
+ displayName: 'Messages Input Mode',
9
+ name: 'messagesInputMode',
10
+ type: 'options',
11
+ options: [
12
+ {
13
+ name: 'Manual (UI)',
14
+ value: 'manual',
15
+ description: 'Enter messages one by one using the UI',
16
+ },
17
+ {
18
+ name: 'JSON (Programmatic)',
19
+ value: 'json',
20
+ description: 'Provide messages as JSON array',
21
+ },
22
+ ],
23
+ default: 'manual',
24
+ description: 'How to provide the messages for the conversation',
25
+ },
26
+ {
27
+ displayName: 'Messages (JSON)',
28
+ name: 'messagesJson',
29
+ type: 'json',
30
+ default: `[
31
+ {
32
+ "role": "system",
33
+ "content": "You are a helpful assistant."
34
+ },
35
+ {
36
+ "role": "user",
37
+ "content": "Hello!"
38
+ }
39
+ ]`,
40
+ placeholder: 'Enter messages as JSON array',
41
+ description: 'Array of messages in OpenAI format: [{"role": "user", "content": "..."}]',
42
+ displayOptions: {
43
+ show: {
44
+ messagesInputMode: ['json'],
45
+ },
46
+ },
47
+ },
48
+ {
49
+ displayName: 'Messages',
50
+ name: 'messages',
51
+ type: 'fixedCollection',
52
+ typeOptions: {
53
+ multipleValues: true,
54
+ sortable: true,
55
+ },
56
+ default: {
57
+ message: [{ role: 'user', content: '' }],
58
+ },
59
+ displayOptions: {
60
+ show: {
61
+ messagesInputMode: ['manual'],
62
+ },
63
+ },
64
+ options: [
65
+ {
66
+ name: 'message',
67
+ displayName: 'Message',
68
+ values: [
69
+ {
70
+ displayName: 'Role',
71
+ name: 'role',
72
+ type: 'options',
73
+ options: [
74
+ {
75
+ name: 'System',
76
+ value: 'system',
77
+ description: 'System message to set the behavior of the AI',
78
+ },
79
+ {
80
+ name: 'User',
81
+ value: 'user',
82
+ description: 'Message from the user',
83
+ },
84
+ {
85
+ name: 'Assistant',
86
+ value: 'assistant',
87
+ description: 'Previous response from the AI assistant',
88
+ },
89
+ ],
90
+ default: 'user',
91
+ },
92
+ {
93
+ displayName: 'Content',
94
+ name: 'content',
95
+ type: 'string',
96
+ typeOptions: { rows: 3 },
97
+ default: '',
98
+ placeholder: 'Enter message content...',
99
+ description: 'The content of the message',
100
+ displayOptions: {
101
+ show: { type: ['text', 'file'] },
102
+ },
103
+ },
104
+ {
105
+ displayName: 'Caption',
106
+ name: 'caption',
107
+ type: 'string',
108
+ typeOptions: { rows: 2 },
109
+ default: '',
110
+ placeholder: 'Optional prompt for the image...',
111
+ description: 'Text to accompany the image (optional)',
112
+ displayOptions: {
113
+ show: { type: ['file_binary'] },
114
+ },
115
+ },
116
+ {
117
+ displayName: 'Type',
118
+ name: 'type',
119
+ type: 'options',
120
+ options: [
121
+ { name: 'Text', value: 'text', description: 'Regular text message' },
122
+ {
123
+ name: 'File (URL / Base64)',
124
+ value: 'file',
125
+ description: 'File attachment using URL or Base64 string',
126
+ },
127
+ {
128
+ name: 'File (Binary)',
129
+ value: 'file_binary',
130
+ description: 'File attachment from binary input',
131
+ },
132
+ ],
133
+ default: 'text',
134
+ description: 'The type of message content',
135
+ },
136
+ {
137
+ displayName: 'Input Binary Field',
138
+ name: 'binaryPropertyName',
139
+ type: 'string',
140
+ default: 'data',
141
+ required: true,
142
+ displayOptions: {
143
+ show: { type: ['file_binary'] },
144
+ },
145
+ description: 'The name of the binary property that contains the file to upload',
146
+ },
147
+ ],
148
+ },
149
+ ],
150
+ description: 'Array of messages for the conversation',
151
+ },
152
+ {
153
+ displayName: 'Advanced Options',
154
+ name: 'advancedOptions',
155
+ type: 'collection',
156
+ placeholder: 'Add Advanced Option',
157
+ default: {},
158
+ options: [
159
+ {
160
+ displayName: 'Response Format',
161
+ name: 'response_format',
162
+ type: 'options',
163
+ options: [
164
+ { name: 'Text', value: 'text', description: 'Return response as plain text' },
165
+ {
166
+ name: 'JSON Object',
167
+ value: 'json_object',
168
+ description: 'Return response as JSON object',
169
+ },
170
+ ],
171
+ default: 'text',
172
+ description: 'The format of the response',
173
+ },
174
+ {
175
+ displayName: 'Temperature',
176
+ name: 'temperature',
177
+ type: 'number',
178
+ typeOptions: { minValue: 0, maxValue: 2, numberPrecision: 2 },
179
+ default: 1,
180
+ description: 'Controls randomness in the response. Lower values make responses more focused and deterministic.',
181
+ },
182
+ {
183
+ displayName: 'Max Tokens',
184
+ name: 'max_tokens',
185
+ type: 'number',
186
+ typeOptions: { minValue: 1, maxValue: 16384 },
187
+ default: 4096,
188
+ placeholder: '4096',
189
+ description: 'Maximum number of tokens to generate in the response',
190
+ hint: 'Default: 4096 tokens. Increase for longer responses, decrease for shorter ones.',
191
+ },
192
+ {
193
+ displayName: 'Top P',
194
+ name: 'top_p',
195
+ type: 'number',
196
+ typeOptions: { minValue: 0, maxValue: 1, numberPrecision: 2 },
197
+ default: 1,
198
+ description: 'Controls diversity via nucleus sampling',
199
+ },
200
+ {
201
+ displayName: 'Frequency Penalty',
202
+ name: 'frequency_penalty',
203
+ type: 'number',
204
+ typeOptions: { minValue: -2, maxValue: 2, numberPrecision: 2 },
205
+ default: 0,
206
+ description: 'Penalty for repeated tokens based on their frequency',
207
+ },
208
+ {
209
+ displayName: 'Presence Penalty',
210
+ name: 'presence_penalty',
211
+ type: 'number',
212
+ typeOptions: { minValue: -2, maxValue: 2, numberPrecision: 2 },
213
+ default: 0,
214
+ description: 'Penalty for repeated tokens based on their presence',
215
+ },
216
+ {
217
+ displayName: 'Stop Sequences',
218
+ name: 'stop',
219
+ type: 'string',
220
+ default: '',
221
+ placeholder: '["\\n", "Human:", "AI:"]',
222
+ description: 'JSON array of strings where the API will stop generating tokens',
223
+ },
224
+ {
225
+ displayName: 'Stream',
226
+ name: 'stream',
227
+ type: 'boolean',
228
+ default: false,
229
+ description: 'Whether to stream the response',
230
+ },
231
+ {
232
+ displayName: 'Seed',
233
+ name: 'seed',
234
+ type: 'number',
235
+ default: 0,
236
+ placeholder: '12345',
237
+ description: 'Seed for deterministic sampling (0 = disabled)',
238
+ },
239
+ {
240
+ displayName: 'User ID',
241
+ name: 'user',
242
+ type: 'string',
243
+ default: '',
244
+ placeholder: 'user-123',
245
+ description: 'Unique identifier for the end-user',
246
+ },
247
+ {
248
+ displayName: 'Tools (Function Calling)',
249
+ name: 'tools',
250
+ type: 'string',
251
+ default: '',
252
+ typeOptions: { rows: 10 },
253
+ placeholder: `[
254
+ {
255
+ "type": "function",
256
+ "function": {
257
+ "name": "get_weather",
258
+ "description": "Get current weather",
259
+ "parameters": {
260
+ "type": "object",
261
+ "properties": {
262
+ "location": {"type": "string", "description": "City name"}
263
+ },
264
+ "required": ["location"]
265
+ }
266
+ }
267
+ }
268
+ ]`,
269
+ description: 'Optional: Array of tools/functions available to the model (OpenAI format).',
270
+ hint: "JSON array of tool definitions in OpenAI format. Leave empty if not using function calling.",
271
+ },
272
+ {
273
+ displayName: 'Tool Choice',
274
+ name: 'tool_choice',
275
+ type: 'options',
276
+ options: [
277
+ { name: 'Auto', value: 'auto', description: 'Let the model decide whether to call functions' },
278
+ { name: 'None', value: 'none', description: 'Force the model to not call any functions' },
279
+ { name: 'Required', value: 'required', description: 'Force the model to call at least one function' },
280
+ ],
281
+ default: 'auto',
282
+ description: 'Control how the model uses tools',
283
+ displayOptions: { show: { tools: ['/.+/'] } },
284
+ },
285
+ {
286
+ displayName: 'Enable Retry',
287
+ name: 'enableRetry',
288
+ type: 'boolean',
289
+ default: true,
290
+ description: 'Whether to retry failed requests',
291
+ },
292
+ {
293
+ displayName: 'Max Retries',
294
+ name: 'maxRetries',
295
+ type: 'number',
296
+ default: 3,
297
+ description: 'Maximum number of retries for failed requests',
298
+ displayOptions: { show: { enableRetry: [true] } },
299
+ },
300
+ {
301
+ displayName: 'Retry Delay (ms)',
302
+ name: 'retryDelay',
303
+ type: 'number',
304
+ default: 1000,
305
+ description: 'Delay between retries in milliseconds',
306
+ displayOptions: { show: { enableRetry: [true] } },
307
+ },
308
+ {
309
+ displayName: 'Request Timeout (ms)',
310
+ name: 'timeout',
311
+ type: 'number',
312
+ default: 60000,
313
+ description: 'Request timeout in milliseconds',
314
+ },
315
+ {
316
+ displayName: 'Debug Mode',
317
+ name: 'debugMode',
318
+ type: 'boolean',
319
+ default: false,
320
+ description: 'Enable debug logging',
321
+ },
322
+ {
323
+ displayName: 'Enable Vision Fallback',
324
+ name: 'enableVisionFallback',
325
+ type: 'boolean',
326
+ default: false,
327
+ description: 'When the primary model does not support vision, automatically use a vision-capable fallback model to process images.',
328
+ },
329
+ {
330
+ displayName: 'Vision Fallback Model',
331
+ name: 'visionFallbackModel',
332
+ type: 'options',
333
+ typeOptions: { loadOptionsMethod: 'getVisionFallbackModels' },
334
+ default: '',
335
+ description: 'Vision-capable model to use when the primary model does not support images',
336
+ displayOptions: { show: { enableVisionFallback: [true] } },
337
+ },
338
+ {
339
+ displayName: 'Custom Vision Model',
340
+ name: 'visionFallbackCustomModel',
341
+ type: 'string',
342
+ default: '',
343
+ placeholder: 'gpt-4o, claude-sonnet-4, gemini-2.0-flash, etc.',
344
+ description: 'Enter the model name manually for vision fallback',
345
+ hint: 'Enter the exact model ID for vision processing (e.g., gpt-4o, claude-sonnet-4)',
346
+ displayOptions: {
347
+ show: { enableVisionFallback: [true], visionFallbackModel: ['__manual__'] },
348
+ },
349
+ },
350
+ ],
351
+ },
352
+ ];
@@ -0,0 +1,2 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const MODELS_PROPERTIES: INodeProperties[];
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MODELS_PROPERTIES = void 0;
4
+ exports.MODELS_PROPERTIES = [
5
+ {
6
+ displayName: 'Filter',
7
+ name: 'modelsFilter',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ options: [
11
+ {
12
+ name: 'All Models',
13
+ value: 'all',
14
+ description: 'Return all models, including disabled ones',
15
+ },
16
+ {
17
+ name: 'Enabled Models',
18
+ value: 'enabled',
19
+ description: 'Only models with model_picker_enabled = true (default Copilot UI set)',
20
+ },
21
+ {
22
+ name: 'Chat Models Only',
23
+ value: 'chat',
24
+ description: 'Enabled chat models (excludes embeddings)',
25
+ },
26
+ {
27
+ name: 'Embedding Models Only',
28
+ value: 'embeddings',
29
+ description: 'Only embedding models (text-embedding-*)',
30
+ },
31
+ ],
32
+ default: 'enabled',
33
+ description: 'Which subset of models to return',
34
+ },
35
+ ];
@@ -0,0 +1,3 @@
1
+ import { IDataObject } from 'n8n-workflow';
2
+ export type ModelsFilter = 'all' | 'enabled' | 'chat' | 'embeddings';
3
+ export declare function fetchModelsOpenAIFormat(token: string, filter: ModelsFilter): Promise<IDataObject>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fetchModelsOpenAIFormat = fetchModelsOpenAIFormat;
4
+ const GitHubCopilotEndpoints_1 = require("../../../shared/utils/GitHubCopilotEndpoints");
5
+ function vendorToOwnedBy(vendor) {
6
+ if (!vendor)
7
+ return 'github-copilot';
8
+ return vendor.toLowerCase().replace(/\s+/g, '-');
9
+ }
10
+ function applyFilter(models, filter) {
11
+ switch (filter) {
12
+ case 'enabled':
13
+ return models.filter((m) => m.model_picker_enabled !== false);
14
+ case 'chat':
15
+ return models.filter((m) => { var _a; return m.model_picker_enabled !== false && ((_a = m.capabilities) === null || _a === void 0 ? void 0 : _a.type) !== 'embeddings'; });
16
+ case 'embeddings':
17
+ return models.filter((m) => { var _a; return ((_a = m.capabilities) === null || _a === void 0 ? void 0 : _a.type) === 'embeddings'; });
18
+ default:
19
+ return models;
20
+ }
21
+ }
22
+ async function fetchModelsOpenAIFormat(token, filter) {
23
+ var _a;
24
+ const response = await fetch(GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getModelsUrl(), {
25
+ method: 'GET',
26
+ headers: GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.getAuthHeaders(token),
27
+ });
28
+ if (!response.ok) {
29
+ const errorText = await response.text();
30
+ throw new Error(GitHubCopilotEndpoints_1.GITHUB_COPILOT_API.ERRORS.API_ERROR(response.status, errorText));
31
+ }
32
+ const raw = (await response.json());
33
+ const allModels = (_a = raw.data) !== null && _a !== void 0 ? _a : [];
34
+ const filtered = applyFilter(allModels, filter);
35
+ const data = filtered.map((model) => {
36
+ var _a, _b, _c, _d;
37
+ return ({
38
+ id: model.id,
39
+ object: 'model',
40
+ created: 0,
41
+ owned_by: vendorToOwnedBy(model.vendor),
42
+ name: (_a = model.name) !== null && _a !== void 0 ? _a : model.id,
43
+ vendor: (_b = model.vendor) !== null && _b !== void 0 ? _b : 'GitHub Copilot',
44
+ version: model.version,
45
+ preview: (_c = model.preview) !== null && _c !== void 0 ? _c : false,
46
+ model_picker_enabled: (_d = model.model_picker_enabled) !== null && _d !== void 0 ? _d : true,
47
+ model_picker_category: model.model_picker_category,
48
+ capabilities: model.capabilities,
49
+ billing: model.billing,
50
+ });
51
+ });
52
+ return {
53
+ object: 'list',
54
+ data,
55
+ _meta: {
56
+ total: data.length,
57
+ source_total: allModels.length,
58
+ filter_applied: filter,
59
+ fetched_at: new Date().toISOString(),
60
+ },
61
+ };
62
+ }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.17",
3
+ "version": "4.5.1",
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",
@@ -58,8 +58,10 @@
58
58
  "pnpm": ">=7.1"
59
59
  },
60
60
  "dependencies": {
61
- "@langchain/openai": "^0.6.14",
62
- "n8n-workflow": "^1.110.0"
61
+ "@langchain/openai": "^0.6.14"
62
+ },
63
+ "peerDependencies": {
64
+ "n8n-workflow": ">=1.0.0"
63
65
  },
64
66
  "overrides": {
65
67
  "form-data": "^4.0.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.4.17",
3
+ "version": "4.5.1",
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",
@@ -58,8 +58,10 @@
58
58
  "pnpm": ">=7.1"
59
59
  },
60
60
  "dependencies": {
61
- "@langchain/openai": "^0.6.14",
62
- "n8n-workflow": "^1.110.0"
61
+ "@langchain/openai": "^0.6.14"
62
+ },
63
+ "peerDependencies": {
64
+ "n8n-workflow": ">=1.0.0"
63
65
  },
64
66
  "overrides": {
65
67
  "form-data": "^4.0.4",