@juspay/neurolink 10.10.7 → 10.10.8

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.
@@ -212,6 +212,23 @@ export class PDFProcessor {
212
212
  static getProviderConfig(provider) {
213
213
  return PDF_PROVIDER_CONFIGS[provider] || null;
214
214
  }
215
+ /**
216
+ * Best-effort page count for a PDF whose count the caller did not supply
217
+ * (#309). Mirrors what `process()` derives for the `input.pdfFiles` path:
218
+ * the accurate pdfjs count when the document parses, otherwise the header
219
+ * regex estimate. Returns null when neither can determine a count.
220
+ *
221
+ * Exists so the aggregate page-limit guard can enforce against PDFs handed
222
+ * in via `input.content`, where `metadata.pages` is optional and routinely
223
+ * omitted — without it, an absent count silently sums as zero.
224
+ */
225
+ static async resolvePageCount(buffer) {
226
+ const accurate = await PDFProcessor.getAccuratePageCount(buffer);
227
+ if (accurate !== null) {
228
+ return accurate;
229
+ }
230
+ return PDFProcessor.extractBasicMetadata(buffer).estimatedPages;
231
+ }
215
232
  static isValidPDF(buffer) {
216
233
  if (buffer.length < 5) {
217
234
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "10.10.7",
3
+ "version": "10.10.8",
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": {