n8n-nodes-github-copilot 3.3.0 → 3.5.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/credentials/GitHubApi.credentials.d.ts +8 -8
  2. package/dist/credentials/GitHubApi.credentials.js +50 -50
  3. package/dist/credentials/GitHubApiManual.credentials.d.ts +7 -7
  4. package/dist/credentials/GitHubApiManual.credentials.js +33 -33
  5. package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +5 -5
  6. package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +324 -324
  7. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +5 -5
  8. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +141 -146
  9. package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +2 -2
  10. package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +172 -202
  11. package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +19 -21
  12. package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +130 -131
  13. package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +8 -8
  14. package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +100 -101
  15. package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +3 -3
  16. package/dist/nodes/GitHubCopilotChatAPI/utils/index.js +19 -19
  17. package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +14 -14
  18. package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +70 -71
  19. package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +5 -5
  20. package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +113 -113
  21. package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +57 -57
  22. package/dist/nodes/GitHubCopilotChatAPI/utils/types.js +2 -2
  23. package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +5 -0
  24. package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +140 -0
  25. package/dist/nodes/GitHubCopilotChatModel/copilot.svg +34 -0
  26. package/dist/shared/models/GitHubCopilotModels.d.ts +43 -0
  27. package/dist/shared/models/GitHubCopilotModels.js +218 -0
  28. package/package.json +7 -6
  29. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.backup.d.ts +0 -5
  30. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.backup.js +0 -651
  31. package/dist/nodes/GitHubCopilotChatAPI/utils/audioProcessor.d.ts +0 -11
  32. package/dist/nodes/GitHubCopilotChatAPI/utils/audioProcessor.js +0 -86
  33. package/dist/nodes/N8nAiAgent/N8nAiAgent.node.d.ts +0 -5
  34. package/dist/nodes/N8nAiAgent/N8nAiAgent.node.js +0 -214
  35. package/dist/nodes/N8nAiAgent/n8n-ai.svg +0 -35
  36. package/dist/nodes/N8nAiAgent/nodeProperties.d.ts +0 -2
  37. package/dist/nodes/N8nAiAgent/nodeProperties.js +0 -432
@@ -1,5 +1,5 @@
1
- import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class GitHubCopilotChatAPI implements INodeType {
3
- description: INodeTypeDescription;
4
- execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
- }
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class GitHubCopilotChatAPI implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -1,146 +1,141 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GitHubCopilotChatAPI = void 0;
4
- const utils_1 = require("./utils");
5
- const nodeProperties_1 = require("./nodeProperties");
6
- const modelCapabilities_1 = require("./utils/modelCapabilities");
7
- const mediaDetection_1 = require("./utils/mediaDetection");
8
- class GitHubCopilotChatAPI {
9
- constructor() {
10
- this.description = {
11
- displayName: 'GitHub Copilot Chat API',
12
- name: 'gitHubCopilotChatAPI',
13
- icon: 'file:copilot.svg',
14
- group: ['AI'],
15
- version: 1,
16
- subtitle: '={{$parameter["operation"] + ": " + $parameter["model"]}}',
17
- description: 'Use official GitHub Copilot Chat API with your subscription - access GPT-5, Claude, Gemini and more',
18
- defaults: {
19
- name: 'GitHub Copilot Chat API',
20
- },
21
- inputs: ["main"],
22
- outputs: ["main"],
23
- credentials: [
24
- {
25
- name: 'githubApi',
26
- required: true,
27
- },
28
- ],
29
- properties: nodeProperties_1.nodeProperties,
30
- };
31
- }
32
- async execute() {
33
- var _a, _b, _c;
34
- const items = this.getInputData();
35
- const returnData = [];
36
- for (let i = 0; i < items.length; i++) {
37
- try {
38
- const operation = this.getNodeParameter('operation', i);
39
- const model = this.getNodeParameter('model', i);
40
- if (operation === 'chat') {
41
- const userMessage = this.getNodeParameter('message', i);
42
- const systemMessage = this.getNodeParameter('systemMessage', i, '');
43
- const advancedOptions = this.getNodeParameter('advancedOptions', i, {});
44
- const includeMedia = this.getNodeParameter('includeMedia', i, false);
45
- if (includeMedia) {
46
- const validation = (0, modelCapabilities_1.validateModelCapabilities)(model, true, false);
47
- if (!validation.isValid) {
48
- throw new Error(validation.errorMessage || 'Model validation failed');
49
- }
50
- if (validation.warnings) {
51
- for (const warning of validation.warnings) {
52
- console.warn(`GitHub Copilot API Warning: ${warning}`);
53
- }
54
- }
55
- }
56
- const messages = [];
57
- if (systemMessage) {
58
- messages.push({
59
- role: 'system',
60
- content: systemMessage,
61
- });
62
- }
63
- let userContent = userMessage;
64
- if (includeMedia) {
65
- const mediaSource = this.getNodeParameter('mediaSource', i);
66
- const mediaFile = this.getNodeParameter('mediaFile', i, '');
67
- const mediaUrl = this.getNodeParameter('mediaUrl', i, '');
68
- const mediaBinaryProperty = this.getNodeParameter('mediaBinaryProperty', i, '');
69
- const contentArray = [];
70
- if (userMessage.trim()) {
71
- contentArray.push({
72
- type: 'text',
73
- text: userMessage,
74
- });
75
- }
76
- try {
77
- const mediaResult = await (0, mediaDetection_1.processMediaFile)(this, i, mediaSource, mediaFile, mediaUrl, mediaBinaryProperty);
78
- if (mediaResult.type === 'image' && mediaResult.dataUrl) {
79
- contentArray.push({
80
- type: 'image_url',
81
- image_url: {
82
- url: mediaResult.dataUrl,
83
- },
84
- });
85
- }
86
- else {
87
- contentArray.push({
88
- type: 'text',
89
- text: `[Image processing failed: ${mediaResult.description}]`,
90
- });
91
- }
92
- }
93
- catch (error) {
94
- contentArray.push({
95
- type: 'text',
96
- text: `[Media processing error: ${error instanceof Error ? error.message : 'Unknown error'}]`,
97
- });
98
- }
99
- userContent = contentArray;
100
- }
101
- messages.push({
102
- role: 'user',
103
- content: userContent,
104
- });
105
- const requestBody = {
106
- model,
107
- messages,
108
- stream: false,
109
- ...advancedOptions,
110
- };
111
- const hasMedia = includeMedia;
112
- const response = await (0, utils_1.makeApiRequest)(this, '/chat/completions', requestBody, hasMedia);
113
- const result = {
114
- message: ((_b = (_a = response.choices[0]) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.content) || '',
115
- model,
116
- operation,
117
- usage: response.usage || null,
118
- finish_reason: ((_c = response.choices[0]) === null || _c === void 0 ? void 0 : _c.finish_reason) || 'unknown',
119
- };
120
- returnData.push({
121
- json: result,
122
- pairedItem: { item: i },
123
- });
124
- }
125
- }
126
- catch (error) {
127
- if (this.continueOnFail()) {
128
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
129
- returnData.push({
130
- json: {
131
- error: errorMessage,
132
- operation: this.getNodeParameter('operation', i),
133
- model: this.getNodeParameter('model', i),
134
- },
135
- pairedItem: { item: i },
136
- });
137
- }
138
- else {
139
- throw error;
140
- }
141
- }
142
- }
143
- return [returnData];
144
- }
145
- }
146
- exports.GitHubCopilotChatAPI = GitHubCopilotChatAPI;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GitHubCopilotChatAPI = void 0;
4
+ const utils_1 = require("./utils");
5
+ const nodeProperties_1 = require("./nodeProperties");
6
+ const mediaDetection_1 = require("./utils/mediaDetection");
7
+ const GitHubCopilotModels_1 = require("../../shared/models/GitHubCopilotModels");
8
+ class GitHubCopilotChatAPI {
9
+ constructor() {
10
+ this.description = {
11
+ displayName: 'GitHub Copilot Chat API',
12
+ name: 'gitHubCopilotChatAPI',
13
+ icon: 'file:copilot.svg',
14
+ group: ['AI'],
15
+ version: 1,
16
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["model"]}}',
17
+ description: 'Use official GitHub Copilot Chat API with your subscription - access GPT-5, Claude, Gemini and more',
18
+ defaults: {
19
+ name: 'GitHub Copilot Chat API',
20
+ },
21
+ inputs: ["main"],
22
+ outputs: ["main"],
23
+ credentials: [
24
+ {
25
+ name: 'githubApi',
26
+ required: true,
27
+ },
28
+ ],
29
+ properties: nodeProperties_1.nodeProperties,
30
+ };
31
+ }
32
+ async execute() {
33
+ var _a, _b, _c;
34
+ const items = this.getInputData();
35
+ const returnData = [];
36
+ for (let i = 0; i < items.length; i++) {
37
+ try {
38
+ const operation = this.getNodeParameter('operation', i);
39
+ const model = this.getNodeParameter('model', i);
40
+ if (operation === 'chat') {
41
+ const userMessage = this.getNodeParameter('message', i);
42
+ const systemMessage = this.getNodeParameter('systemMessage', i, '');
43
+ const advancedOptions = this.getNodeParameter('advancedOptions', i, {});
44
+ const includeMedia = this.getNodeParameter('includeMedia', i, false);
45
+ const modelInfo = GitHubCopilotModels_1.GitHubCopilotModelsManager.getModelByValue(model);
46
+ if (includeMedia) {
47
+ if (!(modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities.vision) && !(modelInfo === null || modelInfo === void 0 ? void 0 : modelInfo.capabilities.multimodal)) {
48
+ throw new Error(`Model ${model} does not support vision/image processing. Please select a model with vision capabilities.`);
49
+ }
50
+ }
51
+ const messages = [];
52
+ if (systemMessage) {
53
+ messages.push({
54
+ role: 'system',
55
+ content: systemMessage,
56
+ });
57
+ }
58
+ let userContent = userMessage;
59
+ if (includeMedia) {
60
+ const mediaSource = this.getNodeParameter('mediaSource', i);
61
+ const mediaFile = this.getNodeParameter('mediaFile', i, '');
62
+ const mediaUrl = this.getNodeParameter('mediaUrl', i, '');
63
+ const mediaBinaryProperty = this.getNodeParameter('mediaBinaryProperty', i, '');
64
+ const contentArray = [];
65
+ if (userMessage.trim()) {
66
+ contentArray.push({
67
+ type: 'text',
68
+ text: userMessage,
69
+ });
70
+ }
71
+ try {
72
+ const mediaResult = await (0, mediaDetection_1.processMediaFile)(this, i, mediaSource, mediaFile, mediaUrl, mediaBinaryProperty);
73
+ if (mediaResult.type === 'image' && mediaResult.dataUrl) {
74
+ contentArray.push({
75
+ type: 'image_url',
76
+ image_url: {
77
+ url: mediaResult.dataUrl,
78
+ },
79
+ });
80
+ }
81
+ else {
82
+ contentArray.push({
83
+ type: 'text',
84
+ text: `[Image processing failed: ${mediaResult.description}]`,
85
+ });
86
+ }
87
+ }
88
+ catch (error) {
89
+ contentArray.push({
90
+ type: 'text',
91
+ text: `[Media processing error: ${error instanceof Error ? error.message : 'Unknown error'}]`,
92
+ });
93
+ }
94
+ userContent = contentArray;
95
+ }
96
+ messages.push({
97
+ role: 'user',
98
+ content: userContent,
99
+ });
100
+ const requestBody = {
101
+ model,
102
+ messages,
103
+ stream: false,
104
+ ...advancedOptions,
105
+ };
106
+ const hasMedia = includeMedia;
107
+ const response = await (0, utils_1.makeApiRequest)(this, '/chat/completions', requestBody, hasMedia);
108
+ const result = {
109
+ message: ((_b = (_a = response.choices[0]) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.content) || '',
110
+ model,
111
+ operation,
112
+ usage: response.usage || null,
113
+ finish_reason: ((_c = response.choices[0]) === null || _c === void 0 ? void 0 : _c.finish_reason) || 'unknown',
114
+ };
115
+ returnData.push({
116
+ json: result,
117
+ pairedItem: { item: i },
118
+ });
119
+ }
120
+ }
121
+ catch (error) {
122
+ if (this.continueOnFail()) {
123
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
124
+ returnData.push({
125
+ json: {
126
+ error: errorMessage,
127
+ operation: this.getNodeParameter('operation', i),
128
+ model: this.getNodeParameter('model', i),
129
+ },
130
+ pairedItem: { item: i },
131
+ });
132
+ }
133
+ else {
134
+ throw error;
135
+ }
136
+ }
137
+ }
138
+ return [returnData];
139
+ }
140
+ }
141
+ exports.GitHubCopilotChatAPI = GitHubCopilotChatAPI;
@@ -1,2 +1,2 @@
1
- import { INodeProperties } from 'n8n-workflow';
2
- export declare const nodeProperties: INodeProperties[];
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ export declare const nodeProperties: INodeProperties[];