@juspay/neurolink 12.47.11 → 12.47.13
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
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## [12.47.
|
|
1
|
+
## [12.47.13](https://github.com/juspay/neurolink/compare/v12.47.12...v12.47.13) (2026-10-06)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
- **(
|
|
5
|
+
- **(providers):** give the Bedrock Claude ids their own context windows ([4fe371a](https://github.com/juspay/neurolink/commit/4fe371af22e53b81d4f1a0e3f80d1d0beaf31f58))
|
|
6
6
|
|
|
7
7
|
## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
|
|
8
8
|
|
|
@@ -802,7 +802,7 @@ WRONG: \`\`\`json
|
|
|
802
802
|
WRONG: Based on the data, here's the result: {"field": "value"}
|
|
803
803
|
CORRECT: {"field": "value"}
|
|
804
804
|
|
|
805
|
-
Your entire response = raw JSON object. Nothing else.`}}),uK,ak,dK=E({"src/lib/core/dynamicModels.ts"(){"use strict";et(),z(),pt(),uK=class VEr{static instance;modelRegistry=null;lastFetch=0;CACHE_DURATION=300*1e3;constructor(){}static getInstance(){return this.instance||(this.instance=new VEr),this.instance}async initialize(){const t=[{url:process.env.MODEL_CONFIG_URL||"http://localhost:3001/api/v1/models",timeout:3e3,name:"local-server"},{url:`https://raw.githubusercontent.com/${process.env.MODEL_CONFIG_GITHUB_REPO||"juspay/neurolink"}/${process.env.MODEL_CONFIG_GITHUB_BRANCH||"release"}/config/models.json`,timeout:5e3,name:"github-raw"},{url:"./config/models.json",timeout:1e3,name:"local-file"}],r=[];for(const n of t)try{h.debug(`[DynamicModelProvider] Attempting to load from: ${n.url} (timeout: ${n.timeout}ms)`);const o=await this.loadFromSourceWithTimeout(n.url,n.timeout),i=$G.parse(o);this.modelRegistry=i,this.lastFetch=Date.now(),h.info(`[DynamicModelProvider] Successfully loaded model registry from: ${n.name}`,{source:n.url,modelCount:this.getTotalModelCount(),providerCount:Object.keys(i.models).length,loadTime:`<${n.timeout}ms`});return}catch(o){const i=o instanceof Error?o.message:String(o);r.push({source:n.name,error:i}),h.warn(`[DynamicModelProvider] Failed to load from ${n.name} (${n.url}):`,{error:i,timeout:n.timeout});continue}throw h.warn("[DynamicModelProvider] All model configuration sources failed",{errors:r}),new Error(`Failed to load model configuration from all source. Attempted: ${r.map(n=>n.source).join(", ")}`)}async loadFromSourceWithTimeout(t,r){if(t.startsWith("http")){const n=new AbortController,o=setTimeout(()=>n.abort(),r);try{(t.includes("localhost")||t.includes("127.0.0.1"))&&await this.healthCheckLocalhost(t,Math.min(r,1e3));const i=await fetch(t,{headers:{"User-Agent":"NeuroLink/1.0 (+https://github.com/juspay/neurolink)",Accept:"application/json","Cache-Control":"no-cache"},signal:n.signal});if(clearTimeout(o),!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);return await i.json()}catch(i){throw clearTimeout(o),pr(i)?new Error(`Request timeout after ${r}ms`,{cause:i}):i}}else return new Promise((n,o)=>{const i=setTimeout(()=>{o(new Error(`File read timeout after ${r}ms`))},r);(async()=>{try{const s=await Promise.resolve().then(()=>(Tn(),Iu)),l=(await Promise.resolve().then(()=>(kr(),nm))).resolve(t);if(!s.existsSync(l))throw new Error(`File not found: ${l}`);const c=s.readFileSync(l,"utf8"),u=JSON.parse(c);clearTimeout(i),n(u)}catch(s){clearTimeout(i),o(s)}})()})}async healthCheckLocalhost(t,r){const n=t.replace(/\/api\/.*$/,"/health")||`${t}/health`,o=new AbortController,i=setTimeout(()=>o.abort(),r);try{const s=await fetch(n,{method:"HEAD",signal:o.signal});if(clearTimeout(i),s.status>=500)throw new Error(`Server error: ${s.status}`)}catch(s){if(clearTimeout(i),pr(s))throw new Error("Localhost health check timeout - server may not be running",{cause:s});if(s instanceof Error&&s.message.includes("ECONNREFUSED"))throw new Error(`Localhost server not running at ${t}`,{cause:s});h.debug(`Health check failed for ${t}, proceeding with main request`,{error:s instanceof Error?s.message:String(s)})}}getModelsForProvider(t){return this.ensureInitialized(),this.modelRegistry?.models[t]||{}}resolveModel(t,r){this.ensureInitialized();const n=this.getModelsForProvider(t);if(!r){const s=this.modelRegistry?.defaults?.[t];return s?n[s]:null}if(n[r])return n[r];const o=this.modelRegistry?.aliases?.[r];if(o){const[s,a]=o.split("/");return this.resolveModel(s,a)}const i=Object.keys(n).find(s=>s.toLowerCase().includes(r.toLowerCase())||r.toLowerCase().includes(s.toLowerCase()));return i?n[i]:null}searchByCapability(t,r={}){this.ensureInitialized();const n=[];if(!this.modelRegistry)return n;for(const[o,i]of Object.entries(this.modelRegistry.models))if(!(r.provider&&o!==r.provider))for(const[s,a]of Object.entries(i))r.excludeDeprecated&&a.deprecated||r.maxPrice&&a.pricing.input>r.maxPrice||a.capabilities.includes(t)&&n.push({provider:o,model:s,config:a});return n.sort((o,i)=>o.config.pricing.input-i.config.pricing.input)}getBestModelFor(t){switch(this.ensureInitialized(),t){case"coding":return this.searchByCapability("functionCalling",{excludeDeprecated:!0})[0]||null;case"analysis":return this.searchByCapability("analysis",{excludeDeprecated:!0})[0]||null;case"vision":return this.searchByCapability("vision",{excludeDeprecated:!0})[0]||null;case"fastest":return this.getAllModels().filter(r=>!r.config.deprecated).sort((r,n)=>r.config.pricing.input-n.config.pricing.input)[0]||null;case"cheapest":return this.getAllModels().filter(r=>!r.config.deprecated).sort((r,n)=>r.config.pricing.input-n.config.pricing.input)[0]||null;default:return null}}getAllModels(){this.ensureInitialized();const t=[];if(!this.modelRegistry)return t;for(const[r,n]of Object.entries(this.modelRegistry.models))for(const[o,i]of Object.entries(n))t.push({provider:r,model:o,config:i});return t}getTotalModelCount(){return this.modelRegistry?Object.values(this.modelRegistry.models).reduce((t,r)=>t+Object.keys(r).length,0):0}needsRefresh(){return Date.now()-this.lastFetch>this.CACHE_DURATION}async refresh(){this.modelRegistry=null,await this.initialize()}ensureInitialized(){if(!this.modelRegistry)throw new Error("Model registry not initialized. Call initialize() first.")}getMetadata(){return this.modelRegistry?{version:this.modelRegistry.version,lastUpdated:this.modelRegistry.lastUpdated,modelCount:this.getTotalModelCount()}:null}},ak=uK.getInstance()}});function zzr(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");return Xct[t]??t}function pK(e,t,r){!Number.isFinite(r)||r<=0||GM.set(`${e}:${t}`,r)}function mK(e,t){if(t)return GM.get(`${e}:${t}`)}function Hct(e,t,r){!Number.isFinite(r)||r<=0||qM.set(`${e}:${t}`,r)}function hK(e,t){if(t)return qM.get(`${e}:${t}`)}function Gzr(e,t){qM.delete(`${e}:${t}`)}function jd(e,t){if(t)try{const i=uK.getInstance().resolveModel(e,t);if(i?.contextWindow)return h.debug(`[ContextWindow] Resolved via dynamic registry: provider=${e}, model=${t}, contextWindow=${i.contextWindow}`),i.contextWindow}catch{}if(t){const o=GM.get(`${e}:${t}`);if(o!==void 0)return o}const r=zzr(e);if(t){const o=F8(r,t)??F8(e,t);if(o)return o.contextWindow}const n=gK[r]??gK[e];if(!n)return fK;if(t&&n[t]!==void 0)return n[t];if(t){for(const[o,i]of Object.entries(n))if(o!=="_default"&&t.startsWith(o))return i}return n._default??fK}function qzr(e,t){return t!==void 0&&t>0?t:Math.min(Kct,Math.ceil(e*Jct))}function ql(e,t,r){const n=jd(e,t),o=qzr(n,r);return n-o}var Wct,fK,Kct,Jct,gK,Xct,GM,qM,$c=E({"src/lib/constants/contextWindows.ts"(){"use strict";dK(),z(),O4(),Dy(),Wct=Object.fromEntries(Oy().map(e=>[e.id,{_default:e.models.defaultContextWindow,...Object.fromEntries(Object.entries(e.models.catalog).flatMap(([t,r])=>r.contextWindow!==void 0?[[t,r.contextWindow]]:[]))}])),fK=128e3,Kct=64e3,Jct=.35,gK={"nvidia-nim":{_default:128e3,"meta/llama-3.3-70b-instruct":128e3,"meta/llama-3.1-405b-instruct":128e3,"meta/llama-3.1-70b-instruct":128e3,"meta/llama-3.2-90b-vision-instruct":128e3,"meta/llama-3.2-11b-vision-instruct":128e3,"nvidia/llama-3.3-nemotron-super-49b-v1":128e3,"nvidia/llama-3.1-nemotron-nano-8b-v1":128e3,"nvidia/llama-3.1-nemotron-70b-instruct":128e3,"deepseek-ai/deepseek-r1":128e3,"deepseek-ai/deepseek-r1-distill-llama-70b":128e3,"mistralai/mixtral-8x22b-instruct-v0.1":65536,"mistralai/mixtral-8x7b-instruct-v0.1":32768,"microsoft/phi-4":16384,"google/gemma-3-27b-it":8192,"openai/gpt-oss-20b":131072},"lm-studio":{_default:8192},llamacpp:{_default:8192},cohere:{_default:128e3,"command-r-plus":128e3,"command-r":128e3,"command-r7b-12-2024":128e3},replicate:{_default:32768},voyage:{_default:32e3,"voyage-4":32e3,"voyage-4-large":32e3,"voyage-4-lite":32e3,"voyage-code-4":32e3,"voyage-3.5":32e3,"voyage-3.5-lite":32e3,"voyage-3-large":32e3,"voyage-code-3":32e3,"voyage-finance-2":32e3,"voyage-law-2":16e3,"voyage-multilingual-2":32e3},jina:{_default:8192,"jina-embeddings-v3":8192,"jina-embeddings-v2-base-en":8192,"jina-embeddings-v2-small-en":8192,"jina-colbert-v2":32e3},stability:{_default:2e3},ideogram:{_default:2e3},recraft:{_default:2e3},anthropic:{_default:2e5,"claude-opus-5-5":1e6,"claude-sonnet-5-5":1e6,"claude-fable-5-1":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-fable-5":1e6,"claude-opus-4-8":1e6,"claude-opus-4-7":1e6,"claude-opus-4-6":1e6,"claude-sonnet-4-6":1e6,"claude-opus-4-5-20251101":2e5,"claude-sonnet-4-5-20250929":2e5,"claude-haiku-4-5-20251001":2e5,"claude-opus-4-1-20250805":2e5,"claude-opus-4-20250514":2e5,"claude-sonnet-4-20250514":2e5,"claude-3-7-sonnet-20250219":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-haiku-20241022":2e5,"claude-3-opus-20240229":2e5,"claude-3-sonnet-20240229":2e5,"claude-3-haiku-20240307":2e5},openai:{_default:128e3,"gpt-6-astra":105e4,"gpt-6-sol":105e4,"gpt-6-luna":105e4,"gpt-5.4":105e4,"gpt-5.4-mini":4e5,"gpt-5.4-nano":4e5,"gpt-5.4-pro":105e4,"gpt-5.3-codex":4e5,"gpt-5.2":4e5,"gpt-5.2-pro":4e5,"gpt-5.2-codex":4e5,"gpt-5.2-chat-latest":128e3,"gpt-5.1":4e5,"gpt-5.1-codex":4e5,"gpt-5.1-codex-max":4e5,"gpt-5.1-codex-mini":4e5,"gpt-5.1-chat-latest":128e3,"gpt-5":4e5,"gpt-5-mini":4e5,"gpt-5-nano":4e5,"gpt-5-pro":4e5,"gpt-5-codex":4e5,"gpt-5-chat-latest":128e3,"gpt-oss-120b":128e3,"gpt-oss-20b":128e3,"gpt-4.1":1047576,"gpt-4.1-mini":1047576,"gpt-4.1-nano":1047576,"gpt-4o":128e3,"gpt-4o-mini":128e3,o1:2e5,"o1-mini":128e3,"o1-pro":2e5,o3:2e5,"o3-mini":2e5,"o3-pro":2e5,"o4-mini":2e5,"gpt-4-turbo":128e3,"gpt-4":8192,"gpt-3.5-turbo":16385},"google-ai":{_default:1048576,"gemini-3.1-pro-preview":1048576,"gemini-3.1-flash-lite-preview":1048576,"gemini-3.1-flash-image-preview":1048576,"gemini-3.1-pro-preview-customtools":1048576,"gemini-3-flash-preview":1048576,"gemini-3-pro-image-preview":65536,"gemini-3-pro-preview":1048576,"gemini-2.5-pro":1048576,"gemini-2.5-flash":1048576,"gemini-2.5-flash-lite":1048576,"gemini-2.5-flash-image":32768,"gemini-2.0-flash":1048576,"gemini-1.5-pro":2097152,"gemini-1.5-flash":1048576},vertex:{_default:1048576,"claude-opus-5-5":1e6,"claude-sonnet-5-5":1e6,"claude-fable-5-1":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-fable-5":1e6,"claude-opus-4-8":1e6,"claude-opus-4-7":1e6,"claude-opus-4-6":1e6,"claude-sonnet-4-6":1e6,"claude-sonnet-4-5":2e5,"claude-opus-4-5":2e5,"claude-haiku-4-5":2e5,"claude-sonnet-4":2e5,"claude-sonnet-4-20250514":2e5,"claude-opus-4-20250514":2e5,"claude-opus-4":2e5,"claude-":2e5,"gemini-3.1-pro-preview":1048576,"gemini-3.1-flash-lite-preview":1048576,"gemini-3.1-flash-image-preview":1048576,"gemini-3.1-pro-preview-customtools":1048576,"gemini-3-flash-preview":1048576,"gemini-3-pro-image-preview":65536,"gemini-3-pro-preview":1048576,"gemini-2.5-pro":1048576,"gemini-2.5-flash":1048576,"gemini-2.0-flash":1048576,"gemini-1.5-pro":2097152,"gemini-1.5-flash":1048576},bedrock:{_default:2e5,"anthropic.claude-opus-5-5":1e6,"anthropic.claude-sonnet-5-5":1e6,"anthropic.claude-fable-5-1":1e6,"anthropic.claude-opus-4-6-v1":1e6,"anthropic.claude-sonnet-4-6":1e6,"anthropic.claude-opus-4-5-20251101-v1:0":2e5,"anthropic.claude-sonnet-4-5-20250929-v1:0":2e5,"anthropic.claude-haiku-4-5-20251001-v1:0":2e5,"anthropic.claude-3-5-sonnet-20241022-v1:0":2e5,"anthropic.claude-3-5-haiku-20241022-v1:0":2e5,"anthropic.claude-3-opus-20240229-v1:0":2e5,"anthropic.claude-3-sonnet-20240229-v1:0":2e5,"anthropic.claude-3-haiku-20240307-v1:0":2e5,"amazon.nova-pro-v1:0":3e5,"amazon.nova-lite-v1:0":3e5,"amazon.nova-2-lite-v1:0":1e6,"writer.palmyra-x5-v1:0":1e6,"writer.palmyra-x4-v1:0":128e3,"nvidia.nemotron-nano-3-30b":256e3},azure:{_default:128e3,"gpt-6-astra":105e4,"gpt-6-sol":105e4,"gpt-6-luna":105e4,"gpt-5.6-sol":105e4,"gpt-5.6-terra":105e4,"gpt-5.6-luna":105e4,"gpt-5.5":105e4,"gpt-5.4":105e4,"gpt-5.4-mini":4e5,"gpt-5.4-nano":4e5,"gpt-5.4-pro":105e4,"gpt-5.2":4e5,"gpt-5.2-pro":4e5,"gpt-5.2-codex":4e5,"gpt-5.1":4e5,"gpt-5":4e5,"gpt-5-mini":4e5,"gpt-4.1":1047576,"gpt-4.1-mini":1047576,"gpt-4o":128e3,"gpt-4o-mini":128e3,o3:2e5,"o3-mini":2e5,"o4-mini":2e5,"gpt-4-turbo":128e3,"gpt-4":8192},ollama:{_default:128e3},litellm:{_default:128e3},huggingface:{_default:32e3},sagemaker:{_default:128e3,"nvidia-nemotron-3-nano-30b":1e6,"qwen3-vl-8b-instruct":32768},...Wct},Xct={googleaistudio:"google-ai",googleai:"google-ai",lmstudio:"lm-studio",llamacpp:"llamacpp",nvidianim:"nvidia-nim",nim:"nvidia-nim",nvidia:"nvidia-nim",deepseek:"deepseek"},GM=new Map,qM=new Map}});function yK(e,t){switch(t){case"video":return 500;case"audio":return 300;case"image":return 1500;case"archive":return 1e3;case"unknown":return 500;case"pdf":return Math.min(Math.ceil(e/100),5e4);case"xlsx":case"docx":case"pptx":return Math.ceil(e*.15/4);case"svg":return Math.ceil(e/4);default:return Math.ceil(e*1.33/4)}}function Vzr(e,t){const r=Math.floor(t*vK);let n=0;const o=[],i=[],s=[],a=[...e].sort((l,c)=>l.sizeBytes-c.sizeBytes);for(const l of a){const c=yK(l.sizeBytes,l.fileType);n+c<=r?(n+=c,o.push(l)):(i.push(l),s.push(`Skipped "${l.name}" (${(l.sizeBytes/1024).toFixed(0)} KB) \u2014 exceeds context budget`))}return{included:o,excluded:i,notices:s}}var vK,jzr,Hzr,Yct=E({"src/lib/context/fileTokenBudget.ts"(){"use strict";vK=.6,jzr=100*1024,Hzr=5*1024*1024}}),wK,Wzr,Zct,Qct,eut,Kzr,tut,rut,Jzr,Xzr,VM,nut,TK,Yzr,Zzr,Qzr,eGr,out=E({"node-stub:node:http"(){wK=()=>{},Wzr=globalThis.crypto,Zct=class{constructor(){throw new Error("[NeuroLink:browser] Node HTTP agents require a server runtime")}},Qct=wK,eut=wK,Kzr=globalThis.ReadableStream||class{},tut=()=>({}),rut={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",204:"No Content",206:"Partial Content",301:"Moved Permanently",302:"Found",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},Jzr=globalThis.URL,Xzr=globalThis.URLSearchParams,VM=e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},VM.custom=Symbol.for("nodejs.util.inspect.custom"),VM.colors={},VM.styles={},nut=globalThis.TextDecoder,TK=globalThis.TextEncoder,Yzr=globalThis.performance||{now:()=>Date.now()},Zzr=globalThis.Buffer||class extends Uint8Array{static from(t,r){if(typeof t=="string"){const n=(r||"utf8").toLowerCase();if(n==="base64"){const o=atob(t),i=new Uint8Array(o.length);for(let s=0;s<o.length;s++)i[s]=o.charCodeAt(s);return i}if(n==="hex"){const o=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)o[i/2]=parseInt(t.substr(i,2),16);return o}return new TK().encode(t)}return new Uint8Array(t)}static alloc(t){return new Uint8Array(t)}static isBuffer(t){return t instanceof Uint8Array}static concat(t){const r=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);let o=0;for(const i of t)n.set(i,o),o+=i.length;return n}static byteLength(t,r){return r==="base64"?Math.ceil(t.length*3/4):new TK().encode(t).length}toString(t){const r=(t||"utf8").toLowerCase();if(r==="hex")return Array.from(new Uint8Array(this.buffer,this.byteOffset,this.byteLength)).map(n=>n.toString(16).padStart(2,"0")).join("");if(r==="base64"){let n="";for(let o=0;o<this.length;o++)n+=String.fromCharCode(this[o]);return btoa(n)}return new nut().decode(this)}},Qzr=globalThis.clearTimeout,eGr=globalThis.clearInterval}}),bK,tGr,rGr,iut,sut,aut,lut,cut,uut,dut,put,mut,hut,fut,gut,yut,vut,wut,Tut,but,_ut,Eut,Sut,kut,xut,Aut,Cut,Iut,Rut,Put,Mut,Out,Dut,Nut,Lut,Fut,$ut,Uut,But,zut,Gut,qut,Vut,jut,Hut,Wut,Kut,Jut,Xut,Yut,Zut,Qut,edt,tdt,rdt,ndt,nGr,odt,oGr,iGr,sGr,idt=E({"src/lib/processors/config/fileExtensions.ts"(){"use strict";zf(),bK=Gd("image"),tGr=Gd("document"),rGr=[".json",".xml",".yaml",".yml",...Gd("data")],iut=[".js",".jsx",".mjs",".cjs"],sut=[".ts",".tsx"],aut=[".py",".pyw",".pyi"],lut=[".java"],cut=[".kt",".kts"],uut=[".go"],dut=[".rs"],put=[".c",".h"],mut=[".cpp",".hpp",".cc",".cxx",".hxx"],hut=[".cs"],fut=[".rb",".rake"],gut=[".php",".phtml",".php3",".php4",".php5",".phps"],yut=[".sh",".bash",".zsh",".fish",".ksh"],vut=[".pl",".pm",".pod",".t"],wut=[".lua"],Tut=[".sql"],but=[".swift"],_ut=[".dart"],Eut=[".m",".mm"],Sut=[".scala",".sc"],kut=[".hs",".lhs"],xut=[".ex",".exs"],Aut=[".erl",".hrl"],Cut=[".clj",".cljs",".cljc",".edn"],Iut=[".fs",".fsx",".fsi"],Rut=[".ml",".mli"],Put=[".lisp",".lsp",".cl"],Mut=[".scm",".ss"],Out=[".groovy",".gvy",".gy",".gsh"],Dut=[".ps1",".psm1",".psd1"],Nut=[".r",".rmd"],Lut=[".jl"],Fut=[".nim",".nims"],$ut=[".zig"],Uut=[".v"],But=[".cr"],zut=[".d"],Gut=[".asm",".s"],qut=[".f",".f90",".f95",".f03",".for"],Vut=[".cob",".cbl",".cobol"],jut=[".pas",".pp",".p"],Hut=[".ada",".adb",".ads"],Wut=[".vue"],Kut=[".svelte"],Jut=[".hbs",".handlebars"],Xut=[".ejs"],Yut=[".pug",".jade"],Zut=[".css"],Qut=[".scss",".sass"],edt=[".less"],tdt=[".styl",".stylus"],rdt=[".dockerfile"],ndt=[".mk"],nGr=[...iut,...sut,...aut,...lut,...cut,...uut,...dut,...put,...mut,...hut,...fut,...gut,...yut,...vut,...wut,...Tut,...but,..._ut,...Eut,...Sut,...kut,...xut,...Aut,...Cut,...Iut,...Rut,...Put,...Mut,...Out,...Dut,...Nut,...Lut,...Fut,...$ut,...Uut,...But,...zut,...Gut,...qut,...Vut,...jut,...Hut,...Wut,...Kut,...Jut,...Xut,...Yut,...Zut,...Qut,...edt,...tdt,...rdt,...ndt],odt=[".env",".ini",".toml",".cfg",".conf",".config",".properties",".editorconfig",".gitignore",".gitattributes",".npmrc",".yarnrc",".prettierrc",".eslintrc",".babelrc"],oGr=Gd("archive"),iGr=Gd("video"),sGr=Gd("audio")}}),sdt,aGr=E({"src/lib/processors/config/languageMap.ts"(){"use strict";qt(),sdt={".js":"JavaScript",".jsx":"JavaScript (JSX)",".mjs":"JavaScript (ESM)",".cjs":"JavaScript (CommonJS)",".ts":"TypeScript",".tsx":"TypeScript (TSX)",".py":"Python",".pyw":"Python",".pyi":"Python (Stub)",".java":"Java",".kt":"Kotlin",".kts":"Kotlin (Script)",".go":"Go",".rs":"Rust",".c":"C",".h":"C Header",".cpp":"C++",".hpp":"C++ Header",".cc":"C++",".cxx":"C++",".hxx":"C++ Header",".cs":"C#",".rb":"Ruby",".rake":"Ruby (Rake)",".php":"PHP",".phtml":"PHP (HTML)",".php3":"PHP",".php4":"PHP",".php5":"PHP",".phps":"PHP",".sh":"Shell",".bash":"Bash",".zsh":"Zsh",".fish":"Fish",".ksh":"Ksh",".sql":"SQL",".swift":"Swift",".dart":"Dart",".m":"Objective-C",".mm":"Objective-C++",".scala":"Scala",".sc":"Scala (Script)",".hs":"Haskell",".lhs":"Literate Haskell",".lua":"Lua",".r":"R",".R":"R",".rmd":"R Markdown",".Rmd":"R Markdown",".pl":"Perl",".pm":"Perl (Module)",".pod":"Perl (Documentation)",".t":"Perl (Test)",".ex":"Elixir",".exs":"Elixir (Script)",".erl":"Erlang",".hrl":"Erlang (Header)",".clj":"Clojure",".cljs":"ClojureScript",".cljc":"Clojure (Common)",".edn":"Clojure (EDN)",".fs":"F#",".fsx":"F# (Script)",".fsi":"F# (Signature)",".ml":"OCaml",".mli":"OCaml (Interface)",".lisp":"Lisp",".lsp":"Lisp",".cl":"Common Lisp",".scm":"Scheme",".ss":"Scheme",".groovy":"Groovy",".gvy":"Groovy",".gy":"Groovy",".gsh":"Groovy (Script)",".ps1":"PowerShell",".psm1":"PowerShell (Module)",".psd1":"PowerShell (Data)",".nim":"Nim",".nims":"Nim (Script)",".zig":"Zig",".v":"V",".jl":"Julia",".cr":"Crystal",".d":"D",".asm":"Assembly",".s":"Assembly",".S":"Assembly",".f":"Fortran",".f90":"Fortran 90",".f95":"Fortran 95",".f03":"Fortran 2003",".for":"Fortran",".cob":"COBOL",".cbl":"COBOL",".cobol":"COBOL",".pas":"Pascal",".pp":"Pascal",".p":"Pascal",".ada":"Ada",".adb":"Ada (Body)",".ads":"Ada (Spec)",".vue":"Vue",".svelte":"Svelte",".hbs":"Handlebars",".handlebars":"Handlebars",".ejs":"EJS",".pug":"Pug",".jade":"Jade",".css":"CSS",".scss":"SCSS",".sass":"Sass",".less":"Less",".styl":"Stylus",".stylus":"Stylus",".html":"HTML",".htm":"HTML",".xhtml":"XHTML",".xml":"XML",".json":"JSON",".yaml":"YAML",".yml":"YAML",".toml":"TOML",".md":"Markdown",".markdown":"Markdown",".rst":"reStructuredText",".tex":"LaTeX",".latex":"LaTeX",".dockerfile":"Dockerfile",".mk":"Makefile",".cmake":"CMake",".gradle":"Gradle",".sbt":"SBT",".env":"Environment",".ini":"INI",".cfg":"Configuration",".conf":"Configuration",".config":"Configuration",".properties":"Properties",".log":"Log",".txt":"Plain Text"}}});function lk(e){return jM[MM(e)]||"application/octet-stream"}var adt,ldt,Hf,Vo,Vi,cdt,udt,ddt,lGr,_K,jM,EK=E({"src/lib/processors/config/mimeConstants.ts"(){"use strict";zf(),adt={JPEG:"image/jpeg",PNG:"image/png",GIF:"image/gif",WEBP:"image/webp",SVG:"image/svg+xml",BMP:"image/bmp",TIFF:"image/tiff",AVIF:"image/avif",HEIC:"image/heic",HEIF:"image/heif",ICO:"image/x-icon",ICO_MS:"image/vnd.microsoft.icon"},ldt={PDF:"application/pdf",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",DOC:"application/msword",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",XLS:"application/vnd.ms-excel",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",PPT:"application/vnd.ms-powerpoint",ODT:"application/vnd.oasis.opendocument.text",ODS:"application/vnd.oasis.opendocument.spreadsheet",ODP:"application/vnd.oasis.opendocument.presentation",RTF:"application/rtf",RTF_TEXT:"text/rtf"},Hf={JSON:"application/json",XML:"application/xml",XML_TEXT:"text/xml",CSV:"text/csv",YAML:"text/yaml",YAML_APP:"application/x-yaml"},Vo={PLAIN:"text/plain",HTML:"text/html",XHTML:"application/xhtml+xml",MARKDOWN:"text/markdown",MARKDOWN_ALT:"text/x-markdown",CSS:"text/css",JAVASCRIPT:"text/javascript",JAVASCRIPT_APP:"application/javascript"},Vi={TYPESCRIPT:"text/typescript",PYTHON:"text/x-python",JAVA:"text/x-java-source",GO:"text/x-go",RUST:"text/x-rustsrc",C:"text/x-c",CPP:"text/x-c++",CSHARP:"text/x-csharp",RUBY:"text/x-ruby",PHP:"text/x-php",SHELL:"text/x-shellscript",SQL:"text/x-sql"},cdt={ZIP:"application/zip",ZIP_COMPRESSED:"application/x-zip-compressed",GZIP:"application/gzip",TAR:"application/x-tar",RAR:"application/x-rar-compressed",RAR_VND:"application/vnd.rar",SEVEN_ZIP:"application/x-7z-compressed",OCTET_STREAM:"application/octet-stream"},udt={MP4:"video/mp4",AVI:"video/avi",MOV:"video/quicktime",MKV:"video/x-matroska",WEBM:"video/webm",FLV:"video/x-flv",WMV:"video/x-ms-wmv"},ddt={MP3:"audio/mpeg",WAV:"audio/wav",AAC:"audio/aac",FLAC:"audio/flac",OGG:"audio/ogg",M4A:"audio/mp4",WMA:"audio/x-ms-wma"},lGr={...adt,...ldt,...Hf,...Vo,...Vi,...cdt,...udt,...ddt},_K={".txt":Vo.PLAIN,".md":Vo.MARKDOWN,".markdown":Vo.MARKDOWN,".html":Vo.HTML,".htm":Vo.HTML,".xhtml":Vo.XHTML,".log":Vo.PLAIN,".css":Vo.CSS,".json":Hf.JSON,".xml":Hf.XML,".yaml":"application/yaml",".yml":"application/yaml",".js":Vo.JAVASCRIPT,".mjs":Vo.JAVASCRIPT,".cjs":Vo.JAVASCRIPT,".ts":Vi.TYPESCRIPT,".tsx":Vi.TYPESCRIPT,".jsx":Vo.JAVASCRIPT,".py":Vi.PYTHON,".java":Vi.JAVA,".go":Vi.GO,".rs":Vi.RUST,".rb":Vi.RUBY,".php":Vi.PHP,".c":Vi.C,".cpp":Vi.CPP,".h":Vi.C,".hpp":Vi.CPP,".cs":Vi.CSHARP,".swift":"text/x-swift",".kt":"text/x-kotlin",".scala":"text/x-scala",".sh":Vi.SHELL,".bash":Vi.SHELL,".zsh":Vi.SHELL,".ps1":"text/x-powershell",".sql":Vi.SQL,".r":"text/x-r",".lua":"text/x-lua",".perl":"text/x-perl",".pl":"text/x-perl",".env":Vo.PLAIN,".ini":Vo.PLAIN,".toml":Vo.PLAIN,".cfg":Vo.PLAIN,".conf":Vo.PLAIN,".properties":Vo.PLAIN,".gitignore":Vo.PLAIN,".dockerignore":Vo.PLAIN,".editorconfig":Vo.PLAIN,".prettierrc":Hf.JSON,".eslintrc":Hf.JSON,".babelrc":Hf.JSON},jM={..._K,...Object.fromEntries(Bf.flatMap(e=>e.extensions.map(t=>[t,e.mimeTypes[0]]))),...Xrt}}});function pdt(e){const t=typeof e=="string"?e.slice(0,SK):e.toString("utf8",0,Math.min(e.length,SK));if(!t.includes("<svg"))return!1;let r=t.charCodeAt(0)===65279?1:0;for(;r<t.length;){for(;r<t.length&&/\s/.test(t[r]);)r++;if(t[r]!=="<")return!1;let n;if(t.startsWith("<?",r))n=t.indexOf("?>",r+2),r=n===-1?t.length:n+2;else if(t.startsWith("<!--",r))n=t.indexOf("-->",r+4),r=n===-1?t.length:n+3;else if(t.startsWith("<!",r))r=cGr(t,r);else return/^<svg[\s>/]/i.test(t.slice(r))}return!1}function cGr(e,t){let r=null,n=0;for(let o=t+2;o<e.length;o++){const i=e[o];if(r){i===r&&(r=null);continue}if(e.startsWith("<!--",o)){const s=e.indexOf("-->",o+4);if(s===-1)return e.length;o=s+2;continue}if(i==='"'||i==="'")r=i;else if(i==="[")n++;else if(i==="]")n=Math.max(0,n-1);else if(i===">"&&n===0)return o+1}return e.length}var SK,mdt=E({"src/lib/utils/markupSniff.ts"(){"use strict";SK=1024}});function hdt(e){if(!e)return;const t=e.split(";")[0].trim().toLowerCase();if(!(!t||t===ydt))return t}function fdt(e){const t={"text/csv":"csv","application/csv":"csv","image/svg+xml":"svg","application/pdf":"pdf","application/json":"text","application/xml":"text","text/xml":"text","application/yaml":"text","application/x-yaml":"text","text/yaml":"text","application/javascript":"text","application/typescript":"text","application/zip":"archive","application/x-tar":"archive","application/gzip":"archive","application/x-gzip":"archive","application/x-7z-compressed":"archive","application/vnd.rar":"archive","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx"};return t[e]?t[e]:e.startsWith("text/")?"text":e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":null}function gdt(e){return{"text/plain":"txt","text/html":"html","text/css":"css","text/javascript":"js","application/javascript":"js","application/typescript":"ts","text/markdown":"md","text/csv":"csv","application/csv":"csv","application/json":"json","application/xml":"xml","text/xml":"xml","application/yaml":"yaml","application/x-yaml":"yaml","text/yaml":"yaml","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov","video/x-matroska":"mkv","video/x-msvideo":"avi","audio/mpeg":"mp3","audio/wav":"wav","audio/ogg":"ogg","audio/flac":"flac","audio/mp4":"m4a","audio/aac":"aac","application/zip":"zip","application/x-tar":"tar","application/gzip":"gz","application/x-gzip":"gz","application/x-7z-compressed":"7z","application/vnd.rar":"rar"}[e]||""}var ydt,vdt=E({"src/lib/utils/mimeTypeHints.ts"(){"use strict";ydt="application/octet-stream"}}),_m={};Z(_m,{Agent:()=>apt,BedrockClient:()=>Tdt,BedrockRuntimeClient:()=>_dt,Blob:()=>spt,Client:()=>cpt,ConverseCommand:()=>Edt,ConverseStreamCommand:()=>Sdt,Cron:()=>Gdt,Dispatcher:()=>upt,File:()=>ipt,FlowProducer:()=>zdt,FormData:()=>opt,GoogleAuth:()=>Rdt,HTTPException:()=>Jdt,Headers:()=>npt,Hippocampus:()=>Ddt,HippocampusConfig:()=>Ndt,Hono:()=>Wdt,ImageFormat:()=>kdt,InvokeEndpointCommand:()=>Cdt,InvokeEndpointWithResponseStreamCommand:()=>Idt,InvokeModelCommand:()=>xdt,Job:()=>Udt,ListFoundationModelsCommand:()=>bdt,MockAgent:()=>mpt,Pool:()=>lpt,Queue:()=>Fdt,QueueScheduler:()=>Bdt,Request:()=>tpt,Response:()=>rpt,SageMakerRuntimeClient:()=>Adt,TextToSpeechClient:()=>Mdt,VertexAI:()=>Pdt,Webhook:()=>Odt,Worker:()=>$dt,convertToHtml:()=>Hdt,cors:()=>Kdt,createClient:()=>Ldt,default:()=>wdt,extractRawText:()=>jdt,fetch:()=>ept,getGlobalDispatcher:()=>ppt,interceptors:()=>hpt,logger:()=>Xdt,parseBuffer:()=>qdt,request:()=>fpt,secureHeaders:()=>Ydt,selectCover:()=>Vdt,setGlobalDispatcher:()=>dpt,streamSSE:()=>Zdt,timeout:()=>Qdt});var Wf,bi,wdt,Tdt,bdt,_dt,Edt,Sdt,kdt,xdt,Adt,Cdt,Idt,Rdt,Pdt,Mdt,Odt,Ddt,Ndt,Ldt,Fdt,$dt,Udt,Bdt,zdt,Gdt,qdt,Vdt,jdt,Hdt,Wdt,Kdt,Jdt,Xdt,Ydt,Zdt,Qdt,ept,tpt,rpt,npt,opt,ipt,spt,apt,lpt,cpt,upt,dpt,ppt,mpt,hpt,fpt,Kf=E({"npm-stub:pdf-parse"(){Wf={get(e,t){return t==="__esModule"?!0:t==="default"?new Proxy({},{get:Wf.get}):new Proxy(function(...r){return new Proxy({},{get:Wf.get})},{get:Wf.get,apply(r,n,o){return new Proxy({},{get:Wf.get})},construct(r,n){return new Proxy({},{get:Wf.get})}})}},bi=new Proxy({},Wf),wdt=bi,{BedrockClient:Tdt,ListFoundationModelsCommand:bdt,BedrockRuntimeClient:_dt,ConverseCommand:Edt,ConverseStreamCommand:Sdt,ImageFormat:kdt,InvokeModelCommand:xdt}=bi,{SageMakerRuntimeClient:Adt,InvokeEndpointCommand:Cdt,InvokeEndpointWithResponseStreamCommand:Idt}=bi,{GoogleAuth:Rdt,VertexAI:Pdt,TextToSpeechClient:Mdt}=bi,{Webhook:Odt}=bi,{Hippocampus:Ddt,HippocampusConfig:Ndt}=bi,{createClient:Ldt}=bi,{Queue:Fdt,Worker:$dt,Job:Udt,QueueScheduler:Bdt,FlowProducer:zdt}=bi,{Cron:Gdt}=bi,{parseBuffer:qdt,selectCover:Vdt}=bi,{extractRawText:jdt,convertToHtml:Hdt}=bi,{Hono:Wdt}=bi,{cors:Kdt,HTTPException:Jdt,logger:Xdt,secureHeaders:Ydt,streamSSE:Zdt,timeout:Qdt}=bi,ept=globalThis.fetch,tpt=globalThis.Request,rpt=globalThis.Response,npt=globalThis.Headers,opt=globalThis.FormData,ipt=globalThis.File,spt=globalThis.Blob,apt=bi.Agent,lpt=bi.Pool,cpt=bi.Client,upt=bi.Dispatcher,dpt=()=>{},ppt=()=>bi,mpt=bi.MockAgent,hpt={redirect:()=>e=>e,retry:()=>e=>e},fpt=async(e,t)=>{const r=await globalThis.fetch(e,t);return{statusCode:r.status,headers:Object.fromEntries(r.headers.entries()),body:{text:()=>r.text(),json:()=>r.json(),arrayBuffer:()=>r.arrayBuffer()}}}}}),Jf,Xf,gpt,ypt=E({"src/lib/utils/pdfProcessor.ts"(){"use strict";ym(),qt(),Zo(),et(),z(),Jf={anthropic:{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"document"},bedrock:{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:"auto",apiType:"document"},"google-vertex":{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"document"},vertex:{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"document"},"google-ai-studio":{maxSizeMB:2e3,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},gemini:{maxSizeMB:2e3,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},"google-ai":{maxSizeMB:2e3,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},openai:{maxSizeMB:10,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},azure:{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},"azure-openai":{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},litellm:{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},"openai-compatible":{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},mistral:{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},"hugging-face":{maxSizeMB:10,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},huggingface:{maxSizeMB:10,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"}},Xf=class ii{static PDF_SIGNATURE=Buffer.from("%PDF-","ascii");static async process(t,r){const n=(r?.provider||"unknown").toLowerCase(),o=Jf[n];if(!ii.isValidPDF(t))throw new Error("Invalid PDF file format. File must start with %PDF- header.");if(!o){const l=Object.keys(Jf).join(", ");throw new Error(`PDF files are not configured for ${n} provider.
|
|
805
|
+
Your entire response = raw JSON object. Nothing else.`}}),uK,ak,dK=E({"src/lib/core/dynamicModels.ts"(){"use strict";et(),z(),pt(),uK=class VEr{static instance;modelRegistry=null;lastFetch=0;CACHE_DURATION=300*1e3;constructor(){}static getInstance(){return this.instance||(this.instance=new VEr),this.instance}async initialize(){const t=[{url:process.env.MODEL_CONFIG_URL||"http://localhost:3001/api/v1/models",timeout:3e3,name:"local-server"},{url:`https://raw.githubusercontent.com/${process.env.MODEL_CONFIG_GITHUB_REPO||"juspay/neurolink"}/${process.env.MODEL_CONFIG_GITHUB_BRANCH||"release"}/config/models.json`,timeout:5e3,name:"github-raw"},{url:"./config/models.json",timeout:1e3,name:"local-file"}],r=[];for(const n of t)try{h.debug(`[DynamicModelProvider] Attempting to load from: ${n.url} (timeout: ${n.timeout}ms)`);const o=await this.loadFromSourceWithTimeout(n.url,n.timeout),i=$G.parse(o);this.modelRegistry=i,this.lastFetch=Date.now(),h.info(`[DynamicModelProvider] Successfully loaded model registry from: ${n.name}`,{source:n.url,modelCount:this.getTotalModelCount(),providerCount:Object.keys(i.models).length,loadTime:`<${n.timeout}ms`});return}catch(o){const i=o instanceof Error?o.message:String(o);r.push({source:n.name,error:i}),h.warn(`[DynamicModelProvider] Failed to load from ${n.name} (${n.url}):`,{error:i,timeout:n.timeout});continue}throw h.warn("[DynamicModelProvider] All model configuration sources failed",{errors:r}),new Error(`Failed to load model configuration from all source. Attempted: ${r.map(n=>n.source).join(", ")}`)}async loadFromSourceWithTimeout(t,r){if(t.startsWith("http")){const n=new AbortController,o=setTimeout(()=>n.abort(),r);try{(t.includes("localhost")||t.includes("127.0.0.1"))&&await this.healthCheckLocalhost(t,Math.min(r,1e3));const i=await fetch(t,{headers:{"User-Agent":"NeuroLink/1.0 (+https://github.com/juspay/neurolink)",Accept:"application/json","Cache-Control":"no-cache"},signal:n.signal});if(clearTimeout(o),!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);return await i.json()}catch(i){throw clearTimeout(o),pr(i)?new Error(`Request timeout after ${r}ms`,{cause:i}):i}}else return new Promise((n,o)=>{const i=setTimeout(()=>{o(new Error(`File read timeout after ${r}ms`))},r);(async()=>{try{const s=await Promise.resolve().then(()=>(Tn(),Iu)),l=(await Promise.resolve().then(()=>(kr(),nm))).resolve(t);if(!s.existsSync(l))throw new Error(`File not found: ${l}`);const c=s.readFileSync(l,"utf8"),u=JSON.parse(c);clearTimeout(i),n(u)}catch(s){clearTimeout(i),o(s)}})()})}async healthCheckLocalhost(t,r){const n=t.replace(/\/api\/.*$/,"/health")||`${t}/health`,o=new AbortController,i=setTimeout(()=>o.abort(),r);try{const s=await fetch(n,{method:"HEAD",signal:o.signal});if(clearTimeout(i),s.status>=500)throw new Error(`Server error: ${s.status}`)}catch(s){if(clearTimeout(i),pr(s))throw new Error("Localhost health check timeout - server may not be running",{cause:s});if(s instanceof Error&&s.message.includes("ECONNREFUSED"))throw new Error(`Localhost server not running at ${t}`,{cause:s});h.debug(`Health check failed for ${t}, proceeding with main request`,{error:s instanceof Error?s.message:String(s)})}}getModelsForProvider(t){return this.ensureInitialized(),this.modelRegistry?.models[t]||{}}resolveModel(t,r){this.ensureInitialized();const n=this.getModelsForProvider(t);if(!r){const s=this.modelRegistry?.defaults?.[t];return s?n[s]:null}if(n[r])return n[r];const o=this.modelRegistry?.aliases?.[r];if(o){const[s,a]=o.split("/");return this.resolveModel(s,a)}const i=Object.keys(n).find(s=>s.toLowerCase().includes(r.toLowerCase())||r.toLowerCase().includes(s.toLowerCase()));return i?n[i]:null}searchByCapability(t,r={}){this.ensureInitialized();const n=[];if(!this.modelRegistry)return n;for(const[o,i]of Object.entries(this.modelRegistry.models))if(!(r.provider&&o!==r.provider))for(const[s,a]of Object.entries(i))r.excludeDeprecated&&a.deprecated||r.maxPrice&&a.pricing.input>r.maxPrice||a.capabilities.includes(t)&&n.push({provider:o,model:s,config:a});return n.sort((o,i)=>o.config.pricing.input-i.config.pricing.input)}getBestModelFor(t){switch(this.ensureInitialized(),t){case"coding":return this.searchByCapability("functionCalling",{excludeDeprecated:!0})[0]||null;case"analysis":return this.searchByCapability("analysis",{excludeDeprecated:!0})[0]||null;case"vision":return this.searchByCapability("vision",{excludeDeprecated:!0})[0]||null;case"fastest":return this.getAllModels().filter(r=>!r.config.deprecated).sort((r,n)=>r.config.pricing.input-n.config.pricing.input)[0]||null;case"cheapest":return this.getAllModels().filter(r=>!r.config.deprecated).sort((r,n)=>r.config.pricing.input-n.config.pricing.input)[0]||null;default:return null}}getAllModels(){this.ensureInitialized();const t=[];if(!this.modelRegistry)return t;for(const[r,n]of Object.entries(this.modelRegistry.models))for(const[o,i]of Object.entries(n))t.push({provider:r,model:o,config:i});return t}getTotalModelCount(){return this.modelRegistry?Object.values(this.modelRegistry.models).reduce((t,r)=>t+Object.keys(r).length,0):0}needsRefresh(){return Date.now()-this.lastFetch>this.CACHE_DURATION}async refresh(){this.modelRegistry=null,await this.initialize()}ensureInitialized(){if(!this.modelRegistry)throw new Error("Model registry not initialized. Call initialize() first.")}getMetadata(){return this.modelRegistry?{version:this.modelRegistry.version,lastUpdated:this.modelRegistry.lastUpdated,modelCount:this.getTotalModelCount()}:null}},ak=uK.getInstance()}});function zzr(e){const t=e.toLowerCase().replace(/[^a-z]/g,"");return Xct[t]??t}function pK(e,t,r){!Number.isFinite(r)||r<=0||GM.set(`${e}:${t}`,r)}function mK(e,t){if(t)return GM.get(`${e}:${t}`)}function Hct(e,t,r){!Number.isFinite(r)||r<=0||qM.set(`${e}:${t}`,r)}function hK(e,t){if(t)return qM.get(`${e}:${t}`)}function Gzr(e,t){qM.delete(`${e}:${t}`)}function jd(e,t){if(t)try{const i=uK.getInstance().resolveModel(e,t);if(i?.contextWindow)return h.debug(`[ContextWindow] Resolved via dynamic registry: provider=${e}, model=${t}, contextWindow=${i.contextWindow}`),i.contextWindow}catch{}if(t){const o=GM.get(`${e}:${t}`);if(o!==void 0)return o}const r=zzr(e);if(t){const o=F8(r,t)??F8(e,t);if(o)return o.contextWindow}const n=gK[r]??gK[e];if(!n)return fK;if(t&&n[t]!==void 0)return n[t];if(t){for(const[o,i]of Object.entries(n))if(o!=="_default"&&t.startsWith(o))return i}return n._default??fK}function qzr(e,t){return t!==void 0&&t>0?t:Math.min(Kct,Math.ceil(e*Jct))}function ql(e,t,r){const n=jd(e,t),o=qzr(n,r);return n-o}var Wct,fK,Kct,Jct,gK,Xct,GM,qM,$c=E({"src/lib/constants/contextWindows.ts"(){"use strict";dK(),z(),O4(),Dy(),Wct=Object.fromEntries(Oy().map(e=>[e.id,{_default:e.models.defaultContextWindow,...Object.fromEntries(Object.entries(e.models.catalog).flatMap(([t,r])=>r.contextWindow!==void 0?[[t,r.contextWindow]]:[]))}])),fK=128e3,Kct=64e3,Jct=.35,gK={"nvidia-nim":{_default:128e3,"meta/llama-3.3-70b-instruct":128e3,"meta/llama-3.1-405b-instruct":128e3,"meta/llama-3.1-70b-instruct":128e3,"meta/llama-3.2-90b-vision-instruct":128e3,"meta/llama-3.2-11b-vision-instruct":128e3,"nvidia/llama-3.3-nemotron-super-49b-v1":128e3,"nvidia/llama-3.1-nemotron-nano-8b-v1":128e3,"nvidia/llama-3.1-nemotron-70b-instruct":128e3,"deepseek-ai/deepseek-r1":128e3,"deepseek-ai/deepseek-r1-distill-llama-70b":128e3,"mistralai/mixtral-8x22b-instruct-v0.1":65536,"mistralai/mixtral-8x7b-instruct-v0.1":32768,"microsoft/phi-4":16384,"google/gemma-3-27b-it":8192,"openai/gpt-oss-20b":131072},"lm-studio":{_default:8192},llamacpp:{_default:8192},cohere:{_default:128e3,"command-r-plus":128e3,"command-r":128e3,"command-r7b-12-2024":128e3},replicate:{_default:32768},voyage:{_default:32e3,"voyage-4":32e3,"voyage-4-large":32e3,"voyage-4-lite":32e3,"voyage-code-4":32e3,"voyage-3.5":32e3,"voyage-3.5-lite":32e3,"voyage-3-large":32e3,"voyage-code-3":32e3,"voyage-finance-2":32e3,"voyage-law-2":16e3,"voyage-multilingual-2":32e3},jina:{_default:8192,"jina-embeddings-v3":8192,"jina-embeddings-v2-base-en":8192,"jina-embeddings-v2-small-en":8192,"jina-colbert-v2":32e3},stability:{_default:2e3},ideogram:{_default:2e3},recraft:{_default:2e3},anthropic:{_default:2e5,"claude-opus-5-5":1e6,"claude-sonnet-5-5":1e6,"claude-fable-5-1":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-fable-5":1e6,"claude-opus-4-8":1e6,"claude-opus-4-7":1e6,"claude-opus-4-6":1e6,"claude-sonnet-4-6":1e6,"claude-opus-4-5-20251101":2e5,"claude-sonnet-4-5-20250929":2e5,"claude-haiku-4-5-20251001":2e5,"claude-opus-4-1-20250805":2e5,"claude-opus-4-20250514":2e5,"claude-sonnet-4-20250514":2e5,"claude-3-7-sonnet-20250219":2e5,"claude-3-5-sonnet-20241022":2e5,"claude-3-5-haiku-20241022":2e5,"claude-3-opus-20240229":2e5,"claude-3-sonnet-20240229":2e5,"claude-3-haiku-20240307":2e5},openai:{_default:128e3,"gpt-6-astra":105e4,"gpt-6-sol":105e4,"gpt-6-luna":105e4,"gpt-5.4":105e4,"gpt-5.4-mini":4e5,"gpt-5.4-nano":4e5,"gpt-5.4-pro":105e4,"gpt-5.3-codex":4e5,"gpt-5.2":4e5,"gpt-5.2-pro":4e5,"gpt-5.2-codex":4e5,"gpt-5.2-chat-latest":128e3,"gpt-5.1":4e5,"gpt-5.1-codex":4e5,"gpt-5.1-codex-max":4e5,"gpt-5.1-codex-mini":4e5,"gpt-5.1-chat-latest":128e3,"gpt-5":4e5,"gpt-5-mini":4e5,"gpt-5-nano":4e5,"gpt-5-pro":4e5,"gpt-5-codex":4e5,"gpt-5-chat-latest":128e3,"gpt-oss-120b":128e3,"gpt-oss-20b":128e3,"gpt-4.1":1047576,"gpt-4.1-mini":1047576,"gpt-4.1-nano":1047576,"gpt-4o":128e3,"gpt-4o-mini":128e3,o1:2e5,"o1-mini":128e3,"o1-pro":2e5,o3:2e5,"o3-mini":2e5,"o3-pro":2e5,"o4-mini":2e5,"gpt-4-turbo":128e3,"gpt-4":8192,"gpt-3.5-turbo":16385},"google-ai":{_default:1048576,"gemini-3.1-pro-preview":1048576,"gemini-3.1-flash-lite-preview":1048576,"gemini-3.1-flash-image-preview":1048576,"gemini-3.1-pro-preview-customtools":1048576,"gemini-3-flash-preview":1048576,"gemini-3-pro-image-preview":65536,"gemini-3-pro-preview":1048576,"gemini-2.5-pro":1048576,"gemini-2.5-flash":1048576,"gemini-2.5-flash-lite":1048576,"gemini-2.5-flash-image":32768,"gemini-2.0-flash":1048576,"gemini-1.5-pro":2097152,"gemini-1.5-flash":1048576},vertex:{_default:1048576,"claude-opus-5-5":1e6,"claude-sonnet-5-5":1e6,"claude-fable-5-1":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-fable-5":1e6,"claude-opus-4-8":1e6,"claude-opus-4-7":1e6,"claude-opus-4-6":1e6,"claude-sonnet-4-6":1e6,"claude-sonnet-4-5":2e5,"claude-opus-4-5":2e5,"claude-haiku-4-5":2e5,"claude-sonnet-4":2e5,"claude-sonnet-4-20250514":2e5,"claude-opus-4-20250514":2e5,"claude-opus-4":2e5,"claude-":2e5,"gemini-3.1-pro-preview":1048576,"gemini-3.1-flash-lite-preview":1048576,"gemini-3.1-flash-image-preview":1048576,"gemini-3.1-pro-preview-customtools":1048576,"gemini-3-flash-preview":1048576,"gemini-3-pro-image-preview":65536,"gemini-3-pro-preview":1048576,"gemini-2.5-pro":1048576,"gemini-2.5-flash":1048576,"gemini-2.0-flash":1048576,"gemini-1.5-pro":2097152,"gemini-1.5-flash":1048576},bedrock:{_default:2e5,"anthropic.claude-opus-5-5":1e6,"anthropic.claude-sonnet-5-5":1e6,"anthropic.claude-fable-5-1":1e6,"anthropic.claude-opus-4-6-v1":1e6,"anthropic.claude-sonnet-4-6":1e6,"anthropic.claude-opus-4-5-20251101-v1:0":2e5,"anthropic.claude-sonnet-4-5-20250929-v1:0":2e5,"anthropic.claude-haiku-4-5-20251001-v1:0":2e5,"anthropic.claude-opus-4-1-20250805-v1:0":2e5,"anthropic.claude-sonnet-4-20250514-v1:0":2e5,"anthropic.claude-3-7-sonnet-20250219-v1:0":2e5,"us.anthropic.claude-3-7-sonnet-20250219-v1:0":2e5,"anthropic.claude-3-5-sonnet-20241022-v1:0":2e5,"anthropic.claude-3-5-haiku-20241022-v1:0":2e5,"anthropic.claude-3-opus-20240229-v1:0":2e5,"anthropic.claude-3-sonnet-20240229-v1:0":2e5,"anthropic.claude-3-haiku-20240307-v1:0":2e5,"amazon.nova-pro-v1:0":3e5,"amazon.nova-lite-v1:0":3e5,"amazon.nova-2-lite-v1:0":1e6,"writer.palmyra-x5-v1:0":1e6,"writer.palmyra-x4-v1:0":128e3,"nvidia.nemotron-nano-3-30b":256e3},azure:{_default:128e3,"gpt-6-astra":105e4,"gpt-6-sol":105e4,"gpt-6-luna":105e4,"gpt-5.6-sol":105e4,"gpt-5.6-terra":105e4,"gpt-5.6-luna":105e4,"gpt-5.5":105e4,"gpt-5.4":105e4,"gpt-5.4-mini":4e5,"gpt-5.4-nano":4e5,"gpt-5.4-pro":105e4,"gpt-5.2":4e5,"gpt-5.2-pro":4e5,"gpt-5.2-codex":4e5,"gpt-5.1":4e5,"gpt-5":4e5,"gpt-5-mini":4e5,"gpt-4.1":1047576,"gpt-4.1-mini":1047576,"gpt-4o":128e3,"gpt-4o-mini":128e3,o3:2e5,"o3-mini":2e5,"o4-mini":2e5,"gpt-4-turbo":128e3,"gpt-4":8192},ollama:{_default:128e3},litellm:{_default:128e3},huggingface:{_default:32e3},sagemaker:{_default:128e3,"nvidia-nemotron-3-nano-30b":1e6,"qwen3-vl-8b-instruct":32768},...Wct},Xct={googleaistudio:"google-ai",googleai:"google-ai",lmstudio:"lm-studio",llamacpp:"llamacpp",nvidianim:"nvidia-nim",nim:"nvidia-nim",nvidia:"nvidia-nim",deepseek:"deepseek"},GM=new Map,qM=new Map}});function yK(e,t){switch(t){case"video":return 500;case"audio":return 300;case"image":return 1500;case"archive":return 1e3;case"unknown":return 500;case"pdf":return Math.min(Math.ceil(e/100),5e4);case"xlsx":case"docx":case"pptx":return Math.ceil(e*.15/4);case"svg":return Math.ceil(e/4);default:return Math.ceil(e*1.33/4)}}function Vzr(e,t){const r=Math.floor(t*vK);let n=0;const o=[],i=[],s=[],a=[...e].sort((l,c)=>l.sizeBytes-c.sizeBytes);for(const l of a){const c=yK(l.sizeBytes,l.fileType);n+c<=r?(n+=c,o.push(l)):(i.push(l),s.push(`Skipped "${l.name}" (${(l.sizeBytes/1024).toFixed(0)} KB) \u2014 exceeds context budget`))}return{included:o,excluded:i,notices:s}}var vK,jzr,Hzr,Yct=E({"src/lib/context/fileTokenBudget.ts"(){"use strict";vK=.6,jzr=100*1024,Hzr=5*1024*1024}}),wK,Wzr,Zct,Qct,eut,Kzr,tut,rut,Jzr,Xzr,VM,nut,TK,Yzr,Zzr,Qzr,eGr,out=E({"node-stub:node:http"(){wK=()=>{},Wzr=globalThis.crypto,Zct=class{constructor(){throw new Error("[NeuroLink:browser] Node HTTP agents require a server runtime")}},Qct=wK,eut=wK,Kzr=globalThis.ReadableStream||class{},tut=()=>({}),rut={100:"Continue",101:"Switching Protocols",200:"OK",201:"Created",202:"Accepted",204:"No Content",206:"Partial Content",301:"Moved Permanently",302:"Found",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"},Jzr=globalThis.URL,Xzr=globalThis.URLSearchParams,VM=e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}},VM.custom=Symbol.for("nodejs.util.inspect.custom"),VM.colors={},VM.styles={},nut=globalThis.TextDecoder,TK=globalThis.TextEncoder,Yzr=globalThis.performance||{now:()=>Date.now()},Zzr=globalThis.Buffer||class extends Uint8Array{static from(t,r){if(typeof t=="string"){const n=(r||"utf8").toLowerCase();if(n==="base64"){const o=atob(t),i=new Uint8Array(o.length);for(let s=0;s<o.length;s++)i[s]=o.charCodeAt(s);return i}if(n==="hex"){const o=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)o[i/2]=parseInt(t.substr(i,2),16);return o}return new TK().encode(t)}return new Uint8Array(t)}static alloc(t){return new Uint8Array(t)}static isBuffer(t){return t instanceof Uint8Array}static concat(t){const r=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);let o=0;for(const i of t)n.set(i,o),o+=i.length;return n}static byteLength(t,r){return r==="base64"?Math.ceil(t.length*3/4):new TK().encode(t).length}toString(t){const r=(t||"utf8").toLowerCase();if(r==="hex")return Array.from(new Uint8Array(this.buffer,this.byteOffset,this.byteLength)).map(n=>n.toString(16).padStart(2,"0")).join("");if(r==="base64"){let n="";for(let o=0;o<this.length;o++)n+=String.fromCharCode(this[o]);return btoa(n)}return new nut().decode(this)}},Qzr=globalThis.clearTimeout,eGr=globalThis.clearInterval}}),bK,tGr,rGr,iut,sut,aut,lut,cut,uut,dut,put,mut,hut,fut,gut,yut,vut,wut,Tut,but,_ut,Eut,Sut,kut,xut,Aut,Cut,Iut,Rut,Put,Mut,Out,Dut,Nut,Lut,Fut,$ut,Uut,But,zut,Gut,qut,Vut,jut,Hut,Wut,Kut,Jut,Xut,Yut,Zut,Qut,edt,tdt,rdt,ndt,nGr,odt,oGr,iGr,sGr,idt=E({"src/lib/processors/config/fileExtensions.ts"(){"use strict";zf(),bK=Gd("image"),tGr=Gd("document"),rGr=[".json",".xml",".yaml",".yml",...Gd("data")],iut=[".js",".jsx",".mjs",".cjs"],sut=[".ts",".tsx"],aut=[".py",".pyw",".pyi"],lut=[".java"],cut=[".kt",".kts"],uut=[".go"],dut=[".rs"],put=[".c",".h"],mut=[".cpp",".hpp",".cc",".cxx",".hxx"],hut=[".cs"],fut=[".rb",".rake"],gut=[".php",".phtml",".php3",".php4",".php5",".phps"],yut=[".sh",".bash",".zsh",".fish",".ksh"],vut=[".pl",".pm",".pod",".t"],wut=[".lua"],Tut=[".sql"],but=[".swift"],_ut=[".dart"],Eut=[".m",".mm"],Sut=[".scala",".sc"],kut=[".hs",".lhs"],xut=[".ex",".exs"],Aut=[".erl",".hrl"],Cut=[".clj",".cljs",".cljc",".edn"],Iut=[".fs",".fsx",".fsi"],Rut=[".ml",".mli"],Put=[".lisp",".lsp",".cl"],Mut=[".scm",".ss"],Out=[".groovy",".gvy",".gy",".gsh"],Dut=[".ps1",".psm1",".psd1"],Nut=[".r",".rmd"],Lut=[".jl"],Fut=[".nim",".nims"],$ut=[".zig"],Uut=[".v"],But=[".cr"],zut=[".d"],Gut=[".asm",".s"],qut=[".f",".f90",".f95",".f03",".for"],Vut=[".cob",".cbl",".cobol"],jut=[".pas",".pp",".p"],Hut=[".ada",".adb",".ads"],Wut=[".vue"],Kut=[".svelte"],Jut=[".hbs",".handlebars"],Xut=[".ejs"],Yut=[".pug",".jade"],Zut=[".css"],Qut=[".scss",".sass"],edt=[".less"],tdt=[".styl",".stylus"],rdt=[".dockerfile"],ndt=[".mk"],nGr=[...iut,...sut,...aut,...lut,...cut,...uut,...dut,...put,...mut,...hut,...fut,...gut,...yut,...vut,...wut,...Tut,...but,..._ut,...Eut,...Sut,...kut,...xut,...Aut,...Cut,...Iut,...Rut,...Put,...Mut,...Out,...Dut,...Nut,...Lut,...Fut,...$ut,...Uut,...But,...zut,...Gut,...qut,...Vut,...jut,...Hut,...Wut,...Kut,...Jut,...Xut,...Yut,...Zut,...Qut,...edt,...tdt,...rdt,...ndt],odt=[".env",".ini",".toml",".cfg",".conf",".config",".properties",".editorconfig",".gitignore",".gitattributes",".npmrc",".yarnrc",".prettierrc",".eslintrc",".babelrc"],oGr=Gd("archive"),iGr=Gd("video"),sGr=Gd("audio")}}),sdt,aGr=E({"src/lib/processors/config/languageMap.ts"(){"use strict";qt(),sdt={".js":"JavaScript",".jsx":"JavaScript (JSX)",".mjs":"JavaScript (ESM)",".cjs":"JavaScript (CommonJS)",".ts":"TypeScript",".tsx":"TypeScript (TSX)",".py":"Python",".pyw":"Python",".pyi":"Python (Stub)",".java":"Java",".kt":"Kotlin",".kts":"Kotlin (Script)",".go":"Go",".rs":"Rust",".c":"C",".h":"C Header",".cpp":"C++",".hpp":"C++ Header",".cc":"C++",".cxx":"C++",".hxx":"C++ Header",".cs":"C#",".rb":"Ruby",".rake":"Ruby (Rake)",".php":"PHP",".phtml":"PHP (HTML)",".php3":"PHP",".php4":"PHP",".php5":"PHP",".phps":"PHP",".sh":"Shell",".bash":"Bash",".zsh":"Zsh",".fish":"Fish",".ksh":"Ksh",".sql":"SQL",".swift":"Swift",".dart":"Dart",".m":"Objective-C",".mm":"Objective-C++",".scala":"Scala",".sc":"Scala (Script)",".hs":"Haskell",".lhs":"Literate Haskell",".lua":"Lua",".r":"R",".R":"R",".rmd":"R Markdown",".Rmd":"R Markdown",".pl":"Perl",".pm":"Perl (Module)",".pod":"Perl (Documentation)",".t":"Perl (Test)",".ex":"Elixir",".exs":"Elixir (Script)",".erl":"Erlang",".hrl":"Erlang (Header)",".clj":"Clojure",".cljs":"ClojureScript",".cljc":"Clojure (Common)",".edn":"Clojure (EDN)",".fs":"F#",".fsx":"F# (Script)",".fsi":"F# (Signature)",".ml":"OCaml",".mli":"OCaml (Interface)",".lisp":"Lisp",".lsp":"Lisp",".cl":"Common Lisp",".scm":"Scheme",".ss":"Scheme",".groovy":"Groovy",".gvy":"Groovy",".gy":"Groovy",".gsh":"Groovy (Script)",".ps1":"PowerShell",".psm1":"PowerShell (Module)",".psd1":"PowerShell (Data)",".nim":"Nim",".nims":"Nim (Script)",".zig":"Zig",".v":"V",".jl":"Julia",".cr":"Crystal",".d":"D",".asm":"Assembly",".s":"Assembly",".S":"Assembly",".f":"Fortran",".f90":"Fortran 90",".f95":"Fortran 95",".f03":"Fortran 2003",".for":"Fortran",".cob":"COBOL",".cbl":"COBOL",".cobol":"COBOL",".pas":"Pascal",".pp":"Pascal",".p":"Pascal",".ada":"Ada",".adb":"Ada (Body)",".ads":"Ada (Spec)",".vue":"Vue",".svelte":"Svelte",".hbs":"Handlebars",".handlebars":"Handlebars",".ejs":"EJS",".pug":"Pug",".jade":"Jade",".css":"CSS",".scss":"SCSS",".sass":"Sass",".less":"Less",".styl":"Stylus",".stylus":"Stylus",".html":"HTML",".htm":"HTML",".xhtml":"XHTML",".xml":"XML",".json":"JSON",".yaml":"YAML",".yml":"YAML",".toml":"TOML",".md":"Markdown",".markdown":"Markdown",".rst":"reStructuredText",".tex":"LaTeX",".latex":"LaTeX",".dockerfile":"Dockerfile",".mk":"Makefile",".cmake":"CMake",".gradle":"Gradle",".sbt":"SBT",".env":"Environment",".ini":"INI",".cfg":"Configuration",".conf":"Configuration",".config":"Configuration",".properties":"Properties",".log":"Log",".txt":"Plain Text"}}});function lk(e){return jM[MM(e)]||"application/octet-stream"}var adt,ldt,Hf,Vo,Vi,cdt,udt,ddt,lGr,_K,jM,EK=E({"src/lib/processors/config/mimeConstants.ts"(){"use strict";zf(),adt={JPEG:"image/jpeg",PNG:"image/png",GIF:"image/gif",WEBP:"image/webp",SVG:"image/svg+xml",BMP:"image/bmp",TIFF:"image/tiff",AVIF:"image/avif",HEIC:"image/heic",HEIF:"image/heif",ICO:"image/x-icon",ICO_MS:"image/vnd.microsoft.icon"},ldt={PDF:"application/pdf",DOCX:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",DOC:"application/msword",XLSX:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",XLS:"application/vnd.ms-excel",PPTX:"application/vnd.openxmlformats-officedocument.presentationml.presentation",PPT:"application/vnd.ms-powerpoint",ODT:"application/vnd.oasis.opendocument.text",ODS:"application/vnd.oasis.opendocument.spreadsheet",ODP:"application/vnd.oasis.opendocument.presentation",RTF:"application/rtf",RTF_TEXT:"text/rtf"},Hf={JSON:"application/json",XML:"application/xml",XML_TEXT:"text/xml",CSV:"text/csv",YAML:"text/yaml",YAML_APP:"application/x-yaml"},Vo={PLAIN:"text/plain",HTML:"text/html",XHTML:"application/xhtml+xml",MARKDOWN:"text/markdown",MARKDOWN_ALT:"text/x-markdown",CSS:"text/css",JAVASCRIPT:"text/javascript",JAVASCRIPT_APP:"application/javascript"},Vi={TYPESCRIPT:"text/typescript",PYTHON:"text/x-python",JAVA:"text/x-java-source",GO:"text/x-go",RUST:"text/x-rustsrc",C:"text/x-c",CPP:"text/x-c++",CSHARP:"text/x-csharp",RUBY:"text/x-ruby",PHP:"text/x-php",SHELL:"text/x-shellscript",SQL:"text/x-sql"},cdt={ZIP:"application/zip",ZIP_COMPRESSED:"application/x-zip-compressed",GZIP:"application/gzip",TAR:"application/x-tar",RAR:"application/x-rar-compressed",RAR_VND:"application/vnd.rar",SEVEN_ZIP:"application/x-7z-compressed",OCTET_STREAM:"application/octet-stream"},udt={MP4:"video/mp4",AVI:"video/avi",MOV:"video/quicktime",MKV:"video/x-matroska",WEBM:"video/webm",FLV:"video/x-flv",WMV:"video/x-ms-wmv"},ddt={MP3:"audio/mpeg",WAV:"audio/wav",AAC:"audio/aac",FLAC:"audio/flac",OGG:"audio/ogg",M4A:"audio/mp4",WMA:"audio/x-ms-wma"},lGr={...adt,...ldt,...Hf,...Vo,...Vi,...cdt,...udt,...ddt},_K={".txt":Vo.PLAIN,".md":Vo.MARKDOWN,".markdown":Vo.MARKDOWN,".html":Vo.HTML,".htm":Vo.HTML,".xhtml":Vo.XHTML,".log":Vo.PLAIN,".css":Vo.CSS,".json":Hf.JSON,".xml":Hf.XML,".yaml":"application/yaml",".yml":"application/yaml",".js":Vo.JAVASCRIPT,".mjs":Vo.JAVASCRIPT,".cjs":Vo.JAVASCRIPT,".ts":Vi.TYPESCRIPT,".tsx":Vi.TYPESCRIPT,".jsx":Vo.JAVASCRIPT,".py":Vi.PYTHON,".java":Vi.JAVA,".go":Vi.GO,".rs":Vi.RUST,".rb":Vi.RUBY,".php":Vi.PHP,".c":Vi.C,".cpp":Vi.CPP,".h":Vi.C,".hpp":Vi.CPP,".cs":Vi.CSHARP,".swift":"text/x-swift",".kt":"text/x-kotlin",".scala":"text/x-scala",".sh":Vi.SHELL,".bash":Vi.SHELL,".zsh":Vi.SHELL,".ps1":"text/x-powershell",".sql":Vi.SQL,".r":"text/x-r",".lua":"text/x-lua",".perl":"text/x-perl",".pl":"text/x-perl",".env":Vo.PLAIN,".ini":Vo.PLAIN,".toml":Vo.PLAIN,".cfg":Vo.PLAIN,".conf":Vo.PLAIN,".properties":Vo.PLAIN,".gitignore":Vo.PLAIN,".dockerignore":Vo.PLAIN,".editorconfig":Vo.PLAIN,".prettierrc":Hf.JSON,".eslintrc":Hf.JSON,".babelrc":Hf.JSON},jM={..._K,...Object.fromEntries(Bf.flatMap(e=>e.extensions.map(t=>[t,e.mimeTypes[0]]))),...Xrt}}});function pdt(e){const t=typeof e=="string"?e.slice(0,SK):e.toString("utf8",0,Math.min(e.length,SK));if(!t.includes("<svg"))return!1;let r=t.charCodeAt(0)===65279?1:0;for(;r<t.length;){for(;r<t.length&&/\s/.test(t[r]);)r++;if(t[r]!=="<")return!1;let n;if(t.startsWith("<?",r))n=t.indexOf("?>",r+2),r=n===-1?t.length:n+2;else if(t.startsWith("<!--",r))n=t.indexOf("-->",r+4),r=n===-1?t.length:n+3;else if(t.startsWith("<!",r))r=cGr(t,r);else return/^<svg[\s>/]/i.test(t.slice(r))}return!1}function cGr(e,t){let r=null,n=0;for(let o=t+2;o<e.length;o++){const i=e[o];if(r){i===r&&(r=null);continue}if(e.startsWith("<!--",o)){const s=e.indexOf("-->",o+4);if(s===-1)return e.length;o=s+2;continue}if(i==='"'||i==="'")r=i;else if(i==="[")n++;else if(i==="]")n=Math.max(0,n-1);else if(i===">"&&n===0)return o+1}return e.length}var SK,mdt=E({"src/lib/utils/markupSniff.ts"(){"use strict";SK=1024}});function hdt(e){if(!e)return;const t=e.split(";")[0].trim().toLowerCase();if(!(!t||t===ydt))return t}function fdt(e){const t={"text/csv":"csv","application/csv":"csv","image/svg+xml":"svg","application/pdf":"pdf","application/json":"text","application/xml":"text","text/xml":"text","application/yaml":"text","application/x-yaml":"text","text/yaml":"text","application/javascript":"text","application/typescript":"text","application/zip":"archive","application/x-tar":"archive","application/gzip":"archive","application/x-gzip":"archive","application/x-7z-compressed":"archive","application/vnd.rar":"archive","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx"};return t[e]?t[e]:e.startsWith("text/")?"text":e.startsWith("image/")?"image":e.startsWith("audio/")?"audio":e.startsWith("video/")?"video":null}function gdt(e){return{"text/plain":"txt","text/html":"html","text/css":"css","text/javascript":"js","application/javascript":"js","application/typescript":"ts","text/markdown":"md","text/csv":"csv","application/csv":"csv","application/json":"json","application/xml":"xml","text/xml":"xml","application/yaml":"yaml","application/x-yaml":"yaml","text/yaml":"yaml","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov","video/x-matroska":"mkv","video/x-msvideo":"avi","audio/mpeg":"mp3","audio/wav":"wav","audio/ogg":"ogg","audio/flac":"flac","audio/mp4":"m4a","audio/aac":"aac","application/zip":"zip","application/x-tar":"tar","application/gzip":"gz","application/x-gzip":"gz","application/x-7z-compressed":"7z","application/vnd.rar":"rar"}[e]||""}var ydt,vdt=E({"src/lib/utils/mimeTypeHints.ts"(){"use strict";ydt="application/octet-stream"}}),_m={};Z(_m,{Agent:()=>apt,BedrockClient:()=>Tdt,BedrockRuntimeClient:()=>_dt,Blob:()=>spt,Client:()=>cpt,ConverseCommand:()=>Edt,ConverseStreamCommand:()=>Sdt,Cron:()=>Gdt,Dispatcher:()=>upt,File:()=>ipt,FlowProducer:()=>zdt,FormData:()=>opt,GoogleAuth:()=>Rdt,HTTPException:()=>Jdt,Headers:()=>npt,Hippocampus:()=>Ddt,HippocampusConfig:()=>Ndt,Hono:()=>Wdt,ImageFormat:()=>kdt,InvokeEndpointCommand:()=>Cdt,InvokeEndpointWithResponseStreamCommand:()=>Idt,InvokeModelCommand:()=>xdt,Job:()=>Udt,ListFoundationModelsCommand:()=>bdt,MockAgent:()=>mpt,Pool:()=>lpt,Queue:()=>Fdt,QueueScheduler:()=>Bdt,Request:()=>tpt,Response:()=>rpt,SageMakerRuntimeClient:()=>Adt,TextToSpeechClient:()=>Mdt,VertexAI:()=>Pdt,Webhook:()=>Odt,Worker:()=>$dt,convertToHtml:()=>Hdt,cors:()=>Kdt,createClient:()=>Ldt,default:()=>wdt,extractRawText:()=>jdt,fetch:()=>ept,getGlobalDispatcher:()=>ppt,interceptors:()=>hpt,logger:()=>Xdt,parseBuffer:()=>qdt,request:()=>fpt,secureHeaders:()=>Ydt,selectCover:()=>Vdt,setGlobalDispatcher:()=>dpt,streamSSE:()=>Zdt,timeout:()=>Qdt});var Wf,bi,wdt,Tdt,bdt,_dt,Edt,Sdt,kdt,xdt,Adt,Cdt,Idt,Rdt,Pdt,Mdt,Odt,Ddt,Ndt,Ldt,Fdt,$dt,Udt,Bdt,zdt,Gdt,qdt,Vdt,jdt,Hdt,Wdt,Kdt,Jdt,Xdt,Ydt,Zdt,Qdt,ept,tpt,rpt,npt,opt,ipt,spt,apt,lpt,cpt,upt,dpt,ppt,mpt,hpt,fpt,Kf=E({"npm-stub:pdf-parse"(){Wf={get(e,t){return t==="__esModule"?!0:t==="default"?new Proxy({},{get:Wf.get}):new Proxy(function(...r){return new Proxy({},{get:Wf.get})},{get:Wf.get,apply(r,n,o){return new Proxy({},{get:Wf.get})},construct(r,n){return new Proxy({},{get:Wf.get})}})}},bi=new Proxy({},Wf),wdt=bi,{BedrockClient:Tdt,ListFoundationModelsCommand:bdt,BedrockRuntimeClient:_dt,ConverseCommand:Edt,ConverseStreamCommand:Sdt,ImageFormat:kdt,InvokeModelCommand:xdt}=bi,{SageMakerRuntimeClient:Adt,InvokeEndpointCommand:Cdt,InvokeEndpointWithResponseStreamCommand:Idt}=bi,{GoogleAuth:Rdt,VertexAI:Pdt,TextToSpeechClient:Mdt}=bi,{Webhook:Odt}=bi,{Hippocampus:Ddt,HippocampusConfig:Ndt}=bi,{createClient:Ldt}=bi,{Queue:Fdt,Worker:$dt,Job:Udt,QueueScheduler:Bdt,FlowProducer:zdt}=bi,{Cron:Gdt}=bi,{parseBuffer:qdt,selectCover:Vdt}=bi,{extractRawText:jdt,convertToHtml:Hdt}=bi,{Hono:Wdt}=bi,{cors:Kdt,HTTPException:Jdt,logger:Xdt,secureHeaders:Ydt,streamSSE:Zdt,timeout:Qdt}=bi,ept=globalThis.fetch,tpt=globalThis.Request,rpt=globalThis.Response,npt=globalThis.Headers,opt=globalThis.FormData,ipt=globalThis.File,spt=globalThis.Blob,apt=bi.Agent,lpt=bi.Pool,cpt=bi.Client,upt=bi.Dispatcher,dpt=()=>{},ppt=()=>bi,mpt=bi.MockAgent,hpt={redirect:()=>e=>e,retry:()=>e=>e},fpt=async(e,t)=>{const r=await globalThis.fetch(e,t);return{statusCode:r.status,headers:Object.fromEntries(r.headers.entries()),body:{text:()=>r.text(),json:()=>r.json(),arrayBuffer:()=>r.arrayBuffer()}}}}}),Jf,Xf,gpt,ypt=E({"src/lib/utils/pdfProcessor.ts"(){"use strict";ym(),qt(),Zo(),et(),z(),Jf={anthropic:{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"document"},bedrock:{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:"auto",apiType:"document"},"google-vertex":{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"document"},vertex:{maxSizeMB:5,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"document"},"google-ai-studio":{maxSizeMB:2e3,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},gemini:{maxSizeMB:2e3,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},"google-ai":{maxSizeMB:2e3,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},openai:{maxSizeMB:10,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},azure:{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},"azure-openai":{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},litellm:{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},"openai-compatible":{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},mistral:{maxSizeMB:10,maxPages:100,supportsNative:!1,requiresCitations:!1,apiType:"files-api"},"hugging-face":{maxSizeMB:10,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"},huggingface:{maxSizeMB:10,maxPages:100,supportsNative:!0,requiresCitations:!1,apiType:"files-api"}},Xf=class ii{static PDF_SIGNATURE=Buffer.from("%PDF-","ascii");static async process(t,r){const n=(r?.provider||"unknown").toLowerCase(),o=Jf[n];if(!ii.isValidPDF(t))throw new Error("Invalid PDF file format. File must start with %PDF- header.");if(!o){const l=Object.keys(Jf).join(", ");throw new Error(`PDF files are not configured for ${n} provider.
|
|
806
806
|
Configured providers: ${l}
|
|
807
807
|
Current provider: ${n}
|
|
808
808
|
|
|
@@ -278,7 +278,14 @@ export const MODEL_CONTEXT_WINDOWS = {
|
|
|
278
278
|
"anthropic.claude-opus-4-5-20251101-v1:0": 200_000,
|
|
279
279
|
"anthropic.claude-sonnet-4-5-20250929-v1:0": 200_000,
|
|
280
280
|
"anthropic.claude-haiku-4-5-20251001-v1:0": 200_000,
|
|
281
|
-
// Claude
|
|
281
|
+
// Claude 4.1 / 4 — the AWS Bedrock model cards state 200K tokens
|
|
282
|
+
"anthropic.claude-opus-4-1-20250805-v1:0": 200_000,
|
|
283
|
+
"anthropic.claude-sonnet-4-20250514-v1:0": 200_000,
|
|
284
|
+
// Claude legacy. AWS lists no model card for 3.7 Sonnet; 200K is the window
|
|
285
|
+
// of the same model in the Anthropic manifest. The `us.` id is its
|
|
286
|
+
// cross-region inference profile, the form tokens.ts keys its output cap by.
|
|
287
|
+
"anthropic.claude-3-7-sonnet-20250219-v1:0": 200_000,
|
|
288
|
+
"us.anthropic.claude-3-7-sonnet-20250219-v1:0": 200_000,
|
|
282
289
|
"anthropic.claude-3-5-sonnet-20241022-v1:0": 200_000,
|
|
283
290
|
"anthropic.claude-3-5-haiku-20241022-v1:0": 200_000,
|
|
284
291
|
"anthropic.claude-3-opus-20240229-v1:0": 200_000,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "12.47.
|
|
3
|
+
"version": "12.47.13",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002/call) for routing, tool selection and context budgeting. MCP-native (4 transports), voice TTS/STT/realtime, RAG, agents, memory, compaction, 9 observability exporters. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · TypeSafe Jev and more.",
|
|
6
6
|
"author": {
|
|
@@ -687,6 +687,9 @@
|
|
|
687
687
|
"jws@<4.0.1": ">=4.0.1",
|
|
688
688
|
"tar@<7.5.8": ">=7.5.8",
|
|
689
689
|
"qs@<6.16.0": ">=6.16.0",
|
|
690
|
+
"proxy-addr@<2.0.8": ">=2.0.8",
|
|
691
|
+
"fast-copy@>=3.0.0 <3.1.0": ">=3.1.0 <4.0.0",
|
|
692
|
+
"fast-copy@>=4.0.0 <4.1.0": ">=4.1.0 <5.0.0",
|
|
690
693
|
"minimatch@>=10.0.0 <10.2.3": ">=10.2.3",
|
|
691
694
|
"minimatch@>=9.0.0 <9.0.7": ">=9.0.7",
|
|
692
695
|
"typedoc>minimatch": ">=10.2.3",
|