@sifxprime/krouter 0.5.164 → 0.5.165

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 (213) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/environment/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/presidio/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  36. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  38. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  39. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  40. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  41. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  42. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +5 -5
  43. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  44. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  45. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  46. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  47. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  48. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  49. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  50. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  51. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +3 -3
  52. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  53. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  54. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  55. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  56. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +1 -1
  57. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  58. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  59. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  60. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  61. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  62. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +3 -3
  63. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  64. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  65. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  66. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  67. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/callback.html +1 -1
  69. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  70. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  71. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  72. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  73. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  74. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  75. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +5 -5
  76. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  77. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  78. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  79. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  80. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +5 -5
  81. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  82. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  84. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  85. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +5 -5
  86. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  87. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  89. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  90. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +5 -5
  91. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  92. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/dashboard/environment.html +1 -1
  94. package/app/.next-cli-build/server/app/dashboard/environment.rsc +5 -5
  95. package/app/.next-cli-build/server/app/dashboard/environment.segments/!KGRhc2hib2FyZCk/dashboard/environment/__PAGE__.segment.rsc +5 -5
  96. package/app/.next-cli-build/server/app/dashboard/environment.segments/_full.segment.rsc +5 -5
  97. package/app/.next-cli-build/server/app/dashboard/environment.segments/_tree.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  99. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  100. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +5 -5
  101. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  102. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  104. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  105. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +5 -5
  106. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  107. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  108. package/app/.next-cli-build/server/app/dashboard/presidio.html +1 -1
  109. package/app/.next-cli-build/server/app/dashboard/presidio.rsc +4 -4
  110. package/app/.next-cli-build/server/app/dashboard/presidio.segments/!KGRhc2hib2FyZCk/dashboard/presidio/__PAGE__.segment.rsc +4 -4
  111. package/app/.next-cli-build/server/app/dashboard/presidio.segments/_full.segment.rsc +4 -4
  112. package/app/.next-cli-build/server/app/dashboard/presidio.segments/_tree.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  114. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  115. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +5 -5
  116. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  117. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  118. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  119. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  120. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +5 -5
  121. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  122. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  123. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  124. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  125. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +5 -5
  126. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  127. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  128. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  129. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  130. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +5 -5
  131. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  132. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  133. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  134. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  135. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +5 -5
  136. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  137. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  138. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  139. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  140. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +6 -6
  141. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  142. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  143. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  144. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  145. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  146. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  147. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  148. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  149. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  150. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  151. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +5 -5
  152. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  153. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  154. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  155. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  156. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +5 -5
  157. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  158. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  159. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  160. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  161. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +5 -5
  162. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  163. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  164. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  165. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  166. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +5 -5
  167. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  168. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  169. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  170. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  171. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +5 -5
  172. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  173. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  174. package/app/.next-cli-build/server/app/index.html +1 -1
  175. package/app/.next-cli-build/server/app/index.rsc +3 -3
  176. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  177. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  178. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  180. package/app/.next-cli-build/server/app/landing.html +1 -1
  181. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  182. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  183. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  184. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  185. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  186. package/app/.next-cli-build/server/app/login.html +1 -1
  187. package/app/.next-cli-build/server/app/login.rsc +4 -4
  188. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  189. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
  191. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  192. package/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  193. package/app/.next-cli-build/server/chunks/1738.js +1 -1
  194. package/app/.next-cli-build/server/chunks/2365.js +1 -1
  195. package/app/.next-cli-build/server/chunks/3120.js +1 -1
  196. package/app/.next-cli-build/server/chunks/5718.js +1 -1
  197. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  198. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  199. package/app/.next-cli-build/server/pages/404.html +1 -1
  200. package/app/.next-cli-build/server/pages/500.html +1 -1
  201. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  202. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  203. package/app/.next-cli-build/static/chunks/{1321-0b5ea2e0d2a8833d.js → 1321-ff45959ff6580781.js} +1 -1
  204. package/app/cli/package.json +1 -1
  205. package/app/node_modules/source-map-js/lib/quick-sort.js +10 -1
  206. package/app/node_modules/source-map-js/lib/source-map-consumer.js +51 -3
  207. package/app/node_modules/source-map-js/lib/source-map-generator.js +6 -4
  208. package/app/node_modules/source-map-js/lib/source-node.js +7 -0
  209. package/app/node_modules/source-map-js/package.json +1 -1
  210. package/app/package.json +1 -1
  211. package/package.json +1 -1
  212. /package/app/.next-cli-build/static/{M98dvtgJ0h4WJXRRd3DBx → 8BL7P4wrNCaFJbJqldneC}/_buildManifest.js +0 -0
  213. /package/app/.next-cli-build/static/{M98dvtgJ0h4WJXRRd3DBx → 8BL7P4wrNCaFJbJqldneC}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sifxprime/krouter",
3
- "version": "0.5.164",
3
+ "version": "0.5.165",
4
4
  "description": "Local AI gateway for Claude Code, Cursor, Codex, Copilot, Cline and any OpenAI-compatible client. Route 40+ LLM providers and 100+ models through one endpoint with automatic fallback, OAuth key management and 20-40% token savings.",
5
5
  "homepage": "https://krouter.kodelyth.com",
6
6
  "repository": {
@@ -112,6 +112,15 @@ function cloneSort(comparator) {
112
112
  return templateFn(comparator);
113
113
  }
114
114
 
115
+ let isEvalAllowed = (function () {
116
+ try {
117
+ new Function('return 0')();
118
+ return true;
119
+ } catch {
120
+ return false;
121
+ }
122
+ })();
123
+
115
124
  /**
116
125
  * Sort the given array in-place with the given comparator function.
117
126
  *
@@ -123,7 +132,7 @@ function cloneSort(comparator) {
123
132
 
124
133
  let sortCache = new WeakMap();
125
134
  exports.quickSort = function (ary, comparator, start = 0) {
126
- let doQuickSort = sortCache.get(comparator);
135
+ let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate(comparator);
127
136
  if (doQuickSort === void 0) {
128
137
  doQuickSort = cloneSort(comparator);
129
138
  sortCache.set(comparator, doQuickSort);
@@ -11,6 +11,14 @@ var ArraySet = require('./array-set').ArraySet;
11
11
  var base64VLQ = require('./base64-vlq');
12
12
  var quickSort = require('./quick-sort').quickSort;
13
13
 
14
+ // Upper bound for a section's `offset.line` in an indexed source map. A flat
15
+ // map spends one ';' per generated line, so a tiny indexed map with a huge
16
+ // offset.line turns into a huge amount of work and memory once its mappings
17
+ // are copied into a SourceMapGenerator (CVE-2026-93749). Ten million lines is
18
+ // far beyond any real generated file. Columns are VLQ-encoded as deltas and
19
+ // don't amplify, so they only need to be valid integers.
20
+ var MAX_SECTION_OFFSET_LINE = 1e7;
21
+
14
22
  function SourceMapConsumer(aSourceMap, aSourceMapURL) {
15
23
  var sourceMap = aSourceMap;
16
24
  if (typeof aSourceMap === 'string') {
@@ -935,6 +943,7 @@ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
935
943
  line: -1,
936
944
  column: 0
937
945
  };
946
+ var maxOffsetLine = 0;
938
947
  this._sections = sections.map(function (s) {
939
948
  if (s.url) {
940
949
  // The url field will require support for asynchronicity.
@@ -945,12 +954,32 @@ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
945
954
  var offsetLine = util.getArg(offset, 'line');
946
955
  var offsetColumn = util.getArg(offset, 'column');
947
956
 
957
+ if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) {
958
+ throw new Error('Section offset line and column must be non-negative integers.');
959
+ }
960
+ if (offsetLine > MAX_SECTION_OFFSET_LINE) {
961
+ throw new Error('Section offset line must not exceed ' + MAX_SECTION_OFFSET_LINE + '.');
962
+ }
963
+
948
964
  if (offsetLine < lastOffset.line ||
949
965
  (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
950
966
  throw new Error('Section offsets must be ordered and non-overlapping.');
951
967
  }
952
968
  lastOffset = offset;
953
969
 
970
+ var consumer = new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL);
971
+
972
+ // Offsets of a nested indexed map add up with this one, so apply the
973
+ // bound to the total.
974
+ var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0);
975
+ if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) {
976
+ throw new Error('Section offset line must not exceed ' + MAX_SECTION_OFFSET_LINE +
977
+ ', including offsets of nested sections.');
978
+ }
979
+ if (totalOffsetLine > maxOffsetLine) {
980
+ maxOffsetLine = totalOffsetLine;
981
+ }
982
+
954
983
  return {
955
984
  generatedOffset: {
956
985
  // The offset fields are 0-based, but we use 1-based indices when
@@ -958,9 +987,24 @@ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
958
987
  generatedLine: offsetLine + 1,
959
988
  generatedColumn: offsetColumn + 1
960
989
  },
961
- consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
990
+ consumer: consumer
962
991
  }
963
992
  });
993
+
994
+ // The largest offset.line of any section, including nested sections.
995
+ this._maxOffsetLine = maxOffsetLine;
996
+ }
997
+
998
+ /**
999
+ * Section offsets come from untrusted input and are used as line/column
1000
+ * numbers, so only accept non-negative safe integers (rejects NaN, Infinity,
1001
+ * strings, fractions, etc).
1002
+ */
1003
+ function isValidOffset(aValue) {
1004
+ return typeof aValue === 'number' &&
1005
+ aValue >= 0 &&
1006
+ aValue <= 9007199254740991 && // Number.MAX_SAFE_INTEGER
1007
+ Math.floor(aValue) === aValue;
964
1008
  }
965
1009
 
966
1010
  IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
@@ -978,8 +1022,12 @@ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
978
1022
  get: function () {
979
1023
  var sources = [];
980
1024
  for (var i = 0; i < this._sections.length; i++) {
981
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
982
- sources.push(this._sections[i].consumer.sources[j]);
1025
+ // Read the getter once per section: for a nested indexed map it is
1026
+ // itself this getter, and re-reading it per item is exponential in the
1027
+ // nesting depth (CVE-2026-93749).
1028
+ var sectionSources = this._sections[i].consumer.sources;
1029
+ for (var j = 0; j < sectionSources.length; j++) {
1030
+ sources.push(sectionSources[j]);
983
1031
  }
984
1032
  }
985
1033
  return sources;
@@ -348,10 +348,12 @@ SourceMapGenerator.prototype._serializeMappings =
348
348
 
349
349
  if (mapping.generatedLine !== previousGeneratedLine) {
350
350
  previousGeneratedColumn = 0;
351
- while (mapping.generatedLine !== previousGeneratedLine) {
352
- next += ';';
353
- previousGeneratedLine++;
354
- }
351
+ // One ';' per skipped line. Build large gaps with a single flat
352
+ // string: appending ';' one by one creates a rope node per line, which
353
+ // can exhaust the heap for a big gap (CVE-2026-93749).
354
+ var lineDelta = mapping.generatedLine - previousGeneratedLine;
355
+ next += lineDelta === 1 ? ';' : ';'.repeat(lineDelta);
356
+ previousGeneratedLine = mapping.generatedLine;
355
357
  }
356
358
  else {
357
359
  if (i > 0) {
@@ -113,6 +113,13 @@ SourceNode.fromStringWithSourceMap =
113
113
  // to the SourceNode without any mapping.
114
114
  // Each line is added as separate string.
115
115
  while (lastGeneratedLine < mapping.generatedLine) {
116
+ if (remainingLinesIndex >= remainingLines.length) {
117
+ // The generated code is exhausted. Skip the rest instead of adding
118
+ // empty lines one by one: a mapping may point far past the end of
119
+ // the code (e.g. an indexed map section with a huge offset.line).
120
+ lastGeneratedLine = mapping.generatedLine;
121
+ break;
122
+ }
116
123
  node.add(shiftNextLine());
117
124
  lastGeneratedLine++;
118
125
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "source-map-js",
3
3
  "description": "Generates and consumes source maps",
4
- "version": "1.2.1",
4
+ "version": "1.2.2",
5
5
  "homepage": "https://github.com/7rulnik/source-map-js",
6
6
  "author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
7
7
  "contributors": [
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "krouter-app",
3
- "version": "0.5.164",
3
+ "version": "0.5.165",
4
4
  "description": "kRouter (Kodelyth Router) web dashboard — Kodelyth AI Infrastructure",
5
5
  "private": true,
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sifxprime/krouter",
3
- "version": "0.5.164",
3
+ "version": "0.5.165",
4
4
  "description": "Local AI gateway for Claude Code, Cursor, Codex, Copilot, Cline and any OpenAI-compatible client. Route 40+ LLM providers and 100+ models through one endpoint with automatic fallback, OAuth key management and 20-40% token savings.",
5
5
  "homepage": "https://krouter.kodelyth.com",
6
6
  "repository": {