n8n-nodes-github-copilot 4.3.0 → 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 (35) 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/package.json +3 -4
  10. package/dist/shared/models/DynamicModelLoader.d.ts +1 -0
  11. package/dist/shared/models/DynamicModelLoader.js +12 -0
  12. package/dist/shared/models/GitHubCopilotModels.d.ts +14 -8
  13. package/dist/shared/models/GitHubCopilotModels.js +255 -74
  14. package/dist/shared/utils/DynamicModelsManager.d.ts +11 -0
  15. package/dist/shared/utils/DynamicModelsManager.js +50 -0
  16. package/dist/shared/utils/GitHubCopilotApiUtils.d.ts +1 -0
  17. package/dist/shared/utils/GitHubCopilotApiUtils.js +85 -6
  18. package/package.json +3 -4
  19. package/shared/icons/copilot.svg +0 -34
  20. package/shared/index.ts +0 -27
  21. package/shared/models/DynamicModelLoader.ts +0 -124
  22. package/shared/models/GitHubCopilotModels.ts +0 -420
  23. package/shared/models/ModelVersionRequirements.ts +0 -165
  24. package/shared/properties/ModelProperties.ts +0 -52
  25. package/shared/properties/ModelSelectionProperty.ts +0 -68
  26. package/shared/utils/DynamicModelsManager.ts +0 -355
  27. package/shared/utils/EmbeddingsApiUtils.ts +0 -135
  28. package/shared/utils/FileChunkingApiUtils.ts +0 -176
  29. package/shared/utils/FileOptimizationUtils.ts +0 -210
  30. package/shared/utils/GitHubCopilotApiUtils.ts +0 -407
  31. package/shared/utils/GitHubCopilotEndpoints.ts +0 -212
  32. package/shared/utils/GitHubDeviceFlowHandler.ts +0 -276
  33. package/shared/utils/OAuthTokenManager.ts +0 -196
  34. package/shared/utils/provider-injection.ts +0 -277
  35. 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
  ];
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "n8n-nodes-github-copilot",
3
- "version": "4.3.0",
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
  };