n8n-nodes-github-copilot 3.4.0 → 3.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.
- package/dist/credentials/GitHubApi.credentials.d.ts +8 -8
- package/dist/credentials/GitHubApi.credentials.js +50 -50
- package/dist/credentials/GitHubApiManual.credentials.d.ts +7 -7
- package/dist/credentials/GitHubApiManual.credentials.js +33 -33
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +5 -5
- package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +324 -324
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +141 -146
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +2 -2
- package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +172 -202
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +19 -21
- package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +130 -131
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +8 -8
- package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +100 -101
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +3 -3
- package/dist/nodes/GitHubCopilotChatAPI/utils/index.js +19 -19
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +14 -14
- package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +70 -71
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +113 -113
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +57 -57
- package/dist/nodes/GitHubCopilotChatAPI/utils/types.js +2 -2
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +5 -5
- package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +141 -211
- package/dist/shared/models/GitHubCopilotModels.d.ts +43 -0
- package/dist/shared/models/GitHubCopilotModels.js +218 -0
- package/package.json +5 -4
- package/dist/credentials/N8nApi.credentials.d.ts +0 -7
- package/dist/credentials/N8nApi.credentials.js +0 -31
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.backup.d.ts +0 -5
- package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.backup.js +0 -651
- package/dist/nodes/GitHubCopilotChatAPI/utils/audioProcessor.d.ts +0 -11
- package/dist/nodes/GitHubCopilotChatAPI/utils/audioProcessor.js +0 -86
- package/dist/nodes/N8nAiAgent/N8nAiAgent.node.d.ts +0 -5
- package/dist/nodes/N8nAiAgent/N8nAiAgent.node.js +0 -152
|
@@ -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
|
|
7
|
-
const
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
if (!
|
|
48
|
-
throw new Error(
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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[];
|