n8n-nodes-github-copilot 4.2.1 → 4.4.0

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.
Files changed (37) hide show
  1. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +1 -0
  2. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +47 -15
  3. package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +37 -0
  4. package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +1 -0
  5. package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +174 -10
  6. package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.d.ts +1 -0
  7. package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.js +65 -4
  8. package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.js +64 -27
  9. package/dist/nodes/GitHubCopilotPGVector/GitHubCopilotPGVector.node.d.ts +10 -0
  10. package/dist/nodes/GitHubCopilotPGVector/GitHubCopilotPGVector.node.js +421 -0
  11. package/dist/package.json +3 -4
  12. package/dist/shared/models/DynamicModelLoader.d.ts +1 -0
  13. package/dist/shared/models/DynamicModelLoader.js +12 -0
  14. package/dist/shared/models/GitHubCopilotModels.d.ts +14 -8
  15. package/dist/shared/models/GitHubCopilotModels.js +255 -74
  16. package/dist/shared/utils/DynamicModelsManager.d.ts +11 -0
  17. package/dist/shared/utils/DynamicModelsManager.js +50 -0
  18. package/dist/shared/utils/GitHubCopilotApiUtils.d.ts +1 -0
  19. package/dist/shared/utils/GitHubCopilotApiUtils.js +85 -6
  20. package/package.json +3 -4
  21. package/shared/icons/copilot.svg +0 -34
  22. package/shared/index.ts +0 -27
  23. package/shared/models/DynamicModelLoader.ts +0 -124
  24. package/shared/models/GitHubCopilotModels.ts +0 -420
  25. package/shared/models/ModelVersionRequirements.ts +0 -165
  26. package/shared/properties/ModelProperties.ts +0 -52
  27. package/shared/properties/ModelSelectionProperty.ts +0 -68
  28. package/shared/utils/DynamicModelsManager.ts +0 -355
  29. package/shared/utils/EmbeddingsApiUtils.ts +0 -135
  30. package/shared/utils/FileChunkingApiUtils.ts +0 -176
  31. package/shared/utils/FileOptimizationUtils.ts +0 -210
  32. package/shared/utils/GitHubCopilotApiUtils.ts +0 -407
  33. package/shared/utils/GitHubCopilotEndpoints.ts +0 -212
  34. package/shared/utils/GitHubDeviceFlowHandler.ts +0 -276
  35. package/shared/utils/OAuthTokenManager.ts +0 -196
  36. package/shared/utils/provider-injection.ts +0 -277
  37. package/shared/utils/version-detection.ts +0 -145
@@ -27,15 +27,15 @@ exports.nodeProperties = [
27
27
  displayName: 'Messages (JSON)',
28
28
  name: 'messagesJson',
29
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
- }
30
+ default: `[
31
+ {
32
+ "role": "system",
33
+ "content": "You are a helpful assistant."
34
+ },
35
+ {
36
+ "role": "user",
37
+ "content": "Hello!"
38
+ }
39
39
  ]`,
40
40
  placeholder: 'Enter messages as JSON array',
41
41
  description: 'Array of messages in OpenAI format: [{"role": "user", "content": "..."}]',
@@ -255,24 +255,24 @@ exports.nodeProperties = [
255
255
  typeOptions: {
256
256
  rows: 10,
257
257
  },
258
- placeholder: `[
259
- {
260
- "type": "function",
261
- "function": {
262
- "name": "get_weather",
263
- "description": "Get current weather",
264
- "parameters": {
265
- "type": "object",
266
- "properties": {
267
- "location": {
268
- "type": "string",
269
- "description": "City name"
270
- }
271
- },
272
- "required": ["location"]
273
- }
274
- }
275
- }
258
+ placeholder: `[
259
+ {
260
+ "type": "function",
261
+ "function": {
262
+ "name": "get_weather",
263
+ "description": "Get current weather",
264
+ "parameters": {
265
+ "type": "object",
266
+ "properties": {
267
+ "location": {
268
+ "type": "string",
269
+ "description": "City name"
270
+ }
271
+ },
272
+ "required": ["location"]
273
+ }
274
+ }
275
+ }
276
276
  ]`,
277
277
  description: 'Optional: Array of tools/functions available to the model (OpenAI format). Leave empty if not using function calling.',
278
278
  hint: "JSON array of tool definitions in OpenAI format. Leave this field empty if you don't need function calling.",
@@ -351,6 +351,43 @@ exports.nodeProperties = [
351
351
  default: false,
352
352
  description: 'Enable debug logging',
353
353
  },
354
+ {
355
+ displayName: 'Enable Vision Fallback',
356
+ name: 'enableVisionFallback',
357
+ type: 'boolean',
358
+ default: false,
359
+ description: 'When the primary model does not support vision, automatically use a vision-capable fallback model to process images. Enable this if you want to send images but your primary model does not support vision.',
360
+ },
361
+ {
362
+ displayName: 'Vision Fallback Model',
363
+ name: 'visionFallbackModel',
364
+ type: 'options',
365
+ typeOptions: {
366
+ loadOptionsMethod: 'getVisionFallbackModels',
367
+ },
368
+ default: '',
369
+ description: 'Select a vision-capable model to use when processing images with a non-vision primary model',
370
+ displayOptions: {
371
+ show: {
372
+ enableVisionFallback: [true],
373
+ },
374
+ },
375
+ },
376
+ {
377
+ displayName: 'Custom Vision Model',
378
+ name: 'visionFallbackCustomModel',
379
+ type: 'string',
380
+ default: '',
381
+ placeholder: 'gpt-4o, claude-sonnet-4, gemini-2.0-flash, etc.',
382
+ description: 'Enter the model name manually for vision fallback',
383
+ hint: 'Enter the exact model ID for vision processing (e.g., gpt-4o, claude-sonnet-4)',
384
+ displayOptions: {
385
+ show: {
386
+ enableVisionFallback: [true],
387
+ visionFallbackModel: ['__manual__'],
388
+ },
389
+ },
390
+ },
354
391
  ],
355
392
  },
356
393
  ];
@@ -0,0 +1,10 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare class GitHubCopilotPGVector implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ loadOptions: {
6
+ getAvailableEmbeddingModels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
+ };
8
+ };
9
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
10
+ }
@@ -0,0 +1,421 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GitHubCopilotPGVector = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const OAuthTokenManager_1 = require("../../shared/utils/OAuthTokenManager");
6
+ const GitHubCopilotEndpoints_1 = require("../../shared/utils/GitHubCopilotEndpoints");
7
+ const DynamicModelLoader_1 = require("../../shared/models/DynamicModelLoader");
8
+ const EmbeddingsApiUtils_1 = require("../../shared/utils/EmbeddingsApiUtils");
9
+ class GitHubCopilotPGVector {
10
+ constructor() {
11
+ this.description = {
12
+ displayName: 'GitHub Copilot PGVector',
13
+ name: 'gitHubCopilotPGVector',
14
+ icon: 'file:../../shared/icons/copilot.svg',
15
+ group: ['transform'],
16
+ version: 1,
17
+ subtitle: '={{$parameter["operation"]}}',
18
+ description: 'GitHub Copilot Embeddings for Postgres PGVector Store',
19
+ defaults: {
20
+ name: 'GitHub Copilot PGVector',
21
+ },
22
+ inputs: ['main'],
23
+ outputs: ['main'],
24
+ credentials: [
25
+ {
26
+ name: 'githubCopilotApi',
27
+ required: true,
28
+ },
29
+ {
30
+ name: 'postgres',
31
+ required: true,
32
+ },
33
+ ],
34
+ properties: [
35
+ {
36
+ displayName: 'Operation',
37
+ name: 'operation',
38
+ type: 'options',
39
+ noDataExpression: true,
40
+ options: [
41
+ {
42
+ name: 'Insert Documents',
43
+ value: 'insert',
44
+ description: 'Insert documents with embeddings into PGVector',
45
+ action: 'Insert documents into PGVector',
46
+ },
47
+ {
48
+ name: 'Search Similar',
49
+ value: 'search',
50
+ description: 'Search for similar documents using vector similarity',
51
+ action: 'Search similar documents',
52
+ },
53
+ {
54
+ name: 'Create Table',
55
+ value: 'createTable',
56
+ description: 'Create PGVector table with embeddings column',
57
+ action: 'Create PGVector table',
58
+ },
59
+ ],
60
+ default: 'insert',
61
+ },
62
+ {
63
+ displayName: 'Embedding Model',
64
+ name: 'model',
65
+ type: 'options',
66
+ typeOptions: {
67
+ loadOptionsMethod: 'getAvailableEmbeddingModels',
68
+ },
69
+ options: [
70
+ {
71
+ name: 'Text Embedding 3 Small',
72
+ value: 'text-embedding-3-small',
73
+ description: "OpenAI's text-embedding-3-small model (recommended)",
74
+ },
75
+ {
76
+ name: 'Text Embedding Ada 002',
77
+ value: 'text-embedding-ada-002',
78
+ description: 'Legacy embedding model',
79
+ },
80
+ ],
81
+ default: 'text-embedding-3-small',
82
+ description: 'Embedding model to use',
83
+ },
84
+ {
85
+ displayName: 'Table Name',
86
+ name: 'tableName',
87
+ type: 'string',
88
+ default: 'documents',
89
+ required: true,
90
+ placeholder: 'documents',
91
+ description: 'Name of the PGVector table',
92
+ displayOptions: {
93
+ show: {
94
+ operation: ['insert', 'search', 'createTable'],
95
+ },
96
+ },
97
+ },
98
+ {
99
+ displayName: 'Text Field',
100
+ name: 'textField',
101
+ type: 'string',
102
+ default: 'text',
103
+ required: true,
104
+ placeholder: 'text',
105
+ description: 'Field name containing the text to embed',
106
+ displayOptions: {
107
+ show: {
108
+ operation: ['insert'],
109
+ },
110
+ },
111
+ },
112
+ {
113
+ displayName: 'Metadata Fields',
114
+ name: 'metadataFields',
115
+ type: 'string',
116
+ default: '',
117
+ placeholder: 'title,author,date',
118
+ description: 'Comma-separated list of metadata fields to store (optional)',
119
+ displayOptions: {
120
+ show: {
121
+ operation: ['insert'],
122
+ },
123
+ },
124
+ },
125
+ {
126
+ displayName: 'Query Text',
127
+ name: 'queryText',
128
+ type: 'string',
129
+ default: '',
130
+ required: true,
131
+ placeholder: 'Search query text',
132
+ description: 'Text to search for similar documents',
133
+ displayOptions: {
134
+ show: {
135
+ operation: ['search'],
136
+ },
137
+ },
138
+ },
139
+ {
140
+ displayName: 'Limit',
141
+ name: 'limit',
142
+ type: 'number',
143
+ default: 10,
144
+ description: 'Maximum number of results to return',
145
+ displayOptions: {
146
+ show: {
147
+ operation: ['search'],
148
+ },
149
+ },
150
+ },
151
+ {
152
+ displayName: 'Distance Threshold',
153
+ name: 'distanceThreshold',
154
+ type: 'number',
155
+ default: 1.0,
156
+ description: 'Maximum cosine distance for results (0-2, lower is more similar)',
157
+ displayOptions: {
158
+ show: {
159
+ operation: ['search'],
160
+ },
161
+ },
162
+ typeOptions: {
163
+ minValue: 0,
164
+ maxValue: 2,
165
+ numberPrecision: 2,
166
+ },
167
+ },
168
+ {
169
+ displayName: 'Vector Dimensions',
170
+ name: 'vectorDimensions',
171
+ type: 'number',
172
+ default: 1536,
173
+ description: 'Number of dimensions for the embedding vector',
174
+ displayOptions: {
175
+ show: {
176
+ operation: ['createTable'],
177
+ },
178
+ },
179
+ },
180
+ {
181
+ displayName: 'Options',
182
+ name: 'options',
183
+ type: 'collection',
184
+ placeholder: 'Add Option',
185
+ default: {},
186
+ options: [
187
+ {
188
+ displayName: 'Dimensions',
189
+ name: 'dimensions',
190
+ type: 'number',
191
+ default: 1536,
192
+ description: 'The number of dimensions for the embedding (text-embedding-3-small supports 512-1536)',
193
+ typeOptions: {
194
+ minValue: 1,
195
+ maxValue: 1536,
196
+ },
197
+ },
198
+ {
199
+ displayName: 'Embedding Column Name',
200
+ name: 'embeddingColumn',
201
+ type: 'string',
202
+ default: 'embedding',
203
+ description: 'Name of the column storing embeddings',
204
+ },
205
+ {
206
+ displayName: 'ID Column Name',
207
+ name: 'idColumn',
208
+ type: 'string',
209
+ default: 'id',
210
+ description: 'Name of the ID column',
211
+ },
212
+ {
213
+ displayName: 'Text Column Name',
214
+ name: 'textColumn',
215
+ type: 'string',
216
+ default: 'content',
217
+ description: 'Name of the column storing text content',
218
+ },
219
+ {
220
+ displayName: 'Batch Size',
221
+ name: 'batchSize',
222
+ type: 'number',
223
+ default: 10,
224
+ description: 'Number of documents to process in each batch',
225
+ typeOptions: {
226
+ minValue: 1,
227
+ maxValue: 100,
228
+ },
229
+ },
230
+ {
231
+ displayName: 'Enable Retry',
232
+ name: 'enableRetry',
233
+ type: 'boolean',
234
+ default: true,
235
+ description: 'Whether to retry on TPM quota errors (403)',
236
+ },
237
+ ],
238
+ },
239
+ ],
240
+ };
241
+ this.methods = {
242
+ loadOptions: {
243
+ async getAvailableEmbeddingModels() {
244
+ return await DynamicModelLoader_1.loadAvailableEmbeddingModels.call(this);
245
+ },
246
+ },
247
+ };
248
+ }
249
+ async execute() {
250
+ const items = this.getInputData();
251
+ const returnData = [];
252
+ const operation = this.getNodeParameter('operation', 0);
253
+ const postgresCredentials = await this.getCredentials('postgres', 0);
254
+ const githubCredentials = await this.getCredentials('githubCopilotApi', 0);
255
+ const githubToken = githubCredentials.token;
256
+ if (!GitHubCopilotEndpoints_1.GitHubCopilotEndpoints.validateToken(githubToken)) {
257
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), "Invalid GitHub token format. Token must start with 'gho_' or 'github_pat_'");
258
+ }
259
+ const oauthToken = await OAuthTokenManager_1.OAuthTokenManager.getValidOAuthToken(githubToken);
260
+ const tableName = this.getNodeParameter('tableName', 0);
261
+ const model = this.getNodeParameter('model', 0);
262
+ const options = this.getNodeParameter('options', 0, {});
263
+ const { Client } = require('pg');
264
+ const pgClient = new Client({
265
+ host: postgresCredentials.host,
266
+ port: postgresCredentials.port,
267
+ user: postgresCredentials.user,
268
+ password: postgresCredentials.password,
269
+ database: postgresCredentials.database,
270
+ });
271
+ try {
272
+ await pgClient.connect();
273
+ switch (operation) {
274
+ case 'createTable': {
275
+ const vectorDimensions = this.getNodeParameter('vectorDimensions', 0);
276
+ const embeddingColumn = options.embeddingColumn || 'embedding';
277
+ const idColumn = options.idColumn || 'id';
278
+ const textColumn = options.textColumn || 'content';
279
+ await pgClient.query('CREATE EXTENSION IF NOT EXISTS vector');
280
+ const createTableQuery = `
281
+ CREATE TABLE IF NOT EXISTS ${tableName} (
282
+ ${idColumn} SERIAL PRIMARY KEY,
283
+ ${textColumn} TEXT NOT NULL,
284
+ metadata JSONB,
285
+ ${embeddingColumn} vector(${vectorDimensions}),
286
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
287
+ );
288
+
289
+ CREATE INDEX IF NOT EXISTS ${tableName}_${embeddingColumn}_idx
290
+ ON ${tableName} USING ivfflat (${embeddingColumn} vector_cosine_ops)
291
+ WITH (lists = 100);
292
+ `;
293
+ await pgClient.query(createTableQuery);
294
+ returnData.push({
295
+ json: {
296
+ success: true,
297
+ message: `Table ${tableName} created with ${vectorDimensions} dimensions`,
298
+ table: tableName,
299
+ dimensions: vectorDimensions,
300
+ },
301
+ });
302
+ break;
303
+ }
304
+ case 'insert': {
305
+ const textField = this.getNodeParameter('textField', 0);
306
+ const metadataFieldsStr = this.getNodeParameter('metadataFields', 0, '');
307
+ const metadataFields = metadataFieldsStr
308
+ ? metadataFieldsStr.split(',').map((f) => f.trim())
309
+ : [];
310
+ const batchSize = options.batchSize || 10;
311
+ const embeddingColumn = options.embeddingColumn || 'embedding';
312
+ const textColumn = options.textColumn || 'content';
313
+ const dimensions = options.dimensions;
314
+ for (let i = 0; i < items.length; i += batchSize) {
315
+ const batch = items.slice(i, Math.min(i + batchSize, items.length));
316
+ const texts = batch.map((item) => String(item.json[textField]));
317
+ const requestBody = {
318
+ model,
319
+ input: texts,
320
+ };
321
+ if (dimensions) {
322
+ requestBody.dimensions = dimensions;
323
+ }
324
+ const embeddingResponse = await (0, EmbeddingsApiUtils_1.executeEmbeddingsRequest)(oauthToken, requestBody, options.enableRetry !== false, 3);
325
+ for (let j = 0; j < batch.length; j++) {
326
+ const item = batch[j];
327
+ const embedding = embeddingResponse.data[j].embedding;
328
+ const text = texts[j];
329
+ const metadata = {};
330
+ metadataFields.forEach((field) => {
331
+ if (item.json[field] !== undefined) {
332
+ metadata[field] = item.json[field];
333
+ }
334
+ });
335
+ const insertQuery = `
336
+ INSERT INTO ${tableName} (${textColumn}, metadata, ${embeddingColumn})
337
+ VALUES ($1, $2, $3)
338
+ RETURNING *
339
+ `;
340
+ const result = await pgClient.query(insertQuery, [
341
+ text,
342
+ JSON.stringify(metadata),
343
+ `[${embedding.join(',')}]`,
344
+ ]);
345
+ returnData.push({
346
+ json: {
347
+ success: true,
348
+ id: result.rows[0].id,
349
+ text: text.substring(0, 100) + (text.length > 100 ? '...' : ''),
350
+ dimensions: embedding.length,
351
+ },
352
+ pairedItem: { item: i + j },
353
+ });
354
+ }
355
+ }
356
+ break;
357
+ }
358
+ case 'search': {
359
+ const queryText = this.getNodeParameter('queryText', 0);
360
+ const limit = this.getNodeParameter('limit', 0);
361
+ const distanceThreshold = this.getNodeParameter('distanceThreshold', 0);
362
+ const embeddingColumn = options.embeddingColumn || 'embedding';
363
+ const textColumn = options.textColumn || 'content';
364
+ const dimensions = options.dimensions;
365
+ const requestBody = {
366
+ model,
367
+ input: [queryText],
368
+ };
369
+ if (dimensions) {
370
+ requestBody.dimensions = dimensions;
371
+ }
372
+ const embeddingResponse = await (0, EmbeddingsApiUtils_1.executeEmbeddingsRequest)(oauthToken, requestBody, options.enableRetry !== false, 3);
373
+ const queryEmbedding = embeddingResponse.data[0].embedding;
374
+ const searchQuery = `
375
+ SELECT
376
+ *,
377
+ (${embeddingColumn} <=> $1::vector) as distance
378
+ FROM ${tableName}
379
+ WHERE (${embeddingColumn} <=> $1::vector) < $2
380
+ ORDER BY ${embeddingColumn} <=> $1::vector
381
+ LIMIT $3
382
+ `;
383
+ const searchResult = await pgClient.query(searchQuery, [
384
+ `[${queryEmbedding.join(',')}]`,
385
+ distanceThreshold,
386
+ limit,
387
+ ]);
388
+ searchResult.rows.forEach((row) => {
389
+ returnData.push({
390
+ json: {
391
+ id: row.id,
392
+ text: row[textColumn],
393
+ metadata: row.metadata,
394
+ distance: row.distance,
395
+ similarity: 1 - row.distance / 2,
396
+ },
397
+ });
398
+ });
399
+ break;
400
+ }
401
+ }
402
+ }
403
+ catch (error) {
404
+ if (this.continueOnFail()) {
405
+ returnData.push({
406
+ json: {
407
+ error: error instanceof Error ? error.message : 'Unknown error occurred',
408
+ },
409
+ });
410
+ }
411
+ else {
412
+ throw error;
413
+ }
414
+ }
415
+ finally {
416
+ await pgClient.end();
417
+ }
418
+ return [returnData];
419
+ }
420
+ }
421
+ exports.GitHubCopilotPGVector = GitHubCopilotPGVector;
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.2.1",
4
- "description": "n8n community node for GitHub Copilot with CLI, Chat API, AI Chat Model, and n8n v2 Chat Hub integration - access GPT-5, Claude Sonnet 4.5, Gemini and more using your Copilot subscription",
3
+ "version": "4.4.0",
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",
7
7
  "author": {
@@ -21,8 +21,7 @@
21
21
  "prepublishOnly": "npm run build"
22
22
  },
23
23
  "files": [
24
- "dist",
25
- "shared"
24
+ "dist"
26
25
  ],
27
26
  "n8n": {
28
27
  "n8nNodesApiVersion": 1,
@@ -1,3 +1,4 @@
1
1
  import { ILoadOptionsFunctions, INodePropertyOptions } from "n8n-workflow";
2
2
  export declare function loadAvailableModels(this: ILoadOptionsFunctions, forceRefresh?: boolean): Promise<INodePropertyOptions[]>;
3
+ export declare function loadAvailableVisionModels(this: ILoadOptionsFunctions, forceRefresh?: boolean): Promise<INodePropertyOptions[]>;
3
4
  export declare function loadAvailableEmbeddingModels(this: ILoadOptionsFunctions, forceRefresh?: boolean): Promise<INodePropertyOptions[]>;
@@ -1,12 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadAvailableModels = loadAvailableModels;
4
+ exports.loadAvailableVisionModels = loadAvailableVisionModels;
4
5
  exports.loadAvailableEmbeddingModels = loadAvailableEmbeddingModels;
5
6
  const DynamicModelsManager_1 = require("../utils/DynamicModelsManager");
6
7
  const OAuthTokenManager_1 = require("../utils/OAuthTokenManager");
7
8
  async function loadAvailableModels(forceRefresh = false) {
8
9
  return loadModelsWithFilter.call(this, "chat", forceRefresh);
9
10
  }
11
+ async function loadAvailableVisionModels(forceRefresh = false) {
12
+ const allOptions = await loadModelsWithFilter.call(this, "chat", forceRefresh);
13
+ const visionOptions = allOptions.filter((opt) => { var _a; return opt.name.includes("👁️") || ((_a = opt.description) === null || _a === void 0 ? void 0 : _a.includes("Vision")); });
14
+ const manualOption = {
15
+ name: "✏️ Enter Custom Model Name",
16
+ value: "__manual__",
17
+ description: "Type your own model name (for new/beta models)",
18
+ };
19
+ const hasManual = visionOptions.some((o) => o.value === "__manual__");
20
+ return hasManual ? visionOptions : [manualOption, ...visionOptions];
21
+ }
10
22
  async function loadAvailableEmbeddingModels(forceRefresh = false) {
11
23
  return loadModelsWithFilter.call(this, "embeddings", forceRefresh);
12
24
  }
@@ -5,8 +5,8 @@ export interface ModelCapability {
5
5
  maxContextTokens: number;
6
6
  maxOutputTokens: number;
7
7
  streaming: boolean;
8
- provider: "OpenAI" | "Anthropic" | "Google" | "Microsoft";
9
- category: "chat" | "reasoning" | "coding" | "vision" | "multimodal";
8
+ provider: "OpenAI" | "Anthropic" | "Google" | "Microsoft" | "xAI";
9
+ category: "chat" | "reasoning" | "coding" | "vision" | "multimodal" | "versatile" | "powerful" | "lightweight";
10
10
  }
11
11
  export interface GitHubCopilotModel {
12
12
  value: string;
@@ -15,16 +15,19 @@ export interface GitHubCopilotModel {
15
15
  capabilities: ModelCapability;
16
16
  recommended: boolean;
17
17
  status: "stable" | "preview" | "experimental";
18
+ isPremium?: boolean;
18
19
  }
19
20
  export declare const GITHUB_COPILOT_MODELS: GitHubCopilotModel[];
20
21
  export declare class GitHubCopilotModelsManager {
21
22
  static getAllModels(): GitHubCopilotModel[];
22
23
  static getToolsCapableModels(): GitHubCopilotModel[];
23
24
  static getVisionCapableModels(): GitHubCopilotModel[];
24
- static getModelsByProvider(provider: "OpenAI" | "Anthropic" | "Google" | "Microsoft"): GitHubCopilotModel[];
25
- static getModelsByCategory(category: "chat" | "reasoning" | "coding" | "vision" | "multimodal"): GitHubCopilotModel[];
25
+ static getModelsByProvider(provider: "OpenAI" | "Anthropic" | "Google" | "Microsoft" | "xAI"): GitHubCopilotModel[];
26
+ static getModelsByCategory(category: "chat" | "reasoning" | "coding" | "vision" | "multimodal" | "versatile" | "powerful" | "lightweight"): GitHubCopilotModel[];
26
27
  static getRecommendedModels(): GitHubCopilotModel[];
27
28
  static getStableModels(): GitHubCopilotModel[];
29
+ static getFreeModels(): GitHubCopilotModel[];
30
+ static getPremiumModels(): GitHubCopilotModel[];
28
31
  static getModelByValue(value: string): GitHubCopilotModel | undefined;
29
32
  static toN8nOptions(models?: GitHubCopilotModel[]): Array<{
30
33
  name: string;
@@ -34,10 +37,13 @@ export declare class GitHubCopilotModelsManager {
34
37
  static getModelsForUseCase(useCase: "general" | "coding" | "vision" | "reasoning" | "tools"): GitHubCopilotModel[];
35
38
  }
36
39
  export declare const DEFAULT_MODELS: {
37
- readonly GENERAL: "gpt-4o-mini";
38
- readonly CODING: "o3-mini";
40
+ readonly GENERAL: "gpt-4.1";
41
+ readonly CODING: "gpt-5-codex";
39
42
  readonly VISION: "gpt-4o";
40
- readonly REASONING: "claude-sonnet-4";
41
- readonly TOOLS: "gpt-5";
43
+ readonly VISION_FALLBACK: "gpt-4.1";
44
+ readonly REASONING: "o3-mini";
45
+ readonly TOOLS: "gpt-4.1";
42
46
  readonly MULTIMODAL: "gemini-2.5-pro";
47
+ readonly FREE: "gpt-4.1";
48
+ readonly PREMIUM: "gpt-5.2";
43
49
  };