@juspay/neurolink 11.18.4 → 11.19.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 +5 -1
- package/dist/browser/neurolink.min.js +360 -373
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -0
- package/dist/localUsage/claudeCodeReader.d.ts +25 -0
- package/dist/localUsage/claudeCodeReader.js +222 -0
- package/dist/localUsage/index.d.ts +18 -0
- package/dist/localUsage/index.js +46 -0
- package/dist/localUsage/localUsageReaderRegistry.d.ts +14 -0
- package/dist/localUsage/localUsageReaderRegistry.js +40 -0
- package/dist/proxy/geminiFormat.js +25 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/localUsage.d.ts +139 -0
- package/dist/types/localUsage.js +13 -0
- package/dist/utils/messageBuilder.js +0 -76
- package/package.json +2 -1
|
@@ -487,82 +487,6 @@ export async function buildMessagesArray(options) {
|
|
|
487
487
|
else if ("input" in options && options.input?.text) {
|
|
488
488
|
currentPrompt = options.input.text;
|
|
489
489
|
}
|
|
490
|
-
// Process CSV files if present and inject into prompt using proper CSV parser
|
|
491
|
-
if ("input" in options && options.input) {
|
|
492
|
-
const input = options.input;
|
|
493
|
-
let csvContent = "";
|
|
494
|
-
const csvOptions = "csvOptions" in options ? options.csvOptions : undefined;
|
|
495
|
-
// Process explicit csvFiles array
|
|
496
|
-
if (input.csvFiles && input.csvFiles.length > 0) {
|
|
497
|
-
for (let i = 0; i < input.csvFiles.length; i++) {
|
|
498
|
-
const csvFile = input.csvFiles[i];
|
|
499
|
-
const filename = extractFilename(csvFile, i);
|
|
500
|
-
const filePath = typeof csvFile === "string" ? csvFile : filename;
|
|
501
|
-
try {
|
|
502
|
-
const result = await FileDetector.detectAndProcess(csvFile, {
|
|
503
|
-
allowedTypes: ["csv"],
|
|
504
|
-
csvOptions: csvOptions,
|
|
505
|
-
});
|
|
506
|
-
let csvSection = `\n\n## CSV Data from "${filename}":\n`;
|
|
507
|
-
// Add metadata from csv-parser library
|
|
508
|
-
if (result.metadata) {
|
|
509
|
-
const metadataText = formatCSVMetadata(result.metadata);
|
|
510
|
-
if (metadataText) {
|
|
511
|
-
csvSection += metadataText + `\n\n`;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
// Put the actual CSV content BEFORE the tool instructions —
|
|
515
|
-
// buildCSVToolInstructions references "the CSV data shown above"
|
|
516
|
-
// and the trailing position keeps that reference accurate.
|
|
517
|
-
// Vertex Gemini misreads CSV-only prompts as "no files attached"
|
|
518
|
-
// when the NOTE-then-data order makes the reference dangle.
|
|
519
|
-
csvSection += result.content;
|
|
520
|
-
csvSection += buildCSVToolInstructions(filePath);
|
|
521
|
-
csvContent += csvSection;
|
|
522
|
-
logger.info(`[CSV] ✅ Processed: ${filename}`, result.metadata);
|
|
523
|
-
}
|
|
524
|
-
catch (error) {
|
|
525
|
-
logger.error(`[CSV] ❌ Failed to process ${filename}:`, error);
|
|
526
|
-
csvContent += `\n\n## CSV Data Error: Failed to process "${filename}"\nReason: ${error instanceof Error ? error.message : "Unknown error"}`;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
// Process unified files array (auto-detect CSV)
|
|
531
|
-
if (input.files && input.files.length > 0) {
|
|
532
|
-
for (const file of input.files) {
|
|
533
|
-
const filename = extractFilename(file);
|
|
534
|
-
try {
|
|
535
|
-
const result = await FileDetector.detectAndProcess(file, {
|
|
536
|
-
maxSize: 50 * 1024 * 1024,
|
|
537
|
-
allowedTypes: ["csv"],
|
|
538
|
-
csvOptions: csvOptions,
|
|
539
|
-
mimetypeHint: isFileWithMetadata(file) ? file.mimetype : undefined,
|
|
540
|
-
});
|
|
541
|
-
if (result.type === "csv") {
|
|
542
|
-
let csvSection = `\n\n## CSV Data from "${filename}":\n`;
|
|
543
|
-
// Add metadata from csv-parser library
|
|
544
|
-
if (result.metadata) {
|
|
545
|
-
const metadataText = formatCSVMetadata(result.metadata);
|
|
546
|
-
if (metadataText) {
|
|
547
|
-
csvSection += metadataText + `\n\n`;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
csvSection += result.content;
|
|
551
|
-
csvContent += csvSection;
|
|
552
|
-
logger.info(`[FileDetector] ✅ CSV: ${filename}`, result.metadata);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
catch (error) {
|
|
556
|
-
// Silently skip non-CSV files in auto-detect mode
|
|
557
|
-
logger.debug(`[FileDetector] Skipped ${filename}: ${error instanceof Error ? error.message : String(error)}`);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
// Prepend CSV content to current prompt
|
|
562
|
-
if (csvContent) {
|
|
563
|
-
currentPrompt = csvContent + (currentPrompt || "");
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
490
|
if (currentPrompt?.trim()) {
|
|
567
491
|
messages.push({
|
|
568
492
|
role: "user",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.19.0",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
|
|
6
6
|
"author": {
|
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
"test:music:unit": "npx tsx test/continuous-test-suite-music-unit.ts",
|
|
124
124
|
"test:image-gen": "npx tsx test/continuous-test-suite-image-gen-extras.ts",
|
|
125
125
|
"test:credentials": "npx tsx test/continuous-test-suite-credentials.ts",
|
|
126
|
+
"test:local-usage": "npx tsx test/continuous-test-suite-local-usage.ts",
|
|
126
127
|
"test:dynamic": "npx tsx test/continuous-test-suite-dynamic.ts",
|
|
127
128
|
"test:proxy": "npx tsx test/continuous-test-suite-proxy.ts",
|
|
128
129
|
"test:codex": "npx tsx test/continuous-test-suite-codex.ts",
|