@juspay/neurolink 8.32.0 → 8.34.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.
- package/CHANGELOG.md +13 -1
- package/README.md +284 -75
- package/dist/action/actionExecutor.d.ts +29 -0
- package/dist/action/actionExecutor.js +290 -0
- package/dist/action/actionInputs.d.ts +25 -0
- package/dist/action/actionInputs.js +293 -0
- package/dist/action/githubIntegration.d.ts +21 -0
- package/dist/action/githubIntegration.js +187 -0
- package/dist/action/index.d.ts +8 -0
- package/dist/action/index.js +11 -0
- package/dist/index.d.ts +145 -13
- package/dist/index.js +145 -13
- package/dist/lib/action/actionExecutor.d.ts +29 -0
- package/dist/lib/action/actionExecutor.js +291 -0
- package/dist/lib/action/actionInputs.d.ts +25 -0
- package/dist/lib/action/actionInputs.js +294 -0
- package/dist/lib/action/githubIntegration.d.ts +21 -0
- package/dist/lib/action/githubIntegration.js +188 -0
- package/dist/lib/action/index.d.ts +8 -0
- package/dist/lib/action/index.js +12 -0
- package/dist/lib/index.d.ts +145 -13
- package/dist/lib/index.js +145 -13
- package/dist/lib/mcp/externalServerManager.js +41 -7
- package/dist/lib/neurolink.d.ts +172 -0
- package/dist/lib/neurolink.js +172 -0
- package/dist/lib/types/actionTypes.d.ts +205 -0
- package/dist/lib/types/actionTypes.js +7 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/utils/errorHandling.d.ts +8 -0
- package/dist/lib/utils/errorHandling.js +29 -0
- package/dist/mcp/externalServerManager.js +41 -7
- package/dist/neurolink.d.ts +172 -0
- package/dist/neurolink.js +172 -0
- package/dist/types/actionTypes.d.ts +205 -0
- package/dist/types/actionTypes.js +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/errorHandling.d.ts +8 -0
- package/dist/utils/errorHandling.js +29 -0
- package/package.json +11 -3
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for NeuroLink GitHub Action
|
|
3
|
+
* @module actionTypes
|
|
4
|
+
*/
|
|
5
|
+
import type { AIProviderName } from "../constants/enums.js";
|
|
6
|
+
/**
|
|
7
|
+
* Provider API key configuration (verified providers only)
|
|
8
|
+
*/
|
|
9
|
+
export type ActionProviderKeys = {
|
|
10
|
+
openaiApiKey?: string;
|
|
11
|
+
anthropicApiKey?: string;
|
|
12
|
+
googleAiApiKey?: string;
|
|
13
|
+
azureOpenaiApiKey?: string;
|
|
14
|
+
azureOpenaiEndpoint?: string;
|
|
15
|
+
azureOpenaiDeployment?: string;
|
|
16
|
+
mistralApiKey?: string;
|
|
17
|
+
huggingfaceApiKey?: string;
|
|
18
|
+
openrouterApiKey?: string;
|
|
19
|
+
litellmApiKey?: string;
|
|
20
|
+
litellmBaseUrl?: string;
|
|
21
|
+
openaiCompatibleApiKey?: string;
|
|
22
|
+
openaiCompatibleBaseUrl?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* AWS credentials for Bedrock/SageMaker
|
|
26
|
+
*/
|
|
27
|
+
export type ActionAWSConfig = {
|
|
28
|
+
awsAccessKeyId?: string;
|
|
29
|
+
awsSecretAccessKey?: string;
|
|
30
|
+
awsRegion: string;
|
|
31
|
+
awsSessionToken?: string;
|
|
32
|
+
bedrockModelId?: string;
|
|
33
|
+
sagemakerEndpoint?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Google Cloud configuration for Vertex AI
|
|
37
|
+
*/
|
|
38
|
+
export type ActionGoogleCloudConfig = {
|
|
39
|
+
googleVertexProject?: string;
|
|
40
|
+
googleVertexLocation: string;
|
|
41
|
+
googleApplicationCredentials?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Extended thinking configuration
|
|
45
|
+
*/
|
|
46
|
+
export type ActionThinkingConfig = {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
level: "minimal" | "low" | "medium" | "high";
|
|
49
|
+
budget: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Multimodal input paths
|
|
53
|
+
*/
|
|
54
|
+
export type ActionMultimodalInputs = {
|
|
55
|
+
imagePaths?: string[];
|
|
56
|
+
pdfPaths?: string[];
|
|
57
|
+
csvPaths?: string[];
|
|
58
|
+
videoPaths?: string[];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Complete action inputs parsed from GitHub Action
|
|
62
|
+
*/
|
|
63
|
+
export type ActionInputs = {
|
|
64
|
+
prompt: string;
|
|
65
|
+
provider: AIProviderName | "auto";
|
|
66
|
+
model?: string;
|
|
67
|
+
temperature: number;
|
|
68
|
+
maxTokens: number;
|
|
69
|
+
systemPrompt?: string;
|
|
70
|
+
command: "generate" | "stream" | "batch";
|
|
71
|
+
providerKeys: ActionProviderKeys;
|
|
72
|
+
awsConfig: ActionAWSConfig;
|
|
73
|
+
googleCloudConfig: ActionGoogleCloudConfig;
|
|
74
|
+
multimodal: ActionMultimodalInputs;
|
|
75
|
+
thinking: ActionThinkingConfig;
|
|
76
|
+
enableAnalytics: boolean;
|
|
77
|
+
enableEvaluation: boolean;
|
|
78
|
+
outputFormat: "text" | "json";
|
|
79
|
+
outputFile?: string;
|
|
80
|
+
enableTools: boolean;
|
|
81
|
+
mcpConfigPath?: string;
|
|
82
|
+
postComment: boolean;
|
|
83
|
+
updateExistingComment: boolean;
|
|
84
|
+
commentTag: string;
|
|
85
|
+
githubToken?: string;
|
|
86
|
+
timeout: number;
|
|
87
|
+
debug: boolean;
|
|
88
|
+
neurolinkVersion: string;
|
|
89
|
+
workingDirectory: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Raw CLI token usage format (actual CLI output)
|
|
93
|
+
*/
|
|
94
|
+
export type CliTokenUsage = {
|
|
95
|
+
input: number;
|
|
96
|
+
output: number;
|
|
97
|
+
total: number;
|
|
98
|
+
cacheCreationTokens?: number;
|
|
99
|
+
cacheReadTokens?: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Raw CLI analytics format (actual CLI output)
|
|
103
|
+
*/
|
|
104
|
+
export type CliAnalytics = {
|
|
105
|
+
provider: string;
|
|
106
|
+
model?: string;
|
|
107
|
+
tokenUsage: CliTokenUsage;
|
|
108
|
+
requestDuration: number;
|
|
109
|
+
timestamp: string;
|
|
110
|
+
cost?: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Raw CLI evaluation format (actual CLI output, 1-10 scale)
|
|
114
|
+
*/
|
|
115
|
+
export type CliEvaluation = {
|
|
116
|
+
relevance: number;
|
|
117
|
+
accuracy: number;
|
|
118
|
+
completeness: number;
|
|
119
|
+
overall: number;
|
|
120
|
+
isOffTopic: boolean;
|
|
121
|
+
reasoning: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Raw CLI response format (actual output structure)
|
|
125
|
+
*/
|
|
126
|
+
export type CliResponse = {
|
|
127
|
+
content: string;
|
|
128
|
+
provider?: string;
|
|
129
|
+
model?: string;
|
|
130
|
+
usage?: CliTokenUsage;
|
|
131
|
+
responseTime?: number;
|
|
132
|
+
analytics?: CliAnalytics;
|
|
133
|
+
evaluation?: CliEvaluation;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Normalized token usage for action output
|
|
137
|
+
*/
|
|
138
|
+
export type ActionTokenUsage = {
|
|
139
|
+
promptTokens: number;
|
|
140
|
+
completionTokens: number;
|
|
141
|
+
totalTokens: number;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Normalized evaluation for action output
|
|
145
|
+
*/
|
|
146
|
+
export type ActionEvaluation = {
|
|
147
|
+
overallScore: number;
|
|
148
|
+
relevance: number;
|
|
149
|
+
accuracy: number;
|
|
150
|
+
completeness: number;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* CLI execution result (normalized)
|
|
154
|
+
*/
|
|
155
|
+
export type ActionExecutionResult = {
|
|
156
|
+
success: boolean;
|
|
157
|
+
response: string;
|
|
158
|
+
responseJson?: Record<string, unknown>;
|
|
159
|
+
provider?: string;
|
|
160
|
+
model?: string;
|
|
161
|
+
usage?: ActionTokenUsage;
|
|
162
|
+
cost?: number;
|
|
163
|
+
executionTime?: number;
|
|
164
|
+
evaluation?: ActionEvaluation;
|
|
165
|
+
error?: string;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* GitHub comment posting result
|
|
169
|
+
*/
|
|
170
|
+
export type ActionCommentResult = {
|
|
171
|
+
success: boolean;
|
|
172
|
+
commentId?: number;
|
|
173
|
+
commentUrl?: string;
|
|
174
|
+
error?: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Complete action output (snake_case to match action.yml outputs)
|
|
178
|
+
*/
|
|
179
|
+
export type ActionOutput = {
|
|
180
|
+
response: string;
|
|
181
|
+
response_json: string;
|
|
182
|
+
provider?: string;
|
|
183
|
+
model?: string;
|
|
184
|
+
tokens_used?: string;
|
|
185
|
+
prompt_tokens?: string;
|
|
186
|
+
completion_tokens?: string;
|
|
187
|
+
cost?: string;
|
|
188
|
+
execution_time?: string;
|
|
189
|
+
evaluation_score?: string;
|
|
190
|
+
comment_id?: string;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Input validation result
|
|
194
|
+
*/
|
|
195
|
+
export type ActionInputValidation = {
|
|
196
|
+
valid: boolean;
|
|
197
|
+
errors: string[];
|
|
198
|
+
warnings: string[];
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Provider key validation mapping
|
|
202
|
+
*/
|
|
203
|
+
export type ProviderKeyMapping = {
|
|
204
|
+
[K in AIProviderName]?: (keyof ActionProviderKeys)[];
|
|
205
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,3 +31,4 @@ export * from "./fileTypes.js";
|
|
|
31
31
|
export * from "./content.js";
|
|
32
32
|
export * from "./ttsTypes.js";
|
|
33
33
|
export * from "./hitlTypes.js";
|
|
34
|
+
export type { ActionInputs, ActionProviderKeys, ActionAWSConfig, ActionGoogleCloudConfig, ActionThinkingConfig, ActionMultimodalInputs, ActionExecutionResult, ActionCommentResult, ActionOutput, ActionTokenUsage, ActionEvaluation, ActionInputValidation, ProviderKeyMapping, CliResponse, CliTokenUsage, CliAnalytics, CliEvaluation, } from "./actionTypes.js";
|
|
@@ -89,6 +89,14 @@ export declare class ErrorFactory {
|
|
|
89
89
|
* Create a memory exhaustion error
|
|
90
90
|
*/
|
|
91
91
|
static memoryExhausted(toolName: string, memoryUsageMB: number): NeuroLinkError;
|
|
92
|
+
/**
|
|
93
|
+
* Create a missing configuration error (e.g., missing API key)
|
|
94
|
+
*/
|
|
95
|
+
static missingConfiguration(configName: string, context?: Record<string, unknown>): NeuroLinkError;
|
|
96
|
+
/**
|
|
97
|
+
* Create an invalid configuration error (e.g., NaN for numeric values)
|
|
98
|
+
*/
|
|
99
|
+
static invalidConfiguration(configName: string, reason: string, context?: Record<string, unknown>): NeuroLinkError;
|
|
92
100
|
/**
|
|
93
101
|
* Create an invalid video resolution error
|
|
94
102
|
*/
|
|
@@ -180,6 +180,35 @@ export class ErrorFactory {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
// ============================================================================
|
|
183
|
+
// CONFIGURATION ERRORS
|
|
184
|
+
// ============================================================================
|
|
185
|
+
/**
|
|
186
|
+
* Create a missing configuration error (e.g., missing API key)
|
|
187
|
+
*/
|
|
188
|
+
static missingConfiguration(configName, context) {
|
|
189
|
+
return new NeuroLinkError({
|
|
190
|
+
code: ERROR_CODES.MISSING_CONFIGURATION,
|
|
191
|
+
message: `Missing required configuration: ${configName}`,
|
|
192
|
+
category: ErrorCategory.VALIDATION,
|
|
193
|
+
severity: ErrorSeverity.HIGH,
|
|
194
|
+
retriable: false,
|
|
195
|
+
context: context || {},
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Create an invalid configuration error (e.g., NaN for numeric values)
|
|
200
|
+
*/
|
|
201
|
+
static invalidConfiguration(configName, reason, context) {
|
|
202
|
+
return new NeuroLinkError({
|
|
203
|
+
code: ERROR_CODES.INVALID_CONFIGURATION,
|
|
204
|
+
message: `Invalid configuration for '${configName}': ${reason}`,
|
|
205
|
+
category: ErrorCategory.VALIDATION,
|
|
206
|
+
severity: ErrorSeverity.HIGH,
|
|
207
|
+
retriable: false,
|
|
208
|
+
context: context || {},
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
// ============================================================================
|
|
183
212
|
// VIDEO VALIDATION ERRORS
|
|
184
213
|
// ============================================================================
|
|
185
214
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.34.0",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"dev": "vite dev",
|
|
30
30
|
"build": "vite build && pnpm run prepack",
|
|
31
31
|
"build:cli": "echo 'Building CLI...' && svelte-kit sync && tsc --project tsconfig.cli.json && pnpm link --global",
|
|
32
|
+
"build:action": "ncc build src/action/index.ts -o action-dist --source-map",
|
|
32
33
|
"cli": "node dist/cli/index.js",
|
|
33
34
|
"preview": "vite preview",
|
|
34
35
|
"prepare": "git rev-parse --git-dir > /dev/null 2>&1 && husky install || echo 'Skipping husky in non-git environment'",
|
|
@@ -78,8 +79,9 @@
|
|
|
78
79
|
"content:cleanup": "node tools/converted-scripts/cleanupHashNamedVideos.js",
|
|
79
80
|
"content:all": "pnpm run content:videos",
|
|
80
81
|
"// Documentation Automation": "",
|
|
82
|
+
"docs:api": "typedoc",
|
|
81
83
|
"docs:sync": "bash scripts/sync-readme.sh",
|
|
82
|
-
"docs:build": "bash scripts/sync-readme.sh && mkdocs build --strict --clean",
|
|
84
|
+
"docs:build": "pnpm run docs:api && bash scripts/sync-readme.sh && mkdocs build --strict --clean",
|
|
83
85
|
"docs:serve": "bash scripts/sync-readme.sh && mkdocs serve",
|
|
84
86
|
"docs:gh-deploy": "bash scripts/sync-readme.sh && mkdocs gh-deploy --force",
|
|
85
87
|
"docs:validate": "node tools/content/documentationSync.js --validate",
|
|
@@ -186,8 +188,8 @@
|
|
|
186
188
|
"csv-parser": "^3.2.0",
|
|
187
189
|
"dotenv": "^16.6.1",
|
|
188
190
|
"exceljs": "^4.4.0",
|
|
189
|
-
"inquirer": "^9.3.7",
|
|
190
191
|
"google-auth-library": "^9.1.0",
|
|
192
|
+
"inquirer": "^9.3.7",
|
|
191
193
|
"json-schema-to-zod": "^2.6.1",
|
|
192
194
|
"mammoth": "^1.11.0",
|
|
193
195
|
"mathjs": "^14.7.0",
|
|
@@ -211,6 +213,9 @@
|
|
|
211
213
|
"canvas": "^3.2.0"
|
|
212
214
|
},
|
|
213
215
|
"devDependencies": {
|
|
216
|
+
"@actions/core": "^2.0.2",
|
|
217
|
+
"@actions/exec": "^2.0.0",
|
|
218
|
+
"@actions/github": "^7.0.0",
|
|
214
219
|
"@biomejs/biome": "^2.2.4",
|
|
215
220
|
"@changesets/changelog-github": "^0.5.1",
|
|
216
221
|
"@changesets/cli": "^2.29.7",
|
|
@@ -237,6 +242,7 @@
|
|
|
237
242
|
"@types/yargs": "^17.0.33",
|
|
238
243
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
239
244
|
"@typescript-eslint/parser": "^8.43.0",
|
|
245
|
+
"@vercel/ncc": "^0.38.4",
|
|
240
246
|
"@vitest/coverage-v8": "^2.1.9",
|
|
241
247
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
242
248
|
"cors": "^2.8.5",
|
|
@@ -253,6 +259,8 @@
|
|
|
253
259
|
"svelte": "^5.0.0",
|
|
254
260
|
"svelte-check": "^4.0.0",
|
|
255
261
|
"tslib": "^2.4.1",
|
|
262
|
+
"typedoc": "^0.28.15",
|
|
263
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
256
264
|
"typescript": "^5.0.0",
|
|
257
265
|
"vite": "^6.4.1",
|
|
258
266
|
"vitest": "^2.0.0",
|