@omnicross/core 0.1.10 → 0.2.1

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 (204) hide show
  1. package/README.md +7 -0
  2. package/dist/{BuiltinToolExecutor-CS2WpXhM.d.cts → BuiltinToolExecutor-BHgH-EaZ.d.cts} +25 -2
  3. package/dist/{BuiltinToolExecutor-BluWyeob.d.ts → BuiltinToolExecutor-Bi1LmiTP.d.ts} +25 -2
  4. package/dist/{CompletionService-kNA17cfI.d.cts → CompletionService-BniP7j88.d.cts} +2 -2
  5. package/dist/{CompletionService-C3BX0Ovy.d.ts → CompletionService-BqrKPwfA.d.ts} +2 -2
  6. package/dist/{ProviderProxy-QdwNV6l1.d.cts → ProviderProxy-Bz_nkOwq.d.cts} +1 -1
  7. package/dist/{ProviderProxy--ROec6VI.d.ts → ProviderProxy-Ckr6oTrE.d.ts} +1 -1
  8. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +6 -6
  9. package/dist/auth/GeminiCodeAssistProjectResolver.js +4 -4
  10. package/dist/{chunk-NGYOO5TO.js → chunk-2C3TTBS7.js} +7 -7
  11. package/dist/{chunk-QUSEZNYS.cjs → chunk-32SRZFFP.cjs} +4 -1
  12. package/dist/chunk-4JOU54M5.js +200 -0
  13. package/dist/{chunk-2UTGX6FM.js → chunk-4VVCXVB7.js} +1 -1
  14. package/dist/{chunk-RJUONLUQ.cjs → chunk-4Z3ZLLC2.cjs} +14 -8
  15. package/dist/chunk-6DDYNS2B.cjs +384 -0
  16. package/dist/{chunk-GXEZ2R3E.js → chunk-6OKXH2TW.js} +18 -7
  17. package/dist/{chunk-YWL7YZWS.cjs → chunk-7LRTPNFL.cjs} +5 -0
  18. package/dist/{chunk-CCVRRJOX.js → chunk-7PIUVCKK.js} +9 -2
  19. package/dist/chunk-7RJI3NDI.cjs +236 -0
  20. package/dist/{chunk-IIRPUVPH.cjs → chunk-7ZHBN75N.cjs} +3 -1
  21. package/dist/chunk-D4WNI6BR.cjs +386 -0
  22. package/dist/chunk-DBBR6RHF.js +236 -0
  23. package/dist/chunk-E4QHVXV5.cjs +118 -0
  24. package/dist/{chunk-HKB656B4.js → chunk-EUZRH544.js} +55 -287
  25. package/dist/{chunk-WNKWAEUR.js → chunk-EYGBM2VC.js} +3 -1
  26. package/dist/{chunk-UWDW6PN3.cjs → chunk-FX325I5Q.cjs} +20 -9
  27. package/dist/chunk-G4CZIUIB.cjs +200 -0
  28. package/dist/chunk-HCOQQAZE.cjs +123 -0
  29. package/dist/chunk-HL2YSPL7.cjs +673 -0
  30. package/dist/{chunk-55FMGZ3L.js → chunk-HN74IGEO.js} +1 -1
  31. package/dist/{chunk-ZY6KU6P3.js → chunk-HOMUGKHR.js} +8 -5
  32. package/dist/{chunk-AOFWNWLT.cjs → chunk-IUL4VWNU.cjs} +22 -1
  33. package/dist/{chunk-5LNYGCIW.cjs → chunk-KIQ2HA2A.cjs} +5 -5
  34. package/dist/{chunk-MUHWHQVM.cjs → chunk-KQBLZMP6.cjs} +4 -3
  35. package/dist/chunk-LFEH7CEO.js +384 -0
  36. package/dist/chunk-LFPQ2OVH.js +386 -0
  37. package/dist/{chunk-FEBAQI5A.js → chunk-LKDAN4D7.js} +6363 -1350
  38. package/dist/chunk-LQYS2N47.js +3923 -0
  39. package/dist/{chunk-NZYN7C3P.cjs → chunk-MPXOKQJP.cjs} +53 -53
  40. package/dist/chunk-MZEGQSKQ.js +118 -0
  41. package/dist/chunk-N76KU6F5.js +123 -0
  42. package/dist/chunk-NLUOTJWB.js +673 -0
  43. package/dist/{chunk-CMVXX7ON.cjs → chunk-NOITAVHA.cjs} +114 -58
  44. package/dist/{chunk-Q27JY5RG.cjs → chunk-OIKREZVQ.cjs} +7 -4
  45. package/dist/{chunk-ZQQUD66M.cjs → chunk-POUTD5AM.cjs} +63 -295
  46. package/dist/{chunk-6D4W22P4.js → chunk-QIIAMBTM.js} +4 -1
  47. package/dist/{chunk-56QD3YW6.cjs → chunk-QWNUOR7F.cjs} +11 -4
  48. package/dist/{chunk-S3DYFEBE.js → chunk-R4VCO2CB.js} +10 -1
  49. package/dist/{chunk-4VZX5F4T.cjs → chunk-T6NWPIYZ.cjs} +5 -2
  50. package/dist/{chunk-EBLFCNPY.js → chunk-U47LQXPB.js} +5 -2
  51. package/dist/chunk-UPQIWJIE.cjs +3923 -0
  52. package/dist/{chunk-N7OOJI5V.js → chunk-V2UKUTJ3.js} +5 -0
  53. package/dist/{chunk-45FHEOKW.js → chunk-V53ZEFXC.js} +92 -36
  54. package/dist/{chunk-RJ5ZGNI3.js → chunk-VL5TUDTM.js} +8 -2
  55. package/dist/{chunk-TIT74RIL.cjs → chunk-VSYQ6XYN.cjs} +6837 -1824
  56. package/dist/{chunk-OC6DOOFX.cjs → chunk-VXRTQZF2.cjs} +5 -5
  57. package/dist/{chunk-RICPANBY.cjs → chunk-WX2E2G7H.cjs} +13 -4
  58. package/dist/{chunk-DE2SRBFZ.js → chunk-X335TJNS.js} +4 -3
  59. package/dist/{chunk-CDHS2QDC.js → chunk-Y4CRNHJO.js} +53 -53
  60. package/dist/{chunk-P7EM6BND.cjs → chunk-ZAPN7XA6.cjs} +10 -10
  61. package/dist/{chunk-N2EIM2XJ.js → chunk-ZLNHPUFA.js} +22 -1
  62. package/dist/completion/BuiltinToolExecutor.cjs +2 -2
  63. package/dist/completion/BuiltinToolExecutor.d.cts +3 -1
  64. package/dist/completion/BuiltinToolExecutor.d.ts +3 -1
  65. package/dist/completion/BuiltinToolExecutor.js +1 -1
  66. package/dist/completion/CompletionService.cjs +32 -28
  67. package/dist/completion/CompletionService.d.cts +7 -3
  68. package/dist/completion/CompletionService.d.ts +7 -3
  69. package/dist/completion/CompletionService.js +31 -27
  70. package/dist/completion.cjs +40 -36
  71. package/dist/completion.d.cts +7 -3
  72. package/dist/completion.d.ts +7 -3
  73. package/dist/completion.js +39 -35
  74. package/dist/egress-I46O_p5L.d.cts +126 -0
  75. package/dist/egress-I46O_p5L.d.ts +126 -0
  76. package/dist/frontends-Doz0RaWu.d.cts +97 -0
  77. package/dist/frontends-Doz0RaWu.d.ts +97 -0
  78. package/dist/image-generation.cjs +52 -0
  79. package/dist/image-generation.d.cts +96 -0
  80. package/dist/image-generation.d.ts +96 -0
  81. package/dist/image-generation.js +52 -0
  82. package/dist/index.cjs +142 -32
  83. package/dist/index.d.cts +16 -8
  84. package/dist/index.d.ts +16 -8
  85. package/dist/index.js +159 -49
  86. package/dist/openai-operation.cjs +18 -0
  87. package/dist/openai-operation.d.cts +22 -0
  88. package/dist/openai-operation.d.ts +22 -0
  89. package/dist/openai-operation.js +18 -0
  90. package/dist/outbound-api/auditCapture.cjs +3 -3
  91. package/dist/outbound-api/auditCapture.d.cts +13 -2
  92. package/dist/outbound-api/auditCapture.d.ts +13 -2
  93. package/dist/outbound-api/auditCapture.js +2 -2
  94. package/dist/outbound-api/auditRedact.cjs +2 -2
  95. package/dist/outbound-api/auditRedact.js +1 -1
  96. package/dist/outbound-api/routeResolver.cjs +2 -2
  97. package/dist/outbound-api/routeResolver.d.cts +11 -4
  98. package/dist/outbound-api/routeResolver.d.ts +11 -4
  99. package/dist/outbound-api/routeResolver.js +1 -1
  100. package/dist/outbound-api/subscriptionRegistryPort.d.cts +5 -1
  101. package/dist/outbound-api/subscriptionRegistryPort.d.ts +5 -1
  102. package/dist/outbound-api/types.d.cts +10 -3
  103. package/dist/outbound-api/types.d.ts +10 -3
  104. package/dist/outbound-api.cjs +65 -33
  105. package/dist/outbound-api.d.cts +205 -10
  106. package/dist/outbound-api.d.ts +205 -10
  107. package/dist/outbound-api.js +64 -32
  108. package/dist/pipeline/AccountAllowanceScheduling.d.cts +22 -15
  109. package/dist/pipeline/AccountAllowanceScheduling.d.ts +22 -15
  110. package/dist/pipeline/LlmConfigProviderAuth.cjs +3 -3
  111. package/dist/pipeline/LlmConfigProviderAuth.js +2 -2
  112. package/dist/pipeline/SubscriptionAccountHealth.cjs +2 -2
  113. package/dist/pipeline/SubscriptionAccountHealth.d.cts +7 -0
  114. package/dist/pipeline/SubscriptionAccountHealth.d.ts +7 -0
  115. package/dist/pipeline/SubscriptionAccountHealth.js +1 -1
  116. package/dist/pipeline/executeProviderCall.cjs +2 -2
  117. package/dist/pipeline/executeProviderCall.d.cts +11 -6
  118. package/dist/pipeline/executeProviderCall.d.ts +11 -6
  119. package/dist/pipeline/executeProviderCall.js +1 -1
  120. package/dist/pipeline/upstreamFetch.cjs +2 -2
  121. package/dist/pipeline/upstreamFetch.d.cts +5 -0
  122. package/dist/pipeline/upstreamFetch.d.ts +5 -0
  123. package/dist/pipeline/upstreamFetch.js +1 -1
  124. package/dist/ports.d.cts +10 -3
  125. package/dist/ports.d.ts +10 -3
  126. package/dist/provider-proxy/ProviderProxy.cjs +32 -28
  127. package/dist/provider-proxy/ProviderProxy.d.cts +6 -2
  128. package/dist/provider-proxy/ProviderProxy.d.ts +6 -2
  129. package/dist/provider-proxy/ProviderProxy.js +31 -27
  130. package/dist/provider-proxy/identity/codexCliHeaders.cjs +4 -2
  131. package/dist/provider-proxy/identity/codexCliHeaders.d.cts +26 -6
  132. package/dist/provider-proxy/identity/codexCliHeaders.d.ts +26 -6
  133. package/dist/provider-proxy/identity/codexCliHeaders.js +5 -3
  134. package/dist/provider-proxy/ingress/providerProxyShared.cjs +36 -28
  135. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +41 -9
  136. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +41 -9
  137. package/dist/provider-proxy/ingress/providerProxyShared.js +35 -27
  138. package/dist/provider-proxy/types.d.cts +17 -483
  139. package/dist/provider-proxy/types.d.ts +17 -483
  140. package/dist/provider-proxy.cjs +46 -28
  141. package/dist/provider-proxy.d.cts +34 -8
  142. package/dist/provider-proxy.d.ts +34 -8
  143. package/dist/provider-proxy.js +45 -27
  144. package/dist/proxy-UZTtjPZx.d.cts +18 -0
  145. package/dist/proxy-UZTtjPZx.d.ts +18 -0
  146. package/dist/{routeResolver-CVFE8KKe.d.cts → routeResolver-Da0yvkL1.d.cts} +4 -2
  147. package/dist/{routeResolver-C0mkkZaM.d.ts → routeResolver-STwMz_G4.d.ts} +4 -2
  148. package/dist/runtime-6QXNU526.cjs +8 -0
  149. package/dist/runtime-M5WXLD2R.js +8 -0
  150. package/dist/runtime-t8AZacFF.d.cts +233 -0
  151. package/dist/runtime-t8AZacFF.d.ts +233 -0
  152. package/dist/search/api.cjs +761 -0
  153. package/dist/search/api.d.cts +370 -0
  154. package/dist/search/api.d.ts +370 -0
  155. package/dist/search/api.js +761 -0
  156. package/dist/search/http.cjs +37 -0
  157. package/dist/search/http.d.cts +269 -0
  158. package/dist/search/http.d.ts +269 -0
  159. package/dist/search/http.js +37 -0
  160. package/dist/search.cjs +57 -0
  161. package/dist/search.d.cts +113 -0
  162. package/dist/search.d.ts +113 -0
  163. package/dist/search.js +57 -0
  164. package/dist/transformer/TransformerChainExecutor.cjs +2 -2
  165. package/dist/transformer/TransformerChainExecutor.d.cts +2 -2
  166. package/dist/transformer/TransformerChainExecutor.d.ts +2 -2
  167. package/dist/transformer/TransformerChainExecutor.js +1 -1
  168. package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.cjs +16 -0
  169. package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.cts +53 -0
  170. package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.ts +53 -0
  171. package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.js +16 -0
  172. package/dist/transformer/transformers/AnthropicTransformer.cjs +4 -3
  173. package/dist/transformer/transformers/AnthropicTransformer.js +3 -2
  174. package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +4 -4
  175. package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +3 -3
  176. package/dist/transformer/transformers/GeminiTransformer.cjs +4 -4
  177. package/dist/transformer/transformers/GeminiTransformer.js +3 -3
  178. package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -3
  179. package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -2
  180. package/dist/transformer/transformers/OpenAITransformer.cjs +3 -3
  181. package/dist/transformer/transformers/OpenAITransformer.js +2 -2
  182. package/dist/transformer/transformers.cjs +11 -10
  183. package/dist/transformer/transformers.js +12 -11
  184. package/dist/transformer/types.d.cts +39 -4
  185. package/dist/transformer/types.d.ts +39 -4
  186. package/dist/transformer.cjs +14 -13
  187. package/dist/transformer.js +13 -12
  188. package/dist/types-BSIJdsyl.d.cts +1130 -0
  189. package/dist/types-Be-yt_6T.d.cts +196 -0
  190. package/dist/types-By9Tg6-I.d.ts +1130 -0
  191. package/dist/types-CbCZqLGg.d.cts +127 -0
  192. package/dist/types-CbCZqLGg.d.ts +127 -0
  193. package/dist/{types-C2MwkLah.d.cts → types-D-oHYusb.d.cts} +250 -21
  194. package/dist/types-Dm4_36V4.d.ts +196 -0
  195. package/dist/{types-BB8pxk_3.d.ts → types-Dvlpjn0d.d.ts} +250 -21
  196. package/dist/usage.cjs +2 -2
  197. package/dist/usage.d.cts +6 -1
  198. package/dist/usage.d.ts +6 -1
  199. package/dist/usage.js +1 -1
  200. package/package.json +71 -64
  201. package/dist/chunk-FCR77GYM.cjs +0 -33
  202. package/dist/chunk-K5NM7VAH.js +0 -33
  203. /package/dist/{chunk-XXFYLL7R.js → chunk-ECZ3ZE2C.js} +0 -0
  204. /package/dist/{chunk-3SCOLIPT.cjs → chunk-MXI2PWIC.cjs} +0 -0
@@ -9,82 +9,86 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkTIT74RILcjs = require('./chunk-TIT74RIL.cjs');
12
+ var _chunkVSYQ6XYNcjs = require('./chunk-VSYQ6XYN.cjs');
13
+ require('./chunk-E4QHVXV5.cjs');
13
14
  require('./chunk-HQP3K7PU.cjs');
14
15
  require('./chunk-QVOB2DNX.cjs');
15
- require('./chunk-P7EM6BND.cjs');
16
- require('./chunk-ZQQUD66M.cjs');
17
- require('./chunk-5LNYGCIW.cjs');
18
- require('./chunk-CMVXX7ON.cjs');
16
+ require('./chunk-7ZHBN75N.cjs');
17
+ require('./chunk-GBHYAGX3.cjs');
18
+ require('./chunk-3OPYJG76.cjs');
19
+ require('./chunk-ZAPN7XA6.cjs');
20
+ require('./chunk-KIQ2HA2A.cjs');
21
+ require('./chunk-NOITAVHA.cjs');
22
+ require('./chunk-QWNUOR7F.cjs');
23
+ require('./chunk-POUTD5AM.cjs');
24
+ require('./chunk-6DDYNS2B.cjs');
19
25
  require('./chunk-5RSZYQJH.cjs');
20
- require('./chunk-56QD3YW6.cjs');
21
- require('./chunk-QUSEZNYS.cjs');
26
+ require('./chunk-32SRZFFP.cjs');
22
27
  require('./chunk-2E42SAW3.cjs');
23
28
  require('./chunk-5UK3KLE2.cjs');
24
- require('./chunk-IIRPUVPH.cjs');
25
- require('./chunk-GBHYAGX3.cjs');
26
- require('./chunk-3OPYJG76.cjs');
27
- require('./chunk-3SCOLIPT.cjs');
29
+ require('./chunk-MXI2PWIC.cjs');
28
30
  require('./chunk-RPII3E6Z.cjs');
29
31
  require('./chunk-6RPZADX3.cjs');
30
32
  require('./chunk-J3QQ6JS5.cjs');
31
33
  require('./chunk-UIBD2YY5.cjs');
32
34
  require('./chunk-R3HK6R4B.cjs');
35
+ require('./chunk-KQBLZMP6.cjs');
36
+
37
+
38
+ var _chunkOIKREZVQcjs = require('./chunk-OIKREZVQ.cjs');
33
39
  require('./chunk-QXD4MV2X.cjs');
34
40
  require('./chunk-NYUNU75A.cjs');
35
41
  require('./chunk-OTZC4TNH.cjs');
36
- require('./chunk-YWL7YZWS.cjs');
42
+ require('./chunk-7LRTPNFL.cjs');
37
43
  require('./chunk-YNJNTCSQ.cjs');
38
44
  require('./chunk-SVNDB62D.cjs');
39
45
  require('./chunk-6QQG7YG3.cjs');
40
46
  require('./chunk-25GXJCEZ.cjs');
41
- require('./chunk-MUHWHQVM.cjs');
42
-
43
-
44
- var _chunkQ27JY5RGcjs = require('./chunk-Q27JY5RG.cjs');
47
+ require('./chunk-FX325I5Q.cjs');
48
+ require('./chunk-AEOZIDEB.cjs');
49
+ require('./chunk-HCOQQAZE.cjs');
45
50
  require('./chunk-APYG5QD7.cjs');
46
51
  require('./chunk-L74VDN4A.cjs');
52
+ require('./chunk-XSVNC2UD.cjs');
47
53
  require('./chunk-4YINUUKQ.cjs');
48
- require('./chunk-4VZX5F4T.cjs');
54
+ require('./chunk-T6NWPIYZ.cjs');
49
55
  require('./chunk-QBZJ7P2T.cjs');
50
56
  require('./chunk-4IH4EL7M.cjs');
51
57
 
52
58
 
53
59
 
54
60
 
61
+ var _chunkJMJBSACDcjs = require('./chunk-JMJBSACD.cjs');
55
62
 
56
63
 
64
+ var _chunkGMMT7RVNcjs = require('./chunk-GMMT7RVN.cjs');
65
+ require('./chunk-UNEFIWXI.cjs');
57
66
 
58
67
 
59
68
 
60
69
 
61
- var _chunkA2YMUCBTcjs = require('./chunk-A2YMUCBT.cjs');
62
- require('./chunk-UWDW6PN3.cjs');
63
- require('./chunk-FCR77GYM.cjs');
64
- require('./chunk-AEOZIDEB.cjs');
65
- require('./chunk-XSVNC2UD.cjs');
66
- require('./chunk-GDIXXKF2.cjs');
67
- require('./chunk-OC6DOOFX.cjs');
68
- require('./chunk-RICPANBY.cjs');
69
- require('./chunk-77USGNRW.cjs');
70
- require('./chunk-AOFWNWLT.cjs');
71
- require('./chunk-RJUONLUQ.cjs');
72
- require('./chunk-235MXAGX.cjs');
73
- require('./chunk-HVBBDBS3.cjs');
74
- require('./chunk-NKVZ6Z3Y.cjs');
75
70
 
76
71
 
77
72
 
78
- var _chunkNZYN7C3Pcjs = require('./chunk-NZYN7C3P.cjs');
79
73
 
80
74
 
81
75
 
76
+ var _chunkA2YMUCBTcjs = require('./chunk-A2YMUCBT.cjs');
77
+ require('./chunk-GDIXXKF2.cjs');
78
+ require('./chunk-VXRTQZF2.cjs');
79
+ require('./chunk-WX2E2G7H.cjs');
80
+ require('./chunk-77USGNRW.cjs');
81
+ require('./chunk-IUL4VWNU.cjs');
82
+ require('./chunk-4Z3ZLLC2.cjs');
83
+ require('./chunk-235MXAGX.cjs');
84
+ require('./chunk-HVBBDBS3.cjs');
85
+ require('./chunk-NKVZ6Z3Y.cjs');
86
+ require('./chunk-UPQIWJIE.cjs');
87
+ require('./chunk-G4CZIUIB.cjs');
82
88
 
83
- var _chunkJMJBSACDcjs = require('./chunk-JMJBSACD.cjs');
84
89
 
85
90
 
86
- var _chunkGMMT7RVNcjs = require('./chunk-GMMT7RVN.cjs');
87
- require('./chunk-UNEFIWXI.cjs');
91
+ var _chunkMPXOKQJPcjs = require('./chunk-MPXOKQJP.cjs');
88
92
 
89
93
 
90
94
 
@@ -112,4 +116,4 @@ require('./chunk-UNEFIWXI.cjs');
112
116
 
113
117
 
114
118
 
115
- exports.BuiltinToolExecutor = _chunkNZYN7C3Pcjs.BuiltinToolExecutor; exports.CompletionService = _chunkTIT74RILcjs.CompletionService; exports.NATIVE_SEARCH_TOOL_NAMES = _chunkGMMT7RVNcjs.NATIVE_SEARCH_TOOL_NAMES; exports.addOpenRouterProviderToRequest = _chunkTIT74RILcjs.addOpenRouterProviderToRequest; exports.applyAugmentation = _chunkJMJBSACDcjs.applyAugmentation; exports.attachStreamEventBuffer = _chunkTIT74RILcjs.attach; exports.buildAnthropicApiUrl = _chunkA2YMUCBTcjs.buildAnthropicApiUrl; exports.buildAzureOpenAIApiUrl = _chunkA2YMUCBTcjs.buildAzureOpenAIApiUrl; exports.buildGeminiApiUrl = _chunkA2YMUCBTcjs.buildGeminiApiUrl; exports.buildNativeSearchAugmentation = _chunkJMJBSACDcjs.buildNativeSearchAugmentation; exports.buildOpenAIApiUrl = _chunkA2YMUCBTcjs.buildOpenAIApiUrl; exports.buildOpenAIResponseApiUrl = _chunkA2YMUCBTcjs.buildOpenAIResponseApiUrl; exports.buildProviderApiUrl = _chunkA2YMUCBTcjs.buildProviderApiUrl; exports.convertMessageToAnthropic = _chunkTIT74RILcjs.convertMessageToAnthropic; exports.convertMessageToGemini = _chunkTIT74RILcjs.convertMessageToGemini; exports.convertMessageToOpenAI = _chunkTIT74RILcjs.convertMessageToOpenAI; exports.detectNativeSearch = _chunkJMJBSACDcjs.detectNativeSearch; exports.emitStreamEvent = _chunkTIT74RILcjs.emit; exports.getBuiltinSearchTools = _chunkNZYN7C3Pcjs.getBuiltinSearchTools; exports.getOpenRouterProviderConfig = _chunkTIT74RILcjs.getOpenRouterProviderConfig; exports.getProviderHeaders = _chunkQ27JY5RGcjs.getProviderHeaders; exports.normalizeAzureEndpoint = _chunkA2YMUCBTcjs.normalizeAzureEndpoint; exports.registerStreamEventBuffer = _chunkTIT74RILcjs.register; exports.releaseStreamEventBuffer = _chunkTIT74RILcjs.release; exports.resolveApiFormat = _chunkA2YMUCBTcjs.resolveApiFormat; exports.resolveProviderEndpoint = _chunkA2YMUCBTcjs.resolveProviderEndpoint;
119
+ exports.BuiltinToolExecutor = _chunkMPXOKQJPcjs.BuiltinToolExecutor; exports.CompletionService = _chunkVSYQ6XYNcjs.CompletionService; exports.NATIVE_SEARCH_TOOL_NAMES = _chunkGMMT7RVNcjs.NATIVE_SEARCH_TOOL_NAMES; exports.addOpenRouterProviderToRequest = _chunkVSYQ6XYNcjs.addOpenRouterProviderToRequest; exports.applyAugmentation = _chunkJMJBSACDcjs.applyAugmentation; exports.attachStreamEventBuffer = _chunkVSYQ6XYNcjs.attach; exports.buildAnthropicApiUrl = _chunkA2YMUCBTcjs.buildAnthropicApiUrl; exports.buildAzureOpenAIApiUrl = _chunkA2YMUCBTcjs.buildAzureOpenAIApiUrl; exports.buildGeminiApiUrl = _chunkA2YMUCBTcjs.buildGeminiApiUrl; exports.buildNativeSearchAugmentation = _chunkJMJBSACDcjs.buildNativeSearchAugmentation; exports.buildOpenAIApiUrl = _chunkA2YMUCBTcjs.buildOpenAIApiUrl; exports.buildOpenAIResponseApiUrl = _chunkA2YMUCBTcjs.buildOpenAIResponseApiUrl; exports.buildProviderApiUrl = _chunkA2YMUCBTcjs.buildProviderApiUrl; exports.convertMessageToAnthropic = _chunkVSYQ6XYNcjs.convertMessageToAnthropic; exports.convertMessageToGemini = _chunkVSYQ6XYNcjs.convertMessageToGemini; exports.convertMessageToOpenAI = _chunkVSYQ6XYNcjs.convertMessageToOpenAI; exports.detectNativeSearch = _chunkJMJBSACDcjs.detectNativeSearch; exports.emitStreamEvent = _chunkVSYQ6XYNcjs.emit; exports.getBuiltinSearchTools = _chunkMPXOKQJPcjs.getBuiltinSearchTools; exports.getOpenRouterProviderConfig = _chunkVSYQ6XYNcjs.getOpenRouterProviderConfig; exports.getProviderHeaders = _chunkOIKREZVQcjs.getProviderHeaders; exports.normalizeAzureEndpoint = _chunkA2YMUCBTcjs.normalizeAzureEndpoint; exports.registerStreamEventBuffer = _chunkVSYQ6XYNcjs.register; exports.releaseStreamEventBuffer = _chunkVSYQ6XYNcjs.release; exports.resolveApiFormat = _chunkA2YMUCBTcjs.resolveApiFormat; exports.resolveProviderEndpoint = _chunkA2YMUCBTcjs.resolveProviderEndpoint;
@@ -1,9 +1,9 @@
1
1
  export { A as ApiFormat, C as CompletionOptions, a as CompletionResult, N as NATIVE_SEARCH_TOOL_NAMES, b as NativeSearchAugmentation, c as NativeSearchDetectionResult, d as NativeSearchProvider, e as NativeSearchUserConfig, S as StreamCallbacks } from './types-BScIHmPr.cjs';
2
- export { C as CompletionService, V as VisionFallbackProvider } from './CompletionService-kNA17cfI.cjs';
2
+ export { C as CompletionService, V as VisionFallbackProvider } from './CompletionService-BniP7j88.cjs';
3
3
  export { buildAnthropicApiUrl, buildAzureOpenAIApiUrl, buildGeminiApiUrl, buildOpenAIApiUrl, buildOpenAIResponseApiUrl, buildProviderApiUrl, normalizeAzureEndpoint, resolveApiFormat, resolveProviderEndpoint } from './completion/url-builder.cjs';
4
4
  import { LLMProvider, OpenRouterProviderRouting } from '@omnicross/contracts/llm-config';
5
5
  import { SimpleChatMessage, AnthropicMessage, OpenAIMessage } from '@omnicross/contracts/completion-types';
6
- export { B as BuiltinToolExecutor, g as getBuiltinSearchTools } from './BuiltinToolExecutor-CS2WpXhM.cjs';
6
+ export { B as BuiltinToolExecutor, g as getBuiltinSearchTools } from './BuiltinToolExecutor-BHgH-EaZ.cjs';
7
7
  export { applyAugmentation, buildNativeSearchAugmentation, detectNativeSearch } from './completion/NativeSearchInjector.cjs';
8
8
  import '@omnicross/contracts/message-blocks';
9
9
  import './usage-event-sink-BX7FE1NL.cjs';
@@ -11,7 +11,7 @@ import './logger-4GvQNzhE.cjs';
11
11
  import './ports/provider-config-source.cjs';
12
12
  import './transformer/types.cjs';
13
13
  import './transformer/TransformerService.cjs';
14
- import './provider-proxy/types.cjs';
14
+ import './types-BSIJdsyl.cjs';
15
15
  import 'node:http';
16
16
  import '@omnicross/contracts/usage-stats-types';
17
17
  import '@omnicross/contracts/subscription-types';
@@ -23,6 +23,10 @@ import './pipeline/SubscriptionAuthSource.cjs';
23
23
  import './pipeline/SubscriptionAuthStrategy.cjs';
24
24
  import './ports/web-search-backend.cjs';
25
25
  import '@omnicross/contracts/websearch-types';
26
+ import './frontends-Doz0RaWu.cjs';
27
+ import '@omnicross/contracts/search-types';
28
+ import './runtime-t8AZacFF.cjs';
29
+ import '@omnicross/contracts/image-generation-types';
26
30
  import '@omnicross/contracts/mcp-types';
27
31
  import '@omnicross/contracts/endpoint-resolver';
28
32
 
@@ -1,9 +1,9 @@
1
1
  export { A as ApiFormat, C as CompletionOptions, a as CompletionResult, N as NATIVE_SEARCH_TOOL_NAMES, b as NativeSearchAugmentation, c as NativeSearchDetectionResult, d as NativeSearchProvider, e as NativeSearchUserConfig, S as StreamCallbacks } from './types-BScIHmPr.js';
2
- export { C as CompletionService, V as VisionFallbackProvider } from './CompletionService-C3BX0Ovy.js';
2
+ export { C as CompletionService, V as VisionFallbackProvider } from './CompletionService-BqrKPwfA.js';
3
3
  export { buildAnthropicApiUrl, buildAzureOpenAIApiUrl, buildGeminiApiUrl, buildOpenAIApiUrl, buildOpenAIResponseApiUrl, buildProviderApiUrl, normalizeAzureEndpoint, resolveApiFormat, resolveProviderEndpoint } from './completion/url-builder.js';
4
4
  import { LLMProvider, OpenRouterProviderRouting } from '@omnicross/contracts/llm-config';
5
5
  import { SimpleChatMessage, AnthropicMessage, OpenAIMessage } from '@omnicross/contracts/completion-types';
6
- export { B as BuiltinToolExecutor, g as getBuiltinSearchTools } from './BuiltinToolExecutor-BluWyeob.js';
6
+ export { B as BuiltinToolExecutor, g as getBuiltinSearchTools } from './BuiltinToolExecutor-Bi1LmiTP.js';
7
7
  export { applyAugmentation, buildNativeSearchAugmentation, detectNativeSearch } from './completion/NativeSearchInjector.js';
8
8
  import '@omnicross/contracts/message-blocks';
9
9
  import './usage-event-sink-BX7FE1NL.js';
@@ -11,7 +11,7 @@ import './logger-4GvQNzhE.js';
11
11
  import './ports/provider-config-source.js';
12
12
  import './transformer/types.js';
13
13
  import './transformer/TransformerService.js';
14
- import './provider-proxy/types.js';
14
+ import './types-By9Tg6-I.js';
15
15
  import 'node:http';
16
16
  import '@omnicross/contracts/usage-stats-types';
17
17
  import '@omnicross/contracts/subscription-types';
@@ -23,6 +23,10 @@ import './pipeline/SubscriptionAuthSource.js';
23
23
  import './pipeline/SubscriptionAuthStrategy.js';
24
24
  import './ports/web-search-backend.js';
25
25
  import '@omnicross/contracts/websearch-types';
26
+ import './frontends-Doz0RaWu.js';
27
+ import '@omnicross/contracts/search-types';
28
+ import './runtime-t8AZacFF.js';
29
+ import '@omnicross/contracts/image-generation-types';
26
30
  import '@omnicross/contracts/mcp-types';
27
31
  import '@omnicross/contracts/endpoint-resolver';
28
32
 
@@ -9,45 +9,60 @@ import {
9
9
  getOpenRouterProviderConfig,
10
10
  register,
11
11
  release
12
- } from "./chunk-FEBAQI5A.js";
12
+ } from "./chunk-LKDAN4D7.js";
13
+ import "./chunk-MZEGQSKQ.js";
13
14
  import "./chunk-VVEHS2LI.js";
14
15
  import "./chunk-WTQMX2Q6.js";
15
- import "./chunk-NGYOO5TO.js";
16
- import "./chunk-HKB656B4.js";
17
- import "./chunk-55FMGZ3L.js";
18
- import "./chunk-45FHEOKW.js";
16
+ import "./chunk-EYGBM2VC.js";
17
+ import "./chunk-MZNPGW5Q.js";
18
+ import "./chunk-DK4A7DLE.js";
19
+ import "./chunk-2C3TTBS7.js";
20
+ import "./chunk-HN74IGEO.js";
21
+ import "./chunk-V53ZEFXC.js";
22
+ import "./chunk-7PIUVCKK.js";
23
+ import "./chunk-EUZRH544.js";
24
+ import "./chunk-LFEH7CEO.js";
19
25
  import "./chunk-FU7EAR73.js";
20
- import "./chunk-CCVRRJOX.js";
21
- import "./chunk-6D4W22P4.js";
26
+ import "./chunk-QIIAMBTM.js";
22
27
  import "./chunk-FXR6N3SR.js";
23
28
  import "./chunk-AQDON6MB.js";
24
- import "./chunk-WNKWAEUR.js";
25
- import "./chunk-MZNPGW5Q.js";
26
- import "./chunk-DK4A7DLE.js";
27
- import "./chunk-XXFYLL7R.js";
29
+ import "./chunk-ECZ3ZE2C.js";
28
30
  import "./chunk-XTEI64OU.js";
29
31
  import "./chunk-XX6NQJMA.js";
30
32
  import "./chunk-GFIZ6LQI.js";
31
33
  import "./chunk-OE6TDIWW.js";
32
34
  import "./chunk-DRWHTIIZ.js";
35
+ import "./chunk-X335TJNS.js";
36
+ import {
37
+ getProviderHeaders
38
+ } from "./chunk-HOMUGKHR.js";
33
39
  import "./chunk-JWC6APFQ.js";
34
40
  import "./chunk-5ERIZW3D.js";
35
41
  import "./chunk-PO3XB56Z.js";
36
- import "./chunk-N7OOJI5V.js";
42
+ import "./chunk-V2UKUTJ3.js";
37
43
  import "./chunk-23S5OPIO.js";
38
44
  import "./chunk-AVYJ4YBN.js";
39
45
  import "./chunk-OPRS4IQZ.js";
40
46
  import "./chunk-2JYRIADS.js";
41
- import "./chunk-DE2SRBFZ.js";
42
- import {
43
- getProviderHeaders
44
- } from "./chunk-ZY6KU6P3.js";
47
+ import "./chunk-6OKXH2TW.js";
48
+ import "./chunk-WNY4WMRF.js";
49
+ import "./chunk-N76KU6F5.js";
45
50
  import "./chunk-WLYIIEAF.js";
46
51
  import "./chunk-TKJMZBAH.js";
52
+ import "./chunk-OZFM4X3S.js";
47
53
  import "./chunk-3QFXFCHG.js";
48
- import "./chunk-EBLFCNPY.js";
54
+ import "./chunk-U47LQXPB.js";
49
55
  import "./chunk-AQ5TNQB7.js";
50
56
  import "./chunk-XEKD23J5.js";
57
+ import {
58
+ applyAugmentation,
59
+ buildNativeSearchAugmentation,
60
+ detectNativeSearch
61
+ } from "./chunk-Y7FO65VT.js";
62
+ import {
63
+ NATIVE_SEARCH_TOOL_NAMES
64
+ } from "./chunk-FMOBD2OQ.js";
65
+ import "./chunk-HUZZZ3JL.js";
51
66
  import {
52
67
  buildAnthropicApiUrl,
53
68
  buildAzureOpenAIApiUrl,
@@ -59,32 +74,21 @@ import {
59
74
  resolveApiFormat,
60
75
  resolveProviderEndpoint
61
76
  } from "./chunk-H5JUT3KV.js";
62
- import "./chunk-GXEZ2R3E.js";
63
- import "./chunk-K5NM7VAH.js";
64
- import "./chunk-WNY4WMRF.js";
65
- import "./chunk-OZFM4X3S.js";
66
77
  import "./chunk-5NJLQ6T6.js";
67
- import "./chunk-2UTGX6FM.js";
68
- import "./chunk-S3DYFEBE.js";
78
+ import "./chunk-4VVCXVB7.js";
79
+ import "./chunk-R4VCO2CB.js";
69
80
  import "./chunk-WYVGULTQ.js";
70
- import "./chunk-N2EIM2XJ.js";
71
- import "./chunk-RJ5ZGNI3.js";
81
+ import "./chunk-ZLNHPUFA.js";
82
+ import "./chunk-VL5TUDTM.js";
72
83
  import "./chunk-3WD4HTR2.js";
73
84
  import "./chunk-MKF46GNZ.js";
74
85
  import "./chunk-GL6XM527.js";
86
+ import "./chunk-LQYS2N47.js";
87
+ import "./chunk-4JOU54M5.js";
75
88
  import {
76
89
  BuiltinToolExecutor,
77
90
  getBuiltinSearchTools
78
- } from "./chunk-CDHS2QDC.js";
79
- import {
80
- applyAugmentation,
81
- buildNativeSearchAugmentation,
82
- detectNativeSearch
83
- } from "./chunk-Y7FO65VT.js";
84
- import {
85
- NATIVE_SEARCH_TOOL_NAMES
86
- } from "./chunk-FMOBD2OQ.js";
87
- import "./chunk-HUZZZ3JL.js";
91
+ } from "./chunk-Y4CRNHJO.js";
88
92
  export {
89
93
  BuiltinToolExecutor,
90
94
  CompletionService,
@@ -0,0 +1,126 @@
1
+ import { lookup } from 'node:dns';
2
+ import { SearchProviderId, SearchProviderError } from '@omnicross/contracts/search-types';
3
+ import { Dispatcher } from 'undici';
4
+
5
+ /**
6
+ * The SSRF egress policy every search network path runs through
7
+ * (plan hard-constraint 7).
8
+ *
9
+ * 阶段4 introduces the first attacker-influenceable network surface in the
10
+ * search tree: a custom `apiHost`. Until now every search request went to one
11
+ * of two fixed engines, so a URL built from configuration could not be aimed at
12
+ * an internal address. It can now, which is why this module exists and why it
13
+ * guards BOTH the API transport and the HTTP slice's redirect walk rather than
14
+ * living inside one adapter.
15
+ *
16
+ * Two layers, because one is not enough:
17
+ *
18
+ * 1. {@link validateEgressUrl} — a URL-level check applied to the initial URL
19
+ * and to EVERY redirect hop. It catches literal addresses and the named
20
+ * loopback/metadata hosts before a request is built.
21
+ * 2. {@link createEgressGuardedDispatcher} — a connection-time check of every
22
+ * address DNS resolves to. Layer 1 alone is a TOCTOU: `evil.example` passes
23
+ * the URL check as a public name and then resolves to `127.0.0.1`. Validating
24
+ * at the moment of use closes that rebinding window.
25
+ *
26
+ * The division of labour between them is worth stating, because it is the
27
+ * easiest thing to misread here: layer 1 can only judge what a URL SAYS, so it
28
+ * denies literal addresses and the two host names that are denied by name
29
+ * (`localhost`, `metadata.google.internal`). An ordinary internal name like
30
+ * `searx.internal.corp` carries no address and passes layer 1 exactly as a
31
+ * public name would — layer 2 is what asks where it actually points. Neither
32
+ * layer is redundant: layer 1 stops `http://169.254.169.254/` without a
33
+ * resolver, and layer 2 stops every name that lies.
34
+ *
35
+ * LIMITATION, stated here because it is a property of the design and not an
36
+ * oversight: layer 2 only applies to DIRECT connections. When a proxy
37
+ * dispatcher is in use the proxy resolves DNS, so the guarded lookup never
38
+ * runs; proxied paths keep layer 1 on every hop and nothing more. The
39
+ * precedence is asserted by a test rather than left to be discovered.
40
+ *
41
+ * Denial messages carry the HOSTNAME only. A search URL embeds the user's
42
+ * query and may carry userinfo credentials, and these errors are printed,
43
+ * logged, and returned to callers.
44
+ *
45
+ * @module search/egress
46
+ */
47
+
48
+ /**
49
+ * The admin-level egress policy.
50
+ *
51
+ * Construction-level, never per-request: a per-request allowlist would let an
52
+ * attacker who can influence a search request also influence where it may go,
53
+ * which is the whole thing this module prevents.
54
+ */
55
+ interface SearchEgressPolicy {
56
+ /**
57
+ * Hostnames permitted to resolve into an otherwise-denied address class.
58
+ *
59
+ * The escape hatch for an internal SearXNG deployment
60
+ * (`searx.internal.corp`). Matching is EXACT and case-insensitive — no
61
+ * wildcards, no suffix matching — because a suffix rule (`.corp`) is one
62
+ * attacker-registered subdomain away from admitting anything.
63
+ */
64
+ allowedPrivateHosts?: string[];
65
+ }
66
+ /** Permit every public host; permit nothing private. The production default. */
67
+ declare const DEFAULT_SEARCH_EGRESS_POLICY: Readonly<SearchEgressPolicy>;
68
+ /** Why a host was denied. Stamped into `details.egressClass` for diagnostics. */
69
+ type EgressDenialReason = 'scheme' | 'malformed' | 'loopback' | 'unspecified' | 'link-local' | 'private' | 'unique-local' | 'metadata';
70
+ /**
71
+ * Validate one request target against the policy.
72
+ *
73
+ * @param url - the target. A relative or unparseable value is a denial, not a
74
+ * crash: a redirect `location` is attacker-controlled input.
75
+ * @returns the parsed URL, so callers can reuse it instead of re-parsing.
76
+ * @throws SearchProviderError code `policy_denied`, naming the hostname only.
77
+ */
78
+ declare function validateEgressUrl(url: string | URL, policy?: SearchEgressPolicy, providerId?: SearchProviderId): URL;
79
+ /**
80
+ * Classify a resolved ADDRESS for a hostname that already passed
81
+ * {@link validateEgressUrl}.
82
+ *
83
+ * Separate from the URL check because this is the rebinding defense: the
84
+ * hostname was public, the address it resolved to may not be. Allowlisting is
85
+ * by hostname, so an allowlisted name's private address is admitted here too —
86
+ * that is exactly what the SearXNG escape hatch means.
87
+ */
88
+ declare function assertEgressAddressAllowed(address: string, hostname: string, policy?: SearchEgressPolicy, providerId?: SearchProviderId): void;
89
+ /**
90
+ * The `policy_denied` error buried in a thrown value's `cause` chain, if any.
91
+ *
92
+ * undici reports a connect-time failure as a `TypeError: fetch failed` whose
93
+ * `cause` holds the real error, so a denial raised inside the guarded lookup
94
+ * reaches the caller wrapped. Without this the transport would classify a
95
+ * blocked rebinding attempt as `upstream_unavailable`.
96
+ *
97
+ * The depth cap assumes undici's wrapping stays SHALLOW — today it is two
98
+ * levels and this allows six. If a future undici (or an intermediate
99
+ * dispatcher) nests deeper, a blocked rebinding attempt would quietly
100
+ * reclassify as a transport failure: the request is still refused, but the
101
+ * security signal is lost. That is the failure mode to check if denials ever
102
+ * start reading as `upstream_unavailable`.
103
+ */
104
+ declare function findEgressDenial(error: unknown): SearchProviderError | undefined;
105
+ /** Node's `dns.lookup` shape — the seam a test replaces. */
106
+ type EgressDnsLookup = typeof lookup;
107
+ /**
108
+ * Wrap a resolver so every address it returns is validated before use.
109
+ *
110
+ * Always resolves with `all: true` and re-shapes the answer to whatever the
111
+ * caller asked for. Node's `net.connect` passes `all: true` under
112
+ * `autoSelectFamily` and `all: false` otherwise; validating only the address a
113
+ * single-answer lookup happened to pick would leave the others unchecked on the
114
+ * hosts where it matters most.
115
+ */
116
+ declare function createEgressGuardedLookup(policy?: SearchEgressPolicy, lookupImpl?: EgressDnsLookup): EgressDnsLookup;
117
+ /**
118
+ * An undici dispatcher that validates every resolved address before connecting.
119
+ *
120
+ * Cached per policy signature: a fresh `Agent` per request would leak
121
+ * connection pools. As in `search/http/proxy.ts`, a superseded dispatcher is
122
+ * never closed — a concurrent request may still be reading through it.
123
+ */
124
+ declare function createEgressGuardedDispatcher(policy?: SearchEgressPolicy, lookupImpl?: EgressDnsLookup): Dispatcher;
125
+
126
+ export { DEFAULT_SEARCH_EGRESS_POLICY as D, type EgressDenialReason as E, type SearchEgressPolicy as S, type EgressDnsLookup as a, assertEgressAddressAllowed as b, createEgressGuardedDispatcher as c, createEgressGuardedLookup as d, findEgressDenial as f, validateEgressUrl as v };
@@ -0,0 +1,126 @@
1
+ import { lookup } from 'node:dns';
2
+ import { SearchProviderId, SearchProviderError } from '@omnicross/contracts/search-types';
3
+ import { Dispatcher } from 'undici';
4
+
5
+ /**
6
+ * The SSRF egress policy every search network path runs through
7
+ * (plan hard-constraint 7).
8
+ *
9
+ * 阶段4 introduces the first attacker-influenceable network surface in the
10
+ * search tree: a custom `apiHost`. Until now every search request went to one
11
+ * of two fixed engines, so a URL built from configuration could not be aimed at
12
+ * an internal address. It can now, which is why this module exists and why it
13
+ * guards BOTH the API transport and the HTTP slice's redirect walk rather than
14
+ * living inside one adapter.
15
+ *
16
+ * Two layers, because one is not enough:
17
+ *
18
+ * 1. {@link validateEgressUrl} — a URL-level check applied to the initial URL
19
+ * and to EVERY redirect hop. It catches literal addresses and the named
20
+ * loopback/metadata hosts before a request is built.
21
+ * 2. {@link createEgressGuardedDispatcher} — a connection-time check of every
22
+ * address DNS resolves to. Layer 1 alone is a TOCTOU: `evil.example` passes
23
+ * the URL check as a public name and then resolves to `127.0.0.1`. Validating
24
+ * at the moment of use closes that rebinding window.
25
+ *
26
+ * The division of labour between them is worth stating, because it is the
27
+ * easiest thing to misread here: layer 1 can only judge what a URL SAYS, so it
28
+ * denies literal addresses and the two host names that are denied by name
29
+ * (`localhost`, `metadata.google.internal`). An ordinary internal name like
30
+ * `searx.internal.corp` carries no address and passes layer 1 exactly as a
31
+ * public name would — layer 2 is what asks where it actually points. Neither
32
+ * layer is redundant: layer 1 stops `http://169.254.169.254/` without a
33
+ * resolver, and layer 2 stops every name that lies.
34
+ *
35
+ * LIMITATION, stated here because it is a property of the design and not an
36
+ * oversight: layer 2 only applies to DIRECT connections. When a proxy
37
+ * dispatcher is in use the proxy resolves DNS, so the guarded lookup never
38
+ * runs; proxied paths keep layer 1 on every hop and nothing more. The
39
+ * precedence is asserted by a test rather than left to be discovered.
40
+ *
41
+ * Denial messages carry the HOSTNAME only. A search URL embeds the user's
42
+ * query and may carry userinfo credentials, and these errors are printed,
43
+ * logged, and returned to callers.
44
+ *
45
+ * @module search/egress
46
+ */
47
+
48
+ /**
49
+ * The admin-level egress policy.
50
+ *
51
+ * Construction-level, never per-request: a per-request allowlist would let an
52
+ * attacker who can influence a search request also influence where it may go,
53
+ * which is the whole thing this module prevents.
54
+ */
55
+ interface SearchEgressPolicy {
56
+ /**
57
+ * Hostnames permitted to resolve into an otherwise-denied address class.
58
+ *
59
+ * The escape hatch for an internal SearXNG deployment
60
+ * (`searx.internal.corp`). Matching is EXACT and case-insensitive — no
61
+ * wildcards, no suffix matching — because a suffix rule (`.corp`) is one
62
+ * attacker-registered subdomain away from admitting anything.
63
+ */
64
+ allowedPrivateHosts?: string[];
65
+ }
66
+ /** Permit every public host; permit nothing private. The production default. */
67
+ declare const DEFAULT_SEARCH_EGRESS_POLICY: Readonly<SearchEgressPolicy>;
68
+ /** Why a host was denied. Stamped into `details.egressClass` for diagnostics. */
69
+ type EgressDenialReason = 'scheme' | 'malformed' | 'loopback' | 'unspecified' | 'link-local' | 'private' | 'unique-local' | 'metadata';
70
+ /**
71
+ * Validate one request target against the policy.
72
+ *
73
+ * @param url - the target. A relative or unparseable value is a denial, not a
74
+ * crash: a redirect `location` is attacker-controlled input.
75
+ * @returns the parsed URL, so callers can reuse it instead of re-parsing.
76
+ * @throws SearchProviderError code `policy_denied`, naming the hostname only.
77
+ */
78
+ declare function validateEgressUrl(url: string | URL, policy?: SearchEgressPolicy, providerId?: SearchProviderId): URL;
79
+ /**
80
+ * Classify a resolved ADDRESS for a hostname that already passed
81
+ * {@link validateEgressUrl}.
82
+ *
83
+ * Separate from the URL check because this is the rebinding defense: the
84
+ * hostname was public, the address it resolved to may not be. Allowlisting is
85
+ * by hostname, so an allowlisted name's private address is admitted here too —
86
+ * that is exactly what the SearXNG escape hatch means.
87
+ */
88
+ declare function assertEgressAddressAllowed(address: string, hostname: string, policy?: SearchEgressPolicy, providerId?: SearchProviderId): void;
89
+ /**
90
+ * The `policy_denied` error buried in a thrown value's `cause` chain, if any.
91
+ *
92
+ * undici reports a connect-time failure as a `TypeError: fetch failed` whose
93
+ * `cause` holds the real error, so a denial raised inside the guarded lookup
94
+ * reaches the caller wrapped. Without this the transport would classify a
95
+ * blocked rebinding attempt as `upstream_unavailable`.
96
+ *
97
+ * The depth cap assumes undici's wrapping stays SHALLOW — today it is two
98
+ * levels and this allows six. If a future undici (or an intermediate
99
+ * dispatcher) nests deeper, a blocked rebinding attempt would quietly
100
+ * reclassify as a transport failure: the request is still refused, but the
101
+ * security signal is lost. That is the failure mode to check if denials ever
102
+ * start reading as `upstream_unavailable`.
103
+ */
104
+ declare function findEgressDenial(error: unknown): SearchProviderError | undefined;
105
+ /** Node's `dns.lookup` shape — the seam a test replaces. */
106
+ type EgressDnsLookup = typeof lookup;
107
+ /**
108
+ * Wrap a resolver so every address it returns is validated before use.
109
+ *
110
+ * Always resolves with `all: true` and re-shapes the answer to whatever the
111
+ * caller asked for. Node's `net.connect` passes `all: true` under
112
+ * `autoSelectFamily` and `all: false` otherwise; validating only the address a
113
+ * single-answer lookup happened to pick would leave the others unchecked on the
114
+ * hosts where it matters most.
115
+ */
116
+ declare function createEgressGuardedLookup(policy?: SearchEgressPolicy, lookupImpl?: EgressDnsLookup): EgressDnsLookup;
117
+ /**
118
+ * An undici dispatcher that validates every resolved address before connecting.
119
+ *
120
+ * Cached per policy signature: a fresh `Agent` per request would leak
121
+ * connection pools. As in `search/http/proxy.ts`, a superseded dispatcher is
122
+ * never closed — a concurrent request may still be reading through it.
123
+ */
124
+ declare function createEgressGuardedDispatcher(policy?: SearchEgressPolicy, lookupImpl?: EgressDnsLookup): Dispatcher;
125
+
126
+ export { DEFAULT_SEARCH_EGRESS_POLICY as D, type EgressDenialReason as E, type SearchEgressPolicy as S, type EgressDnsLookup as a, assertEgressAddressAllowed as b, createEgressGuardedDispatcher as c, createEgressGuardedLookup as d, findEgressDenial as f, validateEgressUrl as v };