watch-tail 0.6.2 → 0.7.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 (268) hide show
  1. package/README.md +22 -6
  2. package/build/client/_app/immutable/assets/0.DKleCc0-.css +2 -0
  3. package/build/client/_app/immutable/assets/0.DKleCc0-.css.br +0 -0
  4. package/build/client/_app/immutable/assets/0.DKleCc0-.css.gz +0 -0
  5. package/build/client/_app/immutable/chunks/{CBRk0OGa.js → 1mB5Ee1Q.js} +1 -1
  6. package/build/client/_app/immutable/chunks/1mB5Ee1Q.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/1mB5Ee1Q.js.gz +0 -0
  8. package/build/client/_app/immutable/chunks/{DWm-CGbg.js → 3fFVdy92.js} +1 -1
  9. package/build/client/_app/immutable/chunks/3fFVdy92.js.br +0 -0
  10. package/build/client/_app/immutable/chunks/3fFVdy92.js.gz +0 -0
  11. package/build/client/_app/immutable/chunks/{w7c5E2ms.js → 8mpn3Xst.js} +1 -1
  12. package/build/client/_app/immutable/chunks/8mpn3Xst.js.br +0 -0
  13. package/build/client/_app/immutable/chunks/8mpn3Xst.js.gz +0 -0
  14. package/build/client/_app/immutable/chunks/{OoMmWNOu.js → B78Vj1az.js} +1 -1
  15. package/build/client/_app/immutable/chunks/B78Vj1az.js.br +0 -0
  16. package/build/client/_app/immutable/chunks/B78Vj1az.js.gz +0 -0
  17. package/build/client/_app/immutable/chunks/{D0IrjYE5.js → B7aS9tS2.js} +1 -1
  18. package/build/client/_app/immutable/chunks/B7aS9tS2.js.br +0 -0
  19. package/build/client/_app/immutable/chunks/B7aS9tS2.js.gz +0 -0
  20. package/build/client/_app/immutable/chunks/{8x_7TBuS.js → BF84Orj8.js} +1 -1
  21. package/build/client/_app/immutable/chunks/BF84Orj8.js.br +0 -0
  22. package/build/client/_app/immutable/chunks/BF84Orj8.js.gz +0 -0
  23. package/build/client/_app/immutable/chunks/BIdvnjrP.js +1 -0
  24. package/build/client/_app/immutable/chunks/BIdvnjrP.js.br +1 -0
  25. package/build/client/_app/immutable/chunks/BIdvnjrP.js.gz +0 -0
  26. package/build/client/_app/immutable/chunks/{UsO0MS14.js → BPoZrXrH.js} +1 -1
  27. package/build/client/_app/immutable/chunks/BPoZrXrH.js.br +0 -0
  28. package/build/client/_app/immutable/chunks/BPoZrXrH.js.gz +0 -0
  29. package/build/client/_app/immutable/chunks/{D1Hr4tKw.js → BSy__Jrd.js} +1 -1
  30. package/build/client/_app/immutable/chunks/BSy__Jrd.js.br +0 -0
  31. package/build/client/_app/immutable/chunks/BSy__Jrd.js.gz +0 -0
  32. package/build/client/_app/immutable/chunks/{KsLFdNDs.js → BdW_yBQU.js} +1 -1
  33. package/build/client/_app/immutable/chunks/BdW_yBQU.js.br +0 -0
  34. package/build/client/_app/immutable/chunks/BdW_yBQU.js.gz +0 -0
  35. package/build/client/_app/immutable/chunks/{F4LqKrLs.js → BnRQs9nz.js} +5 -5
  36. package/build/client/_app/immutable/chunks/BnRQs9nz.js.br +0 -0
  37. package/build/client/_app/immutable/chunks/BnRQs9nz.js.gz +0 -0
  38. package/build/client/_app/immutable/chunks/{AAWh0-tL.js → C6r7NvtG.js} +1 -1
  39. package/build/client/_app/immutable/chunks/C6r7NvtG.js.br +0 -0
  40. package/build/client/_app/immutable/chunks/C6r7NvtG.js.gz +0 -0
  41. package/build/client/_app/immutable/chunks/{KA1QvXmu.js → CEw1go7g.js} +1 -1
  42. package/build/client/_app/immutable/chunks/CEw1go7g.js.br +0 -0
  43. package/build/client/_app/immutable/chunks/CEw1go7g.js.gz +0 -0
  44. package/build/client/_app/immutable/chunks/{BNDRPiSt.js → CFJEGo4j.js} +1 -1
  45. package/build/client/_app/immutable/chunks/CFJEGo4j.js.br +0 -0
  46. package/build/client/_app/immutable/chunks/CFJEGo4j.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/CGnVqaBL.js +1 -0
  48. package/build/client/_app/immutable/chunks/CGnVqaBL.js.br +0 -0
  49. package/build/client/_app/immutable/chunks/CGnVqaBL.js.gz +0 -0
  50. package/build/client/_app/immutable/chunks/{CfPyeeq3.js → CY8zQ4KM.js} +1 -1
  51. package/build/client/_app/immutable/chunks/CY8zQ4KM.js.br +0 -0
  52. package/build/client/_app/immutable/chunks/CY8zQ4KM.js.gz +0 -0
  53. package/build/client/_app/immutable/chunks/{DYDQbI6D.js → CZ3S843d.js} +1 -1
  54. package/build/client/_app/immutable/chunks/CZ3S843d.js.br +0 -0
  55. package/build/client/_app/immutable/chunks/CZ3S843d.js.gz +0 -0
  56. package/build/client/_app/immutable/chunks/{DtV-MjyX.js → CgAZPeK7.js} +1 -1
  57. package/build/client/_app/immutable/chunks/CgAZPeK7.js.br +0 -0
  58. package/build/client/_app/immutable/chunks/CgAZPeK7.js.gz +0 -0
  59. package/build/client/_app/immutable/chunks/{Dc9It0QB.js → CrmB4MvE.js} +1 -1
  60. package/build/client/_app/immutable/chunks/CrmB4MvE.js.br +0 -0
  61. package/build/client/_app/immutable/chunks/CrmB4MvE.js.gz +0 -0
  62. package/build/client/_app/immutable/chunks/{DznDQzx1.js → CtWwlW0t.js} +1 -1
  63. package/build/client/_app/immutable/chunks/CtWwlW0t.js.br +0 -0
  64. package/build/client/_app/immutable/chunks/CtWwlW0t.js.gz +0 -0
  65. package/build/client/_app/immutable/chunks/{CG0TPRkn.js → D-AkVRH7.js} +1 -1
  66. package/build/client/_app/immutable/chunks/D-AkVRH7.js.br +0 -0
  67. package/build/client/_app/immutable/chunks/D-AkVRH7.js.gz +0 -0
  68. package/build/client/_app/immutable/chunks/{D6rwn6Ed.js → D0CZlpgd.js} +1 -1
  69. package/build/client/_app/immutable/chunks/D0CZlpgd.js.br +0 -0
  70. package/build/client/_app/immutable/chunks/D0CZlpgd.js.gz +0 -0
  71. package/build/client/_app/immutable/chunks/{CpeJ2iPd.js → D0IZin0e.js} +1 -1
  72. package/build/client/_app/immutable/chunks/D0IZin0e.js.br +0 -0
  73. package/build/client/_app/immutable/chunks/D0IZin0e.js.gz +0 -0
  74. package/build/client/_app/immutable/chunks/{DQCjzVyz.js → DI6o1zMC.js} +1 -1
  75. package/build/client/_app/immutable/chunks/DI6o1zMC.js.br +0 -0
  76. package/build/client/_app/immutable/chunks/DI6o1zMC.js.gz +0 -0
  77. package/build/client/_app/immutable/chunks/{sf5kQ3yV.js → DbWb9_dK.js} +1 -1
  78. package/build/client/_app/immutable/chunks/DbWb9_dK.js.br +0 -0
  79. package/build/client/_app/immutable/chunks/DbWb9_dK.js.gz +0 -0
  80. package/build/client/_app/immutable/chunks/{1cmfrS0o.js → Dh3ZWuG8.js} +1 -1
  81. package/build/client/_app/immutable/chunks/Dh3ZWuG8.js.br +0 -0
  82. package/build/client/_app/immutable/chunks/Dh3ZWuG8.js.gz +0 -0
  83. package/build/client/_app/immutable/chunks/{CIDBs8t6.js → Dp3OTI-g.js} +1 -1
  84. package/build/client/_app/immutable/chunks/Dp3OTI-g.js.br +0 -0
  85. package/build/client/_app/immutable/chunks/Dp3OTI-g.js.gz +0 -0
  86. package/build/client/_app/immutable/chunks/{BKpsnTLG.js → DtdjxckD.js} +1 -1
  87. package/build/client/_app/immutable/chunks/DtdjxckD.js.br +0 -0
  88. package/build/client/_app/immutable/chunks/DtdjxckD.js.gz +0 -0
  89. package/build/client/_app/immutable/chunks/YehCS1lO.js +5 -0
  90. package/build/client/_app/immutable/chunks/YehCS1lO.js.br +0 -0
  91. package/build/client/_app/immutable/chunks/YehCS1lO.js.gz +0 -0
  92. package/build/client/_app/immutable/chunks/{DqJI6J5U.js → g-7YfdwH.js} +1 -1
  93. package/build/client/_app/immutable/chunks/g-7YfdwH.js.br +0 -0
  94. package/build/client/_app/immutable/chunks/g-7YfdwH.js.gz +0 -0
  95. package/build/client/_app/immutable/chunks/{BWDKMHXq.js → zfc2KyIr.js} +1 -1
  96. package/build/client/_app/immutable/chunks/zfc2KyIr.js.br +0 -0
  97. package/build/client/_app/immutable/chunks/zfc2KyIr.js.gz +0 -0
  98. package/build/client/_app/immutable/entry/{app.FQLd-NC-.js → app.C-KKyvGI.js} +2 -2
  99. package/build/client/_app/immutable/entry/app.C-KKyvGI.js.br +0 -0
  100. package/build/client/_app/immutable/entry/app.C-KKyvGI.js.gz +0 -0
  101. package/build/client/_app/immutable/entry/start.obx3dQT_.js +1 -0
  102. package/build/client/_app/immutable/entry/start.obx3dQT_.js.br +1 -0
  103. package/build/client/_app/immutable/entry/start.obx3dQT_.js.gz +0 -0
  104. package/build/client/_app/immutable/nodes/{0.BN3NguWs.js → 0.2dnHMwE1.js} +1 -1
  105. package/build/client/_app/immutable/nodes/0.2dnHMwE1.js.br +0 -0
  106. package/build/client/_app/immutable/nodes/{0.BN3NguWs.js.gz → 0.2dnHMwE1.js.gz} +0 -0
  107. package/build/client/_app/immutable/nodes/{1.5EZfoLCg.js → 1.D5nbnmDb.js} +1 -1
  108. package/build/client/_app/immutable/nodes/1.D5nbnmDb.js.br +0 -0
  109. package/build/client/_app/immutable/nodes/1.D5nbnmDb.js.gz +0 -0
  110. package/build/client/_app/immutable/nodes/2.DAQ4mvAt.js +5 -0
  111. package/build/client/_app/immutable/nodes/2.DAQ4mvAt.js.br +0 -0
  112. package/build/client/_app/immutable/nodes/2.DAQ4mvAt.js.gz +0 -0
  113. package/build/client/_app/version.json +1 -1
  114. package/build/client/_app/version.json.br +0 -0
  115. package/build/client/_app/version.json.gz +0 -0
  116. package/build/handler.js +4 -4
  117. package/build/index.js +4 -4
  118. package/build/server/chunks/chunks/{EventScatter.js-D3Jaw_Cw.js → EventScatter.js-Du7AJN9m.js} +50 -17
  119. package/build/server/chunks/chunks/{EventScatter.js-D3Jaw_Cw.js.map → EventScatter.js-Du7AJN9m.js.map} +1 -1
  120. package/build/server/chunks/chunks/{archive.js-C2D-5edp.js → archive.js-D2jtMmDo.js} +134 -26
  121. package/build/server/chunks/chunks/archive.js-D2jtMmDo.js.map +1 -0
  122. package/build/server/chunks/chunks/{aws.js-DkPqAybc.js → env2.js-C5BgBJDY.js} +63 -6
  123. package/build/server/chunks/chunks/env2.js-C5BgBJDY.js.map +1 -0
  124. package/build/server/chunks/chunks/identity.js-NmGXxBz3.js +22 -0
  125. package/build/server/chunks/chunks/identity.js-NmGXxBz3.js.map +1 -0
  126. package/build/server/chunks/chunks/{internal2.js-627EG4am.js → internal2.js--RCssYze.js} +2 -2
  127. package/build/server/chunks/chunks/{internal2.js-627EG4am.js.map → internal2.js--RCssYze.js.map} +1 -1
  128. package/build/server/chunks/chunks/{level-filter.js-B3o2hyWD.js → level-filter.js-D9MNrew3.js} +2 -2
  129. package/build/server/chunks/chunks/{level-filter.js-B3o2hyWD.js.map → level-filter.js-D9MNrew3.js.map} +1 -1
  130. package/build/server/chunks/chunks/{log-buffer.js-BI_gQOls.js → log-buffer.js-A9FA-Qv8.js} +18 -3
  131. package/build/server/chunks/chunks/log-buffer.js-A9FA-Qv8.js.map +1 -0
  132. package/build/server/chunks/chunks/{regions.js-IQPMyP5C.js → regions.js-COf7DgnH.js} +3 -3
  133. package/build/server/chunks/chunks/regions.js-COf7DgnH.js.map +1 -0
  134. package/build/server/chunks/chunks/{series-buckets.js-BjigySff.js → series-buckets.js-BmCYga3F.js} +28 -3
  135. package/build/server/chunks/chunks/series-buckets.js-BmCYga3F.js.map +1 -0
  136. package/build/server/chunks/chunks/{state.js-DbqJPX0Y.js → state.js-CI2ef6Vi.js} +2 -2
  137. package/build/server/chunks/chunks/{state.js-DbqJPX0Y.js.map → state.js-CI2ef6Vi.js.map} +1 -1
  138. package/build/server/chunks/entries/endpoints/api/archive/{_server.ts.js-83Ch7djd.js → _server.ts.js-C4hWyXuu.js} +17 -9
  139. package/build/server/chunks/entries/endpoints/api/archive/_server.ts.js-C4hWyXuu.js.map +1 -0
  140. package/build/server/chunks/entries/endpoints/api/health/{_server.ts.js-VctnBhIJ.js → _server.ts.js-C5tfrpmC.js} +4 -5
  141. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-C5tfrpmC.js.map +1 -0
  142. package/build/server/chunks/entries/endpoints/api/identity/{_server.ts.js-Dt540Sio.js → _server.ts.js-PWRPScuN.js} +6 -24
  143. package/build/server/chunks/entries/endpoints/api/identity/_server.ts.js-PWRPScuN.js.map +1 -0
  144. package/build/server/chunks/entries/endpoints/api/log-groups/{_server.ts.js-drLgUdvB.js → _server.ts.js-D4y43Vwe.js} +14 -11
  145. package/build/server/chunks/entries/endpoints/api/log-groups/_server.ts.js-D4y43Vwe.js.map +1 -0
  146. package/build/server/chunks/entries/endpoints/api/regions/{_server.ts.js-CBqfN6Pg.js → _server.ts.js-9_g0ojki.js} +8 -9
  147. package/build/server/chunks/entries/endpoints/api/regions/_server.ts.js-9_g0ojki.js.map +1 -0
  148. package/build/server/chunks/entries/endpoints/api/series/{_server.ts.js-DOvBhEDU.js → _server.ts.js-DibT3Hjc.js} +34 -16
  149. package/build/server/chunks/entries/endpoints/api/series/_server.ts.js-DibT3Hjc.js.map +1 -0
  150. package/build/server/chunks/entries/endpoints/api/stream/{_server.ts.js-B9_-4ssJ.js → _server.ts.js-3ZYI-Za9.js} +15 -12
  151. package/build/server/chunks/entries/endpoints/api/stream/_server.ts.js-3ZYI-Za9.js.map +1 -0
  152. package/build/server/chunks/entries/fallbacks/{error.svelte.js-B8dLO9gT.js → error.svelte.js-DP0OULWi.js} +3 -3
  153. package/build/server/chunks/entries/fallbacks/{error.svelte.js-B8dLO9gT.js.map → error.svelte.js-DP0OULWi.js.map} +1 -1
  154. package/build/server/chunks/entries/pages/{_layout.svelte.js-CBQpEToy.js → _layout.svelte.js-8U7ZeKYO.js} +3 -3
  155. package/build/server/chunks/entries/pages/_layout.svelte.js-8U7ZeKYO.js.map +1 -0
  156. package/build/server/chunks/entries/pages/{_page.svelte.js-BwuzE25P.js → _page.svelte.js-hG1agdw-.js} +82 -33
  157. package/build/server/chunks/entries/pages/_page.svelte.js-hG1agdw-.js.map +1 -0
  158. package/build/server/chunks/{handler-hlKcUyVP.js → handler-_dxqeJJj.js} +3 -3
  159. package/build/server/chunks/{handler-hlKcUyVP.js.map → handler-_dxqeJJj.js.map} +1 -1
  160. package/build/server/chunks/{index.js-BfPWKsz6.js → index.js-arX1nCCw.js} +2 -2
  161. package/build/server/chunks/{index.js-BfPWKsz6.js.map → index.js-arX1nCCw.js.map} +1 -1
  162. package/build/server/chunks/{manifest.js-uuijI5lm.js → manifest.js-D3447-0_.js} +12 -12
  163. package/build/server/chunks/{manifest.js-uuijI5lm.js.map → manifest.js-D3447-0_.js.map} +1 -1
  164. package/build/server/chunks/nodes/{0.js-CNFDDPj5.js → 0.js-XM75fTfb.js} +4 -4
  165. package/build/server/chunks/nodes/{0.js-CNFDDPj5.js.map → 0.js-XM75fTfb.js.map} +1 -1
  166. package/build/server/chunks/nodes/{1.js-bi9PXX_2.js → 1.js-CRIDfcrR.js} +3 -3
  167. package/build/server/chunks/nodes/{1.js-bi9PXX_2.js.map → 1.js-CRIDfcrR.js.map} +1 -1
  168. package/build/server/chunks/nodes/{2.js-3MYCPEqM.js → 2.js-1qmqKlMg.js} +3 -3
  169. package/build/server/chunks/nodes/{2.js-3MYCPEqM.js.map → 2.js-1qmqKlMg.js.map} +1 -1
  170. package/dist/cli/options.js +1 -1
  171. package/dist/lib/cli/aws.js +4 -4
  172. package/dist/lib/log-buffer.js +1 -1
  173. package/package.json +5 -5
  174. package/build/client/_app/immutable/assets/0.Dfts6BC4.css +0 -2
  175. package/build/client/_app/immutable/assets/0.Dfts6BC4.css.br +0 -0
  176. package/build/client/_app/immutable/assets/0.Dfts6BC4.css.gz +0 -0
  177. package/build/client/_app/immutable/chunks/1cmfrS0o.js.br +0 -0
  178. package/build/client/_app/immutable/chunks/1cmfrS0o.js.gz +0 -0
  179. package/build/client/_app/immutable/chunks/8x_7TBuS.js.br +0 -0
  180. package/build/client/_app/immutable/chunks/8x_7TBuS.js.gz +0 -0
  181. package/build/client/_app/immutable/chunks/AAWh0-tL.js.br +0 -0
  182. package/build/client/_app/immutable/chunks/AAWh0-tL.js.gz +0 -0
  183. package/build/client/_app/immutable/chunks/BKpsnTLG.js.br +0 -0
  184. package/build/client/_app/immutable/chunks/BKpsnTLG.js.gz +0 -0
  185. package/build/client/_app/immutable/chunks/BNDRPiSt.js.br +0 -0
  186. package/build/client/_app/immutable/chunks/BNDRPiSt.js.gz +0 -0
  187. package/build/client/_app/immutable/chunks/BWDKMHXq.js.br +0 -0
  188. package/build/client/_app/immutable/chunks/BWDKMHXq.js.gz +0 -0
  189. package/build/client/_app/immutable/chunks/BjxZ_neZ.js +0 -5
  190. package/build/client/_app/immutable/chunks/BjxZ_neZ.js.br +0 -0
  191. package/build/client/_app/immutable/chunks/BjxZ_neZ.js.gz +0 -0
  192. package/build/client/_app/immutable/chunks/CBRk0OGa.js.br +0 -0
  193. package/build/client/_app/immutable/chunks/CBRk0OGa.js.gz +0 -0
  194. package/build/client/_app/immutable/chunks/CG0TPRkn.js.br +0 -0
  195. package/build/client/_app/immutable/chunks/CG0TPRkn.js.gz +0 -0
  196. package/build/client/_app/immutable/chunks/CGReuhGk.js +0 -1
  197. package/build/client/_app/immutable/chunks/CGReuhGk.js.br +0 -1
  198. package/build/client/_app/immutable/chunks/CGReuhGk.js.gz +0 -0
  199. package/build/client/_app/immutable/chunks/CIDBs8t6.js.br +0 -0
  200. package/build/client/_app/immutable/chunks/CIDBs8t6.js.gz +0 -0
  201. package/build/client/_app/immutable/chunks/CfPyeeq3.js.br +0 -0
  202. package/build/client/_app/immutable/chunks/CfPyeeq3.js.gz +0 -0
  203. package/build/client/_app/immutable/chunks/CpeJ2iPd.js.br +0 -0
  204. package/build/client/_app/immutable/chunks/CpeJ2iPd.js.gz +0 -0
  205. package/build/client/_app/immutable/chunks/D0IrjYE5.js.br +0 -0
  206. package/build/client/_app/immutable/chunks/D0IrjYE5.js.gz +0 -0
  207. package/build/client/_app/immutable/chunks/D1Hr4tKw.js.br +0 -0
  208. package/build/client/_app/immutable/chunks/D1Hr4tKw.js.gz +0 -0
  209. package/build/client/_app/immutable/chunks/D6rwn6Ed.js.br +0 -1
  210. package/build/client/_app/immutable/chunks/D6rwn6Ed.js.gz +0 -0
  211. package/build/client/_app/immutable/chunks/DQCjzVyz.js.br +0 -0
  212. package/build/client/_app/immutable/chunks/DQCjzVyz.js.gz +0 -0
  213. package/build/client/_app/immutable/chunks/DWm-CGbg.js.br +0 -0
  214. package/build/client/_app/immutable/chunks/DWm-CGbg.js.gz +0 -0
  215. package/build/client/_app/immutable/chunks/DYDQbI6D.js.br +0 -0
  216. package/build/client/_app/immutable/chunks/DYDQbI6D.js.gz +0 -0
  217. package/build/client/_app/immutable/chunks/Dc9It0QB.js.br +0 -0
  218. package/build/client/_app/immutable/chunks/Dc9It0QB.js.gz +0 -0
  219. package/build/client/_app/immutable/chunks/DkQY3T0m.js +0 -1
  220. package/build/client/_app/immutable/chunks/DkQY3T0m.js.br +0 -0
  221. package/build/client/_app/immutable/chunks/DkQY3T0m.js.gz +0 -0
  222. package/build/client/_app/immutable/chunks/DqJI6J5U.js.br +0 -0
  223. package/build/client/_app/immutable/chunks/DqJI6J5U.js.gz +0 -0
  224. package/build/client/_app/immutable/chunks/DtV-MjyX.js.br +0 -0
  225. package/build/client/_app/immutable/chunks/DtV-MjyX.js.gz +0 -0
  226. package/build/client/_app/immutable/chunks/DznDQzx1.js.br +0 -0
  227. package/build/client/_app/immutable/chunks/DznDQzx1.js.gz +0 -0
  228. package/build/client/_app/immutable/chunks/F4LqKrLs.js.br +0 -0
  229. package/build/client/_app/immutable/chunks/F4LqKrLs.js.gz +0 -0
  230. package/build/client/_app/immutable/chunks/KA1QvXmu.js.br +0 -0
  231. package/build/client/_app/immutable/chunks/KA1QvXmu.js.gz +0 -0
  232. package/build/client/_app/immutable/chunks/KsLFdNDs.js.br +0 -0
  233. package/build/client/_app/immutable/chunks/KsLFdNDs.js.gz +0 -0
  234. package/build/client/_app/immutable/chunks/OoMmWNOu.js.br +0 -0
  235. package/build/client/_app/immutable/chunks/OoMmWNOu.js.gz +0 -0
  236. package/build/client/_app/immutable/chunks/UsO0MS14.js.br +0 -0
  237. package/build/client/_app/immutable/chunks/UsO0MS14.js.gz +0 -0
  238. package/build/client/_app/immutable/chunks/sf5kQ3yV.js.br +0 -0
  239. package/build/client/_app/immutable/chunks/sf5kQ3yV.js.gz +0 -0
  240. package/build/client/_app/immutable/chunks/w7c5E2ms.js.br +0 -0
  241. package/build/client/_app/immutable/chunks/w7c5E2ms.js.gz +0 -0
  242. package/build/client/_app/immutable/entry/app.FQLd-NC-.js.br +0 -0
  243. package/build/client/_app/immutable/entry/app.FQLd-NC-.js.gz +0 -0
  244. package/build/client/_app/immutable/entry/start.DqW_lChD.js +0 -1
  245. package/build/client/_app/immutable/entry/start.DqW_lChD.js.br +0 -1
  246. package/build/client/_app/immutable/entry/start.DqW_lChD.js.gz +0 -0
  247. package/build/client/_app/immutable/nodes/0.BN3NguWs.js.br +0 -0
  248. package/build/client/_app/immutable/nodes/1.5EZfoLCg.js.br +0 -0
  249. package/build/client/_app/immutable/nodes/1.5EZfoLCg.js.gz +0 -0
  250. package/build/client/_app/immutable/nodes/2.CbcDv2oO.js +0 -4
  251. package/build/client/_app/immutable/nodes/2.CbcDv2oO.js.br +0 -0
  252. package/build/client/_app/immutable/nodes/2.CbcDv2oO.js.gz +0 -0
  253. package/build/server/chunks/chunks/archive.js-C2D-5edp.js.map +0 -1
  254. package/build/server/chunks/chunks/aws.js-DkPqAybc.js.map +0 -1
  255. package/build/server/chunks/chunks/env2.js-CcIskxOZ.js +0 -60
  256. package/build/server/chunks/chunks/env2.js-CcIskxOZ.js.map +0 -1
  257. package/build/server/chunks/chunks/log-buffer.js-BI_gQOls.js.map +0 -1
  258. package/build/server/chunks/chunks/regions.js-IQPMyP5C.js.map +0 -1
  259. package/build/server/chunks/chunks/series-buckets.js-BjigySff.js.map +0 -1
  260. package/build/server/chunks/entries/endpoints/api/archive/_server.ts.js-83Ch7djd.js.map +0 -1
  261. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-VctnBhIJ.js.map +0 -1
  262. package/build/server/chunks/entries/endpoints/api/identity/_server.ts.js-Dt540Sio.js.map +0 -1
  263. package/build/server/chunks/entries/endpoints/api/log-groups/_server.ts.js-drLgUdvB.js.map +0 -1
  264. package/build/server/chunks/entries/endpoints/api/regions/_server.ts.js-CBqfN6Pg.js.map +0 -1
  265. package/build/server/chunks/entries/endpoints/api/series/_server.ts.js-DOvBhEDU.js.map +0 -1
  266. package/build/server/chunks/entries/endpoints/api/stream/_server.ts.js-B9_-4ssJ.js.map +0 -1
  267. package/build/server/chunks/entries/pages/_layout.svelte.js-CBQpEToy.js.map +0 -1
  268. package/build/server/chunks/entries/pages/_page.svelte.js-BwuzE25P.js.map +0 -1
@@ -1,10 +1,90 @@
1
- import { d as detectRequestId, a as detectLevelWithSource, i as isLogLevel, L as LEVEL_RANK } from './log-buffer.js-BI_gQOls.js';
2
- import { mkdirSync, statSync } from 'node:fs';
1
+ import { r as resolveAwsConfig, c as createStsClient, p as parseRegionParam } from './env2.js-C5BgBJDY.js';
2
+ import { g as getCallerIdentityWith } from './identity.js-NmGXxBz3.js';
3
+ import { d as detectRequestId, a as detectLevelWithSource, e as eventDurationMs, i as isLogLevel, L as LEVEL_RANK } from './log-buffer.js-A9FA-Qv8.js';
4
+ import { mkdirSync, statSync, readFileSync, writeFileSync, renameSync } from 'node:fs';
3
5
  import { homedir } from 'node:os';
4
- import { join, dirname } from 'node:path';
6
+ import { resolve, join, dirname } from 'node:path';
7
+ import { randomUUID, createHash } from 'node:crypto';
5
8
  import { setTimeout } from 'node:timers/promises';
6
- import { createHash } from 'node:crypto';
7
9
 
10
+ //#region src/lib/server/archive-location.ts
11
+ /** Account/region archive routing. Cached identities are for offline reads only. */
12
+ /** Resolve STS separately so a Logs-only endpoint never receives identity requests. */
13
+ async function identify(env, region) {
14
+ const client = createStsClient(resolveAwsConfig(env, region, "sts"));
15
+ try {
16
+ const effectiveRegion = region ?? await client.config.region();
17
+ return {
18
+ account: (await getCallerIdentityWith(client, { signal: AbortSignal.timeout(5e3) })).account,
19
+ region: effectiveRegion
20
+ };
21
+ } finally {
22
+ client.destroy();
23
+ }
24
+ }
25
+ function hash(value) {
26
+ return createHash("sha256").update(value).digest("hex");
27
+ }
28
+ function valid(identity) {
29
+ return typeof identity?.account === "string" && /^\d{12}$/.test(identity.account) && typeof identity.region === "string" && !!identity.region && parseRegionParam(identity.region).ok;
30
+ }
31
+ /** Resolves an archive path without guessing an account when AWS is unavailable. */
32
+ var ArchiveLocator = class {
33
+ lookup;
34
+ #pending = /* @__PURE__ */ new Map();
35
+ #known = /* @__PURE__ */ new Map();
36
+ constructor(lookup = identify) {
37
+ this.lookup = lookup;
38
+ }
39
+ async locate(basePath, env, selection) {
40
+ const config = resolveAwsConfig(env, selection.region);
41
+ const root = env.WATCH_TAIL_ARCHIVE_DIR?.trim() || dirname(basePath);
42
+ const stsEndpoint = resolveAwsConfig(env, selection.region, "sts").endpoint;
43
+ const key = hash(JSON.stringify([
44
+ config.endpoint,
45
+ config.region,
46
+ env.AWS_PROFILE || "default",
47
+ env.AWS_CONFIG_FILE,
48
+ env.AWS_SHARED_CREDENTIALS_FILE,
49
+ env.AWS_ROLE_ARN,
50
+ env.AWS_WEB_IDENTITY_TOKEN_FILE,
51
+ env.AWS_ACCESS_KEY_ID,
52
+ env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,
53
+ env.AWS_CONTAINER_CREDENTIALS_FULL_URI,
54
+ ...stsEndpoint && stsEndpoint !== config.endpoint ? [stsEndpoint] : []
55
+ ]));
56
+ const cachePath = join(root, "identities", `${key}.json`);
57
+ let pending = this.#pending.get(key);
58
+ if (!pending) {
59
+ pending = this.lookup(env, config.region);
60
+ this.#pending.set(key, pending);
61
+ }
62
+ let identity;
63
+ try {
64
+ identity = await pending;
65
+ } catch (error) {
66
+ let cached = selection.readOnly ? this.#known.get(cachePath) : void 0;
67
+ if (selection.readOnly && !cached) try {
68
+ cached = JSON.parse(readFileSync(cachePath, "utf8"));
69
+ } catch {}
70
+ if (!cached || !valid(cached) || config.region && cached.region !== config.region) throw error;
71
+ identity = cached;
72
+ } finally {
73
+ this.#pending.delete(key);
74
+ }
75
+ if (!valid(identity) || config.region && config.region !== identity.region) throw new Error("AWS did not return a valid archive account and region");
76
+ this.#known.set(cachePath, identity);
77
+ try {
78
+ mkdirSync(dirname(cachePath), { recursive: true });
79
+ const temporary = `${cachePath}.${randomUUID()}.tmp`;
80
+ writeFileSync(temporary, JSON.stringify(identity), { mode: 384 });
81
+ renameSync(temporary, cachePath);
82
+ } catch {}
83
+ const namespace = config.endpoint ? join("endpoints", hash(config.endpoint)) : "";
84
+ return join(root, namespace, identity.account, identity.region, "archive.duckdb");
85
+ }
86
+ };
87
+ //#endregion
8
88
  //#region src/lib/server/archive-sql.ts
9
89
  /**
10
90
  * SQL and row mapping for the local DuckDB archive.
@@ -427,6 +507,7 @@ function seriesScope(request, groups) {
427
507
  function buildSeriesQuery(request) {
428
508
  const bucketMs = Math.max(1, Math.round(request.bucketMs));
429
509
  const scope = seriesScope(request, request.logGroups.length > 0 ? request.logGroups : [""]);
510
+ if (request.metric === "duration") return buildDurationSeriesQuery(request, scope.where, scope.params);
430
511
  if (request.by === "request") return buildRequestSeriesQuery(request, bucketMs, scope.where, scope.params);
431
512
  const params = [
432
513
  BigInt(bucketMs),
@@ -480,6 +561,23 @@ function buildRequestSeriesQuery(request, bucketMs, where, scopeParams) {
480
561
  params
481
562
  };
482
563
  }
564
+ /** Duration points are not bucketed: one point at each request's first observed timestamp. */
565
+ function buildDurationSeriesQuery(request, where, scopeParams) {
566
+ const levels = request.levels ?? [];
567
+ const having = levels.length ? ` HAVING level_rank IN (${levels.map(() => "?").join(", ")})` : "";
568
+ return {
569
+ sql: `WITH requests AS (
570
+ SELECT request_id, log_group, min(timestamp_ms) AS start_ms,
571
+ max(timestamp_ms) - min(timestamp_ms) AS duration_ms,
572
+ first(message ORDER BY timestamp_ms DESC, seq DESC) AS last_message,
573
+ max(${levelRankCase("coalesce(level, 'unknown')")}) AS level_rank
574
+ FROM log_events WHERE ${where.join(" AND ")} AND request_id IS NOT NULL AND request_id <> ''
575
+ GROUP BY request_id, log_group${having})
576
+ SELECT start_ms AS bucket, log_group, ${levelNameCase("level_rank")} AS level,
577
+ 1 AS events, request_id, duration_ms, last_message FROM requests ORDER BY bucket, log_group, request_id`,
578
+ params: [...scopeParams, ...levels.map((level) => LEVEL_RANK[level])]
579
+ };
580
+ }
483
581
  /** Maps the rows of {@link buildSeriesQuery} onto chart points. */
484
582
  function rowsToSeries(rows) {
485
583
  const points = [];
@@ -492,7 +590,11 @@ function rowsToSeries(rows) {
492
590
  t,
493
591
  group,
494
592
  level: typeof level === "string" && level.length > 0 ? level : "unknown",
495
- events: toNumber(pick(row, "events")) ?? 0
593
+ events: toNumber(pick(row, "events")) ?? 0,
594
+ ...typeof row.request_id === "string" ? {
595
+ requestId: row.request_id,
596
+ durationMs: (toNumber(row.duration_ms) ?? 0) + eventDurationMs(typeof row.last_message === "string" ? row.last_message : "")
597
+ } : {}
496
598
  });
497
599
  }
498
600
  return points;
@@ -546,8 +648,8 @@ function isDisabled(value) {
546
648
  *
547
649
  * Vitest sets `VITEST`, and `NODE_ENV=test` covers other harnesses. Tests must
548
650
  * not append to the archive of the machine they run on, so the archive is off
549
- * unless a test asks for it through `WATCH_STREAM_ARCHIVE_DB` or
550
- * `WATCH_STREAM_ARCHIVE=on`.
651
+ * unless a test asks for it through `WATCH_TAIL_ARCHIVE_DB` or
652
+ * `WATCH_TAIL_ARCHIVE=on`.
551
653
  */
552
654
  function isTestProcess(env) {
553
655
  return env.VITEST !== void 0 || env.NODE_ENV === "test";
@@ -555,15 +657,15 @@ function isTestProcess(env) {
555
657
  /**
556
658
  * Resolves the archive file path.
557
659
  *
558
- * `WATCH_STREAM_ARCHIVE_DB` wins; otherwise the file lives in the platform's
660
+ * `WATCH_TAIL_ARCHIVE_DB` wins; otherwise the file lives in the platform's
559
661
  * data directory (`XDG_DATA_HOME`, `%LOCALAPPDATA%` or
560
662
  * `~/Library/Application Support`), never in the current directory, so history
561
663
  * survives running the CLI from a different folder.
562
664
  */
563
665
  function resolveArchiveConfig(env, platform = process.platform, home = homedir()) {
564
- const path = env.WATCH_STREAM_ARCHIVE_DB?.trim() ?? "";
666
+ const path = env.WATCH_TAIL_ARCHIVE_DB?.trim() ?? "";
565
667
  const dataDir = env.XDG_DATA_HOME?.trim() ?? (platform === "darwin" ? join(home, "Library", "Application Support") : platform === "win32" ? env.LOCALAPPDATA?.trim() ?? join(home, "AppData", "Local") : join(home, ".local", "share"));
566
- const requested = env.WATCH_STREAM_ARCHIVE?.trim() ?? "";
668
+ const requested = env.WATCH_TAIL_ARCHIVE?.trim() ?? "";
567
669
  return {
568
670
  enabled: isDisabled(requested) ? false : path.length > 0 || requested.length > 0 ? true : !isTestProcess(env),
569
671
  path: path.length > 0 ? path : join(dataDir, ARCHIVE_DIR_NAME, ARCHIVE_FILE_NAME)
@@ -800,24 +902,30 @@ var LogArchive = class LogArchive {
800
902
  });
801
903
  }
802
904
  };
803
- /** The archive for the running server, opened once per process. */
804
- var sharedArchive = null;
805
- /**
806
- * Returns the process-wide archive for `env`, opening it on first use.
807
- *
808
- * The same file is never opened twice per process; a disabled archive
809
- * (`WATCH_STREAM_ARCHIVE=off`) is remembered so no driver import is attempted.
810
- */
811
- function getArchive(env, load) {
812
- if (sharedArchive === null) {
813
- const config = resolveArchiveConfig(env);
814
- sharedArchive = config.enabled ? LogArchive.open({
815
- path: config.path,
905
+ /** A single opening promise per absolute file path prevents duplicate DuckDB writers. */
906
+ var sharedArchives = /* @__PURE__ */ new Map();
907
+ var archiveLocator = new ArchiveLocator();
908
+ /** Opens the selected account/region archive; explicit --db paths remain file overrides. */
909
+ async function getArchive(env, selection = {}, load) {
910
+ const config = resolveArchiveConfig(env);
911
+ if (!config.enabled) return LogArchive.unavailable(config.path);
912
+ let path = config.path;
913
+ if (!env.WATCH_TAIL_ARCHIVE_DB?.trim()) try {
914
+ path = await archiveLocator.locate(config.path, env, selection);
915
+ } catch (error) {
916
+ return LogArchive.unavailable(config.path, `Cannot select account archive: ${error instanceof Error ? error.message : String(error)}`);
917
+ }
918
+ path = resolve(path);
919
+ let archive = sharedArchives.get(path);
920
+ if (!archive) {
921
+ archive = LogArchive.open({
922
+ path,
816
923
  ...{}
817
- }) : Promise.resolve(LogArchive.unavailable(config.path));
924
+ });
925
+ sharedArchives.set(path, archive);
818
926
  }
819
- return sharedArchive;
927
+ return archive;
820
928
  }
821
929
 
822
930
  export { getArchive as g };
823
- //# sourceMappingURL=archive.js-C2D-5edp.js.map
931
+ //# sourceMappingURL=archive.js-D2jtMmDo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive.js-D2jtMmDo.js","sources":["../../../../.svelte-kit/output/server/chunks/archive.js"],"sourcesContent":["import { a as createStsClient, c as resolveAwsConfig, s as parseRegionParam } from \"./env2.js\";\nimport { t as getCallerIdentityWith } from \"./identity.js\";\nimport { a as detectLevelWithSource, d as isLogLevel, m as eventDurationMs, n as LEVEL_RANK, o as detectRequestId } from \"./log-buffer.js\";\nimport { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { setTimeout } from \"node:timers/promises\";\n//#region src/lib/server/archive-location.ts\n/** Account/region archive routing. Cached identities are for offline reads only. */\n/** Resolve STS separately so a Logs-only endpoint never receives identity requests. */\nasync function identify(env, region) {\n\tconst client = createStsClient(resolveAwsConfig(env, region, \"sts\"));\n\ttry {\n\t\tconst effectiveRegion = region ?? await client.config.region();\n\t\treturn {\n\t\t\taccount: (await getCallerIdentityWith(client, { signal: AbortSignal.timeout(5e3) })).account,\n\t\t\tregion: effectiveRegion\n\t\t};\n\t} finally {\n\t\tclient.destroy();\n\t}\n}\nfunction hash(value) {\n\treturn createHash(\"sha256\").update(value).digest(\"hex\");\n}\nfunction valid(identity) {\n\treturn typeof identity?.account === \"string\" && /^\\d{12}$/.test(identity.account) && typeof identity.region === \"string\" && !!identity.region && parseRegionParam(identity.region).ok;\n}\n/** Resolves an archive path without guessing an account when AWS is unavailable. */\nvar ArchiveLocator = class {\n\tlookup;\n\t#pending = /* @__PURE__ */ new Map();\n\t#known = /* @__PURE__ */ new Map();\n\tconstructor(lookup = identify) {\n\t\tthis.lookup = lookup;\n\t}\n\tasync locate(basePath, env, selection) {\n\t\tconst config = resolveAwsConfig(env, selection.region);\n\t\tconst root = env.WATCH_TAIL_ARCHIVE_DIR?.trim() || dirname(basePath);\n\t\tconst stsEndpoint = resolveAwsConfig(env, selection.region, \"sts\").endpoint;\n\t\tconst key = hash(JSON.stringify([\n\t\t\tconfig.endpoint,\n\t\t\tconfig.region,\n\t\t\tenv.AWS_PROFILE || \"default\",\n\t\t\tenv.AWS_CONFIG_FILE,\n\t\t\tenv.AWS_SHARED_CREDENTIALS_FILE,\n\t\t\tenv.AWS_ROLE_ARN,\n\t\t\tenv.AWS_WEB_IDENTITY_TOKEN_FILE,\n\t\t\tenv.AWS_ACCESS_KEY_ID,\n\t\t\tenv.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,\n\t\t\tenv.AWS_CONTAINER_CREDENTIALS_FULL_URI,\n\t\t\t...stsEndpoint && stsEndpoint !== config.endpoint ? [stsEndpoint] : []\n\t\t]));\n\t\tconst cachePath = join(root, \"identities\", `${key}.json`);\n\t\tlet pending = this.#pending.get(key);\n\t\tif (!pending) {\n\t\t\tpending = this.lookup(env, config.region);\n\t\t\tthis.#pending.set(key, pending);\n\t\t}\n\t\tlet identity;\n\t\ttry {\n\t\t\tidentity = await pending;\n\t\t} catch (error) {\n\t\t\tlet cached = selection.readOnly ? this.#known.get(cachePath) : void 0;\n\t\t\tif (selection.readOnly && !cached) try {\n\t\t\t\tcached = JSON.parse(readFileSync(cachePath, \"utf8\"));\n\t\t\t} catch {}\n\t\t\tif (!cached || !valid(cached) || config.region && cached.region !== config.region) throw error;\n\t\t\tidentity = cached;\n\t\t} finally {\n\t\t\tthis.#pending.delete(key);\n\t\t}\n\t\tif (!valid(identity) || config.region && config.region !== identity.region) throw new Error(\"AWS did not return a valid archive account and region\");\n\t\tthis.#known.set(cachePath, identity);\n\t\ttry {\n\t\t\tmkdirSync(dirname(cachePath), { recursive: true });\n\t\t\tconst temporary = `${cachePath}.${randomUUID()}.tmp`;\n\t\t\twriteFileSync(temporary, JSON.stringify(identity), { mode: 384 });\n\t\t\trenameSync(temporary, cachePath);\n\t\t} catch {}\n\t\tconst namespace = config.endpoint ? join(\"endpoints\", hash(config.endpoint)) : \"\";\n\t\treturn join(root, namespace, identity.account, identity.region, \"archive.duckdb\");\n\t}\n};\n//#endregion\n//#region src/lib/server/archive-sql.ts\n/**\n* SQL and row mapping for the local DuckDB archive.\n*\n* DuckDB is a native dependency and is loaded lazily by `archive.ts`; everything\n* in this file is plain text and pure functions so the archive can be unit\n* tested without the driver. Column order matters: {@link ARCHIVE_INSERT_COLUMNS}\n* is the contract with {@link toArchiveParams}, and the `SELECT` in\n* {@link buildPageQuery} uses the same names as {@link rowsToPage}.\n*\n* `level` and `request_id` are both derived from the message on the way in, and\n* both may be NULL in an archive written by an older build. NULL does not mean\n* the same thing for the two columns: for `level` it is a verdict (\"this line\n* carries no level\"), while for `request_id` it means \"not looked at yet\", since\n* the client can still detect an id in the message it renders. {@link rowsToPage}\n* and the request-id backfill below are written from that difference.\n*/\n/**\n* Statements that bring a database file up to the current schema.\n*\n* Every statement is idempotent so an existing archive can be opened by a newer\n* build without a migration step. `seq` orders events by arrival, which keeps\n* paging stable when many events share a millisecond timestamp.\n*/\nvar ARCHIVE_SCHEMA = [\n\t`CREATE SEQUENCE IF NOT EXISTS log_events_seq`,\n\t`CREATE TABLE IF NOT EXISTS log_events (\n\t\tregion VARCHAR NOT NULL,\n\t\tlog_group VARCHAR NOT NULL,\n\t\tlog_stream VARCHAR,\n\t\tevent_key VARCHAR NOT NULL,\n\t\tevent_id VARCHAR,\n\t\ttimestamp_ms BIGINT NOT NULL,\n\t\tingestion_time_ms BIGINT,\n\t\tmessage VARCHAR NOT NULL,\n\t\tlevel VARCHAR,\n\t\tlevel_source VARCHAR,\n\t\trequest_id VARCHAR,\n\t\tseq BIGINT NOT NULL DEFAULT nextval('log_events_seq'),\n\t\tarchived_at TIMESTAMP NOT NULL DEFAULT now()\n\t)`,\n\t`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS level VARCHAR`,\n\t`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS level_source VARCHAR`,\n\t`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS request_id VARCHAR`,\n\t`CREATE TABLE IF NOT EXISTS archive_meta (key VARCHAR PRIMARY KEY, value VARCHAR)`,\n\t`CREATE UNIQUE INDEX IF NOT EXISTS log_events_unique ON log_events (region, log_group, event_key)`,\n\t`CREATE INDEX IF NOT EXISTS log_events_time ON log_events (region, log_group, timestamp_ms)`\n];\n/** Columns written by {@link buildInsertSql}, in binding order. */\nvar ARCHIVE_INSERT_COLUMNS = [\n\t\"region\",\n\t\"log_group\",\n\t\"log_stream\",\n\t\"event_key\",\n\t\"event_id\",\n\t\"timestamp_ms\",\n\t\"ingestion_time_ms\",\n\t\"message\",\n\t\"level\",\n\t\"level_source\",\n\t\"request_id\"\n];\n/** Escape character used with `LIKE`/`ILIKE` so user input cannot inject wildcards. */\nvar LIKE_ESCAPE = \"\\\\\";\n/**\n* Stable identity of an event inside one log group.\n*\n* CloudWatch event ids are unique per log group and are reused as the key;\n* events without an id (floci and LocalStack omit them) get a deterministic\n* hash of timestamp, stream and message, so re-scanning the same window is\n* idempotent instead of duplicating rows.\n*/\nfunction archiveEventKey(event) {\n\tif (event.id !== null && event.id.length > 0) return event.id;\n\treturn `h:${createHash(\"sha256\").update(`${event.timestamp}\\u0000${event.streamName ?? \"\"}\\u0000${event.message}`).digest(\"hex\").slice(0, 32)}`;\n}\n/** Renders `count` placeholder rows, one group of columns per row. */\nfunction placeholderRows(count) {\n\tconst row = `(${ARCHIVE_INSERT_COLUMNS.map(() => \"?\").join(\", \")})`;\n\treturn Array.from({ length: count }, () => row).join(\", \");\n}\n/**\n* Builds a multi-row `INSERT OR IGNORE`, so events already archived are skipped\n* by the unique index instead of raising.\n*/\nfunction buildInsertSql(rowCount) {\n\tif (!Number.isInteger(rowCount) || rowCount < 1) throw new RangeError(`rowCount must be a positive integer, received ${String(rowCount)}`);\n\treturn `INSERT OR IGNORE INTO log_events (${ARCHIVE_INSERT_COLUMNS.join(\", \")}) VALUES ${placeholderRows(rowCount)}`;\n}\n/**\n* Flattens events into the parameter list {@link buildInsertSql} expects.\n*\n* The request id is detected here, exactly like the level, so the archive holds\n* what a reader of the line would see rather than whatever a writer claimed.\n*/\nfunction toArchiveParams(region, logGroup, events) {\n\tconst params = [];\n\tfor (const event of events) {\n\t\tconst detected = detectLevelWithSource(event.message);\n\t\tparams.push(region, logGroup, event.streamName ?? null, archiveEventKey(event), event.id ?? null, BigInt(Math.round(event.timestamp)), event.ingestionTime === void 0 ? null : BigInt(Math.round(event.ingestionTime)), event.message, detected.level, detected.source, detectRequestId(event.message));\n\t}\n\treturn params;\n}\n/** Column list shared by {@link buildPageQuery} and {@link rowsToPage}. */\nvar PAGE_COLUMNS = `region, log_group, log_stream, event_key, event_id, timestamp_ms, ingestion_time_ms, message, level, level_source, request_id, seq`;\n/** Escapes `LIKE` metacharacters so a search term is matched literally. */\nfunction escapeLike(value) {\n\treturn value.replace(/[\\\\%_]/g, (match) => `${LIKE_ESCAPE}${match}`);\n}\n/**\n* Builds one keyset page of archived events.\n*\n* Ordering is `(timestamp_ms, seq)`, and the cursor compares the same tuple, so\n* pages never repeat or skip a row even when thousands of events share a\n* timestamp.\n*/\nfunction buildPageQuery(request) {\n\tconst limit = Math.max(1, Math.round(request.limit));\n\tconst groups = request.logGroups.length > 0 ? request.logGroups : [\"\"];\n\tconst where = [\n\t\t\"region = ?\",\n\t\t`log_group IN (${groups.map(() => \"?\").join(\", \")})`,\n\t\t\"timestamp_ms >= ?\",\n\t\t\"timestamp_ms <= ?\"\n\t];\n\tconst params = [\n\t\trequest.region,\n\t\t...groups,\n\t\tBigInt(Math.round(request.startTime)),\n\t\tBigInt(Math.round(request.endTime))\n\t];\n\tconst search = request.search?.trim() ?? \"\";\n\tif (search.length > 0) {\n\t\twhere.push(`message ILIKE ? ESCAPE '${LIKE_ESCAPE}'`);\n\t\tparams.push(`%${escapeLike(search)}%`);\n\t}\n\tconst prefix = request.streamPrefix?.trim() ?? \"\";\n\tif (prefix.length > 0) {\n\t\twhere.push(`log_stream LIKE ? ESCAPE '${LIKE_ESCAPE}'`);\n\t\tparams.push(`${escapeLike(prefix)}%`);\n\t}\n\tconst levels = request.levels ?? [];\n\tif (levels.length > 0) {\n\t\twhere.push(`level IN (${levels.map(() => \"?\").join(\", \")})`);\n\t\tparams.push(...levels);\n\t}\n\tconst after = request.after ?? null;\n\tif (after !== null) {\n\t\twhere.push(\"(timestamp_ms > ? OR (timestamp_ms = ? AND seq > ?))\");\n\t\tparams.push(BigInt(Math.round(after.timestamp)), BigInt(Math.round(after.timestamp)), BigInt(Math.round(after.seq)));\n\t}\n\tparams.push(BigInt(limit));\n\treturn {\n\t\tsql: `SELECT ${PAGE_COLUMNS} FROM log_events WHERE ${where.join(\" AND \")} ORDER BY timestamp_ms, seq LIMIT ?`,\n\t\tparams\n\t};\n}\n/** Converts a DuckDB value (which may be a bigint) into a JS number. */\nfunction toNumber(value) {\n\tif (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n\tif (typeof value === \"bigint\") return Number(value);\n\tif (typeof value === \"string\" && value.trim().length > 0) {\n\t\tconst parsed = Number(value);\n\t\treturn Number.isFinite(parsed) ? parsed : null;\n\t}\n\treturn null;\n}\n/** Converts a nullable DuckDB string column into `string` or `null`. */\nfunction toNullableString(value) {\n\tif (typeof value === \"string\") return value.length > 0 ? value : null;\n\treturn null;\n}\n/** Reads one column from a row object, tolerating case differences. */\nfunction pick(row, column) {\n\tif (column in row) return row[column];\n\tconst upper = column.toUpperCase();\n\tif (upper in row) return row[upper];\n}\n/**\n* Maps query rows onto wire events plus the cursor of the last row.\n*\n* Rows without a usable timestamp are dropped rather than rendered as 1970.\n*/\nfunction rowsToPage(rows) {\n\tconst events = [];\n\tlet last = null;\n\tfor (const row of rows) {\n\t\tconst timestamp = toNumber(pick(row, \"timestamp_ms\"));\n\t\tconst seq = toNumber(pick(row, \"seq\"));\n\t\tif (timestamp === null || seq === null) continue;\n\t\tconst rawLevel = pick(row, \"level\");\n\t\tconst group = toNullableString(pick(row, \"log_group\"));\n\t\tconst event = {\n\t\t\tid: toNullableString(pick(row, \"event_key\")),\n\t\t\ttimestamp,\n\t\t\tmessage: typeof pick(row, \"message\") === \"string\" ? pick(row, \"message\") : \"\",\n\t\t\tlevel: isLogLevel(rawLevel) ? rawLevel : null\n\t\t};\n\t\tif (group !== null) event.group = group;\n\t\tconst requestId = toNullableString(pick(row, \"request_id\"));\n\t\tif (requestId !== null) event.requestId = requestId;\n\t\tconst streamName = toNullableString(pick(row, \"log_stream\"));\n\t\tif (streamName !== null) event.streamName = streamName;\n\t\tconst ingestionTime = toNumber(pick(row, \"ingestion_time_ms\"));\n\t\tif (ingestionTime !== null) event.ingestionTime = ingestionTime;\n\t\tevents.push(event);\n\t\tlast = {\n\t\t\ttimestamp,\n\t\t\tseq\n\t\t};\n\t}\n\treturn {\n\t\tevents,\n\t\tlast\n\t};\n}\n/** Aggregate query behind {@link ArchiveTotals}. */\nvar ARCHIVE_TOTALS_SQL = `SELECT count(*) AS rows, count(DISTINCT log_group) AS groups, count(DISTINCT region) AS regions, min(timestamp_ms) AS oldest, max(timestamp_ms) AS newest FROM log_events`;\n/** Log groups held by the archive, optionally limited to one region. */\nfunction buildGroupsQuery(region) {\n\tconst where = region === null || region.length === 0 ? \"\" : \"WHERE region = ?\";\n\treturn {\n\t\tsql: `SELECT region, log_group, count(*) AS events, min(timestamp_ms) AS oldest, max(timestamp_ms) AS newest FROM log_events ${where} GROUP BY region, log_group ORDER BY region, log_group`,\n\t\tparams: where === \"\" ? [] : [region]\n\t};\n}\n/** Maps the single row of {@link ARCHIVE_TOTALS_SQL}. */\nfunction rowToTotals(row) {\n\tif (row === void 0) return {\n\t\trows: 0,\n\t\tgroups: 0,\n\t\tregions: 0,\n\t\toldest: null,\n\t\tnewest: null\n\t};\n\treturn {\n\t\trows: toNumber(pick(row, \"rows\")) ?? 0,\n\t\tgroups: toNumber(pick(row, \"groups\")) ?? 0,\n\t\tregions: toNumber(pick(row, \"regions\")) ?? 0,\n\t\toldest: toNumber(pick(row, \"oldest\")),\n\t\tnewest: toNumber(pick(row, \"newest\"))\n\t};\n}\n/** Maps the rows of {@link buildGroupsQuery}. */\nfunction rowsToGroups(rows) {\n\tconst groups = [];\n\tfor (const row of rows) {\n\t\tconst region = pick(row, \"region\");\n\t\tconst logGroup = pick(row, \"log_group\");\n\t\tif (typeof region !== \"string\" || typeof logGroup !== \"string\") continue;\n\t\tgroups.push({\n\t\t\tregion,\n\t\t\tlogGroup,\n\t\t\tevents: toNumber(pick(row, \"events\")) ?? 0,\n\t\t\toldest: toNumber(pick(row, \"oldest\")),\n\t\t\tnewest: toNumber(pick(row, \"newest\"))\n\t\t});\n\t}\n\treturn groups;\n}\n/**\n* Row budget of one request-id backfill pass.\n*\n* The pass runs on every open, so it has to stay cheap. 20000 messages is a\n* fraction of a second of regex work, and an archive with more than that scans\n* the rest on the next open, because the watermark moves.\n*/\nvar REQUEST_ID_BACKFILL_LIMIT = 2e4;\n/** `archive_meta` key holding the request-id backfill watermark. */\nvar REQUEST_ID_BACKFILL_KEY = \"request_id_backfill\";\n/** Highest `seq` in the archive: the ceiling of a backfill pass. */\nvar ARCHIVE_MAX_SEQ_SQL = `SELECT max(seq) AS maxSeq FROM log_events`;\n/** Reads the single row of {@link ARCHIVE_MAX_SEQ_SQL}; `null` for an empty archive. */\nfunction rowToMaxSeq(row) {\n\treturn row === void 0 ? null : toNumber(pick(row, \"maxSeq\"));\n}\n/** Statement that reads the backfill watermark; no row means it never ran. */\nfunction buildRequestIdBackfillStateQuery() {\n\treturn `SELECT value FROM archive_meta WHERE key = '${REQUEST_ID_BACKFILL_KEY}'`;\n}\n/** Statement that stores the backfill watermark, which is the highest scanned `seq`. */\nfunction buildRequestIdBackfillStateWrite() {\n\treturn `INSERT OR REPLACE INTO archive_meta (key, value) VALUES ('${REQUEST_ID_BACKFILL_KEY}', ?)`;\n}\n/** Reads the watermark row; an absent row or junk means \"scan from the start\". */\nfunction rowToBackfillWatermark(row) {\n\tconst value = row === void 0 ? null : toNumber(pick(row, \"value\"));\n\treturn value === null || value < 0 ? null : value;\n}\n/**\n* Builds the scan that finds rows archived before `request_id` existed.\n*\n* `seq` is selected although the update does not need it: the caller stores\n* where the pass stopped. `afterSeq` skips the range a previous pass already\n* looked at, which is what lets a capped pass resume - a message with no request\n* id stays NULL for ever, so without the lower bound every pass would start on\n* the same id-less rows and never reach the rows above them.\n*/\nfunction buildRequestIdBackfillQuery(request) {\n\tconst limit = Math.max(1, Math.round(request.limit));\n\tconst scanned = request.afterSeq ?? 0;\n\tconst after = scanned > 0 ? \" AND seq > ?\" : \"\";\n\tconst params = [BigInt(Math.round(request.maxSeq))];\n\tif (scanned > 0) params.push(BigInt(Math.round(scanned)));\n\tparams.push(BigInt(limit));\n\treturn {\n\t\tsql: `SELECT event_key, log_group, region, message, seq FROM log_events WHERE seq <= ?${after} AND request_id IS NULL ORDER BY seq LIMIT ?`,\n\t\tparams\n\t};\n}\n/** Maps the rows of {@link buildRequestIdBackfillQuery}, dropping unusable ones. */\nfunction rowsToBackfillCandidates(rows) {\n\tconst candidates = [];\n\tfor (const row of rows) {\n\t\tconst seq = toNumber(pick(row, \"seq\"));\n\t\tconst region = pick(row, \"region\");\n\t\tconst logGroup = pick(row, \"log_group\");\n\t\tconst eventKey = pick(row, \"event_key\");\n\t\tconst message = pick(row, \"message\");\n\t\tif (seq === null || typeof region !== \"string\" || typeof logGroup !== \"string\" || typeof eventKey !== \"string\" || typeof message !== \"string\") continue;\n\t\tcandidates.push({\n\t\t\tseq,\n\t\t\tregion,\n\t\t\tlogGroup,\n\t\t\teventKey,\n\t\t\tmessage\n\t\t});\n\t}\n\treturn candidates;\n}\n/** Highest `seq` of a scanned set, or `null` when nothing was scanned. */\nfunction maxSeqOf(candidates) {\n\tlet highest = null;\n\tfor (const candidate of candidates) if (highest === null || candidate.seq > highest) highest = candidate.seq;\n\treturn highest;\n}\n/**\n* Detects the request id of every candidate.\n*\n* A message that yields no id is dropped rather than written as an empty string:\n* it is a finished row, not a failure, and the watermark moves past it so it is\n* never looked at again.\n*/\nfunction planRequestIdBackfill(candidates) {\n\tconst updates = [];\n\tfor (const candidate of candidates) {\n\t\tconst requestId = detectRequestId(candidate.message);\n\t\tif (requestId === null) continue;\n\t\tupdates.push({\n\t\t\tregion: candidate.region,\n\t\t\tlogGroup: candidate.logGroup,\n\t\t\teventKey: candidate.eventKey,\n\t\t\trequestId\n\t\t});\n\t}\n\treturn updates;\n}\n/**\n* Builds one `UPDATE ... FROM (VALUES ...)` that writes many ids at once.\n*\n* One statement per chunk instead of one per row keeps a 20000-row pass down to\n* a handful of statements, and the predicate is an exact row match on the unique\n* index (`region`, `log_group`, `event_key`).\n*/\nfunction buildRequestIdBackfillUpdate(rowCount) {\n\tif (!Number.isInteger(rowCount) || rowCount < 1) throw new RangeError(`rowCount must be a positive integer, received ${String(rowCount)}`);\n\treturn `UPDATE log_events SET request_id = v.request_id FROM (VALUES ${Array.from({ length: rowCount }, () => \"(?, ?, ?, ?)\").join(\", \")}) AS v(region, log_group, event_key, request_id) WHERE log_events.region = v.region AND log_events.log_group = v.log_group AND log_events.event_key = v.event_key`;\n}\n/** Flattens updates into the parameter list {@link buildRequestIdBackfillUpdate} expects. */\nfunction toRequestIdBackfillParams(updates) {\n\tconst params = [];\n\tfor (const update of updates) params.push(update.region, update.logGroup, update.eventKey, update.requestId);\n\treturn params;\n}\n/** Levels and their rank, highest first; `unknown` is left to the `ELSE` branch. */\nfunction rankArms() {\n\treturn Object.entries(LEVEL_RANK).filter(([level]) => level !== \"unknown\");\n}\n/**\n* SQL `CASE` that turns a level into its severity rank.\n*\n* Generated from {@link LEVEL_RANK} so the ranks have one source of truth: the\n* statement and the UI cannot disagree about which level is worse.\n*/\nfunction levelRankCase(expression) {\n\treturn `CASE ${expression} ${rankArms().map(([level, rank]) => `WHEN '${level}' THEN ${rank}`).join(\" \")} ELSE ${LEVEL_RANK.unknown} END`;\n}\n/** SQL `CASE` that turns a severity rank back into a level name. */\nfunction levelNameCase(expression) {\n\treturn `CASE ${expression} ${rankArms().map(([level, rank]) => `WHEN ${rank} THEN '${level}'`).join(\" \")} ELSE 'unknown' END`;\n}\n/** The `WHERE` clause both series forms share: one region, one window, one or more groups. */\nfunction seriesScope(request, groups) {\n\treturn {\n\t\twhere: [\n\t\t\t\"region = ?\",\n\t\t\t`log_group IN (${groups.map(() => \"?\").join(\", \")})`,\n\t\t\t\"timestamp_ms >= ?\",\n\t\t\t\"timestamp_ms <= ?\"\n\t\t],\n\t\tparams: [\n\t\t\trequest.region,\n\t\t\t...groups,\n\t\t\tBigInt(Math.round(request.startTime)),\n\t\t\tBigInt(Math.round(request.endTime))\n\t\t]\n\t};\n}\n/**\n* Builds the bucketed counts behind the chart.\n*\n* One statement returns every series. The bucket is plain integer arithmetic on\n* `timestamp_ms`, so it cannot drift with a time zone; NULL levels are reported\n* as `unknown` rather than dropped; and a level filter matches only rows that\n* carry one of the requested levels.\n*\n* `by: 'request'` selects the request form below; `by: 'event'` (the default)\n* keeps the event form unchanged.\n*/\nfunction buildSeriesQuery(request) {\n\tconst bucketMs = Math.max(1, Math.round(request.bucketMs));\n\tconst scope = seriesScope(request, request.logGroups.length > 0 ? request.logGroups : [\"\"]);\n\tif (request.metric === \"duration\") return buildDurationSeriesQuery(request, scope.where, scope.params);\n\tif (request.by === \"request\") return buildRequestSeriesQuery(request, bucketMs, scope.where, scope.params);\n\tconst params = [\n\t\tBigInt(bucketMs),\n\t\tBigInt(bucketMs),\n\t\t...scope.params\n\t];\n\tconst where = scope.where.slice();\n\tconst levels = request.levels ?? [];\n\tif (levels.length > 0) {\n\t\twhere.push(`level IN (${levels.map(() => \"?\").join(\", \")})`);\n\t\tparams.push(...levels);\n\t}\n\treturn {\n\t\tsql: `SELECT CAST(floor(timestamp_ms / ?) * ? AS BIGINT) AS bucket, log_group, coalesce(level, 'unknown') AS level, count(*) AS events FROM log_events WHERE ${where.join(\" AND \")} GROUP BY bucket, log_group, level ORDER BY bucket, log_group, level`,\n\t\tparams\n\t};\n}\n/**\n* Builds the request form: one mark per request instead of one per line.\n*\n* `coalesce(request_id, event_key)` makes a line with no request id a request of\n* its own, so no line is dropped. A request is placed at its FIRST line\n* (`min(timestamp_ms)`) and counted once, and it takes the WORST level of its\n* lines (`max` of the ranks). A level filter selects on that same worst level in\n* the `HAVING`: asking for errors keeps every request that logged one, whatever\n* else it logged, and drops the requests that stayed below it.\n*\n* BIND ORDER: DuckDB binds `?` positionally in statement text order, and the CTE\n* comes first, so the parameters are the scope ones, then one rank per requested\n* level (the RANKS, not the level names), and the bucket width LAST - the\n* opposite of the event form above.\n*/\nfunction buildRequestSeriesQuery(request, bucketMs, where, scopeParams) {\n\tconst levels = request.levels ?? [];\n\tconst having = levels.length > 0 ? ` HAVING level_rank IN (${levels.map(() => \"?\").join(\", \")})` : \"\";\n\tconst params = [\n\t\t...scopeParams,\n\t\t...levels.map((level) => LEVEL_RANK[level]),\n\t\tBigInt(bucketMs),\n\t\tBigInt(bucketMs)\n\t];\n\treturn {\n\t\tsql: [\n\t\t\t\"WITH requests AS (\",\n\t\t\t`SELECT coalesce(request_id, event_key) AS request_key, log_group, min(timestamp_ms) AS start_ms, max(${levelRankCase(`coalesce(level, 'unknown')`)}) AS level_rank`,\n\t\t\t`FROM log_events WHERE ${where.join(\" AND \")}`,\n\t\t\t`GROUP BY request_key, log_group${having})`,\n\t\t\t`SELECT CAST(floor(start_ms / ?) * ? AS BIGINT) AS bucket, log_group, ${levelNameCase(\"level_rank\")} AS level, count(*) AS events`,\n\t\t\t\"FROM requests GROUP BY bucket, log_group, level ORDER BY bucket, log_group, level\"\n\t\t].join(\" \"),\n\t\tparams\n\t};\n}\n/** Duration points are not bucketed: one point at each request's first observed timestamp. */\nfunction buildDurationSeriesQuery(request, where, scopeParams) {\n\tconst levels = request.levels ?? [];\n\tconst having = levels.length ? ` HAVING level_rank IN (${levels.map(() => \"?\").join(\", \")})` : \"\";\n\treturn {\n\t\tsql: `WITH requests AS (\n\t\t\tSELECT request_id, log_group, min(timestamp_ms) AS start_ms,\n\t\t\tmax(timestamp_ms) - min(timestamp_ms) AS duration_ms,\n\t\t\tfirst(message ORDER BY timestamp_ms DESC, seq DESC) AS last_message,\n\t\t\tmax(${levelRankCase(\"coalesce(level, 'unknown')\")}) AS level_rank\n\t\t\tFROM log_events WHERE ${where.join(\" AND \")} AND request_id IS NOT NULL AND request_id <> ''\n\t\t\tGROUP BY request_id, log_group${having})\n\t\t\tSELECT start_ms AS bucket, log_group, ${levelNameCase(\"level_rank\")} AS level,\n\t\t\t1 AS events, request_id, duration_ms, last_message FROM requests ORDER BY bucket, log_group, request_id`,\n\t\tparams: [...scopeParams, ...levels.map((level) => LEVEL_RANK[level])]\n\t};\n}\n/** Maps the rows of {@link buildSeriesQuery} onto chart points. */\nfunction rowsToSeries(rows) {\n\tconst points = [];\n\tfor (const row of rows) {\n\t\tconst t = toNumber(pick(row, \"bucket\"));\n\t\tconst group = pick(row, \"log_group\");\n\t\tconst level = pick(row, \"level\");\n\t\tif (t === null || typeof group !== \"string\") continue;\n\t\tpoints.push({\n\t\t\tt,\n\t\t\tgroup,\n\t\t\tlevel: typeof level === \"string\" && level.length > 0 ? level : \"unknown\",\n\t\t\tevents: toNumber(pick(row, \"events\")) ?? 0,\n\t\t\t...typeof row.request_id === \"string\" ? {\n\t\t\t\trequestId: row.request_id,\n\t\t\t\tdurationMs: (toNumber(row.duration_ms) ?? 0) + eventDurationMs(typeof row.last_message === \"string\" ? row.last_message : \"\")\n\t\t\t} : {}\n\t\t});\n\t}\n\treturn points;\n}\n//#endregion\n//#region src/lib/server/archive.ts\n/**\n* Local DuckDB archive of the events the app has streamed.\n*\n* The driver (`@duckdb/node-api` plus its per-platform native binding) is an\n* optional dependency: it is imported lazily, on the first request that needs\n* it, and every failure is turned into an unavailable archive instead of an\n* error. The rest of the app therefore works unchanged on platforms where the\n* binding is missing.\n*\n* One process owns the file: DuckDB allows a single writer, and the SvelteKit\n* server is that writer. Statements are serialised through an internal queue so\n* a stream writing while another request reads cannot interleave on the\n* connection.\n*/\n/** Package name of the optional DuckDB driver. */\nvar DUCKDB_MODULE = \"@duckdb/node-api\";\n/** Directory name used under the platform data directory. */\nvar ARCHIVE_DIR_NAME = \"watch-tail\";\n/** File name of the archive inside {@link ARCHIVE_DIR_NAME}. */\nvar ARCHIVE_FILE_NAME = \"archive.duckdb\";\n/**\n* Imports the optional DuckDB driver.\n*\n* The specifier is held in a variable on purpose: bundlers must leave the\n* import alone so Node resolves it at run time, where a missing binding can be\n* reported as an unavailable archive rather than a build error.\n*/\nasync function loadDuckDbDriver() {\n\tconst loaded = await import(DUCKDB_MODULE);\n\tif (typeof loaded.DuckDBInstance?.create !== \"function\") throw new Error(`${DUCKDB_MODULE} did not expose DuckDBInstance.create`);\n\treturn loaded;\n}\nvar DISABLED_VALUES = /* @__PURE__ */ new Set([\n\t\"0\",\n\t\"false\",\n\t\"no\",\n\t\"off\"\n]);\n/** True when an environment value means \"off\". */\nfunction isDisabled(value) {\n\treturn value !== void 0 && DISABLED_VALUES.has(value.trim().toLowerCase());\n}\n/**\n* True when this process is a test runner.\n*\n* Vitest sets `VITEST`, and `NODE_ENV=test` covers other harnesses. Tests must\n* not append to the archive of the machine they run on, so the archive is off\n* unless a test asks for it through `WATCH_TAIL_ARCHIVE_DB` or\n* `WATCH_TAIL_ARCHIVE=on`.\n*/\nfunction isTestProcess(env) {\n\treturn env.VITEST !== void 0 || env.NODE_ENV === \"test\";\n}\n/**\n* Resolves the archive file path.\n*\n* `WATCH_TAIL_ARCHIVE_DB` wins; otherwise the file lives in the platform's\n* data directory (`XDG_DATA_HOME`, `%LOCALAPPDATA%` or\n* `~/Library/Application Support`), never in the current directory, so history\n* survives running the CLI from a different folder.\n*/\nfunction resolveArchiveConfig(env, platform = process.platform, home = homedir()) {\n\tconst path = env.WATCH_TAIL_ARCHIVE_DB?.trim() ?? \"\";\n\tconst dataDir = env.XDG_DATA_HOME?.trim() ?? (platform === \"darwin\" ? join(home, \"Library\", \"Application Support\") : platform === \"win32\" ? env.LOCALAPPDATA?.trim() ?? join(home, \"AppData\", \"Local\") : join(home, \".local\", \"share\"));\n\tconst requested = env.WATCH_TAIL_ARCHIVE?.trim() ?? \"\";\n\treturn {\n\t\tenabled: isDisabled(requested) ? false : path.length > 0 || requested.length > 0 ? true : !isTestProcess(env),\n\t\tpath: path.length > 0 ? path : join(dataDir, ARCHIVE_DIR_NAME, ARCHIVE_FILE_NAME)\n\t};\n}\n/**\n* A short, non-throwing description of an unknown failure.\n*\n* A conflicting lock is the one failure a user can act on, and DuckDB's own\n* message buries the reason in a pid and a documentation link, so it is\n* reported as what it means for this app.\n*/\nfunction describeOpenError(error, path) {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tif (/Could not set lock|Conflicting lock/i.test(message)) return `the archive file ${path} is locked by another process (another watch-tail is using it); use --db to keep a separate file`;\n\treturn message;\n}\n/** True when the failure is the exclusive file lock. */\nfunction isLockError(error) {\n\tconst message = error instanceof Error ? error.message : String(error);\n\treturn /Could not set lock|Conflicting lock/i.test(message);\n}\n/**\n* One DuckDB file holding every event the app has streamed.\n*\n* `open` never throws: a missing driver, a locked file or a corrupt database all\n* produce an instance with `available === false` and the reason on `error`. The\n* read and write methods then behave as no-ops, so callers never have to guard\n* their happy path.\n*/\nvar LogArchive = class LogArchive {\n\t/** Database file this archive uses. */\n\tpath;\n\t#connection = null;\n\t#available = false;\n\t#error = null;\n\t#queue = Promise.resolve();\n\tconstructor(path) {\n\t\tthis.path = path;\n\t}\n\t/**\n\t* Opens (and creates) the archive.\n\t*\n\t* Statements are executed in order: the sequence first, then the table, then\n\t* the indexes, so an existing file from an older build is upgraded in place.\n\t* The request-id backfill runs last, inside the same serialised path, and\n\t* cannot fail the open.\n\t*/\n\tstatic async open(options) {\n\t\tconst archive = new LogArchive(options.path);\n\t\tconst load = options.load ?? loadDuckDbDriver;\n\t\tconst ensureDir = options.ensureDir ?? ((dir) => mkdirSync(dir, { recursive: true }));\n\t\ttry {\n\t\t\tensureDir(dirname(options.path));\n\t\t\tconst driver = await load();\n\t\t\tfor (let attempt = 1;; attempt += 1) try {\n\t\t\t\tconst connection = await (await driver.DuckDBInstance.create(options.path)).connect();\n\t\t\t\tfor (const statement of ARCHIVE_SCHEMA) await connection.run(statement);\n\t\t\t\tarchive.#connection = connection;\n\t\t\t\tarchive.#available = true;\n\t\t\t\tawait archive.#backfillRequestIds();\n\t\t\t\tbreak;\n\t\t\t} catch (error) {\n\t\t\t\tif (attempt >= 3 || !isLockError(error)) throw error;\n\t\t\t\tawait setTimeout(150);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tarchive.#available = false;\n\t\t\tarchive.#error = describeOpenError(error, options.path);\n\t\t}\n\t\treturn archive;\n\t}\n\t/**\n\t* An archive that is off by configuration or could not be opened.\n\t*\n\t* Every method degrades to a no-op, so callers can use one code path for\n\t* \"no DuckDB on this machine\" and \"the user asked for no archive\".\n\t*/\n\tstatic unavailable(path, error = null) {\n\t\tconst archive = new LogArchive(path);\n\t\tarchive.#available = false;\n\t\tarchive.#error = error;\n\t\treturn archive;\n\t}\n\t/** True when the archive can be read and written. */\n\tget available() {\n\t\treturn this.#available;\n\t}\n\t/** Why the archive is unavailable, or the last failure, or `null`. */\n\tget error() {\n\t\treturn this.#error;\n\t}\n\t/** Runs one task after every task queued before it. */\n\t#enqueue(task) {\n\t\tconst next = this.#queue.then(task, task);\n\t\tthis.#queue = next.then(() => void 0, () => void 0);\n\t\treturn next;\n\t}\n\t/** Runs a statement, returning the failure instead of throwing. */\n\tasync #guard(fallback, task) {\n\t\tif (this.#connection === null) return fallback;\n\t\treturn this.#enqueue(async () => {\n\t\t\ttry {\n\t\t\t\treturn await task();\n\t\t\t} catch (error) {\n\t\t\t\tthis.#error = error instanceof Error ? error.message : String(error);\n\t\t\t\treturn fallback;\n\t\t\t}\n\t\t});\n\t}\n\t/**\n\t* Migrates the request id of rows written before the column existed.\n\t*\n\t* It runs inside {@link LogArchive.#guard}, so it shares the serialised\n\t* statement queue with every other write and reports a failure on `error`\n\t* instead of letting it escape `open`. The watermark is the highest `seq` the\n\t* migration has looked at, so a capped or interrupted pass carries on from\n\t* there on the next open and no row is scanned twice; a row whose message\n\t* holds no id stays NULL, which is the archive's answer for that row.\n\t*/\n\tasync #backfillRequestIds() {\n\t\tawait this.#guard(void 0, async () => {\n\t\t\tconst connection = this.#connection;\n\t\t\tif (connection === null) return;\n\t\t\tconst ceiling = rowToMaxSeq((await connection.runAndReadAll(ARCHIVE_MAX_SEQ_SQL)).getRowObjects()[0]);\n\t\t\tif (ceiling === null) return;\n\t\t\tconst watermark = rowToBackfillWatermark((await connection.runAndReadAll(buildRequestIdBackfillStateQuery())).getRowObjects()[0]);\n\t\t\tif (watermark !== null && watermark >= ceiling) return;\n\t\t\tconst { sql, params } = buildRequestIdBackfillQuery({\n\t\t\t\tmaxSeq: ceiling,\n\t\t\t\tafterSeq: watermark,\n\t\t\t\tlimit: REQUEST_ID_BACKFILL_LIMIT\n\t\t\t});\n\t\t\tconst candidates = rowsToBackfillCandidates((await connection.runAndReadAll(sql, params)).getRowObjects());\n\t\t\tconst updates = planRequestIdBackfill(candidates);\n\t\t\tfor (let start = 0; start < updates.length; start += 500) {\n\t\t\t\tconst chunk = updates.slice(start, start + 500);\n\t\t\t\tawait connection.run(buildRequestIdBackfillUpdate(chunk.length), toRequestIdBackfillParams(chunk));\n\t\t\t}\n\t\t\tconst scanned = candidates.length < 2e4 ? ceiling : maxSeqOf(candidates);\n\t\t\tawait connection.run(buildRequestIdBackfillStateWrite(), [String(scanned ?? ceiling)]);\n\t\t});\n\t}\n\t/**\n\t* Writes one batch of streamed events.\n\t*\n\t* Batches are split into chunks of {@link ARCHIVE_INSERT_CHUNK} rows, and\n\t* `INSERT OR IGNORE` plus the unique index make a repeated scan idempotent.\n\t* Failures never propagate: a full disk must not interrupt a log stream.\n\t*/\n\tasync record(region, logGroup, events) {\n\t\tif (events.length === 0) return 0;\n\t\treturn this.#guard(0, async () => {\n\t\t\tconst connection = this.#connection;\n\t\t\tif (connection === null) return 0;\n\t\t\tlet written = 0;\n\t\t\tfor (let start = 0; start < events.length; start += 500) {\n\t\t\t\tconst chunk = events.slice(start, start + 500);\n\t\t\t\tawait connection.run(buildInsertSql(chunk.length), toArchiveParams(region, logGroup, chunk));\n\t\t\t\twritten += chunk.length;\n\t\t\t}\n\t\t\treturn written;\n\t\t});\n\t}\n\t/** Reads one page of archived events. */\n\tasync page(request) {\n\t\tconst empty = {\n\t\t\tevents: [],\n\t\t\tlast: null\n\t\t};\n\t\treturn this.#guard(empty, async () => {\n\t\t\tconst connection = this.#connection;\n\t\t\tif (connection === null) return empty;\n\t\t\tconst { sql, params } = buildPageQuery(request);\n\t\t\treturn rowsToPage((await connection.runAndReadAll(sql, params)).getRowObjects());\n\t\t});\n\t}\n\t/**\n\t* Bucketed counts for the chart, per group and level.\n\t*\n\t* The request is forwarded as it arrives: it carries the grouping that says\n\t* whether a mark counts an event or a request.\n\t*/\n\tasync seriesQuery(request) {\n\t\treturn this.#guard([], async () => {\n\t\t\tconst connection = this.#connection;\n\t\t\tif (connection === null) return [];\n\t\t\tconst { sql, params } = buildSeriesQuery(request);\n\t\t\treturn rowsToSeries((await connection.runAndReadAll(sql, params)).getRowObjects());\n\t\t});\n\t}\n\t/** Aggregate row count and time bounds. */\n\tasync totals() {\n\t\treturn this.#guard(rowToTotals(void 0), async () => {\n\t\t\tconst connection = this.#connection;\n\t\t\tif (connection === null) return rowToTotals(void 0);\n\t\t\treturn rowToTotals((await connection.runAndReadAll(ARCHIVE_TOTALS_SQL)).getRowObjects()[0]);\n\t\t});\n\t}\n\t/** Log groups held by the archive, optionally limited to one region. */\n\tasync groups(region = null) {\n\t\treturn this.#guard([], async () => {\n\t\t\tconst connection = this.#connection;\n\t\t\tif (connection === null) return [];\n\t\t\tconst { sql, params } = buildGroupsQuery(region);\n\t\t\treturn rowsToGroups((await connection.runAndReadAll(sql, params)).getRowObjects());\n\t\t});\n\t}\n\t/** Status for `GET /api/archive`, including the file size on disk. */\n\tasync status() {\n\t\tconst totals = await this.totals();\n\t\tlet bytes = null;\n\t\tif (this.#available) try {\n\t\t\tbytes = statSync(this.path).size;\n\t\t} catch {\n\t\t\tbytes = null;\n\t\t}\n\t\treturn {\n\t\t\tpath: this.path,\n\t\t\tavailable: this.#available,\n\t\t\terror: this.#error,\n\t\t\tbytes,\n\t\t\ttotals\n\t\t};\n\t}\n\t/** Closes the connection. Safe to call twice. */\n\tasync close() {\n\t\tconst connection = this.#connection;\n\t\tthis.#connection = null;\n\t\tthis.#available = false;\n\t\tif (connection?.closeSync === void 0) return;\n\t\tawait this.#enqueue(async () => {\n\t\t\tconnection.closeSync?.();\n\t\t});\n\t}\n};\n/** A single opening promise per absolute file path prevents duplicate DuckDB writers. */\nvar sharedArchives = /* @__PURE__ */ new Map();\nvar archiveLocator = new ArchiveLocator();\n/** Opens the selected account/region archive; explicit --db paths remain file overrides. */\nasync function getArchive(env, selection = {}, load) {\n\tconst config = resolveArchiveConfig(env);\n\tif (!config.enabled) return LogArchive.unavailable(config.path);\n\tlet path = config.path;\n\tif (!env.WATCH_TAIL_ARCHIVE_DB?.trim()) try {\n\t\tpath = await archiveLocator.locate(config.path, env, selection);\n\t} catch (error) {\n\t\treturn LogArchive.unavailable(config.path, `Cannot select account archive: ${error instanceof Error ? error.message : String(error)}`);\n\t}\n\tpath = resolve(path);\n\tlet archive = sharedArchives.get(path);\n\tif (!archive) {\n\t\tarchive = LogArchive.open({\n\t\t\tpath,\n\t\t\t...load === void 0 ? {} : { load }\n\t\t});\n\t\tsharedArchives.set(path, archive);\n\t}\n\treturn archive;\n}\n//#endregion\nexport { getArchive as t };\n"],"names":[],"mappings":";;;;;;;;;AAQA;AACA;AACA;AACA,eAAe,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE;AACrC,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACrE,CAAC,IAAI;AACL,EAAE,MAAM,eAAe,GAAG,MAAM,IAAI,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AAChE,EAAE,OAAO;AACT,GAAG,OAAO,EAAE,CAAC,MAAM,qBAAqB,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO;AAC/F,GAAG,MAAM,EAAE;AACX,GAAG;AACH,CAAC,CAAC,SAAS;AACX,EAAE,MAAM,CAAC,OAAO,EAAE;AAClB,CAAC;AACD;AACA,SAAS,IAAI,CAAC,KAAK,EAAE;AACrB,CAAC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;AACxD;AACA,SAAS,KAAK,CAAC,QAAQ,EAAE;AACzB,CAAC,OAAO,OAAO,QAAQ,EAAE,OAAO,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,IAAI,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE;AACtL;AACA;AACA,IAAI,cAAc,GAAG,MAAM;AAC3B,CAAC,MAAM;AACP,CAAC,QAAQ,m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ACxI,CAAC;AACD,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AACrB,CAAC,IAAI,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC;AACvC,CAAC,IAAI,CAAC,OAAO,EAAE;AACf,EAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC;AAC5B,GAAG,IAAI;AACP,GAAG,GAAqB,EAAE;AAC1B,GAAG,CAAC;AACJ,EAAE,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC;AACnC,CAAC;AACD,CAAC,OAAO,OAAO;AACf;;"}
@@ -1,6 +1,9 @@
1
+ import { b as private_env } from './shared-server.js-Dn5XheXH.js';
1
2
  import { j as json } from './utils.js-BIlHjgGW.js';
2
3
  import { CloudWatchLogsClient } from '@aws-sdk/client-cloudwatch-logs';
3
4
  import { STSClient } from '@aws-sdk/client-sts';
5
+ import { existsSync } from 'node:fs';
6
+ import { join } from 'node:path';
4
7
 
5
8
  //#region src/lib/server/api.ts
6
9
  /**
@@ -82,7 +85,7 @@ function hasAmbientCredentials(env) {
82
85
  return CREDENTIAL_ENV_KEYS.some((key) => normalize(env[key]) !== null);
83
86
  }
84
87
  /**
85
- * Resolves the region, endpoint, local flag and credential source for CloudWatch Logs.
88
+ * Resolves the region, endpoint, local flag and credential source for an AWS service.
86
89
  *
87
90
  * Region precedence: an explicit region parameter, then `AWS_REGION`, then
88
91
  * `AWS_DEFAULT_REGION`. When none of them is set the result is `null`, which
@@ -93,8 +96,8 @@ function hasAmbientCredentials(env) {
93
96
  * credential source is configured at all, in which case the emulator's
94
97
  * throwaway keys are used.
95
98
  */
96
- function resolveAwsConfig(env, regionParam) {
97
- const endpoint = normalize(env.AWS_ENDPOINT_URL_LOGS) ?? normalize(env.AWS_ENDPOINT_URL);
99
+ function resolveAwsConfig(env, regionParam, service = "logs") {
100
+ const endpoint = normalize(service === "sts" ? env.AWS_ENDPOINT_URL_STS : env.AWS_ENDPOINT_URL_LOGS) ?? normalize(env.AWS_ENDPOINT_URL);
98
101
  const region = normalize(regionParam) ?? normalize(env.AWS_REGION) ?? normalize(env.AWS_DEFAULT_REGION);
99
102
  const local = endpoint !== null && isLocalEndpoint(endpoint);
100
103
  return {
@@ -246,7 +249,7 @@ function describeAwsError(error) {
246
249
  };
247
250
  }
248
251
  /**
249
- * Creates an STS client with the same resolved settings as the Logs client.
252
+ * Creates an STS client with settings resolved for the STS service.
250
253
  *
251
254
  * Used for `GetCallerIdentity`, which answers the question the UI cannot: whose
252
255
  * credentials are these, if they work at all.
@@ -260,6 +263,60 @@ function createStsClient(config) {
260
263
  if (config.credentials === "emulator-default") options.credentials = EMULATOR_CREDENTIALS;
261
264
  return new STSClient(options);
262
265
  }
266
+ //#endregion
267
+ //#region src/lib/server/env.ts
268
+ /** Name of the git-ignored file that holds local (floci) connection settings. */
269
+ var LOCAL_ENV_FILE = ".env.local";
270
+ var localEnvChecked = false;
271
+ /** Reads `process.env` through `globalThis`, so this file needs no `@types/node`. */
272
+ function processEnv() {
273
+ return globalThis.process?.env ?? {};
274
+ }
275
+ /**
276
+ * Loads a dotenv file into `process.env`.
277
+ *
278
+ * Existing environment variables win, matching `node --env-file` semantics.
279
+ * Returns true only when a file was found and parsed.
280
+ */
281
+ function loadEnvFile(path) {
282
+ const runtime = globalThis;
283
+ const loader = runtime.process?.loadEnvFile;
284
+ if (typeof loader !== "function" || !existsSync(path)) return false;
285
+ try {
286
+ loader.call(runtime.process, path);
287
+ return true;
288
+ } catch {
289
+ return false;
290
+ }
291
+ }
292
+ /**
293
+ * Loads `<cwd>/.env.local` once.
294
+ *
295
+ * SvelteKit exposes `.env` values through `$env/dynamic/private`, but the AWS
296
+ * SDK's credential and region providers read `process.env` directly, so the
297
+ * file has to be applied to the process too. Run `pnpm floci:up` to create it.
298
+ */
299
+ function ensureLocalEnv(cwd) {
300
+ if (localEnvChecked) return false;
301
+ localEnvChecked = true;
302
+ const base = globalThis.process?.cwd?.();
303
+ if (base === void 0) return false;
304
+ return loadEnvFile(join(base, LOCAL_ENV_FILE));
305
+ }
306
+ /**
307
+ * Reads the effective server environment.
308
+ *
309
+ * `$env/dynamic/private` does resolve under vitest, but it is a snapshot taken
310
+ * when the module is first evaluated, so the live `process.env` map is merged
311
+ * last and wins.
312
+ */
313
+ function readEnv() {
314
+ ensureLocalEnv();
315
+ return {
316
+ ...private_env,
317
+ ...processEnv()
318
+ };
319
+ }
263
320
 
264
- export { REGION_PARAM_HINT as R, apiError as a, resolveEffectiveRegion as b, createLogsClient as c, describeAwsError as d, createStsClient as e, parseRegionParam as p, resolveAwsConfig as r };
265
- //# sourceMappingURL=aws.js-DkPqAybc.js.map
321
+ export { REGION_PARAM_HINT as R, apiError as a, readEnv as b, createStsClient as c, createLogsClient as d, resolveEffectiveRegion as e, describeAwsError as f, parseRegionParam as p, resolveAwsConfig as r };
322
+ //# sourceMappingURL=env2.js-C5BgBJDY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env2.js-C5BgBJDY.js","sources":["../../../../.svelte-kit/output/server/chunks/env2.js"],"sourcesContent":["import { t as private_env } from \"./shared-server.js\";\nimport { json } from \"@sveltejs/kit\";\nimport { CloudWatchLogsClient } from \"@aws-sdk/client-cloudwatch-logs\";\nimport { STSClient } from \"@aws-sdk/client-sts\";\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\n//#region src/lib/server/api.ts\n/**\n* Builds a JSON error response that never leaks stack traces.\n*\n* Use 400 for bad input, 502 for upstream CloudWatch Logs failures and 499\n* when the client aborted the request.\n*/\nfunction apiError(status, message, code, details) {\n\tconst body = { error: message };\n\tif (code !== void 0) body.code = code;\n\tif (details !== void 0 && details.length > 0) body.details = details;\n\treturn json(body, { status });\n}\n//#endregion\n//#region src/lib/server/aws.ts\n/**\n* Throwaway credentials for local emulators only.\n*\n* floci and LocalStack verify the request signature but accept any non-empty\n* key pair, so these keys make a local endpoint work out of the box.\n*/\nvar EMULATOR_CREDENTIALS = {\n\taccessKeyId: \"test\",\n\tsecretAccessKey: \"test\"\n};\n/** Environment variables that indicate that ambient credentials are configured. */\nvar CREDENTIAL_ENV_KEYS = [\n\t\"AWS_ACCESS_KEY_ID\",\n\t\"AWS_PROFILE\",\n\t\"AWS_SHARED_CREDENTIALS_FILE\",\n\t\"AWS_CONFIG_FILE\",\n\t\"AWS_WEB_IDENTITY_TOKEN_FILE\",\n\t\"AWS_CONTAINER_CREDENTIALS_RELATIVE_URI\",\n\t\"AWS_CONTAINER_CREDENTIALS_FULL_URI\",\n\t\"AWS_ROLE_ARN\"\n];\n/**\n* Display-only region used when nothing else can be resolved. It is never sent\n* to the SDK.\n*/\nvar FALLBACK_REGION = \"us-east-1\";\n/** User-facing hint for a malformed `region` query parameter. */\nvar REGION_PARAM_HINT = \"Invalid region: expected a region code such as us-east-1 or us-west-2-lax-1a\";\n/** Region codes and local-zone codes only: lowercase letters, digits and dashes. */\nvar REGION_PATTERN = /^[a-z0-9-]{1,64}$/;\n/** Hosts that are always considered local, including the IPv6 loopback form. */\nvar LOCAL_HOSTS = /* @__PURE__ */ new Set([\n\t\"localhost\",\n\t\"127.0.0.1\",\n\t\"0.0.0.0\",\n\t\"::1\",\n\t\"[::1]\"\n]);\n/** Substrings that identify a known local AWS emulator. */\nvar LOCAL_HINTS = [\"floci\", \"localstack\"];\nvar MAX_DETAIL_LENGTH = 300;\n/** Trims a value and treats blank strings as absent. */\nfunction normalize(value) {\n\tif (typeof value !== \"string\") return null;\n\tconst trimmed = value.trim();\n\treturn trimmed.length > 0 ? trimmed : null;\n}\n/** Extracts a lowercase host from an endpoint, tolerating missing schemes. */\nfunction hostOf(endpoint) {\n\ttry {\n\t\treturn new URL(endpoint).hostname.toLowerCase();\n\t} catch {\n\t\treturn (/^[a-z][a-z0-9+.-]*:\\/\\/([^/?#]+)/i.exec(endpoint)?.[1] ?? endpoint).toLowerCase();\n\t}\n}\n/** True when the endpoint targets a local emulator such as floci or LocalStack. */\nfunction isLocalEndpoint(endpoint) {\n\tconst host = hostOf(endpoint);\n\tif (LOCAL_HOSTS.has(host)) return true;\n\treturn LOCAL_HINTS.some((hint) => host.includes(hint));\n}\n/** True when any ambient credential source is configured (non-blank) in the environment. */\nfunction hasAmbientCredentials(env) {\n\treturn CREDENTIAL_ENV_KEYS.some((key) => normalize(env[key]) !== null);\n}\n/**\n* Resolves the region, endpoint, local flag and credential source for an AWS service.\n*\n* Region precedence: an explicit region parameter, then `AWS_REGION`, then\n* `AWS_DEFAULT_REGION`. When none of them is set the result is `null`, which\n* lets the SDK resolve the region from the ambient AWS configuration (profile,\n* SSO, instance metadata) instead of this app inventing one.\n*\n* Credentials stay `ambient` unless the endpoint is local and no ambient\n* credential source is configured at all, in which case the emulator's\n* throwaway keys are used.\n*/\nfunction resolveAwsConfig(env, regionParam, service = \"logs\") {\n\tconst endpoint = normalize(service === \"sts\" ? env.AWS_ENDPOINT_URL_STS : env.AWS_ENDPOINT_URL_LOGS) ?? normalize(env.AWS_ENDPOINT_URL);\n\tconst region = normalize(regionParam) ?? normalize(env.AWS_REGION) ?? normalize(env.AWS_DEFAULT_REGION);\n\tconst local = endpoint !== null && isLocalEndpoint(endpoint);\n\treturn {\n\t\tregion,\n\t\tendpoint,\n\t\tlocal,\n\t\tcredentials: local && !hasAmbientCredentials(env) ? \"emulator-default\" : \"ambient\"\n\t};\n}\n/**\n* Validates the optional `region` query parameter.\n*\n* A blank value means \"not supplied\" and is accepted as `null`. Any other\n* value must look like a region code or a local-zone code.\n*/\nfunction parseRegionParam(value) {\n\tconst trimmed = typeof value === \"string\" ? value.trim() : \"\";\n\tif (trimmed.length === 0) return {\n\t\tok: true,\n\t\tregion: null\n\t};\n\tif (!REGION_PATTERN.test(trimmed)) return {\n\t\tok: false,\n\t\tregion: null\n\t};\n\treturn {\n\t\tok: true,\n\t\tregion: trimmed\n\t};\n}\n/**\n* Creates a CloudWatch Logs client.\n*\n* Credentials stay ambient unless {@link AwsConfig.credentials} asks for the\n* emulator defaults: this never reads key material from the environment and\n* never sets `credentials` for a real AWS endpoint, so the SDK default provider\n* chain is used unchanged. The region is only set when the caller asked for\n* one, so the SDK can otherwise resolve it from `AWS_REGION`, the shared\n* profile or SSO.\n*/\nfunction createLogsClient(config) {\n\tconst options = { maxAttempts: 3 };\n\tif (config.region !== null) options.region = config.region;\n\tif (config.endpoint !== null) options.endpoint = config.endpoint;\n\tif (config.credentials === \"emulator-default\") options.credentials = EMULATOR_CREDENTIALS;\n\treturn new CloudWatchLogsClient(options);\n}\nasync function resolveEffectiveRegion(client, config) {\n\tif (config.region !== null) return config.region;\n\ttry {\n\t\tconst region = await client.config.region();\n\t\treturn typeof region === \"string\" && region.trim().length > 0 ? region.trim() : FALLBACK_REGION;\n\t} catch {\n\t\treturn FALLBACK_REGION;\n\t}\n}\nvar ERROR_MESSAGES = {\n\taborted: \"The CloudWatch Logs request was aborted\",\n\t\"missing-credentials\": \"AWS credentials are missing or expired\",\n\t\"missing-region\": \"No AWS region is configured. Set AWS_REGION or add a region to your AWS profile.\",\n\t\"access-denied\": \"Access denied by CloudWatch Logs\",\n\t\"not-found\": \"The CloudWatch Logs resource was not found\",\n\tunreachable: \"The CloudWatch Logs endpoint is unreachable\",\n\tthrottled: \"CloudWatch Logs is throttling requests\",\n\tunknown: \"CloudWatch Logs request failed\"\n};\n/** Codes whose message is user guidance and must not be amended with SDK text. */\nvar FIXED_MESSAGE_CODES = /* @__PURE__ */ new Set([\"missing-region\"]);\n/** Collects name, message, status and a lowercase search haystack from an error chain. */\nfunction readErrorFacts(error) {\n\tconst parts = [];\n\tlet name = \"\";\n\tlet message = \"\";\n\tlet code = \"\";\n\tlet status = null;\n\tlet current = error;\n\tfor (let depth = 0; depth < 4 && current !== null && current !== void 0; depth += 1) {\n\t\tif (current instanceof Error) {\n\t\t\tif (name === \"\") name = current.name;\n\t\t\tif (message === \"\") message = current.message;\n\t\t\tparts.push(current.name, current.message);\n\t\t} else if (typeof current === \"string\") {\n\t\t\tif (message === \"\") message = current;\n\t\t\tparts.push(current);\n\t\t} else if (typeof current === \"object\") {\n\t\t\tconst like = current;\n\t\t\tif (name === \"\" && typeof like.name === \"string\") name = like.name;\n\t\t\tif (message === \"\" && typeof like.message === \"string\") message = like.message;\n\t\t\tif (code === \"\" && typeof like.code === \"string\") code = like.code;\n\t\t\tif (status === null && typeof like.$metadata?.httpStatusCode === \"number\") status = like.$metadata.httpStatusCode;\n\t\t\tif (typeof like.name === \"string\") parts.push(like.name);\n\t\t\tif (typeof like.message === \"string\") parts.push(like.message);\n\t\t\tif (typeof like.code === \"string\") parts.push(like.code);\n\t\t\tcurrent = like.cause;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\treturn {\n\t\tname,\n\t\tmessage: message.trim(),\n\t\tcode,\n\t\tstatus,\n\t\thaystack: parts.join(\" \").toLowerCase()\n\t};\n}\n/** True when the error says that no AWS region could be resolved. */\nfunction isRegionFailure(loweredName, haystack) {\n\treturn loweredName.includes(\"regionprovider\") || loweredName.includes(\"regionnotset\") || loweredName.includes(\"missingregion\") || haystack.includes(\"region is missing\") || haystack.includes(\"region is not configured\") || haystack.includes(\"region is required\") || haystack.includes(\"missing region\") || haystack.includes(\"no region is configured\") || haystack.includes(\"region not set\") || haystack.includes(\"region must be specified\") || haystack.includes(\"region not accepted\") || haystack.includes(\"is not a valid hostname component\");\n}\n/** Maps a thrown value to a machine-readable error code. */\nfunction classify(facts) {\n\tconst { name, code, status, haystack } = facts;\n\tconst loweredName = name.toLowerCase();\n\tif (loweredName === \"aborterror\" || code === \"ABORT_ERR\" || code === \"ERR_CANCELED\") return \"aborted\";\n\tif (loweredName.includes(\"credentialsprovider\") || loweredName.includes(\"expiredtoken\") || haystack.includes(\"could not load credentials\") || haystack.includes(\"credential is expired\") || haystack.includes(\"token has expired\") || haystack.includes(\"resolve credentials\")) return \"missing-credentials\";\n\tif (isRegionFailure(loweredName, haystack)) return \"missing-region\";\n\tif (loweredName.includes(\"accessdenied\") || loweredName.includes(\"invalidclienttokenid\") || loweredName.includes(\"invalidsignature\") || loweredName.includes(\"unrecognizedclient\") || loweredName.includes(\"unauthorized\") || loweredName.includes(\"signaturedoesnotmatch\") || status === 401 || status === 403) return \"access-denied\";\n\tif (loweredName.includes(\"resourcenotfound\") || loweredName.includes(\"loggroupnotfound\") || haystack.includes(\"does not exist\") || status === 404) return \"not-found\";\n\tif (loweredName.includes(\"throttl\") || loweredName.includes(\"toomanyrequests\") || loweredName.includes(\"requestlimitexceeded\") || status === 429) return \"throttled\";\n\tif ([\n\t\t\"econnrefused\",\n\t\t\"econnreset\",\n\t\t\"enotfound\",\n\t\t\"eaiagain\",\n\t\t\"etimedout\",\n\t\t\"ehostunreach\",\n\t\t\"enetunreach\"\n\t].some((token) => haystack.includes(token)) || haystack.includes(\"connection refused\") || haystack.includes(\"socket hang up\") || haystack.includes(\"fetch failed\") || haystack.includes(\"getaddrinfo\") || haystack.includes(\"network error\") || haystack.includes(\"timeout\") || haystack.includes(\"unreachable\")) return \"unreachable\";\n\treturn \"unknown\";\n}\n/**\n* Turns a thrown SDK or network error into a short human message plus a\n* machine-readable code such as `missing-credentials`, `missing-region` or\n* `unreachable`.\n*/\nfunction describeAwsError(error) {\n\tconst facts = readErrorFacts(error);\n\tconst code = classify(facts);\n\tconst base = ERROR_MESSAGES[code] ?? ERROR_MESSAGES.unknown;\n\tif (FIXED_MESSAGE_CODES.has(code)) return {\n\t\tmessage: base,\n\t\tcode\n\t};\n\tconst detail = facts.message.length > MAX_DETAIL_LENGTH ? `${facts.message.slice(0, MAX_DETAIL_LENGTH)}...` : facts.message;\n\treturn {\n\t\tmessage: detail.length > 0 && !base.toLowerCase().includes(detail.toLowerCase()) ? `${base}: ${detail}` : base,\n\t\tcode\n\t};\n}\n/**\n* Creates an STS client with settings resolved for the STS service.\n*\n* Used for `GetCallerIdentity`, which answers the question the UI cannot: whose\n* credentials are these, if they work at all.\n*/\nfunction createStsClient(config) {\n\tconst options = {\n\t\tregion: config.region ?? void 0,\n\t\tmaxAttempts: 2\n\t};\n\tif (config.endpoint !== null) options.endpoint = config.endpoint;\n\tif (config.credentials === \"emulator-default\") options.credentials = EMULATOR_CREDENTIALS;\n\treturn new STSClient(options);\n}\n//#endregion\n//#region src/lib/server/env.ts\n/** Name of the git-ignored file that holds local (floci) connection settings. */\nvar LOCAL_ENV_FILE = \".env.local\";\nvar localEnvChecked = false;\n/** Reads `process.env` through `globalThis`, so this file needs no `@types/node`. */\nfunction processEnv() {\n\treturn globalThis.process?.env ?? {};\n}\n/**\n* Loads a dotenv file into `process.env`.\n*\n* Existing environment variables win, matching `node --env-file` semantics.\n* Returns true only when a file was found and parsed.\n*/\nfunction loadEnvFile(path) {\n\tconst runtime = globalThis;\n\tconst loader = runtime.process?.loadEnvFile;\n\tif (typeof loader !== \"function\" || !existsSync(path)) return false;\n\ttry {\n\t\tloader.call(runtime.process, path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n/**\n* Loads `<cwd>/.env.local` once.\n*\n* SvelteKit exposes `.env` values through `$env/dynamic/private`, but the AWS\n* SDK's credential and region providers read `process.env` directly, so the\n* file has to be applied to the process too. Run `pnpm floci:up` to create it.\n*/\nfunction ensureLocalEnv(cwd) {\n\tif (localEnvChecked) return false;\n\tlocalEnvChecked = true;\n\tconst base = cwd ?? globalThis.process?.cwd?.();\n\tif (base === void 0) return false;\n\treturn loadEnvFile(join(base, LOCAL_ENV_FILE));\n}\n/**\n* Reads the effective server environment.\n*\n* `$env/dynamic/private` does resolve under vitest, but it is a snapshot taken\n* when the module is first evaluated, so the live `process.env` map is merged\n* last and wins.\n*/\nfunction readEnv() {\n\tensureLocalEnv();\n\treturn {\n\t\t...private_env,\n\t\t...processEnv()\n\t};\n}\n//#endregion\nexport { createStsClient as a, resolveAwsConfig as c, createLogsClient as i, resolveEffectiveRegion as l, FALLBACK_REGION as n, describeAwsError as o, REGION_PARAM_HINT as r, parseRegionParam as s, readEnv as t, apiError as u };\n"],"names":[],"mappings":";;;;;;;AAMA;AACA;AACA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EAAE,OAAO,KAAK;AAClC,CAAC,eAAe,GAAG,IAAI;AACvB,CAAC,MAAM,IAAI,GAAU,UAAU,CAAC,OAAO,EAAE,GAAG,IAAI;AAChD,CAAC,IAAI,IAAI,KAAK,MAAM,EAAE,OAAO,KAAK;AAClC,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO,GAAG;AACnB,CAAC,cAAc,EAAE;AACjB,CAAC,OAAO;AACR,EAAE,GAAG,WAAW;AAChB,EAAE,GAAG,UAAU;AACf,EAAE;AACF;;"}
@@ -0,0 +1,22 @@
1
+ import { GetCallerIdentityCommand } from '@aws-sdk/client-sts';
2
+
3
+ //#region src/lib/server/identity.ts
4
+ /**
5
+ * `sts:GetCallerIdentity` for the resolved configuration.
6
+ *
7
+ * This is the cheapest honest answer to "do these credentials work, and whose
8
+ * are they?": one call, no permissions beyond the implicit
9
+ * `sts:GetCallerIdentity`, and it returns the ARN to show the user.
10
+ */
11
+ /** Reads the caller identity with an existing client. */
12
+ async function getCallerIdentityWith(client, options = {}) {
13
+ const response = await client.send(new GetCallerIdentityCommand({}), { abortSignal: options.signal });
14
+ return {
15
+ arn: response.Arn ?? "",
16
+ account: response.Account ?? "",
17
+ userId: response.UserId ?? ""
18
+ };
19
+ }
20
+
21
+ export { getCallerIdentityWith as g };
22
+ //# sourceMappingURL=identity.js-NmGXxBz3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js-NmGXxBz3.js","sources":["../../../../.svelte-kit/output/server/chunks/identity.js"],"sourcesContent":["import { GetCallerIdentityCommand } from \"@aws-sdk/client-sts\";\n//#region src/lib/server/identity.ts\n/**\n* `sts:GetCallerIdentity` for the resolved configuration.\n*\n* This is the cheapest honest answer to \"do these credentials work, and whose\n* are they?\": one call, no permissions beyond the implicit\n* `sts:GetCallerIdentity`, and it returns the ARN to show the user.\n*/\n/** Reads the caller identity with an existing client. */\nasync function getCallerIdentityWith(client, options = {}) {\n\tconst response = await client.send(new GetCallerIdentityCommand({}), { abortSignal: options.signal });\n\treturn {\n\t\tarn: response.Arn ?? \"\",\n\t\taccount: response.Account ?? \"\",\n\t\tuserId: response.UserId ?? \"\"\n\t};\n}\n//#endregion\nexport { getCallerIdentityWith as t };\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,EAAE,EAAE;AAC3D,CAAC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,wBAAwB,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACtG,CAAC,OAAO;AACR,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,IAAI,EAAE;AACzB,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE;AACjC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI;AAC7B,EAAE;AACF;;"}
@@ -163,7 +163,7 @@ var options = {
163
163
  app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <meta name=\"text-scale\" content=\"scale\" />\n <meta name=\"theme-color\" content=\"#0a0a0a\" />\n " + head + "\n </head>\n <body data-sveltekit-preload-data=\"hover\">\n <div style=\"display: contents\">" + body + "</div>\n </body>\n</html>\n",
164
164
  error: error_template_default
165
165
  },
166
- version_hash: "ymp2l7"
166
+ version_hash: "7ipnb"
167
167
  };
168
168
  async function get_hooks() {
169
169
  let handle;
@@ -185,4 +185,4 @@ async function get_hooks() {
185
185
  }
186
186
 
187
187
  export { get_hooks as g, options as o, read_implementation as r, set_read_implementation as s };
188
- //# sourceMappingURL=internal2.js-627EG4am.js.map
188
+ //# sourceMappingURL=internal2.js--RCssYze.js.map