n8n-nodes-github-copilot 3.38.24 → 3.38.26

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 (36) hide show
  1. package/dist/credentials/GitHubCopilotApi.credentials.d.ts +1 -1
  2. package/dist/credentials/GitHubCopilotApi.credentials.js +25 -25
  3. package/dist/nodes/GitHubCopilot/GitHubCopilot.node.d.ts +1 -1
  4. package/dist/nodes/GitHubCopilot/GitHubCopilot.node.js +166 -166
  5. package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.d.ts +1 -1
  6. package/dist/nodes/GitHubCopilotAuthHelper/GitHubCopilotAuthHelper.node.js +539 -539
  7. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.d.ts +1 -1
  8. package/dist/nodes/GitHubCopilotChatAPI/GitHubCopilotChatAPI.node.js +46 -44
  9. package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.d.ts +1 -1
  10. package/dist/nodes/GitHubCopilotChatAPI/nodeProperties.js +82 -82
  11. package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.d.ts +2 -2
  12. package/dist/nodes/GitHubCopilotChatAPI/utils/helpers.js +26 -26
  13. package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.d.ts +2 -2
  14. package/dist/nodes/GitHubCopilotChatAPI/utils/imageProcessor.js +12 -12
  15. package/dist/nodes/GitHubCopilotChatAPI/utils/index.d.ts +4 -4
  16. package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.d.ts +3 -3
  17. package/dist/nodes/GitHubCopilotChatAPI/utils/mediaDetection.js +19 -19
  18. package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.d.ts +1 -1
  19. package/dist/nodes/GitHubCopilotChatAPI/utils/modelCapabilities.js +23 -23
  20. package/dist/nodes/GitHubCopilotChatAPI/utils/types.d.ts +5 -5
  21. package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.d.ts +1 -1
  22. package/dist/nodes/GitHubCopilotChatModel/GitHubCopilotChatModel.node.js +163 -110
  23. package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.d.ts +1 -1
  24. package/dist/nodes/GitHubCopilotEmbeddings/GitHubCopilotEmbeddings.node.js +114 -114
  25. package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.d.ts +1 -1
  26. package/dist/nodes/GitHubCopilotOpenAI/GitHubCopilotOpenAI.node.js +74 -69
  27. package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.d.ts +1 -1
  28. package/dist/nodes/GitHubCopilotOpenAI/nodeProperties.js +181 -181
  29. package/dist/nodes/GitHubCopilotOpenAI/utils/index.d.ts +2 -2
  30. package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.d.ts +10 -10
  31. package/dist/nodes/GitHubCopilotOpenAI/utils/openaiCompat.js +53 -53
  32. package/dist/nodes/GitHubCopilotOpenAI/utils/types.d.ts +12 -12
  33. package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.d.ts +1 -1
  34. package/dist/nodes/GitHubCopilotTest/GitHubCopilotTest.node.js +120 -116
  35. package/dist/package.json +1 -1
  36. package/package.json +1 -1
@@ -6,16 +6,16 @@ const child_process_1 = require("child_process");
6
6
  const util_1 = require("util");
7
7
  const execAsync = (0, util_1.promisify)(child_process_1.exec);
8
8
  function filterCopilotOutput(rawOutput) {
9
- const lines = rawOutput.split("\n");
9
+ const lines = rawOutput.split('\n');
10
10
  let startIndex = -1;
11
11
  const endIndex = lines.length;
12
12
  for (let i = 0; i < lines.length; i++) {
13
13
  const line = lines[i].trim();
14
- if (line.includes("# Explanation:") ||
15
- line.includes("# Suggestion:") ||
16
- line.includes("# Command:") ||
17
- line.includes("# Code:") ||
18
- (line.startsWith("") && i > 5)) {
14
+ if (line.includes('# Explanation:') ||
15
+ line.includes('# Suggestion:') ||
16
+ line.includes('# Command:') ||
17
+ line.includes('# Code:') ||
18
+ (line.startsWith('') && i > 5)) {
19
19
  startIndex = i;
20
20
  break;
21
21
  }
@@ -23,7 +23,7 @@ function filterCopilotOutput(rawOutput) {
23
23
  if (startIndex === -1) {
24
24
  for (let i = 0; i < lines.length; i++) {
25
25
  const line = lines[i].trim();
26
- if (line.includes("version ") && line.includes("(") && line.includes(")")) {
26
+ if (line.includes('version ') && line.includes('(') && line.includes(')')) {
27
27
  startIndex = i + 3;
28
28
  break;
29
29
  }
@@ -32,7 +32,7 @@ function filterCopilotOutput(rawOutput) {
32
32
  if (startIndex === -1) {
33
33
  for (let i = 0; i < lines.length; i++) {
34
34
  const line = lines[i].trim();
35
- if (line.length > 10 && !line.includes("Welcome to") && !line.includes("powered by AI")) {
35
+ if (line.length > 10 && !line.includes('Welcome to') && !line.includes('powered by AI')) {
36
36
  startIndex = i;
37
37
  break;
38
38
  }
@@ -40,28 +40,28 @@ function filterCopilotOutput(rawOutput) {
40
40
  }
41
41
  if (startIndex >= 0) {
42
42
  const filteredLines = lines.slice(startIndex, endIndex);
43
- return filteredLines.join("\n").trim();
43
+ return filteredLines.join('\n').trim();
44
44
  }
45
45
  return rawOutput.trim();
46
46
  }
47
47
  class GitHubCopilot {
48
48
  constructor() {
49
49
  this.description = {
50
- displayName: "GitHub Copilot",
51
- name: "gitHubCopilot",
52
- icon: "file:../../shared/icons/copilot.svg",
53
- group: ["transform"],
50
+ displayName: 'GitHub Copilot',
51
+ name: 'gitHubCopilot',
52
+ icon: 'file:../../shared/icons/copilot.svg',
53
+ group: ['transform'],
54
54
  version: 1,
55
- subtitle: "",
56
- description: "Interact with GitHub Copilot API for code completions",
55
+ subtitle: '',
56
+ description: 'Interact with GitHub Copilot API for code completions',
57
57
  defaults: {
58
- name: "GitHub Copilot",
58
+ name: 'GitHub Copilot',
59
59
  },
60
- inputs: ["main"],
61
- outputs: ["main"],
60
+ inputs: ['main'],
61
+ outputs: ['main'],
62
62
  credentials: [
63
63
  {
64
- name: "githubCopilotApi",
64
+ name: 'githubCopilotApi',
65
65
  required: false,
66
66
  displayOptions: {
67
67
  show: {
@@ -72,177 +72,177 @@ class GitHubCopilot {
72
72
  ],
73
73
  properties: [
74
74
  {
75
- displayName: "Authentication Method",
76
- name: "useCredential",
77
- type: "boolean",
75
+ displayName: 'Authentication Method',
76
+ name: 'useCredential',
77
+ type: 'boolean',
78
78
  default: false,
79
- description: "Use GitHub Copilot API credential instead of local GitHub CLI authentication",
79
+ description: 'Use GitHub Copilot API credential instead of local GitHub CLI authentication',
80
80
  },
81
81
  {
82
- displayName: "Operation",
83
- name: "operation",
84
- type: "options",
82
+ displayName: 'Operation',
83
+ name: 'operation',
84
+ type: 'options',
85
85
  noDataExpression: true,
86
86
  options: [
87
87
  {
88
- name: "Suggest",
89
- value: "suggest",
90
- description: "Get code suggestions from GitHub Copilot",
91
- action: "Get code suggestions",
88
+ name: 'Suggest',
89
+ value: 'suggest',
90
+ description: 'Get code suggestions from GitHub Copilot',
91
+ action: 'Get code suggestions',
92
92
  },
93
93
  {
94
- name: "Explain",
95
- value: "explain",
96
- description: "Explain code or commands using GitHub Copilot",
97
- action: "Explain code or commands",
94
+ name: 'Explain',
95
+ value: 'explain',
96
+ description: 'Explain code or commands using GitHub Copilot',
97
+ action: 'Explain code or commands',
98
98
  },
99
99
  {
100
- name: "Shell",
101
- value: "shell",
102
- description: "Get shell command suggestions from GitHub Copilot",
103
- action: "Get shell command suggestions",
100
+ name: 'Shell',
101
+ value: 'shell',
102
+ description: 'Get shell command suggestions from GitHub Copilot',
103
+ action: 'Get shell command suggestions',
104
104
  },
105
105
  {
106
- name: "Revise",
107
- value: "revise",
108
- description: "Revise and improve existing code or commands",
109
- action: "Revise code or commands",
106
+ name: 'Revise',
107
+ value: 'revise',
108
+ description: 'Revise and improve existing code or commands',
109
+ action: 'Revise code or commands',
110
110
  },
111
111
  {
112
- name: "Rate Response",
113
- value: "rating",
114
- description: "Rate a previous GitHub Copilot response",
115
- action: "Rate response",
112
+ name: 'Rate Response',
113
+ value: 'rating',
114
+ description: 'Rate a previous GitHub Copilot response',
115
+ action: 'Rate response',
116
116
  },
117
117
  ],
118
- default: "suggest",
118
+ default: 'suggest',
119
119
  },
120
120
  {
121
- displayName: "Prompt",
122
- name: "prompt",
123
- type: "string",
121
+ displayName: 'Prompt',
122
+ name: 'prompt',
123
+ type: 'string',
124
124
  typeOptions: {
125
125
  rows: 3,
126
126
  },
127
127
  required: true,
128
- default: "",
129
- placeholder: "Enter your request...",
130
- description: "What you want GitHub Copilot to help with",
128
+ default: '',
129
+ placeholder: 'Enter your request...',
130
+ description: 'What you want GitHub Copilot to help with',
131
131
  },
132
132
  {
133
- displayName: "Filter Output",
134
- name: "filterOutput",
135
- type: "boolean",
133
+ displayName: 'Filter Output',
134
+ name: 'filterOutput',
135
+ type: 'boolean',
136
136
  default: true,
137
- description: "Remove GitHub Copilot CLI header and footer, keeping only the useful response",
137
+ description: 'Remove GitHub Copilot CLI header and footer, keeping only the useful response',
138
138
  },
139
139
  {
140
- displayName: "Language",
141
- name: "language",
142
- type: "options",
140
+ displayName: 'Language',
141
+ name: 'language',
142
+ type: 'options',
143
143
  displayOptions: {
144
144
  show: {
145
- operation: ["suggest"],
145
+ operation: ['suggest'],
146
146
  },
147
147
  },
148
148
  options: [
149
- { name: "JavaScript", value: "javascript" },
150
- { name: "TypeScript", value: "typescript" },
151
- { name: "Python", value: "python" },
152
- { name: "Java", value: "java" },
153
- { name: "C#", value: "csharp" },
154
- { name: "C++", value: "cpp" },
155
- { name: "Go", value: "go" },
156
- { name: "Rust", value: "rust" },
157
- { name: "PHP", value: "php" },
158
- { name: "Ruby", value: "ruby" },
159
- { name: "Shell", value: "shell" },
160
- { name: "SQL", value: "sql" },
161
- { name: "Other", value: "other" },
149
+ { name: 'JavaScript', value: 'javascript' },
150
+ { name: 'TypeScript', value: 'typescript' },
151
+ { name: 'Python', value: 'python' },
152
+ { name: 'Java', value: 'java' },
153
+ { name: 'C#', value: 'csharp' },
154
+ { name: 'C++', value: 'cpp' },
155
+ { name: 'Go', value: 'go' },
156
+ { name: 'Rust', value: 'rust' },
157
+ { name: 'PHP', value: 'php' },
158
+ { name: 'Ruby', value: 'ruby' },
159
+ { name: 'Shell', value: 'shell' },
160
+ { name: 'SQL', value: 'sql' },
161
+ { name: 'Other', value: 'other' },
162
162
  ],
163
- default: "javascript",
164
- description: "Programming language for code suggestions",
163
+ default: 'javascript',
164
+ description: 'Programming language for code suggestions',
165
165
  },
166
166
  {
167
- displayName: "Command Type",
168
- name: "commandType",
169
- type: "options",
167
+ displayName: 'Command Type',
168
+ name: 'commandType',
169
+ type: 'options',
170
170
  displayOptions: {
171
171
  show: {
172
- operation: ["shell"],
172
+ operation: ['shell'],
173
173
  },
174
174
  },
175
175
  options: [
176
- { name: "General", value: "general" },
177
- { name: "Git", value: "git" },
178
- { name: "Docker", value: "docker" },
179
- { name: "npm/yarn", value: "npm" },
180
- { name: "File Operations", value: "file" },
176
+ { name: 'General', value: 'general' },
177
+ { name: 'Git', value: 'git' },
178
+ { name: 'Docker', value: 'docker' },
179
+ { name: 'npm/yarn', value: 'npm' },
180
+ { name: 'File Operations', value: 'file' },
181
181
  ],
182
- default: "general",
183
- description: "Type of shell commands to suggest",
182
+ default: 'general',
183
+ description: 'Type of shell commands to suggest',
184
184
  },
185
185
  {
186
- displayName: "Additional Context",
187
- name: "context",
188
- type: "string",
186
+ displayName: 'Additional Context',
187
+ name: 'context',
188
+ type: 'string',
189
189
  typeOptions: {
190
190
  rows: 2,
191
191
  },
192
- default: "",
193
- placeholder: "Any additional context or constraints...",
194
- description: "Optional additional context to provide better suggestions",
192
+ default: '',
193
+ placeholder: 'Any additional context or constraints...',
194
+ description: 'Optional additional context to provide better suggestions',
195
195
  },
196
196
  {
197
- displayName: "Original Code/Command",
198
- name: "originalCode",
199
- type: "string",
197
+ displayName: 'Original Code/Command',
198
+ name: 'originalCode',
199
+ type: 'string',
200
200
  typeOptions: {
201
201
  rows: 4,
202
202
  },
203
203
  required: true,
204
- default: "",
205
- placeholder: "Enter the original code or command to revise...",
206
- description: "The original code or command that you want to improve",
204
+ default: '',
205
+ placeholder: 'Enter the original code or command to revise...',
206
+ description: 'The original code or command that you want to improve',
207
207
  displayOptions: {
208
208
  show: {
209
- operation: ["revise"],
209
+ operation: ['revise'],
210
210
  },
211
211
  },
212
212
  },
213
213
  {
214
- displayName: "Rating",
215
- name: "rating",
216
- type: "options",
214
+ displayName: 'Rating',
215
+ name: 'rating',
216
+ type: 'options',
217
217
  options: [
218
- { name: "Very Good", value: "very-good" },
219
- { name: "Good", value: "good" },
220
- { name: "Fair", value: "fair" },
221
- { name: "Poor", value: "poor" },
218
+ { name: 'Very Good', value: 'very-good' },
219
+ { name: 'Good', value: 'good' },
220
+ { name: 'Fair', value: 'fair' },
221
+ { name: 'Poor', value: 'poor' },
222
222
  ],
223
223
  required: true,
224
- default: "good",
225
- description: "Rate the GitHub Copilot response",
224
+ default: 'good',
225
+ description: 'Rate the GitHub Copilot response',
226
226
  displayOptions: {
227
227
  show: {
228
- operation: ["rating"],
228
+ operation: ['rating'],
229
229
  },
230
230
  },
231
231
  },
232
232
  {
233
- displayName: "Response to Rate",
234
- name: "responseToRate",
235
- type: "string",
233
+ displayName: 'Response to Rate',
234
+ name: 'responseToRate',
235
+ type: 'string',
236
236
  typeOptions: {
237
237
  rows: 3,
238
238
  },
239
239
  required: true,
240
- default: "",
241
- placeholder: "Enter the GitHub Copilot response you want to rate...",
242
- description: "The GitHub Copilot response that you want to rate",
240
+ default: '',
241
+ placeholder: 'Enter the GitHub Copilot response you want to rate...',
242
+ description: 'The GitHub Copilot response that you want to rate',
243
243
  displayOptions: {
244
244
  show: {
245
- operation: ["rating"],
245
+ operation: ['rating'],
246
246
  },
247
247
  },
248
248
  },
@@ -254,60 +254,60 @@ class GitHubCopilot {
254
254
  const returnData = [];
255
255
  for (let i = 0; i < items.length; i++) {
256
256
  try {
257
- const operation = this.getNodeParameter("operation", i);
258
- const prompt = this.getNodeParameter("prompt", i);
259
- const context = this.getNodeParameter("context", i, "");
260
- const useCredential = this.getNodeParameter("useCredential", i, false);
261
- let githubToken = "";
262
- let authMethod = "Local CLI";
257
+ const operation = this.getNodeParameter('operation', i);
258
+ const prompt = this.getNodeParameter('prompt', i);
259
+ const context = this.getNodeParameter('context', i, '');
260
+ const useCredential = this.getNodeParameter('useCredential', i, false);
261
+ let githubToken = '';
262
+ let authMethod = 'Local CLI';
263
263
  if (useCredential) {
264
264
  try {
265
- const credentials = await this.getCredentials("githubCopilotApi");
265
+ const credentials = await this.getCredentials('githubCopilotApi');
266
266
  const token = credentials.token;
267
267
  if (token) {
268
268
  githubToken = token;
269
- authMethod = "GitHub Copilot API Credential";
269
+ authMethod = 'GitHub Copilot API Credential';
270
270
  }
271
271
  }
272
272
  catch {
273
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), "GitHub Copilot credential is not configured. Please configure it or use Local CLI authentication.");
273
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'GitHub Copilot credential is not configured. Please configure it or use Local CLI authentication.');
274
274
  }
275
275
  }
276
- const useToken = githubToken && githubToken.trim() !== "";
276
+ const useToken = githubToken && githubToken.trim() !== '';
277
277
  let command;
278
278
  let fullPrompt = prompt;
279
279
  if (context) {
280
280
  fullPrompt = `${prompt}\n\nAdditional context: ${context}`;
281
281
  }
282
282
  switch (operation) {
283
- case "suggest": {
284
- const language = this.getNodeParameter("language", i);
285
- if (language !== "other") {
283
+ case 'suggest': {
284
+ const language = this.getNodeParameter('language', i);
285
+ if (language !== 'other') {
286
286
  fullPrompt = `[${language}] ${fullPrompt}`;
287
287
  }
288
288
  const escapedSuggestPrompt = fullPrompt.replace(/'/g, "'\"'\"'");
289
289
  command = `gh copilot suggest '${escapedSuggestPrompt}'`;
290
290
  break;
291
291
  }
292
- case "explain": {
292
+ case 'explain': {
293
293
  const escapedExplainPrompt = fullPrompt.replace(/'/g, "'\"'\"'");
294
294
  command = `gh copilot explain '${escapedExplainPrompt}'`;
295
295
  break;
296
296
  }
297
- case "shell": {
298
- const commandType = this.getNodeParameter("commandType", i);
297
+ case 'shell': {
298
+ const commandType = this.getNodeParameter('commandType', i);
299
299
  let shellPrompt = fullPrompt;
300
300
  switch (commandType) {
301
- case "git":
301
+ case 'git':
302
302
  shellPrompt = `git: ${fullPrompt}`;
303
303
  break;
304
- case "docker":
304
+ case 'docker':
305
305
  shellPrompt = `docker: ${fullPrompt}`;
306
306
  break;
307
- case "npm":
307
+ case 'npm':
308
308
  shellPrompt = `npm/yarn: ${fullPrompt}`;
309
309
  break;
310
- case "file":
310
+ case 'file':
311
311
  shellPrompt = `file operations: ${fullPrompt}`;
312
312
  break;
313
313
  default:
@@ -317,16 +317,16 @@ class GitHubCopilot {
317
317
  command = `gh copilot suggest '${escapedShellPrompt}' --type shell`;
318
318
  break;
319
319
  }
320
- case "revise": {
321
- const originalCode = this.getNodeParameter("originalCode", i);
320
+ case 'revise': {
321
+ const originalCode = this.getNodeParameter('originalCode', i);
322
322
  const revisePrompt = `${fullPrompt}\n\nOriginal code/command:\n${originalCode}`;
323
323
  const escapedRevisePrompt = revisePrompt.replace(/'/g, "'\"'\"'");
324
324
  command = `gh copilot revise '${escapedRevisePrompt}'`;
325
325
  break;
326
326
  }
327
- case "rating": {
328
- const rating = this.getNodeParameter("rating", i);
329
- const responseToRate = this.getNodeParameter("responseToRate", i);
327
+ case 'rating': {
328
+ const rating = this.getNodeParameter('rating', i);
329
+ const responseToRate = this.getNodeParameter('responseToRate', i);
330
330
  const escapedResponseToRate = responseToRate.replace(/'/g, "'\"'\"'");
331
331
  command = `gh copilot rate '${escapedResponseToRate}' --rating ${rating}`;
332
332
  break;
@@ -334,11 +334,11 @@ class GitHubCopilot {
334
334
  default:
335
335
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
336
336
  }
337
- console.log("Executing command:", command);
338
- console.log("Auth method:", authMethod);
339
- console.log("Using token:", useToken ? "Yes (Manual)" : "No (Local CLI)");
340
- let stdout = "";
341
- let stderr = "";
337
+ console.log('Executing command:', command);
338
+ console.log('Auth method:', authMethod);
339
+ console.log('Using token:', useToken ? 'Yes (Manual)' : 'No (Local CLI)');
340
+ let stdout = '';
341
+ let stderr = '';
342
342
  try {
343
343
  const envVars = {
344
344
  ...process.env,
@@ -358,34 +358,34 @@ class GitHubCopilot {
358
358
  catch (execError) {
359
359
  const err = execError;
360
360
  stderr = err.stderr || err.message || String(execError);
361
- stdout = err.stdout || "";
361
+ stdout = err.stdout || '';
362
362
  }
363
363
  if (stderr) {
364
364
  const debugInfo = useToken
365
365
  ? ` [Using manual token: ${githubToken.substring(0, 4)}...]`
366
- : " [Using local CLI authentication]";
367
- if (stderr.includes("internal server error") || stderr.includes("code: 500")) {
366
+ : ' [Using local CLI authentication]';
367
+ if (stderr.includes('internal server error') || stderr.includes('code: 500')) {
368
368
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot service is temporarily unavailable (HTTP 500). This is a GitHub server issue. Please try again in a few moments.${debugInfo} Error: ${stderr}`);
369
369
  }
370
- else if (stderr.includes("code: 400") || stderr.includes("Bad Request")) {
370
+ else if (stderr.includes('code: 400') || stderr.includes('Bad Request')) {
371
371
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot request failed (HTTP 400). The request is malformed or invalid.${debugInfo} Full error response: ${stderr}`);
372
372
  }
373
- else if (stderr.includes("401") ||
374
- stderr.includes("Unauthorized") ||
375
- stderr.includes("Bad credentials")) {
373
+ else if (stderr.includes('401') ||
374
+ stderr.includes('Unauthorized') ||
375
+ stderr.includes('Bad credentials')) {
376
376
  const tokenHelp = useToken
377
- ? " IMPORTANT: Only tokens generated by \"gh auth token\" command work with Copilot. Personal Access Tokens from GitHub website DO NOT work. Try: run \"gh auth login\" first, then use \"gh auth token\" to get a working token."
378
- : " Please run \"gh auth login\" on the server first, or provide a token generated by \"gh auth token\" command.";
377
+ ? ' IMPORTANT: Only tokens generated by "gh auth token" command work with Copilot. Personal Access Tokens from GitHub website DO NOT work. Try: run "gh auth login" first, then use "gh auth token" to get a working token.'
378
+ : ' Please run "gh auth login" on the server first, or provide a token generated by "gh auth token" command.';
379
379
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub authentication failed (HTTP 401).${tokenHelp}${debugInfo} Full error response: ${stderr}`);
380
380
  }
381
- else if (stderr.includes("403") || stderr.includes("Forbidden")) {
381
+ else if (stderr.includes('403') || stderr.includes('Forbidden')) {
382
382
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot access denied (HTTP 403). Please ensure your account has Copilot subscription.${debugInfo} Full error response: ${stderr}`);
383
383
  }
384
384
  else if (!stdout) {
385
385
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), `GitHub Copilot CLI error:${debugInfo} Full error response: ${stderr}`);
386
386
  }
387
387
  }
388
- const filterOutput = this.getNodeParameter("filterOutput", i, true);
388
+ const filterOutput = this.getNodeParameter('filterOutput', i, true);
389
389
  let processedOutput = stdout;
390
390
  if (filterOutput) {
391
391
  processedOutput = filterCopilotOutput(stdout);
@@ -397,12 +397,12 @@ class GitHubCopilot {
397
397
  context: context || undefined,
398
398
  authMethod: authMethod,
399
399
  tokenUsed: useToken,
400
- tokenPrefix: useToken ? githubToken.substring(0, 4) + "..." : "none",
401
- language: operation === "suggest" ? this.getNodeParameter("language", i) : undefined,
402
- commandType: operation === "shell" ? this.getNodeParameter("commandType", i) : undefined,
403
- originalCode: operation === "revise" ? this.getNodeParameter("originalCode", i) : undefined,
404
- rating: operation === "rating" ? this.getNodeParameter("rating", i) : undefined,
405
- responseToRate: operation === "rating" ? this.getNodeParameter("responseToRate", i) : undefined,
400
+ tokenPrefix: useToken ? githubToken.substring(0, 4) + '...' : 'none',
401
+ language: operation === 'suggest' ? this.getNodeParameter('language', i) : undefined,
402
+ commandType: operation === 'shell' ? this.getNodeParameter('commandType', i) : undefined,
403
+ originalCode: operation === 'revise' ? this.getNodeParameter('originalCode', i) : undefined,
404
+ rating: operation === 'rating' ? this.getNodeParameter('rating', i) : undefined,
405
+ responseToRate: operation === 'rating' ? this.getNodeParameter('responseToRate', i) : undefined,
406
406
  output: processedOutput,
407
407
  cliRawOutput: stdout,
408
408
  cliStderr: stderr || undefined,
@@ -416,8 +416,8 @@ class GitHubCopilot {
416
416
  returnData.push({
417
417
  json: {
418
418
  error: error instanceof Error ? error.message : String(error),
419
- operation: this.getNodeParameter("operation", i, "unknown"),
420
- prompt: this.getNodeParameter("prompt", i, ""),
419
+ operation: this.getNodeParameter('operation', i, 'unknown'),
420
+ prompt: this.getNodeParameter('prompt', i, ''),
421
421
  timestamp: new Date().toISOString(),
422
422
  },
423
423
  pairedItem: { item: i },
@@ -1,4 +1,4 @@
1
- import { IWebhookFunctions, IWebhookResponseData, INodeType, INodeTypeDescription } from "n8n-workflow";
1
+ import { IWebhookFunctions, IWebhookResponseData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
2
  export declare class GitHubCopilotAuthHelper implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;